@skaile/workspaces 6.8.1 → 6.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/ai-sdk.js +5 -5
  3. package/dist/{asset-feeds-R75MH2WW.js → asset-feeds-PANNQPEE.js} +19 -19
  4. package/dist/{asset-feeds-R75MH2WW.js.map → asset-feeds-PANNQPEE.js.map} +1 -1
  5. package/dist/asset-manager/catalog-deployer.js +4 -4
  6. package/dist/asset-manager/history.js +19 -1
  7. package/dist/asset-manager/index.js +11 -11
  8. package/dist/asset-manager/installer.js +7 -7
  9. package/dist/asset-manager/renderers.js +6 -6
  10. package/dist/asset-manager/src/history.d.ts.map +1 -1
  11. package/dist/asset-manager/src/index.d.ts +65 -3
  12. package/dist/asset-manager/src/index.d.ts.map +1 -1
  13. package/dist/bridge/harnesses/claude-sdk.js +9 -9
  14. package/dist/bridge/harnesses/codex.js +29 -12
  15. package/dist/bridge/harnesses/codex.js.map +1 -1
  16. package/dist/bridge/harnesses/continue.js +8 -8
  17. package/dist/bridge/harnesses/echo.js +3 -3
  18. package/dist/bridge/harnesses/gemini.js +8 -8
  19. package/dist/bridge/harnesses/goose.js +8 -8
  20. package/dist/bridge/harnesses/omp.js +191 -24
  21. package/dist/bridge/harnesses/omp.js.map +1 -1
  22. package/dist/bridge/harnesses/opencode.js +8 -8
  23. package/dist/bridge/harnesses/qwen.js +8 -8
  24. package/dist/bridge/index.js +14 -14
  25. package/dist/bridge/src/codex/friendly-error.d.ts +7 -1
  26. package/dist/bridge/src/codex/friendly-error.d.ts.map +1 -1
  27. package/dist/bridge/src/codex/login-fallback.d.ts +5 -0
  28. package/dist/bridge/src/codex/login-fallback.d.ts.map +1 -1
  29. package/dist/bridge/src/harnesses/codex.d.ts +2 -0
  30. package/dist/bridge/src/harnesses/codex.d.ts.map +1 -1
  31. package/dist/bridge/src/harnesses/omp.d.ts +28 -0
  32. package/dist/bridge/src/harnesses/omp.d.ts.map +1 -1
  33. package/dist/{chunk-PKC2AHOB.js → chunk-2UKNI2HJ.js} +2 -2
  34. package/dist/{chunk-PKC2AHOB.js.map → chunk-2UKNI2HJ.js.map} +1 -1
  35. package/dist/{chunk-SBNUXJ6E.js → chunk-3AIEJSQR.js} +3 -3
  36. package/dist/{chunk-SBNUXJ6E.js.map → chunk-3AIEJSQR.js.map} +1 -1
  37. package/dist/{chunk-TMJBEGS4.js → chunk-4KPQ6ILH.js} +5 -34
  38. package/dist/chunk-4KPQ6ILH.js.map +1 -0
  39. package/dist/{chunk-G7NMF5WQ.js → chunk-4ROXSQEG.js} +3 -3
  40. package/dist/{chunk-G7NMF5WQ.js.map → chunk-4ROXSQEG.js.map} +1 -1
  41. package/dist/{chunk-WFK4MUBL.js → chunk-5J6JWGY4.js} +3 -3
  42. package/dist/{chunk-WFK4MUBL.js.map → chunk-5J6JWGY4.js.map} +1 -1
  43. package/dist/{chunk-ORXV3UB6.js → chunk-5J6N6LHL.js} +3 -3
  44. package/dist/{chunk-ORXV3UB6.js.map → chunk-5J6N6LHL.js.map} +1 -1
  45. package/dist/{chunk-O5Y7VMVQ.js → chunk-5KWQMCH7.js} +3 -3
  46. package/dist/{chunk-O5Y7VMVQ.js.map → chunk-5KWQMCH7.js.map} +1 -1
  47. package/dist/{chunk-KTBKW2FI.js → chunk-7QYBKUAS.js} +4 -3
  48. package/dist/chunk-7QYBKUAS.js.map +1 -0
  49. package/dist/{chunk-SILFO5RY.js → chunk-7TF5MNFK.js} +2 -2
  50. package/dist/{chunk-SILFO5RY.js.map → chunk-7TF5MNFK.js.map} +1 -1
  51. package/dist/{chunk-XIIIGLSL.js → chunk-7UCPGQCW.js} +9 -9
  52. package/dist/{chunk-XIIIGLSL.js.map → chunk-7UCPGQCW.js.map} +1 -1
  53. package/dist/{chunk-NAEXYRHR.js → chunk-AQTAULXT.js} +10 -10
  54. package/dist/{chunk-NAEXYRHR.js.map → chunk-AQTAULXT.js.map} +1 -1
  55. package/dist/{chunk-LL5GMUQG.js → chunk-BDAXHJC5.js} +7 -7
  56. package/dist/{chunk-LL5GMUQG.js.map → chunk-BDAXHJC5.js.map} +1 -1
  57. package/dist/{chunk-DXBHGNSI.js → chunk-BLBXOG5Q.js} +6 -6
  58. package/dist/{chunk-DXBHGNSI.js.map → chunk-BLBXOG5Q.js.map} +1 -1
  59. package/dist/{chunk-Y6LC5PEZ.js → chunk-C324IAXI.js} +14 -5
  60. package/dist/chunk-C324IAXI.js.map +1 -0
  61. package/dist/{chunk-NW7Y5SNK.js → chunk-CPMLMNI5.js} +4 -4
  62. package/dist/{chunk-NW7Y5SNK.js.map → chunk-CPMLMNI5.js.map} +1 -1
  63. package/dist/{chunk-DFP476EU.js → chunk-DJSGQW2Q.js} +89 -4
  64. package/dist/chunk-DJSGQW2Q.js.map +1 -0
  65. package/dist/{chunk-QCR5AE5E.js → chunk-E675QKFG.js} +5 -5
  66. package/dist/{chunk-QCR5AE5E.js.map → chunk-E675QKFG.js.map} +1 -1
  67. package/dist/{chunk-7RBFYW24.js → chunk-EMSU6L7K.js} +5 -5
  68. package/dist/{chunk-7RBFYW24.js.map → chunk-EMSU6L7K.js.map} +1 -1
  69. package/dist/{chunk-O7ADRMCR.js → chunk-FZO64PLQ.js} +45 -16
  70. package/dist/chunk-FZO64PLQ.js.map +1 -0
  71. package/dist/{chunk-I4DI5DAX.js → chunk-FZTHL6SK.js} +18 -18
  72. package/dist/chunk-FZTHL6SK.js.map +1 -0
  73. package/dist/{chunk-CMXDFTA2.js → chunk-GYPPVANR.js} +3 -3
  74. package/dist/{chunk-CMXDFTA2.js.map → chunk-GYPPVANR.js.map} +1 -1
  75. package/dist/{chunk-G44FFUMA.js → chunk-GZL6RN4Z.js} +92 -14
  76. package/dist/chunk-GZL6RN4Z.js.map +1 -0
  77. package/dist/{chunk-N65H7YYI.js → chunk-IISEBVMA.js} +5 -5
  78. package/dist/{chunk-N65H7YYI.js.map → chunk-IISEBVMA.js.map} +1 -1
  79. package/dist/{chunk-BGATDUYX.js → chunk-J45JCYS4.js} +4 -4
  80. package/dist/{chunk-BGATDUYX.js.map → chunk-J45JCYS4.js.map} +1 -1
  81. package/dist/{chunk-6ZM5X2XW.js → chunk-KVTV4LT2.js} +3 -3
  82. package/dist/{chunk-6ZM5X2XW.js.map → chunk-KVTV4LT2.js.map} +1 -1
  83. package/dist/{chunk-SAL72A7T.js → chunk-LMADWO4Q.js} +9 -6
  84. package/dist/chunk-LMADWO4Q.js.map +1 -0
  85. package/dist/{chunk-3HSLJAMJ.js → chunk-LYVLDGML.js} +3 -3
  86. package/dist/{chunk-3HSLJAMJ.js.map → chunk-LYVLDGML.js.map} +1 -1
  87. package/dist/{chunk-SGI5MRKP.js → chunk-MDCI4RSG.js} +40 -5
  88. package/dist/chunk-MDCI4RSG.js.map +1 -0
  89. package/dist/{chunk-QGA2OBUJ.js → chunk-MPO5CQUZ.js} +3 -3
  90. package/dist/{chunk-QGA2OBUJ.js.map → chunk-MPO5CQUZ.js.map} +1 -1
  91. package/dist/{chunk-KO3VSZQP.js → chunk-NDBHEOIA.js} +6 -6
  92. package/dist/{chunk-KO3VSZQP.js.map → chunk-NDBHEOIA.js.map} +1 -1
  93. package/dist/{chunk-OLZE4IHX.js → chunk-PBEDRYHP.js} +4093 -3886
  94. package/dist/chunk-PBEDRYHP.js.map +1 -0
  95. package/dist/{chunk-YMO4ZDLC.js → chunk-PLVM6OIV.js} +45 -13
  96. package/dist/chunk-PLVM6OIV.js.map +1 -0
  97. package/dist/{chunk-LZ3E6TML.js → chunk-Q5SSRVD5.js} +18 -9
  98. package/dist/chunk-Q5SSRVD5.js.map +1 -0
  99. package/dist/{chunk-4CD2R4MJ.js → chunk-QBUJTVMY.js} +4 -4
  100. package/dist/{chunk-4CD2R4MJ.js.map → chunk-QBUJTVMY.js.map} +1 -1
  101. package/dist/{chunk-REAF7ZFA.js → chunk-QIV7H3GJ.js} +398 -36
  102. package/dist/chunk-QIV7H3GJ.js.map +1 -0
  103. package/dist/{chunk-I6XH46Q6.js → chunk-RP3ML3QD.js} +3 -3
  104. package/dist/{chunk-I6XH46Q6.js.map → chunk-RP3ML3QD.js.map} +1 -1
  105. package/dist/{chunk-SVMIUCTT.js → chunk-RZRJTCP2.js} +4 -4
  106. package/dist/{chunk-SVMIUCTT.js.map → chunk-RZRJTCP2.js.map} +1 -1
  107. package/dist/{chunk-N2W7OJC6.js → chunk-S47KU4YB.js} +3 -3
  108. package/dist/{chunk-N2W7OJC6.js.map → chunk-S47KU4YB.js.map} +1 -1
  109. package/dist/{chunk-EDKTS44C.js → chunk-SME3PK4L.js} +6 -6
  110. package/dist/{chunk-EDKTS44C.js.map → chunk-SME3PK4L.js.map} +1 -1
  111. package/dist/{chunk-QW5B3TEO.js → chunk-TMQFOJ6F.js} +3 -3
  112. package/dist/{chunk-QW5B3TEO.js.map → chunk-TMQFOJ6F.js.map} +1 -1
  113. package/dist/{chunk-BB5EJLKZ.js → chunk-TUOHA6BM.js} +2 -2
  114. package/dist/{chunk-BB5EJLKZ.js.map → chunk-TUOHA6BM.js.map} +1 -1
  115. package/dist/{chunk-HLAEYFUN.js → chunk-U3FI4DVT.js} +3 -3
  116. package/dist/{chunk-HLAEYFUN.js.map → chunk-U3FI4DVT.js.map} +1 -1
  117. package/dist/{chunk-237BMOZW.js → chunk-UWD7YBDR.js} +4 -4
  118. package/dist/{chunk-237BMOZW.js.map → chunk-UWD7YBDR.js.map} +1 -1
  119. package/dist/{chunk-56PIAGD6.js → chunk-VEIWFS7Z.js} +331 -59
  120. package/dist/chunk-VEIWFS7Z.js.map +1 -0
  121. package/dist/{chunk-7O2CR5SZ.js → chunk-WEPTGUR4.js} +41 -35
  122. package/dist/chunk-WEPTGUR4.js.map +1 -0
  123. package/dist/{chunk-VT6G5AJV.js → chunk-WS3BOCAT.js} +4 -3
  124. package/dist/chunk-WS3BOCAT.js.map +1 -0
  125. package/dist/{chunk-JAGBPHXB.js → chunk-X5SGUBUV.js} +3 -3
  126. package/dist/{chunk-JAGBPHXB.js.map → chunk-X5SGUBUV.js.map} +1 -1
  127. package/dist/{chunk-62NNP7LU.js → chunk-XB4XHGIE.js} +3 -3
  128. package/dist/{chunk-62NNP7LU.js.map → chunk-XB4XHGIE.js.map} +1 -1
  129. package/dist/{chunk-VQFA5DR7.js → chunk-YPTDPN2B.js} +3 -3
  130. package/dist/{chunk-VQFA5DR7.js.map → chunk-YPTDPN2B.js.map} +1 -1
  131. package/dist/{chunk-Z5EPCIB6.js → chunk-ZUROGXJM.js} +93 -14
  132. package/dist/chunk-ZUROGXJM.js.map +1 -0
  133. package/dist/{claude-code-DS26HI3K.js → claude-code-ILZ46SLO.js} +5 -5
  134. package/dist/{claude-code-DS26HI3K.js.map → claude-code-ILZ46SLO.js.map} +1 -1
  135. package/dist/cli/index.js +277 -143
  136. package/dist/cli/index.js.map +1 -1
  137. package/dist/cli/src/agent-pins.d.ts +8 -0
  138. package/dist/cli/src/agent-pins.d.ts.map +1 -1
  139. package/dist/cli/src/commands/asset-cmd.d.ts.map +1 -1
  140. package/dist/cli/src/commands/catalog.d.ts +4 -4
  141. package/dist/cli/src/commands/catalog.d.ts.map +1 -1
  142. package/dist/cli/src/commands/connector.d.ts.map +1 -1
  143. package/dist/cli/src/commands/deploy.d.ts.map +1 -1
  144. package/dist/cli/src/commands/flow.d.ts.map +1 -1
  145. package/dist/cli/src/commands/harness.d.ts.map +1 -1
  146. package/dist/cli/src/commands/integration.d.ts.map +1 -1
  147. package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
  148. package/dist/cli/src/commands/library-index.d.ts +42 -0
  149. package/dist/cli/src/commands/library-index.d.ts.map +1 -1
  150. package/dist/cli/src/commands/library-publish.d.ts.map +1 -1
  151. package/dist/cli/src/commands/npx.d.ts.map +1 -1
  152. package/dist/cli/src/commands/patch.d.ts.map +1 -1
  153. package/dist/cli/src/commands/plugin-registry-cmd.d.ts.map +1 -1
  154. package/dist/cli/src/commands/project.d.ts.map +1 -1
  155. package/dist/cli/src/commands/run.d.ts.map +1 -1
  156. package/dist/cli/src/commands/serve-preflight.d.ts +10 -0
  157. package/dist/cli/src/commands/serve-preflight.d.ts.map +1 -1
  158. package/dist/cli/src/commands/serve.d.ts +5 -3
  159. package/dist/cli/src/commands/serve.d.ts.map +1 -1
  160. package/dist/cli/src/commands/session.d.ts.map +1 -1
  161. package/dist/cli/src/commands/source.d.ts.map +1 -1
  162. package/dist/cli/src/commands/store.d.ts.map +1 -1
  163. package/dist/cli/src/commands/validate.d.ts.map +1 -1
  164. package/dist/cli/src/config-checks.d.ts +13 -0
  165. package/dist/cli/src/config-checks.d.ts.map +1 -1
  166. package/dist/cli/src/group-help.d.ts +11 -0
  167. package/dist/cli/src/group-help.d.ts.map +1 -0
  168. package/dist/connectors/config.js +2 -2
  169. package/dist/connectors/index.js +17 -17
  170. package/dist/connectors/src/config.d.ts.map +1 -1
  171. package/dist/{connectors-3ST6PGWP.js → connectors-KTRUUKWG.js} +20 -20
  172. package/dist/{connectors-3ST6PGWP.js.map → connectors-KTRUUKWG.js.map} +1 -1
  173. package/dist/core/index.js +4 -4
  174. package/dist/core/logging.js +1 -1
  175. package/dist/core/runtime-assets.js +2 -2
  176. package/dist/core/src/index.d.ts +1 -1
  177. package/dist/core/src/index.d.ts.map +1 -1
  178. package/dist/core/src/logging/config.d.ts.map +1 -1
  179. package/dist/core/src/repo-manager.d.ts +6 -0
  180. package/dist/core/src/repo-manager.d.ts.map +1 -1
  181. package/dist/core/src/run-state-ignore.d.ts +6 -4
  182. package/dist/core/src/run-state-ignore.d.ts.map +1 -1
  183. package/dist/core/src/walker.d.ts.map +1 -1
  184. package/dist/core/src/workspace-config.d.ts +6 -0
  185. package/dist/core/src/workspace-config.d.ts.map +1 -1
  186. package/dist/core/workspace-config.js +1 -1
  187. package/dist/deploy/index.js +4 -4
  188. package/dist/discovery/index.js +2 -2
  189. package/dist/{ensure-sources-VELKRM6X.js → ensure-sources-5QWKUIUD.js} +23 -23
  190. package/dist/{ensure-sources-VELKRM6X.js.map → ensure-sources-5QWKUIUD.js.map} +1 -1
  191. package/dist/factory-assets/connectors/box.js +17 -17
  192. package/dist/factory-assets/connectors/deploy.js +17 -17
  193. package/dist/factory-assets/connectors/devserver.js +17 -17
  194. package/dist/factory-assets/connectors/flow/adapter.js +17 -17
  195. package/dist/factory-assets/connectors/flow/engine.js +5 -5
  196. package/dist/factory-assets/connectors/flow/run-flow.js +18 -18
  197. package/dist/factory-assets/connectors/flow.js +17 -17
  198. package/dist/factory-assets/connectors/git.js +17 -17
  199. package/dist/factory-assets/connectors/gmail.js +17 -17
  200. package/dist/factory-assets/connectors/googledrive.js +17 -17
  201. package/dist/factory-assets/connectors/local.js +17 -17
  202. package/dist/factory-assets/connectors/mattermost.js +17 -17
  203. package/dist/factory-assets/connectors/memory.js +17 -17
  204. package/dist/factory-assets/connectors/minio.js +17 -17
  205. package/dist/factory-assets/connectors/postgres.js +17 -17
  206. package/dist/factory-assets/connectors/s3.js +17 -17
  207. package/dist/factory-assets/connectors/sharepoint.js +17 -17
  208. package/dist/factory-assets/connectors/sqlite.js +17 -17
  209. package/dist/factory-assets/connectors/static-server.js +17 -17
  210. package/dist/factory-assets/connectors/tunnel.js +17 -17
  211. package/dist/factory-assets/connectors/webdav.js +17 -17
  212. package/dist/factory-assets/connectors/xstate-store.js +17 -17
  213. package/dist/factory-assets/connectors/xstate.js +17 -17
  214. package/dist/factory-assets/skills/authoring-skaile-assets/SKILL.md +4 -4
  215. package/dist/factory-assets/skills/authoring-skaile-manifests/SKILL.md +10 -10
  216. package/dist/factory-assets/skills/authoring-skaile-manifests/references/dependency-standard.md +15 -15
  217. package/dist/factory-assets/skills/manifest-compliance/SKILL.md +1 -1
  218. package/dist/{flows-I6ODIPZZ.js → flows-UCP6ZUYS.js} +7 -7
  219. package/dist/{flows-I6ODIPZZ.js.map → flows-UCP6ZUYS.js.map} +1 -1
  220. package/dist/{helpers-LWNKX56Y.js → helpers-INS4B7OQ.js} +23 -23
  221. package/dist/{helpers-LWNKX56Y.js.map → helpers-INS4B7OQ.js.map} +1 -1
  222. package/dist/library/index.js +7 -7
  223. package/dist/library/src/index.d.ts +1 -1
  224. package/dist/library/src/index.d.ts.map +1 -1
  225. package/dist/library/src/remote/index.d.ts +1 -1
  226. package/dist/library/src/remote/index.d.ts.map +1 -1
  227. package/dist/library/src/remote/remote-catalog-source.d.ts +33 -2
  228. package/dist/library/src/remote/remote-catalog-source.d.ts.map +1 -1
  229. package/dist/{library-publish-WJVCT2IK.js → library-publish-AZTYRASL.js} +61 -47
  230. package/dist/library-publish-AZTYRASL.js.map +1 -0
  231. package/dist/model-endpoint/index.js +7 -7
  232. package/dist/model-endpoint/src/index.d.ts +1 -1
  233. package/dist/model-endpoint/src/index.d.ts.map +1 -1
  234. package/dist/model-endpoint/src/openai-agent.d.ts +60 -0
  235. package/dist/model-endpoint/src/openai-agent.d.ts.map +1 -0
  236. package/dist/model-endpoint/src/resolve.d.ts +12 -3
  237. package/dist/model-endpoint/src/resolve.d.ts.map +1 -1
  238. package/dist/model-endpoint/src/server.d.ts.map +1 -1
  239. package/dist/model-endpoint/src/types.d.ts +33 -0
  240. package/dist/model-endpoint/src/types.d.ts.map +1 -1
  241. package/dist/model-endpoint/src/upstream-models.d.ts +20 -0
  242. package/dist/model-endpoint/src/upstream-models.d.ts.map +1 -0
  243. package/dist/{open-library-Q7QZJY5D.js → open-library-3HMXYGUF.js} +26 -26
  244. package/dist/{open-library-Q7QZJY5D.js.map → open-library-3HMXYGUF.js.map} +1 -1
  245. package/dist/{open-registry-RZW2AFD6.js → open-registry-BHBHQMBA.js} +11 -11
  246. package/dist/{open-registry-RZW2AFD6.js.map → open-registry-BHBHQMBA.js.map} +1 -1
  247. package/dist/{paths-RPK5PNZQ.js → paths-77PXOXZY.js} +7 -7
  248. package/dist/{paths-RPK5PNZQ.js.map → paths-77PXOXZY.js.map} +1 -1
  249. package/dist/{plugin-store-OJTERUEZ.js → plugin-store-XQP2CRYH.js} +7 -7
  250. package/dist/{plugin-store-OJTERUEZ.js.map → plugin-store-XQP2CRYH.js.map} +1 -1
  251. package/dist/{project-WVPRL7CP.js → project-HVNPK2ZF.js} +39 -40
  252. package/dist/{project-WVPRL7CP.js.map → project-HVNPK2ZF.js.map} +1 -1
  253. package/dist/resolver/index.js +4 -4
  254. package/dist/runner/index.js +28 -28
  255. package/dist/runner/src/agent-loop.d.ts +42 -0
  256. package/dist/runner/src/agent-loop.d.ts.map +1 -0
  257. package/dist/runner/src/agents/in-process-host.d.ts +9 -6
  258. package/dist/runner/src/agents/in-process-host.d.ts.map +1 -1
  259. package/dist/runner/src/model-endpoint-discovery.d.ts +3 -0
  260. package/dist/runner/src/model-endpoint-discovery.d.ts.map +1 -1
  261. package/dist/runner/src/serve.d.ts.map +1 -1
  262. package/dist/runner/src/session-builder.d.ts +6 -4
  263. package/dist/runner/src/session-builder.d.ts.map +1 -1
  264. package/dist/runner/src/turn-end-contract.d.ts.map +1 -1
  265. package/dist/runner/src/turn-scheduler.d.ts +37 -2
  266. package/dist/runner/src/turn-scheduler.d.ts.map +1 -1
  267. package/dist/sdk/asset-manager.js +11 -11
  268. package/dist/sdk/bridge.js +14 -14
  269. package/dist/sdk/core.js +4 -4
  270. package/dist/sdk/flow.js +5 -5
  271. package/dist/sdk/index.js +28 -28
  272. package/dist/sdk/resolver.js +4 -4
  273. package/dist/sdk/runner.js +28 -28
  274. package/dist/sdk/transport/ws/server.js +5 -5
  275. package/dist/sdk/transport/ws.js +5 -5
  276. package/dist/sdk/transport.js +5 -5
  277. package/dist/{serve-preflight-24YWWYUG.js → serve-preflight-NHZOKHIC.js} +27 -26
  278. package/dist/{serve-preflight-24YWWYUG.js.map → serve-preflight-NHZOKHIC.js.map} +1 -1
  279. package/dist/{setup-F5JX64UP.js → setup-EX7Z7XRN.js} +24 -24
  280. package/dist/{setup-F5JX64UP.js.map → setup-EX7Z7XRN.js.map} +1 -1
  281. package/dist/{skills-KHHW3RZ3.js → skills-DE2BDQ6G.js} +6 -6
  282. package/dist/{skills-KHHW3RZ3.js.map → skills-DE2BDQ6G.js.map} +1 -1
  283. package/dist/{source-DG5IAAGZ.js → source-URRPRGMZ.js} +39 -39
  284. package/dist/{source-DG5IAAGZ.js.map → source-URRPRGMZ.js.map} +1 -1
  285. package/dist/{source-manifest-publish-76S2JD3O.js → source-manifest-publish-ZWRYRJ2U.js} +41 -41
  286. package/dist/{source-manifest-publish-76S2JD3O.js.map → source-manifest-publish-ZWRYRJ2U.js.map} +1 -1
  287. package/dist/transport/index.js +5 -5
  288. package/dist/transport/ws/server.js +5 -5
  289. package/dist/transport/ws.js +5 -5
  290. package/dist/tui/index.js +29 -29
  291. package/dist/tui/index.js.map +1 -1
  292. package/dist/tui/src/repl.d.ts.map +1 -1
  293. package/dist/types/manifests.js +1 -1
  294. package/dist/types/src/manifests/scaffold-body.d.ts +1 -1
  295. package/dist/types/src/manifests/scaffold-body.d.ts.map +1 -1
  296. package/dist/workspace-plugin/adapters/mcp.js +20 -20
  297. package/dist/workspace-plugin/adapters/omp.js +14 -14
  298. package/dist/workspace-plugin/index.js +2 -2
  299. package/package.json +1 -1
  300. package/dist/chunk-56PIAGD6.js.map +0 -1
  301. package/dist/chunk-7O2CR5SZ.js.map +0 -1
  302. package/dist/chunk-DFP476EU.js.map +0 -1
  303. package/dist/chunk-E5AZA2FL.js +0 -83
  304. package/dist/chunk-E5AZA2FL.js.map +0 -1
  305. package/dist/chunk-G44FFUMA.js.map +0 -1
  306. package/dist/chunk-I4DI5DAX.js.map +0 -1
  307. package/dist/chunk-KTBKW2FI.js.map +0 -1
  308. package/dist/chunk-LZ3E6TML.js.map +0 -1
  309. package/dist/chunk-O7ADRMCR.js.map +0 -1
  310. package/dist/chunk-OLZE4IHX.js.map +0 -1
  311. package/dist/chunk-REAF7ZFA.js.map +0 -1
  312. package/dist/chunk-SAL72A7T.js.map +0 -1
  313. package/dist/chunk-SGI5MRKP.js.map +0 -1
  314. package/dist/chunk-TMJBEGS4.js.map +0 -1
  315. package/dist/chunk-VT6G5AJV.js.map +0 -1
  316. package/dist/chunk-Y6LC5PEZ.js.map +0 -1
  317. package/dist/chunk-YMO4ZDLC.js.map +0 -1
  318. package/dist/chunk-Z5EPCIB6.js.map +0 -1
  319. package/dist/library-publish-WJVCT2IK.js.map +0 -1
