@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.
Files changed (176) hide show
  1. package/README.md +1 -1
  2. package/dist/builtin-memory/00-runtime-base.md +3 -10
  3. package/dist/builtin-memory/04-base-worker.md +18 -0
  4. package/dist/builtin-memory/04-orchestration-kernel.md +1 -1
  5. package/dist/builtin-pi-packages/pi-crtr-extensions/README.md +13 -34
  6. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/provider-rotation.test.ts +639 -741
  7. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.ts +241 -58
  8. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/statusline.ts +2 -9
  9. package/dist/builtin-pi-packages/pi-crtr-extensions/lib/subscription-state.ts +365 -94
  10. package/dist/builtin-pi-packages/pi-crtr-extensions/package-lock.json +2 -2
  11. package/dist/builtin-pi-packages/pi-mode-switch/README.md +11 -39
  12. package/dist/builtin-pi-packages/pi-mode-switch/extensions/index.ts +20 -15
  13. package/dist/builtin-pi-packages/pi-mode-switch/package.json +1 -1
  14. package/dist/builtin-views/canvas/tui.mjs +8 -9
  15. package/dist/builtin-views/chat/tui.mjs +12 -12
  16. package/dist/builtin-views/git-pr/tui.mjs +7 -8
  17. package/dist/builtin-views/inbox/tui.mjs +27 -41
  18. package/dist/builtin-views/linkedin/tui.mjs +23 -37
  19. package/dist/builtin-views/prompt-review/tui.mjs +11 -11
  20. package/dist/builtin-views/settings/tui.mjs +11 -11
  21. package/dist/builtin-views/workspace-sidebar/tui.mjs +8 -9
  22. package/dist/cli.d.ts +1 -1
  23. package/dist/cli.js +1 -0
  24. package/dist/clients/attach/__tests__/attach-chrome-remote.test.js +11 -7
  25. package/dist/clients/attach/__tests__/crtr-output-render.test.js +1 -1
  26. package/dist/clients/attach/__tests__/mermaid-render.test.d.ts +1 -0
  27. package/dist/clients/attach/__tests__/mermaid-render.test.js +20 -0
  28. package/dist/clients/attach/__tests__/oauth-dialog-lifecycle.test.d.ts +1 -0
  29. package/dist/clients/attach/__tests__/oauth-dialog-lifecycle.test.js +110 -0
  30. package/dist/clients/attach/attach-cmd.d.ts +1 -1
  31. package/dist/clients/attach/attach-cmd.js +733 -730
  32. package/dist/clients/attach/auth-pickers.d.ts +12 -0
  33. package/dist/clients/attach/auth-pickers.js +11 -0
  34. package/dist/clients/attach/canvas-panels.js +2 -3
  35. package/dist/clients/attach/chat-view.d.ts +7 -8
  36. package/dist/clients/attach/chat-view.js +119 -79
  37. package/dist/clients/attach/edit-diff-render.d.ts +6 -0
  38. package/dist/clients/attach/edit-diff-render.js +263 -0
  39. package/dist/clients/attach/input-controller.d.ts +28 -2
  40. package/dist/clients/attach/input-controller.js +38 -5
  41. package/dist/clients/attach/mermaid-render.js +5 -2
  42. package/dist/clients/attach/pickers.d.ts +8 -7
  43. package/dist/clients/attach/pickers.js +13 -17
  44. package/dist/clients/attach/slash-commands.d.ts +9 -0
  45. package/dist/clients/attach/slash-commands.js +128 -7
  46. package/dist/clients/attach/titled-editor.d.ts +12 -1
  47. package/dist/clients/attach/titled-editor.js +103 -8
  48. package/dist/commands/canvas-browse.js +2 -2
  49. package/dist/commands/memory/lint.js +39 -5
  50. package/dist/commands/memory/write.js +1 -0
  51. package/dist/commands/node.js +12 -5
  52. package/dist/commands/profile/new.js +30 -5
  53. package/dist/commands/surface-tmux-spread.js +1 -3
  54. package/dist/commands/sys/__tests__/config-keybindings.test.d.ts +1 -0
  55. package/dist/commands/sys/__tests__/config-keybindings.test.js +55 -0
  56. package/dist/commands/sys/__tests__/config-model-ladders.test.d.ts +1 -0
  57. package/dist/commands/sys/__tests__/config-model-ladders.test.js +121 -0
  58. package/dist/commands/sys/config.js +18 -21
  59. package/dist/commands/sys/setup-core.d.ts +12 -1
  60. package/dist/commands/sys/setup-core.js +25 -3
  61. package/dist/commands/sys/setup.js +166 -20
  62. package/dist/core/__tests__/base-worker-prompt.test.d.ts +1 -0
  63. package/dist/core/__tests__/base-worker-prompt.test.js +24 -0
  64. package/dist/core/__tests__/canvas-inbox-watcher-hold.test.js +232 -1
  65. package/dist/core/__tests__/fault-classifier.test.js +15 -0
  66. package/dist/core/__tests__/full/broker-dialogs.test.js +7 -2
  67. package/dist/core/__tests__/full/broker-pane-resolution.test.js +9 -6
  68. package/dist/core/__tests__/full/cascade-close.test.js +5 -2
  69. package/dist/core/__tests__/full/dead-pane-regression.test.js +6 -3
  70. package/dist/core/__tests__/full/detach-focus.test.js +10 -5
  71. package/dist/core/__tests__/full/human-new-window-regression.test.js +6 -3
  72. package/dist/core/__tests__/full/review-render-pane-regression.test.js +2 -2
  73. package/dist/core/__tests__/helpers/harness.d.ts +1 -0
  74. package/dist/core/__tests__/helpers/harness.js +28 -4
  75. package/dist/core/__tests__/host-teardown-process-group.test.js +15 -4
  76. package/dist/core/__tests__/live-mutation-verbs.test.js +5 -4
  77. package/dist/core/__tests__/review-model-floor.test.js +1 -1
  78. package/dist/core/__tests__/stream-watchdog.test.d.ts +1 -0
  79. package/dist/core/__tests__/stream-watchdog.test.js +70 -0
  80. package/dist/core/__tests__/tmux-surface.test.js +72 -0
  81. package/dist/core/canvas/__tests__/remote-event-stream.test.js +11 -9
  82. package/dist/core/canvas/__tests__/render-remote.test.js +7 -4
  83. package/dist/core/canvas/browse/__tests__/model.test.js +23 -5
  84. package/dist/core/canvas/browse/__tests__/rebuild-coalescer.test.js +30 -13
  85. package/dist/core/canvas/browse/__tests__/render.test.js +1 -0
  86. package/dist/core/canvas/browse/app.js +164 -5
  87. package/dist/core/canvas/browse/model.d.ts +10 -6
  88. package/dist/core/canvas/browse/model.js +20 -12
  89. package/dist/core/canvas/browse/pins.d.ts +4 -0
  90. package/dist/core/canvas/browse/pins.js +29 -0
  91. package/dist/core/canvas/browse/render.d.ts +13 -1
  92. package/dist/core/canvas/browse/render.js +72 -15
  93. package/dist/core/canvas/nav-model.js +5 -11
  94. package/dist/core/canvas/paths.d.ts +5 -0
  95. package/dist/core/canvas/paths.js +7 -0
  96. package/dist/core/canvas/pid.d.ts +14 -10
  97. package/dist/core/canvas/pid.js +14 -10
  98. package/dist/core/config.d.ts +53 -2
  99. package/dist/core/config.js +228 -110
  100. package/dist/core/fault-classifier.js +1 -1
  101. package/dist/core/fs-utils.d.ts +1 -0
  102. package/dist/core/fs-utils.js +15 -1
  103. package/dist/core/keybindings/__tests__/resolve.test.d.ts +1 -0
  104. package/dist/core/keybindings/__tests__/resolve.test.js +224 -0
  105. package/dist/core/keybindings/catalog.d.ts +14 -0
  106. package/dist/core/keybindings/catalog.js +256 -0
  107. package/dist/core/keybindings/index.d.ts +5 -0
  108. package/dist/core/keybindings/index.js +4 -0
  109. package/dist/core/keybindings/match.d.ts +29 -0
  110. package/dist/core/keybindings/match.js +99 -0
  111. package/dist/core/keybindings/persistence.d.ts +14 -0
  112. package/dist/core/keybindings/persistence.js +31 -0
  113. package/dist/core/keybindings/resolve.d.ts +14 -0
  114. package/dist/core/keybindings/resolve.js +305 -0
  115. package/dist/core/keybindings/types.d.ts +37 -0
  116. package/dist/core/keybindings/types.js +1 -0
  117. package/dist/core/memory-resolver.d.ts +1 -1
  118. package/dist/core/memory-resolver.js +10 -3
  119. package/dist/core/predicate.d.ts +5 -3
  120. package/dist/core/predicate.js +5 -3
  121. package/dist/core/runtime/broker-protocol.d.ts +33 -5
  122. package/dist/core/runtime/broker.js +165 -14
  123. package/dist/core/runtime/launch.d.ts +39 -6
  124. package/dist/core/runtime/launch.js +79 -21
  125. package/dist/core/runtime/naming.js +3 -3
  126. package/dist/core/runtime/pi-cli.d.ts +6 -0
  127. package/dist/core/runtime/pi-cli.js +16 -2
  128. package/dist/core/runtime/placement.d.ts +2 -2
  129. package/dist/core/runtime/placement.js +4 -1
  130. package/dist/core/runtime/promote.js +4 -0
  131. package/dist/core/runtime/recap.d.ts +3 -3
  132. package/dist/core/runtime/recap.js +47 -44
  133. package/dist/core/runtime/recycle.js +6 -1
  134. package/dist/core/runtime/reset.js +5 -0
  135. package/dist/core/runtime/revive.js +28 -18
  136. package/dist/core/runtime/session-list-cache.d.ts +23 -0
  137. package/dist/core/runtime/session-list-cache.js +270 -0
  138. package/dist/core/runtime/spawn.js +51 -32
  139. package/dist/core/runtime/stream-watchdog.d.ts +26 -0
  140. package/dist/core/runtime/stream-watchdog.js +75 -0
  141. package/dist/core/runtime/tmux-chrome.d.ts +1 -1
  142. package/dist/core/runtime/tmux-chrome.js +2 -2
  143. package/dist/core/runtime/tmux.d.ts +18 -15
  144. package/dist/core/runtime/tmux.js +216 -110
  145. package/dist/core/tui/__tests__/host-keybindings.test.d.ts +1 -0
  146. package/dist/core/tui/__tests__/host-keybindings.test.js +112 -0
  147. package/dist/core/tui/host.d.ts +30 -1
  148. package/dist/core/tui/host.js +148 -34
  149. package/dist/core/view/__tests__/transport-remote.test.js +9 -6
  150. package/dist/core/view/contract.d.ts +17 -3
  151. package/dist/daemon/crtrd-cli.d.ts +1 -1
  152. package/dist/daemon/crtrd-cli.js +1 -0
  153. package/dist/pi-extensions/__tests__/canvas-stophook-agentend.test.js +41 -0
  154. package/dist/pi-extensions/__tests__/canvas-stophook-context-nudge.test.d.ts +1 -0
  155. package/dist/pi-extensions/__tests__/canvas-stophook-context-nudge.test.js +121 -0
  156. package/dist/pi-extensions/canvas-inbox-watcher.d.ts +1 -1
  157. package/dist/pi-extensions/canvas-inbox-watcher.js +203 -25
  158. package/dist/pi-extensions/canvas-recap.d.ts +4 -0
  159. package/dist/pi-extensions/canvas-recap.js +38 -37
  160. package/dist/pi-extensions/canvas-stophook.d.ts +11 -0
  161. package/dist/pi-extensions/canvas-stophook.js +33 -4
  162. package/dist/suppress-experimental-warnings.d.ts +1 -0
  163. package/dist/suppress-experimental-warnings.js +15 -0
  164. package/dist/types.d.ts +3 -13
  165. package/dist/types.js +12 -36
  166. package/dist/web-client/assets/{index-CnF5r8ky.js → index--md2ylfi.js} +18 -17
  167. package/dist/web-client/assets/index-BUdm9s9s.css +2 -0
  168. package/dist/web-client/index.html +3 -3
  169. package/dist/web-client/sw.js +1 -1
  170. package/package.json +11 -8
  171. package/scripts/postinstall.mjs +1 -1
  172. package/dist/pi-extensions/canvas-nav.d.ts +0 -43
  173. package/dist/pi-extensions/canvas-nav.js +0 -640
  174. package/dist/pi-extensions/widget-order-bus.d.ts +0 -6
  175. package/dist/pi-extensions/widget-order-bus.js +0 -34
  176. package/dist/web-client/assets/index-BnmSLNLa.css +0 -2
