@makaio/framework 1.0.0-dev-1781382091626 → 1.0.0-dev-1781397017668
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-CgzOqnVm.mjs → account-identity-D-9gunfD.mjs} +1 -1
- package/dist/adapter-D_p5kKxi.mjs +1 -0
- package/dist/adapters/config/index.d.mts +1 -1
- package/dist/adapters/config/index.mjs +1 -1
- package/dist/adapters/index.d.mts +2 -2
- package/dist/adapters/index.mjs +1 -1
- package/dist/adapters/node.d.mts +1 -1
- package/dist/adapters/node.mjs +1 -1
- package/dist/bus/index.d.mts +6 -5
- package/dist/bus/index.mjs +1 -1
- package/dist/canonical-model-BNb0IFWC.mjs +1 -0
- package/dist/{client-BBJf1mVA.mjs → client-D24ebgGH.mjs} +1 -1
- package/dist/compression-vRUOO-28.mjs +1 -0
- 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/canonical-model/index.d.mts +2 -0
- package/dist/contracts/canonical-model/index.mjs +1 -0
- 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 +7 -7
- 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 +1117 -1559
- 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/{definition-DWWzV-k0.d.mts → definition-CPc6oKaF.d.mts} +1 -1
- package/dist/{detached-extension-handle-Diiwgm13.mjs → detached-extension-handle-BYxNmLfv.mjs} +1 -1
- package/dist/{extension-ZBN4BGre.mjs → extension-CTkoi8MV.mjs} +1 -1
- package/dist/{extension-DfNcE0zm.mjs → extension-DEUfzXcg.mjs} +1 -1
- package/dist/{filesystem-service-BjfrUmGS.mjs → filesystem-service-T8JOIWeP.mjs} +1 -1
- package/dist/git/index.mjs +1 -1
- package/dist/{globby-BIH65cbN.mjs → globby-Bos1vjKj.mjs} +1 -1
- package/dist/{handlers-BAB4fQNH.mjs → handlers-CTrL8wmC.mjs} +2 -2
- package/dist/{harness-B8E_wRwa.mjs → harness-HEpELa_v.mjs} +1 -1
- package/dist/{index-Bw_zL7Rs.d.mts → index-6QvT0ljq.d.mts} +1 -1
- package/dist/{index-BT5tNA3Y.d.mts → index-B3mq3Qjf.d.mts} +1 -1
- package/dist/{index-DQppnGdC.d.mts → index-B92SK0rO.d.mts} +5 -5
- package/dist/index-B99Prx5a.d.mts +859 -0
- package/dist/{index-B1Rz7oUy.d.mts → index-BLqtL-_a.d.mts} +11 -11
- package/dist/{index-Dyz7dzLW.d.mts → index-BM_y78ZA2.d.mts} +9 -9
- package/dist/{index-CKP_uNGT.d.mts → index-BQ8H7cvY.d.mts} +16 -16
- package/dist/{index-C3zfJg6s.d.mts → index-BSFmBEDL.d.mts} +1 -1
- package/dist/{index-wP87FKTQ2.d.mts → index-C0TEY7RE.d.mts} +3 -3
- package/dist/{index-RUN1iHYu.d.mts → index-C24PcW2r.d.mts} +8 -8
- package/dist/{index-Buo9H8RK.d.mts → index-CEdOq5Om.d.mts} +1 -1
- package/dist/{index-Abq3I8wg.d.mts → index-CszoKxxO.d.mts} +141 -138
- package/dist/{index-COwW_2Gb.d.mts → index-DBgv39-Q.d.mts} +60 -60
- package/dist/{index-B2xbnMZe.d.mts → index-DLPjliGd.d.mts} +1 -1
- package/dist/{index-BpniJgxu.d.mts → index-DfNIhEm_.d.mts} +16 -16
- package/dist/{index-dAjtejnc.d.mts → index-DvETyI0_.d.mts} +1 -1
- package/dist/{index-DW8EiMJ9.d.mts → index-NyKdb8kT.d.mts} +28 -28
- package/dist/{index-B8tAGwHR.d.mts → index-QvciMc7_.d.mts} +387 -160
- package/dist/{index-DlvMtyHK.d.mts → index-WKF5BHsw.d.mts} +8 -8
- package/dist/kernel/cli/index.d.mts +2 -2
- package/dist/kernel/cli/index.mjs +1 -1
- package/dist/kernel/cli/register.d.mts +1 -1
- package/dist/kernel/cli/register.mjs +1 -1
- package/dist/kernel/cli/schemas.mjs +1 -1
- package/dist/kernel/extension/index.d.mts +1 -1
- package/dist/kernel/extension/index.mjs +1 -1
- package/dist/kernel/index.d.mts +5 -5
- package/dist/kernel/index.mjs +1 -1
- package/dist/kernel/namespace/index.d.mts +1 -1
- package/dist/kernel/namespace/index.mjs +1 -1
- package/dist/kernel/observability/index.d.mts +1 -1
- package/dist/kernel/observability/index.mjs +1 -1
- package/dist/kernel/providers/index.d.mts +1 -1
- package/dist/kernel/providers/index.mjs +1 -1
- package/dist/kernel/window/index.d.mts +1 -1
- package/dist/kernel/window/index.mjs +1 -1
- package/dist/{lib-Cq5R6Tx9.mjs → lib-DkLlhp9Z.mjs} +1 -1
- package/dist/{lib-nlcl5kRW.mjs → lib-jOuIcSs9.mjs} +1 -1
- package/dist/{load-extensions-D9nbDIiW.d.mts → load-extensions-CQqw0Smr.d.mts} +1 -1
- package/dist/{load-extensions-wELQ4BBN.mjs → load-extensions-D-DyzN4j.mjs} +1 -1
- package/dist/mcp-http-server/index.mjs +1 -1
- package/dist/{namespace-BPlAuhc_.d.mts → namespace-B1Bldc48.d.mts} +117 -9
- package/dist/{namespace-5BLWcC3Q.d.mts → namespace-BAJTZXWc.d.mts} +42 -42
- package/dist/{namespace-Dfq6MDN9.mjs → namespace-BxrHvS5c.mjs} +1 -1
- package/dist/namespace-CH_NWUKW.mjs +1 -0
- package/dist/{namespace-BSNFeJA4.d.mts → namespace-CN2TfSCY.d.mts} +4 -4
- package/dist/{namespace--ROWLToE.d.mts → namespace-C_kaVySz.d.mts} +10 -10
- package/dist/{namespace-CHMszppN.d.mts → namespace-D_ZXa76m.d.mts} +26 -26
- package/dist/{namespace-Ds6HkJEU.d.mts → namespace-DbvQ4HYc.d.mts} +44 -34
- package/dist/{native-session-supervisor-DeKpxhWO.mjs → native-session-supervisor-DbrqcFq9.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-BKFXaKPL.mjs → orchestrator-shared-yFP8e7d5.mjs} +1 -1
- package/dist/{package-DzN_jdqd.mjs → package-Bn665ylV.mjs} +1 -1
- package/dist/package.json +1 -1
- package/dist/primitive-runtime-C2yw4-F8.mjs +1 -0
- package/dist/{profile-D39-Zy_W.mjs → profile-r4G32bCH.mjs} +1 -1
- package/dist/{provider-context-wp4VSJFI.mjs → provider-context-Ds6GNYnE.mjs} +1 -1
- package/dist/rules/index.d.mts +1 -1
- package/dist/rules/index.mjs +1 -1
- package/dist/rules/schemas.d.mts +1 -1
- package/dist/runtime-bun/index.mjs +1 -1
- package/dist/runtime-node/extension-discovery.d.mts +1 -1
- package/dist/runtime-node/extension-validation.d.mts +1 -1
- package/dist/runtime-node/extension-validation.mjs +1 -1
- package/dist/runtime-node/index.d.mts +3 -3
- package/dist/runtime-node/index.mjs +24 -26
- package/dist/runtime-node/makaio-config.d.mts +1 -1
- package/dist/runtime-node/makaio-config.mjs +1 -1
- package/dist/runtime-node/workflow-worker/index.d.mts +1 -1
- package/dist/runtime-node/workflow-worker/index.mjs +1 -1
- package/dist/runtime-node/workflow-worker/worker-entry.mjs +1 -1
- package/dist/{schema-C3TgjrsV.mjs → schema-atatXwNg.mjs} +1 -1
- package/dist/{schema-cNoxaiT0.d.mts → schema-msWs4YhT.d.mts} +2 -2
- package/dist/{schemas-DUE6mc1O.d.mts → schemas-CN9hprME.d.mts} +6 -6
- package/dist/schemas-CiMm2zrE.mjs +1 -0
- package/dist/{schemas-o2Q24yOF.d.mts → schemas-DMl7IKG-.d.mts} +5 -5
- package/dist/{schemas-DsyYsfVN2.d.mts → schemas-DRZJK6hW2.d.mts} +12 -12
- package/dist/{schemas-on3_N5HP.d.mts → schemas-xoTn8JZb.d.mts} +44 -34
- 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 +12 -12
- 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.mjs +1 -1
- package/dist/services/git/schemas.mjs +1 -1
- package/dist/services/harness/index.d.mts +3 -3
- package/dist/services/harness/index.mjs +1 -1
- package/dist/services/index.d.mts +84 -79
- package/dist/services/index.mjs +1 -1
- package/dist/services/log-import/browser.d.mts +2 -2
- package/dist/services/log-import/index.d.mts +2 -2
- package/dist/services/log-import/log-import.d.mts +1 -1
- package/dist/services/log-import/log-import.mjs +1 -1
- package/dist/services/log-import/namespace.d.mts +2 -2
- package/dist/services/log-import/namespace.mjs +1 -1
- package/dist/services/log-import/schemas.d.mts +1 -1
- package/dist/services/log-import/schemas.mjs +1 -1
- package/dist/services/model-registry/index.d.mts +1 -1
- package/dist/services/model-registry/index.mjs +1 -1
- package/dist/services/preferences/index.d.mts +2 -2
- package/dist/services/preferences/schemas.d.mts +1 -1
- package/dist/services/preferences/storage-namespace.d.mts +2 -2
- package/dist/services/provider-context/index.d.mts +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 +12 -12
- package/dist/services/settings/namespace.mjs +1 -1
- package/dist/services/settings/storage/clients-namespace.d.mts +1 -1
- package/dist/services/settings/storage/clients-namespace.mjs +1 -1
- package/dist/services/settings/storage/index.d.mts +3 -3
- package/dist/services/settings/storage/index.mjs +1 -1
- package/dist/services/settings/storage/providers-namespace.d.mts +1 -1
- package/dist/services/settings/storage/providers-namespace.mjs +1 -1
- package/dist/services/subagent/index.d.mts +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/{session-P4nX60Xx.mjs → session-Me3XO-l9.mjs} +2 -2
- package/dist/session-bKk-XeaY.mjs +1 -0
- package/dist/{skill-BNQnWVIG.mjs → skill-B_VlGon5.mjs} +1 -1
- package/dist/{src-CBG3IHUl.mjs → src-6n-8M8EU.mjs} +1 -1
- package/dist/storage/drizzle/client.d.mts +1 -1
- package/dist/storage/drizzle/client.mjs +1 -1
- package/dist/storage/drizzle/index.d.mts +1 -1
- package/dist/storage/drizzle/index.mjs +1 -1
- package/dist/storage/handlers/drizzle/index.d.mts +1 -1
- package/dist/storage/handlers/drizzle/index.mjs +1 -1
- package/dist/storage/handlers/index.d.mts +1 -1
- package/dist/storage/handlers/index.mjs +1 -1
- package/dist/{tool-approval-service-DNHV5x0M.mjs → tool-approval-service-C2xXBtdJ.mjs} +1 -1
- package/dist/{tools-CQImrHAp.mjs → tools-DEUzCPBB.mjs} +1 -1
- package/dist/{types-BtsKrzK7.d.mts → types-4LKM7ZfA.d.mts} +200 -81
- package/dist/{types-D5IMwOkJ.d.mts → types-BB8iIAjZ.d.mts} +1 -1
- package/dist/ui-kernel/index.d.mts +1 -1
- package/dist/ui-kernel/pages/schemas.d.mts +1 -1
- package/dist/{version-B4NO_fID.mjs → version-SYP_DX4M.mjs} +1 -1
- package/dist/workflow-engine/index.d.mts +57 -57
- package/dist/workflow-engine/index.mjs +1 -1
- package/dist/workflow-engine/package.d.mts +1 -1
- package/dist/workflow-engine/package.mjs +1 -1
- package/dist/workflow-engine/workflow-orchestrator.mjs +1 -1
- package/dist/{workflow-worker-CK9Sqj7D.mjs → workflow-worker-CjuRYLmJ.mjs} +1 -1
- package/package.json +5 -1
- package/dist/adapter-UpcpZDOv.mjs +0 -1
- package/dist/namespace-BXqetkc3.mjs +0 -1
- package/dist/primitive-runtime-CNC_bSac.mjs +0 -1
- package/dist/schemas-CuKayWhA.mjs +0 -1
- package/dist/session-BwX5_k47.mjs +0 -1
- /package/dist/{ajv-BA2z5ztb.mjs → ajv-Cx19PP7Q.mjs} +0 -0
- /package/dist/{await-trigger-DREnXCEJ.mjs → await-trigger-uKEHY8E4.mjs} +0 -0
- /package/dist/{base-orchestrator-M5mAB5-w.d.mts → base-orchestrator-BRq4MXa7.d.mts} +0 -0
- /package/dist/{capability-service-jjrFLM6r.mjs → capability-service-CHl8rrwb.mjs} +0 -0
- /package/dist/{cleanEnvForAdapter-vZfPGi0X.mjs → cleanEnvForAdapter-D32WnVuy.mjs} +0 -0
- /package/dist/{client-BJVDImPV.d.mts → client-D2ZftNb6.d.mts} +0 -0
- /package/dist/{clients-namespace-SFk7OTop.d.mts → clients-namespace-CeAB0t06.d.mts} +0 -0
- /package/dist/{config-namespace-DydHz9so.mjs → config-namespace-DW5KHKPW.mjs} +0 -0
- /package/dist/{config-namespace-BzAvE2nY.d.mts → config-namespace-DloU-hNB.d.mts} +0 -0
- /package/dist/{create-static-mount-BB1MIQ9J.mjs → create-static-mount-Bi0VpYS8.mjs} +0 -0
- /package/dist/{cross-spawn-BL6EvJBv.mjs → cross-spawn-C58yEvsS.mjs} +0 -0
- /package/dist/{cursor-storage-CmKjSvKY.mjs → cursor-storage-CpuT5POU.mjs} +0 -0
- /package/dist/{definition-BSghHJpQ.d.mts → definition-BdxbXbrq.d.mts} +0 -0
- /package/dist/{definition-q6iLw11H.d.mts → definition-BwLJnqEo.d.mts} +0 -0
- /package/dist/{descriptor-to-package-CY8oc2gl.mjs → descriptor-to-package-D-FNxohm.mjs} +0 -0
- /package/dist/{drizzle-wjquQK2m.mjs → drizzle-D7dkDEB5.mjs} +0 -0
- /package/dist/{esm-CQVFKEW5.mjs → esm-CP2zvvlx.mjs} +0 -0
- /package/dist/{event-BEllCn16.mjs → event-DaXakaHo.mjs} +0 -0
- /package/dist/{execution-target-CQGYaaM2.mjs → execution-target-Da6Vjvba.mjs} +0 -0
- /package/dist/{extension-discovery-CkV_VRdJ.d.mts → extension-discovery-Bv5FDtrM.d.mts} +0 -0
- /package/dist/{extension-namespace-BBgYOttA.mjs → extension-namespace-O3sKdnY9.mjs} +0 -0
- /package/dist/{facet-DMrryX_0.mjs → facet-Q_vgXb23.mjs} +0 -0
- /package/dist/{filesystem-service-Ddngll0j.d.mts → filesystem-service-89fN-2Dd.d.mts} +0 -0
- /package/dist/{handler-DqpiV9eA.mjs → handler-BIA3ld4C.mjs} +0 -0
- /package/dist/{host-DbMiI5wQ.mjs → host-DFqmG2qO.mjs} +0 -0
- /package/dist/{identity-Bmx-8fPa.mjs → identity-CA5MzB19.mjs} +0 -0
- /package/dist/{index-Dsq2zKvu.d.mts → index-BE-yMFTz.d.mts} +0 -0
- /package/dist/{index-CDU_s69P.d.mts → index-BUilJdHr.d.mts} +0 -0
- /package/dist/{index-C33Tq1ei2.d.mts → index-BVhnqzDC2.d.mts} +0 -0
- /package/dist/{index-Cz9JMjZK.d.mts → index-BeNVLvtk2.d.mts} +0 -0
- /package/dist/{index-D0SUjZmU.d.mts → index-BplsE3qw.d.mts} +0 -0
- /package/dist/{index-C6BhKRnH.d.mts → index-BtL_9HBk.d.mts} +0 -0
- /package/dist/{index-Bsp0O_sI.d.mts → index-CBTp2XuF.d.mts} +0 -0
- /package/dist/{index-BMpRB6iE.d.mts → index-CYZqADXY2.d.mts} +0 -0
- /package/dist/{index-DSV1aFgK.d.mts → index-CfpfkKih.d.mts} +0 -0
- /package/dist/{index-BxFA1XcP.d.mts → index-CkPIPbx9.d.mts} +0 -0
- /package/dist/{index-DOfq0qqv.d.mts → index-D0RWuwl5.d.mts} +0 -0
- /package/dist/{index-CGJjA-hR2.d.mts → index-DHHKwLww.d.mts} +0 -0
- /package/dist/{index-zgm2j9V92.d.mts → index-DJSffYTW2.d.mts} +0 -0
- /package/dist/{index-BpXX9WZJ.d.mts → index-DNmENr9M.d.mts} +0 -0
- /package/dist/{index-9IDJUJ4X.d.mts → index-DVgKfgh1.d.mts} +0 -0
- /package/dist/{index-D6Iyvz9T.d.mts → index-DWqSqcpW.d.mts} +0 -0
- /package/dist/{index-BBvcP-P0.d.mts → index-DdCyeZ59.d.mts} +0 -0
- /package/dist/{index-EsXVjKsv.d.mts → index-GuspCNLR.d.mts} +0 -0
- /package/dist/{index-Drz_a7kW.d.mts → index-cFuQpzIm.d.mts} +0 -0
- /package/dist/{index-BnQSPC6c.d.mts → index-kOSSuOcK.d.mts} +0 -0
- /package/dist/{index-BbCjtc3h.d.mts → index-orAkFukT.d.mts} +0 -0
- /package/dist/{jsonl-transport-C21tpVfe.mjs → jsonl-transport-Bb8ltqOe.mjs} +0 -0
- /package/dist/{lib-CNOQJtgs.mjs → lib-BmcGxHXH.mjs} +0 -0
- /package/dist/{materialization-3QUnQLbC.mjs → materialization-DsPIGQP1.mjs} +0 -0
- /package/dist/{model-registry-B0AIdj7O.mjs → model-registry-DLeMw3l8.mjs} +0 -0
- /package/dist/{model-registry-j-rCKcik.mjs → model-registry-DQDclqdw.mjs} +0 -0
- /package/dist/{namespace--s0d86h-.d.mts → namespace-2G7A4Sza.d.mts} +0 -0
- /package/dist/{namespace-BBVtD1gu.d.mts → namespace-CEqkI6Zu.d.mts} +0 -0
- /package/dist/{namespace-BbjCyZC9.mjs → namespace-CN-Llu7H.mjs} +0 -0
- /package/dist/{namespace-aJJfBJU5.d.mts → namespace-DKnJL0Ja.d.mts} +0 -0
- /package/dist/{namespace-XTGCaSXj.d.mts → namespace-DMhz3yvr.d.mts} +0 -0
- /package/dist/{namespace-DzVf1hVH.d.mts → namespace-DcUwOJ4f.d.mts} +0 -0
- /package/dist/{namespace-B60mn8J-2.d.mts → namespace-Dr1wDUZA2.d.mts} +0 -0
- /package/dist/{namespace-BgPoC46Q.mjs → namespace-DrpHLJAy.mjs} +0 -0
- /package/dist/{namespace-ENv7H7Na.mjs → namespace-FJsnoEQy.mjs} +0 -0
- /package/dist/{namespace-D6X67cUk.mjs → namespace-UUw-S7ia.mjs} +0 -0
- /package/dist/{namespace-uuR0Fg5r.d.mts → namespace-nQS4XwnT.d.mts} +0 -0
- /package/dist/{namespace-nlsvvMtD.d.mts → namespace-q5dD3acO.d.mts} +0 -0
- /package/dist/{namespace-FT8igkn4.mjs → namespace-uGUGfpGQ.mjs} +0 -0
- /package/dist/{namespace-CUOGcGPG.mjs → namespace-zWB-ULrX.mjs} +0 -0
- /package/dist/{orchestrator-shared-D91Wk7z-.d.mts → orchestrator-shared-CbS4ueeq.d.mts} +0 -0
- /package/dist/{out-C1JFb2Bp.mjs → out-BUHr98Xe.mjs} +0 -0
- /package/dist/{package--RZnpN2J.d.mts → package-BEbo1-6S.d.mts} +0 -0
- /package/dist/{package-BzJvtM5O.mjs → package-YQeRE8bV.mjs} +0 -0
- /package/dist/{platform-Dhv22LiX.mjs → platform-CsO-MRJP.mjs} +0 -0
- /package/dist/{providers-B1p0P-vB.mjs → providers-FEZT2bQG.mjs} +0 -0
- /package/dist/{providers-namespace-BqWYkydw.d.mts → providers-namespace-DMUyEbmp.d.mts} +0 -0
- /package/dist/{quick-lru-B9nWXbXI.mjs → quick-lru-C7AXdpbU.mjs} +0 -0
- /package/dist/{registry-RG-bkw3c.mjs → registry-udUhXSIC.mjs} +0 -0
- /package/dist/{schema-CzhOc7TV.mjs → schema-Ba64XQjo.mjs} +0 -0
- /package/dist/{schema-introspection-CuRZPYEc.mjs → schema-introspection-D5FaI5B_.mjs} +0 -0
- /package/dist/{schemas-BCIuTWRl2.mjs → schemas-5kegIs9D.mjs} +0 -0
- /package/dist/{schemas-B77Gi8Xr.d.mts → schemas-9Ifo5zSf.d.mts} +0 -0
- /package/dist/{schemas-BdAf5u58.mjs → schemas-9QC3nvYP.mjs} +0 -0
- /package/dist/{schemas-Dyk7JuVl.d.mts → schemas-BSAKbVyd.d.mts} +0 -0
- /package/dist/{schemas-Kq33MTPY.d.mts → schemas-BxI5Yq8d.d.mts} +0 -0
- /package/dist/{schemas-Chyj6HuZ.d.mts → schemas-CRS7tkFP.d.mts} +0 -0
- /package/dist/{schemas-B5ToLwIs.d.mts → schemas-Cae5dubB.d.mts} +0 -0
- /package/dist/{schemas-hSrzflwZ.mjs → schemas-DAYPhB5K.mjs} +0 -0
- /package/dist/{schemas-DZUaRcYl.d.mts → schemas-DZfBym73.d.mts} +0 -0
- /package/dist/{schemas-C792eVAZ.d.mts → schemas-DznsZ0bq.d.mts} +0 -0
- /package/dist/{semver-DhHJv6Dt.mjs → semver-ClOD8k8c.mjs} +0 -0
- /package/dist/{server-lifecycle-47mygK3E.d.mts → server-lifecycle-5iHxcgBO.d.mts} +0 -0
- /package/dist/{server-lifecycle-Cg47L59Q.mjs → server-lifecycle-CFQaPTf7.mjs} +0 -0
- /package/dist/{session-lineage-CKg6mErA.d.mts → session-lineage-DFkJgYt5.d.mts} +0 -0
- /package/dist/{shared-schemas-DYL7a-No.mjs → shared-schemas-jG3EtHZT.mjs} +0 -0
- /package/dist/{src-DedDL9iv.mjs → src-CRDOZl7K.mjs} +0 -0
- /package/dist/{storage-namespace-BXO3lDVy.mjs → storage-namespace-C1JVmZF1.mjs} +0 -0
- /package/dist/{storage-namespace-definition-C3XbpiP8.d.mts → storage-namespace-definition-BPYSLTfN.d.mts} +0 -0
- /package/dist/{storage-namespace-definition-RvjfFysN.mjs → storage-namespace-definition-Df8S3E3r.mjs} +0 -0
- /package/dist/{storage-namespace-BXmMUd7a.d.mts → storage-namespace-gey7EUhM.d.mts} +0 -0
- /package/dist/{supports-color-fVsgozsi.mjs → supports-color-AnssSSH9.mjs} +0 -0
- /package/dist/{telemetry-O0394b7p.mjs → telemetry-DdbvlZ8s.mjs} +0 -0
- /package/dist/{tray-menu-service-B5YPK_YF.mjs → tray-menu-service-am356993.mjs} +0 -0
- /package/dist/{types-D-bP8RRE.d.mts → types-Bj7cOrBQ.d.mts} +0 -0
- /package/dist/{types-D6jnDjP2.d.mts → types-D-GeeSdd.d.mts} +0 -0
- /package/dist/{types-5Gw3iVpK.d.mts → types-DhlQpVEb.d.mts} +0 -0
- /package/dist/{types-B0BtvVAq.d.mts → types-xLd-e0wf.d.mts} +0 -0
- /package/dist/{variant-COVbYmMs.mjs → variant-BdNN5edM.mjs} +0 -0
- /package/dist/{window-registry-CfEi_Ji4.d.mts → window-registry-CA6AC8n7.d.mts} +0 -0
- /package/dist/{window-registry-XjOExitT.mjs → window-registry-LRjWPwr4.mjs} +0 -0
package/dist/.makaio-build.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
|
-
"fingerprint": "
|
|
4
|
-
"builtAt": "2026-06-
|
|
3
|
+
"fingerprint": "c4b78a6bc58364ea22d54f3c3863523e6adc3c0e74c84b71f017bc3b7d668513",
|
|
4
|
+
"builtAt": "2026-06-14T00:31:21.098Z"
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./json-value-CmhSGMLv.mjs";import"./shared-DpOEfD8F.mjs";import{g as t,h as n}from"./profile-
|
|
1
|
+
import{t as e}from"./json-value-CmhSGMLv.mjs";import"./shared-DpOEfD8F.mjs";import{g as t,h as n}from"./profile-r4G32bCH.mjs";import{n as r}from"./version-SYP_DX4M.mjs";import{z as i}from"zod";const a=i.enum([`strong`,`alias`]),o=i.object({scheme:t,value:t,strength:a}),s=i.object({key:t,label:i.string(),usedPercentage:i.number().finite().min(0).max(100),resetsAt:n.optional()}),c=i.object({windows:i.array(s)}),l=i.record(i.string(),i.unknown()).optional(),u=i.object({clientId:t,found:i.boolean(),version:i.string().optional(),warningMessage:i.string().optional()}),d=i.object({clientId:t,binaryName:t,supportedVersions:r.optional()}),f=i.object({clientAccountId:t,clientId:t,observedAt:n,source:t,displayLabel:i.string().optional(),usage:c,metadata:l}),p=i.discriminatedUnion(`kind`,[i.object({kind:i.literal(`session`),sessionId:t}),i.object({kind:i.literal(`adapter-session`),adapterSessionId:t}),i.object({kind:i.literal(`both`),sessionId:t,adapterSessionId:t})]),m=i.object({clientId:i.string(),source:i.string(),kind:i.string(),observedAt:n,payload:e}),h={request:i.object({clientId:t,observedAt:n.optional(),displayLabel:i.string().optional(),identifiers:i.array(o).min(1),metadata:l}),response:i.object({clientAccountId:t,displayLabel:i.string().optional()})},g={request:m.extend({locator:p}),response:i.object({handled:i.boolean(),sessionId:t.nullable(),clientAccountId:t.nullable(),changed:i.boolean()})},_={request:i.object({clientId:t,observedAt:n,source:t,account:i.object({displayLabel:i.string().optional(),identifiers:i.array(o).min(1)}),usage:c,metadata:l}),response:i.object({clientAccountId:t,snapshot:f})};export{l as a,g as c,f as d,s as f,m as i,p as l,h as n,u as o,c as p,a as r,d as s,o as t,_ as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,o as u,ot as d,p as f,s as p,t as m,u as h,v as g}from"./schemas-CiMm2zrE.mjs";import"./compression-vRUOO-28.mjs";import"./contracts/adapter/schemas/session-lineage.mjs";import{createBusNamespace as _}from"@makaio/framework/core";const v={getCapabilities:d,startAgent:g,infer:e,listAgents:a,getAgent:o,stopAgent:l,rehydrateAgent:f,getConfigSchema:i,"agent.created":r,"session.created":h,"session.discovered":m,"session.usage":c,"session.closed":n,log:p,error:u,initialized:t,quota:s},y=_(`adapter`,v),b=y.subjects;export{b as n,v as r,y as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as BaseAgentConnectorConfig } from "../../types-
|
|
1
|
+
import { g as BaseAgentConnectorConfig } from "../../types-D-GeeSdd.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { IMakaioBus, MakaioBusContext } from "@makaio/framework/bus";
|
|
4
4
|
import { AIModelSchema, ProtocolId, ProviderContext } from "@makaio/framework/contracts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"../../cleanEnvForAdapter-
|
|
1
|
+
import{t as e}from"../../cleanEnvForAdapter-D32WnVuy.mjs";import{z as t}from"zod";import n from"node:fs/promises";import{createBusInstance as r,openChannel as i}from"@makaio/framework/bus";import{AIModelSchema as a,CredentialSubjects as o}from"@makaio/framework/contracts";import{BaseAdapterConfigSchema as s,ProviderConfigSchema as c,ProviderDefaultsSchema as l}from"@makaio/framework/contracts/config";import{ProviderStorageSubjects as u}from"@makaio/framework/services/settings/storage";import{resolveTimeouts as d}from"@makaio/framework/utils";import{AdapterSubsystemSubjects as f}from"@makaio/framework/services/adapter-subsystem";import{resolveClientBinary as p}from"@makaio/framework/clients";async function m(e,t={}){if(e.startsWith(`env:`)){let n=e.slice(4);if(!n)throw Error(`Credential reference is missing environment variable name`);return(t.readEnv??(e=>process.env[e]))(n)||null}if(e.startsWith(`file:`)){let r=e.slice(5);if(!r)throw Error(`Credential reference is missing file path`);return(await(t.readFile??(async e=>await n.readFile(e,`utf-8`)))(r)).trim()||null}if(e.startsWith(`keychain:`)){let[n,...r]=e.slice(9).split(`:`);if(!n||r.length===0)throw Error(`Credential reference is missing keychain service or account`);if(!t.resolveKeychain)throw Error(`Keychain credential resolution is not configured`);return t.resolveKeychain(n,r.join(`:`))}return e||null}function h(e,t){let n=e.find(e=>e.id===t);if(!n)throw Error(`Provider definition not found: '${t}'`);if(!g(n))throw Error(`Provider definition '${t}' is missing a defaultModel`);return n}function g(e){return typeof e.defaultModel==`string`&&e.defaultModel.length>0}const _=t.record(t.string(),t.unknown());function v(e){return{getDefaults:()=>e().adapterDefaults,getConfig:async t=>{let{adapterName:n,adapterDefaults:r,adapterDefinition:i,protocol:a}=e(),{providerContext:o}=t,s=o.endpointOverrides?.[a]??null,c=d([{layer:`adapter`,source:n,config:i.defaultTimeouts},{layer:`runtime`,source:`config.ts`,config:t.runtimeTimeouts}]),l={...r.providerConfig,...t.providerConfig,baseUrl:s??t.providerConfig?.baseUrl??r.providerConfig?.baseUrl},u=t.model??r.model;if(!u)throw Error(`No model resolved for adapter "${n}" (agentId: ${t.agentId}). Provide a model explicitly or configure adapterDefaults.model.`);return{...r,...t,adapterName:t.adapterName,model:u,cwd:t.cwd??r.cwd??process.cwd(),timeouts:c,providerConfig:l}}}}async function y(e,t){let n=Object.entries(t);if(n.length===0)return{};let a={},s=e.getContext(),{token:c}=await r({context:s}).request(o.getChannelToken,{}),l=await i(s,`credentials`,{token:c,transports:[]});try{let e=await Promise.allSettled(n.map(([,e])=>l.request(o.resolve,{ref:e})));for(let t=0;t<n.length;t++){let[r,i]=n[t],o=e[t];if(o.status===`fulfilled`)if(o.value.value!==null)a[r]=o.value.value;else if(o.value.error){let e=JSON.stringify(i);console.warn(`[resolveConnectorCredentials] Failed to resolve field '${r}' (ref ${e}):`,o.value.error)}else{let e=JSON.stringify(i);console.info(`[resolveConnectorCredentials] Credential unavailable for field '${r}' (ref ${e}); omitting it from the resolved connector credentials.`)}else{let e=JSON.stringify(i);console.warn(`[resolveConnectorCredentials] Failed to resolve field '${r}' (ref ${e}):`,o.reason)}}}finally{l.close()}return a}async function b(e,t,n){let{config:r}=await e.request(f.getProviderConfig,{id:t});if(!r)throw Error(`ProviderConfig '${t}' not found`);let{context:i}=await e.request(f.buildProviderContext,{providerConfigId:t});if(!i)throw Error(`ProviderConfig '${t}' not found`);if(i.definitionId!==r.definitionId)throw Error(`ProviderConfig '${t}' changed during resolution; retry`);let{provider:a}=await e.request(u.get,{id:i.definitionId});if(!a)throw Error(`ProviderDefinition '${r.definitionId}' not found for config '${t}'`);return{config:r,definition:a,baseUrl:i.endpointOverrides?.[n]??a.endpoints?.[n]??null,credentials:await y(e,i.credentialRefs)}}async function x(e,t,n){let{baseUrl:r,credentials:i}=await b(e,t,n);if(!r)throw Error(`Could not resolve baseUrl for ProviderConfig '${t}' with protocol '${n}'. Ensure the provider definition or config override declares an endpoint for this protocol.`);let a=i.apiKey;if(!a)throw Error(`Could not resolve apiKey for ProviderConfig '${t}'. Store credentials via settings before using this provider.`);return{baseUrl:r,apiKey:a}}function S(e,t){if(!t)return{};let n={};for(let[r,i]of Object.entries(t)){let t=e[r];t!==void 0&&(n[i]=t)}return n}async function C(t){let{bus:n,providerContext:r,clientId:i,baseEnv:a={}}=t,o=await y(n,r?.credentialRefs??{}),s=S(o,r?.credentialEnvVars),c=await p(i);return{credentials:o,credEnv:s,resolvedBinary:c,spawnEnv:{...e(a,{omitEnvVars:r?.ambientCredentialEnvVars}),...s,...c?.env??{}}}}export{a as AIModelSchema,s as BaseAdapterConfigSchema,_ as BaseProviderConfigSchema,c as ProviderConfigSchema,l as ProviderDefaultsSchema,S as buildCredentialEnv,v as createAdapterConfigFactory,h as getDefinitionOrThrow,y as resolveConnectorCredentials,m as resolveCredentialRef,x as resolveProviderEndpoint,b as resolveProviderResolution,C as resolveSessionEnvironment};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as MessageHandle, B as ReasoningLevelMap, C as SendMessageRequestPayload, D as IAdapterConfigFactory, E as ConfigFactoryInput, F as MessageState, H as LedgerSessionContext, I as ProcessingState, L as SendMessageOptions, M as NormalizedMessageInput, N as normalizeMessageInput, O as AIAgentConnector, P as MessageResult, R as AIModel, S as NormalizedCallUsage, T as StartAgentOptions, U as SessionToolLedger, V as ISessionToolLedger, W as ToolLedgerEntry, _ as ConnectorSendMessageOptions, a as AgentCwdChangeRequestPayload, b as ExecutionContext, c as AgentInterruptRequestPayload, d as AgentMcpServersSetResponsePayload, f as AgentModelChangeRequestPayload, g as BaseAgentConnectorConfig, h as AgentStartResult, i as AgentCredentialChangeResponsePayload, j as markCompletedWithFinalResult, k as MessageDeliveryMode, l as AgentInterruptResponsePayload, m as AgentSendMessageOptions, n as AgentContext, o as AgentCwdChangeResponsePayload, p as AgentModelChangeResponsePayload, r as AgentCredentialChangeRequestPayload, s as AgentIdentity, t as AIAgentConfig, u as AgentMcpServersSetRequestPayload, v as ConnectorStartOptions, w as SendMessageResponsePayload, x as GetCapabilitiesResponsePayload, y as ContextWindowInput, z as AIReasoningLevel } from "../types-
|
|
2
|
-
import { _ as LogImporterConfig, a as CompactionMetadata, b as StorageMessagePayload, c as ExternalToolIdentifiers, d as ImportMetadata, f as ImportSegment, g as LogImporter, h as LogImportTestConfig, l as ExternalToolMeta, m as LogImportSessionContext, n as LogOrchestratorConfig, o as DiscoveryMetadata, p as ImportSegmentLineage, r as ParseFileResult, s as ExternalToolIdentifier, u as ImportCursorPosition, v as NormalizedEvent, x as toImportSegment, y as ProcessLogFileResult } from "../base-orchestrator-
|
|
1
|
+
import { A as MessageHandle, B as ReasoningLevelMap, C as SendMessageRequestPayload, D as IAdapterConfigFactory, E as ConfigFactoryInput, F as MessageState, H as LedgerSessionContext, I as ProcessingState, L as SendMessageOptions, M as NormalizedMessageInput, N as normalizeMessageInput, O as AIAgentConnector, P as MessageResult, R as AIModel, S as NormalizedCallUsage, T as StartAgentOptions, U as SessionToolLedger, V as ISessionToolLedger, W as ToolLedgerEntry, _ as ConnectorSendMessageOptions, a as AgentCwdChangeRequestPayload, b as ExecutionContext, c as AgentInterruptRequestPayload, d as AgentMcpServersSetResponsePayload, f as AgentModelChangeRequestPayload, g as BaseAgentConnectorConfig, h as AgentStartResult, i as AgentCredentialChangeResponsePayload, j as markCompletedWithFinalResult, k as MessageDeliveryMode, l as AgentInterruptResponsePayload, m as AgentSendMessageOptions, n as AgentContext, o as AgentCwdChangeResponsePayload, p as AgentModelChangeResponsePayload, r as AgentCredentialChangeRequestPayload, s as AgentIdentity, t as AIAgentConfig, u as AgentMcpServersSetRequestPayload, v as ConnectorStartOptions, w as SendMessageResponsePayload, x as GetCapabilitiesResponsePayload, y as ContextWindowInput, z as AIReasoningLevel } from "../types-D-GeeSdd.mjs";
|
|
2
|
+
import { _ as LogImporterConfig, a as CompactionMetadata, b as StorageMessagePayload, c as ExternalToolIdentifiers, d as ImportMetadata, f as ImportSegment, g as LogImporter, h as LogImportTestConfig, l as ExternalToolMeta, m as LogImportSessionContext, n as LogOrchestratorConfig, o as DiscoveryMetadata, p as ImportSegmentLineage, r as ParseFileResult, s as ExternalToolIdentifier, u as ImportCursorPosition, v as NormalizedEvent, x as toImportSegment, y as ProcessLogFileResult } from "../base-orchestrator-BRq4MXa7.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import * as _$_makaio_core0 from "@makaio/framework/core";
|
|
5
5
|
import { CreateBusNamespaceOptions, ExtractSubjectPayload, FilterablePayloadIntersection, HandlerForSubjectDefinition, RequestContext, SchemaRecord, ScopedSubjectDefinition, SubjectDefinition, SubjectRecordFromSchemaRecord } from "@makaio/framework/core";
|
package/dist/adapters/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e,t}from"../chunk-DTipWd-i.mjs";import{t as n}from"../cleanEnvForAdapter-
|
|
1
|
+
import{o as e,t}from"../chunk-DTipWd-i.mjs";import{t as n}from"../cleanEnvForAdapter-D32WnVuy.mjs";import{i as r,n as i,r as a,t as o}from"../cursor-storage-CpuT5POU.mjs";import{_ as s,a as c,c as l,d as u,f as d,g as f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as ee,s as b,t as te,u as x,v as S}from"../ajv-Cx19PP7Q.mjs";import{z as C}from"zod";import*as ne from"node:fs";import{AuthenticationError as re,DirectoryNotFoundError as ie,ModelUnavailableError as ae,QuotaExceededError as oe,RateLimitError as se,createBusNamespace as ce}from"@makaio/framework/core";import{MakaioBus as w,NoHandlerError as le,RequestError as ue}from"@makaio/framework/bus";import{AdapterSubjects as T,AgentSubjects as E,AgentToolApproveSchema as D,HarnessSubjects as O,MCP_CALL_TOOL_NAME as de,McpSubjects as k,SessionContextSchema as A,SessionSubjects as j}from"@makaio/framework/contracts";import{TurnStorageSubjects as fe}from"@makaio/framework/services/turn";import{CredentialRefSchema as pe}from"@makaio/framework/contracts/config";import{runPostUserMessageHooks as me,runPreUserMessageHooks as he}from"@makaio/framework/hooks";import{activateProviderContextStrict as ge,buildProviderContext as _e}from"@makaio/framework/services/provider-context";import ve from"node:os";import{AgentStorageSubjects as M}from"@makaio/framework/services/session";import{DeferredPromise as N,resolveTimeouts as ye}from"@makaio/framework/utils";import*as be from"node:process";function xe(e,t,n){return w.registerNamespace(ce(e,t,n))}function P(e){let t=[];try{return JSON.stringify(e,function(e,n){if(typeof n==`bigint`)return n.toString();if(typeof n==`object`&&n){for(;t.length>0&&t[t.length-1]!==this;)t.pop();if(t.includes(n))return`[Circular]`;t.push(n)}return n},2)??`[Non-serializable value]`}catch{try{return String(e)}catch{return`[Non-serializable value]`}}}function Se(e){return e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`).replaceAll(`'`,`'`)}function Ce(e){let t=e.replace(/[^a-zA-Z0-9_-]/g,`_`);return t.length===0?`context`:/^[A-Za-z_]/.test(t)?t:`context_${t}`}function we(e,t){let n=Ce(e);return`<${n}>\n${Se(t)}\n</${n}>`}function Te(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.name==`string`&&typeof t.description==`string`&&(t.compatibility===void 0||typeof t.compatibility==`string`)}function Ee(e){if(typeof e!=`object`||!e)return!1;let t=e,n=t.metadata,r=n;return typeof t.name==`string`&&typeof t.content==`string`&&(t.license===void 0||typeof t.license==`string`)&&(t.compatibility===void 0||typeof t.compatibility==`string`)&&(t.allowedTools===void 0||typeof t.allowedTools==`string`)&&(n===void 0||typeof n==`object`&&!!n&&Object.values(r??{}).every(e=>typeof e==`string`))}function De(e){if(!Array.isArray(e))return;let t=e.filter(Te).sort((e,t)=>e.name.localeCompare(t.name)).map(e=>e.compatibility?`- ${e.name}: ${e.description} Compatibility: ${e.compatibility}`:`- ${e.name}: ${e.description}`);return t.length>0?t.join(`
|
|
2
2
|
`):void 0}function Oe(e){if(!Array.isArray(e))return;let t=e.filter(Ee).sort((e,t)=>e.name.localeCompare(t.name)).map(e=>{let t=[`## ${e.name}`];return e.compatibility&&t.push(`Compatibility: ${e.compatibility}`),t.push(e.content),t.join(`
|
|
3
3
|
`)});return t.length>0?t.join(`
|
|
4
4
|
|
package/dist/adapters/node.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as LogImporter, i as LogFileChangeEvent, n as LogOrchestratorConfig, t as BaseLogOrchestrator } from "../base-orchestrator-
|
|
1
|
+
import { g as LogImporter, i as LogFileChangeEvent, n as LogOrchestratorConfig, t as BaseLogOrchestrator } from "../base-orchestrator-BRq4MXa7.mjs";
|
|
2
2
|
|
|
3
3
|
//#region adapters/core/src/log-importer/jsonl-parser.d.ts
|
|
4
4
|
/**
|
package/dist/adapters/node.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e,t}from"../chunk-DTipWd-i.mjs";import{i as n,r}from"../cursor-storage-
|
|
1
|
+
import{o as e,t}from"../chunk-DTipWd-i.mjs";import{i as n,r}from"../cursor-storage-CpuT5POU.mjs";import{t as i}from"../globby-Bos1vjKj.mjs";import*as a from"node:fs/promises";import*as o from"node:path";import{MakaioBus as s}from"@makaio/framework/bus";import{AdapterSubjects as c,SessionStorageSubjects as l,SessionSubjects as u}from"@makaio/framework/contracts";const d=65536;async function f(e){let{filePath:t,startOffset:n=0}=e,r=[],i=[],o=n,s;try{s=await a.open(t,`r`);let e=await s.stat();if(n>=e.size)return{records:r,bytesRead:n,errors:i};let c=Buffer.alloc(d),l=``,u=n,f=0;for(n>0&&(f=await _(s,n));u<e.size;){let{bytesRead:e}=await s.read(c,0,d,u);if(e===0)break;l+=c.toString(`utf8`,0,e),u+=e;let t=l.split(`
|
|
2
2
|
`),n=t.pop();for(let e of t){if(f++,e.trim()===``){o+=Buffer.byteLength(e,`utf8`)+1;continue}let t=h(e,f);t.success?r.push(t.record):i.push(t.error),o+=Buffer.byteLength(e,`utf8`)+1}l=n??``}return{records:r,bytesRead:o,errors:i}}finally{s&&await s.close()}}async function p(e,t){let n=[],r;try{r=await a.open(e,`r`);let i=Buffer.alloc(d),o=``,s=0;for(;n.length<t;){let{bytesRead:e}=await r.read(i,0,d,s);if(e===0)break;o+=i.toString(`utf8`,0,e),s+=e;let a=o.split(`
|
|
3
3
|
`);o=a.pop()??``;for(let e of a){if(n.length>=t)break;let r=e.trim();if(r!==``)try{n.push(JSON.parse(r))}catch{}}}return n}finally{r&&await r.close()}}async function m(e,t){let n;try{n=await a.open(e,`r`);let r=Buffer.alloc(d),i=``,o=0;for(;;){let{bytesRead:e}=await n.read(r,0,d,o);if(e===0)break;i+=r.toString(`utf8`,0,e),o+=e;let a=i.split(`
|
|
4
4
|
`);i=a.pop()??``;for(let e of a){let n=e.trim();if(n!==``)try{if(t(JSON.parse(n)))return!0}catch{}}}return!1}finally{n&&await n.close()}}function h(e,t){try{return{success:!0,record:JSON.parse(e)}}catch(n){return{success:!1,error:{line:t,error:n instanceof Error?n.message:String(n),content:g(e)}}}}function g(e){return e.length<=200?e:e.slice(0,200)+`...`}async function _(e,t){let n=0,r=Buffer.alloc(d),i=0;for(;i<t;){let a=Math.min(d,t-i),{bytesRead:o}=await e.read(r,0,a,i);if(o===0)break;for(let e=0;e<o;e++)r[e]===10&&n++;i+=o}return n}var v=e(t(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))(),1),y=class e extends Error{name=`TimeoutError`;constructor(t,n){super(t,n),Error.captureStackTrace?.(this,e)}};const b=e=>e.reason??new DOMException(`This operation was aborted.`,`AbortError`);function x(e,t){let{milliseconds:n,fallback:r,message:i,customTimers:a={setTimeout,clearTimeout},signal:o}=t,s,c,l=new Promise((t,l)=>{if(typeof n!=`number`||Math.sign(n)!==1)throw TypeError(`Expected \`milliseconds\` to be a positive number, got \`${n}\``);if(o?.aborted){l(b(o));return}if(o&&(c=()=>{l(b(o))},o.addEventListener(`abort`,c,{once:!0})),e.then(t,l),n===1/0)return;let u=new y;s=a.setTimeout.call(void 0,()=>{if(r){try{t(r())}catch(e){l(e)}return}typeof e.cancel==`function`&&e.cancel(),i===!1?t():i instanceof Error?l(i):(u.message=i??`Promise timed out after ${n} milliseconds`,l(u))},n)}).finally(()=>{l.clear(),c&&o&&o.removeEventListener(`abort`,c)});return l.clear=()=>{a.clearTimeout.call(void 0,s),s=void 0},l}function S(e,t,n){let r=0,i=e.length;for(;i>0;){let a=Math.trunc(i/2),o=r+a;n(e[o],t)<=0?(r=++o,i-=a+1):i=a}return r}var C=class{#e=[];#t=0;enqueue(e,t){let{priority:n=0,id:r}=t??{},{size:i}=this,a={priority:n,id:r,run:e};if(i===0){this.#e.length=0,this.#t=0,this.#e.push(a);return}if(this.#e.at(-1).priority>=n){this.#e.push(a);return}this.#n();let o=S(this.#e,a,(e,t)=>t.priority-e.priority);this.#e.splice(o,0,a)}setPriority(e,t){let n=this.#e.findIndex((t,n)=>n>=this.#t&&t.id===e);if(n===-1)throw ReferenceError(`No promise function with the id "${e}" exists in the queue.`);let[r]=this.#e.splice(n,1);this.enqueue(r.run,{priority:t,id:e})}remove(e){let t=this.#e.findIndex((t,n)=>n<this.#t?!1:typeof e==`string`?t.id===e:t.run===e);t!==-1&&this.#e.splice(t,1)}dequeue(){if(this.#t===this.#e.length)return;let e=this.#e[this.#t];return this.#t++,this.#t===this.#e.length?(this.#e.length=0,this.#t=0):this.#t>100&&this.#t>this.#e.length/2&&this.#n(),e?.run}filter(e){let t=[];for(let n=this.#t;n<this.#e.length;n++){let r=this.#e[n];r.priority===e.priority&&t.push(r.run)}return t}get size(){return this.#e.length-this.#t}#n(){this.#t!==0&&(this.#e.splice(0,this.#t),this.#t=0)}},w=class extends v.default{#e;#t;#n=0;#r;#i=!1;#a=!1;#o;#s=0;#c=0;#l;#u;#d;#f=[];#p=0;#m;#h;#g=0;#_;#v;#y=1n;#b=new Map;#x=new Set;timeout;constructor(e){if(super(),e={carryoverIntervalCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:C,strict:!1,...e},!(typeof e.intervalCap==`number`&&e.intervalCap>=1))throw TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??``}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??``}\` (${typeof e.interval})`);if(e.strict&&e.interval===0)throw TypeError("The `strict` option requires a non-zero `interval`");if(e.strict&&e.intervalCap===1/0)throw TypeError("The `strict` option requires a finite `intervalCap`");if(this.#e=e.carryoverIntervalCount??e.carryoverConcurrencyCount??!1,this.#t=e.intervalCap===1/0||e.interval===0,this.#r=e.intervalCap,this.#o=e.interval,this.#d=e.strict,this.#m=new e.queueClass,this.#h=e.queueClass,this.concurrency=e.concurrency,e.timeout!==void 0&&!(Number.isFinite(e.timeout)&&e.timeout>0))throw TypeError(`Expected \`timeout\` to be a positive finite number, got \`${e.timeout}\` (${typeof e.timeout})`);this.timeout=e.timeout,this.#v=e.autoStart===!1,this.#z()}#S(e){for(;this.#p<this.#f.length;){let t=this.#f[this.#p];if(t!==void 0&&e-t>=this.#o)this.#p++;else break}(this.#p>100&&this.#p>this.#f.length/2||this.#p===this.#f.length)&&(this.#f=this.#f.slice(this.#p),this.#p=0)}#C(e){this.#d?this.#f.push(e):this.#n++}#w(){this.#d?this.#f.length>this.#p&&this.#f.pop():this.#n>0&&this.#n--}#T(){return this.#f.length-this.#p}get#E(){return this.#t?!0:this.#d?this.#T()<this.#r:this.#n<this.#r}get#D(){return this.#g<this.#_}#O(){this.#g--,this.#g===0&&this.emit(`pendingZero`),this.#P(),this.emit(`next`)}#k(){this.#u=void 0,this.#I(),this.#F()}#A(e){if(this.#d){if(this.#S(e),this.#T()>=this.#r){let t=this.#f[this.#p],n=this.#o-(e-t);return this.#j(n),!0}return!1}if(this.#l===void 0){let t=this.#s-e;if(t<0){if(this.#c>0){let t=e-this.#c;if(t<this.#o)return this.#j(this.#o-t),!0}this.#n=this.#e?this.#g:0}else return this.#j(t),!0}return!1}#j(e){this.#u===void 0&&(this.#u=setTimeout(()=>{this.#k()},e))}#M(){this.#l&&=(clearInterval(this.#l),void 0)}#N(){this.#u&&=(clearTimeout(this.#u),void 0)}#P(){if(this.#m.size===0){if(this.#M(),this.emit(`empty`),this.#g===0){if(this.#N(),this.#d&&this.#p>0){let e=Date.now();this.#S(e)}this.emit(`idle`)}return!1}let e=!1;if(!this.#v){let t=Date.now(),n=!this.#A(t);if(this.#E&&this.#D){let r=this.#m.dequeue();this.#t||(this.#C(t),this.#B()),this.emit(`active`),r(),n&&this.#F(),e=!0}}return e}#F(){this.#t||this.#l!==void 0||this.#d||(this.#l=setInterval(()=>{this.#I()},this.#o),this.#s=Date.now()+this.#o)}#I(){this.#d||(this.#n===0&&this.#g===0&&this.#l&&this.#M(),this.#n=this.#e?this.#g:0),this.#L(),this.#B()}#L(){for(;this.#P(););}get concurrency(){return this.#_}set concurrency(e){if(!(typeof e==`number`&&e>=1))throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#_=e,this.#L()}setPriority(e,t){if(typeof t!=`number`||!Number.isFinite(t))throw TypeError(`Expected \`priority\` to be a finite number, got \`${t}\` (${typeof t})`);this.#m.setPriority(e,t)}async add(e,t={}){return t={timeout:this.timeout,...t,id:t.id??(this.#y++).toString()},new Promise((n,r)=>{let i=Symbol(`task-${t.id}`),a=()=>void 0,o=async()=>{a(),this.#g++,this.#b.set(i,{id:t.id,priority:t.priority??0,startTime:Date.now(),timeout:t.timeout});let o;try{try{t.signal?.throwIfAborted()}catch(e){throw this.#V(),this.#b.delete(i),e}this.#c=Date.now();let r=e({signal:t.signal});if(t.timeout&&(r=x(Promise.resolve(r),{milliseconds:t.timeout,message:`Task timed out after ${t.timeout}ms (queue has ${this.#g} running, ${this.#m.size} waiting)`})),t.signal){let{signal:e}=t;r=Promise.race([r,new Promise((t,n)=>{o=()=>{n(e.reason)},e.addEventListener(`abort`,o,{once:!0})})])}let a=await r;n(a),this.emit(`completed`,a)}catch(e){r(e),this.emit(`error`,e)}finally{o&&t.signal?.removeEventListener(`abort`,o),this.#b.delete(i),queueMicrotask(()=>{this.#O()})}};this.#m.enqueue(o,t);let s=()=>{if(this.#m instanceof C){this.#m.remove(o);return}this.#m.remove?.(t.id)};if(t.signal){let{signal:e}=t,n=()=>{a(),s(),r(e.reason),this.#P(),this.emit(`next`)};if(a=()=>{e.removeEventListener(`abort`,n),this.#x.delete(a)},e.aborted){n();return}e.addEventListener(`abort`,n,{once:!0}),this.#x.add(a)}this.emit(`add`),this.#P()})}async addAll(e,t){return Promise.all(e.map(async e=>this.add(e,t)))}start(){return this.#v?(this.#v=!1,this.#L(),this):this}pause(){this.#v=!0}clear(){for(let e of this.#x)e();this.#m=new this.#h,this.#M(),this.#H(),this.emit(`empty`),this.#g===0&&(this.#N(),this.emit(`idle`)),this.emit(`next`)}async onEmpty(){this.#m.size!==0&&await this.#R(`empty`)}async onSizeLessThan(e){this.#m.size<e||await this.#R(`next`,()=>this.#m.size<e)}async onIdle(){this.#g===0&&this.#m.size===0||await this.#R(`idle`)}async onPendingZero(){this.#g!==0&&await this.#R(`pendingZero`)}async onRateLimit(){this.isRateLimited||await this.#R(`rateLimit`)}async onRateLimitCleared(){this.isRateLimited&&await this.#R(`rateLimitCleared`)}onError(){return new Promise((e,t)=>{let n=e=>{this.off(`error`,n),t(e)};this.on(`error`,n)})}async#R(e,t){return new Promise(n=>{let r=()=>{t&&!t()||(this.off(e,r),n())};this.on(e,r)})}get size(){return this.#m.size}sizeBy(e){return this.#m.filter(e).length}get pending(){return this.#g}get isPaused(){return this.#v}#z(){this.#t||(this.on(`add`,()=>{this.#m.size>0&&this.#B()}),this.on(`next`,()=>{this.#B()}))}#B(){this.#t||this.#a||(this.#a=!0,queueMicrotask(()=>{this.#a=!1,this.#H()}))}#V(){this.#t||(this.#w(),this.#B())}#H(){let e=this.#i;if(this.#t||this.#m.size===0){e&&(this.#i=!1,this.emit(`rateLimitCleared`));return}let t;if(this.#d){let e=Date.now();this.#S(e),t=this.#T()}else t=this.#n;let n=t>=this.#r;n!==e&&(this.#i=n,this.emit(n?`rateLimit`:`rateLimitCleared`))}get isRateLimited(){return this.#i}get isSaturated(){return this.#g===this.#_&&this.#m.size>0||this.isRateLimited&&this.#m.size>0}get runningTasks(){return[...this.#b.values()].map(e=>({...e,timeoutRemaining:e.timeout?Math.max(0,e.startTime+e.timeout-Date.now()):void 0}))}},T=class{eventQueue;cursorQueue;onEventEmitted;constructor(e){this.onEventEmitted=e.onEventEmitted,this.eventQueue=new w({concurrency:1,interval:1e3,intervalCap:e.eventsPerSecond}),this.cursorQueue=new w({concurrency:1})}queueEvent(e){return this.eventQueue.add(async()=>{await s.emit(e.subject,e.payload),this.onEventEmitted()})}queueAfterEvents(e,t=[]){let n=Promise.all(t);return n.catch(()=>void 0),this.cursorQueue.add(async()=>{await n,await e()})}async drain(){await Promise.all([this.eventQueue.onIdle(),this.cursorQueue.onIdle()])}async onIdle(){await this.drain()}},E=class{options;emittery=new n;trackedFiles=new Map;pollTimer;isPolling=!1;isDisposed=!1;inFlightChecks=new Map;constructor(e){if(!o.isAbsolute(e.directory))throw Error(`Directory must be an absolute path: ${e.directory}`);this.options={directory:e.directory,pattern:e.pattern,pollIntervalMs:e.pollIntervalMs??1e4}}on(e,t){return this.emittery.on(e,t)}once(e,t){return this.emittery.once(e,t)}async start(){this.isDisposed||this.pollTimer===void 0&&(await this.poll(),this.pollTimer=setInterval(()=>{this.poll()},this.options.pollIntervalMs))}stop(){this.pollTimer!==void 0&&(clearInterval(this.pollTimer),this.pollTimer=void 0)}dispose(){this.isDisposed=!0,this.stop(),this.emittery.clearListeners(),this.trackedFiles.clear(),this.inFlightChecks.clear()}isRunning(){return this.pollTimer!==void 0}getTrackedFiles(){return this.trackedFiles}seedFromCursors(e){for(let t of e)this.trackedFiles.set(t.filePath,{size:t.bytesRead,mtimeMs:new Date(t.lastModified).getTime()})}async poll(){if(!this.isDisposed&&!this.isPolling){this.isPolling=!0;try{let e=await this.discoverFiles(),t=new Set(e);for(let e of this.trackedFiles.keys())if(!t.has(e)){if(this.isDisposed)return;this.trackedFiles.delete(e),await this.emittery.emit(`deleted`,{filePath:e})}for(let t of e)try{await this.runFileCheck(t)}catch(e){await this.emitWatcherError(e,t)}if(this.isDisposed)return;await this.emittery.emit(`polled`,{trackedFilePaths:new Set(this.trackedFiles.keys())})}catch(e){await this.emitWatcherError(e)}finally{this.isPolling=!1}}}async discoverFiles(){return i(this.options.pattern,{cwd:this.options.directory,absolute:!0,onlyFiles:!0})}async checkFile(e){if(this.isDisposed)return;let t=await a.stat(e);if(this.isDisposed)return;let n={size:t.size,mtimeMs:t.mtimeMs},r=this.trackedFiles.get(e);if(!r){if(this.trackedFiles.set(e,n),this.isDisposed){this.trackedFiles.delete(e);return}await this.emittery.emit(`change`,{filePath:e,stat:{size:t.size,mtime:t.mtime},changeType:`created`});return}if(n.mtimeMs!==r.mtimeMs){let i=n.size<r.size?`rotated`:`modified`;if(this.trackedFiles.set(e,n),this.isDisposed)return;await this.emittery.emit(`change`,{filePath:e,stat:{size:t.size,mtime:t.mtime},changeType:i})}}clearTrackedFile(e){return this.trackedFiles.delete(e)}clearAllTrackedFiles(){this.trackedFiles.clear()}triggerImmediatePoll(e){this.runFileCheck(e).catch(t=>{this.emitWatcherError(t,e)})}async runFileCheck(e){if(this.isDisposed)return;let t=this.inFlightChecks.get(e);if(t){await t;return}let n=(async()=>{try{await this.checkFile(e)}finally{this.inFlightChecks.delete(e)}})();this.inFlightChecks.set(e,n),await n}async emitWatcherError(e,t){let n=e instanceof Error?e:Error(String(e));try{await this.emittery.emit(`error`,{error:n,filePath:t})}catch(e){console.error(`[LogFileWatcher] Error listener failed:`,e instanceof Error?e.message:String(e))}}},D=class{watcher;constructor(e){this.watcher=new E(e)}isRunning(){return this.watcher.isRunning()}async start(){await this.watcher.start()}stop(){this.watcher.stop()}dispose(){this.watcher.dispose()}onChange(e){return this.watcher.on(`change`,e)}onError(e){return this.watcher.on(`error`,e)}onDeleted(e){return this.watcher.on(`deleted`,e)}onPolled(e){return this.watcher.on(`polled`,({trackedFilePaths:t})=>e(t))}getTrackedFileMtimeMs(e){return this.watcher.getTrackedFiles().get(e)?.mtimeMs}triggerImmediatePoll(e){this.watcher.triggerImmediatePoll(e)}seedFromCursors(e){this.watcher.seedFromCursors(e)}},O=class{filesProcessed=0;eventsEmitted=0;sessionsImported=new Set;sessionsSkipped=new Set;lastLoggedEventCount=0;lastLoggedSnapshot=``;reset(){this.filesProcessed=0,this.eventsEmitted=0,this.sessionsImported.clear(),this.sessionsSkipped.clear(),this.lastLoggedEventCount=0,this.lastLoggedSnapshot=``}recordFileProcessed(){this.filesProcessed++}recordEventEmitted(e){this.eventsEmitted++,!(this.eventsEmitted-this.lastLoggedEventCount<1e3)&&(console.info(`${e} Imported ${this.eventsEmitted} events (${this.sessionsImported.size} sessions)...`),this.lastLoggedEventCount=this.eventsEmitted)}recordSessionImported(e){this.sessionsImported.add(e)}recordSessionSkipped(e){this.sessionsSkipped.add(e)}hasActivity(){return this.eventsEmitted>0||this.filesProcessed>0}stoppedMessage(e){return`${e} Stopped - ${this.eventsEmitted} events from ${this.sessionsImported.size} sessions (${this.sessionsSkipped.size} skipped)`}logProgress(e){if(!this.hasActivity())return;let t=JSON.stringify({eventsEmitted:this.eventsEmitted,filesProcessed:this.filesProcessed,sessionsImported:this.sessionsImported.size,sessionsSkipped:this.sessionsSkipped.size});t!==this.lastLoggedSnapshot&&(this.lastLoggedSnapshot=t,console.info(`${e} Progress: ${this.eventsEmitted} events, ${this.sessionsImported.size} sessions, ${this.filesProcessed} files, ${this.sessionsSkipped.size} skipped`))}};function k(){return async e=>{try{let t=await s.request(u.getByAdapterSessionId,{adapterSessionId:e});return t.session!==null&&!t.session.isImported}catch{return!1}}}var A=class{checkedSessions=new Map;inFlight=new Map;async isSkipped(e,t,n){let r=this.checkedSessions.get(e);if(r!==void 0)return r;let i=this.inFlight.get(e);return i||(i=t(e).then(t=>(this.checkedSessions.set(e,t),t&&n(e),t)).finally(()=>{this.inFlight.delete(e)}),this.inFlight.set(e,i)),i}clear(){this.checkedSessions.clear(),this.inFlight.clear()}};function j(e,t,n,r){return!n||!e||r===`rotated`?!1:new Date(e)>=t}function M(e,t,n){for(let r of n??[]){let n=r.line===void 0?``:` at line ${r.line}`;console.warn(`${e} Parse error in ${t}${n}: ${r.error}`)}}async function N(e,t,n,i){let{cursor:a}=await s.request(r.get,{filePath:e});return a&&a.bytesRead>0&&!a.sessionContext&&!t?(await s.request(r.delete,{filePath:e}).catch(()=>{}),i(n),`retry`):a}async function P(e,t,n,r,i,a){let o=await a.parseFile(e,0);M(i,e,o.errors);let s=a.validateRecords(o.records);s.length>0&&await a.handleFirstRead(e,s,o.bytesRead??0,t,n,0,r)}function F(e,t,n,r,i){let a=[];n&&(a.push(i(t.sessionEvent)),a.push(i(t.startedEvent)));let o=r(e,t);for(let e of o)a.push(i(e));return a}function I(e,t){let n=[];for(let r of e)n.push(t(r));return n}function L(e){return typeof e==`object`&&!!e&&`compactionDetected`in e&&e.compactionDetected===!0}function R(e,t,n){return{...e,state:n(t)}}var z=class{tasks=new Set;track(e){this.tasks.add(e),e.finally(()=>{this.tasks.delete(e)})}async drain(){for(;this.tasks.size>0;)await Promise.allSettled([...this.tasks])}},B=class{config;watcher;eventQueue;importer;managedSessionCache=new A;unsubscribeChange;unsubscribeError;unsubscribeDeleted;stats=new O;watcherTasks=new z;progressTimer;constructor(e,t){this.importer=t;let n=e.directory??t.getLogDirectory();this.config={enabled:e.enabled,directory:e.directory,pollIntervalMs:e.pollIntervalMs??1e4,eventsPerSecond:e.eventsPerSecond??100,adapterId:e.adapterId,adapterName:e.adapterName,checkMakaioManaged:e.checkMakaioManaged},this.watcher=new D({directory:n,pattern:this.getLogFilePattern(),pollIntervalMs:this.config.pollIntervalMs}),this.eventQueue=new T({eventsPerSecond:this.config.eventsPerSecond,onEventEmitted:()=>{this.stats.recordEventEmitted(this.logPrefix)}})}shouldSkipFile(e){return!1}validateRecords(e){return e}getMaxRecords(){}buildCursorSessionContext(e){let{adapterSessionId:t,sessionEvent:n,startedEvent:r,state:i,...a}=e;return{...a,adapterSessionId:t,sessionEvent:n,startedEvent:r,state:this.importer.serializeState(i)}}usesJsonFormat(){let e=this.getLogFilePattern();return e.includes(`.json`)&&!e.includes(`.jsonl`)}isEnabled(){return this.config.enabled}isRunning(){return this.watcher.isRunning()}async start(){if(!this.config.enabled||this.isRunning())return;let e=this.config.directory??this.importer.getLogDirectory();console.info(`${this.logPrefix} Starting - watching ${e}`),this.stats.reset(),this.managedSessionCache.clear(),this.progressTimer=setInterval(()=>this.stats.logProgress(this.logPrefix),1e4),this.unsubscribeChange=this.watcher.onChange(e=>{this.trackFileChange(e)}),this.unsubscribeError=this.watcher.onError(({error:e,filePath:t})=>{console.warn(`${this.logPrefix} Error${t?` for ${t}`:``}: ${e.message}`)}),this.unsubscribeDeleted=this.watcher.onDeleted(({filePath:e})=>{this.watcherTasks.track(s.request(r.delete,{filePath:e}).then(()=>void 0).catch(()=>{}))}),await this.watcher.start()}async stop(){this.progressTimer&&=(clearInterval(this.progressTimer),void 0),this.unsubscribeChange?.(),this.unsubscribeError?.(),this.unsubscribeDeleted?.(),this.unsubscribeChange=void 0,this.unsubscribeError=void 0,this.unsubscribeDeleted=void 0,this.watcher.stop(),await this.watcherTasks.drain(),await this.eventQueue.drain(),this.stats.hasActivity()&&console.info(this.stats.stoppedMessage(this.logPrefix))}async dispose(){await this.stop(),this.watcher.dispose(),this.managedSessionCache.clear()}static createDefaultCheckMakaioManaged(){return k()}async updateCursor(e,t,n,i){await s.request(r.set,{filePath:e,bytesRead:t,lastModified:n.toISOString(),sessionContext:i})}async handleFileChange(e){let{filePath:t,changeType:n,stat:i}=e;if(this.shouldSkipFile(t))return;let a=this.usesJsonFormat();n===`rotated`&&await s.request(r.delete,{filePath:t}).catch(()=>{});let o=await N(t,a,e,e=>this.trackFileChange(e));if(o===`retry`)return;let c=o?.sessionContext!==void 0,l=c?o?.bytesRead??0:0;if(j(o?.lastModified,i.mtime,a,n))return;let u=await this.parseFile(t,a?0:l,this.getMaxRecords());M(this.logPrefix,t,u.errors),this.stats.recordFileProcessed();let d=this.validateRecords(u.records),f=u.bytesRead??0;if(d.length===0){await this.maybeUpdateCursor(t,f,l,i.mtime,a,o?.sessionContext);return}c&&o?.sessionContext?await this.handleIncrementalRead(t,d,o.sessionContext,f,i.mtime,a,l):await this.handleFirstRead(t,d,f,i.mtime,a,l)}trackFileChange(e){let t=this.handleFileChange(e).catch(e=>{console.error(`${this.logPrefix} Error handling file change:`,e instanceof Error?e.message:String(e))});this.watcherTasks.track(t)}async handleFirstRead(e,t,n,r,i,a,o=!0){let s=this.importer.extractSessionContext(t);if(await this.isSessionSkipped(s.adapterSessionId)){await this.maybeUpdateCursor(e,n,a,r,i,this.buildCursorSessionContext(s));return}let c=F(t,s,o,(e,t)=>this.importer.processRecords(e,t),e=>this.queueEvent(e));this.trackImportedSession(s.adapterSessionId),await this.queueCursorUpdate(e,n,a,r,i,this.buildCursorSessionContext(s),c)}trackImportedSession(e){this.stats.recordSessionImported(e)}async handleIncrementalRead(e,t,n,i,a,o,c){if(await this.isSessionSkipped(n.adapterSessionId)){await this.maybeUpdateCursor(e,i,c,a,o,n);return}let l;try{l=this.importer.deserializeState(n.state)}catch(t){console.warn(`${this.logPrefix} Corrupted cursor state for ${e}, deleting cursor and re-importing.`,t instanceof Error?t.message:String(t)),await s.request(r.delete,{filePath:e}).catch(t=>{console.warn(`${this.logPrefix} Failed to delete corrupted cursor for ${e}.`,t instanceof Error?t.message:String(t))}),await P(e,a,o,!0,this.logPrefix,{parseFile:(e,t)=>this.parseFile(e,t),validateRecords:e=>this.validateRecords(e),handleFirstRead:(e,t,n,r,i,a,o)=>this.handleFirstRead(e,t,n,r,i,a,o)});return}let u={adapterSessionId:n.adapterSessionId,model:n.model,cwd:n.cwd,sessionEvent:n.sessionEvent,startedEvent:n.startedEvent,state:l},d=this.importer.processRecords(t,u);if(L(u.state)){await P(e,a,o,!1,this.logPrefix,{parseFile:(e,t)=>this.parseFile(e,t),validateRecords:e=>this.validateRecords(e),handleFirstRead:(e,t,n,r,i,a,o)=>this.handleFirstRead(e,t,n,r,i,a,o)});return}let f=I(d,e=>this.queueEvent(e)),p=R(n,u.state,e=>this.importer.serializeState(e));await this.queueCursorUpdate(e,i,c,a,o,p,f)}async maybeUpdateCursor(e,t,n,r,i,a){(t>n||i)&&await this.updateCursor(e,t,r,a)}async isSessionSkipped(e){return this.managedSessionCache.isSkipped(e,e=>this.importer.isMakaioManaged(e),e=>this.stats.recordSessionSkipped(e))}queueEvent(e){return this.eventQueue.queueEvent(e)}queueCursorUpdate(e,t,n,r,i,a,o=[]){return this.eventQueue.queueAfterEvents(()=>this.maybeUpdateCursor(e,t,n,r,i,a),o)}},V=class extends B{trackingFilePaths=new Set;trackingInactiveCount=new Map;lastSeenMtimeMs=new Map;unsubscribePolled;constructor(e,t){super(e,t)}clearTrackingState(e){this.trackingFilePaths.delete(e),this.trackingInactiveCount.delete(e),this.lastSeenMtimeMs.delete(e)}async persistImportedStatus(e){let{session:t}=await s.request(l.getByLogFilePath,{logFilePath:e});return!t||t.importStatus!==`tracking`||(await s.request(l.updateImportStatus,{sessionId:t.sessionId,importStatus:`imported`})).success?!0:(console.warn(`${this.logPrefix} Failed to persist imported status for ${e}`),!1)}async start(){!this.isEnabled()||this.isRunning()||(await super.start(),this.unsubscribePolled=this.watcher.onPolled(e=>{this.onPollCycle(e).catch(e=>{console.error(`${this.logPrefix} Error handling poll cycle:`,e instanceof Error?e.message:String(e))})}),await this.restorePersistedTrackingState())}async stop(){this.unsubscribePolled?.(),this.unsubscribePolled=void 0,await super.stop()}async dispose(){this.trackingFilePaths.clear(),this.trackingInactiveCount.clear(),this.lastSeenMtimeMs.clear(),await super.dispose()}async handleFileChange(e){let{filePath:t,changeType:n,stat:i}=e;if(this.shouldSkipFile(t))return;let{cursor:a}=await s.request(r.get,{filePath:t});if(!a){await this.discoverNewFile(e);return}n===`modified`&&await this.handleModifiedImportedFile(t,e,i.mtime)}async restorePersistedTrackingState(){this.trackingFilePaths.clear(),this.trackingInactiveCount.clear(),this.lastSeenMtimeMs.clear();try{let{sessions:e}=await s.request(l.listImported,{source:this.config.adapterName,importStatus:`tracking`});for(let t of e){if(t.source!==this.config.adapterName)continue;if(!t.logFilePath){(await s.request(l.updateImportStatus,{sessionId:t.sessionId,importStatus:`imported`})).success||console.warn(`${this.logPrefix} Failed to reset tracking status for session ${t.sessionId}`);continue}let e=this.watcher.getTrackedFileMtimeMs(t.logFilePath);if(e===void 0){(await s.request(l.updateImportStatus,{sessionId:t.sessionId,importStatus:`imported`})).success||console.warn(`${this.logPrefix} Failed to reset tracking status for ${t.logFilePath}`);continue}this.trackingFilePaths.add(t.logFilePath),this.trackingInactiveCount.set(t.logFilePath,0),this.lastSeenMtimeMs.set(t.logFilePath,e)}}catch(e){console.warn(`[DiscoveryOrchestrator] Failed to restore persisted tracking state:`,e instanceof Error?e.message:String(e))}}async discoverNewFile(e){let{filePath:t,stat:n}=e,r=await this.importer.extractDiscoveryMetadata(t);if(!(r.hasMessages??!1)){await this.updateCursor(t,0,n.mtime);return}if(await this.isSessionSkipped(r.adapterSessionId)){await this.updateCursor(t,0,n.mtime);return}let i=this.queueEvent({subject:c.session.discovered,payload:{adapterId:this.config.adapterId,adapterName:this.config.adapterName,adapterSessionId:r.adapterSessionId,model:r.model??null,cwd:r.cwd??null,title:r.title,parentAdapterSessionId:r.parentAdapterSessionId??null,forkPointMessageId:r.forkPointMessageId??null,kind:r.kind??`root`,startedAt:r.startedAt,logFilePath:t}});await this.eventQueue.queueAfterEvents(()=>this.updateCursor(t,0,n.mtime),[i])}async handleModifiedImportedFile(e,t,n){let{session:r}=await s.request(l.getByLogFilePath,{logFilePath:e});if(!r){await this.discoverNewFile(t);return}if(r.source===this.config.adapterName&&!(r.importStatus!==`imported`&&r.importStatus!==`tracking`)){if(await super.handleFileChange(t),r.importStatus===`imported`&&!(await s.request(l.updateImportStatus,{sessionId:r.sessionId,importStatus:`tracking`})).success){console.warn(`${this.logPrefix} Failed to persist tracking status for ${e}`);return}this.trackingFilePaths.add(e),this.lastSeenMtimeMs.set(e,n.getTime()),this.trackingInactiveCount.delete(e),this.watcher.triggerImmediatePoll(e)}}async onPollCycle(e){for(let t of[...this.trackingFilePaths]){if(!e.has(t)){await this.persistImportedStatus(t)&&this.clearTrackingState(t);continue}let n=this.watcher.getTrackedFileMtimeMs(t),r=this.lastSeenMtimeMs.get(t);if(!(n===void 0||r===void 0))try{if(n===r){let e=(this.trackingInactiveCount.get(t)??0)+1;e>=3?await this.persistImportedStatus(t)&&this.clearTrackingState(t):this.trackingInactiveCount.set(t,e)}else this.lastSeenMtimeMs.set(t,n),this.trackingInactiveCount.delete(t)}catch(e){console.warn(`${this.logPrefix} Failed to process tracked file ${t}:`,e instanceof Error?e.message:String(e))}}}};export{B as BaseLogOrchestrator,V as DiscoveryOrchestrator,f as parseJsonlFile,p as readFirstJsonlRecords,m as someJsonlRecord};
|
package/dist/bus/index.d.mts
CHANGED
|
@@ -3605,9 +3605,9 @@ declare const CanonicalModelSelectionSchema: z.ZodObject<{
|
|
|
3605
3605
|
description: z.ZodOptional<z.ZodString>;
|
|
3606
3606
|
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
3607
3607
|
exposureMode: z.ZodEnum<{
|
|
3608
|
-
direct: "direct";
|
|
3609
|
-
discovery: "discovery";
|
|
3610
3608
|
hidden: "hidden";
|
|
3609
|
+
discovery: "discovery";
|
|
3610
|
+
direct: "direct";
|
|
3611
3611
|
}>;
|
|
3612
3612
|
enabled: z.ZodBoolean;
|
|
3613
3613
|
enabledBy: z.ZodOptional<z.ZodEnum<{
|
|
@@ -3653,8 +3653,8 @@ declare const CanonicalModelSelectionSchema: z.ZodObject<{
|
|
|
3653
3653
|
type: z.ZodLiteral<"http">;
|
|
3654
3654
|
}, z.core.$strip>], "type">;
|
|
3655
3655
|
exposureMode: z.ZodEnum<{
|
|
3656
|
-
direct: "direct";
|
|
3657
3656
|
discovery: "discovery";
|
|
3657
|
+
direct: "direct";
|
|
3658
3658
|
}>;
|
|
3659
3659
|
}, z.core.$strip>>;
|
|
3660
3660
|
discoverableTools: z.ZodArray<z.ZodObject<{
|
|
@@ -3664,9 +3664,9 @@ declare const CanonicalModelSelectionSchema: z.ZodObject<{
|
|
|
3664
3664
|
description: z.ZodOptional<z.ZodString>;
|
|
3665
3665
|
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
3666
3666
|
exposureMode: z.ZodEnum<{
|
|
3667
|
-
direct: "direct";
|
|
3668
|
-
discovery: "discovery";
|
|
3669
3667
|
hidden: "hidden";
|
|
3668
|
+
discovery: "discovery";
|
|
3669
|
+
direct: "direct";
|
|
3670
3670
|
}>;
|
|
3671
3671
|
enabled: z.ZodBoolean;
|
|
3672
3672
|
enabledBy: z.ZodOptional<z.ZodEnum<{
|
|
@@ -3678,6 +3678,7 @@ declare const CanonicalModelSelectionSchema: z.ZodObject<{
|
|
|
3678
3678
|
}, z.core.$strip>>;
|
|
3679
3679
|
}, z.core.$strip>>;
|
|
3680
3680
|
allowedDirectories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3681
|
+
adapterConfig: z.ZodOptional<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>;
|
|
3681
3682
|
kind: z.ZodLiteral<"canonical-model">;
|
|
3682
3683
|
model: z.ZodString;
|
|
3683
3684
|
}, z.core.$loose>;
|