@makaio/framework 1.0.0-dev-1781022866275 → 1.0.0-dev-1781023871421
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 +5 -0
- package/dist/account-identity-DT5NOtFi.mjs +1 -0
- package/dist/adapter-C1eI-fGV.mjs +1 -0
- package/dist/adapters/acp-client/index.d.mts +6208 -0
- package/dist/adapters/acp-client/index.mjs +3 -0
- package/dist/adapters/config/index.d.mts +429 -0
- package/dist/adapters/config/index.mjs +1 -0
- package/dist/adapters/index.d.mts +4202 -0
- package/dist/adapters/index.mjs +18 -0
- package/dist/adapters/node.d.mts +263 -0
- package/dist/adapters/node.mjs +4 -0
- package/dist/adapters/stream-session/index.d.mts +1414 -0
- package/dist/adapters/stream-session/index.mjs +1 -0
- package/dist/adapters/stream-session/testing/index.d.mts +29 -0
- package/dist/adapters/stream-session/testing/index.mjs +1 -0
- package/dist/artifact-B3npq1cy.mjs +1 -0
- package/dist/base-orchestrator-wyumsn3b.d.mts +772 -0
- package/dist/bus/index.d.mts +3994 -0
- package/dist/bus/index.mjs +1 -0
- package/dist/bus-Caz3Jpbc.mjs +1 -0
- package/dist/bus-Hb-LGzgb.mjs +2 -0
- package/dist/capability-service-CJbmhfv9.mjs +1 -0
- package/dist/chunk-DTipWd-i.mjs +1 -0
- package/dist/chunk-cpUYaJdV.mjs +1 -0
- package/dist/cleanEnvForAdapter-KkYzQa1f.mjs +1 -0
- package/dist/client-bx74gm4R.mjs +1 -0
- package/dist/clients/index.d.mts +2639 -0
- package/dist/clients/index.mjs +2 -0
- package/dist/clients-namespace-GmSJpBUV.d.mts +332 -0
- package/dist/config-namespace-CPY9YsR8.d.mts +638 -0
- package/dist/config-namespace-ncYg2ct_.mjs +1 -0
- package/dist/contracts/adapter/index.d.mts +3 -0
- package/dist/contracts/adapter/index.mjs +1 -0
- package/dist/contracts/adapter/schemas/session-lineage.d.mts +2 -0
- package/dist/contracts/adapter/schemas/session-lineage.mjs +1 -0
- package/dist/contracts/artifact/index.d.mts +2 -0
- package/dist/contracts/artifact/index.mjs +1 -0
- package/dist/contracts/client/index.d.mts +3 -0
- package/dist/contracts/client/index.mjs +1 -0
- package/dist/contracts/common/index.d.mts +2 -0
- package/dist/contracts/common/index.mjs +1 -0
- package/dist/contracts/config/index.d.mts +455 -0
- package/dist/contracts/config/index.mjs +1 -0
- package/dist/contracts/extension/index.d.mts +4 -0
- package/dist/contracts/extension/index.mjs +1 -0
- package/dist/contracts/facet/index.d.mts +2 -0
- package/dist/contracts/facet/index.mjs +1 -0
- package/dist/contracts/harness/index.d.mts +2 -0
- package/dist/contracts/harness/index.mjs +1 -0
- package/dist/contracts/host/index.d.mts +2 -0
- package/dist/contracts/host/index.mjs +1 -0
- package/dist/contracts/index.d.mts +23046 -0
- package/dist/contracts/index.mjs +1 -0
- package/dist/contracts/materialization/index.d.mts +4 -0
- package/dist/contracts/materialization/index.mjs +1 -0
- package/dist/contracts/model-registry/index.d.mts +2 -0
- package/dist/contracts/model-registry/index.mjs +1 -0
- package/dist/contracts/native-session-supervisor/index.d.mts +2 -0
- package/dist/contracts/native-session-supervisor/index.mjs +1 -0
- package/dist/contracts/platform/index.d.mts +2 -0
- package/dist/contracts/platform/index.mjs +1 -0
- package/dist/contracts/provider/index.d.mts +3 -0
- package/dist/contracts/provider/index.mjs +1 -0
- package/dist/contracts/session/index.d.mts +3 -0
- package/dist/contracts/session/index.mjs +1 -0
- package/dist/contracts/shared/index.d.mts +2 -0
- package/dist/contracts/shared/index.mjs +1 -0
- package/dist/contracts/skill/index.d.mts +2 -0
- package/dist/contracts/skill/index.mjs +1 -0
- package/dist/contracts/telemetry/index.d.mts +2 -0
- package/dist/contracts/telemetry/index.mjs +1 -0
- package/dist/contracts/timeout/index.d.mts +2 -0
- package/dist/contracts/timeout/index.mjs +1 -0
- package/dist/contracts/toast/index.d.mts +198 -0
- package/dist/contracts/toast/index.mjs +1 -0
- package/dist/contracts/variant/index.d.mts +2 -0
- package/dist/contracts/variant/index.mjs +1 -0
- package/dist/core/index.d.mts +1263 -0
- package/dist/core/index.mjs +1 -0
- package/dist/credential-ref-YWQQENEo.mjs +1 -0
- package/dist/cursor-storage-CtVJ3JzB.mjs +1 -0
- package/dist/definition-BLCdXGzh.d.mts +383 -0
- package/dist/definition-CrgHIpTK.d.mts +60 -0
- package/dist/definition-DZMXOnjX.mjs +1 -0
- package/dist/definition-pkJ6szUl.d.mts +158 -0
- package/dist/drizzle-Eq8W1EbD.mjs +1 -0
- package/dist/event-Ca2yUf5i.mjs +1 -0
- package/dist/execution-target-CRPTfZlc.mjs +1 -0
- package/dist/extension-C-4BHMRI.mjs +1 -0
- package/dist/extension-CpIUgBKI.mjs +1 -0
- package/dist/extension-namespace-cMh_mMiL.mjs +1 -0
- package/dist/facet-BuwhrThl.mjs +1 -0
- package/dist/filesystem-service-B8rhBRgB.mjs +1 -0
- package/dist/filesystem-service-p_iJVHd4.d.mts +66 -0
- package/dist/git/index.d.mts +210 -0
- package/dist/git/index.mjs +18 -0
- package/dist/globby-rtWVaFHv.mjs +41 -0
- package/dist/handlers-CkTsQLra.mjs +41 -0
- package/dist/harness-BRCMcvQN.mjs +1 -0
- package/dist/hooks/index.d.mts +423 -0
- package/dist/hooks/index.mjs +1 -0
- package/dist/host-Br9VuOyr.mjs +1 -0
- package/dist/identity-Cz2IeEtm.mjs +1 -0
- package/dist/index-472sOmsW.d.mts +218 -0
- package/dist/index-8SZkg7s6.d.mts +353 -0
- package/dist/index-B3PK4FIn.d.mts +5116 -0
- package/dist/index-B80L4YqA.d.mts +180 -0
- package/dist/index-BFg9BUpx.d.mts +355 -0
- package/dist/index-BGfWS6GE.d.mts +483 -0
- package/dist/index-BVgfS-AJ.d.mts +109 -0
- package/dist/index-B_zQC98V.d.mts +995 -0
- package/dist/index-Bh_Ne7LF.d.mts +1008 -0
- package/dist/index-Bvb2mMH6.d.mts +1730 -0
- package/dist/index-CCGVh9BF2.d.mts +749 -0
- package/dist/index-CGmcS0Ma.d.mts +412 -0
- package/dist/index-CHQ1SqT0.d.mts +117 -0
- package/dist/index-CLpjm52M.d.mts +183 -0
- package/dist/index-Caig6TeF.d.mts +6746 -0
- package/dist/index-CelJCBjk.d.mts +2992 -0
- package/dist/index-ChunCFu4.d.mts +11 -0
- package/dist/index-Cm0dUkWL.d.mts +4651 -0
- package/dist/index-CokQYGVP.d.mts +184 -0
- package/dist/index-Cs0kZXIz2.d.mts +37 -0
- package/dist/index-D5d5HeWI2.d.mts +259 -0
- package/dist/index-D90OmGmV.d.mts +389 -0
- package/dist/index-D9MwJ2Q8.d.mts +67 -0
- package/dist/index-DANINzMu.d.mts +40 -0
- package/dist/index-DBw-89vC2.d.mts +3640 -0
- package/dist/index-DGBu6bHi2.d.mts +438 -0
- package/dist/index-DKC62dY5.d.mts +146 -0
- package/dist/index-DKia0MX1.d.mts +43 -0
- package/dist/index-DMKnON5s.d.mts +28 -0
- package/dist/index-DUaw0Dw8.d.mts +14747 -0
- package/dist/index-De3kPhlN.d.mts +72 -0
- package/dist/index-L4GjJDKb.d.mts +822 -0
- package/dist/index-U-A8eyGT.d.mts +1490 -0
- package/dist/index-eemAKwsB.d.mts +362 -0
- package/dist/index-mNec7V-9.d.mts +1075 -0
- package/dist/index-soFznFCy2.d.mts +89 -0
- package/dist/index-vtXJuwrz.d.mts +40 -0
- package/dist/index-x_lVDp_J.d.mts +134 -0
- package/dist/json-value-CmhSGMLv.mjs +1 -0
- package/dist/kernel/cli/index.d.mts +143 -0
- package/dist/kernel/cli/index.mjs +1 -0
- package/dist/kernel/cli/schemas.d.mts +64 -0
- package/dist/kernel/cli/schemas.mjs +1 -0
- package/dist/kernel/extension/index.d.mts +2 -0
- package/dist/kernel/extension/index.mjs +1 -0
- package/dist/kernel/index.d.mts +296 -0
- package/dist/kernel/index.mjs +1 -0
- package/dist/kernel/namespace/index.d.mts +2 -0
- package/dist/kernel/namespace/index.mjs +1 -0
- package/dist/kernel/observability/index.d.mts +2 -0
- package/dist/kernel/observability/index.mjs +1 -0
- package/dist/kernel/providers/index.d.mts +2 -0
- package/dist/kernel/providers/index.mjs +1 -0
- package/dist/kernel/window/index.d.mts +2 -0
- package/dist/kernel/window/index.mjs +1 -0
- package/dist/materialization-CuUBu4XI.mjs +1 -0
- package/dist/model-registry-CfXytvzx.mjs +1 -0
- package/dist/model-registry-Scn_MC2d.mjs +1 -0
- package/dist/namespace-5QQqbF-B.d.mts +3133 -0
- package/dist/namespace-BM7Djng9.d.mts +189 -0
- package/dist/namespace-BoD94mrN.mjs +1 -0
- package/dist/namespace-BwzZJqTV.mjs +1 -0
- package/dist/namespace-CFLAmQfh.mjs +1 -0
- package/dist/namespace-CTm3nEvh.d.mts +51 -0
- package/dist/namespace-CaaNnKcR.d.mts +921 -0
- package/dist/namespace-CaoZ3S78.d.mts +43 -0
- package/dist/namespace-CxhsoFUP.d.mts +607 -0
- package/dist/namespace-DD8Oiqo7.d.mts +580 -0
- package/dist/namespace-DLovh2Ws.d.mts +1313 -0
- package/dist/namespace-DgqkaOVu.d.mts +768 -0
- package/dist/namespace-DkRgbZYn.mjs +1 -0
- package/dist/namespace-Dr8K0MCp.d.mts +2047 -0
- package/dist/namespace-DuXK5AYN.mjs +1 -0
- package/dist/namespace-EQniz-Aw.d.mts +142 -0
- package/dist/namespace-IV1QK__V.d.mts +159 -0
- package/dist/namespace-LViZ-EQk.mjs +1 -0
- package/dist/namespace-TyiTsLFv.d.mts +3020 -0
- package/dist/namespace-Yna5-Pws.mjs +1 -0
- package/dist/namespace-xcmbQlxh.mjs +1 -0
- package/dist/native-session-supervisor-B1TnaPUF.mjs +1 -0
- package/dist/node/bus-server/index.d.mts +178 -0
- package/dist/node/bus-server/index.mjs +1 -0
- package/dist/node/bus-server/server-lifecycle.d.mts +2 -0
- package/dist/node/bus-server/server-lifecycle.mjs +1 -0
- package/dist/node/machine-identity/index.d.mts +85 -0
- package/dist/node/machine-identity/index.mjs +3 -0
- package/dist/node/transports/index.d.mts +1945 -0
- package/dist/node/transports/index.mjs +2 -0
- package/dist/orchestrator-shared-CIDiFJMD.mjs +1 -0
- package/dist/orchestrator-shared-Dfa7FMyw.d.mts +249 -0
- package/dist/package-DKVlsMP3.mjs +1 -0
- package/dist/platform-DZ7z-wXD.mjs +1 -0
- package/dist/profile-6ynCD5k3.mjs +1 -0
- package/dist/provider-context-CK6B4X_8.mjs +1 -0
- package/dist/providers/index.d.mts +135 -0
- package/dist/providers/index.mjs +1 -0
- package/dist/providers-namespace-DSEpli4A.d.mts +583 -0
- package/dist/providers-u8i15co9.mjs +1 -0
- package/dist/schema-CoyE6mPt.mjs +1 -0
- package/dist/schema-M5YTvSAG.d.mts +949 -0
- package/dist/schema-e0wU_lcV.mjs +1 -0
- package/dist/schema-introspection-Dn1jWQs1.mjs +1 -0
- package/dist/schemas-Bd0OjRQf.d.mts +46 -0
- package/dist/schemas-C46QfKzv.d.mts +459 -0
- package/dist/schemas-CDBSjg7o.d.mts +237 -0
- package/dist/schemas-CR1Rripy.mjs +1 -0
- package/dist/schemas-CVvwIfG4.mjs +1 -0
- package/dist/schemas-CaLhkkLn.mjs +1 -0
- package/dist/schemas-ClOOT1W6.d.mts +174 -0
- package/dist/schemas-DATniTHb.d.mts +182 -0
- package/dist/schemas-DE-GNmSD.mjs +1 -0
- package/dist/schemas-DVF1A4DF.d.mts +160 -0
- package/dist/schemas-DaRSfYLf.d.mts +73 -0
- package/dist/schemas-DiYVzG6e.d.mts +315 -0
- package/dist/schemas-hSrzflwZ.mjs +1 -0
- package/dist/schemas-j7ivZ2HI.d.mts +944 -0
- package/dist/schemas-jFe1AuI-.mjs +1 -0
- package/dist/schemas-wg_6PAdV.d.mts +153 -0
- package/dist/scoped-bus-04pwo1uM.mjs +1 -0
- package/dist/server-lifecycle-FXTPW39-.mjs +1 -0
- package/dist/server-lifecycle-YoSGFGnU.d.mts +160 -0
- package/dist/service-base/index.d.mts +98 -0
- package/dist/service-base/index.mjs +1 -0
- package/dist/services/adapter-runtime/index.d.mts +4 -0
- package/dist/services/adapter-runtime/index.mjs +1 -0
- package/dist/services/adapter-runtime/namespace.d.mts +2 -0
- package/dist/services/adapter-runtime/namespace.mjs +1 -0
- package/dist/services/adapter-runtime/schemas.d.mts +2 -0
- package/dist/services/adapter-runtime/schemas.mjs +1 -0
- package/dist/services/adapter-subsystem/index.d.mts +3 -0
- package/dist/services/adapter-subsystem/index.mjs +1 -0
- package/dist/services/adapter-subsystem/namespace.d.mts +2 -0
- package/dist/services/adapter-subsystem/namespace.mjs +1 -0
- package/dist/services/agent-runtime/index.d.mts +3 -0
- package/dist/services/agent-runtime/index.mjs +1 -0
- package/dist/services/agent-runtime/namespace.d.mts +2 -0
- package/dist/services/agent-runtime/namespace.mjs +1 -0
- package/dist/services/agent-runtime/schemas.d.mts +2 -0
- package/dist/services/agent-runtime/schemas.mjs +1 -0
- package/dist/services/capability/index.d.mts +2 -0
- package/dist/services/capability/index.mjs +1 -0
- package/dist/services/cli-detection/namespace.d.mts +56 -0
- package/dist/services/cli-detection/namespace.mjs +1 -0
- package/dist/services/codebase/index.d.mts +3 -0
- package/dist/services/codebase/index.mjs +1 -0
- package/dist/services/codebase/namespace.d.mts +2 -0
- package/dist/services/codebase/namespace.mjs +1 -0
- package/dist/services/codebase/schemas.d.mts +2 -0
- package/dist/services/codebase/schemas.mjs +1 -0
- package/dist/services/compression/index.d.mts +3 -0
- package/dist/services/compression/index.mjs +1 -0
- package/dist/services/compression/namespace.d.mts +2 -0
- package/dist/services/compression/namespace.mjs +1 -0
- package/dist/services/compression/schemas.d.mts +2 -0
- package/dist/services/compression/schemas.mjs +1 -0
- package/dist/services/context-rules/index.d.mts +412 -0
- package/dist/services/context-rules/index.mjs +1 -0
- package/dist/services/credential-change/index.d.mts +17 -0
- package/dist/services/credential-change/index.mjs +1 -0
- package/dist/services/definition/index.d.mts +2 -0
- package/dist/services/definition/index.mjs +1 -0
- package/dist/services/definition/namespace.d.mts +71 -0
- package/dist/services/definition/namespace.mjs +1 -0
- package/dist/services/definition/schemas.d.mts +38 -0
- package/dist/services/definition/schemas.mjs +1 -0
- package/dist/services/dialog/namespace.d.mts +105 -0
- package/dist/services/dialog/namespace.mjs +1 -0
- package/dist/services/dialog/schemas.d.mts +109 -0
- package/dist/services/dialog/schemas.mjs +1 -0
- package/dist/services/execution-target/index.d.mts +4 -0
- package/dist/services/execution-target/index.mjs +1 -0
- package/dist/services/execution-target/namespace.d.mts +2 -0
- package/dist/services/execution-target/namespace.mjs +1 -0
- package/dist/services/execution-target/schemas.d.mts +2 -0
- package/dist/services/execution-target/schemas.mjs +1 -0
- package/dist/services/filesystem/index.d.mts +3 -0
- package/dist/services/filesystem/index.mjs +1 -0
- package/dist/services/filesystem/namespace.d.mts +432 -0
- package/dist/services/filesystem/namespace.mjs +1 -0
- package/dist/services/filesystem/schemas.d.mts +240 -0
- package/dist/services/filesystem/schemas.mjs +1 -0
- package/dist/services/git/namespace.d.mts +1163 -0
- package/dist/services/git/namespace.mjs +1 -0
- package/dist/services/git/schemas.d.mts +932 -0
- package/dist/services/git/schemas.mjs +1 -0
- package/dist/services/harness/index.d.mts +861 -0
- package/dist/services/harness/index.mjs +1 -0
- package/dist/services/harness/storage/schema.d.mts +424 -0
- package/dist/services/harness/storage/schema.mjs +1 -0
- package/dist/services/index.d.mts +6185 -0
- package/dist/services/index.mjs +1 -0
- package/dist/services/local-notification/index.d.mts +25 -0
- package/dist/services/local-notification/index.mjs +1 -0
- package/dist/services/local-notification/namespace.d.mts +73 -0
- package/dist/services/local-notification/namespace.mjs +1 -0
- package/dist/services/local-notification/schemas.d.mts +88 -0
- package/dist/services/local-notification/schemas.mjs +1 -0
- package/dist/services/log-import/browser.d.mts +3 -0
- package/dist/services/log-import/browser.mjs +1 -0
- package/dist/services/log-import/index.d.mts +274 -0
- package/dist/services/log-import/index.mjs +2 -0
- package/dist/services/log-import/log-import.d.mts +3 -0
- package/dist/services/log-import/log-import.mjs +1 -0
- package/dist/services/log-import/namespace.d.mts +327 -0
- package/dist/services/log-import/namespace.mjs +1 -0
- package/dist/services/log-import/schemas.d.mts +217 -0
- package/dist/services/log-import/schemas.mjs +1 -0
- package/dist/services/model-registry/index.d.mts +2 -0
- package/dist/services/model-registry/index.mjs +1 -0
- package/dist/services/preferences/index.d.mts +3 -0
- package/dist/services/preferences/index.mjs +1 -0
- package/dist/services/preferences/schemas.d.mts +2 -0
- package/dist/services/preferences/schemas.mjs +1 -0
- package/dist/services/preferences/storage-namespace.d.mts +3 -0
- package/dist/services/preferences/storage-namespace.mjs +1 -0
- package/dist/services/provider-context/index.d.mts +2 -0
- package/dist/services/provider-context/index.mjs +1 -0
- package/dist/services/provider-runtime/index.d.mts +136 -0
- package/dist/services/provider-runtime/index.mjs +1 -0
- package/dist/services/session/handlers/index.d.mts +2 -0
- package/dist/services/session/handlers/index.mjs +1 -0
- package/dist/services/session/index.d.mts +10 -0
- package/dist/services/session/index.mjs +1 -0
- package/dist/services/session/messages/namespace.d.mts +2 -0
- package/dist/services/session/messages/namespace.mjs +1 -0
- package/dist/services/session/orchestrator-testing/index.d.mts +2 -0
- package/dist/services/session/orchestrator-testing/index.mjs +1 -0
- package/dist/services/session/session-events/namespace.d.mts +2 -0
- package/dist/services/session/session-events/namespace.mjs +1 -0
- package/dist/services/session/storage/namespace.d.mts +2 -0
- package/dist/services/session/storage/namespace.mjs +1 -0
- package/dist/services/session/storage/schema.d.mts +2 -0
- package/dist/services/session/storage/schema.mjs +1 -0
- package/dist/services/session/testing/index.d.mts +35 -0
- package/dist/services/session/testing/index.mjs +65 -0
- package/dist/services/session/testing/orchestrator-shared.d.mts +2 -0
- package/dist/services/session/testing/orchestrator-shared.mjs +1 -0
- package/dist/services/session/turns/namespace.d.mts +2 -0
- package/dist/services/session/turns/namespace.mjs +1 -0
- package/dist/services/session-editor/index.d.mts +119 -0
- package/dist/services/session-editor/index.mjs +1 -0
- package/dist/services/settings/index.d.mts +47 -0
- package/dist/services/settings/index.mjs +1 -0
- package/dist/services/settings/namespace.d.mts +663 -0
- package/dist/services/settings/namespace.mjs +1 -0
- package/dist/services/settings/storage/clients-namespace.d.mts +2 -0
- package/dist/services/settings/storage/clients-namespace.mjs +1 -0
- package/dist/services/settings/storage/extension-configs/namespace.d.mts +184 -0
- package/dist/services/settings/storage/extension-configs/namespace.mjs +1 -0
- package/dist/services/settings/storage/index.d.mts +4 -0
- package/dist/services/settings/storage/index.mjs +1 -0
- package/dist/services/settings/storage/providers-namespace.d.mts +2 -0
- package/dist/services/settings/storage/providers-namespace.mjs +1 -0
- package/dist/services/subagent/index.d.mts +2 -0
- package/dist/services/subagent/index.mjs +1 -0
- package/dist/services/subagent-template/index.d.mts +3 -0
- package/dist/services/subagent-template/index.mjs +1 -0
- package/dist/services/subagent-template/namespace.d.mts +2 -0
- package/dist/services/subagent-template/namespace.mjs +1 -0
- package/dist/services/subagent-template/schemas.d.mts +2 -0
- package/dist/services/subagent-template/schemas.mjs +1 -0
- package/dist/services/tool-approval/index.d.mts +2 -0
- package/dist/services/tool-approval/index.mjs +1 -0
- package/dist/services/tools/index.d.mts +2 -0
- package/dist/services/tools/index.mjs +1 -0
- package/dist/services/tray-menu/index.d.mts +4 -0
- package/dist/services/tray-menu/index.mjs +1 -0
- package/dist/services/tray-menu/namespace.d.mts +2 -0
- package/dist/services/tray-menu/namespace.mjs +1 -0
- package/dist/services/tray-menu/schemas.d.mts +2 -0
- package/dist/services/tray-menu/schemas.mjs +1 -0
- package/dist/services/turn/index.d.mts +2 -0
- package/dist/services/turn/index.mjs +1 -0
- package/dist/services/turn/namespace.d.mts +2 -0
- package/dist/services/turn/namespace.mjs +1 -0
- package/dist/services/turn/schemas.d.mts +335 -0
- package/dist/services/turn/schemas.mjs +1 -0
- package/dist/session-BoldSdNZ2.mjs +134 -0
- package/dist/session-DuVOYctZ.mjs +1 -0
- package/dist/session-lineage-CRsc9g1x.d.mts +65 -0
- package/dist/shared-DpOEfD8F.mjs +1 -0
- package/dist/shared-schemas-CPShiLNp.mjs +1 -0
- package/dist/skill-CQO4mDqK.mjs +1 -0
- package/dist/storage/drizzle/client.d.mts +78 -0
- package/dist/storage/drizzle/client.mjs +1 -0
- package/dist/storage/drizzle/index.d.mts +137 -0
- package/dist/storage/drizzle/index.mjs +1 -0
- package/dist/storage/handlers/drizzle/index.d.mts +2 -0
- package/dist/storage/handlers/drizzle/index.mjs +1 -0
- package/dist/storage/handlers/index.d.mts +33 -0
- package/dist/storage/handlers/index.mjs +1 -0
- package/dist/storage/index.d.mts +192 -0
- package/dist/storage/index.mjs +1 -0
- package/dist/storage-namespace-BXkoh5Sy.d.mts +221 -0
- package/dist/storage-namespace-DWsYLAXa.mjs +1 -0
- package/dist/storage-namespace-definition-Bkx5rSto.d.mts +17 -0
- package/dist/storage-namespace-definition-CqSdsuCC.mjs +1 -0
- package/dist/style.css +3782 -0
- package/dist/telemetry-CvdLBWuk.mjs +1 -0
- package/dist/testing/drizzle-harness.d.mts +130 -0
- package/dist/testing/drizzle-harness.mjs +1 -0
- package/dist/testing/index.d.mts +106 -0
- package/dist/testing/index.mjs +1 -0
- package/dist/timeout-XsYIOKrc.mjs +1 -0
- package/dist/tool-approval-service-BvZWhYZp.mjs +1 -0
- package/dist/tools/index.d.mts +835 -0
- package/dist/tools/index.mjs +1 -0
- package/dist/tools/testing/index.d.mts +53 -0
- package/dist/tools/testing/index.mjs +1 -0
- package/dist/tools-D-luYcDw.mjs +1431 -0
- package/dist/tray-menu-service-DuXq5k22.mjs +1 -0
- package/dist/types-BCMUtBj1.d.mts +1106 -0
- package/dist/types-C2Ob9zz_.d.mts +128 -0
- package/dist/types-CCdqjeuH.d.mts +262 -0
- package/dist/types-DZHvOc_Q.d.mts +305 -0
- package/dist/types-Dy3YTcTF.d.mts +6777 -0
- package/dist/types-MfJZ67e9.d.mts +315 -0
- package/dist/types-dyP-bXXE.d.mts +31 -0
- package/dist/ui-components/index.d.mts +2342 -0
- package/dist/ui-components/index.mjs +8 -0
- package/dist/ui-config-9bDRwFZr.mjs +1 -0
- package/dist/ui-hooks/index.d.mts +1915 -0
- package/dist/ui-hooks/index.mjs +1 -0
- package/dist/ui-kernel/index.d.mts +2793 -0
- package/dist/ui-kernel/index.mjs +1 -0
- package/dist/ui-kernel/pages/namespace.d.mts +88 -0
- package/dist/ui-kernel/pages/namespace.mjs +1 -0
- package/dist/ui-kernel/pages/schemas.d.mts +2 -0
- package/dist/ui-kernel/pages/schemas.mjs +1 -0
- package/dist/ui-views/index.d.mts +487 -0
- package/dist/ui-views/index.mjs +30 -0
- package/dist/utils/health-probe.d.mts +26 -0
- package/dist/utils/health-probe.mjs +1 -0
- package/dist/utils/index.d.mts +262 -0
- package/dist/utils/index.mjs +2 -0
- package/dist/utils/keychain.d.mts +31 -0
- package/dist/utils/keychain.mjs +1 -0
- package/dist/utils/project-manifest.d.mts +130 -0
- package/dist/utils/project-manifest.mjs +1 -0
- package/dist/utils/resolve-package-root.d.mts +12 -0
- package/dist/utils/resolve-package-root.mjs +1 -0
- package/dist/utils/scope-paths.d.mts +33 -0
- package/dist/utils/scope-paths.mjs +1 -0
- package/dist/utils/workspace-packages.d.mts +59 -0
- package/dist/utils/workspace-packages.mjs +1 -0
- package/dist/utils/workspace-root.d.mts +24 -0
- package/dist/utils/workspace-root.mjs +2 -0
- package/dist/variant-CT6XBP6T.mjs +1 -0
- package/dist/version-BeT3ASEe.mjs +1 -0
- package/dist/visibility-Cb62p9bv.mjs +1 -0
- package/dist/window-registry-CBcrGTv4.d.mts +130 -0
- package/dist/window-registry-DW-dKRjQ.mjs +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1106 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ExtractSubjectPayload, ExtractSubjectResponse, HandlerForSubjectDefinition, ScopedSubjectDefinition, SubjectRecord } from "@makaio/framework/core";
|
|
3
|
+
import { IFilteredBus, IMakaioBus, OnOptions, ScopedBus } from "@makaio/framework/bus";
|
|
4
|
+
import { AIModel, AIReasoningLevel, AIReasoningLevel as AIReasoningLevel$1, AgentSchemas, AgentSubjects, JsonValue, McpRuntimeSessionContext, McpSessionContext, McpToolState, Message, MessageBlock, MessageDeliveryMode, MessageDeliveryMode as MessageDeliveryMode$1, MessageInput, MessageOutcome, ProviderContext, ReasoningLevelMap as ReasoningLevelMap$1, ResponseSchemaDescriptor, SendMessageResultInnerResult, SessionContext, StructuredOutputValidation, SystemPrompt, ToolListItem } from "@makaio/framework/contracts";
|
|
5
|
+
import { DeferredPromise, TimeoutConfig, TrackedTimeoutConfig } from "@makaio/framework/utils";
|
|
6
|
+
import { SetRequired } from "type-fest";
|
|
7
|
+
|
|
8
|
+
//#region adapters/core/src/agent/session-tool-ledger.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* Single tool tracked in the session ledger.
|
|
11
|
+
* Accumulates injection, discovery, and call history across the session lifetime.
|
|
12
|
+
*/
|
|
13
|
+
interface ToolLedgerEntry {
|
|
14
|
+
/** Namespaced tool name, e.g. "github__create_issue" */
|
|
15
|
+
readonly fullName: string;
|
|
16
|
+
/** Original tool name without server prefix, e.g. "create_issue" */
|
|
17
|
+
readonly originalName: string;
|
|
18
|
+
/** MCP server that provides the tool, e.g. "github" */
|
|
19
|
+
readonly serverName: string;
|
|
20
|
+
/** Whether the tool is currently in the direct-injection set */
|
|
21
|
+
injected: boolean;
|
|
22
|
+
/** Turn number when this tool was last included in the injection set */
|
|
23
|
+
lastInjectedAtTurn: number | undefined;
|
|
24
|
+
/** Whether the model has seen this tool via mcp_discover or mcp_call */
|
|
25
|
+
discovered: boolean;
|
|
26
|
+
/** Turn number when this tool was first discovered (set once, never overwritten) */
|
|
27
|
+
firstDiscoveredAtTurn: number | undefined;
|
|
28
|
+
/** Total number of mcp_call invocations across the session */
|
|
29
|
+
callCount: number;
|
|
30
|
+
/** Turn number of the most recent mcp_call invocation */
|
|
31
|
+
lastCalledAtTurn: number | undefined;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Narrowed view of McpSessionContext that the ledger needs.
|
|
35
|
+
* Decouples the ledger from the full session context shape.
|
|
36
|
+
*/
|
|
37
|
+
interface LedgerSessionContext {
|
|
38
|
+
/** Tools resolved for direct injection in this session */
|
|
39
|
+
readonly directTools: readonly McpToolState[];
|
|
40
|
+
/** Tools available for discovery (not direct-injected) */
|
|
41
|
+
readonly discoverableTools: readonly McpToolState[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Public contract for the session-scoped tool ledger.
|
|
45
|
+
* Tracks injection, discovery, and call state for all MCP tools during a session.
|
|
46
|
+
*/
|
|
47
|
+
interface ISessionToolLedger {
|
|
48
|
+
/**
|
|
49
|
+
* Replace the current injection set with the provided list.
|
|
50
|
+
* Tools not in the new list have their `injected` flag cleared (eviction sweep).
|
|
51
|
+
* @param tools - The new set of directly-injected tools
|
|
52
|
+
* @param turnNumber - The current turn number
|
|
53
|
+
*/
|
|
54
|
+
recordInjection(tools: readonly ToolListItem[], turnNumber: number): void;
|
|
55
|
+
/**
|
|
56
|
+
* Record that the model discovered a tool.
|
|
57
|
+
* Applies first-discovery semantics: `firstDiscoveredAtTurn` is set only once.
|
|
58
|
+
* @param toolFullName - The namespaced tool name, e.g. "github__create_issue"
|
|
59
|
+
* @param turnNumber - The current turn number
|
|
60
|
+
*/
|
|
61
|
+
recordDiscovery(toolFullName: string, turnNumber: number): void;
|
|
62
|
+
/**
|
|
63
|
+
* Record one mcp_call invocation for a tool.
|
|
64
|
+
* Implies discovery: also sets `discovered` and `firstDiscoveredAtTurn` if unset.
|
|
65
|
+
* @param toolFullName - The namespaced tool name, e.g. "github__create_issue"
|
|
66
|
+
* @param turnNumber - The current turn number
|
|
67
|
+
*/
|
|
68
|
+
recordCall(toolFullName: string, turnNumber: number): void;
|
|
69
|
+
/**
|
|
70
|
+
* Return all entries where `injected === true`.
|
|
71
|
+
* @returns Snapshot of currently-injected tool entries
|
|
72
|
+
*/
|
|
73
|
+
getInjectedTools(): readonly ToolLedgerEntry[];
|
|
74
|
+
/**
|
|
75
|
+
* Return the total call count for a tool, or 0 if not tracked.
|
|
76
|
+
* @param toolFullName - The namespaced tool name
|
|
77
|
+
* @returns Call count (0 for unknown tools)
|
|
78
|
+
*/
|
|
79
|
+
getCallCount(toolFullName: string): number;
|
|
80
|
+
/**
|
|
81
|
+
* Return a single ledger entry by full name, or undefined if not tracked.
|
|
82
|
+
* @param toolFullName - The namespaced tool name
|
|
83
|
+
* @returns The entry, or undefined
|
|
84
|
+
*/
|
|
85
|
+
getEntry(toolFullName: string): ToolLedgerEntry | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Return all tracked entries regardless of state.
|
|
88
|
+
* @returns Snapshot of all ledger entries
|
|
89
|
+
*/
|
|
90
|
+
getAllEntries(): readonly ToolLedgerEntry[];
|
|
91
|
+
/**
|
|
92
|
+
* Phase 2 seam: suggest the optimal injection set for the next turn.
|
|
93
|
+
* Phase 1 pass-through: returns `context.directTools` mapped to ToolListItem format.
|
|
94
|
+
* @param context - Current session context providing direct and discoverable tools
|
|
95
|
+
* @param currentTurnNumber - The current turn number (for future scoring heuristics)
|
|
96
|
+
* @returns Suggested list of tools to inject for the next turn
|
|
97
|
+
*/
|
|
98
|
+
suggestInjectionSet(context: LedgerSessionContext, currentTurnNumber: number): Promise<readonly ToolListItem[]>;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Agent-scoped ledger that tracks every MCP tool's injection, discovery, and
|
|
102
|
+
* call history within a single agent lifecycle.
|
|
103
|
+
*
|
|
104
|
+
* One instance is created per agent factory call and discarded when
|
|
105
|
+
* the agent is torn down. If the adapter switches connectors mid-session
|
|
106
|
+
* (e.g. model swap), the same ledger is passed to the new connector so
|
|
107
|
+
* history is preserved across the connector boundary.
|
|
108
|
+
*
|
|
109
|
+
* Follows the same plain-class, no-bus pattern as {@link ToolCallTracker}.
|
|
110
|
+
*/
|
|
111
|
+
declare class SessionToolLedger implements ISessionToolLedger {
|
|
112
|
+
private readonly entries;
|
|
113
|
+
/**
|
|
114
|
+
* Upsert an entry for the given full name, creating it if absent.
|
|
115
|
+
* @param fullName - Namespaced tool name
|
|
116
|
+
* @returns The existing or newly-created entry (mutable reference)
|
|
117
|
+
*/
|
|
118
|
+
private upsert;
|
|
119
|
+
/**
|
|
120
|
+
* Replace the current injection set with the provided list.
|
|
121
|
+
* Tools absent from the new list have their `injected` flag cleared (eviction sweep).
|
|
122
|
+
* @param tools - The new set of directly-injected tools
|
|
123
|
+
* @param turnNumber - The current turn number
|
|
124
|
+
*/
|
|
125
|
+
recordInjection(tools: readonly ToolListItem[], turnNumber: number): void;
|
|
126
|
+
/**
|
|
127
|
+
* Record that the model discovered a tool.
|
|
128
|
+
* Applies first-discovery semantics: `firstDiscoveredAtTurn` is only set once.
|
|
129
|
+
* @param toolFullName - The namespaced tool name, e.g. "github__create_issue"
|
|
130
|
+
* @param turnNumber - The current turn number
|
|
131
|
+
*/
|
|
132
|
+
recordDiscovery(toolFullName: string, turnNumber: number): void;
|
|
133
|
+
/**
|
|
134
|
+
* Record one mcp_call invocation for a tool.
|
|
135
|
+
* Implies discovery: also sets `discovered` and `firstDiscoveredAtTurn` if unset.
|
|
136
|
+
* @param toolFullName - The namespaced tool name, e.g. "github__create_issue"
|
|
137
|
+
* @param turnNumber - The current turn number
|
|
138
|
+
*/
|
|
139
|
+
recordCall(toolFullName: string, turnNumber: number): void;
|
|
140
|
+
/**
|
|
141
|
+
* Return all entries where `injected === true`.
|
|
142
|
+
* @returns Snapshot of currently-injected tool entries
|
|
143
|
+
*/
|
|
144
|
+
getInjectedTools(): readonly ToolLedgerEntry[];
|
|
145
|
+
/**
|
|
146
|
+
* Return the total call count for a tool, or 0 if not tracked.
|
|
147
|
+
* @param toolFullName - The namespaced tool name
|
|
148
|
+
* @returns Call count (0 for unknown tools)
|
|
149
|
+
*/
|
|
150
|
+
getCallCount(toolFullName: string): number;
|
|
151
|
+
/**
|
|
152
|
+
* Return a single ledger entry by full name, or undefined if not tracked.
|
|
153
|
+
* @param toolFullName - The namespaced tool name
|
|
154
|
+
* @returns The entry, or undefined
|
|
155
|
+
*/
|
|
156
|
+
getEntry(toolFullName: string): ToolLedgerEntry | undefined;
|
|
157
|
+
/**
|
|
158
|
+
* Return all tracked entries regardless of state.
|
|
159
|
+
* @returns Snapshot of all ledger entries
|
|
160
|
+
*/
|
|
161
|
+
getAllEntries(): readonly ToolLedgerEntry[];
|
|
162
|
+
/**
|
|
163
|
+
* Phase 1 pass-through: return `context.directTools` mapped to ToolListItem format.
|
|
164
|
+
* Phase 2 will replace this with a scoring heuristic that factors in call history
|
|
165
|
+
* and discovery patterns.
|
|
166
|
+
* @param context - Current session context providing direct and discoverable tools
|
|
167
|
+
* @param _currentTurnNumber - The current turn number (reserved for Phase 2 scoring heuristics)
|
|
168
|
+
* @returns Suggested list of tools to inject for the next turn
|
|
169
|
+
*/
|
|
170
|
+
suggestInjectionSet(context: LedgerSessionContext, _currentTurnNumber: number): Promise<readonly ToolListItem[]>;
|
|
171
|
+
}
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region node_modules/emittery/index.d.ts
|
|
174
|
+
/**
|
|
175
|
+
Removes an event subscription.
|
|
176
|
+
*/
|
|
177
|
+
type UnsubscribeFunction = () => void;
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region adapters/core/src/message-handle/types.d.ts
|
|
180
|
+
/**
|
|
181
|
+
* Result of a message operation.
|
|
182
|
+
*/
|
|
183
|
+
type MessageResult = {
|
|
184
|
+
result?: SendMessageResultInnerResult | null;
|
|
185
|
+
error?: Error | string;
|
|
186
|
+
outcome: MessageOutcome; /** Present when outcome='superseded': the messageId that replaced this one */
|
|
187
|
+
supersededBy?: string; /** Present when outcome='merged': the messageId this was folded into */
|
|
188
|
+
mergedInto?: string;
|
|
189
|
+
/**
|
|
190
|
+
* Structured-output validation result for this turn.
|
|
191
|
+
* Present only when a {@link ResponseSchemaDescriptor} was active and validation ran.
|
|
192
|
+
*/
|
|
193
|
+
structuredOutputValidation?: StructuredOutputValidation;
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Lifecycle states for a queued message.
|
|
197
|
+
*/
|
|
198
|
+
type MessageState = 'queued' | 'acknowledged' | 'completed' | 'cancelled';
|
|
199
|
+
/**
|
|
200
|
+
* Options for sending a message.
|
|
201
|
+
*/
|
|
202
|
+
interface SendMessageOptions {
|
|
203
|
+
/**
|
|
204
|
+
* Custom identifier for message tracking (generated if not provided).
|
|
205
|
+
*/
|
|
206
|
+
messageId?: string;
|
|
207
|
+
/**
|
|
208
|
+
* Controls delivery behavior.
|
|
209
|
+
* @defaultValue 'enqueue'
|
|
210
|
+
*/
|
|
211
|
+
deliveryMode?: MessageDeliveryMode;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Options bag used when creating a message handle.
|
|
215
|
+
*
|
|
216
|
+
* Passed to {@link MessageHandle} via `AIAgentConnector.createMessageHandle`.
|
|
217
|
+
*/
|
|
218
|
+
interface MessageHandleOptions {
|
|
219
|
+
/** Optional stable message identifier; autogenerated when omitted. */
|
|
220
|
+
messageId?: string;
|
|
221
|
+
/** Optional delivery semantics for queue processing. */
|
|
222
|
+
deliveryMode?: MessageDeliveryMode;
|
|
223
|
+
/** Optional prior conversation messages to materialize for the turn. */
|
|
224
|
+
messageHistory?: Message[];
|
|
225
|
+
/** Optional per-turn metadata/context payload for prompt materialization. */
|
|
226
|
+
turnContext?: Record<string, JsonValue>;
|
|
227
|
+
/**
|
|
228
|
+
* Per-turn structured-output schema descriptor.
|
|
229
|
+
* When set, the agent's structured-output manager validates the terminal
|
|
230
|
+
* message against this schema before emitting completion events.
|
|
231
|
+
*/
|
|
232
|
+
responseSchema?: ResponseSchemaDescriptor;
|
|
233
|
+
/**
|
|
234
|
+
* Whether this message handle was created for an internal retry turn.
|
|
235
|
+
* When `true`, the `onMessageSent` callback is suppressed so no
|
|
236
|
+
* `user_message.sent` event is emitted for the synthetic retry message.
|
|
237
|
+
*/
|
|
238
|
+
internalRetry?: boolean;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Processing state for agent orchestration.
|
|
242
|
+
*/
|
|
243
|
+
type ProcessingState = 'idle' | 'processing_started' | 'turn_started' | 'step_started' | 'step_finished' | 'turn_finished' | 'processing_finished' | 'active' | 'paused';
|
|
244
|
+
//#endregion
|
|
245
|
+
//#region adapters/core/src/utils/normalizeMessageInput.d.ts
|
|
246
|
+
type NormalizedMessageInput = Required<Message> & {
|
|
247
|
+
blocks: MessageBlock[];
|
|
248
|
+
message?: string;
|
|
249
|
+
};
|
|
250
|
+
/**
|
|
251
|
+
* Normalizes various MessageInput formats into a consistent structure with blocks and optional message text.
|
|
252
|
+
* @param input - The message input to normalize (string or Message object)
|
|
253
|
+
* @returns Normalized message with role, blocks array, and optional message text
|
|
254
|
+
*/
|
|
255
|
+
declare function normalizeMessageInput(input: MessageInput): NormalizedMessageInput;
|
|
256
|
+
//#endregion
|
|
257
|
+
//#region adapters/core/src/message-handle/message-handle.d.ts
|
|
258
|
+
type CompletionTransform = (result: MessageResult) => MessageResult | Promise<MessageResult>;
|
|
259
|
+
type CompletionObserver = (result: MessageResult) => void;
|
|
260
|
+
type CompletionNotification = (handle: MessageHandle, result: MessageResult) => void | Promise<void>;
|
|
261
|
+
declare class MessageHandle {
|
|
262
|
+
readonly messageId: string;
|
|
263
|
+
readonly message: NormalizedMessageInput;
|
|
264
|
+
readonly deliveryMode: MessageDeliveryMode;
|
|
265
|
+
/**
|
|
266
|
+
* Per-turn structured-output schema descriptor.
|
|
267
|
+
* When present, the agent validates the terminal message against this
|
|
268
|
+
* schema before resolving completion and emitting terminal events.
|
|
269
|
+
*/
|
|
270
|
+
readonly responseSchema?: ResponseSchemaDescriptor | undefined;
|
|
271
|
+
/**
|
|
272
|
+
* Internal structured-output retry turns must stay hidden from user-message
|
|
273
|
+
* lifecycle events while still taking precedence over queued user turns.
|
|
274
|
+
*/
|
|
275
|
+
readonly internalRetry: boolean;
|
|
276
|
+
protected readonly deferredCompletion: DeferredPromise<MessageResult>;
|
|
277
|
+
protected readonly deferredAcknowledgement: DeferredPromise<boolean>;
|
|
278
|
+
state: MessageState;
|
|
279
|
+
private isAcknowledged;
|
|
280
|
+
private completionResult;
|
|
281
|
+
private completionStarted;
|
|
282
|
+
private readonly completionTransforms;
|
|
283
|
+
private readonly completionObservers;
|
|
284
|
+
/** If this message was merged into another, the winner's messageId */
|
|
285
|
+
mergedInto?: string;
|
|
286
|
+
/** If this is the merge winner, messageIds that were folded in */
|
|
287
|
+
mergedFrom?: string[];
|
|
288
|
+
/** If this message was superseded by replace/immediate, the replacer's messageId */
|
|
289
|
+
supersededBy?: string;
|
|
290
|
+
/** Adapter session ID - resolved when processing starts */
|
|
291
|
+
private readonly deferredAdapterSessionId;
|
|
292
|
+
private _adapterSessionId?;
|
|
293
|
+
/** Curated message history from sessionContext (mutable for merge propagation) */
|
|
294
|
+
private _messageHistory?;
|
|
295
|
+
/** Turn-scoped context from PreUserMessage hooks (mutable for merge propagation) */
|
|
296
|
+
private _turnContext?;
|
|
297
|
+
constructor(messageId: string, message: NormalizedMessageInput, deliveryMode: MessageDeliveryMode, /** Curated message history from sessionContext */
|
|
298
|
+
|
|
299
|
+
messageHistory?: Message[], /** Turn-scoped context from PreUserMessage hooks */
|
|
300
|
+
|
|
301
|
+
turnContext?: Record<string, JsonValue>,
|
|
302
|
+
/**
|
|
303
|
+
* Per-turn structured-output schema descriptor.
|
|
304
|
+
* When present, the agent validates the terminal message against this
|
|
305
|
+
* schema before resolving completion and emitting terminal events.
|
|
306
|
+
*/
|
|
307
|
+
|
|
308
|
+
responseSchema?: ResponseSchemaDescriptor | undefined,
|
|
309
|
+
/**
|
|
310
|
+
* Internal structured-output retry turns must stay hidden from user-message
|
|
311
|
+
* lifecycle events while still taking precedence over queued user turns.
|
|
312
|
+
*/
|
|
313
|
+
|
|
314
|
+
internalRetry?: boolean);
|
|
315
|
+
/**
|
|
316
|
+
* Curated message history from sessionContext
|
|
317
|
+
* @returns The message history array or undefined if not set
|
|
318
|
+
*/
|
|
319
|
+
get messageHistory(): Message[] | undefined;
|
|
320
|
+
/** Set messageHistory (used by merge strategies to propagate history) */
|
|
321
|
+
set messageHistory(value: Message[] | undefined);
|
|
322
|
+
/**
|
|
323
|
+
* Turn-scoped context from PreUserMessage hooks
|
|
324
|
+
* @returns The turn context record or undefined if not set
|
|
325
|
+
*/
|
|
326
|
+
get turnContext(): Record<string, JsonValue> | undefined;
|
|
327
|
+
/** Set turnContext (used by merge strategies to propagate context) */
|
|
328
|
+
set turnContext(value: Record<string, JsonValue> | undefined);
|
|
329
|
+
/**
|
|
330
|
+
* Get adapter session ID synchronously (undefined if not yet set)
|
|
331
|
+
* @returns The adapter session ID or undefined if not yet set
|
|
332
|
+
*/
|
|
333
|
+
get adapterSessionId(): string | undefined;
|
|
334
|
+
/**
|
|
335
|
+
* Set adapter session ID (called by connector when processing starts)
|
|
336
|
+
*/
|
|
337
|
+
set adapterSessionId(value: string | undefined);
|
|
338
|
+
/**
|
|
339
|
+
* Wait for adapter session ID to be set
|
|
340
|
+
* @returns Promise resolving to session ID when processing starts
|
|
341
|
+
*/
|
|
342
|
+
waitForAdapterSessionId(): Promise<string>;
|
|
343
|
+
get isProcessed(): boolean;
|
|
344
|
+
getState(): MessageState;
|
|
345
|
+
/**
|
|
346
|
+
* Update message state
|
|
347
|
+
* @param state - New message state
|
|
348
|
+
*/
|
|
349
|
+
updateState(state: MessageState): void;
|
|
350
|
+
/**
|
|
351
|
+
* Cancel a pending message
|
|
352
|
+
* @returns True if cancelled, false if already submitted/completed
|
|
353
|
+
*/
|
|
354
|
+
cancel(): Promise<boolean>;
|
|
355
|
+
/**
|
|
356
|
+
* Mark message as acknowledged
|
|
357
|
+
* @param delivered - Whether message was successfully delivered to provider
|
|
358
|
+
* (e.g. false if immediate message arrived too late)
|
|
359
|
+
*/
|
|
360
|
+
markAcknowledged(delivered?: boolean): void;
|
|
361
|
+
/**
|
|
362
|
+
* Register a transform that canonicalizes the terminal result before
|
|
363
|
+
* {@link waitForCompletion} resolves.
|
|
364
|
+
* @param transform - Transform applied to the raw provider completion result
|
|
365
|
+
*/
|
|
366
|
+
addCompletionTransform(transform: CompletionTransform): void;
|
|
367
|
+
/**
|
|
368
|
+
* Register an observer that runs after all completion transforms have
|
|
369
|
+
* produced the canonical terminal result, but before completion resolves.
|
|
370
|
+
* @param observer - Observer called with the final completion result
|
|
371
|
+
*/
|
|
372
|
+
addCompletionObserver(observer: CompletionObserver): void;
|
|
373
|
+
/**
|
|
374
|
+
* Mark message turn as completed
|
|
375
|
+
* @param result - The result message or null if no result available
|
|
376
|
+
*/
|
|
377
|
+
markCompleted(result: MessageResult): void;
|
|
378
|
+
/**
|
|
379
|
+
* Apply registered completion transforms and publish the canonical result.
|
|
380
|
+
* @param result - Raw provider completion result
|
|
381
|
+
*/
|
|
382
|
+
private resolveCompletion;
|
|
383
|
+
/**
|
|
384
|
+
* Notify registered completion observers without changing terminal outcome.
|
|
385
|
+
* @param result - Canonical completion result
|
|
386
|
+
*/
|
|
387
|
+
private notifyCompletionObservers;
|
|
388
|
+
waitForAcknowledgment(timeoutMs?: number): Promise<boolean>;
|
|
389
|
+
waitForCompletion(timeoutMs?: number): Promise<MessageResult>;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Complete a handle while notifying a callback with the transformed final result.
|
|
393
|
+
*
|
|
394
|
+
* `markCompleted()` starts async completion transforms before resolving
|
|
395
|
+
* waiters. Connector/session layers that cache `lastResult` must observe the
|
|
396
|
+
* final transformed value, not the raw provider result they pass into
|
|
397
|
+
* `markCompleted()`.
|
|
398
|
+
* @param handle - Message handle being completed
|
|
399
|
+
* @param result - Raw provider completion result
|
|
400
|
+
* @param onComplete - Optional notification callback receiving the final result
|
|
401
|
+
* @returns Promise that settles after the final-result callback completes
|
|
402
|
+
*/
|
|
403
|
+
declare function markCompletedWithFinalResult(handle: MessageHandle, result: MessageResult, onComplete?: CompletionNotification): Promise<void>;
|
|
404
|
+
//#endregion
|
|
405
|
+
//#region adapters/core/src/connector/agent-connector.d.ts
|
|
406
|
+
type Forbid<T, K extends PropertyKey> = Omit<T, K> & { [P in K]?: never };
|
|
407
|
+
type ForbiddenKeys = 'agentId' | 'adapterId' | 'adapterSessionId' | 'adapterName' | 'sessionId';
|
|
408
|
+
/** Extract Subjects type parameter from a ScopedBus */
|
|
409
|
+
type ExtractScopedBusSubjects<T> = T extends {
|
|
410
|
+
withFilter: (...args: unknown[]) => IFilteredBus<string, infer S>;
|
|
411
|
+
} ? S : T extends ScopedBus<string, infer S> ? S : SubjectRecord;
|
|
412
|
+
/**
|
|
413
|
+
* Abstract base class for AI agent implementations.
|
|
414
|
+
*
|
|
415
|
+
* Each adapter provides its own message queue implementation (UserMessageQueue).
|
|
416
|
+
* This base class provides common infrastructure for state management, bus operations,
|
|
417
|
+
* and error handling.
|
|
418
|
+
* @typeParam TBus - Scoped bus type for adapter namespace
|
|
419
|
+
*/
|
|
420
|
+
declare abstract class AIAgentConnector<TBus extends ScopedBus<string> = ScopedBus<string>, TConfig extends BaseAgentConnectorConfig<TBus> = BaseAgentConnectorConfig<TBus>> {
|
|
421
|
+
/** Unique identifier for this agent instance. */
|
|
422
|
+
protected readonly agentId: string;
|
|
423
|
+
/** Session ID from the provider (set after connection/start). */
|
|
424
|
+
adapterSessionId?: string;
|
|
425
|
+
/** Makaio session ID for cross-session correlation and approval routing. */
|
|
426
|
+
protected readonly sessionId?: string;
|
|
427
|
+
/** Currently active message handle waiting for completion. */
|
|
428
|
+
protected pendingMessageHandle?: MessageHandle;
|
|
429
|
+
/** Scoped event bus for adapter-specific emission. */
|
|
430
|
+
private readonly scopedBus;
|
|
431
|
+
/** Filtered event bus for agent-specific (filtered by agentId) message handling. */
|
|
432
|
+
private readonly filteredBus;
|
|
433
|
+
/** Optional error handler callback. */
|
|
434
|
+
protected readonly errorHandler?: (error: Error, terminate: boolean) => void;
|
|
435
|
+
/** Deferred promise for interrupt coordination. */
|
|
436
|
+
protected deferredInterrupt: DeferredPromise<void> | undefined;
|
|
437
|
+
/**
|
|
438
|
+
* Raw state emitter stays private so subclasses use updateProcessingState()
|
|
439
|
+
* and the public subscription methods instead of coupling to Emittery internals.
|
|
440
|
+
*/
|
|
441
|
+
private readonly emittery;
|
|
442
|
+
/** Current processing state of the agent. */
|
|
443
|
+
private processingState;
|
|
444
|
+
/** Adapter identifier shared across instances of the same adapter type. */
|
|
445
|
+
readonly adapterId: string;
|
|
446
|
+
/** Resolved timeout configuration with provenance tracking. */
|
|
447
|
+
protected readonly timeouts: TrackedTimeoutConfig;
|
|
448
|
+
protected lastResult: MessageResult | null;
|
|
449
|
+
protected readonly config: TConfig & {
|
|
450
|
+
adapterId: string;
|
|
451
|
+
};
|
|
452
|
+
/** Model used for this agent (subclasses may update when SDK confirms actual model) */
|
|
453
|
+
model: string;
|
|
454
|
+
/** ProviderConfig UUID used during agent creation, carried for runtime introspection */
|
|
455
|
+
providerConfigId?: string;
|
|
456
|
+
/** Working directory for agent execution */
|
|
457
|
+
cwd: string;
|
|
458
|
+
/** Current reasoning effort level, updated by changeReasoningInPlace. */
|
|
459
|
+
currentReasoningEffort: AIReasoningLevel | undefined;
|
|
460
|
+
/**
|
|
461
|
+
* Reasoning levels supported by the current model, forwarded from the config factory.
|
|
462
|
+
* `undefined` when the model does not declare reasoning support.
|
|
463
|
+
*/
|
|
464
|
+
supportedReasoningLevels: BaseAgentConnectorConfig['supportedReasoningLevels'];
|
|
465
|
+
protected readonly env: Record<string, string>;
|
|
466
|
+
/** Monotonically-increasing turn counter for MCP ledger bookkeeping. */
|
|
467
|
+
private _currentTurnNumber;
|
|
468
|
+
/** Pending canonical turn number staged by {@link setCanonicalTurnNumber}. */
|
|
469
|
+
private _pendingCanonicalTurnNumber;
|
|
470
|
+
/** Adapter type name for event identification. */
|
|
471
|
+
protected readonly adapterName: string;
|
|
472
|
+
/** Runtime system prompt from start/initialize options. */
|
|
473
|
+
protected systemPrompt?: SystemPrompt;
|
|
474
|
+
protected constructor(config: BaseAgentConnectorConfig<TBus> & {
|
|
475
|
+
adapterId: string;
|
|
476
|
+
});
|
|
477
|
+
/**
|
|
478
|
+
* Get the current processing state of the agent.
|
|
479
|
+
* @returns The current processing state
|
|
480
|
+
*/
|
|
481
|
+
getProcessingState(): ProcessingState;
|
|
482
|
+
/**
|
|
483
|
+
* Handle pause after rejection or error.
|
|
484
|
+
* Subclasses should clear pending messages as appropriate.
|
|
485
|
+
* @param _reason - Reason for pause ('rejection' | 'error'); available for subclass overrides
|
|
486
|
+
*/
|
|
487
|
+
protected handlePause(_reason: 'rejection' | 'error'): void;
|
|
488
|
+
/**
|
|
489
|
+
* Store runtime system prompt for session creation.
|
|
490
|
+
* Subclasses may override to apply SDK-specific side effects (e.g., Gemini's setSystemInstruction).
|
|
491
|
+
* @param prompt - System prompt from start/initialize options
|
|
492
|
+
*/
|
|
493
|
+
protected captureSystemPrompt(prompt: SystemPrompt | undefined): void;
|
|
494
|
+
/**
|
|
495
|
+
* Update the agent's processing state.
|
|
496
|
+
* State transitions trigger events via emittery.
|
|
497
|
+
* @param state - New processing state
|
|
498
|
+
*/
|
|
499
|
+
protected updateProcessingState(state: ProcessingState): Promise<void>;
|
|
500
|
+
/**
|
|
501
|
+
* Subscribe to processing state changes (idle ↔ processing transitions).
|
|
502
|
+
* @param handler - Called with `{ isProcessing: boolean }` on each state change
|
|
503
|
+
* @returns Unsubscribe function
|
|
504
|
+
*/
|
|
505
|
+
onProcessingStateChanged(handler: (payload: EmitteryEvents['processingStateChanged']) => Promise<void> | void): UnsubscribeFunction;
|
|
506
|
+
/**
|
|
507
|
+
* Wait for a single processing state change matching an optional predicate.
|
|
508
|
+
* @param predicate - Optional filter, e.g., `(e) => !e.isProcessing` for idle
|
|
509
|
+
* @returns Promise resolving to `{ isProcessing: boolean }`
|
|
510
|
+
*/
|
|
511
|
+
onceProcessingStateChanged(predicate?: (eventData: EmitteryEvents['processingStateChanged']) => boolean): Promise<ProcessingState>;
|
|
512
|
+
/**
|
|
513
|
+
* Initialize the connector's SDK session without sending a message.
|
|
514
|
+
* Must set adapterSessionId before returning.
|
|
515
|
+
* Called by createAgent for idle agent setup.
|
|
516
|
+
* Implementations MUST be idempotent (no-op if already initialized).
|
|
517
|
+
* @param options - Optional start options (e.g., systemPrompt for Claude)
|
|
518
|
+
*/
|
|
519
|
+
abstract initialize(options?: ConnectorStartOptions): Promise<void>;
|
|
520
|
+
/**
|
|
521
|
+
* Start agent with initial message.
|
|
522
|
+
* @param message - Normalized user message (role and content)
|
|
523
|
+
* @param options - Optional start options (e.g., delivery mode)
|
|
524
|
+
* @returns Session ID, agent ID, and message handle for tracking
|
|
525
|
+
*/
|
|
526
|
+
abstract start(message: NormalizedMessageInput, options?: ConnectorStartOptions): Promise<AgentStartResult>;
|
|
527
|
+
/**
|
|
528
|
+
* Send a message to the agent.
|
|
529
|
+
* For initial message, use start() instead.
|
|
530
|
+
* @param message - Normalized message content
|
|
531
|
+
* @param options - Send options (e.g., delivery mode, message ID)
|
|
532
|
+
* @returns Message handle for tracking
|
|
533
|
+
*/
|
|
534
|
+
abstract sendMessage(message: NormalizedMessageInput, options?: ConnectorSendMessageOptions): Promise<MessageHandle>;
|
|
535
|
+
/**
|
|
536
|
+
* Abort the agent and cleanup resources (panic mode).
|
|
537
|
+
* Triggers AbortController which may cause provider errors.
|
|
538
|
+
* Use close() for graceful shutdown instead.
|
|
539
|
+
*/
|
|
540
|
+
abstract abort(): void;
|
|
541
|
+
/**
|
|
542
|
+
* Gracefully close the agent session.
|
|
543
|
+
* Unlike abort(), this doesn't trigger AbortController errors.
|
|
544
|
+
* Use this for normal shutdown; use abort() for emergency termination.
|
|
545
|
+
*/
|
|
546
|
+
abstract close(): Promise<void>;
|
|
547
|
+
/**
|
|
548
|
+
* Get session ID, waiting for provider to generate it if not yet available.
|
|
549
|
+
* @returns Session ID from provider
|
|
550
|
+
*/
|
|
551
|
+
abstract getAdapterSessionId(): Promise<string>;
|
|
552
|
+
/**
|
|
553
|
+
* Complete the agent session by waiting for all messages to finish.
|
|
554
|
+
* @returns Last message result or null if no messages processed
|
|
555
|
+
*/
|
|
556
|
+
abstract complete(): Promise<MessageResult | null>;
|
|
557
|
+
/**
|
|
558
|
+
* Create a MessageHandle with standard initialization.
|
|
559
|
+
*
|
|
560
|
+
* Centralizes the pattern used by all connectors:
|
|
561
|
+
* 1. Generate messageId (use provided or generate UUID)
|
|
562
|
+
* 2. Create MessageHandle instance
|
|
563
|
+
* 3. Set adapterSessionId
|
|
564
|
+
* 4. Call onMessageSent callback
|
|
565
|
+
* @param message - Normalized user message
|
|
566
|
+
* @param options - Optional message options (id, delivery mode, history, and turn context)
|
|
567
|
+
* @returns Initialized MessageHandle ready for enqueueing
|
|
568
|
+
*/
|
|
569
|
+
protected createMessageHandle(message: NormalizedMessageInput, options?: MessageHandleOptions): MessageHandle;
|
|
570
|
+
/**
|
|
571
|
+
* Signal that MCP tools have changed and should be refreshed at the next turn boundary.
|
|
572
|
+
*
|
|
573
|
+
* Called by the AIAgent layer when receiving MCP bus events (`mcp.tools.updated`,
|
|
574
|
+
* `mcp.tools.enabled`). Connectors that support direct-inject tool refresh (e.g.,
|
|
575
|
+
* `BaseStreamConnector`) override this to set an internal pending-refresh flag.
|
|
576
|
+
* The default implementation is a no-op so connectors that do not manage MCP tools
|
|
577
|
+
* directly are unaffected.
|
|
578
|
+
*/
|
|
579
|
+
markToolRefreshPending(): void;
|
|
580
|
+
/**
|
|
581
|
+
* Stage the canonical orchestrator-assigned turn number for consumption by the next
|
|
582
|
+
* {@link consumeTurnNumber} call. The counter is monotonically increasing.
|
|
583
|
+
* @param turnNumber - Canonical 1-based turn number from SessionOrchestrator
|
|
584
|
+
* @throws RangeError when the value is invalid, regresses, or downgrades a staged value
|
|
585
|
+
*/
|
|
586
|
+
setCanonicalTurnNumber(turnNumber: number): void;
|
|
587
|
+
/**
|
|
588
|
+
* Advance to the next turn number, consuming any pending canonical value.
|
|
589
|
+
* Orchestrator-staged values win; otherwise the local counter increments by one.
|
|
590
|
+
* @returns The current turn number after advancement
|
|
591
|
+
*/
|
|
592
|
+
protected consumeTurnNumber(): number;
|
|
593
|
+
/**
|
|
594
|
+
* Current turn number (read-only). Use {@link consumeTurnNumber} to advance.
|
|
595
|
+
* @returns The current turn number
|
|
596
|
+
*/
|
|
597
|
+
protected get currentTurnNumber(): number;
|
|
598
|
+
/**
|
|
599
|
+
* Staged canonical turn number, or `undefined` if none was staged.
|
|
600
|
+
* @returns The pending canonical turn number
|
|
601
|
+
*/
|
|
602
|
+
protected get pendingTurnNumber(): number | undefined;
|
|
603
|
+
/**
|
|
604
|
+
* Attempt to change the model without a connector swap.
|
|
605
|
+
* Subclasses override when the SDK supports in-place model changes.
|
|
606
|
+
* Base implementation returns false (swap required).
|
|
607
|
+
*
|
|
608
|
+
* **Mutation contract:** Implementations MUST NOT mutate `this.model` directly.
|
|
609
|
+
* The caller (AIAgent.handleModelChange) owns the `this.model` field update after
|
|
610
|
+
* a successful in-place change. Implementations only configure the SDK-internal model
|
|
611
|
+
* (e.g., `query.setModel()`, `geminiConfig.setModel()`).
|
|
612
|
+
* @param _newModel - The model identifier to switch to
|
|
613
|
+
* @returns true if changed in-place, false if swap needed. Exceptions are caught by the
|
|
614
|
+
* caller and treated as false (automatic swap fallback), so implementations need not guard.
|
|
615
|
+
*/
|
|
616
|
+
changeModelInPlace(_newModel: string): Promise<boolean>;
|
|
617
|
+
/**
|
|
618
|
+
* Attempt to change the working directory without a connector swap.
|
|
619
|
+
* Subclasses override when the adapter supports in-place cwd changes (e.g., stateless APIs).
|
|
620
|
+
* Base implementation returns false (swap required).
|
|
621
|
+
*
|
|
622
|
+
* **Mutation contract:** Implementations MUST NOT mutate `this.cwd` directly.
|
|
623
|
+
* The caller (AIAgent.handleCwdChange) owns the `this.cwd` field update after
|
|
624
|
+
* a successful in-place change. Implementations only update SDK-internal state.
|
|
625
|
+
* @param _newCwd - The working directory path to switch to
|
|
626
|
+
* @returns true if changed in-place, false if swap needed. Exceptions are caught by the
|
|
627
|
+
* caller and treated as false (automatic swap fallback), so implementations need not guard.
|
|
628
|
+
*/
|
|
629
|
+
changeCwdInPlace(_newCwd: string): Promise<boolean>;
|
|
630
|
+
/**
|
|
631
|
+
* Attempt to change reasoning effort without swapping the connector.
|
|
632
|
+
*
|
|
633
|
+
* Override in subclasses that support in-place reasoning changes (e.g., adapters
|
|
634
|
+
* that pass reasoning parameters per-request rather than at session-creation time).
|
|
635
|
+
* The base implementation returns `false` so callers fall back to a connector swap.
|
|
636
|
+
*
|
|
637
|
+
* **Mutation contract:** Implementations MUST NOT mutate `this.currentReasoningEffort`
|
|
638
|
+
* directly. The caller owns the `currentReasoningEffort` field update after a successful
|
|
639
|
+
* in-place change. Implementations only configure the SDK-internal reasoning parameter.
|
|
640
|
+
* @param _newLevel - The new reasoning effort level to apply
|
|
641
|
+
* @returns `true` if the change was applied in-place, `false` if a connector swap is needed
|
|
642
|
+
*/
|
|
643
|
+
changeReasoningInPlace(_newLevel: AIReasoningLevel): Promise<boolean>;
|
|
644
|
+
/**
|
|
645
|
+
* Interrupt the current message processing.
|
|
646
|
+
* @returns Promise that resolves when interrupt is handled
|
|
647
|
+
*/
|
|
648
|
+
abstract interrupt(): Promise<void>;
|
|
649
|
+
/**
|
|
650
|
+
* Marks pending message as failed, calls error handler, resolves completion promise.
|
|
651
|
+
* @param error - Error that occurred
|
|
652
|
+
* @param terminate - Whether to abort the agent after handling error
|
|
653
|
+
* @internal
|
|
654
|
+
*/
|
|
655
|
+
handleError(error: unknown, terminate?: boolean): void;
|
|
656
|
+
protected handleToolApprovalDenied(abort: 'not_requested' | 'not_supported' | 'handled', details?: string): void;
|
|
657
|
+
getAgentId(): string;
|
|
658
|
+
getAdapterName(): string;
|
|
659
|
+
/**
|
|
660
|
+
* Get timeout value for a specific category.
|
|
661
|
+
* @param category - Timeout category (initialization, acknowledgement, completion, toolApproval, eventWait)
|
|
662
|
+
* @returns Timeout value in milliseconds
|
|
663
|
+
*/
|
|
664
|
+
getTimeoutMs(category: keyof typeof this.timeouts.values): number;
|
|
665
|
+
/**
|
|
666
|
+
* Request tool approval via the scoped bus with auto-injected metadata.
|
|
667
|
+
*
|
|
668
|
+
* Wraps `scopedBus.request()` to automatically include connector identity
|
|
669
|
+
* (adapterName, agentId, adapterId, adapterSessionId) in the payload.
|
|
670
|
+
* @param subject - Subject definition for the tool approval request
|
|
671
|
+
* @param payload - Request payload (metadata fields are forbidden and auto-injected)
|
|
672
|
+
* @returns Promise resolving to the approval response
|
|
673
|
+
*/
|
|
674
|
+
protected requestToolApproval<TSubject extends ScopedSubjectDefinition<TBus['namespace']>>(subject: TSubject, payload: Forbid<TSubject['$meta']['payload']['request'], ForbiddenKeys>): Promise<TSubject['$meta']['payload']['response']>;
|
|
675
|
+
/**
|
|
676
|
+
* Execute a tool approval request with the shared diagnostics wrapper.
|
|
677
|
+
*
|
|
678
|
+
* Handles the common `RequestError`/`NoHandlerError` path by logging a helpful
|
|
679
|
+
* message via `handleError` and re-throwing so callers can decide whether to
|
|
680
|
+
* surface the failure or fall back to a denial.
|
|
681
|
+
* @param subject - Scoped subject definition for the tool approval request
|
|
682
|
+
* @param payload - Payload that must not include adapter metadata
|
|
683
|
+
* @returns Tool approval response payload
|
|
684
|
+
*/
|
|
685
|
+
protected requestToolApprovalWithHandling<TSubject extends ScopedSubjectDefinition<TBus['namespace']>>(subject: TSubject, payload: Forbid<TSubject['$meta']['payload']['request'], ForbiddenKeys>): Promise<TSubject['$meta']['payload']['response']>;
|
|
686
|
+
/**
|
|
687
|
+
* Emit an event via the scoped bus with auto-injected metadata.
|
|
688
|
+
*
|
|
689
|
+
* Wraps `scopedBus.emit()` to automatically include connector identity
|
|
690
|
+
* (adapterName, agentId, adapterId, adapterSessionId) in the payload.
|
|
691
|
+
* @param subject - Subject definition for the event
|
|
692
|
+
* @param payload - Event payload (metadata fields are forbidden and auto-injected)
|
|
693
|
+
* @returns Promise that resolves when the event is emitted
|
|
694
|
+
*/
|
|
695
|
+
protected emit<TSubject extends ScopedSubjectDefinition<TBus['namespace']>>(subject: TSubject, payload: Forbid<TSubject['$meta']['payload'], ForbiddenKeys>): Promise<void>;
|
|
696
|
+
/**
|
|
697
|
+
* Subscribe to events on the filtered bus (pre-filtered by agentId).
|
|
698
|
+
*
|
|
699
|
+
* Uses `filteredBus` which only delivers events matching this connector's agentId.
|
|
700
|
+
* @param subject - Subject definition to subscribe to
|
|
701
|
+
* @param handler - Event handler receiving the event context
|
|
702
|
+
* @param options - Optional subscription options (e.g., priority)
|
|
703
|
+
* @returns Unsubscribe function
|
|
704
|
+
*/
|
|
705
|
+
on<Subject extends ScopedSubjectDefinition<TBus['namespace']>>(subject: Subject, handler: HandlerForSubjectDefinition<Subject>, options?: OnOptions): () => void;
|
|
706
|
+
/**
|
|
707
|
+
* Wait for a single event on the filtered bus (pre-filtered by agentId).
|
|
708
|
+
*
|
|
709
|
+
* Uses `filteredBus` which only delivers events matching this connector's agentId.
|
|
710
|
+
* @param subject - Subject definition to wait for
|
|
711
|
+
* @param options - Optional options (e.g., predicate filter, timeout)
|
|
712
|
+
* @returns Promise resolving to the event context
|
|
713
|
+
*/
|
|
714
|
+
once<Subject extends ScopedSubjectDefinition<TBus['namespace']>>(subject: Subject, options?: Parameters<IFilteredBus<TBus['namespace'], ExtractScopedBusSubjects<TBus>>['once']>[1]): Promise<never>;
|
|
715
|
+
protected logLowLevelEvent(_event: unknown): void;
|
|
716
|
+
}
|
|
717
|
+
//#endregion
|
|
718
|
+
//#region adapters/core/src/adapter/ai-adapter-config.d.ts
|
|
719
|
+
/**
|
|
720
|
+
* Input provided by agent to the config factory.
|
|
721
|
+
* Contains partial configuration - adapters provide defaults for missing required fields.
|
|
722
|
+
*
|
|
723
|
+
* Includes all runtime options from StartAgentRequest (allowedTools, disallowedTools, etc.)
|
|
724
|
+
* to ensure they flow through to the connector.
|
|
725
|
+
*/
|
|
726
|
+
interface ConfigFactoryInput<TBus extends ScopedBus<string> = ScopedBus<string>> {
|
|
727
|
+
/** Scoped bus for adapter-specific events */
|
|
728
|
+
bus: TBus;
|
|
729
|
+
/** Unique agent identifier (required - generated by AIAgent) */
|
|
730
|
+
agentId: string;
|
|
731
|
+
/** Adapter instance identifier (required - provided by AIAgent from adapter) */
|
|
732
|
+
adapterId: string;
|
|
733
|
+
/** Adapter type name (required - provided by AIAgent from adapter) */
|
|
734
|
+
adapterName: string;
|
|
735
|
+
/**
|
|
736
|
+
* Unresolved provider context (credential refs, not plaintext).
|
|
737
|
+
* Connectors resolve credentials locally via `resolveConnectorCredentials()`.
|
|
738
|
+
*/
|
|
739
|
+
providerContext: ProviderContext;
|
|
740
|
+
/** Provider's session ID for resuming existing conversations */
|
|
741
|
+
adapterSessionId?: string;
|
|
742
|
+
/** Makaio session ID for tool execution context and multi-session correlation */
|
|
743
|
+
sessionId?: string;
|
|
744
|
+
/** Previous adapter session ID for resume attempts (from recovery). */
|
|
745
|
+
resumeAdapterSessionId?: string;
|
|
746
|
+
/** Model to use - optional, adapters provide defaults */
|
|
747
|
+
model?: string;
|
|
748
|
+
/** Working directory for agent execution */
|
|
749
|
+
cwd?: string;
|
|
750
|
+
/** Environment variables to pass to agent execution */
|
|
751
|
+
env?: Record<string, string>;
|
|
752
|
+
/** Reasoning effort for supporting adapters */
|
|
753
|
+
reasoningEffort?: AIReasoningLevel$1;
|
|
754
|
+
/** Reasoning levels supported by the resolved model, forwarded to the connector. */
|
|
755
|
+
supportedReasoningLevels?: ReasoningLevelMap$1;
|
|
756
|
+
/** Error handler for connector errors */
|
|
757
|
+
errorHandler?: (error: Error, terminate: boolean) => void;
|
|
758
|
+
/** Allowed tool names (adapter-specific). Empty array = disable all tools. */
|
|
759
|
+
allowedTools?: string[];
|
|
760
|
+
/** Disallowed tool names (adapter-specific). Takes precedence over allowedTools. */
|
|
761
|
+
disallowedTools?: string[];
|
|
762
|
+
/** Directory restrictions for file-system tool execution. */
|
|
763
|
+
allowedDirectories?: string[];
|
|
764
|
+
/** Provider-specific configuration (non-credential settings). Adapters merge with defaults. */
|
|
765
|
+
providerConfig?: Record<string, unknown>;
|
|
766
|
+
runtimeTimeouts?: TimeoutConfig;
|
|
767
|
+
/** Client identifier for the application this adapter belongs to (e.g., 'claude-code', 'gemini'). */
|
|
768
|
+
clientId?: string;
|
|
769
|
+
/** Client profile name for session-scoped config isolation. */
|
|
770
|
+
clientProfileName?: string;
|
|
771
|
+
/** Harness identifier used to resolve per-agent tool governance. */
|
|
772
|
+
harnessId?: string;
|
|
773
|
+
/**
|
|
774
|
+
* Resolved MCP session context including upstream server configs.
|
|
775
|
+
* When present, native-passthrough adapters use `servers` to configure SDK MCP connections.
|
|
776
|
+
*/
|
|
777
|
+
mcpSessionContext?: LedgerSessionContext | McpRuntimeSessionContext | McpSessionContext;
|
|
778
|
+
/**
|
|
779
|
+
* Session-scoped MCP tool ledger.
|
|
780
|
+
* Passed through unchanged so connectors can track injection and mcp_call usage.
|
|
781
|
+
*/
|
|
782
|
+
toolLedger?: ISessionToolLedger;
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* Interface for adapter-specific configuration factories.
|
|
786
|
+
*
|
|
787
|
+
* Transforms partial ConfigFactoryInput into full adapter-specific config.
|
|
788
|
+
* The key responsibility is applying adapter defaults (especially model).
|
|
789
|
+
* @example
|
|
790
|
+
* ```typescript
|
|
791
|
+
* const OpenAIConfigFactory: IAdapterConfigFactory<OpenAINodeAgentConfig> = {
|
|
792
|
+
* getConfig: async (input) => ({
|
|
793
|
+
* ...input,
|
|
794
|
+
* model: input.model ?? 'gpt-4o',
|
|
795
|
+
* providerConfig: { debugMode: true },
|
|
796
|
+
* }),
|
|
797
|
+
* };
|
|
798
|
+
* ```
|
|
799
|
+
*/
|
|
800
|
+
interface IAdapterConfigFactory<TConfig extends BaseAgentConnectorConfig, TBus extends ScopedBus<string> = ScopedBus<string>> {
|
|
801
|
+
getConfig(input: ConfigFactoryInput<TBus>): Promise<TConfig>;
|
|
802
|
+
}
|
|
803
|
+
//#endregion
|
|
804
|
+
//#region adapters/core/src/agent/types.d.ts
|
|
805
|
+
/**
|
|
806
|
+
* Core agent identity fields.
|
|
807
|
+
* Used as base for contexts, configs, and request payloads.
|
|
808
|
+
*/
|
|
809
|
+
interface AgentIdentity {
|
|
810
|
+
/** Unique agent identifier */
|
|
811
|
+
agentId: string;
|
|
812
|
+
/** Adapter instance identifier */
|
|
813
|
+
adapterId: string;
|
|
814
|
+
/** Adapter type name (e.g., 'claude-code', 'gemini-sdk') */
|
|
815
|
+
adapterName: string;
|
|
816
|
+
/** Session identifier for multi-turn conversations */
|
|
817
|
+
adapterSessionId?: string;
|
|
818
|
+
}
|
|
819
|
+
/**
|
|
820
|
+
* Runtime options as INPUT - model/cwd optional (adapters provide defaults via configFactory).
|
|
821
|
+
*/
|
|
822
|
+
interface AgentRuntimeInput {
|
|
823
|
+
/** Model to use (optional - adapter provides default) */
|
|
824
|
+
model?: string;
|
|
825
|
+
/** Working directory for agent execution (optional - platform provides default) */
|
|
826
|
+
cwd?: string;
|
|
827
|
+
/** Environment variables to pass to agent execution */
|
|
828
|
+
env?: Record<string, string>;
|
|
829
|
+
/** Reasoning effort for supporting adapters */
|
|
830
|
+
reasoningEffort?: AIReasoningLevel$1;
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* Runtime options as RESOLVED config - model/cwd required (after configFactory applies defaults).
|
|
834
|
+
*/
|
|
835
|
+
type AgentRuntimeOptions = SetRequired<AgentRuntimeInput, 'model' | 'cwd'>;
|
|
836
|
+
/**
|
|
837
|
+
* Common context fields for all agent.* subject emissions.
|
|
838
|
+
* AIAgent automatically enriches payloads with these fields.
|
|
839
|
+
*/
|
|
840
|
+
type AgentContext = Required<AgentIdentity>;
|
|
841
|
+
/**
|
|
842
|
+
* Execution context for per-agent processors.
|
|
843
|
+
* Baked in at processor creation time, eliminating runtime registry lookups.
|
|
844
|
+
*/
|
|
845
|
+
type ExecutionContext = AgentContext;
|
|
846
|
+
interface MinimalAgentConnectorConfig<TBus extends ScopedBus<string> = ScopedBus<string>> {
|
|
847
|
+
bus: TBus;
|
|
848
|
+
}
|
|
849
|
+
/**
|
|
850
|
+
* Base configuration for AI agent connector instances.
|
|
851
|
+
*/
|
|
852
|
+
interface BaseAgentConnectorConfig<TBus extends ScopedBus<string> = ScopedBus<string>, TProviderConfig extends object = object> extends MinimalAgentConnectorConfig<TBus>, Omit<AgentIdentity, 'adapterId'>, AgentRuntimeOptions {
|
|
853
|
+
/** Makaio session ID for tool execution context and multi-session correlation */
|
|
854
|
+
sessionId?: string;
|
|
855
|
+
errorHandler?: (error: Error, terminate: boolean) => void;
|
|
856
|
+
/**
|
|
857
|
+
* Resolved timeout configuration with provenance tracking.
|
|
858
|
+
* Set by configFactory after merging all timeout layers.
|
|
859
|
+
*/
|
|
860
|
+
timeouts?: TrackedTimeoutConfig;
|
|
861
|
+
/**
|
|
862
|
+
* UUID of the ProviderConfig entity used during agent creation.
|
|
863
|
+
* Carried on the connector config for runtime introspection and dynamic provider switching.
|
|
864
|
+
*/
|
|
865
|
+
providerConfigId?: string;
|
|
866
|
+
/**
|
|
867
|
+
* Unresolved provider context (credential refs, not plaintext).
|
|
868
|
+
*
|
|
869
|
+
* Passed through from the factory input so connectors can call
|
|
870
|
+
* `resolveConnectorCredentials()` locally during initialization.
|
|
871
|
+
* Connectors must NOT read plaintext credentials from this field —
|
|
872
|
+
* they must resolve refs via `resolveConnectorCredentials()`.
|
|
873
|
+
*/
|
|
874
|
+
providerContext?: ProviderContext;
|
|
875
|
+
providerConfig?: TProviderConfig;
|
|
876
|
+
/**
|
|
877
|
+
* Maps supported reasoning levels to provider-native values for the active model.
|
|
878
|
+
*
|
|
879
|
+
* Populated by the config factory when the resolved model declares reasoning support.
|
|
880
|
+
* Absent when the model does not support extended thinking.
|
|
881
|
+
*/
|
|
882
|
+
supportedReasoningLevels?: ReasoningLevelMap$1;
|
|
883
|
+
/** Previous adapter session ID for resume attempts. */
|
|
884
|
+
resumeAdapterSessionId?: string;
|
|
885
|
+
/** Resolved harness ID for tool policy lookup. */
|
|
886
|
+
harnessId?: string;
|
|
887
|
+
/** Client identifier for the application this adapter belongs to (e.g., 'claude-code', 'gemini'). */
|
|
888
|
+
clientId?: string;
|
|
889
|
+
/** Client profile name for session-scoped config isolation. */
|
|
890
|
+
clientProfileName?: string;
|
|
891
|
+
/** Callback when a user message is enqueued */
|
|
892
|
+
onMessageSent?: (messageHandle: MessageHandle) => void;
|
|
893
|
+
/**
|
|
894
|
+
* Directory restrictions for file-system tool execution.
|
|
895
|
+
* When set, forwarded as `constraints.allowedDirectories` in every tool call.
|
|
896
|
+
* Empty array means no restriction; undefined means no restriction.
|
|
897
|
+
*/
|
|
898
|
+
allowedDirectories?: string[];
|
|
899
|
+
/**
|
|
900
|
+
* MCP session context resolved by the orchestrator.
|
|
901
|
+
* Provides the direct and discoverable tool sets for the current session.
|
|
902
|
+
* When present, enables MCP tool injection and ledger tracking.
|
|
903
|
+
*
|
|
904
|
+
* Intentionally narrowed to LedgerSessionContext — the minimal shape the
|
|
905
|
+
* ledger needs. Adapters requiring the full McpSessionContext (with
|
|
906
|
+
* resolution keys / servers) re-declare this field via Omit + intersection
|
|
907
|
+
* in their own config types (e.g. BaseStreamConnectorConfig, ClaudeAgentConfig).
|
|
908
|
+
*/
|
|
909
|
+
mcpSessionContext?: LedgerSessionContext | McpRuntimeSessionContext | McpSessionContext;
|
|
910
|
+
/**
|
|
911
|
+
* Session-scoped tool ledger for tracking injection, discovery, and call history.
|
|
912
|
+
* When present, the connector records tool events into this ledger.
|
|
913
|
+
*/
|
|
914
|
+
toolLedger?: ISessionToolLedger;
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* Configuration for creating an AIAgent instance.
|
|
918
|
+
*
|
|
919
|
+
* Combines agent identity, runtime input, and factory functions.
|
|
920
|
+
* model/cwd are optional here - configFactory provides adapter defaults.
|
|
921
|
+
* @typeParam TBus - The scoped bus type for this adapter
|
|
922
|
+
* @typeParam TConnector - The connector type (for proper factory return typing)
|
|
923
|
+
*/
|
|
924
|
+
interface AIAgentConfig<TBus extends ScopedBus<string> = ScopedBus<string>, TConnector extends AIAgentConnector<TBus> = AIAgentConnector<TBus>> extends Omit<AgentIdentity, 'adapterSessionId'>, AgentRuntimeInput {
|
|
925
|
+
/** Adapter-specific session identifier for multi-turn conversations */
|
|
926
|
+
adapterSessionId?: string;
|
|
927
|
+
/** Makaio session identifier */
|
|
928
|
+
sessionId?: string;
|
|
929
|
+
/**
|
|
930
|
+
* Unresolved provider context (credential refs, not plaintext).
|
|
931
|
+
* Set by the orchestrator before forwarding the startAgent request.
|
|
932
|
+
* Connectors resolve credentials locally via `resolveConnectorCredentials()`.
|
|
933
|
+
*/
|
|
934
|
+
providerContext?: ProviderContext;
|
|
935
|
+
/** Previous adapter session ID for resume attempts (from recovery). */
|
|
936
|
+
resumeAdapterSessionId?: string;
|
|
937
|
+
/** Resolved harness ID for tool policy lookup. */
|
|
938
|
+
harnessId?: string;
|
|
939
|
+
/** Client identifier for the application this adapter belongs to (e.g., 'claude-code', 'gemini'). */
|
|
940
|
+
clientId?: string;
|
|
941
|
+
/** Client profile name for session-scoped config isolation. */
|
|
942
|
+
clientProfileName?: string;
|
|
943
|
+
/** Global bus instance (defaults to MakaioBus singleton) */
|
|
944
|
+
globalBus?: IMakaioBus;
|
|
945
|
+
/** Scoped bus for adapter-specific events */
|
|
946
|
+
adapterBus: TBus;
|
|
947
|
+
/** Adapter capabilities (e.g., ['streaming', 'tools', 'vision']) */
|
|
948
|
+
capabilities: string[];
|
|
949
|
+
/** Native tools built into the adapter (e.g., ['shell_command', 'apply_patch']) */
|
|
950
|
+
nativeTools: string[];
|
|
951
|
+
/** Available models for this adapter (used for context window lookup) */
|
|
952
|
+
availableModels?: AIModel[];
|
|
953
|
+
/** Allowed tool names (adapter-specific). Empty array = disable all tools. */
|
|
954
|
+
allowedTools?: string[];
|
|
955
|
+
/** Disallowed tool names (adapter-specific). Takes precedence over allowedTools. */
|
|
956
|
+
disallowedTools?: string[];
|
|
957
|
+
/** Directory restrictions for file-system tool execution. */
|
|
958
|
+
allowedDirectories?: string[];
|
|
959
|
+
/**
|
|
960
|
+
* MCP session context resolved by the orchestrator.
|
|
961
|
+
* Passed through to the connector config so adapters can inject direct tools.
|
|
962
|
+
*/
|
|
963
|
+
mcpSessionContext?: LedgerSessionContext | McpRuntimeSessionContext;
|
|
964
|
+
/**
|
|
965
|
+
* Session-scoped ledger tracking MCP injection/discovery/call history.
|
|
966
|
+
* Created once per agent session and passed through unchanged on connector swaps.
|
|
967
|
+
*/
|
|
968
|
+
toolLedger?: ISessionToolLedger;
|
|
969
|
+
/**
|
|
970
|
+
* When true, PreUserMessage hooks are skipped for this agent.
|
|
971
|
+
* Use for ephemeral ping agents where session enrichment and context injection
|
|
972
|
+
* are not needed and would be actively harmful.
|
|
973
|
+
*/
|
|
974
|
+
ephemeral?: boolean;
|
|
975
|
+
/**
|
|
976
|
+
* Config factory - transforms partial input into full adapter-specific config.
|
|
977
|
+
* This is the seam where adapters inject their defaults (especially model).
|
|
978
|
+
*/
|
|
979
|
+
configFactory: (input: ConfigFactoryInput<TBus>) => Promise<BaseAgentConnectorConfig<TBus> & {
|
|
980
|
+
adapterId: string;
|
|
981
|
+
}>;
|
|
982
|
+
/**
|
|
983
|
+
* Connector factory - creates connector from full config.
|
|
984
|
+
* Called AFTER configFactory returns the complete configuration.
|
|
985
|
+
* Config includes adapterId (passed through from input by config factory).
|
|
986
|
+
*/
|
|
987
|
+
connectorFactory: (config: BaseAgentConnectorConfig<TBus> & {
|
|
988
|
+
adapterId: string;
|
|
989
|
+
}) => TConnector | Promise<TConnector>;
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
* Result returned from agent.start()
|
|
993
|
+
*/
|
|
994
|
+
interface AgentStartResult {
|
|
995
|
+
adapterSessionId: string;
|
|
996
|
+
agentId: string;
|
|
997
|
+
messageHandle: MessageHandle;
|
|
998
|
+
}
|
|
999
|
+
/**
|
|
1000
|
+
* Options for sending a message to an agent.
|
|
1001
|
+
* Extends SendMessageOptions with curated message history and system prompt configuration.
|
|
1002
|
+
*/
|
|
1003
|
+
interface AgentSendMessageOptions extends SendMessageOptions {
|
|
1004
|
+
/** Curated message history from orchestration layer */
|
|
1005
|
+
messageHistory?: Message[];
|
|
1006
|
+
/**
|
|
1007
|
+
* System prompt configuration.
|
|
1008
|
+
* - `string`: Replace/set the entire system prompt
|
|
1009
|
+
* - `{ mode: 'append', content: string }`: Append to adapter's default system prompt
|
|
1010
|
+
*/
|
|
1011
|
+
systemPrompt?: SystemPrompt;
|
|
1012
|
+
/**
|
|
1013
|
+
* Context signals assembled by SessionOrchestrator.
|
|
1014
|
+
* Used by AIAgent to decide: native resume vs fresh with history.
|
|
1015
|
+
* Hooks inject context via sessionContext.turnContext (set by replacePayload).
|
|
1016
|
+
*/
|
|
1017
|
+
sessionContext?: SessionContext;
|
|
1018
|
+
/**
|
|
1019
|
+
* Structured output descriptor.
|
|
1020
|
+
* When present and the adapter declares `structuredOutput` capability,
|
|
1021
|
+
* the adapter enforces this schema at the model level.
|
|
1022
|
+
* Ignored by adapters that lack the capability.
|
|
1023
|
+
*/
|
|
1024
|
+
responseSchema?: ResponseSchemaDescriptor;
|
|
1025
|
+
}
|
|
1026
|
+
/**
|
|
1027
|
+
* Options for starting an agent session.
|
|
1028
|
+
* Same as AgentSendMessageOptions - both start() and sendMessage() accept the same options.
|
|
1029
|
+
*/
|
|
1030
|
+
type StartAgentOptions = AgentSendMessageOptions;
|
|
1031
|
+
/**
|
|
1032
|
+
* Options for connector-level message operations.
|
|
1033
|
+
* Extends AgentSendMessageOptions with turnContext for internal AIAgent to Connector communication.
|
|
1034
|
+
* AIAgent extracts sessionContext.turnContext and passes it here.
|
|
1035
|
+
* Inherits responseSchema from AgentSendMessageOptions.
|
|
1036
|
+
*/
|
|
1037
|
+
interface ConnectorSendMessageOptions extends AgentSendMessageOptions {
|
|
1038
|
+
/**
|
|
1039
|
+
* Turn-scoped context assembled by PreUserMessage hooks and the orchestrator.
|
|
1040
|
+
* Extracted from sessionContext.turnContext by AIAgent.
|
|
1041
|
+
* Adapters use this to prepend context blocks to the SDK message.
|
|
1042
|
+
*
|
|
1043
|
+
* ADAPTER CONTRACT: Every adapter MUST materialize turnContext into the
|
|
1044
|
+
* LLM-facing message using serializeTurnContext().
|
|
1045
|
+
*/
|
|
1046
|
+
turnContext?: Record<string, JsonValue>;
|
|
1047
|
+
/**
|
|
1048
|
+
* Whether this message is an internal retry turn synthesized by the structured-output
|
|
1049
|
+
* manager. When `true`, the connector suppresses `user_message.sent` so the retry
|
|
1050
|
+
* is not surfaced as a new user message.
|
|
1051
|
+
*/
|
|
1052
|
+
internalRetry?: boolean;
|
|
1053
|
+
}
|
|
1054
|
+
/**
|
|
1055
|
+
* Options for connector-level start operations.
|
|
1056
|
+
* Same as ConnectorSendMessageOptions.
|
|
1057
|
+
*/
|
|
1058
|
+
type ConnectorStartOptions = ConnectorSendMessageOptions;
|
|
1059
|
+
/** Payload type for `agent.sendMessage` requests. */
|
|
1060
|
+
type SendMessageRequestPayload = ExtractSubjectPayload<typeof AgentSubjects.sendMessage>;
|
|
1061
|
+
/** Response type for `agent.sendMessage` requests. */
|
|
1062
|
+
type SendMessageResponsePayload = ExtractSubjectResponse<typeof AgentSubjects.sendMessage>;
|
|
1063
|
+
/** Payload type for `agent.interrupt` requests. */
|
|
1064
|
+
type AgentInterruptRequestPayload = ExtractSubjectPayload<typeof AgentSubjects.interrupt>;
|
|
1065
|
+
/** Response type for `agent.interrupt` requests. */
|
|
1066
|
+
type AgentInterruptResponsePayload = ExtractSubjectResponse<typeof AgentSubjects.interrupt>;
|
|
1067
|
+
/** Response type for `agent.getCapabilities` requests. */
|
|
1068
|
+
type GetCapabilitiesResponsePayload = ExtractSubjectResponse<typeof AgentSubjects.getCapabilities>;
|
|
1069
|
+
/** Payload type for `agent.cwd.change` requests. */
|
|
1070
|
+
type AgentCwdChangeRequestPayload = ExtractSubjectPayload<typeof AgentSubjects.cwd.change>;
|
|
1071
|
+
/** Response type for `agent.cwd.change` requests. */
|
|
1072
|
+
type AgentCwdChangeResponsePayload = ExtractSubjectResponse<typeof AgentSubjects.cwd.change>;
|
|
1073
|
+
/** Payload type for `agent.model.change` requests. */
|
|
1074
|
+
type AgentModelChangeRequestPayload = ExtractSubjectPayload<typeof AgentSubjects.model.change>;
|
|
1075
|
+
/** Response type for `agent.model.change` requests. */
|
|
1076
|
+
type AgentModelChangeResponsePayload = ExtractSubjectResponse<typeof AgentSubjects.model.change>;
|
|
1077
|
+
/** Payload type for `agent.mcp.servers.set` requests. */
|
|
1078
|
+
type AgentMcpServersSetRequestPayload = ExtractSubjectPayload<typeof AgentSubjects.mcp.servers.set>;
|
|
1079
|
+
/** Response type for `agent.mcp.servers.set` requests. */
|
|
1080
|
+
type AgentMcpServersSetResponsePayload = ExtractSubjectResponse<typeof AgentSubjects.mcp.servers.set>;
|
|
1081
|
+
/** Payload type for `agent.credential.change` requests. */
|
|
1082
|
+
type AgentCredentialChangeRequestPayload = ExtractSubjectPayload<typeof AgentSubjects.credential.change>;
|
|
1083
|
+
/** Response type for `agent.credential.change` requests. */
|
|
1084
|
+
type AgentCredentialChangeResponsePayload = ExtractSubjectResponse<typeof AgentSubjects.credential.change>;
|
|
1085
|
+
type EmitteryEvents = {
|
|
1086
|
+
processingStateChanged: ProcessingState;
|
|
1087
|
+
};
|
|
1088
|
+
/**
|
|
1089
|
+
* Normalized usage metrics for a single agent call.
|
|
1090
|
+
* Adapter implementations normalize provider-specific usage data to this format.
|
|
1091
|
+
*/
|
|
1092
|
+
type NormalizedCallUsage = Omit<z.infer<typeof AgentSchemas.usage>, keyof AgentContext | 'model'>;
|
|
1093
|
+
/**
|
|
1094
|
+
* Input for context window update emission.
|
|
1095
|
+
* Adapters provide raw metrics, helper calculates percentage and level.
|
|
1096
|
+
*/
|
|
1097
|
+
interface ContextWindowInput {
|
|
1098
|
+
/** Total tokens in context (input + output for next turn prediction) */
|
|
1099
|
+
currentTokens: number;
|
|
1100
|
+
/** Model's context window limit */
|
|
1101
|
+
maxTokens: number;
|
|
1102
|
+
/** Cached tokens (optional, reduces cost but still in context) */
|
|
1103
|
+
cachedTokens?: number;
|
|
1104
|
+
}
|
|
1105
|
+
//#endregion
|
|
1106
|
+
export { MessageHandle as A, ReasoningLevelMap$1 as B, SendMessageRequestPayload as C, IAdapterConfigFactory as D, ConfigFactoryInput as E, MessageState as F, LedgerSessionContext as H, ProcessingState as I, SendMessageOptions as L, NormalizedMessageInput as M, normalizeMessageInput as N, AIAgentConnector as O, MessageResult as P, AIModel as R, NormalizedCallUsage as S, StartAgentOptions as T, SessionToolLedger as U, ISessionToolLedger as V, ToolLedgerEntry as W, ConnectorSendMessageOptions as _, AgentCwdChangeRequestPayload as a, ExecutionContext as b, AgentInterruptRequestPayload as c, AgentMcpServersSetResponsePayload as d, AgentModelChangeRequestPayload as f, BaseAgentConnectorConfig as g, AgentStartResult as h, AgentCredentialChangeResponsePayload as i, markCompletedWithFinalResult as j, MessageDeliveryMode$1 as k, AgentInterruptResponsePayload as l, AgentSendMessageOptions as m, AgentContext as n, AgentCwdChangeResponsePayload as o, AgentModelChangeResponsePayload as p, AgentCredentialChangeRequestPayload as r, AgentIdentity as s, AIAgentConfig as t, AgentMcpServersSetRequestPayload as u, ConnectorStartOptions as v, SendMessageResponsePayload as w, GetCapabilitiesResponsePayload as x, ContextWindowInput as y, AIReasoningLevel$1 as z };
|