@north-light/crouter 0.3.353 → 0.3.355

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 (626) 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 +135 -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 +168 -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 +11 -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/02-turn-lifecycle/02-resident.md +1 -0
  25. package/dist/builtin-memory/04-orchestration-kernel.md +10 -31
  26. package/dist/builtin-memory/05-kinds/advisor/01-orchestrator.md +1 -1
  27. package/dist/builtin-memory/05-kinds/explore/00-base.md +2 -2
  28. package/dist/builtin-memory/05-kinds/explore/01-orchestrator.md +2 -2
  29. package/dist/builtin-memory/crouter-concepts/INDEX.md +2 -2
  30. package/dist/builtin-memory/crouter-concepts/lifecycle-and-wakes.md +1 -1
  31. package/dist/builtin-memory/crouter-concepts/memory.md +15 -15
  32. package/dist/builtin-memory/crouter-concepts/nodes-and-the-canvas.md +1 -1
  33. package/dist/builtin-memory/crouter-concepts/profiles-kinds-and-modes.md +5 -5
  34. package/dist/builtin-memory/crouter-concepts/scopes-and-trust.md +1 -1
  35. package/dist/builtin-memory/crouter-concepts/why-a-daemon.md +1 -1
  36. package/dist/builtin-memory/crouter-sdk/INDEX.md +2 -2
  37. package/dist/builtin-memory/crouter-sdk/README.md +5 -6
  38. package/dist/builtin-memory/crouter-sdk/errors.md +0 -13
  39. package/dist/builtin-memory/crouter-sdk/guides/README.md +0 -1
  40. package/dist/builtin-memory/crouter-sdk/guides/event-driven-assistant.md +2 -2
  41. package/dist/builtin-memory/crouter-sdk/nodes.md +0 -2
  42. package/dist/builtin-memory/crouter-sdk/resources.md +0 -1
  43. package/dist/builtin-memory/explore/exploration-doc.md +4 -4
  44. package/dist/builtin-memory/insights/capture.md +6 -6
  45. package/dist/builtin-memory/insights/init.md +14 -14
  46. package/dist/builtin-memory/internal/INDEX.md +4 -4
  47. package/dist/builtin-memory/internal/agent-shaping.md +20 -20
  48. package/dist/builtin-memory/internal/examples/imessage-assistant.md +2 -2
  49. package/dist/builtin-memory/internal/marketplaces.md +2 -2
  50. package/dist/builtin-memory/internal/memory-loading.md +31 -30
  51. package/dist/builtin-memory/internal/nodes-and-canvas.md +1 -1
  52. package/dist/builtin-memory/internal/plugins.md +16 -14
  53. package/dist/builtin-memory/internal/storage-tiers.md +4 -4
  54. package/dist/builtin-memory/memory-read-orientation.md +1 -1
  55. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/memory-slash-commands.ts +32 -40
  56. package/dist/clients/attach/input/controller.js +1 -1
  57. package/dist/clients/attach/input/ref-autocomplete.js +1 -1
  58. package/dist/clients/attach/input/titled-editor.js +1 -1
  59. package/dist/clients/attach/overlays/file-review.d.ts +1 -0
  60. package/dist/clients/attach/overlays/file-review.js +2 -2
  61. package/dist/clients/attach/render/chat-view.d.ts +6 -0
  62. package/dist/clients/attach/render/chat-view.js +2 -2
  63. package/dist/clients/attach/render/crtr-output.d.ts +1 -2
  64. package/dist/clients/attach/render/crtr-output.js +17 -17
  65. package/dist/clients/attach/render/doc-links.d.ts +34 -0
  66. package/dist/clients/attach/render/doc-links.js +1 -0
  67. package/dist/clients/attach/render/group-activity.d.ts +8 -8
  68. package/dist/clients/attach/render/group-activity.js +2 -2
  69. package/dist/clients/attach/render/group-recap.js +1 -1
  70. package/dist/clients/attach/render/markdown-source.js +5 -5
  71. package/dist/clients/attach/render/tool-calls.d.ts +1 -1
  72. package/dist/clients/attach/session/doc-materialize.d.ts +53 -0
  73. package/dist/clients/attach/session/doc-materialize.js +3 -0
  74. package/dist/clients/attach/session/document-links.d.ts +21 -0
  75. package/dist/clients/attach/session/document-links.js +1 -0
  76. package/dist/clients/attach/session/file-links.d.ts +2 -0
  77. package/dist/clients/attach/session/file-links.js +1 -1
  78. package/dist/clients/attach/session/profile-files.js +1 -1
  79. package/dist/clients/attach/slash/dispatch.js +1 -1
  80. package/dist/clients/attach/viewer.js +816 -1561
  81. package/dist/clients/inbox/review/review-client.d.ts +5 -1
  82. package/dist/clients/inbox/review/review-client.js +1 -1
  83. package/dist/commands/api-client.d.ts +2 -0
  84. package/dist/commands/api-client.js +3 -3
  85. package/dist/commands/canvas/edges.d.ts +2 -0
  86. package/dist/commands/canvas/edges.js +2 -0
  87. package/dist/commands/canvas/list.d.ts +4 -0
  88. package/dist/commands/canvas/list.js +3 -0
  89. package/dist/commands/canvas/read.d.ts +8 -0
  90. package/dist/commands/canvas/read.js +5 -0
  91. package/dist/commands/canvas/search.d.ts +2 -0
  92. package/dist/commands/canvas/search.js +3 -0
  93. package/dist/commands/canvas/unwatch.d.ts +2 -0
  94. package/dist/commands/canvas/unwatch.js +1 -0
  95. package/dist/commands/canvas/watch.d.ts +3 -0
  96. package/dist/commands/canvas/watch.js +1 -0
  97. package/dist/commands/canvas-analytics.js +1 -1
  98. package/dist/commands/canvas-history/grep.js +4 -4
  99. package/dist/commands/canvas-history/read.js +2 -2
  100. package/dist/commands/canvas-history/search.js +7 -7
  101. package/dist/commands/canvas-history/shared.d.ts +0 -1
  102. package/dist/commands/canvas-history/shared.js +1 -1
  103. package/dist/commands/canvas-history/stats.js +2 -2
  104. package/dist/commands/canvas-history.js +1 -1
  105. package/dist/commands/canvas.js +1 -1
  106. package/dist/commands/doc/delete.d.ts +2 -0
  107. package/dist/commands/doc/delete.js +1 -0
  108. package/dist/commands/doc/edit.d.ts +2 -0
  109. package/dist/commands/doc/edit.js +1 -0
  110. package/dist/commands/doc/history.d.ts +2 -0
  111. package/dist/commands/doc/history.js +2 -0
  112. package/dist/commands/doc/lint.d.ts +2 -0
  113. package/dist/commands/doc/lint.js +2 -0
  114. package/dist/commands/doc/list.d.ts +2 -0
  115. package/dist/commands/doc/list.js +1 -0
  116. package/dist/commands/doc/move.d.ts +2 -0
  117. package/dist/commands/doc/move.js +1 -0
  118. package/dist/commands/doc/read.d.ts +2 -0
  119. package/dist/commands/doc/read.js +1 -0
  120. package/dist/commands/doc/shared.d.ts +25 -0
  121. package/dist/commands/doc/shared.js +2 -0
  122. package/dist/commands/doc/write.d.ts +2 -0
  123. package/dist/commands/doc/write.js +1 -0
  124. package/dist/commands/{memory.d.ts → doc.d.ts} +1 -1
  125. package/dist/commands/doc.js +1 -0
  126. package/dist/commands/human/review.js +1 -1
  127. package/dist/commands/node/bash.js +2 -2
  128. package/dist/commands/node/create.js +1 -1
  129. package/dist/commands/node/inspect.js +10 -10
  130. package/dist/commands/node/lifecycle.js +2 -2
  131. package/dist/commands/node/outcome.js +1 -1
  132. package/dist/commands/node/subscription.js +1 -1
  133. package/dist/commands/node-context.js +2 -2
  134. package/dist/commands/pkg/browse/catalog.js +1 -1
  135. package/dist/commands/pkg/browse/doc-view.js +1 -1
  136. package/dist/commands/pkg/browse/model.d.ts +9 -17
  137. package/dist/commands/pkg/plugin-inspect.js +1 -1
  138. package/dist/commands/pkg/plugin-manage.d.ts +4 -8
  139. package/dist/commands/pkg/plugin-manage.js +15 -17
  140. package/dist/commands/profile/list.js +1 -1
  141. package/dist/commands/profile/new.js +1 -1
  142. package/dist/commands/profile/project.js +1 -1
  143. package/dist/commands/profile/show.js +1 -1
  144. package/dist/commands/push.js +3 -3
  145. package/dist/commands/sys/config.js +1 -1
  146. package/dist/commands/sys/context/admin/actions.d.ts +18 -43
  147. package/dist/commands/sys/context/admin/actions.js +1 -2
  148. package/dist/commands/sys/context/admin/detail-panel.d.ts +17 -25
  149. package/dist/commands/sys/context/admin/detail-panel.js +2 -1
  150. package/dist/commands/sys/context/admin/docs-panel.d.ts +7 -6
  151. package/dist/commands/sys/context/admin/docs-panel.js +1 -1
  152. package/dist/commands/sys/context/admin/list-view.d.ts +12 -12
  153. package/dist/commands/sys/context/admin/list-view.js +1 -1
  154. package/dist/commands/sys/context/admin/model.d.ts +96 -69
  155. package/dist/commands/sys/context/admin/model.js +1 -1
  156. package/dist/commands/sys/context/admin/rail-panel.d.ts +7 -5
  157. package/dist/commands/sys/context/admin/rail-panel.js +1 -1
  158. package/dist/commands/sys/context/admin/read-view.d.ts +10 -14
  159. package/dist/commands/sys/context/admin/read-view.js +1 -2
  160. package/dist/commands/sys/context/admin/shell.d.ts +26 -31
  161. package/dist/commands/sys/context/admin/shell.js +1 -1
  162. package/dist/commands/sys/context/admin.js +2 -2
  163. package/dist/commands/sys/context/doc.js +2 -3
  164. package/dist/commands/sys/context/expose.js +2 -2
  165. package/dist/commands/sys/context/prompt-review.js +4 -4
  166. package/dist/commands/sys/context/resolve.d.ts +92 -65
  167. package/dist/commands/sys/context/resolve.js +7 -9
  168. package/dist/commands/sys/context.js +1 -1
  169. package/dist/commands/sys/doctor.js +1 -1
  170. package/dist/commands/sys/migrate.js +1 -1
  171. package/dist/commands/sys/panels/profiles-panel.d.ts +3 -1
  172. package/dist/commands/sys/panels/profiles-panel.js +1 -1
  173. package/dist/commands/sys/sync-deps.d.ts +6 -11
  174. package/dist/commands/sys/sync-deps.js +7 -8
  175. package/dist/commands/sys/sync-project-guidance.js +5 -4
  176. package/dist/commands/sys/sync-shared.d.ts +41 -4
  177. package/dist/commands/sys/sync-shared.js +1 -1
  178. package/dist/commands/sys/sync-skills.js +2 -2
  179. package/dist/commands/sys/sync.js +1 -1
  180. package/dist/core/bash-job-supervisor.d.ts +2 -3
  181. package/dist/core/bash-job-supervisor.js +3 -3
  182. package/dist/core/bash-jobs.d.ts +0 -5
  183. package/dist/core/bash-jobs.js +7 -7
  184. package/dist/core/bootstrap.js +2 -2
  185. package/dist/core/canvas/canvas.d.ts +6 -50
  186. package/dist/core/canvas/canvas.js +16 -21
  187. package/dist/core/canvas/db.d.ts +4 -1
  188. package/dist/core/canvas/db.js +2 -2
  189. package/dist/core/canvas/history.d.ts +11 -39
  190. package/dist/core/canvas/history.js +9 -20
  191. package/dist/core/canvas/install-id.d.ts +2 -2
  192. package/dist/core/canvas/install-id.js +1 -1
  193. package/dist/core/canvas/memory-reads.d.ts +5 -0
  194. package/dist/core/canvas/memory-reads.js +1 -1
  195. package/dist/core/canvas/migrations.js +215 -41
  196. package/dist/core/canvas/node-agent-paths.js +1 -1
  197. package/dist/core/canvas/node-tokens.js +1 -1
  198. package/dist/core/canvas/paths.d.ts +0 -4
  199. package/dist/core/canvas/paths.js +1 -1
  200. package/dist/core/canvas/remote-canvas-source.d.ts +0 -1
  201. package/dist/core/canvas/remote-canvas-source.js +1 -1
  202. package/dist/core/canvas/render-source.d.ts +9 -6
  203. package/dist/core/canvas/render-source.js +6 -6
  204. package/dist/core/canvas/sessions.js +2 -2
  205. package/dist/core/canvas/source.d.ts +6 -0
  206. package/dist/core/canvas/tree.d.ts +29 -0
  207. package/dist/core/canvas/tree.js +12 -0
  208. package/dist/core/canvas/types.d.ts +0 -20
  209. package/dist/core/command-plugins/bundle.js +1 -1
  210. package/dist/core/config.d.ts +1 -1
  211. package/dist/core/conversation-store/listener.js +4 -2
  212. package/dist/core/feed/feed.d.ts +9 -7
  213. package/dist/core/feed/feed.js +3 -7
  214. package/dist/core/feed/inbox.d.ts +3 -5
  215. package/dist/core/feed/inbox.js +1 -10
  216. package/dist/core/feed/messages.d.ts +33 -6
  217. package/dist/core/feed/messages.js +10 -7
  218. package/dist/core/feed/reports.d.ts +10 -0
  219. package/dist/core/feed/reports.js +2 -0
  220. package/dist/core/grants/remove.js +1 -1
  221. package/dist/core/graph/access.d.ts +24 -0
  222. package/dist/core/graph/access.js +8 -0
  223. package/dist/core/graph/bodies.d.ts +6 -0
  224. package/dist/core/graph/bodies.js +1 -0
  225. package/dist/core/graph/deletion.d.ts +10 -0
  226. package/dist/core/graph/deletion.js +5 -0
  227. package/dist/core/graph/diff.d.ts +4 -0
  228. package/dist/core/graph/diff.js +4 -0
  229. package/dist/core/graph/documents.d.ts +167 -0
  230. package/dist/core/graph/documents.js +10 -0
  231. package/dist/core/graph/edges.d.ts +25 -0
  232. package/dist/core/graph/edges.js +1 -0
  233. package/dist/core/graph/events.d.ts +26 -0
  234. package/dist/core/graph/events.js +7 -0
  235. package/dist/core/graph/exposures.d.ts +53 -0
  236. package/dist/core/graph/exposures.js +4 -0
  237. package/dist/core/graph/jobs.d.ts +31 -0
  238. package/dist/core/graph/jobs.js +2 -0
  239. package/dist/core/graph/names.d.ts +30 -0
  240. package/dist/core/graph/names.js +3 -0
  241. package/dist/core/graph/objects.d.ts +55 -0
  242. package/dist/core/graph/objects.js +9 -0
  243. package/dist/core/graph/package-docs.d.ts +31 -0
  244. package/dist/core/graph/package-docs.js +5 -0
  245. package/dist/core/graph/package-files.d.ts +20 -0
  246. package/dist/core/graph/package-files.js +2 -0
  247. package/dist/core/graph/reader.d.ts +21 -0
  248. package/dist/core/graph/reader.js +3 -0
  249. package/dist/core/graph/repo-sync/exchange.d.ts +34 -0
  250. package/dist/core/graph/repo-sync/exchange.js +2 -0
  251. package/dist/core/graph/repo-sync/identity.d.ts +30 -0
  252. package/dist/core/graph/repo-sync/identity.js +1 -0
  253. package/dist/core/graph/repo-sync/index.d.ts +4 -0
  254. package/dist/core/graph/repo-sync/index.js +1 -0
  255. package/dist/core/graph/repo-sync/mirror.d.ts +30 -0
  256. package/dist/core/graph/repo-sync/mirror.js +6 -0
  257. package/dist/core/graph/repo-sync/ref-format.d.ts +76 -0
  258. package/dist/core/graph/repo-sync/ref-format.js +2 -0
  259. package/dist/core/graph/repo-sync/repos.d.ts +17 -0
  260. package/dist/core/graph/repo-sync/repos.js +3 -0
  261. package/dist/core/graph/repo-sync/sync.d.ts +42 -0
  262. package/dist/core/graph/repo-sync/sync.js +2 -0
  263. package/dist/core/graph/rules.d.ts +26 -0
  264. package/dist/core/graph/rules.js +3 -0
  265. package/dist/core/graph/spaces/app.d.ts +3 -0
  266. package/dist/core/graph/spaces/app.js +1 -0
  267. package/dist/core/graph/spaces/index.d.ts +19 -0
  268. package/dist/core/graph/spaces/index.js +1 -0
  269. package/dist/core/graph/spaces/person.d.ts +5 -0
  270. package/dist/core/graph/spaces/person.js +2 -0
  271. package/dist/core/graph/spaces/repo.d.ts +4 -0
  272. package/dist/core/graph/spaces/repo.js +1 -0
  273. package/dist/core/graph/types.d.ts +75 -0
  274. package/dist/core/graph/types.js +1 -0
  275. package/dist/core/graph/watches.d.ts +62 -0
  276. package/dist/core/graph/watches.js +18 -0
  277. package/dist/core/human/feedback-companion.js +1 -1
  278. package/dist/core/human/requests.d.ts +3 -1
  279. package/dist/core/human/requests.js +6 -6
  280. package/dist/core/inspector/model.js +2 -2
  281. package/dist/core/io.js +5 -5
  282. package/dist/core/layout-migrate/index.d.ts +24 -1
  283. package/dist/core/layout-migrate/index.js +4 -4
  284. package/dist/core/layout-migrate/paths.d.ts +4 -0
  285. package/dist/core/layout-migrate/paths.js +1 -1
  286. package/dist/core/layout-migrate/stored-paths.d.ts +7 -0
  287. package/dist/core/layout-migrate/stored-paths.js +11 -11
  288. package/dist/core/layout-migrate/stores.d.ts +19 -6
  289. package/dist/core/layout-migrate/stores.js +3 -4
  290. package/dist/core/manifest.d.ts +0 -2
  291. package/dist/core/manifest.js +1 -1
  292. package/dist/core/{memory/extensions.d.ts → plugin-extensions.d.ts} +9 -10
  293. package/dist/core/plugin-extensions.js +1 -0
  294. package/dist/core/preview-registry.d.ts +1 -1
  295. package/dist/core/preview-registry.js +3 -2
  296. package/dist/core/profiles/manifest.d.ts +7 -7
  297. package/dist/core/profiles/manifest.js +1 -1
  298. package/dist/core/profiles/select.js +3 -3
  299. package/dist/core/review/birth.js +1 -1
  300. package/dist/core/review/companion.js +1 -1
  301. package/dist/core/review/stage.d.ts +12 -1
  302. package/dist/core/review/stage.js +1 -1
  303. package/dist/core/review/store.d.ts +2 -0
  304. package/dist/core/review/store.js +1 -1
  305. package/dist/core/review/types.d.ts +7 -1
  306. package/dist/core/runs/events.js +1 -1
  307. package/dist/core/runs/operations.js +5 -5
  308. package/dist/core/runs/questions.js +2 -2
  309. package/dist/core/runtime/bearings-render.d.ts +13 -7
  310. package/dist/core/runtime/bearings-render.js +12 -12
  311. package/dist/core/runtime/bearings.d.ts +8 -18
  312. package/dist/core/runtime/bearings.js +7 -7
  313. package/dist/core/runtime/broker/daemon-ops.d.ts +7 -12
  314. package/dist/core/runtime/broker/daemon-ops.js +1 -1
  315. package/dist/core/runtime/broker/fault-retry.d.ts +2 -0
  316. package/dist/core/runtime/broker/fault-retry.js +1 -1
  317. package/dist/core/runtime/broker/frame-dispatch.d.ts +1 -1
  318. package/dist/core/runtime/broker/frame-memory-refs.d.ts +7 -2
  319. package/dist/core/runtime/broker/frame-memory-refs.js +1 -1
  320. package/dist/core/runtime/broker/inbox.d.ts +1 -4
  321. package/dist/core/runtime/broker/inbox.js +1 -10
  322. package/dist/core/runtime/broker/rebind.js +1 -1
  323. package/dist/core/runtime/broker/retry-card-elision.d.ts +7 -0
  324. package/dist/core/runtime/broker/retry-card-elision.js +1 -0
  325. package/dist/core/runtime/broker-extension-render.d.ts +0 -13
  326. package/dist/core/runtime/broker-extension-render.js +2 -4
  327. package/dist/core/runtime/broker-persona-guidance.js +3 -3
  328. package/dist/core/runtime/broker-protocol.d.ts +1 -1
  329. package/dist/core/runtime/broker.js +1 -1
  330. package/dist/core/runtime/close.d.ts +9 -4
  331. package/dist/core/runtime/close.js +1 -1
  332. package/dist/core/runtime/deliver-live.js +1 -1
  333. package/dist/core/runtime/kickoff.js +17 -19
  334. package/dist/core/runtime/launch-target.d.ts +7 -0
  335. package/dist/core/runtime/launch-target.js +1 -1
  336. package/dist/core/runtime/ledger.d.ts +10 -0
  337. package/dist/core/runtime/ledger.js +3 -0
  338. package/dist/core/runtime/lifecycle.js +2 -2
  339. package/dist/core/runtime/nodes.d.ts +10 -2
  340. package/dist/core/runtime/nodes.js +1 -1
  341. package/dist/core/runtime/outcome-document.d.ts +2 -2
  342. package/dist/core/runtime/outcome-document.js +1 -1
  343. package/dist/core/runtime/persona.js +2 -2
  344. package/dist/core/runtime/placement.js +1 -1
  345. package/dist/core/runtime/promote.d.ts +2 -2
  346. package/dist/core/runtime/promote.js +1 -1
  347. package/dist/core/runtime/prospective-inventory-cli.js +2 -2
  348. package/dist/core/runtime/recycle.js +1 -1
  349. package/dist/core/runtime/reopen.js +1 -1
  350. package/dist/core/runtime/revive.js +2 -2
  351. package/dist/core/runtime/roadmap.d.ts +20 -9
  352. package/dist/core/runtime/roadmap.js +10 -6
  353. package/dist/core/runtime/spawn-env.js +1 -1
  354. package/dist/core/runtime/spawn.d.ts +5 -3
  355. package/dist/core/runtime/spawn.js +2 -2
  356. package/dist/core/runtime/structured-output.d.ts +3 -1
  357. package/dist/core/runtime/structured-output.js +4 -4
  358. package/dist/core/scope.d.ts +1 -32
  359. package/dist/core/scope.js +1 -1
  360. package/dist/core/scoped-state/db.js +2 -1
  361. package/dist/core/scoped-state/migrate.js +2 -2
  362. package/dist/core/scoped-state/profiles.d.ts +11 -0
  363. package/dist/core/scoped-state/profiles.js +1 -1
  364. package/dist/core/scoped-state/schema.d.ts +1 -1
  365. package/dist/core/scoped-state/schema.js +7 -5
  366. package/dist/core/spaces/permissions.d.ts +0 -14
  367. package/dist/core/spaces/permissions.js +1 -1
  368. package/dist/core/spaces/stop.d.ts +13 -0
  369. package/dist/core/spaces/stop.js +2 -2
  370. package/dist/core/storage/tables.d.ts +1 -1
  371. package/dist/core/substrate/delivery/corpus.d.ts +21 -0
  372. package/dist/core/substrate/delivery/corpus.js +3 -0
  373. package/dist/core/substrate/delivery/deliver.d.ts +76 -0
  374. package/dist/core/substrate/delivery/deliver.js +6 -0
  375. package/dist/core/substrate/delivery/listings.d.ts +30 -0
  376. package/dist/core/substrate/delivery/listings.js +7 -0
  377. package/dist/core/substrate/delivery/match.d.ts +28 -0
  378. package/dist/core/substrate/delivery/match.js +1 -0
  379. package/dist/core/substrate/delivery/plan.d.ts +67 -0
  380. package/dist/core/substrate/delivery/plan.js +3 -0
  381. package/dist/core/substrate/delivery/render-boot.d.ts +20 -0
  382. package/dist/core/substrate/delivery/render-boot.js +54 -0
  383. package/dist/core/substrate/delivery/render-event.d.ts +54 -0
  384. package/dist/core/substrate/delivery/render-event.js +8 -0
  385. package/dist/core/substrate/delivery/sub-persona-menu.d.ts +2 -0
  386. package/dist/core/substrate/delivery/sub-persona-menu.js +6 -0
  387. package/dist/core/substrate/delivery/types.d.ts +30 -0
  388. package/dist/core/substrate/delivery/types.js +0 -0
  389. package/dist/core/substrate/gate-explain.d.ts +0 -13
  390. package/dist/core/substrate/gate-explain.js +1 -1
  391. package/dist/core/substrate/schema.d.ts +11 -139
  392. package/dist/core/substrate/schema.js +1 -1
  393. package/dist/core/substrate/subject-fields.d.ts +3 -0
  394. package/dist/core/substrate/subject.d.ts +2 -1
  395. package/dist/core/substrate/subject.js +1 -1
  396. package/dist/daemon/api/handlers/app-profiles.js +1 -1
  397. package/dist/daemon/api/handlers/bash-jobs.js +1 -2
  398. package/dist/daemon/api/handlers/broker-ops.js +1 -1
  399. package/dist/daemon/api/handlers/canvas.js +5 -5
  400. package/dist/daemon/api/handlers/daemon.js +1 -1
  401. package/dist/daemon/api/handlers/delivery.d.ts +2 -0
  402. package/dist/daemon/api/handlers/delivery.js +1 -0
  403. package/dist/daemon/api/handlers/{memory.d.ts → docs.d.ts} +1 -1
  404. package/dist/daemon/api/handlers/docs.js +1 -0
  405. package/dist/daemon/api/handlers/hook-exec.js +1 -1
  406. package/dist/daemon/api/handlers/messages.js +2 -2
  407. package/dist/daemon/api/handlers/node-records.js +2 -2
  408. package/dist/daemon/api/handlers/nodes.js +1 -1
  409. package/dist/daemon/api/handlers/objects.d.ts +2 -0
  410. package/dist/daemon/api/handlers/objects.js +5 -0
  411. package/dist/daemon/api/handlers/package-docs.d.ts +2 -0
  412. package/dist/daemon/api/handlers/package-docs.js +1 -0
  413. package/dist/daemon/api/handlers/profiles.js +1 -1
  414. package/dist/daemon/api/handlers/reports.d.ts +2 -2
  415. package/dist/daemon/api/handlers/reports.js +4 -4
  416. package/dist/daemon/api/handlers/reviews.d.ts +4 -1
  417. package/dist/daemon/api/handlers/reviews.js +1 -1
  418. package/dist/daemon/api/map.d.ts +2 -2
  419. package/dist/daemon/api/map.js +2 -2
  420. package/dist/daemon/api/operations.d.ts +1 -1
  421. package/dist/daemon/api/operations.js +1 -1
  422. package/dist/daemon/api/reader.d.ts +17 -0
  423. package/dist/daemon/api/reader.js +1 -0
  424. package/dist/daemon/api/server.js +1 -1
  425. package/dist/daemon/control.d.ts +2 -3
  426. package/dist/daemon/crtrd.js +8 -6
  427. package/dist/daemon/fleet.js +4 -4
  428. package/dist/daemon/reconcilers/bash-deadline.d.ts +11 -1
  429. package/dist/daemon/reconcilers/bash-deadline.js +2 -1
  430. package/dist/daemon/reconcilers/broker-supervision.js +4 -4
  431. package/dist/daemon/reconcilers/live-obligation.js +1 -1
  432. package/dist/daemon/reconcilers/node-deadline.js +1 -1
  433. package/dist/daemon/reconcilers/node-lifecycle/freeze-lane.js +1 -1
  434. package/dist/daemon/reconcilers/storage-maintenance.d.ts +1 -0
  435. package/dist/daemon/reconcilers/storage-maintenance.js +1 -1
  436. package/dist/daemon/review/deliver.js +2 -2
  437. package/dist/daemon/review/finish.js +1 -1
  438. package/dist/hook-authoring.d.ts +0 -1
  439. package/dist/hook-authoring.js +3 -3
  440. package/dist/migrations/004-canvas-documents/apply.d.ts +10 -0
  441. package/dist/migrations/004-canvas-documents/apply.js +1 -0
  442. package/dist/migrations/004-canvas-documents/fields.d.ts +24 -0
  443. package/dist/migrations/004-canvas-documents/fields.js +2 -0
  444. package/dist/migrations/004-canvas-documents/index.d.ts +16 -0
  445. package/dist/migrations/004-canvas-documents/index.js +2 -0
  446. package/dist/migrations/004-canvas-documents/legacy/discover.d.ts +16 -0
  447. package/dist/migrations/004-canvas-documents/legacy/discover.js +1 -0
  448. package/dist/migrations/004-canvas-documents/legacy/history.d.ts +5 -0
  449. package/dist/migrations/004-canvas-documents/legacy/history.js +2 -0
  450. package/dist/migrations/004-canvas-documents/legacy/nested.d.ts +7 -0
  451. package/dist/migrations/004-canvas-documents/legacy/nested.js +1 -0
  452. package/dist/migrations/004-canvas-documents/legacy/parse.d.ts +14 -0
  453. package/dist/migrations/004-canvas-documents/legacy/parse.js +1 -0
  454. package/dist/migrations/004-canvas-documents/legacy/types.d.ts +91 -0
  455. package/dist/migrations/004-canvas-documents/legacy/types.js +0 -0
  456. package/dist/migrations/004-canvas-documents/legacy-edges.d.ts +6 -0
  457. package/dist/migrations/004-canvas-documents/legacy-edges.js +18 -0
  458. package/dist/migrations/004-canvas-documents/plan.d.ts +102 -0
  459. package/dist/migrations/004-canvas-documents/plan.js +3 -0
  460. package/dist/migrations/004-canvas-documents/pointers.d.ts +23 -0
  461. package/dist/migrations/004-canvas-documents/pointers.js +4 -0
  462. package/dist/migrations/activation.d.ts +9 -18
  463. package/dist/migrations/activation.js +2 -2
  464. package/dist/pi-extensions/broker-local.d.ts +2 -2
  465. package/dist/pi-extensions/broker-local.js +2 -2
  466. package/dist/pi-extensions/canvas-bash-valve.js +5 -4
  467. package/dist/pi-extensions/canvas-context-intro.js +2 -2
  468. package/dist/pi-extensions/canvas-doc-substrate.d.ts +0 -1
  469. package/dist/pi-extensions/canvas-doc-substrate.js +6 -6
  470. package/dist/pi-extensions/canvas-inbox-watcher.js +2 -2
  471. package/dist/pi-extensions/canvas-passive-context.js +1 -1
  472. package/dist/pi-extensions/canvas-recap.js +2 -2
  473. package/dist/pi-extensions/canvas-stophook.d.ts +1 -1
  474. package/dist/pi-extensions/canvas-stophook.js +1 -1
  475. package/dist/prompts/review.js +3 -3
  476. package/dist/shared/env.d.ts +5 -0
  477. package/dist/shared/env.js +1 -1
  478. package/dist/shared/generated-context.js +2 -10
  479. package/dist/shared/inbox-entry-body.d.ts +22 -0
  480. package/dist/shared/inbox-entry-body.js +10 -0
  481. package/dist/{core/memory → shared}/inline-ref-guidance.d.ts +2 -2
  482. package/dist/shared/inline-ref-guidance.js +2 -0
  483. package/dist/types.d.ts +3 -1
  484. package/docs/cli/memory-and-preferences.md +12 -14
  485. package/docs/concepts/README.md +1 -1
  486. package/docs/concepts/lifecycle-and-wakes.md +1 -1
  487. package/docs/concepts/memory.md +15 -15
  488. package/docs/concepts/nodes-and-the-canvas.md +1 -1
  489. package/docs/concepts/profiles-kinds-and-modes.md +5 -5
  490. package/docs/concepts/scopes-and-trust.md +1 -1
  491. package/docs/concepts/why-a-daemon.md +1 -1
  492. package/docs/sdk/README.md +5 -6
  493. package/docs/sdk/errors.md +0 -13
  494. package/docs/sdk/guides/README.md +0 -1
  495. package/docs/sdk/nodes.md +0 -2
  496. package/docs/sdk/resources.md +0 -1
  497. package/package.json +2 -2
  498. package/packages/crouter-identity/package.json +1 -1
  499. package/runtime.lock.json +11 -11
  500. package/scripts/lib/isolation-env.mjs +8 -2
  501. package/dist/api/dto/memory.d.ts +0 -171
  502. package/dist/api/dto/memory.js +0 -1
  503. package/dist/builtin-memory/crouter-sdk/guides/app-memory.md +0 -73
  504. package/dist/builtin-memory/crouter-sdk/memory.md +0 -87
  505. package/dist/commands/broker-permissions.d.ts +0 -2
  506. package/dist/commands/broker-permissions.js +0 -1
  507. package/dist/commands/memory/client.d.ts +0 -11
  508. package/dist/commands/memory/client.js +0 -1
  509. package/dist/commands/memory/delete.d.ts +0 -1
  510. package/dist/commands/memory/delete.js +0 -1
  511. package/dist/commands/memory/edit.d.ts +0 -1
  512. package/dist/commands/memory/edit.js +0 -21
  513. package/dist/commands/memory/find.d.ts +0 -1
  514. package/dist/commands/memory/find.js +0 -1
  515. package/dist/commands/memory/history.d.ts +0 -1
  516. package/dist/commands/memory/history.js +0 -5
  517. package/dist/commands/memory/lint.d.ts +0 -1
  518. package/dist/commands/memory/lint.js +0 -1
  519. package/dist/commands/memory/list.d.ts +0 -1
  520. package/dist/commands/memory/list.js +0 -1
  521. package/dist/commands/memory/move.d.ts +0 -1
  522. package/dist/commands/memory/move.js +0 -1
  523. package/dist/commands/memory/origin.d.ts +0 -1
  524. package/dist/commands/memory/origin.js +0 -1
  525. package/dist/commands/memory/read.d.ts +0 -1
  526. package/dist/commands/memory/read.js +0 -6
  527. package/dist/commands/memory/shared.d.ts +0 -22
  528. package/dist/commands/memory/shared.js +0 -1
  529. package/dist/commands/memory/write.d.ts +0 -1
  530. package/dist/commands/memory/write.js +0 -13
  531. package/dist/commands/memory.js +0 -1
  532. package/dist/commands/node-inspect-artifacts.d.ts +0 -1
  533. package/dist/commands/node-inspect-artifacts.js +0 -8
  534. package/dist/core/help/memory-extensions.d.ts +0 -3
  535. package/dist/core/help/memory-extensions.js +0 -2
  536. package/dist/core/memory/cli-selector.d.ts +0 -13
  537. package/dist/core/memory/cli-selector.js +0 -1
  538. package/dist/core/memory/doc-link-grammar.d.ts +0 -20
  539. package/dist/core/memory/doc-link-grammar.js +0 -2
  540. package/dist/core/memory/extensions.js +0 -1
  541. package/dist/core/memory/history.d.ts +0 -87
  542. package/dist/core/memory/history.js +0 -6
  543. package/dist/core/memory/identity.d.ts +0 -65
  544. package/dist/core/memory/identity.js +0 -1
  545. package/dist/core/memory/inline-ref-guidance.js +0 -2
  546. package/dist/core/memory/inline-ref-inventory.d.ts +0 -9
  547. package/dist/core/memory/inline-ref-inventory.js +0 -1
  548. package/dist/core/memory/lint.d.ts +0 -163
  549. package/dist/core/memory/lint.js +0 -2
  550. package/dist/core/memory/mutation-domain.d.ts +0 -113
  551. package/dist/core/memory/mutation-domain.js +0 -12
  552. package/dist/core/memory/mutations.d.ts +0 -74
  553. package/dist/core/memory/mutations.js +0 -1
  554. package/dist/core/memory/project-namespace.d.ts +0 -31
  555. package/dist/core/memory/project-namespace.js +0 -2
  556. package/dist/core/memory/repository-association.d.ts +0 -31
  557. package/dist/core/memory/repository-association.js +0 -1
  558. package/dist/core/memory/service.d.ts +0 -145
  559. package/dist/core/memory/service.js +0 -2
  560. package/dist/core/memory/tree.d.ts +0 -39
  561. package/dist/core/memory/tree.js +0 -1
  562. package/dist/core/memory-resolver.d.ts +0 -280
  563. package/dist/core/memory-resolver.js +0 -2
  564. package/dist/core/nested-stores.d.ts +0 -18
  565. package/dist/core/nested-stores.js +0 -1
  566. package/dist/core/runtime/memory.d.ts +0 -3
  567. package/dist/core/runtime/memory.js +0 -1
  568. package/dist/core/substrate/frontmatter-validation.d.ts +0 -11
  569. package/dist/core/substrate/frontmatter-validation.js +0 -1
  570. package/dist/core/substrate/gate.d.ts +0 -16
  571. package/dist/core/substrate/gate.js +0 -1
  572. package/dist/core/substrate/index.d.ts +0 -18
  573. package/dist/core/substrate/index.js +0 -1
  574. package/dist/core/substrate/injected-store.d.ts +0 -75
  575. package/dist/core/substrate/injected-store.js +0 -2
  576. package/dist/core/substrate/listings.d.ts +0 -28
  577. package/dist/core/substrate/listings.js +0 -1
  578. package/dist/core/substrate/memory-events.d.ts +0 -6
  579. package/dist/core/substrate/memory-events.js +0 -1
  580. package/dist/core/substrate/on-read-node.d.ts +0 -6
  581. package/dist/core/substrate/on-read-node.js +0 -1
  582. package/dist/core/substrate/on-read.d.ts +0 -101
  583. package/dist/core/substrate/on-read.js +0 -9
  584. package/dist/core/substrate/plan.d.ts +0 -94
  585. package/dist/core/substrate/plan.js +0 -1
  586. package/dist/core/substrate/render-node.d.ts +0 -12
  587. package/dist/core/substrate/render-node.js +0 -1
  588. package/dist/core/substrate/render.d.ts +0 -41
  589. package/dist/core/substrate/render.js +0 -65
  590. package/dist/core/substrate/session-cache.d.ts +0 -27
  591. package/dist/core/substrate/session-cache.js +0 -1
  592. package/dist/core/substrate/surface-match.d.ts +0 -73
  593. package/dist/core/substrate/surface-match.js +0 -1
  594. package/dist/daemon/api/handlers/memory.js +0 -5
  595. package/dist/migrations/001-surfaces-frontmatter.d.ts +0 -2
  596. package/dist/migrations/001-surfaces-frontmatter.js +0 -1
  597. package/dist/migrations/002-profile-project-memory.d.ts +0 -2
  598. package/dist/migrations/002-profile-project-memory.js +0 -1
  599. package/dist/migrations/003-repository-root-memory-identity/front-door.d.ts +0 -26
  600. package/dist/migrations/003-repository-root-memory-identity/front-door.js +0 -11
  601. package/dist/migrations/003-repository-root-memory-identity/index.d.ts +0 -2
  602. package/dist/migrations/003-repository-root-memory-identity/index.js +0 -5
  603. package/dist/migrations/003-repository-root-memory-identity/references.d.ts +0 -95
  604. package/dist/migrations/003-repository-root-memory-identity/references.js +0 -5
  605. package/dist/migrations/003-repository-root-memory-identity/repository-facts.d.ts +0 -39
  606. package/dist/migrations/003-repository-root-memory-identity/repository-facts.js +0 -3
  607. package/dist/migrations/convergent.d.ts +0 -43
  608. package/dist/migrations/convergent.js +0 -2
  609. package/dist/migrations/corpus.d.ts +0 -75
  610. package/dist/migrations/corpus.js +0 -3
  611. package/dist/migrations/frontmatter-splice.d.ts +0 -15
  612. package/dist/migrations/frontmatter-splice.js +0 -8
  613. package/dist/migrations/profile-manifests.d.ts +0 -30
  614. package/dist/migrations/profile-manifests.js +0 -2
  615. package/dist/migrations/registry.d.ts +0 -7
  616. package/dist/migrations/registry.js +0 -1
  617. package/dist/migrations/runner.d.ts +0 -43
  618. package/dist/migrations/runner.js +0 -1
  619. package/dist/migrations/types.d.ts +0 -211
  620. package/dist/shared/birth-announcement.d.ts +0 -12
  621. package/dist/shared/birth-announcement.js +0 -1
  622. package/docs/sdk/guides/app-memory.md +0 -22
  623. package/docs/sdk/memory.md +0 -85
  624. /package/dist/{migrations/types.js → api/dto/delivery.js} +0 -0
  625. /package/dist/{core/memory → shared}/inline-ref-grammar.d.ts +0 -0
  626. /package/dist/{core/memory → shared}/inline-ref-grammar.js +0 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Profiles, kinds, and modes
