feat(agent): interactive TUI launcher + identity + TOOLS.md (#35)
- 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
This commit is contained in:
+15
-7
@@ -1,13 +1,22 @@
|
||||
#!/bin/sh
|
||||
# One-shot agent dispatcher inside the container.
|
||||
# Agent dispatcher inside the container.
|
||||
#
|
||||
# 1. Loads the contract-generated system prompt (contracts + optional
|
||||
# mission section from MOSAIC_MISSION_FILE).
|
||||
# 2. Dispatches to /opt/mosaic/adapters/<MOSAIC_ADAPTER>/adapter.sh per
|
||||
# the contract in /opt/mosaic/adapters/README.md.
|
||||
# Headless (default): loads the contract-generated system prompt, then
|
||||
# dispatches one request to /opt/mosaic/adapters/<MOSAIC_ADAPTER>/adapter.sh
|
||||
# (contract: /opt/mosaic/adapters/README.md).
|
||||
#
|
||||
# Interactive (MOSAIC_INTERACTIVE=1, from scripts/agent.sh): same prompt,
|
||||
# but the adapter opens the full pi TUI with no initial prompt - the human
|
||||
# drives from there.
|
||||
set -eu
|
||||
|
||||
REQUEST="${*:-Return your startup marker and nothing else.}"
|
||||
REQUEST=""
|
||||
if [ "${MOSAIC_INTERACTIVE:-}" != "1" ]; then
|
||||
# Headless: args are the request; default is the startup verification
|
||||
# request used by hello/verify.
|
||||
REQUEST="${*:-Return your startup marker and nothing else.}"
|
||||
export MOSAIC_REQUEST="$REQUEST"
|
||||
fi
|
||||
|
||||
ADAPTER="${MOSAIC_ADAPTER:-pi}"
|
||||
case "$ADAPTER" in
|
||||
@@ -28,6 +37,5 @@ fi
|
||||
/opt/mosaic/src/load-contracts.sh /opt/mosaic/contracts /var/lib/mosaic/system-prompt.md
|
||||
|
||||
export MOSAIC_SYSTEM_PROMPT_FILE="/var/lib/mosaic/system-prompt.md"
|
||||
export MOSAIC_REQUEST="$REQUEST"
|
||||
|
||||
exec "$ADAPTER_SCRIPT"
|
||||
|
||||
Reference in New Issue
Block a user