Files
stack/scripts/mosaic
T
jason.woltje 4c8527fcd3 feat(triage): the owner-only route store and mosaic triage route show|set
<dataRoot>/triage/route.json holds Triage's model route and daily cap as names only:
a catalogue model key, a harness name and a daily-quota cap leaf, with no env value
and no key. The directory is 0700 and the file 0600, owned by the running user; a
link, a hard link, a non-file, a wrong mode or owner, an unknown field or an unknown
time zone refuses. A write is compare-and-set on revision under an exclusive lock,
atomic (temp file, fsync, rename, directory fsync), and appends one receipt line.
The reset is 00:00 in a zone the owner gives, with no default. The file location,
field names and reset rule each live in one place.

mosaic triage route show|set are human verbs and refuse an agent run before any read.
Nothing is wired into the Triage host: the Console keeps route: null. Held for
Jason's ruling on the design's four questions (#1873, lane triage-route-store).
2026-11-18 12:05:07 -06:00

52 lines
2.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# `mosaic launch <seat>` and `mosaic seat task <seat> <text>`: seat launch
# with registration for the control board. See packages/seat/README.md.
# `mosaic queue <verb>`: the work queue. See packages/queue/README.md.
# `mosaic org config validate|resolve` and `mosaic org instances|instance|veto`:
# the installed organization files and role instances; `mosaic business <verb>`
# is the old spelling of both, with the same arguments. See
# packages/organization/README.md.
# `mosaic inbox|decide|tasks|agents|trail|talk|stop|launches` and
# `mosaic bus start|stop|status`: the human commands, managed sessions and
# the bus host. See packages/cli/README.md.
# This is the repository wrapper; run it by path from the checkout. A host
# may also put `mosaic` on PATH as a wrapper that runs a pinned copy's
# scripts/mosaic (scripts/stack-copy.sh wrapper, docs/TOOLS.md "Stack
# copies"). On Jason's host the estate CLI it replaced is `mosaic-old`.
# On a pinned host the human commands and --tester go through
# that `mosaic`, and from a checkout they exit 3. Queue commands stay on
# scripts/mosaic queue in the canonical checkout, because a copy refuses
# them. See packages/cli/README.md "One pinned copy".
set -euo pipefail
REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# No argument: the full-screen app on a terminal (packages/cli/README.md).
if [ $# -eq 0 ]; then
exec node "$REPO/packages/cli/src/cli.mjs"
fi
if [ "${1:-}" = queue ]; then
shift
exec node "$REPO/packages/queue/src/cli.mjs" "$@"
fi
if [ "${1:-}" = business ]; then
# Row 165 (#1662): the human's role instance commands need the human proof,
# so they run in packages/cli. validate and resolve run in packages/organization (the old
# packages/business path is a shim of it, rename r2 stage B). Row 194 adds veto.
# This is the old spelling: `mosaic org config` and `mosaic org instances|instance|veto`
# run the same code through packages/cli, below.
case "${2:-}" in
instances|instance|veto) exec node "$REPO/packages/cli/src/cli.mjs" "$@" ;;
esac
shift
exec node "$REPO/packages/organization/src/cli.mjs" "$@"
fi
# `mosaic library survey`: names and counts from a writing repo, never its text
# (packages/library/README.md). Other library verbs are bus verbs.
if [ "${1:-}" = library ] && [ "${2:-}" = survey ]; then
shift
exec node "$REPO/packages/library/src/survey.mjs" "$@"
fi
case "${1:-}" in
org|proxy|halt|resume|processing|usage|project|limits|inbox|decide|tasks|agents|trail|talk|stop|launches|bus|console|plugins|credentials|hosts|grants|name|names|follow|threads|thread|access|dev|run|triage) exec node "$REPO/packages/cli/src/cli.mjs" "$@" ;;
esac
exec node "$REPO/packages/seat/src/cli.mjs" "$@"