Documentation
¶
Overview ¶
Package adapter implements the Runtime Protocol provider that delegates an assignment to a language/framework-neutral Agent Runtime Interface endpoint.
The package holds one concern: the adapter worker. The assignment loop, the transport to the Agent endpoint, the execution wait, the checkpoint handling and the fenced protocol calls live in the files next to this one, so each of them can be read on its own.
The checkpoint handling of the adapter worker: committing a logical checkpoint and restoring the Agent state a compatible checkpoint carries.
The execution wait of the adapter worker: how an assignment observes the Agent endpoint until the execution ends, over a stream or by polling.
The fenced protocol calls of the adapter worker: the Runtime Control service exchanges and the artifact conversions that carry their results.
The transport of the adapter worker: resolving the Runtime Interface endpoint of an assignment and building the client that reaches it under the transport security boundary (loopback plaintext or pinned TLS).
Index ¶
Constants ¶
const ( ProviderName = "adapter-http" CheckpointSchema = "fenced.adapter-checkpoint/v1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArtifactStore ¶
type ExecutionWindow ¶
type ExecutionWindow interface {
Open(mcp.AttemptContext) func()
}
ExecutionWindow receives the fenced execution context for the duration of one assignment: the runtime opens the sandbox Agent's brokered access (MCP) when the attempt is RUNNING and closes it on every exit path (default deny outside execution windows). Open returns the closer the worker defers, so concurrent workers sharing one Agent endpoint bind their identities per attempt.
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func NewWorker ¶
func NewWorker( control runtimev1.RuntimeControlServiceClient, artifacts ArtifactStore, endpoint, tenantID, runtimeInstanceID string, heartbeatTTL time.Duration, httpClient *http.Client, ) (*Worker, error)
func (*Worker) WithExecutionWindow ¶
func (w *Worker) WithExecutionWindow(window ExecutionWindow) *Worker
WithExecutionWindow attaches the sandbox brokered-access window (the loopback MCP identity slot). The worker publishes the fenced identity and the AgentVersion capability grants for the duration of each assignment.
func (*Worker) WithRuntimeBindings ¶
func (w *Worker) WithRuntimeBindings(bindings *bindings.RuntimeBindings) *Worker
WithRuntimeBindings attaches the deployment's runtime binding table. When set, assignments whose manifest entrypoint is a logical binding reference (or whose version ref has an explicit binding) resolve through it; the worker's constructor endpoint remains the highest-priority override - a dedicated-worker configuration bindings.ValidateEndpointOverride guards.