@skaile/workspaces 6.3.0 → 6.5.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 (399) hide show
  1. package/CHANGELOG.md +72 -1
  2. package/README.md +4 -0
  3. package/dist/ai-sdk.js +74 -32
  4. package/dist/ai-sdk.js.map +1 -1
  5. package/dist/app-sdk/index.js +1 -1
  6. package/dist/{asset-feeds-3YO2352Y.js → asset-feeds-4I6Z4OI3.js} +21 -21
  7. package/dist/{asset-feeds-3YO2352Y.js.map → asset-feeds-4I6Z4OI3.js.map} +1 -1
  8. package/dist/asset-manager/catalog-deployer.js +7 -7
  9. package/dist/asset-manager/index.js +13 -13
  10. package/dist/asset-manager/installer.js +9 -9
  11. package/dist/asset-manager/renderers.js +8 -8
  12. package/dist/asset-manager/src/index.d.ts +156 -27
  13. package/dist/asset-manager/src/index.d.ts.map +1 -1
  14. package/dist/asset-manager/src/install-instances.d.ts +2 -0
  15. package/dist/asset-manager/src/install-instances.d.ts.map +1 -1
  16. package/dist/asset-manager/src/installer.d.ts +6 -0
  17. package/dist/asset-manager/src/installer.d.ts.map +1 -1
  18. package/dist/bridge/harnesses/claude-sdk.js +23 -18
  19. package/dist/bridge/harnesses/claude-sdk.js.map +1 -1
  20. package/dist/bridge/harnesses/codex.js +36 -34
  21. package/dist/bridge/harnesses/codex.js.map +1 -1
  22. package/dist/bridge/harnesses/continue.js +11 -12
  23. package/dist/bridge/harnesses/continue.js.map +1 -1
  24. package/dist/bridge/harnesses/echo.js +4 -5
  25. package/dist/bridge/harnesses/echo.js.map +1 -1
  26. package/dist/bridge/harnesses/gemini.js +8 -9
  27. package/dist/bridge/harnesses/goose.js +11 -12
  28. package/dist/bridge/harnesses/goose.js.map +1 -1
  29. package/dist/bridge/harnesses/omp.js +16 -11
  30. package/dist/bridge/harnesses/omp.js.map +1 -1
  31. package/dist/bridge/harnesses/opencode.js +11 -12
  32. package/dist/bridge/harnesses/opencode.js.map +1 -1
  33. package/dist/bridge/harnesses/qwen.js +8 -9
  34. package/dist/bridge/harnesses/qwen.js.map +1 -1
  35. package/dist/bridge/index.js +19 -20
  36. package/dist/bridge/src/ai-sdk.d.ts +5 -2
  37. package/dist/bridge/src/ai-sdk.d.ts.map +1 -1
  38. package/dist/bridge/src/codex/login-fallback.d.ts +39 -0
  39. package/dist/bridge/src/codex/login-fallback.d.ts.map +1 -0
  40. package/dist/bridge/src/error-classifier.d.ts +6 -0
  41. package/dist/bridge/src/error-classifier.d.ts.map +1 -1
  42. package/dist/bridge/src/harness-model-check.d.ts +11 -7
  43. package/dist/bridge/src/harness-model-check.d.ts.map +1 -1
  44. package/dist/bridge/src/harnesses/claude-sdk.d.ts.map +1 -1
  45. package/dist/bridge/src/harnesses/codex.d.ts +0 -6
  46. package/dist/bridge/src/harnesses/codex.d.ts.map +1 -1
  47. package/dist/bridge/src/harnesses/omp.d.ts.map +1 -1
  48. package/dist/bridge/src/index.d.ts +1 -0
  49. package/dist/bridge/src/index.d.ts.map +1 -1
  50. package/dist/{chunk-XEVFSDIF.js → chunk-22ZX33H6.js} +6 -6
  51. package/dist/{chunk-XEVFSDIF.js.map → chunk-22ZX33H6.js.map} +1 -1
  52. package/dist/{chunk-KPKGWXUJ.js → chunk-23SG4JRV.js} +4 -4
  53. package/dist/{chunk-KPKGWXUJ.js.map → chunk-23SG4JRV.js.map} +1 -1
  54. package/dist/{chunk-MYXFR27L.js → chunk-2HS357RA.js} +77 -37
  55. package/dist/chunk-2HS357RA.js.map +1 -0
  56. package/dist/{chunk-7TSNR5H5.js → chunk-2IAWVUW3.js} +4 -4
  57. package/dist/{chunk-7TSNR5H5.js.map → chunk-2IAWVUW3.js.map} +1 -1
  58. package/dist/{chunk-6GWSDPBP.js → chunk-2M3VLKT2.js} +3 -3
  59. package/dist/{chunk-6GWSDPBP.js.map → chunk-2M3VLKT2.js.map} +1 -1
  60. package/dist/{chunk-PNUM7GUY.js → chunk-3DA74PLW.js} +3 -3
  61. package/dist/{chunk-PNUM7GUY.js.map → chunk-3DA74PLW.js.map} +1 -1
  62. package/dist/{chunk-7RH6E332.js → chunk-3KSLUVKB.js} +7 -7
  63. package/dist/{chunk-7RH6E332.js.map → chunk-3KSLUVKB.js.map} +1 -1
  64. package/dist/{chunk-6OHZUUR7.js → chunk-5DE3DGVR.js} +11 -5
  65. package/dist/chunk-5DE3DGVR.js.map +1 -0
  66. package/dist/{chunk-32FYVSSW.js → chunk-6EKQENAP.js} +6 -6
  67. package/dist/{chunk-32FYVSSW.js.map → chunk-6EKQENAP.js.map} +1 -1
  68. package/dist/{chunk-QK7AG5AV.js → chunk-6Y3SC7O4.js} +4 -4
  69. package/dist/{chunk-QK7AG5AV.js.map → chunk-6Y3SC7O4.js.map} +1 -1
  70. package/dist/{chunk-ROVZCGTN.js → chunk-7EMS2GZO.js} +40 -37
  71. package/dist/chunk-7EMS2GZO.js.map +1 -0
  72. package/dist/{chunk-COUJOTAJ.js → chunk-7H4GTP7V.js} +3 -3
  73. package/dist/{chunk-COUJOTAJ.js.map → chunk-7H4GTP7V.js.map} +1 -1
  74. package/dist/{chunk-VUWRGMT6.js → chunk-AFTZNR2W.js} +3 -3
  75. package/dist/{chunk-VUWRGMT6.js.map → chunk-AFTZNR2W.js.map} +1 -1
  76. package/dist/{chunk-JMIKGAUA.js → chunk-AVFRFGM2.js} +16 -6
  77. package/dist/chunk-AVFRFGM2.js.map +1 -0
  78. package/dist/{chunk-7MV3NHPT.js → chunk-B436SG5P.js} +42 -25
  79. package/dist/chunk-B436SG5P.js.map +1 -0
  80. package/dist/{chunk-ZEH4WFEG.js → chunk-B4BLJUYN.js} +69 -26
  81. package/dist/chunk-B4BLJUYN.js.map +1 -0
  82. package/dist/{chunk-LEJQAX7G.js → chunk-DNXPXJ3X.js} +82 -50
  83. package/dist/chunk-DNXPXJ3X.js.map +1 -0
  84. package/dist/{chunk-HDVLBEEX.js → chunk-E6UWI3TP.js} +3 -3
  85. package/dist/{chunk-HDVLBEEX.js.map → chunk-E6UWI3TP.js.map} +1 -1
  86. package/dist/{chunk-2TFKXSB5.js → chunk-EN5REMWV.js} +4 -4
  87. package/dist/{chunk-2TFKXSB5.js.map → chunk-EN5REMWV.js.map} +1 -1
  88. package/dist/{chunk-QFFMFZIR.js → chunk-EO7KGX6P.js} +4 -4
  89. package/dist/{chunk-QFFMFZIR.js.map → chunk-EO7KGX6P.js.map} +1 -1
  90. package/dist/{chunk-KIPCBIFJ.js → chunk-ETF6Q3R3.js} +23 -80
  91. package/dist/chunk-ETF6Q3R3.js.map +1 -0
  92. package/dist/{chunk-6WH2WE4B.js → chunk-G4NCSYWR.js} +9 -8
  93. package/dist/chunk-G4NCSYWR.js.map +1 -0
  94. package/dist/{chunk-JCPD4QRM.js → chunk-G5SYFFMD.js} +2 -2
  95. package/dist/{chunk-JCPD4QRM.js.map → chunk-G5SYFFMD.js.map} +1 -1
  96. package/dist/{chunk-Q7CU5GQO.js → chunk-HPA3RP5E.js} +4 -4
  97. package/dist/{chunk-Q7CU5GQO.js.map → chunk-HPA3RP5E.js.map} +1 -1
  98. package/dist/{chunk-KGHYXXXV.js → chunk-IS3NIZBX.js} +588 -133
  99. package/dist/chunk-IS3NIZBX.js.map +1 -0
  100. package/dist/{chunk-XBQTXGY4.js → chunk-IWKKTCXY.js} +98 -17
  101. package/dist/chunk-IWKKTCXY.js.map +1 -0
  102. package/dist/{chunk-HH2H2ZV7.js → chunk-J5JWLKLB.js} +35 -20
  103. package/dist/chunk-J5JWLKLB.js.map +1 -0
  104. package/dist/chunk-J6YPKMMY.js +83 -0
  105. package/dist/chunk-J6YPKMMY.js.map +1 -0
  106. package/dist/{chunk-TGV2EWGL.js → chunk-K4DHYTUM.js} +4 -4
  107. package/dist/{chunk-TGV2EWGL.js.map → chunk-K4DHYTUM.js.map} +1 -1
  108. package/dist/{chunk-72NT2TJU.js → chunk-KA2GLAPS.js} +7 -8
  109. package/dist/chunk-KA2GLAPS.js.map +1 -0
  110. package/dist/{chunk-VUJXZDCY.js → chunk-KSH5CFQS.js} +3 -3
  111. package/dist/{chunk-VUJXZDCY.js.map → chunk-KSH5CFQS.js.map} +1 -1
  112. package/dist/{chunk-BIRW3HOG.js → chunk-KSUT5KAE.js} +3 -3
  113. package/dist/{chunk-BIRW3HOG.js.map → chunk-KSUT5KAE.js.map} +1 -1
  114. package/dist/{chunk-AMJ6KEV7.js → chunk-KUADKMNX.js} +4 -4
  115. package/dist/{chunk-AMJ6KEV7.js.map → chunk-KUADKMNX.js.map} +1 -1
  116. package/dist/{chunk-TSTRH4SM.js → chunk-KYNCY3F3.js} +3 -3
  117. package/dist/{chunk-TSTRH4SM.js.map → chunk-KYNCY3F3.js.map} +1 -1
  118. package/dist/{chunk-V5BPDB4J.js → chunk-LE6QS4PG.js} +3 -3
  119. package/dist/{chunk-V5BPDB4J.js.map → chunk-LE6QS4PG.js.map} +1 -1
  120. package/dist/{chunk-6UP2EDFN.js → chunk-NSIOBKDX.js} +313 -4
  121. package/dist/chunk-NSIOBKDX.js.map +1 -0
  122. package/dist/{chunk-MD3FUZS3.js → chunk-OBZ5WQ32.js} +3 -3
  123. package/dist/{chunk-MD3FUZS3.js.map → chunk-OBZ5WQ32.js.map} +1 -1
  124. package/dist/{chunk-ELSGFI3I.js → chunk-OLHHN3NO.js} +31 -7
  125. package/dist/chunk-OLHHN3NO.js.map +1 -0
  126. package/dist/{chunk-JGH7NB47.js → chunk-S7DVT2BV.js} +4 -4
  127. package/dist/{chunk-JGH7NB47.js.map → chunk-S7DVT2BV.js.map} +1 -1
  128. package/dist/{chunk-PHAMYCZH.js → chunk-SN663FCA.js} +5 -5
  129. package/dist/{chunk-PHAMYCZH.js.map → chunk-SN663FCA.js.map} +1 -1
  130. package/dist/{serve-preflight-H2AYMGJ6.js → chunk-SRTWKZP2.js} +30 -61
  131. package/dist/chunk-SRTWKZP2.js.map +1 -0
  132. package/dist/{chunk-H622YULS.js → chunk-SZTHSPRC.js} +3 -4
  133. package/dist/chunk-SZTHSPRC.js.map +1 -0
  134. package/dist/{chunk-LD6O6QKU.js → chunk-T7HGEMNB.js} +4 -4
  135. package/dist/{chunk-LD6O6QKU.js.map → chunk-T7HGEMNB.js.map} +1 -1
  136. package/dist/{chunk-4QRJBY2P.js → chunk-TDPQOR3C.js} +2 -2
  137. package/dist/{chunk-4QRJBY2P.js.map → chunk-TDPQOR3C.js.map} +1 -1
  138. package/dist/{chunk-Y3I4KGLX.js → chunk-TGUMN5G7.js} +310 -175
  139. package/dist/chunk-TGUMN5G7.js.map +1 -0
  140. package/dist/{chunk-TO5SSMRI.js → chunk-THX5EE3K.js} +67 -19
  141. package/dist/chunk-THX5EE3K.js.map +1 -0
  142. package/dist/{chunk-QTLUZUF2.js → chunk-TNQLDEM6.js} +86 -34
  143. package/dist/chunk-TNQLDEM6.js.map +1 -0
  144. package/dist/{chunk-EQNIBBB6.js → chunk-TROEC2Z2.js} +34 -20
  145. package/dist/chunk-TROEC2Z2.js.map +1 -0
  146. package/dist/{chunk-E5NQRHEB.js → chunk-U6KRTCNA.js} +4 -4
  147. package/dist/{chunk-E5NQRHEB.js.map → chunk-U6KRTCNA.js.map} +1 -1
  148. package/dist/{chunk-J5JRGBKK.js → chunk-UMLCKKIA.js} +64 -32
  149. package/dist/chunk-UMLCKKIA.js.map +1 -0
  150. package/dist/{chunk-DU26AVK2.js → chunk-USVUS4DJ.js} +8 -8
  151. package/dist/{chunk-DU26AVK2.js.map → chunk-USVUS4DJ.js.map} +1 -1
  152. package/dist/{chunk-HGOJEVHY.js → chunk-UZET67SO.js} +4 -4
  153. package/dist/{chunk-HGOJEVHY.js.map → chunk-UZET67SO.js.map} +1 -1
  154. package/dist/{chunk-IZQOO6MN.js → chunk-V5KG6CCV.js} +2 -2
  155. package/dist/{chunk-IZQOO6MN.js.map → chunk-V5KG6CCV.js.map} +1 -1
  156. package/dist/{chunk-76FLBODK.js → chunk-VT6G5AJV.js} +10 -7
  157. package/dist/chunk-VT6G5AJV.js.map +1 -0
  158. package/dist/{chunk-URCJIV7T.js → chunk-W5KCAWGN.js} +3 -3
  159. package/dist/{chunk-URCJIV7T.js.map → chunk-W5KCAWGN.js.map} +1 -1
  160. package/dist/{chunk-YW4ASEUP.js → chunk-WFLQMAR5.js} +5 -5
  161. package/dist/{chunk-YW4ASEUP.js.map → chunk-WFLQMAR5.js.map} +1 -1
  162. package/dist/{chunk-RFQONXET.js → chunk-X44XKBZX.js} +3 -3
  163. package/dist/{chunk-RFQONXET.js.map → chunk-X44XKBZX.js.map} +1 -1
  164. package/dist/{chunk-BPTWWKGF.js → chunk-YBEJCQE5.js} +3 -3
  165. package/dist/{chunk-BPTWWKGF.js.map → chunk-YBEJCQE5.js.map} +1 -1
  166. package/dist/{chunk-PL52CI4U.js → chunk-YRC2EFOU.js} +4 -4
  167. package/dist/{chunk-PL52CI4U.js.map → chunk-YRC2EFOU.js.map} +1 -1
  168. package/dist/{chunk-7QG2WRSN.js → chunk-Z2X7UZEZ.js} +25 -8
  169. package/dist/chunk-Z2X7UZEZ.js.map +1 -0
  170. package/dist/{chunk-U3SXCVR7.js → chunk-ZUU2PLA3.js} +4 -4
  171. package/dist/{chunk-U3SXCVR7.js.map → chunk-ZUU2PLA3.js.map} +1 -1
  172. package/dist/{claude-code-EUKDGOOO.js → claude-code-JY6CYEG7.js} +4 -4
  173. package/dist/{claude-code-EUKDGOOO.js.map → claude-code-JY6CYEG7.js.map} +1 -1
  174. package/dist/cli/index.js +322 -162
  175. package/dist/cli/index.js.map +1 -1
  176. package/dist/cli/src/commands/cache.d.ts.map +1 -1
  177. package/dist/cli/src/commands/catalog.d.ts.map +1 -1
  178. package/dist/cli/src/commands/config.d.ts.map +1 -1
  179. package/dist/cli/src/commands/connector.d.ts.map +1 -1
  180. package/dist/cli/src/commands/deploy.d.ts.map +1 -1
  181. package/dist/cli/src/commands/harness.d.ts +5 -4
  182. package/dist/cli/src/commands/harness.d.ts.map +1 -1
  183. package/dist/cli/src/commands/integration.d.ts.map +1 -1
  184. package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
  185. package/dist/cli/src/commands/library-index.d.ts +6 -0
  186. package/dist/cli/src/commands/library-index.d.ts.map +1 -1
  187. package/dist/cli/src/commands/migrate-files.d.ts +3 -6
  188. package/dist/cli/src/commands/migrate-files.d.ts.map +1 -1
  189. package/dist/cli/src/commands/migrate-harness.d.ts +4 -3
  190. package/dist/cli/src/commands/migrate-harness.d.ts.map +1 -1
  191. package/dist/cli/src/commands/migrate.d.ts +2 -2
  192. package/dist/cli/src/commands/outdated.d.ts.map +1 -1
  193. package/dist/cli/src/commands/plugin-registry-cmd.d.ts.map +1 -1
  194. package/dist/cli/src/commands/preset-cmd.d.ts.map +1 -1
  195. package/dist/cli/src/commands/project.d.ts +7 -1
  196. package/dist/cli/src/commands/project.d.ts.map +1 -1
  197. package/dist/cli/src/commands/run.d.ts.map +1 -1
  198. package/dist/cli/src/commands/serve-preflight.d.ts +21 -0
  199. package/dist/cli/src/commands/serve-preflight.d.ts.map +1 -1
  200. package/dist/cli/src/commands/serve.d.ts.map +1 -1
  201. package/dist/cli/src/commands/source-manifest.d.ts.map +1 -1
  202. package/dist/cli/src/commands/source.d.ts +8 -0
  203. package/dist/cli/src/commands/source.d.ts.map +1 -1
  204. package/dist/cli/src/commands/update.d.ts.map +1 -1
  205. package/dist/cli/src/commands/validate-instances.d.ts +6 -0
  206. package/dist/cli/src/commands/validate-instances.d.ts.map +1 -1
  207. package/dist/cli/src/commands/validate.d.ts.map +1 -1
  208. package/dist/cli/src/commands/verify.d.ts.map +1 -1
  209. package/dist/cli/src/config-checks.d.ts +8 -0
  210. package/dist/cli/src/config-checks.d.ts.map +1 -1
  211. package/dist/cli/src/ensure-sources.d.ts.map +1 -1
  212. package/dist/cli/src/helpers.d.ts +13 -4
  213. package/dist/cli/src/helpers.d.ts.map +1 -1
  214. package/dist/cli/src/plugin-store/index.d.ts +1 -1
  215. package/dist/cli/src/plugin-store/index.d.ts.map +1 -1
  216. package/dist/cli/src/plugin-store/reconcile.d.ts.map +1 -1
  217. package/dist/cli/src/plugin-store/spec.d.ts +20 -14
  218. package/dist/cli/src/plugin-store/spec.d.ts.map +1 -1
  219. package/dist/cli/src/setup.d.ts.map +1 -1
  220. package/dist/cli/src/skill-checks.d.ts +2 -0
  221. package/dist/cli/src/skill-checks.d.ts.map +1 -1
  222. package/dist/connectors/config.js +5 -5
  223. package/dist/connectors/index.js +23 -24
  224. package/dist/connectors/src/index.d.ts +2 -2
  225. package/dist/connectors/src/index.d.ts.map +1 -1
  226. package/dist/connectors/src/managed-gitconfig.d.ts +22 -0
  227. package/dist/connectors/src/managed-gitconfig.d.ts.map +1 -1
  228. package/dist/connectors/src/npm-installer.d.ts +11 -3
  229. package/dist/connectors/src/npm-installer.d.ts.map +1 -1
  230. package/dist/connectors-VLFOQNS6.js +49 -0
  231. package/dist/{connectors-XYPE2DCQ.js.map → connectors-VLFOQNS6.js.map} +1 -1
  232. package/dist/connectors-shared/index.js +2 -2
  233. package/dist/core/index.js +6 -6
  234. package/dist/core/manifest.js +2 -2
  235. package/dist/core/models.js +1 -1
  236. package/dist/core/publish-manifest.js +3 -3
  237. package/dist/core/ref.js +1 -1
  238. package/dist/core/runtime-assets.js +5 -5
  239. package/dist/core/src/agent-instances.d.ts +6 -0
  240. package/dist/core/src/agent-instances.d.ts.map +1 -1
  241. package/dist/core/src/config-key-diagnostics.d.ts +2 -1
  242. package/dist/core/src/config-key-diagnostics.d.ts.map +1 -1
  243. package/dist/core/src/index.d.ts +5 -5
  244. package/dist/core/src/index.d.ts.map +1 -1
  245. package/dist/core/src/lock.d.ts +20 -1
  246. package/dist/core/src/lock.d.ts.map +1 -1
  247. package/dist/core/src/manifest-yaml-editor.d.ts +4 -1
  248. package/dist/core/src/manifest-yaml-editor.d.ts.map +1 -1
  249. package/dist/core/src/manifest.d.ts +9 -3
  250. package/dist/core/src/manifest.d.ts.map +1 -1
  251. package/dist/core/src/models.d.ts +10 -0
  252. package/dist/core/src/models.d.ts.map +1 -1
  253. package/dist/core/src/repo-manager.d.ts +11 -0
  254. package/dist/core/src/repo-manager.d.ts.map +1 -1
  255. package/dist/core/src/runtime-assets.d.ts +12 -1
  256. package/dist/core/src/runtime-assets.d.ts.map +1 -1
  257. package/dist/core/src/walker.d.ts +3 -0
  258. package/dist/core/src/walker.d.ts.map +1 -1
  259. package/dist/core/src/workspace-config.d.ts +19 -2
  260. package/dist/core/src/workspace-config.d.ts.map +1 -1
  261. package/dist/core/src/workspace-yaml-editor.d.ts.map +1 -1
  262. package/dist/core/workspace-config.js +4 -4
  263. package/dist/deploy/index.js +6 -6
  264. package/dist/discovery/index.js +5 -5
  265. package/dist/{ensure-sources-IN3VKHUA.js → ensure-sources-6O54DUQB.js} +31 -31
  266. package/dist/ensure-sources-6O54DUQB.js.map +1 -0
  267. package/dist/factory-assets/connectors/box.js +23 -24
  268. package/dist/factory-assets/connectors/deploy.js +23 -24
  269. package/dist/factory-assets/connectors/devserver.js +23 -24
  270. package/dist/factory-assets/connectors/flow/adapter.js +23 -24
  271. package/dist/factory-assets/connectors/flow/engine.js +7 -7
  272. package/dist/factory-assets/connectors/flow/run-flow.js +25 -26
  273. package/dist/factory-assets/connectors/flow.js +23 -24
  274. package/dist/factory-assets/connectors/git.js +23 -24
  275. package/dist/factory-assets/connectors/gmail.js +23 -24
  276. package/dist/factory-assets/connectors/googledrive.js +23 -24
  277. package/dist/factory-assets/connectors/local.js +23 -24
  278. package/dist/factory-assets/connectors/mattermost.js +23 -24
  279. package/dist/factory-assets/connectors/memory.js +23 -24
  280. package/dist/factory-assets/connectors/minio.js +23 -24
  281. package/dist/factory-assets/connectors/postgres.js +23 -24
  282. package/dist/factory-assets/connectors/s3.js +23 -24
  283. package/dist/factory-assets/connectors/sharepoint.js +23 -24
  284. package/dist/factory-assets/connectors/sqlite.js +23 -24
  285. package/dist/factory-assets/connectors/static-server.js +23 -24
  286. package/dist/factory-assets/connectors/tunnel.js +23 -24
  287. package/dist/factory-assets/connectors/webdav.js +23 -24
  288. package/dist/factory-assets/connectors/xstate-store.js +23 -24
  289. package/dist/factory-assets/connectors/xstate.js +23 -24
  290. package/dist/factory-assets/skills/authoring-skaile-assets/SKILL.md +2 -1
  291. package/dist/{flows-QAO63TDV.js → flows-CIUPK7SB.js} +11 -11
  292. package/dist/{flows-QAO63TDV.js.map → flows-CIUPK7SB.js.map} +1 -1
  293. package/dist/{helpers-HDVGCF3M.js → helpers-YHDQHQEQ.js} +28 -29
  294. package/dist/{helpers-HDVGCF3M.js.map → helpers-YHDQHQEQ.js.map} +1 -1
  295. package/dist/library/index.js +10 -10
  296. package/dist/library/install.js +4 -4
  297. package/dist/library/src/manifest-writer.d.ts +9 -0
  298. package/dist/library/src/manifest-writer.d.ts.map +1 -1
  299. package/dist/library/src/remote/remote-catalog-source.d.ts +9 -0
  300. package/dist/library/src/remote/remote-catalog-source.d.ts.map +1 -1
  301. package/dist/library/src/remote/rest-catalog-source.d.ts +1 -0
  302. package/dist/library/src/remote/rest-catalog-source.d.ts.map +1 -1
  303. package/dist/{library-publish-62OWCNB5.js → library-publish-MUGUST43.js} +53 -53
  304. package/dist/{library-publish-62OWCNB5.js.map → library-publish-MUGUST43.js.map} +1 -1
  305. package/dist/model-endpoint/index.js +9 -10
  306. package/dist/open-library-BVQCB37E.js +57 -0
  307. package/dist/{open-library-TZ7OSDEJ.js.map → open-library-BVQCB37E.js.map} +1 -1
  308. package/dist/{open-registry-RLZKTJG3.js → open-registry-JCSIAKEC.js} +14 -14
  309. package/dist/{open-registry-RLZKTJG3.js.map → open-registry-JCSIAKEC.js.map} +1 -1
  310. package/dist/{paths-D6LBQETQ.js → paths-XLKCAFRZ.js} +9 -9
  311. package/dist/{paths-D6LBQETQ.js.map → paths-XLKCAFRZ.js.map} +1 -1
  312. package/dist/{plugin-store-A5J4TLCH.js → plugin-store-NGRUTCJI.js} +9 -9
  313. package/dist/{plugin-store-A5J4TLCH.js.map → plugin-store-NGRUTCJI.js.map} +1 -1
  314. package/dist/project-BGYMLAS6.js +88 -0
  315. package/dist/{project-4AVRES3M.js.map → project-BGYMLAS6.js.map} +1 -1
  316. package/dist/resolver/index.js +7 -7
  317. package/dist/runner/index.js +38 -39
  318. package/dist/runner/src/capability-roundtrip.d.ts +4 -1
  319. package/dist/runner/src/capability-roundtrip.d.ts.map +1 -1
  320. package/dist/runner/src/composition/resolve-instance.d.ts.map +1 -1
  321. package/dist/runner/src/composition/resolve.d.ts +6 -0
  322. package/dist/runner/src/composition/resolve.d.ts.map +1 -1
  323. package/dist/runner/src/credential-notice.d.ts +3 -2
  324. package/dist/runner/src/credential-notice.d.ts.map +1 -1
  325. package/dist/runner/src/resources.d.ts.map +1 -1
  326. package/dist/runner/src/serve.d.ts.map +1 -1
  327. package/dist/sdk/asset-manager.js +13 -13
  328. package/dist/sdk/bridge.js +19 -20
  329. package/dist/sdk/core.js +6 -6
  330. package/dist/sdk/flow.js +7 -7
  331. package/dist/sdk/index.js +38 -39
  332. package/dist/sdk/index.js.map +1 -1
  333. package/dist/sdk/resolver.js +7 -7
  334. package/dist/sdk/runner.js +38 -39
  335. package/dist/sdk/session.js +2 -2
  336. package/dist/sdk/transport/ws/server.js +7 -7
  337. package/dist/sdk/transport/ws.js +7 -7
  338. package/dist/sdk/transport.js +7 -7
  339. package/dist/sdk/types.js +1 -1
  340. package/dist/serve-preflight-GQY5DZX6.js +56 -0
  341. package/dist/serve-preflight-GQY5DZX6.js.map +1 -0
  342. package/dist/session/index.js +2 -2
  343. package/dist/{setup-NSPQD4V4.js → setup-2NWSKSCO.js} +34 -32
  344. package/dist/setup-2NWSKSCO.js.map +1 -0
  345. package/dist/{skills-B533SRVZ.js → skills-PXZOL2FZ.js} +12 -12
  346. package/dist/{skills-B533SRVZ.js.map → skills-PXZOL2FZ.js.map} +1 -1
  347. package/dist/source-XA3L4H6I.js +86 -0
  348. package/dist/{source-VTECABUO.js.map → source-XA3L4H6I.js.map} +1 -1
  349. package/dist/{source-manifest-publish-YORI42MN.js → source-manifest-publish-QEGMTS33.js} +50 -51
  350. package/dist/source-manifest-publish-QEGMTS33.js.map +1 -0
  351. package/dist/transport/index.js +7 -7
  352. package/dist/transport/ws/server.js +7 -7
  353. package/dist/transport/ws.js +7 -7
  354. package/dist/tui/index.js +38 -39
  355. package/dist/tui/index.js.map +1 -1
  356. package/dist/types/index.js +1 -1
  357. package/dist/types/manifests.js +1 -1
  358. package/dist/types/src/capabilities.d.ts +9 -1
  359. package/dist/types/src/capabilities.d.ts.map +1 -1
  360. package/dist/types/src/manifests/agent.d.ts +2 -2
  361. package/dist/types/src/manifests/agent.d.ts.map +1 -1
  362. package/dist/types/src/version.d.ts +8 -8
  363. package/dist/workspace-plugin/adapters/mcp.js +30 -31
  364. package/dist/workspace-plugin/adapters/omp.js +14 -14
  365. package/dist/workspace-plugin/index.js +1 -1
  366. package/package.json +1 -1
  367. package/dist/chunk-6OHZUUR7.js.map +0 -1
  368. package/dist/chunk-6UP2EDFN.js.map +0 -1
  369. package/dist/chunk-6WH2WE4B.js.map +0 -1
  370. package/dist/chunk-72NT2TJU.js.map +0 -1
  371. package/dist/chunk-76FLBODK.js.map +0 -1
  372. package/dist/chunk-7MV3NHPT.js.map +0 -1
  373. package/dist/chunk-7QG2WRSN.js.map +0 -1
  374. package/dist/chunk-ELSGFI3I.js.map +0 -1
  375. package/dist/chunk-EQNIBBB6.js.map +0 -1
  376. package/dist/chunk-H622YULS.js.map +0 -1
  377. package/dist/chunk-HH2H2ZV7.js.map +0 -1
  378. package/dist/chunk-J5JRGBKK.js.map +0 -1
  379. package/dist/chunk-JMIKGAUA.js.map +0 -1
  380. package/dist/chunk-KGHYXXXV.js.map +0 -1
  381. package/dist/chunk-KIPCBIFJ.js.map +0 -1
  382. package/dist/chunk-LEJQAX7G.js.map +0 -1
  383. package/dist/chunk-MYXFR27L.js.map +0 -1
  384. package/dist/chunk-QTLUZUF2.js.map +0 -1
  385. package/dist/chunk-ROVZCGTN.js.map +0 -1
  386. package/dist/chunk-S6KZHPR4.js +0 -315
  387. package/dist/chunk-S6KZHPR4.js.map +0 -1
  388. package/dist/chunk-TO5SSMRI.js.map +0 -1
  389. package/dist/chunk-XBQTXGY4.js.map +0 -1
  390. package/dist/chunk-Y3I4KGLX.js.map +0 -1
  391. package/dist/chunk-ZEH4WFEG.js.map +0 -1
  392. package/dist/connectors-XYPE2DCQ.js +0 -50
  393. package/dist/ensure-sources-IN3VKHUA.js.map +0 -1
  394. package/dist/open-library-TZ7OSDEJ.js +0 -58
  395. package/dist/project-4AVRES3M.js +0 -88
  396. package/dist/serve-preflight-H2AYMGJ6.js.map +0 -1
  397. package/dist/setup-NSPQD4V4.js.map +0 -1
  398. package/dist/source-VTECABUO.js +0 -87
  399. package/dist/source-manifest-publish-YORI42MN.js.map +0 -1
