protocol

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

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

View Source
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
)
View Source
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"
)
View Source
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
)
View Source
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

View Source
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 ChatMessage

type ChatMessage = spec.ChatMessage

Authoritative spec types, re-exported.

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 ContentPartType

type ContentPartType = spec.PartType

Authoritative spec types, re-exported.

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 FilePart

type FilePart = spec.FilePart

Authoritative spec types, re-exported.

type ImagePart

type ImagePart = spec.ImagePart

Authoritative spec types, re-exported.

type MessageAddress

type MessageAddress = spec.MessageAddress

Authoritative spec types, re-exported.

type MessageRef

type MessageRef = spec.MessageRef

Authoritative spec types, re-exported.

type ReasoningPart added in v0.0.2

type ReasoningPart = spec.ReasoningPart

Authoritative spec types, re-exported.

type Role

type Role = spec.Role

Authoritative spec types, re-exported.

type SubagentPart

type SubagentPart = spec.SubagentPart

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 ToolError

type ToolError = spec.ToolError

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.

Jump to

Keyboard shortcuts

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