@makaio/framework 1.0.0-dev-1781023871421 → 1.0.0-dev-1781081952714
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-DT5NOtFi.mjs → account-identity-CgzOqnVm.mjs} +1 -1
- package/dist/{adapter-C1eI-fGV.mjs → adapter-Dt2FDMs4.mjs} +1 -1
- package/dist/adapters/acp-client/index.d.mts +4 -4
- package/dist/adapters/config/index.d.mts +1 -1
- package/dist/adapters/config/index.mjs +1 -1
- package/dist/adapters/index.d.mts +24 -23
- package/dist/adapters/index.mjs +6 -13
- package/dist/adapters/node.d.mts +1 -1
- package/dist/adapters/node.mjs +1 -1
- package/dist/ajv-BJsabpMb.mjs +8 -0
- package/dist/await-trigger-DREnXCEJ.mjs +1 -0
- package/dist/bus/index.d.mts +19 -19
- package/dist/{client-bx74gm4R.mjs → client-BBJf1mVA.mjs} +1 -1
- package/dist/contracts/adapter/index.d.mts +2 -2
- 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/client/index.d.mts +2 -2
- package/dist/contracts/client/index.mjs +1 -1
- package/dist/contracts/common/index.d.mts +1 -1
- package/dist/contracts/config/index.d.mts +1 -1
- 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 +425 -425
- 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/session/index.d.mts +2 -2
- package/dist/contracts/session/index.mjs +1 -1
- package/dist/contracts/shared/index.d.mts +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/toast/index.mjs +1 -1
- package/dist/contracts/variant/index.d.mts +1 -1
- package/dist/contracts/variant/index.mjs +1 -1
- package/dist/create-static-mount-CFGo91CI.mjs +1 -0
- package/dist/cross-spawn-BL6EvJBv.mjs +1 -0
- package/dist/{cursor-storage-CtVJ3JzB.mjs → cursor-storage-C_WTAESV.mjs} +1 -1
- package/dist/{definition-CrgHIpTK.d.mts → definition-DqJOg6Lv.d.mts} +1 -1
- package/dist/descriptor-to-package-CY8oc2gl.mjs +1 -0
- package/dist/detached-extension-handle-CxEBQnSa.mjs +1 -0
- package/dist/drizzle/0000_charming_prowler.sql +443 -0
- package/dist/drizzle/0001_known_stephen_strange.sql +25 -0
- package/dist/drizzle/0002_woozy_gladiator.sql +1 -0
- package/dist/drizzle/0003_overjoyed_adam_destine.sql +1 -0
- package/dist/drizzle/0004_solid_goliath.sql +1 -0
- package/dist/drizzle/0005_round_calypso.sql +51 -0
- package/dist/drizzle/0006_free_tiger_shark.sql +4 -0
- package/dist/drizzle/0007_sparkling_terror.sql +2 -0
- package/dist/drizzle/0008_petite_deathstrike.sql +1 -0
- package/dist/drizzle/0009_lethal_malcolm_colcord.sql +6 -0
- package/dist/drizzle/0010_grey_chronomancer.sql +1 -0
- package/dist/drizzle/0011_solid_nomad.sql +1 -0
- package/dist/drizzle/meta/0000_snapshot.json +2813 -0
- package/dist/drizzle/meta/0001_snapshot.json +2820 -0
- package/dist/drizzle/meta/0002_snapshot.json +2827 -0
- package/dist/drizzle/meta/0003_snapshot.json +2834 -0
- package/dist/drizzle/meta/0004_snapshot.json +2842 -0
- package/dist/drizzle/meta/0005_snapshot.json +2849 -0
- package/dist/drizzle/meta/0006_snapshot.json +2865 -0
- package/dist/drizzle/meta/0007_snapshot.json +2879 -0
- package/dist/drizzle/meta/0008_snapshot.json +2886 -0
- package/dist/drizzle/meta/0009_snapshot.json +2901 -0
- package/dist/drizzle/meta/0010_snapshot.json +2908 -0
- package/dist/drizzle/meta/0011_snapshot.json +2915 -0
- package/dist/drizzle/meta/_journal.json +90 -0
- package/dist/esm-BdLRFEUy.mjs +3 -0
- package/dist/expression/index.d.mts +120 -0
- package/dist/expression/index.mjs +1431 -0
- package/dist/extension--5Q190u_.mjs +1 -0
- package/dist/{extension-CpIUgBKI.mjs → extension-DFIZ3FCJ.mjs} +1 -1
- package/dist/extension-discovery-CkV_VRdJ.d.mts +163 -0
- package/dist/fast-uri-BF2Xuiop.mjs +1 -0
- package/dist/{filesystem-service-B8rhBRgB.mjs → filesystem-service-DH9zlxyd.mjs} +1 -1
- package/dist/git/index.mjs +17 -17
- package/dist/globby-4SrlyIlj.mjs +1 -0
- package/dist/{handlers-CkTsQLra.mjs → handlers-Bev7-xjL.mjs} +1 -1
- package/dist/{index-472sOmsW.d.mts → index-BAhJKQLX.d.mts} +7 -7
- package/dist/{index-D9MwJ2Q8.d.mts → index-BCKRUuI2.d.mts} +2 -2
- package/dist/{index-mNec7V-9.d.mts → index-BYkOUd0x.d.mts} +12 -12
- package/dist/{index-8SZkg7s6.d.mts → index-Bibt5jAX.d.mts} +8 -8
- package/dist/{index-DBw-89vC2.d.mts → index-BmV60tMf.d.mts} +18 -18
- package/dist/{index-B_zQC98V.d.mts → index-BpniJgxu.d.mts} +4 -4
- package/dist/{index-soFznFCy2.d.mts → index-Bw_zL7Rs.d.mts} +1 -1
- package/dist/{index-CelJCBjk.d.mts → index-C3zfJg6s.d.mts} +13 -13
- package/dist/{index-Caig6TeF.d.mts → index-CNOTkyGw.d.mts} +379 -303
- package/dist/{index-Bh_Ne7LF.d.mts → index-CwKzQuIX.d.mts} +28 -28
- package/dist/{index-B3PK4FIn.d.mts → index-D6bw4qJp.d.mts} +112 -112
- package/dist/{index-Cm0dUkWL.d.mts → index-DETxgKS2.d.mts} +24 -24
- package/dist/{index-D90OmGmV.d.mts → index-Db0uJ_Cg2.d.mts} +3 -3
- package/dist/{index-Bvb2mMH6.d.mts → index-IekAD8Gp.d.mts} +44 -44
- package/dist/index-YDfOv0GT.d.mts +1133 -0
- package/dist/{index-L4GjJDKb.d.mts → index-fVgKVvta.d.mts} +3 -3
- package/dist/{index-DUaw0Dw8.d.mts → index-jlQ4IhR5.d.mts} +497 -497
- package/dist/jsonl-transport-BxNXizIm.mjs +3 -0
- package/dist/kernel/cli/index.d.mts +2 -95
- package/dist/kernel/cli/index.mjs +1 -1
- package/dist/kernel/cli/register.d.mts +2 -0
- package/dist/kernel/cli/register.mjs +1 -0
- 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-B9kVK_1_.mjs +4 -0
- package/dist/lib-DPruLs5D.mjs +155 -0
- package/dist/lib-aRogYLqg.mjs +5 -0
- package/dist/load-extensions-C-TqCwzL.mjs +1 -0
- package/dist/load-extensions-D9nbDIiW.d.mts +117 -0
- package/dist/mcp-http-server/index.d.mts +561 -0
- package/dist/mcp-http-server/index.mjs +4 -0
- package/dist/{namespace-EQniz-Aw.d.mts → namespace-B60mn8J-2.d.mts} +4 -4
- package/dist/{namespace-CxhsoFUP.d.mts → namespace-BBVtD1gu.d.mts} +14 -14
- package/dist/namespace-BXqetkc3.mjs +1 -0
- package/dist/{namespace-Dr8K0MCp.d.mts → namespace-BlS_i9KT.d.mts} +17 -17
- package/dist/{namespace-5QQqbF-B.d.mts → namespace-ByyuIFpL.d.mts} +91 -91
- package/dist/{namespace-DLovh2Ws.d.mts → namespace-CHMszppN.d.mts} +6 -6
- package/dist/{namespace-BM7Djng9.d.mts → namespace-CqUGzG53.d.mts} +2 -2
- package/dist/{namespace-DD8Oiqo7.d.mts → namespace-D1Iw_d1P.d.mts} +20 -20
- package/dist/{namespace-DgqkaOVu.d.mts → namespace-DBKWNrk7.d.mts} +22 -22
- package/dist/{namespace-CaaNnKcR.d.mts → namespace-Ds6HkJEU.d.mts} +138 -138
- package/dist/namespace-DzVf1hVH.d.mts +96 -0
- package/dist/{namespace-TyiTsLFv.d.mts → namespace-aBIAWxY3.d.mts} +46 -46
- package/dist/{namespace-DuXK5AYN.mjs → namespace-h0HIuqx0.mjs} +1 -1
- package/dist/{native-session-supervisor-B1TnaPUF.mjs → native-session-supervisor-DeKpxhWO.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/{orchestrator-shared-CIDiFJMD.mjs → orchestrator-shared-FnWrPS09.mjs} +1 -1
- package/dist/out-CvZYgczi.mjs +41 -0
- package/dist/package-1DS4bXg5.mjs +1 -0
- package/dist/package-BSnp1zOR.d.mts +372 -0
- package/dist/package.json +5 -0
- package/dist/primitive-runtime-DcYYWy_6.mjs +8 -0
- package/dist/{profile-6ynCD5k3.mjs → profile-D39-Zy_W.mjs} +1 -1
- package/dist/{provider-context-CK6B4X_8.mjs → provider-context-lfG0BpqX.mjs} +1 -1
- package/dist/quick-lru-B9nWXbXI.mjs +1 -0
- package/dist/rules/index.d.mts +27 -0
- package/dist/rules/index.mjs +1 -0
- package/dist/rules/schemas.d.mts +2 -0
- package/dist/rules/schemas.mjs +1 -0
- package/dist/runtime-bun/index.d.mts +385 -0
- package/dist/runtime-bun/index.mjs +1 -0
- package/dist/runtime-node/bus/runtime/namespace.d.mts +61 -0
- package/dist/runtime-node/bus/runtime/namespace.mjs +1 -0
- package/dist/runtime-node/bus/runtime/schemas.d.mts +54 -0
- package/dist/runtime-node/bus/runtime/schemas.mjs +1 -0
- package/dist/runtime-node/extension-discovery.d.mts +2 -0
- package/dist/runtime-node/extension-discovery.mjs +1 -0
- package/dist/runtime-node/extension-validation.d.mts +2 -0
- package/dist/runtime-node/extension-validation.mjs +1 -0
- package/dist/runtime-node/index.d.mts +745 -0
- package/dist/runtime-node/index.mjs +148 -0
- package/dist/runtime-node/makaio-config.d.mts +153 -0
- package/dist/runtime-node/makaio-config.mjs +1 -0
- package/dist/runtime-node/workflow-worker/index.d.mts +2 -0
- package/dist/runtime-node/workflow-worker/index.mjs +1 -0
- package/dist/runtime-node/workflow-worker/worker-entry.d.mts +39 -0
- package/dist/runtime-node/workflow-worker/worker-entry.mjs +1 -0
- package/dist/{schema-M5YTvSAG.d.mts → schema-CDL_pyyM.d.mts} +4 -4
- package/dist/{schema-e0wU_lcV.mjs → schema-DCJyzRHe.mjs} +1 -1
- package/dist/schema-introspection-CuRZPYEc.mjs +1 -0
- package/dist/{schemas-C46QfKzv.d.mts → schemas-B5ToLwIs.d.mts} +14 -14
- package/dist/schemas-C792eVAZ.d.mts +171 -0
- package/dist/{schemas-CaLhkkLn.mjs → schemas-CSUwpaNm.mjs} +1 -1
- package/dist/{schemas-DVF1A4DF.d.mts → schemas-Chyj6HuZ.d.mts} +9 -9
- package/dist/{schemas-DATniTHb.d.mts → schemas-DZUaRcYl.d.mts} +14 -14
- package/dist/{schemas-DiYVzG6e.d.mts → schemas-Exixg77V2.d.mts} +16 -16
- package/dist/{schemas-ClOOT1W6.d.mts → schemas-lqvZ6UpK.d.mts} +3 -3
- package/dist/{schemas-j7ivZ2HI.d.mts → schemas-on3_N5HP.d.mts} +138 -138
- package/dist/{schemas-wg_6PAdV.d.mts → schemas-t1VR6_b_.d.mts} +4 -4
- package/dist/semver-DhHJv6Dt.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 +2 -2
- 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 +7 -7
- package/dist/services/context-rules/index.mjs +1 -1
- package/dist/services/execution-target/index.d.mts +3 -3
- package/dist/services/execution-target/index.mjs +1 -1
- package/dist/services/execution-target/namespace.d.mts +1 -1
- package/dist/services/execution-target/schemas.d.mts +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.d.mts +6 -6
- package/dist/services/git/namespace.mjs +1 -1
- package/dist/services/git/schemas.d.mts +6 -6
- package/dist/services/git/schemas.mjs +1 -1
- package/dist/services/harness/index.d.mts +12 -12
- package/dist/services/harness/index.mjs +1 -1
- package/dist/services/index.d.mts +159 -158
- 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 +3 -3
- 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.d.mts +6 -6
- package/dist/services/log-import/namespace.mjs +1 -1
- package/dist/services/log-import/schemas.d.mts +3 -3
- 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 +1 -1
- package/dist/services/provider-context/index.mjs +1 -1
- 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 +9 -9
- 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.mjs +1 -1
- 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 +10 -10
- 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/extension-configs/namespace.d.mts +3 -3
- 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 +1 -1
- 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/services/turn/schemas.d.mts +10 -10
- package/dist/{session-BoldSdNZ2.mjs → session-BnfsJoZi.mjs} +1 -1
- package/dist/{session-DuVOYctZ.mjs → session-C1Cami7U.mjs} +1 -1
- package/dist/{session-lineage-CRsc9g1x.d.mts → session-lineage-CKg6mErA.d.mts} +1 -1
- package/dist/{skill-CQO4mDqK.mjs → skill-BNQnWVIG.mjs} +1 -1
- package/dist/src-Dvp41Cg2.mjs +1 -0
- package/dist/src-Z3vAZJfw.mjs +21 -0
- package/dist/storage/drizzle/client.d.mts +1 -1
- package/dist/storage/drizzle/index.d.mts +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/storage-namespace-BXO3lDVy.mjs +1 -0
- package/dist/{storage-namespace-BXkoh5Sy.d.mts → storage-namespace-BXmMUd7a.d.mts} +20 -20
- package/dist/style.css +540 -540
- package/dist/supports-color-fVsgozsi.mjs +1 -0
- package/dist/tool-approval-service-BgNcJvKx.mjs +1 -0
- package/dist/tools-DC4KrqI1.mjs +1 -0
- package/dist/{types-CCdqjeuH.d.mts → types-B0BtvVAq.d.mts} +2 -81
- package/dist/{types-BCMUtBj1.d.mts → types-CmMesAgR.d.mts} +1 -1
- package/dist/{types-DZHvOc_Q.d.mts → types-D0fPFh-D.d.mts} +1 -1
- package/dist/{types-Dy3YTcTF.d.mts → types-DiGqpZOD.d.mts} +288 -288
- package/dist/ui-components/index.d.mts +1 -1
- package/dist/ui-components/index.mjs +2 -2
- package/dist/ui-hooks/index.d.mts +6 -6
- package/dist/ui-kernel/index.d.mts +7 -7
- package/dist/ui-kernel/pages/namespace.d.mts +8 -8
- package/dist/ui-kernel/pages/schemas.d.mts +1 -1
- package/dist/ui-views/index.mjs +2 -2
- package/dist/version-B4NO_fID.mjs +1 -0
- package/dist/workflow-engine/index.d.mts +6568 -0
- package/dist/workflow-engine/index.mjs +1 -0
- package/dist/workflow-engine/package.d.mts +2 -0
- package/dist/workflow-engine/package.mjs +1 -0
- package/dist/workflow-engine/workflow-orchestrator.d.mts +61 -0
- package/dist/workflow-engine/workflow-orchestrator.mjs +1 -0
- package/dist/workflow-worker-DvP753UN.mjs +1 -0
- package/package.json +65 -1
- package/dist/extension-C-4BHMRI.mjs +0 -1
- package/dist/globby-rtWVaFHv.mjs +0 -41
- package/dist/schema-introspection-Dn1jWQs1.mjs +0 -1
- package/dist/schemas-CVvwIfG4.mjs +0 -1
- package/dist/storage-namespace-DWsYLAXa.mjs +0 -1
- package/dist/tool-approval-service-BvZWhYZp.mjs +0 -1
- package/dist/tools-D-luYcDw.mjs +0 -1431
- package/dist/version-BeT3ASEe.mjs +0 -1
- /package/dist/{base-orchestrator-wyumsn3b.d.mts → base-orchestrator-M5mAB5-w.d.mts} +0 -0
- /package/dist/{capability-service-CJbmhfv9.mjs → capability-service-jjrFLM6r.mjs} +0 -0
- /package/dist/{cleanEnvForAdapter-KkYzQa1f.mjs → cleanEnvForAdapter-BlpmyXYk.mjs} +0 -0
- /package/dist/{clients-namespace-GmSJpBUV.d.mts → clients-namespace-SFk7OTop.d.mts} +0 -0
- /package/dist/{config-namespace-CPY9YsR8.d.mts → config-namespace-BzAvE2nY.d.mts} +0 -0
- /package/dist/{config-namespace-ncYg2ct_.mjs → config-namespace-DydHz9so.mjs} +0 -0
- /package/dist/{definition-BLCdXGzh.d.mts → definition-BSghHJpQ.d.mts} +0 -0
- /package/dist/{definition-pkJ6szUl.d.mts → definition-q6iLw11H.d.mts} +0 -0
- /package/dist/{drizzle-Eq8W1EbD.mjs → drizzle-DpjZFY_j.mjs} +0 -0
- /package/dist/{event-Ca2yUf5i.mjs → event-BEllCn16.mjs} +0 -0
- /package/dist/{execution-target-CRPTfZlc.mjs → execution-target-CQGYaaM2.mjs} +0 -0
- /package/dist/{extension-namespace-cMh_mMiL.mjs → extension-namespace-BBgYOttA.mjs} +0 -0
- /package/dist/{facet-BuwhrThl.mjs → facet-DMrryX_0.mjs} +0 -0
- /package/dist/{filesystem-service-p_iJVHd4.d.mts → filesystem-service-Ddngll0j.d.mts} +0 -0
- /package/dist/{harness-BRCMcvQN.mjs → harness-B8E_wRwa.mjs} +0 -0
- /package/dist/{host-Br9VuOyr.mjs → host-DbMiI5wQ.mjs} +0 -0
- /package/dist/{identity-Cz2IeEtm.mjs → identity-Bmx-8fPa.mjs} +0 -0
- /package/dist/{index-U-A8eyGT.d.mts → index-9IDJUJ4X.d.mts} +0 -0
- /package/dist/{index-CGmcS0Ma.d.mts → index-BBvcP-P0.d.mts} +0 -0
- /package/dist/{index-BGfWS6GE.d.mts → index-BKKNWqkP2.d.mts} +0 -0
- /package/dist/{index-DKia0MX1.d.mts → index-BMpRB6iE.d.mts} +0 -0
- /package/dist/{index-CHQ1SqT0.d.mts → index-BbCjtc3h.d.mts} +0 -0
- /package/dist/{index-BFg9BUpx.d.mts → index-BheaEhyI.d.mts} +0 -0
- /package/dist/{index-Cs0kZXIz2.d.mts → index-BnQSPC6c.d.mts} +0 -0
- /package/dist/{index-CCGVh9BF2.d.mts → index-BpXX9WZJ.d.mts} +0 -0
- /package/dist/{index-DMKnON5s.d.mts → index-Bsp0O_sI.d.mts} +0 -0
- /package/dist/{index-DANINzMu.d.mts → index-Buo9H8RK.d.mts} +0 -0
- /package/dist/{index-CLpjm52M.d.mts → index-BxFA1XcP.d.mts} +0 -0
- /package/dist/{index-ChunCFu4.d.mts → index-C33Tq1ei2.d.mts} +0 -0
- /package/dist/{index-DGBu6bHi2.d.mts → index-C6BhKRnH.d.mts} +0 -0
- /package/dist/{index-eemAKwsB.d.mts → index-CDU_s69P.d.mts} +0 -0
- /package/dist/{index-DKC62dY5.d.mts → index-CGJjA-hR2.d.mts} +0 -0
- /package/dist/{index-CokQYGVP.d.mts → index-Clut1ljB.d.mts} +0 -0
- /package/dist/{index-BVgfS-AJ.d.mts → index-Cz9JMjZK.d.mts} +0 -0
- /package/dist/{index-vtXJuwrz.d.mts → index-D0SUjZmU.d.mts} +0 -0
- /package/dist/{index-x_lVDp_J.d.mts → index-D6Iyvz9T.d.mts} +0 -0
- /package/dist/{index-D5d5HeWI2.d.mts → index-DOfq0qqv.d.mts} +0 -0
- /package/dist/{index-De3kPhlN.d.mts → index-DSV1aFgK.d.mts} +0 -0
- /package/dist/{index-B80L4YqA.d.mts → index-Dsq2zKvu.d.mts} +0 -0
- /package/dist/{materialization-CuUBu4XI.mjs → materialization-3QUnQLbC.mjs} +0 -0
- /package/dist/{model-registry-Scn_MC2d.mjs → model-registry-B0AIdj7O.mjs} +0 -0
- /package/dist/{model-registry-CfXytvzx.mjs → model-registry-j-rCKcik.mjs} +0 -0
- /package/dist/{namespace-CFLAmQfh.mjs → namespace-BbjCyZC9.mjs} +0 -0
- /package/dist/{namespace-BwzZJqTV.mjs → namespace-BgPoC46Q.mjs} +0 -0
- /package/dist/{namespace-Yna5-Pws.mjs → namespace-CDiM5Bcr.mjs} +0 -0
- /package/dist/{namespace-BoD94mrN.mjs → namespace-CUOGcGPG.mjs} +0 -0
- /package/dist/{namespace-LViZ-EQk.mjs → namespace-D6X67cUk.mjs} +0 -0
- /package/dist/{namespace-DkRgbZYn.mjs → namespace-ENv7H7Na.mjs} +0 -0
- /package/dist/{namespace-xcmbQlxh.mjs → namespace-FT8igkn4.mjs} +0 -0
- /package/dist/{namespace-CaoZ3S78.d.mts → namespace-XTGCaSXj.d.mts} +0 -0
- /package/dist/{namespace-CTm3nEvh.d.mts → namespace-nlsvvMtD.d.mts} +0 -0
- /package/dist/{namespace-IV1QK__V.d.mts → namespace-uuR0Fg5r.d.mts} +0 -0
- /package/dist/{orchestrator-shared-Dfa7FMyw.d.mts → orchestrator-shared-D91Wk7z-.d.mts} +0 -0
- /package/dist/{package-DKVlsMP3.mjs → package-OE9dMQsq.mjs} +0 -0
- /package/dist/{platform-DZ7z-wXD.mjs → platform-Dhv22LiX.mjs} +0 -0
- /package/dist/{providers-u8i15co9.mjs → providers-B1p0P-vB.mjs} +0 -0
- /package/dist/{providers-namespace-DSEpli4A.d.mts → providers-namespace-BqWYkydw.d.mts} +0 -0
- /package/dist/{schema-CoyE6mPt.mjs → schema-DOnJmAPw.mjs} +0 -0
- /package/dist/{schemas-Bd0OjRQf.d.mts → schemas-B77Gi8Xr.d.mts} +0 -0
- /package/dist/{schemas-jFe1AuI-.mjs → schemas-BCIuTWRl2.mjs} +0 -0
- /package/dist/{schemas-DE-GNmSD.mjs → schemas-BdAf5u58.mjs} +0 -0
- /package/dist/{schemas-CDBSjg7o.d.mts → schemas-Dyk7JuVl.d.mts} +0 -0
- /package/dist/{schemas-DaRSfYLf.d.mts → schemas-Kq33MTPY.d.mts} +0 -0
- /package/dist/{server-lifecycle-YoSGFGnU.d.mts → server-lifecycle-47mygK3E.d.mts} +0 -0
- /package/dist/{server-lifecycle-FXTPW39-.mjs → server-lifecycle-Cg47L59Q.mjs} +0 -0
- /package/dist/{shared-schemas-CPShiLNp.mjs → shared-schemas-CKe2uN4-.mjs} +0 -0
- /package/dist/{storage-namespace-definition-Bkx5rSto.d.mts → storage-namespace-definition-C3XbpiP8.d.mts} +0 -0
- /package/dist/{storage-namespace-definition-CqSdsuCC.mjs → storage-namespace-definition-RvjfFysN.mjs} +0 -0
- /package/dist/{telemetry-CvdLBWuk.mjs → telemetry-O0394b7p.mjs} +0 -0
- /package/dist/{tray-menu-service-DuXq5k22.mjs → tray-menu-service-B5YPK_YF.mjs} +0 -0
- /package/dist/{types-C2Ob9zz_.d.mts → types-5Gw3iVpK.d.mts} +0 -0
- /package/dist/{types-dyP-bXXE.d.mts → types-BhXRffJ_.d.mts} +0 -0
- /package/dist/{types-MfJZ67e9.d.mts → types-D-bP8RRE.d.mts} +0 -0
- /package/dist/{variant-CT6XBP6T.mjs → variant-COVbYmMs.mjs} +0 -0
- /package/dist/{window-registry-CBcrGTv4.d.mts → window-registry-CfEi_Ji4.d.mts} +0 -0
- /package/dist/{window-registry-DW-dKRjQ.mjs → window-registry-XjOExitT.mjs} +0 -0
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
import { IMakaioBus } from "@makaio/framework/bus";
|
|
2
|
+
import { McpAgentContext, McpAgentContext as McpAgentContext$1, ToolExecutionContextOverrides } from "@makaio/framework/contracts";
|
|
3
|
+
import { BaseService } from "@makaio/framework/service-base";
|
|
4
|
+
import { McpToolDefinition, ToolInfo } from "@makaio/framework/tools";
|
|
5
|
+
import { IncomingMessage, ServerResponse } from "node:http";
|
|
6
|
+
import { Server as Server$1 } from "@modelcontextprotocol/sdk/server/index.js";
|
|
7
|
+
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
8
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
9
|
+
|
|
10
|
+
//#region subsystems/mcp-http-server/src/context-registry.d.ts
|
|
11
|
+
/**
|
|
12
|
+
* Registry mapping adapterSessionId to agent context.
|
|
13
|
+
*
|
|
14
|
+
* The adapter registers context before spawning Claude CLI; the MCP server
|
|
15
|
+
* reads it when handling approval requests (via adapterSessionId from URL query).
|
|
16
|
+
*/
|
|
17
|
+
interface IMcpContextRegistry {
|
|
18
|
+
/**
|
|
19
|
+
* Register agent context for an adapter session.
|
|
20
|
+
* @param adapterSessionId - Adapter session identifier
|
|
21
|
+
* @param context - Agent context to store
|
|
22
|
+
*/
|
|
23
|
+
register(adapterSessionId: string, context: McpAgentContext$1): void;
|
|
24
|
+
/**
|
|
25
|
+
* Retrieve agent context for an adapter session.
|
|
26
|
+
* @param adapterSessionId - Adapter session identifier
|
|
27
|
+
* @returns Stored agent context, or undefined if not registered
|
|
28
|
+
*/
|
|
29
|
+
get(adapterSessionId: string): McpAgentContext$1 | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Remove agent context for an adapter session.
|
|
32
|
+
* @param adapterSessionId - Adapter session identifier
|
|
33
|
+
*/
|
|
34
|
+
unregister(adapterSessionId: string): void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Simple Map-backed implementation of {@link IMcpContextRegistry}.
|
|
38
|
+
*
|
|
39
|
+
* Created once per adapter instance, shared with the HTTP MCP server so
|
|
40
|
+
* approval requests can resolve agent context from the URL query param.
|
|
41
|
+
*/
|
|
42
|
+
declare class McpContextRegistry implements IMcpContextRegistry {
|
|
43
|
+
private readonly registry;
|
|
44
|
+
/**
|
|
45
|
+
* Register agent context for an adapter session.
|
|
46
|
+
* @param adapterSessionId - Adapter session identifier
|
|
47
|
+
* @param context - Agent context to store
|
|
48
|
+
*/
|
|
49
|
+
register(adapterSessionId: string, context: McpAgentContext$1): void;
|
|
50
|
+
/**
|
|
51
|
+
* Retrieve agent context for an adapter session.
|
|
52
|
+
* @param adapterSessionId - Adapter session identifier
|
|
53
|
+
* @returns Stored agent context, or undefined if not registered
|
|
54
|
+
*/
|
|
55
|
+
get(adapterSessionId: string): McpAgentContext$1 | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Remove agent context for an adapter session.
|
|
58
|
+
* @param adapterSessionId - Adapter session identifier
|
|
59
|
+
*/
|
|
60
|
+
unregister(adapterSessionId: string): void;
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region subsystems/mcp-http-server/src/approve-tool.d.ts
|
|
64
|
+
/** MCP tool name for the permission prompt handler. */
|
|
65
|
+
declare const APPROVE_TOOL_NAME = "approve";
|
|
66
|
+
/** Payload forwarded to `agent.toolApprove`. */
|
|
67
|
+
interface ToolApproveRequestPayload {
|
|
68
|
+
toolName: string;
|
|
69
|
+
args: Record<string, unknown>;
|
|
70
|
+
toolCallId: string;
|
|
71
|
+
agentId: string;
|
|
72
|
+
adapterId: string;
|
|
73
|
+
adapterName: string;
|
|
74
|
+
adapterSessionId: string;
|
|
75
|
+
/** Makaio session ID — required for approval routing to the owning tab. */
|
|
76
|
+
sessionId: string;
|
|
77
|
+
}
|
|
78
|
+
/** Minimal response shape consumed from `agent.toolApprove`. */
|
|
79
|
+
type ToolApproveResponse = {
|
|
80
|
+
action: 'allow';
|
|
81
|
+
updatedInput?: Record<string, unknown>;
|
|
82
|
+
} | {
|
|
83
|
+
action: 'deny';
|
|
84
|
+
message?: string;
|
|
85
|
+
};
|
|
86
|
+
/** Function seam for approval RPC. */
|
|
87
|
+
type RequestToolApproval = (payload: ToolApproveRequestPayload) => Promise<ToolApproveResponse>;
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region subsystems/mcp-http-server/src/tool-discovery.d.ts
|
|
90
|
+
/**
|
|
91
|
+
* Maps a runtime toolset name to the plugin that owns it.
|
|
92
|
+
* When present, tools in the toolset receive an MCP name of `{pluginName}.{toolName}`.
|
|
93
|
+
*/
|
|
94
|
+
type PluginToolsetMap = Record<string, string>;
|
|
95
|
+
/**
|
|
96
|
+
* Describes a single resolved MCP tool entry, capturing the relationship between
|
|
97
|
+
* the MCP-visible name and the original runtime tool name.
|
|
98
|
+
*/
|
|
99
|
+
interface McpToolEntry {
|
|
100
|
+
/** The MCP-visible name used in `tools/list` and `tools/call`. */
|
|
101
|
+
mcpName: string;
|
|
102
|
+
/** The original tool name as registered in the ToolRegistry. */
|
|
103
|
+
sourceToolName: string;
|
|
104
|
+
/** The toolset this tool belongs to. */
|
|
105
|
+
toolsetName: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Result of resolving MCP tools from the registry.
|
|
109
|
+
*/
|
|
110
|
+
interface McpResolvedTools {
|
|
111
|
+
/** MCP-compatible tool definitions ready to send in `tools/list` responses. */
|
|
112
|
+
tools: McpToolDefinition[];
|
|
113
|
+
/**
|
|
114
|
+
* Bidirectional lookup map from MCP name to tool entry.
|
|
115
|
+
* Use `byMcpName.get(mcpName)?.sourceToolName` to map a `tools/call` name back
|
|
116
|
+
* to the runtime tool name for execution.
|
|
117
|
+
*/
|
|
118
|
+
byMcpName: Map<string, McpToolEntry>;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Adapter identity fields for tool discovery policy filtering.
|
|
122
|
+
*
|
|
123
|
+
* When present, these fields are forwarded to `ToolSubjects.list` so the
|
|
124
|
+
* tool registry can apply per-adapter policy (e.g., allowedAdapters checks).
|
|
125
|
+
*/
|
|
126
|
+
interface McpToolDiscoveryIdentity {
|
|
127
|
+
/** Adapter identifier for policy filtering. */
|
|
128
|
+
readonly adapterId?: string;
|
|
129
|
+
/** Human-readable adapter name for policy filtering. */
|
|
130
|
+
readonly adapterName?: string;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Options for MCP tool discovery.
|
|
134
|
+
*/
|
|
135
|
+
interface McpToolDiscoveryOptions {
|
|
136
|
+
/**
|
|
137
|
+
* Maps toolset names to the plugin that owns them.
|
|
138
|
+
* Tools in a plugin-owned toolset receive an MCP name of `{pluginName}.{toolName}`.
|
|
139
|
+
* Tools in non-plugin toolsets receive bare `{toolName}` unless a collision occurs.
|
|
140
|
+
*/
|
|
141
|
+
pluginToolsets?: PluginToolsetMap;
|
|
142
|
+
/**
|
|
143
|
+
* Official filtering seam for controlling which tools are exposed via MCP.
|
|
144
|
+
*
|
|
145
|
+
* Receives the full list of candidate tools (after bus query or static fallback) and
|
|
146
|
+
* returns the subset to expose. Return an empty array to suppress all tools.
|
|
147
|
+
* Return the input unchanged (default) to expose all tools.
|
|
148
|
+
*
|
|
149
|
+
* Use this hook to implement allow-lists, capability checks, or runtime feature flags
|
|
150
|
+
* without modifying the registry or toolsets themselves.
|
|
151
|
+
* @param tools - All candidate tools available in the registry
|
|
152
|
+
* @returns Subset of tools to expose via MCP
|
|
153
|
+
*/
|
|
154
|
+
getExposedTools?: (tools: ToolInfo[]) => ToolInfo[];
|
|
155
|
+
/**
|
|
156
|
+
* Static fallback tool list used when `ToolSubjects.list` has no registered handler
|
|
157
|
+
* on the bus (e.g., no `ToolRegistry` is running in-process).
|
|
158
|
+
* If omitted and the bus has no handler, the result will be empty.
|
|
159
|
+
*/
|
|
160
|
+
staticFallback?: ToolInfo[];
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Resolves the MCP-visible tool list from the bus, with collision-safe naming.
|
|
164
|
+
*
|
|
165
|
+
* Resolution algorithm:
|
|
166
|
+
* 1. Query `ToolSubjects.list` via `bus.requestOptional`. If no handler is registered,
|
|
167
|
+
* fall back to `options.staticFallback` (empty by default).
|
|
168
|
+
* 2. Apply `options.getExposedTools` filter (identity by default).
|
|
169
|
+
* 3. Assign tentative MCP names: plugin-owned toolsets get `{pluginName}.{toolName}`,
|
|
170
|
+
* all others get bare `{toolName}`.
|
|
171
|
+
* 4. Detect collisions: any tentative name claimed by two or more tools is resolved to
|
|
172
|
+
* `{toolsetName}.{toolName}` for every tool sharing that name.
|
|
173
|
+
* 5. Return `McpResolvedTools` with the final tool list and a `byMcpName` lookup map.
|
|
174
|
+
* @param bus - Bus instance used to query the live tool registry
|
|
175
|
+
* @param options - Discovery options (plugin map, filter hook, static fallback)
|
|
176
|
+
* @param identity - Optional adapter identity for per-adapter policy filtering
|
|
177
|
+
* @returns Resolved MCP tools with bidirectional name mapping
|
|
178
|
+
*/
|
|
179
|
+
declare function resolveMcpTools(bus: IMakaioBus, options?: McpToolDiscoveryOptions, identity?: McpToolDiscoveryIdentity): Promise<McpResolvedTools>;
|
|
180
|
+
/**
|
|
181
|
+
* Convert a `ToolInfo` from the registry to an `McpToolDefinition`.
|
|
182
|
+
*
|
|
183
|
+
* Used internally by `resolveMcpTools` and exposed for consumers that build the tool list outside
|
|
184
|
+
* of `resolveMcpTools` (e.g., static registration paths).
|
|
185
|
+
* @param tool - Tool info entry with optional inputSchema
|
|
186
|
+
* @param mcpName - MCP-visible name to assign (may differ from `tool.name`)
|
|
187
|
+
* @returns MCP-compatible tool definition
|
|
188
|
+
*/
|
|
189
|
+
declare function toolInfoToMcpTool(tool: ToolInfo, mcpName: string): McpToolDefinition;
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region subsystems/mcp-http-server/src/server.d.ts
|
|
192
|
+
/**
|
|
193
|
+
* Options for configuring MCP server startup.
|
|
194
|
+
*/
|
|
195
|
+
interface McpServerOptions {
|
|
196
|
+
/** Required. Defaults to `'stdio'` when using {@link startMcpServer}. */
|
|
197
|
+
transport: 'stdio' | 'http';
|
|
198
|
+
/** Port for HTTP transport. When omitted or 0, OS assigns an available port. */
|
|
199
|
+
port?: number;
|
|
200
|
+
/** Agent context for HTTP transport routing. */
|
|
201
|
+
agentContext?: McpAgentContext$1;
|
|
202
|
+
/** Optional MCP tool discovery customization. */
|
|
203
|
+
toolDiscovery?: McpToolDiscoveryOptions;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Result returned by {@link startMcpServer} for the stdio transport.
|
|
207
|
+
*/
|
|
208
|
+
interface StdioMcpServerHandle {
|
|
209
|
+
/** Gracefully close the MCP server and stdio transport. */
|
|
210
|
+
close: () => Promise<void>;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Result returned by {@link startHttpMcpServer}.
|
|
214
|
+
*/
|
|
215
|
+
interface HttpMcpServerHandle {
|
|
216
|
+
/** OS-assigned port the HTTP server is listening on. */
|
|
217
|
+
port: number;
|
|
218
|
+
/** Context registry for registering/unregistering agent sessions. */
|
|
219
|
+
contextRegistry: IMcpContextRegistry;
|
|
220
|
+
/** Gracefully close the HTTP server and MCP transport. */
|
|
221
|
+
close: () => Promise<void>;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Callback that resolves session-stable context overrides for a given
|
|
225
|
+
* adapter session ID.
|
|
226
|
+
*
|
|
227
|
+
* Invoked on every tool-call request. When the session is found, its
|
|
228
|
+
* return value overrides the default fallback context
|
|
229
|
+
* `{ cwd: process.cwd(), sessionId }`. When the session is unknown or
|
|
230
|
+
* the header is absent, returning `undefined` keeps the fallback.
|
|
231
|
+
* @param adapterSessionId - The adapter session ID extracted from request
|
|
232
|
+
* headers, or `undefined` when the header is absent.
|
|
233
|
+
* @returns Resolved context overrides, or `undefined` to use the fallback.
|
|
234
|
+
*/
|
|
235
|
+
type ResolveContextOverrides = (adapterSessionId: string | undefined) => ToolExecutionContextOverrides | undefined;
|
|
236
|
+
/**
|
|
237
|
+
* Options for {@link createMcpServer}.
|
|
238
|
+
*/
|
|
239
|
+
interface CreateMcpServerOptions {
|
|
240
|
+
/** Registry for resolving agent context by adapterSessionId. When present, the `approve` tool is exposed. */
|
|
241
|
+
contextRegistry?: IMcpContextRegistry;
|
|
242
|
+
/** Optional tool discovery customization. */
|
|
243
|
+
toolDiscovery?: McpToolDiscoveryOptions;
|
|
244
|
+
/** Optional callback to resolve session-stable context overrides from an adapter session ID at tool-call time. */
|
|
245
|
+
resolveContextOverrides?: ResolveContextOverrides;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Options accepted by {@link startHttpMcpServer}.
|
|
249
|
+
*
|
|
250
|
+
* Extends the transport-agnostic {@link McpServerOptions} fields (minus
|
|
251
|
+
* `transport`, which is always `'http'` for this function) with an optional
|
|
252
|
+
* callback for resolving session-stable context overrides at tool-call time.
|
|
253
|
+
*/
|
|
254
|
+
interface HttpMcpServerOptions extends Omit<McpServerOptions, 'transport'> {
|
|
255
|
+
/** Optional callback for session-stable context override resolution. */
|
|
256
|
+
resolveContextOverrides?: ResolveContextOverrides;
|
|
257
|
+
/**
|
|
258
|
+
* Optional callback invoked when the HTTP transport closes.
|
|
259
|
+
*
|
|
260
|
+
* Called synchronously by the MCP SDK's transport `onclose` hook — that is,
|
|
261
|
+
* when {@link HttpMcpServerHandle.close} has been called and the transport
|
|
262
|
+
* has finished closing. Intended for best-effort resource cleanup (e.g.
|
|
263
|
+
* flushing session registries) without blocking the close path.
|
|
264
|
+
*/
|
|
265
|
+
onclose?: () => void;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Create and configure MCP server.
|
|
269
|
+
*
|
|
270
|
+
* **Freshness contract:** Tool lists are resolved fresh on every MCP `tools/list` and
|
|
271
|
+
* `tools/call` request. There is no caching between calls.
|
|
272
|
+
*
|
|
273
|
+
* **Side-effect:** Subscribes to {@link ToolSubjects.registryChanged} on `bus` and
|
|
274
|
+
* sends `notifications/tools/list_changed` to connected MCP clients on each emission.
|
|
275
|
+
* Calling `server.close()` unsubscribes this listener; connected transport closure
|
|
276
|
+
* also reaches the same idempotent cleanup through the SDK's `onclose` hook.
|
|
277
|
+
* @param bus - Bus instance for tool execution and approval RPC.
|
|
278
|
+
* @param sessionId - Session identifier for tool execution context.
|
|
279
|
+
* @param options - Optional server configuration.
|
|
280
|
+
* @returns Configured MCP {@link Server} instance.
|
|
281
|
+
*/
|
|
282
|
+
declare function createMcpServer(bus: IMakaioBus, sessionId: string, options?: CreateMcpServerOptions): Promise<Server$1<{
|
|
283
|
+
method: string;
|
|
284
|
+
params?: {
|
|
285
|
+
[x: string]: unknown;
|
|
286
|
+
_meta?: {
|
|
287
|
+
[x: string]: unknown;
|
|
288
|
+
progressToken?: string | number | undefined;
|
|
289
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
290
|
+
taskId: string;
|
|
291
|
+
} | undefined;
|
|
292
|
+
} | undefined;
|
|
293
|
+
} | undefined;
|
|
294
|
+
}, {
|
|
295
|
+
method: string;
|
|
296
|
+
params?: {
|
|
297
|
+
[x: string]: unknown;
|
|
298
|
+
_meta?: {
|
|
299
|
+
[x: string]: unknown;
|
|
300
|
+
progressToken?: string | number | undefined;
|
|
301
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
302
|
+
taskId: string;
|
|
303
|
+
} | undefined;
|
|
304
|
+
} | undefined;
|
|
305
|
+
} | undefined;
|
|
306
|
+
}, {
|
|
307
|
+
[x: string]: unknown;
|
|
308
|
+
_meta?: {
|
|
309
|
+
[x: string]: unknown;
|
|
310
|
+
progressToken?: string | number | undefined;
|
|
311
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
312
|
+
taskId: string;
|
|
313
|
+
} | undefined;
|
|
314
|
+
} | undefined;
|
|
315
|
+
}>>;
|
|
316
|
+
/**
|
|
317
|
+
* Create a framework-agnostic HTTP request handler that delegates to
|
|
318
|
+
* {@link StreamableHTTPServerTransport.handleRequest}.
|
|
319
|
+
*
|
|
320
|
+
* This is the seam for attaching MCP to a shared HTTP server in the future.
|
|
321
|
+
* The transport handles body parsing internally and we do not pre-parse the body,
|
|
322
|
+
* otherwise the request stream would be consumed before MCP can read it.
|
|
323
|
+
* @param transport - Streamable HTTP transport instance connected to the server.
|
|
324
|
+
* @param onBeforeDispatch - Optional hook called synchronously before request dispatch.
|
|
325
|
+
* @returns Node.js-compatible request handler.
|
|
326
|
+
*/
|
|
327
|
+
declare function createMcpRequestHandler(transport: StreamableHTTPServerTransport, onBeforeDispatch?: (req: IncomingMessage, res: ServerResponse) => void): (req: IncomingMessage, res: ServerResponse) => void;
|
|
328
|
+
/**
|
|
329
|
+
* Start a standalone HTTP MCP server on a new `http.Server`.
|
|
330
|
+
* @param bus - Bus instance.
|
|
331
|
+
* @param options - Server options; `port` defaults to 0 (OS-assigned).
|
|
332
|
+
* Pass `resolveContextOverrides` to supply session-stable context overrides
|
|
333
|
+
* at tool-call time (used by {@link McpServerBridgeService}).
|
|
334
|
+
* @returns Handle exposing the OS-assigned port, context registry, and a close function.
|
|
335
|
+
*/
|
|
336
|
+
declare function startHttpMcpServer(bus: IMakaioBus, options?: HttpMcpServerOptions): Promise<HttpMcpServerHandle>;
|
|
337
|
+
/**
|
|
338
|
+
* Start MCP server with the configured transport.
|
|
339
|
+
*
|
|
340
|
+
* For the stdio transport, returns a {@link StdioMcpServerHandle} whose
|
|
341
|
+
* `close()` method gracefully tears down the MCP server. Signal handling
|
|
342
|
+
* is intentionally left to the composition root — library code must not
|
|
343
|
+
* own process-global resources such as `process.on('SIGINT')`.
|
|
344
|
+
* @param bus - Bus instance.
|
|
345
|
+
* @param sessionId - Session identifier (used for stdio transport).
|
|
346
|
+
* @param options - Server options; defaults to stdio transport.
|
|
347
|
+
* @returns A handle exposing a `close()` function for both transports.
|
|
348
|
+
* For HTTP transport the handle additionally exposes the OS-assigned
|
|
349
|
+
* port and the context registry.
|
|
350
|
+
*/
|
|
351
|
+
declare function startMcpServer(bus: IMakaioBus, sessionId: string, options?: McpServerOptions): Promise<HttpMcpServerHandle | StdioMcpServerHandle>;
|
|
352
|
+
//#endregion
|
|
353
|
+
//#region subsystems/mcp-http-server/src/mcp-server-bridge-service.d.ts
|
|
354
|
+
/**
|
|
355
|
+
* Singleton bus service that manages the HTTP MCP server lifecycle.
|
|
356
|
+
*
|
|
357
|
+
* Handles `mcp.session.register` and `mcp.session.unregister` bus subjects.
|
|
358
|
+
* The HTTP MCP server is started lazily on the first `session.register` call
|
|
359
|
+
* using a coalescing promise so concurrent registrations never start two
|
|
360
|
+
* server instances.
|
|
361
|
+
*
|
|
362
|
+
* The service maintains three parallel session stores:
|
|
363
|
+
* - `pinnedSessions` (plain Map) — sessions exempt from both TTL sweep and
|
|
364
|
+
* LRU count-eviction; only removed by explicit `mcp.session.unregister` or
|
|
365
|
+
* on server close
|
|
366
|
+
* - `sessions` (QuickLRU) — non-pinned sessions subject to TTL/LRU eviction
|
|
367
|
+
* - `contextRegistry` (Map-backed, inside the HTTP server handle) — source of
|
|
368
|
+
* truth for the MCP server's per-request routing
|
|
369
|
+
*
|
|
370
|
+
* The `resolveContextOverrides` callback threaded into `startHttpMcpServer`
|
|
371
|
+
* bridges these stores so tool execution always uses session-stable
|
|
372
|
+
* context overrides rather than per-process fallbacks.
|
|
373
|
+
*/
|
|
374
|
+
declare class McpServerBridgeService extends BaseService {
|
|
375
|
+
private mcpHandle;
|
|
376
|
+
private startPromise;
|
|
377
|
+
private readonly sessions;
|
|
378
|
+
/**
|
|
379
|
+
* Sessions that are exempt from LRU count-eviction and TTL sweep.
|
|
380
|
+
* Pinned sessions have fundamentally different lifecycle semantics — no
|
|
381
|
+
* expiry — so they are kept in a plain Map separate from the QuickLRU.
|
|
382
|
+
* Only an explicit `mcp.session.unregister` or a server close removes them.
|
|
383
|
+
* A soft cap of {@link MAX_PINNED_SESSION_COUNT} is enforced via a warning
|
|
384
|
+
* to detect unregister-path bugs early without disrupting functionality.
|
|
385
|
+
*/
|
|
386
|
+
private readonly pinnedSessions;
|
|
387
|
+
/**
|
|
388
|
+
* @param bus - Bus instance used for handler registration.
|
|
389
|
+
*/
|
|
390
|
+
constructor(bus: IMakaioBus);
|
|
391
|
+
/**
|
|
392
|
+
* Register bus handlers and start the TTL sweep interval.
|
|
393
|
+
* @returns Promise that resolves when all handlers are registered.
|
|
394
|
+
*/
|
|
395
|
+
protected onInit(): Promise<void>;
|
|
396
|
+
/**
|
|
397
|
+
* Resolve context overrides for an adapter session.
|
|
398
|
+
*
|
|
399
|
+
* Updates `lastActivity` on access so recently-used sessions are not
|
|
400
|
+
* swept by the TTL interval.
|
|
401
|
+
* @param adapterSessionId - Adapter session identifier to look up.
|
|
402
|
+
* @returns The stored context overrides, or `undefined` if not found.
|
|
403
|
+
*/
|
|
404
|
+
private resolveOverrides;
|
|
405
|
+
/**
|
|
406
|
+
* Ensure the HTTP MCP server is running, starting it if necessary.
|
|
407
|
+
*
|
|
408
|
+
* Uses a coalescing promise so concurrent callers never start two servers.
|
|
409
|
+
* The promise is cleared on both success and failure so a transient startup
|
|
410
|
+
* error does not permanently block retries.
|
|
411
|
+
* @returns The running HTTP MCP server handle.
|
|
412
|
+
*/
|
|
413
|
+
private ensureStarted;
|
|
414
|
+
}
|
|
415
|
+
//#endregion
|
|
416
|
+
//#region subsystems/mcp-http-server/src/mcp-client-bridge.d.ts
|
|
417
|
+
/**
|
|
418
|
+
* A tool discovered from an MCP server and bridged for bus registration.
|
|
419
|
+
*/
|
|
420
|
+
interface McpBridgedTool {
|
|
421
|
+
/** The tool's name as returned by the MCP server. */
|
|
422
|
+
readonly name: string;
|
|
423
|
+
/** Human-readable description. */
|
|
424
|
+
readonly description: string;
|
|
425
|
+
/** JSON Schema for the tool's input parameters. */
|
|
426
|
+
readonly inputSchema: unknown;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Return type of {@link McpClientBridgeHandle.callTool}.
|
|
430
|
+
*
|
|
431
|
+
* Mirrors the shape returned by the MCP SDK client so callers get the raw
|
|
432
|
+
* result without re-parsing content.
|
|
433
|
+
*/
|
|
434
|
+
type McpCallToolResult = Awaited<ReturnType<Client['callTool']>>;
|
|
435
|
+
/**
|
|
436
|
+
* Handle for an active MCP client bridge.
|
|
437
|
+
*
|
|
438
|
+
* Returned by {@link startMcpClientBridge}. Callers hold this handle for the
|
|
439
|
+
* lifetime of the spawned MCP subprocess, then call {@link close} to tear down
|
|
440
|
+
* the transport and the child process.
|
|
441
|
+
*/
|
|
442
|
+
interface McpClientBridgeHandle {
|
|
443
|
+
/**
|
|
444
|
+
* Currently known tools from the MCP server.
|
|
445
|
+
*
|
|
446
|
+
* Updated automatically whenever the server sends
|
|
447
|
+
* `notifications/tools/list_changed` (requires
|
|
448
|
+
* {@link McpClientBridgeOptions.onToolsChanged} to be provided so the bridge
|
|
449
|
+
* subscribes to list-change events).
|
|
450
|
+
*/
|
|
451
|
+
readonly tools: readonly McpBridgedTool[];
|
|
452
|
+
/**
|
|
453
|
+
* Names of the currently known tools.
|
|
454
|
+
*
|
|
455
|
+
* Convenience accessor over {@link tools} — equivalent to
|
|
456
|
+
* `handle.tools.map(t => t.name)`.
|
|
457
|
+
*/
|
|
458
|
+
readonly toolNames: readonly string[];
|
|
459
|
+
/**
|
|
460
|
+
* Proxy a tool call to the connected MCP server.
|
|
461
|
+
* @param name - Tool name as advertised by the MCP server.
|
|
462
|
+
* @param args - Tool input arguments.
|
|
463
|
+
* @returns The raw MCP call-tool result.
|
|
464
|
+
*/
|
|
465
|
+
callTool(name: string, args: Record<string, unknown>): Promise<McpCallToolResult>;
|
|
466
|
+
/**
|
|
467
|
+
* Close the MCP client and terminate the subprocess.
|
|
468
|
+
* @returns Promise that resolves when the transport has been fully closed.
|
|
469
|
+
*/
|
|
470
|
+
close(): Promise<void>;
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* Options for {@link startMcpClientBridge}.
|
|
474
|
+
*/
|
|
475
|
+
interface McpClientBridgeOptions {
|
|
476
|
+
/**
|
|
477
|
+
* The executable to spawn as an MCP server subprocess.
|
|
478
|
+
*
|
|
479
|
+
* Can be an absolute path or a name resolvable via `PATH`.
|
|
480
|
+
*/
|
|
481
|
+
readonly command: string;
|
|
482
|
+
/**
|
|
483
|
+
* Command-line arguments forwarded to the subprocess.
|
|
484
|
+
* Defaults to an empty array when omitted.
|
|
485
|
+
*/
|
|
486
|
+
readonly args?: readonly string[];
|
|
487
|
+
/**
|
|
488
|
+
* Environment variables for the spawned subprocess.
|
|
489
|
+
*
|
|
490
|
+
* When omitted the SDK's {@link getDefaultEnvironment} is used, which
|
|
491
|
+
* inherits a safe subset of the parent environment.
|
|
492
|
+
*/
|
|
493
|
+
readonly env?: Readonly<Record<string, string>>;
|
|
494
|
+
/**
|
|
495
|
+
* Working directory for the spawned subprocess.
|
|
496
|
+
*
|
|
497
|
+
* Forwarded verbatim to the stdio transport. When omitted, the current
|
|
498
|
+
* working directory of the parent process is inherited.
|
|
499
|
+
*/
|
|
500
|
+
readonly cwd?: string;
|
|
501
|
+
/**
|
|
502
|
+
* Extension name used as the MCP client identifier.
|
|
503
|
+
*
|
|
504
|
+
* Surfaced as `name: 'makaio-{extensionName}'` in the MCP handshake, making
|
|
505
|
+
* server-side logs attributable to the correct extension.
|
|
506
|
+
*/
|
|
507
|
+
readonly extensionName: string;
|
|
508
|
+
/**
|
|
509
|
+
* Callback invoked when the MCP server signals that its tool list has changed.
|
|
510
|
+
*
|
|
511
|
+
* Receives the refreshed tool list after the server sends
|
|
512
|
+
* `notifications/tools/list_changed`. Callers should use this to update any
|
|
513
|
+
* cached tool registrations.
|
|
514
|
+
* @param tools - Updated list of bridged tools.
|
|
515
|
+
*/
|
|
516
|
+
readonly onToolsChanged?: (tools: McpBridgedTool[]) => void;
|
|
517
|
+
/**
|
|
518
|
+
* Optional Makaio bus that receives MCP-backed `tool.list` and `tool.execute` handlers.
|
|
519
|
+
*
|
|
520
|
+
* When provided, the bridge exposes the connected MCP server's tools through
|
|
521
|
+
* the standard ToolSubjects contract while preserving the local handle API.
|
|
522
|
+
*/
|
|
523
|
+
readonly bus?: IMakaioBus;
|
|
524
|
+
/**
|
|
525
|
+
* Toolset name used for bus-visible MCP tools.
|
|
526
|
+
*
|
|
527
|
+
* Defaults to {@link extensionName}, matching detached extension identity.
|
|
528
|
+
*/
|
|
529
|
+
readonly toolsetName?: string;
|
|
530
|
+
/**
|
|
531
|
+
* Priority for bridge-owned bus handlers.
|
|
532
|
+
*
|
|
533
|
+
* Defaults above the regular tool registry so the bridge can merge `tool.list`
|
|
534
|
+
* results and route only the MCP tools it owns before delegating.
|
|
535
|
+
*/
|
|
536
|
+
readonly busHandlerPriority?: number;
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* Spawn an MCP server subprocess via stdio, connect to it as an MCP client,
|
|
540
|
+
* and discover its tool list.
|
|
541
|
+
*
|
|
542
|
+
* The spawned subprocess communicates over its stdin/stdout using the MCP
|
|
543
|
+
* JSON-RPC protocol. The SDK's {@link StdioClientTransport} manages the child
|
|
544
|
+
* process lifecycle; callers must call {@link McpClientBridgeHandle.close} to
|
|
545
|
+
* terminate it cleanly.
|
|
546
|
+
*
|
|
547
|
+
* When {@link McpClientBridgeOptions.onToolsChanged} is provided, the bridge
|
|
548
|
+
* subscribes to `notifications/tools/list_changed` via the SDK's built-in
|
|
549
|
+
* `listChanged.tools` handler so that tool list updates are propagated
|
|
550
|
+
* automatically. The handle's {@link McpClientBridgeHandle.tools} and
|
|
551
|
+
* {@link McpClientBridgeHandle.toolNames} getters reflect the latest known
|
|
552
|
+
* list, updated each time the server signals a change.
|
|
553
|
+
*
|
|
554
|
+
* If `listTools()` fails after the transport has already connected, the bridge
|
|
555
|
+
* closes the client and re-throws so no subprocess is left orphaned.
|
|
556
|
+
* @param options - Bridge configuration.
|
|
557
|
+
* @returns Handle exposing the live tool list and proxy methods.
|
|
558
|
+
*/
|
|
559
|
+
declare function startMcpClientBridge(options: McpClientBridgeOptions): Promise<McpClientBridgeHandle>;
|
|
560
|
+
//#endregion
|
|
561
|
+
export { APPROVE_TOOL_NAME, type CreateMcpServerOptions, type HttpMcpServerHandle, type HttpMcpServerOptions, type IMcpContextRegistry, type McpAgentContext, type McpBridgedTool, type McpCallToolResult, type McpClientBridgeHandle, type McpClientBridgeOptions, McpContextRegistry, type McpResolvedTools, McpServerBridgeService, type McpServerOptions, type McpToolDiscoveryIdentity, type McpToolDiscoveryOptions, type McpToolEntry, type PluginToolsetMap, type RequestToolApproval, type ResolveContextOverrides, type StdioMcpServerHandle, type ToolApproveRequestPayload, type ToolApproveResponse, createMcpRequestHandler, createMcpServer, resolveMcpTools, startHttpMcpServer, startMcpClientBridge, startMcpServer, toolInfoToMcpTool };
|