@skaile/workspaces 6.6.0 → 6.8.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 (381) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/ai-sdk.js +10 -17
  3. package/dist/ai-sdk.js.map +1 -1
  4. package/dist/app-sdk/index.js +1 -1
  5. package/dist/{asset-feeds-WQ6YQPHV.js → asset-feeds-NU5UOO5F.js} +18 -18
  6. package/dist/{asset-feeds-WQ6YQPHV.js.map → asset-feeds-NU5UOO5F.js.map} +1 -1
  7. package/dist/asset-manager/catalog-deployer.js +4 -4
  8. package/dist/asset-manager/index.js +10 -10
  9. package/dist/asset-manager/installer.js +6 -6
  10. package/dist/asset-manager/renderers.js +5 -5
  11. package/dist/asset-manager/src/index.d.ts +89 -15
  12. package/dist/asset-manager/src/index.d.ts.map +1 -1
  13. package/dist/asset-manager/src/install-agent.d.ts +22 -1
  14. package/dist/asset-manager/src/install-agent.d.ts.map +1 -1
  15. package/dist/asset-manager/src/install-instances.d.ts +30 -1
  16. package/dist/asset-manager/src/install-instances.d.ts.map +1 -1
  17. package/dist/asset-manager/src/installer.d.ts +12 -0
  18. package/dist/asset-manager/src/installer.d.ts.map +1 -1
  19. package/dist/asset-manager/src/renderers.d.ts.map +1 -1
  20. package/dist/bridge/harnesses/claude-sdk.js +34 -20
  21. package/dist/bridge/harnesses/claude-sdk.js.map +1 -1
  22. package/dist/bridge/harnesses/codex.js +9 -8
  23. package/dist/bridge/harnesses/codex.js.map +1 -1
  24. package/dist/bridge/harnesses/continue.js +11 -9
  25. package/dist/bridge/harnesses/continue.js.map +1 -1
  26. package/dist/bridge/harnesses/echo.js +5 -4
  27. package/dist/bridge/harnesses/echo.js.map +1 -1
  28. package/dist/bridge/harnesses/gemini.js +8 -6
  29. package/dist/bridge/harnesses/goose.js +11 -9
  30. package/dist/bridge/harnesses/goose.js.map +1 -1
  31. package/dist/bridge/harnesses/omp.js +9 -7
  32. package/dist/bridge/harnesses/omp.js.map +1 -1
  33. package/dist/bridge/harnesses/opencode.js +11 -9
  34. package/dist/bridge/harnesses/opencode.js.map +1 -1
  35. package/dist/bridge/harnesses/qwen.js +9 -7
  36. package/dist/bridge/harnesses/qwen.js.map +1 -1
  37. package/dist/bridge/index.js +17 -15
  38. package/dist/bridge/src/ai-sdk.d.ts.map +1 -1
  39. package/dist/bridge/src/claude-sdk-surface.d.ts +2 -1
  40. package/dist/bridge/src/claude-sdk-surface.d.ts.map +1 -1
  41. package/dist/bridge/src/harness-binaries.d.ts +21 -0
  42. package/dist/bridge/src/harness-binaries.d.ts.map +1 -0
  43. package/dist/bridge/src/harness-model-check.d.ts +22 -6
  44. package/dist/bridge/src/harness-model-check.d.ts.map +1 -1
  45. package/dist/bridge/src/harnesses/claude-sdk.d.ts.map +1 -1
  46. package/dist/bridge/src/harnesses/claude-self-turns.d.ts.map +1 -1
  47. package/dist/bridge/src/harnesses/continue.d.ts.map +1 -1
  48. package/dist/bridge/src/harnesses/gemini.d.ts.map +1 -1
  49. package/dist/bridge/src/harnesses/goose.d.ts.map +1 -1
  50. package/dist/bridge/src/harnesses/omp-models-yml.d.ts.map +1 -1
  51. package/dist/bridge/src/harnesses/omp.d.ts.map +1 -1
  52. package/dist/bridge/src/harnesses/opencode.d.ts.map +1 -1
  53. package/dist/bridge/src/harnesses/qwen.d.ts.map +1 -1
  54. package/dist/bridge/src/index.d.ts +2 -1
  55. package/dist/bridge/src/index.d.ts.map +1 -1
  56. package/dist/bridge/src/types.d.ts +11 -0
  57. package/dist/bridge/src/types.d.ts.map +1 -1
  58. package/dist/{chunk-LBJ4M5J2.js → chunk-237BMOZW.js} +4 -4
  59. package/dist/{chunk-LBJ4M5J2.js.map → chunk-237BMOZW.js.map} +1 -1
  60. package/dist/{chunk-XYCYGN3Q.js → chunk-2I5HNM7K.js} +79 -20
  61. package/dist/chunk-2I5HNM7K.js.map +1 -0
  62. package/dist/{chunk-MXI3XWV6.js → chunk-3HSLJAMJ.js} +4 -4
  63. package/dist/{chunk-MXI3XWV6.js.map → chunk-3HSLJAMJ.js.map} +1 -1
  64. package/dist/{chunk-SCRYXAHH.js → chunk-3NJFPGEB.js} +6 -6
  65. package/dist/{chunk-SCRYXAHH.js.map → chunk-3NJFPGEB.js.map} +1 -1
  66. package/dist/{chunk-RHCEX2EV.js → chunk-3QX2X77G.js} +3 -3
  67. package/dist/{chunk-RHCEX2EV.js.map → chunk-3QX2X77G.js.map} +1 -1
  68. package/dist/{chunk-DS6UUCFG.js → chunk-4CD2R4MJ.js} +5 -4
  69. package/dist/chunk-4CD2R4MJ.js.map +1 -0
  70. package/dist/{chunk-7I5PNB2G.js → chunk-5TLMHB2U.js} +3 -3
  71. package/dist/{chunk-7I5PNB2G.js.map → chunk-5TLMHB2U.js.map} +1 -1
  72. package/dist/{chunk-KSH5CFQS.js → chunk-6PVRP3LW.js} +36 -5
  73. package/dist/chunk-6PVRP3LW.js.map +1 -0
  74. package/dist/{chunk-BSMW3PX2.js → chunk-6UP2EDFN.js} +4 -313
  75. package/dist/chunk-6UP2EDFN.js.map +1 -0
  76. package/dist/{chunk-U3UDOX6I.js → chunk-6ZM5X2XW.js} +6 -4
  77. package/dist/chunk-6ZM5X2XW.js.map +1 -0
  78. package/dist/{chunk-JRVQV7WC.js → chunk-757G6TTZ.js} +595 -126
  79. package/dist/chunk-757G6TTZ.js.map +1 -0
  80. package/dist/{chunk-G5SYFFMD.js → chunk-7NN3P6VF.js} +22 -5
  81. package/dist/chunk-7NN3P6VF.js.map +1 -0
  82. package/dist/{chunk-7PVGND4J.js → chunk-7YOHUX2M.js} +21 -14
  83. package/dist/chunk-7YOHUX2M.js.map +1 -0
  84. package/dist/{chunk-O7QZI6MQ.js → chunk-BB5EJLKZ.js} +2 -2
  85. package/dist/{chunk-O7QZI6MQ.js.map → chunk-BB5EJLKZ.js.map} +1 -1
  86. package/dist/{chunk-2M3VLKT2.js → chunk-BRPEW3UL.js} +3 -3
  87. package/dist/{chunk-2M3VLKT2.js.map → chunk-BRPEW3UL.js.map} +1 -1
  88. package/dist/{chunk-EPXZQIC6.js → chunk-DFP476EU.js} +8 -4
  89. package/dist/chunk-DFP476EU.js.map +1 -0
  90. package/dist/{chunk-B6N653ZG.js → chunk-DRHJRTAS.js} +6 -6
  91. package/dist/{chunk-B6N653ZG.js.map → chunk-DRHJRTAS.js.map} +1 -1
  92. package/dist/{chunk-4J7JQX4G.js → chunk-E3KABQS3.js} +4 -4
  93. package/dist/{chunk-4J7JQX4G.js.map → chunk-E3KABQS3.js.map} +1 -1
  94. package/dist/{chunk-MMOWIRHP.js → chunk-G44FFUMA.js} +12 -10
  95. package/dist/chunk-G44FFUMA.js.map +1 -0
  96. package/dist/{chunk-JIQUF3X2.js → chunk-G7NMF5WQ.js} +3 -3
  97. package/dist/{chunk-JIQUF3X2.js.map → chunk-G7NMF5WQ.js.map} +1 -1
  98. package/dist/{chunk-HGZN6JLP.js → chunk-HKRME377.js} +4 -4
  99. package/dist/{chunk-HGZN6JLP.js.map → chunk-HKRME377.js.map} +1 -1
  100. package/dist/{chunk-6A6HE5LW.js → chunk-HLAEYFUN.js} +3 -3
  101. package/dist/{chunk-6A6HE5LW.js.map → chunk-HLAEYFUN.js.map} +1 -1
  102. package/dist/{chunk-F4CZQD3T.js → chunk-I6XH46Q6.js} +4 -3
  103. package/dist/chunk-I6XH46Q6.js.map +1 -0
  104. package/dist/{chunk-7SJHSGUV.js → chunk-K6HCOTOZ.js} +16 -15
  105. package/dist/chunk-K6HCOTOZ.js.map +1 -0
  106. package/dist/{chunk-AQNW2FET.js → chunk-K7ZGY2BY.js} +351 -51
  107. package/dist/chunk-K7ZGY2BY.js.map +1 -0
  108. package/dist/{chunk-GTGWRKMJ.js → chunk-KHWGUXSF.js} +6 -6
  109. package/dist/{chunk-GTGWRKMJ.js.map → chunk-KHWGUXSF.js.map} +1 -1
  110. package/dist/{chunk-DI6J2PJB.js → chunk-KO3VSZQP.js} +47 -18
  111. package/dist/chunk-KO3VSZQP.js.map +1 -0
  112. package/dist/{chunk-VXYZ5M7Z.js → chunk-LJ6PLEDU.js} +64 -27
  113. package/dist/chunk-LJ6PLEDU.js.map +1 -0
  114. package/dist/{chunk-SHTXMERQ.js → chunk-LL5GMUQG.js} +10 -8
  115. package/dist/chunk-LL5GMUQG.js.map +1 -0
  116. package/dist/{chunk-TCH5UDKT.js → chunk-NW7Y5SNK.js} +10 -8
  117. package/dist/chunk-NW7Y5SNK.js.map +1 -0
  118. package/dist/{chunk-J4WKNJHO.js → chunk-O5Y7VMVQ.js} +15 -14
  119. package/dist/chunk-O5Y7VMVQ.js.map +1 -0
  120. package/dist/{chunk-6SXSVKQY.js → chunk-O7ADRMCR.js} +63 -14
  121. package/dist/chunk-O7ADRMCR.js.map +1 -0
  122. package/dist/{chunk-WW5NAU6N.js → chunk-ORXV3UB6.js} +3 -3
  123. package/dist/{chunk-WW5NAU6N.js.map → chunk-ORXV3UB6.js.map} +1 -1
  124. package/dist/{chunk-VJRL6ZK6.js → chunk-OSABUEWA.js} +3 -3
  125. package/dist/{chunk-VJRL6ZK6.js.map → chunk-OSABUEWA.js.map} +1 -1
  126. package/dist/{chunk-XD3RYAMR.js → chunk-PMZMG3HC.js} +6 -6
  127. package/dist/{chunk-XD3RYAMR.js.map → chunk-PMZMG3HC.js.map} +1 -1
  128. package/dist/{chunk-J262X4JU.js → chunk-Q6FKWPRO.js} +69 -16
  129. package/dist/chunk-Q6FKWPRO.js.map +1 -0
  130. package/dist/{chunk-E2EC6SAX.js → chunk-QC5BYUED.js} +51 -15
  131. package/dist/chunk-QC5BYUED.js.map +1 -0
  132. package/dist/{chunk-RAU5QPI6.js → chunk-QCR5AE5E.js} +5 -5
  133. package/dist/{chunk-RAU5QPI6.js.map → chunk-QCR5AE5E.js.map} +1 -1
  134. package/dist/{chunk-I5IF3JCG.js → chunk-QGA2OBUJ.js} +3 -3
  135. package/dist/{chunk-I5IF3JCG.js.map → chunk-QGA2OBUJ.js.map} +1 -1
  136. package/dist/{chunk-TUFNY6OD.js → chunk-QW5B3TEO.js} +10 -4
  137. package/dist/chunk-QW5B3TEO.js.map +1 -0
  138. package/dist/{chunk-Z4FERR4U.js → chunk-RDIGVPXX.js} +2 -2
  139. package/dist/{chunk-Z4FERR4U.js.map → chunk-RDIGVPXX.js.map} +1 -1
  140. package/dist/{chunk-SZKCE7EC.js → chunk-REAF7ZFA.js} +5 -5
  141. package/dist/{chunk-SZKCE7EC.js.map → chunk-REAF7ZFA.js.map} +1 -1
  142. package/dist/{chunk-OY22B7E2.js → chunk-SBNUXJ6E.js} +3 -3
  143. package/dist/{chunk-OY22B7E2.js.map → chunk-SBNUXJ6E.js.map} +1 -1
  144. package/dist/chunk-SILFO5RY.js +315 -0
  145. package/dist/chunk-SILFO5RY.js.map +1 -0
  146. package/dist/{chunk-6ARPZHOV.js → chunk-TMJBEGS4.js} +35 -6
  147. package/dist/chunk-TMJBEGS4.js.map +1 -0
  148. package/dist/{chunk-5XHQBCB5.js → chunk-WFK4MUBL.js} +21 -7
  149. package/dist/chunk-WFK4MUBL.js.map +1 -0
  150. package/dist/chunk-WWSRIT3J.js +59 -0
  151. package/dist/chunk-WWSRIT3J.js.map +1 -0
  152. package/dist/{chunk-N2PBAXAA.js → chunk-XCGDRLMH.js} +3 -3
  153. package/dist/{chunk-N2PBAXAA.js.map → chunk-XCGDRLMH.js.map} +1 -1
  154. package/dist/{chunk-YN6N3RBM.js → chunk-XIIIGLSL.js} +47 -11
  155. package/dist/chunk-XIIIGLSL.js.map +1 -0
  156. package/dist/{chunk-65UAC3ZR.js → chunk-Y6LC5PEZ.js} +4 -3
  157. package/dist/chunk-Y6LC5PEZ.js.map +1 -0
  158. package/dist/{chunk-KSUT5KAE.js → chunk-YEOG7CWQ.js} +3 -3
  159. package/dist/{chunk-KSUT5KAE.js.map → chunk-YEOG7CWQ.js.map} +1 -1
  160. package/dist/{chunk-5ETYBC2X.js → chunk-YGP6XEPA.js} +6 -6
  161. package/dist/{chunk-5ETYBC2X.js.map → chunk-YGP6XEPA.js.map} +1 -1
  162. package/dist/{chunk-2TLPC6TQ.js → chunk-YHNPWSSH.js} +41 -19
  163. package/dist/chunk-YHNPWSSH.js.map +1 -0
  164. package/dist/{chunk-6RHWTZPT.js → chunk-YZD7DUEF.js} +3 -3
  165. package/dist/{chunk-6RHWTZPT.js.map → chunk-YZD7DUEF.js.map} +1 -1
  166. package/dist/{chunk-4BFEPZ6J.js → chunk-ZBA4P5TD.js} +3 -3
  167. package/dist/{chunk-4BFEPZ6J.js.map → chunk-ZBA4P5TD.js.map} +1 -1
  168. package/dist/{claude-code-LZH7Y4Y5.js → claude-code-AESK7XO4.js} +4 -4
  169. package/dist/{claude-code-LZH7Y4Y5.js.map → claude-code-AESK7XO4.js.map} +1 -1
  170. package/dist/cli/index.js +474 -198
  171. package/dist/cli/index.js.map +1 -1
  172. package/dist/cli/src/agent-pins.d.ts +9 -3
  173. package/dist/cli/src/agent-pins.d.ts.map +1 -1
  174. package/dist/cli/src/commands/asset-cmd.d.ts +1 -1
  175. package/dist/cli/src/commands/asset-cmd.d.ts.map +1 -1
  176. package/dist/cli/src/commands/cache.d.ts.map +1 -1
  177. package/dist/cli/src/commands/catalog.d.ts +2 -0
  178. package/dist/cli/src/commands/catalog.d.ts.map +1 -1
  179. package/dist/cli/src/commands/config.d.ts.map +1 -1
  180. package/dist/cli/src/commands/harness-preflight.d.ts +38 -0
  181. package/dist/cli/src/commands/harness-preflight.d.ts.map +1 -0
  182. package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
  183. package/dist/cli/src/commands/library-index.d.ts +16 -0
  184. package/dist/cli/src/commands/library-index.d.ts.map +1 -1
  185. package/dist/cli/src/commands/migrate-assets.d.ts +5 -0
  186. package/dist/cli/src/commands/migrate-assets.d.ts.map +1 -1
  187. package/dist/cli/src/commands/migrate-harness.d.ts +15 -7
  188. package/dist/cli/src/commands/migrate-harness.d.ts.map +1 -1
  189. package/dist/cli/src/commands/migrate.d.ts.map +1 -1
  190. package/dist/cli/src/commands/outdated.d.ts.map +1 -1
  191. package/dist/cli/src/commands/plugin-registry-cmd.d.ts.map +1 -1
  192. package/dist/cli/src/commands/project.d.ts +14 -0
  193. package/dist/cli/src/commands/project.d.ts.map +1 -1
  194. package/dist/cli/src/commands/run.d.ts.map +1 -1
  195. package/dist/cli/src/commands/serve-preflight.d.ts +6 -5
  196. package/dist/cli/src/commands/serve-preflight.d.ts.map +1 -1
  197. package/dist/cli/src/commands/serve.d.ts.map +1 -1
  198. package/dist/cli/src/commands/session.d.ts.map +1 -1
  199. package/dist/cli/src/commands/source.d.ts +11 -0
  200. package/dist/cli/src/commands/source.d.ts.map +1 -1
  201. package/dist/cli/src/commands/update.d.ts.map +1 -1
  202. package/dist/cli/src/commands/validate-instances.d.ts +6 -0
  203. package/dist/cli/src/commands/validate-instances.d.ts.map +1 -1
  204. package/dist/cli/src/commands/validate.d.ts.map +1 -1
  205. package/dist/cli/src/commands/why.d.ts.map +1 -1
  206. package/dist/cli/src/plugin-store/reconcile.d.ts.map +1 -1
  207. package/dist/cli/src/session-hint.d.ts +7 -0
  208. package/dist/cli/src/session-hint.d.ts.map +1 -0
  209. package/dist/connectors/config.js +3 -3
  210. package/dist/connectors/index.js +21 -19
  211. package/dist/connectors/src/managed-gitconfig.d.ts +6 -4
  212. package/dist/connectors/src/managed-gitconfig.d.ts.map +1 -1
  213. package/dist/{connectors-HU5MHSUJ.js → connectors-5ZZRVAPD.js} +24 -22
  214. package/dist/{connectors-HU5MHSUJ.js.map → connectors-5ZZRVAPD.js.map} +1 -1
  215. package/dist/connectors-shared/index.js +2 -2
  216. package/dist/core/index.js +4 -4
  217. package/dist/core/publish-manifest.js +1 -1
  218. package/dist/core/runtime-assets.js +3 -3
  219. package/dist/core/src/agent-instances.d.ts +11 -0
  220. package/dist/core/src/agent-instances.d.ts.map +1 -1
  221. package/dist/core/src/index.d.ts +3 -2
  222. package/dist/core/src/index.d.ts.map +1 -1
  223. package/dist/core/src/publish-manifest.d.ts +20 -6
  224. package/dist/core/src/publish-manifest.d.ts.map +1 -1
  225. package/dist/core/src/repo-manager.d.ts +9 -0
  226. package/dist/core/src/repo-manager.d.ts.map +1 -1
  227. package/dist/core/src/run-state-ignore.d.ts +17 -0
  228. package/dist/core/src/run-state-ignore.d.ts.map +1 -0
  229. package/dist/core/src/workspace-config.d.ts.map +1 -1
  230. package/dist/core/workspace-config.js +2 -2
  231. package/dist/deploy/index.js +4 -4
  232. package/dist/discovery/index.js +2 -2
  233. package/dist/discovery/src/builtin-providers.d.ts.map +1 -1
  234. package/dist/discovery/src/discover-manifest.d.ts.map +1 -1
  235. package/dist/discovery/src/tree-entries.d.ts.map +1 -1
  236. package/dist/{ensure-sources-CAMWJTMR.js → ensure-sources-VLJ7AUUK.js} +26 -24
  237. package/dist/ensure-sources-VLJ7AUUK.js.map +1 -0
  238. package/dist/factory-assets/connectors/box.js +21 -19
  239. package/dist/factory-assets/connectors/deploy.js +21 -19
  240. package/dist/factory-assets/connectors/devserver.js +21 -19
  241. package/dist/factory-assets/connectors/flow/adapter.js +21 -19
  242. package/dist/factory-assets/connectors/flow/contract/schema.d.ts +3 -3
  243. package/dist/factory-assets/connectors/flow/engine/router-settlement.d.ts +2 -0
  244. package/dist/factory-assets/connectors/flow/engine/router-settlement.d.ts.map +1 -1
  245. package/dist/factory-assets/connectors/flow/engine.js +5 -5
  246. package/dist/factory-assets/connectors/flow/run-flow.js +22 -20
  247. package/dist/factory-assets/connectors/flow.js +21 -19
  248. package/dist/factory-assets/connectors/git/CONNECTOR.md +4 -1
  249. package/dist/factory-assets/connectors/git/exec.d.ts.map +1 -1
  250. package/dist/factory-assets/connectors/git.js +21 -19
  251. package/dist/factory-assets/connectors/gmail.js +21 -19
  252. package/dist/factory-assets/connectors/googledrive.js +21 -19
  253. package/dist/factory-assets/connectors/local.js +21 -19
  254. package/dist/factory-assets/connectors/mattermost.js +21 -19
  255. package/dist/factory-assets/connectors/memory.js +21 -19
  256. package/dist/factory-assets/connectors/minio.js +21 -19
  257. package/dist/factory-assets/connectors/postgres.js +21 -19
  258. package/dist/factory-assets/connectors/s3.js +21 -19
  259. package/dist/factory-assets/connectors/sharepoint.js +21 -19
  260. package/dist/factory-assets/connectors/sqlite.js +21 -19
  261. package/dist/factory-assets/connectors/static-server.js +21 -19
  262. package/dist/factory-assets/connectors/tunnel.js +21 -19
  263. package/dist/factory-assets/connectors/webdav.js +21 -19
  264. package/dist/factory-assets/connectors/xstate-store.js +21 -19
  265. package/dist/factory-assets/connectors/xstate.js +21 -19
  266. package/dist/factory-assets/skills/authoring-skaile-assets/SKILL.md +14 -1
  267. package/dist/{flows-GVOVQGQW.js → flows-I6ODIPZZ.js} +7 -7
  268. package/dist/{flows-GVOVQGQW.js.map → flows-I6ODIPZZ.js.map} +1 -1
  269. package/dist/{helpers-WMCCODAV.js → helpers-APXGTZ5A.js} +26 -24
  270. package/dist/{helpers-WMCCODAV.js.map → helpers-APXGTZ5A.js.map} +1 -1
  271. package/dist/library/index.js +7 -7
  272. package/dist/library/install.js +2 -2
  273. package/dist/library/src/manifest-writer.d.ts +5 -0
  274. package/dist/library/src/manifest-writer.d.ts.map +1 -1
  275. package/dist/{library-publish-UQQMHTND.js → library-publish-B5HL4OBE.js} +47 -45
  276. package/dist/library-publish-B5HL4OBE.js.map +1 -0
  277. package/dist/model-endpoint/index.js +8 -7
  278. package/dist/{open-library-OJ4HT2X4.js → open-library-F56D46K7.js} +29 -27
  279. package/dist/{open-library-OJ4HT2X4.js.map → open-library-F56D46K7.js.map} +1 -1
  280. package/dist/{open-registry-LWGIOJDK.js → open-registry-RZW2AFD6.js} +11 -11
  281. package/dist/{open-registry-LWGIOJDK.js.map → open-registry-RZW2AFD6.js.map} +1 -1
  282. package/dist/{paths-FR2752HV.js → paths-RPK5PNZQ.js} +7 -7
  283. package/dist/{paths-FR2752HV.js.map → paths-RPK5PNZQ.js.map} +1 -1
  284. package/dist/{plugin-store-IALJUBN2.js → plugin-store-OJTERUEZ.js} +7 -7
  285. package/dist/{plugin-store-IALJUBN2.js.map → plugin-store-OJTERUEZ.js.map} +1 -1
  286. package/dist/{project-UQFCYHYS.js → project-GLTP6VFV.js} +43 -41
  287. package/dist/{project-UQFCYHYS.js.map → project-GLTP6VFV.js.map} +1 -1
  288. package/dist/resolver/index.js +4 -4
  289. package/dist/runner/index.js +32 -30
  290. package/dist/runner/src/capability-roundtrip.d.ts +8 -7
  291. package/dist/runner/src/capability-roundtrip.d.ts.map +1 -1
  292. package/dist/runner/src/composition/run-snapshot.d.ts +7 -1
  293. package/dist/runner/src/composition/run-snapshot.d.ts.map +1 -1
  294. package/dist/runner/src/serve.d.ts.map +1 -1
  295. package/dist/runner/src/turn-scheduler.d.ts +8 -0
  296. package/dist/runner/src/turn-scheduler.d.ts.map +1 -1
  297. package/dist/runner/src/turn-visibility.d.ts +97 -0
  298. package/dist/runner/src/turn-visibility.d.ts.map +1 -0
  299. package/dist/sdk/asset-manager.js +10 -10
  300. package/dist/sdk/bridge.js +17 -15
  301. package/dist/sdk/core.js +4 -4
  302. package/dist/sdk/flow.js +5 -5
  303. package/dist/sdk/index.js +32 -30
  304. package/dist/sdk/index.js.map +1 -1
  305. package/dist/sdk/resolver.js +4 -4
  306. package/dist/sdk/runner.js +32 -30
  307. package/dist/sdk/session.js +2 -2
  308. package/dist/sdk/transport/ws/server.js +5 -5
  309. package/dist/sdk/transport/ws.js +5 -5
  310. package/dist/sdk/transport.js +5 -5
  311. package/dist/sdk/types.js +1 -1
  312. package/dist/serve-preflight-EHLBSNUE.js +58 -0
  313. package/dist/{serve-preflight-TYEKHC32.js.map → serve-preflight-EHLBSNUE.js.map} +1 -1
  314. package/dist/session/index.js +2 -2
  315. package/dist/session/src/dispatcher.d.ts.map +1 -1
  316. package/dist/{setup-4JV2IMCB.js → setup-PMZLMFCD.js} +27 -25
  317. package/dist/setup-PMZLMFCD.js.map +1 -0
  318. package/dist/{skills-6QTKFMLW.js → skills-KHHW3RZ3.js} +6 -6
  319. package/dist/{skills-6QTKFMLW.js.map → skills-KHHW3RZ3.js.map} +1 -1
  320. package/dist/source-QNSGAM3S.js +88 -0
  321. package/dist/{source-XYMMJVKR.js.map → source-QNSGAM3S.js.map} +1 -1
  322. package/dist/{source-manifest-publish-SZFGGKB4.js → source-manifest-publish-AI725AVE.js} +44 -42
  323. package/dist/source-manifest-publish-AI725AVE.js.map +1 -0
  324. package/dist/transport/index.js +5 -5
  325. package/dist/transport/ws/server.js +5 -5
  326. package/dist/transport/ws.js +5 -5
  327. package/dist/tui/index.js +56 -37
  328. package/dist/tui/index.js.map +1 -1
  329. package/dist/tui/src/repl.d.ts +10 -0
  330. package/dist/tui/src/repl.d.ts.map +1 -1
  331. package/dist/types/index.js +1 -1
  332. package/dist/types/src/capabilities.d.ts +3 -2
  333. package/dist/types/src/capabilities.d.ts.map +1 -1
  334. package/dist/types/src/events.d.ts +11 -10
  335. package/dist/types/src/events.d.ts.map +1 -1
  336. package/dist/types/src/index.d.ts +2 -0
  337. package/dist/types/src/index.d.ts.map +1 -1
  338. package/dist/types/src/manifests/preset.d.ts +5 -5
  339. package/dist/types/src/protocol.d.ts +3 -0
  340. package/dist/types/src/protocol.d.ts.map +1 -1
  341. package/dist/types/src/turn-visibility.d.ts +50 -0
  342. package/dist/types/src/turn-visibility.d.ts.map +1 -0
  343. package/dist/types/src/version.d.ts +18 -5
  344. package/dist/types/src/version.d.ts.map +1 -1
  345. package/dist/workspace-plugin/adapters/mcp.js +24 -22
  346. package/dist/workspace-plugin/adapters/omp.js +14 -14
  347. package/dist/workspace-plugin/index.js +1 -1
  348. package/package.json +1 -1
  349. package/dist/chunk-2TLPC6TQ.js.map +0 -1
  350. package/dist/chunk-5XHQBCB5.js.map +0 -1
  351. package/dist/chunk-65UAC3ZR.js.map +0 -1
  352. package/dist/chunk-6ARPZHOV.js.map +0 -1
  353. package/dist/chunk-6SXSVKQY.js.map +0 -1
  354. package/dist/chunk-7PVGND4J.js.map +0 -1
  355. package/dist/chunk-7SJHSGUV.js.map +0 -1
  356. package/dist/chunk-AQNW2FET.js.map +0 -1
  357. package/dist/chunk-BSMW3PX2.js.map +0 -1
  358. package/dist/chunk-DI6J2PJB.js.map +0 -1
  359. package/dist/chunk-DS6UUCFG.js.map +0 -1
  360. package/dist/chunk-E2EC6SAX.js.map +0 -1
  361. package/dist/chunk-EPXZQIC6.js.map +0 -1
  362. package/dist/chunk-F4CZQD3T.js.map +0 -1
  363. package/dist/chunk-G5SYFFMD.js.map +0 -1
  364. package/dist/chunk-J262X4JU.js.map +0 -1
  365. package/dist/chunk-J4WKNJHO.js.map +0 -1
  366. package/dist/chunk-JRVQV7WC.js.map +0 -1
  367. package/dist/chunk-KSH5CFQS.js.map +0 -1
  368. package/dist/chunk-MMOWIRHP.js.map +0 -1
  369. package/dist/chunk-SHTXMERQ.js.map +0 -1
  370. package/dist/chunk-TCH5UDKT.js.map +0 -1
  371. package/dist/chunk-TUFNY6OD.js.map +0 -1
  372. package/dist/chunk-U3UDOX6I.js.map +0 -1
  373. package/dist/chunk-VXYZ5M7Z.js.map +0 -1
  374. package/dist/chunk-XYCYGN3Q.js.map +0 -1
  375. package/dist/chunk-YN6N3RBM.js.map +0 -1
  376. package/dist/ensure-sources-CAMWJTMR.js.map +0 -1
  377. package/dist/library-publish-UQQMHTND.js.map +0 -1
  378. package/dist/serve-preflight-TYEKHC32.js +0 -56
  379. package/dist/setup-4JV2IMCB.js.map +0 -1
  380. package/dist/source-XYMMJVKR.js +0 -86
  381. package/dist/source-manifest-publish-SZFGGKB4.js.map +0 -1
