@skaile/workspaces 3.27.1 → 4.0.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 (344) hide show
  1. package/CHANGELOG.md +474 -0
  2. package/dist/app-sdk/index.js +1 -1
  3. package/dist/{asset-feeds-QF7LGRUX.js → asset-feeds-OPG6SUXU.js} +11 -9
  4. package/dist/asset-feeds-OPG6SUXU.js.map +1 -0
  5. package/dist/asset-manager/catalog-deployer.js +5 -3
  6. package/dist/asset-manager/index.js +11 -9
  7. package/dist/asset-manager/installer.js +8 -6
  8. package/dist/asset-manager/renderers.js +2 -2
  9. package/dist/asset-manager/src/renderers.d.ts.map +1 -1
  10. package/dist/bridge/drivers/claude-sdk.js +102 -55
  11. package/dist/bridge/drivers/claude-sdk.js.map +1 -1
  12. package/dist/bridge/drivers/codex.js +178 -22
  13. package/dist/bridge/drivers/codex.js.map +1 -1
  14. package/dist/bridge/drivers/continue.js +199 -7
  15. package/dist/bridge/drivers/continue.js.map +1 -1
  16. package/dist/bridge/drivers/echo.js +10 -4
  17. package/dist/bridge/drivers/echo.js.map +1 -1
  18. package/dist/bridge/drivers/gemini.js +7 -4
  19. package/dist/bridge/drivers/goose.js +160 -7
  20. package/dist/bridge/drivers/goose.js.map +1 -1
  21. package/dist/bridge/drivers/omp.js +321 -96
  22. package/dist/bridge/drivers/omp.js.map +1 -1
  23. package/dist/bridge/drivers/opencode.js +148 -13
  24. package/dist/bridge/drivers/opencode.js.map +1 -1
  25. package/dist/bridge/drivers/qwen.js +41 -11
  26. package/dist/bridge/drivers/qwen.js.map +1 -1
  27. package/dist/bridge/index.js +12 -9
  28. package/dist/bridge/src/cloud.d.ts +62 -71
  29. package/dist/bridge/src/cloud.d.ts.map +1 -1
  30. package/dist/bridge/src/codex/config-toml.d.ts +128 -0
  31. package/dist/bridge/src/codex/config-toml.d.ts.map +1 -0
  32. package/dist/bridge/src/codex/credentials.d.ts +26 -0
  33. package/dist/bridge/src/codex/credentials.d.ts.map +1 -1
  34. package/dist/bridge/src/codex/managed-driver.d.ts.map +1 -1
  35. package/dist/bridge/src/drivers/_subprocess-cli.d.ts +9 -4
  36. package/dist/bridge/src/drivers/_subprocess-cli.d.ts.map +1 -1
  37. package/dist/bridge/src/drivers/claude-sdk.d.ts +19 -11
  38. package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
  39. package/dist/bridge/src/drivers/codex.d.ts +26 -1
  40. package/dist/bridge/src/drivers/codex.d.ts.map +1 -1
  41. package/dist/bridge/src/drivers/continue.d.ts +31 -5
  42. package/dist/bridge/src/drivers/continue.d.ts.map +1 -1
  43. package/dist/bridge/src/drivers/echo.d.ts.map +1 -1
  44. package/dist/bridge/src/drivers/gemini.d.ts +34 -3
  45. package/dist/bridge/src/drivers/gemini.d.ts.map +1 -1
  46. package/dist/bridge/src/drivers/goose.d.ts +26 -2
  47. package/dist/bridge/src/drivers/goose.d.ts.map +1 -1
  48. package/dist/bridge/src/drivers/omp-models-yml.d.ts +216 -0
  49. package/dist/bridge/src/drivers/omp-models-yml.d.ts.map +1 -0
  50. package/dist/bridge/src/drivers/omp.d.ts +26 -23
  51. package/dist/bridge/src/drivers/omp.d.ts.map +1 -1
  52. package/dist/bridge/src/drivers/opencode.d.ts +28 -3
  53. package/dist/bridge/src/drivers/opencode.d.ts.map +1 -1
  54. package/dist/bridge/src/drivers/qwen.d.ts +10 -4
  55. package/dist/bridge/src/drivers/qwen.d.ts.map +1 -1
  56. package/dist/bridge/src/index.d.ts +3 -1
  57. package/dist/bridge/src/index.d.ts.map +1 -1
  58. package/dist/bridge/src/models.d.ts +118 -19
  59. package/dist/bridge/src/models.d.ts.map +1 -1
  60. package/dist/bridge/src/provider-catalog.d.ts +188 -0
  61. package/dist/bridge/src/provider-catalog.d.ts.map +1 -0
  62. package/dist/bridge/src/provider-materialize/continue-config-yaml.d.ts +117 -0
  63. package/dist/bridge/src/provider-materialize/continue-config-yaml.d.ts.map +1 -0
  64. package/dist/bridge/src/provider-materialize/credential-env.d.ts +103 -0
  65. package/dist/bridge/src/provider-materialize/credential-env.d.ts.map +1 -0
  66. package/dist/bridge/src/provider-materialize/env-drivers.d.ts +209 -0
  67. package/dist/bridge/src/provider-materialize/env-drivers.d.ts.map +1 -0
  68. package/dist/bridge/src/provider-materialize/goose-custom-providers.d.ts +127 -0
  69. package/dist/bridge/src/provider-materialize/goose-custom-providers.d.ts.map +1 -0
  70. package/dist/bridge/src/provider-materialize/opencode-config.d.ts +127 -0
  71. package/dist/bridge/src/provider-materialize/opencode-config.d.ts.map +1 -0
  72. package/dist/bridge/src/provider-materialize/session-config-home.d.ts +63 -0
  73. package/dist/bridge/src/provider-materialize/session-config-home.d.ts.map +1 -0
  74. package/dist/bridge/src/provider-registry-derive.d.ts +59 -0
  75. package/dist/bridge/src/provider-registry-derive.d.ts.map +1 -0
  76. package/dist/bridge/src/registry.d.ts +19 -7
  77. package/dist/bridge/src/registry.d.ts.map +1 -1
  78. package/dist/bridge/src/runtime.d.ts.map +1 -1
  79. package/dist/bridge/src/types.d.ts +79 -60
  80. package/dist/bridge/src/types.d.ts.map +1 -1
  81. package/dist/bridge/src/validation.d.ts +2 -3
  82. package/dist/bridge/src/validation.d.ts.map +1 -1
  83. package/dist/{chunk-GURXUF2J.js → chunk-3ZTQY276.js} +95 -80
  84. package/dist/chunk-3ZTQY276.js.map +1 -0
  85. package/dist/{chunk-T3YLZQS4.js → chunk-45LLHKQ2.js} +24 -3
  86. package/dist/chunk-45LLHKQ2.js.map +1 -0
  87. package/dist/{chunk-WJVBJAM5.js → chunk-5IIHO2HI.js} +7 -7
  88. package/dist/{chunk-WJVBJAM5.js.map → chunk-5IIHO2HI.js.map} +1 -1
  89. package/dist/{chunk-HSRHO7SK.js → chunk-C3QLJTMB.js} +106 -150
  90. package/dist/chunk-C3QLJTMB.js.map +1 -0
  91. package/dist/chunk-CUU3AMGE.js +500 -0
  92. package/dist/chunk-CUU3AMGE.js.map +1 -0
  93. package/dist/{chunk-K6VZQNTR.js → chunk-DKCFWSVW.js} +3 -3
  94. package/dist/{chunk-K6VZQNTR.js.map → chunk-DKCFWSVW.js.map} +1 -1
  95. package/dist/{chunk-WWGU3REE.js → chunk-DNGAA24M.js} +7 -7
  96. package/dist/{chunk-WWGU3REE.js.map → chunk-DNGAA24M.js.map} +1 -1
  97. package/dist/{chunk-TCHEW3T2.js → chunk-EBHY23RZ.js} +6 -6
  98. package/dist/{chunk-TCHEW3T2.js.map → chunk-EBHY23RZ.js.map} +1 -1
  99. package/dist/{chunk-MQASB52N.js → chunk-FEFTOV2Y.js} +3 -3
  100. package/dist/{chunk-MQASB52N.js.map → chunk-FEFTOV2Y.js.map} +1 -1
  101. package/dist/{chunk-XMULHVKX.js → chunk-FODAC4RE.js} +17 -15
  102. package/dist/chunk-FODAC4RE.js.map +1 -0
  103. package/dist/{chunk-6H6HLMWG.js → chunk-G2F3ZCPK.js} +3 -3
  104. package/dist/{chunk-6H6HLMWG.js.map → chunk-G2F3ZCPK.js.map} +1 -1
  105. package/dist/{chunk-QSPCI4W2.js → chunk-HO2FQ76C.js} +175 -178
  106. package/dist/chunk-HO2FQ76C.js.map +1 -0
  107. package/dist/chunk-ILG4BXYE.js +936 -0
  108. package/dist/chunk-ILG4BXYE.js.map +1 -0
  109. package/dist/{chunk-E7HKNQTH.js → chunk-JXCUUZA3.js} +3 -4
  110. package/dist/chunk-JXCUUZA3.js.map +1 -0
  111. package/dist/{chunk-MBARHWMZ.js → chunk-K27T47OO.js} +79 -53
  112. package/dist/chunk-K27T47OO.js.map +1 -0
  113. package/dist/chunk-K3YR33F6.js +187 -0
  114. package/dist/chunk-K3YR33F6.js.map +1 -0
  115. package/dist/{chunk-A3HTL7XV.js → chunk-KIQGTAJ5.js} +3 -3
  116. package/dist/{chunk-A3HTL7XV.js.map → chunk-KIQGTAJ5.js.map} +1 -1
  117. package/dist/chunk-KSIRR5PL.js +142 -0
  118. package/dist/chunk-KSIRR5PL.js.map +1 -0
  119. package/dist/{chunk-SIREWRZE.js → chunk-KW7YIRYL.js} +3 -3
  120. package/dist/{chunk-SIREWRZE.js.map → chunk-KW7YIRYL.js.map} +1 -1
  121. package/dist/{chunk-3U3ZKYR7.js → chunk-LN2BQVRB.js} +139 -29
  122. package/dist/chunk-LN2BQVRB.js.map +1 -0
  123. package/dist/{chunk-DZ4UZOFB.js → chunk-M5H4DWIA.js} +3 -3
  124. package/dist/{chunk-DZ4UZOFB.js.map → chunk-M5H4DWIA.js.map} +1 -1
  125. package/dist/{chunk-JMYOJ3PA.js → chunk-MIP4IC3O.js} +3 -3
  126. package/dist/{chunk-JMYOJ3PA.js.map → chunk-MIP4IC3O.js.map} +1 -1
  127. package/dist/{chunk-ZEXYTJ6Y.js → chunk-MJY2BO6N.js} +6 -6
  128. package/dist/{chunk-ZEXYTJ6Y.js.map → chunk-MJY2BO6N.js.map} +1 -1
  129. package/dist/{chunk-AN6NAFRT.js → chunk-N7B3LZ7V.js} +31 -6
  130. package/dist/chunk-N7B3LZ7V.js.map +1 -0
  131. package/dist/{chunk-MX6TGDZ7.js → chunk-NBPL76HH.js} +5 -5
  132. package/dist/{chunk-MX6TGDZ7.js.map → chunk-NBPL76HH.js.map} +1 -1
  133. package/dist/{chunk-2BK4N3FS.js → chunk-NR6BPOW5.js} +2 -7
  134. package/dist/chunk-NR6BPOW5.js.map +1 -0
  135. package/dist/{chunk-J3IXRPZB.js → chunk-PCJF3XBH.js} +10 -10
  136. package/dist/{chunk-J3IXRPZB.js.map → chunk-PCJF3XBH.js.map} +1 -1
  137. package/dist/{chunk-NW65H5EV.js → chunk-PTETBRRC.js} +3 -3
  138. package/dist/{chunk-NW65H5EV.js.map → chunk-PTETBRRC.js.map} +1 -1
  139. package/dist/{chunk-UL4LD7KD.js → chunk-QQL3ET3J.js} +3 -3
  140. package/dist/{chunk-UL4LD7KD.js.map → chunk-QQL3ET3J.js.map} +1 -1
  141. package/dist/{chunk-IB4XKQMQ.js → chunk-REILIKVM.js} +3 -3
  142. package/dist/{chunk-IB4XKQMQ.js.map → chunk-REILIKVM.js.map} +1 -1
  143. package/dist/{chunk-EB72L5ZL.js → chunk-RM4C5AU3.js} +15 -20
  144. package/dist/chunk-RM4C5AU3.js.map +1 -0
  145. package/dist/chunk-SG4D2UOK.js +843 -0
  146. package/dist/chunk-SG4D2UOK.js.map +1 -0
  147. package/dist/{chunk-VN7DELUT.js → chunk-T7RHDVSY.js} +4 -4
  148. package/dist/{chunk-VN7DELUT.js.map → chunk-T7RHDVSY.js.map} +1 -1
  149. package/dist/{chunk-773WLEXL.js → chunk-UKWEJPZZ.js} +3 -3
  150. package/dist/{chunk-773WLEXL.js.map → chunk-UKWEJPZZ.js.map} +1 -1
  151. package/dist/{chunk-3NCGSSCU.js → chunk-WLFRA5RM.js} +47 -45
  152. package/dist/chunk-WLFRA5RM.js.map +1 -0
  153. package/dist/{chunk-FFE7YLYO.js → chunk-XEVWRSLS.js} +7 -7
  154. package/dist/chunk-XEVWRSLS.js.map +1 -0
  155. package/dist/{chunk-FACPWN6P.js → chunk-Y6E62LFB.js} +9 -12
  156. package/dist/chunk-Y6E62LFB.js.map +1 -0
  157. package/dist/{chunk-72DG6GSB.js → chunk-YS4XBN7O.js} +4 -4
  158. package/dist/{chunk-72DG6GSB.js.map → chunk-YS4XBN7O.js.map} +1 -1
  159. package/dist/chunk-YSJKLJD4.js +32 -0
  160. package/dist/chunk-YSJKLJD4.js.map +1 -0
  161. package/dist/cli/index.js +765 -334
  162. package/dist/cli/index.js.map +1 -1
  163. package/dist/cli/src/commands/config.d.ts +17 -6
  164. package/dist/cli/src/commands/config.d.ts.map +1 -1
  165. package/dist/cli/src/commands/migrate-legacy-entry.d.ts +46 -0
  166. package/dist/cli/src/commands/migrate-legacy-entry.d.ts.map +1 -0
  167. package/dist/cli/src/commands/migrate-providers.d.ts +93 -0
  168. package/dist/cli/src/commands/migrate-providers.d.ts.map +1 -0
  169. package/dist/cli/src/commands/providers.d.ts +89 -0
  170. package/dist/cli/src/commands/providers.d.ts.map +1 -0
  171. package/dist/cli/src/commands/run.d.ts +1 -1
  172. package/dist/cli/src/commands/run.d.ts.map +1 -1
  173. package/dist/cli/src/setup.d.ts +46 -6
  174. package/dist/cli/src/setup.d.ts.map +1 -1
  175. package/dist/connectors/config.js +6 -4
  176. package/dist/connectors/index.js +15 -12
  177. package/dist/core/index.js +5 -3
  178. package/dist/core/provider-registry-credentials.d.ts +2 -0
  179. package/dist/core/provider-registry-credentials.js +5 -0
  180. package/dist/core/provider-registry-credentials.js.map +1 -0
  181. package/dist/core/provider-registry.d.ts +2 -0
  182. package/dist/core/provider-registry.js +4 -0
  183. package/dist/core/provider-registry.js.map +1 -0
  184. package/dist/core/runtime-assets.js +2 -2
  185. package/dist/core/src/index.d.ts +10 -4
  186. package/dist/core/src/index.d.ts.map +1 -1
  187. package/dist/core/src/provider-registry-credentials.d.ts +50 -0
  188. package/dist/core/src/provider-registry-credentials.d.ts.map +1 -0
  189. package/dist/core/src/provider-registry-files.d.ts +97 -0
  190. package/dist/core/src/provider-registry-files.d.ts.map +1 -0
  191. package/dist/core/src/provider-registry.d.ts +450 -0
  192. package/dist/core/src/provider-registry.d.ts.map +1 -0
  193. package/dist/core/src/settings.d.ts +18 -78
  194. package/dist/core/src/settings.d.ts.map +1 -1
  195. package/dist/core/src/workspace-config.d.ts +31 -47
  196. package/dist/core/src/workspace-config.d.ts.map +1 -1
  197. package/dist/core/src/workspace-yaml-editor.d.ts.map +1 -1
  198. package/dist/core/workspace-config.js +1 -1
  199. package/dist/deploy/index.js +5 -3
  200. package/dist/deploy/index.js.map +1 -1
  201. package/dist/discovery/index.js +2 -2
  202. package/dist/{ensure-sources-GEJGBQIP.js → ensure-sources-QZAQ4SY2.js} +14 -12
  203. package/dist/ensure-sources-QZAQ4SY2.js.map +1 -0
  204. package/dist/factory-assets/connectors/box.js +15 -12
  205. package/dist/factory-assets/connectors/deploy.js +15 -12
  206. package/dist/factory-assets/connectors/devserver.js +15 -12
  207. package/dist/factory-assets/connectors/flow/adapter.js +15 -12
  208. package/dist/factory-assets/connectors/flow/engine.js +6 -4
  209. package/dist/factory-assets/connectors/flow/index.d.ts +1 -1
  210. package/dist/factory-assets/connectors/flow/index.d.ts.map +1 -1
  211. package/dist/factory-assets/connectors/flow/run-flow.d.ts +0 -3
  212. package/dist/factory-assets/connectors/flow/run-flow.d.ts.map +1 -1
  213. package/dist/factory-assets/connectors/flow/run-flow.js +16 -13
  214. package/dist/factory-assets/connectors/flow/subprompt-runner.d.ts +31 -28
  215. package/dist/factory-assets/connectors/flow/subprompt-runner.d.ts.map +1 -1
  216. package/dist/factory-assets/connectors/flow.js +15 -12
  217. package/dist/factory-assets/connectors/git.js +15 -12
  218. package/dist/factory-assets/connectors/gmail.js +15 -12
  219. package/dist/factory-assets/connectors/googledrive.js +15 -12
  220. package/dist/factory-assets/connectors/local.js +15 -12
  221. package/dist/factory-assets/connectors/mattermost.js +15 -12
  222. package/dist/factory-assets/connectors/memory.js +15 -12
  223. package/dist/factory-assets/connectors/minio.js +15 -12
  224. package/dist/factory-assets/connectors/postgres.js +15 -12
  225. package/dist/factory-assets/connectors/s3.js +15 -12
  226. package/dist/factory-assets/connectors/sharepoint.js +15 -12
  227. package/dist/factory-assets/connectors/sqlite.js +15 -12
  228. package/dist/factory-assets/connectors/static-server.js +15 -12
  229. package/dist/factory-assets/connectors/tunnel.js +15 -12
  230. package/dist/factory-assets/connectors/webdav.js +15 -12
  231. package/dist/factory-assets/connectors/xstate-store.js +15 -12
  232. package/dist/factory-assets/connectors/xstate.js +15 -12
  233. package/dist/{flows-MI2VM5JZ.js → flows-4EIENFNT.js} +9 -7
  234. package/dist/{flows-MI2VM5JZ.js.map → flows-4EIENFNT.js.map} +1 -1
  235. package/dist/{helpers-DXZOHX25.js → helpers-DISRVGRJ.js} +14 -12
  236. package/dist/{helpers-DXZOHX25.js.map → helpers-DISRVGRJ.js.map} +1 -1
  237. package/dist/library/index.js +8 -6
  238. package/dist/library/install.js +5 -3
  239. package/dist/{library-publish-CUPDG5NI.js → library-publish-I2QYQSB4.js} +18 -16
  240. package/dist/library-publish-I2QYQSB4.js.map +1 -0
  241. package/dist/{open-library-32XAI2LH.js → open-library-6LM4W4DR.js} +16 -14
  242. package/dist/{open-library-32XAI2LH.js.map → open-library-6LM4W4DR.js.map} +1 -1
  243. package/dist/paths-P26QGQP5.js +18 -0
  244. package/dist/{paths-CZEH643M.js.map → paths-P26QGQP5.js.map} +1 -1
  245. package/dist/plugin-registry/src/targets.d.ts +16 -2
  246. package/dist/plugin-registry/src/targets.d.ts.map +1 -1
  247. package/dist/{plugin-store-QJNBPIQK.js → plugin-store-T2DJGKBW.js} +7 -5
  248. package/dist/plugin-store-T2DJGKBW.js.map +1 -0
  249. package/dist/{project-RRHUCVXW.js → project-HP3IR7RW.js} +15 -13
  250. package/dist/{project-RRHUCVXW.js.map → project-HP3IR7RW.js.map} +1 -1
  251. package/dist/resolver/index.js +5 -3
  252. package/dist/runner/index.js +25 -22
  253. package/dist/runner/src/agent.d.ts +0 -2
  254. package/dist/runner/src/agent.d.ts.map +1 -1
  255. package/dist/runner/src/codex-init.d.ts.map +1 -1
  256. package/dist/runner/src/codex-resource-tools.d.ts.map +1 -1
  257. package/dist/runner/src/managed-codex-bootstrap.d.ts.map +1 -1
  258. package/dist/runner/src/resources.d.ts +1 -2
  259. package/dist/runner/src/resources.d.ts.map +1 -1
  260. package/dist/runner/src/serve.d.ts.map +1 -1
  261. package/dist/runner/src/session-builder.d.ts +31 -35
  262. package/dist/runner/src/session-builder.d.ts.map +1 -1
  263. package/dist/runner/src/session.d.ts +0 -2
  264. package/dist/runner/src/session.d.ts.map +1 -1
  265. package/dist/sdk/asset-manager.js +11 -9
  266. package/dist/sdk/bridge.js +12 -9
  267. package/dist/sdk/core.js +5 -3
  268. package/dist/sdk/flow.js +6 -4
  269. package/dist/sdk/index.js +25 -22
  270. package/dist/sdk/index.js.map +1 -1
  271. package/dist/sdk/resolver.js +5 -3
  272. package/dist/sdk/runner.js +25 -22
  273. package/dist/sdk/session.js +2 -2
  274. package/dist/sdk/types.js +1 -1
  275. package/dist/session/index.js +2 -2
  276. package/dist/setup-HLRSU3MR.js +435 -0
  277. package/dist/setup-HLRSU3MR.js.map +1 -0
  278. package/dist/{skills-IE3IWWB7.js → skills-QPYHHZ54.js} +7 -5
  279. package/dist/{skills-IE3IWWB7.js.map → skills-QPYHHZ54.js.map} +1 -1
  280. package/dist/{source-RHQLCTWA.js → source-G2VCWPDU.js} +17 -15
  281. package/dist/{source-RHQLCTWA.js.map → source-G2VCWPDU.js.map} +1 -1
  282. package/dist/{source-manifest-publish-DXMCSKU7.js → source-manifest-publish-WYKCKJFC.js} +19 -17
  283. package/dist/source-manifest-publish-WYKCKJFC.js.map +1 -0
  284. package/dist/tui/index.js +25 -23
  285. package/dist/tui/index.js.map +1 -1
  286. package/dist/tui/src/repl.d.ts +0 -2
  287. package/dist/tui/src/repl.d.ts.map +1 -1
  288. package/dist/types/index.js +1 -1
  289. package/dist/types/manifests.js +1 -1
  290. package/dist/types/src/index.d.ts +1 -1
  291. package/dist/types/src/index.d.ts.map +1 -1
  292. package/dist/types/src/lifecycle.d.ts +35 -10
  293. package/dist/types/src/lifecycle.d.ts.map +1 -1
  294. package/dist/types/src/manifests/agent.d.ts +116 -22
  295. package/dist/types/src/manifests/agent.d.ts.map +1 -1
  296. package/dist/types/src/manifests/index.d.ts +2 -2
  297. package/dist/types/src/manifests/index.d.ts.map +1 -1
  298. package/dist/types/src/manifests/preset.d.ts +5 -5
  299. package/dist/types/src/runtime.d.ts +51 -5
  300. package/dist/types/src/runtime.d.ts.map +1 -1
  301. package/dist/types/src/version.d.ts +18 -2
  302. package/dist/types/src/version.d.ts.map +1 -1
  303. package/dist/validator-P5ESKTW5.js +5 -0
  304. package/dist/{validator-RN64BKFW.js.map → validator-P5ESKTW5.js.map} +1 -1
  305. package/dist/workspace-plugin/adapters/mcp.js +11 -9
  306. package/dist/workspace-plugin/adapters/omp.js +11 -11
  307. package/dist/workspace-plugin/adapters/omp.js.map +1 -1
  308. package/dist/workspace-plugin/index.js +1 -1
  309. package/dist/workspace-plugin/src/plugin.d.ts +1 -4
  310. package/dist/workspace-plugin/src/plugin.d.ts.map +1 -1
  311. package/dist/workspace-plugin/src/tools/validator.d.ts +4 -4
  312. package/dist/workspace-plugin/src/tools/validator.d.ts.map +1 -1
  313. package/package.json +13 -1
  314. package/dist/asset-feeds-QF7LGRUX.js.map +0 -1
  315. package/dist/bridge/src/provider-endpoints.d.ts +0 -55
  316. package/dist/bridge/src/provider-endpoints.d.ts.map +0 -1
  317. package/dist/chunk-2BK4N3FS.js.map +0 -1
  318. package/dist/chunk-3NCGSSCU.js.map +0 -1
  319. package/dist/chunk-3U3ZKYR7.js.map +0 -1
  320. package/dist/chunk-AN6NAFRT.js.map +0 -1
  321. package/dist/chunk-AQW4BWNR.js +0 -324
  322. package/dist/chunk-AQW4BWNR.js.map +0 -1
  323. package/dist/chunk-E7HKNQTH.js.map +0 -1
  324. package/dist/chunk-EB72L5ZL.js.map +0 -1
  325. package/dist/chunk-FACPWN6P.js.map +0 -1
  326. package/dist/chunk-FFE7YLYO.js.map +0 -1
  327. package/dist/chunk-FYIHH56K.js +0 -110
  328. package/dist/chunk-FYIHH56K.js.map +0 -1
  329. package/dist/chunk-GURXUF2J.js.map +0 -1
  330. package/dist/chunk-HSRHO7SK.js.map +0 -1
  331. package/dist/chunk-MBARHWMZ.js.map +0 -1
  332. package/dist/chunk-QSPCI4W2.js.map +0 -1
  333. package/dist/chunk-T3YLZQS4.js.map +0 -1
  334. package/dist/chunk-XMULHVKX.js.map +0 -1
  335. package/dist/ensure-sources-GEJGBQIP.js.map +0 -1
  336. package/dist/library-publish-CUPDG5NI.js.map +0 -1
  337. package/dist/paths-CZEH643M.js +0 -16
  338. package/dist/plugin-store-QJNBPIQK.js.map +0 -1
  339. package/dist/runner/src/cloud-bundle.d.ts +0 -36
  340. package/dist/runner/src/cloud-bundle.d.ts.map +0 -1
  341. package/dist/setup-CIRH5BYB.js +0 -517
  342. package/dist/setup-CIRH5BYB.js.map +0 -1
  343. package/dist/source-manifest-publish-DXMCSKU7.js.map +0 -1
  344. package/dist/validator-RN64BKFW.js +0 -5
