Documentation
¶
Overview ¶
Package protocol is a thin compatibility shim over the authoritative github.com/scitrera/ecosystem-messaging-spec/go module. The harness consumes the spec types through these aliases so there is a single wire model across the platform; historically this package carried its own (drifted) copy.
Index ¶
- Constants
- Variables
- func ArgsToRaw(args map[string]json.RawMessage) json.RawMessage
- func RawToArgs(raw json.RawMessage) map[string]json.RawMessage
- type ChatMessage
- type ContentPart
- func NewFilePart(body FilePart) (ContentPart, error)
- func NewImagePart(body ImagePart) (ContentPart, error)
- func NewReasoningPart(text string, redacted bool) (ContentPart, error)
- func NewSubagentPart(body SubagentPart) (ContentPart, error)
- func NewTextPart(text string) (ContentPart, error)
- func NewToolCallPart(env ToolInvokeEnvelope) (ContentPart, error)
- func NewToolResultPart(callID, name string, output json.RawMessage, isError bool) (ContentPart, error)
- type ContentPartType
- type ExecutionBinding
- type ExecutionSite
- type FilePart
- type ImagePart
- type MessageAddress
- type MessageRef
- type ReasoningPart
- type Role
- type SubagentPart
- type SubagentStatus
- type ToolCallPartBody
- type ToolError
- type ToolInvokeEnvelope
- type ToolReference
- type ToolResultPartBody
- type WorkspaceViewDescriptor
- type WorkspaceViewKind
Constants ¶
const ( ExecutionSiteClient = spec.ExecutionSiteClient ExecutionSiteWorker = spec.ExecutionSiteWorker ExecutionSiteRemote = spec.ExecutionSiteRemote WorkspaceViewKindDirectory = spec.WorkspaceViewKindDirectory WorkspaceViewKindGitWorktree = spec.WorkspaceViewKindGitWorktree WorkspaceViewKindCheckout = spec.WorkspaceViewKindCheckout WorkspaceViewKindSnapshot = spec.WorkspaceViewKindSnapshot WorkspaceViewKindOverlay = spec.WorkspaceViewKindOverlay )
const ( RoleSystem = spec.RoleSystem RoleUser = spec.RoleUser RoleAssistant = spec.RoleAssistant RoleTool = spec.RoleTool // RoleToolResult is a harness-internal marker for persisted tool-result // messages. It is NOT a spec role (the spec models tool results as // tool_result content parts). Retained to preserve existing turn behavior; // migrating the turn engine off it is tracked separately. RoleToolResult Role = "tool_result" )
const ( ContentText = spec.PartText ContentReasoning = spec.PartReasoning ContentImage = spec.PartImage ContentFile = spec.PartFile ContentCitation = spec.PartCitation ContentDynamic = spec.PartDynamic ContentToolCall = spec.PartToolCall ContentToolResult = spec.PartToolResult ContentSubagent = spec.PartSubagent ContentFeedback = spec.PartFeedback ContentControl = spec.PartControl )
const ( SubagentPending = spec.SubagentPending SubagentRunning = spec.SubagentRunning SubagentCompleted = spec.SubagentCompleted SubagentFailed = spec.SubagentFailed SubagentCancelled = spec.SubagentCancelled )
Subagent lifecycle statuses, re-exported from the spec.
Variables ¶
var ErrInvalidContentPart = spec.ErrInvalidContentPart
ErrInvalidContentPart is re-exported from the spec.
Functions ¶
func ArgsToRaw ¶
func ArgsToRaw(args map[string]json.RawMessage) json.RawMessage
ArgsToRaw encodes a spec args map as a single JSON object (the harness's internal argument representation).
func RawToArgs ¶
func RawToArgs(raw json.RawMessage) map[string]json.RawMessage
RawToArgs decodes a JSON object into a spec args map.
Types ¶
type ContentPart ¶
type ContentPart = spec.ContentPart
Authoritative spec types, re-exported.
func NewFilePart ¶
func NewFilePart(body FilePart) (ContentPart, error)
NewFilePart builds a file content part.
func NewImagePart ¶
func NewImagePart(body ImagePart) (ContentPart, error)
NewImagePart builds an image content part (keeps the harness's historical (ContentPart, error) signature; the spec constructor cannot fail).
func NewReasoningPart ¶ added in v0.0.2
func NewReasoningPart(text string, redacted bool) (ContentPart, error)
NewReasoningPart builds a model-reasoning content part.
func NewSubagentPart ¶
func NewSubagentPart(body SubagentPart) (ContentPart, error)
NewSubagentPart builds a subagent reference part (keeps the harness's historical (ContentPart, error) signature; the spec constructor cannot fail). It defaults Status to SubagentPending when unset. AsSubagent (a method on the aliased ContentPart) reads it back.
func NewTextPart ¶
func NewTextPart(text string) (ContentPart, error)
NewTextPart builds a text content part. It keeps the harness's historical (ContentPart, error) signature; the spec constructor cannot fail.
func NewToolCallPart ¶
func NewToolCallPart(env ToolInvokeEnvelope) (ContentPart, error)
NewToolCallPart builds a spec tool_call part from an invoke envelope.
func NewToolResultPart ¶
func NewToolResultPart(callID, name string, output json.RawMessage, isError bool) (ContentPart, error)
NewToolResultPart builds a spec tool_result part; the payload is carried in the spec "output" field.
type ExecutionBinding ¶ added in v0.0.2
type ExecutionBinding = spec.ExecutionBinding
Authoritative spec types, re-exported.
type ExecutionSite ¶ added in v0.0.2
type ExecutionSite = spec.ExecutionSite
Authoritative spec types, re-exported.
type MessageAddress ¶
type MessageAddress = spec.MessageAddress
Authoritative spec types, re-exported.
type ReasoningPart ¶ added in v0.0.2
type ReasoningPart = spec.ReasoningPart
Authoritative spec types, re-exported.
type SubagentStatus ¶
type SubagentStatus = spec.SubagentStatus
Authoritative spec types, re-exported.
type ToolCallPartBody ¶
type ToolCallPartBody = spec.ToolCallPartBody
Authoritative spec types, re-exported.
type ToolInvokeEnvelope ¶
type ToolInvokeEnvelope = spec.ToolInvokeEnvelope
Authoritative spec types, re-exported.
func ToolCallFromPart ¶
func ToolCallFromPart(p ContentPart) (ToolInvokeEnvelope, bool)
ToolCallFromPart extracts an invoke envelope from a tool_call content part. The spec tool_call part uses "id" for the call id; it is mapped to envelope.CallID.
type ToolReference ¶ added in v0.0.2
type ToolReference = spec.ToolReference
Authoritative spec types, re-exported.
type ToolResultPartBody ¶
type ToolResultPartBody = spec.ToolResultPartBody
Authoritative spec types, re-exported.
type WorkspaceViewDescriptor ¶ added in v0.0.2
type WorkspaceViewDescriptor = spec.WorkspaceViewDescriptor
Authoritative spec types, re-exported.
type WorkspaceViewKind ¶ added in v0.0.2
type WorkspaceViewKind = spec.WorkspaceViewKind
Authoritative spec types, re-exported.