3
- description: When designing an agent run, read this because profiles, kinds, modes, and memory tiers solve different problems and prevent a long prompt from becoming an unstable substitute for an application identity.
3
+ description: When designing an agent run, read this because profiles, kinds, modes, and document owners solve different problems and prevent a long prompt from becoming an unstable substitute for an application identity.
4
4
  ---
5
5
 
6
6
  # Profiles, kinds, and modes
@@ -12,20 +12,20 @@ Shape a run by choosing the dial that owns the decision. The four dials are inde
12
12
  | Profile | Which application identity, project purview, environment, and profile memory apply? | An application or body of work has stable directories and conventions |
13
13
  | Kind | What standing role, model tier, tools, and expertise should the agent have? | The work matches a recurring role such as developer or reviewer |
14
14
  | Mode | Does this node work hands-on or coordinate independent children? | Parallel work makes coordination the main job |
15
- | Memory tier | Who should receive a document? | Guidance must reach one node, project, profile, user, or all crouter users |
15
+ | Document owner | Who should receive a document? | Guidance must reach one node, repo, profile, user, or all crouter users |
16
16
 
17
- A profile is not a label on a run. It is a stable agent identity with its own memory store and a purview of project directories. It lets an application create nodes from the same target context even if the caller runs elsewhere. Create a profile when an app has a durable set of directories, environment values, and conventions worth sharing. Do not make a profile for every repository or individual request. Use [`client.profiles`](../sdk/resources.md) and the SDK’s `profile` create field to select the application’s identity.
17
+ A profile is not a label on a run. It is a stable agent identity with its own documents and a purview of project directories. It lets an application create nodes from the same target context even if the caller runs elsewhere. Create a profile when an app has a durable set of directories, environment values, and conventions worth sharing. Do not make a profile for every repository or individual request. Use [`client.profiles`](../sdk/resources.md) and the SDK’s `profile` create field to select the application’s identity.
18
18
 
