@north-light/crouter 0.3.197 → 0.3.199

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 (339) hide show
  1. package/dist/api/client.d.ts +19 -19
  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 +126 -33
  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 +8 -8
  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 +3 -3
  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/builtin-memory/wedged-child-on-runaway-bash.md +1 -1
  33. package/dist/clients/attach/chrome/bash-jobs.js +3 -3
  34. package/dist/clients/attach/render/chat-view.d.ts +29 -9
  35. package/dist/clients/attach/render/chat-view.js +64 -35
  36. package/dist/clients/attach/render/markdown-source.js +0 -6
  37. package/dist/clients/attach/render/page-block.d.ts +34 -0
  38. package/dist/clients/attach/render/page-block.js +226 -0
  39. package/dist/clients/attach/render/tool-calls.js +16 -2
  40. package/dist/clients/attach/session/whip.d.ts +2 -0
  41. package/dist/clients/attach/session/whip.js +2 -0
  42. package/dist/clients/attach/viewer.js +1419 -982
  43. package/dist/clients/conversation/projection.js +18 -3
  44. package/dist/clients/inbox/__tests__/serial/inbox-controller.test.js +9 -6
  45. package/dist/clients/inbox/__tests__/serial/mount-panel.test.js +13 -14
  46. package/dist/clients/inbox/controller.js +10 -16
  47. package/dist/clients/inbox/page-adapter.d.ts +3 -4
  48. package/dist/clients/inbox/page-adapter.js +3 -4
  49. package/dist/clients/inbox/resolve.d.ts +1 -1
  50. package/dist/clients/inbox/resolve.js +3 -3
  51. package/dist/clients/inbox/review/document-surface.js +3 -1
  52. package/dist/clients/inbox/review/state.d.ts +2 -1
  53. package/dist/clients/inbox/review/state.js +5 -16
  54. package/dist/clients/inbox/tui/input.js +37 -19
  55. package/dist/clients/inbox/tui/panel.js +5 -31
  56. package/dist/clients/inbox/tui/render.d.ts +11 -0
  57. package/dist/clients/inbox/tui/render.js +101 -36
  58. package/dist/clients/inbox/tui/slots.d.ts +4 -4
  59. package/dist/clients/inbox/tui/slots.js +19 -44
  60. package/dist/clients/inbox/tui/types.d.ts +6 -10
  61. package/dist/clients/inbox/tui.js +2 -2
  62. package/dist/commands/__tests__/human.test.js +118 -24
  63. package/dist/commands/__tests__/node-message.test.js +14 -0
  64. package/dist/commands/attention.js +4 -4
  65. package/dist/commands/canvas-browse.js +1 -1
  66. package/dist/commands/canvas-snapshot.js +1 -1
  67. package/dist/commands/canvas.js +1 -1
  68. package/dist/commands/dashboard.js +1 -1
  69. package/dist/commands/human/{doc.d.ts → components.d.ts} +1 -1
  70. package/dist/commands/human/components.js +77 -0
  71. package/dist/commands/human/feedback.d.ts +2 -0
  72. package/dist/commands/human/feedback.js +108 -0
  73. package/dist/commands/human/prompts.d.ts +17 -8
  74. package/dist/commands/human/prompts.js +217 -226
  75. package/dist/commands/human/queue.js +57 -88
  76. package/dist/commands/human/shared.d.ts +4 -15
  77. package/dist/commands/human/shared.js +19 -61
  78. package/dist/commands/human.js +32 -19
  79. package/dist/commands/memory/origin.js +2 -2
  80. package/dist/commands/node/bash.js +4 -4
  81. package/dist/commands/node/inspect.js +3 -3
  82. package/dist/commands/node/lifecycle.js +1 -1
  83. package/dist/commands/node/message.js +2 -2
  84. package/dist/commands/node-worktree.js +8 -8
  85. package/dist/commands/pkg/browse.js +1 -1
  86. package/dist/commands/pkg/plugin-manage.js +129 -10
  87. package/dist/commands/profile/delete.js +41 -15
  88. package/dist/commands/profile.js +1 -1
  89. package/dist/commands/push.js +1 -1
  90. package/dist/commands/surface/node/focus.js +29 -14
  91. package/dist/commands/surface-edit.js +3 -3
  92. package/dist/commands/surface-inbox.d.ts +2 -0
  93. package/dist/commands/{human/inbox.js → surface-inbox.js} +14 -18
  94. package/dist/commands/surface.js +2 -1
  95. package/dist/commands/sys/doctor.js +60 -3
  96. package/dist/commands/sys/feedback.js +79 -25
  97. package/dist/commands/sys/settings.js +1 -1
  98. package/dist/core/__tests__/cron-broker-capacity.test.js +1 -1
  99. package/dist/core/__tests__/daemon-boot.test.js +7 -4
  100. package/dist/core/__tests__/dead-node-policy-table.test.js +20 -36
  101. package/dist/core/__tests__/extension-abort.test.js +5 -2
  102. package/dist/core/__tests__/fixtures/fake-engine.d.ts +13 -2
  103. package/dist/core/__tests__/fixtures/fake-engine.js +47 -3
  104. package/dist/core/__tests__/human-cancel-guard.test.js +31 -10
  105. package/dist/core/__tests__/human-deliver.test.js +41 -45
  106. package/dist/core/__tests__/human-node-not-supervised.test.js +1 -1
  107. package/dist/core/__tests__/plugin-page-components.test.js +157 -0
  108. package/dist/core/__tests__/seam/broker-crash-teardown.test.js +13 -11
  109. package/dist/core/__tests__/seam/dormancy-release.test.js +103 -4
  110. package/dist/core/__tests__/serial/flagship-lifecycle.test.js +2 -2
  111. package/dist/core/__tests__/serial/human-deliver-e2e.test.js +12 -16
  112. package/dist/core/__tests__/serial/live-mutation.test.js +1 -1
  113. package/dist/core/__tests__/serial/tmux-surface.test.js +4 -2
  114. package/dist/core/__tests__/serial/worktree.test.js +24 -198
  115. package/dist/core/__tests__/session-cycles.test.js +22 -0
  116. package/dist/core/__tests__/stop-guard.test.js +4 -4
  117. package/dist/core/__tests__/watchdog-abort-arms-retry.test.js +19 -4
  118. package/dist/core/bash-jobs.d.ts +6 -0
  119. package/dist/core/bash-jobs.js +10 -0
  120. package/dist/core/canvas/__tests__/attention.test.js +8 -5
  121. package/dist/core/canvas/__tests__/render-remote.test.js +5 -5
  122. package/dist/core/canvas/attention.js +8 -6
  123. package/dist/core/canvas/browse/app.d.ts +1 -1
  124. package/dist/core/canvas/browse/app.js +21 -3
  125. package/dist/core/canvas/browse/model.d.ts +8 -2
  126. package/dist/core/canvas/browse/model.js +11 -4
  127. package/dist/core/canvas/browse/render.d.ts +4 -0
  128. package/dist/core/canvas/browse/render.js +5 -1
  129. package/dist/core/canvas/canvas.d.ts +33 -0
  130. package/dist/core/canvas/canvas.js +92 -0
  131. package/dist/core/canvas/crons.d.ts +9 -0
  132. package/dist/core/canvas/crons.js +51 -0
  133. package/dist/core/canvas/node-order.d.ts +22 -1
  134. package/dist/core/canvas/node-order.js +26 -1
  135. package/dist/core/canvas/render-source.d.ts +5 -0
  136. package/dist/core/canvas/render-source.js +1 -0
  137. package/dist/core/canvas/types.d.ts +9 -3
  138. package/dist/core/command-plugins/bundle.d.ts +6 -1
  139. package/dist/core/command-plugins/bundle.js +26 -13
  140. package/dist/core/command.js +8 -12
  141. package/dist/core/config.d.ts +47 -1
  142. package/dist/core/config.js +138 -4
  143. package/dist/core/help.d.ts +3 -0
  144. package/dist/core/help.js +1 -1
  145. package/dist/core/human/__tests__/page-catalog.test.d.ts +1 -0
  146. package/dist/core/human/__tests__/page-catalog.test.js +20 -0
  147. package/dist/core/human/__tests__/page-tickets.test.js +68 -34
  148. package/dist/core/human/__tests__/page.test.js +60 -119
  149. package/dist/core/human/__tests__/serial/inbox-core.test.js +6 -16
  150. package/dist/core/human/answer-text.d.ts +3 -0
  151. package/dist/core/human/answer-text.js +98 -0
  152. package/dist/core/human/answer.d.ts +53 -0
  153. package/dist/core/human/answer.js +119 -0
  154. package/dist/core/human/component-docs.d.ts +18 -0
  155. package/dist/core/human/component-docs.js +434 -0
  156. package/dist/core/human/convention.d.ts +17 -3
  157. package/dist/core/human/convention.js +36 -5
  158. package/dist/core/human/feedback-companion.d.ts +20 -0
  159. package/dist/core/human/feedback-companion.js +98 -0
  160. package/dist/core/human/feedback.d.ts +65 -0
  161. package/dist/core/human/feedback.js +116 -0
  162. package/dist/core/human/page-catalog.d.ts +56 -5
  163. package/dist/core/human/page-catalog.js +151 -22
  164. package/dist/core/human/page-errors.d.ts +4 -0
  165. package/dist/core/human/page-errors.js +7 -0
  166. package/dist/core/human/page-eval.d.ts +20 -0
  167. package/dist/core/human/page-eval.js +123 -0
  168. package/dist/core/human/page-schema.d.ts +48 -116
  169. package/dist/core/human/page-schema.js +100 -72
  170. package/dist/core/human/page-synth.d.ts +2 -4
  171. package/dist/core/human/page-synth.js +20 -7
  172. package/dist/core/human/page.d.ts +13 -21
  173. package/dist/core/human/page.js +147 -391
  174. package/dist/core/human/review-schema.d.ts +1 -0
  175. package/dist/core/human/review-schema.js +1 -1
  176. package/dist/core/human/root.d.ts +6 -2
  177. package/dist/core/human/root.js +12 -4
  178. package/dist/core/human/scan.d.ts +3 -3
  179. package/dist/core/human/scan.js +21 -21
  180. package/dist/core/human/summary.d.ts +2 -6
  181. package/dist/core/human/summary.js +3 -59
  182. package/dist/core/human/tickets.d.ts +22 -15
  183. package/dist/core/human/tickets.js +90 -28
  184. package/dist/core/human/types.d.ts +14 -2
  185. package/dist/core/keybindings/catalog.d.ts +2 -2
  186. package/dist/core/keybindings/catalog.js +1 -0
  187. package/dist/core/preview-registry.js +8 -10
  188. package/dist/core/profiles/default-binding.d.ts +4 -0
  189. package/dist/core/profiles/default-binding.js +24 -0
  190. package/dist/core/profiles/deletion-reservation.d.ts +8 -0
  191. package/dist/core/profiles/deletion-reservation.js +38 -0
  192. package/dist/core/profiles/manifest.d.ts +3 -0
  193. package/dist/core/profiles/manifest.js +12 -0
  194. package/dist/core/profiles/select.js +2 -2
  195. package/dist/core/review/realize.js +12 -4
  196. package/dist/core/review/store.d.ts +6 -0
  197. package/dist/core/review/store.js +31 -0
  198. package/dist/core/runtime/bearings.d.ts +0 -4
  199. package/dist/core/runtime/bearings.js +4 -62
  200. package/dist/core/runtime/bin-contributions.d.ts +44 -0
  201. package/dist/core/runtime/bin-contributions.js +186 -0
  202. package/dist/core/runtime/boot-root.js +6 -1
  203. package/dist/core/runtime/broker/client-registry.d.ts +4 -0
  204. package/dist/core/runtime/broker/client-registry.js +13 -1
  205. package/dist/core/runtime/broker/extension-abort.d.ts +1 -1
  206. package/dist/core/runtime/broker/extension-abort.js +4 -2
  207. package/dist/core/runtime/broker/fault-retry.js +4 -0
  208. package/dist/core/runtime/broker/frame-dispatch.d.ts +3 -1
  209. package/dist/core/runtime/broker/frame-dispatch.js +5 -6
  210. package/dist/core/runtime/broker/read-ops.d.ts +1 -1
  211. package/dist/core/runtime/broker/read-ops.js +2 -2
  212. package/dist/core/runtime/broker/rebind.d.ts +1 -0
  213. package/dist/core/runtime/broker/rebind.js +6 -1
  214. package/dist/core/runtime/broker-extension-render.js +19 -0
  215. package/dist/core/runtime/broker-protocol.d.ts +14 -0
  216. package/dist/core/runtime/broker.d.ts +1 -1
  217. package/dist/core/runtime/broker.js +25 -12
  218. package/dist/core/runtime/busy.d.ts +4 -3
  219. package/dist/core/runtime/busy.js +4 -3
  220. package/dist/core/runtime/front-door-env.d.ts +5 -0
  221. package/dist/core/runtime/front-door-env.js +16 -0
  222. package/dist/core/runtime/front-door.d.ts +1 -5
  223. package/dist/core/runtime/front-door.js +2 -5
  224. package/dist/core/runtime/host.d.ts +1 -1
  225. package/dist/core/runtime/invocation.d.ts +6 -0
  226. package/dist/core/runtime/invocation.js +10 -0
  227. package/dist/core/runtime/kickoff.js +34 -0
  228. package/dist/core/runtime/launch.d.ts +2 -6
  229. package/dist/core/runtime/node-read.js +4 -1
  230. package/dist/core/runtime/nodes.js +2 -0
  231. package/dist/core/runtime/promote.d.ts +1 -0
  232. package/dist/core/runtime/promote.js +3 -1
  233. package/dist/core/runtime/session-cycles.d.ts +6 -0
  234. package/dist/core/runtime/session-cycles.js +15 -1
  235. package/dist/core/runtime/session-visibility.d.ts +17 -8
  236. package/dist/core/runtime/session-visibility.js +19 -10
  237. package/dist/core/runtime/spawn-env.d.ts +9 -1
  238. package/dist/core/runtime/spawn-env.js +62 -2
  239. package/dist/core/runtime/spawn.js +4 -4
  240. package/dist/core/runtime/stop-guard.d.ts +2 -2
  241. package/dist/core/runtime/stop-guard.js +2 -2
  242. package/dist/core/runtime/stop-signals.d.ts +1 -1
  243. package/dist/core/runtime/stop-signals.js +2 -2
  244. package/dist/core/runtime/tmux-bindings.js +1 -1
  245. package/dist/core/session-model/session-state.d.ts +4 -3
  246. package/dist/core/session-model/session-state.js +14 -1
  247. package/dist/core/user-settings.d.ts +36 -2
  248. package/dist/core/user-settings.js +56 -14
  249. package/dist/core/worktree.d.ts +15 -45
  250. package/dist/core/worktree.js +59 -261
  251. package/dist/daemon/api/__tests__/seam/profile-delete.test.d.ts +1 -0
  252. package/dist/daemon/api/__tests__/seam/profile-delete.test.js +386 -0
  253. package/dist/daemon/api/handlers/bash-jobs.js +1 -1
  254. package/dist/daemon/api/handlers/broker-ops.js +9 -5
  255. package/dist/daemon/api/handlers/feedback-comments.d.ts +2 -0
  256. package/dist/daemon/api/handlers/feedback-comments.js +207 -0
  257. package/dist/daemon/api/handlers/human.js +24 -20
  258. package/dist/daemon/api/handlers/inbox.d.ts +10 -0
  259. package/dist/daemon/api/handlers/inbox.js +48 -109
  260. package/dist/daemon/api/handlers/profiles.js +11 -29
  261. package/dist/daemon/api/map.d.ts +6 -1
  262. package/dist/daemon/api/map.js +23 -0
  263. package/dist/daemon/api/server.js +3 -1
  264. package/dist/daemon/companion-retire.d.ts +2 -0
  265. package/dist/daemon/companion-retire.js +33 -0
  266. package/dist/daemon/cron-run.js +29 -17
  267. package/dist/daemon/crtrd.js +1 -1
  268. package/dist/daemon/fleet.d.ts +22 -10
  269. package/dist/daemon/fleet.js +43 -24
  270. package/dist/daemon/human/finish.d.ts +12 -6
  271. package/dist/daemon/human/finish.js +134 -54
  272. package/dist/daemon/human/sweep.js +9 -3
  273. package/dist/daemon/profile-delete.d.ts +7 -0
  274. package/dist/daemon/profile-delete.js +306 -0
  275. package/dist/daemon/reconcilers/broker-supervision.js +14 -9
  276. package/dist/daemon/reconcilers/dormant-inbox.js +11 -6
  277. package/dist/daemon/reconcilers/live-obligation.d.ts +21 -1
  278. package/dist/daemon/reconcilers/live-obligation.js +30 -2
  279. package/dist/daemon/reconcilers/storage-maintenance.d.ts +5 -0
  280. package/dist/daemon/reconcilers/storage-maintenance.js +28 -1
  281. package/dist/daemon/review/deliver.js +3 -3
  282. package/dist/daemon/review/finish.d.ts +0 -2
  283. package/dist/daemon/review/finish.js +1 -29
  284. package/dist/daemon/review/sweep.js +12 -1
  285. package/dist/pi-extensions/__tests__/canvas-bash-valve.test.js +56 -1
  286. package/dist/pi-extensions/__tests__/canvas-stophook-agentend.test.js +4 -4
  287. package/dist/pi-extensions/canvas-bash-valve.d.ts +9 -1
  288. package/dist/pi-extensions/canvas-bash-valve.js +31 -13
  289. package/dist/pi-extensions/canvas-inbox-watcher.js +1 -1
  290. package/dist/pi-extensions/canvas-review-boundary.d.ts +4 -0
  291. package/dist/pi-extensions/canvas-review-boundary.js +18 -9
  292. package/dist/pi-extensions/canvas-stophook.js +4 -4
  293. package/dist/shared/generated-context.js +2 -2
  294. package/dist/types.d.ts +61 -5
  295. package/dist/types.js +8 -2
  296. package/package.json +4 -4
  297. package/runtime.lock.json +5 -33
  298. package/scripts/install-runtime.mjs +19 -24
  299. package/dist/builtin-memory/init.md +0 -38
  300. package/dist/builtin-memory/plan.md +0 -19
  301. package/dist/builtin-memory/spec.md +0 -19
  302. package/dist/clients/attach/render/html-markdown.d.ts +0 -13
  303. package/dist/clients/attach/render/html-markdown.js +0 -206
  304. package/dist/commands/human/doc.js +0 -144
  305. package/dist/commands/human/inbox.d.ts +0 -2
  306. package/dist/core/human/__tests__/page-render.test.js +0 -49
  307. package/dist/core/human/markdown-html.d.ts +0 -8
  308. package/dist/core/human/markdown-html.js +0 -581
  309. package/dist/core/human/page-render.d.ts +0 -3
  310. package/dist/core/human/page-render.js +0 -131
  311. package/dist/pages/bundle.css +0 -1
  312. package/dist/pages/bundle.js +0 -1347
  313. package/dist/pages/comments.d.ts +0 -43
  314. package/dist/pages/comments.js +0 -125
  315. package/dist/pages/elements/cards.d.ts +0 -17
  316. package/dist/pages/elements/cards.js +0 -802
  317. package/dist/pages/elements/chart.js +0 -648
  318. package/dist/pages/elements/options.d.ts +0 -21
  319. package/dist/pages/elements/options.js +0 -629
  320. package/dist/pages/elements/pages.d.ts +0 -24
  321. package/dist/pages/elements/pages.js +0 -355
  322. package/dist/pages/elements/slot.d.ts +0 -21
  323. package/dist/pages/elements/slot.js +0 -105
  324. package/dist/pages/elements/table.d.ts +0 -19
  325. package/dist/pages/elements/table.js +0 -935
  326. package/dist/pages/elements/text.d.ts +0 -25
  327. package/dist/pages/elements/text.js +0 -968
  328. package/dist/pages/entry.d.ts +0 -8
  329. package/dist/pages/entry.js +0 -8
  330. package/dist/pages/host.d.ts +0 -158
  331. package/dist/pages/host.js +0 -182
  332. package/dist/pages/register.d.ts +0 -2
  333. package/dist/pages/register.js +0 -3
  334. package/dist/pages/slot-config.d.ts +0 -36
  335. package/dist/pages/slot-config.js +0 -50
  336. package/dist/pages/types.d.ts +0 -98
  337. package/dist/pages/types.js +0 -23
  338. /package/dist/{core/human/__tests__/page-render.test.d.ts → commands/__tests__/node-message.test.d.ts} +0 -0
  339. /package/dist/{pages/elements/chart.d.ts → core/__tests__/plugin-page-components.test.d.ts} +0 -0
