@north-light/crouter 0.3.353 → 0.3.354

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 (609) hide show
  1. package/dist/api/client.d.ts +35 -25
  2. package/dist/api/client.js +2 -2
  3. package/dist/api/dto/broker-ops.d.ts +2 -36
  4. package/dist/api/dto/canvas.d.ts +8 -13
  5. package/dist/api/dto/config.d.ts +4 -0
  6. package/dist/api/dto/delivery.d.ts +61 -0
  7. package/dist/api/dto/docs.d.ts +133 -0
  8. package/dist/api/dto/docs.js +1 -0
  9. package/dist/api/dto/health.d.ts +26 -79
  10. package/dist/api/dto/node-outcomes.d.ts +1 -3
  11. package/dist/api/dto/nodes.d.ts +5 -26
  12. package/dist/api/dto/objects.d.ts +167 -0
  13. package/dist/api/dto/objects.js +1 -0
  14. package/dist/api/dto/profiles.d.ts +14 -8
  15. package/dist/api/dto/reports.d.ts +9 -7
  16. package/dist/api/dto/reviews.d.ts +9 -3
  17. package/dist/api/dto/worktree.d.ts +1 -1
  18. package/dist/api/index.d.ts +0 -1
  19. package/dist/api/index.js +1 -1
  20. package/dist/api/routes.d.ts +14 -12
  21. package/dist/api/routes.js +1 -1
  22. package/dist/build-root.js +1 -1
  23. package/dist/builtin-memory/00-runtime-base/00-authoring.md +10 -5
  24. package/dist/builtin-memory/04-orchestration-kernel.md +7 -7
  25. package/dist/builtin-memory/05-kinds/advisor/01-orchestrator.md +1 -1
  26. package/dist/builtin-memory/05-kinds/explore/00-base.md +2 -2
  27. package/dist/builtin-memory/05-kinds/explore/01-orchestrator.md +2 -2
  28. package/dist/builtin-memory/crouter-concepts/INDEX.md +2 -2
  29. package/dist/builtin-memory/crouter-concepts/lifecycle-and-wakes.md +1 -1
  30. package/dist/builtin-memory/crouter-concepts/memory.md +15 -15
  31. package/dist/builtin-memory/crouter-concepts/nodes-and-the-canvas.md +1 -1
  32. package/dist/builtin-memory/crouter-concepts/profiles-kinds-and-modes.md +5 -5
  33. package/dist/builtin-memory/crouter-concepts/scopes-and-trust.md +1 -1
  34. package/dist/builtin-memory/crouter-concepts/why-a-daemon.md +1 -1
  35. package/dist/builtin-memory/crouter-sdk/INDEX.md +2 -2
  36. package/dist/builtin-memory/crouter-sdk/README.md +5 -6
  37. package/dist/builtin-memory/crouter-sdk/errors.md +0 -13
  38. package/dist/builtin-memory/crouter-sdk/guides/README.md +0 -1
  39. package/dist/builtin-memory/crouter-sdk/guides/event-driven-assistant.md +2 -2
  40. package/dist/builtin-memory/crouter-sdk/nodes.md +0 -2
  41. package/dist/builtin-memory/crouter-sdk/resources.md +0 -1
  42. package/dist/builtin-memory/explore/exploration-doc.md +4 -4
  43. package/dist/builtin-memory/insights/capture.md +6 -6
  44. package/dist/builtin-memory/insights/init.md +14 -14
  45. package/dist/builtin-memory/internal/INDEX.md +4 -4
  46. package/dist/builtin-memory/internal/agent-shaping.md +20 -20
  47. package/dist/builtin-memory/internal/examples/imessage-assistant.md +2 -2
  48. package/dist/builtin-memory/internal/marketplaces.md +2 -2
  49. package/dist/builtin-memory/internal/memory-loading.md +31 -30
  50. package/dist/builtin-memory/internal/nodes-and-canvas.md +1 -1
  51. package/dist/builtin-memory/internal/plugins.md +16 -14
  52. package/dist/builtin-memory/internal/storage-tiers.md +4 -4
  53. package/dist/builtin-memory/memory-read-orientation.md +1 -1
  54. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/memory-slash-commands.ts +32 -40
  55. package/dist/clients/attach/input/controller.js +1 -1
  56. package/dist/clients/attach/input/ref-autocomplete.js +1 -1
  57. package/dist/clients/attach/input/titled-editor.js +1 -1
  58. package/dist/clients/attach/render/chat-view.js +1 -1
  59. package/dist/clients/attach/render/crtr-output.d.ts +1 -2
  60. package/dist/clients/attach/render/crtr-output.js +17 -17
  61. package/dist/clients/attach/render/group-activity.d.ts +8 -8
  62. package/dist/clients/attach/render/group-activity.js +2 -2
  63. package/dist/clients/attach/render/group-recap.js +1 -1
  64. package/dist/clients/attach/render/tool-calls.d.ts +1 -1
  65. package/dist/clients/attach/session/profile-files.js +1 -1
  66. package/dist/clients/attach/slash/dispatch.js +1 -1
  67. package/dist/clients/attach/viewer.js +806 -1553
  68. package/dist/commands/api-client.d.ts +2 -0
  69. package/dist/commands/api-client.js +3 -3
  70. package/dist/commands/canvas/edges.d.ts +2 -0
  71. package/dist/commands/canvas/edges.js +2 -0
  72. package/dist/commands/canvas/list.d.ts +4 -0
  73. package/dist/commands/canvas/list.js +3 -0
  74. package/dist/commands/canvas/read.d.ts +8 -0
  75. package/dist/commands/canvas/read.js +5 -0
  76. package/dist/commands/canvas/search.d.ts +2 -0
  77. package/dist/commands/canvas/search.js +3 -0
  78. package/dist/commands/canvas/unwatch.d.ts +2 -0
  79. package/dist/commands/canvas/unwatch.js +1 -0
  80. package/dist/commands/canvas/watch.d.ts +3 -0
  81. package/dist/commands/canvas/watch.js +1 -0
  82. package/dist/commands/canvas-analytics.js +1 -1
  83. package/dist/commands/canvas-history/grep.js +4 -4
  84. package/dist/commands/canvas-history/read.js +2 -2
  85. package/dist/commands/canvas-history/search.js +7 -7
  86. package/dist/commands/canvas-history/shared.d.ts +0 -1
  87. package/dist/commands/canvas-history/shared.js +1 -1
  88. package/dist/commands/canvas-history/stats.js +2 -2
  89. package/dist/commands/canvas-history.js +1 -1
  90. package/dist/commands/canvas.js +1 -1
  91. package/dist/commands/doc/delete.d.ts +2 -0
  92. package/dist/commands/doc/delete.js +1 -0
  93. package/dist/commands/doc/edit.d.ts +2 -0
  94. package/dist/commands/doc/edit.js +1 -0
  95. package/dist/commands/doc/history.d.ts +2 -0
  96. package/dist/commands/doc/history.js +2 -0
  97. package/dist/commands/doc/lint.d.ts +2 -0
  98. package/dist/commands/doc/lint.js +2 -0
  99. package/dist/commands/doc/list.d.ts +2 -0
  100. package/dist/commands/doc/list.js +1 -0
  101. package/dist/commands/doc/move.d.ts +2 -0
  102. package/dist/commands/doc/move.js +1 -0
  103. package/dist/commands/doc/read.d.ts +2 -0
  104. package/dist/commands/doc/read.js +1 -0
  105. package/dist/commands/doc/shared.d.ts +25 -0
  106. package/dist/commands/doc/shared.js +2 -0
  107. package/dist/commands/doc/write.d.ts +2 -0
  108. package/dist/commands/doc/write.js +1 -0
  109. package/dist/commands/{memory.d.ts → doc.d.ts} +1 -1
  110. package/dist/commands/doc.js +1 -0
  111. package/dist/commands/human/review.js +1 -1
  112. package/dist/commands/node/bash.js +2 -2
  113. package/dist/commands/node/create.js +1 -1
  114. package/dist/commands/node/inspect.js +10 -10
  115. package/dist/commands/node/lifecycle.js +2 -2
  116. package/dist/commands/node/outcome.js +1 -1
  117. package/dist/commands/node/subscription.js +1 -1
  118. package/dist/commands/node-context.js +2 -2
  119. package/dist/commands/pkg/browse/catalog.js +1 -1
  120. package/dist/commands/pkg/browse/doc-view.js +1 -1
  121. package/dist/commands/pkg/browse/model.d.ts +9 -17
  122. package/dist/commands/pkg/plugin-inspect.js +1 -1
  123. package/dist/commands/pkg/plugin-manage.d.ts +4 -8
  124. package/dist/commands/pkg/plugin-manage.js +15 -17
  125. package/dist/commands/profile/list.js +1 -1
  126. package/dist/commands/profile/new.js +1 -1
  127. package/dist/commands/profile/project.js +1 -1
  128. package/dist/commands/profile/show.js +1 -1
  129. package/dist/commands/push.js +3 -3
  130. package/dist/commands/sys/config.js +1 -1
  131. package/dist/commands/sys/context/admin/actions.d.ts +18 -43
  132. package/dist/commands/sys/context/admin/actions.js +1 -2
  133. package/dist/commands/sys/context/admin/detail-panel.d.ts +17 -25
  134. package/dist/commands/sys/context/admin/detail-panel.js +2 -1
  135. package/dist/commands/sys/context/admin/docs-panel.d.ts +7 -6
  136. package/dist/commands/sys/context/admin/docs-panel.js +1 -1
  137. package/dist/commands/sys/context/admin/list-view.d.ts +12 -12
  138. package/dist/commands/sys/context/admin/list-view.js +1 -1
  139. package/dist/commands/sys/context/admin/model.d.ts +96 -69
  140. package/dist/commands/sys/context/admin/model.js +1 -1
  141. package/dist/commands/sys/context/admin/rail-panel.d.ts +7 -5
  142. package/dist/commands/sys/context/admin/rail-panel.js +1 -1
  143. package/dist/commands/sys/context/admin/read-view.d.ts +10 -14
  144. package/dist/commands/sys/context/admin/read-view.js +1 -2
  145. package/dist/commands/sys/context/admin/shell.d.ts +26 -31
  146. package/dist/commands/sys/context/admin/shell.js +1 -1
  147. package/dist/commands/sys/context/admin.js +2 -2
  148. package/dist/commands/sys/context/doc.js +2 -3
  149. package/dist/commands/sys/context/expose.js +2 -2
  150. package/dist/commands/sys/context/prompt-review.js +4 -4
  151. package/dist/commands/sys/context/resolve.d.ts +92 -65
  152. package/dist/commands/sys/context/resolve.js +7 -9
  153. package/dist/commands/sys/context.js +1 -1
  154. package/dist/commands/sys/doctor.js +1 -1
  155. package/dist/commands/sys/migrate.js +1 -1
  156. package/dist/commands/sys/panels/profiles-panel.d.ts +3 -1
  157. package/dist/commands/sys/panels/profiles-panel.js +1 -1
  158. package/dist/commands/sys/sync-deps.d.ts +6 -11
  159. package/dist/commands/sys/sync-deps.js +7 -8
  160. package/dist/commands/sys/sync-project-guidance.js +5 -4
  161. package/dist/commands/sys/sync-shared.d.ts +41 -4
  162. package/dist/commands/sys/sync-shared.js +1 -1
  163. package/dist/commands/sys/sync-skills.js +2 -2
  164. package/dist/commands/sys/sync.js +1 -1
  165. package/dist/core/bash-job-supervisor.d.ts +2 -3
  166. package/dist/core/bash-job-supervisor.js +3 -3
  167. package/dist/core/bash-jobs.d.ts +0 -5
  168. package/dist/core/bash-jobs.js +7 -7
  169. package/dist/core/bootstrap.js +2 -2
  170. package/dist/core/canvas/canvas.d.ts +6 -50
  171. package/dist/core/canvas/canvas.js +16 -21
  172. package/dist/core/canvas/db.d.ts +4 -1
  173. package/dist/core/canvas/db.js +2 -2
  174. package/dist/core/canvas/history.d.ts +11 -39
  175. package/dist/core/canvas/history.js +9 -20
  176. package/dist/core/canvas/install-id.d.ts +2 -2
  177. package/dist/core/canvas/install-id.js +1 -1
  178. package/dist/core/canvas/memory-reads.d.ts +5 -0
  179. package/dist/core/canvas/memory-reads.js +1 -1
  180. package/dist/core/canvas/migrations.js +215 -41
  181. package/dist/core/canvas/node-agent-paths.js +1 -1
  182. package/dist/core/canvas/node-tokens.js +1 -1
  183. package/dist/core/canvas/paths.d.ts +0 -4
  184. package/dist/core/canvas/paths.js +1 -1
  185. package/dist/core/canvas/remote-canvas-source.d.ts +0 -1
  186. package/dist/core/canvas/remote-canvas-source.js +1 -1
  187. package/dist/core/canvas/render-source.d.ts +9 -6
  188. package/dist/core/canvas/render-source.js +6 -6
  189. package/dist/core/canvas/sessions.js +2 -2
  190. package/dist/core/canvas/source.d.ts +6 -0
  191. package/dist/core/canvas/tree.d.ts +29 -0
  192. package/dist/core/canvas/tree.js +12 -0
  193. package/dist/core/canvas/types.d.ts +0 -20
  194. package/dist/core/command-plugins/bundle.js +1 -1
  195. package/dist/core/config.d.ts +1 -1
  196. package/dist/core/conversation-store/listener.js +4 -2
  197. package/dist/core/feed/feed.d.ts +9 -7
  198. package/dist/core/feed/feed.js +3 -7
  199. package/dist/core/feed/inbox.d.ts +3 -5
  200. package/dist/core/feed/inbox.js +1 -10
  201. package/dist/core/feed/messages.d.ts +33 -6
  202. package/dist/core/feed/messages.js +10 -7
  203. package/dist/core/feed/reports.d.ts +10 -0
  204. package/dist/core/feed/reports.js +2 -0
  205. package/dist/core/grants/remove.js +1 -1
  206. package/dist/core/graph/access.d.ts +24 -0
  207. package/dist/core/graph/access.js +8 -0
  208. package/dist/core/graph/bodies.d.ts +6 -0
  209. package/dist/core/graph/bodies.js +1 -0
  210. package/dist/core/graph/deletion.d.ts +9 -0
  211. package/dist/core/graph/deletion.js +5 -0
  212. package/dist/core/graph/diff.d.ts +4 -0
  213. package/dist/core/graph/diff.js +4 -0
  214. package/dist/core/graph/documents.d.ts +160 -0
  215. package/dist/core/graph/documents.js +7 -0
  216. package/dist/core/graph/edges.d.ts +24 -0
  217. package/dist/core/graph/edges.js +1 -0
  218. package/dist/core/graph/events.d.ts +26 -0
  219. package/dist/core/graph/events.js +6 -0
  220. package/dist/core/graph/exposures.d.ts +53 -0
  221. package/dist/core/graph/exposures.js +4 -0
  222. package/dist/core/graph/jobs.d.ts +31 -0
  223. package/dist/core/graph/jobs.js +2 -0
  224. package/dist/core/graph/names.d.ts +28 -0
  225. package/dist/core/graph/names.js +3 -0
  226. package/dist/core/graph/objects.d.ts +55 -0
  227. package/dist/core/graph/objects.js +9 -0
  228. package/dist/core/graph/package-docs.d.ts +31 -0
  229. package/dist/core/graph/package-docs.js +5 -0
  230. package/dist/core/graph/package-files.d.ts +20 -0
  231. package/dist/core/graph/package-files.js +2 -0
  232. package/dist/core/graph/reader.d.ts +21 -0
  233. package/dist/core/graph/reader.js +3 -0
  234. package/dist/core/graph/repo-sync/exchange.d.ts +34 -0
  235. package/dist/core/graph/repo-sync/exchange.js +2 -0
  236. package/dist/core/graph/repo-sync/identity.d.ts +30 -0
  237. package/dist/core/graph/repo-sync/identity.js +1 -0
  238. package/dist/core/graph/repo-sync/index.d.ts +4 -0
  239. package/dist/core/graph/repo-sync/index.js +1 -0
  240. package/dist/core/graph/repo-sync/mirror.d.ts +30 -0
  241. package/dist/core/graph/repo-sync/mirror.js +6 -0
  242. package/dist/core/graph/repo-sync/ref-format.d.ts +76 -0
  243. package/dist/core/graph/repo-sync/ref-format.js +2 -0
  244. package/dist/core/graph/repo-sync/repos.d.ts +17 -0
  245. package/dist/core/graph/repo-sync/repos.js +3 -0
  246. package/dist/core/graph/repo-sync/sync.d.ts +42 -0
  247. package/dist/core/graph/repo-sync/sync.js +2 -0
  248. package/dist/core/graph/rules.d.ts +26 -0
  249. package/dist/core/graph/rules.js +3 -0
  250. package/dist/core/graph/spaces/app.d.ts +3 -0
  251. package/dist/core/graph/spaces/app.js +1 -0
  252. package/dist/core/graph/spaces/index.d.ts +19 -0
  253. package/dist/core/graph/spaces/index.js +1 -0
  254. package/dist/core/graph/spaces/person.d.ts +5 -0
  255. package/dist/core/graph/spaces/person.js +2 -0
  256. package/dist/core/graph/spaces/repo.d.ts +4 -0
  257. package/dist/core/graph/spaces/repo.js +1 -0
  258. package/dist/core/graph/types.d.ts +75 -0
  259. package/dist/core/graph/types.js +1 -0
  260. package/dist/core/graph/watches.d.ts +62 -0
  261. package/dist/core/graph/watches.js +18 -0
  262. package/dist/core/human/feedback-companion.js +1 -1
  263. package/dist/core/human/requests.d.ts +3 -1
  264. package/dist/core/human/requests.js +6 -6
  265. package/dist/core/inspector/model.js +2 -2
  266. package/dist/core/io.js +5 -5
  267. package/dist/core/layout-migrate/index.d.ts +24 -1
  268. package/dist/core/layout-migrate/index.js +4 -4
  269. package/dist/core/layout-migrate/paths.d.ts +4 -0
  270. package/dist/core/layout-migrate/paths.js +1 -1
  271. package/dist/core/layout-migrate/stored-paths.d.ts +7 -0
  272. package/dist/core/layout-migrate/stored-paths.js +11 -11
  273. package/dist/core/layout-migrate/stores.d.ts +19 -6
  274. package/dist/core/layout-migrate/stores.js +3 -4
  275. package/dist/core/manifest.d.ts +0 -2
  276. package/dist/core/manifest.js +1 -1
  277. package/dist/core/{memory/extensions.d.ts → plugin-extensions.d.ts} +9 -10
  278. package/dist/core/plugin-extensions.js +1 -0
  279. package/dist/core/preview-registry.d.ts +1 -1
  280. package/dist/core/preview-registry.js +3 -2
  281. package/dist/core/profiles/manifest.d.ts +7 -7
  282. package/dist/core/profiles/manifest.js +1 -1
  283. package/dist/core/profiles/select.js +3 -3
  284. package/dist/core/review/birth.js +1 -1
  285. package/dist/core/review/companion.js +1 -1
  286. package/dist/core/review/stage.d.ts +12 -1
  287. package/dist/core/review/stage.js +1 -1
  288. package/dist/core/review/store.d.ts +2 -0
  289. package/dist/core/review/store.js +1 -1
  290. package/dist/core/review/types.d.ts +7 -1
  291. package/dist/core/runs/events.js +1 -1
  292. package/dist/core/runs/operations.js +5 -5
  293. package/dist/core/runs/questions.js +2 -2
  294. package/dist/core/runtime/bearings-render.d.ts +13 -7
  295. package/dist/core/runtime/bearings-render.js +12 -12
  296. package/dist/core/runtime/bearings.d.ts +8 -18
  297. package/dist/core/runtime/bearings.js +7 -7
  298. package/dist/core/runtime/broker/daemon-ops.d.ts +7 -12
  299. package/dist/core/runtime/broker/daemon-ops.js +1 -1
  300. package/dist/core/runtime/broker/fault-retry.d.ts +2 -0
  301. package/dist/core/runtime/broker/fault-retry.js +1 -1
  302. package/dist/core/runtime/broker/frame-dispatch.d.ts +1 -1
  303. package/dist/core/runtime/broker/frame-memory-refs.d.ts +7 -2
  304. package/dist/core/runtime/broker/frame-memory-refs.js +1 -1
  305. package/dist/core/runtime/broker/inbox.d.ts +1 -4
  306. package/dist/core/runtime/broker/inbox.js +1 -10
  307. package/dist/core/runtime/broker/rebind.js +1 -1
  308. package/dist/core/runtime/broker/retry-card-elision.d.ts +7 -0
  309. package/dist/core/runtime/broker/retry-card-elision.js +1 -0
  310. package/dist/core/runtime/broker-extension-render.d.ts +0 -13
  311. package/dist/core/runtime/broker-extension-render.js +2 -4
  312. package/dist/core/runtime/broker-persona-guidance.js +3 -3
  313. package/dist/core/runtime/broker-protocol.d.ts +1 -1
  314. package/dist/core/runtime/broker.js +1 -1
  315. package/dist/core/runtime/close.d.ts +9 -4
  316. package/dist/core/runtime/close.js +1 -1
  317. package/dist/core/runtime/deliver-live.js +1 -1
  318. package/dist/core/runtime/kickoff.js +17 -19
  319. package/dist/core/runtime/launch-target.d.ts +7 -0
  320. package/dist/core/runtime/launch-target.js +1 -1
  321. package/dist/core/runtime/ledger.d.ts +10 -0
  322. package/dist/core/runtime/ledger.js +3 -0
  323. package/dist/core/runtime/lifecycle.js +2 -2
  324. package/dist/core/runtime/nodes.d.ts +10 -2
  325. package/dist/core/runtime/nodes.js +1 -1
  326. package/dist/core/runtime/outcome-document.d.ts +2 -2
  327. package/dist/core/runtime/outcome-document.js +1 -1
  328. package/dist/core/runtime/persona.js +2 -2
  329. package/dist/core/runtime/placement.js +1 -1
  330. package/dist/core/runtime/promote.d.ts +2 -2
  331. package/dist/core/runtime/promote.js +1 -1
  332. package/dist/core/runtime/prospective-inventory-cli.js +2 -2
  333. package/dist/core/runtime/recycle.js +1 -1
  334. package/dist/core/runtime/reopen.js +1 -1
  335. package/dist/core/runtime/revive.js +2 -2
  336. package/dist/core/runtime/roadmap.d.ts +17 -9
  337. package/dist/core/runtime/roadmap.js +4 -4
  338. package/dist/core/runtime/spawn-env.js +1 -1
  339. package/dist/core/runtime/spawn.d.ts +5 -3
  340. package/dist/core/runtime/spawn.js +2 -2
  341. package/dist/core/runtime/structured-output.d.ts +3 -1
  342. package/dist/core/runtime/structured-output.js +4 -4
  343. package/dist/core/scope.d.ts +1 -32
  344. package/dist/core/scope.js +1 -1
  345. package/dist/core/scoped-state/db.js +2 -1
  346. package/dist/core/scoped-state/migrate.js +2 -2
  347. package/dist/core/scoped-state/profiles.d.ts +11 -0
  348. package/dist/core/scoped-state/profiles.js +1 -1
  349. package/dist/core/scoped-state/schema.d.ts +1 -1
  350. package/dist/core/scoped-state/schema.js +7 -5
  351. package/dist/core/spaces/permissions.d.ts +0 -14
  352. package/dist/core/spaces/permissions.js +1 -1
  353. package/dist/core/spaces/stop.d.ts +13 -0
  354. package/dist/core/spaces/stop.js +2 -2
  355. package/dist/core/storage/tables.d.ts +1 -1
  356. package/dist/core/substrate/delivery/corpus.d.ts +21 -0
  357. package/dist/core/substrate/delivery/corpus.js +3 -0
  358. package/dist/core/substrate/delivery/deliver.d.ts +76 -0
  359. package/dist/core/substrate/delivery/deliver.js +6 -0
  360. package/dist/core/substrate/delivery/listings.d.ts +27 -0
  361. package/dist/core/substrate/delivery/listings.js +4 -0
  362. package/dist/core/substrate/delivery/match.d.ts +28 -0
  363. package/dist/core/substrate/delivery/match.js +1 -0
  364. package/dist/core/substrate/delivery/plan.d.ts +67 -0
  365. package/dist/core/substrate/delivery/plan.js +3 -0
  366. package/dist/core/substrate/delivery/render-boot.d.ts +20 -0
  367. package/dist/core/substrate/delivery/render-boot.js +54 -0
  368. package/dist/core/substrate/delivery/render-event.d.ts +47 -0
  369. package/dist/core/substrate/delivery/render-event.js +6 -0
  370. package/dist/core/substrate/delivery/sub-persona-menu.d.ts +2 -0
  371. package/dist/core/substrate/delivery/sub-persona-menu.js +6 -0
  372. package/dist/core/substrate/delivery/types.d.ts +30 -0
  373. package/dist/core/substrate/delivery/types.js +0 -0
  374. package/dist/core/substrate/gate-explain.d.ts +0 -13
  375. package/dist/core/substrate/gate-explain.js +1 -1
  376. package/dist/core/substrate/schema.d.ts +11 -139
  377. package/dist/core/substrate/schema.js +1 -1
  378. package/dist/core/substrate/subject-fields.d.ts +3 -0
  379. package/dist/core/substrate/subject.d.ts +2 -1
  380. package/dist/core/substrate/subject.js +1 -1
  381. package/dist/daemon/api/handlers/app-profiles.js +1 -1
  382. package/dist/daemon/api/handlers/bash-jobs.js +1 -2
  383. package/dist/daemon/api/handlers/broker-ops.js +1 -1
  384. package/dist/daemon/api/handlers/canvas.js +5 -5
  385. package/dist/daemon/api/handlers/daemon.js +1 -1
  386. package/dist/daemon/api/handlers/delivery.d.ts +2 -0
  387. package/dist/daemon/api/handlers/delivery.js +1 -0
  388. package/dist/daemon/api/handlers/{memory.d.ts → docs.d.ts} +1 -1
  389. package/dist/daemon/api/handlers/docs.js +1 -0
  390. package/dist/daemon/api/handlers/hook-exec.js +1 -1
  391. package/dist/daemon/api/handlers/messages.js +2 -2
  392. package/dist/daemon/api/handlers/node-records.js +2 -2
  393. package/dist/daemon/api/handlers/nodes.js +1 -1
  394. package/dist/daemon/api/handlers/objects.d.ts +2 -0
  395. package/dist/daemon/api/handlers/objects.js +5 -0
  396. package/dist/daemon/api/handlers/package-docs.d.ts +2 -0
  397. package/dist/daemon/api/handlers/package-docs.js +1 -0
  398. package/dist/daemon/api/handlers/profiles.js +1 -1
  399. package/dist/daemon/api/handlers/reports.d.ts +2 -2
  400. package/dist/daemon/api/handlers/reports.js +4 -4
  401. package/dist/daemon/api/handlers/reviews.js +1 -1
  402. package/dist/daemon/api/map.d.ts +2 -2
  403. package/dist/daemon/api/map.js +2 -2
  404. package/dist/daemon/api/operations.d.ts +1 -1
  405. package/dist/daemon/api/operations.js +1 -1
  406. package/dist/daemon/api/reader.d.ts +17 -0
  407. package/dist/daemon/api/reader.js +1 -0
  408. package/dist/daemon/api/server.js +1 -1
  409. package/dist/daemon/control.d.ts +2 -3
  410. package/dist/daemon/crtrd.js +8 -6
  411. package/dist/daemon/fleet.js +4 -4
  412. package/dist/daemon/reconcilers/bash-deadline.d.ts +11 -1
  413. package/dist/daemon/reconcilers/bash-deadline.js +2 -1
  414. package/dist/daemon/reconcilers/broker-supervision.js +4 -4
  415. package/dist/daemon/reconcilers/live-obligation.js +1 -1
  416. package/dist/daemon/reconcilers/node-deadline.js +1 -1
  417. package/dist/daemon/reconcilers/node-lifecycle/freeze-lane.js +1 -1
  418. package/dist/daemon/reconcilers/storage-maintenance.d.ts +1 -0
  419. package/dist/daemon/reconcilers/storage-maintenance.js +1 -1
  420. package/dist/daemon/review/deliver.js +2 -2
  421. package/dist/daemon/review/finish.js +1 -1
  422. package/dist/hook-authoring.d.ts +0 -1
  423. package/dist/hook-authoring.js +3 -3
  424. package/dist/migrations/004-canvas-documents/apply.d.ts +10 -0
  425. package/dist/migrations/004-canvas-documents/apply.js +1 -0
  426. package/dist/migrations/004-canvas-documents/fields.d.ts +24 -0
  427. package/dist/migrations/004-canvas-documents/fields.js +2 -0
  428. package/dist/migrations/004-canvas-documents/index.d.ts +16 -0
  429. package/dist/migrations/004-canvas-documents/index.js +2 -0
  430. package/dist/migrations/004-canvas-documents/legacy/discover.d.ts +16 -0
  431. package/dist/migrations/004-canvas-documents/legacy/discover.js +1 -0
  432. package/dist/migrations/004-canvas-documents/legacy/history.d.ts +5 -0
  433. package/dist/migrations/004-canvas-documents/legacy/history.js +2 -0
  434. package/dist/migrations/004-canvas-documents/legacy/nested.d.ts +7 -0
  435. package/dist/migrations/004-canvas-documents/legacy/nested.js +1 -0
  436. package/dist/migrations/004-canvas-documents/legacy/parse.d.ts +14 -0
  437. package/dist/migrations/004-canvas-documents/legacy/parse.js +1 -0
  438. package/dist/migrations/004-canvas-documents/legacy/types.d.ts +91 -0
  439. package/dist/migrations/004-canvas-documents/legacy/types.js +0 -0
  440. package/dist/migrations/004-canvas-documents/legacy-edges.d.ts +6 -0
  441. package/dist/migrations/004-canvas-documents/legacy-edges.js +18 -0
  442. package/dist/migrations/004-canvas-documents/plan.d.ts +102 -0
  443. package/dist/migrations/004-canvas-documents/plan.js +3 -0
  444. package/dist/migrations/004-canvas-documents/pointers.d.ts +23 -0
  445. package/dist/migrations/004-canvas-documents/pointers.js +4 -0
  446. package/dist/migrations/activation.d.ts +9 -18
  447. package/dist/migrations/activation.js +2 -2
  448. package/dist/pi-extensions/broker-local.d.ts +2 -2
  449. package/dist/pi-extensions/broker-local.js +2 -2
  450. package/dist/pi-extensions/canvas-bash-valve.js +5 -4
  451. package/dist/pi-extensions/canvas-context-intro.js +2 -2
  452. package/dist/pi-extensions/canvas-doc-substrate.d.ts +0 -1
  453. package/dist/pi-extensions/canvas-doc-substrate.js +6 -6
  454. package/dist/pi-extensions/canvas-inbox-watcher.js +2 -2
  455. package/dist/pi-extensions/canvas-passive-context.js +1 -1
  456. package/dist/pi-extensions/canvas-recap.js +2 -2
  457. package/dist/pi-extensions/canvas-stophook.d.ts +1 -1
  458. package/dist/pi-extensions/canvas-stophook.js +1 -1
  459. package/dist/prompts/review.js +3 -3
  460. package/dist/shared/env.d.ts +5 -0
  461. package/dist/shared/env.js +1 -1
  462. package/dist/shared/generated-context.js +2 -10
  463. package/dist/shared/inbox-entry-body.d.ts +22 -0
  464. package/dist/shared/inbox-entry-body.js +10 -0
  465. package/dist/{core/memory → shared}/inline-ref-guidance.d.ts +2 -2
  466. package/dist/shared/inline-ref-guidance.js +2 -0
  467. package/dist/types.d.ts +3 -1
  468. package/docs/cli/memory-and-preferences.md +12 -14
  469. package/docs/concepts/README.md +1 -1
  470. package/docs/concepts/lifecycle-and-wakes.md +1 -1
  471. package/docs/concepts/memory.md +15 -15
  472. package/docs/concepts/nodes-and-the-canvas.md +1 -1
  473. package/docs/concepts/profiles-kinds-and-modes.md +5 -5
  474. package/docs/concepts/scopes-and-trust.md +1 -1
  475. package/docs/concepts/why-a-daemon.md +1 -1
  476. package/docs/sdk/README.md +5 -6
  477. package/docs/sdk/errors.md +0 -13
  478. package/docs/sdk/guides/README.md +0 -1
  479. package/docs/sdk/nodes.md +0 -2
  480. package/docs/sdk/resources.md +0 -1
  481. package/package.json +2 -2
  482. package/packages/crouter-identity/package.json +1 -1
  483. package/runtime.lock.json +11 -11
  484. package/dist/api/dto/memory.d.ts +0 -171
  485. package/dist/api/dto/memory.js +0 -1
  486. package/dist/builtin-memory/crouter-sdk/guides/app-memory.md +0 -73
  487. package/dist/builtin-memory/crouter-sdk/memory.md +0 -87
  488. package/dist/commands/broker-permissions.d.ts +0 -2
  489. package/dist/commands/broker-permissions.js +0 -1
  490. package/dist/commands/memory/client.d.ts +0 -11
  491. package/dist/commands/memory/client.js +0 -1
  492. package/dist/commands/memory/delete.d.ts +0 -1
  493. package/dist/commands/memory/delete.js +0 -1
  494. package/dist/commands/memory/edit.d.ts +0 -1
  495. package/dist/commands/memory/edit.js +0 -21
  496. package/dist/commands/memory/find.d.ts +0 -1
  497. package/dist/commands/memory/find.js +0 -1
  498. package/dist/commands/memory/history.d.ts +0 -1
  499. package/dist/commands/memory/history.js +0 -5
  500. package/dist/commands/memory/lint.d.ts +0 -1
  501. package/dist/commands/memory/lint.js +0 -1
  502. package/dist/commands/memory/list.d.ts +0 -1
  503. package/dist/commands/memory/list.js +0 -1
  504. package/dist/commands/memory/move.d.ts +0 -1
  505. package/dist/commands/memory/move.js +0 -1
  506. package/dist/commands/memory/origin.d.ts +0 -1
  507. package/dist/commands/memory/origin.js +0 -1
  508. package/dist/commands/memory/read.d.ts +0 -1
  509. package/dist/commands/memory/read.js +0 -6
  510. package/dist/commands/memory/shared.d.ts +0 -22
  511. package/dist/commands/memory/shared.js +0 -1
  512. package/dist/commands/memory/write.d.ts +0 -1
  513. package/dist/commands/memory/write.js +0 -13
  514. package/dist/commands/memory.js +0 -1
  515. package/dist/commands/node-inspect-artifacts.d.ts +0 -1
  516. package/dist/commands/node-inspect-artifacts.js +0 -8
  517. package/dist/core/help/memory-extensions.d.ts +0 -3
  518. package/dist/core/help/memory-extensions.js +0 -2
  519. package/dist/core/memory/cli-selector.d.ts +0 -13
  520. package/dist/core/memory/cli-selector.js +0 -1
  521. package/dist/core/memory/doc-link-grammar.d.ts +0 -20
  522. package/dist/core/memory/doc-link-grammar.js +0 -2
  523. package/dist/core/memory/extensions.js +0 -1
  524. package/dist/core/memory/history.d.ts +0 -87
  525. package/dist/core/memory/history.js +0 -6
  526. package/dist/core/memory/identity.d.ts +0 -65
  527. package/dist/core/memory/identity.js +0 -1
  528. package/dist/core/memory/inline-ref-guidance.js +0 -2
  529. package/dist/core/memory/inline-ref-inventory.d.ts +0 -9
  530. package/dist/core/memory/inline-ref-inventory.js +0 -1
  531. package/dist/core/memory/lint.d.ts +0 -163
  532. package/dist/core/memory/lint.js +0 -2
  533. package/dist/core/memory/mutation-domain.d.ts +0 -113
  534. package/dist/core/memory/mutation-domain.js +0 -12
  535. package/dist/core/memory/mutations.d.ts +0 -74
  536. package/dist/core/memory/mutations.js +0 -1
  537. package/dist/core/memory/project-namespace.d.ts +0 -31
  538. package/dist/core/memory/project-namespace.js +0 -2
  539. package/dist/core/memory/repository-association.d.ts +0 -31
  540. package/dist/core/memory/repository-association.js +0 -1
  541. package/dist/core/memory/service.d.ts +0 -145
  542. package/dist/core/memory/service.js +0 -2
  543. package/dist/core/memory/tree.d.ts +0 -39
  544. package/dist/core/memory/tree.js +0 -1
  545. package/dist/core/memory-resolver.d.ts +0 -280
  546. package/dist/core/memory-resolver.js +0 -2
  547. package/dist/core/nested-stores.d.ts +0 -18
  548. package/dist/core/nested-stores.js +0 -1
  549. package/dist/core/runtime/memory.d.ts +0 -3
  550. package/dist/core/runtime/memory.js +0 -1
  551. package/dist/core/substrate/frontmatter-validation.d.ts +0 -11
  552. package/dist/core/substrate/frontmatter-validation.js +0 -1
  553. package/dist/core/substrate/gate.d.ts +0 -16
  554. package/dist/core/substrate/gate.js +0 -1
  555. package/dist/core/substrate/index.d.ts +0 -18
  556. package/dist/core/substrate/index.js +0 -1
  557. package/dist/core/substrate/injected-store.d.ts +0 -75
  558. package/dist/core/substrate/injected-store.js +0 -2
  559. package/dist/core/substrate/listings.d.ts +0 -28
  560. package/dist/core/substrate/listings.js +0 -1
  561. package/dist/core/substrate/memory-events.d.ts +0 -6
  562. package/dist/core/substrate/memory-events.js +0 -1
  563. package/dist/core/substrate/on-read-node.d.ts +0 -6
  564. package/dist/core/substrate/on-read-node.js +0 -1
  565. package/dist/core/substrate/on-read.d.ts +0 -101
  566. package/dist/core/substrate/on-read.js +0 -9
  567. package/dist/core/substrate/plan.d.ts +0 -94
  568. package/dist/core/substrate/plan.js +0 -1
  569. package/dist/core/substrate/render-node.d.ts +0 -12
  570. package/dist/core/substrate/render-node.js +0 -1
  571. package/dist/core/substrate/render.d.ts +0 -41
  572. package/dist/core/substrate/render.js +0 -65
  573. package/dist/core/substrate/session-cache.d.ts +0 -27
  574. package/dist/core/substrate/session-cache.js +0 -1
  575. package/dist/core/substrate/surface-match.d.ts +0 -73
  576. package/dist/core/substrate/surface-match.js +0 -1
  577. package/dist/daemon/api/handlers/memory.js +0 -5
  578. package/dist/migrations/001-surfaces-frontmatter.d.ts +0 -2
  579. package/dist/migrations/001-surfaces-frontmatter.js +0 -1
  580. package/dist/migrations/002-profile-project-memory.d.ts +0 -2
  581. package/dist/migrations/002-profile-project-memory.js +0 -1
  582. package/dist/migrations/003-repository-root-memory-identity/front-door.d.ts +0 -26
  583. package/dist/migrations/003-repository-root-memory-identity/front-door.js +0 -11
  584. package/dist/migrations/003-repository-root-memory-identity/index.d.ts +0 -2
  585. package/dist/migrations/003-repository-root-memory-identity/index.js +0 -5
  586. package/dist/migrations/003-repository-root-memory-identity/references.d.ts +0 -95
  587. package/dist/migrations/003-repository-root-memory-identity/references.js +0 -5
  588. package/dist/migrations/003-repository-root-memory-identity/repository-facts.d.ts +0 -39
  589. package/dist/migrations/003-repository-root-memory-identity/repository-facts.js +0 -3
  590. package/dist/migrations/convergent.d.ts +0 -43
  591. package/dist/migrations/convergent.js +0 -2
  592. package/dist/migrations/corpus.d.ts +0 -75
  593. package/dist/migrations/corpus.js +0 -3
  594. package/dist/migrations/frontmatter-splice.d.ts +0 -15
  595. package/dist/migrations/frontmatter-splice.js +0 -8
  596. package/dist/migrations/profile-manifests.d.ts +0 -30
  597. package/dist/migrations/profile-manifests.js +0 -2
  598. package/dist/migrations/registry.d.ts +0 -7
  599. package/dist/migrations/registry.js +0 -1
  600. package/dist/migrations/runner.d.ts +0 -43
  601. package/dist/migrations/runner.js +0 -1
  602. package/dist/migrations/types.d.ts +0 -211
  603. package/dist/shared/birth-announcement.d.ts +0 -12
  604. package/dist/shared/birth-announcement.js +0 -1
  605. package/docs/sdk/guides/app-memory.md +0 -22
  606. package/docs/sdk/memory.md +0 -85
  607. /package/dist/{migrations/types.js → api/dto/delivery.js} +0 -0
  608. /package/dist/{core/memory → shared}/inline-ref-grammar.d.ts +0 -0
  609. /package/dist/{core/memory → shared}/inline-ref-grammar.js +0 -0
