Help us shape the future of Go! Take the 2026 Go Developer Survey

worker

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 17 Imported by: 0

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

View Source
const (
	ToolName = "questlock_delegate"
	// MaxRequestBytes bounds both an approved request file and an MCP frame.
	MaxRequestBytes = 1 << 20
)
View Source
const ReviseToolName = "questlock_revise"

Variables

View Source
var (
	ErrConfiguration = errors.New("worker_configuration_invalid")
	ErrTransport     = errors.New("worker_transport_failed")
)

Functions

func Serve

func Serve(ctx context.Context, input io.ReadCloser, output io.Writer, options Options) error

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.

Jump to

Keyboard shortcuts

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