@north-light/crouter 0.3.198 → 0.3.200

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 (316) hide show
  1. package/dist/api/client.d.ts +18 -18
  2. package/dist/api/client.js +29 -37
  3. package/dist/api/dto/broker-ops.d.ts +3 -1
  4. package/dist/api/dto/broker.d.ts +13 -2
  5. package/dist/api/dto/broker.js +4 -4
  6. package/dist/api/dto/human.d.ts +6 -5
  7. package/dist/api/dto/inbox.d.ts +81 -34
  8. package/dist/api/dto/nodes.d.ts +8 -2
  9. package/dist/api/dto/profiles.d.ts +23 -0
  10. package/dist/api/dto/profiles.js +2 -2
  11. package/dist/api/dto/worktree.d.ts +3 -5
  12. package/dist/api/routes.d.ts +3 -5
  13. package/dist/api/routes.js +4 -6
  14. package/dist/builtin-memory/00-runtime-base.md +6 -6
  15. package/dist/builtin-memory/01-spine/01-no-manager.md +1 -1
  16. package/dist/builtin-memory/02-lifecycle/00-terminal.md +3 -3
  17. package/dist/builtin-memory/04-orchestration-kernel.md +6 -6
  18. package/dist/builtin-memory/05-kinds/design/00-base.md +1 -1
  19. package/dist/builtin-memory/05-kinds/plan/reviewers/security.md +2 -2
  20. package/dist/builtin-memory/05-kinds/review/00-base.md +2 -2
  21. package/dist/builtin-memory/05-kinds/review/01-orchestrator.md +1 -1
  22. package/dist/builtin-memory/05-kinds/spec/01-orchestrator.md +1 -1
  23. package/dist/builtin-memory/insights/capture.md +2 -2
  24. package/dist/builtin-memory/insights/init.md +3 -3
  25. package/dist/builtin-memory/internal/INDEX.md +1 -1
  26. package/dist/builtin-memory/internal/memory-loading.md +1 -1
  27. package/dist/builtin-memory/internal/nodes-and-canvas.md +2 -2
  28. package/dist/builtin-memory/internal/plugins.md +59 -2
  29. package/dist/builtin-memory/internal/storage-tiers.md +3 -1
  30. package/dist/builtin-memory/spec/roadmap.md +2 -2
  31. package/dist/builtin-memory/testing.md +1 -1
  32. package/dist/clients/attach/chrome/bash-jobs.js +3 -3
  33. package/dist/clients/attach/render/chat-view.d.ts +26 -1
  34. package/dist/clients/attach/render/chat-view.js +61 -11
  35. package/dist/clients/attach/render/page-block.d.ts +34 -0
  36. package/dist/clients/attach/render/page-block.js +226 -0
  37. package/dist/clients/attach/session/whip.d.ts +2 -0
  38. package/dist/clients/attach/session/whip.js +2 -0
  39. package/dist/clients/attach/viewer.js +1419 -993
  40. package/dist/clients/conversation/projection.js +18 -3
  41. package/dist/clients/inbox/__tests__/serial/inbox-controller.test.js +9 -6
  42. package/dist/clients/inbox/__tests__/serial/mount-panel.test.js +13 -21
  43. package/dist/clients/inbox/controller.js +10 -16
  44. package/dist/clients/inbox/page-adapter.d.ts +1 -3
  45. package/dist/clients/inbox/page-adapter.js +3 -4
  46. package/dist/clients/inbox/resolve.d.ts +1 -1
  47. package/dist/clients/inbox/resolve.js +3 -3
  48. package/dist/clients/inbox/review/document-surface.js +3 -1
  49. package/dist/clients/inbox/review/state.d.ts +2 -1
  50. package/dist/clients/inbox/review/state.js +5 -16
  51. package/dist/clients/inbox/tui/input.js +37 -19
  52. package/dist/clients/inbox/tui/panel.js +5 -31
  53. package/dist/clients/inbox/tui/render.d.ts +11 -0
  54. package/dist/clients/inbox/tui/render.js +71 -27
  55. package/dist/clients/inbox/tui/slots.d.ts +3 -1
  56. package/dist/clients/inbox/tui/slots.js +16 -12
  57. package/dist/clients/inbox/tui/types.d.ts +2 -7
  58. package/dist/clients/inbox/tui.js +2 -2
  59. package/dist/commands/__tests__/human.test.js +71 -114
  60. package/dist/commands/__tests__/node-message.test.js +14 -0
  61. package/dist/commands/attention.js +4 -4
  62. package/dist/commands/canvas-snapshot.js +1 -1
  63. package/dist/commands/canvas.js +1 -1
  64. package/dist/commands/dashboard.js +1 -1
  65. package/dist/commands/human/{html.d.ts → components.d.ts} +1 -1
  66. package/dist/commands/human/components.js +77 -0
  67. package/dist/commands/human/feedback.d.ts +2 -0
  68. package/dist/commands/human/feedback.js +108 -0
  69. package/dist/commands/human/prompts.d.ts +13 -5
  70. package/dist/commands/human/prompts.js +160 -97
  71. package/dist/commands/human/queue.js +57 -88
  72. package/dist/commands/human/shared.d.ts +2 -12
  73. package/dist/commands/human/shared.js +17 -11
  74. package/dist/commands/human.js +29 -21
  75. package/dist/commands/memory/origin.js +2 -2
  76. package/dist/commands/node/bash.js +4 -4
  77. package/dist/commands/node/inspect.js +3 -3
  78. package/dist/commands/node/lifecycle.js +1 -1
  79. package/dist/commands/node/message.js +2 -2
  80. package/dist/commands/node-worktree.js +8 -8
  81. package/dist/commands/pkg/browse.js +1 -1
  82. package/dist/commands/pkg/plugin-manage.js +129 -10
  83. package/dist/commands/profile/delete.js +41 -15
  84. package/dist/commands/profile.js +1 -1
  85. package/dist/commands/push.js +1 -1
  86. package/dist/commands/surface/node/focus.js +29 -14
  87. package/dist/commands/surface-edit.js +3 -3
  88. package/dist/commands/surface-inbox.d.ts +2 -0
  89. package/dist/commands/{human/inbox.js → surface-inbox.js} +14 -18
  90. package/dist/commands/surface.js +2 -1
  91. package/dist/commands/sys/doctor.js +60 -3
  92. package/dist/commands/sys/feedback.js +79 -25
  93. package/dist/commands/sys/settings.js +1 -1
  94. package/dist/core/__tests__/cron-broker-capacity.test.js +1 -1
  95. package/dist/core/__tests__/extension-abort.test.js +5 -2
  96. package/dist/core/__tests__/fixtures/fake-engine.d.ts +13 -2
  97. package/dist/core/__tests__/fixtures/fake-engine.js +47 -3
  98. package/dist/core/__tests__/helpers/harness.js +17 -55
  99. package/dist/core/__tests__/human-cancel-guard.test.js +31 -10
  100. package/dist/core/__tests__/human-deliver.test.js +31 -26
  101. package/dist/core/__tests__/human-node-not-supervised.test.js +1 -1
  102. package/dist/core/__tests__/plugin-page-components.test.js +157 -0
  103. package/dist/core/__tests__/seam/broker-crash-teardown.test.js +4 -5
  104. package/dist/core/__tests__/seam/dormancy-release.test.js +40 -0
  105. package/dist/core/__tests__/serial/flagship-lifecycle.test.js +2 -2
  106. package/dist/core/__tests__/serial/human-deliver-e2e.test.js +12 -6
  107. package/dist/core/__tests__/serial/live-mutation.test.js +1 -1
  108. package/dist/core/__tests__/serial/tmux-surface.test.js +4 -2
  109. package/dist/core/__tests__/serial/worktree.test.js +24 -198
  110. package/dist/core/__tests__/session-cycles.test.js +22 -0
  111. package/dist/core/__tests__/stop-guard.test.js +4 -4
  112. package/dist/core/__tests__/watchdog-abort-arms-retry.test.js +19 -4
  113. package/dist/core/bash-jobs.d.ts +6 -0
  114. package/dist/core/bash-jobs.js +10 -0
  115. package/dist/core/canvas/__tests__/attention.test.js +8 -5
  116. package/dist/core/canvas/__tests__/render-remote.test.js +5 -5
  117. package/dist/core/canvas/attention.js +8 -6
  118. package/dist/core/canvas/browse/model.d.ts +8 -2
  119. package/dist/core/canvas/browse/model.js +11 -4
  120. package/dist/core/canvas/canvas.d.ts +7 -0
  121. package/dist/core/canvas/canvas.js +37 -0
  122. package/dist/core/canvas/crons.d.ts +9 -0
  123. package/dist/core/canvas/crons.js +51 -0
  124. package/dist/core/canvas/node-order.d.ts +22 -1
  125. package/dist/core/canvas/node-order.js +26 -1
  126. package/dist/core/canvas/render-source.d.ts +5 -0
  127. package/dist/core/canvas/render-source.js +1 -0
  128. package/dist/core/canvas/types.d.ts +9 -3
  129. package/dist/core/command-plugins/bundle.d.ts +6 -1
  130. package/dist/core/command-plugins/bundle.js +26 -13
  131. package/dist/core/command.js +2 -1
  132. package/dist/core/config.d.ts +47 -1
  133. package/dist/core/config.js +137 -4
  134. package/dist/core/help.js +1 -1
  135. package/dist/core/human/__tests__/page-catalog.test.js +4 -0
  136. package/dist/core/human/__tests__/page-tickets.test.js +65 -52
  137. package/dist/core/human/__tests__/page.test.js +56 -98
  138. package/dist/core/human/__tests__/serial/inbox-core.test.js +6 -6
  139. package/dist/core/human/answer-text.js +3 -3
  140. package/dist/core/human/answer.d.ts +6 -4
  141. package/dist/core/human/answer.js +4 -10
  142. package/dist/core/human/component-docs.d.ts +11 -7
  143. package/dist/core/human/component-docs.js +361 -88
  144. package/dist/core/human/convention.d.ts +17 -3
  145. package/dist/core/human/convention.js +36 -5
  146. package/dist/core/human/feedback-companion.d.ts +20 -0
  147. package/dist/core/human/feedback-companion.js +98 -0
  148. package/dist/core/human/feedback.d.ts +65 -0
  149. package/dist/core/human/feedback.js +116 -0
  150. package/dist/core/human/page-catalog.d.ts +40 -5
  151. package/dist/core/human/page-catalog.js +102 -30
  152. package/dist/core/human/page-errors.d.ts +4 -0
  153. package/dist/core/human/page-errors.js +7 -0
  154. package/dist/core/human/page-eval.d.ts +20 -0
  155. package/dist/core/human/page-eval.js +123 -0
  156. package/dist/core/human/page-schema.d.ts +23 -191
  157. package/dist/core/human/page-schema.js +60 -89
  158. package/dist/core/human/page-synth.d.ts +1 -1
  159. package/dist/core/human/page-synth.js +15 -18
  160. package/dist/core/human/page.d.ts +12 -27
  161. package/dist/core/human/page.js +142 -474
  162. package/dist/core/human/root.d.ts +6 -2
  163. package/dist/core/human/root.js +12 -4
  164. package/dist/core/human/scan.d.ts +3 -4
  165. package/dist/core/human/scan.js +16 -15
  166. package/dist/core/human/summary.d.ts +1 -2
  167. package/dist/core/human/summary.js +2 -2
  168. package/dist/core/human/tickets.d.ts +20 -14
  169. package/dist/core/human/tickets.js +91 -31
  170. package/dist/core/human/types.d.ts +10 -2
  171. package/dist/core/preview-registry.js +8 -10
  172. package/dist/core/profiles/default-binding.d.ts +4 -0
  173. package/dist/core/profiles/default-binding.js +24 -0
  174. package/dist/core/profiles/deletion-reservation.d.ts +8 -0
  175. package/dist/core/profiles/deletion-reservation.js +38 -0
  176. package/dist/core/profiles/manifest.d.ts +3 -0
  177. package/dist/core/profiles/manifest.js +12 -0
  178. package/dist/core/profiles/select.js +2 -2
  179. package/dist/core/review/realize.js +3 -3
  180. package/dist/core/review/store.d.ts +6 -0
  181. package/dist/core/review/store.js +31 -0
  182. package/dist/core/runtime/bearings.d.ts +0 -4
  183. package/dist/core/runtime/bearings.js +4 -62
  184. package/dist/core/runtime/bin-contributions.d.ts +44 -0
  185. package/dist/core/runtime/bin-contributions.js +186 -0
  186. package/dist/core/runtime/broker/client-registry.d.ts +4 -0
  187. package/dist/core/runtime/broker/client-registry.js +13 -1
  188. package/dist/core/runtime/broker/extension-abort.d.ts +1 -1
  189. package/dist/core/runtime/broker/extension-abort.js +4 -2
  190. package/dist/core/runtime/broker/fault-retry.js +4 -0
  191. package/dist/core/runtime/broker/frame-dispatch.d.ts +3 -1
  192. package/dist/core/runtime/broker/frame-dispatch.js +5 -6
  193. package/dist/core/runtime/broker/read-ops.d.ts +1 -1
  194. package/dist/core/runtime/broker/read-ops.js +2 -2
  195. package/dist/core/runtime/broker/rebind.d.ts +1 -0
  196. package/dist/core/runtime/broker/rebind.js +6 -1
  197. package/dist/core/runtime/broker-extension-render.js +19 -0
  198. package/dist/core/runtime/broker-protocol.d.ts +14 -0
  199. package/dist/core/runtime/broker.d.ts +1 -1
  200. package/dist/core/runtime/broker.js +17 -6
  201. package/dist/core/runtime/front-door-env.d.ts +5 -0
  202. package/dist/core/runtime/front-door-env.js +16 -0
  203. package/dist/core/runtime/front-door.d.ts +1 -5
  204. package/dist/core/runtime/front-door.js +2 -5
  205. package/dist/core/runtime/host.d.ts +1 -1
  206. package/dist/core/runtime/invocation.d.ts +6 -0
  207. package/dist/core/runtime/invocation.js +10 -0
  208. package/dist/core/runtime/kickoff.js +34 -0
  209. package/dist/core/runtime/launch.d.ts +2 -6
  210. package/dist/core/runtime/node-read.js +4 -1
  211. package/dist/core/runtime/nodes.js +2 -0
  212. package/dist/core/runtime/promote.d.ts +1 -0
  213. package/dist/core/runtime/promote.js +3 -1
  214. package/dist/core/runtime/session-cycles.d.ts +6 -0
  215. package/dist/core/runtime/session-cycles.js +15 -1
  216. package/dist/core/runtime/session-visibility.d.ts +17 -8
  217. package/dist/core/runtime/session-visibility.js +19 -10
  218. package/dist/core/runtime/spawn-env.d.ts +9 -1
  219. package/dist/core/runtime/spawn-env.js +62 -2
  220. package/dist/core/runtime/stop-guard.d.ts +2 -2
  221. package/dist/core/runtime/stop-guard.js +2 -2
  222. package/dist/core/runtime/stop-signals.d.ts +1 -1
  223. package/dist/core/runtime/stop-signals.js +2 -2
  224. package/dist/core/runtime/tmux-bindings.js +1 -1
  225. package/dist/core/session-model/session-state.d.ts +4 -3
  226. package/dist/core/session-model/session-state.js +14 -1
  227. package/dist/core/user-settings.d.ts +21 -2
  228. package/dist/core/user-settings.js +32 -11
  229. package/dist/core/worktree.d.ts +15 -45
  230. package/dist/core/worktree.js +59 -261
  231. package/dist/daemon/api/__tests__/seam/profile-delete.test.d.ts +1 -0
  232. package/dist/daemon/api/__tests__/seam/profile-delete.test.js +386 -0
  233. package/dist/daemon/api/handlers/bash-jobs.js +1 -1
  234. package/dist/daemon/api/handlers/broker-ops.js +9 -5
  235. package/dist/daemon/api/handlers/feedback-comments.d.ts +2 -0
  236. package/dist/daemon/api/handlers/feedback-comments.js +207 -0
  237. package/dist/daemon/api/handlers/human.js +24 -20
  238. package/dist/daemon/api/handlers/inbox.d.ts +10 -0
  239. package/dist/daemon/api/handlers/inbox.js +39 -115
  240. package/dist/daemon/api/handlers/profiles.js +11 -29
  241. package/dist/daemon/api/map.d.ts +6 -1
  242. package/dist/daemon/api/map.js +23 -0
  243. package/dist/daemon/api/server.js +3 -1
  244. package/dist/daemon/companion-retire.d.ts +2 -0
  245. package/dist/daemon/companion-retire.js +33 -0
  246. package/dist/daemon/cron-run.js +14 -16
  247. package/dist/daemon/human/finish.d.ts +12 -7
  248. package/dist/daemon/human/finish.js +101 -38
  249. package/dist/daemon/human/sweep.js +5 -1
  250. package/dist/daemon/profile-delete.d.ts +7 -0
  251. package/dist/daemon/profile-delete.js +306 -0
  252. package/dist/daemon/reconcilers/broker-supervision.js +3 -1
  253. package/dist/daemon/review/deliver.js +3 -3
  254. package/dist/daemon/review/finish.d.ts +0 -2
  255. package/dist/daemon/review/finish.js +1 -29
  256. package/dist/pi-extensions/__tests__/canvas-bash-valve.test.js +56 -1
  257. package/dist/pi-extensions/__tests__/canvas-stophook-agentend.test.js +4 -4
  258. package/dist/pi-extensions/canvas-bash-valve.js +19 -5
  259. package/dist/pi-extensions/canvas-inbox-watcher.js +1 -1
  260. package/dist/pi-extensions/canvas-review-boundary.d.ts +4 -0
  261. package/dist/pi-extensions/canvas-review-boundary.js +18 -9
  262. package/dist/pi-extensions/canvas-stophook.js +4 -4
  263. package/dist/shared/generated-context.js +2 -2
  264. package/dist/types.d.ts +44 -2
  265. package/dist/types.js +7 -2
  266. package/package.json +6 -5
  267. package/runtime.lock.json +5 -33
  268. package/dist/builtin-memory/init.md +0 -38
  269. package/dist/builtin-memory/plan.md +0 -19
  270. package/dist/builtin-memory/spec.md +0 -19
  271. package/dist/commands/human/doc.d.ts +0 -2
  272. package/dist/commands/human/doc.js +0 -91
  273. package/dist/commands/human/html.js +0 -81
  274. package/dist/commands/human/inbox.d.ts +0 -2
  275. package/dist/core/human/__tests__/html-markdown.test.js +0 -52
  276. package/dist/core/human/__tests__/page-render.test.js +0 -66
  277. package/dist/core/human/html-markdown.d.ts +0 -3
  278. package/dist/core/human/html-markdown.js +0 -288
  279. package/dist/core/human/page-render.d.ts +0 -4
  280. package/dist/core/human/page-render.js +0 -105
  281. package/dist/pages/bundle.css +0 -1
  282. package/dist/pages/bundle.js +0 -1778
  283. package/dist/pages/comments.d.ts +0 -72
  284. package/dist/pages/comments.js +0 -176
  285. package/dist/pages/controls.d.ts +0 -98
  286. package/dist/pages/controls.js +0 -261
  287. package/dist/pages/elements/cards.d.ts +0 -28
  288. package/dist/pages/elements/cards.js +0 -915
  289. package/dist/pages/elements/chart.d.ts +0 -23
  290. package/dist/pages/elements/chart.js +0 -664
  291. package/dist/pages/elements/options.d.ts +0 -30
  292. package/dist/pages/elements/options.js +0 -742
  293. package/dist/pages/elements/pages.d.ts +0 -30
  294. package/dist/pages/elements/pages.js +0 -377
  295. package/dist/pages/elements/slot.d.ts +0 -26
  296. package/dist/pages/elements/slot.js +0 -112
  297. package/dist/pages/elements/table.d.ts +0 -36
  298. package/dist/pages/elements/table.js +0 -1043
  299. package/dist/pages/elements/text.d.ts +0 -31
  300. package/dist/pages/elements/text.js +0 -1175
  301. package/dist/pages/entry.d.ts +0 -8
  302. package/dist/pages/entry.js +0 -8
  303. package/dist/pages/host.d.ts +0 -134
  304. package/dist/pages/host.js +0 -165
  305. package/dist/pages/readonly.d.ts +0 -24
  306. package/dist/pages/readonly.js +0 -31
  307. package/dist/pages/register.d.ts +0 -2
  308. package/dist/pages/register.js +0 -3
  309. package/dist/pages/responses.d.ts +0 -37
  310. package/dist/pages/responses.js +0 -56
  311. package/dist/pages/slot-config.d.ts +0 -36
  312. package/dist/pages/slot-config.js +0 -50
  313. package/dist/pages/types.d.ts +0 -98
  314. package/dist/pages/types.js +0 -23
  315. /package/dist/{core/human/__tests__/html-markdown.test.d.ts → commands/__tests__/node-message.test.d.ts} +0 -0
  316. /package/dist/core/{human/__tests__/page-render.test.d.ts → __tests__/plugin-page-components.test.d.ts} +0 -0