@@ -1,34 +1,35 @@
1
- import { WorkspacePlugin } from './chunk-Z4FERR4U.js';
2
- import { buildWorkspaceToolDefs } from './chunk-GTGWRKMJ.js';
1
+ import { WorkspacePlugin } from './chunk-RDIGVPXX.js';
2
+ import { buildWorkspaceToolDefs } from './chunk-KHWGUXSF.js';
3
3
  import { findAiAssetsRoot } from './chunk-HQAPUPBE.js';
4
- import { startModelEndpoint } from './chunk-SZKCE7EC.js';
5
- import { WebSocketServerTransport } from './chunk-6A6HE5LW.js';
4
+ import { startModelEndpoint } from './chunk-REAF7ZFA.js';
5
+ import { WebSocketServerTransport } from './chunk-HLAEYFUN.js';
6
6
  import { assembleSystemPrompt, buildCapabilitiesPromptSection } from './chunk-W3UDISS2.js';
7
7
  import { prepareNativePolicy, codexInstanceEnvironment, parseCodexCredential, parseCodexRefreshInput, parseCodexRefreshResult } from './chunk-CMXDFTA2.js';
8
- import { resolveFlowPath } from './chunk-5ETYBC2X.js';
8
+ import { resolveFlowPath } from './chunk-YGP6XEPA.js';
9
9
  import { findAiAssetsRoot as findAiAssetsRoot$1, deployCatalogEntry, undeployCatalogEntry } from './chunk-USSP43U3.js';
