@makaio/framework 1.0.0-dev-1783705652236 → 1.0.0-dev-1783940945655
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/dist/.makaio-build.json +2 -2
- package/dist/account-identity-BYfeWLe-.mjs +1 -0
- package/dist/adapter-auth-runtime-a4O7cSNP.mjs +1 -0
- package/dist/adapter-binding-DDUyv1JK.d.mts +254 -0
- package/dist/{adapter-CA8rPIUz.mjs → adapter-nl_xz9dz.mjs} +1 -1
- package/dist/adapter-subsystem/index.d.mts +110 -5
- package/dist/adapter-subsystem/index.mjs +1 -1
- package/dist/adapters/acp-client/index.d.mts +10 -0
- package/dist/adapters/acp-client/index.mjs +2 -2
- package/dist/adapters/config/index.d.mts +176 -153
- package/dist/adapters/config/index.mjs +1 -1
- package/dist/adapters/index.d.mts +1021 -1005
- package/dist/adapters/index.mjs +6 -6
- package/dist/adapters/node.d.mts +1 -1
- package/dist/adapters/node.mjs +1 -1
- package/dist/adapters/stream-session/index.d.mts +7 -5
- package/dist/adapters/stream-session/index.mjs +1 -1
- package/dist/auth-C3NOWqTU.mjs +1 -0
- package/dist/{base-orchestrator-J1WKAUkF.d.mts → base-orchestrator-BiShpVKL.d.mts} +6 -0
- package/dist/bus/index.d.mts +21 -21
- package/dist/bus/index.mjs +1 -1
- package/dist/{canonical-model-DV-Z8gsb.mjs → canonical-model-CVRCW9h7.mjs} +1 -1
- package/dist/client-BkpLM8Fx.mjs +1 -0
- package/dist/client-binary-version-verifier-BK_vIjIo.mjs +2 -0
- package/dist/client-binary-version-verifier-BwrMTAh2.d.mts +179 -0
- package/dist/clients/index.d.mts +74 -90
- package/dist/clients/index.mjs +1 -2
- package/dist/clients/managed-install.d.mts +2 -0
- package/dist/clients/managed-install.mjs +1 -0
- package/dist/{clients-namespace-Bt_VTkEU.d.mts → clients-namespace-B96QIJOs.d.mts} +224 -21
- package/dist/compression-CZ_6fYq8.mjs +1 -0
- package/dist/config-namespace-DTA6EQL8.mjs +1 -0
- package/dist/{config-namespace-DqdFE6zk.d.mts → config-namespace-x0fuhEXe.d.mts} +73 -1
- package/dist/contracts/adapter/index.d.mts +3 -3
- package/dist/contracts/adapter/index.mjs +1 -1
- package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
- package/dist/contracts/artifact/index.d.mts +1 -1
- package/dist/contracts/auth/index.d.mts +3 -0
- package/dist/contracts/auth/index.mjs +1 -0
- package/dist/contracts/canonical-model/index.d.mts +1 -1
- package/dist/contracts/canonical-model/index.mjs +1 -1
- package/dist/contracts/client/index.d.mts +3 -3
- package/dist/contracts/client/index.mjs +1 -1
- package/dist/contracts/common/index.d.mts +1 -1
- package/dist/contracts/config/index.d.mts +20 -93
- package/dist/contracts/config/index.mjs +1 -1
- package/dist/contracts/extension/index.d.mts +3 -3
- package/dist/contracts/extension/index.mjs +1 -1
- package/dist/contracts/facet/index.d.mts +1 -1
- package/dist/contracts/facet/index.mjs +1 -1
- package/dist/contracts/harness/index.d.mts +1 -1
- package/dist/contracts/harness/index.mjs +1 -1
- package/dist/contracts/host/index.d.mts +1 -1
- package/dist/contracts/host/index.mjs +1 -1
- package/dist/contracts/index.d.mts +1214 -261
- package/dist/contracts/index.mjs +1 -1
- package/dist/contracts/materialization/index.d.mts +3 -3
- package/dist/contracts/materialization/index.mjs +1 -1
- package/dist/contracts/model-registry/index.d.mts +1 -1
- package/dist/contracts/model-registry/index.mjs +1 -1
- package/dist/contracts/native-session-supervisor/index.d.mts +1 -1
- package/dist/contracts/native-session-supervisor/index.mjs +1 -1
- package/dist/contracts/platform/index.d.mts +1 -1
- package/dist/contracts/platform/index.mjs +1 -1
- package/dist/contracts/provider/index.d.mts +2 -2
- package/dist/contracts/provider/index.mjs +1 -1
- package/dist/contracts/session/index.d.mts +2 -2
- package/dist/contracts/session/index.mjs +1 -1
- package/dist/contracts/shared/index.d.mts +2 -2
- package/dist/contracts/shared/index.mjs +1 -1
- package/dist/contracts/skill/index.d.mts +1 -1
- package/dist/contracts/skill/index.mjs +1 -1
- package/dist/contracts/telemetry/index.d.mts +1 -1
- package/dist/contracts/telemetry/index.mjs +1 -1
- package/dist/contracts/timeout/index.d.mts +1 -1
- package/dist/contracts/timeout/index.mjs +1 -1
- package/dist/contracts/toast/index.mjs +1 -1
- package/dist/contracts/variant/index.d.mts +1 -1
- package/dist/contracts/variant/index.mjs +1 -1
- package/dist/contracts/workflow/index.d.mts +2 -2
- package/dist/contracts/workflow/index.mjs +1 -1
- package/dist/{definition-s9PIua2B.d.mts → definition-Bj9Vr16H.d.mts} +1 -1
- package/dist/{definition-Cllhr9mi.d.mts → definition-BsTlOz99.d.mts} +36 -4
- package/dist/{definition-CuJvtYeG.d.mts → definition-Cbl0k6Fc.d.mts} +31 -1
- package/dist/definition-K3m51lgO.mjs +1 -0
- package/dist/definitions-C1pgx0Nq.mjs +1 -0
- package/dist/{detached-extension-handle-Cx6-0eqg.mjs → detached-extension-handle-CTaQoolf.mjs} +1 -1
- package/dist/execution-target-Bg2wpfML.mjs +1 -0
- package/dist/{extension-CJClssfp.mjs → extension-CjTu6mzW.mjs} +1 -1
- package/dist/extension-D4iKUUMG.mjs +1 -0
- package/dist/{filesystem-service-Bmyqo6po.mjs → filesystem-service-maY_P3yA.mjs} +1 -1
- package/dist/git/index.mjs +1 -1
- package/dist/{globby-D4SANVoq.mjs → globby-CisClzat.mjs} +1 -1
- package/dist/handlers-RGs3eC9X.mjs +57 -0
- package/dist/{harness-DkUpbsuY.mjs → harness-DflvHAGV.mjs} +1 -1
- package/dist/{index-C23g_M_J2.d.mts → index-5s_dN3cg2.d.mts} +18 -1
- package/dist/index-9dISOTLT.d.mts +174 -0
- package/dist/{index-B9d_8_V2.d.mts → index-9g0agW_p.d.mts} +55 -55
- package/dist/{index-DoEF9LAc.d.mts → index-BcejR1Jc.d.mts} +3 -3
- package/dist/index-BsEvzFey.d.mts +1175 -0
- package/dist/{index-ntS1EXlf.d.mts → index-BtL7ONuM.d.mts} +1 -1
- package/dist/index-BxuiHVFi.d.mts +284 -0
- package/dist/{index-PIlYSC73.d.mts → index-C9Q1E8Y-.d.mts} +66 -53
- package/dist/{index-CaerrEDH.d.mts → index-CB2XTzvd.d.mts} +3 -3
- package/dist/{index-Cx1Bm6WD.d.mts → index-CVs0Qxks.d.mts} +8 -8
- package/dist/{index-WHUV7neB.d.mts → index-CW6-0k3Z.d.mts} +105 -105
- package/dist/index-CagRgpXI2.d.mts +84 -0
- package/dist/{index-DZPNuWMc.d.mts → index-Cw3cjGAT.d.mts} +7 -7
- package/dist/{index-DnnKUwHm.d.mts → index-D5IEq4_E.d.mts} +36 -32
- package/dist/{index-h5go5Dtd.d.mts → index-D75FnT0B.d.mts} +1 -1
- package/dist/{index-O08Q2ikz.d.mts → index-DNc1yLQs.d.mts} +8 -8
- package/dist/{index-FFVwQMad.d.mts → index-DlUPWOh4.d.mts} +737 -97
- package/dist/{index-DScUb-hF.d.mts → index-Do7Wgio_2.d.mts} +35 -12
- package/dist/{index-C9FCWOhp.d.mts → index-DxatNFz7.d.mts} +124 -22
- package/dist/{index-BvTd61i5.d.mts → index-T96ydgVk.d.mts} +260 -160
- package/dist/{index-DLNRgZPo2.d.mts → index-j2YlW_Fc.d.mts} +1 -1
- package/dist/{index-BcvG3wPv.d.mts → index-p6dWV52m.d.mts} +513 -373
- package/dist/{index-B2DjrVb8.d.mts → index-sCOlgPyj.d.mts} +1589 -482
- package/dist/kernel/cli/index.d.mts +2 -2
- package/dist/kernel/cli/index.mjs +1 -1
- package/dist/kernel/cli/register.d.mts +1 -1
- package/dist/kernel/cli/register.mjs +1 -1
- package/dist/kernel/cli/schemas.mjs +1 -1
- package/dist/kernel/extension/index.d.mts +1 -1
- package/dist/kernel/extension/index.mjs +1 -1
- package/dist/kernel/index.d.mts +5 -5
- package/dist/kernel/index.mjs +1 -1
- package/dist/kernel/namespace/index.d.mts +1 -1
- package/dist/kernel/namespace/index.mjs +1 -1
- package/dist/kernel/observability/index.d.mts +1 -1
- package/dist/kernel/observability/index.mjs +1 -1
- package/dist/kernel/providers/index.d.mts +1 -1
- package/dist/kernel/providers/index.mjs +1 -1
- package/dist/kernel/window/index.d.mts +1 -1
- package/dist/kernel/window/index.mjs +1 -1
- package/dist/{lib-BOmKyjWD.mjs → lib-DIVnpS8e.mjs} +1 -1
- package/dist/{lib-DLZYp5z3.mjs → lib-DymjnkAP.mjs} +1 -1
- package/dist/{load-extensions-Cze1RHcG.mjs → load-extensions-BtUrq2_t.mjs} +1 -1
- package/dist/{load-extensions-DNRIy4zC.d.mts → load-extensions-_EnedkUp.d.mts} +1 -1
- package/dist/{loop-gate-handlers-o2B5FPdF.mjs → loop-gate-handlers-0a3dIY8O.mjs} +1 -1
- package/dist/mcp-http-server/index.mjs +1 -1
- package/dist/model-uE5IyUFJ.mjs +1 -0
- package/dist/namespace-C05pkLbN.mjs +1 -0
- package/dist/{namespace-D8P8Sxce2.d.mts → namespace-CGgOLxiW2.d.mts} +2 -2
- package/dist/{namespace-BGIeqwfU.d.mts → namespace-CQBSXm1U.d.mts} +20 -20
- package/dist/{namespace-CfvtDD_U.d.mts → namespace-CfgtqUWS.d.mts} +156 -156
- package/dist/{namespace-D9PLFmPQ.d.mts → namespace-CpyL93kW.d.mts} +27 -27
- package/dist/{namespace-CZK2ff3B.d.mts → namespace-D3SQQgxa2.d.mts} +1 -1
- package/dist/namespace-D7pE2QWv.mjs +1 -0
- package/dist/{namespace-dFBD2ZmS.mjs → namespace-DwQtzlY-.mjs} +1 -1
- package/dist/namespace-HsI0Jbbr.mjs +1 -0
- package/dist/namespace-VmsT_tLJ.d.mts +3729 -0
- package/dist/namespace-Xp9-g_r-.mjs +1 -0
- package/dist/{native-session-supervisor-7ElwM6Is.mjs → native-session-supervisor-CdtVGWA9.mjs} +1 -1
- package/dist/node/bus-server/index.d.mts +1 -1
- package/dist/node/bus-server/index.mjs +1 -1
- package/dist/node/bus-server/server-lifecycle.d.mts +1 -1
- package/dist/node/bus-server/server-lifecycle.mjs +1 -1
- package/dist/node/transports/index.d.mts +36 -1
- package/dist/node/transports/index.mjs +2 -2
- package/dist/{orchestrator-shared-ChygCvR1.mjs → orchestrator-shared-DAkGOu9H.mjs} +1 -1
- package/dist/{orchestrator-shared-DFLb1otg.d.mts → orchestrator-shared-pxtyNu3W.d.mts} +13 -6
- package/dist/{package-Co_GO3UD.mjs → package-0gVhAVkO.mjs} +1 -1
- package/dist/package-BwvGaKwn.mjs +1 -0
- package/dist/package.json +1 -1
- package/dist/{profile-BMBXUqqh.mjs → profile-D2m94ZYD.mjs} +1 -1
- package/dist/provider-context-BYkMl--1.mjs +1 -0
- package/dist/provider-context-DOsjOjiR.mjs +1 -0
- package/dist/{providers-namespace-5GoTlHXz.d.mts → providers-namespace-O4de1tgO.d.mts} +161 -14
- package/dist/resolved-O2XXjTeu.mjs +1 -0
- package/dist/rules/index.d.mts +1 -1
- package/dist/rules/index.mjs +1 -1
- package/dist/rules/schemas.d.mts +1 -1
- package/dist/runtime-bun/index.mjs +1 -1
- package/dist/runtime-node/client-binary-strategy-dependencies.d.mts +34 -0
- package/dist/runtime-node/client-binary-strategy-dependencies.mjs +1 -0
- package/dist/runtime-node/extension-discovery.d.mts +1 -1
- package/dist/runtime-node/extension-validation.d.mts +1 -1
- package/dist/runtime-node/extension-validation.mjs +1 -1
- package/dist/runtime-node/index.d.mts +32 -6
- package/dist/runtime-node/index.mjs +24 -24
- package/dist/runtime-node/makaio-config.d.mts +1 -1
- package/dist/runtime-node/makaio-config.mjs +1 -1
- package/dist/runtime-node/workflow-worker/index.d.mts +1 -1
- package/dist/runtime-node/workflow-worker/index.mjs +1 -1
- package/dist/runtime-node/workflow-worker/worker-entry.mjs +1 -1
- package/dist/{schema-7aKBGB7S.mjs → schema-BI0aCHvV.mjs} +1 -1
- package/dist/{schema-B5vHi7Uu.d.mts → schema-BnTOFCdU.d.mts} +1 -1
- package/dist/{schemas-Br-rSxPE2.d.mts → schemas--uwN5dfK2.d.mts} +11 -11
- package/dist/schemas-C-J4W1ID.mjs +1 -0
- package/dist/{schemas-CoFCV42v.d.mts → schemas-C17AifUQ.d.mts} +156 -156
- package/dist/schemas-D6lj9NMg.mjs +1 -0
- package/dist/schemas-K3Td_WdR.d.mts +3175 -0
- package/dist/schemas-n9Ff6_RX.mjs +1 -0
- package/dist/selection-YRuVSdck.mjs +1 -0
- package/dist/services/adapter-runtime/index.d.mts +3 -3
- package/dist/services/adapter-runtime/index.mjs +1 -1
- package/dist/services/adapter-runtime/namespace.d.mts +1 -1
- package/dist/services/adapter-runtime/schemas.d.mts +1 -1
- package/dist/services/adapter-subsystem/index.d.mts +4 -3
- package/dist/services/adapter-subsystem/index.mjs +1 -1
- package/dist/services/adapter-subsystem/namespace.d.mts +1 -1
- package/dist/services/adapter-subsystem/namespace.mjs +1 -1
- package/dist/services/agent-runtime/index.d.mts +2 -2
- package/dist/services/agent-runtime/namespace.d.mts +1 -1
- package/dist/services/agent-runtime/schemas.d.mts +1 -1
- package/dist/services/capability/index.d.mts +1 -1
- package/dist/services/capability/index.mjs +1 -1
- package/dist/services/codebase/index.d.mts +2 -2
- package/dist/services/codebase/namespace.d.mts +1 -1
- package/dist/services/codebase/schemas.d.mts +1 -1
- package/dist/services/compression/index.d.mts +2 -2
- package/dist/services/compression/namespace.d.mts +1 -1
- package/dist/services/compression/schemas.d.mts +1 -1
- package/dist/services/context-rules/index.d.mts +1 -1
- package/dist/services/context-rules/index.mjs +1 -1
- package/dist/services/definition/namespace.d.mts +1 -19
- package/dist/services/definition/schemas.d.mts +0 -9
- package/dist/services/definition/schemas.mjs +1 -1
- package/dist/services/execution-target/index.d.mts +4 -4
- package/dist/services/execution-target/index.mjs +1 -1
- package/dist/services/execution-target/namespace.d.mts +1 -1
- package/dist/services/execution-target/namespace.mjs +1 -1
- package/dist/services/execution-target/schemas.d.mts +1 -1
- package/dist/services/execution-target/schemas.mjs +1 -1
- package/dist/services/filesystem/index.d.mts +1 -1
- package/dist/services/filesystem/index.mjs +1 -1
- package/dist/services/filesystem/namespace.d.mts +6 -6
- package/dist/services/filesystem/schemas.d.mts +3 -3
- package/dist/services/git/namespace.mjs +1 -1
- package/dist/services/git/schemas.mjs +1 -1
- package/dist/services/harness/index.d.mts +6 -6
- package/dist/services/harness/index.mjs +1 -1
- package/dist/services/index.d.mts +1671 -253
- package/dist/services/index.mjs +1 -1
- package/dist/services/log-import/browser.d.mts +2 -2
- package/dist/services/log-import/index.d.mts +2 -2
- package/dist/services/log-import/log-import.d.mts +1 -1
- package/dist/services/log-import/log-import.mjs +1 -1
- package/dist/services/log-import/namespace.mjs +1 -1
- package/dist/services/log-import/schemas.mjs +1 -1
- package/dist/services/model-registry/index.d.mts +1 -1
- package/dist/services/model-registry/index.mjs +1 -1
- package/dist/services/preferences/index.d.mts +2 -2
- package/dist/services/preferences/schemas.d.mts +1 -1
- package/dist/services/preferences/storage-namespace.d.mts +2 -2
- package/dist/services/provider-context/index.d.mts +2 -2
- package/dist/services/provider-context/index.mjs +1 -1
- package/dist/services/provider-runtime/index.d.mts +18 -0
- package/dist/services/provider-runtime/index.mjs +1 -1
- package/dist/services/session/handlers/index.d.mts +1 -1
- package/dist/services/session/handlers/index.mjs +1 -1
- package/dist/services/session/index.d.mts +10 -10
- package/dist/services/session/index.mjs +1 -1
- package/dist/services/session/messages/namespace.d.mts +1 -1
- package/dist/services/session/messages/namespace.mjs +1 -1
- package/dist/services/session/orchestrator-testing/index.d.mts +1 -1
- package/dist/services/session/orchestrator-testing/index.mjs +1 -1
- package/dist/services/session/session-events/namespace.d.mts +1 -1
- package/dist/services/session/session-events/namespace.mjs +1 -1
- package/dist/services/session/storage/namespace.d.mts +1 -1
- package/dist/services/session/storage/schema.d.mts +1 -1
- package/dist/services/session/testing/index.d.mts +2 -2
- package/dist/services/session/testing/index.mjs +10 -10
- package/dist/services/session/testing/orchestrator-shared.d.mts +1 -1
- package/dist/services/session/testing/orchestrator-shared.mjs +1 -1
- package/dist/services/session/turns/namespace.d.mts +1 -1
- package/dist/services/session/turns/namespace.mjs +1 -1
- package/dist/services/session-editor/index.d.mts +1 -1
- package/dist/services/session-editor/index.mjs +1 -1
- package/dist/services/settings/index.d.mts +3 -3
- package/dist/services/settings/index.mjs +1 -1
- package/dist/services/settings/namespace.d.mts +18 -25
- package/dist/services/settings/namespace.mjs +1 -1
- package/dist/services/settings/storage/clients-namespace.d.mts +1 -1
- package/dist/services/settings/storage/clients-namespace.mjs +1 -1
- package/dist/services/settings/storage/index.d.mts +3 -3
- package/dist/services/settings/storage/index.mjs +1 -1
- package/dist/services/settings/storage/providers-namespace.d.mts +1 -1
- package/dist/services/settings/storage/providers-namespace.mjs +1 -1
- package/dist/services/subagent/index.d.mts +2 -2
- package/dist/services/subagent/index.mjs +1 -1
- package/dist/services/subagent-template/index.d.mts +2 -2
- package/dist/services/subagent-template/namespace.d.mts +1 -1
- package/dist/services/subagent-template/schemas.d.mts +1 -1
- package/dist/services/tool-approval/index.d.mts +1 -1
- package/dist/services/tool-approval/index.mjs +1 -1
- package/dist/services/tools/index.d.mts +1 -1
- package/dist/services/tools/index.mjs +1 -1
- package/dist/services/tray-menu/index.d.mts +3 -3
- package/dist/services/tray-menu/index.mjs +1 -1
- package/dist/services/tray-menu/namespace.d.mts +1 -1
- package/dist/services/tray-menu/schemas.d.mts +1 -1
- package/dist/services/turn/index.d.mts +1 -1
- package/dist/services/turn/namespace.d.mts +1 -1
- package/dist/session-CAjudDuJ.mjs +76 -0
- package/dist/{session-DBfQkgdy.mjs → session-lRd8HZNZ.mjs} +1 -1
- package/dist/{session-lineage-C1M7-O3C.d.mts → session-lineage-BLw8iWAj.d.mts} +1 -1
- package/dist/{shared-BVW-3Dhy.mjs → shared-RP_KARKF.mjs} +1 -1
- package/dist/{skill-N-ttlp1i.mjs → skill-CpNjWFuE.mjs} +1 -1
- package/dist/{src-Ck2sbaDa.mjs → src-Bo2eA51B.mjs} +1 -1
- package/dist/storage/drizzle/client.d.mts +1 -1
- package/dist/storage/drizzle/client.mjs +1 -1
- package/dist/storage/drizzle/index.d.mts +1 -1
- package/dist/storage/drizzle/index.mjs +1 -1
- package/dist/storage/handlers/drizzle/index.d.mts +1 -1
- package/dist/storage/handlers/drizzle/index.mjs +1 -1
- package/dist/storage/handlers/index.d.mts +1 -1
- package/dist/storage/handlers/index.mjs +1 -1
- package/dist/{tool-approval-service-DEiMKTv9.mjs → tool-approval-service-Dh0XI21f.mjs} +1 -1
- package/dist/tools-C8vqn1KY.mjs +1 -0
- package/dist/{transition-OzGXyy3p.d.mts → transition-Bfe8VVc1.d.mts} +2 -2
- package/dist/{types-BWduCvRU.d.mts → types-B-xY9WW2.d.mts} +1 -1
- package/dist/{types-BrUOVfwe.d.mts → types-DvKaEOOn.d.mts} +252 -19
- package/dist/{types-CBLPaQXe.d.mts → types-q95p55BF.d.mts} +437 -287
- package/dist/ui-hooks/index.d.mts +103 -14
- package/dist/ui-hooks/index.mjs +1 -1
- package/dist/ui-kernel/index.d.mts +3 -3
- package/dist/ui-kernel/pages/schemas.d.mts +1 -1
- package/dist/utils/keychain.mjs +1 -1
- package/dist/{version-DoV_pSzT.mjs → version-C1-VD-XL.mjs} +1 -1
- package/dist/workflow-CvVAZ89A.mjs +1 -0
- package/dist/workflow-engine/index.d.mts +33 -33
- package/dist/workflow-engine/index.mjs +1 -1
- package/dist/workflow-engine/package.d.mts +1 -1
- package/dist/workflow-engine/package.mjs +1 -1
- package/dist/workflow-engine/workflow-orchestrator.mjs +1 -1
- package/dist/{workflow-worker-dH70EbjE.mjs → workflow-worker-CudfEstp.mjs} +1 -1
- package/package.json +5 -1
- package/dist/account-identity-C7Kx_ieU.mjs +0 -1
- package/dist/cleanEnvForAdapter-BooAgM2R.mjs +0 -1
- package/dist/client-DaR4mzqn.mjs +0 -1
- package/dist/compression-C5JAWdgZ.mjs +0 -1
- package/dist/config-namespace-CY9leBnE.mjs +0 -1
- package/dist/credential-ref-YWQQENEo.mjs +0 -1
- package/dist/definition-C-GVz7uw.mjs +0 -1
- package/dist/execution-target-BR8bLkCR.mjs +0 -1
- package/dist/extension-BS_4BOeO.mjs +0 -1
- package/dist/handlers-B74FvKlA.mjs +0 -57
- package/dist/index-BcwOnvUh.d.mts +0 -749
- package/dist/index-D6aAzr32.d.mts +0 -997
- package/dist/index-DtwGhFFQ.d.mts +0 -40
- package/dist/namespace-B4cV_pk3.d.mts +0 -1317
- package/dist/namespace-BO3tODGC.mjs +0 -1
- package/dist/namespace-CVMZVqB5.mjs +0 -1
- package/dist/namespace-DBHwyhME.mjs +0 -1
- package/dist/namespace-DibbhCPP.mjs +0 -1
- package/dist/package-CF_Zm2v4.mjs +0 -1
- package/dist/provider-context-CqMgPOWF.mjs +0 -1
- package/dist/provider-context-DC_eq7es.mjs +0 -1
- package/dist/schemas-CVo8qAK-.mjs +0 -1
- package/dist/schemas-CuG17U3L.mjs +0 -1
- package/dist/session-CX6QDhi2.mjs +0 -76
- package/dist/tools-CGFZkB7F.mjs +0 -1
- package/dist/workflow-C3dgVwTY.mjs +0 -1
- /package/dist/{ajv-B5dPIck0.mjs → ajv-DfHhgdS5.mjs} +0 -0
- /package/dist/{await-trigger-DwVldnMt.mjs → await-trigger-D623tvig.mjs} +0 -0
- /package/dist/{capability-service-XlymTzz1.mjs → capability-service-Dg2bU8qc.mjs} +0 -0
- /package/dist/{client-CebV_fZc.d.mts → client-DmJwprw1.d.mts} +0 -0
- /package/dist/{create-static-mount-DkK28kKW.mjs → create-static-mount-CBTXRtbN.mjs} +0 -0
- /package/dist/{cross-spawn-CDXy3BjE.mjs → cross-spawn-D9WWFl2a.mjs} +0 -0
- /package/dist/{cursor-storage-luQAg7E_.mjs → cursor-storage-Bw-7ROzx.mjs} +0 -0
- /package/dist/{descriptor-to-package-DdpjpT7n.mjs → descriptor-to-package-D5SWf6TL.mjs} +0 -0
- /package/dist/{drizzle-DVTAl7Us.mjs → drizzle-DYfaDzlO.mjs} +0 -0
- /package/dist/{esm-CQG9Pc7n.mjs → esm-oHhRYTEn.mjs} +0 -0
- /package/dist/{event-DguYjV6D.mjs → event-DTM0-qWP.mjs} +0 -0
- /package/dist/{extension-discovery-CIZn5bkq.d.mts → extension-discovery-APMf1Tes.d.mts} +0 -0
- /package/dist/{extension-namespace-v3K0qVry.mjs → extension-namespace-vrh4ERXR.mjs} +0 -0
- /package/dist/{facet-BM4y4aQP.mjs → facet-DqPBpqkl.mjs} +0 -0
- /package/dist/{filesystem-service-Cwp0sWNc.d.mts → filesystem-service-Bx0bR2Lb.d.mts} +0 -0
- /package/dist/{handler-BFNvtv5t.mjs → handler-4pKQi3eo.mjs} +0 -0
- /package/dist/{host-vY07gek-.mjs → host-BfgdjlII.mjs} +0 -0
- /package/dist/{identity-DC3Pk0ps.mjs → identity-2qUT1NME.mjs} +0 -0
- /package/dist/{index-COI1tjAf.d.mts → index-BZ_DSGnE.d.mts} +0 -0
- /package/dist/{index-D7rWAEY0.d.mts → index-Bd52mmj9.d.mts} +0 -0
- /package/dist/{index-Dfi8Rorw.d.mts → index-BkAKfh4d.d.mts} +0 -0
- /package/dist/{index-CuHqL95P.d.mts → index-Bv9lm0Kf.d.mts} +0 -0
- /package/dist/{index-C4nStEdA.d.mts → index-C18Pn3zP.d.mts} +0 -0
- /package/dist/{index-Cr9lh21j.d.mts → index-CarbJsC92.d.mts} +0 -0
- /package/dist/{index-BjoOSg95.d.mts → index-Ctw617Tj.d.mts} +0 -0
- /package/dist/{index-DUD7wikz2.d.mts → index-D0eUQjTU2.d.mts} +0 -0
- /package/dist/{index-DEzdNQum.d.mts → index-DfVSWBBp.d.mts} +0 -0
- /package/dist/{index-D3ahzHwb.d.mts → index-DnWZdG6C.d.mts} +0 -0
- /package/dist/{index-CpKikwK4.d.mts → index-DoLdETfR.d.mts} +0 -0
- /package/dist/{index-B92mToDo2.d.mts → index-DvaPrL6C.d.mts} +0 -0
- /package/dist/{index-D7Hkmrr3.d.mts → index-DwDBa2mb.d.mts} +0 -0
- /package/dist/{index-Y8rMeYYX.d.mts → index-FDyqQIt5.d.mts} +0 -0
- /package/dist/{index-BWIkf5oJ.d.mts → index-Lp0T_V1W.d.mts} +0 -0
- /package/dist/{index-OGIC4puQ.d.mts → index-Rhcr4YNA.d.mts} +0 -0
- /package/dist/{index-BvLXySoB2.d.mts → index-S-mAqWwq.d.mts} +0 -0
- /package/dist/{index-DOOrKin9.d.mts → index-_zsihEmk.d.mts} +0 -0
- /package/dist/{index-wq7XeqyG.d.mts → index-iJP-l15K.d.mts} +0 -0
- /package/dist/{json-value-DtIkQN7g.d.mts → json-value-C8duSh9X.d.mts} +0 -0
- /package/dist/{jsonl-transport-CGPgD8iU.mjs → jsonl-transport-l5NPcQ_2.mjs} +0 -0
- /package/dist/{lib-ZKtnbCqH.mjs → lib-ClRTNIuz.mjs} +0 -0
- /package/dist/{materialization-CUYxZCfk.mjs → materialization-BwTORtBr.mjs} +0 -0
- /package/dist/{model-registry-C2VXobZj.mjs → model-registry-BneK5SGo.mjs} +0 -0
- /package/dist/{model-registry-rYICIwyR.mjs → model-registry-C8MInDtX.mjs} +0 -0
- /package/dist/{namespace-65uwTpbg.d.mts → namespace-3YVLQ_bM.d.mts} +0 -0
- /package/dist/{namespace-CQ8uza7o.d.mts → namespace-BcDHt-ww.d.mts} +0 -0
- /package/dist/{namespace-BigVYQyx.d.mts → namespace-BhVlHfoO.d.mts} +0 -0
- /package/dist/{namespace-j7vFsmYL.d.mts → namespace-Bl1UhLnK.d.mts} +0 -0
- /package/dist/{namespace-Dk4OslmY.d.mts → namespace-BsEoWXV_.d.mts} +0 -0
- /package/dist/{namespace-DYSFDC2G.mjs → namespace-C238RqwB.mjs} +0 -0
- /package/dist/{namespace-BdO4e1Fm.mjs → namespace-CDO4rY11.mjs} +0 -0
- /package/dist/{namespace-wke7juzy.mjs → namespace-DDx4NVJm.mjs} +0 -0
- /package/dist/{namespace-D1_9WVCo.d.mts → namespace-Dar3O6iT.d.mts} +0 -0
- /package/dist/{namespace-DAj_riOn.d.mts → namespace-DoNigVgx.d.mts} +0 -0
- /package/dist/{namespace-D2s-4pyg.d.mts → namespace-Dvi66QS6.d.mts} +0 -0
- /package/dist/{out-BoEZjBNz.mjs → out-BB6Kb4Xu.mjs} +0 -0
- /package/dist/{package-DmVZxufT.d.mts → package-CdBiknf3.d.mts} +0 -0
- /package/dist/{platform-DnbSvm2u.mjs → platform-CWhGFQFX.mjs} +0 -0
- /package/dist/{providers-Bd7BOZs0.mjs → providers-CUnrif24.mjs} +0 -0
- /package/dist/{quick-lru-6e7I1Bgf.mjs → quick-lru-BLaSzINB.mjs} +0 -0
- /package/dist/{registry-U_3aYSin.mjs → registry-TJjQgTgp.mjs} +0 -0
- /package/dist/{schema-CHp6I33k.mjs → schema-cus0dJ81.mjs} +0 -0
- /package/dist/{schema-introspection-B7xODt4I.mjs → schema-introspection-BsWLmoFp.mjs} +0 -0
- /package/dist/{schemas-KlH1hB7u.d.mts → schemas-9QJf1FtS.d.mts} +0 -0
- /package/dist/{schemas-CJ2JvA7d.d.mts → schemas-BolSW7pQ.d.mts} +0 -0
- /package/dist/{schemas-D4zaFE2p.d.mts → schemas-CLsbsX1W.d.mts} +0 -0
- /package/dist/{schemas-XeIBqwvE.mjs → schemas-CMyv7l7-.mjs} +0 -0
- /package/dist/{schemas-CPI00yvh.mjs → schemas-CWxf_Yut.mjs} +0 -0
- /package/dist/{schemas-BemsLc_V.d.mts → schemas-D_9X_CRo.d.mts} +0 -0
- /package/dist/{schemas-DZGnr9Tl.mjs → schemas-DwfTUQIa.mjs} +0 -0
- /package/dist/{schemas-B6tEKf9T.d.mts → schemas-XRhqOgVE.d.mts} +0 -0
- /package/dist/{schemas-DKncXGnb.d.mts → schemas-fRLDhefF.d.mts} +0 -0
- /package/dist/{schemas-DWfo0wp4.d.mts → schemas-jDRSOXJL.d.mts} +0 -0
- /package/dist/{schemas-lnE9YoG7.d.mts → schemas-qpo1Goit.d.mts} +0 -0
- /package/dist/{schemas-t6h9oSct.d.mts → schemas-qt5QTjVc.d.mts} +0 -0
- /package/dist/{semver-CIhHqMkw.mjs → semver-BccS1s9R.mjs} +0 -0
- /package/dist/{server-lifecycle-C5Z5PSMD.mjs → server-lifecycle-D-jxVr_0.mjs} +0 -0
- /package/dist/{server-lifecycle-_AA6EfzL.d.mts → server-lifecycle-r5Tkk8bU.d.mts} +0 -0
- /package/dist/{shared-schemas-BEVG96xW.mjs → shared-schemas-BNCPgGYP.mjs} +0 -0
- /package/dist/{src-_VODAJnf.mjs → src-Ci_WY9uw.mjs} +0 -0
- /package/dist/{storage-namespace-D5q9CrBp.mjs → storage-namespace-BzE2M4Hq.mjs} +0 -0
- /package/dist/{storage-namespace-Di1A3DMm.d.mts → storage-namespace-DWKFqEW-.d.mts} +0 -0
- /package/dist/{storage-namespace-definition-CzXPW45M.mjs → storage-namespace-definition-4UYuij1r.mjs} +0 -0
- /package/dist/{storage-namespace-definition-BffdI5Bz.d.mts → storage-namespace-definition-BZJGSaX3.d.mts} +0 -0
- /package/dist/{supports-color-DcXkvGDF.mjs → supports-color-Dzp6WuF5.mjs} +0 -0
- /package/dist/{telemetry-Cvi4rxiE.mjs → telemetry-B42EMbZt.mjs} +0 -0
- /package/dist/{timeout-XsYIOKrc.mjs → timeout-CvONPl0l.mjs} +0 -0
- /package/dist/{tray-menu-service-B2AxiQqL.mjs → tray-menu-service-Bonl2KXf.mjs} +0 -0
- /package/dist/{types-Bo78h9e3.d.mts → types-BCW9kr4L.d.mts} +0 -0
- /package/dist/{types-DCvp_swt.d.mts → types-CrJ7KEZ0.d.mts} +0 -0
- /package/dist/{types-BNW5n6qm.d.mts → types-DWNoZ3Sd.d.mts} +0 -0
- /package/dist/{ui-config-9bDRwFZr.mjs → ui-config-B2L3Xgqo.mjs} +0 -0
- /package/dist/{variant-5huHjUTm.mjs → variant-ByI-RZua.mjs} +0 -0
- /package/dist/{window-registry-PkrFIwX2.mjs → window-registry-DsWnCc8z.mjs} +0 -0
- /package/dist/{window-registry-ofIUQnfo.d.mts → window-registry-WsWu-rcK.d.mts} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { _ as BaseAgentConnectorConfig } from "../../types-
|
|
1
|
+
import { A as PreparedAdapterAuthRuntime, B as ResolvedAdapterAuth, D as AdapterAuthLeaseHandle, F as AdapterAuthError, G as resolveBoundProviderAuth, H as ResolvedConnectorAuthDelivery, I as AdapterAuthErrorReason, L as BindProviderAuthOptions, M as SuppliedAdapterAuthRuntime, N as applySuppliedAdapterAuthRuntime, O as AdapterAuthRuntimePreparer, P as prepareAdapterAuthRuntime, R as BoundProviderAuthContext, U as bindProviderAuth, V as ResolvedAuthCredentialValues, W as getOptionalAuthCredentialFields, _ as BaseAgentConnectorConfig, j as ResolvedAdapterRuntimeConfig, k as BoundAdapterRuntimeConfig, z as ResolveAuthCredentialRefs } from "../../types-DvKaEOOn.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { IMakaioBus, MakaioBusContext } from "@makaio/framework/bus";
|
|
4
|
-
import { AIModelSchema, ProtocolId, ProviderContext } from "@makaio/framework/contracts";
|
|
4
|
+
import { AIModelSchema, AdapterProviderAuth, ProtocolId, ProviderContext, ResolvedProviderAuth } from "@makaio/framework/contracts";
|
|
5
5
|
import { BaseAdapterConfigSchema, CredentialRef, ProviderConfigSchema, ProviderDefaultsSchema } from "@makaio/framework/contracts/config";
|
|
6
6
|
import { ClientExecutionContext } from "@makaio/framework/contracts/client";
|
|
7
7
|
import { ProviderRecord } from "@makaio/framework/services/settings/storage";
|
|
8
8
|
import { TimeoutConfig, TrackedTimeoutConfig } from "@makaio/framework/utils";
|
|
9
|
-
import { ProviderConfigFileRecord } from "@makaio/framework/services/adapter-subsystem";
|
|
9
|
+
import { AdapterRuntimeSnapshot, AdapterRuntimeSnapshotErrorCode, AdapterRuntimeSnapshotErrorCode as AdapterRuntimeSnapshotErrorCode$1, ProviderConfigFileRecord } from "@makaio/framework/services/adapter-subsystem";
|
|
10
10
|
import { Simplify } from "type-fest";
|
|
11
11
|
|
|
12
12
|
//#region adapters/core/src/config/resolve-credential-ref.d.ts
|
|
@@ -121,8 +121,6 @@ interface CreateAdapterConfigFactoryOptions<TConfig extends BaseAgentConnectorCo
|
|
|
121
121
|
adapterDefinition: {
|
|
122
122
|
defaultTimeouts?: TimeoutConfig;
|
|
123
123
|
};
|
|
124
|
-
/** Wire protocol used to select the correct provider endpoint URL from endpointOverrides. */
|
|
125
|
-
protocol: ProtocolId;
|
|
126
124
|
}
|
|
127
125
|
/**
|
|
128
126
|
* Minimal input shape required by the factory.
|
|
@@ -133,11 +131,18 @@ interface AdapterConfigFactoryInput<TConfig extends BaseAgentConnectorConfig> {
|
|
|
133
131
|
agentId: string;
|
|
134
132
|
adapterName: string;
|
|
135
133
|
adapterId: string;
|
|
136
|
-
/**
|
|
137
|
-
* Unresolved provider context (credential refs, not plaintext).
|
|
138
|
-
* Connectors resolve credentials locally via `resolveConnectorCredentials()`.
|
|
139
|
-
*/
|
|
134
|
+
/** Resolved refs-only provider context or the closed provider-less state. */
|
|
140
135
|
providerContext: ProviderContext;
|
|
136
|
+
/** Exact protocol declared by the selected adapter/provider reference. */
|
|
137
|
+
providerProtocol?: ProtocolId;
|
|
138
|
+
/** Adapter/provider auth metadata selected by `providerContext.definitionId`. */
|
|
139
|
+
adapterProviderAuth?: AdapterProviderAuth;
|
|
140
|
+
/** Other adapter/provider auth declarations contributing to the scrub union. */
|
|
141
|
+
compatibleProviderAuths?: readonly AdapterProviderAuth[];
|
|
142
|
+
/** Whether this adapter rejects the unresolved provider state. */
|
|
143
|
+
providerContextRequired?: boolean;
|
|
144
|
+
/** Runtime client identity used to validate client-owned auth methods. */
|
|
145
|
+
clientId?: string;
|
|
141
146
|
model?: string;
|
|
142
147
|
cwd?: string;
|
|
143
148
|
env?: Record<string, string>;
|
|
@@ -153,12 +158,14 @@ interface FactoryGuaranteedFields<TProviderConfig> {
|
|
|
153
158
|
cwd: string;
|
|
154
159
|
timeouts: TrackedTimeoutConfig;
|
|
155
160
|
providerConfig: TProviderConfig;
|
|
161
|
+
/** Exact refs-only auth binding consumed once by the central runtime. */
|
|
162
|
+
boundProviderAuth?: BoundProviderAuthContext;
|
|
156
163
|
}
|
|
157
164
|
/**
|
|
158
165
|
* Result type: input + adapter defaults + guaranteed fields.
|
|
159
166
|
* Simplify flattens the intersection for better type display.
|
|
160
167
|
*/
|
|
161
|
-
type ConfigFactoryResult<TInput extends AdapterConfigFactoryInput<TConfig>, TConfig extends BaseAgentConnectorConfig, TProviderConfig = TConfig['providerConfig']> = Simplify<AdapterDefaults<TConfig> & Omit<TInput, 'providerConfig'> & FactoryGuaranteedFields<TProviderConfig>>;
|
|
168
|
+
type ConfigFactoryResult<TInput extends AdapterConfigFactoryInput<TConfig>, TConfig extends BaseAgentConnectorConfig, TProviderConfig = TConfig['providerConfig']> = Simplify<AdapterDefaults<TConfig> & Omit<TInput, 'providerConfig' | 'adapterProviderAuth' | 'compatibleProviderAuths' | 'providerContextRequired'> & FactoryGuaranteedFields<TProviderConfig>>;
|
|
162
169
|
type AdapterConfigFactory<TConfig extends BaseAgentConnectorConfig, TProviderConfig> = {
|
|
163
170
|
getConfig: <TInput extends AdapterConfigFactoryInput<TConfig>>(input: TInput) => Promise<ConfigFactoryResult<TInput, TConfig, TProviderConfig>>; /** Lazily evaluate the thunk and return adapter defaults (model, fastModel, etc.) */
|
|
164
171
|
getDefaults: () => AdapterDefaults<TConfig>;
|
|
@@ -167,12 +174,12 @@ type AdapterConfigFactory<TConfig extends BaseAgentConnectorConfig, TProviderCon
|
|
|
167
174
|
* Create a standardized adapter config factory.
|
|
168
175
|
*
|
|
169
176
|
* Eliminates ceremony by encapsulating the common pattern:
|
|
170
|
-
* 1.
|
|
177
|
+
* 1. Bind the refs-only provider auth selection to one exact adapter declaration
|
|
171
178
|
* 2. resolveTimeouts with adapter + runtime layers
|
|
172
|
-
* 3. Merge providerConfigDefaults with runtime providerConfig
|
|
179
|
+
* 3. Merge providerConfigDefaults with runtime providerConfig
|
|
173
180
|
*
|
|
174
|
-
* The factory is pure: it does not dispatch any bus requests
|
|
175
|
-
*
|
|
181
|
+
* The factory is pure: it does not dispatch any bus requests or resolve
|
|
182
|
+
* credential refs. The central connector runtime consumes the bound result.
|
|
176
183
|
*
|
|
177
184
|
* Options are provided via thunk to enable lazy evaluation, avoiding circular
|
|
178
185
|
* dependency issues when config.ts imports from index.ts (for adapterDefinition)
|
|
@@ -186,13 +193,23 @@ type AdapterConfigFactory<TConfig extends BaseAgentConnectorConfig, TProviderCon
|
|
|
186
193
|
* adapterDefaults: { model: 'gemini-2.5-pro' },
|
|
187
194
|
* schema: null,
|
|
188
195
|
* adapterDefinition: { defaultTimeouts: DEFAULT_TIMEOUTS },
|
|
189
|
-
* protocol: 'openai',
|
|
190
196
|
* }));
|
|
191
197
|
* ```
|
|
192
198
|
*/
|
|
193
199
|
declare function createAdapterConfigFactory<TConfig extends BaseAgentConnectorConfig, TProviderConfig = TConfig['providerConfig']>(optionsThunk: () => CreateAdapterConfigFactoryOptions<TConfig>): AdapterConfigFactory<TConfig, TProviderConfig>;
|
|
194
200
|
//#endregion
|
|
195
201
|
//#region adapters/core/src/config/resolve-provider-endpoint.d.ts
|
|
202
|
+
/** Stable authenticated endpoint-resolution failure categories. */
|
|
203
|
+
type ProviderEndpointAuthErrorCode = 'fetch-auth-unsupported' | 'fetch-auth-missing' | 'fetch-auth-resolution-failed';
|
|
204
|
+
/** Typed, credential-free failure for authenticated direct provider fetches. */
|
|
205
|
+
declare class ProviderEndpointAuthError extends Error {
|
|
206
|
+
readonly code: ProviderEndpointAuthErrorCode;
|
|
207
|
+
/**
|
|
208
|
+
* Create an authenticated endpoint-resolution failure.
|
|
209
|
+
* @param code - Stable failure category
|
|
210
|
+
*/
|
|
211
|
+
constructor(code: ProviderEndpointAuthErrorCode);
|
|
212
|
+
}
|
|
196
213
|
/**
|
|
197
214
|
* Resolved HTTP endpoint credentials for a provider.
|
|
198
215
|
* Returned by {@link resolveProviderEndpoint} for use by infrastructure-layer
|
|
@@ -208,6 +225,13 @@ interface ProviderEndpoint {
|
|
|
208
225
|
*/
|
|
209
226
|
apiKey: string;
|
|
210
227
|
}
|
|
228
|
+
/** Explicit credential-field requirement for the API-key endpoint consumer. */
|
|
229
|
+
interface ProviderEndpointAuthRequirement {
|
|
230
|
+
/** This endpoint helper currently supports API-key authorization only. */
|
|
231
|
+
readonly kind: 'api-key';
|
|
232
|
+
/** Selected auth-method field whose value the HTTP client accepts as its API key. */
|
|
233
|
+
readonly credentialFieldId: string;
|
|
234
|
+
}
|
|
211
235
|
/**
|
|
212
236
|
* Resolve `{ baseUrl, apiKey }` for a given provider config and wire protocol
|
|
213
237
|
* without requiring an agent context.
|
|
@@ -216,69 +240,66 @@ interface ProviderEndpoint {
|
|
|
216
240
|
* STT/TTS providers) that need to make HTTP calls to cloud providers but are not
|
|
217
241
|
* part of an agent turn.
|
|
218
242
|
*
|
|
219
|
-
* Delegates the
|
|
220
|
-
*
|
|
221
|
-
*
|
|
243
|
+
* Delegates the atomic config/definition/auth read to
|
|
244
|
+
* {@link resolveProviderResolution}, then resolves only the explicitly selected
|
|
245
|
+
* `apiKey` ref through the trusted local credential channel. Inferred and
|
|
246
|
+
* unauthenticated selections remain valid for refs-only endpoint resolution,
|
|
247
|
+
* but cannot authorize this API-key-specific fetch seam.
|
|
222
248
|
*
|
|
223
249
|
* Resolution order for the endpoint URL:
|
|
224
250
|
* 1. `ProviderConfig.endpointOverrides[protocol]` (user-customised URL)
|
|
225
251
|
* 2. `ProviderDefinition.endpoints[protocol]` (default from provider package)
|
|
226
252
|
*
|
|
227
|
-
* Credentials are resolved from the
|
|
253
|
+
* Credentials are resolved from the normalized explicit auth selection. No
|
|
254
|
+
* environment or SDK ambient fallback is consulted.
|
|
228
255
|
* @param bus - Makaio bus instance used to query storage and resolve credential refs
|
|
229
256
|
* @param providerConfigId - UUID of the ProviderConfig entity to resolve
|
|
230
257
|
* @param protocol - Wire protocol to select the correct endpoint URL
|
|
258
|
+
* @param authRequirement - Explicit API-key field required by the direct HTTP consumer
|
|
231
259
|
* @returns Resolved `{ baseUrl, apiKey }` for the provider
|
|
232
260
|
* @throws Error when the ProviderConfig or its ProviderDefinition is not found, or
|
|
233
261
|
* when `baseUrl` or `apiKey` cannot be resolved from any source
|
|
234
262
|
*/
|
|
235
|
-
declare function resolveProviderEndpoint(bus: IMakaioBus, providerConfigId: string, protocol: ProtocolId): Promise<ProviderEndpoint>;
|
|
263
|
+
declare function resolveProviderEndpoint(bus: IMakaioBus, providerConfigId: string, protocol: ProtocolId, authRequirement: ProviderEndpointAuthRequirement): Promise<ProviderEndpoint>;
|
|
236
264
|
//#endregion
|
|
237
265
|
//#region adapters/core/src/config/resolve-provider-resolution.d.ts
|
|
266
|
+
/** Stable provider-resolution failure categories. */
|
|
267
|
+
type ProviderResolutionErrorCode = 'provider-config-not-found';
|
|
268
|
+
/** Typed refs-only provider-resolution failure. */
|
|
269
|
+
declare class ProviderResolutionError extends Error {
|
|
270
|
+
readonly code: ProviderResolutionErrorCode;
|
|
271
|
+
/**
|
|
272
|
+
* Create a provider-resolution failure.
|
|
273
|
+
* @param code - Stable failure category.
|
|
274
|
+
* @param message - Credential-free diagnostic.
|
|
275
|
+
*/
|
|
276
|
+
constructor(code: ProviderResolutionErrorCode, message: string);
|
|
277
|
+
}
|
|
238
278
|
/**
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
* HTTP endpoint) without duplicating the lookup chain.
|
|
279
|
+
* Definition-backed provider data plus the selected normalized auth snapshot.
|
|
280
|
+
* Credential values remain refs and are resolved only by a trusted auth
|
|
281
|
+
* consumer after adapter delivery has been selected.
|
|
243
282
|
*/
|
|
244
283
|
interface ProviderResolution {
|
|
245
|
-
/** Bus-safe provider config read model
|
|
246
|
-
config: ProviderConfigFileRecord;
|
|
247
|
-
/**
|
|
248
|
-
definition: ProviderRecord;
|
|
249
|
-
/**
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
*/
|
|
254
|
-
baseUrl: string | null;
|
|
255
|
-
/**
|
|
256
|
-
* Plaintext credentials resolved from the config's credential refs.
|
|
257
|
-
* Empty object when no credentials are configured or none resolve.
|
|
258
|
-
*/
|
|
259
|
-
credentials: Record<string, string>;
|
|
284
|
+
/** Bus-safe provider config read model. */
|
|
285
|
+
readonly config: ProviderConfigFileRecord;
|
|
286
|
+
/** Provider definition referenced by the config. */
|
|
287
|
+
readonly definition: ProviderRecord;
|
|
288
|
+
/** Effective endpoint for the requested protocol, or null when undeclared. */
|
|
289
|
+
readonly baseUrl: string | null;
|
|
290
|
+
/** Validated normalized auth selection with credential refs, never plaintext. */
|
|
291
|
+
readonly auth: ResolvedProviderAuth;
|
|
260
292
|
}
|
|
261
293
|
/**
|
|
262
|
-
* Resolve
|
|
263
|
-
* definition record, endpoint URL, and plaintext credentials.
|
|
264
|
-
*
|
|
265
|
-
* Encapsulates the common lookup chain shared by the adapter config factory
|
|
266
|
-
* and the provider endpoint resolver:
|
|
267
|
-
* 1. `AdapterSubsystemSubjects.getProviderConfig` for the canonical read model
|
|
268
|
-
* 2. `AdapterSubsystemSubjects.buildProviderContext` for runtime credential refs and endpoint overrides
|
|
269
|
-
* 3. `ProviderStorageSubjects.get` for provider-definition metadata
|
|
270
|
-
* 4. `context.endpointOverrides?.[protocol] ?? definition.endpoints?.[protocol]`
|
|
271
|
-
* 5. Opens a DirectChannel via `CredentialSubjects.getChannelToken` and
|
|
272
|
-
* resolves each credential ref; the channel is closed after use.
|
|
294
|
+
* Resolve one provider config to definition metadata, endpoint, and refs-only auth.
|
|
273
295
|
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
* @param bus - Bus instance for
|
|
278
|
-
* @param providerConfigId -
|
|
279
|
-
* @param protocol - Wire protocol used to select the
|
|
280
|
-
* @returns
|
|
281
|
-
* @throws Error when the ProviderConfig or its ProviderDefinition is not found
|
|
296
|
+
* The adapter subsystem is the sole owner of auth-method validation and returns
|
|
297
|
+
* the safe config, refs-only context, and provider definition from one captured
|
|
298
|
+
* snapshot. This helper never opens the credential DirectChannel.
|
|
299
|
+
* @param bus - Bus instance for the atomic adapter-subsystem snapshot request.
|
|
300
|
+
* @param providerConfigId - Explicit provider config ID.
|
|
301
|
+
* @param protocol - Wire protocol used to select the endpoint URL.
|
|
302
|
+
* @returns Definition-backed provider resolution without plaintext credentials.
|
|
282
303
|
*/
|
|
283
304
|
declare function resolveProviderResolution(bus: IMakaioBus, providerConfigId: string, protocol: ProtocolId): Promise<ProviderResolution>;
|
|
284
305
|
//#endregion
|
|
@@ -287,6 +308,24 @@ declare function resolveProviderResolution(bus: IMakaioBus, providerConfigId: st
|
|
|
287
308
|
interface CredentialBusContextProvider {
|
|
288
309
|
getContext(): MakaioBusContext;
|
|
289
310
|
}
|
|
311
|
+
/** Stable credential-resolution failure categories. */
|
|
312
|
+
type ConnectorCredentialResolutionErrorCode = 'credential-unavailable' | 'credential-request-failed';
|
|
313
|
+
/** Trusted resolution policy for refs selected by a normalized auth method. */
|
|
314
|
+
interface ConnectorCredentialResolutionOptions {
|
|
315
|
+
/** Selected field names whose unavailable refs are intentionally omitted. */
|
|
316
|
+
readonly optionalFields?: readonly string[];
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Typed credential-resolution failure that never retains a ref, secret, or provider error.
|
|
320
|
+
*/
|
|
321
|
+
declare class ConnectorCredentialResolutionError extends Error {
|
|
322
|
+
readonly code: ConnectorCredentialResolutionErrorCode;
|
|
323
|
+
/**
|
|
324
|
+
* Create a sanitized connector credential failure.
|
|
325
|
+
* @param code - Stable failure category
|
|
326
|
+
*/
|
|
327
|
+
constructor(code: ConnectorCredentialResolutionErrorCode);
|
|
328
|
+
}
|
|
290
329
|
/**
|
|
291
330
|
* Resolve credential references to plaintext values at the connector layer.
|
|
292
331
|
*
|
|
@@ -295,135 +334,119 @@ interface CredentialBusContextProvider {
|
|
|
295
334
|
* or credential rotation — plaintext never leaves the connector.
|
|
296
335
|
*
|
|
297
336
|
* Returns an empty object immediately when `credentialRefs` is empty,
|
|
298
|
-
* avoiding an unnecessary channel round-trip.
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
337
|
+
* avoiding an unnecessary channel round-trip. Resolution is atomic for
|
|
338
|
+
* required refs: every required ref must produce a value or the whole
|
|
339
|
+
* operation fails with a sanitized typed error. Trusted normalized-auth
|
|
340
|
+
* callers may declare optional selected fields; unavailable optional refs are
|
|
341
|
+
* omitted rather than turning an explicit selection into an ambient fallback.
|
|
302
342
|
* @param bus - Bus instance with context access for channel token retrieval
|
|
303
343
|
* @param credentialRefs - Credential refs keyed by field name
|
|
344
|
+
* @param options - Trusted required/optional policy for selected fields
|
|
304
345
|
* @returns Plaintext credential values keyed by field name
|
|
305
346
|
*/
|
|
306
|
-
declare function resolveConnectorCredentials(bus: CredentialBusContextProvider, credentialRefs: Record<string, CredentialRef
|
|
307
|
-
//#endregion
|
|
308
|
-
//#region adapters/core/src/config/build-credential-env.d.ts
|
|
309
|
-
/**
|
|
310
|
-
* Build environment variables from resolved credentials.
|
|
311
|
-
*
|
|
312
|
-
* Maps plaintext credential values to their environment variable names
|
|
313
|
-
* using the provider definition's `credentialEnvVars` mapping. Subprocess
|
|
314
|
-
* adapters use this to set the correct env vars before spawning.
|
|
315
|
-
* @example
|
|
316
|
-
* ```typescript
|
|
317
|
-
* // { apiKey: 'sk-...' } + { apiKey: 'ANTHROPIC_API_KEY' }
|
|
318
|
-
* // → { ANTHROPIC_API_KEY: 'sk-...' }
|
|
319
|
-
* ```
|
|
320
|
-
* @param credentials - Resolved plaintext credentials keyed by field name
|
|
321
|
-
* @param credentialEnvVars - Mapping from credential field names to env var names
|
|
322
|
-
* @returns Environment variables ready for process.env / subprocess spawn
|
|
323
|
-
*/
|
|
324
|
-
declare function buildCredentialEnv(credentials: Record<string, string>, credentialEnvVars: Record<string, string> | undefined): Record<string, string>;
|
|
347
|
+
declare function resolveConnectorCredentials(bus: CredentialBusContextProvider, credentialRefs: Record<string, CredentialRef>, options?: ConnectorCredentialResolutionOptions): Promise<Record<string, string>>;
|
|
325
348
|
//#endregion
|
|
326
349
|
//#region adapters/core/src/config/resolve-session-environment.d.ts
|
|
327
|
-
/** Minimal bus surface needed for session environment resolution. */
|
|
328
|
-
interface SessionEnvironmentBus {
|
|
329
|
-
getContext(): MakaioBusContext;
|
|
330
|
-
}
|
|
331
|
-
/**
|
|
332
|
-
* Unresolved provider context fields needed for session environment resolution.
|
|
333
|
-
*
|
|
334
|
-
* Mirrors the relevant subset of {@link ProviderContext} from `@makaio/contracts`
|
|
335
|
-
* so callers can pass the full provider context object without importing it here.
|
|
336
|
-
*/
|
|
337
|
-
interface ProviderContextShape {
|
|
338
|
-
/** Provider config UUID carried by full provider contexts. */
|
|
339
|
-
providerConfigId?: string;
|
|
340
|
-
/** Provider definition ID carried by full provider contexts. */
|
|
341
|
-
definitionId?: string;
|
|
342
|
-
/** Credential references keyed by field name. */
|
|
343
|
-
credentialRefs: Record<string, CredentialRef>;
|
|
344
|
-
/** Maps credential field names to env var names for subprocess adapters. */
|
|
345
|
-
credentialEnvVars?: Record<string, string>;
|
|
346
|
-
/** Ambient provider credential env vars to strip before explicit credential injection. */
|
|
347
|
-
ambientCredentialEnvVars?: readonly string[];
|
|
348
|
-
}
|
|
349
350
|
/**
|
|
350
351
|
* Input options for {@link resolveSessionEnvironment}.
|
|
351
352
|
*/
|
|
352
353
|
interface SessionEnvironmentOptions {
|
|
353
|
-
/**
|
|
354
|
-
|
|
355
|
-
/**
|
|
356
|
-
* Unresolved provider context carrying credential refs and env-var mapping.
|
|
357
|
-
* When `undefined`, the credential steps are skipped and `credentials` / `credEnv`
|
|
358
|
-
* are returned as empty objects.
|
|
359
|
-
*/
|
|
360
|
-
providerContext: ProviderContextShape | undefined;
|
|
354
|
+
/** Runtime bus that owns client binary resolution. */
|
|
355
|
+
globalBus?: IMakaioBus;
|
|
361
356
|
/**
|
|
362
357
|
* Stable client identifier passed to `resolveClientBinary`
|
|
363
|
-
* (e.g. `'claude-code'`, `'qwen'`, `'github-copilot'`).
|
|
358
|
+
* (e.g. `'claude-code'`, `'qwen'`, `'github-copilot'`). Omit for
|
|
359
|
+
* connector-only SDK adapters with no managed binary.
|
|
364
360
|
*/
|
|
365
|
-
clientId
|
|
361
|
+
clientId?: string;
|
|
366
362
|
/**
|
|
367
|
-
* Base environment variables
|
|
368
|
-
*
|
|
363
|
+
* Base environment variables explicitly supplied by the host. This function
|
|
364
|
+
* never falls back to ambient `process.env`.
|
|
369
365
|
*/
|
|
370
366
|
baseEnv?: Record<string, string>;
|
|
367
|
+
/** Non-auth session environment composed over the base environment. */
|
|
368
|
+
sessionEnv?: Readonly<Record<string, string>>;
|
|
369
|
+
/** Pre-resolved non-auth binary environment supplied by an external host. */
|
|
370
|
+
binaryEnv?: Readonly<Record<string, string>>;
|
|
371
|
+
/** Complete normalized auth source/sink set removed before selected delivery. */
|
|
372
|
+
scrubEnvVars?: readonly string[];
|
|
373
|
+
/** Environment returned by the connector-owned client config lease. */
|
|
374
|
+
leaseEnv?: Readonly<Record<string, string>>;
|
|
375
|
+
/** Selected normalized process-environment delivery, applied last. */
|
|
376
|
+
selectedAuthEnv?: Readonly<Record<string, string>>;
|
|
371
377
|
}
|
|
372
378
|
/**
|
|
373
379
|
* Fully resolved session environment returned by {@link resolveSessionEnvironment}.
|
|
374
380
|
*
|
|
375
|
-
*
|
|
376
|
-
*
|
|
377
|
-
* repeating the resolution calls.
|
|
381
|
+
* Binary resolution is returned alongside process-private and shared-context
|
|
382
|
+
* environment views derived from one authoritative merge.
|
|
378
383
|
*/
|
|
379
384
|
interface SessionEnvironmentResult {
|
|
380
|
-
/**
|
|
381
|
-
* Plaintext credentials keyed by field name.
|
|
382
|
-
* Empty when `providerContext` is `undefined` or carries no credential refs.
|
|
383
|
-
*/
|
|
384
|
-
credentials: Record<string, string>;
|
|
385
|
-
/**
|
|
386
|
-
* Environment variables derived from `credentials` via the provider's
|
|
387
|
-
* `credentialEnvVars` mapping.
|
|
388
|
-
* Empty when `providerContext` is `undefined` or carries no `credentialEnvVars`.
|
|
389
|
-
*/
|
|
390
|
-
credEnv: Record<string, string>;
|
|
391
385
|
/**
|
|
392
386
|
* Execution context for the resolved client binary, or `undefined` when
|
|
393
387
|
* no `client.resolveBinary` handler is registered (framework-only boot).
|
|
394
388
|
*/
|
|
395
389
|
resolvedBinary: ClientExecutionContext | undefined;
|
|
396
390
|
/**
|
|
397
|
-
*
|
|
398
|
-
* `{ ...
|
|
391
|
+
* Process-private connector environment:
|
|
392
|
+
* `{ ...scrub({ ...baseEnv, ...sessionEnv, ...resolvedBinaryEnv, ...binaryEnv, ...leaseEnv }), ...selectedAuthEnv }`.
|
|
393
|
+
*
|
|
394
|
+
* This view may contain the selected plaintext process delivery and must not
|
|
395
|
+
* be copied into bus payloads, logs, or other shared execution contexts.
|
|
396
|
+
*/
|
|
397
|
+
connectorEnv: Record<string, string>;
|
|
398
|
+
/**
|
|
399
|
+
* Shared execution-context environment produced from host/session/binary
|
|
400
|
+
* inputs after the full auth scrub. Connector-private lease variables are
|
|
401
|
+
* excluded even when another source supplied the same variable name.
|
|
399
402
|
*
|
|
400
|
-
*
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
* isolation.
|
|
403
|
+
* Connector-owned bus and tool payloads use this view so explicitly shareable
|
|
404
|
+
* variables remain available without exporting process authentication or
|
|
405
|
+
* config-directory capabilities.
|
|
404
406
|
*/
|
|
405
|
-
|
|
407
|
+
contextEnv: Readonly<Record<string, string>>;
|
|
406
408
|
}
|
|
407
409
|
/**
|
|
408
|
-
* Resolve
|
|
409
|
-
* client binary — the three-step pattern shared by subprocess connectors.
|
|
410
|
+
* Resolve the selected client binary and compose the two environment views.
|
|
410
411
|
*
|
|
411
|
-
*
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
-
*
|
|
415
|
-
*
|
|
416
|
-
* 3. `resolveClientBinary(clientId)` — dispatches `client.resolveBinary` on the
|
|
417
|
-
* static bus; returns `undefined` in framework-only boot.
|
|
418
|
-
*
|
|
419
|
-
* The returned {@link SessionEnvironmentResult} includes every intermediate
|
|
420
|
-
* value so callers with non-standard composition strategies (e.g. connectors
|
|
421
|
-
* that treat binary env as optional or pass credentials through a different
|
|
422
|
-
* channel) can compose the final env themselves.
|
|
412
|
+
* Credential refs are deliberately absent from this contract. The normalized
|
|
413
|
+
* adapter-auth runtime resolves them once and passes only the selected process
|
|
414
|
+
* delivery. Lease keys are connector-private capabilities: the same names are
|
|
415
|
+
* removed from the shared view regardless of which environment source supplied
|
|
416
|
+
* them, while the connector view still receives the scrubbed lease values.
|
|
423
417
|
* @param options - Session environment resolution options
|
|
424
|
-
* @returns
|
|
425
|
-
* merged spawn environment
|
|
418
|
+
* @returns Binary execution context and merged connector/context environments
|
|
426
419
|
*/
|
|
427
420
|
declare function resolveSessionEnvironment(options: SessionEnvironmentOptions): Promise<SessionEnvironmentResult>;
|
|
428
421
|
//#endregion
|
|
429
|
-
|
|
422
|
+
//#region adapters/core/src/config/resolve-adapter-runtime-snapshot.d.ts
|
|
423
|
+
/** Atomic adapter runtime snapshot with its exact refs-only auth binding. */
|
|
424
|
+
interface BoundAdapterRuntimeSnapshot extends AdapterRuntimeSnapshot {
|
|
425
|
+
/** Exact selected adapter delivery compiled without resolving plaintext. */
|
|
426
|
+
readonly boundProviderAuth: BoundProviderAuthContext;
|
|
427
|
+
}
|
|
428
|
+
/** Typed credential-free atomic adapter runtime resolution failure. */
|
|
429
|
+
declare class AdapterRuntimeSnapshotError extends Error {
|
|
430
|
+
readonly code: AdapterRuntimeSnapshotErrorCode$1;
|
|
431
|
+
/**
|
|
432
|
+
* Create an atomic runtime resolution failure.
|
|
433
|
+
* @param code - Stable failure category returned by the subsystem
|
|
434
|
+
*/
|
|
435
|
+
constructor(code: AdapterRuntimeSnapshotErrorCode$1);
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Resolve and bind one adapter/provider runtime snapshot in a single subsystem read.
|
|
439
|
+
*
|
|
440
|
+
* The response carries refs and runtime-only delivery declarations but never
|
|
441
|
+
* plaintext. Binding remains in Adapter Core so the lower subsystem does not
|
|
442
|
+
* depend on this host-layer package.
|
|
443
|
+
* @param bus - Runtime bus serving the adapter subsystem
|
|
444
|
+
* @param input - Exact adapter name and provider config selection
|
|
445
|
+
* @returns Atomic runtime metadata plus immutable refs-only auth binding
|
|
446
|
+
*/
|
|
447
|
+
declare function resolveAdapterRuntimeSnapshot(bus: IMakaioBus, input: {
|
|
448
|
+
readonly adapterName: string;
|
|
449
|
+
readonly providerConfigId: string;
|
|
450
|
+
}): Promise<BoundAdapterRuntimeSnapshot>;
|
|
451
|
+
//#endregion
|
|
452
|
+
export { type AIModel, AIModelSchema, AdapterAuthError, type AdapterAuthErrorReason, type AdapterAuthLeaseHandle, type AdapterAuthRuntimePreparer, type AdapterConfigFactoryInput, type AdapterDefaults, AdapterRuntimeSnapshotError, type AdapterRuntimeSnapshotErrorCode, type BaseAdapterConfig, BaseAdapterConfigSchema, type BaseProviderConfig, BaseProviderConfigSchema, type BindProviderAuthOptions, type BoundAdapterRuntimeConfig, type BoundAdapterRuntimeSnapshot, type BoundProviderAuthContext, type ConfigFactoryResult, ConnectorCredentialResolutionError, type ConnectorCredentialResolutionErrorCode, type CreateAdapterConfigFactoryOptions, type FactoryGuaranteedFields, type PreparedAdapterAuthRuntime, type ProviderConfig, ProviderConfigSchema, type ProviderDefaults, ProviderDefaultsSchema, type ProviderEndpoint, ProviderEndpointAuthError, type ProviderEndpointAuthErrorCode, type ProviderEndpointAuthRequirement, type ProviderResolution, ProviderResolutionError, type ProviderResolutionErrorCode, type ResolveAuthCredentialRefs, type ResolveCredentialRefDeps, type ResolvedAdapterAuth, type ResolvedAdapterRuntimeConfig, type ResolvedAuthCredentialValues, type ResolvedConnectorAuthDelivery, type SessionEnvironmentOptions, type SessionEnvironmentResult, type SuppliedAdapterAuthRuntime, applySuppliedAdapterAuthRuntime, bindProviderAuth, createAdapterConfigFactory, getDefinitionOrThrow, getOptionalAuthCredentialFields, prepareAdapterAuthRuntime, resolveAdapterRuntimeSnapshot, resolveBoundProviderAuth, resolveConnectorCredentials, resolveCredentialRef, resolveProviderEndpoint, resolveProviderResolution, resolveSessionEnvironment };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as
|
|
1
|
+
import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"../../adapter-auth-runtime-a4O7cSNP.mjs";import{z as l}from"zod";import u from"node:fs/promises";import{AIModelSchema as d,AuthFieldIdSchema as f}from"@makaio/framework/contracts";import{BaseAdapterConfigSchema as p,ProviderConfigSchema as m,ProviderDefaultsSchema as h}from"@makaio/framework/contracts/config";import{resolveTimeouts as g}from"@makaio/framework/utils";import{AdapterSubsystemSubjects as _}from"@makaio/framework/services/adapter-subsystem";async function v(e,t={}){if(e.startsWith(`env:`)){let n=e.slice(4);if(!n)throw Error(`Credential reference is missing environment variable name`);return(t.readEnv??(e=>process.env[e]))(n)||null}if(e.startsWith(`file:`)){let n=e.slice(5);if(!n)throw Error(`Credential reference is missing file path`);return(await(t.readFile??(async e=>await u.readFile(e,`utf-8`)))(n)).trim()||null}if(e.startsWith(`keychain:`)){let[n,...r]=e.slice(9).split(`:`);if(!n||r.length===0)throw Error(`Credential reference is missing keychain service or account`);if(!t.resolveKeychain)throw Error(`Keychain credential resolution is not configured`);return t.resolveKeychain(n,r.join(`:`))}return e||null}function y(e,t){let n=e.find(e=>e.id===t);if(!n)throw Error(`Provider definition not found: '${t}'`);if(!b(n))throw Error(`Provider definition '${t}' is missing a defaultModel`);return n}function b(e){return typeof e.defaultModel==`string`&&e.defaultModel.length>0}const x=l.record(l.string(),l.unknown());function S(e){return{getDefaults:()=>e().adapterDefaults,getConfig:t=>C(e,t)}}async function C(e,t){let{adapterName:n,adapterDefaults:r,adapterDefinition:i}=e(),a=T(t),o=t.providerContext.state===`resolved`&&t.providerProtocol!==void 0?t.providerContext.endpointOverrides?.[t.providerProtocol]??null:null,s=g([{layer:`adapter`,source:n,config:i.defaultTimeouts},{layer:`runtime`,source:`config.ts`,config:t.runtimeTimeouts}]),c={...r.providerConfig,...t.providerConfig,baseUrl:o??t.providerConfig?.baseUrl??r.providerConfig?.baseUrl},l=w(t.model??r.model,n,t.agentId),{providerConfig:u,adapterProviderAuth:d,compatibleProviderAuths:f,providerContextRequired:p,...m}=t;return{...r,...m,adapterName:t.adapterName,model:l,cwd:t.cwd??r.cwd??process.cwd(),timeouts:s,providerConfig:c,...a!==void 0&&{boundProviderAuth:a}}}function w(e,t,n){if(e!==void 0&&e.length>0)return e;throw Error(`No model resolved for adapter "${t}" (agentId: ${n}). Provide a model explicitly or configure adapterDefaults.model.`)}function T(e){if(e.providerContext.state===`unresolved`){if(e.providerContextRequired===!0)throw new a(`provider-context-unresolved`,`This adapter requires a resolved provider authentication context.`);return}if(e.adapterProviderAuth===void 0)throw new a(`binding-missing`,`The selected provider has no adapter authentication declaration.`);let t=s({auth:e.providerContext.auth,adapterProviderAuth:e.adapterProviderAuth,compatibleProviderAuths:e.compatibleProviderAuths});if(t.auth.method.owner===`client`&&t.auth.method.clientId!==e.clientId)throw new a(`client-mismatch`,`Selected authentication client does not match the adapter runtime client.`);return t}var E=class extends Error{code;constructor(e,t){super(t),this.code=e,this.name=`ProviderResolutionError`}};async function D(e,t,n){let{snapshot:r}=await e.request(_.resolveProviderRuntimeSnapshot,{providerConfigId:t});if(!r)throw new E(`provider-config-not-found`,`ProviderConfig '${t}' not found`);let i=r.context.endpointOverrides?.[n]??r.definition.endpoints?.[n]??null;return{config:r.config,definition:r.definition,baseUrl:i,auth:r.context.auth}}var O=class extends Error{code;constructor(e){super(`Authenticated provider endpoint resolution failed (${e}).`),this.code=e,this.name=`ProviderEndpointAuthError`}};async function k(t,r,i,a){let{baseUrl:o,auth:s}=await D(t,r,i);if(!o)throw Error(`Could not resolve baseUrl for ProviderConfig '${r}' with protocol '${i}'. Ensure the provider definition or config override declares an endpoint for this protocol.`);if(s.mode!==`explicit`)throw new O(`fetch-auth-unsupported`);let c=f.safeParse(a.credentialFieldId);if(a.kind!==`api-key`||!c.success)throw new O(`fetch-auth-unsupported`);let l=s.definition.fields.find(({id:e})=>e===c.data);if(l===void 0)throw new O(`fetch-auth-unsupported`);let u=s.credentialRefs[l.id];if(u===void 0)throw new O(`fetch-auth-missing`);let d;try{d=(await e(t,{apiKey:u})).apiKey}catch(e){throw e instanceof n&&e.code===`credential-unavailable`?new O(`fetch-auth-missing`):new O(`fetch-auth-resolution-failed`)}if(d===void 0||d.trim()===``)throw new O(`fetch-auth-missing`);return{baseUrl:o,apiKey:d}}var A=class extends Error{code;constructor(e){super(`Adapter runtime snapshot resolution failed (${e}).`),this.code=e,this.name=`AdapterRuntimeSnapshotError`}};async function j(e,t){let n=await e.request(_.resolveAdapterRuntimeSnapshot,t);if(n.status===`error`)throw new A(n.code);let r=n.runtime;if(r.adapterName!==t.adapterName||r.snapshot.context.providerConfigId!==t.providerConfigId)throw new A(`snapshot-identity-mismatch`);let i=s({auth:r.snapshot.context.auth,adapterProviderAuth:r.adapterProviderAuth,compatibleProviderAuths:r.compatibleProviderAuths});if(i.auth.method.owner===`client`&&i.auth.method.clientId!==r.adapterClientId)throw new A(`client-incompatible`);return{...r,boundProviderAuth:i}}export{d as AIModelSchema,a as AdapterAuthError,A as AdapterRuntimeSnapshotError,p as BaseAdapterConfigSchema,x as BaseProviderConfigSchema,n as ConnectorCredentialResolutionError,m as ProviderConfigSchema,h as ProviderDefaultsSchema,O as ProviderEndpointAuthError,E as ProviderResolutionError,c as applySuppliedAdapterAuthRuntime,s as bindProviderAuth,S as createAdapterConfigFactory,y as getDefinitionOrThrow,t as getOptionalAuthCredentialFields,i as prepareAdapterAuthRuntime,j as resolveAdapterRuntimeSnapshot,r as resolveBoundProviderAuth,e as resolveConnectorCredentials,v as resolveCredentialRef,k as resolveProviderEndpoint,D as resolveProviderResolution,o as resolveSessionEnvironment};
|