@@ -12,7 +12,7 @@ import { getDefaultProfileId } from '../core/profiles/default-binding.js';
12
12
  export const browseLeaf = defineLeaf({
13
13
  name: 'browse',
14
14
  description: 'open the interactive canvas navigator (tabs/tree/search)',
15
- whenToUse: 'you want to VIEW and NAVIGATE the whole canvas interactively — a full-screen TUI with tabs (All/Live/Dormant/Attention/Pinned), an expandable tree (children auto-collapsed; → to expand), `/` fuzzy search, `f` to pin, `m` to message and `R` to rename a node in place, and `?` for the full keymap; Enter resumes the chosen node. Use this to find your way around a large canvas. Use `canvas dashboard` instead for a one-shot ASCII tree you can pipe, and `node inspect list` for a flat machine-readable roster',
15
+ whenToUse: 'you want to VIEW and NAVIGATE the whole canvas interactively — a full-screen TUI with tabs (All/Live/Dormant/Attention/Pinned), an expandable tree (children auto-collapsed; → to expand), `/` fuzzy search, `f` to pin, `y` to copy a node id, `m` to message and `R` to rename a node in place, and `?` for the full keymap; it opens on Live (active/idle) and Enter resumes the chosen node. Use this to find your way around a large canvas. Use `canvas dashboard` instead for a one-shot ASCII tree you can pipe, and `node inspect list` for a flat machine-readable roster',
16
16
  help: {
17
17
  name: 'canvas browse',
18
18
  summary: 'interactive full-screen canvas navigator — tabs, an auto-collapsed tree, and `/` fuzzy search; Enter resumes the chosen node via `crtr surface node focus`. Outside a TTY it prints the static forest and exits',
@@ -15,7 +15,7 @@ export const canvasSnapshotLeaf = defineLeaf({
15
15
  { name: 'subscriptions', type: 'object', required: true, constraint: 'Authoritative subscribes_to adjacency map: each node id maps to its publisher/child node ids in edge order.' },
16
16
  ],
17
17
  outputKind: 'object',
18
- effects: ['Read-only: queries canvas.db, focus rows, telemetry files, and human ask counts.'],
18
+ effects: ['Read-only: queries canvas.db, focus rows, telemetry files, and pending human-reply counts.'],
19
19
  // Machine-readable dump for the browser canvas, not for an agent/human to
20
20
  // glance at — collapse it in the attach viewer by default.
21
21
  preview: { suppressOutput: true },
@@ -43,7 +43,7 @@ export function registerCanvas() {
43
43
  help: {
44
44
  name: 'canvas',
45
45
  summary: 'observe and supervise the whole agent graph',
46
- model: 'Canvas-wide operations, distinct from per-node work (`node`) and a node\'s own spine write verb (`push`). `dashboard` renders the subscription forest as a tree; `browse` opens an interactive full-screen navigator (tabs/tree/search) over the whole canvas and resumes the chosen node; `attention` aggregates pending human asks across the graph; `revive --all` mass-reconnects every disconnected node (bringing back ONE named node is `node lifecycle revive <id>` instead); `history` searches and recalls the content record (reports + context docs) of past work in a cwd; `prune` bounds growth by deleting terminal nodes past a TTL. `config` registers/lists remote canvas targets (preview endpoint + relay token); `use` switches remote-capable read commands such as `node inspect` onto a configured target or back to local.',
46
+ model: 'Canvas-wide operations, distinct from per-node work (`node`) and a node\'s own spine write verb (`push`). `dashboard` renders the subscription forest as a tree; `browse` opens an interactive full-screen navigator (tabs/tree/search) over the whole canvas and resumes the chosen node; `attention` aggregates pending replies from the user across the graph; `revive --all` mass-reconnects every disconnected node (bringing back ONE named node is `node lifecycle revive <id>` instead); `history` searches and recalls the content record (reports + context docs) of past work in a cwd; `prune` bounds growth by deleting terminal nodes past a TTL. `config` registers/lists remote canvas targets (preview endpoint + relay token); `use` switches remote-capable read commands such as `node inspect` onto a configured target or back to local.',
47
47
  },
48
48
  children: [dashboardLeaf, canvasSnapshotLeaf, canvasRosterLeaf, browseLeaf, attentionBranch, reviveLeaf, historyBranch, chordLeaf, issueBranch, canvasPruneLeaf, canvasRebuildIndexLeaf, canvasConfigBranch, canvasUseLeaf],
49
49
  });
@@ -15,7 +15,7 @@ import { renderTreeFromSource, renderForestFromSource, dashboardRowsFromSource,
15
15
  export const dashboardLeaf = defineLeaf({
16
16
  name: 'dashboard',
17
17
  description: 'render the canvas as a subscription tree',
18
- whenToUse: 'you want the whole graph at a glance as a rendered tree — the subscription forest drawn in ASCII so you can read its SHAPE: who reports to whom, how deep each branch runs, plus each node\'s status and context size. Scope to one root or show the full forest. Use `node inspect list` instead for a flat roster without the tree, `node inspect show` to drill into one node\'s neighbors, and `canvas attention` to find which nodes are blocked on a human',
18
+ whenToUse: 'you want the whole graph at a glance as a rendered tree — the subscription forest drawn in ASCII so you can read its SHAPE: who reports to whom, how deep each branch runs, plus each node\'s status and context size. Scope to one root or show the full forest. Use `node inspect list` instead for a flat roster without the tree, `node inspect show` to drill into one node\'s neighbors, and `canvas attention` to find which nodes are blocked on the user',
19
19
  help: {
20
20
  name: 'canvas dashboard',
21
21
  summary: 'render the canvas as an ASCII subscription tree — scoped to a root or the full forest',
@@ -1,2 +1,2 @@
1
1
  import { type BranchDef } from '../../core/command.js';
2
- export declare const humanDoc: BranchDef;
2
+ export declare const humanComponents: BranchDef;
@@ -0,0 +1,77 @@
1
+ import { defineBranch, defineLeaf } from '../../core/command.js';
2
+ import { stateBlock } from '../../core/help.js';
3
+ import { InputError } from '../../core/io.js';
4
+ import { resolvePageComponents } from '../../core/config.js';
5
+ import { componentNames, renderComponentCatalog, renderComponentContract } from '../../core/human/component-docs.js';
6
+ function productComponents() {
7
+ return resolvePageComponents();
8
+ }
9
+ function componentNameState() {
10
+ const names = componentNames(productComponents());
11
+ return stateBlock('components', { count: names.length }, names.join(', '));
12
+ }
13
+ const humanComponentsList = defineLeaf({
14
+ name: 'list',
15
+ description: 'list page components for selection',
16
+ whenToUse: 'choosing which components to put in an authored page module.',
17
+ help: {
18
+ name: 'human components list',
19
+ summary: 'list page components for selection',
20
+ inputNote: 'No input parameters.',
21
+ output: [
22
+ { name: 'catalog', type: 'markdown', required: true, constraint: 'One concise selection entry per registry and product-registered component, grouped structural/response/display; no props or response schemas. A product component is written with the PascalCase tag derived from its registered kind.' },
23
+ { name: 'follow_up', type: 'string', required: true, constraint: 'Points to `crtr human components show <component>` for one selected component contract.' },
24
+ ],
25
+ outputKind: 'object',
26
+ effects: ['None. Read-only.'],
27
+ },
28
+ run: async () => ({
29
+ catalog: renderComponentCatalog(productComponents()),
30
+ follow_up: 'Use `crtr human components show <component>` for one component contract.',
31
+ }),
32
+ render: (result) => `${String(result['catalog'])}\n\n${String(result['follow_up'])}`,
33
+ });
34
+ const humanComponentsShow = defineLeaf({
35
+ name: 'show',
36
+ description: 'show one page component contract',
37
+ whenToUse: 'authoring one selected page component and needing its exact props, response contract, and shape in a page module.',
38
+ help: {
39
+ name: 'human components show',
40
+ summary: 'show one page component contract',
41
+ params: [
42
+ { kind: 'positional', name: 'component', type: 'string', required: true, constraint: 'Component name from the live <components> catalog below. Case-sensitive: registry components are PascalCase.' },
43
+ ],
44
+ output: [
45
+ { name: 'component', type: 'string', required: true, constraint: 'The selected component name.' },
46
+ { name: 'contract', type: 'markdown', required: true, constraint: 'Hand-written props, response contract, and authoring example for that component. A shadcn family (Card, CardHeader, …) shares one contract covering every member.' },
47
+ ],
48
+ outputKind: 'object',
49
+ effects: ['None. Read-only.'],
50
+ dynamicState: componentNameState,
51
+ },
52
+ run: async (input) => {
53
+ const component = input['component'];
54
+ const contract = renderComponentContract(component, productComponents());
55
+ if (contract === undefined) {
56
+ throw new InputError({
57
+ error: 'unknown_component',
58
+ message: `unknown page component "${component}"`,
59
+ field: 'component',
60
+ next: 'Run `crtr human components show -h` and choose a component from its live catalog.',
61
+ });
62
+ }
63
+ return { component, contract };
64
+ },
65
+ render: (result) => String(result['contract']),
66
+ });
67
+ export const humanComponents = defineBranch({
68
+ name: 'components',
69
+ description: 'discover page components and their contracts',
70
+ whenToUse: 'authoring a page module and choosing components, or needing one component’s exact props and response contract.',
71
+ help: {
72
+ name: 'human components',
73
+ summary: 'discover page components and their contracts',
74
+ model: 'These are the components already in scope in a page module — no import, ever. List is the selection catalog; show owns the full props, response contract, and authoring shape for one selected component.',
75
+ },
76
+ children: [humanComponentsList, humanComponentsShow],
77
+ });
@@ -0,0 +1,2 @@
1
+ import type { BranchDef } from '../../core/command.js';
2
+ export declare const humanFeedbackBranch: BranchDef;
@@ -0,0 +1,108 @@
1
+ // `crtr human feedback` — the feedback companion's surface for a page ticket's
2
+ // feedback comments. list shows every item with its id and status; resolve is
3
+ // the companion's terminal report that an open item has been dealt with.
4
+ // Creating comments is the person's channel (the page surface); no agent
5
+ // authors, edits, or deletes them.
6
+ import { existsSync } from 'node:fs';
7
+ import { ApiError } from '../../api/index.js';
8
+ import { defineBranch, defineLeaf } from '../../core/command.js';
9
+ import { pageManifestPath } from '../../core/human/convention.js';
10
+ import { opaqueInboxTicketId, ticketDir } from '../../core/human/root.js';
11
+ import { InputError } from '../../core/io.js';
12
+ import { cliClient, rethrowAsCliError } from '../api-client.js';
13
+ /** Feedback tickets are addressed by the same raw ids as `human resolve`:
14
+ * the page_id from human send, which is also the ticket's directory name. */
15
+ function requirePageTicketId(raw) {
16
+ const ticketId = raw;
17
+ if (!existsSync(pageManifestPath(ticketDir(ticketId)))) {
18
+ throw new InputError({ error: 'not_found', message: `no page ticket: ${ticketId}`, field: 'ticket_id', next: 'Pass the ticket id from your bearings, or a page ticket_id from `crtr human list`.' });
19
+ }
20
+ return ticketId;
21
+ }
22
+ const humanFeedbackList = defineLeaf({
23
+ name: 'list',
24
+ description: "list a page ticket's feedback comments",
25
+ whenToUse: 'you are the feedback companion for a page ticket and need each comment\'s id and open/resolved status.',
26
+ help: {
27
+ name: 'human feedback list',
28
+ summary: "every feedback comment on one page ticket, with ids and open/resolved status",
29
+ params: [
30
+ { kind: 'positional', name: 'ticket_id', type: 'string', required: true, constraint: 'The page ticket id from your bearings (also the page_id from human send).' },
31
+ ],
32
+ output: [
33
+ { name: 'ticket_id', type: 'string', required: true, constraint: 'The page ticket id.' },
34
+ { name: 'open_count', type: 'integer', required: true, constraint: 'How many comments remain open. Zero once feedback exists means all of it has been dealt with.' },
35
+ { name: 'comments', type: 'object[]', required: true, constraint: 'Each: {id, quote, context?, note, status, created_at, resolved_at?}; status is open or resolved. Oldest first.' },
36
+ ],
37
+ outputKind: 'object',
38
+ effects: ['None. Read-only.'],
39
+ },
40
+ run: async (input) => {
41
+ const ticketId = requirePageTicketId(input['ticket_id']);
42
+ try {
43
+ const page = await cliClient().getHumanInboxPage(opaqueInboxTicketId(ticketId));
44
+ return { ticket_id: ticketId, open_count: page.feedback.open_count, comments: page.feedback.comments };
45
+ }
46
+ catch (e) {
47
+ rethrowAsCliError(e);
48
+ }
49
+ },
50
+ });
51
+ const humanFeedbackResolve = defineLeaf({
52
+ name: 'resolve',
53
+ description: 'mark one dealt-with feedback comment resolved',
54
+ whenToUse: 'you are the feedback companion and have dealt with an open comment — by revising the page or answering it in conversation.',
55
+ help: {
56
+ name: 'human feedback resolve',
57
+ summary: 'mark one open feedback comment resolved — terminal, and only after the feedback has actually been dealt with',
58
+ guide: 'Resolution is your report that the work is done, not a triage state: revise the page or answer the comment in conversation first, then resolve. It appends no chat turn — briefly report the result in the conversation yourself. A resolved comment never reopens; a renewed concern arrives as a new comment.',
59
+ params: [
60
+ { kind: 'positional', name: 'comment_id', type: 'string', required: true, constraint: 'A comment id from `crtr human feedback list`. The ticket is your own: it comes from the companion binding of the calling node.' },
61
+ ],
62
+ output: [
63
+ { name: 'resolved', type: 'boolean', required: true, constraint: 'True when this call resolved the comment; false when it was already resolved.' },
64
+ { name: 'ticket_id', type: 'string', required: true, constraint: 'The page ticket id.' },
65
+ { name: 'comment_id', type: 'string', required: true, constraint: 'The comment id.' },
66
+ { name: 'open_count', type: 'integer', required: false, constraint: 'Comments still open after this resolution. Present when resolved is true.' },
67
+ { name: 'reason', type: 'string', required: false, constraint: 'comment_already_resolved when resolved is false.' },
68
+ ],
69
+ outputKind: 'object',
70
+ effects: ["Marks the comment resolved in your own ticket's feedback record — the ticket comes from the calling companion's binding. Only the ticket's bound companion may resolve — any other node refuses with not_companion. A terminal ticket refuses with ticket_terminal — settlement already closed this collaboration."],
71
+ },
72
+ run: async (input) => {
73
+ const commentId = input['comment_id'];
74
+ const callerNodeId = process.env['CRTR_NODE_ID'];
75
+ if (callerNodeId === undefined || callerNodeId === '') {
76
+ throw new InputError({ error: 'no_node', message: 'resolve runs inside the ticket\u2019s feedback companion (CRTR_NODE_ID unset)', next: 'Run this from the companion conversation bound to the ticket.' });
77
+ }
78
+ const binding = (await cliClient().getNode(callerNodeId)).review_binding;
79
+ if (binding === undefined || binding === null || binding.kind !== 'page_feedback') {
80
+ throw new InputError({ error: 'not_companion', message: 'this node is not a page-feedback companion — only the ticket\u2019s bound companion resolves its comments', next: 'Resolve from the companion conversation bound to the ticket.' });
81
+ }
82
+ const ticketId = requirePageTicketId(binding.review_id);
83
+ try {
84
+ const result = await cliClient().resolvePageFeedbackComment(opaqueInboxTicketId(ticketId), commentId, callerNodeId);
85
+ return { resolved: true, ticket_id: ticketId, comment_id: commentId, open_count: result.feedback.open_count };
86
+ }
87
+ catch (e) {
88
+ if (e instanceof ApiError && e.status === 409 && e.code === 'comment_already_resolved') {
89
+ return { resolved: false, ticket_id: ticketId, comment_id: commentId, reason: 'comment_already_resolved' };
90
+ }
91
+ rethrowAsCliError(e);
92
+ }
93
+ },
94
+ render: (r) => r['resolved'] === true
95
+ ? `Resolved feedback comment ${r['comment_id']} — ${r['open_count']} still open on ${r['ticket_id']}.`
96
+ : `Nothing to resolve for ${r['comment_id']} — ${r['reason']}.`,
97
+ });
98
+ export const humanFeedbackBranch = defineBranch({
99
+ name: 'feedback',
100
+ description: "operate on a page ticket's feedback comments",
101
+ whenToUse: "you are a feedback companion working a page ticket's feedback comments.",
102
+ help: {
103
+ name: 'human feedback',
104
+ summary: "a page ticket's feedback comments — the person creates them on the page; the bound companion lists and resolves them",
105
+ model: 'Each comment is immutable once sent and open until resolved. resolve is terminal and companion-only, taken after the feedback has been dealt with by revising the page or answering in conversation.',
106
+ },
107
+ children: [humanFeedbackList, humanFeedbackResolve],
108
+ });
@@ -1,12 +1,21 @@
1
- import type { PageSource } from '../../core/human/page-schema.js';
1
+ import { type PageSource } from '../../core/human/page-schema.js';
2
2
  /** Provenance for crouter tickets. Ticket *identity* comes from the bridge node
3
3
  * directory, never ticket data; `nodeId` carries the originating node so a
4
4
  * consumer can relate a ticket back to whatever that node belongs to, and
5
- * `sessionName` is a presentation label only. Review tickets already stamp
6
- * `nodeId` the same way (`core/review/realize.ts`), so pages match them.
7
- * `nodeId` is stamped even when the daemon is unreachable — losing the label is
8
- * survivable, losing machine attribution is not. */
9
- export declare function sourceStamp(): Promise<PageSource>;
10
- export declare const humanAsk: import("../../core/command.js").LeafDef;
11
- export declare const humanNotify: import("../../core/command.js").LeafDef;
5
+ * `sessionName` is a presentation label only, while `profileName` lets product
6
+ * consumers resolve the applet or worker identity behind the ticket. Review
7
+ * tickets stamp the same provenance (`core/review/realize.ts`), so pages match
8
+ * them. `nodeId` is stamped even when the daemon is unreachable — losing the
9
+ * labels is survivable, losing machine attribution is not.
10
+ *
11
+ * The same read answers who is sending: `lifecycle` decides whether the sender
12
+ * has a transcript a human is plausibly reading, which is what makes skipping
13
+ * the inbox safe. It is null for a bare shell (no node at all) and when the
14
+ * daemon cannot answer — neither is a terminal sender, so neither restricts
15
+ * delivery. */
16
+ export declare function sender(): Promise<{
17
+ source: PageSource;
18
+ lifecycle: 'terminal' | 'resident' | null;
19
+ }>;
20
+ export declare const humanSend: import("../../core/command.js").LeafDef;
12
21
  export declare const humanShow: import("../../core/command.js").LeafDef;