@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
|
@@ -202,7 +202,7 @@ declare const SessionStorageNamespace$1: {
|
|
|
202
202
|
tableName: "sessions";
|
|
203
203
|
dataType: "string";
|
|
204
204
|
columnType: "SQLiteText";
|
|
205
|
-
data: "fork" | "subagent" | "
|
|
205
|
+
data: "fork" | "subagent" | "branch" | "compress" | "rewrite" | "coordinator" | "aside";
|
|
206
206
|
driverParam: string;
|
|
207
207
|
notNull: false;
|
|
208
208
|
hasDefault: false;
|
|
@@ -1073,8 +1073,8 @@ declare const SessionStorageNamespace$1: {
|
|
|
1073
1073
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
1074
1074
|
fork: "fork";
|
|
1075
1075
|
subagent: "subagent";
|
|
1076
|
-
compress: "compress";
|
|
1077
1076
|
branch: "branch";
|
|
1077
|
+
compress: "compress";
|
|
1078
1078
|
rewrite: "rewrite";
|
|
1079
1079
|
coordinator: "coordinator";
|
|
1080
1080
|
aside: "aside";
|
|
@@ -1195,8 +1195,8 @@ declare const SessionStorageNamespace$1: {
|
|
|
1195
1195
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
1196
1196
|
fork: "fork";
|
|
1197
1197
|
subagent: "subagent";
|
|
1198
|
-
compress: "compress";
|
|
1199
1198
|
branch: "branch";
|
|
1199
|
+
compress: "compress";
|
|
1200
1200
|
rewrite: "rewrite";
|
|
1201
1201
|
coordinator: "coordinator";
|
|
1202
1202
|
aside: "aside";
|
|
@@ -1342,8 +1342,8 @@ declare const SessionStorageNamespace$1: {
|
|
|
1342
1342
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
1343
1343
|
fork: "fork";
|
|
1344
1344
|
subagent: "subagent";
|
|
1345
|
-
compress: "compress";
|
|
1346
1345
|
branch: "branch";
|
|
1346
|
+
compress: "compress";
|
|
1347
1347
|
rewrite: "rewrite";
|
|
1348
1348
|
coordinator: "coordinator";
|
|
1349
1349
|
aside: "aside";
|
|
@@ -1425,8 +1425,8 @@ declare const SessionStorageNamespace$1: {
|
|
|
1425
1425
|
branchKind: _$zod.ZodNullable<_$zod.ZodEnum<{
|
|
1426
1426
|
fork: "fork";
|
|
1427
1427
|
subagent: "subagent";
|
|
1428
|
-
compress: "compress";
|
|
1429
1428
|
branch: "branch";
|
|
1429
|
+
compress: "compress";
|
|
1430
1430
|
rewrite: "rewrite";
|
|
1431
1431
|
coordinator: "coordinator";
|
|
1432
1432
|
aside: "aside";
|
|
@@ -1504,8 +1504,8 @@ declare const SessionStorageNamespace$1: {
|
|
|
1504
1504
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
1505
1505
|
fork: "fork";
|
|
1506
1506
|
subagent: "subagent";
|
|
1507
|
-
compress: "compress";
|
|
1508
1507
|
branch: "branch";
|
|
1508
|
+
compress: "compress";
|
|
1509
1509
|
rewrite: "rewrite";
|
|
1510
1510
|
coordinator: "coordinator";
|
|
1511
1511
|
aside: "aside";
|
|
@@ -1594,8 +1594,8 @@ declare const SessionStorageNamespace$1: {
|
|
|
1594
1594
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
1595
1595
|
fork: "fork";
|
|
1596
1596
|
subagent: "subagent";
|
|
1597
|
-
compress: "compress";
|
|
1598
1597
|
branch: "branch";
|
|
1598
|
+
compress: "compress";
|
|
1599
1599
|
rewrite: "rewrite";
|
|
1600
1600
|
coordinator: "coordinator";
|
|
1601
1601
|
aside: "aside";
|
|
@@ -1689,8 +1689,8 @@ declare const SessionStorageNamespace$1: {
|
|
|
1689
1689
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
1690
1690
|
fork: "fork";
|
|
1691
1691
|
subagent: "subagent";
|
|
1692
|
-
compress: "compress";
|
|
1693
1692
|
branch: "branch";
|
|
1693
|
+
compress: "compress";
|
|
1694
1694
|
rewrite: "rewrite";
|
|
1695
1695
|
coordinator: "coordinator";
|
|
1696
1696
|
aside: "aside";
|
|
@@ -1946,8 +1946,8 @@ declare const SessionStorageNamespace$1: {
|
|
|
1946
1946
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
1947
1947
|
fork: "fork";
|
|
1948
1948
|
subagent: "subagent";
|
|
1949
|
-
compress: "compress";
|
|
1950
1949
|
branch: "branch";
|
|
1950
|
+
compress: "compress";
|
|
1951
1951
|
rewrite: "rewrite";
|
|
1952
1952
|
coordinator: "coordinator";
|
|
1953
1953
|
aside: "aside";
|
|
@@ -2075,8 +2075,8 @@ declare const SessionStorageNamespace$1: {
|
|
|
2075
2075
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
2076
2076
|
fork: "fork";
|
|
2077
2077
|
subagent: "subagent";
|
|
2078
|
-
compress: "compress";
|
|
2079
2078
|
branch: "branch";
|
|
2079
|
+
compress: "compress";
|
|
2080
2080
|
rewrite: "rewrite";
|
|
2081
2081
|
coordinator: "coordinator";
|
|
2082
2082
|
aside: "aside";
|
|
@@ -2225,8 +2225,8 @@ declare const SessionStorageNamespace$1: {
|
|
|
2225
2225
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
2226
2226
|
fork: "fork";
|
|
2227
2227
|
subagent: "subagent";
|
|
2228
|
-
compress: "compress";
|
|
2229
2228
|
branch: "branch";
|
|
2229
|
+
compress: "compress";
|
|
2230
2230
|
rewrite: "rewrite";
|
|
2231
2231
|
coordinator: "coordinator";
|
|
2232
2232
|
aside: "aside";
|
|
@@ -2347,8 +2347,8 @@ declare const SessionStorageNamespace$1: {
|
|
|
2347
2347
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
2348
2348
|
fork: "fork";
|
|
2349
2349
|
subagent: "subagent";
|
|
2350
|
-
compress: "compress";
|
|
2351
2350
|
branch: "branch";
|
|
2351
|
+
compress: "compress";
|
|
2352
2352
|
rewrite: "rewrite";
|
|
2353
2353
|
coordinator: "coordinator";
|
|
2354
2354
|
aside: "aside";
|
|
@@ -2494,8 +2494,8 @@ declare const SessionStorageNamespace$1: {
|
|
|
2494
2494
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
2495
2495
|
fork: "fork";
|
|
2496
2496
|
subagent: "subagent";
|
|
2497
|
-
compress: "compress";
|
|
2498
2497
|
branch: "branch";
|
|
2498
|
+
compress: "compress";
|
|
2499
2499
|
rewrite: "rewrite";
|
|
2500
2500
|
coordinator: "coordinator";
|
|
2501
2501
|
aside: "aside";
|
|
@@ -2577,8 +2577,8 @@ declare const SessionStorageNamespace$1: {
|
|
|
2577
2577
|
branchKind: _$zod.ZodNullable<_$zod.ZodEnum<{
|
|
2578
2578
|
fork: "fork";
|
|
2579
2579
|
subagent: "subagent";
|
|
2580
|
-
compress: "compress";
|
|
2581
2580
|
branch: "branch";
|
|
2581
|
+
compress: "compress";
|
|
2582
2582
|
rewrite: "rewrite";
|
|
2583
2583
|
coordinator: "coordinator";
|
|
2584
2584
|
aside: "aside";
|
|
@@ -2656,8 +2656,8 @@ declare const SessionStorageNamespace$1: {
|
|
|
2656
2656
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
2657
2657
|
fork: "fork";
|
|
2658
2658
|
subagent: "subagent";
|
|
2659
|
-
compress: "compress";
|
|
2660
2659
|
branch: "branch";
|
|
2660
|
+
compress: "compress";
|
|
2661
2661
|
rewrite: "rewrite";
|
|
2662
2662
|
coordinator: "coordinator";
|
|
2663
2663
|
aside: "aside";
|
|
@@ -2746,8 +2746,8 @@ declare const SessionStorageNamespace$1: {
|
|
|
2746
2746
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
2747
2747
|
fork: "fork";
|
|
2748
2748
|
subagent: "subagent";
|
|
2749
|
-
compress: "compress";
|
|
2750
2749
|
branch: "branch";
|
|
2750
|
+
compress: "compress";
|
|
2751
2751
|
rewrite: "rewrite";
|
|
2752
2752
|
coordinator: "coordinator";
|
|
2753
2753
|
aside: "aside";
|
|
@@ -2841,8 +2841,8 @@ declare const SessionStorageNamespace$1: {
|
|
|
2841
2841
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
2842
2842
|
fork: "fork";
|
|
2843
2843
|
subagent: "subagent";
|
|
2844
|
-
compress: "compress";
|
|
2845
2844
|
branch: "branch";
|
|
2845
|
+
compress: "compress";
|
|
2846
2846
|
rewrite: "rewrite";
|
|
2847
2847
|
coordinator: "coordinator";
|
|
2848
2848
|
aside: "aside";
|
|
@@ -3098,8 +3098,8 @@ declare const SessionStorageNamespace$1: {
|
|
|
3098
3098
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
3099
3099
|
fork: "fork";
|
|
3100
3100
|
subagent: "subagent";
|
|
3101
|
-
compress: "compress";
|
|
3102
3101
|
branch: "branch";
|
|
3102
|
+
compress: "compress";
|
|
3103
3103
|
rewrite: "rewrite";
|
|
3104
3104
|
coordinator: "coordinator";
|
|
3105
3105
|
aside: "aside";
|
|
@@ -3227,8 +3227,8 @@ declare const SessionStorageNamespace$1: {
|
|
|
3227
3227
|
branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
|
|
3228
3228
|
fork: "fork";
|
|
3229
3229
|
subagent: "subagent";
|
|
3230
|
-
compress: "compress";
|
|
3231
3230
|
branch: "branch";
|
|
3231
|
+
compress: "compress";
|
|
3232
3232
|
rewrite: "rewrite";
|
|
3233
3233
|
coordinator: "coordinator";
|
|
3234
3234
|
aside: "aside";
|
|
@@ -3357,7 +3357,7 @@ declare const SessionStorageNamespace$1: {
|
|
|
3357
3357
|
contextInheritance?: "none" | "parent-history" | undefined;
|
|
3358
3358
|
rootSessionId?: string | undefined;
|
|
3359
3359
|
forkPointMessageId?: string | undefined;
|
|
3360
|
-
branchKind?: "fork" | "subagent" | "
|
|
3360
|
+
branchKind?: "fork" | "subagent" | "branch" | "compress" | "rewrite" | "coordinator" | "aside" | undefined;
|
|
3361
3361
|
adapterName?: string | undefined;
|
|
3362
3362
|
adapterSessionId?: string | undefined;
|
|
3363
3363
|
adapterId?: string | undefined;
|
|
@@ -432,9 +432,9 @@ declare const AgentRuntimeNamespace: _$_makaio_core0.BusNamespaceDefinition<"age
|
|
|
432
432
|
status: _$zod.ZodEnum<{
|
|
433
433
|
completed: "completed";
|
|
434
434
|
cancelled: "cancelled";
|
|
435
|
-
failed: "failed";
|
|
436
435
|
running: "running";
|
|
437
436
|
waiting_input: "waiting_input";
|
|
437
|
+
failed: "failed";
|
|
438
438
|
}>;
|
|
439
439
|
result: _$zod.ZodOptional<_$zod.ZodString>;
|
|
440
440
|
error: _$zod.ZodOptional<_$zod.ZodString>;
|
|
@@ -889,9 +889,9 @@ declare const AgentRuntimeSubjects: _$_makaio_core0.BusSubjects<_$_makaio_core0.
|
|
|
889
889
|
status: _$zod.ZodEnum<{
|
|
890
890
|
completed: "completed";
|
|
891
891
|
cancelled: "cancelled";
|
|
892
|
-
failed: "failed";
|
|
893
892
|
running: "running";
|
|
894
893
|
waiting_input: "waiting_input";
|
|
894
|
+
failed: "failed";
|
|
895
895
|
}>;
|
|
896
896
|
result: _$zod.ZodOptional<_$zod.ZodString>;
|
|
897
897
|
error: _$zod.ZodOptional<_$zod.ZodString>;
|
|
@@ -37,9 +37,9 @@ declare const SubagentTemplateKernelNamespace: _$_makaio_core0.BusNamespaceDefin
|
|
|
37
37
|
status: _$zod.ZodEnum<{
|
|
38
38
|
completed: "completed";
|
|
39
39
|
cancelled: "cancelled";
|
|
40
|
-
failed: "failed";
|
|
41
40
|
running: "running";
|
|
42
41
|
waiting_input: "waiting_input";
|
|
42
|
+
failed: "failed";
|
|
43
43
|
}>;
|
|
44
44
|
result: _$zod.ZodOptional<_$zod.ZodString>;
|
|
45
45
|
error: _$zod.ZodOptional<_$zod.ZodString>;
|
|
@@ -101,9 +101,9 @@ declare const SubagentTemplateSubjects: _$_makaio_core0.BusSubjects<_$_makaio_co
|
|
|
101
101
|
status: _$zod.ZodEnum<{
|
|
102
102
|
completed: "completed";
|
|
103
103
|
cancelled: "cancelled";
|
|
104
|
-
failed: "failed";
|
|
105
104
|
running: "running";
|
|
106
105
|
waiting_input: "waiting_input";
|
|
106
|
+
failed: "failed";
|
|
107
107
|
}>;
|
|
108
108
|
result: _$zod.ZodOptional<_$zod.ZodString>;
|
|
109
109
|
error: _$zod.ZodOptional<_$zod.ZodString>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as BusServerConfig, n as startBusServer, r as BusServer, t as StartBusServerOptions } from "../../server-lifecycle-
|
|
1
|
+
import { i as BusServerConfig, n as startBusServer, r as BusServer, t as StartBusServerOptions } from "../../server-lifecycle-DzO3rjKP.mjs";
|
|
2
2
|
import { BusBroadcastMessage, BusMessage, BusRequestMessage, BusTransport, BusTransportError } from "@makaio/framework/bus";
|
|
3
3
|
import { TransportAuth, WebSocketLike, WebSocketServerLike, WebSocketServerLike as WebSocketServerLike$1 } from "@makaio/framework/node/transports";
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"../../server-lifecycle-
|
|
1
|
+
import{n as e,r as t,t as n}from"../../server-lifecycle-DLdh0-4H.mjs";var r=class{connectionListeners=new Set;on(e,t){e===`connection`&&this.connectionListeners.add(t)}off(e,t){e===`connection`&&this.connectionListeners.delete(t)}close(e){this.connectionListeners.clear(),e?.()}accept(e){for(let t of this.connectionListeners)t(e)}};export{r as HonoWebSocketBridge,t as LoopbackTransport,e as createBusServer,n as startBusServer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as startBusServer, t as StartBusServerOptions } from "../../server-lifecycle-
|
|
1
|
+
import { n as startBusServer, t as StartBusServerOptions } from "../../server-lifecycle-DzO3rjKP.mjs";
|
|
2
2
|
export { StartBusServerOptions, startBusServer };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"../../server-lifecycle-
|
|
1
|
+
import{t as e}from"../../server-lifecycle-DLdh0-4H.mjs";export{e as startBusServer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,A as t,B as n,D as r,E as i,F as a,G as o,H as s,I as c,J as l,K as u,L as d,M as f,N as p,O as m,P as ee,Q as te,R as ne,S as re,T as ie,U as ae,V as oe,W as se,X as ce,Y as le,Z as ue,_ as h,a as de,b as fe,c as pe,d as me,et as he,f as ge,g as _e,h as ve,i as ye,it as g,j as be,k as xe,m as Se,n as Ce,nt as we,p as Te,q as Ee,r as De,rt as Oe,s as ke,tt as Ae,u as je,v as Me,w as Ne,x as Pe,y as Fe,z as Ie}from"./authority-state-bootstrap-CEuKScnL.mjs";import{matchesFilter as Le,matchesSubscription as Re}from"@makaio/framework/bus";import{ArtifactSubjects as ze,EXECUTION_LIST_DEFAULT_LIMIT as Be,EXECUTION_LIST_MAX_LIMIT as _,EXECUTION_LIST_MIN_LIMIT as v,EXTERNAL_EXECUTION_ID_PREFIX as Ve,ExecutionHintsSchema as He,ExecutionsByArtifactRefsQuerySchema as Ue,JsonPatchOperationSchema as We,JsonValueSchema as Ge,SessionSubjects as Ke,WORKFLOW_CANCELLED_REASON as qe,WorkLogFrameEntrySchema as Je,WorkflowError as y,WorkflowErrorCode as Ye,WorkflowNamespace as Xe,WorkflowStepTypeSchema as Ze,WorkflowSubjects as b,createWorkflowCancelSubject as Qe,createWorkflowFinalizerNamespace as $e,dep as et,extensionToken as tt,serializeArtifactRef as nt}from"@makaio/framework/contracts";import{BaseService as rt}from"@makaio/framework/service-base";import{defineDialectSchema as it,executeTransaction as x,getDatabaseDialect as at,registerDrizzleHandlers as ot,resolveSchema as S,serializeDatabaseOperation as C}from"@makaio/framework/storage/drizzle";import{and as w,asc as T,count as E,desc as D,eq as O,getTableColumns as st,gte as ct,isNotNull as lt,isNull as k,lt as ut,lte as dt,notInArray as ft,or as pt,sql as A,sum as j}from"drizzle-orm";import{compile as mt}from"@makaio/framework/expression";import*as ht from"node:os";import{SessionToken as gt}from"@makaio/framework/services";const _t=t.postgres,vt=n.postgres,yt=f.postgres,bt=s.postgres,xt=u.postgres,St=ee.postgres,Ct=se.postgres,wt=he.postgres,Tt=ce.postgres,Et=l.postgres,Dt=te.postgres,Ot=c.postgres,kt=ne.postgres,At=we.postgres,M=it({workflowDefinitions:xe,workflowExecutions:Ie,workflowExecutionFrames:be,workflowGateInstances:oe,workflowStepSpans:o,workflowExecutionLinks:p,workflowRunContexts:ae,worklogSummaries:e,worklogFrameEntries:le,worklogArtifactWrites:Ee,worklogGateEvents:ue,workflowExecutionState:a,workflowExecutionStateEvents:d,workflowFinalizations:Ae},{workflowDefinitions:_t,workflowExecutions:vt,workflowExecutionFrames:yt,workflowGateInstances:bt,workflowStepSpans:xt,workflowExecutionLinks:St,workflowRunContexts:Ct,worklogSummaries:wt,worklogFrameEntries:Tt,worklogArtifactWrites:Et,worklogGateEvents:Dt,workflowExecutionState:Ot,workflowExecutionStateEvents:kt,workflowFinalizations:At});function N(e){return e.type===`global`?{scopeType:`global`,scopeKind:``,scopeId:``}:e.type===`external`?{scopeType:`external`,scopeKind:e.kind,scopeId:e.id}:{scopeType:e.type,scopeKind:``,scopeId:e.id}}function P(e){switch(e.scopeType){case`global`:return{type:`global`};case`external`:if(!e.scopeKind||!e.scopeId)throw Error(`Invalid external workflow scope row: scopeKind and scopeId are required`);return{type:`external`,kind:e.scopeKind,id:e.scopeId};case`workspace`:case`session`:if(!e.scopeId)throw Error(`Invalid ${e.scopeType} workflow scope row: scopeId is required`);return{type:e.scopeType,id:e.scopeId};default:{let t=e.scopeType;throw Error(`Unknown scope type: ${String(t)}`)}}}function jt(e,t){let{scopeType:n,scopeKind:r,scopeId:i}=N(t);return[O(e.scopeType,n),O(e.scopeKind,r),O(e.scopeId,i)]}function F(e){return{id:e.id,name:e.name,description:e.description??void 0,root:e.root,inputSchema:e.inputSchema??void 0,configSchema:e.configSchema??void 0,outputSchema:e.outputSchema??void 0,state:e.state??void 0,artifact:e.artifact??void 0,triggers:e.triggers??void 0,scope:P(e),canvasLayout:e.canvasLayout??void 0,source:e.source??void 0,successFinalizerId:e.successFinalizerId??void 0,executionHints:e.executionHints??void 0}}function Mt(e,t){let n=N(e.scope);return{id:e.id,name:e.name??e.id,root:e.root,description:e.description??null,inputSchema:e.inputSchema??null,configSchema:e.configSchema??null,outputSchema:e.outputSchema??null,state:e.state??null,artifact:e.artifact??null,triggers:e.triggers??null,canvasLayout:e.canvasLayout??null,source:e.source??null,successFinalizerId:e.successFinalizerId??null,executionHints:e.executionHints??null,createdAt:t,updatedAt:t,...n}}function Nt(e,t){let{workflowDefinitions:n}=S(t,M),r=st(n),i=e.on(m.get,async e=>{let r=await t.select().from(n).where(O(n.id,e.payload.id)).limit(1);e.setResult({workflow:r[0]?F(r[0]):null})}),a=e.on(m.set,async i=>{let a=i.payload.workflow,o=Date.now(),s=Mt(a,o),c=await C(t,async()=>{let e=await t.insert(n).values(s).onConflictDoNothing({target:n.id}).returning();if(e.length>0)return{kind:`created`,row:e[0]};let[i]=await t.update(n).set({name:s.name,root:s.root,updatedAt:o,createdAt:A`COALESCE(${r.createdAt}, ${o})`,description:s.description===null?A`${r.description}`:s.description,inputSchema:s.inputSchema===null?A`${r.inputSchema}`:s.inputSchema,configSchema:s.configSchema===null?A`${r.configSchema}`:s.configSchema,outputSchema:s.outputSchema===null?A`${r.outputSchema}`:s.outputSchema,state:s.state,artifact:s.artifact===null?A`${r.artifact}`:s.artifact,triggers:s.triggers===null?A`${r.triggers}`:s.triggers,canvasLayout:s.canvasLayout===null?A`${r.canvasLayout}`:s.canvasLayout,source:s.source===null?A`${r.source}`:s.source,successFinalizerId:s.successFinalizerId,executionHints:s.executionHints===null?A`${r.executionHints}`:s.executionHints,...N(a.scope)}).where(O(n.id,a.id)).returning();return i?{kind:`updated`,row:i}:void 0});c&&await e.emit(c.kind===`created`?g.definition.created:g.definition.updated,F(c.row)),i.setResult({id:a.id})}),o=e.on(m.delete,async r=>{let i=(await C(t,()=>t.delete(n).where(O(n.id,r.payload.id)).returning())).length>0;i&&await e.emit(g.definition.deleted,{id:r.payload.id}),r.setResult({deleted:i})}),s=e.on(m.list,async e=>{let r=e.payload,i=r.scope?jt(n,r.scope):[],a=i.length>0?await t.select().from(n).where(w(...i)):await t.select().from(n);e.setResult({workflows:a.map(F)})});return()=>{i(),a(),o(),s()}}function Pt(e){return{frameId:e.frameId,nodeId:e.nodeId,nodeType:e.nodeType,path:e.path,parentFrameId:e.parentFrameId??void 0,status:e.status,attempt:e.attempt,iteration:e.iteration??void 0,branchKey:e.branchKey??void 0,...e.outputPresent?{output:e.output}:{},error:e.error??void 0,startedAt:e.startedAt??void 0,completedAt:e.completedAt??void 0}}function Ft(e,t){return{frameId:t.frameId,executionId:e,nodeId:t.nodeId,nodeType:t.nodeType,path:t.path,parentFrameId:t.parentFrameId??null,status:t.status,attempt:t.attempt,iteration:t.iteration??null,branchKey:t.branchKey??null,output:t.output===void 0?null:t.output,outputPresent:t.output!==void 0,error:t.error??null,startedAt:t.startedAt??null,completedAt:t.completedAt??null}}function It(e,t){let{workflowExecutionFrames:n}=S(t,M),r=e.on(m.setFrame,async e=>{let{executionId:r,frame:i}=e.payload,a=Ft(r,i);await C(t,()=>t.insert(n).values(a).onConflictDoUpdate({target:n.frameId,set:a})),e.setResult({frameId:i.frameId})}),i=e.on(m.getFrame,async e=>{let r=await t.select().from(n).where(O(n.frameId,e.payload.frameId)).limit(1);e.setResult({frame:r[0]?Pt(r[0]):null})}),a=e.on(m.listFrames,async e=>{let r=await t.select().from(n).where(O(n.executionId,e.payload.executionId)).orderBy(T(n.startedAt),T(n.frameId));e.setResult({frames:r.map(Pt)})});return()=>{r(),i(),a()}}function Lt(e){return`${e.executionId}:${e.nodeId}:${e.frameId}`}function I(e){return{executionId:e.executionId,nodeId:e.nodeId,frameId:e.frameId,schema:e.schema,prompt:e.prompt??void 0,status:e.status,autoAction:e.autoAction,timeoutMs:e.timeoutMs??null,...e.resumeDataPresent?{resumeData:e.resumeData}:{},...e.reason===null?{}:{reason:e.reason},createdAt:e.createdAt,resolvedAt:e.resolvedAt??void 0}}function L(e){return{id:Lt(e),executionId:e.executionId,nodeId:e.nodeId,frameId:e.frameId,schema:e.schema,prompt:e.prompt??null,status:e.status,autoAction:e.autoAction,timeoutMs:e.timeoutMs,resumeData:e.resumeData===void 0?null:e.resumeData,reason:e.reason??null,resumeDataPresent:e.resumeData!==void 0,createdAt:e.createdAt,resolvedAt:e.resolvedAt??null}}function Rt(e,t,n,r){if(e===void 0&&t===void 0)throw Error(`Either executionId or status is required to list gate instances.`);let i=n??Be;if(!Number.isInteger(i)||i<v||i>_)throw Error(`Gate instance list limit must be an integer between ${v} and ${_}.`);return{resolvedLimit:i,predicates:[...e===void 0?[]:[O(r.executionId,e)],...t===void 0?[]:[O(r.status,t)]]}}function zt(e,t){let{workflowExecutions:n,workflowGateInstances:r}=S(t,M),i=e.on(m.setGateInstance,async e=>{let n=e.payload.gate,i=L(n);await C(t,()=>t.insert(r).values(i).onConflictDoUpdate({target:r.id,set:i})),e.setResult({id:i.id})}),a=e.on(m.resolveWaitingGateInstance,async e=>{let n=e.payload.gate,i=L(n),a=await C(t,()=>t.update(r).set(i).where(w(O(r.id,i.id),O(r.status,`waiting`))).returning({id:r.id}));e.setResult({accepted:a.length===1})}),o=e.on(m.getGateInstance,async e=>{let{executionId:n,nodeId:i,frameId:a}=e.payload,o=[O(r.executionId,n),O(r.nodeId,i)];a!==void 0&&o.push(O(r.frameId,a));let s=await t.select().from(r).where(w(...o)).limit(1);e.setResult({gate:s[0]?I(s[0]):null})}),s=e.on(m.listGateInstances,async e=>{let{executionId:n,status:i,limit:a}=e.payload,{resolvedLimit:o,predicates:s}=Rt(n,i,a,r),c=await t.select().from(r).where(w(...s)).orderBy(D(r.createdAt),D(r.id)).limit(o);e.setResult({gates:c.map(I)})}),c=e.on(m.listPausedGateTimeouts,async e=>{let i=await t.select({gate:r}).from(r).innerJoin(n,O(r.executionId,n.id)).where(w(O(r.status,`waiting`),O(n.status,`paused`),lt(r.timeoutMs)));e.setResult({gates:i.map(e=>I(e.gate))})});return()=>{i(),a(),o(),s(),c()}}function Bt(e){return{executionId:e.executionId,frameId:e.frameId,stepId:e.stepId,stepType:e.stepType,status:e.status,startedAt:e.startedAt??void 0,completedAt:e.completedAt??void 0,durationMs:e.durationMs??void 0,inputTokens:e.inputTokens??void 0,outputTokens:e.outputTokens??void 0,estimatedCost:e.estimatedCost??void 0,toolCallCount:e.toolCallCount??void 0,input:e.input??void 0,output:e.output??void 0}}function Vt(e){return{sourceExecutionId:e.sourceExecutionId,targetExecutionId:e.targetExecutionId,linkType:e.linkType,metadata:e.metadata??void 0}}function Ht(e,t){let{workflowStepSpans:n,workflowExecutionLinks:r}=S(t,M),i=e.on(m.setSpan,async e=>{let{span:r}=e.payload;await C(t,()=>t.insert(n).values(r).onConflictDoUpdate({target:[n.executionId,n.frameId],set:r})),e.setResult({id:`${r.executionId}:${r.frameId}`})}),a=e.on(m.listSpans,async e=>{let r=await t.select().from(n).where(O(n.executionId,e.payload.executionId)).orderBy(T(n.startedAt),T(n.stepId),T(n.frameId));e.setResult({spans:r.map(Bt)})}),o=e.on(m.setExecutionLink,async e=>{let{link:n}=e.payload;await C(t,()=>t.insert(r).values(n).onConflictDoUpdate({target:[r.sourceExecutionId,r.targetExecutionId],set:n})),e.setResult({id:`${n.sourceExecutionId}:${n.targetExecutionId}`})}),s=e.on(m.listExecutionLinks,async e=>{let{sourceExecutionId:n,targetExecutionId:i}=e.payload;if(n===void 0&&i===void 0)throw Error(`Either sourceExecutionId or targetExecutionId is required to list execution links.`);let a=[...n===void 0?[]:[O(r.sourceExecutionId,n)],...i===void 0?[]:[O(r.targetExecutionId,i)]],o=t.select().from(r).where(w(...a));e.setResult({links:(await o).map(Vt)})});return()=>{i(),a(),o(),s()}}function R(e,t){return t===null?at(e)===`postgres`?A`'null'::jsonb`:A`'null'`:t}function Ut(e){switch(e.kind){case`path`:return{sourceKind:`path`,sourcePath:e.path,sourceFilename:null,sourceCode:null};case`source`:return{sourceKind:`source`,sourcePath:null,sourceFilename:e.filename,sourceCode:e.source};case`definition`:return{sourceKind:`definition`,sourcePath:null,sourceFilename:null,sourceCode:null}}}function Wt(e){switch(e.sourceKind){case`path`:if(!e.sourcePath)throw Error(`Invalid run context row: sourcePath required for kind=path`);return{kind:`path`,path:e.sourcePath};case`source`:if(!e.sourceFilename)throw Error(`Invalid run context row: sourceFilename required for kind=source`);return{kind:`source`,filename:e.sourceFilename,source:e.sourceCode??``};case`definition`:return{kind:`definition`,workflowId:e.workflowId};default:throw Error(`Unknown run context source kind: ${String(e.sourceKind)}`)}}function Gt(e){return{executionId:e.executionId,workflowId:e.workflowId,coordinatorSessionId:e.coordinatorSessionId,source:Wt(e),definitionSnapshot:e.definitionSnapshot??void 0,workerManifest:e.workerManifest,inputs:e.inputs,config:e.config??{},triggerPayload:e.triggerPayload,...e.artifactRef===null?{}:{artifactRef:e.artifactRef},scope:P(e),...e.executionHints===null?{}:{executionHints:e.executionHints},...e.dispatchMetadata===null?{}:{dispatchMetadata:e.dispatchMetadata},cancelSubject:e.cancelSubject,context:e.context,env:e.env,createdAt:e.createdAt,suspensionStrategy:e.suspensionStrategy??`wait-in-process`,...e.terminalAuthority===null?{}:{terminalAuthority:e.terminalAuthority}}}function Kt(e){let t=Ut(e.source),n=N(e.scope);return{executionId:e.executionId,workflowId:e.workflowId,coordinatorSessionId:e.coordinatorSessionId,...t,definitionSnapshot:e.definitionSnapshot??null,workerManifest:e.workerManifest,inputs:e.inputs,config:e.config??{},triggerPayload:e.triggerPayload,artifactRef:e.artifactRef??null,executionHints:e.executionHints??null,dispatchMetadata:e.dispatchMetadata??null,...n,cancelSubject:e.cancelSubject,context:e.context,env:e.env,createdAt:e.createdAt,suspensionStrategy:e.suspensionStrategy,terminalAuthority:e.terminalAuthority??null}}async function qt(e,t,n){let r=Kt(t);await e.insert(n).values(r).onConflictDoUpdate({target:n.executionId,set:r})}function Jt(e,t){let{workflowRunContexts:n,workflowExecutionState:r,workflowExecutionStateEvents:i}=S(t,M),a=e.on(m.setRunContext,async e=>{let a=e.payload.runContext,o=e.payload.initialState;await x(t,async e=>{if(await qt(e,a,n),o===void 0)return;let s=Date.now(),c=R(t,o);await e.insert(r).values({executionId:a.executionId,sequence:0,value:c,updatedAt:s}).onConflictDoNothing(),await e.insert(i).values({executionId:a.executionId,sequence:0,patch:[],value:c,createdAt:s}).onConflictDoNothing()}),e.setResult({executionId:a.executionId})}),o=e.on(m.getRunContext,async e=>{let{executionId:r}=e.payload,i=await t.select().from(n).where(O(n.executionId,r)),a=i[0]?Gt(i[0]):null;e.setResult({runContext:a})});return()=>{a(),o()}}async function Yt(e,t,n){let{workflowExecutionState:r,workflowExecutionStateEvents:i}=S(e,M),a=Date.now(),o=R(e,n);await x(e,async e=>{await e.insert(r).values({executionId:t,sequence:0,value:o,updatedAt:a}).onConflictDoNothing(),await e.insert(i).values({executionId:t,sequence:0,patch:[],value:o,createdAt:a}).onConflictDoNothing()})}async function Xt(e,t){let{workflowExecutionState:n}=S(e,M),r=(await e.select().from(n).where(O(n.executionId,t)).limit(1))[0];return r?{executionId:r.executionId,sequence:r.sequence,value:r.value}:null}async function Zt(e,t){let{workflowExecutionState:n,workflowExecutionStateEvents:r}=S(e,M),a=Date.now(),o=R(e,t.nextValue);return x(e,async e=>{let s=(await e.select().from(n).where(O(n.executionId,t.executionId)).limit(1))[0];if(!s)throw Error(`no workflow state for execution ${t.executionId}`);if(t.expectedSequence===void 0)throw Error(`expectedSequence is required to patch workflow state`);let c=s.sequence+1,l=i(s.value,t.nextValue);if((await e.update(n).set({sequence:c,value:o,updatedAt:a}).where(w(O(n.executionId,t.executionId),O(n.sequence,t.expectedSequence))).returning()).length===0)throw Error(`state sequence conflict: expected ${String(t.expectedSequence)}, got ${String(s.sequence)}`);return await e.insert(r).values({executionId:t.executionId,sequence:c,patch:l,value:o,createdAt:a}),{executionId:t.executionId,sequence:c,patch:l,value:t.nextValue}})}function Qt(e,t){let n=e.on(m.initializeState,async e=>{let{executionId:n,initialValue:r}=e.payload;await Yt(t,n,r),e.setResult({})}),r=e.on(m.getState,async e=>{let{executionId:n}=e.payload,r=await Xt(t,n);e.setResult({state:r})}),i=e.on(m.patchState,async e=>{let{executionId:n,expectedSequence:r,nextValue:i}=e.payload,a=await Zt(t,{executionId:n,expectedSequence:r,nextValue:i});e.setResult(a)});return()=>{n(),r(),i()}}function $t(e){return{executionId:e.executionId,workflowId:e.workflowId,workflowName:e.workflowName??void 0,status:e.status,startedAt:e.startedAt,completedAt:e.completedAt??void 0,durationMs:e.durationMs??void 0,totalInputTokens:e.totalInputTokens??void 0,totalOutputTokens:e.totalOutputTokens??void 0,totalEstimatedCost:e.totalEstimatedCost??void 0,error:e.error??void 0,failedNodeId:e.failedNodeId??void 0}}async function en(e,t){let{worklogSummaries:n}=S(e,M);await e.insert(n).values(t).onConflictDoNothing()}async function tn(e,t){let{worklogSummaries:n}=S(e,M);await e.insert(n).values(t).onConflictDoUpdate({target:n.executionId,set:nn(t),setWhere:ft(n.status,[`completed`,`failed`,`cancelled`])})}function nn(e){return{workflowId:e.workflowId,workflowName:e.workflowName,status:e.status,startedAt:e.startedAt,completedAt:e.completedAt,durationMs:e.durationMs,error:e.error,failedNodeId:e.failedNodeId}}async function z(e,t){let{worklogSummaries:n}=S(e,M),r=await e.select().from(n).where(O(n.executionId,t)).limit(1);return r[0]?$t(r[0]):null}async function rn(e,t={}){let{worklogSummaries:n}=S(e,M),{workflowId:r,status:i,limit:a=50,offset:o=0}=t,s=[...r===void 0?[]:[O(n.workflowId,r)],...i===void 0?[]:[O(n.status,i)]],c=s.length>0?w(...s):void 0,[l,u]=await Promise.all([e.select().from(n).where(c).orderBy(D(n.startedAt)).limit(a).offset(o),e.select({count:E()}).from(n).where(c)]);return{items:l.map($t),total:u[0]?.count??0}}async function an(e,t){let{worklogFrameEntries:n}=S(e,M);await e.insert(n).values(t).onConflictDoNothing()}async function on(e,t){let{worklogFrameEntries:n}=S(e,M);await e.insert(n).values(t).onConflictDoUpdate({target:n.frameId,set:t,setWhere:ft(n.status,[`completed`,`failed`,`skipped`,`cancelled`])})}async function B(e,t){let{worklogFrameEntries:n}=S(e,M);return(await e.select().from(n).where(O(n.frameId,t)).limit(1))[0]??null}async function sn(e,t){let n=await B(e,t);return n===null?null:Je.parse({executionId:n.executionId,frameId:n.frameId,nodeId:n.nodeId,nodeType:n.nodeType,path:n.path,status:n.status,attempt:n.attempt,iteration:n.iteration??void 0,branchKey:n.branchKey??void 0,startedAt:n.startedAt??void 0,completedAt:n.completedAt??void 0,durationMs:n.durationMs??void 0,inputTokens:n.inputTokens??void 0,outputTokens:n.outputTokens??void 0,estimatedCost:n.estimatedCost??void 0,error:n.error??void 0})}async function cn(e,t){let{worklogArtifactWrites:n}=S(e,M);await e.insert(n).values(t).onConflictDoUpdate({target:n.id,set:t})}function ln(e,t,n,r,i){return`${e}:${t}:${n}:${r}:${i}`}async function V(e,t){let{worklogGateEvents:n}=S(e,M);await e.insert(n).values(t).onConflictDoUpdate({target:n.id,set:t})}async function un(e,t){let{worklogGateEvents:n}=S(e,M);return(await e.select().from(n).where(O(n.id,t)).limit(1))[0]??null}function dn(e,t,n){return`${e}:${t}:${n}`}async function fn(e,t,n){let[r]=await e.update(t).set({totalInputTokens:t.totalInputTokens}).where(O(t.executionId,n)).returning();return r}async function pn(e,t,n){let[r]=await e.select({totalInputTokens:j(t.inputTokens),totalOutputTokens:j(t.outputTokens),totalEstimatedCost:j(t.estimatedCost),measuredInputTokens:E(t.inputTokens),measuredOutputTokens:E(t.outputTokens),measuredCosts:E(t.estimatedCost)}).from(t).where(O(t.executionId,n));return{totalInputTokens:Number(r?.totalInputTokens??0),totalOutputTokens:Number(r?.totalOutputTokens??0),totalEstimatedCost:Number(r?.totalEstimatedCost??0),hasMeasurements:Number(r?.measuredInputTokens??0)>0||Number(r?.measuredOutputTokens??0)>0||Number(r?.measuredCosts??0)>0}}function mn(e){return e.hasMeasurements}async function hn(e,t,n,r){await e.update(t).set({totalInputTokens:r.totalInputTokens,totalOutputTokens:r.totalOutputTokens,totalEstimatedCost:r.totalEstimatedCost}).where(O(t.executionId,n))}async function gn(e,t,n,r){let i=A`coalesce((select sum(${n.inputTokens}) from ${n} where ${n.executionId} = ${r}), 0)`,a=A`coalesce((select sum(${n.outputTokens}) from ${n} where ${n.executionId} = ${r}), 0)`,o=A`coalesce((select sum(${n.estimatedCost}) from ${n} where ${n.executionId} = ${r}), 0)`,s=A`exists(
|
|
1
|
+
import{$ as e,A as t,B as n,D as r,E as i,F as a,G as o,H as s,I as c,J as l,K as u,L as d,M as f,N as p,O as m,P as ee,Q as te,R as ne,S as re,T as ie,U as ae,V as oe,W as se,X as ce,Y as le,Z as ue,_ as h,a as de,b as fe,c as pe,d as me,et as he,f as ge,g as _e,h as ve,i as ye,it as g,j as be,k as xe,m as Se,n as Ce,nt as we,p as Te,q as Ee,r as De,rt as Oe,s as ke,tt as Ae,u as je,v as Me,w as Ne,x as Pe,y as Fe,z as Ie}from"./authority-state-bootstrap-BlbmQ9A5.mjs";import{matchesFilter as Le,matchesSubscription as Re}from"@makaio/framework/bus";import{ArtifactSubjects as ze,EXECUTION_LIST_DEFAULT_LIMIT as Be,EXECUTION_LIST_MAX_LIMIT as _,EXECUTION_LIST_MIN_LIMIT as v,EXTERNAL_EXECUTION_ID_PREFIX as Ve,ExecutionHintsSchema as He,ExecutionsByArtifactRefsQuerySchema as Ue,JsonPatchOperationSchema as We,JsonValueSchema as Ge,SessionSubjects as Ke,WORKFLOW_CANCELLED_REASON as qe,WorkLogFrameEntrySchema as Je,WorkflowError as y,WorkflowErrorCode as Ye,WorkflowNamespace as Xe,WorkflowStepTypeSchema as Ze,WorkflowSubjects as b,createWorkflowCancelSubject as Qe,createWorkflowFinalizerNamespace as $e,dep as et,extensionToken as tt,serializeArtifactRef as nt}from"@makaio/framework/contracts";import{BaseService as rt}from"@makaio/framework/service-base";import{defineDialectSchema as it,executeTransaction as x,getDatabaseDialect as at,registerDrizzleHandlers as ot,resolveSchema as S,serializeDatabaseOperation as C}from"@makaio/framework/storage/drizzle";import{and as w,asc as T,count as E,desc as D,eq as O,getTableColumns as st,gte as ct,isNotNull as lt,isNull as k,lt as ut,lte as dt,notInArray as ft,or as pt,sql as A,sum as j}from"drizzle-orm";import{compile as mt}from"@makaio/framework/expression";import*as ht from"node:os";import{SessionToken as gt}from"@makaio/framework/services";const _t=t.postgres,vt=n.postgres,yt=f.postgres,bt=s.postgres,xt=u.postgres,St=ee.postgres,Ct=se.postgres,wt=he.postgres,Tt=ce.postgres,Et=l.postgres,Dt=te.postgres,Ot=c.postgres,kt=ne.postgres,At=we.postgres,M=it({workflowDefinitions:xe,workflowExecutions:Ie,workflowExecutionFrames:be,workflowGateInstances:oe,workflowStepSpans:o,workflowExecutionLinks:p,workflowRunContexts:ae,worklogSummaries:e,worklogFrameEntries:le,worklogArtifactWrites:Ee,worklogGateEvents:ue,workflowExecutionState:a,workflowExecutionStateEvents:d,workflowFinalizations:Ae},{workflowDefinitions:_t,workflowExecutions:vt,workflowExecutionFrames:yt,workflowGateInstances:bt,workflowStepSpans:xt,workflowExecutionLinks:St,workflowRunContexts:Ct,worklogSummaries:wt,worklogFrameEntries:Tt,worklogArtifactWrites:Et,worklogGateEvents:Dt,workflowExecutionState:Ot,workflowExecutionStateEvents:kt,workflowFinalizations:At});function N(e){return e.type===`global`?{scopeType:`global`,scopeKind:``,scopeId:``}:e.type===`external`?{scopeType:`external`,scopeKind:e.kind,scopeId:e.id}:{scopeType:e.type,scopeKind:``,scopeId:e.id}}function P(e){switch(e.scopeType){case`global`:return{type:`global`};case`external`:if(!e.scopeKind||!e.scopeId)throw Error(`Invalid external workflow scope row: scopeKind and scopeId are required`);return{type:`external`,kind:e.scopeKind,id:e.scopeId};case`workspace`:case`session`:if(!e.scopeId)throw Error(`Invalid ${e.scopeType} workflow scope row: scopeId is required`);return{type:e.scopeType,id:e.scopeId};default:{let t=e.scopeType;throw Error(`Unknown scope type: ${String(t)}`)}}}function jt(e,t){let{scopeType:n,scopeKind:r,scopeId:i}=N(t);return[O(e.scopeType,n),O(e.scopeKind,r),O(e.scopeId,i)]}function F(e){return{id:e.id,name:e.name,description:e.description??void 0,root:e.root,inputSchema:e.inputSchema??void 0,configSchema:e.configSchema??void 0,outputSchema:e.outputSchema??void 0,state:e.state??void 0,artifact:e.artifact??void 0,triggers:e.triggers??void 0,scope:P(e),canvasLayout:e.canvasLayout??void 0,source:e.source??void 0,successFinalizerId:e.successFinalizerId??void 0,executionHints:e.executionHints??void 0}}function Mt(e,t){let n=N(e.scope);return{id:e.id,name:e.name??e.id,root:e.root,description:e.description??null,inputSchema:e.inputSchema??null,configSchema:e.configSchema??null,outputSchema:e.outputSchema??null,state:e.state??null,artifact:e.artifact??null,triggers:e.triggers??null,canvasLayout:e.canvasLayout??null,source:e.source??null,successFinalizerId:e.successFinalizerId??null,executionHints:e.executionHints??null,createdAt:t,updatedAt:t,...n}}function Nt(e,t){let{workflowDefinitions:n}=S(t,M),r=st(n),i=e.on(m.get,async e=>{let r=await t.select().from(n).where(O(n.id,e.payload.id)).limit(1);e.setResult({workflow:r[0]?F(r[0]):null})}),a=e.on(m.set,async i=>{let a=i.payload.workflow,o=Date.now(),s=Mt(a,o),c=await C(t,async()=>{let e=await t.insert(n).values(s).onConflictDoNothing({target:n.id}).returning();if(e.length>0)return{kind:`created`,row:e[0]};let[i]=await t.update(n).set({name:s.name,root:s.root,updatedAt:o,createdAt:A`COALESCE(${r.createdAt}, ${o})`,description:s.description===null?A`${r.description}`:s.description,inputSchema:s.inputSchema===null?A`${r.inputSchema}`:s.inputSchema,configSchema:s.configSchema===null?A`${r.configSchema}`:s.configSchema,outputSchema:s.outputSchema===null?A`${r.outputSchema}`:s.outputSchema,state:s.state,artifact:s.artifact===null?A`${r.artifact}`:s.artifact,triggers:s.triggers===null?A`${r.triggers}`:s.triggers,canvasLayout:s.canvasLayout===null?A`${r.canvasLayout}`:s.canvasLayout,source:s.source===null?A`${r.source}`:s.source,successFinalizerId:s.successFinalizerId,executionHints:s.executionHints===null?A`${r.executionHints}`:s.executionHints,...N(a.scope)}).where(O(n.id,a.id)).returning();return i?{kind:`updated`,row:i}:void 0});c&&await e.emit(c.kind===`created`?g.definition.created:g.definition.updated,F(c.row)),i.setResult({id:a.id})}),o=e.on(m.delete,async r=>{let i=(await C(t,()=>t.delete(n).where(O(n.id,r.payload.id)).returning())).length>0;i&&await e.emit(g.definition.deleted,{id:r.payload.id}),r.setResult({deleted:i})}),s=e.on(m.list,async e=>{let r=e.payload,i=r.scope?jt(n,r.scope):[],a=i.length>0?await t.select().from(n).where(w(...i)):await t.select().from(n);e.setResult({workflows:a.map(F)})});return()=>{i(),a(),o(),s()}}function Pt(e){return{frameId:e.frameId,nodeId:e.nodeId,nodeType:e.nodeType,path:e.path,parentFrameId:e.parentFrameId??void 0,status:e.status,attempt:e.attempt,iteration:e.iteration??void 0,branchKey:e.branchKey??void 0,...e.outputPresent?{output:e.output}:{},error:e.error??void 0,startedAt:e.startedAt??void 0,completedAt:e.completedAt??void 0}}function Ft(e,t){return{frameId:t.frameId,executionId:e,nodeId:t.nodeId,nodeType:t.nodeType,path:t.path,parentFrameId:t.parentFrameId??null,status:t.status,attempt:t.attempt,iteration:t.iteration??null,branchKey:t.branchKey??null,output:t.output===void 0?null:t.output,outputPresent:t.output!==void 0,error:t.error??null,startedAt:t.startedAt??null,completedAt:t.completedAt??null}}function It(e,t){let{workflowExecutionFrames:n}=S(t,M),r=e.on(m.setFrame,async e=>{let{executionId:r,frame:i}=e.payload,a=Ft(r,i);await C(t,()=>t.insert(n).values(a).onConflictDoUpdate({target:n.frameId,set:a})),e.setResult({frameId:i.frameId})}),i=e.on(m.getFrame,async e=>{let r=await t.select().from(n).where(O(n.frameId,e.payload.frameId)).limit(1);e.setResult({frame:r[0]?Pt(r[0]):null})}),a=e.on(m.listFrames,async e=>{let r=await t.select().from(n).where(O(n.executionId,e.payload.executionId)).orderBy(T(n.startedAt),T(n.frameId));e.setResult({frames:r.map(Pt)})});return()=>{r(),i(),a()}}function Lt(e){return`${e.executionId}:${e.nodeId}:${e.frameId}`}function I(e){return{executionId:e.executionId,nodeId:e.nodeId,frameId:e.frameId,schema:e.schema,prompt:e.prompt??void 0,status:e.status,autoAction:e.autoAction,timeoutMs:e.timeoutMs??null,...e.resumeDataPresent?{resumeData:e.resumeData}:{},...e.reason===null?{}:{reason:e.reason},createdAt:e.createdAt,resolvedAt:e.resolvedAt??void 0}}function L(e){return{id:Lt(e),executionId:e.executionId,nodeId:e.nodeId,frameId:e.frameId,schema:e.schema,prompt:e.prompt??null,status:e.status,autoAction:e.autoAction,timeoutMs:e.timeoutMs,resumeData:e.resumeData===void 0?null:e.resumeData,reason:e.reason??null,resumeDataPresent:e.resumeData!==void 0,createdAt:e.createdAt,resolvedAt:e.resolvedAt??null}}function Rt(e,t,n,r){if(e===void 0&&t===void 0)throw Error(`Either executionId or status is required to list gate instances.`);let i=n??Be;if(!Number.isInteger(i)||i<v||i>_)throw Error(`Gate instance list limit must be an integer between ${v} and ${_}.`);return{resolvedLimit:i,predicates:[...e===void 0?[]:[O(r.executionId,e)],...t===void 0?[]:[O(r.status,t)]]}}function zt(e,t){let{workflowExecutions:n,workflowGateInstances:r}=S(t,M),i=e.on(m.setGateInstance,async e=>{let n=e.payload.gate,i=L(n);await C(t,()=>t.insert(r).values(i).onConflictDoUpdate({target:r.id,set:i})),e.setResult({id:i.id})}),a=e.on(m.resolveWaitingGateInstance,async e=>{let n=e.payload.gate,i=L(n),a=await C(t,()=>t.update(r).set(i).where(w(O(r.id,i.id),O(r.status,`waiting`))).returning({id:r.id}));e.setResult({accepted:a.length===1})}),o=e.on(m.getGateInstance,async e=>{let{executionId:n,nodeId:i,frameId:a}=e.payload,o=[O(r.executionId,n),O(r.nodeId,i)];a!==void 0&&o.push(O(r.frameId,a));let s=await t.select().from(r).where(w(...o)).limit(1);e.setResult({gate:s[0]?I(s[0]):null})}),s=e.on(m.listGateInstances,async e=>{let{executionId:n,status:i,limit:a}=e.payload,{resolvedLimit:o,predicates:s}=Rt(n,i,a,r),c=await t.select().from(r).where(w(...s)).orderBy(D(r.createdAt),D(r.id)).limit(o);e.setResult({gates:c.map(I)})}),c=e.on(m.listPausedGateTimeouts,async e=>{let i=await t.select({gate:r}).from(r).innerJoin(n,O(r.executionId,n.id)).where(w(O(r.status,`waiting`),O(n.status,`paused`),lt(r.timeoutMs)));e.setResult({gates:i.map(e=>I(e.gate))})});return()=>{i(),a(),o(),s(),c()}}function Bt(e){return{executionId:e.executionId,frameId:e.frameId,stepId:e.stepId,stepType:e.stepType,status:e.status,startedAt:e.startedAt??void 0,completedAt:e.completedAt??void 0,durationMs:e.durationMs??void 0,inputTokens:e.inputTokens??void 0,outputTokens:e.outputTokens??void 0,estimatedCost:e.estimatedCost??void 0,toolCallCount:e.toolCallCount??void 0,input:e.input??void 0,output:e.output??void 0}}function Vt(e){return{sourceExecutionId:e.sourceExecutionId,targetExecutionId:e.targetExecutionId,linkType:e.linkType,metadata:e.metadata??void 0}}function Ht(e,t){let{workflowStepSpans:n,workflowExecutionLinks:r}=S(t,M),i=e.on(m.setSpan,async e=>{let{span:r}=e.payload;await C(t,()=>t.insert(n).values(r).onConflictDoUpdate({target:[n.executionId,n.frameId],set:r})),e.setResult({id:`${r.executionId}:${r.frameId}`})}),a=e.on(m.listSpans,async e=>{let r=await t.select().from(n).where(O(n.executionId,e.payload.executionId)).orderBy(T(n.startedAt),T(n.stepId),T(n.frameId));e.setResult({spans:r.map(Bt)})}),o=e.on(m.setExecutionLink,async e=>{let{link:n}=e.payload;await C(t,()=>t.insert(r).values(n).onConflictDoUpdate({target:[r.sourceExecutionId,r.targetExecutionId],set:n})),e.setResult({id:`${n.sourceExecutionId}:${n.targetExecutionId}`})}),s=e.on(m.listExecutionLinks,async e=>{let{sourceExecutionId:n,targetExecutionId:i}=e.payload;if(n===void 0&&i===void 0)throw Error(`Either sourceExecutionId or targetExecutionId is required to list execution links.`);let a=[...n===void 0?[]:[O(r.sourceExecutionId,n)],...i===void 0?[]:[O(r.targetExecutionId,i)]],o=t.select().from(r).where(w(...a));e.setResult({links:(await o).map(Vt)})});return()=>{i(),a(),o(),s()}}function R(e,t){return t===null?at(e)===`postgres`?A`'null'::jsonb`:A`'null'`:t}function Ut(e){switch(e.kind){case`path`:return{sourceKind:`path`,sourcePath:e.path,sourceFilename:null,sourceCode:null};case`source`:return{sourceKind:`source`,sourcePath:null,sourceFilename:e.filename,sourceCode:e.source};case`definition`:return{sourceKind:`definition`,sourcePath:null,sourceFilename:null,sourceCode:null}}}function Wt(e){switch(e.sourceKind){case`path`:if(!e.sourcePath)throw Error(`Invalid run context row: sourcePath required for kind=path`);return{kind:`path`,path:e.sourcePath};case`source`:if(!e.sourceFilename)throw Error(`Invalid run context row: sourceFilename required for kind=source`);return{kind:`source`,filename:e.sourceFilename,source:e.sourceCode??``};case`definition`:return{kind:`definition`,workflowId:e.workflowId};default:throw Error(`Unknown run context source kind: ${String(e.sourceKind)}`)}}function Gt(e){return{executionId:e.executionId,workflowId:e.workflowId,coordinatorSessionId:e.coordinatorSessionId,source:Wt(e),definitionSnapshot:e.definitionSnapshot??void 0,workerManifest:e.workerManifest,inputs:e.inputs,config:e.config??{},triggerPayload:e.triggerPayload,...e.artifactRef===null?{}:{artifactRef:e.artifactRef},scope:P(e),...e.executionHints===null?{}:{executionHints:e.executionHints},...e.dispatchMetadata===null?{}:{dispatchMetadata:e.dispatchMetadata},cancelSubject:e.cancelSubject,context:e.context,env:e.env,createdAt:e.createdAt,suspensionStrategy:e.suspensionStrategy??`wait-in-process`,...e.terminalAuthority===null?{}:{terminalAuthority:e.terminalAuthority}}}function Kt(e){let t=Ut(e.source),n=N(e.scope);return{executionId:e.executionId,workflowId:e.workflowId,coordinatorSessionId:e.coordinatorSessionId,...t,definitionSnapshot:e.definitionSnapshot??null,workerManifest:e.workerManifest,inputs:e.inputs,config:e.config??{},triggerPayload:e.triggerPayload,artifactRef:e.artifactRef??null,executionHints:e.executionHints??null,dispatchMetadata:e.dispatchMetadata??null,...n,cancelSubject:e.cancelSubject,context:e.context,env:e.env,createdAt:e.createdAt,suspensionStrategy:e.suspensionStrategy,terminalAuthority:e.terminalAuthority??null}}async function qt(e,t,n){let r=Kt(t);await e.insert(n).values(r).onConflictDoUpdate({target:n.executionId,set:r})}function Jt(e,t){let{workflowRunContexts:n,workflowExecutionState:r,workflowExecutionStateEvents:i}=S(t,M),a=e.on(m.setRunContext,async e=>{let a=e.payload.runContext,o=e.payload.initialState;await x(t,async e=>{if(await qt(e,a,n),o===void 0)return;let s=Date.now(),c=R(t,o);await e.insert(r).values({executionId:a.executionId,sequence:0,value:c,updatedAt:s}).onConflictDoNothing(),await e.insert(i).values({executionId:a.executionId,sequence:0,patch:[],value:c,createdAt:s}).onConflictDoNothing()}),e.setResult({executionId:a.executionId})}),o=e.on(m.getRunContext,async e=>{let{executionId:r}=e.payload,i=await t.select().from(n).where(O(n.executionId,r)),a=i[0]?Gt(i[0]):null;e.setResult({runContext:a})});return()=>{a(),o()}}async function Yt(e,t,n){let{workflowExecutionState:r,workflowExecutionStateEvents:i}=S(e,M),a=Date.now(),o=R(e,n);await x(e,async e=>{await e.insert(r).values({executionId:t,sequence:0,value:o,updatedAt:a}).onConflictDoNothing(),await e.insert(i).values({executionId:t,sequence:0,patch:[],value:o,createdAt:a}).onConflictDoNothing()})}async function Xt(e,t){let{workflowExecutionState:n}=S(e,M),r=(await e.select().from(n).where(O(n.executionId,t)).limit(1))[0];return r?{executionId:r.executionId,sequence:r.sequence,value:r.value}:null}async function Zt(e,t){let{workflowExecutionState:n,workflowExecutionStateEvents:r}=S(e,M),a=Date.now(),o=R(e,t.nextValue);return x(e,async e=>{let s=(await e.select().from(n).where(O(n.executionId,t.executionId)).limit(1))[0];if(!s)throw Error(`no workflow state for execution ${t.executionId}`);if(t.expectedSequence===void 0)throw Error(`expectedSequence is required to patch workflow state`);let c=s.sequence+1,l=i(s.value,t.nextValue);if((await e.update(n).set({sequence:c,value:o,updatedAt:a}).where(w(O(n.executionId,t.executionId),O(n.sequence,t.expectedSequence))).returning()).length===0)throw Error(`state sequence conflict: expected ${String(t.expectedSequence)}, got ${String(s.sequence)}`);return await e.insert(r).values({executionId:t.executionId,sequence:c,patch:l,value:o,createdAt:a}),{executionId:t.executionId,sequence:c,patch:l,value:t.nextValue}})}function Qt(e,t){let n=e.on(m.initializeState,async e=>{let{executionId:n,initialValue:r}=e.payload;await Yt(t,n,r),e.setResult({})}),r=e.on(m.getState,async e=>{let{executionId:n}=e.payload,r=await Xt(t,n);e.setResult({state:r})}),i=e.on(m.patchState,async e=>{let{executionId:n,expectedSequence:r,nextValue:i}=e.payload,a=await Zt(t,{executionId:n,expectedSequence:r,nextValue:i});e.setResult(a)});return()=>{n(),r(),i()}}function $t(e){return{executionId:e.executionId,workflowId:e.workflowId,workflowName:e.workflowName??void 0,status:e.status,startedAt:e.startedAt,completedAt:e.completedAt??void 0,durationMs:e.durationMs??void 0,totalInputTokens:e.totalInputTokens??void 0,totalOutputTokens:e.totalOutputTokens??void 0,totalEstimatedCost:e.totalEstimatedCost??void 0,error:e.error??void 0,failedNodeId:e.failedNodeId??void 0}}async function en(e,t){let{worklogSummaries:n}=S(e,M);await e.insert(n).values(t).onConflictDoNothing()}async function tn(e,t){let{worklogSummaries:n}=S(e,M);await e.insert(n).values(t).onConflictDoUpdate({target:n.executionId,set:nn(t),setWhere:ft(n.status,[`completed`,`failed`,`cancelled`])})}function nn(e){return{workflowId:e.workflowId,workflowName:e.workflowName,status:e.status,startedAt:e.startedAt,completedAt:e.completedAt,durationMs:e.durationMs,error:e.error,failedNodeId:e.failedNodeId}}async function z(e,t){let{worklogSummaries:n}=S(e,M),r=await e.select().from(n).where(O(n.executionId,t)).limit(1);return r[0]?$t(r[0]):null}async function rn(e,t={}){let{worklogSummaries:n}=S(e,M),{workflowId:r,status:i,limit:a=50,offset:o=0}=t,s=[...r===void 0?[]:[O(n.workflowId,r)],...i===void 0?[]:[O(n.status,i)]],c=s.length>0?w(...s):void 0,[l,u]=await Promise.all([e.select().from(n).where(c).orderBy(D(n.startedAt)).limit(a).offset(o),e.select({count:E()}).from(n).where(c)]);return{items:l.map($t),total:u[0]?.count??0}}async function an(e,t){let{worklogFrameEntries:n}=S(e,M);await e.insert(n).values(t).onConflictDoNothing()}async function on(e,t){let{worklogFrameEntries:n}=S(e,M);await e.insert(n).values(t).onConflictDoUpdate({target:n.frameId,set:t,setWhere:ft(n.status,[`completed`,`failed`,`skipped`,`cancelled`])})}async function B(e,t){let{worklogFrameEntries:n}=S(e,M);return(await e.select().from(n).where(O(n.frameId,t)).limit(1))[0]??null}async function sn(e,t){let n=await B(e,t);return n===null?null:Je.parse({executionId:n.executionId,frameId:n.frameId,nodeId:n.nodeId,nodeType:n.nodeType,path:n.path,status:n.status,attempt:n.attempt,iteration:n.iteration??void 0,branchKey:n.branchKey??void 0,startedAt:n.startedAt??void 0,completedAt:n.completedAt??void 0,durationMs:n.durationMs??void 0,inputTokens:n.inputTokens??void 0,outputTokens:n.outputTokens??void 0,estimatedCost:n.estimatedCost??void 0,error:n.error??void 0})}async function cn(e,t){let{worklogArtifactWrites:n}=S(e,M);await e.insert(n).values(t).onConflictDoUpdate({target:n.id,set:t})}function ln(e,t,n,r,i){return`${e}:${t}:${n}:${r}:${i}`}async function V(e,t){let{worklogGateEvents:n}=S(e,M);await e.insert(n).values(t).onConflictDoUpdate({target:n.id,set:t})}async function un(e,t){let{worklogGateEvents:n}=S(e,M);return(await e.select().from(n).where(O(n.id,t)).limit(1))[0]??null}function dn(e,t,n){return`${e}:${t}:${n}`}async function fn(e,t,n){let[r]=await e.update(t).set({totalInputTokens:t.totalInputTokens}).where(O(t.executionId,n)).returning();return r}async function pn(e,t,n){let[r]=await e.select({totalInputTokens:j(t.inputTokens),totalOutputTokens:j(t.outputTokens),totalEstimatedCost:j(t.estimatedCost),measuredInputTokens:E(t.inputTokens),measuredOutputTokens:E(t.outputTokens),measuredCosts:E(t.estimatedCost)}).from(t).where(O(t.executionId,n));return{totalInputTokens:Number(r?.totalInputTokens??0),totalOutputTokens:Number(r?.totalOutputTokens??0),totalEstimatedCost:Number(r?.totalEstimatedCost??0),hasMeasurements:Number(r?.measuredInputTokens??0)>0||Number(r?.measuredOutputTokens??0)>0||Number(r?.measuredCosts??0)>0}}function mn(e){return e.hasMeasurements}async function hn(e,t,n,r){await e.update(t).set({totalInputTokens:r.totalInputTokens,totalOutputTokens:r.totalOutputTokens,totalEstimatedCost:r.totalEstimatedCost}).where(O(t.executionId,n))}async function gn(e,t,n,r){let i=A`coalesce((select sum(${n.inputTokens}) from ${n} where ${n.executionId} = ${r}), 0)`,a=A`coalesce((select sum(${n.outputTokens}) from ${n} where ${n.executionId} = ${r}), 0)`,o=A`coalesce((select sum(${n.estimatedCost}) from ${n} where ${n.executionId} = ${r}), 0)`,s=A`exists(
|
|
2
2
|
select 1 from ${n}
|
|
3
3
|
where ${n.executionId} = ${r}
|
|
4
4
|
and (${n.inputTokens} is not null
|
package/dist/package.json
CHANGED