payload

package
v0.5.40-beta Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package payload defines runner application payloads that depend on Kodelet's model, tool, slash-command, and extension types. The parent protocol package intentionally remains a transport and lease-protocol leaf.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeManifestDigest

func ComputeManifestDigest(manifest Manifest) (string, error)

ComputeManifestDigest returns a stable digest when callers provide deterministically ordered slices.

Types

type CommandExecuteParams

type CommandExecuteParams struct {
	RunID   string `json:"runId"`
	Message string `json:"message"`
}

CommandExecuteParams routes a workspace or extension slash command.

type CommandExecuteResult

type CommandExecuteResult struct {
	Matched         bool     `json:"matched"`
	Action          string   `json:"action,omitempty"`
	CommandName     string   `json:"commandName,omitempty"`
	Response        string   `json:"response,omitempty"`
	Prompt          string   `json:"prompt,omitempty"`
	Display         string   `json:"display,omitempty"`
	DisplayOverride bool     `json:"displayOverride,omitempty"`
	RecipeName      string   `json:"recipeName,omitempty"`
	AllowedTools    []string `json:"allowedTools,omitempty"`
	AllowedCommands []string `json:"allowedCommands,omitempty"`
}

CommandExecuteResult is the normalized command routing result.

type ContextFile

type ContextFile struct {
	Path    string `json:"path"`
	Content string `json:"content"`
	Digest  string `json:"digest"`
}

ContextFile is one pinned model-facing context input.

type ConversationForkParams

type ConversationForkParams struct {
	RunID      string `json:"runId"`
	ToolCallID string `json:"toolCallId"`
	Name       string `json:"name,omitempty"`
}

ConversationForkParams identifies the active runner tool requesting a live fork.

type ConversationForkResult

type ConversationForkResult struct {
	ConversationID string `json:"conversationId"`
}

ConversationForkResult identifies the centrally persisted child conversation.

type EnvironmentCapabilities

type EnvironmentCapabilities struct {
	ToolUpdates        bool `json:"toolUpdates"`
	InteractiveUI      bool `json:"interactiveUI"`
	PersistentSurfaces bool `json:"persistentSurfaces"`
	Commands           bool `json:"commands"`
}

EnvironmentCapabilities advertises optional runner behavior.

type EnvironmentConfig

type EnvironmentConfig struct {
	AllowedCommands     []string                    `json:"allowedCommands,omitempty"`
	ToolMode            llmtypes.ToolMode           `json:"toolMode,omitempty"`
	EnableFSSearchTools bool                        `json:"enableFSSearchTools,omitempty"`
	SystemPromptPath    string                      `json:"systemPromptPath,omitempty"`
	SystemPromptContent string                      `json:"systemPromptContent,omitempty"`
	SystemPromptArgs    map[string]string           `json:"systemPromptArgs,omitempty"`
	SystemInformation   *llmtypes.SystemInformation `json:"systemInformation,omitempty"`
}

EnvironmentConfig is the sanitized runner-owned configuration projection.

type ExtensionOwner

type ExtensionOwner struct {
	ExtensionID string `json:"extensionId"`
	Generation  uint64 `json:"generation"`
}

ExtensionOwner preserves extension process identity across the runner boundary.

type LifecycleDispatchParams

type LifecycleDispatchParams struct {
	RunID            string                          `json:"runId"`
	Event            LifecycleEvent                  `json:"event"`
	Message          string                          `json:"message,omitempty"`
	SystemPrompt     string                          `json:"systemPrompt,omitempty"`
	AllowedTools     []string                        `json:"allowedTools,omitempty"`
	TurnNumber       int                             `json:"turnNumber,omitempty"`
	FinalOutput      string                          `json:"finalOutput,omitempty"`
	TurnCount        int                             `json:"turnCount,omitempty"`
	Messages         []llmtypes.Message              `json:"messages,omitempty"`
	ToolName         string                          `json:"toolName,omitempty"`
	ToolInput        json.RawMessage                 `json:"toolInput,omitempty"`
	ToolCallID       string                          `json:"toolCallId,omitempty"`
	StructuredResult *tooltypes.StructuredToolResult `json:"structuredResult,omitempty"`
}

