wire

package
v0.4.0-rc.30 Latest Latest
Warning

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

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

Documentation

Overview

Package wire defines the internal JSON protocol exchanged by agent runtimes and Airlock. It is not the author-facing Agents SDK API.

Index

Constants

View Source
const (
	ErrorKindPlatform = "platform"
	ErrorKindAgent    = "agent"
)

Variables

This section is empty.

Functions

func ResolveDisplayPart

func ResolveDisplayPart(part *DisplayPart)

Types

type Access

type Access string
const (
	AccessAdmin  Access = "admin"
	AccessUser   Access = "user"
	AccessPublic Access = "public"
)

type Action

type Action struct {
	Type       string    `json:"type"`
	Timestamp  time.Time `json:"timestamp"`
	DurationMs int64     `json:"durationMs"`
	Request    any       `json:"request,omitempty"`
	Response   any       `json:"response,omitempty"`
	Error      string    `json:"error,omitempty"`
}

type AuthInjection

type AuthInjection struct {
	Type AuthInjectionType `json:"type"`
	Name string            `json:"name,omitempty"`
}

type AuthInjectionType

type AuthInjectionType string
const (
	AuthInjectBearer     AuthInjectionType = "bearer"
	AuthInjectAPIKey     AuthInjectionType = "api_key_header"
	AuthInjectPathPrefix AuthInjectionType = "path_prefix"
	AuthInjectQueryParam AuthInjectionType = "query_param"
)

type Capabilities

type Capabilities struct {
	Vision        bool `json:"vision,omitempty"`
	Transcription bool `json:"transcription,omitempty"`
	Speech        bool `json:"speech,omitempty"`
	Embedding     bool `json:"embedding,omitempty"`
	Image         bool `json:"image,omitempty"`
	Search        bool `json:"search,omitempty"`
}

type ConnectionAuth

type ConnectionAuth string
const (
	ConnectionAuthOAuth ConnectionAuth = "oauth"
	ConnectionAuthToken ConnectionAuth = "token"
	ConnectionAuthNone  ConnectionAuth = "none"
)

type ConnectionDef

type ConnectionDef struct {
	Slug              string            `json:"slug,omitempty"`
	Name              string            `json:"name"`
	Description       string            `json:"description"`
	BaseURL           string            `json:"baseUrl,omitempty"`
	AuthMode          ConnectionAuth    `json:"authMode"`
	AuthURL           string            `json:"authUrl,omitempty"`
	TokenURL          string            `json:"tokenUrl,omitempty"`
	Scopes            []string          `json:"scopes,omitempty"`
	AuthParams        map[string]string `json:"authParams,omitempty"`
	Headers           map[string]string `json:"headers,omitempty"`
	AuthInjection     AuthInjection     `json:"authInjection"`
	SetupInstructions string            `json:"setupInstructions,omitempty"`
	LLMHint           string            `json:"llmHint,omitempty"`
	Access            Access            `json:"access,omitempty"`
}

type CreateRunRequest

type CreateRunRequest struct {
	TriggerType string `json:"triggerType"`
	TriggerRef  string `json:"triggerRef"`
}

type CreateRunResponse

type CreateRunResponse struct {
	RunID string `json:"runId"`
}

type DirectoryDef

type DirectoryDef struct {
	Path           string         `json:"path"`
	Read           Access         `json:"read"`
	Write          Access         `json:"write"`
	List           Access         `json:"list"`
	Description    string         `json:"description"`
	LLMHint        string         `json:"llmHint,omitempty"`
	RetentionHours int            `json:"retentionHours,omitempty"`
	Scope          DirectoryScope `json:"scope,omitempty"`
}

type DirectoryScope

type DirectoryScope string

type DisplayPart

type DisplayPart struct {
	Type     string  `json:"type"`
	Text     string  `json:"text,omitempty"`
	Source   string  `json:"source,omitempty"`
	URL      string  `json:"url,omitempty"`
	Data     []byte  `json:"data,omitempty"`
	Filename string  `json:"filename,omitempty"`
	MimeType string  `json:"mimeType,omitempty"`
	Alt      string  `json:"alt,omitempty"`
	Duration float64 `json:"duration,omitempty"`
}

type EnvVarDef

type EnvVarDef struct {
	Slug        string `json:"slug,omitempty"`
	Description string `json:"description"`
	Secret      bool   `json:"secret"`
	Default     string `json:"default,omitempty"`
	Pattern     string `json:"pattern,omitempty"`
}

