- scripts/agent.sh <name>: launches interactive pi TUI in the container with contracts + optional mission + agent identity + named session + optional workspace/tools; the Mosaic alternative to vanilla pi - pi adapter: MOSAIC_INTERACTIVE branch (clean TUI, no -p, no initial prompt); headless exec rebuilt via positional args (no word-splitting on the request); MOSAIC_AGENT_NAME optional in headless - loader: AGENT IDENTITY section when the launcher names the agent - compose: fixed command removed (request defaults live in run-agent.sh); MOSAIC_INTERACTIVE/MOSAIC_AGENT_NAME passthrough - docs/TOOLS.md: full on-demand tool reference; AGENTS.md routes to it - RELEASE -> 0.0.8 (container change); build verified Closes #35
Mosaic runtime adapters
An adapter is the entire harness-specific surface of the system. Everything upstream of an adapter — configuration, contracts, missions, tasks, run records — is harness-agnostic; everything inside an adapter may assume one specific agent runtime.
Contract
An adapter lives at:
/opt/mosaic/adapters/<name>/adapter.sh
and must be executable. The dispatcher (/opt/mosaic/src/run-agent.sh)
selects it via MOSAIC_ADAPTER (default: pi) and execs it after the
system prompt has been generated.
Inputs (environment):
| Variable | Meaning |
|---|---|
MOSAIC_SYSTEM_PROMPT_FILE |
Absolute path to the generated system prompt (contracts + optional mission section). Read it; do not modify it. |
MOSAIC_REQUEST |
The exact user request text (may contain newlines). |
MOSAIC_PROVIDER |
Configured provider name. |
MOSAIC_MODEL |
Configured model id. |
Optional, adapter-specific (documented per adapter):
| Variable | Meaning |
|---|---|
MOSAIC_MOCK_RESPONSE |
mock only: the verbatim response to emit |
Outputs:
stdout: the model response text — the only channel the orchestrator capturesstderr: diagnostics (never credentials)- exit
0: success; nonzero: failure
Rules
- Adapters print ONLY the response on stdout. Status lines go to stderr.
- Adapters never read configuration files; the resolved settings arrive via environment.
- Adapters never write outside
/var/lib/mosaic. - Adding an adapter requires: a new directory, the contract implementation, and
adding the name to the allowlist in
scripts/mosaic-config.mjs.
Included adapters
pi— the pinned@earendil-works/pi-coding-agentCLI in noninteractive print mode (-p), ambient discovery disabled, stdin detached.mock— deterministic echo ofMOSAIC_MOCK_RESPONSE. Test-only: never use it where a real model response is required.