@@ -26,4 +26,4 @@ The costs are real. A daemon must be running, and canvas state has one home inst
26
26
 
27
27
  Those costs buy a simpler model: one state owner, one broker launcher, and clients that can reconnect. A CLI command, an SDK application, and a terminal viewer all use the same API for canvas state. They can come and go without creating competing writers or losing the graph that explains what each agent is doing.
28
28
 
29
- For the lower-level runtime model, run `crtr memory read internal/nodes-and-canvas`. For a complete remote application setup, start with the SDK [getting started guide](../sdk/getting-started.md).
29
+ For the lower-level runtime model, run `crtr canvas read internal/nodes-and-canvas`. For a complete remote application setup, start with the SDK [getting started guide](../sdk/getting-started.md).
@@ -5,7 +5,7 @@ description: Drive a crouter daemon from a Node or browser application with the
5
5
 
6
6
  # `@north-light/crouter-sdk`
7
7
 
8
- The ESM-only client an application installs to drive a crouter daemon: create agent runs, watch streamed events, wait for typed results, read and write memory, and reach the rest of the daemon's `/v1` API.
8
+ The ESM-only client an application installs to drive a crouter daemon: create agent runs, watch streamed events, wait for typed results, and reach the rest of the daemon's `/v1` API.
9
9
 