@@ -1,315 +0,0 @@
1
- import { pluginRegistry } from './chunk-G5SUWZEU.js';
2
- import { AI_PROVIDER_PRESETS } from './chunk-6UP2EDFN.js';
3
- import { resolveCredential } from './chunk-VSX2G7LA.js';
4
- import { parseCredentialRef, registryEntries, isEntryEnabled } from './chunk-RXGPFAMN.js';
5
-
6
- // bridge/src/harness-capabilities.ts
7
- var GENERIC_HARNESS_CAPABILITIES = {
8
- inProcessMcpServers: false,
9
- liveToolUpdates: true,
10
- managedSession: false,
11
- claudeCodeCredentials: false,
12
- resumeNeedsTranscript: false
13
- };
14
- var BUILTIN_HARNESS_CAPABILITIES = {
15
- // Recomposes its tools per turn, so a hot-plugged MCP server is live.
16
- omp: {
17
- inProcessMcpServers: false,
18
- liveToolUpdates: true,
19
- managedSession: false,
20
- claudeCodeCredentials: false,
21
- resumeNeedsTranscript: false
22
- },
23
- // The SDK takes in-process server instances and bakes its tool set at
24
- // creation; it reads Claude's `~/.claude` credentials and JSONL transcripts.
25
- "claude-sdk": {
26
- inProcessMcpServers: true,
27
- liveToolUpdates: false,
28
- managedSession: false,
29
- claudeCodeCredentials: true,
30
- resumeNeedsTranscript: true
31
- },
32
- // Standalone SDK recomposes its tools per turn. A host-managed session
33
- // (native app-server) refreshes its own native tool snapshot instead.
34
- codex: {
35
- inProcessMcpServers: false,
36
- liveToolUpdates: true,
37
- managedSession: true,
38
- claudeCodeCredentials: false,
39
- resumeNeedsTranscript: false
40
- }
41
- };
42
- function harnessCapabilities(id) {
43
- const declared = id ? Object.hasOwn(BUILTIN_HARNESS_CAPABILITIES, id) ? BUILTIN_HARNESS_CAPABILITIES[id] : pluginRegistry.get("harness", id)?.capabilities : void 0;
44
- return { ...GENERIC_HARNESS_CAPABILITIES, ...declared };
45
- }
46
- function supportsLiveToolUpdates(id, managed = false) {
47
- const caps = harnessCapabilities(id);
48
- return caps.liveToolUpdates && !(managed && caps.managedSession);
49
- }
50
-
51
- // bridge/src/provider-materialize/credential-env.ts
52
- var PROVIDER_CREDENTIAL_ENV_PREFIX = "SKAILE_AIP_";
53
- var PROVIDER_CREDENTIAL_ENV_SUFFIX = "_KEY";
54
- function providerCredentialEnvName(providerId) {
55
- const slug = providerId.replace(/[^A-Za-z0-9]/g, "_").toUpperCase();
56
- return `${PROVIDER_CREDENTIAL_ENV_PREFIX}${slug}${PROVIDER_CREDENTIAL_ENV_SUFFIX}`;
57
- }
58
- function conventionalCredentialEnvName(entry) {
59
- const preset = entry.preset ? AI_PROVIDER_PRESETS[entry.preset] : void 0;
60
- if (preset?.credential.env) return preset.credential.env;
61
- const ref = entry.credential?.ref ? parseCredentialRef(entry.credential.ref) : void 0;
62
- return ref?.form === "env" ? ref.name : void 0;
63
- }
64
- function resolveEntryCredential(entry, options = {}) {
65
- return resolveCredential(entry, {
66
- ...options.env ? { env: options.env } : {},
67
- ...options.secrets ? { secrets: options.secrets } : {},
68
- ...options.allowCommand === void 0 ? {} : { allowCommand: options.allowCommand }
69
- }).value;
70
- }
71
- function entryCredentialValue(providerId, entry, options = {}) {
72
- return resolveEntryCredential(entry, options) ?? options.env?.[providerCredentialEnvName(providerId)];
73
- }
74
- function unresolvedProviderCredentials(registry, options = {}) {
75
- const out = [];
76
- for (const [id, entry] of registryEntries(registry)) {
77
- if (entry.kind !== "llm" && entry.kind !== "embed") continue;
78
- if (!isEntryEnabled(entry)) continue;
79
- if (options.providerId && id !== options.providerId) continue;
80
- const resolved = resolveCredential(entry, {
81
- ...options.env ? { env: options.env } : {},
82
- ...options.secrets ? { secrets: options.secrets } : {},
83
- ...options.allowCommand === void 0 ? {} : { allowCommand: options.allowCommand }
84
- });
85
- if (!resolved.error) continue;
86
- if (options.env?.[providerCredentialEnvName(id)]) continue;
87
- out.push({ providerId: id, reason: resolved.error });
88
- }
89
- return out;
90
- }
91
- function entryCredentialEnv(providerId, entry, options = {}) {
92
- const value = resolveEntryCredential(entry, options);
93
- if (!value) return {};
94
- const out = { [providerCredentialEnvName(providerId)]: value };
95
- if (options.aliases !== false) {
96
- const alias = conventionalCredentialEnvName(entry);
97
- if (alias) out[alias] = value;
98
- }
99
- return out;
100
- }
101
- function registryCredentialEnv(registry, options = {}) {
102
- const canonical = {};
103
- const aliases = {};
104
- for (const [id, entry] of registryEntries(registry)) {
105
- if (options.providerId && id !== options.providerId) continue;
106
- if (!isEntryEnabled(entry)) continue;
107
- const value = resolveEntryCredential(entry, options);
108
- if (!value) continue;
109
- canonical[providerCredentialEnvName(id)] = value;
110
- if (options.aliases === false) continue;
111
- const alias = conventionalCredentialEnvName(entry);
112
- if (alias && aliases[alias] === void 0) aliases[alias] = value;
113
- }
114
- return { ...aliases, ...canonical };
115
- }
116
-
117
- // bridge/src/registry.ts
118
- var INCLUDE_CLAUDE_SDK = typeof __INCLUDE_CLAUDE_SDK__ === "undefined" ? true : __INCLUDE_CLAUDE_SDK__;
119
- var INCLUDE_CODEX = typeof __INCLUDE_CODEX__ === "undefined" ? true : __INCLUDE_CODEX__;
120
- var OMP_SURFACES = [
121
- "anthropic-messages",
122
- "openai-completions",
123
- "openai-responses",
124
- "openai-codex-responses",
125
- "azure-openai-responses",
126
- "bedrock-converse-stream",
127
- "google-generative-ai",
128
- "google-vertex"
129
- ];
130
- var BUILTIN_HARNESS_CATALOG = {
131
- omp: {
132
- id: "omp",
133
- name: "omp (oh-my-pi)",
134
- modelAgnostic: true,
135
- supportsInBandAbort: true,
136
- surfaces: OMP_SURFACES,
137
- // omp renders the whole registry as its own `models.yml`, so every entry
138
- // stays selectable and roles / per-subagent models resolve across them.
139
- providerPlurality: "registry",
140
- capabilities: BUILTIN_HARNESS_CAPABILITIES.omp
141
- },
142
- "claude-sdk": {
143
- id: "claude-sdk",
144
- name: "Claude Agent SDK",
145
- modelAgnostic: false,
146
- supportsInBandAbort: true,
147
- // Anthropic's own API, plus the two clouds the SDK addresses natively.
148
- // Foundry is `anthropic-messages` at a different host, not a surface.
149
- surfaces: ["anthropic-messages", "bedrock-converse-stream", "google-vertex"],
150
- providerPlurality: "single",
151
- capabilities: BUILTIN_HARNESS_CAPABILITIES["claude-sdk"]
152
- },
153
- codex: {
154
- id: "codex",
155
- name: "OpenAI Codex",
156
- modelAgnostic: false,
157
- supportsInBandAbort: true,
158
- // Codex's `wire_api` is `responses` or `chat`; its subscription transport
159
- // is the codex-specific responses flavour.
160
- surfaces: ["openai-codex-responses", "openai-responses", "openai-completions"],
161
- providerPlurality: "single",
162
- capabilities: BUILTIN_HARNESS_CAPABILITIES.codex
163
- },
164
- echo: {
165
- id: "echo",
166
- name: "Echo (E2E mock)",
167
- modelAgnostic: true,
168
- supportsInBandAbort: false,
169
- // Deterministic mock: it never opens a connection, so it speaks no wire
170
- // surface and no registry entry can be dispatched to it.
171
- surfaces: [],
172
- providerPlurality: "single"
173
- },
174
- gemini: {
175
- id: "gemini",
176
- name: "Gemini CLI",
177
- modelAgnostic: false,
178
- supportsInBandAbort: false,
179
- surfaces: ["google-generative-ai"],
180
- providerPlurality: "single"
181
- },
182
- qwen: {
183
- id: "qwen",
184
- name: "Qwen Code",
185
- modelAgnostic: true,
186
- supportsInBandAbort: false,
187
- // Driven entirely through OPENAI_BASE_URL / OPENAI_API_KEY.
188
- surfaces: ["openai-completions"],
189
- providerPlurality: "single"
190
- },
191
- opencode: {
192
- id: "opencode",
193
- name: "OpenCode",
194
- modelAgnostic: true,
195
- supportsInBandAbort: false,
196
- surfaces: [
197
- "anthropic-messages",
198
- "openai-completions",
199
- "openai-responses",
200
- "google-generative-ai"
201
- ],
202
- providerPlurality: "credentials-n"
203
- },
204
- goose: {
205
- id: "goose",
206
- name: "Goose",
207
- modelAgnostic: true,
208
- supportsInBandAbort: false,
209
- surfaces: [
210
- "anthropic-messages",
211
- "openai-completions",
212
- "google-generative-ai",
213
- "bedrock-converse-stream"
214
- ],
215
- providerPlurality: "credentials-n"
216
- },
217
- continue: {
218
- id: "continue",
219
- name: "Continue CLI",
220
- modelAgnostic: true,
221
- supportsInBandAbort: false,
222
- surfaces: ["anthropic-messages", "openai-completions", "google-generative-ai"],
223
- providerPlurality: "credentials-n"
224
- }
225
- };
226
- var _harnessesRegistered = false;
227
- async function registerBuiltinHarnesses(registry = pluginRegistry) {
228
- if (registry === pluginRegistry && _harnessesRegistered) return;
229
- if (!registry.get("harness", "omp")) {
230
- const m = await import('./bridge/harnesses/omp.js');
231
- registry.register("harness", m.ompHarnessTarget);
232
- }
233
- if (!registry.get("harness", "echo")) {
234
- const m = await import('./bridge/harnesses/echo.js');
235
- registry.register("harness", m.echoHarnessTarget);
236
- }
237
- if (INCLUDE_CLAUDE_SDK && !registry.get("harness", "claude-sdk")) {
238
- const m = await import('./bridge/harnesses/claude-sdk.js');
239
- registry.register("harness", m.claudeSdkHarnessTarget);
240
- }
241
- if (INCLUDE_CODEX && !registry.get("harness", "codex")) {
242
- const m = await import('./bridge/harnesses/codex.js');
243
- registry.register("harness", m.codexHarnessTarget);
244
- }
245
- if (!registry.get("harness", "gemini")) {
246
- const m = await import('./bridge/harnesses/gemini.js');
247
- registry.register("harness", m.geminiHarnessTarget);
248
- }
249
- if (!registry.get("harness", "qwen")) {
250
- const m = await import('./bridge/harnesses/qwen.js');
251
- registry.register("harness", m.qwenHarnessTarget);
252
- }
253
- if (!registry.get("harness", "opencode")) {
254
- const m = await import('./bridge/harnesses/opencode.js');
255
- registry.register("harness", m.opencodeHarnessTarget);
256
- }
257
- if (!registry.get("harness", "goose")) {
258
- const m = await import('./bridge/harnesses/goose.js');
259
- registry.register("harness", m.gooseHarnessTarget);
260
- }
261
- if (!registry.get("harness", "continue")) {
262
- const m = await import('./bridge/harnesses/continue.js');
263
- registry.register("harness", m.continueHarnessTarget);
264
- }
265
- if (registry === pluginRegistry) _harnessesRegistered = true;
266
- }
267
- async function createHarness(id, config, ctx) {
268
- const target = await resolveHarnessTarget(id);
269
- return target.create(config, ctx ?? {});
270
- }
271
- async function resolveHarnessTarget(id) {
272
- await registerBuiltinHarnesses();
273
- const target = pluginRegistry.get("harness", id);
274
- if (!target) {
275
- if (id in BUILTIN_HARNESS_CATALOG) {
276
- throw new Error(`Agent harness "${id}" is not bundled in this build.`);
277
- }
278
- throw new Error(
279
- `Unknown agent harness: "${id}". Available: ${listHarnesses().map((d) => d.id).join(", ")}`
280
- );
281
- }
282
- return target;
283
- }
284
- function listHarnesses() {
285
- const merged = /* @__PURE__ */ new Map();
286
- for (const info of Object.values(BUILTIN_HARNESS_CATALOG)) {
287
- merged.set(info.id, info);
288
- }
289
- for (const meta of pluginRegistry.list("harness")) {
290
- if (!merged.has(meta.id)) {
291
- const target = pluginRegistry.get("harness", meta.id);
292
- merged.set(meta.id, {
293
- id: meta.id,
294
- name: meta.displayName,
295
- modelAgnostic: target?.modelAgnostic ?? false,
296
- supportsInBandAbort: target?.supportsInBandAbort ?? false,
297
- // Left absent when the target declares nothing: "speaks no surface" and
298
- // "did not say" are different claims, and the platform resolver must be
299
- // able to tell them apart before it filters a harness out.
300
- ...target?.surfaces ? { surfaces: target.surfaces } : {},
301
- ...target?.providerPlurality ? { providerPlurality: target.providerPlurality } : {},
302
- ...target?.capabilities ? { capabilities: target.capabilities } : {}
303
- });
304
- }
305
- }
306
- return [...merged.values()];
307
- }
308
- async function listModelsForHarness(harnessId, registry, options) {
309
- const target = await resolveHarnessTarget(harnessId);
310
- return await target.listModels?.(registry, options) ?? [];
311
- }
312
-
313
- export { BUILTIN_HARNESS_CATALOG, PROVIDER_CREDENTIAL_ENV_PREFIX, PROVIDER_CREDENTIAL_ENV_SUFFIX, conventionalCredentialEnvName, createHarness, entryCredentialEnv, entryCredentialValue, harnessCapabilities, listHarnesses, listModelsForHarness, providerCredentialEnvName, registerBuiltinHarnesses, registryCredentialEnv, resolveEntryCredential, supportsLiveToolUpdates, unresolvedProviderCredentials };
314
- //# sourceMappingURL=chunk-S6KZHPR4.js.map
315
- //# sourceMappingURL=chunk-S6KZHPR4.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../bridge/src/harness-capabilities.ts","../bridge/src/provider-materialize/credential-env.ts","../bridge/src/registry.ts"],"names":[],"mappings":";;;;;;AAqBA,IAAM,4BAAA,GAAoD;AAAA,EACxD,mBAAA,EAAqB,KAAA;AAAA,EACrB,eAAA,EAAiB,IAAA;AAAA,EACjB,cAAA,EAAgB,KAAA;AAAA,EAChB,qBAAA,EAAuB,KAAA;AAAA,EACvB,qBAAA,EAAuB;AACzB,CAAA;AAQO,IAAM,4BAAA,GAA+B;AAAA;AAAA,EAE1C,GAAA,EAAK;AAAA,IACH,mBAAA,EAAqB,KAAA;AAAA,IACrB,eAAA,EAAiB,IAAA;AAAA,IACjB,cAAA,EAAgB,KAAA;AAAA,IAChB,qBAAA,EAAuB,KAAA;AAAA,IACvB,qBAAA,EAAuB;AAAA,GACzB;AAAA;AAAA;AAAA,EAGA,YAAA,EAAc;AAAA,IACZ,mBAAA,EAAqB,IAAA;AAAA,IACrB,eAAA,EAAiB,KAAA;AAAA,IACjB,cAAA,EAAgB,KAAA;AAAA,IAChB,qBAAA,EAAuB,IAAA;AAAA,IACvB,qBAAA,EAAuB;AAAA,GACzB;AAAA;AAAA;AAAA,EAGA,KAAA,EAAO;AAAA,IACL,mBAAA,EAAqB,KAAA;AAAA,IACrB,eAAA,EAAiB,IAAA;AAAA,IACjB,cAAA,EAAgB,IAAA;AAA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A,GAAa,QAAA,EAAU,OAAO,KAAM,EAAC;AAC5D","file":"chunk-S6KZHPR4.js","sourcesContent":["/**\n * What the runner may ask of a harness, by harness id.\n *\n * Deliberately light: this module imports no harness, no SDK and no `zod`, so a\n * runner file that only needs a capability can import it without loading the\n * harness graph. The plugin-registry singleton is read through its `internal`\n * module (the same file `@skaile/workspaces/plugin-registry` re-exports, so one\n * instance under the bundler's shared chunks), not through the package index,\n * which pulls in the deploy helpers and their `zod` schemas.\n *\n * @docLink packages/bridge/api-reference#registry\n */\n\nimport { pluginRegistry } from \"../../plugin-registry/src/internal.js\";\nimport type { HarnessCapabilities } from \"@skaile/workspaces/types\";\n\n/**\n * Capabilities of a harness that declares none: it recomposes its tools per\n * turn like every bridge harness that is not an in-process SDK, and has no\n * managed session, credentials file or transcript-file resume.\n */\nconst GENERIC_HARNESS_CAPABILITIES: HarnessCapabilities = {\n inProcessMcpServers: false,\n liveToolUpdates: true,\n managedSession: false,\n claudeCodeCredentials: false,\n resumeNeedsTranscript: false,\n};\n\n/**\n * Declared capabilities of the built-in harnesses that differ from nothing.\n * `BUILTIN_HARNESS_CATALOG` rows point at these entries, so `listHarnesses()` and\n * {@link harnessCapabilities} read one table. A built-in absent here (echo,\n * gemini, qwen, opencode, goose, continue) takes the generic defaults.\n */\nexport const BUILTIN_HARNESS_CAPABILITIES = {\n // Recomposes its tools per turn, so a hot-plugged MCP server is live.\n omp: {\n inProcessMcpServers: false,\n liveToolUpdates: true,\n managedSession: false,\n claudeCodeCredentials: false,\n resumeNeedsTranscript: false,\n },\n // The SDK takes in-process server instances and bakes its tool set at\n // creation; it reads Claude's `~/.claude` credentials and JSONL transcripts.\n \"claude-sdk\": {\n inProcessMcpServers: true,\n liveToolUpdates: false,\n managedSession: false,\n claudeCodeCredentials: true,\n resumeNeedsTranscript: true,\n },\n // Standalone SDK recomposes its tools per turn. A host-managed session\n // (native app-server) refreshes its own native tool snapshot instead.\n codex: {\n inProcessMcpServers: false,\n liveToolUpdates: true,\n managedSession: true,\n claudeCodeCredentials: false,\n resumeNeedsTranscript: false,\n },\n} as const satisfies Record<string, HarnessCapabilities>;\n\n/**\n * Resolve what the runner may ask of a harness, by harness id, without loading\n * its module. Built-ins read {@link BUILTIN_HARNESS_CAPABILITIES}; a third-party\n * harness reads its registered `HarnessTarget`; an unknown or absent id gets the\n * generic defaults. Fields a harness omits take the generic default too.\n *\n * This is the one place the runner learns harness facts — it never compares an\n * id against `\"claude-sdk\"`, `\"codex\"` or `\"omp\"`.\n *\n * @param id - Harness id (e.g. a session's `harnessType`); `undefined` resolves to the defaults.\n * @docLink packages/bridge/api-reference#registry\n */\nexport function harnessCapabilities(id: string | undefined): HarnessCapabilities {\n const declared = id\n ? Object.hasOwn(BUILTIN_HARNESS_CAPABILITIES, id)\n ? BUILTIN_HARNESS_CAPABILITIES[id as keyof typeof BUILTIN_HARNESS_CAPABILITIES]\n : pluginRegistry.get(\"harness\", id)?.capabilities\n : undefined;\n return { ...GENERIC_HARNESS_CAPABILITIES, ...declared };\n}\n\n/**\n * Whether a hot-plugged MCP server reaches the agent's next turn without a\n * harness restart. A host-managed session refreshes its native tool snapshot\n * itself, so it never takes live updates, whatever the standalone harness does.\n *\n * @param id - Harness id of the live session.\n * @param managed - Whether the session is host-managed (`managedCodex`).\n * @docLink packages/bridge/api-reference#registry\n */\nexport function supportsLiveToolUpdates(id: string | undefined, managed = false): boolean {\n const caps = harnessCapabilities(id);\n return caps.liveToolUpdates && !(managed && caps.managedSession);\n}\n","/**\n * Credential delivery for harness adapters — the one naming rule (§2.3).\n *\n * Every adapter that hands a registry entry's secret to a child process, and\n * every renderer that has to *name* that secret in a config file it writes\n * (omp's `models.yml` `apiKey:`, Codex's `env_key`, OpenCode's `{env:…}`),\n * agrees on one env-var name per entry: `SKAILE_AIP_<UPPER_ID>_KEY`. The name\n * goes in the file, the value goes in the child environment — a rendered\n * config never contains a secret.\n *\n * The platform's secret-env allowlist is a prefix rule on exactly that name,\n * and forge-common delivers the same names when it spawns `skaile serve`, so\n * the transform below is a cross-repo contract: uppercase, every character\n * outside `[A-Za-z0-9]` mapped to `_` (registry ids are `[a-z0-9][a-z0-9_-]*`,\n * so in practice only `-`).\n *\n * Alongside the canonical name, {@link registryCredentialEnv} also sets the\n * *conventional* carrier a CLI already reads (`ANTHROPIC_API_KEY`,\n * `GEMINI_API_KEY`, `GROQ_API_KEY`, …) so a catalog-preset entry works in a\n * harness that has no per-endpoint config file yet.\n *\n * @see PROVIDER-CONFIG-PLAN.md §1.4, §2.3\n */\n\nimport {\n type AIProviderEntry,\n type AIProviderRegistry,\n isEntryEnabled,\n type MergedAIProviderRegistry,\n parseCredentialRef,\n registryEntries,\n} from \"@skaile/workspaces/core/provider-registry\";\nimport { resolveCredential } from \"@skaile/workspaces/core/provider-registry-credentials\";\nimport { AI_PROVIDER_PRESETS } from \"../provider-catalog.js\";\n\n/** Options shared by every registry-shaped credential resolution. */\nexport interface RegistryCredentialOptions {\n /** Restrict resolution to one entry — the provider half of a `modelRef`. */\n providerId?: string;\n /** Environment `env:` refs resolve against. Defaults to `process.env`. */\n env?: Record<string, string | undefined>;\n /** Control-plane secrets keyed by config id, for `platform:` refs. */\n secrets?: Record<string, string>;\n /** Run `cmd:` references. Default `true`. */\n allowCommand?: boolean;\n}\n\n/** Prefix of the canonical per-entry credential variable. */\nexport const PROVIDER_CREDENTIAL_ENV_PREFIX = \"SKAILE_AIP_\";\n\n/** Suffix of the canonical per-entry credential variable. */\nexport const PROVIDER_CREDENTIAL_ENV_SUFFIX = \"_KEY\";\n\n/**\n * The env-var name that carries a registry entry's credential:\n * `anthropic` → `SKAILE_AIP_ANTHROPIC_KEY`, `my-gw.eu` → `SKAILE_AIP_MY_GW_EU_KEY`.\n *\n * Pure: no environment, no registry, no I/O. Renderers call it per entry while\n * emitting a config file, adapters call it while assembling a child env, and\n * the platform allowlist matches the prefix.\n */\nexport function providerCredentialEnvName(providerId: string): string {\n const slug = providerId.replace(/[^A-Za-z0-9]/g, \"_\").toUpperCase();\n return `${PROVIDER_CREDENTIAL_ENV_PREFIX}${slug}${PROVIDER_CREDENTIAL_ENV_SUFFIX}`;\n}\n\n/**\n * The env var a harness already looks for on its own, when the entry names one.\n *\n * The catalog preset's conventional carrier wins (`GEMINI_API_KEY` for\n * `google`), because that is the name the vendor's own CLI reads; otherwise an\n * `env:NAME` credential reference is taken at face value — the operator named\n * that variable, so the child gets it under the same name. `cmd:`, `platform:`\n * and `keyring:` refs have no conventional carrier and return `undefined`.\n */\nexport function conventionalCredentialEnvName(entry: AIProviderEntry): string | undefined {\n const preset = entry.preset ? AI_PROVIDER_PRESETS[entry.preset] : undefined;\n if (preset?.credential.env) return preset.credential.env;\n const ref = entry.credential?.ref ? parseCredentialRef(entry.credential.ref) : undefined;\n return ref?.form === \"env\" ? ref.name : undefined;\n}\n\n/**\n * Resolve one entry's credential to its value, or `undefined` when there is\n * none to hand over (`kind: none`, an ambient `sigv4`/`google_adc` chain, an\n * unset variable, a reserved `keyring:` ref).\n */\nexport function resolveEntryCredential(\n entry: AIProviderEntry,\n options: RegistryCredentialOptions = {},\n): string | undefined {\n return resolveCredential(entry, {\n ...(options.env ? { env: options.env } : {}),\n ...(options.secrets ? { secrets: options.secrets } : {}),\n ...(options.allowCommand === undefined ? {} : { allowCommand: options.allowCommand }),\n }).value;\n}\n\n/**\n * One entry's credential value, including the one the session boundary\n * already resolved for it.\n *\n * A `platform:<configId>` reference is resolved by the runner — it holds the\n * `session_init` secrets map, the harness does not — and materialized into the\n * child environment under {@link providerCredentialEnvName}. So when the\n * reference itself yields nothing, that carrier is consulted: it is the same\n * secret, delivered one step earlier.\n */\nexport function entryCredentialValue(\n providerId: string,\n entry: AIProviderEntry,\n options: RegistryCredentialOptions = {},\n): string | undefined {\n return (\n resolveEntryCredential(entry, options) ?? options.env?.[providerCredentialEnvName(providerId)]\n );\n}\n\n/** One enabled entry whose credential is declared but cannot be resolved. */\nexport interface UnresolvedProviderCredential {\n providerId: string;\n /** Why it does not resolve, e.g. `environment variable ANTHROPIC_API_KEY is not set`. */\n reason: string;\n}\n\n/**\n * The enabled LLM/embed entries that name a credential this process cannot\n * resolve (the variable is unset, the command fails). A harness must not be\n * handed such an entry: the child would send an empty key and fail with a 401\n * instead of using its own login. Entries with no credential, an ambient\n * signing chain, or a value the session boundary already delivered under\n * {@link providerCredentialEnvName} are fine.\n */\nexport function unresolvedProviderCredentials(\n registry: AIProviderRegistry | MergedAIProviderRegistry,\n options: RegistryCredentialOptions = {},\n): UnresolvedProviderCredential[] {\n const out: UnresolvedProviderCredential[] = [];\n for (const [id, entry] of registryEntries(registry)) {\n if (entry.kind !== \"llm\" && entry.kind !== \"embed\") continue;\n if (!isEntryEnabled(entry)) continue;\n if (options.providerId && id !== options.providerId) continue;\n const resolved = resolveCredential(entry, {\n ...(options.env ? { env: options.env } : {}),\n ...(options.secrets ? { secrets: options.secrets } : {}),\n ...(options.allowCommand === undefined ? {} : { allowCommand: options.allowCommand }),\n });\n if (!resolved.error) continue;\n if (options.env?.[providerCredentialEnvName(id)]) continue;\n out.push({ providerId: id, reason: resolved.error });\n }\n return out;\n}\n\n/** Options for {@link entryCredentialEnv} / {@link registryCredentialEnv}. */\nexport interface RegistryCredentialEnvOptions extends RegistryCredentialOptions {\n /**\n * Also set the harness-conventional carrier\n * ({@link conventionalCredentialEnvName}). Default `true`. Set `false` for a\n * harness that reads every endpoint out of a rendered config file and must\n * not inherit a vendor default from a neighbouring entry.\n */\n aliases?: boolean;\n}\n\n/**\n * The credential variables one entry contributes: always\n * `SKAILE_AIP_<ID>_KEY`, plus the conventional carrier unless `aliases` is\n * `false`. Empty when the entry has no resolvable secret.\n */\nexport function entryCredentialEnv(\n providerId: string,\n entry: AIProviderEntry,\n options: RegistryCredentialEnvOptions = {},\n): Record<string, string> {\n const value = resolveEntryCredential(entry, options);\n if (!value) return {};\n const out: Record<string, string> = { [providerCredentialEnvName(providerId)]: value };\n if (options.aliases !== false) {\n const alias = conventionalCredentialEnvName(entry);\n if (alias) out[alias] = value;\n }\n return out;\n}\n\n/**\n * Every enabled entry's credential, as a child-process environment fragment.\n *\n * One canonical `SKAILE_AIP_<ID>_KEY` per entry whose credential resolves; the\n * conventional carriers are added underneath, first entry in registry order\n * winning a collision (registry order is highest-precedence layer first, so\n * the alias follows the same precedence the selector does). Entries whose\n * credential cannot be resolved contribute nothing.\n */\nexport function registryCredentialEnv(\n registry: AIProviderRegistry | MergedAIProviderRegistry,\n options: RegistryCredentialEnvOptions = {},\n): Record<string, string> {\n const canonical: Record<string, string> = {};\n const aliases: Record<string, string> = {};\n for (const [id, entry] of registryEntries(registry)) {\n if (options.providerId && id !== options.providerId) continue;\n if (!isEntryEnabled(entry)) continue;\n const value = resolveEntryCredential(entry, options);\n if (!value) continue;\n canonical[providerCredentialEnvName(id)] = value;\n if (options.aliases === false) continue;\n const alias = conventionalCredentialEnvName(entry);\n if (alias && aliases[alias] === undefined) aliases[alias] = value;\n }\n return { ...aliases, ...canonical };\n}\n","import type {\n AIProviderRegistry,\n AIProviderSurface,\n MergedAIProviderRegistry,\n} from \"@skaile/workspaces/core/provider-registry\";\nimport type { HarnessContext } from \"@skaile/workspaces/plugin-registry\";\nimport { type PluginRegistry, pluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport type { ModelEntry } from \"./models.js\";\nimport type { RegistryCredentialOptions } from \"./provider-materialize/credential-env.js\";\nimport { BUILTIN_HARNESS_CAPABILITIES } from \"./harness-capabilities.js\";\nimport type { AgentConfig, AgentHarness, HarnessInfo } from \"./types.js\";\n\n// Build-time harness gating. `bun build --compile --define:__INCLUDE_*__=...`\n// folds these to literal booleans so an excluded harness module and\n// its SDK are dead-code-stripped from the binary. Under tsup / vitest / bun\n// run-on-source no `--define` runs and the `typeof` guard defaults to `true` —\n// every harness is available (the SDKs stay optional peers).\ndeclare const __INCLUDE_CLAUDE_SDK__: boolean;\ndeclare const __INCLUDE_CODEX__: boolean;\nconst INCLUDE_CLAUDE_SDK =\n typeof __INCLUDE_CLAUDE_SDK__ === \"undefined\" ? true : __INCLUDE_CLAUDE_SDK__;\nconst INCLUDE_CODEX = typeof __INCLUDE_CODEX__ === \"undefined\" ? true : __INCLUDE_CODEX__;\n\n/**\n * Every wire surface omp can speak — it is the harness the `surface` enum was\n * lifted from, so its list is the enum.\n */\nconst OMP_SURFACES = [\n \"anthropic-messages\",\n \"openai-completions\",\n \"openai-responses\",\n \"openai-codex-responses\",\n \"azure-openai-responses\",\n \"bedrock-converse-stream\",\n \"google-generative-ai\",\n \"google-vertex\",\n] as const satisfies readonly AIProviderSurface[];\n\n/**\n * Static capability metadata for every built-in harness.\n *\n * Pure data — this object imports no harness module and references no harness\n * SDK. {@link listHarnesses} returns it (merged with any third-party harnesses)\n * so selection UIs can enumerate every harness without loading a single\n * harness module. The matching harness module's `HarnessTarget` is registered\n * into the plugin registry by {@link registerBuiltinHarnesses}.\n *\n * `surfaces` and `providerPlurality` are the harness-capability declaration\n * the AI provider registry resolves against (plan §2.3): which wire protocols\n * a harness can be pointed at, and how many registry entries it can use at\n * once. The platform's resolver filters candidate entries on `surfaces`\n * instead of matching vendor names.\n *\n * @docLink packages/bridge/api-reference#registry\n */\nexport const BUILTIN_HARNESS_CATALOG: Record<string, HarnessInfo> = {\n omp: {\n id: \"omp\",\n name: \"omp (oh-my-pi)\",\n modelAgnostic: true,\n supportsInBandAbort: true,\n surfaces: OMP_SURFACES,\n // omp renders the whole registry as its own `models.yml`, so every entry\n // stays selectable and roles / per-subagent models resolve across them.\n providerPlurality: \"registry\",\n capabilities: BUILTIN_HARNESS_CAPABILITIES.omp,\n },\n \"claude-sdk\": {\n id: \"claude-sdk\",\n name: \"Claude Agent SDK\",\n modelAgnostic: false,\n supportsInBandAbort: true,\n // Anthropic's own API, plus the two clouds the SDK addresses natively.\n // Foundry is `anthropic-messages` at a different host, not a surface.\n surfaces: [\"anthropic-messages\", \"bedrock-converse-stream\", \"google-vertex\"],\n providerPlurality: \"single\",\n capabilities: BUILTIN_HARNESS_CAPABILITIES[\"claude-sdk\"],\n },\n codex: {\n id: \"codex\",\n name: \"OpenAI Codex\",\n modelAgnostic: false,\n supportsInBandAbort: true,\n // Codex's `wire_api` is `responses` or `chat`; its subscription transport\n // is the codex-specific responses flavour.\n surfaces: [\"openai-codex-responses\", \"openai-responses\", \"openai-completions\"],\n providerPlurality: \"single\",\n capabilities: BUILTIN_HARNESS_CAPABILITIES.codex,\n },\n echo: {\n id: \"echo\",\n name: \"Echo (E2E mock)\",\n modelAgnostic: true,\n supportsInBandAbort: false,\n // Deterministic mock: it never opens a connection, so it speaks no wire\n // surface and no registry entry can be dispatched to it.\n surfaces: [],\n providerPlurality: \"single\",\n },\n gemini: {\n id: \"gemini\",\n name: \"Gemini CLI\",\n modelAgnostic: false,\n supportsInBandAbort: false,\n surfaces: [\"google-generative-ai\"],\n providerPlurality: \"single\",\n },\n qwen: {\n id: \"qwen\",\n name: \"Qwen Code\",\n modelAgnostic: true,\n supportsInBandAbort: false,\n // Driven entirely through OPENAI_BASE_URL / OPENAI_API_KEY.\n surfaces: [\"openai-completions\"],\n providerPlurality: \"single\",\n },\n opencode: {\n id: \"opencode\",\n name: \"OpenCode\",\n modelAgnostic: true,\n supportsInBandAbort: false,\n surfaces: [\n \"anthropic-messages\",\n \"openai-completions\",\n \"openai-responses\",\n \"google-generative-ai\",\n ],\n providerPlurality: \"credentials-n\",\n },\n goose: {\n id: \"goose\",\n name: \"Goose\",\n modelAgnostic: true,\n supportsInBandAbort: false,\n surfaces: [\n \"anthropic-messages\",\n \"openai-completions\",\n \"google-generative-ai\",\n \"bedrock-converse-stream\",\n ],\n providerPlurality: \"credentials-n\",\n },\n continue: {\n id: \"continue\",\n name: \"Continue CLI\",\n modelAgnostic: true,\n supportsInBandAbort: false,\n surfaces: [\"anthropic-messages\", \"openai-completions\", \"google-generative-ai\"],\n providerPlurality: \"credentials-n\",\n },\n};\n\nlet _harnessesRegistered = false;\n\n/**\n * Register every built-in harness's `HarnessTarget` into the plugin registry.\n *\n * This is the single id → module map in bridge core. Every specifier is a\n * literal string so `bun --compile` can statically bundle the harness module\n * (and, transitively, its SDK). The in-process-SDK harnesses (`claude-sdk`,\n * `codex`) are wrapped in build-constant guards so an excluded harness's\n * `await import` folds to dead code in the compiled binary. `omp` and `echo`\n * carry no SDK weight and are always available.\n *\n * **Static import discipline.** Every `import()` specifier below must be a\n * string literal — never aliased through a variable. Indirection defeats\n * `bun --compile`'s static analysis and silently drops the module from the\n * binary.\n *\n * Idempotent: guarded by a module flag so a second call is a no-op (a duplicate\n * `register` would otherwise throw `RegistrationError`).\n *\n * @docLink packages/bridge/api-reference#registry\n */\nexport async function registerBuiltinHarnesses(\n registry: PluginRegistry = pluginRegistry,\n): Promise<void> {\n if (registry === pluginRegistry && _harnessesRegistered) return;\n\n if (!registry.get(\"harness\", \"omp\")) {\n const m = await import(\"@skaile/workspaces/harnesses/omp\");\n registry.register(\"harness\", m.ompHarnessTarget);\n }\n if (!registry.get(\"harness\", \"echo\")) {\n const m = await import(\"@skaile/workspaces/harnesses/echo\");\n registry.register(\"harness\", m.echoHarnessTarget);\n }\n if (INCLUDE_CLAUDE_SDK && !registry.get(\"harness\", \"claude-sdk\")) {\n const m = await import(\"@skaile/workspaces/harnesses/claude-sdk\");\n registry.register(\"harness\", m.claudeSdkHarnessTarget);\n }\n if (INCLUDE_CODEX && !registry.get(\"harness\", \"codex\")) {\n const m = await import(\"@skaile/workspaces/harnesses/codex\");\n registry.register(\"harness\", m.codexHarnessTarget);\n }\n // Subprocess CLI harnesses spawn an external binary the user installs\n // separately — no bundled SDK to dead-code-strip, so (like omp/echo) they\n // carry no build constant and are always registered.\n if (!registry.get(\"harness\", \"gemini\")) {\n const m = await import(\"@skaile/workspaces/harnesses/gemini\");\n registry.register(\"harness\", m.geminiHarnessTarget);\n }\n if (!registry.get(\"harness\", \"qwen\")) {\n const m = await import(\"@skaile/workspaces/harnesses/qwen\");\n registry.register(\"harness\", m.qwenHarnessTarget);\n }\n if (!registry.get(\"harness\", \"opencode\")) {\n const m = await import(\"@skaile/workspaces/harnesses/opencode\");\n registry.register(\"harness\", m.opencodeHarnessTarget);\n }\n if (!registry.get(\"harness\", \"goose\")) {\n const m = await import(\"@skaile/workspaces/harnesses/goose\");\n registry.register(\"harness\", m.gooseHarnessTarget);\n }\n if (!registry.get(\"harness\", \"continue\")) {\n const m = await import(\"@skaile/workspaces/harnesses/continue\");\n registry.register(\"harness\", m.continueHarnessTarget);\n }\n\n if (registry === pluginRegistry) _harnessesRegistered = true;\n}\n\n/**\n * Creates a new harness instance for the given harness id.\n *\n * Ensures the built-in harness targets are registered (idempotent), then looks\n * up the target in the plugin registry and calls its `create()`. The returned\n * harness has not been started yet — call `harness.start()` before sending\n * prompts.\n *\n * @param id - Registered harness identifier (e.g. `\"omp\"`, `\"claude-sdk\"`).\n * @param config - Configuration forwarded to the harness constructor.\n * @param ctx - Optional harness context (logger / abort signal). Defaults to `{}`.\n * @returns A freshly constructed (not yet started) {@link AgentHarness}.\n * @throws {Error} When `id` is a known harness excluded from this build, or\n * when `id` does not match any registered harness at all.\n * @docLink packages/bridge/api-reference#registry\n */\nexport async function createHarness(\n id: string,\n config: AgentConfig,\n ctx?: HarnessContext,\n): Promise<AgentHarness> {\n const target = await resolveHarnessTarget(id);\n return target.create(config, ctx ?? {});\n}\n\n/**\n * Resolve a registered harness target by id, ensuring the built-ins are\n * registered first. Throws the canonical \"not bundled\" / \"unknown harness\"\n * errors so every caller (`createHarness`, `listModelsForHarness`) reports an\n * unrecognized id the same way instead of silently degrading.\n *\n * @throws {Error} When `id` is a known harness excluded from this build, or\n * when `id` does not match any registered harness at all.\n */\nasync function resolveHarnessTarget(id: string) {\n await registerBuiltinHarnesses();\n const target = pluginRegistry.get(\"harness\", id);\n if (!target) {\n if (id in BUILTIN_HARNESS_CATALOG) {\n throw new Error(`Agent harness \"${id}\" is not bundled in this build.`);\n }\n throw new Error(\n `Unknown agent harness: \"${id}\". Available: ${listHarnesses()\n .map((d) => d.id)\n .join(\", \")}`,\n );\n }\n return target;\n}\n\n/**\n * Returns the capability metadata for every available harness.\n *\n * Enumerates every built-in harness from {@link BUILTIN_HARNESS_CATALOG} without\n * loading a single harness module or harness SDK, then merges in any third-party\n * harness targets registered into the plugin registry that are not already in\n * the catalog. Use this to populate harness selection UIs.\n *\n * @returns Array of {@link HarnessInfo} objects, one per available harness.\n * @docLink packages/bridge/api-reference#registry\n */\nexport function listHarnesses(): HarnessInfo[] {\n const merged = new Map<string, HarnessInfo>();\n for (const info of Object.values(BUILTIN_HARNESS_CATALOG)) {\n merged.set(info.id, info);\n }\n for (const meta of pluginRegistry.list(\"harness\")) {\n if (!merged.has(meta.id)) {\n // Third-party harnesses carry no HarnessInfo row; read the capability flags\n // off the registered target (defaulting to conservative false) so a\n // model-agnostic / in-band-abort harness can still advertise them.\n const target = pluginRegistry.get(\"harness\", meta.id);\n merged.set(meta.id, {\n id: meta.id,\n name: meta.displayName,\n modelAgnostic: target?.modelAgnostic ?? false,\n supportsInBandAbort: target?.supportsInBandAbort ?? false,\n // Left absent when the target declares nothing: \"speaks no surface\" and\n // \"did not say\" are different claims, and the platform resolver must be\n // able to tell them apart before it filters a harness out.\n ...(target?.surfaces ? { surfaces: target.surfaces } : {}),\n ...(target?.providerPlurality ? { providerPlurality: target.providerPlurality } : {}),\n ...(target?.capabilities ? { capabilities: target.capabilities } : {}),\n });\n }\n }\n return [...merged.values()];\n}\n\n/**\n * List models available to a specific harness without starting a full agent session.\n *\n * Ensures the built-in harness targets are registered (idempotent), then\n * delegates to the target's optional `listModels()`. Throws on an unknown /\n * not-bundled id (same contract as {@link createHarness}); returns `[]` only\n * when the target exists but exposes no `listModels`.\n *\n * @param harnessId - Registered harness id (e.g. `\"omp\"`, `\"claude-sdk\"`, `\"codex\"`).\n * @param registry - The AI provider registry to discover against — either the\n * bare `id → entry` map or a merged view. Each entry names its credential by\n * reference, resolved through `options` and delivered to the throwaway\n * harness as `SKAILE_AIP_<ID>_KEY` environment entries.\n * @param options - Which entry to restrict to, and where `env:` / `platform:`\n * references resolve from. Defaults to the whole registry against\n * `process.env`.\n * @throws {Error} When `harnessId` is unknown or excluded from this build.\n * @docLink packages/bridge/api-reference#registry\n */\nexport async function listModelsForHarness(\n harnessId: string,\n registry: AIProviderRegistry | MergedAIProviderRegistry,\n options?: RegistryCredentialOptions,\n): Promise<ModelEntry[]> {\n const target = await resolveHarnessTarget(harnessId);\n return (await target.listModels?.(registry, options)) ?? [];\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../cli/src/plugin-store/paths.ts","../cli/src/plugin-store/spec.ts","../cli/src/plugin-store/load.ts","../cli/src/plugin-store/reconcile.ts","../cli/src/plugin-store/index.ts"],"names":["existsSync","readFileSync","join"],"mappings":";;;;;;;;AAWO,SAAS,WAAW,UAAA,EAA4B;AACrD,EAAA,OAAO,IAAA,CAAK,UAAA,EAAY,SAAA,EAAW,SAAS,CAAA;AAC9C;AAGO,SAAS,eAAe,UAAA,EAA4B;AACzD,EAAA,OAAO,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,EAAG,cAAc,CAAA;AACpD;AAGO,SAAS,eAAe,UAAA,EAA4B;AACzD,EAAA,OAAO,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,EAAG,cAAc,CAAA;AACpD;AAGO,SAAS,kBAAkB,UAAA,EAA4B;AAC5D,EAAA,OAAO,IAAA,CAAK,UAAA,CAAW,UAAU,CAAA,EAAG,iBAAiB,CAAA;AACvD;AAGA,SAAS,cAAc,MAAA,EAAqC;AAC1D,EAAA,IAAI,OAAO,MAAA,KAAW,QAAA,EAAU,OAAO,MAAA;AACvC,EAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,MAAM,CAAA,EAAG;AACzB,IAAA,KAAA,MAAW,KAAK,MAAA,EAAQ;AACtB,MAAA,MAAM,GAAA,GAAM,cAAc,CAAC,CAAA;AAC3B,MAAA,IAAI,KAAK,OAAO,GAAA;AAAA,IAClB;AACA,IAAA,OAAO,MAAA;AAAA,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yB,UAAU,CAAA,CAAE,OAAA;AAAA,EACjD,CAAA,CAAA,MAAQ;AACN,IAAA;AAAA,EACF;AACA,EAAA,IAAI,CAAC,OAAA,IAAW,OAAA,CAAQ,MAAA,KAAW,CAAA,EAAG;AACtC,EAAA,IAAI;AACF,IAAA,MAAM,MAAA,GAAS,MAAM,mBAAA,CAAoB,UAAA,EAAY,SAAS,cAAc,CAAA;AAC5E,IAAA,KAAA,MAAW,KAAK,MAAA,CAAO,MAAA,mBAAyB,CAAA,CAAE,IAAA,EAAM,EAAE,MAAM,CAAA;AAAA,EAClE,SAAS,GAAA,EAAK;AAEZ,IAAA,MAAM,SAAS,GAAA,YAAe,KAAA,GAAQ,GAAA,CAAI,OAAA,GAAU,OAAO,GAAG,CAAA;AAC9D,IAAA,MAAM,OAAA,GAAU,oBAAA,CAAqB,MAAA,EAAQ,OAAO,CAAA;AACpD,IAAA,KAAA,MAAW,IAAA,IAAQ,SAAS,gBAAA,CAAiB,IAAA,EAAM,QAAQ,GAAA,CAAI,IAAI,KAAK,MAAM,CAAA;AAAA,EAChF;AACF","file":"chunk-TO5SSMRI.js","sourcesContent":["/**\n * Pure path helpers for the project-local plugin store.\n *\n * The store is a self-contained npm workspace owned by the CLI under\n * `<projectDir>/.skaile/plugins/`. Only `resolvePluginEntry` reads the filesystem.\n */\n\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\n\n/** `<projectDir>/.skaile/plugins` — the store root. */\nexport function pluginsDir(projectDir: string): string {\n return join(projectDir, \".skaile\", \"plugins\");\n}\n\n/** `<store>/package.json` — generated, never user-edited. */\nexport function pluginsPkgJson(projectDir: string): string {\n return join(pluginsDir(projectDir), \"package.json\");\n}\n\n/** `<store>/node_modules` — where reconciled plugin packages land. */\nexport function nodeModulesDir(projectDir: string): string {\n return join(pluginsDir(projectDir), \"node_modules\");\n}\n\n/** `<store>/.reconcile-hash` — SHA of plugins-list + lock slice; skip reinstall when unchanged. */\nexport function reconcileHashFile(projectDir: string): string {\n return join(pluginsDir(projectDir), \".reconcile-hash\");\n}\n\n/** Pick the file an `exports` target points at, preferring the ESM-friendly conditions. */\nfunction exportsTarget(target: unknown): string | undefined {\n if (typeof target === \"string\") return target;\n if (Array.isArray(target)) {\n for (const t of target) {\n const hit = exportsTarget(t);\n if (hit) return hit;\n }\n return undefined;\n }\n if (target && typeof target === \"object\") {\n const map = target as Record<string, unknown>;\n for (const cond of [\"import\", \"node\", \"default\", \"require\"]) {\n if (cond in map) {\n const hit = exportsTarget(map[cond]);\n if (hit) return hit;\n }\n }\n }\n return undefined;\n}\n\n/**\n * Absolute path to a plugin package's entry file under the store's\n * `node_modules`, resolved from its `package.json` (`exports[\".\"]`, then\n * `module`, then `main`, then `index.js`). Node's ESM loader rejects directory\n * imports, so the entry must be a file; `import()` of the result works inside\n * compiled binaries via `pathToFileURL`.\n *\n * @throws When the package is not installed or declares no resolvable entry.\n */\nexport function resolvePluginEntry(projectDir: string, pkgName: string): string {\n const pkgDir = join(nodeModulesDir(projectDir), pkgName);\n const pkgJsonPath = join(pkgDir, \"package.json\");\n if (!existsSync(pkgJsonPath)) {\n throw new Error(`package \"${pkgName}\" is not installed in ${nodeModulesDir(projectDir)}`);\n }\n const pkg = JSON.parse(readFileSync(pkgJsonPath, \"utf8\")) as {\n exports?: unknown;\n module?: string;\n main?: string;\n };\n let rel: string | undefined;\n if (pkg.exports !== undefined) {\n const root =\n typeof pkg.exports === \"object\" && pkg.exports !== null && !Array.isArray(pkg.exports)\n ? ((pkg.exports as Record<string, unknown>)[\".\"] ?? pkg.exports)\n : pkg.exports;\n rel = exportsTarget(root);\n }\n rel ??= pkg.module ?? pkg.main ?? \"index.js\";\n const entry = resolve(pkgDir, rel);\n if (!existsSync(entry)) {\n throw new Error(`package \"${pkgName}\" entry ${rel} does not exist`);\n }\n return entry;\n}\n","/**\n * Parse npm package specifiers from the `plugins:` list into name + range.\n *\n * The leading `@` of a scope is NOT a separator: only the last `@` at a\n * non-zero index splits the package name from its semver range.\n * \"@skaile/provider-fly@^0.1.0\" → { name: \"@skaile/provider-fly\", range: \"^0.1.0\" }\n * \"@skaile/connector-redis\" → { name: \"@skaile/connector-redis\", range: \"*\" }\n * \"lodash@^4\" → { name: \"lodash\", range: \"^4\" }\n */\n\n/** A parsed plugin specifier: package name plus a semver range (`\"*\"` when omitted). */\nexport interface PluginSpec {\n name: string;\n range: string;\n}\n\n/**\n * Parse a single plugin specifier into `{ name, range }`.\n *\n * @param spec - An npm specifier, e.g. `\"@skaile/provider-fly@^0.1.0\"` or `\"lodash\"`.\n * @returns The package name and semver range (range defaults to `\"*\"`).\n * @throws Error when the specifier is empty.\n */\nexport function parseSpec(spec: string): PluginSpec {\n const trimmed = spec.trim();\n if (!trimmed) throw new Error(\"parseSpec: empty specifier\");\n\n // Find the version-separating `@` — the last one that is not the scope `@`\n // at index 0. A bare `@scope/name` has its only `@` at index 0 (no range).\n const at = trimmed.lastIndexOf(\"@\");\n if (at <= 0) {\n return { name: trimmed, range: \"*\" };\n }\n const name = trimmed.slice(0, at);\n const range = trimmed.slice(at + 1);\n return { name, range: range.length > 0 ? range : \"*\" };\n}\n\n/** Convenience: just the package name of a specifier. */\nexport function specName(spec: string): string {\n return parseSpec(spec).name;\n}\n\n/** An npm package name: optional `@scope/`, then lowercase letters, digits and `. _ ~ -`. */\nconst NPM_NAME = /^(?:@[a-z0-9][a-z0-9._~-]*\\/)?[a-z0-9][a-z0-9._~-]*$/;\n\n/**\n * The refusal for a specifier that is not an npm package name with an optional version range\n * (`./dir`, `../dir`, `/abs/dir`, `file:../dir`, `git+https://…`), or `undefined` when it is\n * one. A bare path or `file:` URL has no package name: the package manager would send it to the\n * registry and fail with its registry error (p1737). A local folder is installed under its\n * package name, `name@file:/path/to/dir`, which this accepts.\n */\nexport function npmSpecError(spec: string): string | undefined {\n const trimmed = spec.trim();\n if (trimmed !== \"\") {\n const { name, range } = parseSpec(trimmed);\n if (NPM_NAME.test(name) && (range.startsWith(\"file:\") || !/[\\s/\\\\]/.test(range))) {\n return undefined;\n }\n }\n return (\n `plugin spec '${spec}' is not an npm package name. Give an npm name with an optional version ` +\n \"range, for example @scope/name@1.2.0. To try a local plugin folder, give its package name: \" +\n \"name@file:/path/to/dir.\"\n );\n}\n","/**\n * Runtime plugin loader: dynamic-import each reconciled plugin and let it\n * self-register into the `pluginRegistry`.\n *\n * Each plugin specifier resolves to an absolute path under the store's\n * `node_modules`; we import it via a `file://` URL so the import works inside\n * `bun --compile` binaries (which bundle only the literal-string switches, but\n * can still execute a `file://` import against the unpacked store on disk).\n * Failures are caught per-plugin so one broken plugin never aborts the rest.\n */\n\nimport { pathToFileURL } from \"node:url\";\nimport { type PluginRegistry, pluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport { resolvePluginEntry } from \"./paths.js\";\nimport { parseSpec } from \"./spec.js\";\n\n/** Options for {@link loadPlugins}. */\nexport interface LoadOptions {\n log?: Logger;\n}\n\n/** Result of a load pass: which specs registered and which failed. */\nexport interface LoadResult {\n loaded: string[];\n failed: { spec: string; error: string; reason: string }[];\n}\n\n/** The self-registration entrypoint a plugin module is expected to export. */\ntype PluginModule = { register?: (registry: PluginRegistry) => void };\n\n/**\n * Load and register each plugin in `plugins` into `registry`.\n *\n * @param projectDir - Project root holding `.skaile/plugins/node_modules`.\n * @param plugins - The `skaile.yaml` `plugins:` list (npm specifiers).\n * @param registry - Registry to register into. Defaults to the process-wide `pluginRegistry`.\n * @param opts - Optional logger.\n * @returns Loaded specs + per-plugin failures (never throws).\n */\nexport async function loadPlugins(\n projectDir: string,\n plugins: string[],\n registry: PluginRegistry = pluginRegistry,\n opts: LoadOptions = {},\n): Promise<LoadResult> {\n const loaded: string[] = [];\n const failed: { spec: string; error: string; reason: string }[] = [];\n\n for (const spec of plugins) {\n try {\n const { name } = parseSpec(spec);\n const entry = resolvePluginEntry(projectDir, name);\n const mod = (await import(pathToFileURL(entry).href)) as PluginModule;\n if (typeof mod.register !== \"function\") {\n throw new Error(`plugin \"${name}\" does not export a register() function`);\n }\n mod.register(registry);\n loaded.push(spec);\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n failed.push({ spec, error: `failed to load plugin \"${spec}\": ${message}`, reason: message });\n opts.log?.warn(`plugin load failed: ${spec}`, { error: message });\n }\n }\n\n return { loaded, failed };\n}\n","/**\n * Reconcile the project-local plugin store (`<projectDir>/.skaile/plugins/`).\n *\n * The reconciler is hash-skipped: it computes a SHA-256 over the sorted plugin\n * list plus the lock file's `plugins` slice and compares it to the stored\n * `.reconcile-hash`. On a match it returns with zero further I/O; otherwise it\n * regenerates the store's `package.json` and runs `bun install` against it.\n *\n * The install step is injectable (`InstallFn`) so tests stay hermetic — they\n * pass a fake installer that records calls and writes a stub `node_modules`.\n */\n\nimport { createHash } from \"node:crypto\";\nimport { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { readPluginsLockSlice } from \"@skaile/workspaces/core\";\nimport { nodeModulesDir, pluginsDir, pluginsPkgJson, reconcileHashFile } from \"./paths.js\";\nimport { parseSpec } from \"./spec.js\";\n\n/** How `InstallFn` may treat the store's lock: `frozen` forbids lock changes. */\nexport interface InstallOptions {\n /**\n * `false` when the spec list changed since the last `package.json`, so the\n * lock has to change too. Defaults to `true` (frozen when a lock exists).\n */\n frozen?: boolean;\n}\n\n/**\n * Installs the store's dependencies. Returns `ok: false` (never throws) on a\n * failed install so the reconciler can surface the captured `output`.\n */\nexport type InstallFn = (\n pluginsDir: string,\n opts?: InstallOptions,\n) => Promise<{ ok: boolean; output: string }>;\n\n/** Options for {@link reconcilePlugins}. */\nexport interface ReconcileOptions {\n /** Injectable installer. Defaults to a real `bun install` of the store. */\n runInstall?: InstallFn;\n /**\n * Lock slice to fold into the reconcile-hash. Defaults to\n * `readPluginsLockSlice(projectDir)` so a lock edit invalidates the hash.\n */\n lockSlice?: unknown;\n}\n\n/** Result of a reconcile pass. */\nexport interface ReconcileResult {\n changed: boolean;\n reason: \"no-plugins\" | \"up-to-date\" | \"reconciled\";\n}\n\n/** Run a command to completion, capturing stdout+stderr. `started: false` when it cannot spawn. */\nasync function runCapture(\n args: string[],\n cwd: string,\n): Promise<{ started: boolean; code: number; output: string }> {\n const { portableSpawn } = await import(\"@skaile/workspaces/core\");\n const proc = portableSpawn(args, { cwd });\n const chunks: string[] = [];\n const decoder = new TextDecoder();\n const pump = async (stream: ReadableStream<Uint8Array>) => {\n const reader = stream.getReader();\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n if (value) chunks.push(decoder.decode(value, { stream: true }));\n }\n };\n await Promise.all([pump(proc.stdout), pump(proc.stderr)]);\n const code = await proc.exited;\n // `portableSpawn` reports a spawn error (ENOENT) as exit -1 with no pid.\n return { started: proc.pid !== -1, code, output: chunks.join(\"\") };\n}\n\n/**\n * The default real installer: `bun install` inside the store directory, or\n * `npm install` when `bun` is not on PATH. Frozen only when a lock exists and\n * the spec list did not change (`opts.frozen !== false`): a changed list has to\n * rewrite the lock, which a frozen install refuses.\n */\nexport const defaultInstall: InstallFn = async (dir, opts = {}) => {\n const hasBunLock = existsSync(`${dir}/bun.lock`) || existsSync(`${dir}/bun.lockb`);\n const hasNpmLock = existsSync(`${dir}/package-lock.json`);\n const frozen = opts.frozen !== false;\n\n const bunArgs =\n frozen && (hasBunLock || hasNpmLock)\n ? [\"bun\", \"install\", \"--frozen-lockfile\"]\n : [\"bun\", \"install\"];\n const withBun = await runCapture(bunArgs, dir);\n if (withBun.started) return { ok: withBun.code === 0, output: withBun.output };\n\n const npmArgs =\n frozen && hasNpmLock\n ? [\"npm\", \"ci\", \"--ignore-scripts\", \"--no-audit\", \"--no-fund\"]\n : [\"npm\", \"install\", \"--ignore-scripts\", \"--no-audit\", \"--no-fund\"];\n const withNpm = await runCapture(npmArgs, dir);\n if (withNpm.started) return { ok: withNpm.code === 0, output: withNpm.output };\n return {\n ok: false,\n output:\n \"neither bun nor npm found on PATH; plugin install needs one of them (https://bun.sh or https://nodejs.org)\",\n };\n};\n\n/**\n * Generate the store's `package.json` from the plugin specs. Returns the\n * previous file content (`undefined` when there was none) and whether the\n * dependency set changed.\n */\nfunction writePackageJson(\n projectDir: string,\n plugins: string[],\n): { previous: string | undefined; depsChanged: boolean } {\n const dependencies: Record<string, string> = {};\n for (const spec of plugins) {\n const { name, range } = parseSpec(spec);\n dependencies[name] = range;\n }\n const pkg = {\n name: \"skaile-project-plugins\",\n private: true,\n dependencies,\n };\n const file = pluginsPkgJson(projectDir);\n const previous = existsSync(file) ? readFileSync(file, \"utf8\") : undefined;\n let before: Record<string, string> | undefined;\n try {\n before = previous === undefined ? undefined : JSON.parse(previous).dependencies;\n } catch {\n before = undefined;\n }\n const sortedJson = (d: Record<string, string> | undefined) =>\n JSON.stringify(Object.entries(d ?? {}).sort(([a], [b]) => a.localeCompare(b)));\n const depsChanged = before === undefined || sortedJson(before) !== sortedJson(dependencies);\n mkdirSync(pluginsDir(projectDir), { recursive: true });\n writeFileSync(file, `${JSON.stringify(pkg, null, 2)}\\n`);\n return { previous, depsChanged };\n}\n\n/**\n * Reconcile the plugin store for a project.\n *\n * @param projectDir - Project root containing `skaile.yaml` / `skaile.lock.yaml`.\n * @param plugins - The `skaile.yaml` `plugins:` list (npm specifiers).\n * @param opts - Optional injectable installer + lock slice override.\n * @returns Whether the store changed and why.\n */\nexport async function reconcilePlugins(\n projectDir: string,\n plugins: string[],\n opts: ReconcileOptions = {},\n): Promise<ReconcileResult> {\n if (plugins.length === 0) {\n return { changed: false, reason: \"no-plugins\" };\n }\n\n const lockSlice = opts.lockSlice ?? readPluginsLockSlice(projectDir);\n const wantHash = createHash(\"sha256\")\n .update(JSON.stringify({ plugins: [...plugins].sort(), lock: lockSlice }))\n .digest(\"hex\");\n\n const hashFile = reconcileHashFile(projectDir);\n if (existsSync(hashFile)) {\n const have = readFileSync(hashFile, \"utf8\").trim();\n if (have === wantHash) {\n return { changed: false, reason: \"up-to-date\" };\n }\n }\n\n const { previous, depsChanged } = writePackageJson(projectDir, plugins);\n\n const install = opts.runInstall ?? defaultInstall;\n const result = await install(pluginsDir(projectDir), { frozen: !depsChanged });\n if (!result.ok) {\n // A failed install must not leave the spec behind: the next reconcile\n // would compare against it and treat the store as already changed.\n if (previous === undefined) rmSync(pluginsPkgJson(projectDir), { force: true });\n else writeFileSync(pluginsPkgJson(projectDir), previous);\n throw new Error(`plugin install failed:\\n${result.output}`);\n }\n\n writeFileSync(hashFile, wantHash);\n return { changed: true, reason: \"reconciled\" };\n}\n\n/**\n * Put the store back to `previousPlugins` after `plugin install` failed past\n * the reconcile (the plugin installed but does not load). Best effort: a\n * failing reinstall is swallowed, the store is then rebuilt by the next\n * reconcile because the hash no longer matches the declared list.\n *\n * With no previous plugins every generated file of the store goes away\n * (`package.json`, hash, lock file and `node_modules`), so the store keeps\n * neither the rejected spec nor its installed package.\n */\nexport async function rollbackPluginStore(\n projectDir: string,\n previousPlugins: string[],\n opts: ReconcileOptions = {},\n): Promise<void> {\n if (previousPlugins.length === 0) {\n const dir = pluginsDir(projectDir);\n rmSync(pluginsPkgJson(projectDir), { force: true });\n rmSync(reconcileHashFile(projectDir), { force: true });\n rmSync(nodeModulesDir(projectDir), { recursive: true, force: true });\n for (const lock of [\"bun.lock\", \"bun.lockb\", \"package-lock.json\"]) {\n rmSync(join(dir, lock), { force: true });\n }\n return;\n }\n try {\n await reconcilePlugins(projectDir, previousPlugins, opts);\n } catch {\n // the next reconcile retries\n }\n}\n","/**\n * The project-local plugin store: reconcile (`<projectDir>/.skaile/plugins/`)\n * then load the reconciled plugins into the `pluginRegistry`.\n *\n * `ensurePluginsLoaded` is the single entrypoint commands wire in. It is a\n * guarded no-op when `plugins` is empty/undefined — zero overhead for the\n * common case where no project declares `plugins:` in `skaile.yaml`.\n */\n\nimport { type PluginRegistry, pluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport pc from \"picocolors\";\nimport { type LoadResult, loadPlugins } from \"./load.js\";\nimport { type ReconcileOptions, reconcilePlugins } from \"./reconcile.js\";\nimport { specName } from \"./spec.js\";\n\nexport type { LoadResult } from \"./load.js\";\nexport { loadPlugins } from \"./load.js\";\nexport type { ReconcileOptions } from \"./reconcile.js\";\nexport { reconcilePlugins, rollbackPluginStore } from \"./reconcile.js\";\nexport { npmSpecError, specName } from \"./spec.js\";\n\n/** Options for {@link ensurePluginsLoaded}. */\nexport interface EnsurePluginsOptions extends ReconcileOptions {\n log?: Logger;\n}\n\n/**\n * Reconcile the plugin store then load each plugin into `registry`.\n *\n * No-op (returns immediately) when `plugins` is empty/undefined, so the common\n * no-plugins path costs nothing.\n *\n * @param projectDir - Project root.\n * @param plugins - The `skaile.yaml` `plugins:` list (may be undefined).\n * @param registry - Registry to register into. Defaults to `pluginRegistry`.\n * @param opts - Injectable installer / lock slice + optional logger.\n * @returns The load result, or an empty result when there are no plugins.\n */\nexport async function ensurePluginsLoaded(\n projectDir: string,\n plugins: string[] | undefined,\n registry: PluginRegistry = pluginRegistry,\n opts: EnsurePluginsOptions = {},\n): Promise<LoadResult> {\n if (!plugins || plugins.length === 0) {\n return { loaded: [], failed: [] };\n }\n await reconcilePlugins(projectDir, plugins, opts);\n return loadPlugins(projectDir, plugins, registry, { log: opts.log });\n}\n\n/**\n * The installer's output of a failed `plugin install` is a dump (bun's banner, resolver\n * progress, then the `error:` lines). A load warning keeps the first line and the cause of it\n * (p1113); `skaile plugin install <spec>` prints the whole output.\n *\n * bun: the last `error:` line. npm: its `code` line and the first detail line after it\n * (`E404: 404 Not Found - GET …`), never the trailing `A complete log of this run can be found\n * in: …` pointer (p1272).\n */\nexport function condensePluginFailure(reason: string): string {\n const lines = reason\n .split(\"\\n\")\n .map((l) => l.trim())\n .filter((l) => l !== \"\");\n const [first, ...rest] = lines;\n if (!reason.startsWith(\"plugin install failed\") || first === undefined || rest.length === 0) {\n return reason;\n }\n const head = first.replace(/:$/, \"\");\n const npmPrefix = /^npm (ERR!|error)\\s*/i;\n const npmLines = rest\n .filter((l) => npmPrefix.test(l) && !/^npm \\S+\\s+A complete log of this run\\b/i.test(l))\n .map((l) => l.replace(npmPrefix, \"\"))\n .filter((l) => l !== \"\");\n const codeLine = npmLines.find((l) => /^code\\s+\\S+/i.test(l));\n if (codeLine) {\n const code = codeLine.replace(/^code\\s+/i, \"\");\n const detail = npmLines.find((l) => l !== codeLine && !/^code\\s/i.test(l));\n return `${head}: npm ${code}${detail ? `: ${detail}` : \"\"}`;\n }\n const causes = rest.filter(\n (l) => /^error\\b/i.test(l) || (npmPrefix.test(l) && !/A complete log of this run\\b/i.test(l)),\n );\n const cause =\n causes.at(-1) ?? rest.filter((l) => !/A complete log of this run\\b/i.test(l)).at(-1);\n return `${head}: ${cause ?? rest.at(-1)}`;\n}\n\nfunction escapeRegExp(s: string): string {\n return s.replace(/[.*+?^${}()|[\\]\\\\/]/g, \"\\\\$&\");\n}\n\n/**\n * Split the output of one failed install of the whole plugin store into one reason per plugin\n * (p1272): the package manager runs once for every spec, so its output names the plugins that\n * failed. A plugin gets the line that names it (also its URL-encoded form `@scope%2fname`); a\n * plugin the output never names says it was not installed and which plugin the install stopped\n * at. With one plugin, or when the output names none (no `bun` and no `npm`), every plugin keeps\n * the whole condensed reason.\n */\nexport function pluginFailureReasons(\n reason: string,\n specs: readonly string[],\n): Map<string, string> {\n const out = new Map<string, string>();\n const condensed = condensePluginFailure(reason);\n if (specs.length < 2 || !reason.startsWith(\"plugin install failed\")) return out;\n const lines = reason\n .split(\"\\n\")\n .map((l) => l.trim())\n .filter((l) => l !== \"\" && !/A complete log of this run\\b/i.test(l));\n const names = specs.map((spec) => {\n try {\n return specName(spec);\n } catch {\n return spec;\n }\n });\n const mentions = (text: string, name: string): boolean => {\n const forms = [name, name.replace(\"/\", \"%2f\"), name.replace(\"/\", \"%2F\")];\n return forms.some((f) =>\n new RegExp(`(?<![\\\\w@.-])(?<!@[\\\\w.~-]+/)${escapeRegExp(f)}(?![\\\\w-]|\\\\.\\\\w)`).test(text),\n );\n };\n const cause = /\\berror\\b|\\bE[A-Z0-9]{3,}\\b|\\b404\\b|notarget|failed to resolve/i;\n const named: string[] = [];\n specs.forEach((spec, i) => {\n const name = names[i] as string;\n const line = mentions(condensed, name)\n ? condensed.replace(/^plugin install failed:\\s*/, \"\")\n : lines.filter((l) => mentions(l, name) && cause.test(l)).at(-1);\n if (line === undefined) return;\n named.push(name);\n out.set(spec, `plugin install failed: ${line.replace(/^(npm\\s+)?(ERR!|error:?)\\s*/i, \"\")}`);\n });\n if (named.length === 0) return new Map();\n specs.forEach((spec, i) => {\n if (!out.has(spec)) {\n out.set(\n spec,\n `plugin install failed: ${names[i]} was not installed, the install stopped at ${named.join(\", \")}`,\n );\n }\n });\n return out;\n}\n\n/** One `! plugin <name> failed to load: <reason>` line on stderr (stdout carries a run's answer). */\nfunction warnPluginFailed(spec: string, reason: string): void {\n let name = spec;\n try {\n name = specName(spec);\n } catch {\n /* a spec that does not parse is named as written */\n }\n process.stderr.write(\n ` ${pc.yellow(\"!\")} plugin ${name} failed to load: ${condensePluginFailure(reason)}\\n`,\n );\n}\n\n/**\n * Reconcile + load the `plugins:` of the project's `skaile.yaml` into the process registry, so a\n * plugin's harness is known to `run`, `repl` and `config set harness`. A plugin that fails to\n * reconcile or load is skipped (its harness stays unknown, the command goes on) and named in one\n * `! plugin <name> failed to load: <reason>` line on stderr. An unreadable config is not this\n * function's to report: the command reads it again and says so.\n */\nexport async function loadDeclaredPlugins(projectDir: string): Promise<void> {\n let plugins: string[] | undefined;\n try {\n const { resolveSkWorkspaceConfig } = await import(\"@skaile/workspaces/core\");\n plugins = resolveSkWorkspaceConfig(projectDir).plugins;\n } catch {\n return;\n }\n if (!plugins || plugins.length === 0) return;\n try {\n const result = await ensurePluginsLoaded(projectDir, plugins, pluginRegistry);\n for (const f of result.failed) warnPluginFailed(f.spec, f.reason);\n } catch (err) {\n // The store could not be reconciled: no plugin was loaded.\n const reason = err instanceof Error ? err.message : String(err);\n const reasons = pluginFailureReasons(reason, plugins);\n for (const spec of plugins) warnPluginFailed(spec, reasons.get(spec) ?? reason);\n }\n}\n"]}