10
- import { ConnectFailureCarryOver, registerBuiltinConnectors, listConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, buildSdkConnectorTools, buildLazySdkFlowTools, describeFlowOperations, buildConnectorToolDefs, writeUserGitconfigInclude, buildFlowToolDefs, SessionNodeExecutor, SessionSubpromptRunner, ClassifierSubpromptRunner, SessionInlineSubFlowRunner, driveOrchestratorTurn, buildSdkFlowTools } from './chunk-VXYZ5M7Z.js';
11
- import { loadYamlConnectorDeclarations, withMaterializedConnectorDeclarations, SecretProviderChain, ConnectorStartupError, isKnownSecretRef, EnvSecretProvider, PreMintedSecretProvider, InMemorySecretProvider, resolvedConfigToDeclarations, deriveSingleMaterializedConnectorDeclaration } from './chunk-4BFEPZ6J.js';
12
- import { EventNormalizer } from './chunk-YN6N3RBM.js';
13
- import { sessionSurfaceNotice, approvalCardOf, APPROVE_ONCE, DENY, probeResumeTranscript, transcriptStoreForRuntime } from './chunk-U3UDOX6I.js';
14
- import { codexLoginFallbackNotice } from './chunk-65UAC3ZR.js';
10
+ import { ConnectFailureCarryOver, registerBuiltinConnectors, listConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, buildSdkConnectorTools, buildLazySdkFlowTools, describeFlowOperations, buildConnectorToolDefs, writeUserGitconfigInclude, buildFlowToolDefs, SessionNodeExecutor, SessionSubpromptRunner, ClassifierSubpromptRunner, SessionInlineSubFlowRunner, driveOrchestratorTurn, buildSdkFlowTools } from './chunk-LJ6PLEDU.js';
11
+ import { loadYamlConnectorDeclarations, withMaterializedConnectorDeclarations, SecretProviderChain, ConnectorStartupError, isKnownSecretRef, EnvSecretProvider, PreMintedSecretProvider, InMemorySecretProvider, resolvedConfigToDeclarations, deriveSingleMaterializedConnectorDeclaration } from './chunk-ZBA4P5TD.js';
12
+ import { EventNormalizer } from './chunk-XIIIGLSL.js';
13
+ import { sessionSurfaceNotice, approvalCardOf, APPROVE_ONCE, DENY, probeResumeTranscript, transcriptStoreForRuntime } from './chunk-6ZM5X2XW.js';
14
+ import { codexLoginFallbackNotice } from './chunk-Y6LC5PEZ.js';
15
15
  import { CodexNativeStateUnavailable } from './chunk-LOO5CB5M.js';