19
19
  ```mermaid
20
20
  flowchart LR
21
21
  Profile[Profile: purview, environment, memory] --> Node
22
22
  Kind[Kind: role and tools] --> Node
23
23
  Mode[Mode: base or orchestrator] --> Node
24
- Tier[Memory tier: reach] --> Node
24
+ Tier[Document owner: reach] --> Node
25
25
  ```
26
26
 
27
27
  A kind is a recurring role, not a decorative name. It carries a role-specific posture and may choose a suitable model tier and tools. A custom kind beats a long prompt when the role recurs and needs standing discipline that should survive every run: for example, an application’s compliance reviewer that always needs the same tools, expertise, and model choice. A one-off instruction belongs in the node’s prompt, where it does not create a permanent persona to maintain.
28
28
 
29
29
  Base mode is the normal choice: the node owns and performs the work, using a child only for a separable part. Promote to orchestrator only when independent parts can proceed in parallel and the benefits outweigh coordination and integration. A terminal orchestrator still finishes normally; residency is separate and belongs to a person-facing ongoing conversation.
30
30
 
31
- These choices keep the application prompt focused. Identity belongs in a profile, standing role in a kind, task-specific intent in the prompt, coordination in mode, and reusable knowledge in the narrowest memory tier. For the full selection rules, run `crtr memory read internal/agent-shaping`; [`nodes.create`](../sdk/nodes.md) documents the profile, kind, and mode fields an application passes.
31
+ These choices keep the application prompt focused. Identity belongs in a profile, standing role in a kind, task-specific intent in the prompt, coordination in mode, and reusable knowledge in the narrowest document owner. For the full selection rules, run `crtr canvas read internal/agent-shaping`; [`nodes.create`](../sdk/nodes.md) documents the profile, kind, and mode fields an application passes.
@@ -29,4 +29,4 @@ Scopes rely on a more basic trust boundary: `crtrd` is the sole writer of durabl
29
29
 
