- 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
19 lines
889 B
Bash
19 lines
889 B
Bash
#!/bin/sh
|
|
# Mock adapter: deterministic response for seam tests. NEVER use where a
|
|
# real model response is required.
|
|
#
|
|
# Contract: see /opt/mosaic/adapters/README.md.
|
|
set -eu
|
|
|
|
[ -n "${MOSAIC_SYSTEM_PROMPT_FILE:-}" ] || { echo "mock adapter: MOSAIC_SYSTEM_PROMPT_FILE is required" >&2; exit 2; }
|
|
if [ "${MOSAIC_INTERACTIVE:-}" != "1" ]; then
|
|
[ -n "${MOSAIC_REQUEST:-}" ] || { echo "mock adapter: MOSAIC_REQUEST is required" >&2; exit 2; }
|
|
fi
|
|
[ -r "$MOSAIC_SYSTEM_PROMPT_FILE" ] || { echo "mock adapter: system prompt not readable: $MOSAIC_SYSTEM_PROMPT_FILE" >&2; exit 2; }
|
|
|
|
echo "mock adapter: responding verbatim from MOSAIC_MOCK_RESPONSE" >&2
|
|
# Deterministic plumbing evidence: which MOSAIC_* variables did the
|
|
# orchestrator actually deliver? (Auth secrets are not MOSAIC_-prefixed.)
|
|
(env | grep '^MOSAIC_' | sort) >&2 2>/dev/null || true
|
|
printf '%s\n' "${MOSAIC_MOCK_RESPONSE:-}"
|