@@ -1,20 +1,20 @@
1
1
  import { harnessSessionConfigHome, removeSessionConfigFile, writeSessionConfigFile } from '../../chunk-NBAGV6L2.js';
2
- import { SubprocessCliHarness, extractText, extractCost, extractTokens } from '../../chunk-QGA2OBUJ.js';
2
+ import { SubprocessCliHarness, extractText, extractCost, extractTokens } from '../../chunk-MPO5CQUZ.js';
3
3
  import { HARNESS_BINARIES } from '../../chunk-WWSRIT3J.js';
4
- import { resolveEnvHarnessSession, continueRoleBinding, credentialsForEveryProvider, registryModelEntries, selectableEntries, entrySurface, harnessProviderName, entryBaseUrl, versionedAnthropicBaseUrl } from '../../chunk-I6XH46Q6.js';
4
+ import { resolveEnvHarnessSession, continueRoleBinding, credentialsForEveryProvider, registryModelEntries, selectableEntries, entrySurface, harnessProviderName, entryBaseUrl, versionedAnthropicBaseUrl } from '../../chunk-RP3ML3QD.js';
5
5
  import '../../chunk-5DE3DGVR.js';
6
6
  import '../../chunk-7DN6JKP2.js';
7
- import { getBridgeLogger, registryHarnessConfig } from '../../chunk-ORXV3UB6.js';
8
- import { BUILTIN_HARNESS_CATALOG, entryCredentialValue, providerCredentialEnvName } from '../../chunk-SILFO5RY.js';
7
+ import { getBridgeLogger, registryHarnessConfig } from '../../chunk-5J6N6LHL.js';
8
+ import { BUILTIN_HARNESS_CATALOG, entryCredentialValue, providerCredentialEnvName } from '../../chunk-7TF5MNFK.js';
9
9
  import '../../chunk-G5SUWZEU.js';
