@makaio/framework 1.0.0-dev-1789609124644 → 1.0.0-dev-1790066089222
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.makaio-build.json +2 -2
- package/dist/{adapter-C4v_gNTI.mjs → adapter-DSRgsh2d.mjs} +1 -1
- package/dist/adapter-subsystem/index.d.mts +15 -7
- package/dist/adapter-subsystem/index.mjs +1 -1
- package/dist/adapters/claude/index.mjs +3 -3
- package/dist/adapters/config/index.d.mts +1 -1
- package/dist/adapters/index.d.mts +2 -2
- package/dist/adapters/node.d.mts +1 -1
- package/dist/{attempt-record-codec-DaQ3WHUs.mjs → attempt-record-codec-DXpdMgyI.mjs} +1 -1
- package/dist/bus/index.d.mts +120 -8
- package/dist/bus/index.mjs +1 -1
- package/dist/bus-ceMF9rsq.mjs +9 -0
- package/dist/client-DWSwtFyI.mjs +1 -0
- package/dist/clients/index.d.mts +179 -12
- package/dist/clients/index.mjs +1 -1
- package/dist/clients/managed-install.d.mts +1 -1
- package/dist/code-execution/worker-entry.d.mts +1 -1
- package/dist/code-execution/worker-entry.mjs +1 -1
- package/dist/{code-execution-pUF4IO462.mjs → code-execution-DWSux6k1.mjs} +1 -1
- package/dist/contracts/adapter/index.d.mts +2 -2
- package/dist/contracts/adapter/index.mjs +1 -1
- package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
- package/dist/contracts/artifact/index.d.mts +2 -2
- package/dist/contracts/auth/index.d.mts +2 -2
- package/dist/contracts/automation-trigger/index.d.mts +3 -3
- package/dist/contracts/canonical-model/index.d.mts +1 -1
- package/dist/contracts/capabilities/index.d.mts +1 -1
- package/dist/contracts/client/index.d.mts +3 -3
- package/dist/contracts/client/index.mjs +1 -1
- package/dist/contracts/code-execution/index.d.mts +1 -1
- package/dist/contracts/common/index.d.mts +1 -1
- package/dist/contracts/config/index.d.mts +2 -47
- package/dist/contracts/context-projection/index.d.mts +232 -0
- package/dist/contracts/context-projection/index.mjs +1 -0
- package/dist/contracts/extension/index.d.mts +6 -6
- package/dist/contracts/extension/index.mjs +1 -1
- package/dist/contracts/facet/index.d.mts +1 -1
- package/dist/contracts/harness/index.d.mts +1 -1
- package/dist/contracts/host/index.d.mts +1 -1
- package/dist/contracts/index.d.mts +43 -43
- package/dist/contracts/index.mjs +1 -1
- package/dist/contracts/materialization/index.d.mts +2 -2
- package/dist/contracts/model-registry/index.d.mts +1 -1
- package/dist/contracts/native-session-supervisor/index.d.mts +1 -1
- package/dist/contracts/platform/index.d.mts +1 -1
- package/dist/contracts/provider/index.d.mts +2 -2
- package/dist/contracts/reaction/index.d.mts +1 -1
- package/dist/contracts/session/index.d.mts +3 -3
- package/dist/contracts/session/index.mjs +1 -1
- package/dist/contracts/shared/index.d.mts +2 -2
- package/dist/contracts/skill/index.d.mts +1 -1
- package/dist/contracts/telemetry/index.d.mts +1 -1
- package/dist/contracts/timeout/index.d.mts +1 -1
- package/dist/contracts/variant/index.d.mts +1 -1
- package/dist/contracts/worker/index.d.mts +2 -2
- package/dist/contracts/workflow/index.d.mts +2 -2
- package/dist/{contribution-DDbHzCPF.d.mts → contribution-1GL7Rjaq.d.mts} +2 -2
- package/dist/credential-ref-w4ZYpYW0.d.mts +49 -0
- package/dist/{definition-CuaBQyde.d.mts → definition-DeIGoROj.d.mts} +1 -1
- package/dist/{descriptor-to-package-Dw8dnl5E.mjs → descriptor-to-package-BPIArq6N.mjs} +1 -1
- package/dist/{detached-extension-handle-DN3aqLyq.mjs → detached-extension-handle-W5_yfCyE.mjs} +1 -1
- package/dist/drizzle/0040_session_generation.sql +1 -0
- package/dist/drizzle/0041_session_principal_owner.sql +1 -0
- package/dist/drizzle/meta/_journal.json +14 -0
- package/dist/{execution-attempt-owner-recovery-CE_rvHKE.mjs → execution-attempt-owner-recovery-BZOEVYFH.mjs} +1 -1
- package/dist/extension-C6ANjR33.mjs +1 -0
- package/dist/{extension-context-BH31eOMv.d.mts → extension-context-pQ7Uio_s.d.mts} +44 -1
- package/dist/{extension-discovery-CA2IhDRo.d.mts → extension-discovery-Rup-gANp.d.mts} +114 -15
- package/dist/extension-kOwzAMud.mjs +1 -0
- package/dist/extension-namespace-CeRpt6C8.mjs +1 -0
- package/dist/{framework-packages-Bg4edkkM.mjs → framework-packages-U4Xhouxe.mjs} +1 -1
- package/dist/{hook-responses-Dq16X3Cb.d.mts → hook-responses-B882RcQc.d.mts} +48 -5
- package/dist/{index-Dm3d490n.d.mts → index-B2bxgKiK.d.mts} +1 -1
- package/dist/{index-7CVumCjj.d.mts → index-BTpkpHIS.d.mts} +65 -9
- package/dist/{index-Bh57xARQ.d.mts → index-BUv9gfRT.d.mts} +3 -3
- package/dist/{index-C6e9cwAl2.d.mts → index-BjQtqMxP2.d.mts} +4 -4
- package/dist/{index-B-u0Tu8X.d.mts → index-Bqi44ODz.d.mts} +37 -37
- package/dist/{index-CIzvBH8O.d.mts → index-C8two8wz.d.mts} +1 -1
- package/dist/{index-oxZt93RL.d.mts → index-CESqYf8a.d.mts} +2 -2
- package/dist/{index-C87P0WpY2.d.mts → index-CmCLAMNs.d.mts} +1 -1
- package/dist/index-CyEE1RI5.d.mts +869 -0
- package/dist/{index-De_oh9M-2.d.mts → index-D6Uq1btG.d.mts} +87 -10
- package/dist/{index-CRZ1jrxp.d.mts → index-DDSt0uS2.d.mts} +160 -12
- package/dist/{index-B6WkHnCQ.d.mts → index-DRxgmrad.d.mts} +1 -1
- package/dist/{index-U--ajOHy.d.mts → index-DUYjTfHD.d.mts} +1 -1
- package/dist/{index-HJkz7i4E.d.mts → index-DdJKsdya.d.mts} +188 -10
- package/dist/{index-B4pPwpKk.d.mts → index-DfREUyAk.d.mts} +1 -1
- package/dist/{index-ClKwF6LE.d.mts → index-Di-R1gmo.d.mts} +2 -2
- package/dist/{index-DWANFpTG.d.mts → index-Jdju2W3y.d.mts} +1 -1
- package/dist/{index-DQKVQPUS.d.mts → index-L6mssyeZ.d.mts} +1 -1
- package/dist/{index-B8v1-2-V2.d.mts → index-anIxF_eT.d.mts} +1 -1
- package/dist/{index-iVisrVdC2.d.mts → index-bYBnDBl32.d.mts} +539 -4
- package/dist/{index-Bg3WVL8n.d.mts → index-gNdH1F6r.d.mts} +531 -26
- package/dist/{index-zmDRR8gv2.d.mts → index-m5ZQFglW2.d.mts} +1 -1
- package/dist/{index-mTaFX2HH2.d.mts → index-uk8icWON2.d.mts} +419 -19
- package/dist/kernel/cli/index.d.mts +2 -2
- package/dist/kernel/cli/register.d.mts +1 -1
- package/dist/kernel/extension/index.d.mts +3 -2
- package/dist/kernel/extension/index.mjs +1 -1
- package/dist/kernel/index.d.mts +6 -6
- package/dist/kernel/index.mjs +1 -1
- package/dist/kernel/namespace/index.d.mts +1 -1
- package/dist/kernel/observability/index.d.mts +2 -2
- package/dist/kernel/observability/index.mjs +1 -1
- package/dist/kernel/providers/index.d.mts +1 -1
- package/dist/kernel/window/index.d.mts +1 -1
- package/dist/{lib-BF5XBSfw.mjs → lib-BdyGVjpO.mjs} +1 -1
- package/dist/{lib-Dljw2Cqh.mjs → lib-DxP3tPm9.mjs} +1 -1
- package/dist/load-extensions-BGfSWW_R.mjs +1 -0
- package/dist/{load-extensions-DGstT4_p.d.mts → load-extensions-Be_lOjm_.d.mts} +27 -14
- package/dist/mcp-http-server/index.mjs +1 -1
- package/dist/{namespace-BMdYJN_t.mjs → namespace-CqJhR19O.mjs} +1 -1
- package/dist/{namespace-Cmu-5_P9.d.mts → namespace-DudchWPb.d.mts} +457 -0
- package/dist/{namespace-BEbQb19g.d.mts → namespace-Eir1wQ_r.d.mts} +2 -2
- package/dist/node/bus-server/index.d.mts +1 -1
- package/dist/node/bus-server/server-lifecycle.d.mts +1 -1
- package/dist/node/transports/index.d.mts +102 -4
- package/dist/node/transports/index.mjs +2 -2
- package/dist/{orchestrator-shared-CtPB6PAr.mjs → orchestrator-shared-CF-jPH91.mjs} +1 -1
- package/dist/ownership-memory-handler-C-y9zQf8.mjs +1 -0
- package/dist/package-AlsbnlSt.mjs +159 -0
- package/dist/{package-CDj3F-L3.d.mts → package-CwyC-Krg.d.mts} +1 -1
- package/dist/{package-DYScYC0D.mjs → package-kkPGlxMm.mjs} +1 -1
- package/dist/package.json +1 -1
- package/dist/{registry-DNMjJ-Oj.mjs → registry-DtaRGU8i.mjs} +1 -0
- 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.d.mts +2 -2
- package/dist/runtime-bun/index.mjs +1 -1
- package/dist/runtime-node/boot-config.d.mts +45 -0
- package/dist/runtime-node/boot-config.mjs +1 -0
- package/dist/runtime-node/code-execution/index.d.mts +2 -2
- package/dist/runtime-node/code-execution/index.mjs +1 -1
- package/dist/runtime-node/extension-discovery.d.mts +2 -2
- package/dist/runtime-node/extension-discovery.mjs +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 +345 -27
- package/dist/runtime-node/index.mjs +21 -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-BA1cHBbc.d.mts → schema-FY0EakKe.d.mts} +56 -0
- package/dist/schemas-CkxAK13D.mjs +1 -0
- package/dist/{schemas-CaYEFzK_.d.mts → schemas-FgVQek-j.d.mts} +2 -2
- package/dist/services/adapter-runtime/index.d.mts +3 -3
- 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 +3 -3
- package/dist/services/adapter-subsystem/namespace.d.mts +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 +19 -0
- package/dist/services/capability/index.d.mts +2 -2
- package/dist/services/code-execution/index.d.mts +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-projection/index.d.mts +94 -0
- package/dist/services/context-projection/index.mjs +1 -0
- package/dist/services/context-rules/index.d.mts +1 -1
- package/dist/services/execution-target/index.d.mts +3 -3
- package/dist/services/execution-target/namespace.d.mts +1 -1
- package/dist/services/execution-target/schemas.d.mts +1 -1
- package/dist/services/filesystem/index.d.mts +1 -1
- package/dist/services/index.d.mts +45 -40
- package/dist/services/index.mjs +1 -1
- package/dist/services/log-import/browser.d.mts +2 -2
- package/dist/services/log-import/index.d.mts +2 -2
- package/dist/services/log-import/log-import.d.mts +1 -1
- package/dist/services/materialization/index.d.mts +1 -1
- package/dist/services/model-registry/index.d.mts +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/session/handlers/index.d.mts +1 -1
- package/dist/services/session/index.d.mts +9 -9
- package/dist/services/session/index.mjs +1 -1
- package/dist/services/session/messages/namespace.d.mts +1 -1
- package/dist/services/session/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/storage/namespace.d.mts +1 -1
- package/dist/services/session/storage/schema.d.mts +1 -1
- package/dist/services/session/storage/schema.mjs +1 -1
- package/dist/services/session/testing/index.mjs +4 -2
- 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-editor/index.d.mts +1 -1
- package/dist/services/settings/index.d.mts +3 -3
- package/dist/services/settings/namespace.d.mts +232 -3
- package/dist/services/settings/namespace.mjs +1 -1
- package/dist/services/settings/storage/clients-namespace.d.mts +1 -1
- package/dist/services/settings/storage/index.d.mts +3 -3
- package/dist/services/settings/storage/providers-namespace.d.mts +1 -1
- package/dist/services/subagent/index.d.mts +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/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-BNiMZnfF.mjs +1 -0
- package/dist/session-CMbztxNO.mjs +95 -0
- package/dist/src-BZdw54VU.mjs +1 -0
- package/dist/{src-CbAw9kjJ.mjs → src-C0sw_Vs_.mjs} +1 -1
- package/dist/{src-Xn6SS74f.mjs → src-CqQSqLQI.mjs} +1 -1
- package/dist/storage/drizzle/client.d.mts +1 -1
- package/dist/storage/drizzle/client.mjs +1 -1
- package/dist/storage/drizzle/index.d.mts +1 -1
- package/dist/storage/drizzle/index.mjs +1 -1
- package/dist/storage/handlers/drizzle/index.d.mts +1 -1
- package/dist/storage/handlers/index.d.mts +1 -1
- package/dist/{tool-approval-service-pbkGcAV8.mjs → tool-approval-service-CRo3fZRF.mjs} +1 -1
- package/dist/{tools-C5Gy0IQG.mjs → tools-CKaxi3Mb.mjs} +1 -1
- package/dist/{transition-D-Lgbp1j.d.mts → transition-DMv8cgEd.d.mts} +2 -2
- package/dist/{types-CjYcHDPo2.d.mts → types-7L3BrU9m2.d.mts} +1 -1
- package/dist/{types-DhbllltK.d.mts → types-DNYO_Rxj.d.mts} +12 -3
- package/dist/ui-hooks/index.d.mts +17 -24
- package/dist/ui-hooks/index.mjs +1 -1
- package/dist/ui-kernel/index.d.mts +11 -2
- package/dist/ui-kernel/index.mjs +1 -1
- package/dist/ui-kernel/pages/schemas.d.mts +1 -1
- package/dist/ui-views/index.mjs +1 -1
- package/dist/utils/index.d.mts +31 -1
- package/dist/utils/index.mjs +2 -2
- package/dist/{view-builder-CHUTXJDl.d.mts → view-builder-DJGz9I-u.d.mts} +2 -2
- package/dist/workflow-engine/execution-attempt-repository.d.mts +1 -1
- package/dist/workflow-engine/execution-attempt-repository.mjs +1 -1
- package/dist/workflow-engine/index.d.mts +2 -2
- 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/conformance.d.mts +1 -1
- package/dist/workflow-engine/testing/conformance.mjs +1 -1
- package/dist/workflow-engine/testing/index.d.mts +1 -1
- 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 +1 -1
- package/dist/workflow-engine/workflow-orchestrator.mjs +1 -1
- package/dist/{workflow-transitions-C0sg3kar.mjs → workflow-transitions-t0ORS1F5.mjs} +1 -1
- package/dist/workflow-worker-DXCXb3g-.mjs +3 -0
- package/package.json +9 -1
- package/dist/bus-BQ64i3DN.mjs +0 -9
- package/dist/client-Bg3_IdaF.mjs +0 -1
- package/dist/extension-CfrTp3rC.mjs +0 -1
- package/dist/extension-CnNcY1hR.mjs +0 -1
- package/dist/extension-namespace-Ct9L6SKr.mjs +0 -1
- package/dist/index-D_j_T3nS.d.mts +0 -435
- package/dist/load-extensions-BVgxTj_y.mjs +0 -1
- package/dist/ownership-memory-handler-xex7sLiX.mjs +0 -1
- package/dist/schemas-ClkcU_N5.mjs +0 -1
- package/dist/session-6UG5udTX.mjs +0 -95
- package/dist/session-BB0s7c2B.mjs +0 -1
- package/dist/workflow-worker-ChrMIcKm.mjs +0 -2
- /package/dist/{adapter-binding-BxjUfkOn.d.mts → adapter-binding-CaYBrIkL.d.mts} +0 -0
- /package/dist/{attempt-control-evidence-7lwRG73Y.mjs → attempt-control-evidence-CHBnJoqN.mjs} +0 -0
- /package/dist/{attempt-fixtures-DHdYmr3o.mjs → attempt-fixtures-D3IsP0KH.mjs} +0 -0
- /package/dist/{authority-state-bootstrap-CvuWPywM.mjs → authority-state-bootstrap-4F5Wc_6l.mjs} +0 -0
- /package/dist/{base-orchestrator-CrXiMJzf.d.mts → base-orchestrator-1ofFsqUz.d.mts} +0 -0
- /package/dist/{bootstrap-start-client-C1ZHbv6e.mjs → bootstrap-start-client-9nOdeDYl.mjs} +0 -0
- /package/dist/{capability-service-CQ1aw_p-.d.mts → capability-service-CUN0MIS7.d.mts} +0 -0
- /package/dist/{client-ByjHcS78.d.mts → client-BY3sBW2L.d.mts} +0 -0
- /package/dist/{client-binary-version-verifier-C4fEAUdo.d.mts → client-binary-version-verifier-BeO4Eptw.d.mts} +0 -0
- /package/dist/{clients-namespace-D4BxF2Nw.d.mts → clients-namespace-D92YsbKI.d.mts} +0 -0
- /package/dist/{config-namespace-B1zyOYwH.d.mts → config-namespace-OEckUfVE.d.mts} +0 -0
- /package/dist/{create-static-mount-Dgxgi4W3.mjs → create-static-mount-4B-mNtx1.mjs} +0 -0
- /package/dist/{cross-spawn-BMCAyqrN.mjs → cross-spawn-DGqEuNyT.mjs} +0 -0
- /package/dist/{definition-ClWxAKQ2.d.mts → definition-DLJg-P4G.d.mts} +0 -0
- /package/dist/{esm-Ccx-3z8E.mjs → esm-DwiWcwH0.mjs} +0 -0
- /package/dist/{execution-attempt-repository-aabFKcXN.mjs → execution-attempt-repository-CY289HlC.mjs} +0 -0
- /package/dist/{execution-attempt-repository-BUah8hma.d.mts → execution-attempt-repository-DOb5V4N2.d.mts} +0 -0
- /package/dist/{extension-package-provenance-C7oO5JAE.mjs → extension-package-provenance-ClpN3GHp.mjs} +0 -0
- /package/dist/{filesystem-service-CDYoiwWY.d.mts → filesystem-service-BmavE-uO.d.mts} +0 -0
- /package/dist/{index-BbkcbY6d.d.mts → index--gbsE1W0.d.mts} +0 -0
- /package/dist/{index-DdVpWkaI.d.mts → index-B36rL4gp.d.mts} +0 -0
- /package/dist/{index-DM72_93s.d.mts → index-BD1SbHpP.d.mts} +0 -0
- /package/dist/{index-KdlZRuTp.d.mts → index-BDcK7jqJ2.d.mts} +0 -0
- /package/dist/{index-DAaQ--ki.d.mts → index-BQYGOXY5.d.mts} +0 -0
- /package/dist/{index-gAyARaKS.d.mts → index-BneZFJ7x.d.mts} +0 -0
- /package/dist/{index-D8ELwT5y.d.mts → index-BujgCaKt.d.mts} +0 -0
- /package/dist/{index-DfU8s_xP.d.mts → index-C2StVLk4.d.mts} +0 -0
- /package/dist/{index-BGnQ0EyD.d.mts → index-CCTzitBA.d.mts} +0 -0
- /package/dist/{index-CVRT01082.d.mts → index-Cj_V1aRL.d.mts} +0 -0
- /package/dist/{index-nkix3hP7.d.mts → index-CpN2C9jq.d.mts} +0 -0
- /package/dist/{index-D6p17KPs.d.mts → index-CsRPJ9FV.d.mts} +0 -0
- /package/dist/{index-BPNfYEA22.d.mts → index-CvdvuhTL2.d.mts} +0 -0
- /package/dist/{index-DmX9W3xH2.d.mts → index-D3peNmHN2.d.mts} +0 -0
- /package/dist/{index-DiZ4LmyE.d.mts → index-D7smT-YD.d.mts} +0 -0
- /package/dist/{index-B78CRVi9.d.mts → index-DEx4ZFkz.d.mts} +0 -0
- /package/dist/{index-CjDQn6lw.d.mts → index-DGoJayJg.d.mts} +0 -0
- /package/dist/{index-F7cVpFJ9.d.mts → index-DTvYp2GT.d.mts} +0 -0
- /package/dist/{index-Htfr-K5U2.d.mts → index-DqliLe_D2.d.mts} +0 -0
- /package/dist/{index-BCU5oByg.d.mts → index-DubyRZD9.d.mts} +0 -0
- /package/dist/{index-DjSUOMlr.d.mts → index-DwOpaQAE.d.mts} +0 -0
- /package/dist/{index-BZoOYV-y.d.mts → index-DxkSkszz.d.mts} +0 -0
- /package/dist/{index-tbjIqwa3.d.mts → index-TBJ1kIGA.d.mts} +0 -0
- /package/dist/{index-DXQTkwLB.d.mts → index-YOXWpZAS.d.mts} +0 -0
- /package/dist/{index-CXpgL3gz2.d.mts → index-aIJ7A4DC2.d.mts} +0 -0
- /package/dist/{index-D6liU_KS.d.mts → index-fxh7TB0q.d.mts} +0 -0
- /package/dist/{index-xsaaa85T.d.mts → index-qczb9Yx3.d.mts} +0 -0
- /package/dist/{index-C_kOkO3E.d.mts → index-zqo2mX_Z.d.mts} +0 -0
- /package/dist/{json-value-Ymw2f8i_.d.mts → json-value-Bjl8jzom.d.mts} +0 -0
- /package/dist/{jsonl-transport-Bg033Ng0.mjs → jsonl-transport-Ct1RWs0h.mjs} +0 -0
- /package/dist/{lib-BizqbepU.mjs → lib-DomKag_k.mjs} +0 -0
- /package/dist/{namespace-rJ3ycPMg.d.mts → namespace-Bhx72V7S.d.mts} +0 -0
- /package/dist/{namespace-BCVKdu-U.d.mts → namespace-CxEQv9iZ.d.mts} +0 -0
- /package/dist/{namespace-COHHDh2I.d.mts → namespace-D09uQ231.d.mts} +0 -0
- /package/dist/{namespace-UFcDEBJB.d.mts → namespace-D5DkpaaN.d.mts} +0 -0
- /package/dist/{namespace-CvK86QFk.d.mts → namespace-DHLwz4o3.d.mts} +0 -0
- /package/dist/{namespace-B5IFLQc-.d.mts → namespace-DHbrNQYD.d.mts} +0 -0
- /package/dist/{namespace-s0e215xO.d.mts → namespace-DyD06b5-.d.mts} +0 -0
- /package/dist/{namespace-C1pPZKtI.d.mts → namespace-Dz5_Hrz7.d.mts} +0 -0
- /package/dist/{namespace-Phxf0Lep.d.mts → namespace-Lkv2nyzb.d.mts} +0 -0
- /package/dist/{namespace-DM5vykb7.d.mts → namespace-hlhPqSsw.d.mts} +0 -0
- /package/dist/{namespace-DlOQmhgX.d.mts → namespace-x-gk5SmK.d.mts} +0 -0
- /package/dist/{namespace-f6Kz5cwX.d.mts → namespace-zusFEJPh.d.mts} +0 -0
- /package/dist/{orchestrator-shared--srEeSaY.d.mts → orchestrator-shared-ChU5qRSe.d.mts} +0 -0
- /package/dist/{packages-B98-WETs.d.mts → packages-D2s51nGU.d.mts} +0 -0
- /package/dist/{providers-namespace-DRcl03bo.d.mts → providers-namespace-BLVt8OyP.d.mts} +0 -0
- /package/dist/{runtime-inputs-DBtVIy9h.d.mts → runtime-inputs-BU_kBrP7.d.mts} +0 -0
- /package/dist/{schemas-CEJe8O6P.d.mts → schemas-3KTmPuZg.d.mts} +0 -0
- /package/dist/{schemas-D_-iXLQ9.d.mts → schemas-B-5_Dp4_.d.mts} +0 -0
- /package/dist/{schemas-CeItAAQM.d.mts → schemas-BLxdGZkr.d.mts} +0 -0
- /package/dist/{schemas-Cj6Gbqch.d.mts → schemas-BegArpU_.d.mts} +0 -0
- /package/dist/{schemas-Ca5RILd-2.d.mts → schemas-BzB6z9oX2.d.mts} +0 -0
- /package/dist/{schemas-CtzZDp29.d.mts → schemas-CBBzvIh0.d.mts} +0 -0
- /package/dist/{schemas-Cq1d5tid.d.mts → schemas-CD3Mq-jC.d.mts} +0 -0
- /package/dist/{schemas-LiiyNNpr.d.mts → schemas-Cl7fPlRv.d.mts} +0 -0
- /package/dist/{schemas-DJ2vMsgm.d.mts → schemas-CqawCYTY.d.mts} +0 -0
- /package/dist/{schemas-2_D4iVbb.d.mts → schemas-DEg6R9ph.d.mts} +0 -0
- /package/dist/{schemas-JjyFxrC0.d.mts → schemas-rMUsvzeJ.d.mts} +0 -0
- /package/dist/{server-lifecycle-DUKp1Fbf.d.mts → server-lifecycle-CTJvpdeL.d.mts} +0 -0
- /package/dist/{session-lineage-C3myyt5x.d.mts → session-lineage-BuGN3RZs.d.mts} +0 -0
- /package/dist/{storage-namespace-IvLOIP7j.d.mts → storage-namespace-B5r_ScUz.d.mts} +0 -0
- /package/dist/{storage-namespace-definition-Cv0XiTXb.d.mts → storage-namespace-definition-DiYr8UNl.d.mts} +0 -0
- /package/dist/{types-hkExapGH.d.mts → types-BSx8YYlc.d.mts} +0 -0
- /package/dist/{types-BYEybzjX.d.mts → types-CpEoQapk.d.mts} +0 -0
- /package/dist/{types-QRSc2AUU.d.mts → types-Cuhnt15L.d.mts} +0 -0
- /package/dist/{types-QsyX4H21.d.mts → types-DEGuc-fn.d.mts} +0 -0
- /package/dist/{types-BRM1AZaP.d.mts → types-DciLiPMd.d.mts} +0 -0
- /package/dist/{types-CsmvIK25.mjs → types-wwuw7RkB.mjs} +0 -0
- /package/dist/{window-registry-DeG37kt8.d.mts → window-registry-C3W2wtlX.d.mts} +0 -0
|
@@ -0,0 +1,869 @@
|
|
|
1
|
+
import { i as CliContribution } from "./types-Cuhnt15L.mjs";
|
|
2
|
+
import { a as InstalledExtensionRecord, d as TransitionOutcome, l as SetEnabledReason, v as ExtensionInfo } from "./index-uk8icWON2.mjs";
|
|
3
|
+
import { r as WindowRegistry } from "./window-registry-C3W2wtlX.mjs";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { MakaioError } from "@makaio/framework/core";
|
|
6
|
+
import { ExtensionContributionProcessor, ExtensionOperatorConfigEntry, ExtensionOperatorConfigSource, ExtensionService, ExtensionToken, MakaioExtension, NodeExtensionContext, StorageDialect, TrayManifest, VersionLiteral } from "@makaio/framework/contracts";
|
|
7
|
+
import { IMakaioBus } from "@makaio/framework/bus";
|
|
8
|
+
|
|
9
|
+
//#region packages/kernel/src/extension/types.d.ts
|
|
10
|
+
/**
|
|
11
|
+
* Host-supplied reader for the extension packages installed on the machine
|
|
12
|
+
* running this coordinator.
|
|
13
|
+
*
|
|
14
|
+
* The coordinator only knows the packages it loaded, which is a strictly
|
|
15
|
+
* smaller set than what is installed: surface affinity, unmet requirements, or
|
|
16
|
+
* boot-time suppression all leave an installed package unloaded, and its
|
|
17
|
+
* enablement preference is still addressable. Discovering the rest means
|
|
18
|
+
* scanning the host's install tiers and importing extension code, neither of
|
|
19
|
+
* which belongs in the kernel — so the composition root supplies it here, the
|
|
20
|
+
* same way it supplies the durable enablement store's read/write callbacks.
|
|
21
|
+
*
|
|
22
|
+
* Called on demand (`kernel:extension.catalog`, and the validation
|
|
23
|
+
* `kernel:extension.setEnabled` performs for a name this coordinator never
|
|
24
|
+
* loaded), never during boot, and never on a hot path. Implementations are
|
|
25
|
+
* expected to be slow — they spawn imports — and must resolve rather than
|
|
26
|
+
* reject for an individual unreadable package, reporting it as
|
|
27
|
+
* `criticalityUnknown` instead.
|
|
28
|
+
* @returns Every installed executable extension package, one record per
|
|
29
|
+
* executable package name, in discovery-tier priority order.
|
|
30
|
+
*/
|
|
31
|
+
type InstalledExtensionCatalogSource = () => Promise<readonly InstalledExtensionRecord[]>;
|
|
32
|
+
/** Concrete Node runtime context supplied by the kernel coordinator. */
|
|
33
|
+
type KernelExtensionContext = NodeExtensionContext<IMakaioBus>;
|
|
34
|
+
/** Concrete executable extension shape loaded by the kernel coordinator. */
|
|
35
|
+
type KernelMakaioExtension = MakaioExtension<KernelExtensionContext>;
|
|
36
|
+
/** Awaited contribution processor registered with the {@link ExtensionCoordinator}. */
|
|
37
|
+
type ContributionProcessor = ExtensionContributionProcessor<KernelExtensionContext>;
|
|
38
|
+
/**
|
|
39
|
+
* Hosted runtime surface category used for extension/package gating.
|
|
40
|
+
*
|
|
41
|
+
* Represents the concrete surface a runtime IS -- `'any'` is intentionally
|
|
42
|
+
* absent because a runtime cannot BE `'any'`; it is always interactive or
|
|
43
|
+
* headless. Package manifests may declare `'any'` as their surface affinity,
|
|
44
|
+
* which the coordinator interprets as "load on all surfaces".
|
|
45
|
+
*/
|
|
46
|
+
type ExtensionRuntimeSurface = 'interactive' | 'headless';
|
|
47
|
+
/**
|
|
48
|
+
* Host-advertised runtime capability fact.
|
|
49
|
+
*/
|
|
50
|
+
interface RuntimeCapability {
|
|
51
|
+
/** Stable capability token. */
|
|
52
|
+
readonly id: string;
|
|
53
|
+
/** Concrete capability contract version when the host exposes one. */
|
|
54
|
+
readonly version?: VersionLiteral;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Snapshot of the runtime environment provided by the host.
|
|
58
|
+
*
|
|
59
|
+
* The coordinator uses this to evaluate {@link RuntimeRequirement} gates on
|
|
60
|
+
* each extension before deciding whether to load it.
|
|
61
|
+
*/
|
|
62
|
+
interface RuntimeEnvironment {
|
|
63
|
+
/**
|
|
64
|
+
* Identifiers of the active host runtimes (e.g. `'node'`, `'electron'`).
|
|
65
|
+
*
|
|
66
|
+
* Extensions that declare `{ type: 'host', id: '...' }` requirements check
|
|
67
|
+
* against this set.
|
|
68
|
+
*/
|
|
69
|
+
readonly hosts: ReadonlySet<string>;
|
|
70
|
+
/**
|
|
71
|
+
* Capability tokens advertised by the host (e.g. `'storage.drizzle'`).
|
|
72
|
+
*
|
|
73
|
+
* Extensions that declare `{ type: 'capability', id: '...' }` requirements
|
|
74
|
+
* check against this set. Versioned requirements additionally consult
|
|
75
|
+
* {@link RuntimeEnvironment.capabilityVersions}.
|
|
76
|
+
*/
|
|
77
|
+
readonly capabilities: ReadonlySet<string>;
|
|
78
|
+
/**
|
|
79
|
+
* Concrete versions for host capabilities that expose a versioned contract.
|
|
80
|
+
*
|
|
81
|
+
* A capability requirement with a `version` range is satisfied only when the
|
|
82
|
+
* capability ID is present and this map contains a satisfying concrete version.
|
|
83
|
+
*/
|
|
84
|
+
readonly capabilityVersions?: ReadonlyMap<string, VersionLiteral>;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Options for constructing an {@link ExtensionCoordinator}.
|
|
88
|
+
*/
|
|
89
|
+
interface ExtensionCoordinatorOptions {
|
|
90
|
+
/** Hosted surface category used to apply package gating. Defaults to `'headless'`. */
|
|
91
|
+
surface?: ExtensionRuntimeSurface;
|
|
92
|
+
/**
|
|
93
|
+
* Host launcher command embedded into client wiring installed from warning actions.
|
|
94
|
+
*
|
|
95
|
+
* Defaults to `'makaio'` for framework-only hosts. Hosts pass their
|
|
96
|
+
* own launcher policy through this seam so the runtime does not infer it
|
|
97
|
+
* from process entrypoints.
|
|
98
|
+
*/
|
|
99
|
+
launcherCommand?: string;
|
|
100
|
+
/** Optional database instance for storage handler registration (opaque — cast to MakaioDatabase at call site). */
|
|
101
|
+
db?: unknown;
|
|
102
|
+
/**
|
|
103
|
+
* Node host fields for the context supplied to extension factories.
|
|
104
|
+
*
|
|
105
|
+
* Required when any loaded extension declares a `create` factory. When absent,
|
|
106
|
+
* extensions with `create` will fail to start.
|
|
107
|
+
*
|
|
108
|
+
* Omit `config`, `signal`, and `hasExtension` — those are coordinator-owned
|
|
109
|
+
* and assembled per extension at context-build time.
|
|
110
|
+
*/
|
|
111
|
+
extensionContextBase?: Omit<KernelExtensionContext, 'bus' | 'identity' | 'getService' | 'dataDir' | 'config' | 'signal' | 'hasExtension'>;
|
|
112
|
+
/**
|
|
113
|
+
* Host-provided runtime environment snapshot used to evaluate extension
|
|
114
|
+
* {@link RuntimeRequirement} gates during {@link ExtensionCoordinator.load}.
|
|
115
|
+
*
|
|
116
|
+
* Extensions whose {@link MakaioExtension.requires} entries are not all
|
|
117
|
+
* satisfied by the supplied environment are excluded. Omit only in tests that
|
|
118
|
+
* intentionally bypass environment gating.
|
|
119
|
+
*/
|
|
120
|
+
runtimeEnvironment?: RuntimeEnvironment;
|
|
121
|
+
/**
|
|
122
|
+
* Names of packages whose enablement is operator-managed.
|
|
123
|
+
*
|
|
124
|
+
* Scopes the coordinator's enablement machinery to the packages a
|
|
125
|
+
* descriptor actually declares: {@link ExtensionCoordinatorOptions.loadEnabled}
|
|
126
|
+
* is only consulted for a name in this set, `handleSetEnabled`
|
|
127
|
+
* (`kernel:extension.setEnabled`) refuses outright for any other name, and
|
|
128
|
+
* `ExtensionInfo.persistedEnabled` is `undefined` for it. Every name absent
|
|
129
|
+
* from this set boots unconditionally enabled — a framework package is not
|
|
130
|
+
* subject to operator enablement at all, so the enablement store's
|
|
131
|
+
* category defaults (and a hand-edited disable) can never skip it, and
|
|
132
|
+
* dependents cannot be excluded by a framework name looking "disabled".
|
|
133
|
+
*
|
|
134
|
+
* Omitted entirely: every loaded package is treated as managed, which
|
|
135
|
+
* preserves prior behavior for coordinators built without this option
|
|
136
|
+
* (including every existing test that constructs one without it).
|
|
137
|
+
*/
|
|
138
|
+
extensionManagedNames?: ReadonlySet<string>;
|
|
139
|
+
/**
|
|
140
|
+
* Names of packages this host loads unconditionally as framework packages.
|
|
141
|
+
*
|
|
142
|
+
* These are the only names an extension package may legitimately register a
|
|
143
|
+
* second time: the host always loads the framework package, and a single
|
|
144
|
+
* extension registration under one of those names is the supported core
|
|
145
|
+
* override, which {@link ExtensionCoordinator.load} lets win the name. A
|
|
146
|
+
* collision under any other name is an extension identity collision with no
|
|
147
|
+
* legitimate winner and aborts `load()` — see `coalesceExtensionOverrides`.
|
|
148
|
+
*
|
|
149
|
+
* Omitted entirely: every name in the loaded set is treated as an extension
|
|
150
|
+
* identity, so any name collision aborts. A composition root that mixes
|
|
151
|
+
* framework packages into the same `load()` call must supply this set, or a
|
|
152
|
+
* legitimate core override is reported as a collision.
|
|
153
|
+
*/
|
|
154
|
+
frameworkPackageNames?: ReadonlySet<string>;
|
|
155
|
+
/**
|
|
156
|
+
* Optional reader for the extension packages installed on this host.
|
|
157
|
+
*
|
|
158
|
+
* Backs `kernel:extension.catalog` and lets `kernel:extension.setEnabled`
|
|
159
|
+
* validate — and then persist — a preference for a name this coordinator
|
|
160
|
+
* never loaded. Without it, `catalog` reports `entries: null` and
|
|
161
|
+
* `setEnabled` refuses such a name outright (reason `'no-catalog'`) rather
|
|
162
|
+
* than writing a preference on the caller's word.
|
|
163
|
+
*
|
|
164
|
+
* See {@link InstalledExtensionCatalogSource} for the contract.
|
|
165
|
+
*/
|
|
166
|
+
installedCatalog?: InstalledExtensionCatalogSource;
|
|
167
|
+
/**
|
|
168
|
+
* Optional callback to durably persist an enablement preference.
|
|
169
|
+
*
|
|
170
|
+
* Called by `handleSetEnabled` (the `kernel:extension.setEnabled` RPC
|
|
171
|
+
* handler) on every request it does not refuse outright — unconditionally,
|
|
172
|
+
* regardless of whether the preference appears unchanged, and regardless of
|
|
173
|
+
* this same coordinator's own {@link ExtensionCoordinatorOptions.loadEnabled}
|
|
174
|
+
* value. The composition root supplies this to bridge into a durable store
|
|
175
|
+
* (for example `ExtensionEnablementStore` from `@makaio/runtime-node`),
|
|
176
|
+
* which re-reads its backing file before writing so a concurrent hand-edit
|
|
177
|
+
* is never silently overwritten by a stale in-memory guess.
|
|
178
|
+
*/
|
|
179
|
+
persistEnabled?: (name: string, enabled: boolean) => Promise<void>;
|
|
180
|
+
/**
|
|
181
|
+
* Optional callback to retrieve the persisted enablement preference.
|
|
182
|
+
*
|
|
183
|
+
* Called once per package during {@link ExtensionCoordinator.load}, to seed
|
|
184
|
+
* `entry.enabled` for this boot: returns `false` to skip the package at
|
|
185
|
+
* boot, `true` or `undefined` to start it normally. That boot-time read is
|
|
186
|
+
* a snapshot — nothing later re-derives `entry.enabled` from it, and
|
|
187
|
+
* `handleSetEnabled` must never use it (or `entry.enabled`) to decide
|
|
188
|
+
* whether a write is necessary — see {@link persistEnabled}. A hand-edit to
|
|
189
|
+
* the backing store between boots is exactly what this snapshot is meant to
|
|
190
|
+
* pick up on the *next* restart, not something a live `setEnabled` call
|
|
191
|
+
* reconciles against.
|
|
192
|
+
*
|
|
193
|
+
* `list()` and the singular `get` lookup (`kernel:extension.list` /
|
|
194
|
+
* `kernel:extension.get`) also call this — once per extension, per call —
|
|
195
|
+
* to populate `ExtensionInfo.persistedEnabled`. Unlike the boot-time read
|
|
196
|
+
* above, that call is live: a caller backed by `ExtensionEnablementStore`
|
|
197
|
+
* (`@makaio/runtime-node`) reflects every `persistEnabled` write this
|
|
198
|
+
* process has committed in-process since boot, because that store updates
|
|
199
|
+
* its in-memory set only after its own write lands (see that module). It
|
|
200
|
+
* does not reflect a concurrent hand-edit made by another process; the
|
|
201
|
+
* next boot's `load()` call is what picks that up.
|
|
202
|
+
*/
|
|
203
|
+
loadEnabled?: (name: string) => boolean | undefined;
|
|
204
|
+
/**
|
|
205
|
+
* Optional callback to retrieve stored configuration for a package during
|
|
206
|
+
* startAll and enablePackage. Returns `undefined` when no stored config exists.
|
|
207
|
+
*/
|
|
208
|
+
loadConfig?: (name: string) => Record<string, unknown> | undefined;
|
|
209
|
+
/**
|
|
210
|
+
* Optional operator-owned configuration layer, consulted at every config
|
|
211
|
+
* resolution point.
|
|
212
|
+
*
|
|
213
|
+
* Sits above both descriptor/host defaults and {@link ExtensionCoordinatorOptions.loadConfig},
|
|
214
|
+
* so an explicit operator decision is never silently overwritten by a write
|
|
215
|
+
* from the storage tier. An entry the source reports as unusable fails the
|
|
216
|
+
* affected extension when it activates, under the coordinator's existing
|
|
217
|
+
* criticality rules; extensions the source says nothing about are unaffected.
|
|
218
|
+
*
|
|
219
|
+
* When absent, config resolution behaves exactly as it does without an
|
|
220
|
+
* operator layer.
|
|
221
|
+
*/
|
|
222
|
+
operatorConfig?: ExtensionOperatorConfigSource;
|
|
223
|
+
/**
|
|
224
|
+
* Optional callback invoked by {@link ExtensionCoordinator.startAll} to run
|
|
225
|
+
* database migrations declared by loaded packages before any services start.
|
|
226
|
+
*
|
|
227
|
+
* The coordinator collects all packages whose `StorageManifest.migrations`
|
|
228
|
+
* field is set and passes them as an array of
|
|
229
|
+
* `{ name, migrationsPath, migrationSourceId, migrationsPathByDialect? }`
|
|
230
|
+
* objects to this callback in topological (dependency) order. The callback is
|
|
231
|
+
* responsible for applying pending migrations — typically via Drizzle
|
|
232
|
+
* `migrate()` or the bundled `applyMigrations()` helper — using a tracking
|
|
233
|
+
* table keyed to the migration bundle identity so packages that share one
|
|
234
|
+
* folder share one ledger.
|
|
235
|
+
*
|
|
236
|
+
* When absent, declared migrations are silently skipped and storage tables
|
|
237
|
+
* that depend on them will not be created at runtime.
|
|
238
|
+
*
|
|
239
|
+
* The `migrationsPath` values are absolute discovery paths resolved by the
|
|
240
|
+
* coordinator from each package's `StorageManifest.migrations` field
|
|
241
|
+
* plus executable `storage.packageRoot` metadata when needed.
|
|
242
|
+
* `migrationSourceId` is the stable runtime identity used for bundled hosts;
|
|
243
|
+
* when a package does not declare one, it falls back to `migrationsPath`.
|
|
244
|
+
*
|
|
245
|
+
* When a package declares the object form of `StorageManifest.migrations`,
|
|
246
|
+
* the coordinator additionally passes `migrationsPathByDialect` — an
|
|
247
|
+
* absolute, containment-checked map of every declared per-dialect chain. The
|
|
248
|
+
* coordinator stays dialect-agnostic; the host runtime selects the active
|
|
249
|
+
* dialect's chain from this map and falls back to `migrationsPath` when the
|
|
250
|
+
* map has no entry for that dialect.
|
|
251
|
+
* @param sources - Migration sources in dependency order, each carrying the
|
|
252
|
+
* package name, absolute migration folder path, stable source id, and an
|
|
253
|
+
* optional per-dialect chain map.
|
|
254
|
+
* @returns A promise that resolves when all migrations have been applied.
|
|
255
|
+
*/
|
|
256
|
+
runMigrations?: (sources: ReadonlyArray<{
|
|
257
|
+
name: string;
|
|
258
|
+
migrationsPath: string;
|
|
259
|
+
migrationSourceId: string;
|
|
260
|
+
migrationsPathByDialect?: Partial<Record<StorageDialect, string>>;
|
|
261
|
+
}>) => Promise<void>;
|
|
262
|
+
}
|
|
263
|
+
//#endregion
|
|
264
|
+
//#region packages/kernel/src/extension/resolve-config.d.ts
|
|
265
|
+
/** Constructor fields for an {@link ExtensionOperatorConfigError}. */
|
|
266
|
+
interface ExtensionOperatorConfigErrorInput {
|
|
267
|
+
/** Extension whose configuration could not be resolved. */
|
|
268
|
+
readonly extensionName: string;
|
|
269
|
+
/** Opaque origin label copied from the operator entry. */
|
|
270
|
+
readonly source: string;
|
|
271
|
+
/**
|
|
272
|
+
* Human-readable description of what is wrong, already bounded and flattened,
|
|
273
|
+
* phrased to follow the extension and source prefix.
|
|
274
|
+
*/
|
|
275
|
+
readonly summary: string;
|
|
276
|
+
/**
|
|
277
|
+
* Underlying error, preserved unbounded for callers that inspect it rather
|
|
278
|
+
* than print it.
|
|
279
|
+
*/
|
|
280
|
+
readonly cause?: unknown;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Raised when an extension's operator-supplied configuration cannot be
|
|
284
|
+
* honoured, either because the operator entry itself is unusable or because the
|
|
285
|
+
* configuration it takes part in is rejected by the extension's config schema.
|
|
286
|
+
*
|
|
287
|
+
* Carries the extension name and the entry's `source` label so the operator
|
|
288
|
+
* can find the offending input. In `'activate'` mode it is thrown, and the
|
|
289
|
+
* coordinator routes it through the same criticality rules as any other
|
|
290
|
+
* activation failure: a non-critical extension fails alone, a `critical: true`
|
|
291
|
+
* extension aborts startup. In `'observe'` mode it is constructed but never
|
|
292
|
+
* thrown — only its message is used, as the text of a warning — because a
|
|
293
|
+
* caller that is not driving the lifecycle has no criticality rule to apply.
|
|
294
|
+
*/
|
|
295
|
+
declare class ExtensionOperatorConfigError extends MakaioError {
|
|
296
|
+
/** Name of the extension whose configuration could not be resolved. */
|
|
297
|
+
readonly extensionName: string;
|
|
298
|
+
/** Opaque origin label copied from the operator entry. */
|
|
299
|
+
readonly source: string;
|
|
300
|
+
/**
|
|
301
|
+
* @param input - Extension identity, origin label, summary, and optional cause.
|
|
302
|
+
*/
|
|
303
|
+
constructor(input: ExtensionOperatorConfigErrorInput);
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* The result of a configuration resolution, together with how it was reached.
|
|
307
|
+
*
|
|
308
|
+
* The distinction matters to callers that report configuration back to a
|
|
309
|
+
* human: after a rejected merge, the returned object is the schema's own
|
|
310
|
+
* `.default()` values with every configuration layer discarded — including the
|
|
311
|
+
* operator's. Presenting those as the values an extension is running with
|
|
312
|
+
* would attribute schema defaults to the operator, and to a configuration the
|
|
313
|
+
* extension was never able to accept.
|
|
314
|
+
*/
|
|
315
|
+
interface ExtensionConfigResolution {
|
|
316
|
+
/**
|
|
317
|
+
* Parsed config object, or `undefined` when the extension declares no config
|
|
318
|
+
* schema or no parse produced a usable object.
|
|
319
|
+
*/
|
|
320
|
+
readonly config: unknown;
|
|
321
|
+
/**
|
|
322
|
+
* `true` when the merged configuration was rejected by the schema and
|
|
323
|
+
* `config` holds the schema's defaults instead, so no configuration layer is
|
|
324
|
+
* reflected in it. `false` whenever `config` reflects the merged layers, and
|
|
325
|
+
* whenever there is nothing to reflect (no schema, or no usable fallback).
|
|
326
|
+
*/
|
|
327
|
+
readonly usedSchemaDefaults: boolean;
|
|
328
|
+
}
|
|
329
|
+
//#endregion
|
|
330
|
+
//#region packages/kernel/src/extension/extension-toggle.d.ts
|
|
331
|
+
/**
|
|
332
|
+
* Result of {@link handleSetEnabled}.
|
|
333
|
+
*
|
|
334
|
+
* Carries both the collapsed `success` boolean (for callers that only need
|
|
335
|
+
* to know whether the request needs attention) and the full `outcome` (for
|
|
336
|
+
* callers — the `kernel:extension.setEnabled` RPC response and the CLI/UI
|
|
337
|
+
* surfaces that read it — that must tell a durable-but-deferred preference
|
|
338
|
+
* apart from an outright rejection instead of guessing from `success` alone).
|
|
339
|
+
*/
|
|
340
|
+
interface SetEnabledResult {
|
|
341
|
+
/** `true` when the preference already matches the runtime state; `false` otherwise. */
|
|
342
|
+
readonly success: boolean;
|
|
343
|
+
/** The transition outcome computed for this request. */
|
|
344
|
+
readonly outcome: TransitionOutcome;
|
|
345
|
+
/**
|
|
346
|
+
* Machine-readable detail for this outcome, when there is one to report —
|
|
347
|
+
* which refusal it was, or why a persisted preference is not in effect. See
|
|
348
|
+
* {@link SetEnabledReason}. Absent only for the plain `'applied'` case,
|
|
349
|
+
* where the loaded extension already matches the request and there is
|
|
350
|
+
* nothing further to explain.
|
|
351
|
+
*/
|
|
352
|
+
readonly reason?: SetEnabledReason;
|
|
353
|
+
}
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region packages/kernel/src/extension/extension-coordinator.d.ts
|
|
356
|
+
/**
|
|
357
|
+
* Manages optional extensions through a unified lifecycle with per-extension state
|
|
358
|
+
* machine, bus observability, and window/tray/CLI surface collection.
|
|
359
|
+
*
|
|
360
|
+
* Lifecycle flow for each extension:
|
|
361
|
+
* ```
|
|
362
|
+
* discovered -> initializing -> [create + init + contributions] -> active
|
|
363
|
+
* ↘ failed (any step fails, contributions rolled back)
|
|
364
|
+
* ↘ skipped (ServiceSkipError from create or init,
|
|
365
|
+
* or loadEnabled returned false at boot)
|
|
366
|
+
* ```
|
|
367
|
+
*
|
|
368
|
+
* Every state transition emits `kernel:extension.stateChanged` on the bus.
|
|
369
|
+
* Non-critical failures are isolated so remaining extensions continue to start.
|
|
370
|
+
* Critical extension failures abort boot because the host declared them mandatory.
|
|
371
|
+
*
|
|
372
|
+
* Lifecycle transitions are serialized. Extension lifecycle callbacks must not
|
|
373
|
+
* await another coordinator lifecycle call, because it waits in the same lane.
|
|
374
|
+
*
|
|
375
|
+
* During {@link load}, window manifests are registered into
|
|
376
|
+
* {@link windowRegistry}, tray entries are collected into {@link trayEntries},
|
|
377
|
+
* CLI contributions are collected into {@link cliContributions}, and package
|
|
378
|
+
* namespaces are registered on the bus — but only for entries whose
|
|
379
|
+
* preference-enabled state survives the dependency closure computed by
|
|
380
|
+
* `closeEnabledExtensionEntries` (`extension-entry-closure.ts`), so an entry
|
|
381
|
+
* that can never reach `active` this process never registers surfaces a
|
|
382
|
+
* `cli.execute` or window-open call could otherwise dispatch into, and its
|
|
383
|
+
* namespace can never win a collision against an active entry's or a
|
|
384
|
+
* framework namespace of the same name. Static tray entries are bridged to
|
|
385
|
+
* the tray menu bus service after each extension starts so the tray service
|
|
386
|
+
* can be supplied by the same extension graph.
|
|
387
|
+
*
|
|
388
|
+
* During {@link startAll}, each extension's {@link MakaioExtension.create} factory
|
|
389
|
+
* is called with a `NodeExtensionContext`, followed by `service.init()`.
|
|
390
|
+
* Storage handlers (if any) are registered via
|
|
391
|
+
* `MakaioExtension.storage.registerHandlers` when a `db` instance is
|
|
392
|
+
* provided to the constructor.
|
|
393
|
+
*/
|
|
394
|
+
declare class ExtensionCoordinator {
|
|
395
|
+
private readonly bus;
|
|
396
|
+
private readonly surface;
|
|
397
|
+
private readonly db;
|
|
398
|
+
private readonly extensionContextBase;
|
|
399
|
+
private readonly runtimeEnvironment;
|
|
400
|
+
/**
|
|
401
|
+
* AbortController signalling graceful shutdown to all active packages.
|
|
402
|
+
*
|
|
403
|
+
* Aborted at the start of {@link shutdown} so packages receive the signal
|
|
404
|
+
* before their services are destroyed.
|
|
405
|
+
*/
|
|
406
|
+
private readonly shutdownController;
|
|
407
|
+
/** Insertion-ordered map so iteration matches dependency sort order. */
|
|
408
|
+
private readonly entries;
|
|
409
|
+
private loadOrder;
|
|
410
|
+
private loaded;
|
|
411
|
+
private started;
|
|
412
|
+
private shutdownRequested;
|
|
413
|
+
private shutdownPromise;
|
|
414
|
+
/** FIFO lane for lifecycle transitions that mutate extension entries. */
|
|
415
|
+
private lifecycleTail;
|
|
416
|
+
private rpcCleanups;
|
|
417
|
+
private readonly contributionProcessors;
|
|
418
|
+
/**
|
|
419
|
+
* Transient map from composite key (`toastId:actionId`) to the corresponding
|
|
420
|
+
* {@link ExtensionWarningAction}. Populated during {@link emitWarningsForEntry}
|
|
421
|
+
* and cleared per package before that package's current warning set is
|
|
422
|
+
* recorded, then cleared globally on {@link shutdown}.
|
|
423
|
+
*
|
|
424
|
+
* This map is intentionally coordinator-owned because toast interactions
|
|
425
|
+
* arrive after warning emission and need a short-lived runtime lookup without
|
|
426
|
+
* exposing executable warning actions in the toast payload.
|
|
427
|
+
*/
|
|
428
|
+
private readonly warningActionMap;
|
|
429
|
+
/** Window registry populated during {@link load}. */
|
|
430
|
+
readonly windowRegistry: WindowRegistry;
|
|
431
|
+
private readonly _trayEntries;
|
|
432
|
+
private readonly _cliContributions;
|
|
433
|
+
private readonly persistEnabled;
|
|
434
|
+
private readonly loadEnabled;
|
|
435
|
+
private readonly loadConfig;
|
|
436
|
+
private readonly operatorConfig;
|
|
437
|
+
private readonly runMigrations;
|
|
438
|
+
private readonly extensionManagedNames;
|
|
439
|
+
private readonly frameworkPackageNames;
|
|
440
|
+
private readonly installedCatalog;
|
|
441
|
+
/**
|
|
442
|
+
* @param bus - Bus instance for emitting lifecycle events and serving the list RPC.
|
|
443
|
+
* @param options - Coordinator configuration.
|
|
444
|
+
*/
|
|
445
|
+
constructor(bus: IMakaioBus, options?: ExtensionCoordinatorOptions);
|
|
446
|
+
/**
|
|
447
|
+
* Tray manifest entries collected from packages during {@link load}.
|
|
448
|
+
* @returns Immutable snapshot of all collected tray entries.
|
|
449
|
+
*/
|
|
450
|
+
get trayEntries(): ReadonlyArray<TrayManifest & {
|
|
451
|
+
readonly packageName: string;
|
|
452
|
+
}>;
|
|
453
|
+
/**
|
|
454
|
+
* CLI contributions collected from packages during {@link load}.
|
|
455
|
+
* @returns Immutable snapshot of all collected CLI contributions.
|
|
456
|
+
*/
|
|
457
|
+
get cliContributions(): ReadonlyArray<CliContribution>;
|
|
458
|
+
/**
|
|
459
|
+
* Returns extensions that declare HTTP routes.
|
|
460
|
+
* Primarily retained for diagnostics and compatibility with callers that
|
|
461
|
+
* need a snapshot of loaded HTTP surfaces. Runtime route mounting is handled
|
|
462
|
+
* by contribution processors as extensions activate or stop.
|
|
463
|
+
* @returns Loaded extensions that have an `http` field defined.
|
|
464
|
+
*/
|
|
465
|
+
extensionsWithHttp(): ReadonlyArray<{
|
|
466
|
+
http: {
|
|
467
|
+
prefix: string;
|
|
468
|
+
mount: (app: unknown) => void;
|
|
469
|
+
};
|
|
470
|
+
}>;
|
|
471
|
+
/**
|
|
472
|
+
* Load extension manifests and build the dependency graph.
|
|
473
|
+
*
|
|
474
|
+
* Sets all entries to the `discovered` state and registers the
|
|
475
|
+
* `kernel:extension.list`, `kernel:extension.get`, `kernel:extension.setEnabled`,
|
|
476
|
+
* `cli.listContributions`, and `cli.execute` RPC handlers.
|
|
477
|
+
*
|
|
478
|
+
* Extensions that do not match the coordinator's runtime surface or declared
|
|
479
|
+
* environment requirements are
|
|
480
|
+
* silently excluded. Dependents of excluded extensions are transitively pruned.
|
|
481
|
+
*
|
|
482
|
+
* Window manifests are registered into {@link windowRegistry}, tray entries
|
|
483
|
+
* are collected into {@link trayEntries}, CLI contributions are collected
|
|
484
|
+
* into {@link cliContributions}, and package bus namespaces are registered
|
|
485
|
+
* -- all before any services are started, and all gated by the same
|
|
486
|
+
* dependency closure (see the class-level doc comment above).
|
|
487
|
+
*
|
|
488
|
+
* Single-use: calling this method twice on the same instance throws.
|
|
489
|
+
*
|
|
490
|
+
* The retained names are returned because filtering happens here and nowhere
|
|
491
|
+
* else: a composition root that wants to diagnose what it handed in — an
|
|
492
|
+
* operator config file for an extension this surface excludes, for example —
|
|
493
|
+
* would otherwise have to restate the surface and environment rules and drift
|
|
494
|
+
* from them. They are a result of this call rather than an accessor, so there
|
|
495
|
+
* is no state in which they can be read as "nothing was retained" when in fact
|
|
496
|
+
* nothing has been loaded yet.
|
|
497
|
+
* @param packages - Extension manifests to register.
|
|
498
|
+
* @param configDefaults - Optional map of extension name to default config values
|
|
499
|
+
* sourced from descriptor.json.
|
|
500
|
+
* @returns The packages actually registered, in load order: the input minus
|
|
501
|
+
* the ones excluded by surface or environment filtering and their pruned
|
|
502
|
+
* dependents, with one entry per name — for an accepted core override
|
|
503
|
+
* (see {@link ExtensionCoordinatorOptions.frameworkPackageNames}), the
|
|
504
|
+
* overriding registration rather than the framework package it replaced.
|
|
505
|
+
* The manifests themselves rather than their names, because a caller
|
|
506
|
+
* matching names back against its own input would re-admit exactly the
|
|
507
|
+
* overridden registration this dropped.
|
|
508
|
+
* @throws Error if called more than once, if two registrations collide on a
|
|
509
|
+
* name that is not an overridable framework package name, if a dependency
|
|
510
|
+
* cycle is detected, or if dependency sorting fails.
|
|
511
|
+
*/
|
|
512
|
+
load(packages: ReadonlyArray<KernelMakaioExtension>, configDefaults?: ReadonlyMap<string, Readonly<Record<string, unknown>>>): readonly KernelMakaioExtension[];
|
|
513
|
+
/**
|
|
514
|
+
* Register the `kernel:extension.*` and `cli.*` RPC handlers on the bus.
|
|
515
|
+
*
|
|
516
|
+
* Extracted out of {@link load} purely to stay within that method's line
|
|
517
|
+
* budget; it has no meaning independent of the single call site there.
|
|
518
|
+
*/
|
|
519
|
+
private registerRpcHandlers;
|
|
520
|
+
/**
|
|
521
|
+
* Start all loaded packages in dependency order.
|
|
522
|
+
*
|
|
523
|
+
* For each package the state machine advances:
|
|
524
|
+
* `discovered -> initializing -> active | failed | skipped`
|
|
525
|
+
*
|
|
526
|
+
* Failures are isolated: a package that throws during `create` or `init` is
|
|
527
|
+
* set to `failed` and the error is captured, but remaining packages continue
|
|
528
|
+
* to start unless the package declares `critical: true`.
|
|
529
|
+
*
|
|
530
|
+
* Single-use: calling this method twice on the same instance throws.
|
|
531
|
+
* @throws Error if called more than once, before {@link load}, or when a
|
|
532
|
+
* critical package fails.
|
|
533
|
+
*/
|
|
534
|
+
startAll(): Promise<void>;
|
|
535
|
+
/** Run the admitted startup transition in the coordinator lifecycle lane. */
|
|
536
|
+
private startAllInLifecycleLane;
|
|
537
|
+
/**
|
|
538
|
+
* Shut down all active packages in reverse dependency order.
|
|
539
|
+
*
|
|
540
|
+
* Calls each package's service `destroy()` method (if any). A teardown
|
|
541
|
+
* failure does not stop remaining packages from shutting down, but it is
|
|
542
|
+
* reported: once every package has been stopped, all failures are thrown
|
|
543
|
+
* together so the caller can treat termination as unclean.
|
|
544
|
+
*
|
|
545
|
+
* Safe to call even if {@link startAll} was never called.
|
|
546
|
+
* @returns A promise that settles after every admitted transition and teardown complete.
|
|
547
|
+
* @throws An AggregateError when any package failed to shut down cleanly.
|
|
548
|
+
*/
|
|
549
|
+
shutdown(): Promise<void>;
|
|
550
|
+
/** Run shutdown after every lifecycle transition admitted before shutdown. */
|
|
551
|
+
private shutdownInLifecycleLane;
|
|
552
|
+
/**
|
|
553
|
+
* Return the current state snapshot for all registered packages.
|
|
554
|
+
* @returns Array of {@link ExtensionInfo} objects reflecting current observable states.
|
|
555
|
+
*/
|
|
556
|
+
list(): ExtensionInfo[];
|
|
557
|
+
/**
|
|
558
|
+
* Return the current state snapshot for a single named package.
|
|
559
|
+
*
|
|
560
|
+
* Backs the `kernel:extension.get` RPC (see `coordinator-rpc-handlers.ts`)
|
|
561
|
+
* so that handler does not need its own access to {@link loadEnabled} to
|
|
562
|
+
* populate `ExtensionInfo.persistedEnabled`.
|
|
563
|
+
* @param name - Extension name to look up.
|
|
564
|
+
* @returns The {@link ExtensionInfo} snapshot, or `null` when unknown.
|
|
565
|
+
*/
|
|
566
|
+
getInfo(name: string): ExtensionInfo | null;
|
|
567
|
+
/**
|
|
568
|
+
* Retrieve the live service instance for a named extension.
|
|
569
|
+
* @param tokenOrName - Extension token or extension name string.
|
|
570
|
+
* @returns The active service instance, or `undefined`.
|
|
571
|
+
*/
|
|
572
|
+
getExtensionService<TService = ExtensionService>(tokenOrName: string | ExtensionToken<TService>): TService | undefined;
|
|
573
|
+
/**
|
|
574
|
+
* Look up a loaded extension by name.
|
|
575
|
+
* @param name - Extension name.
|
|
576
|
+
* @returns The extension, or `undefined` if not loaded.
|
|
577
|
+
*/
|
|
578
|
+
getExtension(name: string): KernelMakaioExtension | undefined;
|
|
579
|
+
/**
|
|
580
|
+
* Return the schema-parsed effective config for a loaded extension.
|
|
581
|
+
*
|
|
582
|
+
* Runs the same resolution path the kernel uses at activation, in `'observe'`
|
|
583
|
+
* mode, so every schema transform (e.g. `.trim()`) is reflected in the
|
|
584
|
+
* returned values. This is the correct source for building provenance
|
|
585
|
+
* snapshots — never the raw operator layer, which may not match what the
|
|
586
|
+
* extension actually received.
|
|
587
|
+
*
|
|
588
|
+
* Deliberately state-neutral. Resolution composes the configuration layers
|
|
589
|
+
* and nothing else: it needs no live service, no context, and no running
|
|
590
|
+
* lifecycle, so a disabled, stopped, failed, or not-yet-started extension
|
|
591
|
+
* resolves exactly like a running one. A settings surface is precisely where
|
|
592
|
+
* an extension gets toggled off, and it must not start reporting different
|
|
593
|
+
* values the moment it does.
|
|
594
|
+
* Reports how the configuration was reached, because the two outcomes are
|
|
595
|
+
* not interchangeable for a settings surface: when the merged configuration
|
|
596
|
+
* is rejected, resolution falls back to the schema's own defaults with every
|
|
597
|
+
* layer discarded, and reporting those as effective values would attribute
|
|
598
|
+
* schema defaults to whichever layer supplied them.
|
|
599
|
+
* @param name - Extension name.
|
|
600
|
+
* @returns The resolution, or `undefined` when no extension is loaded under
|
|
601
|
+
* `name`. Its `config` is `undefined` when the extension declares no
|
|
602
|
+
* `configSchema`, or when the merged configuration is rejected by the
|
|
603
|
+
* schema and the schema-default fallback parse fails as well.
|
|
604
|
+
*/
|
|
605
|
+
getResolvedConfig(name: string): ExtensionConfigResolution | undefined;
|
|
606
|
+
/**
|
|
607
|
+
* Collect provider definition IDs from extensions that can still provide them.
|
|
608
|
+
*
|
|
609
|
+
* Active entries are already visible through the contribution catalog.
|
|
610
|
+
* Enabled `discovered` and `initializing` entries are still eligible to
|
|
611
|
+
* activate later in the same boot or enablement pass, so adapters should
|
|
612
|
+
* defer for their providers. Disabled and terminal inactive entries are
|
|
613
|
+
* excluded so optional-provider adapters do not wait on providers that
|
|
614
|
+
* cannot become catalog-visible.
|
|
615
|
+
* @returns Set of provider definition IDs from active or activation-eligible extensions.
|
|
616
|
+
*/
|
|
617
|
+
getLoadedProviderDefinitionIds(): ReadonlySet<string>;
|
|
618
|
+
/**
|
|
619
|
+
* Iterate all active extensions in dependency order with their contexts.
|
|
620
|
+
*
|
|
621
|
+
* Intended for host-owned integration code that needs a snapshot of active
|
|
622
|
+
* packages after the coordinator has completed startup.
|
|
623
|
+
*
|
|
624
|
+
* Configuration is resolved in observe mode, so a configuration that has since
|
|
625
|
+
* become invalid degrades that extension's `ctx.config` to schema defaults
|
|
626
|
+
* rather than throwing and abandoning the rest of the iteration.
|
|
627
|
+
* @param callback - Called once per active extension with its name, manifest,
|
|
628
|
+
* and a per-extension `NodeExtensionContext`.
|
|
629
|
+
*/
|
|
630
|
+
forEachActiveExtension(callback: (name: string, pkg: KernelMakaioExtension, ctx: KernelExtensionContext) => void): void;
|
|
631
|
+
/**
|
|
632
|
+
* Invoke a callback for a single active extension with its resolved context.
|
|
633
|
+
*
|
|
634
|
+
* Singular complement to {@link forEachActiveExtension} for targeted operations
|
|
635
|
+
* after an extension is re-enabled, and resolves configuration in the same
|
|
636
|
+
* non-throwing observe mode.
|
|
637
|
+
* No-ops when the extension is not found or not in `active` state.
|
|
638
|
+
* @param name - Name of the extension to target.
|
|
639
|
+
* @param callback - Called with the extension name, manifest, and a
|
|
640
|
+
* per-extension `NodeExtensionContext` when the extension is active.
|
|
641
|
+
*/
|
|
642
|
+
forExtension(name: string, callback: (name: string, pkg: KernelMakaioExtension, ctx: KernelExtensionContext) => void): void;
|
|
643
|
+
/**
|
|
644
|
+
* Register an awaited contribution processor.
|
|
645
|
+
*
|
|
646
|
+
* The processor's `processActivated` method is called
|
|
647
|
+
* (and awaited) each time an extension transitions to `active` — both during
|
|
648
|
+
* {@link startAll} and on a coordinator-internal restart via
|
|
649
|
+
* {@link applyExtensionTransition} (`true`).
|
|
650
|
+
*
|
|
651
|
+
* `processStopped` (when present) is called before
|
|
652
|
+
* the extension's service is destroyed during {@link shutdown} or a
|
|
653
|
+
* coordinator-internal restart via {@link applyExtensionTransition}
|
|
654
|
+
* (`false`).
|
|
655
|
+
*
|
|
656
|
+
* Processors run in registration order during activation and reverse
|
|
657
|
+
* registration order during deactivation. During activation, processor errors
|
|
658
|
+
* cause the extension to transition to `failed` with rollback of
|
|
659
|
+
* already-activated contributions. During deactivation, errors are caught and
|
|
660
|
+
* logged (best-effort).
|
|
661
|
+
* @param processor - Processor to register.
|
|
662
|
+
* @returns Cleanup function that removes the processor from the registry.
|
|
663
|
+
*/
|
|
664
|
+
registerContributionProcessor(processor: ContributionProcessor): () => void;
|
|
665
|
+
/**
|
|
666
|
+
* Handle the `kernel:extension.setEnabled` RPC by durably recording the
|
|
667
|
+
* operator's enablement preference for an extension.
|
|
668
|
+
*
|
|
669
|
+
* This is the operator-preference seam, and it is **persist-only**: it
|
|
670
|
+
* never runs a live state-machine transition. It persists the requested
|
|
671
|
+
* preference (refusing to disable a `critical` extension, or one whose
|
|
672
|
+
* criticality could not be resolved, and throwing when this coordinator was
|
|
673
|
+
* constructed without a `persistEnabled` writer) and reports whether the
|
|
674
|
+
* process's current runtime state already matches it. See
|
|
675
|
+
* {@link handleSetEnabledImpl} for the full rationale — several package
|
|
676
|
+
* contributions are composed exactly once at boot and cannot be replayed
|
|
677
|
+
* for one package in isolation while the process keeps running.
|
|
678
|
+
* Coordinator-internal or product-internal callers that need to actually
|
|
679
|
+
* restart an already-started extension as part of their own mechanics
|
|
680
|
+
* should call {@link applyExtensionTransition} instead.
|
|
681
|
+
*
|
|
682
|
+
* Every request is validated against the host's installed-extension catalog
|
|
683
|
+
* — a name this coordinator never loaded as an operator-managed extension
|
|
684
|
+
* for its existence, and every name for whether more than one installed copy
|
|
685
|
+
* claims it. A second copy installed while this process runs never reaches
|
|
686
|
+
* `entries`, which still describes the single copy loaded at boot, so only
|
|
687
|
+
* the catalog can see that the next start will refuse the name. That read
|
|
688
|
+
* scans install tiers and imports extension code, so it happens here, before
|
|
689
|
+
* the request enters the lifecycle queue — holding the lifecycle lock across
|
|
690
|
+
* it would stall shutdown and every other transition behind an interactive
|
|
691
|
+
* request. Because it is awaited outside the queue, admission is decided
|
|
692
|
+
* after it rather than before (see {@link admitLifecycle}).
|
|
693
|
+
* @param name - Name of the extension to toggle.
|
|
694
|
+
* @param enabled - `true` to enable, `false` to disable.
|
|
695
|
+
* @returns A {@link SetEnabledResult}: `success` is `true` when the
|
|
696
|
+
* preference already matches the runtime state and `false` when the
|
|
697
|
+
* request was rejected or can only take effect on the next process
|
|
698
|
+
* restart; `outcome` always carries the underlying {@link TransitionOutcome}
|
|
699
|
+
* (`'applied'`, `'rejected'`, or `'restart-required'`) so callers can tell
|
|
700
|
+
* those two `false` cases apart, and `reason` the detail behind it.
|
|
701
|
+
* @throws Error when this coordinator has no durable `persistEnabled`
|
|
702
|
+
* writer, or when a framework package holds the requested name and this
|
|
703
|
+
* coordinator has no installed-extension catalog.
|
|
704
|
+
*/
|
|
705
|
+
handleSetEnabled(name: string, enabled: boolean): Promise<SetEnabledResult>;
|
|
706
|
+
/**
|
|
707
|
+
* Build the {@link CatalogHost} surface the installed-extension catalog
|
|
708
|
+
* assembly reads.
|
|
709
|
+
* @returns Host surface for the catalog helpers.
|
|
710
|
+
*/
|
|
711
|
+
private createCatalogHost;
|
|
712
|
+
/**
|
|
713
|
+
* Enable or disable an already-boot-started extension without touching
|
|
714
|
+
* operator preference.
|
|
715
|
+
*
|
|
716
|
+
* This is the coordinator-internal lifecycle primitive: it does not persist
|
|
717
|
+
* anything and does not refuse a `critical` extension, but it does run the
|
|
718
|
+
* real state-machine transition (unlike {@link handleSetEnabled}, which is
|
|
719
|
+
* persist-only). Use it when a restart is part of the coordinator's own
|
|
720
|
+
* mechanics rather than an operator-originated request — for example a
|
|
721
|
+
* dependency registry that restarts a `critical` extension built to survive
|
|
722
|
+
* that gap (see the `automation-trigger` binding runtime package for the
|
|
723
|
+
* canonical example). It refuses to activate an extension boot skipped
|
|
724
|
+
* entirely (never started `create`/`init` this process) — see the
|
|
725
|
+
* boot-skip guard in `enableExtension` — because that entry's boot-only
|
|
726
|
+
* contribution surfaces were never composed in the first place.
|
|
727
|
+
* @param name - Name of the extension to toggle.
|
|
728
|
+
* @param enabled - `true` to enable, `false` to disable.
|
|
729
|
+
* @returns The transition outcome: `'applied'` or `'rejected'`.
|
|
730
|
+
*/
|
|
731
|
+
applyExtensionTransition(name: string, enabled: boolean): Promise<Exclude<TransitionOutcome, 'restart-required'>>;
|
|
732
|
+
/**
|
|
733
|
+
* Build the {@link ToggleHost} surface shared by {@link handleSetEnabled} and
|
|
734
|
+
* {@link applyExtensionTransition}.
|
|
735
|
+
*
|
|
736
|
+
* Centralizing this avoids the two toggle entry points drifting out of sync
|
|
737
|
+
* on which coordinator state the toggle helpers can see.
|
|
738
|
+
* @returns Host surface for the toggle lifecycle helpers.
|
|
739
|
+
*/
|
|
740
|
+
private createToggleHost;
|
|
741
|
+
/**
|
|
742
|
+
* Admit an operator-originated lifecycle transition, unless this coordinator
|
|
743
|
+
* is already terminal.
|
|
744
|
+
*
|
|
745
|
+
* The shutdown check and the enqueue happen in the same synchronous turn,
|
|
746
|
+
* and that is the entire contract: `shutdown()` marks the coordinator
|
|
747
|
+
* terminal and reserves the teardown slot in one turn too, so anything
|
|
748
|
+
* admitted here is admitted strictly before teardown. A caller that awaited
|
|
749
|
+
* between its own check and the enqueue — `handleSetEnabled` awaits the
|
|
750
|
+
* installed-extension catalog scan — would otherwise queue work behind
|
|
751
|
+
* teardown and still persist a preference after the runtime stopped.
|
|
752
|
+
* @param operation - Lifecycle transition to run exclusively.
|
|
753
|
+
* @param onShutdown - Result reported instead of running `operation` when the
|
|
754
|
+
* coordinator is already terminal.
|
|
755
|
+
* @returns The operation's result, or `onShutdown`.
|
|
756
|
+
*/
|
|
757
|
+
private admitLifecycle;
|
|
758
|
+
/**
|
|
759
|
+
* Schedule a lifecycle transition after every previously admitted transition.
|
|
760
|
+
*
|
|
761
|
+
* The tail recovers from failures so one rejected operation cannot strand
|
|
762
|
+
* later shutdown or toggle work behind a rejected promise.
|
|
763
|
+
* @param operation - Lifecycle transition to run exclusively.
|
|
764
|
+
* @returns The operation's result.
|
|
765
|
+
*/
|
|
766
|
+
private enqueueLifecycle;
|
|
767
|
+
/**
|
|
768
|
+
* Create the shared extension-context helper host without exposing coordinator internals.
|
|
769
|
+
* @returns Helper host for config resolution and ExtensionContext construction.
|
|
770
|
+
*/
|
|
771
|
+
private createExtensionContextHost;
|
|
772
|
+
/**
|
|
773
|
+
* Create the helper host for extension health checks.
|
|
774
|
+
* @returns Coordinator state required by the health runner.
|
|
775
|
+
*/
|
|
776
|
+
private createExtensionHealthHost;
|
|
777
|
+
/**
|
|
778
|
+
* Check whether an extension has reached active state.
|
|
779
|
+
* @param name - Extension name to check.
|
|
780
|
+
* @returns `true` when the extension is active.
|
|
781
|
+
*/
|
|
782
|
+
private hasActiveExtension;
|
|
783
|
+
}
|
|
784
|
+
//#endregion
|
|
785
|
+
//#region packages/kernel/src/extension/extension-selection.d.ts
|
|
786
|
+
/**
|
|
787
|
+
* Resolve name collisions across a registration list, allowing exactly one
|
|
788
|
+
* kind of collision: an extension package deliberately overriding a framework
|
|
789
|
+
* package that the host loads unconditionally.
|
|
790
|
+
*
|
|
791
|
+
* Extension package names are identities, not suggestions. Two extension
|
|
792
|
+
* packages registering under the same name have no legitimate winner — one
|
|
793
|
+
* would silently displace the other, including the case where the displacing
|
|
794
|
+
* registration is operator-disabled and therefore never starts at all. Upstream
|
|
795
|
+
* stages already guarantee unique extension identities: filesystem discovery
|
|
796
|
+
* rejects a same-tier descriptor-name collision outright and resolves a
|
|
797
|
+
* cross-tier one by tier precedence. Reaching this function with two extension
|
|
798
|
+
* registrations under one name therefore means a stage upstream of it stopped
|
|
799
|
+
* holding that guarantee, so it fails loudly rather than picking one.
|
|
800
|
+
*
|
|
801
|
+
* A framework package name is different: the host loads those packages
|
|
802
|
+
* unconditionally, and an extension registering under one of them is the
|
|
803
|
+
* supported core-override flow. `frameworkPackageNames` names exactly those,
|
|
804
|
+
* so the override wins the name (taking the overridden package's place at the
|
|
805
|
+
* end of the load order) while any further registration under the same name is
|
|
806
|
+
* again a collision with no legitimate winner.
|
|
807
|
+
* @param extensions - Eligible extensions in load priority order.
|
|
808
|
+
* @param frameworkPackageNames - Names the host loads unconditionally as
|
|
809
|
+
* framework packages. A single extension registration under one of these is
|
|
810
|
+
* a deliberate core override and wins the name. Omitted (or empty) means
|
|
811
|
+
* every name in `extensions` is an extension identity, so any collision
|
|
812
|
+
* throws.
|
|
813
|
+
* @returns Unique extensions, with an accepted core override in place of the
|
|
814
|
+
* framework package it replaced.
|
|
815
|
+
* @throws Error when two registrations collide on a name that is not an
|
|
816
|
+
* overridable framework package name, or when a framework package name is
|
|
817
|
+
* claimed more than once by an override.
|
|
818
|
+
*/
|
|
819
|
+
declare function coalesceExtensionOverrides(extensions: ReadonlyArray<KernelMakaioExtension>, frameworkPackageNames?: ReadonlySet<string>): KernelMakaioExtension[];
|
|
820
|
+
/**
|
|
821
|
+
* Filter extensions by runtime surface / environment requirements and prune dependents.
|
|
822
|
+
* @param extensions - Full extension set to filter.
|
|
823
|
+
* @param surface - Runtime surface to match.
|
|
824
|
+
* @param env - Host-provided runtime environment, or `undefined` to allow all.
|
|
825
|
+
* @returns Extensions eligible for loading in the current host environment.
|
|
826
|
+
*/
|
|
827
|
+
declare function filterEligibleExtensions(extensions: ReadonlyArray<KernelMakaioExtension>, surface: ExtensionRuntimeSurface, env: RuntimeEnvironment | undefined): KernelMakaioExtension[];
|
|
828
|
+
//#endregion
|
|
829
|
+
//#region packages/kernel/src/extension/installed-extension-catalog.d.ts
|
|
830
|
+
/**
|
|
831
|
+
* Resolve the one installed record a name's enablement decision must answer
|
|
832
|
+
* against on a given runtime surface.
|
|
833
|
+
*
|
|
834
|
+
* A name can appear on more than one row, and picking the first match is only
|
|
835
|
+
* correct by accident. The catalog describes the *host* — every installed copy,
|
|
836
|
+
* on every surface — while an enablement decision is made for one concrete
|
|
837
|
+
* runtime. Three rules bridge that gap:
|
|
838
|
+
*
|
|
839
|
+
* 1. **A shadowed row is never the answer while a live one exists.** Discovery
|
|
840
|
+
* drops a shadowed descriptor whole, so its row describes an install no
|
|
841
|
+
* boot loads. When *every* row for the name is shadowed the name is still
|
|
842
|
+
* installed and still addressable, so the shadowed rows are what is left to
|
|
843
|
+
* answer from.
|
|
844
|
+
* 2. **Surface decides between the rest.** The coordinator filters packages by
|
|
845
|
+
* surface *before* it resolves names, which is exactly why two copies
|
|
846
|
+
* restricted to different surfaces are not reported as a collision (see
|
|
847
|
+
* {@link InstalledExtensionRecord.collidesWith}). The same asymmetry has to
|
|
848
|
+
* hold here: on a headless runtime the headless copy is the one whose
|
|
849
|
+
* `critical` flag the next boot honours, and answering from the interactive
|
|
850
|
+
* copy would accept or refuse a disable on the strength of a package this
|
|
851
|
+
* surface never loads. A row restricted to *another* surface is kept only
|
|
852
|
+
* when nothing else claims the name — installed-but-not-loadable-here is
|
|
853
|
+
* still a real install with a real preference.
|
|
854
|
+
* 3. **The contest is re-judged for this surface whenever it can be.** The
|
|
855
|
+
* catalog's own `collidesWith` answers "is this name contested
|
|
856
|
+
* *somewhere*", which is a different question — see
|
|
857
|
+
* {@link resolveContestOnThisSurface}. Carrying it through unchanged would
|
|
858
|
+
* refuse a name this runtime resolves cleanly; trusting its absence would
|
|
859
|
+
* accept one it cannot resolve at all; and discarding it where no second
|
|
860
|
+
* claimant is visible would drop the only evidence there is.
|
|
861
|
+
* @param records - Installed records as reported by the catalog source.
|
|
862
|
+
* @param name - Executable package name being resolved.
|
|
863
|
+
* @param surface - Runtime surface the decision is being made for.
|
|
864
|
+
* @returns The record to validate against, with its enablement facts stated
|
|
865
|
+
* for `surface`, or `undefined` when nothing installed claims the name.
|
|
866
|
+
*/
|
|
867
|
+
declare function resolveInstalledExtensionRecord(records: readonly InstalledExtensionRecord[], name: string, surface: ExtensionRuntimeSurface): InstalledExtensionRecord | undefined;
|
|
868
|
+
//#endregion
|
|
869
|
+
export { SetEnabledResult as a, ContributionProcessor as c, InstalledExtensionCatalogSource as d, KernelExtensionContext as f, RuntimeEnvironment as h, ExtensionCoordinator as i, ExtensionCoordinatorOptions as l, RuntimeCapability as m, coalesceExtensionOverrides as n, ExtensionConfigResolution as o, KernelMakaioExtension as p, filterEligibleExtensions as r, ExtensionOperatorConfigError as s, resolveInstalledExtensionRecord as t, ExtensionRuntimeSurface as u };
|