Documentation
¶
Overview ¶
Package taskwiring assembles the MCP Tasks extension (#2009) for the platform facade: the `tasks:` configuration section, the capability it advertises, the receiving middleware that turns a declaring client's run_script and export calls into tasks, the tasks/* methods and the caller each is answered for, the runner that executes an export apart from its request, and the task Sources those methods answer from. The facade calls Offered and Install and holds nothing for it; the extension lives here because the facade is at its size budget.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Install ¶
func Install(d Deps) mcp.Middleware
Install assembles the extension where it is offered: it registers the tasks/* methods on the server and the runner on the lifecycle, and returns the receiving middleware, nil where the extension is not offered.
Types ¶
type Config ¶
type Config struct {
Enabled *bool `yaml:"enabled"`
// RetentionDays is how long an export run as a task is kept, for its
// caller to read the result; default 7. A run_script task is the run and
// is kept as long as scripts.run_retention_days keeps the run.
RetentionDays int `yaml:"retention_days"`
}
Config is the `tasks:` section. A client that declares the extension is answered with a task for run_script and the export tools, and follows the work with tasks/get and tasks/cancel. Enabled by default (nil = enabled) wherever there is a database; enabled: false answers every call directly, as for a client without the extension.
type Deps ¶
type Deps struct {
DB *sql.DB
Config Config
Server *mcp.Server
Lifecycle Lifecycle
// Authenticator, Personas and AdminPersona identify the caller of a
// tasks/* request, which passes none of the tools/call layers that would,
// the way a completion request is identified.
Authenticator middleware.Authenticator
Personas *persona.Registry
AdminPersona string
// Runs is the script layer's runs as tasks. The script layer is
// assembled after the server, so it is read when a request arrives.
Runs func() *scriptlayer.RunTasks
}
Deps is what the extension is assembled from.
type Handle ¶
type Handle struct {
// contains filtered or unexported fields
}
Handle is the assembled extension. A nil Handle offers nothing.
func (*Handle) Middleware ¶
func (h *Handle) Middleware() mcp.Middleware
Middleware is the receiving middleware, or nil where the extension is off.