@@ -0,0 +1,936 @@
1
+ // core/src/provider-registry.ts
2
+ var AI_PROVIDER_KINDS = ["llm", "stt", "tts", "embed"];
3
+ var AI_PROVIDER_VOICE_KINDS = ["stt", "tts"];
4
+ var AI_PROVIDER_SURFACES = [
5
+ "anthropic-messages",
6
+ "openai-completions",
7
+ "openai-responses",
8
+ "openai-codex-responses",
9
+ "azure-openai-responses",
10
+ "bedrock-converse-stream",
11
+ "google-generative-ai",
12
+ "google-vertex"
13
+ ];
14
+ var AI_PROVIDER_TRANSPORTS = [
15
+ "direct",
16
+ "bedrock",
17
+ "vertex",
18
+ "foundry",
19
+ "azure-openai"
20
+ ];
21
+ var AI_PROVIDER_CREDENTIAL_KINDS = [
22
+ "api_key_header",
23
+ "bearer",
24
+ "sigv4",
25
+ "google_adc",
26
+ "azure_entra",
27
+ "oauth",
28
+ "none",
29
+ "command"
30
+ ];
31
+ var CREDENTIAL_REF_REQUIRED = {
32
+ api_key_header: true,
33
+ bearer: true,
34
+ oauth: true,
35
+ command: true
36
+ };
37
+ var AI_PROVIDER_DISCOVERY_TYPES = [
38
+ "openai-models-list",
39
+ "anthropic-models-list",
40
+ "google-models-list",
41
+ "none"
42
+ ];
43
+ var AI_PROVIDER_LAYERS = ["catalog", "user", "workspace", "runtime", "session"];
44
+ var SAFE_ID = /^[a-z0-9][a-z0-9_-]*$/;
45
+ var ENV_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
46
+ var CREDENTIAL_REF = /^(env|cmd|platform|keyring):([\s\S]+)$/;
47
+ var SECRET_KEY = /(^|[-_])(api[-_]?key|apikey|authorization|auth|token|secret|password|passwd|credential|credentials|cookie)([-_]|$)|^key$/i;
48
+ var SECRET_VALUE_PATTERNS = [
49
+ /^sk-/i,
50
+ /^xai-/i,
51
+ /^gsk_/,
52
+ /^(ghp|gho|ghu|ghs)_/,
53
+ /^github_pat_/,
54
+ /^xox[baprs]-/,
55
+ /^AIza[0-9A-Za-z_-]{10,}/,
56
+ /^(Bearer|Token|Basic)\s+\S{8,}$/i,
57
+ // Long opaque blob: no spaces, no dots, no scheme punctuation.
58
+ /^[A-Za-z0-9+/_-]{40,}={0,2}$/
59
+ ];
60
+ var INTERPOLATION = /\$\{[^}]+\}/;
61
+ var LLM_KEYS = {
62
+ kind: true,
63
+ label: true,
64
+ preset: true,
65
+ surface: true,
66
+ transport: true,
67
+ base_url: true,
68
+ params: true,
69
+ headers: true,
70
+ query_params: true,
71
+ credential: true,
72
+ model_map: true,
73
+ capabilities: true,
74
+ discovery: true,
75
+ enabled: true,
76
+ locked: true
77
+ };
78
+ var VOICE_KEYS = {
79
+ kind: true,
80
+ label: true,
81
+ preset: true,
82
+ base_url: true,
83
+ params: true,
84
+ headers: true,
85
+ credential: true,
86
+ enabled: true,
87
+ locked: true
88
+ };
89
+ var ENTRY_KEYS = { ...LLM_KEYS, ...VOICE_KEYS };
90
+ var LLM_ONLY_KEYS = ["surface", "transport", "model_map", "capabilities", "discovery"];
91
+ var CAPABILITY_KEYS = {
92
+ context_window: true,
93
+ tools: true,
94
+ images: true,
95
+ thinking_max: true
96
+ };
97
+ var TRANSPORT_PARAMS = {
98
+ bedrock: { required: ["region"], optional: [] },
99
+ vertex: { required: ["project", "location"], optional: ["publisher"] },
100
+ foundry: { required: ["resource"], optional: [] },
101
+ "azure-openai": { required: ["resource", "deployment", "api_version"], optional: [] }
102
+ };
103
+ var AI_PROVIDER_BASE_URL_TEMPLATES = {
104
+ bedrock: "https://bedrock-runtime.{region}.amazonaws.com",
105
+ vertex: "https://{location}-aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/publishers/{publisher}",
106
+ foundry: "https://{resource}.services.ai.azure.com/anthropic",
107
+ "azure-openai": "https://{resource}.openai.azure.com/openai"
108
+ };
109
+ function isPlainObject(value) {
110
+ return typeof value === "object" && value !== null && !Array.isArray(value);
111
+ }
112
+ function isSafeProviderId(id) {
113
+ return SAFE_ID.test(id);
114
+ }
115
+ function looksLikeLiteralSecret(key, value) {
116
+ const trimmed = value.trim();
117
+ if (trimmed === "") return false;
118
+ if (INTERPOLATION.test(trimmed)) return false;
119
+ if (CREDENTIAL_REF.test(trimmed)) return false;
120
+ if (SECRET_KEY.test(key)) return true;
121
+ return SECRET_VALUE_PATTERNS.some((re) => re.test(trimmed));
122
+ }
123
+ function err(ctx, code, path, message) {
124
+ ctx.diagnostics.push({ code, severity: "error", message, path });
125
+ }
126
+ function warn(ctx, code, path, message) {
127
+ ctx.diagnostics.push({ code, severity: "warning", message, path });
128
+ }
129
+ function readStringMap(ctx, raw, path, opts) {
130
+ if (!isPlainObject(raw)) {
131
+ err(ctx, "invalid_type", path, `${path} must be a map of string values`);
132
+ return void 0;
133
+ }
134
+ const out = {};
135
+ let ok = true;
136
+ for (const [key, value] of Object.entries(raw)) {
137
+ const keyPath = `${path}.${key}`;
138
+ if (typeof value !== "string") {
139
+ err(ctx, "invalid_type", keyPath, `${keyPath} must be a string`);
140
+ ok = false;
141
+ continue;
142
+ }
143
+ if (opts.secretScan && looksLikeLiteralSecret(key, value)) {
144
+ err(
145
+ ctx,
146
+ "literal_secret",
147
+ keyPath,
148
+ `${keyPath} holds a literal secret \u2014 use a reference instead (env:NAME, cmd:<shell>, platform:<configId>, keyring:<service>/<account>) or a \${...} interpolation`
149
+ );
150
+ ok = false;
151
+ continue;
152
+ }
153
+ out[key] = value;
154
+ }
155
+ return ok ? out : void 0;
156
+ }
157
+ function readCredential(ctx, raw, path) {
158
+ if (!isPlainObject(raw)) {
159
+ err(ctx, "invalid_type", path, `${path} must be a map with a 'kind'`);
160
+ return { ok: false };
161
+ }
162
+ let ok = true;
163
+ for (const key of Object.keys(raw)) {
164
+ if (key !== "kind" && key !== "ref") {
165
+ err(ctx, "unknown_key", `${path}.${key}`, `${path}.${key} is not a credential key`);
166
+ ok = false;
167
+ }
168
+ }
169
+ const kind = raw.kind;
170
+ if (typeof kind !== "string" || !AI_PROVIDER_CREDENTIAL_KINDS.includes(kind)) {
171
+ err(
172
+ ctx,
173
+ "unknown_credential_kind",
174
+ `${path}.kind`,
175
+ `${path}.kind must be one of ${AI_PROVIDER_CREDENTIAL_KINDS.join(", ")}`
176
+ );
177
+ return { ok: false };
178
+ }
179
+ const credentialKind = kind;
180
+ const rawRef = raw.ref;
181
+ let ref;
182
+ if (rawRef !== void 0) {
183
+ if (typeof rawRef !== "string") {
184
+ err(ctx, "invalid_type", `${path}.ref`, `${path}.ref must be a string`);
185
+ ok = false;
186
+ } else if (!parseCredentialRef(rawRef)) {
187
+ err(
188
+ ctx,
189
+ "literal_secret",
190
+ `${path}.ref`,
191
+ `${path}.ref must be a reference, not a literal secret \u2014 use env:NAME, cmd:<shell>, platform:<configId> or keyring:<service>/<account>`
192
+ );
193
+ ok = false;
194
+ } else {
195
+ ref = rawRef;
196
+ }
197
+ } else if (CREDENTIAL_REF_REQUIRED[credentialKind]) {
198
+ err(
199
+ ctx,
200
+ "missing_credential_ref",
201
+ `${path}.ref`,
202
+ `${path}.ref is required for credential kind '${credentialKind}'`
203
+ );
204
+ ok = false;
205
+ }
206
+ if (!ok) return { ok: false };
207
+ return {
208
+ ok: true,
209
+ value: ref === void 0 ? { kind: credentialKind } : { kind: credentialKind, ref }
210
+ };
211
+ }
212
+ function readTransportSlice(ctx, transport, params, path, present) {
213
+ if (transport === void 0 && present.has("transport")) return { slice: {}, ok: false };
214
+ const explicit = transport !== void 0;
215
+ const effective = transport ?? "direct";
216
+ const rejectedParams = params === void 0 && present.has("params");
217
+ if (effective === "direct") {
218
+ let ok2 = true;
219
+ for (const key of Object.keys(params ?? {})) {
220
+ err(
221
+ ctx,
222
+ "unknown_param",
223
+ `${path}.params.${key}`,
224
+ `${path}.params.${key} is not valid for transport 'direct' \u2014 it takes no parameters`
225
+ );
226
+ ok2 = false;
227
+ }
228
+ return { slice: explicit ? { transport: "direct" } : {}, ok: ok2 };
229
+ }
230
+ const spec = TRANSPORT_PARAMS[effective];
231
+ if (params === void 0) {
232
+ if (!rejectedParams) {
233
+ err(
234
+ ctx,
235
+ "missing_params",
236
+ `${path}.params`,
237
+ `${path}.params is required for transport '${effective}' (${spec.required.join(", ")})`
238
+ );
239
+ }
240
+ return { slice: {}, ok: false };
241
+ }
242
+ let ok = true;
243
+ const values = {};
244
+ for (const [key, value] of Object.entries(params)) {
245
+ if (!spec.required.includes(key) && !spec.optional.includes(key)) {
246
+ err(
247
+ ctx,
248
+ "unknown_param",
249
+ `${path}.params.${key}`,
250
+ `${path}.params.${key} is not valid for transport '${effective}' (accepted: ${[...spec.required, ...spec.optional].join(", ")})`
251
+ );
252
+ ok = false;
253
+ continue;
254
+ }
255
+ if (typeof value !== "string") {
256
+ err(ctx, "invalid_type", `${path}.params.${key}`, `${path}.params.${key} must be a string`);
257
+ ok = false;
258
+ continue;
259
+ }
260
+ values[key] = value;
261
+ }
262
+ for (const key of spec.required) {
263
+ if (values[key] === void 0) {
264
+ err(
265
+ ctx,
266
+ "missing_param",
267
+ `${path}.params.${key}`,
268
+ `${path}.params.${key} is required for transport '${effective}'`
269
+ );
270
+ ok = false;
271
+ }
272
+ }
273
+ if (!ok) return { slice: {}, ok: false };
274
+ switch (effective) {
275
+ case "bedrock":
276
+ return { slice: { transport: effective, params: { region: values.region } }, ok: true };
277
+ case "vertex":
278
+ return {
279
+ slice: {
280
+ transport: effective,
281
+ params: {
282
+ project: values.project,
283
+ location: values.location,
284
+ ...values.publisher === void 0 ? {} : { publisher: values.publisher }
285
+ }
286
+ },
287
+ ok: true
288
+ };
289
+ case "foundry":
290
+ return { slice: { transport: effective, params: { resource: values.resource } }, ok: true };
291
+ case "azure-openai":
292
+ return {
293
+ slice: {
294
+ transport: effective,
295
+ params: {
296
+ resource: values.resource,
297
+ deployment: values.deployment,
298
+ api_version: values.api_version
299
+ }
300
+ },
301
+ ok: true
302
+ };
303
+ }
304
+ }
305
+ function readParams(ctx, raw, path) {
306
+ if (!isPlainObject(raw)) {
307
+ err(ctx, "invalid_type", path, `${path} must be a map`);
308
+ return { ok: false };
309
+ }
310
+ const out = {};
311
+ let ok = true;
312
+ for (const [key, value] of Object.entries(raw)) {
313
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
314
+ err(
315
+ ctx,
316
+ "invalid_type",
317
+ `${path}.${key}`,
318
+ `${path}.${key} must be a string, number or boolean`
319
+ );
320
+ ok = false;
321
+ continue;
322
+ }
323
+ if (typeof value === "string" && looksLikeLiteralSecret(key, value)) {
324
+ err(
325
+ ctx,
326
+ "literal_secret",
327
+ `${path}.${key}`,
328
+ `${path}.${key} holds a literal secret \u2014 put it in credential.ref as a reference`
329
+ );
330
+ ok = false;
331
+ continue;
332
+ }
333
+ out[key] = value;
334
+ }
335
+ return ok ? { ok: true, value: out } : { ok: false };
336
+ }
337
+ function readBaseUrl(ctx, raw, path) {
338
+ if (typeof raw !== "string") {
339
+ err(ctx, "invalid_type", path, `${path} must be a string`);
340
+ return { ok: false };
341
+ }
342
+ let parsed;
343
+ try {
344
+ parsed = new URL(raw);
345
+ } catch {
346
+ err(ctx, "invalid_base_url", path, `${path} is not a valid URL: ${raw}`);
347
+ return { ok: false };
348
+ }
349
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
350
+ err(
351
+ ctx,
352
+ "invalid_base_url",
353
+ path,
354
+ `${path} must use http:// or https:// (got ${parsed.protocol}//)`
355
+ );
356
+ return { ok: false };
357
+ }
358
+ if (parsed.username || parsed.password) {
359
+ err(
360
+ ctx,
361
+ "literal_secret",
362
+ path,
363
+ `${path} embeds credentials in the URL \u2014 move them to credential.ref as a reference`
364
+ );
365
+ return { ok: false };
366
+ }
367
+ return { ok: true, value: raw };
368
+ }
369
+ function readBoolean(ctx, raw, path) {
370
+ if (typeof raw !== "boolean") {
371
+ err(ctx, "invalid_type", path, `${path} must be true or false`);
372
+ return { ok: false };
373
+ }
374
+ return { ok: true, value: raw };
375
+ }
376
+ function readEntry(ctx, raw, path) {
377
+ if (!isPlainObject(raw)) {
378
+ err(ctx, "invalid_type", path, `${path} must be a map`);
379
+ return void 0;
380
+ }
381
+ const present = new Set(Object.keys(raw));
382
+ const entry = {};
383
+ let ok = true;
384
+ if (raw.kind !== void 0) {
385
+ if (typeof raw.kind !== "string" || !AI_PROVIDER_KINDS.includes(raw.kind)) {
386
+ err(
387
+ ctx,
388
+ "unknown_kind",
389
+ `${path}.kind`,
390
+ `${path}.kind must be one of ${AI_PROVIDER_KINDS.join(", ")}`
391
+ );
392
+ ok = false;
393
+ } else {
394
+ entry.kind = raw.kind;
395
+ }
396
+ }
397
+ for (const key of present) {
398
+ if (!ENTRY_KEYS[key]) {
399
+ err(ctx, "unknown_key", `${path}.${key}`, `${path}.${key} is not a registry key`);
400
+ ok = false;
401
+ }
402
+ }
403
+ if (raw.label !== void 0) {
404
+ if (typeof raw.label !== "string") {
405
+ err(ctx, "invalid_type", `${path}.label`, `${path}.label must be a string`);
406
+ ok = false;
407
+ } else {
408
+ entry.label = raw.label;
409
+ }
410
+ }
411
+ if (raw.preset !== void 0) {
412
+ if (typeof raw.preset !== "string" || !isSafeProviderId(raw.preset)) {
413
+ err(
414
+ ctx,
415
+ "invalid_preset",
416
+ `${path}.preset`,
417
+ `${path}.preset must be a catalog preset id matching [a-z0-9][a-z0-9_-]*`
418
+ );
419
+ ok = false;
420
+ } else {
421
+ entry.preset = raw.preset;
422
+ }
423
+ }
424
+ if (raw.base_url !== void 0) {
425
+ const res = readBaseUrl(ctx, raw.base_url, `${path}.base_url`);
426
+ if (!res.ok) ok = false;
427
+ else entry.base_url = res.value;
428
+ }
429
+ if (raw.headers !== void 0) {
430
+ const headers = readStringMap(ctx, raw.headers, `${path}.headers`, { secretScan: true });
431
+ if (!headers) ok = false;
432
+ else entry.headers = headers;
433
+ }
434
+ if (raw.credential !== void 0) {
435
+ const res = readCredential(ctx, raw.credential, `${path}.credential`);
436
+ if (!res.ok) ok = false;
437
+ else entry.credential = res.value;
438
+ }
439
+ if (raw.enabled !== void 0) {
440
+ const res = readBoolean(ctx, raw.enabled, `${path}.enabled`);
441
+ if (!res.ok) ok = false;
442
+ else entry.enabled = res.value;
443
+ }
444
+ if (raw.locked !== void 0) {
445
+ const res = readBoolean(ctx, raw.locked, `${path}.locked`);
446
+ if (!res.ok) ok = false;
447
+ else entry.locked = res.value;
448
+ }
449
+ if (raw.surface !== void 0) {
450
+ if (typeof raw.surface !== "string" || !AI_PROVIDER_SURFACES.includes(raw.surface)) {
451
+ err(
452
+ ctx,
453
+ "unknown_surface",
454
+ `${path}.surface`,
455
+ `${path}.surface must be one of ${AI_PROVIDER_SURFACES.join(", ")}`
456
+ );
457
+ ok = false;
458
+ } else {
459
+ entry.surface = raw.surface;
460
+ }
461
+ }
462
+ if (raw.transport !== void 0) {
463
+ if (typeof raw.transport !== "string" || !AI_PROVIDER_TRANSPORTS.includes(raw.transport)) {
464
+ err(
465
+ ctx,
466
+ "unknown_transport",
467
+ `${path}.transport`,
468
+ `${path}.transport must be one of ${AI_PROVIDER_TRANSPORTS.join(", ")}`
469
+ );
470
+ ok = false;
471
+ } else {
472
+ entry.transport = raw.transport;
473
+ }
474
+ }
475
+ if (raw.params !== void 0) {
476
+ const res = readParams(ctx, raw.params, `${path}.params`);
477
+ if (!res.ok) ok = false;
478
+ else entry.params = res.value;
479
+ }
480
+ if (raw.query_params !== void 0) {
481
+ const qp = readStringMap(ctx, raw.query_params, `${path}.query_params`, { secretScan: true });
482
+ if (!qp) ok = false;
483
+ else entry.query_params = qp;
484
+ }
485
+ if (raw.model_map !== void 0) {
486
+ const map = readStringMap(ctx, raw.model_map, `${path}.model_map`, { secretScan: false });
487
+ if (!map) ok = false;
488
+ else entry.model_map = map;
489
+ }
490
+ if (raw.capabilities !== void 0) {
491
+ if (!isPlainObject(raw.capabilities)) {
492
+ err(ctx, "invalid_type", `${path}.capabilities`, `${path}.capabilities must be a map`);
493
+ ok = false;
494
+ } else {
495
+ const caps = {};
496
+ for (const [modelId, value] of Object.entries(raw.capabilities)) {
497
+ const capPath = `${path}.capabilities.${modelId}`;
498
+ if (!isPlainObject(value)) {
499
+ err(ctx, "invalid_type", capPath, `${capPath} must be a map`);
500
+ ok = false;
501
+ continue;
502
+ }
503
+ const cap = {};
504
+ for (const [capKey, capValue] of Object.entries(value)) {
505
+ if (!CAPABILITY_KEYS[capKey]) {
506
+ err(
507
+ ctx,
508
+ "unknown_key",
509
+ `${capPath}.${capKey}`,
510
+ `${capPath}.${capKey} is not a capability (${Object.keys(CAPABILITY_KEYS).join(", ")})`
511
+ );
512
+ ok = false;
513
+ continue;
514
+ }
515
+ const expected = capKey === "tools" || capKey === "images" ? "boolean" : "number";
516
+ if (typeof capValue !== expected) {
517
+ err(
518
+ ctx,
519
+ "invalid_type",
520
+ `${capPath}.${capKey}`,
521
+ `${capPath}.${capKey} must be a ${expected}`
522
+ );
523
+ ok = false;
524
+ continue;
525
+ }
526
+ cap[capKey] = capValue;
527
+ }
528
+ caps[modelId] = cap;
529
+ }
530
+ entry.capabilities = caps;
531
+ }
532
+ }
533
+ if (raw.discovery !== void 0) {
534
+ if (!isPlainObject(raw.discovery)) {
535
+ err(ctx, "invalid_type", `${path}.discovery`, `${path}.discovery must be a map`);
536
+ ok = false;
537
+ } else {
538
+ const type = raw.discovery.type;
539
+ if (typeof type !== "string") {
540
+ err(
541
+ ctx,
542
+ "invalid_type",
543
+ `${path}.discovery.type`,
544
+ `${path}.discovery.type must be a string`
545
+ );
546
+ ok = false;
547
+ } else {
548
+ if (!AI_PROVIDER_DISCOVERY_TYPES.includes(type)) {
549
+ warn(
550
+ ctx,
551
+ "unknown_discovery_type",
552
+ `${path}.discovery.type`,
553
+ `${path}.discovery.type '${type}' is not a known probe (${AI_PROVIDER_DISCOVERY_TYPES.join(", ")}) \u2014 it is kept verbatim`
554
+ );
555
+ }
556
+ const discovery = { type };
557
+ const discPath = raw.discovery.path;
558
+ if (discPath !== void 0) {
559
+ if (typeof discPath !== "string") {
560
+ err(
561
+ ctx,
562
+ "invalid_type",
563
+ `${path}.discovery.path`,
564
+ `${path}.discovery.path must be a string`
565
+ );
566
+ ok = false;
567
+ } else {
568
+ discovery.path = discPath;
569
+ }
570
+ }
571
+ for (const key of Object.keys(raw.discovery)) {
572
+ if (key !== "type" && key !== "path") {
573
+ err(
574
+ ctx,
575
+ "unknown_key",
576
+ `${path}.discovery.${key}`,
577
+ `${path}.discovery.${key} is not a discovery key`
578
+ );
579
+ ok = false;
580
+ }
581
+ }
582
+ entry.discovery = discovery;
583
+ }
584
+ }
585
+ }
586
+ return ok ? { entry, present } : void 0;
587
+ }
588
+ function entryCommon(patch) {
589
+ const common = {};
590
+ if (patch.label !== void 0) common.label = patch.label;
591
+ if (patch.preset !== void 0) common.preset = patch.preset;
592
+ if (patch.base_url !== void 0) common.base_url = patch.base_url;
593
+ if (patch.headers !== void 0) common.headers = patch.headers;
594
+ if (patch.credential !== void 0) common.credential = patch.credential;
595
+ if (patch.enabled !== void 0) common.enabled = patch.enabled;
596
+ if (patch.locked !== void 0) common.locked = patch.locked;
597
+ return common;
598
+ }
599
+ function checkEntry(ctx, patch, path, present) {
600
+ const kind = patch.kind;
601
+ if (kind === void 0) {
602
+ if (!present.has("kind")) {
603
+ err(
604
+ ctx,
605
+ "missing_kind",
606
+ `${path}.kind`,
607
+ `${path}.kind is required and no layer supplies it \u2014 an entry needs one of ${AI_PROVIDER_KINDS.join(", ")}`
608
+ );
609
+ }
610
+ return void 0;
611
+ }
612
+ let ok = true;
613
+ const common = entryCommon(patch);
614
+ if (patch.base_url !== void 0 && !readBaseUrl(ctx, patch.base_url, `${path}.base_url`).ok) {
615
+ ok = false;
616
+ }
617
+ if (patch.headers !== void 0 && readStringMap(ctx, patch.headers, `${path}.headers`, { secretScan: true }) === void 0) {
618
+ ok = false;
619
+ }
620
+ if (patch.query_params !== void 0 && readStringMap(ctx, patch.query_params, `${path}.query_params`, { secretScan: true }) === void 0) {
621
+ ok = false;
622
+ }
623
+ if (patch.credential !== void 0 && !readCredential(ctx, patch.credential, `${path}.credential`).ok) {
624
+ ok = false;
625
+ }
626
+ let params;
627
+ if (patch.params !== void 0) {
628
+ const res = readParams(ctx, patch.params, `${path}.params`);
629
+ if (!res.ok) ok = false;
630
+ else params = res.value;
631
+ }
632
+ if (kind === "stt" || kind === "tts") {
633
+ for (const key of LLM_ONLY_KEYS) {
634
+ if (!present.has(key)) continue;
635
+ err(
636
+ ctx,
637
+ "llm_only_key",
638
+ `${path}.${key}`,
639
+ `${path}.${key} is llm-only and not accepted on kind '${kind}' (voice entries take kind, label, preset, base_url, headers, credential, params, enabled)`
640
+ );
641
+ ok = false;
642
+ }
643
+ for (const key of present) {
644
+ if (VOICE_KEYS[key] || LLM_ONLY_KEYS.includes(key)) continue;
645
+ err(ctx, "unknown_key", `${path}.${key}`, `${path}.${key} is not a registry key`);
646
+ ok = false;
647
+ }
648
+ const voice = { kind, ...common };
649
+ if (params !== void 0) voice.params = params;
650
+ return ok ? voice : void 0;
651
+ }
652
+ const llm = { kind, ...common };
653
+ if (patch.surface !== void 0) {
654
+ llm.surface = patch.surface;
655
+ } else if (!present.has("surface") && patch.preset === void 0) {
656
+ err(
657
+ ctx,
658
+ "missing_surface",
659
+ `${path}.surface`,
660
+ `${path}.surface is required unless the entry inherits one from a preset`
661
+ );
662
+ ok = false;
663
+ }
664
+ const transportResult = readTransportSlice(ctx, patch.transport, params, path, present);
665
+ if (!transportResult.ok) ok = false;
666
+ else Object.assign(llm, transportResult.slice);
667
+ if (patch.query_params !== void 0) llm.query_params = patch.query_params;
668
+ if (patch.model_map !== void 0) llm.model_map = patch.model_map;
669
+ if (patch.capabilities !== void 0) llm.capabilities = patch.capabilities;
670
+ if (patch.discovery !== void 0) llm.discovery = patch.discovery;
671
+ return ok ? llm : void 0;
672
+ }
673
+ function validateRegistry(raw, options = {}) {
674
+ const ctx = { diagnostics: [] };
675
+ const document = { version: 1, providers: {} };
676
+ const prefix = options.source ? `${options.source}: ` : "";
677
+ const partial = options.layer !== void 0 && options.layer !== "catalog";
678
+ if (raw === void 0 || raw === null) return { document, diagnostics: ctx.diagnostics };
679
+ if (!isPlainObject(raw)) {
680
+ err(ctx, "invalid_type", "", `${prefix}registry document must be a map`);
681
+ return { document, diagnostics: ctx.diagnostics };
682
+ }
683
+ if (raw.version !== void 0 && raw.version !== 1) {
684
+ err(ctx, "unsupported_version", "version", `version must be 1 (got ${String(raw.version)})`);
685
+ return { document, diagnostics: ctx.diagnostics };
686
+ }
687
+ for (const key of Object.keys(raw)) {
688
+ if (key === "version" || key === "providers") continue;
689
+ if (key === "roles") {
690
+ warn(
691
+ ctx,
692
+ "roles_not_here",
693
+ "roles",
694
+ "roles are read from skaile.yaml, not from providers.yml \u2014 this block is ignored"
695
+ );
696
+ continue;
697
+ }
698
+ warn(ctx, "unknown_key", key, `${key} is not a registry document key \u2014 ignored`);
699
+ }
700
+ if (raw.providers === void 0) return { document, diagnostics: ctx.diagnostics };
701
+ if (!isPlainObject(raw.providers)) {
702
+ err(ctx, "invalid_type", "providers", "providers must be a map of entry id \u2192 entry");
703
+ return { document, diagnostics: ctx.diagnostics };
704
+ }
705
+ for (const [id, rawEntry] of Object.entries(raw.providers)) {
706
+ const path = `providers.${id}`;
707
+ if (!isSafeProviderId(id)) {
708
+ err(
709
+ ctx,
710
+ "invalid_id",
711
+ path,
712
+ `'${id}' is not a valid entry id \u2014 use lowercase letters, digits, '-' and '_' starting with a letter or digit`
713
+ );
714
+ continue;
715
+ }
716
+ const read = readEntry(ctx, rawEntry, path);
717
+ if (!read) continue;
718
+ if (partial) {
719
+ document.providers[id] = read.entry;
720
+ continue;
721
+ }
722
+ const entry = checkEntry(ctx, read.entry, path, read.present);
723
+ if (entry) document.providers[id] = entry;
724
+ }
725
+ if (options.source) {
726
+ for (const diagnostic of ctx.diagnostics) {
727
+ diagnostic.message = `${prefix}${diagnostic.message}`;
728
+ }
729
+ }
730
+ return { document, diagnostics: ctx.diagnostics };
731
+ }
732
+ function isEntryEnabled(entry) {
733
+ return entry.enabled !== false;
734
+ }
735
+ function entryTransport(entry) {
736
+ if (entry.kind !== "llm" && entry.kind !== "embed") return void 0;
737
+ return entry.transport ?? "direct";
738
+ }
739
+ function resolveEntryBaseUrl(entry) {
740
+ if (entry.base_url) return entry.base_url;
741
+ const transport = entryTransport(entry);
742
+ if (!transport || transport === "direct") return void 0;
743
+ const template = AI_PROVIDER_BASE_URL_TEMPLATES[transport];
744
+ const params = entry.params;
745
+ if (!params) return void 0;
746
+ const filled = { ...params };
747
+ if (transport === "vertex") filled.publisher ??= "google";
748
+ let out = template;
749
+ for (const [key, value] of Object.entries(filled)) {
750
+ out = out.replaceAll(`{${key}}`, value);
751
+ }
752
+ return /\{[a-z_]+\}/.test(out) ? void 0 : out;
753
+ }
754
+ var LAYER_RANK = {
755
+ catalog: 0,
756
+ user: 1,
757
+ workspace: 2,
758
+ runtime: 3,
759
+ session: 4
760
+ };
761
+ function deepMerge(high, low) {
762
+ if (high === void 0) return low;
763
+ if (low === void 0) return high;
764
+ if (!isPlainObject(high) || !isPlainObject(low)) return high;
765
+ const out = { ...low };
766
+ for (const [key, value] of Object.entries(high)) {
767
+ out[key] = deepMerge(value, low[key]);
768
+ }
769
+ return out;
770
+ }
771
+ function mergeRegistries(layers) {
772
+ const ordered = layers.map((layer, index) => ({ layer, index })).sort((a, b) => {
773
+ const rank = LAYER_RANK[b.layer.layer] - LAYER_RANK[a.layer.layer];
774
+ return rank !== 0 ? rank : a.index - b.index;
775
+ }).map((x) => x.layer);
776
+ const providers = {};
777
+ const origin = {};
778
+ const order = [];
779
+ const frozen = /* @__PURE__ */ new Set();
780
+ for (const { layer, providers: entries } of ordered) {
781
+ for (const [id, entry] of Object.entries(entries)) {
782
+ if (frozen.has(id)) continue;
783
+ if (providers[id] === void 0) {
784
+ providers[id] = { ...entry };
785
+ origin[id] = layer;
786
+ order.push(id);
787
+ } else {
788
+ providers[id] = deepMerge(providers[id], entry);
789
+ }
790
+ if (entry.locked) frozen.add(id);
791
+ }
792
+ }
793
+ return {
794
+ version: 1,
795
+ // The fold cannot narrow a patch into an entry; `validateMergedRegistry`
796
+ // is what turns this view into one every consumer can read as complete.
797
+ providers,
798
+ order,
799
+ origin,
800
+ locked: [...frozen]
801
+ };
802
+ }
803
+ function validateMergedRegistry(merged, options = {}) {
804
+ const ctx = { diagnostics: [] };
805
+ const providers = {};
806
+ const origin = {};
807
+ const order = [];
808
+ for (const id of merged.order) {
809
+ const patch = merged.providers[id];
810
+ if (patch === void 0) continue;
811
+ const present = new Set(
812
+ Object.entries(patch).filter(([, value]) => value !== void 0).map(([key]) => key)
813
+ );
814
+ const from = ctx.diagnostics.length;
815
+ const entry = checkEntry(ctx, patch, `providers.${id}`, present);
816
+ const contributors = (options.sources ?? []).filter((source) => source.providers[id] !== void 0).map((source) => source.label);
817
+ if (contributors.length > 0) {
818
+ const where = ` (contributed by ${contributors.join(", ")})`;
819
+ for (const diagnostic of ctx.diagnostics.slice(from)) diagnostic.message += where;
820
+ }
821
+ if (entry === void 0) continue;
822
+ providers[id] = entry;
823
+ origin[id] = merged.origin[id];
824
+ order.push(id);
825
+ }
826
+ return {
827
+ registry: {
828
+ version: 1,
829
+ providers,
830
+ order,
831
+ origin,
832
+ locked: merged.locked.filter((id) => providers[id] !== void 0)
833
+ },
834
+ diagnostics: ctx.diagnostics
835
+ };
836
+ }
837
+ function registryEntries(registry) {
838
+ if (isMergedRegistry(registry)) {
839
+ return registry.order.map((id) => [id, registry.providers[id]]);
840
+ }
841
+ return Object.entries(registry);
842
+ }
843
+ function isMergedRegistry(registry) {
844
+ return Array.isArray(registry.order);
845
+ }
846
+ function parseCredentialRef(ref) {
847
+ const match = CREDENTIAL_REF.exec(ref.trim());
848
+ if (!match) return void 0;
849
+ const [, form, rest] = match;
850
+ const body = rest.trim();
851
+ if (body === "") return void 0;
852
+ switch (form) {
853
+ case "env":
854
+ return ENV_NAME.test(body) ? { form: "env", name: body } : void 0;
855
+ case "cmd":
856
+ return { form: "cmd", command: body };
857
+ case "platform":
858
+ return { form: "platform", configId: body };
859
+ case "keyring": {
860
+ const slash = body.indexOf("/");
861
+ if (slash <= 0 || slash === body.length - 1) return void 0;
862
+ return { form: "keyring", service: body.slice(0, slash), account: body.slice(slash + 1) };
863
+ }
864
+ default:
865
+ return void 0;
866
+ }
867
+ }
868
+ function formatCredentialRef(ref) {
869
+ switch (ref.form) {
870
+ case "env":
871
+ return `env:${ref.name}`;
872
+ case "cmd":
873
+ return `cmd:${ref.command}`;
874
+ case "platform":
875
+ return `platform:${ref.configId}`;
876
+ case "keyring":
877
+ return `keyring:${ref.service}/${ref.account}`;
878
+ }
879
+ }
880
+ function selectableEntries(registry) {
881
+ return registryEntries(registry).filter(
882
+ (pair) => (pair[1].kind === "llm" || pair[1].kind === "embed") && isEntryEnabled(pair[1])
883
+ );
884
+ }
885
+ function resolveAgainstEntry(providerId, entry, modelId, extra) {
886
+ return {
887
+ providerId,
888
+ modelId,
889
+ providerModelId: modelId === void 0 ? void 0 : entry.model_map?.[modelId] ?? modelId,
890
+ role: extra.role,
891
+ warnings: extra.warnings
892
+ };
893
+ }
894
+ function parseModelRef(ref, registry, roles) {
895
+ const entries = selectableEntries(registry);
896
+ if (entries.length === 0) return void 0;
897
+ const warnings = [];
898
+ let selector = ref.trim();
899
+ let role;
900
+ if (selector.startsWith("@")) {
901
+ role = selector.slice(1);
902
+ const target = roles?.[role];
903
+ if (!target) {
904
+ warnings.push(`role '@${role}' is not defined in roles \u2014 falling back to registry order`);
905
+ const [providerId2, entry2] = entries[0];
906
+ return resolveAgainstEntry(providerId2, entry2, void 0, { role, warnings });
907
+ }
908
+ selector = target.trim();
909
+ if (selector.startsWith("@")) {
910
+ warnings.push(`role '@${role}' points at another role ('${selector}') \u2014 roles do not chain`);
911
+ const [providerId2, entry2] = entries[0];
912
+ return resolveAgainstEntry(providerId2, entry2, void 0, { role, warnings });
913
+ }
914
+ }
915
+ const slash = selector.indexOf("/");
916
+ if (slash > 0) {
917
+ const head = selector.slice(0, slash);
918
+ const tail = selector.slice(slash + 1);
919
+ const match = entries.find(([id]) => id === head);
920
+ if (match && tail !== "") {
921
+ return resolveAgainstEntry(match[0], match[1], tail, { role, warnings });
922
+ }
923
+ if (!match && registryEntries(registry).some(([id]) => id === head)) {
924
+ warnings.push(`provider '${head}' is disabled or not an llm entry \u2014 falling back`);
925
+ }
926
+ }
927
+ const mapped = entries.find(
928
+ ([, entry2]) => entry2.model_map?.[selector] !== void 0 || entry2.capabilities?.[selector]
929
+ );
930
+ const [providerId, entry] = mapped ?? entries[0];
931
+ return resolveAgainstEntry(providerId, entry, selector, { role, warnings });
932
+ }
933
+
934
+ export { AI_PROVIDER_BASE_URL_TEMPLATES, AI_PROVIDER_CREDENTIAL_KINDS, AI_PROVIDER_DISCOVERY_TYPES, AI_PROVIDER_KINDS, AI_PROVIDER_LAYERS, AI_PROVIDER_SURFACES, AI_PROVIDER_TRANSPORTS, AI_PROVIDER_VOICE_KINDS, entryTransport, formatCredentialRef, isEntryEnabled, isSafeProviderId, looksLikeLiteralSecret, mergeRegistries, parseCredentialRef, parseModelRef, registryEntries, resolveEntryBaseUrl, validateMergedRegistry, validateRegistry };
935
+ //# sourceMappingURL=chunk-ILG4BXYE.js.map
936
+ //# sourceMappingURL=chunk-ILG4BXYE.js.map