30
30
  For a browser or remote process, run `crtr sys connect`. It enables the daemon’s TCP listener when needed and returns `base_url` plus a bearer `token` to give the application. `crtr sys connect --scopes …` mints a new scoped token instead of returning the owner token. Treat either token as a credential: the remote app sends it as `Authorization: Bearer <token>`, and its scope list is the ceiling for scope-gated calls and newly created nodes.
31
31
 
32
- The remote API is an explicit boundary, not permission to reach around it. Keep application code on the SDK or `/v1` contract, and let the daemon own state transitions. Run `crtr memory read internal/nodes-and-canvas` for the operational ownership model.
32
+ The remote API is an explicit boundary, not permission to reach around it. Keep application code on the SDK or `/v1` contract, and let the daemon own state transitions. Run `crtr canvas read internal/nodes-and-canvas` for the operational ownership model.
@@ -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.355",
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.355",
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.355",
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.355",
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.355",
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.355",
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.355",
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.355",
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.355",
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.355",
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.355"
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.355",
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.355",
10918
+ "@north-light/crouter-identity": "^0.3.355",
10919
10919
  "jose": "^6.2.1"
10920
10920
  }
10921
10921
  }
@@ -1,6 +1,6 @@
1
1
  import { realpathSync } from 'node:fs';
