@skaile/workspaces 3.27.0 → 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.
- package/CHANGELOG.md +480 -0
- package/dist/app-sdk/index.js +1 -1
- package/dist/{asset-feeds-AJOUKX55.js → asset-feeds-OPG6SUXU.js} +11 -9
- package/dist/asset-feeds-OPG6SUXU.js.map +1 -0
- package/dist/asset-manager/catalog-deployer.js +5 -3
- package/dist/asset-manager/index.js +11 -9
- package/dist/asset-manager/installer.js +8 -6
- package/dist/asset-manager/renderers.js +2 -2
- package/dist/asset-manager/src/renderers.d.ts.map +1 -1
- package/dist/bridge/drivers/claude-sdk.js +102 -55
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +178 -22
- package/dist/bridge/drivers/codex.js.map +1 -1
- package/dist/bridge/drivers/continue.js +199 -7
- package/dist/bridge/drivers/continue.js.map +1 -1
- package/dist/bridge/drivers/echo.js +10 -4
- package/dist/bridge/drivers/echo.js.map +1 -1
- package/dist/bridge/drivers/gemini.js +7 -4
- package/dist/bridge/drivers/goose.js +160 -7
- package/dist/bridge/drivers/goose.js.map +1 -1
- package/dist/bridge/drivers/omp.js +321 -96
- package/dist/bridge/drivers/omp.js.map +1 -1
- package/dist/bridge/drivers/opencode.js +148 -13
- package/dist/bridge/drivers/opencode.js.map +1 -1
- package/dist/bridge/drivers/qwen.js +41 -11
- package/dist/bridge/drivers/qwen.js.map +1 -1
- package/dist/bridge/index.js +12 -9
- package/dist/bridge/src/cloud.d.ts +62 -71
- package/dist/bridge/src/cloud.d.ts.map +1 -1
- package/dist/bridge/src/codex/config-toml.d.ts +128 -0
- package/dist/bridge/src/codex/config-toml.d.ts.map +1 -0
- package/dist/bridge/src/codex/credentials.d.ts +26 -0
- package/dist/bridge/src/codex/credentials.d.ts.map +1 -1
- package/dist/bridge/src/codex/managed-driver.d.ts.map +1 -1
- package/dist/bridge/src/drivers/_subprocess-cli.d.ts +9 -4
- package/dist/bridge/src/drivers/_subprocess-cli.d.ts.map +1 -1
- package/dist/bridge/src/drivers/claude-sdk.d.ts +19 -11
- package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
- package/dist/bridge/src/drivers/codex.d.ts +26 -1
- package/dist/bridge/src/drivers/codex.d.ts.map +1 -1
- package/dist/bridge/src/drivers/continue.d.ts +31 -5
- package/dist/bridge/src/drivers/continue.d.ts.map +1 -1
- package/dist/bridge/src/drivers/echo.d.ts.map +1 -1
- package/dist/bridge/src/drivers/gemini.d.ts +34 -3
- package/dist/bridge/src/drivers/gemini.d.ts.map +1 -1
- package/dist/bridge/src/drivers/goose.d.ts +26 -2
- package/dist/bridge/src/drivers/goose.d.ts.map +1 -1
- package/dist/bridge/src/drivers/omp-models-yml.d.ts +216 -0
- package/dist/bridge/src/drivers/omp-models-yml.d.ts.map +1 -0
- package/dist/bridge/src/drivers/omp.d.ts +26 -23
- package/dist/bridge/src/drivers/omp.d.ts.map +1 -1
- package/dist/bridge/src/drivers/opencode.d.ts +28 -3
- package/dist/bridge/src/drivers/opencode.d.ts.map +1 -1
- package/dist/bridge/src/drivers/qwen.d.ts +10 -4
- package/dist/bridge/src/drivers/qwen.d.ts.map +1 -1
- package/dist/bridge/src/index.d.ts +3 -1
- package/dist/bridge/src/index.d.ts.map +1 -1
- package/dist/bridge/src/models.d.ts +118 -19
- package/dist/bridge/src/models.d.ts.map +1 -1
- package/dist/bridge/src/provider-catalog.d.ts +188 -0
- package/dist/bridge/src/provider-catalog.d.ts.map +1 -0
- package/dist/bridge/src/provider-materialize/continue-config-yaml.d.ts +117 -0
- package/dist/bridge/src/provider-materialize/continue-config-yaml.d.ts.map +1 -0
- package/dist/bridge/src/provider-materialize/credential-env.d.ts +103 -0
- package/dist/bridge/src/provider-materialize/credential-env.d.ts.map +1 -0
- package/dist/bridge/src/provider-materialize/env-drivers.d.ts +209 -0
- package/dist/bridge/src/provider-materialize/env-drivers.d.ts.map +1 -0
- package/dist/bridge/src/provider-materialize/goose-custom-providers.d.ts +127 -0
- package/dist/bridge/src/provider-materialize/goose-custom-providers.d.ts.map +1 -0
- package/dist/bridge/src/provider-materialize/opencode-config.d.ts +127 -0
- package/dist/bridge/src/provider-materialize/opencode-config.d.ts.map +1 -0
- package/dist/bridge/src/provider-materialize/session-config-home.d.ts +63 -0
- package/dist/bridge/src/provider-materialize/session-config-home.d.ts.map +1 -0
- package/dist/bridge/src/provider-registry-derive.d.ts +59 -0
- package/dist/bridge/src/provider-registry-derive.d.ts.map +1 -0
- package/dist/bridge/src/registry.d.ts +19 -7
- package/dist/bridge/src/registry.d.ts.map +1 -1
- package/dist/bridge/src/runtime.d.ts.map +1 -1
- package/dist/bridge/src/types.d.ts +79 -60
- package/dist/bridge/src/types.d.ts.map +1 -1
- package/dist/bridge/src/validation.d.ts +2 -3
- package/dist/bridge/src/validation.d.ts.map +1 -1
- package/dist/{chunk-GURXUF2J.js → chunk-3ZTQY276.js} +95 -80
- package/dist/chunk-3ZTQY276.js.map +1 -0
- package/dist/{chunk-T3YLZQS4.js → chunk-45LLHKQ2.js} +24 -3
- package/dist/chunk-45LLHKQ2.js.map +1 -0
- package/dist/{chunk-UAEGKCE5.js → chunk-5IIHO2HI.js} +7 -7
- package/dist/{chunk-UAEGKCE5.js.map → chunk-5IIHO2HI.js.map} +1 -1
- package/dist/{chunk-HSRHO7SK.js → chunk-C3QLJTMB.js} +106 -150
- package/dist/chunk-C3QLJTMB.js.map +1 -0
- package/dist/chunk-CUU3AMGE.js +500 -0
- package/dist/chunk-CUU3AMGE.js.map +1 -0
- package/dist/{chunk-K6VZQNTR.js → chunk-DKCFWSVW.js} +3 -3
- package/dist/{chunk-K6VZQNTR.js.map → chunk-DKCFWSVW.js.map} +1 -1
- package/dist/{chunk-AEN2UFDN.js → chunk-DNGAA24M.js} +7 -7
- package/dist/{chunk-AEN2UFDN.js.map → chunk-DNGAA24M.js.map} +1 -1
- package/dist/{chunk-TCHEW3T2.js → chunk-EBHY23RZ.js} +6 -6
- package/dist/{chunk-TCHEW3T2.js.map → chunk-EBHY23RZ.js.map} +1 -1
- package/dist/{chunk-MQASB52N.js → chunk-FEFTOV2Y.js} +3 -3
- package/dist/{chunk-MQASB52N.js.map → chunk-FEFTOV2Y.js.map} +1 -1
- package/dist/{chunk-XMULHVKX.js → chunk-FODAC4RE.js} +17 -15
- package/dist/chunk-FODAC4RE.js.map +1 -0
- package/dist/{chunk-6H6HLMWG.js → chunk-G2F3ZCPK.js} +3 -3
- package/dist/{chunk-6H6HLMWG.js.map → chunk-G2F3ZCPK.js.map} +1 -1
- package/dist/{chunk-YLL65VXQ.js → chunk-HO2FQ76C.js} +175 -178
- package/dist/chunk-HO2FQ76C.js.map +1 -0
- package/dist/chunk-ILG4BXYE.js +936 -0
- package/dist/chunk-ILG4BXYE.js.map +1 -0
- package/dist/{chunk-E7HKNQTH.js → chunk-JXCUUZA3.js} +3 -4
- package/dist/chunk-JXCUUZA3.js.map +1 -0
- package/dist/{chunk-MBARHWMZ.js → chunk-K27T47OO.js} +79 -53
- package/dist/chunk-K27T47OO.js.map +1 -0
- package/dist/chunk-K3YR33F6.js +187 -0
- package/dist/chunk-K3YR33F6.js.map +1 -0
- package/dist/{chunk-7P6ASOFL.js → chunk-KIQGTAJ5.js} +3 -3
- package/dist/{chunk-7P6ASOFL.js.map → chunk-KIQGTAJ5.js.map} +1 -1
- package/dist/chunk-KSIRR5PL.js +142 -0
- package/dist/chunk-KSIRR5PL.js.map +1 -0
- package/dist/{chunk-SIREWRZE.js → chunk-KW7YIRYL.js} +3 -3
- package/dist/{chunk-SIREWRZE.js.map → chunk-KW7YIRYL.js.map} +1 -1
- package/dist/{chunk-3U3ZKYR7.js → chunk-LN2BQVRB.js} +139 -29
- package/dist/chunk-LN2BQVRB.js.map +1 -0
- package/dist/{chunk-DZ4UZOFB.js → chunk-M5H4DWIA.js} +3 -3
- package/dist/{chunk-DZ4UZOFB.js.map → chunk-M5H4DWIA.js.map} +1 -1
- package/dist/{chunk-JMYOJ3PA.js → chunk-MIP4IC3O.js} +3 -3
- package/dist/{chunk-JMYOJ3PA.js.map → chunk-MIP4IC3O.js.map} +1 -1
- package/dist/{chunk-O5JUZIVR.js → chunk-MJY2BO6N.js} +6 -6
- package/dist/{chunk-O5JUZIVR.js.map → chunk-MJY2BO6N.js.map} +1 -1
- package/dist/{chunk-AN6NAFRT.js → chunk-N7B3LZ7V.js} +31 -6
- package/dist/chunk-N7B3LZ7V.js.map +1 -0
- package/dist/{chunk-MX6TGDZ7.js → chunk-NBPL76HH.js} +5 -5
- package/dist/{chunk-MX6TGDZ7.js.map → chunk-NBPL76HH.js.map} +1 -1
- package/dist/{chunk-DY5GHUTC.js → chunk-NR6BPOW5.js} +2 -7
- package/dist/chunk-NR6BPOW5.js.map +1 -0
- package/dist/{chunk-F2GEM5B3.js → chunk-PCJF3XBH.js} +10 -10
- package/dist/{chunk-F2GEM5B3.js.map → chunk-PCJF3XBH.js.map} +1 -1
- package/dist/{chunk-NW65H5EV.js → chunk-PTETBRRC.js} +3 -3
- package/dist/{chunk-NW65H5EV.js.map → chunk-PTETBRRC.js.map} +1 -1
- package/dist/{chunk-UL4LD7KD.js → chunk-QQL3ET3J.js} +3 -3
- package/dist/{chunk-UL4LD7KD.js.map → chunk-QQL3ET3J.js.map} +1 -1
- package/dist/{chunk-IB4XKQMQ.js → chunk-REILIKVM.js} +3 -3
- package/dist/{chunk-IB4XKQMQ.js.map → chunk-REILIKVM.js.map} +1 -1
- package/dist/{chunk-N27DSFA7.js → chunk-RM4C5AU3.js} +27 -21
- package/dist/chunk-RM4C5AU3.js.map +1 -0
- package/dist/chunk-SG4D2UOK.js +843 -0
- package/dist/chunk-SG4D2UOK.js.map +1 -0
- package/dist/{chunk-AU4TUVHW.js → chunk-T7RHDVSY.js} +4 -4
- package/dist/{chunk-AU4TUVHW.js.map → chunk-T7RHDVSY.js.map} +1 -1
- package/dist/{chunk-773WLEXL.js → chunk-UKWEJPZZ.js} +3 -3
- package/dist/{chunk-773WLEXL.js.map → chunk-UKWEJPZZ.js.map} +1 -1
- package/dist/{chunk-3NCGSSCU.js → chunk-WLFRA5RM.js} +47 -45
- package/dist/chunk-WLFRA5RM.js.map +1 -0
- package/dist/{chunk-FFE7YLYO.js → chunk-XEVWRSLS.js} +7 -7
- package/dist/chunk-XEVWRSLS.js.map +1 -0
- package/dist/{chunk-5UWAOYDN.js → chunk-Y6E62LFB.js} +9 -12
- package/dist/chunk-Y6E62LFB.js.map +1 -0
- package/dist/{chunk-72DG6GSB.js → chunk-YS4XBN7O.js} +4 -4
- package/dist/{chunk-72DG6GSB.js.map → chunk-YS4XBN7O.js.map} +1 -1
- package/dist/chunk-YSJKLJD4.js +32 -0
- package/dist/chunk-YSJKLJD4.js.map +1 -0
- package/dist/cli/index.js +765 -334
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/config.d.ts +17 -6
- package/dist/cli/src/commands/config.d.ts.map +1 -1
- package/dist/cli/src/commands/migrate-legacy-entry.d.ts +46 -0
- package/dist/cli/src/commands/migrate-legacy-entry.d.ts.map +1 -0
- package/dist/cli/src/commands/migrate-providers.d.ts +93 -0
- package/dist/cli/src/commands/migrate-providers.d.ts.map +1 -0
- package/dist/cli/src/commands/providers.d.ts +89 -0
- package/dist/cli/src/commands/providers.d.ts.map +1 -0
- package/dist/cli/src/commands/run.d.ts +1 -1
- package/dist/cli/src/commands/run.d.ts.map +1 -1
- package/dist/cli/src/setup.d.ts +46 -6
- package/dist/cli/src/setup.d.ts.map +1 -1
- package/dist/connectors/config.js +6 -4
- package/dist/connectors/index.js +15 -12
- package/dist/core/index.js +5 -3
- package/dist/core/provider-registry-credentials.d.ts +2 -0
- package/dist/core/provider-registry-credentials.js +5 -0
- package/dist/core/provider-registry-credentials.js.map +1 -0
- package/dist/core/provider-registry.d.ts +2 -0
- package/dist/core/provider-registry.js +4 -0
- package/dist/core/provider-registry.js.map +1 -0
- package/dist/core/runtime-assets.js +2 -2
- package/dist/core/src/index.d.ts +10 -4
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/provider-registry-credentials.d.ts +50 -0
- package/dist/core/src/provider-registry-credentials.d.ts.map +1 -0
- package/dist/core/src/provider-registry-files.d.ts +97 -0
- package/dist/core/src/provider-registry-files.d.ts.map +1 -0
- package/dist/core/src/provider-registry.d.ts +450 -0
- package/dist/core/src/provider-registry.d.ts.map +1 -0
- package/dist/core/src/settings.d.ts +18 -78
- package/dist/core/src/settings.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts +31 -47
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/src/workspace-yaml-editor.d.ts.map +1 -1
- package/dist/core/workspace-config.js +1 -1
- package/dist/deploy/index.js +5 -3
- package/dist/deploy/index.js.map +1 -1
- package/dist/discovery/index.js +2 -2
- package/dist/{ensure-sources-DYGQNAJM.js → ensure-sources-QZAQ4SY2.js} +14 -12
- package/dist/ensure-sources-QZAQ4SY2.js.map +1 -0
- package/dist/factory-assets/connectors/box.js +15 -12
- package/dist/factory-assets/connectors/deploy.js +15 -12
- package/dist/factory-assets/connectors/devserver.js +15 -12
- package/dist/factory-assets/connectors/flow/adapter.js +15 -12
- package/dist/factory-assets/connectors/flow/engine.js +6 -4
- package/dist/factory-assets/connectors/flow/index.d.ts +1 -1
- package/dist/factory-assets/connectors/flow/index.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/run-flow.d.ts +0 -3
- package/dist/factory-assets/connectors/flow/run-flow.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/run-flow.js +16 -13
- package/dist/factory-assets/connectors/flow/subprompt-runner.d.ts +31 -28
- package/dist/factory-assets/connectors/flow/subprompt-runner.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow.js +15 -12
- package/dist/factory-assets/connectors/git.js +15 -12
- package/dist/factory-assets/connectors/gmail.js +15 -12
- package/dist/factory-assets/connectors/googledrive.js +15 -12
- package/dist/factory-assets/connectors/local.js +15 -12
- package/dist/factory-assets/connectors/mattermost.js +15 -12
- package/dist/factory-assets/connectors/memory.js +15 -12
- package/dist/factory-assets/connectors/minio.js +15 -12
- package/dist/factory-assets/connectors/postgres.js +15 -12
- package/dist/factory-assets/connectors/s3.js +15 -12
- package/dist/factory-assets/connectors/sharepoint.js +15 -12
- package/dist/factory-assets/connectors/sqlite.js +15 -12
- package/dist/factory-assets/connectors/static-server.js +15 -12
- package/dist/factory-assets/connectors/tunnel.js +15 -12
- package/dist/factory-assets/connectors/webdav.js +15 -12
- package/dist/factory-assets/connectors/xstate-store.js +15 -12
- package/dist/factory-assets/connectors/xstate.js +15 -12
- package/dist/{flows-MI2VM5JZ.js → flows-4EIENFNT.js} +9 -7
- package/dist/{flows-MI2VM5JZ.js.map → flows-4EIENFNT.js.map} +1 -1
- package/dist/{helpers-G6XZPN6L.js → helpers-DISRVGRJ.js} +14 -12
- package/dist/{helpers-G6XZPN6L.js.map → helpers-DISRVGRJ.js.map} +1 -1
- package/dist/library/index.js +8 -6
- package/dist/library/install.js +5 -3
- package/dist/{library-publish-WHGKK7G5.js → library-publish-I2QYQSB4.js} +18 -16
- package/dist/library-publish-I2QYQSB4.js.map +1 -0
- package/dist/{open-library-4JSLGWL6.js → open-library-6LM4W4DR.js} +16 -14
- package/dist/{open-library-4JSLGWL6.js.map → open-library-6LM4W4DR.js.map} +1 -1
- package/dist/paths-P26QGQP5.js +18 -0
- package/dist/{paths-CZEH643M.js.map → paths-P26QGQP5.js.map} +1 -1
- package/dist/plugin-registry/src/targets.d.ts +16 -2
- package/dist/plugin-registry/src/targets.d.ts.map +1 -1
- package/dist/{plugin-store-QJNBPIQK.js → plugin-store-T2DJGKBW.js} +7 -5
- package/dist/plugin-store-T2DJGKBW.js.map +1 -0
- package/dist/{project-LISE6I5O.js → project-HP3IR7RW.js} +15 -13
- package/dist/{project-LISE6I5O.js.map → project-HP3IR7RW.js.map} +1 -1
- package/dist/resolver/index.js +5 -3
- package/dist/runner/index.js +25 -22
- package/dist/runner/src/agent.d.ts +0 -2
- package/dist/runner/src/agent.d.ts.map +1 -1
- package/dist/runner/src/codex-init.d.ts.map +1 -1
- package/dist/runner/src/codex-resource-tools.d.ts.map +1 -1
- package/dist/runner/src/managed-codex-bootstrap.d.ts.map +1 -1
- package/dist/runner/src/resources.d.ts +1 -2
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-builder.d.ts +31 -35
- package/dist/runner/src/session-builder.d.ts.map +1 -1
- package/dist/runner/src/session.d.ts +0 -2
- package/dist/runner/src/session.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +11 -9
- package/dist/sdk/bridge.js +12 -9
- package/dist/sdk/core.js +5 -3
- package/dist/sdk/flow.js +6 -4
- package/dist/sdk/index.js +25 -22
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/resolver.js +5 -3
- package/dist/sdk/runner.js +25 -22
- package/dist/sdk/session.js +2 -2
- package/dist/sdk/types.js +1 -1
- package/dist/session/index.js +2 -2
- package/dist/setup-HLRSU3MR.js +435 -0
- package/dist/setup-HLRSU3MR.js.map +1 -0
- package/dist/{skills-IE3IWWB7.js → skills-QPYHHZ54.js} +7 -5
- package/dist/{skills-IE3IWWB7.js.map → skills-QPYHHZ54.js.map} +1 -1
- package/dist/{source-FKVEUOBQ.js → source-G2VCWPDU.js} +17 -15
- package/dist/{source-FKVEUOBQ.js.map → source-G2VCWPDU.js.map} +1 -1
- package/dist/{source-manifest-publish-LTRXO2OQ.js → source-manifest-publish-WYKCKJFC.js} +19 -17
- package/dist/source-manifest-publish-WYKCKJFC.js.map +1 -0
- package/dist/tui/index.js +25 -23
- package/dist/tui/index.js.map +1 -1
- package/dist/tui/src/repl.d.ts +0 -2
- package/dist/tui/src/repl.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/manifests.js +1 -1
- package/dist/types/src/flow.d.ts +6 -1
- package/dist/types/src/flow.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/lifecycle.d.ts +35 -10
- package/dist/types/src/lifecycle.d.ts.map +1 -1
- package/dist/types/src/manifests/agent.d.ts +116 -22
- package/dist/types/src/manifests/agent.d.ts.map +1 -1
- package/dist/types/src/manifests/index.d.ts +2 -2
- package/dist/types/src/manifests/index.d.ts.map +1 -1
- package/dist/types/src/manifests/preset.d.ts +5 -5
- package/dist/types/src/runtime.d.ts +51 -5
- package/dist/types/src/runtime.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +18 -2
- package/dist/types/src/version.d.ts.map +1 -1
- package/dist/validator-P5ESKTW5.js +5 -0
- package/dist/{validator-RN64BKFW.js.map → validator-P5ESKTW5.js.map} +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +11 -9
- package/dist/workspace-plugin/adapters/omp.js +11 -11
- package/dist/workspace-plugin/adapters/omp.js.map +1 -1
- package/dist/workspace-plugin/index.js +1 -1
- package/dist/workspace-plugin/src/plugin.d.ts +1 -4
- package/dist/workspace-plugin/src/plugin.d.ts.map +1 -1
- package/dist/workspace-plugin/src/tools/validator.d.ts +4 -4
- package/dist/workspace-plugin/src/tools/validator.d.ts.map +1 -1
- package/package.json +13 -1
- package/dist/asset-feeds-AJOUKX55.js.map +0 -1
- package/dist/bridge/src/provider-endpoints.d.ts +0 -55
- package/dist/bridge/src/provider-endpoints.d.ts.map +0 -1
- package/dist/chunk-3NCGSSCU.js.map +0 -1
- package/dist/chunk-3U3ZKYR7.js.map +0 -1
- package/dist/chunk-5UWAOYDN.js.map +0 -1
- package/dist/chunk-AN6NAFRT.js.map +0 -1
- package/dist/chunk-AQW4BWNR.js +0 -324
- package/dist/chunk-AQW4BWNR.js.map +0 -1
- package/dist/chunk-DY5GHUTC.js.map +0 -1
- package/dist/chunk-E7HKNQTH.js.map +0 -1
- package/dist/chunk-FFE7YLYO.js.map +0 -1
- package/dist/chunk-FYIHH56K.js +0 -110
- package/dist/chunk-FYIHH56K.js.map +0 -1
- package/dist/chunk-GURXUF2J.js.map +0 -1
- package/dist/chunk-HSRHO7SK.js.map +0 -1
- package/dist/chunk-MBARHWMZ.js.map +0 -1
- package/dist/chunk-N27DSFA7.js.map +0 -1
- package/dist/chunk-T3YLZQS4.js.map +0 -1
- package/dist/chunk-XMULHVKX.js.map +0 -1
- package/dist/chunk-YLL65VXQ.js.map +0 -1
- package/dist/ensure-sources-DYGQNAJM.js.map +0 -1
- package/dist/library-publish-WHGKK7G5.js.map +0 -1
- package/dist/paths-CZEH643M.js +0 -16
- package/dist/plugin-store-QJNBPIQK.js.map +0 -1
- package/dist/runner/src/cloud-bundle.d.ts +0 -36
- package/dist/runner/src/cloud-bundle.d.ts.map +0 -1
- package/dist/setup-CIRH5BYB.js +0 -517
- package/dist/setup-CIRH5BYB.js.map +0 -1
- package/dist/source-manifest-publish-LTRXO2OQ.js.map +0 -1
- package/dist/validator-RN64BKFW.js +0 -5
|
@@ -0,0 +1,843 @@
|
|
|
1
|
+
import { pluginRegistry } from './chunk-6E6PKKAD.js';
|
|
2
|
+
import { resolveCredential } from './chunk-KSIRR5PL.js';
|
|
3
|
+
import { AI_PROVIDER_BASE_URL_TEMPLATES, resolveEntryBaseUrl, parseCredentialRef, registryEntries, isEntryEnabled, mergeRegistries } from './chunk-ILG4BXYE.js';
|
|
4
|
+
import { createLogger } from './chunk-W4IPN3DD.js';
|
|
5
|
+
import { EventEmitter } from 'events';
|
|
6
|
+
|
|
7
|
+
// bridge/src/logger.ts
|
|
8
|
+
function getBridgeLogger(subkind) {
|
|
9
|
+
return createLogger({ kind: "bridge", subkind });
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// bridge/src/provider-catalog.ts
|
|
13
|
+
var ANTHROPIC_VERSION_HEADER = { "anthropic-version": "2023-06-01" };
|
|
14
|
+
var X_API_KEY = { name: "x-api-key", template: "{credential}" };
|
|
15
|
+
var OPENAI_MODELS_PATH = "/v1/models";
|
|
16
|
+
var AI_PROVIDER_PRESETS = {
|
|
17
|
+
anthropic: {
|
|
18
|
+
id: "anthropic",
|
|
19
|
+
kind: "llm",
|
|
20
|
+
label: "Anthropic",
|
|
21
|
+
surface: "anthropic-messages",
|
|
22
|
+
base_url: "https://api.anthropic.com",
|
|
23
|
+
base_url_env: "ANTHROPIC_BASE_URL",
|
|
24
|
+
headers: ANTHROPIC_VERSION_HEADER,
|
|
25
|
+
credential: { kind: "api_key_header", env: "ANTHROPIC_API_KEY" },
|
|
26
|
+
auth_header: X_API_KEY,
|
|
27
|
+
probe_path: "/v1/models",
|
|
28
|
+
discovery: { type: "anthropic-models-list" }
|
|
29
|
+
},
|
|
30
|
+
openai: {
|
|
31
|
+
id: "openai",
|
|
32
|
+
kind: "llm",
|
|
33
|
+
label: "OpenAI",
|
|
34
|
+
surface: "openai-responses",
|
|
35
|
+
base_url: "https://api.openai.com/v1",
|
|
36
|
+
base_url_env: "OPENAI_BASE_URL",
|
|
37
|
+
credential: { kind: "bearer", env: "OPENAI_API_KEY" },
|
|
38
|
+
probe_path: OPENAI_MODELS_PATH,
|
|
39
|
+
discovery: { type: "openai-models-list" },
|
|
40
|
+
notes: "Responses is OpenAI's current API; set surface openai-completions for chat-only clients."
|
|
41
|
+
},
|
|
42
|
+
google: {
|
|
43
|
+
id: "google",
|
|
44
|
+
kind: "llm",
|
|
45
|
+
label: "Google Gemini API",
|
|
46
|
+
surface: "google-generative-ai",
|
|
47
|
+
base_url: "https://generativelanguage.googleapis.com/v1beta",
|
|
48
|
+
credential: { kind: "api_key_header", env: "GEMINI_API_KEY" },
|
|
49
|
+
auth_header: { name: "x-goog-api-key", template: "{credential}" },
|
|
50
|
+
probe_path: "/v1beta/models",
|
|
51
|
+
discovery: { type: "google-models-list" }
|
|
52
|
+
},
|
|
53
|
+
groq: {
|
|
54
|
+
id: "groq",
|
|
55
|
+
kind: "llm",
|
|
56
|
+
label: "Groq",
|
|
57
|
+
surface: "openai-completions",
|
|
58
|
+
base_url: "https://api.groq.com/openai/v1",
|
|
59
|
+
credential: { kind: "bearer", env: "GROQ_API_KEY" },
|
|
60
|
+
probe_path: OPENAI_MODELS_PATH,
|
|
61
|
+
discovery: { type: "openai-models-list" }
|
|
62
|
+
},
|
|
63
|
+
deepseek: {
|
|
64
|
+
id: "deepseek",
|
|
65
|
+
kind: "llm",
|
|
66
|
+
label: "DeepSeek",
|
|
67
|
+
surface: "openai-completions",
|
|
68
|
+
base_url: "https://api.deepseek.com",
|
|
69
|
+
credential: { kind: "bearer", env: "DEEPSEEK_API_KEY" },
|
|
70
|
+
probe_path: "/models",
|
|
71
|
+
discovery: { type: "openai-models-list" },
|
|
72
|
+
notes: "Anthropic-shaped clients use https://api.deepseek.com/anthropic with surface anthropic-messages."
|
|
73
|
+
},
|
|
74
|
+
openrouter: {
|
|
75
|
+
id: "openrouter",
|
|
76
|
+
kind: "llm",
|
|
77
|
+
label: "OpenRouter",
|
|
78
|
+
surface: "openai-completions",
|
|
79
|
+
base_url: "https://openrouter.ai/api/v1",
|
|
80
|
+
credential: { kind: "bearer", env: "OPENROUTER_API_KEY" },
|
|
81
|
+
probe_path: OPENAI_MODELS_PATH,
|
|
82
|
+
discovery: { type: "openai-models-list" }
|
|
83
|
+
},
|
|
84
|
+
mistral: {
|
|
85
|
+
id: "mistral",
|
|
86
|
+
kind: "llm",
|
|
87
|
+
label: "Mistral",
|
|
88
|
+
surface: "openai-completions",
|
|
89
|
+
base_url: "https://api.mistral.ai/v1",
|
|
90
|
+
credential: { kind: "bearer", env: "MISTRAL_API_KEY" },
|
|
91
|
+
probe_path: OPENAI_MODELS_PATH,
|
|
92
|
+
discovery: { type: "openai-models-list" }
|
|
93
|
+
},
|
|
94
|
+
xai: {
|
|
95
|
+
id: "xai",
|
|
96
|
+
kind: "llm",
|
|
97
|
+
label: "xAI (Grok)",
|
|
98
|
+
surface: "openai-completions",
|
|
99
|
+
base_url: "https://api.x.ai/v1",
|
|
100
|
+
credential: { kind: "bearer", env: "XAI_API_KEY" },
|
|
101
|
+
probe_path: OPENAI_MODELS_PATH,
|
|
102
|
+
discovery: { type: "openai-models-list" }
|
|
103
|
+
},
|
|
104
|
+
together: {
|
|
105
|
+
id: "together",
|
|
106
|
+
kind: "llm",
|
|
107
|
+
label: "Together AI",
|
|
108
|
+
surface: "openai-completions",
|
|
109
|
+
base_url: "https://api.together.ai/v1",
|
|
110
|
+
credential: { kind: "bearer", env: "TOGETHER_API_KEY" },
|
|
111
|
+
probe_path: OPENAI_MODELS_PATH,
|
|
112
|
+
discovery: { type: "openai-models-list" }
|
|
113
|
+
},
|
|
114
|
+
fireworks: {
|
|
115
|
+
id: "fireworks",
|
|
116
|
+
kind: "llm",
|
|
117
|
+
label: "Fireworks AI",
|
|
118
|
+
surface: "openai-completions",
|
|
119
|
+
base_url: "https://api.fireworks.ai/inference/v1",
|
|
120
|
+
credential: { kind: "bearer", env: "FIREWORKS_API_KEY" },
|
|
121
|
+
probe_path: OPENAI_MODELS_PATH,
|
|
122
|
+
discovery: { type: "openai-models-list" }
|
|
123
|
+
},
|
|
124
|
+
bedrock: {
|
|
125
|
+
id: "bedrock",
|
|
126
|
+
kind: "llm",
|
|
127
|
+
label: "AWS Bedrock",
|
|
128
|
+
surface: "bedrock-converse-stream",
|
|
129
|
+
transport: "bedrock",
|
|
130
|
+
credential: { kind: "sigv4" },
|
|
131
|
+
required_params: ["region"],
|
|
132
|
+
notes: "Credentials come from the AWS default chain; the runtime host serves no models list."
|
|
133
|
+
},
|
|
134
|
+
vertex: {
|
|
135
|
+
id: "vertex",
|
|
136
|
+
kind: "llm",
|
|
137
|
+
label: "Google Vertex AI",
|
|
138
|
+
surface: "google-vertex",
|
|
139
|
+
transport: "vertex",
|
|
140
|
+
credential: { kind: "google_adc" },
|
|
141
|
+
params: { publisher: "google" },
|
|
142
|
+
required_params: ["project", "location"],
|
|
143
|
+
probe_path: "/models"
|
|
144
|
+
},
|
|
145
|
+
"azure-openai": {
|
|
146
|
+
id: "azure-openai",
|
|
147
|
+
kind: "llm",
|
|
148
|
+
label: "Azure OpenAI",
|
|
149
|
+
surface: "azure-openai-responses",
|
|
150
|
+
transport: "azure-openai",
|
|
151
|
+
credential: { kind: "api_key_header", env: "AZURE_OPENAI_API_KEY" },
|
|
152
|
+
auth_header: { name: "api-key", template: "{credential}" },
|
|
153
|
+
required_params: ["resource", "deployment", "api_version"],
|
|
154
|
+
probe_path: "/models",
|
|
155
|
+
notes: "api_version is mirrored into query_params['api-version']; switch credential.kind to azure_entra for Entra tokens."
|
|
156
|
+
},
|
|
157
|
+
foundry: {
|
|
158
|
+
id: "foundry",
|
|
159
|
+
kind: "llm",
|
|
160
|
+
label: "Claude on Microsoft Foundry",
|
|
161
|
+
surface: "anthropic-messages",
|
|
162
|
+
transport: "foundry",
|
|
163
|
+
headers: ANTHROPIC_VERSION_HEADER,
|
|
164
|
+
credential: { kind: "api_key_header", env: "ANTHROPIC_FOUNDRY_API_KEY" },
|
|
165
|
+
auth_header: X_API_KEY,
|
|
166
|
+
required_params: ["resource"],
|
|
167
|
+
probe_path: "/v1/models"
|
|
168
|
+
},
|
|
169
|
+
ollama: {
|
|
170
|
+
id: "ollama",
|
|
171
|
+
kind: "llm",
|
|
172
|
+
label: "Ollama (local)",
|
|
173
|
+
surface: "openai-completions",
|
|
174
|
+
base_url: "http://localhost:11434/v1",
|
|
175
|
+
credential: { kind: "none" },
|
|
176
|
+
probe_path: OPENAI_MODELS_PATH,
|
|
177
|
+
discovery: { type: "openai-models-list" }
|
|
178
|
+
},
|
|
179
|
+
lmstudio: {
|
|
180
|
+
id: "lmstudio",
|
|
181
|
+
kind: "llm",
|
|
182
|
+
label: "LM Studio (local)",
|
|
183
|
+
surface: "openai-completions",
|
|
184
|
+
base_url: "http://localhost:1234/v1",
|
|
185
|
+
credential: { kind: "none" },
|
|
186
|
+
probe_path: OPENAI_MODELS_PATH,
|
|
187
|
+
discovery: { type: "openai-models-list" }
|
|
188
|
+
},
|
|
189
|
+
vllm: {
|
|
190
|
+
id: "vllm",
|
|
191
|
+
kind: "llm",
|
|
192
|
+
label: "vLLM (self-hosted)",
|
|
193
|
+
surface: "openai-completions",
|
|
194
|
+
base_url: "http://localhost:8000/v1",
|
|
195
|
+
credential: { kind: "none" },
|
|
196
|
+
probe_path: OPENAI_MODELS_PATH,
|
|
197
|
+
discovery: { type: "openai-models-list" },
|
|
198
|
+
notes: "A server started with --api-key expects credential.kind bearer and an env: ref."
|
|
199
|
+
},
|
|
200
|
+
litellm: {
|
|
201
|
+
id: "litellm",
|
|
202
|
+
kind: "llm",
|
|
203
|
+
label: "LiteLLM proxy",
|
|
204
|
+
surface: "openai-completions",
|
|
205
|
+
base_url: "http://localhost:4000",
|
|
206
|
+
credential: { kind: "bearer", env: "LITELLM_API_KEY" },
|
|
207
|
+
probe_path: OPENAI_MODELS_PATH,
|
|
208
|
+
discovery: { type: "openai-models-list" },
|
|
209
|
+
notes: "The credential is the proxy's virtual key; upstream keys stay in the proxy config."
|
|
210
|
+
},
|
|
211
|
+
deepgram: {
|
|
212
|
+
id: "deepgram",
|
|
213
|
+
kind: "stt",
|
|
214
|
+
label: "Deepgram",
|
|
215
|
+
base_url: "https://api.deepgram.com",
|
|
216
|
+
credential: { kind: "api_key_header", env: "DEEPGRAM_API_KEY" },
|
|
217
|
+
auth_header: { name: "Authorization", template: "Token {credential}" },
|
|
218
|
+
params: { model: "nova-3", language: "en" },
|
|
219
|
+
probe_path: "/v1/projects"
|
|
220
|
+
},
|
|
221
|
+
elevenlabs: {
|
|
222
|
+
id: "elevenlabs",
|
|
223
|
+
kind: "tts",
|
|
224
|
+
label: "ElevenLabs",
|
|
225
|
+
base_url: "https://api.elevenlabs.io",
|
|
226
|
+
credential: { kind: "api_key_header", env: "ELEVENLABS_API_KEY" },
|
|
227
|
+
auth_header: { name: "xi-api-key", template: "{credential}" },
|
|
228
|
+
params: { voice_id: "21m00Tcm4TlvDq8ikWAM", output_format: "mp3_44100_128" },
|
|
229
|
+
probe_path: "/v1/models"
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
function listProviderPresets() {
|
|
233
|
+
return Object.values(AI_PROVIDER_PRESETS);
|
|
234
|
+
}
|
|
235
|
+
function getProviderPreset(id) {
|
|
236
|
+
return AI_PROVIDER_PRESETS[id];
|
|
237
|
+
}
|
|
238
|
+
function presetBaseUrl(preset) {
|
|
239
|
+
if (preset.base_url) return preset.base_url;
|
|
240
|
+
if (!preset.transport || preset.transport === "direct") return void 0;
|
|
241
|
+
return AI_PROVIDER_BASE_URL_TEMPLATES[preset.transport];
|
|
242
|
+
}
|
|
243
|
+
function resolvePresetBaseUrl(preset, options = {}) {
|
|
244
|
+
const explicit = options.baseUrl?.trim();
|
|
245
|
+
if (explicit) return explicit;
|
|
246
|
+
const fromEnv = preset.base_url_env ? options.env?.[preset.base_url_env]?.trim() : void 0;
|
|
247
|
+
return fromEnv || preset.base_url;
|
|
248
|
+
}
|
|
249
|
+
function expandPreset(preset, options = {}) {
|
|
250
|
+
const ref = options.credentialRef ?? (preset.credential.env ? `env:${preset.credential.env}` : void 0);
|
|
251
|
+
const credential = ref ? { kind: preset.credential.kind, ref } : { kind: preset.credential.kind };
|
|
252
|
+
const base_url = options.baseUrl ?? preset.base_url;
|
|
253
|
+
const params = { ...preset.params, ...options.params };
|
|
254
|
+
if (preset.kind === "stt" || preset.kind === "tts") {
|
|
255
|
+
return {
|
|
256
|
+
kind: preset.kind,
|
|
257
|
+
label: options.label ?? preset.label,
|
|
258
|
+
preset: preset.id,
|
|
259
|
+
...base_url ? { base_url } : {},
|
|
260
|
+
...preset.headers ? { headers: { ...preset.headers } } : {},
|
|
261
|
+
credential,
|
|
262
|
+
...Object.keys(params).length > 0 ? { params } : {}
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
const transport = preset.transport ?? "direct";
|
|
266
|
+
const entry = {
|
|
267
|
+
kind: preset.kind === "embed" ? "embed" : "llm",
|
|
268
|
+
label: options.label ?? preset.label,
|
|
269
|
+
preset: preset.id,
|
|
270
|
+
...options.surface ?? preset.surface ? { surface: options.surface ?? preset.surface } : {},
|
|
271
|
+
...base_url ? { base_url } : {},
|
|
272
|
+
...preset.headers ? { headers: { ...preset.headers } } : {},
|
|
273
|
+
credential,
|
|
274
|
+
...preset.discovery ? { discovery: { ...preset.discovery } } : {}
|
|
275
|
+
};
|
|
276
|
+
if (transport !== "direct") {
|
|
277
|
+
Object.assign(entry, { transport, params });
|
|
278
|
+
if (transport === "azure-openai" && params.api_version) {
|
|
279
|
+
entry.query_params = { "api-version": params.api_version };
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return entry;
|
|
283
|
+
}
|
|
284
|
+
function catalogLayer(providers) {
|
|
285
|
+
const expanded = {};
|
|
286
|
+
for (const [id, entry] of Object.entries(providers)) {
|
|
287
|
+
if (!entry.preset) continue;
|
|
288
|
+
const preset = AI_PROVIDER_PRESETS[entry.preset];
|
|
289
|
+
if (!preset) continue;
|
|
290
|
+
expanded[id] = expandPreset(preset);
|
|
291
|
+
}
|
|
292
|
+
return { layer: "catalog", providers: expanded };
|
|
293
|
+
}
|
|
294
|
+
function joinBaseAndPath(base, path) {
|
|
295
|
+
const trimmed = base.replace(/\/+$/, "");
|
|
296
|
+
const segments = path.split("/").filter(Boolean);
|
|
297
|
+
const lead = segments[0];
|
|
298
|
+
if (lead && trimmed.toLowerCase().endsWith(`/${lead.toLowerCase()}`)) {
|
|
299
|
+
return `${trimmed}/${segments.slice(1).join("/")}`;
|
|
300
|
+
}
|
|
301
|
+
return `${trimmed}${path}`;
|
|
302
|
+
}
|
|
303
|
+
function resolveProbeUrl(entry) {
|
|
304
|
+
const base = resolveEntryBaseUrl(entry);
|
|
305
|
+
if (!base) return void 0;
|
|
306
|
+
const preset = entry.preset ? AI_PROVIDER_PRESETS[entry.preset] : void 0;
|
|
307
|
+
const path = entry.discovery?.path ?? preset?.probe_path;
|
|
308
|
+
if (!path) return void 0;
|
|
309
|
+
const url = joinBaseAndPath(base, path);
|
|
310
|
+
const query = entry.query_params;
|
|
311
|
+
if (!query || Object.keys(query).length === 0) return url;
|
|
312
|
+
const search = new URLSearchParams(query).toString();
|
|
313
|
+
return `${url}${url.includes("?") ? "&" : "?"}${search}`;
|
|
314
|
+
}
|
|
315
|
+
function buildCredentialHeaders(entry, secret) {
|
|
316
|
+
const kind = entry.credential?.kind ?? "none";
|
|
317
|
+
if (!secret || kind === "none" || kind === "sigv4" || kind === "google_adc") return {};
|
|
318
|
+
const preset = entry.preset ? AI_PROVIDER_PRESETS[entry.preset] : void 0;
|
|
319
|
+
if (preset?.auth_header) {
|
|
320
|
+
return {
|
|
321
|
+
[preset.auth_header.name]: preset.auth_header.template.replace("{credential}", secret)
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
if (kind === "api_key_header") {
|
|
325
|
+
const surface = entry.surface;
|
|
326
|
+
if (surface === "google-generative-ai") return { "x-goog-api-key": secret };
|
|
327
|
+
if (surface === "azure-openai-responses") return { "api-key": secret };
|
|
328
|
+
return { "x-api-key": secret };
|
|
329
|
+
}
|
|
330
|
+
return { Authorization: `Bearer ${secret}` };
|
|
331
|
+
}
|
|
332
|
+
async function probeProviderEntry(entry, options = {}) {
|
|
333
|
+
const url = resolveProbeUrl(entry);
|
|
334
|
+
if (!url) {
|
|
335
|
+
const base = resolveEntryBaseUrl(entry);
|
|
336
|
+
return {
|
|
337
|
+
ok: false,
|
|
338
|
+
probed: false,
|
|
339
|
+
detail: base ? `no read-only probe endpoint is defined for this entry (${base})` : "no base_url could be resolved \u2014 set base_url or the transport's params"
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
const headers = {
|
|
343
|
+
...entry.headers,
|
|
344
|
+
...buildCredentialHeaders(entry, options.secret)
|
|
345
|
+
};
|
|
346
|
+
const controller = new AbortController();
|
|
347
|
+
const timeout = setTimeout(() => controller.abort(), options.timeoutMs ?? 8e3);
|
|
348
|
+
try {
|
|
349
|
+
const response = await fetch(url, { method: "GET", headers, signal: controller.signal });
|
|
350
|
+
if (response.ok) {
|
|
351
|
+
return { ok: true, probed: true, url, status: response.status, detail: "endpoint reachable" };
|
|
352
|
+
}
|
|
353
|
+
const detail = response.status === 401 || response.status === 403 ? "credential rejected (authentication failed)" : `endpoint returned HTTP ${response.status}`;
|
|
354
|
+
return { ok: false, probed: true, url, status: response.status, detail };
|
|
355
|
+
} catch (err) {
|
|
356
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
357
|
+
const detail = err instanceof Error && err.name === "AbortError" ? `request timed out after ${options.timeoutMs ?? 8e3}ms` : message;
|
|
358
|
+
return { ok: false, probed: true, url, detail };
|
|
359
|
+
} finally {
|
|
360
|
+
clearTimeout(timeout);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// bridge/src/provider-materialize/credential-env.ts
|
|
365
|
+
var PROVIDER_CREDENTIAL_ENV_PREFIX = "SKAILE_AIP_";
|
|
366
|
+
var PROVIDER_CREDENTIAL_ENV_SUFFIX = "_KEY";
|
|
367
|
+
function providerCredentialEnvName(providerId) {
|
|
368
|
+
const slug = providerId.replace(/[^A-Za-z0-9]/g, "_").toUpperCase();
|
|
369
|
+
return `${PROVIDER_CREDENTIAL_ENV_PREFIX}${slug}${PROVIDER_CREDENTIAL_ENV_SUFFIX}`;
|
|
370
|
+
}
|
|
371
|
+
function conventionalCredentialEnvName(entry) {
|
|
372
|
+
const preset = entry.preset ? AI_PROVIDER_PRESETS[entry.preset] : void 0;
|
|
373
|
+
if (preset?.credential.env) return preset.credential.env;
|
|
374
|
+
const ref = entry.credential?.ref ? parseCredentialRef(entry.credential.ref) : void 0;
|
|
375
|
+
return ref?.form === "env" ? ref.name : void 0;
|
|
376
|
+
}
|
|
377
|
+
function resolveEntryCredential(entry, options = {}) {
|
|
378
|
+
return resolveCredential(entry, {
|
|
379
|
+
...options.env ? { env: options.env } : {},
|
|
380
|
+
...options.secrets ? { secrets: options.secrets } : {},
|
|
381
|
+
...options.allowCommand === void 0 ? {} : { allowCommand: options.allowCommand }
|
|
382
|
+
}).value;
|
|
383
|
+
}
|
|
384
|
+
function entryCredentialValue(providerId, entry, options = {}) {
|
|
385
|
+
return resolveEntryCredential(entry, options) ?? options.env?.[providerCredentialEnvName(providerId)];
|
|
386
|
+
}
|
|
387
|
+
function entryCredentialEnv(providerId, entry, options = {}) {
|
|
388
|
+
const value = resolveEntryCredential(entry, options);
|
|
389
|
+
if (!value) return {};
|
|
390
|
+
const out = { [providerCredentialEnvName(providerId)]: value };
|
|
391
|
+
if (options.aliases !== false) {
|
|
392
|
+
const alias = conventionalCredentialEnvName(entry);
|
|
393
|
+
if (alias) out[alias] = value;
|
|
394
|
+
}
|
|
395
|
+
return out;
|
|
396
|
+
}
|
|
397
|
+
function registryCredentialEnv(registry, options = {}) {
|
|
398
|
+
const canonical = {};
|
|
399
|
+
const aliases = {};
|
|
400
|
+
for (const [id, entry] of registryEntries(registry)) {
|
|
401
|
+
if (options.providerId && id !== options.providerId) continue;
|
|
402
|
+
if (!isEntryEnabled(entry)) continue;
|
|
403
|
+
const value = resolveEntryCredential(entry, options);
|
|
404
|
+
if (!value) continue;
|
|
405
|
+
canonical[providerCredentialEnvName(id)] = value;
|
|
406
|
+
if (options.aliases === false) continue;
|
|
407
|
+
const alias = conventionalCredentialEnvName(entry);
|
|
408
|
+
if (alias && aliases[alias] === void 0) aliases[alias] = value;
|
|
409
|
+
}
|
|
410
|
+
return { ...aliases, ...canonical };
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// bridge/src/provider-registry-derive.ts
|
|
414
|
+
var PRESET_ALIASES = { gemini: "google" };
|
|
415
|
+
function toMergedRegistry(registry, layer = "session") {
|
|
416
|
+
if (Array.isArray(registry.order)) {
|
|
417
|
+
return registry;
|
|
418
|
+
}
|
|
419
|
+
return mergeRegistries([{ layer, providers: registry }]);
|
|
420
|
+
}
|
|
421
|
+
function slugProviderId(provider) {
|
|
422
|
+
const slug = provider.trim().toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^[^a-z0-9]+/, "");
|
|
423
|
+
return slug || "provider";
|
|
424
|
+
}
|
|
425
|
+
function deriveApiKeyEntry(provider, literal, env, credentialEnv) {
|
|
426
|
+
const preset = AI_PROVIDER_PRESETS[PRESET_ALIASES[provider] ?? provider];
|
|
427
|
+
const envBaseUrl = preset?.base_url_env ? env[preset.base_url_env]?.trim() : void 0;
|
|
428
|
+
const baseUrl = envBaseUrl || preset?.base_url;
|
|
429
|
+
const envNames = [
|
|
430
|
+
preset?.credential.env,
|
|
431
|
+
`${provider.toUpperCase().replace(/[^A-Z0-9]/g, "_")}_API_KEY`
|
|
432
|
+
].filter((name) => !!name);
|
|
433
|
+
const envName = envNames.find((name) => env[name]) ?? envNames[0];
|
|
434
|
+
credentialEnv[envName] = literal;
|
|
435
|
+
const credential = {
|
|
436
|
+
kind: preset?.credential.kind ?? "bearer",
|
|
437
|
+
ref: `env:${envName}`
|
|
438
|
+
};
|
|
439
|
+
return {
|
|
440
|
+
kind: "llm",
|
|
441
|
+
label: preset?.label ?? provider,
|
|
442
|
+
// `openai-completions` is the only defensible guess for a provider the
|
|
443
|
+
// catalog has never heard of: every unlisted vendor the settings cascade
|
|
444
|
+
// accepts today speaks the OpenAI chat wire format.
|
|
445
|
+
surface: preset?.surface ?? "openai-completions",
|
|
446
|
+
...baseUrl ? { base_url: baseUrl } : {},
|
|
447
|
+
...preset?.headers ? { headers: { ...preset.headers } } : {},
|
|
448
|
+
...preset?.discovery ? { discovery: { ...preset.discovery } } : {},
|
|
449
|
+
credential
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
function deriveRegistryFromLegacyApiKeys(apiKeys, options = {}) {
|
|
453
|
+
const env = options.env ?? process.env;
|
|
454
|
+
const providers = {};
|
|
455
|
+
const credentialEnv = {};
|
|
456
|
+
for (const [provider, key] of Object.entries(apiKeys ?? {})) {
|
|
457
|
+
if (!key) continue;
|
|
458
|
+
providers[slugProviderId(provider)] = deriveApiKeyEntry(provider, key, env, credentialEnv);
|
|
459
|
+
}
|
|
460
|
+
const ids = Object.keys(providers);
|
|
461
|
+
if (ids.length === 0) return { providers, credentialEnv };
|
|
462
|
+
return {
|
|
463
|
+
providers,
|
|
464
|
+
credentialEnv,
|
|
465
|
+
deprecation: `[ai-provider-registry] settings.json apiKeys{} is legacy \u2014 normalized ${ids.join(", ")} into registry entries whose credential is an env: reference. Define these endpoints once with 'skaile providers add <id> --preset <preset>' (~/.skaile/providers.yml) and drop apiKeys; it is removed in the next major.`
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
function registryDriverConfig(registry, options = {}) {
|
|
469
|
+
const merged = toMergedRegistry(registry, "runtime");
|
|
470
|
+
return {
|
|
471
|
+
registry: merged,
|
|
472
|
+
env: registryCredentialEnv(merged, options),
|
|
473
|
+
...options.providerId ? { modelRef: options.providerId } : {}
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
var AgentDriver = class extends EventEmitter {
|
|
477
|
+
/** Preserve text-only callers; drivers must explicitly support attachments. */
|
|
478
|
+
promptInput(input) {
|
|
479
|
+
if (input.attachments?.length) return Promise.reject(new Error("Structured input unsupported"));
|
|
480
|
+
return this.prompt(input.text);
|
|
481
|
+
}
|
|
482
|
+
/** Managed replies never fall back to a new prompt after a request has settled. */
|
|
483
|
+
get acceptsReplyAsPrompt() {
|
|
484
|
+
return true;
|
|
485
|
+
}
|
|
486
|
+
/** Stop the driver and await owned process/state cleanup when the backend supports it. */
|
|
487
|
+
async dispose() {
|
|
488
|
+
this.kill();
|
|
489
|
+
}
|
|
490
|
+
/** Optional provider-native session/thread identifier for resume support. */
|
|
491
|
+
get runtimeSessionId() {
|
|
492
|
+
return void 0;
|
|
493
|
+
}
|
|
494
|
+
/** Slash commands discovered from the agent runtime. Override in drivers that support introspection. */
|
|
495
|
+
getSlashCommands() {
|
|
496
|
+
return [];
|
|
497
|
+
}
|
|
498
|
+
// ── Interactive questions (AskUserQuestion) ──────────────────────────────
|
|
499
|
+
/**
|
|
500
|
+
* `true` while the driver is paused on an interactive question and waiting
|
|
501
|
+
* for the user's answer rather than a new prompt. The runner routes a
|
|
502
|
+
* `reply` command to {@link answerQuestion} instead of {@link prompt} when
|
|
503
|
+
* this returns `true`. Drivers without interactive-question support return
|
|
504
|
+
* `false` (the default), so a `reply` falls back to `prompt`.
|
|
505
|
+
*/
|
|
506
|
+
hasPendingQuestion() {
|
|
507
|
+
return false;
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Deliver the user's answer to the question the driver is currently paused
|
|
511
|
+
* on. This resumes the in-flight turn — it does NOT start a new one. When a
|
|
512
|
+
* single tool call asks several questions, the driver resolves the underlying
|
|
513
|
+
* call only once every sub-question has an answer.
|
|
514
|
+
*
|
|
515
|
+
* @param answer - The user's reply text (an option label, free text, or for
|
|
516
|
+
* multi-select a comma-joined list).
|
|
517
|
+
* @param question - The sub-question this answers, verbatim from the
|
|
518
|
+
* `question` event that asked it. Supply it whenever the host lets the user
|
|
519
|
+
* answer out of order — without it the answer fills the next unanswered
|
|
520
|
+
* slot in order, which silently mismatches a non-sequential reply.
|
|
521
|
+
* @returns `true` when the answer was consumed by a pending question; `false`
|
|
522
|
+
* when no question was pending (caller should treat the reply as a prompt).
|
|
523
|
+
*/
|
|
524
|
+
answerQuestion(answer, question, requestId) {
|
|
525
|
+
return false;
|
|
526
|
+
}
|
|
527
|
+
// ── Live reconfiguration ────────────────────────────────────────────────
|
|
528
|
+
/**
|
|
529
|
+
* Live-update driver configuration. The new values take effect on the next
|
|
530
|
+
* prompt() call. Only model/thinking/effort are reconfigurable mid-session.
|
|
531
|
+
*
|
|
532
|
+
* Subclasses that store config locally should override this to apply the
|
|
533
|
+
* patch to their own config field. The base implementation is a no-op.
|
|
534
|
+
*/
|
|
535
|
+
reconfigure(patch) {
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Returns the model identifier currently configured on this driver.
|
|
539
|
+
* Subclasses that store config locally should override this.
|
|
540
|
+
*/
|
|
541
|
+
getModel() {
|
|
542
|
+
return void 0;
|
|
543
|
+
}
|
|
544
|
+
// ── Compaction support ──────────────────────────────────────────────────
|
|
545
|
+
/**
|
|
546
|
+
* Returns the token usage from the most recent completed turn.
|
|
547
|
+
* Returns `null` if usage data is unavailable (e.g. driver doesn't track it).
|
|
548
|
+
*
|
|
549
|
+
* Widened in 3.1.0 to return the full `TokenUsage` shape (input / output /
|
|
550
|
+
* cache-read / cache-creation / reasoning). All fields are optional so
|
|
551
|
+
* drivers can populate just what their provider reports. Existing callers
|
|
552
|
+
* that read only `inputTokens` / `outputTokens` keep working — those fields
|
|
553
|
+
* are still present and carry the same semantics as before.
|
|
554
|
+
*/
|
|
555
|
+
getTokenUsage() {
|
|
556
|
+
return null;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Prompt tokens occupying the context window as of the most recent API
|
|
560
|
+
* request — i.e. how full the context actually is right now.
|
|
561
|
+
*
|
|
562
|
+
* Deliberately NOT the same number as {@link getTokenUsage}, whose usage is
|
|
563
|
+
* cumulative over every API call in the turn and therefore overstates the
|
|
564
|
+
* context by 10-40x on any multi-tool turn. Callers measuring context fill
|
|
565
|
+
* (compaction thresholds) must prefer this; callers billing a turn
|
|
566
|
+
* (usage ledgers, the `finished` event) must keep using `getTokenUsage()`.
|
|
567
|
+
*
|
|
568
|
+
* Returns `null` both when the driver cannot report a per-call figure at all
|
|
569
|
+
* and when it can but has no reading yet. Falling back to `getTokenUsage()`
|
|
570
|
+
* is safe in either case only because a driver clears the two in lockstep: no
|
|
571
|
+
* reading means no API call landed, so there is no cumulative usage to
|
|
572
|
+
* overstate. A driver implementing this must preserve that invariant.
|
|
573
|
+
*/
|
|
574
|
+
getContextTokens() {
|
|
575
|
+
return null;
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Returns the model's context window size in tokens.
|
|
579
|
+
* Returns `null` if unknown.
|
|
580
|
+
*/
|
|
581
|
+
getContextWindow() {
|
|
582
|
+
return null;
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* Returns the list of models available to this driver without starting a session.
|
|
586
|
+
* Drivers that can enumerate their own models override this method.
|
|
587
|
+
* Returns an empty array by default.
|
|
588
|
+
*/
|
|
589
|
+
async listModels() {
|
|
590
|
+
return [];
|
|
591
|
+
}
|
|
592
|
+
// ── Telemetry ─────────────────────────────────────────────────────────────
|
|
593
|
+
_telemetry;
|
|
594
|
+
_activeTrace;
|
|
595
|
+
_activeTurnSpan;
|
|
596
|
+
_turnStartTime;
|
|
597
|
+
/**
|
|
598
|
+
* Attach a telemetry provider and active trace to this driver.
|
|
599
|
+
* Called by the runner after creating the driver but before start().
|
|
600
|
+
*/
|
|
601
|
+
setTelemetry(provider, trace) {
|
|
602
|
+
this._telemetry = provider;
|
|
603
|
+
this._activeTrace = trace;
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Begin a turn span. Called by the runner before prompt().
|
|
607
|
+
* Pass a parent span (e.g. the turn span from the orchestrator) for nesting.
|
|
608
|
+
* Returns the span so the runner can annotate it further.
|
|
609
|
+
*/
|
|
610
|
+
beginTurnSpan(parent, attrs) {
|
|
611
|
+
if (!this._telemetry || !this._activeTrace) return void 0;
|
|
612
|
+
this._turnStartTime = Date.now();
|
|
613
|
+
this._activeTurnSpan = this._telemetry.startSpan(parent ?? this._activeTrace, {
|
|
614
|
+
name: "llm_generation",
|
|
615
|
+
kind: "llm_generation",
|
|
616
|
+
attributes: attrs
|
|
617
|
+
});
|
|
618
|
+
return this._activeTurnSpan;
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* End the current turn span with generation data.
|
|
622
|
+
* Called by the runner after agent_end. Model and provider are passed
|
|
623
|
+
* explicitly — the driver base class does not access config directly.
|
|
624
|
+
*/
|
|
625
|
+
endTurnSpan(result) {
|
|
626
|
+
if (!this._telemetry || !this._activeTurnSpan) return;
|
|
627
|
+
const durationMs = this._turnStartTime ? Date.now() - this._turnStartTime : 0;
|
|
628
|
+
if (result?.inputTokens !== void 0 || result?.outputTokens !== void 0) {
|
|
629
|
+
this._telemetry.logGeneration(this._activeTurnSpan, {
|
|
630
|
+
model: result?.model ?? "unknown",
|
|
631
|
+
provider: result?.provider ?? "unknown",
|
|
632
|
+
inputTokens: result.inputTokens,
|
|
633
|
+
outputTokens: result.outputTokens,
|
|
634
|
+
durationMs,
|
|
635
|
+
stopReason: result.stopReason
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
this._telemetry.endSpan(this._activeTurnSpan, {
|
|
639
|
+
status: result?.error ? "error" : "ok",
|
|
640
|
+
error: result?.error,
|
|
641
|
+
attributes: { "skaile.turn.duration_ms": durationMs }
|
|
642
|
+
});
|
|
643
|
+
this._activeTurnSpan = void 0;
|
|
644
|
+
this._turnStartTime = void 0;
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
// bridge/src/registry.ts
|
|
649
|
+
var INCLUDE_CLAUDE_SDK = typeof __INCLUDE_CLAUDE_SDK__ === "undefined" ? true : __INCLUDE_CLAUDE_SDK__;
|
|
650
|
+
var INCLUDE_CODEX = typeof __INCLUDE_CODEX__ === "undefined" ? true : __INCLUDE_CODEX__;
|
|
651
|
+
var OMP_SURFACES = [
|
|
652
|
+
"anthropic-messages",
|
|
653
|
+
"openai-completions",
|
|
654
|
+
"openai-responses",
|
|
655
|
+
"openai-codex-responses",
|
|
656
|
+
"azure-openai-responses",
|
|
657
|
+
"bedrock-converse-stream",
|
|
658
|
+
"google-generative-ai",
|
|
659
|
+
"google-vertex"
|
|
660
|
+
];
|
|
661
|
+
var BUILTIN_DRIVER_CATALOG = {
|
|
662
|
+
omp: {
|
|
663
|
+
id: "omp",
|
|
664
|
+
name: "omp (oh-my-pi)",
|
|
665
|
+
modelAgnostic: true,
|
|
666
|
+
supportsInBandAbort: true,
|
|
667
|
+
surfaces: OMP_SURFACES,
|
|
668
|
+
// omp renders the whole registry as its own `models.yml`, so every entry
|
|
669
|
+
// stays selectable and roles / per-subagent models resolve across them.
|
|
670
|
+
providerPlurality: "registry"
|
|
671
|
+
},
|
|
672
|
+
"claude-sdk": {
|
|
673
|
+
id: "claude-sdk",
|
|
674
|
+
name: "Claude Agent SDK",
|
|
675
|
+
modelAgnostic: false,
|
|
676
|
+
supportsInBandAbort: true,
|
|
677
|
+
// Anthropic's own API, plus the two clouds the SDK addresses natively.
|
|
678
|
+
// Foundry is `anthropic-messages` at a different host, not a surface.
|
|
679
|
+
surfaces: ["anthropic-messages", "bedrock-converse-stream", "google-vertex"],
|
|
680
|
+
providerPlurality: "single"
|
|
681
|
+
},
|
|
682
|
+
codex: {
|
|
683
|
+
id: "codex",
|
|
684
|
+
name: "OpenAI Codex",
|
|
685
|
+
modelAgnostic: false,
|
|
686
|
+
supportsInBandAbort: true,
|
|
687
|
+
// Codex's `wire_api` is `responses` or `chat`; its subscription transport
|
|
688
|
+
// is the codex-specific responses flavour.
|
|
689
|
+
surfaces: ["openai-codex-responses", "openai-responses", "openai-completions"],
|
|
690
|
+
providerPlurality: "single"
|
|
691
|
+
},
|
|
692
|
+
echo: {
|
|
693
|
+
id: "echo",
|
|
694
|
+
name: "Echo (E2E mock)",
|
|
695
|
+
modelAgnostic: true,
|
|
696
|
+
supportsInBandAbort: false,
|
|
697
|
+
// Deterministic mock: it never opens a connection, so it speaks no wire
|
|
698
|
+
// surface and no registry entry can be dispatched to it.
|
|
699
|
+
surfaces: [],
|
|
700
|
+
providerPlurality: "single"
|
|
701
|
+
},
|
|
702
|
+
gemini: {
|
|
703
|
+
id: "gemini",
|
|
704
|
+
name: "Gemini CLI",
|
|
705
|
+
modelAgnostic: false,
|
|
706
|
+
supportsInBandAbort: false,
|
|
707
|
+
surfaces: ["google-generative-ai"],
|
|
708
|
+
providerPlurality: "single"
|
|
709
|
+
},
|
|
710
|
+
qwen: {
|
|
711
|
+
id: "qwen",
|
|
712
|
+
name: "Qwen Code",
|
|
713
|
+
modelAgnostic: true,
|
|
714
|
+
supportsInBandAbort: false,
|
|
715
|
+
// Driven entirely through OPENAI_BASE_URL / OPENAI_API_KEY.
|
|
716
|
+
surfaces: ["openai-completions"],
|
|
717
|
+
providerPlurality: "single"
|
|
718
|
+
},
|
|
719
|
+
opencode: {
|
|
720
|
+
id: "opencode",
|
|
721
|
+
name: "OpenCode",
|
|
722
|
+
modelAgnostic: true,
|
|
723
|
+
supportsInBandAbort: false,
|
|
724
|
+
surfaces: [
|
|
725
|
+
"anthropic-messages",
|
|
726
|
+
"openai-completions",
|
|
727
|
+
"openai-responses",
|
|
728
|
+
"google-generative-ai"
|
|
729
|
+
],
|
|
730
|
+
providerPlurality: "credentials-n"
|
|
731
|
+
},
|
|
732
|
+
goose: {
|
|
733
|
+
id: "goose",
|
|
734
|
+
name: "Goose",
|
|
735
|
+
modelAgnostic: true,
|
|
736
|
+
supportsInBandAbort: false,
|
|
737
|
+
surfaces: [
|
|
738
|
+
"anthropic-messages",
|
|
739
|
+
"openai-completions",
|
|
740
|
+
"google-generative-ai",
|
|
741
|
+
"bedrock-converse-stream"
|
|
742
|
+
],
|
|
743
|
+
providerPlurality: "credentials-n"
|
|
744
|
+
},
|
|
745
|
+
continue: {
|
|
746
|
+
id: "continue",
|
|
747
|
+
name: "Continue CLI",
|
|
748
|
+
modelAgnostic: true,
|
|
749
|
+
supportsInBandAbort: false,
|
|
750
|
+
surfaces: ["anthropic-messages", "openai-completions", "google-generative-ai"],
|
|
751
|
+
providerPlurality: "credentials-n"
|
|
752
|
+
}
|
|
753
|
+
};
|
|
754
|
+
var DRIVER_CATALOG = BUILTIN_DRIVER_CATALOG;
|
|
755
|
+
var _driversRegistered = false;
|
|
756
|
+
async function registerBuiltinDrivers(registry = pluginRegistry) {
|
|
757
|
+
if (registry === pluginRegistry && _driversRegistered) return;
|
|
758
|
+
if (!registry.get("driver", "omp")) {
|
|
759
|
+
const m = await import('./bridge/drivers/omp.js');
|
|
760
|
+
registry.register("driver", m.ompDriverTarget);
|
|
761
|
+
}
|
|
762
|
+
if (!registry.get("driver", "echo")) {
|
|
763
|
+
const m = await import('./bridge/drivers/echo.js');
|
|
764
|
+
registry.register("driver", m.echoDriverTarget);
|
|
765
|
+
}
|
|
766
|
+
if (INCLUDE_CLAUDE_SDK && !registry.get("driver", "claude-sdk")) {
|
|
767
|
+
const m = await import('./bridge/drivers/claude-sdk.js');
|
|
768
|
+
registry.register("driver", m.claudeSdkDriverTarget);
|
|
769
|
+
}
|
|
770
|
+
if (INCLUDE_CODEX && !registry.get("driver", "codex")) {
|
|
771
|
+
const m = await import('./bridge/drivers/codex.js');
|
|
772
|
+
registry.register("driver", m.codexDriverTarget);
|
|
773
|
+
}
|
|
774
|
+
if (!registry.get("driver", "gemini")) {
|
|
775
|
+
const m = await import('./bridge/drivers/gemini.js');
|
|
776
|
+
registry.register("driver", m.geminiDriverTarget);
|
|
777
|
+
}
|
|
778
|
+
if (!registry.get("driver", "qwen")) {
|
|
779
|
+
const m = await import('./bridge/drivers/qwen.js');
|
|
780
|
+
registry.register("driver", m.qwenDriverTarget);
|
|
781
|
+
}
|
|
782
|
+
if (!registry.get("driver", "opencode")) {
|
|
783
|
+
const m = await import('./bridge/drivers/opencode.js');
|
|
784
|
+
registry.register("driver", m.opencodeDriverTarget);
|
|
785
|
+
}
|
|
786
|
+
if (!registry.get("driver", "goose")) {
|
|
787
|
+
const m = await import('./bridge/drivers/goose.js');
|
|
788
|
+
registry.register("driver", m.gooseDriverTarget);
|
|
789
|
+
}
|
|
790
|
+
if (!registry.get("driver", "continue")) {
|
|
791
|
+
const m = await import('./bridge/drivers/continue.js');
|
|
792
|
+
registry.register("driver", m.continueDriverTarget);
|
|
793
|
+
}
|
|
794
|
+
if (registry === pluginRegistry) _driversRegistered = true;
|
|
795
|
+
}
|
|
796
|
+
async function createDriver(id, config, ctx) {
|
|
797
|
+
const target = await resolveDriverTarget(id);
|
|
798
|
+
return target.create(config, ctx ?? {});
|
|
799
|
+
}
|
|
800
|
+
async function resolveDriverTarget(id) {
|
|
801
|
+
await registerBuiltinDrivers();
|
|
802
|
+
const target = pluginRegistry.get("driver", id);
|
|
803
|
+
if (!target) {
|
|
804
|
+
if (id in BUILTIN_DRIVER_CATALOG) {
|
|
805
|
+
throw new Error(`Agent driver "${id}" is not bundled in this build.`);
|
|
806
|
+
}
|
|
807
|
+
throw new Error(
|
|
808
|
+
`Unknown agent driver: "${id}". Available: ${listDrivers().map((d) => d.id).join(", ")}`
|
|
809
|
+
);
|
|
810
|
+
}
|
|
811
|
+
return target;
|
|
812
|
+
}
|
|
813
|
+
function listDrivers() {
|
|
814
|
+
const merged = /* @__PURE__ */ new Map();
|
|
815
|
+
for (const info of Object.values(BUILTIN_DRIVER_CATALOG)) {
|
|
816
|
+
merged.set(info.id, info);
|
|
817
|
+
}
|
|
818
|
+
for (const meta of pluginRegistry.list("driver")) {
|
|
819
|
+
if (!merged.has(meta.id)) {
|
|
820
|
+
const target = pluginRegistry.get("driver", meta.id);
|
|
821
|
+
merged.set(meta.id, {
|
|
822
|
+
id: meta.id,
|
|
823
|
+
name: meta.displayName,
|
|
824
|
+
modelAgnostic: target?.modelAgnostic ?? false,
|
|
825
|
+
supportsInBandAbort: target?.supportsInBandAbort ?? false,
|
|
826
|
+
// Left absent when the target declares nothing: "speaks no surface" and
|
|
827
|
+
// "did not say" are different claims, and the platform resolver must be
|
|
828
|
+
// able to tell them apart before it filters a driver out.
|
|
829
|
+
...target?.surfaces ? { surfaces: target.surfaces } : {},
|
|
830
|
+
...target?.providerPlurality ? { providerPlurality: target.providerPlurality } : {}
|
|
831
|
+
});
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
return [...merged.values()];
|
|
835
|
+
}
|
|
836
|
+
async function listModelsForDriver(driverId, registry, options) {
|
|
837
|
+
const target = await resolveDriverTarget(driverId);
|
|
838
|
+
return await target.listModels?.(registry, options) ?? [];
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
export { AI_PROVIDER_PRESETS, AgentDriver, BUILTIN_DRIVER_CATALOG, DRIVER_CATALOG, PROVIDER_CREDENTIAL_ENV_PREFIX, PROVIDER_CREDENTIAL_ENV_SUFFIX, buildCredentialHeaders, catalogLayer, conventionalCredentialEnvName, createDriver, deriveRegistryFromLegacyApiKeys, entryCredentialEnv, entryCredentialValue, expandPreset, getBridgeLogger, getProviderPreset, listDrivers, listModelsForDriver, listProviderPresets, presetBaseUrl, probeProviderEntry, providerCredentialEnvName, registerBuiltinDrivers, registryCredentialEnv, registryDriverConfig, resolveEntryCredential, resolvePresetBaseUrl, resolveProbeUrl, toMergedRegistry };
|
|
842
|
+
//# sourceMappingURL=chunk-SG4D2UOK.js.map
|
|
843
|
+
//# sourceMappingURL=chunk-SG4D2UOK.js.map
|