@skaile/workspaces 4.15.0 → 4.16.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 +12 -0
- package/dist/{asset-feeds-WJUCRFUC.js → asset-feeds-24G4CSZ5.js} +7 -7
- package/dist/{asset-feeds-WJUCRFUC.js.map → asset-feeds-24G4CSZ5.js.map} +1 -1
- package/dist/asset-manager/catalog-deployer.js +3 -3
- package/dist/asset-manager/index.js +6 -6
- package/dist/asset-manager/installer.js +4 -4
- package/dist/bridge/drivers/claude-sdk.js +5 -5
- package/dist/bridge/drivers/codex.js +5 -5
- package/dist/bridge/drivers/continue.js +7 -7
- package/dist/bridge/drivers/echo.js +1 -1
- package/dist/bridge/drivers/gemini.js +5 -5
- package/dist/bridge/drivers/goose.js +7 -7
- package/dist/bridge/drivers/omp.js +2 -2
- package/dist/bridge/drivers/opencode.js +81 -44
- package/dist/bridge/drivers/opencode.js.map +1 -1
- package/dist/bridge/drivers/qwen.js +5 -5
- package/dist/bridge/index.js +6 -6
- package/dist/bridge/src/drivers/_subprocess-cli.d.ts.map +1 -1
- package/dist/bridge/src/drivers/opencode.d.ts +18 -5
- package/dist/bridge/src/drivers/opencode.d.ts.map +1 -1
- package/dist/{chunk-DPKH7AK7.js → chunk-3JBERZ4E.js} +7 -7
- package/dist/{chunk-DPKH7AK7.js.map → chunk-3JBERZ4E.js.map} +1 -1
- package/dist/{chunk-NXTLDFLA.js → chunk-5RHPNNWP.js} +3 -3
- package/dist/{chunk-NXTLDFLA.js.map → chunk-5RHPNNWP.js.map} +1 -1
- package/dist/{chunk-WZQWZJYL.js → chunk-6GSZLKA5.js} +3 -3
- package/dist/{chunk-WZQWZJYL.js.map → chunk-6GSZLKA5.js.map} +1 -1
- package/dist/{chunk-LQMALDDB.js → chunk-CJGNYHPG.js} +2 -2
- package/dist/{chunk-LQMALDDB.js.map → chunk-CJGNYHPG.js.map} +1 -1
- package/dist/{chunk-RDOEZBVB.js → chunk-CPJRS7ZC.js} +6 -6
- package/dist/{chunk-RDOEZBVB.js.map → chunk-CPJRS7ZC.js.map} +1 -1
- package/dist/{chunk-QWGSKDD7.js → chunk-DF7C3KZK.js} +116 -5
- package/dist/chunk-DF7C3KZK.js.map +1 -0
- package/dist/{chunk-NKRAHM7T.js → chunk-GMXG2JGN.js} +3 -3
- package/dist/{chunk-NKRAHM7T.js.map → chunk-GMXG2JGN.js.map} +1 -1
- package/dist/{chunk-KFKOXYQC.js → chunk-I7F3CG4Y.js} +7 -7
- package/dist/{chunk-KFKOXYQC.js.map → chunk-I7F3CG4Y.js.map} +1 -1
- package/dist/{chunk-BRNGJTHH.js → chunk-IJTEDXWQ.js} +3 -3
- package/dist/{chunk-BRNGJTHH.js.map → chunk-IJTEDXWQ.js.map} +1 -1
- package/dist/{chunk-PB2Y4AMQ.js → chunk-J7WFDLV6.js} +4 -3
- package/dist/chunk-J7WFDLV6.js.map +1 -0
- package/dist/{chunk-IOFPX6OO.js → chunk-JZ52Y3ZR.js} +38 -20
- package/dist/chunk-JZ52Y3ZR.js.map +1 -0
- package/dist/{chunk-A2T4WIZL.js → chunk-KTCMBEEB.js} +3 -3
- package/dist/{chunk-A2T4WIZL.js.map → chunk-KTCMBEEB.js.map} +1 -1
- package/dist/{chunk-LCKZCLXA.js → chunk-KU473DRO.js} +2 -2
- package/dist/{chunk-LCKZCLXA.js.map → chunk-KU473DRO.js.map} +1 -1
- package/dist/{chunk-ZXQMKXWR.js → chunk-LDT6NGSL.js} +3 -3
- package/dist/{chunk-ZXQMKXWR.js.map → chunk-LDT6NGSL.js.map} +1 -1
- package/dist/{chunk-MK3OCWBG.js → chunk-MC2MF4U5.js} +15 -9
- package/dist/chunk-MC2MF4U5.js.map +1 -0
- package/dist/{chunk-E4Q5GKO2.js → chunk-MDRV5EWH.js} +7 -7
- package/dist/{chunk-E4Q5GKO2.js.map → chunk-MDRV5EWH.js.map} +1 -1
- package/dist/{chunk-2E3EGCQ3.js → chunk-MHAH5HDX.js} +2 -2
- package/dist/{chunk-2E3EGCQ3.js.map → chunk-MHAH5HDX.js.map} +1 -1
- package/dist/{chunk-3IAGNZH3.js → chunk-N7VQYYLZ.js} +5 -5
- package/dist/{chunk-3IAGNZH3.js.map → chunk-N7VQYYLZ.js.map} +1 -1
- package/dist/{chunk-6GHXBCE5.js → chunk-OH2ULGQX.js} +6 -6
- package/dist/{chunk-6GHXBCE5.js.map → chunk-OH2ULGQX.js.map} +1 -1
- package/dist/{chunk-LYENHKH5.js → chunk-OOBWIRWN.js} +9 -9
- package/dist/{chunk-LYENHKH5.js.map → chunk-OOBWIRWN.js.map} +1 -1
- package/dist/{chunk-VJKTXQ6D.js → chunk-PBQ57MIY.js} +3 -3
- package/dist/{chunk-VJKTXQ6D.js.map → chunk-PBQ57MIY.js.map} +1 -1
- package/dist/{chunk-ZXPIKQAN.js → chunk-PQE2MYB6.js} +3 -3
- package/dist/{chunk-ZXPIKQAN.js.map → chunk-PQE2MYB6.js.map} +1 -1
- package/dist/{chunk-I6BO67AL.js → chunk-RLR7L4TI.js} +4 -4
- package/dist/{chunk-I6BO67AL.js.map → chunk-RLR7L4TI.js.map} +1 -1
- package/dist/{chunk-FVKSVVVP.js → chunk-RPC2C3QL.js} +3 -3
- package/dist/{chunk-FVKSVVVP.js.map → chunk-RPC2C3QL.js.map} +1 -1
- package/dist/{chunk-EHKYZ7TL.js → chunk-S54UI7T3.js} +5 -5
- package/dist/{chunk-EHKYZ7TL.js.map → chunk-S54UI7T3.js.map} +1 -1
- package/dist/{chunk-W64ZXABT.js → chunk-TEQDWOBS.js} +3 -3
- package/dist/{chunk-W64ZXABT.js.map → chunk-TEQDWOBS.js.map} +1 -1
- package/dist/{chunk-WQPLZUXU.js → chunk-UFWADBG6.js} +4 -4
- package/dist/{chunk-WQPLZUXU.js.map → chunk-UFWADBG6.js.map} +1 -1
- package/dist/{chunk-7NRF7BQB.js → chunk-UWU572Q6.js} +4 -4
- package/dist/{chunk-7NRF7BQB.js.map → chunk-UWU572Q6.js.map} +1 -1
- package/dist/{chunk-4JGTXBQB.js → chunk-XFWB3KFV.js} +4 -4
- package/dist/{chunk-4JGTXBQB.js.map → chunk-XFWB3KFV.js.map} +1 -1
- package/dist/cli/index.js +64 -51
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/rebuild.d.ts.map +1 -1
- package/dist/connectors/config.js +2 -2
- package/dist/connectors/index.js +9 -9
- package/dist/connectors/src/config.d.ts +20 -3
- package/dist/connectors/src/config.d.ts.map +1 -1
- package/dist/connectors/src/index.d.ts +1 -1
- package/dist/connectors/src/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -3
- package/dist/core/runtime-assets.js +2 -2
- package/dist/core/src/index.d.ts +2 -2
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts +38 -4
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/workspace-config.js +1 -1
- package/dist/deploy/index.js +3 -3
- package/dist/{ensure-sources-6QOYW2PI.js → ensure-sources-KXELEK4M.js} +9 -9
- package/dist/{ensure-sources-6QOYW2PI.js.map → ensure-sources-KXELEK4M.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +9 -9
- package/dist/factory-assets/connectors/deploy.js +9 -9
- package/dist/factory-assets/connectors/devserver.js +9 -9
- package/dist/factory-assets/connectors/flow/adapter.js +9 -9
- package/dist/factory-assets/connectors/flow/engine.js +4 -4
- package/dist/factory-assets/connectors/flow/run-flow.js +10 -10
- package/dist/factory-assets/connectors/flow.js +9 -9
- package/dist/factory-assets/connectors/git.js +9 -9
- package/dist/factory-assets/connectors/gmail.js +9 -9
- package/dist/factory-assets/connectors/googledrive.js +9 -9
- package/dist/factory-assets/connectors/local.js +9 -9
- package/dist/factory-assets/connectors/mattermost.js +9 -9
- package/dist/factory-assets/connectors/memory.js +9 -9
- package/dist/factory-assets/connectors/minio.js +9 -9
- package/dist/factory-assets/connectors/postgres.js +9 -9
- package/dist/factory-assets/connectors/s3.js +9 -9
- package/dist/factory-assets/connectors/sharepoint.js +9 -9
- package/dist/factory-assets/connectors/sqlite.js +9 -9
- package/dist/factory-assets/connectors/static-server.js +9 -9
- package/dist/factory-assets/connectors/tunnel.js +9 -9
- package/dist/factory-assets/connectors/webdav.js +9 -9
- package/dist/factory-assets/connectors/xstate-store.js +9 -9
- package/dist/factory-assets/connectors/xstate.js +9 -9
- package/dist/{flows-7EB63Q2Q.js → flows-PDTAKFWM.js} +6 -6
- package/dist/{flows-7EB63Q2Q.js.map → flows-PDTAKFWM.js.map} +1 -1
- package/dist/{helpers-334DC7KB.js → helpers-RQ6LN6SH.js} +9 -9
- package/dist/{helpers-334DC7KB.js.map → helpers-RQ6LN6SH.js.map} +1 -1
- package/dist/library/index.js +4 -4
- package/dist/{library-publish-B5TLDFPF.js → library-publish-VL2UJJFB.js} +13 -13
- package/dist/{library-publish-B5TLDFPF.js.map → library-publish-VL2UJJFB.js.map} +1 -1
- package/dist/{open-library-2CMPISRN.js → open-library-XYYK7HHI.js} +11 -11
- package/dist/{open-library-2CMPISRN.js.map → open-library-XYYK7HHI.js.map} +1 -1
- package/dist/{paths-IK6Y4OIU.js → paths-6VH76QLZ.js} +6 -6
- package/dist/{paths-IK6Y4OIU.js.map → paths-6VH76QLZ.js.map} +1 -1
- package/dist/{plugin-store-LUJ4GXSO.js → plugin-store-4MXOIEHP.js} +5 -5
- package/dist/{plugin-store-LUJ4GXSO.js.map → plugin-store-4MXOIEHP.js.map} +1 -1
- package/dist/{project-NGIFJGPQ.js → project-P3XZE6TH.js} +10 -10
- package/dist/{project-NGIFJGPQ.js.map → project-P3XZE6TH.js.map} +1 -1
- package/dist/resolver/index.js +3 -3
- package/dist/runner/index.js +14 -14
- package/dist/runner/src/resources.d.ts +6 -6
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts +4 -2
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +6 -6
- package/dist/sdk/bridge.js +6 -6
- package/dist/sdk/core.js +3 -3
- package/dist/sdk/flow.js +4 -4
- package/dist/sdk/index.js +14 -14
- package/dist/sdk/resolver.js +3 -3
- package/dist/sdk/runner.js +14 -14
- package/dist/{setup-GVJL3V3D.js → setup-IIILB5GF.js} +13 -13
- package/dist/{setup-GVJL3V3D.js.map → setup-IIILB5GF.js.map} +1 -1
- package/dist/{skills-YB5RHUAT.js → skills-FA4VQEO7.js} +5 -5
- package/dist/{skills-YB5RHUAT.js.map → skills-FA4VQEO7.js.map} +1 -1
- package/dist/{source-BPLSCZLB.js → source-MU7Y42BZ.js} +12 -12
- package/dist/{source-BPLSCZLB.js.map → source-MU7Y42BZ.js.map} +1 -1
- package/dist/{source-manifest-publish-ZVR24GCL.js → source-manifest-publish-FIVCIPSO.js} +14 -14
- package/dist/{source-manifest-publish-ZVR24GCL.js.map → source-manifest-publish-FIVCIPSO.js.map} +1 -1
- package/dist/tui/index.js +14 -14
- package/dist/workspace-plugin/adapters/mcp.js +5 -5
- 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-IOFPX6OO.js.map +0 -1
- package/dist/chunk-MK3OCWBG.js.map +0 -1
- package/dist/chunk-PB2Y4AMQ.js.map +0 -1
- package/dist/chunk-QWGSKDD7.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../workspace-plugin/src/tools/flows.ts"],"names":[],"mappings":";;;;;AAmBA,eAAsB,SAAS,UAAA,EAAyC;AACtE,EAAA,IAAI;AACF,IAAA,MAAM,UAAA,GAAa,MAAM,gBAAA,CAAiB,UAAU,CAAA;AACpD,IAAA,IAAI,CAAC,UAAA,EAAY,OAAO,MAAA,CAAO,EAAE,CAAA;AACjC,IAAA,MAAM,EAAE,YAAA,EAAa,GAAI,MAAM,OAC7B,4CACF,CAAA;AACA,IAAA,MAAM,KAAA,GAAQ,aAAa,UAAU,CAAA;AACrC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IAAI,CAAA,YAAa,KAAA,GAAQ,EAAE,OAAA,GAAU,MAAA,CAAO,CAAC,CAAC,CAAA;AAAA,EACvD;AACF","file":"chunk-KU473DRO.js","sourcesContent":["// src/tools/flows.ts\n\nimport type { ToolResult } from \"../types.js\";\nimport { err, okJson } from \"../types.js\";\nimport { findAiAssetsRoot } from \"../utils/ai-assets.js\";\nimport { readAllSessions } from \"./sessions.js\";\n\n// ── Flow tools ────────────────────────────────────────────────────────────────\n\n/**\n * List all flow definitions available in the project's `ai-assets` directory.\n *\n * Returns a JSON array of summary objects `{ id, name, nodeCount }`.\n * Returns an empty array when no `ai-assets` root is found.\n *\n * @param projectDir - Absolute path to the skaile project root.\n *\n * @docLink packages/workspace-plugin/concepts#tool-delivery\n */\nexport async function flowList(projectDir: string): Promise<ToolResult> {\n try {\n const assetsRoot = await findAiAssetsRoot(projectDir);\n if (!assetsRoot) return okJson([]);\n const { loadAllFlows } = await import(\n \"@skaile/workspaces/factory-assets/connectors/flow/engine\"\n );\n const flows = loadAllFlows(assetsRoot);\n const summary = flows.map((f: any) => ({\n id: f.id,\n name: f.name ?? f.id,\n nodeCount: f.nodes?.length ?? 0,\n }));\n return okJson(summary);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n\n/**\n * Show the full flow definition (nodes, edges, metadata) for a specific flow.\n *\n * @param projectDir - Absolute path to the skaile project root.\n * @param flowId - Flow ID as returned by {@link flowList}.\n *\n * @docLink packages/workspace-plugin/concepts#tool-delivery\n */\nexport async function flowShow(projectDir: string, flowId: string): Promise<ToolResult> {\n try {\n const assetsRoot = await findAiAssetsRoot(projectDir);\n if (!assetsRoot) return err(`Flow not found: ${flowId}`);\n const { loadAllFlows } = await import(\n \"@skaile/workspaces/factory-assets/connectors/flow/engine\"\n );\n const flows = loadAllFlows(assetsRoot);\n const flow = flows.find((f: any) => f.id === flowId);\n if (!flow) return err(`Flow not found: ${flowId}`);\n return okJson(flow);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n\n/**\n * List all past and active flow run sessions for the workspace.\n *\n * Delegates to {@link readAllSessions} (reads `.skaile/sessions/*.json`),\n * sorted newest-first by `updatedAt`.\n *\n * @param projectDir - Absolute path to the skaile project root.\n *\n * @docLink packages/workspace-plugin/concepts#tool-delivery\n */\nexport async function flowListSessions(projectDir: string): Promise<ToolResult> {\n try {\n const sessions = await readAllSessions(projectDir);\n return okJson(sessions);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n\n/**\n * Get driver metadata for a specific flow run session.\n *\n * @param projectDir - Absolute path to the skaile project root.\n * @param runId - Run ID from {@link flowListSessions}.\n *\n * @docLink packages/workspace-plugin/concepts#tool-delivery\n */\nexport async function flowGetSession(projectDir: string, runId: string): Promise<ToolResult> {\n try {\n const sessions = await readAllSessions(projectDir);\n const session = sessions.find((s) => s.runId === runId);\n if (!session) return err(`Session not found: ${runId}`);\n return okJson(session);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n\n/**\n * Resolve and return the flow definition that was used in a past session.\n *\n * Looks up the session by `runId`, reads its `flowId`, then returns the full\n * flow definition from `ai-assets`.\n *\n * @param projectDir - Absolute path to the skaile project root.\n * @param runId - Run ID from {@link flowListSessions}.\n *\n * @docLink packages/workspace-plugin/concepts#tool-delivery\n */\nexport async function flowFindFlowForSession(\n projectDir: string,\n runId: string,\n): Promise<ToolResult> {\n try {\n const sessions = await readAllSessions(projectDir);\n const session = sessions.find((s) => s.runId === runId);\n if (!session) return err(`Session not found: ${runId}`);\n\n const assetsRoot = await findAiAssetsRoot(projectDir);\n if (!assetsRoot) return err(`Flow not found for session: ${runId} (no ai-assets root)`);\n\n const { loadAllFlows } = await import(\n \"@skaile/workspaces/factory-assets/connectors/flow/engine\"\n );\n const flows = loadAllFlows(assetsRoot);\n const flow = flows.find((f: any) => f.id === session.flowId);\n if (!flow) return err(`Flow not found: ${session.flowId}`);\n return okJson(flow);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getProviderPreset, resolvePresetBaseUrl, expandPreset, resolveProbeUrl, buildCredentialHeaders, presetBaseUrl } from './chunk-
|
|
1
|
+
import { getProviderPreset, resolvePresetBaseUrl, expandPreset, resolveProbeUrl, buildCredentialHeaders, presetBaseUrl } from './chunk-CJGNYHPG.js';
|
|
2
2
|
import { resolveEntryBaseUrl, entryTransport, parseModelRef, registryEntries } from './chunk-GZZPKAV5.js';
|
|
3
3
|
import { modelIdSchemaForTarget } from './chunk-N7B3LZ7V.js';
|
|
4
4
|
|
|
@@ -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-LDT6NGSL.js.map
|
|
327
|
+
//# sourceMappingURL=chunk-LDT6NGSL.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,gBAA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A,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-ZXQMKXWR.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 `OmpDriver.listModels()` in the bridge driver.\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,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;A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AC1F,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-LDT6NGSL.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 `OmpDriver.listModels()` in the bridge driver.\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,4 +1,4 @@
|
|
|
1
|
-
import { resolveSkWorkspaceConfig } from './chunk-
|
|
1
|
+
import { resolveSkWorkspaceConfig } from './chunk-DF7C3KZK.js';
|
|
2
2
|
import { parseFrontmatter } from './chunk-2FBPAR2V.js';
|
|
3
3
|
import { createLogger } from './chunk-BOFL7GIF.js';
|
|
4
4
|
import { readFileSync, existsSync, readdirSync, statSync } from 'fs';
|
|
@@ -350,20 +350,26 @@ var SecretProviderChain = class {
|
|
|
350
350
|
// connectors/src/config.ts
|
|
351
351
|
var configLog = createLogger({ kind: "connector", subkind: "config" });
|
|
352
352
|
function loadConnectorDeclarations(projectDir) {
|
|
353
|
+
return withMaterializedConnectorDeclarations(
|
|
354
|
+
loadYamlConnectorDeclarations(projectDir),
|
|
355
|
+
projectDir
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
function loadYamlConnectorDeclarations(projectDir) {
|
|
353
359
|
const config = resolveSkWorkspaceConfig(projectDir);
|
|
354
360
|
if (config.mounts && config.mounts.length > 0) {
|
|
355
361
|
throw new Error(
|
|
356
362
|
"'mounts:' is no longer supported \u2014 move entries under 'connectors:' with a 'mount:' sub-block. See docs/migration-mounts-to-connectors.md"
|
|
357
363
|
);
|
|
358
364
|
}
|
|
359
|
-
|
|
365
|
+
return config.connectors && config.connectors.length > 0 ? config.connectors.map(workspaceConnectorToDeclaration) : [];
|
|
366
|
+
}
|
|
367
|
+
function withMaterializedConnectorDeclarations(base, projectDir) {
|
|
360
368
|
const byId = /* @__PURE__ */ new Map();
|
|
361
|
-
for (const d of
|
|
369
|
+
for (const d of base) byId.set(d.id, d);
|
|
362
370
|
for (const d of loadMaterializedConnectorDeclarations(projectDir)) {
|
|
363
371
|
if (byId.has(d.id)) {
|
|
364
|
-
configLog.warn(
|
|
365
|
-
`materialized connector '${d.id}' shadowed by an explicit skaile.yaml connector`
|
|
366
|
-
);
|
|
372
|
+
configLog.warn(`materialized connector '${d.id}' shadowed by an explicit connector`);
|
|
367
373
|
continue;
|
|
368
374
|
}
|
|
369
375
|
byId.set(d.id, d);
|
|
@@ -485,6 +491,6 @@ function resolveAuthRef(auth, mountId) {
|
|
|
485
491
|
throw new LegacyAuthGrammarError(auth, mountId);
|
|
486
492
|
}
|
|
487
493
|
|
|
488
|
-
export { ConnectorFieldMissingError, ConnectorStartupError, EnvSecretProvider, ForgeSecretProvider, InMemorySecretProvider, LegacyAuthGrammarError, LockedSecretProvider, OAuthRequiredError, PreMintedSecretProvider, SecretProviderChain, createCliSecretProviderChain, createForgeSecretProviderChain, deriveSingleMaterializedConnectorDeclaration, fromMaterializedConnectorMd, isKnownSecretRef, loadConnectorDeclarations, loadMaterializedConnectorDeclarations, readUnavailableMarker, resolveAuthRef, resolveBackendAuthFor, resolvedConfigToDeclarations };
|
|
489
|
-
//# sourceMappingURL=chunk-
|
|
490
|
-
//# sourceMappingURL=chunk-
|
|
494
|
+
export { ConnectorFieldMissingError, ConnectorStartupError, EnvSecretProvider, ForgeSecretProvider, InMemorySecretProvider, LegacyAuthGrammarError, LockedSecretProvider, OAuthRequiredError, PreMintedSecretProvider, SecretProviderChain, createCliSecretProviderChain, createForgeSecretProviderChain, deriveSingleMaterializedConnectorDeclaration, fromMaterializedConnectorMd, isKnownSecretRef, loadConnectorDeclarations, loadMaterializedConnectorDeclarations, loadYamlConnectorDeclarations, readUnavailableMarker, resolveAuthRef, resolveBackendAuthFor, resolvedConfigToDeclarations, withMaterializedConnectorDeclarations };
|
|
495
|
+
//# sourceMappingURL=chunk-MC2MF4U5.js.map
|
|
496
|
+
//# sourceMappingURL=chunk-MC2MF4U5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../connectors/src/connector-types.ts","../connectors/src/materialized-connectors.ts","../connectors/src/secrets.ts","../connectors/src/config.ts"],"names":[],"mappings":";;;;;;;AA8GO,SAAS,sBAAsB,KAAA,EAA+C;AACnF,EAAA,IAAI,UAAU,MAAA,IAAa,KAAA,KAAU,IAAA,IAAQ,KAAA,KAAU,OAAO,OAAO,MAAA;AACrE,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,CAAM,IAAA,OAAW,EAAA,EAAI,OAAO,EAAE,MAAA,EAAQ,K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CAAA,mCAAA,EAAsC,KAAK,CAAA,GAAA,EAAM,IAAI,CAAA;AAAA;AAAA;AAAA,4DAAA;AAAA,KAKvD;AACA,IAAA,IAAA,CAAK,IAAA,GAAO,wBAAA;AACZ,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AAAA,EACd;AACF;AAmBO,SAAS,qBAAA,CACd,IAAA,EACA,EAAA,EACA,KAAA,EACoB;AACpB,EAAA,IAAI,CAAC,OAAO,OAAO,MAAA;AACnB,EAAA,OAAO,MAAM,OAAA,CAAQ,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,EAAE,CAAA,CAAE,CAAA;AACtC;AAmBO,SAAS,cAAA,CACd,MACA,OAAA,EAC0B;AAC1B,EAAA,IAAI,CAAC,MAAM,OAAO,MAAA;AAElB,EAAA,IAAI,SAAS,SAAA,EAAW;AACtB,IAAA,OAAO,EAAE,IAAA,EAAM,SAAA,EAAW,KAAA,EAAO,EAAA,EAAI,KAAK,IAAA,EAAK;AAAA,EACjD;AACA,EAAA,IAAI,IAAA,CAAK,UAAA,CAAW,MAAM,CAAA,EAAG;AAC3B,IAAA,OAAO,EAAE,IAAA,EAAM,KAAA,EAAO,KAAA,EAAO,IAAA,CAAK,MAAM,MAAA,CAAO,MAAM,CAAA,EAAG,GAAA,EAAK,IAAA,EAAK;AAAA,EACpE;AAIA,EAAA,MAAM,IAAI,sBAAA,CAAuB,IAAA,EAAM,OAAO,CAAA;AAChD","file":"chunk-MC2MF4U5.js","sourcesContent":["/**\n * Connector adapter infrastructure types.\n *\n * Connectors are external backends (databases, KV stores, object stores,\n * in-process state, git repos, etc.). A connector exposes up to two faces: a\n * `ToolFace` (agents access it through injected tools) and/or a\n * `FilesystemFace` (the connector projects content into a mounted directory).\n *\n * @docLink packages/connectors/concepts#connector-types\n */\n\nimport type {\n ConnectorContent,\n ConnectorEntry,\n ListOptions,\n OperationDescriptor,\n SearchOptions,\n SearchResult,\n SyncOptions,\n SyncResult,\n WatchHandle,\n WatchOptions,\n} from \"./shared-types.js\";\n\nexport type { OperationDescriptor } from \"./shared-types.js\";\n\nimport type { Logger } from \"@skaile/workspaces/types\";\nimport type { SecretProvider } from \"./secrets.js\";\n\n// ── Connector declaration (runtime config, resolved from skaile.yaml) ────────\n\n/**\n * Parsed connector configuration from `skaile.yaml`, passed to `ConnectorAdapter.connect()` and held by `ConnectorManager`.\n * @docLink packages/connectors/concepts#connector-declaration\n */\nexport interface ConnectorDeclaration {\n /** Unique identifier for this connector instance. */\n id: string;\n /** Driver type: \"postgres\", \"redis\", \"memory\", \"xstate\", \"yjs\", etc. */\n driver: string;\n /**\n * Human-readable connection name, projected from the materialized CONNECTOR.md\n * frontmatter `label`. The platform resource-explorer tab renders this over the\n * driver name when present; absent for connectors with no configured name.\n */\n label?: string;\n /** Access level enforced by the manager. */\n access: \"read-only\" | \"read-write\";\n /** Credential reference: \"env:VAR_NAME\" or inline value. */\n auth?: string;\n /**\n * Backend provider link id for `auth: \"backend\"` connectors. The runner's\n * token-refresh mediator passes this as the `host.refresh_credential` `id` so\n * the platform resolves the credential against the right provider link.\n */\n providerLinkId?: string;\n /**\n * Operating mode for connectors that manage a working copy. Orthogonal to\n * faces. `agent` = the agent drives the source natively (e.g. native git) and\n * the connector only provisions short-lived credentials. `sync` = the\n * connector owns the working copy (clone + watch + auto-commit/pull). Absent =\n * the driver's legacy `options.{session,sync,lifecycle}` blocks decide.\n */\n mode?: \"agent\" | \"sync\";\n /** Driver-specific configuration. */\n options?: Record<string, unknown>;\n /**\n * Owner-authored instruction text projected from the materialized\n * CONNECTOR.md body (preset custom instructions). Injected eagerly into the\n * agent system prompt. Absent when the body is empty.\n */\n instructions?: string;\n /** Filesystem-face config — only meaningful for mountable connectors. */\n mount?: {\n /** Source URL or path (repo URL, bucket name, host path). */\n source: string;\n /** Override mount target directory (default: `.mounts/<id>/`). */\n target?: string;\n /** Watch flag: omitted → watch read-write, skip read-only. */\n watch?: boolean;\n /** Expert-only: expose the resolved credential to the agent CLI. */\n exposeAccessToken?: boolean;\n /** Optional access-token TTL override (seconds). */\n accessTokenTTL?: number;\n };\n /**\n * Set by the host when it has already decided this connector cannot be\n * attached (e.g. a cloud mount whose host-side build failed). The manager\n * never calls the driver for it and reports it as failed with this reason.\n */\n unavailable?: UnavailableMarker;\n}\n\n/**\n * Why the host declared a connector without making it available. `reason` is\n * a short machine-readable token chosen by the host; `detail` is its prose.\n * @docLink packages/connectors/concepts#connector-declaration\n */\nexport interface UnavailableMarker {\n reason: string;\n detail?: string;\n}\n\n/**\n * Read an `unavailable:` value from an untyped declaration. Absent, `null` and\n * `false` mean \"not marked\". Any other value marks the connector unavailable —\n * a host that wrote the key meant it. A plain string is taken as the reason;\n * anything else that is not a `{ reason, detail? }` object gets a generic one.\n * @docLink packages/connectors/concepts#connector-declaration\n */\nexport function readUnavailableMarker(value: unknown): UnavailableMarker | undefined {\n if (value === undefined || value === null || value === false) return undefined;\n if (typeof value === \"string\" && value.trim() !== \"\") return { reason: value };\n if (typeof value !== \"object\") return { reason: \"unavailable\" };\n const { reason, detail } = value as { reason?: unknown; detail?: unknown };\n const marker: UnavailableMarker = {\n reason: typeof reason === \"string\" && reason.trim() !== \"\" ? reason : \"unavailable\",\n };\n if (typeof detail === \"string\" && detail.trim() !== \"\") marker.detail = detail;\n return marker;\n}\n\n// ── Connector handle (returned by adapter.connect) ───────────────────────────\n\n/**\n * Live state of a connected backend, returned by `Connector.connect()` (or the\n * legacy `ConnectorAdapter.connect()`) and held by `ConnectorManager`.\n * @docLink packages/connectors/concepts#connector-handle\n */\nexport interface ConnectorHandle {\n /** Connector declaration ID. */\n readonly id: string;\n /** Driver name. */\n readonly driver: string;\n /** Effective access level. */\n readonly access: \"read-only\" | \"read-write\";\n /** Lifecycle status. Set by every `Connector`. */\n status: \"connecting\" | \"connected\" | \"error\" | \"disconnected\";\n /** Present iff the connector has a filesystem face and is mounted. */\n mountPath?: string;\n /** Adapter-specific state (connection pool, client, etc.). Opaque to callers. */\n state: unknown;\n}\n\n/** Optional capability a filesystem-face connector attaches to its handle state\n * when reads need an authoritative remote byte size rather than trusting local\n * filesystem metadata.\n */\nexport interface AuthoritativeSizeProvider {\n authoritativeSize(relPath: string): Promise<number | null>;\n}\n\n// ── Connector change event ────────────────────────────────────────────────────\n\n/**\n * Change event emitted by a connector adapter's `watch()` implementation.\n * @docLink packages/connectors/concepts#connector-change-event\n */\nexport interface ConnectorChangeEvent {\n /** Relative path, key, table name, node ID, etc. */\n path: string;\n /** What happened. */\n action: \"create\" | \"edit\" | \"delete\" | \"conflict\";\n /** What caused the change. */\n source: \"filesystem\" | \"operation\" | \"remote\" | \"sync\";\n}\n\n// ── ConnectorManager info ────────────────────────────────────────────────────\n\n/**\n * Summary of a connected connector returned by `ConnectorManager.listConnectors()`.\n * @docLink packages/connectors/concepts#connector-info\n */\nexport interface ConnectorInfo {\n id: string;\n driver: string;\n /** Human-readable connection name; the resource-explorer tab renders this over `id`/`driver` when present. */\n label?: string;\n access: \"read-only\" | \"read-write\";\n /** Operation names this connector exposes as agent tools (via describeOperations). */\n operations: string[];\n}\n\n/**\n * Bulk connect/disconnect result returned by `ConnectorManager.connectAll()` and `disconnectAll()`.\n * @docLink packages/connectors/concepts#connector-report\n */\nexport interface ConnectorReport {\n results: Array<{ id: string; connected: boolean; error?: string }>;\n}\n\n// ── Field spec (connector credential/config declarations) ────────────────────\n\n/**\n * Input types for `ConnectorFieldSpec`. Controls validation rules and the Forge UI affordance.\n * @docLink packages/connectors/concepts#field-type\n */\nexport type FieldType =\n | \"text\" // plain string\n | \"password\" // sensitive; always stored via SecretProvider\n | \"api-key\" // alias for password with specific UI affordance\n | \"url\" // validated URL string\n | \"oauth\" // triggers OAuth flow; oauthService required\n | \"select\" // enum; choices required and non-empty\n | \"boolean\" // default must be \"true\" or \"false\" if provided\n | \"number\"; // default must be a parseable numeric string if provided\n\n/**\n * Declares one credential or configuration field that a connector adapter requires.\n * Used by `ConnectorManager.resolveFields()` and the Forge settings UI.\n * @docLink packages/connectors/concepts#connector-field-spec\n */\nexport interface ConnectorFieldSpec {\n /** Machine name used as the options key in skaile.yaml. */\n key: string;\n /** Human-readable label for the forge settings UI. */\n label: string;\n /** Tooltip / help text. */\n description?: string;\n /** Input type. Controls validation rules and UI affordance in the forge settings panel. */\n type: FieldType;\n /** Whether the adapter refuses to connect when this field is missing. */\n required: boolean;\n /** String fallback used when not provided and not required. */\n default?: string;\n /** Forge UI masks the value; value is never logged. */\n sensitive: boolean;\n /** UI grouping: \"Authentication\", \"Connection\", \"Options\". */\n group?: string;\n /**\n * Required when type === \"select\"; must be non-empty.\n */\n choices?: string[];\n /**\n * Required when type === \"oauth\".\n * Identifies the OAuth service, e.g. \"google\".\n * Used to call OAuthSecretProvider.initiateFlow(oauthService, account).\n * oauth fields must be declared AFTER any field they reference (e.g., \"account\").\n */\n oauthService?: string;\n /** Example value shown as placeholder text in the forge settings UI. */\n example?: string;\n}\n\n/**\n * Thrown by `ConnectorManager.connectAll()` and `resolveFields()` when a required\n * adapter field cannot be resolved through the `SecretProviderChain`. Carries the\n * connector ID, the missing field spec, the ref that was tried, and the available\n * providers for actionable error messages.\n * @docLink packages/connectors/concepts#connector-field-missing-error\n */\nexport class ConnectorFieldMissingError extends Error {\n readonly connectorId: string;\n readonly field: ConnectorFieldSpec;\n readonly triedRef: string;\n readonly availableProviders: string[];\n\n constructor(opts: {\n connectorId: string;\n field: ConnectorFieldSpec;\n triedRef: string;\n availableProviders: string[];\n }) {\n super(\n `Connector \"${opts.connectorId}\" is missing required field \"${opts.field.key}\" ` +\n `(tried: ${opts.triedRef || \"(none)\"}). ` +\n `Available providers: ${opts.availableProviders.join(\", \") || \"(none)\"}`,\n );\n this.name = \"ConnectorFieldMissingError\";\n this.connectorId = opts.connectorId;\n this.field = opts.field;\n this.triedRef = opts.triedRef;\n this.availableProviders = opts.availableProviders;\n }\n}\n\n// ── Runtime skill descriptor ──────────────────────────────────────────────────\n\n/**\n * Instance-specific skill descriptor returned by `ConnectorAdapter.describeSkill()`.\n * Returned by `ConnectorManager.listSkills()` to surface connector capabilities to the agent.\n * @docLink packages/connectors/concepts#runtime-skill-descriptor\n */\nexport interface RuntimeSkillDescriptor {\n /** Connector instance id, e.g. \"gmail-work\". */\n id: string;\n /** Short label: \"Gmail — work@company.com\". */\n name: string;\n /** Instance-specific description: \"Read and write email for work@company.com\". */\n description: string;\n /** Category for grouping in the forge UI. */\n category: string;\n access: \"read-only\" | \"read-write\";\n /** Operation names (without loading full defs) for agent planning. */\n toolNames: string[];\n}\n\n// ── Token mediator (Tier-2 credential mediation) ─────────────────────────────\n\n/**\n * Result of a single `TokenMediator` call. Mirrors\n * `AccessTokenResponseEvent.result` from `@skaile/workspaces/types` so the runner\n * can pass it straight through.\n *\n * @docLink packages/connectors/api-reference#token-mediator\n */\nexport type TokenMediatorResult =\n | {\n ok: true;\n /** Access token to use for the next git operation. */\n token: string;\n /**\n * ISO-8601 expiry, or `null` for indefinite tokens (static PATs). Drives\n * whether the driver schedules a refresh tick.\n */\n expiresAt: string | null;\n /** Optional scope/permissions list, surfaced in audit logs. */\n scope?: string[];\n }\n | {\n ok: false;\n code: \"not-configured\" | \"revoked\" | \"provider-error\" | \"backend-error\" | \"timeout\";\n /** Human-readable detail, never carries secrets. */\n message: string;\n };\n\n/**\n * Function signature mountable connectors use to acquire a fresh access token\n * from the runner-owned backend mediator. Implemented by the runner: emits a\n * `request_access_token` command over the transport and resolves with the\n * matching `access_token_response` payload.\n *\n * Connectors MUST treat this as the only token source when the parsed\n * `MountAuthRef.kind === 'backend'`. Local minting (PAT, OAuth, GitHub App)\n * has been removed from the runner — provider dispatch lives on the platform.\n *\n * @docLink packages/connectors/api-reference#token-mediator\n */\nexport type TokenMediator = (input: {\n connectorId: string;\n reason: \"initial\" | \"refresh\" | \"retry-401\";\n /**\n * Connector driver, used by the runner mediator to pick the platform refresh\n * `kind`; absent on `initial` and for legacy callers.\n */\n driver?: string;\n /**\n * Backend provider link id — the `id` the platform `host.refresh_credential`\n * capability resolves the credential against. Absent on `initial` and for\n * legacy callers.\n */\n providerLinkId?: string;\n}) => Promise<TokenMediatorResult>;\n\n// ── S3 presigner (backend-signed S3 reads) ───────────────────────────────────\n\n/**\n * Request to the platform's runtime capability `host.s3_presign`. `mountId` is\n * the connector id of an `auth: backend` S3 mount in this session; bucket,\n * prefix and endpoint come from the platform's copy of that declaration.\n */\nexport type S3PresignRequest =\n | { mountId: string; op: \"list\"; continuationToken?: string }\n | { mountId: string; op: \"get\"; keys: string[] };\n\n/**\n * Answer from `host.s3_presign`. `list` carries one ListObjectsV2 URL, `get`\n * one GetObject URL per key; folder markers (keys ending in `/`) are listed in\n * `skipped` instead. Every URL expires at `expiresAt` (ten minutes today).\n */\nexport type S3PresignResult =\n | { ok: true; op: \"list\"; url: string; expiresAt: string }\n | {\n ok: true;\n op: \"get\";\n urls: { key: string; url: string }[];\n skipped: { key: string; reason: string }[];\n expiresAt: string;\n }\n | { ok: false; code: string; message: string };\n\n/**\n * Presign client for `auth: backend` S3 mounts, implemented by the runner over\n * the same remote-capability channel as {@link TokenMediator}. The S3 keys stay\n * in the backend; the container only ever sees short-lived read URLs.\n * Never throws: transport failures resolve as `{ ok: false, code: \"backend-error\" }`.\n */\nexport type S3Presigner = (request: S3PresignRequest) => Promise<S3PresignResult>;\n\n// ── Unified connector types ───────────────────────────────────────────────────\n\n/**\n * Context passed to `Connector.connect()` by `ConnectorManager`.\n * @docLink packages/connectors/concepts#connect-context\n */\nexport interface ConnectContext {\n /** Secret provider for resolving credential references. */\n secrets?: SecretProvider;\n /**\n * Backend token mediator — present for `auth: backend` connectors of either\n * face (filesystem or tool), so mount refresh and tool-face OAuth flows share\n * one path.\n */\n tokenMediator?: TokenMediator;\n /**\n * Backend S3 presigner — the read path for `auth: backend` S3 mounts. Absent\n * outside a platform-connected runner.\n */\n s3Presigner?: S3Presigner;\n /**\n * Absolute directory the manager allocated for the filesystem face.\n * Present iff `connector.filesystem != null`. The connector projects its\n * content here during `connect()` and sets `handle.mountPath`.\n */\n mountTarget?: string;\n /** Resolved credential/config fields (from `describeFields()`). */\n resolvedFields?: Record<string, string>;\n /**\n * Aborted when the owning `ConnectorManager` is disposed. Long-running\n * `connect()` implementations — notably background (deferred) filesystem\n * mounts — should observe this and bail out promptly so session cleanup\n * does not wait on a wedged remote.\n */\n abortSignal?: AbortSignal;\n}\n\n/**\n * Filesystem face — present ⇒ the connector is \"mountable\".\n * @docLink packages/connectors/concepts#filesystem-face\n */\nexport interface FilesystemFace {\n /** Pull latest remote state into the mounted directory. */\n sync(handle: ConnectorHandle, options?: SyncOptions): Promise<SyncResult>;\n}\n\n/**\n * Tool face — present ⇒ the connector exposes agent tools.\n * @docLink packages/connectors/concepts#tool-face\n */\nexport interface ToolFace {\n read?(handle: ConnectorHandle, path: string): Promise<ConnectorContent | null>;\n write?(handle: ConnectorHandle, path: string, content: ConnectorContent): Promise<void>;\n delete?(handle: ConnectorHandle, path: string): Promise<boolean>;\n list?(handle: ConnectorHandle, path?: string, options?: ListOptions): Promise<ConnectorEntry[]>;\n search?(handle: ConnectorHandle, query: string, options?: SearchOptions): Promise<SearchResult[]>;\n describeOperations(handle: ConnectorHandle): OperationDescriptor[];\n executeOp(\n handle: ConnectorHandle,\n operation: string,\n args: Record<string, unknown>,\n ): Promise<string>;\n describeSkill?(\n handle: ConnectorHandle,\n declaration: ConnectorDeclaration,\n ): RuntimeSkillDescriptor;\n}\n\n/**\n * The unified connector contract. A connector should expose at least one face\n * (`filesystem` and/or `tools`); `ConnectorManager` rejects a faceless\n * connector at connect time.\n * @docLink packages/connectors/concepts#connector\n */\nexport interface Connector {\n readonly name: string;\n connect(declaration: ConnectorDeclaration, ctx: ConnectContext): Promise<ConnectorHandle>;\n disconnect(handle: ConnectorHandle): Promise<void>;\n readonly filesystem?: FilesystemFace;\n readonly tools?: ToolFace;\n describeFields?(): ConnectorFieldSpec[];\n setLogger?(logger: Logger): void;\n watch?(\n handle: ConnectorHandle,\n callback: (e: ConnectorChangeEvent) => void,\n options?: WatchOptions,\n ): WatchHandle;\n onHibernate?(handle: ConnectorHandle): Promise<string | undefined>;\n onSessionClose?(handle: ConnectorHandle): Promise<string | undefined>;\n}\n\n/**\n * Factory used by the connector registry.\n * @docLink packages/connectors/api-reference#connector-factory\n */\nexport type ConnectorFactory = () => Connector;\n\n/**\n * Per-connector bulk-connect result returned by `ConnectorManager.connectAll()`.\n * @docLink packages/connectors/concepts#connector-startup-report\n */\nexport interface ConnectorStartupReport {\n results: Array<{\n id: string;\n connected: boolean;\n mountPath?: string;\n error?: string;\n access?: \"read-only\" | \"read-write\";\n }>;\n}\n\n/**\n * A connector that failed to connect, as returned by\n * `ConnectorManager.listFailedConnectors()`.\n *\n * A failed connector never enters the manager's active map, so it is absent\n * from `listConnectors()` and `get()` by design — those describe what the agent\n * can actually use. This record is the second list that keeps the failure\n * itself visible.\n *\n * @docLink packages/connectors/concepts#connector-manager\n */\nexport interface FailedConnectorInfo {\n id: string;\n driver: string;\n access: \"read-only\" | \"read-write\";\n label?: string;\n /** `mount.source` when declared. */\n source?: string;\n /** Resolved absolute mount target, when the declaration has a mount. */\n mountPath?: string;\n /** True when the failure is fail-fast material: read-write AND mount-bearing. */\n required: boolean;\n /** The connect error message. */\n error: string;\n /** Present when the host declared the connector unavailable; no connect was attempted. */\n unavailable?: UnavailableMarker;\n}\n\n/**\n * Thrown by `connectAll` when a read-write mountable connector fails and\n * `failOnReadWriteError` was set.\n * @docLink packages/connectors/concepts#connector-startup-error\n */\nexport class ConnectorStartupError extends Error {\n readonly report: ConnectorStartupReport;\n readonly failedReadWrite: ReadonlyArray<{ id: string; error: string }>;\n constructor(\n message: string,\n report: ConnectorStartupReport,\n failedReadWrite: ReadonlyArray<{ id: string; error: string }>,\n ) {\n super(message);\n this.name = \"ConnectorStartupError\";\n this.report = report;\n this.failedReadWrite = failedReadWrite;\n }\n}\n","/**\n * Derive runtime connector declarations from the platform-materialized\n * `.skaile/assets/connector/<name>/CONNECTOR.md` projection.\n *\n * Connector mirror of MCP's `loadMaterializedMcpDeclarations` /\n * `deriveSingleMaterializedMcpDeclaration`. The generated `CONNECTOR.md` carries\n * a RUNTIME declaration (driver/access/auth/mode/options/mount) — distinct from\n * the catalog `CONNECTOR.md` parsed by `core/manifest.ts:fromConnectorMd`\n * (entry/fields). Driver is referenced by name (first-party; resolved via the\n * connector registry — no code-loading).\n */\nimport { existsSync, readFileSync, readdirSync, statSync } from \"node:fs\";\nimport { join } from \"node:path\";\n// Narrow module, not the `core` barrel: the barrel's chunks carry `import.meta`,\n// which breaks consumers that transpile this entry to CommonJS.\nimport { parseFrontmatter } from \"../../core/src/manifest.js\";\nimport type { ConnectorDeclaration } from \"./connector-types.js\";\n\n/** Parse a generated CONNECTOR.md (runtime projection) into a ConnectorDeclaration. */\nexport function fromMaterializedConnectorMd(filePath: string, name: string): ConnectorDeclaration {\n const { data: meta, body } = parseFrontmatter(readFileSync(filePath, \"utf8\"));\n const id = String(meta.name ?? name);\n const decl: ConnectorDeclaration = {\n id,\n driver: String(meta.driver ?? \"\"),\n access: meta.access === \"read-write\" ? \"read-write\" : \"read-only\",\n };\n if (typeof meta.label === \"string\" && meta.label) decl.label = meta.label;\n if (typeof meta.auth === \"string\") decl.auth = meta.auth;\n if (typeof meta.providerLinkId === \"string\" && meta.providerLinkId) {\n decl.providerLinkId = meta.providerLinkId;\n }\n if (meta.mode === \"agent\" || meta.mode === \"sync\") decl.mode = meta.mode;\n if (meta.options && typeof meta.options === \"object\" && !Array.isArray(meta.options)) {\n decl.options = meta.options as Record<string, unknown>;\n }\n if (meta.mount && typeof meta.mount === \"object\" && !Array.isArray(meta.mount)) {\n const m = meta.mount as Record<string, unknown>;\n decl.mount = {\n source: String(m.source ?? \"\"),\n ...(m.target !== undefined ? { target: String(m.target) } : {}),\n ...(typeof m.watch === \"boolean\" ? { watch: m.watch } : {}),\n ...(typeof m.exposeAccessToken === \"boolean\"\n ? { exposeAccessToken: m.exposeAccessToken }\n : {}),\n ...(typeof m.accessTokenTTL === \"number\" ? { accessTokenTTL: m.accessTokenTTL } : {}),\n };\n }\n const trimmedBody = body.trim();\n if (trimmedBody.length > 0) decl.instructions = trimmedBody;\n return decl;\n}\n\n/** Provide `.instance.json` config entries as defaults under the declaration's options (the CONNECTOR.md declaration wins on key collision). */\nfunction foldInstanceConfig(decl: ConnectorDeclaration, instancePath: string): void {\n if (!existsSync(instancePath)) return;\n let parsed: { config?: Record<string, unknown> };\n try {\n parsed = JSON.parse(readFileSync(instancePath, \"utf8\"));\n } catch {\n return;\n }\n const config = parsed.config;\n if (!config || typeof config !== \"object\" || Array.isArray(config)) return;\n decl.options = { ...(config as Record<string, unknown>), ...(decl.options ?? {}) };\n}\n\n/** Derive a single materialized connector declaration; null when no CONNECTOR.md. */\nexport function deriveSingleMaterializedConnectorDeclaration(\n connectorAssetsDir: string,\n name: string,\n): ConnectorDeclaration | null {\n const sub = join(connectorAssetsDir, name);\n const md = join(sub, \"CONNECTOR.md\");\n if (!existsSync(md)) return null;\n const decl = fromMaterializedConnectorMd(md, name);\n foldInstanceConfig(decl, join(sub, \".instance.json\"));\n return decl;\n}\n\n/** Scan `<projectDir>/.skaile/assets/connector/*` for materialized connectors. */\nexport function loadMaterializedConnectorDeclarations(projectDir: string): ConnectorDeclaration[] {\n const root = join(projectDir, \".skaile/assets/connector\");\n if (!existsSync(root)) return [];\n const out: ConnectorDeclaration[] = [];\n for (const name of readdirSync(root)) {\n try {\n const sub = join(root, name);\n if (!statSync(sub).isDirectory()) continue;\n const decl = deriveSingleMaterializedConnectorDeclaration(root, name);\n if (decl) out.push(decl);\n } catch {\n // Per-directory failure is isolated — one bad asset never aborts the scan.\n }\n }\n return out;\n}\n","/**\n * Secret provider abstraction.\n *\n * Decouples credential resolution from process.env so secrets can be\n * provisioned over the transport bridge instead of living in the\n * container's environment.\n */\n\n// Narrow module, not the `core/logging` barrel: it re-exports the SQLite sink,\n// whose `import.meta` breaks consumers that transpile this entry to CommonJS.\nimport { createLogger } from \"../../core/src/logging/create-logger.js\";\n\nconst log = createLogger({ kind: \"connector\", subkind: \"secrets\" });\n\n// ── Interfaces ──────────────────────────────────────────────────────────────\n\n/**\n * Read-only secret resolution. Adapters receive this interface.\n * @docLink packages/connectors/api-reference#secret-provider\n */\nexport interface SecretProvider {\n /**\n * Resolve a credential reference.\n *\n * @param ref - Credential reference such as \"env:GIT_TOKEN\",\n * \"oauth:google:user@example.com\", or an inline literal.\n * @returns The resolved secret value or undefined if not found.\n */\n resolve(ref: string): string | undefined;\n /**\n * Check whether a reference can be resolved.\n *\n * @param ref - Reference to check.\n * @returns True if resolve(ref) would return a non-undefined value.\n */\n has(ref: string): boolean;\n /**\n * Return all ref strings this provider can currently resolve.\n *\n * @returns All resolvable refs (used by forge UI and ConnectorFieldMissingError).\n */\n capabilities(): string[];\n}\n\n/**\n * Extends `SecretProvider` with the ability to load secrets at runtime via `provision()`.\n * @docLink packages/connectors/api-reference#provisionable-secret-provider\n */\nexport interface ProvisionableSecretProvider extends SecretProvider {\n /** Store a batch of key-value secrets. Keys are bare names (no prefix). */\n provision(secrets: Record<string, string>): void;\n}\n\n// ── Implementations ─────────────────────────────────────────────────────────\n\n/**\n * In-memory secret store. Secrets are provisioned over the transport bridge\n * and stored in a private Map — never touching the filesystem or process.env.\n *\n * Supports ref prefixes:\n * `\"env:KEY\"` — looks up KEY in the store\n * `\"vault:KEY\"` — looks up KEY in the store (future vault compat)\n * (no prefix) — returned as an inline value (backwards compat for non-chain usages)\n * @docLink packages/connectors/api-reference#in-memory-secret-provider\n */\nexport class InMemorySecretProvider implements ProvisionableSecretProvider {\n private readonly store = new Map<string, string>();\n\n /**\n * Store a batch of key-value secrets.\n *\n * @param secrets - Key-value map of secret names to values. Keys are bare names (no prefix).\n */\n provision(secrets: Record<string, string>): void {\n for (const [key, value] of Object.entries(secrets)) {\n this.store.set(key, value);\n }\n }\n\n resolve(ref: string): string | undefined {\n if (!ref) return undefined;\n if (ref.startsWith(\"env:\")) return this.store.get(ref.slice(4));\n if (ref.startsWith(\"vault:\")) return this.store.get(ref.slice(6));\n // Bare key: check store first, then fall back to inline literal\n const stored = this.store.get(ref);\n if (stored !== undefined) return stored;\n return ref;\n }\n\n has(ref: string): boolean {\n return this.resolve(ref) !== undefined;\n }\n\n capabilities(): string[] {\n return [...this.store.keys()].map((k) => `env:${k}`);\n }\n}\n\n/**\n * Delegates to `process.env`. Used in CLI/standalone mode.\n * Does NOT pass through inline literals — returns `undefined` for any ref\n * that does not start with `\"env:\"`. Use `InMemorySecretProvider` for inline\n * literals in non-chain contexts.\n * @docLink packages/connectors/api-reference#env-secret-provider\n */\nexport class EnvSecretProvider implements SecretProvider {\n resolve(ref: string): string | undefined {\n if (!ref) return undefined;\n if (ref.startsWith(\"env:\")) return process.env[ref.slice(4)];\n return undefined; // no inline passthrough\n }\n\n has(ref: string): boolean {\n return this.resolve(ref) !== undefined;\n }\n\n capabilities(): string[] {\n return Object.keys(process.env).map((k) => `env:${k}`);\n }\n}\n\n/**\n * Pre-minted credential entry. Mirrors the discriminated `CredentialMint`\n * shape from `@skaile/workspaces/types` but redeclared here to keep this package\n * free of cross-package type dependencies.\n *\n * The failure branch carries the platform-side `code` + `message` so the\n * `ConnectorManager`'s wrapped mediator can surface the real reason instead of\n * a generic \"no pre-mint\" placeholder when a mint comes back as `ok: false`.\n */\nexport type PreMintedCredential =\n | { ok: true; token: string; expiresAt: string | null; mintedAt?: string }\n | {\n ok: false;\n code?: \"not-configured\" | \"revoked\" | \"provider-error\" | \"backend-error\";\n message?: string;\n };\n\n/**\n * Pre-minted credential store. Holds short-lived tokens delivered upfront in\n * the v3 `session_init` envelope so the runner never has to call back to the\n * platform during mount setup.\n *\n * Resolves refs of the form `mount:<id>`, `connector:<id>`, and `mcp:<id>`.\n * Returns `undefined` for any other ref so the chain falls through to the\n * next provider (`EnvSecretProvider` for `pat:env:NAME`, etc.).\n *\n * Tokens can be added/removed at runtime via {@link set} / {@link unset} so\n * `runner.add_mount` / `runner.add_connector` / `runner.add_mcp` capabilities\n * stay strictly in-process — no round trip to the platform to mint while\n * the resource is hot-attached.\n *\n * For callers that need the full mint metadata (expiry timestamp, mintedAt\n * audit fields), use {@link mintFor} instead of the bare `resolve`. The\n * `ConnectorManager` consults this for the `auth: backend` initial-mint path so\n * the driver retains the original expiry semantics.\n *\n * Spec: `_devlog/specs/2026-05-10-deterministic-session-bootstrap.md`.\n *\n * @docLink packages/connectors/api-reference#pre-minted-secret-provider\n */\nexport class PreMintedSecretProvider implements SecretProvider {\n private readonly mints = new Map<string, PreMintedCredential>();\n\n /**\n * Seed pre-minted credentials from the v3 `session_init.credentials` map.\n *\n * Failed mints (`ok: false`) are stored too so callers can distinguish\n * \"not pre-minted\" from \"pre-minted but failed\"; {@link resolve} treats\n * both as `undefined`.\n *\n * @param credentials Optional initial `{ mounts, connectors, mcp }` map.\n */\n constructor(credentials?: {\n mounts?: Record<string, PreMintedCredential>;\n connectors?: Record<string, PreMintedCredential>;\n mcp?: Record<string, PreMintedCredential>;\n }) {\n if (!credentials) return;\n for (const [id, mint] of Object.entries(credentials.mounts ?? {})) {\n this.mints.set(`mount:${id}`, mint);\n }\n for (const [id, mint] of Object.entries(credentials.connectors ?? {})) {\n this.mints.set(`connector:${id}`, mint);\n }\n for (const [id, mint] of Object.entries(credentials.mcp ?? {})) {\n this.mints.set(`mcp:${id}`, mint);\n }\n }\n\n /**\n * Insert (or replace) a pre-minted credential. Used by\n * `runner.add_mount` / `runner.add_connector` / `runner.add_mcp` capability\n * handlers when the platform delivers new credentials mid-session.\n */\n set(kind: \"mount\" | \"connector\" | \"mcp\", id: string, mint: PreMintedCredential): void {\n this.mints.set(`${kind}:${id}`, mint);\n }\n\n /**\n * Remove a stored pre-minted credential. Used by the\n * `runner.remove_resource` capability handler.\n */\n unset(kind: \"mount\" | \"connector\" | \"mcp\", id: string): boolean {\n return this.mints.delete(`${kind}:${id}`);\n }\n\n /**\n * Look up the full {@link PreMintedCredential} for a `mount:` /\n * `connector:` / `mcp:` keyed entry. Callers that only need the token use\n * {@link resolve} via the chain; callers that need expiry / audit\n * metadata (e.g. ConnectorManager) use this entry point.\n */\n mintFor(kind: \"mount\" | \"connector\" | \"mcp\", id: string): PreMintedCredential | undefined {\n return this.mints.get(`${kind}:${id}`);\n }\n\n resolve(ref: string): string | undefined {\n if (!ref) return undefined;\n if (!(ref.startsWith(\"mount:\") || ref.startsWith(\"connector:\") || ref.startsWith(\"mcp:\")))\n return undefined;\n const mint = this.mints.get(ref);\n return mint?.ok ? mint.token : undefined;\n }\n\n has(ref: string): boolean {\n return this.resolve(ref) !== undefined;\n }\n\n capabilities(): string[] {\n return [...this.mints.entries()].filter(([, m]) => m.ok).map(([k]) => k);\n }\n}\n\n/**\n * Forge session secret provider. Secrets are provisioned from the Forge settings\n * panel over the transport bridge. Only handles `\"forge:\"` prefixed refs — returns\n * `undefined` for all others.\n * @docLink packages/connectors/api-reference#forge-secret-provider\n */\nexport class ForgeSecretProvider implements ProvisionableSecretProvider {\n private readonly store = new Map<string, string>();\n\n provision(secrets: Record<string, string>): void {\n for (const [key, value] of Object.entries(secrets)) {\n this.store.set(key, value);\n }\n }\n\n resolve(ref: string): string | undefined {\n if (!ref) return undefined;\n if (ref.startsWith(\"forge:\")) return this.store.get(ref.slice(6));\n return undefined;\n }\n\n has(ref: string): boolean {\n return this.resolve(ref) !== undefined;\n }\n\n capabilities(): string[] {\n return [...this.store.keys()].map((k) => `forge:${k}`);\n }\n}\n\n/**\n * Thrown when an OAuth-secured connector field requires user authorization before\n * it can be resolved. Contains the redirect URL to open in the user's browser.\n * @docLink packages/connectors/api-reference#o-auth-required-error\n */\nexport class OAuthRequiredError extends Error {\n readonly oauthRef: string;\n readonly authUrl: string;\n readonly state: string;\n\n /**\n * @param oauthRef - The 'oauth:<service>:<account>' ref that triggered the error\n * @param authUrl - Browser URL to open for OAuth authorization\n * @param state - OAuth state token for CSRF protection and callback correlation\n */\n constructor(oauthRef: string, authUrl: string, state: string) {\n super(`OAuth authorization required for ${oauthRef}`);\n this.name = \"OAuthRequiredError\";\n this.oauthRef = oauthRef;\n this.authUrl = authUrl;\n this.state = state;\n }\n}\n\n/**\n * Shape of an OAuth token bundle stored by `OAuthSecretProvider`.\n * @docLink packages/connectors/api-reference#o-auth-token-bundle\n */\nexport interface OAuthTokenBundle {\n accessToken: string;\n refreshToken?: string;\n /** Unix timestamp in ms */\n expiry?: number;\n}\n\n/**\n * Return value of `OAuthSecretProvider.initiateFlow()`. Contains the URL and CSRF state token.\n * @docLink packages/connectors/api-reference#o-auth-flow-request\n */\nexport interface OAuthFlowRequest {\n authUrl: string;\n state: string;\n}\n\n/**\n * OAuth token provider. Handles `\"oauth:<service>:<account>\"` refs.\n * Callers must call `chain.prepareRef()` before `chain.resolve()` for `oauth:` refs.\n * @docLink packages/connectors/api-reference#o-auth-secret-provider\n */\nexport interface OAuthSecretProvider extends SecretProvider {\n /**\n * Ensure the token for this ref is fresh.\n * Refreshes if expired.\n * Throws OAuthRequiredError if no token exists and user authorization is needed.\n */\n ensureFresh(ref: string): Promise<void>;\n\n /** Initiate the OAuth authorization flow. Returns URL to open in the user's browser. */\n initiateFlow(oauthService: string, account: string): Promise<OAuthFlowRequest>;\n\n /** Exchange authorization code for tokens and store the bundle. */\n completeFlow(state: string, code: string): Promise<void>;\n}\n\n/**\n * Abstract base for vault-backed secret providers (1Password, KeePass). Subclasses\n * implement `prefix` and `loadKeys()`. Locked until `unlock(credential)` is called.\n * @docLink packages/connectors/api-reference#locked-secret-provider\n */\nexport abstract class LockedSecretProvider implements SecretProvider {\n locked = true;\n protected readonly store = new Map<string, string>();\n abstract readonly prefix: string;\n\n async unlock(credential: string): Promise<void> {\n await this.loadKeys(credential);\n this.locked = false;\n }\n\n protected abstract loadKeys(credential: string): Promise<void>;\n\n resolve(ref: string): string | undefined {\n if (this.locked) return undefined;\n if (!ref.startsWith(this.prefix)) return undefined;\n return this.store.get(ref.slice(this.prefix.length));\n }\n\n has(ref: string): boolean {\n return this.resolve(ref) !== undefined;\n }\n\n capabilities(): string[] {\n if (this.locked) return [];\n return [...this.store.keys()].map((k) => `${this.prefix}${k}`);\n }\n}\n\n// ── Known provider prefixes ──────────────────────────────────────────────────\n\nconst KNOWN_PREFIXES = [\n \"env:\",\n \"vault:\",\n \"forge:\",\n \"op:\",\n \"kp:\",\n \"oauth:\",\n \"mount:\",\n \"connector:\",\n \"mcp:\",\n] as const;\n\nfunction getPrefix(ref: string): string | undefined {\n return KNOWN_PREFIXES.find((p) => ref.startsWith(p));\n}\n\n/**\n * True when `value` starts with a known secret-ref prefix (`env:`, `oauth:`,\n * `mcp:`, ...). Lets callers distinguish an intended-but-unresolved ref from a\n * plain literal — e.g. the runner refuses to forward an unresolved ref into\n * MCP transport headers/env, where the literal would otherwise leak onto the\n * wire and produce a misleading upstream error.\n */\nexport function isKnownSecretRef(value: string): boolean {\n return getPrefix(value) !== undefined;\n}\n\n/**\n * Chains multiple `SecretProvider` instances into a single resolver.\n * - Prefixed refs (`env:`, `forge:`, `op:`, `kp:`, `oauth:`) are routed to the first provider that can resolve them.\n * - Bare refs waterfall through all providers in order.\n * - Plain literals in `skaile.yaml` options are NOT passed to the chain; `ConnectorManager` handles them before calling `resolve()`.\n * @docLink packages/connectors/api-reference#secret-provider-chain\n */\nexport class SecretProviderChain implements SecretProvider {\n /**\n * @param providers - Ordered list of providers. For prefixed refs, the first\n * provider that can resolve wins. For bare refs, waterfall through all in order.\n */\n constructor(private readonly providers: SecretProvider[]) {}\n\n resolve(ref: string): string | undefined {\n if (!ref) return undefined;\n const prefix = getPrefix(ref);\n log.debug(\"resolve secret\", { ref, prefix: prefix ?? \"(bare)\" });\n if (prefix) {\n for (const p of this.providers) {\n const val = p.resolve(ref);\n if (val !== undefined) return val;\n }\n log.warn(\"secret not resolvable\", { ref });\n return undefined;\n }\n // Waterfall for bare refs\n for (const p of this.providers) {\n const val = p.resolve(ref);\n if (val !== undefined) return val;\n }\n log.warn(\"secret not resolvable\", { ref });\n return undefined;\n }\n\n has(ref: string): boolean {\n return this.resolve(ref) !== undefined;\n }\n\n capabilities(): string[] {\n const all = this.providers.flatMap((p) => p.capabilities());\n return [...new Set(all)];\n }\n\n /** Returns the first provider that can resolve this ref. */\n providerFor(ref: string): SecretProvider | undefined {\n for (const p of this.providers) {\n if (p.resolve(ref) !== undefined) return p;\n }\n return undefined;\n }\n\n /**\n * Calls ensureFresh(ref) on the owning provider if it implements OAuthSecretProvider.\n * No-op for providers that don't have ensureFresh().\n *\n * @param ref - Must be an \"oauth:\" prefixed ref for this to have any effect.\n * Calls ensureFresh() on the owning OAuthSecretProvider.\n */\n async prepareRef(ref: string): Promise<void> {\n const owner = this.providerFor(ref);\n if (\n owner &&\n \"ensureFresh\" in owner &&\n typeof (owner as OAuthSecretProvider).ensureFresh === \"function\"\n ) {\n try {\n await (owner as OAuthSecretProvider).ensureFresh(ref);\n } catch (err) {\n log.error(\"secret provider ensureFresh failed\", err, { ref });\n throw err;\n }\n }\n }\n}\n","/**\n * Load connector declarations from skaile.yaml.\n *\n * The top-level `mounts:` key is no longer accepted (hard cut as of Task 11).\n * Filesystem-projected backends must be declared under `connectors:` with a\n * `mount:` sub-block. See `docs/migration-mounts-to-connectors.md`.\n */\n\nimport type { ResolvedSkaileConfig } from \"@skaile/workspaces/types\";\n// Narrow modules, not the `core` barrels: their chunks carry `import.meta`,\n// which breaks consumers that transpile this entry to CommonJS.\nimport { createLogger } from \"../../core/src/logging/create-logger.js\";\nimport {\n resolveSkWorkspaceConfig,\n type ConnectorDeclaration as WorkspaceConnector,\n} from \"../../core/src/workspace-config.js\";\nimport type { ConnectorDeclaration } from \"./connector-types.js\";\nimport { readUnavailableMarker } from \"./connector-types.js\";\nimport { loadMaterializedConnectorDeclarations } from \"./materialized-connectors.js\";\n\nconst configLog = createLogger({ kind: \"connector\", subkind: \"config\" });\n\n/**\n * Read `skaile.yaml` in `projectDir` and return all declared connectors as `ConnectorDeclaration[]`.\n *\n * Throws a migration error when the legacy top-level `mounts:` key is present.\n *\n * @param projectDir - Root of the workspace (directory containing `skaile.yaml`).\n * @returns Merged array of connector declarations from `skaile.yaml` and the materialized\n * `.skaile/assets/connector/*` disk projection (Phase 2.5); empty array if neither source\n * contributes any entries. `skaile.yaml` wins on id collision.\n * @docLink packages/connectors/api-reference#load-connector-declarations\n */\nexport function loadConnectorDeclarations(projectDir: string): ConnectorDeclaration[] {\n return withMaterializedConnectorDeclarations(\n loadYamlConnectorDeclarations(projectDir),\n projectDir,\n );\n}\n\n/**\n * The `skaile.yaml` half of {@link loadConnectorDeclarations}: only the `connectors:` entries,\n * without the materialized projection. The runner needs it on its own because in broker mode the\n * session root keeps materialized connectors across wakes while its yaml declares nothing, and the\n * `session_init` wire set must then stand in for the yaml half, not for both.\n *\n * Throws a migration error when the legacy top-level `mounts:` key is present.\n */\nexport function loadYamlConnectorDeclarations(projectDir: string): ConnectorDeclaration[] {\n const config = resolveSkWorkspaceConfig(projectDir);\n\n // Hard cut: reject legacy top-level `mounts:` key with an actionable message.\n if (config.mounts && config.mounts.length > 0) {\n throw new Error(\n \"'mounts:' is no longer supported — move entries under 'connectors:' with a 'mount:' sub-block. See docs/migration-mounts-to-connectors.md\",\n );\n }\n\n return config.connectors && config.connectors.length > 0\n ? config.connectors.map(workspaceConnectorToDeclaration)\n : [];\n}\n\n/**\n * Add the materialized `.skaile/assets/connector/*` projection to `base`. Library-assigned\n * connectors reach the runner only through that projection. `base` is explicit config (the\n * skaile.yaml entries, or the `session_init` wire set standing in for them) and wins on id\n * collision; the shadowed materialized connector is logged, not silently dropped.\n */\nexport function withMaterializedConnectorDeclarations(\n base: ConnectorDeclaration[],\n projectDir: string,\n): ConnectorDeclaration[] {\n const byId = new Map<string, ConnectorDeclaration>();\n for (const d of base) byId.set(d.id, d);\n for (const d of loadMaterializedConnectorDeclarations(projectDir)) {\n if (byId.has(d.id)) {\n configLog.warn(`materialized connector '${d.id}' shadowed by an explicit connector`);\n continue;\n }\n byId.set(d.id, d);\n }\n return [...byId.values()];\n}\n\nfunction workspaceConnectorToDeclaration(c: WorkspaceConnector): ConnectorDeclaration {\n const decl: ConnectorDeclaration = {\n id: c.id,\n driver: c.driver,\n access: c.access ?? \"read-only\",\n auth: c.auth,\n options: c.options,\n };\n\n // Backend-auth routing key for live token refresh; dropping it breaks git mount mint.\n if (c.providerLinkId) decl.providerLinkId = c.providerLinkId;\n\n const unavailable = readUnavailableMarker(c.unavailable);\n if (unavailable) decl.unavailable = unavailable;\n\n // Map the optional mount sub-block when present.\n if (c.mount) {\n decl.mount = {\n source: c.mount.source,\n target: c.mount.target,\n watch: c.mount.watch,\n exposeAccessToken: c.mount.exposeAccessToken,\n accessTokenTTL: c.mount.accessTokenTTL,\n };\n }\n\n return decl;\n}\n\n/**\n * Map a Protocol v3 `session_init` `resolvedConfig` to `ConnectorDeclaration[]`.\n *\n * Wire mounts are flat (`source` / `target` / `watch` top-level per\n * `ResolvedSkaileConfig`); declarations carry them in the `mount:` sub-block.\n * Wire `connectors` (tool-face) map without a mount block. Malformed entries\n * (missing `id`, `driver`, or — for mounts — `source`) are logged and dropped,\n * never thrown: one bad wire entry must not kill session boot. Duplicate ids\n * (within or across the two arrays) keep the FIRST occurrence — mounts precede\n * connectors — and the shadowed entry is logged and dropped the same way.\n *\n * Pure function, no I/O. Used by the runner in place of the `skaile.yaml`\n * entries when `skaile.yaml` declares no connectors (broker mode, where the\n * delivered yaml carries no declarations). Materialized connectors are added\n * on top either way.\n *\n * @param resolved - `mounts` / `connectors` arrays from the platform-resolved config.\n * @returns Declarations in wire order — mounts first, then connectors.\n * @docLink packages/connectors/api-reference#resolved-config-to-declarations\n */\nexport function resolvedConfigToDeclarations(\n resolved: Pick<ResolvedSkaileConfig, \"mounts\" | \"connectors\">,\n): ConnectorDeclaration[] {\n // Keyed by id: the wire carries no well-formedness guarantee, and a duplicate\n // id downstream would collide on mount paths / tool namespaces. First wins.\n const byId = new Map<string, ConnectorDeclaration>();\n const pushUnlessDuplicate = (kind: \"mount\" | \"connector\", decl: ConnectorDeclaration): void => {\n if (byId.has(decl.id)) {\n configLog.warn(`dropping duplicate resolvedConfig ${kind} (id already declared)`, {\n id: decl.id,\n });\n return;\n }\n byId.set(decl.id, decl);\n };\n\n for (const m of resolved.mounts ?? []) {\n // A mount without a source cannot connect — drop it with the malformed ones.\n if (\n typeof m?.id !== \"string\" ||\n typeof m?.driver !== \"string\" ||\n typeof m.source !== \"string\"\n ) {\n configLog.warn(\"dropping malformed resolvedConfig mount (missing id/driver/source)\", {\n id: (m as { id?: unknown } | undefined)?.id,\n });\n continue;\n }\n const decl: ConnectorDeclaration = {\n id: m.id,\n driver: m.driver,\n access: m.access ?? \"read-only\",\n auth: m.auth,\n options: m.options,\n mount: {\n source: m.source,\n target: m.target,\n watch: m.watch,\n exposeAccessToken: m.exposeAccessToken,\n accessTokenTTL: m.accessTokenTTL,\n },\n };\n // Backend-auth routing key for live token refresh; dropping it breaks git mount mint.\n if (m.providerLinkId) decl.providerLinkId = m.providerLinkId;\n pushUnlessDuplicate(\"mount\", decl);\n }\n\n for (const c of resolved.connectors ?? []) {\n if (typeof c?.id !== \"string\" || typeof c?.driver !== \"string\") {\n configLog.warn(\"dropping malformed resolvedConfig connector (missing id/driver)\", {\n id: (c as { id?: unknown } | undefined)?.id,\n });\n continue;\n }\n const decl: ConnectorDeclaration = {\n id: c.id,\n driver: c.driver,\n access: c.access ?? \"read-only\",\n auth: c.auth,\n options: c.options,\n };\n if (c.providerLinkId) decl.providerLinkId = c.providerLinkId;\n pushUnlessDuplicate(\"connector\", decl);\n }\n\n return [...byId.values()];\n}\n\nimport type { ForgeSecretProvider, SecretProvider } from \"./secrets.js\";\nimport { EnvSecretProvider, InMemorySecretProvider, SecretProviderChain } from \"./secrets.js\";\n\n/**\n * Build a `SecretProviderChain` for Forge session context.\n * `OAuthSecretProvider` is not wired here — it must be provided externally\n * (the Forge session manager constructs it and passes it in).\n * @param forgeProvider - The Forge-provisioned secret store.\n * @param extraProviders - Additional providers prepended to the chain (e.g. an OAuth provider).\n * @returns A chain that routes `forge:` refs to the Forge store and `env:` refs to process.env.\n * @docLink packages/connectors/api-reference#create-forge-secret-provider-chain\n */\nexport function createForgeSecretProviderChain(\n forgeProvider: ForgeSecretProvider,\n extraProviders: SecretProvider[] = [],\n): SecretProviderChain {\n return new SecretProviderChain([...extraProviders, forgeProvider, new EnvSecretProvider()]);\n}\n\n/**\n * Build a `SecretProviderChain` for CLI/standalone context.\n * `EnvSecretProvider` takes priority; `extraSecrets` are loaded into an `InMemorySecretProvider`.\n * @param extraSecrets - Inline secrets injected into memory (e.g. tokens passed via CLI flags).\n * @returns A chain that resolves `env:` refs from process.env plus any inline extras.\n * @docLink packages/connectors/api-reference#create-cli-secret-provider-chain\n */\nexport function createCliSecretProviderChain(\n extraSecrets: Record<string, string> = {},\n): SecretProviderChain {\n const mem = new InMemorySecretProvider();\n if (Object.keys(extraSecrets).length > 0) {\n mem.provision(extraSecrets);\n }\n return new SecretProviderChain([new EnvSecretProvider(), mem]);\n}\n\n// ── Auth grammar (mount-side, Tier 2 credential tiers) ───────────────────────\n\n/**\n * Provider kind for a mount auth ref.\n *\n * Two values are accepted:\n * - `pat` — static personal access token resolved via the secrets chain\n * (standalone CLI / non-platform contexts).\n * - `backend` — token minted by the platform's credential mediator over the\n * transport (`request_access_token` round-trip). Provider\n * dispatch (OAuth, GitHub App, ...) lives backend-side; the\n * runner stays provider-agnostic.\n *\n * @docLink packages/connectors/api-reference#mount-auth-kind\n */\nexport type MountAuthKind = \"pat\" | \"backend\";\n\n/**\n * Parsed mount `auth:` field.\n *\n * - `pat` → `value` is the inner secret ref (e.g. `env:NAME`).\n * - `backend` → `value` is empty (sentinel only); the runner asks the\n * backend for tokens via `request_access_token`.\n *\n * @docLink packages/connectors/api-reference#mount-auth-ref\n */\nexport interface MountAuthRef {\n kind: MountAuthKind;\n /** Prefix-stripped payload — see kind for shape. Empty for `backend`. */\n value: string;\n /** Original auth string from the declaration, kept for diagnostics. */\n raw: string;\n}\n\n/**\n * Thrown when a mount declaration's `auth:` field uses the legacy bare `env:NAME` grammar\n * or any other unrecognized form. Migrate to `pat:env:NAME` (standalone) or `backend`\n * (platform-mediated).\n * @docLink packages/connectors/api-reference#legacy-auth-grammar-error\n */\nexport class LegacyAuthGrammarError extends Error {\n readonly auth: string;\n constructor(auth: string, mountId?: string) {\n const where = mountId ? ` on mount '${mountId}'` : \"\";\n super(\n `Legacy or unrecognized auth grammar${where} ('${auth}'). ` +\n `Replace with one of:\\n` +\n ` - backend (platform-mediated, recommended)\\n` +\n ` - pat:env:NAME (standalone CLI / static token)\\n` +\n `See _devlog/specs/2026-05-06-tier-2-credential-mediation.md.`,\n );\n this.name = \"LegacyAuthGrammarError\";\n this.auth = auth;\n }\n}\n\n/**\n * Resolve the `auth: backend` initial mint for a given mount or connector id\n * by querying the secrets chain with a `${kind}:${id}` ref. Returns the\n * resolved bearer token or `undefined` if no pre-minted credential is\n * available.\n *\n * Used by the runner when wiring `ConnectorManager` to\n * answer initial-mint requests from `PreMintedSecretProvider` without\n * round-tripping to the platform. Drivers continue to receive a\n * `tokenMediator` for refresh + retry-401 paths.\n *\n * @param kind Resource family (`mount` or `connector`).\n * @param id Resource declaration id.\n * @param chain Secrets chain. Pass `undefined` to return `undefined`.\n * @returns The pre-minted token, or `undefined` if not stored on the chain.\n * @docLink packages/connectors/api-reference#resolve-backend-auth-for\n */\nexport function resolveBackendAuthFor(\n kind: \"mount\" | \"connector\",\n id: string,\n chain: import(\"./secrets.js\").SecretProvider | undefined,\n): string | undefined {\n if (!chain) return undefined;\n return chain.resolve(`${kind}:${id}`);\n}\n\n/**\n * Parse a mount-side auth ref into a typed `MountAuthRef`.\n *\n * Accepted forms:\n * - `backend` — platform-mediated mint via `request_access_token`.\n * - `pat:env:NAME` — static PAT resolved from the secrets chain.\n *\n * Rejects bare `env:NAME` (legacy) and provider-prefixed grammars (`oauth:`,\n * `github-app:`) — those moved backend-side as part of Tier-2 mediation.\n * Returns `undefined` when `auth` is absent or empty.\n *\n * @param auth - Raw `auth:` value from the mount declaration.\n * @param mountId - Optional mount id included in error messages.\n * @returns Parsed `MountAuthRef` or `undefined`.\n * @throws {LegacyAuthGrammarError} for any unrecognized grammar.\n * @docLink packages/connectors/api-reference#resolve-auth-ref\n */\nexport function resolveAuthRef(\n auth: string | undefined,\n mountId?: string,\n): MountAuthRef | undefined {\n if (!auth) return undefined;\n\n if (auth === \"backend\") {\n return { kind: \"backend\", value: \"\", raw: auth };\n }\n if (auth.startsWith(\"pat:\")) {\n return { kind: \"pat\", value: auth.slice(\"pat:\".length), raw: auth };\n }\n\n // Legacy bare `env:NAME` and the deprecated provider-prefixed grammars\n // (`oauth:`, `github-app:`) all land here.\n throw new LegacyAuthGrammarError(auth, mountId);\n}\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { declaredConnectErrorKind, ClassifiedConnectError, withConnectErrorKind } from './chunk-UF4AEO54.js';
|
|
2
|
-
import { OAuthRequiredError, ConnectorFieldMissingError, LegacyAuthGrammarError, resolveAuthRef, readUnavailableMarker, ConnectorStartupError } from './chunk-
|
|
3
|
-
import { EventNormalizer } from './chunk-
|
|
4
|
-
import { resolveModelTier } from './chunk-
|
|
5
|
-
import { createDriver } from './chunk-
|
|
2
|
+
import { OAuthRequiredError, ConnectorFieldMissingError, LegacyAuthGrammarError, resolveAuthRef, readUnavailableMarker, ConnectorStartupError } from './chunk-MC2MF4U5.js';
|
|
3
|
+
import { EventNormalizer } from './chunk-TEQDWOBS.js';
|
|
4
|
+
import { resolveModelTier } from './chunk-LDT6NGSL.js';
|
|
5
|
+
import { createDriver } from './chunk-CJGNYHPG.js';
|
|
6
6
|
import { pluginRegistry } from './chunk-6E6PKKAD.js';
|
|
7
7
|
import { computeStimulus } from './chunk-IFGTRL2I.js';
|
|
8
|
-
import { interpolateNodeInstruction, resolveNodeBindings, getConsumedOutputSchema, validateConsumedNodeOutput, appendAttempt, resolveTerminalFailureStatus, remainingActiveExecutionMs, deriveCheckEvidence, computeFlowStateFromSnapshots, availableRouterFrontier, evaluateRouterSelection, routerSelectionOutput, planRouterSkips, unsettledRouterBranchIds, countFailedAttempts, hasAutomaticRetryBudget, persistedRouterSelection } from './chunk-
|
|
8
|
+
import { interpolateNodeInstruction, resolveNodeBindings, getConsumedOutputSchema, validateConsumedNodeOutput, appendAttempt, resolveTerminalFailureStatus, remainingActiveExecutionMs, deriveCheckEvidence, computeFlowStateFromSnapshots, availableRouterFrontier, evaluateRouterSelection, routerSelectionOutput, planRouterSkips, unsettledRouterBranchIds, countFailedAttempts, hasAutomaticRetryBudget, persistedRouterSelection } from './chunk-KTCMBEEB.js';
|
|
9
9
|
import { INPUT_SCHEMA_SHAPES_HINT, coerceInputSchema } from './chunk-XPDB4O4H.js';
|
|
10
10
|
import { parseFlowDefinition } from './chunk-ALLCAFHQ.js';
|
|
11
11
|
import { describeStimulus, buildOrchestratorPrompt, renderSubpromptPrompt, renderStimulusPrompt } from './chunk-RQLL7L72.js';
|
|
@@ -11881,5 +11881,5 @@ function describeFlowOperations() {
|
|
|
11881
11881
|
}
|
|
11882
11882
|
|
|
11883
11883
|
export { AbstractConnector, BUILTIN_CONNECTOR_CATALOG, BoxConnector, ClassifierSubpromptRunner, ConnectorManager, DeployConnector, DevServerConnector, FlowAdapter, GitConnector, GmailConnector, GoogleDriveConnector, LocalConnector, LogBuffer, MAX_REARM_MS, MIN_REFRESH_DELAY_MS, ManagedGitconfigCollisionError, MattermostConnector, MemoryConnector, MinIOConnector, NO_ACTIVE_FLOW_ERROR, PortPool, PostgresConnector, REFRESH_LEAD_MS, S3Connector, S3FetchStoppedError, S3PresignedRequestError, S3_PRESIGN_BATCH, SQLiteConnector, SessionInlineSubFlowRunner, SessionNodeExecutor, SessionSubpromptRunner, SharePointConnector, StaticServerConnector, TunnelConnector, WebDAVConnector, XStateConnector, XStateStoreConnector, __test, atomicReplaceCredential, buildConnectorPromptSection, buildConnectorToolDefs, buildFlowPromptEvent, buildFlowToolDefs, buildLazyFlowToolDefs, buildLazySdkFlowTools, buildSdkConnectorTools, buildSdkFlowTools, checkFleetMountLiveness, classifierQuestion, classifyConnectError, createConnector, createConnector10, createConnector11, createConnector12, createConnector13, createConnector14, createConnector15, createConnector16, createConnector17, createConnector18, createConnector19, createConnector2, createConnector20, createConnector3, createConnector4, createConnector5, createConnector6, createConnector7, createConnector8, createConnector9, createFsWatcher, createWorktree, defaultSpawn, describeFlowOperations, driveOrchestratorTurn, ensureDirMode, ensureFleetMounted, ensureRefreshAttemptStamp, findGitRoot, findMissingPackages, getConnector, installNpmPackages, isFleetManaged, isPackageResolvable, listConnectors, listWorktrees, parseListObjectsV2, presignScopePrefix, presignableKey, readGitSyncStatus, registerBuiltinConnectors, removeMountBlock, removeUnavailableMountBlock, renderCredentialHelperScript, tryGetConnector, worktreeRegistry, writeHelperScript, writeMountBlock, writeUnavailableMountBlock };
|
|
11884
|
-
//# sourceMappingURL=chunk-
|
|
11885
|
-
//# sourceMappingURL=chunk-
|
|
11884
|
+
//# sourceMappingURL=chunk-MDRV5EWH.js.map
|
|
11885
|
+
//# sourceMappingURL=chunk-MDRV5EWH.js.map
|