@emiliosp/pi-maestro 0.17.0 → 0.18.1

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 (1884) hide show
  1. package/ADR.md +7 -5
  2. package/CHANGELOG.md +12 -0
  3. package/README.md +12 -8
  4. package/ROADMAP.md +182 -164
  5. package/TECH_STACK.md +1 -2
  6. package/agents/builder.md +0 -11
  7. package/agents/simplifier.md +0 -11
  8. package/agents/verifier.md +0 -11
  9. package/docs/configuration.md +9 -10
  10. package/docs/subagent-integration.md +28 -27
  11. package/docs/workflow.md +8 -4
  12. package/extensions/maestro.ts +1 -1
  13. package/package.json +8 -16
  14. package/src/config/schema.ts +0 -6
  15. package/src/delegation/createAgentProgress.ts +68 -0
  16. package/src/delegation/executeRoleTask.ts +89 -0
  17. package/src/delegation/executeTask.ts +103 -10
  18. package/src/delegation/{createChildServices.ts → prepareSubagentEnvironment.ts} +7 -2
  19. package/src/delegation/trackAgentActivity.ts +48 -0
  20. package/src/ids/createSpecId.ts +3 -5
  21. package/src/maestro/checks/assertEnvironment.ts +6 -113
  22. package/src/maestro/instructions/getMaestroInstructions.ts +2 -1
  23. package/src/specs/create.ts +1 -1
  24. package/src/tools/child/record-builder-handoff.ts +28 -30
  25. package/src/tools/child/record-simplifier-handoff.ts +33 -35
  26. package/src/tools/child/record-verifier-handoff.ts +37 -39
  27. package/src/tools/main/run-builder.ts +10 -28
  28. package/src/tools/main/run-simplifier.ts +9 -26
  29. package/src/tools/main/run-verifier.ts +10 -27
  30. package/extensions/maestro-subagent.ts +0 -16
  31. package/node_modules/@js-temporal/polyfill/CHANGELOG.md +0 -453
  32. package/node_modules/@js-temporal/polyfill/LICENSE +0 -13
  33. package/node_modules/@js-temporal/polyfill/README.md +0 -90
  34. package/node_modules/@js-temporal/polyfill/dist/index.cjs +0 -2
  35. package/node_modules/@js-temporal/polyfill/dist/index.cjs.map +0 -1
  36. package/node_modules/@js-temporal/polyfill/dist/index.esm.js +0 -2
  37. package/node_modules/@js-temporal/polyfill/dist/index.esm.js.map +0 -1
  38. package/node_modules/@js-temporal/polyfill/dist/index.umd.js +0 -2
  39. package/node_modules/@js-temporal/polyfill/dist/index.umd.js.map +0 -1
  40. package/node_modules/@js-temporal/polyfill/index.d.cts +0 -1215
  41. package/node_modules/@js-temporal/polyfill/index.d.ts +0 -1215
  42. package/node_modules/@js-temporal/polyfill/lib/assert.ts +0 -8
  43. package/node_modules/@js-temporal/polyfill/lib/bigintmath.ts +0 -39
  44. package/node_modules/@js-temporal/polyfill/lib/calendar.ts +0 -2424
  45. package/node_modules/@js-temporal/polyfill/lib/debug.ts +0 -7
  46. package/node_modules/@js-temporal/polyfill/lib/duration.ts +0 -438
  47. package/node_modules/@js-temporal/polyfill/lib/durationformat.d.ts +0 -93
  48. package/node_modules/@js-temporal/polyfill/lib/ecmascript.ts +0 -4973
  49. package/node_modules/@js-temporal/polyfill/lib/index.ts +0 -34
  50. package/node_modules/@js-temporal/polyfill/lib/init.ts +0 -43
  51. package/node_modules/@js-temporal/polyfill/lib/instant.ts +0 -138
  52. package/node_modules/@js-temporal/polyfill/lib/internaltypes.d.ts +0 -242
  53. package/node_modules/@js-temporal/polyfill/lib/intl.ts +0 -758
  54. package/node_modules/@js-temporal/polyfill/lib/intrinsicclass.ts +0 -162
  55. package/node_modules/@js-temporal/polyfill/lib/legacydate.ts +0 -17
  56. package/node_modules/@js-temporal/polyfill/lib/math.ts +0 -96
  57. package/node_modules/@js-temporal/polyfill/lib/now.ts +0 -48
  58. package/node_modules/@js-temporal/polyfill/lib/plaindate.ts +0 -212
  59. package/node_modules/@js-temporal/polyfill/lib/plaindatetime.ts +0 -274
  60. package/node_modules/@js-temporal/polyfill/lib/plainmonthday.ts +0 -110
  61. package/node_modules/@js-temporal/polyfill/lib/plaintime.ts +0 -154
  62. package/node_modules/@js-temporal/polyfill/lib/plainyearmonth.ts +0 -157
  63. package/node_modules/@js-temporal/polyfill/lib/regex.ts +0 -59
  64. package/node_modules/@js-temporal/polyfill/lib/slots.ts +0 -341
  65. package/node_modules/@js-temporal/polyfill/lib/temporal.ts +0 -10
  66. package/node_modules/@js-temporal/polyfill/lib/timeduration.ts +0 -149
  67. package/node_modules/@js-temporal/polyfill/lib/zoneddatetime.ts +0 -492
  68. package/node_modules/@js-temporal/polyfill/package.json +0 -143
  69. package/node_modules/acorn/CHANGELOG.md +0 -998
  70. package/node_modules/acorn/LICENSE +0 -21
  71. package/node_modules/acorn/README.md +0 -309
  72. package/node_modules/acorn/bin/acorn +0 -4
  73. package/node_modules/acorn/dist/acorn.d.mts +0 -897
  74. package/node_modules/acorn/dist/acorn.d.ts +0 -897
  75. package/node_modules/acorn/dist/acorn.js +0 -6342
  76. package/node_modules/acorn/dist/acorn.mjs +0 -6313
  77. package/node_modules/acorn/dist/bin.js +0 -90
  78. package/node_modules/acorn/package.json +0 -50
  79. package/node_modules/jiti/LICENSE +0 -21
  80. package/node_modules/jiti/README.md +0 -258
  81. package/node_modules/jiti/dist/babel.cjs +0 -257
  82. package/node_modules/jiti/dist/jiti.cjs +0 -1
  83. package/node_modules/jiti/lib/jiti-cli.mjs +0 -34
  84. package/node_modules/jiti/lib/jiti-hooks.mjs +0 -124
  85. package/node_modules/jiti/lib/jiti-native.mjs +0 -121
  86. package/node_modules/jiti/lib/jiti-register.d.mts +0 -1
  87. package/node_modules/jiti/lib/jiti-register.mjs +0 -4
  88. package/node_modules/jiti/lib/jiti-static.mjs +0 -23
  89. package/node_modules/jiti/lib/jiti.cjs +0 -30
  90. package/node_modules/jiti/lib/jiti.d.cts +0 -8
  91. package/node_modules/jiti/lib/jiti.d.mts +0 -8
  92. package/node_modules/jiti/lib/jiti.mjs +0 -29
  93. package/node_modules/jiti/lib/types.d.ts +0 -420
  94. package/node_modules/jiti/package.json +0 -146
  95. package/node_modules/jsbi/LICENSE +0 -176
  96. package/node_modules/jsbi/README.md +0 -173
  97. package/node_modules/jsbi/dist/jsbi-cjs.js +0 -2
  98. package/node_modules/jsbi/dist/jsbi-cjs.js.map +0 -1
  99. package/node_modules/jsbi/dist/jsbi-umd.js +0 -2
  100. package/node_modules/jsbi/dist/jsbi-umd.js.map +0 -1
  101. package/node_modules/jsbi/dist/jsbi.mjs +0 -2
  102. package/node_modules/jsbi/dist/jsbi.mjs.map +0 -1
  103. package/node_modules/jsbi/jsbi.d.ts +0 -43
  104. package/node_modules/jsbi/package.json +0 -35
  105. package/node_modules/pi-subagents/CHANGELOG.md +0 -3081
  106. package/node_modules/pi-subagents/LICENSE +0 -21
  107. package/node_modules/pi-subagents/README.md +0 -129
  108. package/node_modules/pi-subagents/agents/claude-code-writer.md +0 -16
  109. package/node_modules/pi-subagents/agents/claude-code.md +0 -15
  110. package/node_modules/pi-subagents/agents/codex-exec-writer.md +0 -16
  111. package/node_modules/pi-subagents/agents/codex-exec.md +0 -15
  112. package/node_modules/pi-subagents/agents/cursor-agent-writer.md +0 -15
  113. package/node_modules/pi-subagents/agents/cursor-agent.md +0 -14
  114. package/node_modules/pi-subagents/agents/delegate.md +0 -14
  115. package/node_modules/pi-subagents/agents/evidence-auditor.md +0 -35
  116. package/node_modules/pi-subagents/agents/oracle.md +0 -68
  117. package/node_modules/pi-subagents/agents/researcher.md +0 -59
  118. package/node_modules/pi-subagents/agents/reviewer.md +0 -48
  119. package/node_modules/pi-subagents/agents/scout.md +0 -47
  120. package/node_modules/pi-subagents/agents/worker.md +0 -43
  121. package/node_modules/pi-subagents/async-retention-discovery-worker.mjs +0 -180
  122. package/node_modules/pi-subagents/docs/agents.md +0 -627
  123. package/node_modules/pi-subagents/docs/configuration.md +0 -756
  124. package/node_modules/pi-subagents/docs/extension-api.md +0 -661
  125. package/node_modules/pi-subagents/docs/missions.md +0 -162
  126. package/node_modules/pi-subagents/docs/models.md +0 -253
  127. package/node_modules/pi-subagents/docs/observability.md +0 -335
  128. package/node_modules/pi-subagents/docs/standalone-background.md +0 -59
  129. package/node_modules/pi-subagents/docs/tool-reference.md +0 -558
  130. package/node_modules/pi-subagents/docs/watchdog.md +0 -187
  131. package/node_modules/pi-subagents/docs/workflows.md +0 -577
  132. package/node_modules/pi-subagents/index.d.ts +0 -3
  133. package/node_modules/pi-subagents/index.d.ts.map +0 -1
  134. package/node_modules/pi-subagents/index.js +0 -15
  135. package/node_modules/pi-subagents/index.js.map +0 -1
  136. package/node_modules/pi-subagents/inspector-runner.mjs +0 -11
  137. package/node_modules/pi-subagents/install.mjs +0 -93
  138. package/node_modules/pi-subagents/node_modules/yaml/LICENSE +0 -13
  139. package/node_modules/pi-subagents/node_modules/yaml/README.md +0 -172
  140. package/node_modules/pi-subagents/node_modules/yaml/bin.mjs +0 -11
  141. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/compose-collection.js +0 -88
  142. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/compose-doc.js +0 -43
  143. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/compose-node.js +0 -109
  144. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/compose-scalar.js +0 -86
  145. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/composer.js +0 -217
  146. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-block-map.js +0 -115
  147. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +0 -198
  148. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +0 -49
  149. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-end.js +0 -37
  150. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +0 -207
  151. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +0 -223
  152. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-props.js +0 -146
  153. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/util-contains-newline.js +0 -34
  154. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +0 -26
  155. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +0 -15
  156. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/util-map-includes.js +0 -13
  157. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/doc/Document.js +0 -335
  158. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/doc/anchors.js +0 -71
  159. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/doc/applyReviver.js +0 -55
  160. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/doc/createNode.js +0 -88
  161. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/doc/directives.js +0 -176
  162. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/errors.js +0 -57
  163. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/index.js +0 -17
  164. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/log.js +0 -11
  165. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/Alias.js +0 -114
  166. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/Collection.js +0 -147
  167. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/Node.js +0 -38
  168. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/Pair.js +0 -36
  169. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/Scalar.js +0 -24
  170. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/YAMLMap.js +0 -144
  171. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +0 -113
  172. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +0 -63
  173. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/identity.js +0 -36
  174. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/toJS.js +0 -37
  175. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/cst-scalar.js +0 -214
  176. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/cst-stringify.js +0 -61
  177. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/cst-visit.js +0 -97
  178. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/cst.js +0 -98
  179. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/lexer.js +0 -717
  180. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/line-counter.js +0 -39
  181. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/parser.js +0 -967
  182. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/public-api.js +0 -102
  183. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/Schema.js +0 -37
  184. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/common/map.js +0 -17
  185. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/common/null.js +0 -15
  186. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/common/seq.js +0 -17
  187. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/common/string.js +0 -14
  188. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/core/bool.js +0 -19
  189. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/core/float.js +0 -43
  190. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/core/int.js +0 -38
  191. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/core/schema.js +0 -23
  192. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/json/schema.js +0 -62
  193. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/tags.js +0 -96
  194. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +0 -58
  195. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +0 -26
  196. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +0 -46
  197. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +0 -71
  198. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +0 -64
  199. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +0 -74
  200. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +0 -78
  201. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +0 -39
  202. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +0 -93
  203. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +0 -101
  204. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +0 -146
  205. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringify.js +0 -129
  206. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +0 -153
  207. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringifyComment.js +0 -20
  208. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +0 -85
  209. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +0 -24
  210. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringifyPair.js +0 -150
  211. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringifyString.js +0 -336
  212. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/util.js +0 -11
  213. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/visit.js +0 -233
  214. package/node_modules/pi-subagents/node_modules/yaml/browser/index.js +0 -5
  215. package/node_modules/pi-subagents/node_modules/yaml/browser/package.json +0 -3
  216. package/node_modules/pi-subagents/node_modules/yaml/dist/cli.d.ts +0 -8
  217. package/node_modules/pi-subagents/node_modules/yaml/dist/cli.mjs +0 -201
  218. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-collection.d.ts +0 -11
  219. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-collection.js +0 -90
  220. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-doc.d.ts +0 -7
  221. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-doc.js +0 -45
  222. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-node.d.ts +0 -29
  223. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-node.js +0 -112
  224. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-scalar.d.ts +0 -5
  225. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-scalar.js +0 -88
  226. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/composer.d.ts +0 -63
  227. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/composer.js +0 -222
  228. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-block-map.d.ts +0 -6
  229. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-block-map.js +0 -117
  230. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +0 -11
  231. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-block-scalar.js +0 -200
  232. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +0 -6
  233. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-block-seq.js +0 -51
  234. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-end.d.ts +0 -6
  235. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-end.js +0 -39
  236. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +0 -7
  237. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-flow-collection.js +0 -209
  238. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +0 -10
  239. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-flow-scalar.js +0 -225
  240. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-props.d.ts +0 -23
  241. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-props.js +0 -148
  242. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-contains-newline.d.ts +0 -2
  243. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-contains-newline.js +0 -36
  244. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +0 -2
  245. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-empty-scalar-position.js +0 -28
  246. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +0 -3
  247. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-flow-indent-check.js +0 -17
  248. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-map-includes.d.ts +0 -4
  249. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-map-includes.js +0 -15
  250. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/Document.d.ts +0 -141
  251. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/Document.js +0 -337
  252. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/anchors.d.ts +0 -24
  253. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/anchors.js +0 -76
  254. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/applyReviver.d.ts +0 -9
  255. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/applyReviver.js +0 -57
  256. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/createNode.d.ts +0 -17
  257. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/createNode.js +0 -90
  258. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/directives.d.ts +0 -49
  259. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/directives.js +0 -178
  260. package/node_modules/pi-subagents/node_modules/yaml/dist/errors.d.ts +0 -21
  261. package/node_modules/pi-subagents/node_modules/yaml/dist/errors.js +0 -62
  262. package/node_modules/pi-subagents/node_modules/yaml/dist/index.d.ts +0 -25
  263. package/node_modules/pi-subagents/node_modules/yaml/dist/index.js +0 -50
  264. package/node_modules/pi-subagents/node_modules/yaml/dist/log.d.ts +0 -3
  265. package/node_modules/pi-subagents/node_modules/yaml/dist/log.js +0 -19
  266. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Alias.d.ts +0 -29
  267. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Alias.js +0 -116
  268. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Collection.d.ts +0 -73
  269. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Collection.js +0 -151
  270. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Node.d.ts +0 -53
  271. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Node.js +0 -40
  272. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Pair.d.ts +0 -22
  273. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Pair.js +0 -39
  274. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Scalar.d.ts +0 -43
  275. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Scalar.js +0 -27
  276. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/YAMLMap.d.ts +0 -53
  277. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/YAMLMap.js +0 -147
  278. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +0 -60
  279. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/YAMLSeq.js +0 -115
  280. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +0 -4
  281. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/addPairToJSMap.js +0 -65
  282. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/identity.d.ts +0 -23
  283. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/identity.js +0 -53
  284. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/toJS.d.ts +0 -29
  285. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/toJS.js +0 -39
  286. package/node_modules/pi-subagents/node_modules/yaml/dist/options.d.ts +0 -350
  287. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst-scalar.d.ts +0 -64
  288. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst-scalar.js +0 -218
  289. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst-stringify.d.ts +0 -8
  290. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst-stringify.js +0 -63
  291. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst-visit.d.ts +0 -39
  292. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst-visit.js +0 -99
  293. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst.d.ts +0 -109
  294. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst.js +0 -112
  295. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/lexer.d.ts +0 -87
  296. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/lexer.js +0 -719
  297. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/line-counter.d.ts +0 -22
  298. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/line-counter.js +0 -41
  299. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/parser.d.ts +0 -84
  300. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/parser.js +0 -972
  301. package/node_modules/pi-subagents/node_modules/yaml/dist/public-api.d.ts +0 -44
  302. package/node_modules/pi-subagents/node_modules/yaml/dist/public-api.js +0 -107
  303. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/Schema.d.ts +0 -17
  304. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/Schema.js +0 -39
  305. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/map.d.ts +0 -2
  306. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/map.js +0 -19
  307. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/null.d.ts +0 -4
  308. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/null.js +0 -17
  309. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/seq.d.ts +0 -2
  310. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/seq.js +0 -19
  311. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/string.d.ts +0 -2
  312. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/string.js +0 -16
  313. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/bool.d.ts +0 -4
  314. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/bool.js +0 -21
  315. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/float.d.ts +0 -4
  316. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/float.js +0 -47
  317. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/int.d.ts +0 -4
  318. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/int.js +0 -42
  319. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/schema.d.ts +0 -1
  320. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/schema.js +0 -25
  321. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/json/schema.d.ts +0 -2
  322. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/json/schema.js +0 -64
  323. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/json-schema.d.ts +0 -69
  324. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/tags.d.ts +0 -48
  325. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/tags.js +0 -99
  326. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/types.d.ts +0 -92
  327. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +0 -2
  328. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/binary.js +0 -70
  329. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +0 -7
  330. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/bool.js +0 -29
  331. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +0 -4
  332. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/float.js +0 -50
  333. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +0 -5
  334. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/int.js +0 -76
  335. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +0 -9
  336. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/merge.js +0 -68
  337. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +0 -22
  338. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/omap.js +0 -77
  339. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +0 -10
  340. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +0 -82
  341. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +0 -1
  342. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/schema.js +0 -41
  343. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +0 -28
  344. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/set.js +0 -96
  345. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +0 -6
  346. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +0 -105
  347. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +0 -34
  348. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/foldFlowLines.js +0 -151
  349. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringify.d.ts +0 -21
  350. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringify.js +0 -132
  351. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +0 -17
  352. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyCollection.js +0 -155
  353. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyComment.d.ts +0 -10
  354. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyComment.js +0 -24
  355. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +0 -4
  356. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyDocument.js +0 -87
  357. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +0 -2
  358. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyNumber.js +0 -26
  359. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyPair.d.ts +0 -3
  360. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyPair.js +0 -152
  361. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyString.d.ts +0 -9
  362. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyString.js +0 -338
  363. package/node_modules/pi-subagents/node_modules/yaml/dist/test-events.d.ts +0 -4
  364. package/node_modules/pi-subagents/node_modules/yaml/dist/test-events.js +0 -134
  365. package/node_modules/pi-subagents/node_modules/yaml/dist/util.d.ts +0 -16
  366. package/node_modules/pi-subagents/node_modules/yaml/dist/util.js +0 -28
  367. package/node_modules/pi-subagents/node_modules/yaml/dist/visit.d.ts +0 -102
  368. package/node_modules/pi-subagents/node_modules/yaml/dist/visit.js +0 -236
  369. package/node_modules/pi-subagents/node_modules/yaml/package.json +0 -97
  370. package/node_modules/pi-subagents/node_modules/yaml/util.js +0 -2
  371. package/node_modules/pi-subagents/package.json +0 -138
  372. package/node_modules/pi-subagents/prompts/council.md +0 -63
  373. package/node_modules/pi-subagents/prompts/gather-context-and-clarify.md +0 -13
  374. package/node_modules/pi-subagents/prompts/parallel-cleanup.md +0 -59
  375. package/node_modules/pi-subagents/prompts/parallel-research.md +0 -50
  376. package/node_modules/pi-subagents/prompts/parallel-review.md +0 -58
  377. package/node_modules/pi-subagents/prompts/review-loop.md +0 -47
  378. package/node_modules/pi-subagents/runner-peer-loader.mjs +0 -21
  379. package/node_modules/pi-subagents/runner-peer-preload.mjs +0 -30
  380. package/node_modules/pi-subagents/skills/council-mode/SKILL.md +0 -59
  381. package/node_modules/pi-subagents/skills/council-mode/references/pass-contracts.md +0 -150
  382. package/node_modules/pi-subagents/skills/pi-subagents/SKILL.md +0 -123
  383. package/node_modules/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +0 -74
  384. package/node_modules/pi-subagents/skills/pi-subagents/references/execution-controls.md +0 -561
  385. package/node_modules/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +0 -165
  386. package/node_modules/pi-subagents/skills/pi-subagents/references/multi-lane-orchestration.md +0 -61
  387. package/node_modules/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +0 -297
  388. package/node_modules/pi-subagents/skills/pi-subagents/references/review-and-validation.md +0 -73
  389. package/node_modules/pi-subagents/src/agents/advertised-agent-prompt.d.ts +0 -14
  390. package/node_modules/pi-subagents/src/agents/advertised-agent-prompt.d.ts.map +0 -1
  391. package/node_modules/pi-subagents/src/agents/advertised-agent-prompt.js +0 -69
  392. package/node_modules/pi-subagents/src/agents/advertised-agent-prompt.js.map +0 -1
  393. package/node_modules/pi-subagents/src/agents/agent-management.d.ts +0 -28
  394. package/node_modules/pi-subagents/src/agents/agent-management.d.ts.map +0 -1
  395. package/node_modules/pi-subagents/src/agents/agent-management.js +0 -1522
  396. package/node_modules/pi-subagents/src/agents/agent-management.js.map +0 -1
  397. package/node_modules/pi-subagents/src/agents/agent-memory.d.ts +0 -49
  398. package/node_modules/pi-subagents/src/agents/agent-memory.d.ts.map +0 -1
  399. package/node_modules/pi-subagents/src/agents/agent-memory.js +0 -349
  400. package/node_modules/pi-subagents/src/agents/agent-memory.js.map +0 -1
  401. package/node_modules/pi-subagents/src/agents/agent-refinements.d.ts +0 -100
  402. package/node_modules/pi-subagents/src/agents/agent-refinements.d.ts.map +0 -1
  403. package/node_modules/pi-subagents/src/agents/agent-refinements.js +0 -569
  404. package/node_modules/pi-subagents/src/agents/agent-refinements.js.map +0 -1
  405. package/node_modules/pi-subagents/src/agents/agent-scope.d.ts +0 -4
  406. package/node_modules/pi-subagents/src/agents/agent-scope.d.ts.map +0 -1
  407. package/node_modules/pi-subagents/src/agents/agent-scope.js +0 -9
  408. package/node_modules/pi-subagents/src/agents/agent-scope.js.map +0 -1
  409. package/node_modules/pi-subagents/src/agents/agent-selection.d.ts +0 -3
  410. package/node_modules/pi-subagents/src/agents/agent-selection.d.ts.map +0 -1
  411. package/node_modules/pi-subagents/src/agents/agent-selection.js +0 -23
  412. package/node_modules/pi-subagents/src/agents/agent-selection.js.map +0 -1
  413. package/node_modules/pi-subagents/src/agents/agent-serializer.d.ts +0 -8
  414. package/node_modules/pi-subagents/src/agents/agent-serializer.d.ts.map +0 -1
  415. package/node_modules/pi-subagents/src/agents/agent-serializer.js +0 -206
  416. package/node_modules/pi-subagents/src/agents/agent-serializer.js.map +0 -1
  417. package/node_modules/pi-subagents/src/agents/agents.d.ts +0 -344
  418. package/node_modules/pi-subagents/src/agents/agents.d.ts.map +0 -1
  419. package/node_modules/pi-subagents/src/agents/agents.js +0 -2748
  420. package/node_modules/pi-subagents/src/agents/agents.js.map +0 -1
  421. package/node_modules/pi-subagents/src/agents/builtin-names.d.ts +0 -2
  422. package/node_modules/pi-subagents/src/agents/builtin-names.d.ts.map +0 -1
  423. package/node_modules/pi-subagents/src/agents/builtin-names.js +0 -17
  424. package/node_modules/pi-subagents/src/agents/builtin-names.js.map +0 -1
  425. package/node_modules/pi-subagents/src/agents/chain-serializer.d.ts +0 -7
  426. package/node_modules/pi-subagents/src/agents/chain-serializer.d.ts.map +0 -1
  427. package/node_modules/pi-subagents/src/agents/chain-serializer.js +0 -319
  428. package/node_modules/pi-subagents/src/agents/chain-serializer.js.map +0 -1
  429. package/node_modules/pi-subagents/src/agents/frontmatter.d.ts +0 -16
  430. package/node_modules/pi-subagents/src/agents/frontmatter.d.ts.map +0 -1
  431. package/node_modules/pi-subagents/src/agents/frontmatter.js +0 -142
  432. package/node_modules/pi-subagents/src/agents/frontmatter.js.map +0 -1
  433. package/node_modules/pi-subagents/src/agents/global-npm-root.d.ts +0 -7
  434. package/node_modules/pi-subagents/src/agents/global-npm-root.d.ts.map +0 -1
  435. package/node_modules/pi-subagents/src/agents/global-npm-root.js +0 -58
  436. package/node_modules/pi-subagents/src/agents/global-npm-root.js.map +0 -1
  437. package/node_modules/pi-subagents/src/agents/identity.d.ts +0 -8
  438. package/node_modules/pi-subagents/src/agents/identity.d.ts.map +0 -1
  439. package/node_modules/pi-subagents/src/agents/identity.js +0 -30
  440. package/node_modules/pi-subagents/src/agents/identity.js.map +0 -1
  441. package/node_modules/pi-subagents/src/agents/proactive-skills.d.ts +0 -36
  442. package/node_modules/pi-subagents/src/agents/proactive-skills.d.ts.map +0 -1
  443. package/node_modules/pi-subagents/src/agents/proactive-skills.js +0 -156
  444. package/node_modules/pi-subagents/src/agents/proactive-skills.js.map +0 -1
  445. package/node_modules/pi-subagents/src/agents/runtime-agent-events.d.ts +0 -27
  446. package/node_modules/pi-subagents/src/agents/runtime-agent-events.d.ts.map +0 -1
  447. package/node_modules/pi-subagents/src/agents/runtime-agent-events.js +0 -53
  448. package/node_modules/pi-subagents/src/agents/runtime-agent-events.js.map +0 -1
  449. package/node_modules/pi-subagents/src/agents/runtime-agent-registry.d.ts +0 -64
  450. package/node_modules/pi-subagents/src/agents/runtime-agent-registry.d.ts.map +0 -1
  451. package/node_modules/pi-subagents/src/agents/runtime-agent-registry.js +0 -395
  452. package/node_modules/pi-subagents/src/agents/runtime-agent-registry.js.map +0 -1
  453. package/node_modules/pi-subagents/src/agents/skills.d.ts +0 -35
  454. package/node_modules/pi-subagents/src/agents/skills.d.ts.map +0 -1
  455. package/node_modules/pi-subagents/src/agents/skills.js +0 -718
  456. package/node_modules/pi-subagents/src/agents/skills.js.map +0 -1
  457. package/node_modules/pi-subagents/src/api/agents.d.ts +0 -5
  458. package/node_modules/pi-subagents/src/api/agents.d.ts.map +0 -1
  459. package/node_modules/pi-subagents/src/api/agents.js +0 -3
  460. package/node_modules/pi-subagents/src/api/agents.js.map +0 -1
  461. package/node_modules/pi-subagents/src/api/background-work.d.ts +0 -39
  462. package/node_modules/pi-subagents/src/api/background-work.d.ts.map +0 -1
  463. package/node_modules/pi-subagents/src/api/background-work.js +0 -165
  464. package/node_modules/pi-subagents/src/api/background-work.js.map +0 -1
  465. package/node_modules/pi-subagents/src/api/capability-ceiling.d.ts +0 -2
  466. package/node_modules/pi-subagents/src/api/capability-ceiling.d.ts.map +0 -1
  467. package/node_modules/pi-subagents/src/api/capability-ceiling.js +0 -2
  468. package/node_modules/pi-subagents/src/api/capability-ceiling.js.map +0 -1
  469. package/node_modules/pi-subagents/src/api/child-tool-plan.d.ts +0 -2
  470. package/node_modules/pi-subagents/src/api/child-tool-plan.d.ts.map +0 -1
  471. package/node_modules/pi-subagents/src/api/child-tool-plan.js +0 -2
  472. package/node_modules/pi-subagents/src/api/child-tool-plan.js.map +0 -1
  473. package/node_modules/pi-subagents/src/api/control-channel.d.ts +0 -2
  474. package/node_modules/pi-subagents/src/api/control-channel.d.ts.map +0 -1
  475. package/node_modules/pi-subagents/src/api/control-channel.js +0 -2
  476. package/node_modules/pi-subagents/src/api/control-channel.js.map +0 -1
  477. package/node_modules/pi-subagents/src/api/delegation.d.ts +0 -113
  478. package/node_modules/pi-subagents/src/api/delegation.d.ts.map +0 -1
  479. package/node_modules/pi-subagents/src/api/delegation.js +0 -9
  480. package/node_modules/pi-subagents/src/api/delegation.js.map +0 -1
  481. package/node_modules/pi-subagents/src/api/external-job-provider.d.ts +0 -58
  482. package/node_modules/pi-subagents/src/api/external-job-provider.d.ts.map +0 -1
  483. package/node_modules/pi-subagents/src/api/external-job-provider.js +0 -140
  484. package/node_modules/pi-subagents/src/api/external-job-provider.js.map +0 -1
  485. package/node_modules/pi-subagents/src/api/external-runs.d.ts +0 -48
  486. package/node_modules/pi-subagents/src/api/external-runs.d.ts.map +0 -1
  487. package/node_modules/pi-subagents/src/api/external-runs.js +0 -246
  488. package/node_modules/pi-subagents/src/api/external-runs.js.map +0 -1
  489. package/node_modules/pi-subagents/src/api/inspectors.d.ts +0 -21
  490. package/node_modules/pi-subagents/src/api/inspectors.d.ts.map +0 -1
  491. package/node_modules/pi-subagents/src/api/inspectors.js +0 -12
  492. package/node_modules/pi-subagents/src/api/inspectors.js.map +0 -1
  493. package/node_modules/pi-subagents/src/api/intercom-bridge.d.ts +0 -2
  494. package/node_modules/pi-subagents/src/api/intercom-bridge.d.ts.map +0 -1
  495. package/node_modules/pi-subagents/src/api/intercom-bridge.js +0 -2
  496. package/node_modules/pi-subagents/src/api/intercom-bridge.js.map +0 -1
  497. package/node_modules/pi-subagents/src/api/preflight.d.ts +0 -179
  498. package/node_modules/pi-subagents/src/api/preflight.d.ts.map +0 -1
  499. package/node_modules/pi-subagents/src/api/preflight.js +0 -410
  500. package/node_modules/pi-subagents/src/api/preflight.js.map +0 -1
  501. package/node_modules/pi-subagents/src/api/project-panes.d.ts +0 -8
  502. package/node_modules/pi-subagents/src/api/project-panes.d.ts.map +0 -1
  503. package/node_modules/pi-subagents/src/api/project-panes.js +0 -8
  504. package/node_modules/pi-subagents/src/api/project-panes.js.map +0 -1
  505. package/node_modules/pi-subagents/src/api/required-child-extensions.d.ts +0 -2
  506. package/node_modules/pi-subagents/src/api/required-child-extensions.d.ts.map +0 -1
  507. package/node_modules/pi-subagents/src/api/required-child-extensions.js +0 -2
  508. package/node_modules/pi-subagents/src/api/required-child-extensions.js.map +0 -1
  509. package/node_modules/pi-subagents/src/api/shared-types.d.ts +0 -2
  510. package/node_modules/pi-subagents/src/api/shared-types.d.ts.map +0 -1
  511. package/node_modules/pi-subagents/src/api/shared-types.js +0 -2
  512. package/node_modules/pi-subagents/src/api/shared-types.js.map +0 -1
  513. package/node_modules/pi-subagents/src/api/workflow-resources.d.ts +0 -3
  514. package/node_modules/pi-subagents/src/api/workflow-resources.d.ts.map +0 -1
  515. package/node_modules/pi-subagents/src/api/workflow-resources.js +0 -2
  516. package/node_modules/pi-subagents/src/api/workflow-resources.js.map +0 -1
  517. package/node_modules/pi-subagents/src/extension/active-runs-prompt.d.ts +0 -8
  518. package/node_modules/pi-subagents/src/extension/active-runs-prompt.d.ts.map +0 -1
  519. package/node_modules/pi-subagents/src/extension/active-runs-prompt.js +0 -30
  520. package/node_modules/pi-subagents/src/extension/active-runs-prompt.js.map +0 -1
  521. package/node_modules/pi-subagents/src/extension/config.d.ts +0 -8
  522. package/node_modules/pi-subagents/src/extension/config.d.ts.map +0 -1
  523. package/node_modules/pi-subagents/src/extension/config.js +0 -283
  524. package/node_modules/pi-subagents/src/extension/config.js.map +0 -1
  525. package/node_modules/pi-subagents/src/extension/control-notices.d.ts +0 -19
  526. package/node_modules/pi-subagents/src/extension/control-notices.d.ts.map +0 -1
  527. package/node_modules/pi-subagents/src/extension/control-notices.js +0 -30
  528. package/node_modules/pi-subagents/src/extension/control-notices.js.map +0 -1
  529. package/node_modules/pi-subagents/src/extension/declaration-pinning.d.ts +0 -19
  530. package/node_modules/pi-subagents/src/extension/declaration-pinning.d.ts.map +0 -1
  531. package/node_modules/pi-subagents/src/extension/declaration-pinning.js +0 -154
  532. package/node_modules/pi-subagents/src/extension/declaration-pinning.js.map +0 -1
  533. package/node_modules/pi-subagents/src/extension/doctor.d.ts +0 -35
  534. package/node_modules/pi-subagents/src/extension/doctor.d.ts.map +0 -1
  535. package/node_modules/pi-subagents/src/extension/doctor.js +0 -226
  536. package/node_modules/pi-subagents/src/extension/doctor.js.map +0 -1
  537. package/node_modules/pi-subagents/src/extension/fanout-child.d.ts +0 -7
  538. package/node_modules/pi-subagents/src/extension/fanout-child.d.ts.map +0 -1
  539. package/node_modules/pi-subagents/src/extension/fanout-child.js +0 -278
  540. package/node_modules/pi-subagents/src/extension/fanout-child.js.map +0 -1
  541. package/node_modules/pi-subagents/src/extension/herdr-pi-bridge.d.ts +0 -17
  542. package/node_modules/pi-subagents/src/extension/herdr-pi-bridge.d.ts.map +0 -1
  543. package/node_modules/pi-subagents/src/extension/herdr-pi-bridge.js +0 -245
  544. package/node_modules/pi-subagents/src/extension/herdr-pi-bridge.js.map +0 -1
  545. package/node_modules/pi-subagents/src/extension/index.d.ts +0 -19
  546. package/node_modules/pi-subagents/src/extension/index.d.ts.map +0 -1
  547. package/node_modules/pi-subagents/src/extension/index.js +0 -1093
  548. package/node_modules/pi-subagents/src/extension/index.js.map +0 -1
  549. package/node_modules/pi-subagents/src/extension/public-execution.d.ts +0 -71
  550. package/node_modules/pi-subagents/src/extension/public-execution.d.ts.map +0 -1
  551. package/node_modules/pi-subagents/src/extension/public-execution.js +0 -212
  552. package/node_modules/pi-subagents/src/extension/public-execution.js.map +0 -1
  553. package/node_modules/pi-subagents/src/extension/reply-workflow-script.d.ts +0 -12
  554. package/node_modules/pi-subagents/src/extension/reply-workflow-script.d.ts.map +0 -1
  555. package/node_modules/pi-subagents/src/extension/reply-workflow-script.js +0 -70
  556. package/node_modules/pi-subagents/src/extension/reply-workflow-script.js.map +0 -1
  557. package/node_modules/pi-subagents/src/extension/rpc.d.ts +0 -85
  558. package/node_modules/pi-subagents/src/extension/rpc.d.ts.map +0 -1
  559. package/node_modules/pi-subagents/src/extension/rpc.js +0 -726
  560. package/node_modules/pi-subagents/src/extension/rpc.js.map +0 -1
  561. package/node_modules/pi-subagents/src/extension/schemas.d.ts +0 -275
  562. package/node_modules/pi-subagents/src/extension/schemas.d.ts.map +0 -1
  563. package/node_modules/pi-subagents/src/extension/schemas.js +0 -311
  564. package/node_modules/pi-subagents/src/extension/schemas.js.map +0 -1
  565. package/node_modules/pi-subagents/src/extension/steering-notices.d.ts +0 -15
  566. package/node_modules/pi-subagents/src/extension/steering-notices.d.ts.map +0 -1
  567. package/node_modules/pi-subagents/src/extension/steering-notices.js +0 -23
  568. package/node_modules/pi-subagents/src/extension/steering-notices.js.map +0 -1
  569. package/node_modules/pi-subagents/src/extension/subagent-guide.d.ts +0 -5
  570. package/node_modules/pi-subagents/src/extension/subagent-guide.d.ts.map +0 -1
  571. package/node_modules/pi-subagents/src/extension/subagent-guide.js +0 -116
  572. package/node_modules/pi-subagents/src/extension/subagent-guide.js.map +0 -1
  573. package/node_modules/pi-subagents/src/extension/subagent-options.d.ts +0 -8
  574. package/node_modules/pi-subagents/src/extension/subagent-options.d.ts.map +0 -1
  575. package/node_modules/pi-subagents/src/extension/subagent-options.js +0 -52
  576. package/node_modules/pi-subagents/src/extension/subagent-options.js.map +0 -1
  577. package/node_modules/pi-subagents/src/extension/tool-activation.d.ts +0 -7
  578. package/node_modules/pi-subagents/src/extension/tool-activation.d.ts.map +0 -1
  579. package/node_modules/pi-subagents/src/extension/tool-activation.js +0 -135
  580. package/node_modules/pi-subagents/src/extension/tool-activation.js.map +0 -1
  581. package/node_modules/pi-subagents/src/extension/tool-description.d.ts +0 -20
  582. package/node_modules/pi-subagents/src/extension/tool-description.d.ts.map +0 -1
  583. package/node_modules/pi-subagents/src/extension/tool-description.js +0 -170
  584. package/node_modules/pi-subagents/src/extension/tool-description.js.map +0 -1
  585. package/node_modules/pi-subagents/src/extension/tool-result.d.ts +0 -10
  586. package/node_modules/pi-subagents/src/extension/tool-result.d.ts.map +0 -1
  587. package/node_modules/pi-subagents/src/extension/tool-result.js +0 -17
  588. package/node_modules/pi-subagents/src/extension/tool-result.js.map +0 -1
  589. package/node_modules/pi-subagents/src/extension/upgrade-notice.d.ts +0 -7
  590. package/node_modules/pi-subagents/src/extension/upgrade-notice.d.ts.map +0 -1
  591. package/node_modules/pi-subagents/src/extension/upgrade-notice.js +0 -37
  592. package/node_modules/pi-subagents/src/extension/upgrade-notice.js.map +0 -1
  593. package/node_modules/pi-subagents/src/inspectors/actions.d.ts +0 -25
  594. package/node_modules/pi-subagents/src/inspectors/actions.d.ts.map +0 -1
  595. package/node_modules/pi-subagents/src/inspectors/actions.js +0 -183
  596. package/node_modules/pi-subagents/src/inspectors/actions.js.map +0 -1
  597. package/node_modules/pi-subagents/src/inspectors/ghostty/actions.d.ts +0 -12
  598. package/node_modules/pi-subagents/src/inspectors/ghostty/actions.d.ts.map +0 -1
  599. package/node_modules/pi-subagents/src/inspectors/ghostty/actions.js +0 -63
  600. package/node_modules/pi-subagents/src/inspectors/ghostty/actions.js.map +0 -1
  601. package/node_modules/pi-subagents/src/inspectors/ghostty/plugin.d.ts +0 -8
  602. package/node_modules/pi-subagents/src/inspectors/ghostty/plugin.d.ts.map +0 -1
  603. package/node_modules/pi-subagents/src/inspectors/ghostty/plugin.js +0 -24
  604. package/node_modules/pi-subagents/src/inspectors/ghostty/plugin.js.map +0 -1
  605. package/node_modules/pi-subagents/src/inspectors/herdr/actions.d.ts +0 -26
  606. package/node_modules/pi-subagents/src/inspectors/herdr/actions.d.ts.map +0 -1
  607. package/node_modules/pi-subagents/src/inspectors/herdr/actions.js +0 -134
  608. package/node_modules/pi-subagents/src/inspectors/herdr/actions.js.map +0 -1
  609. package/node_modules/pi-subagents/src/inspectors/herdr/client.d.ts +0 -42
  610. package/node_modules/pi-subagents/src/inspectors/herdr/client.d.ts.map +0 -1
  611. package/node_modules/pi-subagents/src/inspectors/herdr/client.js +0 -130
  612. package/node_modules/pi-subagents/src/inspectors/herdr/client.js.map +0 -1
  613. package/node_modules/pi-subagents/src/inspectors/herdr/focus.d.ts +0 -25
  614. package/node_modules/pi-subagents/src/inspectors/herdr/focus.d.ts.map +0 -1
  615. package/node_modules/pi-subagents/src/inspectors/herdr/focus.js +0 -50
  616. package/node_modules/pi-subagents/src/inspectors/herdr/focus.js.map +0 -1
  617. package/node_modules/pi-subagents/src/inspectors/herdr/plugin.d.ts +0 -7
  618. package/node_modules/pi-subagents/src/inspectors/herdr/plugin.d.ts.map +0 -1
  619. package/node_modules/pi-subagents/src/inspectors/herdr/plugin.js +0 -15
  620. package/node_modules/pi-subagents/src/inspectors/herdr/plugin.js.map +0 -1
  621. package/node_modules/pi-subagents/src/inspectors/herdr/project-panes.d.ts +0 -137
  622. package/node_modules/pi-subagents/src/inspectors/herdr/project-panes.d.ts.map +0 -1
  623. package/node_modules/pi-subagents/src/inspectors/herdr/project-panes.js +0 -608
  624. package/node_modules/pi-subagents/src/inspectors/herdr/project-panes.js.map +0 -1
  625. package/node_modules/pi-subagents/src/inspectors/inspector-runner.d.ts +0 -24
  626. package/node_modules/pi-subagents/src/inspectors/inspector-runner.d.ts.map +0 -1
  627. package/node_modules/pi-subagents/src/inspectors/inspector-runner.js +0 -162
  628. package/node_modules/pi-subagents/src/inspectors/inspector-runner.js.map +0 -1
  629. package/node_modules/pi-subagents/src/inspectors/plugins.d.ts +0 -9
  630. package/node_modules/pi-subagents/src/inspectors/plugins.d.ts.map +0 -1
  631. package/node_modules/pi-subagents/src/inspectors/plugins.js +0 -83
  632. package/node_modules/pi-subagents/src/inspectors/plugins.js.map +0 -1
  633. package/node_modules/pi-subagents/src/inspectors/session-roots-codec.d.ts +0 -16
  634. package/node_modules/pi-subagents/src/inspectors/session-roots-codec.d.ts.map +0 -1
  635. package/node_modules/pi-subagents/src/inspectors/session-roots-codec.js +0 -33
  636. package/node_modules/pi-subagents/src/inspectors/session-roots-codec.js.map +0 -1
  637. package/node_modules/pi-subagents/src/inspectors/shell-command.d.ts +0 -2
  638. package/node_modules/pi-subagents/src/inspectors/shell-command.d.ts.map +0 -1
  639. package/node_modules/pi-subagents/src/inspectors/shell-command.js +0 -17
  640. package/node_modules/pi-subagents/src/inspectors/shell-command.js.map +0 -1
  641. package/node_modules/pi-subagents/src/inspectors/tmux/actions.d.ts +0 -26
  642. package/node_modules/pi-subagents/src/inspectors/tmux/actions.d.ts.map +0 -1
  643. package/node_modules/pi-subagents/src/inspectors/tmux/actions.js +0 -182
  644. package/node_modules/pi-subagents/src/inspectors/tmux/actions.js.map +0 -1
  645. package/node_modules/pi-subagents/src/inspectors/tmux/client.d.ts +0 -28
  646. package/node_modules/pi-subagents/src/inspectors/tmux/client.d.ts.map +0 -1
  647. package/node_modules/pi-subagents/src/inspectors/tmux/client.js +0 -65
  648. package/node_modules/pi-subagents/src/inspectors/tmux/client.js.map +0 -1
  649. package/node_modules/pi-subagents/src/inspectors/tmux/plugin.d.ts +0 -8
  650. package/node_modules/pi-subagents/src/inspectors/tmux/plugin.d.ts.map +0 -1
  651. package/node_modules/pi-subagents/src/inspectors/tmux/plugin.js +0 -15
  652. package/node_modules/pi-subagents/src/inspectors/tmux/plugin.js.map +0 -1
  653. package/node_modules/pi-subagents/src/inspectors/types.d.ts +0 -49
  654. package/node_modules/pi-subagents/src/inspectors/types.d.ts.map +0 -1
  655. package/node_modules/pi-subagents/src/inspectors/types.js +0 -2
  656. package/node_modules/pi-subagents/src/inspectors/types.js.map +0 -1
  657. package/node_modules/pi-subagents/src/integrations/herdr-status.d.ts +0 -48
  658. package/node_modules/pi-subagents/src/integrations/herdr-status.d.ts.map +0 -1
  659. package/node_modules/pi-subagents/src/integrations/herdr-status.js +0 -351
  660. package/node_modules/pi-subagents/src/integrations/herdr-status.js.map +0 -1
  661. package/node_modules/pi-subagents/src/integrations/pi-web-session-liveness.d.ts +0 -20
  662. package/node_modules/pi-subagents/src/integrations/pi-web-session-liveness.d.ts.map +0 -1
  663. package/node_modules/pi-subagents/src/integrations/pi-web-session-liveness.js +0 -54
  664. package/node_modules/pi-subagents/src/integrations/pi-web-session-liveness.js.map +0 -1
  665. package/node_modules/pi-subagents/src/integrations/program-status.d.ts +0 -31
  666. package/node_modules/pi-subagents/src/integrations/program-status.d.ts.map +0 -1
  667. package/node_modules/pi-subagents/src/integrations/program-status.js +0 -189
  668. package/node_modules/pi-subagents/src/integrations/program-status.js.map +0 -1
  669. package/node_modules/pi-subagents/src/intercom/intercom-bridge.d.ts +0 -59
  670. package/node_modules/pi-subagents/src/intercom/intercom-bridge.d.ts.map +0 -1
  671. package/node_modules/pi-subagents/src/intercom/intercom-bridge.js +0 -194
  672. package/node_modules/pi-subagents/src/intercom/intercom-bridge.js.map +0 -1
  673. package/node_modules/pi-subagents/src/intercom/native-supervisor-channel.d.ts +0 -80
  674. package/node_modules/pi-subagents/src/intercom/native-supervisor-channel.d.ts.map +0 -1
  675. package/node_modules/pi-subagents/src/intercom/native-supervisor-channel.js +0 -992
  676. package/node_modules/pi-subagents/src/intercom/native-supervisor-channel.js.map +0 -1
  677. package/node_modules/pi-subagents/src/intercom/result-intercom.d.ts +0 -36
  678. package/node_modules/pi-subagents/src/intercom/result-intercom.d.ts.map +0 -1
  679. package/node_modules/pi-subagents/src/intercom/result-intercom.js +0 -373
  680. package/node_modules/pi-subagents/src/intercom/result-intercom.js.map +0 -1
  681. package/node_modules/pi-subagents/src/intercom/supervisor-ui.d.ts +0 -30
  682. package/node_modules/pi-subagents/src/intercom/supervisor-ui.d.ts.map +0 -1
  683. package/node_modules/pi-subagents/src/intercom/supervisor-ui.js +0 -50
  684. package/node_modules/pi-subagents/src/intercom/supervisor-ui.js.map +0 -1
  685. package/node_modules/pi-subagents/src/missions/actions.d.ts +0 -55
  686. package/node_modules/pi-subagents/src/missions/actions.d.ts.map +0 -1
  687. package/node_modules/pi-subagents/src/missions/actions.js +0 -396
  688. package/node_modules/pi-subagents/src/missions/actions.js.map +0 -1
  689. package/node_modules/pi-subagents/src/missions/goal-driver.d.ts +0 -17
  690. package/node_modules/pi-subagents/src/missions/goal-driver.d.ts.map +0 -1
  691. package/node_modules/pi-subagents/src/missions/goal-driver.js +0 -172
  692. package/node_modules/pi-subagents/src/missions/goal-driver.js.map +0 -1
  693. package/node_modules/pi-subagents/src/missions/lifecycle.d.ts +0 -40
  694. package/node_modules/pi-subagents/src/missions/lifecycle.d.ts.map +0 -1
  695. package/node_modules/pi-subagents/src/missions/lifecycle.js +0 -352
  696. package/node_modules/pi-subagents/src/missions/lifecycle.js.map +0 -1
  697. package/node_modules/pi-subagents/src/missions/store.d.ts +0 -22
  698. package/node_modules/pi-subagents/src/missions/store.d.ts.map +0 -1
  699. package/node_modules/pi-subagents/src/missions/store.js +0 -605
  700. package/node_modules/pi-subagents/src/missions/store.js.map +0 -1
  701. package/node_modules/pi-subagents/src/missions/types.d.ts +0 -168
  702. package/node_modules/pi-subagents/src/missions/types.d.ts.map +0 -1
  703. package/node_modules/pi-subagents/src/missions/types.js +0 -10
  704. package/node_modules/pi-subagents/src/missions/types.js.map +0 -1
  705. package/node_modules/pi-subagents/src/missions/workflow-state.d.ts +0 -15
  706. package/node_modules/pi-subagents/src/missions/workflow-state.d.ts.map +0 -1
  707. package/node_modules/pi-subagents/src/missions/workflow-state.js +0 -274
  708. package/node_modules/pi-subagents/src/missions/workflow-state.js.map +0 -1
  709. package/node_modules/pi-subagents/src/policy/authority.d.ts +0 -10
  710. package/node_modules/pi-subagents/src/policy/authority.d.ts.map +0 -1
  711. package/node_modules/pi-subagents/src/policy/authority.js +0 -42
  712. package/node_modules/pi-subagents/src/policy/authority.js.map +0 -1
  713. package/node_modules/pi-subagents/src/profiles/profiles.d.ts +0 -135
  714. package/node_modules/pi-subagents/src/profiles/profiles.d.ts.map +0 -1
  715. package/node_modules/pi-subagents/src/profiles/profiles.js +0 -527
  716. package/node_modules/pi-subagents/src/profiles/profiles.js.map +0 -1
  717. package/node_modules/pi-subagents/src/runs/background/active-async-capacity.d.ts +0 -115
  718. package/node_modules/pi-subagents/src/runs/background/active-async-capacity.d.ts.map +0 -1
  719. package/node_modules/pi-subagents/src/runs/background/active-async-capacity.js +0 -512
  720. package/node_modules/pi-subagents/src/runs/background/active-async-capacity.js.map +0 -1
  721. package/node_modules/pi-subagents/src/runs/background/active-run-index.d.ts +0 -13
  722. package/node_modules/pi-subagents/src/runs/background/active-run-index.d.ts.map +0 -1
  723. package/node_modules/pi-subagents/src/runs/background/active-run-index.js +0 -158
  724. package/node_modules/pi-subagents/src/runs/background/active-run-index.js.map +0 -1
  725. package/node_modules/pi-subagents/src/runs/background/async-execution.d.ts +0 -298
  726. package/node_modules/pi-subagents/src/runs/background/async-execution.d.ts.map +0 -1
  727. package/node_modules/pi-subagents/src/runs/background/async-execution.js +0 -2125
  728. package/node_modules/pi-subagents/src/runs/background/async-execution.js.map +0 -1
  729. package/node_modules/pi-subagents/src/runs/background/async-job-tracker.d.ts +0 -33
  730. package/node_modules/pi-subagents/src/runs/background/async-job-tracker.d.ts.map +0 -1
  731. package/node_modules/pi-subagents/src/runs/background/async-job-tracker.js +0 -908
  732. package/node_modules/pi-subagents/src/runs/background/async-job-tracker.js.map +0 -1
  733. package/node_modules/pi-subagents/src/runs/background/async-resume.d.ts +0 -59
  734. package/node_modules/pi-subagents/src/runs/background/async-resume.d.ts.map +0 -1
  735. package/node_modules/pi-subagents/src/runs/background/async-resume.js +0 -678
  736. package/node_modules/pi-subagents/src/runs/background/async-resume.js.map +0 -1
  737. package/node_modules/pi-subagents/src/runs/background/async-retention.d.ts +0 -45
  738. package/node_modules/pi-subagents/src/runs/background/async-retention.d.ts.map +0 -1
  739. package/node_modules/pi-subagents/src/runs/background/async-retention.js +0 -916
  740. package/node_modules/pi-subagents/src/runs/background/async-retention.js.map +0 -1
  741. package/node_modules/pi-subagents/src/runs/background/async-status-snapshot.d.ts +0 -10
  742. package/node_modules/pi-subagents/src/runs/background/async-status-snapshot.d.ts.map +0 -1
  743. package/node_modules/pi-subagents/src/runs/background/async-status-snapshot.js +0 -25
  744. package/node_modules/pi-subagents/src/runs/background/async-status-snapshot.js.map +0 -1
  745. package/node_modules/pi-subagents/src/runs/background/async-status.d.ts +0 -170
  746. package/node_modules/pi-subagents/src/runs/background/async-status.d.ts.map +0 -1
  747. package/node_modules/pi-subagents/src/runs/background/async-status.js +0 -674
  748. package/node_modules/pi-subagents/src/runs/background/async-status.js.map +0 -1
  749. package/node_modules/pi-subagents/src/runs/background/auto-drain.d.ts +0 -17
  750. package/node_modules/pi-subagents/src/runs/background/auto-drain.d.ts.map +0 -1
  751. package/node_modules/pi-subagents/src/runs/background/auto-drain.js +0 -73
  752. package/node_modules/pi-subagents/src/runs/background/auto-drain.js.map +0 -1
  753. package/node_modules/pi-subagents/src/runs/background/await-async-run.d.ts +0 -27
  754. package/node_modules/pi-subagents/src/runs/background/await-async-run.d.ts.map +0 -1
  755. package/node_modules/pi-subagents/src/runs/background/await-async-run.js +0 -88
  756. package/node_modules/pi-subagents/src/runs/background/await-async-run.js.map +0 -1
  757. package/node_modules/pi-subagents/src/runs/background/binary-bootstrap.d.ts +0 -9
  758. package/node_modules/pi-subagents/src/runs/background/binary-bootstrap.d.ts.map +0 -1
  759. package/node_modules/pi-subagents/src/runs/background/binary-bootstrap.js +0 -70
  760. package/node_modules/pi-subagents/src/runs/background/binary-bootstrap.js.map +0 -1
  761. package/node_modules/pi-subagents/src/runs/background/calendar-schedule.d.ts +0 -27
  762. package/node_modules/pi-subagents/src/runs/background/calendar-schedule.d.ts.map +0 -1
  763. package/node_modules/pi-subagents/src/runs/background/calendar-schedule.js +0 -94
  764. package/node_modules/pi-subagents/src/runs/background/calendar-schedule.js.map +0 -1
  765. package/node_modules/pi-subagents/src/runs/background/chain-append.d.ts +0 -35
  766. package/node_modules/pi-subagents/src/runs/background/chain-append.d.ts.map +0 -1
  767. package/node_modules/pi-subagents/src/runs/background/chain-append.js +0 -300
  768. package/node_modules/pi-subagents/src/runs/background/chain-append.js.map +0 -1
  769. package/node_modules/pi-subagents/src/runs/background/chain-root-attachment.d.ts +0 -52
  770. package/node_modules/pi-subagents/src/runs/background/chain-root-attachment.d.ts.map +0 -1
  771. package/node_modules/pi-subagents/src/runs/background/chain-root-attachment.js +0 -187
  772. package/node_modules/pi-subagents/src/runs/background/chain-root-attachment.js.map +0 -1
  773. package/node_modules/pi-subagents/src/runs/background/completion-batcher.d.ts +0 -52
  774. package/node_modules/pi-subagents/src/runs/background/completion-batcher.d.ts.map +0 -1
  775. package/node_modules/pi-subagents/src/runs/background/completion-batcher.js +0 -120
  776. package/node_modules/pi-subagents/src/runs/background/completion-batcher.js.map +0 -1
  777. package/node_modules/pi-subagents/src/runs/background/completion-dedupe.d.ts +0 -14
  778. package/node_modules/pi-subagents/src/runs/background/completion-dedupe.d.ts.map +0 -1
  779. package/node_modules/pi-subagents/src/runs/background/completion-dedupe.js +0 -49
  780. package/node_modules/pi-subagents/src/runs/background/completion-dedupe.js.map +0 -1
  781. package/node_modules/pi-subagents/src/runs/background/completion-replay.d.ts +0 -48
  782. package/node_modules/pi-subagents/src/runs/background/completion-replay.d.ts.map +0 -1
  783. package/node_modules/pi-subagents/src/runs/background/completion-replay.js +0 -267
  784. package/node_modules/pi-subagents/src/runs/background/completion-replay.js.map +0 -1
  785. package/node_modules/pi-subagents/src/runs/background/control-channel.d.ts +0 -171
  786. package/node_modules/pi-subagents/src/runs/background/control-channel.d.ts.map +0 -1
  787. package/node_modules/pi-subagents/src/runs/background/control-channel.js +0 -611
  788. package/node_modules/pi-subagents/src/runs/background/control-channel.js.map +0 -1
  789. package/node_modules/pi-subagents/src/runs/background/fleet-view.d.ts +0 -64
  790. package/node_modules/pi-subagents/src/runs/background/fleet-view.d.ts.map +0 -1
  791. package/node_modules/pi-subagents/src/runs/background/fleet-view.js +0 -667
  792. package/node_modules/pi-subagents/src/runs/background/fleet-view.js.map +0 -1
  793. package/node_modules/pi-subagents/src/runs/background/index-segment.d.ts +0 -16
  794. package/node_modules/pi-subagents/src/runs/background/index-segment.d.ts.map +0 -1
  795. package/node_modules/pi-subagents/src/runs/background/index-segment.js +0 -59
  796. package/node_modules/pi-subagents/src/runs/background/index-segment.js.map +0 -1
  797. package/node_modules/pi-subagents/src/runs/background/inspect-rpc.d.ts +0 -60
  798. package/node_modules/pi-subagents/src/runs/background/inspect-rpc.d.ts.map +0 -1
  799. package/node_modules/pi-subagents/src/runs/background/inspect-rpc.js +0 -406
  800. package/node_modules/pi-subagents/src/runs/background/inspect-rpc.js.map +0 -1
  801. package/node_modules/pi-subagents/src/runs/background/notify.d.ts +0 -192
  802. package/node_modules/pi-subagents/src/runs/background/notify.d.ts.map +0 -1
  803. package/node_modules/pi-subagents/src/runs/background/notify.js +0 -897
  804. package/node_modules/pi-subagents/src/runs/background/notify.js.map +0 -1
  805. package/node_modules/pi-subagents/src/runs/background/owned-process-tree.d.ts +0 -11
  806. package/node_modules/pi-subagents/src/runs/background/owned-process-tree.d.ts.map +0 -1
  807. package/node_modules/pi-subagents/src/runs/background/owned-process-tree.js +0 -117
  808. package/node_modules/pi-subagents/src/runs/background/owned-process-tree.js.map +0 -1
  809. package/node_modules/pi-subagents/src/runs/background/parallel-groups.d.ts +0 -4
  810. package/node_modules/pi-subagents/src/runs/background/parallel-groups.d.ts.map +0 -1
  811. package/node_modules/pi-subagents/src/runs/background/parallel-groups.js +0 -47
  812. package/node_modules/pi-subagents/src/runs/background/parallel-groups.js.map +0 -1
  813. package/node_modules/pi-subagents/src/runs/background/pid-namespace.d.ts +0 -3
  814. package/node_modules/pi-subagents/src/runs/background/pid-namespace.d.ts.map +0 -1
  815. package/node_modules/pi-subagents/src/runs/background/pid-namespace.js +0 -20
  816. package/node_modules/pi-subagents/src/runs/background/pid-namespace.js.map +0 -1
  817. package/node_modules/pi-subagents/src/runs/background/process-terminal-candidate.d.ts +0 -18
  818. package/node_modules/pi-subagents/src/runs/background/process-terminal-candidate.d.ts.map +0 -1
  819. package/node_modules/pi-subagents/src/runs/background/process-terminal-candidate.js +0 -97
  820. package/node_modules/pi-subagents/src/runs/background/process-terminal-candidate.js.map +0 -1
  821. package/node_modules/pi-subagents/src/runs/background/process-terminal.d.ts +0 -22
  822. package/node_modules/pi-subagents/src/runs/background/process-terminal.d.ts.map +0 -1
  823. package/node_modules/pi-subagents/src/runs/background/process-terminal.js +0 -228
  824. package/node_modules/pi-subagents/src/runs/background/process-terminal.js.map +0 -1
  825. package/node_modules/pi-subagents/src/runs/background/result-delivery-ownership.d.ts +0 -11
  826. package/node_modules/pi-subagents/src/runs/background/result-delivery-ownership.d.ts.map +0 -1
  827. package/node_modules/pi-subagents/src/runs/background/result-delivery-ownership.js +0 -37
  828. package/node_modules/pi-subagents/src/runs/background/result-delivery-ownership.js.map +0 -1
  829. package/node_modules/pi-subagents/src/runs/background/result-files.d.ts +0 -62
  830. package/node_modules/pi-subagents/src/runs/background/result-files.d.ts.map +0 -1
  831. package/node_modules/pi-subagents/src/runs/background/result-files.js +0 -626
  832. package/node_modules/pi-subagents/src/runs/background/result-files.js.map +0 -1
  833. package/node_modules/pi-subagents/src/runs/background/result-watcher.d.ts +0 -91
  834. package/node_modules/pi-subagents/src/runs/background/result-watcher.d.ts.map +0 -1
  835. package/node_modules/pi-subagents/src/runs/background/result-watcher.js +0 -797
  836. package/node_modules/pi-subagents/src/runs/background/result-watcher.js.map +0 -1
  837. package/node_modules/pi-subagents/src/runs/background/resume-guidance.d.ts +0 -5
  838. package/node_modules/pi-subagents/src/runs/background/resume-guidance.d.ts.map +0 -1
  839. package/node_modules/pi-subagents/src/runs/background/resume-guidance.js +0 -57
  840. package/node_modules/pi-subagents/src/runs/background/resume-guidance.js.map +0 -1
  841. package/node_modules/pi-subagents/src/runs/background/retained-children.d.ts +0 -25
  842. package/node_modules/pi-subagents/src/runs/background/retained-children.d.ts.map +0 -1
  843. package/node_modules/pi-subagents/src/runs/background/retained-children.js +0 -129
  844. package/node_modules/pi-subagents/src/runs/background/retained-children.js.map +0 -1
  845. package/node_modules/pi-subagents/src/runs/background/retained-nested-route-tracker.d.ts +0 -13
  846. package/node_modules/pi-subagents/src/runs/background/retained-nested-route-tracker.d.ts.map +0 -1
  847. package/node_modules/pi-subagents/src/runs/background/retained-nested-route-tracker.js +0 -91
  848. package/node_modules/pi-subagents/src/runs/background/retained-nested-route-tracker.js.map +0 -1
  849. package/node_modules/pi-subagents/src/runs/background/run-child-session.d.ts +0 -127
  850. package/node_modules/pi-subagents/src/runs/background/run-child-session.d.ts.map +0 -1
  851. package/node_modules/pi-subagents/src/runs/background/run-child-session.js +0 -626
  852. package/node_modules/pi-subagents/src/runs/background/run-child-session.js.map +0 -1
  853. package/node_modules/pi-subagents/src/runs/background/run-id-query.d.ts +0 -4
  854. package/node_modules/pi-subagents/src/runs/background/run-id-query.d.ts.map +0 -1
  855. package/node_modules/pi-subagents/src/runs/background/run-id-query.js +0 -7
  856. package/node_modules/pi-subagents/src/runs/background/run-id-query.js.map +0 -1
  857. package/node_modules/pi-subagents/src/runs/background/run-id-resolver.d.ts +0 -23
  858. package/node_modules/pi-subagents/src/runs/background/run-id-resolver.d.ts.map +0 -1
  859. package/node_modules/pi-subagents/src/runs/background/run-id-resolver.js +0 -173
  860. package/node_modules/pi-subagents/src/runs/background/run-id-resolver.js.map +0 -1
  861. package/node_modules/pi-subagents/src/runs/background/run-status.d.ts +0 -26
  862. package/node_modules/pi-subagents/src/runs/background/run-status.d.ts.map +0 -1
  863. package/node_modules/pi-subagents/src/runs/background/run-status.js +0 -843
  864. package/node_modules/pi-subagents/src/runs/background/run-status.js.map +0 -1
  865. package/node_modules/pi-subagents/src/runs/background/runner-aliases.d.ts +0 -18
  866. package/node_modules/pi-subagents/src/runs/background/runner-aliases.d.ts.map +0 -1
  867. package/node_modules/pi-subagents/src/runs/background/runner-aliases.js +0 -160
  868. package/node_modules/pi-subagents/src/runs/background/runner-aliases.js.map +0 -1
  869. package/node_modules/pi-subagents/src/runs/background/runner-child-launch.d.ts +0 -25
  870. package/node_modules/pi-subagents/src/runs/background/runner-child-launch.d.ts.map +0 -1
  871. package/node_modules/pi-subagents/src/runs/background/runner-child-launch.js +0 -71
  872. package/node_modules/pi-subagents/src/runs/background/runner-child-launch.js.map +0 -1
  873. package/node_modules/pi-subagents/src/runs/background/runner-child-sessions.d.ts +0 -7
  874. package/node_modules/pi-subagents/src/runs/background/runner-child-sessions.d.ts.map +0 -1
  875. package/node_modules/pi-subagents/src/runs/background/runner-child-sessions.js +0 -35
  876. package/node_modules/pi-subagents/src/runs/background/runner-child-sessions.js.map +0 -1
  877. package/node_modules/pi-subagents/src/runs/background/runner-http-dispatcher.d.ts +0 -46
  878. package/node_modules/pi-subagents/src/runs/background/runner-http-dispatcher.d.ts.map +0 -1
  879. package/node_modules/pi-subagents/src/runs/background/runner-http-dispatcher.js +0 -116
  880. package/node_modules/pi-subagents/src/runs/background/runner-http-dispatcher.js.map +0 -1
  881. package/node_modules/pi-subagents/src/runs/background/runner-startup-failure.d.ts +0 -14
  882. package/node_modules/pi-subagents/src/runs/background/runner-startup-failure.d.ts.map +0 -1
  883. package/node_modules/pi-subagents/src/runs/background/runner-startup-failure.js +0 -47
  884. package/node_modules/pi-subagents/src/runs/background/runner-startup-failure.js.map +0 -1
  885. package/node_modules/pi-subagents/src/runs/background/scheduled-runs.d.ts +0 -128
  886. package/node_modules/pi-subagents/src/runs/background/scheduled-runs.d.ts.map +0 -1
  887. package/node_modules/pi-subagents/src/runs/background/scheduled-runs.js +0 -1266
  888. package/node_modules/pi-subagents/src/runs/background/scheduled-runs.js.map +0 -1
  889. package/node_modules/pi-subagents/src/runs/background/stale-run-reconciler.d.ts +0 -38
  890. package/node_modules/pi-subagents/src/runs/background/stale-run-reconciler.d.ts.map +0 -1
  891. package/node_modules/pi-subagents/src/runs/background/stale-run-reconciler.js +0 -421
  892. package/node_modules/pi-subagents/src/runs/background/stale-run-reconciler.js.map +0 -1
  893. package/node_modules/pi-subagents/src/runs/background/steering.d.ts +0 -52
  894. package/node_modules/pi-subagents/src/runs/background/steering.d.ts.map +0 -1
  895. package/node_modules/pi-subagents/src/runs/background/steering.js +0 -247
  896. package/node_modules/pi-subagents/src/runs/background/steering.js.map +0 -1
  897. package/node_modules/pi-subagents/src/runs/background/subagent-runner-bootstrap.d.ts +0 -14
  898. package/node_modules/pi-subagents/src/runs/background/subagent-runner-bootstrap.d.ts.map +0 -1
  899. package/node_modules/pi-subagents/src/runs/background/subagent-runner-bootstrap.js +0 -281
  900. package/node_modules/pi-subagents/src/runs/background/subagent-runner-bootstrap.js.map +0 -1
  901. package/node_modules/pi-subagents/src/runs/background/subagent-runner.d.ts +0 -205
  902. package/node_modules/pi-subagents/src/runs/background/subagent-runner.d.ts.map +0 -1
  903. package/node_modules/pi-subagents/src/runs/background/subagent-runner.js +0 -4919
  904. package/node_modules/pi-subagents/src/runs/background/subagent-runner.js.map +0 -1
  905. package/node_modules/pi-subagents/src/runs/background/subagent-wait.d.ts +0 -124
  906. package/node_modules/pi-subagents/src/runs/background/subagent-wait.d.ts.map +0 -1
  907. package/node_modules/pi-subagents/src/runs/background/subagent-wait.js +0 -749
  908. package/node_modules/pi-subagents/src/runs/background/subagent-wait.js.map +0 -1
  909. package/node_modules/pi-subagents/src/runs/background/terminal-run-index.d.ts +0 -9
  910. package/node_modules/pi-subagents/src/runs/background/terminal-run-index.d.ts.map +0 -1
  911. package/node_modules/pi-subagents/src/runs/background/terminal-run-index.js +0 -169
  912. package/node_modules/pi-subagents/src/runs/background/terminal-run-index.js.map +0 -1
  913. package/node_modules/pi-subagents/src/runs/background/top-level-async.d.ts +0 -8
  914. package/node_modules/pi-subagents/src/runs/background/top-level-async.d.ts.map +0 -1
  915. package/node_modules/pi-subagents/src/runs/background/top-level-async.js +0 -6
  916. package/node_modules/pi-subagents/src/runs/background/top-level-async.js.map +0 -1
  917. package/node_modules/pi-subagents/src/runs/background/wait-completions.d.ts +0 -29
  918. package/node_modules/pi-subagents/src/runs/background/wait-completions.d.ts.map +0 -1
  919. package/node_modules/pi-subagents/src/runs/background/wait-completions.js +0 -265
  920. package/node_modules/pi-subagents/src/runs/background/wait-completions.js.map +0 -1
  921. package/node_modules/pi-subagents/src/runs/background/wait-config.d.ts +0 -9
  922. package/node_modules/pi-subagents/src/runs/background/wait-config.d.ts.map +0 -1
  923. package/node_modules/pi-subagents/src/runs/background/wait-config.js +0 -47
  924. package/node_modules/pi-subagents/src/runs/background/wait-config.js.map +0 -1
  925. package/node_modules/pi-subagents/src/runs/background/wait-subscriptions.d.ts +0 -27
  926. package/node_modules/pi-subagents/src/runs/background/wait-subscriptions.d.ts.map +0 -1
  927. package/node_modules/pi-subagents/src/runs/background/wait-subscriptions.js +0 -337
  928. package/node_modules/pi-subagents/src/runs/background/wait-subscriptions.js.map +0 -1
  929. package/node_modules/pi-subagents/src/runs/background/wait-tool.d.ts +0 -7
  930. package/node_modules/pi-subagents/src/runs/background/wait-tool.d.ts.map +0 -1
  931. package/node_modules/pi-subagents/src/runs/background/wait-tool.js +0 -49
  932. package/node_modules/pi-subagents/src/runs/background/wait-tool.js.map +0 -1
  933. package/node_modules/pi-subagents/src/runs/background/workflow-terminal-proof.d.ts +0 -31
  934. package/node_modules/pi-subagents/src/runs/background/workflow-terminal-proof.d.ts.map +0 -1
  935. package/node_modules/pi-subagents/src/runs/background/workflow-terminal-proof.js +0 -90
  936. package/node_modules/pi-subagents/src/runs/background/workflow-terminal-proof.js.map +0 -1
  937. package/node_modules/pi-subagents/src/runs/foreground/async-dismiss-action.d.ts +0 -7
  938. package/node_modules/pi-subagents/src/runs/foreground/async-dismiss-action.d.ts.map +0 -1
  939. package/node_modules/pi-subagents/src/runs/foreground/async-dismiss-action.js +0 -82
  940. package/node_modules/pi-subagents/src/runs/foreground/async-dismiss-action.js.map +0 -1
  941. package/node_modules/pi-subagents/src/runs/foreground/async-steering-action.d.ts +0 -32
  942. package/node_modules/pi-subagents/src/runs/foreground/async-steering-action.d.ts.map +0 -1
  943. package/node_modules/pi-subagents/src/runs/foreground/async-steering-action.js +0 -270
  944. package/node_modules/pi-subagents/src/runs/foreground/async-steering-action.js.map +0 -1
  945. package/node_modules/pi-subagents/src/runs/foreground/async-stop-action.d.ts +0 -13
  946. package/node_modules/pi-subagents/src/runs/foreground/async-stop-action.d.ts.map +0 -1
  947. package/node_modules/pi-subagents/src/runs/foreground/async-stop-action.js +0 -210
  948. package/node_modules/pi-subagents/src/runs/foreground/async-stop-action.js.map +0 -1
  949. package/node_modules/pi-subagents/src/runs/foreground/command-action.d.ts +0 -13
  950. package/node_modules/pi-subagents/src/runs/foreground/command-action.d.ts.map +0 -1
  951. package/node_modules/pi-subagents/src/runs/foreground/command-action.js +0 -38
  952. package/node_modules/pi-subagents/src/runs/foreground/command-action.js.map +0 -1
  953. package/node_modules/pi-subagents/src/runs/foreground/execution.d.ts +0 -11
  954. package/node_modules/pi-subagents/src/runs/foreground/execution.d.ts.map +0 -1
  955. package/node_modules/pi-subagents/src/runs/foreground/execution.js +0 -2181
  956. package/node_modules/pi-subagents/src/runs/foreground/execution.js.map +0 -1
  957. package/node_modules/pi-subagents/src/runs/foreground/foreground-control.d.ts +0 -25
  958. package/node_modules/pi-subagents/src/runs/foreground/foreground-control.d.ts.map +0 -1
  959. package/node_modules/pi-subagents/src/runs/foreground/foreground-control.js +0 -139
  960. package/node_modules/pi-subagents/src/runs/foreground/foreground-control.js.map +0 -1
  961. package/node_modules/pi-subagents/src/runs/foreground/foreground-history.d.ts +0 -12
  962. package/node_modules/pi-subagents/src/runs/foreground/foreground-history.d.ts.map +0 -1
  963. package/node_modules/pi-subagents/src/runs/foreground/foreground-history.js +0 -166
  964. package/node_modules/pi-subagents/src/runs/foreground/foreground-history.js.map +0 -1
  965. package/node_modules/pi-subagents/src/runs/foreground/prompt-audit.d.ts +0 -33
  966. package/node_modules/pi-subagents/src/runs/foreground/prompt-audit.d.ts.map +0 -1
  967. package/node_modules/pi-subagents/src/runs/foreground/prompt-audit.js +0 -139
  968. package/node_modules/pi-subagents/src/runs/foreground/prompt-audit.js.map +0 -1
  969. package/node_modules/pi-subagents/src/runs/foreground/subagent-executor.d.ts +0 -303
  970. package/node_modules/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +0 -1
  971. package/node_modules/pi-subagents/src/runs/foreground/subagent-executor.js +0 -7629
  972. package/node_modules/pi-subagents/src/runs/foreground/subagent-executor.js.map +0 -1
  973. package/node_modules/pi-subagents/src/runs/foreground/workflow-detach-reconcile.d.ts +0 -16
  974. package/node_modules/pi-subagents/src/runs/foreground/workflow-detach-reconcile.d.ts.map +0 -1
  975. package/node_modules/pi-subagents/src/runs/foreground/workflow-detach-reconcile.js +0 -284
  976. package/node_modules/pi-subagents/src/runs/foreground/workflow-detach-reconcile.js.map +0 -1
  977. package/node_modules/pi-subagents/src/runs/foreground/workflow-foreground-steering.d.ts +0 -44
  978. package/node_modules/pi-subagents/src/runs/foreground/workflow-foreground-steering.d.ts.map +0 -1
  979. package/node_modules/pi-subagents/src/runs/foreground/workflow-foreground-steering.js +0 -149
  980. package/node_modules/pi-subagents/src/runs/foreground/workflow-foreground-steering.js.map +0 -1
  981. package/node_modules/pi-subagents/src/runs/shared/abort-recovery.d.ts +0 -27
  982. package/node_modules/pi-subagents/src/runs/shared/abort-recovery.d.ts.map +0 -1
  983. package/node_modules/pi-subagents/src/runs/shared/abort-recovery.js +0 -109
  984. package/node_modules/pi-subagents/src/runs/shared/abort-recovery.js.map +0 -1
  985. package/node_modules/pi-subagents/src/runs/shared/acceptance.d.ts +0 -145
  986. package/node_modules/pi-subagents/src/runs/shared/acceptance.d.ts.map +0 -1
  987. package/node_modules/pi-subagents/src/runs/shared/acceptance.js +0 -1617
  988. package/node_modules/pi-subagents/src/runs/shared/acceptance.js.map +0 -1
  989. package/node_modules/pi-subagents/src/runs/shared/agent-contract.d.ts +0 -6
  990. package/node_modules/pi-subagents/src/runs/shared/agent-contract.d.ts.map +0 -1
  991. package/node_modules/pi-subagents/src/runs/shared/agent-contract.js +0 -36
  992. package/node_modules/pi-subagents/src/runs/shared/agent-contract.js.map +0 -1
  993. package/node_modules/pi-subagents/src/runs/shared/async-status-projection.d.ts +0 -97
  994. package/node_modules/pi-subagents/src/runs/shared/async-status-projection.d.ts.map +0 -1
  995. package/node_modules/pi-subagents/src/runs/shared/async-status-projection.js +0 -545
  996. package/node_modules/pi-subagents/src/runs/shared/async-status-projection.js.map +0 -1
  997. package/node_modules/pi-subagents/src/runs/shared/background-process-options.d.ts +0 -5
  998. package/node_modules/pi-subagents/src/runs/shared/background-process-options.d.ts.map +0 -1
  999. package/node_modules/pi-subagents/src/runs/shared/background-process-options.js +0 -7
  1000. package/node_modules/pi-subagents/src/runs/shared/background-process-options.js.map +0 -1
  1001. package/node_modules/pi-subagents/src/runs/shared/capability-ceiling.d.ts +0 -58
  1002. package/node_modules/pi-subagents/src/runs/shared/capability-ceiling.d.ts.map +0 -1
  1003. package/node_modules/pi-subagents/src/runs/shared/capability-ceiling.js +0 -179
  1004. package/node_modules/pi-subagents/src/runs/shared/capability-ceiling.js.map +0 -1
  1005. package/node_modules/pi-subagents/src/runs/shared/chain-outputs.d.ts +0 -19
  1006. package/node_modules/pi-subagents/src/runs/shared/chain-outputs.d.ts.map +0 -1
  1007. package/node_modules/pi-subagents/src/runs/shared/chain-outputs.js +0 -105
  1008. package/node_modules/pi-subagents/src/runs/shared/chain-outputs.js.map +0 -1
  1009. package/node_modules/pi-subagents/src/runs/shared/child-commands.d.ts +0 -28
  1010. package/node_modules/pi-subagents/src/runs/shared/child-commands.d.ts.map +0 -1
  1011. package/node_modules/pi-subagents/src/runs/shared/child-commands.js +0 -250
  1012. package/node_modules/pi-subagents/src/runs/shared/child-commands.js.map +0 -1
  1013. package/node_modules/pi-subagents/src/runs/shared/child-hooks.d.ts +0 -32
  1014. package/node_modules/pi-subagents/src/runs/shared/child-hooks.d.ts.map +0 -1
  1015. package/node_modules/pi-subagents/src/runs/shared/child-hooks.js +0 -174
  1016. package/node_modules/pi-subagents/src/runs/shared/child-hooks.js.map +0 -1
  1017. package/node_modules/pi-subagents/src/runs/shared/child-identity.d.ts +0 -24
  1018. package/node_modules/pi-subagents/src/runs/shared/child-identity.d.ts.map +0 -1
  1019. package/node_modules/pi-subagents/src/runs/shared/child-identity.js +0 -41
  1020. package/node_modules/pi-subagents/src/runs/shared/child-identity.js.map +0 -1
  1021. package/node_modules/pi-subagents/src/runs/shared/child-launch-plan.d.ts +0 -71
  1022. package/node_modules/pi-subagents/src/runs/shared/child-launch-plan.d.ts.map +0 -1
  1023. package/node_modules/pi-subagents/src/runs/shared/child-launch-plan.js +0 -89
  1024. package/node_modules/pi-subagents/src/runs/shared/child-launch-plan.js.map +0 -1
  1025. package/node_modules/pi-subagents/src/runs/shared/child-launch.d.ts +0 -118
  1026. package/node_modules/pi-subagents/src/runs/shared/child-launch.d.ts.map +0 -1
  1027. package/node_modules/pi-subagents/src/runs/shared/child-launch.js +0 -248
  1028. package/node_modules/pi-subagents/src/runs/shared/child-launch.js.map +0 -1
  1029. package/node_modules/pi-subagents/src/runs/shared/child-lifecycle.d.ts +0 -14
  1030. package/node_modules/pi-subagents/src/runs/shared/child-lifecycle.d.ts.map +0 -1
  1031. package/node_modules/pi-subagents/src/runs/shared/child-lifecycle.js +0 -23
  1032. package/node_modules/pi-subagents/src/runs/shared/child-lifecycle.js.map +0 -1
  1033. package/node_modules/pi-subagents/src/runs/shared/child-runtime-config.d.ts +0 -106
  1034. package/node_modules/pi-subagents/src/runs/shared/child-runtime-config.d.ts.map +0 -1
  1035. package/node_modules/pi-subagents/src/runs/shared/child-runtime-config.js +0 -39
  1036. package/node_modules/pi-subagents/src/runs/shared/child-runtime-config.js.map +0 -1
  1037. package/node_modules/pi-subagents/src/runs/shared/child-session.d.ts +0 -172
  1038. package/node_modules/pi-subagents/src/runs/shared/child-session.d.ts.map +0 -1
  1039. package/node_modules/pi-subagents/src/runs/shared/child-session.js +0 -589
  1040. package/node_modules/pi-subagents/src/runs/shared/child-session.js.map +0 -1
  1041. package/node_modules/pi-subagents/src/runs/shared/child-tool-plan.d.ts +0 -77
  1042. package/node_modules/pi-subagents/src/runs/shared/child-tool-plan.d.ts.map +0 -1
  1043. package/node_modules/pi-subagents/src/runs/shared/child-tool-plan.js +0 -386
  1044. package/node_modules/pi-subagents/src/runs/shared/child-tool-plan.js.map +0 -1
  1045. package/node_modules/pi-subagents/src/runs/shared/claude-code-adapter.d.ts +0 -81
  1046. package/node_modules/pi-subagents/src/runs/shared/claude-code-adapter.d.ts.map +0 -1
  1047. package/node_modules/pi-subagents/src/runs/shared/claude-code-adapter.js +0 -256
  1048. package/node_modules/pi-subagents/src/runs/shared/claude-code-adapter.js.map +0 -1
  1049. package/node_modules/pi-subagents/src/runs/shared/codex-exec-adapter.d.ts +0 -26
  1050. package/node_modules/pi-subagents/src/runs/shared/codex-exec-adapter.d.ts.map +0 -1
  1051. package/node_modules/pi-subagents/src/runs/shared/codex-exec-adapter.js +0 -128
  1052. package/node_modules/pi-subagents/src/runs/shared/codex-exec-adapter.js.map +0 -1
  1053. package/node_modules/pi-subagents/src/runs/shared/context-mode.d.ts +0 -13
  1054. package/node_modules/pi-subagents/src/runs/shared/context-mode.d.ts.map +0 -1
  1055. package/node_modules/pi-subagents/src/runs/shared/context-mode.js +0 -39
  1056. package/node_modules/pi-subagents/src/runs/shared/context-mode.js.map +0 -1
  1057. package/node_modules/pi-subagents/src/runs/shared/cursor-agent-adapter.d.ts +0 -27
  1058. package/node_modules/pi-subagents/src/runs/shared/cursor-agent-adapter.d.ts.map +0 -1
  1059. package/node_modules/pi-subagents/src/runs/shared/cursor-agent-adapter.js +0 -100
  1060. package/node_modules/pi-subagents/src/runs/shared/cursor-agent-adapter.js.map +0 -1
  1061. package/node_modules/pi-subagents/src/runs/shared/dynamic-fanout.d.ts +0 -50
  1062. package/node_modules/pi-subagents/src/runs/shared/dynamic-fanout.d.ts.map +0 -1
  1063. package/node_modules/pi-subagents/src/runs/shared/dynamic-fanout.js +0 -274
  1064. package/node_modules/pi-subagents/src/runs/shared/dynamic-fanout.js.map +0 -1
  1065. package/node_modules/pi-subagents/src/runs/shared/effective-system-prompt.d.ts +0 -18
  1066. package/node_modules/pi-subagents/src/runs/shared/effective-system-prompt.d.ts.map +0 -1
  1067. package/node_modules/pi-subagents/src/runs/shared/effective-system-prompt.js +0 -24
  1068. package/node_modules/pi-subagents/src/runs/shared/effective-system-prompt.js.map +0 -1
  1069. package/node_modules/pi-subagents/src/runs/shared/extension-bindings.d.ts +0 -17
  1070. package/node_modules/pi-subagents/src/runs/shared/extension-bindings.d.ts.map +0 -1
  1071. package/node_modules/pi-subagents/src/runs/shared/extension-bindings.js +0 -83
  1072. package/node_modules/pi-subagents/src/runs/shared/extension-bindings.js.map +0 -1
  1073. package/node_modules/pi-subagents/src/runs/shared/external-cli-contract.d.ts +0 -30
  1074. package/node_modules/pi-subagents/src/runs/shared/external-cli-contract.d.ts.map +0 -1
  1075. package/node_modules/pi-subagents/src/runs/shared/external-cli-contract.js +0 -146
  1076. package/node_modules/pi-subagents/src/runs/shared/external-cli-contract.js.map +0 -1
  1077. package/node_modules/pi-subagents/src/runs/shared/external-cli-preflight.d.ts +0 -42
  1078. package/node_modules/pi-subagents/src/runs/shared/external-cli-preflight.d.ts.map +0 -1
  1079. package/node_modules/pi-subagents/src/runs/shared/external-cli-preflight.js +0 -160
  1080. package/node_modules/pi-subagents/src/runs/shared/external-cli-preflight.js.map +0 -1
  1081. package/node_modules/pi-subagents/src/runs/shared/external-cli-runner.d.ts +0 -66
  1082. package/node_modules/pi-subagents/src/runs/shared/external-cli-runner.d.ts.map +0 -1
  1083. package/node_modules/pi-subagents/src/runs/shared/external-cli-runner.js +0 -426
  1084. package/node_modules/pi-subagents/src/runs/shared/external-cli-runner.js.map +0 -1
  1085. package/node_modules/pi-subagents/src/runs/shared/external-job-bridge.d.ts +0 -25
  1086. package/node_modules/pi-subagents/src/runs/shared/external-job-bridge.d.ts.map +0 -1
  1087. package/node_modules/pi-subagents/src/runs/shared/external-job-bridge.js +0 -487
  1088. package/node_modules/pi-subagents/src/runs/shared/external-job-bridge.js.map +0 -1
  1089. package/node_modules/pi-subagents/src/runs/shared/external-job-runner.d.ts +0 -45
  1090. package/node_modules/pi-subagents/src/runs/shared/external-job-runner.d.ts.map +0 -1
  1091. package/node_modules/pi-subagents/src/runs/shared/external-job-runner.js +0 -353
  1092. package/node_modules/pi-subagents/src/runs/shared/external-job-runner.js.map +0 -1
  1093. package/node_modules/pi-subagents/src/runs/shared/fast-mode-extension.d.ts +0 -4
  1094. package/node_modules/pi-subagents/src/runs/shared/fast-mode-extension.d.ts.map +0 -1
  1095. package/node_modules/pi-subagents/src/runs/shared/fast-mode-extension.js +0 -9
  1096. package/node_modules/pi-subagents/src/runs/shared/fast-mode-extension.js.map +0 -1
  1097. package/node_modules/pi-subagents/src/runs/shared/git-environment.d.ts +0 -3
  1098. package/node_modules/pi-subagents/src/runs/shared/git-environment.d.ts.map +0 -1
  1099. package/node_modules/pi-subagents/src/runs/shared/git-environment.js +0 -28
  1100. package/node_modules/pi-subagents/src/runs/shared/git-environment.js.map +0 -1
  1101. package/node_modules/pi-subagents/src/runs/shared/herdr-connection.d.ts +0 -71
  1102. package/node_modules/pi-subagents/src/runs/shared/herdr-connection.d.ts.map +0 -1
  1103. package/node_modules/pi-subagents/src/runs/shared/herdr-connection.js +0 -258
  1104. package/node_modules/pi-subagents/src/runs/shared/herdr-connection.js.map +0 -1
  1105. package/node_modules/pi-subagents/src/runs/shared/herdr-external-adapters.d.ts +0 -148
  1106. package/node_modules/pi-subagents/src/runs/shared/herdr-external-adapters.d.ts.map +0 -1
  1107. package/node_modules/pi-subagents/src/runs/shared/herdr-external-adapters.js +0 -405
  1108. package/node_modules/pi-subagents/src/runs/shared/herdr-external-adapters.js.map +0 -1
  1109. package/node_modules/pi-subagents/src/runs/shared/herdr-machine.d.ts +0 -48
  1110. package/node_modules/pi-subagents/src/runs/shared/herdr-machine.d.ts.map +0 -1
  1111. package/node_modules/pi-subagents/src/runs/shared/herdr-machine.js +0 -247
  1112. package/node_modules/pi-subagents/src/runs/shared/herdr-machine.js.map +0 -1
  1113. package/node_modules/pi-subagents/src/runs/shared/herdr-pi-protocol.d.ts +0 -22
  1114. package/node_modules/pi-subagents/src/runs/shared/herdr-pi-protocol.d.ts.map +0 -1
  1115. package/node_modules/pi-subagents/src/runs/shared/herdr-pi-protocol.js +0 -58
  1116. package/node_modules/pi-subagents/src/runs/shared/herdr-pi-protocol.js.map +0 -1
  1117. package/node_modules/pi-subagents/src/runs/shared/herdr-placed-run.d.ts +0 -268
  1118. package/node_modules/pi-subagents/src/runs/shared/herdr-placed-run.d.ts.map +0 -1
  1119. package/node_modules/pi-subagents/src/runs/shared/herdr-placed-run.js +0 -720
  1120. package/node_modules/pi-subagents/src/runs/shared/herdr-placed-run.js.map +0 -1
  1121. package/node_modules/pi-subagents/src/runs/shared/host-step-status.d.ts +0 -34
  1122. package/node_modules/pi-subagents/src/runs/shared/host-step-status.d.ts.map +0 -1
  1123. package/node_modules/pi-subagents/src/runs/shared/host-step-status.js +0 -245
  1124. package/node_modules/pi-subagents/src/runs/shared/host-step-status.js.map +0 -1
  1125. package/node_modules/pi-subagents/src/runs/shared/lane-metadata.d.ts +0 -24
  1126. package/node_modules/pi-subagents/src/runs/shared/lane-metadata.d.ts.map +0 -1
  1127. package/node_modules/pi-subagents/src/runs/shared/lane-metadata.js +0 -127
  1128. package/node_modules/pi-subagents/src/runs/shared/lane-metadata.js.map +0 -1
  1129. package/node_modules/pi-subagents/src/runs/shared/launch-cwd.d.ts +0 -2
  1130. package/node_modules/pi-subagents/src/runs/shared/launch-cwd.d.ts.map +0 -1
  1131. package/node_modules/pi-subagents/src/runs/shared/launch-cwd.js +0 -17
  1132. package/node_modules/pi-subagents/src/runs/shared/launch-cwd.js.map +0 -1
  1133. package/node_modules/pi-subagents/src/runs/shared/long-running-guard.d.ts +0 -33
  1134. package/node_modules/pi-subagents/src/runs/shared/long-running-guard.d.ts.map +0 -1
  1135. package/node_modules/pi-subagents/src/runs/shared/long-running-guard.js +0 -199
  1136. package/node_modules/pi-subagents/src/runs/shared/long-running-guard.js.map +0 -1
  1137. package/node_modules/pi-subagents/src/runs/shared/mcp-config-sources.d.ts +0 -34
  1138. package/node_modules/pi-subagents/src/runs/shared/mcp-config-sources.d.ts.map +0 -1
  1139. package/node_modules/pi-subagents/src/runs/shared/mcp-config-sources.js +0 -419
  1140. package/node_modules/pi-subagents/src/runs/shared/mcp-config-sources.js.map +0 -1
  1141. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.d.ts +0 -87
  1142. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.d.ts.map +0 -1
  1143. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.js +0 -478
  1144. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.js.map +0 -1
  1145. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-grant.d.ts +0 -43
  1146. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-grant.d.ts.map +0 -1
  1147. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-grant.js +0 -160
  1148. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-grant.js.map +0 -1
  1149. package/node_modules/pi-subagents/src/runs/shared/model-resolution-diagnostic.d.ts +0 -34
  1150. package/node_modules/pi-subagents/src/runs/shared/model-resolution-diagnostic.d.ts.map +0 -1
  1151. package/node_modules/pi-subagents/src/runs/shared/model-resolution-diagnostic.js +0 -92
  1152. package/node_modules/pi-subagents/src/runs/shared/model-resolution-diagnostic.js.map +0 -1
  1153. package/node_modules/pi-subagents/src/runs/shared/model-resolution.d.ts +0 -106
  1154. package/node_modules/pi-subagents/src/runs/shared/model-resolution.d.ts.map +0 -1
  1155. package/node_modules/pi-subagents/src/runs/shared/model-resolution.js +0 -405
  1156. package/node_modules/pi-subagents/src/runs/shared/model-resolution.js.map +0 -1
  1157. package/node_modules/pi-subagents/src/runs/shared/model-scope.d.ts +0 -69
  1158. package/node_modules/pi-subagents/src/runs/shared/model-scope.d.ts.map +0 -1
  1159. package/node_modules/pi-subagents/src/runs/shared/model-scope.js +0 -172
  1160. package/node_modules/pi-subagents/src/runs/shared/model-scope.js.map +0 -1
  1161. package/node_modules/pi-subagents/src/runs/shared/mutation-evidence.d.ts +0 -19
  1162. package/node_modules/pi-subagents/src/runs/shared/mutation-evidence.d.ts.map +0 -1
  1163. package/node_modules/pi-subagents/src/runs/shared/mutation-evidence.js +0 -199
  1164. package/node_modules/pi-subagents/src/runs/shared/mutation-evidence.js.map +0 -1
  1165. package/node_modules/pi-subagents/src/runs/shared/nested-events.d.ts +0 -136
  1166. package/node_modules/pi-subagents/src/runs/shared/nested-events.d.ts.map +0 -1
  1167. package/node_modules/pi-subagents/src/runs/shared/nested-events.js +0 -1060
  1168. package/node_modules/pi-subagents/src/runs/shared/nested-events.js.map +0 -1
  1169. package/node_modules/pi-subagents/src/runs/shared/nested-path.d.ts +0 -9
  1170. package/node_modules/pi-subagents/src/runs/shared/nested-path.d.ts.map +0 -1
  1171. package/node_modules/pi-subagents/src/runs/shared/nested-path.js +0 -35
  1172. package/node_modules/pi-subagents/src/runs/shared/nested-path.js.map +0 -1
  1173. package/node_modules/pi-subagents/src/runs/shared/nested-render.d.ts +0 -21
  1174. package/node_modules/pi-subagents/src/runs/shared/nested-render.d.ts.map +0 -1
  1175. package/node_modules/pi-subagents/src/runs/shared/nested-render.js +0 -116
  1176. package/node_modules/pi-subagents/src/runs/shared/nested-render.js.map +0 -1
  1177. package/node_modules/pi-subagents/src/runs/shared/orca-progress-tabs.d.ts +0 -33
  1178. package/node_modules/pi-subagents/src/runs/shared/orca-progress-tabs.d.ts.map +0 -1
  1179. package/node_modules/pi-subagents/src/runs/shared/orca-progress-tabs.js +0 -527
  1180. package/node_modules/pi-subagents/src/runs/shared/orca-progress-tabs.js.map +0 -1
  1181. package/node_modules/pi-subagents/src/runs/shared/parallel-handoff.d.ts +0 -79
  1182. package/node_modules/pi-subagents/src/runs/shared/parallel-handoff.d.ts.map +0 -1
  1183. package/node_modules/pi-subagents/src/runs/shared/parallel-handoff.js +0 -780
  1184. package/node_modules/pi-subagents/src/runs/shared/parallel-handoff.js.map +0 -1
  1185. package/node_modules/pi-subagents/src/runs/shared/parallel-utils.d.ts +0 -170
  1186. package/node_modules/pi-subagents/src/runs/shared/parallel-utils.d.ts.map +0 -1
  1187. package/node_modules/pi-subagents/src/runs/shared/parallel-utils.js +0 -126
  1188. package/node_modules/pi-subagents/src/runs/shared/parallel-utils.js.map +0 -1
  1189. package/node_modules/pi-subagents/src/runs/shared/partial-output.d.ts +0 -25
  1190. package/node_modules/pi-subagents/src/runs/shared/partial-output.d.ts.map +0 -1
  1191. package/node_modules/pi-subagents/src/runs/shared/partial-output.js +0 -36
  1192. package/node_modules/pi-subagents/src/runs/shared/partial-output.js.map +0 -1
  1193. package/node_modules/pi-subagents/src/runs/shared/permissions.d.ts +0 -13
  1194. package/node_modules/pi-subagents/src/runs/shared/permissions.d.ts.map +0 -1
  1195. package/node_modules/pi-subagents/src/runs/shared/permissions.js +0 -93
  1196. package/node_modules/pi-subagents/src/runs/shared/permissions.js.map +0 -1
  1197. package/node_modules/pi-subagents/src/runs/shared/pi-spawn.d.ts +0 -28
  1198. package/node_modules/pi-subagents/src/runs/shared/pi-spawn.d.ts.map +0 -1
  1199. package/node_modules/pi-subagents/src/runs/shared/pi-spawn.js +0 -156
  1200. package/node_modules/pi-subagents/src/runs/shared/pi-spawn.js.map +0 -1
  1201. package/node_modules/pi-subagents/src/runs/shared/process-signal.d.ts +0 -16
  1202. package/node_modules/pi-subagents/src/runs/shared/process-signal.d.ts.map +0 -1
  1203. package/node_modules/pi-subagents/src/runs/shared/process-signal.js +0 -22
  1204. package/node_modules/pi-subagents/src/runs/shared/process-signal.js.map +0 -1
  1205. package/node_modules/pi-subagents/src/runs/shared/readonly-drain-observation.d.ts +0 -26
  1206. package/node_modules/pi-subagents/src/runs/shared/readonly-drain-observation.d.ts.map +0 -1
  1207. package/node_modules/pi-subagents/src/runs/shared/readonly-drain-observation.js +0 -51
  1208. package/node_modules/pi-subagents/src/runs/shared/readonly-drain-observation.js.map +0 -1
  1209. package/node_modules/pi-subagents/src/runs/shared/run-fanout-budget.d.ts +0 -15
  1210. package/node_modules/pi-subagents/src/runs/shared/run-fanout-budget.d.ts.map +0 -1
  1211. package/node_modules/pi-subagents/src/runs/shared/run-fanout-budget.js +0 -259
  1212. package/node_modules/pi-subagents/src/runs/shared/run-fanout-budget.js.map +0 -1
  1213. package/node_modules/pi-subagents/src/runs/shared/runner-launcher.d.ts +0 -12
  1214. package/node_modules/pi-subagents/src/runs/shared/runner-launcher.d.ts.map +0 -1
  1215. package/node_modules/pi-subagents/src/runs/shared/runner-launcher.js +0 -25
  1216. package/node_modules/pi-subagents/src/runs/shared/runner-launcher.js.map +0 -1
  1217. package/node_modules/pi-subagents/src/runs/shared/runtime-acknowledged-extensions.d.ts +0 -8
  1218. package/node_modules/pi-subagents/src/runs/shared/runtime-acknowledged-extensions.d.ts.map +0 -1
  1219. package/node_modules/pi-subagents/src/runs/shared/runtime-acknowledged-extensions.js +0 -45
  1220. package/node_modules/pi-subagents/src/runs/shared/runtime-acknowledged-extensions.js.map +0 -1
  1221. package/node_modules/pi-subagents/src/runs/shared/session-lease.d.ts +0 -70
  1222. package/node_modules/pi-subagents/src/runs/shared/session-lease.d.ts.map +0 -1
  1223. package/node_modules/pi-subagents/src/runs/shared/session-lease.js +0 -251
  1224. package/node_modules/pi-subagents/src/runs/shared/session-lease.js.map +0 -1
  1225. package/node_modules/pi-subagents/src/runs/shared/single-output.d.ts +0 -91
  1226. package/node_modules/pi-subagents/src/runs/shared/single-output.d.ts.map +0 -1
  1227. package/node_modules/pi-subagents/src/runs/shared/single-output.js +0 -350
  1228. package/node_modules/pi-subagents/src/runs/shared/single-output.js.map +0 -1
  1229. package/node_modules/pi-subagents/src/runs/shared/spawn-budget.d.ts +0 -21
  1230. package/node_modules/pi-subagents/src/runs/shared/spawn-budget.d.ts.map +0 -1
  1231. package/node_modules/pi-subagents/src/runs/shared/spawn-budget.js +0 -94
  1232. package/node_modules/pi-subagents/src/runs/shared/spawn-budget.js.map +0 -1
  1233. package/node_modules/pi-subagents/src/runs/shared/structured-output.d.ts +0 -66
  1234. package/node_modules/pi-subagents/src/runs/shared/structured-output.d.ts.map +0 -1
  1235. package/node_modules/pi-subagents/src/runs/shared/structured-output.js +0 -483
  1236. package/node_modules/pi-subagents/src/runs/shared/structured-output.js.map +0 -1
  1237. package/node_modules/pi-subagents/src/runs/shared/subagent-control.d.ts +0 -50
  1238. package/node_modules/pi-subagents/src/runs/shared/subagent-control.d.ts.map +0 -1
  1239. package/node_modules/pi-subagents/src/runs/shared/subagent-control.js +0 -247
  1240. package/node_modules/pi-subagents/src/runs/shared/subagent-control.js.map +0 -1
  1241. package/node_modules/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts +0 -64
  1242. package/node_modules/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts.map +0 -1
  1243. package/node_modules/pi-subagents/src/runs/shared/subagent-prompt-runtime.js +0 -681
  1244. package/node_modules/pi-subagents/src/runs/shared/subagent-prompt-runtime.js.map +0 -1
  1245. package/node_modules/pi-subagents/src/runs/shared/tool-availability.d.ts +0 -17
  1246. package/node_modules/pi-subagents/src/runs/shared/tool-availability.d.ts.map +0 -1
  1247. package/node_modules/pi-subagents/src/runs/shared/tool-availability.js +0 -30
  1248. package/node_modules/pi-subagents/src/runs/shared/tool-availability.js.map +0 -1
  1249. package/node_modules/pi-subagents/src/runs/shared/tool-budget.d.ts +0 -22
  1250. package/node_modules/pi-subagents/src/runs/shared/tool-budget.d.ts.map +0 -1
  1251. package/node_modules/pi-subagents/src/runs/shared/tool-budget.js +0 -79
  1252. package/node_modules/pi-subagents/src/runs/shared/tool-budget.js.map +0 -1
  1253. package/node_modules/pi-subagents/src/runs/shared/tool-timeout.d.ts +0 -32
  1254. package/node_modules/pi-subagents/src/runs/shared/tool-timeout.d.ts.map +0 -1
  1255. package/node_modules/pi-subagents/src/runs/shared/tool-timeout.js +0 -74
  1256. package/node_modules/pi-subagents/src/runs/shared/tool-timeout.js.map +0 -1
  1257. package/node_modules/pi-subagents/src/runs/shared/usage-budget.d.ts +0 -8
  1258. package/node_modules/pi-subagents/src/runs/shared/usage-budget.d.ts.map +0 -1
  1259. package/node_modules/pi-subagents/src/runs/shared/usage-budget.js +0 -75
  1260. package/node_modules/pi-subagents/src/runs/shared/usage-budget.js.map +0 -1
  1261. package/node_modules/pi-subagents/src/runs/shared/usage-reconciliation.d.ts +0 -9
  1262. package/node_modules/pi-subagents/src/runs/shared/usage-reconciliation.d.ts.map +0 -1
  1263. package/node_modules/pi-subagents/src/runs/shared/usage-reconciliation.js +0 -72
  1264. package/node_modules/pi-subagents/src/runs/shared/usage-reconciliation.js.map +0 -1
  1265. package/node_modules/pi-subagents/src/runs/shared/workflow-async-child-guidance.d.ts +0 -4
  1266. package/node_modules/pi-subagents/src/runs/shared/workflow-async-child-guidance.d.ts.map +0 -1
  1267. package/node_modules/pi-subagents/src/runs/shared/workflow-async-child-guidance.js +0 -18
  1268. package/node_modules/pi-subagents/src/runs/shared/workflow-async-child-guidance.js.map +0 -1
  1269. package/node_modules/pi-subagents/src/runs/shared/workflow-graph.d.ts +0 -32
  1270. package/node_modules/pi-subagents/src/runs/shared/workflow-graph.d.ts.map +0 -1
  1271. package/node_modules/pi-subagents/src/runs/shared/workflow-graph.js +0 -222
  1272. package/node_modules/pi-subagents/src/runs/shared/workflow-graph.js.map +0 -1
  1273. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-apply.d.ts +0 -37
  1274. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-apply.d.ts.map +0 -1
  1275. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-apply.js +0 -179
  1276. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-apply.js.map +0 -1
  1277. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-plan.d.ts +0 -85
  1278. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-plan.d.ts.map +0 -1
  1279. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-plan.js +0 -804
  1280. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-plan.js.map +0 -1
  1281. package/node_modules/pi-subagents/src/runs/shared/worktree-lock.d.ts +0 -6
  1282. package/node_modules/pi-subagents/src/runs/shared/worktree-lock.d.ts.map +0 -1
  1283. package/node_modules/pi-subagents/src/runs/shared/worktree-lock.js +0 -41
  1284. package/node_modules/pi-subagents/src/runs/shared/worktree-lock.js.map +0 -1
  1285. package/node_modules/pi-subagents/src/runs/shared/worktree-setup-command.d.ts +0 -39
  1286. package/node_modules/pi-subagents/src/runs/shared/worktree-setup-command.d.ts.map +0 -1
  1287. package/node_modules/pi-subagents/src/runs/shared/worktree-setup-command.js +0 -201
  1288. package/node_modules/pi-subagents/src/runs/shared/worktree-setup-command.js.map +0 -1
  1289. package/node_modules/pi-subagents/src/runs/shared/worktree.d.ts +0 -182
  1290. package/node_modules/pi-subagents/src/runs/shared/worktree.d.ts.map +0 -1
  1291. package/node_modules/pi-subagents/src/runs/shared/worktree.js +0 -1347
  1292. package/node_modules/pi-subagents/src/runs/shared/worktree.js.map +0 -1
  1293. package/node_modules/pi-subagents/src/shared/accessible-dir.d.ts +0 -12
  1294. package/node_modules/pi-subagents/src/shared/accessible-dir.d.ts.map +0 -1
  1295. package/node_modules/pi-subagents/src/shared/accessible-dir.js +0 -37
  1296. package/node_modules/pi-subagents/src/shared/accessible-dir.js.map +0 -1
  1297. package/node_modules/pi-subagents/src/shared/agent-stream-options.d.ts +0 -6
  1298. package/node_modules/pi-subagents/src/shared/agent-stream-options.d.ts.map +0 -1
  1299. package/node_modules/pi-subagents/src/shared/agent-stream-options.js +0 -4
  1300. package/node_modules/pi-subagents/src/shared/agent-stream-options.js.map +0 -1
  1301. package/node_modules/pi-subagents/src/shared/artifacts.d.ts +0 -23
  1302. package/node_modules/pi-subagents/src/shared/artifacts.d.ts.map +0 -1
  1303. package/node_modules/pi-subagents/src/shared/artifacts.js +0 -273
  1304. package/node_modules/pi-subagents/src/shared/artifacts.js.map +0 -1
  1305. package/node_modules/pi-subagents/src/shared/atomic-json.d.ts +0 -20
  1306. package/node_modules/pi-subagents/src/shared/atomic-json.d.ts.map +0 -1
  1307. package/node_modules/pi-subagents/src/shared/atomic-json.js +0 -62
  1308. package/node_modules/pi-subagents/src/shared/atomic-json.js.map +0 -1
  1309. package/node_modules/pi-subagents/src/shared/capacity-resilient-json.d.ts +0 -27
  1310. package/node_modules/pi-subagents/src/shared/capacity-resilient-json.d.ts.map +0 -1
  1311. package/node_modules/pi-subagents/src/shared/capacity-resilient-json.js +0 -87
  1312. package/node_modules/pi-subagents/src/shared/capacity-resilient-json.js.map +0 -1
  1313. package/node_modules/pi-subagents/src/shared/child-cache-retention.d.ts +0 -30
  1314. package/node_modules/pi-subagents/src/shared/child-cache-retention.d.ts.map +0 -1
  1315. package/node_modules/pi-subagents/src/shared/child-cache-retention.js +0 -41
  1316. package/node_modules/pi-subagents/src/shared/child-cache-retention.js.map +0 -1
  1317. package/node_modules/pi-subagents/src/shared/child-session-name.d.ts +0 -9
  1318. package/node_modules/pi-subagents/src/shared/child-session-name.d.ts.map +0 -1
  1319. package/node_modules/pi-subagents/src/shared/child-session-name.js +0 -41
  1320. package/node_modules/pi-subagents/src/shared/child-session-name.js.map +0 -1
  1321. package/node_modules/pi-subagents/src/shared/child-transcript.d.ts +0 -38
  1322. package/node_modules/pi-subagents/src/shared/child-transcript.d.ts.map +0 -1
  1323. package/node_modules/pi-subagents/src/shared/child-transcript.js +0 -226
  1324. package/node_modules/pi-subagents/src/shared/child-transcript.js.map +0 -1
  1325. package/node_modules/pi-subagents/src/shared/completion-owner.d.ts +0 -3
  1326. package/node_modules/pi-subagents/src/shared/completion-owner.d.ts.map +0 -1
  1327. package/node_modules/pi-subagents/src/shared/completion-owner.js +0 -9
  1328. package/node_modules/pi-subagents/src/shared/completion-owner.js.map +0 -1
  1329. package/node_modules/pi-subagents/src/shared/disabled-features.d.ts +0 -92
  1330. package/node_modules/pi-subagents/src/shared/disabled-features.d.ts.map +0 -1
  1331. package/node_modules/pi-subagents/src/shared/disabled-features.js +0 -113
  1332. package/node_modules/pi-subagents/src/shared/disabled-features.js.map +0 -1
  1333. package/node_modules/pi-subagents/src/shared/display-text.d.ts +0 -6
  1334. package/node_modules/pi-subagents/src/shared/display-text.d.ts.map +0 -1
  1335. package/node_modules/pi-subagents/src/shared/display-text.js +0 -155
  1336. package/node_modules/pi-subagents/src/shared/display-text.js.map +0 -1
  1337. package/node_modules/pi-subagents/src/shared/edit-distance.d.ts +0 -5
  1338. package/node_modules/pi-subagents/src/shared/edit-distance.d.ts.map +0 -1
  1339. package/node_modules/pi-subagents/src/shared/edit-distance.js +0 -33
  1340. package/node_modules/pi-subagents/src/shared/edit-distance.js.map +0 -1
  1341. package/node_modules/pi-subagents/src/shared/extension-context.d.ts +0 -22
  1342. package/node_modules/pi-subagents/src/shared/extension-context.d.ts.map +0 -1
  1343. package/node_modules/pi-subagents/src/shared/extension-context.js +0 -40
  1344. package/node_modules/pi-subagents/src/shared/extension-context.js.map +0 -1
  1345. package/node_modules/pi-subagents/src/shared/file-coalescer.d.ts +0 -12
  1346. package/node_modules/pi-subagents/src/shared/file-coalescer.d.ts.map +0 -1
  1347. package/node_modules/pi-subagents/src/shared/file-coalescer.js +0 -35
  1348. package/node_modules/pi-subagents/src/shared/file-coalescer.js.map +0 -1
  1349. package/node_modules/pi-subagents/src/shared/file-lease.d.ts +0 -5
  1350. package/node_modules/pi-subagents/src/shared/file-lease.d.ts.map +0 -1
  1351. package/node_modules/pi-subagents/src/shared/file-lease.js +0 -101
  1352. package/node_modules/pi-subagents/src/shared/file-lease.js.map +0 -1
  1353. package/node_modules/pi-subagents/src/shared/file-system-retry.d.ts +0 -32
  1354. package/node_modules/pi-subagents/src/shared/file-system-retry.d.ts.map +0 -1
  1355. package/node_modules/pi-subagents/src/shared/file-system-retry.js +0 -85
  1356. package/node_modules/pi-subagents/src/shared/file-system-retry.js.map +0 -1
  1357. package/node_modules/pi-subagents/src/shared/fork-context.d.ts +0 -63
  1358. package/node_modules/pi-subagents/src/shared/fork-context.d.ts.map +0 -1
  1359. package/node_modules/pi-subagents/src/shared/fork-context.js +0 -176
  1360. package/node_modules/pi-subagents/src/shared/fork-context.js.map +0 -1
  1361. package/node_modules/pi-subagents/src/shared/fork-session-cwd.d.ts +0 -3
  1362. package/node_modules/pi-subagents/src/shared/fork-session-cwd.d.ts.map +0 -1
  1363. package/node_modules/pi-subagents/src/shared/fork-session-cwd.js +0 -24
  1364. package/node_modules/pi-subagents/src/shared/fork-session-cwd.js.map +0 -1
  1365. package/node_modules/pi-subagents/src/shared/formatters.d.ts +0 -36
  1366. package/node_modules/pi-subagents/src/shared/formatters.d.ts.map +0 -1
  1367. package/node_modules/pi-subagents/src/shared/formatters.js +0 -138
  1368. package/node_modules/pi-subagents/src/shared/formatters.js.map +0 -1
  1369. package/node_modules/pi-subagents/src/shared/jsonl-writer.d.ts +0 -21
  1370. package/node_modules/pi-subagents/src/shared/jsonl-writer.d.ts.map +0 -1
  1371. package/node_modules/pi-subagents/src/shared/jsonl-writer.js +0 -68
  1372. package/node_modules/pi-subagents/src/shared/jsonl-writer.js.map +0 -1
  1373. package/node_modules/pi-subagents/src/shared/launch-contract.d.ts +0 -64
  1374. package/node_modules/pi-subagents/src/shared/launch-contract.d.ts.map +0 -1
  1375. package/node_modules/pi-subagents/src/shared/launch-contract.js +0 -140
  1376. package/node_modules/pi-subagents/src/shared/launch-contract.js.map +0 -1
  1377. package/node_modules/pi-subagents/src/shared/model-info.d.ts +0 -56
  1378. package/node_modules/pi-subagents/src/shared/model-info.d.ts.map +0 -1
  1379. package/node_modules/pi-subagents/src/shared/model-info.js +0 -104
  1380. package/node_modules/pi-subagents/src/shared/model-info.js.map +0 -1
  1381. package/node_modules/pi-subagents/src/shared/model-response-aliases.d.ts +0 -2
  1382. package/node_modules/pi-subagents/src/shared/model-response-aliases.d.ts.map +0 -1
  1383. package/node_modules/pi-subagents/src/shared/model-response-aliases.js +0 -16
  1384. package/node_modules/pi-subagents/src/shared/model-response-aliases.js.map +0 -1
  1385. package/node_modules/pi-subagents/src/shared/node-executable.d.ts +0 -2
  1386. package/node_modules/pi-subagents/src/shared/node-executable.d.ts.map +0 -1
  1387. package/node_modules/pi-subagents/src/shared/node-executable.js +0 -21
  1388. package/node_modules/pi-subagents/src/shared/node-executable.js.map +0 -1
  1389. package/node_modules/pi-subagents/src/shared/opencode-session-headers.d.ts +0 -13
  1390. package/node_modules/pi-subagents/src/shared/opencode-session-headers.d.ts.map +0 -1
  1391. package/node_modules/pi-subagents/src/shared/opencode-session-headers.js +0 -27
  1392. package/node_modules/pi-subagents/src/shared/opencode-session-headers.js.map +0 -1
  1393. package/node_modules/pi-subagents/src/shared/package-version.d.ts +0 -3
  1394. package/node_modules/pi-subagents/src/shared/package-version.d.ts.map +0 -1
  1395. package/node_modules/pi-subagents/src/shared/package-version.js +0 -15
  1396. package/node_modules/pi-subagents/src/shared/package-version.js.map +0 -1
  1397. package/node_modules/pi-subagents/src/shared/parent-wake.d.ts +0 -24
  1398. package/node_modules/pi-subagents/src/shared/parent-wake.d.ts.map +0 -1
  1399. package/node_modules/pi-subagents/src/shared/parent-wake.js +0 -71
  1400. package/node_modules/pi-subagents/src/shared/parent-wake.js.map +0 -1
  1401. package/node_modules/pi-subagents/src/shared/prompt-resources.d.ts +0 -6
  1402. package/node_modules/pi-subagents/src/shared/prompt-resources.d.ts.map +0 -1
  1403. package/node_modules/pi-subagents/src/shared/prompt-resources.js +0 -11
  1404. package/node_modules/pi-subagents/src/shared/prompt-resources.js.map +0 -1
  1405. package/node_modules/pi-subagents/src/shared/pruned-fork.d.ts +0 -35
  1406. package/node_modules/pi-subagents/src/shared/pruned-fork.d.ts.map +0 -1
  1407. package/node_modules/pi-subagents/src/shared/pruned-fork.js +0 -435
  1408. package/node_modules/pi-subagents/src/shared/pruned-fork.js.map +0 -1
  1409. package/node_modules/pi-subagents/src/shared/required-child-extensions.d.ts +0 -35
  1410. package/node_modules/pi-subagents/src/shared/required-child-extensions.d.ts.map +0 -1
  1411. package/node_modules/pi-subagents/src/shared/required-child-extensions.js +0 -106
  1412. package/node_modules/pi-subagents/src/shared/required-child-extensions.js.map +0 -1
  1413. package/node_modules/pi-subagents/src/shared/runtime-module-path.d.ts +0 -11
  1414. package/node_modules/pi-subagents/src/shared/runtime-module-path.d.ts.map +0 -1
  1415. package/node_modules/pi-subagents/src/shared/runtime-module-path.js +0 -17
  1416. package/node_modules/pi-subagents/src/shared/runtime-module-path.js.map +0 -1
  1417. package/node_modules/pi-subagents/src/shared/session-file-trust.d.ts +0 -2
  1418. package/node_modules/pi-subagents/src/shared/session-file-trust.d.ts.map +0 -1
  1419. package/node_modules/pi-subagents/src/shared/session-file-trust.js +0 -21
  1420. package/node_modules/pi-subagents/src/shared/session-file-trust.js.map +0 -1
  1421. package/node_modules/pi-subagents/src/shared/session-identity.d.ts +0 -7
  1422. package/node_modules/pi-subagents/src/shared/session-identity.d.ts.map +0 -1
  1423. package/node_modules/pi-subagents/src/shared/session-identity.js +0 -7
  1424. package/node_modules/pi-subagents/src/shared/session-identity.js.map +0 -1
  1425. package/node_modules/pi-subagents/src/shared/session-tokens.d.ts +0 -3
  1426. package/node_modules/pi-subagents/src/shared/session-tokens.d.ts.map +0 -1
  1427. package/node_modules/pi-subagents/src/shared/session-tokens.js +0 -59
  1428. package/node_modules/pi-subagents/src/shared/session-tokens.js.map +0 -1
  1429. package/node_modules/pi-subagents/src/shared/settings-file-lease.d.ts +0 -5
  1430. package/node_modules/pi-subagents/src/shared/settings-file-lease.d.ts.map +0 -1
  1431. package/node_modules/pi-subagents/src/shared/settings-file-lease.js +0 -39
  1432. package/node_modules/pi-subagents/src/shared/settings-file-lease.js.map +0 -1
  1433. package/node_modules/pi-subagents/src/shared/settings.d.ts +0 -147
  1434. package/node_modules/pi-subagents/src/shared/settings.d.ts.map +0 -1
  1435. package/node_modules/pi-subagents/src/shared/settings.js +0 -248
  1436. package/node_modules/pi-subagents/src/shared/settings.js.map +0 -1
  1437. package/node_modules/pi-subagents/src/shared/shortcuts.d.ts +0 -2
  1438. package/node_modules/pi-subagents/src/shared/shortcuts.d.ts.map +0 -1
  1439. package/node_modules/pi-subagents/src/shared/shortcuts.js +0 -18
  1440. package/node_modules/pi-subagents/src/shared/shortcuts.js.map +0 -1
  1441. package/node_modules/pi-subagents/src/shared/status-format.d.ts +0 -10
  1442. package/node_modules/pi-subagents/src/shared/status-format.d.ts.map +0 -1
  1443. package/node_modules/pi-subagents/src/shared/status-format.js +0 -61
  1444. package/node_modules/pi-subagents/src/shared/status-format.js.map +0 -1
  1445. package/node_modules/pi-subagents/src/shared/thinking-ceiling.d.ts +0 -14
  1446. package/node_modules/pi-subagents/src/shared/thinking-ceiling.d.ts.map +0 -1
  1447. package/node_modules/pi-subagents/src/shared/thinking-ceiling.js +0 -38
  1448. package/node_modules/pi-subagents/src/shared/thinking-ceiling.js.map +0 -1
  1449. package/node_modules/pi-subagents/src/shared/types.d.ts +0 -2748
  1450. package/node_modules/pi-subagents/src/shared/types.d.ts.map +0 -1
  1451. package/node_modules/pi-subagents/src/shared/types.js +0 -270
  1452. package/node_modules/pi-subagents/src/shared/types.js.map +0 -1
  1453. package/node_modules/pi-subagents/src/shared/utf8.d.ts +0 -6
  1454. package/node_modules/pi-subagents/src/shared/utf8.d.ts.map +0 -1
  1455. package/node_modules/pi-subagents/src/shared/utf8.js +0 -13
  1456. package/node_modules/pi-subagents/src/shared/utf8.js.map +0 -1
  1457. package/node_modules/pi-subagents/src/shared/utils.d.ts +0 -73
  1458. package/node_modules/pi-subagents/src/shared/utils.d.ts.map +0 -1
  1459. package/node_modules/pi-subagents/src/shared/utils.js +0 -596
  1460. package/node_modules/pi-subagents/src/shared/utils.js.map +0 -1
  1461. package/node_modules/pi-subagents/src/shared/watch-strategy.d.ts +0 -3
  1462. package/node_modules/pi-subagents/src/shared/watch-strategy.d.ts.map +0 -1
  1463. package/node_modules/pi-subagents/src/shared/watch-strategy.js +0 -6
  1464. package/node_modules/pi-subagents/src/shared/watch-strategy.js.map +0 -1
  1465. package/node_modules/pi-subagents/src/shared/workflow-child-permit.d.ts +0 -59
  1466. package/node_modules/pi-subagents/src/shared/workflow-child-permit.d.ts.map +0 -1
  1467. package/node_modules/pi-subagents/src/shared/workflow-child-permit.js +0 -160
  1468. package/node_modules/pi-subagents/src/shared/workflow-child-permit.js.map +0 -1
  1469. package/node_modules/pi-subagents/src/slash/delegation-adapters.d.ts +0 -153
  1470. package/node_modules/pi-subagents/src/slash/delegation-adapters.d.ts.map +0 -1
  1471. package/node_modules/pi-subagents/src/slash/delegation-adapters.js +0 -310
  1472. package/node_modules/pi-subagents/src/slash/delegation-adapters.js.map +0 -1
  1473. package/node_modules/pi-subagents/src/slash/delegation-json.d.ts +0 -11
  1474. package/node_modules/pi-subagents/src/slash/delegation-json.d.ts.map +0 -1
  1475. package/node_modules/pi-subagents/src/slash/delegation-json.js +0 -118
  1476. package/node_modules/pi-subagents/src/slash/delegation-json.js.map +0 -1
  1477. package/node_modules/pi-subagents/src/slash/delegation-request.d.ts +0 -13
  1478. package/node_modules/pi-subagents/src/slash/delegation-request.d.ts.map +0 -1
  1479. package/node_modules/pi-subagents/src/slash/delegation-request.js +0 -175
  1480. package/node_modules/pi-subagents/src/slash/delegation-request.js.map +0 -1
  1481. package/node_modules/pi-subagents/src/slash/prompt-template-bridge.d.ts +0 -27
  1482. package/node_modules/pi-subagents/src/slash/prompt-template-bridge.d.ts.map +0 -1
  1483. package/node_modules/pi-subagents/src/slash/prompt-template-bridge.js +0 -393
  1484. package/node_modules/pi-subagents/src/slash/prompt-template-bridge.js.map +0 -1
  1485. package/node_modules/pi-subagents/src/slash/prompt-workflows.d.ts +0 -22
  1486. package/node_modules/pi-subagents/src/slash/prompt-workflows.d.ts.map +0 -1
  1487. package/node_modules/pi-subagents/src/slash/prompt-workflows.js +0 -275
  1488. package/node_modules/pi-subagents/src/slash/prompt-workflows.js.map +0 -1
  1489. package/node_modules/pi-subagents/src/slash/selector.d.ts +0 -48
  1490. package/node_modules/pi-subagents/src/slash/selector.d.ts.map +0 -1
  1491. package/node_modules/pi-subagents/src/slash/selector.js +0 -118
  1492. package/node_modules/pi-subagents/src/slash/selector.js.map +0 -1
  1493. package/node_modules/pi-subagents/src/slash/slash-bridge.d.ts +0 -31
  1494. package/node_modules/pi-subagents/src/slash/slash-bridge.d.ts.map +0 -1
  1495. package/node_modules/pi-subagents/src/slash/slash-bridge.js +0 -133
  1496. package/node_modules/pi-subagents/src/slash/slash-bridge.js.map +0 -1
  1497. package/node_modules/pi-subagents/src/slash/slash-commands.d.ts +0 -11
  1498. package/node_modules/pi-subagents/src/slash/slash-commands.d.ts.map +0 -1
  1499. package/node_modules/pi-subagents/src/slash/slash-commands.js +0 -1060
  1500. package/node_modules/pi-subagents/src/slash/slash-commands.js.map +0 -1
  1501. package/node_modules/pi-subagents/src/slash/slash-live-state.d.ts +0 -22
  1502. package/node_modules/pi-subagents/src/slash/slash-live-state.d.ts.map +0 -1
  1503. package/node_modules/pi-subagents/src/slash/slash-live-state.js +0 -264
  1504. package/node_modules/pi-subagents/src/slash/slash-live-state.js.map +0 -1
  1505. package/node_modules/pi-subagents/src/slash/subagent-cost.d.ts +0 -30
  1506. package/node_modules/pi-subagents/src/slash/subagent-cost.d.ts.map +0 -1
  1507. package/node_modules/pi-subagents/src/slash/subagent-cost.js +0 -311
  1508. package/node_modules/pi-subagents/src/slash/subagent-cost.js.map +0 -1
  1509. package/node_modules/pi-subagents/src/slash/subagents-admin.d.ts +0 -3
  1510. package/node_modules/pi-subagents/src/slash/subagents-admin.d.ts.map +0 -1
  1511. package/node_modules/pi-subagents/src/slash/subagents-admin.js +0 -455
  1512. package/node_modules/pi-subagents/src/slash/subagents-admin.js.map +0 -1
  1513. package/node_modules/pi-subagents/src/tui/fleet-status.d.ts +0 -93
  1514. package/node_modules/pi-subagents/src/tui/fleet-status.d.ts.map +0 -1
  1515. package/node_modules/pi-subagents/src/tui/fleet-status.js +0 -1133
  1516. package/node_modules/pi-subagents/src/tui/fleet-status.js.map +0 -1
  1517. package/node_modules/pi-subagents/src/tui/fleet-transcript.d.ts +0 -52
  1518. package/node_modules/pi-subagents/src/tui/fleet-transcript.d.ts.map +0 -1
  1519. package/node_modules/pi-subagents/src/tui/fleet-transcript.js +0 -502
  1520. package/node_modules/pi-subagents/src/tui/fleet-transcript.js.map +0 -1
  1521. package/node_modules/pi-subagents/src/tui/fleet.d.ts +0 -169
  1522. package/node_modules/pi-subagents/src/tui/fleet.d.ts.map +0 -1
  1523. package/node_modules/pi-subagents/src/tui/fleet.js +0 -1432
  1524. package/node_modules/pi-subagents/src/tui/fleet.js.map +0 -1
  1525. package/node_modules/pi-subagents/src/tui/render-helpers.d.ts +0 -24
  1526. package/node_modules/pi-subagents/src/tui/render-helpers.d.ts.map +0 -1
  1527. package/node_modules/pi-subagents/src/tui/render-helpers.js +0 -101
  1528. package/node_modules/pi-subagents/src/tui/render-helpers.js.map +0 -1
  1529. package/node_modules/pi-subagents/src/tui/render.d.ts +0 -61
  1530. package/node_modules/pi-subagents/src/tui/render.d.ts.map +0 -1
  1531. package/node_modules/pi-subagents/src/tui/render.js +0 -3677
  1532. package/node_modules/pi-subagents/src/tui/render.js.map +0 -1
  1533. package/node_modules/pi-subagents/src/tui/running-tone.d.ts +0 -11
  1534. package/node_modules/pi-subagents/src/tui/running-tone.d.ts.map +0 -1
  1535. package/node_modules/pi-subagents/src/tui/running-tone.js +0 -23
  1536. package/node_modules/pi-subagents/src/tui/running-tone.js.map +0 -1
  1537. package/node_modules/pi-subagents/src/tui/subagent-messages.d.ts +0 -23
  1538. package/node_modules/pi-subagents/src/tui/subagent-messages.d.ts.map +0 -1
  1539. package/node_modules/pi-subagents/src/tui/subagent-messages.js +0 -270
  1540. package/node_modules/pi-subagents/src/tui/subagent-messages.js.map +0 -1
  1541. package/node_modules/pi-subagents/src/watchdog/change-signature.d.ts +0 -8
  1542. package/node_modules/pi-subagents/src/watchdog/change-signature.d.ts.map +0 -1
  1543. package/node_modules/pi-subagents/src/watchdog/change-signature.js +0 -244
  1544. package/node_modules/pi-subagents/src/watchdog/change-signature.js.map +0 -1
  1545. package/node_modules/pi-subagents/src/watchdog/child-status.d.ts +0 -54
  1546. package/node_modules/pi-subagents/src/watchdog/child-status.d.ts.map +0 -1
  1547. package/node_modules/pi-subagents/src/watchdog/child-status.js +0 -188
  1548. package/node_modules/pi-subagents/src/watchdog/child-status.js.map +0 -1
  1549. package/node_modules/pi-subagents/src/watchdog/diff-tool.d.ts +0 -26
  1550. package/node_modules/pi-subagents/src/watchdog/diff-tool.d.ts.map +0 -1
  1551. package/node_modules/pi-subagents/src/watchdog/diff-tool.js +0 -99
  1552. package/node_modules/pi-subagents/src/watchdog/diff-tool.js.map +0 -1
  1553. package/node_modules/pi-subagents/src/watchdog/emission-guard.d.ts +0 -37
  1554. package/node_modules/pi-subagents/src/watchdog/emission-guard.d.ts.map +0 -1
  1555. package/node_modules/pi-subagents/src/watchdog/emission-guard.js +0 -98
  1556. package/node_modules/pi-subagents/src/watchdog/emission-guard.js.map +0 -1
  1557. package/node_modules/pi-subagents/src/watchdog/guidance.d.ts +0 -4
  1558. package/node_modules/pi-subagents/src/watchdog/guidance.d.ts.map +0 -1
  1559. package/node_modules/pi-subagents/src/watchdog/guidance.js +0 -20
  1560. package/node_modules/pi-subagents/src/watchdog/guidance.js.map +0 -1
  1561. package/node_modules/pi-subagents/src/watchdog/lsp-diagnostics.d.ts +0 -18
  1562. package/node_modules/pi-subagents/src/watchdog/lsp-diagnostics.d.ts.map +0 -1
  1563. package/node_modules/pi-subagents/src/watchdog/lsp-diagnostics.js +0 -490
  1564. package/node_modules/pi-subagents/src/watchdog/lsp-diagnostics.js.map +0 -1
  1565. package/node_modules/pi-subagents/src/watchdog/model-selection.d.ts +0 -25
  1566. package/node_modules/pi-subagents/src/watchdog/model-selection.d.ts.map +0 -1
  1567. package/node_modules/pi-subagents/src/watchdog/model-selection.js +0 -168
  1568. package/node_modules/pi-subagents/src/watchdog/model-selection.js.map +0 -1
  1569. package/node_modules/pi-subagents/src/watchdog/permission-arbiter.d.ts +0 -21
  1570. package/node_modules/pi-subagents/src/watchdog/permission-arbiter.d.ts.map +0 -1
  1571. package/node_modules/pi-subagents/src/watchdog/permission-arbiter.js +0 -136
  1572. package/node_modules/pi-subagents/src/watchdog/permission-arbiter.js.map +0 -1
  1573. package/node_modules/pi-subagents/src/watchdog/register-child.d.ts +0 -14
  1574. package/node_modules/pi-subagents/src/watchdog/register-child.d.ts.map +0 -1
  1575. package/node_modules/pi-subagents/src/watchdog/register-child.js +0 -129
  1576. package/node_modules/pi-subagents/src/watchdog/register-child.js.map +0 -1
  1577. package/node_modules/pi-subagents/src/watchdog/register-main.d.ts +0 -10
  1578. package/node_modules/pi-subagents/src/watchdog/register-main.d.ts.map +0 -1
  1579. package/node_modules/pi-subagents/src/watchdog/register-main.js +0 -400
  1580. package/node_modules/pi-subagents/src/watchdog/register-main.js.map +0 -1
  1581. package/node_modules/pi-subagents/src/watchdog/render.d.ts +0 -4
  1582. package/node_modules/pi-subagents/src/watchdog/render.d.ts.map +0 -1
  1583. package/node_modules/pi-subagents/src/watchdog/render.js +0 -34
  1584. package/node_modules/pi-subagents/src/watchdog/render.js.map +0 -1
  1585. package/node_modules/pi-subagents/src/watchdog/review.d.ts +0 -37
  1586. package/node_modules/pi-subagents/src/watchdog/review.d.ts.map +0 -1
  1587. package/node_modules/pi-subagents/src/watchdog/review.js +0 -320
  1588. package/node_modules/pi-subagents/src/watchdog/review.js.map +0 -1
  1589. package/node_modules/pi-subagents/src/watchdog/rules.d.ts +0 -22
  1590. package/node_modules/pi-subagents/src/watchdog/rules.d.ts.map +0 -1
  1591. package/node_modules/pi-subagents/src/watchdog/rules.js +0 -59
  1592. package/node_modules/pi-subagents/src/watchdog/rules.js.map +0 -1
  1593. package/node_modules/pi-subagents/src/watchdog/runtime.d.ts +0 -196
  1594. package/node_modules/pi-subagents/src/watchdog/runtime.d.ts.map +0 -1
  1595. package/node_modules/pi-subagents/src/watchdog/runtime.js +0 -867
  1596. package/node_modules/pi-subagents/src/watchdog/runtime.js.map +0 -1
  1597. package/node_modules/pi-subagents/src/watchdog/scope.d.ts +0 -15
  1598. package/node_modules/pi-subagents/src/watchdog/scope.d.ts.map +0 -1
  1599. package/node_modules/pi-subagents/src/watchdog/scope.js +0 -45
  1600. package/node_modules/pi-subagents/src/watchdog/scope.js.map +0 -1
  1601. package/node_modules/pi-subagents/src/watchdog/settings.d.ts +0 -30
  1602. package/node_modules/pi-subagents/src/watchdog/settings.d.ts.map +0 -1
  1603. package/node_modules/pi-subagents/src/watchdog/settings.js +0 -481
  1604. package/node_modules/pi-subagents/src/watchdog/settings.js.map +0 -1
  1605. package/node_modules/pi-subagents/src/watchdog/tool-actions.d.ts +0 -18
  1606. package/node_modules/pi-subagents/src/watchdog/tool-actions.d.ts.map +0 -1
  1607. package/node_modules/pi-subagents/src/watchdog/tool-actions.js +0 -151
  1608. package/node_modules/pi-subagents/src/watchdog/tool-actions.js.map +0 -1
  1609. package/node_modules/pi-subagents/src/watchdog/turn-delta.d.ts +0 -16
  1610. package/node_modules/pi-subagents/src/watchdog/turn-delta.d.ts.map +0 -1
  1611. package/node_modules/pi-subagents/src/watchdog/turn-delta.js +0 -189
  1612. package/node_modules/pi-subagents/src/watchdog/turn-delta.js.map +0 -1
  1613. package/node_modules/pi-subagents/src/watchdog/types.d.ts +0 -142
  1614. package/node_modules/pi-subagents/src/watchdog/types.d.ts.map +0 -1
  1615. package/node_modules/pi-subagents/src/watchdog/types.js +0 -28
  1616. package/node_modules/pi-subagents/src/watchdog/types.js.map +0 -1
  1617. package/node_modules/pi-subagents/src/watchdog/warning-format.d.ts +0 -8
  1618. package/node_modules/pi-subagents/src/watchdog/warning-format.d.ts.map +0 -1
  1619. package/node_modules/pi-subagents/src/watchdog/warning-format.js +0 -60
  1620. package/node_modules/pi-subagents/src/watchdog/warning-format.js.map +0 -1
  1621. package/node_modules/pi-subagents/src/workflows/chat-progress.d.ts +0 -38
  1622. package/node_modules/pi-subagents/src/workflows/chat-progress.d.ts.map +0 -1
  1623. package/node_modules/pi-subagents/src/workflows/chat-progress.js +0 -130
  1624. package/node_modules/pi-subagents/src/workflows/chat-progress.js.map +0 -1
  1625. package/node_modules/pi-subagents/src/workflows/host-command.d.ts +0 -31
  1626. package/node_modules/pi-subagents/src/workflows/host-command.d.ts.map +0 -1
  1627. package/node_modules/pi-subagents/src/workflows/host-command.js +0 -228
  1628. package/node_modules/pi-subagents/src/workflows/host-command.js.map +0 -1
  1629. package/node_modules/pi-subagents/src/workflows/scripted-workflow.d.ts +0 -205
  1630. package/node_modules/pi-subagents/src/workflows/scripted-workflow.d.ts.map +0 -1
  1631. package/node_modules/pi-subagents/src/workflows/scripted-workflow.js +0 -2730
  1632. package/node_modules/pi-subagents/src/workflows/scripted-workflow.js.map +0 -1
  1633. package/node_modules/pi-subagents/src/workflows/structured-workflow-scripts.d.ts +0 -10
  1634. package/node_modules/pi-subagents/src/workflows/structured-workflow-scripts.d.ts.map +0 -1
  1635. package/node_modules/pi-subagents/src/workflows/structured-workflow-scripts.js +0 -166
  1636. package/node_modules/pi-subagents/src/workflows/structured-workflow-scripts.js.map +0 -1
  1637. package/node_modules/pi-subagents/src/workflows/workflow-checklist.d.ts +0 -128
  1638. package/node_modules/pi-subagents/src/workflows/workflow-checklist.d.ts.map +0 -1
  1639. package/node_modules/pi-subagents/src/workflows/workflow-checklist.js +0 -315
  1640. package/node_modules/pi-subagents/src/workflows/workflow-checklist.js.map +0 -1
  1641. package/node_modules/pi-subagents/src/workflows/workflow-child-summary.d.ts +0 -20
  1642. package/node_modules/pi-subagents/src/workflows/workflow-child-summary.d.ts.map +0 -1
  1643. package/node_modules/pi-subagents/src/workflows/workflow-child-summary.js +0 -179
  1644. package/node_modules/pi-subagents/src/workflows/workflow-child-summary.js.map +0 -1
  1645. package/node_modules/pi-subagents/src/workflows/workflow-preflight.d.ts +0 -59
  1646. package/node_modules/pi-subagents/src/workflows/workflow-preflight.d.ts.map +0 -1
  1647. package/node_modules/pi-subagents/src/workflows/workflow-preflight.js +0 -289
  1648. package/node_modules/pi-subagents/src/workflows/workflow-preflight.js.map +0 -1
  1649. package/node_modules/pi-subagents/src/workflows/workflow-receipt.d.ts +0 -35
  1650. package/node_modules/pi-subagents/src/workflows/workflow-receipt.d.ts.map +0 -1
  1651. package/node_modules/pi-subagents/src/workflows/workflow-receipt.js +0 -455
  1652. package/node_modules/pi-subagents/src/workflows/workflow-receipt.js.map +0 -1
  1653. package/node_modules/pi-subagents/src/workflows/workflow-resources.d.ts +0 -56
  1654. package/node_modules/pi-subagents/src/workflows/workflow-resources.d.ts.map +0 -1
  1655. package/node_modules/pi-subagents/src/workflows/workflow-resources.js +0 -272
  1656. package/node_modules/pi-subagents/src/workflows/workflow-resources.js.map +0 -1
  1657. package/node_modules/pi-subagents/src/workflows/workflow-reuse.d.ts +0 -51
  1658. package/node_modules/pi-subagents/src/workflows/workflow-reuse.d.ts.map +0 -1
  1659. package/node_modules/pi-subagents/src/workflows/workflow-reuse.js +0 -103
  1660. package/node_modules/pi-subagents/src/workflows/workflow-reuse.js.map +0 -1
  1661. package/node_modules/pi-subagents/src/workflows/workflow-revival.d.ts +0 -32
  1662. package/node_modules/pi-subagents/src/workflows/workflow-revival.d.ts.map +0 -1
  1663. package/node_modules/pi-subagents/src/workflows/workflow-revival.js +0 -111
  1664. package/node_modules/pi-subagents/src/workflows/workflow-revival.js.map +0 -1
  1665. package/node_modules/pi-subagents/src/workflows/workflow-settlement.d.ts +0 -85
  1666. package/node_modules/pi-subagents/src/workflows/workflow-settlement.d.ts.map +0 -1
  1667. package/node_modules/pi-subagents/src/workflows/workflow-settlement.js +0 -204
  1668. package/node_modules/pi-subagents/src/workflows/workflow-settlement.js.map +0 -1
  1669. package/node_modules/undici/LICENSE +0 -21
  1670. package/node_modules/undici/README.md +0 -797
  1671. package/node_modules/undici/docs/docs/api/Agent.md +0 -291
  1672. package/node_modules/undici/docs/docs/api/BalancedPool.md +0 -297
  1673. package/node_modules/undici/docs/docs/api/CacheStorage.md +0 -188
  1674. package/node_modules/undici/docs/docs/api/CacheStore.md +0 -360
  1675. package/node_modules/undici/docs/docs/api/Client.md +0 -533
  1676. package/node_modules/undici/docs/docs/api/ClientStats.md +0 -93
  1677. package/node_modules/undici/docs/docs/api/Connector.md +0 -198
  1678. package/node_modules/undici/docs/docs/api/ContentType.md +0 -97
  1679. package/node_modules/undici/docs/docs/api/Cookies.md +0 -179
  1680. package/node_modules/undici/docs/docs/api/Debug.md +0 -78
  1681. package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +0 -515
  1682. package/node_modules/undici/docs/docs/api/Dispatcher.md +0 -827
  1683. package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +0 -171
  1684. package/node_modules/undici/docs/docs/api/Errors.md +0 -524
  1685. package/node_modules/undici/docs/docs/api/EventSource.md +0 -358
  1686. package/node_modules/undici/docs/docs/api/Fetch.md +0 -711
  1687. package/node_modules/undici/docs/docs/api/GlobalInstallation.md +0 -121
  1688. package/node_modules/undici/docs/docs/api/H2CClient.md +0 -385
  1689. package/node_modules/undici/docs/docs/api/Interceptors.md +0 -418
  1690. package/node_modules/undici/docs/docs/api/MockAgent.md +0 -622
  1691. package/node_modules/undici/docs/docs/api/MockCallHistory.md +0 -371
  1692. package/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +0 -206
  1693. package/node_modules/undici/docs/docs/api/MockClient.md +0 -199
  1694. package/node_modules/undici/docs/docs/api/MockErrors.md +0 -63
  1695. package/node_modules/undici/docs/docs/api/MockPool.md +0 -618
  1696. package/node_modules/undici/docs/docs/api/Pool.md +0 -279
  1697. package/node_modules/undici/docs/docs/api/PoolStats.md +0 -141
  1698. package/node_modules/undici/docs/docs/api/ProxyAgent.md +0 -248
  1699. package/node_modules/undici/docs/docs/api/RedirectHandler.md +0 -276
  1700. package/node_modules/undici/docs/docs/api/RetryAgent.md +0 -136
  1701. package/node_modules/undici/docs/docs/api/RetryHandler.md +0 -200
  1702. package/node_modules/undici/docs/docs/api/RoundRobinPool.md +0 -239
  1703. package/node_modules/undici/docs/docs/api/SnapshotAgent.md +0 -361
  1704. package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +0 -256
  1705. package/node_modules/undici/docs/docs/api/Util.md +0 -82
  1706. package/node_modules/undici/docs/docs/api/WebSocket.md +0 -536
  1707. package/node_modules/undici/docs/docs/api/api-lifecycle.md +0 -159
  1708. package/node_modules/undici/docs/docs/best-practices/client-certificate.md +0 -66
  1709. package/node_modules/undici/docs/docs/best-practices/crawling.md +0 -60
  1710. package/node_modules/undici/docs/docs/best-practices/migrating-from-v7-to-v8.md +0 -233
  1711. package/node_modules/undici/docs/docs/best-practices/mocking-request.md +0 -192
  1712. package/node_modules/undici/docs/docs/best-practices/proxy.md +0 -129
  1713. package/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +0 -226
  1714. package/node_modules/undici/docs/docs/best-practices/writing-tests.md +0 -65
  1715. package/node_modules/undici/docs/docs/getting-started.md +0 -281
  1716. package/node_modules/undici/docs/docs/index.md +0 -784
  1717. package/node_modules/undici/docs/docs/site.json +0 -125
  1718. package/node_modules/undici/docs/docs/type-map.json +0 -79
  1719. package/node_modules/undici/index-fetch.js +0 -65
  1720. package/node_modules/undici/index.d.ts +0 -3
  1721. package/node_modules/undici/index.js +0 -236
  1722. package/node_modules/undici/lib/api/abort-signal.js +0 -59
  1723. package/node_modules/undici/lib/api/api-connect.js +0 -112
  1724. package/node_modules/undici/lib/api/api-pipeline.js +0 -265
  1725. package/node_modules/undici/lib/api/api-request.js +0 -244
  1726. package/node_modules/undici/lib/api/api-stream.js +0 -270
  1727. package/node_modules/undici/lib/api/api-upgrade.js +0 -121
  1728. package/node_modules/undici/lib/api/index.js +0 -7
  1729. package/node_modules/undici/lib/api/readable.js +0 -616
  1730. package/node_modules/undici/lib/cache/memory-cache-store.js +0 -279
  1731. package/node_modules/undici/lib/cache/sqlite-cache-store.js +0 -469
  1732. package/node_modules/undici/lib/core/connect.js +0 -192
  1733. package/node_modules/undici/lib/core/constants.js +0 -120
  1734. package/node_modules/undici/lib/core/diagnostics.js +0 -227
  1735. package/node_modules/undici/lib/core/errors.js +0 -497
  1736. package/node_modules/undici/lib/core/request.js +0 -546
  1737. package/node_modules/undici/lib/core/socks5-client.js +0 -422
  1738. package/node_modules/undici/lib/core/socks5-utils.js +0 -212
  1739. package/node_modules/undici/lib/core/symbols.js +0 -79
  1740. package/node_modules/undici/lib/core/tree.js +0 -160
  1741. package/node_modules/undici/lib/core/util.js +0 -1049
  1742. package/node_modules/undici/lib/dispatcher/agent.js +0 -177
  1743. package/node_modules/undici/lib/dispatcher/balanced-pool.js +0 -217
  1744. package/node_modules/undici/lib/dispatcher/client-h1.js +0 -1801
  1745. package/node_modules/undici/lib/dispatcher/client-h2.js +0 -1781
  1746. package/node_modules/undici/lib/dispatcher/client.js +0 -741
  1747. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +0 -197
  1748. package/node_modules/undici/lib/dispatcher/dispatcher.js +0 -58
  1749. package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +0 -110
  1750. package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +0 -175
  1751. package/node_modules/undici/lib/dispatcher/fixed-queue.js +0 -135
  1752. package/node_modules/undici/lib/dispatcher/h2c-client.js +0 -51
  1753. package/node_modules/undici/lib/dispatcher/pool-base.js +0 -232
  1754. package/node_modules/undici/lib/dispatcher/pool.js +0 -143
  1755. package/node_modules/undici/lib/dispatcher/proxy-agent.js +0 -395
  1756. package/node_modules/undici/lib/dispatcher/retry-agent.js +0 -38
  1757. package/node_modules/undici/lib/dispatcher/round-robin-pool.js +0 -159
  1758. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +0 -350
  1759. package/node_modules/undici/lib/encoding/index.js +0 -33
  1760. package/node_modules/undici/lib/global.js +0 -82
  1761. package/node_modules/undici/lib/handler/cache-handler.js +0 -818
  1762. package/node_modules/undici/lib/handler/cache-revalidation-handler.js +0 -134
  1763. package/node_modules/undici/lib/handler/decorator-handler.js +0 -72
  1764. package/node_modules/undici/lib/handler/deduplication-handler.js +0 -466
  1765. package/node_modules/undici/lib/handler/redirect-handler.js +0 -238
  1766. package/node_modules/undici/lib/handler/retry-handler.js +0 -594
  1767. package/node_modules/undici/lib/interceptor/cache.js +0 -671
  1768. package/node_modules/undici/lib/interceptor/decompress.js +0 -394
  1769. package/node_modules/undici/lib/interceptor/deduplicate.js +0 -118
  1770. package/node_modules/undici/lib/interceptor/dns.js +0 -582
  1771. package/node_modules/undici/lib/interceptor/dump.js +0 -99
  1772. package/node_modules/undici/lib/interceptor/redirect.js +0 -21
  1773. package/node_modules/undici/lib/interceptor/response-error.js +0 -95
  1774. package/node_modules/undici/lib/interceptor/retry.js +0 -19
  1775. package/node_modules/undici/lib/llhttp/constants.d.ts +0 -195
  1776. package/node_modules/undici/lib/llhttp/constants.js +0 -531
  1777. package/node_modules/undici/lib/llhttp/llhttp-wasm.js +0 -15
  1778. package/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +0 -15
  1779. package/node_modules/undici/lib/llhttp/utils.d.ts +0 -2
  1780. package/node_modules/undici/lib/llhttp/utils.js +0 -12
  1781. package/node_modules/undici/lib/mock/mock-agent.js +0 -244
  1782. package/node_modules/undici/lib/mock/mock-call-history.js +0 -248
  1783. package/node_modules/undici/lib/mock/mock-client.js +0 -68
  1784. package/node_modules/undici/lib/mock/mock-errors.js +0 -29
  1785. package/node_modules/undici/lib/mock/mock-interceptor.js +0 -227
  1786. package/node_modules/undici/lib/mock/mock-pool.js +0 -68
  1787. package/node_modules/undici/lib/mock/mock-symbols.js +0 -32
  1788. package/node_modules/undici/lib/mock/mock-utils.js +0 -720
  1789. package/node_modules/undici/lib/mock/pending-interceptors-formatter.js +0 -43
  1790. package/node_modules/undici/lib/mock/snapshot-agent.js +0 -371
  1791. package/node_modules/undici/lib/mock/snapshot-recorder.js +0 -623
  1792. package/node_modules/undici/lib/mock/snapshot-utils.js +0 -158
  1793. package/node_modules/undici/lib/util/cache.js +0 -758
  1794. package/node_modules/undici/lib/util/date.js +0 -670
  1795. package/node_modules/undici/lib/util/runtime-features.js +0 -93
  1796. package/node_modules/undici/lib/util/stats.js +0 -32
  1797. package/node_modules/undici/lib/util/timers.js +0 -425
  1798. package/node_modules/undici/lib/web/cache/cache.js +0 -862
  1799. package/node_modules/undici/lib/web/cache/cachestorage.js +0 -152
  1800. package/node_modules/undici/lib/web/cache/util.js +0 -45
  1801. package/node_modules/undici/lib/web/cookies/constants.js +0 -12
  1802. package/node_modules/undici/lib/web/cookies/index.js +0 -199
  1803. package/node_modules/undici/lib/web/cookies/parse.js +0 -318
  1804. package/node_modules/undici/lib/web/cookies/util.js +0 -352
  1805. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +0 -521
  1806. package/node_modules/undici/lib/web/eventsource/eventsource.js +0 -500
  1807. package/node_modules/undici/lib/web/eventsource/util.js +0 -60
  1808. package/node_modules/undici/lib/web/fetch/LICENSE +0 -21
  1809. package/node_modules/undici/lib/web/fetch/body.js +0 -547
  1810. package/node_modules/undici/lib/web/fetch/constants.js +0 -131
  1811. package/node_modules/undici/lib/web/fetch/data-url.js +0 -596
  1812. package/node_modules/undici/lib/web/fetch/formdata-parser.js +0 -586
  1813. package/node_modules/undici/lib/web/fetch/formdata.js +0 -278
  1814. package/node_modules/undici/lib/web/fetch/global.js +0 -40
  1815. package/node_modules/undici/lib/web/fetch/headers.js +0 -719
  1816. package/node_modules/undici/lib/web/fetch/index.js +0 -2432
  1817. package/node_modules/undici/lib/web/fetch/request.js +0 -1144
  1818. package/node_modules/undici/lib/web/fetch/response.js +0 -639
  1819. package/node_modules/undici/lib/web/fetch/util.js +0 -1530
  1820. package/node_modules/undici/lib/web/infra/index.js +0 -229
  1821. package/node_modules/undici/lib/web/subresource-integrity/Readme.md +0 -9
  1822. package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +0 -307
  1823. package/node_modules/undici/lib/web/webidl/index.js +0 -1004
  1824. package/node_modules/undici/lib/web/websocket/connection.js +0 -329
  1825. package/node_modules/undici/lib/web/websocket/constants.js +0 -126
  1826. package/node_modules/undici/lib/web/websocket/events.js +0 -331
  1827. package/node_modules/undici/lib/web/websocket/frame.js +0 -127
  1828. package/node_modules/undici/lib/web/websocket/permessage-deflate.js +0 -105
  1829. package/node_modules/undici/lib/web/websocket/receiver.js +0 -507
  1830. package/node_modules/undici/lib/web/websocket/sender.js +0 -109
  1831. package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +0 -104
  1832. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +0 -496
  1833. package/node_modules/undici/lib/web/websocket/util.js +0 -347
  1834. package/node_modules/undici/lib/web/websocket/websocket.js +0 -780
  1835. package/node_modules/undici/package.json +0 -152
  1836. package/node_modules/undici/scripts/strip-comments.js +0 -10
  1837. package/node_modules/undici/types/README.md +0 -6
  1838. package/node_modules/undici/types/agent.d.ts +0 -30
  1839. package/node_modules/undici/types/api.d.ts +0 -43
  1840. package/node_modules/undici/types/balanced-pool.d.ts +0 -30
  1841. package/node_modules/undici/types/cache-interceptor.d.ts +0 -179
  1842. package/node_modules/undici/types/cache.d.ts +0 -36
  1843. package/node_modules/undici/types/client-stats.d.ts +0 -15
  1844. package/node_modules/undici/types/client.d.ts +0 -184
  1845. package/node_modules/undici/types/connector.d.ts +0 -37
  1846. package/node_modules/undici/types/content-type.d.ts +0 -21
  1847. package/node_modules/undici/types/cookies.d.ts +0 -30
  1848. package/node_modules/undici/types/diagnostics-channel.d.ts +0 -74
  1849. package/node_modules/undici/types/dispatcher.d.ts +0 -253
  1850. package/node_modules/undici/types/dispatcher1-wrapper.d.ts +0 -7
  1851. package/node_modules/undici/types/env-http-proxy-agent.d.ts +0 -22
  1852. package/node_modules/undici/types/errors.d.ts +0 -187
  1853. package/node_modules/undici/types/eventsource.d.ts +0 -66
  1854. package/node_modules/undici/types/fetch.d.ts +0 -235
  1855. package/node_modules/undici/types/formdata.d.ts +0 -108
  1856. package/node_modules/undici/types/global-dispatcher.d.ts +0 -9
  1857. package/node_modules/undici/types/global-origin.d.ts +0 -7
  1858. package/node_modules/undici/types/h2c-client.d.ts +0 -73
  1859. package/node_modules/undici/types/handlers.d.ts +0 -16
  1860. package/node_modules/undici/types/header.d.ts +0 -165
  1861. package/node_modules/undici/types/index.d.ts +0 -93
  1862. package/node_modules/undici/types/interceptors.d.ts +0 -82
  1863. package/node_modules/undici/types/mock-agent.d.ts +0 -69
  1864. package/node_modules/undici/types/mock-call-history.d.ts +0 -111
  1865. package/node_modules/undici/types/mock-client.d.ts +0 -27
  1866. package/node_modules/undici/types/mock-errors.d.ts +0 -12
  1867. package/node_modules/undici/types/mock-interceptor.d.ts +0 -98
  1868. package/node_modules/undici/types/mock-pool.d.ts +0 -27
  1869. package/node_modules/undici/types/patch.d.ts +0 -29
  1870. package/node_modules/undici/types/pool-stats.d.ts +0 -19
  1871. package/node_modules/undici/types/pool.d.ts +0 -39
  1872. package/node_modules/undici/types/proxy-agent.d.ts +0 -36
  1873. package/node_modules/undici/types/readable.d.ts +0 -68
  1874. package/node_modules/undici/types/retry-agent.d.ts +0 -8
  1875. package/node_modules/undici/types/retry-handler.d.ts +0 -125
  1876. package/node_modules/undici/types/round-robin-pool.d.ts +0 -39
  1877. package/node_modules/undici/types/snapshot-agent.d.ts +0 -113
  1878. package/node_modules/undici/types/socks5-proxy-agent.d.ts +0 -27
  1879. package/node_modules/undici/types/util.d.ts +0 -18
  1880. package/node_modules/undici/types/utility.d.ts +0 -7
  1881. package/node_modules/undici/types/webidl.d.ts +0 -346
  1882. package/node_modules/undici/types/websocket.d.ts +0 -188
  1883. package/src/delegation/SubSession.ts +0 -102
  1884. package/src/tools/utils/pi-subagent-delegation.ts +0 -121
@@ -1,2730 +0,0 @@
1
- import { accessSync, constants, readFileSync, realpathSync, statSync } from "node:fs";
2
- import { createRequire } from "node:module";
3
- import { dirname, resolve as resolvePath } from "node:path";
4
- import { Worker } from "node:worker_threads";
5
- import { DEFAULT_GLOBAL_CONCURRENCY_LIMIT, Semaphore } from "../runs/shared/parallel-utils.js";
6
- import { HOST_STEP_MAX_COUNT } from "../runs/shared/host-step-status.js";
7
- import { describeGateAcceptanceConflict, parseGateInput } from "../runs/shared/acceptance.js";
8
- import { normalizeWorkflowHostCommandParams } from "./host-command.js";
9
- const KEY_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
10
- const BASE_REF_VALIDATION_ERROR = "baseRef must be a valid Git ref: use HEAD or a supported named ref (for example, refs/heads/main). Full 40/64-character commit IDs and revision expressions are unsupported.";
11
- function validGitRef(ref) {
12
- if (typeof ref !== "string" || !ref || ref === "@" || Buffer.byteLength(ref, "utf-8") > 1024 || ref.startsWith("/") || ref.endsWith("/") || ref.includes("//") || ref.includes("..") || ref.includes("@{"))
13
- return false;
14
- if (/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/iu.test(ref))
15
- return false;
16
- if (/[[\]\\~^:?*\u0000-\u0020\u007f]/u.test(ref) || ref.endsWith(".") || ref.endsWith(".lock"))
17
- return false;
18
- return ref.split("/").every((component) => component.length > 0 && component !== "." && component !== ".." && !component.startsWith(".") && !component.endsWith(".") && !component.endsWith(".lock"));
19
- }
20
- const requireFromPackage = createRequire(import.meta.url);
21
- const WORKFLOW_ASSEMBLY_FLUSH_TIMEOUT_MS = 5_000;
22
- const WORKER_SOURCE = String.raw `
23
- const { parentPort, workerData } = require("node:worker_threads");
24
- const vm = require("node:vm");
25
- const { inspect } = require("node:util");
26
- const { parse } = require(workerData.acornPath);
27
-
28
- let promiseHooks;
29
- try {
30
- ({ promiseHooks } = require("node:v8"));
31
- } catch {}
32
-
33
- function createWorkflowPromiseHook(callbacks) {
34
- if (!promiseHooks || typeof promiseHooks.createHook !== "function") return () => {};
35
- try {
36
- return promiseHooks.createHook(callbacks);
37
- } catch (error) {
38
- if (error?.name !== "NotImplementedError") throw error;
39
- return () => {};
40
- }
41
- }
42
-
43
- let nextCallId = 0;
44
- let topLevelWorkflowPromise;
45
- let suppressNativePromiseConsumption = 0;
46
- const activeNativePromises = [];
47
- const pending = new Map();
48
- const workflowErrorKinds = new WeakMap();
49
- const runKeyPattern = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
50
- function validGitRef(ref) {
51
- if (typeof ref !== "string" || !ref || ref === "@" || new TextEncoder().encode(ref).length > 1024 || ref.startsWith("/") || ref.endsWith("/") || ref.includes("//") || ref.includes("..") || ref.includes("@{")) return false;
52
- if (/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/iu.test(ref)) return false;
53
- if (/[[\]\\~^:?*\u0000-\u0020\u007f]/u.test(ref) || ref.endsWith(".") || ref.endsWith(".lock")) return false;
54
- return ref.split("/").every((component) => component.length > 0 && component !== "." && component !== ".." && !component.startsWith(".") && !component.endsWith(".") && !component.endsWith(".lock"));
55
- }
56
- const trackedPromiseTrackers = new WeakMap();
57
- const trackedPromiseTargets = new WeakMap();
58
- let nativePromiseTrackers = new WeakMap();
59
- let nativePromiseParents = new WeakMap();
60
- const observedCallIds = new Set();
61
-
62
- function stableRunJson(value) {
63
- if (Array.isArray(value)) return "[" + value.map(stableRunJson).join(",") + "]";
64
- if (value && typeof value === "object") return "{" + Object.keys(value).sort().map((key) => JSON.stringify(key) + ":" + stableRunJson(value[key])).join(",") + "}";
65
- return JSON.stringify(value) ?? "undefined";
66
- }
67
-
68
- function canonicalRunParams(params) {
69
- if (params.gate === undefined || params.acceptance !== false) return params;
70
- const { acceptance: _acceptance, ...withoutAcceptance } = params;
71
- return withoutAcceptance;
72
- }
73
-
74
- function isDirectWorkflowScriptPromiseHandlerCall() {
75
- const stack = new Error().stack;
76
- if (typeof stack !== "string") return false;
77
- return stack.split("\n").some((line) => line.includes("workflow-script.js") && !line.includes("at async "));
78
- }
79
-
80
- function nativePromiseTracker(promise) {
81
- if (!promise || (typeof promise !== "object" && typeof promise !== "function")) return undefined;
82
- let tracker = nativePromiseTrackers.get(promise);
83
- if (!tracker) {
84
- tracker = { observations: [], consumed: false, dependencies: [] };
85
- nativePromiseTrackers.set(promise, tracker);
86
- }
87
- return tracker;
88
- }
89
-
90
- function promiseObservationTracker(value) {
91
- if (!value || (typeof value !== "object" && typeof value !== "function")) return undefined;
92
- return trackedPromiseTrackers.get(value) ?? nativePromiseTrackers.get(value);
93
- }
94
-
95
- function addTrackerDependency(tracker, dependency) {
96
- if (!dependency) return;
97
- tracker.dependencies ??= [];
98
- if (!tracker.dependencies.includes(dependency)) tracker.dependencies.push(dependency);
99
- if (tracker.consumed) markTrackedObservationsConsumed(dependency);
100
- }
101
-
102
- function descendsFromTopLevelWorkflow(promise) {
103
- const seen = new Set();
104
- for (let current = promise; current && !seen.has(current); current = nativePromiseParents.get(current)) {
105
- if (current === topLevelWorkflowPromise) return true;
106
- seen.add(current);
107
- }
108
- return false;
109
- }
110
-
111
- function withSuppressedNativePromiseConsumption(callback) {
112
- suppressNativePromiseConsumption++;
113
- try {
114
- return callback();
115
- } finally {
116
- suppressNativePromiseConsumption--;
117
- }
118
- }
119
-
120
- function mergeObservations(...groups) {
121
- const seen = new Set();
122
- const merged = [];
123
- for (const group of groups) {
124
- for (const observation of group) {
125
- if (!observation || typeof observation.callId !== "number" || typeof observation.key !== "string" || typeof observation.operation !== "string" || seen.has(observation.callId)) continue;
126
- seen.add(observation.callId);
127
- merged.push(observation);
128
- }
129
- }
130
- return merged;
131
- }
132
-
133
- function trackedObservationTracker(value) {
134
- return value && (typeof value === "object" || typeof value === "function") ? trackedPromiseTrackers.get(value) : undefined;
135
- }
136
-
137
- function trackedPromiseTarget(value) {
138
- return value && (typeof value === "object" || typeof value === "function") ? trackedPromiseTargets.get(value) ?? value : value;
139
- }
140
-
141
- function addTrackedObservations(tracker, observations) {
142
- tracker.observations = mergeObservations(tracker.observations, observations);
143
- if (!tracker.consumed) return;
144
- for (const observation of tracker.observations) {
145
- if (observedCallIds.has(observation.callId)) continue;
146
- observedCallIds.add(observation.callId);
147
- parentPort.postMessage({ type: "callObserved", callId: observation.callId, key: observation.key, operation: observation.operation });
148
- }
149
- }
150
-
151
- function markTrackedObservationsConsumed(tracker, seen = new Set()) {
152
- if (seen.has(tracker)) return;
153
- seen.add(tracker);
154
- tracker.consumed = true;
155
- addTrackedObservations(tracker, []);
156
- for (const dependency of tracker.dependencies ?? []) markTrackedObservationsConsumed(dependency, seen);
157
- }
158
-
159
- function consumeTrackedObservations(tracker) {
160
- if (isDirectWorkflowScriptPromiseHandlerCall()) return;
161
- const activePromise = activeNativePromises.at(-1);
162
- if (activePromise === topLevelWorkflowPromise || descendsFromTopLevelWorkflow(activePromise)) {
163
- markTrackedObservationsConsumed(tracker);
164
- } else if (activePromise) {
165
- addTrackerDependency(nativePromiseTracker(activePromise), tracker);
166
- } else {
167
- markTrackedObservationsConsumed(tracker);
168
- }
169
- }
170
-
171
- function trackObservationTracker(tracker, promise, allowFutureObservations = false) {
172
- const target = trackedPromiseTarget(promise);
173
- if ((!allowFutureObservations && tracker.observations.length === 0) || !target || typeof target.then !== "function") return promise;
174
-
175
- const tracked = new Proxy(target, {
176
- get(promiseTarget, prop) {
177
- if (prop === "then") return function promiseThen(onFulfilled, onRejected) {
178
- consumeTrackedObservations(tracker);
179
- const chainTracker = { observations: tracker.observations, consumed: false, dependencies: [tracker] };
180
- const wrapHandler = (handler) => typeof handler === "function"
181
- ? function trackedThenHandler(...args) {
182
- const value = handler.apply(this, args);
183
- addTrackerDependency(chainTracker, promiseObservationTracker(value));
184
- return trackedPromiseTarget(value);
185
- }
186
- : handler;
187
- return trackObservationTracker(chainTracker, promiseTarget.then(wrapHandler(onFulfilled), wrapHandler(onRejected)), true);
188
- };
189
- if (prop === "catch") return function promiseCatch(onRejected) {
190
- consumeTrackedObservations(tracker);
191
- return trackObservationTracker({ observations: tracker.observations, consumed: false, dependencies: [tracker] }, promiseTarget.catch(onRejected), true);
192
- };
193
- if (prop === "finally") return function promiseFinally(onFinally) {
194
- consumeTrackedObservations(tracker);
195
- return trackObservationTracker({ observations: tracker.observations, consumed: false, dependencies: [tracker] }, promiseTarget.finally(onFinally), true);
196
- };
197
- return Reflect.get(promiseTarget, prop, promiseTarget);
198
- },
199
- });
200
- trackedPromiseTrackers.set(tracked, tracker);
201
- trackedPromiseTargets.set(tracked, target);
202
- return tracked;
203
- }
204
-
205
- function trackRunObservation(observations, promise) {
206
- const tracker = trackedObservationTracker(promise) ?? { observations: [], consumed: false };
207
- addTrackedObservations(tracker, observations);
208
- return trackObservationTracker(tracker, promise);
209
- }
210
-
211
- function trackPromiseCombinator(items, createPromise) {
212
- const values = Array.from(items);
213
- const dependencies = [...new Set(values.map(promiseObservationTracker).filter(Boolean))];
214
- const promise = withSuppressedNativePromiseConsumption(() => createPromise(values.map(trackedPromiseTarget)));
215
- if (dependencies.length === 0) return promise;
216
- return trackObservationTracker({ observations: [], consumed: false, dependencies }, promise, true);
217
- }
218
-
219
- // Hosts that freeze built-ins make Promise.all and friends non-writable and non-configurable, and a
220
- // Proxy over Promise itself may not return wrappers for those. Proxy a plain constructor instead.
221
- const workflowPromiseTarget = function Promise() {};
222
- workflowPromiseTarget.prototype = Promise.prototype;
223
- const workflowPromise = new Proxy(workflowPromiseTarget, {
224
- apply() {
225
- throw new TypeError("Promise constructor cannot be invoked without 'new'");
226
- },
227
- construct(_proxyTarget, [executor]) {
228
- const target = Promise;
229
- if (typeof executor !== "function") return new target(executor);
230
- const tracker = { observations: [], consumed: false };
231
- const promise = new target((resolve, reject) => {
232
- let settled = false;
233
- try {
234
- executor((value) => {
235
- if (settled) return;
236
- settled = true;
237
- addTrackerDependency(tracker, promiseObservationTracker(value));
238
- resolve(trackedPromiseTarget(value));
239
- }, (reason) => {
240
- if (settled) return;
241
- settled = true;
242
- reject(reason);
243
- });
244
- } catch (error) {
245
- settled = true;
246
- throw error;
247
- }
248
- });
249
- return trackObservationTracker(tracker, promise, true);
250
- },
251
- get(_proxyTarget, prop) {
252
- const target = Promise;
253
- if (prop === "all") return (items) => trackPromiseCombinator(items, (values) => target.all(values));
254
- if (prop === "allSettled") return (items) => trackPromiseCombinator(items, (values) => target.allSettled(values));
255
- if (prop === "race") return (items) => trackPromiseCombinator(items, (values) => target.race(values));
256
- if (prop === "any") return (items) => trackPromiseCombinator(items, (values) => target.any(values));
257
- if (prop === "resolve") return (value) => {
258
- const dependency = promiseObservationTracker(value);
259
- const promise = withSuppressedNativePromiseConsumption(() => target.resolve(trackedPromiseTarget(value)));
260
- if (!dependency) return promise;
261
- return trackObservationTracker({ observations: [], consumed: false, dependencies: [dependency] }, promise, true);
262
- };
263
- const value = target[prop];
264
- return typeof value === "function" ? value.bind(target) : value;
265
- },
266
- });
267
-
268
- function hostCall(method, args, observation) {
269
- const callId = ++nextCallId;
270
- const promise = new Promise((resolve, reject) => {
271
- pending.set(callId, { resolve, reject });
272
- parentPort.postMessage({ type: "call", callId, method, args });
273
- });
274
- return observation && typeof observation.key === "string" && typeof observation.operation === "string"
275
- ? trackRunObservation([{ key: observation.key, operation: observation.operation, callId }], promise)
276
- : promise;
277
- }
278
-
279
- function runHostCall(key, params, collectFailure, batch, generatedLaneKey) {
280
- const callId = ++nextCallId;
281
- const promise = new Promise((resolve, reject) => {
282
- pending.set(callId, { resolve, reject });
283
- parentPort.postMessage({ type: "call", callId, method: "run", args: { key, params, ...(collectFailure ? { collectFailure: true } : {}), ...(batch ? { batch } : {}), ...(generatedLaneKey ? { generatedLaneKey } : {}) } });
284
- });
285
- return { key, callId, promise };
286
- }
287
-
288
- function isArrayIndexProperty(prop) {
289
- if (!/^(0|[1-9]\d*)$/.test(prop)) return false;
290
- const index = Number(prop);
291
- return Number.isSafeInteger(index) && index >= 0 && index < 4294967295;
292
- }
293
-
294
- const runsAllResultTargets = new WeakMap();
295
-
296
- const MAX_LANES = 32;
297
- const MAX_LANE_STAGES = 16;
298
- const MAX_LANE_STAGE_COUNT = 64;
299
- const MAX_LANE_SPEC_BYTES = 64 * 1024;
300
- const MAX_LANE_TASK_BYTES = 1024 * 1024;
301
- const MAX_LANE_PATH_BYTES = 32 * 1024;
302
- const MAX_LANE_BOARD_TEXT_BYTES = 256;
303
- const LANE_PATH_FIELDS = new Set(["cwd", "output", "sessionDir"]);
304
-
305
- function runsAllKeyAccessError(prop) {
306
- return new Error("Cannot read runs.all result property '" + prop + "'. runs.all resolves to an ordered array, not a key map. Use results[0], array destructuring, or results.map((result) => result.output), not results." + prop + ".");
307
- }
308
-
309
- function wrapRunsAllResults(results, keys) {
310
- const keySet = new Set(keys);
311
- const proxy = new Proxy(results, {
312
- get(target, prop, receiver) {
313
- if (typeof prop !== "string") return Reflect.get(target, prop, receiver);
314
- if (prop === "then" || prop === "toJSON") return undefined;
315
- if (prop in target || isArrayIndexProperty(prop)) return Reflect.get(target, prop, receiver);
316
- if (keySet.has(prop)) throw runsAllKeyAccessError(prop);
317
- throw runsAllKeyAccessError(prop);
318
- },
319
- });
320
- runsAllResultTargets.set(proxy, results);
321
- return proxy;
322
- }
323
-
324
- function laneByteLength(value) {
325
- return new TextEncoder().encode(value).byteLength;
326
- }
327
-
328
- function laneBoardText(value) {
329
- if (typeof value !== "string" || !value) return undefined;
330
- if (laneByteLength(value) <= MAX_LANE_BOARD_TEXT_BYTES) return value;
331
- const bytes = new TextEncoder().encode(value).subarray(0, MAX_LANE_BOARD_TEXT_BYTES - 3);
332
- return new TextDecoder().decode(bytes) + "...";
333
- }
334
-
335
- function laneBoardPath(value) {
336
- if (typeof value !== "string" || !value || laneByteLength(value) > MAX_LANE_BOARD_TEXT_BYTES) return undefined;
337
- return value;
338
- }
339
-
340
- function validateLaneStageBounds(params, label) {
341
- if (typeof params.task === "string" && laneByteLength(params.task) > MAX_LANE_TASK_BYTES) throw new Error(label + " task exceeds 1 MiB when UTF-8 encoded.");
342
- for (const field of LANE_PATH_FIELDS) if (typeof params[field] === "string" && laneByteLength(params[field]) > MAX_LANE_PATH_BYTES) throw new Error(label + " " + field + " exceeds 32 KiB when UTF-8 encoded.");
343
- }
344
-
345
- function validateLaneKey(value, owner) {
346
- if (typeof value !== "string" || !runKeyPattern.test(value)) throw new Error(owner + " key must be 1-128 characters using letters, numbers, '.', '_' or '-', and start with a letter or number.");
347
- return value;
348
- }
349
-
350
- function laneStageParams(stage, previous) {
351
- const resume = stage.resume;
352
- const params = { ...stage.params };
353
- if (resume !== "previous") return params;
354
- if (!previous || typeof previous.runId !== "string" || !previous.runId.trim()) return undefined;
355
- return { ...params, resume: previous.runId.trim() };
356
- }
357
-
358
- function laneStageVerdict(result) {
359
- const structured = result && typeof result === "object" && !Array.isArray(result) ? result.structuredOutput : undefined;
360
- const verdict = structured && typeof structured === "object" && !Array.isArray(structured) ? structured.verdict : undefined;
361
- return typeof verdict === "string" && verdict.trim() ? laneBoardText(verdict.trim()) : undefined;
362
- }
363
-
364
- function laneStageIsBlocked(result) {
365
- const structured = result && typeof result === "object" && !Array.isArray(result) ? result.structuredOutput : undefined;
366
- return structured && typeof structured === "object" && !Array.isArray(structured) && structured.verdict === "blocked";
367
- }
368
-
369
- function laneStageRecord(stageKey, child, forcedState) {
370
- const result = child && typeof child === "object" && !Array.isArray(child) ? child : undefined;
371
- const ok = result?.ok === true;
372
- const verdict = laneStageVerdict(result);
373
- const blocked = laneStageIsBlocked(result);
374
- const state = forcedState ?? (result?.state === "running" ? "running" : result?.stopped ? "stopped" : result?.detached ? "detached" : ok ? blocked ? "blocked" : "completed" : "failed");
375
- const error = state !== "completed" && state !== "running"
376
- ? state === "blocked" && blocked
377
- ? "Stage returned a blocked verdict."
378
- : typeof result?.error === "string"
379
- ? result.error
380
- : typeof result?.output === "string"
381
- ? result.output
382
- : "Stage did not complete successfully."
383
- : undefined;
384
- return {
385
- key: stageKey,
386
- ...(typeof result?.runId === "string" && result.runId.trim() ? { runId: laneBoardText(result.runId.trim()) } : {}),
387
- ...(result ? { ok } : {}),
388
- state,
389
- ...(typeof result?.outputReference === "string" ? (laneBoardPath(result.outputReference) ? { outputReference: laneBoardPath(result.outputReference) } : {}) : {}),
390
- ...(verdict ? { verdict } : {}),
391
- ...(error ? { error: laneBoardText(error) } : {}),
392
- };
393
- }
394
-
395
- function laneFailure(stageKey, error) {
396
- const text = error instanceof Error ? error.message : String(error);
397
- return { key: stageKey, ok: false, output: text, error: text, artifactPaths: [] };
398
- }
399
-
400
- function runCollected(key, params, observe, generatedLaneKey) {
401
- validateRunCall(key, params, "runs.lanes stage", runFingerprints);
402
- const launched = runHostCall(key, params, true, undefined, generatedLaneKey);
403
- observe([{ key, operation: "run", callId: launched.callId }]);
404
- return launched.promise.then(decorateWorkflowChildResult);
405
- }
406
-
407
- function validateLaneSpecs(laneSpecs) {
408
- if (!Array.isArray(laneSpecs)) throw new Error("runs.lanes(lanes) requires an array.");
409
- if (laneSpecs.length === 0) throw new Error("runs.lanes(lanes) requires at least one lane.");
410
- if (laneSpecs.length > MAX_LANES) throw new Error("runs.lanes supports at most " + MAX_LANES + " lanes.");
411
- assertJsonValue(laneSpecs, "runs.lanes lanes");
412
- if (laneByteLength(stableRunJson(laneSpecs)) > MAX_LANE_SPEC_BYTES) throw new Error("runs.lanes canonical JSON exceeds 64 KiB.");
413
- const generatedKeys = new Set();
414
- const validationFingerprints = new Map();
415
- let stageCount = 0;
416
- const normalized = [];
417
- for (let laneIndex = 0; laneIndex < laneSpecs.length; laneIndex++) {
418
- const lane = laneSpecs[laneIndex];
419
- const laneLabel = "runs.lanes lane " + laneIndex;
420
- if (!lane || typeof lane !== "object" || Array.isArray(lane)) throw new Error(laneLabel + " must be an object.");
421
- const laneFields = Object.keys(lane);
422
- if (laneFields.some((field) => field !== "key" && field !== "stages")) throw new Error(laneLabel + " contains unsupported fields.");
423
- const laneKey = validateLaneKey(lane.key, laneLabel);
424
- if (!Array.isArray(lane.stages) || lane.stages.length === 0) throw new Error(laneLabel + " stages must contain at least one stage.");
425
- if (lane.stages.length > MAX_LANE_STAGES) throw new Error(laneLabel + " supports at most " + MAX_LANE_STAGES + " stages.");
426
- const stageKeys = new Set();
427
- const stages = [];
428
- for (let stageIndex = 0; stageIndex < lane.stages.length; stageIndex++) {
429
- stageCount++;
430
- if (stageCount > MAX_LANE_STAGE_COUNT) throw new Error("runs.lanes supports at most " + MAX_LANE_STAGE_COUNT + " total stages.");
431
- const stage = lane.stages[stageIndex];
432
- const stageLabel = laneLabel + " stage " + stageIndex;
433
- if (!stage || typeof stage !== "object" || Array.isArray(stage)) throw new Error(stageLabel + " must be an object.");
434
- const stageKey = validateLaneKey(stage.key, stageLabel);
435
- if (stageKeys.has(stageKey)) throw new Error(laneLabel + " contains duplicate stage key '" + stageKey + "'.");
436
- stageKeys.add(stageKey);
437
- const generatedKey = laneKey + "." + stageKey;
438
- validateLaneKey(generatedKey, stageLabel + " generated");
439
- if (generatedKeys.has(generatedKey)) throw new Error("runs.lanes generated child key '" + generatedKey + "' is duplicated.");
440
- generatedKeys.add(generatedKey);
441
- const resume = stage.resume;
442
- if (resume !== undefined && resume !== "previous") {
443
- if (stageIndex === 0 && typeof resume === "string") {
444
- throw new Error(stageLabel + " cannot resume a retained run id in runs.lanes; use runs.run(key, { resume: id }) outside lanes, or start the lane with an agent stage and use resume: \"previous\" later.");
445
- }
446
- throw new Error(stageLabel + " resume must be 'previous'.");
447
- }
448
- if (stageIndex === 0 && resume === "previous") throw new Error(stageLabel + " cannot resume previous without a predecessor stage.");
449
- const { key: _stageKey, resume: _resume, ...params } = stage;
450
- const validationParams = resume === "previous" ? { ...params, resume: "retained-run-placeholder" } : params;
451
- validateLaneStageBounds(validationParams, stageLabel);
452
- validateRunCall(generatedKey, validationParams, stageLabel, validationFingerprints);
453
- const existingFingerprint = runFingerprints.get(generatedKey);
454
- if (existingFingerprint !== undefined && (resume === "previous" || existingFingerprint !== stableRunJson(canonicalRunParams(params)))) {
455
- throw new Error("runs.lanes generated child key '" + generatedKey + "' is already used with incompatible launch params.");
456
- }
457
- stages.push({ key: stageKey, generatedKey, resume, params });
458
- }
459
- normalized.push({ key: laneKey, stages });
460
- }
461
- return normalized;
462
- }
463
-
464
- function runLane(lane, firstResult, observe) {
465
- const records = [];
466
- const appendSkipped = (start) => {
467
- for (let index = start; index < lane.stages.length; index++) records.push({ key: lane.stages[index].key, state: "skipped" });
468
- };
469
- const finish = (state, failedStage) => ({ key: lane.key, state, ...(failedStage ? { failedStage } : {}), stages: records });
470
- const visit = (index, previous) => {
471
- if (index >= lane.stages.length) return Promise.resolve(finish("complete"));
472
- const stage = lane.stages[index];
473
- if (index === 0) {
474
- const record = laneStageRecord(stage.key, previous);
475
- records.push(record);
476
- if (record.state !== "completed") {
477
- appendSkipped(index + 1);
478
- return Promise.resolve(finish("blocked", stage.key));
479
- }
480
- return visit(index + 1, previous);
481
- }
482
- if (stage.resume === "previous" && (!previous || typeof previous.runId !== "string" || !previous.runId.trim())) {
483
- records.push({ key: stage.key, state: "blocked", error: "Previous stage did not return a retained run id." });
484
- appendSkipped(index + 1);
485
- return Promise.resolve(finish("blocked", stage.key));
486
- }
487
- if (!previous || previous.ok !== true || laneStageIsBlocked(previous)) {
488
- records.push({ key: stage.key, state: "blocked", error: "Previous stage did not complete successfully." });
489
- appendSkipped(index + 1);
490
- return Promise.resolve(finish("blocked", stage.key));
491
- }
492
- const params = laneStageParams(stage, previous);
493
- if (!params) {
494
- records.push({ key: stage.key, state: "blocked", error: "Previous stage did not return a retained run id." });
495
- appendSkipped(index + 1);
496
- return Promise.resolve(finish("blocked", stage.key));
497
- }
498
- let launched;
499
- try {
500
- launched = runCollected(stage.generatedKey, params, observe, lane.key);
501
- } catch (error) {
502
- const failed = laneFailure(stage.generatedKey, error);
503
- records.push(laneStageRecord(stage.key, failed));
504
- appendSkipped(index + 1);
505
- return Promise.resolve(finish("blocked", stage.key));
506
- }
507
- return launched.then((result) => {
508
- const record = laneStageRecord(stage.key, result);
509
- records.push(record);
510
- if (record.state === "completed") return visit(index + 1, result);
511
- appendSkipped(index + 1);
512
- return finish("blocked", stage.key);
513
- }, (error) => {
514
- const failed = laneFailure(stage.generatedKey, error);
515
- records.push(laneStageRecord(stage.key, failed));
516
- appendSkipped(index + 1);
517
- return finish("blocked", stage.key);
518
- });
519
- };
520
- return visit(0, firstResult);
521
- }
522
-
523
- function workflowPlanStringMetadata(params) {
524
- return {
525
- ...(typeof params.phase === "string" && params.phase.trim() ? { phase: params.phase.trim() } : {}),
526
- ...(typeof params.label === "string" && params.label.trim() ? { label: params.label.trim() } : {}),
527
- ...(typeof params.agent === "string" && params.agent.trim() ? { agent: params.agent.trim() } : {}),
528
- };
529
- }
530
-
531
- function runLanes(laneSpecs) {
532
- const lanes = validateLaneSpecs(laneSpecs);
533
- parentPort.postMessage({ type: "lanePlan", lanes: lanes.map((lane) => ({
534
- key: lane.key,
535
- stages: lane.stages.map((stage) => ({
536
- key: stage.key,
537
- generatedKey: stage.generatedKey,
538
- ...workflowPlanStringMetadata(stage.params),
539
- ...(typeof stage.params.as === "string" && stage.params.as.trim() ? { outputName: stage.params.as.trim() } : {}),
540
- ...(stage.params.outputSchema ? { structured: true } : {}),
541
- })),
542
- })) });
543
- const firstItems = lanes.map((lane) => {
544
- const first = lane.stages[0];
545
- return { key: first.generatedKey, ...first.params };
546
- });
547
- // Share the runs.all batch launcher while allowing each lane to advance independently.
548
- const firstBatch = launchRunsAll(firstItems, lanes.map((lane) => lane.key));
549
- const firstResults = firstBatch.launched.map(({ promise }) => promise.then(decorateWorkflowChildResult));
550
- let trackedAggregate;
551
- const observe = (observations) => trackRunObservation(observations, trackedAggregate);
552
- const laneAggregate = Promise.all(lanes.map((lane, index) => firstResults[index].then(
553
- (result) => runLane(lane, result, observe),
554
- (error) => runLane(lane, laneFailure(lane.stages[0].generatedKey, error), observe),
555
- )));
556
- trackedAggregate = trackRunObservation(firstBatch.launched.map(({ key, callId }) => ({ key, operation: "run", callId })), laneAggregate);
557
- return trackedAggregate;
558
- }
559
-
560
- function formatRef(result) {
561
- if (!result || typeof result !== "object") throw new Error("runs.ref(result) requires a run result object.");
562
- const parts = ["run " + (result.key || "unknown")];
563
- if (result.runId) parts.push("id=" + String(result.runId).slice(0, 8));
564
- return "[" + parts.join("; ") + "]";
565
- }
566
-
567
- function formatChildResultString(result) {
568
- const output = typeof result?.output === "string" ? result.output.trim() : "";
569
- return output || formatRef(result);
570
- }
571
-
572
- function decorateWorkflowChildResult(result) {
573
- if (!result || typeof result !== "object" || Array.isArray(result)) return result;
574
- Object.defineProperties(result, {
575
- toString: { value() { return formatChildResultString(this); }, enumerable: false, configurable: true },
576
- });
577
- return result;
578
- }
579
-
580
- let runFingerprints = new Map();
581
-
582
- function validateExtensionBindings(value, label) {
583
- if (value === undefined) return;
584
- if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(label + " extensionBindings must be a plain JSON object.");
585
- const keys = Object.keys(value);
586
- if (keys.length > 16) throw new Error(label + " extensionBindings supports at most 16 namespaces.");
587
- for (const key of keys) if (!/^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,62})\/[1-9][0-9]{0,8}$/.test(key)) throw new Error(label + " extensionBindings namespace '" + key + "' must use a package-like name followed by '/<positive-version>'.");
588
- assertJsonValue(value, label + " extensionBindings");
589
- let propertyCount = 0;
590
- function visit(entry, depth) {
591
- if (!entry || typeof entry !== "object") return;
592
- if (depth > 16) throw new Error(label + " extensionBindings exceeds the maximum nesting depth of 16.");
593
- if (Array.isArray(entry)) { for (const item of entry) visit(item, depth + 1); return; }
594
- for (const child of Object.values(entry)) {
595
- propertyCount++;
596
- if (propertyCount > 256) throw new Error(label + " extensionBindings exceeds 256 total properties.");
597
- visit(child, depth + 1);
598
- }
599
- }
600
- visit(value, 0);
601
- if (new TextEncoder().encode(stableRunJson(value)).byteLength > 16384) throw new Error(label + " extensionBindings canonical JSON exceeds 16384 bytes.");
602
- }
603
-
604
- function validateLaneMetadata(value, label, workflowKey) {
605
- if (value === undefined) return;
606
- if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(label + " must be a plain JSON object.");
607
- const fields = Object.keys(value);
608
- const allowed = ["version", "key", "mode", "sourceRef", "claims", "outputPaths"];
609
- const unknown = fields.filter((field) => !allowed.includes(field));
610
- if (unknown.length > 0) throw new Error(label + " has unsupported fields: " + unknown.join(", ") + ".");
611
- if (value.version !== 1) throw new Error(label + ".version must be 1.");
612
- if (typeof value.key !== "string" || !value.key.trim() || !runKeyPattern.test(value.key.trim())) throw new Error(label + ".key is invalid.");
613
- if (workflowKey !== undefined && value.key.trim() !== workflowKey) throw new Error(label + ".key must match workflow key '" + workflowKey + "'.");
614
- if (value.mode !== undefined && !["mutation", "review", "scout", "gate"].includes(value.mode)) throw new Error(label + ".mode is invalid.");
615
- const bounded = (entry, maxBytes) => typeof entry === "string" && entry.trim() && new TextEncoder().encode(entry.trim()).byteLength <= maxBytes && !/[\r\n\u0000]/.test(entry);
616
- if (value.sourceRef !== undefined && !bounded(value.sourceRef, 128)) throw new Error(label + ".sourceRef is invalid.");
617
- for (const [name, maxItems, maxLength] of [["claims", 20, 160], ["outputPaths", 10, 256]]) {
618
- if (value[name] === undefined) continue;
619
- if (!Array.isArray(value[name]) || value[name].length > maxItems || value[name].some((entry) => !bounded(entry, maxLength))) throw new Error(label + "." + name + " is invalid.");
620
- }
621
- }
622
-
623
- // Mirrors parseGateInput in src/runs/shared/acceptance.ts; the sandbox cannot import it.
624
- function describeGateShapeError(gate) {
625
- const shape = "gate must be a non-empty command string or { command, output?: \"json\", schema?, timeoutMs? }.";
626
- if (typeof gate === "string") return gate.trim() ? undefined : shape;
627
- if (!gate || typeof gate !== "object" || Array.isArray(gate)) return shape;
628
- for (const key of Object.keys(gate)) {
629
- if (!["command", "output", "schema", "timeoutMs"].includes(key)) return "gate." + key + " is not supported.";
630
- }
631
- if (typeof gate.command !== "string" || !gate.command.trim()) return shape;
632
- if (gate.output !== undefined && gate.output !== "json") return "gate.output must be \"json\" when present.";
633
- if (gate.schema !== undefined) {
634
- if (gate.output !== "json") return "gate.schema requires gate.output: \"json\".";
635
- if (!gate.schema || typeof gate.schema !== "object" || Array.isArray(gate.schema)) return "gate.schema must be a JSON Schema object.";
636
- }
637
- if (gate.timeoutMs !== undefined && (!Number.isInteger(gate.timeoutMs) || gate.timeoutMs < 1)) return "gate.timeoutMs must be an integer >= 1.";
638
- return undefined;
639
- }
640
-
641
- function describeGateAcceptanceConflict(gate, acceptance) {
642
- const render = (value) => {
643
- let encoded;
644
- try {
645
- encoded = JSON.stringify(value) ?? String(value);
646
- } catch {
647
- encoded = String(value);
648
- }
649
- return encoded.length > 120 ? encoded.slice(0, 120) + "..." : encoded;
650
- };
651
- return " Both fields were present: gate=" + render(gate) + " acceptance=" + render(acceptance) + ".";
652
- }
653
-
654
- function validateRunCall(key, params, label, fingerprints) {
655
- if (typeof key !== "string" || !runKeyPattern.test(key)) throw new Error(label + " has an invalid key.");
656
- if (hostKeys.has(key)) throw new Error("Workflow key '" + key + "' is already used by runs.host.");
657
- if (!params || typeof params !== "object" || Array.isArray(params)) throw new Error(label + " requires a params object.");
658
- if (Object.prototype.hasOwnProperty.call(params, "action") || Object.prototype.hasOwnProperty.call(params, "workflowScript") || Object.prototype.hasOwnProperty.call(params, "globalConcurrencyLimit") || Object.prototype.hasOwnProperty.call(params, "maxSubagentSpawnsPerRun") || Object.prototype.hasOwnProperty.call(params, "tasks") || Object.prototype.hasOwnProperty.call(params, "chain") || Object.prototype.hasOwnProperty.call(params, "parallel") || Object.prototype.hasOwnProperty.call(params, "concurrency") || Object.prototype.hasOwnProperty.call(params, "chainDir")) {
659
- const hint = label === "runs.run" ? "; use runs.all(...) and JavaScript control flow for orchestration." : ".";
660
- throw new Error(label + " accepts one child via { agent, task } and execution controls only" + hint);
661
- }
662
- if (Object.prototype.hasOwnProperty.call(params, "clarify")) throw new Error(label + " does not support clarify UI.");
663
- if (params.worktree !== undefined && typeof params.worktree !== "boolean") throw new Error(label + " worktree must be true or false.");
664
- if (params.baseRef !== undefined && (typeof params.baseRef !== "string" || !validGitRef(params.baseRef))) throw new Error(label + " baseRef must be a valid Git ref: use HEAD or a supported named ref (for example, refs/heads/main). Full 40/64-character commit IDs and revision expressions are unsupported.");
665
- validateLaneMetadata(params.lane, label + " lane", key);
666
- if (params.gate !== undefined) {
667
- const gateError = describeGateShapeError(params.gate);
668
- if (gateError) throw new Error(label + " " + gateError);
669
- }
670
- if (params.gate !== undefined && params.acceptance !== undefined && params.acceptance !== false) throw new Error(label + " gate cannot be combined with acceptance; use one gate command or acceptance.verify." + describeGateAcceptanceConflict(params.gate, params.acceptance));
671
- if (params.gate !== undefined && params.resume !== undefined) throw new Error(label + " gate is not supported with retained resume.");
672
- if (params.extensionBindings !== undefined && params.resume !== undefined) throw new Error(label + " extensionBindings is not supported with retained resume; resume uses the original retained child binding.");
673
- if (params.resume !== undefined && typeof params.resume !== "string") {
674
- const reference = params.resume;
675
- if (!reference || typeof reference !== "object" || Array.isArray(reference)) throw new Error(label + " resume must be a retained run id or keyed workflow receipt reference.");
676
- const fields = Object.keys(reference);
677
- if (fields.some((field) => field !== "workflowRunId" && field !== "key" && field !== "latest")) throw new Error(label + " keyed resume contains unsupported fields.");
678
- if (typeof reference.workflowRunId !== "string" || !reference.workflowRunId.trim()) throw new Error(label + " keyed resume workflowRunId must be non-empty.");
679
- if (typeof reference.key !== "string" || !runKeyPattern.test(reference.key)) throw new Error(label + " keyed resume key is invalid.");
680
- if (reference.latest !== true) throw new Error(label + " keyed resume requires latest: true.");
681
- }
682
- if (typeof params.resume === "string" && !params.resume.trim()) throw new Error(label + " resume must be a non-empty retained run id.");
683
- if (params.resume !== undefined && params.agent !== undefined) throw new Error(label + " resume and agent are mutually exclusive.");
684
- if (params.resume !== undefined && (typeof params.task !== "string" || !params.task.trim())) throw new Error(label + " resume requires a non-empty task follow-up.");
685
- validateExtensionBindings(params.extensionBindings, label);
686
- assertJsonValue(params, label + " params");
687
- const fingerprint = stableRunJson(canonicalRunParams(params));
688
- const existing = fingerprints.get(key);
689
- if (existing !== undefined && existing !== fingerprint) throw new Error("Duplicate workflow key '" + key + "' used with incompatible launch params.");
690
- fingerprints.set(key, fingerprint);
691
- }
692
-
693
- const hostKeys = new Set();
694
-
695
- function validateHostCommand(key, params) {
696
- validateLaneKey(key, "runs.host");
697
- if (!params || typeof params !== "object" || Array.isArray(params)) throw new Error("runs.host('" + key + "') params must be an object.");
698
- const allowed = new Set(["kind", "command", "timeoutMs", "output", "role", "provider"]);
699
- const unknown = Object.keys(params).filter((field) => !allowed.has(field));
700
- if (unknown.length) {
701
- const cwdHint = unknown.includes("cwd")
702
- ? " The host step does not accept per-step cwd; commands and relative output paths use the workflow cwd. Set cwd on the outer subagent request, or put a trusted directory change in command (for example, 'cd /path/to/worktree && npm test')."
703
- : "";
704
- throw new Error("runs.host('" + key + "') params have unsupported fields: " + unknown.join(", ") + "." + cwdHint);
705
- }
706
- if (params.kind !== "command") throw new Error("runs.host('" + key + "') kind must be 'command'.");
707
- if (typeof params.command !== "string" || !params.command.trim() || params.command.includes("\u0000") || new TextEncoder().encode(params.command.trim()).byteLength > 16384) throw new Error("runs.host('" + key + "') command must be a non-empty string of at most 16384 bytes without NUL.");
708
- if (!Number.isInteger(params.timeoutMs) || params.timeoutMs < 1 || params.timeoutMs > 86400000) throw new Error("runs.host('" + key + "') timeoutMs must be an integer from 1 to 86400000.");
709
- if (params.output !== undefined && (typeof params.output !== "string" || !params.output.trim() || /^[/\\]|(?:^|[/\\])\.\.(?:[/\\]|$)/.test(params.output) || /[\u0000-\u001f\u007f]/.test(params.output) || new TextEncoder().encode(params.output.trim()).byteLength > 240)) throw new Error("runs.host('" + key + "') output must be a bounded relative path without traversal or control characters.");
710
- if (params.role !== undefined && params.role !== "ci" && params.role !== "gate") throw new Error("runs.host('" + key + "') role must be 'ci' or 'gate'.");
711
- if (params.provider !== undefined && (typeof params.provider !== "string" || !params.provider.trim() || /[\r\n\u0000]/.test(params.provider) || new TextEncoder().encode(params.provider.trim()).byteLength > 64)) throw new Error("runs.host('" + key + "') provider must be a non-empty single-line string of at most 64 bytes.");
712
- assertJsonValue(params, "runs.host('" + key + "') params");
713
- if (hostKeys.has(key) || runFingerprints.has(key)) throw new Error("Workflow key '" + key + "' is already in use.");
714
- if (hostKeys.size >= 32) throw new Error("workflowScript supports at most 32 runs.host calls.");
715
- hostKeys.add(key);
716
- }
717
-
718
- const RUNS_ALL_PERMISSIVE_WARNING = "runs.all received runs.run(...) launch promise(s) or thenable(s). Those children were already launched individually, so runs.all cannot apply batch fingerprint validation, batch grouping in the fleet view, or collectFailure semantics; a failed child will throw at the runs.all boundary instead of returning as { ok: false }. To get full runs.all semantics, pass config objects: runs.all(items.map((item) => ({ key: item.key, agent: item.agent, task: item.task }))).";
719
-
720
- function runsAllItemThenableInfo(item, index) {
721
- if (!item || typeof item !== "object" || Array.isArray(item)) return null;
722
- if (typeof item.then !== "function") return null;
723
- const tracker = promiseObservationTracker(item);
724
- const observation = tracker && Array.isArray(tracker.observations) ? tracker.observations.find((entry) => entry && entry.operation === "run") : undefined;
725
- return {
726
- key: observation && typeof observation.key === "string" ? observation.key : ("runs.all[" + index + "]"),
727
- callId: observation && typeof observation.callId === "number" ? observation.callId : null,
728
- promise: item,
729
- };
730
- }
731
-
732
- let warnedPermissiveRunsAll = false;
733
-
734
- function launchRunsAll(items, generatedLaneKeys) {
735
- if (!Array.isArray(items)) throw new Error("runs.all(items) requires an array.");
736
- const anyThenable = items.some((item, index) => runsAllItemThenableInfo(item, index) !== null);
737
- if (anyThenable) return launchRunsAllPermissive(items);
738
- const fingerprints = new Map(runFingerprints);
739
- const calls = [];
740
- for (let index = 0; index < items.length; index++) {
741
- if (!Object.prototype.hasOwnProperty.call(items, index)) throw new Error("runs.all items must not contain sparse entries.");
742
- const item = items[index];
743
- if (!item || typeof item !== "object" || Array.isArray(item)) throw new Error("runs.all item " + index + " must be an object.");
744
- const { key, ...params } = item;
745
- validateRunCall(key, params, "runs.all item " + index, fingerprints);
746
- calls.push({ key, params });
747
- }
748
- runFingerprints = fingerprints;
749
- const batch = { id: "batch-" + (++nextCallId), calls };
750
- const launched = calls.map(({ key, params }, index) => runHostCall(key, params, true, batch, generatedLaneKeys?.[index]));
751
- return { calls, launched };
752
- }
753
-
754
- function launchRunsAllPermissive(items) {
755
- if (!warnedPermissiveRunsAll) {
756
- warnedPermissiveRunsAll = true;
757
- try { capturedConsole.warn(RUNS_ALL_PERMISSIVE_WARNING); } catch { /* console emission is best-effort */ }
758
- }
759
- const fingerprints = new Map(runFingerprints);
760
- const calls = [];
761
- const launched = [];
762
- for (let index = 0; index < items.length; index++) {
763
- if (!Object.prototype.hasOwnProperty.call(items, index)) throw new Error("runs.all items must not contain sparse entries.");
764
- const item = items[index];
765
- if (!item || typeof item !== "object" || Array.isArray(item)) throw new Error("runs.all item " + index + " must be an object or a runs.run(...) launch promise.");
766
- const thenable = runsAllItemThenableInfo(item, index);
767
- if (thenable) {
768
- calls.push({ key: thenable.key, params: {} });
769
- launched.push(thenable);
770
- continue;
771
- }
772
- const { key, ...params } = item;
773
- validateRunCall(key, params, "runs.all item " + index, fingerprints);
774
- calls.push({ key, params });
775
- launched.push(null);
776
- }
777
- runFingerprints = fingerprints;
778
- return { calls, launched: launched.map((entry, index) => entry ?? runHostCall(calls[index].key, calls[index].params, false, undefined)) };
779
- }
780
-
781
- const runs = Object.freeze({
782
- run(key, params) {
783
- validateRunCall(key, params, "runs.run", runFingerprints);
784
- const launched = runHostCall(key, params, false);
785
- return trackRunObservation([{ key, operation: "run", callId: launched.callId }], launched.promise.then(decorateWorkflowChildResult));
786
- },
787
- all(items) {
788
- const { calls, launched } = launchRunsAll(items);
789
- return trackRunObservation(launched.map(({ key, callId }) => ({ key, operation: "run", callId })), trackPromiseCombinator(launched.map(({ promise }) => promise), (values) => Promise.all(values).then((results) => wrapRunsAllResults(results.map(decorateWorkflowChildResult), calls.map(({ key }) => key)))));
790
- },
791
- lanes(laneSpecs) {
792
- return runLanes(laneSpecs);
793
- },
794
- host(key, params) {
795
- validateHostCommand(key, params);
796
- return hostCall("host", { key, params }, { key, operation: "host" });
797
- },
798
- steer(key, message, options = {}) {
799
- if (typeof key !== "string" || !runKeyPattern.test(key)) throw new Error("runs.steer has an invalid key.");
800
- if (typeof message !== "string" || !message.trim()) throw new Error("runs.steer message must be a non-empty string.");
801
- if (!options || typeof options !== "object" || Array.isArray(options)) throw new Error("runs.steer options must be an object.");
802
- const allowed = new Set(["mode", "index", "ackTimeoutMs"]);
803
- for (const option of Object.keys(options)) if (!allowed.has(option)) throw new Error("runs.steer options contain unsupported field '" + option + "'.");
804
- if (options.mode !== undefined && options.mode !== "steer" && options.mode !== "follow_up" && options.mode !== "auto") throw new Error("runs.steer mode must be 'steer', 'follow_up', or 'auto'.");
805
- if (options.index !== undefined && (!Number.isInteger(options.index) || options.index < 0 || options.index > 1000000)) throw new Error("runs.steer index must be an integer between 0 and 1000000.");
806
- if (options.ackTimeoutMs !== undefined && (!Number.isInteger(options.ackTimeoutMs) || options.ackTimeoutMs < 1)) throw new Error("runs.steer ackTimeoutMs must be a positive integer.");
807
- return hostCall("steer", { key, message: message.trim(), options }, { key, operation: "steer" });
808
- },
809
- status(keyOrRunId) { return hostCall("status", { keyOrRunId }); },
810
- ref: formatRef,
811
- refs(results) {
812
- if (!Array.isArray(results)) throw new Error("runs.refs(results) requires an array.");
813
- return results.map(formatRef).join("\n");
814
- },
815
- });
816
-
817
- function validateStateKey(key) {
818
- if (typeof key !== "string" || !runKeyPattern.test(key)) throw new Error("state key must be 1-128 characters using letters, numbers, '.', '_' or '-', and start with a letter or number.");
819
- return key;
820
- }
821
-
822
- const state = Object.freeze({
823
- get(key) { return hostCall("state.get", { key: validateStateKey(key) }); },
824
- set(key, value) {
825
- const validKey = validateStateKey(key);
826
- assertJsonValue(value, "state.set('" + validKey + "') value");
827
- return hostCall("state.set", { key: validKey, value });
828
- },
829
- });
830
-
831
- let contextObjectPrototype;
832
-
833
- const capturedConsole = Object.freeze(Object.fromEntries(
834
- ["log", "info", "warn", "error"].map((level) => [level, (...args) => {
835
- parentPort.postMessage({ type: "console", level, text: args.map((value) => typeof value === "string" ? value : inspect(value, { depth: 4, breakLength: 120 })).join(" ") });
836
- }]),
837
- ));
838
-
839
- function formatWorkflowScriptSyntaxError(error) {
840
- const details = formatWorkflowScriptError(error);
841
- return [
842
- "workflowScript must be valid JavaScript.",
843
- "If task text contains Markdown fences or backticks, use an array joined with \"\\n\" or escaped strings instead of a raw backtick template literal.",
844
- "",
845
- "Original SyntaxError:",
846
- details,
847
- ].join("\n");
848
- }
849
-
850
- function formatWorkflowScriptError(error) {
851
- const message = error && typeof error.message === "string" ? error.message : String(error);
852
- const stack = error && typeof error.stack === "string" ? error.stack : "";
853
- if (!stack) return message;
854
- return stack.includes(message) ? stack : message + "\n" + stack;
855
- }
856
-
857
- function isSyntaxError(error) {
858
- return error instanceof SyntaxError || error?.name === "SyntaxError";
859
- }
860
-
861
- function postWorkflowError(error) {
862
- // Pre-run syntax and portability errors are tagged "validation" where the script is compiled;
863
- // anything reaching here was thrown while the script ran, including a runtime SyntaxError.
864
- const taggedKind = error && (typeof error === "object" || typeof error === "function") ? workflowErrorKinds.get(error) : undefined;
865
- parentPort.postMessage({ type: "error", error: isSyntaxError(error) ? formatWorkflowScriptSyntaxError(error) : formatWorkflowScriptError(error), errorKind: taggedKind ?? "script" });
866
- }
867
-
868
- process.on("unhandledRejection", postWorkflowError);
869
-
870
- const NESTED_ASYNC_WORKFLOW_ERROR = "workflowScript validation failed before child launch; no children launched. workflowScript does not support nested async functions. Use top-level await, plain helper functions that return runs.run(...), or explicit Promise chains so workflows stay portable across Node and Bun. Parallel plus sequential rewrite: const a = runs.run(\"a\", { agent: \"worker\", task: \"A\" }); const writer = await runs.run(\"writer\", { agent: \"worker\", task: \"Write\" }); const review = await runs.run(\"review\", { agent: \"reviewer\", task: writer.output }); const [aResult] = await Promise.all([a]); return { a: aResult.output, issue: { writerRunId: writer.runId, reviewRunId: review.runId } };";
871
- const AST_SCALAR_KEYS = new Set(["type", "start", "end"]);
872
-
873
- function assertPortableWorkflowScript(source) {
874
- const wrapped = "(async () => {\n" + source + "\n})()";
875
- let ast;
876
- try {
877
- ast = parse(wrapped, { ecmaVersion: "latest", sourceType: "script" });
878
- } catch (error) {
879
- // The wrapper adds one line before the script; report the script's own line.
880
- if (isSyntaxError(error) && typeof error.message === "string") {
881
- const message = error.message.replace(/\((\d+):(\d+)\)$/, (_match, line, column) => "(" + Math.max(1, Number(line) - 1) + ":" + column + ")");
882
- if (typeof error.stack === "string") error.stack = error.stack.replace(error.message, message);
883
- error.message = message;
884
- }
885
- throw error;
886
- }
887
- const wrapper = workflowWrapperFunction(ast);
888
- walkWorkflowAst(wrapper.body, wrapper);
889
- }
890
-
891
- function workflowWrapperFunction(ast) {
892
- const wrapper = ast.body?.[0]?.expression?.callee;
893
- if (!wrapper || wrapper.type !== "ArrowFunctionExpression") throw new Error("workflowScript wrapper parse invariant failed.");
894
- return wrapper;
895
- }
896
-
897
- function isAsyncFunctionNode(node) {
898
- return node.async === true && (node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression");
899
- }
900
-
901
- function walkWorkflowAst(node, allowedAsyncFunction) {
902
- if (!node || typeof node !== "object") return;
903
- if (Array.isArray(node)) {
904
- for (const item of node) walkWorkflowAst(item, allowedAsyncFunction);
905
- return;
906
- }
907
- if (node !== allowedAsyncFunction && isAsyncFunctionNode(node)) {
908
- throw new Error(NESTED_ASYNC_WORKFLOW_ERROR);
909
- }
910
- for (const [key, child] of Object.entries(node)) {
911
- if (AST_SCALAR_KEYS.has(key)) continue;
912
- walkWorkflowAst(child, allowedAsyncFunction);
913
- }
914
- }
915
-
916
- function assertJsonValue(value, path = "emit", seen = new Set()) {
917
- if (value === null || typeof value === "string" || typeof value === "boolean") return;
918
- if (typeof value === "number") {
919
- if (!Number.isFinite(value)) throw new Error(path + " must contain only finite JSON numbers.");
920
- return;
921
- }
922
- if (typeof value !== "object") throw new Error(path + " must be a JSON value; received " + typeof value + ".");
923
- if (seen.has(value)) throw new Error(path + " must not contain cycles.");
924
- seen.add(value);
925
- if (Array.isArray(value)) {
926
- for (let index = 0; index < value.length; index++) {
927
- if (!Object.prototype.hasOwnProperty.call(value, index)) throw new Error(path + " must not contain sparse array entries.");
928
- assertJsonValue(value[index], path + "[" + index + "]", seen);
929
- }
930
- } else {
931
- const prototype = Object.getPrototypeOf(value);
932
- if (prototype !== null && prototype !== Object.prototype && prototype !== contextObjectPrototype) throw new Error(path + " must contain only plain JSON objects.");
933
- if (Object.getOwnPropertySymbols(value).length > 0) throw new Error(path + " must not contain symbol keys.");
934
- for (const [key, entry] of Object.entries(value)) assertJsonValue(entry, path + "." + key, seen);
935
- }
936
- seen.delete(value);
937
- }
938
-
939
- function isPlainWorkflowObject(value) {
940
- if (!value || typeof value !== "object" || Array.isArray(value)) return false;
941
- const prototype = Object.getPrototypeOf(value);
942
- return prototype === null || prototype === Object.prototype || prototype === contextObjectPrototype;
943
- }
944
-
945
- function unwrapRunsAllResults(value, seen = new Map()) {
946
- if (value === null || typeof value !== "object") return value;
947
- const runsAllTarget = runsAllResultTargets.get(value);
948
- const target = runsAllTarget || value;
949
- if (seen.has(target)) return seen.get(target);
950
- if (Array.isArray(target)) {
951
- const copy = [];
952
- seen.set(target, copy);
953
- let changed = !!runsAllTarget;
954
- for (let index = 0; index < target.length; index++) {
955
- copy[index] = unwrapRunsAllResults(target[index], seen);
956
- changed ||= copy[index] !== target[index];
957
- }
958
- return changed ? copy : target;
959
- }
960
- if (!isPlainWorkflowObject(target) || Object.getOwnPropertySymbols(target).length > 0) return target;
961
- let changed = false;
962
- const entries = Object.entries(target).map(([key, entry]) => {
963
- const unwrapped = unwrapRunsAllResults(entry, seen);
964
- changed ||= unwrapped !== entry;
965
- return [key, unwrapped];
966
- });
967
- return changed ? Object.fromEntries(entries) : target;
968
- }
969
-
970
- function omitUndefinedWorkflowValues(value, seen = new Set()) {
971
- if (value === null || typeof value !== "object") return value;
972
- if (seen.has(value)) return value;
973
- seen.add(value);
974
- const normalized = Array.isArray(value)
975
- ? value.map((entry) => entry === undefined ? null : omitUndefinedWorkflowValues(entry, seen))
976
- : isPlainWorkflowObject(value) && Object.getOwnPropertySymbols(value).length === 0
977
- ? Object.fromEntries(Object.entries(value).flatMap(([key, entry]) => entry === undefined ? [] : [[key, omitUndefinedWorkflowValues(entry, seen)]]))
978
- : value;
979
- seen.delete(value);
980
- return normalized;
981
- }
982
-
983
- function deepFreezeWorkflowArgs(value) {
984
- if (value === null || typeof value !== "object" || Object.isFrozen(value)) return value;
985
- for (const entry of Object.values(value)) deepFreezeWorkflowArgs(entry);
986
- return Object.freeze(value);
987
- }
988
-
989
- parentPort.on("message", async (message) => {
990
- if (message.type === "response") {
991
- const entry = pending.get(message.callId);
992
- if (!entry) return;
993
- pending.delete(message.callId);
994
- if (message.ok) entry.resolve(message.value);
995
- else {
996
- const error = new Error(message.error);
997
- if (message.errorKind === "child" || message.errorKind === "detached-child") workflowErrorKinds.set(error, message.errorKind);
998
- entry.reject(error);
999
- }
1000
- return;
1001
- }
1002
- if (message.type !== "start") return;
1003
- try {
1004
- const sandbox = { runs, Promise: workflowPromise, emit(value) { const unwrapped = unwrapRunsAllResults(value); const emittedValue = unwrapped === undefined ? null : omitUndefinedWorkflowValues(unwrapped); assertJsonValue(emittedValue); parentPort.postMessage({ type: "emit", value: emittedValue }); }, console: capturedConsole };
1005
- if (message.stateEnabled) sandbox.state = state;
1006
- const context = vm.createContext(sandbox, { codeGeneration: { strings: false, wasm: false } });
1007
- contextObjectPrototype = vm.runInContext("Object.prototype", context);
1008
- // Rebuild args inside the VM realm: a worker-realm object would expose the worker's unrestricted
1009
- // Function through args.constructor.constructor, bypassing codeGeneration.strings: false.
1010
- sandbox.args = deepFreezeWorkflowArgs(vm.runInContext("JSON.parse", context)(JSON.stringify(message.args ?? {})));
1011
- let compiled;
1012
- try {
1013
- assertPortableWorkflowScript(message.script);
1014
- compiled = new vm.Script("(async () => {\n" + message.script + "\n})()", { filename: "workflow-script.js", lineOffset: -1 });
1015
- } catch (error) {
1016
- parentPort.postMessage({ type: "error", errorKind: "validation", error: isSyntaxError(error) ? formatWorkflowScriptSyntaxError(error) : formatWorkflowScriptError(error) });
1017
- return;
1018
- }
1019
- const nativePromisePrototype = vm.runInContext("(async () => {})().constructor.prototype", context);
1020
- const nativeThenDescriptor = Object.getOwnPropertyDescriptor(nativePromisePrototype, "then");
1021
- if (!nativeThenDescriptor || typeof nativeThenDescriptor.value !== "function") throw new Error("workflowScript could not inspect the VM Promise.prototype.then method.");
1022
- const nativeThen = nativeThenDescriptor.value;
1023
- let stopWorkflowPromiseHook;
1024
- let value;
1025
- try {
1026
- // Some hosts freeze built-ins in every realm, which makes then read-only. The promise hooks
1027
- // below still track observation, so skip the wrapper rather than fail every workflow.
1028
- if (nativeThenDescriptor.configurable) Object.defineProperty(nativePromisePrototype, "then", {
1029
- ...nativeThenDescriptor,
1030
- value: function workflowPromiseThen(...args) {
1031
- if (isDirectWorkflowScriptPromiseHandlerCall() || suppressNativePromiseConsumption > 0) {
1032
- return withSuppressedNativePromiseConsumption(() => Reflect.apply(nativeThen, this, args));
1033
- }
1034
- return Reflect.apply(nativeThen, this, args);
1035
- },
1036
- });
1037
- stopWorkflowPromiseHook = createWorkflowPromiseHook({
1038
- before(promise) {
1039
- activeNativePromises.push(promise);
1040
- },
1041
- after(promise) {
1042
- const index = activeNativePromises.lastIndexOf(promise);
1043
- if (index !== -1) activeNativePromises.splice(index, 1);
1044
- },
1045
- init(promise, parent) {
1046
- const childTracker = nativePromiseTracker(promise);
1047
- if (!parent) return;
1048
- nativePromiseParents.set(promise, parent);
1049
- const parentTracker = nativePromiseTracker(parent);
1050
- addTrackerDependency(childTracker, parentTracker);
1051
- const activePromise = activeNativePromises.at(-1);
1052
- if (activePromise && activePromise !== parent) {
1053
- addTrackerDependency(nativePromiseTracker(activePromise), parentTracker);
1054
- } else if (!activePromise && suppressNativePromiseConsumption === 0) {
1055
- markTrackedObservationsConsumed(parentTracker);
1056
- }
1057
- },
1058
- });
1059
- const workflowResultPromise = compiled.runInContext(context);
1060
- topLevelWorkflowPromise = workflowResultPromise;
1061
- markTrackedObservationsConsumed(nativePromiseTracker(workflowResultPromise));
1062
- value = await workflowResultPromise;
1063
- } finally {
1064
- try {
1065
- stopWorkflowPromiseHook?.();
1066
- } finally {
1067
- try {
1068
- if (nativeThenDescriptor.configurable) Object.defineProperty(nativePromisePrototype, "then", nativeThenDescriptor);
1069
- } finally {
1070
- topLevelWorkflowPromise = undefined;
1071
- activeNativePromises.length = 0;
1072
- suppressNativePromiseConsumption = 0;
1073
- nativePromiseTrackers = new WeakMap();
1074
- nativePromiseParents = new WeakMap();
1075
- }
1076
- }
1077
- }
1078
- const persistedValue = value === undefined ? null : omitUndefinedWorkflowValues(value);
1079
- try {
1080
- assertJsonValue(persistedValue, "return");
1081
- } catch (error) {
1082
- parentPort.postMessage({ type: "error", errorKind: "return-serialization", errorPhase: "return-serialization", error: formatWorkflowScriptError(error) });
1083
- return;
1084
- }
1085
- parentPort.postMessage({ type: "complete", value: persistedValue });
1086
- } catch (error) {
1087
- postWorkflowError(error);
1088
- }
1089
- });
1090
- `;
1091
- function isWorkflowScriptFailureKind(value) {
1092
- return value === "validation" || value === "script" || value === "child" || value === "return-serialization" || value === "timeout" || value === "detached-child" || value === "runtime";
1093
- }
1094
- function taggedWorkflowError(message, kind) {
1095
- return Object.assign(new Error(message), { workflowErrorKind: kind });
1096
- }
1097
- export class WorkflowScriptError extends Error {
1098
- partial;
1099
- errorKind;
1100
- constructor(message, partial, errorKind, options) {
1101
- super(message, options);
1102
- this.name = "WorkflowScriptError";
1103
- this.partial = partial;
1104
- this.errorKind = errorKind;
1105
- }
1106
- }
1107
- function combinedAbortSignal(signals) {
1108
- const controller = new AbortController();
1109
- const abort = (signal) => {
1110
- if (controller.signal.aborted)
1111
- return;
1112
- controller.abort(signal.reason);
1113
- };
1114
- for (const signal of signals) {
1115
- if (signal.aborted) {
1116
- abort(signal);
1117
- break;
1118
- }
1119
- signal.addEventListener("abort", () => abort(signal), { once: true });
1120
- }
1121
- return controller.signal;
1122
- }
1123
- function isRecord(value) {
1124
- return !!value && typeof value === "object" && !Array.isArray(value);
1125
- }
1126
- function isAcceptanceMetadataRecovery(result) {
1127
- return !result.ok
1128
- && result.recovery?.status === "available-for-review"
1129
- && result.recovery.reason === "acceptance-metadata-rejected";
1130
- }
1131
- const RECOVERY_REVIEW_MUTATION_VERB_PATTERN = /\b(?:add(?:ing)?|append(?:ing)?|apply(?:ing)?|cherry[ -]pick(?:ing)?|change|changing|clean(?:ing)?|commit(?:ting)?|cop(?:y|ying)|create|creating|delete|deleting|edit(?:ing)?|fix(?:ing)?|implement(?:ing)?|insert(?:ing)?|make|making|merge|merging|mov(?:e|ing)|modify(?:ing)?|mutate|mutating|open(?:ing)?|patch(?:ing)?|prepend(?:ing)?|push(?:ing)?|rebase|rebasing|refactor(?:ing)?|remove|removing|rename|renaming|replace|replacing|revert(?:ing)?|revise|revising|rewrite|rewriting|sav(?:e|ing)|stag(?:e|ing)|stash(?:ing)?|tag(?:ging)?|touch(?:ing)?|update|updating|write|writing)\b/i;
1132
- const RECOVERY_REVIEW_READ_ONLY_PATTERN = /\b(?:read[- ]only|review only|only return findings|return findings only|suggest fixes only|without\s+(?:editing|modifying|changing|writing|touching)|do not\s+(?:edit|modify|change|write|touch)|don't\s+(?:edit|modify|change|write|touch)|must not\s+(?:edit|modify|change|write|touch))\b/i;
1133
- const RECOVERY_REVIEW_NO_MUTATION_CLAUSE_PATTERN = /\b(?:do not|don't|must not)\s+(?:edit|modify|change|write|touch)(?:\s+files?)?(?:\s*,\s*(?:commit|push|comment|merge|launch(?:\s+subagents?)?)(?=\s*(?:,|\bor\b|[.;!?\n)]|$)))*(?:\s*,?\s*or\s+(?:commit|push|comment|merge|launch(?:\s+subagents?)?)(?=\s*(?:[.;!?\n)]|$)))?/gi;
1134
- const RECOVERY_REVIEW_DELIVERABLE_PATTERN = /\b(?:compose|create|draft|prepare|produce|write)\s+(?:(?:a|an|the|your)\s+)?(?:findings?|review|report|summary|analysis|recommendations?)(?:\s+(?:to|at|in)\s+\S+)?/gi;
1135
- const RECOVERY_REVIEW_CONTEXT_OBJECT_PATTERN = /\breview\s+(?:(?:the|this|that|saved)\s+)?(?:patch|diff|changes?|implementation|report)\b/gi;
1136
- const RECOVERY_REVIEW_MUTATION_NOUN_CONTEXT_PATTERN = /\b(?:later\s+real\s+)?update\s+imperatives?\b/gi;
1137
- const RECOVERY_REVIEW_PRIOR_FIX_CONTEXT_PATTERN = /\bthe\s+prior\s+fix\s+keeps\b/gi;
1138
- const RECOVERY_REVIEW_DETECTION_CONTEXT_PATTERN = /\b(?:mutation\s+detection\s+now\s+includes\s+move\/rename\/copy\s+file\s+mutation\s+imperatives|delegation\s+detection\s+now\s+blocks\s+get\/let\/have\/tell\/ask\s+follow-up\s+forms)(?=[,.;!?\n]|\b(?:and|but|then|however|nevertheless|nonetheless|yet)\b|$)/gi;
1139
- const RECOVERY_REVIEW_PATTERN_CHANGE_CONTEXT_PATTERN = /\bRECOVERY_REVIEW_MUTATION_VERB_PATTERN\s+now\s+includes\s+append,\s+prepend,\s+and\s+sav(?:e|ing)\b(?=\s*(?:[,.;!?\n)]|$))/gi;
1140
- const RECOVERY_REVIEW_GIT_PATTERN_CHANGE_CONTEXT_PATTERN = /\bfixed\s+mutating\s+git\s+follow-up\s+bypasses\b|\b(?:added|adding)\s+[a-z][a-z-]*(?:\/[a-z][a-z-]*)*(?:(?:\s*,\s*(?:and\s+)?|\s+and\s+)[a-z][a-z-]*(?:\/[a-z][a-z-]*)*)*\s+to\s+the\s+(?:mutation\s+imperative|mutating\s+git\s+command)\s+pattern\b|\band\s+[a-z][a-z-]*(?:\/[a-z][a-z-]*)*(?:(?:\s*,\s*(?:and\s+)?|\s+and\s+)[a-z][a-z-]*(?:\/[a-z][a-z-]*)*)*\s+to\s+the\s+mutating\s+git\s+command\s+pattern\b/gi;
1141
- const RECOVERY_REVIEW_VALIDATION_EVIDENCE_PATTERN = /\bvalidation(?:\s+after\s+fix)?\s*:/gi;
1142
- const RECOVERY_REVIEW_CONTRACT_PROHIBITION_PATTERN = /\b(?:do not|don't|must not)\s+(?:mutate\s+durable\s+state|launch\s+(?:mutating|destructive|mutating\/destructive)\s+work)(?:\s+or\s+(?:mutate\s+durable\s+state|launch\s+(?:mutating|destructive|mutating\/destructive)\s+work))*/gi;
1143
- const RECOVERY_REVIEW_ONLY_REVIEW_CONTRACT_PATTERN = /\bmay\s+only\s+launch\s+explicit\s+read-only\s+review\s+children\s+with\s+acceptance:false\b/gi;
1144
- const RECOVERY_REVIEW_BLOCKED_CONTEXT_FRAGMENT_PATTERN = /\bstate\.set, runs\.host, runs\.steer, ordinary\/mutating children, and destructive command wording are blocked(?=[,.;!?\n)\]}]|$)/gi;
1145
- const RECOVERY_REVIEW_REGRESSION_EVIDENCE_PATTERN = /\b(?:existing regressions cover plain rm and git clean\/reset\/restore|prior regressions covering rm\/git clean as evidence only)(?=[,.;!?\n)\]}]|$)/gi;
1146
- const RECOVERY_REVIEW_BLOCKED_QUOTED_EXAMPLE_PATTERN = /(?:`[^`\n]+`|'[^'\n]+'|"[^"\n]+")(?:(?:\s*,\s*(?:and\s+)?|\s+and\s+)(?:`[^`\n]+`|'[^'\n]+'|"[^"\n]+"))*\s+(?:is|are|remains?)\s+(?:blocked|(?:an?\s+)?blocked\s+examples?)(?=[,.;!?\n)\]}]|$)/gi;
1147
- const RECOVERY_REVIEW_CONTEXT_QUOTED_EXAMPLE_PATTERN = /\b(?:examples?|phrasing|forms|variants):\s*(?:`[^`\n]+`|'[^'\n]+'|"[^"\n]+")(?:(?:\s*,\s*(?:and\s+)?|\s+and\s+)(?:`[^`\n]+`|'[^'\n]+'|"[^"\n]+"))*/gi;
1148
- const RECOVERY_REVIEW_LISTED_BLOCKED_EXAMPLE_PATTERN = /(?:^|[.;!?\n]\s*)blocked\s+examples:\s*(?:\r?\n[ \t]*(?:[-*]|\d+[.)])\s+[^\r\n]+)+/gim;
1149
- const RECOVERY_REVIEW_BLOCKS_QUOTED_EXAMPLE_PATTERN = /\b(?:this\s+)?blocks?\s+examples?\s+like\s+(?:`[^`\n]+`|'[^'\n]+'|"[^"\n]+")(?:(?:\s*,\s*(?:and\s+)?|\s+and\s+)(?:`[^`\n]+`|'[^'\n]+'|"[^"\n]+"))*/gi;
1150
- const RECOVERY_REVIEW_EXAMPLES_LIKE_BLOCKED_PATTERN = /\bexamples?\s+like\s+(?:`[^`\n]+`|'[^'\n]+'|"[^"\n]+")(?:(?:\s*,\s*(?:and\s+)?|\s+and\s+)(?:`[^`\n]+`|'[^'\n]+'|"[^"\n]+"))*\s+(?:is|are|remains?)\s+blocked\b/gi;
1151
- const RECOVERY_REVIEW_QUOTED_VISIBLE_BLOCKED_PATTERN = /(?:\b(?:(?:the\s+)?examples?|commands?\s+hidden\s+in)\s+|(?:^|[\s([{]))(?:`[^`\n]+`|'[^'\n]+'|"[^"\n]+")(?:(?:\s*,\s*(?:and\s+|or\s+)?|\s+(?:and|or)\s+)(?:`[^`\n]+`|'[^'\n]+'|"[^"\n]+"))*\s+(?:(?:is|are|remains?)\s+)?visible\s+and\s+blocked\b/gi;
1152
- const RECOVERY_REVIEW_PROMPTS_LIKE_BLOCKED_PATTERN = /\bdescribed\s+prompts?\s+like\s+Run\s+git\s+rebase\s+main,\s+git\s+rebase\s+main,\s+Run\s+git\s+cherry-pick\s+abc123,\s+cherry-pick\s+abc123,\s+and\s+Stage\s+the\s+changed\s+files\s+as\s+blocked\b/gi;
1153
- const RECOVERY_REVIEW_GIT_MUTATIONS_BROADER_CONTEXT_PATTERN = /\bpositive\s+git\s+mutations\s+are\s+broader:\s*git\s+branch\s+-D\s+old,\s+git\s+tag\s+-d\s+v1\.0,\s+git\s+stash,\s+git\s+revert\s+abc123,\s+and\s+natural\s+cherry\s+pick\s+abc123\s+now\s+trips?\s+the\s+recovery\s+barrier\b/gi;
1154
- const RECOVERY_REVIEW_GIT_COVERAGE_CONTEXT_PATTERN = /\bbroadened\s+positive\s+git\s+mutation\s+coverage\s+for\s+natural\s+`cherry\s+pick`,\s+`revert`,\s+`stash`,\s+`tag`,\s+plus\s+git\s+`branch\|revert\|stash\|tag`/gi;
1155
- const RECOVERY_REVIEW_REGRESSION_QUOTED_EXAMPLE_PATTERN = /\b(?:added\s+)?exact\s+regressions?\s+for\s+(?:`[^`\n]+`|'[^'\n]+'|"[^"\n]+")(?:(?:\s*,\s*(?:and\s+)?|\s+and\s+)(?:`[^`\n]+`|'[^'\n]+'|"[^"\n]+"))*/gi;
1156
- const RECOVERY_REVIEW_REGRESSION_ANAPHORIC_EXAMPLE_PATTERN = /\b(?:added\s+)?exact\s+regressions?\s+for\s+(?:do|run|execute|perform|apply)\s+(?:it|that|this|(?:the\s+)?(?:(?:previous(?:ly)?|prior|above|quoted|blocked)\s+){0,4}(?:command|example|operation|action|phrase|instruction|request))(?:[\s,]+(?:now|still|again|really|actually|immediately)){0,3}[\s,]+anyway(?:(?:\s*,\s*(?:and\s+)?|\s+and\s+)(?:do|run|execute|perform|apply)\s+(?:it|that|this|(?:the\s+)?(?:(?:previous(?:ly)?|prior|above|quoted|blocked)\s+){0,4}(?:command|example|operation|action|phrase|instruction|request))(?:[\s,]+(?:now|still|again|really|actually|immediately)){0,3}[\s,]+anyway)*/gi;
1157
- const RECOVERY_REVIEW_REGRESSION_FOLLOWED_BY_ANAPHORIC_PATTERN = /\badded\s+(?:exact\s+)?regressions?\s+for\s+quoted\s+rm\s+remaining\s+blocked\s+followed\s+by\s+execute\s+the\s+previous\s+command\b(?=\s*(?:[,.;!?\n)]|\bwhile\b|$))/gi;
1158
- const RECOVERY_REVIEW_REGRESSION_FOLLOWED_BY_NAMED_RM_PATTERN = /\b(?:added\s+)?(?:exact\s+)?regressions?\s+for\s+quoted\s+rm\s+remaining\s+blocked\s+followed\s+by\s+(?:do|run|execute|perform|apply)\s+(?:it|that|this|(?:the\s+)?(?:(?:previous(?:ly)?|prior|above|quoted|blocked)\s+){0,4}(?:command|example|operation|action|phrase|instruction|request))(?:[\s,]+(?:now|still|again|really|actually|immediately)){0,3}(?:[\s,]+anyway)?(?=\s*(?:[,.;!?\n)]|\bwhile\b|$))/gi;
1159
- const RECOVERY_REVIEW_BLOCKED_LIVE_VARIANT_CONTEXT_PATTERN = /\b(?:while\s+)?keeping\s+live-command\s+variants\s+such\s+as\s+followed\s+by\s+execute\s+the\s+previous\s+command\s+then\s+update\s+tests\s+blocked\b(?=\s*(?:[,.;!?\n)]|$))/gi;
1160
- const RECOVERY_REVIEW_ANAPHORIC_REFERENCES_CONTEXT_PATTERN = /\bdirect\s+anaphoric\s+references\s+now\s+include\s+numeric\s+and\s+word\s+ordinals\s+through\s+tenth\s+plus\s+one,\s+so\s+(?:do|run|execute|perform|apply)\s+(?:it|that|this|(?:the\s+)?(?:(?:\d+(?:st|nd|rd|th)|first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|last|next|previous(?:ly)?|prior|above|quoted|blocked)\s+){0,4}(?:command|example|operation|action|phrase|instruction|request|one))(?:[\s,]+(?:right|now|still|again|really|actually|immediately)){0,4}[\s,]+anyway(?:(?:\s*,\s*(?:and\s+)?|\s+and\s+)(?:do|run|execute|perform|apply)\s+(?:it|that|this|(?:the\s+)?(?:(?:\d+(?:st|nd|rd|th)|first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|last|next|previous(?:ly)?|prior|above|quoted|blocked)\s+){0,4}(?:command|example|operation|action|phrase|instruction|request|one))(?:[\s,]+(?:right|now|still|again|really|actually|immediately)){0,4}[\s,]+anyway)*\s+(?:is|are|remains?)\s+blocked\b(?:\s+after\s+quoted\s+destructive\s+examples\s+are\s+scrubbed)?/gi;
1161
- const RECOVERY_REVIEW_NO_ANAPHORIC_MUTATION_CLAUSE_PATTERN = /\b(?:do not|don't|must not)\s+(?:do|run|execute|perform|apply)\s+(?:it|that|this|(?:the\s+)?(?:(?:\d+(?:st|nd|rd|th)|first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|last|next|previous(?:ly)?|prior|above|quoted|blocked)\s+){0,4}(?:command|example|operation|action|phrase|instruction|request|one))(?:(?!\b(?:and|but|then|however|nevertheless|nonetheless|yet)\b)[^,.;!?\n—–-]){0,80}/gi;
1162
- const RECOVERY_REVIEW_NO_DELEGATION_CLAUSE_PATTERN = /\b(?:do not|don't|must not)\s+(?:(?:launch|start|spawn|run)\b(?:(?!\b(?:and|but|then|however|nevertheless|nonetheless|yet)\b)[^,.;!?\n])*(?:workers?|reviewers?|agents?|subagents?|children|child|runs?)|(?:get|let|request|hand\s+off|assign|use|have|tell)\b(?:(?!\b(?:and|but|then|however|nevertheless|nonetheless|yet)\b)[^,.;!?\n])*(?:workers?|reviewers?|agents?|subagents?|children|child)|(?:get|let|have|tell|request)\b(?:(?!\b(?:and|but|then|however|nevertheless|nonetheless|yet)\b)[^,.;!?\n])*(?:review|implementation|fix(?:es)?|changes?|follow-up)\b(?:(?!\b(?:and|but|then|however|nevertheless|nonetheless|yet)\b)[^,.;!?\n])*\b(?:from|with|via|by)\b(?:(?!\b(?:and|but|then|however|nevertheless|nonetheless|yet)\b)[^,.;!?\n])*(?:workers?|reviewers?|agents?|subagents?|children|child)|ask\b(?:(?!\b(?:and|but|then|however|nevertheless|nonetheless|yet)\b)[^,.;!?\n])*(?:(?:workers?|reviewers?|agents?|subagents?|children|child)\b(?:(?!\b(?:and|but|then|however|nevertheless|nonetheless|yet)\b)[^,.;!?\n])*\b(?:continue|implement|review|fix|edit|write|modify|change|patch|update|delete|remove|create|follow-up)|(?:review|implementation|fix(?:es)?|changes?|follow-up)\b(?:(?!\b(?:and|but|then|however|nevertheless|nonetheless|yet)\b)[^,.;!?\n])*\b(?:from|via)\b(?:(?!\b(?:and|but|then|however|nevertheless|nonetheless|yet)\b)[^,.;!?\n])*(?:workers?|reviewers?|agents?|subagents?|children|child)))\b/gi;
1163
- const RECOVERY_REVIEW_DELEGATION_PATTERN = /\b(?:launch|start|spawn|run)\b[^,.;!?\n]*(?:workers?|reviewers?|agents?|subagents?|children|child|runs?)\b|\b(?:delegate|hand\s+off|assign)\s+(?:remediation|implementation(?:\s+follow-up)?|changes?|fix(?:es)?|follow-up)\s+to\s+(?:(?:a|an|the)\s+)?(?:workers?|reviewers?|agents?|subagents?|children|child)\b|\b(?:get|let|have|tell|request)\b[^,.;!?\n]*(?:workers?|reviewers?|agents?|subagents?|children|child)\b[^,.;!?\n]*\b(?:continue|implement|review|fix|edit|write|modify|change|patch|update|delete|remove|create|follow-up)\b|\b(?:get|let|have|tell|request)\b[^,.;!?\n]*(?:review|implementation|fix(?:es)?|changes?|follow-up)\b[^,.;!?\n]*\b(?:from|with|via|by)\b[^,.;!?\n]*(?:workers?|reviewers?|agents?|subagents?|children|child)\b|\bask\b[^,.;!?\n]*(?:(?:workers?|reviewers?|agents?|subagents?|children|child)\b[^,.;!?\n]*\b(?:continue|implement|review|fix|edit|write|modify|change|patch|update|delete|remove|create|follow-up)|(?:review|implementation|fix(?:es)?|changes?|follow-up)\b[^,.;!?\n]*\b(?:from|via)\b[^,.;!?\n]*(?:workers?|reviewers?|agents?|subagents?|children|child))\b|\buse\b[^,.;!?\n]*(?:workers?|reviewers?|agents?|subagents?|children|child|runs?)\s+(?:for|to)\s+(?:implementation|follow-up|remediation|fix|edit|write|modify|change|patch|update|delete|remove|create)\b/i;
1164
- const RECOVERY_REVIEW_ANAPHORIC_MUTATION_PATTERN = /\b(?:do|run|execute|perform|apply)\s+(?:it|that|this|(?:the\s+)?(?:(?:\d+(?:st|nd|rd|th)|first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|last|next|previous(?:ly)?|prior|above|quoted|blocked)\s+){0,4}(?:command|example|operation|action|phrase|instruction|request|one))(?!(?:\s+(?:(?:now|still|also|already)\s+)*(?:is|are|remains?)\s+blocked\b))(?:(?:[\s,]+\w+){0,4}[\s,]+anyway|(?:(?!\b(?:and|but|then|however|nevertheless|nonetheless|yet)\b)[^,.;!?\n]){0,80})(?=\s*(?:[,.;!?\n)]|\b(?:and|but|then|however|nevertheless|nonetheless|yet)\b|$))/i;
1165
- const RECOVERY_REVIEW_DESTRUCTIVE_COMMAND_PATTERN = /(?:^|[\s;,.`'"([{])(?:\S*\/)?(?:rm|rmdir|unlink|truncate|mv|cp|chmod|chown)\b|\bgit\b(?:\s+(?:-[A-Za-z](?:\s+(?:"[^"\n]*"|'[^'\n]*'|\S+))?|--(?:git-dir|work-tree|namespace|exec-path|config-env)(?:=(?:"[^"\n]*"|'[^'\n]*'|\S+)|\s+(?:"[^"\n]*"|'[^'\n]*'|\S+))|--[A-Za-z0-9-]+(?:=(?:"[^"\n]*"|'[^'\n]*'|\S+))?))*\s+(?:add|branch|cherry-pick|clean|commit|merge|rebase|reset|restore|revert|stash|tag|checkout|switch)\b/i;
1166
- const RECOVERY_REVIEW_DASH_LIVE_ACTION_PATTERN = /(?:[—–]|--|\s-\s|:|\s\/\s)\s*(?:then\s+)?(?:(?:add|append|apply|change|cherry[ -]pick|clean|commit|copy|create|delete|edit|fix|implement|insert|make|merge|move|modify|mutate|open|patch|prepend|push|rebase|refactor|remove|rename|replace|revert|revise|rewrite|save|stage|stash|tag|touch|update|write)\b|(?:launch|start|spawn|run)\b[^,.;!?\n]*(?:workers?|reviewers?|agents?|subagents?|children|child|runs?)\b|(?:\S*\/)?(?:rm|rmdir|unlink|truncate|mv|cp|chmod|chown)\b|git\b[^,.;!?\n]*\b(?:add|branch|cherry-pick|clean|commit|merge|rebase|reset|restore|revert|stash|tag|checkout|switch)\b)/i;
1167
- function isExplicitReadOnlyRecoveryReview(params) {
1168
- const agent = typeof params.agent === "string" ? params.agent.trim() : "";
1169
- const task = typeof params.task === "string" ? params.task.trim() : "";
1170
- const taskDestructiveCommandText = task
1171
- .replace(RECOVERY_REVIEW_BLOCKED_CONTEXT_FRAGMENT_PATTERN, " ")
1172
- .replace(RECOVERY_REVIEW_REGRESSION_EVIDENCE_PATTERN, " ")
1173
- .replace(RECOVERY_REVIEW_BLOCKED_QUOTED_EXAMPLE_PATTERN, " ")
1174
- .replace(RECOVERY_REVIEW_CONTEXT_QUOTED_EXAMPLE_PATTERN, " ")
1175
- .replace(RECOVERY_REVIEW_LISTED_BLOCKED_EXAMPLE_PATTERN, " ")
1176
- .replace(RECOVERY_REVIEW_BLOCKS_QUOTED_EXAMPLE_PATTERN, " ")
1177
- .replace(RECOVERY_REVIEW_EXAMPLES_LIKE_BLOCKED_PATTERN, " ")
1178
- .replace(RECOVERY_REVIEW_QUOTED_VISIBLE_BLOCKED_PATTERN, " ")
1179
- .replace(RECOVERY_REVIEW_PROMPTS_LIKE_BLOCKED_PATTERN, " ")
1180
- .replace(RECOVERY_REVIEW_GIT_MUTATIONS_BROADER_CONTEXT_PATTERN, " ")
1181
- .replace(RECOVERY_REVIEW_GIT_COVERAGE_CONTEXT_PATTERN, " ")
1182
- .replace(RECOVERY_REVIEW_REGRESSION_FOLLOWED_BY_NAMED_RM_PATTERN, " ");
1183
- const taskDashLiveActionText = task
1184
- .replace(RECOVERY_REVIEW_DELIVERABLE_PATTERN, " ")
1185
- .replace(RECOVERY_REVIEW_CONTEXT_OBJECT_PATTERN, " ")
1186
- .replace(RECOVERY_REVIEW_MUTATION_NOUN_CONTEXT_PATTERN, " ")
1187
- .replace(RECOVERY_REVIEW_PRIOR_FIX_CONTEXT_PATTERN, " ")
1188
- .replace(RECOVERY_REVIEW_DETECTION_CONTEXT_PATTERN, " ")
1189
- .replace(RECOVERY_REVIEW_PATTERN_CHANGE_CONTEXT_PATTERN, " ")
1190
- .replace(RECOVERY_REVIEW_GIT_PATTERN_CHANGE_CONTEXT_PATTERN, " ")
1191
- .replace(RECOVERY_REVIEW_VALIDATION_EVIDENCE_PATTERN, " ")
1192
- .replace(RECOVERY_REVIEW_CONTRACT_PROHIBITION_PATTERN, " ")
1193
- .replace(RECOVERY_REVIEW_ONLY_REVIEW_CONTRACT_PATTERN, " ")
1194
- .replace(RECOVERY_REVIEW_BLOCKED_QUOTED_EXAMPLE_PATTERN, " ")
1195
- .replace(RECOVERY_REVIEW_CONTEXT_QUOTED_EXAMPLE_PATTERN, " ")
1196
- .replace(RECOVERY_REVIEW_LISTED_BLOCKED_EXAMPLE_PATTERN, " ")
1197
- .replace(RECOVERY_REVIEW_BLOCKS_QUOTED_EXAMPLE_PATTERN, " ")
1198
- .replace(RECOVERY_REVIEW_EXAMPLES_LIKE_BLOCKED_PATTERN, " ")
1199
- .replace(RECOVERY_REVIEW_QUOTED_VISIBLE_BLOCKED_PATTERN, " ")
1200
- .replace(RECOVERY_REVIEW_PROMPTS_LIKE_BLOCKED_PATTERN, " ")
1201
- .replace(RECOVERY_REVIEW_GIT_MUTATIONS_BROADER_CONTEXT_PATTERN, " ")
1202
- .replace(RECOVERY_REVIEW_GIT_COVERAGE_CONTEXT_PATTERN, " ")
1203
- .replace(RECOVERY_REVIEW_REGRESSION_QUOTED_EXAMPLE_PATTERN, " ")
1204
- .replace(RECOVERY_REVIEW_REGRESSION_ANAPHORIC_EXAMPLE_PATTERN, " ")
1205
- .replace(RECOVERY_REVIEW_REGRESSION_FOLLOWED_BY_ANAPHORIC_PATTERN, " ")
1206
- .replace(RECOVERY_REVIEW_BLOCKED_LIVE_VARIANT_CONTEXT_PATTERN, " ")
1207
- .replace(RECOVERY_REVIEW_ANAPHORIC_REFERENCES_CONTEXT_PATTERN, " ");
1208
- const taskMutationText = task
1209
- .replace(RECOVERY_REVIEW_DELIVERABLE_PATTERN, " ")
1210
- .replace(RECOVERY_REVIEW_CONTEXT_OBJECT_PATTERN, " ")
1211
- .replace(RECOVERY_REVIEW_MUTATION_NOUN_CONTEXT_PATTERN, " ")
1212
- .replace(RECOVERY_REVIEW_PRIOR_FIX_CONTEXT_PATTERN, " ")
1213
- .replace(RECOVERY_REVIEW_DETECTION_CONTEXT_PATTERN, " ")
1214
- .replace(RECOVERY_REVIEW_PATTERN_CHANGE_CONTEXT_PATTERN, " ")
1215
- .replace(RECOVERY_REVIEW_GIT_PATTERN_CHANGE_CONTEXT_PATTERN, " ")
1216
- .replace(RECOVERY_REVIEW_VALIDATION_EVIDENCE_PATTERN, " ")
1217
- .replace(RECOVERY_REVIEW_CONTRACT_PROHIBITION_PATTERN, " ")
1218
- .replace(RECOVERY_REVIEW_ONLY_REVIEW_CONTRACT_PATTERN, " ")
1219
- .replace(RECOVERY_REVIEW_BLOCKED_CONTEXT_FRAGMENT_PATTERN, " ")
1220
- .replace(RECOVERY_REVIEW_REGRESSION_EVIDENCE_PATTERN, " ")
1221
- .replace(RECOVERY_REVIEW_BLOCKED_QUOTED_EXAMPLE_PATTERN, " ")
1222
- .replace(RECOVERY_REVIEW_CONTEXT_QUOTED_EXAMPLE_PATTERN, " ")
1223
- .replace(RECOVERY_REVIEW_LISTED_BLOCKED_EXAMPLE_PATTERN, " ")
1224
- .replace(RECOVERY_REVIEW_BLOCKS_QUOTED_EXAMPLE_PATTERN, " ")
1225
- .replace(RECOVERY_REVIEW_EXAMPLES_LIKE_BLOCKED_PATTERN, " ")
1226
- .replace(RECOVERY_REVIEW_QUOTED_VISIBLE_BLOCKED_PATTERN, " ")
1227
- .replace(RECOVERY_REVIEW_PROMPTS_LIKE_BLOCKED_PATTERN, " ")
1228
- .replace(RECOVERY_REVIEW_GIT_MUTATIONS_BROADER_CONTEXT_PATTERN, " ")
1229
- .replace(RECOVERY_REVIEW_GIT_COVERAGE_CONTEXT_PATTERN, " ")
1230
- .replace(RECOVERY_REVIEW_REGRESSION_QUOTED_EXAMPLE_PATTERN, " ")
1231
- .replace(RECOVERY_REVIEW_REGRESSION_ANAPHORIC_EXAMPLE_PATTERN, " ")
1232
- .replace(RECOVERY_REVIEW_REGRESSION_FOLLOWED_BY_ANAPHORIC_PATTERN, " ")
1233
- .replace(RECOVERY_REVIEW_BLOCKED_LIVE_VARIANT_CONTEXT_PATTERN, " ")
1234
- .replace(RECOVERY_REVIEW_ANAPHORIC_REFERENCES_CONTEXT_PATTERN, " ")
1235
- .replace(RECOVERY_REVIEW_NO_ANAPHORIC_MUTATION_CLAUSE_PATTERN, " ")
1236
- .replace(RECOVERY_REVIEW_NO_DELEGATION_CLAUSE_PATTERN, " ")
1237
- .replace(RECOVERY_REVIEW_NO_MUTATION_CLAUSE_PATTERN, " ")
1238
- .replace(new RegExp(RECOVERY_REVIEW_READ_ONLY_PATTERN.source, "gi"), " ");
1239
- return params.acceptance === false
1240
- && agent !== ""
1241
- && /\b(?:advisor|oracle|review|reviewer)\b/i.test(agent)
1242
- && RECOVERY_REVIEW_READ_ONLY_PATTERN.test(task)
1243
- && !RECOVERY_REVIEW_DESTRUCTIVE_COMMAND_PATTERN.test(taskDestructiveCommandText)
1244
- && !RECOVERY_REVIEW_MUTATION_VERB_PATTERN.test(taskMutationText)
1245
- && !RECOVERY_REVIEW_DELEGATION_PATTERN.test(taskMutationText)
1246
- && !RECOVERY_REVIEW_ANAPHORIC_MUTATION_PATTERN.test(taskMutationText)
1247
- && !RECOVERY_REVIEW_DESTRUCTIVE_COMMAND_PATTERN.test(taskMutationText)
1248
- && !RECOVERY_REVIEW_DASH_LIVE_ACTION_PATTERN.test(taskDashLiveActionText);
1249
- }
1250
- function recoveryBarrierMessage(sourceKey, target) {
1251
- return `Run '${target}' cannot launch after run '${sourceKey}' returned rejected acceptance recovery; only explicit read-only review children with acceptance:false may follow.`;
1252
- }
1253
- function isPlainJsonObject(value) {
1254
- if (!isRecord(value))
1255
- return false;
1256
- const prototype = Object.getPrototypeOf(value);
1257
- return prototype === null || prototype === Object.prototype;
1258
- }
1259
- function parseWorkflowResumeReference(value) {
1260
- if (!isRecord(value))
1261
- return undefined;
1262
- const fields = Object.keys(value);
1263
- if (fields.some((field) => field !== "workflowRunId" && field !== "key" && field !== "latest"))
1264
- throw new Error("keyed resume contains unsupported fields.");
1265
- if (typeof value.workflowRunId !== "string" || !value.workflowRunId.trim())
1266
- throw new Error("keyed resume workflowRunId must be non-empty.");
1267
- const key = validateKey(value.key, "keyed resume");
1268
- if (value.latest !== true)
1269
- throw new Error("keyed resume requires latest: true.");
1270
- return { workflowRunId: value.workflowRunId.trim(), key, latest: true };
1271
- }
1272
- function omitUndefinedWorkflowValues(value, seen = new Set()) {
1273
- if (value === null || typeof value !== "object")
1274
- return value;
1275
- if (seen.has(value))
1276
- return value;
1277
- seen.add(value);
1278
- const normalized = Array.isArray(value)
1279
- ? value.map((entry) => entry === undefined ? null : omitUndefinedWorkflowValues(entry, seen))
1280
- : isPlainJsonObject(value)
1281
- ? Object.fromEntries(Object.entries(value).flatMap(([key, entry]) => entry === undefined ? [] : [[key, omitUndefinedWorkflowValues(entry, seen)]]))
1282
- : value;
1283
- seen.delete(value);
1284
- return normalized;
1285
- }
1286
- function omitNonJsonWorkflowResultMetadata(value) {
1287
- const normalized = omitUndefinedWorkflowValues(value);
1288
- if (!isPlainJsonObject(normalized) || !Object.hasOwn(normalized, "results"))
1289
- return normalized;
1290
- try {
1291
- assertWorkflowJsonValue(normalized.results, "runs.run result.results");
1292
- return normalized;
1293
- }
1294
- catch {
1295
- const { results: _results, ...safeResult } = normalized;
1296
- return safeResult;
1297
- }
1298
- }
1299
- export function assertWorkflowJsonValue(value, path = "value", seen = new Set()) {
1300
- if (value === null || typeof value === "string" || typeof value === "boolean")
1301
- return;
1302
- if (typeof value === "number") {
1303
- if (!Number.isFinite(value))
1304
- throw new Error(`${path} must contain only finite JSON numbers.`);
1305
- return;
1306
- }
1307
- if (typeof value !== "object")
1308
- throw new Error(`${path} must be a JSON value; received ${typeof value}.`);
1309
- if (seen.has(value))
1310
- throw new Error(`${path} must not contain cycles.`);
1311
- seen.add(value);
1312
- if (Array.isArray(value)) {
1313
- for (let index = 0; index < value.length; index++) {
1314
- if (!Object.hasOwn(value, index))
1315
- throw new Error(`${path} must not contain sparse array entries.`);
1316
- assertWorkflowJsonValue(value[index], `${path}[${index}]`, seen);
1317
- }
1318
- }
1319
- else {
1320
- const prototype = Object.getPrototypeOf(value);
1321
- if (prototype !== null && prototype !== Object.prototype)
1322
- throw new Error(`${path} must contain only plain JSON objects.`);
1323
- if (Object.getOwnPropertySymbols(value).length > 0)
1324
- throw new Error(`${path} must not contain symbol keys.`);
1325
- for (const [key, entry] of Object.entries(value))
1326
- assertWorkflowJsonValue(entry, `${path}.${key}`, seen);
1327
- }
1328
- seen.delete(value);
1329
- }
1330
- export function formatWorkflowJsonPreview(value, maxLength) {
1331
- try {
1332
- assertWorkflowJsonValue(value);
1333
- const serialized = JSON.stringify(value);
1334
- if (typeof serialized !== "string")
1335
- return undefined;
1336
- // Serialized JSON never ends in "…", so the suffix always means the preview was cut.
1337
- return serialized.length > maxLength ? `${serialized.slice(0, maxLength)}…` : serialized;
1338
- }
1339
- catch {
1340
- return undefined;
1341
- }
1342
- }
1343
- function workflowReturnRecoveryHint(children) {
1344
- if (children.length === 0)
1345
- return " Return only plain JSON data. For a child result, select fields such as { runId: child.runId, ok: child.ok, outputReference: child.outputReference }.";
1346
- const references = children.slice(0, 10).map((child) => {
1347
- const fields = [child.runId ? `runId=${child.runId.slice(0, 500)}` : undefined, child.outputReference ? `outputReference=${child.outputReference.slice(0, 500)}` : undefined, child.artifactPaths[0] ? `artifact=${child.artifactPaths[0].slice(0, 500)}` : undefined].filter((field) => field !== undefined);
1348
- return `'${child.key}'${fields.length > 0 ? ` (${fields.join(", ")})` : ""}`;
1349
- });
1350
- return ` ${children.some((child) => child.state === "running") ? "Child calls returned before return serialization failed; launch receipts do not prove completion." : "Child work completed before return serialization failed."} Recover outputs from: ${references.join(", ")}${children.length > references.length ? `, and ${children.length - references.length} more` : ""}. Return a plain projection such as { runId: child.runId, ok: child.ok, outputReference: child.outputReference }.`;
1351
- }
1352
- /** Display-only preview for the exact simple `return runs.run(key, {...})` form. */
1353
- export function previewSimpleWorkflowRun(script) {
1354
- const body = script?.match(/^\s*return\s+(?:await\s+)?runs\.run\s*\(\s*(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|`[^`$\\]*`)\s*,\s*\{([\s\S]*)\}\s*\)\s*;?\s*$/)?.[1];
1355
- if (body === undefined)
1356
- return undefined;
1357
- const readProperty = (name) => {
1358
- const match = body.match(new RegExp(`(?:^|,)\\s*(?:${name}|["']${name}["'])\\s*:\\s*("(?:\\\\.|[^"\\\\])*"|'(?:\\\\.|[^'\\\\])*'|\u0060[^\u0060$\\\\]*\u0060)`));
1359
- if (!match?.[1])
1360
- return undefined;
1361
- const literal = match[1];
1362
- if (literal.startsWith('"')) {
1363
- try {
1364
- return JSON.parse(literal);
1365
- }
1366
- catch {
1367
- return undefined;
1368
- }
1369
- }
1370
- if (literal.slice(1, -1).includes("\\"))
1371
- return undefined;
1372
- return literal.slice(1, -1);
1373
- };
1374
- const agent = readProperty("agent");
1375
- const task = readProperty("task");
1376
- return { ...(agent !== undefined ? { agent } : {}), ...(task !== undefined ? { task } : {}) };
1377
- }
1378
- function stableJson(value) {
1379
- if (Array.isArray(value))
1380
- return `[${value.map(stableJson).join(",")}]`;
1381
- if (isRecord(value))
1382
- return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${stableJson(value[key])}`).join(",")}}`;
1383
- return JSON.stringify(value) ?? "undefined";
1384
- }
1385
- function canonicalRunParams(params) {
1386
- if (params.gate === undefined || params.acceptance !== false)
1387
- return params;
1388
- const { acceptance: _acceptance, ...withoutAcceptance } = params;
1389
- return withoutAcceptance;
1390
- }
1391
- /** Canonical launch-params identity; matches the worker's stableRunJson(canonicalRunParams(params)). */
1392
- export function workflowRunParamsFingerprint(params) {
1393
- return stableJson(canonicalRunParams(params));
1394
- }
1395
- function validateKey(value, owner = "runs.run") {
1396
- if (typeof value !== "string" || !KEY_PATTERN.test(value)) {
1397
- throw new Error(`${owner} key must be 1-128 characters using letters, numbers, '.', '_' or '-', and start with a letter or number.`);
1398
- }
1399
- return value;
1400
- }
1401
- const AST_LOCATION_KEYS = new Set(["type", "start", "end", "loc", "range"]);
1402
- function astNode(value) {
1403
- return Boolean(value) && typeof value === "object" && typeof value.type === "string";
1404
- }
1405
- function literalString(node) {
1406
- if (!astNode(node))
1407
- return undefined;
1408
- if (node.type === "Literal" && typeof node.value === "string")
1409
- return node.value;
1410
- if (node.type === "TemplateLiteral" && Array.isArray(node.expressions) && node.expressions.length === 0 && Array.isArray(node.quasis)) {
1411
- const first = node.quasis[0];
1412
- if (typeof first?.value?.cooked === "string")
1413
- return first.value.cooked;
1414
- }
1415
- return undefined;
1416
- }
1417
- function directRunsCall(node, method) {
1418
- if (!astNode(node) || node.type !== "CallExpression" || !astNode(node.callee) || node.callee.type !== "MemberExpression")
1419
- return false;
1420
- const property = node.callee.computed === true ? literalString(node.callee.property) : astNode(node.callee.property) && node.callee.property.type === "Identifier" ? node.callee.property.name : undefined;
1421
- return property === method && astNode(node.callee.object) && node.callee.object.type === "Identifier" && node.callee.object.name === "runs";
1422
- }
1423
- function validateStaticHostCall(call) {
1424
- const args = Array.isArray(call.arguments) ? call.arguments : [];
1425
- const keyNode = astNode(args[0]) ? args[0] : undefined;
1426
- const params = astNode(args[1]) ? args[1] : undefined;
1427
- const errors = [];
1428
- const key = literalString(keyNode);
1429
- if (keyNode && key !== undefined && !KEY_PATTERN.test(key))
1430
- errors.push({ message: "runs.host key must be 1-128 characters using letters, numbers, '.', '_' or '-', and start with a letter or number.", ...nodeLocation(keyNode) });
1431
- if (!params || params.type !== "ObjectExpression" || !Array.isArray(params.properties) || params.properties.some((property) => !astNode(property) || property.type !== "Property"))
1432
- return errors;
1433
- const allowed = new Set(["kind", "command", "timeoutMs", "output", "role", "provider"]);
1434
- for (const property of params.properties) {
1435
- if (!astNode(property))
1436
- continue;
1437
- const name = staticPropertyKey(property);
1438
- if (name !== undefined && !allowed.has(name))
1439
- errors.push({ message: name === "cwd" ? "runs.host params contain unsupported field 'cwd'. The host step does not accept per-step cwd; commands and relative output paths use the workflow cwd. Set cwd on the outer subagent request, or put a trusted directory change in command (for example, 'cd /path/to/worktree && npm test')." : `runs.host params contain unsupported field '${name}'.`, ...nodeLocation(property) });
1440
- }
1441
- const kindNode = directObjectPropertyValue(params, "kind");
1442
- const commandNode = directObjectPropertyValue(params, "command");
1443
- const timeoutNode = directObjectPropertyValue(params, "timeoutMs");
1444
- const kind = literalString(kindNode);
1445
- const command = literalString(commandNode);
1446
- const timeout = astNode(timeoutNode) && timeoutNode.type === "Literal" ? timeoutNode.value : undefined;
1447
- if (!kindNode)
1448
- errors.push({ message: "runs.host params require kind: 'command'.", ...nodeLocation(params) });
1449
- else if (kind !== undefined && kind !== "command")
1450
- errors.push({ message: "runs.host params kind must be 'command'.", ...nodeLocation(kindNode) });
1451
- if (!commandNode)
1452
- errors.push({ message: "runs.host params require command.", ...nodeLocation(params) });
1453
- else if (command !== undefined && !command.trim())
1454
- errors.push({ message: "runs.host params command must be non-empty.", ...nodeLocation(commandNode) });
1455
- if (!timeoutNode)
1456
- errors.push({ message: "runs.host params require timeoutMs.", ...nodeLocation(params) });
1457
- else if (typeof timeout === "number" && (!Number.isInteger(timeout) || timeout < 1))
1458
- errors.push({ message: "runs.host params timeoutMs must be a positive integer.", ...nodeLocation(timeoutNode) });
1459
- const outputNode = directObjectPropertyValue(params, "output");
1460
- const output = literalString(outputNode);
1461
- if (outputNode && output !== undefined && (!output.trim() || /^[/\\]|(?:^|[/\\])\.\.(?:[/\\]|$)/.test(output)))
1462
- errors.push({ message: "runs.host params output must be a non-empty relative path without traversal.", ...nodeLocation(outputNode) });
1463
- const roleNode = directObjectPropertyValue(params, "role");
1464
- const role = literalString(roleNode);
1465
- if (roleNode && role !== undefined && role !== "ci" && role !== "gate")
1466
- errors.push({ message: "runs.host params role must be 'ci' or 'gate'.", ...nodeLocation(roleNode) });
1467
- return errors;
1468
- }
1469
- function nodeLocation(node) {
1470
- return node.loc ? { line: Math.max(1, node.loc.start.line - 1), column: node.loc.start.column + 1 } : {};
1471
- }
1472
- function walkAst(node, visit, includeNestedFunctions = true) {
1473
- if (Array.isArray(node)) {
1474
- for (const item of node)
1475
- walkAst(item, visit, includeNestedFunctions);
1476
- return;
1477
- }
1478
- if (!astNode(node))
1479
- return;
1480
- visit(node);
1481
- if (!includeNestedFunctions && (node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression"))
1482
- return;
1483
- for (const [key, child] of Object.entries(node)) {
1484
- if (!AST_LOCATION_KEYS.has(key))
1485
- walkAst(child, visit, includeNestedFunctions);
1486
- }
1487
- }
1488
- function bindingPatternContainsName(node, name) {
1489
- if (!astNode(node))
1490
- return false;
1491
- if (node.type === "Identifier")
1492
- return node.name === name;
1493
- if (node.type === "RestElement")
1494
- return bindingPatternContainsName(node.argument, name);
1495
- if (node.type === "AssignmentPattern")
1496
- return bindingPatternContainsName(node.left, name);
1497
- if (node.type === "ArrayPattern" && Array.isArray(node.elements))
1498
- return node.elements.some((element) => bindingPatternContainsName(element, name));
1499
- if (node.type === "ObjectPattern" && Array.isArray(node.properties))
1500
- return node.properties.some((property) => {
1501
- if (!astNode(property))
1502
- return false;
1503
- return property.type === "RestElement"
1504
- ? bindingPatternContainsName(property.argument, name)
1505
- : property.type === "Property" && bindingPatternContainsName(property.value, name);
1506
- });
1507
- return false;
1508
- }
1509
- function definitelyReassignsBinding(node, name) {
1510
- let assignment = node;
1511
- while (astNode(assignment) && assignment.type === "AssignmentExpression" && assignment.operator !== "&&=" && assignment.operator !== "||=" && assignment.operator !== "??=") {
1512
- if (bindingPatternContainsName(assignment.left, name))
1513
- return true;
1514
- assignment = assignment.right;
1515
- }
1516
- return false;
1517
- }
1518
- function lexicalDeclarationContainsName(node, name) {
1519
- if (!astNode(node))
1520
- return false;
1521
- if (node.type === "VariableDeclaration" && node.kind !== "var" && Array.isArray(node.declarations)) {
1522
- return node.declarations.some((declaration) => astNode(declaration) && bindingPatternContainsName(declaration.id, name));
1523
- }
1524
- return (node.type === "FunctionDeclaration" || node.type === "ClassDeclaration") && bindingPatternContainsName(node.id, name);
1525
- }
1526
- function scopeShadowsIdentifier(node, name) {
1527
- if (node.type === "BlockStatement" && Array.isArray(node.body))
1528
- return node.body.some((statement) => lexicalDeclarationContainsName(statement, name));
1529
- if (node.type === "CatchClause")
1530
- return bindingPatternContainsName(node.param, name);
1531
- if (node.type === "ForStatement")
1532
- return lexicalDeclarationContainsName(node.init, name);
1533
- if (node.type === "ForInStatement" || node.type === "ForOfStatement")
1534
- return lexicalDeclarationContainsName(node.left, name);
1535
- if (node.type === "SwitchStatement" && Array.isArray(node.cases)) {
1536
- return node.cases.some((entry) => astNode(entry) && Array.isArray(entry.consequent) && entry.consequent.some((statement) => lexicalDeclarationContainsName(statement, name)));
1537
- }
1538
- return false;
1539
- }
1540
- function walkAstWithoutShadowedIdentifier(node, name, visit) {
1541
- if (Array.isArray(node)) {
1542
- for (const item of node)
1543
- walkAstWithoutShadowedIdentifier(item, name, visit);
1544
- return;
1545
- }
1546
- if (!astNode(node) || scopeShadowsIdentifier(node, name))
1547
- return;
1548
- visit(node);
1549
- if (node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression")
1550
- return;
1551
- for (const [key, child] of Object.entries(node)) {
1552
- if (!AST_LOCATION_KEYS.has(key))
1553
- walkAstWithoutShadowedIdentifier(child, name, visit);
1554
- }
1555
- }
1556
- function definitelyNonJson(node, normalizeUndefined = false) {
1557
- if (node.type === "Literal") {
1558
- if (typeof node.bigint === "string")
1559
- return "BigInt values are not JSON-representable";
1560
- if (node.regex !== undefined)
1561
- return "regular expressions are not JSON-representable";
1562
- return undefined;
1563
- }
1564
- if (node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression")
1565
- return "functions are not JSON-representable";
1566
- if (node.type === "Identifier" && node.name === "undefined")
1567
- return normalizeUndefined ? undefined : "undefined is not JSON-representable";
1568
- if (node.type === "UnaryExpression" && node.operator === "void")
1569
- return normalizeUndefined ? undefined : "undefined is not JSON-representable";
1570
- if (node.type === "ArrayExpression" && Array.isArray(node.elements)) {
1571
- if (node.elements.some((entry) => entry === null))
1572
- return "sparse arrays are not JSON-representable";
1573
- for (const entry of node.elements)
1574
- if (astNode(entry)) {
1575
- const error = definitelyNonJson(entry, normalizeUndefined);
1576
- if (error)
1577
- return error;
1578
- }
1579
- }
1580
- if (node.type === "ObjectExpression" && Array.isArray(node.properties)) {
1581
- const values = new Map();
1582
- for (const property of node.properties) {
1583
- if (!astNode(property) || property.type !== "Property" || !astNode(property.value) || property.kind !== "init")
1584
- return undefined;
1585
- const key = staticPropertyKey(property);
1586
- if (key === undefined)
1587
- return undefined;
1588
- values.set(key, property.value);
1589
- }
1590
- for (const value of values.values()) {
1591
- const error = definitelyNonJson(value, normalizeUndefined);
1592
- if (error)
1593
- return error;
1594
- }
1595
- }
1596
- return undefined;
1597
- }
1598
- function staticPropertyKey(property) {
1599
- return property.computed === true
1600
- ? literalString(property.key)
1601
- : literalString(property.key) ?? (astNode(property.key) && property.key.type === "Identifier" ? property.key.name : undefined);
1602
- }
1603
- function directObjectPropertyValue(node, name) {
1604
- if (node.type !== "ObjectExpression" || !Array.isArray(node.properties))
1605
- return undefined;
1606
- let value;
1607
- for (const property of node.properties) {
1608
- if (!astNode(property) || property.type !== "Property" || !astNode(property.value))
1609
- continue;
1610
- if (staticPropertyKey(property) === name)
1611
- value = property.value;
1612
- }
1613
- return value;
1614
- }
1615
- function validateStaticBaseRef(params, owner) {
1616
- if (params.type !== "ObjectExpression" || !Array.isArray(params.properties))
1617
- return [];
1618
- // Inspect the final definition only. A later spread or unknown key may overwrite it.
1619
- for (let index = params.properties.length - 1; index >= 0; index--) {
1620
- const property = params.properties[index];
1621
- if (!astNode(property) || property.type !== "Property")
1622
- return [];
1623
- const key = staticPropertyKey(property);
1624
- if (key === undefined)
1625
- return [];
1626
- if (key !== "baseRef")
1627
- continue;
1628
- if (property.kind !== "init" || !astNode(property.value))
1629
- return [];
1630
- const valueNode = property.value;
1631
- const value = literalString(valueNode);
1632
- if ((value !== undefined || valueNode.type === "Literal") && !validGitRef(value)) {
1633
- return [{ message: `${owner} ${BASE_REF_VALIDATION_ERROR}`, ...nodeLocation(valueNode) }];
1634
- }
1635
- return [];
1636
- }
1637
- return [];
1638
- }
1639
- // Children with their own cwd, agentScope, or resume resolve agents elsewhere, and a
1640
- // spread or computed key can replace `agent`; leave those to launch-time resolution.
1641
- function staticChildAgentNode(params) {
1642
- if (!astNode(params) || params.type !== "ObjectExpression" || !Array.isArray(params.properties))
1643
- return undefined;
1644
- let agent;
1645
- for (const property of params.properties) {
1646
- if (!astNode(property) || property.type !== "Property")
1647
- return undefined;
1648
- const key = staticPropertyKey(property);
1649
- if (key === undefined || key === "cwd" || key === "agentScope" || key === "resume")
1650
- return undefined;
1651
- if (key === "agent")
1652
- agent = property.kind === "init" && astNode(property.value) ? property.value : undefined;
1653
- }
1654
- return literalString(agent) === undefined ? undefined : agent;
1655
- }
1656
- function validateStaticChildAgents(call, agentNameError) {
1657
- const args = Array.isArray(call.arguments) ? call.arguments : [];
1658
- const elements = (node) => astNode(node) && node.type === "ArrayExpression" && Array.isArray(node.elements) ? node.elements : [];
1659
- // A spread or unknown computed key on the lane can replace `stages`.
1660
- const staticLane = (lane) => astNode(lane) && lane.type === "ObjectExpression" && Array.isArray(lane.properties)
1661
- && lane.properties.every((property) => astNode(property) && property.type === "Property" && staticPropertyKey(property) !== undefined);
1662
- const children = directRunsCall(call, "run")
1663
- ? [{ owner: "runs.run", params: args[1] }]
1664
- : directRunsCall(call, "all")
1665
- ? elements(args[0]).map((params) => ({ owner: "runs.all item", params }))
1666
- : directRunsCall(call, "lanes")
1667
- ? elements(args[0]).flatMap((lane) => staticLane(lane) ? elements(directObjectPropertyValue(lane, "stages")).map((params) => ({ owner: "runs.lanes stage", params })) : [])
1668
- : [];
1669
- const errors = [];
1670
- for (const child of children) {
1671
- const agentNode = staticChildAgentNode(child.params);
1672
- const agentName = literalString(agentNode);
1673
- const error = agentName === undefined ? undefined : agentNameError(agentName);
1674
- if (agentNode && error)
1675
- errors.push({ kind: "agent", message: `${child.owner}: ${error}`, ...nodeLocation(agentNode) });
1676
- }
1677
- return errors;
1678
- }
1679
- function directRunsAllKeys(call) {
1680
- const args = Array.isArray(call.arguments) ? call.arguments : [];
1681
- const items = astNode(args[0]) && args[0].type === "ArrayExpression" && Array.isArray(args[0].elements) ? args[0].elements : [];
1682
- return items.flatMap((item) => {
1683
- if (!astNode(item))
1684
- return [];
1685
- const keyNode = directObjectPropertyValue(item, "key");
1686
- const key = literalString(keyNode);
1687
- return keyNode && key !== undefined ? [{ key, node: keyNode }] : [];
1688
- });
1689
- }
1690
- function containsWorkflowLaunch(node) {
1691
- let found = false;
1692
- walkAst(node, (candidate) => {
1693
- if (directRunsCall(candidate, "run") || directRunsCall(candidate, "all") || directRunsCall(candidate, "lanes"))
1694
- found = true;
1695
- });
1696
- return found;
1697
- }
1698
- function containsRunsIdentifier(node) {
1699
- let found = false;
1700
- walkAst(node, (candidate) => {
1701
- if (candidate.type === "Identifier" && candidate.name === "runs")
1702
- found = true;
1703
- });
1704
- return found;
1705
- }
1706
- function invalidatesRunsBinding(workflowBody) {
1707
- let invalidated = false;
1708
- walkAst(workflowBody, (node) => {
1709
- if ((node.type === "VariableDeclarator" || node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "ClassDeclaration" || node.type === "ClassExpression")
1710
- && containsRunsIdentifier(node.id))
1711
- invalidated = true;
1712
- if ((node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression") && Array.isArray(node.params)
1713
- && node.params.some(containsRunsIdentifier))
1714
- invalidated = true;
1715
- if (node.type === "CatchClause" && containsRunsIdentifier(node.param))
1716
- invalidated = true;
1717
- if ((node.type === "AssignmentExpression" || node.type === "UpdateExpression") && containsRunsIdentifier(node.left ?? node.argument))
1718
- invalidated = true;
1719
- });
1720
- return invalidated;
1721
- }
1722
- function containsAbruptControl(node) {
1723
- let found = false;
1724
- walkAst(node, (candidate) => {
1725
- if (candidate !== node && (candidate.type === "ReturnStatement" || candidate.type === "ThrowStatement" || candidate.type === "BreakStatement" || candidate.type === "ContinueStatement"))
1726
- found = true;
1727
- }, false);
1728
- return found;
1729
- }
1730
- function directLaunchCall(expression) {
1731
- if (!astNode(expression))
1732
- return undefined;
1733
- const candidate = expression.type === "AwaitExpression" && astNode(expression.argument) ? expression.argument : expression;
1734
- return directRunsCall(candidate, "run") || directRunsCall(candidate, "all") ? candidate : undefined;
1735
- }
1736
- function staticWorkflowLaunchPlan(workflowBody) {
1737
- if (workflowBody.type !== "BlockStatement" || !Array.isArray(workflowBody.body) || invalidatesRunsBinding(workflowBody)) {
1738
- return { keys: [], dynamic: containsWorkflowLaunch(workflowBody) };
1739
- }
1740
- const keys = new Set();
1741
- let dynamic = false;
1742
- let remainderUncertain = false;
1743
- const addCall = (call) => {
1744
- const args = Array.isArray(call.arguments) ? call.arguments : [];
1745
- let nestedLaunch = false;
1746
- for (const argument of args)
1747
- walkAst(argument, (node) => {
1748
- if (node !== call && (directRunsCall(node, "run") || directRunsCall(node, "all") || directRunsCall(node, "lanes")))
1749
- nestedLaunch = true;
1750
- });
1751
- if (nestedLaunch) {
1752
- dynamic = true;
1753
- return;
1754
- }
1755
- if (directRunsCall(call, "run")) {
1756
- const key = literalString(args[0]);
1757
- if (key === undefined)
1758
- dynamic = true;
1759
- else
1760
- keys.add(key);
1761
- return;
1762
- }
1763
- const array = astNode(args[0]) && args[0].type === "ArrayExpression" && Array.isArray(args[0].elements) ? args[0] : undefined;
1764
- if (!array) {
1765
- dynamic = true;
1766
- return;
1767
- }
1768
- const batchKeys = [];
1769
- for (const item of array.elements) {
1770
- if (!astNode(item) || item.type !== "ObjectExpression" || !Array.isArray(item.properties)
1771
- || item.properties.some((property) => !astNode(property) || property.type !== "Property" || staticPropertyKey(property) === undefined)) {
1772
- dynamic = true;
1773
- return;
1774
- }
1775
- const key = literalString(directObjectPropertyValue(item, "key"));
1776
- if (key === undefined) {
1777
- dynamic = true;
1778
- return;
1779
- }
1780
- batchKeys.push(key);
1781
- }
1782
- for (const key of batchKeys)
1783
- keys.add(key);
1784
- };
1785
- for (const statement of workflowBody.body) {
1786
- if (!astNode(statement))
1787
- continue;
1788
- if (remainderUncertain) {
1789
- if (containsWorkflowLaunch(statement))
1790
- dynamic = true;
1791
- continue;
1792
- }
1793
- const expressions = [];
1794
- if (statement.type === "VariableDeclaration" && Array.isArray(statement.declarations)) {
1795
- for (const declaration of statement.declarations)
1796
- if (astNode(declaration))
1797
- expressions.push(declaration.init);
1798
- }
1799
- else if (statement.type === "ExpressionStatement")
1800
- expressions.push(statement.expression);
1801
- else if (statement.type === "ReturnStatement" || statement.type === "ThrowStatement")
1802
- expressions.push(statement.argument);
1803
- let handledLaunch = false;
1804
- for (const expression of expressions) {
1805
- const call = directLaunchCall(expression);
1806
- if (call) {
1807
- addCall(call);
1808
- handledLaunch = true;
1809
- }
1810
- else if (containsWorkflowLaunch(expression))
1811
- dynamic = true;
1812
- }
1813
- if (!handledLaunch && expressions.length === 0 && containsWorkflowLaunch(statement))
1814
- dynamic = true;
1815
- if (statement.type === "ReturnStatement" || statement.type === "ThrowStatement")
1816
- remainderUncertain = true;
1817
- else if (containsAbruptControl(statement))
1818
- remainderUncertain = true;
1819
- }
1820
- return { keys: [...keys], dynamic };
1821
- }
1822
- /** Parse a workflowScript and apply only rules that are decidable from its local syntax. */
1823
- export function validateWorkflowScript(script, options = {}) {
1824
- const errors = [];
1825
- if (!script.trim())
1826
- return { ok: false, errors: [{ message: "workflowScript must not be empty." }] };
1827
- let root;
1828
- try {
1829
- const parser = requireFromPackage(resolveWorkflowParserEntry());
1830
- root = parser.parse(`(async () => {\n${script}\n})()`, { ecmaVersion: "latest", sourceType: "script", locations: true });
1831
- }
1832
- catch (error) {
1833
- const location = error && typeof error === "object" && "loc" in error && error.loc && typeof error.loc === "object"
1834
- ? error.loc
1835
- : undefined;
1836
- const message = (error instanceof Error ? error.message : String(error)).replace(/\s+\(\d+:\d+\)$/, "");
1837
- return { ok: false, errors: [{ message, ...(typeof location?.line === "number" ? { line: Math.max(1, location.line - 1) } : {}), ...(typeof location?.column === "number" ? { column: location.column + 1 } : {}) }] };
1838
- }
1839
- const wrapper = astNode(root.body) ? undefined : Array.isArray(root.body) && astNode(root.body[0]) && astNode(root.body[0].expression) && astNode(root.body[0].expression.callee)
1840
- ? root.body[0].expression.callee
1841
- : undefined;
1842
- const workflowBody = wrapper && astNode(wrapper.body) ? wrapper.body : root;
1843
- // A rebound `runs` may not be the workflow API, so its calls prove nothing about child launches.
1844
- const agentNameError = options.agentNameError && !invalidatesRunsBinding(workflowBody) ? options.agentNameError : undefined;
1845
- walkAst(workflowBody, (node) => {
1846
- if (node !== wrapper && node.async === true && (node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression")) {
1847
- errors.push({ message: "workflowScript does not support nested async functions. Use top-level await, plain helper functions that return runs.run(...), or explicit Promise chains.", ...nodeLocation(node) });
1848
- }
1849
- if (directRunsCall(node, "run")) {
1850
- const args = Array.isArray(node.arguments) ? node.arguments : [];
1851
- const keyNode = astNode(args[0]) ? args[0] : undefined;
1852
- const key = literalString(keyNode);
1853
- if (keyNode && key !== undefined && !KEY_PATTERN.test(key))
1854
- errors.push({ message: "runs.run key must be 1-128 characters using letters, numbers, '.', '_' or '-', and start with a letter or number.", ...nodeLocation(keyNode) });
1855
- if (astNode(args[1])) {
1856
- errors.push(...validateStaticBaseRef(args[1], "runs.run"));
1857
- const message = definitelyNonJson(args[1]);
1858
- if (message)
1859
- errors.push({ message: `runs.run params are invalid: ${message}.`, ...nodeLocation(args[1]) });
1860
- }
1861
- }
1862
- if (directRunsCall(node, "all")) {
1863
- for (const entry of directRunsAllKeys(node))
1864
- if (!KEY_PATTERN.test(entry.key))
1865
- errors.push({ message: "runs.all item key must be 1-128 characters using letters, numbers, '.', '_' or '-', and start with a letter or number.", ...nodeLocation(entry.node) });
1866
- const args = Array.isArray(node.arguments) ? node.arguments : [];
1867
- if (astNode(args[0]) && args[0].type === "ArrayExpression" && Array.isArray(args[0].elements)) {
1868
- for (const item of args[0].elements)
1869
- if (astNode(item)) {
1870
- errors.push(...validateStaticBaseRef(item, "runs.all item"));
1871
- const message = definitelyNonJson(item);
1872
- if (message)
1873
- errors.push({ message: `runs.all item params are invalid: ${message}.`, ...nodeLocation(item) });
1874
- }
1875
- }
1876
- }
1877
- if (directRunsCall(node, "host"))
1878
- errors.push(...validateStaticHostCall(node));
1879
- if (agentNameError)
1880
- errors.push(...validateStaticChildAgents(node, agentNameError));
1881
- const boundaryValue = node.type === "CallExpression" && astNode(node.callee) && node.callee.type === "Identifier" && node.callee.name === "emit" && Array.isArray(node.arguments) && astNode(node.arguments[0])
1882
- ? node.arguments[0]
1883
- : node.type === "CallExpression" && astNode(node.callee) && node.callee.type === "MemberExpression" && astNode(node.callee.object) && node.callee.object.type === "Identifier" && node.callee.object.name === "state" && astNode(node.callee.property) && node.callee.property.type === "Identifier" && node.callee.property.name === "set" && Array.isArray(node.arguments) && astNode(node.arguments[1])
1884
- ? node.arguments[1]
1885
- : undefined;
1886
- if (boundaryValue) {
1887
- // emit normalizes undefined like return; state.set values must already be JSON.
1888
- const message = definitelyNonJson(boundaryValue, Array.isArray(node.arguments) && boundaryValue === node.arguments[0]);
1889
- if (message)
1890
- errors.push({ message: `workflowScript boundary value is invalid: ${message}.`, ...nodeLocation(boundaryValue) });
1891
- }
1892
- });
1893
- walkAst(workflowBody, (node) => {
1894
- if (node.type !== "ReturnStatement" || !astNode(node.argument))
1895
- return;
1896
- const message = definitelyNonJson(node.argument, true);
1897
- if (message)
1898
- errors.push({ message: `workflowScript boundary value is invalid: ${message}.`, ...nodeLocation(node.argument) });
1899
- }, false);
1900
- if (workflowBody.type === "BlockStatement" && Array.isArray(workflowBody.body)) {
1901
- for (let statementIndex = 0; statementIndex < workflowBody.body.length; statementIndex++) {
1902
- const statement = workflowBody.body[statementIndex];
1903
- if (!astNode(statement) || statement.type !== "VariableDeclaration" || !Array.isArray(statement.declarations))
1904
- continue;
1905
- for (const declaration of statement.declarations) {
1906
- if (!astNode(declaration) || !astNode(declaration.id) || declaration.id.type !== "Identifier" || !astNode(declaration.init) || declaration.init.type !== "AwaitExpression" || !astNode(declaration.init.argument) || !directRunsCall(declaration.init.argument, "all"))
1907
- continue;
1908
- const name = declaration.id.name;
1909
- const laterStatements = workflowBody.body.slice(statementIndex + 1);
1910
- const keys = new Set(directRunsAllKeys(declaration.init.argument).map((entry) => entry.key));
1911
- if (keys.size === 0)
1912
- continue;
1913
- const args = Array.isArray(declaration.init.argument.arguments) ? declaration.init.argument.arguments : [];
1914
- const itemCount = astNode(args[0]) && args[0].type === "ArrayExpression" && Array.isArray(args[0].elements) ? args[0].elements.length : 0;
1915
- const arrayResultShape = Array.from({ length: itemCount });
1916
- for (const later of laterStatements) {
1917
- walkAstWithoutShadowedIdentifier(later, name, (node) => {
1918
- if (node.type !== "MemberExpression" || !astNode(node.object) || node.object.type !== "Identifier" || node.object.name !== name)
1919
- return;
1920
- const property = node.computed === true ? literalString(node.property) : astNode(node.property) && node.property.type === "Identifier" ? node.property.name : undefined;
1921
- if (property && keys.has(property) && !(property in arrayResultShape))
1922
- errors.push({ message: `runs.all returns an ordered array; '${name}.${property}' is keyed access. Use an index, destructuring, or map(...).`, ...nodeLocation(node) });
1923
- });
1924
- if (statement.kind !== "const" && astNode(later) && later.type === "ExpressionStatement" && definitelyReassignsBinding(later.expression, name))
1925
- break;
1926
- }
1927
- }
1928
- }
1929
- }
1930
- const warnings = [];
1931
- if (options.maxSubagentSpawnsPerRun !== undefined) {
1932
- const plan = staticWorkflowLaunchPlan(workflowBody);
1933
- if (plan.keys.length > options.maxSubagentSpawnsPerRun) {
1934
- errors.push({
1935
- kind: "spawn-budget",
1936
- message: `workflowScript statically requires child launches ${plan.keys.map((key) => `'${key}'`).join(", ")}; minimum required: ${plan.keys.length}; configured: ${options.maxSubagentSpawnsPerRun}.`,
1937
- });
1938
- }
1939
- if (plan.dynamic) {
1940
- warnings.push({
1941
- kind: "dynamic-spawn-count",
1942
- message: `workflowScript contains dynamic child launches; static validation proved ${plan.keys.length} launch(es), so runtime fan-out enforcement remains authoritative for the configured budget of ${options.maxSubagentSpawnsPerRun}.`,
1943
- });
1944
- }
1945
- }
1946
- const unique = errors.filter((error, index) => errors.findIndex((candidate) => candidate.message === error.message && candidate.line === error.line && candidate.column === error.column) === index);
1947
- return { ok: unique.length === 0, errors: unique, ...(warnings.length > 0 ? { warnings } : {}) };
1948
- }
1949
- function workflowStringMetadata(params) {
1950
- return {
1951
- ...(typeof params.phase === "string" && params.phase.trim() ? { phase: params.phase.trim() } : {}),
1952
- ...(typeof params.label === "string" && params.label.trim() ? { label: params.label.trim() } : {}),
1953
- // Requested agent name, so a child is identifiable while it runs. Launch
1954
- // resolution overwrites this with the canonical name on the terminal entry.
1955
- ...(typeof params.agent === "string" && params.agent.trim() ? { agent: params.agent.trim() } : {}),
1956
- };
1957
- }
1958
- function resolveWorkflowParserEntry() {
1959
- try {
1960
- return requireFromPackage.resolve("acorn");
1961
- }
1962
- catch (primaryError) {
1963
- // Some runtimes (e.g. Bun-compiled single-file binaries) fail bare
1964
- // package-specifier resolution through createRequire while subpath
1965
- // resolution still works. Resolve the manifest and derive the
1966
- // CommonJS entry from its "main" field instead.
1967
- try {
1968
- const manifestPath = requireFromPackage.resolve("acorn/package.json");
1969
- const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
1970
- const entry = typeof manifest.main === "string" && manifest.main ? manifest.main : "./dist/acorn.js";
1971
- return resolvePath(dirname(manifestPath), entry);
1972
- }
1973
- catch {
1974
- throw primaryError;
1975
- }
1976
- }
1977
- }
1978
- const AUTO_RESUME_PARAM_KEYS = ["acceptance", "agentContract", "baseRef", "index", "intercomBridge", "label", "lane", "maxRuntimeMs", "output", "outputMode", "outputSchema", "phase", "skill", "skills", "task", "timeoutMs", "toolBudget", "worktree"];
1979
- function isZeroUsage(usage) {
1980
- if (!isRecord(usage))
1981
- return false;
1982
- const cost = usage.cost;
1983
- return (usage.input ?? 0) === 0
1984
- && (usage.output ?? 0) === 0
1985
- && (usage.cacheRead ?? 0) === 0
1986
- && (usage.cacheWrite ?? 0) === 0
1987
- && (!isRecord(cost) || (cost.total ?? 0) === 0);
1988
- }
1989
- function setupAbortResumeParams(params, result, signal) {
1990
- if (signal.aborted || result.state === "running" || result.ok || result.stopped || result.interrupted || !result.runId)
1991
- return undefined;
1992
- const childResult = Array.isArray(result.results) && result.results.length === 1 && isRecord(result.results[0]) ? result.results[0] : undefined;
1993
- const error = typeof childResult?.error === "string" ? childResult.error : result.error;
1994
- if (error !== "This operation was aborted" || !isZeroUsage(childResult?.usage))
1995
- return undefined;
1996
- const messages = Array.isArray(childResult?.messages) ? childResult.messages : [];
1997
- const message = messages.findLast((entry) => isRecord(entry) && entry.role === "assistant");
1998
- if (message !== undefined) {
1999
- if (!isRecord(message))
2000
- return undefined;
2001
- if (message.stopReason !== "error" || message.errorMessage !== error)
2002
- return undefined;
2003
- if (!Array.isArray(message.content) || message.content.length > 0 || !isZeroUsage(message.usage))
2004
- return undefined;
2005
- if (Object.hasOwn(message, "diagnostics") || Object.hasOwn(message, "responseId"))
2006
- return undefined;
2007
- }
2008
- const task = typeof params.task === "string" && params.task.trim() ? params.task.trim() : "Continue after the setup abort.";
2009
- const resumeParams = { resume: result.runId, task };
2010
- for (const key of AUTO_RESUME_PARAM_KEYS) {
2011
- if (Object.hasOwn(params, key))
2012
- resumeParams[key] = params[key];
2013
- }
2014
- resumeParams.resume = result.runId;
2015
- resumeParams.task = task;
2016
- return resumeParams;
2017
- }
2018
- export async function runWorkflowScript(options) {
2019
- const emptyPartial = () => ({ emits: [], console: [], trace: [], children: [] });
2020
- if (!options.script.trim())
2021
- throw new WorkflowScriptError("workflowScript must not be empty.", emptyPartial(), "validation");
2022
- if (options.timeoutMs !== undefined && (!Number.isInteger(options.timeoutMs) || options.timeoutMs < 1))
2023
- throw new WorkflowScriptError("workflow script timeout must be a positive integer.", emptyPartial(), "runtime");
2024
- if (options.globalConcurrencyLimit !== undefined && (!Number.isSafeInteger(options.globalConcurrencyLimit) || options.globalConcurrencyLimit < 1)) {
2025
- throw new WorkflowScriptError("workflow script global concurrency limit must be a positive integer.", emptyPartial(), "runtime");
2026
- }
2027
- const launchSemaphore = new Semaphore(options.globalConcurrencyLimit ?? DEFAULT_GLOBAL_CONCURRENCY_LIMIT);
2028
- if (options.processCwd !== undefined) {
2029
- let staleCwd = false;
2030
- try {
2031
- realpathSync(process.cwd());
2032
- }
2033
- catch (error) {
2034
- const code = typeof error === "object" && error !== null && "code" in error ? error.code : undefined;
2035
- if (code !== "ENOENT")
2036
- throw new WorkflowScriptError("Workflow current cwd could not be validated.", emptyPartial(), "runtime", { cause: error });
2037
- staleCwd = true;
2038
- }
2039
- try {
2040
- if (staleCwd)
2041
- process.chdir(options.processCwd);
2042
- else {
2043
- const target = realpathSync(options.processCwd);
2044
- if (!statSync(target).isDirectory()) {
2045
- const error = new Error(`ENOTDIR: not a directory, access '${target}'`);
2046
- error.code = "ENOTDIR";
2047
- throw error;
2048
- }
2049
- accessSync(target, constants.X_OK);
2050
- }
2051
- }
2052
- catch (error) {
2053
- const detail = error instanceof Error ? error.message : String(error);
2054
- throw new WorkflowScriptError(`Workflow process cwd is unavailable: ${options.processCwd}: ${detail}`, emptyPartial(), "runtime", { cause: error });
2055
- }
2056
- }
2057
- let acornPath;
2058
- try {
2059
- acornPath = resolveWorkflowParserEntry();
2060
- }
2061
- catch (error) {
2062
- throw new WorkflowScriptError("Workflow parser dependency 'acorn' is unavailable from pi-subagents. Reinstall pi-subagents dependencies before launching workflowScript.", emptyPartial(), "runtime", { cause: error });
2063
- }
2064
- let worker;
2065
- try {
2066
- worker = new Worker(WORKER_SOURCE, { eval: true, workerData: { acornPath } });
2067
- }
2068
- catch (error) {
2069
- throw new WorkflowScriptError(`Workflow worker could not start: ${error instanceof Error ? error.message : String(error)}`, emptyPartial(), "runtime", { cause: error });
2070
- }
2071
- const emits = [];
2072
- const consoleEntries = [];
2073
- const trace = [];
2074
- const children = new Map();
2075
- const childOrder = [];
2076
- const launches = new Map();
2077
- const steers = new Map();
2078
- const hostCalls = new Map();
2079
- const stoppedLaunches = new Set();
2080
- const childStopControllers = new Map();
2081
- const batchAdmissions = new Map();
2082
- const observedRunCalls = new Set();
2083
- const observedSteerCalls = new Set();
2084
- const observedHostCalls = new Set();
2085
- const childController = new AbortController();
2086
- let acceptanceRecoveryBarrier;
2087
- let settled = false;
2088
- let finishing = false;
2089
- let assemblyAbortRequested = false;
2090
- let assemblyFlushTimer;
2091
- let abortError;
2092
- const partial = () => ({ emits, console: consoleEntries, trace, children: childOrder.flatMap((key) => {
2093
- const child = children.get(key);
2094
- return child ? [child] : [];
2095
- }) });
2096
- // Hosts use onTrace to persist a progress journal, and it is invoked from inside
2097
- // the run-promise handlers below. A throw here would reject the child promise the
2098
- // script is awaiting, so a single failed status write could mark a completed child
2099
- // failed and abort its siblings through Promise.all. Telemetry must not decide
2100
- // workflow outcomes, so a failing callback is reported and the run continues.
2101
- const traceChanged = () => {
2102
- try {
2103
- options.onTrace?.([...trace]);
2104
- }
2105
- catch (error) {
2106
- console.error("Workflow onTrace callback failed:", error);
2107
- }
2108
- };
2109
- const lanePlanChanged = (lanes) => {
2110
- try {
2111
- options.onLanePlan?.(lanes);
2112
- }
2113
- catch (error) {
2114
- console.error("Workflow onLanePlan callback failed:", error);
2115
- }
2116
- };
2117
- const hostStepChanged = (hostStep) => {
2118
- try {
2119
- options.onHostStep?.(hostStep);
2120
- }
2121
- catch (error) {
2122
- console.error("Workflow onHostStep callback failed:", error);
2123
- }
2124
- };
2125
- const stoppedChildResult = (key, message) => ({ key, ok: false, stopped: true, output: message, error: message, artifactPaths: [] });
2126
- const responseBoundaryFailure = (key, error) => {
2127
- const text = error instanceof Error ? error.message : String(error);
2128
- return { key, ok: false, output: text, error: text, artifactPaths: [] };
2129
- };
2130
- const assertRecoveryBarrierAllowsRun = (key, params) => {
2131
- if (!acceptanceRecoveryBarrier || isExplicitReadOnlyRecoveryReview(params))
2132
- return;
2133
- throw new Error(recoveryBarrierMessage(acceptanceRecoveryBarrier.key, key));
2134
- };
2135
- const recordAcceptanceRecoveryBarrier = (key, result) => {
2136
- if (isAcceptanceMetadataRecovery(result))
2137
- acceptanceRecoveryBarrier = { key };
2138
- };
2139
- const stopChild = (key, message = `Workflow child '${key}' stopped.`) => {
2140
- if (!launches.has(key) || children.has(key))
2141
- return false;
2142
- stoppedLaunches.add(key);
2143
- children.set(key, stoppedChildResult(key, message));
2144
- childStopControllers.get(key)?.abort(new Error(message));
2145
- const started = trace.findLast((entry) => entry.operation === "run" && entry.key === key && entry.state === "started");
2146
- trace.push({
2147
- operation: "run",
2148
- key,
2149
- state: "stopped",
2150
- ...(started?.agent ? { agent: started.agent } : {}),
2151
- ...(started?.phase ? { phase: started.phase } : {}),
2152
- ...(started?.label ? { label: started.label } : {}),
2153
- ...(started?.generatedLaneKey ? { generatedLaneKey: started.generatedLaneKey } : {}),
2154
- error: message,
2155
- });
2156
- traceChanged();
2157
- return true;
2158
- };
2159
- const notifyChildSettled = (key, result) => {
2160
- if (result.state === "running" || !options.onChildSettled || !options.workflowRunId)
2161
- return;
2162
- const outcome = result.ok
2163
- ? "completed"
2164
- : result.stopped
2165
- ? "stopped"
2166
- : result.detached
2167
- ? "paused"
2168
- : "failed";
2169
- const outputReference = result.outputReference ?? result.outputArtifactPath;
2170
- try {
2171
- options.onChildSettled({
2172
- workflowRunId: options.workflowRunId,
2173
- childKey: key,
2174
- ...(result.runId ? { childRunId: result.runId } : {}),
2175
- outcome,
2176
- ...(outputReference ? { outputReference } : {}),
2177
- ...(!result.ok && result.error ? { error: result.error } : {}),
2178
- workflowRunning: !settled && !finishing,
2179
- result,
2180
- });
2181
- }
2182
- catch (error) {
2183
- console.error("Workflow onChildSettled callback failed:", error);
2184
- }
2185
- };
2186
- options.registerStopChild?.(stopChild);
2187
- return await new Promise((resolve, reject) => {
2188
- const finish = (outcome) => {
2189
- if (settled || finishing)
2190
- return;
2191
- finishing = true;
2192
- if (assemblyFlushTimer !== undefined) {
2193
- clearTimeout(assemblyFlushTimer);
2194
- assemblyFlushTimer = undefined;
2195
- }
2196
- childController.abort("error" in outcome ? outcome.error : new Error("Workflow script completed."));
2197
- void Promise.allSettled([...steers.values(), ...hostCalls.values()].map(({ promise }) => promise)).then(() => {
2198
- if (settled)
2199
- return;
2200
- settled = true;
2201
- options.registerStopChild?.(undefined);
2202
- if (timer)
2203
- clearTimeout(timer);
2204
- options.signal?.removeEventListener("abort", onAbort);
2205
- void worker.terminate();
2206
- const unobservedKeys = "value" in outcome ? [...launches].filter(([, launch]) => !launch.observed).map(([key]) => key) : [];
2207
- const completionError = unobservedKeys.length > 0
2208
- ? new Error(`workflowScript completed with unawaited runs.run launch(es): ${unobservedKeys.map((key) => `'${key}'`).join(", ")}. For ordinary parallel fanout use await runs.all([{key, agent, task}, ...]); do not read .output from unawaited launches.`)
2209
- : "value" in outcome
2210
- ? (() => {
2211
- const unobservedSteers = [...steers.values()].filter((steer) => !steer.observed).map((steer) => steer.key);
2212
- if (unobservedSteers.length > 0)
2213
- return new Error(`workflowScript completed with unawaited runs.steer call(s): ${unobservedSteers.map((key) => `'${key}'`).join(", ")}. Await or return each call.`);
2214
- const unobservedHosts = [...hostCalls.values()].filter((host) => !host.observed).map((host) => host.key);
2215
- return unobservedHosts.length > 0 ? new Error(`workflowScript completed with unawaited runs.host call(s): ${unobservedHosts.map((key) => `'${key}'`).join(", ")}. Await or return each call.`) : undefined;
2216
- })()
2217
- : undefined;
2218
- // Stops and reloads end through the abort paths untagged: they are not failures.
2219
- if ("error" in outcome)
2220
- reject(new WorkflowScriptError(outcome.error.message, partial(), isWorkflowScriptFailureKind(outcome.error.workflowErrorKind) ? outcome.error.workflowErrorKind : undefined));
2221
- else if (completionError)
2222
- reject(new WorkflowScriptError(completionError.message, partial(), "validation"));
2223
- else
2224
- resolve({ value: outcome.value, ...partial() });
2225
- });
2226
- };
2227
- const onAbort = () => {
2228
- const signalReason = options.signal?.reason;
2229
- const error = signalReason instanceof Error
2230
- ? signalReason
2231
- : typeof signalReason === "string"
2232
- ? new Error(signalReason)
2233
- : new Error("Workflow script aborted.");
2234
- if (finishing)
2235
- return;
2236
- abortError = error;
2237
- const allChildrenSettled = launches.size > 0
2238
- && [...launches.keys()].every((key) => children.has(key));
2239
- let mayFlushAssembly = false;
2240
- try {
2241
- mayFlushAssembly = options.continueAfterAbortWhenChildrenSettled?.(error) === true;
2242
- }
2243
- catch (callbackError) {
2244
- const callbackMessage = callbackError instanceof Error ? callbackError.message : String(callbackError);
2245
- return finish({ error: taggedWorkflowError(`Workflow assembly flush eligibility failed: ${callbackMessage}`, "runtime") });
2246
- }
2247
- if (mayFlushAssembly && allChildrenSettled) {
2248
- // A reloaded async workflow may already be past its last child launch.
2249
- // Keep the worker alive for pure result assembly, but abort the child
2250
- // signal so any later launch or side effect cannot use stale context.
2251
- assemblyAbortRequested = true;
2252
- childController.abort(error);
2253
- assemblyFlushTimer = setTimeout(() => finish({ error }), WORKFLOW_ASSEMBLY_FLUSH_TIMEOUT_MS);
2254
- return;
2255
- }
2256
- for (const key of launches.keys()) {
2257
- if (children.has(key))
2258
- continue;
2259
- stoppedLaunches.add(key);
2260
- const started = trace.findLast((entry) => entry.operation === "run" && entry.key === key && entry.state === "started");
2261
- trace.push({
2262
- operation: "run",
2263
- key,
2264
- state: "stopped",
2265
- ...(started?.agent ? { agent: started.agent } : {}),
2266
- ...(started?.phase ? { phase: started.phase } : {}),
2267
- ...(started?.label ? { label: started.label } : {}),
2268
- ...(started?.generatedLaneKey ? { generatedLaneKey: started.generatedLaneKey } : {}),
2269
- error: error.message,
2270
- });
2271
- }
2272
- traceChanged();
2273
- finish({ error });
2274
- };
2275
- const timer = options.timeoutMs === undefined
2276
- ? undefined
2277
- : setTimeout(() => {
2278
- finish({ error: taggedWorkflowError(`Workflow script timed out after ${options.timeoutMs}ms.`, "timeout") });
2279
- }, options.timeoutMs);
2280
- options.signal?.addEventListener("abort", onAbort, { once: true });
2281
- if (options.signal?.aborted)
2282
- return onAbort();
2283
- worker.on("error", (error) => finish({ error: taggedWorkflowError(`Workflow worker failed: ${error instanceof Error ? error.message : String(error)}`, "runtime") }));
2284
- worker.on("exit", (code) => {
2285
- if (!settled && code !== 0)
2286
- finish({ error: taggedWorkflowError(`Workflow worker exited with code ${code}.`, "runtime") });
2287
- });
2288
- worker.on("message", (message) => {
2289
- if (settled)
2290
- return;
2291
- if (message.type === "lanePlan" && Array.isArray(message.lanes)) {
2292
- lanePlanChanged(message.lanes);
2293
- return;
2294
- }
2295
- if (message.type === "emit") {
2296
- try {
2297
- assertWorkflowJsonValue(message.value, "emit");
2298
- }
2299
- catch (error) {
2300
- finish({ error: taggedWorkflowError(`Workflow emit could not be persisted: ${error instanceof Error ? error.message : String(error)}`, "runtime") });
2301
- return;
2302
- }
2303
- emits.push(message.value);
2304
- try {
2305
- options.onEmit?.([...emits]);
2306
- }
2307
- catch (error) {
2308
- emits.pop();
2309
- finish({ error: taggedWorkflowError(`Workflow emit could not be persisted: ${error instanceof Error ? error.message : String(error)}`, "runtime") });
2310
- }
2311
- return;
2312
- }
2313
- if (message.type === "console") {
2314
- const level = message.level;
2315
- if ((level === "log" || level === "info" || level === "warn" || level === "error") && typeof message.text === "string")
2316
- consoleEntries.push({ level, text: message.text });
2317
- return;
2318
- }
2319
- if (message.type === "complete") {
2320
- try {
2321
- assertWorkflowJsonValue(message.value, "return");
2322
- }
2323
- catch (error) {
2324
- return finish({ error: taggedWorkflowError(`Workflow return could not be persisted: ${error instanceof Error ? error.message : String(error)}`, "return-serialization") });
2325
- }
2326
- return finish({ value: message.value });
2327
- }
2328
- if (message.type === "error") {
2329
- const rawError = typeof message.error === "string" ? message.error : "Workflow script failed.";
2330
- const text = message.errorPhase === "return-serialization" ? `${rawError}${workflowReturnRecoveryHint(partial().children)}` : rawError;
2331
- return finish({ error: isWorkflowScriptFailureKind(message.errorKind) ? taggedWorkflowError(text, message.errorKind) : new Error(text) });
2332
- }
2333
- if (message.type === "callObserved" && typeof message.callId === "number") {
2334
- const key = typeof message.key === "string" ? message.key : undefined;
2335
- if (message.operation === "run") {
2336
- const launch = key ? launches.get(key) : undefined;
2337
- if (launch)
2338
- launch.observed = true;
2339
- else
2340
- observedRunCalls.add(message.callId);
2341
- }
2342
- else if (message.operation === "steer") {
2343
- const steer = steers.get(message.callId);
2344
- if (steer)
2345
- steer.observed = true;
2346
- else
2347
- observedSteerCalls.add(message.callId);
2348
- }
2349
- else if (message.operation === "host") {
2350
- const host = hostCalls.get(message.callId);
2351
- if (host)
2352
- host.observed = true;
2353
- else
2354
- observedHostCalls.add(message.callId);
2355
- }
2356
- return;
2357
- }
2358
- if (message.type !== "call" || typeof message.callId !== "number" || typeof message.method !== "string" || !isRecord(message.args))
2359
- return;
2360
- if (assemblyAbortRequested)
2361
- return finish({ error: abortError ?? new Error("Workflow context was replaced or reloaded.") });
2362
- const respond = (promise, responsePath, onBoundaryError) => {
2363
- void promise.then((value) => {
2364
- if (settled)
2365
- return;
2366
- const normalized = responsePath ? omitNonJsonWorkflowResultMetadata(value) : omitUndefinedWorkflowValues(value);
2367
- if (!responsePath) {
2368
- worker.postMessage({ type: "response", callId: message.callId, ok: true, value: normalized });
2369
- return;
2370
- }
2371
- try {
2372
- assertWorkflowJsonValue(normalized, responsePath);
2373
- worker.postMessage({ type: "response", callId: message.callId, ok: true, value: normalized });
2374
- }
2375
- catch (error) {
2376
- onBoundaryError?.(error);
2377
- worker.postMessage({ type: "response", callId: message.callId, ok: false, error: `${responsePath} must contain only JSON data before it can be returned from workflowScript. Return a plain projection such as { runId, ok, output }. ${error instanceof Error ? error.message : String(error)}` });
2378
- }
2379
- }, (error) => {
2380
- if (!settled) {
2381
- const errorKind = error instanceof Error ? error.workflowErrorKind : undefined;
2382
- worker.postMessage({ type: "response", callId: message.callId, ok: false, error: error instanceof Error ? error.message : String(error), ...(isWorkflowScriptFailureKind(errorKind) ? { errorKind } : {}) });
2383
- }
2384
- });
2385
- };
2386
- if (message.method === "state.get" || message.method === "state.set") {
2387
- if (!options.state)
2388
- return respond(Promise.reject(new Error("Workflow state is unavailable without a mission.")));
2389
- let key;
2390
- try {
2391
- key = validateKey(message.args.key, "state");
2392
- }
2393
- catch (error) {
2394
- return respond(Promise.reject(error));
2395
- }
2396
- if (message.method === "state.get")
2397
- return respond(Promise.resolve().then(() => options.state.get(key)));
2398
- if (acceptanceRecoveryBarrier)
2399
- return respond(Promise.reject(new Error(recoveryBarrierMessage(acceptanceRecoveryBarrier.key, `state.set('${key}')`))));
2400
- const value = message.args.value;
2401
- try {
2402
- assertWorkflowJsonValue(value, `state.set('${key}') value`);
2403
- }
2404
- catch (error) {
2405
- return respond(Promise.reject(error));
2406
- }
2407
- return respond(Promise.resolve().then(() => options.state.set(key, value)));
2408
- }
2409
- if (message.method === "status") {
2410
- const keyOrRunId = message.args.keyOrRunId;
2411
- if (typeof keyOrRunId !== "string" || !keyOrRunId.trim())
2412
- return respond(Promise.reject(new Error("runs.status(keyOrRunId) requires a non-empty string.")));
2413
- const known = children.get(keyOrRunId);
2414
- const target = known?.runId ?? keyOrRunId;
2415
- trace.push({ operation: "status", key: keyOrRunId, state: "started", ...(known?.runId ? { runId: known.runId } : {}) });
2416
- traceChanged();
2417
- if (settled || finishing)
2418
- return;
2419
- respond(options.status(target, childController.signal).then((result) => {
2420
- if (settled || finishing)
2421
- return result;
2422
- trace.push({ operation: "status", key: keyOrRunId, state: result.ok ? "completed" : "failed", ...(result.runId ? { runId: result.runId } : {}), ...(!result.ok ? { error: result.output } : {}) });
2423
- traceChanged();
2424
- if (!result.ok)
2425
- throw new Error(`Status '${keyOrRunId}' failed: ${result.output}`);
2426
- return result;
2427
- }));
2428
- return;
2429
- }
2430
- if (message.method === "steer") {
2431
- let key;
2432
- try {
2433
- key = validateKey(message.args.key, "runs.steer");
2434
- }
2435
- catch (error) {
2436
- return respond(Promise.reject(error));
2437
- }
2438
- const steerMessage = message.args.message;
2439
- if (typeof steerMessage !== "string" || !steerMessage.trim())
2440
- return respond(Promise.reject(new Error(`runs.steer('${key}') requires a non-empty message.`)));
2441
- const steerOptions = isRecord(message.args.options) ? message.args.options : {};
2442
- if (acceptanceRecoveryBarrier)
2443
- return respond(Promise.reject(new Error(recoveryBarrierMessage(acceptanceRecoveryBarrier.key, `runs.steer('${key}')`))));
2444
- const startedAt = Date.now();
2445
- trace.push({ operation: "steer", key, state: "started" });
2446
- traceChanged();
2447
- const promise = Promise.resolve().then(() => {
2448
- if (!launches.has(key))
2449
- throw new Error(`runs.steer('${key}') requires a prior runs.run/runs.all launch with that key.`);
2450
- if (!options.steer)
2451
- throw new Error("Workflow steering is unavailable in this host.");
2452
- return options.steer(key, steerMessage.trim(), steerOptions, childController.signal);
2453
- }).then((receipt) => {
2454
- trace.push({ operation: "steer", key, state: receipt.state, durationMs: Date.now() - startedAt, ...(receipt.error ? { error: receipt.error } : {}) });
2455
- traceChanged();
2456
- return receipt;
2457
- }, (error) => {
2458
- const text = error instanceof Error ? error.message : String(error);
2459
- trace.push({ operation: "steer", key, state: "failed", durationMs: Date.now() - startedAt, error: text });
2460
- traceChanged();
2461
- throw error;
2462
- });
2463
- steers.set(message.callId, { key, promise, observed: observedSteerCalls.delete(message.callId) });
2464
- respond(promise);
2465
- return;
2466
- }
2467
- if (message.method === "host") {
2468
- let key;
2469
- let params;
2470
- try {
2471
- key = validateKey(message.args.key, "runs.host");
2472
- params = normalizeWorkflowHostCommandParams(message.args.params, `runs.host('${key}') params`);
2473
- }
2474
- catch (error) {
2475
- return respond(Promise.reject(error));
2476
- }
2477
- if (acceptanceRecoveryBarrier)
2478
- return respond(Promise.reject(new Error(recoveryBarrierMessage(acceptanceRecoveryBarrier.key, `runs.host('${key}')`))));
2479
- if (!options.host)
2480
- return respond(Promise.reject(new Error("runs.host is unavailable in this host context.")));
2481
- if (hostCalls.size >= HOST_STEP_MAX_COUNT)
2482
- return respond(Promise.reject(new Error(`workflowScript supports at most ${HOST_STEP_MAX_COUNT} runs.host calls.`)));
2483
- const startedAt = Date.now();
2484
- const startedStep = {
2485
- version: 1,
2486
- kind: "host-step",
2487
- monitorKind: "command",
2488
- id: key,
2489
- label: key,
2490
- ...(params.role ? { role: params.role } : {}),
2491
- ...(params.provider ? { provider: params.provider } : {}),
2492
- state: "running",
2493
- updatedAt: startedAt,
2494
- deadlineAt: startedAt + params.timeoutMs,
2495
- };
2496
- hostStepChanged(startedStep);
2497
- trace.push({ operation: "host", key, state: "started" });
2498
- traceChanged();
2499
- const promise = Promise.resolve().then(() => options.host(key, params, childController.signal)).then((result) => {
2500
- const state = result.state === "stopped" ? "cancelled" : result.ok ? "done" : "error";
2501
- const detail = [result.error, result.stderr.trim() || result.stdout.trim()].filter(Boolean).join(" ").replace(/\s+/g, " ").trim().slice(0, 200);
2502
- hostStepChanged({ ...startedStep, state, ...(state === "done" ? { verdict: "pass" } : {}), ...(!result.ok ? { reasonCode: result.state === "timed-out" ? "timed_out" : result.state === "stopped" ? "aborted" : "command_failed" } : {}), ...(detail ? { detail } : {}), reportPath: params.output ?? result.outputPath.split(/[\\/]/).at(-1), exitCode: result.exitCode, updatedAt: Date.now() });
2503
- trace.push({ operation: "host", key, state: result.ok ? "completed" : result.state === "stopped" ? "stopped" : "failed", durationMs: result.durationMs, ...(!result.ok ? { error: result.error ?? "Host command failed." } : {}) });
2504
- traceChanged();
2505
- if (!result.ok)
2506
- throw new Error(`Host command '${key}' failed: ${detail || result.error || `exit code ${result.exitCode ?? "unknown"}`}`);
2507
- return result;
2508
- }, (error) => {
2509
- const text = error instanceof Error ? error.message : String(error);
2510
- hostStepChanged({ ...startedStep, state: "error", reasonCode: "execution_failed", detail: text.replace(/\s+/g, " ").slice(0, 200), updatedAt: Date.now() });
2511
- trace.push({ operation: "host", key, state: "failed", durationMs: Date.now() - startedAt, error: text });
2512
- traceChanged();
2513
- throw error;
2514
- });
2515
- hostCalls.set(message.callId, { key, promise, observed: observedHostCalls.delete(message.callId) });
2516
- respond(promise, `runs.host('${key}') result`);
2517
- return;
2518
- }
2519
- if (message.method !== "run")
2520
- return respond(Promise.reject(new Error(`Unknown runs API method '${message.method}'.`)));
2521
- let key;
2522
- try {
2523
- key = validateKey(message.args.key);
2524
- }
2525
- catch (error) {
2526
- return respond(Promise.reject(error));
2527
- }
2528
- const params = message.args.params;
2529
- if (!isRecord(params))
2530
- return respond(Promise.reject(new Error(`runs.run('${key}', params) requires a params object.`)));
2531
- const generatedLaneKey = typeof message.args.generatedLaneKey === "string" && KEY_PATTERN.test(message.args.generatedLaneKey) && key.startsWith(`${message.args.generatedLaneKey}.`)
2532
- ? message.args.generatedLaneKey
2533
- : undefined;
2534
- const collectFailure = message.args.collectFailure === true;
2535
- const callObserved = observedRunCalls.delete(message.callId);
2536
- const deliver = (promise) => collectFailure
2537
- ? promise
2538
- : promise.then((result) => {
2539
- const recoverableAcceptanceMetadata = result.recovery?.status === "available-for-review"
2540
- && result.recovery.reason === "acceptance-metadata-rejected";
2541
- if (!result.ok && result.state !== "running" && !result.stopped && !recoverableAcceptanceMetadata) {
2542
- throw taggedWorkflowError(`Run '${key}' ${result.detached ? "detached" : "failed"}: ${result.error ?? result.output}`, result.detached ? "detached-child" : "child");
2543
- }
2544
- return result;
2545
- });
2546
- const fingerprint = workflowRunParamsFingerprint(params);
2547
- const existing = launches.get(key);
2548
- if (existing) {
2549
- if (existing.fingerprint !== fingerprint)
2550
- return respond(Promise.reject(new Error(`Duplicate workflow key '${key}' used with incompatible launch params.`)));
2551
- if (callObserved)
2552
- existing.observed = true;
2553
- trace.push({ operation: "run", key, state: "reused", ...workflowStringMetadata(params), ...(existing.generatedLaneKey ? { generatedLaneKey: existing.generatedLaneKey } : {}) });
2554
- traceChanged();
2555
- return respond(deliver(existing.promise), `runs.run('${key}') result`, (error) => children.set(key, responseBoundaryFailure(key, error)));
2556
- }
2557
- const permitError = options.oneUsePermit?.claim(key);
2558
- if (permitError)
2559
- return respond(Promise.reject(new Error(permitError)));
2560
- if (options.oneUsePermit && message.args.batch !== undefined)
2561
- return respond(Promise.reject(new Error("Workflow child permit does not support runs.all.")));
2562
- if (options.oneUsePermit && params.resume !== undefined)
2563
- return respond(Promise.reject(new Error("Workflow child permit does not support retained resume.")));
2564
- if (params.action !== undefined)
2565
- return respond(Promise.reject(new Error(`runs.run('${key}') accepts execution params only; management action is not allowed.`)));
2566
- if (params.workflowScript !== undefined)
2567
- return respond(Promise.reject(new Error(`runs.run('${key}') cannot start a nested workflow script.`)));
2568
- if (params.tasks !== undefined || params.chain !== undefined || params.parallel !== undefined || params.concurrency !== undefined || params.chainDir !== undefined) {
2569
- return respond(Promise.reject(new Error(`runs.run('${key}') accepts one child via { agent, task }; use runs.all(...) and JavaScript control flow for orchestration.`)));
2570
- }
2571
- if (params.worktree !== undefined && typeof params.worktree !== "boolean") {
2572
- return respond(Promise.reject(new Error(`runs.run('${key}') worktree must be true or false.`)));
2573
- }
2574
- if (params.baseRef !== undefined && (typeof params.baseRef !== "string" || !validGitRef(params.baseRef))) {
2575
- return respond(Promise.reject(new Error(`runs.run('${key}') ${BASE_REF_VALIDATION_ERROR}`)));
2576
- }
2577
- if (params.gate !== undefined) {
2578
- const parsedGate = parseGateInput(params.gate);
2579
- if (!parsedGate.ok)
2580
- return respond(Promise.reject(new Error(`runs.run('${key}') ${parsedGate.error}`)));
2581
- }
2582
- if (params.gate !== undefined && params.acceptance !== undefined && params.acceptance !== false) {
2583
- return respond(Promise.reject(new Error(`runs.run('${key}') gate cannot be combined with acceptance; use one gate command or acceptance.verify.` + describeGateAcceptanceConflict(params.gate, params.acceptance))));
2584
- }
2585
- if (params.gate !== undefined && params.resume !== undefined) {
2586
- return respond(Promise.reject(new Error(`runs.run('${key}') gate is not supported with retained resume.`)));
2587
- }
2588
- let resumeReference;
2589
- try {
2590
- if (params.resume !== undefined && typeof params.resume !== "string")
2591
- resumeReference = parseWorkflowResumeReference(params.resume);
2592
- }
2593
- catch (error) {
2594
- return respond(Promise.reject(new Error(`runs.run('${key}') ${error instanceof Error ? error.message : String(error)}`)));
2595
- }
2596
- if (typeof params.resume === "string" && !params.resume.trim())
2597
- return respond(Promise.reject(new Error(`runs.run('${key}') resume must be a non-empty retained run id.`)));
2598
- if (params.resume !== undefined && params.agent !== undefined) {
2599
- return respond(Promise.reject(new Error(`runs.run('${key}') resume and agent are mutually exclusive.`)));
2600
- }
2601
- if (params.resume !== undefined && (typeof params.task !== "string" || !params.task.trim())) {
2602
- return respond(Promise.reject(new Error(`runs.run('${key}') resume requires a non-empty task follow-up.`)));
2603
- }
2604
- const startedAt = Date.now();
2605
- const batch = isRecord(message.args.batch) && typeof message.args.batch.id === "string" && Array.isArray(message.args.batch.calls)
2606
- ? { id: message.args.batch.id, calls: message.args.batch.calls.filter((call) => isRecord(call) && typeof call.key === "string" && isRecord(call.params)) }
2607
- : undefined;
2608
- let admission = batch ? batchAdmissions.get(batch.id) : undefined;
2609
- if (!admission) {
2610
- const seenKeys = new Set();
2611
- const calls = (batch?.calls ?? [{ key, params }]).filter((call) => {
2612
- if (seenKeys.has(call.key) || launches.has(call.key))
2613
- return false;
2614
- seenKeys.add(call.key);
2615
- return true;
2616
- });
2617
- admission = Promise.resolve().then(() => {
2618
- if (settled || finishing)
2619
- return;
2620
- for (const call of calls)
2621
- assertRecoveryBarrierAllowsRun(call.key, call.params);
2622
- return options.admit?.(calls, childController.signal);
2623
- });
2624
- if (batch)
2625
- batchAdmissions.set(batch.id, admission);
2626
- }
2627
- let resolvedResumeLineage;
2628
- const promise = admission.then(async () => {
2629
- if (settled || finishing || stoppedLaunches.has(key)) {
2630
- const reason = childController.signal.reason;
2631
- const text = children.get(key)?.error ?? (reason instanceof Error ? reason.message : typeof reason === "string" ? reason : "Workflow script aborted.");
2632
- return stoppedChildResult(key, text);
2633
- }
2634
- const childStopController = new AbortController();
2635
- childStopControllers.set(key, childStopController);
2636
- const childSignal = combinedAbortSignal([childController.signal, childStopController.signal]);
2637
- const resumeInput = resumeReference ?? (typeof params.resume === "string" && options.resolveResume ? params.resume : undefined);
2638
- const resolvedResumeValue = resumeInput
2639
- ? await Promise.resolve().then(() => {
2640
- if (!options.resolveResume)
2641
- throw new Error("Keyed workflow receipt resume is unavailable in this host.");
2642
- return options.resolveResume(resumeInput, childSignal, typeof params.index === "number" ? params.index : undefined);
2643
- })
2644
- : undefined;
2645
- const resolvedResume = typeof resolvedResumeValue === "string"
2646
- ? resolvedResumeValue
2647
- : isRecord(resolvedResumeValue) && typeof resolvedResumeValue.runId === "string"
2648
- ? resolvedResumeValue.runId
2649
- : undefined;
2650
- if (resumeReference && (typeof resolvedResume !== "string" || !resolvedResume.trim()))
2651
- throw new Error("Keyed workflow receipt resume resolved without a retained run id.");
2652
- const resolvedResumeId = resolvedResume?.trim();
2653
- if (isRecord(resolvedResumeValue)) {
2654
- const lineage = Array.isArray(resolvedResumeValue.runIds)
2655
- ? resolvedResumeValue.runIds.filter((runId) => typeof runId === "string" && Boolean(runId.trim())).map((runId) => runId.trim())
2656
- : [];
2657
- resolvedResumeLineage = [...new Set(lineage.length ? lineage : [resolvedResumeId])];
2658
- if (resolvedResumeLineage.at(-1) !== resolvedResumeId)
2659
- resolvedResumeLineage.push(resolvedResumeId);
2660
- if (typeof resumeInput === "string") {
2661
- const predecessor = [...children.values()].find((child) => child.runId === resolvedResumeId);
2662
- if (predecessor?.continuation && predecessor.continuation.runIds.at(-1) === resolvedResumeId)
2663
- resolvedResumeLineage = predecessor.continuation.runIds;
2664
- }
2665
- }
2666
- const launchParams = resolvedResumeId ? { ...params, resume: resolvedResumeId } : params;
2667
- await launchSemaphore.acquire();
2668
- try {
2669
- if (settled || finishing || stoppedLaunches.has(key) || childSignal.aborted) {
2670
- const reason = childSignal.reason;
2671
- const text = children.get(key)?.error ?? (reason instanceof Error ? reason.message : typeof reason === "string" ? reason : "Workflow script aborted.");
2672
- return stoppedChildResult(key, text);
2673
- }
2674
- const result = await options.launch(key, launchParams, childSignal, { admitted: true, batch: batch !== undefined });
2675
- const autoResumeParams = setupAbortResumeParams(params, result, childSignal);
2676
- if (!autoResumeParams)
2677
- return result;
2678
- resolvedResumeLineage = [...new Set([...(resolvedResumeLineage ?? []), result.runId])];
2679
- trace.push({ operation: "run", key, state: "started", ...workflowStringMetadata(autoResumeParams), ...(generatedLaneKey ? { generatedLaneKey } : {}), phase: "auto-resume", runId: result.runId });
2680
- traceChanged();
2681
- return options.launch(key, autoResumeParams, childSignal, { admitted: true, batch: batch !== undefined });
2682
- }
2683
- finally {
2684
- launchSemaphore.release();
2685
- }
2686
- }, (error) => {
2687
- if (!childController.signal.aborted)
2688
- throw error;
2689
- const reason = childController.signal.reason;
2690
- return stoppedChildResult(key, reason instanceof Error ? reason.message : typeof reason === "string" ? reason : "Workflow script aborted.");
2691
- }).then((result) => {
2692
- let normalized = !result.ok && result.state !== "running" && !result.error ? { ...result, error: result.output } : result;
2693
- if (resolvedResumeLineage?.length && normalized.runId) {
2694
- normalized = { ...normalized, continuation: { runIds: [...new Set([...resolvedResumeLineage, normalized.runId])] } };
2695
- }
2696
- childStopControllers.delete(key);
2697
- if (stoppedLaunches.has(key))
2698
- return children.get(key) ?? normalized;
2699
- children.set(key, normalized);
2700
- recordAcceptanceRecoveryBarrier(key, normalized);
2701
- const state = normalized.state === "running" ? "started" : normalized.ok ? "completed" : normalized.stopped ? "stopped" : normalized.detached ? "detached" : "failed";
2702
- const settledEntry = { operation: "run", key, state, durationMs: Date.now() - startedAt, ...workflowStringMetadata(params), ...(generatedLaneKey ? { generatedLaneKey } : {}), ...(normalized.agent ? { agent: normalized.agent } : {}), ...(normalized.runId ? { runId: normalized.runId } : {}), ...(!normalized.ok && normalized.state !== "running" ? { error: normalized.error ?? normalized.output } : {}) };
2703
- if (normalized.reused)
2704
- settledEntry.reused = true;
2705
- trace.push(settledEntry);
2706
- traceChanged();
2707
- notifyChildSettled(key, normalized);
2708
- return normalized;
2709
- }, (error) => {
2710
- const text = error instanceof Error ? error.message : String(error);
2711
- const failure = { key, ok: false, output: text, error: text, artifactPaths: [] };
2712
- childStopControllers.delete(key);
2713
- if (stoppedLaunches.has(key))
2714
- return children.get(key) ?? { ...failure, stopped: true };
2715
- children.set(key, failure);
2716
- trace.push({ operation: "run", key, state: "failed", durationMs: Date.now() - startedAt, ...workflowStringMetadata(params), ...(generatedLaneKey ? { generatedLaneKey } : {}), error: text });
2717
- traceChanged();
2718
- notifyChildSettled(key, failure);
2719
- return failure;
2720
- });
2721
- launches.set(key, { fingerprint, promise, observed: callObserved, ...(generatedLaneKey ? { generatedLaneKey } : {}) });
2722
- childOrder.push(key);
2723
- trace.push({ operation: "run", key, state: "started", ...workflowStringMetadata(params), ...(generatedLaneKey ? { generatedLaneKey } : {}) });
2724
- traceChanged();
2725
- respond(deliver(promise), `runs.run('${key}') result`, (error) => children.set(key, responseBoundaryFailure(key, error)));
2726
- });
2727
- worker.postMessage({ type: "start", script: options.script, ...(options.args ? { args: options.args } : {}), stateEnabled: options.state !== undefined });
2728
- });
2729
- }
2730
- //# sourceMappingURL=scripted-workflow.js.map