16
- import { dispatchCapability } from './chunk-KSUT5KAE.js';
16
+ import { dispatchCapability } from './chunk-YEOG7CWQ.js';
17
17
  import { classifyClaudeSdkError } from './chunk-5DE3DGVR.js';
18
18
  import { agentExecRequested } from './chunk-7DN6JKP2.js';
19
- import { toAgentEffort, toMergedRegistry } from './chunk-WW5NAU6N.js';
20
- import { unresolvedProviderCredentials, harnessCapabilities, createHarness, catalogLayer, providerCredentialEnvName, registryCredentialEnv, AI_PROVIDER_PRESETS, supportsLiveToolUpdates } from './chunk-BSMW3PX2.js';
21
- import { loadFlow } from './chunk-5XHQBCB5.js';
19
+ import { toAgentEffort, toMergedRegistry } from './chunk-ORXV3UB6.js';
20
+ import { unresolvedProviderCredentials, harnessCapabilities, createHarness, providerCredentialEnvName, registryCredentialEnv, supportsLiveToolUpdates } from './chunk-SILFO5RY.js';
21
+ import { catalogLayer, AI_PROVIDER_PRESETS } from './chunk-6UP2EDFN.js';
22
+ import { loadFlow } from './chunk-WFK4MUBL.js';
22
23
  import { renderStimulusPrompt } from './chunk-WD3L5QSU.js';