LifecycleDispatchParams carries the typed union required by proxied lifecycle events.

type LifecycleDispatchResult

type LifecycleDispatchResult struct {
	Message          string                          `json:"message,omitempty"`
	Blocked          bool                            `json:"blocked,omitempty"`
	Reason           string                          `json:"reason,omitempty"`
	SystemPrompt     string                          `json:"systemPrompt,omitempty"`
	AllowedTools     []string                        `json:"allowedTools,omitempty"`
	ToolsModified    bool                            `json:"toolsModified,omitempty"`
	FollowUpMessages []string                        `json:"followUpMessages,omitempty"`
	ToolInput        json.RawMessage                 `json:"toolInput,omitempty"`
	StructuredResult *tooltypes.StructuredToolResult `json:"structuredResult,omitempty"`
	Modified         bool                            `json:"modified,omitempty"`
	Accepted         bool                            `json:"accepted,omitempty"`
}

LifecycleDispatchResult is the aggregate effective extension decision.

type LifecycleEvent

type LifecycleEvent string

LifecycleEvent identifies one proxied extension lifecycle operation.

const (
	LifecycleUserMessage LifecycleEvent = "user.message"
	LifecycleAgentStart  LifecycleEvent = "agent.start"
	LifecycleTurnStart   LifecycleEvent = "turn.start"
	LifecycleAgentInit   LifecycleEvent = "agent.init"
	LifecycleTurnEnd     LifecycleEvent = "turn.end"
	LifecycleAgentEnd    LifecycleEvent = "agent.end"
	LifecycleToolCall    LifecycleEvent = "tool.call"
	LifecycleToolUpdate  LifecycleEvent = "tool.update"
	LifecycleToolResult  LifecycleEvent = "tool.result"
)

type Manifest

type Manifest struct {
	ProtocolVersion     int                     `json:"protocolVersion"`
	RunnerID            string                  `json:"runnerId"`
	RunID               string                  `json:"runId"`
	Generation          int64                   `json:"generation"`
	Digest              string                  `json:"digest"`
	WorkingDirectory    string                  `json:"workingDirectory"`
	ContextFiles        []ContextFile           `json:"contextFiles"`
	Tools               []ToolDefinition        `json:"tools"`
	Skills              []SkillDefinition       `json:"skills"`
	Commands            []slashcommands.Command `json:"commands"`
	Config              EnvironmentConfig       `json:"config"`
	ExtensionGeneration int64                   `json:"extensionGeneration"`
	Capabilities        EnvironmentCapabilities `json:"capabilities"`
}

Manifest is the immutable wire snapshot returned by run.open.

type SkillDefinition

type SkillDefinition struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Source      string `json:"source"`
	Digest      string `json:"digest"`
}

SkillDefinition describes a skill owned and pinned by the runner.

type ToolDefinition

type ToolDefinition struct {
	Name        string         `json:"name"`
	Description string         `json:"description"`
	InputSchema map[string]any `json:"inputSchema"`
	Placement   string         `json:"placement"`
}

ToolDefinition is one serializable model-facing runner tool.

type ToolExecuteParams

type ToolExecuteParams struct {
	RunID       string          `json:"runId"`
	ToolCallID  string          `json:"toolCallId"`
	Name        string          `json:"name"`
	Input       json.RawMessage `json:"input"`
	WantUpdates bool            `json:"wantUpdates,omitempty"`
}

ToolExecuteParams asks the runner to perform the complete local tool lifecycle.

type ToolExecuteResult

type ToolExecuteResult struct {
	Input    json.RawMessage `json:"input"`
	Result   ToolResult      `json:"result"`
	Modified bool            `json:"modified,omitempty"`
}

ToolExecuteResult is the authoritative final runner tool result.

type ToolResult

