protocol

package
v0.2.62 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	InboundRawTextMetadataKey        = "rocketclaw_raw_text"
	InboundOriginMetadataKey         = "rocketclaw_origin"
	InboundMediaMetadataKey          = "rocketclaw_media"
	InboundPrincipalMetadataKey      = "rocketclaw_principal"
	InboundPrincipalNameMetadataKey  = "rocketclaw_principal_name"
	InboundPrincipalEmailMetadataKey = "rocketclaw_principal_email"
	InboundAllowedAgentsMetadataKey  = "rocketclaw_allowed_agents"
	InboundSenderSessionMetadataKey  = "rocketclaw_sender_session"
	InboundSenderAgentMetadataKey    = "rocketclaw_sender_agent"
	InboundSenderActionMetadataKey   = "rocketclaw_sender_action"
	SenderActionStopped              = "stopped"
)
View Source
const GoalCommandHelp = `` /* 252-byte string literal not displayed */
View Source
const MaxInboundTextAttachmentBytes = 256 << 10

Variables

View Source
var ErrBridgeStopped = errors.New("bridge stopped")
View Source
var ErrGoalAlreadyActive = errors.New("goal already active")

Functions

func Clone added in v0.1.0

func Clone[T any](p *T) *T

func IsTextAttachment

func IsTextAttachment(name, normalizedMIME string) bool

func NormalizeMIMEType added in v0.1.0

func NormalizeMIMEType(mimeType string) string

func SetInboundAllowedAgents

func SetInboundAllowedAgents(inbound *InboundMessage, agents []string)

func SlackThreadConversationID

func SlackThreadConversationID(channelID, threadTS string) string

func SlackThreadSessionID added in v0.2.48

func SlackThreadSessionID(channelID, threadTS, agent string) string

func StraightenImage added in v0.2.59

func StraightenImage(mimeType, data string) (uprightMIMEType, upright string, err error)

Types

type AskUserQuestionAnswer

type AskUserQuestionAnswer struct {
	Selected []string `json:"selected"`
	Custom   string   `json:"custom"`
	Source   Source   `json:"source"`
}

type AskUserQuestionOption

type AskUserQuestionOption struct{ Label, Value, Description string }

type AskUserQuestionRequest

type AskUserQuestionRequest struct {
	ID, Question, Details string
	ConversationID        string
	Options               []AskUserQuestionOption
	Multiple              bool
}

type AttachmentPresence added in v0.1.12

type AttachmentPresence string
const (
	AttachmentPresenceNone        AttachmentPresence = ""
	AttachmentPresenceUnsupported AttachmentPresence = "unsupported"
	AttachmentPresenceImages      AttachmentPresence = "images"
)

type BackgroundJob added in v0.1.19

type BackgroundJob struct {
	ID, Kind, State, Label, ToolCallID, SubagentKey, StoppedBy, Note string
	Hidden                                                           bool
}

type Conversation added in v0.1.0

type Conversation struct {
	ID, Agent, CreatedBy, Space string
	Run                         *CronRun
}

type ConversationChange added in v0.1.12

type ConversationChange struct {
	ConversationID string `json:"conversationId"`
	Revision       string `json:"revision"`
}

type CronRun added in v0.2.0

type CronRun struct {
	Path   string
	At     time.Time
	OneOff bool
}

type CronRunResult

type CronRunResult struct {
	ConversationID string
	Reported       bool
}

type CronjobMessage

type CronjobMessage struct {
	RelativePath, Agent, RanAt string
	Space                      string
}

type Event added in v0.1.0

type Event struct {
	Message         *OutboundMessage
	Acknowledgement chan error
}

type GoalAction added in v0.1.12

type GoalAction string
const (
	GoalActionNone     GoalAction = ""
	GoalActionKickoff  GoalAction = "goal"
	GoalActionContinue GoalAction = "goal_continuation"
)

type GoalRequest

type GoalRequest struct {
	Objective string
	MaxTurns  int
}

func ParseGoalRequest

func ParseGoalRequest(text string) (goal GoalRequest, rejection string)

type InboundAttachment

type InboundAttachment struct {
	Name, MIMEType string
	Data           []byte
}

type InboundContent

type InboundContent struct {
	Text               string
	TextAttachments    []string
	Attachments        []InboundAttachment
	AttachmentPresence AttachmentPresence
	AttachmentWarnings []string
}

type InboundKind

type InboundKind string
const (
	InboundKindPrompt  InboundKind = "prompt"
	InboundKindSteer   InboundKind = "steer"
	InboundKindEnqueue InboundKind = "enqueue"
	InboundKindHeld    InboundKind = "held"
	InboundKindCancel  InboundKind = "cancel"
)

type InboundMessage

type InboundMessage struct {
	Source                Source
	Text                  string
	Attachments           []InboundAttachment
	SlackReply            *SlackReplyTarget
	AttachmentPresence    AttachmentPresence
	Human                 bool
	GoalTurn              bool
	AttachmentWarnings    []string
	Kind                  InboundKind
	GoalAction            GoalAction
	PreserveWhitespace    bool
	ConversationID        string
	Metadata              map[string]string
	ExternalMCPMetadata   map[string]string
	SyncDestination       string
	RequireOutputDecision bool
	Cronjob               *CronjobMessage
	OriginHeader          string
	SlackRoot             *InboundMessage `json:"-"`
	// contains filtered or unexported fields
}

func NewInboundMessage

func NewInboundMessage(source Source, kind InboundKind, text string, human bool) *InboundMessage

func NewInboundMessageFromContent

func NewInboundMessageFromContent(source Source, kind InboundKind, content *InboundContent, human bool) *InboundMessage