23
- import { TERMINAL_AGENT_RUN_STATUSES, withActivityLabelJsonSchema, TOOL_ACTIVITY_PROMPT_SECTION, SESSION_ROOT_CONNECTOR_ID, PLATFORM_BLOCKS_RUNTIME_FEATURE, PROTOCOL_VERSION, deliveryClassOf } from './chunk-G5SYFFMD.js';
24
- import { knowledgeKindProvider, scanLibraryRoot, LocalIndex } from './chunk-MMOWIRHP.js';
25
- import { createDefaultKindRegistry } from './chunk-J4WKNJHO.js';
24
+ import { TURN_VISIBILITY_EVENT_TYPES, TERMINAL_AGENT_RUN_STATUSES, withActivityLabelJsonSchema, TOOL_ACTIVITY_PROMPT_SECTION, SESSION_ROOT_CONNECTOR_ID, PLATFORM_BLOCKS_RUNTIME_FEATURE, TURN_VISIBILITY_RUNTIME_FEATURE, PROTOCOL_VERSION, deliveryClassOf } from './chunk-7NN3P6VF.js';
25
+ import { knowledgeKindProvider, scanLibraryRoot, LocalIndex } from './chunk-G44FFUMA.js';
26
+ import { createDefaultKindRegistry } from './chunk-O5Y7VMVQ.js';
26
27
  import { parseFlowDefinition } from './chunk-JRN5QF4C.js';
27
28
  import { BindingSchema, effectiveComposes, AgentManifestSchema, AgentTriggerSchema, ANTHROPIC_MODEL_ALIASES } from './chunk-VT6G5AJV.js';
28
- import { readLock, buildAgentPromptSections, resolveSettings, loadProviderRegistry, resolveLibraryDir } from './chunk-6ARPZHOV.js';
29
- import { resolveRuntimeAssets } from './chunk-JIQUF3X2.js';
29
+ import { readLock, ensureRunStateIgnored, buildAgentPromptSections, resolveSettings, loadProviderRegistry, resolveLibraryDir } from './chunk-TMJBEGS4.js';
30
+ import { resolveRuntimeAssets } from './chunk-G7NMF5WQ.js';
30
31
  import { DEFAULT_HARNESS_ID, resolveHarnessPaths } from './chunk-C5HFK34M.js';
31
- import { matchPin, DEFAULT_AGENT_INSTANCE_ID, effectiveAgentInstances, resolveAgentDefinitionDir, AgentRefResolutionError, resolveSkWorkspaceConfig, resolveAgentDir, agentSourceCacheDir, loadMcpServerDeclarations, COMPACTION_DEFAULTS, resolveCompactionThresholdPercent, getGlobalCacheDir, sourceCacheKey, validateAssetRecipeAttr, deriveSingleMaterializedMcpDeclaration, stageMaterializedSkills, readSkillAllowList, isStagedSkillMarkerFor, unstageSkill, STAGED_SKILL_MARKER } from './chunk-6SXSVKQY.js';
32
+ import { matchPin, DEFAULT_AGENT_INSTANCE_ID, effectiveAgentInstances, resolveAgentDefinitionDir, AgentRefResolutionError, resolveSkWorkspaceConfig, resolveAgentDir, agentSourceCacheDir, loadMcpServerDeclarations, COMPACTION_DEFAULTS, resolveCompactionThresholdPercent, getGlobalCacheDir, sourceCacheKey, validateAssetRecipeAttr, deriveSingleMaterializedMcpDeclaration, stageMaterializedSkills, readSkillAllowList, isStagedSkillMarkerFor, unstageSkill, STAGED_SKILL_MARKER } from './chunk-O7ADRMCR.js';
32
33
  import { globalSkaileDir, globalCacheRoot } from './chunk-L5VSIPQD.js';
33
34
  import { harnessNameForHarnessId, SUPPORTED_HARNESSES, HARNESS_TARGETS } from './chunk-VTETQCR6.js';
34
35
  import { withFsDeadline, FsDeadlineError, fsDeadlineMs, parseFrontmatter, tryWithFsDeadline } from './chunk-GNUA7XT2.js';
@@ -1429,6 +1430,22 @@ function buildCompositionRunSnapshot(sessionId, items, promptVersion) {
1429
1430
  items: entries
1430
1431
  };
1431
1432
  }
