Expand description
Shared-host building blocks, compiled into rpi rather than a separate crate.
This layer defines lifecycle rules, capacity, a persistent administrative catalog, supervised ordinary Harness backend, native admission/receipts, immutable trusted profiles, a bounded trusted administrative facade and a control daemon/CLI. Importing this module starts no services. The journal alone dispatches nothing; explicit daemon policy owns native administration. IPC exposes allowed profile refs, full-intent receipts and journalled profile create/restore/guarded close, cancel and stop. Session-free Mini has separate opt-in private authority and v1.6 volatile operations; never durable replay.
Modules§
- administration
- Trusted in-process administrative facade. No IPC parser or peer-minted authority. Intent, native effects and result publication are not atomic; uncertain work is inspect-only, never automatically replayed.
- bindings
- Native-only production assembly, using real runtime Providers and builtin tools. Inputs are supplied by a trusted Host owner, never model arguments. No CLI Args, settings discovery, process env mutation or subprocess Agent fallback occurs here. Only an explicit private nativeHooks resource binding can load trusted code, through owned deferred assembly and strict custody.
- client
- Versioned shared Host control client; not native session RPC. Explicit, bounded Unix IPC client for shared Host control. No discovery, process spawn, transcript access, retry, background reader or Agent ownership. A dropped exchange closes its connection: it does not undo remote work.
- daemon
- Working Host ownership for foreground and supervised execution.
- lifecycle
- Administrative intent/result journal, separate from native prompt admission. This module never executes an Agent. Only a fresh committed admission permits the trusted coordinator to attempt an action; duplicate/uncertain work is not replayed. No credentials, tool payloads or arbitrary result JSON are accepted.
- mini
- Session-free owned execution; volatile results, not the persistent wire API. Session-free native owner. Results are bounded, volatile and incarnation scoped; no admission journal, Harness, Session, writer or replay exists here. Only HostService owns this backend. A client is a weak observer, never an abort handle for the supervised prompt future or a second owner registry.
- mini_
control - Optional, private Mini authority and bounded EPOCH-LOCAL operation records. This is not another Agent owner, execution loop or durable journal. All native effects use the sole HostService table and lifecycle reservation.
- ordinary
- Supervised ordinary JSONL backend. No CLI resource loader, global cwd/env mutation, second Agent loop, IPC, or durable input-ACK protocol lives here.
- protocol
- Shared Host control wire v1. Mirrored in rpi-extcore, never linked into a DLL from rpi-cli. Wire declarations do NOT advertise implemented capabilities. This is distinct from both native session RPC and the rpi-server protocol.
- server
- Authenticated, bounded Unix control endpoint. Capabilities are implementation promises, not an enumeration of the eventual protocol. Native prompt admission/receipts are supported. Administrative execution only accepts complete profile, guarded Close/CancelSubmitted and Stop intents through the daemon’s fixed native authority and durable coordinator; legacy ops stay off.
- service
- In-process owner coordinator. This is not the production binder, daemon,
IPC server or durable receipt layer. A daemon must retain this service and
call
shutdownbefore releasing its runtime/catalog.
Structs§
- AgentId
- Agent
Page - Agent
Profile File - One private daemon Agent profile document (startup or dynamic-only).
- Agent
Record - Agent
Spec - Capacity
- One short synchronous critical section covers duplicate checks, capacity checks and reservation. No I/O or awaits occur while holding this lock.
- Capacity
Snapshot - Catalog
Guard - Catalog
Status - Control
Scope Id - Effective
Timeout - Effective
Timeouts - Host
Catalog - Administrative state only. Does not create Agent backends or stop external tools. The eventual service owner must drain actual backends before shutdown.
- Host
Config - Host
Epoch - Host
Startup Agent - A validated native Agent input; its name does not imply automatic startup.
- Launch
Spec - Allowlisted startup metadata, not a raw argv/env bag. No prompts, credentials or tool arguments belong here. Full restore bindings are a backend concern.
- Model
Ref - Native
Extension Artifacts - Pure reads only: no dlopen, registration, worker, staging or discovery. Bytes, order and canonical source provenance are immutable after freeze. Approvals must independently match this provenance/digest before loading.
- Native
Extension Call - A scoped session view. Field order drops the session BEFORE publishing that the callback finished; close must not observe zero with a keepalive in flight.
- Native
Extension Custody - Host ownership of one explicit DLL batch, including failed registration. Debug never reveals artifact paths, plugin state or Session data. Harness hooks must retain only a Weak reference; each actual worker takes a call scope, and shutdown drops the session before waiting on its receipts.
- Native
Hook Config - Private profile approval for an ordered, explicit DLL batch. It grants only the implemented hook bridge, not a sandbox for arbitrary native code.
- Native
Instruction Resources - Immutable, bounded explicit instruction snapshot. Construction performs only reads. This type cannot contain DLLs, package discovery or skill execution. A profile identifier is evidence of binding identity, never an authority grant.
- Native
Staged Extensions - Only owns its newly created staging directory, never source/user data or the Host owner itself. SDK guard retention cannot create an owner/session cycle.
- Prepared
Profile - A fresh, owned binding snapshot. Preparing creates no Session, acquires no Session writer and registers no Agent. Saved resource facts still have to be validated by strict restore before writer acquisition/repair.
- Profile
Ref - Public identity of immutable trusted inputs. Possessing/constructing this value grants nothing: the Host must resolve the exact pair in its allowlist.
- Profile
Version - Request
Id - Resident
Permit - Held by the supervised backend owner through startup, execution, cancellation and final cleanup, NOT by a transient client request or foreground run future. Dropping it frees a catalog slot; it does not cancel or stop any actual backend.
- RunId
- Session
Ref - Timeout
Overrides - Timeouts
- Trusted
Profile Set - Owns private inputs without Debug/Serialize, replacement or insertion APIs. Construct only from Host-owned inputs, never a peer’s profile JSON. Versions are random nonces, not hashes that could become a credential guessing oracle.
Enums§
- Agent
Mode - Agent
State - Catalog
Error - Execution
Mode - Host
Error - Fixed diagnostic labels: do not put prompts, credentials or raw argv here.
- Native
Binding Resources - Kept distinct from the instruction-only type: only the Hooks variant can stage/load code, and that requires an independently approved private profile.
- Timeout
Override - Timeout
Source
Constants§
- MAX_
NATIVE_ EXTENSION_ ARTIFACTS - MAX_
NATIVE_ EXTENSION_ BYTES - MAX_
NATIVE_ EXTENSION_ TOTAL_ BYTES - MAX_
PAGE_ SIZE - MAX_
PROFILE_ BYTES - Absolute profile byte budget. The document can contain provider credentials, so callers must read it through the private-file loader.
- MAX_
TRUSTED_ PROFILES - Trusted inputs are still bounded, independently of the IPC frame budget.