@north-light/crouter 0.3.154

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 (1643) hide show
  1. package/README.md +48 -0
  2. package/bin/crouter +4 -0
  3. package/bin/crtr +4 -0
  4. package/bin/crtrd +4 -0
  5. package/bin/runtime-generation-manifest.mjs +263 -0
  6. package/bin/runtime-selector.mjs +378 -0
  7. package/dist/api/__tests__/client.test.d.ts +1 -0
  8. package/dist/api/__tests__/client.test.js +274 -0
  9. package/dist/api/client.d.ts +249 -0
  10. package/dist/api/client.js +616 -0
  11. package/dist/api/dto/attach.d.ts +16 -0
  12. package/dist/api/dto/attach.js +13 -0
  13. package/dist/api/dto/broker.d.ts +45 -0
  14. package/dist/api/dto/broker.js +20 -0
  15. package/dist/api/dto/canvas.d.ts +253 -0
  16. package/dist/api/dto/canvas.js +2 -0
  17. package/dist/api/dto/common.d.ts +27 -0
  18. package/dist/api/dto/common.js +15 -0
  19. package/dist/api/dto/config.d.ts +19 -0
  20. package/dist/api/dto/config.js +3 -0
  21. package/dist/api/dto/crons.d.ts +124 -0
  22. package/dist/api/dto/crons.js +10 -0
  23. package/dist/api/dto/files.d.ts +11 -0
  24. package/dist/api/dto/files.js +7 -0
  25. package/dist/api/dto/focus.d.ts +24 -0
  26. package/dist/api/dto/focus.js +10 -0
  27. package/dist/api/dto/health.d.ts +41 -0
  28. package/dist/api/dto/health.js +2 -0
  29. package/dist/api/dto/human.d.ts +57 -0
  30. package/dist/api/dto/human.js +4 -0
  31. package/dist/api/dto/inbox.d.ts +105 -0
  32. package/dist/api/dto/inbox.js +10 -0
  33. package/dist/api/dto/lifecycle.d.ts +79 -0
  34. package/dist/api/dto/lifecycle.js +3 -0
  35. package/dist/api/dto/messages.d.ts +55 -0
  36. package/dist/api/dto/messages.js +2 -0
  37. package/dist/api/dto/modelauth.d.ts +41 -0
  38. package/dist/api/dto/modelauth.js +3 -0
  39. package/dist/api/dto/nodes.d.ts +209 -0
  40. package/dist/api/dto/nodes.js +3 -0
  41. package/dist/api/dto/profiles.d.ts +14 -0
  42. package/dist/api/dto/profiles.js +3 -0
  43. package/dist/api/dto/reports.d.ts +41 -0
  44. package/dist/api/dto/reports.js +2 -0
  45. package/dist/api/dto/subscriptions.d.ts +14 -0
  46. package/dist/api/dto/subscriptions.js +2 -0
  47. package/dist/api/dto/worktree.d.ts +19 -0
  48. package/dist/api/dto/worktree.js +6 -0
  49. package/dist/api/errors.d.ts +19 -0
  50. package/dist/api/errors.js +30 -0
  51. package/dist/api/index.d.ts +24 -0
  52. package/dist/api/index.js +25 -0
  53. package/dist/api/routes.d.ts +64 -0
  54. package/dist/api/routes.js +92 -0
  55. package/dist/build-root.d.ts +43 -0
  56. package/dist/build-root.js +96 -0
  57. package/dist/builtin-memory/00-runtime-base.md +51 -0
  58. package/dist/builtin-memory/01-spine/00-has-manager.md +23 -0
  59. package/dist/builtin-memory/01-spine/01-no-manager.md +10 -0
  60. package/dist/builtin-memory/02-lifecycle/00-terminal.md +19 -0
  61. package/dist/builtin-memory/02-lifecycle/01-resident.md +10 -0
  62. package/dist/builtin-memory/04-base-worker.md +18 -0
  63. package/dist/builtin-memory/04-orchestration-kernel.md +109 -0
  64. package/dist/builtin-memory/05-kinds/advisor/00-base.md +19 -0
  65. package/dist/builtin-memory/05-kinds/advisor/01-orchestrator.md +26 -0
  66. package/dist/builtin-memory/05-kinds/design/00-base.md +20 -0
  67. package/dist/builtin-memory/05-kinds/design/01-orchestrator.md +13 -0
  68. package/dist/builtin-memory/05-kinds/developer/00-base.md +22 -0
  69. package/dist/builtin-memory/05-kinds/developer/01-orchestrator.md +21 -0
  70. package/dist/builtin-memory/05-kinds/explore/00-base.md +20 -0
  71. package/dist/builtin-memory/05-kinds/explore/01-orchestrator.md +16 -0
  72. package/dist/builtin-memory/05-kinds/general/00-base.md +15 -0
  73. package/dist/builtin-memory/05-kinds/general/01-orchestrator.md +11 -0
  74. package/dist/builtin-memory/05-kinds/plan/00-base.md +20 -0
  75. package/dist/builtin-memory/05-kinds/plan/01-orchestrator.md +17 -0
  76. package/dist/builtin-memory/05-kinds/plan/reviewers/architecture-fit.md +17 -0
  77. package/dist/builtin-memory/05-kinds/plan/reviewers/code-smells.md +17 -0
  78. package/dist/builtin-memory/05-kinds/plan/reviewers/pattern-consistency.md +19 -0
  79. package/dist/builtin-memory/05-kinds/plan/reviewers/requirements-coverage.md +17 -0
  80. package/dist/builtin-memory/05-kinds/plan/reviewers/security.md +20 -0
  81. package/dist/builtin-memory/05-kinds/product/00-base.md +25 -0
  82. package/dist/builtin-memory/05-kinds/product/01-orchestrator.md +15 -0
  83. package/dist/builtin-memory/05-kinds/product/teardown.md +15 -0
  84. package/dist/builtin-memory/05-kinds/review/00-base.md +19 -0
  85. package/dist/builtin-memory/05-kinds/review/01-orchestrator.md +17 -0
  86. package/dist/builtin-memory/05-kinds/spec/00-base.md +20 -0
  87. package/dist/builtin-memory/05-kinds/spec/01-orchestrator.md +15 -0
  88. package/dist/builtin-memory/05-kinds/spec/requirements.md +13 -0
  89. package/dist/builtin-memory/design.md +62 -0
  90. package/dist/builtin-memory/development.md +120 -0
  91. package/dist/builtin-memory/internal/INDEX.md +26 -0
  92. package/dist/builtin-memory/internal/agent-shaping.md +77 -0
  93. package/dist/builtin-memory/internal/examples/INDEX.md +15 -0
  94. package/dist/builtin-memory/internal/examples/imessage-assistant.md +100 -0
  95. package/dist/builtin-memory/internal/marketplaces.md +164 -0
  96. package/dist/builtin-memory/internal/nodes-and-canvas.md +51 -0
  97. package/dist/builtin-memory/internal/plugins.md +249 -0
  98. package/dist/builtin-memory/internal/storage-tiers.md +41 -0
  99. package/dist/builtin-memory/planning.md +43 -0
  100. package/dist/builtin-memory/product.md +80 -0
  101. package/dist/builtin-memory/spec.md +98 -0
  102. package/dist/builtin-memory/wedged-child-on-runaway-bash.md +34 -0
  103. package/dist/builtin-pi-packages/pi-crtr-extensions/README.md +47 -0
  104. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/claude-plugin-commands.test.ts +49 -0
  105. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/crtr-commands.test.ts +93 -0
  106. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/memory-slash-commands.test.ts +194 -0
  107. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/provider-rotation.test.ts +2632 -0
  108. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/statusline.test.ts +68 -0
  109. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/claude-plugin-commands.ts +492 -0
  110. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/crouter-help.ts +95 -0
  111. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/crtr-commands/filters.json +7 -0
  112. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/crtr-commands/index.ts +191 -0
  113. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/frontmatter-rules/index.ts +448 -0
  114. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/frontmatter-rules/test.ts +119 -0
  115. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/memory-slash-commands.ts +195 -0
  116. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.ts +1232 -0
  117. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/statusline.ts +255 -0
  118. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/strip-skills-docs.ts +47 -0
  119. package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/sysprompt-window.ts +19 -0
  120. package/dist/builtin-pi-packages/pi-crtr-extensions/lib/package.json +3 -0
  121. package/dist/builtin-pi-packages/pi-crtr-extensions/lib/subscription-state.js +1 -0
  122. package/dist/builtin-pi-packages/pi-crtr-extensions/lib/subscription-state.ts +2 -0
  123. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/LICENSE +13 -0
  124. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/README.md +172 -0
  125. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/bin.mjs +11 -0
  126. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
  127. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
  128. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
  129. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
  130. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/composer.js +219 -0
  131. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
  132. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
  133. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
  134. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
  135. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
  136. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +225 -0
  137. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
  138. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
  139. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
  140. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
  141. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
  142. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/doc/Document.js +335 -0
  143. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
  144. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
  145. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
  146. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/doc/directives.js +176 -0
  147. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/errors.js +57 -0
  148. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/index.js +17 -0
  149. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/log.js +11 -0
  150. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/Alias.js +116 -0
  151. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
  152. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
  153. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
  154. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
  155. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
  156. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
  157. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
  158. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
  159. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
  160. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
  161. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
  162. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
  163. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/cst.js +98 -0
  164. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/lexer.js +721 -0
  165. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
  166. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/parser.js +975 -0
  167. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/public-api.js +102 -0
  168. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
  169. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
  170. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
  171. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
  172. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
  173. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
  174. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
  175. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
  176. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
  177. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
  178. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/tags.js +96 -0
  179. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
  180. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
  181. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
  182. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
  183. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +67 -0
  184. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
  185. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
  186. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
  187. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
  188. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
  189. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
  190. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
  191. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
  192. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
  193. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
  194. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +25 -0
  195. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
  196. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
  197. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/util.js +11 -0
  198. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/visit.js +233 -0
  199. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/index.js +5 -0
  200. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/package.json +3 -0
  201. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/cli.d.ts +8 -0
  202. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/cli.mjs +201 -0
  203. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
  204. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-collection.js +90 -0
  205. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
  206. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-doc.js +45 -0
  207. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
  208. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-node.js +112 -0
  209. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
  210. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
  211. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/composer.d.ts +63 -0
  212. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/composer.js +224 -0
  213. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
  214. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
  215. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
  216. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
  217. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
  218. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
  219. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
  220. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-end.js +39 -0
  221. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
  222. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
  223. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
  224. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-flow-scalar.js +227 -0
  225. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
  226. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-props.js +148 -0
  227. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
  228. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
  229. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
  230. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
  231. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
  232. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
  233. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
  234. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
  235. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/Document.d.ts +141 -0
  236. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/Document.js +337 -0
  237. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
  238. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/anchors.js +76 -0
  239. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
  240. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/applyReviver.js +57 -0
  241. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
  242. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/createNode.js +90 -0
  243. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/directives.d.ts +49 -0
  244. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/directives.js +178 -0
  245. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/errors.d.ts +21 -0
  246. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/errors.js +62 -0
  247. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/index.d.ts +25 -0
  248. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/index.js +50 -0
  249. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/log.d.ts +3 -0
  250. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/log.js +19 -0
  251. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
  252. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Alias.js +118 -0
  253. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
  254. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Collection.js +151 -0
  255. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
  256. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Node.js +40 -0
  257. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
  258. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Pair.js +39 -0
  259. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Scalar.d.ts +47 -0
  260. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Scalar.js +27 -0
  261. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
  262. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
  263. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
  264. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
  265. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
  266. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
  267. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
  268. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/identity.js +53 -0
  269. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
  270. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/toJS.js +39 -0
  271. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/options.d.ts +350 -0
  272. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
  273. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
  274. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
  275. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
  276. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
  277. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst-visit.js +99 -0
  278. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst.d.ts +109 -0
  279. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst.js +112 -0
  280. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
  281. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/lexer.js +723 -0
  282. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
  283. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/line-counter.js +41 -0
  284. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/parser.d.ts +84 -0
  285. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/parser.js +980 -0
  286. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/public-api.d.ts +44 -0
  287. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/public-api.js +107 -0
  288. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
  289. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/Schema.js +39 -0
  290. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
  291. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/map.js +19 -0
  292. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
  293. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/null.js +17 -0
  294. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
  295. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/seq.js +19 -0
  296. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
  297. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/string.js +16 -0
  298. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
  299. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/bool.js +21 -0
  300. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
  301. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/float.js +47 -0
  302. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
  303. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/int.js +42 -0
  304. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
  305. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/schema.js +25 -0
  306. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
  307. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/json/schema.js +64 -0
  308. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
  309. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/tags.d.ts +48 -0
  310. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/tags.js +99 -0
  311. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/types.d.ts +92 -0
  312. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
  313. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
  314. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
  315. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
  316. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
  317. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
  318. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
  319. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
  320. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
  321. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/merge.js +71 -0
  322. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
  323. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
  324. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
  325. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
  326. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
  327. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
  328. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
  329. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
  330. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
  331. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
  332. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
  333. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
  334. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
  335. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringify.js +132 -0
  336. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
  337. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
  338. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
  339. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
  340. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
  341. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
  342. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
  343. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyNumber.js +27 -0
  344. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
  345. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
  346. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
  347. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
  348. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/test-events.d.ts +4 -0
  349. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/test-events.js +134 -0
  350. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/util.d.ts +16 -0
  351. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/util.js +28 -0
  352. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/visit.d.ts +102 -0
  353. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/visit.js +236 -0
  354. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/package.json +97 -0
  355. package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/util.js +2 -0
  356. package/dist/builtin-pi-packages/pi-crtr-extensions/package-lock.json +3385 -0
  357. package/dist/builtin-pi-packages/pi-crtr-extensions/package.json +25 -0
  358. package/dist/builtin-pi-packages/pi-crtr-extensions/tsconfig.json +10 -0
  359. package/dist/builtin-pi-packages/pi-mode-switch/README.md +36 -0
  360. package/dist/builtin-pi-packages/pi-mode-switch/bin/mode +36 -0
  361. package/dist/builtin-pi-packages/pi-mode-switch/extensions/index.ts +449 -0
  362. package/dist/builtin-pi-packages/pi-mode-switch/package.json +14 -0
  363. package/dist/builtin-pi-packages/pi-mode-switch/tsconfig.json +9 -0
  364. package/dist/builtin-views/_lib/states.mjs +161 -0
  365. package/dist/builtin-views/canvas/core.mjs +657 -0
  366. package/dist/builtin-views/canvas/text.mjs +58 -0
  367. package/dist/builtin-views/canvas/tui.mjs +168 -0
  368. package/dist/builtin-views/canvas/web.jsx +121 -0
  369. package/dist/builtin-views/chat/core.mjs +684 -0
  370. package/dist/builtin-views/chat/text.mjs +101 -0
  371. package/dist/builtin-views/chat/tui.mjs +360 -0
  372. package/dist/builtin-views/chat/web.jsx +362 -0
  373. package/dist/builtin-views/git-pr/core.mjs +673 -0
  374. package/dist/builtin-views/git-pr/text.mjs +84 -0
  375. package/dist/builtin-views/git-pr/tui.mjs +301 -0
  376. package/dist/builtin-views/git-pr/web.jsx +216 -0
  377. package/dist/builtin-views/inbox/_lib/render.mjs +175 -0
  378. package/dist/builtin-views/inbox/core.mjs +1273 -0
  379. package/dist/builtin-views/inbox/text.mjs +73 -0
  380. package/dist/builtin-views/inbox/tui.mjs +314 -0
  381. package/dist/builtin-views/inbox/web.jsx +188 -0
  382. package/dist/builtin-views/linkedin/core.mjs +906 -0
  383. package/dist/builtin-views/linkedin/text.mjs +69 -0
  384. package/dist/builtin-views/linkedin/tui.mjs +413 -0
  385. package/dist/builtin-views/linkedin/web.jsx +206 -0
  386. package/dist/builtin-views/prompt-review/core.mjs +735 -0
  387. package/dist/builtin-views/prompt-review/text.mjs +15 -0
  388. package/dist/builtin-views/prompt-review/tui.mjs +196 -0
  389. package/dist/builtin-views/prompt-review/web.jsx +484 -0
  390. package/dist/builtin-views/workspace-sidebar/__tests__/core.test.d.ts +1 -0
  391. package/dist/builtin-views/workspace-sidebar/__tests__/core.test.js +50 -0
  392. package/dist/builtin-views/workspace-sidebar/__tests__/core.test.ts +53 -0
  393. package/dist/builtin-views/workspace-sidebar/core.mjs +670 -0
  394. package/dist/builtin-views/workspace-sidebar/text.mjs +53 -0
  395. package/dist/builtin-views/workspace-sidebar/tui.mjs +141 -0
  396. package/dist/builtin-views/workspace-sidebar/web.jsx +109 -0
  397. package/dist/cli.d.ts +2 -0
  398. package/dist/cli.js +86 -0
  399. package/dist/clients/attach/__tests__/attach-chrome-remote.test.d.ts +1 -0
  400. package/dist/clients/attach/__tests__/attach-chrome-remote.test.js +467 -0
  401. package/dist/clients/attach/__tests__/attach-keybindings.test.d.ts +1 -0
  402. package/dist/clients/attach/__tests__/attach-keybindings.test.js +141 -0
  403. package/dist/clients/attach/__tests__/attach-remote-readonly.test.d.ts +1 -0
  404. package/dist/clients/attach/__tests__/attach-remote-readonly.test.js +191 -0
  405. package/dist/clients/attach/__tests__/chat-view-snapshot-ordering.test.d.ts +1 -0
  406. package/dist/clients/attach/__tests__/chat-view-snapshot-ordering.test.js +236 -0
  407. package/dist/clients/attach/__tests__/context-message.test.d.ts +1 -0
  408. package/dist/clients/attach/__tests__/context-message.test.js +46 -0
  409. package/dist/clients/attach/__tests__/crtr-output-coverage.test.d.ts +1 -0
  410. package/dist/clients/attach/__tests__/crtr-output-coverage.test.js +55 -0
  411. package/dist/clients/attach/__tests__/crtr-output.test.d.ts +1 -0
  412. package/dist/clients/attach/__tests__/crtr-output.test.js +2103 -0
  413. package/dist/clients/attach/__tests__/diagram.test.d.ts +1 -0
  414. package/dist/clients/attach/__tests__/diagram.test.js +42 -0
  415. package/dist/clients/attach/__tests__/markdown-headings.test.d.ts +1 -0
  416. package/dist/clients/attach/__tests__/markdown-headings.test.js +27 -0
  417. package/dist/clients/attach/__tests__/oauth-dialog-lifecycle.test.d.ts +1 -0
  418. package/dist/clients/attach/__tests__/oauth-dialog-lifecycle.test.js +133 -0
  419. package/dist/clients/attach/__tests__/prompt-preview.test.d.ts +1 -0
  420. package/dist/clients/attach/__tests__/prompt-preview.test.js +87 -0
  421. package/dist/clients/attach/__tests__/ref-autocomplete.test.d.ts +1 -0
  422. package/dist/clients/attach/__tests__/ref-autocomplete.test.js +176 -0
  423. package/dist/clients/attach/__tests__/titled-editor-preview.test.d.ts +1 -0
  424. package/dist/clients/attach/__tests__/titled-editor-preview.test.js +271 -0
  425. package/dist/clients/attach/__tests__/visible-paths.test.d.ts +1 -0
  426. package/dist/clients/attach/__tests__/visible-paths.test.js +19 -0
  427. package/dist/clients/attach/chrome/bash-jobs.d.ts +9 -0
  428. package/dist/clients/attach/chrome/bash-jobs.js +43 -0
  429. package/dist/clients/attach/chrome/canvas-panels.d.ts +36 -0
  430. package/dist/clients/attach/chrome/canvas-panels.js +172 -0
  431. package/dist/clients/attach/chrome/completion-bell.d.ts +10 -0
  432. package/dist/clients/attach/chrome/completion-bell.js +89 -0
  433. package/dist/clients/attach/chrome/cron-wait.d.ts +3 -0
  434. package/dist/clients/attach/chrome/cron-wait.js +34 -0
  435. package/dist/clients/attach/chrome/git-info.d.ts +20 -0
  436. package/dist/clients/attach/chrome/git-info.js +44 -0
  437. package/dist/clients/attach/chrome/roster.d.ts +26 -0
  438. package/dist/clients/attach/chrome/roster.js +233 -0
  439. package/dist/clients/attach/chrome/status-line.d.ts +35 -0
  440. package/dist/clients/attach/chrome/status-line.js +133 -0
  441. package/dist/clients/attach/chrome/widgets.d.ts +9 -0
  442. package/dist/clients/attach/chrome/widgets.js +61 -0
  443. package/dist/clients/attach/command.d.ts +2 -0
  444. package/dist/clients/attach/command.js +96 -0
  445. package/dist/clients/attach/config.d.ts +91 -0
  446. package/dist/clients/attach/config.js +271 -0
  447. package/dist/clients/attach/input/clipboard-image.d.ts +55 -0
  448. package/dist/clients/attach/input/clipboard-image.js +237 -0
  449. package/dist/clients/attach/input/controller.d.ts +210 -0
  450. package/dist/clients/attach/input/controller.js +689 -0
  451. package/dist/clients/attach/input/ref-autocomplete.d.ts +75 -0
  452. package/dist/clients/attach/input/ref-autocomplete.js +135 -0
  453. package/dist/clients/attach/input/titled-editor.d.ts +209 -0
  454. package/dist/clients/attach/input/titled-editor.js +801 -0
  455. package/dist/clients/attach/overlays/auth.d.ts +13 -0
  456. package/dist/clients/attach/overlays/auth.js +245 -0
  457. package/dist/clients/attach/overlays/dialogs.d.ts +27 -0
  458. package/dist/clients/attach/overlays/dialogs.js +102 -0
  459. package/dist/clients/attach/overlays/file-review.d.ts +9 -0
  460. package/dist/clients/attach/overlays/file-review.js +181 -0
  461. package/dist/clients/attach/overlays/graph.d.ts +76 -0
  462. package/dist/clients/attach/overlays/graph.js +657 -0
  463. package/dist/clients/attach/overlays/mcp.d.ts +32 -0
  464. package/dist/clients/attach/overlays/mcp.js +310 -0
  465. package/dist/clients/attach/overlays/pickers.d.ts +59 -0
  466. package/dist/clients/attach/overlays/pickers.js +170 -0
  467. package/dist/clients/attach/render/chat-view.d.ts +185 -0
  468. package/dist/clients/attach/render/chat-view.js +946 -0
  469. package/dist/clients/attach/render/context-message.d.ts +14 -0
  470. package/dist/clients/attach/render/context-message.js +81 -0
  471. package/dist/clients/attach/render/crtr-output.d.ts +48 -0
  472. package/dist/clients/attach/render/crtr-output.js +694 -0
  473. package/dist/clients/attach/render/diagram.d.ts +14 -0
  474. package/dist/clients/attach/render/diagram.js +135 -0
  475. package/dist/clients/attach/render/edit-diff.d.ts +6 -0
  476. package/dist/clients/attach/render/edit-diff.js +263 -0
  477. package/dist/clients/attach/render/frozen-history.d.ts +38 -0
  478. package/dist/clients/attach/render/frozen-history.js +100 -0
  479. package/dist/clients/attach/render/markdown-headings.d.ts +11 -0
  480. package/dist/clients/attach/render/markdown-headings.js +82 -0
  481. package/dist/clients/attach/session/banner.d.ts +9 -0
  482. package/dist/clients/attach/session/banner.js +29 -0
  483. package/dist/clients/attach/session/bindings.d.ts +12 -0
  484. package/dist/clients/attach/session/bindings.js +52 -0
  485. package/dist/clients/attach/session/chrome-refresh.d.ts +34 -0
  486. package/dist/clients/attach/session/chrome-refresh.js +93 -0
  487. package/dist/clients/attach/session/connection.d.ts +44 -0
  488. package/dist/clients/attach/session/connection.js +178 -0
  489. package/dist/clients/attach/session/context.d.ts +54 -0
  490. package/dist/clients/attach/session/context.js +16 -0
  491. package/dist/clients/attach/session/editor-frame.d.ts +43 -0
  492. package/dist/clients/attach/session/editor-frame.js +136 -0
  493. package/dist/clients/attach/session/editor-inventory.d.ts +59 -0
  494. package/dist/clients/attach/session/editor-inventory.js +161 -0
  495. package/dist/clients/attach/session/focus-events.d.ts +4 -0
  496. package/dist/clients/attach/session/focus-events.js +12 -0
  497. package/dist/clients/attach/session/frames.d.ts +43 -0
  498. package/dist/clients/attach/session/frames.js +170 -0
  499. package/dist/clients/attach/session/identity.d.ts +16 -0
  500. package/dist/clients/attach/session/identity.js +25 -0
  501. package/dist/clients/attach/session/input-wiring.d.ts +31 -0
  502. package/dist/clients/attach/session/input-wiring.js +128 -0
  503. package/dist/clients/attach/session/keys.d.ts +22 -0
  504. package/dist/clients/attach/session/keys.js +60 -0
  505. package/dist/clients/attach/session/layout.d.ts +20 -0
  506. package/dist/clients/attach/session/layout.js +56 -0
  507. package/dist/clients/attach/session/mode.d.ts +25 -0
  508. package/dist/clients/attach/session/mode.js +97 -0
  509. package/dist/clients/attach/session/pane-tag.d.ts +15 -0
  510. package/dist/clients/attach/session/pane-tag.js +43 -0
  511. package/dist/clients/attach/session/pi-assets.d.ts +1 -0
  512. package/dist/clients/attach/session/pi-assets.js +24 -0
  513. package/dist/clients/attach/session/pi-oauth-flows.d.ts +1 -0
  514. package/dist/clients/attach/session/pi-oauth-flows.js +21 -0
  515. package/dist/clients/attach/session/reconnect.d.ts +37 -0
  516. package/dist/clients/attach/session/reconnect.js +127 -0
  517. package/dist/clients/attach/session/state-sync.d.ts +38 -0
  518. package/dist/clients/attach/session/state-sync.js +68 -0
  519. package/dist/clients/attach/session/teardown.d.ts +30 -0
  520. package/dist/clients/attach/session/teardown.js +96 -0
  521. package/dist/clients/attach/slash/dispatch.d.ts +124 -0
  522. package/dist/clients/attach/slash/dispatch.js +696 -0
  523. package/dist/clients/attach/slash/prompt-preview.d.ts +30 -0
  524. package/dist/clients/attach/slash/prompt-preview.js +121 -0
  525. package/dist/clients/attach/viewer.d.ts +8 -0
  526. package/dist/clients/attach/viewer.js +1559 -0
  527. package/dist/clients/attach/visible-paths.d.ts +9 -0
  528. package/dist/clients/attach/visible-paths.js +76 -0
  529. package/dist/clients/web/__tests__/push-engine.test.d.ts +1 -0
  530. package/dist/clients/web/__tests__/push-engine.test.js +302 -0
  531. package/dist/clients/web/__tests__/push-registry.test.d.ts +1 -0
  532. package/dist/clients/web/__tests__/push-registry.test.js +177 -0
  533. package/dist/clients/web/dev-server.d.ts +7 -0
  534. package/dist/clients/web/dev-server.js +60 -0
  535. package/dist/clients/web/events.d.ts +19 -0
  536. package/dist/clients/web/events.js +165 -0
  537. package/dist/clients/web/push-engine.d.ts +108 -0
  538. package/dist/clients/web/push-engine.js +256 -0
  539. package/dist/clients/web/push-registry.d.ts +89 -0
  540. package/dist/clients/web/push-registry.js +378 -0
  541. package/dist/clients/web/server.d.ts +19 -0
  542. package/dist/clients/web/server.js +693 -0
  543. package/dist/clients/web/web-client/shared/protocol.d.ts +322 -0
  544. package/dist/clients/web/web-client/shared/protocol.js +8 -0
  545. package/dist/clients/web/web-cmd.d.ts +2 -0
  546. package/dist/clients/web/web-cmd.js +141 -0
  547. package/dist/commands/__tests__/api-client-cold-start-diagnostic.test.d.ts +1 -0
  548. package/dist/commands/__tests__/api-client-cold-start-diagnostic.test.js +96 -0
  549. package/dist/commands/__tests__/canvas-config.test.d.ts +1 -0
  550. package/dist/commands/__tests__/canvas-config.test.js +107 -0
  551. package/dist/commands/__tests__/human.test.d.ts +1 -0
  552. package/dist/commands/__tests__/human.test.js +344 -0
  553. package/dist/commands/__tests__/node-no-kickoff-flag.test.d.ts +1 -0
  554. package/dist/commands/__tests__/node-no-kickoff-flag.test.js +73 -0
  555. package/dist/commands/__tests__/node-worktree-flag.test.d.ts +1 -0
  556. package/dist/commands/__tests__/node-worktree-flag.test.js +49 -0
  557. package/dist/commands/__tests__/revive-now-gate.test.d.ts +1 -0
  558. package/dist/commands/__tests__/revive-now-gate.test.js +60 -0
  559. package/dist/commands/api-client.d.ts +100 -0
  560. package/dist/commands/api-client.js +377 -0
  561. package/dist/commands/attention.d.ts +2 -0
  562. package/dist/commands/attention.js +223 -0
  563. package/dist/commands/canvas-browse.d.ts +2 -0
  564. package/dist/commands/canvas-browse.js +95 -0
  565. package/dist/commands/canvas-config.d.ts +2 -0
  566. package/dist/commands/canvas-config.js +210 -0
  567. package/dist/commands/canvas-history/grep.d.ts +1 -0
  568. package/dist/commands/canvas-history/grep.js +104 -0
  569. package/dist/commands/canvas-history/read.d.ts +1 -0
  570. package/dist/commands/canvas-history/read.js +48 -0
  571. package/dist/commands/canvas-history/search.d.ts +1 -0
  572. package/dist/commands/canvas-history/search.js +118 -0
  573. package/dist/commands/canvas-history/shared.d.ts +27 -0
  574. package/dist/commands/canvas-history/shared.js +76 -0
  575. package/dist/commands/canvas-history.d.ts +2 -0
  576. package/dist/commands/canvas-history.js +30 -0
  577. package/dist/commands/canvas-issue.d.ts +2 -0
  578. package/dist/commands/canvas-issue.js +149 -0
  579. package/dist/commands/canvas-prune.d.ts +2 -0
  580. package/dist/commands/canvas-prune.js +108 -0
  581. package/dist/commands/canvas-rebuild-index.d.ts +2 -0
  582. package/dist/commands/canvas-rebuild-index.js +46 -0
  583. package/dist/commands/canvas-roster.d.ts +2 -0
  584. package/dist/commands/canvas-roster.js +62 -0
  585. package/dist/commands/canvas-snapshot.d.ts +2 -0
  586. package/dist/commands/canvas-snapshot.js +34 -0
  587. package/dist/commands/canvas-use.d.ts +1 -0
  588. package/dist/commands/canvas-use.js +63 -0
  589. package/dist/commands/canvas.d.ts +3 -0
  590. package/dist/commands/canvas.js +50 -0
  591. package/dist/commands/chord.d.ts +2 -0
  592. package/dist/commands/chord.js +242 -0
  593. package/dist/commands/cron.d.ts +2 -0
  594. package/dist/commands/cron.js +524 -0
  595. package/dist/commands/dashboard.d.ts +2 -0
  596. package/dist/commands/dashboard.js +80 -0
  597. package/dist/commands/human/prompts.d.ts +8 -0
  598. package/dist/commands/human/prompts.js +427 -0
  599. package/dist/commands/human/queue.d.ts +12 -0
  600. package/dist/commands/human/queue.js +531 -0
  601. package/dist/commands/human/shared.d.ts +80 -0
  602. package/dist/commands/human/shared.js +194 -0
  603. package/dist/commands/human.d.ts +2 -0
  604. package/dist/commands/human.js +44 -0
  605. package/dist/commands/memory/delete.d.ts +1 -0
  606. package/dist/commands/memory/delete.js +77 -0
  607. package/dist/commands/memory/find.d.ts +1 -0
  608. package/dist/commands/memory/find.js +192 -0
  609. package/dist/commands/memory/lint.d.ts +9 -0
  610. package/dist/commands/memory/lint.js +217 -0
  611. package/dist/commands/memory/list.d.ts +1 -0
  612. package/dist/commands/memory/list.js +84 -0
  613. package/dist/commands/memory/origin.d.ts +1 -0
  614. package/dist/commands/memory/origin.js +100 -0
  615. package/dist/commands/memory/read.d.ts +1 -0
  616. package/dist/commands/memory/read.js +72 -0
  617. package/dist/commands/memory/shared.d.ts +54 -0
  618. package/dist/commands/memory/shared.js +225 -0
  619. package/dist/commands/memory/write.d.ts +1 -0
  620. package/dist/commands/memory/write.js +142 -0
  621. package/dist/commands/memory.d.ts +2 -0
  622. package/dist/commands/memory.js +26 -0
  623. package/dist/commands/node-context.d.ts +2 -0
  624. package/dist/commands/node-context.js +157 -0
  625. package/dist/commands/node-inspect-artifacts.d.ts +1 -0
  626. package/dist/commands/node-inspect-artifacts.js +109 -0
  627. package/dist/commands/node-lifecycle-revive.d.ts +12 -0
  628. package/dist/commands/node-lifecycle-revive.js +287 -0
  629. package/dist/commands/node-snapshot.d.ts +2 -0
  630. package/dist/commands/node-snapshot.js +37 -0
  631. package/dist/commands/node-transcript.d.ts +2 -0
  632. package/dist/commands/node-transcript.js +62 -0
  633. package/dist/commands/node-worktree.d.ts +2 -0
  634. package/dist/commands/node-worktree.js +102 -0
  635. package/dist/commands/node.d.ts +44 -0
  636. package/dist/commands/node.js +1943 -0
  637. package/dist/commands/pkg/cli-inspect.d.ts +17 -0
  638. package/dist/commands/pkg/cli-inspect.js +190 -0
  639. package/dist/commands/pkg/cli-manage.d.ts +3 -0
  640. package/dist/commands/pkg/cli-manage.js +206 -0
  641. package/dist/commands/pkg/cli.d.ts +1 -0
  642. package/dist/commands/pkg/cli.js +14 -0
  643. package/dist/commands/pkg/market-inspect.d.ts +2 -0
  644. package/dist/commands/pkg/market-inspect.js +141 -0
  645. package/dist/commands/pkg/market-manage.d.ts +3 -0
  646. package/dist/commands/pkg/market-manage.js +224 -0
  647. package/dist/commands/pkg/market.d.ts +1 -0
  648. package/dist/commands/pkg/market.js +14 -0
  649. package/dist/commands/pkg/plugin-inspect.d.ts +2 -0
  650. package/dist/commands/pkg/plugin-inspect.js +150 -0
  651. package/dist/commands/pkg/plugin-manage.d.ts +19 -0
  652. package/dist/commands/pkg/plugin-manage.js +398 -0
  653. package/dist/commands/pkg/plugin.d.ts +1 -0
  654. package/dist/commands/pkg/plugin.js +14 -0
  655. package/dist/commands/pkg/shared.d.ts +5 -0
  656. package/dist/commands/pkg/shared.js +61 -0
  657. package/dist/commands/pkg.d.ts +2 -0
  658. package/dist/commands/pkg.js +24 -0
  659. package/dist/commands/profile/default.d.ts +2 -0
  660. package/dist/commands/profile/default.js +143 -0
  661. package/dist/commands/profile/delete.d.ts +1 -0
  662. package/dist/commands/profile/delete.js +39 -0
  663. package/dist/commands/profile/env.d.ts +2 -0
  664. package/dist/commands/profile/env.js +194 -0
  665. package/dist/commands/profile/list.d.ts +1 -0
  666. package/dist/commands/profile/list.js +35 -0
  667. package/dist/commands/profile/new.d.ts +1 -0
  668. package/dist/commands/profile/new.js +75 -0
  669. package/dist/commands/profile/project.d.ts +2 -0
  670. package/dist/commands/profile/project.js +97 -0
  671. package/dist/commands/profile/rename.d.ts +1 -0
  672. package/dist/commands/profile/rename.js +42 -0
  673. package/dist/commands/profile/show.d.ts +1 -0
  674. package/dist/commands/profile/show.js +50 -0
  675. package/dist/commands/profile.d.ts +2 -0
  676. package/dist/commands/profile.js +37 -0
  677. package/dist/commands/push.d.ts +2 -0
  678. package/dist/commands/push.js +166 -0
  679. package/dist/commands/revive.d.ts +2 -0
  680. package/dist/commands/revive.js +174 -0
  681. package/dist/commands/search/answer.d.ts +1 -0
  682. package/dist/commands/search/answer.js +50 -0
  683. package/dist/commands/search/contents.d.ts +1 -0
  684. package/dist/commands/search/contents.js +96 -0
  685. package/dist/commands/search/exa.d.ts +53 -0
  686. package/dist/commands/search/exa.js +157 -0
  687. package/dist/commands/search/puremd.d.ts +11 -0
  688. package/dist/commands/search/puremd.js +53 -0
  689. package/dist/commands/search/web.d.ts +1 -0
  690. package/dist/commands/search/web.js +65 -0
  691. package/dist/commands/search.d.ts +2 -0
  692. package/dist/commands/search.js +24 -0
  693. package/dist/commands/surface-edit.d.ts +2 -0
  694. package/dist/commands/surface-edit.js +159 -0
  695. package/dist/commands/surface-inspect.d.ts +2 -0
  696. package/dist/commands/surface-inspect.js +38 -0
  697. package/dist/commands/surface-node.d.ts +2 -0
  698. package/dist/commands/surface-node.js +16 -0
  699. package/dist/commands/surface-reload.d.ts +2 -0
  700. package/dist/commands/surface-reload.js +127 -0
  701. package/dist/commands/surface-tmux-spread.d.ts +2 -0
  702. package/dist/commands/surface-tmux-spread.js +220 -0
  703. package/dist/commands/surface.d.ts +2 -0
  704. package/dist/commands/surface.js +48 -0
  705. package/dist/commands/sys/__tests__/config-broker-thresholds.test.d.ts +1 -0
  706. package/dist/commands/sys/__tests__/config-broker-thresholds.test.js +95 -0
  707. package/dist/commands/sys/__tests__/config-keybindings.test.d.ts +1 -0
  708. package/dist/commands/sys/__tests__/config-keybindings.test.js +55 -0
  709. package/dist/commands/sys/__tests__/config-model-ladders.test.d.ts +1 -0
  710. package/dist/commands/sys/__tests__/config-model-ladders.test.js +121 -0
  711. package/dist/commands/sys/__tests__/helpers/setup-runtime.d.ts +5 -0
  712. package/dist/commands/sys/__tests__/helpers/setup-runtime.js +19 -0
  713. package/dist/commands/sys/__tests__/setup-core.test.d.ts +1 -0
  714. package/dist/commands/sys/__tests__/setup-core.test.js +291 -0
  715. package/dist/commands/sys/__tests__/setup-front-door.test.d.ts +1 -0
  716. package/dist/commands/sys/__tests__/setup-front-door.test.js +137 -0
  717. package/dist/commands/sys/__tests__/setup-models.test.d.ts +1 -0
  718. package/dist/commands/sys/__tests__/setup-models.test.js +205 -0
  719. package/dist/commands/sys/__tests__/setup-providers-viewport.test.d.ts +1 -0
  720. package/dist/commands/sys/__tests__/setup-providers-viewport.test.js +155 -0
  721. package/dist/commands/sys/__tests__/sync-deps.test.d.ts +1 -0
  722. package/dist/commands/sys/__tests__/sync-deps.test.js +188 -0
  723. package/dist/commands/sys/__tests__/sync-import.test.d.ts +1 -0
  724. package/dist/commands/sys/__tests__/sync-import.test.js +314 -0
  725. package/dist/commands/sys/config.d.ts +1 -0
  726. package/dist/commands/sys/config.js +292 -0
  727. package/dist/commands/sys/daemon.d.ts +2 -0
  728. package/dist/commands/sys/daemon.js +188 -0
  729. package/dist/commands/sys/doctor.d.ts +1 -0
  730. package/dist/commands/sys/doctor.js +528 -0
  731. package/dist/commands/sys/feedback.d.ts +1 -0
  732. package/dist/commands/sys/feedback.js +174 -0
  733. package/dist/commands/sys/logs.d.ts +1 -0
  734. package/dist/commands/sys/logs.js +127 -0
  735. package/dist/commands/sys/prompt-review.d.ts +1 -0
  736. package/dist/commands/sys/prompt-review.js +291 -0
  737. package/dist/commands/sys/promptstudio.d.ts +2 -0
  738. package/dist/commands/sys/promptstudio.js +65 -0
  739. package/dist/commands/sys/setup-core.d.ts +138 -0
  740. package/dist/commands/sys/setup-core.js +582 -0
  741. package/dist/commands/sys/setup-wizard.d.ts +130 -0
  742. package/dist/commands/sys/setup-wizard.js +2310 -0
  743. package/dist/commands/sys/setup.d.ts +6 -0
  744. package/dist/commands/sys/setup.js +36 -0
  745. package/dist/commands/sys/shared.d.ts +51 -0
  746. package/dist/commands/sys/shared.js +81 -0
  747. package/dist/commands/sys/support/prepare.d.ts +13 -0
  748. package/dist/commands/sys/support/prepare.js +235 -0
  749. package/dist/commands/sys/support/submit.d.ts +19 -0
  750. package/dist/commands/sys/support/submit.js +525 -0
  751. package/dist/commands/sys/support.d.ts +2 -0
  752. package/dist/commands/sys/support.js +18 -0
  753. package/dist/commands/sys/sync-deps.d.ts +19 -0
  754. package/dist/commands/sys/sync-deps.js +508 -0
  755. package/dist/commands/sys/sync-project-guidance.d.ts +1 -0
  756. package/dist/commands/sys/sync-project-guidance.js +345 -0
  757. package/dist/commands/sys/sync-shared.d.ts +7 -0
  758. package/dist/commands/sys/sync-shared.js +49 -0
  759. package/dist/commands/sys/sync-skills.d.ts +1 -0
  760. package/dist/commands/sys/sync-skills.js +306 -0
  761. package/dist/commands/sys/sync.d.ts +2 -0
  762. package/dist/commands/sys/sync.js +18 -0
  763. package/dist/commands/sys/sysprompt.d.ts +1 -0
  764. package/dist/commands/sys/sysprompt.js +97 -0
  765. package/dist/commands/sys/update.d.ts +2 -0
  766. package/dist/commands/sys/update.js +139 -0
  767. package/dist/commands/sys.d.ts +2 -0
  768. package/dist/commands/sys.js +30 -0
  769. package/dist/commands/view-cycle.d.ts +2 -0
  770. package/dist/commands/view-cycle.js +130 -0
  771. package/dist/commands/view-list.d.ts +2 -0
  772. package/dist/commands/view-list.js +66 -0
  773. package/dist/commands/view-new.d.ts +2 -0
  774. package/dist/commands/view-new.js +74 -0
  775. package/dist/commands/view-pick.d.ts +6 -0
  776. package/dist/commands/view-pick.js +129 -0
  777. package/dist/commands/view-run.d.ts +2 -0
  778. package/dist/commands/view-run.js +214 -0
  779. package/dist/commands/view.d.ts +2 -0
  780. package/dist/commands/view.js +31 -0
  781. package/dist/commands/workspace.d.ts +2 -0
  782. package/dist/commands/workspace.js +165 -0
  783. package/dist/core/__tests__/base-worker-prompt.test.d.ts +1 -0
  784. package/dist/core/__tests__/base-worker-prompt.test.js +60 -0
  785. package/dist/core/__tests__/boot-fault-attempt.test.d.ts +1 -0
  786. package/dist/core/__tests__/boot-fault-attempt.test.js +83 -0
  787. package/dist/core/__tests__/boot.test.d.ts +1 -0
  788. package/dist/core/__tests__/boot.test.js +275 -0
  789. package/dist/core/__tests__/branded-host-concurrency.test.d.ts +1 -0
  790. package/dist/core/__tests__/branded-host-concurrency.test.js +72 -0
  791. package/dist/core/__tests__/broker-fork-seam.test.d.ts +1 -0
  792. package/dist/core/__tests__/broker-fork-seam.test.js +118 -0
  793. package/dist/core/__tests__/broker-launch-candidates.test.d.ts +1 -0
  794. package/dist/core/__tests__/broker-launch-candidates.test.js +241 -0
  795. package/dist/core/__tests__/broker-preflight.test.d.ts +1 -0
  796. package/dist/core/__tests__/broker-preflight.test.js +95 -0
  797. package/dist/core/__tests__/broker-sdk-wiring.test.d.ts +1 -0
  798. package/dist/core/__tests__/broker-sdk-wiring.test.js +732 -0
  799. package/dist/core/__tests__/broker-snapshot-history.test.d.ts +1 -0
  800. package/dist/core/__tests__/broker-snapshot-history.test.js +213 -0
  801. package/dist/core/__tests__/canvas-inbox-watcher-hold.test.d.ts +1 -0
  802. package/dist/core/__tests__/canvas-inbox-watcher-hold.test.js +502 -0
  803. package/dist/core/__tests__/canvas-inbox-watcher.test.d.ts +1 -0
  804. package/dist/core/__tests__/canvas-inbox-watcher.test.js +255 -0
  805. package/dist/core/__tests__/canvas.test.d.ts +1 -0
  806. package/dist/core/__tests__/canvas.test.js +201 -0
  807. package/dist/core/__tests__/chat-view-reconnect.test.d.ts +1 -0
  808. package/dist/core/__tests__/chat-view-reconnect.test.js +105 -0
  809. package/dist/core/__tests__/child-death-wake.test.d.ts +1 -0
  810. package/dist/core/__tests__/child-death-wake.test.js +161 -0
  811. package/dist/core/__tests__/close.test.d.ts +1 -0
  812. package/dist/core/__tests__/close.test.js +254 -0
  813. package/dist/core/__tests__/command-plugins-surfaces.test.d.ts +1 -0
  814. package/dist/core/__tests__/command-plugins-surfaces.test.js +325 -0
  815. package/dist/core/__tests__/command-plugins.test.d.ts +1 -0
  816. package/dist/core/__tests__/command-plugins.test.js +448 -0
  817. package/dist/core/__tests__/connection-reconnect-resume.test.d.ts +1 -0
  818. package/dist/core/__tests__/connection-reconnect-resume.test.js +36 -0
  819. package/dist/core/__tests__/context-intro.test.d.ts +1 -0
  820. package/dist/core/__tests__/context-intro.test.js +256 -0
  821. package/dist/core/__tests__/cron-broker-capacity.test.d.ts +1 -0
  822. package/dist/core/__tests__/cron-broker-capacity.test.js +100 -0
  823. package/dist/core/__tests__/daemon-boot.test.d.ts +1 -0
  824. package/dist/core/__tests__/daemon-boot.test.js +374 -0
  825. package/dist/core/__tests__/daemon-wedge.test.d.ts +1 -0
  826. package/dist/core/__tests__/daemon-wedge.test.js +104 -0
  827. package/dist/core/__tests__/dead-node-policy-table.test.d.ts +1 -0
  828. package/dist/core/__tests__/dead-node-policy-table.test.js +103 -0
  829. package/dist/core/__tests__/deferred-no-wake.test.d.ts +1 -0
  830. package/dist/core/__tests__/deferred-no-wake.test.js +514 -0
  831. package/dist/core/__tests__/events-contract.test.d.ts +1 -0
  832. package/dist/core/__tests__/events-contract.test.js +76 -0
  833. package/dist/core/__tests__/fault-classifier.test.d.ts +1 -0
  834. package/dist/core/__tests__/fault-classifier.test.js +71 -0
  835. package/dist/core/__tests__/finalization-migration.test.d.ts +1 -0
  836. package/dist/core/__tests__/finalization-migration.test.js +38 -0
  837. package/dist/core/__tests__/fixtures/api-server-host.d.ts +1 -0
  838. package/dist/core/__tests__/fixtures/api-server-host.js +47 -0
  839. package/dist/core/__tests__/fixtures/c3-custom-provider-ext.d.ts +2 -0
  840. package/dist/core/__tests__/fixtures/c3-custom-provider-ext.js +34 -0
  841. package/dist/core/__tests__/fixtures/c5-command-boundary-ext.d.ts +2 -0
  842. package/dist/core/__tests__/fixtures/c5-command-boundary-ext.js +8 -0
  843. package/dist/core/__tests__/fixtures/extra-extension.d.ts +1 -0
  844. package/dist/core/__tests__/fixtures/extra-extension.js +3 -0
  845. package/dist/core/__tests__/fixtures/fake-engine.d.ts +310 -0
  846. package/dist/core/__tests__/fixtures/fake-engine.js +1210 -0
  847. package/dist/core/__tests__/fixtures/fake-pi-host.d.ts +2 -0
  848. package/dist/core/__tests__/fixtures/fake-pi-host.js +311 -0
  849. package/dist/core/__tests__/fixtures/metadata-migration-race.d.ts +1 -0
  850. package/dist/core/__tests__/fixtures/metadata-migration-race.js +49 -0
  851. package/dist/core/__tests__/fixtures/spawn-proof-target.test.d.ts +1 -0
  852. package/dist/core/__tests__/fixtures/spawn-proof-target.test.js +15 -0
  853. package/dist/core/__tests__/flagship-lifecycle.test.d.ts +1 -0
  854. package/dist/core/__tests__/flagship-lifecycle.test.js +303 -0
  855. package/dist/core/__tests__/focuses.test.d.ts +1 -0
  856. package/dist/core/__tests__/focuses.test.js +208 -0
  857. package/dist/core/__tests__/fork.test.d.ts +1 -0
  858. package/dist/core/__tests__/fork.test.js +108 -0
  859. package/dist/core/__tests__/full/broker-attach-limits.test.d.ts +1 -0
  860. package/dist/core/__tests__/full/broker-attach-limits.test.js +147 -0
  861. package/dist/core/__tests__/full/broker-attach-stream.test.d.ts +1 -0
  862. package/dist/core/__tests__/full/broker-attach-stream.test.js +133 -0
  863. package/dist/core/__tests__/full/broker-crash-teardown.test.d.ts +1 -0
  864. package/dist/core/__tests__/full/broker-crash-teardown.test.js +122 -0
  865. package/dist/core/__tests__/full/broker-deliver-ack.test.d.ts +1 -0
  866. package/dist/core/__tests__/full/broker-deliver-ack.test.js +73 -0
  867. package/dist/core/__tests__/full/broker-dialogs.test.d.ts +1 -0
  868. package/dist/core/__tests__/full/broker-dialogs.test.js +180 -0
  869. package/dist/core/__tests__/full/broker-display-snapshot.test.d.ts +1 -0
  870. package/dist/core/__tests__/full/broker-display-snapshot.test.js +75 -0
  871. package/dist/core/__tests__/full/broker-dormant-wake.test.d.ts +1 -0
  872. package/dist/core/__tests__/full/broker-dormant-wake.test.js +130 -0
  873. package/dist/core/__tests__/full/broker-model-changed-broadcast.test.d.ts +1 -0
  874. package/dist/core/__tests__/full/broker-model-changed-broadcast.test.js +57 -0
  875. package/dist/core/__tests__/full/broker-navigate-tree-rewelcome.test.d.ts +1 -0
  876. package/dist/core/__tests__/full/broker-navigate-tree-rewelcome.test.js +80 -0
  877. package/dist/core/__tests__/full/broker-pane-resolution.test.d.ts +1 -0
  878. package/dist/core/__tests__/full/broker-pane-resolution.test.js +155 -0
  879. package/dist/core/__tests__/full/broker-provider-retry.test.d.ts +1 -0
  880. package/dist/core/__tests__/full/broker-provider-retry.test.js +387 -0
  881. package/dist/core/__tests__/full/cascade-close.test.d.ts +1 -0
  882. package/dist/core/__tests__/full/cascade-close.test.js +240 -0
  883. package/dist/core/__tests__/full/consult-startup-failure.test.d.ts +1 -0
  884. package/dist/core/__tests__/full/consult-startup-failure.test.js +124 -0
  885. package/dist/core/__tests__/full/detach-focus.test.d.ts +1 -0
  886. package/dist/core/__tests__/full/detach-focus.test.js +126 -0
  887. package/dist/core/__tests__/full/idle-release-settlement.test.d.ts +1 -0
  888. package/dist/core/__tests__/full/idle-release-settlement.test.js +108 -0
  889. package/dist/core/__tests__/full/issue-146-yield-spawn-focus.test.d.ts +1 -0
  890. package/dist/core/__tests__/full/issue-146-yield-spawn-focus.test.js +107 -0
  891. package/dist/core/__tests__/full/park-clock-release.test.d.ts +1 -0
  892. package/dist/core/__tests__/full/park-clock-release.test.js +56 -0
  893. package/dist/core/__tests__/full/yield-message-transaction.test.d.ts +1 -0
  894. package/dist/core/__tests__/full/yield-message-transaction.test.js +70 -0
  895. package/dist/core/__tests__/helpers/broker-clients.d.ts +43 -0
  896. package/dist/core/__tests__/helpers/broker-clients.js +182 -0
  897. package/dist/core/__tests__/helpers/fleet.d.ts +12 -0
  898. package/dist/core/__tests__/helpers/fleet.js +45 -0
  899. package/dist/core/__tests__/helpers/harness.d.ts +128 -0
  900. package/dist/core/__tests__/helpers/harness.js +867 -0
  901. package/dist/core/__tests__/helpers/viewer-panes.d.ts +12 -0
  902. package/dist/core/__tests__/helpers/viewer-panes.js +133 -0
  903. package/dist/core/__tests__/history-inbox.test.d.ts +1 -0
  904. package/dist/core/__tests__/history-inbox.test.js +105 -0
  905. package/dist/core/__tests__/host-teardown-process-group.test.d.ts +1 -0
  906. package/dist/core/__tests__/host-teardown-process-group.test.js +476 -0
  907. package/dist/core/__tests__/human-cancel-guard.test.d.ts +1 -0
  908. package/dist/core/__tests__/human-cancel-guard.test.js +71 -0
  909. package/dist/core/__tests__/human-deliver-e2e.test.d.ts +1 -0
  910. package/dist/core/__tests__/human-deliver-e2e.test.js +123 -0
  911. package/dist/core/__tests__/human-deliver.test.d.ts +1 -0
  912. package/dist/core/__tests__/human-deliver.test.js +399 -0
  913. package/dist/core/__tests__/human-node-not-supervised.test.d.ts +1 -0
  914. package/dist/core/__tests__/human-node-not-supervised.test.js +94 -0
  915. package/dist/core/__tests__/inline-memory-refs.test.d.ts +1 -0
  916. package/dist/core/__tests__/inline-memory-refs.test.js +320 -0
  917. package/dist/core/__tests__/kickoff.test.d.ts +1 -0
  918. package/dist/core/__tests__/kickoff.test.js +148 -0
  919. package/dist/core/__tests__/lifecycle.test.d.ts +1 -0
  920. package/dist/core/__tests__/lifecycle.test.js +165 -0
  921. package/dist/core/__tests__/live-lifecycle-prompt.test.d.ts +1 -0
  922. package/dist/core/__tests__/live-lifecycle-prompt.test.js +51 -0
  923. package/dist/core/__tests__/live-mutation-verbs.test.d.ts +1 -0
  924. package/dist/core/__tests__/live-mutation-verbs.test.js +195 -0
  925. package/dist/core/__tests__/live-mutation.test.d.ts +1 -0
  926. package/dist/core/__tests__/live-mutation.test.js +197 -0
  927. package/dist/core/__tests__/memory-index-render.test.d.ts +1 -0
  928. package/dist/core/__tests__/memory-index-render.test.js +60 -0
  929. package/dist/core/__tests__/memory-resolver-precedence.test.d.ts +1 -0
  930. package/dist/core/__tests__/memory-resolver-precedence.test.js +169 -0
  931. package/dist/core/__tests__/migration.test.d.ts +1 -0
  932. package/dist/core/__tests__/migration.test.js +717 -0
  933. package/dist/core/__tests__/model-pin-durability.test.d.ts +1 -0
  934. package/dist/core/__tests__/model-pin-durability.test.js +124 -0
  935. package/dist/core/__tests__/on-read-crouter-home-fence.test.d.ts +1 -0
  936. package/dist/core/__tests__/on-read-crouter-home-fence.test.js +67 -0
  937. package/dist/core/__tests__/on-read-dedup-resume.test.d.ts +1 -0
  938. package/dist/core/__tests__/on-read-dedup-resume.test.js +121 -0
  939. package/dist/core/__tests__/on-read-identity.test.d.ts +1 -0
  940. package/dist/core/__tests__/on-read-identity.test.js +68 -0
  941. package/dist/core/__tests__/parse-argv-stdin-secret.test.d.ts +1 -0
  942. package/dist/core/__tests__/parse-argv-stdin-secret.test.js +26 -0
  943. package/dist/core/__tests__/passive-subscription.test.d.ts +1 -0
  944. package/dist/core/__tests__/passive-subscription.test.js +212 -0
  945. package/dist/core/__tests__/pid-identity-match.test.d.ts +1 -0
  946. package/dist/core/__tests__/pid-identity-match.test.js +145 -0
  947. package/dist/core/__tests__/pid-zombie.test.d.ts +1 -0
  948. package/dist/core/__tests__/pid-zombie.test.js +42 -0
  949. package/dist/core/__tests__/preview-registry-sync.test.d.ts +1 -0
  950. package/dist/core/__tests__/preview-registry-sync.test.js +65 -0
  951. package/dist/core/__tests__/prune-to-limit.test.d.ts +1 -0
  952. package/dist/core/__tests__/prune-to-limit.test.js +126 -0
  953. package/dist/core/__tests__/prune.test.d.ts +1 -0
  954. package/dist/core/__tests__/prune.test.js +135 -0
  955. package/dist/core/__tests__/push-final-guard.test.d.ts +1 -0
  956. package/dist/core/__tests__/push-final-guard.test.js +184 -0
  957. package/dist/core/__tests__/refresh-stall-recycle.test.d.ts +1 -0
  958. package/dist/core/__tests__/refresh-stall-recycle.test.js +101 -0
  959. package/dist/core/__tests__/relaunch-root.test.d.ts +1 -0
  960. package/dist/core/__tests__/relaunch-root.test.js +114 -0
  961. package/dist/core/__tests__/remote-canvas-target.test.d.ts +1 -0
  962. package/dist/core/__tests__/remote-canvas-target.test.js +87 -0
  963. package/dist/core/__tests__/reset.test.d.ts +1 -0
  964. package/dist/core/__tests__/reset.test.js +69 -0
  965. package/dist/core/__tests__/respawn-throttle.test.d.ts +1 -0
  966. package/dist/core/__tests__/respawn-throttle.test.js +154 -0
  967. package/dist/core/__tests__/review-model-floor.test.d.ts +1 -0
  968. package/dist/core/__tests__/review-model-floor.test.js +104 -0
  969. package/dist/core/__tests__/revive-all.test.d.ts +1 -0
  970. package/dist/core/__tests__/revive-all.test.js +147 -0
  971. package/dist/core/__tests__/revive.test.d.ts +1 -0
  972. package/dist/core/__tests__/revive.test.js +575 -0
  973. package/dist/core/__tests__/scope-crouter-home-fence.test.d.ts +1 -0
  974. package/dist/core/__tests__/scope-crouter-home-fence.test.js +55 -0
  975. package/dist/core/__tests__/secrets.test.d.ts +1 -0
  976. package/dist/core/__tests__/secrets.test.js +55 -0
  977. package/dist/core/__tests__/session-branch.test.d.ts +1 -0
  978. package/dist/core/__tests__/session-branch.test.js +61 -0
  979. package/dist/core/__tests__/session-cycles.test.d.ts +1 -0
  980. package/dist/core/__tests__/session-cycles.test.js +77 -0
  981. package/dist/core/__tests__/session-model.test.d.ts +1 -0
  982. package/dist/core/__tests__/session-model.test.js +129 -0
  983. package/dist/core/__tests__/spawn-no-kickoff.test.d.ts +1 -0
  984. package/dist/core/__tests__/spawn-no-kickoff.test.js +119 -0
  985. package/dist/core/__tests__/spawn-root.test.d.ts +1 -0
  986. package/dist/core/__tests__/spawn-root.test.js +320 -0
  987. package/dist/core/__tests__/spawn-worktree-id-conflict.test.d.ts +1 -0
  988. package/dist/core/__tests__/spawn-worktree-id-conflict.test.js +59 -0
  989. package/dist/core/__tests__/stdin-body-no-discard.test.d.ts +1 -0
  990. package/dist/core/__tests__/stdin-body-no-discard.test.js +33 -0
  991. package/dist/core/__tests__/stdout-errors.test.d.ts +1 -0
  992. package/dist/core/__tests__/stdout-errors.test.js +16 -0
  993. package/dist/core/__tests__/steer-note.test.d.ts +1 -0
  994. package/dist/core/__tests__/steer-note.test.js +41 -0
  995. package/dist/core/__tests__/stop-guard.test.d.ts +1 -0
  996. package/dist/core/__tests__/stop-guard.test.js +157 -0
  997. package/dist/core/__tests__/stream-watchdog.test.d.ts +1 -0
  998. package/dist/core/__tests__/stream-watchdog.test.js +154 -0
  999. package/dist/core/__tests__/subcommand-tier.test.d.ts +1 -0
  1000. package/dist/core/__tests__/subcommand-tier.test.js +99 -0
  1001. package/dist/core/__tests__/subscription-delivery.test.d.ts +1 -0
  1002. package/dist/core/__tests__/subscription-delivery.test.js +211 -0
  1003. package/dist/core/__tests__/subscription-pool-credential-guard.test.d.ts +1 -0
  1004. package/dist/core/__tests__/subscription-pool-credential-guard.test.js +94 -0
  1005. package/dist/core/__tests__/test-runner-cheap-sharding.test.d.ts +1 -0
  1006. package/dist/core/__tests__/test-runner-cheap-sharding.test.js +97 -0
  1007. package/dist/core/__tests__/tmux-surface.test.d.ts +1 -0
  1008. package/dist/core/__tests__/tmux-surface.test.js +470 -0
  1009. package/dist/core/__tests__/wake-bearings.test.d.ts +1 -0
  1010. package/dist/core/__tests__/wake-bearings.test.js +102 -0
  1011. package/dist/core/__tests__/worktree.test.d.ts +1 -0
  1012. package/dist/core/__tests__/worktree.test.js +876 -0
  1013. package/dist/core/__tests__/yield-ensures-daemon.test.d.ts +1 -0
  1014. package/dist/core/__tests__/yield-ensures-daemon.test.js +54 -0
  1015. package/dist/core/auth-file.d.ts +40 -0
  1016. package/dist/core/auth-file.js +177 -0
  1017. package/dist/core/auth-interaction.d.ts +19 -0
  1018. package/dist/core/auth-interaction.js +94 -0
  1019. package/dist/core/auto-update.d.ts +1 -0
  1020. package/dist/core/auto-update.js +93 -0
  1021. package/dist/core/bash-jobs.d.ts +55 -0
  1022. package/dist/core/bash-jobs.js +150 -0
  1023. package/dist/core/bootstrap.d.ts +5 -0
  1024. package/dist/core/bootstrap.js +98 -0
  1025. package/dist/core/broker-client/__tests__/transport-relay.test.d.ts +1 -0
  1026. package/dist/core/broker-client/__tests__/transport-relay.test.js +213 -0
  1027. package/dist/core/broker-client/client.d.ts +97 -0
  1028. package/dist/core/broker-client/client.js +189 -0
  1029. package/dist/core/broker-client/index.d.ts +1 -0
  1030. package/dist/core/broker-client/index.js +13 -0
  1031. package/dist/core/broker-client/transport-relay.d.ts +51 -0
  1032. package/dist/core/broker-client/transport-relay.js +169 -0
  1033. package/dist/core/broker-client/transport-socket.d.ts +29 -0
  1034. package/dist/core/broker-client/transport-socket.js +164 -0
  1035. package/dist/core/broker-client/transport.d.ts +32 -0
  1036. package/dist/core/broker-client/transport.js +26 -0
  1037. package/dist/core/canvas/__tests__/attention.test.d.ts +1 -0
  1038. package/dist/core/canvas/__tests__/attention.test.js +97 -0
  1039. package/dist/core/canvas/__tests__/human-work-outbox.test.d.ts +1 -0
  1040. package/dist/core/canvas/__tests__/human-work-outbox.test.js +123 -0
  1041. package/dist/core/canvas/__tests__/remote-canvas-source.test.d.ts +1 -0
  1042. package/dist/core/canvas/__tests__/remote-canvas-source.test.js +372 -0
  1043. package/dist/core/canvas/__tests__/remote-event-stream.test.d.ts +1 -0
  1044. package/dist/core/canvas/__tests__/remote-event-stream.test.js +146 -0
  1045. package/dist/core/canvas/__tests__/render-remote.test.d.ts +1 -0
  1046. package/dist/core/canvas/__tests__/render-remote.test.js +241 -0
  1047. package/dist/core/canvas/__tests__/source-resolve.test.d.ts +1 -0
  1048. package/dist/core/canvas/__tests__/source-resolve.test.js +77 -0
  1049. package/dist/core/canvas/attention.d.ts +19 -0
  1050. package/dist/core/canvas/attention.js +87 -0
  1051. package/dist/core/canvas/boot-id.d.ts +6 -0
  1052. package/dist/core/canvas/boot-id.js +26 -0
  1053. package/dist/core/canvas/boot.d.ts +93 -0
  1054. package/dist/core/canvas/boot.js +190 -0
  1055. package/dist/core/canvas/browse/__tests__/model.test.d.ts +1 -0
  1056. package/dist/core/canvas/browse/__tests__/model.test.js +290 -0
  1057. package/dist/core/canvas/browse/__tests__/rebuild-coalescer.test.d.ts +1 -0
  1058. package/dist/core/canvas/browse/__tests__/rebuild-coalescer.test.js +134 -0
  1059. package/dist/core/canvas/browse/__tests__/render.test.d.ts +1 -0
  1060. package/dist/core/canvas/browse/__tests__/render.test.js +111 -0
  1061. package/dist/core/canvas/browse/app.d.ts +41 -0
  1062. package/dist/core/canvas/browse/app.js +916 -0
  1063. package/dist/core/canvas/browse/model.d.ts +169 -0
  1064. package/dist/core/canvas/browse/model.js +485 -0
  1065. package/dist/core/canvas/browse/pins.d.ts +4 -0
  1066. package/dist/core/canvas/browse/pins.js +29 -0
  1067. package/dist/core/canvas/browse/rebuild-coalescer.d.ts +7 -0
  1068. package/dist/core/canvas/browse/rebuild-coalescer.js +61 -0
  1069. package/dist/core/canvas/browse/render.d.ts +59 -0
  1070. package/dist/core/canvas/browse/render.js +550 -0
  1071. package/dist/core/canvas/canvas.d.ts +358 -0
  1072. package/dist/core/canvas/canvas.js +897 -0
  1073. package/dist/core/canvas/crons.d.ts +222 -0
  1074. package/dist/core/canvas/crons.js +367 -0
  1075. package/dist/core/canvas/daemon-owner.d.ts +67 -0
  1076. package/dist/core/canvas/daemon-owner.js +141 -0
  1077. package/dist/core/canvas/db.d.ts +30 -0
  1078. package/dist/core/canvas/db.js +1167 -0
  1079. package/dist/core/canvas/extensions.d.ts +5 -0
  1080. package/dist/core/canvas/extensions.js +39 -0
  1081. package/dist/core/canvas/focuses.d.ts +22 -0
  1082. package/dist/core/canvas/focuses.js +81 -0
  1083. package/dist/core/canvas/history.d.ts +91 -0
  1084. package/dist/core/canvas/history.js +490 -0
  1085. package/dist/core/canvas/human-work-outbox.d.ts +73 -0
  1086. package/dist/core/canvas/human-work-outbox.js +261 -0
  1087. package/dist/core/canvas/index.d.ts +11 -0
  1088. package/dist/core/canvas/index.js +13 -0
  1089. package/dist/core/canvas/install-id.d.ts +9 -0
  1090. package/dist/core/canvas/install-id.js +84 -0
  1091. package/dist/core/canvas/labels.d.ts +28 -0
  1092. package/dist/core/canvas/labels.js +38 -0
  1093. package/dist/core/canvas/meta-file.d.ts +20 -0
  1094. package/dist/core/canvas/meta-file.js +98 -0
  1095. package/dist/core/canvas/nav-model.d.ts +55 -0
  1096. package/dist/core/canvas/nav-model.js +284 -0
  1097. package/dist/core/canvas/nav-render.d.ts +124 -0
  1098. package/dist/core/canvas/nav-render.js +266 -0
  1099. package/dist/core/canvas/paths.d.ts +81 -0
  1100. package/dist/core/canvas/paths.js +164 -0
  1101. package/dist/core/canvas/pid.d.ts +335 -0
  1102. package/dist/core/canvas/pid.js +636 -0
  1103. package/dist/core/canvas/remote-canvas-source.d.ts +62 -0
  1104. package/dist/core/canvas/remote-canvas-source.js +231 -0
  1105. package/dist/core/canvas/remote-event-stream.d.ts +24 -0
  1106. package/dist/core/canvas/remote-event-stream.js +94 -0
  1107. package/dist/core/canvas/render-source.d.ts +132 -0
  1108. package/dist/core/canvas/render-source.js +457 -0
  1109. package/dist/core/canvas/render.d.ts +47 -0
  1110. package/dist/core/canvas/render.js +237 -0
  1111. package/dist/core/canvas/source.d.ts +35 -0
  1112. package/dist/core/canvas/source.js +44 -0
  1113. package/dist/core/canvas/status-glyph.d.ts +42 -0
  1114. package/dist/core/canvas/status-glyph.js +116 -0
  1115. package/dist/core/canvas/telemetry.d.ts +14 -0
  1116. package/dist/core/canvas/telemetry.js +35 -0
  1117. package/dist/core/canvas/types.d.ts +302 -0
  1118. package/dist/core/canvas/types.js +8 -0
  1119. package/dist/core/clipboard-text.d.ts +3 -0
  1120. package/dist/core/clipboard-text.js +39 -0
  1121. package/dist/core/command-manifests/registry.d.ts +43 -0
  1122. package/dist/core/command-manifests/registry.js +103 -0
  1123. package/dist/core/command-manifests/schema.d.ts +87 -0
  1124. package/dist/core/command-manifests/schema.js +849 -0
  1125. package/dist/core/command-plugins/adapter.d.ts +22 -0
  1126. package/dist/core/command-plugins/adapter.js +160 -0
  1127. package/dist/core/command-plugins/compose.d.ts +11 -0
  1128. package/dist/core/command-plugins/compose.js +88 -0
  1129. package/dist/core/command-plugins/discovery.d.ts +74 -0
  1130. package/dist/core/command-plugins/discovery.js +291 -0
  1131. package/dist/core/command.d.ts +175 -0
  1132. package/dist/core/command.js +636 -0
  1133. package/dist/core/config.d.ts +125 -0
  1134. package/dist/core/config.js +620 -0
  1135. package/dist/core/configured-clis/cache.d.ts +16 -0
  1136. package/dist/core/configured-clis/cache.js +57 -0
  1137. package/dist/core/configured-clis/compose.d.ts +14 -0
  1138. package/dist/core/configured-clis/compose.js +60 -0
  1139. package/dist/core/configured-clis/discovery.d.ts +47 -0
  1140. package/dist/core/configured-clis/discovery.js +173 -0
  1141. package/dist/core/configured-clis/fetch.d.ts +51 -0
  1142. package/dist/core/configured-clis/fetch.js +156 -0
  1143. package/dist/core/configured-clis/invoker.d.ts +36 -0
  1144. package/dist/core/configured-clis/invoker.js +547 -0
  1145. package/dist/core/configured-clis/manifest.d.ts +24 -0
  1146. package/dist/core/configured-clis/manifest.js +284 -0
  1147. package/dist/core/configured-clis/registration.d.ts +40 -0
  1148. package/dist/core/configured-clis/registration.js +201 -0
  1149. package/dist/core/errors.d.ts +27 -0
  1150. package/dist/core/errors.js +48 -0
  1151. package/dist/core/events/emit.d.ts +4 -0
  1152. package/dist/core/events/emit.js +17 -0
  1153. package/dist/core/events/envelope.d.ts +2 -0
  1154. package/dist/core/events/envelope.js +84 -0
  1155. package/dist/core/events/errors.d.ts +4 -0
  1156. package/dist/core/events/errors.js +69 -0
  1157. package/dist/core/events/index.d.ts +5 -0
  1158. package/dist/core/events/index.js +4 -0
  1159. package/dist/core/events/operation-id.d.ts +4 -0
  1160. package/dist/core/events/operation-id.js +24 -0
  1161. package/dist/core/events/read.d.ts +40 -0
  1162. package/dist/core/events/read.js +639 -0
  1163. package/dist/core/events/serialize.d.ts +4 -0
  1164. package/dist/core/events/serialize.js +199 -0
  1165. package/dist/core/events/source.d.ts +18 -0
  1166. package/dist/core/events/source.js +47 -0
  1167. package/dist/core/events/types.d.ts +68 -0
  1168. package/dist/core/events/types.js +11 -0
  1169. package/dist/core/fault-classifier.d.ts +43 -0
  1170. package/dist/core/fault-classifier.js +143 -0
  1171. package/dist/core/feed/__tests__/coalesce-human.test.d.ts +1 -0
  1172. package/dist/core/feed/__tests__/coalesce-human.test.js +36 -0
  1173. package/dist/core/feed/__tests__/empty-node-guard.test.d.ts +1 -0
  1174. package/dist/core/feed/__tests__/empty-node-guard.test.js +45 -0
  1175. package/dist/core/feed/__tests__/inbox-migrate.test.d.ts +1 -0
  1176. package/dist/core/feed/__tests__/inbox-migrate.test.js +53 -0
  1177. package/dist/core/feed/feed.d.ts +31 -0
  1178. package/dist/core/feed/feed.js +159 -0
  1179. package/dist/core/feed/inbox-migrate.d.ts +11 -0
  1180. package/dist/core/feed/inbox-migrate.js +135 -0
  1181. package/dist/core/feed/inbox.d.ts +84 -0
  1182. package/dist/core/feed/inbox.js +407 -0
  1183. package/dist/core/feed/passive.d.ts +14 -0
  1184. package/dist/core/feed/passive.js +114 -0
  1185. package/dist/core/frontmatter.d.ts +8 -0
  1186. package/dist/core/frontmatter.js +35 -0
  1187. package/dist/core/fs-utils.d.ts +21 -0
  1188. package/dist/core/fs-utils.js +149 -0
  1189. package/dist/core/git.d.ts +22 -0
  1190. package/dist/core/git.js +72 -0
  1191. package/dist/core/help.d.ts +223 -0
  1192. package/dist/core/help.js +275 -0
  1193. package/dist/core/host-exports/__tests__/export-prunes-boot-skill.test.d.ts +1 -0
  1194. package/dist/core/host-exports/__tests__/export-prunes-boot-skill.test.js +84 -0
  1195. package/dist/core/host-exports/builtins.d.ts +50 -0
  1196. package/dist/core/host-exports/builtins.js +68 -0
  1197. package/dist/core/host-exports/export.d.ts +32 -0
  1198. package/dist/core/host-exports/export.js +128 -0
  1199. package/dist/core/inspector/core.d.ts +23 -0
  1200. package/dist/core/inspector/core.js +148 -0
  1201. package/dist/core/inspector/model.d.ts +54 -0
  1202. package/dist/core/inspector/model.js +182 -0
  1203. package/dist/core/inspector/text.d.ts +5 -0
  1204. package/dist/core/inspector/text.js +32 -0
  1205. package/dist/core/inspector/tui.d.ts +3 -0
  1206. package/dist/core/inspector/tui.js +220 -0
  1207. package/dist/core/io.d.ts +73 -0
  1208. package/dist/core/io.js +254 -0
  1209. package/dist/core/keybindings/__tests__/bespoke-consumers.test.d.ts +1 -0
  1210. package/dist/core/keybindings/__tests__/bespoke-consumers.test.js +40 -0
  1211. package/dist/core/keybindings/__tests__/inbox-affordance.test.d.ts +1 -0
  1212. package/dist/core/keybindings/__tests__/inbox-affordance.test.js +38 -0
  1213. package/dist/core/keybindings/__tests__/resolve.test.d.ts +1 -0
  1214. package/dist/core/keybindings/__tests__/resolve.test.js +233 -0
  1215. package/dist/core/keybindings/background-bash.d.ts +13 -0
  1216. package/dist/core/keybindings/background-bash.js +34 -0
  1217. package/dist/core/keybindings/catalog.d.ts +15 -0
  1218. package/dist/core/keybindings/catalog.js +285 -0
  1219. package/dist/core/keybindings/inbox.d.ts +21 -0
  1220. package/dist/core/keybindings/inbox.js +35 -0
  1221. package/dist/core/keybindings/index.d.ts +7 -0
  1222. package/dist/core/keybindings/index.js +6 -0
  1223. package/dist/core/keybindings/match.d.ts +29 -0
  1224. package/dist/core/keybindings/match.js +105 -0
  1225. package/dist/core/keybindings/persistence.d.ts +14 -0
  1226. package/dist/core/keybindings/persistence.js +31 -0
  1227. package/dist/core/keybindings/resolve.d.ts +22 -0
  1228. package/dist/core/keybindings/resolve.js +333 -0
  1229. package/dist/core/keybindings/types.d.ts +37 -0
  1230. package/dist/core/keybindings/types.js +1 -0
  1231. package/dist/core/locked-file.d.ts +24 -0
  1232. package/dist/core/locked-file.js +91 -0
  1233. package/dist/core/log.d.ts +3 -0
  1234. package/dist/core/log.js +27 -0
  1235. package/dist/core/manifest.d.ts +5 -0
  1236. package/dist/core/manifest.js +15 -0
  1237. package/dist/core/memory/inline-ref-grammar.d.ts +53 -0
  1238. package/dist/core/memory/inline-ref-grammar.js +99 -0
  1239. package/dist/core/memory/inline-ref-guidance.d.ts +8 -0
  1240. package/dist/core/memory/inline-ref-guidance.js +35 -0
  1241. package/dist/core/memory/inline-ref-inventory.d.ts +13 -0
  1242. package/dist/core/memory/inline-ref-inventory.js +79 -0
  1243. package/dist/core/memory-resolver.d.ts +106 -0
  1244. package/dist/core/memory-resolver.js +422 -0
  1245. package/dist/core/output.d.ts +35 -0
  1246. package/dist/core/output.js +99 -0
  1247. package/dist/core/pagination.d.ts +33 -0
  1248. package/dist/core/pagination.js +89 -0
  1249. package/dist/core/pool-credential-store.d.ts +34 -0
  1250. package/dist/core/pool-credential-store.js +116 -0
  1251. package/dist/core/predicate.d.ts +65 -0
  1252. package/dist/core/predicate.js +191 -0
  1253. package/dist/core/preview-registry.d.ts +25 -0
  1254. package/dist/core/preview-registry.js +2841 -0
  1255. package/dist/core/profiles/__tests__/env-store.test.d.ts +1 -0
  1256. package/dist/core/profiles/__tests__/env-store.test.js +97 -0
  1257. package/dist/core/profiles/__tests__/root-profile.test.d.ts +1 -0
  1258. package/dist/core/profiles/__tests__/root-profile.test.js +69 -0
  1259. package/dist/core/profiles/default-binding.d.ts +6 -0
  1260. package/dist/core/profiles/default-binding.js +46 -0
  1261. package/dist/core/profiles/env-store.d.ts +22 -0
  1262. package/dist/core/profiles/env-store.js +157 -0
  1263. package/dist/core/profiles/manifest.d.ts +35 -0
  1264. package/dist/core/profiles/manifest.js +371 -0
  1265. package/dist/core/profiles/select.d.ts +42 -0
  1266. package/dist/core/profiles/select.js +673 -0
  1267. package/dist/core/profiles/state-block.d.ts +4 -0
  1268. package/dist/core/profiles/state-block.js +16 -0
  1269. package/dist/core/provider-management.d.ts +12 -0
  1270. package/dist/core/provider-management.js +22 -0
  1271. package/dist/core/render.d.ts +12 -0
  1272. package/dist/core/render.js +127 -0
  1273. package/dist/core/resolver.d.ts +14 -0
  1274. package/dist/core/resolver.js +136 -0
  1275. package/dist/core/runtime/__tests__/command-expansion.test.d.ts +1 -0
  1276. package/dist/core/runtime/__tests__/command-expansion.test.js +25 -0
  1277. package/dist/core/runtime/__tests__/engine-route.test.d.ts +1 -0
  1278. package/dist/core/runtime/__tests__/engine-route.test.js +36 -0
  1279. package/dist/core/runtime/__tests__/install-id-cache-scoping.test.d.ts +1 -0
  1280. package/dist/core/runtime/__tests__/install-id-cache-scoping.test.js +41 -0
  1281. package/dist/core/runtime/__tests__/node-env.test.d.ts +1 -0
  1282. package/dist/core/runtime/__tests__/node-env.test.js +73 -0
  1283. package/dist/core/runtime/__tests__/spawn-at-given-id.test.d.ts +1 -0
  1284. package/dist/core/runtime/__tests__/spawn-at-given-id.test.js +34 -0
  1285. package/dist/core/runtime/__tests__/spawn-env.test.d.ts +1 -0
  1286. package/dist/core/runtime/__tests__/spawn-env.test.js +268 -0
  1287. package/dist/core/runtime/auth-reload.d.ts +7 -0
  1288. package/dist/core/runtime/auth-reload.js +67 -0
  1289. package/dist/core/runtime/banner.d.ts +13 -0
  1290. package/dist/core/runtime/banner.js +51 -0
  1291. package/dist/core/runtime/bearings.d.ts +99 -0
  1292. package/dist/core/runtime/bearings.js +429 -0
  1293. package/dist/core/runtime/boot-root.d.ts +24 -0
  1294. package/dist/core/runtime/boot-root.js +102 -0
  1295. package/dist/core/runtime/branded-host.d.ts +25 -0
  1296. package/dist/core/runtime/branded-host.js +342 -0
  1297. package/dist/core/runtime/broker-cli.d.ts +1 -0
  1298. package/dist/core/runtime/broker-cli.js +81 -0
  1299. package/dist/core/runtime/broker-protocol.d.ts +642 -0
  1300. package/dist/core/runtime/broker-protocol.js +146 -0
  1301. package/dist/core/runtime/broker-request.d.ts +37 -0
  1302. package/dist/core/runtime/broker-request.js +85 -0
  1303. package/dist/core/runtime/broker-sdk.d.ts +36 -0
  1304. package/dist/core/runtime/broker-sdk.js +128 -0
  1305. package/dist/core/runtime/broker.d.ts +245 -0
  1306. package/dist/core/runtime/broker.js +3711 -0
  1307. package/dist/core/runtime/busy.d.ts +32 -0
  1308. package/dist/core/runtime/busy.js +107 -0
  1309. package/dist/core/runtime/canvas-extensions.d.ts +20 -0
  1310. package/dist/core/runtime/canvas-extensions.js +70 -0
  1311. package/dist/core/runtime/close.d.ts +34 -0
  1312. package/dist/core/runtime/close.js +223 -0
  1313. package/dist/core/runtime/command-expansion.d.ts +19 -0
  1314. package/dist/core/runtime/command-expansion.js +104 -0
  1315. package/dist/core/runtime/connectivity.d.ts +12 -0
  1316. package/dist/core/runtime/connectivity.js +73 -0
  1317. package/dist/core/runtime/deliver-live.d.ts +26 -0
  1318. package/dist/core/runtime/deliver-live.js +63 -0
  1319. package/dist/core/runtime/fault-recovery-nudge.d.ts +3 -0
  1320. package/dist/core/runtime/fault-recovery-nudge.js +3 -0
  1321. package/dist/core/runtime/fault-recovery.d.ts +23 -0
  1322. package/dist/core/runtime/fault-recovery.js +83 -0
  1323. package/dist/core/runtime/fault.d.ts +64 -0
  1324. package/dist/core/runtime/fault.js +260 -0
  1325. package/dist/core/runtime/fleet.d.ts +57 -0
  1326. package/dist/core/runtime/fleet.js +35 -0
  1327. package/dist/core/runtime/front-door.d.ts +16 -0
  1328. package/dist/core/runtime/front-door.js +186 -0
  1329. package/dist/core/runtime/host.d.ts +43 -0
  1330. package/dist/core/runtime/host.js +432 -0
  1331. package/dist/core/runtime/interactive-deliver.d.ts +15 -0
  1332. package/dist/core/runtime/interactive-deliver.js +41 -0
  1333. package/dist/core/runtime/kickoff.d.ts +53 -0
  1334. package/dist/core/runtime/kickoff.js +289 -0
  1335. package/dist/core/runtime/launch-prompt.d.ts +8 -0
  1336. package/dist/core/runtime/launch-prompt.js +13 -0
  1337. package/dist/core/runtime/launch.d.ts +191 -0
  1338. package/dist/core/runtime/launch.js +442 -0
  1339. package/dist/core/runtime/lifecycle.d.ts +12 -0
  1340. package/dist/core/runtime/lifecycle.js +121 -0
  1341. package/dist/core/runtime/managed-provider-cooling.d.ts +38 -0
  1342. package/dist/core/runtime/managed-provider-cooling.js +81 -0
  1343. package/dist/core/runtime/memory.d.ts +3 -0
  1344. package/dist/core/runtime/memory.js +18 -0
  1345. package/dist/core/runtime/model-selection.d.ts +41 -0
  1346. package/dist/core/runtime/model-selection.js +118 -0
  1347. package/dist/core/runtime/model-swap.d.ts +27 -0
  1348. package/dist/core/runtime/model-swap.js +70 -0
  1349. package/dist/core/runtime/naming-persist.d.ts +11 -0
  1350. package/dist/core/runtime/naming-persist.js +41 -0
  1351. package/dist/core/runtime/naming.d.ts +26 -0
  1352. package/dist/core/runtime/naming.js +174 -0
  1353. package/dist/core/runtime/node-read.d.ts +36 -0
  1354. package/dist/core/runtime/node-read.js +255 -0
  1355. package/dist/core/runtime/nodes.d.ts +113 -0
  1356. package/dist/core/runtime/nodes.js +330 -0
  1357. package/dist/core/runtime/package-health.d.ts +49 -0
  1358. package/dist/core/runtime/package-health.js +217 -0
  1359. package/dist/core/runtime/persona.d.ts +25 -0
  1360. package/dist/core/runtime/persona.js +132 -0
  1361. package/dist/core/runtime/pi-cli.d.ts +8 -0
  1362. package/dist/core/runtime/pi-cli.js +65 -0
  1363. package/dist/core/runtime/pi-vendored.d.ts +26 -0
  1364. package/dist/core/runtime/pi-vendored.js +77 -0
  1365. package/dist/core/runtime/placement-tmux.d.ts +42 -0
  1366. package/dist/core/runtime/placement-tmux.js +151 -0
  1367. package/dist/core/runtime/placement.d.ts +97 -0
  1368. package/dist/core/runtime/placement.js +394 -0
  1369. package/dist/core/runtime/promote.d.ts +44 -0
  1370. package/dist/core/runtime/promote.js +176 -0
  1371. package/dist/core/runtime/recap.d.ts +8 -0
  1372. package/dist/core/runtime/recap.js +136 -0
  1373. package/dist/core/runtime/recycle.d.ts +14 -0
  1374. package/dist/core/runtime/recycle.js +158 -0
  1375. package/dist/core/runtime/reopen.d.ts +32 -0
  1376. package/dist/core/runtime/reopen.js +119 -0
  1377. package/dist/core/runtime/reset.d.ts +68 -0
  1378. package/dist/core/runtime/reset.js +198 -0
  1379. package/dist/core/runtime/resume-root.d.ts +6 -0
  1380. package/dist/core/runtime/resume-root.js +292 -0
  1381. package/dist/core/runtime/revive-all.d.ts +61 -0
  1382. package/dist/core/runtime/revive-all.js +106 -0
  1383. package/dist/core/runtime/revive.d.ts +58 -0
  1384. package/dist/core/runtime/revive.js +357 -0
  1385. package/dist/core/runtime/roadmap.d.ts +13 -0
  1386. package/dist/core/runtime/roadmap.js +45 -0
  1387. package/dist/core/runtime/session-branch.d.ts +13 -0
  1388. package/dist/core/runtime/session-branch.js +46 -0
  1389. package/dist/core/runtime/session-cycles.d.ts +30 -0
  1390. package/dist/core/runtime/session-cycles.js +77 -0
  1391. package/dist/core/runtime/session-list-cache.d.ts +53 -0
  1392. package/dist/core/runtime/session-list-cache.js +406 -0
  1393. package/dist/core/runtime/situational-context.d.ts +12 -0
  1394. package/dist/core/runtime/situational-context.js +48 -0
  1395. package/dist/core/runtime/situational-live.d.ts +9 -0
  1396. package/dist/core/runtime/situational-live.js +40 -0
  1397. package/dist/core/runtime/spawn-env.d.ts +31 -0
  1398. package/dist/core/runtime/spawn-env.js +179 -0
  1399. package/dist/core/runtime/spawn.d.ts +118 -0
  1400. package/dist/core/runtime/spawn.js +473 -0
  1401. package/dist/core/runtime/stop-guard.d.ts +18 -0
  1402. package/dist/core/runtime/stop-guard.js +77 -0
  1403. package/dist/core/runtime/stop-signals.d.ts +14 -0
  1404. package/dist/core/runtime/stop-signals.js +46 -0
  1405. package/dist/core/runtime/stream-watchdog.d.ts +55 -0
  1406. package/dist/core/runtime/stream-watchdog.js +140 -0
  1407. package/dist/core/runtime/structured-output.d.ts +12 -0
  1408. package/dist/core/runtime/structured-output.js +90 -0
  1409. package/dist/core/runtime/surface-bg.d.ts +11 -0
  1410. package/dist/core/runtime/surface-bg.js +68 -0
  1411. package/dist/core/runtime/tmux-chrome.d.ts +1 -0
  1412. package/dist/core/runtime/tmux-chrome.js +4 -0
  1413. package/dist/core/runtime/tmux.d.ts +247 -0
  1414. package/dist/core/runtime/tmux.js +858 -0
  1415. package/dist/core/runtime/warm-pool.d.ts +51 -0
  1416. package/dist/core/runtime/warm-pool.js +373 -0
  1417. package/dist/core/scope.d.ts +47 -0
  1418. package/dist/core/scope.js +255 -0
  1419. package/dist/core/secrets.d.ts +25 -0
  1420. package/dist/core/secrets.js +55 -0
  1421. package/dist/core/self-update.d.ts +21 -0
  1422. package/dist/core/self-update.js +105 -0
  1423. package/dist/core/session-model/session-state.d.ts +51 -0
  1424. package/dist/core/session-model/session-state.js +170 -0
  1425. package/dist/core/spawn.d.ts +16 -0
  1426. package/dist/core/spawn.js +30 -0
  1427. package/dist/core/stdout-errors.d.ts +3 -0
  1428. package/dist/core/stdout-errors.js +14 -0
  1429. package/dist/core/subscription-state.d.ts +138 -0
  1430. package/dist/core/subscription-state.js +918 -0
  1431. package/dist/core/substrate/ceiling.d.ts +20 -0
  1432. package/dist/core/substrate/ceiling.js +69 -0
  1433. package/dist/core/substrate/gate.d.ts +13 -0
  1434. package/dist/core/substrate/gate.js +21 -0
  1435. package/dist/core/substrate/index.d.ts +11 -0
  1436. package/dist/core/substrate/index.js +25 -0
  1437. package/dist/core/substrate/injected-store.d.ts +10 -0
  1438. package/dist/core/substrate/injected-store.js +55 -0
  1439. package/dist/core/substrate/on-read.d.ts +14 -0
  1440. package/dist/core/substrate/on-read.js +404 -0
  1441. package/dist/core/substrate/render-node.d.ts +11 -0
  1442. package/dist/core/substrate/render-node.js +29 -0
  1443. package/dist/core/substrate/render.d.ts +21 -0
  1444. package/dist/core/substrate/render.js +547 -0
  1445. package/dist/core/substrate/schema.d.ts +125 -0
  1446. package/dist/core/substrate/schema.js +191 -0
  1447. package/dist/core/substrate/session-cache.d.ts +25 -0
  1448. package/dist/core/substrate/session-cache.js +101 -0
  1449. package/dist/core/substrate/subject-fields.d.ts +45 -0
  1450. package/dist/core/substrate/subject-fields.js +38 -0
  1451. package/dist/core/substrate/subject.d.ts +12 -0
  1452. package/dist/core/substrate/subject.js +47 -0
  1453. package/dist/core/timing.d.ts +11 -0
  1454. package/dist/core/timing.js +94 -0
  1455. package/dist/core/tui/__tests__/host-keybindings.test.d.ts +1 -0
  1456. package/dist/core/tui/__tests__/host-keybindings.test.js +113 -0
  1457. package/dist/core/tui/draw.d.ts +100 -0
  1458. package/dist/core/tui/draw.js +359 -0
  1459. package/dist/core/tui/host.d.ts +66 -0
  1460. package/dist/core/tui/host.js +689 -0
  1461. package/dist/core/tui/terminal.d.ts +23 -0
  1462. package/dist/core/tui/terminal.js +101 -0
  1463. package/dist/core/view/__tests__/transport-cache.test.d.ts +1 -0
  1464. package/dist/core/view/__tests__/transport-cache.test.js +62 -0
  1465. package/dist/core/view/__tests__/transport-remote.test.d.ts +1 -0
  1466. package/dist/core/view/__tests__/transport-remote.test.js +98 -0
  1467. package/dist/core/view/bridge.d.ts +10 -0
  1468. package/dist/core/view/bridge.js +31 -0
  1469. package/dist/core/view/chrome.d.ts +9 -0
  1470. package/dist/core/view/chrome.js +22 -0
  1471. package/dist/core/view/contract.d.ts +205 -0
  1472. package/dist/core/view/contract.js +23 -0
  1473. package/dist/core/view/loader.d.ts +31 -0
  1474. package/dist/core/view/loader.js +188 -0
  1475. package/dist/core/view/remote-canvas-target.d.ts +4 -0
  1476. package/dist/core/view/remote-canvas-target.js +30 -0
  1477. package/dist/core/view/stream-local.d.ts +3 -0
  1478. package/dist/core/view/stream-local.js +231 -0
  1479. package/dist/core/view/transport-cache.d.ts +8 -0
  1480. package/dist/core/view/transport-cache.js +38 -0
  1481. package/dist/core/view/transport-local.d.ts +7 -0
  1482. package/dist/core/view/transport-local.js +83 -0
  1483. package/dist/core/view/transport-remote.d.ts +2 -0
  1484. package/dist/core/view/transport-remote.js +58 -0
  1485. package/dist/core/view/transport.d.ts +10 -0
  1486. package/dist/core/view/transport.js +15 -0
  1487. package/dist/core/wake.d.ts +86 -0
  1488. package/dist/core/wake.js +307 -0
  1489. package/dist/core/worktree.d.ts +111 -0
  1490. package/dist/core/worktree.js +732 -0
  1491. package/dist/daemon/__tests__/broker-ownership.test.d.ts +1 -0
  1492. package/dist/daemon/__tests__/broker-ownership.test.js +25 -0
  1493. package/dist/daemon/__tests__/daemon-ownership.test.d.ts +1 -0
  1494. package/dist/daemon/__tests__/daemon-ownership.test.js +27 -0
  1495. package/dist/daemon/api/__tests__/error-seam.test.d.ts +1 -0
  1496. package/dist/daemon/api/__tests__/error-seam.test.js +56 -0
  1497. package/dist/daemon/api/__tests__/full/api-server.test.d.ts +1 -0
  1498. package/dist/daemon/api/__tests__/full/api-server.test.js +369 -0
  1499. package/dist/daemon/api/__tests__/full/b10-attach-modelauth.test.d.ts +1 -0
  1500. package/dist/daemon/api/__tests__/full/b10-attach-modelauth.test.js +220 -0
  1501. package/dist/daemon/api/__tests__/full/push-parity.test.d.ts +1 -0
  1502. package/dist/daemon/api/__tests__/full/push-parity.test.js +199 -0
  1503. package/dist/daemon/api/__tests__/full/worktree-parity.test.d.ts +1 -0
  1504. package/dist/daemon/api/__tests__/full/worktree-parity.test.js +160 -0
  1505. package/dist/daemon/api/__tests__/inbox.test.d.ts +1 -0
  1506. package/dist/daemon/api/__tests__/inbox.test.js +578 -0
  1507. package/dist/daemon/api/bridge.d.ts +21 -0
  1508. package/dist/daemon/api/bridge.js +351 -0
  1509. package/dist/daemon/api/handlers/attach.d.ts +2 -0
  1510. package/dist/daemon/api/handlers/attach.js +56 -0
  1511. package/dist/daemon/api/handlers/canvas.d.ts +2 -0
  1512. package/dist/daemon/api/handlers/canvas.js +463 -0
  1513. package/dist/daemon/api/handlers/crons.d.ts +2 -0
  1514. package/dist/daemon/api/handlers/crons.js +354 -0
  1515. package/dist/daemon/api/handlers/daemon.d.ts +2 -0
  1516. package/dist/daemon/api/handlers/daemon.js +35 -0
  1517. package/dist/daemon/api/handlers/files.d.ts +2 -0
  1518. package/dist/daemon/api/handlers/files.js +64 -0
  1519. package/dist/daemon/api/handlers/focus.d.ts +2 -0
  1520. package/dist/daemon/api/handlers/focus.js +92 -0
  1521. package/dist/daemon/api/handlers/health.d.ts +2 -0
  1522. package/dist/daemon/api/handlers/health.js +65 -0
  1523. package/dist/daemon/api/handlers/human.d.ts +12 -0
  1524. package/dist/daemon/api/handlers/human.js +741 -0
  1525. package/dist/daemon/api/handlers/inbox.d.ts +2 -0
  1526. package/dist/daemon/api/handlers/inbox.js +423 -0
  1527. package/dist/daemon/api/handlers/messages.d.ts +2 -0
  1528. package/dist/daemon/api/handlers/messages.js +290 -0
  1529. package/dist/daemon/api/handlers/modelauth.d.ts +2 -0
  1530. package/dist/daemon/api/handlers/modelauth.js +116 -0
  1531. package/dist/daemon/api/handlers/nodes.d.ts +2 -0
  1532. package/dist/daemon/api/handlers/nodes.js +540 -0
  1533. package/dist/daemon/api/handlers/profiles.d.ts +2 -0
  1534. package/dist/daemon/api/handlers/profiles.js +69 -0
  1535. package/dist/daemon/api/handlers/reports.d.ts +2 -0
  1536. package/dist/daemon/api/handlers/reports.js +144 -0
  1537. package/dist/daemon/api/handlers/subscriptions.d.ts +2 -0
  1538. package/dist/daemon/api/handlers/subscriptions.js +53 -0
  1539. package/dist/daemon/api/handlers/worktree.d.ts +2 -0
  1540. package/dist/daemon/api/handlers/worktree.js +40 -0
  1541. package/dist/daemon/api/map.d.ts +100 -0
  1542. package/dist/daemon/api/map.js +360 -0
  1543. package/dist/daemon/api/router.d.ts +56 -0
  1544. package/dist/daemon/api/router.js +190 -0
  1545. package/dist/daemon/api/server.d.ts +23 -0
  1546. package/dist/daemon/api/server.js +258 -0
  1547. package/dist/daemon/control.d.ts +21 -0
  1548. package/dist/daemon/control.js +22 -0
  1549. package/dist/daemon/cron-run.d.ts +64 -0
  1550. package/dist/daemon/cron-run.js +944 -0
  1551. package/dist/daemon/cron-sink.d.ts +26 -0
  1552. package/dist/daemon/cron-sink.js +43 -0
  1553. package/dist/daemon/crtrd-cli.d.ts +1 -0
  1554. package/dist/daemon/crtrd-cli.js +18 -0
  1555. package/dist/daemon/crtrd.d.ts +89 -0
  1556. package/dist/daemon/crtrd.js +1953 -0
  1557. package/dist/daemon/fleet.d.ts +81 -0
  1558. package/dist/daemon/fleet.js +405 -0
  1559. package/dist/daemon/manage.d.ts +103 -0
  1560. package/dist/daemon/manage.js +389 -0
  1561. package/dist/daemon/pidfile.d.ts +8 -0
  1562. package/dist/daemon/pidfile.js +37 -0
  1563. package/dist/daemon/supervise-cadence.d.ts +1 -0
  1564. package/dist/daemon/supervise-cadence.js +6 -0
  1565. package/dist/index.d.ts +23 -0
  1566. package/dist/index.js +44 -0
  1567. package/dist/pi-extensions/__tests__/canvas-bash-valve.test.d.ts +1 -0
  1568. package/dist/pi-extensions/__tests__/canvas-bash-valve.test.js +31 -0
  1569. package/dist/pi-extensions/__tests__/canvas-context-intro.test.d.ts +1 -0
  1570. package/dist/pi-extensions/__tests__/canvas-context-intro.test.js +182 -0
  1571. package/dist/pi-extensions/__tests__/canvas-stophook-agentend.test.d.ts +1 -0
  1572. package/dist/pi-extensions/__tests__/canvas-stophook-agentend.test.js +467 -0
  1573. package/dist/pi-extensions/__tests__/canvas-stophook-context-nudge.test.d.ts +1 -0
  1574. package/dist/pi-extensions/__tests__/canvas-stophook-context-nudge.test.js +121 -0
  1575. package/dist/pi-extensions/canvas-bash-valve.d.ts +8 -0
  1576. package/dist/pi-extensions/canvas-bash-valve.js +297 -0
  1577. package/dist/pi-extensions/canvas-context-intro.d.ts +91 -0
  1578. package/dist/pi-extensions/canvas-context-intro.js +230 -0
  1579. package/dist/pi-extensions/canvas-doc-substrate.d.ts +44 -0
  1580. package/dist/pi-extensions/canvas-doc-substrate.js +151 -0
  1581. package/dist/pi-extensions/canvas-goal-capture.d.ts +21 -0
  1582. package/dist/pi-extensions/canvas-goal-capture.js +83 -0
  1583. package/dist/pi-extensions/canvas-inbox-watcher.d.ts +25 -0
  1584. package/dist/pi-extensions/canvas-inbox-watcher.js +942 -0
  1585. package/dist/pi-extensions/canvas-passive-context.d.ts +32 -0
  1586. package/dist/pi-extensions/canvas-passive-context.js +134 -0
  1587. package/dist/pi-extensions/canvas-recap.d.ts +41 -0
  1588. package/dist/pi-extensions/canvas-recap.js +263 -0
  1589. package/dist/pi-extensions/canvas-stophook.d.ts +53 -0
  1590. package/dist/pi-extensions/canvas-stophook.js +985 -0
  1591. package/dist/pi-extensions/canvas-structured-output.d.ts +9 -0
  1592. package/dist/pi-extensions/canvas-structured-output.js +155 -0
  1593. package/dist/prompts/review.d.ts +2 -0
  1594. package/dist/prompts/review.js +130 -0
  1595. package/dist/prompts/view.d.ts +7 -0
  1596. package/dist/prompts/view.js +172 -0
  1597. package/dist/suppress-experimental-warnings.d.ts +1 -0
  1598. package/dist/suppress-experimental-warnings.js +15 -0
  1599. package/dist/types.d.ts +297 -0
  1600. package/dist/types.js +153 -0
  1601. package/dist/web/ViewChrome.d.ts +7 -0
  1602. package/dist/web/ViewChrome.js +28 -0
  1603. package/dist/web/ViewPane.d.ts +39 -0
  1604. package/dist/web/ViewPane.js +48 -0
  1605. package/dist/web/index.d.ts +8 -0
  1606. package/dist/web/index.js +22 -0
  1607. package/dist/web/runtime.d.ts +39 -0
  1608. package/dist/web/runtime.js +232 -0
  1609. package/dist/web/states.d.ts +24 -0
  1610. package/dist/web/states.js +24 -0
  1611. package/dist/web/transport-http.d.ts +5 -0
  1612. package/dist/web/transport-http.js +34 -0
  1613. package/dist/web/transport-stream.d.ts +3 -0
  1614. package/dist/web/transport-stream.js +204 -0
  1615. package/dist/web-client/apple-touch-icon.png +0 -0
  1616. package/dist/web-client/assets/fragment-mono-latin-400-normal-BYwT3kSJ.woff +0 -0
  1617. package/dist/web-client/assets/fragment-mono-latin-400-normal-yxdJ5AmL.woff2 +0 -0
  1618. package/dist/web-client/assets/fragment-mono-latin-ext-400-normal-BbKYyvR9.woff2 +0 -0
  1619. package/dist/web-client/assets/fragment-mono-latin-ext-400-normal-CT4YFKeK.woff +0 -0
  1620. package/dist/web-client/assets/index-BpyZGBhI.js +79 -0
  1621. package/dist/web-client/assets/index-CpEl9LTS.css +2 -0
  1622. package/dist/web-client/assets/martian-mono-cyrillic-wght-normal-B84CD5C_.woff2 +0 -0
  1623. package/dist/web-client/assets/martian-mono-latin-ext-wght-normal-DlL6xMw5.woff2 +0 -0
  1624. package/dist/web-client/assets/martian-mono-latin-wght-normal-5W32yIyr.woff2 +0 -0
  1625. package/dist/web-client/assets/workbox-window.prod.es5-Bd17z0YL.js +2 -0
  1626. package/dist/web-client/icon-192.png +0 -0
  1627. package/dist/web-client/icon-512.png +0 -0
  1628. package/dist/web-client/icon-maskable-512.png +0 -0
  1629. package/dist/web-client/index.html +17 -0
  1630. package/dist/web-client/manifest.webmanifest +1 -0
  1631. package/dist/web-client/sw.js +1 -0
  1632. package/docs/compat/hearth-crtr-v1.md +187 -0
  1633. package/docs/compat/hearth-crtr-v2.md +185 -0
  1634. package/docs/compat/hearth-crtr-v3.md +184 -0
  1635. package/docs/compat/hearth-crtr-v4.md +188 -0
  1636. package/docs/compat/hearth-crtr-v5.md +175 -0
  1637. package/docs/public-api.md +77 -0
  1638. package/package.json +156 -0
  1639. package/runtime.lock.json +12919 -0
  1640. package/scripts/install-runtime.mjs +308 -0
  1641. package/scripts/patch-pi-tree-root-ordering.mjs +57 -0
  1642. package/scripts/postinstall.mjs +33 -0
  1643. package/scripts/runtime-lock.mjs +26 -0
