Documentation
¶
Overview ¶
Package delegation defines credential-free, scoped child execution contracts.
Index ¶
- Constants
- func Admit(ctx context.Context) error
- func Decode(data []byte, target any) error
- func ValidID(id string) bool
- func WithAdmission(ctx context.Context, admit func() error) context.Context
- func WithPrepare(ctx context.Context, prepare Prepare) context.Context
- type Event
- type Identity
- type Params
- type Prepare
- type Preset
- type Profile
- type Request
- type Result
- type Run
- type SteerResult
Constants ¶
const ( StartMethod = "child.start" ReadMethod = "child.read" CancelMethod = "child.cancel" SteerMethod = "child.steer" ReleaseMethod = "child.lease.release" )
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode rejects unknown fields, null options and trailing data at the runner boundary. Nested ExecutionOptions perform their own strict validation.
func WithAdmission ¶
WithAdmission connects durable chat initialization to registry admission.
Types ¶
type Event ¶
type Event struct {
Sequence uint64 `json:"sequence"`
Kind string `json:"kind"`
Text string `json:"text,omitempty"`
ToolName string `json:"toolName,omitempty"`
ToolCallID string `json:"toolCallId,omitempty"`
Input string `json:"input,omitempty"`
ToolOutput string `json:"toolOutput,omitempty"`
Success *bool `json:"success,omitempty"`
Error string `json:"error,omitempty"`
}
type Identity ¶
type Identity struct {
RunnerID string `json:"runnerId,omitempty"`
HostInstanceID string `json:"hostInstanceId,omitempty"`
ConversationID string `json:"conversationId"`
RunID string `json:"runId"`
ParentConversationID string `json:"parentConversationId"`
ParentRunID string `json:"parentRunId"`
ExtensionID string `json:"extensionId"`
Profile string `json:"profile"`
}
type Params ¶
type Params struct {
RunID string `json:"runId"`
ToolCallID string `json:"toolCallId,omitempty"`
ExtensionID string `json:"extensionId"`
Generation uint64 `json:"generation"`
Request Request `json:"request,omitempty"`
ChildID string `json:"childId,omitempty"`
ChildRunID string `json:"childRunId,omitempty"`
Message string `json:"message,omitempty"`
RequestID string `json:"requestId,omitempty"`
LeaseID string `json:"leaseId,omitempty"`
After uint64 `json:"after,omitempty"`
}
Params is sent only on the authenticated runner connection.
type Prepare ¶
Prepare validates and freezes configuration before any child is admitted. Run executes the existing persisted chat path, not a second agent loop.
func PrepareFromContext ¶
type Preset ¶
type Preset struct {
Profile
ExtensionID string `json:"extensionId"`
Generation uint64 `json:"generation"`
}
Preset is the runner-resolved snapshot advertised with its environment.
type Profile ¶
type Profile struct {
Name string `json:"name"`
Options *llmtypes.ExecutionOptions `json:"options,omitempty"`
SystemPromptPath string `json:"systemPromptPath,omitempty"`
SystemPrompt string `json:"systemPrompt,omitempty"`
}
Profile is owned by one extension process, never a daemon profile or Config.
type Request ¶
type Request struct {
ContextMode string `json:"contextMode,omitempty"`
Resume string `json:"resume,omitempty"`
RequestID string `json:"requestId"`
Profile string `json:"profile"`
Message string `json:"message"`
Options *llmtypes.ExecutionOptions `json:"options,omitempty"`
SystemPrompt string `json:"systemPrompt,omitempty"`
CWD string `json:"cwd,omitempty"`
LeaseID string `json:"leaseId,omitempty"`
}
Request accepts only an owned child resume target, never an arbitrary source, provider credentials, or an endpoint. Fork always means the live parent.
type Run ¶
Prepare validates and freezes configuration before any child is admitted. Run executes the existing persisted chat path, not a second agent loop.