@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 @@
|
|
|
1
|
+
import{agents as e,sessions as t}from"./session/storage/schema.mjs";import{t as n}from"../schema-CoyE6mPt.mjs";import{t as r}from"../schema-e0wU_lcV.mjs";import{n as i,r as a,t as o}from"../namespace-DuXK5AYN.mjs";import{SessionStorageNamespace as s,SessionStorageSubjects as c}from"./session/storage/namespace.mjs";import{A as l,C as u,D as ee,E as d,F as te,M as ne,N as re,O as ie,P as f,S as ae,T as oe,_ as se,a as ce,b as le,c as ue,d as de,f as fe,g as pe,h as me,i as he,j as ge,k as _e,l as ve,m as ye,n as p,o as m,p as h,r as g,s as _,t as v,u as y,v as b,w as x,x as S,y as C}from"../handlers-CkTsQLra.mjs";import{A as w,B as T,C as E,D,E as O,F as k,G as A,H as j,I as M,K as N,L as P,M as be,N as xe,O as Se,P as Ce,R as we,S as Te,T as Ee,U as De,V as Oe,W as ke,_ as Ae,a as je,b as Me,c as Ne,d as Pe,f as Fe,g as Ie,h as Le,i as Re,j as ze,k as Be,l as Ve,m as He,o as Ue,p as We,r as Ge,s as Ke,t as qe,u as Je,v as Ye,x as Xe,y as Ze,z as Qe}from"../session-BoldSdNZ2.mjs";import{TurnStorageNamespace as $e,TurnStorageSubjects as et}from"./turn/namespace.mjs";import{TurnStorageNamespace as tt}from"./session/turns/namespace.mjs";import{AdapterRuntimeSchemas as nt,ResolveIdRequestSchema as rt,ResolveIdResponseSchema as it,ResolveNameRequestSchema as at,ResolveNameResponseSchema as ot}from"./adapter-runtime/schemas.mjs";import{AdapterRuntimeNamespace as F,AdapterRuntimeSubjects as st}from"./adapter-runtime/namespace.mjs";import{MessageStorageNamespace as ct,MessageStorageSubjects as lt}from"./session/messages/namespace.mjs";import{t as ut}from"../namespace-DkRgbZYn.mjs";import{ProviderStorageNamespace as dt}from"./settings/storage/providers-namespace.mjs";import{ContainerIsolatedExecutionTargetSchema as ft,ContainerLocalExecutionTargetSchema as pt,ExecutionTargetInputSchema as mt,ExecutionTargetListQuerySchema as ht,ExecutionTargetResolveRequestSchema as gt,ExecutionTargetSchema as _t,ExecutionTargetSchemas as vt,ExecutionTargetTypeSchema as yt,LocalExecutionTargetSchema as bt}from"./execution-target/schemas.mjs";import{ExecutionTargetNamespace as I,ExecutionTargetSubjects as xt}from"./execution-target/namespace.mjs";import{n as St,r as Ct,t as wt}from"../provider-context-CK6B4X_8.mjs";import{BugEntrySchema as Tt,CompressRequestSchema as Et,CompressResponseSchema as Dt,CompressionEventSchema as Ot,CompressionSchemas as kt,ExtractedContextSchema as At,TechnicalDetailsSchema as jt,TodoEntrySchema as Mt}from"./compression/schemas.mjs";import{PreferenceItemSchema as Nt,PreferenceKeySchema as Pt,PreferenceValueSchema as Ft,PreferencesSchemas as It}from"./preferences/schemas.mjs";import{PreferencesNamespace as L,PreferencesSubjects as Lt}from"./preferences/storage-namespace.mjs";import{t as Rt}from"../namespace-LViZ-EQk.mjs";import{A as zt,B as Bt,C as Vt,D as Ht,E as Ut,F as Wt,G as Gt,H as Kt,I as qt,J as Jt,K as Yt,L as Xt,M as Zt,N as Qt,O as $t,P as en,R as tn,S as nn,T as rn,U as an,V as on,W as sn,Y as cn,_ as ln,a as R,b as z,c as un,d as dn,f as fn,g as B,h as pn,i as V,j as mn,k as hn,l as gn,m as _n,o as vn,p as H,q as yn,r as bn,s as U,u as xn,v as W,w as Sn,x as Cn,y as wn,z as Tn}from"../tools-D-luYcDw.mjs";import{t as En}from"../capability-service-CJbmhfv9.mjs";import{a as Dn,c as On,i as kn,l as An,n as jn,o as G,r as Mn,s as Nn,t as Pn,u as Fn}from"../model-registry-Scn_MC2d.mjs";import{t as In}from"../tool-approval-service-BvZWhYZp.mjs";import{TrayMenuEntrySchema as Ln,TrayMenuGroupEntrySchema as Rn,TrayMenuGroupSchema as zn,TrayMenuItemClickedSchema as Bn,TrayMenuListEntrySchema as Vn,TrayMenuMetadataSchema as Hn,TrayMenuSchemas as Un,TrayMenuSectionSchema as Wn}from"./tray-menu/schemas.mjs";import{TrayMenuNamespace as K,TrayMenuSubjects as Gn}from"./tray-menu/namespace.mjs";import{t as Kn}from"../tray-menu-service-DuXq5k22.mjs";import{t as qn}from"../namespace-Yna5-Pws.mjs";import{i as Jn,n as Yn,r as Xn,t as Zn}from"../package-DKVlsMP3.mjs";import{FsNamespace as Qn}from"./filesystem/namespace.mjs";import"./capability/index.mjs";import"./tool-approval/index.mjs";import"./tray-menu/index.mjs";import"./subagent/index.mjs";import{AgentInstanceStatusSchema as $n,AgentRuntimeSchemas as er,AgentRuntimeSelectionSchema as tr}from"./agent-runtime/schemas.mjs";import{AgentRuntimeNamespace as q,AgentRuntimeSubjects as nr}from"./agent-runtime/namespace.mjs";import{CodebaseChangedEventSchema as rr,CodebaseSchemas as ir}from"./codebase/schemas.mjs";import{CodebaseNamespace as J,CodebaseSubjects as ar}from"./codebase/namespace.mjs";import{CompressionNamespace as Y,CompressionSubjects as or}from"./compression/namespace.mjs";import{r as sr,t as cr}from"../storage-namespace-DWsYLAXa.mjs";import{DefinitionNamespace as lr}from"./definition/namespace.mjs";import{DialogNamespace as ur}from"./dialog/namespace.mjs";import{_ as dr,c as fr,d as pr,f as mr,g as hr,h as gr,i as _r,l as vr,m as yr,n as br,o as xr,p as Sr,r as X,s as Cr,t as wr,u as Tr,v as Er,y as Dr}from"../execution-target-CRPTfZlc.mjs";import{CLIDetectionNamespace as Or}from"./cli-detection/namespace.mjs";import{LocalNotificationNamespace as kr}from"./local-notification/namespace.mjs";import{t as Ar}from"../namespace-BoD94mrN.mjs";import{ExtensionConfigStorageNamespace as jr}from"./settings/storage/extension-configs/namespace.mjs";import{ClientStorageNamespace as Mr}from"./settings/storage/clients-namespace.mjs";import{SubagentTemplateCompletedEventSchema as Nr,SubagentTemplateCreateSchema as Pr,SubagentTemplateInstanceSchema as Fr,SubagentTemplateInstanceStatusSchema as Ir,SubagentTemplateKernelSchemas as Lr,SubagentTemplateSchema as Rr,SubagentTemplateSettingsSchemas as zr,SubagentTemplateSpawnRequestSchema as Br,SubagentTemplateSpawnedEventSchema as Vr,SubagentTemplateSummarySchema as Hr,SubagentTemplateUpdateSchema as Ur}from"./subagent-template/schemas.mjs";import{r as Wr,t as Gr}from"../namespace-BwzZJqTV.mjs";import{SubagentTemplateKernelNamespace as Z,SubagentTemplateSubjects as Kr}from"./subagent-template/namespace.mjs";import{i as qr,n as Jr,r as Yr,t as Xr}from"../identity-Cz2IeEtm.mjs";import"./adapter-runtime/index.mjs";import"./agent-runtime/index.mjs";import"./codebase/index.mjs";import"./compression/index.mjs";import"./preferences/index.mjs";import"./subagent-template/index.mjs";import{ImportCursorStorageNamespace as Zr}from"@makaio/framework/adapters";import{ModelRegistryPublicNamespace as Qr}from"@makaio/framework/contracts/model-registry";function $r(e){return{source:`extension`,ownerKey:`extension:${e}`}}function ei(e,t){for(let n of e.values())if(n.registry===t)for(let e of n.registrations)t.registerKind(e,n.owner)}function ti(){let e=new Map,t=t=>{let n=e.get(t);if(n){e.delete(t);for(let e=n.registrations.length-1;e>=0;--e){let t=n.registrations[e];n.registry.deregisterKind(t.kind,t.schemaVersion,n.owner)}ei(e,n.registry)}};return{filter:e=>(e.artifactKinds?.kinds?.length??0)>0,async processActivated(n,r,i){let a=i.getService(R);if(!a)throw Error(`ArtifactSchemaRegistry is not available — ensure artifact-schema-registry is started before extensions with artifactKinds.`);let o=(r.artifactKinds?.kinds??[]).map(e=>e.toRegistration()),s=$r(n);t(n);for(let e of o)a.registerKind(e,s);e.set(n,{registry:a,owner:s,registrations:o})},async processStopped(e){try{t(e)}catch(t){console.error(`[ArtifactContributionProcessor] Deregister error for "${e}":`,t)}}}}function ni(e,t,n){return{...n,filter:{...n.filter,kind:e,schemaVersion:t}}}function ri(){let e=new Map,t=t=>{let n=e.get(t);n&&(e.delete(t),n.cleanup())};return{filter:e=>{let t=e.artifactLifecycleHooks!=null,n=(e.artifactKinds?.kinds??[]).some(e=>(e.hooks?.hooks.length??0)>0);return t||n},async processActivated(n,r,i){let a=i.getService(V);if(!a)throw Error(`ArtifactLifecycleHookRegistry is not available — ensure artifact-lifecycle-hook-registry is started before extensions with artifact lifecycle hooks.`);let o=r.artifactLifecycleHooks?[...await r.artifactLifecycleHooks.createHooks({bus:i.bus,extensionName:n})]:[],s=[];for(let e of r.artifactKinds?.kinds??[])if(e.hooks)for(let t of e.hooks.hooks)s.push(ni(e.kind,e.schemaVersion,t));let c=[...o,...s];t(n);let l=a.registerHooks(n,c);e.set(n,{cleanup:l})},async processStopped(e){try{t(e)}catch(t){console.error(`[ArtifactLifecycleHookContributionProcessor] Deregister error for "${e}":`,t)}}}}function Q(e,t){for(let n of e.values())if(n.registry===t)for(let e of n.registrations)t.registerNamespace(e)}function ii(){let e=new Map,t=(t,n)=>{if(n){for(let e of n.registrations)n.registry.registerNamespace(e);e.set(t,n)}},n=t=>{let n=e.get(t);if(n){e.delete(t);for(let e=n.registrations.length-1;e>=0;--e){let t=n.registrations[e];n.registry.deregisterNamespace(t.namespace)}Q(e,n.registry)}};return{filter:e=>(e.facetNamespaces?.namespaces?.length??0)>0,async processActivated(r,i,a){let o=a.getService(U);if(!o)throw Error(`FacetNamespaceRegistry is not available — ensure facet-namespace-registry is started before extensions with facetNamespaces.`);let s=(i.facetNamespaces?.namespaces??[]).map(e=>e.toRegistration()),c=e.get(r);n(r);let l=[];try{for(let e of s)o.registerNamespace(e),l.push(e)}catch(n){for(let e=l.length-1;e>=0;--e)o.deregisterNamespace(l[e].namespace);throw Q(e,o),t(r,c),n}e.set(r,{registry:o,registrations:s})},async processStopped(e){try{n(e)}catch(t){console.error(`[FacetNamespaceContributionProcessor] Deregister error for "${e}":`,t)}}}}function $(e,t){for(let n of e.values())if(n.registry===t)for(let e of n.registrations)t.registerBinding(e)}function ai(){let e=new Map,t=(t,n)=>{if(n){for(let e of n.registrations)n.registry.registerBinding(e);e.set(t,n)}},n=t=>{let n=e.get(t);if(n){e.delete(t);for(let e=n.registrations.length-1;e>=0;--e){let t=n.registrations[e];n.registry.deregisterBinding(t.id)}$(e,n.registry)}};return{filter:e=>(e.surfaceBindings?.bindings?.length??0)>0,async processActivated(r,i,a){let o=a.getService(H);if(!o)throw Error(`SurfaceBindingRegistry is not available — ensure surface-binding-registry is started before extensions with surfaceBindings.`);let s=(i.surfaceBindings?.bindings??[]).map(e=>e.toRegistration()),c=e.get(r);n(r);let l=[];try{for(let e of s)o.registerBinding(e),l.push(e)}catch(n){for(let e=l.length-1;e>=0;--e)o.deregisterBinding(l[e].id);throw $(e,o),t(r,c),n}e.set(r,{registry:o,registrations:s})},async processStopped(e){try{n(e)}catch(t){console.error(`[SurfaceBindingContributionProcessor] Deregister error for "${e}":`,t)}}}}function oi(){let e=new Map;return{filter:e=>!!e.workflowBlocks?.blocks,async processActivated(t,n,r){let i=r.getService(W);if(!i)throw Error(`WorkflowBlockRegistry is not available — ensure workflow-block-registry is started before extensions with workflowBlocks.`);await i.register(t,n.workflowBlocks.blocks),e.set(t,()=>i.deregister(t))},async processStopped(t){let n=e.get(t);if(n){try{await n()}catch(e){console.error(`[WorkflowBlockContributionProcessor] Deregister error for "${t}":`,e)}e.delete(t)}}}}function si(){let e=new Map;return{filter:e=>!!(e.transitionRules?.rules?.length||e.transitionActions?.actions),async processActivated(t,n,r){let i=r.getService(B);if(!i)throw Error(`TransitionContributionProcessor: TransitionPipelineService is not available — ensure '${B.name}' is started before extensions with transitionRules or transitionActions.`);let a=n.transitionRules?.rules??[],o=n.transitionActions?.actions,s=a.length>0,c=o!==void 0;s&&ci(t,a),c&&li(t,o);let l=!1,u=!1;try{s&&(i.ruleRegistry.register(t,a),l=!0),c&&(i.actionRegistry.register(t,o),u=!0)}catch(e){throw l&&i.ruleRegistry.deregister(t),u&&i.actionRegistry.deregister(t),e}e.set(t,()=>{s&&i.ruleRegistry.deregister(t),c&&i.actionRegistry.deregister(t)})},async processStopped(t){let n=e.get(t);if(n){try{n()}catch(e){console.error(`[TransitionContributionProcessor] Deregister error for "${t}":`,e)}e.delete(t)}}}}function ci(e,t){let n=`${e}.`;for(let e of t)if(!e.id.startsWith(n))throw Error(`TransitionContributionProcessor: rule '${e.id}' must be namespaced by extension '${n}'`)}function li(e,t){let n=`${e}.`;for(let e of Object.keys(t))if(!e.startsWith(n))throw Error(`TransitionContributionProcessor: action type '${e}' must be namespaced by extension '${n}'`)}const ui=[F,ut,q,f,Or,Mr,J,Y,sr,cr,lr,ur,X,I,jr,Qn,qn,Zr,kr,P,G,Qr,L,Ar,dt,Rt,Gr,K,$e,Z,Wr];export{Xr as AdapterIdentityRegistry,ke as AdapterRegistry,F as AdapterRuntimeNamespace,nt as AdapterRuntimeSchemas,st as AdapterRuntimeSubjects,$n as AgentInstanceStatusSchema,q as AgentRuntimeNamespace,er as AgentRuntimeSchemas,tr as AgentRuntimeSelectionSchema,nr as AgentRuntimeSubjects,f as AgentStorageNamespace,te as AgentStorageSubjects,yn as ArtifactLifecycleHookRegistry,V as ArtifactLifecycleHookRegistryToken,Jt as ArtifactLifecycleHookRejectedError,cn as ArtifactSchemaRegistry,R as ArtifactSchemaRegistryToken,Tt as BugEntrySchema,Be as CONNECTOR_SWAP_DEFAULT_PIPELINE,Pn as CachedRegistryFetcher,sn as CanonicalModelResolutionError,an as CanonicalModelResolver,Kt as CanonicalModelService,En as CapabilityService,vn as CapabilityToken,rr as CodebaseChangedEventSchema,J as CodebaseNamespace,ir as CodebaseSchemas,ar as CodebaseSubjects,Et as CompressRequestSchema,Dt as CompressResponseSchema,Ot as CompressionEventSchema,Y as CompressionNamespace,kt as CompressionSchemas,or as CompressionSubjects,xr as ContainerCreatedSchema,Cr as ContainerDestroyedSchema,ft as ContainerIsolatedExecutionTargetSchema,fr as ContainerIsolatedSpawnRequestSchema,pt as ContainerLocalExecutionTargetSchema,vr as ContainerLocalSpawnRequestSchema,Tr as ContainerRuntimeSchema,wr as ContainerSpawnNamespace,br as ContainerSpawnSubjects,pr as ContainerStartedSchema,mr as ContainerStateSchema,Sr as ContainerStoppedSchema,qe as ContextWindowTracker,X as DockerNamespace,_r as DockerSubjects,mt as ExecutionTargetInputSchema,ht as ExecutionTargetListQuerySchema,I as ExecutionTargetNamespace,gt as ExecutionTargetResolveRequestSchema,_t as ExecutionTargetSchema,vt as ExecutionTargetSchemas,xt as ExecutionTargetSubjects,yt as ExecutionTargetTypeSchema,At as ExtractedContextSchema,Yt as FacetNamespaceRegistry,U as FacetNamespaceRegistryToken,jn as FallbackRegistryFetcher,ui as FrameworkServicesCoreNamespaces,bt as LocalExecutionTargetSchema,Ue as MakaioSession,A as MakaioSessionService,P as MessageRoutingNamespace,we as MessageRoutingSubjects,ct as MessageStorageNamespace,lt as MessageStorageSubjects,G as ModelRegistryNamespace,Mn as ModelRegistryProviderNotFoundError,On as ModelRegistrySchema,An as ModelRegistrySchemas,kn as ModelRegistryService,Nn as ModelRegistrySubjects,un as ModelRegistryToken,Nt as PreferenceItemSchema,Pt as PreferenceKeySchema,Ft as PreferenceValueSchema,L as PreferencesNamespace,It as PreferencesSchemas,Lt as PreferencesSubjects,Fn as ProviderModelOverrideSchema,rt as ResolveIdRequestSchema,it as ResolveIdResponseSchema,at as ResolveNameRequestSchema,ot as ResolveNameResponseSchema,D as SessionBridge,gn as SessionBridgeToken,o as SessionEventStorageNamespace,i as SessionEventStorageSubjects,Ee as SessionExtensionContextImpl,Ve as SessionLogger,Ce as SessionOrchestrator,xn as SessionOrchestratorToken,s as SessionStorageNamespace,c as SessionStorageSubjects,dn as SessionStorageToken,fn as SessionToken,k as SessionTurnManager,yr as SpawnRequestSchema,gr as SpawnResponseSchema,hr as StatusRequestSchema,dr as StatusResponseSchema,Er as StopRequestSchema,Dr as StopResponseSchema,Jn as SubagentManager,Xn as SubagentService,Zn as SubagentServiceToken,Nr as SubagentTemplateCompletedEventSchema,Pr as SubagentTemplateCreateSchema,Fr as SubagentTemplateInstanceSchema,Ir as SubagentTemplateInstanceStatusSchema,Z as SubagentTemplateKernelNamespace,Lr as SubagentTemplateKernelSchemas,Rr as SubagentTemplateSchema,zr as SubagentTemplateSettingsSchemas,Br as SubagentTemplateSpawnRequestSchema,Vr as SubagentTemplateSpawnedEventSchema,Kr as SubagentTemplateSubjects,Hr as SubagentTemplateSummarySchema,Ur as SubagentTemplateUpdateSchema,Gt as SurfaceBindingRegistry,H as SurfaceBindingRegistryToken,jt as TechnicalDetailsSchema,Mt as TodoEntrySchema,In as ToolApprovalService,_n as ToolApprovalToken,Bt as ToolRegistry,pn as ToolRegistryToken,Xt as TransitionActionRegistry,Wt as TransitionPipelineService,B as TransitionPipelineToken,qt as TransitionRuleRegistry,Ln as TrayMenuEntrySchema,Rn as TrayMenuGroupEntrySchema,zn as TrayMenuGroupSchema,Bn as TrayMenuItemClickedSchema,Vn as TrayMenuListEntrySchema,Hn as TrayMenuMetadataSchema,K as TrayMenuNamespace,Un as TrayMenuSchemas,Wn as TrayMenuSectionSchema,Kn as TrayMenuService,Gn as TrayMenuSubjects,ln as TrayMenuToken,ge as Turn,xe as TurnContextEnricher,tt as TurnStorageNamespace,et as TurnStorageSubjects,tn as WORKFLOW_START_ACTION_TYPE,Tn as WorkflowBlockRegistry,W as WorkflowBlockRegistryToken,le as actionRegistry,wt as activateProviderContext,St as activateProviderContextStrict,e as agents,wn as artifactLifecycleHookRegistryPackage,z as artifactSchemaRegistryPackage,p as assembleForkContext,Jr as buildDeterministicAdapterId,Ct as buildProviderContext,b as buildRecoveryContext,h as buildRecoveryContextWithPipeline,S as buildSessionContext,oe as buildTurnInitiator,on as canonicalModelPackage,Cn as capabilityPackage,ti as createArtifactKindContributionProcessor,ri as createArtifactLifecycleHookContributionProcessor,ii as createFacetNamespaceContributionProcessor,nn as createModelRegistryPackage,O as createSessionExtensionContext,ai as createSurfaceBindingContributionProcessor,bn as createToolContributionProcessor,si as createTransitionContributionProcessor,oi as createWorkflowBlockContributionProcessor,ye as ensureAgentCwd,me as ensureAgentModel,_e as extractTextContent,Vt as facetNamespaceRegistryPackage,Pe as fetchAgentsBySession,Fe as fetchMessageCountsBySession,We as fetchPreviewBySession,Ye as fetchSessionPreviewMaps,d as findTurnByAgent,Sn as frameworkCorePackages,C as getFullConversation,ee as getOrCreateSession,Ne as importCursors,E as kindToBranchKind,Ze as mapAgentsBySession,He as mapRowToSession,Me as mapToSession,Dn as mergeModelMetadata,Qe as messageRouting,r as messages,de as normalizeSelectionString,l as normalizeToBlocks,Le as parseForkTransforms,Se as pickFallbackRuntimeOptions,pe as recoverAgent,ve as registerAbandonHandler,Yr as registerAdapterRuntimeIdentityHandlers,ue as registerAttachHandler,m as registerBuiltInActions,ce as registerCompressHandler,Re as registerCompressLineageResolver,N as registerCoreSessionServiceHandlers,Xe as registerDrizzleAgentStorage,Ke as registerDrizzleImportCursorStorage,M as registerDrizzleMessageRoutingStorage,Oe as registerDrizzleMessageStorage,j as registerDrizzleSessionEventStorage,Ae as registerDrizzleSessionStorage,re as registerDrizzleTurnStorage,he as registerForkHandler,Je as registerFtsSearchHandler,ze as registerGetStatusCountsHandler,w as registerListActionsHandler,Ie as registerMemoryAgentStorage,T as registerMemoryMessageStorage,De as registerMemorySessionEventStorage,Te as registerMemorySessionStorage,ne as registerMemoryTurnStorage,g as registerMergeHandler,je as registerParentResolver,be as registerResumeHandler,Ge as registerSpawningToolCallResolver,_ as resetBuiltInActionsRegistration,ae as resolveAdapterId,fe as resolveAdapterNameById,qr as resolveDeterministicAdapterId,u as resolveExecutionTarget,x as resolveModelCapabilities,ie as resolveTargetAgents,v as routeToAgents,y as routeToAgentsCore,rn as sessionBridgePackage,a as sessionEvents,Ut as sessionOrchestratorPackage,Ht as sessionPackage,$t as sessionStoragePackage,t as sessions,Yn as subagentServicePackage,hn as surfaceBindingRegistryPackage,zt as toolApprovalPackage,mn as toolRegistryPackage,Zt as transitionPipelinePackage,Qt as trayMenuPackage,n as turns,se as verifyAndRecoverAgents,en as workflowBlockRegistryPackage};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LocalNotificationPayload, LocalNotificationProviderSummary, LocalNotificationSchemas, NotifyFailureResponse, NotifyRequest, NotifyResponse, NotifySuccessResponse } from "./schemas.mjs";
|
|
2
|
+
import { ICapabilityProvider } from "@makaio/framework/contracts";
|
|
3
|
+
|
|
4
|
+
//#region services/core/src/local-notification/types.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Local notification provider interface.
|
|
7
|
+
*
|
|
8
|
+
* Each platform (Electron, iOS, Android, Web) implements this interface
|
|
9
|
+
* to show native notifications.
|
|
10
|
+
*/
|
|
11
|
+
interface ILocalNotificationProvider extends ICapabilityProvider {
|
|
12
|
+
/**
|
|
13
|
+
* Show a notification using the platform's native API.
|
|
14
|
+
* @param notification - The notification payload
|
|
15
|
+
* @returns Result indicating success or failure
|
|
16
|
+
*/
|
|
17
|
+
notify(notification: LocalNotificationPayload): Promise<NotifyResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Check if the provider is available and has permission.
|
|
20
|
+
* @returns Whether notifications can be shown
|
|
21
|
+
*/
|
|
22
|
+
isAvailable(): boolean;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { type ILocalNotificationProvider, type LocalNotificationPayload, type LocalNotificationProviderSummary, LocalNotificationSchemas, type NotifyFailureResponse, type NotifyRequest, type NotifyResponse, type NotifySuccessResponse };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{LocalNotificationSchemas as e}from"./schemas.mjs";export{e as LocalNotificationSchemas};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as _$zod from "zod";
|
|
2
|
+
import * as _$_makaio_core0 from "@makaio/framework/core";
|
|
3
|
+
import * as _$zod_v4_core0 from "zod/v4/core";
|
|
4
|
+
|
|
5
|
+
//#region services/core/src/local-notification/namespace.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Local notification namespace definition.
|
|
8
|
+
*
|
|
9
|
+
* Provides type-safe subjects for platform-native notification operations.
|
|
10
|
+
* Each platform (Electron, iOS, Android, Web) registers a single provider
|
|
11
|
+
* that handles these subjects.
|
|
12
|
+
*/
|
|
13
|
+
declare const LocalNotificationNamespace: _$_makaio_core0.BusNamespaceDefinition<"local-notification", {
|
|
14
|
+
notify: {
|
|
15
|
+
request: _$zod.ZodObject<{
|
|
16
|
+
title: _$zod.ZodString;
|
|
17
|
+
body: _$zod.ZodString;
|
|
18
|
+
icon: _$zod.ZodOptional<_$zod.ZodString>;
|
|
19
|
+
url: _$zod.ZodOptional<_$zod.ZodString>;
|
|
20
|
+
}, _$zod_v4_core0.$strip>;
|
|
21
|
+
response: _$zod.ZodDiscriminatedUnion<[_$zod.ZodObject<{
|
|
22
|
+
success: _$zod.ZodLiteral<true>;
|
|
23
|
+
}, _$zod_v4_core0.$strict>, _$zod.ZodObject<{
|
|
24
|
+
success: _$zod.ZodLiteral<false>;
|
|
25
|
+
error: _$zod.ZodString;
|
|
26
|
+
}, _$zod_v4_core0.$strict>], "success">;
|
|
27
|
+
};
|
|
28
|
+
getProvider: {
|
|
29
|
+
request: _$zod.ZodObject<{}, _$zod_v4_core0.$strip>;
|
|
30
|
+
response: _$zod.ZodObject<{
|
|
31
|
+
provider: _$zod.ZodNullable<_$zod.ZodObject<{
|
|
32
|
+
id: _$zod.ZodString;
|
|
33
|
+
displayName: _$zod.ZodString;
|
|
34
|
+
available: _$zod.ZodBoolean;
|
|
35
|
+
}, _$zod_v4_core0.$strip>>;
|
|
36
|
+
}, _$zod_v4_core0.$strip>;
|
|
37
|
+
};
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Typed subjects for local notification operations.
|
|
41
|
+
*
|
|
42
|
+
* Subjects available:
|
|
43
|
+
* - `LocalNotificationSubjects.notify` — Show a local notification (RPC)
|
|
44
|
+
* - `LocalNotificationSubjects.getProvider` — Get provider info (RPC)
|
|
45
|
+
*/
|
|
46
|
+
declare const LocalNotificationSubjects: _$_makaio_core0.BusSubjects<_$_makaio_core0.FlatSubjectDefinitions<"local-notification", {
|
|
47
|
+
notify: {
|
|
48
|
+
request: _$zod.ZodObject<{
|
|
49
|
+
title: _$zod.ZodString;
|
|
50
|
+
body: _$zod.ZodString;
|
|
51
|
+
icon: _$zod.ZodOptional<_$zod.ZodString>;
|
|
52
|
+
url: _$zod.ZodOptional<_$zod.ZodString>;
|
|
53
|
+
}, _$zod_v4_core0.$strip>;
|
|
54
|
+
response: _$zod.ZodDiscriminatedUnion<[_$zod.ZodObject<{
|
|
55
|
+
success: _$zod.ZodLiteral<true>;
|
|
56
|
+
}, _$zod_v4_core0.$strict>, _$zod.ZodObject<{
|
|
57
|
+
success: _$zod.ZodLiteral<false>;
|
|
58
|
+
error: _$zod.ZodString;
|
|
59
|
+
}, _$zod_v4_core0.$strict>], "success">;
|
|
60
|
+
};
|
|
61
|
+
getProvider: {
|
|
62
|
+
request: _$zod.ZodObject<{}, _$zod_v4_core0.$strip>;
|
|
63
|
+
response: _$zod.ZodObject<{
|
|
64
|
+
provider: _$zod.ZodNullable<_$zod.ZodObject<{
|
|
65
|
+
id: _$zod.ZodString;
|
|
66
|
+
displayName: _$zod.ZodString;
|
|
67
|
+
available: _$zod.ZodBoolean;
|
|
68
|
+
}, _$zod_v4_core0.$strip>>;
|
|
69
|
+
}, _$zod_v4_core0.$strip>;
|
|
70
|
+
};
|
|
71
|
+
}>, "local-notification">;
|
|
72
|
+
//#endregion
|
|
73
|
+
export { LocalNotificationNamespace, LocalNotificationSubjects };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{LocalNotificationSchemas as e}from"./schemas.mjs";import{createBusNamespace as t}from"@makaio/framework/core";const n=t(`local-notification`,e),r=n.subjects;export{n as LocalNotificationNamespace,r as LocalNotificationSubjects};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region services/core/src/local-notification/schemas.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Local notification payload sent to the active platform provider.
|
|
6
|
+
*/
|
|
7
|
+
interface LocalNotificationPayload {
|
|
8
|
+
/** Notification title. */
|
|
9
|
+
title: string;
|
|
10
|
+
/** Notification body text. */
|
|
11
|
+
body: string;
|
|
12
|
+
/** Optional icon path or identifier. */
|
|
13
|
+
icon?: string;
|
|
14
|
+
/** Optional click action URL. */
|
|
15
|
+
url?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Request payload for showing a local notification.
|
|
19
|
+
*/
|
|
20
|
+
type NotifyRequest = LocalNotificationPayload;
|
|
21
|
+
/**
|
|
22
|
+
* Response returned when the platform provider accepts the notification.
|
|
23
|
+
*/
|
|
24
|
+
type NotifySuccessResponse = {
|
|
25
|
+
/** Whether the notification was shown. */success: true;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Response returned when the platform provider cannot show the notification.
|
|
29
|
+
*/
|
|
30
|
+
type NotifyFailureResponse = {
|
|
31
|
+
/** Whether the notification was shown. */success: false; /** Human-readable failure reason. */
|
|
32
|
+
error: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Local notification result.
|
|
36
|
+
*/
|
|
37
|
+
type NotifyResponse = NotifySuccessResponse | NotifyFailureResponse;
|
|
38
|
+
/**
|
|
39
|
+
* Summary of the active local notification provider.
|
|
40
|
+
*/
|
|
41
|
+
interface LocalNotificationProviderSummary {
|
|
42
|
+
/** Provider identifier. */
|
|
43
|
+
id: string;
|
|
44
|
+
/** Human-readable provider name. */
|
|
45
|
+
displayName: string;
|
|
46
|
+
/** Whether the provider can currently show notifications. */
|
|
47
|
+
available: boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Local notification domain schemas.
|
|
51
|
+
*
|
|
52
|
+
* Local notifications are platform-native notifications (Electron, iOS, Android, Web).
|
|
53
|
+
* Unlike push notifications, only one provider is active per platform.
|
|
54
|
+
*/
|
|
55
|
+
declare const LocalNotificationSchemas: {
|
|
56
|
+
/**
|
|
57
|
+
* Show a local notification on the current platform.
|
|
58
|
+
*/
|
|
59
|
+
notify: {
|
|
60
|
+
request: z.ZodObject<{
|
|
61
|
+
title: z.ZodString;
|
|
62
|
+
body: z.ZodString;
|
|
63
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
64
|
+
url: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
response: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
67
|
+
success: z.ZodLiteral<true>;
|
|
68
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
69
|
+
success: z.ZodLiteral<false>;
|
|
70
|
+
error: z.ZodString;
|
|
71
|
+
}, z.core.$strict>], "success">;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Get the current platform's notification provider info.
|
|
75
|
+
*/
|
|
76
|
+
getProvider: {
|
|
77
|
+
request: z.ZodObject<{}, z.core.$strip>;
|
|
78
|
+
response: z.ZodObject<{
|
|
79
|
+
provider: z.ZodNullable<z.ZodObject<{
|
|
80
|
+
id: z.ZodString;
|
|
81
|
+
displayName: z.ZodString;
|
|
82
|
+
available: z.ZodBoolean;
|
|
83
|
+
}, z.core.$strip>>;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
//#endregion
|
|
88
|
+
export { LocalNotificationPayload, LocalNotificationProviderSummary, LocalNotificationSchemas, NotifyFailureResponse, NotifyRequest, NotifyResponse, NotifySuccessResponse };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as e}from"zod";const t=e.object({title:e.string(),body:e.string(),icon:e.string().optional(),url:e.string().optional()}),n=e.discriminatedUnion(`success`,[e.object({success:e.literal(!0)}).strict(),e.object({success:e.literal(!1),error:e.string()}).strict()]),r=e.object({id:e.string(),displayName:e.string(),available:e.boolean()}),i={notify:{request:t,response:n},getProvider:{request:e.object({}),response:e.object({provider:r.nullable()})}};export{i as LocalNotificationSchemas};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { t as LogImporterInfo } from "../../index-D9MwJ2Q8.mjs";
|
|
2
|
+
import { a as OrchestratorFactory, i as OrchestratorEntry, r as LogImporterRegistration, t as LogImportRegistryOptions } from "../../types-DZHvOc_Q.mjs";
|
|
3
|
+
export { type LogImportRegistryOptions, type LogImporterInfo, type LogImporterRegistration, type OrchestratorEntry, type OrchestratorFactory };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { i as LogImportSettings, t as LogImporterInfo } from "../../index-D9MwJ2Q8.mjs";
|
|
2
|
+
import { a as OrchestratorFactory, i as OrchestratorEntry, n as LogImportServiceInstance, o as LogImportRegistry, r as LogImporterRegistration, t as LogImportRegistryOptions } from "../../types-DZHvOc_Q.mjs";
|
|
3
|
+
import { IMakaioBus } from "@makaio/framework/bus";
|
|
4
|
+
import * as _$_makaio_contracts0 from "@makaio/framework/contracts";
|
|
5
|
+
import { ExtensionContext, MakaioNodeExtension } from "@makaio/framework/contracts";
|
|
6
|
+
import * as _$drizzle_orm_sqlite_core0 from "drizzle-orm/sqlite-core";
|
|
7
|
+
import { MakaioDatabase } from "@makaio/framework/storage/drizzle";
|
|
8
|
+
import { LogImporter, ProcessLogFileResult } from "@makaio/framework/adapters";
|
|
9
|
+
import { ContributionProcessor } from "@makaio/framework/kernel";
|
|
10
|
+
|
|
11
|
+
//#region services/log-import/src/log-import-contribution-processor.d.ts
|
|
12
|
+
/**
|
|
13
|
+
* Create a {@link ContributionProcessor} that wires `MakaioNodeExtension<IMakaioBus>.logImport`
|
|
14
|
+
* surfaces into the {@link LogImportRegistry}.
|
|
15
|
+
*
|
|
16
|
+
* The returned processor:
|
|
17
|
+
* - Filters to extensions that declare `logImport`.
|
|
18
|
+
* - On activation: resolves `LogImportRegistry` from the extension context,
|
|
19
|
+
* registers the log importer, and attaches an orchestrator factory when the
|
|
20
|
+
* config provides orchestrator classes.
|
|
21
|
+
* - On stopped: unregisters the importer and calls any registered cleanup.
|
|
22
|
+
*
|
|
23
|
+
* **Error semantics:** `processActivated` throws a hard error when
|
|
24
|
+
* `LogImportRegistry` is missing (composition misconfiguration) or when
|
|
25
|
+
* registration fails. Any partial state is rolled back before re-throwing.
|
|
26
|
+
* `processStopped` is best-effort and must not throw.
|
|
27
|
+
* @returns A `ContributionProcessor` ready for registration with the coordinator.
|
|
28
|
+
*/
|
|
29
|
+
declare function createLogImportContributionProcessor(): ContributionProcessor;
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region services/log-import/src/package.d.ts
|
|
32
|
+
/** Token for the log import registry package. */
|
|
33
|
+
declare const LogImportRegistryToken: _$_makaio_contracts0.ExtensionToken<LogImportRegistry>;
|
|
34
|
+
/** Package that starts the framework log import registry. */
|
|
35
|
+
declare const logImportRegistryPackage: MakaioNodeExtension<IMakaioBus>;
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region services/log-import/src/compaction-events.d.ts
|
|
38
|
+
/**
|
|
39
|
+
* Payload needed to persist a deterministic `session.compacted` event.
|
|
40
|
+
*/
|
|
41
|
+
interface SessionCompactedEventInput {
|
|
42
|
+
sessionId: string;
|
|
43
|
+
eventId: string;
|
|
44
|
+
timestamp: number;
|
|
45
|
+
trigger: 'manual' | 'auto';
|
|
46
|
+
preTokens: number | null;
|
|
47
|
+
summary: string | null;
|
|
48
|
+
compressChildSessionId: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Persist a deterministic `session.compacted` event with race-safe idempotency.
|
|
52
|
+
*
|
|
53
|
+
* This helper owns the existence check for the common case. If a concurrent
|
|
54
|
+
* importer wins the race between that check and the append, we re-check by
|
|
55
|
+
* `eventId` and treat the duplicate as success.
|
|
56
|
+
* @param bus - Bus instance for event storage requests
|
|
57
|
+
* @param event - Fully materialized compaction event payload
|
|
58
|
+
*/
|
|
59
|
+
declare function appendSessionCompactedEvent(bus: IMakaioBus, event: SessionCompactedEventInput): Promise<void>;
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region services/log-import/src/import-types.d.ts
|
|
62
|
+
/** Result returned after persisting an imported segment subtree. */
|
|
63
|
+
interface ImportSegmentTreeResult {
|
|
64
|
+
/** Makaio session ID created or reused for the imported segment. */
|
|
65
|
+
sessionId: string;
|
|
66
|
+
/** Total messages persisted across the segment subtree. */
|
|
67
|
+
messageCount: number;
|
|
68
|
+
}
|
|
69
|
+
/** Minimal caller context required to persist a processed import result tree. */
|
|
70
|
+
interface PersistImportResultContext {
|
|
71
|
+
/** Owning adapter instance ID. */
|
|
72
|
+
adapterId: string;
|
|
73
|
+
/** Canonical adapter name used for linkage. */
|
|
74
|
+
adapterName: string;
|
|
75
|
+
/** Log file path on disk; only the root segment owns it. */
|
|
76
|
+
logFilePath?: string | null;
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region services/log-import/src/generic-import-handlers.d.ts
|
|
80
|
+
/**
|
|
81
|
+
* Persist a processed import result via the canonical segment-tree path.
|
|
82
|
+
*
|
|
83
|
+
* Uses the importer's explicit lineage tree as the single source of truth for
|
|
84
|
+
* session creation, message persistence, compaction events, and status finalization.
|
|
85
|
+
* @param bus - Bus instance
|
|
86
|
+
* @param result - Fully processed importer result for one log file
|
|
87
|
+
* @param ctx - Adapter identity and optional root log file path
|
|
88
|
+
* @returns Makaio session ID and total persisted message count
|
|
89
|
+
*/
|
|
90
|
+
declare function persistImportResultTree(bus: IMakaioBus, result: ProcessLogFileResult, ctx: PersistImportResultContext): Promise<ImportSegmentTreeResult>;
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region services/log-import/src/import-phase.d.ts
|
|
93
|
+
/**
|
|
94
|
+
* Import lifecycle phase constants for the log-import persistence path.
|
|
95
|
+
* @packageDocumentation
|
|
96
|
+
*/
|
|
97
|
+
/**
|
|
98
|
+
* Named phases of the import lifecycle executed by {@link importSegmentTree}.
|
|
99
|
+
*
|
|
100
|
+
* Each phase represents a durable checkpoint with explicit invariants.
|
|
101
|
+
* Phases always progress in order; no phase is skipped or rolled back within a
|
|
102
|
+
* single segment tree traversal.
|
|
103
|
+
*
|
|
104
|
+
* ```
|
|
105
|
+
* linked ──► persisted ──► finalized
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* **linked**
|
|
109
|
+
* The unified session row has been created by
|
|
110
|
+
* `SessionStorageSubjects.importUpsert` and stores the adapter session ID.
|
|
111
|
+
* Messages may not exist yet. Lineage-sensitive consumers that require stored
|
|
112
|
+
* message content must not act on the linked phase alone during an active
|
|
113
|
+
* import; they should wait for the `persisted` phase.
|
|
114
|
+
*
|
|
115
|
+
* **persisted**
|
|
116
|
+
* All messages for this segment have been written to storage via
|
|
117
|
+
* `MessageStorageSubjects.upsertByAdapterMessageId`. If this segment is a
|
|
118
|
+
* compaction child, the `session.compacted` event has been appended to the
|
|
119
|
+
* parent session. At this point the session's message content is queryable, but
|
|
120
|
+
* the session status is still `'discovered'`.
|
|
121
|
+
*
|
|
122
|
+
* **finalized**
|
|
123
|
+
* The entire subtree (this segment and all descendants) has been persisted.
|
|
124
|
+
* The unified session row's `importStatus` has been moved to `'imported'`
|
|
125
|
+
* and its session `status` has been moved to `'active'`. The session is fully
|
|
126
|
+
* visible and queryable. Status finalization is always bottom-up: a parent only
|
|
127
|
+
* reaches `finalized` after every child has reached `finalized`.
|
|
128
|
+
*/
|
|
129
|
+
declare const ImportPhase: {
|
|
130
|
+
/**
|
|
131
|
+
* Session link created; messages may not exist yet.
|
|
132
|
+
*
|
|
133
|
+
* Invariant: `SessionStorageSubjects.importUpsert` has returned successfully
|
|
134
|
+
* and the Makaio `sessionId` is stable.
|
|
135
|
+
*/
|
|
136
|
+
readonly linked: "linked";
|
|
137
|
+
/**
|
|
138
|
+
* Messages stored and compaction events emitted.
|
|
139
|
+
*
|
|
140
|
+
* Invariant: all messages for this segment are in storage; if this segment
|
|
141
|
+
* carries compaction metadata, `session.compacted` has been appended to the
|
|
142
|
+
* parent session.
|
|
143
|
+
*/
|
|
144
|
+
readonly persisted: "persisted";
|
|
145
|
+
/**
|
|
146
|
+
* Status moved to `'imported'` / `'active'` after full subtree succeeds.
|
|
147
|
+
*
|
|
148
|
+
* Invariant: this segment and every descendant have reached `persisted`;
|
|
149
|
+
* `SessionStorageSubjects.updateImportStatus` has set the session `importStatus`
|
|
150
|
+
* to `'imported'` and promoted the session `status` to `'active'`.
|
|
151
|
+
*/
|
|
152
|
+
readonly finalized: "finalized";
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* Union of all valid import lifecycle phase names.
|
|
156
|
+
*
|
|
157
|
+
* Derived from {@link ImportPhase} so the type and the runtime value are
|
|
158
|
+
* always in sync.
|
|
159
|
+
*/
|
|
160
|
+
type ImportPhaseValue = (typeof ImportPhase)[keyof typeof ImportPhase];
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region services/log-import/src/storage/schema.d.ts
|
|
163
|
+
/**
|
|
164
|
+
* Drizzle schema for the `log_import_settings` table.
|
|
165
|
+
*
|
|
166
|
+
* Stores per-adapter global import mode. One row per adapter — `adapter_name`
|
|
167
|
+
* is the primary key. Hosts that need scoped overrides should provide their own
|
|
168
|
+
* extended storage subjects and tables.
|
|
169
|
+
*/
|
|
170
|
+
declare const logImportSettings: _$drizzle_orm_sqlite_core0.SQLiteTableWithColumns<{
|
|
171
|
+
name: "log_import_settings";
|
|
172
|
+
schema: undefined;
|
|
173
|
+
columns: {
|
|
174
|
+
adapterName: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
175
|
+
name: "adapter_name";
|
|
176
|
+
tableName: "log_import_settings";
|
|
177
|
+
dataType: "string";
|
|
178
|
+
columnType: "SQLiteText";
|
|
179
|
+
data: string;
|
|
180
|
+
driverParam: string;
|
|
181
|
+
notNull: true;
|
|
182
|
+
hasDefault: false;
|
|
183
|
+
isPrimaryKey: true;
|
|
184
|
+
isAutoincrement: false;
|
|
185
|
+
hasRuntimeDefault: false;
|
|
186
|
+
enumValues: [string, ...string[]];
|
|
187
|
+
baseColumn: never;
|
|
188
|
+
identity: undefined;
|
|
189
|
+
generated: undefined;
|
|
190
|
+
}, {}, {
|
|
191
|
+
length: number | undefined;
|
|
192
|
+
}>;
|
|
193
|
+
mode: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
194
|
+
name: "mode";
|
|
195
|
+
tableName: "log_import_settings";
|
|
196
|
+
dataType: "string";
|
|
197
|
+
columnType: "SQLiteText";
|
|
198
|
+
data: "disabled" | "discover" | "import";
|
|
199
|
+
driverParam: string;
|
|
200
|
+
notNull: true;
|
|
201
|
+
hasDefault: true;
|
|
202
|
+
isPrimaryKey: false;
|
|
203
|
+
isAutoincrement: false;
|
|
204
|
+
hasRuntimeDefault: false;
|
|
205
|
+
enumValues: ["disabled", "discover", "import"];
|
|
206
|
+
baseColumn: never;
|
|
207
|
+
identity: undefined;
|
|
208
|
+
generated: undefined;
|
|
209
|
+
}, {}, {
|
|
210
|
+
length: number | undefined;
|
|
211
|
+
}>;
|
|
212
|
+
createdAt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
213
|
+
name: "created_at";
|
|
214
|
+
tableName: "log_import_settings";
|
|
215
|
+
dataType: "number";
|
|
216
|
+
columnType: "SQLiteInteger";
|
|
217
|
+
data: number;
|
|
218
|
+
driverParam: number;
|
|
219
|
+
notNull: true;
|
|
220
|
+
hasDefault: false;
|
|
221
|
+
isPrimaryKey: false;
|
|
222
|
+
isAutoincrement: false;
|
|
223
|
+
hasRuntimeDefault: false;
|
|
224
|
+
enumValues: undefined;
|
|
225
|
+
baseColumn: never;
|
|
226
|
+
identity: undefined;
|
|
227
|
+
generated: undefined;
|
|
228
|
+
}, {}, {}>;
|
|
229
|
+
updatedAt: _$drizzle_orm_sqlite_core0.SQLiteColumn<{
|
|
230
|
+
name: "updated_at";
|
|
231
|
+
tableName: "log_import_settings";
|
|
232
|
+
dataType: "number";
|
|
233
|
+
columnType: "SQLiteInteger";
|
|
234
|
+
data: number;
|
|
235
|
+
driverParam: number;
|
|
236
|
+
notNull: true;
|
|
237
|
+
hasDefault: false;
|
|
238
|
+
isPrimaryKey: false;
|
|
239
|
+
isAutoincrement: false;
|
|
240
|
+
hasRuntimeDefault: false;
|
|
241
|
+
enumValues: undefined;
|
|
242
|
+
baseColumn: never;
|
|
243
|
+
identity: undefined;
|
|
244
|
+
generated: undefined;
|
|
245
|
+
}, {}, {}>;
|
|
246
|
+
};
|
|
247
|
+
dialect: "sqlite";
|
|
248
|
+
}>;
|
|
249
|
+
/** Type for a selected log import settings row. */
|
|
250
|
+
type SelectLogImportSettings = typeof logImportSettings.$inferSelect;
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region services/log-import/src/storage/handlers.d.ts
|
|
253
|
+
/**
|
|
254
|
+
* Maps a database row to the {@link LogImportSettings} API type.
|
|
255
|
+
*
|
|
256
|
+
* Exported so the host-owned scoped-settings handler can reuse the same
|
|
257
|
+
* mapping when it falls back to the framework global row.
|
|
258
|
+
* @param row - Database row from `log_import_settings`
|
|
259
|
+
* @returns Mapped `LogImportSettings` object
|
|
260
|
+
*/
|
|
261
|
+
declare function rowToSettings(row: SelectLogImportSettings): LogImportSettings;
|
|
262
|
+
/**
|
|
263
|
+
* Registers all Drizzle-based log-import settings storage handlers with the bus.
|
|
264
|
+
*
|
|
265
|
+
* Handles `getMode`, `setMode`, and `listSettings` operations for the
|
|
266
|
+
* `log_import_settings` table.
|
|
267
|
+
* @param bus - MakaioBus instance for message handling
|
|
268
|
+
* @param db - Drizzle database instance
|
|
269
|
+
* @param _ctx - Extension context (unused; reserved for future use)
|
|
270
|
+
* @returns Cleanup function to unregister all handlers
|
|
271
|
+
*/
|
|
272
|
+
declare function registerDrizzleLogImportStorage(bus: IMakaioBus, db: MakaioDatabase, _ctx: ExtensionContext): () => void;
|
|
273
|
+
//#endregion
|
|
274
|
+
export { ImportPhase, type ImportPhaseValue, LogImportRegistry, type LogImportRegistryOptions, LogImportRegistryToken, type LogImportServiceInstance, type LogImporterInfo, type LogImporterRegistration, type OrchestratorEntry, type OrchestratorFactory, type PersistImportResultContext, type SessionCompactedEventInput, appendSessionCompactedEvent, createLogImportContributionProcessor, logImportRegistryPackage, persistImportResultTree, registerDrizzleLogImportStorage, rowToSettings };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{LogImportNamespace as e,LogImportSubjects as t}from"./namespace.mjs";import{z as n}from"zod";import*as r from"node:fs/promises";import{basename as i,dirname as a,isAbsolute as o,join as s,relative as c,resolve as l,sep as u}from"node:path";import{MakaioBus as d}from"@makaio/framework/bus";import{COMPRESS_SESSION_LINEAGE_KIND as f,CapabilitySubjects as p,FORK_SESSION_LINEAGE_KIND as m,ROOT_SESSION_LINEAGE_KIND as ee,SUBAGENT_SESSION_LINEAGE_KIND as h,extensionToken as te}from"@makaio/framework/contracts";import{integer as g,sqliteTable as _,text as v}from"drizzle-orm/sqlite-core";import{eq as y}from"drizzle-orm";import{ImportCursorStorageSubjects as ne,toImportSegment as re}from"@makaio/framework/adapters";import{MessageStorageSubjects as ie,SessionEventStorageSubjects as b,SessionStorageSubjects as x,toSessionLineage as ae}from"@makaio/framework/services/session";const S=n.discriminatedUnion(`kind`,[n.object({adapterSessionId:n.string(),kind:n.literal(ee),parentAdapterSessionId:n.null().default(null),forkPointMessageId:n.null().default(null),model:n.string().nullable().default(null),cwd:n.string().nullable().default(null),startedAt:n.number().finite().optional()}),n.object({adapterSessionId:n.string(),kind:n.literal(m),parentAdapterSessionId:n.string(),forkPointMessageId:n.string(),model:n.string().nullable().default(null),cwd:n.string().nullable().default(null),startedAt:n.number().finite().optional()}),n.object({adapterSessionId:n.string(),kind:n.literal(h),parentAdapterSessionId:n.string(),forkPointMessageId:n.null().default(null),model:n.string().nullable().default(null),cwd:n.string().nullable().default(null),startedAt:n.number().finite().optional()}),n.object({adapterSessionId:n.string(),kind:n.literal(f),parentAdapterSessionId:n.string(),forkPointMessageId:n.null().default(null),model:n.string().nullable().default(null),cwd:n.string().nullable().default(null),startedAt:n.number().finite().optional()})]);function C(e){return S.parse(e.payload)}function w(e,t,n,r,i,a,o){let s=ae(e);return{externalSessionId:e.adapterSessionId,source:t,cwd:n,...r===void 0?{}:{logFilePath:r},...i===void 0?{}:{startedAt:i},...a===void 0?{}:{adapterId:a},...o===void 0?{}:{clientId:o},...s}}function T(e,t,n){let r={adapterSessionId:e.adapterSessionId,model:t,cwd:n};switch(e.lineage.kind){case`root`:return{...r,kind:`root`,parentAdapterSessionId:null,forkPointMessageId:null};case`fork`:if(e.lineage.parentAdapterSessionId==null)throw Error(`Fork segment ${e.adapterSessionId} missing parentAdapterSessionId`);if(e.lineage.forkPointMessageId==null)throw Error(`Fork segment ${e.adapterSessionId} missing forkPointMessageId`);return{...r,kind:`fork`,parentAdapterSessionId:e.lineage.parentAdapterSessionId,forkPointMessageId:e.lineage.forkPointMessageId};case`subagent`:if(e.lineage.parentAdapterSessionId==null)throw Error(`Subagent segment ${e.adapterSessionId} missing parentAdapterSessionId`);return{...r,kind:`subagent`,parentAdapterSessionId:e.lineage.parentAdapterSessionId,forkPointMessageId:null};case`compress`:if(e.lineage.parentAdapterSessionId==null)throw Error(`Compress segment ${e.adapterSessionId} missing parentAdapterSessionId`);return{...r,kind:`compress`,parentAdapterSessionId:e.lineage.parentAdapterSessionId,forkPointMessageId:null};default:{let t=e.lineage.kind;throw Error(`Unknown lineage kind: ${String(t)}`)}}}async function E(e,t){let{events:n}=await e.request(b.getByIds,{sessionId:t.sessionId,eventIds:[t.eventId]});if(!(n.length>0))try{await e.request(b.append,{event:{sessionId:t.sessionId,eventId:t.eventId,timestamp:t.timestamp,type:`session.compacted`,payload:{trigger:t.trigger,preTokens:t.preTokens,summary:t.summary,compressChildSessionId:t.compressChildSessionId}}})}catch(n){let{events:r}=await e.request(b.getByIds,{sessionId:t.sessionId,eventIds:[t.eventId]});if(r.length>0)return;throw n}}const D=new Map,O=`MAKAIO_GLOBSTAR_DIR`,k=`MAKAIO_GLOBSTAR`,A=`MAKAIO_STAR`;function j(e){return e.replace(/[\\/]+/g,`/`).replace(/^\.\/+/,``)}function oe(e,t){let n=j(e),r=j(t),a=r.includes(`/`)?n:i(n);if(r.length>200)return!1;if(!r.includes(`*`))return a===r;let o=0;for(let e of r)if(e===`*`&&(o+=1,o>64))return!1;let s=D.get(r);if(s)return D.delete(r),D.set(r,s),s.test(a);let c=r.replace(/\*\*\//g,O).replace(/\*\*/g,k).replace(/\*/g,A).replace(/[.+^${}()|[\]\\]/g,`\\$&`).replaceAll(O,`(?:.*/)?`).replaceAll(k,`.*`).replaceAll(A,`[^/]*`),l=RegExp(`^${c}$`);if(D.size>=512){let e=D.keys().next();e.done||D.delete(e.value)}return D.set(r,l),l.test(a)}async function M(e,t,n=e){let i=[];try{let a=await r.readdir(e,{withFileTypes:!0});for(let r of a){let a=s(e,r.name);if(r.isDirectory()){let e=await M(a,t,n);i.push(...e)}else if(r.isFile()){if(!oe(c(n,a).split(u).join(`/`),t))continue;i.push(a)}}}catch{}return i}function se(e,t,n){if(e!==void 0){if(o(e))return e;if(t&&o(t))return l(a(t),e);if(n&&o(n))return l(n,e)}}function N(e,t,n=!0,r){let i=[];if(n){let n=e.split(`
|
|
2
|
+
`).filter(e=>e.trim());for(let e of n){let n=t.parseRecord(e,r);n&&i.push(n)}}else{let n=t.parseRecord(e,r);n&&i.push(n)}return i}function P(e,n){return e.on(t.scan,async t=>{let{adapterName:i}=t.payload,a=n(i);if(!a){t.setResult({adapterName:i,sessionsFound:0,newSessions:0});return}let{importer:o,logFilePattern:s,adapterName:c}=a,l=o.getLogDirectory();try{await r.access(l)}catch{t.setResult({adapterName:i,sessionsFound:0,newSessions:0});return}let u=s.endsWith(`.jsonl`),d=await M(l,s),f=0,p=0;for(let t of d)try{let n=N(await r.readFile(t,`utf8`),o,u,t);if(n.length===0)continue;let i=C(o.extractSessionContext(n).sessionEvent);f++;let{created:a}=await e.request(x.importUpsert,w(i,c,i.cwd,t,i.startedAt));a&&p++}catch(e){console.warn(`[LogImportRegistry] Failed to process ${t}:`,e instanceof Error?e.message:e)}t.setResult({adapterName:i,sessionsFound:f,newSessions:p})})}async function F(e,t,n,i,a,o){try{let a=await r.stat(i),s=t.extractSessionContext(n),c={adapterSessionId:o,model:s.model,cwd:s.cwd,sessionEvent:s.sessionEvent,startedEvent:s.startedEvent,state:t.serializeState(s.state)};await e.request(ne.set,{filePath:i,bytesRead:a.size,lastModified:a.mtime.toISOString(),sessionContext:c})}catch(e){console.warn(`[importFromFileContent] Failed to persist import cursor`,{adapterName:a,adapterSessionId:o,filePath:i,error:e instanceof Error?e.message:String(e),stack:e instanceof Error?e.stack:void 0})}}async function I(e,t,n,r,i){let a=i.find(e=>e.origin===`compact`),o=a?.contentText??null,s=r.timestamp??a?.timestamp??Date.now();await E(e,{sessionId:t,eventId:`session-compacted:${t}:${n}`,timestamp:s,trigger:r.trigger,preTokens:r.preTokens,summary:o,compressChildSessionId:n})}async function L(e,t,n){for(let r of n)await e.request(ie.upsertByAdapterMessageId,{sessionId:t,turnId:null,adapterMessageId:r.adapterMessageId,role:r.role,contentText:r.contentText,blocks:r.blocks,agentId:r.agentId,adapterSessionId:r.adapterSessionId,timestamp:r.timestamp,...r.origin!==void 0&&{origin:r.origin}})}async function R(e,t,n,r){let i=T(t,n.model,n.cwd),a=t.messages.length>0?t.messages.reduce((e,t)=>Math.min(e,t.timestamp),1/0):void 0,{sessionId:o}=await e.request(x.importUpsert,w(i,n.adapterName,n.cwd,n.logFilePath,a,n.adapterId));await L(e,o,t.messages),r!==void 0&&t.compaction!==void 0&&await I(e,r,o,t.compaction,t.messages);let s=t.messages.length,c={adapterId:n.adapterId,adapterName:n.adapterName,model:n.model,cwd:n.cwd,logFilePath:null};for(let n of t.children??[]){let t=await R(e,n,c,o);s+=t.messageCount}return await e.request(x.updateImportStatus,{sessionId:o,importStatus:`imported`}),{sessionId:o,messageCount:s}}async function z(e,t,n){let r=C(t.sessionEvent);return R(e,re(t),{adapterId:n.adapterId,adapterName:n.adapterName,model:r.model,cwd:r.cwd,logFilePath:n.logFilePath})}async function B(e){let{bus:t,importer:n,content:r,isJsonl:i,adapterName:a,adapterId:o,sourceFilePath:s,persistedLogFilePath:c}=e,l=N(r,n,i,s);if(l.length===0)throw Error(`No valid records found`);let u=n.processLogFile(l),d=se(c,s,C(u.sessionEvent).cwd),{sessionId:f,messageCount:p}=await z(t,u,{adapterId:o,adapterName:a,logFilePath:d});return d!==void 0&&await F(t,n,l,d,a,u.adapterSessionId),{sessionId:f,messageCount:p}}function V(e,n){return e.on(t.uploadFiles,async t=>{let{adapterName:r,files:i}=t.payload,a=n(r);if(!a){t.setResult({adapterName:r,filesProcessed:i.length,sessionsImported:0,errors:i.map(e=>({filename:e.filename,error:`No importer registered for this adapter`}))});return}let{importer:o,logFilePattern:s,adapterName:c,id:l}=a,u=s.endsWith(`.jsonl`),d=0,f=[];for(let t of i)try{await B({bus:e,importer:o,content:Buffer.from(t.contentBase64,`base64`).toString(`utf8`),isJsonl:u,adapterName:c,adapterId:l,sourceFilePath:t.filename}),d++}catch(e){f.push({filename:t.filename,error:e instanceof Error?e.message:String(e)})}t.setResult({adapterName:r,filesProcessed:i.length,sessionsImported:d,errors:f})})}function H(e,n){return e.on(t.importSession,async t=>{let{adapterSessionId:i,adapterName:a}=t.payload,{session:o}=await e.request(x.getByAdapterSessionId,{adapterSessionId:i,source:a});if(!o)throw Error(`Session not found for external ID: ${i}`);if(o.source!==a)throw Error(`Session '${i}' belongs to adapter '${o.source}', not '${a}'`);if(!o.logFilePath)throw Error(`No log file path recorded for session with external ID '${i}'. Re-run a discovery scan to populate the file path.`);let s=n(a);if(!s)throw Error(`No importer registered for adapter '${a}'`);let{importer:c,logFilePattern:l,adapterName:u,id:d}=s,f=l.endsWith(`.jsonl`),{sessionId:p,messageCount:m}=await B({bus:e,importer:c,content:await r.readFile(o.logFilePath,`utf8`),isJsonl:f,adapterName:u,adapterId:d,sourceFilePath:o.logFilePath,persistedLogFilePath:o.logFilePath});t.setResult({sessionId:p,messageCount:m})})}function U(e){return e.hasAdapterContribution?`adapter`:`extension`}function W(e){if(!e||typeof e!=`object`)return!1;let t=e,n=t.registration;return typeof t.id==`string`&&typeof t.displayName==`string`&&typeof t.adapterName==`string`&&!!n&&typeof n==`object`&&typeof n.LogImporterClass==`function`&&typeof n.logFilePattern==`string`&&(n.LogOrchestratorClass===void 0||typeof n.LogOrchestratorClass==`function`)&&(n.LogDiscoveryOrchestratorClass===void 0||typeof n.LogDiscoveryOrchestratorClass==`function`)}function G(e,t,n){return{enabled:n?.enabled??!0,pollIntervalMs:n?.pollIntervalMs,eventsPerSecond:n?.eventsPerSecond,adapterId:e,adapterName:t,checkMakaioManaged:n?.checkMakaioManaged}}function K(e,t,n,r,i){if(!r&&!i)return null;let a=G(e,t,n);return e=>a.enabled?e===`discover`&&i?new i(a):e===`import`&&r?new r(a):null:null}async function ce(e,n,r,i){try{let a=await r.requestOptional(t.getMode,{adapterName:n});if(!a.handled)return;let{mode:o}=a.data;if(o===`disabled`)return;await i(e,o)}catch(e){console.warn(`[LogImport] Failed to restore persisted mode for '${n}':`,e)}}async function q(e,t,n){if(!W(e)||n.getImporter(e.id)!==void 0)return;await n.register({id:e.id,adapterName:e.adapterName,displayName:e.displayName,source:U({hasAdapterContribution:!0}),importer:new e.registration.LogImporterClass({adapterId:e.id,adapterName:e.adapterName}),logFilePattern:e.registration.logFilePattern});let r=K(e.id,e.adapterName,e.logImportConfig,e.registration.LogOrchestratorClass,e.registration.LogDiscoveryOrchestratorClass);r&&n.setOrchestratorFactory(e.id,r),await ce(e.id,e.adapterName,t,(e,t)=>n.switchMode(e,t))}async function le(e,t,n){let r=e.on(p.register,async t=>{await q(t.payload.provider,e,n)},{filter:{capabilityId:`log-import`}});for(let r of t?.getProviders(`log-import`)??[])await q(r,e,n);return r}async function J(e,t){let n=e.get(t);if(n)try{n.orchestrator.isRunning()&&await n.orchestrator.stop()}finally{try{await n.orchestrator.dispose()}finally{e.delete(t)}}}async function ue(e,t){try{await e.start()}catch(n){try{try{e.isRunning()&&await e.stop()}finally{await e.dispose()}}catch(e){console.warn(`[LogImportRegistry] Failed to clean up orchestrator after start failure for '${t}'.`,e instanceof Error?e.message:String(e))}throw n}}var Y=class{bus;capabilityService;registrations=new Map;orchestrators=new Map;cleanupHandlers=[];initialized=!1;constructor(e){this.bus=e?.bus??d,this.capabilityService=e?.capabilityService}async init(){if(this.initialized)return;let e=this.bus.on(t.listImporters,e=>{let t=this.listImporters();e.setResult({importers:t})});this.cleanupHandlers.push(e);let n=P(this.bus,e=>this.getImporterByAdapterName(e));this.cleanupHandlers.push(n);let r=V(this.bus,e=>this.getImporterByAdapterName(e));this.cleanupHandlers.push(r);let i=H(this.bus,e=>this.getImporterByAdapterName(e));this.cleanupHandlers.push(i);let a=await le(this.bus,this.capabilityService,this);this.cleanupHandlers.push(a),this.initialized=!0}async register(e){if(this.registrations.has(e.id))throw Error(`Log importer '${e.id}' is already registered`);this.registrations.set(e.id,e)}async unregister(e){if(!this.registrations.has(e))throw Error(`Log importer '${e}' is not registered`);await J(this.orchestrators,e),this.registrations.delete(e)}async startImporter(e){if(!this.registrations.get(e))throw Error(`Log importer '${e}' is not registered`);let t=this.orchestrators.get(e);if(!t)throw Error(`No orchestrator available for '${e}'. Orchestrators must be created and provided by the adapter or extension before starting.`);t.orchestrator.isRunning()||(await t.orchestrator.start(),t.isManaged=!0)}async stopImporter(e){let t=this.orchestrators.get(e);t&&(t.orchestrator.isRunning()&&await t.orchestrator.stop(),t.isManaged=!1)}async switchMode(e,t){let n=this.registrations.get(e);if(!n)throw Error(`Log importer '${e}' is not registered`);if(await J(this.orchestrators,e),t===`disabled`||!n.orchestratorFactory)return;let r=n.orchestratorFactory(t);r&&(await ue(r,e),this.orchestrators.set(e,{orchestrator:r,isManaged:!0}))}async startDiscovery(e){return this.switchMode(e,`discover`)}setOrchestratorFactory(e,t){let n=this.registrations.get(e);if(!n)throw Error(`Cannot set orchestrator factory for unregistered importer '${e}'`);this.registrations.set(e,{...n,orchestratorFactory:t})}listImporters(){let e=[];for(let[,t]of this.registrations){let n=this.orchestrators.get(t.id)?.orchestrator.isRunning()??!1;e.push({id:t.id,adapterName:t.adapterName,displayName:t.displayName,source:t.source,logFilePattern:t.logFilePattern,isRunning:n,supportsManualImport:t.supportsManualImport??!0})}return e}getImporter(e){let t=this.registrations.get(e);return t?{...t}:void 0}getImporterByAdapterName(e){for(let t of this.registrations.values())if(t.adapterName===e)return{...t}}detectImporter(e){let t,n=0;for(let r of this.registrations.values()){let i=r.importer.canHandle(e);if(i===!1)continue;let a=i===!0?1:i.confidence;a>n&&(n=a,t=r)}return t}async registerOrchestrator(e,t){if(!this.registrations.has(e))throw Error(`Cannot register orchestrator for unregistered importer '${e}'`);await J(this.orchestrators,e),this.orchestrators.set(e,{orchestrator:t,isManaged:!1})}async destroy(){if(!(!this.initialized&&this.orchestrators.size===0&&this.cleanupHandlers.length===0)){for(let[e]of this.orchestrators)await J(this.orchestrators,e);for(let e of this.cleanupHandlers)e();this.cleanupHandlers.length=0,this.initialized=!1}}};const X=te(`log-import-registry`),de={name:X.name,displayName:`Log Import Registry`,version:`0.1.0`,critical:!0,namespaces:[e],create:e=>new Y({bus:e.bus})};function fe(e,t,n){return{enabled:n?.enabled??!0,pollIntervalMs:n?.pollIntervalMs,eventsPerSecond:n?.eventsPerSecond,adapterId:e,adapterName:t,checkMakaioManaged:n?.checkMakaioManaged}}function pe(e,t,n){if(!n.LogOrchestratorClass&&!n.LogDiscoveryOrchestratorClass)return null;let r=fe(e,t,n.logImportConfig);return e=>r.enabled?e===`discover`&&n.LogDiscoveryOrchestratorClass?new n.LogDiscoveryOrchestratorClass(r):e===`import`&&n.LogOrchestratorClass?new n.LogOrchestratorClass(r):null:null}function me(){let e=new Map;return{filter:e=>!!e.logImport,processActivated:async(t,n,r)=>{let{logImport:i}=n;if(!i)return;let a=r.getService(X);if(!a)throw Error(`[LogImportContributionProcessor] LogImportRegistry is not available. Ensure '${X.name}' is listed as a dependency before activating '${t}'.`);let{adapterName:o,displayName:s,config:c}=i,l=c,u=`package:${t}`,d=U({hasAdapterContribution:!!n.adapters?.length}),f=new l.LogImporterClass({adapterId:u,adapterName:o});await a.register({id:u,adapterName:o,displayName:s,source:d,importer:f,logFilePattern:l.logFilePattern??``,supportsManualImport:l.supportsManualImport});try{let e=pe(u,o,l);e&&a.setOrchestratorFactory(u,e)}catch(e){try{await a.unregister(u)}catch(e){console.error(`[LogImportContributionProcessor] Rollback of log importer '${u}' failed:`,e)}throw e}console.info(`[LogImportContributionProcessor] Registered log importer '${o}' from package: ${t}`),e.set(u,async()=>{try{await a.unregister(u)}catch(e){console.error(`[LogImportContributionProcessor] Failed to unregister log importer '${u}' during cleanup:`,e)}})},processStopped:async t=>{let n=`package:${t}`,r=e.get(n);r&&(e.delete(n),await r())}}}const he={linked:`linked`,persisted:`persisted`,finalized:`finalized`},Z=_(`log_import_settings`,{adapterName:v(`adapter_name`).primaryKey(),mode:v(`mode`,{enum:[`disabled`,`discover`,`import`]}).notNull().default(`disabled`),createdAt:g(`created_at`).notNull(),updatedAt:g(`updated_at`).notNull()});function Q(e){return{adapterName:e.adapterName,mode:e.mode,createdAt:e.createdAt,updatedAt:e.updatedAt}}function ge(e){let{bus:n,db:r}=e;return n.on(t.getMode,async e=>{let{adapterName:t}=e.payload,[n]=await r.select().from(Z).where(y(Z.adapterName,t)).limit(1);e.setResult({mode:n?.mode??`disabled`})})}function $(e){let{bus:n,db:r}=e;return n.on(t.setMode,async e=>{let{adapterName:t,mode:n}=e.payload,i=Date.now();await r.insert(Z).values({adapterName:t,mode:n,createdAt:i,updatedAt:i}).onConflictDoUpdate({target:Z.adapterName,set:{mode:n,updatedAt:i}}),e.setResult({success:!0})})}function _e(e){let{bus:n,db:r}=e;return n.on(t.listSettings,async e=>{let t=await r.select().from(Z);e.setResult({settings:t.map(Q)})})}function ve(e,t,n){let r={bus:e,db:t},i=[ge(r),$(r),_e(r)];return()=>i.forEach(e=>e())}export{he as ImportPhase,Y as LogImportRegistry,X as LogImportRegistryToken,E as appendSessionCompactedEvent,me as createLogImportContributionProcessor,de as logImportRegistryPackage,z as persistImportResultTree,ve as registerDrizzleLogImportStorage,Q as rowToSettings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"../../schemas-DE-GNmSD.mjs";import{LogImportSubjects as t}from"./namespace.mjs";export{e as IMPORT_LAST_SCAN_CATEGORY,t as LogImportSubjects};
|