10
10
  import '../../chunk-6UP2EDFN.js';
11
- import '../../chunk-TMJBEGS4.js';
11
+ import '../../chunk-4KPQ6ILH.js';
12
12
  import '../../chunk-4GY63JU6.js';
13
- import '../../chunk-G7NMF5WQ.js';
13
+ import '../../chunk-4ROXSQEG.js';
14
14
  import '../../chunk-5KRMNUL4.js';
15
15
  import '../../chunk-C5HFK34M.js';
16
16
  import '../../chunk-MWXYN6NY.js';
17
- import '../../chunk-O7ADRMCR.js';
17
+ import '../../chunk-FZO64PLQ.js';
18
18
  import '../../chunk-L5VSIPQD.js';
19
19
  import '../../chunk-VTETQCR6.js';
20
20
  import '../../chunk-QC5BYUED.js';
@@ -23,7 +23,7 @@ import '../../chunk-RVRB27AN.js';
23
23
  import '../../chunk-V5KG6CCV.js';
24
24
  import '../../chunk-VSX2G7LA.js';
25
25
  import { parseModelRef } from '../../chunk-RXGPFAMN.js';
26
- import '../../chunk-SGI5MRKP.js';
26
+ import '../../chunk-MDCI4RSG.js';
27
27
  import '../../chunk-C3CAXQMA.js';
