@north-light/cli 0.0.0-stage → 0.3.413

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 (2511) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +182 -2
  3. package/bin/crouter +4 -0
  4. package/bin/crtr +4 -0
  5. package/bin/crtr-launcher +4 -0
  6. package/bin/crtrd +4 -0
  7. package/bin/progress-painter.mjs +89 -0
  8. package/bin/runtime-generation-manifest.mjs +286 -0
  9. package/bin/runtime-selector.mjs +510 -0
  10. package/dist/api/client.d.ts +501 -0
  11. package/dist/api/client.js +3 -0
  12. package/dist/api/command-manifest/index.d.ts +3 -0
  13. package/dist/api/command-manifest/index.js +1 -0
  14. package/dist/api/command-manifest/manifest.d.ts +51 -0
  15. package/dist/api/command-manifest/manifest.js +1 -0
  16. package/dist/api/command-manifest/result.d.ts +25 -0
  17. package/dist/api/command-manifest/result.js +1 -0
  18. package/dist/api/command-manifest/schema.d.ts +28 -0
  19. package/dist/api/command-manifest/schema.js +1 -0
  20. package/dist/api/dto/analytics.d.ts +184 -0
  21. package/dist/api/dto/analytics.js +0 -0
  22. package/dist/api/dto/attach.d.ts +22 -0
  23. package/dist/api/dto/attach.js +0 -0
  24. package/dist/api/dto/bash-jobs.d.ts +24 -0
  25. package/dist/api/dto/bash-jobs.js +1 -0
  26. package/dist/api/dto/bash.d.ts +17 -0
  27. package/dist/api/dto/bash.js +0 -0
  28. package/dist/api/dto/broker-ops.d.ts +187 -0
  29. package/dist/api/dto/broker-ops.js +0 -0
  30. package/dist/api/dto/broker-signals.d.ts +25 -0
  31. package/dist/api/dto/broker-signals.js +0 -0
  32. package/dist/api/dto/broker.d.ts +86 -0
  33. package/dist/api/dto/broker.js +0 -0
  34. package/dist/api/dto/canvas.d.ts +359 -0
  35. package/dist/api/dto/canvas.js +0 -0
  36. package/dist/api/dto/chat-inventory.d.ts +56 -0
  37. package/dist/api/dto/chat-inventory.js +0 -0
  38. package/dist/api/dto/common.d.ts +29 -0
  39. package/dist/api/dto/common.js +1 -0
  40. package/dist/api/dto/config.d.ts +46 -0
  41. package/dist/api/dto/config.js +0 -0
  42. package/dist/api/dto/crons.d.ts +158 -0
  43. package/dist/api/dto/crons.js +1 -0
  44. package/dist/api/dto/custom-objects.d.ts +66 -0
  45. package/dist/api/dto/custom-objects.js +0 -0
  46. package/dist/api/dto/delivery.d.ts +71 -0
  47. package/dist/api/dto/delivery.js +0 -0
  48. package/dist/api/dto/docs.d.ts +135 -0
  49. package/dist/api/dto/docs.js +1 -0
  50. package/dist/api/dto/files.d.ts +21 -0
  51. package/dist/api/dto/files.js +0 -0
  52. package/dist/api/dto/focus.d.ts +24 -0
  53. package/dist/api/dto/focus.js +0 -0
  54. package/dist/api/dto/grants.d.ts +28 -0
  55. package/dist/api/dto/grants.js +0 -0
  56. package/dist/api/dto/health.d.ts +116 -0
  57. package/dist/api/dto/health.js +0 -0
  58. package/dist/api/dto/human-requests.d.ts +113 -0
  59. package/dist/api/dto/human-requests.js +0 -0
  60. package/dist/api/dto/human.d.ts +28 -0
  61. package/dist/api/dto/human.js +0 -0
  62. package/dist/api/dto/inbox.d.ts +273 -0
  63. package/dist/api/dto/inbox.js +0 -0
  64. package/dist/api/dto/lifecycle.d.ts +88 -0
  65. package/dist/api/dto/lifecycle.js +0 -0
  66. package/dist/api/dto/limits.d.ts +29 -0
  67. package/dist/api/dto/limits.js +0 -0
  68. package/dist/api/dto/mail.d.ts +44 -0
  69. package/dist/api/dto/mail.js +0 -0
  70. package/dist/api/dto/messages.d.ts +104 -0
  71. package/dist/api/dto/messages.js +0 -0
  72. package/dist/api/dto/model-config.d.ts +25 -0
  73. package/dist/api/dto/model-config.js +0 -0
  74. package/dist/api/dto/modelauth.d.ts +132 -0
  75. package/dist/api/dto/modelauth.js +0 -0
  76. package/dist/api/dto/node-events.d.ts +65 -0
  77. package/dist/api/dto/node-events.js +0 -0
  78. package/dist/api/dto/node-outcomes.d.ts +88 -0
  79. package/dist/api/dto/node-outcomes.js +0 -0
  80. package/dist/api/dto/node-records.d.ts +35 -0
  81. package/dist/api/dto/node-records.js +0 -0
  82. package/dist/api/dto/nodes.d.ts +371 -0
  83. package/dist/api/dto/nodes.js +0 -0
  84. package/dist/api/dto/objects.d.ts +172 -0
  85. package/dist/api/dto/objects.js +1 -0
  86. package/dist/api/dto/profiles.d.ts +117 -0
  87. package/dist/api/dto/profiles.js +1 -0
  88. package/dist/api/dto/recovery.d.ts +104 -0
  89. package/dist/api/dto/recovery.js +0 -0
  90. package/dist/api/dto/reports.d.ts +95 -0
  91. package/dist/api/dto/reports.js +0 -0
  92. package/dist/api/dto/review-comments.d.ts +146 -0
  93. package/dist/api/dto/review-comments.js +0 -0
  94. package/dist/api/dto/reviews.d.ts +113 -0
  95. package/dist/api/dto/reviews.js +0 -0
  96. package/dist/api/dto/run-events.d.ts +295 -0
  97. package/dist/api/dto/run-events.js +0 -0
  98. package/dist/api/dto/structured-requests.d.ts +64 -0
  99. package/dist/api/dto/structured-requests.js +1 -0
  100. package/dist/api/dto/subscriptions.d.ts +14 -0
  101. package/dist/api/dto/subscriptions.js +0 -0
  102. package/dist/api/dto/worktree.d.ts +55 -0
  103. package/dist/api/dto/worktree.js +0 -0
  104. package/dist/api/error-codes.d.ts +259 -0
  105. package/dist/api/error-codes.js +1 -0
  106. package/dist/api/errors.d.ts +47 -0
  107. package/dist/api/errors.js +1 -0
  108. package/dist/api/index.d.ts +48 -0
  109. package/dist/api/index.js +1 -0
  110. package/dist/api/long-poll.d.ts +59 -0
  111. package/dist/api/long-poll.js +1 -0
  112. package/dist/api/node-transport.d.ts +18 -0
  113. package/dist/api/node-transport.js +1 -0
  114. package/dist/api/plugin-manifest-schema.d.ts +233 -0
  115. package/dist/api/plugin-manifest-schema.js +0 -0
  116. package/dist/api/routes.d.ts +164 -0
  117. package/dist/api/routes.js +1 -0
  118. package/dist/api/runtime-version.d.ts +31 -0
  119. package/dist/api/runtime-version.js +1 -0
  120. package/dist/build-root.d.ts +58 -0
  121. package/dist/build-root.js +1 -0
  122. package/dist/builtin-memory/00-runtime-base/00-authoring.md +46 -0
  123. package/dist/builtin-memory/00-runtime-base/01-escalation-unattended.md +15 -0
  124. package/dist/builtin-memory/00-runtime-base/01-escalation.md +15 -0
  125. package/dist/builtin-memory/00-runtime-base/02-insight-capture.md +11 -0
  126. package/dist/builtin-memory/01-spine/00-has-manager.md +14 -0
  127. package/dist/builtin-memory/02-turn-lifecycle/00-ending-a-turn.md +28 -0
  128. package/dist/builtin-memory/02-turn-lifecycle/01-terminal-user.md +11 -0
  129. package/dist/builtin-memory/02-turn-lifecycle/01-terminal.md +13 -0
  130. package/dist/builtin-memory/02-turn-lifecycle/02-resident.md +19 -0
  131. package/dist/builtin-memory/04-base-worker-exploring.md +13 -0
  132. package/dist/builtin-memory/04-base-worker.md +15 -0
  133. package/dist/builtin-memory/04-orchestration-kernel.md +62 -0
  134. package/dist/builtin-memory/05-kinds/advisor/01-orchestrator.md +17 -0
  135. package/dist/builtin-memory/05-kinds/advisor/advice-contract.md +15 -0
  136. package/dist/builtin-memory/05-kinds/explore/00-base.md +19 -0
  137. package/dist/builtin-memory/05-kinds/explore/01-orchestrator.md +17 -0
  138. package/dist/builtin-memory/05-kinds/general/00-base.md +15 -0
  139. package/dist/builtin-memory/05-kinds/review/00-base.md +17 -0
  140. package/dist/builtin-memory/05-kinds/review/01-orchestrator.md +20 -0
  141. package/dist/builtin-memory/05-kinds/review/companion/00-base.md +21 -0
  142. package/dist/builtin-memory/05-kinds/review/security-findings.md +13 -0
  143. package/dist/builtin-memory/advisor/council.md +33 -0
  144. package/dist/builtin-memory/crouter-concepts/INDEX.md +15 -0
  145. package/dist/builtin-memory/crouter-concepts/README.md +19 -0
  146. package/dist/builtin-memory/crouter-concepts/documents.md +54 -0
  147. package/dist/builtin-memory/crouter-concepts/lifecycle-and-wakes.md +28 -0
  148. package/dist/builtin-memory/crouter-concepts/nodes-and-the-canvas.md +31 -0
  149. package/dist/builtin-memory/crouter-concepts/profiles-kinds-and-modes.md +33 -0
  150. package/dist/builtin-memory/crouter-concepts/scopes-and-trust.md +41 -0
  151. package/dist/builtin-memory/crouter-concepts/why-a-daemon.md +31 -0
  152. package/dist/builtin-memory/crouter-plugin/INDEX.md +12 -0
  153. package/dist/builtin-memory/crouter-plugin/README.md +22 -0
  154. package/dist/builtin-memory/crouter-plugin/bundles-and-memory.md +30 -0
  155. package/dist/builtin-memory/crouter-plugin/commands.md +24 -0
  156. package/dist/builtin-memory/crouter-plugin/deploying.md +36 -0
  157. package/dist/builtin-memory/crouter-plugin/errors.md +41 -0
  158. package/dist/builtin-memory/crouter-plugin/getting-started.md +25 -0
  159. package/dist/builtin-memory/crouter-plugin/output.md +52 -0
  160. package/dist/builtin-memory/crouter-plugin/parameters.md +31 -0
  161. package/dist/builtin-memory/crouter-sdk/INDEX.md +13 -0
  162. package/dist/builtin-memory/crouter-sdk/README.md +92 -0
  163. package/dist/builtin-memory/crouter-sdk/bash.md +40 -0
  164. package/dist/builtin-memory/crouter-sdk/client.md +299 -0
  165. package/dist/builtin-memory/crouter-sdk/docker.md +70 -0
  166. package/dist/builtin-memory/crouter-sdk/error-envelope.md +38 -0
  167. package/dist/builtin-memory/crouter-sdk/errors.md +113 -0
  168. package/dist/builtin-memory/crouter-sdk/files.md +50 -0
  169. package/dist/builtin-memory/crouter-sdk/getting-started.md +226 -0
  170. package/dist/builtin-memory/crouter-sdk/guides/README.md +20 -0
  171. package/dist/builtin-memory/crouter-sdk/guides/apps-on-crouter-cloud.md +117 -0
  172. package/dist/builtin-memory/crouter-sdk/guides/apps-with-many-users.md +61 -0
  173. package/dist/builtin-memory/crouter-sdk/guides/event-driven-assistant.md +91 -0
  174. package/dist/builtin-memory/crouter-sdk/guides/fan-out-pipeline.md +57 -0
  175. package/dist/builtin-memory/crouter-sdk/guides/human-approval.md +79 -0
  176. package/dist/builtin-memory/crouter-sdk/guides/typed-extraction.md +55 -0
  177. package/dist/builtin-memory/crouter-sdk/memory.md +49 -0
  178. package/dist/builtin-memory/crouter-sdk/nodes.md +195 -0
  179. package/dist/builtin-memory/crouter-sdk/release-notes.md +209 -0
  180. package/dist/builtin-memory/crouter-sdk/resources.md +101 -0
  181. package/dist/builtin-memory/crouter-sdk/streaming.md +218 -0
  182. package/dist/builtin-memory/crouter-sdk/testing.md +165 -0
  183. package/dist/builtin-memory/explore/exploration-doc.md +27 -0
  184. package/dist/builtin-memory/insights/capture.md +49 -0
  185. package/dist/builtin-memory/insights/init.md +88 -0
  186. package/dist/builtin-memory/internal/INDEX.md +40 -0
  187. package/dist/builtin-memory/internal/agent-shaping.md +80 -0
  188. package/dist/builtin-memory/internal/examples/INDEX.md +16 -0
  189. package/dist/builtin-memory/internal/examples/imessage-assistant.md +101 -0
  190. package/dist/builtin-memory/internal/marketplaces.md +160 -0
  191. package/dist/builtin-memory/internal/memory-loading.md +68 -0
  192. package/dist/builtin-memory/internal/nodes-and-canvas.md +60 -0
  193. package/dist/builtin-memory/internal/plugins.md +457 -0
  194. package/dist/builtin-memory/internal/storage-tiers.md +51 -0
  195. package/dist/builtin-memory/memory-read-orientation.md +13 -0
  196. package/dist/builtin-memory/wedged-child-on-runaway-bash.md +21 -0
  197. package/dist/builtin-pi-packages/pi-crtr-extensions/README.md +49 -0
  198. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/claude-plugin-commands.ts +440 -0
  199. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/crtr-commands/filters.json +7 -0
  200. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/crtr-commands/index.ts +214 -0
  201. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/frontmatter-rules/index.ts +421 -0
  202. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/memory-slash-commands.ts +145 -0
  203. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/pi-shell-runner.ts +34 -0
  204. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.d.ts +78 -0
  205. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.js +1181 -0
  206. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.ts +1409 -0
  207. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/sysprompt-window.ts +19 -0
  208. package/dist/builtin-pi-packages/pi-crtr-extensions/lib/package.json +3 -0
  209. package/dist/builtin-pi-packages/pi-crtr-extensions/lib/subscription-state.js +1 -0
  210. package/dist/builtin-pi-packages/pi-crtr-extensions/lib/subscription-state.ts +2 -0
  211. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/LICENSE +13 -0
  212. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/README.md +172 -0
  213. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/bin.mjs +11 -0
  214. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
  215. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
  216. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
  217. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
  218. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/composer.js +219 -0
  219. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
  220. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
  221. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
  222. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
  223. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
  224. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +225 -0
  225. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
  226. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
  227. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
  228. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
  229. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
  230. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/doc/Document.js +335 -0
  231. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
  232. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
  233. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
  234. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/doc/directives.js +176 -0
  235. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/errors.js +57 -0
  236. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/index.js +17 -0
  237. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/log.js +11 -0
  238. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/Alias.js +116 -0
  239. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
  240. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
  241. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
  242. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
  243. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
  244. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
  245. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
  246. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
  247. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
  248. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
  249. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
  250. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
  251. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/cst.js +98 -0
  252. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/lexer.js +721 -0
  253. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
  254. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/parser.js +975 -0
  255. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/public-api.js +102 -0
  256. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
  257. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
  258. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
  259. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
  260. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
  261. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
  262. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
  263. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
  264. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
  265. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
  266. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/tags.js +96 -0
  267. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
  268. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
  269. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
  270. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
  271. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +67 -0
  272. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
  273. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
  274. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
  275. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
  276. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
  277. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
  278. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
  279. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
  280. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
  281. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
  282. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +25 -0
  283. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
  284. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
  285. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/util.js +11 -0
  286. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/visit.js +233 -0
  287. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/index.js +5 -0
  288. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/package.json +3 -0
  289. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/cli.d.ts +8 -0
  290. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/cli.mjs +201 -0
  291. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
  292. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-collection.js +90 -0
  293. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
  294. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-doc.js +45 -0
  295. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
  296. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-node.js +112 -0
  297. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
  298. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
  299. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/composer.d.ts +63 -0
  300. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/composer.js +224 -0
  301. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
  302. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
  303. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
  304. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
  305. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
  306. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
  307. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
  308. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-end.js +39 -0
  309. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
  310. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
  311. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
  312. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-flow-scalar.js +227 -0
  313. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
  314. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-props.js +148 -0
  315. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
  316. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
  317. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
  318. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
  319. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
  320. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
  321. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
  322. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
  323. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/Document.d.ts +141 -0
  324. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/Document.js +337 -0
  325. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
  326. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/anchors.js +76 -0
  327. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
  328. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/applyReviver.js +57 -0
  329. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
  330. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/createNode.js +90 -0
  331. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/directives.d.ts +49 -0
  332. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/directives.js +178 -0
  333. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/errors.d.ts +21 -0
  334. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/errors.js +62 -0
  335. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/index.d.ts +25 -0
  336. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/index.js +50 -0
  337. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/log.d.ts +3 -0
  338. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/log.js +19 -0
  339. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
  340. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Alias.js +118 -0
  341. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
  342. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Collection.js +151 -0
  343. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
  344. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Node.js +40 -0
  345. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
  346. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Pair.js +39 -0
  347. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Scalar.d.ts +47 -0
  348. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Scalar.js +27 -0
  349. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
  350. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
  351. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
  352. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
  353. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
  354. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
  355. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
  356. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/identity.js +53 -0
  357. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
  358. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/toJS.js +39 -0
  359. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/options.d.ts +350 -0
  360. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
  361. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
  362. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
  363. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
  364. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
  365. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst-visit.js +99 -0
  366. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst.d.ts +109 -0
  367. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst.js +112 -0
  368. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
  369. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/lexer.js +723 -0
  370. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
  371. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/line-counter.js +41 -0
  372. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/parser.d.ts +84 -0
  373. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/parser.js +980 -0
  374. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/public-api.d.ts +44 -0
  375. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/public-api.js +107 -0
  376. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
  377. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/Schema.js +39 -0
  378. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
  379. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/map.js +19 -0
  380. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
  381. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/null.js +17 -0
  382. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
  383. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/seq.js +19 -0
  384. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
  385. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/string.js +16 -0
  386. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
  387. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/bool.js +21 -0
  388. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
  389. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/float.js +47 -0
  390. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
  391. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/int.js +42 -0
  392. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
  393. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/schema.js +25 -0
  394. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
  395. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/json/schema.js +64 -0
  396. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
  397. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/tags.d.ts +48 -0
  398. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/tags.js +99 -0
  399. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/types.d.ts +92 -0
  400. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
  401. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
  402. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
  403. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
  404. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
  405. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
  406. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
  407. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
  408. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
  409. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/merge.js +71 -0
  410. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
  411. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
  412. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
  413. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
  414. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
  415. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
  416. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
  417. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
  418. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
  419. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
  420. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
  421. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
  422. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
  423. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringify.js +132 -0
  424. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
  425. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
  426. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
  427. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
  428. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
  429. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
  430. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
  431. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyNumber.js +27 -0
  432. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
  433. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
  434. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
  435. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
  436. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/test-events.d.ts +4 -0
  437. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/test-events.js +134 -0
  438. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/util.d.ts +16 -0
  439. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/util.js +28 -0
  440. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/visit.d.ts +102 -0
  441. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/visit.js +236 -0
  442. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/package.json +97 -0
  443. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/util.js +2 -0
  444. package/dist/builtin-pi-packages/pi-crtr-extensions/package-lock.json +3857 -0
  445. package/dist/builtin-pi-packages/pi-crtr-extensions/package.json +25 -0
  446. package/dist/builtin-pi-packages/pi-crtr-extensions/tsconfig.json +10 -0
  447. package/dist/cli.d.ts +2 -0
  448. package/dist/cli.js +11 -0
  449. package/dist/clients/attach/ansi-cells.d.ts +44 -0
  450. package/dist/clients/attach/ansi-cells.js +1 -0
  451. package/dist/clients/attach/assets/README.md +7 -0
  452. package/dist/clients/attach/assets/whip-06.mp3 +0 -0
  453. package/dist/clients/attach/assets/whip-crack.mp3 +0 -0
  454. package/dist/clients/attach/assets/whip-snap.mp3 +0 -0
  455. package/dist/clients/attach/chrome/bash-jobs.d.ts +6 -0
  456. package/dist/clients/attach/chrome/bash-jobs.js +1 -0
  457. package/dist/clients/attach/chrome/canvas-panels.d.ts +38 -0
  458. package/dist/clients/attach/chrome/canvas-panels.js +1 -0
  459. package/dist/clients/attach/chrome/completion-bell.d.ts +10 -0
  460. package/dist/clients/attach/chrome/completion-bell.js +1 -0
  461. package/dist/clients/attach/chrome/cron-wait.d.ts +3 -0
  462. package/dist/clients/attach/chrome/cron-wait.js +1 -0
  463. package/dist/clients/attach/chrome/git-info.d.ts +20 -0
  464. package/dist/clients/attach/chrome/git-info.js +2 -0
  465. package/dist/clients/attach/chrome/header.d.ts +10 -0
  466. package/dist/clients/attach/chrome/header.js +1 -0
  467. package/dist/clients/attach/chrome/inbox-strip.d.ts +31 -0
  468. package/dist/clients/attach/chrome/inbox-strip.js +1 -0
  469. package/dist/clients/attach/chrome/key-hint.d.ts +9 -0
  470. package/dist/clients/attach/chrome/key-hint.js +1 -0
  471. package/dist/clients/attach/chrome/recap.d.ts +7 -0
  472. package/dist/clients/attach/chrome/recap.js +1 -0
  473. package/dist/clients/attach/chrome/review-wait.d.ts +6 -0
  474. package/dist/clients/attach/chrome/review-wait.js +1 -0
  475. package/dist/clients/attach/chrome/roster.d.ts +36 -0
  476. package/dist/clients/attach/chrome/roster.js +4 -0
  477. package/dist/clients/attach/chrome/status-line.d.ts +38 -0
  478. package/dist/clients/attach/chrome/status-line.js +1 -0
  479. package/dist/clients/attach/chrome/ticket-panel.d.ts +29 -0
  480. package/dist/clients/attach/chrome/ticket-panel.js +1 -0
  481. package/dist/clients/attach/chrome/widgets.d.ts +9 -0
  482. package/dist/clients/attach/chrome/widgets.js +1 -0
  483. package/dist/clients/attach/command.d.ts +3 -0
  484. package/dist/clients/attach/command.js +1 -0
  485. package/dist/clients/attach/config.d.ts +95 -0
  486. package/dist/clients/attach/config.js +1 -0
  487. package/dist/clients/attach/input/capabilities.d.ts +30 -0
  488. package/dist/clients/attach/input/capabilities.js +1 -0
  489. package/dist/clients/attach/input/clipboard-image.d.ts +55 -0
  490. package/dist/clients/attach/input/clipboard-image.js +20 -0
  491. package/dist/clients/attach/input/completion-frecency.d.ts +45 -0
  492. package/dist/clients/attach/input/completion-frecency.js +1 -0
  493. package/dist/clients/attach/input/controller.d.ts +91 -0
  494. package/dist/clients/attach/input/controller.js +7 -0
  495. package/dist/clients/attach/input/overlay-owner.d.ts +41 -0
  496. package/dist/clients/attach/input/overlay-owner.js +1 -0
  497. package/dist/clients/attach/input/ref-autocomplete.d.ts +77 -0
  498. package/dist/clients/attach/input/ref-autocomplete.js +2 -0
  499. package/dist/clients/attach/input/titled-editor.d.ts +225 -0
  500. package/dist/clients/attach/input/titled-editor.js +4 -0
  501. package/dist/clients/attach/overlays/auth.d.ts +13 -0
  502. package/dist/clients/attach/overlays/auth.js +2 -0
  503. package/dist/clients/attach/overlays/dialogs.d.ts +27 -0
  504. package/dist/clients/attach/overlays/dialogs.js +2 -0
  505. package/dist/clients/attach/overlays/file-review.d.ts +10 -0
  506. package/dist/clients/attach/overlays/file-review.js +2 -0
  507. package/dist/clients/attach/overlays/graph.d.ts +83 -0
  508. package/dist/clients/attach/overlays/graph.js +1 -0
  509. package/dist/clients/attach/overlays/help.d.ts +33 -0
  510. package/dist/clients/attach/overlays/help.js +1 -0
  511. package/dist/clients/attach/overlays/mcp.d.ts +32 -0
  512. package/dist/clients/attach/overlays/mcp.js +1 -0
  513. package/dist/clients/attach/overlays/pickers.d.ts +56 -0
  514. package/dist/clients/attach/overlays/pickers.js +1 -0
  515. package/dist/clients/attach/photon_rs_bg.wasm +0 -0
  516. package/dist/clients/attach/render/activity-slot.d.ts +4 -0
  517. package/dist/clients/attach/render/activity-slot.js +1 -0
  518. package/dist/clients/attach/render/assistant-message.d.ts +13 -0
  519. package/dist/clients/attach/render/assistant-message.js +1 -0
  520. package/dist/clients/attach/render/card-presentation.d.ts +36 -0
  521. package/dist/clients/attach/render/card-presentation.js +5 -0
  522. package/dist/clients/attach/render/chat-view.d.ts +356 -0
  523. package/dist/clients/attach/render/chat-view.js +5 -0
  524. package/dist/clients/attach/render/condensed-history.d.ts +21 -0
  525. package/dist/clients/attach/render/condensed-history.js +1 -0
  526. package/dist/clients/attach/render/context-message.d.ts +22 -0
  527. package/dist/clients/attach/render/context-message.js +1 -0
  528. package/dist/clients/attach/render/crtr-output.d.ts +52 -0
  529. package/dist/clients/attach/render/crtr-output.js +17 -0
  530. package/dist/clients/attach/render/diagram.d.ts +4 -0
  531. package/dist/clients/attach/render/diagram.js +7 -0
  532. package/dist/clients/attach/render/doc-links.d.ts +34 -0
  533. package/dist/clients/attach/render/doc-links.js +1 -0
  534. package/dist/clients/attach/render/edit-diff.d.ts +12 -0
  535. package/dist/clients/attach/render/edit-diff.js +5 -0
  536. package/dist/clients/attach/render/glyph-codepoints.d.ts +3 -0
  537. package/dist/clients/attach/render/glyph-codepoints.js +1 -0
  538. package/dist/clients/attach/render/group-activity.d.ts +84 -0
  539. package/dist/clients/attach/render/group-activity.js +2 -0
  540. package/dist/clients/attach/render/group-recap.d.ts +13 -0
  541. package/dist/clients/attach/render/group-recap.js +1 -0
  542. package/dist/clients/attach/render/markdown-source.d.ts +16 -0
  543. package/dist/clients/attach/render/markdown-source.js +5 -0
  544. package/dist/clients/attach/render/measured-container.d.ts +96 -0
  545. package/dist/clients/attach/render/measured-container.js +1 -0
  546. package/dist/clients/attach/render/page-block.d.ts +37 -0
  547. package/dist/clients/attach/render/page-block.js +1 -0
  548. package/dist/clients/attach/render/scroll-animation.d.ts +8 -0
  549. package/dist/clients/attach/render/scroll-animation.js +1 -0
  550. package/dist/clients/attach/render/tool-calls.d.ts +53 -0
  551. package/dist/clients/attach/render/tool-calls.js +3 -0
  552. package/dist/clients/attach/render/transcript-copy.d.ts +9 -0
  553. package/dist/clients/attach/render/transcript-copy.js +2 -0
  554. package/dist/clients/attach/render/transcript-search.d.ts +28 -0
  555. package/dist/clients/attach/render/transcript-search.js +1 -0
  556. package/dist/clients/attach/render/viewport.d.ts +38 -0
  557. package/dist/clients/attach/render/viewport.js +1 -0
  558. package/dist/clients/attach/session/banner.d.ts +13 -0
  559. package/dist/clients/attach/session/banner.js +1 -0
  560. package/dist/clients/attach/session/bindings.d.ts +20 -0
  561. package/dist/clients/attach/session/bindings.js +1 -0
  562. package/dist/clients/attach/session/chrome-refresh.d.ts +40 -0
  563. package/dist/clients/attach/session/chrome-refresh.js +1 -0
  564. package/dist/clients/attach/session/connection.d.ts +53 -0
  565. package/dist/clients/attach/session/connection.js +1 -0
  566. package/dist/clients/attach/session/context.d.ts +59 -0
  567. package/dist/clients/attach/session/context.js +0 -0
  568. package/dist/clients/attach/session/doc-materialize.d.ts +53 -0
  569. package/dist/clients/attach/session/doc-materialize.js +3 -0
  570. package/dist/clients/attach/session/document-links.d.ts +21 -0
  571. package/dist/clients/attach/session/document-links.js +1 -0
  572. package/dist/clients/attach/session/editor-frame.d.ts +47 -0
  573. package/dist/clients/attach/session/editor-frame.js +1 -0
  574. package/dist/clients/attach/session/editor-inventory.d.ts +63 -0
  575. package/dist/clients/attach/session/editor-inventory.js +6 -0
  576. package/dist/clients/attach/session/file-links.d.ts +24 -0
  577. package/dist/clients/attach/session/file-links.js +1 -0
  578. package/dist/clients/attach/session/focus-events.d.ts +4 -0
  579. package/dist/clients/attach/session/focus-events.js +1 -0
  580. package/dist/clients/attach/session/frame.d.ts +46 -0
  581. package/dist/clients/attach/session/frame.js +1 -0
  582. package/dist/clients/attach/session/frames.d.ts +49 -0
  583. package/dist/clients/attach/session/frames.js +1 -0
  584. package/dist/clients/attach/session/identity.d.ts +16 -0
  585. package/dist/clients/attach/session/identity.js +1 -0
  586. package/dist/clients/attach/session/input-wiring.d.ts +50 -0
  587. package/dist/clients/attach/session/input-wiring.js +1 -0
  588. package/dist/clients/attach/session/invariant.d.ts +9 -0
  589. package/dist/clients/attach/session/invariant.js +1 -0
  590. package/dist/clients/attach/session/keys.d.ts +46 -0
  591. package/dist/clients/attach/session/keys.js +1 -0
  592. package/dist/clients/attach/session/layout.d.ts +22 -0
  593. package/dist/clients/attach/session/layout.js +1 -0
  594. package/dist/clients/attach/session/mouse.d.ts +27 -0
  595. package/dist/clients/attach/session/mouse.js +1 -0
  596. package/dist/clients/attach/session/pane-focus.d.ts +8 -0
  597. package/dist/clients/attach/session/pane-focus.js +1 -0
  598. package/dist/clients/attach/session/pane-tag.d.ts +44 -0
  599. package/dist/clients/attach/session/pane-tag.js +1 -0
  600. package/dist/clients/attach/session/pi-assets.d.ts +1 -0
  601. package/dist/clients/attach/session/pi-assets.js +1 -0
  602. package/dist/clients/attach/session/pi-oauth-flows.d.ts +1 -0
  603. package/dist/clients/attach/session/pi-oauth-flows.js +1 -0
  604. package/dist/clients/attach/session/profile-files.d.ts +17 -0
  605. package/dist/clients/attach/session/profile-files.js +1 -0
  606. package/dist/clients/attach/session/reconnect.d.ts +44 -0
  607. package/dist/clients/attach/session/reconnect.js +1 -0
  608. package/dist/clients/attach/session/selection.d.ts +28 -0
  609. package/dist/clients/attach/session/selection.js +3 -0
  610. package/dist/clients/attach/session/state-sync.d.ts +38 -0
  611. package/dist/clients/attach/session/state-sync.js +1 -0
  612. package/dist/clients/attach/session/surface-frame.d.ts +20 -0
  613. package/dist/clients/attach/session/surface-frame.js +1 -0
  614. package/dist/clients/attach/session/surface-host.d.ts +65 -0
  615. package/dist/clients/attach/session/surface-host.js +1 -0
  616. package/dist/clients/attach/session/teardown.d.ts +30 -0
  617. package/dist/clients/attach/session/teardown.js +5 -0
  618. package/dist/clients/attach/session/transcript-search.d.ts +20 -0
  619. package/dist/clients/attach/session/transcript-search.js +3 -0
  620. package/dist/clients/attach/session/whip-achievements.d.ts +4 -0
  621. package/dist/clients/attach/session/whip-achievements.js +2 -0
  622. package/dist/clients/attach/session/whip.d.ts +20 -0
  623. package/dist/clients/attach/session/whip.js +1 -0
  624. package/dist/clients/attach/slash/dispatch.d.ts +116 -0
  625. package/dist/clients/attach/slash/dispatch.js +2 -0
  626. package/dist/clients/attach/slash/prompt-preview.d.ts +30 -0
  627. package/dist/clients/attach/slash/prompt-preview.js +1 -0
  628. package/dist/clients/attach/viewer.d.ts +8 -0
  629. package/dist/clients/attach/viewer.js +1946 -0
  630. package/dist/clients/conversation/projection.d.ts +79 -0
  631. package/dist/clients/conversation/projection.js +1 -0
  632. package/dist/clients/conversation/submit.d.ts +38 -0
  633. package/dist/clients/conversation/submit.js +1 -0
  634. package/dist/clients/inbox/controller.d.ts +174 -0
  635. package/dist/clients/inbox/controller.js +1 -0
  636. package/dist/clients/inbox/dto-adapt.d.ts +28 -0
  637. package/dist/clients/inbox/dto-adapt.js +1 -0
  638. package/dist/clients/inbox/layout.d.ts +8 -0
  639. package/dist/clients/inbox/layout.js +1 -0
  640. package/dist/clients/inbox/page-adapter.d.ts +33 -0
  641. package/dist/clients/inbox/page-adapter.js +1 -0
  642. package/dist/clients/inbox/resolve.d.ts +16 -0
  643. package/dist/clients/inbox/resolve.js +1 -0
  644. package/dist/clients/inbox/review/anchors.d.ts +41 -0
  645. package/dist/clients/inbox/review/anchors.js +1 -0
  646. package/dist/clients/inbox/review/comments-client.d.ts +74 -0
  647. package/dist/clients/inbox/review/comments-client.js +1 -0
  648. package/dist/clients/inbox/review/companion-pane.d.ts +47 -0
  649. package/dist/clients/inbox/review/companion-pane.js +1 -0
  650. package/dist/clients/inbox/review/document-surface.d.ts +212 -0
  651. package/dist/clients/inbox/review/document-surface.js +2 -0
  652. package/dist/clients/inbox/review/frame.d.ts +57 -0
  653. package/dist/clients/inbox/review/frame.js +1 -0
  654. package/dist/clients/inbox/review/keys.d.ts +69 -0
  655. package/dist/clients/inbox/review/keys.js +1 -0
  656. package/dist/clients/inbox/review/launch.d.ts +16 -0
  657. package/dist/clients/inbox/review/launch.js +1 -0
  658. package/dist/clients/inbox/review/live-source.d.ts +24 -0
  659. package/dist/clients/inbox/review/live-source.js +1 -0
  660. package/dist/clients/inbox/review/nvim.d.ts +15 -0
  661. package/dist/clients/inbox/review/nvim.js +1 -0
  662. package/dist/clients/inbox/review/remap.d.ts +51 -0
  663. package/dist/clients/inbox/review/remap.js +1 -0
  664. package/dist/clients/inbox/review/review-client.d.ts +43 -0
  665. package/dist/clients/inbox/review/review-client.js +1 -0
  666. package/dist/clients/inbox/review/roundtrip.d.ts +5 -0
  667. package/dist/clients/inbox/review/roundtrip.js +3 -0
  668. package/dist/clients/inbox/review/state.d.ts +153 -0
  669. package/dist/clients/inbox/review/state.js +4 -0
  670. package/dist/clients/inbox/review-adapter.d.ts +17 -0
  671. package/dist/clients/inbox/review-adapter.js +1 -0
  672. package/dist/clients/inbox/surface.d.ts +25 -0
  673. package/dist/clients/inbox/surface.js +1 -0
  674. package/dist/clients/inbox/tui/ansi.d.ts +68 -0
  675. package/dist/clients/inbox/tui/ansi.js +3 -0
  676. package/dist/clients/inbox/tui/input.d.ts +5 -0
  677. package/dist/clients/inbox/tui/input.js +5 -0
  678. package/dist/clients/inbox/tui/keys.d.ts +28 -0
  679. package/dist/clients/inbox/tui/keys.js +1 -0
  680. package/dist/clients/inbox/tui/page-body.d.ts +10 -0
  681. package/dist/clients/inbox/tui/page-body.js +1 -0
  682. package/dist/clients/inbox/tui/panel.d.ts +4 -0
  683. package/dist/clients/inbox/tui/panel.js +1 -0
  684. package/dist/clients/inbox/tui/render.d.ts +23 -0
  685. package/dist/clients/inbox/tui/render.js +2 -0
  686. package/dist/clients/inbox/tui/slots.d.ts +33 -0
  687. package/dist/clients/inbox/tui/slots.js +3 -0
  688. package/dist/clients/inbox/tui/types.d.ts +73 -0
  689. package/dist/clients/inbox/tui/types.js +0 -0
  690. package/dist/clients/inbox/tui.d.ts +17 -0
  691. package/dist/clients/inbox/tui.js +1 -0
  692. package/dist/clients/surfaces/host.d.ts +74 -0
  693. package/dist/clients/surfaces/host.js +0 -0
  694. package/dist/commands/api-client.d.ts +104 -0
  695. package/dist/commands/api-client.js +4 -0
  696. package/dist/commands/attention.d.ts +2 -0
  697. package/dist/commands/attention.js +1 -0
  698. package/dist/commands/canvas/edges.d.ts +2 -0
  699. package/dist/commands/canvas/edges.js +2 -0
  700. package/dist/commands/canvas/list.d.ts +4 -0
  701. package/dist/commands/canvas/list.js +3 -0
  702. package/dist/commands/canvas/read.d.ts +14 -0
  703. package/dist/commands/canvas/read.js +10 -0
  704. package/dist/commands/canvas/search.d.ts +2 -0
  705. package/dist/commands/canvas/search.js +3 -0
  706. package/dist/commands/canvas/unwatch.d.ts +2 -0
  707. package/dist/commands/canvas/unwatch.js +1 -0
  708. package/dist/commands/canvas/watch.d.ts +3 -0
  709. package/dist/commands/canvas/watch.js +1 -0
  710. package/dist/commands/canvas-analytics/chart.d.ts +52 -0
  711. package/dist/commands/canvas-analytics/chart.js +1 -0
  712. package/dist/commands/canvas-analytics/drilldown.d.ts +34 -0
  713. package/dist/commands/canvas-analytics/drilldown.js +1 -0
  714. package/dist/commands/canvas-analytics/format.d.ts +29 -0
  715. package/dist/commands/canvas-analytics/format.js +1 -0
  716. package/dist/commands/canvas-analytics/graph-detail.d.ts +2 -0
  717. package/dist/commands/canvas-analytics/graph-detail.js +2 -0
  718. package/dist/commands/canvas-analytics/graphs.d.ts +9 -0
  719. package/dist/commands/canvas-analytics/graphs.js +1 -0
  720. package/dist/commands/canvas-analytics/memory.d.ts +2 -0
  721. package/dist/commands/canvas-analytics/memory.js +1 -0
  722. package/dist/commands/canvas-analytics/overview.d.ts +2 -0
  723. package/dist/commands/canvas-analytics/overview.js +1 -0
  724. package/dist/commands/canvas-analytics/shell.d.ts +60 -0
  725. package/dist/commands/canvas-analytics/shell.js +2 -0
  726. package/dist/commands/canvas-analytics/time.d.ts +2 -0
  727. package/dist/commands/canvas-analytics/time.js +1 -0
  728. package/dist/commands/canvas-analytics/usage.d.ts +2 -0
  729. package/dist/commands/canvas-analytics/usage.js +1 -0
  730. package/dist/commands/canvas-analytics/view.d.ts +85 -0
  731. package/dist/commands/canvas-analytics/view.js +1 -0
  732. package/dist/commands/canvas-analytics.d.ts +2 -0
  733. package/dist/commands/canvas-analytics.js +1 -0
  734. package/dist/commands/canvas-browse.d.ts +2 -0
  735. package/dist/commands/canvas-browse.js +1 -0
  736. package/dist/commands/canvas-config.d.ts +2 -0
  737. package/dist/commands/canvas-config.js +2 -0
  738. package/dist/commands/canvas-history/grep.d.ts +1 -0
  739. package/dist/commands/canvas-history/grep.js +7 -0
  740. package/dist/commands/canvas-history/read.d.ts +1 -0
  741. package/dist/commands/canvas-history/read.js +3 -0
  742. package/dist/commands/canvas-history/search.d.ts +1 -0
  743. package/dist/commands/canvas-history/search.js +10 -0
  744. package/dist/commands/canvas-history/shared.d.ts +34 -0
  745. package/dist/commands/canvas-history/shared.js +1 -0
  746. package/dist/commands/canvas-history/stats.d.ts +1 -0
  747. package/dist/commands/canvas-history/stats.js +6 -0
  748. package/dist/commands/canvas-history.d.ts +2 -0
  749. package/dist/commands/canvas-history.js +1 -0
  750. package/dist/commands/canvas-issue.d.ts +2 -0
  751. package/dist/commands/canvas-issue.js +14 -0
  752. package/dist/commands/canvas-prune.d.ts +2 -0
  753. package/dist/commands/canvas-prune.js +1 -0
  754. package/dist/commands/canvas-roster.d.ts +2 -0
  755. package/dist/commands/canvas-roster.js +1 -0
  756. package/dist/commands/canvas-snapshot.d.ts +2 -0
  757. package/dist/commands/canvas-snapshot.js +1 -0
  758. package/dist/commands/canvas-use.d.ts +1 -0
  759. package/dist/commands/canvas-use.js +1 -0
  760. package/dist/commands/canvas.d.ts +3 -0
  761. package/dist/commands/canvas.js +1 -0
  762. package/dist/commands/chord.d.ts +2 -0
  763. package/dist/commands/chord.js +1 -0
  764. package/dist/commands/cron.d.ts +2 -0
  765. package/dist/commands/cron.js +11 -0
  766. package/dist/commands/custom-object/ack.d.ts +2 -0
  767. package/dist/commands/custom-object/ack.js +3 -0
  768. package/dist/commands/custom-object/publish.d.ts +2 -0
  769. package/dist/commands/custom-object/publish.js +1 -0
  770. package/dist/commands/custom-object/receive.d.ts +2 -0
  771. package/dist/commands/custom-object/receive.js +2 -0
  772. package/dist/commands/custom-object/register.d.ts +2 -0
  773. package/dist/commands/custom-object/register.js +3 -0
  774. package/dist/commands/custom-object/shared.d.ts +5 -0
  775. package/dist/commands/custom-object/shared.js +1 -0
  776. package/dist/commands/custom-object/unregister.d.ts +2 -0
  777. package/dist/commands/custom-object/unregister.js +1 -0
  778. package/dist/commands/custom-object.d.ts +2 -0
  779. package/dist/commands/custom-object.js +1 -0
  780. package/dist/commands/dashboard.d.ts +2 -0
  781. package/dist/commands/dashboard.js +1 -0
  782. package/dist/commands/doc/delete.d.ts +2 -0
  783. package/dist/commands/doc/delete.js +1 -0
  784. package/dist/commands/doc/edit.d.ts +2 -0
  785. package/dist/commands/doc/edit.js +1 -0
  786. package/dist/commands/doc/history.d.ts +2 -0
  787. package/dist/commands/doc/history.js +2 -0
  788. package/dist/commands/doc/lint.d.ts +2 -0
  789. package/dist/commands/doc/lint.js +2 -0
  790. package/dist/commands/doc/list.d.ts +2 -0
  791. package/dist/commands/doc/list.js +1 -0
  792. package/dist/commands/doc/move.d.ts +2 -0
  793. package/dist/commands/doc/move.js +1 -0
  794. package/dist/commands/doc/read.d.ts +2 -0
  795. package/dist/commands/doc/read.js +1 -0
  796. package/dist/commands/doc/replace-blocks.d.ts +6 -0
  797. package/dist/commands/doc/replace-blocks.js +4 -0
  798. package/dist/commands/doc/shared.d.ts +25 -0
  799. package/dist/commands/doc/shared.js +2 -0
  800. package/dist/commands/doc/write.d.ts +2 -0
  801. package/dist/commands/doc/write.js +1 -0
  802. package/dist/commands/doc.d.ts +2 -0
  803. package/dist/commands/doc.js +1 -0
  804. package/dist/commands/human/components.d.ts +4 -0
  805. package/dist/commands/human/components.js +3 -0
  806. package/dist/commands/human/feedback.d.ts +2 -0
  807. package/dist/commands/human/feedback.js +1 -0
  808. package/dist/commands/human/prompts.d.ts +21 -0
  809. package/dist/commands/human/prompts.js +1 -0
  810. package/dist/commands/human/queue.d.ts +3 -0
  811. package/dist/commands/human/queue.js +1 -0
  812. package/dist/commands/human/request.d.ts +2 -0
  813. package/dist/commands/human/request.js +1 -0
  814. package/dist/commands/human/review.d.ts +2 -0
  815. package/dist/commands/human/review.js +1 -0
  816. package/dist/commands/human/shared.d.ts +16 -0
  817. package/dist/commands/human/shared.js +1 -0
  818. package/dist/commands/human.d.ts +2 -0
  819. package/dist/commands/human.js +4 -0
  820. package/dist/commands/node/bash.d.ts +1 -0
  821. package/dist/commands/node/bash.js +5 -0
  822. package/dist/commands/node/create.d.ts +6 -0
  823. package/dist/commands/node/create.js +2 -0
  824. package/dist/commands/node/inspect.d.ts +2 -0
  825. package/dist/commands/node/inspect.js +12 -0
  826. package/dist/commands/node/lifecycle.d.ts +4 -0
  827. package/dist/commands/node/lifecycle.js +4 -0
  828. package/dist/commands/node/message.d.ts +1 -0
  829. package/dist/commands/node/message.js +1 -0
  830. package/dist/commands/node/outcome.d.ts +2 -0
  831. package/dist/commands/node/outcome.js +4 -0
  832. package/dist/commands/node/pyramid.d.ts +2 -0
  833. package/dist/commands/node/pyramid.js +2 -0
  834. package/dist/commands/node/subscription.d.ts +1 -0
  835. package/dist/commands/node/subscription.js +1 -0
  836. package/dist/commands/node/wait.d.ts +1 -0
  837. package/dist/commands/node/wait.js +7 -0
  838. package/dist/commands/node-context.d.ts +2 -0
  839. package/dist/commands/node-context.js +2 -0
  840. package/dist/commands/node-lifecycle-revive.d.ts +12 -0
  841. package/dist/commands/node-lifecycle-revive.js +1 -0
  842. package/dist/commands/node-snapshot.d.ts +2 -0
  843. package/dist/commands/node-snapshot.js +1 -0
  844. package/dist/commands/node-transcript.d.ts +2 -0
  845. package/dist/commands/node-transcript.js +1 -0
  846. package/dist/commands/node-worktree.d.ts +2 -0
  847. package/dist/commands/node-worktree.js +1 -0
  848. package/dist/commands/node.d.ts +2 -0
  849. package/dist/commands/node.js +1 -0
  850. package/dist/commands/pkg/browse/actions.d.ts +7 -0
  851. package/dist/commands/pkg/browse/actions.js +1 -0
  852. package/dist/commands/pkg/browse/catalog.d.ts +9 -0
  853. package/dist/commands/pkg/browse/catalog.js +1 -0
  854. package/dist/commands/pkg/browse/command-view.d.ts +3 -0
  855. package/dist/commands/pkg/browse/command-view.js +1 -0
  856. package/dist/commands/pkg/browse/detail-panel.d.ts +66 -0
  857. package/dist/commands/pkg/browse/detail-panel.js +1 -0
  858. package/dist/commands/pkg/browse/doc-view.d.ts +3 -0
  859. package/dist/commands/pkg/browse/doc-view.js +1 -0
  860. package/dist/commands/pkg/browse/list-panel.d.ts +28 -0
  861. package/dist/commands/pkg/browse/list-panel.js +2 -0
  862. package/dist/commands/pkg/browse/model.d.ts +223 -0
  863. package/dist/commands/pkg/browse/model.js +1 -0
  864. package/dist/commands/pkg/browse/shell.d.ts +93 -0
  865. package/dist/commands/pkg/browse/shell.js +1 -0
  866. package/dist/commands/pkg/browse.d.ts +2 -0
  867. package/dist/commands/pkg/browse.js +1 -0
  868. package/dist/commands/pkg/market-inspect.d.ts +2 -0
  869. package/dist/commands/pkg/market-inspect.js +1 -0
  870. package/dist/commands/pkg/market-manage.d.ts +16 -0
  871. package/dist/commands/pkg/market-manage.js +1 -0
  872. package/dist/commands/pkg/market.d.ts +1 -0
  873. package/dist/commands/pkg/market.js +1 -0
  874. package/dist/commands/pkg/plugin-env.d.ts +3 -0
  875. package/dist/commands/pkg/plugin-env.js +4 -0
  876. package/dist/commands/pkg/plugin-inspect.d.ts +2 -0
  877. package/dist/commands/pkg/plugin-inspect.js +1 -0
  878. package/dist/commands/pkg/plugin-manage.d.ts +94 -0
  879. package/dist/commands/pkg/plugin-manage.js +17 -0
  880. package/dist/commands/pkg/plugin.d.ts +1 -0
  881. package/dist/commands/pkg/plugin.js +1 -0
  882. package/dist/commands/pkg/shared.d.ts +13 -0
  883. package/dist/commands/pkg/shared.js +1 -0
  884. package/dist/commands/pkg.d.ts +2 -0
  885. package/dist/commands/pkg.js +1 -0
  886. package/dist/commands/profile/daemon-profiles.d.ts +13 -0
  887. package/dist/commands/profile/daemon-profiles.js +4 -0
  888. package/dist/commands/profile/default.d.ts +2 -0
  889. package/dist/commands/profile/default.js +2 -0
  890. package/dist/commands/profile/delete.d.ts +1 -0
  891. package/dist/commands/profile/delete.js +1 -0
  892. package/dist/commands/profile/env.d.ts +8 -0
  893. package/dist/commands/profile/env.js +3 -0
  894. package/dist/commands/profile/kind.d.ts +1 -0
  895. package/dist/commands/profile/kind.js +1 -0
  896. package/dist/commands/profile/list.d.ts +1 -0
  897. package/dist/commands/profile/list.js +1 -0
  898. package/dist/commands/profile/meta.d.ts +4 -0
  899. package/dist/commands/profile/meta.js +1 -0
  900. package/dist/commands/profile/new.d.ts +1 -0
  901. package/dist/commands/profile/new.js +1 -0
  902. package/dist/commands/profile/pause.d.ts +2 -0
  903. package/dist/commands/profile/pause.js +1 -0
  904. package/dist/commands/profile/project.d.ts +2 -0
  905. package/dist/commands/profile/project.js +1 -0
  906. package/dist/commands/profile/rename.d.ts +1 -0
  907. package/dist/commands/profile/rename.js +1 -0
  908. package/dist/commands/profile/show.d.ts +1 -0
  909. package/dist/commands/profile/show.js +1 -0
  910. package/dist/commands/profile.d.ts +2 -0
  911. package/dist/commands/profile.js +1 -0
  912. package/dist/commands/push.d.ts +2 -0
  913. package/dist/commands/push.js +9 -0
  914. package/dist/commands/revive.d.ts +2 -0
  915. package/dist/commands/revive.js +10 -0
  916. package/dist/commands/surface/node/cycle.d.ts +1 -0
  917. package/dist/commands/surface/node/cycle.js +1 -0
  918. package/dist/commands/surface/node/focus.d.ts +1 -0
  919. package/dist/commands/surface/node/focus.js +1 -0
  920. package/dist/commands/surface/node/id.d.ts +1 -0
  921. package/dist/commands/surface/node/id.js +1 -0
  922. package/dist/commands/surface/node/pin.d.ts +1 -0
  923. package/dist/commands/surface/node/pin.js +1 -0
  924. package/dist/commands/surface/node/placement.d.ts +30 -0
  925. package/dist/commands/surface/node/placement.js +1 -0
  926. package/dist/commands/surface-edit.d.ts +2 -0
  927. package/dist/commands/surface-edit.js +1 -0
  928. package/dist/commands/surface-inbox.d.ts +2 -0
  929. package/dist/commands/surface-inbox.js +1 -0
  930. package/dist/commands/surface-inspect.d.ts +2 -0
  931. package/dist/commands/surface-inspect.js +1 -0
  932. package/dist/commands/surface-node.d.ts +2 -0
  933. package/dist/commands/surface-node.js +1 -0
  934. package/dist/commands/surface-reload.d.ts +7 -0
  935. package/dist/commands/surface-reload.js +1 -0
  936. package/dist/commands/surface-tmux-spread.d.ts +2 -0
  937. package/dist/commands/surface-tmux-spread.js +1 -0
  938. package/dist/commands/surface.d.ts +2 -0
  939. package/dist/commands/surface.js +1 -0
  940. package/dist/commands/sys/branch.d.ts +2 -0
  941. package/dist/commands/sys/branch.js +1 -0
  942. package/dist/commands/sys/config.d.ts +1 -0
  943. package/dist/commands/sys/config.js +1 -0
  944. package/dist/commands/sys/connect.d.ts +1 -0
  945. package/dist/commands/sys/connect.js +3 -0
  946. package/dist/commands/sys/context/admin/actions.d.ts +23 -0
  947. package/dist/commands/sys/context/admin/actions.js +1 -0
  948. package/dist/commands/sys/context/admin/detail-panel.d.ts +73 -0
  949. package/dist/commands/sys/context/admin/detail-panel.js +2 -0
  950. package/dist/commands/sys/context/admin/docs-panel.d.ts +63 -0
  951. package/dist/commands/sys/context/admin/docs-panel.js +1 -0
  952. package/dist/commands/sys/context/admin/list-view.d.ts +62 -0
  953. package/dist/commands/sys/context/admin/list-view.js +1 -0
  954. package/dist/commands/sys/context/admin/model.d.ts +123 -0
  955. package/dist/commands/sys/context/admin/model.js +1 -0
  956. package/dist/commands/sys/context/admin/rail-panel.d.ts +84 -0
  957. package/dist/commands/sys/context/admin/rail-panel.js +1 -0
  958. package/dist/commands/sys/context/admin/read-view.d.ts +27 -0
  959. package/dist/commands/sys/context/admin/read-view.js +1 -0
  960. package/dist/commands/sys/context/admin/shell.d.ts +125 -0
  961. package/dist/commands/sys/context/admin/shell.js +1 -0
  962. package/dist/commands/sys/context/admin.d.ts +1 -0
  963. package/dist/commands/sys/context/admin.js +2 -0
  964. package/dist/commands/sys/context/doc.d.ts +1 -0
  965. package/dist/commands/sys/context/doc.js +2 -0
  966. package/dist/commands/sys/context/expose.d.ts +1 -0
  967. package/dist/commands/sys/context/expose.js +2 -0
  968. package/dist/commands/sys/context/prompt-review.d.ts +1 -0
  969. package/dist/commands/sys/context/prompt-review.js +11 -0
  970. package/dist/commands/sys/context/resolve.d.ts +115 -0
  971. package/dist/commands/sys/context/resolve.js +8 -0
  972. package/dist/commands/sys/context/sysprompt.d.ts +1 -0
  973. package/dist/commands/sys/context/sysprompt.js +5 -0
  974. package/dist/commands/sys/context.d.ts +2 -0
  975. package/dist/commands/sys/context.js +1 -0
  976. package/dist/commands/sys/daemon.d.ts +4 -0
  977. package/dist/commands/sys/daemon.js +1 -0
  978. package/dist/commands/sys/doctor.d.ts +36 -0
  979. package/dist/commands/sys/doctor.js +1 -0
  980. package/dist/commands/sys/env.d.ts +1 -0
  981. package/dist/commands/sys/env.js +1 -0
  982. package/dist/commands/sys/feedback.d.ts +1 -0
  983. package/dist/commands/sys/feedback.js +7 -0
  984. package/dist/commands/sys/join.d.ts +1 -0
  985. package/dist/commands/sys/join.js +1 -0
  986. package/dist/commands/sys/limits.d.ts +1 -0
  987. package/dist/commands/sys/limits.js +3 -0
  988. package/dist/commands/sys/logs.d.ts +1 -0
  989. package/dist/commands/sys/logs.js +3 -0
  990. package/dist/commands/sys/migrate.d.ts +1 -0
  991. package/dist/commands/sys/migrate.js +1 -0
  992. package/dist/commands/sys/panels/broker-limits-panel.d.ts +17 -0
  993. package/dist/commands/sys/panels/broker-limits-panel.js +2 -0
  994. package/dist/commands/sys/panels/dependencies-panel.d.ts +14 -0
  995. package/dist/commands/sys/panels/dependencies-panel.js +1 -0
  996. package/dist/commands/sys/panels/keybindings-panel.d.ts +56 -0
  997. package/dist/commands/sys/panels/keybindings-panel.js +1 -0
  998. package/dist/commands/sys/panels/models-panel.d.ts +100 -0
  999. package/dist/commands/sys/panels/models-panel.js +1 -0
  1000. package/dist/commands/sys/panels/plugin-env-panel.d.ts +19 -0
  1001. package/dist/commands/sys/panels/plugin-env-panel.js +2 -0
  1002. package/dist/commands/sys/panels/plugins-panel.d.ts +16 -0
  1003. package/dist/commands/sys/panels/plugins-panel.js +1 -0
  1004. package/dist/commands/sys/panels/prefs-panel.d.ts +21 -0
  1005. package/dist/commands/sys/panels/prefs-panel.js +1 -0
  1006. package/dist/commands/sys/panels/profiles-panel.d.ts +70 -0
  1007. package/dist/commands/sys/panels/profiles-panel.js +1 -0
  1008. package/dist/commands/sys/panels/provider-panel.d.ts +68 -0
  1009. package/dist/commands/sys/panels/provider-panel.js +1 -0
  1010. package/dist/commands/sys/panels/terminal-panel.d.ts +19 -0
  1011. package/dist/commands/sys/panels/terminal-panel.js +1 -0
  1012. package/dist/commands/sys/provider-login.d.ts +8 -0
  1013. package/dist/commands/sys/provider-login.js +9 -0
  1014. package/dist/commands/sys/retry-delivery.d.ts +1 -0
  1015. package/dist/commands/sys/retry-delivery.js +1 -0
  1016. package/dist/commands/sys/settings-shell.d.ts +54 -0
  1017. package/dist/commands/sys/settings-shell.js +1 -0
  1018. package/dist/commands/sys/settings.d.ts +2 -0
  1019. package/dist/commands/sys/settings.js +1 -0
  1020. package/dist/commands/sys/setup-core.d.ts +121 -0
  1021. package/dist/commands/sys/setup-core.js +9 -0
  1022. package/dist/commands/sys/setup-settings-runner.d.ts +13 -0
  1023. package/dist/commands/sys/setup-settings-runner.js +1 -0
  1024. package/dist/commands/sys/setup-wizard.d.ts +52 -0
  1025. package/dist/commands/sys/setup-wizard.js +1 -0
  1026. package/dist/commands/sys/setup.d.ts +6 -0
  1027. package/dist/commands/sys/setup.js +1 -0
  1028. package/dist/commands/sys/shared.d.ts +51 -0
  1029. package/dist/commands/sys/shared.js +1 -0
  1030. package/dist/commands/sys/spaces.d.ts +1 -0
  1031. package/dist/commands/sys/spaces.js +2 -0
  1032. package/dist/commands/sys/support/prepare.d.ts +13 -0
  1033. package/dist/commands/sys/support/prepare.js +3 -0
  1034. package/dist/commands/sys/support/submit.d.ts +19 -0
  1035. package/dist/commands/sys/support/submit.js +6 -0
  1036. package/dist/commands/sys/support.d.ts +2 -0
  1037. package/dist/commands/sys/support.js +1 -0
  1038. package/dist/commands/sys/sync-deps.d.ts +16 -0
  1039. package/dist/commands/sys/sync-deps.js +14 -0
  1040. package/dist/commands/sys/sync-project-guidance.d.ts +1 -0
  1041. package/dist/commands/sys/sync-project-guidance.js +5 -0
  1042. package/dist/commands/sys/sync-shared.d.ts +44 -0
  1043. package/dist/commands/sys/sync-shared.js +1 -0
  1044. package/dist/commands/sys/sync-skills.d.ts +1 -0
  1045. package/dist/commands/sys/sync-skills.js +2 -0
  1046. package/dist/commands/sys/sync.d.ts +2 -0
  1047. package/dist/commands/sys/sync.js +1 -0
  1048. package/dist/commands/sys/terminal-option.d.ts +112 -0
  1049. package/dist/commands/sys/terminal-option.js +15 -0
  1050. package/dist/commands/sys/tutorial/branch.d.ts +1 -0
  1051. package/dist/commands/sys/tutorial/branch.js +1 -0
  1052. package/dist/commands/sys/tutorial/lessons.d.ts +5 -0
  1053. package/dist/commands/sys/tutorial/lessons.js +8 -0
  1054. package/dist/commands/sys/tutorial/scenario.d.ts +1 -0
  1055. package/dist/commands/sys/tutorial/scenario.js +3 -0
  1056. package/dist/commands/sys/tutorial/tracks.d.ts +1 -0
  1057. package/dist/commands/sys/tutorial/tracks.js +4 -0
  1058. package/dist/commands/sys/update.d.ts +2 -0
  1059. package/dist/commands/sys/update.js +1 -0
  1060. package/dist/commands/sys/worktrees.d.ts +2 -0
  1061. package/dist/commands/sys/worktrees.js +5 -0
  1062. package/dist/commands/sys.d.ts +2 -0
  1063. package/dist/commands/sys.js +1 -0
  1064. package/dist/core/activity-signal.d.ts +7 -0
  1065. package/dist/core/activity-signal.js +2 -0
  1066. package/dist/core/asset-root.d.ts +7 -0
  1067. package/dist/core/asset-root.js +1 -0
  1068. package/dist/core/auth-file.d.ts +41 -0
  1069. package/dist/core/auth-file.js +2 -0
  1070. package/dist/core/auth-interaction.d.ts +19 -0
  1071. package/dist/core/auth-interaction.js +3 -0
  1072. package/dist/core/auto-update.d.ts +1 -0
  1073. package/dist/core/auto-update.js +4 -0
  1074. package/dist/core/bash-guard.d.ts +6 -0
  1075. package/dist/core/bash-guard.js +11 -0
  1076. package/dist/core/bash-job-supervisor.d.ts +5 -0
  1077. package/dist/core/bash-job-supervisor.js +4 -0
  1078. package/dist/core/bash-jobs.d.ts +180 -0
  1079. package/dist/core/bash-jobs.js +8 -0
  1080. package/dist/core/bootstrap.d.ts +1 -0
  1081. package/dist/core/bootstrap.js +2 -0
  1082. package/dist/core/broker-client/client.d.ts +89 -0
  1083. package/dist/core/broker-client/client.js +1 -0
  1084. package/dist/core/broker-client/index.d.ts +1 -0
  1085. package/dist/core/broker-client/index.js +1 -0
  1086. package/dist/core/broker-client/transport-relay.d.ts +47 -0
  1087. package/dist/core/broker-client/transport-relay.js +1 -0
  1088. package/dist/core/broker-client/transport-socket.d.ts +35 -0
  1089. package/dist/core/broker-client/transport-socket.js +1 -0
  1090. package/dist/core/broker-client/transport.d.ts +36 -0
  1091. package/dist/core/broker-client/transport.js +1 -0
  1092. package/dist/core/canvas/app-run.d.ts +3 -0
  1093. package/dist/core/canvas/app-run.js +1 -0
  1094. package/dist/core/canvas/attention.d.ts +18 -0
  1095. package/dist/core/canvas/attention.js +1 -0
  1096. package/dist/core/canvas/boot-id.d.ts +6 -0
  1097. package/dist/core/canvas/boot-id.js +1 -0
  1098. package/dist/core/canvas/boot.d.ts +92 -0
  1099. package/dist/core/canvas/boot.js +1 -0
  1100. package/dist/core/canvas/browse/app.d.ts +26 -0
  1101. package/dist/core/canvas/browse/app.js +3 -0
  1102. package/dist/core/canvas/browse/model.d.ts +172 -0
  1103. package/dist/core/canvas/browse/model.js +1 -0
  1104. package/dist/core/canvas/browse/pins.d.ts +4 -0
  1105. package/dist/core/canvas/browse/pins.js +1 -0
  1106. package/dist/core/canvas/browse/render.d.ts +98 -0
  1107. package/dist/core/canvas/browse/render.js +3 -0
  1108. package/dist/core/canvas/canvas.d.ts +397 -0
  1109. package/dist/core/canvas/canvas.js +65 -0
  1110. package/dist/core/canvas/context-strip.d.ts +20 -0
  1111. package/dist/core/canvas/context-strip.js +5 -0
  1112. package/dist/core/canvas/crons.d.ts +298 -0
  1113. package/dist/core/canvas/crons.js +36 -0
  1114. package/dist/core/canvas/daemon-actions.d.ts +45 -0
  1115. package/dist/core/canvas/daemon-actions.js +28 -0
  1116. package/dist/core/canvas/daemon-owner.d.ts +67 -0
  1117. package/dist/core/canvas/daemon-owner.js +6 -0
  1118. package/dist/core/canvas/db.d.ts +33 -0
  1119. package/dist/core/canvas/db.js +2 -0
  1120. package/dist/core/canvas/deliveries.d.ts +120 -0
  1121. package/dist/core/canvas/deliveries.js +102 -0
  1122. package/dist/core/canvas/delivery-contract.d.ts +37 -0
  1123. package/dist/core/canvas/delivery-contract.js +1 -0
  1124. package/dist/core/canvas/executions.d.ts +29 -0
  1125. package/dist/core/canvas/executions.js +1 -0
  1126. package/dist/core/canvas/extensions.d.ts +9 -0
  1127. package/dist/core/canvas/extensions.js +1 -0
  1128. package/dist/core/canvas/focuses.d.ts +22 -0
  1129. package/dist/core/canvas/focuses.js +1 -0
  1130. package/dist/core/canvas/history.d.ts +104 -0
  1131. package/dist/core/canvas/history.js +14 -0
  1132. package/dist/core/canvas/index.d.ts +14 -0
  1133. package/dist/core/canvas/index.js +1 -0
  1134. package/dist/core/canvas/install-id.d.ts +9 -0
  1135. package/dist/core/canvas/install-id.js +1 -0
  1136. package/dist/core/canvas/labels.d.ts +30 -0
  1137. package/dist/core/canvas/labels.js +1 -0
  1138. package/dist/core/canvas/managed-worktree-sweep-candidates.d.ts +4 -0
  1139. package/dist/core/canvas/managed-worktree-sweep-candidates.js +12 -0
  1140. package/dist/core/canvas/memory-reads.d.ts +24 -0
  1141. package/dist/core/canvas/memory-reads.js +1 -0
  1142. package/dist/core/canvas/meta-file.d.ts +20 -0
  1143. package/dist/core/canvas/meta-file.js +1 -0
  1144. package/dist/core/canvas/migrations.d.ts +16 -0
  1145. package/dist/core/canvas/migrations.js +989 -0
  1146. package/dist/core/canvas/nav-model.d.ts +44 -0
  1147. package/dist/core/canvas/nav-model.js +1 -0
  1148. package/dist/core/canvas/nav-render.d.ts +136 -0
  1149. package/dist/core/canvas/nav-render.js +1 -0
  1150. package/dist/core/canvas/node-agent-paths.d.ts +8 -0
  1151. package/dist/core/canvas/node-agent-paths.js +1 -0
  1152. package/dist/core/canvas/node-order.d.ts +24 -0
  1153. package/dist/core/canvas/node-order.js +1 -0
  1154. package/dist/core/canvas/node-recap.d.ts +23 -0
  1155. package/dist/core/canvas/node-recap.js +2 -0
  1156. package/dist/core/canvas/node-sql-migration.d.ts +4 -0
  1157. package/dist/core/canvas/node-sql-migration.js +80 -0
  1158. package/dist/core/canvas/node-tokens.d.ts +24 -0
  1159. package/dist/core/canvas/node-tokens.js +5 -0
  1160. package/dist/core/canvas/outcome-actions.d.ts +23 -0
  1161. package/dist/core/canvas/outcome-actions.js +6 -0
  1162. package/dist/core/canvas/paths.d.ts +72 -0
  1163. package/dist/core/canvas/paths.js +1 -0
  1164. package/dist/core/canvas/pid.d.ts +391 -0
  1165. package/dist/core/canvas/pid.js +5 -0
  1166. package/dist/core/canvas/recovery.d.ts +90 -0
  1167. package/dist/core/canvas/recovery.js +26 -0
  1168. package/dist/core/canvas/remote-canvas-source.d.ts +70 -0
  1169. package/dist/core/canvas/remote-canvas-source.js +1 -0
  1170. package/dist/core/canvas/remote-transport.d.ts +7 -0
  1171. package/dist/core/canvas/remote-transport.js +1 -0
  1172. package/dist/core/canvas/render-source.d.ts +193 -0
  1173. package/dist/core/canvas/render-source.js +7 -0
  1174. package/dist/core/canvas/sessions.d.ts +57 -0
  1175. package/dist/core/canvas/sessions.js +4 -0
  1176. package/dist/core/canvas/source.d.ts +48 -0
  1177. package/dist/core/canvas/source.js +1 -0
  1178. package/dist/core/canvas/status-glyph.d.ts +52 -0
  1179. package/dist/core/canvas/status-glyph.js +1 -0
  1180. package/dist/core/canvas/structured-requests.d.ts +69 -0
  1181. package/dist/core/canvas/structured-requests.js +15 -0
  1182. package/dist/core/canvas/telemetry.d.ts +14 -0
  1183. package/dist/core/canvas/telemetry.js +1 -0
  1184. package/dist/core/canvas/tree.d.ts +29 -0
  1185. package/dist/core/canvas/tree.js +12 -0
  1186. package/dist/core/canvas/types.d.ts +454 -0
  1187. package/dist/core/canvas/types.js +1 -0
  1188. package/dist/core/canvas/waits.d.ts +18 -0
  1189. package/dist/core/canvas/waits.js +6 -0
  1190. package/dist/core/canvas/worktrees.d.ts +41 -0
  1191. package/dist/core/canvas/worktrees.js +1 -0
  1192. package/dist/core/clipboard-text.d.ts +11 -0
  1193. package/dist/core/clipboard-text.js +1 -0
  1194. package/dist/core/command-hooks/artifact.d.ts +16 -0
  1195. package/dist/core/command-hooks/artifact.js +1 -0
  1196. package/dist/core/command-hooks/catalog.d.ts +14 -0
  1197. package/dist/core/command-hooks/catalog.js +1 -0
  1198. package/dist/core/command-hooks/compose.d.ts +15 -0
  1199. package/dist/core/command-hooks/compose.js +1 -0
  1200. package/dist/core/command-hooks/discovery.d.ts +133 -0
  1201. package/dist/core/command-hooks/discovery.js +1 -0
  1202. package/dist/core/command-hooks/help.d.ts +5 -0
  1203. package/dist/core/command-hooks/help.js +1 -0
  1204. package/dist/core/command-hooks/index.d.ts +7 -0
  1205. package/dist/core/command-hooks/index.js +1 -0
  1206. package/dist/core/command-hooks/lifecycle-catalog.d.ts +21 -0
  1207. package/dist/core/command-hooks/lifecycle-catalog.js +1 -0
  1208. package/dist/core/command-hooks/lifecycle-create.d.ts +4 -0
  1209. package/dist/core/command-hooks/lifecycle-create.js +1 -0
  1210. package/dist/core/command-hooks/report.d.ts +32 -0
  1211. package/dist/core/command-hooks/report.js +1 -0
  1212. package/dist/core/command-hooks/schema.d.ts +42 -0
  1213. package/dist/core/command-hooks/schema.js +1 -0
  1214. package/dist/core/command-hooks/transport/exec-invoke.d.ts +24 -0
  1215. package/dist/core/command-hooks/transport/exec-invoke.js +1 -0
  1216. package/dist/core/command-hooks/transport/exec-lifecycle.d.ts +23 -0
  1217. package/dist/core/command-hooks/transport/exec-lifecycle.js +1 -0
  1218. package/dist/core/command-hooks/transport/plan.d.ts +3 -0
  1219. package/dist/core/command-hooks/transport/plan.js +1 -0
  1220. package/dist/core/command-manifests/registry.d.ts +67 -0
  1221. package/dist/core/command-manifests/registry.js +1 -0
  1222. package/dist/core/command-plugins/bundle.d.ts +149 -0
  1223. package/dist/core/command-plugins/bundle.js +1 -0
  1224. package/dist/core/command-plugins/compose.d.ts +11 -0
  1225. package/dist/core/command-plugins/compose.js +1 -0
  1226. package/dist/core/command-plugins/discovery.d.ts +50 -0
  1227. package/dist/core/command-plugins/discovery.js +1 -0
  1228. package/dist/core/command-plugins/endpoint.d.ts +24 -0
  1229. package/dist/core/command-plugins/endpoint.js +1 -0
  1230. package/dist/core/command-plugins/extensions.d.ts +20 -0
  1231. package/dist/core/command-plugins/extensions.js +1 -0
  1232. package/dist/core/command-plugins/help-addenda.d.ts +25 -0
  1233. package/dist/core/command-plugins/help-addenda.js +1 -0
  1234. package/dist/core/command-plugins/presence.d.ts +2 -0
  1235. package/dist/core/command-plugins/presence.js +1 -0
  1236. package/dist/core/command-plugins/revalidate.d.ts +18 -0
  1237. package/dist/core/command-plugins/revalidate.js +2 -0
  1238. package/dist/core/command-plugins/transport/exec-invoke.d.ts +28 -0
  1239. package/dist/core/command-plugins/transport/exec-invoke.js +1 -0
  1240. package/dist/core/command-plugins/transport/http-fetch.d.ts +41 -0
  1241. package/dist/core/command-plugins/transport/http-fetch.js +1 -0
  1242. package/dist/core/command-plugins/transport/http-invoke.d.ts +15 -0
  1243. package/dist/core/command-plugins/transport/http-invoke.js +3 -0
  1244. package/dist/core/command-plugins/transport/http-plan.d.ts +68 -0
  1245. package/dist/core/command-plugins/transport/http-plan.js +1 -0
  1246. package/dist/core/command.d.ts +210 -0
  1247. package/dist/core/command.js +10 -0
  1248. package/dist/core/config.d.ts +233 -0
  1249. package/dist/core/config.js +1 -0
  1250. package/dist/core/conversation-store/client-worker.d.ts +1 -0
  1251. package/dist/core/conversation-store/client-worker.js +1 -0
  1252. package/dist/core/conversation-store/client.d.ts +2 -0
  1253. package/dist/core/conversation-store/client.js +2 -0
  1254. package/dist/core/conversation-store/file-store.d.ts +37 -0
  1255. package/dist/core/conversation-store/file-store.js +9 -0
  1256. package/dist/core/conversation-store/index.d.ts +60 -0
  1257. package/dist/core/conversation-store/index.js +1 -0
  1258. package/dist/core/conversation-store/listener.d.ts +4 -0
  1259. package/dist/core/conversation-store/listener.js +8 -0
  1260. package/dist/core/conversation-store/patch.d.ts +1 -0
  1261. package/dist/core/conversation-store/patch.js +1 -0
  1262. package/dist/core/directory/join.d.ts +27 -0
  1263. package/dist/core/directory/join.js +1 -0
  1264. package/dist/core/disk-usage.d.ts +4 -0
  1265. package/dist/core/disk-usage.js +1 -0
  1266. package/dist/core/document-lines.d.ts +4 -0
  1267. package/dist/core/document-lines.js +3 -0
  1268. package/dist/core/editor-resolver.d.ts +28 -0
  1269. package/dist/core/editor-resolver.js +4 -0
  1270. package/dist/core/env-name.d.ts +6 -0
  1271. package/dist/core/env-name.js +1 -0
  1272. package/dist/core/errors.d.ts +38 -0
  1273. package/dist/core/errors.js +1 -0
  1274. package/dist/core/events/emit.d.ts +6 -0
  1275. package/dist/core/events/emit.js +3 -0
  1276. package/dist/core/events/envelope.d.ts +2 -0
  1277. package/dist/core/events/envelope.js +1 -0
  1278. package/dist/core/events/errors.d.ts +4 -0
  1279. package/dist/core/events/errors.js +1 -0
  1280. package/dist/core/events/index.d.ts +5 -0
  1281. package/dist/core/events/index.js +1 -0
  1282. package/dist/core/events/operation-id.d.ts +4 -0
  1283. package/dist/core/events/operation-id.js +1 -0
  1284. package/dist/core/events/read.d.ts +40 -0
  1285. package/dist/core/events/read.js +1 -0
  1286. package/dist/core/events/serialize.d.ts +4 -0
  1287. package/dist/core/events/serialize.js +1 -0
  1288. package/dist/core/events/source.d.ts +16 -0
  1289. package/dist/core/events/source.js +1 -0
  1290. package/dist/core/events/types.d.ts +68 -0
  1291. package/dist/core/events/types.js +1 -0
  1292. package/dist/core/exclusive-lock.d.ts +34 -0
  1293. package/dist/core/exclusive-lock.js +1 -0
  1294. package/dist/core/fault-classifier.d.ts +34 -0
  1295. package/dist/core/fault-classifier.js +1 -0
  1296. package/dist/core/feed/feed.d.ts +63 -0
  1297. package/dist/core/feed/feed.js +4 -0
  1298. package/dist/core/feed/inbox-migrate.d.ts +11 -0
  1299. package/dist/core/feed/inbox-migrate.js +3 -0
  1300. package/dist/core/feed/inbox.d.ts +34 -0
  1301. package/dist/core/feed/inbox.js +1 -0
  1302. package/dist/core/feed/messages.d.ts +83 -0
  1303. package/dist/core/feed/messages.js +8 -0
  1304. package/dist/core/feed/reports.d.ts +10 -0
  1305. package/dist/core/feed/reports.js +2 -0
  1306. package/dist/core/frontmatter.d.ts +8 -0
  1307. package/dist/core/frontmatter.js +1 -0
  1308. package/dist/core/fs-utils.d.ts +44 -0
  1309. package/dist/core/fs-utils.js +3 -0
  1310. package/dist/core/git.d.ts +28 -0
  1311. package/dist/core/git.js +2 -0
  1312. package/dist/core/grants/local.d.ts +4 -0
  1313. package/dist/core/grants/local.js +1 -0
  1314. package/dist/core/grants/mirror.d.ts +76 -0
  1315. package/dist/core/grants/mirror.js +4 -0
  1316. package/dist/core/grants/on-sync.d.ts +22 -0
  1317. package/dist/core/grants/on-sync.js +1 -0
  1318. package/dist/core/grants/remove.d.ts +7 -0
  1319. package/dist/core/grants/remove.js +1 -0
  1320. package/dist/core/grants/sandboxes.d.ts +7 -0
  1321. package/dist/core/grants/sandboxes.js +1 -0
  1322. package/dist/core/grants/sync.d.ts +40 -0
  1323. package/dist/core/grants/sync.js +1 -0
  1324. package/dist/core/grants/watch.d.ts +14 -0
  1325. package/dist/core/grants/watch.js +1 -0
  1326. package/dist/core/graph/access.d.ts +28 -0
  1327. package/dist/core/graph/access.js +8 -0
  1328. package/dist/core/graph/bodies.d.ts +6 -0
  1329. package/dist/core/graph/bodies.js +1 -0
  1330. package/dist/core/graph/custom.d.ts +74 -0
  1331. package/dist/core/graph/custom.js +11 -0
  1332. package/dist/core/graph/deletion.d.ts +17 -0
  1333. package/dist/core/graph/deletion.js +6 -0
  1334. package/dist/core/graph/diff.d.ts +4 -0
  1335. package/dist/core/graph/diff.js +4 -0
  1336. package/dist/core/graph/documents.d.ts +167 -0
  1337. package/dist/core/graph/documents.js +10 -0
  1338. package/dist/core/graph/edges.d.ts +25 -0
  1339. package/dist/core/graph/edges.js +1 -0
  1340. package/dist/core/graph/events.d.ts +50 -0
  1341. package/dist/core/graph/events.js +11 -0
  1342. package/dist/core/graph/exposures.d.ts +53 -0
  1343. package/dist/core/graph/exposures.js +4 -0
  1344. package/dist/core/graph/jobs.d.ts +31 -0
  1345. package/dist/core/graph/jobs.js +2 -0
  1346. package/dist/core/graph/kinds/action.d.ts +3 -0
  1347. package/dist/core/graph/kinds/action.js +1 -0
  1348. package/dist/core/graph/kinds/custom.d.ts +7 -0
  1349. package/dist/core/graph/kinds/custom.js +7 -0
  1350. package/dist/core/graph/kinds/document.d.ts +19 -0
  1351. package/dist/core/graph/kinds/document.js +5 -0
  1352. package/dist/core/graph/kinds/dto.d.ts +5 -0
  1353. package/dist/core/graph/kinds/dto.js +1 -0
  1354. package/dist/core/graph/kinds/job.d.ts +2 -0
  1355. package/dist/core/graph/kinds/job.js +2 -0
  1356. package/dist/core/graph/kinds/kind.d.ts +66 -0
  1357. package/dist/core/graph/kinds/kind.js +1 -0
  1358. package/dist/core/graph/kinds/node.d.ts +12 -0
  1359. package/dist/core/graph/kinds/node.js +5 -0
  1360. package/dist/core/graph/kinds/owner.d.ts +2 -0
  1361. package/dist/core/graph/kinds/owner.js +2 -0
  1362. package/dist/core/graph/kinds/registry.d.ts +13 -0
  1363. package/dist/core/graph/kinds/registry.js +1 -0
  1364. package/dist/core/graph/kinds/render.d.ts +9 -0
  1365. package/dist/core/graph/kinds/render.js +1 -0
  1366. package/dist/core/graph/names.d.ts +35 -0
  1367. package/dist/core/graph/names.js +3 -0
  1368. package/dist/core/graph/objects.d.ts +62 -0
  1369. package/dist/core/graph/objects.js +11 -0
  1370. package/dist/core/graph/package-docs.d.ts +32 -0
  1371. package/dist/core/graph/package-docs.js +5 -0
  1372. package/dist/core/graph/package-files.d.ts +20 -0
  1373. package/dist/core/graph/package-files.js +2 -0
  1374. package/dist/core/graph/reader.d.ts +30 -0
  1375. package/dist/core/graph/reader.js +3 -0
  1376. package/dist/core/graph/receiver-url.d.ts +11 -0
  1377. package/dist/core/graph/receiver-url.js +1 -0
  1378. package/dist/core/graph/receivers.d.ts +26 -0
  1379. package/dist/core/graph/receivers.js +7 -0
  1380. package/dist/core/graph/repo-sync/exchange.d.ts +34 -0
  1381. package/dist/core/graph/repo-sync/exchange.js +2 -0
  1382. package/dist/core/graph/repo-sync/identity.d.ts +30 -0
  1383. package/dist/core/graph/repo-sync/identity.js +1 -0
  1384. package/dist/core/graph/repo-sync/index.d.ts +4 -0
  1385. package/dist/core/graph/repo-sync/index.js +1 -0
  1386. package/dist/core/graph/repo-sync/mirror.d.ts +30 -0
  1387. package/dist/core/graph/repo-sync/mirror.js +6 -0
  1388. package/dist/core/graph/repo-sync/ref-format.d.ts +76 -0
  1389. package/dist/core/graph/repo-sync/ref-format.js +2 -0
  1390. package/dist/core/graph/repo-sync/repos.d.ts +19 -0
  1391. package/dist/core/graph/repo-sync/repos.js +3 -0
  1392. package/dist/core/graph/repo-sync/sync.d.ts +42 -0
  1393. package/dist/core/graph/repo-sync/sync.js +2 -0
  1394. package/dist/core/graph/rules.d.ts +26 -0
  1395. package/dist/core/graph/rules.js +3 -0
  1396. package/dist/core/graph/spaces/app.d.ts +3 -0
  1397. package/dist/core/graph/spaces/app.js +1 -0
  1398. package/dist/core/graph/spaces/index.d.ts +19 -0
  1399. package/dist/core/graph/spaces/index.js +1 -0
  1400. package/dist/core/graph/spaces/person.d.ts +5 -0
  1401. package/dist/core/graph/spaces/person.js +3 -0
  1402. package/dist/core/graph/spaces/repo.d.ts +13 -0
  1403. package/dist/core/graph/spaces/repo.js +1 -0
  1404. package/dist/core/graph/types.d.ts +94 -0
  1405. package/dist/core/graph/types.js +1 -0
  1406. package/dist/core/graph/watches.d.ts +62 -0
  1407. package/dist/core/graph/watches.js +18 -0
  1408. package/dist/core/help.d.ts +309 -0
  1409. package/dist/core/help.js +9 -0
  1410. package/dist/core/host-exports/builtins.d.ts +50 -0
  1411. package/dist/core/host-exports/builtins.js +9 -0
  1412. package/dist/core/host-exports/export.d.ts +31 -0
  1413. package/dist/core/host-exports/export.js +3 -0
  1414. package/dist/core/human/action-binding.d.ts +23 -0
  1415. package/dist/core/human/action-binding.js +1 -0
  1416. package/dist/core/human/answer-text.d.ts +5 -0
  1417. package/dist/core/human/answer-text.js +5 -0
  1418. package/dist/core/human/answer.d.ts +53 -0
  1419. package/dist/core/human/answer.js +1 -0
  1420. package/dist/core/human/claim.d.ts +23 -0
  1421. package/dist/core/human/claim.js +3 -0
  1422. package/dist/core/human/completion.d.ts +38 -0
  1423. package/dist/core/human/completion.js +1 -0
  1424. package/dist/core/human/component-docs.d.ts +18 -0
  1425. package/dist/core/human/component-docs.js +248 -0
  1426. package/dist/core/human/convention.d.ts +31 -0
  1427. package/dist/core/human/convention.js +2 -0
  1428. package/dist/core/human/feedback-companion.d.ts +19 -0
  1429. package/dist/core/human/feedback-companion.js +1 -0
  1430. package/dist/core/human/feedback.d.ts +62 -0
  1431. package/dist/core/human/feedback.js +1 -0
  1432. package/dist/core/human/page-authoring.d.ts +30 -0
  1433. package/dist/core/human/page-authoring.js +1 -0
  1434. package/dist/core/human/page-catalog.d.ts +57 -0
  1435. package/dist/core/human/page-catalog.js +1 -0
  1436. package/dist/core/human/page-errors.d.ts +4 -0
  1437. package/dist/core/human/page-errors.js +1 -0
  1438. package/dist/core/human/page-eval.d.ts +25 -0
  1439. package/dist/core/human/page-eval.js +1 -0
  1440. package/dist/core/human/page-html-markdown.d.ts +8 -0
  1441. package/dist/core/human/page-html-markdown.js +8 -0
  1442. package/dist/core/human/page-markdown.d.ts +3 -0
  1443. package/dist/core/human/page-markdown.js +17 -0
  1444. package/dist/core/human/page-schema.d.ts +289 -0
  1445. package/dist/core/human/page-schema.js +1 -0
  1446. package/dist/core/human/page-synth.d.ts +7 -0
  1447. package/dist/core/human/page-synth.js +11 -0
  1448. package/dist/core/human/page.d.ts +16 -0
  1449. package/dist/core/human/page.js +1 -0
  1450. package/dist/core/human/requests.d.ts +146 -0
  1451. package/dist/core/human/requests.js +82 -0
  1452. package/dist/core/human/review-schema.d.ts +20 -0
  1453. package/dist/core/human/review-schema.js +1 -0
  1454. package/dist/core/human/root.d.ts +4 -0
  1455. package/dist/core/human/root.js +1 -0
  1456. package/dist/core/human/scan.d.ts +6 -0
  1457. package/dist/core/human/scan.js +1 -0
  1458. package/dist/core/human/summary.d.ts +3 -0
  1459. package/dist/core/human/summary.js +1 -0
  1460. package/dist/core/human/tickets.d.ts +68 -0
  1461. package/dist/core/human/tickets.js +1 -0
  1462. package/dist/core/human/types.d.ts +118 -0
  1463. package/dist/core/human/types.js +0 -0
  1464. package/dist/core/human/visible-paths.d.ts +9 -0
  1465. package/dist/core/human/visible-paths.js +1 -0
  1466. package/dist/core/human-actions.d.ts +25 -0
  1467. package/dist/core/human-actions.js +1 -0
  1468. package/dist/core/inspector/chrome.d.ts +6 -0
  1469. package/dist/core/inspector/chrome.js +1 -0
  1470. package/dist/core/inspector/contract.d.ts +105 -0
  1471. package/dist/core/inspector/contract.js +0 -0
  1472. package/dist/core/inspector/core.d.ts +39 -0
  1473. package/dist/core/inspector/core.js +2 -0
  1474. package/dist/core/inspector/host.d.ts +46 -0
  1475. package/dist/core/inspector/host.js +4 -0
  1476. package/dist/core/inspector/model.d.ts +88 -0
  1477. package/dist/core/inspector/model.js +2 -0
  1478. package/dist/core/inspector/text.d.ts +5 -0
  1479. package/dist/core/inspector/text.js +6 -0
  1480. package/dist/core/inspector/transport.d.ts +6 -0
  1481. package/dist/core/inspector/transport.js +1 -0
  1482. package/dist/core/inspector/tui.d.ts +3 -0
  1483. package/dist/core/inspector/tui.js +2 -0
  1484. package/dist/core/installed-plugins.d.ts +2 -0
  1485. package/dist/core/installed-plugins.js +1 -0
  1486. package/dist/core/io.d.ts +122 -0
  1487. package/dist/core/io.js +7 -0
  1488. package/dist/core/keybindings/attach-control.d.ts +49 -0
  1489. package/dist/core/keybindings/attach-control.js +1 -0
  1490. package/dist/core/keybindings/background-bash.d.ts +13 -0
  1491. package/dist/core/keybindings/background-bash.js +1 -0
  1492. package/dist/core/keybindings/catalog.d.ts +18 -0
  1493. package/dist/core/keybindings/catalog.js +1 -0
  1494. package/dist/core/keybindings/inbox.d.ts +18 -0
  1495. package/dist/core/keybindings/inbox.js +1 -0
  1496. package/dist/core/keybindings/index.d.ts +8 -0
  1497. package/dist/core/keybindings/index.js +1 -0
  1498. package/dist/core/keybindings/match.d.ts +44 -0
  1499. package/dist/core/keybindings/match.js +1 -0
  1500. package/dist/core/keybindings/persistence.d.ts +18 -0
  1501. package/dist/core/keybindings/persistence.js +1 -0
  1502. package/dist/core/keybindings/resolve.d.ts +28 -0
  1503. package/dist/core/keybindings/resolve.js +1 -0
  1504. package/dist/core/keybindings/types.d.ts +42 -0
  1505. package/dist/core/keybindings/types.js +0 -0
  1506. package/dist/core/layout-migrate/index.d.ts +38 -0
  1507. package/dist/core/layout-migrate/index.js +4 -0
  1508. package/dist/core/layout-migrate/loose-keys.d.ts +2 -0
  1509. package/dist/core/layout-migrate/loose-keys.js +1 -0
  1510. package/dist/core/layout-migrate/paths.d.ts +30 -0
  1511. package/dist/core/layout-migrate/paths.js +1 -0
  1512. package/dist/core/layout-migrate/stored-paths.d.ts +9 -0
  1513. package/dist/core/layout-migrate/stored-paths.js +11 -0
  1514. package/dist/core/layout-migrate/stores.d.ts +30 -0
  1515. package/dist/core/layout-migrate/stores.js +3 -0
  1516. package/dist/core/layout.d.ts +34 -0
  1517. package/dist/core/layout.js +2 -0
  1518. package/dist/core/llm/body-limits.d.ts +7 -0
  1519. package/dist/core/llm/body-limits.js +1 -0
  1520. package/dist/core/llm/refusal.d.ts +13 -0
  1521. package/dist/core/llm/refusal.js +1 -0
  1522. package/dist/core/llm/run.d.ts +60 -0
  1523. package/dist/core/llm/run.js +4 -0
  1524. package/dist/core/locked-file.d.ts +27 -0
  1525. package/dist/core/locked-file.js +1 -0
  1526. package/dist/core/log.d.ts +9 -0
  1527. package/dist/core/log.js +5 -0
  1528. package/dist/core/manifest-recovery.d.ts +15 -0
  1529. package/dist/core/manifest-recovery.js +1 -0
  1530. package/dist/core/manifest-stale.d.ts +18 -0
  1531. package/dist/core/manifest-stale.js +1 -0
  1532. package/dist/core/manifest.d.ts +5 -0
  1533. package/dist/core/manifest.js +1 -0
  1534. package/dist/core/model-auth/daemon-login.d.ts +13 -0
  1535. package/dist/core/model-auth/daemon-login.js +1 -0
  1536. package/dist/core/model-auth/flows.d.ts +50 -0
  1537. package/dist/core/model-auth/flows.js +1 -0
  1538. package/dist/core/model-auth/handoff-jti.d.ts +4 -0
  1539. package/dist/core/model-auth/handoff-jti.js +1 -0
  1540. package/dist/core/model-config.d.ts +20 -0
  1541. package/dist/core/model-config.js +1 -0
  1542. package/dist/core/model-routes.d.ts +90 -0
  1543. package/dist/core/model-routes.js +1 -0
  1544. package/dist/core/nvim-launch.d.ts +7 -0
  1545. package/dist/core/nvim-launch.js +1 -0
  1546. package/dist/core/output.d.ts +35 -0
  1547. package/dist/core/output.js +7 -0
  1548. package/dist/core/pagination.d.ts +35 -0
  1549. package/dist/core/pagination.js +1 -0
  1550. package/dist/core/plugin-env.d.ts +8 -0
  1551. package/dist/core/plugin-env.js +1 -0
  1552. package/dist/core/plugin-extensions.d.ts +29 -0
  1553. package/dist/core/plugin-extensions.js +1 -0
  1554. package/dist/core/plugin-swap-lock.d.ts +9 -0
  1555. package/dist/core/plugin-swap-lock.js +1 -0
  1556. package/dist/core/pool-credential-store.d.ts +34 -0
  1557. package/dist/core/pool-credential-store.js +1 -0
  1558. package/dist/core/predicate.d.ts +65 -0
  1559. package/dist/core/predicate.js +1 -0
  1560. package/dist/core/preview-registry.d.ts +59 -0
  1561. package/dist/core/preview-registry.js +3 -0
  1562. package/dist/core/preview-result-path.d.ts +4 -0
  1563. package/dist/core/preview-result-path.js +1 -0
  1564. package/dist/core/profiles/app-env-store.d.ts +4 -0
  1565. package/dist/core/profiles/app-env-store.js +2 -0
  1566. package/dist/core/profiles/default-binding.d.ts +15 -0
  1567. package/dist/core/profiles/default-binding.js +1 -0
  1568. package/dist/core/profiles/deletion-reservation.d.ts +12 -0
  1569. package/dist/core/profiles/deletion-reservation.js +1 -0
  1570. package/dist/core/profiles/env-store.d.ts +22 -0
  1571. package/dist/core/profiles/env-store.js +2 -0
  1572. package/dist/core/profiles/fuzzy-match.d.ts +19 -0
  1573. package/dist/core/profiles/fuzzy-match.js +1 -0
  1574. package/dist/core/profiles/manifest.d.ts +120 -0
  1575. package/dist/core/profiles/manifest.js +1 -0
  1576. package/dist/core/profiles/select.d.ts +46 -0
  1577. package/dist/core/profiles/select.js +35 -0
  1578. package/dist/core/provider-credential.d.ts +6 -0
  1579. package/dist/core/provider-credential.js +1 -0
  1580. package/dist/core/provider-error-recognition.d.ts +27 -0
  1581. package/dist/core/provider-error-recognition.js +1 -0
  1582. package/dist/core/provider-failure.d.ts +42 -0
  1583. package/dist/core/provider-failure.js +1 -0
  1584. package/dist/core/provider-management.d.ts +12 -0
  1585. package/dist/core/provider-management.js +1 -0
  1586. package/dist/core/providers/approval.d.ts +23 -0
  1587. package/dist/core/providers/approval.js +3 -0
  1588. package/dist/core/providers/audit.d.ts +28 -0
  1589. package/dist/core/providers/audit.js +4 -0
  1590. package/dist/core/providers/bundles.d.ts +68 -0
  1591. package/dist/core/providers/bundles.js +2 -0
  1592. package/dist/core/providers/call.d.ts +62 -0
  1593. package/dist/core/providers/call.js +1 -0
  1594. package/dist/core/providers/errors.d.ts +97 -0
  1595. package/dist/core/providers/errors.js +1 -0
  1596. package/dist/core/providers/files.d.ts +89 -0
  1597. package/dist/core/providers/files.js +1 -0
  1598. package/dist/core/providers/inflight.d.ts +13 -0
  1599. package/dist/core/providers/inflight.js +1 -0
  1600. package/dist/core/providers/mint.d.ts +27 -0
  1601. package/dist/core/providers/mint.js +1 -0
  1602. package/dist/core/providers/receipts.d.ts +9 -0
  1603. package/dist/core/providers/receipts.js +3 -0
  1604. package/dist/core/providers/request.d.ts +27 -0
  1605. package/dist/core/providers/request.js +1 -0
  1606. package/dist/core/providers/token-cache.d.ts +44 -0
  1607. package/dist/core/providers/token-cache.js +1 -0
  1608. package/dist/core/rate-limit-scope.d.ts +25 -0
  1609. package/dist/core/rate-limit-scope.js +1 -0
  1610. package/dist/core/remote-canvas-target.d.ts +4 -0
  1611. package/dist/core/remote-canvas-target.js +1 -0
  1612. package/dist/core/render.d.ts +12 -0
  1613. package/dist/core/render.js +18 -0
  1614. package/dist/core/resolver.d.ts +14 -0
  1615. package/dist/core/resolver.js +1 -0
  1616. package/dist/core/review/birth.d.ts +7 -0
  1617. package/dist/core/review/birth.js +1 -0
  1618. package/dist/core/review/comments.d.ts +69 -0
  1619. package/dist/core/review/comments.js +21 -0
  1620. package/dist/core/review/companion.d.ts +33 -0
  1621. package/dist/core/review/companion.js +1 -0
  1622. package/dist/core/review/document.d.ts +27 -0
  1623. package/dist/core/review/document.js +2 -0
  1624. package/dist/core/review/fork.d.ts +8 -0
  1625. package/dist/core/review/fork.js +5 -0
  1626. package/dist/core/review/project.d.ts +17 -0
  1627. package/dist/core/review/project.js +1 -0
  1628. package/dist/core/review/realize.d.ts +3 -0
  1629. package/dist/core/review/realize.js +1 -0
  1630. package/dist/core/review/remap.d.ts +24 -0
  1631. package/dist/core/review/remap.js +19 -0
  1632. package/dist/core/review/signal.d.ts +5 -0
  1633. package/dist/core/review/signal.js +1 -0
  1634. package/dist/core/review/stage.d.ts +38 -0
  1635. package/dist/core/review/stage.js +1 -0
  1636. package/dist/core/review/store.d.ts +44 -0
  1637. package/dist/core/review/store.js +1 -0
  1638. package/dist/core/review/types.d.ts +139 -0
  1639. package/dist/core/review/types.js +1 -0
  1640. package/dist/core/runs/activity.d.ts +11 -0
  1641. package/dist/core/runs/activity.js +6 -0
  1642. package/dist/core/runs/confinement.d.ts +23 -0
  1643. package/dist/core/runs/confinement.js +2 -0
  1644. package/dist/core/runs/events.d.ts +41 -0
  1645. package/dist/core/runs/events.js +7 -0
  1646. package/dist/core/runs/operations.d.ts +75 -0
  1647. package/dist/core/runs/operations.js +12 -0
  1648. package/dist/core/runs/questions.d.ts +73 -0
  1649. package/dist/core/runs/questions.js +4 -0
  1650. package/dist/core/runtime/advertised-command-invocation.d.ts +20 -0
  1651. package/dist/core/runtime/advertised-command-invocation.js +1 -0
  1652. package/dist/core/runtime/auth-reload.d.ts +7 -0
  1653. package/dist/core/runtime/auth-reload.js +1 -0
  1654. package/dist/core/runtime/banner.d.ts +15 -0
  1655. package/dist/core/runtime/banner.js +1 -0
  1656. package/dist/core/runtime/bearings-render.d.ts +62 -0
  1657. package/dist/core/runtime/bearings-render.js +18 -0
  1658. package/dist/core/runtime/bearings.d.ts +56 -0
  1659. package/dist/core/runtime/bearings.js +7 -0
  1660. package/dist/core/runtime/bin-contributions.d.ts +44 -0
  1661. package/dist/core/runtime/bin-contributions.js +2 -0
  1662. package/dist/core/runtime/boot-root.d.ts +34 -0
  1663. package/dist/core/runtime/boot-root.js +5 -0
  1664. package/dist/core/runtime/branded-host.d.ts +55 -0
  1665. package/dist/core/runtime/branded-host.js +2 -0
  1666. package/dist/core/runtime/broker/cli-relay.d.ts +5 -0
  1667. package/dist/core/runtime/broker/cli-relay.js +1 -0
  1668. package/dist/core/runtime/broker/client-registry.d.ts +36 -0
  1669. package/dist/core/runtime/broker/client-registry.js +1 -0
  1670. package/dist/core/runtime/broker/daemon-ops.d.ts +65 -0
  1671. package/dist/core/runtime/broker/daemon-ops.js +1 -0
  1672. package/dist/core/runtime/broker/engine-drive.d.ts +37 -0
  1673. package/dist/core/runtime/broker/engine-drive.js +1 -0
  1674. package/dist/core/runtime/broker/engine-routing.d.ts +143 -0
  1675. package/dist/core/runtime/broker/engine-routing.js +1 -0
  1676. package/dist/core/runtime/broker/event-projection.d.ts +43 -0
  1677. package/dist/core/runtime/broker/event-projection.js +1 -0
  1678. package/dist/core/runtime/broker/extension-abort.d.ts +15 -0
  1679. package/dist/core/runtime/broker/extension-abort.js +1 -0
  1680. package/dist/core/runtime/broker/fault-retry.d.ts +127 -0
  1681. package/dist/core/runtime/broker/fault-retry.js +1 -0
  1682. package/dist/core/runtime/broker/frame-client.d.ts +38 -0
  1683. package/dist/core/runtime/broker/frame-client.js +1 -0
  1684. package/dist/core/runtime/broker/frame-dispatch.d.ts +64 -0
  1685. package/dist/core/runtime/broker/frame-dispatch.js +1 -0
  1686. package/dist/core/runtime/broker/frame-engine-control.d.ts +21 -0
  1687. package/dist/core/runtime/broker/frame-engine-control.js +1 -0
  1688. package/dist/core/runtime/broker/frame-memory-refs.d.ts +25 -0
  1689. package/dist/core/runtime/broker/frame-memory-refs.js +1 -0
  1690. package/dist/core/runtime/broker/frame-model-query.d.ts +13 -0
  1691. package/dist/core/runtime/broker/frame-model-query.js +1 -0
  1692. package/dist/core/runtime/broker/frame-read.d.ts +19 -0
  1693. package/dist/core/runtime/broker/frame-read.js +1 -0
  1694. package/dist/core/runtime/broker/frame-replies.d.ts +24 -0
  1695. package/dist/core/runtime/broker/frame-replies.js +1 -0
  1696. package/dist/core/runtime/broker/frame-session.d.ts +34 -0
  1697. package/dist/core/runtime/broker/frame-session.js +4 -0
  1698. package/dist/core/runtime/broker/held-deferred-inbox.d.ts +15 -0
  1699. package/dist/core/runtime/broker/held-deferred-inbox.js +1 -0
  1700. package/dist/core/runtime/broker/inbox.d.ts +22 -0
  1701. package/dist/core/runtime/broker/inbox.js +1 -0
  1702. package/dist/core/runtime/broker/model-adapter.d.ts +24 -0
  1703. package/dist/core/runtime/broker/model-adapter.js +2 -0
  1704. package/dist/core/runtime/broker/node-named.d.ts +15 -0
  1705. package/dist/core/runtime/broker/node-named.js +1 -0
  1706. package/dist/core/runtime/broker/node-token.d.ts +3 -0
  1707. package/dist/core/runtime/broker/node-token.js +1 -0
  1708. package/dist/core/runtime/broker/read-ops.d.ts +27 -0
  1709. package/dist/core/runtime/broker/read-ops.js +1 -0
  1710. package/dist/core/runtime/broker/rebind.d.ts +78 -0
  1711. package/dist/core/runtime/broker/rebind.js +1 -0
  1712. package/dist/core/runtime/broker/retry-card-elision.d.ts +7 -0
  1713. package/dist/core/runtime/broker/retry-card-elision.js +1 -0
  1714. package/dist/core/runtime/broker/run-deferred-mail.d.ts +8 -0
  1715. package/dist/core/runtime/broker/run-deferred-mail.js +1 -0
  1716. package/dist/core/runtime/broker/run-turn-end.d.ts +38 -0
  1717. package/dist/core/runtime/broker/run-turn-end.js +1 -0
  1718. package/dist/core/runtime/broker/run-turn-queue.d.ts +48 -0
  1719. package/dist/core/runtime/broker/run-turn-queue.js +1 -0
  1720. package/dist/core/runtime/broker/signal-stream.d.ts +30 -0
  1721. package/dist/core/runtime/broker/signal-stream.js +1 -0
  1722. package/dist/core/runtime/broker/tool-groups.d.ts +39 -0
  1723. package/dist/core/runtime/broker/tool-groups.js +1 -0
  1724. package/dist/core/runtime/broker/turn-admission.d.ts +11 -0
  1725. package/dist/core/runtime/broker/turn-admission.js +1 -0
  1726. package/dist/core/runtime/broker/turn-ignition.d.ts +49 -0
  1727. package/dist/core/runtime/broker/turn-ignition.js +1 -0
  1728. package/dist/core/runtime/broker-cli.d.ts +1 -0
  1729. package/dist/core/runtime/broker-cli.js +3 -0
  1730. package/dist/core/runtime/broker-extension-render.d.ts +3 -0
  1731. package/dist/core/runtime/broker-extension-render.js +3 -0
  1732. package/dist/core/runtime/broker-inventory.d.ts +4 -0
  1733. package/dist/core/runtime/broker-inventory.js +1 -0
  1734. package/dist/core/runtime/broker-persona-guidance.d.ts +27 -0
  1735. package/dist/core/runtime/broker-persona-guidance.js +4 -0
  1736. package/dist/core/runtime/broker-protocol.d.ts +716 -0
  1737. package/dist/core/runtime/broker-protocol.js +3 -0
  1738. package/dist/core/runtime/broker-request.d.ts +37 -0
  1739. package/dist/core/runtime/broker-request.js +1 -0
  1740. package/dist/core/runtime/broker-sdk.d.ts +36 -0
  1741. package/dist/core/runtime/broker-sdk.js +1 -0
  1742. package/dist/core/runtime/broker.d.ts +73 -0
  1743. package/dist/core/runtime/broker.js +1 -0
  1744. package/dist/core/runtime/canvas-extensions.d.ts +34 -0
  1745. package/dist/core/runtime/canvas-extensions.js +1 -0
  1746. package/dist/core/runtime/chat-inventory-rows.d.ts +8 -0
  1747. package/dist/core/runtime/chat-inventory-rows.js +1 -0
  1748. package/dist/core/runtime/close.d.ts +46 -0
  1749. package/dist/core/runtime/close.js +1 -0
  1750. package/dist/core/runtime/come-back-note.d.ts +5 -0
  1751. package/dist/core/runtime/come-back-note.js +3 -0
  1752. package/dist/core/runtime/command-expansion.d.ts +19 -0
  1753. package/dist/core/runtime/command-expansion.js +9 -0
  1754. package/dist/core/runtime/command-surface.d.ts +38 -0
  1755. package/dist/core/runtime/command-surface.js +1 -0
  1756. package/dist/core/runtime/connectivity.d.ts +12 -0
  1757. package/dist/core/runtime/connectivity.js +1 -0
  1758. package/dist/core/runtime/crtr-theme.d.ts +12 -0
  1759. package/dist/core/runtime/crtr-theme.js +1 -0
  1760. package/dist/core/runtime/deliver-live.d.ts +38 -0
  1761. package/dist/core/runtime/deliver-live.js +1 -0
  1762. package/dist/core/runtime/fault-recovery.d.ts +23 -0
  1763. package/dist/core/runtime/fault-recovery.js +1 -0
  1764. package/dist/core/runtime/fault.d.ts +6 -0
  1765. package/dist/core/runtime/fault.js +1 -0
  1766. package/dist/core/runtime/first-run-offer.d.ts +11 -0
  1767. package/dist/core/runtime/first-run-offer.js +5 -0
  1768. package/dist/core/runtime/fleet.d.ts +93 -0
  1769. package/dist/core/runtime/fleet.js +1 -0
  1770. package/dist/core/runtime/focus-viewer.d.ts +39 -0
  1771. package/dist/core/runtime/focus-viewer.js +1 -0
  1772. package/dist/core/runtime/front-door-env.d.ts +5 -0
  1773. package/dist/core/runtime/front-door-env.js +1 -0
  1774. package/dist/core/runtime/front-door-login.d.ts +2 -0
  1775. package/dist/core/runtime/front-door-login.js +1 -0
  1776. package/dist/core/runtime/front-door.d.ts +26 -0
  1777. package/dist/core/runtime/front-door.js +11 -0
  1778. package/dist/core/runtime/headless-pi.d.ts +37 -0
  1779. package/dist/core/runtime/headless-pi.js +1 -0
  1780. package/dist/core/runtime/host.d.ts +59 -0
  1781. package/dist/core/runtime/host.js +3 -0
  1782. package/dist/core/runtime/interactive-deliver.d.ts +22 -0
  1783. package/dist/core/runtime/interactive-deliver.js +1 -0
  1784. package/dist/core/runtime/invocation.d.ts +9 -0
  1785. package/dist/core/runtime/invocation.js +0 -0
  1786. package/dist/core/runtime/kickoff.d.ts +49 -0
  1787. package/dist/core/runtime/kickoff.js +28 -0
  1788. package/dist/core/runtime/launch-config-worker.d.ts +1 -0
  1789. package/dist/core/runtime/launch-config-worker.js +1 -0
  1790. package/dist/core/runtime/launch-prompt.d.ts +8 -0
  1791. package/dist/core/runtime/launch-prompt.js +4 -0
  1792. package/dist/core/runtime/launch-target.d.ts +34 -0
  1793. package/dist/core/runtime/launch-target.js +1 -0
  1794. package/dist/core/runtime/launch.d.ts +194 -0
  1795. package/dist/core/runtime/launch.js +3 -0
  1796. package/dist/core/runtime/ledger.d.ts +10 -0
  1797. package/dist/core/runtime/ledger.js +3 -0
  1798. package/dist/core/runtime/lifecycle.d.ts +34 -0
  1799. package/dist/core/runtime/lifecycle.js +2 -0
  1800. package/dist/core/runtime/managed-provider-cooling.d.ts +24 -0
  1801. package/dist/core/runtime/managed-provider-cooling.js +1 -0
  1802. package/dist/core/runtime/model-registry.d.ts +3 -0
  1803. package/dist/core/runtime/model-registry.js +1 -0
  1804. package/dist/core/runtime/model-selection.d.ts +54 -0
  1805. package/dist/core/runtime/model-selection.js +1 -0
  1806. package/dist/core/runtime/model-swap.d.ts +26 -0
  1807. package/dist/core/runtime/model-swap.js +1 -0
  1808. package/dist/core/runtime/naming.d.ts +69 -0
  1809. package/dist/core/runtime/naming.js +14 -0
  1810. package/dist/core/runtime/nerd-font.d.ts +46 -0
  1811. package/dist/core/runtime/nerd-font.js +2 -0
  1812. package/dist/core/runtime/node-id-token.d.ts +6 -0
  1813. package/dist/core/runtime/node-id-token.js +1 -0
  1814. package/dist/core/runtime/node-read.d.ts +51 -0
  1815. package/dist/core/runtime/node-read.js +3 -0
  1816. package/dist/core/runtime/nodes.d.ts +138 -0
  1817. package/dist/core/runtime/nodes.js +1 -0
  1818. package/dist/core/runtime/outcome-document.d.ts +59 -0
  1819. package/dist/core/runtime/outcome-document.js +1 -0
  1820. package/dist/core/runtime/package-health.d.ts +34 -0
  1821. package/dist/core/runtime/package-health.js +4 -0
  1822. package/dist/core/runtime/persona.d.ts +21 -0
  1823. package/dist/core/runtime/persona.js +2 -0
  1824. package/dist/core/runtime/pi-cli.d.ts +8 -0
  1825. package/dist/core/runtime/pi-cli.js +1 -0
  1826. package/dist/core/runtime/pi-vendored.d.ts +28 -0
  1827. package/dist/core/runtime/pi-vendored.js +1 -0
  1828. package/dist/core/runtime/placement-tmux.d.ts +32 -0
  1829. package/dist/core/runtime/placement-tmux.js +1 -0
  1830. package/dist/core/runtime/placement.d.ts +100 -0
  1831. package/dist/core/runtime/placement.js +1 -0
  1832. package/dist/core/runtime/progress-bar.d.ts +13 -0
  1833. package/dist/core/runtime/progress-bar.js +2 -0
  1834. package/dist/core/runtime/promote.d.ts +76 -0
  1835. package/dist/core/runtime/promote.js +1 -0
  1836. package/dist/core/runtime/prospective-inventory-cli.d.ts +1 -0
  1837. package/dist/core/runtime/prospective-inventory-cli.js +3 -0
  1838. package/dist/core/runtime/prospective-inventory.d.ts +10 -0
  1839. package/dist/core/runtime/prospective-inventory.js +2 -0
  1840. package/dist/core/runtime/provider-credential-gate.d.ts +4 -0
  1841. package/dist/core/runtime/provider-credential-gate.js +2 -0
  1842. package/dist/core/runtime/recap.d.ts +3 -0
  1843. package/dist/core/runtime/recap.js +27 -0
  1844. package/dist/core/runtime/recovery-hold.d.ts +2 -0
  1845. package/dist/core/runtime/recovery-hold.js +1 -0
  1846. package/dist/core/runtime/recycle.d.ts +14 -0
  1847. package/dist/core/runtime/recycle.js +1 -0
  1848. package/dist/core/runtime/reopen.d.ts +38 -0
  1849. package/dist/core/runtime/reopen.js +1 -0
  1850. package/dist/core/runtime/reset.d.ts +68 -0
  1851. package/dist/core/runtime/reset.js +1 -0
  1852. package/dist/core/runtime/resume-root.d.ts +34 -0
  1853. package/dist/core/runtime/resume-root.js +11 -0
  1854. package/dist/core/runtime/revive-all.d.ts +57 -0
  1855. package/dist/core/runtime/revive-all.js +1 -0
  1856. package/dist/core/runtime/revive.d.ts +105 -0
  1857. package/dist/core/runtime/revive.js +3 -0
  1858. package/dist/core/runtime/roadmap.d.ts +24 -0
  1859. package/dist/core/runtime/roadmap.js +15 -0
  1860. package/dist/core/runtime/run-command.d.ts +36 -0
  1861. package/dist/core/runtime/run-command.js +1 -0
  1862. package/dist/core/runtime/session-branch.d.ts +7 -0
  1863. package/dist/core/runtime/session-branch.js +1 -0
  1864. package/dist/core/runtime/session-cycles.d.ts +45 -0
  1865. package/dist/core/runtime/session-cycles.js +1 -0
  1866. package/dist/core/runtime/session-list-cache.d.ts +37 -0
  1867. package/dist/core/runtime/session-list-cache.js +1 -0
  1868. package/dist/core/runtime/session-visibility.d.ts +37 -0
  1869. package/dist/core/runtime/session-visibility.js +1 -0
  1870. package/dist/core/runtime/setup-marker.d.ts +8 -0
  1871. package/dist/core/runtime/setup-marker.js +1 -0
  1872. package/dist/core/runtime/shell-expansion.d.ts +32 -0
  1873. package/dist/core/runtime/shell-expansion.js +9 -0
  1874. package/dist/core/runtime/situational-context.d.ts +19 -0
  1875. package/dist/core/runtime/situational-context.js +2 -0
  1876. package/dist/core/runtime/situational-live.d.ts +9 -0
  1877. package/dist/core/runtime/situational-live.js +1 -0
  1878. package/dist/core/runtime/spawn-env.d.ts +54 -0
  1879. package/dist/core/runtime/spawn-env.js +1 -0
  1880. package/dist/core/runtime/spawn.d.ts +155 -0
  1881. package/dist/core/runtime/spawn.js +3 -0
  1882. package/dist/core/runtime/stamp/channel.d.ts +20 -0
  1883. package/dist/core/runtime/stamp/channel.js +1 -0
  1884. package/dist/core/runtime/stamp/protocol.d.ts +90 -0
  1885. package/dist/core/runtime/stamp/protocol.js +1 -0
  1886. package/dist/core/runtime/stop-guard.d.ts +31 -0
  1887. package/dist/core/runtime/stop-guard.js +8 -0
  1888. package/dist/core/runtime/stop-signals.d.ts +16 -0
  1889. package/dist/core/runtime/stop-signals.js +1 -0
  1890. package/dist/core/runtime/stream-watchdog.d.ts +54 -0
  1891. package/dist/core/runtime/stream-watchdog.js +1 -0
  1892. package/dist/core/runtime/structured-output.d.ts +91 -0
  1893. package/dist/core/runtime/structured-output.js +5 -0
  1894. package/dist/core/runtime/surface-bg.d.ts +13 -0
  1895. package/dist/core/runtime/surface-bg.js +1 -0
  1896. package/dist/core/runtime/tmux-bindings.d.ts +30 -0
  1897. package/dist/core/runtime/tmux-bindings.js +4 -0
  1898. package/dist/core/runtime/tmux-chrome.d.ts +2 -0
  1899. package/dist/core/runtime/tmux-chrome.js +1 -0
  1900. package/dist/core/runtime/tmux-driver.d.ts +314 -0
  1901. package/dist/core/runtime/tmux-driver.js +6 -0
  1902. package/dist/core/runtime/tmux-handoff.d.ts +36 -0
  1903. package/dist/core/runtime/tmux-handoff.js +10 -0
  1904. package/dist/core/runtime/tool-group-summary.d.ts +19 -0
  1905. package/dist/core/runtime/tool-group-summary.js +6 -0
  1906. package/dist/core/runtime/turn-visibility.d.ts +10 -0
  1907. package/dist/core/runtime/turn-visibility.js +1 -0
  1908. package/dist/core/runtime/view-socket.d.ts +21 -0
  1909. package/dist/core/runtime/view-socket.js +1 -0
  1910. package/dist/core/runtime/warm-pool.d.ts +65 -0
  1911. package/dist/core/runtime/warm-pool.js +1 -0
  1912. package/dist/core/scope.d.ts +32 -0
  1913. package/dist/core/scope.js +1 -0
  1914. package/dist/core/scoped-state/db.d.ts +17 -0
  1915. package/dist/core/scoped-state/db.js +2 -0
  1916. package/dist/core/scoped-state/migrate.d.ts +8 -0
  1917. package/dist/core/scoped-state/migrate.js +3 -0
  1918. package/dist/core/scoped-state/paths.d.ts +9 -0
  1919. package/dist/core/scoped-state/paths.js +1 -0
  1920. package/dist/core/scoped-state/profiles.d.ts +27 -0
  1921. package/dist/core/scoped-state/profiles.js +1 -0
  1922. package/dist/core/scoped-state/providers.d.ts +24 -0
  1923. package/dist/core/scoped-state/providers.js +1 -0
  1924. package/dist/core/scoped-state/schema.d.ts +6 -0
  1925. package/dist/core/scoped-state/schema.js +16 -0
  1926. package/dist/core/scoped-state/settings.d.ts +28 -0
  1927. package/dist/core/scoped-state/settings.js +1 -0
  1928. package/dist/core/scopes.d.ts +17 -0
  1929. package/dist/core/scopes.js +1 -0
  1930. package/dist/core/secrets.d.ts +40 -0
  1931. package/dist/core/secrets.js +2 -0
  1932. package/dist/core/self-update.d.ts +27 -0
  1933. package/dist/core/self-update.js +1 -0
  1934. package/dist/core/session-model/session-state.d.ts +53 -0
  1935. package/dist/core/session-model/session-state.js +1 -0
  1936. package/dist/core/shell-segments.d.ts +42 -0
  1937. package/dist/core/shell-segments.js +4 -0
  1938. package/dist/core/spaces/cache-env.d.ts +2 -0
  1939. package/dist/core/spaces/cache-env.js +1 -0
  1940. package/dist/core/spaces/file-root.d.ts +23 -0
  1941. package/dist/core/spaces/file-root.js +1 -0
  1942. package/dist/core/spaces/mounts.d.ts +34 -0
  1943. package/dist/core/spaces/mounts.js +1 -0
  1944. package/dist/core/spaces/open-beneath.d.ts +71 -0
  1945. package/dist/core/spaces/open-beneath.js +1 -0
  1946. package/dist/core/spaces/permissions.d.ts +19 -0
  1947. package/dist/core/spaces/permissions.js +1 -0
  1948. package/dist/core/spaces/process.d.ts +41 -0
  1949. package/dist/core/spaces/process.js +1 -0
  1950. package/dist/core/spaces/runtime-home.d.ts +5 -0
  1951. package/dist/core/spaces/runtime-home.js +1 -0
  1952. package/dist/core/spaces/space.d.ts +8 -0
  1953. package/dist/core/spaces/space.js +2 -0
  1954. package/dist/core/spaces/stop.d.ts +21 -0
  1955. package/dist/core/spaces/stop.js +2 -0
  1956. package/dist/core/spaces/users.d.ts +19 -0
  1957. package/dist/core/spaces/users.js +1 -0
  1958. package/dist/core/spawn.d.ts +15 -0
  1959. package/dist/core/spawn.js +1 -0
  1960. package/dist/core/sqlite-statements.d.ts +4 -0
  1961. package/dist/core/sqlite-statements.js +1 -0
  1962. package/dist/core/stdout-errors.d.ts +3 -0
  1963. package/dist/core/stdout-errors.js +1 -0
  1964. package/dist/core/storage/attachments.d.ts +33 -0
  1965. package/dist/core/storage/attachments.js +1 -0
  1966. package/dist/core/storage/client.d.ts +109 -0
  1967. package/dist/core/storage/client.js +3 -0
  1968. package/dist/core/storage/download.d.ts +24 -0
  1969. package/dist/core/storage/download.js +1 -0
  1970. package/dist/core/storage/shares.d.ts +32 -0
  1971. package/dist/core/storage/shares.js +1 -0
  1972. package/dist/core/storage/tables.d.ts +63 -0
  1973. package/dist/core/storage/tables.js +3 -0
  1974. package/dist/core/subscription-state.d.ts +121 -0
  1975. package/dist/core/subscription-state.js +4 -0
  1976. package/dist/core/substrate/delivery/corpus.d.ts +27 -0
  1977. package/dist/core/substrate/delivery/corpus.js +3 -0
  1978. package/dist/core/substrate/delivery/deliver.d.ts +76 -0
  1979. package/dist/core/substrate/delivery/deliver.js +6 -0
  1980. package/dist/core/substrate/delivery/listings.d.ts +30 -0
  1981. package/dist/core/substrate/delivery/listings.js +7 -0
  1982. package/dist/core/substrate/delivery/match.d.ts +28 -0
  1983. package/dist/core/substrate/delivery/match.js +1 -0
  1984. package/dist/core/substrate/delivery/plan.d.ts +67 -0
  1985. package/dist/core/substrate/delivery/plan.js +3 -0
  1986. package/dist/core/substrate/delivery/render-boot.d.ts +20 -0
  1987. package/dist/core/substrate/delivery/render-boot.js +54 -0
  1988. package/dist/core/substrate/delivery/render-event.d.ts +54 -0
  1989. package/dist/core/substrate/delivery/render-event.js +8 -0
  1990. package/dist/core/substrate/delivery/sub-persona-menu.d.ts +2 -0
  1991. package/dist/core/substrate/delivery/sub-persona-menu.js +6 -0
  1992. package/dist/core/substrate/delivery/types.d.ts +30 -0
  1993. package/dist/core/substrate/delivery/types.js +0 -0
  1994. package/dist/core/substrate/gate-explain.d.ts +35 -0
  1995. package/dist/core/substrate/gate-explain.js +1 -0
  1996. package/dist/core/substrate/schema.d.ts +29 -0
  1997. package/dist/core/substrate/schema.js +1 -0
  1998. package/dist/core/substrate/subject-fields.d.ts +48 -0
  1999. package/dist/core/substrate/subject-fields.js +1 -0
  2000. package/dist/core/substrate/subject.d.ts +13 -0
  2001. package/dist/core/substrate/subject.js +1 -0
  2002. package/dist/core/termrender/code-doc.d.ts +12 -0
  2003. package/dist/core/termrender/code-doc.js +5 -0
  2004. package/dist/core/termrender/display.d.ts +16 -0
  2005. package/dist/core/termrender/display.js +2 -0
  2006. package/dist/core/termrender/termrender.d.ts +71 -0
  2007. package/dist/core/termrender/termrender.js +14 -0
  2008. package/dist/core/termrender/version.d.ts +1 -0
  2009. package/dist/core/termrender/version.js +1 -0
  2010. package/dist/core/timing.d.ts +11 -0
  2011. package/dist/core/timing.js +2 -0
  2012. package/dist/core/tui/draw.d.ts +103 -0
  2013. package/dist/core/tui/draw.js +2 -0
  2014. package/dist/core/tui/fuzzy.d.ts +9 -0
  2015. package/dist/core/tui/fuzzy.js +1 -0
  2016. package/dist/core/tui/markdown.d.ts +17 -0
  2017. package/dist/core/tui/markdown.js +3 -0
  2018. package/dist/core/tui/page-host.d.ts +31 -0
  2019. package/dist/core/tui/page-host.js +1 -0
  2020. package/dist/core/tui/panel.d.ts +45 -0
  2021. package/dist/core/tui/panel.js +1 -0
  2022. package/dist/core/tui/terminal.d.ts +23 -0
  2023. package/dist/core/tui/terminal.js +2 -0
  2024. package/dist/core/user-settings.d.ts +377 -0
  2025. package/dist/core/user-settings.js +1 -0
  2026. package/dist/core/wake.d.ts +89 -0
  2027. package/dist/core/wake.js +1 -0
  2028. package/dist/core/worktree-close.d.ts +4 -0
  2029. package/dist/core/worktree-close.js +6 -0
  2030. package/dist/core/worktree-containment.d.ts +14 -0
  2031. package/dist/core/worktree-containment.js +3 -0
  2032. package/dist/core/worktree-landing.d.ts +44 -0
  2033. package/dist/core/worktree-landing.js +4 -0
  2034. package/dist/core/worktree-mutation-async.d.ts +13 -0
  2035. package/dist/core/worktree-mutation-async.js +10 -0
  2036. package/dist/core/worktree-quarantine.d.ts +19 -0
  2037. package/dist/core/worktree-quarantine.js +1 -0
  2038. package/dist/core/worktree-remove.d.ts +15 -0
  2039. package/dist/core/worktree-remove.js +1 -0
  2040. package/dist/core/worktree-sweep.d.ts +60 -0
  2041. package/dist/core/worktree-sweep.js +6 -0
  2042. package/dist/core/worktree.d.ts +120 -0
  2043. package/dist/core/worktree.js +18 -0
  2044. package/dist/daemon/analytics/compute.d.ts +37 -0
  2045. package/dist/daemon/analytics/compute.js +1 -0
  2046. package/dist/daemon/analytics/scan-worker.d.ts +1 -0
  2047. package/dist/daemon/analytics/scan-worker.js +2 -0
  2048. package/dist/daemon/analytics/scan.d.ts +37 -0
  2049. package/dist/daemon/analytics/scan.js +1 -0
  2050. package/dist/daemon/api/app-listener.d.ts +22 -0
  2051. package/dist/daemon/api/app-listener.js +24 -0
  2052. package/dist/daemon/api/bridge.d.ts +63 -0
  2053. package/dist/daemon/api/bridge.js +8 -0
  2054. package/dist/daemon/api/deferred-head.d.ts +14 -0
  2055. package/dist/daemon/api/deferred-head.js +4 -0
  2056. package/dist/daemon/api/handlers/analytics.d.ts +2 -0
  2057. package/dist/daemon/api/handlers/analytics.js +1 -0
  2058. package/dist/daemon/api/handlers/app-profiles.d.ts +17 -0
  2059. package/dist/daemon/api/handlers/app-profiles.js +1 -0
  2060. package/dist/daemon/api/handlers/attach.d.ts +2 -0
  2061. package/dist/daemon/api/handlers/attach.js +1 -0
  2062. package/dist/daemon/api/handlers/bash-jobs.d.ts +2 -0
  2063. package/dist/daemon/api/handlers/bash-jobs.js +1 -0
  2064. package/dist/daemon/api/handlers/bash.d.ts +2 -0
  2065. package/dist/daemon/api/handlers/bash.js +1 -0
  2066. package/dist/daemon/api/handlers/broker-ops.d.ts +5 -0
  2067. package/dist/daemon/api/handlers/broker-ops.js +1 -0
  2068. package/dist/daemon/api/handlers/broker-recovery.d.ts +4 -0
  2069. package/dist/daemon/api/handlers/broker-recovery.js +1 -0
  2070. package/dist/daemon/api/handlers/broker-signals.d.ts +19 -0
  2071. package/dist/daemon/api/handlers/broker-signals.js +2 -0
  2072. package/dist/daemon/api/handlers/canvas.d.ts +7 -0
  2073. package/dist/daemon/api/handlers/canvas.js +6 -0
  2074. package/dist/daemon/api/handlers/chat-inventory.d.ts +2 -0
  2075. package/dist/daemon/api/handlers/chat-inventory.js +1 -0
  2076. package/dist/daemon/api/handlers/crons.d.ts +2 -0
  2077. package/dist/daemon/api/handlers/crons.js +1 -0
  2078. package/dist/daemon/api/handlers/custom-objects.d.ts +10 -0
  2079. package/dist/daemon/api/handlers/custom-objects.js +3 -0
  2080. package/dist/daemon/api/handlers/daemon.d.ts +2 -0
  2081. package/dist/daemon/api/handlers/daemon.js +1 -0
  2082. package/dist/daemon/api/handlers/delivery-retry.d.ts +2 -0
  2083. package/dist/daemon/api/handlers/delivery-retry.js +1 -0
  2084. package/dist/daemon/api/handlers/delivery.d.ts +2 -0
  2085. package/dist/daemon/api/handlers/delivery.js +1 -0
  2086. package/dist/daemon/api/handlers/docs.d.ts +2 -0
  2087. package/dist/daemon/api/handlers/docs.js +1 -0
  2088. package/dist/daemon/api/handlers/feedback-comments.d.ts +2 -0
  2089. package/dist/daemon/api/handlers/feedback-comments.js +3 -0
  2090. package/dist/daemon/api/handlers/files.d.ts +2 -0
  2091. package/dist/daemon/api/handlers/files.js +1 -0
  2092. package/dist/daemon/api/handlers/focus.d.ts +2 -0
  2093. package/dist/daemon/api/handlers/focus.js +1 -0
  2094. package/dist/daemon/api/handlers/health.d.ts +2 -0
  2095. package/dist/daemon/api/handlers/health.js +14 -0
  2096. package/dist/daemon/api/handlers/hook-exec.d.ts +2 -0
  2097. package/dist/daemon/api/handlers/hook-exec.js +1 -0
  2098. package/dist/daemon/api/handlers/human-requests.d.ts +2 -0
  2099. package/dist/daemon/api/handlers/human-requests.js +1 -0
  2100. package/dist/daemon/api/handlers/human.d.ts +2 -0
  2101. package/dist/daemon/api/handlers/human.js +1 -0
  2102. package/dist/daemon/api/handlers/inbox-page.d.ts +4 -0
  2103. package/dist/daemon/api/handlers/inbox-page.js +1 -0
  2104. package/dist/daemon/api/handlers/inbox.d.ts +12 -0
  2105. package/dist/daemon/api/handlers/inbox.js +1 -0
  2106. package/dist/daemon/api/handlers/limits.d.ts +2 -0
  2107. package/dist/daemon/api/handlers/limits.js +1 -0
  2108. package/dist/daemon/api/handlers/llm.d.ts +2 -0
  2109. package/dist/daemon/api/handlers/llm.js +3 -0
  2110. package/dist/daemon/api/handlers/memory-reads.d.ts +4 -0
  2111. package/dist/daemon/api/handlers/memory-reads.js +1 -0
  2112. package/dist/daemon/api/handlers/memory.d.ts +38 -0
  2113. package/dist/daemon/api/handlers/memory.js +8 -0
  2114. package/dist/daemon/api/handlers/messages.d.ts +4 -0
  2115. package/dist/daemon/api/handlers/messages.js +2 -0
  2116. package/dist/daemon/api/handlers/model-config.d.ts +2 -0
  2117. package/dist/daemon/api/handlers/model-config.js +1 -0
  2118. package/dist/daemon/api/handlers/modelauth.d.ts +5 -0
  2119. package/dist/daemon/api/handlers/modelauth.js +1 -0
  2120. package/dist/daemon/api/handlers/node-events.d.ts +44 -0
  2121. package/dist/daemon/api/handlers/node-events.js +6 -0
  2122. package/dist/daemon/api/handlers/node-outcomes.d.ts +2 -0
  2123. package/dist/daemon/api/handlers/node-outcomes.js +1 -0
  2124. package/dist/daemon/api/handlers/node-records.d.ts +2 -0
  2125. package/dist/daemon/api/handlers/node-records.js +3 -0
  2126. package/dist/daemon/api/handlers/nodes.d.ts +17 -0
  2127. package/dist/daemon/api/handlers/nodes.js +1 -0
  2128. package/dist/daemon/api/handlers/objects.d.ts +2 -0
  2129. package/dist/daemon/api/handlers/objects.js +2 -0
  2130. package/dist/daemon/api/handlers/package-docs.d.ts +2 -0
  2131. package/dist/daemon/api/handlers/package-docs.js +1 -0
  2132. package/dist/daemon/api/handlers/profiles.d.ts +11 -0
  2133. package/dist/daemon/api/handlers/profiles.js +1 -0
  2134. package/dist/daemon/api/handlers/prospective-chat-inventory.d.ts +2 -0
  2135. package/dist/daemon/api/handlers/prospective-chat-inventory.js +1 -0
  2136. package/dist/daemon/api/handlers/providers.d.ts +70 -0
  2137. package/dist/daemon/api/handlers/providers.js +1 -0
  2138. package/dist/daemon/api/handlers/questions.d.ts +7 -0
  2139. package/dist/daemon/api/handlers/questions.js +1 -0
  2140. package/dist/daemon/api/handlers/reports.d.ts +6 -0
  2141. package/dist/daemon/api/handlers/reports.js +18 -0
  2142. package/dist/daemon/api/handlers/review-comments.d.ts +2 -0
  2143. package/dist/daemon/api/handlers/review-comments.js +1 -0
  2144. package/dist/daemon/api/handlers/reviews.d.ts +5 -0
  2145. package/dist/daemon/api/handlers/reviews.js +1 -0
  2146. package/dist/daemon/api/handlers/run-routes.d.ts +2 -0
  2147. package/dist/daemon/api/handlers/run-routes.js +1 -0
  2148. package/dist/daemon/api/handlers/runs.d.ts +9 -0
  2149. package/dist/daemon/api/handlers/runs.js +1 -0
  2150. package/dist/daemon/api/handlers/structured-requests.d.ts +2 -0
  2151. package/dist/daemon/api/handlers/structured-requests.js +1 -0
  2152. package/dist/daemon/api/handlers/subscriptions.d.ts +2 -0
  2153. package/dist/daemon/api/handlers/subscriptions.js +1 -0
  2154. package/dist/daemon/api/handlers/telemetry-record.d.ts +4 -0
  2155. package/dist/daemon/api/handlers/telemetry-record.js +1 -0
  2156. package/dist/daemon/api/handlers/transfer.d.ts +15 -0
  2157. package/dist/daemon/api/handlers/transfer.js +1 -0
  2158. package/dist/daemon/api/handlers/validate.d.ts +23 -0
  2159. package/dist/daemon/api/handlers/validate.js +1 -0
  2160. package/dist/daemon/api/handlers/vendor-status.d.ts +8 -0
  2161. package/dist/daemon/api/handlers/vendor-status.js +1 -0
  2162. package/dist/daemon/api/handlers/worktree.d.ts +2 -0
  2163. package/dist/daemon/api/handlers/worktree.js +1 -0
  2164. package/dist/daemon/api/long-poll-wait.d.ts +3 -0
  2165. package/dist/daemon/api/long-poll-wait.js +1 -0
  2166. package/dist/daemon/api/map.d.ts +167 -0
  2167. package/dist/daemon/api/map.js +2 -0
  2168. package/dist/daemon/api/operations.d.ts +18 -0
  2169. package/dist/daemon/api/operations.js +1 -0
  2170. package/dist/daemon/api/principal.d.ts +71 -0
  2171. package/dist/daemon/api/principal.js +1 -0
  2172. package/dist/daemon/api/reader.d.ts +17 -0
  2173. package/dist/daemon/api/reader.js +1 -0
  2174. package/dist/daemon/api/router.d.ts +123 -0
  2175. package/dist/daemon/api/router.js +1 -0
  2176. package/dist/daemon/api/server.d.ts +28 -0
  2177. package/dist/daemon/api/server.js +1 -0
  2178. package/dist/daemon/api/vendor-signin.d.ts +7 -0
  2179. package/dist/daemon/api/vendor-signin.js +77 -0
  2180. package/dist/daemon/api/viewer-presence.d.ts +3 -0
  2181. package/dist/daemon/api/viewer-presence.js +1 -0
  2182. package/dist/daemon/boot-migrations.d.ts +14 -0
  2183. package/dist/daemon/boot-migrations.js +1 -0
  2184. package/dist/daemon/broker-signals/bus.d.ts +30 -0
  2185. package/dist/daemon/broker-signals/bus.js +10 -0
  2186. package/dist/daemon/companion-retire.d.ts +4 -0
  2187. package/dist/daemon/companion-retire.js +1 -0
  2188. package/dist/daemon/control.d.ts +40 -0
  2189. package/dist/daemon/control.js +1 -0
  2190. package/dist/daemon/cron/armed-context.d.ts +25 -0
  2191. package/dist/daemon/cron/armed-context.js +1 -0
  2192. package/dist/daemon/cron/capture.d.ts +22 -0
  2193. package/dist/daemon/cron/capture.js +2 -0
  2194. package/dist/daemon/cron/disposition.d.ts +21 -0
  2195. package/dist/daemon/cron/disposition.js +1 -0
  2196. package/dist/daemon/cron/escalation.d.ts +12 -0
  2197. package/dist/daemon/cron/escalation.js +3 -0
  2198. package/dist/daemon/cron/held.d.ts +4 -0
  2199. package/dist/daemon/cron/held.js +1 -0
  2200. package/dist/daemon/cron/lease-recovery.d.ts +3 -0
  2201. package/dist/daemon/cron/lease-recovery.js +1 -0
  2202. package/dist/daemon/cron/live-runs.d.ts +11 -0
  2203. package/dist/daemon/cron/live-runs.js +1 -0
  2204. package/dist/daemon/cron/passes.d.ts +6 -0
  2205. package/dist/daemon/cron/passes.js +1 -0
  2206. package/dist/daemon/cron/settle.d.ts +28 -0
  2207. package/dist/daemon/cron/settle.js +1 -0
  2208. package/dist/daemon/cron/sinks.d.ts +19 -0
  2209. package/dist/daemon/cron/sinks.js +2 -0
  2210. package/dist/daemon/cron-run.d.ts +31 -0
  2211. package/dist/daemon/cron-run.js +1 -0
  2212. package/dist/daemon/crtrd-cli.d.ts +1 -0
  2213. package/dist/daemon/crtrd-cli.js +1 -0
  2214. package/dist/daemon/crtrd.d.ts +28 -0
  2215. package/dist/daemon/crtrd.js +12 -0
  2216. package/dist/daemon/delivery/run-delivery.d.ts +34 -0
  2217. package/dist/daemon/delivery/run-delivery.js +1 -0
  2218. package/dist/daemon/due-sources.d.ts +15 -0
  2219. package/dist/daemon/due-sources.js +1 -0
  2220. package/dist/daemon/due.d.ts +14 -0
  2221. package/dist/daemon/due.js +11 -0
  2222. package/dist/daemon/fleet.d.ts +79 -0
  2223. package/dist/daemon/fleet.js +19 -0
  2224. package/dist/daemon/http-dispatcher.d.ts +1 -0
  2225. package/dist/daemon/http-dispatcher.js +1 -0
  2226. package/dist/daemon/human/finish.d.ts +24 -0
  2227. package/dist/daemon/human/finish.js +10 -0
  2228. package/dist/daemon/human/settle.d.ts +44 -0
  2229. package/dist/daemon/human/settle.js +1 -0
  2230. package/dist/daemon/human/sweep.d.ts +21 -0
  2231. package/dist/daemon/human/sweep.js +1 -0
  2232. package/dist/daemon/joined-owner.d.ts +5 -0
  2233. package/dist/daemon/joined-owner.js +1 -0
  2234. package/dist/daemon/launcher-events.d.ts +2 -0
  2235. package/dist/daemon/launcher-events.js +1 -0
  2236. package/dist/daemon/manage.d.ts +176 -0
  2237. package/dist/daemon/manage.js +2 -0
  2238. package/dist/daemon/messaging/node-message.d.ts +27 -0
  2239. package/dist/daemon/messaging/node-message.js +1 -0
  2240. package/dist/daemon/park-activity.d.ts +9 -0
  2241. package/dist/daemon/park-activity.js +1 -0
  2242. package/dist/daemon/park-pending.d.ts +18 -0
  2243. package/dist/daemon/park-pending.js +1 -0
  2244. package/dist/daemon/pidfile.d.ts +8 -0
  2245. package/dist/daemon/pidfile.js +1 -0
  2246. package/dist/daemon/profile-delete.d.ts +7 -0
  2247. package/dist/daemon/profile-delete.js +1 -0
  2248. package/dist/daemon/reconcilers/action-lane.d.ts +8 -0
  2249. package/dist/daemon/reconcilers/action-lane.js +1 -0
  2250. package/dist/daemon/reconcilers/bash-deadline.d.ts +27 -0
  2251. package/dist/daemon/reconcilers/bash-deadline.js +2 -0
  2252. package/dist/daemon/reconcilers/broker-supervision.d.ts +88 -0
  2253. package/dist/daemon/reconcilers/broker-supervision.js +4 -0
  2254. package/dist/daemon/reconcilers/controller-death.d.ts +7 -0
  2255. package/dist/daemon/reconcilers/controller-death.js +1 -0
  2256. package/dist/daemon/reconcilers/cron-lane.d.ts +7 -0
  2257. package/dist/daemon/reconcilers/cron-lane.js +1 -0
  2258. package/dist/daemon/reconcilers/delivery-lane.d.ts +9 -0
  2259. package/dist/daemon/reconcilers/delivery-lane.js +8 -0
  2260. package/dist/daemon/reconcilers/fault-retry-backstop.d.ts +41 -0
  2261. package/dist/daemon/reconcilers/fault-retry-backstop.js +1 -0
  2262. package/dist/daemon/reconcilers/grove-instance-sweep.d.ts +36 -0
  2263. package/dist/daemon/reconcilers/grove-instance-sweep.js +1 -0
  2264. package/dist/daemon/reconcilers/live-obligation.d.ts +65 -0
  2265. package/dist/daemon/reconcilers/live-obligation.js +1 -0
  2266. package/dist/daemon/reconcilers/managed-worktree-sweep.d.ts +24 -0
  2267. package/dist/daemon/reconcilers/managed-worktree-sweep.js +1 -0
  2268. package/dist/daemon/reconcilers/node-deadline.d.ts +7 -0
  2269. package/dist/daemon/reconcilers/node-deadline.js +1 -0
  2270. package/dist/daemon/reconcilers/node-lifecycle/freeze-lane.d.ts +48 -0
  2271. package/dist/daemon/reconcilers/node-lifecycle/freeze-lane.js +1 -0
  2272. package/dist/daemon/reconcilers/node-lifecycle/respawn-policy.d.ts +30 -0
  2273. package/dist/daemon/reconcilers/node-lifecycle/respawn-policy.js +1 -0
  2274. package/dist/daemon/reconcilers/node-lifecycle/terminating.d.ts +5 -0
  2275. package/dist/daemon/reconcilers/node-lifecycle/terminating.js +1 -0
  2276. package/dist/daemon/reconcilers/node-lifecycle/tick.d.ts +20 -0
  2277. package/dist/daemon/reconcilers/node-lifecycle/tick.js +1 -0
  2278. package/dist/daemon/reconcilers/node-lifecycle/wants-execution.d.ts +8 -0
  2279. package/dist/daemon/reconcilers/node-lifecycle/wants-execution.js +1 -0
  2280. package/dist/daemon/reconcilers/pending-review-submit.d.ts +7 -0
  2281. package/dist/daemon/reconcilers/pending-review-submit.js +1 -0
  2282. package/dist/daemon/reconcilers/storage-due-work.d.ts +32 -0
  2283. package/dist/daemon/reconcilers/storage-due-work.js +1 -0
  2284. package/dist/daemon/reconcilers/storage-maintenance.d.ts +69 -0
  2285. package/dist/daemon/reconcilers/storage-maintenance.js +8 -0
  2286. package/dist/daemon/reconcilers/structured-request-lane.d.ts +4 -0
  2287. package/dist/daemon/reconcilers/structured-request-lane.js +1 -0
  2288. package/dist/daemon/resume-detector.d.ts +12 -0
  2289. package/dist/daemon/resume-detector.js +1 -0
  2290. package/dist/daemon/review/comment-notify.d.ts +27 -0
  2291. package/dist/daemon/review/comment-notify.js +2 -0
  2292. package/dist/daemon/review/companion.d.ts +8 -0
  2293. package/dist/daemon/review/companion.js +1 -0
  2294. package/dist/daemon/review/deliver.d.ts +5 -0
  2295. package/dist/daemon/review/deliver.js +3 -0
  2296. package/dist/daemon/review/finish.d.ts +27 -0
  2297. package/dist/daemon/review/finish.js +1 -0
  2298. package/dist/daemon/review/sweep.d.ts +4 -0
  2299. package/dist/daemon/review/sweep.js +1 -0
  2300. package/dist/daemon/run-notices.d.ts +49 -0
  2301. package/dist/daemon/run-notices.js +1 -0
  2302. package/dist/daemon/runs/append-section.d.ts +6 -0
  2303. package/dist/daemon/runs/append-section.js +2 -0
  2304. package/dist/daemon/runs/observer.d.ts +14 -0
  2305. package/dist/daemon/runs/observer.js +4 -0
  2306. package/dist/daemon/startup-policy.d.ts +1 -0
  2307. package/dist/daemon/startup-policy.js +1 -0
  2308. package/dist/daemon/structured-requests/boot.d.ts +2 -0
  2309. package/dist/daemon/structured-requests/boot.js +1 -0
  2310. package/dist/daemon/structured-requests/effects.d.ts +4 -0
  2311. package/dist/daemon/structured-requests/effects.js +1 -0
  2312. package/dist/daemon/structured-requests/notifier.d.ts +2 -0
  2313. package/dist/daemon/structured-requests/notifier.js +1 -0
  2314. package/dist/daemon/structured-requests/sidecar.d.ts +3 -0
  2315. package/dist/daemon/structured-requests/sidecar.js +1 -0
  2316. package/dist/daemon/supervise-cadence.d.ts +1 -0
  2317. package/dist/daemon/supervise-cadence.js +1 -0
  2318. package/dist/hook-authoring.d.ts +130 -0
  2319. package/dist/hook-authoring.js +5 -0
  2320. package/dist/hook-process.d.ts +7 -0
  2321. package/dist/hook-process.js +1 -0
  2322. package/dist/index.d.ts +33 -0
  2323. package/dist/index.js +1 -0
  2324. package/dist/launcher/bwrap.d.ts +13 -0
  2325. package/dist/launcher/bwrap.js +2 -0
  2326. package/dist/launcher/client.d.ts +4 -0
  2327. package/dist/launcher/client.js +3 -0
  2328. package/dist/launcher/limits/cgroup.d.ts +28 -0
  2329. package/dist/launcher/limits/cgroup.js +2 -0
  2330. package/dist/launcher/limits/log.d.ts +3 -0
  2331. package/dist/launcher/limits/log.js +1 -0
  2332. package/dist/launcher/limits/manager.d.ts +82 -0
  2333. package/dist/launcher/limits/manager.js +1 -0
  2334. package/dist/launcher/limits/policy.d.ts +98 -0
  2335. package/dist/launcher/limits/policy.js +1 -0
  2336. package/dist/launcher/limits/purge-worker.d.ts +8 -0
  2337. package/dist/launcher/limits/purge-worker.js +2 -0
  2338. package/dist/launcher/limits/quota.d.ts +48 -0
  2339. package/dist/launcher/limits/quota.js +4 -0
  2340. package/dist/launcher/limits/settings.d.ts +19 -0
  2341. package/dist/launcher/limits/settings.js +2 -0
  2342. package/dist/launcher/main.d.ts +1 -0
  2343. package/dist/launcher/main.js +3 -0
  2344. package/dist/launcher/netrule.d.ts +1 -0
  2345. package/dist/launcher/netrule.js +1 -0
  2346. package/dist/launcher/scope-directories.d.ts +4 -0
  2347. package/dist/launcher/scope-directories.js +1 -0
  2348. package/dist/launcher/seccomp.d.ts +1 -0
  2349. package/dist/launcher/seccomp.js +1 -0
  2350. package/dist/launcher/spec.d.ts +149 -0
  2351. package/dist/launcher/spec.js +1 -0
  2352. package/dist/launcher/users.d.ts +23 -0
  2353. package/dist/launcher/users.js +7 -0
  2354. package/dist/launcher/validate.d.ts +22 -0
  2355. package/dist/launcher/validate.js +1 -0
  2356. package/dist/migrations/004-canvas-documents/apply.d.ts +10 -0
  2357. package/dist/migrations/004-canvas-documents/apply.js +1 -0
  2358. package/dist/migrations/004-canvas-documents/fields.d.ts +24 -0
  2359. package/dist/migrations/004-canvas-documents/fields.js +2 -0
  2360. package/dist/migrations/004-canvas-documents/index.d.ts +16 -0
  2361. package/dist/migrations/004-canvas-documents/index.js +2 -0
  2362. package/dist/migrations/004-canvas-documents/legacy/discover.d.ts +16 -0
  2363. package/dist/migrations/004-canvas-documents/legacy/discover.js +1 -0
  2364. package/dist/migrations/004-canvas-documents/legacy/history.d.ts +5 -0
  2365. package/dist/migrations/004-canvas-documents/legacy/history.js +2 -0
  2366. package/dist/migrations/004-canvas-documents/legacy/nested.d.ts +7 -0
  2367. package/dist/migrations/004-canvas-documents/legacy/nested.js +1 -0
  2368. package/dist/migrations/004-canvas-documents/legacy/parse.d.ts +14 -0
  2369. package/dist/migrations/004-canvas-documents/legacy/parse.js +1 -0
  2370. package/dist/migrations/004-canvas-documents/legacy/types.d.ts +91 -0
  2371. package/dist/migrations/004-canvas-documents/legacy/types.js +0 -0
  2372. package/dist/migrations/004-canvas-documents/legacy-edges.d.ts +6 -0
  2373. package/dist/migrations/004-canvas-documents/legacy-edges.js +18 -0
  2374. package/dist/migrations/004-canvas-documents/plan.d.ts +102 -0
  2375. package/dist/migrations/004-canvas-documents/plan.js +3 -0
  2376. package/dist/migrations/004-canvas-documents/pointers.d.ts +23 -0
  2377. package/dist/migrations/004-canvas-documents/pointers.js +4 -0
  2378. package/dist/migrations/activation.d.ts +17 -0
  2379. package/dist/migrations/activation.js +2 -0
  2380. package/dist/native/linux/arm64/addon.node +0 -0
  2381. package/dist/native/linux/x64/addon.node +0 -0
  2382. package/dist/native/linux.d.ts +29 -0
  2383. package/dist/native/linux.js +1 -0
  2384. package/dist/pi-extensions/broker-local.d.ts +19 -0
  2385. package/dist/pi-extensions/broker-local.js +2 -0
  2386. package/dist/pi-extensions/canvas-bash-valve.d.ts +23 -0
  2387. package/dist/pi-extensions/canvas-bash-valve.js +7 -0
  2388. package/dist/pi-extensions/canvas-context-intro.d.ts +55 -0
  2389. package/dist/pi-extensions/canvas-context-intro.js +2 -0
  2390. package/dist/pi-extensions/canvas-doc-substrate.d.ts +51 -0
  2391. package/dist/pi-extensions/canvas-doc-substrate.js +9 -0
  2392. package/dist/pi-extensions/canvas-elapsed.d.ts +21 -0
  2393. package/dist/pi-extensions/canvas-elapsed.js +2 -0
  2394. package/dist/pi-extensions/canvas-goal-capture.d.ts +21 -0
  2395. package/dist/pi-extensions/canvas-goal-capture.js +1 -0
  2396. package/dist/pi-extensions/canvas-inbox-watcher.d.ts +26 -0
  2397. package/dist/pi-extensions/canvas-inbox-watcher.js +2 -0
  2398. package/dist/pi-extensions/canvas-passive-context.d.ts +38 -0
  2399. package/dist/pi-extensions/canvas-passive-context.js +14 -0
  2400. package/dist/pi-extensions/canvas-preview-result.d.ts +22 -0
  2401. package/dist/pi-extensions/canvas-preview-result.js +4 -0
  2402. package/dist/pi-extensions/canvas-prompt-scrub.d.ts +13 -0
  2403. package/dist/pi-extensions/canvas-prompt-scrub.js +2 -0
  2404. package/dist/pi-extensions/canvas-recap.d.ts +54 -0
  2405. package/dist/pi-extensions/canvas-recap.js +11 -0
  2406. package/dist/pi-extensions/canvas-review-boundary.d.ts +42 -0
  2407. package/dist/pi-extensions/canvas-review-boundary.js +3 -0
  2408. package/dist/pi-extensions/canvas-stamp.d.ts +14 -0
  2409. package/dist/pi-extensions/canvas-stamp.js +2 -0
  2410. package/dist/pi-extensions/canvas-stophook.d.ts +48 -0
  2411. package/dist/pi-extensions/canvas-stophook.js +1 -0
  2412. package/dist/pi-extensions/canvas-structured-output.d.ts +49 -0
  2413. package/dist/pi-extensions/canvas-structured-output.js +19 -0
  2414. package/dist/pi-extensions/canvas-tool-guide.d.ts +14 -0
  2415. package/dist/pi-extensions/canvas-tool-guide.js +9 -0
  2416. package/dist/pi-extensions/envelope-merge.d.ts +13 -0
  2417. package/dist/pi-extensions/envelope-merge.js +8 -0
  2418. package/dist/pi-extensions/system-prompt-entry.d.ts +15 -0
  2419. package/dist/pi-extensions/system-prompt-entry.js +1 -0
  2420. package/dist/prompts/review.d.ts +2 -0
  2421. package/dist/prompts/review.js +110 -0
  2422. package/dist/shared/crtr-version.d.ts +2 -0
  2423. package/dist/shared/crtr-version.js +1 -0
  2424. package/dist/shared/env.d.ts +116 -0
  2425. package/dist/shared/env.js +2 -0
  2426. package/dist/shared/generated-context.d.ts +83 -0
  2427. package/dist/shared/generated-context.js +8 -0
  2428. package/dist/shared/inbox-entry-body.d.ts +22 -0
  2429. package/dist/shared/inbox-entry-body.js +10 -0
  2430. package/dist/shared/inline-ref-grammar.d.ts +53 -0
  2431. package/dist/shared/inline-ref-grammar.js +1 -0
  2432. package/dist/shared/inline-ref-guidance.d.ts +8 -0
  2433. package/dist/shared/inline-ref-guidance.js +2 -0
  2434. package/dist/shared/predicates.d.ts +2 -0
  2435. package/dist/shared/predicates.js +1 -0
  2436. package/dist/shared/shell-quote.d.ts +3 -0
  2437. package/dist/shared/shell-quote.js +1 -0
  2438. package/dist/shared/strip-cd-prefix.d.ts +1 -0
  2439. package/dist/shared/strip-cd-prefix.js +1 -0
  2440. package/dist/shared/tool-groups.d.ts +26 -0
  2441. package/dist/shared/tool-groups.js +1 -0
  2442. package/dist/shared/working-activity.d.ts +9 -0
  2443. package/dist/shared/working-activity.js +1 -0
  2444. package/dist/suppress-experimental-warnings.d.ts +1 -0
  2445. package/dist/suppress-experimental-warnings.js +1 -0
  2446. package/dist/types.d.ts +562 -0
  2447. package/dist/types.js +1 -0
  2448. package/docs/cli/README.md +17 -0
  2449. package/docs/cli/canvas-and-dashboard.md +56 -0
  2450. package/docs/cli/documents-and-preferences.md +52 -0
  2451. package/docs/cli/first-session.md +76 -0
  2452. package/docs/cli/human-inbox.md +34 -0
  2453. package/docs/cli/official-marketplace.md +75 -0
  2454. package/docs/cli/the-viewer.md +80 -0
  2455. package/docs/concepts/README.md +17 -0
  2456. package/docs/concepts/documents.md +52 -0
  2457. package/docs/concepts/lifecycle-and-wakes.md +26 -0
  2458. package/docs/concepts/nodes-and-the-canvas.md +29 -0
  2459. package/docs/concepts/profiles-kinds-and-modes.md +31 -0
  2460. package/docs/concepts/scopes-and-trust.md +39 -0
  2461. package/docs/concepts/why-a-daemon.md +29 -0
  2462. package/docs/plugin/README.md +20 -0
  2463. package/docs/plugin/bundles-and-memory.md +28 -0
  2464. package/docs/plugin/commands.md +22 -0
  2465. package/docs/plugin/deploying.md +34 -0
  2466. package/docs/plugin/errors.md +39 -0
  2467. package/docs/plugin/getting-started.md +23 -0
  2468. package/docs/plugin/output.md +51 -0
  2469. package/docs/plugin/parameters.md +29 -0
  2470. package/docs/public-api.md +75 -0
  2471. package/docs/release-local.md +8 -0
  2472. package/docs/sdk/README.md +90 -0
  2473. package/docs/sdk/bash.md +39 -0
  2474. package/docs/sdk/client.md +297 -0
  2475. package/docs/sdk/docker.md +68 -0
  2476. package/docs/sdk/error-envelope.md +36 -0
  2477. package/docs/sdk/errors.md +111 -0
  2478. package/docs/sdk/files.md +49 -0
  2479. package/docs/sdk/getting-started.md +224 -0
  2480. package/docs/sdk/guides/README.md +19 -0
  2481. package/docs/sdk/guides/apps-on-crouter-cloud.md +115 -0
  2482. package/docs/sdk/guides/apps-with-many-users.md +59 -0
  2483. package/docs/sdk/guides/event-driven-assistant.md +24 -0
  2484. package/docs/sdk/guides/fan-out-pipeline.md +24 -0
  2485. package/docs/sdk/guides/human-approval.md +24 -0
  2486. package/docs/sdk/guides/typed-extraction.md +24 -0
  2487. package/docs/sdk/memory.md +47 -0
  2488. package/docs/sdk/nodes.md +194 -0
  2489. package/docs/sdk/release-notes.md +207 -0
  2490. package/docs/sdk/resources.md +99 -0
  2491. package/docs/sdk/streaming.md +216 -0
  2492. package/docs/sdk/testing.md +163 -0
  2493. package/package.json +160 -4
  2494. package/packages/crouter-identity/dist/index.d.ts +107 -0
  2495. package/packages/crouter-identity/dist/index.js +226 -0
  2496. package/packages/crouter-identity/package.json +33 -0
  2497. package/runtime.lock.json +13864 -0
  2498. package/scripts/build-native-linux.mjs +35 -0
  2499. package/scripts/ensure-native-linux.mjs +72 -0
  2500. package/scripts/install-runtime.mjs +614 -0
  2501. package/scripts/lib/isolation-env.mjs +48 -0
  2502. package/scripts/lib/pack-args.mjs +19 -0
  2503. package/scripts/lib/runtime-deps-key.mjs +50 -0
  2504. package/scripts/lib/update-target.mjs +78 -0
  2505. package/scripts/pack-minify.mjs +114 -0
  2506. package/scripts/patch-pi-tree-root-ordering.mjs +57 -0
  2507. package/scripts/postinstall.mjs +55 -0
  2508. package/scripts/runtime-lock.mjs +26 -0
  2509. package/scripts/runtime-smoke.mjs +54 -0
  2510. package/scripts/self-update.mjs +45 -0
  2511. package/src/native/linux/addon.c +255 -0
