@crouton-kit/crouter 0.3.68 → 0.3.78
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.
- package/README.md +1 -1
- package/dist/builtin-memory/00-runtime-base.md +3 -10
- package/dist/builtin-memory/04-base-worker.md +18 -0
- package/dist/builtin-memory/04-orchestration-kernel.md +1 -1
- package/dist/builtin-pi-packages/pi-crtr-extensions/README.md +13 -34
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/provider-rotation.test.ts +639 -741
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.ts +241 -58
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/statusline.ts +2 -9
- package/dist/builtin-pi-packages/pi-crtr-extensions/lib/subscription-state.ts +365 -94
- package/dist/builtin-pi-packages/pi-crtr-extensions/package-lock.json +2 -2
- package/dist/builtin-pi-packages/pi-mode-switch/README.md +11 -39
- package/dist/builtin-pi-packages/pi-mode-switch/extensions/index.ts +20 -15
- package/dist/builtin-pi-packages/pi-mode-switch/package.json +1 -1
- package/dist/builtin-views/canvas/tui.mjs +8 -9
- package/dist/builtin-views/chat/tui.mjs +12 -12
- package/dist/builtin-views/git-pr/tui.mjs +7 -8
- package/dist/builtin-views/inbox/tui.mjs +27 -41
- package/dist/builtin-views/linkedin/tui.mjs +23 -37
- package/dist/builtin-views/prompt-review/tui.mjs +11 -11
- package/dist/builtin-views/settings/tui.mjs +11 -11
- package/dist/builtin-views/workspace-sidebar/tui.mjs +8 -9
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +1 -0
- package/dist/clients/attach/__tests__/attach-chrome-remote.test.js +11 -7
- package/dist/clients/attach/__tests__/crtr-output-render.test.js +1 -1
- package/dist/clients/attach/__tests__/mermaid-render.test.d.ts +1 -0
- package/dist/clients/attach/__tests__/mermaid-render.test.js +20 -0
- package/dist/clients/attach/__tests__/oauth-dialog-lifecycle.test.d.ts +1 -0
- package/dist/clients/attach/__tests__/oauth-dialog-lifecycle.test.js +110 -0
- package/dist/clients/attach/attach-cmd.d.ts +1 -1
- package/dist/clients/attach/attach-cmd.js +733 -730
- package/dist/clients/attach/auth-pickers.d.ts +12 -0
- package/dist/clients/attach/auth-pickers.js +11 -0
- package/dist/clients/attach/canvas-panels.js +2 -3
- package/dist/clients/attach/chat-view.d.ts +7 -8
- package/dist/clients/attach/chat-view.js +119 -79
- package/dist/clients/attach/edit-diff-render.d.ts +6 -0
- package/dist/clients/attach/edit-diff-render.js +263 -0
- package/dist/clients/attach/input-controller.d.ts +28 -2
- package/dist/clients/attach/input-controller.js +38 -5
- package/dist/clients/attach/mermaid-render.js +5 -2
- package/dist/clients/attach/pickers.d.ts +8 -7
- package/dist/clients/attach/pickers.js +13 -17
- package/dist/clients/attach/slash-commands.d.ts +9 -0
- package/dist/clients/attach/slash-commands.js +128 -7
- package/dist/clients/attach/titled-editor.d.ts +12 -1
- package/dist/clients/attach/titled-editor.js +103 -8
- package/dist/commands/canvas-browse.js +2 -2
- package/dist/commands/memory/lint.js +39 -5
- package/dist/commands/memory/write.js +1 -0
- package/dist/commands/node.js +12 -5
- package/dist/commands/profile/new.js +30 -5
- package/dist/commands/surface-tmux-spread.js +1 -3
- package/dist/commands/sys/__tests__/config-keybindings.test.d.ts +1 -0
- package/dist/commands/sys/__tests__/config-keybindings.test.js +55 -0
- package/dist/commands/sys/__tests__/config-model-ladders.test.d.ts +1 -0
- package/dist/commands/sys/__tests__/config-model-ladders.test.js +121 -0
- package/dist/commands/sys/config.js +18 -21
- package/dist/commands/sys/setup-core.d.ts +12 -1
- package/dist/commands/sys/setup-core.js +25 -3
- package/dist/commands/sys/setup.js +166 -20
- package/dist/core/__tests__/base-worker-prompt.test.d.ts +1 -0
- package/dist/core/__tests__/base-worker-prompt.test.js +24 -0
- package/dist/core/__tests__/canvas-inbox-watcher-hold.test.js +232 -1
- package/dist/core/__tests__/fault-classifier.test.js +15 -0
- package/dist/core/__tests__/full/broker-dialogs.test.js +7 -2
- package/dist/core/__tests__/full/broker-pane-resolution.test.js +9 -6
- package/dist/core/__tests__/full/cascade-close.test.js +5 -2
- package/dist/core/__tests__/full/dead-pane-regression.test.js +6 -3
- package/dist/core/__tests__/full/detach-focus.test.js +10 -5
- package/dist/core/__tests__/full/human-new-window-regression.test.js +6 -3
- package/dist/core/__tests__/full/review-render-pane-regression.test.js +2 -2
- package/dist/core/__tests__/helpers/harness.d.ts +1 -0
- package/dist/core/__tests__/helpers/harness.js +28 -4
- package/dist/core/__tests__/host-teardown-process-group.test.js +15 -4
- package/dist/core/__tests__/live-mutation-verbs.test.js +5 -4
- package/dist/core/__tests__/review-model-floor.test.js +1 -1
- package/dist/core/__tests__/stream-watchdog.test.d.ts +1 -0
- package/dist/core/__tests__/stream-watchdog.test.js +70 -0
- package/dist/core/__tests__/tmux-surface.test.js +72 -0
- package/dist/core/canvas/__tests__/remote-event-stream.test.js +11 -9
- package/dist/core/canvas/__tests__/render-remote.test.js +7 -4
- package/dist/core/canvas/browse/__tests__/model.test.js +23 -5
- package/dist/core/canvas/browse/__tests__/rebuild-coalescer.test.js +30 -13
- package/dist/core/canvas/browse/__tests__/render.test.js +1 -0
- package/dist/core/canvas/browse/app.js +164 -5
- package/dist/core/canvas/browse/model.d.ts +10 -6
- package/dist/core/canvas/browse/model.js +20 -12
- package/dist/core/canvas/browse/pins.d.ts +4 -0
- package/dist/core/canvas/browse/pins.js +29 -0
- package/dist/core/canvas/browse/render.d.ts +13 -1
- package/dist/core/canvas/browse/render.js +72 -15
- package/dist/core/canvas/nav-model.js +5 -11
- package/dist/core/canvas/paths.d.ts +5 -0
- package/dist/core/canvas/paths.js +7 -0
- package/dist/core/canvas/pid.d.ts +14 -10
- package/dist/core/canvas/pid.js +14 -10
- package/dist/core/config.d.ts +53 -2
- package/dist/core/config.js +228 -110
- package/dist/core/fault-classifier.js +1 -1
- package/dist/core/fs-utils.d.ts +1 -0
- package/dist/core/fs-utils.js +15 -1
- package/dist/core/keybindings/__tests__/resolve.test.d.ts +1 -0
- package/dist/core/keybindings/__tests__/resolve.test.js +224 -0
- package/dist/core/keybindings/catalog.d.ts +14 -0
- package/dist/core/keybindings/catalog.js +256 -0
- package/dist/core/keybindings/index.d.ts +5 -0
- package/dist/core/keybindings/index.js +4 -0
- package/dist/core/keybindings/match.d.ts +29 -0
- package/dist/core/keybindings/match.js +99 -0
- package/dist/core/keybindings/persistence.d.ts +14 -0
- package/dist/core/keybindings/persistence.js +31 -0
- package/dist/core/keybindings/resolve.d.ts +14 -0
- package/dist/core/keybindings/resolve.js +305 -0
- package/dist/core/keybindings/types.d.ts +37 -0
- package/dist/core/keybindings/types.js +1 -0
- package/dist/core/memory-resolver.d.ts +1 -1
- package/dist/core/memory-resolver.js +10 -3
- package/dist/core/predicate.d.ts +5 -3
- package/dist/core/predicate.js +5 -3
- package/dist/core/runtime/broker-protocol.d.ts +33 -5
- package/dist/core/runtime/broker.js +165 -14
- package/dist/core/runtime/launch.d.ts +39 -6
- package/dist/core/runtime/launch.js +79 -21
- package/dist/core/runtime/naming.js +3 -3
- package/dist/core/runtime/pi-cli.d.ts +6 -0
- package/dist/core/runtime/pi-cli.js +16 -2
- package/dist/core/runtime/placement.d.ts +2 -2
- package/dist/core/runtime/placement.js +4 -1
- package/dist/core/runtime/promote.js +4 -0
- package/dist/core/runtime/recap.d.ts +3 -3
- package/dist/core/runtime/recap.js +47 -44
- package/dist/core/runtime/recycle.js +6 -1
- package/dist/core/runtime/reset.js +5 -0
- package/dist/core/runtime/revive.js +28 -18
- package/dist/core/runtime/session-list-cache.d.ts +23 -0
- package/dist/core/runtime/session-list-cache.js +270 -0
- package/dist/core/runtime/spawn.js +51 -32
- package/dist/core/runtime/stream-watchdog.d.ts +26 -0
- package/dist/core/runtime/stream-watchdog.js +75 -0
- package/dist/core/runtime/tmux-chrome.d.ts +1 -1
- package/dist/core/runtime/tmux-chrome.js +2 -2
- package/dist/core/runtime/tmux.d.ts +18 -15
- package/dist/core/runtime/tmux.js +216 -110
- package/dist/core/tui/__tests__/host-keybindings.test.d.ts +1 -0
- package/dist/core/tui/__tests__/host-keybindings.test.js +112 -0
- package/dist/core/tui/host.d.ts +30 -1
- package/dist/core/tui/host.js +148 -34
- package/dist/core/view/__tests__/transport-remote.test.js +9 -6
- package/dist/core/view/contract.d.ts +17 -3
- package/dist/daemon/crtrd-cli.d.ts +1 -1
- package/dist/daemon/crtrd-cli.js +1 -0
- package/dist/pi-extensions/__tests__/canvas-stophook-agentend.test.js +41 -0
- package/dist/pi-extensions/__tests__/canvas-stophook-context-nudge.test.d.ts +1 -0
- package/dist/pi-extensions/__tests__/canvas-stophook-context-nudge.test.js +121 -0
- package/dist/pi-extensions/canvas-inbox-watcher.d.ts +1 -1
- package/dist/pi-extensions/canvas-inbox-watcher.js +203 -25
- package/dist/pi-extensions/canvas-recap.d.ts +4 -0
- package/dist/pi-extensions/canvas-recap.js +38 -37
- package/dist/pi-extensions/canvas-stophook.d.ts +11 -0
- package/dist/pi-extensions/canvas-stophook.js +33 -4
- package/dist/suppress-experimental-warnings.d.ts +1 -0
- package/dist/suppress-experimental-warnings.js +15 -0
- package/dist/types.d.ts +3 -13
- package/dist/types.js +12 -36
- package/dist/web-client/assets/{index-CnF5r8ky.js → index--md2ylfi.js} +18 -17
- package/dist/web-client/assets/index-BUdm9s9s.css +2 -0
- package/dist/web-client/index.html +3 -3
- package/dist/web-client/sw.js +1 -1
- package/package.json +11 -8
- package/scripts/postinstall.mjs +1 -1
- package/dist/pi-extensions/canvas-nav.d.ts +0 -43
- package/dist/pi-extensions/canvas-nav.js +0 -640
- package/dist/pi-extensions/widget-order-bus.d.ts +0 -6
- package/dist/pi-extensions/widget-order-bus.js +0 -34
- package/dist/web-client/assets/index-BnmSLNLa.css +0 -2
package/README.md
CHANGED
|
@@ -30,5 +30,5 @@ To opt out of the bootstrap (e.g. in CI), set `CRTR_NO_BOOTSTRAP=1`.
|
|
|
30
30
|
The node runtime hosts the [pi coding agent](https://pi.dev) in each broker. To set your pi install up the way crouter's author runs it, add these to the `packages` array in `~/.pi/agent/settings.json` (neither ships with pi — you add them yourself):
|
|
31
31
|
|
|
32
32
|
- **[pi-claude-oauth-adapter](https://github.com/minzique/dotfiles-agents/tree/main/packages/pi-claude-oauth-adapter)** — third-party npm package; Anthropic OAuth / Claude Code compatibility adapter for pi. Install with `"npm:pi-claude-oauth-adapter"`.
|
|
33
|
-
- **
|
|
33
|
+
- **pi-crtr-extensions** — crtr's engine-side pi extensions (crtr help-gate, slash-command surfacing, provider rotation, frontmatter rules, statusline). Bundled in this repo at `src/builtin-pi-packages/pi-crtr-extensions` and wired into `~/.pi/agent/settings.json` automatically by `crtr sys setup` — nothing to install separately.
|
|
34
34
|
|
|
@@ -11,15 +11,6 @@ You are a **node** in a live agent graph (the crtr canvas). This section is your
|
|
|
11
11
|
## Identity
|
|
12
12
|
You have a node id (`$CRTR_NODE_ID`), a context dir on disk, and a pi session as your vehicle. You are pinned to one working dir.
|
|
13
13
|
|
|
14
|
-
## Delegating
|
|
15
|
-
Hand any self-contained unit of work to a child instead of doing it inline — that keeps your own context window (your scarce resource) free for steering, and lets independent units run in parallel:
|
|
16
|
-
|
|
17
|
-
crtr node new "<task>" --kind <kind> # `crtr node -h` lists the kinds + the delegate→feed loop
|
|
18
|
-
|
|
19
|
-
You auto-subscribe to every child you spawn, so you're woken when it finishes; the wake message already carries the digest — dereference the reports that matter. Prefer delegating over grinding it out yourself.
|
|
20
|
-
|
|
21
|
-
When the work depends on context you already hold — an explore report, a design, a spec, earlier findings — name those files by path in the task itself: a child starts blind and inherits only what you point it at, so unreferenced context you have is context it won't find.
|
|
22
|
-
|
|
23
14
|
## Reports vs artifacts
|
|
24
15
|
Two different things, two different homes. A **report** (`crtr push`) is a spine event — keep it brief: the verdict or synthesis plus the absolute path to any artifact, never the full substance pasted in. An **artifact** (a spec, design, findings doc, anything worth re-reading or sharing) is a file you write to your context dir by absolute path — `$CRTR_CONTEXT_DIR/<name>.md`. Your working dir is the project, so a bare `context/...` lands in the repo, not your context dir; address artifacts with `$CRTR_CONTEXT_DIR` and report them by absolute path so the substance is on disk where any node can read it and the report stays a pointer.
|
|
25
16
|
|
|
@@ -30,6 +21,8 @@ Don't stall and don't guess at a decision a person should make:
|
|
|
30
21
|
|
|
31
22
|
crtr human ask "<question>"
|
|
32
23
|
|
|
24
|
+
ANY question aimed at the user goes through it, not just hard blocks — a question posed as prose in a reply or report pings nobody, while an ask lands on their screen and pushes the answer back to your inbox.
|
|
25
|
+
|
|
33
26
|
## When crtr itself misbehaves
|
|
34
27
|
A `crtr` command that errors unexpectedly, hangs, churns, double-spawns, or contradicts its own `-h` is a harness bug — don't silently work around it. Run `crtr sys feedback` to report it (`-h` for how), then continue.
|
|
35
28
|
|
|
@@ -39,7 +32,7 @@ Two different moves; don't conflate them. **Promote** when the *shape* of the jo
|
|
|
39
32
|
crtr node promote --kind <kind> # `crtr node promote -h` — become a long-lived orchestrator now
|
|
40
33
|
crtr node yield # `crtr node yield -h` — refresh into a clean window, carrying a note forward
|
|
41
34
|
|
|
42
|
-
Don't promote or yield for work that fits one window — finish it with `crtr push final`.
|
|
35
|
+
Don't promote or yield for work that fits one window — finish it with `crtr push final`. And never yield carrying an unasked question: put anything you're still wondering for the human through `crtr human ask` BEFORE you yield — an in-flight ask survives the refresh, and its answer wakes your fresh window like any child's report.
|
|
43
36
|
|
|
44
37
|
## Diagrams
|
|
45
38
|
When structure would land faster as a picture than as prose — a flow, a state machine, a small architecture — write it as a ```mermaid fenced code block. The human's viewer renders it inline as a terminal diagram. Reach for it when the shape is the point, not for everything.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
kind: preference
|
|
3
|
+
when-and-why-to-read: When a node runs in base mode, this preference should be read because base nodes own one bounded task and finish it hands-on rather than recursively passing the same assignment down the graph.
|
|
4
|
+
system-prompt-visibility: content
|
|
5
|
+
file-read-visibility: none
|
|
6
|
+
gate: {mode: base}
|
|
7
|
+
rationale: >-
|
|
8
|
+
A base security reviewer handed its entire assignment to another base security reviewer,
|
|
9
|
+
which repeated the move through a 35-node chain in under five minutes. The universal prompt
|
|
10
|
+
had said to delegate any self-contained work while no base-mode layer told sub-kinds to work
|
|
11
|
+
hands-on; exact sub-kind gating also meant plan/reviewers/security did not inherit plan/00-base.
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## You are a hands-on worker
|
|
15
|
+
|
|
16
|
+
Own the task you were given and complete it yourself in this window. Your scarce resource is task completion, not preserving your context for steering.
|
|
17
|
+
|
|
18
|
+
Delegate only a genuinely independent subtask that can run in parallel while you continue owning the parent task. Each child gets a bounded outcome distinct from your whole assignment; passing the same task to another base node creates recursion instead of progress. When the goal itself needs decomposition or will not fit one window, become an orchestrator rather than building a chain of base workers.
|
|
@@ -94,7 +94,7 @@ You own the goal; the human is a stakeholder, not your manager. They answer ques
|
|
|
94
94
|
|
|
95
95
|
Engage (`crtr human ask`) when the goal is genuinely ambiguous and the codebase doesn't settle it, when you're choosing between approaches with real tradeoffs, when you've found something that changes scope or direction, when an action is irreversible or high-risk, or when finished work needs sign-off. Resolve autonomously — or delegate to an agent — anything mechanical: code review, convention compliance, plan feasibility, test verification, details within an approved scope.
|
|
96
96
|
|
|
97
|
-
**Never yield
|
|
97
|
+
**Never yield holding an unasked question.** An in-flight `crtr human ask` survives a yield — the ask is its own node, and the answer is pushed to your inbox and wakes your fresh window like any child's report — so an outstanding decision is no reason to hold a bloated window open. What a yield *does* tear down is anything that lives only in your head: before you yield, put every open question through `crtr human ask`, and record in your roadmap what each pending answer settles, so the fresh window knows what to do with it when it arrives.
|
|
98
98
|
|
|
99
99
|
## Before you finish
|
|
100
100
|
|
|
@@ -1,32 +1,16 @@
|
|
|
1
|
-
# pi-
|
|
1
|
+
# pi-crtr-extensions
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
crtr's engine-side [pi](https://pi.dev) package — the extensions and prompt
|
|
4
|
+
templates every pi engine (including crouter's brokers) loads. This directory,
|
|
5
|
+
inside the crouter tree, is the canonical and only copy; it ships in crouter's
|
|
6
|
+
`dist/builtin-pi-packages/pi-crtr-extensions` and `crtr sys setup` wires that
|
|
7
|
+
path into the `packages` array of `~/.pi/agent/settings.json` (alongside the
|
|
8
|
+
bundled `pi-mode-switch`) — there is nothing to clone or install separately.
|
|
5
9
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
My pi install is four packages wired together through the `packages` array in
|
|
11
|
-
`~/.pi/agent/settings.json`. None of these ship with pi; each is added explicitly.
|
|
12
|
-
|
|
13
|
-
```jsonc
|
|
14
|
-
{
|
|
15
|
-
"packages": [
|
|
16
|
-
"npm:pi-claude-oauth-adapter", // third-party npm: Anthropic OAuth / Claude-Code compat adapter
|
|
17
|
-
"../../Code/cli/sisyphus/pi-plugins/sisyphus", // local: sisyphus orchestration prompts/skills
|
|
18
|
-
"../../Code/cli/pi-personal-extensions", // local: THIS package
|
|
19
|
-
"../../Code/cli/pi-mode-switch" // local: Alt+M spec/plan/normal mode cycling
|
|
20
|
-
],
|
|
21
|
-
"defaultProvider": "anthropic",
|
|
22
|
-
"defaultModel": "claude-opus-4-8",
|
|
23
|
-
"defaultThinkingLevel": "high",
|
|
24
|
-
"enableSkillCommands": true,
|
|
25
|
-
"steeringMode": "all",
|
|
26
|
-
"quietStartup": true,
|
|
27
|
-
"theme": "dark"
|
|
28
|
-
}
|
|
29
|
-
```
|
|
10
|
+
The package is excluded from crouter's tsc compile unit; pi loads the `.ts`
|
|
11
|
+
sources directly with its own loader. Imports may reach from here into
|
|
12
|
+
crouter's compiled core (e.g. `lib/subscription-state.ts` imports the model
|
|
13
|
+
ladder from `../../../types.js`), never the other direction.
|
|
30
14
|
|
|
31
15
|
**Does the OAuth plugin ship with pi? No.** `pi-claude-oauth-adapter` is a
|
|
32
16
|
third-party npm package ([minzique/dotfiles-agents](https://github.com/minzique/dotfiles-agents/tree/main/packages/pi-claude-oauth-adapter)) —
|
|
@@ -37,14 +21,9 @@ If you want Claude-subscription auth, you add this line yourself — it is not b
|
|
|
37
21
|
OAuth login/refresh via `@earendil-works/pi-ai/oauth` to rotate across
|
|
38
22
|
subscription credentials — that's a different mechanism, built in here.)
|
|
39
23
|
|
|
40
|
-
For this package specifically, after cloning into `~/Code/cli/pi-personal-extensions`:
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
npm install # installs runtime deps (yaml)
|
|
44
|
-
```
|
|
45
|
-
|
|
46
24
|
`@earendil-works/pi-coding-agent` is a peer dependency provided by pi at runtime —
|
|
47
|
-
do not install it locally.
|
|
25
|
+
do not install it locally. The one runtime dep (`yaml`) is vendored under this
|
|
26
|
+
directory's `node_modules/`.
|
|
48
27
|
|
|
49
28
|
## Contents
|
|
50
29
|
|