payload

package
v0.6.0-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: MIT Imports: 10 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

View Source
const MethodModelHelperExecute = "model.helper.execute"

MethodModelHelperExecute is a runner-to-control-plane request. It is not a user execution endpoint and requires an active delegated tool capability.

Variables

This section is empty.

Functions

func ComputeDiscoveryDigest

func ComputeDiscoveryDigest(manifest Manifest) (string, error)

ComputeDiscoveryDigest fences workspace policy and command registrations, not tool schemas that may depend on model identity or execution-only capabilities. Actual tool and shortcut calls still use the pinned run's full manifest digest.

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"`
	PersistentWidgets  bool `json:"persistentWidgets"`
	PersistentSurfaces bool `json:"persistentSurfaces"`
	Commands           bool `json:"commands"`
}

EnvironmentCapabilities advertises optional runner behavior.

type EnvironmentConfig

type EnvironmentConfig struct {
	Options             *llmtypes.ExecutionOptions  `json:"options,omitempty"`
	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 {
	Shortcuts           []protocol.ShortcutDescriptor `json:"shortcuts,omitempty"`
	Profiles            []delegation.Preset           `json:"profiles,omitempty"`
	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 ModelHelperParams

type ModelHelperParams struct {
	RunID      string                       `json:"runId"`
	ToolCallID string                       `json:"toolCallId"`
	Request    tooltypes.ModelHelperRequest `json:"request"`
}

ModelHelperParams identifies the run and tool that own an internal utility.

type ModelHelperResult

type ModelHelperResult struct {
	Text string `json:"text"`
}

ModelHelperResult carries only extracted text, never provider configuration.

type ShortcutExecuteParams

type ShortcutExecuteParams struct {
	RunID    string                      `json:"runId"`
	Digest   string                      `json:"digest"`
	Shortcut protocol.ShortcutDescriptor `json:"shortcut"`
}

ShortcutExecuteParams fences a shortcut to a pinned run and registration.

type ShortcutExecuteResult

type ShortcutExecuteResult struct {
	Matched bool                       `json:"matched"`
	Result  *extensions.ShortcutResult `json:"result,omitempty"`
}

ShortcutExecuteResult returns a host action, never starts a model turn.

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 {
	ExtensionID string         `json:"extensionId,omitempty"`
	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 UIExtensionCleanupParams

type UIExtensionCleanupParams struct {
	Owner ExtensionOwner `json:"owner"`
}

UIExtensionCleanupParams revokes UI owned by one failed/closed process.

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 UISurfaceInvalidateParams

type UISurfaceInvalidateParams struct {
	RunID     string         `json:"runId"`
	Owner     ExtensionOwner `json:"owner"`
	ScopeID   string         `json:"scopeId"`
	ID        string         `json:"id"`
	Lifecycle uint64         `json:"lifecycle"`
}

UISurfaceInvalidateParams revokes one native surface without ending its worker.

type UISurfaceOpenParams

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

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