@@ -0,0 +1 @@
1
+ var v=Object.defineProperty;var d=(e,n)=>v(e,"name",{value:n,configurable:!0});import{ApiError as i}from"../../../api/errors.js";import{openDb as _,withCanvasWrite as j}from"../../../core/canvas/db.js";import{readerForNode as l}from"../../../core/graph/reader.js";import{noteNodeBooting as A}from"../../../core/graph/repo-sync/index.js";import{checkoutsForCwd as f}from"../../../core/graph/repo-sync/repos.js";import{DRY_RUN_ONLY as E,deliver as k,hypotheticalFrom as I,hypotheticalReader as O,inspect as h}from"../../../core/substrate/delivery/deliver.js";import{requireCurrentExecution as p}from"./broker-recovery.js";const N=["boot","system-prompt","compact","persona","file-read","command","pre-command","slash-command","names",...E];function y(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new i(400,"usage","delivery requires a JSON body");const n=e;if(!N.includes(n.activity))throw new i(400,"usage",`invalid delivery activity: ${String(n.activity)}`);if(n.subject!==void 0&&typeof n.subject!="string")throw new i(400,"usage","delivery subject must be a string");return n}d(y,"parse");function m(e){if(e.principal.class!=="person"&&e.principal.class!=="broker")throw new i(403,"permission_error","a delivery dry run is available to a person or a node only")}d(m,"requirePerson");function w(e){const n=_(),r=n.isTransaction;n.exec(r?"SAVEPOINT delivery_dry_run":"BEGIN IMMEDIATE");try{return e(n)}finally{r?n.exec("ROLLBACK TO delivery_dry_run; RELEASE delivery_dry_run"):n.exec("ROLLBACK")}}d(w,"rolledBack");function R(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new i(400,"usage","hypothetical must be an object");const n=d((a,s)=>{if(a!==void 0){if(typeof a!="string"||a==="")throw new i(400,"usage",`hypothetical.${s} must be a non-empty string`);return a}},"str"),r=n(e.cwd,"cwd");if(r!==void 0&&!r.startsWith("/"))throw new i(400,"usage","hypothetical.cwd must be an absolute path");if(e.mode!==void 0&&e.mode!=="base"&&e.mode!=="orchestrator")throw new i(400,"usage","hypothetical.mode must be base or orchestrator");if(e.lifecycle!==void 0&&e.lifecycle!=="terminal"&&e.lifecycle!=="resident")throw new i(400,"usage","hypothetical.lifecycle must be terminal or resident");if(e.has_manager!==void 0&&typeof e.has_manager!="boolean")throw new i(400,"usage","hypothetical.has_manager must be a boolean");if(e.depth!==void 0&&(!Number.isInteger(e.depth)||e.depth<0))throw new i(400,"usage","hypothetical.depth must be a non-negative integer");const t={};r!==void 0&&(t.cwd=r),e.profile!==void 0&&(t.profile=e.profile===null?null:n(e.profile,"profile"));const c=n(e.grantee,"grantee");c!==void 0&&(t.grantee=c);const o=n(e.kind,"kind");return o!==void 0&&(t.kind=o),e.mode!==void 0&&(t.mode=e.mode),e.lifecycle!==void 0&&(t.lifecycle=e.lifecycle),e.has_manager!==void 0&&(t.hasManager=e.has_manager),e.depth!==void 0&&(t.depth=e.depth),t}d(R,"hypotheticalOf");async function T(e){m(e);const n=y(e.body);if(n.node!==void 0&&typeof n.node!="string")throw new i(400,"usage","node must be a node id");const r={activity:n.activity,...n.subject!==void 0?{subject:n.subject}:{}},{result:t,plan:c}=w(o=>{if(n.hypothetical===void 0){if(n.node===void 0)throw new i(400,"usage","a delivery dry run names a node, a hypothetical node, or both");return h(o,l(o,n.node,g=>f(o,g)),r,n.subject_override)}const a=R(n.hypothetical),s=n.node!==void 0?I(n.node,a):{...a,cwd:a.cwd??""};if(s.cwd==="")throw new i(400,"usage","a hypothetical node needs a cwd");const{reader:u,subject:b}=O(o,s);return h(o,u,r,n.subject_override,b)});return{status:200,body:{...t,plan:c}}}d(T,"handleDryRun");async function S(e){const n=e.params.id,r=y(e.body),t={activity:r.activity,...r.subject!==void 0?{subject:r.subject}:{},...r.inherited===!0?{inherited:!0}:{}};if(r.dry_run===!0){m(e);const{result:o,plan:a}=w(s=>h(s,l(s,n,u=>f(s,u)),t,r.subject_override));return{status:200,body:{...o,plan:a}}}if(e.principal.class==="broker"&&e.principal.node!==n)throw new i(403,"permission_error","delivery is performed by the node's own broker");return p(n,r.expected_execution_id),r.activity==="boot"&&(await A(n),p(n,r.expected_execution_id)),{status:200,body:j(o=>k(o,l(o,n,a=>f(o,a)),t))}}d(S,"handleDelivery");const M=[{method:"POST",pattern:"/v1/nodes/:id/delivery",handler:S},{method:"POST",pattern:"/v1/delivery/dry-run",handler:T}];export{M as deliveryRoutes};
@@ -0,0 +1,2 @@
1
+ import type { RouteTable } from '../router.js';
2
+ export declare const docRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var re=Object.defineProperty;var u=(t,e)=>re(t,"name",{value:e,configurable:!0});import{prepared as P}from"../../../core/sqlite-statements.js";import{ApiError as g}from"../../../api/errors.js";import{DOC_KINDS as q,DOC_UNSET_FIELDS as H}from"../../../api/dto/docs.js";import{PRIVACY_LEVELS_DTO as V}from"../../../api/dto/objects.js";import{withCanvasWrite as k}from"../../../core/canvas/db.js";import{CrtrError as ie}from"../../../core/errors.js";import{emitEvent as se}from"../../../core/events/emit.js";import{canChange as K,spaceOf as ae}from"../../../core/graph/access.js";import{get as A}from"../../../core/graph/bodies.js";import{deleteDocument as ce,documentRecord as F,editDocument as de,heads as I,history as ue,linksIn as U,moveDocument as fe,readBase as le,setDocumentRecord as me,withCurrentNames as pe,writeDocument as he}from"../../../core/graph/documents.js";import{resolveName as X}from"../../../core/graph/names.js";import{getByRowid as M}from"../../../core/graph/objects.js";import{noteRepoDocumentsChanged as we}from"../../../core/graph/repo-sync/index.js";import{checkoutsForCwd as ye}from"../../../core/graph/repo-sync/repos.js";import{lintRules as ve,rulesOf as ge}from"../../../core/graph/rules.js";import{unifiedDiff as _e}from"../../../core/graph/diff.js";import{ownerFromFlag as W,readerFor as E,resolveRef as z}from"../reader.js";function _(t,e,n,o,i={}){return new g(t,e,n,{...i,error:e,message:n,next:o})}u(_,"refuse");const b=u((t,e)=>new g(400,"invalid_request",t,e),"invalid");function D(t){const e=t.body;if(e===void 0)return{};if(typeof e!="object"||e===null||Array.isArray(e))throw b("the request body must be a JSON object");return e}u(D,"bodyOf");const x=u(t=>e=>ye(t,e),"reposFnFor");function C(t,e){if(t instanceof ie){const n=t.details;if(t.code==="read_first")throw _(409,"read_first",t.message,`Read it first with \`crtr canvas read ${e?.id??"<ref>"}\`, then rerun the edit.`,n??{});if(t.code==="conflict")throw new g(409,"name_taken",t.message,n);if(t.code==="forbidden")throw new g(403,"forbidden",t.message,n);if(n?.rule==="repo-public-only")throw _(422,"repo_documents_are_public",t.message,'Own it as `user` and add a rule with `if: {"repo": "<handle>"}` so it loads only in that repo.')}throw t}u(C,"mapGraphError");function B(t,e,n){const o=z(t,e,decodeURIComponent(n));if("remote"in o)throw _(404,"not_found",G(o.remote),"Check the name with `crtr canvas search`.");if("deleted"in o)throw new g(404,"not_found",`${o.deleted.name} is deleted`,{id:o.deleted.id,deleted:!0});if(o.type!=="document")throw b(`${n} is a ${o.type}, not a document`);return o}u(B,"refDocument");function G(t){return`no object named ${t} on this runtime; it may be on another runtime, or the name may be misspelled`}u(G,"remoteMessage");function be(t,e){const n=e.owner===null?null:M(t,e.owner);return n?n.type==="node"?n.id:n.name:""}u(be,"ownerHandle");function j(t,e){const n=be(t,e);return n?`${n}/${e.name}`:e.name}u(j,"canonicalName");function ke(t,e){const n=e.owner===null?null:M(t,e.owner),o=n?{id:n.id,type:n.type,handle:n.type==="node"?n.id:n.name}:null;return{id:e.id,type:e.type,kind:e.kind,owner:o,privacy:e.privacy,name:e.name,preview:e.preview??"",created_at:e.created_at,deleted_at:e.deleted_at}}u(ke,"objectDTO");function Ee(t,e){const n=e.owner===null?null:M(t,e.owner);return n?.type==="repo"?n:null}u(Ee,"repoOwner");function S(t,e,n,o){const i=[...new Map(n.flatMap(r=>{const f=Ee(t,r);return f?[[f.id,f]]:[]})).values()],a=e.class==="node"?e.cwd:o;return{repos:i,...a!==void 0?{cwd:a}:{}}}u(S,"repoChange");function T(t){for(const e of t.repos)try{we(e,t.cwd)}catch(n){se({level:"warn",event:"repo_sync.failed",outcome:"failed",error:n,fields:{repo:e.name,step:"export",reason:n instanceof Error?n.message:String(n)}})}}u(T,"syncChanged");const Y=/^[A-Za-z0-9_-]+(\/[A-Za-z0-9_-]+)*$/;function Oe(t,e){if(t===void 0)return;if(!Array.isArray(t)){e.push("`rules` must be a list");return}const n=t.map(i=>{if(typeof i!="object"||i===null||Array.isArray(i))return i;const{match_frontmatter:a,...r}=i;return"matchFrontmatter"in r?{...r,match_frontmatter:r.matchFrontmatter}:a===void 0?r:{...r,matchFrontmatter:a}}),o=ve(n);if(o){e.push(o.replaceAll("matchFrontmatter","match_frontmatter"));return}return n}u(Oe,"rulesFromDTO");function Z(t,e){const n={},o=u(s=>{const c=t[s];if(c!==void 0){if(typeof c!="string"){e.push(`\`${s}\` must be a string`);return}return c}},"str"),i=o("preview");i!==void 0&&(i.trim()===""||/[\r\n]/.test(i)?e.push("`preview` must be one non-empty line"):n.preview=i);const a=o("summary");a!==void 0&&(n.summary=a);const r=o("why_it_exists");if(r!==void 0&&(n.whyItExists=r),t.privacy!==void 0&&(V.includes(t.privacy)?n.privacy=t.privacy:e.push(`\`privacy\` must be one of ${V.join(", ")}`)),t.unlisted!==void 0&&(typeof t.unlisted!="boolean"?e.push("`unlisted` must be a boolean"):n.unlisted=t.unlisted),t.lint_ignore!==void 0){const s=t.lint_ignore;!Array.isArray(s)||s.some(c=>typeof c!="string")?e.push("`lint_ignore` must be a list of strings"):n.lintIgnore=s}if(t.extensions!==void 0){const s=t.extensions;typeof s!="object"||s===null||Array.isArray(s)||Object.values(s).some(c=>typeof c!="object"||c===null||Array.isArray(c))?e.push("`extensions` must map each plugin to an object of fields"):n.extensions=s}const f=Oe(t.rules,e);return f!==void 0&&(n.rules=f),n}u(Z,"fieldsFrom");function J(t){if(t.length>0)throw b(t.join("; "),{errors:t})}u(J,"failOn");function Q(t,e,n,o){const i=U(n).filter(a=>"remote"in X(t,e,a));return{...o.length>0?{unresolved_links:o}:{},...i.length>0?{remote_links:i}:{}}}u(Q,"linkReport");function $e(t){const e=D(t),n=[],o=e.name;(typeof o!="string"||!Y.test(o))&&n.push("`name` must be segments of letters, digits, `_` or `-` joined by `/`"),typeof e.body!="string"&&n.push("`body` must be a string"),typeof e.preview!="string"&&n.push("`preview` is required");const i=e.kind??"knowledge";q.includes(i)||n.push(i==="report"?"reports are written only by `crtr push`":`\`kind\` must be one of ${q.join(", ")}`);const a=Z(e,n);e.cwd!==void 0&&typeof e.cwd!="string"&&n.push("`cwd` must be a string"),J(n);const r=e,{dto:f,change:s}=k(c=>{const h=E(c,t),d=W(c,h,r.owner,r.cwd);if(!K(c,h,d))throw new g(404,"not_found",`no owner ${d.name} you can write to`);try{const{object:p,unresolved:l}=he(c,h,{...a,owner:d,name:r.name,kind:i,preview:a.preview,privacy:a.privacy??"public"},r.body,x(c));return{dto:{id:p.id,name:j(c,p),...Q(c,h,r.body,l)},change:S(c,h,[p],r.cwd)}}catch(p){C(p)}});return T(s),f}u($e,"write");function Ae(t,e){let n=t;e.forEach(({old:o,new:i},a)=>{const r=o===""?-1:n.indexOf(o);if(r<0)throw _(422,"replace_no_match",`replace[${a}]: old text not found in the revision you read`,"Copy the old text exactly from your last read and rerun.",{index:a});if(n.indexOf(o,r+1)>=0)throw _(422,"replace_ambiguous",`replace[${a}]: old text occurs more than once`,"Include more surrounding text so the old text matches once, and rerun.",{index:a});n=n.slice(0,r)+i+n.slice(r+o.length)})}u(Ae,"checkReplacements");function je(t){const e=D(t),n=[],o=e.body!==void 0,i=e.replace!==void 0;o&&i&&n.push("give `body` or `replace`, not both"),o&&typeof e.body!="string"&&n.push("`body` must be a string");const a=e.replace;i&&(!Array.isArray(a)||a.length===0||a.some(d=>typeof d!="object"||d===null||typeof d.old!="string"||typeof d.new!="string"))&&n.push("`replace` must be a non-empty list of {old, new} strings"),(typeof e.rationale!="string"||e.rationale.trim()==="")&&n.push("`rationale` is required"),e.verbatim!==void 0&&typeof e.verbatim!="boolean"&&n.push("`verbatim` must be a boolean"),e.base!==void 0&&(typeof e.base!="string"||e.base==="")&&n.push("`base` must be a non-empty heads key"),e.base!==void 0&&!o&&!i&&n.push("`base` applies only to a `body` or `replace` edit");const r=Z(e,n),f=e.unset??[];if(!Array.isArray(f)||f.some(d=>!H.includes(d)))n.push(`\`unset\` takes only ${H.join(", ")}`);else for(const d of f)d==="summary"&&(r.summary=null),d==="why_it_exists"&&(r.whyItExists=null),d==="unlisted"&&(r.unlisted=!1),d==="lint_ignore"&&(r.lintIgnore=null),d==="extensions"&&(r.extensions=null),d==="rules"&&(r.rules=[]);!o&&!i&&Object.keys(r).length===0&&n.push("nothing to change: give `body`, `replace`, or a field"),J(n);const s=e,{dto:c,synced:h}=k(d=>{const p=E(d,t),l=B(d,p,t.params.ref),v=j(d,l),$=S(d,p,[l]);try{if(!o&&!i)return me(d,p,l,r),{dto:{id:l.id,name:v,revision:F(d,l).revision},synced:$};const w=s.base??le(d,p,l);if(i&&w!==null){const oe=F(d,l),L=I(d,l);oe.heads_key===w&&L.length===1&&Ae(pe(d,l,A(L[0].body_hash)),s.replace)}const R=s.verbatim===!0,m=o?{body:s.body,verbatim:R}:{replace:s.replace,verbatim:R},y=de(d,p,l,m,s.rationale,w,r,x(d));if("stale"in y)throw _(409,"stale_revision",`${v} changed after your read; it is now at revision ${y.stale.revision}`,`Read it again with \`crtr canvas read ${v}\`, then redo your change on the current text.`,{stale:y.stale});const N=A(I(d,l)[0].body_hash);return{dto:{id:l.id,name:v,revision:y.revision,...Q(d,p,N,y.unresolved)},synced:$}}catch(w){C(w,l)}});return T(h),c}u(je,"edit");function Re(t){const e=D(t);if(e.new_name===void 0&&e.owner===void 0)throw b("give a new name, an owner, or both");if(e.new_name!==void 0&&(typeof e.new_name!="string"||!Y.test(e.new_name)))throw b("`new_name` must be segments of letters, digits, `_` or `-` joined by `/`");const{dto:n,change:o}=k(i=>{const a=E(i,t),r=B(i,a,t.params.ref),f=e.owner===void 0?void 0:W(i,a,e.owner,e.cwd);try{const s=fe(i,a,r,{...e.new_name!==void 0?{name:e.new_name}:{},...f?{owner:f}:{}});return{dto:{id:s.id,name:j(i,s)},change:S(i,a,[r,s],e.cwd)}}catch(s){C(s,r)}});return T(o),n}u(Re,"move");function De(t){const{dto:e,change:n}=k(o=>{const i=E(o,t),a=B(o,i,t.params.ref),r=j(o,a),f=S(o,i,[a]);try{ce(o,i,a,x(o))}catch(s){C(s,a)}return{dto:{id:a.id,name:r},change:f}});return T(n),e}u(De,"remove");function Ce(t){const e=t.query.get("diff"),n=e===null?void 0:Number(e);if(n!==void 0&&!(Number.isInteger(n)&&n>0))throw b("`diff` must be a revision number");return k(o=>{const i=E(o,t),a=z(o,i,decodeURIComponent(t.params.ref));if("remote"in a)throw _(404,"not_found",G(a.remote),"Check the name with `crtr canvas search`.");const r="deleted"in a?a.deleted:a;if(r.type!=="document")throw b(`${r.name} is a ${r.type}, not a document`);const f=ue(o,i,r),s={object:ke(o,r),revisions:f.map(c=>({rev_id:c.rev_id,number:c.number,author_id:c.author,rationale:c.rationale,verbatim:c.verbatim,created_at:c.created_at,parents:c.parents}))};if(n!==void 0){const c=f.find(d=>d.number===n);if(!c)throw new g(404,"not_found",`${r.name} has no revision ${n}`);const h=c.parents[0]===void 0?void 0:f.find(d=>d.rev_id===c.parents[0]);s.diff=_e(h?A(h.body_hash):"",A(c.body_hash))}return s})}u(Ce,"revisionHistory");const ee=1e3,ne=1e3,te=3e3,Se=/^When\b.+\bbecause\b.+/,Te=u(t=>{const e=t.trim();return e===""?0:e.split(/\s+/).length},"words");function Ne(t,e){if(t.some(o=>o.on==="boot"&&o.deliver==="content")&&e>ee)return`body is ${e} words, over the ${ee}-word cap for a boot rule at content (the whole body enters every node's context). Keep the core here and move separate subjects into [[linked]] documents.`;const n=[...new Set(t.filter(o=>o.on!=="boot"&&o.deliver==="content").map(o=>o.on))];return n.length>0&&e>ne?`body is ${e} words, over the ${ne}-word cap for a content rule on ${n.join("/")}. Keep the core here and move separate subjects into [[linked]] documents.`:t.some(o=>o.on==="boot"&&o.deliver==="preview")&&e>te?`body is ${e} words, over the ${te}-word cap for a boot rule at preview. Keep the core here and move separate subjects into [[linked]] documents.`:null}u(Ne,"lengthFinding");function Fe(t){const e=D(t);return k(n=>{const o=E(n,t),i=e.owner===void 0?null:W(n,o,e.owner,e.cwd),a=P(n,"SELECT * FROM objects WHERE type = 'document' AND deleted_at IS NULL AND kind != 'report' ORDER BY name").all(),r=[],f=new Map;for(const s of a){if(i&&s.owner!==i.rowid||!K(n,o,s))continue;const c=F(n,s),h=new Set(c.lint_ignore??[]),d=j(n,s),p=u((m,y,N)=>{h.has(m)||r.push({name:d,severity:y,rule:m,message:N})},"add"),l=ge(n,s),v=I(n,s)[0],$=v?A(v.body_hash):"",w=Ne(l,Te($));w&&p("length","error",w),l.some(m=>m.deliver==="preview")&&!Se.test(s.preview??"")&&p("preview-shape","error",`a rule delivers this document at preview, so the preview must read "When <situation in the reader's work>, read this because <what the reader gains>"`);const R=new Set(P(n,"SELECT written_as FROM edges WHERE type = 'links-to' AND src = ?").all(s.rowid).map(m=>m.written_as));for(const m of U($))R.has(m)||"remote"in X(n,o,m)||p("links","warning",`[[${m}]] names no object in your view`);if(l.some(m=>m.on==="workspace-open"&&m.deliver==="content")){const m=ae(n,s);m.type==="repo"&&!h.has("workspace-open")&&f.set(m.name,[...f.get(m.name)??[],d])}}for(const[s,c]of f)if(!(c.length<2))for(const h of c)r.push({name:h,severity:"warning",rule:"workspace-open",message:`repo ${s} has ${c.length} documents delivered at content on workspace-open (${c.join(", ")}); keep one and link the rest from it`});return{findings:r}})}u(Fe,"lint");const O=u((t,e=200)=>n=>({status:e,body:t(n)}),"ok"),Qe=[{method:"POST",pattern:"/v1/docs",handler:O($e,201)},{method:"PATCH",pattern:"/v1/docs/:ref",handler:O(je)},{method:"POST",pattern:"/v1/docs/:ref/move",handler:O(Re)},{method:"DELETE",pattern:"/v1/docs/:ref",handler:O(De)},{method:"GET",pattern:"/v1/docs/:ref/history",handler:O(Ce)},{method:"POST",pattern:"/v1/docs/lint",handler:O(Fe)}];export{Qe as docRoutes};
@@ -0,0 +1,2 @@
1
+ import type { RouteTable } from '../router.js';
2
+ export declare const feedbackCommentRoutes: RouteTable;
@@ -0,0 +1,3 @@
1
+ var g=Object.defineProperty;var c=(o,t)=>g(o,"name",{value:t,configurable:!0});import{basename as y}from"node:path";import{ApiError as r}from"../../../api/index.js";import{createPageFeedbackComment as I,readPageFeedback as u,resolvePageFeedbackComment as q,PageFeedbackCommentAlreadyResolvedError as C,PageTicketTerminalError as k,UnknownPageFeedbackCommentError as T}from"../../../core/human/feedback.js";import{discardFeedbackCompanion as b,pageDocumentSha256 as P,realizeFeedbackCompanion as N}from"../../../core/human/feedback-companion.js";import{parsePage as S}from"../../../core/human/page.js";import{pageTicketState as F,selectedPageDir as E}from"../../../core/human/tickets.js";import{deliverNodeMessage as x}from"../../messaging/node-message.js";import{requireTicketId as D,resolveTicket as O}from"./inbox.js";import{invalidRequest as p,objectBody as h,optionalString as R,requiredString as l}from"./validate.js";import{toPageFeedbackDTO as w,toPageFeedbackCommentDTO as v}from"../map.js";const M=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function _(o){const t=D(o.params),e=O(t);if(e===null)throw new r(404,"ticket_not_found","no matching ticket");if(e.kind==="review")throw new r(409,"ticket_kind_unsupported","review tickets have no feedback comments");const n=F(e.dir);if(n==="resolved"||n==="canceled")throw new r(409,"ticket_terminal","ticket already has a terminal outcome");return e}c(_,"requireMutablePageTicket");function j(o){const t=o.comment_id;if(t===void 0||!M.test(t))throw new r(400,"invalid_request","invalid feedback comment id");return t}c(j,"requireCommentId");function $(o){return[...o.quote.split(`
2
+ `).map(e=>`> ${e}`),"",o.note].join(`
3
+ `)}c($,"renderCommentTurn");async function z(o){const t=o.mutation.feedback.companionNodeId;if(t===void 0)throw new r(500,"internal","feedback has comments but no companion conversation");try{const e=await x({node_id:t,body:$(o.mutation.comment),label:o.title,from:"human",mode:"interactive",data:{page_id:y(o.dir),comment_id:o.mutation.comment.id,verb:"create"}});return{target_node_id:t,status:"delivered",via:e.via,woke:e.revived,...e.reason===void 0?{}:{reason:e.reason}}}catch(e){return{target_node_id:t,status:"failed",woke:!1,error:e instanceof Error?e.message:String(e)}}}c(z,"deliverCommentTurn");function A(o){const t=[],e=h(o.body,["quote","context","note"],t),n=l(e,"quote",t),i=R(e,"context",t),d=l(e,"note",t);return(t.length>0||n===void 0||d===void 0)&&p("page feedback comment request",t),{quote:n,...i===void 0?{}:{context:i},note:d}}c(A,"parseCreate");async function B(o){const t=A(o),e=_(o),n=S(E(e.dir));if(n.dialect!=="jsx")throw new r(409,"page_dialect_unsupported","feedback comments exist only on TSX pages");let i=u(e.dir).companionNodeId,d,s=!1;if(i===void 0){const m=n.source?.nodeId;if(m===void 0)throw new r(409,"ticket_has_no_sender","this page carries no sending node to deliver feedback to");d=P(e.dir);try{i=await N({ticketId:e.ticketId,dir:e.dir,senderNodeId:m,title:n.title})}catch(f){throw new r(409,"fork_failed",`the sending node could not be forked: ${f instanceof Error?f.message:String(f)}`)}s=!0}let a;try{a=I(e.dir,{...t,companionNodeId:i,firstCommentedSha256:d})}catch(m){throw s&&b(i),m instanceof k?new r(409,"ticket_terminal","ticket already has a terminal outcome"):m}return s&&a.feedback.companionNodeId!==i&&b(i),{status:200,body:{comment:v(a.comment),feedback:w(a.feedback),delivery:await z({dir:e.dir,title:n.title,mutation:a})}}}c(B,"handleCreate");function U(o){const t=[],e=h(o.body,["node_id"],t),n=l(e,"node_id",t);return(t.length>0||n===void 0)&&p("feedback resolve request",t),n}c(U,"parseResolve");async function X(o){const t=_(o),e=j(o.params),n=U(o),i=u(t.dir).companionNodeId;if(i===void 0||n!==i)throw new r(403,"not_companion","only the ticket's bound feedback companion resolves its comments");let d;try{d=q(t.dir,e)}catch(a){throw a instanceof T?new r(404,"unknown_comment",a.message):a instanceof C?new r(409,"comment_already_resolved",a.message):a instanceof k?new r(409,"ticket_terminal","ticket already has a terminal outcome"):a}return{status:200,body:{comment:v(d.comment),feedback:w(d.feedback)}}}c(X,"handleResolve");const oe=[{method:"POST",pattern:"/v1/human/inbox/:ticket_id/feedback-comments",handler:B},{method:"POST",pattern:"/v1/human/inbox/:ticket_id/feedback-comments/:comment_id/resolve",handler:X}];export{oe as feedbackCommentRoutes};
@@ -0,0 +1,2 @@
1
+ import { type RouteTable } from '../router.js';
2
+ export declare const fileRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var S=Object.defineProperty;var o=(e,t)=>S(e,"name",{value:t,configurable:!0});import{closeSync as A,constants as _,fstatSync as q,readSync as B}from"node:fs";import{isAbsolute as T,resolve as R}from"node:path";import{appSpace as I}from"../../../core/layout.js";import{ApiError as u}from"../../../api/index.js";import{notFound as b,usage as c}from"../../../core/errors.js";import{InputError as L}from"../../../core/io.js";import{RunError as m}from"../../../core/runs/operations.js";import{isBeneathRefusal as M,listBeneath as k,openBeneath as v,writeFileBeneath as z}from"../../../core/spaces/open-beneath.js";import{fileRoot as F}from"../../../core/spaces/permissions.js";import{nodeMayReach as N,runNodeIds as P,runPlace as O}from"../../../core/runs/confinement.js";import{resolvedScopes as D}from"../router.js";const p=512*1024,w=1024*1024,C=1e3;function h(e,t){if(e===null||e==="")throw c(`a file ${t} requires a \`path\` ${t==="write"?"body field":"query param"}`);if(!T(e))throw c(`file ${t} path must be absolute`,{received:e});return e}o(h,"requireAbsolutePath");function E(e){if(e==null)return"utf8";if(e==="utf8"||e==="base64")return e;throw c("encoding must be `utf8` or `base64`",{received:e})}o(E,"parseEncoding");function d(e,t,r){if(e instanceof u||e instanceof L||e instanceof m)throw e;if(M(e))throw new m(400,"invalid_request",`${t} meets a symlink, leaves its permitted root, or is not a regular file`,"path");const n=e.code;throw n==="ENOENT"?b(`no such file: ${t}`,{received:t}):n==="EACCES"||n==="EPERM"?new u(403,"forbidden",`permission denied ${r} ${t}`):new u(500,"internal",`cannot ${r} ${t}: ${e instanceof Error?e.message:String(e)}`)}o(d,"mapFilesystemError");function $(e,t){const r=O(e);if(r?.isolated){const n=new Set(P(r.run));return{isolated:!0,reaches:o(i=>n.has(i),"reaches")}}return{isolated:!1,reaches:o(n=>N(e,t,n,t),"reaches")}}o($,"runConfinement");function y(e,t,r){const n=e.principal,i=n.class==="person"?null:n.class==="app"?{app:n.app,resolved:n.scopes,launched:null}:{app:n.app,resolved:D(n),launched:n.scopes,run:$(n.node,n.app)},s=F(i,t,r);if("root"in s)return s.root;throw"hidden"in s?b(`no such file: ${t}`,{received:t}):new m(403,"scope_missing",s.missing?`missing scope ${s.missing}`:`no permission names ${t}`,void 0,void 0,s.missing??void 0)}o(y,"rootFor");function W(e,t,r){let n;try{n=v(e,t,_.O_RDONLY)}catch(i){return d(i,t,"reading")}try{const i=q(n);if(i.isDirectory())throw c(`file peek path is a directory: ${t}`,{received:t});const s=Buffer.allocUnsafe(Math.min(i.size,p)+1),l=B(n,s,0,s.length,0),g=l>p,f=s.subarray(0,Math.min(l,p)).toString(r);return{path:t,content:f,truncated:g}}catch(i){return d(i,t,"reading")}finally{A(n)}}o(W,"readHead");function Y(e){const t=h(e.query.get("path"),"peek");return{status:200,body:W(y(e,t,"read"),t,E(e.query.get("encoding")))}}o(Y,"handlePeek");function Z(e){return e.length%4===0&&/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}o(Z,"isBase64");function j(e){if(typeof e!="object"||e===null||Array.isArray(e))throw c("file write requires an object body");const t=e,r=h(typeof t.path=="string"?t.path:null,"write");if(typeof t.content!="string")throw c("file write requires a string `content` body field");const n=E(t.encoding);if(n==="base64"&&!Z(t.content))throw c("base64 file content must be valid base64");return{path:r,content:t.content,encoding:n}}o(j,"parseWriteBody");function G(e,t,r){if(r.byteLength>w)throw new u(413,"file_too_large",`file content exceeds the ${w} byte limit`);try{return z(e,t,r,{mode:process.platform==="linux"?432:384,atomic:!0}),{path:t,bytes_written:r.byteLength}}catch(n){return d(n,t,"writing")}}o(G,"writeAtomically");function U(e){const{path:t,content:r,encoding:n}=j(e.body);return{status:200,body:G(y(e,t,"rw"),t,Buffer.from(r,n))}}o(U,"handleWrite");function X(e){if(e===null)return C;const t=Number(e);if(!Number.isInteger(t)||t<1)throw c("file list limit must be a positive integer",{received:e});return t}o(X,"parseLimit");function H(e){const t=h(e.query.get("path"),"list"),r=X(e.query.get("limit")),n=y(e,t,"read");let i;try{i=k(n,t,r+1)}catch(f){return d(f,t,"listing")}const s=e.principal;if(s.class==="broker"&&R(t)===I(s.app).nodes){const f=$(s.node,s.app);i=i.filter(({name:a})=>f.reaches(a))}const l=i.slice(0,r).map(({name:f,stat:a})=>({name:f,type:a.isFile()?"file":a.isDirectory()?"dir":"other",size:a.size,modified:a.mtime.toISOString()}));return{status:200,body:{path:t,entries:l,truncated:i.length>r}}}o(H,"handleList");const ce=[{method:"GET",pattern:"/v1/files/peek",scope:"crtr:act",handler:Y},{method:"POST",pattern:"/v1/files/write",scope:"crtr:act",handler:U},{method:"GET",pattern:"/v1/files/list",scope:"crtr:act",handler:H}];export{ce as fileRoutes};
@@ -0,0 +1,2 @@
1
+ import { type RouteTable } from '../router.js';
2
+ export declare const focusRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var r=Object.defineProperty;var o=(n,e)=>r(n,"name",{value:e,configurable:!0});import{focusByPane as i,focusOf as d,listFocuses as a,registerViewerFocus as c}from"../../../core/runtime/placement.js";import{closeFocusRow as f,setFocusPane as p}from"../../../core/canvas/focuses.js";import{usage as s}from"../../../core/errors.js";import{ownerOnly as l}from"../router.js";function u(n){return n===null?null:{focus_id:n.focus_id,pane:n.pane,session:n.session,node_id:n.node_id}}o(u,"toFocusDTO");function y(){return{status:200,body:a().map(e=>u(e))}}o(y,"handleListFocuses");function h(n){const e=n.query.get("node_id");if(e===null||e==="")throw s("focuses/by-node requires a node_id query param");return{status:200,body:u(d(e))}}o(h,"handleFocusByNode");function m(n){const e=n.query.get("pane");if(e===null||e==="")throw s("focuses/by-pane requires a pane query param");return{status:200,body:u(i(e))}}o(m,"handleFocusByPane");function _(n){if(typeof n!="object"||n===null)throw s("register-focus body must be a JSON object");const e=n;if(typeof e.node_id!="string"||e.node_id==="")throw s("node_id is required");if(typeof e.pane!="string"||e.pane==="")throw s("pane is required");return{node_id:e.node_id,pane:e.pane,session:typeof e.session=="string"?e.session:null,window:typeof e.window=="string"?e.window:null}}o(_,"parseRegisterBody");function b(n){const e=_(n.body),t=c(e.node_id,e.pane,e.session,e.window);return{status:200,body:u(t)}}o(b,"handleRegisterFocus");function w(n){if(typeof n!="object"||n===null)throw s("set-focus-pane body must be a JSON object");const e=n;return{pane:typeof e.pane=="string"?e.pane:null,session:typeof e.session=="string"?e.session:null}}o(w,"parseSetPaneBody");function g(n){const e=n.params.focus_id;if(e===void 0||e==="")throw s("focus_id is required");const t=w(n.body);return p(e,t.pane,t.session),{status:204}}o(g,"handleSetFocusPane");function q(n){const e=n.params.focus_id;if(e===void 0||e==="")throw s("focus_id is required");return f(e),{status:204}}o(q,"handleCloseFocus");const O=l([{method:"GET",pattern:"/v1/focuses",handler:y},{method:"POST",pattern:"/v1/focuses",handler:b},{method:"GET",pattern:"/v1/focuses/by-node",handler:h},{method:"GET",pattern:"/v1/focuses/by-pane",handler:m},{method:"PATCH",pattern:"/v1/focuses/:focus_id",handler:g},{method:"DELETE",pattern:"/v1/focuses/:focus_id",handler:q}]);export{O as focusRoutes};
@@ -0,0 +1,2 @@
1
+ import type { RouteTable } from '../router.js';
2
+ export declare function healthRoutes(tcpAddress: () => string | null): RouteTable;
@@ -0,0 +1,14 @@
1
+ var c=Object.defineProperty;var o=(e,t)=>c(e,"name",{value:t,configurable:!0});import{prepared as n}from"../../../core/sqlite-statements.js";import{openDb as r}from"../../../core/canvas/db.js";import{apiSocketPath as i}from"../../../core/canvas/paths.js";import{currentVersion as d}from"../../../core/self-update.js";import{API_VERSION as p}from"../../../api/index.js";import{DEFAULT_INTERVAL_MS as l}from"../../supervise-cadence.js";import{isPidPresent as _}from"../../../core/canvas/pid.js";import{boundDaemonControl as u}from"../../control.js";import{dueReport as m}from"../../due.js";const h=l;function a(){try{return n(r(),"SELECT 1 FROM nodes LIMIT 1").get(),!0}catch{return!1}}o(a,"canvasAccessible");function f(){const e={},t=n(r(),`
2
+ SELECT status, COUNT(*) AS count
3
+ FROM node_rows
4
+ WHERE node_id NOT IN (SELECT node_id FROM warm_pool)
5
+ GROUP BY status
6
+ `).all();for(const s of t)e[s.status]=s.count;return e}o(f,"nodeCounts");function E(){return n(r(),`
7
+ SELECT pi_pid
8
+ FROM node_rows
9
+ WHERE node_id NOT IN (SELECT node_id FROM warm_pool)
10
+ AND kind != 'human'
11
+ AND pi_pid IS NOT NULL
12
+ AND turn_open_at IS NOT NULL
13
+ AND turn_closed_at IS NULL
14
+ `).all().filter(t=>_(t.pi_pid)).length}o(E,"busyNodeCount");function N(){const e=a(),t=u()?.startupBlock()??null,s={ok:e&&t===null,daemon_up:!0,store_accessible:e,brokers_reconciled:t===null,startup_phase:t?.phase??"ready",...t===null?{}:{startup_blocked:t.message}};return{status:s.ok?200:503,body:s}}o(N,"handleHealthz");function T(e){if(!a())throw{status:503,code:"store_unavailable",message:"canvas store is inaccessible"};return{status:200,body:{daemon_pid:process.pid,tick_interval_ms:h,node_counts:f(),busy_node_count:E(),listeners:{socket_path:i(),tcp:e()},runtime_version:d(),api_version:p,startup_phase:u()?.startupBlock()?.phase??"ready"}}}o(T,"handleStatus");function b(){if(!a())throw{status:503,code:"store_unavailable",message:"canvas store is inaccessible"};return{status:200,body:m()}}o(b,"handleDue");function y(e){return[{method:"GET",pattern:"/healthz",handler:o(t=>N(),"handler")},{method:"GET",pattern:"/v1/status",handler:o(t=>T(e),"handler")},{method:"GET",pattern:"/v1/due",handler:o(t=>b(),"handler")}]}o(y,"healthRoutes");export{y as healthRoutes};
@@ -0,0 +1,2 @@
1
+ import type { RouteTable } from '../router.js';
2
+ export declare const hookExecRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var x=Object.defineProperty;var p=(o,n)=>x(o,"name",{value:n,configurable:!0});import{realpathSync as E}from"node:fs";import{isAbsolute as _,relative as k,sep as h}from"node:path";import{ApiError as i}from"../../../api/index.js";import{coreHookCatalog as T}from"../../../build-root.js";import{getNode as O}from"../../../core/canvas/canvas.js";import{isSafeNodeId as P,nodeAgentDir as A}from"../../../core/canvas/paths.js";import{discoverHookRegistry as I}from"../../../core/command-hooks/discovery.js";import{EXEC_HOOK_TIMEOUT_MS as S}from"../../../core/command-hooks/transport/exec-invoke.js";import{buildAppProcessEnv as H}from"../../../core/runtime/spawn-env.js";import{compileLaunch as N}from"../../../core/spaces/mounts.js";import{appProcessSandboxed as M,launchAppProcess as R}from"../../../core/spaces/process.js";import{requireCurrentExecution as B}from"./broker-recovery.js";function y(o,n,t){const r=o.params.id;if(r===void 0?o.principal.class!=="person":!P(r)||o.principal.class!=="broker"||o.principal.node!==r)throw new i(403,"permission_error","hook execution requires its current node, or the person for the global route");const e=r===void 0?null:O(r);if(r!==void 0&&!e)throw new i(404,"not_found","node not found");if(r!==void 0&&B(r,n),typeof t!="string"||!_(t))throw new i(400,"invalid_request","hook cwd must be absolute");if(!M())throw new i(400,"invalid_request","hook routes require the root launcher");let a;try{a=E(t)}catch(u){throw u.code==="ENOENT"?new i(400,"invalid_request","hook cwd does not exist"):u}if(e){if(e.isolated===!0){const d=A(r,e.grantee??"app:terminal"),s=k(d,a);if(s===".."||s.startsWith(`..${h}`)||s.startsWith(h))throw new i(403,"permission_error","hook cwd is outside the isolated node folder")}const u=N({nodeId:r,app:o.principal.class==="broker"?o.principal.app:"app:terminal",sub:e.sub??"user:local",grantId:e.grant_id??null,scopes:e.scopes??null,isolated:e.isolated===!0,command:[],env:{},auditMissing:p(()=>{},"auditMissing")}),f=p(d=>{const s=k(d,a);return s===""||s!==".."&&!s.startsWith(`..${h}`)&&!_(s)},"within");if(!u.mounts.some(d=>f(d.source)))throw new i(403,"permission_error","hook cwd is outside the node mounts")}return{id:r,node:e,cwd:a,app:e&&o.principal.class==="broker"?o.principal.app:"app:terminal"}}p(y,"checkedContext");async function b(o,n){const t=I(await T(),o,n);if(!t.valid)throw new i(422,"hook_registry_invalid","the effective hook registry is invalid");return t}p(b,"currentRegistry");async function C(o){const{node:n,cwd:t}=y(o,o.query.get("expected_execution_id"),o.query.get("cwd"));return{status:200,body:{hooks:(await b(t,n.profile_id??null)).hooks.filter(e=>e.plugin.scope==="user").map(e=>({id:e.id,plugin:e.plugin.name,target:e.target,phase:e.phase,op:e.op,description:e.description,effects:e.effects,declarationIndex:e.declarationIndex}))}}}p(C,"handleHookPlan");async function v(o){const n=o.body;if(!n||typeof n!="object"||Array.isArray(n))throw new i(400,"invalid_request","hook execution requires a JSON body");const t=n,{id:r,node:e,cwd:a,app:u}=y(o,t.expected_execution_id,t.cwd);if(typeof t.hook_id!="string"||typeof t.request!="string")throw new i(400,"invalid_request","hook execution requires hook_id and request");const d=(await b(a,e?.profile_id??null)).hooks.find(c=>c.id===t.hook_id);if(!d)throw new i(404,"hook_not_registered","hook id is not registered for this cwd");const s=H(a,e?.profile_id??null,u),m=await R({...r===void 0?{}:{nodeId:r},app:u,command:[d.executable,"--crtr-hook-protocol","1"],cwd:a,pluginRoot:d.plugin.root,env:s,stdin:t.request,stdoutBytes:10*1024*1024,stderrBytes:64*1024});let l,w=!1;try{const c=await Promise.race([m.completion,new Promise((W,g)=>{l=setTimeout(()=>{w=!0,m.stop().then(()=>g(new i(504,"hook_timeout","hook executable timed out")),q=>g(q))},S)})]);if(w)throw new i(504,"hook_timeout","hook executable timed out");if(c.stdoutTruncated)throw new i(502,"hook_output_limit","hook stdout exceeded the 10 MiB cap");return{status:200,body:{stdout:c.stdout,status:c.exitCode,signal:c.signal}}}finally{l&&clearTimeout(l)}}p(v,"handleHookExec");const Y=[{method:"GET",pattern:"/v1/nodes/:id/hooks/plan",handler:C},{method:"POST",pattern:"/v1/nodes/:id/hooks/exec",handler:v},{method:"POST",pattern:"/v1/hooks/exec",handler:v}];export{Y as hookExecRoutes};
@@ -0,0 +1,2 @@
1
+ import type { RouteTable } from '../router.js';
2
+ export declare const humanRequestRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var N=Object.defineProperty;var o=(e,t)=>N(e,"name",{value:t,configurable:!0});import{statSync as P}from"node:fs";import{isAbsolute as T}from"node:path";import{ApiError as s}from"../../../api/index.js";import{readDaemonActionById as C}from"../../../core/canvas/daemon-actions.js";import{isSafeNodeId as I}from"../../../core/canvas/paths.js";import{getNode as b}from"../../../core/canvas/canvas.js";import{assertScope as $}from"../../../core/scopes.js";import{resolvePageComponents as g}from"../../../core/config.js";import{resolveHumanAction as D}from"../../../core/human-actions.js";import{HUMAN_ACTION_NAME_PATTERN as x}from"../../../core/human/action-binding.js";import{createPageRequest as J,getRequest as F}from"../../../core/human/requests.js";import{preparePageSource as M}from"../../../core/human/page-authoring.js";import{publishPage as B,validatePageTicketResponses as G}from"../../../core/human/tickets.js";import{cancelHumanTicket as H,resolvePageTicket as L}from"../../human/finish.js";import{inboxPageProjection as U}from"./inbox-page.js";const K=1e3,q=200,m={placement:"inline",inbox:!0,reply:!1},v=["sessionName","askedBy","emittedAt","profileName","nodeId"];function c(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(c,"isPlainObject");function l(e,t,n){for(const r of Object.keys(e))if(!t.includes(r))throw new s(400,"invalid_request",`unexpected field in ${n}: ${r}`)}o(l,"requireNoExtraKeys");function i(e){return new s(400,"invalid_request",e)}o(i,"invalid");function w(e){if(!c(e))throw i("`page` must be an object");if(l(e,["dialect","source"],"`page`"),e.dialect!=="jsx"&&e.dialect!=="html")throw i('`page.dialect` must be "jsx" or "html"');if(typeof e.source!="string"||e.source.trim()==="")throw i("`page.source` must be the authored page text");return{dialect:e.dialect,source:e.source}}o(w,"validatePage");function S(e,t){const n=e??t;if(n!=="inline"&&n!=="panel")throw i('`delivery.placement` must be "inline" or "panel"');return n}o(S,"validatePlacement");function X(e,t){if(e===void 0)return m;if(!c(e))throw i("`delivery` must be an object");l(e,["placement","inbox","reply"],"`delivery`");const n=e.inbox??m.inbox,r=e.reply??m.reply;if(typeof n!="boolean")throw i("`delivery.inbox` must be boolean");if(typeof r!="boolean")throw i("`delivery.reply` must be boolean");if(r&&t===null)throw i("`delivery.reply` requires `requester_node_id`");return{placement:S(e.placement,m.placement),inbox:n,reply:r}}o(X,"validateCreateDelivery");function z(e,t){if(e===void 0)return t;if(!c(e))throw i("`delivery` must be an object");return l(e,["placement"],"`delivery`"),{...t,placement:S(e.placement,t.placement)}}o(z,"validateReplaceDelivery");function V(e){if(e===void 0)return;if(!c(e))throw i("`source` must be an object");l(e,v,"`source`");const t={};for(const n of v){const r=e[n];if(r!==void 0){if(typeof r!="string"||r==="")throw i(`\`source.${n}\` must be a nonempty string`);t[n]=r}}return t}o(V,"validateSource");function Y(e){if(typeof e!="string"||e==="")throw i("`creator_cwd` is required");if(!T(e))throw i("`creator_cwd` must be an absolute path");try{if(!P(e).isDirectory())throw i(`\`creator_cwd\` is not a directory: ${e}`)}catch(t){throw t instanceof s?t:i(`\`creator_cwd\` does not exist: ${e}`)}return e}o(Y,"validateCreatorCwd");function Q(e){if(e!==void 0){if(!c(e))throw i("`action` must be an object");if(l(e,["name","payload"],"`action`"),typeof e.name!="string"||!x.test(e.name))throw i("`action.name` must be a declared action name");return{name:e.name,payload:e.payload??null}}}o(Q,"validateActionSelection");function W(e){if(e==null)return null;if(typeof e!="string"||!I(e))throw i("`requester_node_id` must be a safe node id or null");return e}o(W,"validateRequesterNodeId");function Z(e){if(!c(e))throw i("request body is required");l(e,["page","delivery","source","requester_node_id","creator_cwd","action"],"the request body");const t=V(e.source),n=W(e.requester_node_id),r=Q(e.action);return{page:w(e.page),delivery:X(e.delivery,n),...t===void 0?{}:{source:t},requesterNodeId:n,creatorCwd:Y(e.creator_cwd),...r===void 0?{}:{action:r}}}o(Z,"validateCreateRequest");function ee(e,t){if(!c(e))throw i("request body is required");return l(e,["page","delivery"],"the request body"),{page:w(e.page),delivery:z(e.delivery,t)}}o(ee,"validateReplaceRequest");function _(e,t,n){if(e!==void 0){if(typeof e!="string"||e.trim()===""||e.length>n)throw i(`\`${t}\` must be nonempty after trim and at most ${n} characters`);return e}}o(_,"optionalBoundedString");function te(e){if(!c(e))throw i("request body is required");if(l(e,["responses","actor"],"the request body"),!c(e.responses))throw i("`responses` must be an object");const t=_(e.actor,"actor",q);return{responses:e.responses,...t===void 0?{}:{actor:t}}}o(te,"validateRespondRequest");function ne(e){if(e===void 0)return{};if(!c(e))throw i("request body must be an object");l(e,["reason","actor"],"the request body");const t=_(e.reason,"reason",K),n=_(e.actor,"actor",q);return{...t===void 0?{}:{reason:t},...n===void 0?{}:{actor:n}}}o(ne,"validateSettleRequest");function h(e){const t=e.params.request_id;if(typeof t!="string"||t==="")throw i("request id is required");return t}o(h,"requestId");function f(e){const t=F(e);if(t===null||t.kind!=="page")throw new s(404,"not_found","no request with that id");return t}o(f,"requirePageRequest");function A(e){try{const t=JSON.parse(e.specification_json);if(!c(t))throw new Error("not an object");return t}catch{throw new s(500,"internal","the request specification could not be read")}}o(A,"manifest");function re(e){if(e.result_json===null)return null;try{return JSON.parse(e.result_json)}catch{throw new s(500,"internal","the request result could not be read")}}o(re,"terminalResult");function oe(e){if(e.action_json===null)return null;try{const t=JSON.parse(e.action_json);if(t.schema!=="crtr.human-action-binding/v1"||typeof t.name!="string")throw new Error("invalid action");return t}catch{throw new s(500,"internal","the request action could not be read")}}o(oe,"frozenAction");function ie(e){return e.state!=="settled"?"pending":e.outcome==="answered"?"answered":e.outcome==="dismissed"?"dismissed":"canceled"}o(ie,"requestState");function ae(e){if(e.action_delivery_id===null)return{state:"none",attempt:0};const t=C(e.action_delivery_id);if(t===null)return{state:"none",attempt:0};const n=t.state==="acknowledged"?"accepted":t.state==="permanent_failed"?"permanent_failed":t.state==="handed_off"?"running":"pending",r={state:n,attempt:t.attempts};return n==="pending"&&t.nextAttemptAt!==null&&(r.next_attempt_at=new Date(t.nextAttemptAt).toISOString()),t.acknowledgedAt!==null&&(r.accepted_at=new Date(t.acknowledgedAt).toISOString()),t.failedAt!==null&&(r.permanent_failed_at=new Date(t.failedAt).toISOString()),t.lastFailure!==null&&(r.last_failure=t.lastFailure),r}o(ae,"deliveryDetail");function y(e){const t=A(e),n=re(e),r=ie(e),a={request_id:e.request_id,inbox_ticket_id:e.inbox_ticket_id,request_dir:e.request_dir,kind:e.kind,state:r,title:e.title,source:t.source??{},emitted_at:t.source?.emittedAt??e.created_at};e.subtitle!==null&&(a.subtitle=e.subtitle),e.kind==="page"&&(a.page=U(e)),n!==null&&(a.settled_at=e.settled_at??e.updated_at,n.kind==="page"&&r==="answered"&&(a.responses=n.responses),n.kind==="canceled"&&n.reason!==void 0&&(a.reason=n.reason),n.kind==="page"&&n.actor!==void 0&&(a.actor=n.actor),n.kind==="canceled"&&n.actor!==void 0&&(a.actor=n.actor));const u=oe(e);return u!==null&&(a.action={name:u.name,payload:u.payload},a.delivery=ae(e)),a}o(y,"requestToDTO");function k(e,t,n,r){try{return M({dialect:e,document:t,source:n,delivery:r,productKinds:g()})}catch(a){throw i(a instanceof Error?a.message:"the page could not be prepared")}}o(k,"prepareOrReject");function se(e){const t=Z(e.body),n=t.requesterNodeId??t.source?.nodeId;if(n!=null){const d=b(n);d!==null&&$(d,"crtr:act")}let r;if(t.action!==void 0){const d=D(t.action.name,t.creatorCwd);if("kind"in d){const E=d.kind==="unknown_action"?`no action named ${d.name} is declared from ${t.creatorCwd}`:`${d.name} is declared in ${d.configOrigin} but unusable: ${d.reason}`;throw new s(400,d.kind,E)}const p=n==null?null:b(n);if(n&&!p)throw new s(404,"not_found","action requester node not found");if(p&&e.principal.class!=="person"&&p.grantee!==e.principal.app)throw new s(403,"permission_error","action requester belongs to another app");r=JSON.stringify({schema:"crtr.human-action-binding/v1",name:t.action.name,payload:t.action.payload,creatorCwd:t.creatorCwd,configOrigin:d.configOrigin,argv:d.argv,cwd:d.cwd,app:p?.grantee??(e.principal.class==="broker"?e.principal.app:"app:terminal")})}const a=k(t.page.dialect,t.page.source,t.source,t.delivery),u=J({prepared:a,requester_node_id:t.requesterNodeId,...r===void 0?{}:{action_json:r}});return{status:201,body:{request_id:u.request_id,request_dir:u.request_dir,state:"pending",...t.action===void 0?{}:{action:{name:t.action.name}},delivery_state:"none"}}}o(se,"handleCreate");function de(e){return{status:200,body:y(f(h(e)))}}o(de,"handleGet");function ce(e){const t=f(h(e));if(t.state==="settled")throw new s(409,"already_settled","the request already has a terminal result");const n=A(t),r=ee(e.body,n.delivery),a=k(r.page.dialect,r.page.source,n.source,r.delivery);try{B(t.request_dir,a)}catch(u){throw u instanceof Error&&u.message===`page request is not open: ${t.request_id}`?new s(409,"already_settled","the request already has a terminal result"):u}return{status:200,body:y(f(t.request_id))}}o(ce,"handleReplace");function O(e){return e instanceof s?e:e instanceof Error&&e.message.includes("unknown page request")?new s(404,"not_found","no request with that id"):e instanceof Error&&e.message==="page_has_no_response_lifecycle"?new s(409,"not_settleable","this request carries no response lifecycle"):new s(500,"internal","the request could not be settled")}o(O,"settlementError");function R(e){if(e.state==="settled")throw new s(409,"already_settled","the request already has a terminal result");if(!e.settleable)throw new s(409,"not_settleable","this request carries no response lifecycle")}o(R,"requireSettleable");async function ue(e){const t=f(h(e)),n=te(e.body);R(t);try{G(t.request_dir,n.responses)}catch(r){throw i(r instanceof Error?r.message:"the response map is invalid")}try{await L(t.request_id,n.responses,n.actor===void 0?{}:{actor:n.actor})}catch(r){throw O(r)}return{status:200,body:y(f(t.request_id))}}o(ue,"handleRespond");async function j(e,t){const n=f(h(e)),r=ne(e.body);R(n);try{await H(n.request_id,{...r,disposition:t})}catch(a){throw O(a)}return{status:200,body:y(f(n.request_id))}}o(j,"settle");function le(){return{status:200,body:{components:[...g()]}}}o(le,"handleComponents");const je=[{method:"GET",pattern:"/v1/human/components",handler:o(()=>le(),"handler")},{method:"POST",pattern:"/v1/human/requests",scope:"crtr:act",handler:se},{method:"GET",pattern:"/v1/human/requests/:request_id",handler:de},{method:"POST",pattern:"/v1/human/requests/:request_id/replace",handler:ce},{method:"POST",pattern:"/v1/human/requests/:request_id/respond",handler:ue},{method:"POST",pattern:"/v1/human/requests/:request_id/dismiss",handler:o(e=>j(e,"dismissed"),"handler")},{method:"POST",pattern:"/v1/human/requests/:request_id/cancel",handler:o(e=>j(e,"canceled"),"handler")}];export{je as humanRequestRoutes};
@@ -0,0 +1,2 @@
1
+ import type { RouteTable } from '../router.js';
2
+ export declare const humanRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ const o=[];export{o as humanRoutes};
@@ -0,0 +1,4 @@
1
+ import type { InboxPageDTO } from '../../../api/index.js';
2
+ import { type HumanRequestRecord } from '../../../core/human/requests.js';
3
+ /** Project the one SQL-selected page revision for every page reader. */
4
+ export declare function inboxPageProjection(request: HumanRequestRecord): InboxPageDTO;
@@ -0,0 +1 @@
1
+ var u=Object.defineProperty;var i=(e,t)=>u(e,"name",{value:t,configurable:!0});import{readFileSync as n}from"node:fs";import{readPageFeedback as s}from"../../../core/human/feedback.js";import{pageModulePath as a,pagePath as l}from"../../../core/human/convention.js";import{parsePage as p}from"../../../core/human/page.js";import{presentationDir as f}from"../../../core/human/requests.js";import{readPageProgress as g,readTicketResult as m}from"../../../core/human/tickets.js";import{toPageFeedbackDTO as k}from"../map.js";function b(e){const t={kind:e.kind,step:e.step,config:e.config};return e.id!==void 0&&(t.id=e.id),e.unvalidated===!0&&(t.unvalidated=!0),e.display===!0&&(t.display=!0),t}i(b,"pageSlotToDTO");function _(e){const t={schema:"crtr.page/v2",dialect:e.dialect,title:e.title,delivery:e.delivery,document:e.document,steps:e.steps,slots:e.slots.map(b)};if(e.subtitle!==void 0&&(t.subtitle=e.subtitle),e.source!==void 0){const r={};e.source.sessionName!==void 0&&(r.sessionName=e.source.sessionName),e.source.askedBy!==void 0&&(r.askedBy=e.source.askedBy),e.source.emittedAt!==void 0&&(r.emittedAt=e.source.emittedAt),e.source.profileName!==void 0&&(r.profileName=e.source.profileName),e.source.nodeId!==void 0&&(r.nodeId=e.source.nodeId),Object.keys(r).length>0&&(t.source=r)}return t}i(_,"pageManifestToDTO");function y(e){return e.settleable?e.state!=="settled"?"pending":e.outcome==="canceled"||e.outcome==="dismissed"?"canceled":"resolved":"passive"}i(y,"state");function v(e){const t=m(e.request_dir);if(t===null)return null;if(t.kind==="page"||t.kind==="canceled")return t;throw new Error(`page request has an invalid terminal result: ${e.request_id}`)}i(v,"result");function O(e){if(e.kind!=="page")throw new Error(`request is not a page: ${e.request_id}`);const t=f(e),r=p(t),o=n(l(t,r.dialect),"utf8"),c=r.dialect==="jsx"?n(a(t),"utf8"):o,d=e.settleable?g(e.request_dir):null;return{ticket_id:e.inbox_ticket_id,kind:"page",state:y(e),revision:t,page:_(r),document:c,source_document:o,document_media_type:r.dialect==="jsx"?"text/jsx":"text/html",progress:d===null?null:{responses:d},result:v(e),feedback:k(s(e.request_dir))}}i(O,"inboxPageProjection");export{O as inboxPageProjection};
@@ -0,0 +1,12 @@
1
+ import type { InboxTicketIdDTO } from '../../../api/index.js';
2
+ import type { RouteTable } from '../router.js';
3
+ export interface ResolvedTicket {
4
+ ticketId: string;
5
+ dir: string;
6
+ kind: 'page' | 'review';
7
+ }
8
+ /** Resolve one opaque inbox ticket id to its canonical directory. Shared with
9
+ * the feedback-comment routes, which address tickets by the same ids. */
10
+ export declare function resolveTicket(ticketId: InboxTicketIdDTO): ResolvedTicket | null;
11
+ export declare function requireTicketId(params: Record<string, string>): InboxTicketIdDTO;
12
+ export declare const inboxRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var g=Object.defineProperty;var d=(e,n)=>g(e,"name",{value:n,configurable:!0});import{ApiError as t}from"../../../api/index.js";import{inboxPageProjection as v}from"./inbox-page.js";import{getRequestByInboxTicket as p}from"../../../core/human/requests.js";import{getNode as w}from"../../../core/canvas/canvas.js";import{canReadNode as m}from"../router.js";import{parsePage as y}from"../../../core/human/page.js";import{scanInbox as q,scanPageHistory as T}from"../../../core/human/scan.js";import{readPageTicket as h,readTicketResult as k,selectedPageDir as I,validatePageTicketResponses as A,writePageProgress as P}from"../../../core/human/tickets.js";import{describePageAnswer as x}from"../../../core/human/answer.js";import{cancelHumanTicket as E,resolvePageTicket as R}from"../../human/finish.js";const O="Canceled from the inbox.",N=1e3,S=/^[a-f0-9]{64}$/;function c(e){const n=p(e);return n===null?null:{ticketId:n.request_id,dir:n.request_dir,kind:n.kind}}d(c,"resolveTicket");function l(e){const n=e.ticket_id;if(n===void 0||!S.test(n))throw new t(400,"invalid_request","invalid ticket id");return n}d(l,"requireTicketId");function u(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}d(u,"isPlainObject");function f(e,n){for(const i of Object.keys(e))if(!n.includes(i))throw new t(400,"invalid_request",`unexpected field: ${i}`)}d(f,"requireNoExtraKeys");function C(e){if(!u(e))throw new t(400,"invalid_request","respond body is required");if(f(e,["responses"]),!u(e.responses))throw new t(400,"invalid_request","`responses` must be an object");return{responses:e.responses}}d(C,"validateRespondRequest");function D(e){if(!u(e))throw new t(400,"invalid_request","progress body is required");if(f(e,["responses"]),!u(e.responses))throw new t(400,"invalid_request","`responses` must be an object");return{responses:e.responses}}d(D,"validateProgressRequest");function j(e){if(e===void 0)return{};if(!u(e))throw new t(400,"invalid_request","cancel body must be an object");if(f(e,["reason"]),e.reason===void 0)return{};const n=e.reason;if(typeof n!="string")throw new t(400,"invalid_request","`reason` must be a string");if(n.trim()===""||n.length>N)throw new t(400,"invalid_request","`reason` must be nonempty after trim and at most 1000 characters");return{reason:n}}d(j,"validateCancelRequest");const G=[/^slot ".*?" /,/^response names unknown or non-response-bearing slot id/,/^final page response is missing response-bearing slot id/];function _(e){return e instanceof Error&&G.some(n=>n.test(e.message))}d(_,"isSlotValidationError");function b(e){const n={request_id:e.id,request_dir:e.dir,ticket_id:e.inboxTicketId,kind:"page",title:e.title,placement:e.placement,dialect:e.dialect,steps:e.steps,emitted_at:e.emittedAt,source:e.source,slot_kinds:e.slotKinds,inbox:e.inbox,awaits_response:e.awaitsResponse,state:e.state};return e.subtitle!==""&&(n.subtitle=e.subtitle),e.answerDigest!==void 0&&(n.answer_digest=e.answerDigest),e.recommendedOptions.length>0&&(n.recommended_options=e.recommendedOptions.map(i=>({slot_id:i.slotId,option_id:i.optionId,label:i.label}))),e.fastAction!==void 0&&(n.fast_action={kind:e.fastAction.kind,responses:e.fastAction.responses}),n}d(b,"pageSummaryToDTO");function L(e){return{status:200,body:{tickets:q().filter(i=>{if(e.principal.class==="person")return!0;const r=p(i.inboxTicketId),s=r?.requester_node_id?w(r.requester_node_id):null;return s!==null&&m(e.principal,s.grantee??"app:terminal",s.node_id)}).map(i=>{if(i.kind==="page")return b(i);if(i.kind==="review")return{request_id:i.id,request_dir:i.dir,ticket_id:i.inboxTicketId,kind:"review",title:i.title,subtitle:i.subtitle,blocked_since:i.blockedSince,source:i.source};throw new Error(`unknown ticket kind: ${i.kind}`)}).sort((i,r)=>{const s=d(a=>a.kind==="page"?a.emitted_at:a.blocked_since,"pageTime"),o=Date.parse(s(r))-Date.parse(s(i));return o!==0?o:i.ticket_id.localeCompare(r.ticket_id)})}}}d(L,"handleList");function H(e){const n=e.query.get("node_id");if(n==="")throw new t(400,"invalid_request","node_id must be nonempty when present");return{status:200,body:{tickets:T(n??void 0).filter(s=>{if(e.principal.class==="person")return!0;const o=p(s.inboxTicketId),a=o?.requester_node_id?w(o.requester_node_id):null;return a!==null&&m(e.principal,a.grantee??"app:terminal",a.node_id)}).map(b)}}}d(H,"handleHistory");function K(e){const n=l(e.params),i=c(n);if(i===null)throw new t(404,"ticket_not_found","no matching ticket");if(i.kind==="review")throw new t(409,"ticket_kind_unsupported","review tickets have no page read operation");const r=p(n);if(r===null||r.kind!=="page")throw new t(404,"ticket_not_found","no matching ticket");try{return{status:200,body:v(r)}}catch{throw new t(500,"internal","the ticket could not be read")}}d(K,"handleGetPage");async function $(e){const n=l(e.params),i=C(e.body),r=c(n);if(r===null)throw new t(404,"ticket_not_found","no matching ticket");if(r.kind==="review")throw new t(409,"ticket_kind_unsupported","review tickets submit through their own path");if(h(r.dir).state==="passive")throw new t(409,"page_has_no_response_lifecycle","this page has no response lifecycle");const s=k(r.dir);if(s!==null&&s.kind!=="canceled")throw new t(409,"ticket_already_resolved","ticket was already resolved");if(s?.kind==="canceled")throw new t(409,"ticket_canceled","canceled tickets cannot be answered");try{A(r.dir,i.responses)}catch(o){throw _(o)?new t(400,"invalid_ticket_response",o.message):new t(500,"internal","validation failed")}try{const o=await R(r.ticketId,i.responses);if(o.kind!=="page")throw new t(409,"ticket_kind_mismatch","unexpected result kind");return{status:200,body:o}}catch(o){throw o instanceof t?o:_(o)?new t(400,"invalid_ticket_response",o.message):new t(500,"internal","the ticket could not be finalized")}}d($,"handleRespond");function V(e){const n=l(e.params),i=D(e.body),r=c(n);if(r===null)throw new t(404,"ticket_not_found","no matching ticket");if(r.kind==="review")throw new t(409,"ticket_kind_unsupported","review tickets do not support progress autosave");if(h(r.dir).state==="passive")throw new t(409,"page_has_no_response_lifecycle","this page has no response lifecycle");const s=k(r.dir);if(s!==null&&s.kind!=="canceled")throw new t(409,"ticket_already_resolved","ticket was already resolved");try{return P(r.dir,i.responses),{status:200,body:{}}}catch(o){throw _(o)?new t(400,"invalid_ticket_response",o.message):new t(500,"internal","progress could not be saved")}}d(V,"handleProgress");async function z(e){const n=l(e.params),i=j(e.body),r=c(n);if(r===null)throw new t(404,"ticket_not_found","no matching ticket");if(r.kind==="review")throw new t(409,"ticket_kind_unsupported","review tickets have their own cancel path");if(h(r.dir).state==="passive")throw new t(409,"page_has_no_response_lifecycle","this page has no response lifecycle");try{const s=await E(r.ticketId,{reason:i.reason??O,actor:"human",disposition:"dismissed"});if(s.outcome==="already_settled"||s.result.kind!=="canceled")throw new t(409,"ticket_already_resolved","ticket was already resolved");return{status:200,body:s.result}}catch(s){throw s instanceof t?s:new t(500,"internal","the ticket could not be canceled")}}d(z,"handleCancel");function B(e){const n=l(e.params),i=c(n);if(i===null)throw new t(404,"ticket_not_found","no matching ticket");if(i.kind==="review")throw new t(409,"ticket_kind_unsupported","review tickets fetch responses through their own path");const r=k(i.dir);if(r===null)throw new t(404,"ticket_pending","ticket has no response yet");if(r.kind==="canceled")throw new t(404,"ticket_canceled","canceled tickets have no response");if(r.kind!=="page")throw new t(409,"ticket_kind_mismatch","unexpected result kind");try{const s=y(I(i.dir));return{status:200,body:{...r,answer:x(s,r.responses,{completedAt:r.completedAt})}}}catch{throw new t(500,"internal","the ticket answer could not be read")}}d(B,"handleGetResponse");const ne=[{method:"GET",pattern:"/v1/human/inbox",handler:L},{method:"GET",pattern:"/v1/human/inbox/history",handler:H},{method:"GET",pattern:"/v1/human/inbox/:ticket_id",handler:K},{method:"GET",pattern:"/v1/human/inbox/:ticket_id/response",handler:B},{method:"POST",pattern:"/v1/human/inbox/:ticket_id/respond",handler:$},{method:"POST",pattern:"/v1/human/inbox/:ticket_id/progress",handler:V},{method:"POST",pattern:"/v1/human/inbox/:ticket_id/cancel",handler:z}];export{ne as inboxRoutes,l as requireTicketId,c as resolveTicket};
@@ -0,0 +1,2 @@
1
+ import { type RouteTable } from '../router.js';
2
+ export declare const limitsRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var h=Object.defineProperty;var n=(e,s)=>h(e,"name",{value:s,configurable:!0});import{existsSync as k}from"node:fs";import{runtimeRoot as i}from"../../../core/layout.js";import{launcherRequest as y}from"../../../launcher/client.js";import{LAUNCHER_SOCKET as w}from"../../../launcher/spec.js";import{bareApp as d,budgetFor as v}from"../../../launcher/limits/policy.js";import{LimitInputError as S,applyChange as g,readSettings as p,removeOverride as E,writeSettings as u}from"../../../launcher/limits/settings.js";import{ownerOnly as R}from"../router.js";function c(){return process.platform==="linux"&&k(w)}n(c,"hasLauncher");function m(e){throw{status:400,code:"invalid_request",message:e}}n(m,"bad");function l(e,s){const t=s?.apps.find(r=>r.app===d(e));if(t)return{app:`app:${t.app}`,memory_bytes:t.memory_bytes,disk_bytes:t.disk_bytes,memory_source:t.memory_source,disk_source:t.disk_source,disk_used_bytes:t.disk_used_bytes};const o=v(e,p(i()));return{app:`app:${d(e)}`,memory_bytes:o.memoryBytes,disk_bytes:o.diskBytes,memory_source:o.memorySource,disk_source:o.diskSource,disk_used_bytes:null}}n(l,"appRow");async function f(){if(!c())return null;const e=await y({operation:"limits.show"});return"limits"in e?e.limits:null}n(f,"report");async function A(){const e=await f(),s=p(i()),t=new Set([...e?.apps.map(r=>r.app)??[],...Object.keys(s.apps)]);return{status:200,body:{memory_enforced:e?.memory.available??!1,memory_reason:e?e.memory.reason:"this host has no launcher, so memory limits are not enforced",disk_enforced:e?.disk.available??!1,disk_reason:e?e.disk.reason:"this host has no launcher, so disk limits are not enforced",apps:[...t].sort().map(r=>l(r,e))}}}n(A,"handleShow");function b(e){const s=d(decodeURIComponent(e.params.app??""));return/^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$/.test(s)||m(`app must be an app id such as app:terminal; received ${e.params.app??""}`),s}n(b,"appParam");async function _(e){let s=!1;return c()&&(await y({operation:"limits.apply",app:e}),s=!0),{app:`app:${e}`,applied:s,limits:l(e,await f())}}n(_,"apply");async function $(e){const s=b(e),t=e.body;(t===null||typeof t!="object"||Array.isArray(t))&&m("body must be an object with memory_bytes and/or disk_bytes");const{memory_bytes:o,disk_bytes:r}=t;o===void 0&&r===void 0&&m("set at least one of memory_bytes and disk_bytes");try{const a=g(p(i()),s,{...o===void 0?{}:{memory_bytes:o},...r===void 0?{}:{disk_bytes:r}});u(i(),a)}catch(a){throw a instanceof S&&m(a.message),a}return{status:200,body:await _(s)}}n($,"handleSet");async function C(e){const s=b(e),t=e.query.get("fields"),o=t===null||t===""?["memory","disk"]:t.split(",");return o.every(r=>r==="memory"||r==="disk")||m(`fields must be memory, disk or memory,disk; received ${t}`),u(i(),E(p(i()),s,o)),{status:200,body:await _(s)}}n(C,"handleRemove");const I=R([{method:"GET",pattern:"/v1/limits",handler:A},{method:"PUT",pattern:"/v1/limits/apps/:app",handler:$},{method:"DELETE",pattern:"/v1/limits/apps/:app",handler:C}]);export{I as limitsRoutes};
@@ -0,0 +1,2 @@
1
+ import type { RouteTable } from '../router.js';
2
+ export declare const llmRoutes: RouteTable;
@@ -0,0 +1,3 @@
1
+ var y=Object.defineProperty;var d=(o,r)=>y(o,"name",{value:r,configurable:!0});import{randomUUID as b}from"node:crypto";import{MODEL_CONTEXT_BODY_MAX_BYTES as h}from"../../../core/llm/body-limits.js";import{parseLlmRequest as g,runLlm as w}from"../../../core/llm/run.js";import{RunError as l}from"../../../core/runs/operations.js";import{getNode as v}from"../../../core/canvas/canvas.js";import{socketPrincipal as u}from"../server.js";function _(o,r){if(r==="broker"||r==="person"||r===void 0||!o||typeof o!="object"||Array.isArray(o)||!("rate_limit"in o))return o;const{rate_limit:s,...a}=o;return a}d(_,"operatorDetails");const B=[{method:"POST",pattern:"/v1/llm",scope:"crtr:llm",maxBodyBytes:h,handler:d(async({body:o,res:r,req:s})=>{const a=b();r.setHeader("Request-Id",a);const f=new AbortController,p=d(()=>f.abort(),"abort");r.on("close",p);let c;try{const e=g(o),t=u(s),n=t?.class==="broker"?v(t.node):null;if(t?.class==="broker"&&!n)throw new l(401,"unauthorized","node not found");const i=await w(e,f.signal,e.stream?m=>{typeof m.served_model=="string"&&(c=m.served_model),r.headersSent||r.writeHead(200,{"content-type":"application/x-ndjson; charset=utf-8","cache-control":"no-cache"}),r.write(`${JSON.stringify(m)}
2
+ `)}:void 0,n?{cwd:n.cwd,profileId:n.profile_id??null}:void 0);return e.stream?(r.headersSent||r.writeHead(200,{"content-type":"application/x-ndjson; charset=utf-8","cache-control":"no-cache"}),r.end(),{status:200}):{status:200,body:i.completion}}catch(e){if(r.headersSent){const t=e instanceof l?e:new l(503,"upstream_model_unavailable","model stream failed"),n=t.details&&typeof t.details=="object"&&!Array.isArray(t.details)?t.details:{},i=_(c!==void 0&&typeof n.served_model!="string"?{...n,served_model:c}:t.details,u(s)?.class);return r.end(`${JSON.stringify({error:{code:t.code,message:t.message,...i===void 0?{}:{details:i},type:"server_error",origin:"runtime",retryable:t.retryable,request_id:a}})}
3
+ `),{status:200}}if(e instanceof l){const t=_(e.details,u(s)?.class);return e.code==="all_routes_exhausted"&&r.setHeader("Retry-After",String(e.details.retry_after_s)),{status:e.status,body:{error:{code:e.code,message:e.message,...t===void 0?{}:{details:t},type:e.status===429?"rate_limit_error":e.status<500?"invalid_request_error":"server_error",...e.param?{param:e.param}:{},origin:"runtime",retryable:e.retryable,request_id:a,...e.code==="all_routes_exhausted"?{retry_after_s:e.details.retry_after_s}:{}}}}}throw e}finally{r.off("close",p)}},"handler")}];export{B as llmRoutes};
@@ -0,0 +1,4 @@
1
+ import type { RouteTable } from '../router.js';
2
+ export declare const MAX_MEMORY_READ_EVENTS = 500;
3
+ export declare const MAX_MEMORY_READ_TEXT = 512;
4
+ export declare const memoryReadsRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var l=Object.defineProperty;var i=(e,t)=>l(e,"name",{value:t,configurable:!0});import{ApiError as f}from"../../../api/index.js";import{getNode as b}from"../../../core/canvas/canvas.js";import{insertMemoryReads as v}from"../../../core/canvas/memory-reads.js";const p=500,u=512,w=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?Z$/;function r(e){return new f(400,"invalid_request",e)}i(r,"invalid");function y(e,t,o){if(typeof e!="string"||e.length===0||e.length>u)throw r(`events[${o}].${t} must be a non-empty string of at most ${u} characters`);return e}i(y,"text");function g(e){if(typeof e!="object"||e===null||Array.isArray(e))throw r("body must be an object");const t=Object.keys(e).filter(n=>n!=="events");if(t.length>0)throw r(`unknown body field: ${t.join(", ")}`);const o=e.events;if(!Array.isArray(o)||o.length<1||o.length>p)throw r(`events must be an array of 1\u2013${p} events`);return o.map((n,a)=>{if(typeof n!="object"||n===null||Array.isArray(n))throw r(`events[${a}] must be an object`);const s=n,m=Object.keys(s).filter(h=>!["name","scope","at","type"].includes(h));if(m.length>0)throw r(`events[${a}] has unknown field: ${m.join(", ")}`);if(s.type!=="read"&&s.type!=="loaded")throw r(`events[${a}].type must be "read" or "loaded"`);const d=s.at,c=typeof d=="string"&&w.test(d)?Date.parse(d):Number.NaN;if(!Number.isFinite(c))throw r(`events[${a}].at must be an ISO UTC timestamp`);return{name:y(s.name,"name",a),scope:y(s.scope,"scope",a),at:new Date(c).toISOString(),type:s.type}})}i(g,"parseEvents");function A(e){const t=e.params.id??"",o=g(e.body),n=b(t);if(!n||n.kind==="human")throw new f(404,"not_found","node not found");return v(t,o),{status:204}}i(A,"handleMemoryReads");const M=[{method:"POST",pattern:"/v1/nodes/:id/memory-reads",handler:A}];export{p as MAX_MEMORY_READ_EVENTS,u as MAX_MEMORY_READ_TEXT,M as memoryReadsRoutes};
@@ -0,0 +1,38 @@
1
+ import type { ObjectRow } from '../../../core/graph/types.js';
2
+ import type { RequestPrincipal, RouteTable } from '../router.js';
3
+ export declare const MEMORY_OPERATIONS: Set<string>;
4
+ /** `memory.get` serves at most this many body bytes (D2-MEM-20). */
5
+ export declare const MEMORY_BODY_MAX_BYTES: number;
6
+ declare const KINDS: readonly ["knowledge", "preference"];
7
+ type MemoryKind = (typeof KINDS)[number];
8
+ export interface MemoryListItem {
9
+ name: string;
10
+ folder: string;
11
+ kind: MemoryKind;
12
+ preview: string;
13
+ summary: string | null;
14
+ privacy: ObjectRow['privacy'];
15
+ revision: number;
16
+ created_at: string;
17
+ updated_at: string;
18
+ }
19
+ export interface MemoryDocument extends MemoryListItem {
20
+ body: string;
21
+ size: number;
22
+ truncated: boolean;
23
+ grantee: string | null;
24
+ }
25
+ /** The longest prefix of at most `max` bytes that ends on a whole UTF-8 character. */
26
+ export declare function utf8Prefix(buffer: Buffer, max: number): Buffer;
27
+ export declare function memoryList(principal: RequestPrincipal, query: URLSearchParams): {
28
+ items: MemoryListItem[];
29
+ next_cursor: string | null;
30
+ };
31
+ export declare function memoryGet(principal: RequestPrincipal, query: URLSearchParams): MemoryDocument;
32
+ export declare function handleMemoryOperation(name: string, principal: RequestPrincipal, query: URLSearchParams): {
33
+ status: number;
34
+ body: unknown;
35
+ };
36
+ /** Unix socket and v0 loopback: person, broker, and a scoped app token. */
37
+ export declare const memoryRoutes: RouteTable;
38
+ export {};
@@ -0,0 +1,8 @@
1
+ var x=Object.defineProperty;var n=(t,e)=>x(t,"name",{value:e,configurable:!0});import{createHash as C}from"node:crypto";import{prepared as l}from"../../../core/sqlite-statements.js";import{withCanvasWrite as _}from"../../../core/canvas/db.js";import{canRead as y}from"../../../core/graph/access.js";import{bodyOf as H}from"../../../core/graph/bodies.js";import{ensureOwner as j}from"../../../core/graph/objects.js";import{readerFor as B}from"../../../core/graph/reader.js";import{checkoutsForCwd as F}from"../../../core/graph/repo-sync/repos.js";import{RunError as w}from"../../../core/runs/operations.js";const se=new Set(["memory.list","memory.get"]),W=1024*1024,O=/^[A-Za-z0-9_-]+(\/[A-Za-z0-9_-]+)*$/,R=["knowledge","preference"],a=n((t,e)=>new w(400,"invalid_request",t,e),"invalid"),S=n(()=>new w(404,"not_found","no memory document by that name"),"notFound");function v(t){const e=t.get("store");if(e===null)throw a("store is required","store");if(e!=="user")throw a('store must be "user"',"store")}n(v,"store");function Y(t){const e=t.get("kind");if(e===null)return null;if(!R.includes(e))throw a("kind must be knowledge or preference","kind");return e}n(Y,"kindOf");function J(t){const e=t.get("limit");if(e===null)return 50;if(!/^(0|[1-9]\d*)$/.test(e)||Number(e)<1||Number(e)>100)throw a("limit must be an integer from 1 to 100","limit");return Number(e)}n(J,"limitOf");function z(t,e){return C("sha256").update(JSON.stringify(["user",t,e])).digest("base64url").slice(0,16)}n(z,"filterHash");function U(t,e){return Buffer.from(JSON.stringify({n:t,f:e}),"utf8").toString("base64url")}n(U,"encodeCursor");function $(t,e){if(t===null)return null;try{if(!/^[A-Za-z0-9_-]+$/.test(t))throw new Error("not base64url");const r=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));if(typeof r.n=="string"&&O.test(r.n)&&r.f===e)return r.n}catch{}throw a("cursor is not the next_cursor of a previous page with the same store, path and kind","cursor")}n($,"decodeCursor");function b(t){return j(t,"person","local-user","user:local","user")}n(b,"personObject");function A(t,e){return B(t,e,r=>F(t,r))}n(A,"graphReader");function I(t,e){const r=l(t,`SELECT r.body_hash, r.created_at FROM revisions r WHERE r.document = ?
2
+ AND NOT EXISTS (SELECT 1 FROM revision_parents p WHERE p.parent = r.rowid) ORDER BY r.number DESC, r.rev_id LIMIT 1`).get(e.rowid),o=l(t,"SELECT created_at, author FROM revisions WHERE document = ? ORDER BY number, created_at LIMIT 1").get(e.rowid);if(!r||!o)throw S();return{head:r,first:o}}n(I,"revisions");function L(t,e){const{head:r,first:o}=I(t,e),i=e.name.lastIndexOf("/");return{name:e.name,folder:i<0?"":e.name.slice(0,i),kind:e.kind,preview:e.preview,summary:e.summary,privacy:e.privacy,revision:e.revision,created_at:o.created_at,updated_at:r.created_at}}n(L,"item");function G(t,e){return e===null?null:l(t,`SELECT i.external_id FROM objects a
3
+ JOIN identities i ON i.object = CASE WHEN a.type = 'node' THEN a.owner ELSE a.rowid END AND i.scheme = 'app'
4
+ WHERE a.rowid = ?`).get(e)?.external_id??null}n(G,"granteeOf");function Z(t,e){if(t.length<=e)return t;let r=e;for(;r>0&&(t[r]&192)===128;)r--;return t.subarray(0,r)}n(Z,"utf8Prefix");const D=200;function P(t,e){v(e);const r=e.get("path");if(r!==null&&!O.test(r))throw a("path must be name segments of letters, digits, `_` or `-` joined by `/`","path");const o=Y(e),i=J(e),f=z(r,o);let s=$(e.get("cursor"),f);return _(u=>{const h=A(u,t),m=b(u),c=r===null?null:`${r}/`,g=o===null?R:[o],T=l(u,`SELECT o.*, d.summary, d.revision, d.source_path FROM objects o JOIN documents d ON d.object = o.rowid
5
+ WHERE o.owner = ? AND o.type = 'document' AND o.deleted_at IS NULL AND d.unlisted = 0
6
+ AND o.kind IN (?, ?) AND (? IS NULL OR substr(o.name, 1, length(?)) = ?) AND (? IS NULL OR o.name > ?)
7
+ ORDER BY o.name LIMIT ?`),d=[];for(;;){const p=T.all(m.rowid,g[0],g[g.length-1],c,c,c,s,s,D);for(const N of p)if(s=N.name,y(u,h,N)&&d.push(N),d.length>i)break;if(d.length>i||p.length<D)break}const E=d.slice(0,i),M=d.length>i;return{items:E.map(p=>L(u,p)),next_cursor:M?U(E[E.length-1].name,f):null}})}n(P,"memoryList");function X(t,e){v(e);const r=e.get("name");if(r===null)throw a("name is required","name");if(!O.test(r))throw a("name must be segments of letters, digits, `_` or `-` joined by `/`","name");return _(o=>{const i=A(o,t),f=b(o),s=l(o,`SELECT o.*, d.summary, d.revision, d.source_path FROM objects o JOIN documents d ON d.object = o.rowid
8
+ WHERE o.owner = ? AND o.type = 'document' AND o.name = ? AND o.deleted_at IS NULL AND o.kind IN ('knowledge', 'preference')`).get(f.rowid,r);if(!s||!y(o,i,s))throw S();const{head:u,first:h}=I(o,s),m=Buffer.from(H(u.body_hash,s.source_path),"utf8"),c=Z(m,W);return{...L(o,s),body:c.toString("utf8"),size:m.length,truncated:c.length<m.length,grantee:G(o,h.author)}})}n(X,"memoryGet");function k(t,e,r){if(t==="memory.list")return{status:200,body:P(e,r)};if(t==="memory.get")return{status:200,body:X(e,r)};throw new w(404,"not_found","unknown operation")}n(k,"handleMemoryOperation");const ae=[{method:"GET",pattern:"/v1/memory",handler:n(t=>k("memory.list",t.principal,t.query),"handler")},{method:"GET",pattern:"/v1/memory/document",handler:n(t=>k("memory.get",t.principal,t.query),"handler")}];export{W as MEMORY_BODY_MAX_BYTES,se as MEMORY_OPERATIONS,k as handleMemoryOperation,X as memoryGet,P as memoryList,ae as memoryRoutes,Z as utf8Prefix};
@@ -0,0 +1,4 @@
1
+ import { type HandlerResult, type RequestContext, type RouteTable } from '../router.js';
2
+ export declare function handleMessage(ctx: RequestContext): Promise<HandlerResult>;
3
+ export declare const brokerMailRoutes: RouteTable;
4
+ export declare const messageRoutes: RouteTable;
@@ -0,0 +1,2 @@
1
+ var X=Object.defineProperty;var c=(t,e)=>X(t,"name",{value:e,configurable:!0});import{randomBytes as Y}from"node:crypto";import{claimNodeMail as Z,acknowledgeNodeMail as ee}from"../../../core/canvas/deliveries.js";import{nodeMailEntry as te}from"../../../core/feed/inbox.js";import{enqueueNodeMail as M,cancelPendingNodeMail as re}from"../../../core/feed/messages.js";import{reviveNode as B}from"../../../core/runtime/revive.js";import{BrokerUnreachableError as T}from"../../../core/runtime/broker-request.js";import{isBrokerLive as A}from"../../../core/runtime/model-swap.js";import{deliverLive as ne,interruptLive as oe}from"../../../core/runtime/interactive-deliver.js";import{isProfilePaused as ie}from"../../../core/profiles/manifest.js";import{getNode as $,withFreshTerminalGuard as ae}from"../../../core/canvas/canvas.js";import{getById as se,nodeObject as z,ownerForGrantee as de}from"../../../core/graph/objects.js";import{recordActedOn as ce}from"../../../core/graph/edges.js";import{recordWatch as ue}from"../../../core/graph/watches.js";import{publish as W}from"../../../core/graph/events.js";import{readerFor as le}from"../reader.js";import{withCanvasWrite as J}from"../../../core/canvas/db.js";import{getPendingStructuredRequestForNode as L}from"../../../core/canvas/structured-requests.js";import{cancelCronsOnWake as G}from"../../../core/canvas/crons.js";import{assertNotFinalized as C,assertFinalizedForReopen as fe,commitReopenResident as j}from"../../../core/runtime/reopen.js";import{admitLegacyStructuredOutput as me}from"../../structured-requests/sidecar.js";import{appendSituationalContext as F,formatSituationalProse as pe}from"../../../core/runtime/situational-context.js";import{formatDataCard as D}from"../../../shared/generated-context.js";import{hasNoNaturalCycle as ye}from"../../../core/runtime/revive-all.js";import{recordPendingParkActivity as he}from"../../park-pending.js";import{wantsExecution as ge}from"../../reconcilers/node-lifecycle/wants-execution.js";import{hasFreshGroundState as ve}from"../../../core/runtime/revive.js";import{CrtrError as be,notFound as q,usage as d}from"../../../core/errors.js";import{emitEvent as we}from"../../../core/events/emit.js";import{assertScope as _e}from"../../../core/scopes.js";import{InputError as O}from"../../../core/io.js";import{ApiError as ke}from"../../../api/index.js";import{ownerOnly as xe}from"../router.js";const Se=["critical","urgent","normal","deferred"];function U(t,e){if(typeof t!="object"||t===null||Array.isArray(t))throw d(`${e} must be an object { kind, facts?, body? }`);const i=t,r=i.kind;if(typeof r!="string"||r.trim()==="")throw d(`${e}.kind is required`);if(!r.includes(":"))throw d(`${e}.kind must be namespaced (contain ':'): ${r}`);const s={kind:r},n=i.facts;if(n!==void 0){if(typeof n!="object"||n===null||Array.isArray(n))throw d(`${e}.facts must be an object of string or number values`);const m={};for(const[l,f]of Object.entries(n)){if(typeof f!="string"&&typeof f!="number")throw d(`${e}.facts.${l} must be a string or number`);m[l]=f}s.facts=m}const o=i.body;if(o!==void 0){if(typeof o!="string")throw d(`${e}.body must be a string`);s.body=o}return s}c(U,"parseCardRequest");function H(t,e){try{return D(t.kind,t.facts??{},t.body??"")}catch(i){throw d(`${e}: ${i instanceof Error?i.message:String(i)}`)}}c(H,"renderCard");function $e(t){if(typeof t!="object"||t===null)throw d("a message requires a JSON body { body, tier?, fresh? }");const e=t,i=e.body,r=e.fresh===!0,s=e.tier,n=e.situational_context,o=e.output_schema,m=typeof i=="string"&&i.trim()!=="",l=typeof n=="string"&&n.trim()!=="",f=typeof o=="string"&&o.trim()!=="",w=e.situational_card,h=e.context_cards,v=w===void 0?void 0:U(w,"situational_card");if(h!==void 0&&!Array.isArray(h))throw d("context_cards must be an array of { kind, facts?, body? }");const p=h?.map((R,y)=>U(R,`context_cards[${y}]`));if(v!==void 0&&typeof n=="string"&&n!=="")throw d("situational_card and situational_context are mutually exclusive");const _=v!==void 0||p!==void 0&&p.length>0;if(!r&&!m&&!l&&!f&&!_)throw d("a message requires a non-empty body (or fresh: true, situational_context, a runtime card, or output_schema)");if(r&&p!==void 0&&p.length>0)throw d("context_cards cannot ride a fresh revive (no inbox entry carries them)");if(s!==void 0&&!Se.includes(s))throw d(`invalid tier: ${String(s)} (expected critical|urgent|normal|deferred)`);const u={body:typeof i=="string"?i:""};s!==void 0&&(u.tier=s),r&&(u.fresh=!0),e.reopen===!0&&(u.reopen=!0),typeof n=="string"&&(u.situational_context=n),v!==void 0&&(u.situational_card=v),p!==void 0&&(u.context_cards=p),typeof o=="string"&&(u.output_schema=o),typeof e.from=="string"&&(u.from=e.from);const b=e.delivery;if(b!==void 0&&b!=="interactive")throw d(`invalid delivery: ${String(b)} (expected interactive)`);if(b==="interactive"){if(r||u.situational_context!==void 0||u.output_schema!==void 0)throw d("interactive delivery supports a body, runtime cards, and reopen only (no fresh, situational_context, or output_schema)");if(!m)throw d("interactive delivery requires a non-empty body");if(u.tier==="deferred")throw d("interactive delivery cannot be deferred");u.delivery="interactive"}return u}c($e,"parseSendBody");function qe(t){try{return JSON.parse(t)}catch{throw d("output_schema must be a JSON schema string")}}c(qe,"parseSchema");function Ne(t){return t.split(`
2
+ `)[0].slice(0,120)}c(Ne,"label");function K(t,e){return e===null?"":D("reopen-final-report",{report:`${t}/${e}`},"This node previously completed work. Read this final report before acting on the new instruction.")}c(K,"previousFinalReportCard");function Ae(t,e,i){if(i!==null&&i!=="human"&&se(t,i)?.type==="node"){const n=z(t,i);return{actor:n,senderNode:n}}if(i==="human")return{actor:de(t,"user:local"),senderNode:null};const r=le(t,e);return{actor:r.class==="person"?r.person:r.class==="app"?r.app:r.node,senderNode:r.class==="node"?r.node:null}}c(Ae,"messageActor");function Q(t,e,i,r,s,n){const o=z(t,i),{actor:m,senderNode:l}=Ae(t,e,r),f=s===null?{}:{pointer:s};ce(t,m,o),l!==null&&l.rowid!==o.rowid&&ue(t,l,o,"message",{endsOn:n&&s!==null?`result:${s}`:"final"}),W(t,{event:"messaged",object:o,actor:m,attrs:{},...f}),l!==null&&W(t,{event:"sent",object:l,actor:l,attrs:{to:o.id},...f})}c(Q,"recordMessage");function Ce(t,e){return new O({error:"deferred_no_natural_cycle",message:`${t} is ${e} with no natural next cycle ahead of it \u2014 a deferred message would never be delivered.`,next:"Use --tier normal, urgent, or critical to wake it now, or --reopen (with a body or --fresh) to re-task it first."})}c(Ce,"deferredNoNaturalCycle");function je(t){if(!ve(t))throw new ke(422,"unprocessable",`node ${t} has no goal/roadmap on disk \u2014 a fresh revive would resume amnesiac.`)}c(je,"assertRecoverableForFresh");function Fe(t,e){return t instanceof O?{error:t.payload.error,message:t.payload.message,next:t.payload.next,message_id:e}:t instanceof be?{error:t.code,message:t.message,message_id:e}:{error:"wake_failed",message:"the target could not be woken; see the daemon log",message_id:e}}c(Fe,"wakeFailure");async function Oe(t){const e=t.params.id,i=$(e);if(i===null)throw q(`unknown node: ${e}`,{received:e});const r=$e(t.body),s=r.tier??"normal",n=ie(i.profile_id),o=r.from??null;if(o!==null){const a=$(o);a!==null&&_e(a,"crtr:act")}const m=r.body.trim()!=="",l=r.situational_card!==void 0?H(r.situational_card,"situational_card"):r.situational_context!==void 0?pe(r.situational_context.trim()):"",f=l!=="",w=(r.context_cards??[]).map((a,g)=>H(a,`context_cards[${g}]`)),h=r.output_schema!==void 0&&r.output_schema.trim()!==""?qe(r.output_schema):null;let v=!1;const p=c(a=>{if(!(h===null||v)){if(L(e)!==null)throw new O({error:"structured_request_conflict",message:`node ${e} already has a pending structured request`,next:"Wait for the current request to settle before requesting another structured result."});me(e,"oneoff",h,a),v=!0}},"ensureSchema");if(r.fresh){const a=r.reopen?fe(e):null;r.reopen||C(e),je(e),p(),f&&F(e,l),r.reopen&&j(e,a);const g=await B(e,{resume:!1,capacity:"refuse"});return{status:201,body:{node_id:e,delivered:!1,revived:g.launch!==void 0}}}r.delivery==="interactive"&&!r.reopen&&C(e);let _=!1,u="";if(r.delivery==="interactive"&&r.reopen&&(u=K(e,j(e)),_=!0),r.delivery==="interactive"&&p(),r.delivery==="interactive"&&!n&&!i.run_id&&A(i))try{return f&&F(e,l),await ne(e,r.body,{cards:[...u===""?[]:[u],...f?[l]:[],...w],origin:o==="human"?{type:"human"}:{type:"runtime",kind:"inbox",entries:[{...o===null?{}:{from:o},kind:"message",tier:s}]}}),J(g=>Q(g,t,e,o,null,!1)),G(e),{status:201,body:{node_id:e,delivered:!0,revived:!1,delivered_via:"engine"}}}catch(a){if(!(a instanceof T))throw a}const b=c(()=>{r.reopen||C(e);const a=Y(16).toString("hex"),g=c(S=>Q(S,t,e,o,a,h!==null),"withinEnqueue");p(a),f&&F(e,l),r.reopen&&!_&&(u=K(e,j(e)));const N=[...u===""?[]:[u],...w],I=N.length>0?{cards:N}:{};if(m||h!==null){const S=m?r.body:`A one-off structured-output request has been granted. Submit a result matching the requested schema with the \`submit_result\` tool (\`request_id: "${L(e)?.request_id??"<request-id>"}"\`) before you stop; after it is accepted, continue normally.`;return M(e,{senderNodeId:o,urgency:s,wake:1,kind:"message",messageId:a,withinEnqueue:g,label:Ne(S),bodyJson:{body:S,...f?{situational:!0}:{},...I}})}return M(e,{senderNodeId:o,urgency:s,wake:1,kind:"message",messageId:a,withinEnqueue:g,label:f?"(ambient context updated)":"(context delivered)",bodyJson:{...f?{situational:!0}:{},situationalOnly:!0,...I}})},"deliverImmediate"),y=c(()=>{if(s==="deferred"){const a=ae(e,ye,b);if(a.kind==="missing")throw q(`unknown node: ${e}`,{received:e});if(a.kind==="terminal")throw Ce(e,a.status);return a.result}return b()},"deliver")();y.urgency!=="deferred"&&J(()=>he(e));const k=$(e);if(k===null)throw q(`unknown node: ${e}`,{received:e});i.frozen_at!==null&&G(e);let P=!1,E=!1,x;if((r.reopen||k.lifecycle==="terminal"||!ge(k))&&y.urgency!=="deferred"&&!n&&!A(k))try{const a=await B(e,{resume:!0,capacity:"freeze"});P=a.launch!==void 0,E=a.outcome==="frozen"}catch(a){x=Fe(a,y.messageId),we({level:"error",event:"message.wake_failed",node_id:e,error:a,fields:{message_id:y.messageId,error_code:x.error}})}return{status:201,body:{node_id:e,delivered:!0,revived:P,...E?{not_revived_reason:"capacity_frozen"}:{},...x===void 0?{}:{wake_failed:x},delivered_at:y.createdAt,...y.urgency===s?{}:{delivered_tier:y.urgency},...r.delivery==="interactive"?{delivered_via:"inbox"}:{}}}}c(Oe,"handleMessage");async function Re(t){const e=t.params.id,i=$(e);if(i===null)throw q(`unknown node: ${e}`,{received:e});const r=re(e,{senderNodeId:"human",kind:"message"});let s=!1;if(A(i))try{s=await oe(e)!=="idle"}catch(o){if(!(o instanceof T))throw o}return{status:200,body:{node_id:e,outcome:s?"aborted_turn":r.length>0?"canceled_pending":"idle",aborted_turn:s,canceled_pending:r.length}}}c(Re,"handleInterrupt");function V(t){if(typeof t.body!="object"||t.body===null||Array.isArray(t.body))throw d("mail requires an object body");const e=t.body;if(typeof e.execution_id!="string"||e.execution_id.trim()==="")throw d("execution_id is required");return e}c(V,"mailBody");function Pe(t){const e=V(t),i=e.channel;if(i!=="wake"&&i!=="passive"&&i!=="deferred_run")throw d("channel must be wake, passive, or deferred_run");const r=Z(t.params.id,e.execution_id,i);return{status:200,body:{action:r.action,deliveries:r.deliveries.map(n=>({delivery_id:n.deliveryId,attempts:n.attempts,handoff:n.handoff,entry:{...te(n),seq:n.message.seq}}))}}}c(Pe,"handleMailClaim");function Ee(t){const e=V(t);if(!Array.isArray(e.deliveries))throw d("deliveries must be an array");const i=e.deliveries.map(n=>{if(typeof n!="object"||n===null||Array.isArray(n))throw d("each delivery must be an object");const o=n;if(typeof o.delivery_id!="string"||o.delivery_id==="")throw d("delivery_id is required");if(!Number.isSafeInteger(o.attempts)||o.attempts<1)throw d("attempts must be a positive integer");if(o.disposition!=="acknowledged"&&o.disposition!=="released")throw d("disposition must be acknowledged or released");return{delivery_id:o.delivery_id,attempts:o.attempts,disposition:o.disposition}}),r=ee(t.params.id,e.execution_id,i.map(n=>({deliveryId:n.delivery_id,attempts:n.attempts,disposition:n.disposition})));return{status:200,body:{action:r.action,results:r.results.map(n=>({delivery_id:n.deliveryId,outcome:n.outcome}))}}}c(Ee,"handleMailAcknowledge");const gt=xe([{method:"POST",pattern:"/v1/nodes/:id/mail/claim",handler:Pe},{method:"POST",pattern:"/v1/nodes/:id/mail/acknowledge",handler:Ee}]),vt=[{method:"POST",pattern:"/v1/nodes/:id/messages",scope:"crtr:act",handler:Oe},{method:"POST",pattern:"/v1/nodes/:id/interrupt",scope:"crtr:act",handler:Re}];export{gt as brokerMailRoutes,Oe as handleMessage,vt as messageRoutes};
@@ -0,0 +1,2 @@
1
+ import { type RouteTable } from '../router.js';
2
+ export declare const modelConfigRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var f=Object.defineProperty;var i=(e,o)=>f(e,"name",{value:o,configurable:!0});import{ApiError as t}from"../../../api/errors.js";import{validateCoreModelConfig as a,replaceCoreModelConfig as c}from"../../../core/model-config.js";import{parseModelSpec as d}from"../../../core/model-routes.js";import{openModelRegistry as l}from"../../../core/runtime/model-registry.js";import{ownerOnly as m}from"../router.js";function g(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new t(400,"invalid_request","model config must be an object");const o=e;if(typeof o.config_version!="string"||o.config_version.trim()==="")throw new t(400,"invalid_request","config_version must be a non-empty string");try{return{configVersion:o.config_version,config:a(o)}}catch(r){throw new t(400,"invalid_request",r instanceof Error?r.message:String(r))}}i(g,"parseRequest");async function u(e){const o=await l();for(const r of Object.values(e.modelRoutes))for(const n of Object.values(r.models)){const s=d(n);if(s===void 0||o.find(s.providerId,s.modelId)===void 0)throw new t(422,"unprocessable",`route ref ${n} is absent from the baked model registry`)}}i(u,"validateCatalog");async function p(e){const{configVersion:o,config:r}=g(e.body);await u(r);try{c(r)}catch(n){throw new t(500,"model_config_write_failed",n instanceof Error?n.message:String(n))}return{status:200,body:{config_version:o,delivered:!0}}}i(p,"handlePut");const C=m([{method:"PUT",pattern:"/v1/model-config",handler:p}]);export{C as modelConfigRoutes};
@@ -0,0 +1,5 @@
1
+ import type { ModelAuthProviderStatusDTO } from '../../../api/index.js';
2
+ import { type ManagedProviderId } from '../../../core/subscription-state.js';
3
+ import type { RouteTable } from '../router.js';
4
+ export declare function managedStatus(provider: ManagedProviderId): ModelAuthProviderStatusDTO;
5
+ export declare const modelAuthRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var E=Object.defineProperty;var a=(n,e)=>E(n,"name",{value:e,configurable:!0});import{join as M}from"node:path";import{deleteAuthCredential as A,readAuthCredentials as P,setAuthCredential as q}from"../../../core/auth-file.js";import{PoolCredentialStore as j}from"../../../core/pool-credential-store.js";import{secretsDir as T}from"../../../core/layout.js";import{ApiError as l}from"../../../api/index.js";import{RunError as O}from"../../../core/runs/operations.js";import{usage as h}from"../../../core/errors.js";import{resolveLaunchTarget as C}from"../../../core/runtime/launch-target.js";import{MANAGED_PROVIDER_IDS as $,OPENAI_CHATGPT_PROVIDER_ID as R,commitManagedLogin as L,coolingUntilFor as S,isManagedProvider as p,readSubscriptionPool as y,removeAllManagedAccounts as x}from"../../../core/subscription-state.js";import{cancelModelAuthFlow as G,completeModelAuthFlow as N,startModelAuthFlow as U,waitModelAuthFlow as V}from"../../../core/model-auth/flows.js";import{waitSeconds as K}from"../long-poll-wait.js";function c(){return M(T(),"auth.json")}a(c,"authPath");function D(n,e){if(typeof e!="string"||e==="")throw new l(400,"invalid_request",`oauth credential requires \`${n}\``);const t=Date.parse(e);if(Number.isNaN(t))throw new l(400,"invalid_request",`\`${n}\` is not a valid ISO timestamp`);return t}a(D,"parseExpiry");function w(n,e,t){if(typeof t!="string"||t==="")throw new l(400,"invalid_request",`${n} credential requires \`${e}\``);return t}a(w,"requireField");function B(n,e=Date.now()){const t=Object.entries(n.modelCooldowns??{}).filter(([,o])=>o>e).map(([o,r])=>({family:o,rate_limited_until:new Date(r).toISOString()}));return{label:n.label,expires_at:new Date(n.expires).toISOString(),rate_limited_until:new Date(n.rateLimitedUntil).toISOString(),...t.length?{model_cooldowns:t}:{},...n.authFailure?{auth_failure:n.authFailure}:{},...n.accountId?{account_id:n.accountId}:{}}}a(B,"toManagedAccountStatus");function H(n){const e=y(n).map(t=>B(t));return{provider:n,managed:!0,configured:e.length>0,accounts:e}}a(H,"managedStatus");function _(n,e){const t=n.query.getAll(e);if(t.length>1)throw h(`${e} must appear at most once`);return t[0]}a(_,"singleQueryValue");function J(n){const e=n.indexOf("/"),t=e>0?n.slice(0,e):"";if(t==="")throw new l(422,"unresolved_model","the selected launch has no concrete model provider");return t}a(J,"providerFromModel");async function Q(){const n=await P(c()),e=a(o=>o===R&&n[o]!==void 0&&y(o).length===0,"legacyApiKey"),t=$.filter(o=>!e(o)).map(H);for(const[o,r]of Object.entries(n))p(o)&&!e(o)||r.type!=="api_key"&&r.type!=="oauth"||t.push({provider:o,managed:!1,configured:!0,kind:r.type});return{status:200,body:{providers:t}}}a(Q,"handleList");async function z(n){for(const[s]of n.query)if(s!=="profile"&&s!=="cwd"&&s!=="kind"&&s!=="model")throw h(`unknown model-auth readiness query parameter: ${s}`);const e=_(n,"profile"),t=_(n,"cwd"),o=_(n,"kind"),r=_(n,"model");if(o!==void 0&&o.trim()==="")throw h("kind must be a non-empty string when provided");if(r!==void 0&&r.trim()==="")throw h("model must be a non-empty string when provided");const d=await C({root:!0,...e!==void 0?{profile:e}:{},...t!==void 0?{cwd:t}:{},...o!==void 0?{kind:o}:{},...r!==void 0?{model:r}:{}},{readOnlyProfileSelection:!0});if(d.launch.model===void 0)throw new l(422,"unresolved_model","the selected launch has no concrete model");const i=J(d.launch.model);if(p(i)){const s=y(i);if(s.length>0){const m=s.filter(f=>f.authFailure===void 0);if(m.length===0)return{status:200,body:{provider:i,model:d.launch.model,credential:"unusable",reason:"invalid_grant"}};const g=Date.now(),v=d.launch.model,I=m.some(f=>S(f,v)<=g),k=Math.min(...m.map(f=>S(f,v)));return{status:200,body:{provider:i,model:d.launch.model,credential:"ready",...!I&&k>g?{rate_limited_until:new Date(k).toISOString()}:{}}}}}const u=await new j(c()).read(i),b=u?.type==="oauth"||u?.type==="api_key"&&!!u.key;return{status:200,body:{provider:i,model:d.launch.model,credential:b?"ready":"missing"}}}a(z,"handleReadiness");async function W(n){const e=n.params.provider,t=n.body;if(t===void 0||typeof t!="object"||typeof t.kind!="string")throw new l(400,"invalid_request","a credential `kind` is required");switch(t.kind){case"api_key":{const o=w("api_key","api_key",t.api_key);return await q(e,{type:"api_key",key:o},c()),{status:200,body:{provider:e,installed:!0,managed:!1}}}case"oauth":{if(p(e))throw new l(422,"unprocessable",`provider ${e} stores oauth credentials as managed accounts \u2014 use kind \`managed_account\``);const o=w("oauth","access_token",t.access_token),r=w("oauth","refresh_token",t.refresh_token),d=D("expires_at",t.expires_at),i=t.extra??{};await q(e,{type:"oauth",...i,access:o,refresh:r,expires:d},c());const u={provider:e,installed:!0,managed:!1};return typeof t.account_id=="string"&&t.account_id!==""&&(u.account_id=t.account_id),{status:200,body:u}}case"managed_account":{if(!p(e))throw new l(422,"unprocessable",`provider ${e} does not support managed accounts`);const o=typeof t.label=="string"&&t.label.trim()?t.label.trim():void 0;if(!o&&t.auto_label!==!0)throw new l(400,"invalid_request","managed_account credential requires `label` or `auto_label`");const r=typeof t.account_id=="string"&&t.account_id!==""?t.account_id:void 0,d=w("managed_account","access_token",t.access_token),i=w("managed_account","refresh_token",t.refresh_token),u=D("expires_at",t.expires_at),b=typeof t.last_rate_limited_at=="number"?t.last_rate_limited_at:Math.max(0,...y(e).map(m=>m.lastRateLimitedAt));await L(e,o,{refresh:i,access:d,expires:u,...r?{accountId:r}:{},lastRateLimitedAt:b,autoLabel:t.auto_label===!0});const s={provider:e,installed:!0,managed:!0};return r&&(s.account_id=r),{status:200,body:s}}default:throw new l(400,"invalid_request",`unknown credential kind: ${String(t.kind)}`)}}a(W,"handleInstall");async function X(n){const e=n.params.provider;if(p(e)){const o=await x(e),r=await A(e,c());return{status:200,body:{provider:e,removed_accounts:o+(r?1:0)}}}const t=await A(e,c())?1:0;return{status:200,body:{provider:e,removed_accounts:t}}}a(X,"handleDelete");function F(n){const e=n.body;if(e===void 0)return{};if(typeof e!="object"||e===null||Array.isArray(e))throw new l(400,"invalid_request","request body must be a JSON object");return e}a(F,"bodyObject");async function Y(n){const e=F(n);return{status:200,body:await U({provider:e.provider,...e.redirect!==void 0?{redirect:e.redirect}:{},...e.label!==void 0?{label:e.label}:{}})}}a(Y,"handleFlowStart");async function Z(n){const e=F(n);return{status:200,body:await N(n.params.flow_id,e.input)}}a(Z,"handleFlowComplete");async function ee(n){const e=G(n.params.flow_id);if(!e)throw new O(400,"invalid_request","no sign-in has this flow_id","flow_id");const{jti:t,...o}=e;return{status:200,body:o}}a(ee,"handleFlowCancel");async function te(n){for(const[i]of n.query)if(i!=="wait")throw h(`unknown model-auth flow query parameter: ${i}`);_(n,"wait");const e=K("model_auth.get",n.query),t=new AbortController;n.res.once("close",()=>t.abort());const o=await V(n.params.flow_id,e*1e3,t.signal);if(!o)throw new O(404,"not_found","no sign-in has this flow_id","flow_id");const{jti:r,...d}=o;return{status:200,body:d}}a(te,"handleFlowGet");const he=[{method:"POST",pattern:"/v1/model-auth/flows",ownerOnly:!0,handler:Y},{method:"POST",pattern:"/v1/model-auth/flows/:flow_id/complete",ownerOnly:!0,handler:Z},{method:"POST",pattern:"/v1/model-auth/flows/:flow_id/cancel",ownerOnly:!0,handler:ee},{method:"GET",pattern:"/v1/model-auth/flows/:flow_id",ownerOnly:!0,handler:te},{method:"GET",pattern:"/v1/model-auth",handler:Q},{method:"GET",pattern:"/v1/model-auth/readiness",handler:z},{method:"PUT",pattern:"/v1/model-auth/:provider",ownerOnly:!0,handler:W},{method:"DELETE",pattern:"/v1/model-auth/:provider",ownerOnly:!0,handler:X}];export{H as managedStatus,he as modelAuthRoutes};
@@ -0,0 +1,44 @@
1
+ import type { NodeEventDTO, NodeEventErrorDTO, ReportDTO } from '../../../api/index.js';
2
+ import type { BrokerToClient } from '../../../core/runtime/broker-protocol.js';
3
+ import type { RouteTable } from '../router.js';
4
+ type StreamEvent = Exclude<NodeEventDTO, NodeEventErrorDTO>;
5
+ type WithoutSequence<T> = T extends unknown ? Omit<T, 'sequence_number'> : never;
6
+ type StreamEventPayload = WithoutSequence<StreamEvent>;
7
+ type Subscriber = (event: NodeEventDTO) => void;
8
+ /** The bounded per-node resume buffer. Event sequence numbers belong here rather
9
+ * than to HTTP connections, so every subscriber observes the same cursor. */
10
+ export declare class NodeEventRing {
11
+ private events;
12
+ private bytes;
13
+ private nextSequence;
14
+ private earliestAvailable;
15
+ append(event: StreamEventPayload): StreamEvent;
16
+ replay(after: number | undefined): {
17
+ gap: NodeEventErrorDTO | null;
18
+ events: readonly StreamEvent[];
19
+ };
20
+ get empty(): boolean;
21
+ }
22
+ /** Per-node state retained while broker frames become public stream events. */
23
+ export declare class NodeEventTranslationState {
24
+ readonly toolSummaries: Map<string, string>;
25
+ private emittedAssistantText;
26
+ resetAssistantText(): void;
27
+ emitAssistantTextDelta(message: unknown): string;
28
+ seedAssistantText(message: unknown): string;
29
+ }
30
+ /** Translate only the application-safe subset of broker frames. Tool argument
31
+ * summaries and emitted assistant text stay per node hub; raw arguments and
32
+ * tool output never cross this boundary. */
33
+ export declare function translateBrokerFrame(nodeId: string, frame: BrokerToClient, state?: NodeEventTranslationState): StreamEventPayload[];
34
+ declare class NodeEventStreams {
35
+ private readonly hubs;
36
+ subscribe(nodeId: string, after: number | undefined, subscriber: Subscriber): {
37
+ unsubscribe: () => void;
38
+ terminal: boolean;
39
+ };
40
+ report(nodeId: string, report: ReportDTO): void;
41
+ }
42
+ export declare const nodeEventStreams: NodeEventStreams;
43
+ export declare const nodeEventRoutes: RouteTable;
44
+ export {};
@@ -0,0 +1,6 @@
1
+ var O=Object.defineProperty;var o=(n,e)=>O(n,"name",{value:e,configurable:!0});import{randomUUID as q}from"node:crypto";import{ApiError as E}from"../../../api/errors.js";import{BrokerClient as C}from"../../../core/broker-client/client.js";import{getNode as b}from"../../../core/canvas/canvas.js";import{isPidAlive as B}from"../../../core/canvas/pid.js";import{BROKER_VIEW_SOCKET_WAIT_MS as k}from"../../../core/runtime/view-socket.js";import{toNodeOutcomeDTO as M}from"../map.js";import{reportsForNode as L}from"./reports.js";const D=15e3,$=6e4,x=250,P=512,T=256*1024,j=1e3,G=32*1024*1024;class V{static{o(this,"NodeEventRing")}events=[];bytes=0;nextSequence=1;earliestAvailable=1;append(e){const t={...e,sequence_number:this.nextSequence++},s=Buffer.byteLength(JSON.stringify(t),"utf8");if(s>T)return this.events=[],this.bytes=0,this.earliestAvailable=this.nextSequence,t;for(this.events.push(t),this.bytes+=s;this.events.length>P||this.bytes>T;){const r=this.events.shift();if(r===void 0)break;this.bytes-=Buffer.byteLength(JSON.stringify(r),"utf8"),this.earliestAvailable=r.sequence_number+1}return t}replay(e){if(e===void 0)return{gap:null,events:this.events};const t=e<this.earliestAvailable-1||e>=this.nextSequence?A(this.earliestAvailable):null;return{gap:t,events:t===null?this.events.filter(s=>s.sequence_number>e):this.events}}get empty(){return this.events.length===0}}function A(n){return{type:"error",error:{code:"stream_gap",message:"the requested event cursor is older than this daemon can resume",details:{earliest_sequence:n}}}}o(A,"streamGap");function H(n){return n===null?"arguments: null":Array.isArray(n)?`arguments: array (${n.length} items)`:typeof n=="object"?`arguments: object (${Object.keys(n).length} fields)`:`arguments: ${typeof n}`}o(H,"toolSummary");function m(n){if(typeof n!="object"||n===null)return"";const e=n.content;return typeof e=="string"?e:Array.isArray(e)?e.filter(t=>typeof t=="object"&&t!==null).filter(t=>t.type==="text"&&typeof t.text=="string").map(t=>t.text).join(""):""}o(m,"assistantText");class w{static{o(this,"NodeEventTranslationState")}toolSummaries=new Map;emittedAssistantText="";resetAssistantText(){this.emittedAssistantText=""}emitAssistantTextDelta(e){const t=m(e),s=t.startsWith(this.emittedAssistantText)?t.slice(this.emittedAssistantText.length):t;return this.emittedAssistantText=t,s}seedAssistantText(e){const t=m(e);return this.emittedAssistantText=t,t}}function z(n,e,t=new w){switch(e.type){case"message_start":return e.message.role==="assistant"&&t.resetAssistantText(),[];case"message_update":{if(e.message.role!=="assistant")return[];const s=t.emitAssistantTextDelta(e.message);return s===""?[]:[{type:"node.output_text.delta",node_id:n,delta:s}]}case"message_end":{if(e.message.role!=="assistant")return[];const s=m(e.message);return t.resetAssistantText(),[{type:"node.output_text.done",node_id:n,text:s}]}case"tool_execution_start":{const s=H(e.args);return t.toolSummaries.set(e.toolCallId,s),[{type:"node.tool_call.started",node_id:n,tool_call_id:e.toolCallId,tool:e.toolName,summary:s}]}case"tool_execution_end":{const s=t.toolSummaries.get(e.toolCallId)??"[arguments unavailable]";return t.toolSummaries.delete(e.toolCallId),[{type:"node.tool_call.completed",node_id:n,tool_call_id:e.toolCallId,tool:e.toolName,status:e.isError?"error":"ok",summary:s}]}case"turn_start":return[{type:"node.turn.started",node_id:n}];case"turn_end":return[{type:"node.turn.completed",node_id:n}];default:return[]}}o(z,"translateBrokerFrame");class J{static{o(this,"NodeEventHub")}nodeId;remove;ring=new V;subscribers=new Set;observer;observerErrorAt;poll;reconnect;idleClose;status;settledRevision;settledOutcome;settledSequence;snapshotSeeded=!1;reportsSeeded=!1;translationState=new w;fresh=!0;constructor(e,t){this.nodeId=e,this.remove=t}subscribe(e,t){const s=this.fresh&&e!==void 0;this.fresh=!1,this.start();const r=this.settledOutcome!==void 0,d=s?{gap:A(1),events:this.ring.replay(void 0).events}:this.ring.replay(e);r||(this.subscribers.add(t),this.status!=="dormant"&&this.openObserver());let h=!1;return queueMicrotask(()=>{if(!h){d.gap!==null&&t(d.gap);for(const l of d.events)t(l)}}),r&&this.scheduleIdleClose(),{unsubscribe:o(()=>{h=!0,r||this.unsubscribe(t)},"unsubscribe"),terminal:r}}report(e){this.settledRevision===void 0&&this.publish({type:"node.report.pushed",node_id:this.nodeId,report:e})}start(){this.idleClose!==void 0&&(clearTimeout(this.idleClose),this.idleClose=void 0),this.poll===void 0&&(this.check(),this.settledRevision===void 0&&(this.seedReports(),this.poll=setInterval(()=>this.check(),x)))}seedReports(){if(!this.reportsSeeded){this.reportsSeeded=!0;for(const e of L(this.nodeId).reverse())this.report(e)}}check(){const e=b(this.nodeId);if(e===null){this.fail("stream_error",`node ${this.nodeId} no longer exists`);return}const t=M(e);if(t!==null){this.settledRevision!==t.revision&&(this.settledRevision=t.revision,this.settledOutcome=t,this.settledSequence=this.publish({type:"node.settled",node_id:this.nodeId,outcome:t}).sequence_number,this.stopObserver(),this.stopPoll());return}const s=e.pi_pid===null?"dormant":e.status;if(s==="dormant"){this.observerErrorAt=void 0,this.status!=="dormant"&&(this.status=s,this.publish({type:"node.status.changed",node_id:this.nodeId,status:s}));return}this.status===void 0?this.status=s:this.status!=="dormant"&&this.status!==s&&(this.status=s,this.publish({type:"node.status.changed",node_id:this.nodeId,status:s})),this.openObserver()}openObserver(){if(this.observer!==void 0||this.subscribers.size===0)return;const e=new C(this.nodeId);this.observer=e,e.on("connect",()=>{this.observerErrorAt=void 0;const t=b(this.nodeId);this.status==="dormant"&&t!==null&&t.pi_pid!==null&&(this.status=t.status,this.publish({type:"node.status.changed",node_id:this.nodeId,status:t.status})),e.send({type:"hello",role:"observer",client_id:q(),attends:!1})}),e.on("frame",t=>{try{t.type==="welcome"&&this.seedSnapshot(t.snapshot);for(const s of z(this.nodeId,t,this.translationState))this.publish(s)}catch(s){this.fail("stream_error",s instanceof Error?s.message:String(s))}}),e.on("error",()=>{const t=b(this.nodeId),s=Date.now();if(t!==null&&t.pi_pid!==null&&B(t.pi_pid)){if(this.observerErrorAt??=s,s-this.observerErrorAt<k)return;this.fail("stream_error","observer connection failed");return}this.observerErrorAt=void 0}),e.on("close",()=>{this.observer===e&&(this.observer=void 0,!(this.subscribers.size===0||this.settledRevision!==void 0)&&(this.status!=="dormant"&&(this.publish({type:"node.status.changed",node_id:this.nodeId,status:"dormant"}),this.status="dormant"),this.scheduleReconnect()))}),e.connect()}seedSnapshot(e){if(this.snapshotSeeded)return;this.snapshotSeeded=!0;const t=e.messages.filter(r=>r.role==="assistant"),s=e.state.isStreaming?t.pop():void 0;for(const r of t)this.publish({type:"node.output_text.done",node_id:this.nodeId,text:m(r)});s!==void 0&&this.publish({type:"node.output_text.delta",node_id:this.nodeId,delta:this.translationState.seedAssistantText(s)})}scheduleReconnect(){this.reconnect===void 0&&(this.reconnect=setTimeout(()=>{this.reconnect=void 0,this.check()},x))}publish(e){const t=this.ring.append(e);for(const s of[...this.subscribers])s(t);return t}fail(e,t){const s={type:"error",error:{code:e,message:t}};for(const r of[...this.subscribers])r(s);this.stopObserver(),this.stopPoll()}unsubscribe(e){this.subscribers.delete(e),this.subscribers.size===0&&this.scheduleIdleClose()}scheduleIdleClose(){this.idleClose===void 0&&(this.idleClose=setTimeout(()=>{this.stopObserver(),this.stopPoll(),this.remove()},$))}stopObserver(){this.reconnect!==void 0&&(clearTimeout(this.reconnect),this.reconnect=void 0);const e=this.observer;this.observer=void 0,e?.close()}stopPoll(){this.poll!==void 0&&(clearInterval(this.poll),this.poll=void 0)}}class W{static{o(this,"NodeEventStreams")}hubs=new Map;subscribe(e,t,s){let r=this.hubs.get(e);return r===void 0&&(r=new J(e,()=>this.hubs.delete(e)),this.hubs.set(e,r)),r.subscribe(t,s)}report(e,t){this.hubs.get(e)?.report(t)}}const F=new W;function K(n){const e=n.get("after");if(e===null||e==="")return{};if(!/^(?:0|[1-9]\d*)$/.test(e))throw new E(400,"invalid_request","`after` must be a non-negative integer");const t=Number(e);if(!Number.isSafeInteger(t))throw new E(400,"invalid_request","`after` must be a safe integer");return{after:t}}o(K,"parseQuery");function I(n){const{type:e,...t}=n;return`event: ${e}
2
+ data: ${JSON.stringify(t)}
3
+
4
+ `}o(I,"sseRecord");async function U(n){const e=n.params.id??"";if(b(e)===null)throw new E(404,"node_not_found",`no node ${e}`);const{after:t}=K(n.query),{req:s,res:r}=n;r.writeHead(200,{"content-type":"text/event-stream; charset=utf-8","cache-control":"no-cache",connection:"keep-alive"});let d=!1,h=!1,l=!1,c=0;const u=[];let v,f;const _=o(()=>{r.writableEnded||r.end()},"finish"),p=o(()=>{if(!d){if(d=!0,f!==void 0&&clearInterval(f),v?.(),r.destroyed){u.length=0,c=0,_();return}if(l||u.length>0){h=!0;return}_()}},"close"),g=o(()=>{for(l=!1;u.length>0;){const i=u.shift();if(c-=Buffer.byteLength(i,"utf8"),!r.write(i)){l=!0,r.once("drain",g);return}}h&&_()},"flush"),N=o(()=>{if(d)return;u.length=0,c=0;const i=I({type:"error",error:{code:"stream_dropped",message:"stream reader is too slow"}});u.push(i),c=Buffer.byteLength(i,"utf8"),d=!0,h=!0,f!==void 0&&clearInterval(f),v?.(),l||g()},"dropSlowReader"),y=o(i=>{if(d)return!1;if(l||u.length>0){const a=Buffer.byteLength(i,"utf8");return u.length>=j||c+a>G?(N(),!1):(u.push(i),c+=a,!0)}return r.write(i)||(l=!0,r.once("drain",g)),!0},"write"),S=o((i,a)=>{d||y(I({type:"error",error:{code:i,message:a}})),p()},"fail"),R=o(i=>{try{if(!y(I(i)))return;(i.type==="node.settled"||i.type==="error"&&i.error.code!=="stream_gap")&&p()}catch(a){S("stream_error",a instanceof Error?a.message:String(a))}},"onEvent");f=setInterval(()=>{try{d||y(`: keepalive
5
+
6
+ `)}catch(i){S("stream_error",i instanceof Error?i.message:String(i))}},D),s.once("close",p);try{const i=F.subscribe(e,t,R);v=i.unsubscribe,i.terminal&&queueMicrotask(p)}catch(i){S("stream_error",i instanceof Error?i.message:String(i))}return{status:200}}o(U,"handleEvents");const ie=[{method:"GET",pattern:"/v1/nodes/:id/events",handler:U}];export{V as NodeEventRing,w as NodeEventTranslationState,ie as nodeEventRoutes,F as nodeEventStreams,z as translateBrokerFrame};
@@ -0,0 +1,2 @@
1
+ import type { RouteTable } from '../router.js';
2
+ export declare const nodeOutcomeRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var w=Object.defineProperty;var r=(t,e)=>w(t,"name",{value:e,configurable:!0});import{setTimeout as h}from"node:timers/promises";import{ApiError as a}from"../../../api/errors.js";import{getNode as v}from"../../../core/canvas/canvas.js";import{openDb as A,withCanvasWrite as m}from"../../../core/canvas/db.js";import{enqueueLateOutcomeAction as O,readOutcomeAction as s,registerOutcomeAction as g,unregisterOutcomeAction as D}from"../../../core/canvas/outcome-actions.js";import{OUTCOME_PAYLOAD_MAX_BYTES as f}from"../../../core/canvas/types.js";import{composeNodeOutcomeDocument as N}from"../../../core/runtime/outcome-document.js";import{HUMAN_ACTION_NAME_PATTERN as k}from"../../../core/human/action-binding.js";import{resolveHumanAction as b}from"../../../core/human-actions.js";import{toNodeOutcomeDTO as p,toOutcomeDeliveryDTO as E}from"../map.js";import{waitSeconds as T}from"../long-poll-wait.js";const q=250;function l(t){const e=v(t);if(e===null)throw new a(404,"node_not_found",`no node ${t}`);return e}r(l,"requireNode");function $(t){const e=p(t);return{node_id:t.node_id,state:e===null?"pending":"settled",outcome:e,node_status:t.status,deadline_at:t.deadline_at??null}}r($,"responseFor");async function L(t){const e=t.params.id??"",o=Date.now()+T("node-outcomes.get.119",t.query)*1e3;let n=l(e);for(;p(n)===null&&Date.now()<o;)await h(Math.min(q,o-Date.now())),n=l(e);return{status:200,body:$(n)}}r(L,"handleGetOutcome");function j(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}r(j,"isPlainObject");function M(t){let e;try{e=JSON.stringify(t)}catch{throw new a(400,"invalid_request","`payload` must be JSON-serializable")}if(e===void 0)throw new a(400,"invalid_request","`payload` must be JSON-serializable");return Buffer.byteLength(e,"utf8")}r(M,"payloadBytes");function P(t){if(!j(t))throw new a(400,"invalid_request","request body must be an object");for(const o of Object.keys(t))if(o!=="action"&&o!=="payload")throw new a(400,"invalid_request",`unexpected field in request body: ${o}`);const e=t.action;if(typeof e!="string"||!k.test(e))throw new a(400,"invalid_request","`action` must be a declared action name");if(t.payload!==void 0&&M(t.payload)>f)throw new a(413,"payload_too_large",`serialized payload exceeds ${f} bytes`);return t.payload===void 0?{action:e}:{action:e,payload:t.payload}}r(P,"parseRegistration");function _(t,e){const o=e.delivery,n=Date.parse(e.object.created_at);return E({nodeId:t,actionName:e.actionName,state:o===null?"armed":o.state==="handed_off"?"running":o.state==="acknowledged"?"accepted":o.state,attempt:o?.attempts??0,nextAttemptAt:o?.nextAttemptAt??0,acceptedAt:o?.acknowledgedAt??null,permanentFailedAt:o?.failedAt??null,lastFailure:o?.lastFailure??null,createdAt:n,updatedAt:o?.updatedAt??e.updatedAt})}r(_,"outcomeView");function S(t){const e=t.outcome_reason;let o,n;return t.outcome_kind==="result"||e==="finished"||e==="declined"?(o="done",n="done"):e==="parked"?(o="done",n="parked"):e==="closed"||e==="retired"||e==="stranded"||e==="deadline_exceeded"?(o="canceled",n=null):(o="dead",n=null),{...t,status:o,intent:n,terminal_reason:e}}r(S,"nodeAtOutcome");function R(t,e){const o=b(t,e);if(!("kind"in o))return o;throw o.kind==="unknown_action"?new a(422,"unknown_action",`no action named ${t} is declared from ${e}`):new a(422,"invalid_action",`${t} is declared in ${o.configOrigin} but unusable: ${o.reason}`,{reason:o.reason,configOrigin:o.configOrigin})}r(R,"resolveAction");function x(t){const e=t.params.id??"",o=l(e),n=P(t.body),y=R(n.action,o.cwd);return m(d=>{const u=s(d,e);if(u&&u.delivery!==null)throw new a(409,"outcome_delivery_settled","outcome delivery has already started or settled");const i=l(e);if(g(d,e,{actionName:n.action,...y,payload:n.payload}),i.outcome_at!==null){if(i.outcome_kind==null||i.outcome_reason==null||i.outcome_revision==null||i.outcome_at==null)throw new Error(`outcome latch is incomplete for node ${e}`);O(d,e,N({node:S(i),outcome:{kind:i.outcome_kind,reason:i.outcome_reason,at:i.outcome_at,revision:i.outcome_revision,detailJson:i.outcome_detail_json??null},finalReport:i.final_report}))}const c=s(d,e);if(c===null)throw new Error(`outcome action was not registered for ${e}`);return{status:200,body:_(e,c)}})}r(x,"handlePutDelivery");function z(t){const e=t.params.id??"",o=s(A(),e);if(o===null)throw new a(404,"outcome_delivery_not_found",`no outcome delivery for node ${e}`);return{status:200,body:_(e,o)}}r(z,"handleGetDelivery");function F(t){const e=t.params.id??"";return m(o=>{if(!D(o,e))throw new a(409,"outcome_delivery_settled","outcome delivery has already started or settled");return{status:204}})}r(F,"handleDeleteDelivery");const Q=[{method:"GET",pattern:"/v1/nodes/:id/outcome",handler:L},{method:"PUT",pattern:"/v1/nodes/:id/outcome-delivery",handler:x},{method:"GET",pattern:"/v1/nodes/:id/outcome-delivery",handler:z},{method:"DELETE",pattern:"/v1/nodes/:id/outcome-delivery",handler:F}];export{Q as nodeOutcomeRoutes};
@@ -0,0 +1,2 @@
1
+ import type { RouteTable } from '../router.js';
2
+ export declare const nodeRecordRoutes: RouteTable;
@@ -0,0 +1,3 @@
1
+ var p=Object.defineProperty;var o=(e,r)=>p(e,"name",{value:r,configurable:!0});import{prepared as l}from"../../../core/sqlite-statements.js";import{dirname as c,isAbsolute as f,join as h,resolve as y}from"node:path";import{appendRotatingRecord as b}from"../../../core/log.js";import{jobDir as g,messagesDir as _}from"../../../core/canvas/paths.js";import{parseNodeTelemetryRecord as w,writeNodeTelemetryRecord as v}from"./telemetry-record.js";import{openDb as N}from"../../../core/canvas/db.js";import{reportDocumentBody as S}from"../../../core/feed/inbox.js";import{reportRefNodeId as R}from"../../../shared/inbox-entry-body.js";import{writeNodeRecap as T}from"../../../core/canvas/node-recap.js";import{markStopSignal as E,consumeStopSignals as j,clearStopSignals as D}from"../../../core/runtime/stop-signals.js";import{notFound as a,usage as n}from"../../../core/errors.js";import{isBeneathRefusal as A,readFileBeneath as O}from"../../../core/spaces/open-beneath.js";import{requireCurrentExecution as u}from"./broker-recovery.js";function i(e){if(e.body===null||typeof e.body!="object"||Array.isArray(e.body))throw n("node record requires a JSON object");const r=e.body;return u(e.params.id,r.expected_execution_id),r}o(i,"body");function s(e,r){if(typeof e!="string")throw n(`${r} must be a string`);return e}o(s,"text");const H=[{method:"POST",pattern:"/v1/nodes/:id/records/log",handler:o(e=>{const r=s(i(e).record,"record");return{status:200,body:{appended:b(h(g(e.params.id),"log.jsonl"),r)}}},"handler")},{method:"PUT",pattern:"/v1/nodes/:id/records/telemetry",handler:o(e=>(v(e.params.id,w(i(e))),{status:204}),"handler")},{method:"PUT",pattern:"/v1/nodes/:id/records/recap",handler:o(e=>(T(e.params.id,s(i(e).briefing,"briefing")),{status:204}),"handler")},{method:"GET",pattern:"/v1/nodes/:id/records/inbox",handler:o(e=>{const r=e.params.id,d=e.query.get("ref");if(u(r,e.query.get("execution_id")),d===null||R(d)===void 0)throw n("ref must be a report handle");const t=l(N(),`SELECT m.object_id FROM deliveries d JOIN messages m ON m.message_id = d.message_id
2
+ WHERE d.destination_id = ? AND d.state = 'handed_off'
3
+ AND d.claim_owner = ? AND d.canceled_at IS NULL AND m.body_ref = ? LIMIT 1`).get(r,e.query.get("execution_id"),d);if(t===void 0)throw a("report was not delivered to this node");const m=t.object_id===null?null:S(t.object_id);if(m===null)throw a("report not found");return{status:200,body:{content:m}}},"handler")},{method:"GET",pattern:"/v1/nodes/:id/records/passive",handler:o(e=>{const r=e.query.get("ref"),d=_(e.params.id);if(r===null||!f(r)||c(y(r))!==d||!r.endsWith(".md"))throw n("ref must be a direct-message spill path for this node");try{return{status:200,body:{content:O(d,r).toString("utf8")}}}catch(t){throw t.code==="ENOENT"?a("passive message not found"):A(t)?n("ref meets a symlink or is not a regular file; only the node's own message files are served"):t}},"handler")},{method:"POST",pattern:"/v1/nodes/:id/records/pushed-final",handler:o(e=>{const r=i(e);if(r.action==="mark")E(e.params.id,"pushedFinal",s(r.expected_execution_id,"expected_execution_id"));else if(r.action==="clear")D(e.params.id);else{if(r.action==="consume")return{status:200,body:j(e.params.id,s(r.expected_execution_id,"expected_execution_id"))};throw n("action must be mark, clear or consume")}return{status:200,body:{pushedFinal:!1}}},"handler")}];export{H as nodeRecordRoutes};