10
10
  One package, one class. `new Crouter()` in Node talks to the owner's unix socket. `new Crouter({ baseURL, token })` in a browser or a remote process talks to the daemon's TCP listener with a bearer token. Resource methods issue `/v1` requests; `createAndWait`, `parse`, and `auth.status` compose more than one request. crtrd stays the sole owner of canvas state.
11
11
 
@@ -32,7 +32,6 @@ if (run.kind === 'result') console.log(run.output_parsed.root_cause);
32
32
  | [Client construction](./client.md) | Every constructor option and its environment-variable fallback; per-request options |
33
33
  | [Nodes](./nodes.md) | `create` parameters, the outcome union, `parse()` with a zod schema, `waitForOutcome`, `message`, `cancel`, nested resources |
34
34
  | [Streaming](./streaming.md) | The event table, `stream()` / `events()`, the activity helper, resume with `after`, `stream_gap` and `stream_dropped` |
35
- | [Memory](./memory.md) | The scope object and every `client.memory` method |
36
35
  | [Files](./files.md) | Absolute-path reads, writes, and one-level lists |
37
36
  | [Bash](./bash.md) | One bounded command and its output result |
38
37
  | [Resource map](./resources.md) | Every namespace with its phase, what is deliberately excluded, and the `client.request()` escape hatch |
