@skaile/workspaces 6.10.0 → 6.12.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 +16 -0
- package/dist/app-sdk/index.js +1 -1
- package/dist/{asset-feeds-UG3PG423.js → asset-feeds-PO2WC75V.js} +13 -13
- package/dist/{asset-feeds-UG3PG423.js.map → asset-feeds-PO2WC75V.js.map} +1 -1
- package/dist/asset-manager/index.js +6 -6
- package/dist/asset-manager/installer.js +3 -3
- package/dist/asset-manager/renderers.js +2 -2
- package/dist/bridge/harnesses/claude-sdk.js +7 -7
- package/dist/bridge/harnesses/codex.js +5 -5
- package/dist/bridge/harnesses/continue.js +4 -4
- package/dist/bridge/harnesses/echo.js +4 -4
- package/dist/bridge/harnesses/gemini.js +7 -7
- package/dist/bridge/harnesses/goose.js +4 -4
- package/dist/bridge/harnesses/omp.js +41 -10
- package/dist/bridge/harnesses/omp.js.map +1 -1
- package/dist/bridge/harnesses/opencode.js +4 -4
- package/dist/bridge/harnesses/qwen.js +7 -7
- package/dist/bridge/index.js +11 -11
- package/dist/bridge/src/harnesses/omp.d.ts +13 -1
- package/dist/bridge/src/harnesses/omp.d.ts.map +1 -1
- package/dist/bridge/src/types.d.ts +7 -0
- package/dist/bridge/src/types.d.ts.map +1 -1
- package/dist/channels/adapters/msteams/activity.d.ts +2 -2
- package/dist/channels/adapters/msteams/activity.d.ts.map +1 -1
- package/dist/channels/adapters/msteams.js +21 -6
- package/dist/channels/adapters/msteams.js.map +1 -1
- package/dist/channels/index.js +175 -26
- package/dist/channels/index.js.map +1 -1
- package/dist/channels/src/context-batch.d.ts +63 -0
- package/dist/channels/src/context-batch.d.ts.map +1 -0
- package/dist/channels/src/egress/output-mirror.d.ts +7 -0
- package/dist/channels/src/egress/output-mirror.d.ts.map +1 -1
- package/dist/channels/src/engine.d.ts +21 -2
- package/dist/channels/src/engine.d.ts.map +1 -1
- package/dist/channels/src/index.d.ts +1 -0
- package/dist/channels/src/index.d.ts.map +1 -1
- package/dist/channels/src/ports.d.ts +9 -0
- package/dist/channels/src/ports.d.ts.map +1 -1
- package/dist/channels/src/types.d.ts +6 -0
- package/dist/channels/src/types.d.ts.map +1 -1
- package/dist/{chunk-7NN3P6VF.js → chunk-342UX2MG.js} +10 -5
- package/dist/chunk-342UX2MG.js.map +1 -0
- package/dist/{chunk-NTFP2XF4.js → chunk-45XL75RO.js} +9 -9
- package/dist/{chunk-NTFP2XF4.js.map → chunk-45XL75RO.js.map} +1 -1
- package/dist/{chunk-JDZUQFN7.js → chunk-4NJVF3DV.js} +4 -4
- package/dist/{chunk-JDZUQFN7.js.map → chunk-4NJVF3DV.js.map} +1 -1
- package/dist/{chunk-GA4GUDTL.js → chunk-5M3S6DLV.js} +3 -3
- package/dist/{chunk-GA4GUDTL.js.map → chunk-5M3S6DLV.js.map} +1 -1
- package/dist/{chunk-HE3TZYNG.js → chunk-5XYZNMMC.js} +4 -4
- package/dist/{chunk-HE3TZYNG.js.map → chunk-5XYZNMMC.js.map} +1 -1
- package/dist/{chunk-2U67XYZM.js → chunk-6NNXBXYI.js} +3 -3
- package/dist/{chunk-2U67XYZM.js.map → chunk-6NNXBXYI.js.map} +1 -1
- package/dist/{chunk-FXBKBOI5.js → chunk-7FXOOUOC.js} +4 -4
- package/dist/{chunk-FXBKBOI5.js.map → chunk-7FXOOUOC.js.map} +1 -1
- package/dist/{chunk-KRL53RZB.js → chunk-7LJUK5JK.js} +4 -4
- package/dist/{chunk-KRL53RZB.js.map → chunk-7LJUK5JK.js.map} +1 -1
- package/dist/{chunk-NCJSYU6A.js → chunk-7O6SCI7B.js} +5 -5
- package/dist/{chunk-NCJSYU6A.js.map → chunk-7O6SCI7B.js.map} +1 -1
- package/dist/{chunk-R3ZNAPBV.js → chunk-7VBD5XUM.js} +3 -3
- package/dist/{chunk-R3ZNAPBV.js.map → chunk-7VBD5XUM.js.map} +1 -1
- package/dist/{chunk-YEOG7CWQ.js → chunk-7ZL23M3X.js} +3 -3
- package/dist/{chunk-YEOG7CWQ.js.map → chunk-7ZL23M3X.js.map} +1 -1
- package/dist/{chunk-375HN3FD.js → chunk-CH6UVEM5.js} +9 -9
- package/dist/{chunk-375HN3FD.js.map → chunk-CH6UVEM5.js.map} +1 -1
- package/dist/{chunk-HQUF6O4B.js → chunk-CI4I34F4.js} +7 -7
- package/dist/{chunk-HQUF6O4B.js.map → chunk-CI4I34F4.js.map} +1 -1
- package/dist/{chunk-RTFH2QR2.js → chunk-CLMIZ4N6.js} +3 -3
- package/dist/{chunk-RTFH2QR2.js.map → chunk-CLMIZ4N6.js.map} +1 -1
- package/dist/{chunk-QBJQ426X.js → chunk-DKRD6CZL.js} +3 -3
- package/dist/{chunk-QBJQ426X.js.map → chunk-DKRD6CZL.js.map} +1 -1
- package/dist/{chunk-RZ5R6GDJ.js → chunk-DRUAQ7IY.js} +3 -3
- package/dist/{chunk-RZ5R6GDJ.js.map → chunk-DRUAQ7IY.js.map} +1 -1
- package/dist/{chunk-3AIEJSQR.js → chunk-ESUF2ZYT.js} +3 -3
- package/dist/{chunk-3AIEJSQR.js.map → chunk-ESUF2ZYT.js.map} +1 -1
- package/dist/{chunk-C5UKYTTD.js → chunk-FECB7RI7.js} +9 -9
- package/dist/{chunk-C5UKYTTD.js.map → chunk-FECB7RI7.js.map} +1 -1
- package/dist/{chunk-4Z4RULWQ.js → chunk-FO2GU5L7.js} +196 -35
- package/dist/chunk-FO2GU5L7.js.map +1 -0
- package/dist/{chunk-2D6HZAO5.js → chunk-FVOQPTK2.js} +3 -3
- package/dist/{chunk-2D6HZAO5.js.map → chunk-FVOQPTK2.js.map} +1 -1
- package/dist/{chunk-5JBMYZNA.js → chunk-GODUKPGD.js} +3 -3
- package/dist/{chunk-5JBMYZNA.js.map → chunk-GODUKPGD.js.map} +1 -1
- package/dist/{chunk-7DUOKE73.js → chunk-GQQIMKEP.js} +11 -11
- package/dist/{chunk-7DUOKE73.js.map → chunk-GQQIMKEP.js.map} +1 -1
- package/dist/{chunk-BRPEW3UL.js → chunk-GYRIO6RA.js} +3 -3
- package/dist/{chunk-BRPEW3UL.js.map → chunk-GYRIO6RA.js.map} +1 -1
- package/dist/{chunk-DOMRBOJZ.js → chunk-HPQ2WDYC.js} +4 -4
- package/dist/{chunk-DOMRBOJZ.js.map → chunk-HPQ2WDYC.js.map} +1 -1
- package/dist/{chunk-4I4SBOCS.js → chunk-IIELRGIZ.js} +7 -7
- package/dist/{chunk-4I4SBOCS.js.map → chunk-IIELRGIZ.js.map} +1 -1
- package/dist/{chunk-6PVRP3LW.js → chunk-IPCRQWNC.js} +17 -6
- package/dist/chunk-IPCRQWNC.js.map +1 -0
- package/dist/{chunk-5KQFR4D7.js → chunk-L74W5TVC.js} +4 -4
- package/dist/{chunk-5KQFR4D7.js.map → chunk-L74W5TVC.js.map} +1 -1
- package/dist/{chunk-WS3BOCAT.js → chunk-LCXQ4LVP.js} +16 -3
- package/dist/chunk-LCXQ4LVP.js.map +1 -0
- package/dist/{chunk-2MUUPRIG.js → chunk-LXD37LHF.js} +4 -4
- package/dist/{chunk-2MUUPRIG.js.map → chunk-LXD37LHF.js.map} +1 -1
- package/dist/{chunk-PSPFWTJI.js → chunk-MRTOKIEJ.js} +3 -3
- package/dist/{chunk-PSPFWTJI.js.map → chunk-MRTOKIEJ.js.map} +1 -1
- package/dist/{chunk-NFFBYG2W.js → chunk-PZS55HOX.js} +3 -3
- package/dist/{chunk-NFFBYG2W.js.map → chunk-PZS55HOX.js.map} +1 -1
- package/dist/{chunk-XDVR7QIT.js → chunk-QC4Q7PMQ.js} +6 -3
- package/dist/chunk-QC4Q7PMQ.js.map +1 -0
- package/dist/{chunk-5P7LTPBR.js → chunk-RRKJHADP.js} +3 -3
- package/dist/{chunk-5P7LTPBR.js.map → chunk-RRKJHADP.js.map} +1 -1
- package/dist/{chunk-6O7VDKX3.js → chunk-RZQCBFIU.js} +2 -2
- package/dist/{chunk-6O7VDKX3.js.map → chunk-RZQCBFIU.js.map} +1 -1
- package/dist/{chunk-KE5HDORU.js → chunk-S6NS3I3P.js} +2 -2
- package/dist/{chunk-KE5HDORU.js.map → chunk-S6NS3I3P.js.map} +1 -1
- package/dist/{chunk-XWCV2A2F.js → chunk-SZ3XCZHC.js} +3 -3
- package/dist/{chunk-XWCV2A2F.js.map → chunk-SZ3XCZHC.js.map} +1 -1
- package/dist/{chunk-SKG6G4HO.js → chunk-UHTCOYFJ.js} +7 -7
- package/dist/{chunk-SKG6G4HO.js.map → chunk-UHTCOYFJ.js.map} +1 -1
- package/dist/{chunk-F2IBDVBP.js → chunk-VHRGCLCR.js} +2 -2
- package/dist/{chunk-F2IBDVBP.js.map → chunk-VHRGCLCR.js.map} +1 -1
- package/dist/{chunk-HLFLET7S.js → chunk-WCHGUS7X.js} +5 -5
- package/dist/{chunk-HLFLET7S.js.map → chunk-WCHGUS7X.js.map} +1 -1
- package/dist/{chunk-IMO4EHND.js → chunk-WPTNYDDS.js} +4 -4
- package/dist/{chunk-IMO4EHND.js.map → chunk-WPTNYDDS.js.map} +1 -1
- package/dist/{chunk-BCID52M5.js → chunk-YPX7LQSW.js} +7 -7
- package/dist/{chunk-BCID52M5.js.map → chunk-YPX7LQSW.js.map} +1 -1
- package/dist/{chunk-PTXQMTCG.js → chunk-ZRKU7BRI.js} +3 -3
- package/dist/{chunk-PTXQMTCG.js.map → chunk-ZRKU7BRI.js.map} +1 -1
- package/dist/{claude-code-CMFGCDMX.js → claude-code-TDMSETH6.js} +4 -4
- package/dist/{claude-code-CMFGCDMX.js.map → claude-code-TDMSETH6.js.map} +1 -1
- package/dist/cli/index.js +63 -63
- package/dist/client/index.js +1 -1
- package/dist/client/src/client.d.ts +3 -0
- package/dist/client/src/client.d.ts.map +1 -1
- package/dist/connectors/index.js +13 -13
- package/dist/{connectors-P5M2D4MH.js → connectors-IUJRBTCW.js} +16 -16
- package/dist/{connectors-P5M2D4MH.js.map → connectors-IUJRBTCW.js.map} +1 -1
- package/dist/connectors-shared/index.js +2 -2
- package/dist/discovery/index.js +2 -2
- package/dist/{ensure-sources-MOGLBEUF.js → ensure-sources-Q2TTZVLX.js} +19 -19
- package/dist/{ensure-sources-MOGLBEUF.js.map → ensure-sources-Q2TTZVLX.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +13 -13
- package/dist/factory-assets/connectors/deploy.js +13 -13
- package/dist/factory-assets/connectors/devserver.js +13 -13
- package/dist/factory-assets/connectors/flow/adapter.js +13 -13
- package/dist/factory-assets/connectors/flow/run-flow.js +14 -14
- package/dist/factory-assets/connectors/flow.js +13 -13
- package/dist/factory-assets/connectors/git.js +13 -13
- package/dist/factory-assets/connectors/gmail.js +13 -13
- package/dist/factory-assets/connectors/googledrive.js +13 -13
- package/dist/factory-assets/connectors/local.js +13 -13
- package/dist/factory-assets/connectors/mattermost.js +13 -13
- package/dist/factory-assets/connectors/memory.js +13 -13
- package/dist/factory-assets/connectors/minio.js +13 -13
- package/dist/factory-assets/connectors/postgres.js +13 -13
- package/dist/factory-assets/connectors/s3.js +13 -13
- package/dist/factory-assets/connectors/sharepoint.js +13 -13
- package/dist/factory-assets/connectors/sqlite.js +13 -13
- package/dist/factory-assets/connectors/static-server.js +13 -13
- package/dist/factory-assets/connectors/tunnel.js +13 -13
- package/dist/factory-assets/connectors/webdav.js +13 -13
- package/dist/factory-assets/connectors/xstate-store.js +13 -13
- package/dist/factory-assets/connectors/xstate.js +13 -13
- package/dist/{helpers-JL5AEGDT.js → helpers-S6AQGXRH.js} +19 -19
- package/dist/{helpers-JL5AEGDT.js.map → helpers-S6AQGXRH.js.map} +1 -1
- package/dist/library/index.js +3 -3
- package/dist/{library-publish-DZNNZNMB.js → library-publish-7U4TJNQX.js} +33 -33
- package/dist/{library-publish-DZNNZNMB.js.map → library-publish-7U4TJNQX.js.map} +1 -1
- package/dist/model-endpoint/index.js +3 -3
- package/dist/{open-library-OJREQ22B.js → open-library-K6O6OVW5.js} +21 -21
- package/dist/{open-library-OJREQ22B.js.map → open-library-K6O6OVW5.js.map} +1 -1
- package/dist/{open-registry-OEU6QUK2.js → open-registry-4HNCWOCN.js} +6 -6
- package/dist/{open-registry-OEU6QUK2.js.map → open-registry-4HNCWOCN.js.map} +1 -1
- package/dist/{project-52UABBD5.js → project-ZWIZZIUT.js} +29 -29
- package/dist/{project-52UABBD5.js.map → project-ZWIZZIUT.js.map} +1 -1
- package/dist/runner/index.js +21 -21
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/turn-ids.d.ts +70 -0
- package/dist/runner/src/turn-ids.d.ts.map +1 -0
- package/dist/runner/src/turn-scheduler.d.ts +7 -0
- package/dist/runner/src/turn-scheduler.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +6 -6
- package/dist/sdk/bridge.js +11 -11
- package/dist/sdk/client.js +1 -1
- package/dist/sdk/index.js +22 -22
- package/dist/sdk/runner.js +21 -21
- package/dist/sdk/session.js +2 -2
- package/dist/sdk/types.js +1 -1
- package/dist/{serve-preflight-HOQ7CGYR.js → serve-preflight-E3IEZTTF.js} +21 -21
- package/dist/{serve-preflight-HOQ7CGYR.js.map → serve-preflight-E3IEZTTF.js.map} +1 -1
- package/dist/session/index.js +2 -2
- package/dist/session/src/dispatcher.d.ts +4 -1
- package/dist/session/src/dispatcher.d.ts.map +1 -1
- package/dist/{setup-JIDZ372C.js → setup-V4EXOMVQ.js} +20 -20
- package/dist/{setup-JIDZ372C.js.map → setup-V4EXOMVQ.js.map} +1 -1
- package/dist/{source-P6ZFSSZZ.js → source-O7XXDX55.js} +31 -31
- package/dist/{source-P6ZFSSZZ.js.map → source-O7XXDX55.js.map} +1 -1
- package/dist/{source-manifest-publish-Y36FHVDS.js → source-manifest-publish-GUU4LX2S.js} +33 -33
- package/dist/{source-manifest-publish-Y36FHVDS.js.map → source-manifest-publish-GUU4LX2S.js.map} +1 -1
- package/dist/tui/index.js +21 -21
- package/dist/types/index.js +1 -1
- package/dist/types/manifests.js +1 -1
- package/dist/types/src/capabilities.d.ts +2 -1
- package/dist/types/src/capabilities.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +2 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/manifests/agent.d.ts +2 -0
- package/dist/types/src/manifests/agent.d.ts.map +1 -1
- package/dist/types/src/protocol.d.ts +2 -0
- package/dist/types/src/protocol.d.ts.map +1 -1
- package/dist/types/src/turn-ids.d.ts +62 -0
- package/dist/types/src/turn-ids.d.ts.map +1 -0
- package/dist/types/src/version.d.ts +12 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +15 -15
- package/dist/workspace-plugin/adapters/omp.js +7 -7
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-4Z4RULWQ.js.map +0 -1
- package/dist/chunk-6PVRP3LW.js.map +0 -1
- package/dist/chunk-7NN3P6VF.js.map +0 -1
- package/dist/chunk-WS3BOCAT.js.map +0 -1
- package/dist/chunk-XDVR7QIT.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getProviderPreset, resolvePresetBaseUrl, expandPreset, resolveProbeUrl, buildCredentialHeaders, presetBaseUrl } from './chunk-6UP2EDFN.js';
|
|
2
|
-
import { modelIdSchemaForTarget } from './chunk-
|
|
2
|
+
import { modelIdSchemaForTarget } from './chunk-LCXQ4LVP.js';
|
|
3
3
|
import { resolveEntryBaseUrl, entryTransport, parseModelRef, registryEntries } from './chunk-RXGPFAMN.js';
|
|
4
4
|
|
|
5
5
|
// bridge/src/models.ts
|
|
@@ -323,5 +323,5 @@ function resolveModelTier(tier, sessionModel, options = {}) {
|
|
|
323
323
|
}
|
|
324
324
|
|
|
325
325
|
export { ModelTierResolutionError, PROVIDER_MODEL_TIERS, STATIC_MODELS, fetchProviderModels, getModels, getStaticModels, modelIdTargetForEntry, resolveManifestModel, resolveModelCapabilities, resolveModelTier };
|
|
326
|
-
//# sourceMappingURL=chunk-
|
|
327
|
-
//# sourceMappingURL=chunk-
|
|
326
|
+
//# sourceMappingURL=chunk-ESUF2ZYT.js.map
|
|
327
|
+
//# sourceMappingURL=chunk-ESUF2ZYT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../bridge/src/models.ts"],"names":[],"mappings":";;;;;AAmDA,SAAS,SAAS,EAAA,EAAoB;AACpC,EAAA,OAAO,EAAA,CACJ,OAAA,CAAQ,4BAAA,EAA8B,EAAE,EACxC,OAAA,CAAQ,OAAA,EAAS,GAAG,CAAA,CACpB,QAAQ,OAAA,EAAS,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa,CAAA;AAC5C;AAMA,SAAS,kBAAkB,EAAA,EAAqB;AAC9C,EAAA,MAAM,IAAA,GAAO,gEAAA;AACb,EAAA,OAAO,CAAC,IAAA,CAAK,IAAA,CAAK,EAAE,CAAA;AACtB;AAKA,IAAM,gBAAA,GAAgD;AAAA,EACpD,SAAA,EAAW,CAAC,IAAA,KAAS;AACnB,IAAA,MAAM,MAAA,GAAS,IAAA,EAAM,IAAA,IAAQ,EAAC;AAC9B,IAAA,OAAO,MAAA,CACJ,MAAA,CAAO,CAAC,CAAA,KAAW,EAAE,EAAA,IAAM,CAAC,CAAA,CAAE,EAAA,CAAG,SAAS,OAAO,CAAC,CAAA,CAClD,GAAA,CAAI,CAAC,CAAA,MAAY;AAAA,MAChB,IAAI,CAAA,CAAE,EAAA;AAAA,MACN,IAAA,EAAM,CAAA,CAAE,YAAA,IAAgB,QAAA,CAAS,EAAE,EAAE;AAAA,KACvC,CAAE,CAAA;AAAA,EACN,CAAA;AAAA,EACA,MAAA,EAAQ,CAAC,IAAA,KAAS;AAChB,IAAA,MAAM,MAAA,GAAS,IAAA,EAAM,IAAA,IAAQ,EAAC;AAC9B,IAAA,OAAO,MAAA,CACJ,MAAA,CAAO,CAAC,CAAA,KAAW,EAAE,EAAA,IAAM,iBAAA,CAAkB,CAAA,CAAE,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AAA,IACnB,YAAA,IACA,2BAA2B,SAAA,EAAW,OAAO,KAC7C,OAAA,EAAS,OAAA;AAEb","file":"chunk-3AIEJSQR.js","sourcesContent":["/**\n * Model catalog — static fallback + live provider API fetching.\n *\n * Provides `fetchProviderModels(provider, apiKey)` for live model lists and\n * `getStaticModels(provider)` as an offline fallback.\n * OMP model listing is handled by `OmpHarness.listModels()` in the bridge harness.\n */\n\nimport {\n type AIProviderCapabilities,\n type AIProviderLlmEntry,\n type AIProviderRegistry,\n entryTransport,\n type MergedAIProviderRegistry,\n parseModelRef,\n registryEntries,\n resolveEntryBaseUrl,\n} from \"@skaile/workspaces/core/provider-registry\";\nimport { type ModelIdTarget, modelIdSchemaForTarget } from \"@skaile/workspaces/types/manifests\";\nimport {\n buildCredentialHeaders,\n expandPreset,\n getProviderPreset,\n presetBaseUrl,\n resolvePresetBaseUrl,\n resolveProbeUrl,\n} from \"./provider-catalog.js\";\n\n/**\n * A single LLM model entry returned by the model catalog.\n *\n * Used by `getModels`, `getStaticModels`, and `fetchProviderModels` to represent\n * an available model for a provider.\n *\n * @docLink packages/bridge/api-reference#models\n */\nexport interface ModelEntry {\n /** Provider-specific model identifier used in API calls (e.g. `\"claude-sonnet-4-5\"`). */\n id: string;\n /** Human-readable display name for UIs and logs (e.g. `\"Claude Sonnet 4.5\"`). */\n name: string;\n}\n\n// ---------------------------------------------------------------------------\n// Provider API configs (for fetching model lists)\n// ---------------------------------------------------------------------------\n\n/** Extract ModelEntry[] from a provider's parsed models-list JSON response. */\ntype ParseModels = (body: any) => ModelEntry[];\n\n/** Humanize a model ID into a display name (e.g. \"claude-sonnet-4-6\" → \"Claude Sonnet 4 6\") */\nfunction humanize(id: string): string {\n return id\n .replace(/^accounts\\/[^/]+\\/models\\//, \"\")\n .replace(/[-_]/g, \" \")\n .replace(/\\b\\w/g, (c) => c.toUpperCase());\n}\n\n/**\n * Filter function used by providers that return the OpenAI-style /v1/models list.\n * Keeps only chat/completion models, skips embeddings, moderation, tts, whisper, dall-e, etc.\n */\nfunction isLikelyChatModel(id: string): boolean {\n const skip = /embed|moderat|tts|whisper|dall-e|davinci|babbage|ada-00|text-/i;\n return !skip.test(id);\n}\n\n// Per-provider response parsers. The endpoint URL and the credential header\n// come from the catalog preset (provider-catalog.ts), joined in\n// fetchProviderModels.\nconst PROVIDER_PARSERS: Record<string, ParseModels> = {\n anthropic: (body) => {\n const models = body?.data ?? [];\n return models\n .filter((m: any) => m.id && !m.id.includes(\"embed\"))\n .map((m: any) => ({\n id: m.id,\n name: m.display_name ?? humanize(m.id),\n }));\n },\n openai: (body) => {\n const models = body?.data ?? [];\n return models\n .filter((m: any) => m.id && isLikelyChatModel(m.id))\n .map((m: any) => ({ id: m.id, name: humanize(m.id) }))\n .sort((a: ModelEntry, b: ModelEntry) => a.id.localeCompare(b.id));\n },\n openrouter: (body) => {\n const models = body?.data ?? [];\n return models\n .filter((m: any) => m.id)\n .map((m: any) => ({ id: m.id, name: m.name ?? humanize(m.id) }))\n .sort((a: ModelEntry, b: ModelEntry) => a.id.localeCompare(b.id));\n },\n mistral: (body) => {\n const models = body?.data ?? [];\n return models\n .filter((m: any) => m.id && isLikelyChatModel(m.id))\n .map((m: any) => ({ id: m.id, name: humanize(m.id) }))\n .sort((a: ModelEntry, b: ModelEntry) => a.id.localeCompare(b.id));\n },\n groq: (body) => {\n const models = body?.data ?? [];\n return models\n .filter((m: any) => m.id && isLikelyChatModel(m.id))\n .map((m: any) => ({ id: m.id, name: humanize(m.id) }))\n .sort((a: ModelEntry, b: ModelEntry) => a.id.localeCompare(b.id));\n },\n deepseek: (body) => {\n const models = body?.data ?? [];\n return models\n .map((m: any) => ({ id: m.id, name: humanize(m.id) }))\n .sort((a: ModelEntry, b: ModelEntry) => a.id.localeCompare(b.id));\n },\n xai: (body) => {\n const models = body?.data ?? [];\n return models\n .filter((m: any) => m.id && isLikelyChatModel(m.id))\n .map((m: any) => ({ id: m.id, name: humanize(m.id) }))\n .sort((a: ModelEntry, b: ModelEntry) => a.id.localeCompare(b.id));\n },\n together: (body) => {\n const models = body?.data ?? body ?? [];\n const arr = Array.isArray(models) ? models : [];\n return arr\n .filter((m: any) => m.id && m.type === \"chat\")\n .map((m: any) => ({ id: m.id, name: m.display_name ?? humanize(m.id) }))\n .sort((a: ModelEntry, b: ModelEntry) => a.id.localeCompare(b.id));\n },\n fireworks: (body) => {\n const models = body?.data ?? [];\n return models\n .map((m: any) => ({ id: m.id, name: humanize(m.id) }))\n .sort((a: ModelEntry, b: ModelEntry) => a.id.localeCompare(b.id));\n },\n google: (body) => {\n const models = body?.models ?? [];\n return models\n .filter((m: any) => m.supportedGenerationMethods?.includes(\"generateContent\"))\n .map((m: any) => ({\n id: (m.name ?? \"\").replace(/^models\\//, \"\"),\n name: m.displayName ?? humanize(m.name ?? \"\"),\n }))\n .sort((a: ModelEntry, b: ModelEntry) => a.id.localeCompare(b.id));\n },\n};\n\n// ---------------------------------------------------------------------------\n// Live fetch\n// ---------------------------------------------------------------------------\n\n/**\n * Result of a model-list fetch operation, with source attribution.\n *\n * Returned by {@link fetchProviderModels} and {@link getModels}. When `ok` is `false`,\n * `models` is empty and `error` describes the failure. The `source` field indicates\n * whether the list came from a live API call or the offline static catalog.\n *\n * @docLink packages/bridge/api-reference#models\n */\nexport interface FetchModelsResult {\n /** `true` when the fetch succeeded and `models` is populated. */\n ok: boolean;\n /** Fetched model list; empty on failure. */\n models: ModelEntry[];\n /** Human-readable error description when `ok` is `false`. */\n error?: string;\n /** Whether the result came from a live API call or the static fallback. */\n source: \"api\" | \"static\";\n}\n\n/**\n * Options controlling where a model-list fetch is addressed.\n *\n * @since 1.5.0\n */\nexport interface FetchModelsOptions {\n /**\n * Base URL to resolve the provider's models endpoint against — e.g. the\n * gateway a session already routes completions through. Overrides the\n * provider's `baseUrlEnv` value.\n */\n baseUrl?: string;\n /**\n * Environment consulted for the provider's base-URL env var\n * (`ANTHROPIC_BASE_URL` for `anthropic`). Defaults to `process.env`; pass an\n * explicit record to keep a call hermetic.\n */\n env?: Record<string, string | undefined>;\n}\n\n/**\n * Fetch the model list from a provider's REST API.\n *\n * Returns `{ ok: true, models, source: 'api' }` on success, or\n * `{ ok: false, models: [], error }` on any HTTP or network failure — the\n * caller should fall back to {@link getStaticModels} in that case.\n *\n * The endpoint, the credential header and the response path all come from the\n * catalog preset named by `provider` ({@link resolvePresetBaseUrl},\n * {@link resolveProbeUrl}, {@link buildCredentialHeaders}), so discovery hits\n * the same host dispatch does — including a gateway named by `baseUrl` or by\n * the vendor's own `*_BASE_URL` variable.\n *\n * @param provider - Catalog preset id (e.g. `\"anthropic\"`, `\"openai\"`, `\"google\"`).\n * @param apiKey - API key presented in the preset's credential header.\n * @param options - Optional base-URL / environment overrides.\n * @returns Resolved model list with source attribution.\n * @docLink packages/bridge/api-reference#models\n */\nexport async function fetchProviderModels(\n provider: string,\n apiKey: string,\n options: FetchModelsOptions = {},\n): Promise<FetchModelsResult> {\n const preset = getProviderPreset(provider);\n const parse = PROVIDER_PARSERS[provider];\n if (!preset || !parse) {\n return {\n ok: false,\n models: [],\n error: `No API config for provider: ${provider}`,\n source: \"static\",\n };\n }\n\n const baseUrl = resolvePresetBaseUrl(preset, {\n ...(options.baseUrl ? { baseUrl: options.baseUrl } : {}),\n env: options.env ?? process.env,\n });\n const entry = expandPreset(preset, baseUrl ? { baseUrl } : {});\n const url = resolveProbeUrl(entry);\n if (!url) {\n return {\n ok: false,\n models: [],\n error: `Provider ${provider} exposes no models endpoint`,\n source: \"static\",\n };\n }\n // Static non-secret headers (Anthropic's `anthropic-version`) plus the\n // credential carrier the preset's `auth_header` names.\n const headers = { ...entry.headers, ...buildCredentialHeaders(entry, apiKey) };\n\n try {\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), 10_000);\n\n const response = await fetch(url, {\n method: \"GET\",\n headers,\n signal: controller.signal,\n });\n\n clearTimeout(timeout);\n\n if (!response.ok) {\n return {\n ok: false,\n models: [],\n error: `API returned HTTP ${response.status}`,\n source: \"static\",\n };\n }\n\n const body = await response.json();\n const models = parse(body);\n\n return { ok: true, models, source: \"api\" };\n } catch (err: any) {\n const msg =\n err.name === \"AbortError\" ? \"Request timed out (10s)\" : (err.message ?? \"Network error\");\n return { ok: false, models: [], error: msg, source: \"static\" };\n }\n}\n\n/**\n * Get models for a provider, trying the live API first and falling back to the static catalog.\n *\n * When no `apiKey` is provided the static catalog is returned immediately without\n * a network call. When the live API fails or returns an empty list, the static\n * catalog is used as a fallback — the result's `source` field indicates which was used.\n *\n * @param provider - Provider name (e.g. `\"anthropic\"`, `\"openai\"`, `\"google\"`).\n * @param apiKey - Optional API key; omit to skip the live fetch and use the static catalog.\n * @param options - Optional base-URL / environment overrides (see {@link FetchModelsOptions}).\n * @returns Resolved model list with source attribution.\n * @docLink packages/bridge/api-reference#models\n */\nexport async function getModels(\n provider: string,\n apiKey?: string,\n options: FetchModelsOptions = {},\n): Promise<FetchModelsResult> {\n if (!apiKey) {\n const models = getStaticModels(provider);\n return { ok: true, models, source: \"static\" };\n }\n\n const result = await fetchProviderModels(provider, apiKey, options);\n if (result.ok && result.models.length > 0) {\n return result;\n }\n\n // Fall back to static\n const staticModels = getStaticModels(provider);\n if (staticModels.length > 0) {\n return { ok: true, models: staticModels, source: \"static\", error: result.error };\n }\n\n return result;\n}\n\n// ---------------------------------------------------------------------------\n// Static catalog (offline fallback)\n// ---------------------------------------------------------------------------\n\n/**\n * Offline model catalog keyed by provider name.\n *\n * Used as a fallback by {@link getModels} when the live provider API is unreachable or\n * returns an empty list. Covers Anthropic, OpenAI, Google, Mistral, Groq, DeepSeek,\n * xAI, Together, Fireworks, and OpenRouter. Update this list when providers add new\n * models and a live fetch is not available.\n *\n * @docLink packages/bridge/api-reference#models\n */\nexport const STATIC_MODELS: Record<string, ModelEntry[]> = {\n anthropic: [\n { id: \"claude-opus-4-6\", name: \"Claude Opus 4.6\" },\n { id: \"claude-sonnet-4-6\", name: \"Claude Sonnet 4.6\" },\n { id: \"claude-haiku-4-5-20251001\", name: \"Claude Haiku 4.5\" },\n { id: \"claude-opus-4-5\", name: \"Claude Opus 4.5\" },\n { id: \"claude-sonnet-4-5\", name: \"Claude Sonnet 4.5\" },\n ],\n openai: [\n { id: \"gpt-4o\", name: \"GPT-4o\" },\n { id: \"gpt-4o-mini\", name: \"GPT-4o Mini\" },\n { id: \"gpt-4.1\", name: \"GPT-4.1\" },\n { id: \"gpt-4.1-mini\", name: \"GPT-4.1 Mini\" },\n { id: \"o3\", name: \"o3\" },\n { id: \"o4-mini\", name: \"o4-mini\" },\n ],\n google: [\n { id: \"gemini-2.5-pro\", name: \"Gemini 2.5 Pro\" },\n { id: \"gemini-2.5-flash\", name: \"Gemini 2.5 Flash\" },\n { id: \"gemini-2.0-flash\", name: \"Gemini 2.0 Flash\" },\n ],\n mistral: [\n { id: \"mistral-large-latest\", name: \"Mistral Large\" },\n { id: \"mistral-small-latest\", name: \"Mistral Small\" },\n { id: \"codestral-latest\", name: \"Codestral\" },\n ],\n groq: [\n { id: \"llama-3.3-70b-versatile\", name: \"Llama 3.3 70B\" },\n { id: \"llama-3.1-8b-instant\", name: \"Llama 3.1 8B\" },\n { id: \"mixtral-8x7b-32768\", name: \"Mixtral 8x7B\" },\n ],\n deepseek: [\n { id: \"deepseek-chat\", name: \"DeepSeek Chat\" },\n { id: \"deepseek-reasoner\", name: \"DeepSeek Reasoner\" },\n ],\n xai: [\n { id: \"grok-3\", name: \"Grok 3\" },\n { id: \"grok-3-mini\", name: \"Grok 3 Mini\" },\n ],\n together: [\n { id: \"meta-llama/Llama-3.3-70B-Instruct-Turbo\", name: \"Llama 3.3 70B Turbo\" },\n { id: \"mistralai/Mixtral-8x7B-Instruct-v0.1\", name: \"Mixtral 8x7B\" },\n ],\n fireworks: [\n { id: \"accounts/fireworks/models/llama-v3p3-70b-instruct\", name: \"Llama 3.3 70B\" },\n { id: \"accounts/fireworks/models/deepseek-v3\", name: \"DeepSeek v3\" },\n ],\n openrouter: [\n { id: \"anthropic/claude-sonnet-4.6\", name: \"Claude Sonnet 4.6\" },\n { id: \"anthropic/claude-opus-4.6\", name: \"Claude Opus 4.6\" },\n { id: \"anthropic/claude-haiku-4.5\", name: \"Claude Haiku 4.5\" },\n { id: \"anthropic/claude-sonnet-4.5\", name: \"Claude Sonnet 4.5\" },\n { id: \"anthropic/claude-3.7-sonnet\", name: \"Claude 3.7 Sonnet\" },\n { id: \"openai/gpt-4o\", name: \"GPT-4o\" },\n { id: \"openai/gpt-4.1\", name: \"GPT-4.1\" },\n { id: \"openai/gpt-4.1-mini\", name: \"GPT-4.1 Mini\" },\n { id: \"google/gemini-2.5-pro\", name: \"Gemini 2.5 Pro\" },\n { id: \"google/gemini-2.5-flash\", name: \"Gemini 2.5 Flash\" },\n { id: \"meta-llama/llama-4-maverick\", name: \"Llama 4 Maverick\" },\n { id: \"meta-llama/llama-3.3-70b-instruct\", name: \"Llama 3.3 70B\" },\n { id: \"deepseek/deepseek-chat-v3-0324\", name: \"DeepSeek v3\" },\n { id: \"deepseek/deepseek-r1\", name: \"DeepSeek R1\" },\n { id: \"mistralai/mistral-large-2411\", name: \"Mistral Large 2\" },\n ],\n};\n\n/**\n * Get models for a specific provider from the static catalog, or empty array if unknown.\n *\n * Pure synchronous lookup — no network call. Use when the provider API is unavailable\n * or when a fast offline fallback is needed (e.g. in the UI before credentials are configured).\n *\n * @param provider - Provider name matching a key in {@link STATIC_MODELS}.\n * @returns Offline model list, or `[]` for unknown providers.\n * @docLink packages/bridge/api-reference#models\n */\nexport function getStaticModels(provider: string): ModelEntry[] {\n return STATIC_MODELS[provider] ?? [];\n}\n\n// ---------------------------------------------------------------------------\n// Registry-backed model identity (§2.4)\n// ---------------------------------------------------------------------------\n\n/** A registry in either of the two shapes consumers hold. */\nexport type ProviderRegistryView = AIProviderRegistry | MergedAIProviderRegistry;\n\n/**\n * Where a model selector is resolved. `registry` absent means no registry is\n * configured at all — every resolver here then returns `undefined` and the\n * caller keeps its pre-registry behaviour.\n */\nexport interface ModelRegistryContext {\n /** The merged registry (`mergeRegistries`), or a single layer. */\n registry?: ProviderRegistryView;\n /** `skaile.yaml` `roles`: role name → model selector (`smol` → `groq/llama-3.1-8b`). */\n roles?: Record<string, string>;\n /**\n * Entry the session already runs on. Scopes `model_map` lookups to it;\n * absent lets the selector pick in registry order.\n */\n providerId?: string;\n}\n\n/** The `llm`/`embed` entry registered under `id`, if any. */\nfunction llmEntry(registry: ProviderRegistryView, id: string): AIProviderLlmEntry | undefined {\n const entry = registryEntries(registry).find(([entryId]) => entryId === id)?.[1];\n if (!entry || (entry.kind !== \"llm\" && entry.kind !== \"embed\")) return undefined;\n return entry;\n}\n\n/**\n * The wire facts that decide which model-id vocabulary an entry enforces\n * (`modelIdSchemaForTarget`).\n *\n * `surface` and `base_url` fall back to the entry's preset: an entry written as\n * `{kind: llm, preset: anthropic}` carries neither of its own until the catalog\n * merge layer expands it, and validation must not depend on having been handed\n * a merged registry.\n */\nexport function modelIdTargetForEntry(entry: AIProviderLlmEntry): ModelIdTarget {\n const preset = entry.preset ? getProviderPreset(entry.preset) : undefined;\n const surface = entry.surface ?? preset?.surface;\n const base_url = resolveEntryBaseUrl(entry) ?? (preset ? presetBaseUrl(preset) : undefined);\n return {\n ...(surface ? { surface } : {}),\n ...(entryTransport(entry) ? { transport: entryTransport(entry) } : {}),\n ...(base_url ? { base_url } : {}),\n };\n}\n\n/** A manifest model preference resolved against the registry. */\nexport interface ResolvedManifestModel {\n /** Entry the preference routes to. */\n providerId: string;\n /** Logical id, after `@role` expansion and before `model_map`. */\n modelId?: string;\n /** Provider-side id — what goes on the wire: `model_map[modelId] ?? modelId`. */\n providerModelId?: string;\n /** Role name, when the preference was `@role`. */\n role?: string;\n /** The wire target `providerModelId` was checked against. */\n target: ModelIdTarget;\n /** Non-fatal notes: a dangling role, a disabled provider, a stale preset. */\n warnings: string[];\n /**\n * Set when `providerModelId` is not a legal id for `target` — in practice,\n * a non-Anthropic id on the first-party Anthropic Messages API. Never\n * thrown: the caller decides whether a manifest that names a model its\n * endpoint cannot serve is a warning or a failure.\n */\n error?: string;\n}\n\n/**\n * Resolve an agent manifest's `model.preferred` (or any single entry of\n * `model.fallback`) against the provider registry, then check the id it\n * produces against the selected entry's own vocabulary.\n *\n * The three selector forms — `@role`, `<providerId>/<modelId>`, bare id — are\n * resolved by `parseModelRef` (`@skaile/workspaces/core/provider-registry`),\n * which owns that grammar; this adds the per-surface id check on top.\n *\n * Returns `undefined` when there is nothing to resolve: no preference, or no\n * registry that can serve one.\n */\nexport function resolveManifestModel(\n preference: string | undefined,\n context: ModelRegistryContext = {},\n): ResolvedManifestModel | undefined {\n if (!preference || !context.registry) return undefined;\n const ref = parseModelRef(preference, context.registry, context.roles);\n if (!ref) return undefined;\n\n const entry = llmEntry(context.registry, ref.providerId);\n const target = entry ? modelIdTargetForEntry(entry) : {};\n const resolved: ResolvedManifestModel = {\n providerId: ref.providerId,\n ...(ref.modelId !== undefined ? { modelId: ref.modelId } : {}),\n ...(ref.providerModelId !== undefined ? { providerModelId: ref.providerModelId } : {}),\n ...(ref.role !== undefined ? { role: ref.role } : {}),\n target,\n warnings: [...ref.warnings],\n };\n if (ref.providerModelId === undefined) return resolved;\n\n const check = modelIdSchemaForTarget(target).safeParse(ref.providerModelId);\n if (!check.success) {\n resolved.error =\n `model \"${ref.providerModelId}\" is not valid for provider \"${ref.providerId}\" ` +\n `(surface ${target.surface ?? \"unknown\"}, transport ${target.transport ?? \"direct\"}` +\n `${target.base_url ? `, ${target.base_url}` : \"\"}): ` +\n (check.error.issues[0]?.message ?? \"invalid model id\");\n }\n return resolved;\n}\n\n/**\n * Resolve a model's capability facts — context window, thinking ceiling, tool\n * and image support — from the registry entry that serves it.\n *\n * `capabilities` is keyed by the *logical* id (the `model_map` key), so a\n * selector is resolved first and the record is read under both the logical and\n * the provider-side id. `fallback` is the caller's own per-model table (the\n * compaction window defaults, the platform's thinking limits); the entry wins\n * field by field, and a field the entry does not state falls through.\n *\n * Returns `undefined` when neither source knows anything about the model.\n */\nexport function resolveModelCapabilities(\n selector: string | undefined,\n context: ModelRegistryContext & {\n /** Per-model-id capability table consulted for fields the entry omits. */\n fallback?: Record<string, AIProviderCapabilities>;\n } = {},\n): AIProviderCapabilities | undefined {\n if (!selector) return undefined;\n const ref = context.registry\n ? parseModelRef(selector, context.registry, context.roles)\n : undefined;\n const entry = ref && context.registry ? llmEntry(context.registry, ref.providerId) : undefined;\n const ids = [ref?.modelId, ref?.providerModelId, selector].filter(\n (id): id is string => id !== undefined,\n );\n const entryCaps = ids.map((id) => entry?.capabilities?.[id]).find((caps) => caps !== undefined);\n const fallbackCaps = ids.map((id) => context.fallback?.[id]).find((caps) => caps !== undefined);\n\n const context_window = entryCaps?.context_window ?? fallbackCaps?.context_window;\n const thinking_max = entryCaps?.thinking_max ?? fallbackCaps?.thinking_max;\n const tools = entryCaps?.tools ?? fallbackCaps?.tools;\n const images = entryCaps?.images ?? fallbackCaps?.images;\n if (\n context_window === undefined &&\n thinking_max === undefined &&\n tools === undefined &&\n images === undefined\n ) {\n return undefined;\n }\n return {\n ...(context_window !== undefined ? { context_window } : {}),\n ...(thinking_max !== undefined ? { thinking_max } : {}),\n ...(tools !== undefined ? { tools } : {}),\n ...(images !== undefined ? { images } : {}),\n };\n}\n\n// ---------------------------------------------------------------------------\n// Model tier resolution (Flow v2 `run.model`)\n// ---------------------------------------------------------------------------\n\n/** Per-tier concrete model ids for one provider. */\nexport interface ModelTierOverrides {\n small?: string;\n default?: string;\n deep?: string;\n}\n\n/**\n * Tier→model mapping per provider, for deployments with **no provider\n * registry**. This is the point of the closed `small | default | deep`\n * vocabulary: an authored flow names an intent and the runtime owns which\n * concrete model serves it, so flows stay portable across model-lineup changes.\n *\n * It is no longer the source of truth for what a tier means. Where a registry\n * exists, a tier resolves through `roles` and the selected entry's `model_map`\n * (see {@link resolveModelTier}) — which works for every provider, names the\n * ids that deployment actually serves, and is editable without a release. This\n * table survives only for the pre-registry path, where nothing else can answer\n * the question; a vendor missing from it there is a `ModelTierResolutionError`,\n * not a guess.\n *\n * These are **direct provider-API ids**. A gateway transport (Bedrock, Vertex,\n * Azure) addresses the same models by different ids — Bedrock prefixes\n * `us.anthropic.`, for instance — and that translation belongs to whoever owns\n * the deployment, not here. {@link resolveModelTier} therefore consults this\n * table only on the direct API and demands an explicit override otherwise,\n * rather than handing a gateway an id it cannot serve.\n *\n * Every id here must also appear in {@link STATIC_MODELS} — a test asserts it,\n * so the two cannot drift into naming a model the catalog disowns. That check\n * proves internal consistency only; it cannot tell you an id is still current\n * with a provider's live lineup.\n *\n * Where a provider's lineup has no genuinely distinct model for a tier, the\n * entry deliberately repeats the neighbouring one. That is a reviewable\n * property of that lineup, unlike inheriting whatever model the session\n * happened to start with — which is how `small` could silently mean Opus.\n */\nexport const PROVIDER_MODEL_TIERS: Record<string, Required<ModelTierOverrides>> = {\n anthropic: {\n small: \"claude-haiku-4-5-20251001\",\n default: \"claude-sonnet-4-6\",\n deep: \"claude-opus-4-6\",\n },\n openai: { small: \"gpt-4o-mini\", default: \"gpt-4.1\", deep: \"o3\" },\n google: { small: \"gemini-2.0-flash\", default: \"gemini-2.5-flash\", deep: \"gemini-2.5-pro\" },\n mistral: {\n small: \"mistral-small-latest\",\n default: \"mistral-large-latest\",\n deep: \"mistral-large-latest\",\n },\n groq: {\n small: \"llama-3.1-8b-instant\",\n default: \"llama-3.3-70b-versatile\",\n deep: \"llama-3.3-70b-versatile\",\n },\n deepseek: { small: \"deepseek-chat\", default: \"deepseek-chat\", deep: \"deepseek-reasoner\" },\n xai: { small: \"grok-3-mini\", default: \"grok-3\", deep: \"grok-3\" },\n together: {\n small: \"mistralai/Mixtral-8x7B-Instruct-v0.1\",\n default: \"meta-llama/Llama-3.3-70B-Instruct-Turbo\",\n deep: \"meta-llama/Llama-3.3-70B-Instruct-Turbo\",\n },\n fireworks: {\n small: \"accounts/fireworks/models/llama-v3p3-70b-instruct\",\n default: \"accounts/fireworks/models/llama-v3p3-70b-instruct\",\n deep: \"accounts/fireworks/models/deepseek-v3\",\n },\n openrouter: {\n small: \"anthropic/claude-haiku-4.5\",\n default: \"anthropic/claude-sonnet-4.6\",\n deep: \"anthropic/claude-opus-4.6\",\n },\n};\n\n/** Raised when a tier names an intent this provider cannot serve. */\nexport class ModelTierResolutionError extends Error {\n constructor(\n readonly tier: \"small\" | \"deep\",\n readonly provider: string | undefined,\n ) {\n super(\n `cannot resolve model tier \"${tier}\" for provider \"${provider ?? \"(none)\"}\": no built-in mapping and no configured override. ` +\n `Configure a \"${tier}\" model override for this provider, or author the node as model: \"default\" to inherit the session model.`,\n );\n this.name = \"ModelTierResolutionError\";\n }\n}\n\n/**\n * Resolve a tier for a deployment that has a registry: through `roles[tier]`\n * first, then the selected entry's `model_map[tier]`.\n *\n * A `model_map` **miss is a miss**. `parseModelRef` falls back to the literal\n * selector when nothing maps it, and no provider serves a model called\n * `\"small\"` — so only a genuine mapping counts, and an unmapped tier is left\n * for the caller to fail on.\n */\nfunction resolveTierThroughRegistry(\n tier: keyof ModelTierOverrides,\n options: ModelRegistryContext,\n): string | undefined {\n const { registry, roles, providerId } = options;\n if (!registry) return undefined;\n if (roles?.[tier] !== undefined) {\n const viaRole = parseModelRef(`@${tier}`, registry, roles);\n if (viaRole?.providerModelId) return viaRole.providerModelId;\n }\n const ref = parseModelRef(providerId ? `${providerId}/${tier}` : tier, registry, roles);\n if (!ref?.modelId) return undefined;\n return llmEntry(registry, ref.providerId)?.model_map?.[ref.modelId];\n}\n\n/** Options {@link resolveModelTier} reads. */\nexport interface ResolveModelTierOptions extends ModelRegistryContext {\n /** Legacy provider id, keying {@link PROVIDER_MODEL_TIERS}. */\n provider?: string;\n /** Legacy cloud transport; anything but `default` disables the built-in table. */\n cloud?: string;\n /** Per-tier ids configured for this deployment. Wins over everything. */\n overrides?: ModelTierOverrides;\n}\n\n/**\n * Resolve a Flow v2 `run.model` tier to a concrete model id.\n *\n * Precedence, highest first: a configured `overrides` entry; the registry —\n * `roles[tier]`, then the selected entry's `model_map[tier]`, which is how a\n * tier is defined for *any* provider; and finally, **only when no registry is\n * configured**, {@link PROVIDER_MODEL_TIERS} on the direct provider API.\n *\n * `\"default\"` and an absent tier **inherit `sessionModel` first**. The session\n * model is the one id known to work for this deployment — it already carries\n * whatever provider, lineup and gateway translation the host configured — so\n * preferring any table over it would silently downgrade a configured model\n * and, on a gateway transport, substitute an id that provider cannot serve.\n *\n * `\"small\"` and `\"deep\"` never fall back to `sessionModel`; when nothing above\n * resolves them they throw {@link ModelTierResolutionError}. Inheriting there\n * would run an arbitrary model behind an author's explicit request for a cheap\n * or a strong one — a cost or quality surprise that shows up only in the bill\n * or the output. Failing names it at the node instead.\n *\n * Pure: no I/O, no environment reads.\n */\nexport function resolveModelTier(\n tier: \"small\" | \"default\" | \"deep\" | undefined,\n sessionModel: string | undefined,\n options: ResolveModelTierOptions = {},\n): string | undefined {\n // Built-in ids address the provider's own API; a gateway renames them. And a\n // registry answers the question properly, so the table is its fallback only.\n const directApi = !options.cloud || options.cloud === \"default\";\n const builtIn =\n !options.registry && directApi && options.provider\n ? PROVIDER_MODEL_TIERS[options.provider]\n : undefined;\n if (tier === \"small\" || tier === \"deep\") {\n const resolved =\n options.overrides?.[tier] ?? resolveTierThroughRegistry(tier, options) ?? builtIn?.[tier];\n if (!resolved) throw new ModelTierResolutionError(tier, options.provider);\n return resolved;\n }\n return (\n options.overrides?.default ??\n sessionModel ??\n resolveTierThroughRegistry(\"default\", options) ??\n builtIn?.default\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../bridge/src/models.ts"],"names":[],"mappings":";;;;;AAmDA,SAAS,SAAS,EAAA,EAAoB;AACpC,EAAA,OAAO,EAAA,CACJ,OAAA,CAAQ,4BAAA,EAA8B,EAAE,EACxC,OAAA,CAAQ,OAAA,EAAS,GAAG,CAAA,CACpB,QAAQ,OAAA,EAAS,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa,CAAA;AAC5C;AAMA,SAAS,kBAAkB,EAAA,EAAqB;AAC9C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S,QAAA,EAAU,GAAA,CAAI,UAAU,CAAA,EAAG,SAAA,GAAY,IAAI,OAAO,CAAA;AACpE;AAkCO,SAAS,gBAAA,CACd,IAAA,EACA,YAAA,EACA,OAAA,GAAmC,EAAC,EAChB;AAGpB,EAAA,MAAM,SAAA,GAAY,CAAC,OAAA,CAAQ,KAAA,IAAS,QAAQ,KAAA,KAAU,SAAA;AACtD,EAAA,MAAM,OAAA,GACJ,CAAC,OAAA,CAAQ,QAAA,IAAY,SAAA,IAAa,QAAQ,QAAA,GACtC,oBAAA,CAAqB,OAAA,CAAQ,QAAQ,CAAA,GACrC,MAAA;AACN,EAAA,IAAI,IAAA,KAAS,OAAA,IAAW,IAAA,KAAS,MAAA,EAAQ;AACvC,IAAA,MAAM,QAAA,GACJ,OAAA,CAAQ,SAAA,GAAY,IAAI,CAAA,IAAK,2BAA2B,IAAA,EAAM,OAAO,CAAA,IAAK,OAAA,GAAU,IAAI,CAAA;AAC1F,IAAA,IAAI,CAAC,QAAA,EAAU,MAAM,IAAI,wBAAA,CAAyB,IAAA,EAAM,QAAQ,QAAQ,CAAA;AACxE,IAAA,OAAO,QAAA;AAAA,EACT;AACA,EAAA,OACE,OAAA,CAAQ,WAAW,OAAA,IACnB,YAAA,IACA,2BAA2B,SAAA,EAAW,OAAO,KAC7C,OAAA,EAAS,OAAA;AAEb","file":"chunk-ESUF2ZYT.js","sourcesContent":["/**\n * Model catalog — static fallback + live provider API fetching.\n *\n * Provides `fetchProviderModels(provider, apiKey)` for live model lists and\n * `getStaticModels(provider)` as an offline fallback.\n * OMP model listing is handled by `OmpHarness.listModels()` in the bridge harness.\n */\n\nimport {\n type AIProviderCapabilities,\n type AIProviderLlmEntry,\n type AIProviderRegistry,\n entryTransport,\n type MergedAIProviderRegistry,\n parseModelRef,\n registryEntries,\n resolveEntryBaseUrl,\n} from \"@skaile/workspaces/core/provider-registry\";\nimport { type ModelIdTarget, modelIdSchemaForTarget } from \"@skaile/workspaces/types/manifests\";\nimport {\n buildCredentialHeaders,\n expandPreset,\n getProviderPreset,\n presetBaseUrl,\n resolvePresetBaseUrl,\n resolveProbeUrl,\n} from \"./provider-catalog.js\";\n\n/**\n * A single LLM model entry returned by the model catalog.\n *\n * Used by `getModels`, `getStaticModels`, and `fetchProviderModels` to represent\n * an available model for a provider.\n *\n * @docLink packages/bridge/api-reference#models\n */\nexport interface ModelEntry {\n /** Provider-specific model identifier used in API calls (e.g. `\"claude-sonnet-4-5\"`). */\n id: string;\n /** Human-readable display name for UIs and logs (e.g. `\"Claude Sonnet 4.5\"`). */\n name: string;\n}\n\n// ---------------------------------------------------------------------------\n// Provider API configs (for fetching model lists)\n// ---------------------------------------------------------------------------\n\n/** Extract ModelEntry[] from a provider's parsed models-list JSON response. */\ntype ParseModels = (body: any) => ModelEntry[];\n\n/** Humanize a model ID into a display name (e.g. \"claude-sonnet-4-6\" → \"Claude Sonnet 4 6\") */\nfunction humanize(id: string): string {\n return id\n .replace(/^accounts\\/[^/]+\\/models\\//, \"\")\n .replace(/[-_]/g, \" \")\n .replace(/\\b\\w/g, (c) => c.toUpperCase());\n}\n\n/**\n * Filter function used by providers that return the OpenAI-style /v1/models list.\n * Keeps only chat/completion models, skips embeddings, moderation, tts, whisper, dall-e, etc.\n */\nfunction isLikelyChatModel(id: string): boolean {\n const skip = /embed|moderat|tts|whisper|dall-e|davinci|babbage|ada-00|text-/i;\n return !skip.test(id);\n}\n\n// Per-provider response parsers. The endpoint URL and the credential header\n// come from the catalog preset (provider-catalog.ts), joined in\n// fetchProviderModels.\nconst PROVIDER_PARSERS: Record<string, ParseModels> = {\n anthropic: (body) => {\n const models = body?.data ?? [];\n return models\n .filter((m: any) => m.id && !m.id.includes(\"embed\"))\n .map((m: any) => ({\n id: m.id,\n name: m.display_name ?? humanize(m.id),\n }));\n },\n openai: (body) => {\n const models = body?.data ?? [];\n return models\n .filter((m: any) => m.id && isLikelyChatModel(m.id))\n .map((m: any) => ({ id: m.id, name: humanize(m.id) }))\n .sort((a: ModelEntry, b: ModelEntry) => a.id.localeCompare(b.id));\n },\n openrouter: (body) => {\n const models = body?.data ?? [];\n return models\n .filter((m: any) => m.id)\n .map((m: any) => ({ id: m.id, name: m.name ?? humanize(m.id) }))\n .sort((a: ModelEntry, b: ModelEntry) => a.id.localeCompare(b.id));\n },\n mistral: (body) => {\n const models = body?.data ?? [];\n return models\n .filter((m: any) => m.id && isLikelyChatModel(m.id))\n .map((m: any) => ({ id: m.id, name: humanize(m.id) }))\n .sort((a: ModelEntry, b: ModelEntry) => a.id.localeCompare(b.id));\n },\n groq: (body) => {\n const models = body?.data ?? [];\n return models\n .filter((m: any) => m.id && isLikelyChatModel(m.id))\n .map((m: any) => ({ id: m.id, name: humanize(m.id) }))\n .sort((a: ModelEntry, b: ModelEntry) => a.id.localeCompare(b.id));\n },\n deepseek: (body) => {\n const models = body?.data ?? [];\n return models\n .map((m: any) => ({ id: m.id, name: humanize(m.id) }))\n .sort((a: ModelEntry, b: ModelEntry) => a.id.localeCompare(b.id));\n },\n xai: (body) => {\n const models = body?.data ?? [];\n return models\n .filter((m: any) => m.id && isLikelyChatModel(m.id))\n .map((m: any) => ({ id: m.id, name: humanize(m.id) }))\n .sort((a: ModelEntry, b: ModelEntry) => a.id.localeCompare(b.id));\n },\n together: (body) => {\n const models = body?.data ?? body ?? [];\n const arr = Array.isArray(models) ? models : [];\n return arr\n .filter((m: any) => m.id && m.type === \"chat\")\n .map((m: any) => ({ id: m.id, name: m.display_name ?? humanize(m.id) }))\n .sort((a: ModelEntry, b: ModelEntry) => a.id.localeCompare(b.id));\n },\n fireworks: (body) => {\n const models = body?.data ?? [];\n return models\n .map((m: any) => ({ id: m.id, name: humanize(m.id) }))\n .sort((a: ModelEntry, b: ModelEntry) => a.id.localeCompare(b.id));\n },\n google: (body) => {\n const models = body?.models ?? [];\n return models\n .filter((m: any) => m.supportedGenerationMethods?.includes(\"generateContent\"))\n .map((m: any) => ({\n id: (m.name ?? \"\").replace(/^models\\//, \"\"),\n name: m.displayName ?? humanize(m.name ?? \"\"),\n }))\n .sort((a: ModelEntry, b: ModelEntry) => a.id.localeCompare(b.id));\n },\n};\n\n// ---------------------------------------------------------------------------\n// Live fetch\n// ---------------------------------------------------------------------------\n\n/**\n * Result of a model-list fetch operation, with source attribution.\n *\n * Returned by {@link fetchProviderModels} and {@link getModels}. When `ok` is `false`,\n * `models` is empty and `error` describes the failure. The `source` field indicates\n * whether the list came from a live API call or the offline static catalog.\n *\n * @docLink packages/bridge/api-reference#models\n */\nexport interface FetchModelsResult {\n /** `true` when the fetch succeeded and `models` is populated. */\n ok: boolean;\n /** Fetched model list; empty on failure. */\n models: ModelEntry[];\n /** Human-readable error description when `ok` is `false`. */\n error?: string;\n /** Whether the result came from a live API call or the static fallback. */\n source: \"api\" | \"static\";\n}\n\n/**\n * Options controlling where a model-list fetch is addressed.\n *\n * @since 1.5.0\n */\nexport interface FetchModelsOptions {\n /**\n * Base URL to resolve the provider's models endpoint against — e.g. the\n * gateway a session already routes completions through. Overrides the\n * provider's `baseUrlEnv` value.\n */\n baseUrl?: string;\n /**\n * Environment consulted for the provider's base-URL env var\n * (`ANTHROPIC_BASE_URL` for `anthropic`). Defaults to `process.env`; pass an\n * explicit record to keep a call hermetic.\n */\n env?: Record<string, string | undefined>;\n}\n\n/**\n * Fetch the model list from a provider's REST API.\n *\n * Returns `{ ok: true, models, source: 'api' }` on success, or\n * `{ ok: false, models: [], error }` on any HTTP or network failure — the\n * caller should fall back to {@link getStaticModels} in that case.\n *\n * The endpoint, the credential header and the response path all come from the\n * catalog preset named by `provider` ({@link resolvePresetBaseUrl},\n * {@link resolveProbeUrl}, {@link buildCredentialHeaders}), so discovery hits\n * the same host dispatch does — including a gateway named by `baseUrl` or by\n * the vendor's own `*_BASE_URL` variable.\n *\n * @param provider - Catalog preset id (e.g. `\"anthropic\"`, `\"openai\"`, `\"google\"`).\n * @param apiKey - API key presented in the preset's credential header.\n * @param options - Optional base-URL / environment overrides.\n * @returns Resolved model list with source attribution.\n * @docLink packages/bridge/api-reference#models\n */\nexport async function fetchProviderModels(\n provider: string,\n apiKey: string,\n options: FetchModelsOptions = {},\n): Promise<FetchModelsResult> {\n const preset = getProviderPreset(provider);\n const parse = PROVIDER_PARSERS[provider];\n if (!preset || !parse) {\n return {\n ok: false,\n models: [],\n error: `No API config for provider: ${provider}`,\n source: \"static\",\n };\n }\n\n const baseUrl = resolvePresetBaseUrl(preset, {\n ...(options.baseUrl ? { baseUrl: options.baseUrl } : {}),\n env: options.env ?? process.env,\n });\n const entry = expandPreset(preset, baseUrl ? { baseUrl } : {});\n const url = resolveProbeUrl(entry);\n if (!url) {\n return {\n ok: false,\n models: [],\n error: `Provider ${provider} exposes no models endpoint`,\n source: \"static\",\n };\n }\n // Static non-secret headers (Anthropic's `anthropic-version`) plus the\n // credential carrier the preset's `auth_header` names.\n const headers = { ...entry.headers, ...buildCredentialHeaders(entry, apiKey) };\n\n try {\n const controller = new AbortController();\n const timeout = setTimeout(() => controller.abort(), 10_000);\n\n const response = await fetch(url, {\n method: \"GET\",\n headers,\n signal: controller.signal,\n });\n\n clearTimeout(timeout);\n\n if (!response.ok) {\n return {\n ok: false,\n models: [],\n error: `API returned HTTP ${response.status}`,\n source: \"static\",\n };\n }\n\n const body = await response.json();\n const models = parse(body);\n\n return { ok: true, models, source: \"api\" };\n } catch (err: any) {\n const msg =\n err.name === \"AbortError\" ? \"Request timed out (10s)\" : (err.message ?? \"Network error\");\n return { ok: false, models: [], error: msg, source: \"static\" };\n }\n}\n\n/**\n * Get models for a provider, trying the live API first and falling back to the static catalog.\n *\n * When no `apiKey` is provided the static catalog is returned immediately without\n * a network call. When the live API fails or returns an empty list, the static\n * catalog is used as a fallback — the result's `source` field indicates which was used.\n *\n * @param provider - Provider name (e.g. `\"anthropic\"`, `\"openai\"`, `\"google\"`).\n * @param apiKey - Optional API key; omit to skip the live fetch and use the static catalog.\n * @param options - Optional base-URL / environment overrides (see {@link FetchModelsOptions}).\n * @returns Resolved model list with source attribution.\n * @docLink packages/bridge/api-reference#models\n */\nexport async function getModels(\n provider: string,\n apiKey?: string,\n options: FetchModelsOptions = {},\n): Promise<FetchModelsResult> {\n if (!apiKey) {\n const models = getStaticModels(provider);\n return { ok: true, models, source: \"static\" };\n }\n\n const result = await fetchProviderModels(provider, apiKey, options);\n if (result.ok && result.models.length > 0) {\n return result;\n }\n\n // Fall back to static\n const staticModels = getStaticModels(provider);\n if (staticModels.length > 0) {\n return { ok: true, models: staticModels, source: \"static\", error: result.error };\n }\n\n return result;\n}\n\n// ---------------------------------------------------------------------------\n// Static catalog (offline fallback)\n// ---------------------------------------------------------------------------\n\n/**\n * Offline model catalog keyed by provider name.\n *\n * Used as a fallback by {@link getModels} when the live provider API is unreachable or\n * returns an empty list. Covers Anthropic, OpenAI, Google, Mistral, Groq, DeepSeek,\n * xAI, Together, Fireworks, and OpenRouter. Update this list when providers add new\n * models and a live fetch is not available.\n *\n * @docLink packages/bridge/api-reference#models\n */\nexport const STATIC_MODELS: Record<string, ModelEntry[]> = {\n anthropic: [\n { id: \"claude-opus-4-6\", name: \"Claude Opus 4.6\" },\n { id: \"claude-sonnet-4-6\", name: \"Claude Sonnet 4.6\" },\n { id: \"claude-haiku-4-5-20251001\", name: \"Claude Haiku 4.5\" },\n { id: \"claude-opus-4-5\", name: \"Claude Opus 4.5\" },\n { id: \"claude-sonnet-4-5\", name: \"Claude Sonnet 4.5\" },\n ],\n openai: [\n { id: \"gpt-4o\", name: \"GPT-4o\" },\n { id: \"gpt-4o-mini\", name: \"GPT-4o Mini\" },\n { id: \"gpt-4.1\", name: \"GPT-4.1\" },\n { id: \"gpt-4.1-mini\", name: \"GPT-4.1 Mini\" },\n { id: \"o3\", name: \"o3\" },\n { id: \"o4-mini\", name: \"o4-mini\" },\n ],\n google: [\n { id: \"gemini-2.5-pro\", name: \"Gemini 2.5 Pro\" },\n { id: \"gemini-2.5-flash\", name: \"Gemini 2.5 Flash\" },\n { id: \"gemini-2.0-flash\", name: \"Gemini 2.0 Flash\" },\n ],\n mistral: [\n { id: \"mistral-large-latest\", name: \"Mistral Large\" },\n { id: \"mistral-small-latest\", name: \"Mistral Small\" },\n { id: \"codestral-latest\", name: \"Codestral\" },\n ],\n groq: [\n { id: \"llama-3.3-70b-versatile\", name: \"Llama 3.3 70B\" },\n { id: \"llama-3.1-8b-instant\", name: \"Llama 3.1 8B\" },\n { id: \"mixtral-8x7b-32768\", name: \"Mixtral 8x7B\" },\n ],\n deepseek: [\n { id: \"deepseek-chat\", name: \"DeepSeek Chat\" },\n { id: \"deepseek-reasoner\", name: \"DeepSeek Reasoner\" },\n ],\n xai: [\n { id: \"grok-3\", name: \"Grok 3\" },\n { id: \"grok-3-mini\", name: \"Grok 3 Mini\" },\n ],\n together: [\n { id: \"meta-llama/Llama-3.3-70B-Instruct-Turbo\", name: \"Llama 3.3 70B Turbo\" },\n { id: \"mistralai/Mixtral-8x7B-Instruct-v0.1\", name: \"Mixtral 8x7B\" },\n ],\n fireworks: [\n { id: \"accounts/fireworks/models/llama-v3p3-70b-instruct\", name: \"Llama 3.3 70B\" },\n { id: \"accounts/fireworks/models/deepseek-v3\", name: \"DeepSeek v3\" },\n ],\n openrouter: [\n { id: \"anthropic/claude-sonnet-4.6\", name: \"Claude Sonnet 4.6\" },\n { id: \"anthropic/claude-opus-4.6\", name: \"Claude Opus 4.6\" },\n { id: \"anthropic/claude-haiku-4.5\", name: \"Claude Haiku 4.5\" },\n { id: \"anthropic/claude-sonnet-4.5\", name: \"Claude Sonnet 4.5\" },\n { id: \"anthropic/claude-3.7-sonnet\", name: \"Claude 3.7 Sonnet\" },\n { id: \"openai/gpt-4o\", name: \"GPT-4o\" },\n { id: \"openai/gpt-4.1\", name: \"GPT-4.1\" },\n { id: \"openai/gpt-4.1-mini\", name: \"GPT-4.1 Mini\" },\n { id: \"google/gemini-2.5-pro\", name: \"Gemini 2.5 Pro\" },\n { id: \"google/gemini-2.5-flash\", name: \"Gemini 2.5 Flash\" },\n { id: \"meta-llama/llama-4-maverick\", name: \"Llama 4 Maverick\" },\n { id: \"meta-llama/llama-3.3-70b-instruct\", name: \"Llama 3.3 70B\" },\n { id: \"deepseek/deepseek-chat-v3-0324\", name: \"DeepSeek v3\" },\n { id: \"deepseek/deepseek-r1\", name: \"DeepSeek R1\" },\n { id: \"mistralai/mistral-large-2411\", name: \"Mistral Large 2\" },\n ],\n};\n\n/**\n * Get models for a specific provider from the static catalog, or empty array if unknown.\n *\n * Pure synchronous lookup — no network call. Use when the provider API is unavailable\n * or when a fast offline fallback is needed (e.g. in the UI before credentials are configured).\n *\n * @param provider - Provider name matching a key in {@link STATIC_MODELS}.\n * @returns Offline model list, or `[]` for unknown providers.\n * @docLink packages/bridge/api-reference#models\n */\nexport function getStaticModels(provider: string): ModelEntry[] {\n return STATIC_MODELS[provider] ?? [];\n}\n\n// ---------------------------------------------------------------------------\n// Registry-backed model identity (§2.4)\n// ---------------------------------------------------------------------------\n\n/** A registry in either of the two shapes consumers hold. */\nexport type ProviderRegistryView = AIProviderRegistry | MergedAIProviderRegistry;\n\n/**\n * Where a model selector is resolved. `registry` absent means no registry is\n * configured at all — every resolver here then returns `undefined` and the\n * caller keeps its pre-registry behaviour.\n */\nexport interface ModelRegistryContext {\n /** The merged registry (`mergeRegistries`), or a single layer. */\n registry?: ProviderRegistryView;\n /** `skaile.yaml` `roles`: role name → model selector (`smol` → `groq/llama-3.1-8b`). */\n roles?: Record<string, string>;\n /**\n * Entry the session already runs on. Scopes `model_map` lookups to it;\n * absent lets the selector pick in registry order.\n */\n providerId?: string;\n}\n\n/** The `llm`/`embed` entry registered under `id`, if any. */\nfunction llmEntry(registry: ProviderRegistryView, id: string): AIProviderLlmEntry | undefined {\n const entry = registryEntries(registry).find(([entryId]) => entryId === id)?.[1];\n if (!entry || (entry.kind !== \"llm\" && entry.kind !== \"embed\")) return undefined;\n return entry;\n}\n\n/**\n * The wire facts that decide which model-id vocabulary an entry enforces\n * (`modelIdSchemaForTarget`).\n *\n * `surface` and `base_url` fall back to the entry's preset: an entry written as\n * `{kind: llm, preset: anthropic}` carries neither of its own until the catalog\n * merge layer expands it, and validation must not depend on having been handed\n * a merged registry.\n */\nexport function modelIdTargetForEntry(entry: AIProviderLlmEntry): ModelIdTarget {\n const preset = entry.preset ? getProviderPreset(entry.preset) : undefined;\n const surface = entry.surface ?? preset?.surface;\n const base_url = resolveEntryBaseUrl(entry) ?? (preset ? presetBaseUrl(preset) : undefined);\n return {\n ...(surface ? { surface } : {}),\n ...(entryTransport(entry) ? { transport: entryTransport(entry) } : {}),\n ...(base_url ? { base_url } : {}),\n };\n}\n\n/** A manifest model preference resolved against the registry. */\nexport interface ResolvedManifestModel {\n /** Entry the preference routes to. */\n providerId: string;\n /** Logical id, after `@role` expansion and before `model_map`. */\n modelId?: string;\n /** Provider-side id — what goes on the wire: `model_map[modelId] ?? modelId`. */\n providerModelId?: string;\n /** Role name, when the preference was `@role`. */\n role?: string;\n /** The wire target `providerModelId` was checked against. */\n target: ModelIdTarget;\n /** Non-fatal notes: a dangling role, a disabled provider, a stale preset. */\n warnings: string[];\n /**\n * Set when `providerModelId` is not a legal id for `target` — in practice,\n * a non-Anthropic id on the first-party Anthropic Messages API. Never\n * thrown: the caller decides whether a manifest that names a model its\n * endpoint cannot serve is a warning or a failure.\n */\n error?: string;\n}\n\n/**\n * Resolve an agent manifest's `model.preferred` (or any single entry of\n * `model.fallback`) against the provider registry, then check the id it\n * produces against the selected entry's own vocabulary.\n *\n * The three selector forms — `@role`, `<providerId>/<modelId>`, bare id — are\n * resolved by `parseModelRef` (`@skaile/workspaces/core/provider-registry`),\n * which owns that grammar; this adds the per-surface id check on top.\n *\n * Returns `undefined` when there is nothing to resolve: no preference, or no\n * registry that can serve one.\n */\nexport function resolveManifestModel(\n preference: string | undefined,\n context: ModelRegistryContext = {},\n): ResolvedManifestModel | undefined {\n if (!preference || !context.registry) return undefined;\n const ref = parseModelRef(preference, context.registry, context.roles);\n if (!ref) return undefined;\n\n const entry = llmEntry(context.registry, ref.providerId);\n const target = entry ? modelIdTargetForEntry(entry) : {};\n const resolved: ResolvedManifestModel = {\n providerId: ref.providerId,\n ...(ref.modelId !== undefined ? { modelId: ref.modelId } : {}),\n ...(ref.providerModelId !== undefined ? { providerModelId: ref.providerModelId } : {}),\n ...(ref.role !== undefined ? { role: ref.role } : {}),\n target,\n warnings: [...ref.warnings],\n };\n if (ref.providerModelId === undefined) return resolved;\n\n const check = modelIdSchemaForTarget(target).safeParse(ref.providerModelId);\n if (!check.success) {\n resolved.error =\n `model \"${ref.providerModelId}\" is not valid for provider \"${ref.providerId}\" ` +\n `(surface ${target.surface ?? \"unknown\"}, transport ${target.transport ?? \"direct\"}` +\n `${target.base_url ? `, ${target.base_url}` : \"\"}): ` +\n (check.error.issues[0]?.message ?? \"invalid model id\");\n }\n return resolved;\n}\n\n/**\n * Resolve a model's capability facts — context window, thinking ceiling, tool\n * and image support — from the registry entry that serves it.\n *\n * `capabilities` is keyed by the *logical* id (the `model_map` key), so a\n * selector is resolved first and the record is read under both the logical and\n * the provider-side id. `fallback` is the caller's own per-model table (the\n * compaction window defaults, the platform's thinking limits); the entry wins\n * field by field, and a field the entry does not state falls through.\n *\n * Returns `undefined` when neither source knows anything about the model.\n */\nexport function resolveModelCapabilities(\n selector: string | undefined,\n context: ModelRegistryContext & {\n /** Per-model-id capability table consulted for fields the entry omits. */\n fallback?: Record<string, AIProviderCapabilities>;\n } = {},\n): AIProviderCapabilities | undefined {\n if (!selector) return undefined;\n const ref = context.registry\n ? parseModelRef(selector, context.registry, context.roles)\n : undefined;\n const entry = ref && context.registry ? llmEntry(context.registry, ref.providerId) : undefined;\n const ids = [ref?.modelId, ref?.providerModelId, selector].filter(\n (id): id is string => id !== undefined,\n );\n const entryCaps = ids.map((id) => entry?.capabilities?.[id]).find((caps) => caps !== undefined);\n const fallbackCaps = ids.map((id) => context.fallback?.[id]).find((caps) => caps !== undefined);\n\n const context_window = entryCaps?.context_window ?? fallbackCaps?.context_window;\n const thinking_max = entryCaps?.thinking_max ?? fallbackCaps?.thinking_max;\n const tools = entryCaps?.tools ?? fallbackCaps?.tools;\n const images = entryCaps?.images ?? fallbackCaps?.images;\n if (\n context_window === undefined &&\n thinking_max === undefined &&\n tools === undefined &&\n images === undefined\n ) {\n return undefined;\n }\n return {\n ...(context_window !== undefined ? { context_window } : {}),\n ...(thinking_max !== undefined ? { thinking_max } : {}),\n ...(tools !== undefined ? { tools } : {}),\n ...(images !== undefined ? { images } : {}),\n };\n}\n\n// ---------------------------------------------------------------------------\n// Model tier resolution (Flow v2 `run.model`)\n// ---------------------------------------------------------------------------\n\n/** Per-tier concrete model ids for one provider. */\nexport interface ModelTierOverrides {\n small?: string;\n default?: string;\n deep?: string;\n}\n\n/**\n * Tier→model mapping per provider, for deployments with **no provider\n * registry**. This is the point of the closed `small | default | deep`\n * vocabulary: an authored flow names an intent and the runtime owns which\n * concrete model serves it, so flows stay portable across model-lineup changes.\n *\n * It is no longer the source of truth for what a tier means. Where a registry\n * exists, a tier resolves through `roles` and the selected entry's `model_map`\n * (see {@link resolveModelTier}) — which works for every provider, names the\n * ids that deployment actually serves, and is editable without a release. This\n * table survives only for the pre-registry path, where nothing else can answer\n * the question; a vendor missing from it there is a `ModelTierResolutionError`,\n * not a guess.\n *\n * These are **direct provider-API ids**. A gateway transport (Bedrock, Vertex,\n * Azure) addresses the same models by different ids — Bedrock prefixes\n * `us.anthropic.`, for instance — and that translation belongs to whoever owns\n * the deployment, not here. {@link resolveModelTier} therefore consults this\n * table only on the direct API and demands an explicit override otherwise,\n * rather than handing a gateway an id it cannot serve.\n *\n * Every id here must also appear in {@link STATIC_MODELS} — a test asserts it,\n * so the two cannot drift into naming a model the catalog disowns. That check\n * proves internal consistency only; it cannot tell you an id is still current\n * with a provider's live lineup.\n *\n * Where a provider's lineup has no genuinely distinct model for a tier, the\n * entry deliberately repeats the neighbouring one. That is a reviewable\n * property of that lineup, unlike inheriting whatever model the session\n * happened to start with — which is how `small` could silently mean Opus.\n */\nexport const PROVIDER_MODEL_TIERS: Record<string, Required<ModelTierOverrides>> = {\n anthropic: {\n small: \"claude-haiku-4-5-20251001\",\n default: \"claude-sonnet-4-6\",\n deep: \"claude-opus-4-6\",\n },\n openai: { small: \"gpt-4o-mini\", default: \"gpt-4.1\", deep: \"o3\" },\n google: { small: \"gemini-2.0-flash\", default: \"gemini-2.5-flash\", deep: \"gemini-2.5-pro\" },\n mistral: {\n small: \"mistral-small-latest\",\n default: \"mistral-large-latest\",\n deep: \"mistral-large-latest\",\n },\n groq: {\n small: \"llama-3.1-8b-instant\",\n default: \"llama-3.3-70b-versatile\",\n deep: \"llama-3.3-70b-versatile\",\n },\n deepseek: { small: \"deepseek-chat\", default: \"deepseek-chat\", deep: \"deepseek-reasoner\" },\n xai: { small: \"grok-3-mini\", default: \"grok-3\", deep: \"grok-3\" },\n together: {\n small: \"mistralai/Mixtral-8x7B-Instruct-v0.1\",\n default: \"meta-llama/Llama-3.3-70B-Instruct-Turbo\",\n deep: \"meta-llama/Llama-3.3-70B-Instruct-Turbo\",\n },\n fireworks: {\n small: \"accounts/fireworks/models/llama-v3p3-70b-instruct\",\n default: \"accounts/fireworks/models/llama-v3p3-70b-instruct\",\n deep: \"accounts/fireworks/models/deepseek-v3\",\n },\n openrouter: {\n small: \"anthropic/claude-haiku-4.5\",\n default: \"anthropic/claude-sonnet-4.6\",\n deep: \"anthropic/claude-opus-4.6\",\n },\n};\n\n/** Raised when a tier names an intent this provider cannot serve. */\nexport class ModelTierResolutionError extends Error {\n constructor(\n readonly tier: \"small\" | \"deep\",\n readonly provider: string | undefined,\n ) {\n super(\n `cannot resolve model tier \"${tier}\" for provider \"${provider ?? \"(none)\"}\": no built-in mapping and no configured override. ` +\n `Configure a \"${tier}\" model override for this provider, or author the node as model: \"default\" to inherit the session model.`,\n );\n this.name = \"ModelTierResolutionError\";\n }\n}\n\n/**\n * Resolve a tier for a deployment that has a registry: through `roles[tier]`\n * first, then the selected entry's `model_map[tier]`.\n *\n * A `model_map` **miss is a miss**. `parseModelRef` falls back to the literal\n * selector when nothing maps it, and no provider serves a model called\n * `\"small\"` — so only a genuine mapping counts, and an unmapped tier is left\n * for the caller to fail on.\n */\nfunction resolveTierThroughRegistry(\n tier: keyof ModelTierOverrides,\n options: ModelRegistryContext,\n): string | undefined {\n const { registry, roles, providerId } = options;\n if (!registry) return undefined;\n if (roles?.[tier] !== undefined) {\n const viaRole = parseModelRef(`@${tier}`, registry, roles);\n if (viaRole?.providerModelId) return viaRole.providerModelId;\n }\n const ref = parseModelRef(providerId ? `${providerId}/${tier}` : tier, registry, roles);\n if (!ref?.modelId) return undefined;\n return llmEntry(registry, ref.providerId)?.model_map?.[ref.modelId];\n}\n\n/** Options {@link resolveModelTier} reads. */\nexport interface ResolveModelTierOptions extends ModelRegistryContext {\n /** Legacy provider id, keying {@link PROVIDER_MODEL_TIERS}. */\n provider?: string;\n /** Legacy cloud transport; anything but `default` disables the built-in table. */\n cloud?: string;\n /** Per-tier ids configured for this deployment. Wins over everything. */\n overrides?: ModelTierOverrides;\n}\n\n/**\n * Resolve a Flow v2 `run.model` tier to a concrete model id.\n *\n * Precedence, highest first: a configured `overrides` entry; the registry —\n * `roles[tier]`, then the selected entry's `model_map[tier]`, which is how a\n * tier is defined for *any* provider; and finally, **only when no registry is\n * configured**, {@link PROVIDER_MODEL_TIERS} on the direct provider API.\n *\n * `\"default\"` and an absent tier **inherit `sessionModel` first**. The session\n * model is the one id known to work for this deployment — it already carries\n * whatever provider, lineup and gateway translation the host configured — so\n * preferring any table over it would silently downgrade a configured model\n * and, on a gateway transport, substitute an id that provider cannot serve.\n *\n * `\"small\"` and `\"deep\"` never fall back to `sessionModel`; when nothing above\n * resolves them they throw {@link ModelTierResolutionError}. Inheriting there\n * would run an arbitrary model behind an author's explicit request for a cheap\n * or a strong one — a cost or quality surprise that shows up only in the bill\n * or the output. Failing names it at the node instead.\n *\n * Pure: no I/O, no environment reads.\n */\nexport function resolveModelTier(\n tier: \"small\" | \"default\" | \"deep\" | undefined,\n sessionModel: string | undefined,\n options: ResolveModelTierOptions = {},\n): string | undefined {\n // Built-in ids address the provider's own API; a gateway renames them. And a\n // registry answers the question properly, so the table is its fallback only.\n const directApi = !options.cloud || options.cloud === \"default\";\n const builtIn =\n !options.registry && directApi && options.provider\n ? PROVIDER_MODEL_TIERS[options.provider]\n : undefined;\n if (tier === \"small\" || tier === \"deep\") {\n const resolved =\n options.overrides?.[tier] ?? resolveTierThroughRegistry(tier, options) ?? builtIn?.[tier];\n if (!resolved) throw new ModelTierResolutionError(tier, options.provider);\n return resolved;\n }\n return (\n options.overrides?.default ??\n sessionModel ??\n resolveTierThroughRegistry(\"default\", options) ??\n builtIn?.default\n );\n}\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { openLibrary } from './chunk-
|
|
2
|
-
import { getKindRegistry } from './chunk-
|
|
3
|
-
import { S, logErr, logWarn, logOk, logInfo } from './chunk-
|
|
4
|
-
import { resolveBinding, UnknownCompositionKindError } from './chunk-
|
|
5
|
-
import { filesEntryPaths, resolveIndexPath, LocalIndex, assetRootProblem, stampManifestPublisher, upsertManifestAsset } from './chunk-
|
|
6
|
-
import { SEMVER_RE, invalidSemverMessage, flowFileNameError, parseManifestFile, requiresSyntaxErrors } from './chunk-
|
|
1
|
+
import { openLibrary } from './chunk-5XYZNMMC.js';
|
|
2
|
+
import { getKindRegistry } from './chunk-HPQ2WDYC.js';
|
|
3
|
+
import { S, logErr, logWarn, logOk, logInfo } from './chunk-LXD37LHF.js';
|
|
4
|
+
import { resolveBinding, UnknownCompositionKindError } from './chunk-FO2GU5L7.js';
|
|
5
|
+
import { filesEntryPaths, resolveIndexPath, LocalIndex, assetRootProblem, stampManifestPublisher, upsertManifestAsset } from './chunk-7FXOOUOC.js';
|
|
6
|
+
import { SEMVER_RE, invalidSemverMessage, flowFileNameError, parseManifestFile, requiresSyntaxErrors } from './chunk-DRUAQ7IY.js';
|
|
7
7
|
import { parseFlowDefinition } from './chunk-JRN5QF4C.js';
|
|
8
|
-
import { SKILL_DESCRIPTION_PLACEHOLDER_PREFIX, FLOW_DESCRIPTION_PLACEHOLDER, FLOW_NODE_INSTRUCTION_PLACEHOLDER, PRESET_DESCRIPTION_PLACEHOLDER, PRESET_ITEM_PLACEHOLDER_REF, isScaffoldBody, composeSlotDiagnostics, agentDeprecationDiagnostics, composeRefTarget } from './chunk-
|
|
8
|
+
import { SKILL_DESCRIPTION_PLACEHOLDER_PREFIX, FLOW_DESCRIPTION_PLACEHOLDER, FLOW_NODE_INSTRUCTION_PLACEHOLDER, PRESET_DESCRIPTION_PLACEHOLDER, PRESET_ITEM_PLACEHOLDER_REF, isScaffoldBody, composeSlotDiagnostics, agentDeprecationDiagnostics, composeRefTarget } from './chunk-LCXQ4LVP.js';
|
|
9
9
|
import { checkAgentSkillConformance } from './chunk-MEU2HHGV.js';
|
|
10
10
|
import { matchPin } from './chunk-BNLXZXZN.js';
|
|
11
11
|
import { globalSkaileDir } from './chunk-L5VSIPQD.js';
|
|
@@ -1460,5 +1460,5 @@ function warnUntrackedAssetFiles(libPath) {
|
|
|
1460
1460
|
}
|
|
1461
1461
|
|
|
1462
1462
|
export { DEFAULT_VERSION, DOMAIN_REMOVED_HINT, MANIFEST_GLOBS, assetEntryRef, assetNamespace, bareName, checkAsset, checkAssetFile, checkComposeKinds, composeRefContext, declaredVersion, deviceLogin, duplicateAssetMessage, exitOnEmptyAsset, exitOnLibrarySymlinks, exitOnManifestPathProblems, exitOnManifestPublisherProblems, exitOnRootSkillExtraAssets, exitOnRootSkillLibrary, findAssetManifestFile, findEntryManifestFile, formatNamespaceAvailability, getAccessToken, getStoreIdentity, hasStoredAuth, indexLibrary, invalidPublisherMessage, invalidSemverText, libraryAssetRefusals, loadStoreAuthConfig, logout, manifestDependencyProblems, manifestEntryFilesRefusals, manifestEntryNameProblems, manifestEntryRenames, manifestEntryRootRefusals, manifestFilesProblems, manifestNamespaces, manifestParseErrorText, manifestParseFailureLine, manifestPublisherProblems, manifestRequiresProblems, manifestRootProblems, manifestVersionMismatchMessage, plannedRefs, preflightNamespace, publishToStore, readOnlyLibraryAt, refFor, registerLibraryAsset, registeredAssetKeys, rejectRemovedDomainOption, removedDomainOption, renameFileFix, reportLibrarySymlinks, requireValidPublisherOrExit, resolveLibraryPublisherDetailed, rootLevelAssetFileProblem, rootSkillExtraAssetProblems, unheldRequiresOfFile, unresolvedManifestDependencies, warnIgnoredDomainFiles, warnLegacyBundleFiles, warnLibraryNameFallback, warnUntrackedAssetFiles };
|
|
1463
|
-
//# sourceMappingURL=chunk-
|
|
1464
|
-
//# sourceMappingURL=chunk-
|
|
1463
|
+
//# sourceMappingURL=chunk-FECB7RI7.js.map
|
|
1464
|
+
//# sourceMappingURL=chunk-FECB7RI7.js.map
|