type EnvVarValueResponse

type EnvVarValueResponse struct {
	Value string `json:"value"`
}

type ExecEndpointDef

type ExecEndpointDef struct {
	Slug        string `json:"slug,omitempty"`
	Description string `json:"description"`
	LLMHint     string `json:"llmHint,omitempty"`
	Access      Access `json:"access,omitempty"`
}

type ExecRequest

type ExecRequest struct {
	Command   string   `json:"command"`
	Args      []string `json:"args,omitempty"`
	StdinB64  string   `json:"stdinB64,omitempty"`
	TimeoutMs int64    `json:"timeoutMs,omitempty"`
}

type FileInfo

type FileInfo struct {
	Path         string    `json:"path"`
	Filename     string    `json:"filename"`
	ContentType  string    `json:"contentType"`
	Size         int64     `json:"size"`
	LastModified time.Time `json:"lastModified"`
}

type HTTPRequest

type HTTPRequest struct {
	URL        string            `json:"url"`
	Method     string            `json:"method,omitempty"`
	Headers    map[string]string `json:"headers,omitempty"`
	Body       string            `json:"body,omitempty"`
	Timeout    int               `json:"timeout,omitempty"`
	SaveAs     string            `json:"saveAs,omitempty"`
	Raw        bool              `json:"raw,omitempty"`
	AllHeaders bool              `json:"allHeaders,omitempty"`
}

type HTTPResponse

type HTTPResponse struct {
	Status      int               `json:"status"`
	Headers     map[string]string `json:"headers"`
	Body        string            `json:"body,omitempty"`
	ContentType string            `json:"contentType"`
	Size        int               `json:"size"`
	BodyPreview string            `json:"bodyPreview,omitempty"`
	SavedTo     string            `json:"savedTo,omitempty"`
	Note        string            `json:"note,omitempty"`
}

type InstructionDef

type InstructionDef struct {
	Text   string   `json:"text"`
	Access []Access `json:"access,omitempty"`
}

type LLMProxyRequest

type LLMProxyRequest struct {
	Slug       string          `json:"slug,omitempty"`
	Capability string          `json:"capability,omitempty"`
	Options    json.RawMessage `json:"options"`
}

type LogEntry

type LogEntry struct {
	Level   LogLevel `json:"level"`
	Message string   `json:"message"`
}

type LogLevel

type LogLevel string
const (
	LogLevelDebug LogLevel = "debug"
	LogLevelInfo  LogLevel = "info"
	LogLevelWarn  LogLevel = "warn"
	LogLevelError LogLevel = "error"
)

type MCPAuth

type MCPAuth string
const (
	MCPAuthOAuth          MCPAuth = "oauth"
	MCPAuthOAuthDiscovery MCPAuth = "oauth_discovery"
	MCPAuthToken          MCPAuth = "token"
	MCPAuthNone           MCPAuth = "none"
)

type MCPAuthStatus

type MCPAuthStatus struct {
	Slug         string  `json:"slug"`
	AuthMode     MCPAuth `json:"authMode"`
	Authorized   bool    `json:"authorized"`
	AuthURL      string  `json:"authUrl,omitempty"`
	Instructions string  `json:"instructions,omitempty"`
}

type MCPContent

type MCPContent struct {
	Type     string `json:"type"`
	Text     string `json:"text,omitempty"`
	URI      string `json:"uri,omitempty"`
	Name     string `json:"name,omitempty"`
	MimeType string `json:"mimeType,omitempty"`
	Data     string `json:"data,omitempty"`
}

type MCPDef

type MCPDef struct {
	Slug          string        `json:"slug,omitempty"`
	Name          string        `json:"name"`
	URL           string        `json:"url"`
	AuthMode      MCPAuth       `json:"authMode"`
	AuthURL       string        `json:"authUrl,omitempty"`
	TokenURL      string        `json:"tokenUrl,omitempty"`
	Scopes        []string      `json:"scopes,omitempty"`
	AuthInjection AuthInjection `json:"authInjection"`
	Access        Access        `json:"access,omitempty"`
}

type MCPToolCallRequest

type MCPToolCallRequest struct {
	Tool      string          `json:"tool"`
	Arguments json.RawMessage `json:"arguments"`
}

type MCPToolCallResponse