@@ -42,21 +41,21 @@ if (run.kind === 'result') console.log(run.output_parsed.root_cause);
42
41
 
43
42
  ## Phases
44
43
 
45
- The surface ships in three cuts. Phase 3 memory methods are shipped.
44
+ The surface ships in three cuts.
46
45
 
47
46
  | Phase | What lands | State |
48
47
  |---|---|---|
49
48
  | **Phase 1** | Client construction and transports; `client.auth.status()`; `client.nodes.create`, `retrieve`, `list`, `outcome`, `waitForOutcome`, `createAndWait`, `parse`, `message`, `cancel`, and `interrupt`; `nodes.reports.list`; `profiles.ensure` and `retrieve`; `system.status` and `health`; the error hierarchy; per-request options; `crtr sys connect`; and `env-docker.connection()` | Shipped |
50
49
  | **Phase 2 namespaces** | Node lifecycle, job, worktree, and result; canvas and canvas history; crons; human requests and inbox; models; `client.files.read` through `/v1/files/peek`, `write`, and `list`; and `client.bash.run` | Shipped |
51
50
  | **Phase 2 streaming** | `GET /v1/nodes/{id}/events`, `nodes.stream(params, options?)`, `nodes.events(id, options?)`, `NodeStream`, and the activity helper | Shipped |