2
2
  import { tmpdir, userInfo } from 'node:os';
3
- import { isAbsolute, relative, sep } from 'node:path';
3
+ import { basename, dirname, isAbsolute, join, relative, sep } from 'node:path';
4
4
 
5
5
  // A node's shell inherits broker identity and pi paths. Neither an installer
6
6
  // nor a test lane is that broker; nested processes must resolve their own roots.
@@ -15,6 +15,12 @@ export function scrubInheritedBrokerEnv(env = process.env) {
15
15
 
16
16
  // A normal host install uses the account HOME. When HOME is overridden, no
17
17
  // working directory or configured write root may still point into that account.
18
+ // A node's shell runs with HOME at its app-space home (`~/.crouter/apps/<app>/home`);
19
+ // that is the account acting through a node, not an isolated home.
20
+ function isAccountAppSpaceHome(home, accountHome) {
21
+ return basename(home) === 'home' && dirname(dirname(home)) === join(accountHome, '.crouter', 'apps');
22
+ }
23
+
18
24
  export function unsafeIsolationReason({ requireTemporaryHome = false, requireCrtrHome = false } = {}) {
19
25
  const inside = (home, target) => {
20
26
  const rel = relative(home, target);
@@ -23,7 +29,7 @@ export function unsafeIsolationReason({ requireTemporaryHome = false, requireCrt
23
29
  try {
24
30
  const home = realpathSync(process.env.HOME);
25
31
  const accountHome = realpathSync(userInfo().homedir);
26
- if (home === accountHome) return requireTemporaryHome ? 'HOME is the account home' : null;
32
+ if (home === accountHome || isAccountAppSpaceHome(home, accountHome)) return requireTemporaryHome ? 'HOME is the account home' : null;
27
33
  if (requireCrtrHome && !process.env.CRTR_HOME) return 'CRTR_HOME is missing';
28
34
  for (const [name, path] of [
29
35
  ['cwd', process.cwd()], ['TMPDIR', tmpdir()],
@@ -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;