28
28
  import '../../chunk-BOFL7GIF.js';
29
29
  import '../../chunk-NSBPE2FW.js';
@@ -1,12 +1,12 @@
1
1
  import { dispatchCapability } from '../../chunk-YEOG7CWQ.js';
2
- import { AgentHarness, getBridgeLogger, registryHarnessConfig } from '../../chunk-ORXV3UB6.js';
3
- import { BUILTIN_HARNESS_CATALOG } from '../../chunk-SILFO5RY.js';
2
+ import { AgentHarness, getBridgeLogger, registryHarnessConfig } from '../../chunk-5J6N6LHL.js';
3
+ import { BUILTIN_HARNESS_CATALOG } from '../../chunk-7TF5MNFK.js';
4
4
  import '../../chunk-G5SUWZEU.js';
5
5
  import '../../chunk-6UP2EDFN.js';
6
6
  import '../../chunk-7NN3P6VF.js';
7
7
  import '../../chunk-VSX2G7LA.js';
8
8
  import '../../chunk-RXGPFAMN.js';
9
- import '../../chunk-SGI5MRKP.js';
9
+ import '../../chunk-MDCI4RSG.js';
10
10
  import '../../chunk-C3CAXQMA.js';
11
11
  import '../../chunk-BOFL7GIF.js';