52
- | **Phase 3** | Memory routes and `client.memory`, plus the review, comment, and chat-inventory namespaces | Memory shipped; remaining namespaces not shipped |
51
+ | **Phase 3** | The review, comment, and chat-inventory namespaces | Not shipped |
53
52
 
54
53
  The per-run `scopes` create field ships in phase 1. `nodes.update` scope support remains phase 2 and is not in the shipped client or wire declarations.
55
54
 
56
55
  ## Verification status
57
56
 
58
- The SDK declarations, streaming examples, and memory examples are verified.
57
+ The SDK declarations and streaming examples are verified.
59
58
 
60
59
  ## Where the agents read this
61
60
 
62
- The same content routed for agents lives in the builtin memory document `crouter-sdk`, which ships with the `crtr` binary. An agent working in an application's repository reaches it with `crtr memory read crouter-sdk` and does not need this repository checked out.
61
+ The same content routed for agents lives in the builtin memory document `crouter-sdk`, which ships with the `crtr` binary. An agent working in an application's repository reaches it with `crtr canvas read crouter-sdk` and does not need this repository checked out.
@@ -64,19 +64,6 @@ The SDK validates path-segment identifiers before it makes a request. Invalid no
64
64
  | The bearer token's ceiling lacks the scope a route needs, or `nodes.create` asks for `scopes` outside it (`details.scopes` lists them) | `PermissionDeniedError`, 403 `scope_denied` |
65
65
  | A scoped token reaches an owner-only route (daemon restart, attach, broker internals, canvas prune, profile pause/resume/delete, model credential install) | `PermissionDeniedError`, 403 `owner_only` |
66
66
 
67
- ## Memory requests
68
-
69
- | Condition | Class, status, and code |
70
- |---|---|
71
- | `retrieve` or `resolve` names a document that does not exist, including a document deleted earlier | `NotFoundError`, 404 `memory_document_not_found` |
72
- | `history` names a document with no document or revision history | `NotFoundError`, 404 `not_found` |
73
- | History is requested for a builtin or plugin document | `BadRequestError`, 400 `usage` |
74
- | A mutation directly sets protected frontmatter (`kind`, `when-and-why-to-read`, `origin`, or `last-updated`) | `BadRequestError`, 400 `invalid_request` |
75
- | An update would make no change | `BadRequestError`, 400 `usage` |
76
- | A node-targeted caller lacks `memory:read` or `memory:write` | `PermissionDeniedError`, 403 `scope_denied` |
77
-
78
- Invalid names, invalid scope combinations, invalid limits, builtin mutation selections, and invalid search combinations are also `BadRequestError` responses. Builtin and plugin documents cannot be mutated; no code should treat a 400 refusal as a successful write.
79
-
80
67
  ## The wire body
81
68
 
82
69
  The daemon answers an error with:
@@ -13,6 +13,5 @@ These recipes turn the SDK namespaces into complete applications: a bounded extr
13
13
  | [Event-driven assistant](./event-driven-assistant.md) | Events arrive over time from a webhook, queue, or watcher. | A resident node that wakes for each event. |
14
14
  | [Fan-out pipeline](./fan-out-pipeline.md) | One task needs independent research before a synthesis. | An orchestrator's final report. |
15
15
  | [Human approval](./human-approval.md) | A person must decide before work continues. | A node resumed by an inbox answer. |
16
- | [Application memory](./app-memory.md) | Several runs need the same durable application knowledge. | A profile-owned document read by a scoped run. |
17
16
 
18
17
  Start with typed extraction for a request/response job. Use a resident node when the same assistant should react again later. Use an orchestrator only when child work can proceed independently; otherwise keep the composition in your application.
package/docs/sdk/nodes.md CHANGED
@@ -189,8 +189,6 @@ for (const report of reports) console.log(report.tier, report.body);
189
189
 
190
190
  List routes return what the daemon returns. `nodes.list`, `nodes.reports.list`, and `nodes.jobs.list` return plain arrays — there is no page object, no `hasNextPage()`, and no `after` cursor on them, because the daemon has no paging substrate behind those routes and an envelope there would promise a continuation that can never happen.
191
191
 
192
- The one place the page envelope exists is the phase-3 memory routes. See [Memory](./memory.md).
193
-
194
192
  ## Identifier validation
195
193
 
196
194
  Methods that take a node id validate it before the request: core node methods, lifecycle methods, `nodes.reports`, `nodes.jobs`, `nodes.worktree`, and `nodes.result`. An invalid id throws `TypeError` locally and sends no request. `nodes.outcome(id, { wait })` also throws `RangeError` locally when `wait` is not an integer from 0 through 25.