type MCPToolCallResponse struct {
	Content []MCPContent `json:"content"`
	IsError bool         `json:"isError"`
}

type MCPToolSchema

type MCPToolSchema struct {
	ServerSlug  string          `json:"serverSlug"`
	Name        string          `json:"name"`
	Description string          `json:"description"`
	InputSchema json.RawMessage `json:"inputSchema"`
}

type ModelProxyRequest

type ModelProxyRequest struct {
	Slug       string          `json:"slug,omitempty"`
	Capability string          `json:"capability"`
	Options    json.RawMessage `json:"options"`
}

type ModelSlotDef

type ModelSlotDef struct {
	Slug        string `json:"slug"`
	Capability  string `json:"capability"`
	Description string `json:"description,omitempty"`
}

type PrintRequest

type PrintRequest struct {
	Parts          []DisplayPart `json:"parts"`
	Topic          string        `json:"topic,omitempty"`
	ConversationID string        `json:"conversationId,omitempty"`
	RunID          string        `json:"runId,omitempty"`
	UserID         string        `json:"userId,omitempty"`
}

type PromptData

type PromptData struct {
	AgentDashboardURL   string        `json:"agentDashboardUrl"`
	AgentRouteURL       string        `json:"agentRouteUrl"`
	Siblings            []SiblingInfo `json:"siblings,omitempty"`
	Capabilities        Capabilities  `json:"capabilities,omitempty"`
	SupportedModalities []string      `json:"supportedModalities,omitempty"`
}

type PromptInput

type PromptInput struct {
	Messages         []message.Message `json:"messages"`
	Message          string            `json:"message,omitempty"`
	ConversationID   string            `json:"conversationId,omitempty"`
	ProviderID       string            `json:"providerId,omitempty"`
	ModelID          string            `json:"modelId,omitempty"`
	Temperature      *float64          `json:"temperature,omitempty"`
	MaxOutputTokens  *int              `json:"maxOutputTokens,omitempty"`
	ProviderOptions  json.RawMessage   `json:"providerOptions,omitempty"`
	Files            []FileInfo        `json:"files,omitempty"`
	ResumeRunID      string            `json:"resumeRunId,omitempty"`
	Approved         *bool             `json:"approved,omitempty"`
	Source           string            `json:"source,omitempty"`
	ExpectedSyncHash string            `json:"expectedSyncHash,omitempty"`
	Instructions     string            `json:"instructions,omitempty"`
	CallerAccess     Access            `json:"callerAccess,omitempty"`
	VisibleSiblings  []uuid.UUID       `json:"visibleSiblings,omitempty"`
	ForceCompact     bool              `json:"forceCompact,omitempty"`
	AutoConfirm      bool              `json:"autoConfirm,omitempty"`
	DirectTools      bool              `json:"directTools,omitempty"`
	Platform         string            `json:"platform,omitempty"`
	UserDisplayName  string            `json:"userDisplayName,omitempty"`
	UserEmail        string            `json:"userEmail,omitempty"`
}

type ProxyRequest

type ProxyRequest struct {
	Method  string            `json:"method"`
	Path    string            `json:"path"`
	Body    string            `json:"body,omitempty"`
	Headers map[string]string `json:"headers,omitempty"`
}

type RouteDef

type RouteDef struct {
	Path        string `json:"path"`
	Method      string `json:"method"`
	Access      Access `json:"access"`
	Description string `json:"description,omitempty"`
}

type RunCompleteRequest

type RunCompleteRequest struct {
	RunID      string          `json:"runId"`
	Status     string          `json:"status"`
	Error      string          `json:"error,omitempty"`
	ErrorKind  string          `json:"errorKind,omitempty"`
	PanicTrace string          `json:"panicTrace,omitempty"`
	Actions    []Action        `json:"actions"`
	Logs       []LogEntry      `json:"logs,omitempty"`
	Checkpoint json.RawMessage `json:"checkpoint,omitempty"`
}

type ScheduleAtRequest

type ScheduleAtRequest struct {
	Slug   string    `json:"slug"`
	FireAt time.Time `json:"fireAt"`
}

type ScheduleHandlerDef

type ScheduleHandlerDef struct {
	Slug        string `json:"slug"`
	Kind        string `json:"kind"`
	Recurrence  string `json:"recurrence,omitempty"`
	TimeoutMs   int64  `json:"timeoutMs"`
	Description string `json:"description,omitempty"`
}