12
12
  import '../../chunk-NSBPE2FW.js';
@@ -1,18 +1,18 @@
1
- export { GeminiFamilyHarness, GeminiHarness, geminiHarnessTarget } from '../../chunk-LL5GMUQG.js';
2
- import '../../chunk-QGA2OBUJ.js';
3
- import '../../chunk-SBNUXJ6E.js';
1
+ export { GeminiFamilyHarness, GeminiHarness, geminiHarnessTarget } from '../../chunk-BDAXHJC5.js';
2
+ import '../../chunk-MPO5CQUZ.js';
3
+ import '../../chunk-3AIEJSQR.js';
4
4
  import '../../chunk-WWSRIT3J.js';
5
- import '../../chunk-I6XH46Q6.js';
5
+ import '../../chunk-RP3ML3QD.js';
6
6
  import '../../chunk-5DE3DGVR.js';
7
7
  import '../../chunk-7DN6JKP2.js';
8
- import '../../chunk-ORXV3UB6.js';
9
- import '../../chunk-SILFO5RY.js';
8
+ import '../../chunk-5J6N6LHL.js';
9
+ import '../../chunk-7TF5MNFK.js';
10
10
  import '../../chunk-G5SUWZEU.js';
11
11
  import '../../chunk-6UP2EDFN.js';
12
- import '../../chunk-VT6G5AJV.js';
12
+ import '../../chunk-WS3BOCAT.js';
13
13
  import '../../chunk-VSX2G7LA.js';
14
14
  import '../../chunk-RXGPFAMN.js';
15
- import '../../chunk-SGI5MRKP.js';
15
+ import '../../chunk-MDCI4RSG.js';
16
16
  import '../../chunk-C3CAXQMA.js';
17
17
  import '../../chunk-BOFL7GIF.js';
18
18
  import '../../chunk-NSBPE2FW.js';
@@ -1,20 +1,20 @@
1
1
  import { harnessSessionConfigHome, pruneSessionConfigDir, writeSessionConfigFile } from '../../chunk-NBAGV6L2.js';
2
- import { SubprocessCliHarness, extractText, extractCost, extractTokens } from '../../chunk-QGA2OBUJ.js';
2
+ import { SubprocessCliHarness, extractText, extractCost, extractTokens } from '../../chunk-MPO5CQUZ.js';
3
3
  import { HARNESS_BINARIES } from '../../chunk-WWSRIT3J.js';
