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"
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
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.