@makaio/framework 1.0.0-dev-1785407933303 → 1.0.0-dev-1786014320559
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 +4 -3
- package/dist/{account-identity-DFx8pwKL.mjs → account-identity-DGpXd8h_.mjs} +1 -1
- package/dist/adapter-BkdJaOOG.mjs +1 -0
- package/dist/adapter-subsystem/index.d.mts +138 -6
- package/dist/adapter-subsystem/index.mjs +1 -1
- package/dist/adapters/acp-client/index.d.mts +105 -7
- package/dist/adapters/acp-client/index.mjs +2 -2
- package/dist/adapters/claude/index.d.mts +24 -24
- package/dist/adapters/config/index.d.mts +1 -1
- package/dist/adapters/config/index.mjs +1 -1
- package/dist/adapters/index.d.mts +379 -812
- package/dist/adapters/index.mjs +6 -6
- package/dist/adapters/node.d.mts +1 -1
- package/dist/adapters/node.mjs +1 -1
- package/dist/adapters/stream-session/index.d.mts +28 -7
- package/dist/adapters/stream-session/index.mjs +1 -1
- package/dist/agent-namespace-D51PODFf.mjs +1 -0
- package/dist/{ajv-DD3SIL2i.mjs → ajv-L5fKxaia.mjs} +2 -2
- package/dist/artifact-k3veR4Yx.mjs +1 -0
- package/dist/attach-error-BSlc7JfL.mjs +1 -0
- package/dist/{auth-DGEdiHF6.mjs → auth-A1K_7q-8.mjs} +1 -1
- package/dist/authority-state-bootstrap-YwtEImIB.mjs +1 -0
- package/dist/automation-trigger-CuSdQwir.mjs +1 -0
- package/dist/await-trigger-ph1S0zVI.mjs +1 -0
- package/dist/bus/index.d.mts +17 -3
- package/dist/bus/index.mjs +1 -1
- package/dist/bus-BIj0_aG6.mjs +1 -0
- package/dist/bus-CqgrphNE.mjs +2 -0
- package/dist/{canonical-model-BAytQ4NV.mjs → canonical-model-DJASlL4m.mjs} +1 -1
- package/dist/{capabilities-BQEp34ir.mjs → capabilities-Bqckjh7G.mjs} +1 -1
- package/dist/{client-DbS847wW.mjs → client-BL5__WT0.mjs} +1 -1
- package/dist/clients/index.d.mts +7 -7
- package/dist/clients/index.mjs +1 -1
- package/dist/clients/managed-install.d.mts +1 -1
- package/dist/clients/managed-install.mjs +1 -1
- package/dist/{compression-74fFeBha.mjs → compression-BbttSqm8.mjs} +1 -1
- package/dist/{config-namespace-TVX-hG4I.mjs → config-namespace-CyzeLWSg.mjs} +1 -1
- package/dist/{context-resolution-DNRkyQto.d.mts → context-resolution-CW0ya4QO.d.mts} +14 -14
- package/dist/contracts/adapter/index.d.mts +3 -3
- package/dist/contracts/adapter/index.mjs +1 -1
- package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
- package/dist/contracts/artifact/index.d.mts +3 -3
- package/dist/contracts/artifact/index.mjs +1 -1
- package/dist/contracts/auth/index.d.mts +2 -2
- package/dist/contracts/auth/index.mjs +1 -1
- package/dist/contracts/automation-trigger/index.d.mts +4 -0
- package/dist/contracts/automation-trigger/index.mjs +1 -0
- package/dist/contracts/canonical-model/index.d.mts +1 -1
- package/dist/contracts/canonical-model/index.mjs +1 -1
- package/dist/contracts/capabilities/index.d.mts +1 -1
- package/dist/contracts/capabilities/index.mjs +1 -1
- package/dist/contracts/client/index.d.mts +2 -2
- package/dist/contracts/client/index.mjs +1 -1
- package/dist/contracts/common/index.d.mts +1 -1
- package/dist/contracts/config/index.d.mts +1 -1
- package/dist/contracts/config/index.mjs +1 -1
- package/dist/contracts/extension/index.d.mts +6 -5
- package/dist/contracts/extension/index.mjs +1 -1
- package/dist/contracts/facet/index.d.mts +1 -1
- package/dist/contracts/facet/index.mjs +1 -1
- package/dist/contracts/harness/index.d.mts +1 -1
- package/dist/contracts/harness/index.mjs +1 -1
- package/dist/contracts/host/index.d.mts +1 -1
- package/dist/contracts/host/index.mjs +1 -1
- package/dist/contracts/index.d.mts +161 -100
- package/dist/contracts/index.mjs +1 -1
- package/dist/contracts/materialization/index.d.mts +3 -3
- package/dist/contracts/materialization/index.mjs +1 -1
- package/dist/contracts/model-registry/index.d.mts +1 -1
- package/dist/contracts/model-registry/index.mjs +1 -1
- package/dist/contracts/native-session-supervisor/index.d.mts +1 -1
- package/dist/contracts/native-session-supervisor/index.mjs +1 -1
- package/dist/contracts/platform/index.d.mts +1 -1
- package/dist/contracts/platform/index.mjs +1 -1
- package/dist/contracts/provider/index.d.mts +2 -2
- package/dist/contracts/provider/index.mjs +1 -1
- package/dist/contracts/reaction/index.d.mts +2 -0
- package/dist/contracts/reaction/index.mjs +1 -0
- package/dist/contracts/session/index.d.mts +3 -3
- package/dist/contracts/session/index.mjs +1 -1
- package/dist/contracts/shared/index.d.mts +3 -3
- package/dist/contracts/shared/index.mjs +1 -1
- package/dist/contracts/skill/index.d.mts +1 -1
- package/dist/contracts/skill/index.mjs +1 -1
- package/dist/contracts/telemetry/index.d.mts +1 -1
- package/dist/contracts/telemetry/index.mjs +1 -1
- package/dist/contracts/timeout/index.d.mts +1 -1
- package/dist/contracts/timeout/index.mjs +1 -1
- package/dist/contracts/toast/index.mjs +1 -1
- package/dist/contracts/variant/index.d.mts +1 -1
- package/dist/contracts/variant/index.mjs +1 -1
- package/dist/contracts/worker-node/index.d.mts +1 -1
- package/dist/contracts/worker-node/index.mjs +1 -1
- package/dist/contracts/workflow/index.d.mts +3 -3
- package/dist/contracts/workflow/index.mjs +1 -1
- package/dist/contribution-BH-wKsWI.d.mts +35 -0
- package/dist/core/index.d.mts +60 -1
- package/dist/core/index.mjs +1 -1
- package/dist/definition-BYgHlmMw.d.mts +375 -0
- package/dist/{definition-CJfiv8xm.mjs → definition-CDg-Jq1T.mjs} +1 -1
- package/dist/{detached-extension-handle-Ddfquy5_.mjs → detached-extension-handle-DKd17UB6.mjs} +1 -1
- package/dist/drizzle/0031_adapter_session_currency.sql +66 -0
- package/dist/drizzle/0032_native_session_ownership.sql +77 -0
- package/dist/drizzle/0033_m_msf3hu2s.sql +1 -0
- package/dist/drizzle/meta/_journal.json +21 -0
- package/dist/{execution-attempt-repository-DWXKY41_.d.mts → execution-attempt-repository-DFyAnchJ.d.mts} +1 -1
- package/dist/{execution-target-Cf645pDj.mjs → execution-target-ByNwZh5-.mjs} +1 -1
- package/dist/extension-DMdmj9gi.mjs +1 -0
- package/dist/extension-DUmibvMk.mjs +1 -0
- package/dist/extension-context-CqfddWXs.d.mts +295 -0
- package/dist/{extension-discovery-CQRdbVQ6.d.mts → extension-discovery-Fhps4icD.d.mts} +2 -0
- package/dist/{extension-namespace-Yu41YepM.mjs → extension-namespace-B554RmCp.mjs} +1 -1
- package/dist/extension-package-provenance-Dh_-Z-tE.mjs +1 -0
- package/dist/{filesystem-service-DlP2HfDg.mjs → filesystem-service-FAtd9gWH.mjs} +1 -1
- package/dist/framework-packages-D_2hBZ-p.mjs +1 -0
- package/dist/git/index.mjs +1 -1
- package/dist/{globby-1yCVCk8s.mjs → globby-BBLuT_vy.mjs} +1 -1
- package/dist/handlers-2yd00VEq.mjs +57 -0
- package/dist/{harness-DpwsFsE7.mjs → harness-KxbWGL4I.mjs} +1 -1
- package/dist/{hook-responses-Dh1PWXqJ.d.mts → hook-responses-CQZIv3L3.d.mts} +2 -293
- package/dist/{index-HsTxm-R3.d.mts → index-3eUIRy7T.d.mts} +250 -20
- package/dist/{index-brqfk9JQ.d.mts → index-B4xdTT3c.d.mts} +6 -6
- package/dist/{index-CmFbzuiW.d.mts → index-B5op6AsV.d.mts} +72 -62
- package/dist/{index-CMgLxw14.d.mts → index-B6GOuxVy2.d.mts} +18 -18
- package/dist/index-BFhJe-Sb.d.mts +302 -0
- package/dist/{index-fmR2JNgJ.d.mts → index-BQprJNA_.d.mts} +4 -4
- package/dist/{index-EjsSBQXy2.d.mts → index-BSQ30wYP.d.mts} +1 -1
- package/dist/{index-Hk9mpC3o.d.mts → index-BSbGB23v.d.mts} +8 -8
- package/dist/{index-BbF2gRwd.d.mts → index-BiAYXjgM.d.mts} +41 -41
- package/dist/{index-sFsAqeK1.d.mts → index-ByZi9bml.d.mts} +7616 -4158
- package/dist/{index-CMJZ2Z8m.d.mts → index-C7HcDpHE.d.mts} +4 -0
- package/dist/{index-BskPjMet.d.mts → index-CB4aIUoF.d.mts} +16 -16
- package/dist/{index-B-xrJCwa.d.mts → index-CDusRXio.d.mts} +136 -137
- package/dist/{index-CUvNKYkV.d.mts → index-CSN_0sCo.d.mts} +19 -2
- package/dist/{index-BAXkicoQ.d.mts → index-C__EQfKa.d.mts} +1 -1
- package/dist/{index-BfLulUMy2.d.mts → index-CqQYgsbB.d.mts} +1659 -217
- package/dist/{index-DF9ffhVe.d.mts → index-CwDiyJkJ.d.mts} +327 -756
- package/dist/{index-GHASUiem.d.mts → index-DBadVauL.d.mts} +1 -1
- package/dist/{index-gUhidukN.d.mts → index-DI7-tIL3.d.mts} +299 -2
- package/dist/index-DP3o_13U.d.mts +165 -0
- package/dist/{index-DSBT83c0.d.mts → index-DcYAAJ0V.d.mts} +24 -3
- package/dist/{index-DqkjRTr7.d.mts → index-Dch_AxUg.d.mts} +77 -39
- package/dist/{index-XZyMxxnU.d.mts → index-DcqSUsX6.d.mts} +39 -83
- package/dist/{index-B0Kf_OWi.d.mts → index-DgOfgjx3.d.mts} +1 -1
- package/dist/{index-Ds5_rDEJ.d.mts → index-DwLRZscE.d.mts} +1 -12
- package/dist/{index-DkiTJM5p.d.mts → index-DxYDRoDE2.d.mts} +17 -3
- package/dist/{index-CRvpVIqA.d.mts → index-OsbtyMgx2.d.mts} +10 -1
- package/dist/{index-BaZeoZoS.d.mts → index-bIe_57cL.d.mts} +1 -1
- package/dist/{json-value-Brslhqbm.d.mts → json-value-C1RGgS0a.d.mts} +16 -1
- package/dist/{json-value-DmU8ibo_.mjs → json-value-D57aJhVn.mjs} +1 -1
- package/dist/kernel/cli/index.d.mts +2 -2
- package/dist/kernel/cli/index.mjs +1 -1
- package/dist/kernel/cli/register.d.mts +1 -1
- package/dist/kernel/cli/register.mjs +1 -1
- package/dist/kernel/cli/schemas.mjs +1 -1
- package/dist/kernel/extension/index.d.mts +1 -1
- package/dist/kernel/extension/index.mjs +1 -1
- package/dist/kernel/index.d.mts +9 -9
- package/dist/kernel/index.mjs +1 -1
- package/dist/kernel/namespace/index.d.mts +2 -2
- package/dist/kernel/namespace/index.mjs +1 -1
- package/dist/kernel/observability/index.d.mts +1 -1
- package/dist/kernel/observability/index.mjs +1 -1
- package/dist/kernel/providers/index.d.mts +1 -1
- package/dist/kernel/providers/index.mjs +1 -1
- package/dist/kernel/window/index.d.mts +1 -1
- package/dist/kernel/window/index.mjs +1 -1
- package/dist/{lib-C7-s68uf.mjs → lib-B_rJ6r0T.mjs} +1 -1
- package/dist/{lib-DErgth_E.mjs → lib-CnOAtohU.mjs} +1 -1
- package/dist/load-extensions-CW9uzNR5.mjs +1 -0
- package/dist/{load-extensions-BxsDB87B.d.mts → load-extensions-DUpaMQ7G.d.mts} +17 -13
- package/dist/{materialization-Jd198K3y.mjs → materialization-CcpCDhXh.mjs} +1 -1
- package/dist/mcp-http-server/index.mjs +1 -1
- package/dist/model-ZH3L1dPW.mjs +1 -0
- package/dist/{namespace-BqxtpNAn.mjs → namespace-B7bntOB8.mjs} +1 -1
- package/dist/{namespace-CWUDFGOy.mjs → namespace-BFqkUTJp.mjs} +1 -1
- package/dist/{namespace-D-WH2uYV2.d.mts → namespace-CAy4P5mW.d.mts} +8 -8
- package/dist/{namespace-B8uKAzWJ.mjs → namespace-CFjdyNXG.mjs} +1 -1
- package/dist/{namespace-DV-Hr9sZ.d.mts → namespace-ChnRTUG4.d.mts} +11 -1
- package/dist/namespace-CxrOLeeP.mjs +1 -0
- package/dist/{namespace-g_mbIZq_.d.mts → namespace-DSlfFhB1.d.mts} +410 -26
- package/dist/{namespace-Dkod-w11.d.mts → namespace-DwZwGXgF.d.mts} +4 -0
- package/dist/{namespace-BXvD9t0I.d.mts → namespace-Rge9mMI-.d.mts} +27 -19
- package/dist/{native-session-supervisor-DRx0MX-d.mjs → native-session-supervisor-fZYPUk0-.mjs} +1 -1
- package/dist/node/bus-server/index.d.mts +1 -1
- package/dist/node/bus-server/index.mjs +1 -1
- package/dist/node/bus-server/server-lifecycle.d.mts +1 -1
- package/dist/node/bus-server/server-lifecycle.mjs +1 -1
- package/dist/{orchestrator-shared-BHCv-l2O.d.mts → orchestrator-shared-B-KRW1Z0.d.mts} +1 -0
- package/dist/orchestrator-shared-CTCZc6Vl.mjs +1 -0
- package/dist/ownership-memory-handler-Bblp93YC.mjs +1 -0
- package/dist/{package-DWMxGfzK.d.mts → package-Bf3hyuzs.d.mts} +234 -84
- package/dist/package-CBdvjyyZ.mjs +1 -0
- package/dist/package-CddkNbZI.mjs +1 -0
- package/dist/package-ypz4rKvn.mjs +7 -0
- package/dist/package.json +1 -1
- package/dist/{profile-BTAI31Nt.mjs → profile-BtznZlq3.mjs} +1 -1
- package/dist/{provider-context-Dq53Cgzz.mjs → provider-context-BrLZYnDW.mjs} +1 -1
- package/dist/{provider-context-PZIQWcqQ.mjs → provider-context-Dh-VOOYF.mjs} +1 -1
- package/dist/reaction-BS0k4eNN.mjs +1 -0
- package/dist/{registry-wfF2uTty.mjs → registry-BO_bOoky.mjs} +2 -2
- package/dist/{resolved-DZgqql2Z.mjs → resolved-DMByz1_2.mjs} +1 -1
- package/dist/rules/index.d.mts +1 -1
- package/dist/rules/index.mjs +1 -1
- package/dist/rules/schemas.d.mts +1 -1
- package/dist/runtime-bun/index.mjs +1 -1
- package/dist/runtime-node/extension-discovery.d.mts +1 -1
- package/dist/runtime-node/extension-validation.d.mts +1 -1
- package/dist/runtime-node/extension-validation.mjs +1 -1
- package/dist/runtime-node/index.d.mts +4 -4
- package/dist/runtime-node/index.mjs +24 -24
- package/dist/runtime-node/makaio-config.d.mts +1 -1
- package/dist/runtime-node/makaio-config.mjs +1 -1
- package/dist/runtime-node/workflow-worker/index.d.mts +1 -1
- package/dist/runtime-node/workflow-worker/index.mjs +1 -1
- package/dist/runtime-node/workflow-worker/worker-entry.mjs +1 -1
- package/dist/{schema-Dd-e89MO.mjs → schema-DBG7Jq5_.mjs} +1 -1
- package/dist/{schema-DKUb4rkr.d.mts → schema-DKTzriEY.d.mts} +519 -9
- package/dist/{schemas-B5eUUi6u.d.mts → schemas-9qeeHGBf.d.mts} +8 -8
- package/dist/{schemas-CRB2O5zo.mjs → schemas-BqD8LlQw.mjs} +1 -1
- package/dist/{schemas-DaHQzpgm.mjs → schemas-CsjN7cmM.mjs} +1 -1
- package/dist/schemas-DSkBOdx_.mjs +1 -0
- package/dist/schemas-DplrlAyR.mjs +1 -0
- package/dist/{schemas-DuIlOWR3.d.mts → schemas-VbB1FTxx.d.mts} +4 -0
- package/dist/scoped-bus-ClwTWqX8.mjs +1 -0
- package/dist/{selection-BNwTKEVT.mjs → selection-7Ku8DBnh.mjs} +1 -1
- package/dist/services/adapter-runtime/index.d.mts +3 -3
- package/dist/services/adapter-runtime/index.mjs +1 -1
- package/dist/services/adapter-runtime/namespace.d.mts +1 -1
- package/dist/services/adapter-runtime/schemas.d.mts +1 -1
- package/dist/services/adapter-subsystem/index.d.mts +4 -4
- package/dist/services/adapter-subsystem/index.mjs +1 -1
- package/dist/services/adapter-subsystem/namespace.d.mts +2 -2
- package/dist/services/adapter-subsystem/namespace.mjs +1 -1
- package/dist/services/agent-runtime/index.d.mts +2 -2
- package/dist/services/agent-runtime/namespace.d.mts +1 -1
- package/dist/services/agent-runtime/schemas.d.mts +1 -1
- package/dist/services/automation-trigger/index.d.mts +943 -0
- package/dist/services/automation-trigger/index.mjs +1 -0
- package/dist/services/capability/index.d.mts +1 -1
- package/dist/services/capability/index.mjs +1 -1
- package/dist/services/codebase/index.d.mts +2 -2
- package/dist/services/codebase/namespace.d.mts +1 -1
- package/dist/services/codebase/schemas.d.mts +1 -1
- package/dist/services/compression/index.d.mts +2 -2
- package/dist/services/compression/namespace.d.mts +1 -1
- package/dist/services/compression/schemas.d.mts +1 -1
- package/dist/services/context-rules/index.d.mts +4 -4
- package/dist/services/context-rules/index.mjs +1 -1
- package/dist/services/execution-target/index.d.mts +3 -3
- package/dist/services/execution-target/index.mjs +1 -1
- package/dist/services/execution-target/namespace.d.mts +1 -1
- package/dist/services/execution-target/namespace.mjs +1 -1
- package/dist/services/execution-target/schemas.d.mts +1 -1
- package/dist/services/execution-target/schemas.mjs +1 -1
- package/dist/services/filesystem/index.d.mts +1 -1
- package/dist/services/filesystem/index.mjs +1 -1
- package/dist/services/filesystem/namespace.d.mts +6 -6
- package/dist/services/filesystem/schemas.d.mts +3 -3
- package/dist/services/git/namespace.d.mts +2 -2
- package/dist/services/git/namespace.mjs +1 -1
- package/dist/services/git/schemas.d.mts +1 -1
- package/dist/services/git/schemas.mjs +1 -1
- package/dist/services/harness/index.d.mts +3 -3
- package/dist/services/harness/index.mjs +1 -1
- package/dist/services/index.d.mts +449 -83
- package/dist/services/index.mjs +1 -1
- package/dist/services/log-import/browser.d.mts +2 -2
- package/dist/services/log-import/index.d.mts +3 -3
- package/dist/services/log-import/log-import.d.mts +1 -1
- package/dist/services/log-import/log-import.mjs +1 -1
- package/dist/services/log-import/namespace.mjs +1 -1
- package/dist/services/log-import/schemas.mjs +1 -1
- package/dist/services/materialization/index.d.mts +1 -1
- package/dist/services/materialization/index.mjs +1 -1
- package/dist/services/model-registry/index.d.mts +1 -1
- package/dist/services/model-registry/index.mjs +1 -1
- package/dist/services/preferences/index.d.mts +2 -2
- package/dist/services/preferences/schemas.d.mts +1 -1
- package/dist/services/preferences/storage-namespace.d.mts +2 -2
- package/dist/services/provider-context/index.d.mts +1 -1
- package/dist/services/provider-context/index.mjs +1 -1
- package/dist/services/provider-runtime/index.mjs +1 -1
- package/dist/services/session/handlers/index.d.mts +2 -2
- package/dist/services/session/handlers/index.mjs +1 -1
- package/dist/services/session/index.d.mts +10 -10
- package/dist/services/session/index.mjs +1 -1
- package/dist/services/session/messages/namespace.d.mts +1 -1
- package/dist/services/session/messages/namespace.mjs +1 -1
- package/dist/services/session/orchestrator-testing/index.d.mts +1 -1
- package/dist/services/session/orchestrator-testing/index.mjs +1 -1
- package/dist/services/session/session-events/namespace.d.mts +1 -1
- package/dist/services/session/session-events/namespace.mjs +1 -1
- package/dist/services/session/storage/namespace.d.mts +1 -1
- package/dist/services/session/storage/schema.d.mts +2 -2
- package/dist/services/session/storage/schema.mjs +1 -1
- package/dist/services/session/testing/index.d.mts +12 -4
- package/dist/services/session/testing/index.mjs +36 -4
- package/dist/services/session/testing/orchestrator-shared.d.mts +1 -1
- package/dist/services/session/testing/orchestrator-shared.mjs +1 -1
- package/dist/services/session/turns/namespace.d.mts +1 -1
- package/dist/services/session/turns/namespace.mjs +1 -1
- package/dist/services/session-editor/index.d.mts +1 -1
- package/dist/services/session-editor/index.mjs +1 -1
- package/dist/services/settings/index.d.mts +3 -3
- package/dist/services/settings/index.mjs +1 -1
- package/dist/services/settings/namespace.d.mts +8 -8
- package/dist/services/settings/namespace.mjs +1 -1
- package/dist/services/settings/storage/clients-namespace.d.mts +1 -1
- package/dist/services/settings/storage/clients-namespace.mjs +1 -1
- package/dist/services/settings/storage/index.d.mts +3 -3
- package/dist/services/settings/storage/index.mjs +1 -1
- package/dist/services/settings/storage/providers-namespace.d.mts +1 -1
- package/dist/services/settings/storage/providers-namespace.mjs +1 -1
- package/dist/services/subagent/index.d.mts +1 -1
- package/dist/services/subagent/index.mjs +1 -1
- package/dist/services/subagent-template/index.d.mts +2 -2
- package/dist/services/subagent-template/namespace.d.mts +1 -1
- package/dist/services/subagent-template/schemas.d.mts +1 -1
- package/dist/services/tool-approval/index.d.mts +1 -1
- package/dist/services/tool-approval/index.mjs +1 -1
- package/dist/services/tools/index.d.mts +1 -1
- package/dist/services/tools/index.mjs +1 -1
- package/dist/services/tray-menu/index.d.mts +3 -3
- package/dist/services/tray-menu/index.mjs +1 -1
- package/dist/services/tray-menu/namespace.d.mts +1 -1
- package/dist/services/tray-menu/schemas.d.mts +1 -1
- package/dist/services/turn/index.d.mts +1 -1
- package/dist/services/turn/namespace.d.mts +1 -1
- package/dist/services/workflow-transitions/index.d.mts +1 -1
- package/dist/services/workflow-transitions/index.mjs +1 -1
- package/dist/session-BMy2kRpX.mjs +90 -0
- package/dist/session-Cipx34j6.mjs +1 -0
- package/dist/{session-lineage-B_JW5LpF.d.mts → session-lineage-B_PVa1XN.d.mts} +1 -1
- package/dist/shared-BFVuCDPx.mjs +1 -0
- package/dist/{skill-BR6rkfLe.mjs → skill-C1D51nhh.mjs} +1 -1
- package/dist/{src-DD0v-nIj.mjs → src-xbmzokNe.mjs} +1 -1
- package/dist/storage/drizzle/client.d.mts +1 -1
- package/dist/storage/drizzle/client.mjs +1 -1
- package/dist/storage/drizzle/index.d.mts +42 -2
- package/dist/storage/drizzle/index.mjs +1 -1
- package/dist/storage/handlers/drizzle/index.d.mts +1 -1
- package/dist/storage/handlers/drizzle/index.mjs +1 -1
- package/dist/storage/handlers/index.d.mts +1 -1
- package/dist/storage/handlers/index.mjs +1 -1
- package/dist/tool-approval-service-BVgN9Q1r.mjs +1 -0
- package/dist/{tools-PdG9fO1M.mjs → tools-DxwHox1a.mjs} +1 -1
- package/dist/{transition-DwqL8W9V.d.mts → transition-BF1nevaC.d.mts} +7 -34
- package/dist/{types-DMLDHFR9.d.mts → types-BNjPhj_a.d.mts} +1 -1
- package/dist/{types-DR60yv6W.d.mts → types-CijlWGwb.d.mts} +1575 -157
- package/dist/types-ClpEaoAm.d.mts +2917 -0
- package/dist/ui-hooks/index.d.mts +29 -2
- package/dist/ui-hooks/index.mjs +1 -1
- package/dist/ui-kernel/index.d.mts +2 -2
- package/dist/ui-kernel/pages/schemas.d.mts +1 -1
- package/dist/ui-views/index.d.mts +1 -1
- package/dist/utils/index.d.mts +77 -1
- package/dist/utils/index.mjs +2 -2
- package/dist/{version-CoCeMxDT.mjs → version-BfNnVAGr.mjs} +1 -1
- package/dist/{view-builder-qp51cMWh.d.mts → view-builder-Bc9dx6jF.d.mts} +1 -1
- package/dist/{visibility-qhGWmpSJ.mjs → visibility-Dl1o2I01.mjs} +1 -1
- package/dist/{worker-node-Bl9_vqYi.mjs → worker-node-BDOYPEpi.mjs} +1 -1
- package/dist/{worker-node-DZTuT1DS.mjs → worker-node-DJ41Tr-F.mjs} +1 -1
- package/dist/workflow-Hzc5jlnV.mjs +1 -0
- package/dist/workflow-engine/execution-attempt-repository.d.mts +1 -1
- package/dist/workflow-engine/index.d.mts +161 -442
- package/dist/workflow-engine/index.mjs +1 -1
- package/dist/workflow-engine/package.d.mts +1 -1
- package/dist/workflow-engine/package.mjs +1 -1
- package/dist/workflow-engine/provider-operation.d.mts +1 -1
- package/dist/workflow-engine/testing/index.d.mts +2 -2
- package/dist/workflow-engine/testing/index.mjs +1 -1
- package/dist/workflow-engine/testing/sqlite.d.mts +1 -1
- package/dist/workflow-engine/testing/sqlite.mjs +27 -27
- package/dist/workflow-engine/workflow-orchestrator.mjs +1 -1
- package/dist/workflow-engine/workflow-trigger-binding-consumer.d.mts +46 -0
- package/dist/workflow-engine/workflow-trigger-binding-consumer.mjs +1 -0
- package/dist/{workflow-transitions-DSc45ixc.mjs → workflow-transitions-DM0fN_eP.mjs} +1 -1
- package/dist/workflow-worker-DARC7UZl.mjs +1 -0
- package/dist/zod-json-schema-BAGAFfCN.mjs +1 -0
- package/package.json +29 -1
- package/dist/adapter-D5c5LrPN.mjs +0 -1
- package/dist/artifact-DGiXqb11.mjs +0 -1
- package/dist/attach-error-C3tngg6J.mjs +0 -1
- package/dist/authority-state-bootstrap-GPL_tqaT.mjs +0 -1
- package/dist/await-trigger-I3lrepb8.mjs +0 -1
- package/dist/bus-B6SAjgOC.mjs +0 -2
- package/dist/bus-C2l3K74u.mjs +0 -1
- package/dist/extension-DCA4pYrY.mjs +0 -1
- package/dist/extension-hjOPs10e.mjs +0 -1
- package/dist/framework-packages-C3RWfJDk.mjs +0 -1
- package/dist/handlers-CfnLyLfE.mjs +0 -57
- package/dist/load-extensions-D0DfjYLC.mjs +0 -1
- package/dist/model-BGgVmRnN.mjs +0 -1
- package/dist/namespace-DJfUADSV.mjs +0 -1
- package/dist/orchestrator-shared-BxmHCPvx.mjs +0 -1
- package/dist/package-CNUPPcU1.mjs +0 -7
- package/dist/package-Dft_RItb.mjs +0 -1
- package/dist/schemas-Cm09dXL4.mjs +0 -1
- package/dist/scoped-bus-C9BdNwfM.mjs +0 -1
- package/dist/session-BOGCd18q.mjs +0 -1
- package/dist/session-BTFiDoGz.mjs +0 -76
- package/dist/shared-BQ0CHIVy.mjs +0 -1
- package/dist/tool-approval-service-kBA0fRzm.mjs +0 -1
- package/dist/types-CJ_QZ1yW.d.mts +0 -1487
- package/dist/workflow-BfDbgtIQ.mjs +0 -1
- package/dist/workflow-worker-BN9XPxQO.mjs +0 -1
- package/dist/{adapter-auth-runtime-DO-FVTXg.mjs → adapter-auth-runtime-D9Lnl7cc.mjs} +0 -0
- package/dist/{adapter-binding-DQchUtrK.d.mts → adapter-binding-B-FBoCys.d.mts} +0 -0
- package/dist/{attempt-record-codec-CqO1_XnE.mjs → attempt-record-codec-DaFLKR5C.mjs} +0 -0
- package/dist/{base-orchestrator-BilsQNW1.d.mts → base-orchestrator-D9u4NyiM.d.mts} +0 -0
- package/dist/{capability-service-BqiLlRGA.mjs → capability-service-CJHNkjvm.mjs} +0 -0
- package/dist/{client-B--e2qcU.d.mts → client-4ihewPUm.d.mts} +0 -0
- package/dist/{client-binary-version-verifier-taewmKTY.mjs → client-binary-version-verifier-DJajc_Ff.mjs} +0 -0
- package/dist/{client-binary-version-verifier-CgjM_vGF.d.mts → client-binary-version-verifier-jDDZ64Ah.d.mts} +0 -0
- package/dist/{clients-namespace-DfxjG2ZP.d.mts → clients-namespace-DFWuUawf.d.mts} +0 -0
- package/dist/{config-namespace-BCqvufbD.d.mts → config-namespace-D1kyZj0B.d.mts} +0 -0
- package/dist/{create-static-mount-bbQhTt6W.mjs → create-static-mount-9tnGpIeK.mjs} +0 -0
- package/dist/{cross-spawn-B57KZuns.mjs → cross-spawn-BIgueAqr.mjs} +0 -0
- package/dist/{cursor-storage-DIFK_9hg.mjs → cursor-storage-ROWfiTh1.mjs} +0 -0
- package/dist/{definition-gnKgXU91.d.mts → definition-DB-kKc0d.d.mts} +0 -0
- package/dist/{definitions-xrrY0wgz.mjs → definitions-CF6YmEhL.mjs} +0 -0
- package/dist/{descriptor-to-package-DvF08krT.mjs → descriptor-to-package-BecVCopf.mjs} +0 -0
- package/dist/{drizzle-z_0SiGY8.mjs → drizzle-CPv3vdTE.mjs} +0 -0
- package/dist/{esm-CltRnX8_.mjs → esm-CBFWM8u_.mjs} +0 -0
- package/dist/{event-CmVjR6Ib.mjs → event-DR8U9Efx.mjs} +0 -0
- package/dist/{facet-BCI00njh.mjs → facet-DVsW12iF.mjs} +0 -0
- package/dist/{filesystem-service-CQ9yVkSz.d.mts → filesystem-service-Cm2RHKBa.d.mts} +0 -0
- package/dist/{handler-Cbv9FqDO.mjs → handler-Bqlk-6BY.mjs} +0 -0
- package/dist/{host-Caq6ZfSJ.mjs → host-k5yoyKHg.mjs} +0 -0
- package/dist/{identity-D6guMtmi.mjs → identity-DC3Pk0ps.mjs} +0 -0
- package/dist/{index-dtsLKOID.d.mts → index-42UdYStR.d.mts} +0 -0
- package/dist/{index-DR40QWlw.d.mts → index-BJAB-BW_.d.mts} +0 -0
- package/dist/{index-Dm1nUxCF.d.mts → index-BJMezANn.d.mts} +0 -0
- package/dist/{index-Cv-o5Krs.d.mts → index-BRCrFirq.d.mts} +0 -0
- package/dist/{index-BVRQEpAg.d.mts → index-BRzHs7Bx.d.mts} +6 -6
- /package/dist/{index-vA--0lOM.d.mts → index-BVcQcphK.d.mts} +0 -0
- /package/dist/{index-ye0oklfU.d.mts → index-BcvqDfcN.d.mts} +0 -0
- /package/dist/{index-CGZQVTid.d.mts → index-BeENojSx2.d.mts} +0 -0
- /package/dist/{index-DjgLchuQ.d.mts → index-Beo_Ik8-.d.mts} +0 -0
- /package/dist/{index-sS6KUlrx.d.mts → index-BgGe9WZz.d.mts} +0 -0
- /package/dist/{index-CWHfOz6d.d.mts → index-CK3f0bAL.d.mts} +0 -0
- /package/dist/{index-DZunhZec.d.mts → index-CQuRTeRa.d.mts} +0 -0
- /package/dist/{index-jTaAHsul.d.mts → index-CRmE88hi.d.mts} +0 -0
- /package/dist/{index-CjdRdsd0.d.mts → index-CvW9_SzR.d.mts} +0 -0
- /package/dist/{index-ByKi34v5.d.mts → index-CxSSdIZz.d.mts} +0 -0
- /package/dist/{index-vcSj12YQ.d.mts → index-E4SET1AA.d.mts} +0 -0
- /package/dist/{index-DN4NOCqN2.d.mts → index-Ol9RBB0W2.d.mts} +0 -0
- /package/dist/{index-BIdsFcQs2.d.mts → index-aoxdnhJ42.d.mts} +0 -0
- /package/dist/{index-SsBHjUqA.d.mts → index-nydhGvXa.d.mts} +0 -0
- /package/dist/{jsonl-transport-bQl3JwIu.mjs → jsonl-transport-Bp_6pB2a.mjs} +0 -0
- /package/dist/{lib-DOBXZmYX.mjs → lib-Bwdd2m81.mjs} +0 -0
- /package/dist/{model-registry-CmgcPDH3.mjs → model-registry-Y854mUml.mjs} +0 -0
- /package/dist/{model-registry-xyBKSye-.mjs → model-registry-yURX738J.mjs} +0 -0
- /package/dist/{modes-BheyN7SS.mjs → modes-DmUsjHdV.mjs} +0 -0
- /package/dist/{namespace-HO2J9sO8.mjs → namespace-B9FEGuEu.mjs} +0 -0
- /package/dist/{namespace-jDhZjw-i.d.mts → namespace-Bi3CmYQy.d.mts} +0 -0
- /package/dist/{namespace-GPA7zots.d.mts → namespace-BusZERU8.d.mts} +0 -0
- /package/dist/{namespace-BOkKoq34.d.mts → namespace-ByP1Iipi.d.mts} +0 -0
- /package/dist/{namespace-YytVKIgI.d.mts → namespace-C1D77w7U.d.mts} +0 -0
- /package/dist/{namespace-CErHuXtb.d.mts → namespace-C6CVEGH8.d.mts} +0 -0
- /package/dist/{namespace-C-9si-fV.mjs → namespace-CfIW0hpQ.mjs} +0 -0
- /package/dist/{namespace-YxU1xf-K.mjs → namespace-CkBbNFSU.mjs} +0 -0
- /package/dist/{namespace-DWCEo-9M.d.mts → namespace-DX1Ec15L.d.mts} +0 -0
- /package/dist/{namespace-CWGKCNZm.mjs → namespace-DbNWsPFY.mjs} +0 -0
- /package/dist/{namespace-Cv1RFP7n.d.mts → namespace-Dgg0uoe6.d.mts} +0 -0
- /package/dist/{namespace-tGRAod3o.d.mts → namespace-s2y_NFKf.d.mts} +0 -0
- /package/dist/{namespace-Blp4c8GK.d.mts → namespace-yREpGJgG.d.mts} +0 -0
- /package/dist/{out-CvjtANXN.mjs → out-DrhwCgqM.mjs} +0 -0
- /package/dist/{packages-DtEEP0Vt.mjs → packages-FBv3fAOR.mjs} +0 -0
- /package/dist/{packages-BZ6pzFIq.d.mts → packages-N3-2Kl-Y.d.mts} +0 -0
- /package/dist/{platform-Bv8llU9c.mjs → platform-BrsMv_S3.mjs} +0 -0
- /package/dist/{provider-operation-Cxoe2SUr.d.mts → provider-operation-DJ_TLZFf.d.mts} +0 -0
- /package/dist/{providers-Co5UszRH.mjs → providers-CCcn4Ndp.mjs} +0 -0
- /package/dist/{providers-namespace-DjFkmvBR.d.mts → providers-namespace-DeJBh6MP.d.mts} +0 -0
- /package/dist/{quick-lru-CrOpWwrf.mjs → quick-lru-uwB0hP-y.mjs} +0 -0
- /package/dist/{schema-introspection-DgWQCpwx.mjs → schema-introspection-C1wvklj9.mjs} +0 -0
- /package/dist/{schema-Db-y-09L.mjs → schema-jIapW8Kb.mjs} +0 -0
- /package/dist/{schemas-CR8hSqTy.d.mts → schemas-B7zo7Zcx.d.mts} +0 -0
- /package/dist/{schemas-CqRm0i9a.mjs → schemas-BNdiVBWh.mjs} +0 -0
- /package/dist/{schemas-B1NWNASS.d.mts → schemas-C-Bm6Oac.d.mts} +0 -0
- /package/dist/{schemas-BO7uOum6.d.mts → schemas-CD0wOQxx.d.mts} +0 -0
- /package/dist/{schemas-N6x2z7Lf.d.mts → schemas-CeUI2i5j.d.mts} +0 -0
- /package/dist/{schemas-CwbYk_kZ.d.mts → schemas-Cg-Kwp8c.d.mts} +0 -0
- /package/dist/{schemas-BtZqovRH.d.mts → schemas-Cv3rR9Sz.d.mts} +0 -0
- /package/dist/{schemas-tDf_WiC8.mjs → schemas-CvHFbzdy.mjs} +0 -0
- /package/dist/{schemas-BsVYZviy.d.mts → schemas-DZH9lpxs.d.mts} +0 -0
- /package/dist/{schemas-BGExwp3j.mjs → schemas-DgwEVUt-.mjs} +0 -0
- /package/dist/{schemas-Bfxskx_2.mjs → schemas-mLpOfMoN.mjs} +0 -0
- /package/dist/{schemas-CQyRBqD6.d.mts → schemas-qA279_j_.d.mts} +0 -0
- /package/dist/{schemas-miYxK_Z1.d.mts → schemas-sMoRnBdZ.d.mts} +0 -0
- /package/dist/{semver-DlM8znk4.mjs → semver-DTXuyLcK.mjs} +0 -0
- /package/dist/{server-lifecycle-Dsq56aqC.d.mts → server-lifecycle-C_8iKgat.d.mts} +0 -0
- /package/dist/{server-lifecycle-kmQ5PUDv.mjs → server-lifecycle-DKx_fWlq.mjs} +0 -0
- /package/dist/{shared-schemas-DXwyMCwZ.mjs → shared-schemas-aahW97QW.mjs} +0 -0
- /package/dist/{src-CCu8TwL6.mjs → src-DHqsl5Pg.mjs} +0 -0
- /package/dist/{storage-namespace-BSrv0vXR.mjs → storage-namespace-Dz2jsssp.mjs} +0 -0
- /package/dist/{storage-namespace-dfywhXR3.d.mts → storage-namespace-Tf3P5yJ5.d.mts} +0 -0
- /package/dist/{storage-namespace-definition-BvlX0QV_.d.mts → storage-namespace-definition-BsnYAPot.d.mts} +0 -0
- /package/dist/{storage-namespace-definition-CkMKt7-I.mjs → storage-namespace-definition-CDef0E20.mjs} +0 -0
- /package/dist/{supports-color-DUugCQsK.mjs → supports-color-i7OTnKcZ.mjs} +0 -0
- /package/dist/{telemetry-Pr3oP2rk.mjs → telemetry-BvCBUjFg.mjs} +0 -0
- /package/dist/{timeout-DWDhddRJ.mjs → timeout-B0nYjLc8.mjs} +0 -0
- /package/dist/{tray-menu-service-BBLa-Rcv.mjs → tray-menu-service-Deo6yyP8.mjs} +0 -0
- /package/dist/{types-BrcjaNPZ.d.mts → types-CNS55jvt.d.mts} +0 -0
- /package/dist/{types-b54n1o57.d.mts → types-Ce6LL25v.d.mts} +0 -0
- /package/dist/{types-DHmPneIO.d.mts → types-xCdGghb2.d.mts} +0 -0
- /package/dist/{ui-config-CyCdlns_.mjs → ui-config-BIyGzMNL.mjs} +0 -0
- /package/dist/{variant-krjlTdJt.mjs → variant-B4uWdxW7.mjs} +0 -0
- /package/dist/{window-registry-BDnZLPVx.d.mts → window-registry-BLtVx3Iw.d.mts} +0 -0
- /package/dist/{window-registry-I-imZHV_.mjs → window-registry-CoBJq3u4.mjs} +0 -0
|
@@ -0,0 +1,943 @@
|
|
|
1
|
+
import { IMakaioBus } from "@makaio/framework/bus";
|
|
2
|
+
import * as _$_makaio_contracts0 from "@makaio/framework/contracts";
|
|
3
|
+
import { AutomationTriggerBinding, AutomationTriggerCleanup, AutomationTriggerDescriptor, AutomationTriggerListener, AutomationTriggerSubscription, AutomationTriggerType, JsonValue, MakaioNodeExtension } from "@makaio/framework/contracts";
|
|
4
|
+
import { ContributionProcessor, KernelExtensionContext, KernelMakaioExtension } from "@makaio/framework/kernel";
|
|
5
|
+
import { BaseService } from "@makaio/framework/service-base";
|
|
6
|
+
|
|
7
|
+
//#region services/core/src/automation-trigger/automation-trigger-binding-runtime.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Minimal resolution surface the binding runtime needs from a trigger registry.
|
|
10
|
+
*
|
|
11
|
+
* Declaring the dependency structurally keeps the runtime free of the registry's
|
|
12
|
+
* bus lifecycle: any owner-aware catalog that can resolve a kind to its owner and
|
|
13
|
+
* executable trigger can drive the runtime.
|
|
14
|
+
*/
|
|
15
|
+
interface AutomationTriggerResolver {
|
|
16
|
+
/**
|
|
17
|
+
* Resolves a trigger kind to its owning extension and executable type.
|
|
18
|
+
* @param kind - Canonical trigger kind to resolve.
|
|
19
|
+
* @returns The owner and trigger type, or `undefined` when not registered.
|
|
20
|
+
*/
|
|
21
|
+
resolveRegistration(kind: string): {
|
|
22
|
+
readonly owner: string;
|
|
23
|
+
readonly type: AutomationTriggerType;
|
|
24
|
+
} | undefined;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Schema-validated binding admission prepared for one registration snapshot.
|
|
28
|
+
*
|
|
29
|
+
* The capability keeps parsed parameters private while exposing the canonical
|
|
30
|
+
* key a caller needs for its own handover decision. Calling {@link subscribe}
|
|
31
|
+
* consumes that exact parsed snapshot, so a transforming parameter schema can
|
|
32
|
+
* never produce one key for inspection and a different activation input.
|
|
33
|
+
*/
|
|
34
|
+
interface PreparedAutomationTriggerBinding {
|
|
35
|
+
/** Canonical key derived from the prepared, schema-parsed parameters. */
|
|
36
|
+
readonly bindingKey: string;
|
|
37
|
+
/** Whether this trigger's event output has an object root suitable for workflows. */
|
|
38
|
+
readonly workflowCompatible: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Attaches a listener using this prepared registration and parameter snapshot.
|
|
41
|
+
* @param listener - Listener invoked for every validated emitted event.
|
|
42
|
+
* @returns A handle whose `detach` releases this listener's reference.
|
|
43
|
+
*/
|
|
44
|
+
subscribe(listener: AutomationTriggerListener): Promise<AutomationTriggerSubscription>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Reference-counted activation runtime for automation trigger bindings.
|
|
48
|
+
*
|
|
49
|
+
* Four invariants define this runtime:
|
|
50
|
+
*
|
|
51
|
+
* 1. **Canonical sharing.** A binding is identified by
|
|
52
|
+
* `<kind>:<canonical-json(parsed params)>`. Parameters are parsed through the
|
|
53
|
+
* trigger's `paramsSchema` first and then canonicalized, so defaults and
|
|
54
|
+
* normalizing transforms are applied before the key is computed and the
|
|
55
|
+
* values handed to `activate` are exactly the values the key was derived
|
|
56
|
+
* from; two bindings that mean the same thing therefore share exactly one
|
|
57
|
+
* live activation, reference-counted by listener.
|
|
58
|
+
* 2. **Lane-serialized state, lane-free extension code.** Every internal state
|
|
59
|
+
* transition — indexing, reference counting, retirement, abort — runs on a
|
|
60
|
+
* single FIFO lane, so no two activations, teardowns, or replacements can
|
|
61
|
+
* interleave their bookkeeping. Extension-owned promises (`activate` and the
|
|
62
|
+
* cleanup it returns) and listener delivery are awaited **outside** the lane
|
|
63
|
+
* and reconciled against the entry's map identity when they settle.
|
|
64
|
+
* Callers keep their ordering guarantees — `detach()` still resolves only once
|
|
65
|
+
* the cleanup has settled — while extension code can never block the lane.
|
|
66
|
+
* That is what makes a listener free to subscribe or detach during delivery,
|
|
67
|
+
* lets {@link close} abort an `activate` that only settles on abort, and lets
|
|
68
|
+
* a cleanup mutate the runtime.
|
|
69
|
+
* 3. **Map identity is the single liveness signal.** Retiring an activation
|
|
70
|
+
* unindexes it, clears its listeners, and aborts its signal — always together,
|
|
71
|
+
* always in one lane step. An entry is therefore live exactly while it is the
|
|
72
|
+
* indexed activation for its key: an emit from a source that outlived its
|
|
73
|
+
* cleanup is discarded, and a late-completing activation cannot be
|
|
74
|
+
* resurrected — its cleanup runs and nothing else. No separate disposed flag
|
|
75
|
+
* or generation counter is needed to distinguish a superseded activation from
|
|
76
|
+
* the live one.
|
|
77
|
+
*
|
|
78
|
+
* 4. **Registration identity gates sharing.** An activation records the
|
|
79
|
+
* registered trigger it was built from. Sharing a live activation is only
|
|
80
|
+
* correct while that registration is still the current one: an owner that
|
|
81
|
+
* re-registers a kind replaces `activate`, `paramsSchema`, and `eventSchema`
|
|
82
|
+
* wholesale, so joining the previous activation would run new subscribers
|
|
83
|
+
* against an implementation discovery no longer advertises. A join whose
|
|
84
|
+
* captured trigger is no longer the resolved one therefore retires the stale
|
|
85
|
+
* activation and builds a fresh one.
|
|
86
|
+
*
|
|
87
|
+
* Listeners on the retired activation are silenced rather than migrated. That
|
|
88
|
+
* is the same semantic as {@link stopKind}, and for the same reason: their
|
|
89
|
+
* consumers recover by re-subscribing on `automation-triggers.changed`, which
|
|
90
|
+
* the replacing registration necessarily emitted before this join could be
|
|
91
|
+
* admitted. Migrating them instead would hand them an activation whose
|
|
92
|
+
* `activate` may still fail, with their own `subscribe` already resolved and
|
|
93
|
+
* no error path left to report it on.
|
|
94
|
+
*
|
|
95
|
+
* The runtime deliberately does not extend `BaseService`: it owns no bus subjects
|
|
96
|
+
* and no bus lifecycle. It is a plain collaborator constructed with a resolver,
|
|
97
|
+
* so hosts can compose it into whatever lifecycle owns it and call
|
|
98
|
+
* {@link close} on teardown.
|
|
99
|
+
*/
|
|
100
|
+
declare class AutomationTriggerBindingRuntime {
|
|
101
|
+
private readonly resolver;
|
|
102
|
+
/** Live activations indexed by canonical binding key. */
|
|
103
|
+
private readonly bindings;
|
|
104
|
+
/** Maps issued public handles back to their internal identity. */
|
|
105
|
+
private readonly records;
|
|
106
|
+
/**
|
|
107
|
+
* The single FIFO state-transition lane.
|
|
108
|
+
*
|
|
109
|
+
* Operations placed on it must not await extension-owned promises or deliver
|
|
110
|
+
* events — that is the invariant which keeps the lane free of deadlocks.
|
|
111
|
+
*/
|
|
112
|
+
private readonly lane;
|
|
113
|
+
/** Monotonic subscription id source. */
|
|
114
|
+
private subscriptionCounter;
|
|
115
|
+
/** Set by {@link close}; rejects further acquisitions. */
|
|
116
|
+
private closed;
|
|
117
|
+
/**
|
|
118
|
+
* @param resolver - Registry surface used to resolve kinds to executable
|
|
119
|
+
* triggers and their owning extension.
|
|
120
|
+
*/
|
|
121
|
+
constructor(resolver: AutomationTriggerResolver);
|
|
122
|
+
/**
|
|
123
|
+
* Attaches a listener to the binding, activating the trigger if needed.
|
|
124
|
+
*
|
|
125
|
+
* Parameters are validated through the trigger's `paramsSchema` and then
|
|
126
|
+
* checked for JSON compatibility before anything is activated, so an invalid
|
|
127
|
+
* binding never reaches extension code. When an activation already exists for
|
|
128
|
+
* the canonical key — including one that is still activating — the listener
|
|
129
|
+
* joins it and no second activation occurs, provided that activation still
|
|
130
|
+
* belongs to the current registration of the kind (invariant 4).
|
|
131
|
+
*
|
|
132
|
+
* Three phases: a lane-internal admission that installs or joins the entry, an
|
|
133
|
+
* out-of-lane await of the shared activation promise, and a lane-internal
|
|
134
|
+
* commit that issues the handle only while the admitted listener is still live.
|
|
135
|
+
*
|
|
136
|
+
* A caller that swaps one binding for another does so by subscribing the
|
|
137
|
+
* replacement and only then detaching the previous handle. That ordering is the
|
|
138
|
+
* caller's, deliberately: it keeps a shared source from being torn down and
|
|
139
|
+
* re-activated, it leaves the previous subscription fully intact when the
|
|
140
|
+
* acquisition fails, and it leaves the window between the two steps — where a
|
|
141
|
+
* caller with its own delivery bookkeeping has to settle which of the two
|
|
142
|
+
* attached listeners acts — under that caller's control.
|
|
143
|
+
* @param binding - Trigger kind plus JSON parameters to activate.
|
|
144
|
+
* @param listener - Listener invoked for every validated emitted event.
|
|
145
|
+
* @returns A handle whose `detach` releases this listener's reference.
|
|
146
|
+
* @throws When the runtime is closed, the kind is not registered, the
|
|
147
|
+
* parameters fail validation, the activation itself fails, or a lifecycle
|
|
148
|
+
* operation retires the admission before activation completes.
|
|
149
|
+
*/
|
|
150
|
+
subscribe(binding: AutomationTriggerBinding, listener: AutomationTriggerListener): Promise<AutomationTriggerSubscription>;
|
|
151
|
+
/**
|
|
152
|
+
* Parses a binding once for both canonical-key inspection and subscription.
|
|
153
|
+
*
|
|
154
|
+
* The returned capability captures the registration that performed the parse.
|
|
155
|
+
* Its subscription rejects if that registration is replaced before admission,
|
|
156
|
+
* rather than re-parsing through a different schema under a stale key.
|
|
157
|
+
* Preparation does not activate anything and does not require the runtime to
|
|
158
|
+
* be open.
|
|
159
|
+
* @param binding - Trigger kind plus JSON parameters to prepare.
|
|
160
|
+
* @returns A prepared capability, or `undefined` when the kind is unregistered.
|
|
161
|
+
* @throws When the parameters fail the trigger's schema or are not
|
|
162
|
+
* JSON-compatible.
|
|
163
|
+
*/
|
|
164
|
+
prepareBinding(binding: AutomationTriggerBinding): PreparedAutomationTriggerBinding | undefined;
|
|
165
|
+
/**
|
|
166
|
+
* Acquires one prepared binding without parsing its parameters again.
|
|
167
|
+
* @param prepared - Private registration and parameter snapshot.
|
|
168
|
+
* @param listener - Listener to attach.
|
|
169
|
+
* @returns A detachable subscription handle.
|
|
170
|
+
*/
|
|
171
|
+
private subscribePrepared;
|
|
172
|
+
/**
|
|
173
|
+
* Computes the canonical sharing key a binding would activate under.
|
|
174
|
+
*
|
|
175
|
+
* Exists so a caller that indexes its own bookkeeping by binding key — a
|
|
176
|
+
* reconciler diffing stored bindings, for instance — derives that key through
|
|
177
|
+
* the same resolution and parsing the runtime itself uses, instead of
|
|
178
|
+
* re-implementing the schema parse and canonicalization and drifting from it.
|
|
179
|
+
*
|
|
180
|
+
* Does not activate anything and does not require the runtime to be open.
|
|
181
|
+
* @param binding - Trigger kind plus JSON parameters.
|
|
182
|
+
* @returns The canonical key, or `undefined` when the kind is not registered.
|
|
183
|
+
* @throws When the parameters fail the trigger's `paramsSchema` or are not
|
|
184
|
+
* JSON-compatible — the same rejection {@link subscribe} would produce.
|
|
185
|
+
*/
|
|
186
|
+
resolveBindingKey(binding: AutomationTriggerBinding): string | undefined;
|
|
187
|
+
/**
|
|
188
|
+
* Tears down every activation contributed by one owner.
|
|
189
|
+
*
|
|
190
|
+
* Only activations whose owner was captured as `owner` at activation time are
|
|
191
|
+
* removed, so other owners keep emitting. Handles pointing at a stopped
|
|
192
|
+
* activation stay safely detachable — their `detach` becomes a no-op.
|
|
193
|
+
* @param owner - Owning extension whose activations should stop.
|
|
194
|
+
* @returns Resolves once every matching cleanup has settled.
|
|
195
|
+
*/
|
|
196
|
+
stopOwner(owner: string): Promise<void>;
|
|
197
|
+
/**
|
|
198
|
+
* Tears down every activation of one trigger kind.
|
|
199
|
+
*
|
|
200
|
+
* Exists for the case where a *service an activation depends on* goes away
|
|
201
|
+
* while the trigger contributing the kind stays registered: the kind is still
|
|
202
|
+
* resolvable and still legitimately contributed, but every live activation of
|
|
203
|
+
* it is now backed by a dead collaborator. Retiring them unindexes them, which
|
|
204
|
+
* is what makes the next `subscribe` for that kind build a fresh activation
|
|
205
|
+
* against the live collaborator instead of joining a permanently inert one.
|
|
206
|
+
*
|
|
207
|
+
* Narrower than {@link stopOwner} on purpose: an owner commonly contributes
|
|
208
|
+
* several kinds with unrelated backing services, and stopping all of them would
|
|
209
|
+
* silence bindings that were never affected.
|
|
210
|
+
*
|
|
211
|
+
* The kind stays registered — this runtime holds no registrations. Handles
|
|
212
|
+
* pointing at a stopped activation stay safely detachable.
|
|
213
|
+
* @param kind - Canonical trigger kind whose activations should stop.
|
|
214
|
+
* @returns Resolves once every matching cleanup has settled.
|
|
215
|
+
*/
|
|
216
|
+
stopKind(kind: string): Promise<void>;
|
|
217
|
+
/**
|
|
218
|
+
* Disposes every activation and permanently closes the runtime.
|
|
219
|
+
*
|
|
220
|
+
* Delegates to {@link close}; exists so the runtime satisfies the
|
|
221
|
+
* `ExtensionServiceLifecycle` contract from `@makaio/contracts` and the
|
|
222
|
+
* coordinator can call `service.destroy?.()` on package teardown.
|
|
223
|
+
* @returns Resolves once every cleanup has settled.
|
|
224
|
+
*/
|
|
225
|
+
destroy(): Promise<void>;
|
|
226
|
+
/**
|
|
227
|
+
* Disposes every activation and permanently closes the runtime.
|
|
228
|
+
*
|
|
229
|
+
* Idempotent, and safe to call while an activation is still in flight. The
|
|
230
|
+
* lane carries only state transitions, so this call is never queued behind
|
|
231
|
+
* extension-owned code: a pending acquisition is admitted first (the lane is
|
|
232
|
+
* FIFO) and its activation is then retired here like any other. Retirement
|
|
233
|
+
* aborts the activation signal immediately, which is what lets an `activate`
|
|
234
|
+
* that only settles on abort settle at all — its cleanup then runs and this
|
|
235
|
+
* call resolves. Handles issued before close remain safely detachable.
|
|
236
|
+
* @returns Resolves once every cleanup has settled.
|
|
237
|
+
*/
|
|
238
|
+
close(): Promise<void>;
|
|
239
|
+
/**
|
|
240
|
+
* Installs a new activation entry or joins an existing one. Lane-internal.
|
|
241
|
+
*
|
|
242
|
+
* Starts the single `activate` call for a new entry but never awaits it: the
|
|
243
|
+
* outcome is published on {@link ActiveBinding.activated} for the acquirer and
|
|
244
|
+
* for teardown to await after the lane is released.
|
|
245
|
+
*
|
|
246
|
+
* An existing entry is joined only when it was built from the registration this
|
|
247
|
+
* admission just resolved. Otherwise it is retired here and replaced — see
|
|
248
|
+
* {@link AutomationTriggerBindingRuntime} invariant 4.
|
|
249
|
+
* @param prepared - Once-parsed binding and registration snapshot to admit.
|
|
250
|
+
* @param listener - Listener to attach.
|
|
251
|
+
* @returns The entry joined, the allocated listener id, and any activation this
|
|
252
|
+
* admission superseded.
|
|
253
|
+
* @throws When the runtime is closed, the kind is unknown, or its registration
|
|
254
|
+
* changed after preparation.
|
|
255
|
+
*/
|
|
256
|
+
private admitWithinLane;
|
|
257
|
+
/**
|
|
258
|
+
* Runs the single `activate` call for an entry and publishes its outcome.
|
|
259
|
+
*
|
|
260
|
+
* Deliberately not awaited by its caller: the lane must never contain
|
|
261
|
+
* extension-owned promises. `activate` is still entered synchronously, so a
|
|
262
|
+
* trigger that emits inside `activate` reaches its first listener immediately.
|
|
263
|
+
* @param entry - Entry being activated.
|
|
264
|
+
* @param type - Registered trigger providing the activation implementation.
|
|
265
|
+
* @param params - Canonical, schema-parsed activation parameters.
|
|
266
|
+
* @param deferred - Shared outcome slot every awaiter of this entry observes.
|
|
267
|
+
* @returns Resolves once the outcome has been published.
|
|
268
|
+
*/
|
|
269
|
+
private startActivation;
|
|
270
|
+
/**
|
|
271
|
+
* Releases one listener reference, tearing the activation down when it was the
|
|
272
|
+
* last.
|
|
273
|
+
*
|
|
274
|
+
* A no-op when the handle was already detached, when its activation was
|
|
275
|
+
* superseded, or when the activation was removed by {@link stopOwner} or
|
|
276
|
+
* {@link close}.
|
|
277
|
+
* @param handle - Subscription handle to release.
|
|
278
|
+
* @returns Resolves once any resulting cleanup has settled.
|
|
279
|
+
* @throws When the handle was not issued by this runtime.
|
|
280
|
+
*/
|
|
281
|
+
private release;
|
|
282
|
+
/**
|
|
283
|
+
* Decides the outcome of a detach and applies its state transition.
|
|
284
|
+
* Lane-internal.
|
|
285
|
+
* @param handle - Subscription handle to release.
|
|
286
|
+
* @returns The entry whose cleanup must now run, or `undefined` when the
|
|
287
|
+
* activation survives or was already retired.
|
|
288
|
+
* @throws When the handle was not issued by this runtime.
|
|
289
|
+
*/
|
|
290
|
+
private releaseWithinLane;
|
|
291
|
+
/**
|
|
292
|
+
* Retires every activation matching a predicate and awaits their cleanups.
|
|
293
|
+
*
|
|
294
|
+
* The single teardown sweep behind {@link stopOwner}, {@link stopKind}, and
|
|
295
|
+
* {@link close}. Two parts must not diverge between them: selecting entries from
|
|
296
|
+
* a snapshot while collecting only first-time retirements, and awaiting the
|
|
297
|
+
* resulting cleanups outside the lane.
|
|
298
|
+
* @param matches - Selects the activations to retire.
|
|
299
|
+
* @param beforeSweep - Optional state transition applied on the lane
|
|
300
|
+
* immediately before the sweep, for a caller that must change runtime state
|
|
301
|
+
* atomically with it. Must not await anything.
|
|
302
|
+
* @returns Resolves once every matching cleanup has settled.
|
|
303
|
+
*/
|
|
304
|
+
private retireMatching;
|
|
305
|
+
/**
|
|
306
|
+
* Unindexes an activation, silences it, and aborts its signal. Lane-internal.
|
|
307
|
+
*
|
|
308
|
+
* Returning the entry only on the first retirement is what makes cleanup run
|
|
309
|
+
* exactly once: every teardown path decides on the lane and only the winning
|
|
310
|
+
* decision receives an entry to clean up.
|
|
311
|
+
*
|
|
312
|
+
* This is the sole remover from the index. That is what establishes invariant
|
|
313
|
+
* 3 of {@link AutomationTriggerBindingRuntime}: map identity alone answers "is
|
|
314
|
+
* this activation still live" and makes a second retirement a no-op.
|
|
315
|
+
* @param entry - Activation to retire.
|
|
316
|
+
* @returns The entry when this call retired it, `undefined` when it was
|
|
317
|
+
* already retired.
|
|
318
|
+
*/
|
|
319
|
+
private retireWithinLane;
|
|
320
|
+
/**
|
|
321
|
+
* Awaits a retired activation's cleanup. Runs outside the lane.
|
|
322
|
+
*
|
|
323
|
+
* Waits for the shared activation outcome first, so an entry retired while it
|
|
324
|
+
* was still activating is still cleaned up once `activate` settles — its
|
|
325
|
+
* signal was already aborted by the retirement, which is what lets an
|
|
326
|
+
* abort-driven activation settle at all.
|
|
327
|
+
*
|
|
328
|
+
* Cleanup failures are logged rather than propagated: teardown must stay
|
|
329
|
+
* idempotent for callers and must never abandon the remaining activations in a
|
|
330
|
+
* {@link stopOwner} or {@link close} sweep.
|
|
331
|
+
* @param entry - Retired activation to tear down.
|
|
332
|
+
* @returns Resolves once the cleanup has settled.
|
|
333
|
+
*/
|
|
334
|
+
private runCleanup;
|
|
335
|
+
/**
|
|
336
|
+
* Creates a public subscription handle bound to an internal record.
|
|
337
|
+
* @param record - Internal identity of the subscription.
|
|
338
|
+
* @returns The public handle; its `detach` decides on the lane and is
|
|
339
|
+
* idempotent.
|
|
340
|
+
*/
|
|
341
|
+
private issueHandle;
|
|
342
|
+
/**
|
|
343
|
+
* Builds the activation context handed to a trigger's `activate`.
|
|
344
|
+
*
|
|
345
|
+
* The returned `emit` validates every payload against the schema captured at
|
|
346
|
+
* activation time before any listener runs, and is inert once the activation has
|
|
347
|
+
* been retired or superseded.
|
|
348
|
+
* @param entry - Activation the context belongs to.
|
|
349
|
+
* @returns The activation context for this activation only.
|
|
350
|
+
*/
|
|
351
|
+
private createContext;
|
|
352
|
+
/**
|
|
353
|
+
* Validates and delivers one emitted payload to an activation's listeners.
|
|
354
|
+
*
|
|
355
|
+
* Never runs while the state-transition lane is held, so a listener is free to
|
|
356
|
+
* subscribe or detach during delivery — including for an emit made from inside
|
|
357
|
+
* `activate`.
|
|
358
|
+
* @param entry - Activation that emitted.
|
|
359
|
+
* @param payload - Raw payload supplied by the trigger.
|
|
360
|
+
* @param correlationId - Optional correlation id propagated by the source.
|
|
361
|
+
* @returns Resolves once every listener has settled.
|
|
362
|
+
* @throws When the payload fails the activation's captured `eventSchema` or is
|
|
363
|
+
* not JSON-compatible.
|
|
364
|
+
*/
|
|
365
|
+
private dispatch;
|
|
366
|
+
}
|
|
367
|
+
//#endregion
|
|
368
|
+
//#region services/core/src/automation-trigger/automation-trigger-registry.d.ts
|
|
369
|
+
/**
|
|
370
|
+
* Owner-aware registry and bus catalog for automation triggers contributed by
|
|
371
|
+
* extensions.
|
|
372
|
+
*
|
|
373
|
+
* Registration is keyed by the owning extension: every trigger kind must carry
|
|
374
|
+
* the canonical `<owner>.` prefix, kinds are globally unique across owners, and
|
|
375
|
+
* a registration batch is atomic — the complete incoming batch (including every
|
|
376
|
+
* descriptor snapshot) is validated before either index changes, so a failing
|
|
377
|
+
* batch leaves no partial registration.
|
|
378
|
+
*
|
|
379
|
+
* The registry supports dot-qualified owner names such as `makaio.clients-core`:
|
|
380
|
+
* a trigger kind must start with `<owner>.` (with a trailing dot), which
|
|
381
|
+
* permits `makaio.clients-core.profile-changed` for owner `makaio.clients-core`.
|
|
382
|
+
* Npm-scoped owners use that same exact-prefix rule: `@acme/review.review-posted`
|
|
383
|
+
* belongs to owner `@acme/review`, not a prefix-matching variant.
|
|
384
|
+
*
|
|
385
|
+
* Whole-batch replacement: each `register` call replaces that owner's entire
|
|
386
|
+
* previously registered batch atomically. An empty batch removes the owner's
|
|
387
|
+
* entries. Conflicts with another owner's kinds are rejected with an error that
|
|
388
|
+
* names both the kind and the requesting owner.
|
|
389
|
+
*
|
|
390
|
+
* Bus catalog: `onInit()` registers the `automation-triggers.list` RPC handler
|
|
391
|
+
* so callers can query the current trigger catalog without a direct reference to
|
|
392
|
+
* this service. The `automation-triggers.changed` event is emitted on every
|
|
393
|
+
* successful registration or deregistration. Registry state commits before the
|
|
394
|
+
* event is emitted, so an observer failure cannot undo a change sibling
|
|
395
|
+
* observers may already have consumed.
|
|
396
|
+
*/
|
|
397
|
+
declare class AutomationTriggerRegistry extends BaseService {
|
|
398
|
+
/** Registered triggers grouped by owning extension. */
|
|
399
|
+
private typesByOwner;
|
|
400
|
+
/** Global kind index for collision checks and resolution lookup. */
|
|
401
|
+
private typesByKind;
|
|
402
|
+
/**
|
|
403
|
+
* Monotonically increasing revision counter.
|
|
404
|
+
*
|
|
405
|
+
* Starts at 0 and increments on every successful `register` or `deregister`
|
|
406
|
+
* call. Included in the `automation-triggers.changed` event so subscribers
|
|
407
|
+
* can detect missed events.
|
|
408
|
+
*/
|
|
409
|
+
private revision;
|
|
410
|
+
/**
|
|
411
|
+
* FIFO mutation lane.
|
|
412
|
+
*
|
|
413
|
+
* `register` and `deregister` mutate and then await notification settlement.
|
|
414
|
+
* Serializing them gives each committed change a unique revision and keeps
|
|
415
|
+
* notifications in committed revision order.
|
|
416
|
+
*/
|
|
417
|
+
private readonly mutations;
|
|
418
|
+
/**
|
|
419
|
+
* Memoized {@link list} result, keyed on the kind index it was derived from.
|
|
420
|
+
*
|
|
421
|
+
* Keying on the Map identity rather than on an explicit invalidation call is
|
|
422
|
+
* what makes the memo unconditionally correct: every index mutation publishes a
|
|
423
|
+
* **new** Map, so a stale memo can never match the live index and no mutation
|
|
424
|
+
* path can forget to invalidate it.
|
|
425
|
+
*/
|
|
426
|
+
private catalog;
|
|
427
|
+
/**
|
|
428
|
+
* @param bus - Bus instance used for the service lifecycle and catalog RPC.
|
|
429
|
+
*/
|
|
430
|
+
constructor(bus: IMakaioBus);
|
|
431
|
+
/**
|
|
432
|
+
* Initialize the service by registering the `automation-triggers.list` RPC
|
|
433
|
+
* handler.
|
|
434
|
+
*
|
|
435
|
+
* Only discovery is exposed over the bus. Trigger activation and deactivation
|
|
436
|
+
* are in-process operations not accessible via bus subjects in this phase.
|
|
437
|
+
*/
|
|
438
|
+
protected onInit(): void;
|
|
439
|
+
/**
|
|
440
|
+
* Clears all in-memory registrations on teardown so handler closure
|
|
441
|
+
* references held by the kind index are released.
|
|
442
|
+
*
|
|
443
|
+
* Assigns fresh Maps rather than clearing in place, preserving the invariant
|
|
444
|
+
* that every index mutation publishes a new Map and invalidates any memoized
|
|
445
|
+
* catalog by identity.
|
|
446
|
+
*/
|
|
447
|
+
protected onDestroy(): void;
|
|
448
|
+
/**
|
|
449
|
+
* Atomically registers the complete automation trigger batch for an owner.
|
|
450
|
+
*
|
|
451
|
+
* Each call replaces that owner's previous batch entirely. The whole incoming
|
|
452
|
+
* batch — including every descriptor snapshot — is validated before either
|
|
453
|
+
* index changes, so a failing batch leaves the prior registration intact.
|
|
454
|
+
* Kinds owned by another owner still collide; an empty batch removes this
|
|
455
|
+
* owner's current registrations.
|
|
456
|
+
*
|
|
457
|
+
* Emits `automation-triggers.changed` with `reason: 'registered'` (or
|
|
458
|
+
* `'deregistered'` for an empty batch that removes a prior batch). Notification
|
|
459
|
+
* payloads identify the exact union of the previous and replacement batch's
|
|
460
|
+
* kinds. Failures are reported but do not alter the committed registry state.
|
|
461
|
+
*
|
|
462
|
+
* Serialized against every other registry mutation: validation, index
|
|
463
|
+
* replacement, and notification settlement complete before the next mutation
|
|
464
|
+
* starts.
|
|
465
|
+
*
|
|
466
|
+
* A no-op (no emit, no state change) when `definitions` is empty and the
|
|
467
|
+
* owner had no prior registrations.
|
|
468
|
+
* @param owner - The extension contributing the complete batch.
|
|
469
|
+
* @param definitions - Complete automation trigger types to register.
|
|
470
|
+
* @returns Resolves when registration commits and changed-event notification
|
|
471
|
+
* settles.
|
|
472
|
+
* @throws When a kind is not namespaced by `<owner>.`, has an empty local
|
|
473
|
+
* name, duplicates another incoming kind, or belongs to another owner.
|
|
474
|
+
*/
|
|
475
|
+
register(owner: string, definitions: readonly AutomationTriggerType[]): Promise<void>;
|
|
476
|
+
/**
|
|
477
|
+
* Applies one registration batch. Mutation-lane internal.
|
|
478
|
+
* @param owner - The extension contributing the complete batch.
|
|
479
|
+
* @param definitions - Complete automation trigger types to register.
|
|
480
|
+
* @returns Resolves when registration commits and changed-event notification
|
|
481
|
+
* settles.
|
|
482
|
+
* @throws When batch validation fails.
|
|
483
|
+
*/
|
|
484
|
+
private registerWithinLane;
|
|
485
|
+
/**
|
|
486
|
+
* Deregisters all automation triggers contributed by an owner.
|
|
487
|
+
*
|
|
488
|
+
* Idempotent — a no-op (no emit) when the owner has no registered triggers.
|
|
489
|
+
* Emits `automation-triggers.changed` with `reason: 'deregistered'` on
|
|
490
|
+
* success. Notification failures are reported but do not alter the committed
|
|
491
|
+
* registry state.
|
|
492
|
+
*
|
|
493
|
+
* Serialized against every other registry mutation.
|
|
494
|
+
* @param owner - The extension to remove.
|
|
495
|
+
* @returns Resolves when deregistration commits and changed-event notification
|
|
496
|
+
* settles.
|
|
497
|
+
*/
|
|
498
|
+
deregister(owner: string): Promise<void>;
|
|
499
|
+
/**
|
|
500
|
+
* Resolves a trigger kind to its owning extension and registered type
|
|
501
|
+
* snapshot.
|
|
502
|
+
*
|
|
503
|
+
* Used internally by the activation runtime to look up executable trigger
|
|
504
|
+
* fields without bus indirection. Returns `undefined` for unknown kinds so
|
|
505
|
+
* callers can gate gracefully on extension deregistration.
|
|
506
|
+
* @param kind - Canonical trigger kind to resolve, e.g. `demo.assignment`.
|
|
507
|
+
* @returns The owner and defensive type snapshot, or `undefined` when not
|
|
508
|
+
* registered.
|
|
509
|
+
*/
|
|
510
|
+
resolveRegistration(kind: string): {
|
|
511
|
+
readonly owner: string;
|
|
512
|
+
readonly type: AutomationTriggerType;
|
|
513
|
+
} | undefined;
|
|
514
|
+
/**
|
|
515
|
+
* Returns serializable descriptor snapshots for all registered automation
|
|
516
|
+
* triggers.
|
|
517
|
+
*
|
|
518
|
+
* Descriptors are detached clones deep-frozen at registration time, so the same
|
|
519
|
+
* objects are shared across calls: a caller cannot mutate the stored discovery
|
|
520
|
+
* snapshot, and the catalog RPC does not pay a deep clone of the whole catalog
|
|
521
|
+
* per query. The array itself is memoized per index revision. Descriptor
|
|
522
|
+
* derivation runs only during successful batch validation; listing never
|
|
523
|
+
* executes extension code.
|
|
524
|
+
* @returns Frozen descriptor snapshots for every registered trigger.
|
|
525
|
+
*/
|
|
526
|
+
list(): readonly AutomationTriggerDescriptor[];
|
|
527
|
+
/**
|
|
528
|
+
* Validates a complete registration batch without mutating registry state.
|
|
529
|
+
*
|
|
530
|
+
* Builds defensive type snapshots and pre-computes descriptor snapshots for
|
|
531
|
+
* every trigger in the batch. If any trigger fails validation the entire
|
|
532
|
+
* batch is rejected — no partial snapshots are returned.
|
|
533
|
+
* @param owner - Owner of the proposed definitions.
|
|
534
|
+
* @param definitions - Trigger types to validate.
|
|
535
|
+
* @returns Array of registered entries with snapshotted types and descriptors.
|
|
536
|
+
* @throws When namespace, duplicate-kind, or cross-owner invariants are
|
|
537
|
+
* violated, or when a trigger's schemas cannot be projected to JSON Schema.
|
|
538
|
+
*/
|
|
539
|
+
private validateBatch;
|
|
540
|
+
}
|
|
541
|
+
//#endregion
|
|
542
|
+
//#region services/core/src/automation-trigger/canonical-binding-key.d.ts
|
|
543
|
+
/**
|
|
544
|
+
* Canonicalizes a JSON record into the exact value its binding key encodes.
|
|
545
|
+
*
|
|
546
|
+
* Defined as the parse of the canonical serialization rather than as a separate
|
|
547
|
+
* traversal, which is what makes the guarantee exact instead of merely intended:
|
|
548
|
+
* the record handed to `activate` is by construction the value
|
|
549
|
+
* {@link createCanonicalBindingKey} derived its key from, so no parameter can
|
|
550
|
+
* ever disagree with the key it produced.
|
|
551
|
+
*
|
|
552
|
+
* Two normalizations follow from that definition. Object keys come back sorted,
|
|
553
|
+
* so `activate` observes a deterministic property order. Negative zero comes back
|
|
554
|
+
* as `0`, because that is what serialization does to it — without this, a binding
|
|
555
|
+
* could hand `activate` a `-0` the key cannot express, and two parameter sets that
|
|
556
|
+
* share one activation would disagree about what that activation was given.
|
|
557
|
+
* @param record - Schema-parsed, JSON-validated binding parameters.
|
|
558
|
+
* @returns A structurally equal record in canonical form.
|
|
559
|
+
*/
|
|
560
|
+
declare function canonicalizeJsonRecord(record: Record<string, JsonValue>): Record<string, JsonValue>;
|
|
561
|
+
/**
|
|
562
|
+
* Computes the canonical sharing key for an automation trigger binding.
|
|
563
|
+
*
|
|
564
|
+
* Two bindings share a single live activation exactly when they produce the same
|
|
565
|
+
* key. Callers must pass the **schema-parsed** parameters so that defaults and
|
|
566
|
+
* normalizing transforms are already applied — otherwise two bindings that mean
|
|
567
|
+
* the same thing would activate the underlying source twice.
|
|
568
|
+
*
|
|
569
|
+
* The key format is `<kind>:<canonical-json(params)>`. Key ordering is handled by
|
|
570
|
+
* the canonical serialization itself, so passing an already-canonicalized record
|
|
571
|
+
* yields the same key as passing the raw parsed one.
|
|
572
|
+
* @param kind - Canonical trigger kind, e.g. `demo.assignment`.
|
|
573
|
+
* @param params - Schema-parsed, JSON-validated binding parameters.
|
|
574
|
+
* @returns A stable string key identifying the shared binding.
|
|
575
|
+
*/
|
|
576
|
+
declare function createCanonicalBindingKey(kind: string, params: Record<string, JsonValue>): string;
|
|
577
|
+
//#endregion
|
|
578
|
+
//#region services/core/src/automation-trigger/packages.d.ts
|
|
579
|
+
/** Token for the automation trigger registry service. */
|
|
580
|
+
declare const AutomationTriggerRegistryToken: _$_makaio_contracts0.ExtensionToken<AutomationTriggerRegistry>;
|
|
581
|
+
/** Token for the automation trigger binding runtime service. */
|
|
582
|
+
declare const AutomationTriggerBindingRuntimeToken: _$_makaio_contracts0.ExtensionToken<AutomationTriggerBindingRuntime>;
|
|
583
|
+
/** Package that starts the framework automation trigger registry. */
|
|
584
|
+
declare const automationTriggerRegistryPackage: MakaioNodeExtension<IMakaioBus>;
|
|
585
|
+
/**
|
|
586
|
+
* Package that starts the automation trigger binding runtime.
|
|
587
|
+
*
|
|
588
|
+
* The runtime resolves its registry lazily via a closure around
|
|
589
|
+
* `ctx.getService(AutomationTriggerRegistryToken)` rather than capturing a
|
|
590
|
+
* fixed reference at construction time. This allows the registry to restart
|
|
591
|
+
* (disable → re-enable) without forcing the runtime to restart in lock-step:
|
|
592
|
+
* the runtime service and every handle issued by it survive the gap, and
|
|
593
|
+
* contributor replay installs fresh registrations in the new registry instance
|
|
594
|
+
* before any new subscription resolves. New subscriptions therefore always
|
|
595
|
+
* resolve against the current live registry.
|
|
596
|
+
*
|
|
597
|
+
* Contributor-owned activations do not survive the gap: the contribution
|
|
598
|
+
* processor stops the sources it owns when the registry stops, because the
|
|
599
|
+
* cleanup closures that could stop them are dropped at that point. Their handles
|
|
600
|
+
* stay safely detachable — detaching a stopped activation is a no-op.
|
|
601
|
+
*
|
|
602
|
+
* Deliberately does NOT declare `dependencies: [dep(registry)]`. A non-optional
|
|
603
|
+
* dependency edge does not cascade a stop — the coordinator refuses to disable a
|
|
604
|
+
* package while active non-optional dependents remain. Declaring it would make
|
|
605
|
+
* the registry permanently undisableable whenever this runtime is active, which
|
|
606
|
+
* would remove the registry restart/replay capability the lazy resolver above
|
|
607
|
+
* exists to support. Start ordering is instead given by the position of the two
|
|
608
|
+
* packages in `frameworkCorePackages`, and the runtime needs no registry
|
|
609
|
+
* reference at construction time.
|
|
610
|
+
*/
|
|
611
|
+
declare const automationTriggerBindingRuntimePackage: MakaioNodeExtension<IMakaioBus>;
|
|
612
|
+
//#endregion
|
|
613
|
+
//#region services/core/src/automation-trigger/builtins/bus-event-trigger.d.ts
|
|
614
|
+
/**
|
|
615
|
+
* Creates the built-in `makaio.bus-event` automation trigger.
|
|
616
|
+
*
|
|
617
|
+
* One activation observes exactly one subject pattern and forwards every
|
|
618
|
+
* matching **event** as a trigger event. Three properties define it:
|
|
619
|
+
*
|
|
620
|
+
* 1. **Events only.** The namespace wildcard is registered as an event handler
|
|
621
|
+
* only, so the activation is never advertised as a request route for the whole
|
|
622
|
+
* namespace, and a request that matches the pattern is skipped even if it ever
|
|
623
|
+
* reaches the handler: a trigger must never observe, delay, or answer an RPC.
|
|
624
|
+
* 2. **Object-root JSON payloads.** A scalar, array, or non-JSON payload is
|
|
625
|
+
* skipped and logged instead of thrown: the handler runs inside the emitter's
|
|
626
|
+
* dispatch, so throwing would surface a trigger's validation problem as a
|
|
627
|
+
* failure of the unrelated code that emitted the event.
|
|
628
|
+
* 3. **No consumer semantics.** No workflow identity and no consumer-owned
|
|
629
|
+
* filtering live here. Filtering an already-emitted event is the
|
|
630
|
+
* subscriber's concern; this trigger only decides what an activation
|
|
631
|
+
* observes.
|
|
632
|
+
*
|
|
633
|
+
* The bus is captured here, at trigger-creation time, from the contributing
|
|
634
|
+
* extension's context — not from the activation context — so every activation
|
|
635
|
+
* of this trigger observes the same bus the extension was activated with.
|
|
636
|
+
* @param bus - Bus instance owned by the contributing extension.
|
|
637
|
+
* @returns The registry-boundary trigger type for `makaio.bus-event`.
|
|
638
|
+
*/
|
|
639
|
+
declare function createBusEventAutomationTrigger(bus: IMakaioBus): AutomationTriggerType;
|
|
640
|
+
/**
|
|
641
|
+
* Every built-in automation trigger that needs nothing but a bus.
|
|
642
|
+
*
|
|
643
|
+
* The composition seam for hosts that assemble their own trigger batch: a worker
|
|
644
|
+
* or a headless host that must observe bus events, but composes no cron scheduler,
|
|
645
|
+
* gets the bus-backed set from here instead of listing individual factories and
|
|
646
|
+
* silently falling behind when another bus-backed built-in is added. The
|
|
647
|
+
* framework's own built-ins package composes this list plus the triggers that need
|
|
648
|
+
* more than a bus.
|
|
649
|
+
* @param bus - Bus instance the activations observe.
|
|
650
|
+
* @returns The bus-backed built-in trigger types.
|
|
651
|
+
*/
|
|
652
|
+
declare function busBackedAutomationTriggers(bus: IMakaioBus): readonly AutomationTriggerType[];
|
|
653
|
+
//#endregion
|
|
654
|
+
//#region services/core/src/automation-trigger/cron-scheduler.d.ts
|
|
655
|
+
/**
|
|
656
|
+
* One schedule request placed by an active cron automation trigger binding.
|
|
657
|
+
*
|
|
658
|
+
* Carries no workflow identity and no machine role: who reacts to a firing, and
|
|
659
|
+
* whether this host is allowed to schedule at all, are decided above this port.
|
|
660
|
+
* A provider only needs to know when to fire and how to report a firing.
|
|
661
|
+
*/
|
|
662
|
+
interface AutomationCronScheduleInput {
|
|
663
|
+
/**
|
|
664
|
+
* Canonical binding key of the requesting activation.
|
|
665
|
+
*
|
|
666
|
+
* Diagnostic identity, supplied by the trigger so a provider can attribute a
|
|
667
|
+
* schedule to the binding that owns it. Providers must not treat it as a
|
|
668
|
+
* unique index: the binding runtime may briefly hold a retiring and a fresh
|
|
669
|
+
* activation of the same key at the same time.
|
|
670
|
+
*/
|
|
671
|
+
readonly bindingKey: string;
|
|
672
|
+
/** Cron expression, e.g. `0 9 * * 1`. */
|
|
673
|
+
readonly schedule: string;
|
|
674
|
+
/** IANA timezone the expression is evaluated in. */
|
|
675
|
+
readonly timezone: string;
|
|
676
|
+
/**
|
|
677
|
+
* Reports one firing to the requesting activation.
|
|
678
|
+
* @param payload - The scheduled occurrence that fired.
|
|
679
|
+
* @returns Resolves once the firing has been dispatched.
|
|
680
|
+
*/
|
|
681
|
+
readonly emit: (payload: {
|
|
682
|
+
readonly scheduledFor: number;
|
|
683
|
+
}) => Promise<void>;
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Host-selected provider that turns cron schedules into firings.
|
|
687
|
+
*
|
|
688
|
+
* The framework ships a local, in-process provider; a host that must schedule
|
|
689
|
+
* centrally (for example through a relay) registers its own provider under
|
|
690
|
+
* {@link AutomationCronSchedulerToken} instead. Exactly one provider is active
|
|
691
|
+
* in a booted runtime.
|
|
692
|
+
*/
|
|
693
|
+
interface AutomationCronScheduler {
|
|
694
|
+
/**
|
|
695
|
+
* Registers one cron schedule.
|
|
696
|
+
* @param input - Schedule expression, timezone, owner key, and firing sink.
|
|
697
|
+
* @returns Cleanup that cancels this schedule; idempotent.
|
|
698
|
+
* @throws When the schedule expression or timezone is not valid.
|
|
699
|
+
*/
|
|
700
|
+
readonly schedule: (input: AutomationCronScheduleInput) => Promise<AutomationTriggerCleanup>;
|
|
701
|
+
}
|
|
702
|
+
/** Token for the host-selected automation cron scheduler provider. */
|
|
703
|
+
declare const AutomationCronSchedulerToken: _$_makaio_contracts0.ExtensionToken<AutomationCronScheduler>;
|
|
704
|
+
/**
|
|
705
|
+
* Rejects a schedule request whose expression or timezone cannot be evaluated.
|
|
706
|
+
*
|
|
707
|
+
* Lives beside the port rather than inside one provider because every provider
|
|
708
|
+
* owes callers the same rejection: a provider that accepts an unparseable
|
|
709
|
+
* expression — because it forwards scheduling elsewhere and only finds out later —
|
|
710
|
+
* would report a healthy binding that silently never fires, and the binding's
|
|
711
|
+
* author would learn about it from nothing. Validating against the same cron
|
|
712
|
+
* implementation the local provider runs is what makes "accepted here" mean
|
|
713
|
+
* "schedulable there".
|
|
714
|
+
*
|
|
715
|
+
* Constructs and immediately discards a paused job: croner performs its parse in
|
|
716
|
+
* the constructor, and a paused instance starts no timer, so nothing is scheduled.
|
|
717
|
+
*
|
|
718
|
+
* `nextRun()` is called for its validation rather than its value. Croner accepts
|
|
719
|
+
* an unknown timezone at construction and only rejects it when an occurrence is
|
|
720
|
+
* actually resolved, so without this call an unresolvable timezone would pass
|
|
721
|
+
* validation and instead surface later — as a raw croner error from whichever
|
|
722
|
+
* provider first tried to use it, naming neither the timezone nor the binding.
|
|
723
|
+
* @param input - Schedule request whose expression and timezone are checked.
|
|
724
|
+
* @throws When croner rejects the expression or the timezone, with the offending
|
|
725
|
+
* values and the requesting binding named.
|
|
726
|
+
*/
|
|
727
|
+
declare function assertValidCronSchedule(input: AutomationCronScheduleInput): void;
|
|
728
|
+
//#endregion
|
|
729
|
+
//#region services/core/src/automation-trigger/builtins/cron-trigger.d.ts
|
|
730
|
+
/**
|
|
731
|
+
* Creates the built-in `makaio.cron` automation trigger.
|
|
732
|
+
*
|
|
733
|
+
* The trigger owns no timers. It resolves the host-selected
|
|
734
|
+
* {@link AutomationCronScheduler} and delegates, so the same binding semantics
|
|
735
|
+
* hold whether a host schedules in-process or centrally.
|
|
736
|
+
*
|
|
737
|
+
* The binding key handed to the scheduler is the one the runtime supplies on the
|
|
738
|
+
* activation context, so a provider attributing a job to a binding names exactly
|
|
739
|
+
* what the runtime indexed it under.
|
|
740
|
+
*
|
|
741
|
+
* The scheduler is resolved through the supplied resolver at activation time
|
|
742
|
+
* rather than captured at creation time, so a provider that restarts is picked
|
|
743
|
+
* up by the next activation instead of leaving this trigger holding a dead
|
|
744
|
+
* reference.
|
|
745
|
+
* @param resolveScheduler - Resolves the currently registered provider.
|
|
746
|
+
* @returns The registry-boundary trigger type for `makaio.cron`.
|
|
747
|
+
*/
|
|
748
|
+
declare function createCronAutomationTrigger(resolveScheduler: () => AutomationCronScheduler | undefined): AutomationTriggerType;
|
|
749
|
+
//#endregion
|
|
750
|
+
//#region services/core/src/automation-trigger/cron-scheduler-selection.d.ts
|
|
751
|
+
/** Minimal package view needed to detect an already-present provider. */
|
|
752
|
+
interface CronSchedulerProviderView {
|
|
753
|
+
/** Package name; a provider registers under the scheduler token name. */
|
|
754
|
+
readonly name: string;
|
|
755
|
+
/** Human-readable name used in duplicate-provider diagnostics. */
|
|
756
|
+
readonly displayName?: string;
|
|
757
|
+
}
|
|
758
|
+
/** Inputs of one host's cron scheduler provider decision. */
|
|
759
|
+
interface AutomationCronSchedulerSelection {
|
|
760
|
+
/**
|
|
761
|
+
* Provider packages explicitly contributed by host composition seams, if any.
|
|
762
|
+
*
|
|
763
|
+
* Must register under {@link AutomationCronSchedulerToken}; a package that
|
|
764
|
+
* does not is a wiring mistake and fails boot rather than silently leaving the
|
|
765
|
+
* runtime without a scheduler.
|
|
766
|
+
*
|
|
767
|
+
* More than one entry is a composition error. The array form lets boot combine
|
|
768
|
+
* its direct host option with descriptor server-module host exports before
|
|
769
|
+
* making one deterministic provider decision.
|
|
770
|
+
*/
|
|
771
|
+
readonly hostPackages?: readonly MakaioNodeExtension<IMakaioBus>[] | undefined;
|
|
772
|
+
/**
|
|
773
|
+
* Every package the host is about to load, framework and extension alike.
|
|
774
|
+
*
|
|
775
|
+
* Scanned for provider registrations so a second provider is rejected before
|
|
776
|
+
* the coordinator starts either of them.
|
|
777
|
+
*/
|
|
778
|
+
readonly loadedPackages: readonly CronSchedulerProviderView[];
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Decides which cron scheduler provider package a host must add.
|
|
782
|
+
*
|
|
783
|
+
* Exactly one provider is active in a booted runtime:
|
|
784
|
+
*
|
|
785
|
+
* - A host that supplies one provider package uses it, and no loaded package may also
|
|
786
|
+
* register the service.
|
|
787
|
+
* - A host that supplies none uses the loaded provider when there is exactly
|
|
788
|
+
* one, and otherwise falls back to the framework's local provider — that
|
|
789
|
+
* fallback is what makes framework-only boot work with no host wiring.
|
|
790
|
+
* - Two providers, or a host package that does not register the service, fail
|
|
791
|
+
* boot with a message naming the offenders.
|
|
792
|
+
* @param selection - The host's explicit choice plus the packages being loaded.
|
|
793
|
+
* @returns The provider package to add, or `undefined` when a loaded package
|
|
794
|
+
* already provides one.
|
|
795
|
+
* @throws When a host package does not register the scheduler service, or when
|
|
796
|
+
* more than one provider would be active.
|
|
797
|
+
*/
|
|
798
|
+
declare function selectAutomationCronSchedulerPackage(selection: AutomationCronSchedulerSelection): MakaioNodeExtension<IMakaioBus> | undefined;
|
|
799
|
+
//#endregion
|
|
800
|
+
//#region services/core/src/automation-trigger/local-cron-scheduler.d.ts
|
|
801
|
+
/**
|
|
802
|
+
* In-process {@link AutomationCronScheduler} backed by croner.
|
|
803
|
+
*
|
|
804
|
+
* The default provider for hosts that schedule locally. It owns nothing but its
|
|
805
|
+
* jobs: no workflow lookup, no persistence, no machine-role decision. A host
|
|
806
|
+
* that must not schedule locally simply registers a different provider under
|
|
807
|
+
* {@link AutomationCronSchedulerToken}.
|
|
808
|
+
*
|
|
809
|
+
* Jobs are held in a set of entries rather than a map keyed by binding key,
|
|
810
|
+
* because two activations of the same key can legitimately overlap while one is
|
|
811
|
+
* retiring. Each cleanup cancels exactly the job it created, so an overlapping
|
|
812
|
+
* pair can never cancel each other's job or leak one past {@link shutdown}.
|
|
813
|
+
*/
|
|
814
|
+
declare class LocalAutomationCronScheduler implements AutomationCronScheduler {
|
|
815
|
+
/** Live jobs; entry identity is what a cleanup cancels. */
|
|
816
|
+
private readonly jobs;
|
|
817
|
+
/**
|
|
818
|
+
* Registers one cron schedule.
|
|
819
|
+
*
|
|
820
|
+
* The schedule is validated, then the croner instance is constructed, before
|
|
821
|
+
* the entry is tracked — so an invalid expression or timezone rejects without
|
|
822
|
+
* leaving a job behind. A failing `emit` is logged rather than propagated: it
|
|
823
|
+
* runs inside croner's timer callback, where an escaping rejection would become
|
|
824
|
+
* an unhandled one and could stop the job from firing again.
|
|
825
|
+
* @param input - Schedule expression, timezone, owner key, and firing sink.
|
|
826
|
+
* @returns Cleanup that cancels exactly this schedule; idempotent.
|
|
827
|
+
* @throws When croner rejects the expression or the timezone.
|
|
828
|
+
*/
|
|
829
|
+
schedule(input: AutomationCronScheduleInput): Promise<AutomationTriggerCleanup>;
|
|
830
|
+
/**
|
|
831
|
+
* Cancels every live schedule.
|
|
832
|
+
*
|
|
833
|
+
* Idempotent, and the only teardown path a host needs: the scheduler holds no
|
|
834
|
+
* other resources.
|
|
835
|
+
*/
|
|
836
|
+
shutdown(): Promise<void>;
|
|
837
|
+
/**
|
|
838
|
+
* Cancels every live schedule on service teardown.
|
|
839
|
+
*
|
|
840
|
+
* Delegates to {@link shutdown}; exists so the scheduler satisfies the
|
|
841
|
+
* `ExtensionServiceLifecycle` contract and the coordinator can call
|
|
842
|
+
* `service.destroy?.()` on package teardown.
|
|
843
|
+
* @returns Resolves once every job has been cancelled.
|
|
844
|
+
*/
|
|
845
|
+
destroy(): Promise<void>;
|
|
846
|
+
/**
|
|
847
|
+
* Number of live schedules.
|
|
848
|
+
* @returns Count of jobs currently registered.
|
|
849
|
+
*/
|
|
850
|
+
activeScheduleCount(): number;
|
|
851
|
+
/**
|
|
852
|
+
* Builds the croner job for one schedule request.
|
|
853
|
+
*
|
|
854
|
+
* `scheduledFor` is the **scheduled occurrence**, not the moment the callback
|
|
855
|
+
* ran. Croner's `currentRun()` is the wall clock captured when it entered the
|
|
856
|
+
* callback, so a busy event loop would report a drifted minute and every
|
|
857
|
+
* consumer of the payload would inherit that drift. The occurrence is therefore
|
|
858
|
+
* tracked here: seeded from the job's next run before it can fire, and rolled
|
|
859
|
+
* forward inside the callback, where `nextRun()` already reports the occurrence
|
|
860
|
+
* after the one being served.
|
|
861
|
+
*
|
|
862
|
+
* Infallible by precondition: the caller already ran
|
|
863
|
+
* {@link assertValidCronSchedule} against the same expression and timezone, so
|
|
864
|
+
* the construction below cannot reject them.
|
|
865
|
+
* @param input - The schedule request being registered.
|
|
866
|
+
* @returns A started croner instance.
|
|
867
|
+
*/
|
|
868
|
+
private createJob;
|
|
869
|
+
}
|
|
870
|
+
/**
|
|
871
|
+
* Package registering the in-process cron scheduler provider.
|
|
872
|
+
*
|
|
873
|
+
* The default choice for framework-only boots. A host replaces it by supplying
|
|
874
|
+
* its own provider package for {@link AutomationCronSchedulerToken}; exactly one
|
|
875
|
+
* provider may be registered in a booted runtime.
|
|
876
|
+
*/
|
|
877
|
+
declare const localAutomationCronSchedulerPackage: MakaioNodeExtension<IMakaioBus>;
|
|
878
|
+
//#endregion
|
|
879
|
+
//#region services/core/src/automation-trigger/builtins/package.d.ts
|
|
880
|
+
/**
|
|
881
|
+
* Owner name of the framework's built-in automation triggers.
|
|
882
|
+
*
|
|
883
|
+
* Deliberately the bare `makaio` namespace: the registry requires every trigger
|
|
884
|
+
* kind to be prefixed with its owner, and the built-in kinds are canonically
|
|
885
|
+
* `makaio.bus-event` and `makaio.cron`. Registering them under the same `makaio`
|
|
886
|
+
* owner keeps the owner/kind invariant in force for built-ins instead of
|
|
887
|
+
* carving out an exception for them.
|
|
888
|
+
*/
|
|
889
|
+
declare const AUTOMATION_TRIGGER_BUILTINS_OWNER = "makaio";
|
|
890
|
+
/**
|
|
891
|
+
* Package contributing the framework's built-in automation triggers.
|
|
892
|
+
*
|
|
893
|
+
* Contributes through the ordinary `automationTriggers` surface, so built-ins
|
|
894
|
+
* take exactly the same registration, replay, and teardown path as any
|
|
895
|
+
* extension-contributed trigger. Each trigger captures what it needs from the
|
|
896
|
+
* contribution context at creation time — the bus for `makaio.bus-event`, a lazy
|
|
897
|
+
* scheduler resolver for `makaio.cron` — so the activation context stays free of
|
|
898
|
+
* host wiring.
|
|
899
|
+
*
|
|
900
|
+
* The dependency on the cron scheduler provider is declared **optional**, which
|
|
901
|
+
* buys start ordering without a disable refusal: a provider present in the
|
|
902
|
+
* composition is started before these built-ins, so the first reconciliation that
|
|
903
|
+
* activates a stored `makaio.cron` binding already finds it — a host that lists
|
|
904
|
+
* its provider after this package would otherwise leave those bindings
|
|
905
|
+
* unavailable with no further signal to retry on. When no provider is composed at
|
|
906
|
+
* all the built-ins still register, and a `makaio.cron` activation then fails with
|
|
907
|
+
* a message naming the missing service, which keeps `makaio.bus-event` available
|
|
908
|
+
* to a host whose scheduler is degraded.
|
|
909
|
+
*/
|
|
910
|
+
declare const automationTriggerBuiltinsPackage: MakaioNodeExtension<IMakaioBus>;
|
|
911
|
+
//#endregion
|
|
912
|
+
//#region services/core/src/automation-trigger/automation-trigger-contribution-processor.d.ts
|
|
913
|
+
/** Runtime hooks used to replay contributions after registry/runtime activation. */
|
|
914
|
+
interface AutomationTriggerContributionProcessorOptions {
|
|
915
|
+
/**
|
|
916
|
+
* Enumerate active extensions in dependency order.
|
|
917
|
+
*
|
|
918
|
+
* The registry and the binding runtime can both be enabled after an extension
|
|
919
|
+
* contributing automation triggers is already active, so those active
|
|
920
|
+
* contributors are replayed after either one starts.
|
|
921
|
+
* @param callback - Called for each active extension and its context.
|
|
922
|
+
*/
|
|
923
|
+
readonly forEachActiveExtension: (callback: (name: string, pkg: KernelMakaioExtension, ctx: KernelExtensionContext) => void) => void;
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* Processes AutomationTrigger contributions from extensions.
|
|
927
|
+
*
|
|
928
|
+
* Calls each extension's `automationTriggers.createAutomationTriggers(ctx)`
|
|
929
|
+
* factory during activation and registers the returned definitions with the
|
|
930
|
+
* `AutomationTriggerRegistry` under the extension name; deregisters them and
|
|
931
|
+
* tears down their active bindings via
|
|
932
|
+
* {@link AutomationTriggerBindingRuntime.stopOwner} when the extension stops.
|
|
933
|
+
*
|
|
934
|
+
* Contributor activation is atomic: if `createAutomationTriggers` or the
|
|
935
|
+
* registry replacement throws, the existing registration and its cleanup remain
|
|
936
|
+
* intact. Ownership bookkeeping across restarts lives in
|
|
937
|
+
* {@link AutomationTriggerContributionOwnership}.
|
|
938
|
+
* @param options - Runtime hooks used for late registry-owner activation.
|
|
939
|
+
* @returns Contribution processor that manages AutomationTrigger registration.
|
|
940
|
+
*/
|
|
941
|
+
declare function createAutomationTriggerContributionProcessor(options: AutomationTriggerContributionProcessorOptions): ContributionProcessor;
|
|
942
|
+
//#endregion
|
|
943
|
+
export { AUTOMATION_TRIGGER_BUILTINS_OWNER, type AutomationCronScheduleInput, type AutomationCronScheduler, type AutomationCronSchedulerSelection, AutomationCronSchedulerToken, AutomationTriggerBindingRuntime, AutomationTriggerBindingRuntimeToken, type AutomationTriggerContributionProcessorOptions, AutomationTriggerRegistry, AutomationTriggerRegistryToken, type AutomationTriggerResolver, LocalAutomationCronScheduler, type PreparedAutomationTriggerBinding, assertValidCronSchedule, automationTriggerBindingRuntimePackage, automationTriggerBuiltinsPackage, automationTriggerRegistryPackage, busBackedAutomationTriggers, canonicalizeJsonRecord, createAutomationTriggerContributionProcessor, createBusEventAutomationTrigger, createCanonicalBindingKey, createCronAutomationTrigger, localAutomationCronSchedulerPackage, selectAutomationCronSchedulerPackage };
|