Documentation
¶
Overview ¶
Package worker exposes bounded explicit delegation through MCP over stdio. It reads only the request file named by the caller in the declared workspace; it never discovers files, executes commands, or edits workspace files.
Index ¶
Constants ¶
const ( ToolName = "questlock_delegate" // MaxRequestBytes bounds both an approved request file and an MCP frame. MaxRequestBytes = 1 << 20 )
const ReviseToolName = "questlock_revise"
const StatusToolName = "questlock_status"
Variables ¶
var ( ErrConfiguration = errors.New("worker_configuration_invalid") ErrTransport = errors.New("worker_transport_failed") )
Functions ¶
func ReadApprovedRequest ¶ added in v0.8.0
ReadApprovedRequest reuses the MCP worker's pinned, bounded, symlink-refusing file boundary for explicit opt-in local queue callers. It discovers no files.
func Serve ¶
Serve runs the official MCP SDK on newline-delimited JSON streams. The SDK supports current server/discover and legacy initialize clients. It closes input on disconnect or cancellation; output remains owned by the caller. Errors returned here and to the client contain controlled labels only.
Types ¶
type Options ¶
type Options struct {
Workspace string
Version string
// ProfileID is an operator-chosen nonsecret label, never a broker URL or
// credential. ProfileKind is custom (default) or managed.
ProfileID string
ProfileKind string
Execute func(context.Context, delegation.Request) (delegation.Result, error)
// Revise optionally enables checked literal edits, without model inference.
Revise func(context.Context, revision.Request) (revision.Result, error)
AllowPaid bool
}
Options is process authority, not tool input. Execute must honor its context and preserve the delegation router's durable reuse and uncertainty rules. Enabling AllowPaid still requires explicit prices and positive dollar budgets in the request policy; it does not authorize arbitrary paid model calls.
type Status ¶ added in v0.13.0
type Status struct {
Schema int `json:"schema"`
RuntimeVersion string `json:"runtime_version"`
RequestRoot string `json:"request_root"`
Profile StatusProfile `json:"profile"`
Policy StatusPolicy `json:"policy"`
RequestSchemas StatusSchemas `json:"request_schemas"`
Checks StatusChecks `json:"checks"`
Tools []string `json:"tools"`
WorkflowConfigs map[string]string `json:"workflow_configs"`
Readiness StatusReadiness `json:"readiness"`
ReadOnly bool `json:"read_only"`
ModelCalls int `json:"model_calls"`
}
Status is the connected worker's operating contract, not a broker, provider, or native-client health check. Schema versions describe the accepted JSON: delegation currently has no schema field; revision requires schema: 1.