@@ -0,0 +1,867 @@
1
+ // helpers/harness.ts — a reusable, FAITHFUL integration-test driver for the
2
+ // node/canvas runtime.
3
+ //
4
+ // It drives the REAL `crtr` CLI (as subprocesses, AS specific nodes) into a
5
+ // REAL but isolated tmux session, substitutes the fake-pi vehicle (fixtures/
6
+ // fake-pi-host.ts) for the LLM `pi` via the CRTR_PI_BINARY seam, fires the REAL
7
+ // extension hooks inside that fake-pi over a polled control channel, and runs
8
+ // the daemon decision pass in-process via superviseTick(now). Every assertion
9
+ // reads straight off the canvas data layer. NOTHING here mocks the runtime.
10
+ //
11
+ // See harness-design.md §4/§5 and vehicle-and-hooks.md §6 for the architecture
12
+ // this implements. The ONE production seam used is CRTR_PI_BINARY in
13
+ // piCommand (src/core/runtime/tmux.ts) — no production file is modified.
14
+ //
15
+ // Isolation contract (harness-design.md §4a):
16
+ // • The harness itself runs AS a canvas node, so its OWN process.env carries
17
+ // the REAL canvas vars. We override CRTR_HOME (+ CRTR_PI_BINARY) for our own
18
+ // in-process reads/revives, and scrub every canvas var from each subprocess
19
+ // env. closeDb() rebinds sqlite to the isolated home before every read.
20
+ // • The isolated tmux session lives on the DEFAULT server (the runtime shells
21
+ // `tmux` with no -L, so an -L server would be invisible to the real CLI and
22
+ // to superviseTick). We only ever kill-session, never kill-server.
23
+ import { spawnSync, spawn } from 'node:child_process';
24
+ import { mkdtempSync, rmSync, existsSync, readFileSync, readdirSync, writeFileSync, renameSync, } from 'node:fs';
25
+ import { homedir, tmpdir } from 'node:os';
26
+ import { join, dirname } from 'node:path';
27
+ import { fileURLToPath } from 'node:url';
28
+ import { createRequire } from 'node:module';
29
+ import { createNode, getNode, recordPid, subscribersOf, subscriptionsOf, } from '../../canvas/canvas.js';
30
+ import { closeDb } from '../../canvas/db.js';
31
+ import { isFocused } from '../../runtime/placement.js';
32
+ import { reviveNode } from '../../runtime/revive.js';
33
+ import { superviseTick } from '../../../daemon/crtrd.js';
34
+ import { DaemonFleet } from '../../../daemon/fleet.js';
35
+ import { apiSocketPath } from '../../canvas/paths.js';
36
+ import { bindDaemonEventSource, resetEventSourceForTests } from '../../events/source.js';
37
+ import { bindFleet, resetFleetForTests } from '../../runtime/fleet.js';
38
+ import { readInboxSince } from '../../feed/inbox.js';
39
+ import { capturePidCommand, recordedPidLiveness } from '../../canvas/pid.js';
40
+ // --- locations --------------------------------------------------------------
41
+ const HERE = dirname(fileURLToPath(import.meta.url));
42
+ const TREE_ROOT = join(HERE, '..', '..', '..'); // src/ or dist/
43
+ const CROUTER = join(TREE_ROOT, '..'); // package root
44
+ const COMPILED = TREE_ROOT === join(CROUTER, 'dist');
45
+ const MODULE_EXT = COMPILED ? '.js' : '.ts';
46
+ const CLI_ENTRY = join(TREE_ROOT, `cli${MODULE_EXT}`);
47
+ const FAKE_PI_HOST = join(HERE, '..', 'fixtures', `fake-pi-host${MODULE_EXT}`);
48
+ // The standalone API-server host (separate process — see the fixture header for
49
+ // why it cannot be in-process alongside the harness's spawnSync cli() driver).
50
+ const API_SERVER_HOST = join(HERE, '..', 'fixtures', `api-server-host${MODULE_EXT}`);
51
+ // The in-process fake BrokerEngine (the SDK analog of the fake-pi vehicle). The
52
+ // REAL broker loads it via the CRTR_BROKER_ENGINE seam (broker-sdk.ts). Source
53
+ // tests load the TypeScript fixture through tsx; compiled tests load its emitted
54
+ // JavaScript directly so every integration child exercises the built runtime.
55
+ const FAKE_ENGINE = join(HERE, '..', 'fixtures', `fake-engine${MODULE_EXT}`);
56
+ const TSX_ESM = COMPILED ? null : createRequire(import.meta.url).resolve('tsx/esm');
57
+ // A multi-word launcher, baked verbatim ahead of the (shell-quoted) argv by the
58
+ // seam. Absolute paths so it works regardless of the spawned window's cwd.
59
+ const FAKE_PI_BINARY = [process.execPath, ...(TSX_ESM === null ? [] : ['--import', TSX_ESM]), FAKE_PI_HOST].join(' ');
60
+ // Every raw `tmux` call the harness/full-tier tests make against the shared
61
+ // DEFAULT server is synchronous (spawnSync). Node's spawnSync blocks the WHOLE
62
+ // worker (no event loop, no `node --test` timeout can preempt it) until the
63
+ // child exits — with no `timeout` option it can wait FOREVER. A wedged/CPU-
64
+ // starved tmux server (the acknowledged "intermittent Linux-only crash-revive
65
+ // wedge", CI-only) has been observed to hang one of these calls indefinitely,
66
+ // which permanently consumes one of the `--test-concurrency` slots; as more
67
+ // full-tier files each hit the SAME wedged server, every slot eventually gets
68
+ // consumed the same way and the whole suite flatlines with zero further TAP
69
+ // output (confirmed 3/3 in CI, see ci-full-suite-hang-blocker.md). TMUX_TIMEOUT_MS
70
+ // bounds every raw tmux spawnSync call so a wedge fails that ONE call (and the
71
+ // test it belongs to) fast instead of hanging the run.
72
+ export const TMUX_TIMEOUT_MS = 10_000;
73
+ /** True when a usable tmux is on PATH — tests gate on this and SKIP otherwise. */
74
+ export function hasTmux() {
75
+ return spawnSync('tmux', ['-V'], { stdio: 'ignore', timeout: TMUX_TIMEOUT_MS }).status === 0;
76
+ }
77
+ function tmuxSessionExists(session) {
78
+ return (spawnSync('tmux', ['has-session', '-t', session], {
79
+ stdio: 'ignore',
80
+ timeout: TMUX_TIMEOUT_MS,
81
+ }).status === 0);
82
+ }
83
+ // Every canvas/tmux var the harness itself runs under — scrubbed from each child
84
+ // env so a spawned CLI cannot leak the REAL canvas into the isolated test.
85
+ const CANVAS_ENV_KEYS = [
86
+ 'CRTR_NODE_ID',
87
+ 'CRTR_HOME',
88
+ 'CRTR_ROOT_SESSION',
89
+ 'CRTR_SUBTREE',
90
+ 'CRTR_NODE_SESSION',
91
+ 'CRTR_PARENT_NODE_ID',
92
+ 'CRTR_FRONT_DOOR',
93
+ 'CRTR_KIND',
94
+ 'CRTR_MODE',
95
+ 'CRTR_LIFECYCLE',
96
+ 'CRTR_NODE_CWD',
97
+ 'CRTR_PI_BINARY',
98
+ // Scrubbed then re-added (controlled) in childEnv, mirroring CRTR_PI_BINARY —
99
+ // so the headless-broker seam can't leak the REAL engine into the isolated
100
+ // test, and the CLI subprocess that spawns a broker carries the FAKE one.
101
+ 'CRTR_BROKER_ENGINE',
102
+ 'TMUX',
103
+ 'TMUX_PANE',
104
+ ];
105
+ function cleanBaseEnv() {
106
+ const e = {};
107
+ for (const [k, v] of Object.entries(process.env))
108
+ if (v !== undefined)
109
+ e[k] = v;
110
+ for (const k of CANVAS_ENV_KEYS)
111
+ delete e[k];
112
+ // Contain per-invocation bootstrap + auto-update side effects (they write to
113
+ // ~/.crouter / ~/.claude / ~/.pi, NOT under CRTR_HOME — HOME is contained too).
114
+ e['CRTR_NO_BOOTSTRAP'] = '1';
115
+ e['CRTR_NO_AUTO_UPDATE'] = '1';
116
+ e['CRTR_NO_EXPORTS'] = '1';
117
+ e['CRTR_NO_AUTO_INIT'] = '1';
118
+ return e;
119
+ }
120
+ async function waitFor(probe, opts = {}) {
121
+ const timeoutMs = opts.timeoutMs ?? 20_000;
122
+ const intervalMs = opts.intervalMs ?? 100;
123
+ const deadline = Date.now() + timeoutMs;
124
+ for (;;) {
125
+ const v = probe();
126
+ if (v)
127
+ return v;
128
+ if (Date.now() > deadline)
129
+ throw new Error(`waitFor timed out: ${opts.label ?? 'condition'}`);
130
+ await new Promise((r) => setTimeout(r, intervalMs));
131
+ }
132
+ }
133
+ /** Thin wrapper: a headless-only harness (broker-hosted, paneless nodes). */
134
+ export async function createHeadlessHarness(opts = {}) {
135
+ return createHarness({ ...opts, headless: true });
136
+ }
137
+ export async function createHarness(opts = {}) {
138
+ const headless = opts.headless === true;
139
+ if (!headless && !hasTmux())
140
+ throw new Error('createHarness: tmux not available');
141
+ const origHome = process.env['CRTR_HOME'];
142
+ const origAgentHome = process.env['HOME'];
143
+ const origPiBinary = process.env['CRTR_PI_BINARY'];
144
+ const origNodeSession = process.env['CRTR_NODE_SESSION'];
145
+ const origNodeOptions = process.env['NODE_OPTIONS'];
146
+ const origBrokerEngine = process.env['CRTR_BROKER_ENGINE'];
147
+ // The headless broker binds a unix socket at <home>/nodes/<id>/view.sock. A
148
+ // unix socket path (sun_path) has a ~104-char OS limit, and macOS's per-user
149
+ // $TMPDIR (/var/folders/<…>/T/, ~49 chars) alone pushes that path past the
150
+ // limit — server.listen() then fails EINVAL and the broker's loop drains
151
+ // (boots, never serves). NOT a production concern (~/.crouter/canvas/… is
152
+ // short); a test-only artifact of the long temp base. Use a SHORT base + short
153
+ // prefix for the canvas home so broker sockets fit. tmpHome (HOME) hosts no
154
+ // socket, so it can stay on the standard temp base.
155
+ const shortTmpBase = existsSync('/tmp') ? '/tmp' : tmpdir();
156
+ const home = mkdtempSync(join(shortTmpBase, 'crh-'));
157
+ const tmpHome = mkdtempSync(join(tmpdir(), 'crtr-harness-HOME-'));
158
+ const session = `${opts.sessionPrefix ?? 'crtr-harness'}-${process.pid}-${Date.now().toString(36)}`;
159
+ // The harness reads/writes the isolated canvas in-process. CRTR_PI_BINARY in
160
+ // OUR env makes in-process revives (superviseTick → reviveNode → openNodeWindow)
161
+ // bake the fake-pi into the command string.
162
+ process.env['CRTR_HOME'] = home;
163
+ // HOME must be isolated in THIS process too, not just in the subprocess envs
164
+ // below: an in-process launch (spawnHeadlessChild's reviveNode, superviseTick
165
+ // pass-2 wakes) builds its broker env from process.env, so a real HOME here
166
+ // makes every broker read the developer's OWN ~/.pi/agent — auth.json and the
167
+ // managed subscription pools — instead of agentHome, and provider tests then
168
+ // pass or fail on whatever credentials the machine happens to hold.
169
+ // …but the isolated HOME must NOT hide the installed runtime generation from
170
+ // the `crtr` chrome panes tmux forks. `bin/crtr` resolves its generation from
171
+ // `$CRTR_RUNTIME_HOME` else `$HOME/.crouter/runtime`, and a viewer pane bakes
172
+ // in the BARE command `crtr surface attach to <id>` — so with HOME rewritten to
173
+ // an empty temp dir every viewer pane died with `invalid runtime selection:
174
+ // missing <tmpHome>/.crouter/runtime/selected` before it could self-tag.
175
+ // Pin the REAL runtime home (captured before the HOME rewrite) so panes load
176
+ // the generation `npm run install-runtime` selected. Runner-only until now
177
+ // purely by accident: a dev box already has a tmux server running with the
178
+ // developer's real HOME, and a new session inherits the SERVER's env — on a
179
+ // pristine runner the harness's own `new-session` starts the server, so the
180
+ // rewritten HOME becomes every pane's HOME.
181
+ const realRuntimeHome = process.env['CRTR_RUNTIME_HOME'] ?? join(process.env['HOME'] ?? homedir(), '.crouter', 'runtime');
182
+ process.env['HOME'] = tmpHome;
183
+ process.env['CRTR_RUNTIME_HOME'] = realRuntimeHome;
184
+ process.env['CRTR_PI_BINARY'] = FAKE_PI_BINARY;
185
+ delete process.env['CRTR_NODE_SESSION'];
186
+ // Source tests need tsx in every spawned broker because host.ts resolves its
187
+ // sibling broker-cli.js to broker-cli.ts and the fake engine is TypeScript.
188
+ // Compiled integration tests execute emitted JavaScript directly and scrub an
189
+ // ambient NODE_OPTIONS so their children do not accidentally pay for or depend
190
+ // on a source loader. dispose() restores the caller's value in both cases.
191
+ if (TSX_ESM === null) {
192
+ delete process.env['NODE_OPTIONS'];
193
+ }
194
+ else {
195
+ process.env['NODE_OPTIONS'] = [process.env['NODE_OPTIONS'], `--import ${TSX_ESM}`]
196
+ .filter((s) => s !== undefined && s !== '')
197
+ .join(' ');
198
+ }
199
+ process.env['CRTR_BROKER_ENGINE'] = FAKE_ENGINE;
200
+ closeDb();
201
+ // The harness drives superviseTick() in-process, so it stands in for the
202
+ // daemon process (crtrd.ts:2490 binds the same way at real-daemon startup).
203
+ // Reset first: `bound` is a single-assignment process global with no other
204
+ // unbind path, and each harness instance points at a different isolated
205
+ // `home`, so a bare re-bind() across sequential harnesses in one test
206
+ // process would throw "already bound". Binding daemon (not broker) here
207
+ // keeps in-process reviveNode()'s host.ts:299 `eventSource() === undefined`
208
+ // check false, so it never binds a broker source over this one.
209
+ resetEventSourceForTests();
210
+ bindDaemonEventSource();
211
+ // The harness also stands in for the daemon's FLEET: every in-harness broker
212
+ // launch (reviveNode from a test, superviseTick pass-2 wakes) registers its
213
+ // ChildProcess handle here, and real child exits enqueue exit-policy jobs on
214
+ // this serial work lane — the same single-lane discipline crtrd runs, but
215
+ // drainable to a deterministic quiescent point. Reset first for the same
216
+ // reason as the event source above (process-global, sequential harnesses).
217
+ resetFleetForTests();
218
+ let laneTail = Promise.resolve();
219
+ let laneClosed = false;
220
+ function enqueueLaneJob(job) {
221
+ // Same admission rule as crtrd's shutdown: once the harness is disposed,
222
+ // late exit events (dispose SIGKILLs every broker; their exit callbacks
223
+ // fire on later event-loop turns, after CRTR_HOME is restored) must NOT
224
+ // run policy — they would read the REAL canvas home.
225
+ if (laneClosed)
226
+ return laneTail;
227
+ // Drop the cached SQLite handle before every policy job. crtrd owns canvas
228
+ // state in-process, so its exit policy always reads its own writes; the
229
+ // harness runs lifecycle verbs as SUBPROCESSES (`h.cli`), whose WAL writes
230
+ // are invisible to a cached handle. Without this, an exit landing just
231
+ // after `node lifecycle close` reads the pre-close row (still active, with
232
+ // a session id), classifies `respawn-resume`, and RELAUNCHES a node the
233
+ // close just canceled — the intermittent "broker engine destroyed by
234
+ // close" failure, which only reproduced when the exit lost the race.
235
+ const run = laneTail.then(() => { closeDb(); return job(); }).then(() => { }, (err) => {
236
+ // Policy jobs contain their own error handling; anything escaping is a
237
+ // genuine bug — surface it, never wedge the lane.
238
+ console.error('[harness] fleet lane job failed:', err);
239
+ });
240
+ laneTail = run;
241
+ return run;
242
+ }
243
+ async function drainLane() {
244
+ let tail;
245
+ do {
246
+ tail = laneTail;
247
+ await tail;
248
+ } while (tail !== laneTail);
249
+ }
250
+ const fleet = new DaemonFleet({ epoch: 'harness-epoch', enqueue: enqueueLaneJob });
251
+ bindFleet(fleet);
252
+ // Neutralize ensureDaemon (spawn.ts calls it on every `node new`): write a
253
+ // fake-live-daemon pidfile pointing at OUR (always-alive) pid, so
254
+ // isDaemonRunning() is true and no REAL crtrd is spawned against the isolated
255
+ // home. Source-mode broker launches propagate NODE_OPTIONS=--import tsx to
256
+ // subprocesses, so allowing ensureDaemon to start a real supervisor would race
257
+ // the in-process superviseTick + fixed-clock crash/grace scenarios. The same
258
+ // containment keeps compiled runs identical. The harness drives the daemon pass
259
+ // itself via `tick()`. (fakeLiveDaemon pattern, home-session.test.ts.) home/ is
260
+ // rmSync'd in dispose.
261
+ writeFileSync(join(home, 'crtrd.pid'), String(process.pid), 'utf8');
262
+ const pidsToKill = new Set();
263
+ let nextRootSeq = 0;
264
+ // Every REAL `crtr` CLI subprocess this harness spawns (`node new`,
265
+ // `node promote`, `node message send`, `push final`, …) routes its canvas reads/mutations
266
+ // through cliClient() over crtrd's socket. The fake pidfile above makes
267
+ // isDaemonRunning() true so ensureDaemon never spawns a REAL crtrd against the
268
+ // isolated home — but that leaves the socket UNBOUND, so a subprocess client
269
+ // finds nothing (exit 5, daemon_unavailable). Stand up an API server on THIS
270
+ // isolated home's socket. It MUST run in a SEPARATE process: cli() drives the
271
+ // CLI via spawnSync, which blocks this process's event loop until the child
272
+ // exits, so an in-process server could never answer that child's request
273
+ // (request_timeout). The api-server-host fixture runs createApiServer() ONLY
274
+ // (no supervision loop — the harness drives superviseTick itself), carrying
275
+ // CRTR_HOME=home so apiSocketPath() resolves to this isolated socket. Killed
276
+ // in dispose(). No real subprocess daemon is ever autostarted; no client is
277
+ // mocked.
278
+ const apiServerProc = spawn(process.execPath, [...(TSX_ESM === null ? [] : ['--import', TSX_ESM]), API_SERVER_HOST], {
279
+ cwd: CROUTER,
280
+ // `node new`/`node promote`/… route to THIS server, whose spawnChild/
281
+ // reviveNode launch the broker ENGINE as a detached child of this very
282
+ // process (launchBrokerOrCrash, spawn.ts). That broker must load the FAKE
283
+ // pi vehicle + fake BrokerEngine, so carry the same two seams childEnv
284
+ // gives every in-process harness launch (cleanBaseEnv scrubs them). HOME
285
+ // is pinned to the isolated tmpHome so the server + the brokers it spawns
286
+ // never read the real user home. Without these, spawnChild launches the
287
+ // REAL pi and the child never boots (awaitBoot: pi_pid=null, bootCount=0).
288
+ env: {
289
+ ...cleanBaseEnv(),
290
+ CRTR_HOME: home,
291
+ HOME: tmpHome,
292
+ CRTR_PI_BINARY: FAKE_PI_BINARY,
293
+ CRTR_BROKER_ENGINE: FAKE_ENGINE,
294
+ },
295
+ stdio: ['ignore', 'pipe', 'pipe'],
296
+ });
297
+ let apiServerStderr = '';
298
+ apiServerProc.stderr?.on('data', (chunk) => {
299
+ apiServerStderr += chunk.toString();
300
+ });
301
+ if (apiServerProc.pid !== undefined)
302
+ pidsToKill.add(apiServerProc.pid);
303
+ try {
304
+ await waitFor(() => existsSync(apiSocketPath()), {
305
+ timeoutMs: 30_000,
306
+ intervalMs: 25,
307
+ label: 'api server socket bind',
308
+ });
309
+ }
310
+ catch (err) {
311
+ try {
312
+ apiServerProc.kill('SIGKILL');
313
+ }
314
+ catch {
315
+ /* already gone */
316
+ }
317
+ throw new Error(`api-server-host never bound ${apiSocketPath()}\n--server stderr--\n${apiServerStderr}`, { cause: err });
318
+ }
319
+ // Pre-create the isolated session on the DEFAULT server so teardown always
320
+ // has a kill-sessions target.
321
+ // ISOLATION ASSUMPTION (see header + MINOR-6): isolation is by SESSION NAME on
322
+ // the DEFAULT tmux server only. The runtime CLI shells `tmux` with no `-L`, so
323
+ // a custom-socket server (`tmux -L foo`) would be invisible to it; this harness
324
+ // therefore assumes the default socket and only ever kill-sessions, never the
325
+ // server.
326
+ // HEADLESS: skip ALL eager tmux setup. No node in a headless run opens a
327
+ // window, so there is no pane to pre-seed an env into and no session to pre-
328
+ // create.
329
+ if (!headless) {
330
+ // -x/-y explicitly: a DETACHED session with no client attached inherits
331
+ // tmux's 80x24 default, and these tests split it several times before
332
+ // `surface node focus` splits once more for the viewer. At 24 rows the
333
+ // viewer lands in a 2-row pane (or the split fails outright), the attach
334
+ // TUI exits, and tmux closes the pane — leaving the node with no tagged
335
+ // viewer and the test with nothing to look at. A dev box's session is as
336
+ // big as the developer's terminal, which is why this was hosted-runner-only.
337
+ spawnSync('tmux', ['new-session', '-d', '-s', session, '-x', '250', '-y', '60', '-c', CROUTER, 'sleep 100000'], {
338
+ stdio: 'ignore',
339
+ timeout: TMUX_TIMEOUT_MS,
340
+ });
341
+ // Put CRTR_PI_BINARY in the SESSION environment so EVERY pane/process spawned
342
+ // in this session inherits it — so any pi the runtime launches (boot, revive)
343
+ // resolves to the fake-pi vehicle, not a real pi.
344
+ spawnSync('tmux', ['set-environment', '-t', session, 'CRTR_PI_BINARY', FAKE_PI_BINARY], {
345
+ stdio: 'ignore',
346
+ timeout: TMUX_TIMEOUT_MS,
347
+ });
348
+ spawnSync('tmux', ['set-environment', '-t', session, 'CRTR_HOME', home], {
349
+ stdio: 'ignore',
350
+ timeout: TMUX_TIMEOUT_MS,
351
+ });
352
+ // Every `crtr` pane this session forks (the attach viewers above all) must
353
+ // find the installed runtime generation despite the isolated HOME.
354
+ spawnSync('tmux', ['set-environment', '-t', session, 'CRTR_RUNTIME_HOME', realRuntimeHome], {
355
+ stdio: 'ignore',
356
+ timeout: TMUX_TIMEOUT_MS,
357
+ });
358
+ }
359
+ // -- env for a subprocess CLI invocation -----------------------------------
360
+ function childEnv(nodeId) {
361
+ const e = cleanBaseEnv();
362
+ e['CRTR_HOME'] = home;
363
+ e['HOME'] = tmpHome;
364
+ e['CRTR_RUNTIME_HOME'] = realRuntimeHome;
365
+ e['CRTR_NODE_SESSION'] = session;
366
+ e['CRTR_PI_BINARY'] = FAKE_PI_BINARY;
367
+ e['CRTR_BROKER_ENGINE'] = FAKE_ENGINE;
368
+ if (nodeId !== null)
369
+ e['CRTR_NODE_ID'] = nodeId;
370
+ return e;
371
+ }
372
+ function nodeDir(id) {
373
+ return join(home, 'nodes', id);
374
+ }
375
+ function nodeDirs() {
376
+ try {
377
+ // Node ids are minted by newNodeId() (runtime/nodes.ts) as
378
+ // `<install>-<time36>-<rand4hex>` (a72554e3 stamped the canvas-install id
379
+ // onto the historical 2-segment `<time36>-<rand4hex>` shape, so the id is
380
+ // opaque and its segment count has already changed once — mirror
381
+ // profiles/manifest.ts's ID_SHAPE rather than hard-coding a segment
382
+ // count). Scope the scan to "one or more lowercase-alnum segments ending
383
+ // in an 8-hex random suffix" so a stray non-node sibling under nodes/ is
384
+ // never miscounted as a new node dir — e.g. a `reports/` dir created for
385
+ // an empty node id (the rare CI flake on full-tier run 27459304455 that
386
+ // broke the spawn counters with `expected exactly 1 new node dir, got
387
+ // [<id>, reports]`), or literal `reports` (no hyphen, no hex suffix).
388
+ return readdirSync(join(home, 'nodes')).filter((d) => /^[a-z0-9]+(?:-[a-z0-9]+)*-[0-9a-f]{8}$/.test(d));
389
+ }
390
+ catch {
391
+ return [];
392
+ }
393
+ }
394
+ function readLines(path) {
395
+ try {
396
+ return readFileSync(path, 'utf8')
397
+ .split('\n')
398
+ .filter((l) => l.trim() !== '');
399
+ }
400
+ catch {
401
+ return [];
402
+ }
403
+ }
404
+ function cli(nodeId, args) {
405
+ const runtimeArgs = TSX_ESM === null ? [] : ['--import', TSX_ESM];
406
+ const res = spawnSync(process.execPath, [...runtimeArgs, CLI_ENTRY, ...args], {
407
+ cwd: CROUTER,
408
+ env: childEnv(nodeId),
409
+ encoding: 'utf8',
410
+ stdio: ['ignore', 'pipe', 'pipe'],
411
+ timeout: 60_000,
412
+ });
413
+ closeDb();
414
+ let json;
415
+ try {
416
+ json = JSON.parse(res.stdout ?? '');
417
+ }
418
+ catch {
419
+ /* not json */
420
+ }
421
+ return { code: res.status ?? -1, stdout: res.stdout ?? '', stderr: res.stderr ?? '', json };
422
+ }
423
+ // -- control channel -------------------------------------------------------
424
+ function sendCmd(nodeId, cmd) {
425
+ const dir = nodeDir(nodeId);
426
+ const tmp = join(dir, 'fake-pi.cmd.tmp');
427
+ writeFileSync(tmp, JSON.stringify(cmd));
428
+ renameSync(tmp, join(dir, 'fake-pi.cmd')); // atomic: host never reads a partial
429
+ }
430
+ function eventCount(nodeId, event) {
431
+ return readLines(join(nodeDir(nodeId), 'fake-pi.events.jsonl')).filter((l) => {
432
+ try {
433
+ return JSON.parse(l).event === event;
434
+ }
435
+ catch {
436
+ return false;
437
+ }
438
+ }).length;
439
+ }
440
+ function bootCount(nodeId) {
441
+ return readLines(join(nodeDir(nodeId), 'fake-pi.boots.jsonl')).length;
442
+ }
443
+ function injected(nodeId) {
444
+ return readLines(join(nodeDir(nodeId), 'fake-pi.injected.jsonl'))
445
+ .map((l) => {
446
+ try {
447
+ return JSON.parse(l);
448
+ }
449
+ catch {
450
+ return null;
451
+ }
452
+ })
453
+ .filter((x) => x !== null);
454
+ }
455
+ // Wait for the host to have BEGUN dispatching agent_end (recorded before its
456
+ // handlers run, so it survives a handler that tears the process down).
457
+ async function awaitAgentEnd(nodeId, base, label) {
458
+ await waitFor(() => eventCount(nodeId, 'agent_end') > base, {
459
+ timeoutMs: 20_000,
460
+ label,
461
+ });
462
+ }
463
+ const harness = {
464
+ home,
465
+ agentHome: tmpHome,
466
+ session,
467
+ spawnRoot(task, o = {}) {
468
+ const id = o.id ?? `root-${process.pid}-${nextRootSeq++}`;
469
+ const meta = {
470
+ node_id: id,
471
+ name: o.id ?? (task.slice(0, 24) || id),
472
+ created: new Date().toISOString(),
473
+ cwd: CROUTER,
474
+ kind: o.kind ?? 'general',
475
+ mode: o.mode ?? 'base',
476
+ lifecycle: o.lifecycle ?? 'resident',
477
+ status: 'active',
478
+ parent: null,
479
+ };
480
+ createNode(meta);
481
+ // Every real bootRoot records its broker's pid synchronously at launch
482
+ // (spawn.ts's bootRoot calls recordPid right after launchBrokerOrCrash,
483
+ // well before any daemon tick) — a production root's pi_pid is never
484
+ // null for longer than an instant. This in-process fixture has no real
485
+ // broker to launch, so mint it a pid that is genuinely alive for the
486
+ // rest of the test: this harness process's own pid (already threaded
487
+ // into the id scheme above). The pid is metadata post-cutover (fleet
488
+ // entries are the liveness authority), but status surfaces and identity
489
+ // rechecks still read it, so keep the fixture row shaped like a real one.
490
+ recordPid(id, process.pid);
491
+ closeDb();
492
+ return id;
493
+ },
494
+ fabricateBrokerNode(o = {}) {
495
+ const id = o.id ?? `brk-${process.pid}-${nextRootSeq++}`;
496
+ const meta = {
497
+ node_id: id,
498
+ name: id,
499
+ created: new Date().toISOString(),
500
+ cwd: CROUTER,
501
+ host_kind: 'broker',
502
+ kind: o.kind ?? 'developer',
503
+ mode: o.mode ?? 'base',
504
+ lifecycle: o.lifecycle ?? 'terminal',
505
+ parent: o.parent ?? null,
506
+ pi_session_id: o.pi_session_id ?? null,
507
+ pi_session_file: o.pi_session_file ?? null,
508
+ status: o.status ?? 'active',
509
+ intent: o.intent ?? null,
510
+ pi_pid: o.pi_pid ?? null,
511
+ };
512
+ createNode(meta);
513
+ closeDb();
514
+ return id;
515
+ },
516
+ async spawnChild(parentId, task, o = {}) {
517
+ const before = new Set(nodeDirs());
518
+ const args = ['node', 'new', task, '--parent', parentId, '--cwd', CROUTER];
519
+ if (o.kind)
520
+ args.push('--kind', o.kind);
521
+ if (o.mode)
522
+ args.push('--mode', o.mode);
523
+ if (o.model)
524
+ args.push('--model', o.model);
525
+ const res = cli(parentId, args);
526
+ if (res.code !== 0) {
527
+ throw new Error(`spawnChild(${parentId}) failed (code ${res.code})\n--stdout--\n${res.stdout}\n--stderr--\n${res.stderr}`);
528
+ }
529
+ const added = nodeDirs().filter((d) => !before.has(d));
530
+ if (added.length !== 1) {
531
+ throw new Error(`spawnChild: expected exactly 1 new node dir, got [${added.join(', ')}]`);
532
+ }
533
+ const childId = added[0];
534
+ await harness.awaitBoot(childId);
535
+ return childId;
536
+ },
537
+ async spawnHeadlessChild(parentId, task, o = {}) {
538
+ const before = new Set(nodeDirs());
539
+ // The synchronous CLI must reach the separate API fixture process, which
540
+ // creates the row and necessarily starts a fixture-owned broker before
541
+ // returning. Production has one daemon/fleet; the harness split exists
542
+ // only because spawnSync blocks this process's event loop. Retire that
543
+ // fixture launch immediately, then perform the authoritative boot through
544
+ // THIS process's reviveNode so the harness fleet owns the ChildProcess
545
+ // handle and its real exit event (§H harness mode a).
546
+ const args = ['node', 'new', task, '--parent', parentId, '--cwd', CROUTER];
547
+ if (o.kind)
548
+ args.push('--kind', o.kind);
549
+ if (o.mode)
550
+ args.push('--mode', o.mode);
551
+ if (o.model)
552
+ args.push('--model', o.model);
553
+ const res = cli(parentId, args);
554
+ if (res.code !== 0) {
555
+ throw new Error(`spawnHeadlessChild(${parentId}) failed (code ${res.code})\n--stdout--\n${res.stdout}\n--stderr--\n${res.stderr}`);
556
+ }
557
+ const added = nodeDirs().filter((d) => !before.has(d));
558
+ if (added.length !== 1) {
559
+ throw new Error(`spawnHeadlessChild: expected exactly 1 new node dir, got [${added.join(', ')}]`);
560
+ }
561
+ const childId = added[0];
562
+ closeDb();
563
+ const fixtureRow = getNode(childId);
564
+ const fixturePid = fixtureRow?.pi_pid ?? null;
565
+ const fixtureIdentity = fixtureRow?.pi_pid_identity ?? null;
566
+ const priorBoots = harness.bootCount(childId);
567
+ if (fixturePid !== null && fixtureIdentity !== null && recordedPidLiveness(fixturePid, fixtureIdentity) === 'alive') {
568
+ process.kill(fixturePid, 'SIGTERM');
569
+ await waitFor(() => recordedPidLiveness(fixturePid, fixtureIdentity) !== 'alive', {
570
+ timeoutMs: 10_000,
571
+ intervalMs: 25,
572
+ label: `API-fixture broker exit for ${childId}`,
573
+ });
574
+ }
575
+ reviveNode(childId, { resume: false });
576
+ await harness.awaitBoot(childId, { minCount: priorBoots + 1 });
577
+ return childId;
578
+ },
579
+ async spawnHeadlessChildNoBoot(parentId, task, o = {}) {
580
+ const before = new Set(nodeDirs());
581
+ const args = ['node', 'new', task, '--parent', parentId, '--cwd', CROUTER];
582
+ if (o.kind)
583
+ args.push('--kind', o.kind);
584
+ if (o.mode)
585
+ args.push('--mode', o.mode);
586
+ if (o.model)
587
+ args.push('--model', o.model);
588
+ const res = cli(parentId, args);
589
+ if (res.code !== 0) {
590
+ throw new Error(`spawnHeadlessChildNoBoot(${parentId}) failed (code ${res.code})\n--stdout--\n${res.stdout}\n--stderr--\n${res.stderr}`);
591
+ }
592
+ const added = nodeDirs().filter((d) => !before.has(d));
593
+ if (added.length !== 1) {
594
+ throw new Error(`spawnHeadlessChildNoBoot: expected exactly 1 new node dir, got [${added.join(', ')}]`);
595
+ }
596
+ return added[0];
597
+ },
598
+ cli,
599
+ async turn(nodeId, text = '') {
600
+ const base = eventCount(nodeId, 'agent_end');
601
+ sendCmd(nodeId, { cmd: 'turn', id: `turn-${Date.now()}`, text });
602
+ await awaitAgentEnd(nodeId, base, `turn agent_end for ${nodeId}`);
603
+ },
604
+ async stop(nodeId, reason = 'stop', errorMessage) {
605
+ const base = eventCount(nodeId, 'agent_end');
606
+ sendCmd(nodeId, { cmd: 'stop', id: `stop-${Date.now()}`, reason, errorMessage });
607
+ await awaitAgentEnd(nodeId, base, `stop agent_end for ${nodeId}`);
608
+ },
609
+ async finish(nodeId, finalText) {
610
+ const res = cli(nodeId, ['push', 'final', finalText]);
611
+ if (res.code !== 0) {
612
+ throw new Error(`finish(${nodeId}): push final failed (code ${res.code})\n${res.stderr}`);
613
+ }
614
+ // Fire agent_end so the now-done node runs the real (b) done branch
615
+ // (null presence + ctx.shutdown → window closes), exactly as real pi would.
616
+ const base = eventCount(nodeId, 'agent_end');
617
+ sendCmd(nodeId, { cmd: 'stop', id: `finish-${Date.now()}` });
618
+ await awaitAgentEnd(nodeId, base, `finish agent_end for ${nodeId}`);
619
+ await harness.waitForPaneGone(nodeId);
620
+ },
621
+ async tick(now) {
622
+ closeDb();
623
+ // On the lane, after every already-enqueued exit job — the same strict
624
+ // serialization crtrd's enqueueTick gives the real daemon.
625
+ await enqueueLaneJob(() => superviseTick(now));
626
+ closeDb();
627
+ },
628
+ fleet,
629
+ async deliverExit(nodeId, status = { code: null, signal: 'SIGKILL' }) {
630
+ closeDb();
631
+ fleet.deliverExit(nodeId, status);
632
+ await drainLane();
633
+ closeDb();
634
+ },
635
+ drainFleet: drainLane,
636
+ async awaitFleetExit(nodeId, timeoutMs = 15_000) {
637
+ await waitFor(() => !fleet.has(nodeId), {
638
+ timeoutMs,
639
+ intervalMs: 20,
640
+ label: `fleet forgets ${nodeId} (child exit delivered)`,
641
+ });
642
+ await drainLane();
643
+ closeDb();
644
+ },
645
+ async awaitBoot(nodeId, o = {}) {
646
+ const minCount = o.minCount ?? 1;
647
+ const bootsPath = join(nodeDir(nodeId), 'fake-pi.boots.jsonl');
648
+ const errPath = join(nodeDir(nodeId), 'fake-pi.error');
649
+ let lines;
650
+ try {
651
+ lines = await waitFor(() => {
652
+ const ls = readLines(bootsPath);
653
+ return ls.length >= minCount ? ls : null;
654
+ }, {
655
+ timeoutMs: o.timeoutMs ?? 30_000,
656
+ label: `fake-pi boot >= ${minCount} for ${nodeId}` +
657
+ (existsSync(errPath) ? ` (error file: ${readFileSync(errPath, 'utf8')})` : ''),
658
+ });
659
+ }
660
+ catch (err) {
661
+ // Failure-path-only diagnostic: on boot timeout, dump the node row's recorded
662
+ // liveness fields, recorded-vs-live identity verdict, tail of broker.log, and
663
+ // late error file so the failure is self-explaining from the CI log alone.
664
+ closeDb();
665
+ const n = getNode(nodeId);
666
+ process.stderr.write(`[awaitBoot] timeout for ${nodeId}: pi_pid=${n?.pi_pid ?? 'null'} ` +
667
+ `pi_pid_identity=${n?.pi_pid_identity ?? 'null'} status=${n?.status ?? 'null'} ` +
668
+ `intent=${n?.intent ?? 'null'} pi_session_id=${n?.pi_session_id ?? 'null'} ` +
669
+ `bootCount=${bootCount(nodeId)} minCount=${minCount}\n`);
670
+ // Identity-aware liveness: what does the current process state say about recorded identity?
671
+ if (n?.pi_pid !== null && n?.pi_pid !== undefined) {
672
+ const liveness = recordedPidLiveness(n.pi_pid, n.pi_pid_identity);
673
+ process.stderr.write(`[awaitBoot] identity-liveness: pid=${n.pi_pid} recorded-identity=${n.pi_pid_identity ?? 'null'} liveness=${liveness}\n`);
674
+ }
675
+ // Tail of broker.log if it exists (shows pre-session startup issues)
676
+ const brokerLogPath = join(nodeDir(nodeId), 'job', 'broker.log');
677
+ if (existsSync(brokerLogPath)) {
678
+ const logContent = readFileSync(brokerLogPath, 'utf8');
679
+ const lines = logContent.split('\n');
680
+ const tail = lines.slice(-10).join('\n');
681
+ process.stderr.write(`[awaitBoot] broker.log tail:\n${tail}\n`);
682
+ }
683
+ // Late error file (written during boot, e.g., fake-pi init failure)
684
+ const lateErrPath = join(nodeDir(nodeId), 'fake-pi.error');
685
+ if (existsSync(lateErrPath)) {
686
+ const lateErr = readFileSync(lateErrPath, 'utf8');
687
+ process.stderr.write(`[awaitBoot] fake-pi.error: ${lateErr}\n`);
688
+ }
689
+ throw err;
690
+ }
691
+ const boot = JSON.parse(lines[lines.length - 1]);
692
+ if (typeof boot.pid === 'number')
693
+ pidsToKill.add(boot.pid);
694
+ return boot;
695
+ },
696
+ async awaitWake(nodeId, o = {}) {
697
+ const sinceCount = o.sinceCount ?? 0;
698
+ const match = o.match;
699
+ const fresh = await waitFor(() => {
700
+ const all = injected(nodeId).slice(sinceCount);
701
+ if (all.length === 0)
702
+ return null;
703
+ if (match && !all.some((e) => match.test(e.content)))
704
+ return null;
705
+ return all;
706
+ }, { timeoutMs: o.timeoutMs ?? 15_000, label: `wake delivery for ${nodeId}` });
707
+ return fresh.map((e) => e.content);
708
+ },
709
+ async waitForStatus(nodeId, status, timeoutMs = 20_000) {
710
+ await waitFor(() => {
711
+ closeDb();
712
+ return getNode(nodeId)?.status === status;
713
+ }, { timeoutMs, label: `status=${status} for ${nodeId}` });
714
+ },
715
+ async waitForPaneGone(nodeId, timeoutMs = 20_000) {
716
+ await waitFor(() => {
717
+ closeDb();
718
+ return !isFocused(nodeId);
719
+ }, { timeoutMs, label: `viewer gone for ${nodeId}` });
720
+ },
721
+ waitFor,
722
+ node(nodeId) {
723
+ closeDb();
724
+ return getNode(nodeId);
725
+ },
726
+ status(nodeId) {
727
+ closeDb();
728
+ return getNode(nodeId)?.status ?? null;
729
+ },
730
+ paneAlive(nodeId) {
731
+ closeDb();
732
+ return isFocused(nodeId);
733
+ },
734
+ inbox(nodeId) {
735
+ closeDb();
736
+ return readInboxSince(nodeId);
737
+ },
738
+ injected,
739
+ fakeCmd(nodeId, cmd) {
740
+ sendCmd(nodeId, cmd);
741
+ },
742
+ dialogResults(nodeId) {
743
+ return readLines(join(nodeDir(nodeId), 'fake-pi.dialog.jsonl'))
744
+ .map((l) => {
745
+ try {
746
+ return JSON.parse(l);
747
+ }
748
+ catch {
749
+ return null;
750
+ }
751
+ })
752
+ .filter((x) => x !== null);
753
+ },
754
+ brokerSock(nodeId) {
755
+ return join(nodeDir(nodeId), 'view.sock');
756
+ },
757
+ bootCount,
758
+ subscribers(nodeId) {
759
+ closeDb();
760
+ return subscribersOf(nodeId).map((s) => ({ node_id: s.node_id, active: s.active }));
761
+ },
762
+ subscriptions(nodeId) {
763
+ closeDb();
764
+ return subscriptionsOf(nodeId).map((s) => ({ node_id: s.node_id, active: s.active }));
765
+ },
766
+ async dispose() {
767
+ laneClosed = true;
768
+ spawnSync('tmux', ['kill-session', '-t', session], {
769
+ stdio: 'ignore',
770
+ timeout: TMUX_TIMEOUT_MS,
771
+ });
772
+ // Best-effort: a superviseTick-triggered revive of a fabricated node fires
773
+ // a DETACHED throwaway broker (it loads the real SDK; the rmSync of home
774
+ // below makes a mid-boot one self-terminate when its files vanish). Kill
775
+ // any that recorded a pid first — scan every node's row pid + recorded
776
+ // boot pids and add them to the kill set.
777
+ closeDb();
778
+ for (const d of nodeDirs()) {
779
+ try {
780
+ const n = getNode(d);
781
+ if (n?.pi_pid != null)
782
+ pidsToKill.add(n.pi_pid);
783
+ }
784
+ catch {
785
+ /* row gone — fine */
786
+ }
787
+ for (const line of readLines(join(nodeDir(d), 'fake-pi.boots.jsonl'))) {
788
+ try {
789
+ const p = JSON.parse(line).pid;
790
+ if (typeof p === 'number')
791
+ pidsToKill.add(p);
792
+ }
793
+ catch {
794
+ /* skip */
795
+ }
796
+ }
797
+ }
798
+ // Every pid here was recorded EARLIER (a row's pi_pid, a fake-pi boot
799
+ // line, the API-server child) and may since have exited and had its pid
800
+ // REUSED by an unrelated process — including a real, just-spawned broker
801
+ // on the developer's own canvas, which a blind SIGKILL then murders (the
802
+ // 2026-07-27 "brokers die at startup" RCA). Re-read each pid's command
803
+ // at the signal boundary (same fresh-read guard crtrd's reapOrphanBrokers
804
+ // uses) and signal ONLY what still looks like one of THIS fixture's
805
+ // processes: a broker/CLI declaring this isolated canvas home, or one of
806
+ // the fixture entrypoints. Anything else is skipped, not killed.
807
+ const fixtureFingerprints = [home, tmpHome, API_SERVER_HOST, FAKE_ENGINE, FAKE_PI_HOST];
808
+ for (const p of pidsToKill) {
809
+ const command = capturePidCommand(p);
810
+ if (command === null)
811
+ continue; // gone already — nothing to signal
812
+ if (!fixtureFingerprints.some((mark) => command.includes(mark)))
813
+ continue; // pid reused by a stranger
814
+ try {
815
+ process.kill(p, 'SIGKILL');
816
+ }
817
+ catch {
818
+ /* already gone */
819
+ }
820
+ }
821
+ closeDb();
822
+ // Stop the standalone API-server process (its socket lives under home/,
823
+ // removed below). SIGTERM lets it close() its listener and unlink the
824
+ // socket; the pid is also in pidsToKill as a backstop.
825
+ try {
826
+ apiServerProc.kill('SIGTERM');
827
+ }
828
+ catch {
829
+ /* already gone */
830
+ }
831
+ // Leave the process-global event source + fleet unbound so the next
832
+ // harness instance in this same test process can bind cleanly (see setup
833
+ // above). dispose() the fleet first: a pending backoff-respawn timer
834
+ // would otherwise hold the test process's event loop open.
835
+ fleet.dispose();
836
+ resetFleetForTests();
837
+ resetEventSourceForTests();
838
+ rmSync(home, { recursive: true, force: true });
839
+ rmSync(tmpHome, { recursive: true, force: true });
840
+ if (origHome === undefined)
841
+ delete process.env['CRTR_HOME'];
842
+ else
843
+ process.env['CRTR_HOME'] = origHome;
844
+ if (origAgentHome === undefined)
845
+ delete process.env['HOME'];
846
+ else
847
+ process.env['HOME'] = origAgentHome;
848
+ if (origPiBinary === undefined)
849
+ delete process.env['CRTR_PI_BINARY'];
850
+ else
851
+ process.env['CRTR_PI_BINARY'] = origPiBinary;
852
+ if (origNodeSession === undefined)
853
+ delete process.env['CRTR_NODE_SESSION'];
854
+ else
855
+ process.env['CRTR_NODE_SESSION'] = origNodeSession;
856
+ if (origNodeOptions === undefined)
857
+ delete process.env['NODE_OPTIONS'];
858
+ else
859
+ process.env['NODE_OPTIONS'] = origNodeOptions;
860
+ if (origBrokerEngine === undefined)
861
+ delete process.env['CRTR_BROKER_ENGINE'];
862
+ else
863
+ process.env['CRTR_BROKER_ENGINE'] = origBrokerEngine;
864
+ },
865
+ };
866
+ return harness;
867
+ }