@@ -1,7 +1,7 @@
1
1
  import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
3
  import { jobDir } from '../canvas/paths.js';
4
- const SIGNALS = ['pushedFinal', 'askedHuman'];
4
+ const SIGNALS = ['pushedFinal', 'requestedHumanReply'];
5
5
  function signalPath(nodeId, signal) {
6
6
  return join(jobDir(nodeId), `.${signal}`);
7
7
  }
@@ -24,7 +24,7 @@ export function markStopSignal(nodeId, signal) {
24
24
  /** Consume command outcomes from this broker's just-settled turn. Markers from
25
25
  * an earlier crashed broker are discarded rather than bleeding into its successor. */
26
26
  export function consumeStopSignals(nodeId) {
27
- const signals = { pushedFinal: false, askedHuman: false };
27
+ const signals = { pushedFinal: false, requestedHumanReply: false };
28
28
  for (const signal of SIGNALS) {
29
29
  const path = signalPath(nodeId, signal);
30
30
  if (!existsSync(path))
@@ -522,7 +522,7 @@ function restoreWrappedBinding(wrapper) {
522
522
  // not the sealed generation that installed it. The neighboring `crtr surface node cycle` builders
523
523
  // share that property.
524
524
  export function inboxToggleTmuxCommand() {
525
- return ['run-shell', '-b', 'crtr human inbox toggle --quiet --tmux-socket "#{socket_path}" --tmux-client "#{client_name}" --target-pane "#{pane_id}"'];
525
+ return ['run-shell', '-b', 'crtr surface inbox --quiet --tmux-socket "#{socket_path}" --tmux-client "#{client_name}" --target-pane "#{pane_id}"'];
526
526
  }
527
527
  function actionCommand(id) {
528
528
  switch (id) {
@@ -24,9 +24,10 @@ export interface SessionState {
24
24
  /** Live context occupancy in prompt tokens: seeded from the snapshot's
25
25
  * contextUsage, then tracked off each assistant `message_end`. */
26
26
  contextTokens: number | undefined;
27
- /** Queued steering + follow-up messages, from `queue_update`. A fresh broker
28
- * with an empty queue emits no `queue_update`, so every welcome resets this
29
- * rather than leaving a dead broker's rows on screen. */
27
+ /** Queued steering + follow-up messages: seeded from `welcome.snapshot.queued`
28
+ * and tracked off `queue_update`. Every welcome REPLACES this — the attaching
29
+ * broker's own queue is the whole truth, so a dead broker's rows never survive
30
+ * and a client attaching mid-queue still sees what is waiting. */
30
31
  queued: Array<{
31
32
  text: string;
32
33
  }>;
@@ -48,7 +48,7 @@ export function applySnapshot(frame) {
48
48
  agentDir: frame.agentDir,
49
49
  engine: snapshot.state,
50
50
  contextTokens: contextUsage?.tokens ?? undefined,
51
- queued: [],
51
+ queued: snapshotQueued(snapshot),
52
52
  display: {
53
53
  statuses: { ...display.statuses },
54
54
  widgets: Object.fromEntries(Object.entries(display.widgets).map(([k, w]) => [k, { lines: [...w.lines], placement: w.placement }])),
@@ -140,6 +140,19 @@ export function reduce(state, frame) {
140
140
  return state;
141
141
  }
142
142
  }
143
+ /** The queue a `welcome` reports, composed exactly as `queue_update` composes
144
+ * it. Absent on a snapshot from a broker generation older than the field, and
145
+ * on an offline node (no engine, so no queue) — both mean nothing is waiting. */
146
+ function snapshotQueued(snapshot) {
147
+ const queued = snapshot.queued;
148
+ if (typeof queued !== 'object' || queued === null)
149
+ return [];
150
+ const { steering, followUp } = queued;
151
+ return [...texts(steering), ...texts(followUp)].map((text) => ({ text }));
152
+ }
153
+ function texts(value) {
154
+ return Array.isArray(value) ? value.filter((entry) => typeof entry === 'string') : [];
155
+ }
143
156
  /** Apply a partial patch to pi's state, preserving reference identity when the
144
157
  * patch changes nothing (and when no welcome has seeded `engine` yet). */
145
158
  function patchEngine(state, patch) {
@@ -147,10 +147,10 @@ export declare const CONFIG_SETTINGS_COVERAGE: {
147
147
  setFromString: (config: ScopeConfig, raw: string) => string | null;
148
148
  };
149
149
  };
150
- html_surface: {
150
+ page_surface: {
151
151
  surface: "settings";
152
152
  setting: {
153
- key: "html_surface";
153
+ key: "page_surface";
154
154
  label: string;
155
155
  description: string;
156
156
  valueConstraint: string;
@@ -166,6 +166,21 @@ export declare const CONFIG_SETTINGS_COVERAGE: {
166
166
  surface: "specialized";
167
167
  owner: string;
168
168
  };
169
+ whip_message_mode: {
170
+ surface: "settings";
171
+ setting: {
172
+ key: "whip_message_mode";
173
+ label: string;
174
+ description: string;
175
+ valueConstraint: string;
176
+ applies: string;
177
+ group: "display";
178
+ order: number;
179
+ format: (config: ScopeConfig) => "random" | "go faster";
180
+ cycle: (config: ScopeConfig, delta: number) => void;
181
+ setFromString: (config: ScopeConfig, raw: string) => string | null;
182
+ };
183
+ };
169
184
  mouse_mode_default: {
170
185
  surface: "settings";
171
186
  setting: {
@@ -307,6 +322,10 @@ export declare const CONFIG_SETTINGS_COVERAGE: {
307
322
  surface: "specialized";
308
323
  owner: string;
309
324
  };
325
+ bin: {
326
+ surface: "specialized";
327
+ owner: string;
328
+ };
310
329
  };
311
330
  /** The exhaustive top-level key list used by config persistence and help. */
312
331
  export declare const SCOPE_CONFIG_KEYS: (keyof ScopeConfig)[];
@@ -1,4 +1,4 @@
1
- import { CONDENSED_HISTORY_MODES, MOUSE_MODE_DEFAULTS } from '../types.js';
1
+ import { CONDENSED_HISTORY_MODES, MOUSE_MODE_DEFAULTS, WHIP_MESSAGE_MODES } from '../types.js';
2
2
  function cycleChoice(choices, current, delta) {
3
3
  const index = choices.indexOf(current);
4
4
  const start = index >= 0 ? index : 0;
@@ -158,7 +158,7 @@ export const CONFIG_SETTINGS_COVERAGE = {
158
158
  valueConstraint: 'true|false',
159
159
  applies: 'Applies on the next turn end.',
160
160
  group: 'display',
161
- order: 40,
161
+ order: 41,
162
162
  format: (config) => config.completion_bell ? 'on' : 'off',
163
163
  cycle: (config) => { config.completion_bell = !config.completion_bell; },
164
164
  setFromString: (config, raw) => {
@@ -192,28 +192,48 @@ export const CONFIG_SETTINGS_COVERAGE = {
192
192
  },
193
193
  },
194
194
  },
195
- html_surface: {
195
+ page_surface: {
196
196
  surface: 'settings',
197
197
  setting: {
198
- key: 'html_surface',
199
- label: 'HTML human surface',
200
- description: 'Prompt agents to use HTML pages by default for structured or interactive content shown to you.',
198
+ key: 'page_surface',
199
+ label: 'Page human surface',
200
+ description: 'Prompt agents to use JSX pages by default for structured or interactive content shown to you.',
201
201
  valueConstraint: 'true|false',
202
202
  applies: 'Applies when human command help is assembled.',
203
203
  group: 'display',
204
204
  order: 37,
205
- format: (config) => config.html_surface ? 'on' : 'off',
206
- cycle: (config) => { config.html_surface = !config.html_surface; },
205
+ format: (config) => config.page_surface ? 'on' : 'off',
206
+ cycle: (config) => { config.page_surface = !config.page_surface; },
207
207
  setFromString: (config, raw) => {
208
- const value = booleanFromString(raw, 'html_surface');
208
+ const value = booleanFromString(raw, 'page_surface');
209
209
  if (typeof value === 'string')
210
210
  return value;
211
- config.html_surface = value;
211
+ config.page_surface = value;
212
212
  return null;
213
213
  },
214
214
  },
215
215
  },
216
216
  whip_messages: { surface: 'specialized', owner: 'sys config set whip_messages' },
217
+ whip_message_mode: {
218
+ surface: 'settings',
219
+ setting: {
220
+ key: 'whip_message_mode',
221
+ label: 'Whip message',
222
+ description: 'What the whip action sends: a random line from whip_messages, or the fixed “Go faster”.',
223
+ valueConstraint: WHIP_MESSAGE_MODES.join('|'),
224
+ applies: 'Applies on the next attach.',
225
+ group: 'display',
226
+ order: 40,
227
+ format: (config) => config.whip_message_mode === 'go-faster' ? 'go faster' : 'random',
228
+ cycle: (config, delta) => { config.whip_message_mode = cycleChoice(WHIP_MESSAGE_MODES, config.whip_message_mode, delta); },
229
+ setFromString: (config, raw) => {
230
+ if (!WHIP_MESSAGE_MODES.includes(raw))
231
+ return `whip_message_mode must be one of: ${WHIP_MESSAGE_MODES.join('|')}`;
232
+ config.whip_message_mode = raw;
233
+ return null;
234
+ },
235
+ },
236
+ },
217
237
  mouse_mode_default: {
218
238
  surface: 'settings',
219
239
  setting: {
@@ -365,9 +385,10 @@ export const CONFIG_SETTINGS_COVERAGE = {
365
385
  modelRoutes: { surface: 'specialized', owner: 'Models route declarations' },
366
386
  modelRouting: { surface: 'specialized', owner: 'Models route declarations' },
367
387
  kinds: { surface: 'specialized', owner: 'Models tab and kind registry' },
368
- page_components: { surface: 'specialized', owner: 'Page component catalog: product-registered page slot kinds' },
388
+ page_components: { surface: 'specialized', owner: 'Page component catalog: product-registered page component kinds' },
369
389
  remoteCanvas: { surface: 'specialized', owner: 'canvas config commands' },
370
390
  spawnEnv: { surface: 'specialized', owner: 'spawn environment allow-list' },
391
+ bin: { surface: 'specialized', owner: 'bare-binary contributions on every node PATH' },
371
392
  };
372
393
  /** The exhaustive top-level key list used by config persistence and help. */
373
394
  export const SCOPE_CONFIG_KEYS = Object.keys(CONFIG_SETTINGS_COVERAGE);
@@ -1,4 +1,3 @@
1
- import { type GitResult, type GitSyncOptions } from './git.js';
2
1
  import { type NodeMeta, type ManagedWorktree } from './canvas/index.js';
3
2
  export interface WorktreeCommandResult {
4
3
  ok: boolean;
@@ -23,32 +22,24 @@ export interface CloseManagedWorktreeResult {
23
22
  branch: string;
24
23
  worktree_path: string;
25
24
  landed_sha: string;
26
- /** False when the landing happened but the worktree checkout could not be
27
- * removed automatically afterward — the close still counts as done (state is
28
- * closed, push-final is unblocked); `worktree_remove_error` carries the
29
- * manual cleanup note. */
25
+ /** Always false for a live caller: cleanup is deliberately pending until
26
+ * the caller exits and the reported manual command can safely remove it. */
30
27
  worktree_removed: boolean;
31
28
  worktree_remove_error?: string;
32
- /** False when the landing happened but the local branch could not be deleted
33
- * afterward — same non-fatal treatment as worktree_removed. */
29
+ /** Always false while the pending-cleanup checkout has this branch checked out. */
34
30
  branch_deleted: boolean;
35
31
  branch_delete_error?: string;
36
32
  }
37
33
  export declare function closeManagedWorktree(nodeId: string): CloseManagedWorktreeResult;
38
- type WorktreeCleanupRunner = (args: string[], cwd: string, options: GitSyncOptions) => GitResult;
39
- /** Test seam for the bounded post-land cleanup regression. */
40
- export declare function setWorktreeCleanupRunnerForTest(runner?: WorktreeCleanupRunner): void;
41
34
  /** Recovery guidance for a vanished checkout whose refs do not prove that its
42
35
  * work is delivered. This deliberately never recommends `worktree close`:
43
36
  * that command cannot operate on the absent checkout. */
44
37
  export declare function missingWorktreeRecoveryHint(wt: ManagedWorktree): string;
45
38
  interface CleanEmptyProof {
46
- /** The branch's HEAD SHA at the moment this was proven clean-and-contained
47
- * — the exact value the destructive delete must be conditioned on. */
39
+ /** The branch's HEAD SHA at the moment this was proven clean and contained
40
+ * in the current base. */
48
41
  branchSha: string;
49
- /** The base branch tip the proof was made against; re-resolved and
50
- * re-checked immediately before the destructive delete, since the proof
51
- * and the delete are two different points in time. */
42
+ /** The current base tip, retained for race diagnostics. */
52
43
  baseSha: string;
53
44
  }
54
45
  /** Fix B's shared "nothing to land" test — the SAME clean-worktree definition
@@ -58,20 +49,11 @@ interface CleanEmptyProof {
58
49
  * be a git-ancestor of (or equal to) the CURRENT tip of its recorded base
59
50
  * branch — i.e. landing it would be a pure no-op. Any ambiguity (missing
60
51
  * path, mid-rebase, wrong branch, an unresolvable base, or a real ancestry
61
- * divergence) returns null: this function only ever proves "safe to drop"
52
+ * divergence) returns null: this function only ever proves a no-op land
62
53
  * when a live git check establishes it, never on a heuristic guess, so real
63
- * unlanded work always falls through to the existing explicit-close guard.
64
- * This proof is NOT itself the safety boundary — it only decides whether
65
- * auto-drop is even attempted. `autoDropCleanManagedWorktreeLocked` below
66
- * re-proves containment against the LIVE base immediately before the
67
- * destructive delete, refuses outright if the checkout cannot be removed,
68
- * and conditions the delete itself on BOTH `branchSha` and that same live
69
- * base SHA via `bestEffortDeleteBranchWithBaseProof`'s atomic multi-ref
70
- * transaction — those checks, not this one, are what close the TOCTOU gap.
71
- * Exported (alongside
72
- * `autoDropCleanManagedWorktreeLocked`) purely so regression tests can
73
- * inject a race in the window between proving and cleanup; production code
74
- * must always go through `autoDropCleanManagedWorktree`. */
54
+ * unlanded work always falls through to the explicit-close guard. The locked
55
+ * path re-checks this predicate before recording deferred cleanup; production
56
+ * code must always go through `autoDropCleanManagedWorktree`. */
75
57
  export declare function proveCleanEmptyManagedWorktree(wt: ManagedWorktree): CleanEmptyProof | null;
76
58
  export interface AutoDroppedWorktree {
77
59
  node_id: string;
@@ -82,22 +64,10 @@ export interface AutoDroppedWorktree {
82
64
  branch_deleted: boolean;
83
65
  branch_delete_error?: string;
84
66
  }
85
- /** Exported (see `proveCleanEmptyManagedWorktree`'s doc) so regression tests
86
- * can call it directly with a proof captured before injecting a race.
87
- * Returns null — persisting NO state change — when the immediate base
88
- * re-verification, the checkout removal, or the atomic base+branch delete
89
- * refuses: the caller (`autoDropCleanManagedWorktree`, and `push final`
90
- * above it) then falls through to the existing `open_managed_worktree`
91
- * guard exactly as if this worktree had never looked droppable. In every
92
- * refusal case the branch, and every commit reachable from it, is
93
- * unconditionally preserved — that is the actual safety property this
94
- * function guarantees. A checkout-removal refusal in particular must be
95
- * treated as a full refusal, not a partial success: if the checkout cannot
96
- * be removed (e.g. a file reappeared after the clean predicate ran), the
97
- * branch is still checked out somewhere, so this function must never reach
98
- * the ref-deletion transaction or mutate managed-worktree state — both the
99
- * branch and the live checkout stay fully recoverable and the caller's
100
- * `open_managed_worktree` guard fires. */
67
+ /** Re-check a clean auto-drop before closing its record. `push final` runs
68
+ * inside the owner broker, so it has the same destructive-cwd boundary as
69
+ * explicit close: removal and branch deletion are deferred until that owner
70
+ * has exited. */
101
71
  export declare function autoDropCleanManagedWorktreeLocked(nodeId: string, wt: ManagedWorktree, proof: CleanEmptyProof): AutoDroppedWorktree | null;
102
72
  /** `push final`'s escape hatch: a managed worktree that has
103
73
  * nothing to land is auto-dropped instead of blocking on an explicit
@@ -106,7 +76,7 @@ export declare function autoDropCleanManagedWorktreeLocked(nodeId: string, wt: M
106
76
  * that never had anything to close in the first place (a read-only
107
77
  * review node). Returns null and changes nothing when the worktree is not
108
78
  * PROVABLY empty-and-clean by `proveCleanEmptyManagedWorktree`, OR when a
109
- * concurrent mutation invalidates that proof before the destructive delete
79
+ * concurrent mutation invalidates that proof before the record is closed
110
80
  * (see `autoDropCleanManagedWorktreeLocked`); the caller's existing
111
81
  * `open_managed_worktree` guard then still applies unchanged — real
112
82
  * commits, real uncommitted changes, and a lost race all require the