Daemon services¶
The handles of the daemon-wide domains, reached from a
Client: client.daemon, client.images,
client.policy, client.mcp, client.events and client.prompts.
fastsandbox.Daemon
¶
The daemon: health, information, settings, log levels and disk usage.
info
async
¶
info() -> DaemonInfo
The path of the API socket the daemon serves; its version is in health().
fastsandbox.Images
¶
The images of the daemon.
local_metadata
async
¶
local_metadata(reference: str) -> LocalImageMetadata
The local metadata of reference.
pull_stream
async
¶
pull_stream(reference: str) -> Stream[PullProgress]
Pulls reference, streaming its progress.
load_file
async
¶
Loads an image archive from a file of the host.
export
async
¶
Exports reference as an image archive, held in memory whole (see export_stream).
export_stream
async
¶
Exports reference as an image archive, streamed: its chunks, as the daemon sends them.
An export can weigh hundreds of megabytes: a program writes the chunks to a file as they
come, rather than holding the archive in memory. A chunk may be empty; aclose() stops
early and closes the connection.
Raises:
| Type | Description |
|---|---|
NotFoundError
|
When the daemon holds no image |
fastsandbox.Policy
¶
The network policy of the daemon.
apply
async
¶
apply(*changes: RuleChange) -> list[RuleChangeResult]
Applies rule changes; each result says whether it applied.
Raises:
| Type | Description |
|---|---|
InvalidRequestError
|
For a host of a rule added that is not a host pattern (a URL, a path), before anything is sent. |
apply_all
async
¶
apply_all(*changes: RuleChange) -> list[RuleChangeResult]
Applies rule changes and fails on the first that did not apply.
Raises:
| Type | Description |
|---|---|
InvalidRequestError
|
For a host of a rule added that is not a host pattern (a URL, a path), before anything is sent. |
OperationFailedError
|
When a change did not apply. |
check
async
¶
check(check: NetworkCheck) -> CheckResult
What the global policy decides for a host or an HTTP request.
The rules scoped to a sandbox, its kits' included, are not taken into account: the answer
is the baseline, not what a given sandbox reaches, which log() records.
fastsandbox.Mcp
¶
The MCP gateway settings of the daemon.
check_registration
async
¶
check_registration(server: McpServerCheck) -> RegistrationCheck
Whether an MCP server definition can be registered.
fastsandbox.Events
¶
The event stream of the daemon.
subscribe
async
¶
subscribe() -> Stream[DaemonEvent]
Every event: the current state replayed, a sync event, then the live events.