4
- import { resolveEnvHarnessSession, resolveRegistryBinding, credentialsForEveryProvider, registryModelEntries, selectableEntries, isStockCatalogEndpoint, entrySurface, entryBaseUrl, entryModelIds } from '../../chunk-I6XH46Q6.js';
4
+ import { resolveEnvHarnessSession, resolveRegistryBinding, credentialsForEveryProvider, registryModelEntries, selectableEntries, isStockCatalogEndpoint, entrySurface, entryBaseUrl, entryModelIds } from '../../chunk-RP3ML3QD.js';
5
5
  import '../../chunk-5DE3DGVR.js';
6
6
  import '../../chunk-7DN6JKP2.js';
7
- import { getBridgeLogger, registryHarnessConfig } from '../../chunk-ORXV3UB6.js';
8
- import { BUILTIN_HARNESS_CATALOG, providerCredentialEnvName } from '../../chunk-SILFO5RY.js';
7
+ import { getBridgeLogger, registryHarnessConfig } from '../../chunk-5J6N6LHL.js';
8
+ import { BUILTIN_HARNESS_CATALOG, providerCredentialEnvName } from '../../chunk-7TF5MNFK.js';
9
9
  import '../../chunk-G5SUWZEU.js';
10
10
  import '../../chunk-6UP2EDFN.js';
11
- import '../../chunk-TMJBEGS4.js';
11
+ import '../../chunk-4KPQ6ILH.js';
12
12
  import '../../chunk-4GY63JU6.js';
13
- import '../../chunk-G7NMF5WQ.js';
13
+ import '../../chunk-4ROXSQEG.js';
14
14
  import '../../chunk-5KRMNUL4.js';
15
15
  import '../../chunk-C5HFK34M.js';
16
16
  import '../../chunk-MWXYN6NY.js';
17
- import '../../chunk-O7ADRMCR.js';
17
+ import '../../chunk-FZO64PLQ.js';
18
18
  import '../../chunk-L5VSIPQD.js';
19
19
  import '../../chunk-VTETQCR6.js';
20
20
  import '../../chunk-QC5BYUED.js';
@@ -23,7 +23,7 @@ import '../../chunk-RVRB27AN.js';
23
23
  import '../../chunk-V5KG6CCV.js';
24
24
  import '../../chunk-VSX2G7LA.js';
25
25
  import '../../chunk-RXGPFAMN.js';
26
- import '../../chunk-SGI5MRKP.js';
26
+ import '../../chunk-MDCI4RSG.js';
27
27
  import '../../chunk-C3CAXQMA.js';
28
28
  import '../../chunk-BOFL7GIF.js';
29
29
  import '../../chunk-NSBPE2FW.js';
@@ -1,18 +1,18 @@
1
1
  import { checkToolInputSchema } from '../../chunk-3X7VTCPG.js';
2
- import { materializeOmpProviders, isCredentialOmissionWarning, materializeOmpIdentityDir, registryModelEntries } from '../../chunk-NW7Y5SNK.js';
2
+ import { materializeOmpProviders, isCredentialOmissionWarning, materializeOmpIdentityDir, registryModelEntries } from '../../chunk-CPMLMNI5.js';
3
3
  import { dispatchCapability } from '../../chunk-YEOG7CWQ.js';
4
4
  import { HARNESS_BINARIES } from '../../chunk-WWSRIT3J.js';
5
- import '../../chunk-I6XH46Q6.js';
5
+ import '../../chunk-RP3ML3QD.js';
6
6
  import { RUNNER_AGENT_ENV_KEYS, ReconfigureLedger, stripRunnerPrivateEnv, classifyGenericErrorMessage } from '../../chunk-5DE3DGVR.js';
7
7
  import { wrapAgentCommand, resolveAgentExec } from '../../chunk-7DN6JKP2.js';
8
- import { AgentHarness, getBridgeLogger, TOOL_ALLOWLIST_UNSUPPORTED, registryHarnessConfig } from '../../chunk-ORXV3UB6.js';
9
- import { BUILTIN_HARNESS_CATALOG } from '../../chunk-SILFO5RY.js';
8
+ import { AgentHarness, getBridgeLogger, TOOL_ALLOWLIST_UNSUPPORTED, registryHarnessConfig } from '../../chunk-5J6N6LHL.js';
9
+ import { BUILTIN_HARNESS_CATALOG } from '../../chunk-7TF5MNFK.js';
10
10
  import '../../chunk-G5SUWZEU.js';
11
11
  import '../../chunk-6UP2EDFN.js';
12
12
  import { withActivityLabelJsonSchema } from '../../chunk-7NN3P6VF.js';
13
13
  import '../../chunk-VSX2G7LA.js';
14
14
  import '../../chunk-RXGPFAMN.js';
15
- import '../../chunk-SGI5MRKP.js';
15
+ import '../../chunk-MDCI4RSG.js';
16
16
  import '../../chunk-C3CAXQMA.js';
17
17
  import '../../chunk-BOFL7GIF.js';
18
18
  import '../../chunk-NSBPE2FW.js';
@@ -184,6 +184,35 @@ function ompStartFailureCause(lines) {
184
184
  }
185
185
  return clean.at(-1) ?? "";
186
186
  }
