@emiliosp/pi-maestro 0.16.0 → 0.18.0

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 +6 -4
  2. package/CHANGELOG.md +18 -0
  3. package/README.md +14 -10
  4. package/ROADMAP.md +207 -147
  5. package/TECH_STACK.md +1 -2
  6. package/agents/builder.md +8 -19
  7. package/agents/simplifier.md +0 -11
  8. package/agents/verifier.md +12 -23
  9. package/docs/configuration.md +9 -10
  10. package/docs/glossary.md +5 -3
  11. package/docs/subagent-integration.md +28 -27
  12. package/docs/workflow.md +48 -36
  13. package/extensions/maestro.ts +1 -1
  14. package/package.json +8 -16
  15. package/src/config/schema.ts +0 -6
  16. package/src/delegation/SubSessionManager.ts +102 -0
  17. package/src/delegation/TaskExecutionError.ts +20 -0
  18. package/src/delegation/createChildServices.ts +110 -0
  19. package/src/delegation/executeTask.ts +56 -0
  20. package/src/delegation/readTaskResult.ts +27 -0
  21. package/src/maestro/checks/assertEnvironment.ts +6 -113
  22. package/src/maestro/instructions/getMaestroInstructions.ts +15 -12
  23. package/src/tools/child/record-builder-handoff.ts +28 -30
  24. package/src/tools/child/record-simplifier-handoff.ts +33 -35
  25. package/src/tools/child/record-verifier-handoff.ts +37 -39
  26. package/src/tools/main/run-builder.ts +9 -28
  27. package/src/tools/main/run-simplifier.ts +8 -26
  28. package/src/tools/main/run-verifier.ts +9 -27
  29. package/src/tools/utils/executeRoleTask.ts +57 -0
  30. package/templates/spec.md +23 -11
  31. package/extensions/maestro-subagent.ts +0 -16
  32. package/node_modules/@js-temporal/polyfill/CHANGELOG.md +0 -453
  33. package/node_modules/@js-temporal/polyfill/LICENSE +0 -13
  34. package/node_modules/@js-temporal/polyfill/README.md +0 -90
  35. package/node_modules/@js-temporal/polyfill/dist/index.cjs +0 -2
  36. package/node_modules/@js-temporal/polyfill/dist/index.cjs.map +0 -1
  37. package/node_modules/@js-temporal/polyfill/dist/index.esm.js +0 -2
  38. package/node_modules/@js-temporal/polyfill/dist/index.esm.js.map +0 -1
  39. package/node_modules/@js-temporal/polyfill/dist/index.umd.js +0 -2
  40. package/node_modules/@js-temporal/polyfill/dist/index.umd.js.map +0 -1
  41. package/node_modules/@js-temporal/polyfill/index.d.cts +0 -1215
  42. package/node_modules/@js-temporal/polyfill/index.d.ts +0 -1215
  43. package/node_modules/@js-temporal/polyfill/lib/assert.ts +0 -8
  44. package/node_modules/@js-temporal/polyfill/lib/bigintmath.ts +0 -39
  45. package/node_modules/@js-temporal/polyfill/lib/calendar.ts +0 -2424
  46. package/node_modules/@js-temporal/polyfill/lib/debug.ts +0 -7
  47. package/node_modules/@js-temporal/polyfill/lib/duration.ts +0 -438
  48. package/node_modules/@js-temporal/polyfill/lib/durationformat.d.ts +0 -93
  49. package/node_modules/@js-temporal/polyfill/lib/ecmascript.ts +0 -4973
  50. package/node_modules/@js-temporal/polyfill/lib/index.ts +0 -34
  51. package/node_modules/@js-temporal/polyfill/lib/init.ts +0 -43
  52. package/node_modules/@js-temporal/polyfill/lib/instant.ts +0 -138
  53. package/node_modules/@js-temporal/polyfill/lib/internaltypes.d.ts +0 -242
  54. package/node_modules/@js-temporal/polyfill/lib/intl.ts +0 -758
  55. package/node_modules/@js-temporal/polyfill/lib/intrinsicclass.ts +0 -162
  56. package/node_modules/@js-temporal/polyfill/lib/legacydate.ts +0 -17
  57. package/node_modules/@js-temporal/polyfill/lib/math.ts +0 -96
  58. package/node_modules/@js-temporal/polyfill/lib/now.ts +0 -48
  59. package/node_modules/@js-temporal/polyfill/lib/plaindate.ts +0 -212
  60. package/node_modules/@js-temporal/polyfill/lib/plaindatetime.ts +0 -274
  61. package/node_modules/@js-temporal/polyfill/lib/plainmonthday.ts +0 -110
  62. package/node_modules/@js-temporal/polyfill/lib/plaintime.ts +0 -154
  63. package/node_modules/@js-temporal/polyfill/lib/plainyearmonth.ts +0 -157
  64. package/node_modules/@js-temporal/polyfill/lib/regex.ts +0 -59
  65. package/node_modules/@js-temporal/polyfill/lib/slots.ts +0 -341
  66. package/node_modules/@js-temporal/polyfill/lib/temporal.ts +0 -10
  67. package/node_modules/@js-temporal/polyfill/lib/timeduration.ts +0 -149
  68. package/node_modules/@js-temporal/polyfill/lib/zoneddatetime.ts +0 -492
  69. package/node_modules/@js-temporal/polyfill/package.json +0 -143
  70. package/node_modules/acorn/CHANGELOG.md +0 -998
  71. package/node_modules/acorn/LICENSE +0 -21
  72. package/node_modules/acorn/README.md +0 -309
  73. package/node_modules/acorn/bin/acorn +0 -4
  74. package/node_modules/acorn/dist/acorn.d.mts +0 -897
  75. package/node_modules/acorn/dist/acorn.d.ts +0 -897
  76. package/node_modules/acorn/dist/acorn.js +0 -6342
  77. package/node_modules/acorn/dist/acorn.mjs +0 -6313
  78. package/node_modules/acorn/dist/bin.js +0 -90
  79. package/node_modules/acorn/package.json +0 -50
  80. package/node_modules/jiti/LICENSE +0 -21
  81. package/node_modules/jiti/README.md +0 -258
  82. package/node_modules/jiti/dist/babel.cjs +0 -257
  83. package/node_modules/jiti/dist/jiti.cjs +0 -1
  84. package/node_modules/jiti/lib/jiti-cli.mjs +0 -34
  85. package/node_modules/jiti/lib/jiti-hooks.mjs +0 -124
  86. package/node_modules/jiti/lib/jiti-native.mjs +0 -121
  87. package/node_modules/jiti/lib/jiti-register.d.mts +0 -1
  88. package/node_modules/jiti/lib/jiti-register.mjs +0 -4
  89. package/node_modules/jiti/lib/jiti-static.mjs +0 -23
  90. package/node_modules/jiti/lib/jiti.cjs +0 -30
  91. package/node_modules/jiti/lib/jiti.d.cts +0 -8
  92. package/node_modules/jiti/lib/jiti.d.mts +0 -8
  93. package/node_modules/jiti/lib/jiti.mjs +0 -29
  94. package/node_modules/jiti/lib/types.d.ts +0 -420
  95. package/node_modules/jiti/package.json +0 -146
  96. package/node_modules/jsbi/LICENSE +0 -176
  97. package/node_modules/jsbi/README.md +0 -173
  98. package/node_modules/jsbi/dist/jsbi-cjs.js +0 -2
  99. package/node_modules/jsbi/dist/jsbi-cjs.js.map +0 -1
  100. package/node_modules/jsbi/dist/jsbi-umd.js +0 -2
  101. package/node_modules/jsbi/dist/jsbi-umd.js.map +0 -1
  102. package/node_modules/jsbi/dist/jsbi.mjs +0 -2
  103. package/node_modules/jsbi/dist/jsbi.mjs.map +0 -1
  104. package/node_modules/jsbi/jsbi.d.ts +0 -43
  105. package/node_modules/jsbi/package.json +0 -35
  106. package/node_modules/pi-subagents/CHANGELOG.md +0 -3081
  107. package/node_modules/pi-subagents/LICENSE +0 -21
  108. package/node_modules/pi-subagents/README.md +0 -129
  109. package/node_modules/pi-subagents/agents/claude-code-writer.md +0 -16
  110. package/node_modules/pi-subagents/agents/claude-code.md +0 -15
  111. package/node_modules/pi-subagents/agents/codex-exec-writer.md +0 -16
  112. package/node_modules/pi-subagents/agents/codex-exec.md +0 -15
  113. package/node_modules/pi-subagents/agents/cursor-agent-writer.md +0 -15
  114. package/node_modules/pi-subagents/agents/cursor-agent.md +0 -14
  115. package/node_modules/pi-subagents/agents/delegate.md +0 -14
  116. package/node_modules/pi-subagents/agents/evidence-auditor.md +0 -35
  117. package/node_modules/pi-subagents/agents/oracle.md +0 -68
  118. package/node_modules/pi-subagents/agents/researcher.md +0 -59
  119. package/node_modules/pi-subagents/agents/reviewer.md +0 -48
  120. package/node_modules/pi-subagents/agents/scout.md +0 -47
  121. package/node_modules/pi-subagents/agents/worker.md +0 -43
  122. package/node_modules/pi-subagents/async-retention-discovery-worker.mjs +0 -180
  123. package/node_modules/pi-subagents/docs/agents.md +0 -627
  124. package/node_modules/pi-subagents/docs/configuration.md +0 -756
  125. package/node_modules/pi-subagents/docs/extension-api.md +0 -661
  126. package/node_modules/pi-subagents/docs/missions.md +0 -162
  127. package/node_modules/pi-subagents/docs/models.md +0 -253
  128. package/node_modules/pi-subagents/docs/observability.md +0 -335
  129. package/node_modules/pi-subagents/docs/standalone-background.md +0 -59
  130. package/node_modules/pi-subagents/docs/tool-reference.md +0 -558
  131. package/node_modules/pi-subagents/docs/watchdog.md +0 -187
  132. package/node_modules/pi-subagents/docs/workflows.md +0 -577
  133. package/node_modules/pi-subagents/index.d.ts +0 -3
  134. package/node_modules/pi-subagents/index.d.ts.map +0 -1
  135. package/node_modules/pi-subagents/index.js +0 -15
  136. package/node_modules/pi-subagents/index.js.map +0 -1
  137. package/node_modules/pi-subagents/inspector-runner.mjs +0 -11
  138. package/node_modules/pi-subagents/install.mjs +0 -93
  139. package/node_modules/pi-subagents/node_modules/yaml/LICENSE +0 -13
  140. package/node_modules/pi-subagents/node_modules/yaml/README.md +0 -172
  141. package/node_modules/pi-subagents/node_modules/yaml/bin.mjs +0 -11
  142. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/compose-collection.js +0 -88
  143. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/compose-doc.js +0 -43
  144. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/compose-node.js +0 -109
  145. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/compose-scalar.js +0 -86
  146. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/composer.js +0 -217
  147. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-block-map.js +0 -115
  148. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +0 -198
  149. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +0 -49
  150. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-end.js +0 -37
  151. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +0 -207
  152. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +0 -223
  153. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/resolve-props.js +0 -146
  154. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/util-contains-newline.js +0 -34
  155. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +0 -26
  156. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +0 -15
  157. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/compose/util-map-includes.js +0 -13
  158. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/doc/Document.js +0 -335
  159. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/doc/anchors.js +0 -71
  160. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/doc/applyReviver.js +0 -55
  161. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/doc/createNode.js +0 -88
  162. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/doc/directives.js +0 -176
  163. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/errors.js +0 -57
  164. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/index.js +0 -17
  165. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/log.js +0 -11
  166. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/Alias.js +0 -114
  167. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/Collection.js +0 -147
  168. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/Node.js +0 -38
  169. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/Pair.js +0 -36
  170. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/Scalar.js +0 -24
  171. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/YAMLMap.js +0 -144
  172. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +0 -113
  173. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +0 -63
  174. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/identity.js +0 -36
  175. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/nodes/toJS.js +0 -37
  176. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/cst-scalar.js +0 -214
  177. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/cst-stringify.js +0 -61
  178. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/cst-visit.js +0 -97
  179. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/cst.js +0 -98
  180. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/lexer.js +0 -717
  181. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/line-counter.js +0 -39
  182. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/parse/parser.js +0 -967
  183. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/public-api.js +0 -102
  184. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/Schema.js +0 -37
  185. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/common/map.js +0 -17
  186. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/common/null.js +0 -15
  187. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/common/seq.js +0 -17
  188. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/common/string.js +0 -14
  189. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/core/bool.js +0 -19
  190. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/core/float.js +0 -43
  191. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/core/int.js +0 -38
  192. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/core/schema.js +0 -23
  193. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/json/schema.js +0 -62
  194. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/tags.js +0 -96
  195. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +0 -58
  196. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +0 -26
  197. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +0 -46
  198. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +0 -71
  199. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +0 -64
  200. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +0 -74
  201. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +0 -78
  202. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +0 -39
  203. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +0 -93
  204. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +0 -101
  205. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +0 -146
  206. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringify.js +0 -129
  207. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +0 -153
  208. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringifyComment.js +0 -20
  209. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +0 -85
  210. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +0 -24
  211. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringifyPair.js +0 -150
  212. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/stringify/stringifyString.js +0 -336
  213. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/util.js +0 -11
  214. package/node_modules/pi-subagents/node_modules/yaml/browser/dist/visit.js +0 -233
  215. package/node_modules/pi-subagents/node_modules/yaml/browser/index.js +0 -5
  216. package/node_modules/pi-subagents/node_modules/yaml/browser/package.json +0 -3
  217. package/node_modules/pi-subagents/node_modules/yaml/dist/cli.d.ts +0 -8
  218. package/node_modules/pi-subagents/node_modules/yaml/dist/cli.mjs +0 -201
  219. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-collection.d.ts +0 -11
  220. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-collection.js +0 -90
  221. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-doc.d.ts +0 -7
  222. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-doc.js +0 -45
  223. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-node.d.ts +0 -29
  224. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-node.js +0 -112
  225. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-scalar.d.ts +0 -5
  226. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/compose-scalar.js +0 -88
  227. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/composer.d.ts +0 -63
  228. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/composer.js +0 -222
  229. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-block-map.d.ts +0 -6
  230. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-block-map.js +0 -117
  231. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +0 -11
  232. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-block-scalar.js +0 -200
  233. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +0 -6
  234. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-block-seq.js +0 -51
  235. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-end.d.ts +0 -6
  236. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-end.js +0 -39
  237. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +0 -7
  238. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-flow-collection.js +0 -209
  239. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +0 -10
  240. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-flow-scalar.js +0 -225
  241. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-props.d.ts +0 -23
  242. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/resolve-props.js +0 -148
  243. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-contains-newline.d.ts +0 -2
  244. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-contains-newline.js +0 -36
  245. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +0 -2
  246. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-empty-scalar-position.js +0 -28
  247. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +0 -3
  248. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-flow-indent-check.js +0 -17
  249. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-map-includes.d.ts +0 -4
  250. package/node_modules/pi-subagents/node_modules/yaml/dist/compose/util-map-includes.js +0 -15
  251. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/Document.d.ts +0 -141
  252. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/Document.js +0 -337
  253. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/anchors.d.ts +0 -24
  254. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/anchors.js +0 -76
  255. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/applyReviver.d.ts +0 -9
  256. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/applyReviver.js +0 -57
  257. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/createNode.d.ts +0 -17
  258. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/createNode.js +0 -90
  259. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/directives.d.ts +0 -49
  260. package/node_modules/pi-subagents/node_modules/yaml/dist/doc/directives.js +0 -178
  261. package/node_modules/pi-subagents/node_modules/yaml/dist/errors.d.ts +0 -21
  262. package/node_modules/pi-subagents/node_modules/yaml/dist/errors.js +0 -62
  263. package/node_modules/pi-subagents/node_modules/yaml/dist/index.d.ts +0 -25
  264. package/node_modules/pi-subagents/node_modules/yaml/dist/index.js +0 -50
  265. package/node_modules/pi-subagents/node_modules/yaml/dist/log.d.ts +0 -3
  266. package/node_modules/pi-subagents/node_modules/yaml/dist/log.js +0 -19
  267. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Alias.d.ts +0 -29
  268. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Alias.js +0 -116
  269. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Collection.d.ts +0 -73
  270. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Collection.js +0 -151
  271. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Node.d.ts +0 -53
  272. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Node.js +0 -40
  273. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Pair.d.ts +0 -22
  274. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Pair.js +0 -39
  275. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Scalar.d.ts +0 -43
  276. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/Scalar.js +0 -27
  277. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/YAMLMap.d.ts +0 -53
  278. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/YAMLMap.js +0 -147
  279. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +0 -60
  280. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/YAMLSeq.js +0 -115
  281. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +0 -4
  282. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/addPairToJSMap.js +0 -65
  283. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/identity.d.ts +0 -23
  284. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/identity.js +0 -53
  285. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/toJS.d.ts +0 -29
  286. package/node_modules/pi-subagents/node_modules/yaml/dist/nodes/toJS.js +0 -39
  287. package/node_modules/pi-subagents/node_modules/yaml/dist/options.d.ts +0 -350
  288. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst-scalar.d.ts +0 -64
  289. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst-scalar.js +0 -218
  290. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst-stringify.d.ts +0 -8
  291. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst-stringify.js +0 -63
  292. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst-visit.d.ts +0 -39
  293. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst-visit.js +0 -99
  294. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst.d.ts +0 -109
  295. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/cst.js +0 -112
  296. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/lexer.d.ts +0 -87
  297. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/lexer.js +0 -719
  298. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/line-counter.d.ts +0 -22
  299. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/line-counter.js +0 -41
  300. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/parser.d.ts +0 -84
  301. package/node_modules/pi-subagents/node_modules/yaml/dist/parse/parser.js +0 -972
  302. package/node_modules/pi-subagents/node_modules/yaml/dist/public-api.d.ts +0 -44
  303. package/node_modules/pi-subagents/node_modules/yaml/dist/public-api.js +0 -107
  304. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/Schema.d.ts +0 -17
  305. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/Schema.js +0 -39
  306. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/map.d.ts +0 -2
  307. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/map.js +0 -19
  308. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/null.d.ts +0 -4
  309. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/null.js +0 -17
  310. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/seq.d.ts +0 -2
  311. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/seq.js +0 -19
  312. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/string.d.ts +0 -2
  313. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/common/string.js +0 -16
  314. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/bool.d.ts +0 -4
  315. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/bool.js +0 -21
  316. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/float.d.ts +0 -4
  317. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/float.js +0 -47
  318. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/int.d.ts +0 -4
  319. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/int.js +0 -42
  320. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/schema.d.ts +0 -1
  321. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/core/schema.js +0 -25
  322. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/json/schema.d.ts +0 -2
  323. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/json/schema.js +0 -64
  324. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/json-schema.d.ts +0 -69
  325. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/tags.d.ts +0 -48
  326. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/tags.js +0 -99
  327. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/types.d.ts +0 -92
  328. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +0 -2
  329. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/binary.js +0 -70
  330. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +0 -7
  331. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/bool.js +0 -29
  332. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +0 -4
  333. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/float.js +0 -50
  334. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +0 -5
  335. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/int.js +0 -76
  336. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +0 -9
  337. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/merge.js +0 -68
  338. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +0 -22
  339. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/omap.js +0 -77
  340. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +0 -10
  341. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +0 -82
  342. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +0 -1
  343. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/schema.js +0 -41
  344. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +0 -28
  345. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/set.js +0 -96
  346. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +0 -6
  347. package/node_modules/pi-subagents/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +0 -105
  348. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +0 -34
  349. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/foldFlowLines.js +0 -151
  350. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringify.d.ts +0 -21
  351. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringify.js +0 -132
  352. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +0 -17
  353. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyCollection.js +0 -155
  354. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyComment.d.ts +0 -10
  355. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyComment.js +0 -24
  356. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +0 -4
  357. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyDocument.js +0 -87
  358. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +0 -2
  359. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyNumber.js +0 -26
  360. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyPair.d.ts +0 -3
  361. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyPair.js +0 -152
  362. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyString.d.ts +0 -9
  363. package/node_modules/pi-subagents/node_modules/yaml/dist/stringify/stringifyString.js +0 -338
  364. package/node_modules/pi-subagents/node_modules/yaml/dist/test-events.d.ts +0 -4
  365. package/node_modules/pi-subagents/node_modules/yaml/dist/test-events.js +0 -134
  366. package/node_modules/pi-subagents/node_modules/yaml/dist/util.d.ts +0 -16
  367. package/node_modules/pi-subagents/node_modules/yaml/dist/util.js +0 -28
  368. package/node_modules/pi-subagents/node_modules/yaml/dist/visit.d.ts +0 -102
  369. package/node_modules/pi-subagents/node_modules/yaml/dist/visit.js +0 -236
  370. package/node_modules/pi-subagents/node_modules/yaml/package.json +0 -97
  371. package/node_modules/pi-subagents/node_modules/yaml/util.js +0 -2
  372. package/node_modules/pi-subagents/package.json +0 -138
  373. package/node_modules/pi-subagents/prompts/council.md +0 -63
  374. package/node_modules/pi-subagents/prompts/gather-context-and-clarify.md +0 -13
  375. package/node_modules/pi-subagents/prompts/parallel-cleanup.md +0 -59
  376. package/node_modules/pi-subagents/prompts/parallel-research.md +0 -50
  377. package/node_modules/pi-subagents/prompts/parallel-review.md +0 -58
  378. package/node_modules/pi-subagents/prompts/review-loop.md +0 -47
  379. package/node_modules/pi-subagents/runner-peer-loader.mjs +0 -21
  380. package/node_modules/pi-subagents/runner-peer-preload.mjs +0 -30
  381. package/node_modules/pi-subagents/skills/council-mode/SKILL.md +0 -59
  382. package/node_modules/pi-subagents/skills/council-mode/references/pass-contracts.md +0 -150
  383. package/node_modules/pi-subagents/skills/pi-subagents/SKILL.md +0 -123
  384. package/node_modules/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +0 -74
  385. package/node_modules/pi-subagents/skills/pi-subagents/references/execution-controls.md +0 -561
  386. package/node_modules/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +0 -165
  387. package/node_modules/pi-subagents/skills/pi-subagents/references/multi-lane-orchestration.md +0 -61
  388. package/node_modules/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +0 -297
  389. package/node_modules/pi-subagents/skills/pi-subagents/references/review-and-validation.md +0 -73
  390. package/node_modules/pi-subagents/src/agents/advertised-agent-prompt.d.ts +0 -14
  391. package/node_modules/pi-subagents/src/agents/advertised-agent-prompt.d.ts.map +0 -1
  392. package/node_modules/pi-subagents/src/agents/advertised-agent-prompt.js +0 -69
  393. package/node_modules/pi-subagents/src/agents/advertised-agent-prompt.js.map +0 -1
  394. package/node_modules/pi-subagents/src/agents/agent-management.d.ts +0 -28
  395. package/node_modules/pi-subagents/src/agents/agent-management.d.ts.map +0 -1
  396. package/node_modules/pi-subagents/src/agents/agent-management.js +0 -1522
  397. package/node_modules/pi-subagents/src/agents/agent-management.js.map +0 -1
  398. package/node_modules/pi-subagents/src/agents/agent-memory.d.ts +0 -49
  399. package/node_modules/pi-subagents/src/agents/agent-memory.d.ts.map +0 -1
  400. package/node_modules/pi-subagents/src/agents/agent-memory.js +0 -349
  401. package/node_modules/pi-subagents/src/agents/agent-memory.js.map +0 -1
  402. package/node_modules/pi-subagents/src/agents/agent-refinements.d.ts +0 -100
  403. package/node_modules/pi-subagents/src/agents/agent-refinements.d.ts.map +0 -1
  404. package/node_modules/pi-subagents/src/agents/agent-refinements.js +0 -569
  405. package/node_modules/pi-subagents/src/agents/agent-refinements.js.map +0 -1
  406. package/node_modules/pi-subagents/src/agents/agent-scope.d.ts +0 -4
  407. package/node_modules/pi-subagents/src/agents/agent-scope.d.ts.map +0 -1
  408. package/node_modules/pi-subagents/src/agents/agent-scope.js +0 -9
  409. package/node_modules/pi-subagents/src/agents/agent-scope.js.map +0 -1
  410. package/node_modules/pi-subagents/src/agents/agent-selection.d.ts +0 -3
  411. package/node_modules/pi-subagents/src/agents/agent-selection.d.ts.map +0 -1
  412. package/node_modules/pi-subagents/src/agents/agent-selection.js +0 -23
  413. package/node_modules/pi-subagents/src/agents/agent-selection.js.map +0 -1
  414. package/node_modules/pi-subagents/src/agents/agent-serializer.d.ts +0 -8
  415. package/node_modules/pi-subagents/src/agents/agent-serializer.d.ts.map +0 -1
  416. package/node_modules/pi-subagents/src/agents/agent-serializer.js +0 -206
  417. package/node_modules/pi-subagents/src/agents/agent-serializer.js.map +0 -1
  418. package/node_modules/pi-subagents/src/agents/agents.d.ts +0 -344
  419. package/node_modules/pi-subagents/src/agents/agents.d.ts.map +0 -1
  420. package/node_modules/pi-subagents/src/agents/agents.js +0 -2748
  421. package/node_modules/pi-subagents/src/agents/agents.js.map +0 -1
  422. package/node_modules/pi-subagents/src/agents/builtin-names.d.ts +0 -2
  423. package/node_modules/pi-subagents/src/agents/builtin-names.d.ts.map +0 -1
  424. package/node_modules/pi-subagents/src/agents/builtin-names.js +0 -17
  425. package/node_modules/pi-subagents/src/agents/builtin-names.js.map +0 -1
  426. package/node_modules/pi-subagents/src/agents/chain-serializer.d.ts +0 -7
  427. package/node_modules/pi-subagents/src/agents/chain-serializer.d.ts.map +0 -1
  428. package/node_modules/pi-subagents/src/agents/chain-serializer.js +0 -319
  429. package/node_modules/pi-subagents/src/agents/chain-serializer.js.map +0 -1
  430. package/node_modules/pi-subagents/src/agents/frontmatter.d.ts +0 -16
  431. package/node_modules/pi-subagents/src/agents/frontmatter.d.ts.map +0 -1
  432. package/node_modules/pi-subagents/src/agents/frontmatter.js +0 -142
  433. package/node_modules/pi-subagents/src/agents/frontmatter.js.map +0 -1
  434. package/node_modules/pi-subagents/src/agents/global-npm-root.d.ts +0 -7
  435. package/node_modules/pi-subagents/src/agents/global-npm-root.d.ts.map +0 -1
  436. package/node_modules/pi-subagents/src/agents/global-npm-root.js +0 -58
  437. package/node_modules/pi-subagents/src/agents/global-npm-root.js.map +0 -1
  438. package/node_modules/pi-subagents/src/agents/identity.d.ts +0 -8
  439. package/node_modules/pi-subagents/src/agents/identity.d.ts.map +0 -1
  440. package/node_modules/pi-subagents/src/agents/identity.js +0 -30
  441. package/node_modules/pi-subagents/src/agents/identity.js.map +0 -1
  442. package/node_modules/pi-subagents/src/agents/proactive-skills.d.ts +0 -36
  443. package/node_modules/pi-subagents/src/agents/proactive-skills.d.ts.map +0 -1
  444. package/node_modules/pi-subagents/src/agents/proactive-skills.js +0 -156
  445. package/node_modules/pi-subagents/src/agents/proactive-skills.js.map +0 -1
  446. package/node_modules/pi-subagents/src/agents/runtime-agent-events.d.ts +0 -27
  447. package/node_modules/pi-subagents/src/agents/runtime-agent-events.d.ts.map +0 -1
  448. package/node_modules/pi-subagents/src/agents/runtime-agent-events.js +0 -53
  449. package/node_modules/pi-subagents/src/agents/runtime-agent-events.js.map +0 -1
  450. package/node_modules/pi-subagents/src/agents/runtime-agent-registry.d.ts +0 -64
  451. package/node_modules/pi-subagents/src/agents/runtime-agent-registry.d.ts.map +0 -1
  452. package/node_modules/pi-subagents/src/agents/runtime-agent-registry.js +0 -395
  453. package/node_modules/pi-subagents/src/agents/runtime-agent-registry.js.map +0 -1
  454. package/node_modules/pi-subagents/src/agents/skills.d.ts +0 -35
  455. package/node_modules/pi-subagents/src/agents/skills.d.ts.map +0 -1
  456. package/node_modules/pi-subagents/src/agents/skills.js +0 -718
  457. package/node_modules/pi-subagents/src/agents/skills.js.map +0 -1
  458. package/node_modules/pi-subagents/src/api/agents.d.ts +0 -5
  459. package/node_modules/pi-subagents/src/api/agents.d.ts.map +0 -1
  460. package/node_modules/pi-subagents/src/api/agents.js +0 -3
  461. package/node_modules/pi-subagents/src/api/agents.js.map +0 -1
  462. package/node_modules/pi-subagents/src/api/background-work.d.ts +0 -39
  463. package/node_modules/pi-subagents/src/api/background-work.d.ts.map +0 -1
  464. package/node_modules/pi-subagents/src/api/background-work.js +0 -165
  465. package/node_modules/pi-subagents/src/api/background-work.js.map +0 -1
  466. package/node_modules/pi-subagents/src/api/capability-ceiling.d.ts +0 -2
  467. package/node_modules/pi-subagents/src/api/capability-ceiling.d.ts.map +0 -1
  468. package/node_modules/pi-subagents/src/api/capability-ceiling.js +0 -2
  469. package/node_modules/pi-subagents/src/api/capability-ceiling.js.map +0 -1
  470. package/node_modules/pi-subagents/src/api/child-tool-plan.d.ts +0 -2
  471. package/node_modules/pi-subagents/src/api/child-tool-plan.d.ts.map +0 -1
  472. package/node_modules/pi-subagents/src/api/child-tool-plan.js +0 -2
  473. package/node_modules/pi-subagents/src/api/child-tool-plan.js.map +0 -1
  474. package/node_modules/pi-subagents/src/api/control-channel.d.ts +0 -2
  475. package/node_modules/pi-subagents/src/api/control-channel.d.ts.map +0 -1
  476. package/node_modules/pi-subagents/src/api/control-channel.js +0 -2
  477. package/node_modules/pi-subagents/src/api/control-channel.js.map +0 -1
  478. package/node_modules/pi-subagents/src/api/delegation.d.ts +0 -113
  479. package/node_modules/pi-subagents/src/api/delegation.d.ts.map +0 -1
  480. package/node_modules/pi-subagents/src/api/delegation.js +0 -9
  481. package/node_modules/pi-subagents/src/api/delegation.js.map +0 -1
  482. package/node_modules/pi-subagents/src/api/external-job-provider.d.ts +0 -58
  483. package/node_modules/pi-subagents/src/api/external-job-provider.d.ts.map +0 -1
  484. package/node_modules/pi-subagents/src/api/external-job-provider.js +0 -140
  485. package/node_modules/pi-subagents/src/api/external-job-provider.js.map +0 -1
  486. package/node_modules/pi-subagents/src/api/external-runs.d.ts +0 -48
  487. package/node_modules/pi-subagents/src/api/external-runs.d.ts.map +0 -1
  488. package/node_modules/pi-subagents/src/api/external-runs.js +0 -246
  489. package/node_modules/pi-subagents/src/api/external-runs.js.map +0 -1
  490. package/node_modules/pi-subagents/src/api/inspectors.d.ts +0 -21
  491. package/node_modules/pi-subagents/src/api/inspectors.d.ts.map +0 -1
  492. package/node_modules/pi-subagents/src/api/inspectors.js +0 -12
  493. package/node_modules/pi-subagents/src/api/inspectors.js.map +0 -1
  494. package/node_modules/pi-subagents/src/api/intercom-bridge.d.ts +0 -2
  495. package/node_modules/pi-subagents/src/api/intercom-bridge.d.ts.map +0 -1
  496. package/node_modules/pi-subagents/src/api/intercom-bridge.js +0 -2
  497. package/node_modules/pi-subagents/src/api/intercom-bridge.js.map +0 -1
  498. package/node_modules/pi-subagents/src/api/preflight.d.ts +0 -179
  499. package/node_modules/pi-subagents/src/api/preflight.d.ts.map +0 -1
  500. package/node_modules/pi-subagents/src/api/preflight.js +0 -410
  501. package/node_modules/pi-subagents/src/api/preflight.js.map +0 -1
  502. package/node_modules/pi-subagents/src/api/project-panes.d.ts +0 -8
  503. package/node_modules/pi-subagents/src/api/project-panes.d.ts.map +0 -1
  504. package/node_modules/pi-subagents/src/api/project-panes.js +0 -8
  505. package/node_modules/pi-subagents/src/api/project-panes.js.map +0 -1
  506. package/node_modules/pi-subagents/src/api/required-child-extensions.d.ts +0 -2
  507. package/node_modules/pi-subagents/src/api/required-child-extensions.d.ts.map +0 -1
  508. package/node_modules/pi-subagents/src/api/required-child-extensions.js +0 -2
  509. package/node_modules/pi-subagents/src/api/required-child-extensions.js.map +0 -1
  510. package/node_modules/pi-subagents/src/api/shared-types.d.ts +0 -2
  511. package/node_modules/pi-subagents/src/api/shared-types.d.ts.map +0 -1
  512. package/node_modules/pi-subagents/src/api/shared-types.js +0 -2
  513. package/node_modules/pi-subagents/src/api/shared-types.js.map +0 -1
  514. package/node_modules/pi-subagents/src/api/workflow-resources.d.ts +0 -3
  515. package/node_modules/pi-subagents/src/api/workflow-resources.d.ts.map +0 -1
  516. package/node_modules/pi-subagents/src/api/workflow-resources.js +0 -2
  517. package/node_modules/pi-subagents/src/api/workflow-resources.js.map +0 -1
  518. package/node_modules/pi-subagents/src/extension/active-runs-prompt.d.ts +0 -8
  519. package/node_modules/pi-subagents/src/extension/active-runs-prompt.d.ts.map +0 -1
  520. package/node_modules/pi-subagents/src/extension/active-runs-prompt.js +0 -30
  521. package/node_modules/pi-subagents/src/extension/active-runs-prompt.js.map +0 -1
  522. package/node_modules/pi-subagents/src/extension/config.d.ts +0 -8
  523. package/node_modules/pi-subagents/src/extension/config.d.ts.map +0 -1
  524. package/node_modules/pi-subagents/src/extension/config.js +0 -283
  525. package/node_modules/pi-subagents/src/extension/config.js.map +0 -1
  526. package/node_modules/pi-subagents/src/extension/control-notices.d.ts +0 -19
  527. package/node_modules/pi-subagents/src/extension/control-notices.d.ts.map +0 -1
  528. package/node_modules/pi-subagents/src/extension/control-notices.js +0 -30
  529. package/node_modules/pi-subagents/src/extension/control-notices.js.map +0 -1
  530. package/node_modules/pi-subagents/src/extension/declaration-pinning.d.ts +0 -19
  531. package/node_modules/pi-subagents/src/extension/declaration-pinning.d.ts.map +0 -1
  532. package/node_modules/pi-subagents/src/extension/declaration-pinning.js +0 -154
  533. package/node_modules/pi-subagents/src/extension/declaration-pinning.js.map +0 -1
  534. package/node_modules/pi-subagents/src/extension/doctor.d.ts +0 -35
  535. package/node_modules/pi-subagents/src/extension/doctor.d.ts.map +0 -1
  536. package/node_modules/pi-subagents/src/extension/doctor.js +0 -226
  537. package/node_modules/pi-subagents/src/extension/doctor.js.map +0 -1
  538. package/node_modules/pi-subagents/src/extension/fanout-child.d.ts +0 -7
  539. package/node_modules/pi-subagents/src/extension/fanout-child.d.ts.map +0 -1
  540. package/node_modules/pi-subagents/src/extension/fanout-child.js +0 -278
  541. package/node_modules/pi-subagents/src/extension/fanout-child.js.map +0 -1
  542. package/node_modules/pi-subagents/src/extension/herdr-pi-bridge.d.ts +0 -17
  543. package/node_modules/pi-subagents/src/extension/herdr-pi-bridge.d.ts.map +0 -1
  544. package/node_modules/pi-subagents/src/extension/herdr-pi-bridge.js +0 -245
  545. package/node_modules/pi-subagents/src/extension/herdr-pi-bridge.js.map +0 -1
  546. package/node_modules/pi-subagents/src/extension/index.d.ts +0 -19
  547. package/node_modules/pi-subagents/src/extension/index.d.ts.map +0 -1
  548. package/node_modules/pi-subagents/src/extension/index.js +0 -1093
  549. package/node_modules/pi-subagents/src/extension/index.js.map +0 -1
  550. package/node_modules/pi-subagents/src/extension/public-execution.d.ts +0 -71
  551. package/node_modules/pi-subagents/src/extension/public-execution.d.ts.map +0 -1
  552. package/node_modules/pi-subagents/src/extension/public-execution.js +0 -212
  553. package/node_modules/pi-subagents/src/extension/public-execution.js.map +0 -1
  554. package/node_modules/pi-subagents/src/extension/reply-workflow-script.d.ts +0 -12
  555. package/node_modules/pi-subagents/src/extension/reply-workflow-script.d.ts.map +0 -1
  556. package/node_modules/pi-subagents/src/extension/reply-workflow-script.js +0 -70
  557. package/node_modules/pi-subagents/src/extension/reply-workflow-script.js.map +0 -1
  558. package/node_modules/pi-subagents/src/extension/rpc.d.ts +0 -85
  559. package/node_modules/pi-subagents/src/extension/rpc.d.ts.map +0 -1
  560. package/node_modules/pi-subagents/src/extension/rpc.js +0 -726
  561. package/node_modules/pi-subagents/src/extension/rpc.js.map +0 -1
  562. package/node_modules/pi-subagents/src/extension/schemas.d.ts +0 -275
  563. package/node_modules/pi-subagents/src/extension/schemas.d.ts.map +0 -1
  564. package/node_modules/pi-subagents/src/extension/schemas.js +0 -311
  565. package/node_modules/pi-subagents/src/extension/schemas.js.map +0 -1
  566. package/node_modules/pi-subagents/src/extension/steering-notices.d.ts +0 -15
  567. package/node_modules/pi-subagents/src/extension/steering-notices.d.ts.map +0 -1
  568. package/node_modules/pi-subagents/src/extension/steering-notices.js +0 -23
  569. package/node_modules/pi-subagents/src/extension/steering-notices.js.map +0 -1
  570. package/node_modules/pi-subagents/src/extension/subagent-guide.d.ts +0 -5
  571. package/node_modules/pi-subagents/src/extension/subagent-guide.d.ts.map +0 -1
  572. package/node_modules/pi-subagents/src/extension/subagent-guide.js +0 -116
  573. package/node_modules/pi-subagents/src/extension/subagent-guide.js.map +0 -1
  574. package/node_modules/pi-subagents/src/extension/subagent-options.d.ts +0 -8
  575. package/node_modules/pi-subagents/src/extension/subagent-options.d.ts.map +0 -1
  576. package/node_modules/pi-subagents/src/extension/subagent-options.js +0 -52
  577. package/node_modules/pi-subagents/src/extension/subagent-options.js.map +0 -1
  578. package/node_modules/pi-subagents/src/extension/tool-activation.d.ts +0 -7
  579. package/node_modules/pi-subagents/src/extension/tool-activation.d.ts.map +0 -1
  580. package/node_modules/pi-subagents/src/extension/tool-activation.js +0 -135
  581. package/node_modules/pi-subagents/src/extension/tool-activation.js.map +0 -1
  582. package/node_modules/pi-subagents/src/extension/tool-description.d.ts +0 -20
  583. package/node_modules/pi-subagents/src/extension/tool-description.d.ts.map +0 -1
  584. package/node_modules/pi-subagents/src/extension/tool-description.js +0 -170
  585. package/node_modules/pi-subagents/src/extension/tool-description.js.map +0 -1
  586. package/node_modules/pi-subagents/src/extension/tool-result.d.ts +0 -10
  587. package/node_modules/pi-subagents/src/extension/tool-result.d.ts.map +0 -1
  588. package/node_modules/pi-subagents/src/extension/tool-result.js +0 -17
  589. package/node_modules/pi-subagents/src/extension/tool-result.js.map +0 -1
  590. package/node_modules/pi-subagents/src/extension/upgrade-notice.d.ts +0 -7
  591. package/node_modules/pi-subagents/src/extension/upgrade-notice.d.ts.map +0 -1
  592. package/node_modules/pi-subagents/src/extension/upgrade-notice.js +0 -37
  593. package/node_modules/pi-subagents/src/extension/upgrade-notice.js.map +0 -1
  594. package/node_modules/pi-subagents/src/inspectors/actions.d.ts +0 -25
  595. package/node_modules/pi-subagents/src/inspectors/actions.d.ts.map +0 -1
  596. package/node_modules/pi-subagents/src/inspectors/actions.js +0 -183
  597. package/node_modules/pi-subagents/src/inspectors/actions.js.map +0 -1
  598. package/node_modules/pi-subagents/src/inspectors/ghostty/actions.d.ts +0 -12
  599. package/node_modules/pi-subagents/src/inspectors/ghostty/actions.d.ts.map +0 -1
  600. package/node_modules/pi-subagents/src/inspectors/ghostty/actions.js +0 -63
  601. package/node_modules/pi-subagents/src/inspectors/ghostty/actions.js.map +0 -1
  602. package/node_modules/pi-subagents/src/inspectors/ghostty/plugin.d.ts +0 -8
  603. package/node_modules/pi-subagents/src/inspectors/ghostty/plugin.d.ts.map +0 -1
  604. package/node_modules/pi-subagents/src/inspectors/ghostty/plugin.js +0 -24
  605. package/node_modules/pi-subagents/src/inspectors/ghostty/plugin.js.map +0 -1
  606. package/node_modules/pi-subagents/src/inspectors/herdr/actions.d.ts +0 -26
  607. package/node_modules/pi-subagents/src/inspectors/herdr/actions.d.ts.map +0 -1
  608. package/node_modules/pi-subagents/src/inspectors/herdr/actions.js +0 -134
  609. package/node_modules/pi-subagents/src/inspectors/herdr/actions.js.map +0 -1
  610. package/node_modules/pi-subagents/src/inspectors/herdr/client.d.ts +0 -42
  611. package/node_modules/pi-subagents/src/inspectors/herdr/client.d.ts.map +0 -1
  612. package/node_modules/pi-subagents/src/inspectors/herdr/client.js +0 -130
  613. package/node_modules/pi-subagents/src/inspectors/herdr/client.js.map +0 -1
  614. package/node_modules/pi-subagents/src/inspectors/herdr/focus.d.ts +0 -25
  615. package/node_modules/pi-subagents/src/inspectors/herdr/focus.d.ts.map +0 -1
  616. package/node_modules/pi-subagents/src/inspectors/herdr/focus.js +0 -50
  617. package/node_modules/pi-subagents/src/inspectors/herdr/focus.js.map +0 -1
  618. package/node_modules/pi-subagents/src/inspectors/herdr/plugin.d.ts +0 -7
  619. package/node_modules/pi-subagents/src/inspectors/herdr/plugin.d.ts.map +0 -1
  620. package/node_modules/pi-subagents/src/inspectors/herdr/plugin.js +0 -15
  621. package/node_modules/pi-subagents/src/inspectors/herdr/plugin.js.map +0 -1
  622. package/node_modules/pi-subagents/src/inspectors/herdr/project-panes.d.ts +0 -137
  623. package/node_modules/pi-subagents/src/inspectors/herdr/project-panes.d.ts.map +0 -1
  624. package/node_modules/pi-subagents/src/inspectors/herdr/project-panes.js +0 -608
  625. package/node_modules/pi-subagents/src/inspectors/herdr/project-panes.js.map +0 -1
  626. package/node_modules/pi-subagents/src/inspectors/inspector-runner.d.ts +0 -24
  627. package/node_modules/pi-subagents/src/inspectors/inspector-runner.d.ts.map +0 -1
  628. package/node_modules/pi-subagents/src/inspectors/inspector-runner.js +0 -162
  629. package/node_modules/pi-subagents/src/inspectors/inspector-runner.js.map +0 -1
  630. package/node_modules/pi-subagents/src/inspectors/plugins.d.ts +0 -9
  631. package/node_modules/pi-subagents/src/inspectors/plugins.d.ts.map +0 -1
  632. package/node_modules/pi-subagents/src/inspectors/plugins.js +0 -83
  633. package/node_modules/pi-subagents/src/inspectors/plugins.js.map +0 -1
  634. package/node_modules/pi-subagents/src/inspectors/session-roots-codec.d.ts +0 -16
  635. package/node_modules/pi-subagents/src/inspectors/session-roots-codec.d.ts.map +0 -1
  636. package/node_modules/pi-subagents/src/inspectors/session-roots-codec.js +0 -33
  637. package/node_modules/pi-subagents/src/inspectors/session-roots-codec.js.map +0 -1
  638. package/node_modules/pi-subagents/src/inspectors/shell-command.d.ts +0 -2
  639. package/node_modules/pi-subagents/src/inspectors/shell-command.d.ts.map +0 -1
  640. package/node_modules/pi-subagents/src/inspectors/shell-command.js +0 -17
  641. package/node_modules/pi-subagents/src/inspectors/shell-command.js.map +0 -1
  642. package/node_modules/pi-subagents/src/inspectors/tmux/actions.d.ts +0 -26
  643. package/node_modules/pi-subagents/src/inspectors/tmux/actions.d.ts.map +0 -1
  644. package/node_modules/pi-subagents/src/inspectors/tmux/actions.js +0 -182
  645. package/node_modules/pi-subagents/src/inspectors/tmux/actions.js.map +0 -1
  646. package/node_modules/pi-subagents/src/inspectors/tmux/client.d.ts +0 -28
  647. package/node_modules/pi-subagents/src/inspectors/tmux/client.d.ts.map +0 -1
  648. package/node_modules/pi-subagents/src/inspectors/tmux/client.js +0 -65
  649. package/node_modules/pi-subagents/src/inspectors/tmux/client.js.map +0 -1
  650. package/node_modules/pi-subagents/src/inspectors/tmux/plugin.d.ts +0 -8
  651. package/node_modules/pi-subagents/src/inspectors/tmux/plugin.d.ts.map +0 -1
  652. package/node_modules/pi-subagents/src/inspectors/tmux/plugin.js +0 -15
  653. package/node_modules/pi-subagents/src/inspectors/tmux/plugin.js.map +0 -1
  654. package/node_modules/pi-subagents/src/inspectors/types.d.ts +0 -49
  655. package/node_modules/pi-subagents/src/inspectors/types.d.ts.map +0 -1
  656. package/node_modules/pi-subagents/src/inspectors/types.js +0 -2
  657. package/node_modules/pi-subagents/src/inspectors/types.js.map +0 -1
  658. package/node_modules/pi-subagents/src/integrations/herdr-status.d.ts +0 -48
  659. package/node_modules/pi-subagents/src/integrations/herdr-status.d.ts.map +0 -1
  660. package/node_modules/pi-subagents/src/integrations/herdr-status.js +0 -351
  661. package/node_modules/pi-subagents/src/integrations/herdr-status.js.map +0 -1
  662. package/node_modules/pi-subagents/src/integrations/pi-web-session-liveness.d.ts +0 -20
  663. package/node_modules/pi-subagents/src/integrations/pi-web-session-liveness.d.ts.map +0 -1
  664. package/node_modules/pi-subagents/src/integrations/pi-web-session-liveness.js +0 -54
  665. package/node_modules/pi-subagents/src/integrations/pi-web-session-liveness.js.map +0 -1
  666. package/node_modules/pi-subagents/src/integrations/program-status.d.ts +0 -31
  667. package/node_modules/pi-subagents/src/integrations/program-status.d.ts.map +0 -1
  668. package/node_modules/pi-subagents/src/integrations/program-status.js +0 -189
  669. package/node_modules/pi-subagents/src/integrations/program-status.js.map +0 -1
  670. package/node_modules/pi-subagents/src/intercom/intercom-bridge.d.ts +0 -59
  671. package/node_modules/pi-subagents/src/intercom/intercom-bridge.d.ts.map +0 -1
  672. package/node_modules/pi-subagents/src/intercom/intercom-bridge.js +0 -194
  673. package/node_modules/pi-subagents/src/intercom/intercom-bridge.js.map +0 -1
  674. package/node_modules/pi-subagents/src/intercom/native-supervisor-channel.d.ts +0 -80
  675. package/node_modules/pi-subagents/src/intercom/native-supervisor-channel.d.ts.map +0 -1
  676. package/node_modules/pi-subagents/src/intercom/native-supervisor-channel.js +0 -992
  677. package/node_modules/pi-subagents/src/intercom/native-supervisor-channel.js.map +0 -1
  678. package/node_modules/pi-subagents/src/intercom/result-intercom.d.ts +0 -36
  679. package/node_modules/pi-subagents/src/intercom/result-intercom.d.ts.map +0 -1
  680. package/node_modules/pi-subagents/src/intercom/result-intercom.js +0 -373
  681. package/node_modules/pi-subagents/src/intercom/result-intercom.js.map +0 -1
  682. package/node_modules/pi-subagents/src/intercom/supervisor-ui.d.ts +0 -30
  683. package/node_modules/pi-subagents/src/intercom/supervisor-ui.d.ts.map +0 -1
  684. package/node_modules/pi-subagents/src/intercom/supervisor-ui.js +0 -50
  685. package/node_modules/pi-subagents/src/intercom/supervisor-ui.js.map +0 -1
  686. package/node_modules/pi-subagents/src/missions/actions.d.ts +0 -55
  687. package/node_modules/pi-subagents/src/missions/actions.d.ts.map +0 -1
  688. package/node_modules/pi-subagents/src/missions/actions.js +0 -396
  689. package/node_modules/pi-subagents/src/missions/actions.js.map +0 -1
  690. package/node_modules/pi-subagents/src/missions/goal-driver.d.ts +0 -17
  691. package/node_modules/pi-subagents/src/missions/goal-driver.d.ts.map +0 -1
  692. package/node_modules/pi-subagents/src/missions/goal-driver.js +0 -172
  693. package/node_modules/pi-subagents/src/missions/goal-driver.js.map +0 -1
  694. package/node_modules/pi-subagents/src/missions/lifecycle.d.ts +0 -40
  695. package/node_modules/pi-subagents/src/missions/lifecycle.d.ts.map +0 -1
  696. package/node_modules/pi-subagents/src/missions/lifecycle.js +0 -352
  697. package/node_modules/pi-subagents/src/missions/lifecycle.js.map +0 -1
  698. package/node_modules/pi-subagents/src/missions/store.d.ts +0 -22
  699. package/node_modules/pi-subagents/src/missions/store.d.ts.map +0 -1
  700. package/node_modules/pi-subagents/src/missions/store.js +0 -605
  701. package/node_modules/pi-subagents/src/missions/store.js.map +0 -1
  702. package/node_modules/pi-subagents/src/missions/types.d.ts +0 -168
  703. package/node_modules/pi-subagents/src/missions/types.d.ts.map +0 -1
  704. package/node_modules/pi-subagents/src/missions/types.js +0 -10
  705. package/node_modules/pi-subagents/src/missions/types.js.map +0 -1
  706. package/node_modules/pi-subagents/src/missions/workflow-state.d.ts +0 -15
  707. package/node_modules/pi-subagents/src/missions/workflow-state.d.ts.map +0 -1
  708. package/node_modules/pi-subagents/src/missions/workflow-state.js +0 -274
  709. package/node_modules/pi-subagents/src/missions/workflow-state.js.map +0 -1
  710. package/node_modules/pi-subagents/src/policy/authority.d.ts +0 -10
  711. package/node_modules/pi-subagents/src/policy/authority.d.ts.map +0 -1
  712. package/node_modules/pi-subagents/src/policy/authority.js +0 -42
  713. package/node_modules/pi-subagents/src/policy/authority.js.map +0 -1
  714. package/node_modules/pi-subagents/src/profiles/profiles.d.ts +0 -135
  715. package/node_modules/pi-subagents/src/profiles/profiles.d.ts.map +0 -1
  716. package/node_modules/pi-subagents/src/profiles/profiles.js +0 -527
  717. package/node_modules/pi-subagents/src/profiles/profiles.js.map +0 -1
  718. package/node_modules/pi-subagents/src/runs/background/active-async-capacity.d.ts +0 -115
  719. package/node_modules/pi-subagents/src/runs/background/active-async-capacity.d.ts.map +0 -1
  720. package/node_modules/pi-subagents/src/runs/background/active-async-capacity.js +0 -512
  721. package/node_modules/pi-subagents/src/runs/background/active-async-capacity.js.map +0 -1
  722. package/node_modules/pi-subagents/src/runs/background/active-run-index.d.ts +0 -13
  723. package/node_modules/pi-subagents/src/runs/background/active-run-index.d.ts.map +0 -1
  724. package/node_modules/pi-subagents/src/runs/background/active-run-index.js +0 -158
  725. package/node_modules/pi-subagents/src/runs/background/active-run-index.js.map +0 -1
  726. package/node_modules/pi-subagents/src/runs/background/async-execution.d.ts +0 -298
  727. package/node_modules/pi-subagents/src/runs/background/async-execution.d.ts.map +0 -1
  728. package/node_modules/pi-subagents/src/runs/background/async-execution.js +0 -2125
  729. package/node_modules/pi-subagents/src/runs/background/async-execution.js.map +0 -1
  730. package/node_modules/pi-subagents/src/runs/background/async-job-tracker.d.ts +0 -33
  731. package/node_modules/pi-subagents/src/runs/background/async-job-tracker.d.ts.map +0 -1
  732. package/node_modules/pi-subagents/src/runs/background/async-job-tracker.js +0 -908
  733. package/node_modules/pi-subagents/src/runs/background/async-job-tracker.js.map +0 -1
  734. package/node_modules/pi-subagents/src/runs/background/async-resume.d.ts +0 -59
  735. package/node_modules/pi-subagents/src/runs/background/async-resume.d.ts.map +0 -1
  736. package/node_modules/pi-subagents/src/runs/background/async-resume.js +0 -678
  737. package/node_modules/pi-subagents/src/runs/background/async-resume.js.map +0 -1
  738. package/node_modules/pi-subagents/src/runs/background/async-retention.d.ts +0 -45
  739. package/node_modules/pi-subagents/src/runs/background/async-retention.d.ts.map +0 -1
  740. package/node_modules/pi-subagents/src/runs/background/async-retention.js +0 -916
  741. package/node_modules/pi-subagents/src/runs/background/async-retention.js.map +0 -1
  742. package/node_modules/pi-subagents/src/runs/background/async-status-snapshot.d.ts +0 -10
  743. package/node_modules/pi-subagents/src/runs/background/async-status-snapshot.d.ts.map +0 -1
  744. package/node_modules/pi-subagents/src/runs/background/async-status-snapshot.js +0 -25
  745. package/node_modules/pi-subagents/src/runs/background/async-status-snapshot.js.map +0 -1
  746. package/node_modules/pi-subagents/src/runs/background/async-status.d.ts +0 -170
  747. package/node_modules/pi-subagents/src/runs/background/async-status.d.ts.map +0 -1
  748. package/node_modules/pi-subagents/src/runs/background/async-status.js +0 -674
  749. package/node_modules/pi-subagents/src/runs/background/async-status.js.map +0 -1
  750. package/node_modules/pi-subagents/src/runs/background/auto-drain.d.ts +0 -17
  751. package/node_modules/pi-subagents/src/runs/background/auto-drain.d.ts.map +0 -1
  752. package/node_modules/pi-subagents/src/runs/background/auto-drain.js +0 -73
  753. package/node_modules/pi-subagents/src/runs/background/auto-drain.js.map +0 -1
  754. package/node_modules/pi-subagents/src/runs/background/await-async-run.d.ts +0 -27
  755. package/node_modules/pi-subagents/src/runs/background/await-async-run.d.ts.map +0 -1
  756. package/node_modules/pi-subagents/src/runs/background/await-async-run.js +0 -88
  757. package/node_modules/pi-subagents/src/runs/background/await-async-run.js.map +0 -1
  758. package/node_modules/pi-subagents/src/runs/background/binary-bootstrap.d.ts +0 -9
  759. package/node_modules/pi-subagents/src/runs/background/binary-bootstrap.d.ts.map +0 -1
  760. package/node_modules/pi-subagents/src/runs/background/binary-bootstrap.js +0 -70
  761. package/node_modules/pi-subagents/src/runs/background/binary-bootstrap.js.map +0 -1
  762. package/node_modules/pi-subagents/src/runs/background/calendar-schedule.d.ts +0 -27
  763. package/node_modules/pi-subagents/src/runs/background/calendar-schedule.d.ts.map +0 -1
  764. package/node_modules/pi-subagents/src/runs/background/calendar-schedule.js +0 -94
  765. package/node_modules/pi-subagents/src/runs/background/calendar-schedule.js.map +0 -1
  766. package/node_modules/pi-subagents/src/runs/background/chain-append.d.ts +0 -35
  767. package/node_modules/pi-subagents/src/runs/background/chain-append.d.ts.map +0 -1
  768. package/node_modules/pi-subagents/src/runs/background/chain-append.js +0 -300
  769. package/node_modules/pi-subagents/src/runs/background/chain-append.js.map +0 -1
  770. package/node_modules/pi-subagents/src/runs/background/chain-root-attachment.d.ts +0 -52
  771. package/node_modules/pi-subagents/src/runs/background/chain-root-attachment.d.ts.map +0 -1
  772. package/node_modules/pi-subagents/src/runs/background/chain-root-attachment.js +0 -187
  773. package/node_modules/pi-subagents/src/runs/background/chain-root-attachment.js.map +0 -1
  774. package/node_modules/pi-subagents/src/runs/background/completion-batcher.d.ts +0 -52
  775. package/node_modules/pi-subagents/src/runs/background/completion-batcher.d.ts.map +0 -1
  776. package/node_modules/pi-subagents/src/runs/background/completion-batcher.js +0 -120
  777. package/node_modules/pi-subagents/src/runs/background/completion-batcher.js.map +0 -1
  778. package/node_modules/pi-subagents/src/runs/background/completion-dedupe.d.ts +0 -14
  779. package/node_modules/pi-subagents/src/runs/background/completion-dedupe.d.ts.map +0 -1
  780. package/node_modules/pi-subagents/src/runs/background/completion-dedupe.js +0 -49
  781. package/node_modules/pi-subagents/src/runs/background/completion-dedupe.js.map +0 -1
  782. package/node_modules/pi-subagents/src/runs/background/completion-replay.d.ts +0 -48
  783. package/node_modules/pi-subagents/src/runs/background/completion-replay.d.ts.map +0 -1
  784. package/node_modules/pi-subagents/src/runs/background/completion-replay.js +0 -267
  785. package/node_modules/pi-subagents/src/runs/background/completion-replay.js.map +0 -1
  786. package/node_modules/pi-subagents/src/runs/background/control-channel.d.ts +0 -171
  787. package/node_modules/pi-subagents/src/runs/background/control-channel.d.ts.map +0 -1
  788. package/node_modules/pi-subagents/src/runs/background/control-channel.js +0 -611
  789. package/node_modules/pi-subagents/src/runs/background/control-channel.js.map +0 -1
  790. package/node_modules/pi-subagents/src/runs/background/fleet-view.d.ts +0 -64
  791. package/node_modules/pi-subagents/src/runs/background/fleet-view.d.ts.map +0 -1
  792. package/node_modules/pi-subagents/src/runs/background/fleet-view.js +0 -667
  793. package/node_modules/pi-subagents/src/runs/background/fleet-view.js.map +0 -1
  794. package/node_modules/pi-subagents/src/runs/background/index-segment.d.ts +0 -16
  795. package/node_modules/pi-subagents/src/runs/background/index-segment.d.ts.map +0 -1
  796. package/node_modules/pi-subagents/src/runs/background/index-segment.js +0 -59
  797. package/node_modules/pi-subagents/src/runs/background/index-segment.js.map +0 -1
  798. package/node_modules/pi-subagents/src/runs/background/inspect-rpc.d.ts +0 -60
  799. package/node_modules/pi-subagents/src/runs/background/inspect-rpc.d.ts.map +0 -1
  800. package/node_modules/pi-subagents/src/runs/background/inspect-rpc.js +0 -406
  801. package/node_modules/pi-subagents/src/runs/background/inspect-rpc.js.map +0 -1
  802. package/node_modules/pi-subagents/src/runs/background/notify.d.ts +0 -192
  803. package/node_modules/pi-subagents/src/runs/background/notify.d.ts.map +0 -1
  804. package/node_modules/pi-subagents/src/runs/background/notify.js +0 -897
  805. package/node_modules/pi-subagents/src/runs/background/notify.js.map +0 -1
  806. package/node_modules/pi-subagents/src/runs/background/owned-process-tree.d.ts +0 -11
  807. package/node_modules/pi-subagents/src/runs/background/owned-process-tree.d.ts.map +0 -1
  808. package/node_modules/pi-subagents/src/runs/background/owned-process-tree.js +0 -117
  809. package/node_modules/pi-subagents/src/runs/background/owned-process-tree.js.map +0 -1
  810. package/node_modules/pi-subagents/src/runs/background/parallel-groups.d.ts +0 -4
  811. package/node_modules/pi-subagents/src/runs/background/parallel-groups.d.ts.map +0 -1
  812. package/node_modules/pi-subagents/src/runs/background/parallel-groups.js +0 -47
  813. package/node_modules/pi-subagents/src/runs/background/parallel-groups.js.map +0 -1
  814. package/node_modules/pi-subagents/src/runs/background/pid-namespace.d.ts +0 -3
  815. package/node_modules/pi-subagents/src/runs/background/pid-namespace.d.ts.map +0 -1
  816. package/node_modules/pi-subagents/src/runs/background/pid-namespace.js +0 -20
  817. package/node_modules/pi-subagents/src/runs/background/pid-namespace.js.map +0 -1
  818. package/node_modules/pi-subagents/src/runs/background/process-terminal-candidate.d.ts +0 -18
  819. package/node_modules/pi-subagents/src/runs/background/process-terminal-candidate.d.ts.map +0 -1
  820. package/node_modules/pi-subagents/src/runs/background/process-terminal-candidate.js +0 -97
  821. package/node_modules/pi-subagents/src/runs/background/process-terminal-candidate.js.map +0 -1
  822. package/node_modules/pi-subagents/src/runs/background/process-terminal.d.ts +0 -22
  823. package/node_modules/pi-subagents/src/runs/background/process-terminal.d.ts.map +0 -1
  824. package/node_modules/pi-subagents/src/runs/background/process-terminal.js +0 -228
  825. package/node_modules/pi-subagents/src/runs/background/process-terminal.js.map +0 -1
  826. package/node_modules/pi-subagents/src/runs/background/result-delivery-ownership.d.ts +0 -11
  827. package/node_modules/pi-subagents/src/runs/background/result-delivery-ownership.d.ts.map +0 -1
  828. package/node_modules/pi-subagents/src/runs/background/result-delivery-ownership.js +0 -37
  829. package/node_modules/pi-subagents/src/runs/background/result-delivery-ownership.js.map +0 -1
  830. package/node_modules/pi-subagents/src/runs/background/result-files.d.ts +0 -62
  831. package/node_modules/pi-subagents/src/runs/background/result-files.d.ts.map +0 -1
  832. package/node_modules/pi-subagents/src/runs/background/result-files.js +0 -626
  833. package/node_modules/pi-subagents/src/runs/background/result-files.js.map +0 -1
  834. package/node_modules/pi-subagents/src/runs/background/result-watcher.d.ts +0 -91
  835. package/node_modules/pi-subagents/src/runs/background/result-watcher.d.ts.map +0 -1
  836. package/node_modules/pi-subagents/src/runs/background/result-watcher.js +0 -797
  837. package/node_modules/pi-subagents/src/runs/background/result-watcher.js.map +0 -1
  838. package/node_modules/pi-subagents/src/runs/background/resume-guidance.d.ts +0 -5
  839. package/node_modules/pi-subagents/src/runs/background/resume-guidance.d.ts.map +0 -1
  840. package/node_modules/pi-subagents/src/runs/background/resume-guidance.js +0 -57
  841. package/node_modules/pi-subagents/src/runs/background/resume-guidance.js.map +0 -1
  842. package/node_modules/pi-subagents/src/runs/background/retained-children.d.ts +0 -25
  843. package/node_modules/pi-subagents/src/runs/background/retained-children.d.ts.map +0 -1
  844. package/node_modules/pi-subagents/src/runs/background/retained-children.js +0 -129
  845. package/node_modules/pi-subagents/src/runs/background/retained-children.js.map +0 -1
  846. package/node_modules/pi-subagents/src/runs/background/retained-nested-route-tracker.d.ts +0 -13
  847. package/node_modules/pi-subagents/src/runs/background/retained-nested-route-tracker.d.ts.map +0 -1
  848. package/node_modules/pi-subagents/src/runs/background/retained-nested-route-tracker.js +0 -91
  849. package/node_modules/pi-subagents/src/runs/background/retained-nested-route-tracker.js.map +0 -1
  850. package/node_modules/pi-subagents/src/runs/background/run-child-session.d.ts +0 -127
  851. package/node_modules/pi-subagents/src/runs/background/run-child-session.d.ts.map +0 -1
  852. package/node_modules/pi-subagents/src/runs/background/run-child-session.js +0 -626
  853. package/node_modules/pi-subagents/src/runs/background/run-child-session.js.map +0 -1
  854. package/node_modules/pi-subagents/src/runs/background/run-id-query.d.ts +0 -4
  855. package/node_modules/pi-subagents/src/runs/background/run-id-query.d.ts.map +0 -1
  856. package/node_modules/pi-subagents/src/runs/background/run-id-query.js +0 -7
  857. package/node_modules/pi-subagents/src/runs/background/run-id-query.js.map +0 -1
  858. package/node_modules/pi-subagents/src/runs/background/run-id-resolver.d.ts +0 -23
  859. package/node_modules/pi-subagents/src/runs/background/run-id-resolver.d.ts.map +0 -1
  860. package/node_modules/pi-subagents/src/runs/background/run-id-resolver.js +0 -173
  861. package/node_modules/pi-subagents/src/runs/background/run-id-resolver.js.map +0 -1
  862. package/node_modules/pi-subagents/src/runs/background/run-status.d.ts +0 -26
  863. package/node_modules/pi-subagents/src/runs/background/run-status.d.ts.map +0 -1
  864. package/node_modules/pi-subagents/src/runs/background/run-status.js +0 -843
  865. package/node_modules/pi-subagents/src/runs/background/run-status.js.map +0 -1
  866. package/node_modules/pi-subagents/src/runs/background/runner-aliases.d.ts +0 -18
  867. package/node_modules/pi-subagents/src/runs/background/runner-aliases.d.ts.map +0 -1
  868. package/node_modules/pi-subagents/src/runs/background/runner-aliases.js +0 -160
  869. package/node_modules/pi-subagents/src/runs/background/runner-aliases.js.map +0 -1
  870. package/node_modules/pi-subagents/src/runs/background/runner-child-launch.d.ts +0 -25
  871. package/node_modules/pi-subagents/src/runs/background/runner-child-launch.d.ts.map +0 -1
  872. package/node_modules/pi-subagents/src/runs/background/runner-child-launch.js +0 -71
  873. package/node_modules/pi-subagents/src/runs/background/runner-child-launch.js.map +0 -1
  874. package/node_modules/pi-subagents/src/runs/background/runner-child-sessions.d.ts +0 -7
  875. package/node_modules/pi-subagents/src/runs/background/runner-child-sessions.d.ts.map +0 -1
  876. package/node_modules/pi-subagents/src/runs/background/runner-child-sessions.js +0 -35
  877. package/node_modules/pi-subagents/src/runs/background/runner-child-sessions.js.map +0 -1
  878. package/node_modules/pi-subagents/src/runs/background/runner-http-dispatcher.d.ts +0 -46
  879. package/node_modules/pi-subagents/src/runs/background/runner-http-dispatcher.d.ts.map +0 -1
  880. package/node_modules/pi-subagents/src/runs/background/runner-http-dispatcher.js +0 -116
  881. package/node_modules/pi-subagents/src/runs/background/runner-http-dispatcher.js.map +0 -1
  882. package/node_modules/pi-subagents/src/runs/background/runner-startup-failure.d.ts +0 -14
  883. package/node_modules/pi-subagents/src/runs/background/runner-startup-failure.d.ts.map +0 -1
  884. package/node_modules/pi-subagents/src/runs/background/runner-startup-failure.js +0 -47
  885. package/node_modules/pi-subagents/src/runs/background/runner-startup-failure.js.map +0 -1
  886. package/node_modules/pi-subagents/src/runs/background/scheduled-runs.d.ts +0 -128
  887. package/node_modules/pi-subagents/src/runs/background/scheduled-runs.d.ts.map +0 -1
  888. package/node_modules/pi-subagents/src/runs/background/scheduled-runs.js +0 -1266
  889. package/node_modules/pi-subagents/src/runs/background/scheduled-runs.js.map +0 -1
  890. package/node_modules/pi-subagents/src/runs/background/stale-run-reconciler.d.ts +0 -38
  891. package/node_modules/pi-subagents/src/runs/background/stale-run-reconciler.d.ts.map +0 -1
  892. package/node_modules/pi-subagents/src/runs/background/stale-run-reconciler.js +0 -421
  893. package/node_modules/pi-subagents/src/runs/background/stale-run-reconciler.js.map +0 -1
  894. package/node_modules/pi-subagents/src/runs/background/steering.d.ts +0 -52
  895. package/node_modules/pi-subagents/src/runs/background/steering.d.ts.map +0 -1
  896. package/node_modules/pi-subagents/src/runs/background/steering.js +0 -247
  897. package/node_modules/pi-subagents/src/runs/background/steering.js.map +0 -1
  898. package/node_modules/pi-subagents/src/runs/background/subagent-runner-bootstrap.d.ts +0 -14
  899. package/node_modules/pi-subagents/src/runs/background/subagent-runner-bootstrap.d.ts.map +0 -1
  900. package/node_modules/pi-subagents/src/runs/background/subagent-runner-bootstrap.js +0 -281
  901. package/node_modules/pi-subagents/src/runs/background/subagent-runner-bootstrap.js.map +0 -1
  902. package/node_modules/pi-subagents/src/runs/background/subagent-runner.d.ts +0 -205
  903. package/node_modules/pi-subagents/src/runs/background/subagent-runner.d.ts.map +0 -1
  904. package/node_modules/pi-subagents/src/runs/background/subagent-runner.js +0 -4919
  905. package/node_modules/pi-subagents/src/runs/background/subagent-runner.js.map +0 -1
  906. package/node_modules/pi-subagents/src/runs/background/subagent-wait.d.ts +0 -124
  907. package/node_modules/pi-subagents/src/runs/background/subagent-wait.d.ts.map +0 -1
  908. package/node_modules/pi-subagents/src/runs/background/subagent-wait.js +0 -749
  909. package/node_modules/pi-subagents/src/runs/background/subagent-wait.js.map +0 -1
  910. package/node_modules/pi-subagents/src/runs/background/terminal-run-index.d.ts +0 -9
  911. package/node_modules/pi-subagents/src/runs/background/terminal-run-index.d.ts.map +0 -1
  912. package/node_modules/pi-subagents/src/runs/background/terminal-run-index.js +0 -169
  913. package/node_modules/pi-subagents/src/runs/background/terminal-run-index.js.map +0 -1
  914. package/node_modules/pi-subagents/src/runs/background/top-level-async.d.ts +0 -8
  915. package/node_modules/pi-subagents/src/runs/background/top-level-async.d.ts.map +0 -1
  916. package/node_modules/pi-subagents/src/runs/background/top-level-async.js +0 -6
  917. package/node_modules/pi-subagents/src/runs/background/top-level-async.js.map +0 -1
  918. package/node_modules/pi-subagents/src/runs/background/wait-completions.d.ts +0 -29
  919. package/node_modules/pi-subagents/src/runs/background/wait-completions.d.ts.map +0 -1
  920. package/node_modules/pi-subagents/src/runs/background/wait-completions.js +0 -265
  921. package/node_modules/pi-subagents/src/runs/background/wait-completions.js.map +0 -1
  922. package/node_modules/pi-subagents/src/runs/background/wait-config.d.ts +0 -9
  923. package/node_modules/pi-subagents/src/runs/background/wait-config.d.ts.map +0 -1
  924. package/node_modules/pi-subagents/src/runs/background/wait-config.js +0 -47
  925. package/node_modules/pi-subagents/src/runs/background/wait-config.js.map +0 -1
  926. package/node_modules/pi-subagents/src/runs/background/wait-subscriptions.d.ts +0 -27
  927. package/node_modules/pi-subagents/src/runs/background/wait-subscriptions.d.ts.map +0 -1
  928. package/node_modules/pi-subagents/src/runs/background/wait-subscriptions.js +0 -337
  929. package/node_modules/pi-subagents/src/runs/background/wait-subscriptions.js.map +0 -1
  930. package/node_modules/pi-subagents/src/runs/background/wait-tool.d.ts +0 -7
  931. package/node_modules/pi-subagents/src/runs/background/wait-tool.d.ts.map +0 -1
  932. package/node_modules/pi-subagents/src/runs/background/wait-tool.js +0 -49
  933. package/node_modules/pi-subagents/src/runs/background/wait-tool.js.map +0 -1
  934. package/node_modules/pi-subagents/src/runs/background/workflow-terminal-proof.d.ts +0 -31
  935. package/node_modules/pi-subagents/src/runs/background/workflow-terminal-proof.d.ts.map +0 -1
  936. package/node_modules/pi-subagents/src/runs/background/workflow-terminal-proof.js +0 -90
  937. package/node_modules/pi-subagents/src/runs/background/workflow-terminal-proof.js.map +0 -1
  938. package/node_modules/pi-subagents/src/runs/foreground/async-dismiss-action.d.ts +0 -7
  939. package/node_modules/pi-subagents/src/runs/foreground/async-dismiss-action.d.ts.map +0 -1
  940. package/node_modules/pi-subagents/src/runs/foreground/async-dismiss-action.js +0 -82
  941. package/node_modules/pi-subagents/src/runs/foreground/async-dismiss-action.js.map +0 -1
  942. package/node_modules/pi-subagents/src/runs/foreground/async-steering-action.d.ts +0 -32
  943. package/node_modules/pi-subagents/src/runs/foreground/async-steering-action.d.ts.map +0 -1
  944. package/node_modules/pi-subagents/src/runs/foreground/async-steering-action.js +0 -270
  945. package/node_modules/pi-subagents/src/runs/foreground/async-steering-action.js.map +0 -1
  946. package/node_modules/pi-subagents/src/runs/foreground/async-stop-action.d.ts +0 -13
  947. package/node_modules/pi-subagents/src/runs/foreground/async-stop-action.d.ts.map +0 -1
  948. package/node_modules/pi-subagents/src/runs/foreground/async-stop-action.js +0 -210
  949. package/node_modules/pi-subagents/src/runs/foreground/async-stop-action.js.map +0 -1
  950. package/node_modules/pi-subagents/src/runs/foreground/command-action.d.ts +0 -13
  951. package/node_modules/pi-subagents/src/runs/foreground/command-action.d.ts.map +0 -1
  952. package/node_modules/pi-subagents/src/runs/foreground/command-action.js +0 -38
  953. package/node_modules/pi-subagents/src/runs/foreground/command-action.js.map +0 -1
  954. package/node_modules/pi-subagents/src/runs/foreground/execution.d.ts +0 -11
  955. package/node_modules/pi-subagents/src/runs/foreground/execution.d.ts.map +0 -1
  956. package/node_modules/pi-subagents/src/runs/foreground/execution.js +0 -2181
  957. package/node_modules/pi-subagents/src/runs/foreground/execution.js.map +0 -1
  958. package/node_modules/pi-subagents/src/runs/foreground/foreground-control.d.ts +0 -25
  959. package/node_modules/pi-subagents/src/runs/foreground/foreground-control.d.ts.map +0 -1
  960. package/node_modules/pi-subagents/src/runs/foreground/foreground-control.js +0 -139
  961. package/node_modules/pi-subagents/src/runs/foreground/foreground-control.js.map +0 -1
  962. package/node_modules/pi-subagents/src/runs/foreground/foreground-history.d.ts +0 -12
  963. package/node_modules/pi-subagents/src/runs/foreground/foreground-history.d.ts.map +0 -1
  964. package/node_modules/pi-subagents/src/runs/foreground/foreground-history.js +0 -166
  965. package/node_modules/pi-subagents/src/runs/foreground/foreground-history.js.map +0 -1
  966. package/node_modules/pi-subagents/src/runs/foreground/prompt-audit.d.ts +0 -33
  967. package/node_modules/pi-subagents/src/runs/foreground/prompt-audit.d.ts.map +0 -1
  968. package/node_modules/pi-subagents/src/runs/foreground/prompt-audit.js +0 -139
  969. package/node_modules/pi-subagents/src/runs/foreground/prompt-audit.js.map +0 -1
  970. package/node_modules/pi-subagents/src/runs/foreground/subagent-executor.d.ts +0 -303
  971. package/node_modules/pi-subagents/src/runs/foreground/subagent-executor.d.ts.map +0 -1
  972. package/node_modules/pi-subagents/src/runs/foreground/subagent-executor.js +0 -7629
  973. package/node_modules/pi-subagents/src/runs/foreground/subagent-executor.js.map +0 -1
  974. package/node_modules/pi-subagents/src/runs/foreground/workflow-detach-reconcile.d.ts +0 -16
  975. package/node_modules/pi-subagents/src/runs/foreground/workflow-detach-reconcile.d.ts.map +0 -1
  976. package/node_modules/pi-subagents/src/runs/foreground/workflow-detach-reconcile.js +0 -284
  977. package/node_modules/pi-subagents/src/runs/foreground/workflow-detach-reconcile.js.map +0 -1
  978. package/node_modules/pi-subagents/src/runs/foreground/workflow-foreground-steering.d.ts +0 -44
  979. package/node_modules/pi-subagents/src/runs/foreground/workflow-foreground-steering.d.ts.map +0 -1
  980. package/node_modules/pi-subagents/src/runs/foreground/workflow-foreground-steering.js +0 -149
  981. package/node_modules/pi-subagents/src/runs/foreground/workflow-foreground-steering.js.map +0 -1
  982. package/node_modules/pi-subagents/src/runs/shared/abort-recovery.d.ts +0 -27
  983. package/node_modules/pi-subagents/src/runs/shared/abort-recovery.d.ts.map +0 -1
  984. package/node_modules/pi-subagents/src/runs/shared/abort-recovery.js +0 -109
  985. package/node_modules/pi-subagents/src/runs/shared/abort-recovery.js.map +0 -1
  986. package/node_modules/pi-subagents/src/runs/shared/acceptance.d.ts +0 -145
  987. package/node_modules/pi-subagents/src/runs/shared/acceptance.d.ts.map +0 -1
  988. package/node_modules/pi-subagents/src/runs/shared/acceptance.js +0 -1617
  989. package/node_modules/pi-subagents/src/runs/shared/acceptance.js.map +0 -1
  990. package/node_modules/pi-subagents/src/runs/shared/agent-contract.d.ts +0 -6
  991. package/node_modules/pi-subagents/src/runs/shared/agent-contract.d.ts.map +0 -1
  992. package/node_modules/pi-subagents/src/runs/shared/agent-contract.js +0 -36
  993. package/node_modules/pi-subagents/src/runs/shared/agent-contract.js.map +0 -1
  994. package/node_modules/pi-subagents/src/runs/shared/async-status-projection.d.ts +0 -97
  995. package/node_modules/pi-subagents/src/runs/shared/async-status-projection.d.ts.map +0 -1
  996. package/node_modules/pi-subagents/src/runs/shared/async-status-projection.js +0 -545
  997. package/node_modules/pi-subagents/src/runs/shared/async-status-projection.js.map +0 -1
  998. package/node_modules/pi-subagents/src/runs/shared/background-process-options.d.ts +0 -5
  999. package/node_modules/pi-subagents/src/runs/shared/background-process-options.d.ts.map +0 -1
  1000. package/node_modules/pi-subagents/src/runs/shared/background-process-options.js +0 -7
  1001. package/node_modules/pi-subagents/src/runs/shared/background-process-options.js.map +0 -1
  1002. package/node_modules/pi-subagents/src/runs/shared/capability-ceiling.d.ts +0 -58
  1003. package/node_modules/pi-subagents/src/runs/shared/capability-ceiling.d.ts.map +0 -1
  1004. package/node_modules/pi-subagents/src/runs/shared/capability-ceiling.js +0 -179
  1005. package/node_modules/pi-subagents/src/runs/shared/capability-ceiling.js.map +0 -1
  1006. package/node_modules/pi-subagents/src/runs/shared/chain-outputs.d.ts +0 -19
  1007. package/node_modules/pi-subagents/src/runs/shared/chain-outputs.d.ts.map +0 -1
  1008. package/node_modules/pi-subagents/src/runs/shared/chain-outputs.js +0 -105
  1009. package/node_modules/pi-subagents/src/runs/shared/chain-outputs.js.map +0 -1
  1010. package/node_modules/pi-subagents/src/runs/shared/child-commands.d.ts +0 -28
  1011. package/node_modules/pi-subagents/src/runs/shared/child-commands.d.ts.map +0 -1
  1012. package/node_modules/pi-subagents/src/runs/shared/child-commands.js +0 -250
  1013. package/node_modules/pi-subagents/src/runs/shared/child-commands.js.map +0 -1
  1014. package/node_modules/pi-subagents/src/runs/shared/child-hooks.d.ts +0 -32
  1015. package/node_modules/pi-subagents/src/runs/shared/child-hooks.d.ts.map +0 -1
  1016. package/node_modules/pi-subagents/src/runs/shared/child-hooks.js +0 -174
  1017. package/node_modules/pi-subagents/src/runs/shared/child-hooks.js.map +0 -1
  1018. package/node_modules/pi-subagents/src/runs/shared/child-identity.d.ts +0 -24
  1019. package/node_modules/pi-subagents/src/runs/shared/child-identity.d.ts.map +0 -1
  1020. package/node_modules/pi-subagents/src/runs/shared/child-identity.js +0 -41
  1021. package/node_modules/pi-subagents/src/runs/shared/child-identity.js.map +0 -1
  1022. package/node_modules/pi-subagents/src/runs/shared/child-launch-plan.d.ts +0 -71
  1023. package/node_modules/pi-subagents/src/runs/shared/child-launch-plan.d.ts.map +0 -1
  1024. package/node_modules/pi-subagents/src/runs/shared/child-launch-plan.js +0 -89
  1025. package/node_modules/pi-subagents/src/runs/shared/child-launch-plan.js.map +0 -1
  1026. package/node_modules/pi-subagents/src/runs/shared/child-launch.d.ts +0 -118
  1027. package/node_modules/pi-subagents/src/runs/shared/child-launch.d.ts.map +0 -1
  1028. package/node_modules/pi-subagents/src/runs/shared/child-launch.js +0 -248
  1029. package/node_modules/pi-subagents/src/runs/shared/child-launch.js.map +0 -1
  1030. package/node_modules/pi-subagents/src/runs/shared/child-lifecycle.d.ts +0 -14
  1031. package/node_modules/pi-subagents/src/runs/shared/child-lifecycle.d.ts.map +0 -1
  1032. package/node_modules/pi-subagents/src/runs/shared/child-lifecycle.js +0 -23
  1033. package/node_modules/pi-subagents/src/runs/shared/child-lifecycle.js.map +0 -1
  1034. package/node_modules/pi-subagents/src/runs/shared/child-runtime-config.d.ts +0 -106
  1035. package/node_modules/pi-subagents/src/runs/shared/child-runtime-config.d.ts.map +0 -1
  1036. package/node_modules/pi-subagents/src/runs/shared/child-runtime-config.js +0 -39
  1037. package/node_modules/pi-subagents/src/runs/shared/child-runtime-config.js.map +0 -1
  1038. package/node_modules/pi-subagents/src/runs/shared/child-session.d.ts +0 -172
  1039. package/node_modules/pi-subagents/src/runs/shared/child-session.d.ts.map +0 -1
  1040. package/node_modules/pi-subagents/src/runs/shared/child-session.js +0 -589
  1041. package/node_modules/pi-subagents/src/runs/shared/child-session.js.map +0 -1
  1042. package/node_modules/pi-subagents/src/runs/shared/child-tool-plan.d.ts +0 -77
  1043. package/node_modules/pi-subagents/src/runs/shared/child-tool-plan.d.ts.map +0 -1
  1044. package/node_modules/pi-subagents/src/runs/shared/child-tool-plan.js +0 -386
  1045. package/node_modules/pi-subagents/src/runs/shared/child-tool-plan.js.map +0 -1
  1046. package/node_modules/pi-subagents/src/runs/shared/claude-code-adapter.d.ts +0 -81
  1047. package/node_modules/pi-subagents/src/runs/shared/claude-code-adapter.d.ts.map +0 -1
  1048. package/node_modules/pi-subagents/src/runs/shared/claude-code-adapter.js +0 -256
  1049. package/node_modules/pi-subagents/src/runs/shared/claude-code-adapter.js.map +0 -1
  1050. package/node_modules/pi-subagents/src/runs/shared/codex-exec-adapter.d.ts +0 -26
  1051. package/node_modules/pi-subagents/src/runs/shared/codex-exec-adapter.d.ts.map +0 -1
  1052. package/node_modules/pi-subagents/src/runs/shared/codex-exec-adapter.js +0 -128
  1053. package/node_modules/pi-subagents/src/runs/shared/codex-exec-adapter.js.map +0 -1
  1054. package/node_modules/pi-subagents/src/runs/shared/context-mode.d.ts +0 -13
  1055. package/node_modules/pi-subagents/src/runs/shared/context-mode.d.ts.map +0 -1
  1056. package/node_modules/pi-subagents/src/runs/shared/context-mode.js +0 -39
  1057. package/node_modules/pi-subagents/src/runs/shared/context-mode.js.map +0 -1
  1058. package/node_modules/pi-subagents/src/runs/shared/cursor-agent-adapter.d.ts +0 -27
  1059. package/node_modules/pi-subagents/src/runs/shared/cursor-agent-adapter.d.ts.map +0 -1
  1060. package/node_modules/pi-subagents/src/runs/shared/cursor-agent-adapter.js +0 -100
  1061. package/node_modules/pi-subagents/src/runs/shared/cursor-agent-adapter.js.map +0 -1
  1062. package/node_modules/pi-subagents/src/runs/shared/dynamic-fanout.d.ts +0 -50
  1063. package/node_modules/pi-subagents/src/runs/shared/dynamic-fanout.d.ts.map +0 -1
  1064. package/node_modules/pi-subagents/src/runs/shared/dynamic-fanout.js +0 -274
  1065. package/node_modules/pi-subagents/src/runs/shared/dynamic-fanout.js.map +0 -1
  1066. package/node_modules/pi-subagents/src/runs/shared/effective-system-prompt.d.ts +0 -18
  1067. package/node_modules/pi-subagents/src/runs/shared/effective-system-prompt.d.ts.map +0 -1
  1068. package/node_modules/pi-subagents/src/runs/shared/effective-system-prompt.js +0 -24
  1069. package/node_modules/pi-subagents/src/runs/shared/effective-system-prompt.js.map +0 -1
  1070. package/node_modules/pi-subagents/src/runs/shared/extension-bindings.d.ts +0 -17
  1071. package/node_modules/pi-subagents/src/runs/shared/extension-bindings.d.ts.map +0 -1
  1072. package/node_modules/pi-subagents/src/runs/shared/extension-bindings.js +0 -83
  1073. package/node_modules/pi-subagents/src/runs/shared/extension-bindings.js.map +0 -1
  1074. package/node_modules/pi-subagents/src/runs/shared/external-cli-contract.d.ts +0 -30
  1075. package/node_modules/pi-subagents/src/runs/shared/external-cli-contract.d.ts.map +0 -1
  1076. package/node_modules/pi-subagents/src/runs/shared/external-cli-contract.js +0 -146
  1077. package/node_modules/pi-subagents/src/runs/shared/external-cli-contract.js.map +0 -1
  1078. package/node_modules/pi-subagents/src/runs/shared/external-cli-preflight.d.ts +0 -42
  1079. package/node_modules/pi-subagents/src/runs/shared/external-cli-preflight.d.ts.map +0 -1
  1080. package/node_modules/pi-subagents/src/runs/shared/external-cli-preflight.js +0 -160
  1081. package/node_modules/pi-subagents/src/runs/shared/external-cli-preflight.js.map +0 -1
  1082. package/node_modules/pi-subagents/src/runs/shared/external-cli-runner.d.ts +0 -66
  1083. package/node_modules/pi-subagents/src/runs/shared/external-cli-runner.d.ts.map +0 -1
  1084. package/node_modules/pi-subagents/src/runs/shared/external-cli-runner.js +0 -426
  1085. package/node_modules/pi-subagents/src/runs/shared/external-cli-runner.js.map +0 -1
  1086. package/node_modules/pi-subagents/src/runs/shared/external-job-bridge.d.ts +0 -25
  1087. package/node_modules/pi-subagents/src/runs/shared/external-job-bridge.d.ts.map +0 -1
  1088. package/node_modules/pi-subagents/src/runs/shared/external-job-bridge.js +0 -487
  1089. package/node_modules/pi-subagents/src/runs/shared/external-job-bridge.js.map +0 -1
  1090. package/node_modules/pi-subagents/src/runs/shared/external-job-runner.d.ts +0 -45
  1091. package/node_modules/pi-subagents/src/runs/shared/external-job-runner.d.ts.map +0 -1
  1092. package/node_modules/pi-subagents/src/runs/shared/external-job-runner.js +0 -353
  1093. package/node_modules/pi-subagents/src/runs/shared/external-job-runner.js.map +0 -1
  1094. package/node_modules/pi-subagents/src/runs/shared/fast-mode-extension.d.ts +0 -4
  1095. package/node_modules/pi-subagents/src/runs/shared/fast-mode-extension.d.ts.map +0 -1
  1096. package/node_modules/pi-subagents/src/runs/shared/fast-mode-extension.js +0 -9
  1097. package/node_modules/pi-subagents/src/runs/shared/fast-mode-extension.js.map +0 -1
  1098. package/node_modules/pi-subagents/src/runs/shared/git-environment.d.ts +0 -3
  1099. package/node_modules/pi-subagents/src/runs/shared/git-environment.d.ts.map +0 -1
  1100. package/node_modules/pi-subagents/src/runs/shared/git-environment.js +0 -28
  1101. package/node_modules/pi-subagents/src/runs/shared/git-environment.js.map +0 -1
  1102. package/node_modules/pi-subagents/src/runs/shared/herdr-connection.d.ts +0 -71
  1103. package/node_modules/pi-subagents/src/runs/shared/herdr-connection.d.ts.map +0 -1
  1104. package/node_modules/pi-subagents/src/runs/shared/herdr-connection.js +0 -258
  1105. package/node_modules/pi-subagents/src/runs/shared/herdr-connection.js.map +0 -1
  1106. package/node_modules/pi-subagents/src/runs/shared/herdr-external-adapters.d.ts +0 -148
  1107. package/node_modules/pi-subagents/src/runs/shared/herdr-external-adapters.d.ts.map +0 -1
  1108. package/node_modules/pi-subagents/src/runs/shared/herdr-external-adapters.js +0 -405
  1109. package/node_modules/pi-subagents/src/runs/shared/herdr-external-adapters.js.map +0 -1
  1110. package/node_modules/pi-subagents/src/runs/shared/herdr-machine.d.ts +0 -48
  1111. package/node_modules/pi-subagents/src/runs/shared/herdr-machine.d.ts.map +0 -1
  1112. package/node_modules/pi-subagents/src/runs/shared/herdr-machine.js +0 -247
  1113. package/node_modules/pi-subagents/src/runs/shared/herdr-machine.js.map +0 -1
  1114. package/node_modules/pi-subagents/src/runs/shared/herdr-pi-protocol.d.ts +0 -22
  1115. package/node_modules/pi-subagents/src/runs/shared/herdr-pi-protocol.d.ts.map +0 -1
  1116. package/node_modules/pi-subagents/src/runs/shared/herdr-pi-protocol.js +0 -58
  1117. package/node_modules/pi-subagents/src/runs/shared/herdr-pi-protocol.js.map +0 -1
  1118. package/node_modules/pi-subagents/src/runs/shared/herdr-placed-run.d.ts +0 -268
  1119. package/node_modules/pi-subagents/src/runs/shared/herdr-placed-run.d.ts.map +0 -1
  1120. package/node_modules/pi-subagents/src/runs/shared/herdr-placed-run.js +0 -720
  1121. package/node_modules/pi-subagents/src/runs/shared/herdr-placed-run.js.map +0 -1
  1122. package/node_modules/pi-subagents/src/runs/shared/host-step-status.d.ts +0 -34
  1123. package/node_modules/pi-subagents/src/runs/shared/host-step-status.d.ts.map +0 -1
  1124. package/node_modules/pi-subagents/src/runs/shared/host-step-status.js +0 -245
  1125. package/node_modules/pi-subagents/src/runs/shared/host-step-status.js.map +0 -1
  1126. package/node_modules/pi-subagents/src/runs/shared/lane-metadata.d.ts +0 -24
  1127. package/node_modules/pi-subagents/src/runs/shared/lane-metadata.d.ts.map +0 -1
  1128. package/node_modules/pi-subagents/src/runs/shared/lane-metadata.js +0 -127
  1129. package/node_modules/pi-subagents/src/runs/shared/lane-metadata.js.map +0 -1
  1130. package/node_modules/pi-subagents/src/runs/shared/launch-cwd.d.ts +0 -2
  1131. package/node_modules/pi-subagents/src/runs/shared/launch-cwd.d.ts.map +0 -1
  1132. package/node_modules/pi-subagents/src/runs/shared/launch-cwd.js +0 -17
  1133. package/node_modules/pi-subagents/src/runs/shared/launch-cwd.js.map +0 -1
  1134. package/node_modules/pi-subagents/src/runs/shared/long-running-guard.d.ts +0 -33
  1135. package/node_modules/pi-subagents/src/runs/shared/long-running-guard.d.ts.map +0 -1
  1136. package/node_modules/pi-subagents/src/runs/shared/long-running-guard.js +0 -199
  1137. package/node_modules/pi-subagents/src/runs/shared/long-running-guard.js.map +0 -1
  1138. package/node_modules/pi-subagents/src/runs/shared/mcp-config-sources.d.ts +0 -34
  1139. package/node_modules/pi-subagents/src/runs/shared/mcp-config-sources.d.ts.map +0 -1
  1140. package/node_modules/pi-subagents/src/runs/shared/mcp-config-sources.js +0 -419
  1141. package/node_modules/pi-subagents/src/runs/shared/mcp-config-sources.js.map +0 -1
  1142. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.d.ts +0 -87
  1143. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.d.ts.map +0 -1
  1144. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.js +0 -478
  1145. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.js.map +0 -1
  1146. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-grant.d.ts +0 -43
  1147. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-grant.d.ts.map +0 -1
  1148. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-grant.js +0 -160
  1149. package/node_modules/pi-subagents/src/runs/shared/mcp-direct-tool-grant.js.map +0 -1
  1150. package/node_modules/pi-subagents/src/runs/shared/model-resolution-diagnostic.d.ts +0 -34
  1151. package/node_modules/pi-subagents/src/runs/shared/model-resolution-diagnostic.d.ts.map +0 -1
  1152. package/node_modules/pi-subagents/src/runs/shared/model-resolution-diagnostic.js +0 -92
  1153. package/node_modules/pi-subagents/src/runs/shared/model-resolution-diagnostic.js.map +0 -1
  1154. package/node_modules/pi-subagents/src/runs/shared/model-resolution.d.ts +0 -106
  1155. package/node_modules/pi-subagents/src/runs/shared/model-resolution.d.ts.map +0 -1
  1156. package/node_modules/pi-subagents/src/runs/shared/model-resolution.js +0 -405
  1157. package/node_modules/pi-subagents/src/runs/shared/model-resolution.js.map +0 -1
  1158. package/node_modules/pi-subagents/src/runs/shared/model-scope.d.ts +0 -69
  1159. package/node_modules/pi-subagents/src/runs/shared/model-scope.d.ts.map +0 -1
  1160. package/node_modules/pi-subagents/src/runs/shared/model-scope.js +0 -172
  1161. package/node_modules/pi-subagents/src/runs/shared/model-scope.js.map +0 -1
  1162. package/node_modules/pi-subagents/src/runs/shared/mutation-evidence.d.ts +0 -19
  1163. package/node_modules/pi-subagents/src/runs/shared/mutation-evidence.d.ts.map +0 -1
  1164. package/node_modules/pi-subagents/src/runs/shared/mutation-evidence.js +0 -199
  1165. package/node_modules/pi-subagents/src/runs/shared/mutation-evidence.js.map +0 -1
  1166. package/node_modules/pi-subagents/src/runs/shared/nested-events.d.ts +0 -136
  1167. package/node_modules/pi-subagents/src/runs/shared/nested-events.d.ts.map +0 -1
  1168. package/node_modules/pi-subagents/src/runs/shared/nested-events.js +0 -1060
  1169. package/node_modules/pi-subagents/src/runs/shared/nested-events.js.map +0 -1
  1170. package/node_modules/pi-subagents/src/runs/shared/nested-path.d.ts +0 -9
  1171. package/node_modules/pi-subagents/src/runs/shared/nested-path.d.ts.map +0 -1
  1172. package/node_modules/pi-subagents/src/runs/shared/nested-path.js +0 -35
  1173. package/node_modules/pi-subagents/src/runs/shared/nested-path.js.map +0 -1
  1174. package/node_modules/pi-subagents/src/runs/shared/nested-render.d.ts +0 -21
  1175. package/node_modules/pi-subagents/src/runs/shared/nested-render.d.ts.map +0 -1
  1176. package/node_modules/pi-subagents/src/runs/shared/nested-render.js +0 -116
  1177. package/node_modules/pi-subagents/src/runs/shared/nested-render.js.map +0 -1
  1178. package/node_modules/pi-subagents/src/runs/shared/orca-progress-tabs.d.ts +0 -33
  1179. package/node_modules/pi-subagents/src/runs/shared/orca-progress-tabs.d.ts.map +0 -1
  1180. package/node_modules/pi-subagents/src/runs/shared/orca-progress-tabs.js +0 -527
  1181. package/node_modules/pi-subagents/src/runs/shared/orca-progress-tabs.js.map +0 -1
  1182. package/node_modules/pi-subagents/src/runs/shared/parallel-handoff.d.ts +0 -79
  1183. package/node_modules/pi-subagents/src/runs/shared/parallel-handoff.d.ts.map +0 -1
  1184. package/node_modules/pi-subagents/src/runs/shared/parallel-handoff.js +0 -780
  1185. package/node_modules/pi-subagents/src/runs/shared/parallel-handoff.js.map +0 -1
  1186. package/node_modules/pi-subagents/src/runs/shared/parallel-utils.d.ts +0 -170
  1187. package/node_modules/pi-subagents/src/runs/shared/parallel-utils.d.ts.map +0 -1
  1188. package/node_modules/pi-subagents/src/runs/shared/parallel-utils.js +0 -126
  1189. package/node_modules/pi-subagents/src/runs/shared/parallel-utils.js.map +0 -1
  1190. package/node_modules/pi-subagents/src/runs/shared/partial-output.d.ts +0 -25
  1191. package/node_modules/pi-subagents/src/runs/shared/partial-output.d.ts.map +0 -1
  1192. package/node_modules/pi-subagents/src/runs/shared/partial-output.js +0 -36
  1193. package/node_modules/pi-subagents/src/runs/shared/partial-output.js.map +0 -1
  1194. package/node_modules/pi-subagents/src/runs/shared/permissions.d.ts +0 -13
  1195. package/node_modules/pi-subagents/src/runs/shared/permissions.d.ts.map +0 -1
  1196. package/node_modules/pi-subagents/src/runs/shared/permissions.js +0 -93
  1197. package/node_modules/pi-subagents/src/runs/shared/permissions.js.map +0 -1
  1198. package/node_modules/pi-subagents/src/runs/shared/pi-spawn.d.ts +0 -28
  1199. package/node_modules/pi-subagents/src/runs/shared/pi-spawn.d.ts.map +0 -1
  1200. package/node_modules/pi-subagents/src/runs/shared/pi-spawn.js +0 -156
  1201. package/node_modules/pi-subagents/src/runs/shared/pi-spawn.js.map +0 -1
  1202. package/node_modules/pi-subagents/src/runs/shared/process-signal.d.ts +0 -16
  1203. package/node_modules/pi-subagents/src/runs/shared/process-signal.d.ts.map +0 -1
  1204. package/node_modules/pi-subagents/src/runs/shared/process-signal.js +0 -22
  1205. package/node_modules/pi-subagents/src/runs/shared/process-signal.js.map +0 -1
  1206. package/node_modules/pi-subagents/src/runs/shared/readonly-drain-observation.d.ts +0 -26
  1207. package/node_modules/pi-subagents/src/runs/shared/readonly-drain-observation.d.ts.map +0 -1
  1208. package/node_modules/pi-subagents/src/runs/shared/readonly-drain-observation.js +0 -51
  1209. package/node_modules/pi-subagents/src/runs/shared/readonly-drain-observation.js.map +0 -1
  1210. package/node_modules/pi-subagents/src/runs/shared/run-fanout-budget.d.ts +0 -15
  1211. package/node_modules/pi-subagents/src/runs/shared/run-fanout-budget.d.ts.map +0 -1
  1212. package/node_modules/pi-subagents/src/runs/shared/run-fanout-budget.js +0 -259
  1213. package/node_modules/pi-subagents/src/runs/shared/run-fanout-budget.js.map +0 -1
  1214. package/node_modules/pi-subagents/src/runs/shared/runner-launcher.d.ts +0 -12
  1215. package/node_modules/pi-subagents/src/runs/shared/runner-launcher.d.ts.map +0 -1
  1216. package/node_modules/pi-subagents/src/runs/shared/runner-launcher.js +0 -25
  1217. package/node_modules/pi-subagents/src/runs/shared/runner-launcher.js.map +0 -1
  1218. package/node_modules/pi-subagents/src/runs/shared/runtime-acknowledged-extensions.d.ts +0 -8
  1219. package/node_modules/pi-subagents/src/runs/shared/runtime-acknowledged-extensions.d.ts.map +0 -1
  1220. package/node_modules/pi-subagents/src/runs/shared/runtime-acknowledged-extensions.js +0 -45
  1221. package/node_modules/pi-subagents/src/runs/shared/runtime-acknowledged-extensions.js.map +0 -1
  1222. package/node_modules/pi-subagents/src/runs/shared/session-lease.d.ts +0 -70
  1223. package/node_modules/pi-subagents/src/runs/shared/session-lease.d.ts.map +0 -1
  1224. package/node_modules/pi-subagents/src/runs/shared/session-lease.js +0 -251
  1225. package/node_modules/pi-subagents/src/runs/shared/session-lease.js.map +0 -1
  1226. package/node_modules/pi-subagents/src/runs/shared/single-output.d.ts +0 -91
  1227. package/node_modules/pi-subagents/src/runs/shared/single-output.d.ts.map +0 -1
  1228. package/node_modules/pi-subagents/src/runs/shared/single-output.js +0 -350
  1229. package/node_modules/pi-subagents/src/runs/shared/single-output.js.map +0 -1
  1230. package/node_modules/pi-subagents/src/runs/shared/spawn-budget.d.ts +0 -21
  1231. package/node_modules/pi-subagents/src/runs/shared/spawn-budget.d.ts.map +0 -1
  1232. package/node_modules/pi-subagents/src/runs/shared/spawn-budget.js +0 -94
  1233. package/node_modules/pi-subagents/src/runs/shared/spawn-budget.js.map +0 -1
  1234. package/node_modules/pi-subagents/src/runs/shared/structured-output.d.ts +0 -66
  1235. package/node_modules/pi-subagents/src/runs/shared/structured-output.d.ts.map +0 -1
  1236. package/node_modules/pi-subagents/src/runs/shared/structured-output.js +0 -483
  1237. package/node_modules/pi-subagents/src/runs/shared/structured-output.js.map +0 -1
  1238. package/node_modules/pi-subagents/src/runs/shared/subagent-control.d.ts +0 -50
  1239. package/node_modules/pi-subagents/src/runs/shared/subagent-control.d.ts.map +0 -1
  1240. package/node_modules/pi-subagents/src/runs/shared/subagent-control.js +0 -247
  1241. package/node_modules/pi-subagents/src/runs/shared/subagent-control.js.map +0 -1
  1242. package/node_modules/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts +0 -64
  1243. package/node_modules/pi-subagents/src/runs/shared/subagent-prompt-runtime.d.ts.map +0 -1
  1244. package/node_modules/pi-subagents/src/runs/shared/subagent-prompt-runtime.js +0 -681
  1245. package/node_modules/pi-subagents/src/runs/shared/subagent-prompt-runtime.js.map +0 -1
  1246. package/node_modules/pi-subagents/src/runs/shared/tool-availability.d.ts +0 -17
  1247. package/node_modules/pi-subagents/src/runs/shared/tool-availability.d.ts.map +0 -1
  1248. package/node_modules/pi-subagents/src/runs/shared/tool-availability.js +0 -30
  1249. package/node_modules/pi-subagents/src/runs/shared/tool-availability.js.map +0 -1
  1250. package/node_modules/pi-subagents/src/runs/shared/tool-budget.d.ts +0 -22
  1251. package/node_modules/pi-subagents/src/runs/shared/tool-budget.d.ts.map +0 -1
  1252. package/node_modules/pi-subagents/src/runs/shared/tool-budget.js +0 -79
  1253. package/node_modules/pi-subagents/src/runs/shared/tool-budget.js.map +0 -1
  1254. package/node_modules/pi-subagents/src/runs/shared/tool-timeout.d.ts +0 -32
  1255. package/node_modules/pi-subagents/src/runs/shared/tool-timeout.d.ts.map +0 -1
  1256. package/node_modules/pi-subagents/src/runs/shared/tool-timeout.js +0 -74
  1257. package/node_modules/pi-subagents/src/runs/shared/tool-timeout.js.map +0 -1
  1258. package/node_modules/pi-subagents/src/runs/shared/usage-budget.d.ts +0 -8
  1259. package/node_modules/pi-subagents/src/runs/shared/usage-budget.d.ts.map +0 -1
  1260. package/node_modules/pi-subagents/src/runs/shared/usage-budget.js +0 -75
  1261. package/node_modules/pi-subagents/src/runs/shared/usage-budget.js.map +0 -1
  1262. package/node_modules/pi-subagents/src/runs/shared/usage-reconciliation.d.ts +0 -9
  1263. package/node_modules/pi-subagents/src/runs/shared/usage-reconciliation.d.ts.map +0 -1
  1264. package/node_modules/pi-subagents/src/runs/shared/usage-reconciliation.js +0 -72
  1265. package/node_modules/pi-subagents/src/runs/shared/usage-reconciliation.js.map +0 -1
  1266. package/node_modules/pi-subagents/src/runs/shared/workflow-async-child-guidance.d.ts +0 -4
  1267. package/node_modules/pi-subagents/src/runs/shared/workflow-async-child-guidance.d.ts.map +0 -1
  1268. package/node_modules/pi-subagents/src/runs/shared/workflow-async-child-guidance.js +0 -18
  1269. package/node_modules/pi-subagents/src/runs/shared/workflow-async-child-guidance.js.map +0 -1
  1270. package/node_modules/pi-subagents/src/runs/shared/workflow-graph.d.ts +0 -32
  1271. package/node_modules/pi-subagents/src/runs/shared/workflow-graph.d.ts.map +0 -1
  1272. package/node_modules/pi-subagents/src/runs/shared/workflow-graph.js +0 -222
  1273. package/node_modules/pi-subagents/src/runs/shared/workflow-graph.js.map +0 -1
  1274. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-apply.d.ts +0 -37
  1275. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-apply.d.ts.map +0 -1
  1276. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-apply.js +0 -179
  1277. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-apply.js.map +0 -1
  1278. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-plan.d.ts +0 -85
  1279. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-plan.d.ts.map +0 -1
  1280. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-plan.js +0 -804
  1281. package/node_modules/pi-subagents/src/runs/shared/worktree-cleanup-plan.js.map +0 -1
  1282. package/node_modules/pi-subagents/src/runs/shared/worktree-lock.d.ts +0 -6
  1283. package/node_modules/pi-subagents/src/runs/shared/worktree-lock.d.ts.map +0 -1
  1284. package/node_modules/pi-subagents/src/runs/shared/worktree-lock.js +0 -41
  1285. package/node_modules/pi-subagents/src/runs/shared/worktree-lock.js.map +0 -1
  1286. package/node_modules/pi-subagents/src/runs/shared/worktree-setup-command.d.ts +0 -39
  1287. package/node_modules/pi-subagents/src/runs/shared/worktree-setup-command.d.ts.map +0 -1
  1288. package/node_modules/pi-subagents/src/runs/shared/worktree-setup-command.js +0 -201
  1289. package/node_modules/pi-subagents/src/runs/shared/worktree-setup-command.js.map +0 -1
  1290. package/node_modules/pi-subagents/src/runs/shared/worktree.d.ts +0 -182
  1291. package/node_modules/pi-subagents/src/runs/shared/worktree.d.ts.map +0 -1
  1292. package/node_modules/pi-subagents/src/runs/shared/worktree.js +0 -1347
  1293. package/node_modules/pi-subagents/src/runs/shared/worktree.js.map +0 -1
  1294. package/node_modules/pi-subagents/src/shared/accessible-dir.d.ts +0 -12
  1295. package/node_modules/pi-subagents/src/shared/accessible-dir.d.ts.map +0 -1
  1296. package/node_modules/pi-subagents/src/shared/accessible-dir.js +0 -37
  1297. package/node_modules/pi-subagents/src/shared/accessible-dir.js.map +0 -1
  1298. package/node_modules/pi-subagents/src/shared/agent-stream-options.d.ts +0 -6
  1299. package/node_modules/pi-subagents/src/shared/agent-stream-options.d.ts.map +0 -1
  1300. package/node_modules/pi-subagents/src/shared/agent-stream-options.js +0 -4
  1301. package/node_modules/pi-subagents/src/shared/agent-stream-options.js.map +0 -1
  1302. package/node_modules/pi-subagents/src/shared/artifacts.d.ts +0 -23
  1303. package/node_modules/pi-subagents/src/shared/artifacts.d.ts.map +0 -1
  1304. package/node_modules/pi-subagents/src/shared/artifacts.js +0 -273
  1305. package/node_modules/pi-subagents/src/shared/artifacts.js.map +0 -1
  1306. package/node_modules/pi-subagents/src/shared/atomic-json.d.ts +0 -20
  1307. package/node_modules/pi-subagents/src/shared/atomic-json.d.ts.map +0 -1
  1308. package/node_modules/pi-subagents/src/shared/atomic-json.js +0 -62
  1309. package/node_modules/pi-subagents/src/shared/atomic-json.js.map +0 -1
  1310. package/node_modules/pi-subagents/src/shared/capacity-resilient-json.d.ts +0 -27
  1311. package/node_modules/pi-subagents/src/shared/capacity-resilient-json.d.ts.map +0 -1
  1312. package/node_modules/pi-subagents/src/shared/capacity-resilient-json.js +0 -87
  1313. package/node_modules/pi-subagents/src/shared/capacity-resilient-json.js.map +0 -1
  1314. package/node_modules/pi-subagents/src/shared/child-cache-retention.d.ts +0 -30
  1315. package/node_modules/pi-subagents/src/shared/child-cache-retention.d.ts.map +0 -1
  1316. package/node_modules/pi-subagents/src/shared/child-cache-retention.js +0 -41
  1317. package/node_modules/pi-subagents/src/shared/child-cache-retention.js.map +0 -1
  1318. package/node_modules/pi-subagents/src/shared/child-session-name.d.ts +0 -9
  1319. package/node_modules/pi-subagents/src/shared/child-session-name.d.ts.map +0 -1
  1320. package/node_modules/pi-subagents/src/shared/child-session-name.js +0 -41
  1321. package/node_modules/pi-subagents/src/shared/child-session-name.js.map +0 -1
  1322. package/node_modules/pi-subagents/src/shared/child-transcript.d.ts +0 -38
  1323. package/node_modules/pi-subagents/src/shared/child-transcript.d.ts.map +0 -1
  1324. package/node_modules/pi-subagents/src/shared/child-transcript.js +0 -226
  1325. package/node_modules/pi-subagents/src/shared/child-transcript.js.map +0 -1
  1326. package/node_modules/pi-subagents/src/shared/completion-owner.d.ts +0 -3
  1327. package/node_modules/pi-subagents/src/shared/completion-owner.d.ts.map +0 -1
  1328. package/node_modules/pi-subagents/src/shared/completion-owner.js +0 -9
  1329. package/node_modules/pi-subagents/src/shared/completion-owner.js.map +0 -1
  1330. package/node_modules/pi-subagents/src/shared/disabled-features.d.ts +0 -92
  1331. package/node_modules/pi-subagents/src/shared/disabled-features.d.ts.map +0 -1
  1332. package/node_modules/pi-subagents/src/shared/disabled-features.js +0 -113
  1333. package/node_modules/pi-subagents/src/shared/disabled-features.js.map +0 -1
  1334. package/node_modules/pi-subagents/src/shared/display-text.d.ts +0 -6
  1335. package/node_modules/pi-subagents/src/shared/display-text.d.ts.map +0 -1
  1336. package/node_modules/pi-subagents/src/shared/display-text.js +0 -155
  1337. package/node_modules/pi-subagents/src/shared/display-text.js.map +0 -1
  1338. package/node_modules/pi-subagents/src/shared/edit-distance.d.ts +0 -5
  1339. package/node_modules/pi-subagents/src/shared/edit-distance.d.ts.map +0 -1
  1340. package/node_modules/pi-subagents/src/shared/edit-distance.js +0 -33
  1341. package/node_modules/pi-subagents/src/shared/edit-distance.js.map +0 -1
  1342. package/node_modules/pi-subagents/src/shared/extension-context.d.ts +0 -22
  1343. package/node_modules/pi-subagents/src/shared/extension-context.d.ts.map +0 -1
  1344. package/node_modules/pi-subagents/src/shared/extension-context.js +0 -40
  1345. package/node_modules/pi-subagents/src/shared/extension-context.js.map +0 -1
  1346. package/node_modules/pi-subagents/src/shared/file-coalescer.d.ts +0 -12
  1347. package/node_modules/pi-subagents/src/shared/file-coalescer.d.ts.map +0 -1
  1348. package/node_modules/pi-subagents/src/shared/file-coalescer.js +0 -35
  1349. package/node_modules/pi-subagents/src/shared/file-coalescer.js.map +0 -1
  1350. package/node_modules/pi-subagents/src/shared/file-lease.d.ts +0 -5
  1351. package/node_modules/pi-subagents/src/shared/file-lease.d.ts.map +0 -1
  1352. package/node_modules/pi-subagents/src/shared/file-lease.js +0 -101
  1353. package/node_modules/pi-subagents/src/shared/file-lease.js.map +0 -1
  1354. package/node_modules/pi-subagents/src/shared/file-system-retry.d.ts +0 -32
  1355. package/node_modules/pi-subagents/src/shared/file-system-retry.d.ts.map +0 -1
  1356. package/node_modules/pi-subagents/src/shared/file-system-retry.js +0 -85
  1357. package/node_modules/pi-subagents/src/shared/file-system-retry.js.map +0 -1
  1358. package/node_modules/pi-subagents/src/shared/fork-context.d.ts +0 -63
  1359. package/node_modules/pi-subagents/src/shared/fork-context.d.ts.map +0 -1
  1360. package/node_modules/pi-subagents/src/shared/fork-context.js +0 -176
  1361. package/node_modules/pi-subagents/src/shared/fork-context.js.map +0 -1
  1362. package/node_modules/pi-subagents/src/shared/fork-session-cwd.d.ts +0 -3
  1363. package/node_modules/pi-subagents/src/shared/fork-session-cwd.d.ts.map +0 -1
  1364. package/node_modules/pi-subagents/src/shared/fork-session-cwd.js +0 -24
  1365. package/node_modules/pi-subagents/src/shared/fork-session-cwd.js.map +0 -1
  1366. package/node_modules/pi-subagents/src/shared/formatters.d.ts +0 -36
  1367. package/node_modules/pi-subagents/src/shared/formatters.d.ts.map +0 -1
  1368. package/node_modules/pi-subagents/src/shared/formatters.js +0 -138
  1369. package/node_modules/pi-subagents/src/shared/formatters.js.map +0 -1
  1370. package/node_modules/pi-subagents/src/shared/jsonl-writer.d.ts +0 -21
  1371. package/node_modules/pi-subagents/src/shared/jsonl-writer.d.ts.map +0 -1
  1372. package/node_modules/pi-subagents/src/shared/jsonl-writer.js +0 -68
  1373. package/node_modules/pi-subagents/src/shared/jsonl-writer.js.map +0 -1
  1374. package/node_modules/pi-subagents/src/shared/launch-contract.d.ts +0 -64
  1375. package/node_modules/pi-subagents/src/shared/launch-contract.d.ts.map +0 -1
  1376. package/node_modules/pi-subagents/src/shared/launch-contract.js +0 -140
  1377. package/node_modules/pi-subagents/src/shared/launch-contract.js.map +0 -1
  1378. package/node_modules/pi-subagents/src/shared/model-info.d.ts +0 -56
  1379. package/node_modules/pi-subagents/src/shared/model-info.d.ts.map +0 -1
  1380. package/node_modules/pi-subagents/src/shared/model-info.js +0 -104
  1381. package/node_modules/pi-subagents/src/shared/model-info.js.map +0 -1
  1382. package/node_modules/pi-subagents/src/shared/model-response-aliases.d.ts +0 -2
  1383. package/node_modules/pi-subagents/src/shared/model-response-aliases.d.ts.map +0 -1
  1384. package/node_modules/pi-subagents/src/shared/model-response-aliases.js +0 -16
  1385. package/node_modules/pi-subagents/src/shared/model-response-aliases.js.map +0 -1
  1386. package/node_modules/pi-subagents/src/shared/node-executable.d.ts +0 -2
  1387. package/node_modules/pi-subagents/src/shared/node-executable.d.ts.map +0 -1
  1388. package/node_modules/pi-subagents/src/shared/node-executable.js +0 -21
  1389. package/node_modules/pi-subagents/src/shared/node-executable.js.map +0 -1
  1390. package/node_modules/pi-subagents/src/shared/opencode-session-headers.d.ts +0 -13
  1391. package/node_modules/pi-subagents/src/shared/opencode-session-headers.d.ts.map +0 -1
  1392. package/node_modules/pi-subagents/src/shared/opencode-session-headers.js +0 -27
  1393. package/node_modules/pi-subagents/src/shared/opencode-session-headers.js.map +0 -1
  1394. package/node_modules/pi-subagents/src/shared/package-version.d.ts +0 -3
  1395. package/node_modules/pi-subagents/src/shared/package-version.d.ts.map +0 -1
  1396. package/node_modules/pi-subagents/src/shared/package-version.js +0 -15
  1397. package/node_modules/pi-subagents/src/shared/package-version.js.map +0 -1
  1398. package/node_modules/pi-subagents/src/shared/parent-wake.d.ts +0 -24
  1399. package/node_modules/pi-subagents/src/shared/parent-wake.d.ts.map +0 -1
  1400. package/node_modules/pi-subagents/src/shared/parent-wake.js +0 -71
  1401. package/node_modules/pi-subagents/src/shared/parent-wake.js.map +0 -1
  1402. package/node_modules/pi-subagents/src/shared/prompt-resources.d.ts +0 -6
  1403. package/node_modules/pi-subagents/src/shared/prompt-resources.d.ts.map +0 -1
  1404. package/node_modules/pi-subagents/src/shared/prompt-resources.js +0 -11
  1405. package/node_modules/pi-subagents/src/shared/prompt-resources.js.map +0 -1
  1406. package/node_modules/pi-subagents/src/shared/pruned-fork.d.ts +0 -35
  1407. package/node_modules/pi-subagents/src/shared/pruned-fork.d.ts.map +0 -1
  1408. package/node_modules/pi-subagents/src/shared/pruned-fork.js +0 -435
  1409. package/node_modules/pi-subagents/src/shared/pruned-fork.js.map +0 -1
  1410. package/node_modules/pi-subagents/src/shared/required-child-extensions.d.ts +0 -35
  1411. package/node_modules/pi-subagents/src/shared/required-child-extensions.d.ts.map +0 -1
  1412. package/node_modules/pi-subagents/src/shared/required-child-extensions.js +0 -106
  1413. package/node_modules/pi-subagents/src/shared/required-child-extensions.js.map +0 -1
  1414. package/node_modules/pi-subagents/src/shared/runtime-module-path.d.ts +0 -11
  1415. package/node_modules/pi-subagents/src/shared/runtime-module-path.d.ts.map +0 -1
  1416. package/node_modules/pi-subagents/src/shared/runtime-module-path.js +0 -17
  1417. package/node_modules/pi-subagents/src/shared/runtime-module-path.js.map +0 -1
  1418. package/node_modules/pi-subagents/src/shared/session-file-trust.d.ts +0 -2
  1419. package/node_modules/pi-subagents/src/shared/session-file-trust.d.ts.map +0 -1
  1420. package/node_modules/pi-subagents/src/shared/session-file-trust.js +0 -21
  1421. package/node_modules/pi-subagents/src/shared/session-file-trust.js.map +0 -1
  1422. package/node_modules/pi-subagents/src/shared/session-identity.d.ts +0 -7
  1423. package/node_modules/pi-subagents/src/shared/session-identity.d.ts.map +0 -1
  1424. package/node_modules/pi-subagents/src/shared/session-identity.js +0 -7
  1425. package/node_modules/pi-subagents/src/shared/session-identity.js.map +0 -1
  1426. package/node_modules/pi-subagents/src/shared/session-tokens.d.ts +0 -3
  1427. package/node_modules/pi-subagents/src/shared/session-tokens.d.ts.map +0 -1
  1428. package/node_modules/pi-subagents/src/shared/session-tokens.js +0 -59
  1429. package/node_modules/pi-subagents/src/shared/session-tokens.js.map +0 -1
  1430. package/node_modules/pi-subagents/src/shared/settings-file-lease.d.ts +0 -5
  1431. package/node_modules/pi-subagents/src/shared/settings-file-lease.d.ts.map +0 -1
  1432. package/node_modules/pi-subagents/src/shared/settings-file-lease.js +0 -39
  1433. package/node_modules/pi-subagents/src/shared/settings-file-lease.js.map +0 -1
  1434. package/node_modules/pi-subagents/src/shared/settings.d.ts +0 -147
  1435. package/node_modules/pi-subagents/src/shared/settings.d.ts.map +0 -1
  1436. package/node_modules/pi-subagents/src/shared/settings.js +0 -248
  1437. package/node_modules/pi-subagents/src/shared/settings.js.map +0 -1
  1438. package/node_modules/pi-subagents/src/shared/shortcuts.d.ts +0 -2
  1439. package/node_modules/pi-subagents/src/shared/shortcuts.d.ts.map +0 -1
  1440. package/node_modules/pi-subagents/src/shared/shortcuts.js +0 -18
  1441. package/node_modules/pi-subagents/src/shared/shortcuts.js.map +0 -1
  1442. package/node_modules/pi-subagents/src/shared/status-format.d.ts +0 -10
  1443. package/node_modules/pi-subagents/src/shared/status-format.d.ts.map +0 -1
  1444. package/node_modules/pi-subagents/src/shared/status-format.js +0 -61
  1445. package/node_modules/pi-subagents/src/shared/status-format.js.map +0 -1
  1446. package/node_modules/pi-subagents/src/shared/thinking-ceiling.d.ts +0 -14
  1447. package/node_modules/pi-subagents/src/shared/thinking-ceiling.d.ts.map +0 -1
  1448. package/node_modules/pi-subagents/src/shared/thinking-ceiling.js +0 -38
  1449. package/node_modules/pi-subagents/src/shared/thinking-ceiling.js.map +0 -1
  1450. package/node_modules/pi-subagents/src/shared/types.d.ts +0 -2748
  1451. package/node_modules/pi-subagents/src/shared/types.d.ts.map +0 -1
  1452. package/node_modules/pi-subagents/src/shared/types.js +0 -270
  1453. package/node_modules/pi-subagents/src/shared/types.js.map +0 -1
  1454. package/node_modules/pi-subagents/src/shared/utf8.d.ts +0 -6
  1455. package/node_modules/pi-subagents/src/shared/utf8.d.ts.map +0 -1
  1456. package/node_modules/pi-subagents/src/shared/utf8.js +0 -13
  1457. package/node_modules/pi-subagents/src/shared/utf8.js.map +0 -1
  1458. package/node_modules/pi-subagents/src/shared/utils.d.ts +0 -73
  1459. package/node_modules/pi-subagents/src/shared/utils.d.ts.map +0 -1
  1460. package/node_modules/pi-subagents/src/shared/utils.js +0 -596
  1461. package/node_modules/pi-subagents/src/shared/utils.js.map +0 -1
  1462. package/node_modules/pi-subagents/src/shared/watch-strategy.d.ts +0 -3
  1463. package/node_modules/pi-subagents/src/shared/watch-strategy.d.ts.map +0 -1
  1464. package/node_modules/pi-subagents/src/shared/watch-strategy.js +0 -6
  1465. package/node_modules/pi-subagents/src/shared/watch-strategy.js.map +0 -1
  1466. package/node_modules/pi-subagents/src/shared/workflow-child-permit.d.ts +0 -59
  1467. package/node_modules/pi-subagents/src/shared/workflow-child-permit.d.ts.map +0 -1
  1468. package/node_modules/pi-subagents/src/shared/workflow-child-permit.js +0 -160
  1469. package/node_modules/pi-subagents/src/shared/workflow-child-permit.js.map +0 -1
  1470. package/node_modules/pi-subagents/src/slash/delegation-adapters.d.ts +0 -153
  1471. package/node_modules/pi-subagents/src/slash/delegation-adapters.d.ts.map +0 -1
  1472. package/node_modules/pi-subagents/src/slash/delegation-adapters.js +0 -310
  1473. package/node_modules/pi-subagents/src/slash/delegation-adapters.js.map +0 -1
  1474. package/node_modules/pi-subagents/src/slash/delegation-json.d.ts +0 -11
  1475. package/node_modules/pi-subagents/src/slash/delegation-json.d.ts.map +0 -1
  1476. package/node_modules/pi-subagents/src/slash/delegation-json.js +0 -118
  1477. package/node_modules/pi-subagents/src/slash/delegation-json.js.map +0 -1
  1478. package/node_modules/pi-subagents/src/slash/delegation-request.d.ts +0 -13
  1479. package/node_modules/pi-subagents/src/slash/delegation-request.d.ts.map +0 -1
  1480. package/node_modules/pi-subagents/src/slash/delegation-request.js +0 -175
  1481. package/node_modules/pi-subagents/src/slash/delegation-request.js.map +0 -1
  1482. package/node_modules/pi-subagents/src/slash/prompt-template-bridge.d.ts +0 -27
  1483. package/node_modules/pi-subagents/src/slash/prompt-template-bridge.d.ts.map +0 -1
  1484. package/node_modules/pi-subagents/src/slash/prompt-template-bridge.js +0 -393
  1485. package/node_modules/pi-subagents/src/slash/prompt-template-bridge.js.map +0 -1
  1486. package/node_modules/pi-subagents/src/slash/prompt-workflows.d.ts +0 -22
  1487. package/node_modules/pi-subagents/src/slash/prompt-workflows.d.ts.map +0 -1
  1488. package/node_modules/pi-subagents/src/slash/prompt-workflows.js +0 -275
  1489. package/node_modules/pi-subagents/src/slash/prompt-workflows.js.map +0 -1
  1490. package/node_modules/pi-subagents/src/slash/selector.d.ts +0 -48
  1491. package/node_modules/pi-subagents/src/slash/selector.d.ts.map +0 -1
  1492. package/node_modules/pi-subagents/src/slash/selector.js +0 -118
  1493. package/node_modules/pi-subagents/src/slash/selector.js.map +0 -1
  1494. package/node_modules/pi-subagents/src/slash/slash-bridge.d.ts +0 -31
  1495. package/node_modules/pi-subagents/src/slash/slash-bridge.d.ts.map +0 -1
  1496. package/node_modules/pi-subagents/src/slash/slash-bridge.js +0 -133
  1497. package/node_modules/pi-subagents/src/slash/slash-bridge.js.map +0 -1
  1498. package/node_modules/pi-subagents/src/slash/slash-commands.d.ts +0 -11
  1499. package/node_modules/pi-subagents/src/slash/slash-commands.d.ts.map +0 -1
  1500. package/node_modules/pi-subagents/src/slash/slash-commands.js +0 -1060
  1501. package/node_modules/pi-subagents/src/slash/slash-commands.js.map +0 -1
  1502. package/node_modules/pi-subagents/src/slash/slash-live-state.d.ts +0 -22
  1503. package/node_modules/pi-subagents/src/slash/slash-live-state.d.ts.map +0 -1
  1504. package/node_modules/pi-subagents/src/slash/slash-live-state.js +0 -264
  1505. package/node_modules/pi-subagents/src/slash/slash-live-state.js.map +0 -1
  1506. package/node_modules/pi-subagents/src/slash/subagent-cost.d.ts +0 -30
  1507. package/node_modules/pi-subagents/src/slash/subagent-cost.d.ts.map +0 -1
  1508. package/node_modules/pi-subagents/src/slash/subagent-cost.js +0 -311
  1509. package/node_modules/pi-subagents/src/slash/subagent-cost.js.map +0 -1
  1510. package/node_modules/pi-subagents/src/slash/subagents-admin.d.ts +0 -3
  1511. package/node_modules/pi-subagents/src/slash/subagents-admin.d.ts.map +0 -1
  1512. package/node_modules/pi-subagents/src/slash/subagents-admin.js +0 -455
  1513. package/node_modules/pi-subagents/src/slash/subagents-admin.js.map +0 -1
  1514. package/node_modules/pi-subagents/src/tui/fleet-status.d.ts +0 -93
  1515. package/node_modules/pi-subagents/src/tui/fleet-status.d.ts.map +0 -1
  1516. package/node_modules/pi-subagents/src/tui/fleet-status.js +0 -1133
  1517. package/node_modules/pi-subagents/src/tui/fleet-status.js.map +0 -1
  1518. package/node_modules/pi-subagents/src/tui/fleet-transcript.d.ts +0 -52
  1519. package/node_modules/pi-subagents/src/tui/fleet-transcript.d.ts.map +0 -1
  1520. package/node_modules/pi-subagents/src/tui/fleet-transcript.js +0 -502
  1521. package/node_modules/pi-subagents/src/tui/fleet-transcript.js.map +0 -1
  1522. package/node_modules/pi-subagents/src/tui/fleet.d.ts +0 -169
  1523. package/node_modules/pi-subagents/src/tui/fleet.d.ts.map +0 -1
  1524. package/node_modules/pi-subagents/src/tui/fleet.js +0 -1432
  1525. package/node_modules/pi-subagents/src/tui/fleet.js.map +0 -1
  1526. package/node_modules/pi-subagents/src/tui/render-helpers.d.ts +0 -24
  1527. package/node_modules/pi-subagents/src/tui/render-helpers.d.ts.map +0 -1
  1528. package/node_modules/pi-subagents/src/tui/render-helpers.js +0 -101
  1529. package/node_modules/pi-subagents/src/tui/render-helpers.js.map +0 -1
  1530. package/node_modules/pi-subagents/src/tui/render.d.ts +0 -61
  1531. package/node_modules/pi-subagents/src/tui/render.d.ts.map +0 -1
  1532. package/node_modules/pi-subagents/src/tui/render.js +0 -3677
  1533. package/node_modules/pi-subagents/src/tui/render.js.map +0 -1
  1534. package/node_modules/pi-subagents/src/tui/running-tone.d.ts +0 -11
  1535. package/node_modules/pi-subagents/src/tui/running-tone.d.ts.map +0 -1
  1536. package/node_modules/pi-subagents/src/tui/running-tone.js +0 -23
  1537. package/node_modules/pi-subagents/src/tui/running-tone.js.map +0 -1
  1538. package/node_modules/pi-subagents/src/tui/subagent-messages.d.ts +0 -23
  1539. package/node_modules/pi-subagents/src/tui/subagent-messages.d.ts.map +0 -1
  1540. package/node_modules/pi-subagents/src/tui/subagent-messages.js +0 -270
  1541. package/node_modules/pi-subagents/src/tui/subagent-messages.js.map +0 -1
  1542. package/node_modules/pi-subagents/src/watchdog/change-signature.d.ts +0 -8
  1543. package/node_modules/pi-subagents/src/watchdog/change-signature.d.ts.map +0 -1
  1544. package/node_modules/pi-subagents/src/watchdog/change-signature.js +0 -244
  1545. package/node_modules/pi-subagents/src/watchdog/change-signature.js.map +0 -1
  1546. package/node_modules/pi-subagents/src/watchdog/child-status.d.ts +0 -54
  1547. package/node_modules/pi-subagents/src/watchdog/child-status.d.ts.map +0 -1
  1548. package/node_modules/pi-subagents/src/watchdog/child-status.js +0 -188
  1549. package/node_modules/pi-subagents/src/watchdog/child-status.js.map +0 -1
  1550. package/node_modules/pi-subagents/src/watchdog/diff-tool.d.ts +0 -26
  1551. package/node_modules/pi-subagents/src/watchdog/diff-tool.d.ts.map +0 -1
  1552. package/node_modules/pi-subagents/src/watchdog/diff-tool.js +0 -99
  1553. package/node_modules/pi-subagents/src/watchdog/diff-tool.js.map +0 -1
  1554. package/node_modules/pi-subagents/src/watchdog/emission-guard.d.ts +0 -37
  1555. package/node_modules/pi-subagents/src/watchdog/emission-guard.d.ts.map +0 -1
  1556. package/node_modules/pi-subagents/src/watchdog/emission-guard.js +0 -98
  1557. package/node_modules/pi-subagents/src/watchdog/emission-guard.js.map +0 -1
  1558. package/node_modules/pi-subagents/src/watchdog/guidance.d.ts +0 -4
  1559. package/node_modules/pi-subagents/src/watchdog/guidance.d.ts.map +0 -1
  1560. package/node_modules/pi-subagents/src/watchdog/guidance.js +0 -20
  1561. package/node_modules/pi-subagents/src/watchdog/guidance.js.map +0 -1
  1562. package/node_modules/pi-subagents/src/watchdog/lsp-diagnostics.d.ts +0 -18
  1563. package/node_modules/pi-subagents/src/watchdog/lsp-diagnostics.d.ts.map +0 -1
  1564. package/node_modules/pi-subagents/src/watchdog/lsp-diagnostics.js +0 -490
  1565. package/node_modules/pi-subagents/src/watchdog/lsp-diagnostics.js.map +0 -1
  1566. package/node_modules/pi-subagents/src/watchdog/model-selection.d.ts +0 -25
  1567. package/node_modules/pi-subagents/src/watchdog/model-selection.d.ts.map +0 -1
  1568. package/node_modules/pi-subagents/src/watchdog/model-selection.js +0 -168
  1569. package/node_modules/pi-subagents/src/watchdog/model-selection.js.map +0 -1
  1570. package/node_modules/pi-subagents/src/watchdog/permission-arbiter.d.ts +0 -21
  1571. package/node_modules/pi-subagents/src/watchdog/permission-arbiter.d.ts.map +0 -1
  1572. package/node_modules/pi-subagents/src/watchdog/permission-arbiter.js +0 -136
  1573. package/node_modules/pi-subagents/src/watchdog/permission-arbiter.js.map +0 -1
  1574. package/node_modules/pi-subagents/src/watchdog/register-child.d.ts +0 -14
  1575. package/node_modules/pi-subagents/src/watchdog/register-child.d.ts.map +0 -1
  1576. package/node_modules/pi-subagents/src/watchdog/register-child.js +0 -129
  1577. package/node_modules/pi-subagents/src/watchdog/register-child.js.map +0 -1
  1578. package/node_modules/pi-subagents/src/watchdog/register-main.d.ts +0 -10
  1579. package/node_modules/pi-subagents/src/watchdog/register-main.d.ts.map +0 -1
  1580. package/node_modules/pi-subagents/src/watchdog/register-main.js +0 -400
  1581. package/node_modules/pi-subagents/src/watchdog/register-main.js.map +0 -1
  1582. package/node_modules/pi-subagents/src/watchdog/render.d.ts +0 -4
  1583. package/node_modules/pi-subagents/src/watchdog/render.d.ts.map +0 -1
  1584. package/node_modules/pi-subagents/src/watchdog/render.js +0 -34
  1585. package/node_modules/pi-subagents/src/watchdog/render.js.map +0 -1
  1586. package/node_modules/pi-subagents/src/watchdog/review.d.ts +0 -37
  1587. package/node_modules/pi-subagents/src/watchdog/review.d.ts.map +0 -1
  1588. package/node_modules/pi-subagents/src/watchdog/review.js +0 -320
  1589. package/node_modules/pi-subagents/src/watchdog/review.js.map +0 -1
  1590. package/node_modules/pi-subagents/src/watchdog/rules.d.ts +0 -22
  1591. package/node_modules/pi-subagents/src/watchdog/rules.d.ts.map +0 -1
  1592. package/node_modules/pi-subagents/src/watchdog/rules.js +0 -59
  1593. package/node_modules/pi-subagents/src/watchdog/rules.js.map +0 -1
  1594. package/node_modules/pi-subagents/src/watchdog/runtime.d.ts +0 -196
  1595. package/node_modules/pi-subagents/src/watchdog/runtime.d.ts.map +0 -1
  1596. package/node_modules/pi-subagents/src/watchdog/runtime.js +0 -867
  1597. package/node_modules/pi-subagents/src/watchdog/runtime.js.map +0 -1
  1598. package/node_modules/pi-subagents/src/watchdog/scope.d.ts +0 -15
  1599. package/node_modules/pi-subagents/src/watchdog/scope.d.ts.map +0 -1
  1600. package/node_modules/pi-subagents/src/watchdog/scope.js +0 -45
  1601. package/node_modules/pi-subagents/src/watchdog/scope.js.map +0 -1
  1602. package/node_modules/pi-subagents/src/watchdog/settings.d.ts +0 -30
  1603. package/node_modules/pi-subagents/src/watchdog/settings.d.ts.map +0 -1
  1604. package/node_modules/pi-subagents/src/watchdog/settings.js +0 -481
  1605. package/node_modules/pi-subagents/src/watchdog/settings.js.map +0 -1
  1606. package/node_modules/pi-subagents/src/watchdog/tool-actions.d.ts +0 -18
  1607. package/node_modules/pi-subagents/src/watchdog/tool-actions.d.ts.map +0 -1
  1608. package/node_modules/pi-subagents/src/watchdog/tool-actions.js +0 -151
  1609. package/node_modules/pi-subagents/src/watchdog/tool-actions.js.map +0 -1
  1610. package/node_modules/pi-subagents/src/watchdog/turn-delta.d.ts +0 -16
  1611. package/node_modules/pi-subagents/src/watchdog/turn-delta.d.ts.map +0 -1
  1612. package/node_modules/pi-subagents/src/watchdog/turn-delta.js +0 -189
  1613. package/node_modules/pi-subagents/src/watchdog/turn-delta.js.map +0 -1
  1614. package/node_modules/pi-subagents/src/watchdog/types.d.ts +0 -142
  1615. package/node_modules/pi-subagents/src/watchdog/types.d.ts.map +0 -1
  1616. package/node_modules/pi-subagents/src/watchdog/types.js +0 -28
  1617. package/node_modules/pi-subagents/src/watchdog/types.js.map +0 -1
  1618. package/node_modules/pi-subagents/src/watchdog/warning-format.d.ts +0 -8
  1619. package/node_modules/pi-subagents/src/watchdog/warning-format.d.ts.map +0 -1
  1620. package/node_modules/pi-subagents/src/watchdog/warning-format.js +0 -60
  1621. package/node_modules/pi-subagents/src/watchdog/warning-format.js.map +0 -1
  1622. package/node_modules/pi-subagents/src/workflows/chat-progress.d.ts +0 -38
  1623. package/node_modules/pi-subagents/src/workflows/chat-progress.d.ts.map +0 -1
  1624. package/node_modules/pi-subagents/src/workflows/chat-progress.js +0 -130
  1625. package/node_modules/pi-subagents/src/workflows/chat-progress.js.map +0 -1
  1626. package/node_modules/pi-subagents/src/workflows/host-command.d.ts +0 -31
  1627. package/node_modules/pi-subagents/src/workflows/host-command.d.ts.map +0 -1
  1628. package/node_modules/pi-subagents/src/workflows/host-command.js +0 -228
  1629. package/node_modules/pi-subagents/src/workflows/host-command.js.map +0 -1
  1630. package/node_modules/pi-subagents/src/workflows/scripted-workflow.d.ts +0 -205
  1631. package/node_modules/pi-subagents/src/workflows/scripted-workflow.d.ts.map +0 -1
  1632. package/node_modules/pi-subagents/src/workflows/scripted-workflow.js +0 -2730
  1633. package/node_modules/pi-subagents/src/workflows/scripted-workflow.js.map +0 -1
  1634. package/node_modules/pi-subagents/src/workflows/structured-workflow-scripts.d.ts +0 -10
  1635. package/node_modules/pi-subagents/src/workflows/structured-workflow-scripts.d.ts.map +0 -1
  1636. package/node_modules/pi-subagents/src/workflows/structured-workflow-scripts.js +0 -166
  1637. package/node_modules/pi-subagents/src/workflows/structured-workflow-scripts.js.map +0 -1
  1638. package/node_modules/pi-subagents/src/workflows/workflow-checklist.d.ts +0 -128
  1639. package/node_modules/pi-subagents/src/workflows/workflow-checklist.d.ts.map +0 -1
  1640. package/node_modules/pi-subagents/src/workflows/workflow-checklist.js +0 -315
  1641. package/node_modules/pi-subagents/src/workflows/workflow-checklist.js.map +0 -1
  1642. package/node_modules/pi-subagents/src/workflows/workflow-child-summary.d.ts +0 -20
  1643. package/node_modules/pi-subagents/src/workflows/workflow-child-summary.d.ts.map +0 -1
  1644. package/node_modules/pi-subagents/src/workflows/workflow-child-summary.js +0 -179
  1645. package/node_modules/pi-subagents/src/workflows/workflow-child-summary.js.map +0 -1
  1646. package/node_modules/pi-subagents/src/workflows/workflow-preflight.d.ts +0 -59
  1647. package/node_modules/pi-subagents/src/workflows/workflow-preflight.d.ts.map +0 -1
  1648. package/node_modules/pi-subagents/src/workflows/workflow-preflight.js +0 -289
  1649. package/node_modules/pi-subagents/src/workflows/workflow-preflight.js.map +0 -1
  1650. package/node_modules/pi-subagents/src/workflows/workflow-receipt.d.ts +0 -35
  1651. package/node_modules/pi-subagents/src/workflows/workflow-receipt.d.ts.map +0 -1
  1652. package/node_modules/pi-subagents/src/workflows/workflow-receipt.js +0 -455
  1653. package/node_modules/pi-subagents/src/workflows/workflow-receipt.js.map +0 -1
  1654. package/node_modules/pi-subagents/src/workflows/workflow-resources.d.ts +0 -56
  1655. package/node_modules/pi-subagents/src/workflows/workflow-resources.d.ts.map +0 -1
  1656. package/node_modules/pi-subagents/src/workflows/workflow-resources.js +0 -272
  1657. package/node_modules/pi-subagents/src/workflows/workflow-resources.js.map +0 -1
  1658. package/node_modules/pi-subagents/src/workflows/workflow-reuse.d.ts +0 -51
  1659. package/node_modules/pi-subagents/src/workflows/workflow-reuse.d.ts.map +0 -1
  1660. package/node_modules/pi-subagents/src/workflows/workflow-reuse.js +0 -103
  1661. package/node_modules/pi-subagents/src/workflows/workflow-reuse.js.map +0 -1
  1662. package/node_modules/pi-subagents/src/workflows/workflow-revival.d.ts +0 -32
  1663. package/node_modules/pi-subagents/src/workflows/workflow-revival.d.ts.map +0 -1
  1664. package/node_modules/pi-subagents/src/workflows/workflow-revival.js +0 -111
  1665. package/node_modules/pi-subagents/src/workflows/workflow-revival.js.map +0 -1
  1666. package/node_modules/pi-subagents/src/workflows/workflow-settlement.d.ts +0 -85
  1667. package/node_modules/pi-subagents/src/workflows/workflow-settlement.d.ts.map +0 -1
  1668. package/node_modules/pi-subagents/src/workflows/workflow-settlement.js +0 -204
  1669. package/node_modules/pi-subagents/src/workflows/workflow-settlement.js.map +0 -1
  1670. package/node_modules/undici/LICENSE +0 -21
  1671. package/node_modules/undici/README.md +0 -797
  1672. package/node_modules/undici/docs/docs/api/Agent.md +0 -291
  1673. package/node_modules/undici/docs/docs/api/BalancedPool.md +0 -297
  1674. package/node_modules/undici/docs/docs/api/CacheStorage.md +0 -188
  1675. package/node_modules/undici/docs/docs/api/CacheStore.md +0 -360
  1676. package/node_modules/undici/docs/docs/api/Client.md +0 -533
  1677. package/node_modules/undici/docs/docs/api/ClientStats.md +0 -93
  1678. package/node_modules/undici/docs/docs/api/Connector.md +0 -198
  1679. package/node_modules/undici/docs/docs/api/ContentType.md +0 -97
  1680. package/node_modules/undici/docs/docs/api/Cookies.md +0 -179
  1681. package/node_modules/undici/docs/docs/api/Debug.md +0 -78
  1682. package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +0 -515
  1683. package/node_modules/undici/docs/docs/api/Dispatcher.md +0 -827
  1684. package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +0 -171
  1685. package/node_modules/undici/docs/docs/api/Errors.md +0 -524
  1686. package/node_modules/undici/docs/docs/api/EventSource.md +0 -358
  1687. package/node_modules/undici/docs/docs/api/Fetch.md +0 -711
  1688. package/node_modules/undici/docs/docs/api/GlobalInstallation.md +0 -121
  1689. package/node_modules/undici/docs/docs/api/H2CClient.md +0 -385
  1690. package/node_modules/undici/docs/docs/api/Interceptors.md +0 -418
  1691. package/node_modules/undici/docs/docs/api/MockAgent.md +0 -622
  1692. package/node_modules/undici/docs/docs/api/MockCallHistory.md +0 -371
  1693. package/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +0 -206
  1694. package/node_modules/undici/docs/docs/api/MockClient.md +0 -199
  1695. package/node_modules/undici/docs/docs/api/MockErrors.md +0 -63
  1696. package/node_modules/undici/docs/docs/api/MockPool.md +0 -618
  1697. package/node_modules/undici/docs/docs/api/Pool.md +0 -279
  1698. package/node_modules/undici/docs/docs/api/PoolStats.md +0 -141
  1699. package/node_modules/undici/docs/docs/api/ProxyAgent.md +0 -248
  1700. package/node_modules/undici/docs/docs/api/RedirectHandler.md +0 -276
  1701. package/node_modules/undici/docs/docs/api/RetryAgent.md +0 -136
  1702. package/node_modules/undici/docs/docs/api/RetryHandler.md +0 -200
  1703. package/node_modules/undici/docs/docs/api/RoundRobinPool.md +0 -239
  1704. package/node_modules/undici/docs/docs/api/SnapshotAgent.md +0 -361
  1705. package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +0 -256
  1706. package/node_modules/undici/docs/docs/api/Util.md +0 -82
  1707. package/node_modules/undici/docs/docs/api/WebSocket.md +0 -536
  1708. package/node_modules/undici/docs/docs/api/api-lifecycle.md +0 -159
  1709. package/node_modules/undici/docs/docs/best-practices/client-certificate.md +0 -66
  1710. package/node_modules/undici/docs/docs/best-practices/crawling.md +0 -60
  1711. package/node_modules/undici/docs/docs/best-practices/migrating-from-v7-to-v8.md +0 -233
  1712. package/node_modules/undici/docs/docs/best-practices/mocking-request.md +0 -192
  1713. package/node_modules/undici/docs/docs/best-practices/proxy.md +0 -129
  1714. package/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +0 -226
  1715. package/node_modules/undici/docs/docs/best-practices/writing-tests.md +0 -65
  1716. package/node_modules/undici/docs/docs/getting-started.md +0 -281
  1717. package/node_modules/undici/docs/docs/index.md +0 -784
  1718. package/node_modules/undici/docs/docs/site.json +0 -125
  1719. package/node_modules/undici/docs/docs/type-map.json +0 -79
  1720. package/node_modules/undici/index-fetch.js +0 -65
  1721. package/node_modules/undici/index.d.ts +0 -3
  1722. package/node_modules/undici/index.js +0 -236
  1723. package/node_modules/undici/lib/api/abort-signal.js +0 -59
  1724. package/node_modules/undici/lib/api/api-connect.js +0 -112
  1725. package/node_modules/undici/lib/api/api-pipeline.js +0 -265
  1726. package/node_modules/undici/lib/api/api-request.js +0 -244
  1727. package/node_modules/undici/lib/api/api-stream.js +0 -270
  1728. package/node_modules/undici/lib/api/api-upgrade.js +0 -121
  1729. package/node_modules/undici/lib/api/index.js +0 -7
  1730. package/node_modules/undici/lib/api/readable.js +0 -616
  1731. package/node_modules/undici/lib/cache/memory-cache-store.js +0 -279
  1732. package/node_modules/undici/lib/cache/sqlite-cache-store.js +0 -469
  1733. package/node_modules/undici/lib/core/connect.js +0 -192
  1734. package/node_modules/undici/lib/core/constants.js +0 -120
  1735. package/node_modules/undici/lib/core/diagnostics.js +0 -227
  1736. package/node_modules/undici/lib/core/errors.js +0 -497
  1737. package/node_modules/undici/lib/core/request.js +0 -546
  1738. package/node_modules/undici/lib/core/socks5-client.js +0 -422
  1739. package/node_modules/undici/lib/core/socks5-utils.js +0 -212
  1740. package/node_modules/undici/lib/core/symbols.js +0 -79
  1741. package/node_modules/undici/lib/core/tree.js +0 -160
  1742. package/node_modules/undici/lib/core/util.js +0 -1049
  1743. package/node_modules/undici/lib/dispatcher/agent.js +0 -177
  1744. package/node_modules/undici/lib/dispatcher/balanced-pool.js +0 -217
  1745. package/node_modules/undici/lib/dispatcher/client-h1.js +0 -1801
  1746. package/node_modules/undici/lib/dispatcher/client-h2.js +0 -1781
  1747. package/node_modules/undici/lib/dispatcher/client.js +0 -741
  1748. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +0 -197
  1749. package/node_modules/undici/lib/dispatcher/dispatcher.js +0 -58
  1750. package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +0 -110
  1751. package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +0 -175
  1752. package/node_modules/undici/lib/dispatcher/fixed-queue.js +0 -135
  1753. package/node_modules/undici/lib/dispatcher/h2c-client.js +0 -51
  1754. package/node_modules/undici/lib/dispatcher/pool-base.js +0 -232
  1755. package/node_modules/undici/lib/dispatcher/pool.js +0 -143
  1756. package/node_modules/undici/lib/dispatcher/proxy-agent.js +0 -395
  1757. package/node_modules/undici/lib/dispatcher/retry-agent.js +0 -38
  1758. package/node_modules/undici/lib/dispatcher/round-robin-pool.js +0 -159
  1759. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +0 -350
  1760. package/node_modules/undici/lib/encoding/index.js +0 -33
  1761. package/node_modules/undici/lib/global.js +0 -82
  1762. package/node_modules/undici/lib/handler/cache-handler.js +0 -818
  1763. package/node_modules/undici/lib/handler/cache-revalidation-handler.js +0 -134
  1764. package/node_modules/undici/lib/handler/decorator-handler.js +0 -72
  1765. package/node_modules/undici/lib/handler/deduplication-handler.js +0 -466
  1766. package/node_modules/undici/lib/handler/redirect-handler.js +0 -238
  1767. package/node_modules/undici/lib/handler/retry-handler.js +0 -594
  1768. package/node_modules/undici/lib/interceptor/cache.js +0 -671
  1769. package/node_modules/undici/lib/interceptor/decompress.js +0 -394
  1770. package/node_modules/undici/lib/interceptor/deduplicate.js +0 -118
  1771. package/node_modules/undici/lib/interceptor/dns.js +0 -582
  1772. package/node_modules/undici/lib/interceptor/dump.js +0 -99
  1773. package/node_modules/undici/lib/interceptor/redirect.js +0 -21
  1774. package/node_modules/undici/lib/interceptor/response-error.js +0 -95
  1775. package/node_modules/undici/lib/interceptor/retry.js +0 -19
  1776. package/node_modules/undici/lib/llhttp/constants.d.ts +0 -195
  1777. package/node_modules/undici/lib/llhttp/constants.js +0 -531
  1778. package/node_modules/undici/lib/llhttp/llhttp-wasm.js +0 -15
  1779. package/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +0 -15
  1780. package/node_modules/undici/lib/llhttp/utils.d.ts +0 -2
  1781. package/node_modules/undici/lib/llhttp/utils.js +0 -12
  1782. package/node_modules/undici/lib/mock/mock-agent.js +0 -244
  1783. package/node_modules/undici/lib/mock/mock-call-history.js +0 -248
  1784. package/node_modules/undici/lib/mock/mock-client.js +0 -68
  1785. package/node_modules/undici/lib/mock/mock-errors.js +0 -29
  1786. package/node_modules/undici/lib/mock/mock-interceptor.js +0 -227
  1787. package/node_modules/undici/lib/mock/mock-pool.js +0 -68
  1788. package/node_modules/undici/lib/mock/mock-symbols.js +0 -32
  1789. package/node_modules/undici/lib/mock/mock-utils.js +0 -720
  1790. package/node_modules/undici/lib/mock/pending-interceptors-formatter.js +0 -43
  1791. package/node_modules/undici/lib/mock/snapshot-agent.js +0 -371
  1792. package/node_modules/undici/lib/mock/snapshot-recorder.js +0 -623
  1793. package/node_modules/undici/lib/mock/snapshot-utils.js +0 -158
  1794. package/node_modules/undici/lib/util/cache.js +0 -758
  1795. package/node_modules/undici/lib/util/date.js +0 -670
  1796. package/node_modules/undici/lib/util/runtime-features.js +0 -93
  1797. package/node_modules/undici/lib/util/stats.js +0 -32
  1798. package/node_modules/undici/lib/util/timers.js +0 -425
  1799. package/node_modules/undici/lib/web/cache/cache.js +0 -862
  1800. package/node_modules/undici/lib/web/cache/cachestorage.js +0 -152
  1801. package/node_modules/undici/lib/web/cache/util.js +0 -45
  1802. package/node_modules/undici/lib/web/cookies/constants.js +0 -12
  1803. package/node_modules/undici/lib/web/cookies/index.js +0 -199
  1804. package/node_modules/undici/lib/web/cookies/parse.js +0 -318
  1805. package/node_modules/undici/lib/web/cookies/util.js +0 -352
  1806. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +0 -521
  1807. package/node_modules/undici/lib/web/eventsource/eventsource.js +0 -500
  1808. package/node_modules/undici/lib/web/eventsource/util.js +0 -60
  1809. package/node_modules/undici/lib/web/fetch/LICENSE +0 -21
  1810. package/node_modules/undici/lib/web/fetch/body.js +0 -547
  1811. package/node_modules/undici/lib/web/fetch/constants.js +0 -131
  1812. package/node_modules/undici/lib/web/fetch/data-url.js +0 -596
  1813. package/node_modules/undici/lib/web/fetch/formdata-parser.js +0 -586
  1814. package/node_modules/undici/lib/web/fetch/formdata.js +0 -278
  1815. package/node_modules/undici/lib/web/fetch/global.js +0 -40
  1816. package/node_modules/undici/lib/web/fetch/headers.js +0 -719
  1817. package/node_modules/undici/lib/web/fetch/index.js +0 -2432
  1818. package/node_modules/undici/lib/web/fetch/request.js +0 -1144
  1819. package/node_modules/undici/lib/web/fetch/response.js +0 -639
  1820. package/node_modules/undici/lib/web/fetch/util.js +0 -1530
  1821. package/node_modules/undici/lib/web/infra/index.js +0 -229
  1822. package/node_modules/undici/lib/web/subresource-integrity/Readme.md +0 -9
  1823. package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +0 -307
  1824. package/node_modules/undici/lib/web/webidl/index.js +0 -1004
  1825. package/node_modules/undici/lib/web/websocket/connection.js +0 -329
  1826. package/node_modules/undici/lib/web/websocket/constants.js +0 -126
  1827. package/node_modules/undici/lib/web/websocket/events.js +0 -331
  1828. package/node_modules/undici/lib/web/websocket/frame.js +0 -127
  1829. package/node_modules/undici/lib/web/websocket/permessage-deflate.js +0 -105
  1830. package/node_modules/undici/lib/web/websocket/receiver.js +0 -507
  1831. package/node_modules/undici/lib/web/websocket/sender.js +0 -109
  1832. package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +0 -104
  1833. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +0 -496
  1834. package/node_modules/undici/lib/web/websocket/util.js +0 -347
  1835. package/node_modules/undici/lib/web/websocket/websocket.js +0 -780
  1836. package/node_modules/undici/package.json +0 -152
  1837. package/node_modules/undici/scripts/strip-comments.js +0 -10
  1838. package/node_modules/undici/types/README.md +0 -6
  1839. package/node_modules/undici/types/agent.d.ts +0 -30
  1840. package/node_modules/undici/types/api.d.ts +0 -43
  1841. package/node_modules/undici/types/balanced-pool.d.ts +0 -30
  1842. package/node_modules/undici/types/cache-interceptor.d.ts +0 -179
  1843. package/node_modules/undici/types/cache.d.ts +0 -36
  1844. package/node_modules/undici/types/client-stats.d.ts +0 -15
  1845. package/node_modules/undici/types/client.d.ts +0 -184
  1846. package/node_modules/undici/types/connector.d.ts +0 -37
  1847. package/node_modules/undici/types/content-type.d.ts +0 -21
  1848. package/node_modules/undici/types/cookies.d.ts +0 -30
  1849. package/node_modules/undici/types/diagnostics-channel.d.ts +0 -74
  1850. package/node_modules/undici/types/dispatcher.d.ts +0 -253
  1851. package/node_modules/undici/types/dispatcher1-wrapper.d.ts +0 -7
  1852. package/node_modules/undici/types/env-http-proxy-agent.d.ts +0 -22
  1853. package/node_modules/undici/types/errors.d.ts +0 -187
  1854. package/node_modules/undici/types/eventsource.d.ts +0 -66
  1855. package/node_modules/undici/types/fetch.d.ts +0 -235
  1856. package/node_modules/undici/types/formdata.d.ts +0 -108
  1857. package/node_modules/undici/types/global-dispatcher.d.ts +0 -9
  1858. package/node_modules/undici/types/global-origin.d.ts +0 -7
  1859. package/node_modules/undici/types/h2c-client.d.ts +0 -73
  1860. package/node_modules/undici/types/handlers.d.ts +0 -16
  1861. package/node_modules/undici/types/header.d.ts +0 -165
  1862. package/node_modules/undici/types/index.d.ts +0 -93
  1863. package/node_modules/undici/types/interceptors.d.ts +0 -82
  1864. package/node_modules/undici/types/mock-agent.d.ts +0 -69
  1865. package/node_modules/undici/types/mock-call-history.d.ts +0 -111
  1866. package/node_modules/undici/types/mock-client.d.ts +0 -27
  1867. package/node_modules/undici/types/mock-errors.d.ts +0 -12
  1868. package/node_modules/undici/types/mock-interceptor.d.ts +0 -98
  1869. package/node_modules/undici/types/mock-pool.d.ts +0 -27
  1870. package/node_modules/undici/types/patch.d.ts +0 -29
  1871. package/node_modules/undici/types/pool-stats.d.ts +0 -19
  1872. package/node_modules/undici/types/pool.d.ts +0 -39
  1873. package/node_modules/undici/types/proxy-agent.d.ts +0 -36
  1874. package/node_modules/undici/types/readable.d.ts +0 -68
  1875. package/node_modules/undici/types/retry-agent.d.ts +0 -8
  1876. package/node_modules/undici/types/retry-handler.d.ts +0 -125
  1877. package/node_modules/undici/types/round-robin-pool.d.ts +0 -39
  1878. package/node_modules/undici/types/snapshot-agent.d.ts +0 -113
  1879. package/node_modules/undici/types/socks5-proxy-agent.d.ts +0 -27
  1880. package/node_modules/undici/types/util.d.ts +0 -18
  1881. package/node_modules/undici/types/utility.d.ts +0 -7
  1882. package/node_modules/undici/types/webidl.d.ts +0 -346
  1883. package/node_modules/undici/types/websocket.d.ts +0 -188
  1884. package/src/tools/utils/pi-subagent-delegation.ts +0 -121
@@ -1,3677 +0,0 @@
1
- /**
2
- * Rendering functions for subagent results
3
- */
4
- import * as path from "node:path";
5
- import { createHash } from "node:crypto";
6
- import { getMarkdownTheme, keyText } from "@earendil-works/pi-coding-agent";
7
- import { Container, Markdown, Spacer, Text, visibleWidth } from "@earendil-works/pi-tui";
8
- import { unresolvedChildWatchdogBlockers } from "../watchdog/child-status.js";
9
- import { MAX_WIDGET_JOBS, WIDGET_ANIMATION_INTERVAL_MS, WIDGET_KEY, } from "../shared/types.js";
10
- import { previewDisplayText, sanitizeDisplayText, truncateDisplayText } from "../shared/display-text.js";
11
- import { formatShortcutLabel } from "../shared/shortcuts.js";
12
- import { formatContextUsage, formatTokens, formatUsage, formatDuration, formatModelThinking, formatToolCall, formatTokenUsage, shortenPath } from "../shared/formatters.js";
13
- import { getDisplayItems, getSingleResultOutput, PROMPT_REDACTED } from "../shared/utils.js";
14
- import { flatToLogicalStepIndex } from "../runs/background/parallel-groups.js";
15
- import { formatNestedAggregate } from "../runs/shared/nested-render.js";
16
- import { aggregateStepStatus, formatActivityLabel, formatAgentRunningLabel, formatParallelOutcome } from "../shared/status-format.js";
17
- import { contextModeBadge, contextModePrefix } from "../runs/shared/context-mode.js";
18
- import { shouldSuppressSingleStep, stripRepeatedAgentPrefix, withDuplicateLabelDiscriminators } from "./render-helpers.js";
19
- import { runningTone } from "./running-tone.js";
20
- import { childThinkingLevel } from "../shared/model-info.js";
21
- import { buildWorkflowChatProgressRows } from "../workflows/chat-progress.js";
22
- import { formatWorkflowPreflight, formatWorkflowPreflightPlanSummary, formatWorkflowPreflightWarningSummary, formatWorkflowPreflightWarnings } from "../workflows/workflow-preflight.js";
23
- import { encodeAsyncStatusSnapshotWidget } from "../runs/background/async-status-snapshot.js";
24
- import { projectAsyncWorkflowRows } from "../runs/shared/async-status-projection.js";
25
- import { hostStepReportName, hostStepVerdictLabel } from "../runs/shared/host-step-status.js";
26
- import { workflowGraphStageNodes } from "../runs/shared/workflow-graph.js";
27
- import { formatWorkflowChecklistBottleneck, formatWorkflowChecklistPhase, formatWorkflowChecklistSummary, projectWorkflowChecklist } from "../workflows/workflow-checklist.js";
28
- function resolveMainWindowRenderLayout(config) {
29
- return {
30
- horizontalSpacing: config?.horizontalSpacing ?? 2,
31
- ...(config?.compactResultMaxLines !== undefined ? { compactResultMaxLines: config.compactResultMaxLines } : {}),
32
- };
33
- }
34
- function mainWindowIndent(layout, level) {
35
- return " ".repeat(Math.max(0, layout.horizontalSpacing * level));
36
- }
37
- function capCompactMainWindowResult(component, layout, theme, enabled) {
38
- const maxLines = layout.compactResultMaxLines;
39
- if (!enabled || maxLines === undefined)
40
- return component;
41
- const capped = new Container();
42
- capped.render = (width) => {
43
- const lines = component.render(width);
44
- if (lines.length <= maxLines)
45
- return lines;
46
- const visibleRows = maxLines === 1 ? 1 : maxLines - 1;
47
- const hiddenCount = lines.length - visibleRows;
48
- const hint = theme.fg("accent", `… ${hiddenCount} rows hidden · ${expandKeyHint("to expand", "to view them")}`);
49
- if (maxLines === 1)
50
- return [truncLine(`${lines[0] ?? ""} ${hint}`, width)];
51
- return [...lines.slice(0, visibleRows), truncLine(hint, width)];
52
- };
53
- return capped;
54
- }
55
- function expandKeyHint(action, unconfiguredAction = action) {
56
- const shortcut = keyText("app.tools.expand");
57
- return shortcut ? `Press ${shortcut} ${action}` : `Configure the expand key ${unconfiguredAction}`;
58
- }
59
- export function liveDetailHintText() {
60
- return expandKeyHint("for live detail");
61
- }
62
- function workflowDetailHintText() {
63
- return expandKeyHint("for details");
64
- }
65
- function foregroundSingleHintText(shortcut) {
66
- if (!shortcut)
67
- return liveDetailHintText();
68
- const label = formatShortcutLabel(shortcut);
69
- return `${liveDetailHintText()} · ${label} to run in background`;
70
- }
71
- function getTermWidth() {
72
- return process.stdout.columns || 120;
73
- }
74
- const segmenter = new Intl.Segmenter(undefined, { granularity: "grapheme" });
75
- const ansiStylePattern = /\x1b\[[0-9;]*m/y;
76
- /**
77
- * Truncate a line to maxWidth, preserving ANSI styling through the ellipsis.
78
- *
79
- * pi-tui's truncateToWidth adds \x1b[0m before ellipsis which resets all styling,
80
- * causing background color bleed in the TUI. This implementation tracks active
81
- * ANSI styles and re-applies them before the ellipsis.
82
- *
83
- * Uses Intl.Segmenter for proper Unicode/emoji handling (not char-by-char).
84
- */
85
- export function truncLine(text, maxWidth) {
86
- if (maxWidth <= 0)
87
- return "";
88
- if (visibleWidth(text) <= maxWidth)
89
- return text;
90
- const targetWidth = maxWidth - 1;
91
- let result = "";
92
- let currentWidth = 0;
93
- let activeStyles = [];
94
- let i = 0;
95
- while (i < text.length) {
96
- ansiStylePattern.lastIndex = i;
97
- const ansiMatch = ansiStylePattern.exec(text);
98
- if (ansiMatch) {
99
- const code = ansiMatch[0];
100
- result += code;
101
- if (code === "\x1b[0m" || code === "\x1b[m") {
102
- activeStyles = [];
103
- }
104
- else {
105
- activeStyles.push(code);
106
- }
107
- i += code.length;
108
- continue;
109
- }
110
- let end = text.indexOf("\x1b[", i);
111
- if (end === i)
112
- end = text.indexOf("\x1b[", i + 2);
113
- if (end === -1)
114
- end = text.length;
115
- const textPortion = text.slice(i, end);
116
- for (const seg of segmenter.segment(textPortion)) {
117
- const grapheme = seg.segment;
118
- const graphemeWidth = grapheme === "\x1b" ? 0 : visibleWidth(grapheme);
119
- if (currentWidth + graphemeWidth > targetWidth) {
120
- return result + activeStyles.join("") + "…";
121
- }
122
- result += grapheme;
123
- currentWidth += graphemeWidth;
124
- }
125
- i = end;
126
- }
127
- return result + activeStyles.join("") + "…";
128
- }
129
- function wrapPlainText(text, maxWidth) {
130
- if (maxWidth <= 0)
131
- return [""];
132
- const lines = [];
133
- for (const rawLine of text.split("\n")) {
134
- if (rawLine.length === 0) {
135
- lines.push("");
136
- continue;
137
- }
138
- let current = "";
139
- let currentWidth = 0;
140
- for (const seg of segmenter.segment(rawLine)) {
141
- const grapheme = seg.segment;
142
- const graphemeWidth = visibleWidth(grapheme);
143
- if (graphemeWidth > maxWidth)
144
- continue;
145
- if (currentWidth > 0 && currentWidth + graphemeWidth > maxWidth) {
146
- lines.push(current);
147
- current = grapheme;
148
- currentWidth = graphemeWidth;
149
- continue;
150
- }
151
- current += grapheme;
152
- currentWidth += graphemeWidth;
153
- }
154
- lines.push(current);
155
- }
156
- return lines;
157
- }
158
- const RUNNING_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
159
- const STATIC_RUNNING_GLYPH = "●";
160
- function runningSeed(...values) {
161
- let seed;
162
- for (const value of values) {
163
- if (value === undefined || !Number.isFinite(value))
164
- continue;
165
- seed = (seed ?? 0) + Math.trunc(value);
166
- }
167
- return seed;
168
- }
169
- function runningGlyph(seed) {
170
- if (seed === undefined)
171
- return STATIC_RUNNING_GLYPH;
172
- return RUNNING_FRAMES[Math.abs(seed) % RUNNING_FRAMES.length];
173
- }
174
- function animatedSeed(seed, frame) {
175
- if (frame === undefined)
176
- return seed;
177
- return (seed ?? 0) + frame;
178
- }
179
- function progressRunningSeed(progress) {
180
- if (!progress)
181
- return undefined;
182
- return runningSeed(progress.index, progress.toolCount, progress.tokens, progress.durationMs, progress.lastActivityAt, progress.currentToolStartedAt, progress.turnCount);
183
- }
184
- export function clearLegacyResultAnimationTimer(context) {
185
- const timer = context.state.subagentResultAnimationTimer;
186
- if (!timer)
187
- return;
188
- clearInterval(timer);
189
- context.state.subagentResultAnimationTimer = undefined;
190
- }
191
- function extractOutputTarget(task) {
192
- const writeToMatch = task.match(/\[Write to:\s*([^\]\n]+)\]/i);
193
- if (writeToMatch?.[1]?.trim())
194
- return writeToMatch[1].trim();
195
- const findingsMatch = task.match(/Write your findings to(?: exactly this path)?:\s*([^\r\n]+)/i);
196
- if (findingsMatch?.[1]?.trim())
197
- return findingsMatch[1].trim();
198
- const outputMatch = task.match(/[Oo]utput(?:\s+to)?\s*:\s*(\S+)/i);
199
- if (outputMatch?.[1]?.trim())
200
- return outputMatch[1].trim();
201
- return undefined;
202
- }
203
- function hasEmptyTextOutputWithoutOutputTarget(task, output) {
204
- if (output.trim())
205
- return false;
206
- return !extractOutputTarget(task);
207
- }
208
- function getToolCallLines(result, expanded) {
209
- if (result.messages) {
210
- return getDisplayItems(result.messages)
211
- .filter((item) => item.type === "tool")
212
- .map((item) => formatToolCall(item.name, item.args, expanded));
213
- }
214
- return result.toolCalls?.map((toolCall) => expanded ? toolCall.expandedText : toolCall.text) ?? [];
215
- }
216
- const ansiEscapePattern = /\x1b\[[0-9;]*m/g;
217
- const noisyStatusPatterns = [
218
- /^(?:i|we)\s+(?:will|need|can|should|am|are)\b/i,
219
- /^i(?:'m|’m| am)\b/i,
220
- /\bso i (?:will|need|can)\b/i,
221
- /^(?:checking|fetching|reading|inspecting|verifying|collecting|confirming|polling)\b/i,
222
- /^(?:async\s+subagent\s+)?[\w.-]+\s*·\s*(?:step|agent)\s+\d+\/\d+\s*·/i,
223
- /^(?:Step|Agent)\s+\d+\/\d+:\s+[\w.-]+\s*·\s*(?:running|queued|pending|complete|completed)\b/i,
224
- /^(?:async\s+subagent\s+)?[\w.-]+(?:\s+\[(?:fresh|fork|mixed)\])?\s*·\s*(?:running|queued|pending|complete|completed|done)\b/i,
225
- /^Press\s+\S+\s+for\s+live\s+detail$/i,
226
- /^output:\s+.+\/async-subagent-runs\//i,
227
- ];
228
- const liveOutputWordSignalPattern = /\b(?:access denied|denied|error|exception|fail(?:ed|ure)?|fatal|panic|rejected|timeout|timed out|unable|warning)\b/i;
229
- const liveOutputCodeSignalPattern = /\bE[A-Z0-9_]{2,}\b/;
230
- function oneLine(text) {
231
- return text.replace(ansiEscapePattern, "").replace(/\s+/g, " ").trim();
232
- }
233
- const COMPACT_TASK_MAX_CHARS = 96;
234
- /** Display label for a child run: the derived session name (agent + task
235
- * excerpt) when the launcher provided one, else the bare agent name. */
236
- function childDisplayName(result, fallback = "subagent") {
237
- return result?.sessionName?.trim() || result?.agent || fallback;
238
- }
239
- export function compactTaskText(task, label) {
240
- const taskText = task?.trim();
241
- const labelText = label?.trim();
242
- const normalizedTask = taskText && taskText !== PROMPT_REDACTED ? oneLine(taskText) : "";
243
- const normalizedLabel = labelText && labelText !== PROMPT_REDACTED ? oneLine(labelText) : "";
244
- const normalized = normalizedLabel && normalizedTask && normalizedLabel !== normalizedTask
245
- ? `${normalizedLabel} — ${normalizedTask}`
246
- : normalizedLabel || normalizedTask;
247
- if (!normalized)
248
- return undefined;
249
- return previewDisplayText(normalized, COMPACT_TASK_MAX_CHARS);
250
- }
251
- const LANE_VALUE_MAX_CHARS = 48;
252
- function boundedLaneValue(value, maxChars = LANE_VALUE_MAX_CHARS) {
253
- if (!value?.trim() || value.trim() === PROMPT_REDACTED)
254
- return undefined;
255
- return previewDisplayText(oneLine(value), maxChars);
256
- }
257
- function workflowNodeStepStatus(status) {
258
- switch (status) {
259
- case "completed":
260
- return "completed";
261
- case "detached":
262
- return "paused";
263
- default:
264
- return status;
265
- }
266
- }
267
- function workflowNodeStatusLabel(status) {
268
- switch (status) {
269
- case "completed":
270
- return "complete";
271
- case "detached":
272
- return "paused";
273
- default:
274
- return status;
275
- }
276
- }
277
- function workflowStepPriority(step, currentNodeId) {
278
- const isCurrent = step.workflowKey === currentNodeId;
279
- if (step.status === "running" || (isCurrent && step.status !== "complete" && step.status !== "completed"))
280
- return 0;
281
- const gate = laneGate(step);
282
- if (step.status === "failed"
283
- || step.status === "partial"
284
- || step.status === "paused"
285
- || step.status === "stopped"
286
- || step.status === "rejected"
287
- || step.toolBudgetBlocked === true
288
- || step.turnBudgetExceeded === true
289
- || step.activityState === "needs_attention"
290
- || step.watchdog?.phase === "stale"
291
- || unresolvedChildWatchdogBlockers(step.watchdog).length > 0
292
- || gate !== undefined)
293
- return 1;
294
- if (step.status === "pending")
295
- return 2;
296
- return 3;
297
- }
298
- /** Merge materialized child rows with the planned workflow stages for rendering. */
299
- function workflowWidgetSteps(job, planned = job.mode === "workflow" ? workflowGraphStageNodes(job.workflowGraph) : []) {
300
- const loaded = job.steps ?? [];
301
- if (planned.length === 0)
302
- return loaded;
303
- const loadedIndexesByKey = new Map();
304
- for (const [index, step] of loaded.entries()) {
305
- if (!step.workflowKey)
306
- continue;
307
- const indexes = loadedIndexesByKey.get(step.workflowKey) ?? [];
308
- indexes.push(index);
309
- loadedIndexesByKey.set(step.workflowKey, indexes);
310
- }
311
- const consumed = new Set();
312
- const entries = [];
313
- for (const [order, node] of planned.entries()) {
314
- const loadedIndex = loadedIndexesByKey.get(node.id)?.find((index) => !consumed.has(index));
315
- if (loadedIndex !== undefined) {
316
- consumed.add(loadedIndex);
317
- const loadedStep = loaded[loadedIndex];
318
- entries.push({
319
- step: {
320
- ...loadedStep,
321
- index: node.flatIndex ?? loadedStep.index ?? order,
322
- agent: loadedStep.agent || node.agent || job.agents?.[0] || "workflow",
323
- phase: loadedStep.phase ?? node.phase,
324
- label: loadedStep.label ?? node.label,
325
- workflowKey: loadedStep.workflowKey ?? node.id,
326
- ...(loadedStep.outputName === undefined && node.outputName !== undefined ? { outputName: node.outputName } : {}),
327
- ...(loadedStep.structured === undefined && node.structured !== undefined ? { structured: node.structured } : {}),
328
- ...(loadedStep.error === undefined && node.error !== undefined ? { error: node.error } : {}),
329
- },
330
- order,
331
- });
332
- continue;
333
- }
334
- entries.push({
335
- step: {
336
- index: node.flatIndex ?? order,
337
- agent: node.agent ?? job.agents?.[0] ?? "workflow",
338
- status: workflowNodeStepStatus(node.status),
339
- workflowKey: node.id,
340
- label: node.label,
341
- ...(node.phase ? { phase: node.phase } : {}),
342
- ...(node.outputName ? { outputName: node.outputName } : {}),
343
- ...(node.structured !== undefined ? { structured: node.structured } : {}),
344
- ...(node.error ? { error: node.error } : {}),
345
- },
346
- order,
347
- });
348
- }
349
- for (const [index, step] of loaded.entries()) {
350
- if (!consumed.has(index))
351
- entries.push({ step, order: planned.length + index });
352
- }
353
- entries.sort((left, right) => workflowStepPriority(left.step, job.workflowGraph?.currentNodeId) - workflowStepPriority(right.step, job.workflowGraph?.currentNodeId) || left.order - right.order);
354
- return entries.map(({ step }) => step);
355
- }
356
- function workflowStageProgress(job, stages = job.mode === "workflow" ? workflowGraphStageNodes(job.workflowGraph) : []) {
357
- if (job.mode !== "workflow")
358
- return undefined;
359
- if (stages.length === 0)
360
- return undefined;
361
- const currentId = job.workflowGraph?.currentNodeId;
362
- const currentIndex = currentId ? stages.findIndex((stage) => stage.id === currentId) : -1;
363
- if (currentIndex >= 0 && stages[currentIndex]?.status !== "completed")
364
- return { total: stages.length, current: currentIndex };
365
- const runningIndex = stages.findIndex((stage) => stage.status === "running");
366
- if (runningIndex >= 0)
367
- return { total: stages.length, current: runningIndex };
368
- const indexedStage = job.currentStep !== undefined && job.currentStep >= 0 ? stages[job.currentStep] : undefined;
369
- if (indexedStage && indexedStage.status !== "completed")
370
- return { total: stages.length, current: job.currentStep };
371
- if (stages.every((stage) => stage.status === "completed"))
372
- return { total: stages.length, current: stages.length - 1 };
373
- return { total: stages.length };
374
- }
375
- function buildWorkflowWidgetProjection(job, now = Date.now()) {
376
- const stages = job.mode === "workflow" ? workflowGraphStageNodes(job.workflowGraph) : [];
377
- const stageProgress = workflowStageProgress(job, stages);
378
- const clock = job.status === "running" ? now : job.updatedAt;
379
- const loadedSteps = workflowWidgetSteps(job, stages);
380
- const steps = job.mode === "workflow" ? loadedSteps.map((step) => step.status === "running" && step.startedAt !== undefined && clock !== undefined
381
- ? { ...step, durationMs: Math.max(0, clock - step.startedAt) } : step) : loadedSteps;
382
- const projection = { stages, steps, now };
383
- if (stageProgress)
384
- projection.stageProgress = stageProgress;
385
- if (stages.length)
386
- projection.plannedKeys = new Set(stages.map((node) => node.id));
387
- if (job.mode === "workflow") {
388
- const checklist = projectWorkflowChecklist({
389
- graph: job.workflowGraph,
390
- steps: job.steps,
391
- hostSteps: job.hostSteps,
392
- preflight: job.preflight,
393
- trace: job.workflow?.trace,
394
- now: clock,
395
- });
396
- if (checklist.total > 0)
397
- projection.checklist = checklist;
398
- }
399
- return projection;
400
- }
401
- function workflowWidgetProjectionLookup(now = Date.now(), childrenByParent = new Map()) {
402
- const projections = new WeakMap();
403
- return (job) => {
404
- const cached = projections.get(job);
405
- if (cached)
406
- return cached;
407
- const projection = buildWorkflowWidgetProjection(job, now);
408
- const children = childrenByParent.get(job.asyncId);
409
- if (children?.length) {
410
- projection.children = children;
411
- projection.materializedKeys = new Set(children.flatMap((child) => [child.asyncId, ...(child.workflowKey ? [child.workflowKey] : [])]));
412
- for (const step of projection.steps) {
413
- if (step.runId && projection.materializedKeys.has(step.runId) && step.workflowKey)
414
- projection.materializedKeys.add(step.workflowKey);
415
- }
416
- }
417
- projections.set(job, projection);
418
- return projection;
419
- };
420
- }
421
- function laneStepForJob(job, steps = workflowWidgetSteps(job)) {
422
- if (steps.length === 0)
423
- return undefined;
424
- const graphCurrent = job.workflowGraph?.currentNodeId;
425
- if (graphCurrent) {
426
- const current = steps.find((step) => step.workflowKey === graphCurrent);
427
- if (current)
428
- return current;
429
- }
430
- if (job.currentStep !== undefined) {
431
- const current = steps[job.currentStep];
432
- if (current && (current.index === undefined || current.index === job.currentStep))
433
- return current;
434
- // Active parallel groups retain flat indices while exposing only the group slice.
435
- const indexedCurrent = steps.find((step) => step.index === job.currentStep);
436
- if (indexedCurrent)
437
- return indexedCurrent;
438
- return steps[0];
439
- }
440
- return steps.find((step) => step.status === "running")
441
- ?? steps.find((step) => step.status === "pending")
442
- ?? steps.at(-1);
443
- }
444
- function laneTraceForJob(job) {
445
- return Array.isArray(job.workflow?.trace) ? job.workflow.trace.at(-1) : undefined;
446
- }
447
- function laneGate(step) {
448
- const review = step?.review?.status ?? step?.acceptance?.reviewResult?.status;
449
- if (review === "blockers")
450
- return "review blockers";
451
- if (review === "review-required")
452
- return "review required";
453
- if (review === "reviewed")
454
- return "reviewed";
455
- const acceptance = step?.acceptance?.status;
456
- if (acceptance === "review-required")
457
- return "acceptance review";
458
- if (acceptance === "checked" || acceptance === "verified" || acceptance === "accepted")
459
- return "acceptance";
460
- return undefined;
461
- }
462
- function laneNextAction(state, step, output, gate) {
463
- if (unresolvedChildWatchdogBlockers(step?.watchdog).length > 0)
464
- return "resolve watchdog blockers";
465
- if (step?.watchdog?.phase === "stale")
466
- return "inspect stale state";
467
- if (step?.toolBudgetBlocked === true || step?.turnBudgetExceeded === true)
468
- return "inspect blocked state";
469
- if (gate === "review blockers")
470
- return "resolve review blockers";
471
- if (gate === "review required" || gate === "acceptance review")
472
- return "review output";
473
- if (step?.activityState === "needs_attention")
474
- return "inspect attention";
475
- if (state === "queued" || state === "pending")
476
- return "await launch";
477
- if (state === "failed" || state === "rejected")
478
- return "inspect failure";
479
- if (state === "partial")
480
- return "inspect partial state";
481
- if (state === "paused")
482
- return "inspect paused state";
483
- if (state === "stopped")
484
- return "inspect stopped state";
485
- if ((state === "complete" || state === "completed") && gate === "reviewed")
486
- return "ready";
487
- if ((state === "complete" || state === "completed") && output)
488
- return "inspect output";
489
- return undefined;
490
- }
491
- function isTerminalLaneState(state) {
492
- return state !== "queued" && state !== "running";
493
- }
494
- /** Project already-loaded async status facts into one bounded, render-only lane row. */
495
- export function projectAsyncLane(job, ...args) {
496
- const selectedStep = args.length === 0 ? laneStepForJob(job) : args[0];
497
- const trace = laneTraceForJob(job);
498
- const workspace = job.cwd ? boundedLaneValue(shortenPath(job.cwd)) : undefined;
499
- const label = compactTaskText(selectedStep?.description, selectedStep?.label)
500
- ?? boundedLaneValue(trace?.label)
501
- ?? (workspace ? undefined : boundedLaneValue(selectedStep?.workflowKey ?? job.workflowKey));
502
- const role = boundedLaneValue(selectedStep?.agent ?? trace?.agent ?? job.agents?.[0] ?? widgetJobName(job), 32) ?? "subagent";
503
- const phase = boundedLaneValue(selectedStep?.phase ?? trace?.phase);
504
- const gate = laneGate(selectedStep);
505
- const output = boundedLaneValue(selectedStep?.outputName);
506
- const ref = boundedLaneValue(selectedStep?.workflowKey ?? job.workflowKey ?? job.asyncId.slice(0, 8), 24) ?? job.asyncId.slice(0, 8);
507
- const chips = [
508
- selectedStep?.context,
509
- selectedStep?.structured ? "structured" : undefined,
510
- selectedStep?.activityState === "active_long_running" ? "long-running" : undefined,
511
- selectedStep?.activityState === "needs_attention" ? "attention" : undefined,
512
- selectedStep?.watchdog?.phase === "stale" ? "stale" : undefined,
513
- unresolvedChildWatchdogBlockers(selectedStep?.watchdog).length > 0 ? `wd:${unresolvedChildWatchdogBlockers(selectedStep?.watchdog).length}` : undefined,
514
- selectedStep?.toolBudgetBlocked === true || selectedStep?.turnBudgetExceeded === true ? "blocked" : undefined,
515
- ].filter((chip) => Boolean(chip));
516
- const state = isTerminalLaneState(job.status) ? job.status : selectedStep?.status ?? job.status;
517
- const next = laneNextAction(state, selectedStep, output, gate);
518
- if (!label && !phase && !gate && !output && !selectedStep?.workflowKey && !job.workflowKey && !trace?.label && !trace?.phase)
519
- return undefined;
520
- return { ...(label ? { label } : {}), role, ...(phase ? { phase } : {}), state, ...(gate ? { gate } : {}), ...(next ? { next } : {}), ...(output ? { output } : {}), ...(workspace ? { workspace } : {}), ref, chips };
521
- }
522
- function laneStateLabel(state, theme) {
523
- if (state === "running")
524
- return theme.fg("accent", "running");
525
- if (state === "queued" || state === "pending")
526
- return theme.fg("muted", state);
527
- if (state === "complete" || state === "completed")
528
- return theme.fg("success", "complete");
529
- if (state === "failed" || state === "rejected")
530
- return theme.fg("error", state === "rejected" ? "rejected" : "failed");
531
- return theme.fg("warning", state);
532
- }
533
- function formatLaneProjection(lane, theme) {
534
- const label = boundedLaneValue(lane.label, 56);
535
- const identity = [label, lane.role ? `role:${lane.role}` : undefined].filter(Boolean).join(" · ");
536
- return `${identity ? theme.bold(identity) : theme.bold(lane.role)} · ${laneStateLabel(lane.state, theme)}`;
537
- }
538
- function formatLaneChip(chip, theme) {
539
- const text = `[${chip}]`;
540
- if (chip === "blocked")
541
- return theme.fg("error", text);
542
- if (chip === "stale")
543
- return theme.fg("warning", text);
544
- return text;
545
- }
546
- function formatLaneProjectionDetails(lane, theme) {
547
- const details = [
548
- lane.phase ? `phase:${lane.phase}` : undefined,
549
- lane.gate ? `gate:${lane.gate}` : undefined,
550
- lane.next ? `next:${lane.next}` : undefined,
551
- lane.output ? `out:${lane.output}` : undefined,
552
- lane.workspace ? `workspace:${lane.workspace}` : lane.ref ? `ref:${lane.ref}` : undefined,
553
- ].filter(Boolean);
554
- const chips = lane.chips.map((chip) => formatLaneChip(chip, theme));
555
- return [...(details.length ? [theme.fg("dim", details.join(" · "))] : []), ...chips].join(" · ") || undefined;
556
- }
557
- function formatLaneProjectionLines(lane, theme, indent) {
558
- const details = formatLaneProjectionDetails(lane, theme);
559
- return [
560
- `${indent}${formatLaneProjection(lane, theme)}`,
561
- ...(details ? [`${indent} ${details}`] : []),
562
- ];
563
- }
564
- function laneRenderKey(job, projection) {
565
- const selectedStep = projection ? laneStepForJob(job, projection.steps) : laneStepForJob(job);
566
- const lane = projectAsyncLane(job, selectedStep);
567
- return lane ? [lane.label, lane.role, lane.phase, lane.state, lane.gate, lane.next, lane.output, lane.workspace, lane.ref, lane.chips] : undefined;
568
- }
569
- function widgetLaneDetailLines(job, theme, projection) {
570
- if (job.steps?.length && (job.mode === "parallel" || job.mode === "chain"))
571
- return [];
572
- const selectedStep = projection ? laneStepForJob(job, projection.steps) : laneStepForJob(job);
573
- const lane = projectAsyncLane(job, selectedStep);
574
- return lane ? formatLaneProjectionLines(lane, theme, " ") : [];
575
- }
576
- function workflowPreflightLines(job) {
577
- if (job.mode !== "workflow" || !job.preflight)
578
- return [];
579
- return [
580
- ...formatWorkflowPreflight(job.preflight, { indent: " " }).split("\n"),
581
- ...(job.workflow?.preflightWarnings ? formatWorkflowPreflightWarnings(job.workflow.preflightWarnings, { indent: " " }).split("\n") : []),
582
- ];
583
- }
584
- function workflowLabelForResult(details, resultIndex) {
585
- const flatIndex = foregroundResultIndex(details, resultIndex);
586
- const visit = (nodes) => {
587
- for (const node of nodes) {
588
- if (node.flatIndex === flatIndex && node.label.trim())
589
- return node.label;
590
- const nested = node.children ? visit(node.children) : undefined;
591
- if (nested)
592
- return nested;
593
- }
594
- return undefined;
595
- };
596
- return details.workflowGraph ? visit(details.workflowGraph.nodes) : undefined;
597
- }
598
- function foregroundProgressForResult(details, resultIndex) {
599
- const result = details.results[resultIndex];
600
- if (result?.progress)
601
- return result.progress;
602
- const index = result?.index ?? resultIndex;
603
- const indexed = details.progress?.find((progress) => progress.index === index);
604
- if (indexed)
605
- return indexed;
606
- return result?.agent
607
- ? details.progress?.find((progress) => progress.agent === result.agent && progress.status === "running")
608
- : undefined;
609
- }
610
- function foregroundResultIndex(details, resultIndex) {
611
- const result = details.results[resultIndex];
612
- if (typeof result?.index === "number")
613
- return result.index;
614
- return foregroundProgressForResult(details, resultIndex)?.index ?? resultIndex;
615
- }
616
- function foregroundResultDisplayName(details, resultIndex, result, fallback) {
617
- const progress = foregroundProgressForResult(details, resultIndex);
618
- const agent = normalizedParallelDisplayText(result?.agent) ?? normalizedParallelDisplayText(progress?.agent);
619
- const workflowLabel = normalizedParallelDisplayText(workflowLabelForResult(details, resultIndex));
620
- if (workflowLabel)
621
- return compactTaskText(undefined, workflowLabel) ?? workflowLabel;
622
- const sessionName = normalizedParallelDisplayText(result?.sessionName) ?? normalizedParallelDisplayText(progress?.sessionName);
623
- if (sessionName) {
624
- const sessionTask = stripRepeatedAgentPrefix(sessionName, agent);
625
- if (sessionTask && sessionTask !== PROMPT_REDACTED && sessionTask.toLowerCase() !== agent?.toLowerCase()) {
626
- return compactTaskText(sessionTask) ?? sessionTask;
627
- }
628
- }
629
- return compactTaskText(result?.task) ?? compactTaskText(progress?.task) ?? agent ?? fallback;
630
- }
631
- function foregroundSingleDisplayName(result) {
632
- return normalizedParallelDisplayText(result?.agent)
633
- ?? normalizedParallelDisplayText(result?.sessionName)
634
- ?? compactTaskText(result?.task)
635
- ?? "subagent";
636
- }
637
- function hasLiveOutputSignal(line) {
638
- const clean = oneLine(line);
639
- return liveOutputWordSignalPattern.test(clean) || liveOutputCodeSignalPattern.test(clean);
640
- }
641
- function isNoisyStatusLine(line) {
642
- const clean = oneLine(line);
643
- return clean.length > 0
644
- && clean.length <= 240
645
- && !hasLiveOutputSignal(clean)
646
- && noisyStatusPatterns.some((pattern) => pattern.test(clean));
647
- }
648
- function latestActivityText(line) {
649
- return oneLine(line)
650
- .replace(/^i (?:will|can|need to|am going to)\s+/i, "")
651
- .replace(/^i(?:'m|’m| am)\s+/i, "");
652
- }
653
- function progressUpdateSummary(lines) {
654
- const counts = new Map();
655
- for (const line of lines)
656
- counts.set(line.toLowerCase(), (counts.get(line.toLowerCase()) ?? 0) + 1);
657
- const exactRepeatCount = Math.max(...counts.values());
658
- const latest = latestActivityText(lines[lines.length - 1]);
659
- const repeat = exactRepeatCount > 1 ? ` · repeated ${exactRepeatCount}×` : "";
660
- return `↻ ${lines.length} progress updates${repeat} · latest: ${latest}`;
661
- }
662
- function compactRecentOutputLines(recentOutput) {
663
- const lines = [];
664
- const noisyLines = [];
665
- const otherLines = [];
666
- for (const rawLine of recentOutput ?? []) {
667
- const line = oneLine(rawLine);
668
- if (!line || line === "(running...)")
669
- continue;
670
- lines.push(line);
671
- (isNoisyStatusLine(line) ? noisyLines : otherLines).push(line);
672
- }
673
- if (noisyLines.length >= 4 && !otherLines.some(hasLiveOutputSignal)) {
674
- if (otherLines.length === 0) {
675
- return [
676
- progressUpdateSummary(noisyLines),
677
- "pattern: repeated short status lines",
678
- ];
679
- }
680
- const visibleTail = otherLines.slice(-3);
681
- const hiddenSignals = otherLines.slice(0, -3).filter(hasLiveOutputSignal);
682
- return [
683
- progressUpdateSummary(noisyLines),
684
- ...(hiddenSignals.length > 0 ? [`… ${hiddenSignals.length} older signal ${hiddenSignals.length === 1 ? "line" : "lines"}: ${hiddenSignals.at(-1)}`] : []),
685
- ...visibleTail,
686
- ].slice(0, 5);
687
- }
688
- if (lines.length <= 5)
689
- return lines;
690
- const tail = lines.slice(-5);
691
- const hiddenSignals = lines.slice(0, -5).filter(hasLiveOutputSignal);
692
- if (hiddenSignals.length === 0)
693
- return tail;
694
- return [
695
- `… ${hiddenSignals.length} older signal ${hiddenSignals.length === 1 ? "line" : "lines"}: ${hiddenSignals.at(-1)}`,
696
- ...lines.slice(-4),
697
- ];
698
- }
699
- function compactWorkflowError(error) {
700
- const outputMatch = error.match(/(?:^|\n)Output:\s*([\s\S]+)/);
701
- if (!outputMatch)
702
- return oneLine(error);
703
- const prefix = oneLine(error.slice(0, outputMatch.index)).replace(/:$/, "") || "Failed";
704
- const outputLines = outputMatch[1].split(/\r?\n/).map(oneLine).filter(Boolean);
705
- const allOutputLinesAreNoisy = outputLines.length > 0 && outputLines.every(isNoisyStatusLine);
706
- const latest = outputLines.at(-1);
707
- return allOutputLinesAreNoisy && latest
708
- ? `${prefix} · latest: ${latestActivityText(latest)}`
709
- : `${prefix} · ${oneLine(outputMatch[1] ?? "")}`;
710
- }
711
- const WORKFLOW_LIVE_ROW_LIMIT = 8;
712
- function visibleWorkflowRows(rows) {
713
- if (rows.length <= WORKFLOW_LIVE_ROW_LIMIT)
714
- return { rows, hiddenRows: 0 };
715
- const selected = new Set();
716
- const add = (row) => {
717
- if (selected.size >= WORKFLOW_LIVE_ROW_LIMIT || selected.has(row.key))
718
- return;
719
- selected.add(row.key);
720
- };
721
- for (const row of [...rows].reverse()) {
722
- if (row.state === "failed" || row.state === "detached")
723
- add(row);
724
- }
725
- for (const row of [...rows].reverse())
726
- add(row);
727
- return {
728
- rows: rows.filter((row) => selected.has(row.key)),
729
- hiddenRows: rows.length - selected.size,
730
- };
731
- }
732
- function snapshotNowForProgress(progress) {
733
- if (progress.currentToolStartedAt !== undefined && progress.durationMs !== undefined)
734
- return progress.currentToolStartedAt + progress.durationMs;
735
- return progress.lastActivityAt;
736
- }
737
- function renderToolArgsPreview(value, maxLength, expanded) {
738
- const normalized = sanitizeDisplayText(value);
739
- if (expanded || normalized.length <= maxLength)
740
- return normalized;
741
- return `${truncateDisplayText(normalized, maxLength)}...`;
742
- }
743
- function formatCurrentToolLine(progress, availableWidth, expanded, snapshotNow) {
744
- if (!progress.currentTool)
745
- return undefined;
746
- const maxToolArgsLen = Math.max(50, availableWidth - 20);
747
- const toolArgsPreview = progress.currentToolArgs
748
- ? renderToolArgsPreview(progress.currentToolArgs, maxToolArgsLen, expanded)
749
- : "";
750
- const durationSuffix = progress.currentToolStartedAt !== undefined && snapshotNow !== undefined
751
- ? ` | ${formatDuration(Math.max(0, snapshotNow - progress.currentToolStartedAt))}`
752
- : "";
753
- return toolArgsPreview
754
- ? `${progress.currentTool}: ${toolArgsPreview}${durationSuffix}`
755
- : `${progress.currentTool}${durationSuffix}`;
756
- }
757
- function buildLiveStatusLine(progress, snapshotNow) {
758
- if (progress.lastActivityAt !== undefined && snapshotNow !== undefined)
759
- return formatActivityLabel(progress.lastActivityAt, progress.activityState, snapshotNow);
760
- if (progress.activityState === "needs_attention")
761
- return "needs attention";
762
- if (progress.activityState === "active_long_running")
763
- return "active but long-running";
764
- if (progress.lastActivityAt !== undefined)
765
- return "active";
766
- return undefined;
767
- }
768
- function themeBold(theme, text) {
769
- return (theme.bold?.(text)) ?? text;
770
- }
771
- function statJoin(theme, parts) {
772
- return parts.filter(Boolean).map((part) => theme.fg("dim", part)).join(` ${theme.fg("dim", "·")} `);
773
- }
774
- function formatTokenStat(tokens) {
775
- return `${formatTokens(tokens)} token`;
776
- }
777
- function formatToolUseStat(count) {
778
- return `${count} tool use${count === 1 ? "" : "s"}`;
779
- }
780
- function formatTotalCostStat(totalCost) {
781
- if (!totalCost || (totalCost.inputTokens === 0 && totalCost.outputTokens === 0 && totalCost.costUsd === 0))
782
- return "";
783
- const parts = [];
784
- if (totalCost.inputTokens)
785
- parts.push(`in:${formatTokens(totalCost.inputTokens)}`);
786
- if (totalCost.outputTokens)
787
- parts.push(`out:${formatTokens(totalCost.outputTokens)}`);
788
- if (totalCost.costUsd)
789
- parts.push(`$${totalCost.costUsd.toFixed(4)}`);
790
- return parts.join(" ");
791
- }
792
- function formatProgressStats(theme, progress, includeDuration = true) {
793
- if (!progress)
794
- return "";
795
- const parts = [];
796
- if (progress.toolCount > 0)
797
- parts.push(formatToolUseStat(progress.toolCount));
798
- if (progress.tokens > 0)
799
- parts.push(formatTokenStat(progress.tokens));
800
- if (includeDuration && progress.durationMs > 0)
801
- parts.push(formatDuration(progress.durationMs));
802
- return statJoin(theme, parts);
803
- }
804
- function firstOutputLine(text) {
805
- return text.split("\n").find((line) => line.trim())?.trim() ?? "";
806
- }
807
- function resultStatusLine(result, output) {
808
- if (result.detached)
809
- return result.detachedReason ? `Detached: ${result.detachedReason}` : "Detached";
810
- if (result.stopped)
811
- return "Stopped";
812
- if (result.interrupted)
813
- return "Paused";
814
- if (result.exitCode !== 0)
815
- return `Error: ${result.error ?? (firstOutputLine(output) || `exit ${result.exitCode}`)}`;
816
- if (result.acceptance?.status && result.acceptance.status !== "not-required")
817
- return `Done · acceptance: ${result.acceptance.status}`;
818
- if (hasEmptyTextOutputWithoutOutputTarget(result.task, output))
819
- return "Done (no text output)";
820
- return "Done";
821
- }
822
- function semanticResultPresentation(input) {
823
- if (input.running) {
824
- const glyph = input.frame !== undefined ? runningGlyph((input.seed ?? 0) + input.frame) : runningGlyph(input.seed);
825
- return { glyph, label: "running", tone: "accent", ...(input.thinking ? { thinking: input.thinking } : {}) };
826
- }
827
- if (input.detached)
828
- return { glyph: "■", label: "detached", tone: "warning" };
829
- if (input.stopped)
830
- return { glyph: "■", label: "stopped", tone: "warning" };
831
- if (input.interrupted)
832
- return { glyph: "■", label: "paused", tone: "warning" };
833
- if (input.failed)
834
- return { glyph: "✗", label: "failed", tone: "error" };
835
- if (input.partial)
836
- return { glyph: "■", label: "partial", tone: "warning" };
837
- return { glyph: "✓", label: "completed", tone: input.completedWithoutOutput ? "warning" : "success" };
838
- }
839
- function hasTerminalResultFlag(result) {
840
- return Boolean(result.detached || result.stopped || result.interrupted);
841
- }
842
- function hasTerminalResult(result) {
843
- if (hasTerminalResultFlag(result))
844
- return true;
845
- const status = result.progress?.status;
846
- if (status === "running" || status === "pending")
847
- return false;
848
- return result.exitCode !== undefined;
849
- }
850
- function isResultRunning(result, status = result.progress?.status) {
851
- return status === "running" && !hasTerminalResultFlag(result);
852
- }
853
- function detailsHaveRunningResult(details) {
854
- return details.progress?.some((progress) => {
855
- if (progress.status !== "running")
856
- return false;
857
- const result = details.results.find((entry) => entry.progress?.index === progress.index) ?? details.results[progress.index];
858
- return !result || !hasTerminalResultFlag(result);
859
- })
860
- || details.results.some((result) => isResultRunning(result))
861
- || workflowGraphHasStatus(details, ["running"]);
862
- }
863
- function resultPresentation(result, output, running = isResultRunning(result), seed = progressRunningSeed(result.progress ?? result.progressSummary), frame) {
864
- return semanticResultPresentation({
865
- running,
866
- detached: result.detached,
867
- stopped: result.stopped,
868
- interrupted: result.interrupted,
869
- failed: result.exitCode !== 0,
870
- completedWithoutOutput: hasEmptyTextOutputWithoutOutputTarget(result.task, output),
871
- seed,
872
- frame,
873
- thinking: childThinkingLevel(result, result.progress),
874
- });
875
- }
876
- function presentationTone(presentation, theme) {
877
- return presentation.label === "running" ? runningTone(theme, presentation.thinking) : (text) => theme.fg(presentation.tone, text);
878
- }
879
- function resultGlyph(result, output, theme, running = isResultRunning(result), seed = progressRunningSeed(result.progress ?? result.progressSummary), frame) {
880
- const presentation = resultPresentation(result, output, running, seed, frame);
881
- return presentationTone(presentation, theme)(presentation.glyph);
882
- }
883
- function styledResultPresentation(presentation, theme) {
884
- const tone = presentationTone(presentation, theme);
885
- return {
886
- glyph: tone(presentation.glyph),
887
- label: tone(presentation.label),
888
- };
889
- }
890
- function compactCurrentActivity(progress) {
891
- const snapshotNow = snapshotNowForProgress(progress);
892
- return formatCurrentToolLine(progress, getTermWidth() - 4, false, snapshotNow) ?? buildLiveStatusLine(progress, snapshotNow) ?? "thinking…";
893
- }
894
- function textDigest(text) {
895
- return createHash("sha256").update(text).digest("hex").slice(0, 16);
896
- }
897
- function displayTextRenderKey(text) {
898
- const normalized = sanitizeDisplayText(text);
899
- return [normalized.length, textDigest(normalized)];
900
- }
901
- function expandedStepActivityRenderKey(step) {
902
- return [
903
- step.recentTools?.slice(-3).map((tool) => [tool.tool, displayTextRenderKey(tool.args), tool.endMs]),
904
- compactRecentOutputLines(step.recentOutput).map(displayTextRenderKey),
905
- ];
906
- }
907
- function widgetStepRenderKey(step, index, expanded = false) {
908
- return [
909
- step.index ?? index,
910
- step.agent,
911
- step.sessionName,
912
- step.workflowKey,
913
- step.phase,
914
- step.label,
915
- step.status,
916
- step.activityState,
917
- step.lastActivityAt,
918
- step.currentTool,
919
- step.currentToolArgs,
920
- step.currentToolStartedAt,
921
- step.currentPath,
922
- step.turnCount,
923
- step.toolCount,
924
- step.startedAt,
925
- step.endedAt,
926
- step.durationMs,
927
- step.tokens?.total,
928
- step.model,
929
- step.thinking,
930
- step.context,
931
- step.description,
932
- step.outputName,
933
- step.structured,
934
- step.acceptance?.status,
935
- step.acceptance?.reviewResult?.status,
936
- step.review?.status,
937
- step.toolBudgetBlocked,
938
- step.turnBudgetExceeded,
939
- step.timedOut,
940
- step.stopped,
941
- step.execution?.status,
942
- step.execution?.error,
943
- step.execution?.timedOut,
944
- step.execution?.interrupted,
945
- step.execution?.stopped,
946
- step.execution?.detached,
947
- step.watchdog?.phase,
948
- unresolvedChildWatchdogBlockers(step.watchdog).length,
949
- step.error,
950
- expanded ? expandedStepActivityRenderKey(step) : undefined,
951
- nestedRenderKey(step.children, expanded),
952
- ];
953
- }
954
- function nestedRenderKey(children, expanded = false) {
955
- return (children ?? []).map((child) => [
956
- child.id,
957
- child.state,
958
- child.agent,
959
- child.sessionName,
960
- child.model,
961
- child.thinking,
962
- child.activityState,
963
- child.lastActivityAt,
964
- child.currentTool,
965
- child.currentToolStartedAt,
966
- child.currentPath,
967
- child.turnCount,
968
- child.toolCount,
969
- child.startedAt,
970
- child.endedAt,
971
- child.lastUpdate,
972
- child.error,
973
- child.totalTokens?.total,
974
- child.steps?.map((step, index) => widgetStepRenderKey({ ...step, agent: step.agent, status: step.status }, index, expanded)),
975
- nestedRenderKey(child.children, expanded),
976
- ]);
977
- }
978
- function hostStepRenderKey(row) {
979
- return [
980
- row.kind,
981
- row.name,
982
- row.state,
983
- row.provider,
984
- row.role,
985
- row.verdict,
986
- row.reasonCode,
987
- row.detail,
988
- row.target,
989
- row.freshness,
990
- row.reportPath,
991
- ];
992
- }
993
- export function widgetRenderKey(job, expanded = false) {
994
- const projection = buildWorkflowWidgetProjection(job, job.updatedAt ?? 0);
995
- return JSON.stringify({
996
- asyncDir: job.asyncDir,
997
- parentWorkflowRunId: job.parentWorkflowRunId,
998
- workflowKey: job.workflowKey,
999
- status: job.status,
1000
- description: job.mode === "workflow" ? job.description : undefined,
1001
- activityState: job.activityState,
1002
- lastActivityAt: job.lastActivityAt,
1003
- currentTool: job.currentTool,
1004
- currentToolStartedAt: job.currentToolStartedAt,
1005
- currentPath: job.currentPath,
1006
- turnCount: job.turnCount,
1007
- toolCount: job.toolCount,
1008
- mode: job.mode,
1009
- agents: job.agents,
1010
- currentStep: job.currentStep,
1011
- chainStepCount: job.chainStepCount,
1012
- parallelGroups: job.parallelGroups,
1013
- workflowHostSteps: projectAsyncWorkflowRows([], job.hostSteps).map(hostStepRenderKey),
1014
- workflowGraph: job.mode === "workflow" && job.workflowGraph ? {
1015
- currentNodeId: job.workflowGraph.currentNodeId,
1016
- stages: projection.stages.map((node) => [node.id, node.status, node.agent, node.phase, node.label, node.flatIndex, node.outputName, node.structured, node.error]),
1017
- } : undefined,
1018
- preflight: expanded ? job.preflight : job.preflight?.lanes.map((lane) => [lane.key, lane.mode, lane.decision, lane.claims, lane.expectedOutput]),
1019
- preflightWarnings: expanded ? job.workflow?.preflightWarnings : undefined,
1020
- checklist: projection.checklist ? {
1021
- total: projection.checklist.total,
1022
- done: projection.checklist.done,
1023
- running: projection.checklist.running,
1024
- queued: projection.checklist.queued,
1025
- blocked: projection.checklist.blocked,
1026
- failed: projection.checklist.failed,
1027
- phases: projection.checklist.phases.map((phase) => [phase.key, phase.state, phase.done, phase.total, phase.running, phase.queued, phase.blocked, phase.failed, phase.paused, phase.stopped, phase.items.map((item) => [item.key, item.label, item.agent, item.state, item.preflight?.key, item.preflight?.mode, item.preflight?.decision, item.preflight?.claims, item.preflight?.expectedOutput, item.currentTool, item.currentPath, item.durationMs, item.toolCount, item.error])]),
1028
- } : undefined,
1029
- steps: job.steps?.map((step, index) => widgetStepRenderKey(step, index, expanded)),
1030
- nestedChildren: nestedRenderKey(job.nestedChildren, expanded),
1031
- lane: laneRenderKey(job, projection),
1032
- stepsTotal: job.stepsTotal,
1033
- runningSteps: job.runningSteps,
1034
- completedSteps: job.completedSteps,
1035
- activeParallelGroup: job.activeParallelGroup,
1036
- startedAt: job.startedAt,
1037
- updatedAt: job.updatedAt,
1038
- timedOut: job.timedOut,
1039
- stopped: job.stopped,
1040
- totalTokens: job.totalTokens,
1041
- });
1042
- }
1043
- function formatWidgetAgents(agents) {
1044
- const distinct = [...new Set(agents)];
1045
- if (distinct.length === 1 && agents.length > 1)
1046
- return `${distinct[0]} ×${agents.length}`;
1047
- if (agents.length > 3)
1048
- return `${agents.slice(0, 2).join(", ")} +${agents.length - 2} more`;
1049
- return agents.join(", ");
1050
- }
1051
- function widgetJobName(job) {
1052
- if (job.mode === "parallel")
1053
- return "parallel";
1054
- if (job.mode === "chain")
1055
- return "chain";
1056
- if (job.mode === "single" && job.agents?.length === 1)
1057
- return job.agents[0];
1058
- if (job.agents?.length)
1059
- return formatWidgetAgents(job.agents);
1060
- return job.mode ?? "subagent";
1061
- }
1062
- function isSingleChildAsyncJob(job) {
1063
- return job.mode === "single"
1064
- && job.steps?.length === 1
1065
- && shouldSuppressSingleStep(job.chainStepCount, job.stepsTotal);
1066
- }
1067
- function isCompletedWidgetStepStatus(status) {
1068
- return status === "complete" || status === "completed";
1069
- }
1070
- function singleChildAgentName(job, step) {
1071
- return job.agents?.length === 1 ? job.agents[0] : step.agent || widgetJobName(job);
1072
- }
1073
- function hasSingleChildDetailEvidence(job, step) {
1074
- return Boolean(step.error?.trim()
1075
- || step.execution?.error?.trim()
1076
- || step.phase?.trim()
1077
- || step.label?.trim()
1078
- || step.workflowKey?.trim()
1079
- || step.outputName?.trim()
1080
- || step.lane
1081
- || job.workflowKey?.trim()
1082
- || job.lane
1083
- || laneTraceForJob(job)?.phase?.trim()
1084
- || laneTraceForJob(job)?.label?.trim()
1085
- || step.timedOut
1086
- || step.stopped
1087
- || step.execution?.timedOut
1088
- || step.execution?.interrupted
1089
- || step.execution?.stopped
1090
- || step.execution?.detached
1091
- || job.timedOut
1092
- || job.stopped
1093
- || ["failed", "partial", "paused", "stopped", "detached"].includes(step.execution?.status ?? "")
1094
- || step.acceptance?.status === "rejected"
1095
- || step.acceptance?.reviewResult?.status === "blockers"
1096
- || step.review?.status === "blockers");
1097
- }
1098
- function shouldCollapseSingleChildDetails(job, step) {
1099
- if (!isSingleChildAsyncJob(job) || hasSingleChildDetailEvidence(job, step))
1100
- return false;
1101
- if (job.status === "running")
1102
- return step.status === "running";
1103
- if (job.status === "complete")
1104
- return isCompletedWidgetStepStatus(step.status);
1105
- return false;
1106
- }
1107
- function singleChildTask(job, step) {
1108
- const task = compactTaskText(step.description, step.label);
1109
- if (task)
1110
- return task;
1111
- const sessionName = step.sessionName?.trim();
1112
- if (!sessionName)
1113
- return undefined;
1114
- const agentName = singleChildAgentName(job, step);
1115
- const sessionTask = stripRepeatedAgentPrefix(sessionName, agentName);
1116
- return sessionTask === agentName ? undefined : compactTaskText(sessionTask);
1117
- }
1118
- function widgetActivity(job) {
1119
- const facts = [];
1120
- if (job.currentTool && job.currentToolStartedAt !== undefined && job.updatedAt !== undefined)
1121
- facts.push(`${job.currentTool} ${formatDuration(Math.max(0, job.updatedAt - job.currentToolStartedAt))}`);
1122
- else if (job.currentTool)
1123
- facts.push(job.currentTool);
1124
- if (job.currentPath)
1125
- facts.push(shortenPath(job.currentPath));
1126
- if (job.turnCount !== undefined)
1127
- facts.push(`${job.turnCount} turns`);
1128
- if (job.toolCount !== undefined)
1129
- facts.push(`${job.toolCount} tools`);
1130
- const activity = buildLiveStatusLine(job, job.updatedAt);
1131
- if (activity && facts.length)
1132
- return `${activity} · ${facts.join(" · ")}`;
1133
- if (activity)
1134
- return activity;
1135
- if (facts.length)
1136
- return facts.join(" · ");
1137
- if (job.status === "running")
1138
- return "thinking…";
1139
- if (job.status === "queued")
1140
- return "queued…";
1141
- if (job.status === "paused")
1142
- return "Paused";
1143
- if (job.status === "stopped")
1144
- return "Stopped";
1145
- if (job.status === "partial")
1146
- return "Partial";
1147
- if (job.status === "failed")
1148
- return "Failed";
1149
- return "Done";
1150
- }
1151
- function widgetStepRunningSeed(step, fallbackIndex) {
1152
- return runningSeed(fallbackIndex, step.index, step.toolCount, step.turnCount, step.tokens?.total, step.lastActivityAt, step.currentToolStartedAt, step.durationMs);
1153
- }
1154
- function widgetStepsRunningSeed(steps) {
1155
- let seed;
1156
- for (const [index, step] of (steps ?? []).entries())
1157
- seed = runningSeed(seed, widgetStepRunningSeed(step, index));
1158
- return seed;
1159
- }
1160
- function widgetJobRunningSeed(job) {
1161
- return runningSeed(job.updatedAt, job.lastActivityAt, job.toolCount, job.turnCount, job.totalTokens?.total, job.currentStep, job.runningSteps, job.completedSteps, widgetStepsRunningSeed(job.steps));
1162
- }
1163
- function widgetJobsRunningSeed(jobs) {
1164
- let seed;
1165
- for (const job of jobs)
1166
- seed = runningSeed(seed, widgetJobRunningSeed(job));
1167
- return seed;
1168
- }
1169
- function activeHeaderTone(theme, hasActive) {
1170
- return hasActive ? runningTone(theme) : (text) => theme.fg("dim", text);
1171
- }
1172
- function widgetStatusGlyph(job, theme, frame) {
1173
- if (job.status === "running")
1174
- return runningTone(theme, job.mode === "single" ? childThinkingLevel(job.steps?.[0]) : undefined)(runningGlyph(animatedSeed(widgetJobRunningSeed(job), frame)));
1175
- if (job.status === "queued")
1176
- return theme.fg("muted", "◦");
1177
- if (job.status === "complete")
1178
- return theme.fg("success", "✓");
1179
- if (job.status === "paused")
1180
- return theme.fg("warning", "■");
1181
- if (job.status === "stopped")
1182
- return theme.fg("warning", "■");
1183
- return theme.fg("error", "✗");
1184
- }
1185
- function widgetStepGlyph(status, theme, seed, frame, thinking) {
1186
- if (status === "running")
1187
- return runningTone(theme, thinking)(runningGlyph(animatedSeed(seed, frame)));
1188
- if (status === "complete" || status === "completed")
1189
- return theme.fg("success", "✓");
1190
- if (status === "failed")
1191
- return theme.fg("error", "✗");
1192
- if (status === "paused")
1193
- return theme.fg("warning", "■");
1194
- if (status === "stopped")
1195
- return theme.fg("warning", "■");
1196
- return theme.fg("muted", "◦");
1197
- }
1198
- function widgetStepStatus(status, theme, thinking) {
1199
- if (status === "running")
1200
- return runningTone(theme, thinking)("running");
1201
- if (status === "complete" || status === "completed")
1202
- return theme.fg("success", "complete");
1203
- if (status === "failed")
1204
- return theme.fg("error", "failed");
1205
- if (status === "paused")
1206
- return theme.fg("warning", "paused");
1207
- if (status === "stopped")
1208
- return theme.fg("warning", "stopped");
1209
- return theme.fg("dim", status);
1210
- }
1211
- function workflowChecklistStateLabel(state) {
1212
- if (state === "running")
1213
- return "running";
1214
- if (state === "complete")
1215
- return "complete";
1216
- return state;
1217
- }
1218
- function workflowChecklistGlyph(item, theme, frame) {
1219
- if (item.state === "running")
1220
- return runningTone(theme, item.thinking)(runningGlyph(animatedSeed(runningSeed(item.startedAt, item.durationMs, item.toolCount, item.currentToolStartedAt), frame)));
1221
- if (item.state === "complete")
1222
- return theme.fg("success", "✓");
1223
- if (item.state === "blocked")
1224
- return theme.fg("error", "!");
1225
- if (item.state === "failed")
1226
- return theme.fg("error", "✗");
1227
- if (item.state === "paused" || item.state === "stopped")
1228
- return theme.fg("warning", "■");
1229
- return theme.fg("muted", "◦");
1230
- }
1231
- function workflowChecklistItemPriority(state) {
1232
- if (state === "blocked")
1233
- return 0;
1234
- if (state === "failed")
1235
- return 1;
1236
- if (state === "running")
1237
- return 2;
1238
- if (state === "paused")
1239
- return 3;
1240
- if (state === "stopped")
1241
- return 4;
1242
- if (state === "queued")
1243
- return 5;
1244
- return 6;
1245
- }
1246
- function workflowChecklistItemLine(item, theme, indent, frame, includeError) {
1247
- const identity = [item.label, item.agent && item.agent !== item.label ? item.agent : undefined].filter(Boolean).join(" · ");
1248
- const context = contextModeBadge(theme, item.context);
1249
- const state = item.state === "complete" ? "" : ` ${theme.fg("dim", `· ${workflowChecklistStateLabel(item.state)}`)}`;
1250
- const details = [
1251
- item.currentTool ? `${item.currentTool}${item.durationMs !== undefined ? ` ${formatDuration(item.durationMs)}` : ""}` : undefined,
1252
- !item.currentTool && item.currentPath ? shortenPath(item.currentPath) : undefined,
1253
- !item.currentTool && item.durationMs !== undefined ? formatDuration(item.durationMs) : undefined,
1254
- item.toolCount !== undefined ? `${item.toolCount} tools` : undefined,
1255
- item.outputName ? `out:${item.outputName}` : undefined,
1256
- includeError && item.error ? `error:${oneLine(item.error)}` : undefined,
1257
- ].filter(Boolean).join(" · ");
1258
- return `${indent}${workflowChecklistGlyph(item, theme, frame)} ${theme.bold(identity || item.key)}${context}${state}${details ? ` ${theme.fg("dim", `· ${details}`)}` : ""}`;
1259
- }
1260
- const COLLAPSED_WORKFLOW_PHASE_LIMIT = 4;
1261
- function workflowChecklistWidgetLines(checklist, theme, indent, expanded, frame, options = {}) {
1262
- if (!checklist?.total)
1263
- return [];
1264
- const includeSummary = options.includeSummary ?? true;
1265
- const limitPhases = options.limitPhases ?? !expanded;
1266
- const includeBottleneckOutput = options.includeBottleneckOutput ?? expanded;
1267
- const includeItemErrors = options.includeItemErrors ?? true;
1268
- const lines = includeSummary ? [`${indent}${theme.fg("dim", `Checklist ${formatWorkflowChecklistSummary(checklist)}`)}`] : [];
1269
- const phases = !limitPhases || checklist.phases.length <= COLLAPSED_WORKFLOW_PHASE_LIMIT
1270
- ? checklist.phases
1271
- : checklist.phases
1272
- .map((phase, index) => ({ phase, index }))
1273
- .sort((left, right) => Number(left.phase.state !== "running") - Number(right.phase.state !== "running")
1274
- || Number(left.phase.state === "complete") - Number(right.phase.state === "complete")
1275
- || left.index - right.index)
1276
- .slice(0, COLLAPSED_WORKFLOW_PHASE_LIMIT)
1277
- .sort((left, right) => left.index - right.index)
1278
- .map(({ phase }) => phase);
1279
- for (const phase of phases) {
1280
- const phaseItem = phase.items.find((item) => item.state === "running") ?? phase.items[0];
1281
- const glyph = workflowChecklistGlyph({
1282
- state: phase.state,
1283
- startedAt: phaseItem?.startedAt,
1284
- durationMs: phaseItem?.durationMs,
1285
- toolCount: phaseItem?.toolCount,
1286
- currentToolStartedAt: phaseItem?.currentToolStartedAt,
1287
- }, theme, frame);
1288
- lines.push(`${indent}${glyph} ${theme.bold(formatWorkflowChecklistPhase(phase))}`);
1289
- if (expanded) {
1290
- for (const item of [...phase.items].sort((left, right) => workflowChecklistItemPriority(left.state) - workflowChecklistItemPriority(right.state))) {
1291
- lines.push(workflowChecklistItemLine(item, theme, `${indent} `, frame, includeItemErrors || item.kind === "host"));
1292
- }
1293
- }
1294
- }
1295
- const bottleneck = formatWorkflowChecklistBottleneck(checklist.bottleneck, { includeOutput: includeBottleneckOutput, includeError: !expanded });
1296
- if (bottleneck) {
1297
- const tone = checklist.bottleneck?.state === "blocked" || checklist.bottleneck?.state === "failed" ? "error" : checklist.bottleneck?.state === "running" ? "accent" : "warning";
1298
- lines.push(`${indent}${theme.fg(tone, `bottleneck · ${bottleneck}`)}`);
1299
- }
1300
- return lines;
1301
- }
1302
- function compactWorkflowLaneState(items) {
1303
- let state;
1304
- for (const item of items) {
1305
- if (state === undefined || workflowChecklistItemPriority(item.state) < workflowChecklistItemPriority(state))
1306
- state = item.state;
1307
- }
1308
- return state ?? "queued";
1309
- }
1310
- function compactWorkflowLaneOwner(items) {
1311
- const owners = [...new Set(items.map((item) => item.agent ?? item.role).filter((value) => Boolean(value?.trim())))];
1312
- if (owners.length === 0)
1313
- return undefined;
1314
- return boundedLaneValue(owners.length > 2 ? `${owners.slice(0, 2).join(", ")} +${owners.length - 2}` : owners.join(", "), 32);
1315
- }
1316
- function compactWorkflowLaneLabel(items, key) {
1317
- const labels = [...new Set(items.map((item) => item.label).filter((value) => Boolean(value?.trim() && value.trim() !== key)))];
1318
- if (labels.length === 0)
1319
- return undefined;
1320
- return boundedLaneValue(labels.length > 1 ? `${labels[0]} +${labels.length - 1}` : labels[0], 48);
1321
- }
1322
- function compactWorkflowLaneRow(key, items, lane = items.find((item) => item.preflight)?.preflight, fallbackState = "queued") {
1323
- const state = items.length ? compactWorkflowLaneState(items) : fallbackState;
1324
- const toolCounts = items.map((item) => item.toolCount).filter((value) => value !== undefined);
1325
- const durations = items.map((item) => item.durationMs).filter((value) => value !== undefined);
1326
- const label = compactWorkflowLaneLabel(items, key);
1327
- return {
1328
- key: boundedLaneValue(key, 40) ?? key,
1329
- state,
1330
- agent: compactWorkflowLaneOwner(items),
1331
- ...(items.length === 1 && items[0]?.thinking ? { thinking: items[0].thinking } : {}),
1332
- ...(lane?.mode ? { mode: lane.mode } : {}),
1333
- ...(lane?.decision ? { decision: boundedLaneValue(lane.decision, 56) } : {}),
1334
- ...(lane?.claims?.length ? { claims: boundedLaneValue(lane.claims.join(", "), 56) } : {}),
1335
- ...(lane?.expectedOutput ? { expectedOutput: boundedLaneValue(lane.expectedOutput, 56) } : {}),
1336
- ...(label ? { label } : {}),
1337
- ...(toolCounts.length ? { toolUses: toolCounts.reduce((sum, value) => sum + value, 0) } : {}),
1338
- ...(durations.length ? { durationMs: Math.max(...durations) } : {}),
1339
- };
1340
- }
1341
- function compactWorkflowFallbackState(job) {
1342
- if (job.activityState === "needs_attention" || job.timedOut || job.toolBudgetBlocked || job.turnBudgetExceeded)
1343
- return "blocked";
1344
- switch (job.status) {
1345
- case "complete": return "complete";
1346
- case "failed": return "failed";
1347
- case "paused": return "paused";
1348
- case "stopped": return "stopped";
1349
- case "partial":
1350
- case "rejected": return "blocked";
1351
- default: return "queued";
1352
- }
1353
- }
1354
- /** Flatten the loaded checklist into one compact row per declared lane. */
1355
- function compactWorkflowLaneRows(job, checklist) {
1356
- const groups = new Map();
1357
- for (const item of checklist?.phases.flatMap((phase) => phase.items) ?? []) {
1358
- const key = item.preflight?.key ?? item.key;
1359
- const group = groups.get(key);
1360
- if (group)
1361
- group.push(item);
1362
- else
1363
- groups.set(key, [item]);
1364
- }
1365
- const rows = [];
1366
- const preflightKeys = new Set(job.preflight?.lanes.map((lane) => lane.key) ?? []);
1367
- if (job.preflight?.lanes.length) {
1368
- for (const lane of job.preflight.lanes) {
1369
- rows.push(compactWorkflowLaneRow(lane.key, groups.get(lane.key) ?? [], lane, compactWorkflowFallbackState(job)));
1370
- }
1371
- }
1372
- for (const [key, items] of groups) {
1373
- if (preflightKeys.has(key))
1374
- continue;
1375
- rows.push(compactWorkflowLaneRow(key, items));
1376
- }
1377
- return rows;
1378
- }
1379
- function compactWorkflowLaneCounts(rows) {
1380
- const counts = { total: rows.length, done: 0, active: 0, queued: 0, blocked: 0, failed: 0, paused: 0, stopped: 0 };
1381
- for (const row of rows) {
1382
- switch (row.state) {
1383
- case "complete":
1384
- counts.done++;
1385
- break;
1386
- case "running":
1387
- counts.active++;
1388
- break;
1389
- case "queued":
1390
- counts.queued++;
1391
- break;
1392
- case "blocked":
1393
- counts.blocked++;
1394
- break;
1395
- case "failed":
1396
- counts.failed++;
1397
- break;
1398
- case "paused":
1399
- counts.paused++;
1400
- break;
1401
- case "stopped":
1402
- counts.stopped++;
1403
- break;
1404
- }
1405
- }
1406
- return counts;
1407
- }
1408
- function compactWorkflowLaneLine(row, theme, indent, frame) {
1409
- const owner = row.agent && row.mode ? `${row.agent}/${row.mode}` : row.agent ?? row.mode;
1410
- const state = row.state === "complete" ? undefined : row.state === "running" ? "active" : row.state;
1411
- const intent = [
1412
- row.decision,
1413
- row.claims,
1414
- row.expectedOutput,
1415
- !row.mode && row.label ? row.label : undefined,
1416
- ].filter((value) => Boolean(value));
1417
- return `${indent}${workflowChecklistGlyph({ state: row.state, durationMs: row.durationMs, toolCount: row.toolUses, thinking: row.thinking }, theme, frame)} ${theme.bold(row.key)}${owner ? ` ${theme.fg("dim", `· ${owner}`)}` : ""}${state ? ` ${theme.fg("dim", `· ${state}`)}` : ""}${intent.length ? ` ${theme.fg("dim", `· ${intent.join(" · ")}`)}` : ""}`;
1418
- }
1419
- function compactWorkflowShortId(job) {
1420
- return job.asyncId.slice(0, 8);
1421
- }
1422
- function compactWorkflowDisplayLabel(job) {
1423
- return boundedLaneValue(job.description, 64) ?? compactWorkflowShortId(job);
1424
- }
1425
- function compactWorkflowStats(job, rows, theme, projection) {
1426
- const counts = compactWorkflowLaneCounts(rows);
1427
- const total = counts.total || projection.stageProgress?.total || job.stepsTotal || job.agents?.length || 0;
1428
- const progress = [
1429
- total > 0 ? `${counts.done}/${total} done` : undefined,
1430
- counts.active ? `${counts.active} active` : undefined,
1431
- counts.queued ? `${counts.queued} queued` : undefined,
1432
- counts.blocked ? `${counts.blocked} blocked` : undefined,
1433
- counts.failed ? `${counts.failed} failed` : undefined,
1434
- counts.paused ? `${counts.paused} paused` : undefined,
1435
- counts.stopped ? `${counts.stopped} stopped` : undefined,
1436
- ].filter((value) => Boolean(value));
1437
- const rowToolUses = rows.map((row) => row.toolUses).filter((value) => value !== undefined);
1438
- const toolUses = job.toolCount ?? (rowToolUses.length ? rowToolUses.reduce((sum, value) => sum + value, 0) : undefined);
1439
- const rowDuration = rows.map((row) => row.durationMs).filter((value) => value !== undefined);
1440
- const end = job.status === "running" ? projection.now : job.updatedAt;
1441
- const durationMs = job.status !== "queued" && job.startedAt !== undefined && end !== undefined
1442
- ? Math.max(0, end - job.startedAt)
1443
- : job.status !== "queued" && rowDuration.length ? Math.max(...rowDuration) : undefined;
1444
- return statJoin(theme, [
1445
- `id: ${compactWorkflowShortId(job)}`,
1446
- ...progress,
1447
- toolUses !== undefined ? formatToolUseStat(toolUses) : undefined,
1448
- durationMs !== undefined ? formatDuration(durationMs) : undefined,
1449
- ].filter((value) => Boolean(value)));
1450
- }
1451
- function compactWorkflowBottleneck(rows, job) {
1452
- let row;
1453
- for (const candidate of rows) {
1454
- if (candidate.state !== "blocked" && candidate.state !== "failed" && candidate.state !== "paused" && candidate.state !== "stopped")
1455
- continue;
1456
- if (!row || workflowChecklistItemPriority(candidate.state) < workflowChecklistItemPriority(row.state))
1457
- row = candidate;
1458
- }
1459
- if (row)
1460
- return { text: `${row.key} · ${row.state}`, tone: row.state === "blocked" || row.state === "failed" ? "error" : "warning" };
1461
- if (job.activityState === "needs_attention" || job.timedOut || job.toolBudgetBlocked || job.turnBudgetExceeded)
1462
- return { text: `workflow · ${job.activityState === "needs_attention" ? "needs attention" : "blocked"}`, tone: job.activityState === "needs_attention" ? "warning" : "error" };
1463
- if (job.status === "failed" || job.status === "partial" || job.status === "rejected")
1464
- return { text: `workflow · ${job.status}`, tone: "error" };
1465
- if (job.status === "paused" || job.status === "stopped")
1466
- return { text: `workflow · ${job.status}`, tone: "warning" };
1467
- return undefined;
1468
- }
1469
- function compactWorkflowHeaderLine(job, theme, width) {
1470
- const label = compactWorkflowDisplayLabel(job);
1471
- const full = `${theme.fg("toolTitle", themeBold(theme, `async workflow: ${label}`))} ${theme.fg("dim", "─ background")}`;
1472
- if (width === undefined || visibleWidth(full) <= width)
1473
- return full;
1474
- return `${theme.fg("toolTitle", themeBold(theme, `async workflow ${label}`))} ${theme.fg("dim", "· background")}`;
1475
- }
1476
- function compactWorkflowWidgetBodyLines(job, theme, frame, projection) {
1477
- const rows = compactWorkflowLaneRows(job, projection.checklist);
1478
- const lines = [` ${compactWorkflowStats(job, rows, theme, projection)}`];
1479
- if (projection.inlineFleetCovered)
1480
- return [...lines, ` ${theme.fg("dim", "Workflow children shown in Fleet roster")}`];
1481
- if (rows.length) {
1482
- for (const row of rows) {
1483
- if (!projection.materializedKeys?.has(row.key))
1484
- lines.push(compactWorkflowLaneLine(row, theme, " ", frame));
1485
- }
1486
- }
1487
- else {
1488
- lines.push(` ${theme.fg("dim", "◦ waiting for workflow lanes")}`);
1489
- }
1490
- const bottleneck = compactWorkflowBottleneck(rows, job);
1491
- if (bottleneck)
1492
- lines.push(` ${theme.fg(bottleneck.tone, `bottleneck · ${bottleneck.text}`)}`);
1493
- if (job.status === "running" || rows.some((row) => row.state === "running"))
1494
- lines.push(` ${theme.fg("accent", workflowDetailHintText())}`);
1495
- return lines;
1496
- }
1497
- function widgetStepActivity(step, snapshotNow) {
1498
- const facts = [];
1499
- if (step.currentTool && step.currentToolStartedAt !== undefined && snapshotNow !== undefined)
1500
- facts.push(`${step.currentTool} ${formatDuration(Math.max(0, snapshotNow - step.currentToolStartedAt))}`);
1501
- else if (step.currentTool)
1502
- facts.push(step.currentTool);
1503
- if (step.currentPath)
1504
- facts.push(shortenPath(step.currentPath));
1505
- if (step.turnCount !== undefined)
1506
- facts.push(`${step.turnCount} turns`);
1507
- if (step.toolCount !== undefined)
1508
- facts.push(`${step.toolCount} tools`);
1509
- if (step.tokens?.total)
1510
- facts.push(formatTokenUsage(step.tokens, "token"));
1511
- const activity = buildLiveStatusLine(step, snapshotNow);
1512
- if (activity && facts.length)
1513
- return `${activity} · ${facts.join(" · ")}`;
1514
- if (activity)
1515
- return activity;
1516
- return facts.join(" · ");
1517
- }
1518
- function widgetChainDetails(job, theme, expanded = false, width = getTermWidth(), frame) {
1519
- if (!job.steps?.length)
1520
- return [];
1521
- const total = job.chainStepCount ?? job.steps.length;
1522
- const lines = [];
1523
- for (const span of buildAsyncChainStepSpans(total, job.steps.length, job.parallelGroups)) {
1524
- const steps = job.steps.slice(span.start, span.start + span.count);
1525
- if (span.isParallel) {
1526
- lines.push(...parallelWidgetGroupDetails(job, theme, { steps, total: span.count, stepIndex: span.stepIndex, chainTotal: total }, expanded, width, frame, false));
1527
- continue;
1528
- }
1529
- const step = steps[0];
1530
- if (!step) {
1531
- lines.push(` ${theme.fg("dim", `◦ Step ${span.stepIndex + 1}/${total}: pending`)}`);
1532
- continue;
1533
- }
1534
- lines.push(...foregroundStyleWidgetStepLines(job, theme, step, "Step", span.stepIndex + 1, total, expanded, width, frame));
1535
- }
1536
- return lines;
1537
- }
1538
- function widgetParallelAgentDetails(job, theme, expanded = false, width = getTermWidth(), frame) {
1539
- if (!job.steps?.length)
1540
- return [];
1541
- if (job.mode !== "parallel" && job.mode !== "chain")
1542
- return [];
1543
- if (job.mode === "chain" && !job.activeParallelGroup && job.parallelGroups?.length)
1544
- return widgetChainDetails(job, theme, expanded, width, frame);
1545
- const group = activeParallelWidgetGroup(job);
1546
- if (group)
1547
- return parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, Boolean(job.activeParallelGroup));
1548
- const total = job.stepsTotal ?? job.steps.length;
1549
- const lines = [];
1550
- for (const [index, step] of job.steps.entries()) {
1551
- const marker = index === job.steps.length - 1 ? "└" : "├";
1552
- const activity = widgetStepActivity(step, job.updatedAt);
1553
- const itemTitle = job.mode === "parallel" || job.activeParallelGroup ? "Agent" : "Step";
1554
- const modelDisplay = modelThinkingBadge(theme, step.model, step.thinking);
1555
- const label = compactTaskText(step.description, step.label);
1556
- const display = step.sessionName?.trim() || (label ? `${label} (${step.agent})` : step.agent);
1557
- const thinking = childThinkingLevel(step);
1558
- lines.push(` ${theme.fg("dim", `${marker} ${widgetStepGlyph(step.status, theme, widgetStepRunningSeed(step, index), frame, thinking)} ${itemTitle} ${index + 1}/${total}: ${display} · ${widgetStepStatus(step.status, theme, thinking)}${modelDisplay}${activity ? ` · ${activity}` : ""}`)}`);
1559
- const lane = projectAsyncLane(job, step);
1560
- if (lane)
1561
- lines.push(...formatLaneProjectionLines(lane, theme, " "));
1562
- for (const nestedLine of formatNestedWidgetLines(step.children, theme, width, expanded, job.updatedAt, expanded ? 8 : 6))
1563
- lines.push(` ${nestedLine}`);
1564
- }
1565
- return lines;
1566
- }
1567
- function parseParallelGroupAgentCount(label) {
1568
- if (!label || !label.startsWith("[") || !label.endsWith("]"))
1569
- return undefined;
1570
- const inner = label.slice(1, -1).trim();
1571
- if (!inner)
1572
- return 0;
1573
- return inner.split("+").map((part) => part.trim()).filter(Boolean).length;
1574
- }
1575
- function buildChainStepSpans(details) {
1576
- if (details.workflowGraph?.nodes?.length) {
1577
- const spans = [];
1578
- let flatCursor = 0;
1579
- for (const node of details.workflowGraph.nodes) {
1580
- if (node.stepIndex === undefined)
1581
- continue;
1582
- if (node.kind === "parallel-group" || node.kind === "dynamic-parallel-group") {
1583
- const childFlatIndexes = (node.children ?? [])
1584
- .map((child) => child.flatIndex)
1585
- .filter((value) => typeof value === "number");
1586
- const start = childFlatIndexes.length ? Math.min(...childFlatIndexes) : flatCursor;
1587
- const count = node.children?.length ?? 0;
1588
- spans.push({ stepIndex: node.stepIndex, start, count, isParallel: true, status: node.status, label: node.label, error: node.error });
1589
- flatCursor = Math.max(flatCursor, start + count);
1590
- continue;
1591
- }
1592
- const start = node.flatIndex ?? flatCursor;
1593
- spans.push({ stepIndex: node.stepIndex, start, count: 1, isParallel: false, status: node.status, label: node.label, error: node.error });
1594
- flatCursor = Math.max(flatCursor, start + 1);
1595
- }
1596
- if (spans.length)
1597
- return spans.sort((left, right) => left.stepIndex - right.stepIndex);
1598
- }
1599
- if (!details.chainAgents?.length)
1600
- return [];
1601
- const spans = [];
1602
- let start = 0;
1603
- for (let stepIndex = 0; stepIndex < details.chainAgents.length; stepIndex++) {
1604
- const label = details.chainAgents[stepIndex];
1605
- const parsedCount = parseParallelGroupAgentCount(label);
1606
- const count = parsedCount ?? 1;
1607
- spans.push({ stepIndex, start, count, isParallel: parsedCount !== undefined });
1608
- start += count;
1609
- }
1610
- return spans;
1611
- }
1612
- function buildAsyncChainStepSpans(total, stepCount, parallelGroups = []) {
1613
- const groupsByStep = new Map();
1614
- for (const group of parallelGroups) {
1615
- if (!groupsByStep.has(group.stepIndex))
1616
- groupsByStep.set(group.stepIndex, group);
1617
- }
1618
- const spans = [];
1619
- let flatIndex = 0;
1620
- for (let stepIndex = 0; stepIndex < total; stepIndex++) {
1621
- const group = groupsByStep.get(stepIndex);
1622
- if (group) {
1623
- spans.push({ stepIndex, start: group.start, count: group.count, isParallel: true });
1624
- flatIndex = Math.max(flatIndex, group.start + group.count);
1625
- continue;
1626
- }
1627
- spans.push({ stepIndex, start: flatIndex, count: flatIndex < stepCount ? 1 : 0, isParallel: false });
1628
- flatIndex++;
1629
- }
1630
- return spans;
1631
- }
1632
- function normalizedParallelDisplayText(value) {
1633
- if (!value?.trim())
1634
- return undefined;
1635
- const normalized = oneLine(value);
1636
- return normalized && normalized !== PROMPT_REDACTED ? normalized : undefined;
1637
- }
1638
- function parallelWidgetStepDisplayName(step) {
1639
- const agent = normalizedParallelDisplayText(step.agent);
1640
- const explicitLabel = normalizedParallelDisplayText(step.label);
1641
- if (explicitLabel) {
1642
- const label = compactTaskText(step.description, explicitLabel) ?? explicitLabel;
1643
- return agent ? `${label} (${agent})` : label;
1644
- }
1645
- const sessionName = normalizedParallelDisplayText(step.sessionName);
1646
- if (sessionName) {
1647
- const sessionTask = stripRepeatedAgentPrefix(sessionName, agent);
1648
- if (sessionTask && sessionTask !== PROMPT_REDACTED && sessionTask.toLowerCase() !== agent?.toLowerCase())
1649
- return sessionTask;
1650
- }
1651
- return compactTaskText(step.description) ?? agent ?? "subagent";
1652
- }
1653
- function parallelWidgetStepPriority(step) {
1654
- if (step.status === "running" || step.activityState === "needs_attention")
1655
- return 0;
1656
- switch (step.status) {
1657
- case "failed":
1658
- case "rejected":
1659
- case "partial":
1660
- case "stopped":
1661
- case "paused":
1662
- return 1;
1663
- case "complete":
1664
- case "completed":
1665
- return 2;
1666
- default:
1667
- return 3;
1668
- }
1669
- }
1670
- function parallelWidgetStepRows(steps, total, prioritizeActive) {
1671
- const indexed = steps.map((step, index) => ({ step, index, displayName: parallelWidgetStepDisplayName(step) }));
1672
- if (prioritizeActive)
1673
- indexed.sort((left, right) => parallelWidgetStepPriority(left.step) - parallelWidgetStepPriority(right.step) || left.index - right.index);
1674
- return withDuplicateLabelDiscriminators(indexed, total).map(({ displayName, ...row }) => row);
1675
- }
1676
- function activeParallelWidgetGroup(job) {
1677
- const steps = job.steps ?? [];
1678
- if (!steps.length)
1679
- return undefined;
1680
- if (job.mode === "parallel")
1681
- return { steps, total: job.stepsTotal ?? steps.length };
1682
- if (job.mode !== "chain" || !job.activeParallelGroup)
1683
- return undefined;
1684
- const chainTotal = job.chainStepCount ?? job.stepsTotal ?? steps.length;
1685
- const spans = buildAsyncChainStepSpans(chainTotal, steps.length, job.parallelGroups);
1686
- const currentStep = job.currentStep;
1687
- const activeSpan = currentStep === undefined
1688
- ? spans.find((span) => span.isParallel)
1689
- : spans.find((span) => span.isParallel
1690
- && currentStep >= span.start
1691
- && currentStep < span.start + span.count);
1692
- return {
1693
- steps,
1694
- total: activeSpan?.count ?? job.stepsTotal ?? steps.length,
1695
- stepIndex: activeSpan?.stepIndex,
1696
- chainTotal,
1697
- };
1698
- }
1699
- function parallelWidgetGroupHeader(group, theme, frame) {
1700
- const status = aggregateStepStatus(group.steps);
1701
- const label = group.stepIndex !== undefined && group.chainTotal !== undefined
1702
- ? `Step ${group.stepIndex + 1}/${group.chainTotal}: parallel group`
1703
- : "parallel group";
1704
- return ` ${widgetStepGlyph(status, theme, widgetStepsRunningSeed(group.steps), frame)} ${themeBold(theme, label)} ${theme.fg("dim", "·")} ${theme.fg("dim", formatParallelOutcome(group.steps, group.total))}`;
1705
- }
1706
- function parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, prioritizeActive) {
1707
- const lines = [parallelWidgetGroupHeader(group, theme, frame)];
1708
- const rows = parallelWidgetStepRows(group.steps, group.total, prioritizeActive);
1709
- for (const [rowIndex, row] of rows.entries()) {
1710
- const marker = rowIndex === rows.length - 1 && rows.length >= group.total ? "└─" : "├─";
1711
- lines.push(...foregroundStyleWidgetStepLines(job, theme, row.step, "Agent", row.index + 1, group.total, expanded, width, frame, {
1712
- rowLabel: row.rowLabel,
1713
- rowIndent: " ",
1714
- detailIndent: " ",
1715
- rowMarker: marker,
1716
- includeCurrentPath: true,
1717
- }));
1718
- }
1719
- for (let index = rows.length; index < group.total; index++) {
1720
- const marker = index === group.total - 1 ? "└─" : "├─";
1721
- lines.push(` ${marker} ${theme.fg("muted", "◦")} ${theme.fg("dim", "pending")}`);
1722
- }
1723
- return lines;
1724
- }
1725
- function isDoneResult(result) {
1726
- const status = result.progress?.status;
1727
- if (status === "completed")
1728
- return true;
1729
- if (status === "running" || status === "pending")
1730
- return false;
1731
- if (result.interrupted || result.detached)
1732
- return false;
1733
- return result.exitCode === 0;
1734
- }
1735
- function workflowGraphHasStatus(details, statuses) {
1736
- return details.workflowGraph?.nodes.some((node) => statuses.includes(node.status)) ?? false;
1737
- }
1738
- function chainSpanStatus(details, span) {
1739
- if (span.status)
1740
- return span.status;
1741
- const results = details.results.slice(span.start, span.start + span.count);
1742
- if (results.some((result) => isResultRunning(result)))
1743
- return "running";
1744
- if (results.some((result) => !hasTerminalResultFlag(result) && (result.progress?.status === "failed" || result.exitCode !== 0) && !isResultRunning(result)))
1745
- return "failed";
1746
- if (results.some((result) => result.stopped))
1747
- return "stopped";
1748
- if (results.some((result) => result.interrupted))
1749
- return "paused";
1750
- if (results.some((result) => result.detached || result.progress?.status === "detached"))
1751
- return "detached";
1752
- if (results.length < span.count)
1753
- return "pending";
1754
- if (results.length > 0 && results.every(isDoneResult))
1755
- return "completed";
1756
- return "pending";
1757
- }
1758
- function withDuplicateForegroundLabels(entries, total) {
1759
- return withDuplicateLabelDiscriminators(entries.map((entry) => ({ ...entry, index: entry.displayIndex, displayName: entry.agentName })), total).map(({ displayName, rowLabel, ...entry }) => ({
1760
- ...entry,
1761
- rowLabel: rowLabel === displayName ? undefined : rowLabel.slice(0, -(displayName.length + 2)),
1762
- }));
1763
- }
1764
- function buildChainRenderEntries(details, label) {
1765
- if (details.mode !== "chain" || !label.hasParallelInChain || label.showActiveGroupOnly)
1766
- return undefined;
1767
- const entries = [];
1768
- for (const span of buildChainStepSpans(details)) {
1769
- if (span.isParallel) {
1770
- entries.push({
1771
- kind: "group",
1772
- stepLabel: `Step ${span.stepIndex + 1}/${label.logicalStepCount}: parallel group`,
1773
- groupLabel: span.label?.trim() || undefined,
1774
- status: chainSpanStatus(details, span),
1775
- error: span.error,
1776
- });
1777
- const groupEntries = [];
1778
- for (let index = span.start; index < span.start + span.count; index++) {
1779
- const result = details.results[index];
1780
- const localIndex = foregroundResultIndex(details, index);
1781
- const displayIndex = localIndex >= span.start && localIndex < span.start + span.count
1782
- ? localIndex - span.start
1783
- : index - span.start;
1784
- groupEntries.push({
1785
- kind: "result",
1786
- resultIndex: index,
1787
- rowNumber: index - span.start + 1,
1788
- agentName: foregroundResultDisplayName(details, index, result, `agent-${displayIndex + 1}`),
1789
- displayIndex,
1790
- isParallel: true,
1791
- });
1792
- }
1793
- entries.push(...withDuplicateForegroundLabels(groupEntries, span.count));
1794
- continue;
1795
- }
1796
- for (let index = span.start; index < span.start + span.count; index++) {
1797
- const result = details.results[index];
1798
- entries.push({
1799
- kind: "result",
1800
- resultIndex: index,
1801
- rowNumber: span.stepIndex + 1,
1802
- rowLabel: resultRowLabel(label, span.stepIndex + 1),
1803
- agentName: foregroundResultDisplayName(details, index, result, details.chainAgents?.[span.stepIndex] ?? `step-${span.stepIndex + 1}`),
1804
- displayIndex: foregroundResultIndex(details, index),
1805
- });
1806
- }
1807
- }
1808
- return entries;
1809
- }
1810
- function buildMultiProgressLabel(details, hasRunning) {
1811
- const stepSpans = buildChainStepSpans(details);
1812
- const hasParallelInChain = details.mode === "chain" && stepSpans.some((span) => span.isParallel);
1813
- const activeParallelGroup = details.mode === "chain"
1814
- && details.currentStepIndex !== undefined
1815
- && stepSpans.some((span) => span.stepIndex === details.currentStepIndex && span.isParallel);
1816
- const itemTitle = details.mode === "parallel" || activeParallelGroup ? "Agent" : "Step";
1817
- if (details.mode === "parallel") {
1818
- const totalCount = details.totalSteps ?? details.results.length;
1819
- const statuses = new Array(totalCount).fill("pending");
1820
- for (const progress of details.progress ?? []) {
1821
- if (progress.index >= 0 && progress.index < totalCount)
1822
- statuses[progress.index] = progress.status;
1823
- }
1824
- for (let i = 0; i < details.results.length; i++) {
1825
- const result = details.results[i];
1826
- const progressFromArray = details.progress?.find((progress) => progress.index === i)
1827
- || details.progress?.find((progress) => progress.agent === result.agent && progress.status === "running");
1828
- const index = result.progress?.index ?? progressFromArray?.index ?? i;
1829
- if (index < 0 || index >= totalCount)
1830
- continue;
1831
- const status = result.stopped
1832
- ? "stopped"
1833
- : result.interrupted || result.detached
1834
- ? "detached"
1835
- : result.progress?.status
1836
- ?? (result.exitCode === 0 ? "completed" : "failed");
1837
- statuses[index] = status;
1838
- }
1839
- const running = statuses.filter((status) => status === "running").length;
1840
- const done = statuses.filter((status) => status === "completed").length;
1841
- const headerLabel = hasRunning
1842
- ? `${formatAgentRunningLabel(running)} · ${done}/${totalCount} done`
1843
- : `${done}/${totalCount} done`;
1844
- return { headerLabel, itemTitle, totalCount, hasParallelInChain, activeParallelGroup, groupStartIndex: 0, groupEndIndex: totalCount, showActiveGroupOnly: false, logicalStepCount: totalCount };
1845
- }
1846
- if (activeParallelGroup) {
1847
- const currentStepIndex = details.currentStepIndex;
1848
- const span = stepSpans[currentStepIndex];
1849
- const groupSize = span?.count ?? 1;
1850
- const groupStart = span?.start ?? 0;
1851
- const groupEnd = groupStart + groupSize;
1852
- let running = 0;
1853
- let done = 0;
1854
- for (let index = groupStart; index < groupEnd; index++) {
1855
- const progressEntry = details.progress?.find((progress) => progress.index === index);
1856
- const resultEntry = details.results.find((result) => result.progress?.index === index) ?? details.results[index];
1857
- if (progressEntry?.status === "running" && (!resultEntry || !hasTerminalResultFlag(resultEntry))) {
1858
- running++;
1859
- continue;
1860
- }
1861
- if (progressEntry?.status === "completed") {
1862
- done++;
1863
- continue;
1864
- }
1865
- if (resultEntry && isDoneResult(resultEntry))
1866
- done++;
1867
- }
1868
- const totalSteps = details.totalSteps ?? details.chainAgents?.length ?? 1;
1869
- const headerLabel = hasRunning
1870
- ? `step ${currentStepIndex + 1}/${totalSteps} · parallel group: ${formatAgentRunningLabel(running)} · ${done}/${groupSize} done`
1871
- : `step ${currentStepIndex + 1}/${totalSteps} · parallel group: ${done}/${groupSize} done`;
1872
- return { headerLabel, itemTitle, totalCount: groupSize, hasParallelInChain, activeParallelGroup, groupStartIndex: groupStart, groupEndIndex: groupEnd, showActiveGroupOnly: true, logicalStepCount: totalSteps };
1873
- }
1874
- if (details.mode === "chain" && details.chainAgents?.length) {
1875
- const totalCount = details.totalSteps ?? details.chainAgents.length;
1876
- const doneLogical = stepSpans.filter((span) => {
1877
- if (span.status && span.status !== "completed")
1878
- return false;
1879
- if (span.count === 0)
1880
- return span.status === "completed";
1881
- for (let index = span.start; index < span.start + span.count; index++) {
1882
- const progressEntry = details.progress?.find((progress) => progress.index === index);
1883
- const resultEntry = details.results.find((result) => result.progress?.index === index) ?? details.results[index];
1884
- if (progressEntry?.status === "running" || progressEntry?.status === "pending" || progressEntry?.status === "failed")
1885
- return false;
1886
- if (!resultEntry || !isDoneResult(resultEntry))
1887
- return false;
1888
- }
1889
- return true;
1890
- }).length;
1891
- const currentStep = details.currentStepIndex !== undefined ? details.currentStepIndex + 1 : Math.min(totalCount, doneLogical + (hasRunning ? 1 : 0));
1892
- const headerLabel = hasRunning ? `step ${currentStep}/${totalCount}` : `step ${doneLogical}/${totalCount}`;
1893
- return { headerLabel, itemTitle, totalCount, hasParallelInChain, activeParallelGroup, groupStartIndex: 0, groupEndIndex: details.results.length, showActiveGroupOnly: false, logicalStepCount: totalCount };
1894
- }
1895
- const totalCount = details.totalSteps ?? details.results.length;
1896
- const currentStep = details.currentStepIndex !== undefined ? details.currentStepIndex + 1 : Math.min(totalCount, details.results.filter(isDoneResult).length + (hasRunning ? 1 : 0));
1897
- const done = details.results.filter(isDoneResult).length;
1898
- const headerLabel = hasRunning ? `step ${currentStep}/${totalCount}` : `step ${done}/${totalCount}`;
1899
- return { headerLabel, itemTitle, totalCount, hasParallelInChain, activeParallelGroup, groupStartIndex: 0, groupEndIndex: details.results.length, showActiveGroupOnly: false, logicalStepCount: totalCount };
1900
- }
1901
- function resultRowLabel(label, stepNumber) {
1902
- if (label.itemTitle === "Agent")
1903
- return undefined;
1904
- if (shouldSuppressSingleStep(label.logicalStepCount))
1905
- return undefined;
1906
- return `Step ${stepNumber}/${label.logicalStepCount}`;
1907
- }
1908
- function buildForegroundResultEntries(details, label, displayStart, displayEnd, useResultsDirectly) {
1909
- const fallbackLabel = label.itemTitle.toLowerCase();
1910
- const entries = Array.from({ length: displayEnd - displayStart }, (_, offset) => {
1911
- const index = displayStart + offset;
1912
- const result = details.results[index];
1913
- const stableIndex = foregroundResultIndex(details, index);
1914
- const rowNumber = label.showActiveGroupOnly ? index - label.groupStartIndex + 1 : stableIndex + 1;
1915
- const fallbackAgent = useResultsDirectly
1916
- ? (result?.agent || `${fallbackLabel}-${rowNumber}`)
1917
- : (details.chainAgents[index] || result?.agent || `${fallbackLabel}-${rowNumber}`);
1918
- const displayIndex = label.activeParallelGroup && stableIndex >= label.groupStartIndex && stableIndex < label.groupEndIndex
1919
- ? stableIndex - label.groupStartIndex
1920
- : label.activeParallelGroup ? index - label.groupStartIndex : stableIndex;
1921
- return {
1922
- kind: "result",
1923
- resultIndex: index,
1924
- rowNumber,
1925
- rowLabel: resultRowLabel(label, rowNumber),
1926
- agentName: foregroundResultDisplayName(details, index, result, fallbackAgent),
1927
- displayIndex,
1928
- };
1929
- });
1930
- return label.itemTitle === "Agent" ? withDuplicateForegroundLabels(entries, label.totalCount) : entries;
1931
- }
1932
- function widgetStats(job, theme, projection = buildWorkflowWidgetProjection(job), collapsed = false) {
1933
- const parts = [];
1934
- const { stageProgress } = projection;
1935
- const stepsTotal = stageProgress?.total ?? job.stepsTotal ?? (job.agents?.length ?? 1);
1936
- const isSingleChild = isSingleChildAsyncJob(job);
1937
- const checklistPrimary = collapsed && job.mode === "workflow" && projection.checklist !== undefined;
1938
- if (checklistPrimary) {
1939
- parts.push(formatWorkflowChecklistSummary(projection.checklist));
1940
- }
1941
- else if (stageProgress) {
1942
- const currentStage = stageProgress.current !== undefined ? projection.stages[stageProgress.current] : undefined;
1943
- const focus = currentStage
1944
- ? [compactTaskText(undefined, currentStage.label) ?? boundedLaneValue(currentStage.id), currentStage.agent ? boundedLaneValue(currentStage.agent) : "", workflowNodeStatusLabel(currentStage.status)].filter(Boolean)
1945
- : [];
1946
- parts.push(["staged lane", stageProgress.current !== undefined ? `stage ${stageProgress.current + 1}/${stageProgress.total}` : `${stageProgress.total} stages`, ...focus].join(" · "));
1947
- }
1948
- else if (job.activeParallelGroup) {
1949
- const running = job.runningSteps ?? (job.status === "running" ? 1 : 0);
1950
- const done = job.completedSteps ?? (job.status === "complete" ? stepsTotal : 0);
1951
- if (job.mode === "parallel") {
1952
- if (job.status === "running" && running > 0)
1953
- parts.push(formatAgentRunningLabel(running));
1954
- if (stepsTotal > 0)
1955
- parts.push(`${done}/${stepsTotal} done`);
1956
- }
1957
- else {
1958
- const activeGroup = job.currentStep !== undefined
1959
- ? job.parallelGroups?.find((group) => job.currentStep >= group.start && job.currentStep < group.start + group.count)
1960
- : job.parallelGroups?.find((group) => group.start === 0);
1961
- const logicalStep = activeGroup?.stepIndex ?? job.currentStep ?? 0;
1962
- const total = job.chainStepCount ?? stepsTotal;
1963
- const groupParts = [`${done}/${stepsTotal} done`];
1964
- if (job.status === "running" && running > 0)
1965
- groupParts.unshift(formatAgentRunningLabel(running));
1966
- parts.push(`step ${logicalStep + 1}/${total} · parallel group: ${groupParts.join(" · ")}`);
1967
- }
1968
- }
1969
- else if (job.currentStep !== undefined) {
1970
- if (job.mode === "chain") {
1971
- const total = job.chainStepCount ?? stepsTotal;
1972
- parts.push(`step ${flatToLogicalStepIndex(job.currentStep, total, job.parallelGroups ?? []) + 1}/${total}`);
1973
- }
1974
- else if (!isSingleChild) {
1975
- parts.push(`step ${job.currentStep + 1}/${stepsTotal}`);
1976
- }
1977
- }
1978
- else if (stepsTotal > 1) {
1979
- parts.push(`steps ${stepsTotal}`);
1980
- }
1981
- if (projection.checklist && !checklistPrimary)
1982
- parts.push(formatWorkflowChecklistSummary(projection.checklist));
1983
- if (job.toolCount !== undefined)
1984
- parts.push(formatToolUseStat(job.toolCount));
1985
- if (job.totalTokens?.total)
1986
- parts.push(formatTokenUsage(job.totalTokens, "token"));
1987
- const end = job.status === "running" && (job.mode === "workflow" || job.parentWorkflowRunId) ? projection.now : job.updatedAt;
1988
- if (job.status !== "queued" && job.startedAt !== undefined && end !== undefined)
1989
- parts.push(formatDuration(Math.max(0, end - job.startedAt)));
1990
- return statJoin(theme, parts);
1991
- }
1992
- function widgetStepStats(theme, step, snapshotNow = Date.now()) {
1993
- const externalElapsed = step.runner?.type === "external-cli" && step.externalProcess
1994
- ? step.externalProcess.durationMs ?? Math.max(0, (step.externalProcess.endedAt ?? snapshotNow) - step.externalProcess.startedAt)
1995
- : undefined;
1996
- return statJoin(theme, [
1997
- step.runner?.type === "external-cli" ? "external-cli" : "",
1998
- step.turnCount !== undefined ? `${step.turnCount} turns` : "",
1999
- step.toolCount !== undefined ? formatToolUseStat(step.toolCount) : "",
2000
- step.tokens
2001
- ? step.contextLimit !== undefined
2002
- ? formatContextUsage(step.tokens, step.contextLimit) ?? formatTokenUsage(step.tokens, "token")
2003
- : step.tokens.total ? formatTokenUsage(step.tokens, "token") : ""
2004
- : "",
2005
- externalElapsed !== undefined ? formatDuration(externalElapsed) : step.durationMs !== undefined ? formatDuration(step.durationMs) : "",
2006
- ]);
2007
- }
2008
- function modelThinkingBadge(theme, model, thinking) {
2009
- const label = formatModelThinking(model, thinking);
2010
- return label ? theme.fg("dim", ` (${label})`) : "";
2011
- }
2012
- function widgetStepActivityLine(step, width, expanded, snapshotNow) {
2013
- const toolLine = formatCurrentToolLine(step, width, expanded, snapshotNow);
2014
- if (toolLine)
2015
- return toolLine;
2016
- const activity = buildLiveStatusLine(step, snapshotNow);
2017
- if (activity)
2018
- return activity;
2019
- if (step.status === "running")
2020
- return "thinking…";
2021
- return "";
2022
- }
2023
- function widgetOutputPath(job, step) {
2024
- if (typeof step.index !== "number")
2025
- return undefined;
2026
- return path.join(job.asyncDir, `output-${step.index}.log`);
2027
- }
2028
- function nestedRunName(run) {
2029
- if (run.sessionName?.trim())
2030
- return run.sessionName.trim();
2031
- if (run.agent)
2032
- return run.agent;
2033
- if (run.agents?.length)
2034
- return formatWidgetAgents(run.agents);
2035
- return run.id;
2036
- }
2037
- function nestedStatusGlyph(state, theme, seed, thinking) {
2038
- if (state === "running")
2039
- return runningTone(theme, thinking)(runningGlyph(seed));
2040
- if (state === "complete" || state === "completed")
2041
- return theme.fg("success", "✓");
2042
- if (state === "failed")
2043
- return theme.fg("error", "✗");
2044
- if (state === "partial")
2045
- return theme.fg("warning", "■");
2046
- if (state === "paused")
2047
- return theme.fg("warning", "■");
2048
- if (state === "stopped")
2049
- return theme.fg("warning", "■");
2050
- return theme.fg("muted", "◦");
2051
- }
2052
- function nestedRunSeed(run) {
2053
- return runningSeed(run.lastUpdate, run.lastActivityAt, run.currentStep, run.toolCount, run.turnCount, run.totalTokens?.total, run.currentToolStartedAt);
2054
- }
2055
- function formatClockTime(ms) {
2056
- if (ms === undefined || !Number.isFinite(ms))
2057
- return undefined;
2058
- const date = new Date(ms);
2059
- const pad = (value) => value.toString().padStart(2, "0");
2060
- return `${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
2061
- }
2062
- function nestedRunEventTime(run) {
2063
- return run.state === "running"
2064
- ? (run.lastActivityAt ?? run.currentToolStartedAt ?? run.lastUpdate ?? run.startedAt)
2065
- : (run.endedAt ?? run.lastUpdate ?? run.lastActivityAt ?? run.startedAt);
2066
- }
2067
- function nestedStepTimestamp(step, fallback) {
2068
- return formatClockTime(step.status === "running"
2069
- ? (step.lastActivityAt ?? step.currentToolStartedAt ?? fallback ?? step.startedAt)
2070
- : (step.endedAt ?? step.lastActivityAt ?? fallback ?? step.startedAt));
2071
- }
2072
- function nestedTimestampPrefix(timestamp) {
2073
- return timestamp ? `[${timestamp}] ` : "";
2074
- }
2075
- function nestedActivity(input, state, snapshotNow) {
2076
- const facts = [];
2077
- if (input.currentTool && input.currentToolStartedAt !== undefined && snapshotNow !== undefined)
2078
- facts.push(`${input.currentTool} ${formatDuration(Math.max(0, snapshotNow - input.currentToolStartedAt))}`);
2079
- else if (input.currentTool)
2080
- facts.push(input.currentTool);
2081
- if (input.currentPath)
2082
- facts.push(shortenPath(input.currentPath));
2083
- if (input.turnCount !== undefined)
2084
- facts.push(`${input.turnCount} turns`);
2085
- if (input.toolCount !== undefined)
2086
- facts.push(`${input.toolCount} tools`);
2087
- const activity = buildLiveStatusLine(input, snapshotNow);
2088
- if (activity && facts.length)
2089
- return `${activity} · ${facts.join(" · ")}`;
2090
- if (activity)
2091
- return activity;
2092
- if (facts.length)
2093
- return facts.join(" · ");
2094
- if (state === "running")
2095
- return "thinking…";
2096
- if (state === "queued" || state === "pending")
2097
- return "queued…";
2098
- if (state === "paused")
2099
- return "Paused";
2100
- if (state === "stopped")
2101
- return "Stopped";
2102
- if (state === "partial")
2103
- return "Partial";
2104
- if (state === "failed")
2105
- return "Failed";
2106
- return "Done";
2107
- }
2108
- function formatNestedWidgetLines(children, theme, width, expanded, snapshotNow, lineBudget = expanded ? 12 : 1) {
2109
- if (!children?.length || lineBudget <= 0)
2110
- return [];
2111
- if (!expanded) {
2112
- const rows = [];
2113
- const maxLeaves = 4;
2114
- const maxLines = Math.min(6, lineBudget);
2115
- let leaves = 0;
2116
- let overflow = 0;
2117
- const appendLeaf = (step, prefix, fallback) => {
2118
- if (leaves >= maxLeaves) {
2119
- overflow++;
2120
- return;
2121
- }
2122
- leaves++;
2123
- const state = "status" in step ? step.status : step.state;
2124
- const modelThinking = formatModelThinking(step.model, step.thinking);
2125
- const activity = nestedActivity(step, state, snapshotNow ?? fallback);
2126
- const timestamp = "status" in step ? nestedStepTimestamp(step, fallback) : formatClockTime(nestedRunEventTime(step));
2127
- const error = step.error ? ` · ${step.error}` : "";
2128
- const name = "status" in step ? childDisplayName(step) : nestedRunName(step);
2129
- rows.push({
2130
- prefix,
2131
- text: `${nestedTimestampPrefix(timestamp)}${nestedStatusGlyph(state, theme, undefined, childThinkingLevel(step))} ${name} · ${state}${modelThinking ? ` · ${modelThinking}` : ""}${activity ? ` · ${activity}` : ""}${error}`,
2132
- });
2133
- };
2134
- for (const child of children) {
2135
- const steps = (child.mode === "parallel" || child.mode === "chain") ? child.steps ?? [] : [];
2136
- if (steps.length > 0) {
2137
- const ownerModelThinking = formatModelThinking(child.model, child.thinking);
2138
- const ownerActivity = nestedActivity(child, child.state, snapshotNow ?? child.lastUpdate);
2139
- const ownerError = child.error ? ` · ${child.error}` : "";
2140
- rows.push({
2141
- prefix: "↳ ",
2142
- text: `OWNER ${nestedStatusGlyph(child.state, theme, nestedRunSeed(child), childThinkingLevel(child))} ${nestedRunName(child)} · ${child.state}${ownerModelThinking ? ` · ${ownerModelThinking}` : ""}${ownerActivity ? ` · ${ownerActivity}` : ""}${ownerError}`,
2143
- });
2144
- for (const step of steps)
2145
- appendLeaf(step, "↳ │ ", child.lastUpdate);
2146
- }
2147
- else {
2148
- appendLeaf(child, "↳ ", child.lastUpdate);
2149
- }
2150
- }
2151
- if (overflow > 0)
2152
- rows.push({ prefix: "↳ ", text: `… +${overflow} more nested leaves` });
2153
- const visibleRows = rows.length <= maxLines
2154
- ? rows
2155
- : overflow > 0
2156
- ? [...rows.slice(0, Math.max(0, maxLines - 1)), rows.at(-1)]
2157
- : rows.slice(0, maxLines);
2158
- return visibleRows.map((row, index) => {
2159
- const marker = index === visibleRows.length - 1 ? "└─" : "├─";
2160
- const prefix = row.prefix;
2161
- const text = row.text.startsWith("OWNER ") ? row.text.slice("OWNER ".length) : row.text;
2162
- return truncLine(theme.fg("dim", `${prefix}${marker} ${text}`), width);
2163
- });
2164
- }
2165
- const lines = [];
2166
- const maxDepth = 2;
2167
- const append = (items, depth, prefix) => {
2168
- if (!items?.length || lines.length >= lineBudget)
2169
- return;
2170
- if (depth > maxDepth) {
2171
- const aggregate = formatNestedAggregate(items);
2172
- if (aggregate && lines.length < lineBudget)
2173
- lines.push(theme.fg("dim", `${prefix}↳ ${aggregate}`));
2174
- return;
2175
- }
2176
- for (let index = 0; index < items.length; index++) {
2177
- const child = items[index];
2178
- if (lines.length >= lineBudget) {
2179
- const aggregate = formatNestedAggregate(items.slice(index));
2180
- if (aggregate)
2181
- lines[lines.length - 1] = theme.fg("dim", `${prefix}↳ ${aggregate}`);
2182
- return;
2183
- }
2184
- const activity = nestedActivity(child, child.state, snapshotNow ?? child.lastUpdate);
2185
- const error = child.error ? ` · ${child.error}` : "";
2186
- const modelThinking = formatModelThinking(child.model, child.thinking);
2187
- lines.push(theme.fg("dim", `${prefix}↳ ${nestedTimestampPrefix(formatClockTime(nestedRunEventTime(child)))}${nestedStatusGlyph(child.state, theme, nestedRunSeed(child), childThinkingLevel(child))} ${nestedRunName(child)} · ${child.state}${modelThinking ? ` · ${modelThinking}` : ""} · ${activity}${error}`));
2188
- if (depth === maxDepth) {
2189
- const aggregate = formatNestedAggregate([...(child.steps?.flatMap((step) => step.children ?? []) ?? []), ...(child.children ?? [])]);
2190
- if (aggregate && lines.length < lineBudget)
2191
- lines.push(theme.fg("dim", `${prefix} ↳ ${aggregate}`));
2192
- continue;
2193
- }
2194
- for (const step of child.steps ?? []) {
2195
- if (lines.length >= lineBudget)
2196
- return;
2197
- const modelThinking = formatModelThinking(step.model, step.thinking);
2198
- lines.push(theme.fg("dim", `${prefix} ↳ ${nestedTimestampPrefix(nestedStepTimestamp(step, child.lastUpdate))}${nestedStatusGlyph(step.status, theme, undefined, childThinkingLevel(step))} ${childDisplayName(step)} · ${step.status}${modelThinking ? ` · ${modelThinking}` : ""} · ${nestedActivity(step, step.status, snapshotNow ?? child.lastUpdate)}`));
2199
- append(step.children, depth + 1, `${prefix} `);
2200
- }
2201
- append(child.children, depth + 1, `${prefix} `);
2202
- }
2203
- };
2204
- append(children, 0, "");
2205
- return lines.map((line) => truncLine(line, width));
2206
- }
2207
- function foregroundStyleWidgetStepLines(job, theme, step, itemTitle, index, total, expanded, width, frame, options) {
2208
- const rowIndent = options?.rowIndent ?? " ";
2209
- const detailIndent = options?.detailIndent ?? " ";
2210
- const thinking = childThinkingLevel(step);
2211
- const status = widgetStepStatus(step.status, theme, thinking);
2212
- const stats = widgetStepStats(theme, step, job.updatedAt);
2213
- const modelDisplay = modelThinkingBadge(theme, step.model, step.thinking);
2214
- const collapseDetails = shouldCollapseSingleChildDetails(job, step);
2215
- const displayName = collapseDetails ? singleChildAgentName(job, step) : childDisplayName(step);
2216
- const stageName = itemTitle === "Stage"
2217
- ? compactTaskText(undefined, step.label) ?? boundedLaneValue(step.workflowKey) ?? displayName
2218
- : undefined;
2219
- const stageIdentity = stageName && stageName !== displayName ? `${stageName} (${displayName})` : stageName ?? displayName;
2220
- const rowLabel = collapseDetails ? displayName : (options?.rowLabel ?? `${itemTitle} ${index}/${total}: ${itemTitle === "Stage" ? stageIdentity : displayName}`);
2221
- const rowMarker = options?.rowMarker ? `${options.rowMarker} ` : "";
2222
- const lines = [`${rowIndent}${rowMarker}${widgetStepGlyph(step.status, theme, widgetStepRunningSeed(step, index - 1), frame, thinking)} ${themeBold(theme, rowLabel)}${contextModeBadge(theme, step.context)} ${theme.fg("dim", "·")} ${status}${modelDisplay}${stats ? ` ${theme.fg("dim", "·")} ${stats}` : ""}`];
2223
- const lane = projectAsyncLane(job, step);
2224
- if (lane)
2225
- lines.push(...formatLaneProjectionLines(lane, theme, detailIndent));
2226
- const task = collapseDetails ? singleChildTask(job, step) : compactTaskText(step.description, step.label);
2227
- if (task)
2228
- lines.push(`${detailIndent}${theme.fg("dim", `task: ${task}`)}`);
2229
- const activity = widgetStepActivityLine(step, width, expanded, job.updatedAt);
2230
- const currentPath = options?.includeCurrentPath && step.currentPath ? shortenPath(step.currentPath) : undefined;
2231
- const activityWithPath = currentPath && activity && !activity.includes(currentPath)
2232
- ? `${activity} · ${currentPath}`
2233
- : activity ?? currentPath;
2234
- if (activityWithPath)
2235
- lines.push(`${detailIndent}${theme.fg("dim", `⎿ ${activityWithPath}`)}`);
2236
- for (const nestedLine of formatNestedWidgetLines(step.children, theme, width, expanded, job.updatedAt, expanded ? 12 : 6)) {
2237
- lines.push(`${detailIndent}${nestedLine}`);
2238
- }
2239
- const error = step.error?.trim() || step.execution?.error?.trim();
2240
- if (error)
2241
- lines.push(`${detailIndent}${theme.fg("error", `error: ${oneLine(error)}`)}`);
2242
- if (step.status === "running") {
2243
- if (!expanded)
2244
- lines.push(`${detailIndent}${theme.fg("accent", liveDetailHintText())}`);
2245
- const output = widgetOutputPath(job, step);
2246
- if (output)
2247
- lines.push(`${detailIndent}${theme.fg("dim", `output: ${shortenPath(output)}`)}`);
2248
- if (expanded) {
2249
- const liveStatus = buildLiveStatusLine(step, job.updatedAt);
2250
- if (liveStatus && liveStatus !== activity)
2251
- lines.push(`${detailIndent}${theme.fg("accent", liveStatus)}`);
2252
- for (const tool of step.recentTools?.slice(-3) ?? []) {
2253
- const maxArgsLen = Math.max(40, width - 30);
2254
- const argsPreview = renderToolArgsPreview(tool.args, maxArgsLen, expanded);
2255
- lines.push(`${detailIndent} ${theme.fg("dim", `${tool.tool}${argsPreview ? `: ${argsPreview}` : ""}`)}`);
2256
- }
2257
- for (const line of compactRecentOutputLines(step.recentOutput)) {
2258
- lines.push(`${detailIndent} ${theme.fg("dim", line)}`);
2259
- }
2260
- }
2261
- }
2262
- return lines;
2263
- }
2264
- function hostStepWidgetLines(job, theme, indent) {
2265
- const rows = projectAsyncWorkflowRows([], job.hostSteps).filter((row) => row.kind);
2266
- const visible = rows.slice(0, 8);
2267
- const lines = visible.map((row) => {
2268
- const state = hostStepVerdictLabel(row.state, row.verdict);
2269
- const glyph = state === "running" ? theme.fg("accent", "●")
2270
- : state === "pending" ? theme.fg("muted", "◦")
2271
- : state === "pass" ? theme.fg("success", "✓")
2272
- : state === "fail" || state === "error" ? theme.fg("error", "✗")
2273
- : theme.fg("warning", "■");
2274
- const details = [
2275
- row.provider ? `provider:${row.provider}` : undefined,
2276
- row.role ? `role:${row.role}` : undefined,
2277
- row.target,
2278
- row.detail,
2279
- row.reasonCode ? `reason:${row.reasonCode}` : undefined,
2280
- row.freshness?.stale ? "stale" : row.freshness?.observedRef ? `ref:${row.freshness.observedRef}` : undefined,
2281
- row.reportPath ? `out:${hostStepReportName(row.reportPath)}` : undefined,
2282
- ].filter(Boolean).join(" · ");
2283
- return `${indent}${glyph} ${row.kind}: ${row.name} · ${state}${details ? ` · ${details}` : ""}`;
2284
- });
2285
- if (rows.length > visible.length)
2286
- lines.push(`${indent}${theme.fg("dim", `… +${rows.length - visible.length} host steps hidden`)}`);
2287
- return lines;
2288
- }
2289
- function foregroundStyleWidgetDetails(job, theme, expanded, width, frame, projection = buildWorkflowWidgetProjection(job)) {
2290
- const steps = projection.steps.filter((step) => !projection.materializedKeys?.has(step.workflowKey ?? "") && !projection.materializedKeys?.has(step.runId ?? ""));
2291
- const checklist = widgetChecklistWithoutMaterializedChildren(projection);
2292
- if (!expanded && job.mode === "workflow") {
2293
- return compactWorkflowWidgetBodyLines(job, theme, frame, projection);
2294
- }
2295
- if (!steps.length) {
2296
- const lane = projectAsyncLane(job, laneStepForJob(job, steps));
2297
- return [
2298
- ...(expanded ? workflowPreflightLines(job) : []),
2299
- ...workflowChecklistWidgetLines(checklist, theme, " ", expanded, frame),
2300
- ...(lane ? formatLaneProjectionLines(lane, theme, " ") : []),
2301
- ...hostStepWidgetLines(job, theme, " "),
2302
- ` ${theme.fg("dim", `⎿ ${widgetActivity(job)}`)}`,
2303
- ...formatNestedWidgetLines(job.nestedChildren, theme, width, expanded, job.updatedAt, expanded ? 12 : 6).map((line) => ` ${line}`),
2304
- ];
2305
- }
2306
- if (job.mode === "chain" && !job.activeParallelGroup && job.parallelGroups?.length)
2307
- return widgetChainDetails(job, theme, expanded, width, frame);
2308
- const lines = [
2309
- ...(expanded ? workflowPreflightLines(job) : []),
2310
- ...workflowChecklistWidgetLines(checklist, theme, " ", expanded, frame, { includeItemErrors: !expanded }),
2311
- ];
2312
- const group = activeParallelWidgetGroup(job);
2313
- if (group) {
2314
- lines.push(...parallelWidgetGroupDetails(job, theme, group, expanded, width, frame, Boolean(job.activeParallelGroup)));
2315
- }
2316
- else {
2317
- const { stageProgress, plannedKeys } = projection;
2318
- const total = job.mode === "chain"
2319
- ? job.chainStepCount ?? job.stepsTotal ?? steps.length
2320
- : stageProgress?.total ?? job.stepsTotal ?? steps.length;
2321
- const stageTotal = stageProgress?.total ?? total;
2322
- const extraStepCount = plannedKeys
2323
- ? steps.filter((step) => step.workflowKey === undefined || !plannedKeys.has(step.workflowKey)).length
2324
- : total;
2325
- let extraStepIndex = 0;
2326
- for (const [index, step] of steps.entries()) {
2327
- const isPlannedStage = plannedKeys !== undefined && step.workflowKey !== undefined && plannedKeys.has(step.workflowKey);
2328
- const itemTitle = isPlannedStage ? "Stage" : "Step";
2329
- const displayIndex = isPlannedStage ? (step.index ?? index) + 1 : plannedKeys ? ++extraStepIndex : index + 1;
2330
- const displayTotal = isPlannedStage ? stageTotal : extraStepCount;
2331
- lines.push(...foregroundStyleWidgetStepLines(job, theme, step, itemTitle, displayIndex, displayTotal, expanded, width, frame));
2332
- }
2333
- }
2334
- lines.push(...hostStepWidgetLines(job, theme, " "));
2335
- const attached = new Set(steps.flatMap((step) => step.children?.map((child) => child.id) ?? []));
2336
- const unattached = job.nestedChildren?.filter((child) => !attached.has(child.id)) ?? [];
2337
- for (const nestedLine of formatNestedWidgetLines(unattached, theme, width, expanded, job.updatedAt, expanded ? 12 : 6)) {
2338
- lines.push(` ${nestedLine}`);
2339
- }
2340
- return lines;
2341
- }
2342
- function buildSingleWidgetLines(job, theme, width, expanded, frame, projection = buildWorkflowWidgetProjection(job)) {
2343
- if ((!expanded || projection.inlineFleetCovered) && job.mode === "workflow")
2344
- return [compactWorkflowHeaderLine(job, theme, width), ...compactWorkflowWidgetBodyLines(job, theme, frame, projection)].map((line) => truncLine(line, width));
2345
- const stats = widgetStats(job, theme, projection, !expanded);
2346
- const count = job.mode === "workflow"
2347
- ? projection.checklist?.total ?? projection.stageProgress?.total ?? job.stepsTotal ?? job.agents?.length ?? job.steps?.length
2348
- : job.mode === "chain" ? job.chainStepCount : projection.stageProgress?.total ?? job.stepsTotal ?? job.agents?.length ?? job.steps?.length;
2349
- const mode = widgetJobName(job);
2350
- const title = isSingleChildAsyncJob(job)
2351
- ? "async subagent"
2352
- : `async subagent ${mode}${count && count > 1 ? ` (${count})` : ""}`;
2353
- const checklistPrimary = !expanded && job.mode === "workflow" && projection.checklist !== undefined;
2354
- const collapseDetails = !checklistPrimary && job.steps?.length === 1 && shouldCollapseSingleChildDetails(job, job.steps[0]);
2355
- const summary = `${widgetStatusGlyph(job, theme, frame)} ${themeBold(theme, mode)}${contextModeBadge(theme, job.context)}${stats ? ` ${theme.fg("dim", "·")} ${stats}` : ""}`;
2356
- return [
2357
- `${theme.fg("toolTitle", themeBold(theme, title))} ${theme.fg("dim", "· background")}`,
2358
- ...(collapseDetails ? [] : [summary]),
2359
- ...foregroundStyleWidgetDetails(job, theme, expanded, width, frame, projection),
2360
- ].map((line) => truncLine(line, width));
2361
- }
2362
- function compactSingleWidgetLines(job, theme, width, frame, projection = buildWorkflowWidgetProjection(job)) {
2363
- const fullLines = buildSingleWidgetLines(job, theme, width, false, frame, projection);
2364
- if (fullLines.length <= 10 || !job.steps?.length || (job.mode !== "parallel" && !job.activeParallelGroup))
2365
- return fullLines;
2366
- const group = activeParallelWidgetGroup(job);
2367
- if (!group)
2368
- return fullLines;
2369
- const rows = parallelWidgetStepRows(group.steps, group.total, Boolean(job.activeParallelGroup));
2370
- const lines = fullLines.slice(0, 2);
2371
- lines.push(parallelWidgetGroupHeader(group, theme, frame));
2372
- for (const [rowIndex, row] of rows.entries()) {
2373
- const step = row.step;
2374
- const thinking = childThinkingLevel(step);
2375
- const status = widgetStepStatus(step.status, theme, thinking);
2376
- const activity = widgetStepActivityLine(step, width, false, job.updatedAt);
2377
- const stepStats = widgetStepStats(theme, step, job.updatedAt);
2378
- const activitySuffix = activity ? ` ${theme.fg("dim", "·")} ${theme.fg("dim", activity)}` : "";
2379
- const modelDisplay = modelThinkingBadge(theme, step.model, step.thinking);
2380
- const task = compactTaskText(step.description, step.label);
2381
- const taskSuffix = task ? ` ${theme.fg("dim", "·")} ${theme.fg("dim", `task: ${task}`)}` : "";
2382
- const marker = rowIndex === rows.length - 1 && rowIndex >= group.total - 1 ? "└─" : "├─";
2383
- lines.push(` ${marker} ${widgetStepGlyph(step.status, theme, widgetStepRunningSeed(step, row.index), frame, thinking)} ${themeBold(theme, row.rowLabel)}${contextModeBadge(theme, step.context)} ${theme.fg("dim", "·")} ${status}${modelDisplay}${taskSuffix}${activitySuffix}${stepStats ? ` ${theme.fg("dim", "·")} ${stepStats}` : ""}`);
2384
- const lane = projectAsyncLane(job, step);
2385
- if (lane)
2386
- lines.push(...formatLaneProjectionLines(lane, theme, " "));
2387
- for (const nestedLine of formatNestedWidgetLines(step.children, theme, width, false, job.updatedAt, 6))
2388
- lines.push(` ${nestedLine}`);
2389
- }
2390
- lines.push(...hostStepWidgetLines(job, theme, " "));
2391
- if (job.steps.some((step) => step.status === "running"))
2392
- lines.push(theme.fg("accent", ` ${liveDetailHintText()}`));
2393
- return lines.map((line) => truncLine(line, width));
2394
- }
2395
- const RESERVED_NON_WIDGET_ROWS = 19;
2396
- let widgetLayoutSession;
2397
- function resetWidgetLayoutSession() {
2398
- widgetLayoutSession = undefined;
2399
- }
2400
- function estimateAvailableWidgetRows() {
2401
- const rows = process.stdout.rows || 30;
2402
- return Math.max(1, rows - RESERVED_NON_WIDGET_ROWS);
2403
- }
2404
- function currentTerminalRows() {
2405
- return process.stdout.rows || 30;
2406
- }
2407
- function currentTerminalColumns() {
2408
- return process.stdout.columns || 120;
2409
- }
2410
- function widgetSessionMatches(expanded) {
2411
- return widgetLayoutSession?.expanded === expanded
2412
- && widgetLayoutSession.rows === currentTerminalRows()
2413
- && widgetLayoutSession.columns === currentTerminalColumns();
2414
- }
2415
- function widgetHeaderCounts(jobs) {
2416
- return {
2417
- running: jobs.filter((job) => job.status === "running"),
2418
- queued: jobs.filter((job) => job.status === "queued"),
2419
- complete: jobs.filter((job) => job.status === "complete"),
2420
- failed: jobs.filter((job) => job.status === "failed"),
2421
- paused: jobs.filter((job) => job.status === "paused"),
2422
- stopped: jobs.filter((job) => job.status === "stopped"),
2423
- };
2424
- }
2425
- function buildSingleLineWidgetLines(jobs, theme, width, frame) {
2426
- const counts = widgetHeaderCounts(jobs);
2427
- const hasActive = counts.running.length > 0 || counts.queued.length > 0;
2428
- const glyph = counts.running.length > 0 ? runningGlyph(animatedSeed(widgetJobsRunningSeed(counts.running), frame)) : hasActive ? "●" : "○";
2429
- const parts = [];
2430
- if (counts.running.length > 0)
2431
- parts.push(`${counts.running.length}/${jobs.length} running`);
2432
- if (counts.queued.length > 0)
2433
- parts.push(`${counts.queued.length} queued`);
2434
- if (counts.failed.length > 0)
2435
- parts.push(`${counts.failed.length} failed`);
2436
- if (counts.stopped.length > 0)
2437
- parts.push(`${counts.stopped.length} stopped`);
2438
- if (counts.paused.length > 0)
2439
- parts.push(`${counts.paused.length} paused`);
2440
- for (const status of ["partial", "rejected"]) {
2441
- const count = jobs.filter((job) => job.status === status).length;
2442
- if (count > 0)
2443
- parts.push(`${count} ${status}`);
2444
- }
2445
- if (!hasActive && counts.complete.length > 0)
2446
- parts.push(`${counts.complete.length}/${jobs.length} done`);
2447
- const tone = activeHeaderTone(theme, hasActive);
2448
- return [truncLine(`${tone(glyph)} ${tone("subagents")} (${parts.join(", ") || `${jobs.length} total`})`, width)];
2449
- }
2450
- function orderedWidgetJobs(jobs) {
2451
- return [
2452
- ...jobs.filter((job) => job.status === "running"),
2453
- ...jobs.filter((job) => job.status === "queued"),
2454
- ...jobs.filter((job) => job.status !== "running" && job.status !== "queued"),
2455
- ];
2456
- }
2457
- function progressiveJobKey(job) {
2458
- return job.asyncId;
2459
- }
2460
- function isProgressiveActiveJob(job) {
2461
- return job?.status === "running" || job?.status === "queued";
2462
- }
2463
- function selectProgressiveJobKeys(jobs, previousKeys, bodyRows) {
2464
- if (bodyRows <= 0)
2465
- return [];
2466
- const jobsByKey = new Map(jobs.map((job) => [progressiveJobKey(job), job]));
2467
- const selected = [];
2468
- const append = (key) => {
2469
- if (selected.includes(key) || !jobsByKey.has(key))
2470
- return;
2471
- selected.push(key);
2472
- };
2473
- for (const key of previousKeys) {
2474
- if (!isProgressiveActiveJob(jobsByKey.get(key)))
2475
- continue;
2476
- append(key);
2477
- if (selected.length >= bodyRows)
2478
- return selected;
2479
- }
2480
- for (const job of orderedWidgetJobs(jobs)) {
2481
- if (!isProgressiveActiveJob(job))
2482
- continue;
2483
- const key = progressiveJobKey(job);
2484
- append(key);
2485
- if (selected.length >= bodyRows)
2486
- break;
2487
- }
2488
- if (selected.length >= bodyRows)
2489
- return selected;
2490
- for (const key of previousKeys) {
2491
- if (isProgressiveActiveJob(jobsByKey.get(key)))
2492
- continue;
2493
- append(key);
2494
- if (selected.length >= bodyRows)
2495
- return selected;
2496
- }
2497
- for (const job of orderedWidgetJobs(jobs)) {
2498
- const key = progressiveJobKey(job);
2499
- append(key);
2500
- if (selected.length >= bodyRows)
2501
- break;
2502
- }
2503
- return selected;
2504
- }
2505
- // Counts the leaf entries collectFleetStatusEntries (fleet-status.ts) makes for a running async job,
2506
- // so this matches FleetView's "N active agents": a workflow counts only its loaded child runs;
2507
- // another job counts its active steps, synthesized from `agents` when it has no steps.
2508
- function runningLeafAgentCount(job, projectionFor) {
2509
- if (job.mode === "workflow")
2510
- return (projectionFor(job).children ?? []).reduce((total, child) => total + runningLeafAgentCount(child, projectionFor), 0);
2511
- if (job.status !== "running")
2512
- return 0;
2513
- const sequential = job.mode === "chain" && !job.activeParallelGroup;
2514
- const current = job.currentStep ?? 0;
2515
- const steps = job.steps?.length
2516
- ? job.steps
2517
- : job.agents?.map((_, index) => ({ index, status: sequential && index !== current ? "pending" : "running" }));
2518
- if (!steps?.length)
2519
- return 1;
2520
- return steps.filter((step, offset) => ["running", "queued", "pending"].includes(step.status)
2521
- && !(step.status === "pending" && sequential && (step.index ?? offset) !== current)).length;
2522
- }
2523
- function progressiveHeaderLine(jobs, theme, width, frame, projectionFor) {
2524
- const counts = widgetHeaderCounts(jobs);
2525
- const hasActive = counts.running.length > 0 || counts.queued.length > 0;
2526
- const glyph = counts.running.length > 0 ? runningGlyph(animatedSeed(widgetJobsRunningSeed(counts.running), frame)) : hasActive ? "●" : "○";
2527
- const parts = [];
2528
- const runningAgents = jobs.reduce((total, job) => total + runningLeafAgentCount(job, projectionFor), 0);
2529
- if (runningAgents > 0)
2530
- parts.push(formatAgentRunningLabel(runningAgents));
2531
- if (counts.queued.length > 0)
2532
- parts.push(`${counts.queued.length} queued`);
2533
- if (!hasActive) {
2534
- if (counts.failed.length > 0)
2535
- parts.push(`${counts.failed.length} failed`);
2536
- if (counts.stopped.length > 0)
2537
- parts.push(`${counts.stopped.length} stopped`);
2538
- if (counts.paused.length > 0)
2539
- parts.push(`${counts.paused.length} paused`);
2540
- if (counts.complete.length > 0)
2541
- parts.push(`${counts.complete.length}/${jobs.length} done`);
2542
- }
2543
- const tone = activeHeaderTone(theme, hasActive);
2544
- return truncLine(`${tone(glyph)} ${tone("Async agents")} ${theme.fg("dim", "·")} ${theme.fg("dim", parts.join(", ") || `${jobs.length} total`)}`, width);
2545
- }
2546
- function progressiveJobLine(job, theme, width, frame, projection = buildWorkflowWidgetProjection(job), compactRows = job.mode === "workflow" ? compactWorkflowLaneRows(job, projection.checklist) : undefined) {
2547
- const compactWorkflow = job.mode === "workflow";
2548
- const stats = compactWorkflow ? compactWorkflowStats(job, compactRows ?? [], theme, projection) : widgetStats(job, theme, projection, true);
2549
- if (compactWorkflow) {
2550
- const bottleneck = compactWorkflowBottleneck(compactRows ?? [], job);
2551
- const suffix = [stats, bottleneck ? theme.fg(bottleneck.tone, `bottleneck · ${bottleneck.text}`) : undefined].filter((value) => Boolean(value)).join(` ${theme.fg("dim", "·")} `);
2552
- return truncLine(` ${widgetStatusGlyph(job, theme, frame)} ${compactWorkflowHeaderLine(job, theme, Math.max(0, width - 4))}${suffix ? ` ${theme.fg("dim", "·")} ${suffix}` : ""}`, width);
2553
- }
2554
- const activity = widgetActivity(job);
2555
- const status = job.status === "complete" ? "done" : job.status;
2556
- const lane = projectAsyncLane(job, laneStepForJob(job, projection.steps));
2557
- const laneSummary = lane
2558
- ? [lane.label ?? lane.role, lane.phase ? `phase:${lane.phase}` : undefined, lane.output ? `out:${lane.output}` : undefined, lane.workspace ? `workspace:${lane.workspace}` : `ref:${lane.ref}`].filter(Boolean).join(" · ")
2559
- : "";
2560
- const laneSignals = lane
2561
- ? [lane.next ? `next:${lane.next}` : undefined, ...lane.chips.map((chip) => formatLaneChip(chip, theme))].filter(Boolean).join(" · ")
2562
- : "";
2563
- const parts = [
2564
- `${themeBold(theme, widgetJobName(job))}${contextModeBadge(theme, job.context)}`,
2565
- theme.fg("dim", status),
2566
- laneSignals ? laneSignals : "",
2567
- laneSummary ? theme.fg("dim", laneSummary) : "",
2568
- stats,
2569
- activity && activity.toLowerCase() !== status ? theme.fg("dim", activity) : "",
2570
- ].filter(Boolean);
2571
- return truncLine(` ${widgetStatusGlyph(job, theme, frame)} ${parts.join(` ${theme.fg("dim", "·")} `)}`, width);
2572
- }
2573
- function progressiveHiddenLine(hiddenJobs, theme, width) {
2574
- const counts = widgetHeaderCounts(hiddenJobs);
2575
- const parts = [];
2576
- if (counts.running.length > 0)
2577
- parts.push(`${counts.running.length} running`);
2578
- if (counts.queued.length > 0)
2579
- parts.push(`${counts.queued.length} queued`);
2580
- const finished = counts.complete.length + counts.failed.length + counts.paused.length + counts.stopped.length;
2581
- if (finished > 0)
2582
- parts.push(`${finished} finished`);
2583
- return truncLine(theme.fg("dim", ` +${hiddenJobs.length} more${parts.length ? ` (${parts.join(", ")})` : ""}`), width);
2584
- }
2585
- function buildProgressiveWidgetLines(jobs, theme, width, lockedRows, previousKeys, frame, projectionFor = workflowWidgetProjectionLookup()) {
2586
- const rowCount = Math.max(1, lockedRows);
2587
- if (rowCount === 1)
2588
- return { lines: buildSingleLineWidgetLines(jobs, theme, width, frame), visibleJobKeys: [], contentRows: 1 };
2589
- const bodyRows = rowCount - 1;
2590
- let visibleJobKeys = selectProgressiveJobKeys(jobs, previousKeys, bodyRows);
2591
- const jobsByKey = new Map(jobs.map((job) => [progressiveJobKey(job), job]));
2592
- let visibleJobs = visibleJobKeys.map((key) => jobsByKey.get(key)).filter((job) => Boolean(job));
2593
- let hiddenJobs = jobs.filter((job) => !visibleJobKeys.includes(progressiveJobKey(job)));
2594
- const needsHiddenLine = hiddenJobs.length > 0;
2595
- if (needsHiddenLine && visibleJobs.length >= bodyRows && bodyRows > 0) {
2596
- visibleJobs = visibleJobs.slice(0, bodyRows - 1);
2597
- visibleJobKeys = visibleJobs.map(progressiveJobKey);
2598
- hiddenJobs = jobs.filter((job) => !visibleJobKeys.includes(progressiveJobKey(job)));
2599
- }
2600
- // Rows left after every visible job line show the visible workflows' lanes.
2601
- let spareRows = rowCount - 1 - visibleJobs.length - (hiddenJobs.length > 0 ? 1 : 0);
2602
- const lines = [progressiveHeaderLine(jobs, theme, width, frame, projectionFor)];
2603
- for (const job of visibleJobs) {
2604
- const projection = projectionFor(job);
2605
- const laneRows = job.mode === "workflow" ? compactWorkflowLaneRows(job, projection.checklist) : undefined;
2606
- lines.push(progressiveJobLine(job, theme, width, frame, projection, laneRows));
2607
- if (!laneRows || projection.inlineFleetCovered)
2608
- continue;
2609
- const shownLanes = laneRows.slice(0, Math.max(0, spareRows));
2610
- for (const row of shownLanes)
2611
- lines.push(truncLine(compactWorkflowLaneLine(row, theme, " ", frame), width));
2612
- spareRows -= shownLanes.length;
2613
- }
2614
- if (hiddenJobs.length > 0 && lines.length < rowCount)
2615
- lines.push(progressiveHiddenLine(hiddenJobs, theme, width));
2616
- const contentRows = Math.min(lines.length, rowCount);
2617
- while (lines.length < rowCount)
2618
- lines.push(" ");
2619
- return { lines: lines.slice(0, rowCount), visibleJobKeys, contentRows };
2620
- }
2621
- function collapsedWidgetLineBudget(rows) {
2622
- return Math.max(10, Math.min(14, Math.floor(rows * 0.35)));
2623
- }
2624
- function paddedWidgetLine(line, width) {
2625
- if (width <= 2)
2626
- return " ".repeat(Math.max(0, width));
2627
- const text = ` ${truncLine(line, width - 2)} `;
2628
- return `${text}${" ".repeat(Math.max(0, width - visibleWidth(text)))}`;
2629
- }
2630
- function fitWidgetLineBudget(lines, theme, width, expanded) {
2631
- const rows = process.stdout.rows || 30;
2632
- const budget = expanded
2633
- ? Math.max(12, Math.min(24, Math.floor(rows * 0.55)))
2634
- : collapsedWidgetLineBudget(rows);
2635
- if (lines.length <= budget)
2636
- return lines;
2637
- const visibleLines = Math.max(1, budget - 1);
2638
- const hiddenCount = lines.length - visibleLines;
2639
- const hint = expanded
2640
- ? `… ${hiddenCount} live-detail lines hidden`
2641
- : `… ${hiddenCount} lines hidden · ${expandKeyHint("to expand", "to view them")}`;
2642
- return [...lines.slice(0, visibleLines), truncLine(theme.fg("dim", hint), width)];
2643
- }
2644
- function fitAdaptiveWidgetLines(jobs, buildLines, theme, width, expanded, frame, projectionFor, layout = "adaptive") {
2645
- if (expanded) {
2646
- resetWidgetLayoutSession();
2647
- return fitWidgetLineBudget(buildLines(), theme, width, true);
2648
- }
2649
- const hasMatchingSession = widgetSessionMatches(expanded);
2650
- const rows = currentTerminalRows();
2651
- const columns = currentTerminalColumns();
2652
- const availableRows = estimateAvailableWidgetRows();
2653
- if (hasMatchingSession && widgetLayoutSession?.tier === "single-line") {
2654
- return buildSingleLineWidgetLines(jobs, theme, width, frame);
2655
- }
2656
- if (hasMatchingSession && widgetLayoutSession?.tier === "progressive" && widgetLayoutSession.lockedRows !== undefined) {
2657
- const session = widgetLayoutSession;
2658
- const lockedRows = widgetLayoutSession.lockedRows;
2659
- let rendered = buildProgressiveWidgetLines(jobs, theme, width, lockedRows, session.visibleJobKeys, frame, projectionFor);
2660
- // The height stays fixed across content-only updates (#186). It grows when a new job would be hidden while the cap
2661
- // has room, and shrinks to content only when root jobs leave, so finished jobs leave no blank rows.
2662
- const capRows = Math.min(availableRows, collapsedWidgetLineBudget(rows));
2663
- if (rendered.visibleJobKeys.length < jobs.length && lockedRows < capRows) {
2664
- rendered = buildProgressiveWidgetLines(jobs, theme, width, capRows, session.visibleJobKeys, frame, projectionFor);
2665
- session.lockedRows = Math.max(lockedRows, rendered.contentRows);
2666
- }
2667
- else if (jobs.length < (session.rootJobCount ?? 0)) {
2668
- session.lockedRows = rendered.contentRows;
2669
- }
2670
- session.rootJobCount = jobs.length;
2671
- session.visibleJobKeys = rendered.visibleJobKeys;
2672
- return rendered.lines.slice(0, session.lockedRows);
2673
- }
2674
- if (layout === "adaptive") {
2675
- const lines = buildLines();
2676
- if (lines.length <= availableRows) {
2677
- widgetLayoutSession = { expanded, rows, columns, tier: "full", visibleJobKeys: [] };
2678
- return fitWidgetLineBudget(lines, theme, width, false);
2679
- }
2680
- if (availableRows > 2 && jobs.length === 1 && projectionFor?.(jobs[0]).stageProgress) {
2681
- widgetLayoutSession = { expanded, rows, columns, tier: "full", visibleJobKeys: [] };
2682
- return fitWidgetLineBudget(lines, theme, width, false);
2683
- }
2684
- }
2685
- if (availableRows <= 2) {
2686
- widgetLayoutSession = { expanded, rows, columns, tier: "single-line", visibleJobKeys: [] };
2687
- return buildSingleLineWidgetLines(jobs, theme, width, frame);
2688
- }
2689
- // Lock to the rows the content fills so the fixed-height card has no blank padding.
2690
- const rendered = buildProgressiveWidgetLines(jobs, theme, width, Math.min(availableRows, collapsedWidgetLineBudget(rows)), [], frame, projectionFor);
2691
- const lockedRows = rendered.contentRows;
2692
- widgetLayoutSession = { expanded, rows, columns, tier: "progressive", lockedRows, rootJobCount: jobs.length, visibleJobKeys: rendered.visibleJobKeys };
2693
- return rendered.lines.slice(0, lockedRows);
2694
- }
2695
- const asyncWidgetUpdates = new WeakMap();
2696
- const inlineWorkflowCoverage = new WeakMap();
2697
- const asyncWidgetInvalidations = new WeakMap();
2698
- function inlineWorkflowDescendantShape(children) {
2699
- return children?.map((child) => [child.id, child.agent, inlineWorkflowDescendantShape(child.children)]);
2700
- }
2701
- function inlineWorkflowRowShape(job) {
2702
- return [
2703
- job.asyncId,
2704
- job.parentWorkflowRunId,
2705
- job.workflowKey,
2706
- job.mode,
2707
- job.currentStep,
2708
- job.activeParallelGroup,
2709
- job.status,
2710
- job.context,
2711
- job.agents,
2712
- job.steps?.map((step, index) => [
2713
- step.index ?? index,
2714
- step.workflowKey,
2715
- step.agent,
2716
- step.status,
2717
- Boolean(step.runner),
2718
- inlineWorkflowDescendantShape(step.children),
2719
- ]),
2720
- inlineWorkflowDescendantShape(job.nestedChildren),
2721
- job.hostSteps?.map((row) => [row.id, row.monitorKind, row.label]),
2722
- Boolean(job.workflowGraph),
2723
- ];
2724
- }
2725
- /** Structural identity of the workflow rows that Fleet can cover. */
2726
- export function inlineWorkflowRenderKey(job, children) {
2727
- return JSON.stringify([inlineWorkflowRowShape(job), children.map(inlineWorkflowRowShape)]);
2728
- }
2729
- /** Presentation-only coverage from the mounted inline Fleet roster, never configuration. */
2730
- export function setInlineWorkflowCoverage(ui, coverage) {
2731
- const previous = inlineWorkflowCoverage.get(ui);
2732
- if ((previous?.size ?? 0) === coverage.size && [...coverage].every(([id, key]) => previous?.get(id) === key))
2733
- return;
2734
- if (coverage.size)
2735
- inlineWorkflowCoverage.set(ui, coverage);
2736
- else
2737
- inlineWorkflowCoverage.delete(ui);
2738
- asyncWidgetInvalidations.get(ui)?.();
2739
- }
2740
- /** Attach only to loaded workflow parents; orphan jobs remain top-level. */
2741
- function widgetJobTree(jobs, now) {
2742
- const parents = new Map(jobs.filter((job) => job.mode === "workflow").map((job) => [job.asyncId, job]));
2743
- const childrenByParent = new Map();
2744
- const roots = [];
2745
- for (const job of jobs) {
2746
- const parent = job.parentWorkflowRunId ? parents.get(job.parentWorkflowRunId) : undefined;
2747
- // Root-only adaptive summaries cannot advertise live work under a non-running parent.
2748
- const keepLiveRoot = isProgressiveActiveJob(job) && parent?.status !== "running";
2749
- if (parent && parent.asyncId !== job.asyncId && !keepLiveRoot) {
2750
- const children = childrenByParent.get(parent.asyncId) ?? [];
2751
- children.push(job);
2752
- childrenByParent.set(parent.asyncId, children);
2753
- }
2754
- else
2755
- roots.push(job);
2756
- }
2757
- return { roots, projectionFor: workflowWidgetProjectionLookup(now, childrenByParent) };
2758
- }
2759
- function widgetChecklistWithoutMaterializedChildren(projection) {
2760
- const { checklist, materializedKeys } = projection;
2761
- if (!checklist || !materializedKeys)
2762
- return checklist;
2763
- return { ...checklist, phases: checklist.phases.map((phase) => ({ ...phase, items: phase.items.filter((item) => !materializedKeys.has(item.key)) })) };
2764
- }
2765
- function materializedWidgetChildLines(job, theme, width, expanded, frame, projectionFor) {
2766
- const { children, inlineFleetCovered } = projectionFor(job);
2767
- if (inlineFleetCovered || !children?.length)
2768
- return [];
2769
- const lines = [];
2770
- const shown = orderedWidgetJobs(children).slice(0, MAX_WIDGET_JOBS);
2771
- for (const [index, child] of shown.entries()) {
2772
- const projection = projectionFor(child);
2773
- const last = index === children.length - 1;
2774
- const identity = child.workflowKey ?? child.asyncId;
2775
- const stats = widgetStats(child, theme, projection, !expanded);
2776
- lines.push(` ${last ? "└─" : "├─"} ${theme.bold(identity)} ${widgetStatusGlyph(child, theme, frame)} ${themeBold(theme, widgetJobName(child))}${contextModeBadge(theme, child.context)}${stats ? ` ${theme.fg("dim", "·")} ${stats}` : ""}`);
2777
- for (const detail of foregroundStyleWidgetDetails(child, theme, expanded, Math.max(0, width - 6), frame, projection))
2778
- lines.push(` ${last ? " " : "│ "}${detail}`);
2779
- for (const detail of materializedWidgetChildLines(child, theme, Math.max(0, width - 4), expanded, frame, projectionFor))
2780
- lines.push(` ${detail}`);
2781
- }
2782
- if (shown.length < children.length)
2783
- lines.push(` +${children.length - shown.length} more workflow children`);
2784
- return lines;
2785
- }
2786
- function buildWidgetComponent(jobs, ui, initiallyCollapsed = false, layout) {
2787
- return (tui, theme) => {
2788
- const container = new Container();
2789
- let cachedRenderWidth;
2790
- let cachedFrame;
2791
- let cachedExpanded;
2792
- let cachedLines;
2793
- let cachedCoverage = "[]";
2794
- let collapsed = initiallyCollapsed;
2795
- const invalidate = () => {
2796
- cachedLines = undefined;
2797
- resetWidgetLayoutSession();
2798
- tui.requestRender();
2799
- };
2800
- const invalidateCoverage = () => {
2801
- cachedLines = undefined;
2802
- tui.requestRender();
2803
- };
2804
- asyncWidgetInvalidations.set(ui, invalidateCoverage);
2805
- const update = (nextJobs) => {
2806
- jobs = nextJobs;
2807
- cachedLines = undefined;
2808
- tui.requestRender();
2809
- };
2810
- asyncWidgetUpdates.set(ui, update);
2811
- const component = Object.assign(container, {
2812
- // Only the mouse fields used here, without requiring newer Pi type exports.
2813
- handleMouse(event) {
2814
- if (event.type !== "click" || event.button !== "left" || event.y !== 0)
2815
- return undefined;
2816
- if (event.shift || event.alt || event.ctrl)
2817
- return undefined;
2818
- collapsed = !collapsed;
2819
- invalidate();
2820
- return { handled: true };
2821
- },
2822
- dispose() {
2823
- if (asyncWidgetUpdates.get(ui) === update)
2824
- asyncWidgetUpdates.delete(ui);
2825
- if (asyncWidgetInvalidations.get(ui) === invalidateCoverage)
2826
- asyncWidgetInvalidations.delete(ui);
2827
- },
2828
- });
2829
- container.render = (renderWidth) => {
2830
- const now = Date.now();
2831
- const frame = Math.floor(now / WIDGET_ANIMATION_INTERVAL_MS);
2832
- const expanded = ui.getToolsExpanded?.() ?? false;
2833
- const coverage = inlineWorkflowCoverage.get(ui);
2834
- const covered = new Set();
2835
- if (coverage?.size) {
2836
- const childrenByParent = new Map();
2837
- for (const child of jobs) {
2838
- if (!child.parentWorkflowRunId)
2839
- continue;
2840
- const children = childrenByParent.get(child.parentWorkflowRunId) ?? [];
2841
- children.push(child);
2842
- childrenByParent.set(child.parentWorkflowRunId, children);
2843
- }
2844
- for (const job of jobs) {
2845
- const snapshot = coverage.get(job.asyncId);
2846
- if (snapshot === undefined)
2847
- continue;
2848
- const children = childrenByParent.get(job.asyncId) ?? [];
2849
- if (!children.some((child) => childrenByParent.has(child.asyncId))
2850
- && snapshot === inlineWorkflowRenderKey(job, children))
2851
- covered.add(job.asyncId);
2852
- }
2853
- }
2854
- const coverageKey = JSON.stringify([...covered]);
2855
- if (cachedLines && cachedRenderWidth === renderWidth && cachedFrame === frame && cachedExpanded === expanded && cachedCoverage === coverageKey)
2856
- return cachedLines;
2857
- if (cachedCoverage !== coverageKey)
2858
- resetWidgetLayoutSession();
2859
- cachedCoverage = coverageKey;
2860
- const width = Math.max(0, renderWidth - 2);
2861
- const { roots, projectionFor } = widgetJobTree(jobs, now);
2862
- for (const job of roots)
2863
- projectionFor(job).inlineFleetCovered = covered.has(job.asyncId);
2864
- const buildLines = () => expanded
2865
- ? buildWidgetLinesWithProjection(roots, theme, width, true, frame, projectionFor)
2866
- : roots.length === 1 && !projectionFor(roots[0]).children?.length
2867
- ? compactSingleWidgetLines(roots[0], theme, width, frame, projectionFor(roots[0]))
2868
- : buildWidgetLinesWithProjection(roots, theme, width, false, frame, projectionFor);
2869
- cachedRenderWidth = renderWidth;
2870
- cachedFrame = frame;
2871
- cachedExpanded = expanded;
2872
- cachedLines = (collapsed
2873
- ? buildSingleLineWidgetLines(jobs, theme, width, frame)
2874
- : fitAdaptiveWidgetLines(roots, buildLines, theme, width, expanded, frame, projectionFor, layout)).map((line) => paddedWidgetLine(line, renderWidth));
2875
- return cachedLines;
2876
- };
2877
- return component;
2878
- };
2879
- }
2880
- function buildWidgetLinesWithProjection(jobs, theme, width = getTermWidth(), expanded = false, frame, projectionFor = workflowWidgetProjectionLookup()) {
2881
- if (jobs.length === 0)
2882
- return [];
2883
- if (jobs.length === 1)
2884
- return [
2885
- ...buildSingleWidgetLines(jobs[0], theme, width, expanded, frame, projectionFor(jobs[0])),
2886
- ...materializedWidgetChildLines(jobs[0], theme, width, expanded, frame, projectionFor).map((line) => truncLine(line, width)),
2887
- ];
2888
- const running = jobs.filter((job) => job.status === "running");
2889
- const queued = jobs.filter((job) => job.status === "queued");
2890
- const finished = jobs.filter((job) => job.status !== "running" && job.status !== "queued");
2891
- const lines = [];
2892
- const hasActive = running.length > 0 || queued.length > 0;
2893
- const headerGlyph = running.length > 0 ? runningGlyph(animatedSeed(widgetJobsRunningSeed(running), frame)) : hasActive ? "●" : "○";
2894
- const tone = activeHeaderTone(theme, hasActive);
2895
- lines.push(truncLine(`${tone(headerGlyph)} ${tone("Async agents")} ${theme.fg("dim", "· background")}`, width));
2896
- const items = [];
2897
- let hiddenRunning = 0;
2898
- let hiddenFinished = 0;
2899
- let queuedSummaryShown = false;
2900
- let slots = MAX_WIDGET_JOBS;
2901
- const appendJob = (job) => {
2902
- const projection = projectionFor(job);
2903
- const compactWorkflow = (!expanded || projection.inlineFleetCovered) && job.mode === "workflow";
2904
- const stats = compactWorkflow ? "" : widgetStats(job, theme, projection, !expanded);
2905
- const details = compactWorkflow
2906
- ? [
2907
- ...compactWorkflowWidgetBodyLines(job, theme, frame, projection),
2908
- ]
2909
- : [
2910
- ` ${theme.fg("dim", `⎿ ${widgetActivity(job)}`)}`,
2911
- ...widgetLaneDetailLines(job, theme, projection),
2912
- ...workflowChecklistWidgetLines(widgetChecklistWithoutMaterializedChildren(projection), theme, " ", expanded, frame, { includeItemErrors: !expanded || !job.steps?.length }),
2913
- ...widgetParallelAgentDetails(job, theme, expanded, width, frame),
2914
- ];
2915
- items.push([
2916
- compactWorkflow
2917
- ? compactWorkflowHeaderLine(job, theme, width)
2918
- : `${widgetStatusGlyph(job, theme, frame)} ${themeBold(theme, widgetJobName(job))}${contextModeBadge(theme, job.context)}${stats ? ` ${theme.fg("dim", "·")} ${stats}` : ""}`,
2919
- ...details,
2920
- ...materializedWidgetChildLines(job, theme, width, expanded, frame, projectionFor),
2921
- ]);
2922
- };
2923
- for (const job of running) {
2924
- if (slots <= 0) {
2925
- hiddenRunning++;
2926
- continue;
2927
- }
2928
- appendJob(job);
2929
- slots--;
2930
- }
2931
- if (queued.length > 0 && slots > 0) {
2932
- items.push([`${theme.fg("muted", "◦")} ${theme.fg("dim", `${queued.length} queued`)}`]);
2933
- queuedSummaryShown = true;
2934
- slots--;
2935
- }
2936
- for (const job of finished) {
2937
- if (slots <= 0) {
2938
- hiddenFinished++;
2939
- continue;
2940
- }
2941
- appendJob(job);
2942
- slots--;
2943
- }
2944
- const hiddenQueued = queued.length > 0 && !queuedSummaryShown ? queued.length : 0;
2945
- const hiddenTotal = hiddenRunning + hiddenFinished + hiddenQueued;
2946
- if (hiddenTotal > 0) {
2947
- const parts = [];
2948
- if (hiddenRunning > 0)
2949
- parts.push(`${hiddenRunning} running`);
2950
- if (hiddenQueued > 0)
2951
- parts.push(`${hiddenQueued} queued`);
2952
- if (hiddenFinished > 0)
2953
- parts.push(`${hiddenFinished} finished`);
2954
- items.push([theme.fg("dim", `+${hiddenTotal} more (${parts.join(", ")})`)]);
2955
- }
2956
- for (let i = 0; i < items.length; i++) {
2957
- const item = items[i];
2958
- const last = i === items.length - 1;
2959
- const branch = last ? "└─" : "├─";
2960
- const continuation = last ? " " : "│ ";
2961
- lines.push(truncLine(`${theme.fg("dim", branch)} ${item[0]}`, width));
2962
- for (const detail of item.slice(1)) {
2963
- lines.push(truncLine(`${theme.fg("dim", continuation)} ${detail}`, width));
2964
- }
2965
- }
2966
- return lines;
2967
- }
2968
- export function buildWidgetLines(jobs, theme, width = getTermWidth(), expanded = false, frame) {
2969
- const { roots, projectionFor } = widgetJobTree(jobs, Date.now());
2970
- return buildWidgetLinesWithProjection(roots, theme, width, expanded, frame, projectionFor);
2971
- }
2972
- /**
2973
- * Render the async jobs widget
2974
- */
2975
- export function renderWidget(ctx, jobs, initiallyCollapsed = false, layout = "adaptive") {
2976
- if (jobs.length === 0) {
2977
- resetWidgetLayoutSession();
2978
- asyncWidgetUpdates.delete(ctx.ui);
2979
- if (ctx.hasUI)
2980
- ctx.ui.setWidget(WIDGET_KEY, undefined);
2981
- return;
2982
- }
2983
- if (!ctx.hasUI)
2984
- return;
2985
- if (ctx.mode === "rpc") {
2986
- ctx.ui.setWidget(WIDGET_KEY, encodeAsyncStatusSnapshotWidget(jobs));
2987
- return;
2988
- }
2989
- // Pi replaces a widget by deleting and reinserting its key. Update the mounted
2990
- // component instead so progress cannot move it past other extensions' widgets.
2991
- const update = asyncWidgetUpdates.get(ctx.ui);
2992
- if (update)
2993
- update(jobs);
2994
- else
2995
- ctx.ui.setWidget(WIDGET_KEY, buildWidgetComponent(jobs, ctx.ui, initiallyCollapsed, layout));
2996
- }
2997
- function renderSingleCompact(d, r, theme, layout, frame, foregroundDetachShortcut) {
2998
- const output = r.truncation?.text || getSingleResultOutput(r);
2999
- const progress = r.progress || r.progressSummary;
3000
- const isRunning = isResultRunning(r);
3001
- const contextBadge = contextModeBadge(theme, r.context ?? d.context);
3002
- const stats = statJoin(theme, [
3003
- r.usage?.turns ? `⟳ ${r.usage.turns}` : "",
3004
- formatProgressStats(theme, progress),
3005
- ]);
3006
- const c = new Container();
3007
- const width = getTermWidth() - 4;
3008
- const detailIndent = mainWindowIndent(layout, 1);
3009
- const continuationIndent = mainWindowIndent(layout, 2) + (layout.horizontalSpacing > 0 ? " " : "");
3010
- const modelDisplay = modelThinkingBadge(theme, r.progress?.model ?? r.model, r.thinking ?? r.progress?.thinking);
3011
- c.addChild(new Text(truncLine(`${resultGlyph(r, output, theme, isRunning, undefined, frame)} ${theme.fg("toolTitle", theme.bold(foregroundSingleDisplayName(r)))}${modelDisplay}${contextBadge}${stats ? ` ${theme.fg("dim", "·")} ${stats}` : ""}`, width), 0, 0));
3012
- if (isRunning && r.progress) {
3013
- const task = compactTaskText(r.task);
3014
- if (task)
3015
- c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}task: ${task}`), width), 0, 0));
3016
- const progressSnapshotNow = snapshotNowForProgress(r.progress);
3017
- const activity = compactCurrentActivity(r.progress);
3018
- c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}⎿ ${activity}`), width), 0, 0));
3019
- const liveStatus = buildLiveStatusLine(r.progress, progressSnapshotNow);
3020
- if (liveStatus && liveStatus !== activity)
3021
- c.addChild(new Text(truncLine(theme.fg("dim", `${continuationIndent}${liveStatus}`), width), 0, 0));
3022
- for (const nestedLine of formatNestedWidgetLines(r.children, theme, width, false, progressSnapshotNow)) {
3023
- c.addChild(new Text(truncLine(`${detailIndent}${nestedLine}`, width), 0, 0));
3024
- }
3025
- c.addChild(new Text(truncLine(theme.fg("accent", `${detailIndent}${foregroundSingleHintText(foregroundDetachShortcut)}`), width), 0, 0));
3026
- if (r.artifactPaths)
3027
- c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}output: ${shortenPath(r.artifactPaths.outputPath)}`), width), 0, 0));
3028
- return c;
3029
- }
3030
- for (const nestedLine of formatNestedWidgetLines(r.children, theme, width, false, r.progress?.lastActivityAt)) {
3031
- c.addChild(new Text(truncLine(`${detailIndent}${nestedLine}`, width), 0, 0));
3032
- }
3033
- c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}⎿ ${resultStatusLine(r, output)}`), width), 0, 0));
3034
- const preview = firstOutputLine(output);
3035
- if (preview && r.exitCode === 0 && !hasEmptyTextOutputWithoutOutputTarget(r.task, output)) {
3036
- c.addChild(new Text(truncLine(theme.fg("dim", `${continuationIndent}${preview}`), width), 0, 0));
3037
- }
3038
- if (r.sessionFile)
3039
- c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}session: ${shortenPath(r.sessionFile)}`), width), 0, 0));
3040
- if (r.artifactPaths)
3041
- c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}output: ${shortenPath(r.artifactPaths.outputPath)}`), width), 0, 0));
3042
- if (r.truncation?.artifactPath)
3043
- c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}full output: ${shortenPath(r.truncation.artifactPath)}`), width), 0, 0));
3044
- return c;
3045
- }
3046
- function workflowRowGlyph(row, theme, frame, thinking) {
3047
- if (row.state === "planned")
3048
- return theme.fg("muted", "◦");
3049
- if (row.state === "running")
3050
- return runningTone(theme, thinking)(runningGlyph(frame));
3051
- if (row.state === "complete")
3052
- return theme.fg("success", "✓");
3053
- if (row.state === "detached" || row.state === "stopped")
3054
- return theme.fg("warning", "■");
3055
- return theme.fg("error", "✗");
3056
- }
3057
- function workflowRowStateLabel(row, theme, thinking) {
3058
- const label = (row.state === "complete" ? "complete" : row.state).padEnd(8);
3059
- if (row.state === "planned")
3060
- return theme.fg("dim", label);
3061
- if (row.state === "running")
3062
- return runningTone(theme, thinking)(label);
3063
- if (row.state === "complete")
3064
- return theme.fg("success", label);
3065
- if (row.state === "detached" || row.state === "stopped")
3066
- return theme.fg("warning", label);
3067
- return theme.fg("error", label);
3068
- }
3069
- function workflowOverallState(rows, hasTerminalValue, isError) {
3070
- if (rows.some((row) => row.state === "failed"))
3071
- return "failed";
3072
- if (rows.some((row) => row.state === "detached"))
3073
- return "paused";
3074
- if (isError)
3075
- return "failed";
3076
- if ((rows.length > 0 && rows.every((row) => row.state === "complete")) || hasTerminalValue)
3077
- return "complete";
3078
- return "running";
3079
- }
3080
- function foregroundWorkflowChecklist(details) {
3081
- if (details.mode !== "workflow")
3082
- return undefined;
3083
- const stageNodes = details.workflowGraph ? workflowGraphStageNodes(details.workflowGraph) : [];
3084
- const steps = details.results.flatMap((result, resultIndex) => {
3085
- const stableIndex = foregroundResultIndex(details, resultIndex);
3086
- const workflowKey = result.workflowKey;
3087
- if (details.workflowGraph && typeof workflowKey !== "string")
3088
- return [];
3089
- const node = typeof workflowKey === "string"
3090
- ? stageNodes.find((candidate) => candidate.id === workflowKey)
3091
- : undefined;
3092
- const progress = foregroundProgressForResult(details, resultIndex);
3093
- const status = isResultRunning(result) || progress?.status === "running"
3094
- ? "running"
3095
- : result.detached
3096
- ? "paused"
3097
- : result.stopped
3098
- ? "stopped"
3099
- : result.exitCode === 0
3100
- ? "complete"
3101
- : "failed";
3102
- return [{
3103
- key: node?.id ?? (typeof workflowKey === "string" ? workflowKey : `result-${resultIndex + 1}`),
3104
- label: node?.label ?? workflowLabelForResult(details, resultIndex) ?? result.task ?? result.agent,
3105
- phase: node?.phase,
3106
- agent: result.agent,
3107
- thinking: result.thinking ?? progress?.thinking,
3108
- status,
3109
- context: result.context,
3110
- activityState: progress?.activityState,
3111
- startedAt: progress?.lastActivityAt !== undefined && progress.durationMs !== undefined ? progress.lastActivityAt - progress.durationMs : undefined,
3112
- durationMs: progress?.durationMs,
3113
- currentTool: progress?.currentTool,
3114
- currentToolStartedAt: progress?.currentToolStartedAt,
3115
- currentPath: progress?.currentPath,
3116
- turnCount: progress?.turnCount,
3117
- toolCount: progress?.toolCount ?? result.progressSummary?.toolCount,
3118
- error: result.error,
3119
- toolBudgetBlocked: result.toolBudgetBlocked,
3120
- turnBudgetExceeded: result.turnBudgetExceeded,
3121
- timedOut: result.timedOut,
3122
- stopped: result.stopped,
3123
- acceptance: result.acceptance ? { status: result.acceptance.status, reviewResult: result.acceptance.reviewResult ? { status: result.acceptance.reviewResult.status } : undefined } : undefined,
3124
- review: result.review ? { status: result.review.status } : undefined,
3125
- watchdog: result.watchdog,
3126
- }];
3127
- });
3128
- const checklist = projectWorkflowChecklist({
3129
- graph: details.workflowGraph,
3130
- steps,
3131
- hostSteps: details.workflow?.receipt?.hostSteps,
3132
- preflight: details.preflight,
3133
- trace: details.workflow?.trace,
3134
- now: Date.now(),
3135
- });
3136
- return checklist.total > 0 ? checklist : undefined;
3137
- }
3138
- function renderWorkflowChatProgress(d, result, theme, layout, frame, expanded = false) {
3139
- const workflow = d.workflow;
3140
- const rows = workflow ? buildWorkflowChatProgressRows(workflow.trace, d.preflight) : d.preflight ? buildWorkflowChatProgressRows([], d.preflight) : [];
3141
- const state = workflowOverallState(rows, workflow?.value !== undefined, result.isError);
3142
- const glyph = state === "running" ? runningTone(theme)(runningGlyph(frame)) : state === "complete" ? theme.fg("success", "✓") : state === "paused" ? theme.fg("warning", "■") : theme.fg("error", "✗");
3143
- const width = getTermWidth() - 4;
3144
- const runId = d.runId ? d.runId.slice(0, 12) : "workflow";
3145
- const repoLabel = d.chatProgress?.repoLabel ?? (d.chatProgress?.repoRelation === "same" ? "same repo" : "other repo");
3146
- const phase = rows.find((row) => row.state === "running" && row.phase)?.phase ?? [...rows].reverse().find((row) => row.phase)?.phase;
3147
- const c = new Container();
3148
- const rowIndent = mainWindowIndent(layout, 1);
3149
- c.addChild(new Text(truncLine(`${glyph} ${theme.fg("toolTitle", theme.bold("workflow"))} ${runId} ${theme.fg("dim", "·")} ${d.chatProgress?.repoRelation === "same" ? "same repo" : "other repo"} ${theme.fg("dim", "·")} ${state}`, width), 0, 0));
3150
- c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}Repo ${repoLabel}`), width), 0, 0));
3151
- if (d.preflight)
3152
- c.addChild(new Text(truncLine(theme.fg("dim", formatWorkflowPreflightPlanSummary(d.preflight, { indent: rowIndent })), width), 0, 0));
3153
- if (phase)
3154
- c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}Phase ${phase}`), width), 0, 0));
3155
- const checklist = projectWorkflowChecklist({ hostSteps: workflow?.receipt?.hostSteps, preflight: d.preflight, trace: workflow?.trace, now: Date.now() });
3156
- for (const line of workflowChecklistWidgetLines(checklist, theme, rowIndent, false, frame, { limitPhases: !expanded, includeBottleneckOutput: expanded })) {
3157
- c.addChild(new Text(truncLine(line, width), 0, 0));
3158
- }
3159
- if (rows.length === 0) {
3160
- c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}◦ waiting for workflow child launches`), width), 0, 0));
3161
- return c;
3162
- }
3163
- const visible = visibleWorkflowRows(rows);
3164
- if (visible.hiddenRows > 0)
3165
- c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}… ${visible.hiddenRows} older workflow rows hidden`), width), 0, 0));
3166
- const childLevels = new Map((d.workflowChildren?.children ?? []).map((child) => [child.childId, childThinkingLevel(child)]));
3167
- for (const row of visible.rows) {
3168
- const thinking = childLevels.get(row.key);
3169
- const status = workflowRowStateLabel(row, theme, thinking);
3170
- const label = row.label && row.label !== row.key ? ` ${oneLine(row.label)}` : "";
3171
- const duration = row.durationMs !== undefined ? ` ${theme.fg("dim", `· ${formatDuration(row.durationMs)}`)}` : "";
3172
- const run = row.runId ? ` ${theme.fg("dim", `[${row.runId.slice(0, 8)}]`)}` : "";
3173
- const error = row.error ? ` ${theme.fg(row.state === "detached" ? "warning" : "error", `· ${compactWorkflowError(row.error)}`)}` : "";
3174
- const hints = expanded && row.preflight ? [
3175
- row.preflight.mode ? `mode:${row.preflight.mode}` : undefined,
3176
- row.preflight.decision ? `decision:${row.preflight.decision}` : undefined,
3177
- row.preflight.claims?.length ? `claims:${row.preflight.claims.join(",")}` : undefined,
3178
- row.preflight.expectedOutput ? `expected:${row.preflight.expectedOutput}` : undefined,
3179
- row.preflight.independence ? `independence:${row.preflight.independence}` : undefined,
3180
- ].filter((value) => Boolean(value)).join(" · ") : "";
3181
- c.addChild(new Text(truncLine(`${rowIndent}${workflowRowGlyph(row, theme, frame, thinking)} ${status} ${theme.bold(row.key)}${label}${run}${duration}${error}${hints ? ` ${theme.fg("dim", `· ${hints}`)}` : ""}`, width), 0, 0));
3182
- }
3183
- if (workflow?.preflightWarnings?.length) {
3184
- const warningLines = expanded
3185
- ? formatWorkflowPreflightWarnings(workflow.preflightWarnings, { indent: rowIndent }).split("\n")
3186
- : [formatWorkflowPreflightWarningSummary(workflow.preflightWarnings, { indent: rowIndent, hint: "expand for debug" })];
3187
- for (const warningLine of warningLines)
3188
- c.addChild(new Text(truncLine(theme.fg("warning", warningLine), width), 0, 0));
3189
- }
3190
- if (workflow?.emits.length)
3191
- c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}Emits ${workflow.emits.length}`), width), 0, 0));
3192
- return c;
3193
- }
3194
- function renderMultiCompact(d, theme, layout, frame) {
3195
- const hasRunning = detailsHaveRunningResult(d);
3196
- const detached = d.results.some((r) => r.detached)
3197
- || workflowGraphHasStatus(d, ["detached"]);
3198
- const stopped = d.results.some((r) => r.stopped)
3199
- || workflowGraphHasStatus(d, ["stopped"]);
3200
- const failed = d.results.some((r) => !hasTerminalResultFlag(r) && r.exitCode !== 0 && !isResultRunning(r))
3201
- || workflowGraphHasStatus(d, ["failed"]);
3202
- const paused = d.results.some((r) => r.interrupted)
3203
- || workflowGraphHasStatus(d, ["paused"]);
3204
- const partial = workflowGraphHasStatus(d, ["partial"]);
3205
- let totalSummary = d.progressSummary;
3206
- if (!totalSummary) {
3207
- let sawProgress = false;
3208
- const summary = { toolCount: 0, tokens: 0, durationMs: 0 };
3209
- for (const r of d.results) {
3210
- const prog = r.progress || r.progressSummary;
3211
- if (!prog)
3212
- continue;
3213
- sawProgress = true;
3214
- summary.toolCount += prog.toolCount;
3215
- summary.tokens += prog.tokens;
3216
- summary.durationMs = d.mode === "chain" ? summary.durationMs + prog.durationMs : Math.max(summary.durationMs, prog.durationMs);
3217
- }
3218
- if (sawProgress)
3219
- totalSummary = summary;
3220
- }
3221
- const multiLabel = buildMultiProgressLabel(d, hasRunning);
3222
- const itemTitle = multiLabel.itemTitle;
3223
- const workflowChecklist = foregroundWorkflowChecklist(d);
3224
- const checklistPrimary = d.mode === "workflow" && workflowChecklist !== undefined;
3225
- const stats = statJoin(theme, [checklistPrimary ? formatWorkflowChecklistSummary(workflowChecklist) : multiLabel.headerLabel, formatProgressStats(theme, totalSummary), formatTotalCostStat(d.totalCost)]);
3226
- const aggregatePresentation = semanticResultPresentation({
3227
- running: hasRunning,
3228
- detached,
3229
- stopped,
3230
- interrupted: paused,
3231
- failed,
3232
- partial,
3233
- seed: runningSeed(progressRunningSeed(totalSummary), d.currentStepIndex),
3234
- frame,
3235
- });
3236
- const glyph = presentationTone(aggregatePresentation, theme)(aggregatePresentation.glyph);
3237
- const contextBadge = contextModeBadge(theme, d.context);
3238
- const c = new Container();
3239
- const width = getTermWidth() - 4;
3240
- const rowIndent = mainWindowIndent(layout, 1);
3241
- const detailIndent = mainWindowIndent(layout, 2);
3242
- c.addChild(new Text(truncLine(`${glyph} ${theme.fg("toolTitle", theme.bold(d.mode))}${contextBadge}${stats ? ` ${theme.fg("dim", "·")} ${stats}` : ""}`, width), 0, 0));
3243
- if (checklistPrimary) {
3244
- for (const line of workflowChecklistWidgetLines(workflowChecklist, theme, rowIndent, false, frame, { includeSummary: false })) {
3245
- c.addChild(new Text(truncLine(line, width), 0, 0));
3246
- }
3247
- if (hasRunning || workflowChecklist.running > 0)
3248
- c.addChild(new Text(truncLine(theme.fg("accent", `${rowIndent}${liveDetailHintText()}`), width), 0, 0));
3249
- return c;
3250
- }
3251
- for (const line of workflowChecklistWidgetLines(workflowChecklist, theme, rowIndent, false, frame)) {
3252
- c.addChild(new Text(truncLine(line, width), 0, 0));
3253
- }
3254
- const useResultsDirectly = multiLabel.hasParallelInChain || !d.chainAgents?.length;
3255
- const displayStart = multiLabel.showActiveGroupOnly ? multiLabel.groupStartIndex : 0;
3256
- const displayEnd = multiLabel.showActiveGroupOnly ? multiLabel.groupEndIndex : (useResultsDirectly ? d.results.length : d.chainAgents.length);
3257
- const chainEntries = buildChainRenderEntries(d, multiLabel);
3258
- const renderEntries = chainEntries ?? buildForegroundResultEntries(d, multiLabel, displayStart, displayEnd, useResultsDirectly);
3259
- for (const entry of renderEntries) {
3260
- if (entry.kind === "group") {
3261
- const glyph = widgetStepGlyph(entry.status, theme);
3262
- const statusLabel = widgetStepStatus(entry.status, theme);
3263
- const groupLabel = entry.groupLabel ? ` (${compactTaskText(undefined, entry.groupLabel) ?? entry.groupLabel})` : "";
3264
- c.addChild(new Text(truncLine(`${rowIndent}${glyph} ${entry.stepLabel}${groupLabel} ${theme.fg("dim", "·")} ${statusLabel}`, width), 0, 0));
3265
- if (entry.error)
3266
- c.addChild(new Text(truncLine(theme.fg("error", `${detailIndent}⎿ Error: ${entry.error}`), width), 0, 0));
3267
- continue;
3268
- }
3269
- const i = entry.resultIndex;
3270
- const r = d.results[i];
3271
- const rowNumber = entry.rowNumber;
3272
- const agentName = entry.agentName;
3273
- if (!r) {
3274
- const pendingLabel = entry.rowLabel ?? (entry.isParallel ? "" : `${itemTitle} ${rowNumber}`);
3275
- const labelPrefix = pendingLabel ? `${pendingLabel}: ` : "";
3276
- c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}◦ ${labelPrefix}${agentName} · pending`), width), 0, 0));
3277
- continue;
3278
- }
3279
- const output = getSingleResultOutput(r);
3280
- const progressFromArray = foregroundProgressForResult(d, i);
3281
- const rProg = r.progress || progressFromArray || r.progressSummary;
3282
- const rRunning = rProg && "status" in rProg && isResultRunning(r, rProg.status);
3283
- const rPending = rProg && "status" in rProg && rProg.status === "pending";
3284
- const stepStats = formatProgressStats(theme, rProg);
3285
- const glyph = rPending ? theme.fg("dim", "◦") : resultGlyph(r, output, theme, rRunning, progressRunningSeed(rProg), frame);
3286
- const pendingLabel = rPending ? ` ${theme.fg("dim", "· pending")}` : "";
3287
- const stepLabel = entry.rowLabel;
3288
- const rowProgressModel = rProg && "status" in rProg ? rProg : undefined;
3289
- const rowModelDisplay = modelThinkingBadge(theme, rowProgressModel?.model ?? r.model, r.thinking ?? rowProgressModel?.thinking);
3290
- const labelPrefix = stepLabel ? `${stepLabel}: ` : "";
3291
- const line = `${glyph} ${labelPrefix}${themeBold(theme, agentName)}${contextModeBadge(theme, r.context)}${rowModelDisplay}${stepStats ? ` ${theme.fg("dim", "·")} ${stepStats}` : ""}${pendingLabel}`;
3292
- c.addChild(new Text(truncLine(`${rowIndent}${line}`, width), 0, 0));
3293
- if (rRunning || rPending) {
3294
- const task = compactTaskText(r.task, workflowLabelForResult(d, i));
3295
- if (task)
3296
- c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}task: ${task}`), width), 0, 0));
3297
- }
3298
- if (rRunning && rProg && "status" in rProg) {
3299
- const liveProgress = rProg;
3300
- const activity = compactCurrentActivity(liveProgress);
3301
- c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}⎿ ${activity}`), width), 0, 0));
3302
- for (const nestedLine of formatNestedWidgetLines(r.children, theme, width, false, snapshotNowForProgress(liveProgress))) {
3303
- c.addChild(new Text(truncLine(`${detailIndent}${nestedLine}`, width), 0, 0));
3304
- }
3305
- c.addChild(new Text(truncLine(theme.fg("accent", `${detailIndent}${liveDetailHintText()}`), width), 0, 0));
3306
- }
3307
- else if (!rPending && (r.exitCode !== 0 || r.interrupted || r.detached || hasEmptyTextOutputWithoutOutputTarget(r.task, output))) {
3308
- c.addChild(new Text(truncLine(theme.fg(r.exitCode !== 0 ? "error" : "dim", `${detailIndent}⎿ ${resultStatusLine(r, output)}`), width), 0, 0));
3309
- }
3310
- if (!rRunning && !rPending) {
3311
- for (const nestedLine of formatNestedWidgetLines(r.children, theme, width, false, r.progress?.lastActivityAt)) {
3312
- c.addChild(new Text(truncLine(`${detailIndent}${nestedLine}`, width), 0, 0));
3313
- }
3314
- }
3315
- const outputTarget = extractOutputTarget(r.task);
3316
- if (outputTarget)
3317
- c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}output: ${outputTarget}`), width), 0, 0));
3318
- if (r.artifactPaths)
3319
- c.addChild(new Text(truncLine(theme.fg("dim", `${detailIndent}output: ${shortenPath(r.artifactPaths.outputPath)}`), width), 0, 0));
3320
- }
3321
- if (d.artifacts)
3322
- c.addChild(new Text(truncLine(theme.fg("dim", `${rowIndent}artifacts: ${shortenPath(d.artifacts.dir)}`), width), 0, 0));
3323
- return c;
3324
- }
3325
- export function renderSubagentSummary(result, options, theme) {
3326
- const details = result.details;
3327
- const results = details?.results ?? [];
3328
- const hasSingleTerminalResult = results.length === 1 && hasTerminalResult(results[0]);
3329
- const hasOnlyTerminalResults = results.length > 0 && results.every(hasTerminalResult);
3330
- const running = !hasSingleTerminalResult && !hasOnlyTerminalResults && (options.isPartial === true
3331
- || Boolean(details?.asyncId && details.mode !== "management")
3332
- || Boolean(details && detailsHaveRunningResult(details)));
3333
- const stopped = results.some((entry) => entry.stopped)
3334
- || Boolean(details && workflowGraphHasStatus(details, ["stopped"]));
3335
- const paused = results.some((entry) => entry.interrupted || entry.detached)
3336
- || Boolean(details && workflowGraphHasStatus(details, ["paused", "detached"]));
3337
- const failed = result.isError === true
3338
- || results.some((entry) => !hasTerminalResultFlag(entry) && entry.exitCode !== 0 && !isResultRunning(entry))
3339
- || Boolean(details && workflowGraphHasStatus(details, ["failed"]));
3340
- const partial = Boolean(details && workflowGraphHasStatus(details, ["partial"]));
3341
- const state = running ? "running" : failed ? "failed" : stopped ? "stopped" : paused ? "paused" : partial ? "partial" : "completed";
3342
- const glyph = state === "running"
3343
- ? runningTone(theme, details?.mode === "single" && results.length === 1 ? childThinkingLevel(results[0], results[0]?.progress) : undefined)(STATIC_RUNNING_GLYPH)
3344
- : state === "completed"
3345
- ? theme.fg("success", "✓")
3346
- : state === "failed"
3347
- ? theme.fg("error", "✗")
3348
- : theme.fg("warning", "■");
3349
- const label = details?.mode === "single" && results.length === 1
3350
- ? foregroundSingleDisplayName(results[0])
3351
- : details?.mode || "subagent";
3352
- return new Text(truncLine(`${glyph} ${theme.fg("toolTitle", theme.bold(label))} ${theme.fg("dim", "·")} ${theme.fg(state === "failed" ? "error" : state === "completed" ? "success" : state === "running" ? "accent" : "warning", state)}`, getTermWidth() - 4), 0, 0);
3353
- }
3354
- /**
3355
- * Render a subagent result
3356
- */
3357
- export function renderSubagentResult(result, options, theme, frame, rendererConfig, foregroundDetachShortcut) {
3358
- const layout = resolveMainWindowRenderLayout(rendererConfig);
3359
- const compact = (component) => capCompactMainWindowResult(component, layout, theme, !options.expanded);
3360
- const d = result.details;
3361
- if (d?.mode === "workflow" && d.chatProgress?.mode === "live-card" && d.workflow?.value === undefined && (!result.isError || (d.workflow?.trace.length ?? 0) > 0)) {
3362
- return compact(renderWorkflowChatProgress(d, result, theme, options.expanded ? resolveMainWindowRenderLayout() : layout, frame, options.expanded));
3363
- }
3364
- if (!d || !d.results.length) {
3365
- const t = result.content[0];
3366
- const text = t?.type === "text" ? t.text : "(no output)";
3367
- const contextPrefix = contextModePrefix(theme, d?.context);
3368
- const width = getTermWidth() - 4;
3369
- if (!text.includes("\n"))
3370
- return compact(new Text(truncLine(`${contextPrefix}${text}`, width), 0, 0));
3371
- if (d && !options.expanded && !result.isError) {
3372
- const lines = text.split(/\r?\n/);
3373
- const firstNonEmptyLine = lines.find((line) => line.trim())?.trim() || "(no output)";
3374
- const compactLine = d.mode === "workflow" && d.preflight
3375
- ? formatWorkflowPreflightPlanSummary(d.preflight)
3376
- : firstNonEmptyLine;
3377
- const c = new Container();
3378
- const detailIndent = mainWindowIndent(layout, 1);
3379
- c.addChild(new Text(truncLine(`${contextPrefix}${compactLine} · ${lines.length} lines`, width), 0, 0));
3380
- c.addChild(new Text(truncLine(theme.fg("accent", `${detailIndent}${expandKeyHint("for full output")}`), width), 0, 0));
3381
- return compact(c);
3382
- }
3383
- const c = new Container();
3384
- const wrapped = wrapPlainText(`${contextPrefix}${text}`, width);
3385
- for (const line of wrapped)
3386
- c.addChild(new Text(line, 0, 0));
3387
- return c;
3388
- }
3389
- const expanded = options.expanded;
3390
- const mdTheme = getMarkdownTheme();
3391
- if (d.mode === "single" && d.results.length === 1) {
3392
- const r = d.results[0];
3393
- const detachableShortcut = d.asyncId || d.background ? undefined : foregroundDetachShortcut;
3394
- if (!r)
3395
- return compact(renderMultiCompact(d, theme, layout, frame));
3396
- if (!expanded)
3397
- return compact(renderSingleCompact(d, r, theme, layout, frame, detachableShortcut));
3398
- const isRunning = isResultRunning(r);
3399
- const contextBadge = contextModeBadge(theme, r.context ?? d.context);
3400
- const output = r.truncation?.text || getSingleResultOutput(r);
3401
- const presentation = styledResultPresentation(resultPresentation(r, output, isRunning, undefined, frame), theme);
3402
- const progressInfo = isRunning && r.progress
3403
- ? ` | ${r.progress.toolCount} tools, ${formatTokens(r.progress.tokens)} tok, ${formatDuration(r.progress.durationMs)}`
3404
- : r.progressSummary
3405
- ? ` | ${r.progressSummary.toolCount} tools, ${formatTokens(r.progressSummary.tokens)} tok, ${formatDuration(r.progressSummary.durationMs)}`
3406
- : "";
3407
- const w = getTermWidth() - 4;
3408
- const fit = (text) => expanded ? text : truncLine(text, w);
3409
- const toolCallLines = getToolCallLines(r, expanded);
3410
- const c = new Container();
3411
- c.addChild(new Text(fit(`${presentation.glyph} ${theme.fg("toolTitle", theme.bold(foregroundSingleDisplayName(r)))}${contextBadge}${progressInfo} ${theme.fg("dim", "·")} ${presentation.label}`), 0, 0));
3412
- c.addChild(new Spacer(1));
3413
- const taskMaxLen = Math.max(20, w - 8);
3414
- const taskPreview = expanded || r.task.length <= taskMaxLen
3415
- ? r.task
3416
- : `${r.task.slice(0, taskMaxLen)}...`;
3417
- c.addChild(new Text(fit(theme.fg("dim", `Task: ${taskPreview}`)), 0, 0));
3418
- c.addChild(new Spacer(1));
3419
- if (!isRunning && (r.exitCode !== 0 || r.interrupted || r.detached || r.stopped)) {
3420
- c.addChild(new Text(fit(theme.fg(r.exitCode !== 0 ? "error" : "dim", ` ⎿ ${resultStatusLine(r, output)}`)), 0, 0));
3421
- }
3422
- if (isRunning && r.progress) {
3423
- const progressSnapshotNow = snapshotNowForProgress(r.progress);
3424
- for (const nestedLine of formatNestedWidgetLines(r.children, theme, w, true, progressSnapshotNow, 12)) {
3425
- c.addChild(new Text(fit(` ${nestedLine}`), 0, 0));
3426
- }
3427
- const toolLine = formatCurrentToolLine(r.progress, w, expanded, progressSnapshotNow);
3428
- if (toolLine) {
3429
- c.addChild(new Text(fit(theme.fg("warning", `> ${toolLine}`)), 0, 0));
3430
- }
3431
- const liveStatusLine = buildLiveStatusLine(r.progress, progressSnapshotNow);
3432
- if (liveStatusLine) {
3433
- c.addChild(new Text(fit(theme.fg("accent", liveStatusLine)), 0, 0));
3434
- }
3435
- c.addChild(new Text(fit(theme.fg("accent", foregroundSingleHintText(detachableShortcut))), 0, 0));
3436
- if (r.artifactPaths) {
3437
- c.addChild(new Text(fit(theme.fg("dim", `Artifacts: ${shortenPath(r.artifactPaths.outputPath)}`)), 0, 0));
3438
- }
3439
- if (r.progress.recentTools?.length) {
3440
- for (const t of r.progress.recentTools.slice(-3)) {
3441
- const maxArgsLen = Math.max(40, w - 24);
3442
- const argsPreview = renderToolArgsPreview(t.args, maxArgsLen, expanded);
3443
- c.addChild(new Text(fit(theme.fg("dim", `${t.tool}: ${argsPreview}`)), 0, 0));
3444
- }
3445
- }
3446
- for (const line of compactRecentOutputLines(r.progress.recentOutput)) {
3447
- c.addChild(new Text(fit(theme.fg("dim", ` ${line}`)), 0, 0));
3448
- }
3449
- if (toolLine || liveStatusLine || r.progress.recentTools?.length || r.progress.recentOutput?.length || r.artifactPaths) {
3450
- c.addChild(new Spacer(1));
3451
- }
3452
- }
3453
- else {
3454
- for (const nestedLine of formatNestedWidgetLines(r.children, theme, w, true, r.progress?.lastActivityAt, 8)) {
3455
- c.addChild(new Text(fit(` ${nestedLine}`), 0, 0));
3456
- }
3457
- }
3458
- if (expanded) {
3459
- for (const line of toolCallLines) {
3460
- c.addChild(new Text(fit(theme.fg("muted", line)), 0, 0));
3461
- }
3462
- if (toolCallLines.length)
3463
- c.addChild(new Spacer(1));
3464
- }
3465
- if (output)
3466
- c.addChild(new Markdown(output, 0, 0, mdTheme));
3467
- c.addChild(new Spacer(1));
3468
- if (r.skills?.length) {
3469
- c.addChild(new Text(fit(theme.fg("dim", `Skills: ${r.skills.join(", ")}`)), 0, 0));
3470
- }
3471
- if (r.skillsWarning) {
3472
- c.addChild(new Text(fit(theme.fg("warning", `Warning: ${r.skillsWarning}`)), 0, 0));
3473
- }
3474
- c.addChild(new Text(fit(theme.fg("dim", formatUsage(r.usage, r.progress?.model ?? r.model))), 0, 0));
3475
- if (r.sessionFile) {
3476
- c.addChild(new Text(fit(theme.fg("dim", `Session: ${shortenPath(r.sessionFile)}`)), 0, 0));
3477
- }
3478
- if (!isRunning && r.artifactPaths) {
3479
- c.addChild(new Spacer(1));
3480
- c.addChild(new Text(fit(theme.fg("dim", `Artifacts: ${shortenPath(r.artifactPaths.outputPath)}`)), 0, 0));
3481
- }
3482
- return c;
3483
- }
3484
- if (!expanded)
3485
- return compact(renderMultiCompact(d, theme, layout, frame));
3486
- const hasRunning = detailsHaveRunningResult(d);
3487
- const detached = d.results.some((r) => r.detached)
3488
- || workflowGraphHasStatus(d, ["detached"]);
3489
- const stopped = d.results.some((r) => r.stopped)
3490
- || workflowGraphHasStatus(d, ["stopped"]);
3491
- const failed = d.results.some((r) => !hasTerminalResultFlag(r) && r.exitCode !== 0 && !isResultRunning(r))
3492
- || workflowGraphHasStatus(d, ["failed"]);
3493
- const paused = d.results.some((r) => r.interrupted)
3494
- || workflowGraphHasStatus(d, ["paused"]);
3495
- const partial = workflowGraphHasStatus(d, ["partial"]);
3496
- const completedWithoutOutput = d.results.some((r) => !hasTerminalResultFlag(r)
3497
- && r.exitCode === 0
3498
- && !isResultRunning(r)
3499
- && hasEmptyTextOutputWithoutOutputTarget(r.task, getSingleResultOutput(r)));
3500
- const presentation = styledResultPresentation(semanticResultPresentation({
3501
- running: hasRunning,
3502
- detached,
3503
- stopped,
3504
- interrupted: paused,
3505
- failed,
3506
- partial,
3507
- completedWithoutOutput,
3508
- frame,
3509
- }), theme);
3510
- const totalSummary = d.progressSummary ||
3511
- d.results.reduce((acc, r) => {
3512
- const prog = r.progress || r.progressSummary;
3513
- if (prog) {
3514
- acc.toolCount += prog.toolCount;
3515
- acc.tokens += prog.tokens;
3516
- acc.durationMs =
3517
- d.mode === "chain"
3518
- ? acc.durationMs + prog.durationMs
3519
- : Math.max(acc.durationMs, prog.durationMs);
3520
- }
3521
- return acc;
3522
- }, { toolCount: 0, tokens: 0, durationMs: 0 });
3523
- const summaryParts = [
3524
- totalSummary.toolCount || totalSummary.tokens
3525
- ? `${totalSummary.toolCount} tools, ${formatTokens(totalSummary.tokens)} tok, ${formatDuration(totalSummary.durationMs)}`
3526
- : "",
3527
- formatTotalCostStat(d.totalCost),
3528
- ].filter(Boolean);
3529
- const summaryStr = summaryParts.length ? ` | ${summaryParts.join(", ")}` : "";
3530
- const modeLabel = d.mode;
3531
- const contextBadge = contextModeBadge(theme, d.context);
3532
- const multiLabel = buildMultiProgressLabel(d, hasRunning);
3533
- const itemTitle = multiLabel.itemTitle;
3534
- const chainVis = d.chainAgents?.length && !multiLabel.hasParallelInChain
3535
- ? d.chainAgents
3536
- .map((agent, i) => {
3537
- const result = d.results[i];
3538
- const displayName = foregroundResultDisplayName(d, i, result, agent);
3539
- const isCurrent = i === (d.currentStepIndex ?? d.results.length);
3540
- const stepPresentation = result
3541
- ? styledResultPresentation(resultPresentation(result, getSingleResultOutput(result), isCurrent && hasRunning && !hasTerminalResultFlag(result)), theme)
3542
- : undefined;
3543
- const stepStatus = stepPresentation
3544
- ? `${stepPresentation.glyph} ${stepPresentation.label}`
3545
- : theme.fg("dim", "◦ pending");
3546
- return `${stepStatus} ${displayName}${contextModeBadge(theme, result?.context)}`;
3547
- })
3548
- .join(theme.fg("dim", " → "))
3549
- : null;
3550
- const w = getTermWidth() - 4;
3551
- const fit = (text) => expanded ? text : truncLine(text, w);
3552
- const c = new Container();
3553
- c.addChild(new Text(fit(`${presentation.glyph} ${theme.fg("toolTitle", theme.bold(modeLabel))}${contextBadge} · ${multiLabel.headerLabel}${summaryStr} ${theme.fg("dim", "·")} ${presentation.label}`), 0, 0));
3554
- if (chainVis) {
3555
- c.addChild(new Text(fit(` ${chainVis}`), 0, 0));
3556
- }
3557
- const workflowChecklist = foregroundWorkflowChecklist(d);
3558
- for (const line of workflowChecklistWidgetLines(workflowChecklist, theme, " ", true, frame, { includeItemErrors: false })) {
3559
- c.addChild(new Text(fit(line), 0, 0));
3560
- }
3561
- const useResultsDirectly = multiLabel.hasParallelInChain || !d.chainAgents?.length;
3562
- const displayStart = multiLabel.showActiveGroupOnly ? multiLabel.groupStartIndex : 0;
3563
- const displayEnd = multiLabel.showActiveGroupOnly ? multiLabel.groupEndIndex : (useResultsDirectly ? d.results.length : d.chainAgents.length);
3564
- const chainEntries = buildChainRenderEntries(d, multiLabel);
3565
- const renderEntries = chainEntries ?? buildForegroundResultEntries(d, multiLabel, displayStart, displayEnd, useResultsDirectly);
3566
- c.addChild(new Spacer(1));
3567
- for (const entry of renderEntries) {
3568
- if (entry.kind === "group") {
3569
- const statusLabel = widgetStepStatus(entry.status, theme);
3570
- const groupLabel = entry.groupLabel ? ` (${compactTaskText(undefined, entry.groupLabel) ?? entry.groupLabel})` : "";
3571
- c.addChild(new Text(fit(` ${statusLabel} ${entry.stepLabel}${groupLabel}`), 0, 0));
3572
- c.addChild(new Text(theme.fg(entry.status === "failed" ? "error" : "dim", ` status: ${entry.status}`), 0, 0));
3573
- if (entry.error)
3574
- c.addChild(new Text(theme.fg("error", ` error: ${entry.error}`), 0, 0));
3575
- c.addChild(new Spacer(1));
3576
- continue;
3577
- }
3578
- const i = entry.resultIndex;
3579
- const r = d.results[i];
3580
- const rowNumber = entry.rowNumber;
3581
- const agentName = entry.agentName;
3582
- if (!r) {
3583
- const pendingLabel = entry.rowLabel ?? (entry.isParallel ? "" : `${itemTitle} ${rowNumber}`);
3584
- const labelPrefix = pendingLabel ? `${pendingLabel}: ` : "";
3585
- c.addChild(new Text(fit(theme.fg("dim", ` ${labelPrefix}${agentName}`)), 0, 0));
3586
- c.addChild(new Text(theme.fg("dim", ` status: pending`), 0, 0));
3587
- c.addChild(new Spacer(1));
3588
- continue;
3589
- }
3590
- const progressFromArray = foregroundProgressForResult(d, i);
3591
- const rProg = r.progress || progressFromArray || r.progressSummary;
3592
- const rRunning = isResultRunning(r, rProg?.status);
3593
- const resultOutput = getSingleResultOutput(r);
3594
- const rowPresentation = styledResultPresentation(resultPresentation(r, resultOutput, rRunning, progressRunningSeed(rProg), frame), theme);
3595
- const stats = rProg ? ` | ${rProg.toolCount} tools, ${formatDuration(rProg.durationMs)}` : "";
3596
- const modelDisplay = modelThinkingBadge(theme, rProg?.model ?? r.model, r.thinking ?? rProg?.thinking);
3597
- const stepLabel = entry.rowLabel;
3598
- const contextBadge = contextModeBadge(theme, r.context);
3599
- const labelPrefix = stepLabel ? `${stepLabel}: ` : "";
3600
- const stepHeader = rRunning
3601
- ? `${rowPresentation.glyph} ${labelPrefix}${theme.bold(theme.fg("warning", agentName))}${contextBadge}${modelDisplay}${stats} ${theme.fg("dim", "·")} ${rowPresentation.label}`
3602
- : `${rowPresentation.glyph} ${labelPrefix}${theme.bold(agentName)}${contextBadge}${modelDisplay}${stats} ${theme.fg("dim", "·")} ${rowPresentation.label}`;
3603
- const toolCallLines = getToolCallLines(r, expanded);
3604
- c.addChild(new Text(fit(stepHeader), 0, 0));
3605
- const taskMaxLen = Math.max(20, w - 12);
3606
- const taskPreview = expanded || r.task.length <= taskMaxLen
3607
- ? r.task
3608
- : `${r.task.slice(0, taskMaxLen)}...`;
3609
- c.addChild(new Text(fit(theme.fg("dim", ` task: ${taskPreview}`)), 0, 0));
3610
- const outputTarget = extractOutputTarget(r.task);
3611
- if (outputTarget) {
3612
- c.addChild(new Text(fit(theme.fg("dim", ` output: ${outputTarget}`)), 0, 0));
3613
- }
3614
- if (!rRunning && (r.exitCode !== 0 || r.interrupted || r.detached || r.stopped)) {
3615
- c.addChild(new Text(fit(theme.fg(r.exitCode !== 0 ? "error" : "dim", ` ⎿ ${resultStatusLine(r, resultOutput)}`)), 0, 0));
3616
- }
3617
- if (r.skills?.length) {
3618
- c.addChild(new Text(fit(theme.fg("dim", ` skills: ${r.skills.join(", ")}`)), 0, 0));
3619
- }
3620
- if (r.skillsWarning) {
3621
- c.addChild(new Text(fit(theme.fg("warning", ` Warning: ${r.skillsWarning}`)), 0, 0));
3622
- }
3623
- if (rRunning && rProg) {
3624
- if (rProg.skills?.length) {
3625
- c.addChild(new Text(fit(theme.fg("accent", ` skills: ${rProg.skills.join(", ")}`)), 0, 0));
3626
- }
3627
- const progressSnapshotNow = snapshotNowForProgress(rProg);
3628
- const toolLine = formatCurrentToolLine(rProg, w, expanded, progressSnapshotNow);
3629
- if (toolLine) {
3630
- c.addChild(new Text(fit(theme.fg("warning", ` > ${toolLine}`)), 0, 0));
3631
- }
3632
- const liveStatusLine = buildLiveStatusLine(rProg, progressSnapshotNow);
3633
- if (liveStatusLine) {
3634
- c.addChild(new Text(fit(theme.fg("accent", ` ${liveStatusLine}`)), 0, 0));
3635
- }
3636
- for (const nestedLine of formatNestedWidgetLines(r.children, theme, w, true, progressSnapshotNow, 8)) {
3637
- c.addChild(new Text(fit(` ${nestedLine}`), 0, 0));
3638
- }
3639
- c.addChild(new Text(fit(theme.fg("accent", ` ${liveDetailHintText()}`)), 0, 0));
3640
- if (r.artifactPaths) {
3641
- c.addChild(new Text(fit(theme.fg("dim", ` artifacts: ${shortenPath(r.artifactPaths.outputPath)}`)), 0, 0));
3642
- }
3643
- if (rProg.recentTools?.length) {
3644
- for (const t of rProg.recentTools.slice(-3)) {
3645
- const maxArgsLen = Math.max(40, w - 30);
3646
- const argsPreview = renderToolArgsPreview(t.args, maxArgsLen, expanded);
3647
- c.addChild(new Text(fit(theme.fg("dim", ` ${t.tool}: ${argsPreview}`)), 0, 0));
3648
- }
3649
- }
3650
- for (const line of compactRecentOutputLines(rProg.recentOutput)) {
3651
- c.addChild(new Text(fit(theme.fg("dim", ` ${line}`)), 0, 0));
3652
- }
3653
- }
3654
- if (!rRunning) {
3655
- for (const nestedLine of formatNestedWidgetLines(r.children, theme, w, true, r.progress?.lastActivityAt, 8)) {
3656
- c.addChild(new Text(fit(` ${nestedLine}`), 0, 0));
3657
- }
3658
- }
3659
- if (!rRunning && r.artifactPaths) {
3660
- c.addChild(new Text(fit(theme.fg("dim", ` artifacts: ${shortenPath(r.artifactPaths.outputPath)}`)), 0, 0));
3661
- }
3662
- if (expanded && !rRunning) {
3663
- for (const line of toolCallLines) {
3664
- c.addChild(new Text(fit(theme.fg("muted", ` ${line}`)), 0, 0));
3665
- }
3666
- if (toolCallLines.length)
3667
- c.addChild(new Spacer(1));
3668
- }
3669
- c.addChild(new Spacer(1));
3670
- }
3671
- if (d.artifacts) {
3672
- c.addChild(new Spacer(1));
3673
- c.addChild(new Text(fit(theme.fg("dim", `Artifacts dir: ${shortenPath(d.artifacts.dir)}`)), 0, 0));
3674
- }
3675
- return c;
3676
- }
3677
- //# sourceMappingURL=render.js.map