type ScheduledFire

type ScheduledFire struct {
	ID         string    `json:"id"`
	Slug       string    `json:"slug"`
	Kind       string    `json:"kind"`
	FireAt     time.Time `json:"fireAt"`
	Status     string    `json:"status"`
	Recurrence string    `json:"recurrence,omitempty"`
}

type SealRequest

type SealRequest struct {
	Plaintext string `json:"plaintext"`
}

type SealResponse

type SealResponse struct {
	Sealed string `json:"sealed"`
}

type SearchProxyRequest

type SearchProxyRequest struct {
	Slug       string `json:"slug,omitempty"`
	Capability string `json:"capability,omitempty"`
	websearch.Request
}

type SessionCompactRequest

type SessionCompactRequest struct {
	Summary     []session.Message `json:"summary"`
	TokensFreed int               `json:"tokensFreed"`
}

type ShareFileRequest

type ShareFileRequest struct {
	Path           string `json:"path"`
	ExpiresSeconds int64  `json:"expiresSeconds,omitempty"`
}

type ShareFileResponse

type ShareFileResponse struct {
	URL         string `json:"url"`
	ExpiresAtMs int64  `json:"expiresAtMs"`
}

type SiblingInfo

type SiblingInfo struct {
	ID          uuid.UUID       `json:"id"`
	Slug        string          `json:"slug"`
	Name        string          `json:"name"`
	Description string          `json:"description,omitempty"`
	Tools       []MCPToolSchema `json:"tools,omitempty"`
}

type SyncRequest

type SyncRequest struct {
	Version          string               `json:"version"`
	Description      string               `json:"description,omitempty"`
	Emoji            string               `json:"emoji,omitempty"`
	Tools            []ToolDef            `json:"tools,omitempty"`
	Webhooks         []WebhookDef         `json:"webhooks"`
	ScheduleHandlers []ScheduleHandlerDef `json:"scheduleHandlers"`
	Routes           []RouteDef           `json:"routes,omitempty"`
	Topics           []TopicDef           `json:"topics,omitempty"`
	MCPServers       []MCPDef             `json:"mcpServers,omitempty"`
	Connections      []ConnectionDef      `json:"connections,omitempty"`
	ExecEndpoints    []ExecEndpointDef    `json:"execEndpoints,omitempty"`
	EnvVars          []EnvVarDef          `json:"envVars,omitempty"`
	Directories      []DirectoryDef       `json:"directories,omitempty"`
	Instructions     []InstructionDef     `json:"instructions,omitempty"`
	ModelSlots       []ModelSlotDef       `json:"modelSlots,omitempty"`
}

type SyncResponse

type SyncResponse struct {
	PromptData        PromptData                 `json:"promptData"`
	MCPAuthStatus     []MCPAuthStatus            `json:"mcpAuthStatus,omitempty"`
	MCPSchemas        map[string][]MCPToolSchema `json:"mcpSchemas,omitempty"`
	PublicStorageBase string                     `json:"publicStorageBase,omitempty"`
	SyncStateHash     string                     `json:"syncStateHash,omitempty"`
}

type ToolDef

type ToolDef struct {
	Name          string            `json:"name"`
	Description   string            `json:"description"`
	LLMHint       string            `json:"llmHint,omitempty"`
	Access        Access            `json:"access"`
	InputSchema   json.RawMessage   `json:"inputSchema,omitempty"`
	OutputSchema  json.RawMessage   `json:"outputSchema,omitempty"`
	InputExamples []json.RawMessage `json:"inputExamples,omitempty"`
}

type TopicDef

type TopicDef struct {
	Slug        string `json:"slug"`
	Description string `json:"description"`
	LLMHint     string `json:"llmHint,omitempty"`
	Access      Access `json:"access"`
	PerUser     bool   `json:"perUser,omitempty"`
}

type UnsealRequest

type UnsealRequest struct {
	Sealed string `json:"sealed"`
}

type UnsealResponse

type UnsealResponse struct {
	Plaintext string `json:"plaintext"`
}

type WebhookDef

type WebhookDef struct {
	Path        string `json:"path"`
	Verify      string `json:"verify"`
	Header      string `json:"header,omitempty"`
	TimeoutMs   int64  `json:"timeoutMs"`
	Description string `json:"description,omitempty"`
}

Jump to

Keyboard shortcuts

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