187
+ var KILLED_EXIT_WAIT_MS = 5e3;
188
+ var EarlyOmpExit = class extends Error {
189
+ constructor(code, signal) {
190
+ super(`omp process crashed (exit code ${code})`);
191
+ this.code = code;
192
+ this.signal = signal;
193
+ }
194
+ code;
195
+ signal;
196
+ };
197
+ function removeHomeAfterExit(proc, home) {
198
+ let resolve;
199
+ const promise = new Promise((r) => {
200
+ resolve = r;
201
+ });
202
+ const timer = setTimeout(remove, KILLED_EXIT_WAIT_MS);
203
+ timer.unref?.();
204
+ function remove() {
205
+ clearTimeout(timer);
206
+ try {
207
+ rmSync(home, { recursive: true, force: true });
208
+ } catch {
209
+ }
210
+ resolve();
211
+ }
212
+ if (proc.exitCode !== null || proc.signalCode !== null) remove();
213
+ else proc.once("exit", remove);
214
+ return promise;
215
+ }
187
216
  var OmpHarness = class extends AgentHarness {
188
217
  harnessInfo = {
189
218
  id: "omp",
@@ -203,6 +232,11 @@ var OmpHarness = class extends AgentHarness {
203
232
  prevText = "";
204
233
  /** OMP session ID captured via `get_state` after each turn. */
205
234
  _ompSessionId;
235
+ /**
236
+ * The omp session the last unexpected exit left behind, set as `config.resumeSessionId` for
237
+ * the respawn; cleared once a respawn on it fails (the next one starts empty).
238
+ */
239
+ exitResumeSessionId;
206
240
  /**
207
241
  * Usage of the most recent turn, summed over every model call in it (a tool
208
242
  * loop is one prompt but many assistant messages). Cleared when a turn
@@ -215,12 +249,18 @@ var OmpHarness = class extends AgentHarness {
215
249
  * `get_state.contextUsage.tokens` replaces it once that reply lands.
216
250
  */
217
251
  _lastContextTokens = null;
252
+ /** USD cost of the most recent turn, summed like {@link _lastTokens}. */
253
+ _lastTurnCostUsd = 0;
254
+ /** The current turn's request failed (`message_end` with `stopReason: "error"`). */
255
+ turnFailed = false;
218
256
  /** Context window of the active model, from `get_state.contextUsage`. */
219
257
  _contextWindow = null;
220
258
  /** Per-spawn file holding the system prompt omp was started with; removed with the process. */
221
259
  systemPromptFile = null;
222
260
  /** The private omp home of the running process, when it is the harness's own temporary one. */
223
261
  privateHome = null;
262
+ /** Settles when the process last killed has exited and its private home is deleted. */
263
+ homeGone = Promise.resolve();
224
264
  getTokenUsage() {
225
265
  return this._lastTokens;
226
266
  }
@@ -271,6 +311,14 @@ var OmpHarness = class extends AgentHarness {
271
311
  promptTail = Promise.resolve();
272
312
  /** `true` while `agent_end` is being delivered to listeners. */
273
313
  turnEnded = false;
314
+ /** `true` once the current turn showed model output (text, a thinking delta or a tool run). */
315
+ turnOutputSeen = false;
316
+ /** `true` once `runPrompt` sent the current prompt a second time after an early exit. */
317
+ promptRetried = false;
318
+ /** `true` once omp recorded the current prompt as a user message in its session. */
319
+ turnUserMessageSeen = false;
320
+ /** Counts `kill()` calls, so a prompt that restarts omp itself can tell it was killed meanwhile. */
321
+ killEpoch = 0;
274
322
  get runtimeSessionId() {
275
323
  return this._ompSessionId;
276
324
  }
@@ -377,9 +425,26 @@ var OmpHarness = class extends AgentHarness {
377
425
  async start() {
378
426
  if (this.startPromise) return this.startPromise;
379
427
  if (this.proc) return;
380
- this.startPromise = this._start().catch((err) => {
428
+ this.startPromise = this._start().then(() => {
429
+ this.exitResumeSessionId = void 0;
430
+ }).catch(async (err) => {
381
431
  this.removeSystemPromptFile();
382
432
  this.removePrivateHome();
433
+ const resumeId = this.exitResumeSessionId;
434
+ if (resumeId !== void 0 && this.config.resumeSessionId === resumeId) {
435
+ this.log.warn("omp did not restart on its previous session; starting a new one", {
436
+ sessionId: resumeId,
437
+ error: err instanceof Error ? err.message : String(err)
438
+ });
439
+ this.exitResumeSessionId = void 0;
440
+ this._ompSessionId = void 0;
441
+ this.config = { ...this.config, resumeSessionId: void 0 };
442
+ return this._start().catch((retryErr) => {
443
+ this.removeSystemPromptFile();
444
+ this.removePrivateHome();
445
+ throw retryErr;
446
+ });
447
+ }
383
448
  throw err;
384
449
  });
385
450
  return this.startPromise;
@@ -497,13 +562,50 @@ var OmpHarness = class extends AgentHarness {
497
562
  }
498
563
  const lastStderr = this.stderrBuffer.slice(-10).join("\n");
499
564
  const crashed = code !== null && code !== 0;
500
- if (crashed) {
565
+ const wasReady = this.ready;
566
+ const betweenTurns = wasReady && this.turnReject === null;
567
+ if (wasReady) {
568
+ const sessionId = this._ompSessionId;
569
+ if (sessionId) {
570
+ this.config = { ...this.config, resumeSessionId: sessionId };
571
+ this.exitResumeSessionId = sessionId;
572
+ }
573
+ if (betweenTurns) {
574
+ this.log.warn("omp exited between turns; it restarts on the next prompt", {
575
+ code,
576
+ signal,
577
+ resumeSessionId: sessionId ?? null,
578
+ stderr: lastStderr || null
579
+ });
580
+ } else if (lastStderr) {
581
+ this.log.warn("omp exited during a turn", { code, signal, stderr: lastStderr });
582
+ }
583
+ }
584
+ const resumeAttempt = !wasReady && this.exitResumeSessionId !== void 0 && this.config.resumeSessionId === this.exitResumeSessionId;
585
+ const wouldDuplicate = this.turnUserMessageSeen && this.config.resumeSessionId !== void 0;
586
+ const retryEarly = (crashed || signal !== null) && wasReady && !betweenTurns && !this.turnOutputSeen && !wouldDuplicate && !this.promptRetried && !resumeAttempt;
587
+ if (retryEarly) {
588
+ this.log.warn("omp exited in a turn before its first output", {
589
+ code,
590
+ signal,
591
+ stderr: lastStderr || null
592
+ });
593
+ } else if (crashed && !betweenTurns && !resumeAttempt) {
594
+ const sessionDir2 = path.join(this.config.cwd, ".omp", "sessions");
501
595
  const detail = {
502
596
  message: `omp process crashed (exit code ${code})${lastStderr ? `: ${lastStderr}` : ""}`,
503
597
  category: "process",
504
598
  retryable: true,
505
- hint: lastStderr || "The agent process exited unexpectedly. Try sending your prompt again."
599
+ hint: lastStderr || `omp exited with code ${code}${signal ? ` (signal ${signal})` : ""} and wrote nothing to stderr; its session files are in ${sessionDir2}. Try sending your prompt again.`
506
600
  };
601
+ if (!lastStderr) {
602
+ this.log.warn("omp exited with no stderr", {
603
+ code,
604
+ signal,
605
+ sessionDir: sessionDir2,
606
+ sessionId: this._ompSessionId ?? null
607
+ });
608
+ }
507
609
  this.emit("agent-event", { type: "error", error: detail.message, detail });
508
610
  }
509
611
  if (!this.ready) {
@@ -521,7 +623,7 @@ var OmpHarness = class extends AgentHarness {
521
623
  }
522
624
  this.cleanup();
523
625
  this.rejectTurn(
524
- new Error(
626
+ retryEarly ? new EarlyOmpExit(code, signal) : new Error(
525
627
  crashed ? `omp process crashed (exit code ${code})` : `omp process exited before the turn completed${signal ? ` (signal ${signal})` : ""}`
526
628
  )
527
629
  );
@@ -942,6 +1044,12 @@ var OmpHarness = class extends AgentHarness {
942
1044
  this.emit(`response:${event.id}`, event);
943
1045
  return;
944
1046
  }
1047
+ if (event.type === "message_start" && event.message?.role === "assistant" || event.type === "message_update" || event.type === "host_tool_call" || event.type === "extension_ui_request" || event.type.startsWith("tool_execution")) {
1048
+ this.turnOutputSeen = true;
1049
+ }
1050
+ if (event.type === "message_end" && event.message?.role === "user") {
1051
+ this.turnUserMessageSeen = true;
1052
+ }
945
1053
  if (event.type === "host_tool_call") {
946
1054
  this.handleHostToolCall(event);
947
1055
  return;
@@ -1003,13 +1111,22 @@ var OmpHarness = class extends AgentHarness {
1003
1111
  this.prevText = "";
1004
1112
  }
1005
1113
  if (event.type === "message_end") this.recordMessageUsage(event.message);
1114
+ if (event.type === "tool_execution_start") this.announceToolExecution(event);
1006
1115
  if (event.type === "message_end" && event.message?.role === "assistant" && event.message.stopReason === "error") {
1007
1116
  const error = event.message.errorMessage || "omp request failed";
1008
1117
  const detail = this.classifyErrorMessage(error);
1009
1118
  this.log.error("omp request failed", new Error(error), { detail });
1010
1119
  this.emit("agent-event", { type: "error", error: detail.message, detail });
1120
+ this.turnFailed = true;
1011
1121
  }
1012
1122
  if (event.type === "agent_end") {
1123
+ this.emit("agent-event", {
1124
+ type: "result",
1125
+ subtype: "success",
1126
+ summary: this.turnFailed ? "Turn failed" : "Turn completed",
1127
+ costUsd: this._lastTurnCostUsd,
1128
+ ...this._lastTokens ? { tokens: { ...this._lastTokens } } : {}
1129
+ });
1013
1130
  void this.captureState();
1014
1131
  }
1015
1132
  const turnEnded = event.type === "agent_end";
@@ -1089,6 +1206,25 @@ var OmpHarness = class extends AgentHarness {
1089
1206
  beginUsageTurn() {
1090
1207
  this._lastTokens = null;
1091
1208
  this._lastContextTokens = null;
1209
+ this._lastTurnCostUsd = 0;
1210
+ this.turnFailed = false;
1211
+ }
1212
+ /**
1213
+ * omp announces a tool run as `tool_execution_start`; its assistant message names the
1214
+ * call only in `message_end`, after the run. Publish it as `tool_call` here, like a host
1215
+ * tool call. Host tools already got theirs from `host_tool_call`, and `ask` becomes a
1216
+ * `question` through its dialog.
1217
+ */
1218
+ announceToolExecution(event) {
1219
+ const name = typeof event.toolName === "string" ? event.toolName : "";
1220
+ if (!name || name === "ask" || this.hostToolCapabilities.has(name)) return;
1221
+ this.emit("agent-event", {
1222
+ type: "tool_call",
1223
+ name,
1224
+ tool: { name },
1225
+ ...typeof event.toolCallId === "string" ? { toolCallId: event.toolCallId } : {},
1226
+ input: event.args ?? {}
1227
+ });
1092
1228
  }
1093
1229
  /**
1094
1230
  * Fold one finished assistant message into the turn's usage. Only the
@@ -1118,6 +1254,8 @@ var OmpHarness = class extends AgentHarness {
1118
1254
  add("reasoningTokens", reasoning);
1119
1255
  add("totalTokens", total);
1120
1256
  this._lastTokens = turn;
1257
+ const cost = count(message.usage.cost?.total);
1258
+ if (cost !== void 0) this._lastTurnCostUsd += cost;
1121
1259
  if (callContext > 0) this._lastContextTokens = callContext;
1122
1260
  }
1123
1261
  nextId() {
@@ -1273,22 +1411,42 @@ ${input.text}` : input.text;
1273
1411
  * Rejects if the child dies first.
1274
1412
  */
1275
1413
  async runPrompt(payload) {
1276
- await this.start();
1277
- await this.reconfig.flushBeforeTurn();
1278
- const id = this.nextId();
1279
- const turnPromise = new Promise((resolve, reject) => {
1280
- this.turnResolve = resolve;
1281
- this.turnReject = reject;
1282
- });
1283
- this.beginUsageTurn();
1284
- try {
1285
- this.send({ id, type: "prompt", ...payload });
1286
- } catch (err) {
1287
- this.turnResolve = null;
1288
- this.turnReject = null;
1289
- throw err;
1414
+ this.promptRetried = false;
1415
+ const epoch = this.killEpoch;
1416
+ for (; ; ) {
1417
+ await this.start();
1418
+ if (this.killEpoch !== epoch) {
1419
+ this.kill();
1420
+ throw new Error("omp process killed");
1421
+ }
1422
+ await this.reconfig.flushBeforeTurn();
1423
+ const id = this.nextId();
1424
+ const turnPromise = new Promise((resolve, reject) => {
1425
+ this.turnResolve = resolve;
1426
+ this.turnReject = reject;
1427
+ });
1428
+ this.turnOutputSeen = false;
1429
+ this.turnUserMessageSeen = false;
1430
+ this.beginUsageTurn();
1431
+ try {
1432
+ this.send({ id, type: "prompt", ...payload });
1433
+ } catch (err) {
1434
+ this.turnResolve = null;
1435
+ this.turnReject = null;
1436
+ throw err;
1437
+ }
1438
+ try {
1439
+ await turnPromise;
1440
+ return;
1441
+ } catch (err) {
1442
+ if (!(err instanceof EarlyOmpExit)) throw err;
1443
+ this.promptRetried = true;
1444
+ this.log.warn("omp exited before its first output; sending the prompt again", {
1445
+ code: err.code,
1446
+ signal: err.signal
1447
+ });
1448
+ }
1290
1449
  }
1291
- await turnPromise;
1292
1450
  }
1293
1451
  /**
1294
1452
  * Sends an in-band abort RPC to the omp process, requesting it to stop the
@@ -1314,18 +1472,27 @@ ${input.text}` : input.text;
1314
1472
  * `OmpHarness` to start a fresh session.
1315
1473
  */
1316
1474
  kill() {
1475
+ this.killEpoch++;
1317
1476
  const proc = this.proc;
1318
1477
  if (!proc) return;
1319
1478
  if (this.turnEnded) this.resolveTurn();
1320
1479
  else this.rejectTurn(new Error("omp process killed"));
1321
1480
  proc.kill("SIGTERM");
1481
+ const home = this.privateHome;
1482
+ this.homeGone = home ? removeHomeAfterExit(proc, home) : Promise.resolve();
1322
1483
  this.cleanup();
1323
1484
  }
1485
+ /** Stop omp and wait until the process has exited and its private home is deleted. */
1486
+ async dispose() {
1487
+ this.kill();
1488
+ await this.homeGone;
1489
+ }
1324
1490
  async resetSession() {
1325
1491
  this.kill();
1326
1492
  this.config = { ...this.config, resumeSessionId: void 0 };
1327
1493
  this._lastTokens = null;
1328
1494
  this._lastContextTokens = null;
1495
+ this._lastTurnCostUsd = 0;
1329
1496
  this._contextWindow = null;
1330
1497
  await this.start();
1331
1498
  }