This repository is a Node.js ESM orchestration runtime for boss/employee dispatch, Web UI, browser/CDP automation, Telegram/Discord channels, memory, heartbeat, and PABCD orchestration.
- Start at
structure/INDEX.mdfor the current architecture map. - Keep
README.md,AGENTS.md, this file, andstructure/AGENTS.mdaligned when command/API/orchestration behavior changes. - Do not use the old
devlog/structure/path for architecture docs; the active folder isstructure/.
- The running server executes compiled
dist/(jaw serve→dist/server.js), never the TS sources. After changingserver.ts/src/**/bin/**, runnpm run buildbefore telling anyone to restart; frontend changes additionally neednpm run build:frontend. Full rules:AGENTS.md§ Build & Deploy Contract.
- PABCD entry is explicit:
jaw orchestrate,/orchestrate, or/pabcd. Resume is explicit/continue; natural-language “continue/계속/이어서” remains a normal prompt. - Workflow helper slash commands are
/plan,/interview,/deliberate,/planaudit, and/goal./planis a compatibility guide for users expecting a plan command; it maps to PABCD P and does not create another planning mode./planauditis the canonical remote-safe spelling;/plan-auditis not registered. Bounded automation is a/goal run ...subcommand family, not a separate top-level/autopilotcommand; current/goal runcontrols are tracking-oriented runtime gates. /goal plan [hint],/goalplan [hint], andcli-jaw goal plan [hint]create a pending plan-mode goal. The raw hint is stored separately asplanHint, not as the durable objective. Agents must refine with/goal refine <specific objective>,cli-jaw goal refine "<specific objective>", or/api/goalrefine-objectivebefore checkpoints are accepted./reviewis a project-dir review workflow: it uses configuredprojectDirsor a validated recent-context git repo, never JAW_HOME/process.cwd()fallback, treats/review [focus]user text as the highest-priority scope signal, resolves the review scope from the current conversation focus plus recent goal/chat context and commit history/diffs/worktree/untracked files, saves a Markdown report with scope evidence, and scopes--fixto Critical/High findings as new working-tree patches on top of currentHEADwithout rewriting commits. Git ranges are evidence for the conversation-selected work item, not permission to include unrelated recent commits.- Pi (
pi) is a top-level runtime above AI-E, not a hosted-provider SDK inside cli-jaw. It runs per turn throughpi --mode rpcwith cli-jaw-ownedsettings.piprofiles, isolatedPI_CODING_AGENT_DIRconfig generation, Settings profile registration, and npm-exec fallback for machines without a globalpibinary. - AGY (
agy) is a top-level runtime, not anai-eprovider. It runs in print mode throughagy -pusing AGY's current native selected model, captures print-mode session ids from a per-run--log-file, resumes exact saved sessions with--conversation <id>, exposes model switching only through native AGY UI (no--model/--effortflags), checks auth at run time, and uses plain-text stdout rather than NDJSON parsing. - Cursor (
cursor) is a top-level experimental runtime, not anai-eprovider. It runs throughcursor-agent -p --trust --output-format stream-json, resumes with--resume <chatId>, uses--model <resolvedModelId>, and encodes effort in the model id rather than passing a separate--effort/--thinkingflag. Cursor quota is auth/status-only until the CLI exposes quota windows. - Kiro (
kiro-code) is a top-level runtime, not anai-eprovider. It runs throughkiro-cli chat --no-interactive, resumes with--resume-id <sessionId>, passes--modeland optional--trust-all-tools, parses plain-text stdout (ANSI stripped), emitsagent_toolsteps from Kiro tool progress lines, shows AGY-style working indicators while busy, and captures session ids from the kiro-cli v2 session store (conversations_v2in the kiro-cli data sqlite, keyed by the canonical cwd) — the legacy~/.kiro/sessions/cli/*.jsonfiles are not used bychat --no-interactive. Live models come fromkiro-cli chat --list-models --format json; quota uses reverse-engineeredAmazonCodeWhispererService.GetUsageLimitswith the Kiro CLI auth store token. - Claude E is the registry key
claude-e; runtime telemetry usesagent:claude-e:*. Some persisted helper/session internals still use the historicalclaude-ibucket for compatibility. - Gemini full-access runs use
--skip-trust --approval-mode yoloon both fresh and resume sessions. /api/channel/sendis the canonical outbound Telegram/Discord delivery endpoint.- Heartbeat schedules support
{ kind: "every", minutes }and{ kind: "cron", cron, timeZone? }. - Tool logs are capped by
src/shared/tool-log-sanitize.tsbefore SSE/WebSocket,agent_done, and orchestration snapshot delivery. Web UI delivery is SSE-first throughGET /api/events, with WebSocket as the legacy fallback dispatcher. - Employee worker progress is query-first via
jaw worker status [agent], watchable viajaw worker watch [agent]orjaw dispatch --watch, memory-only for current plus previous completed run, and safe-summary only with thinking detail hidden. jaw employee list [--json]lists DB and static employees, including Control.jaw dispatchreads response bodies defensively and reports stale/missing server routes when an old manager returns HTML instead of JSON.npm run buildis a pure backend build/link operation and must not signal, kill, or restart live manager processes.- Web/CLI
jaw dashboard servedefaults to manager port24576; Electron implicit spawn owns the separate24577-24590manager lane and does not reuse24576. jaw browser fetch <url>is the adaptive URL-reader mirror from agbrowse: use it for a known URL/search-result URL, not as generic search.
Backend and frontend are separate builds. Both must run after source changes.
npm run build # backend only (tsc → dist/)
npm run build:frontend # frontend only (vite → public/dist/)public/js/**/*.tschanges requirenpm run build:frontend— the browser loads Vite-bundled output frompublic/dist/, not raw TS.- Backend
src/**/*.tschanges requirenpm run build. - After editing frontend code, ALWAYS run
npm run build:frontendbefore reporting the change is applied.
Prefer the existing gates only:
npm run gate:all
npm test
bash structure/audit-fin-status.shDoc-only changes should not modify .mjs, .js, or .ts source files unless explicitly requested.