@north-light/cli 0.0.0 → 0.3.414

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 +158 -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,17 @@
1
+ import { type ModelRegistryLike } from '../../../core/model-routes.js';
2
+ import { type HandlerResult, type RequestContext, type RouteTable } from '../router.js';
3
+ interface NodeHandlerDeps {
4
+ modelRegistry?: ModelRegistryLike;
5
+ }
6
+ interface CreatePreparation {
7
+ deadlineAt?: string;
8
+ beforeBrokerLaunch?: (nodeId: string) => void;
9
+ }
10
+ export { resolveCreateKind } from '../../../core/runtime/launch-target.js';
11
+ export declare function handleCreate(ctx: RequestContext, deps?: NodeHandlerDeps, preparation?: CreatePreparation): Promise<HandlerResult>;
12
+ export declare function handleList(ctx: RequestContext): HandlerResult;
13
+ export declare function handleFork(ctx: RequestContext): Promise<HandlerResult>;
14
+ export declare function handlePromote(ctx: RequestContext, deps?: NodeHandlerDeps): Promise<HandlerResult>;
15
+ export declare function handleYield(ctx: RequestContext, deps?: NodeHandlerDeps): Promise<HandlerResult>;
16
+ export declare function handleConfig(ctx: RequestContext, deps?: NodeHandlerDeps): Promise<HandlerResult>;
17
+ export declare const nodeRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var be=Object.defineProperty;var a=(e,t)=>be(e,"name",{value:t,configurable:!0});import{prepared as Y}from"../../../core/sqlite-statements.js";import{envProfileId as ve}from"../../../shared/env.js";import{pausedCanvasProfiles as ke}from"../../../core/profiles/manifest.js";import{existsSync as C,realpathSync as Q,statSync as X}from"node:fs";import{isAbsolute as L,resolve as T}from"node:path";import{appendSituationalContext as Se,formatSituationalProse as Oe}from"../../../core/runtime/situational-context.js";import{closeNode as Re}from"../../../core/runtime/close.js";import{reviveNode as Ie}from"../../../core/runtime/revive.js";import{nowIso as M}from"../../../core/fs-utils.js";import{assertLaunchModelRegistered as F,forkNode as $e,resolveForkSource as Ne,spawnChildPrepared as Ae}from"../../../core/runtime/spawn.js";import{forkSourceNode as Ce,newNodeId as Te}from"../../../core/runtime/nodes.js";import{abandonCreateRequest as Z,childrenOf as Ee,completeCreateRequest as q,findCreateRequest as Pe,getNode as k,recordCreateRequestNode as De,reserveCreateRequest as ee,reserveCreateRequestNode as je,listNodes as ne,recordRespawnAttempt as xe,subscribersOf as Le,subscriptionsOf as te,setMessageWait as Me,updateNode as N}from"../../../core/canvas/canvas.js";import{subtreeIds as Fe}from"../../../core/canvas/nav-model.js";import{withCanvasWrite as G}from"../../../core/canvas/db.js";import{nodeObject as Ge}from"../../../core/graph/objects.js";import{recordActedOn as Be}from"../../../core/graph/edges.js";import{publish as Ke}from"../../../core/graph/events.js";import{readerFor as We}from"../reader.js";import{relocateSessionCwd as Ve,unbindSession as ze}from"../../../core/canvas/sessions.js";import{ticketCountsForNodes as Je}from"../../../core/canvas/attention.js";import{isSafeNodeId as Ue}from"../../../core/canvas/paths.js";import{contextDir as oe,nodeAgentDir as re}from"../../../core/canvas/node-agent-paths.js";import{existsBeneath as He,isAbsentOrRefused as Ye,isBeneathRefusal as Qe,readdirBeneath as Xe}from"../../../core/spaces/open-beneath.js";import{readNodeMessagesPage as Ze,readNodeSession as qe,readNodeSnapshot as en,transcriptMarkdown as nn}from"../../../core/runtime/node-read.js";import{assembleNodeSubject as tn}from"../../../core/substrate/subject.js";import{reviveAll as on}from"../../../core/runtime/revive-all.js";import{promoteAsync as rn,requestYieldAsync as dn,reshapeNodeAsync as B}from"../../../core/runtime/promote.js";import{recycleNode as sn}from"../../../core/runtime/recycle.js";import{relaunchRoot as an}from"../../../core/runtime/reset.js";import{assertReopenGate as ln}from"../../../core/runtime/reopen.js";import{writeYieldMessage as cn,readGoal as fn}from"../../../core/runtime/kickoff.js";import{ensureRoadmap as un,hasRoadmap as pn}from"../../../core/runtime/roadmap.js";import{renameWindow as mn}from"../../../core/runtime/placement.js";import{buildLaunchSpecAsync as hn,explicitModelIntent as wn,normalizeModel as yn,readMergedLaunchConfigAsync as ie}from"../../../core/runtime/launch.js";import{modelRequestFromConfig as _n}from"../../../core/model-routes.js";import{persistDormantModel as gn,setModelLive as bn}from"../../../core/runtime/model-swap.js";import{waitForBrokerViewSocket as vn}from"../../../core/runtime/view-socket.js";import{BrokerUnreachableError as kn}from"../../../core/runtime/broker-request.js";import{boundFleet as K}from"../../../core/runtime/fleet.js";import{admitLegacyStructuredOutput as Sn}from"../../structured-requests/sidecar.js";import{OUTCOME_PAYLOAD_MAX_BYTES as de}from"../../../core/canvas/types.js";import{HUMAN_ACTION_NAME_PATTERN as On}from"../../../core/human/action-binding.js";import{resolveHumanAction as Rn}from"../../../core/human-actions.js";import{parseDurationMs as In}from"../../../core/wake.js";import{claimWarmNode as $n,refillWarmPool as se,resumeWarmClaim as Nn,warmPoolEnabled as An}from"../../../core/runtime/warm-pool.js";import{assertLaunchKind as W,isLaunchKind as Cn,resolveLaunchTarget as Tn}from"../../../core/runtime/launch-target.js";import{fullName as En}from"../../../core/canvas/labels.js";import{reportsForNode as ae}from"./reports.js";import{requireUsableProfile as Pn}from"./profiles.js";import{assertProfileActive as Dn,loadExactProfileManifest as jn}from"../../../core/profiles/manifest.js";import{getCron as xn}from"../../../core/canvas/crons.js";import{cronWakeOrigin as Ln}from"../../../core/runtime/bearings.js";import{boundDaemonControl as Mn}from"../../control.js";import{notFound as E,usage as p}from"../../../core/errors.js";import{assertScope as Fn,validateScopes as le}from"../../../core/scopes.js";import{scopeAllowed as R}from"../../../shared/env.js";import{toCloseResultDTO as Gn,toNodeDetailDTO as V,toNodeSummaryDTO as Bn,toReviveResultDTO as Kn}from"../map.js";import{ApiError as m}from"../../../api/index.js";import{InputError as h}from"../../../core/io.js";import{brokerMayReach as z,canReadNode as ce,resolvedScopes as Wn}from"../router.js";import{fileRoot as Vn}from"../../../core/spaces/file-root.js";import{activeGrant as zn,terminalGrant as Jn}from"../../../core/grants/mirror.js";import{readConfig as Un}from"../../../core/config.js";import{hasConfiguredProviderCredential as Hn,NO_PROVIDER_CREDENTIAL_MESSAGE as fe}from"../../../core/runtime/provider-credential-gate.js";function w(e){const t=k(e);if(t===null)throw E(`unknown node: ${e}`,{received:e});return t}a(w,"requireMeta");function J(e){return{subscribesTo:te(e),subscribers:Le(e),children:Ee(e)}}a(J,"edgesFor");function g(e){const t=w(e);return V(t,J(e))}a(g,"detailOf");function Yn(e){let t=ae(e).length;try{t+=Xe(re(e),oe(e)).length}catch(n){if(!Ye(n))throw n}return t}a(Yn,"countFiles");function Qn(e){if(typeof e!="object"||e===null)throw p("a node create requires a JSON body");const t=e;if(t.kind!==void 0&&(typeof t.kind!="string"||t.kind.trim()===""))throw p("kind must be a non-empty string when provided");if(t.description!==void 0&&(typeof t.description!="string"||t.description.trim()===""))throw p("description must be a non-empty string when provided");if(t.creator!==void 0&&(typeof t.creator!="string"||t.creator.trim()===""))throw p("creator must be a non-empty node id when provided");if(t.scopes!==void 0&&le(t.scopes),t.isolated!==void 0&&typeof t.isolated!="boolean")throw new m(400,"invalid_request","isolated must be a boolean",{param:"isolated"});const n=t.root_lifecycle;if(n!==void 0&&n!=="resident"&&n!=="terminal")throw p("root_lifecycle must be 'resident' or 'terminal'");if(t.request_key!==void 0&&(typeof t.request_key!="string"||t.request_key.trim()===""||t.request_key.length>128))throw p("request_key must be a non-empty string of at most 128 characters when provided");return t}a(Qn,"parseCreateBody");function Xn(e){if(e===void 0)return;const t=In(e),n=t===null?null:new Date(Date.now()+t);if(t===null||!Number.isFinite(t)||t<=0||n===null||!Number.isFinite(n.getTime()))throw new m(422,"invalid_deadline","`deadline` must be a positive representable duration");return n.toISOString()}a(Xn,"parseDeadline");function Zn(e){if(e!==void 0){if(typeof e!="object"||e===null||Array.isArray(e))throw new m(400,"invalid_request","`outcome_delivery` must be an object");if(typeof e.action!="string"||!On.test(e.action))throw new m(400,"invalid_request","`outcome_delivery.action` must be a declared action name");if(e.payload!==void 0){let t;try{t=JSON.stringify(e.payload)}catch{throw new m(400,"invalid_request","`outcome_delivery.payload` must be JSON-serializable")}if(t===void 0)throw new m(400,"invalid_request","`outcome_delivery.payload` must be JSON-serializable");if(Buffer.byteLength(t,"utf8")>de)throw new m(413,"payload_too_large",`serialized payload exceeds ${de} bytes`)}return e}}a(Zn,"parseOutcomeDelivery");function qn(e,t){const n=Rn(e.action,t);if(!("kind"in n))return{actionName:e.action,argv:n.argv,cwd:n.cwd,configOrigin:n.configOrigin,...e.payload===void 0?{}:{payload:e.payload}};throw n.kind==="unknown_action"?new m(422,"unknown_action",`no action named ${e.action} is declared from ${t}`):new m(422,"invalid_action",`${e.action} is declared in ${n.configOrigin} but unusable: ${n.reason}`,{reason:n.reason,configOrigin:n.configOrigin})}a(qn,"resolveOutcomeDelivery");function et(e,t,n){const r={kind:e.kind,cwd:n,prompt:e.prompt??""};return e.mode!==void 0&&(r.mode=e.mode),e.name!==void 0&&(r.name=e.name),e.description!==void 0&&(r.description=e.description),t!==void 0&&(r.parent=t),e.creator!==void 0&&(r.creator=e.creator),e.scopes!==void 0&&(r.scopes=e.scopes),e.isolated!==void 0&&(r.isolated=e.isolated),e.root===!0&&(r.root=!0),e.root_lifecycle!==void 0&&(r.rootLifecycle=e.root_lifecycle),(e.worktree===!0||typeof e.worktree=="string")&&(r.worktree=!0),typeof e.worktree=="string"&&(r.worktreeBase=e.worktree),e.worktree!==void 0&&(r.worktreeCwd=T(e.pin_cwd??e.cwd??n)),e.fork_from!==void 0&&(r.forkFrom=e.fork_from),e.model!==void 0&&(r.model=e.model),e.profile!==void 0&&(r.profile=e.profile),e.situational_context!==void 0&&(r.situationalContext=e.situational_context),e.node_id!==void 0&&(r.nodeId=e.node_id),r}a(et,"buildRecipe");function nt(e,t,n){return!An()||e.prefer_warm!==!0||e.root!==!0||e.parent!=null||e.root_lifecycle==="terminal"||(e.prompt??"")!==""||e.model!==void 0||e.fork_from!==void 0||e.worktree!==void 0||e.node_id!==void 0||e.scopes!==void 0||e.isolated!==void 0?null:{kind:e.kind,mode:e.mode??"base",cwd:t,profileId:n,model:e.model??null,situationalContext:e.situational_context??null,name:e.name??null,creator:e.creator??null}}a(nt,"warmRequestFor");import{resolveCreateKind as zo}from"../../../core/runtime/launch-target.js";function ue(e){const t=e.modelIntent===void 0?void 0:`${e.modelIntent.family}/${e.modelIntent.strength}`;return _n(e.model,t,e.modelExact===!0)}a(ue,"requestFromLaunch");function tt(e,t){if(t===null)return e;if(e.scopes===void 0)return{...e,scopes:[...t]};const n=e.scopes.filter(r=>!R(t,r));if(n.length===0)return e;throw new m(403,"scope_denied",`scopes exceed the bearer token's ceiling: ${n.join(", ")}`,{scopes:n,ceiling:t})}a(tt,"withinCeiling");async function pe(e,t,n){const r=(await hn(t.kind,t.mode,{lifecycle:t.lifecycle,hasManager:e.parent!==null,model:t.model,modelOverride:!0,cwd:e.cwd,profileId:e.profile_id??null})).launch;await F(ue(r),{cwd:e.cwd,profileId:e.profile_id??null},n)}a(pe,"assertNodeModelChangeRegistered");function me(e,t){const n=e.principal;if(n.class!=="broker")return;const r=Vn({app:n.app,resolved:Wn(n),launched:n.scopes},t,"read");if("root"in r)return;const o="missing"in r?r.missing:null;throw new m(403,"scope_missing",o?`the child's directory ${t} needs missing scope ${o}`:`no permission of this run names the child's directory ${t}`,void 0,void 0,o?{scope:o}:void 0)}a(me,"assertCallerReaches");const U=new Map;async function ot(e,t={},n={}){const r=tt(Qn(e.body),e.ceiling);if(e.principal.class==="broker"){const u=e.principal;if(r.prefer_warm===!0&&u.app!=="app:terminal"&&(r.prefer_warm=!1),r.parent!=null){const i=w(r.parent);if(i.grantee!==u.app)throw new m(403,"other_app_run","cannot create a child under another app's node");if(!z(u,r.parent,i.grantee??"app:terminal"))throw E(`unknown node: ${r.parent}`,{received:r.parent})}if(r.creator!==void 0&&r.creator!==u.node)throw new m(403,"other_app_run","cannot create for another node");if(r.fork_from!==void 0){let i=null;try{i=Ce(Ne(r.fork_from))}catch{}if(i?.grantee!==u.app||!z(u,i.node_id,i.grantee))throw new m(403,"other_app_run","cannot fork another app's conversation")}r.creator=u.node}r.creator!==void 0&&Fn(w(r.creator),"crtr:act");const o=r.request_key?.trim();if(o===void 0||r.node_id!==void 0&&Ue(r.node_id)&&k(r.node_id)!==null&&Pe(o)?.nodeId!==r.node_id)return P(e,r,t,n);const d=U.get(o);if(d!==void 0)return d;const s=rt(e,r,o,t,n);U.set(o,s);try{return await s}finally{U.delete(o)}}a(ot,"handleCreate");async function rt(e,t,n,r,o){const d=ee(n);if(d.nodeId!==null&&k(d.nodeId)!==null){if(d.state!=="warm_claimed"){const s=k(d.nodeId);if(e.principal.class!=="person"&&!ce(e.principal,s.grantee??"app:terminal",d.nodeId))throw new m(409,"create_request_conflict","request_key belongs to another caller");return{status:201,body:g(d.nodeId)}}return P(e,t,r,o,d)}try{return await P(e,t,r,o,d)}catch(s){const u=ee(n);throw(u.nodeId===null||k(u.nodeId)===null)&&Z(n,u.nodeId),s}}a(rt,"handleKeyedCreateRequest");async function P(e,t,n,r,o=void 0){const d=r.deadlineAt??Xn(t.deadline),s=Zn(t.outcome_delivery),u=t.parent??void 0;if(u==null&&t.root!==!0)throw p("a node create requires a parent (or root: true for an independent root)");let i=null;if(t.output_schema!==void 0)try{i=JSON.parse(t.output_schema)}catch{throw p("output_schema must be a JSON schema string")}const{profileId:l,kind:y,cwd:f,launch:c}=await Tn(t,{validateKind:ge});me(e,f),t.worktree!==void 0&&me(e,T(t.pin_cwd??t.cwd??f));const _={...t,kind:y},S=s===void 0?void 0:qn(s,f);if(await F(ue(c),{cwd:f,profileId:l},n.modelRegistry),!await Hn(l))throw new m(412,"no_provider_credential",fe,{error:"no_provider_credential",message:fe,next:"The person running this runtime logs a provider in with `crtr sys setup`, or stores a provider key on the profile."});let $=null;{const O=o===void 0||o.nodeId===null||o.state==="warm_claimed"?nt(_,f,l):null,j=i===null&&r.beforeBrokerLaunch===void 0?void 0:v=>{i!==null&&Sn(v,"terminal",i),r.beforeBrokerLaunch?.(v)};if(o?.state==="warm_claimed"&&o.nodeId!==null){const v=O===null?null:await Nn(O,o.nodeId,j);if(v===null)throw Z(o.requestKey,o.nodeId),new m(503,"create_resume_failed",`could not resume warm claim ${o.nodeId}; retry the create`);return q(o.requestKey,v),{status:201,body:g(v)}}if(O!==null){const v=await $n(O,{...d===void 0?{}:{deadlineAt:d},...S===void 0?{}:{outcomeDelivery:S},...o===void 0?{}:{requestKey:o.requestKey}},j);if(v!==null)return o!==void 0&&q(o.requestKey,v),se(O),{status:201,body:g(v)};$=O}const x=o?.nodeId??t.node_id??(o===void 0?void 0:Te());o!==void 0&&o.nodeId===null&&je(o.requestKey,x);const A=et(x===void 0?_:{..._,node_id:x},u,f);d!==void 0&&(A.deadlineAt=d),S!==void 0&&(A.outcomeDelivery=S),A.readiness=t.root===!0?"await":"launch";const H=await Ae(A,j,()=>{$!==null&&se($)});return o!==void 0&&De(o.requestKey,H.node.node_id),{status:201,body:g(H.node.node_id)}}}a(P,"handleCreateRequest");function b(e,t){const n=e.query.getAll(t);if(n.length>1)throw p(`${t} must appear at most once`);return n[0]}a(b,"singleQueryValue");function he(e,t){if(e!==void 0){if(e==="1"||e==="true")return!0;if(e==="0"||e==="false")return!1;throw p(`${t} must be true or false`)}}a(he,"optionalBoolean");function D(e,t,n){if(e!==void 0){if(n.includes(e))return e;throw p(`${t} must be one of: ${n.join(", ")}`)}}a(D,"oneOf");function it(e){const t=new Set(["status","lifecycle","kind","mode","profile_id","profile_prefix","parent","top_level","under","hanging","include"]);for(const[_]of e.query)if(!t.has(_))throw p(`unknown nodes query parameter: ${_}`);const n=D(b(e,"status"),"status",["active","idle","done","dead","canceled"]),r=D(b(e,"lifecycle"),"lifecycle",["terminal","resident"]),o=b(e,"kind"),d=D(b(e,"mode"),"mode",["base","orchestrator"]),s=b(e,"profile_id"),u=b(e,"profile_prefix"),i=b(e,"parent"),l=he(b(e,"top_level"),"top_level"),y=b(e,"under"),f=he(b(e,"hanging"),"hanging"),c=D(b(e,"include"),"include",["activity"]);if(i!==void 0&&l===!0)throw p("parent and top_level=true cannot be combined");return{...n!==void 0?{status:n}:{},...r!==void 0?{lifecycle:r}:{},...o!==void 0?{kind:o}:{},...d!==void 0?{mode:d}:{},...s!==void 0?{profile_id:s}:{},...u!==void 0?{profile_prefix:u}:{},...i!==void 0?{parent:i}:{},...l!==void 0?{top_level:l}:{},...y!==void 0?{under:y}:{},...f!==void 0?{hanging:f}:{},...c!==void 0?{include:c}:{}}}a(it,"parseListQuery");function dt(e){const t=it(e);let n=t.status!==void 0?ne({status:t.status}):ne();if(e.principal.class!=="person"&&(n=n.filter(s=>ce(e.principal,s.grantee??"app:terminal",s.node_id))),t.lifecycle!==void 0&&(n=n.filter(s=>s.lifecycle===t.lifecycle)),t.kind!==void 0&&(n=n.filter(s=>s.kind===t.kind)),t.mode!==void 0&&(n=n.filter(s=>s.mode===t.mode)),t.profile_id!==void 0&&(n=n.filter(s=>s.profile_id===t.profile_id)),t.profile_prefix!==void 0&&(n=n.filter(s=>s.profile_id?.startsWith(t.profile_prefix))),t.parent!==void 0&&(n=n.filter(s=>s.parent===t.parent)),t.top_level===!0&&(n=n.filter(s=>s.parent===null)),t.under!==void 0){const s=new Set(Fe(t.under));n=n.filter(u=>s.has(u.node_id))}t.hanging===!0&&(n=n.filter(s=>s.parent!==null&&k(s.parent)===null));const r=t.include==="activity"?Je(n.map(s=>s.node_id)):null,o=n.length>0?ke():new Set;return{status:200,body:n.map(s=>{const u=Bn(s,s.profile_id!==null&&o.has(s.profile_id));if(r!==null){const i=ae(s.node_id);u.activity={latest_report:i[0]??null,final_report:s.final_report===null?null:i.find(l=>l.name===s.final_report)??null,pending_human_count:r[s.node_id]??0}}return u})}}a(dt,"handleList");function st(e){const t=e.params.id;return w(t),{status:200,body:g(t)}}a(st,"handleDetail");async function at(e){const t=e.params.id;w(t);const n=await en(t);return{status:200,body:{node_id:t,snapshot:{messages:n.snapshot.messages,...n.snapshot.messageIds===void 0?{}:{messageIds:n.snapshot.messageIds},messageVisibility:n.snapshot.messageVisibility,turnVisibility:n.snapshot.turnVisibility,stats:n.snapshot.stats,state:n.snapshot.state,display:n.snapshot.display,...n.snapshot.queued===void 0?{}:{queued:n.snapshot.queued},...n.snapshot.toolGroupSummaries===void 0?{}:{toolGroupSummaries:n.snapshot.toolGroupSummaries},...n.snapshot.workingActivity===void 0?{}:{workingActivity:n.snapshot.workingActivity}},commands:n.commands.map(o=>({name:o.name,description:o.description,source:o.source})),captured_at:M()}}}a(at,"handleSnapshot");async function lt(e){const t=e.params.id,n=tn(t);if(n===null)throw E(`unknown node: ${t}`,{received:t});return{status:200,body:n}}a(lt,"handleSubject");function ct(e){for(const[d]of e.query)if(d!=="cursor"&&d!=="limit")throw p(`unknown messages query parameter: ${d}`);const t=e.query.getAll("cursor"),n=e.query.getAll("limit");if(t.length>1)throw p("cursor must appear at most once");if(n.length>1)throw p("limit must appear at most once");if(n.length===0)return t.length===0?{}:{cursor:t[0]};const r=n[0],o=Number(r);if(!Number.isSafeInteger(o)||r==="")throw p("limit must be an integer from 1 through 500");return t.length===0?{limit:o}:{cursor:t[0],limit:o}}a(ct,"parseMessagesQuery");async function ft(e){const t=e.params.id,n=await Ze(t,ct(e));return{status:200,body:{node_id:t,messages:n.messages,...n.messageIds===void 0?{}:{message_ids:n.messageIds},message_visibility:n.messageVisibility,next_cursor:n.nextCursor,captured_at:M()}}}a(ft,"handleMessages");function ut(e){const t=e.params.id;w(t);const n=qe(t);return{status:200,body:{node_id:t,session_file:n.sessionFile,session_jsonl:n.sessionJsonl,system_prompt:n.systemPrompt,captured_at:M()}}}a(ut,"handleSession");async function pt(e){const t=e.params.id;return w(t),{status:200,body:{node_id:t,markdown:await nn(t)}}}a(pt,"handleTranscript");function mt(e){const t=e.params.id;w(t);const n=a((o,d)=>({node_id:o,label:k(o)?.name??o,dir:oe(o),self:d,files:Yn(o)}),"root"),r=[n(t,!0),...te(t).map(o=>n(o.node_id,!1))].filter(o=>ht(o.node_id,o.dir)||o.files>0);return{status:200,body:{node_id:t,roots:r}}}a(mt,"handleContext");function ht(e,t){try{return He(re(e),t)}catch(n){if(Qe(n))return!1;throw n}}a(ht,"hasDir");async function wt(e){const t=w(e.params.id),n=e.principal.class==="broker"?e.principal.scopes:e.ceiling,r=n===null?void 0:t.scopes==null?[...n]:[...new Set([...t.scopes.filter(d=>R(n,d)),...n.filter(d=>R(t.scopes,d))])],o=await $e(t.node_id,r,e.principal.class==="broker"?e.principal.node:void 0);return{status:201,body:g(o.node.node_id)}}a(wt,"handleFork");async function yt(e){const t=e.params.id;w(t);const n=e.body,r=n?.resume??!0,o=n?.reopen??!1;ln(t,o);const d=!r&&n?.cron_id!==void 0?xn(n.cron_id):null,s=await Ie(t,{resume:r,capacity:"refuse",...d!==null?{wakeReason:Ln(d,"schedule_revive")}:{}});s.outcome!=="already-live"&&xe(t,{failures:0,notBefore:null});const u=k(t)?.status??"active";return{status:200,body:Kn(t,s,u)}}a(yt,"handleRevive");async function _t(e){const t=e.params.id;return{status:200,body:{newNodeId:(await an(t))?.newNodeId??null}}}a(_t,"handleRelaunchRoot");function gt(e){const t=e.params.id;w(t);const n=e.body;if(n?.caller_pid!==void 0&&(!Number.isInteger(n.caller_pid)||n.caller_pid<=0))throw p("caller_pid must be a positive integer when provided");const r=Mn(),o=Re(t,{rootEvent:n?.finish===!0?"finish":"cancel",callerPid:n?.caller_pid,...e.principal.class==="broker"?{closer:e.principal.node}:{},...r===null?{}:{registerDetached:r.registerDetached}});return{status:200,body:Gn(o)}}a(gt,"handleClose");async function bt(e){const t=e.params.id;w(t);const n=await sn(t);return{status:200,body:{recycled:n.recycled,finalized:n.finalized,new_root:n.newRoot,delivered:n.delivered}}}a(bt,"handleRecycle");async function vt(e){const t=e.params.id;return w(t),await B(t,{lifecycle:"terminal"}),I(e,t,["lifecycle"]),{status:200,body:g(t)}}a(vt,"handleDemote");async function kt(e,t={}){const n=e.params.id,r=w(n),o=e.body??{};o.kind!==void 0&&await W(o.kind,r.cwd,r.profile_id??null),o.model!==void 0&&await pe(r,{kind:o.kind??r.kind,mode:"orchestrator",lifecycle:o.resident===!0?"resident":r.lifecycle,model:o.model},t.modelRegistry);const d=await rn(n,{...o.kind!==void 0?{kind:o.kind}:{},...o.resident===!0?{resident:!0}:{},...o.model!==void 0?{model:o.model}:{}});I(e,n,["mode",...o.kind!==void 0?["kind"]:[],...o.resident===!0?["lifecycle"]:[],...o.model!==void 0?["model"]:[]]);const s=V(d.meta,J(n));return s.roadmap_written=d.roadmapWritten,s.roadmap_ref=d.roadmapRef,s.goal_path=d.goalPath,{status:200,body:s}}a(kt,"handlePromote");async function St(e,t={}){const n=e.params.id,r=w(n),o=e.body??{};o.kind!==void 0&&await W(o.kind,r.cwd,r.profile_id??null),o.model!==void 0&&await pe(r,{kind:o.kind??r.kind,mode:o.promote===!0?"orchestrator":r.mode,lifecycle:r.lifecycle,model:o.model},t.modelRegistry);const d=o.note??"Refresh: continue against your roadmap or goal.";cn(n,d);const s=await dn(n,{...o.promote===!0?{promote:!0}:{},...o.kind!==void 0?{kind:o.kind}:{},...o.model!==void 0?{model:o.model}:{}});return{status:200,body:V(s.meta,J(n))}}a(St,"handleYield");function Ot(e){const t=e.params.id;w(t);const n=e.body;if(n===void 0||typeof n.controller!="string"||n.controller.trim()==="")throw p("a wait requires a controller node id");const r=k(n.controller);if(r===null)throw E(`unknown controller: ${n.controller}`,{received:n.controller});if(r.status!=="active"&&r.status!=="idle")throw new m(422,"unprocessable",`controller ${n.controller} is ${r.status}`);return Me(t,n.controller),{status:200,body:g(t)}}a(Ot,"handleWait");async function Rt(e){const t=e.principal,n=await on(t.class==="broker"?o=>o.grantee===t.app&&z(t,o.node_id,o.grantee):void 0);return{status:200,body:{revived:[...n.revived],failed:[...n.failed],frozen:[...n.frozen]}}}a(Rt,"handleReviveAll");const It=new Set(["interrupt","steer","after-turn","next-turn"]);function $t(e){if(e===null)return null;const t=a(r=>{throw new h({error:"invalid_listen",message:r,received:e,field:"listen",next:'Send an object mapping levels "1".."10" to interrupt|steer|after-turn|next-turn (e.g. {"3":"next-turn"}), or null to reset to the global default.'})},"bad");if(typeof e!="object"||Array.isArray(e))return t("listen must be an object or null");const n=Object.entries(e);if(n.length===0)return t("listen must name at least one level");for(const[r,o]of n)/^(?:[1-9]|10)$/.test(r)||t(`listen level must be 1..10: ${r}`),(typeof o!="string"||!It.has(o))&&t(`listen delivery must be interrupt|steer|after-turn|next-turn: ${String(o)}`);return JSON.stringify(Object.fromEntries(n))}a($t,"listenJson");function I(e,t,n,r){n.length===0&&r===void 0||G(o=>{if(r?.(o),n.length===0)return;const d=Ge(o,t),s=We(o,e),u=s.class==="person"?s.person:s.class==="app"?s.app:s.node;Be(o,u,d),Ke(o,{event:"configured",object:d,actor:u,attrs:{changed:n.join(",")}})})}a(I,"recordConfigured");function we(e){const t=K().get(e);if(t===void 0)return!1;try{return process.kill(t.pid,"SIGTERM"),!0}catch{return!1}}a(we,"restartLiveBroker");function ye(e,t){try{return Q(e)===Q(t)}catch{return!1}}a(ye,"sameDirectory");async function Nt(e,t={}){const n=e.params.id,r=e.body;let o;if(r===void 0)o={};else if(typeof r=="object"&&r!==null&&!Array.isArray(r))o=r;else throw new h({error:"cwd_invalid",message:"cwd repair requires a non-null object with a non-empty cwd string",received:r,field:"cwd",next:"Send a config patch with a non-empty absolute cwd string."});if(o.profile!==void 0){if(typeof o.profile!="string"||o.profile==="")throw new h({error:"profile_invalid",message:"profile must be a non-empty profile id or name",received:o.profile,field:"profile",next:"Send a profile id or exact name."});if(Object.keys(o).some(f=>f!=="profile"&&f!=="restart"&&o[f]!==void 0))throw new h({error:"profile_not_exclusive",message:"profile can only be combined with restart",field:"profile",next:"Send profile (and optionally restart) alone."});const i=w(n),l=Pn(e,o.profile);Dn(l.profileId);const y=jn(l.profileId).manifest.grantee??"app:terminal";if(y!==(i.grantee??"app:terminal"))throw new h({error:"profile_grantee_mismatch",message:`profile ${l.profileId} belongs to ${y}, node ${n} to ${i.grantee}`,received:o.profile,field:"profile",next:"Pick a profile owned by the same app as the node."});return(i.profile_id??null)!==l.profileId&&(Cn(i.kind)?(await W(i.kind,i.cwd,l.profileId),await B(n,{profileId:l.profileId})):N(n,{profile_id:l.profileId}),I(e,n,["profile"])),o.restart===!0&&we(n),{status:200,body:g(n)}}if(Object.prototype.hasOwnProperty.call(o,"cwd")){const i=o.cwd;if(typeof i!="string"||i==="")throw new h({error:"cwd_invalid",message:"cwd must be a non-empty string",received:i,field:"cwd",next:"Send a non-empty absolute cwd string."});if(Object.keys(o).some(c=>c!=="cwd"&&c!=="keep_session"&&c!=="restart"&&o[c]!==void 0))throw new h({error:"cwd_not_exclusive",message:"cwd repair cannot be combined with another config field",received:o,field:"cwd",next:"Send cwd as the only config field."});const l=w(n),y=C(l.cwd);if(o.keep_session===!0||y&&L(i)&&C(i)&&ye(l.cwd,i)){if(!L(i))throw new h({error:"cwd_not_absolute",message:`cwd must be an absolute path: ${i}`,received:i,field:"cwd",next:"Send an absolute path."});const c=T(i);let _=!1;try{_=X(c).isDirectory()}catch{}if(!_)throw new h({error:"cwd_missing",message:`cwd is not an existing directory: ${c}`,received:i,field:"cwd",next:"Send an existing absolute directory."});if(y&&!ye(l.cwd,c))throw new h({error:"cwd_not_same_directory",message:`${c} is not the same directory as the recorded ${l.cwd}; --keep-session only relocates an alias`,received:i,field:"cwd",next:"Drop --keep-session to repair a gone cwd, or pass the real path of the recorded directory."});if(l.managed_worktree?.state==="open")throw new h({error:"cwd_node_managed_worktree_open",message:`${n} owns an open managed worktree and cannot relocate its cwd`,received:i,field:"cwd",next:"Reconcile the managed worktree first."});const S=l.cwd;return S!==c&&(G($=>{N(n,{cwd:c}),Y($,"UPDATE crons SET cwd = ? WHERE anchor_node = ? AND cwd = ?").run(c,n,S),Ve(n,S,c)}),I(e,n,["cwd"])),o.restart===!0&&we(n),{status:200,body:g(n)}}if(K().has(n)){const c=`${n} cannot repair its cwd while its broker is live`;throw new m(409,"cwd_node_live",c,{error:"cwd_node_live",message:c,received:i,field:"cwd",next:"Let the node become dormant, then retry the cwd repair."})}if(l.fork_from!=null)throw new h({error:"cwd_node_forked",message:`${n} is a fork and cannot repair its cwd; recorded cwd: ${l.cwd}`,received:i,field:"cwd",next:`Restore ${l.cwd}, then revive the fork normally.`});if(l.managed_worktree?.state==="open")throw new h({error:"cwd_node_managed_worktree_open",message:`${n} owns an open managed worktree and cannot repair its cwd`,received:i,field:"cwd",next:"Restore or reconcile the recorded checkout, then use the managed-worktree close or abandon flow."});if(C(l.cwd))throw new h({error:"cwd_still_present",message:`${n} recorded cwd still exists: ${l.cwd}; cwd repair is not a relocation command`,received:i,field:"cwd",next:"This command only repairs a node whose recorded cwd is gone."});if(!L(i))throw new h({error:"cwd_not_absolute",message:`cwd must be an absolute path: ${i}`,received:i,field:"cwd",next:"Send an absolute path."});const f=T(i);if(!C(f))throw new h({error:"cwd_missing",message:`cwd does not exist: ${f}`,received:i,field:"cwd",next:"Create the replacement directory or send an existing absolute directory."});try{if(!X(f).isDirectory())throw new h({error:"cwd_not_a_directory",message:`cwd is not a directory: ${f}`,received:i,field:"cwd",next:"Send an existing absolute directory."})}catch(c){throw c instanceof h?c:new h({error:"cwd_missing",message:`cwd does not exist: ${f}`,received:i,field:"cwd",next:"Create the replacement directory or send an existing absolute directory."})}return G(()=>{N(n,{cwd:f}),ze(n)}),I(e,n,["cwd"]),{status:200,body:g(n)}}let d=w(n);const s=o.listen===void 0?void 0:$t(o.listen);if(o.scopes!==void 0){const i=le(o.scopes),l=d.grantee==="app:terminal"?Jn():d.grant_id?zn(d.grant_id):null,y=d.grantee==="app:terminal"&&!Un("user").runtime?.issuer;if(!i.every(f=>R(d.scopes,f)&&(l?R(l.resolved,f):y)))throw new h({error:"unknown_scope",message:"scopes may only narrow the node's current effective set",received:i,field:"scopes",next:"Send only scopes the node currently holds."});if(i.includes("crtr:act")&&!R(i,"crtr:llm"))throw new m(400,"invalid_scope","crtr:act requires crtr:llm");d=N(n,{scopes:i})}if(o.situational_context!==void 0&&Se(n,Oe(o.situational_context)),o.model!==void 0){const i=(await ie(d.cwd,d.profile_id??null)).modelLadders,l=wn(o.model,i),y=yn(o.model,i);await F({kind:"concrete",spec:y},{cwd:d.cwd,profileId:d.profile_id??null},t.modelRegistry);const f=K();let c=!1;if(f.isClaimed(n)&&await vn(n,f.get(n)?.handle.exited)&&(c=await bn(n,y,l).then(()=>!0,_=>{if(_ instanceof kn)return!1;throw _})),!c){if(f.isClaimed(n)){const _=`${n}'s broker did not accept the model switch; the model was not changed`;throw new m(409,"broker_not_ready",_,{error:"broker_not_ready",message:_,received:o.model,field:"model",next:"Check the node with `crtr node show`, then retry the model change."})}if(!y.includes("/"))throw p(`model must resolve to a provider/id spec: ${o.model}`);gn(n,y,l)}d=w(n)}if(o.kind!==void 0||o.mode!==void 0||o.lifecycle!==void 0){o.kind!==void 0&&await ge(o.kind);const i=o.kind??d.kind,l=o.mode??d.mode,y=o.lifecycle??d.lifecycle;let f;l==="orchestrator"&&!pn(n)&&(f=a(()=>{const c=fn(n);un(n,c!==null&&c.trim()!==""?{goal:c.trim()}:{})},"beforePersist")),d=await B(n,{...o.kind!==void 0?{kind:i}:{},...o.mode!==void 0?{mode:l}:{},...o.lifecycle!==void 0?{lifecycle:y}:{}},f)}o.name!==void 0&&(d=N(n,{name:o.name}),d.window&&mn(d.window,En(d)));const u=["scopes","situational_context","model","kind","mode","lifecycle","name","listen"].filter(i=>o[i]!==void 0);return I(e,n,u,s===void 0?void 0:i=>{Y(i,"UPDATE objects SET listen_json = ? WHERE id = ? AND type = 'node'").run(s,n)}),{status:200,body:g(n)}}a(Nt,"handleConfig");async function _e(){return(await ie(process.cwd(),ve()||null)).kinds}a(_e,"daemonKinds");async function ge(e){const t=Object.keys(await _e());if(!t.includes(e))throw p(`unknown kind: ${e}`,{received:e,next:`Valid kinds: ${t.sort().join(", ")}.`})}a(ge,"assertKindServer");async function At(){const e=await _e();return{status:200,body:{kinds:Object.keys(e).sort().map(n=>({kind:n,when_to_use:e[n]?.whenToUse??null,available_to:e[n]?.availableTo??null}))}}}a(At,"handleListKinds");const Ko=[{method:"POST",pattern:"/v1/nodes",scope:"crtr:act",handler:ot},{method:"GET",pattern:"/v1/nodes",handler:dt},{method:"GET",pattern:"/v1/kinds",handler:a(()=>At(),"handler")},{method:"POST",pattern:"/v1/nodes/revive-all",scope:"crtr:act",handler:Rt},{method:"GET",pattern:"/v1/nodes/:id",handler:st},{method:"GET",pattern:"/v1/nodes/:id/snapshot",handler:at},{method:"GET",pattern:"/v1/nodes/:id/subject",handler:lt},{method:"GET",pattern:"/v1/nodes/:id/messages",handler:ft},{method:"GET",pattern:"/v1/nodes/:id/session",handler:ut},{method:"GET",pattern:"/v1/nodes/:id/transcript",handler:pt},{method:"GET",pattern:"/v1/nodes/:id/context",handler:mt},{method:"POST",pattern:"/v1/nodes/:id/fork",scope:"crtr:act",handler:wt},{method:"POST",pattern:"/v1/nodes/:id/revive",scope:"crtr:act",handler:yt},{method:"POST",pattern:"/v1/nodes/:id/relaunch-root",scope:"crtr:act",handler:_t},{method:"POST",pattern:"/v1/nodes/:id/close",handler:gt},{method:"POST",pattern:"/v1/nodes/:id/recycle",scope:"crtr:act",handler:bt},{method:"POST",pattern:"/v1/nodes/:id/demote",scope:"crtr:act",handler:vt},{method:"POST",pattern:"/v1/nodes/:id/promote",scope:"crtr:act",handler:kt},{method:"POST",pattern:"/v1/nodes/:id/yield",scope:"crtr:act",handler:St},{method:"POST",pattern:"/v1/nodes/:id/wait",handler:Ot},{method:"PATCH",pattern:"/v1/nodes/:id/config",handler:Nt}];export{Nt as handleConfig,ot as handleCreate,wt as handleFork,dt as handleList,kt as handlePromote,St as handleYield,Ko as nodeRoutes,zo as resolveCreateKind};
@@ -0,0 +1,2 @@
1
+ import type { RouteTable } from '../router.js';
2
+ export declare const objectRoutes: RouteTable;
@@ -0,0 +1,2 @@
1
+ var Z=Object.defineProperty;var f=(e,r)=>Z(e,"name",{value:r,configurable:!0});import{prepared as J}from"../../../core/sqlite-statements.js";import{ApiError as g}from"../../../api/errors.js";import{PRIVACY_LEVELS_DTO as K}from"../../../api/dto/objects.js";import{openDb as A,withCanvasWrite as b}from"../../../core/canvas/db.js";import{actorOf as $}from"../../../core/graph/documents.js";import{readerForObject as F}from"../../../core/graph/reader.js";import{canRead as U}from"../../../core/graph/access.js";import{customObjectRef as I,authorizeCustom as S,fenceArgv as C}from"./custom-objects.js";import{edgesOf as Y}from"../../../core/graph/edges.js";import{publish as B}from"../../../core/graph/events.js";import{objectDTO as a}from"../../../core/graph/kinds/dto.js";import{isKind as Q,kindNames as X,kindOf as D}from"../../../core/graph/kinds/registry.js";import{listObjects as x,searchObjects as L}from"../../../core/graph/objects.js";import{checkoutsForCwd as ee}from"../../../core/graph/repo-sync/repos.js";import{recordWatch as te,unwatch as re,watchersOf as ne,watchesOf as oe}from"../../../core/graph/watches.js";import{readerFor as m,resolveRef as P}from"../reader.js";import{invalidRequest as E,isRecord as v}from"./validate.js";const W=f(e=>r=>ee(e,r),"reposFnFor");function z(e,r){return{...a(e,r),...D(e,r.type).listItem?.(e,r)}}f(z,"listItem");function ie(e){return`no object named ${e} on this runtime; it may be on another runtime, or the name may be misspelled`}f(ie,"remoteMessage");function G(e,r,t){try{return k(e,r,t)}catch(o){if(o instanceof g&&o.code==="not_found"&&!o.details?.deleted)return null;throw o}}f(G,"ownerFilter");function k(e,r,t){const o=P(e,r,t);if("remote"in o)throw new g(404,"not_found",ie(o.remote),{next:"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});return o}f(k,"liveRef");const O=f(e=>decodeURIComponent(e.params.ref),"refParam");function se(e){const r=["1","true"].includes(e.query.get("fields")??"");return b(t=>{const o=m(t,e),n=P(t,o,O(e));if("remote"in n)return{state:"remote",remote:n.remote};if("deleted"in n)return{state:"deleted",deleted:a(t,n.deleted)};const{data:i,text:s}=D(t,n.type).read(t,o,n,{fields:r,reposFn:W(t)});return{state:"object",type:n.type,object:a(t,n),text:s,data:i}})}f(se,"read");function q(e,r,t,o){if(e!=null){if(!t.includes(e)){o.push({field:r,problem:`must be one of ${t.join(", ")}`,received:e});return}return e}}f(q,"oneOf");function V(e,r,t){if(r!=null){if(typeof r!="string"||!Q(e,r)){t.push({field:"type",problem:`must be a kind: one of ${X(e).join(", ")}`,received:r});return}return r}}f(V,"kindName");function H(e,r,t,o){if(e==null)return o;const n=Number(e);return!Number.isInteger(n)||n<1||n>100?(t.push({field:r,problem:"must be an integer from 1 to 100",received:e}),o):n}f(H,"limitOf");function ce(e){const r=e.query,t=[],o=V(A(),r.get("type"),t),n=q(r.get("privacy"),"privacy",K,t),i=H(r.get("limit"),"limit",t,50),s=r.get("cursor");s!==null&&!/^\d+$/.test(s)&&t.push({field:"cursor",problem:"is not a cursor from a previous page",received:s});const c=r.get("deleted");return c!==null&&!["0","1","true","false"].includes(c)&&t.push({field:"deleted",problem:"must be true or false",received:c}),t.length>0&&E("object list request",t),b(u=>{const d=m(u,e),p={...o?{type:o}:{},...n?{privacy:n}:{},...r.get("kind")!==null?{kind:r.get("kind")}:{},...c==="1"||c==="true"?{deleted:!0}:{}},h=r.get("owner");if(h!==null){const y=G(u,d,h);if(y===null)return{items:[],next_cursor:null};p.owner=y}const _=r.get("name"),w=[];let l=s===null?0:Number(s),T=!0;for(;w.length<i&&T;){const y=x(u,d,p,{limit:100,after_rowid:l});T=y.length===100;for(const R of y)if(l=R.rowid,(_===null||R.name.startsWith(_))&&w.push(R),w.length===i)break}const N=w.at(-1);return{items:w.map(y=>z(u,y)),next_cursor:w.length===i&&N?String(N.rowid):null}})}f(ce,"list");function ue(e){const r=[],t=v(e.body)?e.body:{};v(e.body)||r.push({field:"body",problem:"must be an object",received:e.body});const o=t.text;(typeof o!="string"||o.trim()==="")&&r.push({field:"text",problem:"is required",received:o});const n=t.grep;if(n!==void 0)if(typeof n!="string")r.push({field:"grep",problem:"must be a regular expression string",received:n});else try{new RegExp(n)}catch(c){r.push({field:"grep",problem:`is not a valid regular expression: ${c.message}`,received:n})}t.body!==void 0&&typeof t.body!="boolean"&&r.push({field:"body",problem:"must be a boolean",received:t.body});const i=V(A(),t.type,r);t.kind!==void 0&&typeof t.kind!="string"&&r.push({field:"kind",problem:"must be a string",received:t.kind}),t.owner!==void 0&&typeof t.owner!="string"&&r.push({field:"owner",problem:"must be a string",received:t.owner});const s=H(t.limit,"limit",r,50);return r.length>0&&E("object search request",r),b(c=>{const u=m(c,e),d=typeof t.owner=="string"?G(c,u,t.owner):null;if(typeof t.owner=="string"&&d===null)return{items:[]};const p=L(c,u,{text:o,body:t.body===!0||typeof n=="string"}),h=new Set(p.map(l=>l.object.rowid));return{items:(typeof n=="string"?L(c,u,{text:n,grep:!0}).filter(l=>h.has(l.object.rowid)):p).filter(l=>(!i||l.object.type===i)&&(t.kind===void 0||l.object.kind===t.kind)&&(!d||l.object.owner===d.rowid)).slice(0,s).map(l=>({object:z(c,l.object),...l.line!==void 0?{matches:[{line:l.line,text:l.text??""}]}:{}}))}})}f(ue,"search");const M=["interrupt","steer","after-turn","next-turn"],fe=/^(\*|>|[A-Za-z0-9_-]+)(\.(\*|>|[A-Za-z0-9_-]+))*$/;function de(e,r){if(e!==void 0){if(!Array.isArray(e)||e.length===0||e.some(t=>typeof t!="string"||!fe.test(t)||t.includes(">")&&!t.endsWith(">"))){r.push({field:"patterns",problem:"must be a non-empty list of event patterns (dot-separated words, `*` for one word, a final `>` for the rest)",received:e});return}return e}}f(de,"patternsOf");function le(e,r){if(e===void 0)return;if(!v(e)||Object.keys(e).length===0){r.push({field:"config",problem:"must map levels 1-10 to a delivery",received:e});return}const t=[];for(const[o,n]of Object.entries(e)){const i=Number(o);!Number.isInteger(i)||i<1||i>10?r.push({field:`config.${o}`,problem:"level must be an integer from 1 to 10"}):M.includes(n)?t.push({threshold:i,delivery:n}):r.push({field:`config.${o}`,problem:`delivery must be one of ${M.join(", ")}`,received:n})}return t.sort((o,n)=>n.threshold-o.threshold)}f(le,"configOf");function ae(e){const r=[],t=e.body===void 0?{}:v(e.body)?e.body:(r.push({field:"body",problem:"must be an object"}),{}),o=de(t.patterns,r),n=le(t.config,r);return t.filter!==void 0&&!v(t.filter)&&r.push({field:"filter",problem:"must be an object",received:t.filter}),t.watcher!==void 0&&typeof t.watcher!="string"&&r.push({field:"watcher",problem:"must be a custom-object ref",received:t.watcher}),r.length>0&&E("watch request",r),b(i=>{const s=typeof t.watcher=="string"?I(i,t.watcher):null;if(e.publishToken&&!s)throw new g(404,"not_found","watcher not found");if(e.principal.class==="anonymous"&&!s)throw new g(404,"not_found","watcher not found");const c=s?S(i,e,s):$(m(i,e));s&&C(i,e,s);const u=s?F(i,s):m(i,e),d=s?(()=>{const h=k(i,u,O(e));if(!U(i,u,h))throw new g(404,"not_found","object not found");return h})():k(i,u,O(e)),p=o??[">"];return te(i,s??c,d,s?"act":"ask",{patterns:p,...n?{config:n}:{},...t.filter!==void 0?{filter:t.filter}:{}}),B(i,{event:"watched",object:d,actor:c,attrs:{}},W(i)),{object:a(i,d),patterns:p}})}f(ae,"watch");function pe(e){const r=e.query.get("pattern"),t=e.query.get("watcher");return b(o=>{const n=t?I(o,t):null;if((e.publishToken||e.principal.class==="anonymous")&&!n)throw new g(404,"not_found","watcher not found");const i=n?S(o,e,n):$(m(o,e));n&&C(o,e,n);const s=n?F(o,n):m(o,e),c=k(o,s,O(e)),u=f(()=>J(o,`SELECT count(*) AS n FROM watch_subscriptions s JOIN watches w ON w.rowid = s.watch
2
+ WHERE w.watcher = ? AND w.object = ?`).get((n??i).rowid,c.rowid).n,"count"),d=u();return re(o,n??i,c,r??void 0),{object:a(o,c),removed:d-u()}})}f(pe,"unwatchRoute");function me(e){const r=[],t=q(e.query.get("type"),"type",["acted-on","links-to","watches"],r),o=q(e.query.get("direction"),"direction",["out","in"],r);return r.length>0&&E("edges request",r),b(n=>{const i=m(n,e),s=k(n,i,O(e)),c=[];if(t!=="watches")for(const u of Y(n,i,s,{...t?{type:t}:{},direction:o??"both"}))c.push({type:u.type,src:a(n,u.src),dst:a(n,u.dst),...u.written_as?{written_as:u.written_as}:{}});if(t===void 0||t==="watches"){const u=[...o!=="in"?oe(n,i,s):[],...o!=="out"?ne(n,i,s):[]];for(const d of u)c.push({type:"watches",src:a(n,d.watcher),dst:a(n,d.object)})}return{items:c}})}f(me,"edges");const j=f(e=>r=>({status:200,body:e(r)}),"ok"),Ie=[{method:"POST",pattern:"/v1/objects/search",handler:j(ue)},{method:"GET",pattern:"/v1/objects/:ref/edges",handler:j(me)},{method:"POST",pattern:"/v1/objects/:ref/watch",handler:j(ae)},{method:"DELETE",pattern:"/v1/objects/:ref/watch",handler:j(pe)},{method:"GET",pattern:"/v1/objects/:ref",handler:j(se)},{method:"GET",pattern:"/v1/objects",handler:j(ce)}];export{Ie as objectRoutes};
@@ -0,0 +1,2 @@
1
+ import type { RouteTable } from '../router.js';
2
+ export declare const packageDocRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var a=Object.defineProperty;var o=(e,t)=>a(e,"name",{value:t,configurable:!0});import{withCanvasWrite as c}from"../../../core/canvas/db.js";import{reconcilePackageDocuments as r}from"../../../core/graph/package-docs.js";const i=[{method:"POST",pattern:"/v1/documents/reconcile-packages",handler:o(()=>({status:200,body:c(e=>r(e))}),"handler")}];export{i as packageDocRoutes};
@@ -0,0 +1,11 @@
1
+ import { listProfiles, type ProfileEntry } from '../../../core/profiles/manifest.js';
2
+ import { type RequestContext, type RouteTable } from '../router.js';
3
+ /** Rename a profile's manifest name and its live canvas profile object's handle as one unit, so
4
+ * `[[name/x]]` links, `owner=` listings and `--owner profile:<name>` follow the new name. The
5
+ * object is renamed first inside the canvas transaction, which refuses with `conflict` before
6
+ * anything is written when another live profile object holds the handle; a manifest failure then
7
+ * rolls the object rename back. */
8
+ export declare function renameProfileAndHandle(profileId: string, name: string): ProfileEntry;
9
+ /** One visible profile by exact id or unique name; a miss or an invisible profile is 404. */
10
+ export declare function requireUsableProfile(ctx: RequestContext, name: string): ReturnType<typeof listProfiles>[number];
11
+ export declare const profileRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var I=Object.defineProperty;var i=(t,e)=>I(t,"name",{value:e,configurable:!0});import{assertLaunchKind as v}from"../../../core/runtime/launch-target.js";import{listNodesByProfile as h,shiftProfileNodeDeadlines as T}from"../../../core/canvas/canvas.js";import{liveExecutionForNode as k}from"../../../core/canvas/executions.js";import{shiftAutoBackgroundBashDeadlines as D}from"../../../core/bash-jobs.js";import{contextDir as q}from"../../../core/canvas/node-agent-paths.js";import{boundFleet as N}from"../../../core/runtime/fleet.js";import{recordedPidLiveness as O}from"../../../core/canvas/pid.js";import{withCanvasWrite as L}from"../../../core/canvas/db.js";import{renameProfileObject as M}from"../../../core/graph/objects.js";import{usage as l}from"../../../core/errors.js";import{ApiError as p}from"../../../api/errors.js";import{scopeAllowed as b}from"../../../core/scopes.js";import{validateEnvVarName as S}from"../../../core/env-name.js";import{listProfileEnvNames as V,removeProfileEnvVar as $,setProfileEnvVar as F}from"../../../core/profiles/env-store.js";import{listAppEnvNames as R,removeAppEnvVar as G,setAppEnvVar as U}from"../../../core/profiles/app-env-store.js";import{addProfileProject as B,assertDeliveryLimits as C,setProfileDeliveryLimit as K,assertProfileProjects as y,createProfile as P,ensureRootProfile as H,listProfiles as u,loadProfileManifest as _,pauseProfile as W,removeProfileProject as z,renameProfile as J,resumeProfile as Q,setProfileDefaultKind as X,updateProfileMetadata as Y}from"../../../core/profiles/manifest.js";import{requestProfileDeletion as Z}from"../../profile-delete.js";import{brokerSignalBus as x}from"../../broker-signals/bus.js";import{toProfileDTO as d}from"../map.js";import{resolvedScopes as ee}from"../router.js";const w="root";function m(t){return t.principal.class==="person"?"app:terminal":t.principal.app}i(m,"callerApp");function E(t,e,n=null){if(u().some(r=>r.manifest.name===e&&r.profileId!==n&&(r.manifest.grantee??"app:terminal")===t))throw new p(400,"invalid_request",`${t} already has a profile named ${e}`)}i(E,"assertNameFree");function f(t,e){const n=j(t,e),r=n.manifest.grantee??"app:terminal";if(t.principal.class!=="person"&&r!==t.principal.app)throw new p(403,"permission_error",`profile ${n.profileId} belongs to ${r}; only that app changes it`);return n}i(f,"requireOwnProfile");async function te(t){const e=t.body??{};if(typeof e.name!="string"||e.name.trim()==="")throw l("a profile name is required",{field:"name"});e.projects!==void 0&&y(e.projects);const n=m(t),r=e.name.trim();E(n,r),e.default_kind!==void 0&&await v(e.default_kind,process.cwd(),null);const o=P(r,e.projects??[],{defaultKind:e.default_kind,metadata:e.metadata,grantee:n});return{status:201,body:d(o)}}i(te,"handleCreate");function re(t,e){const n=e.trim();if(n==="")throw l("profile name must not be empty");return L(r=>(M(r,t,n),J(t,n)))}i(re,"renameProfileAndHandle");async function ne(t){const{profileId:e,manifest:n}=f(t,t.params.name),r=t.body??{};return r.name!==void 0&&E(n.grantee??"app:terminal",r.name.trim(),e),r.default_kind!==void 0&&await v(r.default_kind,process.cwd(),e),r.add_project!==void 0&&y([r.add_project]),r.set_delivery_limit!==void 0&&C({[r.set_delivery_limit.owner]:r.set_delivery_limit.level}),r.name!==void 0&&re(e,r.name),r.default_kind!==void 0&&X(e,r.default_kind),r.add_project!==void 0&&B(e,r.add_project.path),r.set_delivery_limit!==void 0&&K(e,r.set_delivery_limit.owner,r.set_delivery_limit.level),r.remove_project!==void 0&&z(e,r.remove_project),{status:200,body:d(_(e))}}i(ne,"handleUpdate");function ae(t){const{profileId:e}=f(t,t.params.name);return{status:200,body:{profile_id:e,names:V(e)}}}i(ae,"handleEnvList");function c(t){const e=t.params.var,n=S(e);if(!n.isValid)throw l(`invalid env var name: ${n.errors.join("; ")}`,{field:"name",received:e});return e}i(c,"requireEnvVarName");function ie(t){const{profileId:e}=f(t,t.params.name),n=c(t),{value:r}=t.body??{};if(typeof r!="string"||r==="")throw l("a non-empty env value is required",{field:"value"});return{status:200,body:{profile_id:e,changed:F(e,n,r)}}}i(ie,"handleEnvSet");function oe(t){const{profileId:e}=f(t,t.params.name),n=c(t);return{status:200,body:{profile_id:e,changed:$(e,n)}}}i(oe,"handleEnvRemove");async function se(t){const e=t.params.name,n=t.body??{};n.projects!==void 0&&y(n.projects);const r=m(t);if(e===w&&r==="app:terminal")return{status:200,body:d(H())};if(e===w)throw new p(403,"permission_error","root belongs to the terminal app");const o=u().find(s=>s.manifest.name===e&&(s.manifest.grantee??"app:terminal")===r);if(o!==void 0)return{status:200,body:d(o)};n.default_kind!==void 0&&await v(n.default_kind,process.cwd(),null);const a=P(e,n.projects??[],{defaultKind:n.default_kind,metadata:n.metadata,grantee:r});return{status:200,body:d(a)}}i(se,"handleEnsure");function de(t){const e=f(t,t.params.name),n=t.body??{};if(typeof n!="object"||n===null||Array.isArray(n))throw l("profile metadata body must be an object",{field:"body"});const r=n,o=r.unset===void 0?[]:r.unset;if(!Array.isArray(o)||o.some(A=>typeof A!="string"))throw l("profile metadata `unset` must be an array of strings",{field:"unset"});const a=r.set===void 0?{}:r.set,s=Y(e.profileId,a,o);return{status:200,body:d(s)}}i(de,"handleSetMetadata");function le(t){const e=_(t.params.name),n=W(e.profileId),r=h(e.profileId).filter(a=>a.status==="active"||a.status==="idle");if(r.length===0)return{status:200,body:{profile_id:e.profileId,paused_at:n.manifest.paused_at}};const o=N();for(const a of r){const s=o.get(a.node_id);if(s!==void 0){o.interruptForProfilePause(a.node_id,s.pid);continue}a.pi_pid!=null&&O(a.pi_pid,a.pi_pid_identity)==="alive"&&o.interruptForProfilePause(a.node_id,a.pi_pid)}return{status:200,body:{profile_id:e.profileId,paused_at:n.manifest.paused_at}}}i(le,"handlePause");function fe(t){const e=_(t.params.name),n=Q(e.profileId);for(const r of h(e.profileId))(r.status==="active"||r.status==="idle"||k(r.node_id)!==null)&&x.markMail(r.node_id);if(n.pausedAt!==null){const r=Date.parse(n.pausedAt);if(!Number.isNaN(r)){const o=Math.max(0,Date.now()-r);T(e.profileId,o);for(const a of h(e.profileId))a.status!=="dead"&&D(q(a.node_id),o)}}return{status:200,body:{profile_id:e.profileId,paused_at:n.manifest.paused_at}}}i(fe,"handleResume");function g(t){const e=t.principal;if(e.class==="person")return u();const n=ee(e);return u().filter(({profileId:r,manifest:o})=>{const a=o.grantee??"app:terminal";if(a===e.app)return!0;const s=`crtr:memory:rw:${a}:profile:${r}`;return b(n,s)&&(e.class!=="broker"||b(e.scopes,s))})}i(g,"visibleProfiles");function j(t,e){const n=g(t),r=n.find(({profileId:a})=>a===e),o=r?[r]:n.filter(({manifest:a})=>a.name===e);if(o.length===0)throw new p(404,"not_found","profile not found");if(o.length>1)throw new p(400,"ambiguous","profile name matches multiple visible profiles; use an exact id");return o[0]}i(j,"requireUsableProfile");function pe(t){return{status:200,body:g(t).map(d)}}i(pe,"handleList");function me(t){return{status:200,body:d(j(t,t.params.name))}}i(me,"handleGet");async function ue(t){return Z(f(t,t.params.name).profileId,t.body)}i(ue,"handleDelete");const Se=[{method:"GET",pattern:"/v1/apps/self/env",handler:i(t=>({status:200,body:{names:R(m(t))}}),"handler")},{method:"PUT",pattern:"/v1/apps/self/env/:var",handler:i(t=>{const e=c(t),{value:n}=t.body??{};if(typeof n!="string"||!n)throw l("a non-empty env value is required",{field:"value"});return{status:200,body:{changed:U(m(t),e,n)}}},"handler")},{method:"DELETE",pattern:"/v1/apps/self/env/:var",handler:i(t=>({status:200,body:{changed:G(m(t),c(t))}}),"handler")},{method:"PUT",pattern:"/v1/profiles/:name",handler:se},{method:"POST",pattern:"/v1/profiles/:name/pause",ownerOnly:!0,handler:le},{method:"POST",pattern:"/v1/profiles/:name/resume",ownerOnly:!0,handler:fe},{method:"PATCH",pattern:"/v1/profiles/:name/metadata",handler:de},{method:"POST",pattern:"/v1/profiles",handler:te},{method:"PATCH",pattern:"/v1/profiles/:name",handler:ne},{method:"GET",pattern:"/v1/profiles/:name/env",handler:ae},{method:"PUT",pattern:"/v1/profiles/:name/env/:var",handler:ie},{method:"DELETE",pattern:"/v1/profiles/:name/env/:var",handler:oe},{method:"DELETE",pattern:"/v1/profiles/:name",handler:ue},{method:"GET",pattern:"/v1/profiles",handler:pe},{method:"GET",pattern:"/v1/profiles/:name",handler:me}];export{Se as profileRoutes,re as renameProfileAndHandle,j as requireUsableProfile};
@@ -0,0 +1,2 @@
1
+ import type { RouteTable } from '../router.js';
2
+ export declare const prospectiveChatInventoryRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var u=Object.defineProperty;var a=(e,n)=>u(e,"name",{value:n,configurable:!0});import{ApiError as m}from"../../../api/errors.js";import{usage as p}from"../../../core/errors.js";import{resolveLaunchTarget as y}from"../../../core/runtime/launch-target.js";import{runProspectiveInventory as h}from"../../../core/runtime/prospective-inventory.js";const c=new Map;function l(e,n){const o=e.query.getAll(n);if(o.length>1)throw p(`${n} must appear at most once`);return o[0]}a(l,"singleQueryValue");async function w(e){for(const[s]of e.query)if(s!=="profile"&&s!=="cwd"&&s!=="kind")throw p(`unknown prospective inventory query parameter: ${s}`);const n=l(e,"profile"),o=l(e,"cwd"),i=l(e,"kind");if(i!==void 0&&i.trim()==="")throw p("kind must be a non-empty string when provided");const t=await y({root:!0,...n!==void 0?{profile:n}:{},...o!==void 0?{cwd:o}:{},...i!==void 0?{kind:i}:{}},{readOnlyProfileSelection:!0}),d=JSON.stringify([t.profileId,t.cwd,t.kind]);let r=c.get(d);r===void 0&&(r=h({cwd:t.cwd,profileId:t.profileId,extensions:t.launch.extensions}),c.set(d,r),r.finally(()=>{c.get(d)===r&&c.delete(d)}).catch(()=>{}));let f;try{f=await r}catch{throw new m(503,"preflight_failed","prospective chat inventory preflight failed")}return{status:200,body:{profile_id:t.profileId,cwd:t.cwd,commands:f.commands,memory_refs:f.memory_refs}}}a(w,"handleGet");const q=[{method:"GET",pattern:"/v1/prospective-chat-inventory",handler:w}];export{q as prospectiveChatInventoryRoutes};
@@ -0,0 +1,70 @@
1
+ import type { ServerResponse } from 'node:http';
2
+ import { type RequestPrincipal, type RouteTable } from '../router.js';
3
+ import type { AppPrincipal } from '../principal.js';
4
+ export declare const PROVIDER_OPERATIONS: Set<string>;
5
+ /** Who is calling, normalized across listeners. `resolved` is the caller's
6
+ * resolved scope set read at call time (the grant mirror, so a grant sync
7
+ * changes the answer for a running broker, D3-TOK-21); `null` = the person,
8
+ * who holds every group (contract 1 OWN-4). `nodeScopes` is a broker node's
9
+ * own narrowing list (`null` = none). */
10
+ export interface ProviderCaller {
11
+ class: 'person' | 'app' | 'broker';
12
+ /** The user on whose behalf; `null` for a person on the socket (R2 resolves it). */
13
+ sub: string | null;
14
+ grantee: string | null;
15
+ client_id: string | null;
16
+ resolved: readonly string[] | null;
17
+ nodeScopes: readonly string[] | null;
18
+ run_id: string | null;
19
+ node_id: string | null;
20
+ }
21
+ export declare function callerFromRequest(principal: RequestPrincipal): ProviderCaller;
22
+ export declare function callerFromApp(principal: AppPrincipal): ProviderCaller;
23
+ /** Does the caller hold `<provider>:<group>`? Both the resolved set and a
24
+ * broker's node list must cover it. */
25
+ export declare function callerAllows(caller: ProviderCaller, scope: string): boolean;
26
+ /** Throws `scope_missing` naming `<provider>:<group>` unless the caller holds it (D2-PRV-10). */
27
+ export declare function requireGroup(caller: ProviderCaller, provider: string, group: string): void;
28
+ /** v0 = no directory configured: both rows answer `not_found` (D3-V0-1). */
29
+ export declare function providerOperationsEnabled(): boolean;
30
+ export interface ProviderCallInput {
31
+ provider: string;
32
+ tool: string;
33
+ arguments: Record<string, unknown>;
34
+ version?: number;
35
+ /** Outside a run, the answered approval question the repeat names (R5). */
36
+ approval?: string;
37
+ }
38
+ export declare function parseProvider(value: unknown): string;
39
+ export declare function parseCallInput(body: unknown): ProviderCallInput;
40
+ /** Per-request context the call path needs: the audit `request_id` (also the
41
+ * `Crtr-Request-Id` a provider receives) and the signal that aborts the call
42
+ * when the caller's socket closes (R9). */
43
+ export interface ProviderRequest {
44
+ requestId: string;
45
+ signal: AbortSignal;
46
+ }
47
+ export interface ProviderInput {
48
+ params: Record<string, string>;
49
+ body: unknown;
50
+ query?: URLSearchParams;
51
+ }
52
+ /** Dispatch one provider operation. Throws `ProviderError`/`RunError`; the listener renders it with `providerErrorBody`. */
53
+ export declare function handleProviderOperation(name: string, caller: ProviderCaller, input: ProviderInput, request: ProviderRequest): Promise<{
54
+ status: number;
55
+ body: unknown;
56
+ }>;
57
+ /** An `AbortController` tied to the response: closing the caller's socket aborts the call. */
58
+ export declare function abortOnClose(res: ServerResponse): {
59
+ signal: AbortSignal;
60
+ release: () => void;
61
+ };
62
+ /** Render a thrown value as the contract-2 envelope; a non-`RunError` is logged as a 500.
63
+ * `directoryCaller`: true on the app listener (a directory-token caller), false on the socket. */
64
+ export declare function providerFailure(error: unknown, requestId: string, directoryCaller: boolean, runId?: string | null): {
65
+ status: number;
66
+ body: unknown;
67
+ headers: Record<string, string>;
68
+ };
69
+ /** Socket routes (person, broker). The router has already checked the caller class. */
70
+ export declare const providerRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var A=Object.defineProperty;var s=(e,r)=>A(e,"name",{value:r,configurable:!0});import{randomUUID as E}from"node:crypto";import{readConfig as P}from"../../../core/config.js";import{activeGrantForApp as I,allGrants as h}from"../../../core/grants/mirror.js";import{getNode as R}from"../../../core/canvas/canvas.js";import{scopeAllowed as O}from"../../../core/scopes.js";import{ProviderError as u,providerErrorBody as $,scopeMissing as q}from"../../../core/providers/errors.js";import{callProvider as x,providerTools as G}from"../../../core/providers/call.js";import{providerIdsFromGrants as N,providerInstallState as T}from"../../../core/providers/bundles.js";import{listInstalledPlugins as F}from"../../../core/resolver.js";import{listAudit as j,writeProviderAudit as C}from"../../../core/providers/audit.js";import{emitEvent as g}from"../../../core/events/emit.js";import{resolvedScopes as D}from"../router.js";const fe=new Set(["provider.tools","provider.call","audit.list"]);function M(e){if(e.class==="person")return{class:"person",sub:null,grantee:null,client_id:null,resolved:null,nodeScopes:null,run_id:null,node_id:null};if(e.class==="app"){const r=I(e.app);if(!r)throw new u("grant_revoked",`app ${e.app} has no active grant`);return{class:"app",sub:r.sub,grantee:e.app,client_id:null,resolved:r.resolved,nodeScopes:e.scopes,run_id:null,node_id:null}}return{class:"broker",sub:e.sub,grantee:e.app,client_id:e.client_id,resolved:D(e),nodeScopes:e.scopes,run_id:e.run??R(e.node)?.run_id??null,node_id:e.node}}s(M,"callerFromRequest");function pe(e){return{class:"app",sub:e.sub,grantee:e.grantee,client_id:e.client_id,resolved:e.resolved,nodeScopes:null,run_id:null,node_id:null}}s(pe,"callerFromApp");const U=/^([A-Za-z0-9_-]{1,64}):([A-Za-z0-9_-]{1,64})$/;function k(e){const r=U.exec(e);return r!==null&&r[1]!=="crtr"}s(k,"isProviderScope");const w=new WeakMap;function z(e){let r=w.get(e);return r===void 0&&(r=new Set(e),w.set(e,r)),r}s(z,"heldSet");function _(e,r){return e===null?!0:k(r)?z(e).has(r):O(e,r)}s(_,"holds");function y(e,r){return e.class==="person"?!0:_(e.resolved??[],r)&&_(e.nodeScopes,r)}s(y,"callerAllows");function ce(e,r,t){const n=`${r}:${t}`;if(!y(e,n))throw q(n)}s(ce,"requireGroup");function L(){return!!P("user").runtime?.issuer}s(L,"providerOperationsEnabled");const V=/^[A-Za-z0-9_-]{1,64}$/;function c(e,r){return new u("invalid_request",e,{param:r})}s(c,"invalid");function S(e){if(typeof e!="string"||!V.test(e)||e==="crtr")throw c("provider must be a provider id","provider");return e}s(S,"parseProvider");function Z(e){if(!e||typeof e!="object"||Array.isArray(e))throw new u("invalid_request","a JSON object is required");const r=e,t=S(r.provider),n=r.tool;if(typeof n!="string"||!n.trim())throw c("tool must be a non-empty string","tool");const i=r.arguments??{};if(!i||typeof i!="object"||Array.isArray(i))throw c("arguments must be an object","arguments");const d=r.version;if(d!==void 0&&(typeof d!="number"||!Number.isInteger(d)||d<1))throw c("version must be an integer >= 1","version");const o=r.approval;if(o!==void 0&&(typeof o!="string"||!o))throw c("approval must be a question id","approval");return{provider:t,tool:n.trim(),arguments:i,...d===void 0?{}:{version:d},...o===void 0?{}:{approval:o}}}s(Z,"parseCallInput");function B(e,r=new URLSearchParams){const t=s((o,f,p)=>{const l=r.get(o);if(l===null)return f;if(!/^\d+$/.test(l)||Number(l)>p||Number(l)<1)throw c(`invalid ${o}`,o);return Number(l)},"numeric"),n=r.has("after")?t("after",0,Number.MAX_SAFE_INTEGER):void 0,i=t("limit",100,1e3),d=Object.fromEntries(["operation","outcome","run_id","since","until"].filter(o=>r.has(o)).map(o=>[o,r.get(o)]));return{status:200,body:j(e.class==="person"?null:e.grantee,{after:n,limit:i,...d})}}s(B,"auditList");async function H(e,r,t){const n=performance.now(),i=new Set(F("user").filter(a=>a.enabled&&a.manifest.provider?.id===a.name).map(a=>a.name)),d=N(h()),o=[...new Set([...i,...d])].sort();if(r!==void 0&&!o.includes(r))throw new u("not_found",`provider "${r}" is not available`);const f=r===void 0?o:[r],p=e.class==="person"?h().flatMap(a=>a.status==="active"?a.resolved_scopes.map(({scope:v})=>v):[]):e.resolved??[],l=await Promise.all(f.map(async a=>{if(!p.some(m=>m.startsWith(`${a}:`)&&y(e,m)))return null;if(i.has(a)){const m=await G(e,a);return m.groups.length>0?m:null}const b=T(a);return{provider:a,display_name:a,status:b.status,...b.error?{error:b.error}:{},groups:[],commands:[]}})).then(a=>a.filter(v=>v!==null));if(g({level:"debug",event:"api.provider.tools",duration_ms:performance.now()-n,fields:{caller:e.class,provider:r??null,providers:l.length}}),r!==void 0){if(l.length===0)throw new u("not_found",`provider "${r}" is not available`);return{status:200,body:l[0]}}return{status:200,body:{providers:l}}}s(H,"providerTools");async function W(e,r,t){return x(e,r,t)}s(W,"providerCall");async function J(e,r,t,n){if(!L())throw new u("not_found","provider operations need a directory-connected runtime");if(e==="audit.list")return B(r,t.query);if(e==="provider.tools")return H(r,t.params.provider===void 0?void 0:S(t.params.provider),n);if(e==="provider.call"){let i;try{i=Z(t.body)}catch(d){const o=t.body&&typeof t.body=="object"&&!Array.isArray(t.body)?t.body:{};throw C({request_id:n.requestId,caller:r,provider:typeof o.provider=="string"?o.provider:"",tool:typeof o.tool=="string"?o.tool:"",outcome:`refused:${d instanceof u?d.code:"invalid_request"}`}),d}return W(r,i,n)}throw new u("not_found","unknown operation")}s(J,"handleProviderOperation");function X(e){const r=new AbortController,t=s(()=>{e.writableFinished||r.abort()},"abort");return e.on("close",t),{signal:r.signal,release:s(()=>e.off("close",t),"release")}}s(X,"abortOnClose");function K(e,r,t,n){const i=$(e,r,t,n??void 0);return i.status>=500&&!(e instanceof u)&&g({event:"api.provider.failed",level:"error",error:e instanceof Error?e:new Error(String(e)),fields:{request_id:r}}),i}s(K,"providerFailure");const me=[{method:"GET",pattern:"/v1/audit",name:"audit.list"},{method:"GET",pattern:"/v1/providers/tools",name:"provider.tools"},{method:"GET",pattern:"/v1/providers/:provider/tools",name:"provider.tools"},{method:"POST",pattern:"/v1/provider/call",name:"provider.call"}].map(({method:e,pattern:r,name:t})=>({method:e,pattern:r,handler:s(async n=>{const i=E(),{signal:d,release:o}=X(n.res);let f=null;try{return f=M(n.principal),{...await J(t,f,{params:n.params,body:n.body,query:new URL(n.req.url??"/","http://runtime.local").searchParams},{requestId:i,signal:d}),headers:{"Request-Id":i}}}catch(p){return K(p,i,!1,f?.run_id)}finally{o()}},"handler")}));export{fe as PROVIDER_OPERATIONS,X as abortOnClose,y as callerAllows,pe as callerFromApp,M as callerFromRequest,J as handleProviderOperation,Z as parseCallInput,S as parseProvider,K as providerFailure,L as providerOperationsEnabled,me as providerRoutes,ce as requireGroup};
@@ -0,0 +1,7 @@
1
+ import type { AppPrincipal } from '../principal.js';
2
+ export declare const QUESTION_OPERATIONS: Set<string>;
3
+ /** `question.get` / `question.answer` (daemon-operations §question.*) for an app caller. */
4
+ export declare function handleQuestionOperation(name: string, caller: AppPrincipal, questionId: string, body: unknown): Promise<{
5
+ status: number;
6
+ body: unknown;
7
+ }>;
@@ -0,0 +1 @@
1
+ var g=Object.defineProperty;var o=(e,t)=>g(e,"name",{value:t,configurable:!0});import{validatePageTicketResponses as h}from"../../../core/human/tickets.js";import{getRequest as y}from"../../../core/human/requests.js";import{RunError as a}from"../../../core/runs/operations.js";import{getQuestion as _,questionObject as b,questionResult as v,questionStatus as d}from"../../../core/runs/questions.js";import{answerPageTicket as R}from"../../human/finish.js";import{requireRun as A}from"../router.js";const Q=new Set(["question.get","question.answer"]),f=o(()=>new a(404,"not_found","question not found"),"missing");function l(e,t,n){const r=_(t);if(r===null)throw f();if(r.run===null){if(r.approval?.grantee!==e.grantee||r.approval.sub!==e.sub)throw f()}else try{A(e,r.run.run_id,n)}catch(s){throw s instanceof a&&s.code==="not_found"?f():s}return r}o(l,"reachable");function w(e){const t=y(e);return new a(409,"run_settled",`question ${e} is already ${d(t)}`,void 0,{state:d(t),result:v(t)})}o(w,"settled");function O(e){return/slot(?: id)? "([^"]+)"/.exec(e)?.[1]??"responses"}o(O,"slotParam");async function N(e,t,n,r){if(e==="question.get"){const{request:i,run:c,approval:q}=l(t,n,!1);return{status:200,body:b(i,c,q)}}const{request:s}=l(t,n,!0);if(s.state==="settled")throw w(n);const u=r&&typeof r=="object"&&!Array.isArray(r)?r.responses:void 0;if(!u||typeof u!="object"||Array.isArray(u))throw new a(400,"invalid_request","responses must be an object keyed by slot id","responses");try{h(s.request_dir,u)}catch(i){const c=i instanceof Error?i.message:String(i);throw new a(400,"invalid_request",c,O(c))}const p=await R(s.request_id,u,{actor:t.grantee});if(p.outcome==="already_settled")throw w(n);const m=p.result;return{status:200,body:{question_id:s.request_id,status:"answered",answer:m.responses}}}o(N,"handleQuestionOperation");export{Q as QUESTION_OPERATIONS,N as handleQuestionOperation};
@@ -0,0 +1,6 @@
1
+ import type { ReportDTO } from '../../../api/index.js';
2
+ import type { RouteTable } from '../router.js';
3
+ /** One node's report documents, newest first, read as the person (records nothing). This stays
4
+ * in the daemon so collection projections can include report activity without client-side N+1s. */
5
+ export declare function reportsForNode(id: string): ReportDTO[];
6
+ export declare const reportRoutes: RouteTable;
@@ -0,0 +1,18 @@
1
+ var B=Object.defineProperty;var d=(t,e)=>B(t,"name",{value:e,configurable:!0});import{existsSync as M,rmSync as j}from"node:fs";import{getNode as a}from"../../../core/canvas/canvas.js";import{liveExecutionForNode as J}from"../../../core/canvas/executions.js";import{markStopSignal as z}from"../../../core/runtime/stop-signals.js";import{emitEvent as L}from"../../../core/events/emit.js";import{push as W,FinalizationError as S,StructuredRequestFinalizationError as H}from"../../../core/feed/feed.js";import{branchIsPushedAtCurrentTip as X,hasOpenManagedWorktree as G,missingWorktreeRecoveryHint as K}from"../../../core/worktree.js";import{autoDropCleanManagedWorktreeAsync as U}from"../../../core/worktree-mutation-async.js";import{openDb as V,withCanvasWrite as Y}from"../../../core/canvas/db.js";import{get as Q}from"../../../core/graph/bodies.js";import{heads as Z}from"../../../core/graph/documents.js";import{listObjects as ee,nodeObject as te}from"../../../core/graph/objects.js";import{readerFor as re}from"../../../core/graph/reader.js";import{notFound as ne,usage as f}from"../../../core/errors.js";import{InputError as u}from"../../../core/io.js";import{toReportResultDTO as ie}from"../map.js";import{clearSchemaReprompts as oe,outputDeclinedPath as se,stageStructuredResult as de,structuredRequestResultPath as ae,validateStructuredResult as ue}from"../../../core/runtime/structured-output.js";import{getPendingStructuredRequestForNode as _,getStructuredRequest as R,settleStructuredRequestIn as le}from"../../../core/canvas/structured-requests.js";import{ApiError as p}from"../../../api/errors.js";import{applySettlementEffects as $}from"../../structured-requests/effects.js";import{nodeEventStreams as x}from"./node-events.js";import{emitRunEvent as E}from"../../../core/runs/events.js";function g(t){const e=a(t);if(e===null)throw ne(`unknown node: ${t}`,{received:t});return e}d(g,"requireNode");function ce(t){if(typeof t!="object"||t===null)throw f("a push report requires a JSON body { tier, body }");const e=t.tier,i=t.delivery_tier,r=t.body;if(e!=="update"&&e!=="urgent"&&e!=="final")throw f(`invalid report tier: ${String(e)} (expected update|urgent|final)`);if(i!==void 0&&i!=="deferred"&&i!=="normal"&&i!=="urgent")throw f(`invalid delivery_tier: ${String(i)} (expected deferred|normal|urgent)`);if(e!=="update"&&i!==void 0)throw f("delivery_tier is only valid for update reports");if(typeof r!="string"||r.trim()==="")throw f("a push report requires a non-empty body");return{tier:e,...i===void 0?{}:{delivery_tier:i},body:r}}d(ce,"parsePushBody");async function fe(t){const e=t.params.id;g(e);const i=ce(t.body);if(i.tier==="final"&&_(e)!==null)throw new u({error:"structured_result_pending",message:"This node owes a structured result \u2014 a plain `push final` would finish it without recording one.",next:'Submit the result with the `submit_result` tool instead (or `crtr push result`); it validates against the pending schema, records it, and pushes the final report for you. If the schema cannot be honestly satisfied, call `submit_result` with `decline` (or `crtr push result --decline "<reason>" --code <token>`) to record the decline and finish the node.'});const r=i.tier==="final"?a(e)?.status:void 0,n=i.tier==="final"?await O(e):void 0,o=await b(e,i);i.tier==="final"&&A(e);const s=i.tier==="final"&&r!==void 0?{from:r,to:a(e)?.status??"done"}:void 0,m=ie(o,s,n),l=q(e).find(c=>c.id===o.reportId);if(l!==void 0){x.report(e,l);const c=a(e)?.run_id;c&&E(c,e,"node.report.pushed",{body:l.body,kind:l.tier==="final"?"final":"update"})}return{status:200,body:m}}d(fe,"handlePush");async function O(t){if(!G(a(t)))return;const e=await U(t);if(e!==null)return e.worktree_path;if(!await X(a(t).managed_worktree))throw new u({error:"open_managed_worktree",message:"This node still owns an open managed worktree that is neither clean and locally landed nor clean with its exact tip on origin \u2014 `push final` cannot finish.",next:(()=>{const i=a(t)?.managed_worktree;return i!=null&&i.state==="open"&&!M(i.path)?K(i):"Make the recorded worktree clean, including untracked files: commit work to retain and remove or ignore only disposable generated files. With its recorded branch checked out and no rebase in progress, push its current tip to a branch on origin, then rerun `crtr push final`; or run `crtr node worktree close` to land the clean worktree into its recorded local base."})()})}d(O,"guardFinalWorktree");const I=2e3;function me(t,e){const i=JSON.stringify(e,null,2),r=i.length>I?`${i.slice(0,I)}
2
+ \u2026 (truncated \u2014 the full result is at the result path above)`:i;return`Structured output submitted.
3
+
4
+ Result path: ${t}
5
+
6
+ \`\`\`json
7
+ ${r}
8
+ \`\`\`
9
+ `}d(me,"submitReportBody");function he(t,e){return`Structured result declined.
10
+
11
+ Reason: ${e.reason}
12
+ Code: ${e.code}
13
+ Retryable: ${e.retryable?"yes":"no"}
14
+
15
+ Declined marker: ${t}
16
+ `}d(he,"declineReportBody");const N=1024,T=64;function pe(t,e){if(typeof t!="object"||t===null)throw f("a result submission requires a JSON body { value } or { decline, code, retryable }");const i=t.request_id;if(typeof i!="string"||i.trim()===""){const o=_(e);throw new u({error:"request_id_required",message:`a structured result requires request_id${o===null?"":` (pending request: ${o.request_id})`}`,next:"Pass `--request <request-id>` exactly as named in the structured-output instruction."})}const r=Object.hasOwn(t,"value"),n=Object.hasOwn(t,"decline");if(r&&n)throw f("a result submission carries either { value } or { decline, code, retryable }, not both");if(n){const{decline:o,code:s,retryable:m}=t;if(typeof o!="string"||o.trim()==="")throw new u({error:"missing_decline_reason",message:"A decline needs a reason.",next:'Rerun with `--decline "<one sentence on why the schema cannot be honestly satisfied>" --code <token>`.'});if(o.length>N)throw new u({error:"decline_reason_too_long",message:`A decline reason is at most ${N} characters (got ${o.length}).`,next:"Keep the reason to one plain sentence; put any detail in an artifact and name its path."});if(typeof s!="string"||s.trim()===""||/\s/.test(s.trim())||s.trim().length>T)throw new u({error:"invalid_decline_code",message:`A decline needs a code: one whitespace-free token of at most ${T} characters naming the decline class.`,next:"Rerun with `--code <token>` \u2014 the token your requester documented for this case."});if(typeof m!="boolean")throw f("a decline carries `retryable` as a boolean");return{requestId:i.trim(),declined:{reason:o.trim(),code:s.trim(),retryable:m}}}if(!r)throw f("a result submission requires a JSON body { value } or { decline, code, retryable }");return{requestId:i.trim(),value:t.value}}d(pe,"parseSubmitBody");const we=1024*1024;async function ye(t){const e=t.params.id,i=g(e);_(e)!==null&&oe(e);const r=pe(t.body,e),n=R(r.requestId);if(n===null||n.node_id!==e)throw new p(404,"structured_request_not_found","the named structured request does not belong to this node");if(n.state!=="pending")throw new p(409,n.state==="expired"?"structured_request_expired":"structured_request_settled",`structured request ${n.request_id} is already ${n.state}`);let o;if("value"in r){if(Buffer.byteLength(JSON.stringify(r.value)??"")>we)throw new u({error:"result_too_large",message:"the submitted result is over 1 MiB serialized; nothing was recorded.",next:"Submit a smaller result \u2014 write bulky content to a file and put its path in the result."});try{o=await ue(n.schema,r.value)}catch(c){throw new u({error:"result_schema_mismatch",message:`the submitted result does not match the requested schema: ${c.message}`,next:'Fix the listed fields and submit again; if the schema cannot be honestly satisfied, decline it (`submit_result` with `decline`, or `crtr push result --decline "<reason>" --code <token>`).'})}}const s="declined"in r?se(e,i.grantee):ae(e,n.request_id,n.submission,i.grantee),m="declined"in r?he(s,r.declined):me(s,o),l="value"in r?de(e,n.request_id,n.submission,o,i.grantee):void 0;try{if(n.submission==="oneoff"){const h=Y(D=>le(D,n.request_id,"declined"in r?{intended:"declined",declined:r.declined}:{intended:"completed",result:o}));if(!h.changed||h.row===null||h.row.state!=="completed"&&h.row.state!=="declined")throw new p(409,h.row?.state==="expired"?"structured_request_expired":"structured_request_settled",`structured request ${n.request_id} is already ${h.row?.state??"settled"}`);await $(h.row,l);const y=await b(e,{tier:"update",body:m},void 0,{requestMessageId:n.request_message_id});return P(e,y.reportId),{status:200,body:{mode:n.submission,result_path:s,report:y.report,notified:[...y.deliveredTo],..."declined"in r?{declined:r.declined}:{}}}}const c=a(e)?.status,v=await O(e),F="declined"in r?{kind:"failure",reason:"declined",detailJson:JSON.stringify({schema:"crtr.node-outcome-detail/v1",message:r.declined.reason,declined:r.declined}),structured:{requestId:n.request_id,declined:r.declined,skipEffects:!0}}:{structured:{requestId:n.request_id,value:o,skipEffects:!0}},w=await b(e,{tier:"final",body:m},F);A(e);const C=R(n.request_id);await $(C,l),P(e,w.reportId);const k=c===void 0?void 0:{from:c,to:a(e)?.status??"done"};return{status:200,body:{mode:n.submission,result_path:s,report:w.report,notified:[...w.deliveredTo],..."declined"in r?{declined:r.declined}:{},...k===void 0?{}:{transitioned:k},...v===void 0?{}:{worktree_auto_dropped:!0,worktree_auto_dropped_path:v}}}}finally{l!==void 0&&j(l.tmpPath,{force:!0})}}d(ye,"handleSubmitResult");function P(t,e){const i=q(t).find(n=>n.id===e);if(i===void 0)return;x.report(t,i);const r=a(t)?.run_id;r&&E(r,t,"node.report.pushed",{body:i.body,kind:i.tier==="final"?"final":"update"})}d(P,"emitReportEvents");function A(t){try{const e=J(t);e!==null&&z(t,"pushedFinal",e.executionId)}catch(e){try{L({event:"daemon.node.final-marker.failed",level:"error",node_id:t,error:e})||process.stderr.write(`final marker failed for ${t}: ${String(e)}
17
+ `)}catch{process.stderr.write(`final marker failed for ${t}: ${String(e)}
18
+ `)}}}d(A,"markCommittedFinal");async function b(t,e,i,r){try{return await W(t,{kind:e.tier,body:e.body,...e.delivery_tier===void 0?{}:{deliveryTier:e.delivery_tier},...i===void 0?{}:{outcome:i},...r===void 0?{}:{result:r}})}catch(n){throw n instanceof H?new p(409,n.message,n.message==="structured_request_expired"?"the named structured request expired before this submission committed":"the named structured request is already settled"):n instanceof S&&n.code==="already_finalized"?new u({error:"already_finalized",message:"This node already submitted its canonical final result.",next:"Push an update with the new information, then stop."}):n instanceof S&&n.code==="finalization_forbidden"?new u({error:"finalization_forbidden",message:"A canceled or dead node cannot submit a canonical final result.",next:"Do not push final from this node."}):n}}d(b,"pushOrRethrow");function q(t){const e=V();return ee(e,re(e,{class:"person"},()=>[]),{type:"document",kind:"report",owner:te(e,t)}).map(r=>{const n=r.name.match(/-(update|urgent|final)$/)?.[1]??"update",o=Z(e,r)[0];return{name:r.name,id:r.id,tier:n,body:o===void 0?"":Q(o.body_hash).trim(),created:r.created_at}}).sort((r,n)=>r.created<n.created?1:r.created>n.created?-1:n.name.localeCompare(r.name))}d(q,"reportsForNode");function _e(t){const e=t.params.id;g(e);const i=t.query.get("tier"),r=t.query.get("limit"),n=r!==null?Number(r):void 0;let o=q(e);return i!==null&&(o=o.filter(s=>s.tier===i)),n!==void 0&&Number.isFinite(n)&&n>=0&&(o=o.slice(0,n)),{status:200,body:o}}d(_e,"handleList");const ze=[{method:"POST",pattern:"/v1/nodes/:id/reports",ownerOnly:!0,handler:fe},{method:"GET",pattern:"/v1/nodes/:id/reports",handler:_e},{method:"POST",pattern:"/v1/nodes/:id/result",handler:ye}];export{ze as reportRoutes,q as reportsForNode};
@@ -0,0 +1,2 @@
1
+ import type { RouteTable } from '../router.js';
2
+ export declare const reviewCommentRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var z=Object.defineProperty;var d=(n,t)=>z(n,"name",{value:t,configurable:!0});import{randomUUID as q}from"node:crypto";import{getNode as T}from"../../../core/canvas/canvas.js";import{isSafeNodeId as S}from"../../../core/canvas/paths.js";import{createComment as J,deleteComment as X,editComment as Y,getComment as A,listCommentEvents as Z,listComments as $,listReviewEvents as ee,reopenComment as ne,resolveComment as te}from"../../../core/review/comments.js";import{withCanvasWrite as k}from"../../../core/canvas/db.js";import{captureAnchorText as ie,requireCurrentDocumentLocked as oe}from"../../../core/review/document.js";import{forkReviewComment as re}from"../../../core/review/fork.js";import{applyRangeBatch as de}from"../../../core/review/remap.js";import{getReviewByCompanion as se,requireVisibleReview as f}from"../../../core/review/store.js";import{ReviewOperationError as v}from"../../../core/review/types.js";import{notifyComment as ce}from"../../review/comment-notify.js";import{toReviewCommentDTO as p,toReviewCommentEventDTO as x}from"../map.js";import{invalidRequest as ue,isRecord as I,objectBody as R,requireParam as D,requiredString as P}from"./validate.js";const j=/^[a-f0-9]{32}$/,L=/^[a-f0-9]{64}$/,ae=new Set(["open","resolved","deleted","all"]),me=new Set(["wake","quiet"]);function m(n){ue("review comment request",n)}d(m,"invalidRequest");function le(n,t,e){const i=n[t];if(i!==void 0){if(typeof i!="string"||!L.test(i)){e.push({field:t,problem:"must be a lowercase SHA-256 hex digest",received:i});return}return i}}d(le,"optionalSha256");function M(n,t,e){const i=n[t];if(typeof i!="string"||!L.test(i)){e.push({field:t,problem:"must be a lowercase SHA-256 hex digest",...i===void 0?{}:{received:i}});return}return i}d(M,"requiredSha256");function B(n,t){const e=n.deliver;if(e!==void 0){if(typeof e!="string"||!me.has(e)){t.push({field:"deliver",problem:"must be wake or quiet",received:e});return}return e}}d(B,"optionalDeliver");function fe(n,t){const e=n.if_revision;if(e!==void 0){if(!Number.isSafeInteger(e)||e<0){t.push({field:"if_revision",problem:"must be a non-negative safe integer",received:e});return}return e}}d(fe,"optionalRevision");function F(n,t){const e=n.actor_node_id;return e==null?{kind:"human",node_id:null}:typeof e!="string"||!S(e)?(t.push({field:"actor_node_id",problem:"must be a safe node id or null",received:e}),null):{kind:"node",node_id:e}}d(F,"actorFrom");function G(n,t,e){T(n)===null&&e.push({field:t,problem:"must name an existing node",received:n})}d(G,"requireKnownNode");function N(n,t){n.node_id!==null&&G(n.node_id,"actor_node_id",t)}d(N,"requireKnownActor");function H(n,t,e){if(!I(n)){e.push({field:t,problem:"must be an anchor object",received:n});return}const i=["line","end_line","col_start","col_end","quote"];for(const r of Object.keys(n))i.includes(r)||e.push({field:`${t}.${r}`,problem:"is not allowed",received:n[r]});const o=n.line,s=n.end_line;typeof o!="number"&&e.push({field:`${t}.line`,problem:"must be a number",...o===void 0?{}:{received:o}}),typeof s!="number"&&e.push({field:`${t}.end_line`,problem:"must be a number",...s===void 0?{}:{received:s}});for(const r of["col_start","col_end"]){const c=n[r];c!==void 0&&typeof c!="number"&&e.push({field:`${t}.${r}`,problem:"must be a number",received:c})}if(n.quote!==void 0&&typeof n.quote!="string"&&e.push({field:`${t}.quote`,problem:"must be a string",received:n.quote}),!(typeof o!="number"||typeof s!="number"))return{line:o,end_line:s,...typeof n.col_start=="number"?{col_start:n.col_start}:{},...typeof n.col_end=="number"?{col_end:n.col_end}:{},...typeof n.quote=="string"?{quote:n.quote}:{}}}d(H,"anchorFrom");function w(n,t){return D(n,"review_id","must be a safe review id",S,t)}d(w,"requireReviewId");function C(n,t){return D(n,"comment_id","must be a 32-character lowercase hexadecimal id",e=>j.test(e),t)}d(C,"requireCommentId");function b(n){const t=f(n);if(t.state!=="open")throw new v("review_terminal","review already has a terminal outcome",{state:t.state,requested:"comment",review:t});return t}d(b,"requireOpenReview");function U(n){const t=n===null?void 0:T(n)?.review_binding?.review_id,e=n===null?null:se(n)??(t===void 0?null:f(t));if(e===null||e.state!=="open")throw new v("review_required","an open review is required when no review id is supplied",{actor_node_id:n});return e}d(U,"requireCompanionReview");function he(n){return{comment:p(n),events:Z(n.comment_id).map(x)}}d(he,"toDetail");function _e(n,t){return{attempted:!0,target_node_id:n.companion_node_id,status:"failed",woke:!1,error:t instanceof Error?t.message:String(t)}}d(_e,"deliveryFailure");async function V(n){if(!n.changed)return{comment:p(n.comment),changed:!1};let t;try{t=await ce({review:n.review,comment:n.comment,verb:n.verb,actor_node_id:n.actor.node_id,deliver:n.deliver,operation_id:n.operationId})}catch(e){t=_e(n.review,e)}return{comment:p(n.comment),changed:!0,delivery:t}}d(V,"mutationResult");function ve(n,t){const e=[],i=R(n.body,["text","anchor","doc_hash","actor_node_id","deliver"],e),o=t==="review"?(()=>{const a=w(n,e);return a===void 0?void 0:{kind:"review",review_id:a}})():{kind:"self"},s=P(i,"text",e),r=H(i.anchor,"anchor",e),c=le(i,"doc_hash",e),u=F(i,e),h=B(i,e);return u!==null&&N(u,e),(e.length>0||o===void 0||s===void 0||r===void 0||u===null)&&m(e),{selector:o,text:s,anchor:r,...c===void 0?{}:{doc_hash:c},actor:u,...h===void 0?{}:{deliver:h}}}d(ve,"parseCreate");function pe(n,t){const e=[],i=R(n.body,t?["text","actor_node_id","deliver","if_revision"]:["actor_node_id","deliver","if_revision"],e),o=C(n,e),s=t?P(i,"text",e):void 0,r=F(i,e),c=B(i,e),u=fe(i,e);return r!==null&&N(r,e),(e.length>0||o===void 0||r===null||t&&s===void 0)&&m(e),{comment_id:o,...s===void 0?{}:{text:s},actor:r,...c===void 0?{}:{deliver:c},...u===void 0?{}:{if_revision:u}}}d(pe,"parseAction");function we(n){const t=[],e=R(n.body,["from_doc_hash","to_doc_hash","entries"],t),i=w(n,t),o=M(e,"from_doc_hash",t),s=M(e,"to_doc_hash",t),r=e.entries,c=[];return Array.isArray(r)?r.forEach((u,h)=>{const a=`entries[${h}]`;if(!I(u)){t.push({field:a,problem:"must be an object",received:u});return}for(const g of Object.keys(u))["comment_id","anchor","detached"].includes(g)||t.push({field:`${a}.${g}`,problem:"is not allowed",received:u[g]});const l=u.comment_id;if(typeof l!="string"||!j.test(l)){t.push({field:`${a}.comment_id`,problem:"must be a 32-character lowercase hexadecimal id",received:l});return}const W=u.anchor!==void 0,_=u.detached;_!==void 0&&_!==!0&&t.push({field:`${a}.detached`,problem:"must be true when present",received:_});const E=_===!0;if(W===E){t.push({field:a,problem:"must provide exactly one of anchor or detached: true"});return}if(E){c.push({comment_id:l,detached:!0});return}const O=H(u.anchor,`${a}.anchor`,t);O!==void 0&&c.push({comment_id:l,anchor:O})}):t.push({field:"entries",problem:"must be an array",received:r}),(t.length>0||i===void 0||o===void 0||s===void 0||!Array.isArray(r))&&m(t),{review_id:i,request:{from_doc_hash:o,to_doc_hash:s,entries:c}}}d(we,"parseRangeBatch");function be(n,t,e){for(const[r,c]of n.query)r!=="status"&&(r!=="actor_node_id"||t!=="self")&&e.push({field:r,problem:"is not allowed",received:c});const i=n.query.getAll("status");(i.length>1||i.length===1&&!ae.has(i[0]))&&e.push({field:"status",problem:"must be open, resolved, deleted, or all",received:i.length>1?i:i[0]});const o=n.query.getAll("actor_node_id");let s=null;if(o.length>1)e.push({field:"actor_node_id",problem:"must appear at most once",received:o});else if(o.length===1){const r=o[0];S(r)?(s=r,G(r,"actor_node_id",e)):e.push({field:"actor_node_id",problem:"must be a safe node id",received:r})}return{...i.length===0?{}:{status:i[0]},actor_node_id:s}}d(be,"parseListQuery");function ye(n,t){const e={};for(const[i,o]of n.query)i!=="since_seq"&&i!=="limit"&&t.push({field:i,problem:"is not allowed",received:o});for(const i of["since_seq","limit"]){const o=n.query.getAll(i);if(o.length>1){t.push({field:i,problem:"must appear at most once",received:o});continue}if(o.length===0)continue;const s=o[0],r=Number(s);if(!Number.isSafeInteger(r)||r<0||String(r)!==s){t.push({field:i,problem:"must be a non-negative safe integer",received:s});continue}e[i]=r}return e.limit!==void 0&&e.limit<1&&t.push({field:"limit",problem:"must be at least 1",received:e.limit}),e}d(ye,"parseEventQuery");async function Q(n,t){const e=ve(n,t),i=q(),o=k(s=>{const r=e.selector.kind==="review"?b(e.selector.review_id):b(U(e.actor.node_id).review_id),c=oe(s,r.review_id,e.doc_hash??r.anchor_base_sha256),u=J({review_id:r.review_id,text:e.text,anchor:e.anchor,line_text:ie(c.lines,e.anchor),doc_hash:c.sha256,actor:e.actor,operation_id:i});return{review:r,mutation:u}});return{status:200,body:await V({review:o.review,...o.mutation,verb:"create",actor:e.actor,deliver:e.deliver,operationId:i})}}d(Q,"handleCreate");function K(n,t){const e=[],i=t==="review"?(()=>{const c=w(n,e);return c===void 0?void 0:{kind:"review",review_id:c}})():{kind:"self"},o=be(n,t,e);(e.length>0||i===void 0)&&m(e);const s=i.kind==="review"?f(i.review_id):U(o.actor_node_id);return{status:200,body:{review_id:s.review_id,comments:$(s.review_id,o).map(p)}}}d(K,"handleList");function ge(n){const t=[],e=w(n,t),i=ye(n,t);(t.length>0||e===void 0)&&m(t);const o=f(e),s=ee(o.review_id,i);return{status:200,body:{review_id:o.review_id,events:s.events.map(x),next_since_seq:s.events.length===0?null:s.next_since_seq}}}d(ge,"handleEvents");function qe(n){const{review_id:t,request:e}=we(n),i=q(),o=k(()=>{const r=b(t),c=$(r.review_id).length,u=de({review_id:r.review_id,...e,actor:{kind:"human",node_id:null},operation_id:i});return{review:r,nondeleted:c,applied:u}});return{status:200,body:{review_id:o.review.review_id,anchor_base_sha256:o.applied.anchor_base_sha256,updated:o.applied.updated,detached:o.applied.detached,unchanged:o.nondeleted-o.applied.updated}}}d(qe,"handleRanges");function Se(n){const t=[],e=C(n,t);(t.length>0||e===void 0)&&m(t);const i=A(e);if(i===null)throw new v("unknown_comment","comment was not found",{received:e});return f(i.review_id),{status:200,body:he(i)}}d(Se,"handleDetail");async function y(n,t){const e=pe(n,t==="edit"),i=q(),o=k(()=>{const s=A(e.comment_id);if(s===null)throw new v("unknown_comment","comment was not found",{received:e.comment_id});const r=b(s.review_id),c=t==="edit"?Y(e.comment_id,{text:e.text,actor:e.actor,operation_id:i,if_revision:e.if_revision}):t==="resolve"?te(e.comment_id,{actor:e.actor,operation_id:i,if_revision:e.if_revision}):t==="reopen"?ne(e.comment_id,{actor:e.actor,operation_id:i,if_revision:e.if_revision}):X(e.comment_id,{actor:e.actor,operation_id:i,if_revision:e.if_revision});return{review:r,mutation:c}});return{status:200,body:await V({review:o.review,...o.mutation,verb:t,actor:e.actor,deliver:e.deliver,operationId:i})}}d(y,"handleAction");async function ke(n){const t=[],e=C(n,t);(t.length>0||e===void 0)&&m(t);const i=await re(e);return{status:200,body:{comment_id:e,node_id:i.node_id,cwd:i.cwd}}}d(ke,"handleFork");const Be=[{method:"POST",pattern:"/v1/human/reviews/self/comments",handler:d(n=>Q(n,"self"),"handler")},{method:"GET",pattern:"/v1/human/reviews/self/comments",handler:d(n=>K(n,"self"),"handler")},{method:"POST",pattern:"/v1/human/reviews/:review_id/comments",handler:d(n=>Q(n,"review"),"handler")},{method:"GET",pattern:"/v1/human/reviews/:review_id/comments",handler:d(n=>K(n,"review"),"handler")},{method:"GET",pattern:"/v1/human/reviews/:review_id/comment-events",handler:ge},{method:"POST",pattern:"/v1/human/reviews/:review_id/comment-ranges",handler:qe},{method:"GET",pattern:"/v1/human/comments/:comment_id",handler:Se},{method:"POST",pattern:"/v1/human/comments/:comment_id/edit",handler:d(n=>y(n,"edit"),"handler")},{method:"POST",pattern:"/v1/human/comments/:comment_id/resolve",handler:d(n=>y(n,"resolve"),"handler")},{method:"POST",pattern:"/v1/human/comments/:comment_id/reopen",handler:d(n=>y(n,"reopen"),"handler")},{method:"POST",pattern:"/v1/human/comments/:comment_id/delete",handler:d(n=>y(n,"delete"),"handler")},{method:"POST",pattern:"/v1/human/comments/:comment_id/fork",handler:ke}];export{Be as reviewCommentRoutes};
@@ -0,0 +1,5 @@
1
+ import type { CreateReviewRequest } from '../../../api/index.js';
2
+ import { type RequestContext, type RouteTable } from '../router.js';
3
+ /** Validate a create body. Exported for its contract test. */
4
+ export declare function parseCreate(ctx: RequestContext): CreateReviewRequest;
5
+ export declare const reviewRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var k=Object.defineProperty;var s=(t,e)=>k(t,"name",{value:e,configurable:!0});import{ApiError as m}from"../../../api/index.js";import{withCanvasWrite as R}from"../../../core/canvas/db.js";import{isSafeNodeId as p}from"../../../core/canvas/paths.js";import{readDocument as q}from"../../../core/graph/documents.js";import{getByRowid as E}from"../../../core/graph/objects.js";import{checkoutsForCwd as S}from"../../../core/graph/repo-sync/repos.js";import{getNode as b}from"../../../core/canvas/canvas.js";import{assertScope as T}from"../../../core/scopes.js";import{createReview as $}from"../../../core/review/birth.js";import{readAnchorBase as C,listReviews as D,requireVisibleReview as y}from"../../../core/review/store.js";import{cancelReview as I,submitReviewApproval as A}from"../../review/finish.js";import{toFeedbackResultDTO as O,toReviewDTO as F}from"../map.js";import{readerFor as L,resolveRef as B}from"../reader.js";import{canReadNode as N}from"../router.js";import{invalidRequest as P,objectBody as w,optionalString as c,requireParam as j,requiredString as g}from"./validate.js";const G=new Set(["open","approved","canceled"]),V=["origin_kind","origin_node_id","document","file","idempotency_key","subtitle","output_path"],W=["reason","actor","disposition"];function l(t){P("review request",t)}s(l,"invalidRequest");function h(t,e){return j(t,"review_id","must be a safe review id",p,e)}s(h,"requireReviewId");function f(t){return{...F(t,t.state==="approved"?{result_path:`${t.review_dir}/result.json`}:{}),review_dir:t.review_dir}}s(f,"toReviewResponseDTO");function K(t){const e=[],i=w(t.body,V,e),o=i.origin_kind,n=o==="ticket"||o==="inline"?o:void 0;n===void 0&&e.push({field:"origin_kind",problem:"must be ticket or inline",...o===void 0?{}:{received:o}});const r=g(i,"origin_node_id",e);r!==void 0&&!p(r)&&e.push({field:"origin_node_id",problem:"must be a safe node id",received:r});const d=c(i,"document",e),a=c(i,"file",e);n==="ticket"&&(d===void 0||a!==void 0)&&e.push({field:"document",problem:"is required for ticket reviews, and file is not allowed"}),n==="inline"&&a===void 0==(d===void 0)&&e.push({field:"file",problem:"inline reviews take exactly one of file or document"});const u=g(i,"idempotency_key",e);u!==void 0&&u.length>128&&e.push({field:"idempotency_key",problem:"must be at most 128 characters",received:u});const v=c(i,"subtitle",e),_=c(i,"output_path",e);return n==="ticket"&&v===void 0&&i.subtitle===void 0&&e.push({field:"subtitle",problem:"is required for ticket reviews"}),n==="inline"&&i.subtitle!==void 0&&e.push({field:"subtitle",problem:"is only allowed for ticket reviews",received:i.subtitle}),n==="inline"&&i.output_path!==void 0&&e.push({field:"output_path",problem:"is only allowed for ticket reviews",received:i.output_path}),(e.length>0||n===void 0||r===void 0||!p(r)||u===void 0||u.length>128)&&l(e),{origin_kind:n,origin_node_id:r,...d===void 0?{}:{document:d},...a===void 0?{}:{file:a},idempotency_key:u,...v===void 0?{}:{subtitle:v},..._===void 0?{}:{output_path:_}}}s(K,"parseCreate");function M(t){const e=[],i={},o=new Set(["state","origin_node_id","file"]);for(const[n,r]of t.query.entries())o.has(n)||e.push({field:n,problem:"is not allowed",received:r});for(const n of o){const r=t.query.getAll(n);if(r.length>1){e.push({field:n,problem:"must appear at most once",received:r});continue}const d=r[0];d!==void 0&&(n==="state"?G.has(d)?i.state=d:e.push({field:n,problem:"must be open, approved, or canceled",received:d}):n==="origin_node_id"?p(d)?i.origin_node_id=d:e.push({field:n,problem:"must be a safe node id",received:d}):d===""?e.push({field:n,problem:"must be a non-empty string",received:d}):i.file=d)}return e.length>0&&l(e),i}s(M,"parseList");function x(t,e){const i=t.body===void 0?{}:w(t.body,W,e),o=c(i,"reason",e),n=c(i,"actor",e),r=c(i,"disposition",e);return r!==void 0&&r!=="canceled"&&r!=="dismissed"&&e.push({field:"disposition",problem:'must be "canceled" or "dismissed"',received:r}),{...o===void 0?{}:{reason:o},...n===void 0?{}:{actor:n},...r==="canceled"||r==="dismissed"?{disposition:r}:{}}}s(x,"parseCancel");function z(t,e){w(t.body,[],e)}s(z,"requireEmptyBody");async function H(t){const e=K(t),i=b(e.origin_node_id);i!==null&&T(i,"crtr:act");const{document:o,file:n,...r}=e,d=await $({...r,...o===void 0?{file:n??""}:{document:J(t,o)}});return{status:200,body:f(d)}}s(H,"handleCreate");function J(t,e){return R(i=>{const o=L(i,t),n=B(i,o,e);if("remote"in n)throw new m(404,"not_found",`no document named ${n.remote} on this runtime`,{next:"Check the name with `crtr canvas search`."});if("deleted"in n)throw new m(404,"not_found",`${n.deleted.name} is deleted`,{id:n.deleted.id,deleted:!0});if(n.type!=="document")throw new m(400,"invalid_request",`${e} is a ${n.type}, not a document`);const r=q(i,o,n,u=>S(i,u));if(r.needsMerge)throw new m(409,"needs_merge",`${n.name} has ${r.heads.length} heads; merge them before a review`,{id:n.id,next:`Read it with \`crtr canvas read ${n.id}\` and write the merged body with \`crtr doc edit\`.`});const d=n.owner===null?null:E(i,n.owner),a=d===null?"":d.type==="node"?d.id:d.name;return{id:n.id,name:a===""?n.name:`${a}/${n.name}`,base:r.record.heads_key,body:r.heads[0].body}})}s(J,"reviewedDocument");function Q(t){const e=M(t);return{status:200,body:{reviews:D(e).filter(o=>{if(t.principal.class==="person")return!0;const n=b(o.origin_node_id);return n!==null&&N(t.principal,n.grantee??"app:terminal",n.node_id)}).map(f)}}}s(Q,"handleList");function U(t){const e=[],i=h(t,e);return(e.length>0||i===void 0)&&l(e),{status:200,body:f(y(i))}}s(U,"handleRead");async function X(t){const e=[],i=h(t,e);z(t,e),(e.length>0||i===void 0)&&l(e);const o=await A(i);return{status:200,body:o.outcome==="awaiting_companion"?{review:f(o.record),outcome:o.outcome}:{review:f(o.record),result:O(o.result),outcome:o.outcome}}}s(X,"handleSubmit");async function Y(t){const e=[],i=h(t,e),o=x(t,e);(e.length>0||i===void 0)&&l(e);const n=await I(i,o);return{status:200,body:{review:f(n.record),outcome:n.outcome}}}s(Y,"handleCancel");function Z(t){const e=[],i=h(t,e);(e.length>0||i===void 0)&&l(e);const o=y(i),n=C(o.review_id);if(n===null)throw new Error(`review anchor base is missing: ${o.review_id}`);return{status:200,body:{review_id:o.review_id,anchor_base_sha256:n.sha256,anchor_base_text:new TextDecoder("utf-8",{fatal:!0}).decode(n.bytes),file:o.file}}}s(Z,"handleDocument");const ve=[{method:"POST",pattern:"/v1/human/reviews",scope:"crtr:act",handler:H},{method:"GET",pattern:"/v1/human/reviews",handler:Q},{method:"GET",pattern:"/v1/human/reviews/:review_id",handler:U},{method:"POST",pattern:"/v1/human/reviews/:review_id/submit",handler:X},{method:"POST",pattern:"/v1/human/reviews/:review_id/cancel",handler:Y},{method:"GET",pattern:"/v1/human/reviews/:review_id/document",handler:Z}];export{K as parseCreate,ve as reviewRoutes};
@@ -0,0 +1,2 @@
1
+ import type { RouteTable } from '../router.js';
2
+ export declare const runRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var a=Object.defineProperty;var t=(e,r)=>a(e,"name",{value:r,configurable:!0});import{randomUUID as s}from"node:crypto";import{cursor as m,streamRunEvents as i}from"../app-listener.js";import{handleRunOperation as o}from"./runs.js";import{OPERATIONS as d}from"../operations.js";const q=d.filter(e=>["run.list","run.get","run.events","trace.get","run.message","run.interrupt","run.cancel","run.delete"].includes(e.name)).map(e=>({method:e.method,pattern:e.path,handler:t(async r=>{const n=r.params.run_id;if(e.name==="run.events"){const u=m(r.req,r.query);return await i(r.req,r.res,n,r.principal,u,s(),"ndjson"),{status:200}}return o(e,r.principal,n,r.query,r.body,r.req.headers["idempotency-key"])},"handler")}));export{q as runRoutes};
@@ -0,0 +1,9 @@
1
+ import { type AppPrincipal } from '../principal.js';
2
+ import { type RequestPrincipal } from '../router.js';
3
+ import type { AppOperation } from '../operations.js';
4
+ declare function integer(value: string | null, param: string, min: number, max: number, fallback: number): number;
5
+ export { integer };
6
+ export declare function handleRunOperation(operation: AppOperation, principal: AppPrincipal | RequestPrincipal, id: string | undefined, query: URLSearchParams, body: unknown, key: string | undefined): Promise<{
7
+ status: number;
8
+ body: unknown;
9
+ }>;
@@ -0,0 +1 @@
1
+ var q=Object.defineProperty;var w=(a,t)=>q(a,"name",{value:t,configurable:!0});import{callerGrant as p}from"../principal.js";import{grantVersion as g}from"../../../core/grants/mirror.js";import{waitGrantChange as R}from"../../../core/grants/watch.js";import{RunError as n,idempotencyKeyOf as h,cancelRun as S,deleteRun as N,interruptRun as O,listRuns as $,messageRun as A,renameRun as j,requestedScopes as x,startRun as B,traceRun as J,waitRun as z}from"../../../core/runs/operations.js";import{canReadRun as b,requireRun as f,runCallerApp as C}from"../router.js";import{waitSeconds as v}from"../long-poll-wait.js";function l(a){if(!a||typeof a!="object"||Array.isArray(a))throw new n(400,"invalid_request","a JSON object is required");return a}w(l,"object");function y(a,t,i,u,d){if(a===null)return d;if(!/^(0|[1-9]\d*)$/.test(a)||!Number.isSafeInteger(Number(a))||Number(a)<i||Number(a)>u)throw new n(400,"invalid_request",`invalid ${t}`,t);return Number(a)}w(y,"integer");const E=256*1024;async function I(a,t,i,u,d,_){switch(a.name){case"grant.get":{if("class"in t)throw new n(403,"permission_error","an app token is required");const e=v("grant.get",u),s=u.get("since");if(s!==null&&!/^[A-Za-z0-9_-]{1,64}$/.test(s))throw new n(400,"invalid_request","invalid since","since");let r=p(t);return e&&s!==null&&g(r)===s&&(await R(t.grant,e),r=p(t)),{status:200,body:{sub:t.sub,grantee:t.grantee,client_id:t.client_id,grant:t.grant,rev:r.rev,resolved_scopes:r.resolved_scopes,spend_cap:r.spend_cap,exp:t.exp,payer:"user",dependencies:r.dependencies??{},version:g(r)}}}case"run.start":{if("class"in t)throw new n(403,"permission_error","an app token is required");const e=l(d),s=["mode","parent","fork_from","node_id","env","tools","system_prompt"];for(const o of s)if(e[o]!==void 0)throw new n(403,"owner_only",`${o} is owner-only`,o);const r=["payer","model","model_policy","deadline","kind"];for(const o of r)if(e[o]!==void 0)throw new n(400,"invalid_request",`${o} is not available`,o);for(const o of Object.keys(e))if(!["prompt","scopes","metadata","profile","isolated","cwd","worktree","output_schema","message"].includes(o))throw new n(400,"invalid_request",`unknown field ${o}`,o);if(e.profile!==void 0&&(typeof e.profile!="string"||!e.profile))throw new n(400,"invalid_request","profile must be a profile id","profile");if(e.isolated!==void 0&&typeof e.isolated!="boolean")throw new n(400,"invalid_request","isolated must be a boolean","isolated");if(e.cwd!==void 0&&(e.isolated!==!0||typeof e.cwd!="string"||!e.cwd))throw new n(400,"invalid_request","cwd is available only for an isolated run and must be an absolute path inside its root folder","cwd");if(e.worktree!==void 0&&e.isolated!==!0)throw new n(400,"invalid_request","worktree is not available","worktree");if(e.isolated===!0&&e.worktree!==void 0)throw new n(400,"invalid_request","worktree is unavailable for an isolated run","worktree");if(typeof e.prompt!="string"||!e.prompt.trim())throw new n(400,"invalid_request","prompt is required","prompt");if(e.message!==void 0&&(typeof e.message!="string"||!e.message.trim()))throw new n(400,"invalid_request","message must be a non-empty string","message");const c=e.metadata===void 0?{}:l(e.metadata);if(Buffer.byteLength(JSON.stringify(c))>4096)throw new n(400,"invalid_request","metadata exceeds 4 KB","metadata");let m;if(e.output_schema!==void 0){const o=e.output_schema;if(!o||typeof o!="object"||Array.isArray(o))throw new n(400,"invalid_request","output_schema must be a JSON Schema object","output_schema");if(Buffer.byteLength(JSON.stringify(o))>E)throw new n(400,"invalid_request","output_schema exceeds 256 KB","output_schema");m=o}const k=x(t.resolved,e.scopes,t.grantee);return{status:201,body:await B(t,{prompt:e.prompt,scopes:k,metadata:c,profile:e.profile,isolated:e.isolated,cwd:e.cwd,...m===void 0?{}:{output_schema:m},...e.message===void 0?{}:{message:e.message}},h(_))}}case"run.list":{const e=u.get("status")??void 0;if(e&&!["running","waiting_on_user","idle","settled"].includes(e))throw new n(400,"invalid_request","invalid status","status");const s=u.get("app");if(s!==null&&!/^(?:app:)?[a-z0-9][a-z0-9-]*$/.test(s))throw new n(400,"invalid_request","invalid app","app");const r=s===null?C(t):s.startsWith("app:")?s:`app:${s}`;if(r!==null&&!b(t,r))throw new n(404,"not_found","run not found");return{status:200,body:$(r,{status:e,after:u.get("after")??void 0,limit:y(u.get("limit"),"limit",1,100,50),..."class"in t&&t.class==="broker"&&r!==null?{visible:w(c=>b(t,r,c),"visible")}:{}})}}case"run.get":{const e=v("run.get",u),s=f(t,i),r=await z(i,s.grantee,e);return f(t,i),{status:200,body:r}}case"run.message":{const e=l(d);if(typeof e.message!="string"||!e.message.trim())throw new n(400,"invalid_request","message is required","message");if(e.start_turn!==void 0&&typeof e.start_turn!="boolean")throw new n(400,"invalid_request","start_turn must be a boolean","start_turn");return{status:202,body:await A(f(t,i,!0),e.message,void 0,e.start_turn,h(_))}}case"run.interrupt":{const e=l(d===void 0?{}:d);if(e.children!==void 0&&e.children!=="stop"&&e.children!=="continue")throw new n(400,"invalid_request","invalid children","children");return{status:200,body:await O(f(t,i,!0),e.children)}}case"run.cancel":{const e=l(d===void 0?{}:d);if(e.keep_schedules!==void 0&&typeof e.keep_schedules!="boolean")throw new n(400,"invalid_request","invalid keep_schedules","keep_schedules");return{status:200,body:await S(f(t,i,!0),{keepSchedules:e.keep_schedules})}}case"run.rename":{const e=l(d);for(const s of Object.keys(e))if(s!=="name")throw new n(400,"invalid_request",`unknown field ${s}`,s);return{status:200,body:j(f(t,i,!0),e.name)}}case"run.delete":{const{uploads_pending:e}=await N(f(t,i,!0,!0));return{status:200,body:{run_id:i,uploads_pending:e}}}case"trace.get":{const e=u.get("format")??void 0;if(e&&e!=="entries")throw new n(400,"invalid_request","unknown trace format","format");const s=f(t,i);return{status:200,body:J(i,s.grantee,e)}}default:throw new n(404,"not_found","unknown operation")}}w(I,"handleRunOperation");export{I as handleRunOperation,y as integer};
@@ -0,0 +1,2 @@
1
+ import type { RouteTable } from '../router.js';
2
+ export declare const structuredRequestRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var O=Object.defineProperty;var i=(t,e)=>O(t,"name",{value:e,configurable:!0});import{isSafeNodeId as h}from"../../../core/canvas/paths.js";import{admitStructuredRequest as T,bindStructuredRequest as N,getPendingStructuredRequestForNode as P,getStructuredRequest as c,settleStructuredRequest as l,toStructuredRequestDTO as _}from"../../../core/canvas/structured-requests.js";import{getNode as S}from"../../../core/canvas/canvas.js";import{ApiError as D}from"../../../api/errors.js";import{handleCreate as j}from"./nodes.js";import{handleMessage as E}from"./messages.js";import{writeStructuredRequestSidecar as k}from"../../../core/runtime/structured-output.js";import{requestBrokerTeardown as x}from"../../../core/runtime/host.js";import{transition as $}from"../../../core/runtime/lifecycle.js";import{subscribeStructuredRequest as C}from"../../structured-requests/notifier.js";import{SYNC_WORK_BUDGET_MS as R}from"../../../api/index.js";import{waitSeconds as I}from"../long-poll-wait.js";function d(t,e,n){throw new D(t,e,n)}i(d,"fail");function M(t){(typeof t!="object"||t===null||Array.isArray(t))&&d(400,"invalid_request","a structured request requires a JSON object");const e=t;(typeof e.request_id!="string"||!h(e.request_id))&&d(400,"request_id_invalid","request_id must use the node-id character rule"),e.mode!=="sync"&&e.mode!=="async"&&d(400,"invalid_request","mode must be sync or async"),typeof e.prompt!="string"&&d(400,"invalid_request","prompt must be a string"),(typeof e.output_schema!="object"||e.output_schema===null||Array.isArray(e.output_schema))&&d(400,"invalid_request","output_schema must be a JSON Schema object");const n=e.target;(typeof n!="object"||n===null)&&d(400,"invalid_request","target is required");const r=n;if(r.kind==="node")(typeof r.node_id!="string"||!h(r.node_id))&&d(400,"invalid_request","target.node_id must use the node-id character rule");else if(r.kind==="new"){(typeof r.create!="object"||r.create===null||Array.isArray(r.create))&&d(400,"invalid_request","target.create must be an object");for(const u of["prompt","output_schema","deadline","root_lifecycle","no_kickoff"])Object.hasOwn(r.create,u)&&d(400,"create_field_forbidden",`target.create may not carry ${u}`)}else d(400,"invalid_request","target.kind must be new or node");return e.work_budget_ms!==void 0&&(!Number.isInteger(e.work_budget_ms)||e.work_budget_ms<=0)&&d(400,"work_budget_invalid","work_budget_ms must be a positive integer"),e.deadline_at!==void 0&&(typeof e.deadline_at!="string"||Number.isNaN(Date.parse(e.deadline_at)))&&d(400,"invalid_request","deadline_at must be an ISO timestamp"),e}i(M,"parseCreate");function F(t,e){const n=t.deadline_at===void 0?null:Date.parse(t.deadline_at),r=t.work_budget_ms===void 0?null:e+t.work_budget_ms,u=n===null?r:r===null?n:Math.min(n,r);return t.mode==="sync"?Math.min(u??e+R,e+R):u}i(F,"deadlineFor");function v(t,e,n=""){return{...t,method:"POST",path:"",params:n===""?{}:{id:n},query:new URLSearchParams,body:e}}i(v,"context");function q(t){return{status:200,body:{admitted:!0,request:_(t)}}}i(q,"terminalAdmission");function f(t){return t!==null&&Date.now()>=t}i(f,"deadlinePassed");function w(t){return q(l(t,{intended:"expired"}).row)}i(w,"expireAdmission");async function A(t,e){let n;const r=new Promise(m=>{n=m}),u=C(t,n);try{return c(t).state==="pending"&&e>0&&await Promise.race([r,new Promise(p=>setTimeout(p,e))]),_(c(t))}finally{u()}}i(A,"waitForRequest");async function B(t,e){const n=await A(t,Math.max(0,e-Date.now()));return n.state==="pending"?_(l(t,{intended:"expired"}).row):n}i(B,"waitForTerminal");async function L(t){const e=M(t.body);e.mode==="sync"&&e.target.kind!=="new"&&d(400,"sync_requires_dedicated_node","sync requests require target.kind=new");const n=Date.now(),r=F(e,n);if(f(r))return{status:200,body:{admitted:!1,reason:"work_budget_exhausted"}};let u=null,m="terminal",p=!0;if(e.target.kind==="node"){u=e.target.node_id;const s=S(u);s===null&&d(404,"node_not_found",`unknown node: ${u}`),(s.final_report!==null||s.status==="done"||s.status==="canceled"||s.status==="dead")&&d(409,"node_terminal",`node ${u} is terminal`),P(u)!==null&&d(409,"structured_request_conflict",`node ${u} already has a pending structured request`),m="oneoff",p=!1}if(f(r))return{status:200,body:{admitted:!1,reason:"work_budget_exhausted"}};let y;try{y=T({requestId:e.request_id,mode:e.mode,submission:m,dedicated:p,schema:e.output_schema,deadlineAt:r,nodeId:u,now:Date.now()})}catch(s){const a=String(s);throw(s.code==="ERR_SQLITE_CONSTRAINT_PRIMARYKEY"||a.includes("structured_requests.request_id"))&&d(409,"request_id_in_use",`request_id ${e.request_id} is already in use`),(a.includes("idx_structured_requests_one_pending_node")||a.includes("structured_requests.node_id"))&&d(409,"structured_request_conflict","the target node already has a pending structured request"),s}if(f(r))return w(e.request_id);if(e.target.kind==="new")try{u=(await j(v(t,{...e.target.create,root:!0,root_lifecycle:"terminal",prompt:""}),{},{...r===null?{}:{deadlineAt:new Date(r).toISOString()},beforeBrokerLaunch:i(a=>{if(u=a,f(r))throw new Error("structured request deadline expired before binding");const o=N(e.request_id,a);if(!o.changed||o.row===null||o.row.state!=="pending")throw new Error("structured request bind did not remain pending");u=a,k(o.row)},"beforeBrokerLaunch")})).body.node_id}catch{const a=c(e.request_id),o=a.state==="pending"?l(e.request_id,{intended:"failed",failureReason:a.node_id===null?"node_create_failed":"bind_failed"}).row:a;if(u!==null&&o.node_id===null){const b=S(u);(b?.status==="active"||b?.status==="idle")&&$(u,"cancel",{reason:"stranded"}),await x(u)}return q(o)}else{if(f(r))return w(e.request_id);try{k(y)}catch{return q(l(e.request_id,{intended:"failed",failureReason:"bind_failed"}).row)}}const g=c(e.request_id);if(g.state!=="pending")return q(g);if(f(r))return w(e.request_id);try{await E(v(t,{body:e.prompt,tier:"normal"},u))}catch{return q(l(e.request_id,{intended:"failed",failureReason:"prompt_delivery_failed"}).row)}return e.mode==="async"?{status:202,body:{admitted:!0,request:_(c(e.request_id))}}:{status:200,body:{admitted:!0,request:await B(e.request_id,r)}}}i(L,"handleCreateStructuredRequest");async function Y(t){const e=t.params.request_id,n=I("structured-request.get",t.query),r=c(e);return r===null&&d(404,"structured_request_not_found",`unknown structured request: ${e}`),{status:200,body:n===0?_(r):await A(e,n*1e3)}}i(Y,"handleReadStructuredRequest");async function G(t){const e=l(t.params.request_id,{intended:"canceled"});return e.row===null&&d(404,"structured_request_not_found",`unknown structured request: ${t.params.request_id}`),{status:200,body:_(e.row)}}i(G,"handleCancelStructuredRequest");const ne=[{method:"POST",pattern:"/v1/structured-requests",handler:L},{method:"GET",pattern:"/v1/structured-requests/:request_id",handler:Y},{method:"POST",pattern:"/v1/structured-requests/:request_id/cancel",handler:G}];export{ne as structuredRequestRoutes};
@@ -0,0 +1,2 @@
1
+ import type { RouteTable } from '../router.js';
2
+ export declare const subscriptionRoutes: RouteTable;
@@ -0,0 +1 @@
1
+ var l=Object.defineProperty;var p=(n,i)=>l(n,"name",{value:i,configurable:!0});import{ApiError as e}from"../../../api/index.js";import{getNode as a,subscribe as b,subscriptionsOf as f,unsubscribe as h}from"../../../core/canvas/canvas.js";import{toSubscriptionDTO as g}from"../map.js";function u(n){if(a(n)===null)throw new e(404,"node_not_found",`unknown node: ${n}`)}p(u,"requireNode");function w(n){const i=n.params.id,t=n.body??{},r=t.target;if(typeof r!="string"||r==="")throw new e(400,"invalid_request","subscribe body requires a `target` node id");if(r===i)throw new e(422,"unprocessable","a node cannot subscribe to itself");if(u(i),u(r),n.principal.class==="broker"){const o=a(i),c=a(r);if(o.grantee!==n.principal.app||c.grantee!==n.principal.app||o.run_id!==c.run_id||n.principal.run!==null&&o.run_id!==n.principal.run)throw new e(403,"other_app_run","subscriptions must stay within the calling app run")}const s=t.active??!0;b(i,r,s);const d=f(i).find(o=>o.node_id===r);if(d===void 0)throw new e(500,"internal","subscription edge vanished after write");return{status:200,body:g(d)}}p(w,"handleSubscribe");function _(n){const i=n.params.id,t=n.params.target;if(u(i),n.principal.class==="broker"){const r=a(i),s=a(t);if(r.grantee!==n.principal.app||n.principal.run!==null&&r.run_id!==n.principal.run||s&&(s.grantee!==r.grantee||s.run_id!==r.run_id))throw new e(403,"other_app_run","subscriptions must stay within the calling app run")}return h(i,t),{status:204}}p(_,"handleUnsubscribe");const E=[{method:"POST",pattern:"/v1/nodes/:id/subscriptions",handler:w},{method:"DELETE",pattern:"/v1/nodes/:id/subscriptions/:target",handler:_}];export{E as subscriptionRoutes};
@@ -0,0 +1,4 @@
1
+ import type { BrokerTelemetryRequest } from '../../../api/dto/broker-ops.js';
2
+ export declare function parseNodeTelemetryRecord(value: Record<string, unknown>): Omit<BrokerTelemetryRequest, 'expected_execution_id'>;
3
+ /** Merge nullable live gauges with the last usable node-local values. */
4
+ export declare function writeNodeTelemetryRecord(nodeId: string, record: Omit<BrokerTelemetryRequest, 'expected_execution_id'>): void;
@@ -0,0 +1 @@
1
+ var m=Object.defineProperty;var a=(r,t)=>m(r,"name",{value:t,configurable:!0});import{mkdirSync as u,readFileSync as l,writeFileSync as y}from"node:fs";import{join as c}from"node:path";import{jobDir as p}from"../../../core/canvas/paths.js";import{usage as _}from"../../../core/errors.js";function b(r){const{tokens_in:t,tokens_out:i,context_tokens:e,last_activity:o,model:n,updated_at:s}=r;if(typeof t!="number"||!Number.isFinite(t)||t<0||typeof i!="number"||!Number.isFinite(i)||i<0||e!==null&&(typeof e!="number"||!Number.isFinite(e)||e<0)||o!==null&&typeof o!="string"||typeof n!="string"||typeof s!="string"||Number.isNaN(Date.parse(s)))throw _("invalid telemetry");return{tokens_in:t,tokens_out:i,context_tokens:e,last_activity:o,model:n,updated_at:s}}a(b,"parseNodeTelemetryRecord");function v(r,t){const i=p(r),e=c(i,"telemetry.json");let o={};try{o=JSON.parse(l(e,"utf8"))}catch(n){if(!(n instanceof SyntaxError)&&n.code!=="ENOENT")throw n}u(i,{recursive:!0}),y(e,JSON.stringify({tokens_in:t.tokens_in,tokens_out:t.tokens_out,context_tokens:t.context_tokens??o.context_tokens,last_activity:t.last_activity??o.last_activity,model:t.model||o.model||"",updated_at:t.updated_at},null,2),"utf8")}a(v,"writeNodeTelemetryRecord");export{b as parseNodeTelemetryRecord,v as writeNodeTelemetryRecord};
@@ -0,0 +1,15 @@
1
+ import type { IncomingMessage, ServerResponse } from 'node:http';
2
+ import type { FileCaller } from '../../../core/spaces/permissions.js';
3
+ import type { AppOperation } from '../operations.js';
4
+ import type { AppPrincipal } from '../principal.js';
5
+ /** The app-listener rows of file transfer (daemon-operations §File transfer). */
6
+ export declare const TRANSFER_OPERATIONS: Set<string>;
7
+ /** An app caller's file permission: its grant, with no narrower launched list. */
8
+ export declare function fileCaller(caller: AppPrincipal): FileCaller;
9
+ /** JSON rows. `file.download` streams and goes through `handleTransferDownload`. */
10
+ export declare function handleTransferOperation(operation: AppOperation, caller: AppPrincipal, params: Record<string, string>, query: URLSearchParams, body: unknown): Promise<{
11
+ status: number;
12
+ body: unknown;
13
+ }>;
14
+ /** `file.download` (`stream: 'bytes'`): raw bytes with `Range` support. */
15
+ export declare function handleTransferDownload(req: IncomingMessage, res: ServerResponse, caller: AppPrincipal, query: URLSearchParams): Promise<void>;
@@ -0,0 +1 @@
1
+ var h=Object.defineProperty;var s=(e,a)=>h(e,"name",{value:a,configurable:!0});import{isAbsolute as w,resolve as _}from"node:path";import{RunError as n}from"../../../core/runs/operations.js";import{invalidStorageName as m,storageClient as l,StorageRefused as y,UPLOAD_MAX_BYTES as g}from"../../../core/storage/client.js";import{serveDownload as b}from"../../../core/storage/download.js";import{createShare as q,deleteOwnShare as v,listOwnShares as A}from"../../../core/storage/shares.js";import{getUpload as S,insertUpload as k,uploadUseAt as x}from"../../../core/storage/tables.js";import{requireRun as z}from"../router.js";const C=new Set(["upload.create","attachment.link","file.download","share.create","share.list","share.delete"]);function c(e){if(!e||typeof e!="object"||Array.isArray(e))throw new n(400,"invalid_request","a JSON object is required");return e}s(c,"object");function f(e){return{app:e.grantee,resolved:e.resolved,launched:null}}s(f,"fileCaller");const O=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}\/[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}(?:\s*;.{0,200})?$/;async function T(e,a){const i=c(a);for(const p of Object.keys(i))if(!["name","media_type","size"].includes(p))throw new n(400,"invalid_request",`unknown field ${p}`,p);const{name:r,media_type:o,size:t}=i;if(typeof t!="number"||!Number.isSafeInteger(t)||t<0)throw new n(400,"invalid_request","size must be a non-negative integer","size");if(t>g)throw new n(400,"invalid_request","size exceeds 100 MiB","size");if(typeof r!="string")throw new n(400,"invalid_request","name is required","name");const d=m(r);if(d)throw new n(400,"invalid_request",d,"name");if(typeof o!="string"||!O.test(o))throw new n(400,"invalid_request","media_type must be a media type","media_type");const u=await l().createUpload({name:r,media_type:o,size:t});return k({upload_id:u.upload_id,grantee:e.grantee,name:r,media_type:o,size:t,created_at:new Date().toISOString()}),{upload_id:u.upload_id,url:u.url,upload_link:u.upload_link,expires_at:u.expires_at}}s(T,"uploadCreate");async function D(e,a){if(!a)throw new n(400,"invalid_request","path is required","path");if(!w(a))throw new n(400,"invalid_request","path must be absolute","path");const i=x(_(a)),r=s(()=>new n(404,"not_found","no upload is recorded at that path"),"missing");if(!i)throw r();try{z(e,i.run_id)}catch(t){throw t instanceof n&&t.code==="not_found"?r():t}const o=S(i.upload_id);if(!o||o.delete_pending_since)throw r();try{return await l().signDownload(i.upload_id)}catch(t){throw t instanceof y?r():t}}s(D,"attachmentLink");async function M(e,a,i,r,o){switch(e.name){case"upload.create":return{status:201,body:await T(a,o)};case"attachment.link":return{status:200,body:await D(a,r.get("path"))};case"share.create":{const t=c(o);for(const d of Object.keys(t))if(!["path","expires_at"].includes(d))throw new n(400,"invalid_request",`unknown field ${d}`,d);return{status:201,body:await q(f(a),{path:t.path,expires_at:t.expires_at})}}case"share.list":return{status:200,body:A(a.grantee)};case"share.delete":return{status:200,body:await v(a.grantee,i.share_id)};default:throw new n(404,"not_found","unknown operation")}}s(M,"handleTransferOperation");function P(e,a,i,r){return b(e,a,f(i),r.get("path"))}s(P,"handleTransferDownload");export{C as TRANSFER_OPERATIONS,f as fileCaller,P as handleTransferDownload,M as handleTransferOperation};
@@ -0,0 +1,23 @@
1
+ import { isRecord } from '../../../shared/predicates.js';
2
+ import type { RequestContext } from '../router.js';
3
+ export { isRecord };
4
+ export type Violation = {
5
+ field: string;
6
+ problem: string;
7
+ received?: unknown;
8
+ };
9
+ /** Reject the request with every violation collected so far. `subject` names
10
+ * what was being parsed, e.g. "review comment request". */
11
+ export declare function invalidRequest(subject: string, violations: Violation[]): never;
12
+ /** Narrow a request body to an object and reject any field outside `allowed`.
13
+ * A non-object body yields `{}` so the caller's field reads all miss and
14
+ * report their own violations rather than throwing. */
15
+ export declare function objectBody(body: unknown, allowed: readonly string[], violations: Violation[]): Record<string, unknown>;
16
+ /** A required field that must be a string carrying at least one non-whitespace
17
+ * character — whitespace alone is not a value. */
18
+ export declare function requiredString(body: Record<string, unknown>, field: string, violations: Violation[]): string | undefined;
19
+ /** `requiredString`'s rule when present; absence is allowed. */
20
+ export declare function optionalString(body: Record<string, unknown>, field: string, violations: Violation[]): string | undefined;
21
+ /** A path parameter that must be present and satisfy `accepts`. `problem`
22
+ * describes the shape the caller failed to supply. */
23
+ export declare function requireParam(ctx: RequestContext, field: string, problem: string, accepts: (value: string) => boolean, violations: Violation[]): string | undefined;