@makaio/framework 1.0.0-dev-1783977266352 → 1.0.0-dev-1784144891135
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/adapters/config/index.d.mts +2 -2
- package/dist/adapters/config/index.mjs +1 -1
- package/dist/adapters/index.d.mts +2 -2
- package/dist/adapters/index.mjs +3 -3
- package/dist/adapters/node.d.mts +1 -1
- package/dist/adapters/node.mjs +1 -1
- package/dist/{artifact-CGjnoyCC.mjs → artifact-Dnpy5ei_.mjs} +1 -1
- package/dist/{authority-state-bootstrap-CEuKScnL.mjs → authority-state-bootstrap-BlbmQ9A5.mjs} +1 -1
- package/dist/bus/index.mjs +1 -1
- package/dist/clients/index.d.mts +1 -1
- 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/context-resolution-CE1o3wTv.d.mts +1268 -0
- package/dist/contracts/adapter/index.d.mts +2 -2
- package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
- package/dist/contracts/artifact/index.d.mts +2 -1
- package/dist/contracts/artifact/index.mjs +1 -1
- package/dist/contracts/auth/index.d.mts +2 -2
- package/dist/contracts/canonical-model/index.d.mts +1 -1
- package/dist/contracts/client/index.d.mts +2 -2
- package/dist/contracts/common/index.d.mts +1 -1
- package/dist/contracts/config/index.d.mts +1 -1
- package/dist/contracts/extension/index.d.mts +3 -3
- 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 +75 -75
- package/dist/contracts/index.mjs +1 -1
- package/dist/contracts/materialization/index.d.mts +4 -4
- package/dist/contracts/materialization/index.mjs +1 -1
- 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/session/index.d.mts +2 -2
- 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/workflow/index.d.mts +2 -2
- package/dist/contracts/workflow/index.mjs +1 -1
- package/dist/{detached-extension-handle-vDK194QV.mjs → detached-extension-handle-BVM-Ic-4.mjs} +1 -1
- package/dist/{filesystem-service-maY_P3yA.mjs → filesystem-service-qR9Zy5-r.mjs} +1 -1
- package/dist/git/index.mjs +1 -1
- package/dist/{globby-CisClzat.mjs → globby-DE358g5u.mjs} +1 -1
- package/dist/{index-D3Eek6kd.d.mts → index-4WQgnxfO.d.mts} +158 -1044
- package/dist/{index-C6LZOiDv.d.mts → index-B96HlWaM.d.mts} +1 -1
- package/dist/{index-DMQlLz2W.d.mts → index-BB5xeWrm.d.mts} +6 -6
- package/dist/{index-DpZbaS7y.d.mts → index-BB6bmH1n.d.mts} +3 -3
- package/dist/{index-Bbr5LEUc.d.mts → index-BFAc9Mqw.d.mts} +1 -1
- package/dist/{index-Cx8jGKOs.d.mts → index-BMmJJJmZ.d.mts} +7 -7
- package/dist/{index-j2YlW_Fc.d.mts → index-B_KmL_z8.d.mts} +1 -1
- package/dist/{index-CagRgpXI2.d.mts → index-ChB3K_a12.d.mts} +1 -1
- package/dist/{index-BrAp9ntB.d.mts → index-CxxqBc3y.d.mts} +87 -87
- package/dist/{index-BxuiHVFi.d.mts → index-DA5S_dj8.d.mts} +1 -1
- package/dist/{index-BXWTilGs.d.mts → index-DHejCnq8.d.mts} +3 -3
- package/dist/{index-kqxUXYe7.d.mts → index-DL1L6Pvw.d.mts} +6 -6
- package/dist/{index-CHjKP5G0.d.mts → index-DeLkAZZ2.d.mts} +23 -10
- package/dist/{index-Cq6rXKae.d.mts → index-GmoTPQcx.d.mts} +92 -92
- package/dist/{index-D75FnT0B.d.mts → index-TWs1TQ2-.d.mts} +1 -1
- package/dist/index-n9dy5seY.d.mts +817 -0
- package/dist/{index-MTvmxwiu2.d.mts → index-wP-qhIoT2.d.mts} +4 -4
- 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 +1 -1
- package/dist/kernel/index.d.mts +5 -5
- package/dist/kernel/namespace/index.d.mts +1 -1
- package/dist/kernel/observability/index.d.mts +1 -1
- package/dist/kernel/providers/index.d.mts +1 -1
- package/dist/kernel/window/index.d.mts +1 -1
- package/dist/{lib-DktBDEoY.mjs → lib-6P8_sBCe.mjs} +1 -1
- package/dist/{lib-DIVnpS8e.mjs → lib-DhbCgfYD.mjs} +1 -1
- package/dist/{load-extensions-nqL5WAKj.mjs → load-extensions-5VckHXuw.mjs} +1 -1
- package/dist/{load-extensions-_EnedkUp.d.mts → load-extensions-jGQgvw6Z.d.mts} +1 -1
- package/dist/materialization-BBxXhthv.mjs +1 -0
- package/dist/mcp-http-server/index.mjs +1 -1
- package/dist/{namespace-dgNmx9g3.d.mts → namespace-BF1FZKiV.d.mts} +27 -27
- package/dist/{namespace-CukqFYHf2.d.mts → namespace-BQhnjUvN2.d.mts} +1 -1
- package/dist/{namespace-TLkZRkcU.d.mts → namespace-CXoCX9u1.d.mts} +20 -20
- package/dist/{namespace-BoA6u44C.d.mts → namespace-CbQ8hdd8.d.mts} +2 -2
- package/dist/{namespace-rO-C2Dgu2.d.mts → namespace-Cv8zbqwY.d.mts} +2 -2
- 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/{package-CsFFT9iR.mjs → package-Brt4dhRC.mjs} +1 -1
- package/dist/package.json +1 -1
- package/dist/packages-BBJsifai.d.mts +532 -0
- package/dist/packages-I0D3JP9L.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.mjs +1 -1
- package/dist/runtime-node/extension-discovery.d.mts +1 -1
- package/dist/runtime-node/extension-validation.d.mts +1 -1
- package/dist/runtime-node/extension-validation.mjs +1 -1
- package/dist/runtime-node/index.d.mts +3 -3
- package/dist/runtime-node/index.mjs +23 -23
- 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-CxN7d_MU.d.mts → schema-BwJf2zRN.d.mts} +1 -1
- package/dist/schemas-6H-dlMrB.mjs +1 -0
- package/dist/{schemas-OaBqeEUT.d.mts → schemas-D6zcRPQo.d.mts} +2 -2
- package/dist/{schemas-CIO03KSD2.d.mts → schemas-tF70HEfT.d.mts} +17 -17
- 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 +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/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/schemas.d.mts +1 -1
- package/dist/services/filesystem/index.d.mts +1 -1
- package/dist/services/filesystem/index.mjs +1 -1
- package/dist/services/filesystem/namespace.d.mts +12 -12
- package/dist/services/filesystem/schemas.d.mts +6 -6
- package/dist/services/git/namespace.mjs +1 -1
- package/dist/services/git/schemas.mjs +1 -1
- package/dist/services/harness/index.mjs +1 -1
- package/dist/services/index.d.mts +59 -308
- package/dist/services/index.mjs +1 -1
- package/dist/services/log-import/browser.d.mts +2 -2
- package/dist/services/log-import/index.d.mts +2 -2
- package/dist/services/log-import/log-import.d.mts +1 -1
- package/dist/services/log-import/log-import.mjs +1 -1
- package/dist/services/log-import/namespace.mjs +1 -1
- package/dist/services/log-import/schemas.mjs +1 -1
- package/dist/services/materialization/index.d.mts +76 -0
- package/dist/services/materialization/index.mjs +1 -0
- 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-runtime/index.mjs +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/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/testing/index.mjs +1 -1
- package/dist/services/session/testing/orchestrator-shared.d.mts +1 -1
- package/dist/services/session/testing/orchestrator-shared.mjs +1 -1
- package/dist/services/session/turns/namespace.d.mts +1 -1
- package/dist/services/session-editor/index.d.mts +1 -1
- package/dist/services/settings/index.d.mts +3 -3
- package/dist/services/settings/namespace.d.mts +14 -14
- 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/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/{src-Bo2eA51B.mjs → src-T5DtFSyU.mjs} +1 -1
- package/dist/storage/drizzle/client.d.mts +1 -1
- package/dist/storage/drizzle/client.mjs +1 -1
- package/dist/storage/drizzle/index.d.mts +1 -1
- package/dist/storage/drizzle/index.mjs +1 -1
- package/dist/storage/handlers/drizzle/index.d.mts +1 -1
- package/dist/storage/handlers/drizzle/index.mjs +1 -1
- package/dist/storage/handlers/index.d.mts +1 -1
- package/dist/storage/handlers/index.mjs +1 -1
- package/dist/tools-CWSuNk-M.mjs +1 -0
- package/dist/{transition-DjipYcC3.d.mts → transition-C9UOqw0W.d.mts} +2 -2
- package/dist/{types-B-xY9WW2.d.mts → types-Be7wY1De.d.mts} +1 -1
- package/dist/{types-DQsYUZwa.d.mts → types-he1s7Vd_.d.mts} +37 -37
- package/dist/ui-kernel/index.d.mts +1 -1
- package/dist/ui-kernel/pages/schemas.d.mts +1 -1
- package/dist/utils/index.d.mts +20 -1
- package/dist/utils/index.mjs +2 -2
- package/dist/view-builder-D75mQTa1.d.mts +618 -0
- package/dist/{workflow-DFJYGjq_.mjs → workflow-DPeE6-Ta.mjs} +1 -1
- package/dist/workflow-engine/index.d.mts +68 -68
- package/dist/workflow-engine/index.mjs +1 -1
- package/dist/workflow-engine/package.d.mts +1 -1
- package/dist/workflow-engine/package.mjs +1 -1
- package/dist/workflow-engine/workflow-orchestrator.mjs +1 -1
- package/dist/{workflow-worker-BEFjCccX.mjs → workflow-worker-CPCh68Qf.mjs} +1 -1
- package/package.json +6 -2
- package/dist/definition-D7qCBmtc.d.mts +0 -60
- package/dist/index-CidblQAY.d.mts +0 -355
- package/dist/materialization-BwTORtBr.mjs +0 -1
- package/dist/schemas-DlCdlCEF.d.mts +0 -153
- package/dist/schemas-DlrQ0227.mjs +0 -1
- package/dist/tools-PC_L6g2m.mjs +0 -1
- /package/dist/{adapter-auth-runtime-a4O7cSNP.mjs → adapter-auth-runtime-CotG_6M4.mjs} +0 -0
- /package/dist/{adapter-binding-DDUyv1JK.d.mts → adapter-binding-DQ1HrGcH.d.mts} +0 -0
- /package/dist/{ajv-DfHhgdS5.mjs → ajv-WvFKnw8d.mjs} +0 -0
- /package/dist/{await-trigger-DP-fTQc4.mjs → await-trigger-COHFNyNi.mjs} +0 -0
- /package/dist/{base-orchestrator-BiShpVKL.d.mts → base-orchestrator-p3zIcnaJ.d.mts} +0 -0
- /package/dist/{capability-service-Dg2bU8qc.mjs → capability-service-TCOwWrLi.mjs} +0 -0
- /package/dist/{client-DmJwprw1.d.mts → client-CGEyBWKl.d.mts} +0 -0
- /package/dist/{client-binary-version-verifier-BK_vIjIo.mjs → client-binary-version-verifier-CaFlNNjs.mjs} +0 -0
- /package/dist/{client-binary-version-verifier-BwrMTAh2.d.mts → client-binary-version-verifier-WsNRplFB.d.mts} +0 -0
- /package/dist/{clients-namespace-B96QIJOs.d.mts → clients-namespace-ClKm1GLT.d.mts} +0 -0
- /package/dist/{config-namespace-x0fuhEXe.d.mts → config-namespace-DOw8R5eb.d.mts} +0 -0
- /package/dist/{create-static-mount-CBTXRtbN.mjs → create-static-mount-DM9qO98Q.mjs} +0 -0
- /package/dist/{cross-spawn-D9WWFl2a.mjs → cross-spawn-CVfmnMVP.mjs} +0 -0
- /package/dist/{cursor-storage-Bw-7ROzx.mjs → cursor-storage-BoFVjVGq.mjs} +0 -0
- /package/dist/{definition-BsTlOz99.d.mts → definition-BZrouYAq.d.mts} +0 -0
- /package/dist/{definition-Cbl0k6Fc.d.mts → definition-ClKlXenJ.d.mts} +0 -0
- /package/dist/{descriptor-to-package-Rs-OjOQU.mjs → descriptor-to-package-DCwvJoUE.mjs} +0 -0
- /package/dist/{drizzle-DYfaDzlO.mjs → drizzle-BQDvlDL2.mjs} +0 -0
- /package/dist/{esm-C_WW4-pP.mjs → esm-1UzF2r1U.mjs} +0 -0
- /package/dist/{event-DTM0-qWP.mjs → event-Ddxe4yp9.mjs} +0 -0
- /package/dist/{execution-target-Bg2wpfML.mjs → execution-target-D6PoGaO8.mjs} +0 -0
- /package/dist/{extension-discovery-APMf1Tes.d.mts → extension-discovery-Cce4FmRu.d.mts} +0 -0
- /package/dist/{filesystem-service-Bx0bR2Lb.d.mts → filesystem-service-CWBzOEAA.d.mts} +0 -0
- /package/dist/{handler-4pKQi3eo.mjs → handler-Bxs0moLY.mjs} +0 -0
- /package/dist/{identity-2qUT1NME.mjs → identity-D481xSkS.mjs} +0 -0
- /package/dist/{index-FDyqQIt5.d.mts → index-4b-ig5Uf.d.mts} +0 -0
- /package/dist/{index-Bv9lm0Kf.d.mts → index-BOlzcjwS.d.mts} +0 -0
- /package/dist/{index-S-mAqWwq.d.mts → index-BRdPSBFH2.d.mts} +0 -0
- /package/dist/{index-BmsPH78f2.d.mts → index-BcqWLD6J.d.mts} +0 -0
- /package/dist/{index-DmuGKvE2.d.mts → index-BfNfKh4y.d.mts} +0 -0
- /package/dist/{index-CSxfU0tB.d.mts → index-BjgfHTX4.d.mts} +0 -0
- /package/dist/{index-CarbJsC92.d.mts → index-BrvsExEF.d.mts} +0 -0
- /package/dist/{index-D0eUQjTU2.d.mts → index-C2PHX5Em.d.mts} +0 -0
- /package/dist/{index-BZ_DSGnE.d.mts → index-CNS1jyBU.d.mts} +0 -0
- /package/dist/{index-DoLdETfR.d.mts → index-CQco6KNL.d.mts} +0 -0
- /package/dist/{index-C18Pn3zP.d.mts → index-ChsmMZmN.d.mts} +0 -0
- /package/dist/{index-DwDBa2mb.d.mts → index-D3cH5U0n.d.mts} +0 -0
- /package/dist/{index-T96ydgVk.d.mts → index-DAVLhzkq.d.mts} +0 -0
- /package/dist/{index-9dISOTLT.d.mts → index-DIAmg04s.d.mts} +0 -0
- /package/dist/{index-DlAfs3RD.d.mts → index-DKCFz7dL.d.mts} +0 -0
- /package/dist/{index-DvaPrL6C.d.mts → index-DbP0yaRw.d.mts} +0 -0
- /package/dist/{index-2PsDAhPN.d.mts → index-DnPJWaO7.d.mts} +0 -0
- /package/dist/{index-DXBiCH2y.d.mts → index-Dx6P-ajY.d.mts} +0 -0
- /package/dist/{index-Rhcr4YNA.d.mts → index-Jec13bI-2.d.mts} +0 -0
- /package/dist/{index-BkAKfh4d.d.mts → index-M8rNEeH8.d.mts} +0 -0
- /package/dist/{index-DnWZdG6C.d.mts → index-NZ-gfUOw.d.mts} +0 -0
- /package/dist/{index-DfVSWBBp.d.mts → index-RtP5Mi4D.d.mts} +0 -0
- /package/dist/{index-_zsihEmk.d.mts → index-XLGBNeu0.d.mts} +0 -0
- /package/dist/{index-Bd52mmj9.d.mts → index-fFSPF7N0.d.mts} +0 -0
- /package/dist/{index-Ctw617Tj.d.mts → index-p1N3ZuqF.d.mts} +0 -0
- /package/dist/{json-value-C8duSh9X.d.mts → json-value-BsWNQQbr.d.mts} +0 -0
- /package/dist/{jsonl-transport-l5NPcQ_2.mjs → jsonl-transport-B70HQ9l1.mjs} +0 -0
- /package/dist/{lib-ClRTNIuz.mjs → lib-C_apP_9s.mjs} +0 -0
- /package/dist/{model-registry-C8MInDtX.mjs → model-registry-C3NX834K.mjs} +0 -0
- /package/dist/{namespace-HsI0Jbbr.mjs → namespace-B1_egU5J.mjs} +0 -0
- /package/dist/{namespace-Dar3O6iT.d.mts → namespace-BTp6-zD8.d.mts} +0 -0
- /package/dist/{namespace-Bl1UhLnK.d.mts → namespace-BqlDkdht2.d.mts} +0 -0
- /package/dist/{namespace-DoNigVgx.d.mts → namespace-BwAiuQ2_.d.mts} +0 -0
- /package/dist/{namespace-3YVLQ_bM.d.mts → namespace-CU1jSw6E.d.mts} +0 -0
- /package/dist/{namespace-BcDHt-ww.d.mts → namespace-CddQuUvG.d.mts} +0 -0
- /package/dist/{namespace-BsEoWXV_.d.mts → namespace-DNgZ_rfi.d.mts} +0 -0
- /package/dist/{namespace-VmsT_tLJ.d.mts → namespace-Dzbt8LqQ.d.mts} +0 -0
- /package/dist/{namespace-Dvi66QS6.d.mts → namespace-SwgMs4rw.d.mts} +0 -0
- /package/dist/{namespace-BhVlHfoO.d.mts → namespace-UCwUrFRx.d.mts} +0 -0
- /package/dist/{namespace-Xp9-g_r-.mjs → namespace-kIjqar0Y.mjs} +0 -0
- /package/dist/{orchestrator-shared-pxtyNu3W.d.mts → orchestrator-shared-DrEFeZYw.d.mts} +0 -0
- /package/dist/{orchestrator-shared-DAkGOu9H.mjs → orchestrator-shared-jYk9mi5C.mjs} +0 -0
- /package/dist/{out-BB6Kb4Xu.mjs → out-B6fO6go6.mjs} +0 -0
- /package/dist/{package-BYpWkSuQ.mjs → package-3cW8oIkI.mjs} +0 -0
- /package/dist/{package-DG9GSY8M.d.mts → package-BVm1EakP.d.mts} +0 -0
- /package/dist/{providers-namespace-O4de1tgO.d.mts → providers-namespace-Bl3M8Ibo.d.mts} +0 -0
- /package/dist/{quick-lru-BLaSzINB.mjs → quick-lru-Coxb6GVa.mjs} +0 -0
- /package/dist/{registry-TJjQgTgp.mjs → registry-ElIHcMM2.mjs} +0 -0
- /package/dist/{schemas-9QJf1FtS.d.mts → schemas-B3K1ekm7.d.mts} +0 -0
- /package/dist/{schemas-jDRSOXJL.d.mts → schemas-BKgUDm_a2.d.mts} +0 -0
- /package/dist/{schemas-XRhqOgVE.d.mts → schemas-CVbfHPw-.d.mts} +0 -0
- /package/dist/{schemas-CLsbsX1W.d.mts → schemas-CzT0LApM.d.mts} +0 -0
- /package/dist/{schemas-D_9X_CRo.d.mts → schemas-DPosZWw-.d.mts} +0 -0
- /package/dist/{schemas-fRLDhefF.d.mts → schemas-D_H0ztxl.d.mts} +0 -0
- /package/dist/{schemas-qpo1Goit.d.mts → schemas-DfZ85CRF2.d.mts} +0 -0
- /package/dist/{schemas-K3Td_WdR.d.mts → schemas-Dq_g7Giu.d.mts} +0 -0
- /package/dist/{schemas-DwfTUQIa.mjs → schemas-FiDj_kLq.mjs} +0 -0
- /package/dist/{schemas-qt5QTjVc.d.mts → schemas-pl0mzEtO.d.mts} +0 -0
- /package/dist/{server-lifecycle-D-jxVr_0.mjs → server-lifecycle-DLdh0-4H.mjs} +0 -0
- /package/dist/{server-lifecycle-r5Tkk8bU.d.mts → server-lifecycle-DzO3rjKP.d.mts} +0 -0
- /package/dist/{session-lineage-YShrn77v.d.mts → session-lineage-COFDOi7x.d.mts} +0 -0
- /package/dist/{src-Ci_WY9uw.mjs → src-Dqa1n_kI.mjs} +0 -0
- /package/dist/{storage-namespace-BzE2M4Hq.mjs → storage-namespace-B1_x8Ho2.mjs} +0 -0
- /package/dist/{storage-namespace-DWKFqEW-.d.mts → storage-namespace-D4yQ--Sp.d.mts} +0 -0
- /package/dist/{storage-namespace-definition-BZJGSaX3.d.mts → storage-namespace-definition-BzSaRLtZ.d.mts} +0 -0
- /package/dist/{supports-color-Dzp6WuF5.mjs → supports-color-CCdGjFUY.mjs} +0 -0
- /package/dist/{tool-approval-service-Dh0XI21f.mjs → tool-approval-service-BgSn_6NT.mjs} +0 -0
- /package/dist/{tray-menu-service-Bonl2KXf.mjs → tray-menu-service-BJ9r7IY3.mjs} +0 -0
- /package/dist/{types-BCW9kr4L.d.mts → types-B9QOZAZ5.d.mts} +0 -0
- /package/dist/{types-DWNoZ3Sd.d.mts → types-Bgb8eQkd.d.mts} +0 -0
- /package/dist/{types-DvKaEOOn.d.mts → types-C8_OhAFv.d.mts} +0 -0
- /package/dist/{types-CrJ7KEZ0.d.mts → types-Diu9uAnB.d.mts} +0 -0
- /package/dist/{window-registry-WsWu-rcK.d.mts → window-registry-CHv3cgSN.d.mts} +0 -0
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
//#region core/contracts/src/materialization/schemas.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Discriminated target that a surface binding maps to on the external provider.
|
|
6
|
-
*
|
|
7
|
-
* Each variant carries the fields required to identify the target element
|
|
8
|
-
* on the provider surface:
|
|
9
|
-
*
|
|
10
|
-
* - `'label'` — a label or tag on the issue/work item (optional prefix filter)
|
|
11
|
-
* - `'field'` — a named custom field on the work item (optional external field id)
|
|
12
|
-
* - `'issue-type'` — a named issue type classification (optional external type id)
|
|
13
|
-
* - `'body-fragment'` — a named slot in the issue or PR body
|
|
14
|
-
* - `'comment'` — a structured comment rendered from a template string
|
|
15
|
-
*/
|
|
16
|
-
declare const SurfaceBindingTargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
17
|
-
kind: z.ZodLiteral<"label">;
|
|
18
|
-
prefix: z.ZodOptional<z.ZodString>;
|
|
19
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
20
|
-
kind: z.ZodLiteral<"field">;
|
|
21
|
-
name: z.ZodString;
|
|
22
|
-
fieldId: z.ZodOptional<z.ZodString>;
|
|
23
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
24
|
-
kind: z.ZodLiteral<"issue-type">;
|
|
25
|
-
name: z.ZodString;
|
|
26
|
-
typeId: z.ZodOptional<z.ZodString>;
|
|
27
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
28
|
-
kind: z.ZodLiteral<"body-fragment">;
|
|
29
|
-
slot: z.ZodString;
|
|
30
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
31
|
-
kind: z.ZodLiteral<"comment">;
|
|
32
|
-
template: z.ZodString;
|
|
33
|
-
}, z.core.$strip>], "kind">;
|
|
34
|
-
/**
|
|
35
|
-
* Serializable registration record for a surface binding.
|
|
36
|
-
*
|
|
37
|
-
* Surface binding registrations describe how a framework namespace maps to a
|
|
38
|
-
* provider-specific surface element (field, label, issue type, etc.).
|
|
39
|
-
* Registrations are declared by product extensions and consumed by
|
|
40
|
-
* materialization adapters at sync time.
|
|
41
|
-
*
|
|
42
|
-
* The `id` field is a dot-namespaced stable string (e.g. `'github.status.field'`).
|
|
43
|
-
*/
|
|
44
|
-
declare const SurfaceBindingRegistrationSchema: z.ZodObject<{
|
|
45
|
-
id: z.ZodString;
|
|
46
|
-
provider: z.ZodString;
|
|
47
|
-
namespace: z.ZodString;
|
|
48
|
-
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
49
|
-
kind: z.ZodLiteral<"label">;
|
|
50
|
-
prefix: z.ZodOptional<z.ZodString>;
|
|
51
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
52
|
-
kind: z.ZodLiteral<"field">;
|
|
53
|
-
name: z.ZodString;
|
|
54
|
-
fieldId: z.ZodOptional<z.ZodString>;
|
|
55
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
56
|
-
kind: z.ZodLiteral<"issue-type">;
|
|
57
|
-
name: z.ZodString;
|
|
58
|
-
typeId: z.ZodOptional<z.ZodString>;
|
|
59
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
60
|
-
kind: z.ZodLiteral<"body-fragment">;
|
|
61
|
-
slot: z.ZodString;
|
|
62
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
63
|
-
kind: z.ZodLiteral<"comment">;
|
|
64
|
-
template: z.ZodString;
|
|
65
|
-
}, z.core.$strip>], "kind">;
|
|
66
|
-
appliesTo: z.ZodArray<z.ZodEnum<{
|
|
67
|
-
artifact: "artifact";
|
|
68
|
-
workpiece: "workpiece";
|
|
69
|
-
surface: "surface";
|
|
70
|
-
}>>;
|
|
71
|
-
valueMapping: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
72
|
-
description: z.ZodOptional<z.ZodString>;
|
|
73
|
-
}, z.core.$strip>;
|
|
74
|
-
/** Serializable registration record for a surface binding. */
|
|
75
|
-
type SurfaceBindingRegistration = z.infer<typeof SurfaceBindingRegistrationSchema>;
|
|
76
|
-
/** Discriminated target on the external provider surface. */
|
|
77
|
-
type SurfaceBindingTarget = z.infer<typeof SurfaceBindingTargetSchema>;
|
|
78
|
-
/** Semantic hint for provider-neutral artifact projected fields. */
|
|
79
|
-
declare const ProjectedFieldSemanticSchema: z.ZodEnum<{
|
|
80
|
-
status: "status";
|
|
81
|
-
workflow: "workflow";
|
|
82
|
-
priority: "priority";
|
|
83
|
-
}>;
|
|
84
|
-
/** A provider-neutral field from artifact data that may be projected to an external surface. */
|
|
85
|
-
declare const ProjectedFieldSchema: z.ZodObject<{
|
|
86
|
-
path: z.ZodString;
|
|
87
|
-
semantic: z.ZodOptional<z.ZodEnum<{
|
|
88
|
-
status: "status";
|
|
89
|
-
workflow: "workflow";
|
|
90
|
-
priority: "priority";
|
|
91
|
-
}>>;
|
|
92
|
-
}, z.core.$strip>;
|
|
93
|
-
/** Semantic hint for provider-neutral artifact projected fields. */
|
|
94
|
-
type ProjectedFieldSemantic = z.infer<typeof ProjectedFieldSemanticSchema>;
|
|
95
|
-
/** A provider-neutral artifact field projection declaration. */
|
|
96
|
-
type ProjectedField = z.infer<typeof ProjectedFieldSchema>;
|
|
97
|
-
/**
|
|
98
|
-
* Projection policy that controls how an artifact kind surfaces on a provider.
|
|
99
|
-
*
|
|
100
|
-
* - `'none'` — the artifact is never materialized to a provider surface
|
|
101
|
-
* - `'surface'` — the artifact maps to a provider work item or issue
|
|
102
|
-
* - `'comment'` — the artifact is rendered as a structured comment on an existing item
|
|
103
|
-
*/
|
|
104
|
-
declare const ArtifactProjectionPolicySchema: z.ZodObject<{
|
|
105
|
-
mode: z.ZodEnum<{
|
|
106
|
-
none: "none";
|
|
107
|
-
comment: "comment";
|
|
108
|
-
surface: "surface";
|
|
109
|
-
}>;
|
|
110
|
-
defaultRole: z.ZodOptional<z.ZodEnum<{
|
|
111
|
-
artifact: "artifact";
|
|
112
|
-
workpiece: "workpiece";
|
|
113
|
-
}>>;
|
|
114
|
-
semanticEvents: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
115
|
-
created: "created";
|
|
116
|
-
revised: "revised";
|
|
117
|
-
"status-changed": "status-changed";
|
|
118
|
-
"observation-added": "observation-added";
|
|
119
|
-
}>>>;
|
|
120
|
-
projectedFields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
121
|
-
path: z.ZodString;
|
|
122
|
-
semantic: z.ZodOptional<z.ZodEnum<{
|
|
123
|
-
status: "status";
|
|
124
|
-
workflow: "workflow";
|
|
125
|
-
priority: "priority";
|
|
126
|
-
}>>;
|
|
127
|
-
}, z.core.$strip>>>;
|
|
128
|
-
}, z.core.$strip>;
|
|
129
|
-
/** Projection policy that controls how an artifact kind surfaces on a provider. */
|
|
130
|
-
type ArtifactProjectionPolicy = z.infer<typeof ArtifactProjectionPolicySchema>;
|
|
131
|
-
/**
|
|
132
|
-
* A reference linking a framework artifact to an external provider object.
|
|
133
|
-
*
|
|
134
|
-
* `artifactId` and `provider`+`externalId` together form the composite primary
|
|
135
|
-
* key for a materialization ref. The `surfaceRole` captures whether the artifact
|
|
136
|
-
* was materialized as the top-level workpiece or as a subordinate artifact record.
|
|
137
|
-
*/
|
|
138
|
-
declare const ArtifactMaterializationRefSchema: z.ZodObject<{
|
|
139
|
-
artifactId: z.ZodString;
|
|
140
|
-
provider: z.ZodString;
|
|
141
|
-
externalId: z.ZodString;
|
|
142
|
-
externalUrl: z.ZodOptional<z.ZodString>;
|
|
143
|
-
surfaceRole: z.ZodEnum<{
|
|
144
|
-
artifact: "artifact";
|
|
145
|
-
workpiece: "workpiece";
|
|
146
|
-
}>;
|
|
147
|
-
lastSyncedRevision: z.ZodOptional<z.ZodString>;
|
|
148
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
149
|
-
}, z.core.$strip>;
|
|
150
|
-
/** A reference linking a framework artifact to an external provider object. */
|
|
151
|
-
type ArtifactMaterializationRef = z.infer<typeof ArtifactMaterializationRefSchema>;
|
|
152
|
-
//#endregion
|
|
153
|
-
export { ProjectedField as a, ProjectedFieldSemanticSchema as c, SurfaceBindingTarget as d, SurfaceBindingTargetSchema as f, ArtifactProjectionPolicySchema as i, SurfaceBindingRegistration as l, ArtifactMaterializationRefSchema as n, ProjectedFieldSchema as o, ArtifactProjectionPolicy as r, ProjectedFieldSemantic as s, ArtifactMaterializationRef as t, SurfaceBindingRegistrationSchema as u };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{z as e}from"zod";const t=e.discriminatedUnion(`kind`,[e.object({kind:e.literal(`label`),prefix:e.string().min(1).optional()}),e.object({kind:e.literal(`field`),name:e.string().min(1),fieldId:e.string().min(1).optional()}),e.object({kind:e.literal(`issue-type`),name:e.string().min(1),typeId:e.string().min(1).optional()}),e.object({kind:e.literal(`body-fragment`),slot:e.string().min(1)}),e.object({kind:e.literal(`comment`),template:e.string().min(1)})]),n=e.object({id:e.string().min(1),provider:e.string().min(1),namespace:e.string().min(1),target:t,appliesTo:e.array(e.enum([`workpiece`,`artifact`,`surface`])).min(1),valueMapping:e.record(e.string(),e.string()).optional(),description:e.string().min(1).optional()}),r=e.enum([`status`,`workflow`,`priority`]),i=e.object({path:e.string().min(1),semantic:r.optional()}),a=e.object({mode:e.enum([`none`,`surface`,`comment`]),defaultRole:e.enum([`workpiece`,`artifact`]).optional(),semanticEvents:e.array(e.enum([`created`,`revised`,`status-changed`,`observation-added`])).optional(),projectedFields:e.array(i).optional()}),o=e.object({artifactId:e.string().min(1),provider:e.string().min(1),externalId:e.string().min(1),externalUrl:e.string().optional(),surfaceRole:e.enum([`workpiece`,`artifact`]),lastSyncedRevision:e.string().optional(),metadata:e.record(e.string(),e.unknown()).optional()});export{n as a,r as i,a as n,t as o,i as r,o as t};
|
package/dist/tools-PC_L6g2m.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{B as e,b as t}from"./handlers-RGs3eC9X.mjs";import{SessionStorageSubjects as n}from"./services/session/storage/namespace.mjs";import{$ as r,D as i,L as a,W as o,a as s,b as c,c as l,f as u,i as d,j as f,n as ee,q as te,r as ne,tt as re}from"./session-CAjudDuJ.mjs";import{n as p}from"./namespace-D7pE2QWv.mjs";import{t as ie}from"./capability-service-Dg2bU8qc.mjs";import"./services/adapter-subsystem/index.mjs";import{i as ae,s as oe}from"./model-registry-C8MInDtX.mjs";import{t as se}from"./tool-approval-service-Dh0XI21f.mjs";import{t as ce}from"./tray-menu-service-Bonl2KXf.mjs";import{r as m,t as h}from"./handler-4pKQi3eo.mjs";import{r as le}from"./package-BYpWkSuQ.mjs";import{t as ue}from"./filesystem-service-maY_P3yA.mjs";import{z as g}from"zod";import{createHash as de}from"node:crypto";import{MakaioError as fe,createMakaioContext as pe}from"@makaio/framework/core";import{MakaioBus as _}from"@makaio/framework/bus";import{AdapterSubjects as me,ArtifactSubjects as v,CanonicalModelSubjects as he,DEFAULT_HARNESSES as ge,HarnessDefinitionCreateSchema as _e,HarnessSubjects as y,JsonValueSchema as ve,ToolSubjects as b,TransitionRuleDefinitionSchema as ye,WorkflowBlocksSubjects as be,WorkflowSubjects as xe,dep as x,extensionToken as S,validateToolAdapterIdentity as Se,zodSchemaToJsonRecord as C}from"@makaio/framework/contracts";import{BaseService as w}from"@makaio/framework/service-base";import{registerDrizzleHandlers as T}from"@makaio/framework/storage/drizzle";import{slugifyProviderConfigName as E}from"@makaio/framework/contracts/config";import{ClientAccountIdentifierSchema as Ce,ClientSessionAccountObserveSchema as we,ClientSubjects as D}from"@makaio/framework/contracts/client";import{FacetSubjects as O}from"@makaio/framework/contracts/facet";import{MaterializationSubjects as k}from"@makaio/framework/contracts/materialization";import{FILE_ACCESS_RULES_KEY as Te,FILE_ACCESS_RULES_KEY as Ee,ToolErrorCodes as A,errorToToolResult as De,extractToolFilePath as Oe,toolError as j,toolSuccess as ke}from"@makaio/framework/tools";import{ConditionSchema as Ae,evaluate as je}from"@makaio/framework/rules";import{evaluateSync as Me}from"@makaio/framework/expression";import{GitService as Ne}from"@makaio/framework/git";const Pe=[{type:`supersedes`,symmetry:`asymmetric`},{type:`contradicts`,symmetry:`symmetric`},{type:`derives_from`,symmetry:`asymmetric`},{type:`responds_to`,symmetry:`asymmetric`},{type:`contains`,symmetry:`asymmetric`},{type:`refines`,symmetry:`asymmetric`},{type:`scopes`,symmetry:`asymmetric`},{type:`references`,symmetry:`asymmetric`},{type:`evidenced_by`,symmetry:`asymmetric`}],M={extension:0,"factory-repo":1,"target-repo":2},N={source:`extension`,ownerKey:`extension:bus`};function P(e){return`${e.source}:${e.ownerKey}`}function Fe(e,t){return e.source===t.source&&e.ownerKey===t.ownerKey}function F(e){return structuredClone(e)}function I(e,t){return`${e}@${t}`}var L=class extends w{kinds=new Map;kindContributions=new Map;nextKindContributionOrder=0;relationTypes=new Map;constructor(e){super(e)}async onInit(){for(let e of Pe)this.relationTypes.set(e.type,e);this.registerHandler(v.kind.register,e=>{this.registerKind(e.payload),e.setResult({registered:!0})}),this.registerHandler(v.kind.list,e=>{let{kind:t}=e.payload,n=[...this.kinds.values()].filter(e=>!t||e.kind===t).map(F);e.setResult({kinds:n})}),this.registerHandler(v[`relation-type`].register,e=>{this.storeRelationType(e.payload),e.setResult({registered:!0})}),this.registerHandler(v[`relation-type`].list,e=>{let{type:t}=e.payload,n=[...this.relationTypes.values()].filter(e=>!t||e.type===t).map(F);e.setResult({relationTypes:n})})}compareKindContributions(e,t){let n=M[e.owner.source]-M[t.owner.source];return n===0?e.owner.source===`extension`?t.order-e.order:e.order-t.order:n}findSameTierRepoConflict(e,t,n){return[...e.values()].find(e=>!Fe(e.owner,t)&&e.owner.source===t.source&&t.source!==`extension`&&e.order<=n)}recomputeKindWinner(e){let t=this.kindContributions.get(e),n=this.kinds.get(e);if(t===void 0||t.size===0){this.kindContributions.delete(e),this.kinds.delete(e),this.emitKindChangedFromKey(e,n);return}let r;for(let e of t.values())(r===void 0||this.compareKindContributions(e,r)<0)&&(r=e);let i=r;this.kinds.set(e,F(i.registration)),JSON.stringify(n)!==JSON.stringify(i.registration)&&this.bus.emit(v.kind.changed,{kind:i.registration.kind,schemaVersion:i.registration.schemaVersion})}emitKindChangedFromKey(e,t){t!==void 0&&this.bus.emit(v.kind.changed,{kind:t.kind,schemaVersion:t.schemaVersion})}registerKind(e,t=N){let n=I(e.kind,e.schemaVersion),r=this.kindContributions.get(n)??new Map,i=P(t),a=r.get(i),o=t.source===`extension`?this.nextKindContributionOrder:a?.order??this.nextKindContributionOrder,s=this.findSameTierRepoConflict(r,t,o);if(s!==void 0){console.warn(`[ArtifactSchemaRegistry] Artifact kind '${n}' is already registered by '${s.owner.ownerKey}' at the same priority; keeping the existing owner.`);return}r.set(i,{owner:t,registration:F(e),order:t.source===`extension`||a===void 0?this.nextKindContributionOrder++:a.order}),this.kindContributions.set(n,r),this.recomputeKindWinner(n)}deregisterKind(e,t,n=N){let r=I(e,t),i=this.kindContributions.get(r);i!==void 0&&(i.delete(P(n)),this.recomputeKindWinner(r))}replaceKindRegistrationsForOwner(e,t){let n=new Set,r=P(e),i=new Map;for(let[e,t]of this.kindContributions.entries()){let a=t.get(r);a!==void 0&&(i.set(e,a.order),t.delete(r),n.add(e))}for(let a of t){let t=I(a.kind,a.schemaVersion),o=this.kindContributions.get(t)??new Map,s=e.source===`extension`?void 0:i.get(t),c=s??this.nextKindContributionOrder,l=this.findSameTierRepoConflict(o,e,c);if(l!==void 0){console.warn(`[ArtifactSchemaRegistry] Artifact kind '${t}' is already registered by '${l.owner.ownerKey}' at the same priority; keeping the existing owner.`);continue}o.set(r,{owner:e,registration:F(a),order:s??this.nextKindContributionOrder++}),this.kindContributions.set(t,o),n.add(t)}for(let e of n)this.recomputeKindWinner(e)}storeRelationType(e){let t=this.relationTypes.get(e.type);if(t){if(t.symmetry!==e.symmetry)throw Error(`Relation type '${e.type}' is already registered with different symmetry (existing: '${t.symmetry}', new: '${e.symmetry}')`);return}this.relationTypes.set(e.type,F(e))}getKind(e,t){let n=this.kinds.get(I(e,t));return n?F(n):void 0}getRelationType(e){let t=this.relationTypes.get(e);return t?F(t):void 0}onDestroy(){this.kinds.clear(),this.kindContributions.clear(),this.relationTypes.clear(),this.nextKindContributionOrder=0}},R=class extends Error{reason;hookId;constructor(e,t){super(`Artifact write rejected by hook '${t}': ${e}`),this.reason=e,this.hookId=t,this.name=`ArtifactLifecycleHookRejectedError`}};function z(e,t){return e?!(e.kind!==void 0&&e.kind!==`*`&&e.kind!==t.kind||e.schemaVersion!==void 0&&e.schemaVersion!==t.schemaVersion):!0}function B(e){return e.priority??0}function Ie(e,t,n){return e.filter(e=>e.event===t&&z(e.filter,n)).sort((e,t)=>B(t)-B(e))}function Le(e,t,n){return e.filter(e=>e.event===t&&z(e.filter,n)).sort((e,t)=>B(t)-B(e))}function Re(e,t){return{...e,...`data`in t?{data:t.data}:{},...`relations`in t?{relations:t.relations}:{},...`confidence`in t?{confidence:t.confidence}:{},...`representations`in t?{representations:t.representations}:{},...`actor`in t?{actor:t.actor}:{}}}function ze(e,t){let{confidence:n,representations:r,...i}=e;return{...i,data:t.data,relations:[...t.relations],...t.confidence===void 0?{}:{confidence:t.confidence},...t.representations===void 0?{}:{representations:t.representations},actor:t.actor}}var V=class extends w{registrations=new Map;constructor(e){super(e)}async onInit(){}onDestroy(){this.registrations.clear()}registerHooks(e,t){let n=[...t];this.registrations.set(e,n);let r=!1;return()=>{r||(r=!0,this.registrations.get(e)===n&&this.registrations.delete(e))}}allHooks(){let e=[];for(let t of this.registrations.values())e.push(...t);return e}async runBeforeCreate(e){return this.runBeforeHooks(`beforeCreate`,e)}async runBeforeRevise(e){return this.runBeforeHooks(`beforeRevise`,e)}async runBeforeHooks(e,t){let{draft:n,previous:r,kindRegistration:i}=t,a=Ie(this.allHooks(),e,n),o=new Map,s={kind:n.kind,schemaVersion:n.schemaVersion,scope:n.scope,data:n.data,relations:n.relations,...n.confidence===void 0?{}:{confidence:n.confidence},...n.representations===void 0?{}:{representations:n.representations},actor:n.actor},c=!1;for(let t of a){let n,a={event:e,get draft(){return s},previous:r,kindRegistration:i,bus:this.bus,meta:o,rejectCreation(e){n={reason:e}},skipMaterialization(){c=!0},updateDraft(e){s=Re(s,e)}};if(await t.handler(a),n)throw new R(n.reason,t.id)}return{draft:ze(n,s),skipMaterialization:c,meta:o}}async runAfterCreate(e){await this.runAfterHooks(`afterCreate`,`created`,e)}async runAfterRevise(e){await this.runAfterHooks(`afterRevise`,`revised`,e)}async runAfterStatusChanged(e){await this.runAfterHooks(`afterStatusChanged`,`status-changed`,e)}async runAfterObservationAdded(e){await this.runAfterHooks(`afterObservationAdded`,`observation-added`,e)}async runAfterHooks(e,t,n){let{artifact:r,previous:i,observation:a,kindRegistration:o,projectionPolicy:s,skipDefaultProjection:c,meta:l}=n,u=Le(this.allHooks(),e,r),d=this.bus,f=!1;for(let n of u){if(c&&(n.priority??0)<0||f&&(n.priority??0)<0)continue;let u={event:e,semanticEvent:t,artifact:r,previous:i?{refClass:`artifact`,id:i.id,revision:i.revision,kind:i.kind}:void 0,observation:a,kindRegistration:o,projectionPolicy:s,bus:d,meta:l,preventDefault(){f=!0},async resolveRelations(e){let t=r.relations.filter(t=>t.type===e).map(e=>e.target),n=[];for(let e of t){let t=e;if(t.refClass===`artifact`){let e=t,{artifact:r}=await d.request(v.resolve,{ref:e});r&&n.push(r)}}return n}};try{await n.handler(u)}catch(t){console.error(`[ArtifactLifecycleHookRegistry] Hook '${n.id}' threw during '${e}':`,t)}}}};function H(e){return structuredClone(e)}var Be=class extends w{namespaces=new Map;constructor(e){super(e)}async onInit(){this.registerHandler(O.namespace.register,e=>{this.registerNamespace(e.payload),e.setResult({registered:!0})}),this.registerHandler(O.namespace.list,e=>{let{namespace:t}=e.payload,n=[...this.namespaces.values()].filter(e=>!t||e.namespace===t).map(H);e.setResult({namespaces:n})})}registerNamespace(e){let t=this.namespaces.get(e.namespace);if(t){if(JSON.stringify(t)!==JSON.stringify(e))throw Error(`Facet namespace '${e.namespace}' is already registered with a different definition`);return}this.namespaces.set(e.namespace,H(e)),this.bus.emit(O.namespace.changed,{namespace:e.namespace})}deregisterNamespace(e){this.namespaces.delete(e)&&this.bus.emit(O.namespace.changed,{namespace:e})}getNamespace(e){let t=this.namespaces.get(e);return t?H(t):void 0}onDestroy(){this.namespaces.clear()}};function U(e){return structuredClone(e)}var Ve=class extends w{bindings=new Map;constructor(e){super(e)}async onInit(){this.registerHandler(k.surfaceBinding.register,e=>{this.registerBinding(e.payload),e.setResult({registered:!0})}),this.registerHandler(k.surfaceBinding.list,e=>{let{provider:t,namespace:n}=e.payload,r=[...this.bindings.values()].filter(e=>(!t||e.provider===t)&&(!n||e.namespace===n)).map(U);e.setResult({bindings:r})})}registerBinding(e){let t=this.bindings.get(e.id);if(t){if(JSON.stringify(t)!==JSON.stringify(e))throw Error(`Surface binding '${e.id}' is already registered with a different definition`);return}this.bindings.set(e.id,U(e)),this.bus.emit(k.surfaceBinding.changed,{id:e.id,provider:e.provider})}deregisterBinding(e){let t=this.bindings.get(e);t&&(this.bindings.delete(e),this.bus.emit(k.surfaceBinding.changed,{id:e,provider:t.provider}))}getBinding(e){let t=this.bindings.get(e);return t?U(t):void 0}onDestroy(){this.bindings.clear()}},W=class extends fe{code;suggestions;constructor(e,t,n){super(e),this.code=t,this.suggestions=n}},He=class{deps;constructor(e){this.deps=e}async resolve(e,t){switch(e.kind){case`bare`:return this.resolveBare(e.model);case`qualified`:return this.resolveQualified(e.segment1,e.segment2,e.model)}}async resolveBare(e){let t=await this.deps.resolveDefaultModelTarget(e);switch(t.kind){case`resolved`:return{kind:`adapter`,adapterName:t.target.adapterName,providerConfigId:t.target.providerConfigId,model:t.target.model};case`ambiguous`:throw new W(`Model "${e}" is available via multiple providers. Use a qualified reference to select one.`,`ambiguous-model`,t.matches.map(e=>e.qualifiedName));case`not-found`:throw new W(`Model "${e}" was not found in any enabled adapter's registry.`,`model-not-found`)}}async resolveQualified(e,t,n){return t===void 0?this.resolveQualifiedOneSegment(e,n):this.resolveQualifiedTwoSegments(e,t,n)}async resolveQualifiedTwoSegments(e,t,n){let r=await this.deps.listEnabledAdapterNames();if(!r.includes(e))throw new W(`Adapter "${e}" is not enabled or does not exist.`,`adapter-not-found`);return{kind:`adapter`,adapterName:e,providerConfigId:await this.resolveProviderSegment(t,e,r),model:n}}async resolveQualifiedOneSegment(e,t){let n=await this.deps.listEnabledAdapterNames();if(n.includes(e)){let n=await this.deps.getDefaultBinding(e);if(!n)throw new W(`Adapter "${e}" has no enabled provider binding. Configure or enable a provider binding first.`,`no-binding`);return{kind:`adapter`,adapterName:e,providerConfigId:n.providerConfigId,model:t}}let r=await this.deps.findProviderConfigByName(e);if(r)return{kind:`adapter`,adapterName:(await this.pickBindingForConfig(r.id,n)).adapterName,providerConfigId:r.id,model:t};let i=await this.deps.findProviderDefinition(e,n);if(i){let r=await this.deps.findDefaultConfigForDefinition(i.id);if(!r)throw new W(`Provider definition "${e}" exists but has no configured provider config. Create a provider config first.`,`provider-not-found`);return{kind:`adapter`,adapterName:(await this.pickBindingForConfig(r.id,n)).adapterName,providerConfigId:r.id,model:t}}throw new W(`"${e}" does not match any enabled adapter name, provider config name, or provider definition ID.`,`adapter-not-found`)}async resolveProviderSegment(e,t,n){let r=await this.deps.findProviderConfigByName(e);if(r)return await this.requireBindingForAdapterAndConfig(t,r.id,e),r.id;let i=await this.deps.findProviderDefinition(e,n);if(i){let n=await this.deps.findConfigForDefinitionAndAdapter(i.id,t);if(!n)throw new W(`Provider definition "${e}" has no enabled config bound to adapter "${t}". Create a provider config and binding first.`,`no-binding`);return n.id}throw new W(`"${e}" does not match any provider config name or provider definition ID.`,`provider-not-found`)}async requireBindingForAdapterAndConfig(e,t,n){if(!(await this.deps.listBindingsForConfig(t)).some(t=>t.adapterName===e))throw new W(`No binding exists between adapter "${e}" and provider "${n}". Create a binding first.`,`no-binding`)}async pickBindingForConfig(e,t){let n=(await this.deps.listBindingsForConfig(e)).filter(e=>t.includes(e.adapterName));if(n.length===0)throw new W(`Provider config "${e}" has no bindings to enabled adapters. Bind it to an enabled adapter first.`,`no-binding`);return n.find(e=>e.isDefault)??n[0]}},Ue=class e extends w{constructor(e=_){super(e)}async onInit(){await this.bus.request(p.ensureReady,{});let e=new He(this.createDeps());this.registerHandler(he.resolve,async t=>{let n=await e.resolve(t.payload.parsed,t.payload.context);t.setResult(n)})}createDeps(){let e=this.bus,t=async()=>{let{adapters:t}=await e.request(p.listAdapters,{});return t.filter(e=>e.enabled).map(e=>e.name)},n=async t=>{let[n,r]=await Promise.all([e.request(p.getDefaultBinding,{adapterName:t}),this.listEnabledProviderConfigIds()]);if(n.binding&&r.has(n.binding.providerConfigId))return n.binding;let{bindings:i}=await e.request(p.listBindings,{adapterName:t}),a=i.filter(e=>r.has(e.providerConfigId));return a.find(e=>e.isDefault)??a[0]},r=async t=>{let{definitions:n}=await e.request(p.getProviderDefinitionsByAdapter,{adapterName:t});return n},i=async t=>{let{bindings:n}=await e.request(p.listBindingsByConfig,{providerConfigId:t});return n},a=async t=>{let{configs:n}=await e.request(p.listProviderConfigs,{enabled:!0}),r=E(t);return n.find(e=>E(e.name)===r)},o=this.buildFindProviderDefinition(t,r),s=async t=>{let{configs:n}=await e.request(p.listProviderConfigsByDefinition,{definitionId:t}),r=n.filter(e=>e.enabled);return r.find(e=>e.isDefault)??r[0]},c=async(t,n)=>{let{config:r}=await e.request(p.findConfigForDefinitionAndAdapter,{definitionId:t,adapterName:n});return r?{id:r.id}:void 0};return{listEnabledAdapterNames:t,getDefaultBinding:n,findProviderConfigByName:a,findProviderDefinition:o,listBindingsForConfig:i,findDefaultConfigForDefinition:s,findConfigForDefinitionAndAdapter:c,resolveDefaultModelTarget:this.buildResolveDefaultModelTarget(t,r,c)}}buildFindProviderDefinition(e,t){return async(n,r)=>{let i=r??await e();for(let e of i){let r=(await t(e)).find(e=>e.id===n);if(r)return r}}}buildResolveDefaultModelTarget(t,n,r){let i=this.bus;return async a=>{let o=await t(),s=await Promise.all(o.map(async e=>({adapterName:e,definitions:await n(e)}))),c=Array.from(new Set(s.flatMap(({definitions:e})=>e.map(e=>e.id))));if(c.length===0)return{kind:`not-found`};let{matches:l}=await i.request(oe.checkModelInProviders,{providerIds:c,model:a}),u=(await Promise.all(s.map(({adapterName:e,definitions:t})=>this.collectAdapterCandidates(e,t,a,l,r)))).flat();return e.buildResolution(u)}}async collectAdapterCandidates(e,t,n,r,i){let a=t.filter(e=>e.id in r),o=await Promise.all(a.map(t=>i(t.id,e)));return a.flatMap((t,r)=>{let i=o[r];return i?[{adapterName:e,definitionId:t.id,providerConfigId:i.id,qualifiedName:`${e}/${t.id}::${n}`,model:n}]:[]})}static buildResolution(e){let t=Array.from(new Map(e.map(e=>[this.routeKey(e),e])).values());if(t.length===0)return{kind:`not-found`};if(t.length>1)return{kind:`ambiguous`,matches:t.map(({adapterName:e,definitionId:t,qualifiedName:n})=>({adapterName:e,definitionId:t,qualifiedName:n}))};let[n]=t;return{kind:`resolved`,target:{adapterName:n.adapterName,providerConfigId:n.providerConfigId,definitionId:n.definitionId,model:n.model}}}static routeKey(e){return`${e.adapterName}\0${e.definitionId}\0${e.providerConfigId}`}async listEnabledProviderConfigIds(){let{configs:e}=await this.bus.request(p.listProviderConfigs,{enabled:!0});return new Set(e.map(e=>e.id))}};const G={name:`makaio.canonical-model`,displayName:`Canonical Model`,version:`0.1.0`,critical:!1,create:e=>new Ue(e.bus)};function We(e){let t=Se({adapterId:e?.adapterId,adapterName:e?.adapterName,contextOverrides:{adapterId:e?.contextOverrides?.adapterId,adapterName:e?.contextOverrides?.adapterName}}),n=t.issues[0];return n?j(A.VALIDATION_FAILED,n.message):ke(t.effectiveIdentity)}function Ge(e){let t=e?.allowedDirectories;if(Array.isArray(t))return t.filter(e=>typeof e==`string`)}async function Ke(e,t,n,r){let i=new Map;for(let e of t)i.set(e.name,await r(e.name));let a=t.filter(e=>{let t=i.get(e.name);return!t?.allowedAdapters||t.allowedAdapters.length===0?!0:t.allowedAdapters.includes(n)}),o=new Set(a.map(e=>e.name));return{filteredTools:e.filter(e=>!(!o.has(e.toolsetName)||i.get(e.toolsetName)?.disabledTools?.includes(e.name))),filteredToolsets:a}}function qe(){return`exec_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}var Je=class{bus;toolsets=new Map;tools=new Map;cleanupHandlers=[];handlerPriority;policyProvider;fileAccessRuleProvider;revision=0;constructor(e){this.bus=e?.bus??_,this.handlerPriority=e?.handlerPriority??0,this.policyProvider=e?.policyProvider,this.fileAccessRuleProvider=e?.fileAccessRuleProvider,this.registerHandlers()}registerHandlers(){let e=this.bus.on(b.list,async e=>{let{toolsetName:t,adapterId:n,adapterName:r}=e.payload,{tools:i,toolsets:a}=await this.listToolsWithToolsets({toolsetName:t,adapterId:n,adapterName:r});e.setResult({tools:i,toolsets:a})},{priority:this.handlerPriority});this.cleanupHandlers.push(e);let t=this.bus.on(b.execute,async e=>{let{toolName:t,input:n,adapterId:r,adapterName:i,contextOverrides:a}=e.payload,o=await this.execute(t,n,{contextOverrides:a,adapterId:r,adapterName:i});e.setResult(o)},{priority:this.handlerPriority});this.cleanupHandlers.push(t)}async register(e){if(this.toolsets.has(e.metadata.name))throw Error(`Toolset '${e.metadata.name}' is already registered`);let t=[],n=[];for(let[,r]of Object.entries(e.tools)){let i=r.metadata.name;if(this.tools.has(i))throw Error(`Tool '${i}' is already registered (from toolset '${this.tools.get(i).toolsetName}')`);n.push({tool:r,toolsetName:e.metadata.name}),t.push(i)}this.toolsets.set(e.metadata.name,e);for(let e=0;e<n.length;e+=1)this.tools.set(t[e],n[e]);await this.emitRegistryChanged(`toolset-registered`,e.metadata.name).catch(t=>console.warn(`[ToolRegistry] Failed to emit ${b.registryChanged.subject} for '${e.metadata.name}':`,t)),await this.bus.emit(b.registered,{toolsetName:e.metadata.name,toolsetVersion:e.metadata.version,toolNames:t}).catch(t=>console.warn(`[ToolRegistry] Failed to emit ${b.registered.subject} for '${e.metadata.name}':`,t))}async deregister(e){let t=this.toolsets.get(e);if(!t)throw Error(`Toolset '${e}' is not registered`);for(let e of Object.values(t.tools))this.tools.delete(e.metadata.name);this.toolsets.delete(e),await this.emitRegistryChanged(`toolset-unregistered`,e).catch(t=>console.warn(`[ToolRegistry] Failed to emit ${b.registryChanged.subject} for '${e}':`,t))}async emitRegistryChanged(e,t){this.revision+=1,await this.bus.emit(b.registryChanged,{revision:this.revision,reason:e,toolsetName:t})}async execute(e,t,n){let r=this.tools.get(e);if(!r)return j(A.TOOL_NOT_FOUND,`Tool '${e}' not found`);let i=We(n);if(!i.success)return i;let{tool:a,toolsetName:o}=r,s=await this.checkPolicy(o,e,i.data.adapterId,i.data.adapterName);if(s)return s;let c=qe(),l=Date.now();await this.bus.emit(b.started,{toolName:e,toolsetName:o,executionId:c,timestamp:l});try{let r=a.inputSchema.safeParse(t);if(!r.success){let t=j(A.VALIDATION_FAILED,`Input validation failed`,{issues:r.error.issues});return await this.bus.emit(b.error,{toolName:e,toolsetName:o,executionId:c,timestamp:Date.now(),error:t.error}),t}let s=await this.buildExecutionContext(n,i.data),u=await a.execute(r.data,s);return u.success?await this.bus.emit(b.completed,{toolName:e,toolsetName:o,executionId:c,timestamp:Date.now(),durationMs:Date.now()-l}):await this.bus.emit(b.error,{toolName:e,toolsetName:o,executionId:c,timestamp:Date.now(),error:u.error}),u}catch(t){let n=De(t);return await this.bus.emit(b.error,{toolName:e,toolsetName:o,executionId:c,timestamp:Date.now(),error:n.error}),n}}async buildExecutionContext(e,t){let n=e?.contextOverrides?.constraints;if(this.fileAccessRuleProvider){let t=e?.contextOverrides?.cwd??process.cwd(),r=Ge(n),i=await this.fileAccessRuleProvider(t,r);n={...n,[Te]:i}}let r=pe({...e?.contextOverrides,constraints:n}),i=e?.contextOverrides;return{...r,bus:this.bus,sessionId:i?.sessionId,agentId:i?.agentId,adapterId:t.adapterId,adapterName:t.adapterName,adapterSessionId:i?.adapterSessionId,turnId:i?.turnId,turnContext:i?.turnContext,toolCallId:i?.toolCallId}}async checkPolicy(e,t,n,r){if(!this.policyProvider)return null;let i=await this.policyProvider(e);if(!i)return null;if(i.disabledTools?.includes(t))return j(A.PERMISSION_DENIED,`Tool '${t}' is disabled`,{toolsetName:e,toolName:t});if(i.allowedAdapters&&i.allowedAdapters.length>0){let t=r??n;if(!t||!i.allowedAdapters.includes(t))return j(A.PERMISSION_DENIED,`Adapter not allowed for toolset '${e}'`,{toolsetName:e,adapterId:n,adapterName:r,allowedAdapters:i.allowedAdapters})}return null}listTools(e){let t=[];for(let[,n]of this.tools){if(e?.toolsetName&&n.toolsetName!==e.toolsetName)continue;let{$schema:r,...i}=g.toJSONSchema(n.tool.inputSchema);t.push({name:n.tool.metadata.name,description:n.tool.metadata.description,toolsetName:n.toolsetName,annotations:n.tool.metadata.annotations,inputSchema:i})}return t}listToolsets(){let e=[];for(let[,t]of this.toolsets){let n={name:t.metadata.name,description:t.metadata.description,version:t.metadata.version,toolCount:Object.keys(t.tools).length};if(t.configSchema){let{$schema:e,...r}=g.toJSONSchema(t.configSchema);n.configSchema=r}e.push(n)}return e}async listToolsWithToolsets(e){let t=this.listTools(e),n=this.listToolsets(),r=e?.toolsetName?n.filter(t=>t.name===e.toolsetName):n,i=e?.adapterName??e?.adapterId;if(this.policyProvider&&i){let{filteredTools:e,filteredToolsets:n}=await Ke(t,r,i,this.policyProvider);return{tools:e,toolsets:n}}return{tools:t,toolsets:r}}getTool(e){return this.tools.get(e)?.tool}getToolset(e){return this.toolsets.get(e)}dispose(){for(let e of this.cleanupHandlers)e();this.cleanupHandlers.length=0}destroy(){this.dispose()}},Ye=class extends w{triggersByExtension=new Map;stepsByExtension=new Map;revision=0;cache=null;constructor(e){super(e)}onInit(){this.registerHandler(be.list,e=>{e.setResult({triggers:this.listTriggers(),steps:this.listSteps()})})}async register(e,t){let n=[],r=[],i=this.snapshotExtensionState(e),a=new Set;for(let e of this.triggersByExtension.values())for(let t of e)a.add(t.metadata.name);for(let e of this.stepsByExtension.values())for(let t of e)a.add(t.metadata.name);if(t.triggers)for(let r of t.triggers)this.assertExtensionNamespace(e,r.metadata),this.assertNoCollision(r.metadata,a),a.add(r.metadata.name),n.push({metadata:{...r.metadata,extensionName:e},configSchema:C(r.configSchema),outputSchema:C(r.outputSchema)});if(t.steps)for(let n of t.steps)this.assertExtensionNamespace(e,n.metadata),this.assertNoCollision(n.metadata,a),a.add(n.metadata.name),r.push({metadata:{...n.metadata,extensionName:e},configSchema:C(n.configSchema),inputSchema:C(n.inputSchema),outputSchema:C(n.outputSchema),runs:structuredClone(n.runs)});if(n.length>0&&this.triggersByExtension.set(e,n),r.length>0&&this.stepsByExtension.set(e,r),n.length>0||r.length>0){this.revision+=1;try{await this.emitChanged(e,`registered`)}catch(t){throw this.restoreExtensionState(e,i),t}}}async deregister(e){let t=this.snapshotExtensionState(e),n=this.triggersByExtension.delete(e),r=this.stepsByExtension.delete(e);if(n||r){this.revision+=1;try{await this.emitChanged(e,`deregistered`)}catch(n){throw this.restoreExtensionState(e,t),n}}}listTriggers(){return this.getCache().triggers.map(Xe)}listSteps(){return this.getCache().steps.map(Ze)}async emitChanged(e,t){await this.bus.emit(be.changed,{extensionName:e,revision:this.revision,reason:t})}getCache(){return(!this.cache||this.cache.revision!==this.revision)&&(this.cache={revision:this.revision,triggers:[...this.triggersByExtension.values()].flat(),steps:[...this.stepsByExtension.values()].flat()}),this.cache}snapshotExtensionState(e){return{triggers:this.triggersByExtension.get(e),steps:this.stepsByExtension.get(e),revision:this.revision,cache:this.cache}}restoreExtensionState(e,t){t.triggers?this.triggersByExtension.set(e,t.triggers):this.triggersByExtension.delete(e),t.steps?this.stepsByExtension.set(e,t.steps):this.stepsByExtension.delete(e),this.revision=t.revision,this.cache=t.cache}assertNoCollision(e,t){if(t.has(e.name))throw Error(`Workflow block name collision: '${e.name}' is already registered`)}assertExtensionNamespace(e,t){let n=`${e}.`;if(!t.name.startsWith(n))throw Error(`Workflow block '${t.name}' must be namespaced by extension '${n}'`)}};function Xe(e){return{metadata:Qe(e.metadata),configSchema:structuredClone(e.configSchema),outputSchema:structuredClone(e.outputSchema)}}function Ze(e){return{metadata:Qe(e.metadata),configSchema:structuredClone(e.configSchema),inputSchema:structuredClone(e.inputSchema),outputSchema:structuredClone(e.outputSchema),runs:structuredClone(e.runs)}}function Qe(e){return e.categories?{...e,categories:[...e.categories]}:{...e}}const K=`workflow.start`;function $e(e){return()=>({async execute(t,n){let{input:r={},executionHints:i}=t,{workflowId:a}=r;if(typeof a!=`string`||a.length===0)throw Error(`[TransitionActionRegistry] 'workflow.start' action requires a non-empty 'input.workflowId' string`);await e.request(xe.start,{workflowId:a,input:et(r,n),config:r.config,artifactRef:r.artifactRef,scope:r.scope,triggerPayload:{_transitionRuleId:n._transition.ruleId,_transitionDepth:n._transition.depth,_transitionEventType:n._transition.eventType},executionHints:i})}})}function et(e,t){let n=e.inputExpression;if(typeof n!=`string`)return e.input;let r=Me(n,tt(t)),i=ve.safeParse(r);if(!i.success)throw Error(`[TransitionActionRegistry] 'workflow.start' inputExpression for rule '${t._transition.ruleId}' must resolve to a JSON value`);return i.data}function tt(e){let t={...e};return{...t,ctx:t}}var nt=class{factories=new Map;factoriesBySource=new Map;constructor(e){this.factories.set(K,$e(e)),this.factoriesBySource.set(`__builtin__`,[K])}register(e,t){let n=Object.keys(t);if(n.length!==0){if(this.factoriesBySource.has(e))throw Error(`TransitionActionRegistry: duplicate source '${e}'`);for(let t of n)if(this.factories.has(t))throw Error(`TransitionActionRegistry: duplicate action type '${t}' from source '${e}'`);for(let e of n)this.factories.set(e,t[e]);this.factoriesBySource.set(e,n)}}deregister(e){if(e===`__builtin__`)return;let t=this.factoriesBySource.get(e);if(t){for(let e of t)this.factories.delete(e);this.factoriesBySource.delete(e)}}async dispatch(e,t){let n=this.factories.get(e.type);if(!n)throw Error(`TransitionActionRegistry: unknown action type '${e.type}'. Registered types: ${[...this.factories.keys()].join(`, `)}`);await n().execute(e,t)}has(e){return this.factories.has(e)}listTypes(){return[...this.factories.keys()]}},rt=class{rulesBySource=new Map;rulesByEventType=new Map;ruleIdSet=new Set;register(e,t){if(t.length===0)return;if(this.rulesBySource.has(e))throw Error(`TransitionRuleRegistry: duplicate source '${e}'`);let n=new Set,r=[];for(let i of t){let t=ye.parse(i);if(n.has(t.id))throw Error(`TransitionRuleRegistry: duplicate rule ID '${t.id}' within source '${e}'`);if(this.ruleIdSet.has(t.id))throw Error(`TransitionRuleRegistry: duplicate rule ID '${t.id}' from source '${e}'`);n.add(t.id),r.push({rule:t,condition:t.when===void 0?void 0:Ae.parse(t.when)})}for(let e of r){let{rule:t}=e;this.ruleIdSet.add(t.id);let n=this.rulesByEventType.get(t.on)??[];n.push(e),this.rulesByEventType.set(t.on,n)}this.rulesBySource.set(e,r)}deregister(e){let t=this.rulesBySource.get(e);if(t){for(let{rule:e}of t){this.ruleIdSet.delete(e.id);let t=this.rulesByEventType.get(e.on);if(t){let n=t.filter(t=>t.rule.id!==e.id);n.length>0?this.rulesByEventType.set(e.on,n):this.rulesByEventType.delete(e.on)}}this.rulesBySource.delete(e)}}getRulesForEvent(e){let t=this.rulesByEventType.get(e);return t?t.filter(e=>e.rule.enabled):[]}snapshotSource(e){let t=this.rulesBySource.get(e);if(t)return{ruleIds:t.map(e=>e.rule.id)}}},it=class extends w{ruleRegistry;actionRegistry;depthMap=new Map;constructor(e){super(e),this.ruleRegistry=new rt,this.actionRegistry=new nt(e)}onInit(){this.registerHandler(v.created,async e=>{await this.handleArtifactEvent(`artifact.created`,{artifact:e.payload.artifact})}),this.registerHandler(v.revised,async e=>{let t=await this.resolvePreviousRevisedArtifact(e.payload.previous);await this.handleArtifactEvent(`artifact.revised`,{artifact:e.payload.artifact,previous:e.payload.previous,...t===void 0?{}:{previousArtifact:t}})}),this.registerHandler(v.status.changed,async e=>{let t=await this.resolveStatusChangedArtifact(e.payload.artifact);t!==void 0&&await this.handleArtifactEvent(`artifact.status.changed`,{artifact:t,path:e.payload.path,previous:e.payload.previous,current:e.payload.current})})}async handleArtifactEvent(e,t){let n=this.artifactKey(t.artifact),r=this.readDepth(n);if(r>=10){console.warn(`[TransitionPipelineService] Transition depth limit (10) reached for event '${e}' on artifact '${n}'. Loop protection active — skipping rule evaluation.`);return}let i=this.ruleRegistry.getRulesForEvent(e);if(i.length!==0)for(let a of i)await this.evaluateAndDispatch(a,e,t,n,r)}async resolveStatusChangedArtifact(e){let t=await this.bus.requestOptional(v.resolve,{ref:e});if(!t.handled){console.warn(`[TransitionPipelineService] No artifact resolver is registered for status transition on artifact '${this.artifactKey(e)}'. Skipping rule evaluation.`);return}if(t.data.artifact===null){console.warn(`[TransitionPipelineService] Could not resolve status transition artifact '${this.artifactKey(e)}'. Skipping rule evaluation.`);return}return t.data.artifact}async resolvePreviousRevisedArtifact(e){let t=await this.bus.requestOptional(v.resolve,{ref:e});if(!(!t.handled||t.data.artifact===null))return t.data.artifact}async evaluateAndDispatch(e,t,n,r,i){let{rule:a,condition:o}=e,s={...n,_transition:{ruleId:a.id,eventType:t,depth:i+1}};if(o!==void 0){let e={...s},t;try{t=je(o,e)}catch(e){console.error(`[TransitionPipelineService] Condition evaluation error for rule '${a.id}':`,e);return}if(!t)return}try{await this.actionRegistry.dispatch(a.action,s),a.action.type===`workflow.start`&&this.incrementDepth(r)}catch(e){console.error(`[TransitionPipelineService] Action dispatch error for rule '${a.id}' (action type '${a.action.type}'):`,e)}}artifactKey(e){return`${typeof e.kind==`string`?e.kind:`unknown`}:${typeof e.id==`string`?e.id:`unknown`}`}readDepth(e){let t=this.depthMap.get(e);return t===void 0?0:Date.now()>t.expiresAt?(this.depthMap.delete(e),0):t.count}incrementDepth(e){let t=this.depthMap.get(e);this.depthMap.set(e,{count:t===void 0?1:t.count+1,expiresAt:Date.now()+6e4})}};function at(e){return async t=>{let n=await ot(e,t);if(!n)return{handled:!1,sessionId:null,clientAccountId:null,changed:!1};let{sessionId:r}=n,{observation:i,accountObserveRequest:a}=st(t),o=await e.requestOptional(D.account.observe,a);if(!o.handled)return{handled:!1,sessionId:r,clientAccountId:null,changed:!1};let{clientAccountId:s}=o.data;return{handled:!0,sessionId:r,clientAccountId:s,changed:await mt(e,r,i,s)}}}async function ot(e,t){switch(t.locator.kind){case`session`:{let{session:r}=await e.request(n.get,{sessionId:t.locator.sessionId});return r?{sessionId:r.sessionId,session:r}:null}case`adapter-session`:{let{session:r}=await e.request(n.getByAdapterSessionId,{adapterSessionId:t.locator.adapterSessionId});return r?{sessionId:r.sessionId,session:r}:null}case`both`:{let[{session:r},{session:i}]=await Promise.all([e.request(n.get,{sessionId:t.locator.sessionId}),e.request(n.getByAdapterSessionId,{adapterSessionId:t.locator.adapterSessionId})]);if(!r&&!i)return null;if(!r||!i)throw Error(`Session locator mismatch: sessionId "${t.locator.sessionId}" and adapterSessionId "${t.locator.adapterSessionId}" must both resolve the same session`);if(r.sessionId!==i.sessionId)throw Error(`Session locator mismatch: sessionId "${t.locator.sessionId}" and adapterSessionId "${t.locator.adapterSessionId}" resolve to different sessions`);return{sessionId:r.sessionId,session:r}}}}function st(e){let t={clientId:e.clientId,source:e.source,kind:e.kind,observedAt:e.observedAt,payload:ft(e.payload)};return{observation:t,accountObserveRequest:ct(t)}}function ct(e){let t=e.payload,n=lt(t),r=ut(t);if(r.length>0)return{clientId:e.clientId,observedAt:e.observedAt,displayLabel:dt(t,n),identifiers:r};throw Error(`client.session.account.observe for "${e.clientId}" requires canonical client account identifiers`)}function lt(e){return pt(e.accountInfo)??e}function ut(e){let t=e.identifiers;if(!Array.isArray(t))return[];try{return g.array(Ce).min(1).parse(t)}catch(e){throw Error(`client.session.account.observe received malformed canonical client account identifiers`,{cause:e})}}function dt(e,t){return q(e.displayLabel)??q(t.displayLabel)??q(t.email)??q(t.label)}function ft(e){return structuredClone(e)}function pt(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function q(e){return typeof e==`string`&&e.trim().length>0?e.trim():void 0}async function mt(e,t,r,i){let a=await e.request(n.update,{sessionId:t,clientId:r.clientId,clientAccountId:i,lastClientIdentityObservation:r});if(!a.success)throw Error(`Failed to update session "${t}" with client account linkage`);return a.clientAccountChanged??!1}const ht=S(`session-storage`).name;var gt=class extends w{constructor(e=_){super(e)}onInit(){let e=at(this.bus);this.registerHandler(D.session.account.observe,async t=>{t.setResult(await e(we.request.parse(t.payload)))})}};const _t={name:`makaio.session-client-account-linking`,displayName:`Session Client Account Linking`,version:`0.1.0`,dependencies:[x(ht),x(`makaio.clients-core`)],critical:!1,create:e=>new gt(e.bus)},vt={name:`framework-shell`,displayName:`Shell`,version:`0.1.0`,surface:`interactive`,windows:[{id:`main`,style:`utility`,width:1e3,height:700,singleton:!0}]};async function yt(e){let{harnesses:t}=await e.request(m.list,{}),n=new Set(t.map(e=>e.id));for(let t of ge){if(n.has(t.id))continue;let r={...t};await e.request(m.set,{harness:r})}}function J(e,t,n){return e??t??n}var bt=class extends w{static storage={drizzle:h};constructor(e=_){super(e)}async onInit(){await yt(this.bus),this.registerHandlers()}registerHandlers(){this.registerHandler(y.get,async e=>{let t=await this.loadHarness(e.payload);if(!t)throw Error(`Harness not found`);e.setResult(t)}),this.registerHandler(y.list,async e=>{let{harnesses:t}=await this.bus.request(m.list,e.payload);e.setResult({harnesses:t})}),this.registerHandler(y.set,async e=>{let t=await this.upsertHarness(e.payload);e.setResult({id:t})}),this.registerHandler(y.delete,async e=>{let{deleted:t}=await this.bus.request(m.delete,{id:e.payload.id});e.setResult({success:t})}),this.registerHandler(y.getDefault,async e=>{let t=await this.getDefaultHarness(e.payload.adapterName,e.payload.clientId);e.setResult(t)}),this.registerHandler(y.resolve,async e=>{let{adapterName:t,clientId:n,personaHarnessId:r,profileHarnessId:i}=e.payload;if(r){let i=await this.resolveAndValidateHarness(r,t,`persona`,n);e.setResult(i);return}if(i){let r=await this.resolveAndValidateHarness(i,t,`profile`,n);e.setResult(r);return}let a=await this.getDefaultHarness(t,n);e.setResult(a)}),this.registerHandler(y.getSchema,({setResult:e})=>{let{$schema:t,...n}=g.toJSONSchema(_e);e({schema:n,uiConfig:{editMode:`fullPage`,hiddenFields:[`isDefault`]}})})}async upsertHarness(e){let t=await this.resolveHarnessId(e.name,e.adapterName,e.clientId),n=await this.loadHarness({id:t,adapterName:e.adapterName,clientId:e.clientId}),r=this.mergeHarnessPayload(t,e,n);return r.adapterName&&await this.validateNativeTools(r.adapterName,r.nativeTools),await this.bus.request(m.set,{harness:r}),t}mergeHarnessPayload(e,t,n){let r={enabled:[],disabled:[]};return{id:e,name:t.name,description:J(t.description,n?.description,void 0),adapterName:t.adapterName,clientId:J(t.clientId,n?.clientId,void 0),env:J(t.env,n?.env,void 0),credentials:J(t.credentials,n?.credentials,void 0),cwd:J(t.cwd,n?.cwd,void 0),approvalPolicy:J(t.approvalPolicy,n?.approvalPolicy,`always-ask`),nativeTools:J(t.nativeTools,n?.nativeTools,r),registryTools:J(t.registryTools,n?.registryTools,r),skills:J(t.skills,n?.skills,void 0),toolCapabilityMap:t.toolCapabilityMap??n?.toolCapabilityMap,capabilityOverrides:t.capabilityOverrides??n?.capabilityOverrides,toolApprovalOverrides:t.toolApprovalOverrides??n?.toolApprovalOverrides,isDefault:J(t.isDefault,n?.isDefault,!1),enabled:J(t.enabled,n?.enabled,!0)}}async resolveHarnessId(e,t,n){let r=n??t,{harnesses:i}=await this.bus.request(m.list,{name:e}),a=i.find(t=>t.name===e&&(t.clientId??t.adapterName)===r);if(a)return a.id;let o=i.find(t=>t.name===e&&(t.clientId??t.adapterName)!==r);if(o){let t=o.clientId?`client '${o.clientId}'`:`adapter '${o.adapterName}'`;throw Error(`Harness "${e}" already exists with scope ${t}; cannot change scope to ${r??`(none)`}`)}return this.createStableHarnessId(e,r)}async loadHarness(e){if(e.id){let{harness:t}=await this.bus.request(m.get,{id:e.id});return t&&(!e.adapterName||t.adapterName===e.adapterName)&&(!e.clientId||t.clientId===e.clientId)?t:null}if(!e.name)return null;let{harnesses:t}=await this.bus.request(m.list,{name:e.name,adapterName:e.adapterName,clientId:e.clientId});return e.clientId?t.find(t=>t.clientId===e.clientId)??null:e.adapterName?t.find(t=>t.adapterName===e.adapterName)??null:t[0]??null}async getDefaultHarness(e,t){if(t){let{harnesses:e}=await this.bus.request(m.list,{clientId:t}),n=e.find(e=>e.isDefault&&e.enabled);if(n)return n;let r=e.find(e=>e.enabled);if(r)return r}if(e){let{harnesses:t}=await this.bus.request(m.list,{adapterName:e}),n=t.find(e=>e.isDefault&&e.enabled);if(n)return n;let r=t.find(e=>e.enabled);if(r)return r}let n=t?e?`client '${t}' or adapter '${e}'`:`client '${t}'`:`adapter '${e}'`;throw Error(`No harness available for ${n}`)}assertHarnessAdapterMatch(e,t,n,r){if(e.adapterName&&t&&e.adapterName!==t)throw Error(`Resolved ${n} harness adapter mismatch: expected "${t}", got "${e.adapterName}"`);if(e.clientId&&r&&e.clientId!==r)throw Error(`Resolved ${n} harness client mismatch: expected "${r}", got "${e.clientId}"`)}assertHarnessEnabled(e,t){if(!e.enabled)throw Error(`Resolved ${t} harness is disabled: ${e.id}`)}async validateNativeTools(e,t){let n=await this.bus.requestOptional(me.getCapabilities,{adapterName:e});if(!n.handled)return;let r=new Set(n.data.nativeTools),i=[...t.enabled,...t.disabled].filter(e=>!r.has(e));if(i.length>0)throw Error(`Tool '${i[0]}' not found in adapter '${e}' native tools. Declared tools: ${[...r].join(`, `)}`)}createStableHarnessId(e,t){return`harness-${de(`sha256`).update(`${t??``}\0${e}`).digest(`hex`).slice(0,24)}`}async resolveAndValidateHarness(e,t,n,r){let i=await this.loadHarness({id:e});if(!i)throw Error(`${n===`persona`?`Persona`:`Profile`} harness not found: ${e}`);return this.assertHarnessAdapterMatch(i,t,n,r),this.assertHarnessEnabled(i,n),i}};const xt={name:`makaio.harness`,displayName:`Harness`,version:`0.1.0`,critical:!0,storage:{registerHandlers:T(h)},create:e=>new bt(e.bus)},Y=S(`session-storage`),X=S(`session-bridge`),Z=S(`session`),St=S(`session-orchestrator`),Ct=S(`observed-session-ingestion`),Q=S(`tool-registry`),wt=S(`tool-approval`),Tt=S(`tray-menu`),Et=S(`capability`),Dt=S(`model-registry`),Ot=S(`workflow-block-registry`),kt=S(`transition-pipeline`),At=S(`filesystem`),jt=S(`git`),Mt=S(`artifact-schema-registry`),Nt=S(`artifact-lifecycle-hook-registry`),Pt=S(`facet-namespace-registry`),Ft=S(`surface-binding-registry`),It={name:Mt.name,displayName:`Artifact Schema Registry`,version:`0.1.0`,critical:!0,create:e=>new L(e.bus)},Lt={name:Nt.name,displayName:`Artifact Lifecycle Hook Registry`,version:`0.1.0`,critical:!0,create:e=>new V(e.bus)},Rt={name:Pt.name,displayName:`Facet Namespace Registry`,version:`0.1.0`,critical:!0,create:e=>new Be(e.bus)},zt={name:Ft.name,displayName:`Surface Binding Registry`,version:`0.1.0`,critical:!0,create:e=>new Ve(e.bus)},Bt={name:Y.name,displayName:`Session Storage`,version:`0.1.0`,critical:!0,storage:{registerHandlers:T((n,a)=>{let o=[],u=e=>{for(let t=o.length-1;t>=0;--t)try{o[t]?.()}catch(t){console.warn(`[sessionStoragePackage] cleanup failed during ${e}:`,t)}o.length=0};try{o.push(i(n,a)),o.push(e(n,a)),o.push(r(n,a)),o.push(te(n,a)),o.push(t(n,a)),o.push(f(n,a)),o.push(l(n,a)),o.push(c(n,a)),o.push(s(n,a)),o.push(d(n)),o.push(ne(n)),o.push(ee(n))}catch(e){throw u(`rollback`),e}return()=>{u(`shutdown`)}})}},$={name:X.name,displayName:`Session Bridge`,version:`0.1.0`,dependencies:[x(Y.name)],critical:!0,create:e=>new a(e.bus)},Vt={name:Z.name,displayName:`Session`,version:`0.1.0`,dependencies:[x(X.name)],critical:!0,create:e=>new re(e.bus)},Ht={name:St.name,displayName:`Session Orchestrator`,version:`0.1.0`,dependencies:[x(Z.name),x(G.name)],critical:!0,runtimeOwnership:{sessionOrchestrator:!0},create:e=>new o(e.bus,e.machineId)},Ut={name:Ct.name,displayName:`Observed-Session Ingestion`,version:`0.1.0`,dependencies:[x(X.name)],critical:!1,create:e=>new u(e.bus)},Wt={name:Q.name,displayName:`Tool Registry`,version:`0.1.0`,critical:!0,create:e=>new Je({bus:e.bus})},Gt={name:wt.name,displayName:`Tool Approval`,version:`0.1.0`,dependencies:[x(Q.name)],critical:!0,create:e=>new se(e.bus)},Kt={name:Tt.name,displayName:`Tray Menu`,version:`0.1.0`,critical:!0,create:e=>new ce(e.bus)},qt={name:Et.name,displayName:`Capability`,version:`0.1.0`,critical:!0,create:e=>new ie(e.bus)},Jt={name:Ot.name,displayName:`Workflow Block Registry`,version:`0.1.0`,critical:!0,create:e=>new Ye(e.bus)},Yt={name:kt.name,displayName:`Transition Pipeline`,version:`0.1.0`,critical:!0,create:e=>new it(e.bus)},Xt={name:At.name,displayName:`Filesystem`,version:`0.1.0`,critical:!0,create:e=>new ue(e.bus,e.machineId)},Zt={name:jt.name,displayName:`Git`,version:`0.1.0`,dependencies:[x(At.name)],critical:!0,create:e=>new Ne(e.bus)};function Qt(e){return{name:Dt.name,displayName:`Model Registry`,version:`0.1.0`,critical:!0,create:t=>new ae({bus:t.bus,fetcher:e})}}const $t=[It,Lt,Rt,zt,Bt,$,_t,Vt,Ht,Ut,le,Wt,Gt,Kt,qt,xt,G,vt,Jt,Yt,Zt,Xt];function en(){let e=new Map;return{filter:e=>!!e.tools?.createToolsets,async processActivated(t,n,r){let i=r.getService(Q);if(!i)throw Error(`ToolRegistry is not available. Ensure toolRegistryPackage is included in the composition root.`);let a=n.tools.createToolsets(r),o=[];try{for(let e of a)await i.register(e),o.push(()=>i.deregister(e.metadata.name))}catch(e){for(let e=o.length-1;e>=0;--e)try{await o[e]()}catch(e){console.error(`[ToolContributionProcessor] Rollback error for "${t}":`,e)}throw e}e.set(t,o)},async processStopped(t){let n=e.get(t);if(n){for(let e=n.length-1;e>=0;--e)try{await n[e]()}catch(e){console.error(`[ToolContributionProcessor] Deregister error for "${t}":`,e)}e.delete(t)}}}}export{Gt as A,Je as B,Rt as C,Vt as D,Ht as E,it as F,Ve as G,Ue as H,rt as I,R as J,Be as K,nt as L,Yt as M,Kt as N,Bt as O,Jt as P,K as R,Qt as S,$ as T,He as U,G as V,W,L as Y,Tt as _,Mt as a,It as b,Dt as c,Y as d,Z as f,kt as g,Q as h,Nt as i,Wt as j,zt as k,X as l,wt as m,Oe as n,Et as o,Ft as p,V as q,en as r,Pt as s,Ee as t,St as u,Ot as v,$t as w,qt as x,Lt as y,Ye as z};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|