@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,772 @@
|
|
|
1
|
+
import { SubjectDefinition } from "@makaio/framework/core";
|
|
2
|
+
import { SessionLineageKind, SessionMessageBlock, SessionMetadata } from "@makaio/framework/contracts";
|
|
3
|
+
import { JsonObject } from "type-fest";
|
|
4
|
+
|
|
5
|
+
//#region adapters/core/src/log-importer/types.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Normalized event produced by log importers.
|
|
8
|
+
*
|
|
9
|
+
* Represents a single event extracted from an external tool's log file,
|
|
10
|
+
* normalized to Makaio's subject/payload format for emission to the bus.
|
|
11
|
+
* @remarks
|
|
12
|
+
* Events may include optional {@link ImportMetadata} to distinguish
|
|
13
|
+
* imported events from live events and preserve original timestamps.
|
|
14
|
+
* @see {@link LogImporter} - Interface that produces these events
|
|
15
|
+
* @see {@link ImportMetadata} - Provenance metadata for imported events
|
|
16
|
+
*/
|
|
17
|
+
interface NormalizedEvent {
|
|
18
|
+
/** The Makaio subject definition for this event */
|
|
19
|
+
subject: SubjectDefinition;
|
|
20
|
+
/** Event payload matching the subject's schema, may include _import metadata */
|
|
21
|
+
payload: Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Base interface for adapter name identifiers used in log import provenance.
|
|
25
|
+
*
|
|
26
|
+
* Extended via declaration merging by adapters and extensions to register
|
|
27
|
+
* new adapter names for log import provenance.
|
|
28
|
+
* @remarks
|
|
29
|
+
* Adapters and extensions extend this interface to add their adapter names:
|
|
30
|
+
* ```typescript
|
|
31
|
+
* declare module '@makaio/framework/adapters' {
|
|
32
|
+
* interface ExternalToolIdentifiers {
|
|
33
|
+
* 'claude-code-cli': ExternalToolMeta;
|
|
34
|
+
* 'my-custom-adapter': ExternalToolMeta;
|
|
35
|
+
* }
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
* @see {@link ExternalToolMeta} - Metadata interface for adapter identifiers
|
|
39
|
+
* @see {@link ExternalToolIdentifier} - Type alias for registered adapter names
|
|
40
|
+
*/
|
|
41
|
+
interface ExternalToolIdentifiers {}
|
|
42
|
+
/**
|
|
43
|
+
* Metadata interface for external tool identifiers.
|
|
44
|
+
*
|
|
45
|
+
* Currently empty - provides a seam for future metadata like display names,
|
|
46
|
+
* log format descriptions, or file patterns.
|
|
47
|
+
* @remarks
|
|
48
|
+
* Future extension might include:
|
|
49
|
+
* - `displayName?: string` - Human-readable tool name
|
|
50
|
+
* - `format?: 'jsonl' | 'json' | 'text'` - Expected log format
|
|
51
|
+
* - `filePattern?: string` - Glob pattern for log files
|
|
52
|
+
*/
|
|
53
|
+
interface ExternalToolMeta {}
|
|
54
|
+
/**
|
|
55
|
+
* Known adapter names used for log import provenance.
|
|
56
|
+
*
|
|
57
|
+
* Used in {@link ImportMetadata.tool} to identify the source adapter.
|
|
58
|
+
* Extensible via declaration merging of {@link ExternalToolIdentifiers}.
|
|
59
|
+
* Falls back to `string` when no augmentations are in scope, so the core
|
|
60
|
+
* package is usable standalone while still providing autocomplete for
|
|
61
|
+
* known keys when augmentations are present.
|
|
62
|
+
*/
|
|
63
|
+
type ExternalToolIdentifier = keyof ExternalToolIdentifiers | (string & {});
|
|
64
|
+
/**
|
|
65
|
+
* Provenance metadata for imported events.
|
|
66
|
+
*
|
|
67
|
+
* Added to event payloads under `_import` key to distinguish
|
|
68
|
+
* imported events from live events and preserve original context.
|
|
69
|
+
* @remarks
|
|
70
|
+
* This metadata enables:
|
|
71
|
+
* - Filtering imported vs live events in queries
|
|
72
|
+
* - Accurate timeline reconstruction with original timestamps
|
|
73
|
+
* - Debugging import issues by tracing back to source files
|
|
74
|
+
* @see {@link NormalizedEvent} - Events containing this metadata
|
|
75
|
+
*/
|
|
76
|
+
interface ImportMetadata {
|
|
77
|
+
/** Always 'external' to indicate imported (not live) event */
|
|
78
|
+
source: 'external';
|
|
79
|
+
/** Adapter name that produced the original log (e.g., 'claude-code-cli') */
|
|
80
|
+
tool: ExternalToolIdentifier;
|
|
81
|
+
/** Original timestamp from the external tool's log record (ISO 8601) */
|
|
82
|
+
originalTimestamp?: string;
|
|
83
|
+
/** Always false for imported events (they are replayed, not streamed) */
|
|
84
|
+
streaming: false;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Cursor position for tracking import progress within a file.
|
|
88
|
+
*
|
|
89
|
+
* Used to resume import from the last successfully processed position
|
|
90
|
+
* after restarts, avoiding duplicate event emission.
|
|
91
|
+
* @remarks
|
|
92
|
+
* Cursors track byte offsets rather than line numbers for efficiency
|
|
93
|
+
* and to handle partial lines correctly. The lastModified timestamp
|
|
94
|
+
* enables detection of file truncation/rotation.
|
|
95
|
+
* @see {@link LogImporter} - Uses cursors for incremental import
|
|
96
|
+
*/
|
|
97
|
+
interface ImportCursorPosition {
|
|
98
|
+
/** Absolute path to the log file being tracked */
|
|
99
|
+
filePath: string;
|
|
100
|
+
/** Number of bytes successfully read and processed */
|
|
101
|
+
bytesRead: number;
|
|
102
|
+
/** ISO 8601 timestamp of file's last modification when cursor was saved */
|
|
103
|
+
lastModified: string;
|
|
104
|
+
/**
|
|
105
|
+
* Session context for incremental imports (persisted on first read).
|
|
106
|
+
* Contains adapter-specific state needed to resume processing mid-session.
|
|
107
|
+
*/
|
|
108
|
+
sessionContext?: SessionMetadata & {
|
|
109
|
+
/** Adapter's native session identifier */adapterSessionId: string; /** Session discovered event (emitted once at session start) */
|
|
110
|
+
sessionEvent: NormalizedEvent; /** Agent started event (emitted once at session start) */
|
|
111
|
+
startedEvent: NormalizedEvent; /** Serialized adapter-specific state for resumption */
|
|
112
|
+
state: JsonObject;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Session context for incremental log imports.
|
|
117
|
+
*
|
|
118
|
+
* Contains adapter-specific state that must persist across chunks during
|
|
119
|
+
* incremental import. Created on first read and restored from cursor on
|
|
120
|
+
* subsequent reads.
|
|
121
|
+
* @typeParam TState - Adapter-specific resumable state type
|
|
122
|
+
* @see {@link LogImporter.extractSessionContext} - Creates this context
|
|
123
|
+
* @see {@link LogImporter.processRecords} - Uses this context
|
|
124
|
+
*/
|
|
125
|
+
interface LogImportSessionContext<TState = unknown> extends SessionMetadata {
|
|
126
|
+
/** Adapter's native session identifier */
|
|
127
|
+
adapterSessionId: string;
|
|
128
|
+
/**
|
|
129
|
+
* Session discovered event (adapter creates with adapter-specific payload).
|
|
130
|
+
* Emitted once when the session is first discovered.
|
|
131
|
+
*/
|
|
132
|
+
sessionEvent: NormalizedEvent;
|
|
133
|
+
/**
|
|
134
|
+
* Agent started event (adapter creates with model, cwd, etc.).
|
|
135
|
+
* Emitted once when the session starts processing.
|
|
136
|
+
*/
|
|
137
|
+
startedEvent: NormalizedEvent;
|
|
138
|
+
/** Resumable import state - adapter-specific */
|
|
139
|
+
state: TState;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Message payload ready for persistence via MessageStorageSubjects.
|
|
143
|
+
*
|
|
144
|
+
* Adapters return this from {@link ProcessLogFileResult.messagePayloads}.
|
|
145
|
+
* Uses {@link SessionMessageBlock} as the canonical block type.
|
|
146
|
+
*/
|
|
147
|
+
interface StorageMessagePayload {
|
|
148
|
+
/** Adapter's native message ID — used for upsert deduplication */
|
|
149
|
+
adapterMessageId: string;
|
|
150
|
+
/** Message role */
|
|
151
|
+
role: 'user' | 'assistant';
|
|
152
|
+
/** Plain text for FTS indexing */
|
|
153
|
+
contentText: string;
|
|
154
|
+
/** Structured content blocks */
|
|
155
|
+
blocks: SessionMessageBlock[];
|
|
156
|
+
/** Agent ID (defaults to 'main' for non-subagent messages) */
|
|
157
|
+
agentId: string;
|
|
158
|
+
/** Adapter's session ID */
|
|
159
|
+
adapterSessionId: string;
|
|
160
|
+
/** Unix ms timestamp */
|
|
161
|
+
timestamp: number;
|
|
162
|
+
/** Input modality or origin. `'compact'` = injected summary after a compaction boundary. */
|
|
163
|
+
origin?: 'voice' | 'text' | 'compact';
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Canonical lineage metadata for an import segment.
|
|
167
|
+
*
|
|
168
|
+
* Every imported session segment carries explicit lineage — there is no
|
|
169
|
+
* "unknown" state. Root sessions use `kind: 'root'` with a null parent.
|
|
170
|
+
*/
|
|
171
|
+
interface ImportSegmentLineage {
|
|
172
|
+
/** Relationship of this segment to its parent. */
|
|
173
|
+
kind: SessionLineageKind;
|
|
174
|
+
/** Adapter session ID of the parent segment, null for root sessions. */
|
|
175
|
+
parentAdapterSessionId: string | null;
|
|
176
|
+
/** Message ID where this session diverged from parent (null for root, subagent, and compress). */
|
|
177
|
+
forkPointMessageId: string | null;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Compaction boundary metadata from the external tool's log.
|
|
181
|
+
*/
|
|
182
|
+
interface CompactionMetadata {
|
|
183
|
+
/** How compaction was triggered. */
|
|
184
|
+
trigger: 'manual' | 'auto';
|
|
185
|
+
/** Token count before compaction (null if unavailable). */
|
|
186
|
+
preTokens: number | null;
|
|
187
|
+
/** Unix ms timestamp of the compaction event (null if unavailable). */
|
|
188
|
+
timestamp: number | null;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Canonical import segment — the structural tree of imported session data.
|
|
192
|
+
*
|
|
193
|
+
* This is the single source of truth for compaction structure and lineage
|
|
194
|
+
* during import. The importer is the canonical owner of this contract.
|
|
195
|
+
* @remarks
|
|
196
|
+
* - Every segment carries explicit {@link ImportSegmentLineage}
|
|
197
|
+
* - Children represent compaction boundaries or nested segments
|
|
198
|
+
* - Use {@link toImportSegment} to convert a {@link ProcessLogFileResult}
|
|
199
|
+
*/
|
|
200
|
+
interface ImportSegment {
|
|
201
|
+
/** Adapter's native session identifier for this segment. */
|
|
202
|
+
adapterSessionId: string;
|
|
203
|
+
/** Explicit lineage metadata — always present, never inferred post-import. */
|
|
204
|
+
lineage: ImportSegmentLineage;
|
|
205
|
+
/** Storage-ready message payloads for this segment. */
|
|
206
|
+
messages: StorageMessagePayload[];
|
|
207
|
+
/** Compaction metadata from the boundary record (absent if not a compress child). */
|
|
208
|
+
compaction?: CompactionMetadata;
|
|
209
|
+
/** Child segments (compress children, nested compactions). */
|
|
210
|
+
children?: ImportSegment[];
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Result of processing a complete log file.
|
|
214
|
+
*
|
|
215
|
+
* The full import pipeline result. For the structural tree without event data,
|
|
216
|
+
* see {@link ImportSegment} and {@link toImportSegment}.
|
|
217
|
+
* @see {@link LogImporter.processLogFile}
|
|
218
|
+
*/
|
|
219
|
+
interface ProcessLogFileResult {
|
|
220
|
+
/** Adapter session ID extracted from the log */
|
|
221
|
+
adapterSessionId: string;
|
|
222
|
+
/** Session discovered event (adapter.session.discovered) */
|
|
223
|
+
sessionEvent: NormalizedEvent;
|
|
224
|
+
/** All normalized message events including agent.started */
|
|
225
|
+
messageEvents: NormalizedEvent[];
|
|
226
|
+
/** Storage-ready message payloads extracted from records */
|
|
227
|
+
messagePayloads: StorageMessagePayload[];
|
|
228
|
+
/** Explicit lineage metadata — always present, never inferred post-import. */
|
|
229
|
+
lineage: ImportSegmentLineage;
|
|
230
|
+
/** Compress child results — one per compaction boundary. Absent when no compaction. */
|
|
231
|
+
compressChildren?: ProcessLogFileResult[];
|
|
232
|
+
/** Compaction metadata from the boundary record. */
|
|
233
|
+
compactionMetadata?: CompactionMetadata;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Converts a {@link ProcessLogFileResult} to a canonical {@link ImportSegment}.
|
|
237
|
+
*
|
|
238
|
+
* Strips bus-emission fields (sessionEvent, messageEvents) and recursively
|
|
239
|
+
* converts children, producing the clean structural tree.
|
|
240
|
+
* @param result - The full import result from an adapter
|
|
241
|
+
* @returns A canonical import segment tree
|
|
242
|
+
*/
|
|
243
|
+
declare function toImportSegment(result: ProcessLogFileResult): ImportSegment;
|
|
244
|
+
/**
|
|
245
|
+
* Lightweight metadata extracted during session discovery.
|
|
246
|
+
*
|
|
247
|
+
* Contains only the fields needed to populate the `adapter.session.discovered`
|
|
248
|
+
* event without running the full import pipeline.
|
|
249
|
+
* @see {@link LogImporter.extractDiscoveryMetadata} - Method that returns this type
|
|
250
|
+
*/
|
|
251
|
+
interface DiscoveryMetadata {
|
|
252
|
+
/** Session identifier from the external tool */
|
|
253
|
+
adapterSessionId: string;
|
|
254
|
+
/** Model used (null if unknown or not present in logs) */
|
|
255
|
+
model: string | null;
|
|
256
|
+
/** Working directory (null if not present in logs) */
|
|
257
|
+
cwd: string | null;
|
|
258
|
+
/** Human-readable session title (truncated to 200 chars) */
|
|
259
|
+
title: string;
|
|
260
|
+
/**
|
|
261
|
+
* Whether the log file contains at least one importable message (user or assistant).
|
|
262
|
+
* Files with only system/metadata records should set this to `false` so the
|
|
263
|
+
* discovery orchestrator can skip them.
|
|
264
|
+
* Optional for backward compatibility with out-of-tree importers; consumers
|
|
265
|
+
* should treat `undefined` as `false`.
|
|
266
|
+
*/
|
|
267
|
+
hasMessages?: boolean;
|
|
268
|
+
/** Parent session's adapter ID (null/undefined if root session). */
|
|
269
|
+
parentAdapterSessionId?: string | null;
|
|
270
|
+
/** Message ID where this session diverged from parent (null/undefined if root or subagent). */
|
|
271
|
+
forkPointMessageId?: string | null;
|
|
272
|
+
/** Relationship to parent: root session, user fork, or subagent. Defaults to 'root' if omitted. */
|
|
273
|
+
kind?: SessionLineageKind;
|
|
274
|
+
/** Unix ms timestamp of when the session started in the external tool. */
|
|
275
|
+
startedAt?: number;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Contract for log importers (adapters and extensions).
|
|
279
|
+
*
|
|
280
|
+
* Importers implement this interface to import external session logs
|
|
281
|
+
* into Makaio's event system. Both AI adapters (Claude Code, Codex, Gemini)
|
|
282
|
+
* and extensions can provide log importers.
|
|
283
|
+
* @remarks
|
|
284
|
+
* The importer is responsible for:
|
|
285
|
+
* - Locating log files in tool-specific directories
|
|
286
|
+
* - Parsing tool-specific log formats
|
|
287
|
+
* - Detecting compatible log formats via {@link canHandle}
|
|
288
|
+
* - Extracting session context from initial records
|
|
289
|
+
* - Processing records into normalized events with context
|
|
290
|
+
* - Serializing/deserializing state for cursor persistence
|
|
291
|
+
* - Detecting sessions already managed by Makaio (to skip)
|
|
292
|
+
*
|
|
293
|
+
* The generic `TRecord` type represents the tool's native log record format
|
|
294
|
+
* (e.g., Claude Code's JSONL records with `type`, `message`, `sessionId`).
|
|
295
|
+
* @typeParam TRecord - The tool's native log record type
|
|
296
|
+
* @typeParam TState - The resumable state type (defaults to unknown)
|
|
297
|
+
* @see {@link NormalizedEvent} - Output format for normalized events
|
|
298
|
+
* @see {@link ImportMetadata} - Provenance metadata added to events
|
|
299
|
+
* @see {@link ImportCursorPosition} - Cursor tracking for incremental import
|
|
300
|
+
* @see {@link LogImportSessionContext} - Session context for incremental imports
|
|
301
|
+
*/
|
|
302
|
+
interface LogImporter<TRecord, TState = unknown> {
|
|
303
|
+
/**
|
|
304
|
+
* Check if this importer can handle the given log sample.
|
|
305
|
+
*
|
|
306
|
+
* Used for auto-detection during log upload to match importers with
|
|
307
|
+
* unknown log formats. Inspects a sample record/line to determine compatibility.
|
|
308
|
+
* @param sample - Sample log content (JSONL line or parsed JSON object)
|
|
309
|
+
* @returns Boolean or confidence score (0-1) indicating compatibility
|
|
310
|
+
* @remarks
|
|
311
|
+
* Simple implementations return boolean. Advanced implementations can return
|
|
312
|
+
* a confidence score for disambiguation when multiple importers claim support.
|
|
313
|
+
*
|
|
314
|
+
* Example implementations:
|
|
315
|
+
* - Claude Code: Check for `type` field in `['started', 'message', 'tool_use']`
|
|
316
|
+
* - Codex: Check for `event` field matching Codex schema patterns
|
|
317
|
+
* - Gemini: Check for Gemini-specific log structure
|
|
318
|
+
*
|
|
319
|
+
* Return `{ confidence: 0.95 }` for high confidence matches,
|
|
320
|
+
* `{ confidence: 0.5 }` for ambiguous formats, or `false` for incompatible.
|
|
321
|
+
*/
|
|
322
|
+
canHandle(sample: string | JsonObject): boolean | {
|
|
323
|
+
confidence: number;
|
|
324
|
+
};
|
|
325
|
+
/**
|
|
326
|
+
* Get the root directory containing this tool's log files.
|
|
327
|
+
* @returns Absolute path to the log directory (may contain subdirectories)
|
|
328
|
+
* @remarks
|
|
329
|
+
* Examples of log directories:
|
|
330
|
+
* - Claude Code: `~/.claude/projects/` (contains `session.jsonl` files)
|
|
331
|
+
* - Codex: `~/.codex/sessions/` (date-organized subdirectories)
|
|
332
|
+
* - Gemini: `~/.gemini/tmp/` (hash-organized project directories)
|
|
333
|
+
*/
|
|
334
|
+
getLogDirectory(): string;
|
|
335
|
+
/**
|
|
336
|
+
* Parse a single line/record from log file content.
|
|
337
|
+
* @param content - Raw line content from the log file (JSONL) or full file (JSON)
|
|
338
|
+
* @param sourceFilePath - Optional path to the source file (for importers that need path context)
|
|
339
|
+
* @returns Parsed record or null if line is malformed/unparseable
|
|
340
|
+
* @remarks
|
|
341
|
+
* Implementations should be lenient - return null for malformed records
|
|
342
|
+
* rather than throwing. The caller will log a warning and continue.
|
|
343
|
+
*
|
|
344
|
+
* The optional `sourceFilePath` parameter enables importers to store file path
|
|
345
|
+
* context in records when needed (e.g., deriving storage roots from path structure).
|
|
346
|
+
*/
|
|
347
|
+
parseRecord(content: string | JsonObject, sourceFilePath?: string): TRecord | null;
|
|
348
|
+
/**
|
|
349
|
+
* Check if a session is managed by Makaio (should be skipped during import).
|
|
350
|
+
* @param sessionId - The external tool's session identifier
|
|
351
|
+
* @returns True if Makaio manages this session, false if it should be imported
|
|
352
|
+
* @remarks
|
|
353
|
+
* This prevents re-importing sessions that Makaio already tracks via live
|
|
354
|
+
* streaming. Implementation typically queries AdapterSessionStorage for the
|
|
355
|
+
* sessionId to check if the session has status='live'.
|
|
356
|
+
*
|
|
357
|
+
* May be async to support database lookups.
|
|
358
|
+
*/
|
|
359
|
+
isMakaioManaged(sessionId: string): Promise<boolean>;
|
|
360
|
+
/**
|
|
361
|
+
* Extract lightweight discovery metadata from a log file.
|
|
362
|
+
*
|
|
363
|
+
* Optimized for minimal I/O — reads only enough of the file to populate
|
|
364
|
+
* the four discovery fields. Used by the DiscoveryOrchestrator to avoid
|
|
365
|
+
* the full parseFile → extractSessionContext pipeline.
|
|
366
|
+
* @param filePath - Absolute path to the log file
|
|
367
|
+
* @returns Discovery metadata with session ID, model, cwd, and title
|
|
368
|
+
*/
|
|
369
|
+
extractDiscoveryMetadata(filePath: string): Promise<DiscoveryMetadata>;
|
|
370
|
+
/**
|
|
371
|
+
* Extract session context from records (called on first read only).
|
|
372
|
+
*
|
|
373
|
+
* Creates the session context including session/started events and
|
|
374
|
+
* initial adapter state. This is only called when no existing cursor
|
|
375
|
+
* context exists (i.e., first time reading this file).
|
|
376
|
+
* @param records - Initial batch of parsed records from the file
|
|
377
|
+
* @returns Session context with events and initial state
|
|
378
|
+
* @remarks
|
|
379
|
+
* The returned context is persisted in the cursor and restored on
|
|
380
|
+
* subsequent reads via {@link deserializeState}.
|
|
381
|
+
*/
|
|
382
|
+
extractSessionContext(records: TRecord[]): LogImportSessionContext<TState>;
|
|
383
|
+
/**
|
|
384
|
+
* Process records into events (context always provided).
|
|
385
|
+
*
|
|
386
|
+
* Converts adapter-specific records to normalized Makaio events using
|
|
387
|
+
* the provided session context. Updates context.state as needed for
|
|
388
|
+
* stateful processing (e.g., turn tracking).
|
|
389
|
+
* @param records - Batch of parsed records to process
|
|
390
|
+
* @param context - Session context (from extractSessionContext or restored)
|
|
391
|
+
* @returns Array of normalized events (may be empty)
|
|
392
|
+
* @remarks
|
|
393
|
+
* This replaces the stateless `toNormalizedEvents` method. The context
|
|
394
|
+
* provides session metadata and mutable adapter state for tracking
|
|
395
|
+
* things like conversation turns across chunks.
|
|
396
|
+
*
|
|
397
|
+
* Implementations should add {@link ImportMetadata} to payloads
|
|
398
|
+
* under the `_import` key for provenance tracking.
|
|
399
|
+
*/
|
|
400
|
+
processRecords(records: TRecord[], context: LogImportSessionContext<TState>): NormalizedEvent[];
|
|
401
|
+
/**
|
|
402
|
+
* Serialize adapter state for cursor persistence.
|
|
403
|
+
*
|
|
404
|
+
* Converts the adapter's typed state to a JSON-serializable object
|
|
405
|
+
* for storage in the cursor.
|
|
406
|
+
* @param state - Adapter-specific state to serialize
|
|
407
|
+
* @returns JSON-serializable representation of the state
|
|
408
|
+
*/
|
|
409
|
+
serializeState(state: TState): JsonObject;
|
|
410
|
+
/**
|
|
411
|
+
* Restore adapter state from cursor.
|
|
412
|
+
*
|
|
413
|
+
* Converts the serialized state back to the adapter's typed state
|
|
414
|
+
* when resuming from a persisted cursor.
|
|
415
|
+
* @param raw - Serialized state from cursor storage
|
|
416
|
+
* @returns Restored adapter-specific state
|
|
417
|
+
*/
|
|
418
|
+
deserializeState(raw: JsonObject): TState;
|
|
419
|
+
/**
|
|
420
|
+
* Process a complete log file in a single call.
|
|
421
|
+
*
|
|
422
|
+
* Composes extractSessionContext + processRecords + message extraction.
|
|
423
|
+
* Adapters that need special handling (fork detection, field normalization)
|
|
424
|
+
* should override this method.
|
|
425
|
+
* @param records - All parsed records from the log file
|
|
426
|
+
* @returns Combined session metadata, events, and message payloads
|
|
427
|
+
*/
|
|
428
|
+
processLogFile(records: TRecord | TRecord[]): ProcessLogFileResult;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Configuration for log importer constructor.
|
|
432
|
+
*
|
|
433
|
+
* Minimal config required to instantiate a log importer for testing.
|
|
434
|
+
*/
|
|
435
|
+
interface LogImporterConfig {
|
|
436
|
+
/** Unique identifier for the adapter instance */
|
|
437
|
+
adapterId: string;
|
|
438
|
+
/** Human-readable adapter name */
|
|
439
|
+
adapterName: string;
|
|
440
|
+
/** Optional session ownership check used by importer implementations that can skip Makaio-managed sessions. */
|
|
441
|
+
checkMakaioManaged?: (sessionId: string) => Promise<boolean>;
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Test configuration for log import conformance tests.
|
|
445
|
+
*
|
|
446
|
+
* Host-owned log importer packages may use this shape to describe their
|
|
447
|
+
* test fixtures and importer constructors.
|
|
448
|
+
* @see {@link LogImporter} - Base interface that LogImporterClass must implement
|
|
449
|
+
*/
|
|
450
|
+
interface LogImportTestConfig<TRecord = unknown, TState = unknown> {
|
|
451
|
+
/**
|
|
452
|
+
* Fixture file name for conformance tests.
|
|
453
|
+
*
|
|
454
|
+
* Relative to the conformance harness fixture directory.
|
|
455
|
+
* @example 'codex-session.jsonl' or 'gemini-session.json'
|
|
456
|
+
*/
|
|
457
|
+
fixtureFile: string;
|
|
458
|
+
/**
|
|
459
|
+
* Log importer class constructor.
|
|
460
|
+
*
|
|
461
|
+
* Must implement {@link LogImporter} for conformance tests.
|
|
462
|
+
*/
|
|
463
|
+
LogImporterClass: new (config: LogImporterConfig) => LogImporter<TRecord, TState>;
|
|
464
|
+
}
|
|
465
|
+
//#endregion
|
|
466
|
+
//#region adapters/core/src/log-importer/event-queue.d.ts
|
|
467
|
+
interface LogImportEventQueueConfig {
|
|
468
|
+
readonly eventsPerSecond: number;
|
|
469
|
+
readonly onEventEmitted: () => void;
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Serializes log-import event delivery and cursor writes.
|
|
473
|
+
*
|
|
474
|
+
* Cursor tasks accept the event promises they depend on, so event emission
|
|
475
|
+
* failures reject the cursor task instead of advancing import progress.
|
|
476
|
+
*/
|
|
477
|
+
declare class LogImportEventQueue {
|
|
478
|
+
private readonly eventQueue;
|
|
479
|
+
private readonly cursorQueue;
|
|
480
|
+
private readonly onEventEmitted;
|
|
481
|
+
constructor(config: LogImportEventQueueConfig);
|
|
482
|
+
/**
|
|
483
|
+
* Queue a normalized event and return its delivery promise.
|
|
484
|
+
* @param event - Normalized event to emit
|
|
485
|
+
* @returns Promise that resolves after delivery or rejects on emit failure
|
|
486
|
+
*/
|
|
487
|
+
queueEvent(event: NormalizedEvent): Promise<void>;
|
|
488
|
+
/**
|
|
489
|
+
* Queue a cursor/progress task behind previously queued event deliveries.
|
|
490
|
+
* @param task - Cursor/progress task to run after event delivery succeeds
|
|
491
|
+
* @param precedingEventPromises - Emission promises queued before this task
|
|
492
|
+
* @returns Promise that rejects if a preceding event or the task itself fails
|
|
493
|
+
*/
|
|
494
|
+
queueAfterEvents(task: () => Promise<void>, precedingEventPromises?: readonly Promise<void>[]): Promise<void>;
|
|
495
|
+
/** Wait until all queued event and cursor tasks finish. */
|
|
496
|
+
drain(): Promise<void>;
|
|
497
|
+
/** Alias for callers that use queue-idle terminology instead of shutdown-drain terminology. */
|
|
498
|
+
onIdle(): Promise<void>;
|
|
499
|
+
}
|
|
500
|
+
//#endregion
|
|
501
|
+
//#region adapters/core/src/log-importer/log-import-watcher.d.ts
|
|
502
|
+
interface LogFileChangeEvent {
|
|
503
|
+
/** Absolute path to the changed file. */
|
|
504
|
+
filePath: string;
|
|
505
|
+
/** Current file stats needed for cursor and rotation handling. */
|
|
506
|
+
stat: {
|
|
507
|
+
/** File size in bytes. */size: number; /** Last modification time. */
|
|
508
|
+
mtime: Date;
|
|
509
|
+
};
|
|
510
|
+
/** Type of change detected by the watcher. */
|
|
511
|
+
changeType: 'created' | 'modified' | 'rotated';
|
|
512
|
+
}
|
|
513
|
+
interface LogImportWatcherOptions {
|
|
514
|
+
/** Directory to watch for log files. */
|
|
515
|
+
directory: string;
|
|
516
|
+
/** Glob pattern used to discover log files. */
|
|
517
|
+
pattern: string;
|
|
518
|
+
/** Polling interval in milliseconds. */
|
|
519
|
+
pollIntervalMs: number;
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Adapter-log watcher facade used by orchestrators.
|
|
523
|
+
*
|
|
524
|
+
* Keeps the concrete file-watcher package out of the exported orchestrator API,
|
|
525
|
+
* while preserving the small operations subclasses need for discovery tracking.
|
|
526
|
+
*/
|
|
527
|
+
declare class LogImportWatcher {
|
|
528
|
+
private readonly watcher;
|
|
529
|
+
constructor(options: LogImportWatcherOptions);
|
|
530
|
+
/** @returns True when the underlying watcher is actively polling. */
|
|
531
|
+
isRunning(): boolean;
|
|
532
|
+
/** Start watching the configured log directory. */
|
|
533
|
+
start(): Promise<void>;
|
|
534
|
+
/** Stop watching while preserving tracked file state. */
|
|
535
|
+
stop(): void;
|
|
536
|
+
/** Dispose watcher resources and listeners. */
|
|
537
|
+
dispose(): void;
|
|
538
|
+
/**
|
|
539
|
+
* Subscribe to file change events.
|
|
540
|
+
* @param handler - Callback receiving a log file change event.
|
|
541
|
+
* @returns Function that unsubscribes the handler.
|
|
542
|
+
*/
|
|
543
|
+
onChange(handler: (event: LogFileChangeEvent) => void | Promise<void>): () => void;
|
|
544
|
+
/**
|
|
545
|
+
* Subscribe to watcher errors.
|
|
546
|
+
* @param handler - Callback receiving the error and optional file path.
|
|
547
|
+
* @returns Function that unsubscribes the handler.
|
|
548
|
+
*/
|
|
549
|
+
onError(handler: (event: {
|
|
550
|
+
error: Error;
|
|
551
|
+
filePath?: string;
|
|
552
|
+
}) => void | Promise<void>): () => void;
|
|
553
|
+
/**
|
|
554
|
+
* Subscribe to tracked-file deletion events.
|
|
555
|
+
* @param handler - Callback receiving the deleted file path.
|
|
556
|
+
* @returns Function that unsubscribes the handler.
|
|
557
|
+
*/
|
|
558
|
+
onDeleted(handler: (event: {
|
|
559
|
+
filePath: string;
|
|
560
|
+
}) => void | Promise<void>): () => void;
|
|
561
|
+
/**
|
|
562
|
+
* Subscribe to completed watcher poll cycles.
|
|
563
|
+
* @param handler - Callback receiving the current tracked file path set.
|
|
564
|
+
* @returns Function that unsubscribes the poll handler.
|
|
565
|
+
*/
|
|
566
|
+
onPolled(handler: (trackedFilePaths: ReadonlySet<string>) => void | Promise<void>): () => void;
|
|
567
|
+
/**
|
|
568
|
+
* Read the watcher's last observed mtime for a file.
|
|
569
|
+
* @param filePath - Absolute path to inspect.
|
|
570
|
+
* @returns Last observed mtime in milliseconds, or undefined when untracked.
|
|
571
|
+
*/
|
|
572
|
+
getTrackedFileMtimeMs(filePath: string): number | undefined;
|
|
573
|
+
/**
|
|
574
|
+
* Schedule a single-file watcher poll.
|
|
575
|
+
* @param filePath - Absolute path to poll immediately.
|
|
576
|
+
*/
|
|
577
|
+
triggerImmediatePoll(filePath: string): void;
|
|
578
|
+
/**
|
|
579
|
+
* Seed watcher state from persisted cursor positions.
|
|
580
|
+
* @param cursors - Cursor positions used to initialize tracked file state.
|
|
581
|
+
*/
|
|
582
|
+
seedFromCursors(cursors: Array<Pick<ImportCursorPosition, 'filePath' | 'bytesRead' | 'lastModified'>>): void;
|
|
583
|
+
}
|
|
584
|
+
//#endregion
|
|
585
|
+
//#region adapters/core/src/log-importer/orchestrator-config.d.ts
|
|
586
|
+
/** Configuration for log import orchestrators. */
|
|
587
|
+
interface LogOrchestratorConfig {
|
|
588
|
+
enabled: boolean;
|
|
589
|
+
directory?: string;
|
|
590
|
+
pollIntervalMs?: number;
|
|
591
|
+
eventsPerSecond?: number;
|
|
592
|
+
adapterId: string;
|
|
593
|
+
adapterName: string;
|
|
594
|
+
checkMakaioManaged?: (sessionId: string) => Promise<boolean>;
|
|
595
|
+
}
|
|
596
|
+
/** Result of parsing a log file. */
|
|
597
|
+
interface ParseFileResult<TRecord> {
|
|
598
|
+
records: TRecord[];
|
|
599
|
+
bytesRead?: number;
|
|
600
|
+
errors?: Array<{
|
|
601
|
+
line?: number;
|
|
602
|
+
error: string;
|
|
603
|
+
}>;
|
|
604
|
+
}
|
|
605
|
+
//#endregion
|
|
606
|
+
//#region adapters/core/src/log-importer/base-orchestrator.d.ts
|
|
607
|
+
/**
|
|
608
|
+
* Abstract base class for log import orchestrators.
|
|
609
|
+
*
|
|
610
|
+
* Supports JSONL (byte offset cursors) and JSON (mtime-based) file formats.
|
|
611
|
+
* Concrete implementations provide adapter-specific file parsing.
|
|
612
|
+
* @typeParam TRecord - The adapter's native log record type
|
|
613
|
+
* @typeParam TState - The adapter's resumable state type (default: unknown)
|
|
614
|
+
*/
|
|
615
|
+
declare abstract class BaseLogOrchestrator<TRecord, TState = unknown> {
|
|
616
|
+
protected readonly config: Required<Omit<LogOrchestratorConfig, 'checkMakaioManaged' | 'directory'>> & {
|
|
617
|
+
checkMakaioManaged?: LogOrchestratorConfig['checkMakaioManaged'];
|
|
618
|
+
directory?: string;
|
|
619
|
+
};
|
|
620
|
+
protected readonly watcher: LogImportWatcher;
|
|
621
|
+
protected readonly eventQueue: LogImportEventQueue;
|
|
622
|
+
/** Log prefix for console output - set by subclass */
|
|
623
|
+
protected abstract readonly logPrefix: string;
|
|
624
|
+
/** Importer instance - subclasses create and manage their own typed instance. */
|
|
625
|
+
protected readonly importer: LogImporter<TRecord, TState>;
|
|
626
|
+
private readonly managedSessionCache;
|
|
627
|
+
private unsubscribeChange?;
|
|
628
|
+
private unsubscribeError?;
|
|
629
|
+
private unsubscribeDeleted?;
|
|
630
|
+
private readonly stats;
|
|
631
|
+
private readonly watcherTasks;
|
|
632
|
+
private progressTimer?;
|
|
633
|
+
protected constructor(config: LogOrchestratorConfig, importer: LogImporter<TRecord, TState>);
|
|
634
|
+
/** Get the glob pattern for log files to watch. */
|
|
635
|
+
protected abstract getLogFilePattern(): string;
|
|
636
|
+
/**
|
|
637
|
+
* Determine whether a discovered file should be skipped before processing.
|
|
638
|
+
*
|
|
639
|
+
* Default implementation never skips. Subclasses may override to exclude
|
|
640
|
+
* files by name (e.g., ephemeral compaction summary files).
|
|
641
|
+
* @param _filePath - Absolute path to the candidate file
|
|
642
|
+
* @returns `true` to skip the file entirely, `false` to process normally
|
|
643
|
+
*/
|
|
644
|
+
protected shouldSkipFile(_filePath: string): boolean;
|
|
645
|
+
/**
|
|
646
|
+
* Parse a log file from the given byte offset.
|
|
647
|
+
* @param filePath - Path to the log file
|
|
648
|
+
* @param startOffset - Byte offset to start reading from
|
|
649
|
+
* @param maxRecords - Optional maximum number of records to return (for shallow discovery)
|
|
650
|
+
*/
|
|
651
|
+
protected abstract parseFile(filePath: string, startOffset: number, maxRecords?: number): Promise<ParseFileResult<TRecord>>;
|
|
652
|
+
/**
|
|
653
|
+
* Validate and filter parsed records. Default: returns records as-is.
|
|
654
|
+
* @param records - Raw parsed records
|
|
655
|
+
* @returns Validated/filtered records
|
|
656
|
+
*/
|
|
657
|
+
protected validateRecords(records: TRecord[]): TRecord[];
|
|
658
|
+
/**
|
|
659
|
+
* Returns the maximum number of records to parse per file.
|
|
660
|
+
* Override in subclasses to limit parsing (e.g., discovery mode).
|
|
661
|
+
* @returns Maximum record count, or `undefined` for no limit.
|
|
662
|
+
*/
|
|
663
|
+
protected getMaxRecords(): number | undefined;
|
|
664
|
+
/**
|
|
665
|
+
* Builds the serialized session context for cursor persistence.
|
|
666
|
+
* @param context - The import session context to serialize.
|
|
667
|
+
* @returns Serialized cursor session context.
|
|
668
|
+
*/
|
|
669
|
+
protected buildCursorSessionContext(context: LogImportSessionContext<TState>): NonNullable<ImportCursorPosition['sessionContext']>;
|
|
670
|
+
/**
|
|
671
|
+
* Check if this orchestrator uses JSON format (mtime-based cursor).
|
|
672
|
+
* @returns True if JSON format, false for JSONL
|
|
673
|
+
*/
|
|
674
|
+
protected usesJsonFormat(): boolean;
|
|
675
|
+
isEnabled(): boolean;
|
|
676
|
+
isRunning(): boolean;
|
|
677
|
+
start(): Promise<void>;
|
|
678
|
+
stop(): Promise<void>;
|
|
679
|
+
dispose(): Promise<void>;
|
|
680
|
+
/** @returns Function that checks if a session is Makaio-managed. */
|
|
681
|
+
static createDefaultCheckMakaioManaged(): (sessionId: string) => Promise<boolean>;
|
|
682
|
+
protected updateCursor(filePath: string, bytesRead: number, mtime: Date, sessionContext?: ImportCursorPosition['sessionContext']): Promise<void>;
|
|
683
|
+
/**
|
|
684
|
+
* Handle a file-change event: resolve cursor state and route to first-read or
|
|
685
|
+
* incremental-read as appropriate.
|
|
686
|
+
*
|
|
687
|
+
* Subclasses (e.g., {@link DiscoveryOrchestrator}) may override this method to
|
|
688
|
+
* substitute an entirely different dispatch strategy.
|
|
689
|
+
* @param event - File change event from the watcher
|
|
690
|
+
*/
|
|
691
|
+
protected handleFileChange(event: LogFileChangeEvent): Promise<void>;
|
|
692
|
+
/**
|
|
693
|
+
* Track a watcher-triggered file import so shutdown can wait for any cursor
|
|
694
|
+
* work that the handler enqueues before draining the shared FIFO queue.
|
|
695
|
+
* @param event - File change event to process
|
|
696
|
+
*/
|
|
697
|
+
protected trackFileChange(event: LogFileChangeEvent): void;
|
|
698
|
+
/**
|
|
699
|
+
* Handle the first read of a log file.
|
|
700
|
+
*
|
|
701
|
+
* Extracts session context, emits session lifecycle events, processes records,
|
|
702
|
+
* and saves the cursor. Subclasses may override to change behavior (e.g.,
|
|
703
|
+
* {@link DiscoveryOrchestrator} skips message processing).
|
|
704
|
+
* @param filePath - Path to the log file
|
|
705
|
+
* @param records - Records parsed from the file
|
|
706
|
+
* @param bytesRead - Bytes read during this parse
|
|
707
|
+
* @param mtime - File modification time
|
|
708
|
+
* @param isJsonFormat - Whether the file uses JSON (mtime-based) format
|
|
709
|
+
* @param startOffset - Byte offset this read started from
|
|
710
|
+
* @param emitLifecycleEvents - Whether to emit session and started lifecycle events for this pass
|
|
711
|
+
*/
|
|
712
|
+
protected handleFirstRead(filePath: string, records: TRecord[], bytesRead: number, mtime: Date, isJsonFormat: boolean, startOffset: number, emitLifecycleEvents?: boolean): Promise<void>;
|
|
713
|
+
/**
|
|
714
|
+
* Record that a session has been imported, updating import statistics.
|
|
715
|
+
*
|
|
716
|
+
* Protected to allow subclasses to update stats when processing additional
|
|
717
|
+
* sessions (e.g., compress child sessions from compacted files).
|
|
718
|
+
* @param adapterSessionId - The session ID that was imported
|
|
719
|
+
*/
|
|
720
|
+
protected trackImportedSession(adapterSessionId: string): void;
|
|
721
|
+
/**
|
|
722
|
+
* Handle an incremental read of a log file.
|
|
723
|
+
*
|
|
724
|
+
* Processes new records since the last cursor position. Subclasses may override
|
|
725
|
+
* to skip incremental processing (e.g., {@link DiscoveryOrchestrator}).
|
|
726
|
+
* @param filePath - Path to the log file
|
|
727
|
+
* @param records - New records since last read
|
|
728
|
+
* @param cursorContext - Existing cursor session context
|
|
729
|
+
* @param bytesRead - Bytes read during this parse
|
|
730
|
+
* @param mtime - File modification time
|
|
731
|
+
* @param isJsonFormat - Whether the file uses JSON (mtime-based) format
|
|
732
|
+
* @param startOffset - Byte offset this read started from
|
|
733
|
+
*/
|
|
734
|
+
protected handleIncrementalRead(filePath: string, records: TRecord[], cursorContext: NonNullable<ImportCursorPosition['sessionContext']>, bytesRead: number, mtime: Date, isJsonFormat: boolean, startOffset: number): Promise<void>;
|
|
735
|
+
protected maybeUpdateCursor(filePath: string, bytesRead: number, startOffset: number, mtime: Date, isJsonFormat: boolean, sessionContext?: ImportCursorPosition['sessionContext']): Promise<void>;
|
|
736
|
+
/**
|
|
737
|
+
* Determine whether an adapter session should be skipped from import.
|
|
738
|
+
*
|
|
739
|
+
* Delegates to the managed-session cache so concurrent checks for the same
|
|
740
|
+
* `adapterSessionId` share one storage lookup and tracked skips update stats.
|
|
741
|
+
* @param adapterSessionId - External adapter session ID being evaluated
|
|
742
|
+
* @returns Promise resolving to true when the session is Makaio-managed and should be skipped
|
|
743
|
+
*/
|
|
744
|
+
protected isSessionSkipped(adapterSessionId: string): Promise<boolean>;
|
|
745
|
+
/**
|
|
746
|
+
* Queue a normalized event and return its delivery promise.
|
|
747
|
+
* @param event - Normalized event to emit
|
|
748
|
+
* @returns Promise that resolves after delivery or rejects on emit failure
|
|
749
|
+
*/
|
|
750
|
+
protected queueEvent(event: NormalizedEvent): Promise<void>;
|
|
751
|
+
/**
|
|
752
|
+
* Enqueue a cursor write as a PQueue task so it executes after all previously
|
|
753
|
+
* queued events for the same batch have been emitted.
|
|
754
|
+
*
|
|
755
|
+
* PQueue runs tasks with concurrency=1 in FIFO order, so placing the cursor
|
|
756
|
+
* write at the back of the queue after all `queueEvent` calls guarantees that
|
|
757
|
+
* the cursor advances only once every preceding event in the batch has been
|
|
758
|
+
* delivered. This prevents the race where a process exit after `queueEvent`
|
|
759
|
+
* but before queue drain would leave events lost yet the cursor advanced.
|
|
760
|
+
* @param filePath - Path to the log file
|
|
761
|
+
* @param bytesRead - Total bytes read at the new cursor position
|
|
762
|
+
* @param startOffset - Byte offset this read started from
|
|
763
|
+
* @param mtime - File modification time
|
|
764
|
+
* @param isJsonFormat - Whether the file uses JSON (mtime-based) format
|
|
765
|
+
* @param sessionContext - Serialized session context for the cursor
|
|
766
|
+
* @param precedingEventPromises - Emission promises queued before this cursor write
|
|
767
|
+
* @returns Promise that resolves when the cursor write has completed
|
|
768
|
+
*/
|
|
769
|
+
protected queueCursorUpdate(filePath: string, bytesRead: number, startOffset: number, mtime: Date, isJsonFormat: boolean, sessionContext?: ImportCursorPosition['sessionContext'], precedingEventPromises?: Promise<void>[]): Promise<void>;
|
|
770
|
+
}
|
|
771
|
+
//#endregion
|
|
772
|
+
export { LogImporterConfig as _, CompactionMetadata as a, StorageMessagePayload as b, ExternalToolIdentifiers as c, ImportMetadata as d, ImportSegment as f, LogImporter as g, LogImportTestConfig as h, LogFileChangeEvent as i, ExternalToolMeta as l, LogImportSessionContext as m, LogOrchestratorConfig as n, DiscoveryMetadata as o, ImportSegmentLineage as p, ParseFileResult as r, ExternalToolIdentifier as s, BaseLogOrchestrator as t, ImportCursorPosition as u, NormalizedEvent as v, toImportSegment as x, ProcessLogFileResult as y };
|