type ToolResult struct {
	AssistantFacing string                            `json:"assistantFacing"`
	DisplayOutput   string                            `json:"displayOutput,omitempty"`
	Error           string                            `json:"error,omitempty"`
	Structured      tooltypes.StructuredToolResult    `json:"structured"`
	ContentParts    []tooltypes.ToolResultContentPart `json:"contentParts,omitempty"`
}

ToolResult is the serializable authoritative or transient result sent over the runner link.

type ToolUpdateParams

type ToolUpdateParams struct {
	RunID      string     `json:"runId"`
	RequestID  string     `json:"requestId"`
	ToolCallID string     `json:"toolCallId"`
	Sequence   uint64     `json:"sequence"`
	Result     ToolResult `json:"result"`
	Modified   bool       `json:"modified,omitempty"`
}

ToolUpdateParams is a replaceable transient tool snapshot linked to one request ID.

type UIConfirmParams

type UIConfirmParams struct {
	RunID   string                      `json:"runId"`
	Owner   ExtensionOwner              `json:"owner"`
	Request extensions.UIConfirmRequest `json:"request"`
}

type UIInputParams

type UIInputParams struct {
	RunID   string                    `json:"runId"`
	Owner   ExtensionOwner            `json:"owner"`
	Request extensions.UIInputRequest `json:"request"`
}

type UINotifyParams

type UINotifyParams struct {
	RunID   string                     `json:"runId"`
	Owner   ExtensionOwner             `json:"owner"`
	Request extensions.UINotifyRequest `json:"request"`
}

type UISelectParams

type UISelectParams struct {
	RunID   string                     `json:"runId"`
	Owner   ExtensionOwner             `json:"owner"`
	Request extensions.UISelectRequest `json:"request"`
}

type UISurfaceCloseParams

type UISurfaceCloseParams struct {
	RunID   string                           `json:"runId"`
	Owner   ExtensionOwner                   `json:"owner"`
	Request extensions.UISurfaceCloseRequest `json:"request"`
}

type UISurfaceFrameParams

type UISurfaceFrameParams struct {
	RunID   string                           `json:"runId"`
	Owner   ExtensionOwner                   `json:"owner"`
	Request extensions.UISurfaceFrameRequest `json:"request"`
}

type UISurfaceInputParams

type UISurfaceInputParams struct {
	RunID     string                                `json:"runId"`
	Owner     ExtensionOwner                        `json:"owner"`
	Lifecycle uint64                                `json:"lifecycle"`
	Request   extensions.UISurfaceInputNotification `json:"request"`
}

type UISurfaceOpenParams

type UISurfaceOpenParams struct {
	RunID   string                          `json:"runId"`
	Owner   ExtensionOwner                  `json:"owner"`
	Request extensions.UISurfaceOpenRequest `json:"request"`
}

type UISurfaceResizeParams

type UISurfaceResizeParams struct {
	RunID     string                                 `json:"runId"`
	Owner     ExtensionOwner                         `json:"owner"`
	Lifecycle uint64                                 `json:"lifecycle"`
	Request   extensions.UISurfaceResizeNotification `json:"request"`
}

type UITranscriptAppendParams

type UITranscriptAppendParams struct {
	RunID   string                               `json:"runId"`
	Owner   ExtensionOwner                       `json:"owner"`
	Request extensions.UITranscriptAppendRequest `json:"request"`
}

type UIWidgetFrameParams

type UIWidgetFrameParams struct {
	RunID   string                          `json:"runId"`
	Owner   ExtensionOwner                  `json:"owner"`
	Request extensions.UIWidgetFrameRequest `json:"request"`
}

type UIWidgetRemoveParams

type UIWidgetRemoveParams struct {
	RunID   string                           `json:"runId"`
	Owner   ExtensionOwner                   `json:"owner"`
	Request extensions.UIWidgetRemoveRequest `json:"request"`
}

type UIWidgetSetParams

type UIWidgetSetParams struct {
	RunID   string                        `json:"runId"`
	Owner   ExtensionOwner                `json:"owner"`
	Request extensions.UIWidgetSetRequest `json:"request"`
}

Jump to

Keyboard shortcuts

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