1433
+ var MAX_RUN_SNAPSHOTS = 20;
1434
+ async function pruneRunSnapshots(projectDir, except, keep) {
1435
+ const dir = path3.join(projectDir, RUN_SNAPSHOT_DIR);
1436
+ try {
1437
+ const names = (await fs8.readdir(dir)).filter((n) => n.endsWith(".json"));
1438
+ const dated = await Promise.all(
1439
+ names.map(async (name) => ({
1440
+ file: path3.join(dir, name),
1441
+ mtime: (await fs8.stat(path3.join(dir, name))).mtimeMs
1442
+ }))
1443
+ );
1444
+ const stale = dated.filter((d) => d.file !== except).sort((a, b) => b.mtime - a.mtime).slice(Math.max(keep - 1, 0));
1445
+ await Promise.all(stale.map((d) => fs8.rm(d.file, { force: true })));
1446
+ } catch {
1447
+ }
1448
+ }
1432
1449
  async function saveCompositionRunSnapshot(projectDir, snapshot) {
1433
1450
  const file = compositionRunSnapshotPath(projectDir, snapshot.session_id);
1434
1451
  await fs8.mkdir(path3.dirname(file), { recursive: true });
@@ -1436,6 +1453,8 @@ async function saveCompositionRunSnapshot(projectDir, snapshot) {
1436
1453
  await fs8.writeFile(tmp, `${JSON.stringify(snapshot, null, 2)}
1437
1454
  `, "utf-8");
1438
1455
  await fs8.rename(tmp, file);
1456
+ ensureRunStateIgnored(projectDir);
1457
+ await pruneRunSnapshots(projectDir, file, MAX_RUN_SNAPSHOTS);
1439
1458
  }
1440
1459
 
1441
1460
  // runner/src/composition/resolve-instance.ts
@@ -7126,14 +7145,16 @@ function buildClientCapabilityHandler(args) {
7126
7145
  const gen = args.generateCallId ?? (() => `cap-${Date.now()}-${Math.floor(Math.random() * 1e9)}`);
7127
7146
  return async (input, ctx) => {
7128
7147
  const callId = ctx?.callId ?? gen();
7148
+ const refused2 = () => new Error(`Capability ${args.wire.name} refused: its readers are unknown`);
7129
7149
  if (args.wire.fireAndForget) {
7130
- args.emit({
7150
+ const sent = args.emit({
7131
7151
  type: "capability_invoked",
7132
7152
  callId,
7133
7153
  name: args.wire.name,
7134
7154
  input,
7135
7155
  invokedBy: "agent"
7136
7156
  });
7157
+ if (sent === false) throw refused2();
7137
7158
  return {};
7138
7159
  }
7139
7160
  if (args.pending.has(callId)) {
@@ -7151,19 +7172,24 @@ function buildClientCapabilityHandler(args) {
7151
7172
  );
7152
7173
  }, timeoutMs);
7153
7174
  args.pending.set(callId, { resolve: resolve5, reject, timer });
7154
- args.emit({
7175
+ const sent = args.emit({
7155
7176
  type: "capability_invoked",
7156
7177
  callId,
7157
7178
  name: args.wire.name,
7158
7179
  input,
7159
7180
  invokedBy: "agent"
7160
7181
  });
7182
+ if (sent === false) {
7183
+ clearTimeout(timer);
7184
+ args.pending.delete(callId);
7185
+ reject(refused2());
7186
+ }
7161
7187
  });
7162
7188
  };
7163
7189
  }
7164
7190
  async function dispatchRunnerCapabilityInvocation(cmd, deps) {
7165
7191
  try {
7166
- const result = await deps.invoke(cmd.name, cmd.input);
7192
+ const result = withErrorMirror(await deps.invoke(cmd.name, cmd.input));
7167
7193
  deps.emit({ type: "capability_result", callId: cmd.callId, result });
7168
7194
  } catch (err) {
7169
7195
  deps.emit({
@@ -7173,6 +7199,12 @@ async function dispatchRunnerCapabilityInvocation(cmd, deps) {
7173
7199
  });
7174
7200
  }
7175
7201
  }
7202
+ function withErrorMirror(result) {
7203
+ if (typeof result !== "object" || result === null) return result;
7204
+ const r = result;
7205
+ if (r.ok !== false || typeof r.message !== "string" || "error" in r) return result;
7206
+ return { ...result, error: r.message };
7207
+ }
7176
7208
  function capabilityFailure(name, err) {
7177
7209
  if (err instanceof Error && err.name === "ZodError" && "issues" in err) {
7178
7210
  const issues = err.issues;
@@ -9696,6 +9728,7 @@ var TurnScheduler = class {
9696
9728
  this.deps.logPhase("harness_start", startedAt, { ok, attempts });
9697
9729
  }
9698
9730
  if (!endTurn) return;
9731
+ this.deps.turnVisibility?.enter(turn.visibility ?? null);
9699
9732
  this.deps.turnEnd?.begin();
9700
9733
  const endsBefore = this.turnEndReports;
9701
9734
  try {
@@ -9709,6 +9742,7 @@ var TurnScheduler = class {
9709
9742
  } finally {
9710
9743
  this.deps.turnEnd?.end();
9711
9744
  this.deps.turnEnd?.settle();
9745
+ this.deps.turnVisibility?.exit();
9712
9746
  endTurn();
9713
9747
  }
9714
9748
  }
@@ -9789,6 +9823,211 @@ function awaitAgentEnd(harness, prompt, timeoutMs) {
9789
9823
  });
9790
9824
  }
9791
9825
 
9826
+ // runner/src/turn-visibility.ts
9827
+ var AGENT_RECIPIENT = "__agent__";
9828
+ var STAMPED_TYPES = new Set(TURN_VISIBILITY_EVENT_TYPES);
9829
+ function turnVisibilityOf(cmd) {
9830
+ if (cmd.visibilityMode !== "Private") return null;
9831
+ const ids = Array.isArray(cmd.privateRecipientIds) ? cmd.privateRecipientIds : [];
9832
+ const readers = [
9833
+ ...new Set(
9834
+ ids.filter(
9835
+ (id) => typeof id === "string" && id.length > 0 && id !== AGENT_RECIPIENT
9836
+ )
9837
+ )
9838
+ ];
9839
+ if (readers.length === 0) return "no-readers";
9840
+ return { visibilityMode: "Private", privateRecipientIds: readers };
9841
+ }
9842
+ var UNKNOWN = /* @__PURE__ */ Symbol("unknown-owner");
9843
+ var MAX_TRACKED = 4096;
9844
+ var MAX_OUTSTANDING = 256;
9845
+ var PARENTLESS_CHILD_TYPES = /* @__PURE__ */ new Set([
9846
+ "capability_invoked",
9847
+ "render_invoked",
9848
+ "custom_message"
9849
+ ]);
9850
+ var QUESTION_TOOL = "AskUserQuestion";
9851
+ function intersect(a, b) {
9852
+ if (a === UNKNOWN || b === UNKNOWN) return UNKNOWN;
9853
+ if (a === null) return b;
9854
+ if (b === null) return a;
9855
+ const readers = a.privateRecipientIds.filter((id) => b.privateRecipientIds.includes(id));
9856
+ return readers.length > 0 ? { visibilityMode: "Private", privateRecipientIds: readers } : UNKNOWN;
9857
+ }
9858
+ var BoundedMap = class {
9859
+ entries = /* @__PURE__ */ new Map();
9860
+ set(key, value) {
9861
+ this.entries.delete(key);
9862
+ this.entries.set(key, value);
9863
+ if (this.entries.size > MAX_TRACKED) {
9864
+ const oldest = this.entries.keys().next().value;
9865
+ if (oldest !== void 0) this.entries.delete(oldest);
9866
+ }
9867
+ }
9868
+ resolve(key) {
9869
+ return this.entries.has(key) ? this.entries.get(key) : UNKNOWN;
9870
+ }
9871
+ };
9872
+ var WITHHELD_KEPT_FIELDS = [
9873
+ "selfStarted",
9874
+ "cancelled",
9875
+ "retrying",
9876
+ "retryReason",
9877
+ "category",
9878
+ "costUsd",
9879
+ "tokens",
9880
+ "modelUsage",
9881
+ "contextTokens",
9882
+ "contextWindow"
9883
+ ];
9884
+ var WITHHELD_ERROR_MESSAGE = "Output withheld: the people allowed to read it could not be established.";
9885
+ var TurnVisibilityStamp = class {
9886
+ current = null;
9887
+ /** The self-started turn running now, if any, and whose work it reads. */
9888
+ selfTurn = void 0;
9889
+ toolUses = new BoundedMap();
9890
+ tasks = new BoundedMap();
9891
+ /** Background tasks started and not yet settled, with their launching turn's readers. */
9892
+ running = /* @__PURE__ */ new Map();
9893
+ /** More tasks ran than {@link MAX_OUTSTANDING}: which are still running is no longer known. */
9894
+ runningOverflow = false;
9895
+ /**
9896
+ * Owner of the `AskUserQuestion` block in the raw event observed last. serve
9897
+ * normalizes and sends that event's `question` synchronously, before it
9898
+ * observes the next one.
9899
+ */
9900
+ questionOwner = void 0;
9901
+ privateSeen = false;
9902
+ /** Content events withheld so far, for the log. */
9903
+ withheldCount = 0;
9904
+ /** Stamp the prompt turn's own events until {@link exit}; `null` stamps nothing. */
9905
+ enter(visibility) {
9906
+ this.current = visibility;
9907
+ if (visibility) this.privateSeen = true;
9908
+ }
9909
+ exit() {
9910
+ this.current = null;
9911
+ }
9912
+ /**
9913
+ * Feed every raw harness event before it is normalized: it carries the ids of
9914
+ * the tool uses a turn starts and of the background tasks it launches, which
9915
+ * normalized events no longer have.
9916
+ */
9917
+ observeHarnessEvent(raw) {
9918
+ this.questionOwner = void 0;
9919
+ if (typeof raw !== "object" || raw === null) return;
9920
+ const event = raw;
9921
+ switch (event.type) {
9922
+ case "self_turn_started": {
9923
+ const ids = Array.isArray(event.taskIds) ? event.taskIds : [];
9924
+ let owner = ids.length === 0 ? UNKNOWN : null;
9925
+ for (const id of ids)
9926
+ owner = intersect(owner, typeof id === "string" ? this.tasks.resolve(id) : UNKNOWN);
9927
+ this.selfTurn = owner;
9928
+ return;
9929
+ }
9930
+ case "background_task_started":
9931
+ if (typeof event.taskId === "string") {
9932
+ const owner = this.mainOwner();
9933
+ this.remember(this.tasks, event.taskId, owner);
9934
+ if (this.running.size >= MAX_OUTSTANDING && !this.running.has(event.taskId))
9935
+ this.runningOverflow = true;
9936
+ else this.running.set(event.taskId, owner);
9937
+ }
9938
+ return;
9939
+ case "background_task_settled":
9940
+ if (typeof event.taskId === "string") this.running.delete(event.taskId);
9941
+ return;
9942
+ case "background_tasks_reset":
9943
+ this.running.clear();
9944
+ this.runningOverflow = false;
9945
+ return;
9946
+ case "tool_call":
9947
+ if (typeof event.toolCallId === "string")
9948
+ this.remember(this.toolUses, event.toolCallId, this.ownerUnder(event.parentToolUseId));
9949
+ return;
9950
+ case "message_start":
9951
+ case "message_end": {
9952
+ const message = event.message;
9953
+ if (!message) return;
9954
+ const owner = this.ownerUnder(message.parentToolUseId);
9955
+ if (Array.isArray(message.content)) {
9956
+ for (const block of message.content) {
9957
+ if (block?.type !== "tool_use") continue;
9958
+ if (typeof block.id === "string") this.remember(this.toolUses, block.id, owner);
9959
+ if (block.name === QUESTION_TOOL) this.questionOwner = owner;
9960
+ }
9961
+ }
9962
+ if (Array.isArray(message.toolCalls)) {
9963
+ for (const call of message.toolCalls) {
9964
+ if (typeof call?.id === "string") this.remember(this.toolUses, call.id, owner);
9965
+ }
9966
+ }
9967
+ return;
9968
+ }
9969
+ }
9970
+ }
9971
+ /**
9972
+ * The event as it goes on the wire: stamped with its owner's readers, or
9973
+ * `null` when it is withheld (see the class doc). `fromCapability` marks an
9974
+ * event a capability emitted whose type does not say so (a render's fallback text).
9975
+ */
9976
+ stamp(event, opts = {}) {
9977
+ const parent = event.parentToolUseId;
9978
+ const selfStarted = event.selfStarted === true;
9979
+ let owner = event.type === "question" && this.questionOwner !== void 0 ? this.questionOwner : selfStarted && typeof parent !== "string" && this.selfTurn === void 0 ? UNKNOWN : this.ownerUnder(parent);
9980
+ if (typeof parent !== "string" && (opts.fromCapability === true || PARENTLESS_CHILD_TYPES.has(event.type)))
9981
+ owner = intersect(owner, this.runningOwner());
9982
+ const terminal = event.type === "finished" || event.type === "error" && event.fatal === true && event.retrying !== true;
9983
+ if (terminal && typeof parent !== "string") this.selfTurn = void 0;
9984
+ if (!STAMPED_TYPES.has(event.type)) return event;
9985
+ if (owner === UNKNOWN) return this.privateSeen ? this.withhold(event) : event;
9986
+ if (owner === null) return event;
9987
+ const stamped = {
9988
+ visibilityMode: owner.visibilityMode,
9989
+ privateRecipientIds: [...owner.privateRecipientIds]
9990
+ };
9991
+ return { ...event, ...stamped };
9992
+ }
9993
+ /** Readers of the main thread: the prompt turn, narrowed by a self-started turn running too. */
9994
+ mainOwner() {
9995
+ return this.selfTurn === void 0 ? this.current : intersect(this.current, this.selfTurn);
9996
+ }
9997
+ /** Readers every running background task's launching turn shares; `null` when none runs. */
9998
+ runningOwner() {
9999
+ if (this.runningOverflow) return UNKNOWN;
10000
+ let owner = null;
10001
+ for (const taskOwner of this.running.values()) owner = intersect(owner, taskOwner);
10002
+ return owner;
10003
+ }
10004
+ /** Readers of work started under `parent` (a tool use id), or of the main thread without one. */
10005
+ ownerUnder(parent) {
10006
+ return typeof parent === "string" ? this.toolUses.resolve(parent) : this.mainOwner();
10007
+ }
10008
+ /** An owner that is unknown is not remembered, so the id stays unknown. */
10009
+ remember(map, id, owner) {
10010
+ if (owner !== UNKNOWN) map.set(id, owner);
10011
+ }
10012
+ withhold(event) {
10013
+ this.withheldCount += 1;
10014
+ if (event.type !== "finished" && event.type !== "error") return null;
10015
+ const kept = {};
10016
+ for (const key of WITHHELD_KEPT_FIELDS) {
10017
+ const value = event[key];
10018
+ if (value !== void 0) kept[key] = value;
10019
+ }
10020
+ if (event.type === "finished")
10021
+ return { costUsd: 0, ...kept, type: "finished", summary: "" };
10022
+ return {
10023
+ ...kept,
10024
+ type: "error",
10025
+ message: WITHHELD_ERROR_MESSAGE,
10026
+ fatal: event.fatal
10027
+ };
10028
+ }
10029
+ };
10030
+
9792
10031
  // runner/src/event-gap-buffer.ts
9793
10032
  var EVENT_GAP_BUFFER_MAX_EVENTS = 1e4;
9794
10033
  var EVENT_GAP_BUFFER_MAX_BYTES = 16 * 1024 * 1024;
@@ -12809,23 +13048,36 @@ function ensureGitConfigInclude(managedGitconfigPath, alsoMatching = []) {
12809
13048
  throw err;
12810
13049
  }
12811
13050
  }
12812
- function userGitconfigToInclude(managedGitconfigPath) {
13051
+ function userGitconfigsToInclude(managedGitconfigPath) {
12813
13052
  const home = process.env.HOME || homedir();
12814
- if (!home) return void 0;
12815
- const userPath = join(home, ".gitconfig");
12816
- let text2;
12817
- try {
12818
- text2 = readFileSync(userPath, "utf-8");
12819
- } catch {
12820
- return void 0;
12821
- }
13053
+ if (!home) return [];
13054
+ const xdg = process.env.XDG_CONFIG_HOME;
13055
+ const xdgDir = xdg && isAbsolute(xdg) ? xdg : join(home, ".config");
12822
13056
  let realManaged = managedGitconfigPath;
12823
13057
  try {
12824
13058
  realManaged = join(realpathSync(dirname(managedGitconfigPath)), "managed-gitconfig");
12825
13059
  } catch {
12826
13060
  }
12827
- if (text2.includes(managedGitconfigPath) || text2.includes(realManaged)) return void 0;
12828
- return userPath;
13061
+ const found = [];
13062
+ const seen = /* @__PURE__ */ new Set();
13063
+ for (const userPath of [join(xdgDir, "git", "config"), join(home, ".gitconfig")]) {
13064
+ let text2;
13065
+ try {
13066
+ text2 = readFileSync(userPath, "utf-8");
13067
+ } catch {
13068
+ continue;
13069
+ }
13070
+ if (text2.includes(managedGitconfigPath) || text2.includes(realManaged)) continue;
13071
+ let identity = userPath;
13072
+ try {
13073
+ identity = realpathSync(userPath);
13074
+ } catch {
13075
+ }
13076
+ if (seen.has(identity)) continue;
13077
+ seen.add(identity);
13078
+ found.push(userPath);
13079
+ }
13080
+ return found;
12829
13081
  }
12830
13082
  function setupManagedGitconfig(projectDir, serverLog, includeInHome) {
12831
13083
  const managedGitconfigPath = join(resolve(projectDir), ".skaile", "managed-gitconfig");
@@ -12833,7 +13085,7 @@ function setupManagedGitconfig(projectDir, serverLog, includeInHome) {
12833
13085
  try {
12834
13086
  writeUserGitconfigInclude({
12835
13087
  gitconfigPath: managedGitconfigPath,
12836
- userGitconfigPath: includeInHome ? void 0 : userGitconfigToInclude(managedGitconfigPath)
13088
+ userGitconfigPaths: includeInHome ? void 0 : userGitconfigsToInclude(managedGitconfigPath)
12837
13089
  });
12838
13090
  } catch (err) {
12839
13091
  serverLog.warn("failed to write managed-gitconfig \u2014 the agent's git has no global config", {
@@ -13428,7 +13680,8 @@ async function startAgentServer(opts) {
13428
13680
  throw new Error("CODEX_MANAGED_BOOTSTRAP_INVALID");
13429
13681
  const supportedRuntimeFeatures = [
13430
13682
  ...managedHost ? ["codex-app-server-v1"] : [],
13431
- PLATFORM_BLOCKS_RUNTIME_FEATURE
13683
+ PLATFORM_BLOCKS_RUNTIME_FEATURE,
13684
+ TURN_VISIBILITY_RUNTIME_FEATURE
13432
13685
  ];
13433
13686
  let managedBootstrapClosed = false;
13434
13687
  const port = opts.port ?? 8080;
@@ -13459,7 +13712,8 @@ async function startAgentServer(opts) {
13459
13712
  serverLog.info("ws auth token", {
13460
13713
  source: opts.authToken ? "caller" : takenAuthToken.source
13461
13714
  });
13462
- if (!opts.transport && !authToken) {
13715
+ const warnNoAuthAtListen = !opts.transport && !authToken && (opts.port ?? 8080) === 0;
13716
+ if (!opts.transport && !authToken && !warnNoAuthAtListen) {
13463
13717
  serverLog.warn(wsNoAuthWarning(opts.port ?? 8080, opts.host));
13464
13718
  }
13465
13719
  if (takenAuthToken.unlinkError)
@@ -13507,7 +13761,12 @@ async function startAgentServer(opts) {
13507
13761
  onLog: log,
13508
13762
  ...opts.host ? { host: opts.host } : {},
13509
13763
  ...authToken ? { authToken } : {},
13510
- ...opts.onListening ? { onListening: opts.onListening } : {}
13764
+ ...opts.onListening || warnNoAuthAtListen ? {
13765
+ onListening: (info) => {
13766
+ if (warnNoAuthAtListen) serverLog.warn(wsNoAuthWarning(info.port, opts.host));
13767
+ opts.onListening?.(info);
13768
+ }
13769
+ } : {}
13511
13770
  });
13512
13771
  logStore.addSink(
13513
13772
  new WsLogSink({
@@ -13518,13 +13777,27 @@ async function startAgentServer(opts) {
13518
13777
  );
13519
13778
  const turnStatus = new TurnStatusTracker();
13520
13779
  const eventGapBuffer = new EventGapBuffer();
13521
- function sendEvent(event) {
13780
+ const turnVisibility = new TurnVisibilityStamp();
13781
+ const initLessRunner = !managedHost && (wsConfig.secrets?.provider ?? "env") === "env";
13782
+ let clientEverConnected = false;
13783
+ transport.onConnect(() => {
13784
+ clientEverConnected = true;
13785
+ });
13786
+ function sendEvent(event, opts2) {
13787
+ const stamped = turnVisibility.stamp(event, opts2);
13788
+ if (stamped) deliverEvent(stamped);
13789
+ else log(`[serve] withheld a ${event.type} event: its readers are unknown`);
13790
+ return stamped !== null;
13791
+ }
13792
+ function deliverEvent(event) {
13522
13793
  turnStatus.observe(event);
13523
13794
  if (transport.connected) {
13524
13795
  transport.send(event);
13525
13796
  return;
13526
13797
  }
13527
- if (!initAcknowledged) return;
13798
+ if (!initAcknowledged && !(initLessRunner && initGeneration === 0 && clientEverConnected)) {
13799
+ return;
13800
+ }
13528
13801
  eventGapBuffer.push(event, { isStale: settledCapabilityCallCheck(event) });
13529
13802
  }
13530
13803
  function settledCapabilityCallCheck(event) {
@@ -13593,7 +13866,15 @@ async function startAgentServer(opts) {
13593
13866
  });
13594
13867
  signal?.addEventListener("abort", abort, { once: true });
13595
13868
  try {
13596
- transport.send({ type: "capability_invoked", callId, name, input, invokedBy: "agent" });
13869
+ const invoked = turnVisibility.stamp({
13870
+ type: "capability_invoked",
13871
+ callId,
13872
+ name,
13873
+ input,
13874
+ invokedBy: "agent"
13875
+ });
13876
+ if (invoked) transport.send(invoked);
13877
+ else finish(new Error(`Capability ${name} refused: its readers are unknown`));
13597
13878
  } catch (error) {
13598
13879
  finish(error);
13599
13880
  }
@@ -13780,10 +14061,9 @@ async function startAgentServer(opts) {
13780
14061
  invoke: (name, input, signal, callId) => capabilityRegistry.invoke(name, input, { sessionId, signal, callId }),
13781
14062
  onToolsChanged: (listener) => capabilityRegistry.onToolsChanged(listener),
13782
14063
  emitRender: (event) => sendEvent(event),
13783
- emitText: (text2) => sendEvent({
13784
- type: "text",
13785
- content: text2
13786
- })
14064
+ emitText: (text2) => {
14065
+ sendEvent({ type: "text", content: text2 }, { fromCapability: true });
14066
+ }
13787
14067
  };
13788
14068
  }
13789
14069
  const sessionInstanceId = opts.instanceId ?? DEFAULT_AGENT_INSTANCE_ID;
@@ -14274,7 +14554,8 @@ async function startAgentServer(opts) {
14274
14554
  },
14275
14555
  log,
14276
14556
  logPhase,
14277
- turnEnd: turnEndContract
14557
+ turnEnd: turnEndContract,
14558
+ turnVisibility
14278
14559
  });
14279
14560
  let harnessRestartChain = Promise.resolve();
14280
14561
  let toolRestartScheduler;
@@ -14289,6 +14570,7 @@ async function startAgentServer(opts) {
14289
14570
  harness.removeAllListeners("error");
14290
14571
  harness.removeAllListeners("reconfigure-rollback");
14291
14572
  harness.kill();
14573
+ turnVisibility.observeHarnessEvent({ type: "background_tasks_reset" });
14292
14574
  } catch (err) {
14293
14575
  log(
14294
14576
  `[serve] failed to retire previous harness: ${err instanceof Error ? err.message : String(err)}`
@@ -14416,6 +14698,7 @@ async function startAgentServer(opts) {
14416
14698
  liveHarnessActiveAfterTurn,
14417
14699
  event
14418
14700
  );
14701
+ turnVisibility.observeHarnessEvent(event);
14419
14702
  const normalized = normalizer.normalize(event);
14420
14703
  const turnEnded = event.type === "agent_end";
14421
14704
  for (const e of normalized) {
@@ -15316,6 +15599,7 @@ async function startAgentServer(opts) {
15316
15599
  const initReceivedAt = Date.now();
15317
15600
  const thisInit = ++initGeneration;
15318
15601
  initAcknowledged = false;
15602
+ if (thisInit === 1) eventGapBuffer.clear();
15319
15603
  if (cmd.protocolVersion.major !== PROTOCOL_VERSION.major) {
15320
15604
  log(
15321
15605
  `[serve] incompatible protocol: agent=${PROTOCOL_VERSION.major} platform=${cmd.protocolVersion.major}`
@@ -15620,8 +15904,17 @@ async function startAgentServer(opts) {
15620
15904
  }
15621
15905
  async function handlePrompt(cmd) {
15622
15906
  if (cmd.messageId) sendEvent({ type: "prompt_ack", messageId: cmd.messageId });
15907
+ const visibility = turnVisibilityOf(cmd);
15908
+ if (visibility === "no-readers") {
15909
+ refusePrompt(
15910
+ "Prompt refused: a private prompt must name at least one person who may read the answer.",
15911
+ { onReceipt: true }
15912
+ );
15913
+ return;
15914
+ }
15623
15915
  await turnScheduler.prompt({
15624
15916
  owner: { senderId: cmd.senderId, messageId: cmd.messageId },
15917
+ visibility,
15625
15918
  // The turn ahead may be paused on a question it can only leave through
15626
15919
  // this harness's rule for a new prompt; apply it now, not after that turn.
15627
15920
  onQueued: () => harness?.supersedePendingQuestion?.(),
@@ -15666,6 +15959,10 @@ async function startAgentServer(opts) {
15666
15959
  refusePrompt("Prompt refused: a tool allowlist cannot apply while a flow runs.");
15667
15960
  return false;
15668
15961
  }
15962
+ if (visibility) {
15963
+ refusePrompt("Prompt refused: a private message cannot stay private while a flow runs.");
15964
+ return false;
15965
+ }
15669
15966
  if (Array.isArray(cmd.platformBlocks))
15670
15967
  pendingFlowPlatformBlocks.push(...cmd.platformBlocks);
15671
15968
  return async () => {
@@ -15726,9 +16023,11 @@ async function startAgentServer(opts) {
15726
16023
  }
15727
16024
  });
15728
16025
  }
15729
- function refusePrompt(message) {
16026
+ function refusePrompt(message, opts2 = {}) {
15730
16027
  log(`[serve] ${message}`);
15731
- sendEvent({ type: "error", message, fatal: false, category: "validation" });
16028
+ const event = { type: "error", message, fatal: false, category: "validation" };
16029
+ if (opts2.onReceipt) deliverEvent(event);
16030
+ else sendEvent(event);
15732
16031
  }
15733
16032
  async function handleReply(cmd) {
15734
16033
  await turnScheduler.reply({
@@ -16157,7 +16456,8 @@ async function startAgentServer(opts) {
16157
16456
  });
16158
16457
  transport.onConnect(() => {
16159
16458
  if (!eventGapBuffer.hasPending) return;
16160
- if (!initAcknowledged || sessionReadyOutcome === "rejected") {
16459
+ const initLessTurn = initLessRunner && initGeneration === 0;
16460
+ if (!initAcknowledged && !initLessTurn || sessionReadyOutcome === "rejected") {
16161
16461
  const discarded = eventGapBuffer.clear();
16162
16462
  serverLog.warn(
16163
16463
  `[serve] discarded ${discarded} event(s) buffered while disconnected: the init they belong to is no longer acknowledged`
@@ -16417,5 +16717,5 @@ function touchSession(state) {
16417
16717
  }
16418
16718
 
16419
16719
  export { AgentRunError, CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CONNECTOR_MUTATE_NOT_READY, CapabilityRegistry, CompileManifestEntrySchema, CompositionError, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, DEFAULT_FLOW_MUTATE_CONNECTOR_WAIT_MS, DEFAULT_MAX_FINISHED_TREES, DEFAULT_RUN_LIMITS, MOUNT_LIST_MAX_DEPTH, MOUNT_LIST_MAX_ENTRIES, MOUNT_READ_DEADLINE_FACTOR, MOUNT_READ_MAX_CHUNK_BYTES, MOUNT_STAT_BUDGET_MS, MOUNT_STAT_MAX_ENTRIES, MOUNT_TREE_OP_DEADLINE_FACTOR, MOUNT_WRITE_MAX_CHUNK_BYTES, MarkdownStreamer, PreInitRingSink, ResourceOperationError, SESSION_ROOT_WRITABLE_DIRS, SESSION_ROOT_WRITABLE_FILES, UnknownCompositionKindError, WRITE_RANGE_PARTIAL_TTL_MS, WS_AUTH_TOKEN_ENV, WS_AUTH_TOKEN_FILE_ENV, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildCompositionRunSnapshot, buildConnectorTokenMediator, buildContextSection, buildEnvironmentSection, buildResourcesAvailablePayload, buildRunnerAgentSections, buildStoreSnapshotReplay, builtinCapabilities, canonicalJson, capabilityLogInstance, capabilitySignatureInputs, clearPreInitRingSink, clearSession, compileComposition, compositionRunSnapshotPath, computeCapabilitySignature, computeDirectoryTotals, computeRevisionHash, connectorRefreshKind, createAgentSession, createCompositionContentSource, createFinalTextFallback, createFlowConnectorReadiness, createInMemoryRunStore, createManagedCodexSubpromptHarness, createRunController, createSessionStimulusBus, defineCapability, deleteSession, describeComposition, dispatchResourceRequest, dispatchRunnerCapabilityInvocation, emitSystemPromptComposed, ensureClaudeSettingsDisablesConnectors, ensureGitConfigInclude, executeConnectorMutate, extractClaudeAiOauthExpiresAt, flowStartNeedsHarnessRestart, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, handleSessionRootResourceRequest, harnessActiveAfterTurnEnd, hasNonTerminalFlow, hashAgentFiles, hashContent, hostOpResumeStimulus, installPreInitRingSink, instanceForSession, instanceSessionOverrides, isCompilePinCurrent, isCompositionError, isEmptyKnowledgeIndex, isSessionRootPathAllowed, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadCompositionRunSnapshot, loadKnowledgeDir, loadManagedCodexHostConfig, loadSession, loadSessionById, logConnectorReport, manifestModelForHarness, mcpAuthSecretKey, newSession, nulTailPaddingLength, pickChatFlowTarget, pickFlowToolTarget, pickRepointedManager, planFlowMutate, prepareCodexTools, reconcilePendingDecisions, reconnectedRunNeedsAgentTurn, recreateKeepingLiveFlows, registerActiveFlow, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, rejectPendingCapabilityCallsOnDisconnect, resetRunnerLogStore, resolveAgentInstance, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveFlowMutateConnectorWaitMs, resolveInstanceAgentDir, resolveMixin, resolveSessionId, restoredRunHasWorkToResume, runAgentChat, saveCompositionRunSnapshot, saveSession, setCurrentSession, setUpFlowConnector, startAgentServer, stimulusFromMetas, stripFrontmatter, takeRunnerWsAuthToken, toActiveFlowTarget, touchSession, unresolvedCredentialNotices, validateInputResponse, verifyConventionItems, writeClaudeCodeCredentialsFile, writeRangeChunk, writeRangePartialPath };
16420
- //# sourceMappingURL=chunk-AQNW2FET.js.map
16421
- //# sourceMappingURL=chunk-AQNW2FET.js.map
16720
+ //# sourceMappingURL=chunk-K7ZGY2BY.js.map
16721
+ //# sourceMappingURL=chunk-K7ZGY2BY.js.map