@hearsay-tools/squawk 0.18.0-dev.6602 → 0.18.0-dev.6606

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +10 -696
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -22,7 +22,7 @@ and a run never stops to ask; it just finishes. Leave it on a VPS and you get
22
22
  a dev team that's *always on* — a mobile-friendly cockpit you can check from
23
23
  your phone, working your backlog while you're away.
24
24
 
25
- [A look inside](#a-look-inside) · [What Squawk does best](#what-squawk-does-best-) · [What it solves](#what-it-solves) · [Who it's for](#who-its-for) · [Quick start](#quick-start) · [How it works](#how-it-works) · [Core concepts](#core-concepts) · [Cockpit tour](#cockpit-tour) · [Agent backends](#coding-agent-backends) · [Remote access](#remote-access-host-squawk-on-a-server)
25
+ [A look inside](#a-look-inside) · [What Squawk does best](#what-squawk-does-best-) · [What it solves](#what-it-solves) · [Who it's for](#who-its-for) · [Quick start](#quick-start) · [How it works](#how-it-works) · [Core concepts](#core-concepts) · [Cockpit tour](#cockpit-tour) · [Agent backends](docs/areas/runners.md#coding-agent-backends) · [Remote access](docs/remote-access.md#remote-access-host-squawk-on-a-server)
26
26
 
27
27
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
28
28
  ![Node 24.21.0+](https://img.shields.io/badge/Node-24.21.0%2B-339933)
@@ -140,7 +140,7 @@ and an orchestrator keeps a whole queue of them moving.
140
140
  with one agent, review with another) — and through **OpenCode**, **pi** or
141
141
  **OMP** you can point a run at **open-source or local models**, not just the
142
142
  big vendors. See
143
- [Agent backends](#coding-agent-backends).
143
+ [Agent backends](docs/areas/runners.md#coding-agent-backends).
144
144
  - 🖥️ **Close the laptop and the work stops.** A local agent only runs while your
145
145
  machine is on and awake. Put Squawk on a **VPS, cloud box, or dedicated server**
146
146
  and the cockpit becomes the GUI for an **always-on AI coding team** — kick off,
@@ -205,7 +205,7 @@ The old `cez` and `cezarion` commands still work during the
205
205
  [deprecation window](docs/migration.md#rollback-and-the-deprecation-window), with one stderr notice per process. No API key is ever used — Squawk shells out to whichever agent
206
206
  CLIs you are already logged into, `claude` by default.
207
207
 
208
- > **Contributing?** [Local development](#local-development) shows how to get a
208
+ > **Contributing?** [Local development](docs/development.md#local-development) shows how to get a
209
209
  > global `hsq` command straight off your checkout (`npm run install-as-command`)
210
210
  > — no publish needed.
211
211
 
@@ -435,717 +435,31 @@ See [Workflow format](docs/areas/workflows.md).
435
435
 
436
436
  ## How it runs agents
437
437
 
438
- Squawk shells out to your locally installed, logged-in agent CLI —
439
- **your subscription, no API key**. With the default Claude Code backend that
440
- means headless `stream-json` mode, tool access via `--allowedTools`, with
441
- unapproved tools denied without prompting (`--permission-mode dontAsk`) inside
442
- the task's worktree — but note the zero-config default list (`Read`, `Edit`,
443
- `Write`, `Grep`, `Glob`, `Bash`) grants unrestricted `Bash` unless a step sets
444
- `bashAllowlist`, so treat a run as having full shell access in its worktree,
445
- not a sandboxed allowlist. Set `HSQ_APPROVAL_GATE=1` (`CEZ_APPROVAL_GATE` fallback) to opt into Claude's
446
- interactive approval UI. Codex, OpenCode and Cursor are driven through their
447
- own native protocols and don't honor `allowedTools` at all; OpenCode's own
448
- permission config decides what it asks. pi and OMP map `allowedTools` onto
449
- their own tool allowlists — see
450
- [Coding agent backends](#coding-agent-backends) for what each one actually
451
- locks down. Nothing runs on a server you don't own.
452
-
453
- Live Preview lets Chromium use host graphics when available. Chromium selects the
454
- backend and falls back to software when hardware is unavailable or blocked. This
455
- needs no Squawk setting or VirGL-specific setup. On Linux, GPU access may also
456
- need a working display in the cockpit process environment. JPEG streaming is
457
- unchanged; GPU rendering does not guarantee hardware frame encoding.
458
-
459
- Useful environment variables:
460
-
461
- | Var | Effect |
462
- |---|---|
463
- | `HSQ_*` settings (`CEZ_*` fallback) | Ordinary settings prefer a defined HSQ value, including empty. Home, hosted-mode REMOTE and native shell controls use the separate rules below. Both home locators and inherited controller authority are removed from child environments, even in full-env mode. |
464
- | `CEZ_DELEGATION` | Retired (hearsay-tools/cezarion#2784); has no effect. Workers and task messaging are per-task settings, both on by default. See [Owned workers](docs/workers.md#owned-workers). |
465
- | `HSQ_DELEGATION_URL`, `CEZ_DELEGATION_URL`, `HSQ_DELEGATION_TOKEN`, `CEZ_DELEGATION_TOKEN` | Internal generated session values; do not configure or copy them. Tokens rotate on Continue/restart and are revoked when the session/controller closes. |
466
- | `HSQ_REMOTE`, `CEZ_REMOTE` | Hosted mode: exact `1` under either name disables local handoff and local settings administration. Empty or `0` cannot cancel the other name's hosted-mode pin. Server installers pin both names. |
467
- | `HSQ_API_PORT`, `CEZ_API_PORT` | Local service port used by the development web proxy; defaults to 4321. |
468
- | `HSQ_CODEX_NETWORK`, `CEZ_CODEX_NETWORK` | Codex sandbox network access: exact `0` disables it. |
469
- | `HSQ_CODEX_REASONING`, `CEZ_CODEX_REASONING` | Codex reasoning summary: auto (default), concise, detailed or none. |
470
- | `HSQ_RELEASE_CHANNEL`, `CEZ_RELEASE_CHANNEL` | Explicitly requests `nightly` in `release-snapshot.mjs`. Other nonempty values, including `stable` and `development`, publish nothing. When unset or empty, the event selects development snapshots. `release.mjs` selects stable releases through its bump argument. |
471
- | `HSQ_RELEASE_ROOT`, `CEZ_RELEASE_ROOT` | Repository root containing the package manifests that `release.mjs` reads and stamps. |
472
- | `HSQ_SNAPSHOT_ROOT`, `CEZ_SNAPSHOT_ROOT` | Repository root containing the package manifests that `release-snapshot.mjs` reads and stamps. |
473
- | `HSQ_ALLOW_TEST_SPAWN`, `CEZ_ALLOW_TEST_SPAWN` | Test harness opt-in for real agent process spawning. Leave unset outside tests. |
474
- | `HSQ_ARTIFACTS_DIR`, `CEZ_ARTIFACTS_DIR`, `HSQ_HANDOFF_FILE`, `CEZ_HANDOFF_FILE`, `HSQ_TASK_ID`, `CEZ_TASK_ID`, `HSQ_PROJECT_ROOT`, `CEZ_PROJECT_ROOT` | Internal task paths and identity generated by the controller. Do not configure them. |
475
- | `HSQ_TOOL_SOCKET`, `CEZ_TOOL_SOCKET`, `HSQ_TOOL_TOKEN`, `CEZ_TOOL_TOKEN` | Internal tool transport authority generated for each session. Do not configure or copy it. |
476
- | `HSQ_AUTOSAVE_OWNER`, `CEZ_AUTOSAVE_OWNER` | Internal process attribution markers. Do not configure them. |
477
- | `HSQ_DESKTOP`, `CEZ_DESKTOP`, `HSQ_SUPERVISED`, `CEZ_SUPERVISED`, `HSQ_SUPERVISOR_PID`, `CEZ_SUPERVISOR_PID`, `HSQ_SUPERVISOR_STDIN`, `CEZ_SUPERVISOR_STDIN` | Internal desktop and supervisor lifecycle values. The shell's CEZ value wins when present, including empty values; HSQ is used only when CEZ is absent. Do not configure them. |
478
- | `HSQ_DISCLAIM_EXEC`, `CEZ_DISCLAIM_EXEC` | Desktop executable used to remove inherited macOS execution attribution. A defined CEZ value wins over HSQ. Discovered automatically. |
479
- | `HSQ_DESKTOP_ENTRY` / `CEZ_DESKTOP_ENTRY` | Native-shell development entry file. The HSQ name wins when present, including an empty value. |
480
- | `HSQ_DESKTOP_CWD` / `CEZ_DESKTOP_CWD` | Native-shell starting project directory. The HSQ name wins when present. |
481
- | `HSQ_DESKTOP_NODE` / `CEZ_DESKTOP_NODE` | Native-shell Node executable. The HSQ name wins when present. Empty selects `node` on PATH. |
482
- | `HSQ_DESKTOP_NO_UPDATE=1` / `CEZ_DESKTOP_NO_UPDATE=1` | Disable signed native-shell updates. The HSQ name wins when present. Debug builds already disable updates. |
483
- | `HSQ_DESKTOP_DEBUG_IPC` / `CEZ_DESKTOP_DEBUG_IPC` | Debug builds only: exercise native title-bar IPC after loading the cockpit. The HSQ name wins when present. |
484
- | `HSQ_URL`, `CEZ_URL` | Cockpit origin for `hsq task` and operator `hsq discover` (e.g. a hosted `HSQ_REMOTE`, `CEZ_REMOTE` cockpit). Unset, they find the local cockpit serving this checkout on ports 4321–4370. Parent discovery uses its delegation controller instead. |
485
- | `HSQ_COCKPIT_URL`, `CEZ_COCKPIT_URL`, `HSQ_PROJECT_ID`, `CEZ_PROJECT_ID` | Set by the cockpit in every agent's environment once it listens: the bound origin and the run's project. `hsq automation` calls that address; a headless `hsq run` sets neither. Do not configure them. |
486
- | `HSQ_DRY_RUN=1`, `CEZ_DRY_RUN=1` | Use bundled mocks for all five agent backends — the cockpit works offline for demos and development. Explicit backend binary overrides still win. |
487
- | `HSQ_AGENT_MODELS_LOCKED=1`, `CEZ_AGENT_MODELS_LOCKED=1` | Globally lock each runner to the model configured in its native Claude/Codex/OpenCode settings while keeping runner selection available. Exact `1` also delegates authentication and provider enablement to those native agents, so Squawk skips its credential probes and provider-disable preferences. Existing Squawk presets are preserved but ignored, and an environment change requires a restart. The config-file equivalent is `"modelsLocked": true` in global `<config>/config.json` or one repository's `.ai/cezar/config.json`; config-file locks do not disable provider checks. |
488
- | `HSQ_APPROVAL_GATE=1`, `CEZ_APPROVAL_GATE=1` | Opt into Claude's interactive approval UI; by default, unapproved tools are denied without interrupting the run. Ignored when `HSQ_CLAUDE_PERMISSION_MODE`, `CEZ_CLAUDE_PERMISSION_MODE` is a recognized value (`dontAsk`, `acceptEdits`, or `bypass`). |
489
- | `HSQ_CLAUDE_PERMISSION_MODE`, `CEZ_CLAUDE_PERMISSION_MODE` | Claude agent-run permission flag: `dontAsk` (default), `acceptEdits`, or `bypass`. `bypass` passes `--dangerously-skip-permissions` and omits `--permission-mode`. Unset or unknown keeps today's `dontAsk` / `HSQ_APPROVAL_GATE`, `CEZ_APPROVAL_GATE` path. Provider verification commands are never given this flag. |
490
- | `HSQ_CLAUDE_SETTING_SOURCES`, `CEZ_CLAUDE_SETTING_SOURCES` | When set, Claude agent runs also pass `--setting-sources <value>` (e.g. `user,project,local`). Unset or empty omits the flag. Provider verification is never given this flag. |
491
- | `HSQ_ARCHIVE_ON_MERGE=1`, `CEZ_ARCHIVE_ON_MERGE=1` | Archive settled task families after all associated pull requests merge. Off by default; only `1` enables this environment default. Saved project settings override global Tasks settings, which override the environment. Runs in the background while the cockpit is open, including unopened projects, without starting agents. Unarchive preserves restored tasks until a later merge. |
492
- | `HSQ_AUTOMATIONS=0`, `CEZ_AUTOMATIONS=0` | Disable **automations** (GitHub polls and schedules). On by default; only the exact value `0` disables them. Unset, empty, `1` and other values keep them on. The Automations view and agent schedule tools are available by default. New automations start paused; each enabled automation launches an ordinary task per match or occurrence while Squawk is open. Schedules need no GitHub remote. With `0`, nothing polls or fires, automation endpoints answer `409`, and the nav item and schedule tools are hidden. Read at boot: restart after changing it. Existing enabled definitions resume after an upgrade unless you set `HSQ_AUTOMATIONS=0`, `CEZ_AUTOMATIONS=0` before restart. Definitions, receipts and high-watermarks are retained; unset the flag and restart to resume without migration. |
493
- | `HSQ_PREVIEW=1`, `CEZ_PREVIEW=1` | Turn on **live preview** (experimental): agents register a dev server with the `cezar_preview_serve` tool, and the cockpit opens it in a headless Chromium on the host, docked next to the task. Squawk first runs a registered command after you press Run and open. Agents can then use `cezar_preview_stop({ port, restart?: boolean })` to stop or restart their own Squawk-started server with that unchanged approval; changed command, cwd or path needs Run and open again. Adopted servers cannot be stopped by this tool. Each agent session also gets `HSQ_PREVIEW_CDP_URL`, `CEZ_PREVIEW_CDP_URL`, a cockpit address through which it drives the same browser (`agent-browser --cdp "$CEZ_PREVIEW_CDP_URL" --pin-tab …`) while you watch; Chromium itself opens no debug port. Off by default, and only the exact value `1` enables it — without it the tool is not listed, its route and the preview WebSocket refuse, and `capabilities.preview` is `false`. Read at boot, so restart after changing it. |
494
- | `HSQ_PREVIEW_NO_SANDBOX=1`, `CEZ_PREVIEW_NO_SANDBOX=1` | Launch the preview's Chromium with `--no-sandbox`. Off by default and never added automatically, not even for root or in a container; use it only where Chromium's sandbox cannot start, and only for pages you trust. Only the exact value `1` applies. Read at boot. |
495
- | `HSQ_AUTOSAVE=1`, `CEZ_AUTOSAVE=1` | Re-enable the periodic (90 s) autosave commit in task worktrees. Off by default (open-mercato/cezar#471) — turn-end and pre-PR flushes always run, so branches still end complete. Every autosave names its trigger in the commit subject (`cezar autosave (periodic)` vs `(turn end)` / `(run finalize)` / `(pre-PR)`), so the flushes you keep are distinguishable from the timer you disabled. The turn-end / run-finalize flushes and the timer commit only while HEAD is the task's own `cez/<id8>` branch; on a branch the agent checked out they leave the work uncommitted, and the closing flush says so in the handoff's Squawk records block, not its Progress log (hearsay-tools/cezarion#1004, hearsay-tools/cezarion#1809). A turn-end / run-finalize commit is reported there too, with its `git reset --soft` fold-back command, and the timer's commits share one line per run of consecutive periodic commits (count, first and latest sha), with no cockpit note. Draft-PR publish refuses while HEAD is not on the task branch and names both branches; its pre-PR flush commits only onto that branch (hearsay-tools/squawk#1110). |
496
- | `HSQ_CLAUDE_BIN=/path/to/claude`, `CEZ_CLAUDE_BIN=/path/to/claude` | Override the Claude executable for model discovery and execution. A set `HSQ_CLAUDE_BIN` wins over `CEZ_CLAUDE_BIN`; an explicit binary argument wins over both. |
497
- | `HSQ_CODEX_BIN=/path/to/codex`, `CEZ_CODEX_BIN=/path/to/codex` | Override which `codex` binary is used. |
498
- | `HSQ_OPENCODE_BIN=/path/to/opencode`, `CEZ_OPENCODE_BIN=/path/to/opencode` | Override which `opencode` binary is used. |
499
- | `HSQ_PI_BIN=/path/to/pi`, `CEZ_PI_BIN=/path/to/pi` | Override which `pi` binary is used. |
500
- | `HSQ_OMP_BIN=/path/to/omp`, `CEZ_OMP_BIN=/path/to/omp` | Override which `omp` (Oh My Pi) binary is used. |
501
- | `HSQ_CURSOR_BIN=/path/to/agent`, `CEZ_CURSOR_BIN=/path/to/agent` | Override the Cursor CLI (`agent`) executable. |
502
- | `CLAUDE_CONFIG_DIR`, `CODEX_HOME`, `PI_CODING_AGENT_DIR`, `OMP_PROFILE` | The agents' **own** variables, honoured where the vendor documents one. Setting one moves that agent's **default account** — the config folder (for omp, the profile) Squawk discovers. A *second* login of the same CLI is deliberately not an environment setting, since one process-wide value cannot differ per project: add it under **Settings → Agent accounts** and pick it per project. |
503
- | `HSQ_BROWSE_ROOT=~/`, `CEZ_BROWSE_ROOT=~/` | Default root for **Add project → Open local folder…**. The picker cannot navigate above it; a saved workspace value overrides the environment default and must name an existing folder. |
504
- | `HSQ_PROJECTS_DIR=~/cezar/projects`, `CEZ_PROJECTS_DIR=~/cezar/projects` | Default destination for **Clone from GitHub** and **New project**. Saved workspace settings override it, and missing directories are created recursively. |
505
- | `HSQ_PROJECT_WARMUP=0`, `CEZ_PROJECT_WARMUP=0` | Prepare each registered project only when it is first opened. By default the cockpit prepares every other registered project in the background once it listens, one at a time, most recently opened first: the run store opens and interrupted runs resume, so the first click on a project does not wait. A project another live cockpit serves is skipped. |
506
- | `HSQ_AUTONOMOUS_DEFAULT=0`, `CEZ_AUTONOMOUS_DEFAULT=0` | Seed the New Task Autonomous default (`0` or `1`). Without a seed, skills default on and workflows off; a saved global Resources setting overrides it. |
507
- | `HSQ_WORKTREE_DEFAULT=1`, `CEZ_WORKTREE_DEFAULT=1` | Seed the New Task Worktree default (`0` or `1`). Without a seed, eligible runs default on; a saved global Resources setting overrides it. |
508
- | `HSQ_DISABLE_REPO_LOCK=1`, `CEZ_DISABLE_REPO_LOCK=1` | **Dangerous escape hatch:** allow any run executing in the repository root — an explicit `worktree=false` run, non-Git degradation, or a continuation whose worktree cannot be restored — to proceed without Squawk’s repository-root lease. Agents can overwrite each other’s files or Git state; isolated worktree runs are unaffected. Off by default; only the exact value `1` enables it. |
509
- | `HSQ_HIDE_TOKEN_USAGE=1`, `CEZ_HIDE_TOKEN_USAGE=1` | Hide raw input/output token counts throughout the browser cockpit while leaving backend-reported cost visible. Only the exact value `1` enables it; telemetry and API payloads are unchanged, and a restart is required after changing it. |
510
- | `HSQ_HIDE_COST=1`, `CEZ_HIDE_COST=1` | Hide backend-reported monetary cost throughout the browser cockpit while leaving raw input/output token counts visible. Only the exact value `1` enables it; telemetry and API payloads are unchanged, and a restart is required after changing it. |
511
- | `HSQ_HIDE_TOKEN_METRICS=1`, `CEZ_HIDE_TOKEN_METRICS=1` | Legacy master switch that hides both token usage and cost. It takes precedence over the two independent flags; only the exact value `1` enables it, payloads are unchanged, and a restart is required. |
512
- | `GITHUB_TOKEN` | Fallback for GitHub reads/PRs when `gh` isn't authenticated. |
513
- | `HSQ_HOME=/path/to/home` (`CEZ_HOME` fallback) | Selects `config/`, `state/`, `data/`, `cache/`, and `run/` below this directory. With neither set, uses the [platform roots](docs/migration.md#home-directories). A non-default `CEZ_HOME` keeps its permanent one-root fallback; an explicit legacy-default `CEZ_HOME` uses the platform roots. Both home locators are removed from child environments. |
514
- | `HSQ_ENV_PASSTHROUGH=A,B`, `CEZ_ENV_PASSTHROUGH=A,B` | Forward these extra host env vars to spawned agents. `CEZ_HOME` and `HSQ_HOME` are always removed, including in full-env mode. By default agents get a least-privilege env (safe shell/toolchain vars + the backend's own auth + `GITHUB_TOKEN` + `HSQ_*` and matching `CEZ_*` aliases), not your full environment — use this to add a var an agent needs. A dev server live preview starts gets the same env without the backend's auth and `GITHUB_TOKEN`, plus these names. |
515
- | `HSQ_AGENT_ENV_FULL=1`, `CEZ_AGENT_ENV_FULL=1` | Escape hatch: give spawned agents, and dev servers live preview starts, the full host environment except `CEZ_HOME` and `HSQ_HOME` (pre-hardening behavior). Off by default; only set it if you understand that this hands every host secret to the agent process. |
516
- | `HSQ_AGENT_TMPDIR=0`, `CEZ_AGENT_TMPDIR=0` | Stop giving each task its own temp directory and hand agents the host `TMPDIR` again (pre-open-mercato/cezar#785 behavior). On by default: every run gets `TMPDIR`/`TEMP`/`TMP` pointing at `.ai/cezar/t/<task-id8>` (`.ai/cezar/tmp/<task-id>` before hearsay-tools/cezarion#1022), created and write-probed before the agent spawns, kept across session close, Continue, and restart while the task is live, and reaped at terminal completion or history deletion (hearsay-tools/cezarion#515) — and kept short enough for unix-socket paths: a checkout so deep that `.ai/cezar/t/<task-id8>` would leave no room under the kernel's socket-path limit for Chromium's singleton socket resolves it to a `cez-agent-…` directory under the system temp dir instead (hearsay-tools/cezarion#387), with its location recorded so host temp-environment changes cannot move live scratch. So concurrent tasks stop sharing one directory and a task refuses to start rather than run against a temp directory that silently swallows its shell output (see Troubleshooting below). Only an exact `0` disables it, and it disables the whole thing — the pre-spawn check included, so this stays an escape hatch you can actually take. |
517
- | `HSQ_REDACT_SECRETS=0`, `CEZ_REDACT_SECRETS=0` | Disable scrubbing of credential values/token shapes from the on-disk state (the NDJSON transcript and the free-text fields of the run records in `runs.db`). On by default; leave it on. Controller-generated delegation tokens are always scrubbed. Best-effort defense-in-depth, not a guarantee: it catches known token shapes and the values of your own secret-named env vars, so a credential in neither category can still get through. |
518
- | `HSQ_TITLE_UPDATES=0`, `CEZ_TITLE_UPDATES=0` | Turn off the live task-title refresh (namer re-runs on each turn end). The Settings → Agents toggle overrides this default. |
519
- | `HSQ_AUTONAME=0`, `CEZ_AUTONAME=0` | Disable ALL LLM task naming (creation + live) — titles stay heuristic (`437: /om-auto-review-pr`). Under `HSQ_DRY_RUN=1`, `CEZ_DRY_RUN=1` naming is already off unless forced with `HSQ_AUTONAME=1`, `CEZ_AUTONAME=1`. |
520
- | `HSQ_REVIEW_GATE=1`, `CEZ_REVIEW_GATE=1` | Turn ON the optional diff-first review gate (open-mercato/cezar#489): a successful, non-autonomous run with changes parks at `review` (Accept / Send back / Draft PR) instead of finishing. Off by default — changed runs settle to `done` with the diff left in the worktree. Only `1` enables. The Settings → Agents toggle overrides this; autonomous runs always skip it. |
521
- | `VITE_HSQ_API_BASE=http://localhost:4321`, `VITE_CEZ_API_BASE=http://localhost:4321` | **Build time only**, and only when the cockpit bundle is deployed apart from the service it talks to. Empty (the default) means "the origin that served this page", which is right for both normal cases: the CLI serves the bundle itself, and `npm run dev` proxies `/api` to the local service. A deployment that must be configured without a rebuild can put `<meta name="cez-api-base" content="…">` in the served HTML instead, which wins over this. |
522
- | `VITE_HSQ_E2E=1`, `VITE_CEZ_E2E=1` | **Build time only.** The cockpit e2e suite sets this when it builds the bundle it drives. It pins `useNow` and every `refetchInterval` so a wait cannot span a 30s tick or a 4s poll. Leave unset for production. |
523
-
524
- ### Troubleshooting: the agent's shell returns nothing
525
-
526
- **Symptom.** A task on the Claude backend keeps working, but every shell command
527
- comes back with no output and a spurious non-zero exit status — `echo hello`
528
- included. Redirecting into a file inside the worktree still produces the right
529
- content, so the commands genuinely run; only the *capture* is lost. Codex tasks
530
- on the same machine are unaffected, because that backend streams over stdio
531
- pipes instead of round-tripping a command's output through a temp file.
532
-
533
- **Diagnosis.** The temp directory the agent was given is out of space or out of
534
- quota. One line tells you:
535
-
536
- ```bash
537
- echo probe > "${TMPDIR:-/tmp}/probe" # "Disk quota exceeded" / "No space left on device"
538
- df -i "${TMPDIR:-/tmp}" # a tmpfs can exhaust inodes long before bytes
539
- ```
540
-
541
- Under quota the file is *created* and the write then fails, so the backend reads
542
- back a zero-byte capture file and hands the agent an empty result.
543
-
544
- **Fix.** Since open-mercato/cezar#785 Squawk gives each task its own `TMPDIR` under
545
- `.ai/cezar/t/<task-id8>` and write-probes it before spawning, so a broken temp
546
- directory fails the task with `agent temp directory is not writable: …` on the
547
- task thread instead of corrupting its work. If you see that error, free space on
548
- the disk holding the repo. `HSQ_AGENT_TMPDIR=0` (`CEZ_AGENT_TMPDIR` fallback) turns the whole mechanism off —
549
- per-task directory and pre-spawn check alike — and hands agents the host
550
- `TMPDIR` again, which is the way out if the check itself is wrong on your
551
- platform.
552
-
553
- ### Troubleshooting: tools inside a task fail with a socket-path error
554
-
555
- **Symptom.** Inside a task, `npm install`, `npm run typecheck`, or another tool
556
- dies with `listen EINVAL` or a "socket path too long" / `ENAMETOOLONG` error —
557
- with `TMPDIR=/tmp` set by hand, the same commands succeed. Tools like `tsx` bind
558
- *named* unix sockets under `TMPDIR` (its IPC server builds
559
- `<tmpdir>/tsx-<uid>/<pid>.pipe`), and the kernel caps a socket path at 104–108
560
- bytes — a temp directory near that length leaves no room for the name.
561
-
562
- **Fix.** Since hearsay-tools/cezarion#387 Squawk keeps each task's temp directory short
563
- enough for these sockets: at most 58 bytes since hearsay-tools/cezarion#1022, which
564
- leaves room for Chromium's `<tmpdir>/org.chromium.Chromium.XXXXXX/SingletonSocket`
565
- on macOS's 104-byte limit. The repo-local directory is `.ai/cezar/t/<task-id8>`
566
- (the first 8 characters of the task id), short enough for ordinary checkouts such
567
- as `/home/<user>/projects/<repo>`. A checkout deep enough to push it past the limit
568
- gets a short `cez-agent-…` directory under the system temp directory instead —
569
- still per-task, still write-probed before the agent spawns, still reaped when the
570
- run ends.
571
- `HSQ_AGENT_TMPDIR=0` (`CEZ_AGENT_TMPDIR` fallback) reverts the whole mechanism to the host `TMPDIR`.
572
-
573
- ---
438
+ See [How it runs agents](docs/areas/runners.md).
574
439
 
575
440
  ## Coding agent backends
576
441
 
577
- Squawk is not married to one vendor. Every agent step runs through a single
578
- `AgentRunner` seam with six built-in backends:
579
-
580
- | Backend | CLI | How Squawk drives it | Tool access |
581
- |---|---|---|---|
582
- | **Claude Code** (default) | [`claude`](https://github.com/anthropics/claude-code) | Headless `stream-json` mode. | Per-tool `--allowedTools` (`bashAllowlist` scopes `Bash`); an empty `allowedTools` sends `--tools ""`, which removes every built-in tool, and pre-approves Squawk's own tools (other MCP tools follow the permission mode); `dontAsk` denies unapproved tools without prompting (`HSQ_APPROVAL_GATE=1` (`CEZ_APPROVAL_GATE` fallback) → `acceptEdits` + approval UI; `HSQ_CLAUDE_PERMISSION_MODE=bypass` (`CEZ_CLAUDE_PERMISSION_MODE` fallback) → `--dangerously-skip-permissions`). |
583
- | **Codex** | [`codex`](https://github.com/openai/codex) | `codex app-server` — JSON-RPC over stdio, the same transport the Codex IDE extensions use. | Ignores `allowedTools`; inherits managed permissions and Codex approval defaults. Confirmed unmanaged sessions use `danger-full-access`. `HSQ_CODEX_NETWORK=0` (`CEZ_CODEX_NETWORK` fallback) requires network restriction: unmanaged sessions use network-blocked `workspace-write`; managed filesystem rules remain intact, and an unconfirmed network restriction stops before any turn. If requirements discovery is unavailable, Codex permission defaults apply. |
584
- | **OpenCode** _(experimental)_ | [`opencode`](https://opencode.ai) | `opencode serve` — a local HTTP server with an SSE event stream. | Ignores `allowedTools` entirely; OpenCode's own permission config governs. Squawk answers OpenCode's built-in asks (outside-worktree reads, `.env` reads, the repeated-call guard) once, unless your config has a rule for that permission. Any other ask shows a permission card in the cockpit, and the run waits for your answer. |
585
- | **Cursor** | [`agent`](https://cursor.com/docs/cli/installation) | Resumable `--print --output-format stream-json` turns on a qualified build; an unqualified build fails the task before inference. | Print mode admits marketplace plugins, including user and team plugins. Per-run `allowedTools` and `bashAllowlist` are unsupported. |
586
- | **pi** _(experimental)_ | [`pi`](https://github.com/badlogic/pi-mono) | Persistent `--mode rpc` over JSONL; models are picked with the `provider/model` convention. | Maps `allowedTools` onto pi tool names. The default list, which adds the harness extras `Subagent`, `SubagentSupervisor` and `SubagentWait`, sends no allowlist: `--no-builtin-tools` plus a bundled extension that activates those built-ins, so MCP servers (`direct`, `codemode` and `deferred` exposure) and other pi extensions' tools stay callable. The six base tools alone, the list a worker inherits from a Claude parent, take the same path. A narrowed `allowedTools`, or one that names any tool outside that default set (an `mcp__` tool, `WebFetch` or a custom tool), uses pi's `--tools` allowlist, so a step that grants named tools reaches only those; a list that maps to nothing becomes `--no-tools` (or only the Squawk tools). A configured `bashAllowlist` disables Bash because pi cannot express command-prefix rules. |
587
- | **OMP** _(experimental)_ | [`omp`](https://github.com/can1357/oh-my-pi) | Persistent `--mode rpc` over JSONL (Oh My Pi, a pi fork); models use the `provider/model` convention and are discovered from `omp models --json`. | Maps `allowedTools` onto OMP's `--tools` allowlist (`[]` becomes `--no-tools`); default sessions also pass `todo`, `lsp`, `ast_edit`, `task` and `wait`. A configured `bashAllowlist` disables `bash` because OMP cannot express command-prefix rules. `--tools` filters built-in tools only, so MCP and extension tools stay callable under a narrowed list. |
588
-
589
- > ⚠️ **OpenCode, pi and OMP support are experimental.** These runners work but are less
590
- > battle-tested than the Claude Code and Codex backends, and OpenCode ignores
591
- > `allowedTools` (its own permission config governs what it asks). Treat them as
592
- > previews and expect rough edges.
593
-
594
- On startup Squawk probes which CLIs are installed and the cockpit only offers
595
- the backends it found — install any one of the six and you're operational.
596
-
597
- ### Cursor CLI
598
-
599
- Install [Cursor CLI](https://cursor.com/docs/cli/installation) and run `agent login`,
600
- or set `CURSOR_API_KEY`. Squawk discovers `agent` on PATH; `HSQ_CURSOR_BIN` (`CEZ_CURSOR_BIN` fallback) overrides
601
- its location. Select **Cursor** in the runner picker. On build
602
- `2026.10.01-e373342` or newer, new sessions use print mode so marketplace plugins
603
- are available. Squawk checks `agent --version` and the native tool catalog before
604
- the first turn; `agent --version` is also the quick way to check your installation.
605
- Squawk starts the CLI with `--disable-auto-update`, so a task never updates it;
606
- update it yourself with `agent update`. An older build, or a build missing a core
607
- tool, fails the task before any inference, with the reason and the fix: run
608
- `agent update`, or update Squawk if your build is newer than it supports.
609
- ACP-tagged and untagged Cursor sessions cannot resume after ACP removal: Continue
610
- on one reports that, and you start a new task to carry the work on. Existing
611
- print-tagged sessions can still resume.
612
- A missing CLI leaves the other backends available. `HSQ_DRY_RUN=1` (`CEZ_DRY_RUN` fallback) uses the mock.
613
- Cursor questions from a plugin may be automatically skipped by print mode. Squawk's
614
- own `cezar_ask` questions remain answerable in the cockpit; plugins that require
615
- native questions may not work fully. Project-local Claude plugin settings may
616
- not disable a user or team marketplace copy. A previously confirmed Cursor
617
- session ID can also lose history inside Cursor without an error; Squawk resumes
618
- the recorded ID and checks that Cursor returns the same ID.
619
- Cursor provides no qualified token-usage telemetry; Squawk leaves usage unavailable
620
- instead of estimating it. Squawk discovers Cursor's canonical model IDs and advertised
621
- effort levels through Cursor's read-only ACP model catalog (`agent acp`), which opens
622
- no session. Print mode accepts those IDs and applies effort using a complete native
623
- parameter selection passed with `--model`, retaining the account catalog's defaults for
624
- other parameters. Advertised legacy print variants remain supported. An unsupported
625
- explicit effort fails instead of silently choosing another level.
626
-
627
- Settings → Agent config exposes Cursor’s global `cli-config.json`, project
628
- `.cursor/cli.json` permissions, `.cursor/mcp.json`, and shared `AGENTS.md`.
629
- [Cursor’s configuration reference](https://cursor.com/docs/cli/reference/configuration)
630
- documents `CURSOR_CONFIG_DIR` and the Linux/BSD `XDG_CONFIG_HOME/cursor` override.
631
- These select configuration; Squawk does not offer alternate Cursor account profiles
632
- because a complete credential-and-session home override has not been verified.
633
-
634
- ### OMP (Oh My Pi)
635
-
636
- Install [OMP](https://github.com/can1357/oh-my-pi) (`curl -fsSL https://omp.sh/install | sh`
637
- installs a prebuilt binary; Bun is needed only for `--source`) and run `omp login`. Squawk discovers `omp` on PATH;
638
- `HSQ_OMP_BIN` (`CEZ_OMP_BIN` fallback) overrides its location. `omp` is a separate backend from `pi`: a host with
639
- both binaries keeps both, and `HSQ_PI_BIN` (`CEZ_PI_BIN` fallback) never selects OMP. Select **OMP** in the runner
640
- picker to use a persistent `--mode rpc` session. A missing CLI leaves the other backends
641
- available and shows OMP as unavailable. `HSQ_DRY_RUN=1` (`CEZ_DRY_RUN` fallback) uses the mock.
642
-
643
- Agents ask questions through Squawk's `cezar_ask` tool, and OMP's own sub-agents appear in the
644
- Agents drawer. Settings → Agent config exposes OMP's `config.yml`, `mcp.json` and
645
- `AGENTS.md` files. Named OMP profiles and accounts are not supported yet.
646
-
647
- **Pick a backend at three levels** (most specific wins):
648
-
649
- 1. **Config default** — `"defaultRunner": "codex"` in `.ai/cezar/config.json`.
650
- 2. **Per task** — the backend picker next to the task box in the cockpit.
651
- 3. **Per workflow step** — `runner:` on any step in the YAML.
652
-
653
- Per-step overrides are what make **mixed-agent strategies** a one-liner:
654
- implement with one agent, review with another, and let a shell check referee:
655
-
656
- ```yaml
657
- name: implement-and-cross-review
658
- steps:
659
- - id: implement
660
- name: Implement
661
- prompt: "{{task}}"
662
- runner: codex # one vendor writes the code…
663
- effort: medium # …with a cheaper reasoning pass
664
- - id: review
665
- name: Cross-review
666
- prompt: "Review the diff produced for: {{task}}. Fix real issues only."
667
- runner: claude # …another one reviews it
668
- effort: high # …with more reasoning for review
669
- - id: verify
670
- name: Verify
671
- command: "npm test"
672
- onFail: { retry: implement, max: 2 }
673
- ```
674
-
675
- Owned workers can compare approaches in separate worktrees. Each worker has its own
676
- runner and model selection; see [Owned workers](docs/workers.md#owned-workers).
677
-
678
- **Models come from your own machine.** For Claude, Codex, OpenCode, and Pi, the model picker
679
- is not a list Squawk ships — it asks the installed CLI what it can actually run
680
- (Claude stream-json `list_models`, `codex app-server`'s `model/list`,
681
- `opencode models`, and `pi --list-models`), caches the answer in
682
- memory for five minutes, and shows it. A model your provider rolled out
683
- yesterday is selectable without a Squawk release, and one it retired stops being
684
- offered. Claude discovery starts no model turn and uses safe mode with no session
685
- persistence. It has a 15-second deadline and a 200-model cap, with child cleanup
686
- on every outcome. Unsupported or unavailable Claude CLIs fall back to the
687
- `opus`, `sonnet`, and `haiku` aliases. `auto` (let the agent decide) is always
688
- available, including when the CLI is missing, logged out, or slow — discovery
689
- never blocks the cockpit, and a model you pinned yourself stays selectable even
690
- if it is absent from the discovered list.
691
-
692
- The seam is deliberately small: a backend is one class implementing the
693
- `AgentRunner` interface (`packages/cezar/src/core/agent-runner.ts`) that turns a prompt into
694
- a stream of normalized events. Other CLIs — pi, aider, whatever ships next —
695
- can slot in the same way.
696
-
697
- ---
442
+ See [Coding agent backends](docs/areas/runners.md).
698
443
 
699
444
  ## Desktop app
700
445
 
701
- Squawk Desktop is a Tauri 2 app for macOS, Windows and Linux. Start a local cockpit
702
- or connect to a remote HTTPS cockpit (loopback HTTP supports SSH tunnels). Remote
703
- windows have no native command permissions and need no local Node or agent install.
704
- Local mode needs Node.js 24.21.0+ and npm, then installs `@hearsay-tools/squawk` on first use.
705
-
706
- See [desktop installation, development and testing](docs/desktop.md). PR builds
707
- provide test installers; public releases require platform signing and notarization.
446
+ See [Desktop app](docs/desktop.md).
708
447
 
709
448
  ## Remote access (host Squawk on a server)
710
449
 
711
- Squawk runs on `localhost` by default. To reach the cockpit from another machine —
712
- a shared team box, a VPS, your phone — put an **authenticated public front** in
713
- front of it. The built-in installer does this interactively, per **platform
714
- strategy**, and never escalates silently: every privileged command is printed
715
- and verified, and it ends with a real authenticated end-to-end check.
716
-
717
- ```bash
718
- npx -p @hearsay-tools/squawk hsq server-install --platform ubuntu-vps # stand it up
719
- npx -p @hearsay-tools/squawk hsq server-deploy --platform ubuntu-vps # roll out a new version (reload the service)
720
- npx -p @hearsay-tools/squawk hsq server-uninstall --platform ubuntu-vps # reverse it
721
-
722
- # host a SECOND cockpit for another domain on the same box (ubuntu-vps):
723
-
724
- npx -p @hearsay-tools/squawk hsq server-install --platform ubuntu-vps --domain shop.example.com
725
- ```
726
-
727
- On `ubuntu-vps` a single host can run several independent cockpits — add
728
- `--domain <host>` and each gets its own port, nginx site, login and service; a
729
- new domain never resumes or clobbers the first install.
730
-
731
- **Already running a reverse proxy?** If Dokploy, Coolify, Caddy or your own
732
- nginx already owns `:80/:443`, Squawk's would fight it for the ports. Install the
733
- service only and let your proxy front it:
734
-
735
- ```bash
736
- npx -p @hearsay-tools/squawk hsq server-install --platform ubuntu-vps \
737
- --external-proxy --domain Squawk.example.com --bind-host 172.17.0.1
738
- ```
739
-
740
- `--bind-host` is only needed when the proxy runs in a **container** (Traefik
741
- can't reach the host's loopback); a host-installed proxy uses the `127.0.0.1`
742
- default. In this mode **your proxy must enforce authentication** — Squawk has
743
- none of its own. [Details →](docs/server-install/ubuntu-vps.md#the-box-already-has-a-reverse-proxy-dokploy-coolify-caddy)
744
-
745
- | Provider | `--platform` | Public front | Guide |
746
- |----------|--------------|--------------|-------|
747
- | Ubuntu / Debian VPS | `ubuntu-vps` | nginx + Let's Encrypt HTTPS, htpasswd login, systemd | [Step-by-step →](docs/server-install/ubuntu-vps.md) |
748
- | Ubuntu + existing proxy | `ubuntu-vps --external-proxy` | your Dokploy/Traefik/Caddy front; Squawk ships the service only | [Step-by-step →](docs/server-install/ubuntu-vps.md#the-box-already-has-a-reverse-proxy-dokploy-coolify-caddy) |
749
- | macOS + ngrok | `macosx-ngrok` | ngrok tunnel + `--basic-auth`, launchd | [Step-by-step →](docs/server-install/macosx-ngrok.md) |
750
-
751
- See the **[Remote access overview](docs/server-install/README.md)** for how it
752
- works and how to redeploy new versions. A remote cockpit keeps Agent config and
753
- worktree setup read-only; to edit them from the browser, see
754
- **[Remote settings administration](docs/server-install/remote-settings.md)**.
755
-
756
- ---
450
+ See [Remote access (host Squawk on a server)](docs/remote-access.md).
757
451
 
758
452
  ## Reviewing task files
759
453
 
760
- File links in task messages open the Files tab at the selected file, rather than
761
- navigating to a host path under the cockpit URL. The selection stays in the URL,
762
- so bookmarks and browser Back work. This works with local and remote cockpits.
763
-
764
- For a deliverable outside the project, an agent must explicitly publish a snapshot:
765
-
766
- ```sh
767
- hsq artifact publish /tmp/decision.md
768
- ```
769
-
770
- An agent starts a long command, such as a benchmark or a full test run, with `hsq job start`:
771
-
772
- ```sh
773
- hsq job start bench -- npm run benchmark
774
- hsq job status bench
775
- ```
776
-
777
- The command keeps running after the agent's shell call, turn and session end. It prints the
778
- paths of its log file and its exit-code file, which are in the task's temp directory unless
779
- `--dir` names another one. The agent waits for it with a process wait. A second start of a
780
- name that still runs is refused.
781
-
782
- Squawk supplies the bundled command and task context to agent sessions automatically
783
- (`HSQ_TASK_ID` (`CEZ_TASK_ID` fallback) and `HSQ_ARTIFACTS_DIR` (`CEZ_ARTIFACTS_DIR` fallback); do not configure these yourself). The command
784
- returns JSON with a Markdown link for the agent to share. When the owning project
785
- is registered, the link keeps that project when copied or opened from another
786
- project. If ownership cannot be discovered, publication keeps the legacy task link.
787
- The Files tab also lists published artifacts. It previews text, Markdown and raster
788
- images; other formats can be downloaded. Published HTML links in assistant replies also
789
- show report cards. **Read report** opens the sandboxed reader beside the conversation
790
- on wide screens, in the main area on medium screens, and full screen on phones.
791
- Back returns to the source card. Unopened cards fetch metadata only.
792
- Report scripts never execute, and embedded images in Markdown documents do not load
793
- automatically.
794
-
795
- Snapshots do not change when the original file changes. They survive worktree
796
- removal and are removed with task history, including normal history retention.
797
- Publication is limited to 10 MiB per file, 64 snapshots and 64 MiB per task; reaching
798
- a limit refuses the new publication without evicting earlier files. There is no
799
- arbitrary host-file reader or automatic collection of mentioned paths. Publish
800
- only intended review material, never credentials or unrelated private files.
454
+ See [Reviewing task files](docs/task-files.md).
801
455
 
802
456
  ## Configuration (optional)
803
457
 
804
- Zero config is the default — everything below is opt-in via the project's
805
- `config.json` in `.ai/squawk/` (`.ai/cezar/` before the project moves). A missing
806
- or malformed file uses the defaults, a bad value falls back to its own default,
807
- nothing blocks startup, and the cockpit never saves over a file that is not valid
808
- JSON:
809
-
810
- ```jsonc
811
- {
812
- "skillsRepos": [], // team skills; none by default. Example: [{ "repo": "open-mercato/skills", "ref": "main" }]
813
- // Team-skill repos are code-trusted: a skill body becomes an agent system prompt.
814
- // Only owner/name, https/ssh URLs, or local paths (`/abs`, `./rel`, `~/dir`,
815
- // `C:\dir`) are accepted — no ext::/fd:: transport helpers. Write a relative
816
- // path as `./name`, not a bare `name`. Pin `ref` to a full commit SHA to freeze
817
- // the source against a moving branch head — Squawk verifies it resolves to
818
- // exactly that commit, and reports it as `team.commit`. `"enabled": false` keeps
819
- // a source listed but loads none of its skills. The Skills page edits this list,
820
- // keeps every other key, and refuses to write a file it cannot read.
821
- "worktreeRetention": 10, // keep the last N finished worktrees on disk; 0 = unlimited (no reclaim, no branch sweep)
822
- "defaultRunner": "claude", // agent backend: "claude" (default) · "codex" · "opencode" · "cursor" · "pi" · "omp"
823
- "modelsLocked": true, // optional: native per-runner model is fixed/read-only; runner stays selectable
824
- "plannerModel": "sonnet", // model the "Plan first" button uses to draft chains
825
- "baseBranch": "develop", // branch worktrees fork from + PRs target (also settable in the Git view)
826
- "worktreeSetup": { "commands": ["npm ci"] }, // prepare each new worktree before the agent starts (below)
827
- "worktreeTeardown": { "commands": ["docker compose down"] } // stop a worker worktree's own services before destroy (below)
828
- }
829
- ```
830
-
831
- Put the same `"modelsLocked": true` key in `<config>/config.json` to apply it
832
- to every registered project. When the key is absent or `false` in both config
833
- files (and `HSQ_AGENT_MODELS_LOCKED` (`CEZ_AGENT_MODELS_LOCKED` fallback) is not `1`), each runner's normal model
834
- selector uses that runner's discovered model list. While locked, the model is
835
- shown read-only and follows the selected runner's native settings; the runner
836
- itself remains selectable.
837
-
838
- Run data (`runs.db` and its `-wal`/`-shm` files, the `runs.json.pre-sqlite*.bak`
839
- backups, NDJSON event logs, worktrees, `todos.json`) is git-ignored
840
- automatically; your workflows and skills stay committable. See [run history recovery](https://github.com/hearsay-tools/cezarion/blob/main/docs/run-history-recovery.md) for backup and repair steps.
841
-
842
- Settings that belong to *you* rather than to a repo — the parallel cap
843
- (`maxParallel`, default **2**), the per-task memory ceiling and the checkout
844
- root — live once in `<config>/config.json`, alongside the
845
- [project registry](docs/areas/workspace-registry.md#multiple-projects-one-cockpit), and are edited from
846
- **Settings → Resources** and **Settings → Projects**. A `maxParallel` left over
847
- in a repo's `.ai/cezar/config.json` is imported into the workspace file the
848
- first time Squawk boots there, and ignored afterwards.
849
-
850
- ### Session-start context
851
-
852
- Every session Squawk launches — a fresh step, a retry, **Continue**, recovery, an owned
853
- worker — opens with the run's whole handoff file, so the agent has its notes without a tool
854
- call. Add your own context, such as a vision document, with an optional
855
- `.ai/cezar/context.yaml`:
856
-
857
- ```yaml
858
- version: 1
859
- rules:
860
- - id: project-vision
861
- on: session_start
862
- target: both # parent · worker · both
863
- template: |
864
- Project vision:
865
- {{file:docs/vision.md}}
866
- ```
867
-
868
- The whole prefix is capped at 64 KiB, blocks that do not fit are skipped whole, and each launch
869
- logs which blocks it applied or skipped. See [docs/context-injection.md](docs/context-injection.md)
870
- for the variables, the limits and the error handling.
871
-
872
- ### Preparing new worktrees
873
-
874
- Every task and worker runs in a fresh worktree, and a fresh worktree has nothing installed. Give
875
- the project a `worktreeSetup` and Squawk runs those commands in each new worktree before the
876
- agent's first turn, so the agent (and anything that runs beside it, such as a test watcher)
877
- starts in a ready tree:
878
-
879
- ```jsonc
880
- // .ai/squawk/config.json (.ai/cezar/config.json before the project moves)
881
- "worktreeSetup": {
882
- "commands": ["npm ci", "cp \"$HSQ_PROJECT_ROOT/.env\" .env"],
883
- "timeoutSeconds": 900 // optional, per command; default 900, max 7200
884
- }
885
- ```
886
-
887
- Or edit it in **Settings → Worktrees → Prepare new worktrees**, one command per line. These are
888
- commands the host runs, so a hosted cockpit (`HSQ_REMOTE=1` or `CEZ_REMOTE=1`) shows it read-only until the host
889
- operator runs `hsq remote-settings enable` ([Remote settings administration](docs/server-install/remote-settings.md)).
890
-
891
- - **When it runs.** In every new task worktree and every worker worktree, and again when Continue
892
- rebuilds a worktree that retention reclaimed. Never for a task that runs in the repo working
893
- tree (worktree off), and never for a non-git directory.
894
- - **How it runs.** Each command runs as `bash -lc '<command>'` in the worktree root, in order,
895
- and the setup stops at the first command that fails or times out. Up to 20 commands.
896
- - **What it can see.** The same curated environment the live preview gives a dev server: your
897
- `PATH`, `HOME` and the shell basics, but no agent API keys and no GitHub token. A private
898
- registry token reaches it through `HSQ_ENV_PASSTHROUGH=NPM_TOKEN` (`CEZ_ENV_PASSTHROUGH` fallback) (or the tool's own config
899
- file under `HOME`). It also gets `HSQ_PROJECT_ROOT` (`CEZ_PROJECT_ROOT` fallback) (the main checkout, for copying untracked
900
- files like `.env`) and `HSQ_TASK_ID` (`CEZ_TASK_ID` fallback).
901
- - **What you see.** The task thread shows a "Ran `<command>`" card per command with its output
902
- (the last 20 KB) and a line with the outcome and duration.
903
- - **What the agent sees.** Its first message says what ran, so it doesn't repeat the install.
904
- If a command fails or times out, the agent still starts and its first message names the
905
- command, the exit code and the end of the output, so it can fix the cause or work around it.
906
- - **Keep generated files gitignored.** Autosave commits whatever Git doesn't ignore, so anything
907
- setup creates outside `.gitignore` becomes part of the task's changes. `node_modules/` and
908
- `.venv/` are usually ignored already.
909
-
910
- Without the key nothing runs, exactly as before. Examples:
911
-
912
- | Project | `commands` |
913
- | --- | --- |
914
- | npm | `["npm ci"]` |
915
- | pnpm | `["pnpm install --frozen-lockfile"]` |
916
- | Python (uv) | `["uv sync --frozen"]` |
917
- | Go | `["go mod download"]` |
918
- | Rust | `["cargo fetch"]` |
919
- | Copy local env | `["cp \"$CEZ_PROJECT_ROOT/.env\" .env"]` |
920
-
921
- ### Stopping a worker worktree's services before destroy
922
-
923
- A worker's worktree can start things that keep running after the worker settles: a test
924
- server, a file watcher, a container. Worker destroy refuses while a process still works in
925
- the worktree, and names each one by its pid and executable name, never its arguments. Give the project a
926
- `worktreeTeardown` and destroy runs those commands in the worker's worktree first:
927
-
928
- ```jsonc
929
- // .ai/squawk/config.json (.ai/cezar/config.json before the project moves)
930
- "worktreeTeardown": {
931
- "commands": ["command -v my-watcher >/dev/null 2>&1 && my-watcher stop . || true"],
932
- "timeoutSeconds": 120 // optional, per command; default 900, max 7200
933
- }
934
- ```
935
-
936
- The key has the shape, the limits and the environment of `worktreeSetup`. The commands run
937
- only in a worktree whose ownership destroy has proven, before it looks for holders. A failed
938
- command or a timeout is recorded in the worker's events, and destroy goes on: a process that
939
- still holds the worktree is named in the refusal and never signalled, and the next retry runs
940
- the teardown again. The key is edited in the config file only; Settings does not show it.
941
- Without the key nothing runs, exactly as before.
942
-
943
- ### Editing the agents' own config (Settings → Agent config)
944
-
945
- Squawk picks *which* agent runs; **Settings → Agent config** lets you edit *how* it
946
- behaves — the raw config files Claude, Codex, OpenCode, Cursor, pi and OMP read
947
- for settings, MCP, and memory. In the multi-project cockpit the section is project-scoped:
948
- repo-relative files resolve from the selected project's root, while user-scope
949
- files continue to resolve from the agent's home.
950
-
951
- Each file keeps its native format and vendor-documented precedence. Tracked
952
- files reach task worktrees after commit; Claude's gitignored personal layer is
953
- seeded into each run's worktree. Config files can define hooks and MCP commands that run
954
- on the host, so a hosted cockpit (`HSQ_REMOTE=1` or `CEZ_REMOTE=1`) is read-only and never serves home-file
955
- contents until the host operator runs `hsq remote-settings enable`
956
- ([Remote settings administration](docs/server-install/remote-settings.md)).
957
-
958
- ---
458
+ See [Configuration (optional)](docs/configuration.md).
959
459
 
960
460
  ## Local development
961
461
 
962
- End-to-end, from a fresh clone to a global `hsq` command you can run in **any**
963
- repo on your machine — no npm publish required.
964
-
965
- **1. Prerequisites** — Node 24.21.0+ and `git` (plus at least one logged-in agent CLI,
966
- as in [Quick start](#quick-start)).
967
-
968
- **2. Clone & install**
969
-
970
- The npm global prefix must be writable by your user. On Unix, use Node installed
971
- with nvm, or set a user-owned prefix (`npm config set prefix ~/.npm-global`) and
972
- add `~/.npm-global/bin` to your `PATH`. On Windows, use a user-owned npm prefix
973
- and add the prefix itself (reported by `npm prefix -g`) to `PATH`; npm puts
974
- Windows executables directly there. Set `PATH` before these commands.
975
-
976
- ```bash
977
- git clone https://github.com/hearsay-tools/cezarion.git
978
- cd cezarion
979
- npm install --global pnpm@12.11.2
980
- pnpm install --frozen-lockfile
981
- ```
982
-
983
- Dependency installation uses pnpm 12.11.2 (pinned in `packageManager`) and
984
- `pnpm-lock.yaml`. Use pnpm for dependency changes; keep npm for the existing
985
- build/test scripts. Workspace dependencies are linked locally and esbuild's
986
- install hook is approved in `pnpm-workspace.yaml`. The store uses hardlinks when
987
- the checkout and store share a filesystem. Publishing and end-user installation
988
- continue to use npm. For this repository's Worktrees setup, use
989
- `pnpm install --frozen-lockfile` after the checked-out base branch contains the migration.
990
-
991
- **3. Build** — compiles the api-client and the server (`tsc → packages/cezar/dist/`) and the cockpit
992
- (`vite build → packages/cezar/web/dist/`), then runs the pack gate:
993
-
994
- ```bash
995
- npm run build
996
- ```
997
-
998
- **4. Install as a global command** — build + put `hsq` on
999
- your PATH pointing at *this checkout*:
1000
-
1001
- ```bash
1002
- npm run install-as-command # live link (default) — see the change loop below
1003
- # or: npm run install-as-command:global # self-contained snapshot copy
1004
-
1005
- ```
1006
-
1007
- Now `cd` into any other repo and run it:
1008
-
1009
- ```bash
1010
- cd ~/some-other-project
1011
- hsq # cockpit for that repo, straight off your checkout
1012
- hsq --help # the same command as `npx -p @hearsay-tools/squawk hsq`
1013
- ```
1014
-
1015
- **5. The change loop**
1016
-
1017
- - **Link mode** (default): edit source → `npm run build` → the global command
1018
- reflects it immediately. No relink needed. (It is a live symlink into this
1019
- checkout — don't move or delete the checkout while it's linked.)
1020
- - **Snapshot mode** (`:global`): re-run `npm run install-as-command:global` to
1021
- refresh the installed copy. It survives moving/deleting the checkout.
1022
-
1023
- **6. Uninstall**
1024
-
1025
- ```bash
1026
- npm run uninstall-as-command # removes hsq and the compatibility commands (either flavor)
1027
- ```
1028
-
1029
- **7. Troubleshooting**
1030
-
1031
- - **`hsq: command not found`** after install → your npm global bin dir isn't on
1032
- PATH. The script prints the exact dir; add it to your shell profile
1033
- (Unix: `export PATH="$(npm prefix -g)/bin:$PATH"`; Windows: add the directory
1034
- reported by `npm prefix -g` itself to `PATH`, without a `bin` suffix).
1035
- - **`EACCES` / permission denied** → your global prefix is root-owned. Point npm
1036
- at a user-writable one and retry — **never** sudo:
1037
- `npm config set prefix ~/.npm-global`.
1038
- - **Already installed the published `@wjarka/cezarion` globally?** The
1039
- link/snapshot install replaces it; `uninstall-as-command` removes ours, and
1040
- `npm i -g @hearsay-tools/squawk` brings the published one back.
1041
-
1042
- ### In-checkout scripts
1043
-
1044
- ```bash
1045
- npm run dev # server (API :4321) + Vite dev server, opens the cockpit in the browser
1046
- npm run dev:server # tsx packages/cezar/src/index.ts — the API server alone
1047
- npm run dev:web # Vite dev server alone (proxies /api to :4321)
1048
- npm run build # tsc → packages/cezar/dist/, vite build → packages/cezar/web/dist/, then the pack gate
1049
- npm run typecheck # check all four workspaces without building
1050
- npm run typecheck:web # check web sources without building
1051
- npm test # vitest — server + cockpit unit suites
1052
- npm run test:changed # iteration only: tests related to branch + working-tree changes
1053
- pnpm metrics <file> # function complexity; add --test <test-file> for coverage and CRAP
1054
- npm run test:unit # node:test — fast core-module tests
1055
- npm run test:package # pack/install and exercise the built CLI
1056
- npm run test:e2e # real-browser cockpit suite (agent-browser)
1057
- npm run test:e2e:local # full browser suite in four isolated, concurrent lanes
1058
- ```
1059
-
1060
- The four-lane local browser run needs roughly 8 GiB of RAM at peak. It keeps CI's
1061
- serial-per-shard policy unchanged. See [cockpit E2E testing](packages/web/e2e/README.md#full-local-suite-in-four-lanes)
1062
- for lane isolation, logs, and cleanup.
1063
-
1064
- Calculate metrics for one JavaScript or TypeScript file, or select a function:
1065
-
1066
- ```bash
1067
- pnpm metrics packages/contract/src/attention.ts
1068
- pnpm metrics packages/contract/src/attention.ts --function deriveAttention
1069
- pnpm --silent metrics packages/contract/src/attention.ts --line 150 --json
1070
- pnpm metrics packages/contract/src/attention.ts --function deriveAttention --test packages/contract/src/attention.test.ts
1071
- pnpm metrics packages/contract/src/attention.ts --coverage coverage/coverage-final.json
1072
- ```
1073
-
1074
- Complexity follows ESLint's classic convention, including short-circuit operators,
1075
- optional chaining, default parameters and each non-default switch case. Functions,
1076
- methods and arrow functions have separate scores. Module and class initialization
1077
- are excluded. Use `Class.method` or `--line` when a name is ambiguous.
1078
-
1079
- CRAP is `C² × (1 − coverage)³ + C`, using executable line coverage within each
1080
- function body. This is the line-coverage variant; the original proposal used
1081
- basis-path coverage. An empty function uses its call counter. Missing coverage
1082
- shows `unavailable`, or `null` for CRAP in JSON. It never assumes zero coverage.
1083
- The command discovers `coverage/coverage-final.json` from the source directory
1084
- up to the checkout root, then the current directory. An explicit `--coverage`
1085
- selects an Istanbul JSON report. Reports older than the source leave CRAP unavailable;
1086
- reports must describe the current source, so regenerate them after source changes.
1087
-
1088
- Repeat `--test` to collect coverage from several Vitest test files. This runs only
1089
- the supplied tests in the unit projects, with two workers and a ten-minute limit.
1090
- Coverage files are temporary and are removed after the calculation. A failed test
1091
- run exits nonzero and produces no scores. Without `--test`, no tests run. Test logs
1092
- go to stderr, so `--json` stdout contains only the report. This tool belongs to the
1093
- checkout and is available after the normal dependency installation. Use
1094
- `pnpm --silent metrics ... --json` to also suppress pnpm's command banner.
1095
-
1096
- The tool is bundled in the [check-code-quality skill](.ai/skills/check-code-quality/SKILL.md).
1097
- Ask an agent to measure a file, function or module for a scoped stats report.
1098
- That path uses available coverage and reports missing CRAP without starting the
1099
- PR process. Ask explicitly for fresh coverage when needed.
1100
-
1101
- The local pre-PR gate uses Squeal 0.1.423's one-shot changed-function check:
1102
-
1103
- ```bash
1104
- quality_report=$(mktemp "${TMPDIR:-/tmp}/code-quality.XXXXXXXX") || exit 2
1105
- squeal code --base origin/main --json > "$quality_report"
1106
- quality_status=$?
1107
- printf 'Report: %s; exit: %s\n' "$quality_report" "$quality_status"
1108
- ```
1109
-
1110
- It checks changed JS/TS functions, including test callbacks and nested functions,
1111
- with complexity at most 20 and CRAP at most 30. Equality passes. The default
1112
- budget is 600 seconds. The base commit supplies the policy.
1113
-
1114
- A pass requires complete evidence: no skipped, incomplete or uncounted functions,
1115
- failed or unfinished tests, or exhausted budget. Exit 0 alone is insufficient
1116
- because a report can contain skipped functions. Exits 1, 3 and 2 mean violations,
1117
- incomplete measurement and usage/setup errors. Missing Squeal or unsupported
1118
- evidence blocks the PR. There is no bundled fallback or inherited-refactor
1119
- deferral. See the [pre-PR procedure](.ai/skills/check-code-quality/references/pre-pr.md)
1120
- for report identity, completeness checks and reviewable evidence.
1121
-
1122
- CI and explicit statistics commands keep their existing paths during this
1123
- local-first rollout. CI artifact reuse and supported exceptions await the
1124
- remaining work in hearsay-tools/squeal#167.
1125
-
1126
- For iteration, run affected test files or `npm run test:changed` (inspect with
1127
- `-- --plan`; override the local main comparison with `-- --base=<ref>`).
1128
- The changed-test command includes staged, unstaged and untracked changes and
1129
- falls back to full Vitest on shared/configuration/unknown input or missing Git
1130
- history. It is not a substitute for final verification. See [AGENTS.md § Validation](AGENTS.md#validation)
1131
- for targeted browser commands and the [CI guide](docs/sdlc/ci.md) for the final-gate/evidence-reuse policy.
1132
-
1133
- `npm run typecheck` checks all four workspaces from source without writing build
1134
- output. `npm run typecheck:web` checks the cockpit and reads the server route types
1135
- from this checkout. Run `pnpm install --frozen-lockfile` in each new worktree first.
1136
- Packaged CLI tests import built modules; CI checks them with
1137
- `npm run typecheck:package` after `npm run build`.
1138
-
1139
- CI runs eight duration-balanced Vitest shards alongside the build and package checks.
1140
- See [CI verification](docs/sdlc/ci.md) for the job graph and local commands.
1141
-
1142
- The stack is deliberately small: **TypeScript** (strict, ESM), **Hono** + SSE for
1143
- the server, **Zod** at every boundary, **YAML** for workflows, and a **React 19 +
1144
- Vite + Tailwind v4 + shadcn/ui** cockpit shipped pre-built in `packages/cezar/web/dist/` — the
1145
- published package carries the built app, so `npx` users never run a bundler.
1146
- Every module is meant to be read in one sitting.
1147
-
1148
- ---
462
+ See [Local development](docs/development.md).
1149
463
 
1150
464
  ## License
1151
465
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hearsay-tools/squawk",
3
- "version": "0.18.0-dev.6602",
3
+ "version": "0.18.0-dev.6606",
4
4
  "description": "Local cockpit for running and tracking AI agent tasks in your repo. Uses your logged-in `claude` CLI and `gh` — zero config, zero database.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -62,8 +62,8 @@
62
62
  "devDependencies": {
63
63
  "@babel/parser": "^8.0.8",
64
64
  "@babel/types": "^8.0.8",
65
- "@open-mercato/cezar-api-client": "0.18.0-dev.6602",
66
- "@open-mercato/cezar-contract": "0.18.0-dev.6602",
65
+ "@open-mercato/cezar-api-client": "0.18.0-dev.6606",
66
+ "@open-mercato/cezar-contract": "0.18.0-dev.6606",
67
67
  "@types/node": "^24.19.1",
68
68
  "@types/ws": "^8.18.1",
69
69
  "esbuild": "^0.28.1",
@@ -80,5 +80,5 @@
80
80
  "publishConfig": {
81
81
  "access": "public"
82
82
  },
83
- "gitHead": "812c0951f25e1a99c71ec0c14e67521b866c1c0f"
83
+ "gitHead": "9d284df6f0b79932676b98b3d70a444f8fe17313"
84
84
  }