package/dist/types.d.ts CHANGED
@@ -50,6 +50,8 @@ export interface AutoUpdateConfig {
50
50
  content: AutoUpdateMode;
51
51
  interval_hours: number;
52
52
  }
53
+ export type KeybindingOverrides = Record<string, string[]>;
54
+ /** Compile-time seam for runtime consumers migrating to semantic binding IDs. */
53
55
  export type CanvasAction = {
54
56
  kind?: 'crtr';
55
57
  run: string;
@@ -70,25 +72,16 @@ export interface CanvasMenuItem {
70
72
  action: CanvasAction;
71
73
  confirm?: boolean;
72
74
  }
73
- /** Legacy GRAPH bind shape; retained for graphBinds only. */
74
75
  export interface CanvasBind {
75
76
  run: string;
76
77
  confirm?: boolean;
77
78
  desc?: string;
78
79
  }
79
- /** Canvas-nav config (`canvasNav` in config.json). `prefixBinds` are consumed
80
- * at the tmux alt+c menu layer; `graphBinds` are consumed in-process by the
81
- * canvas-nav pi extension while in GRAPH. Built-in GRAPH keys
82
- * (j/k/h/l/g/G/enter/m/e/x/esc) are reserved — `graphBinds` is strictly
83
- * additive. */
84
80
  export interface CanvasNavConfig {
85
- /** Fallback pi shortcut for GRAPH toggle when NOT in tmux. Default 'alt+g'. */
86
81
  prefixKey?: string;
87
- /** chord key (after alt+c) → action; tmux-menu layer. */
88
82
  prefixBinds: Record<string, CanvasAction & {
89
83
  desc?: string;
90
84
  }>;
91
- /** extra raw key in GRAPH → action; pi-extension layer (additive only). */
92
85
  graphBinds: Record<string, CanvasBind>;
93
86
  }
94
87
  export type ModelStrength = 'ultra' | 'strong' | 'medium' | 'light';
@@ -129,7 +122,7 @@ export interface ScopeConfig {
129
122
  plugins: Record<string, ConfigPluginEntry>;
130
123
  auto_update: AutoUpdateConfig;
131
124
  max_panes_per_window: number;
132
- canvasNav: CanvasNavConfig;
125
+ keybindings: KeybindingOverrides;
133
126
  modelLadders: ModelLaddersConfig;
134
127
  /** The kind registry (spec §1.5): kind existence + launch knobs, keyed by
135
128
  * full kind string (top-level e.g. `developer`, or sub-kind e.g.
@@ -264,9 +257,6 @@ export declare function defaultRemoteCanvasConfig(): RemoteCanvasConfig;
264
257
  * ancestor) — `product/teardown` is included explicitly below for parity
265
258
  * even though its value equals the default. */
266
259
  export declare function defaultKindsConfig(): Record<string, KindConfig>;
267
- /** Built-in canvas-nav binds so an absent config still gives the intended UX.
268
- * prefixBinds restate the current menu defaults; graphBinds stay empty.
269
- */
270
260
  export declare function defaultCanvasNavConfig(): CanvasNavConfig;
271
261
  export declare function defaultModelLaddersConfig(): ModelLaddersConfig;
272
262
  export declare function defaultScopeState(): ScopeState;
package/dist/types.js CHANGED
@@ -28,7 +28,7 @@ export function defaultScopeConfig() {
28
28
  plugins: {},
29
29
  auto_update: { crtr: 'notify', content: 'notify', interval_hours: 24 },
30
30
  max_panes_per_window: DEFAULT_MAX_PANES_PER_WINDOW,
31
- canvasNav: defaultCanvasNavConfig(),
31
+ keybindings: {},
32
32
  modelLadders: defaultModelLaddersConfig(),
33
33
  kinds: defaultKindsConfig(),
34
34
  remoteCanvas: defaultRemoteCanvasConfig(),
@@ -57,12 +57,12 @@ export function defaultKindsConfig() {
57
57
  },
58
58
  explore: {
59
59
  whenToUse: 'Map unfamiliar code or architecture — read-only orientation and code-path research with concrete file:line evidence. Anything diagnostic — investigating a failure, why something is broken or misbehaving, or live/runtime behavior — is advisor, not explore.',
60
- model: 'anthropic/light',
60
+ model: 'openai/light',
61
61
  },
62
62
  developer: {
63
63
  whenToUse: 'Implement a change — make the feature or fix genuinely work against its acceptance criteria, not merely compile.',
64
- model: 'anthropic/medium',
65
- orchestratorModel: 'anthropic/strong',
64
+ model: 'openai/medium',
65
+ orchestratorModel: 'openai/strong',
66
66
  },
67
67
  design: {
68
68
  whenToUse: 'Architect a solution — produce one design document an implementer can build from without re-deciding anything left open.',
@@ -119,46 +119,22 @@ export function defaultKindsConfig() {
119
119
  },
120
120
  };
121
121
  }
122
- /** Built-in canvas-nav binds so an absent config still gives the intended UX.
123
- * prefixBinds restate the current menu defaults; graphBinds stay empty.
124
- */
125
122
  export function defaultCanvasNavConfig() {
126
- return {
127
- prefixKey: 'alt+g',
128
- prefixBinds: {
129
- o: { kind: 'keys', keys: '/promote', desc: 'promote to orchestrator' },
130
- r: { kind: 'keys', keys: '/resume-node', desc: 'resume node' },
131
- d: { kind: 'crtr', run: 'node lifecycle demote --pane {pane}', desc: 'demote to terminal' },
132
- D: { kind: 'crtr', run: 'node lifecycle demote --pane {pane} --detach', desc: 'detach to background' },
133
- x: { kind: 'crtr', run: 'node lifecycle close --pane {pane}', desc: 'close agent + subtree' },
134
- c: { kind: 'keys', keys: '/context', desc: 'browse context dirs' },
135
- g: { kind: 'keys', keys: '/graph', desc: 'graph view' },
136
- m: { kind: 'crtr', run: 'node focus {manager}', desc: 'focus manager' },
137
- i: {
138
- kind: 'menu',
139
- desc: 'new issue / todo',
140
- items: [
141
- { key: 'i', desc: 'idea', action: { kind: 'popup', run: 'canvas issue new --type idea' } },
142
- { key: 'b', desc: 'bug', action: { kind: 'popup', run: 'canvas issue new --type bug' } },
143
- ],
144
- },
145
- },
146
- graphBinds: {},
147
- };
123
+ throw new Error('runtime consumer must resolve semantic crouter keybindings');
148
124
  }
149
125
  export function defaultModelLaddersConfig() {
150
126
  return {
151
127
  anthropic: {
152
128
  ultra: 'anthropic/claude-fable-5:high',
153
- strong: 'anthropic/claude-opus-4-8:high',
154
- medium: 'anthropic/claude-sonnet-5:high',
155
- light: 'anthropic/claude-haiku-4-5:high',
129
+ strong: 'anthropic/claude-fable-5:medium',
130
+ medium: 'anthropic/claude-opus-4-8:high',
131
+ light: 'anthropic/claude-sonnet-5:high',
156
132
  },
157
133
  openai: {
158
- ultra: 'openai-codex/gpt-5.5:xhigh',
159
- strong: 'openai-codex/gpt-5.5:high',
160
- medium: 'openai-codex/gpt-5.5:medium',
161
- light: 'openai-codex/gpt-5.3-codex-spark',
134
+ ultra: 'openai-codex/gpt-5.6-sol:max',
135
+ strong: 'openai-codex/gpt-5.6-sol:high',
136
+ medium: 'openai-codex/gpt-5.6-terra:medium',
137
+ light: 'openai-codex/gpt-5.6-luna:low',
162
138
  },
163
139
  };
164
140
  }