@@ -26,7 +26,6 @@ Every namespace exported by the client. Namespaces are camelCase. Verbs are `cre
26
26
  | `human.inbox` | `list`, `retrieve`, `respond`, `progress`, `cancel`, `history`, `response` | `/v1/human/inbox…` |
27
27
  | `models.credentials` | `list`, `install`, `remove` | `/v1/model-auth…` |
28
28
  | `models.config` | `update` | `PUT /v1/model-config` |
29
- | `memory` | `list`, `retrieve`, `create`, `update`, `delete`, `move`, `search`, `history`, `resolve` | `/v1/memory…`; see [Memory](./memory.md) |
30
29
 
31
30
  Action methods keep the product's literal name (`fork`, `revive`, `promote`, `yield`) rather than being renamed into a generic verb. Every request-capable method takes `RequestOptions` as its final argument after its path, body, or query arguments. `RequestOptions` is `{ headers?, signal?, timeout?, maxRetries? }`; stream event options exclude `timeout` and add `after`.
32
31
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/crouter",
3
- "version": "0.3.353",
3
+ "version": "0.3.354",
4
4
  "description": "crtr — agent runtime with memory, plugins, and marketplaces",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -131,7 +131,7 @@
131
131
  "@earendil-works/pi-ai": "0.87.1",
132
132
  "@earendil-works/pi-coding-agent": "0.87.1",
133
133
  "@earendil-works/pi-tui": "0.87.1",
134
- "@north-light/crouter-identity": "^0.3.353",
134
+ "@north-light/crouter-identity": "^0.3.354",
135
135
  "cron-parser": "^5.6.0",
136
136
  "esbuild": "^0.27.7",
137
137
  "jose": "^6.2.12",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/crouter-identity",
3
- "version": "0.3.353",
3
+ "version": "0.3.354",
4
4
  "description": "Northlight access-token verification and scope rules",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/runtime.lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@north-light/crouter",
3
- "version": "0.3.353",
3
+ "version": "0.3.354",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@north-light/crouter",
9
- "version": "0.3.353",
9
+ "version": "0.3.354",
10
10
  "hasInstallScript": true,
11
11
  "license": "GPL-3.0-only",
12
12
  "workspaces": [
@@ -18,7 +18,7 @@
18
18
  "@earendil-works/pi-ai": "0.87.1",
19
19
  "@earendil-works/pi-coding-agent": "0.87.1",
20
20
  "@earendil-works/pi-tui": "0.87.1",
21
- "@north-light/crouter-identity": "^0.3.353",
21
+ "@north-light/crouter-identity": "^0.3.354",
22
22
  "cron-parser": "^5.6.0",
23
23
  "esbuild": "^0.27.7",
24
24
  "jose": "^6.2.12",
@@ -10885,17 +10885,17 @@
10885
10885
  },
10886
10886
  "packages/crouter-api": {
10887
10887
  "name": "@north-light/crouter-api",
10888
- "version": "0.3.353",
10888
+ "version": "0.3.354",
10889
10889
  "license": "GPL-3.0-only"
10890
10890
  },
10891
10891
  "packages/crouter-env-docker": {
10892
10892
  "name": "@north-light/crouter-env-docker",
10893
- "version": "0.3.353",
10893
+ "version": "0.3.354",
10894
10894
  "license": "GPL-3.0-only"
10895
10895
  },
10896
10896
  "packages/crouter-identity": {
10897
10897
  "name": "@north-light/crouter-identity",
10898
- "version": "0.3.353",
10898
+ "version": "0.3.354",
10899
10899
  "license": "GPL-3.0-only",
10900
10900
  "dependencies": {
10901
10901
  "jose": "^6.2.1"
@@ -10903,19 +10903,19 @@
10903
10903
  },
10904
10904
  "packages/crouter-plugin": {
10905
10905
  "name": "@north-light/crouter-plugin",
10906
- "version": "0.3.353",
10906
+ "version": "0.3.354",
10907
10907
  "license": "GPL-3.0-only",
10908
10908
  "dependencies": {
10909
- "@north-light/crouter-api": "^0.3.353"
10909
+ "@north-light/crouter-api": "^0.3.354"
10910
10910
  }
10911
10911
  },
10912
10912
  "packages/crouter-sdk": {
10913
10913
  "name": "@north-light/crouter-sdk",
10914
- "version": "0.3.353",
10914
+ "version": "0.3.354",
10915
10915
  "license": "GPL-3.0-only",
10916
10916
  "dependencies": {
10917
- "@north-light/crouter-api": "^0.3.353",
10918
- "@north-light/crouter-identity": "^0.3.353",
10917
+ "@north-light/crouter-api": "^0.3.354",
10918
+ "@north-light/crouter-identity": "^0.3.354",
10919
10919
  "jose": "^6.2.1"
10920
10920
  }
10921
10921
  }
@@ -1,171 +0,0 @@
1
- export declare const MEMORY_SCOPES: readonly ["node", "project", "profile", "user", "builtin"];
2
- export type MemoryScopeName = typeof MEMORY_SCOPES[number];
3
- /** A canonical document address: slash-joined safe segments, carried as one percent-encoded path segment. */
4
- export declare function isMemoryDocName(name: string): boolean;
5
- export interface MemoryOriginConversationDTO {
6
- session_file: string;
7
- }
8
- export interface MemoryScope {
9
- node?: string;
10
- cwd?: string;
11
- profile?: string;
12
- store?: MemoryScopeName;
13
- }
14
- export interface MemoryDocSummaryDTO {
15
- name: string;
16
- short_form: string;
17
- kind: string;
18
- privacy: 'public' | 'friends' | 'private';
19
- scope: MemoryScopeName;
20
- extensions: Record<string, Record<string, string | boolean | number>>;
21
- path: string;
22
- store_root: string;
23
- physical_relative_path: string;
24
- candidates?: MemoryCandidateDTO[];
25
- }
26
- export interface MemoryCandidateDTO {
27
- winner: boolean;
28
- scope: MemoryScopeName;
29
- store_root: string;
30
- physical_relative_path: string;
31
- path: string;
32
- }
33
- export interface MemoryDocDTO extends MemoryDocSummaryDTO {
34
- body: string;
35
- frontmatter: Record<string, unknown> | null;
36
- representation: 'leaf-file' | 'directory-index';
37
- links: string[];
38
- findings?: MemoryLintFindingDTO[];
39
- }
40
- export interface MemoryLintFindingDTO {
41
- severity: string;
42
- rule: string;
43
- message: string;
44
- }
45
- export interface MemoryListQuery extends MemoryScope {
46
- kind?: string;
47
- limit?: number;
48
- after?: string;
49
- }
50
- export interface MemoryDocCreateRequest extends MemoryScope {
51
- name: string;
52
- kind: string;
53
- when_and_why_to_read: string;
54
- body: string;
55
- frontmatter?: Record<string, unknown>;
56
- extensions?: Record<string, Record<string, string | boolean | number>>;
57
- }
58
- export interface MemoryDocUpdateRequest extends MemoryScope {
59
- rationale: string;
60
- body?: string;
61
- frontmatter?: Record<string, unknown>;
62
- extensions?: Record<string, Record<string, string | boolean | number>>;
63
- unset?: string[];
64
- }
65
- export interface MemoryDocDeletedDTO {
66
- name: string;
67
- scope: MemoryScopeName;
68
- path: string;
69
- log_path: string;
70
- deleted: true;
71
- }
72
- export interface MemoryDocMoveRequest extends MemoryScope {
73
- to: string;
74
- }
75
- export interface MemoryDocMovedDTO {
76
- name: string;
77
- previous_name: string;
78
- scope: MemoryScopeName;
79
- path: string;
80
- log_path: string;
81
- refs_rewritten: Array<{
82
- name: string;
83
- scope: MemoryScopeName;
84
- path: string;
85
- refs: number;
86
- }>;
87
- follow_up: string;
88
- }
89
- export interface MemorySearchRequest extends MemoryScope {
90
- query: string;
91
- kind?: string;
92
- grep?: boolean;
93
- body?: boolean;
94
- limit?: number;
95
- after?: string;
96
- min_score?: number;
97
- }
98
- export type MemorySearchHitDTO = MemoryRankedSearchHitDTO | MemoryGrepSearchHitDTO;
99
- export interface MemoryRankedSearchHitDTO {
100
- name: string;
101
- kind: string;
102
- privacy: 'public' | 'friends' | 'private';
103
- scope: MemoryScopeName;
104
- score: number;
105
- short_form: string;
106
- path: string;
107
- store_root: string;
108
- physical_relative_path: string;
109
- candidates?: MemoryCandidateDTO[];
110
- }
111
- export interface MemoryGrepSearchHitDTO {
112
- name: string;
113
- privacy: 'public' | 'friends' | 'private';
114
- scope: MemoryScopeName;
115
- line: number;
116
- text: string;
117
- path: string;
118
- store_root: string;
119
- physical_relative_path: string;
120
- candidates?: MemoryCandidateDTO[];
121
- }
122
- export interface MemoryHistoryQuery extends MemoryScope {
123
- limit?: number;
124
- revision?: number;
125
- diff?: boolean;
126
- }
127
- export interface MemoryHistoryRevisionDTO {
128
- revision: number;
129
- op: 'create' | 'edit' | 'delete' | 'move';
130
- at: string;
131
- node?: string;
132
- rationale?: string;
133
- verbatim?: true;
134
- body_changed: boolean;
135
- frontmatter_changed: string[];
136
- diff?: string;
137
- }
138
- export interface MemoryHistoryRecordDTO {
139
- revision: number;
140
- op: 'create' | 'edit' | 'delete' | 'move';
141
- at: string;
142
- node?: string;
143
- cwd: string;
144
- from?: string;
145
- rationale?: string;
146
- verbatim?: boolean;
147
- before: string;
148
- after: string;
149
- }
150
- export interface MemoryHistoryDTO {
151
- name: string;
152
- scope: MemoryScopeName;
153
- log_path: string;
154
- total: number;
155
- deleted?: unknown;
156
- revisions?: MemoryHistoryRevisionDTO[];
157
- record?: MemoryHistoryRecordDTO;
158
- }
159
- export interface MemoryDocRefDTO {
160
- name: string;
161
- scope: string;
162
- path: string;
163
- store_root: string;
164
- physical_relative_path: string;
165
- plugin?: string;
166
- }
167
- export interface MemoryListDTO<T> {
168
- object: 'list';
169
- data: T[];
170
- has_more: boolean;
171
- }
@@ -1 +0,0 @@
1
- var r=Object.defineProperty;var o=(e,t)=>r(e,"name",{value:t,configurable:!0});const i=["node","project","profile","user","builtin"];function c(e){return/^[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)*$/.test(e)}o(c,"isMemoryDocName");export{i as MEMORY_SCOPES,c as isMemoryDocName};
@@ -1,73 +0,0 @@
1
- ---
2
- kind: knowledge
3
- when-and-why-to-read: When an application's agents need shared durable
4
- knowledge, read this because a profile store gives runs one owned memory
5
- location and scopes can allow reading without writing.
6
- ---
7
-
8
- # Application memory
9
-
10
- Use this recipe when several runs need the same application guidance. Run `npx tsx examples/guides/app-memory.ts /path/to/repo`; it ensures a profile, creates a profile-owned knowledge document if it does not already exist, then starts a run allowed to read but not write memory.
11
-
12
- ```ts
13
- import Crouter, { NotFoundError } from '@north-light/crouter-sdk';
14
- import { resolve } from 'node:path';
15
- import { z } from 'zod';
16
-
17
- const client = new Crouter();
18
- const cwd = resolve(process.argv[2] ?? process.cwd());
19
- const profileName = process.env.APP_PROFILE ?? 'release-notes-app';
20
-
21
- const profile = await client.profiles.ensure(profileName, {
22
- projects: [{ path: cwd, memory: 'content' }],
23
- });
24
-
25
- try {
26
- await client.memory.retrieve('release/voice', { profile: profile.id, store: 'profile' });
27
- } catch (error) {
28
- if (!(error instanceof NotFoundError)) throw error;
29
- await client.memory.create({
30
- name: 'release/voice',
31
- kind: 'knowledge',
32
- when_and_why_to_read: 'When writing release notes, read this because it defines the product voice and terms customers recognize.',
33
- body: 'Use short factual sentences. Name the user-visible result before implementation details.',
34
- frontmatter: { surfaces: ['{"on":"boot","at":"preview"}'] },
35
- profile: profile.id,
36
- store: 'profile',
37
- });
38
- }
39
-
40
- const result = await client.nodes.parse({
41
- cwd,
42
- model: process.env.GUIDE_MODEL,
43
- profile: profile.id,
44
- root: true,
45
- root_lifecycle: 'terminal',
46
- deadline: '5m',
47
- scopes: ['memory:read'],
48
- prompt: 'Write one short release note announcing that customers can download invoices as CSV from account settings. Do not write or update memory.',
49
- output_schema: z.object({ release_note: z.string() }),
50
- });
51
-
52
- if (result.kind === 'result') {
53
- console.log(result.output_parsed.release_note);
54
- } else if (result.reason === 'declined') {
55
- console.error(`agent declined: ${result.declined?.reason ?? 'no reason supplied'}`);
56
- process.exitCode = 2;
57
- } else {
58
- console.error(`agent failed: ${result.reason}`, result.detail);
59
- process.exitCode = 1;
60
- }
61
- ```
62
-
63
- A profile is the application's durable identity: it names the memory store and the projects whose context the profile can reach. The routing line is part of the document, not decoration. State both the moment the agent should read it and the reason it matters; a document with a vague routing line will not surface when the agent needs it.
64
-
65
- The `boot`/`preview` surface exposes the document's routing line when this profile's agent starts. The task asks for a release note without naming `release/voice`; in the local run the agent read that document before producing the note. Without a surface entry, a memory document appears only in its directory listing and its routing line cannot select it at boot. The run passes `scopes: ['memory:read']`. That is an allow-list: node-targeted memory reads are allowed and writes are refused because `memory:write` is absent. The application itself is not narrowed by those node scopes, so keep application credentials and its memory mutation policy separate from the agent's capabilities.
66
-
67
- Observed against the local daemon with `APP_PROFILE=release-notes-app-guide-boot-preview GUIDE_MODEL=openai-codex/gpt-6-sol:high`:
68
-
69
- ```text
70
- You can now download your invoices as a CSV from account settings.
71
- ```
72
-
73
- Use profile memory for knowledge shared across the application's related projects. Put facts that belong to one repository in project memory instead, and temporary run notes in node memory. See [[crouter-concepts/memory]] for the ownership tiers and [[crouter-concepts/profiles-kinds-and-modes]] for what a profile changes.
@@ -1,87 +0,0 @@
1
- ---
2
- kind: knowledge
3
- when-and-why-to-read: When you need Memory, this knowledge should be read
4
- because Read and write memory documents with an explicit target for every
5
- request.
6
- ---
7
-
8
- # `client.memory`
9
-
10
- Phase 3. `client.memory` reads and writes the memory documents that shape an agent run. Every call names its target; the daemon never uses its own working directory or environment to select memory.
11
-
12
- ```ts
13
- const page = await client.memory.list({ node: nodeId, kind: 'knowledge', limit: 50 });
14
- const document = await client.memory.retrieve('insights/capture', { node: nodeId, frontmatter: true });
15
- ```
16
-
17
- ## Target
18
-
19
- ```ts
20
- type MemoryScope = {
21
- node?: string;
22
- cwd?: string;
23
- profile?: string;
24
- store?: 'node' | 'project' | 'profile' | 'user' | 'builtin';
25
- };
26
- ```
27
-
28
- Pass `node` to use that node's working directory and profile. Do not combine it with `cwd` or `profile`. With no target, only user and builtin memory are searched. `store` restricts the request to one memory tier; `store: 'node'` requires `node`, and `store: 'profile'` requires a profile target. `create` defaults to the nearest project store when one is available, otherwise the user store. `update`, `delete`, and `move` resolve the existing document through normal scope precedence when `store` is omitted. `builtin` is read-only.
29
-
30
- When a request supplies `node`, its node row must hold `memory:read` for `list`, `retrieve`, `search`, `history`, and `resolve`, or `memory:write` for `create`, `update`, `delete`, and `move`. Calls without `node` are external application calls and are not narrowed by a node scope list.
31
-
32
- ## Methods
33
-
34
- Every method accepts `RequestOptions` as its final optional argument (`signal`, `timeout`, `maxRetries`, and `headers`). A document name can contain `/`; the SDK encodes it as one path segment.
35
-
36
- | Method | Parameters | Result |
37
- |---|---|---|
38
- | `memory.list(query?, options?)` | `MemoryScope & { kind?, limit?, after? }`; `limit` is 1–100 (default 100) | `MemoryPage<MemoryDocSummaryDTO>` |
39
- | `memory.retrieve(name, query?, options?)` | `name`; `MemoryScope & { frontmatter? }` | `MemoryDocDTO` |
40
- | `memory.create(params, options?)` | `MemoryDocCreateRequest` | `MemoryDocDTO` |
41
- | `memory.update(name, params, options?)` | `name`; `MemoryDocUpdateRequest` | `MemoryDocDTO` |
42
- | `memory.delete(name, scope?, options?)` | `name`; `MemoryScope` | `MemoryDocDeletedDTO` |
43
- | `memory.move(name, params, options?)` | `name`; `MemoryDocMoveRequest` | `MemoryDocMovedDTO` |
44
- | `memory.search(params, options?)` | `MemorySearchRequest` | `MemoryPage<MemorySearchHitDTO>` |
45
- | `memory.history(name, query?, options?)` | `name`; `MemoryHistoryQuery` | `MemoryHistoryDTO` |
46
- | `memory.resolve(name, scope?, options?)` | `name`; `MemoryScope` | `MemoryDocRefDTO` |
47
-
48
- `MemoryDocCreateRequest` requires `name`, `kind`, `when_and_why_to_read`, and `body`; it also accepts `frontmatter`, `extensions`, and the scope fields. `frontmatter.privacy` accepts `public`, `friends`, or `private`; creation defaults to persisted `public`. `MemoryDocUpdateRequest` requires `rationale`, which is stored in revision history rather than document text, and optionally accepts `body`, `frontmatter`, `extensions`, `unset`, and the scope fields. Set `frontmatter.privacy` to change the level; it cannot be unset. A legacy document without the field reads as `private`. `MemoryDocMoveRequest` requires `to` and accepts the scope fields.
49
-
50
- `retrieve` returns the body by default. With `frontmatter: true`, its `body` is the complete document source with the effective privacy level included for older documents. `MemoryDocDTO` also contains `privacy`, `frontmatter`, `representation` (`'leaf-file'` or `'directory-index'`), `links`, and any lint `findings`; document DTOs include their canonical name, kind, scope, extensions, path, store root, physical relative path, and any competing candidates. `resolve` returns the winning document's location and optional plugin name without reading its body.
51
-
52
- ```ts
53
- await client.memory.create({
54
- name: 'billing/refund-policy',
55
- kind: 'knowledge',
56
- when_and_why_to_read: 'When handling a refund request, read this because the eligibility window is not in the order record.',
57
- body: 'Refunds are available for 60 days.',
58
- profile: 'my-app',
59
- });
60
-
61
- await client.memory.update('billing/refund-policy', {
62
- rationale: 'The eligibility window changed on 2026-01-04.',
63
- body: 'Refunds are available for 90 days.',
64
- profile: 'my-app',
65
- });
66
- ```
67
-
68
- The daemon returns document text without expanding shell blocks. Builtin and plugin documents are read-only. `kind`, `when-and-why-to-read`, `origin`, and `last-updated` cannot be set or removed directly. Each mutation writes a complete before/after history record; delete leaves a tombstone. `retrieve` and `resolve` return `NotFoundError` with status 404 and code `memory_document_not_found` for a deleted document or an unknown name. Concurrent writes are last-write-wins.
69
-
70
- `search` uses ranked search by default. Set `body: true` to include document bodies in ranking, or `grep: true` for regular-expression line matches; `grep` and `body` cannot be combined, and `min_score` is only available in ranked search. Ranked hits contain `kind`, `score`, and `short_form`; grep hits contain `line` and `text`.
71
-
72
- `history` returns newest-first revision summaries, optionally with `diff`, or the full before/after record for one `revision`. A delete leaves history available through its tombstone.
73
-
74
- ## Pages
75
-
76
- `list` and `search` return `{ object: 'list', data, has_more }` as a `MemoryPage`. A page has `hasNextPage()`, `getNextPage()`, and is async iterable across every page. The list cursor is the final document's canonical name. Ranked search uses the final hit's name; grep uses an opaque cursor that includes the match location, which the SDK handles.
77
-
78
- ```ts
79
- const page = await client.memory.search({ query: 'refund window', node: nodeId });
80
- for (const hit of page.data) console.log(hit.name);
81
-
82
- if (page.hasNextPage()) {
83
- const next = await page.getNextPage();
84
- }
85
-
86
- for await (const hit of page) console.log(hit.name);
87
- ```
@@ -1,2 +0,0 @@
1
- /** Commands that mutate local installation state cannot be called through a broker's CLI relay. */
2
- export declare function requirePersonCli(): void;
@@ -1 +0,0 @@
1
- var o=Object.defineProperty;var r=(e,n)=>o(e,"name",{value:n,configurable:!0});import{InputError as i}from"../core/io.js";function m(){if(process.env.CRTR_API_SOCKET!==void 0)throw new i({error:"permission_error",message:"this command is not available to a node",next:"Run this command from the person's terminal."})}r(m,"requirePersonCli");export{m as requirePersonCli};
@@ -1,11 +0,0 @@
1
- /** The daemon resolves memory against the caller's view, not its own cwd. A node names only itself:
2
- * the daemon derives its cwd and profile from the node row and refuses a cwd a broker supplies. */
3
- export declare function memoryCaller(): {
4
- cwd?: string;
5
- node?: string;
6
- profile?: string;
7
- };
8
- export declare function memorySelection(input: Record<string, unknown>): Record<string, string>;
9
- export declare function memoryRequest<T>(method: string, path: string, body?: unknown): Promise<T>;
10
- export declare function memoryExtensionHelp(operation: 'write' | 'edit'): Promise<string | null>;
11
- export declare function memoryQuery(params: Record<string, string | number | boolean | undefined>): string;
@@ -1 +0,0 @@
1
- var m=Object.defineProperty;var t=(r,e)=>m(r,"name",{value:e,configurable:!0});import{envNodeId as f,envProfileId as l}from"../../shared/env.js";import{cliClient as y,rethrowAsCliError as u}from"../api-client.js";import{memoryExtensionFieldCatalogHelp as d}from"../../core/help/memory-extensions.js";function s(){const r=f();if(r)return{node:r};const e=l();return{cwd:process.cwd(),...e?{profile:e}:{}}}t(s,"memoryCaller");function A(r){return{...s(),...typeof r.scope=="string"?{store:r.scope}:{},...typeof r.dir=="string"?{dir:r.dir}:{},...typeof r.profile=="string"?{select_profile:r.profile}:{}}}t(A,"memorySelection");async function p(r,e,n){try{const o=await y().request(r,e,n);if(o!==null&&typeof o=="object"&&!Array.isArray(o)&&"diagnostics"in o){const{diagnostics:i,...c}=o;if(Array.isArray(i))for(const a of i)console.error(a);return c}return o}catch(o){u(o,e.startsWith("/v1/memory/resolve")&&o.status===404?"Find the canonical name with `crtr memory find <query>` or browse `crtr memory list`.":void 0)}}t(p,"memoryRequest");async function q(r){try{const e=await p("GET",`/v1/memory/extensions?${g(s())}`);return d(r,e)}catch{return null}}t(q,"memoryExtensionHelp");function g(r){const e=new URLSearchParams;for(const[n,o]of Object.entries(r))o!==void 0&&e.set(n,String(o));return e.toString()}t(g,"memoryQuery");export{s as memoryCaller,q as memoryExtensionHelp,g as memoryQuery,p as memoryRequest,A as memorySelection};
@@ -1 +0,0 @@
1
- export declare const deleteLeaf: import("../../core/command.js").LeafDef;
@@ -1 +0,0 @@
1
- var n=Object.defineProperty;var t=(e,a)=>n(e,"name",{value:a,configurable:!0});import{defineLeaf as r}from"../../core/command.js";import{memoryRequest as s,memorySelection as i}from"./client.js";import{MEMORY_WRITE_SCOPES as l,selectorParam as o}from"./shared.js";const u=r({name:"delete",description:"delete a memory document by name",whenToUse:"a stored document is wrong, obsolete, or superseded and should be removed \u2014 the sanctioned way to delete one, so you never rm the markdown off disk. Resolves the full canonical name exactly as `read` does and removes that one file: if you can read it, you can delete it. Refuses docs you do not own \u2014 builtin docs (shipped with the package) and installed-plugin docs (managed by `crtr pkg`). If two physical files in the selected store share the name, it selects the first physical path in stable lexical order and recovers the collision.",help:{name:"memory delete",summary:"resolve an exact canonical name and remove that document from its store",params:[{kind:"positional",name:"name",required:!0,constraint:"Full canonical name of the document \u2014 a project document is `<namespace>/<local name>`. Resolution is exact, as `read` resolves it: a file path, a bare leaf, a `<scope>/<name>` spelling, and a trailing `/INDEX` all fail. A canonical directory\u2019s own document is deleted at the directory name; its members are untouched and stay reachable. If two physical files in the selected store own the name, delete selects the first path in stable lexical order and reports it. Builtin and installed-plugin documents are read-only and refuse to delete, as does the repository-root document, which declares the immutable namespace for every document in the repository; a nested store\u2019s root guide is ordinary and may be deleted."},o("scope-read",{choices:[...l]},"Package-shipped documents cannot be deleted through this writable-scope selector."),o("dir",{},"Deletes from that one store, including a non-winning duplicate no target view resolves to.")],output:[{name:"name",type:"string",required:!0,constraint:"Full canonical name of the document that was deleted, as resolution settled it."},{name:"scope",type:"string",required:!0,constraint:"Scope the document was deleted from: node, user, project, or profile."},{name:"path",type:"string",required:!0,constraint:"Absolute path of the file that was removed."},{name:"log_path",type:"string",required:!0,constraint:"Absolute path to the document\u2019s revision log, which OUTLIVES the document \u2014 the delete is appended to it as a tombstone carrying the full final text, still readable with `crtr memory history`."},{name:"follow_up",type:"string",required:!1,constraint:"Present only when a same-store canonical collision was recovered by selecting the first physical path in lexical order."}],outputKind:"object",effects:["Permanently removes the resolved file from its store, and prunes any parent directories it leaves empty. Irreversible. Refuses the repository-root document: it declares the immutable `namespace:` every document in this repository composes under, so removing it would unmount the whole repository.","Appends a `delete` record carrying the document\u2019s full final text to `.history/<physical path>.jsonl` in the same store. The log itself is never removed."]},run:t(async e=>s("DELETE",`/v1/memory/docs/${encodeURIComponent(e.name)}`,{...i(e),mode:"cli"}),"run")});export{u as deleteLeaf};
@@ -1 +0,0 @@
1
- export declare const editLeaf: import("../../core/command.js").LeafDef;
@@ -1,21 +0,0 @@
1
- var i=Object.defineProperty;var r=(t,a)=>i(t,"name",{value:a,configurable:!0});import{defineLeaf as o}from"../../core/command.js";import{memoryExtensionHelp as s,memoryRequest as d,memorySelection as l}from"./client.js";import{DOC_RATIONALE_CONSTRAINT as c,GUIDE_CANONICAL_NAMES as h,GUIDE_DOC_LINKS as u,GUIDE_PREDICATE_VOCABULARY as m,GUIDE_ROUTING_LINE as p,GUIDE_SURFACES as y,overlayParam as e,selectorParam as n}from"./shared.js";const f=["short-form","gate","surfaces","unlisted","slash","rationale","lint-ignore"],g=["kind","privacy","when-and-why-to-read","origin","last-updated"],v=o({name:"edit",description:"revise an existing memory document, recording why",whenToUse:"a document that already exists needs to change \u2014 its body, its frontmatter, or both. Every revision carries a --rationale and is appended to the doc\u2019s revision history, so the corpus keeps a record of why it reached its current state. Resolves the name exactly as `read` does and revises the doc where it lives; use `crtr memory write` only to create one that does not exist yet.",help:{name:"memory edit",summary:"resolve an existing document and revise its body and/or frontmatter, appending a history record",guide:`The body you pipe is saved byte for byte. Nothing between stdin and disk parses, normalizes, summarizes, or rewrites it \u2014 the frontmatter fence is prepended and the text is otherwise untouched. Relaying a person\u2019s own words is therefore safe: pass them through unchanged and mark them with --verbatim.
2
-
3
- Two different rationales exist and they never share a flag. --rationale is why THIS REVISION is happening; it is required, it lands in the revision history, and it never touches the document text. --doc-rationale replaces the document\u2019s standing \`rationale\` frontmatter field \u2014 the observed gap the doc exists to close.
4
-
5
- Omitting stdin leaves the body exactly as it stands, which is how a frontmatter-only revision is made. Piping a body REPLACES the whole body; there is no partial or append mode. Emptying a document is not an edit \u2014 that intent is \`crtr memory delete\`.
6
-
7
- Omitted frontmatter flags preserve their fields; a legacy document without privacy is stamped private on edit. --unset is the only way to REMOVE a clearable field. The canonical clearable set (short-form, gate, surfaces, unlisted, slash, rationale, lint-ignore) is always accepted; any other field name is accepted only when the document\u2019s frontmatter already carries it \u2014 the path for dropping a legacy or non-canonical field. --surface replaces the whole surfaces list rather than adding to it.
8
-
9
- An edit that changes nothing fails. A rationale attached to zero change is noise in the trail the history exists to build \u2014 if the doc already says what you meant, there is nothing to record.
10
-
11
- \`last-updated\` is stamped on every successful edit; \`origin\` is preserved, so it keeps pointing at the conversation that created the doc rather than the last one to touch it.
12
-
13
- `+p+`
14
-
15
- `+y+`
16
-
17
- `+m+`
18
-
19
- `+h+`
20
-
21
- `+u+"\n\nCreate a document that does not exist yet with `crtr memory write`. Read the revisions back with `crtr memory history`.",params:[{kind:"positional",name:"name",required:!0,constraint:"Full canonical identity, resolved exactly in the target view or exact project store. A project document requires its complete `<namespace>/<local name>`; a directory document answers at the directory name, never with a trailing `/INDEX`. Same-store physical collisions are refused with both paths; `--dir` selects one exact project store. Builtin and installed-plugin docs are read-only corpora and are refused."},{kind:"flag",name:"rationale",type:"string",required:!0,constraint:"Why THIS REVISION is happening \u2014 the audit-trail entry, required on every edit. Recorded in the document\u2019s revision history, NEVER written into the document. To change the doc\u2019s standing `rationale` frontmatter field instead, use --doc-rationale."},{kind:"flag",name:"verbatim",type:"bool",required:!1,constraint:"Declares the piped body a verbatim payload from the principal \u2014 their own text, relayed unchanged \u2014 rather than agent-authored prose. Pure provenance recorded in the history record; the save path is identical either way, because there is only one save path and it never transforms."},e("kind"),e("privacy"),e("when-and-why-to-read"),e("short-form"),e("unlisted",{},"Presence SETS the field; remove it with `--unset unlisted`."),e("surface"),e("gate"),e("lint-ignore"),e("slash",{},"Presence SETS the field; remove it with `--unset slash`."),{kind:"flag",name:"doc-rationale",type:"string",required:!1,constraint:c},{kind:"flag",name:"extension",type:"string",required:!1,repeatable:!0,constraint:"Set one declared plugin field as `extensions.<plugin>.<field>=VALUE`. The path is required in full; booleans accept only true or false, numbers require finite numeric syntax, and strings/enums preserve the literal text after the first =. Every requested field validates before the document is revised."},{kind:"flag",name:"unset-extension",type:"string",required:!1,repeatable:!0,constraint:"Remove one explicitly persisted declared field by its full `extensions.<plugin>.<field>` path. A removed explicit value lets its declaration default apply only in structured output."},{kind:"flag",name:"unset",type:"string",required:!1,repeatable:!0,constraint:`Remove a frontmatter field. One field per occurrence. ${f.join(", ")} are always accepted, whether or not the doc currently carries them. Any other field name is accepted only when the target document's frontmatter already carries it \u2014 this is the path for dropping a legacy or otherwise non-canonical field (e.g. a stale \`name:\` or \`description:\` left over from before \`when-and-why-to-read\`). Requesting a field the doc does not have fails, naming the fields it does have. \`${g.join("`, `")}\` are never clearable.`},n("scope-read",{},"Edit resolves the address winner and refuses same-store physical collisions."),n("dir"),n("profile"),{kind:"stdin",name:"body",required:!1,constraint:"Full replacement body (markdown, no frontmatter), saved byte for byte. Piped on stdin only \u2014 this leaf already claims the one positional for NAME. Absent or empty stdin leaves the existing body untouched, which is how a frontmatter-only revision is made."}],output:[{name:"name",type:"string",required:!0,constraint:"Resolved document name."},{name:"kind",type:"string",required:!0,constraint:"Kind recorded in frontmatter after the revision."},{name:"scope",type:"string",required:!0,constraint:"Scope the document was revised in: node, project, profile, or user."},{name:"path",type:"string",required:!0,constraint:"Absolute path to the revised document."},{name:"revision",type:"number",required:!0,constraint:"This document\u2019s record count after the append \u2014 the revision number to pass to `crtr memory history --revision`."},{name:"changed",type:"string[]",required:!0,constraint:"`body` when the body text changed, plus the frontmatter field names whose values changed. `last-updated` is excluded \u2014 it is stamped on every edit, so naming it says nothing."}],outputKind:"object",effects:["Rewrites the selected physical memory document and appends one `edit` record to its mirrored `.history` sidecar."]},effectiveHelp:r(async()=>{const t=await s("edit");return{...v.help,dynamicState:r(()=>t,"dynamicState")}},"effectiveHelp"),run:r(async t=>d("PATCH",`/v1/memory/docs/${encodeURIComponent(t.name)}`,{...l(t),mode:"cli",fields:t}),"run")});export{v as editLeaf};
@@ -1 +0,0 @@
1
- export declare const findLeaf: import("../../core/command.js").LeafDef;
@@ -1 +0,0 @@
1
- var f=Object.defineProperty;var o=(e,t)=>f(e,"name",{value:t,configurable:!0});import{defineLeaf as g}from"../../core/command.js";import{usage as w}from"../../core/errors.js";import{memoryRequest as b,memorySelection as v}from"./client.js";import{MEMORY_KINDS as k,selectorParam as s}from"./shared.js";const A=g({name:"find",description:"relevance search across memory documents",whenToUse:"the discovery surface when you do NOT know a document\u2019s canonical name \u2014 ranks documents by relevance over the canonical name, the store-local name, the physical path, the read-routing line, and short-form (add --body to also weigh body text), and every hit reports the canonical name `crtr memory read` takes. Searches every scope by default regardless of any visibility gate; --scope narrows to one class of store, --dir to one exact store. Reach for `crtr memory list` instead when you want the whole inventory rather than a topic match, and --grep when you need an exact regex or literal-string match across document bodies.",help:{name:"memory find",summary:"bounded relevance search across memory documents, weighted over name/local name/physical path/routing-line/short-form (and body with --body)",params:[{kind:"positional",name:"query",required:!0,constraint:"With ranked search (default): whitespace-separated terms, matched case-insensitively and weighted over the document\u2019s names (canonical, store-local, and physical path), the read-routing line, and short-form (plus body with --body); documents matching more/stronger fields rank higher. By default returns at most 10 hits scoring at least half the top score. With --grep: an ECMAScript regex applied to each document body line."},{kind:"flag",name:"kind",type:"enum",choices:[...k],required:!1,constraint:"Filter to a single kind. Default: all kinds."},s("scope-read",{},"Default: every resolved scope, builtin included."),s("dir",{},"Searches that store alone, and searches it physically: two documents sharing one canonical name are both searched and both reported, where the default view searches only the winner."),{kind:"flag",name:"grep",type:"bool",required:!1,constraint:"Treat the query as an ECMAScript regex and match it against document bodies, instead of weighted relevance ranking. Mutually exclusive with --body."},{kind:"flag",name:"body",type:"bool",required:!1,constraint:"Also weigh document body text in the relevance ranking (in addition to name/when/why/short-form). Ignored under --grep, which always scans bodies."},{kind:"flag",name:"limit",type:"int",required:!1,constraint:"Maximum hits to return per page after relevance filtering. Default 10, hard max 100."},{kind:"flag",name:"cursor",type:"string",required:!1,constraint:"Opaque token from next_cursor. Omit on first call."},{kind:"flag",name:"min-score",type:"int",required:!1,constraint:"Ranked mode only. Minimum score to return, replacing the default adaptive floor of half the top score. Must be at least 1."},{kind:"flag",name:"paths",type:"bool",required:!1,constraint:"Include each hit\u2019s physical location \u2014 absolute path, store root, store-relative path, and every other physical document sharing its canonical name. Off by default; the canonical name is sufficient for `crtr memory read <name>`."}],output:[{name:"query",type:"string",required:!0,constraint:"Echo of the input query."},{name:"matches",type:"integer",required:!0,constraint:"Total matches before the default relevance floor and limit are applied (ranked mode) or total matching lines (grep mode) \u2014 across all pages, not just this one."},{name:"hits",type:"object[]",required:!0,constraint:"Ranked mode \u2014 each: {name, kind, privacy, scope, score, short_form}, sorted by score descending. Grep mode \u2014 each: {name, privacy, scope, line, text}, sorted by name then line. `name` is always the canonical name, whatever field matched. With --paths, each shape also carries path, store_root, physical_relative_path, and candidates when several physical documents share the name. Paginated via --limit/--cursor."},{name:"next_cursor",type:"string | null",required:!0,constraint:"Opaque token for the next page; null means no more items."},{name:"follow_up",type:"string",required:!0,constraint:"Concrete next commands for reading a hit in full or refining the search."}],outputKind:"object",effects:["Records this search page as listing context for the current node without marking any matched document as loaded."]},run:o(async e=>{const t=e.query,i=e.kind,c=e.grep,d=e.body,a=e.limit,l=e.cursor,h=e.minScore,m=e.paths;if(a!==void 0&&(a<1||a>100))throw w("--limit must be between 1 and 100.");const u=a??10,n=await b("POST","/v1/memory/search",{...v(e),mode:"cli",query:t,...i===void 0?{}:{kind:i},grep:c,body:d,limit:u,cursor:l,min_score:h}),y=o(r=>{const{path:q,store_root:x,physical_relative_path:_,candidates:R,...p}=r;return p},"omitPaths");return{query:t,matches:n.matches,hits:n.hits.map(r=>m?r:y(r)),next_cursor:n.next_cursor,follow_up:"Read a hit with `crtr memory read <name>`. Run `crtr memory find -h` for filters and verbosity."}},"run")});export{A as findLeaf};
@@ -1 +0,0 @@
1
- export declare const historyLeaf: import("../../core/command.js").LeafDef;