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
- func ResolveDisplayPart(part *DisplayPart)
- type Access
- type Action
- type AgentManifest
- type AuthInjection
- type AuthInjectionType
- type Capabilities
- type ConnectionAuth
- type ConnectionDef
- type CreateRunRequest
- type CreateRunResponse
- type DirectoryDef
- type DirectoryScope
- type DisplayPart
- type EnqueueJobErrorResponse
- type EnqueueJobRequest
- type EnqueueJobResponse
- type EnvVarDef
- type EnvVarValueResponse
- type FileInfo
- type GetJobResponse
- type HTTPRequest
- type HTTPResponse
- type InstructionDef
- type JobCronDef
- type JobHandlerDef
- type JobInfo
- type JobManifest
- type JobProgress
- type JobRunRequest
- type JobRunResponse
- type LLMProxyRequest
- type ListJobsResponse
- type LogEntry
- type LogLevel
- type MCPAuth
- type MCPAuthStatus
- type MCPContent
- type MCPDef
- type MCPToolCallRequest
- type MCPToolCallResponse
- type MCPToolSchema
- type ModelProxyRequest
- type ModelSlotDef
- type PrintRequest
- type PromptData
- type PromptInput
- type ProxyRequest
- type RouteDef
- type RunCompleteRequest
- type SealRequest
- type SealResponse
- type SearchProxyRequest
- type SessionAppendRequest
- type SessionAppendResponse
- type SessionCompactRequest
- type SessionCompactResponse
- type SessionLoadResponse
- type ShareFileRequest
- type ShareFileResponse
- type SiblingInfo
- type StartupHookDef
- type StaticAssetDef
- type SyncRequest
- type SyncResponse
- type ToolDef
- type TopicDef
- type UnsealRequest
- type UnsealResponse
- type UpdateJobProgressRequest
- type WebhookDef
Constants ¶
const ( ErrorKindPlatform = "platform" ErrorKindAgent = "agent" )
Variables ¶
This section is empty.
Functions ¶
func ResolveDisplayPart ¶
func ResolveDisplayPart(part *DisplayPart)
Types ¶
type AgentManifest ¶ added in v0.5.0
type AgentManifest struct {
Version string `json:"version"`
Description string `json:"description"`
Emoji string `json:"emoji"`
Tools []ToolDef `json:"tools"`
Webhooks []WebhookDef `json:"webhooks"`
JobHandlers []JobHandlerDef `json:"jobHandlers"`
JobCrons []JobCronDef `json:"jobCrons"`
Routes []RouteDef `json:"routes"`
Topics []TopicDef `json:"topics"`
MCPServers []MCPDef `json:"mcpServers"`
Connections []ConnectionDef `json:"connections"`
EnvVars []EnvVarDef `json:"envVars"`
Directories []DirectoryDef `json:"directories"`
Instructions []InstructionDef `json:"instructions"`
ModelSlots []ModelSlotDef `json:"modelSlots"`
StaticAssets []StaticAssetDef `json:"staticAssets"`
StartupHooks []StartupHookDef `json:"startupHooks"`
}
AgentManifest is the complete canonical declaration of an agent image. The SDK emits it in offline manifest mode and sends the same value during runtime synchronization. Slices are deterministically ordered by their identifiers, except Instructions and StartupHooks, whose registration order is semantic.
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 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 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 EnqueueJobErrorResponse ¶ added in v0.5.0
type EnqueueJobErrorResponse struct {
Code string `json:"code"`
Error string `json:"error"`
HandlerName string `json:"handlerName"`
HandlerVersion int32 `json:"handlerVersion"`
}
EnqueueJobErrorResponse is returned with HTTP 409 when an exact job handler contract is temporarily unavailable during a deployment transition.
type EnqueueJobRequest ¶ added in v0.5.0
type EnqueueJobRequest struct {
ID string `json:"id"`
Name string `json:"name"`
Version int32 `json:"version"`
InputSchemaHash string `json:"inputSchemaHash"`
OutputSchemaHash string `json:"outputSchemaHash"`
Input json.RawMessage `json:"input"`
ScheduledAt *time.Time `json:"scheduledAt,omitempty"`
}
type EnqueueJobResponse ¶ added in v0.5.0
type EnvVarValueResponse ¶
type EnvVarValueResponse struct {
Value string `json:"value"`
}
type GetJobResponse ¶ added in v0.5.0
type GetJobResponse struct {
Job JobInfo `json:"job"`
}
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"`
RunID string `json:"runId,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 JobCronDef ¶ added in v0.5.0
type JobCronDef struct {
Slug string `json:"slug"`
Schedule string `json:"schedule"`
Description string `json:"description"`
HandlerName string `json:"handlerName"`
HandlerVersion int32 `json:"handlerVersion"`
InputSchemaHash string `json:"inputSchemaHash"`
OutputSchemaHash string `json:"outputSchemaHash"`
Input json.RawMessage `json:"input"`
}
type JobHandlerDef ¶ added in v0.5.0
type JobHandlerDef struct {
Name string `json:"name"`
Version int32 `json:"version"`
Description string `json:"description"`
TimeoutMs int64 `json:"timeoutMs"`
MaxAttempts int32 `json:"maxAttempts"`
MaxConcurrency int32 `json:"maxConcurrency"`
InputSchema json.RawMessage `json:"inputSchema"`
OutputSchema json.RawMessage `json:"outputSchema"`
InputSchemaHash string `json:"inputSchemaHash"`
OutputSchemaHash string `json:"outputSchemaHash"`
}
type JobInfo ¶ added in v0.5.0
type JobInfo struct {
ID string `json:"id"`
AgentID string `json:"agentId"`
HandlerName string `json:"handlerName"`
HandlerVersion int32 `json:"handlerVersion"`
InputSchemaHash string `json:"inputSchemaHash"`
OutputSchemaHash string `json:"outputSchemaHash"`
Status string `json:"status"`
Input json.RawMessage `json:"input"`
Output json.RawMessage `json:"output,omitempty"`
AttemptCount int32 `json:"attemptCount"`
MaxAttempts int32 `json:"maxAttempts"`
AttemptLimit int32 `json:"attemptLimit"`
LastError string `json:"lastError,omitempty"`
Progress *JobProgress `json:"progress,omitempty"`
SourceRunID string `json:"sourceRunId,omitempty"`
ScheduledAt *time.Time `json:"scheduledAt,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
StartedAt *time.Time `json:"startedAt,omitempty"`
CompletedAt *time.Time `json:"completedAt,omitempty"`
}
type JobManifest ¶ added in v0.5.0
type JobManifest struct {
JobHandlers []JobHandlerDef `json:"jobHandlers"`
JobCrons []JobCronDef `json:"jobCrons"`
}
JobManifest is the canonical job declaration emitted by an agent image in job-manifest inspection mode. Both slices are ordered by their identifiers.
type JobProgress ¶ added in v0.5.0
type JobRunRequest ¶ added in v0.5.0
type JobRunRequest struct {
ID string `json:"id"`
Name string `json:"name"`
Version int32 `json:"version"`
InputSchemaHash string `json:"inputSchemaHash"`
OutputSchemaHash string `json:"outputSchemaHash"`
Attempt int32 `json:"attempt"`
TimeoutMs int64 `json:"timeoutMs"`
Input json.RawMessage `json:"input"`
ScheduledAt *time.Time `json:"scheduledAt,omitempty"`
InitiatorKind string `json:"initiatorKind"`
InitiatorUserID string `json:"initiatorUserId"`
InitiatorConversationID string `json:"initiatorConversationId"`
CallerAccess Access `json:"callerAccess"`
}
type JobRunResponse ¶ added in v0.5.0
type JobRunResponse struct {
// Status is success, error, timeout, or retry. Retry reports a temporary
// enqueue availability failure and asks Airlock to redeliver the attempt.
Status string `json:"status"`
Output json.RawMessage `json:"output,omitempty"`
Error string `json:"error,omitempty"`
}
type LLMProxyRequest ¶
type LLMProxyRequest struct {
Slug string `json:"slug,omitempty"`
Capability string `json:"capability,omitempty"`
Options json.RawMessage `json:"options"`
}
type ListJobsResponse ¶ added in v0.5.0
type MCPAuthStatus ¶
type MCPContent ¶
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 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 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 SealRequest ¶
type SealRequest struct {
Plaintext string `json:"plaintext"`
}
type SealResponse ¶
type SealResponse struct {
Sealed string `json:"sealed"`
}
type SearchProxyRequest ¶
type SessionAppendRequest ¶
type SessionAppendResponse ¶
type SessionAppendResponse struct {
Revision string `json:"revision"`
}
type SessionCompactRequest ¶
type SessionCompactResponse ¶
type SessionCompactResponse struct {
Revision string `json:"revision"`
}
type SessionLoadResponse ¶
type ShareFileRequest ¶
type ShareFileRequest struct {
}
type ShareFileResponse ¶
type ShareFileResponse struct {
}
type SiblingInfo ¶
type StartupHookDef ¶ added in v0.5.0
type StartupHookDef struct {
Name string `json:"name"`
}
type StaticAssetDef ¶ added in v0.5.0
type SyncRequest ¶
type SyncRequest = AgentManifest
SyncRequest is the complete agent declaration accepted by runtime sync.
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 UnsealRequest ¶
type UnsealRequest struct {
Sealed string `json:"sealed"`
}
type UnsealResponse ¶
type UnsealResponse struct {
Plaintext string `json:"plaintext"`
}