func (*InboundMessage) CompleteResponseWithAttachments

func (m *InboundMessage) CompleteResponseWithAttachments(text string, attachments []OutboundAttachment, err error)

func (*InboundMessage) EnableResponseWait

func (m *InboundMessage) EnableResponseWait() <-chan InboundResponse

type InboundResponse

type InboundResponse struct {
	Text        string
	Attachments []OutboundAttachment
	Err         error
}

type LaterWorkKind

type LaterWorkKind string
const (
	LaterWorkQueued    LaterWorkKind = "queued"
	LaterWorkScheduled LaterWorkKind = "scheduled"
)

type LaterWorkRow

type LaterWorkRow struct {
	Kind        LaterWorkKind
	Queue       ThreadQueueItem
	ScheduledID string
	Scheduled   ScheduledMessageState
}

func MixedLaterWork

func MixedLaterWork(queue []ThreadQueueItem, scheduled map[string]ScheduledMessageState) []LaterWorkRow

type OneOffCronjob

type OneOffCronjob struct {
	Agent, Prompt, RelativePath, Space string
	ConversationID                     string
}

type OutboundAttachment

type OutboundAttachment struct {
	ID                 string
	ConversationID     string `json:"conversation_id,omitempty"`
	Name, MIMEType     string
	Data               []byte `json:"-"`
	OriginalUnverified bool
	Size               int64
}

func CloneOutboundAttachments

func CloneOutboundAttachments(attachments []OutboundAttachment) []OutboundAttachment

type OutboundMessage

type OutboundMessage struct {
	ConsumedID, ConsumedText           string
	ConsumedHeader                     string
	ConsumedRawText                    string
	ConsumedSource                     Source
	Text                               string
	ConversationID, TurnID             string
	Agent                              string
	Model, SourceConversationID        string
	ReasoningEffort                    *string
	Cronjob                            *CronjobMessage
	Complete                           bool
	SlackReply                         *SlackReplyTarget
	Attachments                        []OutboundAttachment
	GoalTurn, GoalComplete, GoalActive bool
	GoalTurnNumber, GoalMaxTurns       int
	Terminal                           Terminal
	ChannelQuiet                       bool
}

func CloneOutboundMessage

func CloneOutboundMessage(message *OutboundMessage) *OutboundMessage

func NewOutboundMessage

func NewOutboundMessage(conversationID, text string) *OutboundMessage

type OutboundPublisher

type OutboundPublisher interface {
	PublishOutbound(context.Context, *OutboundMessage) error
}

type PrimaryTextRouter

type PrimaryTextRouter interface {
	MentionThread(target TextConversationTarget) (recorded, report bool, err error)
	SubmitMention(ctx context.Context, agent string, target TextConversationTarget, inbound *InboundMessage) (bool, error)
	InterruptTurn(ctx context.Context, turnID string) error
	WebURL(conversationID string) (string, error)
}

type ScheduledMessageState

type ScheduledMessageState struct {
	ConversationID string        `json:"conversation_id,omitempty"`
	Agent          string        `json:"agent,omitempty"`
	Message        string        `json:"message,omitempty"`
	DueAt          time.Time     `json:"due_at,omitzero"`
	Recurring      bool          `json:"recurring,omitempty"`
	Interval       time.Duration `json:"interval,omitempty"`
	Origin         string        `json:"origin,omitempty"`
}

type SessionSummary added in v0.1.0

type SessionSummary struct {
	ConversationID, LastMessage string
	LastUpdated                 time.Time
}

type ShadowBinding added in v0.1.33

type ShadowBinding struct {
	ParentConversationID, ParentAgent, ShadowAgent, ChildConversationID string
	Turns                                                               []ShadowTurn
}

type ShadowTurn added in v0.1.33

type ShadowTurn struct {
	ParentSourceConversationID, ParentTurnID, ChildTurnID string
	Order                                                 int64
	Running                                               bool
	Terminal                                              Terminal
	Revision                                              string
}

type SlackReplyTarget

type SlackReplyTarget struct{ ChannelID, MessageTS, ThreadTS string }

type Source

type Source string
const (
	SourceSlack       Source = "slack"
	SourceWeb         Source = "web"
	SourceExternalMCP Source = "external_mcp"
	SourceSystem      Source = "system"
)

type Terminal

type Terminal string
const (
	TerminalComplete Terminal = "complete"
	TerminalFailed   Terminal = "failed"
	TerminalStopped  Terminal = "stopped"
)

type TextConversationTarget

type TextConversationTarget struct{ ChannelID, MessageID, ThreadID, Agent string }

type ThreadQueueItem

type ThreadQueueItem struct {
	Kind           InboundKind
	ID             string
	ConversationID string
	Message        string
	Content        InboundContent
	Source         Source
	SlackReply     *SlackReplyTarget
	Principal      string
	StashAt        time.Time
	Position       int
	ParkAfter      string
	SlackChannel   string
	SlackTS        string
	Inbound        *InboundMessage
}

type TurnProgress added in v0.2.26

type TurnProgress struct {
	Running, Asking bool
	Steps           []TurnStep
}

type TurnStep added in v0.2.26

type TurnStep struct {
	ID, Title string
	State     TurnStepState
}

type TurnStepState added in v0.2.26

type TurnStepState string
const (
	TurnStepRunning TurnStepState = "running"
	TurnStepDone    TurnStepState = "done"
	TurnStepFailed  TurnStepState = "failed"
)

type UserQuestionAsker

type UserQuestionAsker interface {
	AskUserQuestion(context.Context, *AskUserQuestionRequest) (AskUserQuestionAnswer, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL