fengming 0.3.3 → 0.3.5
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/CHANGELOG.md +3 -3
- package/dist/abort-CjCDVBbH.js +277 -0
- package/dist/abort.runtime-DxJ8129J.js +2 -0
- package/dist/abort.runtime.js +1 -1
- package/dist/accounts-Cyn0sm_v.js +423 -0
- package/dist/accounts-DzcLKcN5.js +2 -0
- package/dist/acp/control-plane/manager.js +1 -1
- package/dist/acp-spawn-4lfz_3K9.js +1286 -0
- package/dist/acp-spawn-BCUjuO6L.js +2 -0
- package/dist/acp-stateful-target-driver-Bv99uwEA.js +89 -0
- package/dist/action-info-CP-p6RHS.js +75 -0
- package/dist/active-runtime-registry-DjKe53a5.js +62 -0
- package/dist/active-tool-schema-warnings-p7CqUnu1.js +105 -0
- package/dist/active-tool-schema-warnings-pGI92yka.js +2 -0
- package/dist/agent-B77yluip.js +1825 -0
- package/dist/agent-BooUvZnR.js +2 -0
- package/dist/agent-bundle-lsp-runtime-3ieSgTgo.js +389 -0
- package/dist/agent-bundle-lsp-runtime-CkJ0XJK7.js +2 -0
- package/dist/agent-bundle-mcp-materialize-BH-esGZL.js +124 -0
- package/dist/agent-bundle-mcp-tools-DkixTTnL.js +3 -0
- package/dist/agent-command-BJKcnQy6.js +1435 -0
- package/dist/agent-delivery-CEfe_Zzt.js +117 -0
- package/dist/agent-harness-runtime-R_Ae6o9C.js +207 -0
- package/dist/agent-kWSaRcQt.js +3 -0
- package/dist/agent-model-discovery-C49swEgd.js +238 -0
- package/dist/agent-model-discovery-DZbixJQs.js +3 -0
- package/dist/agent-runner-utils-BChpi9Ec.js +267 -0
- package/dist/agent-runner.runtime-3LOdt215.js +3784 -0
- package/dist/agent-runner.runtime.js +1 -1
- package/dist/agent-runtime-3jsv8b7Y.js +199 -0
- package/dist/agent-runtime-label-uoFI4ovH.js +30 -0
- package/dist/agent-runtime-metadata-BhFt6kLt.js +53 -0
- package/dist/agent-tool-result-middleware-loader-BxYJNC1i.js +55 -0
- package/dist/agent-tools-COLEG7aL.js +2506 -0
- package/dist/agent-tools.before-tool-call--rMZI5Rd.js +1274 -0
- package/dist/agent-tools.before-tool-call-CbX2sfP4.js +2 -0
- package/dist/agent-via-gateway-DfKij3De.js +486 -0
- package/dist/agent-wait-dedupe-BAUSJotw.js +180 -0
- package/dist/agents/agent-bundle-mcp-materialize.js +1 -1
- package/dist/agents/auth-profiles.runtime.js +1 -1
- package/dist/agents/compaction-planning.worker.js +1 -1
- package/dist/agents/embedded-agent-runner/effective-tool-policy.js +1 -1
- package/dist/agents/embedded-agent-runner/tool-split.js +1 -1
- package/dist/agents/model-catalog.runtime.js +1 -1
- package/dist/agents/model-provider-auth.worker.js +3 -3
- package/dist/agents/models-config.runtime.js +1 -1
- package/dist/agents-CZSNDJWD.js +632 -0
- package/dist/agents.command-shared-DgbjfH23.js +16 -0
- package/dist/agents.commands.add-DknGM1oz.js +304 -0
- package/dist/agents.commands.bind-DDVI0yDe.js +265 -0
- package/dist/agents.commands.delete-Dv4RHEhc.js +128 -0
- package/dist/agents.commands.identity-BSZbc1QR.js +143 -0
- package/dist/agents.commands.list-CA0OTw59.js +235 -0
- package/dist/aliases-EY1GbfwT.js +97 -0
- package/dist/api-CY0oKcRz.js +3 -0
- package/dist/api-DgjY0gIl.js +6 -0
- package/dist/api-VyMyAYze.js +2 -0
- package/dist/api-key-rotation-DxPKIdmC.js +167 -0
- package/dist/app-registration-BBDxCbFo.js +194 -0
- package/dist/apply-DMYy7tc3.js +544 -0
- package/dist/apply-Dd0n97MD.js +2 -0
- package/dist/apply-bHIT1nMp.js +416 -0
- package/dist/apply-g8x7Z83S.js +510 -0
- package/dist/apply-nnbx9TaB.js +2 -0
- package/dist/approval-native-helpers-CjaYvOaZ.js +398 -0
- package/dist/artifacts-B55YR-uA.js +368 -0
- package/dist/assistant-hJaOgfKl.js +291 -0
- package/dist/attachment-normalize-COsastJx.js +213 -0
- package/dist/attempt-execution-fDWDWcWe.js +584 -0
- package/dist/attempt-execution.helpers-Cze5xPim.js +969 -0
- package/dist/attempt-execution.runtime-B1iCG6LN.js +3 -0
- package/dist/attempt-execution.runtime.js +1 -1
- package/dist/attempt.prompt-helpers-CkBYHBBo.js +543 -0
- package/dist/attempt.tool-run-context-DzfRK5pV.js +1240 -0
- package/dist/audio-preflight.runtime-rjWd9uyk.js +7 -0
- package/dist/audio-preflight.runtime.js +1 -1
- package/dist/audit-DgFtNg3U.js +1108 -0
- package/dist/audit-L8EC3WhV.js +477 -0
- package/dist/audit.nondeep.runtime-D0sQ6bO2.js +1416 -0
- package/dist/audit.nondeep.runtime.js +1 -1
- package/dist/audit.runtime-CiG82F31.js +7 -0
- package/dist/audit.runtime.js +1 -1
- package/dist/auth-CzPdsZVM.js +567 -0
- package/dist/auth-choice-BNzS9QBI.js +3 -0
- package/dist/auth-choice-Cwr5kgcD.js +110 -0
- package/dist/auth-choice-DW9qPpMS.js +400 -0
- package/dist/auth-choice.apply.api-providers-C68tOdqj.js +34 -0
- package/dist/auth-choice.apply.api-providers-DSRK0gYo.js +2 -0
- package/dist/auth-choice.plugin-providers.runtime-BJ9VyO1C.js +11 -0
- package/dist/auth-choice.plugin-providers.runtime.js +1 -1
- package/dist/auth-health-BanKwsTW.js +219 -0
- package/dist/auth-list-Dq8obVno.js +115 -0
- package/dist/auth-order-VXqoAroP.js +105 -0
- package/dist/auth-profiles-6VFEdgC-.js +73 -0
- package/dist/auth-profiles-a0M4JYYg.js +14 -0
- package/dist/backend-config-COaTdVnN.js +259 -0
- package/dist/bash-tools-BMAquSiM.js +3 -0
- package/dist/bash-tools-DLiUXfaS.js +3497 -0
- package/dist/binding-routing-Bwvdx_7S.js +113 -0
- package/dist/binding-targets-Z_d0mK_1.js +121 -0
- package/dist/bootstrap-files-CoCV_zqu.js +202 -0
- package/dist/bootstrap-files-_T3VoTrV.js +3 -0
- package/dist/bridge-server-BIaNurGa.js +113 -0
- package/dist/browser-cli-D4wL8NU9.js +230 -0
- package/dist/browser-cli-actions-input-z40PGiYI.js +522 -0
- package/dist/browser-cli-actions-observe-C4TeyNke.js +81 -0
- package/dist/browser-cli-debug-Dv0gH-c8.js +137 -0
- package/dist/browser-cli-inspect-BUXeITYc.js +117 -0
- package/dist/browser-cli-manage-qMb3Yw5Y.js +446 -0
- package/dist/browser-cli-resize-CZWnGwGz.js +32 -0
- package/dist/browser-cli-shared-BpinhvE3.js +69 -0
- package/dist/browser-cli-state-CBbKqqgP.js +371 -0
- package/dist/browser-cli-uI5GGX51.js +2 -0
- package/dist/browser-control-auth-CFPJXdN_.js +2 -0
- package/dist/browser-profiles-D4ni3t4J.js +2 -0
- package/dist/browser-runtime-Dm5D_PLf.js +389 -0
- package/dist/browser-tool.schema-Bek02ox5.js +132 -0
- package/dist/btw-command-DdrwvCK4.js +18 -0
- package/dist/build-DkEeJ9sO.js +261 -0
- package/dist/build-info.json +2 -2
- package/dist/bundled/boot-md/handler.js +2 -2
- package/dist/bundled/session-memory/handler.js +1 -1
- package/dist/bundled-channel-config-schema-BeowdkHi.d.ts +3168 -0
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/capability-cli-DTRuKZJC.js +1809 -0
- package/dist/capability-provider-runtime-Cpp-Jq9g.js +346 -0
- package/dist/cdp.helpers-GfQkB-B5.js +637 -0
- package/dist/channel-BRehZ4Cg.js +2309 -0
- package/dist/channel-actions-hdQKe_se.js +46 -0
- package/dist/channel-bootstrap.runtime-BzjlNG_j.js +38 -0
- package/dist/channel-bootstrap.runtime-CmNNVl40.js +2 -0
- package/dist/channel-bootstrap.runtime.js +1 -1
- package/dist/channel-core-BLcWqSk-.js +5 -0
- package/dist/channel-inbound-pR1B7HTU.js +121 -0
- package/dist/channel-message-W0VurpjH.js +12 -0
- package/dist/channel-outbound-DO4HI6E_.js +436 -0
- package/dist/channel-plugin-resolution-CLA7S5_A.js +2 -0
- package/dist/channel-plugin-resolution-DzwVj01h.js +135 -0
- package/dist/channel-resolution-DOPyiG4k.js +46 -0
- package/dist/channel-selection-kwoWZDQ3.js +171 -0
- package/dist/channel-selection.runtime-LiDliif9.js +2 -0
- package/dist/channel-selection.runtime.js +1 -1
- package/dist/channel.runtime-DDt3PayH.js +697 -0
- package/dist/channel.runtime.js +1 -1
- package/dist/channels-CKJd4eUz.js +1004 -0
- package/dist/channels-cli-DLAPi8pX.js +331 -0
- package/dist/chat-6WsYrS9m.js +3 -0
- package/dist/chat-DpsCEXAx.js +2940 -0
- package/dist/chrome-BWHc9vYG.js +1517 -0
- package/dist/chrome-mcp-BGKgR8A_.js +2 -0
- package/dist/chrome-mcp-Bg5D5PDc.js +864 -0
- package/dist/claude-live-session-BLCZnv-A.js +2 -0
- package/dist/claude-live-session-CGnB64D6.js +1338 -0
- package/dist/clawbot-cli-ynXzgp8B.js +9 -0
- package/dist/cli/daemon-cli.js +3 -3
- package/dist/cli/gateway-lifecycle.runtime.js +4 -4
- package/dist/cli/run-main.js +12 -12
- package/dist/cli-B4Ttnj0P.js +2 -0
- package/dist/cli-BjVgdamH.js +2 -0
- package/dist/cli-CNqBrHLU.js +293 -0
- package/dist/cli-backends.runtime-DoxtCrow.js +7 -0
- package/dist/cli-backends.runtime.js +1 -1
- package/dist/cli-compaction-BCuLbs75.js +363 -0
- package/dist/cli-mthNIkji.js +141 -0
- package/dist/cli-registry-loader-B2sNTdgY.js +2 -0
- package/dist/cli-registry-loader-Dz9YFrjw.js +193 -0
- package/dist/cli-runner-C9t-9-Io.js +597 -0
- package/dist/cli-runner-D21qMGk7.js +2 -0
- package/dist/cli-runner.runtime-BNqbJFgu.js +3 -0
- package/dist/cli-runner.runtime-Dv50IEvH.js +4 -0
- package/dist/cli-runner.runtime.js +1 -1
- package/dist/cli-session-jBtClYfT.js +119 -0
- package/dist/cli-startup-metadata.json +9 -9
- package/dist/cli.runtime-CGBzSGAG.js +1276 -0
- package/dist/cli.runtime.js +1 -1
- package/dist/codex-native-web-search-B3C-srtm.js +20 -0
- package/dist/codex-native-web-search-B7xh2Xcb.js +4 -0
- package/dist/codex-native-web-search-core-CrwANQg5.js +106 -0
- package/dist/command-auth-Dz_pdczs.js +135 -0
- package/dist/command-config-resolution-XCA63Yv8.js +25 -0
- package/dist/command-config-resolution-xtKMDTG9.js +2 -0
- package/dist/command-config-resolution.runtime-xtKMDTG9.js +2 -0
- package/dist/command-config-resolution.runtime.js +1 -1
- package/dist/command-execution-startup-CasEqEXh.js +90 -0
- package/dist/command-primitives-runtime-DC9gtSI3.js +3 -0
- package/dist/command-registry-BQnMdca9.js +9 -0
- package/dist/command-registry-core-hx2t1jQP.js +114 -0
- package/dist/command-registry-rbKA-L_8.js +4 -0
- package/dist/command-secret-gateway-7oveYQCx.js +589 -0
- package/dist/command-secret-targets-B7M1Us_C.js +2 -0
- package/dist/command-status-builders-DrSoZhiI.js +147 -0
- package/dist/command-status.runtime-By0071-y.js +90 -0
- package/dist/command-status.runtime.js +1 -1
- package/dist/commands/status.summary.runtime.js +3 -3
- package/dist/commands-B1MnUj5-.js +161 -0
- package/dist/commands-compact.runtime-DELj3JaW.js +10 -0
- package/dist/commands-compact.runtime.js +1 -1
- package/dist/commands-core.runtime-Zw0grrkC.js +2 -0
- package/dist/commands-core.runtime.js +1 -1
- package/dist/commands-handlers.runtime-BCl_ZHJZ.js +6327 -0
- package/dist/commands-handlers.runtime.js +1 -1
- package/dist/commands-models-Uurm-0C3.js +448 -0
- package/dist/commands-registry-Bo1AeDcq.js +195 -0
- package/dist/commands-registry.runtime-C9DBHyhh.js +4 -0
- package/dist/commands-registry.runtime.js +1 -1
- package/dist/commands-status-BoAXH-wg.js +16 -0
- package/dist/commands-status-CNALMTN9.js +3 -0
- package/dist/commands-status.runtime-CNALMTN9.js +3 -0
- package/dist/commands-status.runtime.js +1 -1
- package/dist/commands-subagents-control.runtime-Dl4IuTzV.js +2 -0
- package/dist/commands-subagents-control.runtime.js +1 -1
- package/dist/commands-system-prompt-BPzpLmUp.js +2 -0
- package/dist/commands-system-prompt-DCOZSNh5.js +161 -0
- package/dist/commands.runtime-bfCLM0Sg.js +175 -0
- package/dist/commands.runtime.js +1 -1
- package/dist/commitments/runtime.js +1 -1
- package/dist/common-CoOYhmSg.js +286 -0
- package/dist/compact-yqaUOESq.js +1165 -0
- package/dist/compact.runtime-Y91AFZVE.js +12 -0
- package/dist/compact.runtime.js +1 -1
- package/dist/compaction-planning-DVnykwzd.js +202 -0
- package/dist/completion-cli-BJjq_g_B.js +393 -0
- package/dist/config-CsmSEaNn.js +374 -0
- package/dist/config-CtNXZ0iy.js +610 -0
- package/dist/config-cli-CNpIVdqp.js +1703 -0
- package/dist/config-mutation-B-SErGM0.js +5 -0
- package/dist/config-mutations-Bu3ahkX8.js +161 -0
- package/dist/config-utils-Bv0Nisds.js +141 -0
- package/dist/config-validation-DitvTYD8.js +33 -0
- package/dist/configure-CdjbRKTg.js +771 -0
- package/dist/configure-Cvi-5ml4.js +3 -0
- package/dist/configure.commands-BJii4733.js +1253 -0
- package/dist/configure.commands-tJzVFJ0o.js +2 -0
- package/dist/context-D1N9oPds.js +2 -0
- package/dist/context-XMtJ9b3v.js +248 -0
- package/dist/context-engine-host-compat-3QznbSaW.js +280 -0
- package/dist/context-engine-host-compat-DquSpnKD.js +2 -0
- package/dist/context-engine-lifecycle-Bqdhy9JU.js +627 -0
- package/dist/control-auth-CMW_9jmY.js +114 -0
- package/dist/control-service-D-r3k91q.js +40 -0
- package/dist/control-service-uIPYrp9F.js +3 -0
- package/dist/control-ui/assets/activity-DgMhyllD.js +124 -0
- package/dist/control-ui/assets/agents-CsRhxO2O.js +1030 -0
- package/dist/control-ui/assets/channels-Dq8bzpMg.js +120 -0
- package/dist/control-ui/assets/cron-Dk5bqYwg.js +1016 -0
- package/dist/control-ui/assets/debug-CNIwFEQO.js +97 -0
- package/dist/control-ui/assets/index-CV2NsPlu.js +7214 -0
- package/dist/control-ui/assets/instances-DLr0iEvT.js +57 -0
- package/dist/control-ui/assets/nodes-D3JEksjl.js +444 -0
- package/dist/control-ui/assets/sessions-nbXWGlHZ.js +425 -0
- package/dist/control-ui/assets/skills-tBOi8OBq.js +362 -0
- package/dist/control-ui/assets/workboard-ClTo7wmK.js +402 -0
- package/dist/control-ui/index.html +1 -1
- package/dist/control-ui/sw.js +1 -1
- package/dist/control-ui-AkRMsk9S.js +750 -0
- package/dist/conversation-label-generator-DHtcgSBn.js +72 -0
- package/dist/conversation-runtime-BEgHW4ta.js +31 -0
- package/dist/core-Bslrvfnp.js +284 -0
- package/dist/core-api-BOlUb7G8.js +5 -0
- package/dist/core-api-CiBoGa2I.js +2 -0
- package/dist/crestodian/crestodian.js +1 -1
- package/dist/crestodian/rescue-message.js +1 -1
- package/dist/crestodian-mXnyuHx9.js +55 -0
- package/dist/cron-PbdpyFrD.js +453 -0
- package/dist/daemon-install-C-d4dFvn.js +66 -0
- package/dist/daemon-install-auth-profiles-store.runtime-CvE2EVVo.js +2 -0
- package/dist/daemon-install-auth-profiles-store.runtime.js +1 -1
- package/dist/dashboard-Ey5dnvMI.js +263 -0
- package/dist/defaults-CsRAv-qE.js +130 -0
- package/dist/defaults-DHZBSNHC.js +3 -0
- package/dist/defaults.constants-CR4S_tvw.js +76 -0
- package/dist/deliver-BkuuFBlm.js +1399 -0
- package/dist/deliver-P4upyes7.js +3 -0
- package/dist/deliver-runtime-CjnLI_nC.js +2 -0
- package/dist/delivery-outbound.runtime-fcJ-M8qj.js +7 -0
- package/dist/delivery-outbound.runtime.js +1 -1
- package/dist/delivery-queue-BqgHvNlY.js +863 -0
- package/dist/delivery-queue-CfsRscJb.js +2 -0
- package/dist/delivery-queue-runtime-D0PKG1Bv.js +16 -0
- package/dist/delivery-target.runtime-C5e8d0WH.js +45 -0
- package/dist/delivery-target.runtime.js +1 -1
- package/dist/delivery.runtime-2Ut8xM3P.js +470 -0
- package/dist/delivery.runtime.js +1 -1
- package/dist/detached-task-runtime-OOZBqRy-.js +86 -0
- package/dist/diagnostics-zf6WQ2h7.js +168 -0
- package/dist/dialogue-C8IOya-l.js +37 -0
- package/dist/direct-dm-wPF-KfNb.js +81 -0
- package/dist/directive-handling.defaults-C-1lmFYo.js +22 -0
- package/dist/directive-handling.fast-lane-DENPMtYI.js +70 -0
- package/dist/directive-handling.impl-C1p5t3qA.js +2 -0
- package/dist/directive-handling.impl-DOo2Sa7C.js +823 -0
- package/dist/directive-handling.model-selection-6gC-fr_g.js +122 -0
- package/dist/directive-handling.persist.runtime-CuhUd2kW.js +274 -0
- package/dist/directive-handling.persist.runtime.js +1 -1
- package/dist/directives-BIKSyN8C.js +319 -0
- package/dist/directory-cli-DZ0PU0Rv.js +239 -0
- package/dist/dispatch-DQLImAqt.js +2057 -0
- package/dist/dispatch-acp-DzyX7wsq.js +1102 -0
- package/dist/dispatch-acp-manager.runtime-CoAfs4O1.js +3 -0
- package/dist/dispatch-acp-manager.runtime.js +1 -1
- package/dist/dispatch-acp-media.runtime-7uUP_jr9.js +4 -0
- package/dist/dispatch-acp-media.runtime.js +1 -1
- package/dist/dispatch-acp-transcript.runtime-BUlmV_h0.js +40 -0
- package/dist/dispatch-acp-transcript.runtime.js +1 -1
- package/dist/dispatch-acp-tts.runtime-ChBnVkNt.js +3 -0
- package/dist/dispatch-acp-tts.runtime.js +1 -1
- package/dist/dispatch-acp.runtime-DAexFaBu.js +18 -0
- package/dist/dispatch-acp.runtime.js +1 -1
- package/dist/dispatcher-D3IQEbf9.js +106 -0
- package/dist/doctor-BSqEqfb6.js +760 -0
- package/dist/doctor-auth-flat-profiles-BIZ4wsYP.js +2 -0
- package/dist/doctor-auth-flat-profiles-DXtD5LfC.js +516 -0
- package/dist/doctor-auth-legacy-oauth-DwFbRYTP.js +48 -0
- package/dist/doctor-auth-oauth-sidecar-6I3FEJbi.js +2 -0
- package/dist/doctor-auth-oauth-sidecar-BSC3rnDM.js +177 -0
- package/dist/doctor-auth-tVGsUiM6.js +216 -0
- package/dist/doctor-bootstrap-size-B0q6bdkO.js +57 -0
- package/dist/doctor-claude-cli-Bn79OuBT.js +150 -0
- package/dist/doctor-config-flow-CCwocXpV.js +1819 -0
- package/dist/doctor-core-checks-D7-1l8jy.js +666 -0
- package/dist/doctor-core-checks-eM8FNi8B.js +2 -0
- package/dist/doctor-core-checks.runtime-Dc03aeoU.js +278 -0
- package/dist/doctor-core-checks.runtime.js +1 -1
- package/dist/doctor-gRYfpEbB.js +6 -0
- package/dist/doctor-gateway-daemon-flow-KTnHAdeV.js +349 -0
- package/dist/doctor-gateway-services-BByDQtjY.js +465 -0
- package/dist/doctor-health-CnoM718z.js +65 -0
- package/dist/doctor-health-contributions-flVKMQwr.js +874 -0
- package/dist/doctor-lint-BBm6gtBa.js +95 -0
- package/dist/doctor-memory-search-DjHVDCGo.js +407 -0
- package/dist/doctor-state-integrity-Bgw25cz1.js +1257 -0
- package/dist/doctor-tool-result-cap-advice-B8wTpiTO.js +27 -0
- package/dist/doctor-workspace-status-DcjeJIpT.js +76 -0
- package/dist/dreaming-BE4t8DVf.js +523 -0
- package/dist/dreaming-command-DWm1lB-Z.js +101 -0
- package/dist/dreaming-narrative-8DM-OMrm.js +721 -0
- package/dist/dreaming-narrative-CcFfheQI.js +2 -0
- package/dist/dreaming-phases-CqOhhTdZ.js +2 -0
- package/dist/dreaming-phases-D9eT6Kk0.js +1162 -0
- package/dist/drive-D2M5B7-2.js +899 -0
- package/dist/echo-transcript-B-wl5MoX.js +52 -0
- package/dist/effective-tool-policy-Cx8mC5aA.js +89 -0
- package/dist/embedded-agent-BTvtoOe_.js +4 -0
- package/dist/embedded-agent-CGmSKuNM.js +4074 -0
- package/dist/embedded-agent-helpers-CboIPx57.js +6 -0
- package/dist/embedded-agent-helpers-cw0InMDZ.js +1037 -0
- package/dist/embedded-agent.runtime-Bfe4bjyF.js +4 -0
- package/dist/embedded-agent.runtime.js +1 -1
- package/dist/embedded-backend-D-EshN85.js +744 -0
- package/dist/embedded-gateway-stub.runtime-Cx9qs0KV.js +12 -0
- package/dist/embedded-gateway-stub.runtime.js +1 -1
- package/dist/embedding-provider-runtime-DaXfsUPo.js +86 -0
- package/dist/embedding-providers-CdU99clu.js +2 -0
- package/dist/embeddings-http-BQnlTr-1.js +222 -0
- package/dist/engine-qmd-5jbjGywA.js +708 -0
- package/dist/engine-storage-CfAgwoDp.js +203 -0
- package/dist/entry.js +1 -1
- package/dist/errors-C0AUxo3P.js +2 -0
- package/dist/exec-approval-forwarder.runtime-BvR47p5Z.js +4 -0
- package/dist/exec-approval-forwarder.runtime.js +1 -1
- package/dist/exec-approval-session-target-CCqYgaVa.js +177 -0
- package/dist/exec-auto-reviewer-BfJaNkNy.js +2 -0
- package/dist/exec-auto-reviewer-Dqx7I88Z.js +241 -0
- package/dist/execute.runtime-Qb6Z75sG.js +579 -0
- package/dist/execute.runtime.js +1 -1
- package/dist/extensionAPI.js +2 -2
- package/dist/extensions/active-memory/index.js +3 -3
- package/dist/extensions/admin-http-rpc/index.js +1 -1
- package/dist/extensions/alibaba/index.js +1 -1
- package/dist/extensions/alibaba/video-generation-provider.js +1 -1
- package/dist/extensions/baichuan/index.js +1 -1
- package/dist/extensions/browser/browser-bridge.js +1 -1
- package/dist/extensions/browser/browser-cdp.js +1 -1
- package/dist/extensions/browser/browser-config.js +5 -5
- package/dist/extensions/browser/browser-control-auth.js +2 -2
- package/dist/extensions/browser/browser-doctor.js +3 -3
- package/dist/extensions/browser/browser-maintenance.js +1 -1
- package/dist/extensions/browser/browser-profiles.js +3 -3
- package/dist/extensions/browser/browser-runtime-api.js +14 -14
- package/dist/extensions/browser/cli-metadata.js +1 -1
- package/dist/extensions/browser/index.js +1 -1
- package/dist/extensions/browser/plugin-registration.js +1 -1
- package/dist/extensions/browser/register.runtime.js +4 -4
- package/dist/extensions/browser/runtime-api.js +16 -16
- package/dist/extensions/byteplus/index.js +3 -3
- package/dist/extensions/byteplus/video-generation-provider.js +1 -1
- package/dist/extensions/canvas/index.js +3 -3
- package/dist/extensions/canvas/runtime-api.js +2 -2
- package/dist/extensions/deepseek/index.js +1 -1
- package/dist/extensions/device-pair/api.js +2 -2
- package/dist/extensions/device-pair/pair-command-approve.js +1 -1
- package/dist/extensions/device-pair/qr-image.js +2 -2
- package/dist/extensions/longcat/index.js +1 -1
- package/dist/extensions/memory-core/api.js +3 -3
- package/dist/extensions/memory-core/cli-metadata.js +1 -1
- package/dist/extensions/memory-core/cli.js +2 -2
- package/dist/extensions/memory-core/index.js +11 -11
- package/dist/extensions/memory-core/manager-runtime.js +1 -1
- package/dist/extensions/memory-core/runtime-api.js +6 -6
- package/dist/extensions/minimax/image-generation-provider.js +1 -1
- package/dist/extensions/minimax/index.js +7 -7
- package/dist/extensions/minimax/media-understanding-provider.js +1 -1
- package/dist/extensions/minimax/music-generation-provider.js +1 -1
- package/dist/extensions/minimax/oauth.js +1 -1
- package/dist/extensions/minimax/oauth.runtime.js +1 -1
- package/dist/extensions/minimax/provider-registration.js +1 -1
- package/dist/extensions/minimax/speech-provider.js +1 -1
- package/dist/extensions/minimax/video-generation-provider.js +1 -1
- package/dist/extensions/minimax/web-search-provider.js +1 -1
- package/dist/extensions/moonshot/index.js +5 -5
- package/dist/extensions/moonshot/media-understanding-provider.js +1 -1
- package/dist/extensions/moonshot/web-search-provider.js +1 -1
- package/dist/extensions/qianfan/index.js +1 -1
- package/dist/extensions/qwen/index.js +5 -5
- package/dist/extensions/qwen/media-understanding-provider.js +1 -1
- package/dist/extensions/qwen/video-generation-provider.js +1 -1
- package/dist/extensions/sensenova/index.js +1 -1
- package/dist/extensions/skill-workshop/api.js +2 -2
- package/dist/extensions/skill-workshop/index.js +4 -4
- package/dist/extensions/stepfun/index.js +2 -2
- package/dist/extensions/tavily/index.js +1 -1
- package/dist/extensions/tavily/web-search-provider.js +1 -1
- package/dist/extensions/tencent/index.js +2 -2
- package/dist/extensions/tiangong/index.js +1 -1
- package/dist/extensions/volcengine/index.js +3 -3
- package/dist/extensions/volcengine/speech-provider.js +1 -1
- package/dist/extensions/webhooks/api.js +1 -1
- package/dist/extensions/webhooks/index.js +1 -1
- package/dist/extensions/weixin/index.js +7 -7
- package/dist/extensions/workboard/index.js +2 -2
- package/dist/extensions/xiaomi/index.js +4 -4
- package/dist/extensions/xiaomi/speech-provider.js +1 -1
- package/dist/extensions/xingchen/index.js +1 -1
- package/dist/extensions/yi/index.js +1 -1
- package/dist/extensions/zai/index.js +4 -4
- package/dist/extensions/zai/media-understanding-provider.js +1 -1
- package/dist/extensions/zhinao/index.js +1 -1
- package/dist/external-cli-auth-selection-CM_aOUJw.js +113 -0
- package/dist/extra-params-Bm1eLWN9.js +615 -0
- package/dist/fallback-notice-state-v1kyWACv.js +15 -0
- package/dist/fallbacks-CDllk2g1.js +31 -0
- package/dist/fallbacks-shared-DdMKEmAC.js +116 -0
- package/dist/fengming-runtime-DSv30J04.js +33 -0
- package/dist/fengming-runtime-config-BE-DquuY.js +2 -0
- package/dist/fengming-runtime-memory-BE-DquuY.js +2 -0
- package/dist/fengming-runtime-session-BE-DquuY.js +2 -0
- package/dist/fengming-tools-DHb-ZeDC.js +12221 -0
- package/dist/flows-Cz3y10A9.js +189 -0
- package/dist/fs-utils-D05rps7O.js +9 -0
- package/dist/gateway-DTi2D7ZS.js +133 -0
- package/dist/gateway-cli-DT2fL2fX.js +443 -0
- package/dist/gateway-install-token-CJhAycOA.js +136 -0
- package/dist/gateway-method-runtime-BuiYTDQk.js +21 -0
- package/dist/gateway-runtime-C5_cVlSW.js +23 -0
- package/dist/get-reply-Cz-dUrWm.js +5198 -0
- package/dist/get-reply-from-config.runtime-BC1HT67i.js +2 -0
- package/dist/get-reply-from-config.runtime.js +1 -1
- package/dist/github-copilot-token-09lxV3kH.js +2 -0
- package/dist/health-CmihbcqN.js +621 -0
- package/dist/health-D8L37hBZ.js +111 -0
- package/dist/health-DU7I9RrJ.js +3 -0
- package/dist/health-state-QZ2E6xGQ.js +106 -0
- package/dist/heartbeat-runner-Bz5PMzEI.js +1930 -0
- package/dist/heartbeat-runner-DfqqQ_8w.js +5 -0
- package/dist/heartbeat-runner.runtime-8BshUhoS.js +3 -0
- package/dist/heartbeat-runner.runtime.js +1 -1
- package/dist/helpers-Bkq4POdX.js +406 -0
- package/dist/hook-helpers-nmDwt3Fa.js +44 -0
- package/dist/hooks-9FOcRqfu.js +536 -0
- package/dist/hooks-cli-CrQelcwo.js +465 -0
- package/dist/http-endpoint-helpers-BD5u6YsT.js +37 -0
- package/dist/http-utils-RcKuBJ0I.js +98 -0
- package/dist/image-DwNoypK2.js +385 -0
- package/dist/image-fallbacks-BUyDnmUX.js +31 -0
- package/dist/image-generation-core.auth.runtime-CA8miEMh.js +2 -0
- package/dist/image-generation-core.auth.runtime.js +1 -1
- package/dist/image-generation-provider-DXMW5EmB.js +152 -0
- package/dist/image-runtime-D5QpNNzz.js +9 -0
- package/dist/image-tool.helpers-6vGxo1Y0.js +150 -0
- package/dist/images-BGWLzQEJ.js +416 -0
- package/dist/images-Db4UB3JG.js +2 -0
- package/dist/inbound-reply-dispatch-DRF6ZmQg.js +2 -0
- package/dist/inbound-reply-dispatch-RAKLqow4.js +147 -0
- package/dist/index.js +1 -1
- package/dist/infra-runtime-BFrpRc_V.js +32 -0
- package/dist/init-sR7bCS9D.js +59 -0
- package/dist/install-BzdJbOUx.js +262 -0
- package/dist/install.runtime-Zye6pbZ6.js +2 -0
- package/dist/internal-DL_vFx8C.js +399 -0
- package/dist/isolated-agent-Qif8Llbt.js +2 -0
- package/dist/isolated-agent-aqEjxqs-.js +1097 -0
- package/dist/kernel-B-i4c2IK.js +979 -0
- package/dist/kernel-DYDJ_hLb.js +3 -0
- package/dist/kimi-web-search-provider.runtime-95HAkvHY.js +307 -0
- package/dist/kimi-web-search-provider.runtime.js +1 -1
- package/dist/library-CZVbE5hF.js +45 -0
- package/dist/lifecycle-C8M3YLbT.js +2 -0
- package/dist/lifecycle-CPDNQnUN.js +570 -0
- package/dist/lifecycle-DpuP7n3J.js +355 -0
- package/dist/lifecycle.runtime-C8M3YLbT.js +2 -0
- package/dist/lifecycle.runtime.js +1 -1
- package/dist/link-understanding/apply.runtime.js +3 -3
- package/dist/list-B_ALwpPl.js +2 -0
- package/dist/list-Bda_GYFy.js +207 -0
- package/dist/list.list-command-W9OGfAIU.js +429 -0
- package/dist/list.model-row-LV4AaX0H.js +39 -0
- package/dist/list.probe-CrZm6BH2.js +451 -0
- package/dist/list.probe-Dfdmb8bC.js +2 -0
- package/dist/list.provider-catalog-7T1jKk0n.js +211 -0
- package/dist/list.provider-catalog-DjGyZVEj.js +2 -0
- package/dist/list.registry-load-DkCS8JZQ.js +152 -0
- package/dist/list.row-sources-B1vjo_Y9.js +474 -0
- package/dist/list.source-plan-C9Sa6zRK.js +81 -0
- package/dist/list.status-command-9daSZZDm.js +815 -0
- package/dist/live-model-switch-Dy-UFUMS.js +119 -0
- package/dist/llm-slug-generator-DEmh5-_1.js +78 -0
- package/dist/llm-slug-generator.js +1 -1
- package/dist/load-config-CvQpC8k6.js +27 -0
- package/dist/load-context-_qSHpZ5S.js +82 -0
- package/dist/loader-CntMt07B.js +7008 -0
- package/dist/local-dispatch.runtime-BSN_gqNS.js +10 -0
- package/dist/local-dispatch.runtime.js +1 -1
- package/dist/main-session-restart-recovery-Db7366lt.js +2 -0
- package/dist/main-session-restart-recovery-n87NTooQ.js +389 -0
- package/dist/managed-image-attachments-BTBBHlKl.js +2 -0
- package/dist/managed-image-attachments-C6_V1yX0.js +616 -0
- package/dist/manager-CKrWxjV6.js +3737 -0
- package/dist/manager-Dvb1FVnx.js +2314 -0
- package/dist/mcp/plugin-tools-serve.js +2 -2
- package/dist/mcp-http-CSoGXOa_.js +583 -0
- package/dist/mcp-http-D4ieDB3W.js +2 -0
- package/dist/media-runtime-GeQTQkkK.js +391 -0
- package/dist/media-services-CWbIUZDe.js +416 -0
- package/dist/media-understanding/apply.runtime.js +1 -1
- package/dist/media-understanding-DXc2BD2L.js +87 -0
- package/dist/media-understanding-provider-BkdUiVWU.js +70 -0
- package/dist/media-understanding-provider-BlgmLViW.js +13 -0
- package/dist/media-understanding-provider-C9P2VjkC.js +29 -0
- package/dist/media-understanding-provider-CJlbgAvl.js +69 -0
- package/dist/memory-CnC2jM1l.js +437 -0
- package/dist/memory-core-host-engine-embeddings-Dy9vN-Ce.js +667 -0
- package/dist/memory-core-host-engine-foundation-C-pGGQnm.js +15 -0
- package/dist/memory-core-host-engine-qmd-DLJDON9w.js +2 -0
- package/dist/memory-core-host-engine-storage-Bzf-C8XE.js +2 -0
- package/dist/memory-core-host-runtime-cli-_LWA6G3x.js +10 -0
- package/dist/memory-core-host-runtime-core-CromkNBr.js +12 -0
- package/dist/memory-core-host-runtime-files-DpbviC1b.js +4 -0
- package/dist/memory-embedding-provider-runtime-CaVVaYC5.js +36 -0
- package/dist/memory-host-core-B5dWHwBF.js +78 -0
- package/dist/memory-host-search.runtime-DqlCFac1.js +2 -0
- package/dist/memory-host-search.runtime.js +1 -1
- package/dist/memory-runtime-BCeeWb1G.js +2 -0
- package/dist/memory-runtime-pR9KGin0.js +57 -0
- package/dist/memory-search-CpDEEY2Q.js +235 -0
- package/dist/message-BeGCG-D8.js +284 -0
- package/dist/message-YGMOyqP5.js +2 -0
- package/dist/message-action-runner-ByMT3_eb.js +1922 -0
- package/dist/message-action-runner-VXmKO_W7.js +2 -0
- package/dist/message-handler-MZ0DMbCx.js +1806 -0
- package/dist/metadata-registry-loader-BH9D1UOx.js +2 -0
- package/dist/metadata-registry-loader-BK1cHCas.js +22 -0
- package/dist/migrate-BA6w0hd3.js +2 -0
- package/dist/migrate-BGuQC-1W.js +458 -0
- package/dist/migration-provider-runtime-BBdDegWG.js +2 -0
- package/dist/migration-provider-runtime-C5WUjrQz.js +68 -0
- package/dist/minimax-web-search-provider.runtime-suVFk3Zx.js +148 -0
- package/dist/minimax-web-search-provider.runtime.js +1 -1
- package/dist/model-BJZXR9dq.js +1302 -0
- package/dist/model-BL7xlN5h.js +2 -0
- package/dist/model-auth-C-6dYVob.js +6 -0
- package/dist/model-auth-DJz7R41W.js +705 -0
- package/dist/model-auth-label-DKNXktIu.js +67 -0
- package/dist/model-catalog-BjiK5rtT.js +3 -0
- package/dist/model-catalog-DM1CTjkW.js +434 -0
- package/dist/model-catalog-visibility-DEJZG0In.js +76 -0
- package/dist/model-config.helpers-BKcUeE_P.js +95 -0
- package/dist/model-context-tokens-5y_PQELY.js +572 -0
- package/dist/model-fallback-BDdBR053.js +1288 -0
- package/dist/model-fallback-auth.runtime-pcWfkIUF.js +5 -0
- package/dist/model-fallback-auth.runtime.js +1 -1
- package/dist/model-picker-Bpvp4_N4.js +1135 -0
- package/dist/model-picker-DWPPtq6d.js +3 -0
- package/dist/model-picker-visibility-BtdqVF80.js +22 -0
- package/dist/model-picker.runtime-CYlqts2z.js +48 -0
- package/dist/model-picker.runtime.js +1 -1
- package/dist/model-pricing-cache-BmmncDqL.js +856 -0
- package/dist/model-pricing-cache-CEwRyWw2.js +3 -0
- package/dist/model-pricing-cache-state-B8Aspp85.js +83 -0
- package/dist/model-provider-auth-B3KXoKkE.js +2 -0
- package/dist/model-provider-auth-Bo_8T7of.js +375 -0
- package/dist/model-runtime-aliases-Br-ZlhrL.js +133 -0
- package/dist/model-selection-D5-ERakL.js +254 -0
- package/dist/model-selection-DrzgktRu.js +7 -0
- package/dist/model-selection-ibwsPgIw.js +352 -0
- package/dist/model-selection.runtime-BRkOZejt.js +7 -0
- package/dist/model-selection.runtime.js +1 -1
- package/dist/models-RPAH3ZBn.js +57 -0
- package/dist/models-auth-status-Cwu9OXU8.js +280 -0
- package/dist/models-cli-CrYkSUoa.js +257 -0
- package/dist/models-config-Ayzj9gDz.js +1189 -0
- package/dist/models-config-BFcjB7nN.js +2 -0
- package/dist/models-config.providers.secrets-CCRUW7gL.js +2 -0
- package/dist/models-config.providers.secrets-DdX_XSRo.js +382 -0
- package/dist/models-http-jLFnelH7.js +88 -0
- package/dist/monitor-CqWICrjO.js +60 -0
- package/dist/monitor-DwccYPfp.js +1024 -0
- package/dist/monitor.account-e9EVttpP.js +5382 -0
- package/dist/music-generation-provider-Dfc--R-x.js +308 -0
- package/dist/native-hook-relay-Cioqiqv8.js +1378 -0
- package/dist/native-hook-relay-DRwJIspI.js +19 -0
- package/dist/node-cli-CrG3LH9J.js +2806 -0
- package/dist/node-command-policy-CkBTEmhl.js +295 -0
- package/dist/nodes-BxrWFA09.js +1483 -0
- package/dist/nodes-DFPTGZjc.js +3 -0
- package/dist/nodes-cli-Czwyt6r1.js +960 -0
- package/dist/nodes-pending-B_4QHyB2.js +211 -0
- package/dist/nodes-utils-c4k31OaG.js +85 -0
- package/dist/oauth-BXncC0JP.js +852 -0
- package/dist/oauth-Ba1O2vqP.js +207 -0
- package/dist/oauth-CGQkfxbJ.js +746 -0
- package/dist/onboard-I5tQlVm6.js +768 -0
- package/dist/onboard-channels-BleKfB1D.js +2 -0
- package/dist/onboard-channels-jVaUjGYX.js +1534 -0
- package/dist/onboard-custom-BR_5oqUr.js +3 -0
- package/dist/onboard-custom-Ss0DThuP.js +280 -0
- package/dist/onboard-custom-config-B-knjQm7.js +422 -0
- package/dist/onboard-search-BsIztGYF.js +412 -0
- package/dist/openai-compat-errors-UkLkk8Q9.js +136 -0
- package/dist/openai-http-mTQB44gu.js +836 -0
- package/dist/openai-transport-stream-CZSs3SIi.js +3427 -0
- package/dist/openresponses-http-BA1Shmj-.js +1175 -0
- package/dist/operations-DhgPih1F.js +805 -0
- package/dist/order-CaXafMPG.js +218 -0
- package/dist/outbound-attachment-BAp7DXDc.js +19 -0
- package/dist/param-readers-De-m2SoB.js +2 -0
- package/dist/payloads-Dg9aAEOC.js +256 -0
- package/dist/persistent-bindings.lifecycle-BkLOz501.js +2 -0
- package/dist/persistent-bindings.lifecycle-e2MLbBCo.js +85 -0
- package/dist/plugin-enabled-CGSENjXc.js +232 -0
- package/dist/plugin-install-BI9_bsVT.js +118 -0
- package/dist/plugin-install-an4V2iXO.js +2 -0
- package/dist/plugin-install-config-policy-C66Nss3D.js +169 -0
- package/dist/plugin-registration-DMerQktl.js +97 -0
- package/dist/plugin-registry-BZfdCw65.js +3 -0
- package/dist/plugin-registry-I1fegSdK.js +2 -0
- package/dist/plugin-runtime-B3XMLJka.js +102 -0
- package/dist/plugin-sdk/.boundary-entry-shims.stamp +1 -1
- package/dist/plugin-sdk/acp-binding-runtime.js +1 -1
- package/dist/plugin-sdk/acp-runtime-backend.js +1 -1
- package/dist/plugin-sdk/acp-runtime.js +2 -2
- package/dist/plugin-sdk/agent-config-primitives.d.ts +1 -1
- package/dist/plugin-sdk/agent-harness-runtime.js +16 -16
- package/dist/plugin-sdk/agent-harness-task-runtime.js +4 -4
- package/dist/plugin-sdk/agent-harness.js +17 -17
- package/dist/plugin-sdk/agent-runtime.js +17 -17
- package/dist/plugin-sdk/agent-sessions.js +1 -1
- package/dist/plugin-sdk/approval-native-runtime.js +2 -2
- package/dist/plugin-sdk/approval-reaction-runtime.js +1 -1
- package/dist/plugin-sdk/approval-runtime.js +2 -2
- package/dist/plugin-sdk/bundled-channel-config-schema-BsOWCrJT.d.ts +3169 -0
- package/dist/plugin-sdk/bundled-channel-config-schema.d.ts +3 -3
- package/dist/plugin-sdk/channel-actions.js +2 -2
- package/dist/plugin-sdk/channel-config-primitives.d.ts +2 -2
- package/dist/plugin-sdk/channel-config-schema-legacy.d.ts +3 -3
- package/dist/plugin-sdk/channel-config-schema.d.ts +2 -2
- package/dist/plugin-sdk/channel-core.d.ts +1 -1
- package/dist/plugin-sdk/channel-core.js +2 -2
- package/dist/plugin-sdk/channel-envelope.js +1 -1
- package/dist/plugin-sdk/channel-inbound-roots.js +1 -1
- package/dist/plugin-sdk/channel-inbound.js +4 -4
- package/dist/plugin-sdk/channel-location.js +1 -1
- package/dist/plugin-sdk/channel-message-runtime.js +5 -5
- package/dist/plugin-sdk/channel-message.js +5 -5
- package/dist/plugin-sdk/channel-outbound.js +2 -2
- package/dist/plugin-sdk/channel-plugin-common.d.ts +1 -1
- package/dist/plugin-sdk/channel-reply-options-runtime.js +1 -1
- package/dist/plugin-sdk/command-auth-native.js +2 -2
- package/dist/plugin-sdk/command-auth.js +4 -4
- package/dist/plugin-sdk/command-primitives-runtime.js +2 -2
- package/dist/plugin-sdk/command-status-runtime.js +1 -1
- package/dist/plugin-sdk/command-status.js +1 -1
- package/dist/plugin-sdk/compat.d.ts +2 -2
- package/dist/plugin-sdk/compat.js +2 -2
- package/dist/plugin-sdk/config-mutation.js +2 -2
- package/dist/plugin-sdk/config-runtime.js +1 -1
- package/dist/plugin-sdk/config-schema-DUddICQM.d.ts +33 -0
- package/dist/plugin-sdk/conversation-binding-runtime.js +1 -1
- package/dist/plugin-sdk/conversation-runtime.js +3 -3
- package/dist/plugin-sdk/core.d.ts +1 -1
- package/dist/plugin-sdk/core.js +3 -3
- package/dist/plugin-sdk/delivery-queue-runtime.js +1 -1
- package/dist/plugin-sdk/direct-dm.js +1 -1
- package/dist/plugin-sdk/discord.d.ts +2 -2
- package/dist/plugin-sdk/embedding-providers.js +2 -2
- package/dist/plugin-sdk/gateway-method-runtime.js +1 -1
- package/dist/plugin-sdk/gateway-runtime.js +2 -2
- package/dist/plugin-sdk/health.js +1 -1
- package/dist/plugin-sdk/image-generation-core.js +3 -3
- package/dist/plugin-sdk/image-generation-runtime.js +1 -1
- package/dist/plugin-sdk/image-generation.js +2 -2
- package/dist/plugin-sdk/inbound-reply-dispatch.js +3 -3
- package/dist/plugin-sdk/index.js +1 -1
- package/dist/plugin-sdk/infra-runtime.js +3 -3
- package/dist/plugin-sdk/mattermost.js +1 -1
- package/dist/plugin-sdk/media-generation-runtime-shared.js +1 -1
- package/dist/plugin-sdk/media-generation-runtime.js +1 -1
- package/dist/plugin-sdk/media-runtime.js +7 -7
- package/dist/plugin-sdk/media-understanding-runtime.js +1 -1
- package/dist/plugin-sdk/media-understanding.js +2 -2
- package/dist/plugin-sdk/memory-core-host-engine-embeddings.js +4 -4
- package/dist/plugin-sdk/memory-core-host-engine-foundation.js +2 -2
- package/dist/plugin-sdk/memory-core-host-engine-qmd.js +2 -2
- package/dist/plugin-sdk/memory-core-host-engine-storage.js +6 -6
- package/dist/plugin-sdk/memory-core-host-runtime-cli.js +2 -2
- package/dist/plugin-sdk/memory-core-host-runtime-core.js +3 -3
- package/dist/plugin-sdk/memory-core-host-runtime-files.js +4 -4
- package/dist/plugin-sdk/memory-core.js +3 -3
- package/dist/plugin-sdk/memory-host-core.js +3 -3
- package/dist/plugin-sdk/memory-host-files.js +4 -4
- package/dist/plugin-sdk/memory-host-search.js +1 -1
- package/dist/plugin-sdk/models-provider-runtime.js +1 -1
- package/dist/plugin-sdk/music-generation-core.js +1 -1
- package/dist/plugin-sdk/native-command-registry.js +1 -1
- package/dist/plugin-sdk/outbound-media.js +2 -2
- package/dist/plugin-sdk/outbound-runtime.js +3 -3
- package/dist/plugin-sdk/param-readers.js +2 -2
- package/dist/plugin-sdk/plugin-runtime.js +2 -2
- package/dist/plugin-sdk/provider-auth-api-key.js +4 -4
- package/dist/plugin-sdk/provider-auth-login.js +1 -1
- package/dist/plugin-sdk/provider-auth-runtime.js +2 -2
- package/dist/plugin-sdk/provider-auth.js +6 -6
- package/dist/plugin-sdk/provider-catalog-runtime.js +2 -2
- package/dist/plugin-sdk/provider-entry.js +1 -1
- package/dist/plugin-sdk/provider-setup.js +1 -1
- package/dist/plugin-sdk/provider-stream-family.js +3 -3
- package/dist/plugin-sdk/provider-stream.js +2 -2
- package/dist/plugin-sdk/provider-transport-runtime.js +1 -1
- package/dist/plugin-sdk/provider-web-fetch.js +2 -2
- package/dist/plugin-sdk/provider-web-search.js +4 -4
- package/dist/plugin-sdk/realtime-bootstrap-context.js +2 -2
- package/dist/plugin-sdk/realtime-transcription.js +1 -1
- package/dist/plugin-sdk/realtime-voice.js +2 -2
- package/dist/plugin-sdk/reply-dispatch-runtime.js +1 -1
- package/dist/plugin-sdk/reply-runtime.js +6 -6
- package/dist/plugin-sdk/runtime-secret-resolution.js +2 -2
- package/dist/plugin-sdk/runtime.js +3 -3
- package/dist/plugin-sdk/self-hosted-provider-setup.js +1 -1
- package/dist/plugin-sdk/simple-completion-runtime.js +1 -1
- package/dist/plugin-sdk/speech-core.js +2 -2
- package/dist/plugin-sdk/speech.js +1 -1
- package/dist/plugin-sdk/tool-plugin.js +1 -1
- package/dist/plugin-sdk/transcripts.js +1 -1
- package/dist/plugin-sdk/tts-runtime.d.ts +1 -1
- package/dist/plugin-sdk/tts-runtime.js +1 -1
- package/dist/plugin-sdk/video-generation-core.js +2 -2
- package/dist/plugin-sdk/video-generation-runtime.js +1 -1
- package/dist/plugin-sdk/web-media.js +3 -3
- package/dist/plugin-sdk/zalouser.js +1 -1
- package/dist/plugin-sdk/zod-schema.core-B4_b2R5K.d.ts +166 -0
- package/dist/plugin-service-2XF6Lu_a.js +1249 -0
- package/dist/plugins/build-smoke-entry.js +2 -2
- package/dist/plugins/loader.js +1 -1
- package/dist/plugins/provider-discovery.runtime.js +1 -1
- package/dist/plugins/provider-runtime.runtime.js +1 -1
- package/dist/plugins/runtime/index.js +21 -21
- package/dist/plugins/tools.js +1 -1
- package/dist/plugins-authoring-command-CCX6tJwd.js +304 -0
- package/dist/plugins-cli-HX8nTV2h.js +63 -0
- package/dist/plugins-cli.runtime-BYn4VsLP.js +339 -0
- package/dist/plugins-cli.runtime.js +1 -1
- package/dist/plugins-command-helpers-ByuW-yNj.js +2 -0
- package/dist/plugins-command-helpers-DaaxGnCD.js +164 -0
- package/dist/plugins-inspect-command-C9NDk23X.js +248 -0
- package/dist/plugins-install-command-B0NfUxeA.js +993 -0
- package/dist/plugins-install-command-BmuScfLI.js +2 -0
- package/dist/plugins-install-persist-CfwO876P.js +252 -0
- package/dist/plugins-list-command-Bx8X908n.js +184 -0
- package/dist/plugins-uninstall-command-p6h44-Ft.js +118 -0
- package/dist/postinstall-inventory.json +862 -862
- package/dist/prepare.runtime-8DdQ4k9k.js +798 -0
- package/dist/prepare.runtime.js +1 -1
- package/dist/presentation-card-DeAf3jYW.js +164 -0
- package/dist/preview-warnings-BF7nlTo8.js +618 -0
- package/dist/profiles-DUhMLnqX.js +194 -0
- package/dist/program-C7f_U7fr.js +131 -0
- package/dist/provider-adapters-CWLwE9KS.js +104 -0
- package/dist/provider-api-key-auth-CshQbUPZ.js +117 -0
- package/dist/provider-api-key-auth.runtime-B64jPCKn.js +14 -0
- package/dist/provider-api-key-auth.runtime.js +1 -1
- package/dist/provider-auth-D-I3YLSn.js +281 -0
- package/dist/provider-auth-api-key-Bub0Rjak.js +5 -0
- package/dist/provider-auth-choice-DpNAEScm.js +311 -0
- package/dist/provider-auth-choice-helpers-Bof937LW.js +210 -0
- package/dist/provider-auth-choice.runtime-B3spikLY.js +18 -0
- package/dist/provider-auth-choice.runtime-vVgz7FKq.js +2 -0
- package/dist/provider-auth-choice.runtime.js +1 -1
- package/dist/provider-auth-guidance-DcCL0Q2U.js +2 -0
- package/dist/provider-auth-guidance-rWRMN4Jn.js +34 -0
- package/dist/provider-auth-helpers-Cp8L-Xha.js +177 -0
- package/dist/provider-auth-login.runtime-BJUzc4iH.js +156 -0
- package/dist/provider-auth-login.runtime.js +1 -1
- package/dist/provider-auth-runtime-DmcWtzbb.js +186 -0
- package/dist/provider-discovery-JyAJi97k.js +95 -0
- package/dist/provider-discovery.runtime-D_0WTYr8.js +290 -0
- package/dist/provider-discovery.runtime.js +1 -1
- package/dist/provider-dispatcher-C8Jt94Xl.js +22 -0
- package/dist/provider-dispatcher.runtime.js +1 -1
- package/dist/provider-entry-By0ggZuI.js +134 -0
- package/dist/provider-hook-runtime-B8AUbQxf.js +255 -0
- package/dist/provider-openai-codex-oauth-C9Mmnt7d.js +2 -0
- package/dist/provider-openai-codex-oauth-CH5Jg1vk.js +44 -0
- package/dist/provider-registration-C1zvaHQP.js +235 -0
- package/dist/provider-registry-B9diJyLv.js +31 -0
- package/dist/provider-registry-BXSxmPGA.js +61 -0
- package/dist/provider-registry-CoE-sxbq.js +61 -0
- package/dist/provider-registry-DLth_GdI.js +61 -0
- package/dist/provider-registry-J4LRd5Rg.js +36 -0
- package/dist/provider-runtime-B4cw16pt.js +3 -0
- package/dist/provider-runtime-DNNbfwOK.js +386 -0
- package/dist/provider-runtime.runtime-98mAe_ni.js +26 -0
- package/dist/provider-runtime.runtime.js +1 -1
- package/dist/provider-self-hosted-setup-Dysv2Kwt.js +373 -0
- package/dist/provider-stream-BLaC8bqO.js +1084 -0
- package/dist/provider-stream-Caa5YOx2.js +313 -0
- package/dist/provider-stream-family-CvvfxLyP.js +2 -0
- package/dist/provider-usage-CVNosTP3.js +71 -0
- package/dist/provider-usage-D2NudXbO.js +4 -0
- package/dist/provider-usage.load-DG6R3lkG.js +357 -0
- package/dist/provider-web-search-DmgTaxRU.js +58 -0
- package/dist/provider-wizard-Cw-5H3tX.js +125 -0
- package/dist/providers.runtime-DF0T9lFz.js +240 -0
- package/dist/providers.runtime-oM9Vn1wr.js +2 -0
- package/dist/providers.runtime.js +1 -1
- package/dist/proxy-BxGnVyJu.js +662 -0
- package/dist/public-artifacts-BMP9hZfh.js +7 -0
- package/dist/pw-ai-CD52qfYo.js +3064 -0
- package/dist/qmd-manager-BYbvU4YC.js +2040 -0
- package/dist/qr-cli-Btz2ZdO3.js +2 -0
- package/dist/qr-cli-eyTRwMm2.js +371 -0
- package/dist/qr-image-BCwiO6tL.js +2 -0
- package/dist/queue-CJRoTOBi.js +923 -0
- package/dist/read-file-ogB-HjbK.js +183 -0
- package/dist/register-service-commands-D_gQ3b6_.js +77 -0
- package/dist/register.agent-DXQLn-r0.js +152 -0
- package/dist/register.configure-FavQPGce.js +16 -0
- package/dist/register.crestodian-Cbfmnl6h.js +24 -0
- package/dist/register.maintenance-B8xODEMU.js +85 -0
- package/dist/register.message-B8PYgZ-j.js +404 -0
- package/dist/register.migrate-CieoN8zZ.js +106 -0
- package/dist/register.onboard-BqWDIDKH.js +115 -0
- package/dist/register.setup-CgeTBW4T.js +40 -0
- package/dist/register.status-health-sessions-C99aHa5h.js +293 -0
- package/dist/register.subclis-79SvyMFt.js +31 -0
- package/dist/register.subclis-CXrO8_TO.js +3 -0
- package/dist/register.subclis-core-GoXV1yMG.js +273 -0
- package/dist/rem-harness-laL5luQa.js +649 -0
- package/dist/repair-sequencing-DGY2mBg6.js +652 -0
- package/dist/reply-media-paths.runtime-BeWVPkgy.js +2 -0
- package/dist/reply-media-paths.runtime-rzAV_Kee.js +154 -0
- package/dist/reply-media-paths.runtime.js +1 -1
- package/dist/reply-payloads-D_JHMviC.js +79 -0
- package/dist/reply-payloads-dedupe-B9GGGaL-.js +176 -0
- package/dist/reply-payloads-dedupe.runtime--C3jHs9y.js +2 -0
- package/dist/reply-payloads-dedupe.runtime.js +1 -1
- package/dist/reply-timing-tracker-DPjlETUb.js +205 -0
- package/dist/reply-turn-admission-DdfIwcMK.js +2056 -0
- package/dist/reply.runtime-BC1HT67i.js +2 -0
- package/dist/reply.runtime.js +1 -1
- package/dist/reset-preserved-selection-Czd80hug.js +45 -0
- package/dist/resolve-COJFlAZT.js +106 -0
- package/dist/restart-B9GMMIZt.js +121 -0
- package/dist/result-fallback-classifier-By0Z6b8r.js +98 -0
- package/dist/root-help-Bp0kGaUZ.js +43 -0
- package/dist/route-CgG9Z7OI.js +475 -0
- package/dist/route-reply-D9_9oRg1.js +174 -0
- package/dist/route-reply.runtime-BwNl3h2m.js +2 -0
- package/dist/route-reply.runtime.js +1 -1
- package/dist/routes-Cz2NHUV4.js +2 -0
- package/dist/routes-DMo6Eacc.js +3701 -0
- package/dist/run-SFRSThMI.js +1162 -0
- package/dist/run-auth-profile.runtime-BxLM8m_2.js +2 -0
- package/dist/run-auth-profile.runtime.js +1 -1
- package/dist/run-command-Cd5iN7eN.js +2 -0
- package/dist/run-command-ah46O06U.js +23 -0
- package/dist/run-context-DGCQJldA.js +66 -0
- package/dist/run-context.runtime-CSBHDAd5.js +2 -0
- package/dist/run-context.runtime.js +1 -1
- package/dist/run-delivery.runtime-C9xoiZ3h.js +762 -0
- package/dist/run-delivery.runtime.js +1 -1
- package/dist/run-embedded.runtime-D8bz5vfV.js +4 -0
- package/dist/run-embedded.runtime.js +1 -1
- package/dist/run-execution-cli.runtime-BAa8KPn7.js +4 -0
- package/dist/run-execution-cli.runtime.js +1 -1
- package/dist/run-executor.runtime-CNnemqSa.js +330 -0
- package/dist/run-executor.runtime.js +1 -1
- package/dist/run-model-catalog.runtime-Dh7EghXr.js +2 -0
- package/dist/run-model-catalog.runtime.js +1 -1
- package/dist/run-session-state-cMlTFwT_.js +159 -0
- package/dist/run-subagent-registry.runtime-BgQU86-E.js +2 -0
- package/dist/run-subagent-registry.runtime.js +1 -1
- package/dist/runner-B3YXRJOB.js +704 -0
- package/dist/runner.entries-DMTKpRDP.js +1485 -0
- package/dist/runtime-BHReFHE2.js +2 -0
- package/dist/runtime-BiQZ6Usw.js +615 -0
- package/dist/runtime-CAeriu2O.js +10 -0
- package/dist/runtime-CAnCRCX3.js +224 -0
- package/dist/runtime-CV_2NqSY.js +300 -0
- package/dist/runtime-CmpnvXo3.js +245 -0
- package/dist/runtime-D2fci1Ey.js +2 -0
- package/dist/runtime-DAsYmYeA.js +3 -0
- package/dist/runtime-DeA45VKG.js +210 -0
- package/dist/runtime-DvkZ8tHI.js +436 -0
- package/dist/runtime-DxVUR2Xg.js +2 -0
- package/dist/runtime-api-B88le0UE.js +12 -0
- package/dist/runtime-channel-AubRWvnH.js +2 -0
- package/dist/runtime-channel-DdclSuEu.js +148 -0
- package/dist/runtime-config-collectors-DukTj2va.js +525 -0
- package/dist/runtime-embedded-agent.runtime-BpLweeFv.js +2 -0
- package/dist/runtime-embedded-agent.runtime.js +1 -1
- package/dist/runtime-internal-CaoUylZw.js +2 -0
- package/dist/runtime-llm.runtime-DlpqGc7S.js +307 -0
- package/dist/runtime-llm.runtime.js +1 -1
- package/dist/runtime-model-auth.runtime-CLAaWzxY.js +46 -0
- package/dist/runtime-model-auth.runtime-DxVvqRTd.js +2 -0
- package/dist/runtime-model-auth.runtime.js +1 -1
- package/dist/runtime-options-TTtN01-I.js +275 -0
- package/dist/runtime-plugin-ClqxJSbp.js +92 -0
- package/dist/runtime-plugins-Bq01wLXP.js +32 -0
- package/dist/runtime-plugins.runtime-cwCvl1TR.js +2 -0
- package/dist/runtime-plugins.runtime.js +1 -1
- package/dist/runtime-prepare.runtime-Cz_hV_k5.js +81 -0
- package/dist/runtime-prepare.runtime.js +1 -1
- package/dist/runtime-provider-QCJq90av.js +24 -0
- package/dist/runtime-provider-Wllc3jC6.js +2 -0
- package/dist/runtime-registry-loader-BM1mQBJr.js +2 -0
- package/dist/runtime-registry-loader-DzhYCt4s.js +117 -0
- package/dist/runtime-shared-BfqOW-Vb.js +365 -0
- package/dist/runtime-web-channel-plugin-BcVPgD14.js +204 -0
- package/dist/runtime-web-tools-fallback.runtime.js +1 -1
- package/dist/scan-ldbaD8jq.js +573 -0
- package/dist/sdk-security-runtime-Bxhq2O1G.js +86 -0
- package/dist/sdk-setup-tools-CsQM9pF0.js +8 -0
- package/dist/secrets-cli-DbpIf4-z.js +150 -0
- package/dist/security-cli-BK4Xpa6h.js +520 -0
- package/dist/selection-BXKik6Ps.js +3 -0
- package/dist/selection-D4O3gK3Q.js +18365 -0
- package/dist/send-DaoGIay5.js +1222 -0
- package/dist/send-DzNjJGJX.js +178 -0
- package/dist/send-f5w9krNS.js +711 -0
- package/dist/send-media-cOciBxcg.js +2072 -0
- package/dist/send-result-DMFwBuOl.js +141 -0
- package/dist/server-BoC1mxZ-.js +24 -0
- package/dist/server-DZnI6w5k.js +72 -0
- package/dist/server-aux-handlers-BwRdYdub.js +1347 -0
- package/dist/server-chat-Q95f4ywD.js +827 -0
- package/dist/server-close.runtime.js +3 -3
- package/dist/server-context-CnXNaarB.js +2 -0
- package/dist/server-context-DRBebo7Y.js +955 -0
- package/dist/server-cron-C0o0ZvqF.js +3173 -0
- package/dist/server-cron-CLeBvurR.js +2 -0
- package/dist/server-maintenance-CqHfTnFD.js +152 -0
- package/dist/server-methods-BmlBQJMD.js +497 -0
- package/dist/server-middleware-DJhnR6jl.js +122 -0
- package/dist/server-model-catalog-CoSSk_Gy.js +2 -0
- package/dist/server-model-catalog-D32oDTQp.js +73 -0
- package/dist/server-node-events-DX9a4etQ.js +597 -0
- package/dist/server-plugin-bootstrap-Vco-EpxY.js +71 -0
- package/dist/server-plugins-WBX2fZRp.js +435 -0
- package/dist/server-reload-handlers-DGJLH8bg.js +719 -0
- package/dist/server-restart-sentinel-Bvon7f8K.js +700 -0
- package/dist/server-runtime-services-BNcH4vhR.js +3 -0
- package/dist/server-runtime-services-BjcQG5y7.js +147 -0
- package/dist/server-runtime-subscriptions-W39HeyoT.js +67 -0
- package/dist/server-session-events-CO73dMU-.js +244 -0
- package/dist/server-session-key-D8V67lDk.js +2 -0
- package/dist/server-session-key-v-KYSmRS.js +75 -0
- package/dist/server-startup-config-u54lUdWN.js +305 -0
- package/dist/server-startup-early-Cy5kArJG.js +87 -0
- package/dist/server-startup-memory-DvINFAYn.js +72 -0
- package/dist/server-startup-plugins-CerpbOSQ.js +127 -0
- package/dist/server-startup-post-attach-COUCwhNa.js +793 -0
- package/dist/server-ws-runtime-BfznAnbI.js +374 -0
- package/dist/server.impl-dQXccj0z.js +2622 -0
- package/dist/session-cost-usage-Bs5yIOBH.js +1600 -0
- package/dist/session-kill-http-DVleb3RW.js +121 -0
- package/dist/session-log-runtime-OG7J4j9m.js +1258 -0
- package/dist/session-override-LIWl5a9T.js +134 -0
- package/dist/session-reset-model.runtime-BpnTi4sa.js +144 -0
- package/dist/session-reset-model.runtime.js +1 -1
- package/dist/session-reset-service-HA07zS8L.js +651 -0
- package/dist/session-status.runtime-D6_clH8l.js +2 -0
- package/dist/session-status.runtime.js +1 -1
- package/dist/session-store-Cj4Rh6qc.js +273 -0
- package/dist/session-store.runtime-DSCxACdZ.js +4 -0
- package/dist/session-store.runtime.js +1 -1
- package/dist/session-subagent-reactivation.runtime-CcwaHAxg.js +2 -0
- package/dist/session-subagent-reactivation.runtime.js +1 -1
- package/dist/session-tab-registry-C-9uI2Wi.js +551 -0
- package/dist/session-utils-BRtPESA4.js +1508 -0
- package/dist/sessions-Beltl3Ra.js +1917 -0
- package/dist/sessions-DR-X-j8D.js +316 -0
- package/dist/sessions-cleanup-CR1CFcJb.js +165 -0
- package/dist/sessions-history-http-CjyHWYEv.js +432 -0
- package/dist/sessions-patch-peSeltuF.js +401 -0
- package/dist/sessions-resolve-D9ULr95s.js +180 -0
- package/dist/sessions-table-Da6bua9d.js +161 -0
- package/dist/sessions-uKpnhod0.js +12736 -0
- package/dist/sessions.runtime-C1mVNaU3.js +2 -0
- package/dist/sessions.runtime.js +1 -1
- package/dist/set-DVj21EuB.js +31 -0
- package/dist/set-image-JChDCaAP.js +17 -0
- package/dist/setup-5I-zpID3.js +614 -0
- package/dist/setup-CjtY6cli.js +2 -0
- package/dist/setup-onboard-configure-help-fast-path-C5GcSuXb.js +64 -0
- package/dist/setup.finalize-Bf10PNbl.js +586 -0
- package/dist/setup.gateway-config-EH5Rvwzy.js +281 -0
- package/dist/setup.migration-import-CoeV4Kc1.js +200 -0
- package/dist/setup.migration-import-DFFGw4DI.js +2 -0
- package/dist/setup.post-install-migration-DcQmWTE7.js +128 -0
- package/dist/shared-BFSJZ6B3.js +212 -0
- package/dist/shared-CVM-dYkO.js +5 -0
- package/dist/shared-fvgcmCsj.js +71 -0
- package/dist/simple-completion-runtime-C_TXe4M1.js +2 -0
- package/dist/simple-completion-runtime-DREq-fcF.js +206 -0
- package/dist/simple-completion-transport-DtD1fEvJ.js +83 -0
- package/dist/snapshot-urls-B-wkwDI9.js +317 -0
- package/dist/speech-core-KQg6oKcR.js +119 -0
- package/dist/speech-provider-DfyLYitQ.js +171 -0
- package/dist/speech-provider-oDvTumNW.js +227 -0
- package/dist/speech-provider-yL-TQ3Em.js +233 -0
- package/dist/stale-oauth-profile-shadows-CW11VYMM.js +2 -0
- package/dist/stale-oauth-profile-shadows-DFl6Lyf1.js +186 -0
- package/dist/standalone-runtime-registry-loader-BiponY-y.js +59 -0
- package/dist/startup-context-PVXYM-X3.js +314 -0
- package/dist/status-BA_0z83w.js +249 -0
- package/dist/status-Bc7BGlRt.js +2 -0
- package/dist/status-BwPWg9eQ.js +3 -0
- package/dist/status-CLQ66eml.js +4 -0
- package/dist/status-Ci2gChtY.js +466 -0
- package/dist/status-CmtBWJEE.js +2 -0
- package/dist/status-DdnMnPNs.js +73 -0
- package/dist/status-all-BpTvkYrt.js +573 -0
- package/dist/status-json-CizozZCr.js +15 -0
- package/dist/status-json-command-FzKa2t6O.js +84 -0
- package/dist/status-message-BHbnxwmt.js +495 -0
- package/dist/status-message.runtime-Df5WBBAk.js +6 -0
- package/dist/status-message.runtime.js +1 -1
- package/dist/status-queue.runtime-CXnZV4Bj.js +2 -0
- package/dist/status-queue.runtime.js +1 -1
- package/dist/status-runtime-shared-D3Hz8WZ_.js +289 -0
- package/dist/status-subagents.runtime-PoDdwwaw.js +32 -0
- package/dist/status-subagents.runtime.js +1 -1
- package/dist/status-text-DNxXSCuI.js +301 -0
- package/dist/status.command-C_e9GcMg.js +2 -0
- package/dist/status.command-DjVKDmt_.js +425 -0
- package/dist/status.command.text-runtime-BeHlqL8b.js +15 -0
- package/dist/status.runtime-h--fx9HY.js +2 -0
- package/dist/status.scan-WyR8TeJz.js +72 -0
- package/dist/status.scan-overview-CMzUAQMQ.js +460 -0
- package/dist/status.scan.deps.runtime-1JTrdyHk.js +19 -0
- package/dist/status.scan.deps.runtime.js +1 -1
- package/dist/status.scan.fast-json-D2jw1wKO.js +163 -0
- package/dist/status.scan.fast-json-DbN1KxJT.js +2 -0
- package/dist/status.summary-6ZijZM1g.js +2 -0
- package/dist/status.summary-CiCsChO-.js +276 -0
- package/dist/store-CdBPITcg.js +2302 -0
- package/dist/store-D0l2NCdn.js +3 -0
- package/dist/stored-model-override-HEgnFh6b.js +79 -0
- package/dist/subagent-announce-BUv_kA1W.js +353 -0
- package/dist/subagent-announce-delivery-Ci2Y_p--.js +1369 -0
- package/dist/subagent-control-BM3vNgsQ.js +492 -0
- package/dist/subagent-control.runtime-Df3pVQL9.js +3 -0
- package/dist/subagent-control.runtime.js +1 -1
- package/dist/subagent-hooks-CN2fLez2.js +2 -0
- package/dist/subagent-hooks-CeOmTJBf.js +230 -0
- package/dist/subagent-hooks-api-Cfe4DAT9.js +23 -0
- package/dist/subagent-registry-B9RPAXUs.js +2627 -0
- package/dist/subagent-registry-C7tedtVB.js +3 -0
- package/dist/subagent-registry.runtime.js +2 -2
- package/dist/subagent-session-cleanup-y0ijZ-LQ.js +390 -0
- package/dist/system-DVtrOGbV.js +111 -0
- package/dist/system-prompt-config-BVmrcmmr.js +918 -0
- package/dist/talk-CrdgqTCl.js +2454 -0
- package/dist/target-id-CrUyi-Uq.js +107 -0
- package/dist/targets-KZ2ezPwx.js +267 -0
- package/dist/targets.runtime-iZ8KdQ1C.js +2 -0
- package/dist/targets.runtime.js +1 -1
- package/dist/task-executor-893pMqzn.js +349 -0
- package/dist/task-owner-access-DC7MKz3n.js +74 -0
- package/dist/task-registry-control.runtime.js +2 -2
- package/dist/task-registry-delivery-runtime-YGMOyqP5.js +2 -0
- package/dist/task-registry-uaYJfgXF.js +2362 -0
- package/dist/task-registry.maintenance-Dx0m2NYh.js +2 -0
- package/dist/task-registry.maintenance-gApg-XOt.js +764 -0
- package/dist/task-status-access-CFhD_ieY.js +18 -0
- package/dist/tasks-B_Qoz38D.js +153 -0
- package/dist/tasks-DtV85zJT.js +548 -0
- package/dist/tasks-audit-system-Con3yYnm.js +210 -0
- package/dist/tasks-json-BM3pauZl.js +73 -0
- package/dist/tavily-web-search-provider.runtime-Cmyyc5kX.js +112 -0
- package/dist/tavily-web-search-provider.runtime.js +1 -1
- package/dist/text-report-CKxmVmt5.js +695 -0
- package/dist/text-transforms.runtime-DVwVsBRS.js +113 -0
- package/dist/text-transforms.runtime.js +1 -1
- package/dist/thread-bindings-B6UEVp9q.js +228 -0
- package/dist/tool-KOZc7TIF.js +143 -0
- package/dist/tool-dispatch-Ca4z2GEr.js +155 -0
- package/dist/tool-images-CzDwHeDR.js +247 -0
- package/dist/tool-plugin-BvQBJ2gU.js +93 -0
- package/dist/tool-resolution-Ddxl6tjh.js +153 -0
- package/dist/tool-result-truncation-BSKuIhd5.js +498 -0
- package/dist/tool-schema-nB27q-vb.js +40 -0
- package/dist/tool-schema-projection-COrMarLR.js +215 -0
- package/dist/tool-split-BjPHBFrv.js +323 -0
- package/dist/tools-CV40BWkc.js +901 -0
- package/dist/tools-catalog-5stC7W2V.js +156 -0
- package/dist/tools-effective-BVjqz2FV.js +442 -0
- package/dist/tools-effective-inventory-esPY5jRB.js +379 -0
- package/dist/tools-invoke-Czk_NM9G.js +51 -0
- package/dist/tools-invoke-http-D7PbsODz.js +68 -0
- package/dist/tools-invoke-shared-CzrEn0Dm.js +200 -0
- package/dist/tools-rSjgf61B.js +579 -0
- package/dist/tools.runtime-DiChCSGI.js +5 -0
- package/dist/tools.runtime.js +1 -1
- package/dist/transcript-rewrite-4IQefjvK.js +688 -0
- package/dist/transcripts-tool-BXTS8tE5.js +2 -0
- package/dist/transcripts-tool-CeWGgz5k.js +656 -0
- package/dist/tts-BS8EeM8p.js +2 -0
- package/dist/tts-BlTZjsaE.js +194 -0
- package/dist/tts-runtime-BfRdJDyY.js +1337 -0
- package/dist/tts-vRSvSw-t.js +3 -0
- package/dist/tts.runtime-ChBnVkNt.js +3 -0
- package/dist/tts.runtime-CmVCUbzq.js +2 -0
- package/dist/tts.runtime.js +1 -1
- package/dist/tui-BoQVBgWB.js +4860 -0
- package/dist/tui-DBYK9BeQ.js +2 -0
- package/dist/tui-backend-X0NI7rAv.js +256 -0
- package/dist/tui-cli-BpUtjV38.js +40 -0
- package/dist/typing-policy-CBwyAQh4.js +199 -0
- package/dist/usage-Bl-tgGx-.js +623 -0
- package/dist/usage-Cj_ektBl.js +1113 -0
- package/dist/usage-format-DWO9ckX3.js +394 -0
- package/dist/usage-format-DnCIXsqG.js +2 -0
- package/dist/video-generation-provider-B7ib4AeI.js +297 -0
- package/dist/video-generation-provider-CXQ6fqJx.js +64 -0
- package/dist/video-generation-provider-DXjl05T6.js +325 -0
- package/dist/video-generation-provider-Db8h71jA.js +77 -0
- package/dist/web-fetch/runtime.js +1 -1
- package/dist/web-fetch-providers.runtime-DhPkYjgB.js +41 -0
- package/dist/web-fetch-providers.runtime.js +1 -1
- package/dist/web-guarded-fetch-BdsVyvDS.js +58 -0
- package/dist/web-guarded-fetch-CJR3JCwT.js +2 -0
- package/dist/web-media-BzzQJAwk.js +4 -0
- package/dist/web-media-DViZjNBa.js +2 -0
- package/dist/web-media-inHawfBU.js +651 -0
- package/dist/web-provider-runtime-shared-Cc08Lt9p.js +142 -0
- package/dist/web-search-provider-common-CtbtmUL-.js +252 -0
- package/dist/web-search-providers.runtime-B7x_cRVn.js +41 -0
- package/dist/web-search-providers.runtime.js +1 -1
- package/package.json +1 -1
- package/dist/abort-CR0u3VsG.js +0 -277
- package/dist/abort.runtime-CXUxanGg.js +0 -2
- package/dist/accounts-BxBaquAf.js +0 -423
- package/dist/accounts-vQjpoqEe.js +0 -2
- package/dist/acp-spawn-2elSoS0E.js +0 -1286
- package/dist/acp-spawn-DtKOHNO1.js +0 -2
- package/dist/acp-stateful-target-driver-BqeA5j0h.js +0 -89
- package/dist/action-info-B8NotHFw.js +0 -75
- package/dist/active-runtime-registry-BO9mpPuB.js +0 -62
- package/dist/active-tool-schema-warnings-C8vGj5FX.js +0 -105
- package/dist/active-tool-schema-warnings-CVeFJuWI.js +0 -2
- package/dist/agent-BgEaDMdp.js +0 -1825
- package/dist/agent-_V5GbziF.js +0 -2
- package/dist/agent-bundle-lsp-runtime-0jBcDEHh.js +0 -389
- package/dist/agent-bundle-lsp-runtime-CQ6dZLs_.js +0 -2
- package/dist/agent-bundle-mcp-materialize-Cu6JqMzC.js +0 -124
- package/dist/agent-bundle-mcp-tools-BGL827cn.js +0 -3
- package/dist/agent-command-CMJdGr16.js +0 -1435
- package/dist/agent-delivery-DMu1MOeq.js +0 -117
- package/dist/agent-harness-runtime-BKSW2E1O.js +0 -207
- package/dist/agent-model-discovery-Cu4YL31r.js +0 -3
- package/dist/agent-model-discovery-DdmVtkZo.js +0 -238
- package/dist/agent-runner-utils-DXNDhwkI.js +0 -267
- package/dist/agent-runner.runtime-Cym4Odfd.js +0 -3784
- package/dist/agent-runtime-BkbhevY3.js +0 -199
- package/dist/agent-runtime-label-DNP06p76.js +0 -30
- package/dist/agent-runtime-metadata-JaTKc7mA.js +0 -53
- package/dist/agent-tool-result-middleware-loader-FbZE0Qpk.js +0 -55
- package/dist/agent-tools-Nwh8BlKX.js +0 -2506
- package/dist/agent-tools.before-tool-call-BwY-FYFl.js +0 -1274
- package/dist/agent-tools.before-tool-call-DwUmYhE3.js +0 -2
- package/dist/agent-u5NDWrw9.js +0 -3
- package/dist/agent-via-gateway-DMtOMwZa.js +0 -486
- package/dist/agent-wait-dedupe-CLuKbI_7.js +0 -180
- package/dist/agents-CiW7UEuB.js +0 -632
- package/dist/agents.command-shared-CXGSQscb.js +0 -16
- package/dist/agents.commands.add-BYBrZDXD.js +0 -304
- package/dist/agents.commands.bind-nfg3AlVc.js +0 -265
- package/dist/agents.commands.delete-pRj6vIrn.js +0 -128
- package/dist/agents.commands.identity-Ci2PnDDl.js +0 -143
- package/dist/agents.commands.list-Crj3BmqB.js +0 -235
- package/dist/aliases-BFspFx3-.js +0 -97
- package/dist/api-BiXhdPle.js +0 -3
- package/dist/api-Cptkjys5.js +0 -6
- package/dist/api-D3vT4ZVi.js +0 -2
- package/dist/api-key-rotation-CQgW8LEx.js +0 -167
- package/dist/app-registration-YW276fZC.js +0 -194
- package/dist/apply-BRxKrOiK.js +0 -510
- package/dist/apply-D0fWCa-U.js +0 -2
- package/dist/apply-DIR8y0ZA.js +0 -2
- package/dist/apply-DNUIV0Lt.js +0 -416
- package/dist/apply-Dux9jI7f.js +0 -544
- package/dist/approval-native-helpers-BMT-5X47.js +0 -398
- package/dist/artifacts-CTrtIv9T.js +0 -368
- package/dist/assistant-ClfI8Kho.js +0 -291
- package/dist/attachment-normalize-DAW86mZY.js +0 -213
- package/dist/attempt-execution-DTi2UfET.js +0 -584
- package/dist/attempt-execution.helpers-DrX0QToi.js +0 -969
- package/dist/attempt-execution.runtime-BCmAxwGy.js +0 -3
- package/dist/attempt.prompt-helpers-BE6kGRtT.js +0 -543
- package/dist/attempt.tool-run-context-J9O2yjbV.js +0 -1240
- package/dist/audio-preflight.runtime-D3GXVYBI.js +0 -7
- package/dist/audit-5T20D-xm.js +0 -1108
- package/dist/audit-CWuV5GlP.js +0 -477
- package/dist/audit.nondeep.runtime-DeYwRDYj.js +0 -1416
- package/dist/audit.runtime-rUlvK4Rb.js +0 -7
- package/dist/auth-DunUSatn.js +0 -567
- package/dist/auth-choice--eBzca8Y.js +0 -3
- package/dist/auth-choice-DJ9jsFUq.js +0 -400
- package/dist/auth-choice-_pLkIdVh.js +0 -110
- package/dist/auth-choice.apply.api-providers-CALcopRP.js +0 -2
- package/dist/auth-choice.apply.api-providers-Dzzm1snk.js +0 -34
- package/dist/auth-choice.plugin-providers.runtime-BHKTeZZc.js +0 -11
- package/dist/auth-health-Cs4OjiF2.js +0 -219
- package/dist/auth-list-bwJ4QDs0.js +0 -115
- package/dist/auth-order-BoHN3Dc_.js +0 -105
- package/dist/auth-profiles-BOLncVgy.js +0 -73
- package/dist/auth-profiles-BiQRkULt.js +0 -14
- package/dist/backend-config-B5yga5ay.js +0 -259
- package/dist/bash-tools-BWvldguc.js +0 -3
- package/dist/bash-tools-DEAAO5np.js +0 -3497
- package/dist/binding-routing-BbtHmU_l.js +0 -113
- package/dist/binding-targets-DSNv3-QA.js +0 -121
- package/dist/bootstrap-files-DD8V2dLe.js +0 -202
- package/dist/bootstrap-files-_6u1uJW2.js +0 -3
- package/dist/bridge-server-v1-XPnAZ.js +0 -113
- package/dist/browser-cli-CnpuO4KR.js +0 -230
- package/dist/browser-cli-DPbIn8SK.js +0 -2
- package/dist/browser-cli-actions-input-DoGR6LI-.js +0 -522
- package/dist/browser-cli-actions-observe-CYMpgmtF.js +0 -81
- package/dist/browser-cli-debug-ChJjSq-h.js +0 -137
- package/dist/browser-cli-inspect-Bbci-WPG.js +0 -117
- package/dist/browser-cli-manage-Bnscjb7b.js +0 -446
- package/dist/browser-cli-resize-D1MJdvZI.js +0 -32
- package/dist/browser-cli-shared-BCQwqz51.js +0 -69
- package/dist/browser-cli-state-BWkPsvUg.js +0 -371
- package/dist/browser-control-auth-CEP_ExeC.js +0 -2
- package/dist/browser-profiles-SvnqnHVN.js +0 -2
- package/dist/browser-runtime-0mRxjFpp.js +0 -389
- package/dist/browser-tool.schema--CLR3nDv.js +0 -132
- package/dist/btw-command-DV6HfrRV.js +0 -18
- package/dist/build-DiRmljCi.js +0 -261
- package/dist/bundled-channel-config-schema-DpdKMATU.d.ts +0 -3168
- package/dist/capability-cli-ATfwTYFe.js +0 -1809
- package/dist/capability-provider-runtime-l3nnLGvn.js +0 -346
- package/dist/cdp.helpers-IIuc0KGS.js +0 -637
- package/dist/channel-CzTD2ouI.js +0 -2309
- package/dist/channel-actions-B5Yk5Axf.js +0 -46
- package/dist/channel-bootstrap.runtime-C9F-Pq1o.js +0 -38
- package/dist/channel-bootstrap.runtime-TPyY5Ngv.js +0 -2
- package/dist/channel-core-XMZJ-ZGF.js +0 -5
- package/dist/channel-inbound-DvqkKmiH.js +0 -121
- package/dist/channel-message-CnJ4vUyt.js +0 -12
- package/dist/channel-outbound-BhefGAqY.js +0 -436
- package/dist/channel-plugin-resolution-BiaJ8aRa.js +0 -2
- package/dist/channel-plugin-resolution-D_CxkMVc.js +0 -135
- package/dist/channel-resolution-DzI28gIM.js +0 -46
- package/dist/channel-selection-CLFO4-eQ.js +0 -171
- package/dist/channel-selection.runtime-Beb2-bMH.js +0 -2
- package/dist/channel.runtime-By5T5eGw.js +0 -697
- package/dist/channels-BrRY9Mag.js +0 -1004
- package/dist/channels-cli-CF--e2RU.js +0 -331
- package/dist/chat-BTMPilpx.js +0 -2940
- package/dist/chat-DnC7XCWK.js +0 -3
- package/dist/chrome-C3_dN9jE.js +0 -1517
- package/dist/chrome-mcp-5jjDHIgn.js +0 -864
- package/dist/chrome-mcp-DFAa-WzK.js +0 -2
- package/dist/claude-live-session-BUPeOzLE.js +0 -1338
- package/dist/claude-live-session-Bprgmr1-.js +0 -2
- package/dist/clawbot-cli-5UVkLT1Y.js +0 -9
- package/dist/cli-6a6sMEUB.js +0 -2
- package/dist/cli-COCN9B5e.js +0 -2
- package/dist/cli-CpI4dBXy.js +0 -141
- package/dist/cli-YLx-ekdH.js +0 -293
- package/dist/cli-backends.runtime-CsBjr7ag.js +0 -7
- package/dist/cli-compaction-Bh0oMwUa.js +0 -363
- package/dist/cli-registry-loader-DDbaAJgY.js +0 -2
- package/dist/cli-registry-loader-xc2Ah8S4.js +0 -193
- package/dist/cli-runner-BfSrIn-9.js +0 -597
- package/dist/cli-runner-D_FAjNbR.js +0 -2
- package/dist/cli-runner.runtime-BJetQDu1.js +0 -3
- package/dist/cli-runner.runtime-BKJQkc7C.js +0 -4
- package/dist/cli-session-Cy3IeH0g.js +0 -119
- package/dist/cli.runtime-BpOz0s3N.js +0 -1276
- package/dist/codex-native-web-search-BDtKRV3F.js +0 -4
- package/dist/codex-native-web-search-C0TrfoMX.js +0 -20
- package/dist/codex-native-web-search-core-CzlK1GfN.js +0 -106
- package/dist/command-auth-CFnvdYX2.js +0 -135
- package/dist/command-config-resolution-B_86rG8v.js +0 -2
- package/dist/command-config-resolution-BbadcA2M.js +0 -25
- package/dist/command-config-resolution.runtime-B_86rG8v.js +0 -2
- package/dist/command-execution-startup-Rrwwdg_5.js +0 -90
- package/dist/command-primitives-runtime-C9bTt5IV.js +0 -3
- package/dist/command-registry-CbpdQKmu.js +0 -9
- package/dist/command-registry-Dw-XC_Zk.js +0 -4
- package/dist/command-registry-core-rvEDki6p.js +0 -114
- package/dist/command-secret-gateway-BX6BIiFn.js +0 -589
- package/dist/command-secret-targets-DCzlTkb5.js +0 -2
- package/dist/command-status-builders-DIsZN9aY.js +0 -147
- package/dist/command-status.runtime-C2x4yMRd.js +0 -90
- package/dist/commands-FYCxWqIx.js +0 -161
- package/dist/commands-compact.runtime-BTMQfx1k.js +0 -10
- package/dist/commands-core.runtime-CuNLz2wm.js +0 -2
- package/dist/commands-handlers.runtime-DyNuPOmY.js +0 -6327
- package/dist/commands-models-s7BRmLQh.js +0 -448
- package/dist/commands-registry-BxEq-3UJ.js +0 -195
- package/dist/commands-registry.runtime-CbXW33S_.js +0 -4
- package/dist/commands-status-BRJMba4h.js +0 -16
- package/dist/commands-status-DCXEwlSF.js +0 -3
- package/dist/commands-status.runtime-DCXEwlSF.js +0 -3
- package/dist/commands-subagents-control.runtime-CduLQJFD.js +0 -2
- package/dist/commands-system-prompt-B3LD8CDs.js +0 -161
- package/dist/commands-system-prompt-DPsXTqOQ.js +0 -2
- package/dist/commands.runtime-3sVz8Qgo.js +0 -175
- package/dist/common-CZvBLb3w.js +0 -286
- package/dist/compact-DxU_9XEc.js +0 -1165
- package/dist/compact.runtime-CqQTypVl.js +0 -12
- package/dist/compaction-planning-DArTi9SN.js +0 -202
- package/dist/completion-cli-CiKl5HhI.js +0 -393
- package/dist/config--yllOaSC.js +0 -374
- package/dist/config-Yt5UcD91.js +0 -610
- package/dist/config-cli-BeXS3R6k.js +0 -1703
- package/dist/config-mutation-cQeWhUqy.js +0 -5
- package/dist/config-mutations-Cg04LH_S.js +0 -161
- package/dist/config-utils-Dhq_UKMC.js +0 -141
- package/dist/config-validation-BANohTKD.js +0 -33
- package/dist/configure-CWxhlx9G.js +0 -771
- package/dist/configure-Jejkc6dn.js +0 -3
- package/dist/configure.commands-BYy1bz8G.js +0 -2
- package/dist/configure.commands-C3hDvZse.js +0 -1253
- package/dist/context-DptQ59DZ.js +0 -248
- package/dist/context-_ZshNBhD.js +0 -2
- package/dist/context-engine-host-compat-C_eflvRw.js +0 -2
- package/dist/context-engine-host-compat-s15Pu845.js +0 -280
- package/dist/context-engine-lifecycle-COHFLnj4.js +0 -627
- package/dist/control-auth-CQJpLoIb.js +0 -114
- package/dist/control-service-BFSgA0Py.js +0 -40
- package/dist/control-service-D7GZv-GS.js +0 -3
- package/dist/control-ui/assets/activity-B7yRLbf3.js +0 -124
- package/dist/control-ui/assets/agents-E-3DAkaW.js +0 -1030
- package/dist/control-ui/assets/channels-D0c7A9OX.js +0 -120
- package/dist/control-ui/assets/cron-B54j2Vmo.js +0 -1016
- package/dist/control-ui/assets/debug-CRcGYNA9.js +0 -97
- package/dist/control-ui/assets/index-bZJJ7U8q.js +0 -7214
- package/dist/control-ui/assets/instances-RcBeqNzx.js +0 -57
- package/dist/control-ui/assets/nodes-BoWRh42t.js +0 -444
- package/dist/control-ui/assets/sessions-BmRQ932H.js +0 -425
- package/dist/control-ui/assets/skills-BDn45kHZ.js +0 -362
- package/dist/control-ui/assets/workboard-BwbcNuC5.js +0 -402
- package/dist/control-ui-ChfTPXZo.js +0 -750
- package/dist/conversation-label-generator-CTfnInQF.js +0 -72
- package/dist/conversation-runtime-B7oAN9Tq.js +0 -31
- package/dist/core-api-CBD0dvTQ.js +0 -5
- package/dist/core-api-ClCm_yM8.js +0 -2
- package/dist/core-wuoxL08a.js +0 -284
- package/dist/crestodian--iYeGB8u.js +0 -55
- package/dist/cron-D2SzQyqo.js +0 -453
- package/dist/daemon-install-B6CAkU3V.js +0 -66
- package/dist/daemon-install-auth-profiles-store.runtime-Cpt5LSD6.js +0 -2
- package/dist/dashboard-ChYOQjM2.js +0 -263
- package/dist/defaults-CCopehWw.js +0 -130
- package/dist/defaults-H4kBp17N.js +0 -3
- package/dist/defaults.constants-CjB9HP6f.js +0 -76
- package/dist/deliver-BzPhWO_F.js +0 -3
- package/dist/deliver-DGyKH3Qi.js +0 -1399
- package/dist/deliver-runtime-Ca2kcQoZ.js +0 -2
- package/dist/delivery-outbound.runtime-D7ycPxY-.js +0 -7
- package/dist/delivery-queue-CnLv30ko.js +0 -863
- package/dist/delivery-queue-CuaDjNMh.js +0 -2
- package/dist/delivery-queue-runtime-DO2vqOIJ.js +0 -16
- package/dist/delivery-target.runtime-QcBVk_j8.js +0 -45
- package/dist/delivery.runtime-L09v4tys.js +0 -470
- package/dist/detached-task-runtime-BqU7YXYT.js +0 -86
- package/dist/diagnostics-T-Hk_Qzi.js +0 -168
- package/dist/dialogue-C0VnTMMn.js +0 -37
- package/dist/direct-dm-BWn67tDD.js +0 -81
- package/dist/directive-handling.defaults-DO6Snm4_.js +0 -22
- package/dist/directive-handling.fast-lane-BemYRfPn.js +0 -70
- package/dist/directive-handling.impl-BMVh1pMh.js +0 -823
- package/dist/directive-handling.impl-vr4MsYbt.js +0 -2
- package/dist/directive-handling.model-selection-DegP9exp.js +0 -122
- package/dist/directive-handling.persist.runtime-BUdU6_zm.js +0 -274
- package/dist/directives-1xk_ZcMf.js +0 -319
- package/dist/directory-cli-D83WEjEG.js +0 -239
- package/dist/dispatch-Ck2tvRYH.js +0 -2057
- package/dist/dispatch-acp-GdaHNdvf.js +0 -1102
- package/dist/dispatch-acp-manager.runtime-BGSrJqrW.js +0 -3
- package/dist/dispatch-acp-media.runtime-DQ8dYQh8.js +0 -4
- package/dist/dispatch-acp-transcript.runtime-CsJZGhnu.js +0 -40
- package/dist/dispatch-acp-tts.runtime-Bo-QxKgx.js +0 -3
- package/dist/dispatch-acp.runtime-C_u7sGcQ.js +0 -18
- package/dist/dispatcher-GtuYO6Ni.js +0 -106
- package/dist/doctor-B2qP9g8d.js +0 -760
- package/dist/doctor-D9wCez5t.js +0 -6
- package/dist/doctor-auth-XnseqtS7.js +0 -216
- package/dist/doctor-auth-flat-profiles-B6cL-TiJ.js +0 -516
- package/dist/doctor-auth-flat-profiles-Birb7qIk.js +0 -2
- package/dist/doctor-auth-legacy-oauth-CXO3OtyG.js +0 -48
- package/dist/doctor-auth-oauth-sidecar-BSgQPbcS.js +0 -177
- package/dist/doctor-auth-oauth-sidecar-CzzyNwxc.js +0 -2
- package/dist/doctor-bootstrap-size-BlVcO5D6.js +0 -57
- package/dist/doctor-claude-cli-_MTVnCQ-.js +0 -150
- package/dist/doctor-config-flow-0kxzjUjK.js +0 -1819
- package/dist/doctor-core-checks-C_g9REOd.js +0 -666
- package/dist/doctor-core-checks-CahzmM1L.js +0 -2
- package/dist/doctor-core-checks.runtime-Bi_oTiTZ.js +0 -278
- package/dist/doctor-gateway-daemon-flow-UAIWsI9w.js +0 -349
- package/dist/doctor-gateway-services-BiMEGiw_.js +0 -465
- package/dist/doctor-health-C69GVfMl.js +0 -65
- package/dist/doctor-health-contributions-Bz19QhI4.js +0 -874
- package/dist/doctor-lint-BVW4E6Qf.js +0 -95
- package/dist/doctor-memory-search-D2PWzDCY.js +0 -407
- package/dist/doctor-state-integrity-DuJIszQj.js +0 -1257
- package/dist/doctor-tool-result-cap-advice-Dpn4zNH3.js +0 -27
- package/dist/doctor-workspace-status-nW9TcIWi.js +0 -76
- package/dist/dreaming-CcOWzGN5.js +0 -523
- package/dist/dreaming-command-sxm3FQGb.js +0 -101
- package/dist/dreaming-narrative-BSRwiUPL.js +0 -2
- package/dist/dreaming-narrative-BskwmYdC.js +0 -721
- package/dist/dreaming-phases-BuHjGyPw.js +0 -2
- package/dist/dreaming-phases-ChVT8Ovk.js +0 -1162
- package/dist/drive-C_u5W4ln.js +0 -899
- package/dist/echo-transcript-tnZWH4EO.js +0 -52
- package/dist/effective-tool-policy-CeHdL2D7.js +0 -89
- package/dist/embedded-agent-CGULn3lb.js +0 -4
- package/dist/embedded-agent-DZTa1YiK.js +0 -4074
- package/dist/embedded-agent-helpers-B65K9o55.js +0 -6
- package/dist/embedded-agent-helpers-BPXCvWBb.js +0 -1037
- package/dist/embedded-agent.runtime-TfBgXcUV.js +0 -4
- package/dist/embedded-backend-BAaFwayA.js +0 -744
- package/dist/embedded-gateway-stub.runtime-CNyrjvgT.js +0 -12
- package/dist/embedding-provider-runtime-EnkHdROJ.js +0 -86
- package/dist/embedding-providers-CDkDb0kv.js +0 -2
- package/dist/embeddings-http-ClIu4_mP.js +0 -222
- package/dist/engine-qmd-DZRiT9i4.js +0 -708
- package/dist/engine-storage-BEqlN8TR.js +0 -203
- package/dist/errors-Co8auIlv.js +0 -2
- package/dist/exec-approval-forwarder.runtime-C7QvfWQ6.js +0 -4
- package/dist/exec-approval-session-target-ChuH1nXL.js +0 -177
- package/dist/exec-auto-reviewer-Bm7380HF.js +0 -2
- package/dist/exec-auto-reviewer-BrrdGleK.js +0 -241
- package/dist/execute.runtime-B-8jUqDB.js +0 -579
- package/dist/external-cli-auth-selection-0BxmRUps.js +0 -113
- package/dist/extra-params-BgyvpEpv.js +0 -615
- package/dist/fallback-notice-state-BXk_kRWM.js +0 -15
- package/dist/fallbacks-CPdVRP81.js +0 -31
- package/dist/fallbacks-shared-CSGf1oaf.js +0 -116
- package/dist/fengming-runtime-NUA51sEw.js +0 -33
- package/dist/fengming-runtime-config-CIZ-SHPt.js +0 -2
- package/dist/fengming-runtime-memory-CIZ-SHPt.js +0 -2
- package/dist/fengming-runtime-session-CIZ-SHPt.js +0 -2
- package/dist/fengming-tools-MvRSt0JA.js +0 -12221
- package/dist/flows-BocRit8D.js +0 -189
- package/dist/fs-utils-DSXeBcjj.js +0 -9
- package/dist/gateway-BCrUxrVw.js +0 -133
- package/dist/gateway-cli-B8bXBd_L.js +0 -443
- package/dist/gateway-install-token-pngTMc-f.js +0 -136
- package/dist/gateway-method-runtime-ueZTz7WH.js +0 -21
- package/dist/gateway-runtime-DbsoThML.js +0 -23
- package/dist/get-reply-DUuaxcBz.js +0 -5198
- package/dist/get-reply-from-config.runtime-B4Dgs3Hg.js +0 -2
- package/dist/github-copilot-token-7AfRRF7J.js +0 -2
- package/dist/health-7Yq5zpoZ.js +0 -3
- package/dist/health-DlZqxm2f.js +0 -621
- package/dist/health-DxesUuur.js +0 -111
- package/dist/health-state-BMG8kOby.js +0 -106
- package/dist/heartbeat-runner-Bq7A_Cjm.js +0 -5
- package/dist/heartbeat-runner-DVwbVyft.js +0 -1930
- package/dist/heartbeat-runner.runtime-DQ2NPXMD.js +0 -3
- package/dist/helpers-PCu2RivJ.js +0 -406
- package/dist/hook-helpers-DLEnCRO7.js +0 -44
- package/dist/hooks-Bv-otcl7.js +0 -536
- package/dist/hooks-cli-C5ve0nzF.js +0 -465
- package/dist/http-endpoint-helpers-w2SagsQz.js +0 -37
- package/dist/http-utils-CVvn0ZA-.js +0 -98
- package/dist/image-BeixBis4.js +0 -385
- package/dist/image-fallbacks-CPbmIMn9.js +0 -31
- package/dist/image-generation-core.auth.runtime-Co38iRxQ.js +0 -2
- package/dist/image-generation-provider-BA4Ar91S.js +0 -152
- package/dist/image-runtime-7ZsfioS1.js +0 -9
- package/dist/image-tool.helpers-upjA3ksB.js +0 -150
- package/dist/images-ChLi1Uog.js +0 -2
- package/dist/images-nB0XAnTa.js +0 -416
- package/dist/inbound-reply-dispatch-DglobJ8j.js +0 -2
- package/dist/inbound-reply-dispatch-QKOgNx-m.js +0 -147
- package/dist/infra-runtime-CGD3RE_2.js +0 -32
- package/dist/init-poVZDCAM.js +0 -59
- package/dist/install-Dn9oPGmU.js +0 -262
- package/dist/install.runtime-D5sllsjl.js +0 -2
- package/dist/internal-CnOL_Roa.js +0 -399
- package/dist/isolated-agent-CNw6E3F0.js +0 -1097
- package/dist/isolated-agent-DjkHhEyR.js +0 -2
- package/dist/kernel-B5Y5IQ-A.js +0 -3
- package/dist/kernel-CMuO4VJy.js +0 -979
- package/dist/kimi-web-search-provider.runtime-V4m_MHsk.js +0 -307
- package/dist/library-B-1EZjtY.js +0 -45
- package/dist/lifecycle-B-5gEZ7O.js +0 -570
- package/dist/lifecycle-Bzh5Jo09.js +0 -2
- package/dist/lifecycle-DvbcJYMl.js +0 -355
- package/dist/lifecycle.runtime-Bzh5Jo09.js +0 -2
- package/dist/list-B4xSHRdU.js +0 -2
- package/dist/list-BnhZHpxx.js +0 -207
- package/dist/list.list-command-DAz-Ws_6.js +0 -429
- package/dist/list.model-row-DtdX9KDu.js +0 -39
- package/dist/list.probe-CY6lxq51.js +0 -2
- package/dist/list.probe-DPuE1GOH.js +0 -451
- package/dist/list.provider-catalog-BHc9WXI6.js +0 -211
- package/dist/list.provider-catalog-CFbrroys.js +0 -2
- package/dist/list.registry-load-C1_sr3gb.js +0 -152
- package/dist/list.row-sources-BMtHc9oi.js +0 -474
- package/dist/list.source-plan-Dth72qPP.js +0 -81
- package/dist/list.status-command-BXCnEq8Q.js +0 -815
- package/dist/live-model-switch-Dxav22vq.js +0 -119
- package/dist/llm-slug-generator-6o8RXL11.js +0 -78
- package/dist/load-config-EF3n0Dyo.js +0 -27
- package/dist/load-context-CI_ogQt_.js +0 -82
- package/dist/loader-DtwEzpp-.js +0 -7008
- package/dist/local-dispatch.runtime-21liE3rA.js +0 -10
- package/dist/main-session-restart-recovery-D1g62iJ5.js +0 -2
- package/dist/main-session-restart-recovery-v2I9CEXi.js +0 -389
- package/dist/managed-image-attachments-BEl5qfCT.js +0 -616
- package/dist/managed-image-attachments-D5KqX2Qy.js +0 -2
- package/dist/manager-DZc3xiNq.js +0 -2314
- package/dist/manager-Vf3vLTGe.js +0 -3737
- package/dist/mcp-http-BaJoPKF9.js +0 -583
- package/dist/mcp-http-CpEaJIGJ.js +0 -2
- package/dist/media-runtime-DtP_Ff8m.js +0 -391
- package/dist/media-services-CXYbyIIp.js +0 -416
- package/dist/media-understanding-DvTIsIyr.js +0 -87
- package/dist/media-understanding-provider-DBBAvuwG.js +0 -13
- package/dist/media-understanding-provider-DOf_uZrx.js +0 -70
- package/dist/media-understanding-provider-DdRfNh9h.js +0 -69
- package/dist/media-understanding-provider-mqpQDt8V.js +0 -29
- package/dist/memory-BNk25Hi6.js +0 -437
- package/dist/memory-core-host-engine-embeddings-XsK5xS70.js +0 -667
- package/dist/memory-core-host-engine-foundation-BYkoOLXl.js +0 -15
- package/dist/memory-core-host-engine-qmd-0JuUCKCK.js +0 -2
- package/dist/memory-core-host-engine-storage-MCFGjDwW.js +0 -2
- package/dist/memory-core-host-runtime-cli-fVGH65E8.js +0 -10
- package/dist/memory-core-host-runtime-core-JtXIAdlM.js +0 -12
- package/dist/memory-core-host-runtime-files-BGw_ypoN.js +0 -4
- package/dist/memory-embedding-provider-runtime-3UBzs4sx.js +0 -36
- package/dist/memory-host-core-Y_O5V-mu.js +0 -78
- package/dist/memory-host-search.runtime-B4TzyvmR.js +0 -2
- package/dist/memory-runtime-9kEPAeKV.js +0 -2
- package/dist/memory-runtime-BU4t85uu.js +0 -57
- package/dist/memory-search-CVX--mSz.js +0 -235
- package/dist/message-BVXoNpWP.js +0 -284
- package/dist/message-HaiKqj0A.js +0 -2
- package/dist/message-action-runner-Chwzn02r.js +0 -2
- package/dist/message-action-runner-tEEliptt.js +0 -1922
- package/dist/message-handler-CHDS_NF-.js +0 -1806
- package/dist/metadata-registry-loader-Croa1pgR.js +0 -22
- package/dist/metadata-registry-loader-w0p86vis.js +0 -2
- package/dist/migrate-CPCZJ4H5.js +0 -2
- package/dist/migrate-CUj6m6Cx.js +0 -458
- package/dist/migration-provider-runtime-4r4WGtf2.js +0 -2
- package/dist/migration-provider-runtime-TxrH_mM7.js +0 -68
- package/dist/minimax-web-search-provider.runtime-Dr2GJiWj.js +0 -148
- package/dist/model-BQSouNOa.js +0 -2
- package/dist/model-CAk0bcuO.js +0 -1302
- package/dist/model-auth-BF7w9Fiv.js +0 -705
- package/dist/model-auth-label-r729wcPk.js +0 -67
- package/dist/model-auth-us8b_D5d.js +0 -6
- package/dist/model-catalog-BGykBGxx.js +0 -434
- package/dist/model-catalog-BVXrqFbI.js +0 -3
- package/dist/model-catalog-visibility-Bsup46vy.js +0 -76
- package/dist/model-config.helpers-wzD1EEfE.js +0 -95
- package/dist/model-context-tokens-DrIU9eJc.js +0 -572
- package/dist/model-fallback-GySPjr3J.js +0 -1288
- package/dist/model-fallback-auth.runtime-Dg_Jmguu.js +0 -5
- package/dist/model-picker-BI6jXOjt.js +0 -3
- package/dist/model-picker-DYyJHhfH.js +0 -1135
- package/dist/model-picker-visibility-D_IMZfxd.js +0 -22
- package/dist/model-picker.runtime-B70kQMyc.js +0 -48
- package/dist/model-pricing-cache-CSpUDzSt.js +0 -856
- package/dist/model-pricing-cache-dkPwTUVJ.js +0 -3
- package/dist/model-pricing-cache-state-C6shoEWy.js +0 -83
- package/dist/model-provider-auth-BfZHbTaj.js +0 -2
- package/dist/model-provider-auth-CPCBWvqL.js +0 -375
- package/dist/model-runtime-aliases-DUzusc9_.js +0 -133
- package/dist/model-selection-8UzO5mgF.js +0 -254
- package/dist/model-selection-Cb7azWw1.js +0 -7
- package/dist/model-selection-jDYEo0WI.js +0 -352
- package/dist/model-selection.runtime-D_yHZLbs.js +0 -7
- package/dist/models-BxA2IU3W.js +0 -57
- package/dist/models-auth-status-yG7yyRcv.js +0 -280
- package/dist/models-cli-DUt4uiMH.js +0 -257
- package/dist/models-config-B5bkuh6A.js +0 -1189
- package/dist/models-config-Xj8vG_x2.js +0 -2
- package/dist/models-config.providers.secrets-DNBB440Z.js +0 -2
- package/dist/models-config.providers.secrets-DNIQlBSE.js +0 -382
- package/dist/models-http-DMILRsry.js +0 -88
- package/dist/monitor-7tD_FE_5.js +0 -60
- package/dist/monitor-HjEwlqJs.js +0 -1024
- package/dist/monitor.account-D0F9tnWD.js +0 -5382
- package/dist/music-generation-provider-3ykPaUwR.js +0 -308
- package/dist/native-hook-relay-BJKHIhWd.js +0 -1378
- package/dist/native-hook-relay-V8Kappw1.js +0 -19
- package/dist/node-cli-BLVyQ93e.js +0 -2806
- package/dist/node-command-policy-B0ezpI_O.js +0 -295
- package/dist/nodes-DnWH_15m.js +0 -3
- package/dist/nodes-RkB4ZmP6.js +0 -1483
- package/dist/nodes-cli-upwPs91b.js +0 -960
- package/dist/nodes-pending--sojaxpI.js +0 -211
- package/dist/nodes-utils-Yks_uDZK.js +0 -85
- package/dist/oauth-CQN2efEy.js +0 -207
- package/dist/oauth-DApi3OI9.js +0 -746
- package/dist/oauth-DkUWBub2.js +0 -852
- package/dist/onboard-CiQSBSrz.js +0 -768
- package/dist/onboard-channels-DaWYXiLv.js +0 -1534
- package/dist/onboard-channels-DnwM2_IL.js +0 -2
- package/dist/onboard-custom-BQPckD0V.js +0 -3
- package/dist/onboard-custom-config-BmbThk2-.js +0 -422
- package/dist/onboard-custom-xInFj1Rs.js +0 -280
- package/dist/onboard-search-DSfmthe5.js +0 -412
- package/dist/openai-compat-errors-VR4SN1MV.js +0 -136
- package/dist/openai-http-DV95ynPi.js +0 -836
- package/dist/openai-transport-stream-BwpzqR-b.js +0 -3427
- package/dist/openresponses-http-DPchx8IC.js +0 -1175
- package/dist/operations-f9R8j-r9.js +0 -805
- package/dist/order-BQx8mNGZ.js +0 -218
- package/dist/outbound-attachment-C4yojK6p.js +0 -19
- package/dist/param-readers-BIXyd5la.js +0 -2
- package/dist/payloads-DrY1bKyF.js +0 -256
- package/dist/persistent-bindings.lifecycle-BiPN7luW.js +0 -85
- package/dist/persistent-bindings.lifecycle-X3wfan2Z.js +0 -2
- package/dist/plugin-enabled-CqsBObeO.js +0 -232
- package/dist/plugin-install-CfB1_kpX.js +0 -118
- package/dist/plugin-install-DzMraXHH.js +0 -2
- package/dist/plugin-install-config-policy-BD_elPNg.js +0 -169
- package/dist/plugin-registration-Dy58ncPf.js +0 -97
- package/dist/plugin-registry-BlmODeop.js +0 -3
- package/dist/plugin-registry-k5OK18l5.js +0 -2
- package/dist/plugin-runtime-B3t53CKr.js +0 -102
- package/dist/plugin-sdk/bundled-channel-config-schema-C3pWWvwG.d.ts +0 -3169
- package/dist/plugin-sdk/config-schema-D7cABQ6o.d.ts +0 -33
- package/dist/plugin-sdk/zod-schema.core-CwBNqcXp.d.ts +0 -166
- package/dist/plugin-service-sKF4gWFm.js +0 -1249
- package/dist/plugins-authoring-command-I72k2cuv.js +0 -304
- package/dist/plugins-cli-DMQRbPsU.js +0 -63
- package/dist/plugins-cli.runtime-CvDuKFJj.js +0 -339
- package/dist/plugins-command-helpers-C5WMM4bk.js +0 -164
- package/dist/plugins-command-helpers-DDt_pMQ4.js +0 -2
- package/dist/plugins-inspect-command-ka7Hpld3.js +0 -248
- package/dist/plugins-install-command-BHSgof-_.js +0 -2
- package/dist/plugins-install-command-t5caX9q_.js +0 -993
- package/dist/plugins-install-persist-Bah1m3x7.js +0 -252
- package/dist/plugins-list-command-BXLWwXHM.js +0 -184
- package/dist/plugins-uninstall-command-C_3m6CrW.js +0 -118
- package/dist/prepare.runtime-COZaHg5E.js +0 -798
- package/dist/presentation-card-CciJv4ru.js +0 -164
- package/dist/preview-warnings-L4VuEOyB.js +0 -618
- package/dist/profiles-CM2xoUYX.js +0 -194
- package/dist/program-B-4C7bC-.js +0 -131
- package/dist/provider-adapters-Eh8mS2Fd.js +0 -104
- package/dist/provider-api-key-auth-DTh2cbmS.js +0 -117
- package/dist/provider-api-key-auth.runtime-DrTYYfxK.js +0 -14
- package/dist/provider-auth-Bnaijzmv.js +0 -281
- package/dist/provider-auth-api-key-CNP8o5E7.js +0 -5
- package/dist/provider-auth-choice-Devw4sQf.js +0 -311
- package/dist/provider-auth-choice-helpers-DmVudRp6.js +0 -210
- package/dist/provider-auth-choice.runtime-C337IQ3W.js +0 -2
- package/dist/provider-auth-choice.runtime-DqGYalFo.js +0 -18
- package/dist/provider-auth-guidance-Bk4WV6Lg.js +0 -2
- package/dist/provider-auth-guidance-C7NCKuKn.js +0 -34
- package/dist/provider-auth-helpers-r7mC8I5l.js +0 -177
- package/dist/provider-auth-login.runtime-BFJgAAS6.js +0 -156
- package/dist/provider-auth-runtime-BiLPGiMW.js +0 -186
- package/dist/provider-discovery-uxRmAIf_.js +0 -95
- package/dist/provider-discovery.runtime-mwbSivDS.js +0 -290
- package/dist/provider-dispatcher-CtKWj3r-.js +0 -22
- package/dist/provider-entry-DjACqdrB.js +0 -134
- package/dist/provider-hook-runtime-CpJsM7Dk.js +0 -255
- package/dist/provider-openai-codex-oauth-DWGmVUYg.js +0 -2
- package/dist/provider-openai-codex-oauth-ctxd00JW.js +0 -44
- package/dist/provider-registration-l8EX4voM.js +0 -235
- package/dist/provider-registry-BgIQXJle.js +0 -31
- package/dist/provider-registry-CVuzobHN.js +0 -36
- package/dist/provider-registry-DmdDbSQs.js +0 -61
- package/dist/provider-registry-LqtLqheu.js +0 -61
- package/dist/provider-registry-pTYVjODc.js +0 -61
- package/dist/provider-runtime-BQZSuC9l.js +0 -3
- package/dist/provider-runtime-D9Q-7VuO.js +0 -386
- package/dist/provider-runtime.runtime-C6YZ8YI0.js +0 -26
- package/dist/provider-self-hosted-setup-BIAD2ISe.js +0 -373
- package/dist/provider-stream-DScdaoRo.js +0 -313
- package/dist/provider-stream-PE0IxmpZ.js +0 -1084
- package/dist/provider-stream-family-S2fhlydZ.js +0 -2
- package/dist/provider-usage-DVKHMF6l.js +0 -4
- package/dist/provider-usage-EEjx1av0.js +0 -71
- package/dist/provider-usage.load-Cu11xbrw.js +0 -357
- package/dist/provider-web-search-Dbk7MO-1.js +0 -58
- package/dist/provider-wizard-DS2Xb2eu.js +0 -125
- package/dist/providers.runtime-BPhGcupv.js +0 -240
- package/dist/providers.runtime-DoylK-ht.js +0 -2
- package/dist/proxy-BxacG0p3.js +0 -662
- package/dist/public-artifacts-Dq3y7bBv.js +0 -7
- package/dist/pw-ai-DlSSqerW.js +0 -3064
- package/dist/qmd-manager-B_SG-ejE.js +0 -2040
- package/dist/qr-cli-CT-sE_j9.js +0 -2
- package/dist/qr-cli-DPlDCXJQ.js +0 -371
- package/dist/qr-image--VmmvuDB.js +0 -2
- package/dist/queue-Be2Y7PcO.js +0 -923
- package/dist/read-file-hhemkDfq.js +0 -183
- package/dist/register-service-commands-CeVpCQU3.js +0 -77
- package/dist/register.agent-JLsb-giw.js +0 -152
- package/dist/register.configure-CP0Q-ost.js +0 -16
- package/dist/register.crestodian-CBXyXEix.js +0 -24
- package/dist/register.maintenance-DGIPQ2Vo.js +0 -85
- package/dist/register.message-BBQwz0Ld.js +0 -404
- package/dist/register.migrate-CkgNlvLD.js +0 -106
- package/dist/register.onboard-CS9gRK0c.js +0 -115
- package/dist/register.setup-DhqDOer9.js +0 -40
- package/dist/register.status-health-sessions-CiwQN_lw.js +0 -293
- package/dist/register.subclis-86Md7P0P.js +0 -3
- package/dist/register.subclis-CTVI8zvZ.js +0 -31
- package/dist/register.subclis-core-Cy4AnRCu.js +0 -273
- package/dist/rem-harness-vSsq3HiK.js +0 -649
- package/dist/repair-sequencing-SHADYdcA.js +0 -652
- package/dist/reply-media-paths.runtime-Bf5nxPuP.js +0 -154
- package/dist/reply-media-paths.runtime-sLsMpKGO.js +0 -2
- package/dist/reply-payloads-CJ3w8rSA.js +0 -79
- package/dist/reply-payloads-dedupe-DDFXWCVR.js +0 -176
- package/dist/reply-payloads-dedupe.runtime-DbXPzKmG.js +0 -2
- package/dist/reply-timing-tracker-DjVIBsVb.js +0 -205
- package/dist/reply-turn-admission-nEW5QbY5.js +0 -2056
- package/dist/reply.runtime-B4Dgs3Hg.js +0 -2
- package/dist/reset-preserved-selection-CVD1yeVC.js +0 -45
- package/dist/resolve-DidlinMh.js +0 -106
- package/dist/restart-DzTrO95c.js +0 -121
- package/dist/result-fallback-classifier-BqsFUDvP.js +0 -98
- package/dist/root-help-QGs0dCCN.js +0 -43
- package/dist/route-B3R-uzFG.js +0 -475
- package/dist/route-reply-CdfhgIoY.js +0 -174
- package/dist/route-reply.runtime-DwuU2WjH.js +0 -2
- package/dist/routes-ChXmJocl.js +0 -3701
- package/dist/routes-D-ZF4AdA.js +0 -2
- package/dist/run-ClmVDTET.js +0 -1162
- package/dist/run-auth-profile.runtime-CTxrwz0y.js +0 -2
- package/dist/run-command-CqZJQ0Im.js +0 -2
- package/dist/run-command-GClW75NL.js +0 -23
- package/dist/run-context-BOdGeRg5.js +0 -66
- package/dist/run-context.runtime-CwuKVYPj.js +0 -2
- package/dist/run-delivery.runtime-BQ39dm34.js +0 -762
- package/dist/run-embedded.runtime-e1K4Bt1_.js +0 -4
- package/dist/run-execution-cli.runtime-Cjrgt4cV.js +0 -4
- package/dist/run-executor.runtime-C2JE6JGb.js +0 -330
- package/dist/run-model-catalog.runtime-DkrLKopr.js +0 -2
- package/dist/run-session-state-C5YdQs7o.js +0 -159
- package/dist/run-subagent-registry.runtime-Dl_lXi6y.js +0 -2
- package/dist/runner-CNGHdaIg.js +0 -704
- package/dist/runner.entries-dckPkeld.js +0 -1485
- package/dist/runtime-9LxcVCyw.js +0 -615
- package/dist/runtime-BCOtBS5G.js +0 -3
- package/dist/runtime-C-pgjoJr.js +0 -210
- package/dist/runtime-CyF0vJXG.js +0 -10
- package/dist/runtime-D-7lMvGV.js +0 -2
- package/dist/runtime-D17OmF9G.js +0 -224
- package/dist/runtime-D6SweufG.js +0 -245
- package/dist/runtime-DVAM7AFd.js +0 -2
- package/dist/runtime-DX2ClrP-.js +0 -436
- package/dist/runtime-FOOWuiYX.js +0 -300
- package/dist/runtime-api-B0F0JsV1.js +0 -12
- package/dist/runtime-cREKSBYC.js +0 -2
- package/dist/runtime-channel-BmD4hoCR.js +0 -148
- package/dist/runtime-channel-BsebQSPL.js +0 -2
- package/dist/runtime-config-collectors-BjYeQ0Tk.js +0 -525
- package/dist/runtime-embedded-agent.runtime-A4r23Bn8.js +0 -2
- package/dist/runtime-internal-DkV-EMTK.js +0 -2
- package/dist/runtime-llm.runtime-BQKNnuRc.js +0 -307
- package/dist/runtime-model-auth.runtime-BbGqHVM5.js +0 -2
- package/dist/runtime-model-auth.runtime-rtJH4LBB.js +0 -46
- package/dist/runtime-options-B0EGb1Wq.js +0 -275
- package/dist/runtime-plugin-Bdqm44bH.js +0 -92
- package/dist/runtime-plugins-rZk1eAK_.js +0 -32
- package/dist/runtime-plugins.runtime-DApiYzny.js +0 -2
- package/dist/runtime-prepare.runtime-DWxvnbyY.js +0 -81
- package/dist/runtime-provider-B0slPjtk.js +0 -2
- package/dist/runtime-provider-DLgupOKt.js +0 -24
- package/dist/runtime-registry-loader-Cf2HuMjd.js +0 -2
- package/dist/runtime-registry-loader-DLzDrA7e.js +0 -117
- package/dist/runtime-shared-Bg-OiD4u.js +0 -365
- package/dist/runtime-web-channel-plugin-DrMjRaqi.js +0 -204
- package/dist/scan-DA7Oqxuv.js +0 -573
- package/dist/sdk-security-runtime-WjOaCbga.js +0 -86
- package/dist/sdk-setup-tools-DaYT6_jD.js +0 -8
- package/dist/secrets-cli-fJQ0geWO.js +0 -150
- package/dist/security-cli-CJMwGp8U.js +0 -520
- package/dist/selection-BNwLQzqJ.js +0 -3
- package/dist/selection-Cj-l80pO.js +0 -18365
- package/dist/send-DstYcrDW.js +0 -711
- package/dist/send-aTxtLkJm.js +0 -178
- package/dist/send-media-Bl2ryo6a.js +0 -2072
- package/dist/send-qwDMMnM6.js +0 -1222
- package/dist/send-result-BWRKr16H.js +0 -141
- package/dist/server-CMtA1S09.js +0 -24
- package/dist/server-DIRaYiiH.js +0 -72
- package/dist/server-aux-handlers-BRO-9-Jf.js +0 -1347
- package/dist/server-chat-0J_ke0ph.js +0 -827
- package/dist/server-context-DWOSX34k.js +0 -2
- package/dist/server-context-R7MFLFdI.js +0 -955
- package/dist/server-cron-2FuFg2j8.js +0 -2
- package/dist/server-cron-ChPAVQtg.js +0 -3173
- package/dist/server-maintenance-ZvS7Id6T.js +0 -152
- package/dist/server-methods-DSbhPK3k.js +0 -497
- package/dist/server-middleware-CYxFU-e5.js +0 -122
- package/dist/server-model-catalog-B22UhmRr.js +0 -73
- package/dist/server-model-catalog-BJIHPP3P.js +0 -2
- package/dist/server-node-events-tNWJnXQM.js +0 -597
- package/dist/server-plugin-bootstrap-Ccu97zi8.js +0 -71
- package/dist/server-plugins-ByXwKPnj.js +0 -435
- package/dist/server-reload-handlers-ConGiT9Q.js +0 -719
- package/dist/server-restart-sentinel-mPHo61LL.js +0 -700
- package/dist/server-runtime-services-BR1icaUW.js +0 -3
- package/dist/server-runtime-services-Bx8n34dj.js +0 -147
- package/dist/server-runtime-subscriptions-CZklTkRG.js +0 -67
- package/dist/server-session-events-DxdiZYM2.js +0 -244
- package/dist/server-session-key-CYvLslFO.js +0 -75
- package/dist/server-session-key-D9GQut81.js +0 -2
- package/dist/server-startup-config-Byb0vR8j.js +0 -305
- package/dist/server-startup-early-a65fHTQS.js +0 -87
- package/dist/server-startup-memory-ClwzC9jX.js +0 -72
- package/dist/server-startup-plugins-CaBj0Nt2.js +0 -127
- package/dist/server-startup-post-attach-B7TcxkmO.js +0 -793
- package/dist/server-ws-runtime-Cxk_CqMr.js +0 -374
- package/dist/server.impl-CQ6dnx43.js +0 -2622
- package/dist/session-cost-usage-GsYDNvka.js +0 -1600
- package/dist/session-kill-http-CKkxZhhd.js +0 -121
- package/dist/session-log-runtime-Bwc2Oijk.js +0 -1258
- package/dist/session-override-CWbKiXiC.js +0 -134
- package/dist/session-reset-model.runtime-CDFMjwWA.js +0 -144
- package/dist/session-reset-service-SE0aK4cw.js +0 -651
- package/dist/session-status.runtime-Df89I7Fk.js +0 -2
- package/dist/session-store-RkvjJPMQ.js +0 -273
- package/dist/session-store.runtime-C7P5asx7.js +0 -4
- package/dist/session-subagent-reactivation.runtime-BhGUZG1Z.js +0 -2
- package/dist/session-tab-registry-9rSuQ0Yz.js +0 -551
- package/dist/session-utils-De8TIM0h.js +0 -1508
- package/dist/sessions-6b9a00Tl.js +0 -1917
- package/dist/sessions-CEPHczjC.js +0 -316
- package/dist/sessions-CEojHc8b.js +0 -12736
- package/dist/sessions-cleanup-BkG7_sq9.js +0 -165
- package/dist/sessions-history-http-BjJEfjJa.js +0 -432
- package/dist/sessions-patch-PwG5sknc.js +0 -401
- package/dist/sessions-resolve-CSIrd_fi.js +0 -180
- package/dist/sessions-table-8CbU7jXa.js +0 -161
- package/dist/sessions.runtime-BYHMD0M7.js +0 -2
- package/dist/set-BJDpe28W.js +0 -31
- package/dist/set-image-CwTFx7PX.js +0 -17
- package/dist/setup-B6LmeIms.js +0 -614
- package/dist/setup-B_zxHfYu.js +0 -2
- package/dist/setup-onboard-configure-help-fast-path-Bck3SKEH.js +0 -64
- package/dist/setup.finalize-CmLYX-Rf.js +0 -586
- package/dist/setup.gateway-config-H_89Msro.js +0 -281
- package/dist/setup.migration-import-DVzyUjX6.js +0 -2
- package/dist/setup.migration-import-DmJpqoqf.js +0 -200
- package/dist/setup.post-install-migration-WPFWKXXg.js +0 -128
- package/dist/shared-CUhu8NTs.js +0 -5
- package/dist/shared-D-BN2JhY.js +0 -71
- package/dist/shared-ES8nDIcn.js +0 -212
- package/dist/simple-completion-runtime-BGZkWvKr.js +0 -206
- package/dist/simple-completion-runtime-CM_IISYW.js +0 -2
- package/dist/simple-completion-transport-Bo0u9dhp.js +0 -83
- package/dist/snapshot-urls-C1KjRQD5.js +0 -317
- package/dist/speech-core-Bas7e4h0.js +0 -119
- package/dist/speech-provider-BonJQv5S.js +0 -227
- package/dist/speech-provider-CwdKQmDv.js +0 -171
- package/dist/speech-provider-DcQRnYhZ.js +0 -233
- package/dist/stale-oauth-profile-shadows-C3aeAWfv.js +0 -186
- package/dist/stale-oauth-profile-shadows-m5rb8dPc.js +0 -2
- package/dist/standalone-runtime-registry-loader-B9n2LBKC.js +0 -59
- package/dist/startup-context-DY7C4riM.js +0 -314
- package/dist/status-6EPKat7p.js +0 -73
- package/dist/status-C6Fa7Dsf.js +0 -2
- package/dist/status-CNnxDQlM.js +0 -4
- package/dist/status-D2Scvbc0.js +0 -3
- package/dist/status-Ducanro3.js +0 -2
- package/dist/status-_XX_6QVA.js +0 -466
- package/dist/status-all-BP1u6vou.js +0 -573
- package/dist/status-json-DPlOJ_ue.js +0 -15
- package/dist/status-json-command-BT7EwVKj.js +0 -84
- package/dist/status-message-Dzr9-MX-.js +0 -495
- package/dist/status-message.runtime-DFezIt1d.js +0 -6
- package/dist/status-prBlcUV5.js +0 -249
- package/dist/status-queue.runtime-C1bmg2rl.js +0 -2
- package/dist/status-runtime-shared-RjKIPEQ0.js +0 -289
- package/dist/status-subagents.runtime-tsCCe4Ny.js +0 -32
- package/dist/status-text-Bkeyg8Bf.js +0 -301
- package/dist/status.command-D06_4ATq.js +0 -425
- package/dist/status.command-dDEZM84a.js +0 -2
- package/dist/status.command.text-runtime-WH9tP7yg.js +0 -15
- package/dist/status.runtime-B76GaBIR.js +0 -2
- package/dist/status.scan-Bc6clx0F.js +0 -72
- package/dist/status.scan-overview-v_-AaFhC.js +0 -460
- package/dist/status.scan.deps.runtime-BkH1HAb4.js +0 -19
- package/dist/status.scan.fast-json-CrlfKKI3.js +0 -2
- package/dist/status.scan.fast-json-D8v6zfP8.js +0 -163
- package/dist/status.summary-DBhvgOPr.js +0 -276
- package/dist/status.summary-hQV0PKFO.js +0 -2
- package/dist/store-BClomp_4.js +0 -3
- package/dist/store-BHqDPtNw.js +0 -2302
- package/dist/stored-model-override-vm4CtQWX.js +0 -79
- package/dist/subagent-announce-D244Q4w2.js +0 -353
- package/dist/subagent-announce-delivery-qKZfF7Bs.js +0 -1369
- package/dist/subagent-control-c87mVGUE.js +0 -492
- package/dist/subagent-control.runtime-DfQtIsDb.js +0 -3
- package/dist/subagent-hooks-B_UW5Len.js +0 -2
- package/dist/subagent-hooks-CYvFWt_r.js +0 -230
- package/dist/subagent-hooks-api-DZgaJf19.js +0 -23
- package/dist/subagent-registry-BlcoCggo.js +0 -2627
- package/dist/subagent-registry-CuObhNeO.js +0 -3
- package/dist/subagent-session-cleanup-hFF8Z34s.js +0 -390
- package/dist/system-CN_Knfqq.js +0 -111
- package/dist/system-prompt-config-BmZlhYK9.js +0 -918
- package/dist/talk-DrjGczYs.js +0 -2454
- package/dist/target-id-BNpbyWkq.js +0 -107
- package/dist/targets-CQcGo6u4.js +0 -267
- package/dist/targets.runtime-DwcxNI-x.js +0 -2
- package/dist/task-executor-CZg-qt4u.js +0 -349
- package/dist/task-owner-access-Duem5jjb.js +0 -74
- package/dist/task-registry-Cw8pc3Ry.js +0 -2362
- package/dist/task-registry-delivery-runtime-HaiKqj0A.js +0 -2
- package/dist/task-registry.maintenance-BLv3wpK9.js +0 -764
- package/dist/task-registry.maintenance-CvlIcxE-.js +0 -2
- package/dist/task-status-access-C5nDJSI4.js +0 -18
- package/dist/tasks-D3CfEAlq.js +0 -548
- package/dist/tasks-WKnE5fvr.js +0 -153
- package/dist/tasks-audit-system-okJjcOjU.js +0 -210
- package/dist/tasks-json-C-iUgWNu.js +0 -73
- package/dist/tavily-web-search-provider.runtime-jpagljrA.js +0 -112
- package/dist/text-report-BTsF3Pv3.js +0 -695
- package/dist/text-transforms.runtime-CgH_pbcQ.js +0 -113
- package/dist/thread-bindings-BWxpUE9U.js +0 -228
- package/dist/tool-DhJbbm91.js +0 -143
- package/dist/tool-dispatch-CpFUfblu.js +0 -155
- package/dist/tool-images-C-tFlXjE.js +0 -247
- package/dist/tool-plugin-3NejWxZW.js +0 -93
- package/dist/tool-resolution-oW8Cbamd.js +0 -153
- package/dist/tool-result-truncation-CWFGf7Eu.js +0 -498
- package/dist/tool-schema-CMtc7PdZ.js +0 -40
- package/dist/tool-schema-projection-DJRPEEvY.js +0 -215
- package/dist/tool-split-E4RdK5jS.js +0 -323
- package/dist/tools-BAl3JiNw.js +0 -901
- package/dist/tools-DC8tCPxR.js +0 -579
- package/dist/tools-catalog-Dzv9zaBD.js +0 -156
- package/dist/tools-effective-CGvzyIL2.js +0 -442
- package/dist/tools-effective-inventory-GI5N5Q9v.js +0 -379
- package/dist/tools-invoke-CU2U0hNH.js +0 -51
- package/dist/tools-invoke-http-8s3FiUy4.js +0 -68
- package/dist/tools-invoke-shared-DIETrEY7.js +0 -200
- package/dist/tools.runtime-Bnm8CI7w.js +0 -5
- package/dist/transcript-rewrite-Buv2ITw4.js +0 -688
- package/dist/transcripts-tool-BCFlLCFd.js +0 -2
- package/dist/transcripts-tool-CWgNd0Uw.js +0 -656
- package/dist/tts-Aguo4zC5.js +0 -3
- package/dist/tts-Bf77cURn.js +0 -2
- package/dist/tts-DnADOKOP.js +0 -194
- package/dist/tts-runtime-MBSH-nOM.js +0 -1337
- package/dist/tts.runtime-B-NR9osE.js +0 -2
- package/dist/tts.runtime-Bo-QxKgx.js +0 -3
- package/dist/tui-B0CdNmCz.js +0 -4860
- package/dist/tui-ByRcXM3Z.js +0 -2
- package/dist/tui-backend-C52BUoZI.js +0 -256
- package/dist/tui-cli-BQHpZ4n0.js +0 -40
- package/dist/typing-policy-XspVOezC.js +0 -199
- package/dist/usage-BOYwzimH.js +0 -1113
- package/dist/usage-BSmLrVWB.js +0 -623
- package/dist/usage-format-CfzICmvv.js +0 -2
- package/dist/usage-format-DPJKCPic.js +0 -394
- package/dist/video-generation-provider-CdCTztQ7.js +0 -77
- package/dist/video-generation-provider-MUUshUzz.js +0 -325
- package/dist/video-generation-provider-XmzzTa6e.js +0 -297
- package/dist/video-generation-provider-weiQUJE5.js +0 -64
- package/dist/web-fetch-providers.runtime-tD9zqAS2.js +0 -41
- package/dist/web-guarded-fetch-CyhQZ1yD.js +0 -2
- package/dist/web-guarded-fetch-DIXHI-yJ.js +0 -58
- package/dist/web-media-BPnTMYE5.js +0 -4
- package/dist/web-media-DV_tCQiQ.js +0 -2
- package/dist/web-media-DYydVGCK.js +0 -651
- package/dist/web-provider-runtime-shared-h3M6Bqyg.js +0 -142
- package/dist/web-search-provider-common-CEYWuDcp.js +0 -252
- package/dist/web-search-providers.runtime-YrayP296.js +0 -41
- /package/dist/{acp-runtime-backend-CHZtaM6t.js → acp-runtime-backend-B83JR5Zf.js} +0 -0
- /package/dist/{agent-turn-attachments-BYCRK86s.js → agent-turn-attachments-D5uJijuK.js} +0 -0
- /package/dist/{auth-install-policy-t46tJ8jV.js → auth-install-policy-BIpdwrZ9.js} +0 -0
- /package/dist/{cli-backends-BHXnrVN_.js → cli-backends-79CCRQ2a.js} +0 -0
- /package/dist/{command-secret-targets-DZ0J2Wm3.js → command-secret-targets-BOJlcBil.js} +0 -0
- /package/dist/{commands-DWp49Exc.js → commands-Dw9hwmVt.js} +0 -0
- /package/dist/{commands-reset-hooks-MMq2dvff.js → commands-reset-hooks-epArfNOY.js} +0 -0
- /package/dist/{delegate-Dkj_5OvH.js → delegate-Bw8NQXVr.js} +0 -0
- /package/dist/{jobs-BGELIHcx.js → jobs-BIOTaq7l.js} +0 -0
- /package/dist/{kimi-web-search-provider-4PlMYsPx.js → kimi-web-search-provider-Bzg_DiXO.js} +0 -0
- /package/dist/{memory-host-search-Ds9GiNpf.js → memory-host-search-Dph0Mq-v.js} +0 -0
- /package/dist/{minimax-web-search-provider-d5gTJUNg.js → minimax-web-search-provider-CETxDkkI.js} +0 -0
- /package/dist/{model-selection-cli-CO6BHPiL.js → model-selection-cli-DizUvxeY.js} +0 -0
- /package/dist/{provider-auth-choice-preference-f7Us6TQL.js → provider-auth-choice-preference-uJn1811S.js} +0 -0
- /package/dist/{runtime-wfO9bV5y.js → runtime-BEVbpIgZ.js} +0 -0
- /package/dist/{runtime-web-tools-B6vr1LZs.js → runtime-web-tools-Bf0aEe-F.js} +0 -0
- /package/dist/{runtime-web-tools-fallback.runtime-Crs7KfH5.js → runtime-web-tools-fallback.runtime-DU6rTj6l.js} +0 -0
- /package/dist/{session-subagent-reactivation-H5Rdwkyy.js → session-subagent-reactivation-Bb5SCi9J.js} +0 -0
- /package/dist/{tavily-web-search-provider-DbdIzpMv.js → tavily-web-search-provider-CIEhV60D.js} +0 -0
|
@@ -1,2362 +0,0 @@
|
|
|
1
|
-
import { c as normalizeOptionalString } from "./string-coerce-DKw2K5wM.js";
|
|
2
|
-
import { i as formatErrorMessage } from "./errors-5ePGD43N.js";
|
|
3
|
-
import { _ as uniqueStrings } from "./string-normalization-B8G0vlWE.js";
|
|
4
|
-
import { c as isRecord } from "./utils-v5zGdVpj.js";
|
|
5
|
-
import { t as createSubsystemLogger } from "./subsystem-46gngkCY.js";
|
|
6
|
-
import { c as parseAgentSessionKey } from "./session-key-utils-CdfsDYvz.js";
|
|
7
|
-
import { t as isDeliverableMessageChannel } from "./message-channel-normalize-CaOaCinb.js";
|
|
8
|
-
import "./message-channel-DcN_7tYD.js";
|
|
9
|
-
import { a as executeSqliteQuerySync, n as openFengMingStateDatabase, r as runFengMingStateWriteTransaction, s as getNodeSqliteKysely, t as closeFengMingStateDatabase } from "./fengming-state-db-mqVzOq_B.js";
|
|
10
|
-
import { l as onAgentEvent } from "./agent-events-Dl8p_DjC.js";
|
|
11
|
-
import { o as normalizeDeliveryContext } from "./delivery-context.shared-CHlZnq4E.js";
|
|
12
|
-
import { t as buildAgentRunTerminalOutcome } from "./agent-run-terminal-outcome-uM9dOCUm.js";
|
|
13
|
-
import { n as shouldRouteCompletionThroughRequesterSession } from "./completion-delivery-policy-DYmzT9ZJ.js";
|
|
14
|
-
import { o as requestHeartbeat } from "./heartbeat-wake-D8JKi1wr.js";
|
|
15
|
-
import { a as enqueueSystemEvent } from "./system-events-DviB_CZO.js";
|
|
16
|
-
import { a as sanitizeTaskStatusText, i as formatTaskStatusTitleText } from "./task-status-DXRO3mCX.js";
|
|
17
|
-
import { n as resolveTaskCleanupAfter } from "./task-retention-DxawMBrm.js";
|
|
18
|
-
import { createRequire } from "node:module";
|
|
19
|
-
import "node:fs";
|
|
20
|
-
import crypto from "node:crypto";
|
|
21
|
-
const CODEX_NATIVE_SUBAGENT_RUN_ID_PREFIX = "codex-thread:";
|
|
22
|
-
const CODEX_NATIVE_SUBAGENT_STALE_ERROR = "Codex native subagent stopped reporting progress";
|
|
23
|
-
function isChildlessCodexNativeSubagentTask(task) {
|
|
24
|
-
if (task.runtime !== "subagent" || task.taskKind !== "codex-native") return false;
|
|
25
|
-
if (task.childSessionKey?.trim()) return false;
|
|
26
|
-
return [task.sourceId, task.runId].some((candidate) => candidate?.trim().startsWith(CODEX_NATIVE_SUBAGENT_RUN_ID_PREFIX));
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/tasks/task-executor-policy.ts
|
|
30
|
-
function isTerminalTaskStatus(status) {
|
|
31
|
-
return status === "succeeded" || status === "failed" || status === "timed_out" || status === "cancelled" || status === "lost";
|
|
32
|
-
}
|
|
33
|
-
function resolveTaskDisplayTitle(task) {
|
|
34
|
-
return formatTaskStatusTitleText(task.label?.trim() || (task.runtime === "acp" ? "ACP background task" : task.runtime === "subagent" ? "Subagent task" : task.task.trim() || "Background task"));
|
|
35
|
-
}
|
|
36
|
-
function resolveTaskRunLabel(task) {
|
|
37
|
-
return task.runId ? ` (run ${task.runId.slice(0, 8)})` : "";
|
|
38
|
-
}
|
|
39
|
-
function formatTaskTerminalMessage(task, options = {}) {
|
|
40
|
-
const title = resolveTaskDisplayTitle(task);
|
|
41
|
-
const runLabel = resolveTaskRunLabel(task);
|
|
42
|
-
const summary = sanitizeTaskStatusText(task.terminalSummary, { errorContext: task.status !== "succeeded" || task.terminalOutcome === "blocked" });
|
|
43
|
-
if (task.status === "succeeded") {
|
|
44
|
-
if (task.terminalOutcome === "blocked") return summary ? `Background task blocked: ${title}${runLabel}. ${summary}` : `Background task blocked: ${title}${runLabel}.`;
|
|
45
|
-
if (options.surface === "parent_session") {
|
|
46
|
-
const reviewNext = "Next: parent will review/verify before calling it done.";
|
|
47
|
-
return summary ? `Background task ready for review: ${title}${runLabel}. ${summary} ${reviewNext}` : `Background task ready for review: ${title}${runLabel}. ${reviewNext}`;
|
|
48
|
-
}
|
|
49
|
-
return summary ? `Background task done: ${title}${runLabel}. ${summary}` : `Background task done: ${title}${runLabel}.`;
|
|
50
|
-
}
|
|
51
|
-
if (task.status === "timed_out") return `Background task timed out: ${title}${runLabel}.`;
|
|
52
|
-
if (task.status === "lost") {
|
|
53
|
-
const error = sanitizeTaskStatusText(task.error, { errorContext: true });
|
|
54
|
-
const fallbackSummary = sanitizeTaskStatusText(task.terminalSummary, { errorContext: true });
|
|
55
|
-
return `Background task lost: ${title}${runLabel}. ${error || fallbackSummary || "Backing session disappeared."}`;
|
|
56
|
-
}
|
|
57
|
-
if (task.status === "cancelled") return `Background task cancelled: ${title}${runLabel}.`;
|
|
58
|
-
const error = sanitizeTaskStatusText(task.error, { errorContext: true });
|
|
59
|
-
const fallbackSummary = sanitizeTaskStatusText(task.terminalSummary, { errorContext: true });
|
|
60
|
-
return error ? `Background task failed: ${title}${runLabel}. ${error}` : fallbackSummary ? `Background task failed: ${title}${runLabel}. ${fallbackSummary}` : `Background task failed: ${title}${runLabel}.`;
|
|
61
|
-
}
|
|
62
|
-
function shouldUseParentReviewTaskTerminalMessage(task) {
|
|
63
|
-
return task.runtime === "acp" && task.status === "succeeded" && task.terminalOutcome !== "blocked" && Boolean(task.childSessionKey?.trim());
|
|
64
|
-
}
|
|
65
|
-
function formatTaskBlockedFollowupMessage(task) {
|
|
66
|
-
if (task.status !== "succeeded" || task.terminalOutcome !== "blocked") return null;
|
|
67
|
-
return `Task needs follow-up: ${resolveTaskDisplayTitle(task)}${resolveTaskRunLabel(task)}. ${sanitizeTaskStatusText(task.terminalSummary, { errorContext: true }) || "Task is blocked and needs follow-up."}`;
|
|
68
|
-
}
|
|
69
|
-
function formatTaskStateChangeMessage(task, event) {
|
|
70
|
-
const title = resolveTaskDisplayTitle(task);
|
|
71
|
-
if (event.kind === "running") return `Background task started: ${title}.`;
|
|
72
|
-
if (event.kind === "progress") {
|
|
73
|
-
const summary = sanitizeTaskStatusText(event.summary);
|
|
74
|
-
return summary ? `Background task update: ${title}. ${summary}` : null;
|
|
75
|
-
}
|
|
76
|
-
return null;
|
|
77
|
-
}
|
|
78
|
-
function shouldAutoDeliverTaskTerminalUpdate(task) {
|
|
79
|
-
if (task.notifyPolicy === "silent") return false;
|
|
80
|
-
if (task.runtime === "subagent" && task.status !== "cancelled") return false;
|
|
81
|
-
if (!isTerminalTaskStatus(task.status)) return false;
|
|
82
|
-
return task.deliveryStatus === "pending";
|
|
83
|
-
}
|
|
84
|
-
function shouldAutoDeliverTaskStateChange(task) {
|
|
85
|
-
return task.notifyPolicy === "state_changes" && task.deliveryStatus === "pending" && !isTerminalTaskStatus(task.status);
|
|
86
|
-
}
|
|
87
|
-
function shouldSuppressDuplicateTerminalDelivery(params) {
|
|
88
|
-
if (params.task.runtime !== "acp" || !params.task.runId?.trim()) return false;
|
|
89
|
-
return Boolean(params.preferredTaskId && params.preferredTaskId !== params.task.taskId);
|
|
90
|
-
}
|
|
91
|
-
//#endregion
|
|
92
|
-
//#region src/tasks/task-flow-registry.types.ts
|
|
93
|
-
const TASK_FLOW_SYNC_MODES = new Set(["task_mirrored", "managed"]);
|
|
94
|
-
const TASK_FLOW_STATUSES = new Set([
|
|
95
|
-
"queued",
|
|
96
|
-
"running",
|
|
97
|
-
"waiting",
|
|
98
|
-
"blocked",
|
|
99
|
-
"succeeded",
|
|
100
|
-
"failed",
|
|
101
|
-
"cancelled",
|
|
102
|
-
"lost"
|
|
103
|
-
]);
|
|
104
|
-
function parsePersistedFlowValue(value, values, label) {
|
|
105
|
-
if (typeof value === "string" && values.has(value)) return value;
|
|
106
|
-
throw new Error(`Invalid persisted task flow ${label}: ${JSON.stringify(value)}`);
|
|
107
|
-
}
|
|
108
|
-
function parseOptionalTaskFlowSyncMode(value) {
|
|
109
|
-
if (value == null || value === "") return;
|
|
110
|
-
return parsePersistedFlowValue(value, TASK_FLOW_SYNC_MODES, "sync mode");
|
|
111
|
-
}
|
|
112
|
-
function parseTaskFlowStatus(value) {
|
|
113
|
-
return parsePersistedFlowValue(value, TASK_FLOW_STATUSES, "status");
|
|
114
|
-
}
|
|
115
|
-
//#endregion
|
|
116
|
-
//#region src/tasks/task-registry.sqlite.shared.ts
|
|
117
|
-
function parseSqliteJsonValue(raw) {
|
|
118
|
-
if (!raw?.trim()) return;
|
|
119
|
-
try {
|
|
120
|
-
return JSON.parse(raw);
|
|
121
|
-
} catch {
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
function parseDeliveryContextJson(raw) {
|
|
126
|
-
const parsed = parseSqliteJsonValue(raw);
|
|
127
|
-
if (!isRecord(parsed)) return;
|
|
128
|
-
return normalizeDeliveryContext({
|
|
129
|
-
channel: typeof parsed.channel === "string" ? parsed.channel : void 0,
|
|
130
|
-
to: typeof parsed.to === "string" ? parsed.to : void 0,
|
|
131
|
-
accountId: typeof parsed.accountId === "string" ? parsed.accountId : void 0,
|
|
132
|
-
threadId: typeof parsed.threadId === "string" || typeof parsed.threadId === "number" ? parsed.threadId : void 0
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
//#endregion
|
|
136
|
-
//#region src/tasks/task-registry.types.ts
|
|
137
|
-
const TASK_RUNTIMES = new Set([
|
|
138
|
-
"subagent",
|
|
139
|
-
"acp",
|
|
140
|
-
"cli",
|
|
141
|
-
"cron"
|
|
142
|
-
]);
|
|
143
|
-
const TASK_STATUSES = new Set([
|
|
144
|
-
"queued",
|
|
145
|
-
"running",
|
|
146
|
-
"succeeded",
|
|
147
|
-
"failed",
|
|
148
|
-
"timed_out",
|
|
149
|
-
"cancelled",
|
|
150
|
-
"lost"
|
|
151
|
-
]);
|
|
152
|
-
const TASK_DELIVERY_STATUSES = new Set([
|
|
153
|
-
"pending",
|
|
154
|
-
"delivered",
|
|
155
|
-
"session_queued",
|
|
156
|
-
"failed",
|
|
157
|
-
"parent_missing",
|
|
158
|
-
"not_applicable"
|
|
159
|
-
]);
|
|
160
|
-
const TASK_NOTIFY_POLICIES = new Set([
|
|
161
|
-
"done_only",
|
|
162
|
-
"state_changes",
|
|
163
|
-
"silent"
|
|
164
|
-
]);
|
|
165
|
-
const TASK_TERMINAL_OUTCOMES = new Set(["succeeded", "blocked"]);
|
|
166
|
-
const TASK_SCOPE_KINDS = new Set(["session", "system"]);
|
|
167
|
-
function parsePersistedTaskValue(value, values, label) {
|
|
168
|
-
if (typeof value === "string" && values.has(value)) return value;
|
|
169
|
-
throw new Error(`Invalid persisted task ${label}: ${JSON.stringify(value)}`);
|
|
170
|
-
}
|
|
171
|
-
function parseTaskRuntime(value) {
|
|
172
|
-
return parsePersistedTaskValue(value, TASK_RUNTIMES, "runtime");
|
|
173
|
-
}
|
|
174
|
-
function parseTaskStatus(value) {
|
|
175
|
-
return parsePersistedTaskValue(value, TASK_STATUSES, "status");
|
|
176
|
-
}
|
|
177
|
-
function parseTaskDeliveryStatus(value) {
|
|
178
|
-
return parsePersistedTaskValue(value, TASK_DELIVERY_STATUSES, "delivery status");
|
|
179
|
-
}
|
|
180
|
-
function parseTaskNotifyPolicy(value) {
|
|
181
|
-
return parsePersistedTaskValue(value, TASK_NOTIFY_POLICIES, "notify policy");
|
|
182
|
-
}
|
|
183
|
-
function parseTaskScopeKind(value) {
|
|
184
|
-
return parsePersistedTaskValue(value, TASK_SCOPE_KINDS, "scope kind");
|
|
185
|
-
}
|
|
186
|
-
function parseOptionalTaskTerminalOutcome(value) {
|
|
187
|
-
if (value == null || value === "") return;
|
|
188
|
-
return parsePersistedTaskValue(value, TASK_TERMINAL_OUTCOMES, "terminal outcome");
|
|
189
|
-
}
|
|
190
|
-
//#endregion
|
|
191
|
-
//#region src/tasks/task-flow-registry.store.sqlite.ts
|
|
192
|
-
let cachedDatabase$1 = null;
|
|
193
|
-
function normalizeNumber$1(value) {
|
|
194
|
-
if (typeof value === "bigint") return Number(value);
|
|
195
|
-
return typeof value === "number" ? value : void 0;
|
|
196
|
-
}
|
|
197
|
-
function serializeJson$1(value) {
|
|
198
|
-
return value === void 0 ? null : JSON.stringify(value);
|
|
199
|
-
}
|
|
200
|
-
function parseJsonValue(raw) {
|
|
201
|
-
if (!raw?.trim()) return;
|
|
202
|
-
try {
|
|
203
|
-
return JSON.parse(raw);
|
|
204
|
-
} catch {
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
function rowToSyncMode(row) {
|
|
209
|
-
const syncMode = parseOptionalTaskFlowSyncMode(row.sync_mode);
|
|
210
|
-
if (syncMode) return syncMode;
|
|
211
|
-
return row.shape === "single_task" ? "task_mirrored" : "managed";
|
|
212
|
-
}
|
|
213
|
-
function rowToFlowRecord(row) {
|
|
214
|
-
const endedAt = normalizeNumber$1(row.ended_at);
|
|
215
|
-
const cancelRequestedAt = normalizeNumber$1(row.cancel_requested_at);
|
|
216
|
-
const requesterOrigin = parseDeliveryContextJson(row.requester_origin_json);
|
|
217
|
-
const stateJson = parseJsonValue(row.state_json);
|
|
218
|
-
const waitJson = parseJsonValue(row.wait_json);
|
|
219
|
-
return {
|
|
220
|
-
flowId: row.flow_id,
|
|
221
|
-
syncMode: rowToSyncMode(row),
|
|
222
|
-
ownerKey: row.owner_key,
|
|
223
|
-
...requesterOrigin ? { requesterOrigin } : {},
|
|
224
|
-
...row.controller_id ? { controllerId: row.controller_id } : {},
|
|
225
|
-
revision: normalizeNumber$1(row.revision) ?? 0,
|
|
226
|
-
status: parseTaskFlowStatus(row.status),
|
|
227
|
-
notifyPolicy: parseTaskNotifyPolicy(row.notify_policy),
|
|
228
|
-
goal: row.goal,
|
|
229
|
-
...row.current_step ? { currentStep: row.current_step } : {},
|
|
230
|
-
...row.blocked_task_id ? { blockedTaskId: row.blocked_task_id } : {},
|
|
231
|
-
...row.blocked_summary ? { blockedSummary: row.blocked_summary } : {},
|
|
232
|
-
...stateJson !== void 0 ? { stateJson } : {},
|
|
233
|
-
...waitJson !== void 0 ? { waitJson } : {},
|
|
234
|
-
...cancelRequestedAt != null ? { cancelRequestedAt } : {},
|
|
235
|
-
createdAt: normalizeNumber$1(row.created_at) ?? 0,
|
|
236
|
-
updatedAt: normalizeNumber$1(row.updated_at) ?? 0,
|
|
237
|
-
...endedAt != null ? { endedAt } : {}
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
function bindFlowRecord(record) {
|
|
241
|
-
return {
|
|
242
|
-
flow_id: record.flowId,
|
|
243
|
-
sync_mode: record.syncMode,
|
|
244
|
-
shape: null,
|
|
245
|
-
owner_key: record.ownerKey,
|
|
246
|
-
requester_origin_json: serializeJson$1(record.requesterOrigin),
|
|
247
|
-
controller_id: record.controllerId ?? null,
|
|
248
|
-
revision: record.revision,
|
|
249
|
-
status: record.status,
|
|
250
|
-
notify_policy: record.notifyPolicy,
|
|
251
|
-
goal: record.goal,
|
|
252
|
-
current_step: record.currentStep ?? null,
|
|
253
|
-
blocked_task_id: record.blockedTaskId ?? null,
|
|
254
|
-
blocked_summary: record.blockedSummary ?? null,
|
|
255
|
-
state_json: serializeJson$1(record.stateJson),
|
|
256
|
-
wait_json: serializeJson$1(record.waitJson),
|
|
257
|
-
cancel_requested_at: record.cancelRequestedAt ?? null,
|
|
258
|
-
created_at: record.createdAt,
|
|
259
|
-
updated_at: record.updatedAt,
|
|
260
|
-
ended_at: record.endedAt ?? null
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
function getFlowRegistryKysely(db) {
|
|
264
|
-
return getNodeSqliteKysely(db);
|
|
265
|
-
}
|
|
266
|
-
function pruneFlowsNotInSnapshot(params) {
|
|
267
|
-
const tempTableName = "fengming_live_flow_ids";
|
|
268
|
-
params.db.exec(`CREATE TEMP TABLE IF NOT EXISTS ${tempTableName} (id TEXT PRIMARY KEY)`);
|
|
269
|
-
params.db.exec(`DELETE FROM ${tempTableName}`);
|
|
270
|
-
const insert = params.db.prepare(`INSERT OR IGNORE INTO ${tempTableName} (id) VALUES (?)`);
|
|
271
|
-
for (const id of params.ids) insert.run(id);
|
|
272
|
-
params.db.exec(`
|
|
273
|
-
DELETE FROM flow_runs
|
|
274
|
-
WHERE NOT EXISTS (
|
|
275
|
-
SELECT 1 FROM ${tempTableName}
|
|
276
|
-
WHERE ${tempTableName}.id = flow_runs.flow_id
|
|
277
|
-
)
|
|
278
|
-
`);
|
|
279
|
-
params.db.exec(`DELETE FROM ${tempTableName}`);
|
|
280
|
-
}
|
|
281
|
-
function selectFlowRows(db) {
|
|
282
|
-
return executeSqliteQuerySync(db, getFlowRegistryKysely(db).selectFrom("flow_runs").select([
|
|
283
|
-
"flow_id",
|
|
284
|
-
"sync_mode",
|
|
285
|
-
"shape",
|
|
286
|
-
"owner_key",
|
|
287
|
-
"requester_origin_json",
|
|
288
|
-
"controller_id",
|
|
289
|
-
"revision",
|
|
290
|
-
"status",
|
|
291
|
-
"notify_policy",
|
|
292
|
-
"goal",
|
|
293
|
-
"current_step",
|
|
294
|
-
"blocked_task_id",
|
|
295
|
-
"blocked_summary",
|
|
296
|
-
"state_json",
|
|
297
|
-
"wait_json",
|
|
298
|
-
"cancel_requested_at",
|
|
299
|
-
"created_at",
|
|
300
|
-
"updated_at",
|
|
301
|
-
"ended_at"
|
|
302
|
-
]).orderBy("created_at", "asc").orderBy("flow_id", "asc")).rows;
|
|
303
|
-
}
|
|
304
|
-
function upsertFlowRow(db, row) {
|
|
305
|
-
executeSqliteQuerySync(db, getFlowRegistryKysely(db).insertInto("flow_runs").values(row).onConflict((conflict) => conflict.column("flow_id").doUpdateSet({
|
|
306
|
-
sync_mode: (eb) => eb.ref("excluded.sync_mode"),
|
|
307
|
-
owner_key: (eb) => eb.ref("excluded.owner_key"),
|
|
308
|
-
requester_origin_json: (eb) => eb.ref("excluded.requester_origin_json"),
|
|
309
|
-
controller_id: (eb) => eb.ref("excluded.controller_id"),
|
|
310
|
-
revision: (eb) => eb.ref("excluded.revision"),
|
|
311
|
-
status: (eb) => eb.ref("excluded.status"),
|
|
312
|
-
notify_policy: (eb) => eb.ref("excluded.notify_policy"),
|
|
313
|
-
goal: (eb) => eb.ref("excluded.goal"),
|
|
314
|
-
current_step: (eb) => eb.ref("excluded.current_step"),
|
|
315
|
-
blocked_task_id: (eb) => eb.ref("excluded.blocked_task_id"),
|
|
316
|
-
blocked_summary: (eb) => eb.ref("excluded.blocked_summary"),
|
|
317
|
-
state_json: (eb) => eb.ref("excluded.state_json"),
|
|
318
|
-
wait_json: (eb) => eb.ref("excluded.wait_json"),
|
|
319
|
-
cancel_requested_at: (eb) => eb.ref("excluded.cancel_requested_at"),
|
|
320
|
-
created_at: (eb) => eb.ref("excluded.created_at"),
|
|
321
|
-
updated_at: (eb) => eb.ref("excluded.updated_at"),
|
|
322
|
-
ended_at: (eb) => eb.ref("excluded.ended_at")
|
|
323
|
-
})));
|
|
324
|
-
}
|
|
325
|
-
function openFlowRegistryDatabase() {
|
|
326
|
-
const database = openFengMingStateDatabase();
|
|
327
|
-
const pathname = database.path;
|
|
328
|
-
if (cachedDatabase$1 && cachedDatabase$1.path === pathname && cachedDatabase$1.db.isOpen) return cachedDatabase$1;
|
|
329
|
-
if (cachedDatabase$1 && !cachedDatabase$1.db.isOpen) cachedDatabase$1 = null;
|
|
330
|
-
cachedDatabase$1 = {
|
|
331
|
-
db: database.db,
|
|
332
|
-
path: pathname
|
|
333
|
-
};
|
|
334
|
-
return cachedDatabase$1;
|
|
335
|
-
}
|
|
336
|
-
function withWriteTransaction$1(write) {
|
|
337
|
-
const database = openFlowRegistryDatabase();
|
|
338
|
-
runFengMingStateWriteTransaction(() => {
|
|
339
|
-
write(database);
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
function loadTaskFlowRegistryStateFromSqlite() {
|
|
343
|
-
const { db } = openFlowRegistryDatabase();
|
|
344
|
-
const rows = selectFlowRows(db);
|
|
345
|
-
return { flows: new Map(rows.map((row) => [row.flow_id, rowToFlowRecord(row)])) };
|
|
346
|
-
}
|
|
347
|
-
function saveTaskFlowRegistryStateToSqlite(snapshot) {
|
|
348
|
-
withWriteTransaction$1(({ db }) => {
|
|
349
|
-
const kysely = getFlowRegistryKysely(db);
|
|
350
|
-
const flowIds = [...snapshot.flows.keys()];
|
|
351
|
-
if (flowIds.length === 0) {
|
|
352
|
-
executeSqliteQuerySync(db, kysely.deleteFrom("flow_runs"));
|
|
353
|
-
return;
|
|
354
|
-
}
|
|
355
|
-
pruneFlowsNotInSnapshot({
|
|
356
|
-
db,
|
|
357
|
-
ids: flowIds
|
|
358
|
-
});
|
|
359
|
-
for (const flow of snapshot.flows.values()) upsertFlowRow(db, bindFlowRecord(flow));
|
|
360
|
-
});
|
|
361
|
-
}
|
|
362
|
-
function upsertTaskFlowRegistryRecordToSqlite(flow) {
|
|
363
|
-
withWriteTransaction$1(({ db }) => {
|
|
364
|
-
upsertFlowRow(db, bindFlowRecord(flow));
|
|
365
|
-
});
|
|
366
|
-
}
|
|
367
|
-
function deleteTaskFlowRegistryRecordFromSqlite(flowId) {
|
|
368
|
-
withWriteTransaction$1(({ db }) => {
|
|
369
|
-
executeSqliteQuerySync(db, getFlowRegistryKysely(db).deleteFrom("flow_runs").where("flow_id", "=", flowId));
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
function closeTaskFlowRegistryDatabase() {
|
|
373
|
-
cachedDatabase$1 = null;
|
|
374
|
-
closeFengMingStateDatabase();
|
|
375
|
-
}
|
|
376
|
-
let configuredFlowRegistryStore = {
|
|
377
|
-
loadSnapshot: loadTaskFlowRegistryStateFromSqlite,
|
|
378
|
-
saveSnapshot: saveTaskFlowRegistryStateToSqlite,
|
|
379
|
-
upsertFlow: upsertTaskFlowRegistryRecordToSqlite,
|
|
380
|
-
deleteFlow: deleteTaskFlowRegistryRecordFromSqlite,
|
|
381
|
-
close: closeTaskFlowRegistryDatabase
|
|
382
|
-
};
|
|
383
|
-
let configuredFlowRegistryObservers = null;
|
|
384
|
-
function getTaskFlowRegistryStore() {
|
|
385
|
-
return configuredFlowRegistryStore;
|
|
386
|
-
}
|
|
387
|
-
function getTaskFlowRegistryObservers() {
|
|
388
|
-
return configuredFlowRegistryObservers;
|
|
389
|
-
}
|
|
390
|
-
//#endregion
|
|
391
|
-
//#region src/tasks/task-flow-registry.ts
|
|
392
|
-
const log$1 = createSubsystemLogger("tasks/task-flow-registry");
|
|
393
|
-
const flows = /* @__PURE__ */ new Map();
|
|
394
|
-
let restoreAttempted$1 = false;
|
|
395
|
-
let restoreFailureMessage = null;
|
|
396
|
-
function cloneStructuredValue(value) {
|
|
397
|
-
if (value === void 0) return;
|
|
398
|
-
return structuredClone(value);
|
|
399
|
-
}
|
|
400
|
-
function cloneFlowRecord(record) {
|
|
401
|
-
return {
|
|
402
|
-
...record,
|
|
403
|
-
...record.requesterOrigin ? { requesterOrigin: cloneStructuredValue(record.requesterOrigin) } : {},
|
|
404
|
-
...record.stateJson !== void 0 ? { stateJson: cloneStructuredValue(record.stateJson) } : {},
|
|
405
|
-
...record.waitJson !== void 0 ? { waitJson: cloneStructuredValue(record.waitJson) } : {}
|
|
406
|
-
};
|
|
407
|
-
}
|
|
408
|
-
function normalizeRestoredFlowRecord(record) {
|
|
409
|
-
const syncMode = record.syncMode === "task_mirrored" ? "task_mirrored" : "managed";
|
|
410
|
-
const controllerId = syncMode === "managed" ? normalizeOptionalString(record.controllerId) ?? "core/legacy-restored" : void 0;
|
|
411
|
-
return {
|
|
412
|
-
...record,
|
|
413
|
-
syncMode,
|
|
414
|
-
ownerKey: assertFlowOwnerKey(record.ownerKey),
|
|
415
|
-
...record.requesterOrigin ? { requesterOrigin: cloneStructuredValue(record.requesterOrigin) } : {},
|
|
416
|
-
...controllerId ? { controllerId } : {},
|
|
417
|
-
currentStep: normalizeOptionalString(record.currentStep),
|
|
418
|
-
blockedTaskId: normalizeOptionalString(record.blockedTaskId),
|
|
419
|
-
blockedSummary: normalizeOptionalString(record.blockedSummary),
|
|
420
|
-
...record.stateJson !== void 0 ? { stateJson: cloneStructuredValue(record.stateJson) } : {},
|
|
421
|
-
...record.waitJson !== void 0 ? { waitJson: cloneStructuredValue(record.waitJson) } : {},
|
|
422
|
-
revision: Math.max(0, record.revision),
|
|
423
|
-
cancelRequestedAt: record.cancelRequestedAt ?? void 0,
|
|
424
|
-
endedAt: record.endedAt ?? void 0
|
|
425
|
-
};
|
|
426
|
-
}
|
|
427
|
-
function snapshotFlowRecords(source) {
|
|
428
|
-
return [...source.values()].map((record) => cloneFlowRecord(record));
|
|
429
|
-
}
|
|
430
|
-
function emitFlowRegistryObserverEvent(createEvent) {
|
|
431
|
-
const observers = getTaskFlowRegistryObservers();
|
|
432
|
-
if (!observers?.onEvent) return;
|
|
433
|
-
try {
|
|
434
|
-
observers.onEvent(createEvent());
|
|
435
|
-
} catch {}
|
|
436
|
-
}
|
|
437
|
-
function ensureNotifyPolicy$1(notifyPolicy) {
|
|
438
|
-
return notifyPolicy ?? "done_only";
|
|
439
|
-
}
|
|
440
|
-
function normalizeJsonBlob(value) {
|
|
441
|
-
return value === void 0 ? void 0 : cloneStructuredValue(value);
|
|
442
|
-
}
|
|
443
|
-
function assertFlowOwnerKey(ownerKey) {
|
|
444
|
-
const normalized = normalizeOptionalString(ownerKey);
|
|
445
|
-
if (!normalized) throw new Error("需要 Flow ownerKey");
|
|
446
|
-
return normalized;
|
|
447
|
-
}
|
|
448
|
-
function assertControllerId(controllerId) {
|
|
449
|
-
const normalized = normalizeOptionalString(controllerId);
|
|
450
|
-
if (!normalized) throw new Error("需要受管流 controllerId");
|
|
451
|
-
return normalized;
|
|
452
|
-
}
|
|
453
|
-
function resolveFlowBlockedSummary(task) {
|
|
454
|
-
if (task.status !== "succeeded" || task.terminalOutcome !== "blocked") return;
|
|
455
|
-
return normalizeOptionalString(task.terminalSummary) ?? normalizeOptionalString(task.progressSummary);
|
|
456
|
-
}
|
|
457
|
-
function deriveTaskFlowStatusFromTask(task) {
|
|
458
|
-
if (task.status === "queued") return "queued";
|
|
459
|
-
if (task.status === "running") return "running";
|
|
460
|
-
if (task.status === "succeeded") return task.terminalOutcome === "blocked" ? "blocked" : "succeeded";
|
|
461
|
-
if (task.status === "cancelled") return "cancelled";
|
|
462
|
-
if (task.status === "lost") return "lost";
|
|
463
|
-
return "failed";
|
|
464
|
-
}
|
|
465
|
-
function isTerminalTaskFlowStatus(status) {
|
|
466
|
-
return status === "succeeded" || status === "blocked" || status === "failed" || status === "cancelled" || status === "lost";
|
|
467
|
-
}
|
|
468
|
-
function resolveTaskMirroredFlowTiming(task, isTerminal) {
|
|
469
|
-
if (!isTerminal) return { updatedAt: task.lastEventAt ?? task.createdAt };
|
|
470
|
-
const endedAt = task.endedAt ?? task.lastEventAt ?? task.createdAt;
|
|
471
|
-
return {
|
|
472
|
-
updatedAt: endedAt,
|
|
473
|
-
endedAt
|
|
474
|
-
};
|
|
475
|
-
}
|
|
476
|
-
function ensureFlowRegistryReady() {
|
|
477
|
-
if (restoreAttempted$1) return;
|
|
478
|
-
restoreAttempted$1 = true;
|
|
479
|
-
try {
|
|
480
|
-
const restored = getTaskFlowRegistryStore().loadSnapshot();
|
|
481
|
-
flows.clear();
|
|
482
|
-
for (const [flowId, flow] of restored.flows) flows.set(flowId, normalizeRestoredFlowRecord(flow));
|
|
483
|
-
restoreFailureMessage = null;
|
|
484
|
-
} catch (error) {
|
|
485
|
-
flows.clear();
|
|
486
|
-
restoreFailureMessage = formatErrorMessage(error);
|
|
487
|
-
log$1.warn("Failed to restore task-flow registry", { error });
|
|
488
|
-
return;
|
|
489
|
-
}
|
|
490
|
-
emitFlowRegistryObserverEvent(() => ({
|
|
491
|
-
kind: "restored",
|
|
492
|
-
flows: snapshotFlowRecords(flows)
|
|
493
|
-
}));
|
|
494
|
-
}
|
|
495
|
-
function getTaskFlowRegistryRestoreFailure() {
|
|
496
|
-
ensureFlowRegistryReady();
|
|
497
|
-
return restoreFailureMessage;
|
|
498
|
-
}
|
|
499
|
-
function persistFlowRegistry() {
|
|
500
|
-
getTaskFlowRegistryStore().saveSnapshot({ flows: new Map(snapshotFlowRecords(flows).map((flow) => [flow.flowId, flow])) });
|
|
501
|
-
}
|
|
502
|
-
function persistFlowUpsert(flow) {
|
|
503
|
-
const store = getTaskFlowRegistryStore();
|
|
504
|
-
if (store.upsertFlow) {
|
|
505
|
-
store.upsertFlow(cloneFlowRecord(flow));
|
|
506
|
-
return;
|
|
507
|
-
}
|
|
508
|
-
persistFlowRegistry();
|
|
509
|
-
}
|
|
510
|
-
function persistFlowDelete(flowId) {
|
|
511
|
-
const store = getTaskFlowRegistryStore();
|
|
512
|
-
if (store.deleteFlow) {
|
|
513
|
-
store.deleteFlow(flowId);
|
|
514
|
-
return;
|
|
515
|
-
}
|
|
516
|
-
persistFlowRegistry();
|
|
517
|
-
}
|
|
518
|
-
function buildFlowRecord(params) {
|
|
519
|
-
const now = params.createdAt ?? Date.now();
|
|
520
|
-
const syncMode = params.syncMode ?? "managed";
|
|
521
|
-
const controllerId = syncMode === "managed" ? assertControllerId(params.controllerId) : void 0;
|
|
522
|
-
return {
|
|
523
|
-
flowId: crypto.randomUUID(),
|
|
524
|
-
syncMode,
|
|
525
|
-
ownerKey: assertFlowOwnerKey(params.ownerKey),
|
|
526
|
-
...params.requesterOrigin ? { requesterOrigin: cloneStructuredValue(params.requesterOrigin) } : {},
|
|
527
|
-
...controllerId ? { controllerId } : {},
|
|
528
|
-
revision: Math.max(0, params.revision ?? 0),
|
|
529
|
-
status: params.status ?? "queued",
|
|
530
|
-
notifyPolicy: ensureNotifyPolicy$1(params.notifyPolicy),
|
|
531
|
-
goal: params.goal,
|
|
532
|
-
currentStep: normalizeOptionalString(params.currentStep),
|
|
533
|
-
blockedTaskId: normalizeOptionalString(params.blockedTaskId),
|
|
534
|
-
blockedSummary: normalizeOptionalString(params.blockedSummary),
|
|
535
|
-
...normalizeJsonBlob(params.stateJson) !== void 0 ? { stateJson: normalizeJsonBlob(params.stateJson) } : {},
|
|
536
|
-
...normalizeJsonBlob(params.waitJson) !== void 0 ? { waitJson: normalizeJsonBlob(params.waitJson) } : {},
|
|
537
|
-
...params.cancelRequestedAt != null ? { cancelRequestedAt: params.cancelRequestedAt } : {},
|
|
538
|
-
createdAt: now,
|
|
539
|
-
updatedAt: params.updatedAt ?? now,
|
|
540
|
-
...params.endedAt != null ? { endedAt: params.endedAt } : {}
|
|
541
|
-
};
|
|
542
|
-
}
|
|
543
|
-
function applyFlowPatch(current, patch) {
|
|
544
|
-
const controllerId = patch.controllerId === void 0 ? current.controllerId : normalizeOptionalString(patch.controllerId);
|
|
545
|
-
if (current.syncMode === "managed") assertControllerId(controllerId);
|
|
546
|
-
return {
|
|
547
|
-
...current,
|
|
548
|
-
...patch.status ? { status: patch.status } : {},
|
|
549
|
-
...patch.notifyPolicy ? { notifyPolicy: patch.notifyPolicy } : {},
|
|
550
|
-
...patch.goal ? { goal: patch.goal } : {},
|
|
551
|
-
controllerId,
|
|
552
|
-
currentStep: patch.currentStep === void 0 ? current.currentStep : normalizeOptionalString(patch.currentStep),
|
|
553
|
-
blockedTaskId: patch.blockedTaskId === void 0 ? current.blockedTaskId : normalizeOptionalString(patch.blockedTaskId),
|
|
554
|
-
blockedSummary: patch.blockedSummary === void 0 ? current.blockedSummary : normalizeOptionalString(patch.blockedSummary),
|
|
555
|
-
stateJson: patch.stateJson === void 0 ? current.stateJson : normalizeJsonBlob(patch.stateJson),
|
|
556
|
-
waitJson: patch.waitJson === void 0 ? current.waitJson : normalizeJsonBlob(patch.waitJson),
|
|
557
|
-
cancelRequestedAt: patch.cancelRequestedAt === void 0 ? current.cancelRequestedAt : patch.cancelRequestedAt ?? void 0,
|
|
558
|
-
revision: current.revision + 1,
|
|
559
|
-
updatedAt: patch.updatedAt ?? Date.now(),
|
|
560
|
-
endedAt: patch.endedAt === void 0 ? current.endedAt : patch.endedAt ?? void 0
|
|
561
|
-
};
|
|
562
|
-
}
|
|
563
|
-
function writeFlowRecord(next, previous) {
|
|
564
|
-
flows.set(next.flowId, next);
|
|
565
|
-
persistFlowUpsert(next);
|
|
566
|
-
emitFlowRegistryObserverEvent(() => ({
|
|
567
|
-
kind: "upserted",
|
|
568
|
-
flow: cloneFlowRecord(next),
|
|
569
|
-
...previous ? { previous: cloneFlowRecord(previous) } : {}
|
|
570
|
-
}));
|
|
571
|
-
return cloneFlowRecord(next);
|
|
572
|
-
}
|
|
573
|
-
function createFlowRecord(params) {
|
|
574
|
-
ensureFlowRegistryReady();
|
|
575
|
-
return writeFlowRecord(buildFlowRecord(params));
|
|
576
|
-
}
|
|
577
|
-
function createManagedTaskFlow(params) {
|
|
578
|
-
return createFlowRecord({
|
|
579
|
-
...params,
|
|
580
|
-
syncMode: "managed",
|
|
581
|
-
controllerId: assertControllerId(params.controllerId)
|
|
582
|
-
});
|
|
583
|
-
}
|
|
584
|
-
function createTaskFlowForTask(params) {
|
|
585
|
-
const terminalFlowStatus = deriveTaskFlowStatusFromTask(params.task);
|
|
586
|
-
const timing = resolveTaskMirroredFlowTiming(params.task, isTerminalTaskFlowStatus(terminalFlowStatus));
|
|
587
|
-
return createFlowRecord({
|
|
588
|
-
syncMode: "task_mirrored",
|
|
589
|
-
ownerKey: params.task.ownerKey,
|
|
590
|
-
requesterOrigin: params.requesterOrigin,
|
|
591
|
-
status: terminalFlowStatus,
|
|
592
|
-
notifyPolicy: params.task.notifyPolicy,
|
|
593
|
-
goal: normalizeOptionalString(params.task.label) ?? (params.task.task.trim() || "Background task"),
|
|
594
|
-
blockedTaskId: terminalFlowStatus === "blocked" ? normalizeOptionalString(params.task.taskId) : void 0,
|
|
595
|
-
blockedSummary: resolveFlowBlockedSummary(params.task),
|
|
596
|
-
createdAt: params.task.createdAt,
|
|
597
|
-
updatedAt: timing.updatedAt,
|
|
598
|
-
...timing.endedAt !== void 0 ? { endedAt: timing.endedAt } : {}
|
|
599
|
-
});
|
|
600
|
-
}
|
|
601
|
-
function updateFlowRecordByIdUnchecked(flowId, patch) {
|
|
602
|
-
ensureFlowRegistryReady();
|
|
603
|
-
const current = flows.get(flowId);
|
|
604
|
-
if (!current) return null;
|
|
605
|
-
return writeFlowRecord(applyFlowPatch(current, patch), current);
|
|
606
|
-
}
|
|
607
|
-
function updateFlowRecordByIdExpectedRevision(params) {
|
|
608
|
-
ensureFlowRegistryReady();
|
|
609
|
-
const current = flows.get(params.flowId);
|
|
610
|
-
if (!current) return {
|
|
611
|
-
applied: false,
|
|
612
|
-
reason: "not_found"
|
|
613
|
-
};
|
|
614
|
-
if (current.revision !== params.expectedRevision) return {
|
|
615
|
-
applied: false,
|
|
616
|
-
reason: "revision_conflict",
|
|
617
|
-
current: cloneFlowRecord(current)
|
|
618
|
-
};
|
|
619
|
-
return {
|
|
620
|
-
applied: true,
|
|
621
|
-
flow: writeFlowRecord(applyFlowPatch(current, params.patch), current)
|
|
622
|
-
};
|
|
623
|
-
}
|
|
624
|
-
function setFlowWaiting(params) {
|
|
625
|
-
return updateFlowRecordByIdExpectedRevision({
|
|
626
|
-
flowId: params.flowId,
|
|
627
|
-
expectedRevision: params.expectedRevision,
|
|
628
|
-
patch: {
|
|
629
|
-
status: normalizeOptionalString(params.blockedTaskId) || normalizeOptionalString(params.blockedSummary) ? "blocked" : "waiting",
|
|
630
|
-
currentStep: params.currentStep,
|
|
631
|
-
stateJson: params.stateJson,
|
|
632
|
-
waitJson: params.waitJson,
|
|
633
|
-
blockedTaskId: params.blockedTaskId,
|
|
634
|
-
blockedSummary: params.blockedSummary,
|
|
635
|
-
endedAt: null,
|
|
636
|
-
updatedAt: params.updatedAt
|
|
637
|
-
}
|
|
638
|
-
});
|
|
639
|
-
}
|
|
640
|
-
function resumeFlow(params) {
|
|
641
|
-
return updateFlowRecordByIdExpectedRevision({
|
|
642
|
-
flowId: params.flowId,
|
|
643
|
-
expectedRevision: params.expectedRevision,
|
|
644
|
-
patch: {
|
|
645
|
-
status: params.status ?? "queued",
|
|
646
|
-
currentStep: params.currentStep,
|
|
647
|
-
stateJson: params.stateJson,
|
|
648
|
-
waitJson: null,
|
|
649
|
-
blockedTaskId: null,
|
|
650
|
-
blockedSummary: null,
|
|
651
|
-
endedAt: null,
|
|
652
|
-
updatedAt: params.updatedAt
|
|
653
|
-
}
|
|
654
|
-
});
|
|
655
|
-
}
|
|
656
|
-
function finishFlow(params) {
|
|
657
|
-
const endedAt = params.endedAt ?? params.updatedAt ?? Date.now();
|
|
658
|
-
return updateFlowRecordByIdExpectedRevision({
|
|
659
|
-
flowId: params.flowId,
|
|
660
|
-
expectedRevision: params.expectedRevision,
|
|
661
|
-
patch: {
|
|
662
|
-
status: "succeeded",
|
|
663
|
-
currentStep: params.currentStep,
|
|
664
|
-
stateJson: params.stateJson,
|
|
665
|
-
waitJson: null,
|
|
666
|
-
blockedTaskId: null,
|
|
667
|
-
blockedSummary: null,
|
|
668
|
-
endedAt,
|
|
669
|
-
updatedAt: params.updatedAt ?? endedAt
|
|
670
|
-
}
|
|
671
|
-
});
|
|
672
|
-
}
|
|
673
|
-
function failFlow(params) {
|
|
674
|
-
const endedAt = params.endedAt ?? params.updatedAt ?? Date.now();
|
|
675
|
-
return updateFlowRecordByIdExpectedRevision({
|
|
676
|
-
flowId: params.flowId,
|
|
677
|
-
expectedRevision: params.expectedRevision,
|
|
678
|
-
patch: {
|
|
679
|
-
status: "failed",
|
|
680
|
-
currentStep: params.currentStep,
|
|
681
|
-
stateJson: params.stateJson,
|
|
682
|
-
waitJson: null,
|
|
683
|
-
blockedTaskId: params.blockedTaskId,
|
|
684
|
-
blockedSummary: params.blockedSummary,
|
|
685
|
-
endedAt,
|
|
686
|
-
updatedAt: params.updatedAt ?? endedAt
|
|
687
|
-
}
|
|
688
|
-
});
|
|
689
|
-
}
|
|
690
|
-
function requestFlowCancel(params) {
|
|
691
|
-
return updateFlowRecordByIdExpectedRevision({
|
|
692
|
-
flowId: params.flowId,
|
|
693
|
-
expectedRevision: params.expectedRevision,
|
|
694
|
-
patch: {
|
|
695
|
-
cancelRequestedAt: params.cancelRequestedAt ?? params.updatedAt ?? Date.now(),
|
|
696
|
-
updatedAt: params.updatedAt
|
|
697
|
-
}
|
|
698
|
-
});
|
|
699
|
-
}
|
|
700
|
-
function syncFlowFromTask(task) {
|
|
701
|
-
const flowId = task.parentFlowId?.trim();
|
|
702
|
-
if (!flowId) return null;
|
|
703
|
-
const flow = getTaskFlowById(flowId);
|
|
704
|
-
if (!flow) return null;
|
|
705
|
-
if (flow.syncMode !== "task_mirrored") return flow;
|
|
706
|
-
const terminalFlowStatus = deriveTaskFlowStatusFromTask(task);
|
|
707
|
-
const isTerminal = isTerminalTaskFlowStatus(terminalFlowStatus);
|
|
708
|
-
const timing = resolveTaskMirroredFlowTiming({
|
|
709
|
-
createdAt: flow.createdAt,
|
|
710
|
-
lastEventAt: task.lastEventAt,
|
|
711
|
-
endedAt: task.endedAt
|
|
712
|
-
}, isTerminal);
|
|
713
|
-
return updateFlowRecordByIdUnchecked(flowId, {
|
|
714
|
-
status: terminalFlowStatus,
|
|
715
|
-
notifyPolicy: task.notifyPolicy,
|
|
716
|
-
goal: normalizeOptionalString(task.label) ?? (task.task.trim() || "Background task"),
|
|
717
|
-
blockedTaskId: terminalFlowStatus === "blocked" ? task.taskId.trim() || null : null,
|
|
718
|
-
blockedSummary: terminalFlowStatus === "blocked" ? resolveFlowBlockedSummary(task) ?? null : null,
|
|
719
|
-
waitJson: null,
|
|
720
|
-
updatedAt: timing.updatedAt,
|
|
721
|
-
...isTerminal ? { endedAt: timing.endedAt ?? timing.updatedAt } : { endedAt: null }
|
|
722
|
-
});
|
|
723
|
-
}
|
|
724
|
-
function getTaskFlowById(flowId) {
|
|
725
|
-
ensureFlowRegistryReady();
|
|
726
|
-
const flow = flows.get(flowId);
|
|
727
|
-
return flow ? cloneFlowRecord(flow) : void 0;
|
|
728
|
-
}
|
|
729
|
-
function listTaskFlowsForOwnerKey(ownerKey) {
|
|
730
|
-
ensureFlowRegistryReady();
|
|
731
|
-
const normalizedOwnerKey = ownerKey.trim();
|
|
732
|
-
if (!normalizedOwnerKey) return [];
|
|
733
|
-
return [...flows.values()].filter((flow) => flow.ownerKey.trim() === normalizedOwnerKey).map((flow) => cloneFlowRecord(flow)).toSorted((left, right) => right.createdAt - left.createdAt);
|
|
734
|
-
}
|
|
735
|
-
function findLatestTaskFlowForOwnerKey(ownerKey) {
|
|
736
|
-
const flow = listTaskFlowsForOwnerKey(ownerKey)[0];
|
|
737
|
-
return flow ? cloneFlowRecord(flow) : void 0;
|
|
738
|
-
}
|
|
739
|
-
function resolveTaskFlowForLookupToken(token) {
|
|
740
|
-
const lookup = token.trim();
|
|
741
|
-
if (!lookup) return;
|
|
742
|
-
return getTaskFlowById(lookup) ?? findLatestTaskFlowForOwnerKey(lookup);
|
|
743
|
-
}
|
|
744
|
-
function listTaskFlowRecords() {
|
|
745
|
-
ensureFlowRegistryReady();
|
|
746
|
-
return [...flows.values()].map((flow) => cloneFlowRecord(flow)).toSorted((left, right) => right.createdAt - left.createdAt);
|
|
747
|
-
}
|
|
748
|
-
function deleteTaskFlowRecordById(flowId) {
|
|
749
|
-
ensureFlowRegistryReady();
|
|
750
|
-
const current = flows.get(flowId);
|
|
751
|
-
if (!current) return false;
|
|
752
|
-
flows.delete(flowId);
|
|
753
|
-
persistFlowDelete(flowId);
|
|
754
|
-
emitFlowRegistryObserverEvent(() => ({
|
|
755
|
-
kind: "deleted",
|
|
756
|
-
flowId,
|
|
757
|
-
previous: cloneFlowRecord(current)
|
|
758
|
-
}));
|
|
759
|
-
return true;
|
|
760
|
-
}
|
|
761
|
-
//#endregion
|
|
762
|
-
//#region src/tasks/task-registry.process-state.ts
|
|
763
|
-
const TASK_REGISTRY_PROCESS_STATE_KEY = Symbol.for("fengming.taskRegistry.state");
|
|
764
|
-
function getTaskRegistryProcessState() {
|
|
765
|
-
const globalState = globalThis;
|
|
766
|
-
globalState[TASK_REGISTRY_PROCESS_STATE_KEY] ??= {
|
|
767
|
-
tasks: /* @__PURE__ */ new Map(),
|
|
768
|
-
taskDeliveryStates: /* @__PURE__ */ new Map(),
|
|
769
|
-
taskIdsByRunId: /* @__PURE__ */ new Map(),
|
|
770
|
-
taskIdsByOwnerKey: /* @__PURE__ */ new Map(),
|
|
771
|
-
taskIdsByParentFlowId: /* @__PURE__ */ new Map(),
|
|
772
|
-
taskIdsByRelatedSessionKey: /* @__PURE__ */ new Map(),
|
|
773
|
-
tasksWithPendingDelivery: /* @__PURE__ */ new Set()
|
|
774
|
-
};
|
|
775
|
-
return globalState[TASK_REGISTRY_PROCESS_STATE_KEY];
|
|
776
|
-
}
|
|
777
|
-
//#endregion
|
|
778
|
-
//#region src/tasks/task-registry.store.sqlite.ts
|
|
779
|
-
const TASK_RUN_SELECT_COLUMNS = [
|
|
780
|
-
"task_id",
|
|
781
|
-
"runtime",
|
|
782
|
-
"task_kind",
|
|
783
|
-
"source_id",
|
|
784
|
-
"requester_session_key",
|
|
785
|
-
"owner_key",
|
|
786
|
-
"scope_kind",
|
|
787
|
-
"child_session_key",
|
|
788
|
-
"parent_flow_id",
|
|
789
|
-
"parent_task_id",
|
|
790
|
-
"agent_id",
|
|
791
|
-
"run_id",
|
|
792
|
-
"label",
|
|
793
|
-
"task",
|
|
794
|
-
"status",
|
|
795
|
-
"delivery_status",
|
|
796
|
-
"notify_policy",
|
|
797
|
-
"created_at",
|
|
798
|
-
"started_at",
|
|
799
|
-
"ended_at",
|
|
800
|
-
"last_event_at",
|
|
801
|
-
"cleanup_after",
|
|
802
|
-
"error",
|
|
803
|
-
"progress_summary",
|
|
804
|
-
"terminal_summary",
|
|
805
|
-
"terminal_outcome"
|
|
806
|
-
];
|
|
807
|
-
let cachedDatabase = null;
|
|
808
|
-
function normalizeNumber(value) {
|
|
809
|
-
if (typeof value === "bigint") return Number(value);
|
|
810
|
-
return typeof value === "number" ? value : void 0;
|
|
811
|
-
}
|
|
812
|
-
function serializeJson(value) {
|
|
813
|
-
return value == null ? null : JSON.stringify(value);
|
|
814
|
-
}
|
|
815
|
-
function rowToTaskRecord(row) {
|
|
816
|
-
const startedAt = normalizeNumber(row.started_at);
|
|
817
|
-
const endedAt = normalizeNumber(row.ended_at);
|
|
818
|
-
const lastEventAt = normalizeNumber(row.last_event_at);
|
|
819
|
-
const cleanupAfter = normalizeNumber(row.cleanup_after);
|
|
820
|
-
const scopeKind = parseTaskScopeKind(row.scope_kind);
|
|
821
|
-
const terminalOutcome = parseOptionalTaskTerminalOutcome(row.terminal_outcome);
|
|
822
|
-
const requesterSessionKey = scopeKind === "system" ? "" : row.requester_session_key?.trim() || row.owner_key;
|
|
823
|
-
return {
|
|
824
|
-
taskId: row.task_id,
|
|
825
|
-
runtime: parseTaskRuntime(row.runtime),
|
|
826
|
-
...row.task_kind ? { taskKind: row.task_kind } : {},
|
|
827
|
-
...row.source_id ? { sourceId: row.source_id } : {},
|
|
828
|
-
requesterSessionKey,
|
|
829
|
-
ownerKey: row.owner_key,
|
|
830
|
-
scopeKind,
|
|
831
|
-
...row.child_session_key ? { childSessionKey: row.child_session_key } : {},
|
|
832
|
-
...row.parent_flow_id ? { parentFlowId: row.parent_flow_id } : {},
|
|
833
|
-
...row.parent_task_id ? { parentTaskId: row.parent_task_id } : {},
|
|
834
|
-
...row.agent_id ? { agentId: row.agent_id } : {},
|
|
835
|
-
...row.run_id ? { runId: row.run_id } : {},
|
|
836
|
-
...row.label ? { label: row.label } : {},
|
|
837
|
-
task: row.task,
|
|
838
|
-
status: parseTaskStatus(row.status),
|
|
839
|
-
deliveryStatus: parseTaskDeliveryStatus(row.delivery_status),
|
|
840
|
-
notifyPolicy: parseTaskNotifyPolicy(row.notify_policy),
|
|
841
|
-
createdAt: normalizeNumber(row.created_at) ?? 0,
|
|
842
|
-
...startedAt != null ? { startedAt } : {},
|
|
843
|
-
...endedAt != null ? { endedAt } : {},
|
|
844
|
-
...lastEventAt != null ? { lastEventAt } : {},
|
|
845
|
-
...cleanupAfter != null ? { cleanupAfter } : {},
|
|
846
|
-
...row.error ? { error: row.error } : {},
|
|
847
|
-
...row.progress_summary ? { progressSummary: row.progress_summary } : {},
|
|
848
|
-
...row.terminal_summary ? { terminalSummary: row.terminal_summary } : {},
|
|
849
|
-
...terminalOutcome ? { terminalOutcome } : {}
|
|
850
|
-
};
|
|
851
|
-
}
|
|
852
|
-
function rowToTaskDeliveryState(row) {
|
|
853
|
-
const requesterOrigin = parseDeliveryContextJson(row.requester_origin_json);
|
|
854
|
-
const lastNotifiedEventAt = normalizeNumber(row.last_notified_event_at);
|
|
855
|
-
return {
|
|
856
|
-
taskId: row.task_id,
|
|
857
|
-
...requesterOrigin ? { requesterOrigin } : {},
|
|
858
|
-
...lastNotifiedEventAt != null ? { lastNotifiedEventAt } : {}
|
|
859
|
-
};
|
|
860
|
-
}
|
|
861
|
-
function bindTaskRecordBase(record) {
|
|
862
|
-
return {
|
|
863
|
-
task_id: record.taskId,
|
|
864
|
-
runtime: record.runtime,
|
|
865
|
-
task_kind: record.taskKind ?? null,
|
|
866
|
-
source_id: record.sourceId ?? null,
|
|
867
|
-
requester_session_key: record.scopeKind === "system" ? "" : record.requesterSessionKey,
|
|
868
|
-
owner_key: record.ownerKey,
|
|
869
|
-
scope_kind: record.scopeKind,
|
|
870
|
-
child_session_key: record.childSessionKey ?? null,
|
|
871
|
-
parent_flow_id: record.parentFlowId ?? null,
|
|
872
|
-
parent_task_id: record.parentTaskId ?? null,
|
|
873
|
-
agent_id: record.agentId ?? null,
|
|
874
|
-
run_id: record.runId ?? null,
|
|
875
|
-
label: record.label ?? null,
|
|
876
|
-
task: record.task,
|
|
877
|
-
status: record.status,
|
|
878
|
-
delivery_status: record.deliveryStatus,
|
|
879
|
-
notify_policy: record.notifyPolicy,
|
|
880
|
-
created_at: record.createdAt,
|
|
881
|
-
started_at: record.startedAt ?? null,
|
|
882
|
-
ended_at: record.endedAt ?? null,
|
|
883
|
-
last_event_at: record.lastEventAt ?? null,
|
|
884
|
-
cleanup_after: record.cleanupAfter ?? null,
|
|
885
|
-
error: record.error ?? null,
|
|
886
|
-
progress_summary: record.progressSummary ?? null,
|
|
887
|
-
terminal_summary: record.terminalSummary ?? null,
|
|
888
|
-
terminal_outcome: record.terminalOutcome ?? null
|
|
889
|
-
};
|
|
890
|
-
}
|
|
891
|
-
function bindTaskDeliveryState(state) {
|
|
892
|
-
return {
|
|
893
|
-
task_id: state.taskId,
|
|
894
|
-
requester_origin_json: serializeJson(state.requesterOrigin),
|
|
895
|
-
last_notified_event_at: state.lastNotifiedEventAt ?? null
|
|
896
|
-
};
|
|
897
|
-
}
|
|
898
|
-
function getTaskRegistryKysely(db) {
|
|
899
|
-
return getNodeSqliteKysely(db);
|
|
900
|
-
}
|
|
901
|
-
function pruneRowsNotInSnapshot(params) {
|
|
902
|
-
params.db.exec(`CREATE TEMP TABLE IF NOT EXISTS ${params.tempTableName} (id TEXT PRIMARY KEY)`);
|
|
903
|
-
params.db.exec(`DELETE FROM ${params.tempTableName}`);
|
|
904
|
-
const insert = params.db.prepare(`INSERT OR IGNORE INTO ${params.tempTableName} (id) VALUES (?)`);
|
|
905
|
-
for (const id of params.ids) insert.run(id);
|
|
906
|
-
params.db.exec(`
|
|
907
|
-
DELETE FROM ${params.tableName}
|
|
908
|
-
WHERE NOT EXISTS (
|
|
909
|
-
SELECT 1 FROM ${params.tempTableName}
|
|
910
|
-
WHERE ${params.tempTableName}.id = ${params.tableName}.${params.columnName}
|
|
911
|
-
)
|
|
912
|
-
`);
|
|
913
|
-
params.db.exec(`DELETE FROM ${params.tempTableName}`);
|
|
914
|
-
}
|
|
915
|
-
function selectTaskRows(db) {
|
|
916
|
-
return executeSqliteQuerySync(db, getTaskRegistryKysely(db).selectFrom("task_runs").select(TASK_RUN_SELECT_COLUMNS).orderBy("created_at", "asc").orderBy("task_id", "asc")).rows;
|
|
917
|
-
}
|
|
918
|
-
function selectTaskDeliveryStateRows(db) {
|
|
919
|
-
return executeSqliteQuerySync(db, getTaskRegistryKysely(db).selectFrom("task_delivery_state").select([
|
|
920
|
-
"task_id",
|
|
921
|
-
"requester_origin_json",
|
|
922
|
-
"last_notified_event_at"
|
|
923
|
-
]).orderBy("task_id", "asc")).rows;
|
|
924
|
-
}
|
|
925
|
-
function upsertTaskRow(db, row) {
|
|
926
|
-
executeSqliteQuerySync(db, getTaskRegistryKysely(db).insertInto("task_runs").values(row).onConflict((conflict) => conflict.column("task_id").doUpdateSet({
|
|
927
|
-
runtime: (eb) => eb.ref("excluded.runtime"),
|
|
928
|
-
task_kind: (eb) => eb.ref("excluded.task_kind"),
|
|
929
|
-
source_id: (eb) => eb.ref("excluded.source_id"),
|
|
930
|
-
requester_session_key: (eb) => eb.ref("excluded.requester_session_key"),
|
|
931
|
-
owner_key: (eb) => eb.ref("excluded.owner_key"),
|
|
932
|
-
scope_kind: (eb) => eb.ref("excluded.scope_kind"),
|
|
933
|
-
child_session_key: (eb) => eb.ref("excluded.child_session_key"),
|
|
934
|
-
parent_flow_id: (eb) => eb.ref("excluded.parent_flow_id"),
|
|
935
|
-
parent_task_id: (eb) => eb.ref("excluded.parent_task_id"),
|
|
936
|
-
agent_id: (eb) => eb.ref("excluded.agent_id"),
|
|
937
|
-
run_id: (eb) => eb.ref("excluded.run_id"),
|
|
938
|
-
label: (eb) => eb.ref("excluded.label"),
|
|
939
|
-
task: (eb) => eb.ref("excluded.task"),
|
|
940
|
-
status: (eb) => eb.ref("excluded.status"),
|
|
941
|
-
delivery_status: (eb) => eb.ref("excluded.delivery_status"),
|
|
942
|
-
notify_policy: (eb) => eb.ref("excluded.notify_policy"),
|
|
943
|
-
created_at: (eb) => eb.ref("excluded.created_at"),
|
|
944
|
-
started_at: (eb) => eb.ref("excluded.started_at"),
|
|
945
|
-
ended_at: (eb) => eb.ref("excluded.ended_at"),
|
|
946
|
-
last_event_at: (eb) => eb.ref("excluded.last_event_at"),
|
|
947
|
-
cleanup_after: (eb) => eb.ref("excluded.cleanup_after"),
|
|
948
|
-
error: (eb) => eb.ref("excluded.error"),
|
|
949
|
-
progress_summary: (eb) => eb.ref("excluded.progress_summary"),
|
|
950
|
-
terminal_summary: (eb) => eb.ref("excluded.terminal_summary"),
|
|
951
|
-
terminal_outcome: (eb) => eb.ref("excluded.terminal_outcome")
|
|
952
|
-
})));
|
|
953
|
-
}
|
|
954
|
-
function replaceTaskDeliveryStateRow(db, row) {
|
|
955
|
-
executeSqliteQuerySync(db, getTaskRegistryKysely(db).insertInto("task_delivery_state").values(row).onConflict((conflict) => conflict.column("task_id").doUpdateSet({
|
|
956
|
-
requester_origin_json: (eb) => eb.ref("excluded.requester_origin_json"),
|
|
957
|
-
last_notified_event_at: (eb) => eb.ref("excluded.last_notified_event_at")
|
|
958
|
-
})));
|
|
959
|
-
}
|
|
960
|
-
function deleteTaskRowsWithDeliveryState(db, taskId) {
|
|
961
|
-
const kysely = getTaskRegistryKysely(db);
|
|
962
|
-
executeSqliteQuerySync(db, kysely.deleteFrom("task_delivery_state").where("task_id", "=", taskId));
|
|
963
|
-
executeSqliteQuerySync(db, kysely.deleteFrom("task_runs").where("task_id", "=", taskId));
|
|
964
|
-
}
|
|
965
|
-
function openTaskRegistryDatabase() {
|
|
966
|
-
const database = openFengMingStateDatabase();
|
|
967
|
-
const pathname = database.path;
|
|
968
|
-
if (cachedDatabase && cachedDatabase.path === pathname && cachedDatabase.db.isOpen) return cachedDatabase;
|
|
969
|
-
if (cachedDatabase && !cachedDatabase.db.isOpen) cachedDatabase = null;
|
|
970
|
-
cachedDatabase = {
|
|
971
|
-
db: database.db,
|
|
972
|
-
path: pathname
|
|
973
|
-
};
|
|
974
|
-
return cachedDatabase;
|
|
975
|
-
}
|
|
976
|
-
function withWriteTransaction(write) {
|
|
977
|
-
const database = openTaskRegistryDatabase();
|
|
978
|
-
runFengMingStateWriteTransaction(() => {
|
|
979
|
-
write(database);
|
|
980
|
-
});
|
|
981
|
-
}
|
|
982
|
-
function loadTaskRegistryStateFromSqlite() {
|
|
983
|
-
const { db } = openTaskRegistryDatabase();
|
|
984
|
-
const taskRows = selectTaskRows(db);
|
|
985
|
-
const deliveryRows = selectTaskDeliveryStateRows(db);
|
|
986
|
-
return {
|
|
987
|
-
tasks: new Map(taskRows.map((row) => [row.task_id, rowToTaskRecord(row)])),
|
|
988
|
-
deliveryStates: new Map(deliveryRows.map((row) => [row.task_id, rowToTaskDeliveryState(row)]))
|
|
989
|
-
};
|
|
990
|
-
}
|
|
991
|
-
function listTaskRegistryRecordsByOwnerKeyFromSqlite(ownerKey) {
|
|
992
|
-
const key = ownerKey.trim();
|
|
993
|
-
if (!key) return [];
|
|
994
|
-
const { db } = openTaskRegistryDatabase();
|
|
995
|
-
return executeSqliteQuerySync(db, getTaskRegistryKysely(db).selectFrom("task_runs").select(TASK_RUN_SELECT_COLUMNS).where("owner_key", "=", key).orderBy("created_at", "asc").orderBy("task_id", "asc")).rows.map(rowToTaskRecord);
|
|
996
|
-
}
|
|
997
|
-
function saveTaskRegistryStateToSqlite(snapshot) {
|
|
998
|
-
withWriteTransaction(({ db }) => {
|
|
999
|
-
const kysely = getTaskRegistryKysely(db);
|
|
1000
|
-
const taskIds = [...snapshot.tasks.keys()];
|
|
1001
|
-
if (taskIds.length === 0) {
|
|
1002
|
-
executeSqliteQuerySync(db, kysely.deleteFrom("task_delivery_state"));
|
|
1003
|
-
executeSqliteQuerySync(db, kysely.deleteFrom("task_runs"));
|
|
1004
|
-
return;
|
|
1005
|
-
}
|
|
1006
|
-
pruneRowsNotInSnapshot({
|
|
1007
|
-
db,
|
|
1008
|
-
tableName: "task_runs",
|
|
1009
|
-
columnName: "task_id",
|
|
1010
|
-
tempTableName: "fengming_live_task_run_ids",
|
|
1011
|
-
ids: taskIds
|
|
1012
|
-
});
|
|
1013
|
-
const deliveryTaskIds = [...snapshot.deliveryStates.keys()];
|
|
1014
|
-
if (deliveryTaskIds.length === 0) executeSqliteQuerySync(db, kysely.deleteFrom("task_delivery_state"));
|
|
1015
|
-
else pruneRowsNotInSnapshot({
|
|
1016
|
-
db,
|
|
1017
|
-
tableName: "task_delivery_state",
|
|
1018
|
-
columnName: "task_id",
|
|
1019
|
-
tempTableName: "fengming_live_task_delivery_ids",
|
|
1020
|
-
ids: deliveryTaskIds
|
|
1021
|
-
});
|
|
1022
|
-
for (const task of snapshot.tasks.values()) upsertTaskRow(db, bindTaskRecordBase(task));
|
|
1023
|
-
for (const state of snapshot.deliveryStates.values()) replaceTaskDeliveryStateRow(db, bindTaskDeliveryState(state));
|
|
1024
|
-
});
|
|
1025
|
-
}
|
|
1026
|
-
function upsertTaskRegistryRecordToSqlite(task) {
|
|
1027
|
-
withWriteTransaction(({ db }) => {
|
|
1028
|
-
upsertTaskRow(db, bindTaskRecordBase(task));
|
|
1029
|
-
});
|
|
1030
|
-
}
|
|
1031
|
-
function upsertTaskWithDeliveryStateToSqlite(params) {
|
|
1032
|
-
withWriteTransaction(({ db }) => {
|
|
1033
|
-
upsertTaskRow(db, bindTaskRecordBase(params.task));
|
|
1034
|
-
if (params.deliveryState) replaceTaskDeliveryStateRow(db, bindTaskDeliveryState(params.deliveryState));
|
|
1035
|
-
else executeSqliteQuerySync(db, getTaskRegistryKysely(db).deleteFrom("task_delivery_state").where("task_id", "=", params.task.taskId));
|
|
1036
|
-
});
|
|
1037
|
-
}
|
|
1038
|
-
function deleteTaskRegistryRecordFromSqlite(taskId) {
|
|
1039
|
-
withWriteTransaction(({ db }) => {
|
|
1040
|
-
deleteTaskRowsWithDeliveryState(db, taskId);
|
|
1041
|
-
});
|
|
1042
|
-
}
|
|
1043
|
-
function deleteTaskAndDeliveryStateFromSqlite(taskId) {
|
|
1044
|
-
withWriteTransaction(({ db }) => {
|
|
1045
|
-
deleteTaskRowsWithDeliveryState(db, taskId);
|
|
1046
|
-
});
|
|
1047
|
-
}
|
|
1048
|
-
function upsertTaskDeliveryStateToSqlite(state) {
|
|
1049
|
-
withWriteTransaction(({ db }) => {
|
|
1050
|
-
replaceTaskDeliveryStateRow(db, bindTaskDeliveryState(state));
|
|
1051
|
-
});
|
|
1052
|
-
}
|
|
1053
|
-
function deleteTaskDeliveryStateFromSqlite(taskId) {
|
|
1054
|
-
withWriteTransaction(({ db }) => {
|
|
1055
|
-
executeSqliteQuerySync(db, getTaskRegistryKysely(db).deleteFrom("task_delivery_state").where("task_id", "=", taskId));
|
|
1056
|
-
});
|
|
1057
|
-
}
|
|
1058
|
-
function closeTaskRegistryDatabase() {
|
|
1059
|
-
cachedDatabase = null;
|
|
1060
|
-
closeFengMingStateDatabase();
|
|
1061
|
-
}
|
|
1062
|
-
let configuredTaskRegistryStore = {
|
|
1063
|
-
loadSnapshot: loadTaskRegistryStateFromSqlite,
|
|
1064
|
-
saveSnapshot: saveTaskRegistryStateToSqlite,
|
|
1065
|
-
listTasksForOwnerKey: listTaskRegistryRecordsByOwnerKeyFromSqlite,
|
|
1066
|
-
upsertTaskWithDeliveryState: upsertTaskWithDeliveryStateToSqlite,
|
|
1067
|
-
upsertTask: upsertTaskRegistryRecordToSqlite,
|
|
1068
|
-
deleteTaskWithDeliveryState: deleteTaskAndDeliveryStateFromSqlite,
|
|
1069
|
-
deleteTask: deleteTaskRegistryRecordFromSqlite,
|
|
1070
|
-
upsertDeliveryState: upsertTaskDeliveryStateToSqlite,
|
|
1071
|
-
deleteDeliveryState: deleteTaskDeliveryStateFromSqlite,
|
|
1072
|
-
close: closeTaskRegistryDatabase
|
|
1073
|
-
};
|
|
1074
|
-
let configuredTaskRegistryObservers = null;
|
|
1075
|
-
function getTaskRegistryStore() {
|
|
1076
|
-
return configuredTaskRegistryStore;
|
|
1077
|
-
}
|
|
1078
|
-
function getTaskRegistryObservers() {
|
|
1079
|
-
return configuredTaskRegistryObservers;
|
|
1080
|
-
}
|
|
1081
|
-
//#endregion
|
|
1082
|
-
//#region src/tasks/task-registry.ts
|
|
1083
|
-
const log = createSubsystemLogger("tasks/registry");
|
|
1084
|
-
const taskRegistryProcessState = getTaskRegistryProcessState();
|
|
1085
|
-
const tasks = taskRegistryProcessState.tasks;
|
|
1086
|
-
const taskDeliveryStates = taskRegistryProcessState.taskDeliveryStates;
|
|
1087
|
-
const taskIdsByRunId = taskRegistryProcessState.taskIdsByRunId;
|
|
1088
|
-
const taskIdsByOwnerKey = taskRegistryProcessState.taskIdsByOwnerKey;
|
|
1089
|
-
const taskIdsByParentFlowId = taskRegistryProcessState.taskIdsByParentFlowId;
|
|
1090
|
-
const taskIdsByRelatedSessionKey = taskRegistryProcessState.taskIdsByRelatedSessionKey;
|
|
1091
|
-
const tasksWithPendingDelivery = taskRegistryProcessState.tasksWithPendingDelivery;
|
|
1092
|
-
let listenerStarted = false;
|
|
1093
|
-
let restoreAttempted = false;
|
|
1094
|
-
const TASK_REGISTRY_DELIVERY_RUNTIME_OVERRIDE_KEY = Symbol.for("fengming.taskRegistry.deliveryRuntimeOverride");
|
|
1095
|
-
const TASK_REGISTRY_CONTROL_RUNTIME_OVERRIDE_KEY = Symbol.for("fengming.taskRegistry.controlRuntimeOverride");
|
|
1096
|
-
const require = createRequire(import.meta.url);
|
|
1097
|
-
const TASK_REGISTRY_CONTROL_RUNTIME_CANDIDATES = ["./task-registry-control.runtime.js", "./task-registry-control.runtime.ts"];
|
|
1098
|
-
let deliveryRuntimePromise = null;
|
|
1099
|
-
let controlRuntimePromise = null;
|
|
1100
|
-
var ParentFlowLinkError = class extends Error {
|
|
1101
|
-
constructor(code, message, details) {
|
|
1102
|
-
super(message);
|
|
1103
|
-
this.code = code;
|
|
1104
|
-
this.details = details;
|
|
1105
|
-
this.name = "ParentFlowLinkError";
|
|
1106
|
-
}
|
|
1107
|
-
};
|
|
1108
|
-
function isParentFlowLinkError(error) {
|
|
1109
|
-
return error instanceof ParentFlowLinkError;
|
|
1110
|
-
}
|
|
1111
|
-
function isActiveTaskStatus(status) {
|
|
1112
|
-
return status === "queued" || status === "running";
|
|
1113
|
-
}
|
|
1114
|
-
function isTerminalFlowStatus(status) {
|
|
1115
|
-
return status === "succeeded" || status === "failed" || status === "cancelled" || status === "lost";
|
|
1116
|
-
}
|
|
1117
|
-
function assertTaskOwner(params) {
|
|
1118
|
-
if (!params.ownerKey.trim() && params.scopeKind !== "system") throw new Error("需要 Task ownerKey");
|
|
1119
|
-
}
|
|
1120
|
-
function assertParentFlowLinkAllowed(params) {
|
|
1121
|
-
const flowId = params.parentFlowId?.trim();
|
|
1122
|
-
if (!flowId) return;
|
|
1123
|
-
if (params.scopeKind !== "session") throw new ParentFlowLinkError("scope_kind_not_session", "Only session-scoped tasks can link to flows.", { flowId });
|
|
1124
|
-
const flow = getTaskFlowById(flowId);
|
|
1125
|
-
if (!flow) throw new ParentFlowLinkError("parent_flow_not_found", `Parent flow not found: ${flowId}`, { flowId });
|
|
1126
|
-
if (normalizeOptionalString(flow.ownerKey) !== normalizeOptionalString(params.ownerKey)) throw new ParentFlowLinkError("owner_key_mismatch", "Task ownerKey must match parent flow ownerKey.", { flowId });
|
|
1127
|
-
if (flow.cancelRequestedAt != null) throw new ParentFlowLinkError("cancel_requested", "Parent flow cancellation has already been requested.", {
|
|
1128
|
-
flowId,
|
|
1129
|
-
status: flow.status
|
|
1130
|
-
});
|
|
1131
|
-
if (isTerminalFlowStatus(flow.status)) throw new ParentFlowLinkError("terminal", `Parent flow is already ${flow.status}.`, {
|
|
1132
|
-
flowId,
|
|
1133
|
-
status: flow.status
|
|
1134
|
-
});
|
|
1135
|
-
}
|
|
1136
|
-
function cloneTaskRecord(record) {
|
|
1137
|
-
return { ...record };
|
|
1138
|
-
}
|
|
1139
|
-
function normalizeTaskTimestamps(task) {
|
|
1140
|
-
let createdAt = task.createdAt;
|
|
1141
|
-
for (const candidate of [
|
|
1142
|
-
task.startedAt,
|
|
1143
|
-
task.lastEventAt,
|
|
1144
|
-
task.endedAt
|
|
1145
|
-
]) if (typeof candidate === "number" && candidate < createdAt) createdAt = candidate;
|
|
1146
|
-
const startedAt = typeof task.startedAt === "number" ? Math.max(task.startedAt, createdAt) : task.startedAt;
|
|
1147
|
-
const lastEventAt = typeof task.lastEventAt === "number" ? Math.max(task.lastEventAt, startedAt ?? createdAt) : task.lastEventAt;
|
|
1148
|
-
const endedAt = typeof task.endedAt === "number" ? Math.max(task.endedAt, startedAt ?? createdAt) : task.endedAt;
|
|
1149
|
-
if (createdAt === task.createdAt && startedAt === task.startedAt && lastEventAt === task.lastEventAt && endedAt === task.endedAt) return task;
|
|
1150
|
-
const normalized = {
|
|
1151
|
-
...task,
|
|
1152
|
-
createdAt
|
|
1153
|
-
};
|
|
1154
|
-
if (typeof startedAt === "number") normalized.startedAt = startedAt;
|
|
1155
|
-
if (typeof lastEventAt === "number") normalized.lastEventAt = lastEventAt;
|
|
1156
|
-
if (typeof endedAt === "number") normalized.endedAt = endedAt;
|
|
1157
|
-
return normalized;
|
|
1158
|
-
}
|
|
1159
|
-
function cloneTaskDeliveryState(state) {
|
|
1160
|
-
return {
|
|
1161
|
-
...state,
|
|
1162
|
-
...state.requesterOrigin ? { requesterOrigin: { ...state.requesterOrigin } } : {}
|
|
1163
|
-
};
|
|
1164
|
-
}
|
|
1165
|
-
function snapshotTaskRecords(source) {
|
|
1166
|
-
return [...source.values()].map((record) => cloneTaskRecord(record));
|
|
1167
|
-
}
|
|
1168
|
-
function emitTaskRegistryObserverEvent(createEvent) {
|
|
1169
|
-
const observers = getTaskRegistryObservers();
|
|
1170
|
-
if (!observers?.onEvent) return;
|
|
1171
|
-
try {
|
|
1172
|
-
observers.onEvent(createEvent());
|
|
1173
|
-
} catch (error) {
|
|
1174
|
-
log.warn("Task registry observer failed", {
|
|
1175
|
-
event: "task-registry",
|
|
1176
|
-
error
|
|
1177
|
-
});
|
|
1178
|
-
}
|
|
1179
|
-
}
|
|
1180
|
-
function persistTaskUpsert(task) {
|
|
1181
|
-
const store = getTaskRegistryStore();
|
|
1182
|
-
const deliveryState = taskDeliveryStates.get(task.taskId);
|
|
1183
|
-
if (store.upsertTaskWithDeliveryState) {
|
|
1184
|
-
store.upsertTaskWithDeliveryState({
|
|
1185
|
-
task,
|
|
1186
|
-
...deliveryState ? { deliveryState } : {}
|
|
1187
|
-
});
|
|
1188
|
-
return;
|
|
1189
|
-
}
|
|
1190
|
-
if (store.upsertTask) {
|
|
1191
|
-
if (deliveryState && !store.upsertDeliveryState) {
|
|
1192
|
-
store.saveSnapshot({
|
|
1193
|
-
tasks,
|
|
1194
|
-
deliveryStates: taskDeliveryStates
|
|
1195
|
-
});
|
|
1196
|
-
return;
|
|
1197
|
-
}
|
|
1198
|
-
store.upsertTask(task);
|
|
1199
|
-
if (deliveryState && store.upsertDeliveryState) store.upsertDeliveryState(deliveryState);
|
|
1200
|
-
return;
|
|
1201
|
-
}
|
|
1202
|
-
store.saveSnapshot({
|
|
1203
|
-
tasks,
|
|
1204
|
-
deliveryStates: taskDeliveryStates
|
|
1205
|
-
});
|
|
1206
|
-
}
|
|
1207
|
-
function persistTaskDelete(taskId) {
|
|
1208
|
-
const store = getTaskRegistryStore();
|
|
1209
|
-
if (store.deleteTaskWithDeliveryState) {
|
|
1210
|
-
store.deleteTaskWithDeliveryState(taskId);
|
|
1211
|
-
return;
|
|
1212
|
-
}
|
|
1213
|
-
if (store.deleteTask) {
|
|
1214
|
-
store.deleteTask(taskId);
|
|
1215
|
-
return;
|
|
1216
|
-
}
|
|
1217
|
-
store.saveSnapshot({
|
|
1218
|
-
tasks,
|
|
1219
|
-
deliveryStates: taskDeliveryStates
|
|
1220
|
-
});
|
|
1221
|
-
}
|
|
1222
|
-
function persistTaskDeliveryStateUpsert(state) {
|
|
1223
|
-
const store = getTaskRegistryStore();
|
|
1224
|
-
if (store.upsertDeliveryState) {
|
|
1225
|
-
store.upsertDeliveryState(state);
|
|
1226
|
-
return;
|
|
1227
|
-
}
|
|
1228
|
-
store.saveSnapshot({
|
|
1229
|
-
tasks,
|
|
1230
|
-
deliveryStates: taskDeliveryStates
|
|
1231
|
-
});
|
|
1232
|
-
}
|
|
1233
|
-
function persistTaskDeliveryStateDelete(taskId) {
|
|
1234
|
-
const store = getTaskRegistryStore();
|
|
1235
|
-
if (store.deleteDeliveryState) {
|
|
1236
|
-
store.deleteDeliveryState(taskId);
|
|
1237
|
-
return;
|
|
1238
|
-
}
|
|
1239
|
-
store.saveSnapshot({
|
|
1240
|
-
tasks,
|
|
1241
|
-
deliveryStates: taskDeliveryStates
|
|
1242
|
-
});
|
|
1243
|
-
}
|
|
1244
|
-
function clearTaskRegistryMemory() {
|
|
1245
|
-
tasks.clear();
|
|
1246
|
-
taskDeliveryStates.clear();
|
|
1247
|
-
taskIdsByRunId.clear();
|
|
1248
|
-
taskIdsByOwnerKey.clear();
|
|
1249
|
-
taskIdsByParentFlowId.clear();
|
|
1250
|
-
taskIdsByRelatedSessionKey.clear();
|
|
1251
|
-
tasksWithPendingDelivery.clear();
|
|
1252
|
-
}
|
|
1253
|
-
function ensureDeliveryStatus(params) {
|
|
1254
|
-
if (params.scopeKind === "system") return "not_applicable";
|
|
1255
|
-
return params.ownerKey.trim() ? "pending" : "parent_missing";
|
|
1256
|
-
}
|
|
1257
|
-
function ensureNotifyPolicy(params) {
|
|
1258
|
-
if (params.notifyPolicy) return params.notifyPolicy;
|
|
1259
|
-
return (params.deliveryStatus ?? ensureDeliveryStatus({
|
|
1260
|
-
ownerKey: params.ownerKey,
|
|
1261
|
-
scopeKind: params.scopeKind
|
|
1262
|
-
})) === "not_applicable" ? "silent" : "done_only";
|
|
1263
|
-
}
|
|
1264
|
-
function resolveTaskScopeKind(params) {
|
|
1265
|
-
if (params.scopeKind) return params.scopeKind;
|
|
1266
|
-
return params.requesterSessionKey.trim() ? "session" : "system";
|
|
1267
|
-
}
|
|
1268
|
-
function resolveTaskRequesterSessionKey(params) {
|
|
1269
|
-
const requesterSessionKey = params.requesterSessionKey?.trim();
|
|
1270
|
-
if (requesterSessionKey) return requesterSessionKey;
|
|
1271
|
-
if (params.scopeKind === "system") return "";
|
|
1272
|
-
return params.ownerKey?.trim() ?? "";
|
|
1273
|
-
}
|
|
1274
|
-
function resolveTaskOwnerKey(params) {
|
|
1275
|
-
return params.ownerKey?.trim() || params.requesterSessionKey.trim();
|
|
1276
|
-
}
|
|
1277
|
-
function normalizeTaskSummary(value) {
|
|
1278
|
-
return value?.replace(/\s+/g, " ").trim() || void 0;
|
|
1279
|
-
}
|
|
1280
|
-
function normalizeTaskStatus(value) {
|
|
1281
|
-
return value === "running" || value === "queued" || value === "succeeded" || value === "failed" || value === "timed_out" || value === "cancelled" || value === "lost" ? value : "queued";
|
|
1282
|
-
}
|
|
1283
|
-
function normalizeTaskTerminalOutcome(value) {
|
|
1284
|
-
return value === "succeeded" || value === "blocked" ? value : void 0;
|
|
1285
|
-
}
|
|
1286
|
-
function shouldApplyRunScopedStatusUpdate(params) {
|
|
1287
|
-
if (params.currentStatus === params.nextStatus) return true;
|
|
1288
|
-
if (!isTerminalTaskStatus(params.currentStatus)) return true;
|
|
1289
|
-
if (!isTerminalTaskStatus(params.nextStatus)) return false;
|
|
1290
|
-
return params.currentStatus === "succeeded" && params.nextStatus !== "lost";
|
|
1291
|
-
}
|
|
1292
|
-
function resolveTaskTerminalOutcome(params) {
|
|
1293
|
-
const normalized = normalizeTaskTerminalOutcome(params.terminalOutcome);
|
|
1294
|
-
if (normalized) return normalized;
|
|
1295
|
-
return params.status === "succeeded" ? "succeeded" : void 0;
|
|
1296
|
-
}
|
|
1297
|
-
function mapAgentRunTerminalOutcomeToTaskStatus(outcome) {
|
|
1298
|
-
switch (outcome.reason) {
|
|
1299
|
-
case "completed": return "succeeded";
|
|
1300
|
-
case "hard_timeout":
|
|
1301
|
-
case "timed_out": return "timed_out";
|
|
1302
|
-
case "cancelled":
|
|
1303
|
-
case "aborted": return "cancelled";
|
|
1304
|
-
case "blocked":
|
|
1305
|
-
case "failed": return "failed";
|
|
1306
|
-
default: return outcome.reason;
|
|
1307
|
-
}
|
|
1308
|
-
}
|
|
1309
|
-
function buildTaskLifecycleTerminalOutcome(params) {
|
|
1310
|
-
return buildAgentRunTerminalOutcome({
|
|
1311
|
-
status: params.phase === "error" ? "error" : params.data?.aborted === true ? "timeout" : "ok",
|
|
1312
|
-
error: params.data?.error,
|
|
1313
|
-
stopReason: params.data?.stopReason,
|
|
1314
|
-
livenessState: params.data?.livenessState,
|
|
1315
|
-
timeoutPhase: params.data?.timeoutPhase,
|
|
1316
|
-
providerStarted: params.data?.providerStarted,
|
|
1317
|
-
startedAt: params.startedAt,
|
|
1318
|
-
endedAt: params.endedAt
|
|
1319
|
-
});
|
|
1320
|
-
}
|
|
1321
|
-
function appendTaskEvent(event) {
|
|
1322
|
-
const summary = normalizeTaskSummary(event.summary);
|
|
1323
|
-
return {
|
|
1324
|
-
at: event.at,
|
|
1325
|
-
kind: event.kind,
|
|
1326
|
-
...summary ? { summary } : {}
|
|
1327
|
-
};
|
|
1328
|
-
}
|
|
1329
|
-
function loadTaskRegistryDeliveryRuntime() {
|
|
1330
|
-
const deliveryRuntimeOverride = globalThis[TASK_REGISTRY_DELIVERY_RUNTIME_OVERRIDE_KEY];
|
|
1331
|
-
if (deliveryRuntimeOverride) return Promise.resolve(deliveryRuntimeOverride);
|
|
1332
|
-
deliveryRuntimePromise ??= import("./task-registry-delivery-runtime-HaiKqj0A.js");
|
|
1333
|
-
return deliveryRuntimePromise;
|
|
1334
|
-
}
|
|
1335
|
-
function loadTaskRegistryControlRuntime() {
|
|
1336
|
-
const controlRuntimeOverride = globalThis[TASK_REGISTRY_CONTROL_RUNTIME_OVERRIDE_KEY];
|
|
1337
|
-
if (controlRuntimeOverride) return Promise.resolve(controlRuntimeOverride);
|
|
1338
|
-
controlRuntimePromise ??= Promise.resolve().then(() => {
|
|
1339
|
-
for (const candidate of TASK_REGISTRY_CONTROL_RUNTIME_CANDIDATES) try {
|
|
1340
|
-
return require(candidate);
|
|
1341
|
-
} catch {}
|
|
1342
|
-
throw new Error("Failed to load task registry control runtime.");
|
|
1343
|
-
});
|
|
1344
|
-
return controlRuntimePromise;
|
|
1345
|
-
}
|
|
1346
|
-
function addRunIdIndex(taskId, runId) {
|
|
1347
|
-
const trimmed = runId?.trim();
|
|
1348
|
-
if (!trimmed) return;
|
|
1349
|
-
let ids = taskIdsByRunId.get(trimmed);
|
|
1350
|
-
if (!ids) {
|
|
1351
|
-
ids = /* @__PURE__ */ new Set();
|
|
1352
|
-
taskIdsByRunId.set(trimmed, ids);
|
|
1353
|
-
}
|
|
1354
|
-
ids.add(taskId);
|
|
1355
|
-
}
|
|
1356
|
-
function addIndexedKey(index, key, taskId) {
|
|
1357
|
-
let ids = index.get(key);
|
|
1358
|
-
if (!ids) {
|
|
1359
|
-
ids = /* @__PURE__ */ new Set();
|
|
1360
|
-
index.set(key, ids);
|
|
1361
|
-
}
|
|
1362
|
-
ids.add(taskId);
|
|
1363
|
-
}
|
|
1364
|
-
function deleteIndexedKey(index, key, taskId) {
|
|
1365
|
-
const ids = index.get(key);
|
|
1366
|
-
if (!ids) return;
|
|
1367
|
-
ids.delete(taskId);
|
|
1368
|
-
if (ids.size === 0) index.delete(key);
|
|
1369
|
-
}
|
|
1370
|
-
function getTaskRelatedSessionIndexKeys(task) {
|
|
1371
|
-
return uniqueStrings([normalizeOptionalString(task.ownerKey), normalizeOptionalString(task.childSessionKey)].filter(Boolean));
|
|
1372
|
-
}
|
|
1373
|
-
function addOwnerKeyIndex(taskId, task) {
|
|
1374
|
-
const key = normalizeOptionalString(task.ownerKey);
|
|
1375
|
-
if (!key) return;
|
|
1376
|
-
addIndexedKey(taskIdsByOwnerKey, key, taskId);
|
|
1377
|
-
}
|
|
1378
|
-
function deleteOwnerKeyIndex(taskId, task) {
|
|
1379
|
-
const key = normalizeOptionalString(task.ownerKey);
|
|
1380
|
-
if (!key) return;
|
|
1381
|
-
deleteIndexedKey(taskIdsByOwnerKey, key, taskId);
|
|
1382
|
-
}
|
|
1383
|
-
function addParentFlowIdIndex(taskId, task) {
|
|
1384
|
-
const key = task.parentFlowId?.trim();
|
|
1385
|
-
if (!key) return;
|
|
1386
|
-
addIndexedKey(taskIdsByParentFlowId, key, taskId);
|
|
1387
|
-
}
|
|
1388
|
-
function deleteParentFlowIdIndex(taskId, task) {
|
|
1389
|
-
const key = task.parentFlowId?.trim();
|
|
1390
|
-
if (!key) return;
|
|
1391
|
-
deleteIndexedKey(taskIdsByParentFlowId, key, taskId);
|
|
1392
|
-
}
|
|
1393
|
-
function addRelatedSessionKeyIndex(taskId, task) {
|
|
1394
|
-
for (const sessionKey of getTaskRelatedSessionIndexKeys(task)) addIndexedKey(taskIdsByRelatedSessionKey, sessionKey, taskId);
|
|
1395
|
-
}
|
|
1396
|
-
function deleteRelatedSessionKeyIndex(taskId, task) {
|
|
1397
|
-
for (const sessionKey of getTaskRelatedSessionIndexKeys(task)) deleteIndexedKey(taskIdsByRelatedSessionKey, sessionKey, taskId);
|
|
1398
|
-
}
|
|
1399
|
-
function rebuildRunIdIndex() {
|
|
1400
|
-
taskIdsByRunId.clear();
|
|
1401
|
-
for (const [taskId, task] of tasks.entries()) addRunIdIndex(taskId, task.runId);
|
|
1402
|
-
}
|
|
1403
|
-
function rebuildOwnerKeyIndex() {
|
|
1404
|
-
taskIdsByOwnerKey.clear();
|
|
1405
|
-
for (const [taskId, task] of tasks.entries()) addOwnerKeyIndex(taskId, task);
|
|
1406
|
-
}
|
|
1407
|
-
function rebuildParentFlowIdIndex() {
|
|
1408
|
-
taskIdsByParentFlowId.clear();
|
|
1409
|
-
for (const [taskId, task] of tasks.entries()) addParentFlowIdIndex(taskId, task);
|
|
1410
|
-
}
|
|
1411
|
-
function rebuildRelatedSessionKeyIndex() {
|
|
1412
|
-
taskIdsByRelatedSessionKey.clear();
|
|
1413
|
-
for (const [taskId, task] of tasks.entries()) addRelatedSessionKeyIndex(taskId, task);
|
|
1414
|
-
}
|
|
1415
|
-
function getTasksByRunId(runId) {
|
|
1416
|
-
const ids = taskIdsByRunId.get(runId.trim());
|
|
1417
|
-
if (!ids || ids.size === 0) return [];
|
|
1418
|
-
return [...ids].map((taskId) => tasks.get(taskId)).filter((task) => Boolean(task));
|
|
1419
|
-
}
|
|
1420
|
-
function taskRunScopeKey(task) {
|
|
1421
|
-
return [
|
|
1422
|
-
task.runtime,
|
|
1423
|
-
task.scopeKind,
|
|
1424
|
-
normalizeOptionalString(task.ownerKey) ?? "",
|
|
1425
|
-
normalizeOptionalString(task.childSessionKey) ?? ""
|
|
1426
|
-
].join("\0");
|
|
1427
|
-
}
|
|
1428
|
-
function getTasksByRunScope(params) {
|
|
1429
|
-
const matches = getTasksByRunId(params.runId).filter((task) => !params.runtime || task.runtime === params.runtime);
|
|
1430
|
-
const sessionKey = normalizeOptionalString(params.sessionKey);
|
|
1431
|
-
if (sessionKey) {
|
|
1432
|
-
const childMatches = matches.filter((task) => normalizeOptionalString(task.childSessionKey) === sessionKey);
|
|
1433
|
-
if (childMatches.length > 0) return childMatches;
|
|
1434
|
-
return matches.filter((task) => task.scopeKind === "session" && normalizeOptionalString(task.ownerKey) === sessionKey);
|
|
1435
|
-
}
|
|
1436
|
-
return new Set(matches.map((task) => taskRunScopeKey(task))).size <= 1 ? matches : [];
|
|
1437
|
-
}
|
|
1438
|
-
function getPeerTasksForDelivery(task) {
|
|
1439
|
-
if (!task.runId?.trim()) return [];
|
|
1440
|
-
return getTasksByRunId(task.runId).filter((candidate) => candidate.runtime === task.runtime && candidate.scopeKind === task.scopeKind && (normalizeOptionalString(candidate.ownerKey) ?? "") === (normalizeOptionalString(task.ownerKey) ?? "") && (normalizeOptionalString(candidate.childSessionKey) ?? "") === (normalizeOptionalString(task.childSessionKey) ?? ""));
|
|
1441
|
-
}
|
|
1442
|
-
function taskLookupPriority(task) {
|
|
1443
|
-
return task.runtime === "cli" ? 1 : 0;
|
|
1444
|
-
}
|
|
1445
|
-
function pickPreferredRunIdTask(matches) {
|
|
1446
|
-
return [...matches].toSorted((left, right) => {
|
|
1447
|
-
const priorityDiff = taskLookupPriority(left) - taskLookupPriority(right);
|
|
1448
|
-
if (priorityDiff !== 0) return priorityDiff;
|
|
1449
|
-
return left.createdAt - right.createdAt;
|
|
1450
|
-
})[0];
|
|
1451
|
-
}
|
|
1452
|
-
function compareTasksNewestFirst(left, right) {
|
|
1453
|
-
const createdAtDiff = right.createdAt - left.createdAt;
|
|
1454
|
-
if (createdAtDiff !== 0) return createdAtDiff;
|
|
1455
|
-
return (right.insertionIndex ?? 0) - (left.insertionIndex ?? 0);
|
|
1456
|
-
}
|
|
1457
|
-
function findExistingTaskForCreate(params) {
|
|
1458
|
-
const runId = params.runId?.trim();
|
|
1459
|
-
const runScopeMatches = runId ? getTasksByRunId(runId).filter((task) => task.runtime === params.runtime && task.scopeKind === params.scopeKind && (normalizeOptionalString(task.ownerKey) ?? "") === (normalizeOptionalString(params.ownerKey) ?? "") && (normalizeOptionalString(task.childSessionKey) ?? "") === (normalizeOptionalString(params.childSessionKey) ?? "") && (normalizeOptionalString(task.parentFlowId) ?? "") === (normalizeOptionalString(params.parentFlowId) ?? "")) : [];
|
|
1460
|
-
const exact = runId ? runScopeMatches.find((task) => (normalizeOptionalString(task.label) ?? "") === (normalizeOptionalString(params.label) ?? "") && (normalizeOptionalString(task.task) ?? "") === (normalizeOptionalString(params.task) ?? "")) : void 0;
|
|
1461
|
-
if (exact) return exact;
|
|
1462
|
-
if (!runId || params.runtime !== "acp") return;
|
|
1463
|
-
if (runScopeMatches.length === 0) return;
|
|
1464
|
-
return pickPreferredRunIdTask(runScopeMatches);
|
|
1465
|
-
}
|
|
1466
|
-
function mergeExistingTaskForCreate(existing, params) {
|
|
1467
|
-
const patch = {};
|
|
1468
|
-
const requesterOrigin = normalizeDeliveryContext(params.requesterOrigin);
|
|
1469
|
-
const currentDeliveryState = taskDeliveryStates.get(existing.taskId);
|
|
1470
|
-
if (requesterOrigin && !currentDeliveryState?.requesterOrigin) upsertTaskDeliveryState({
|
|
1471
|
-
taskId: existing.taskId,
|
|
1472
|
-
requesterOrigin,
|
|
1473
|
-
lastNotifiedEventAt: currentDeliveryState?.lastNotifiedEventAt
|
|
1474
|
-
});
|
|
1475
|
-
if (params.sourceId?.trim() && !existing.sourceId?.trim()) patch.sourceId = params.sourceId.trim();
|
|
1476
|
-
if (params.taskKind?.trim() && !existing.taskKind?.trim()) patch.taskKind = params.taskKind.trim();
|
|
1477
|
-
if (params.parentFlowId?.trim() && !existing.parentFlowId?.trim()) {
|
|
1478
|
-
assertParentFlowLinkAllowed({
|
|
1479
|
-
ownerKey: existing.ownerKey,
|
|
1480
|
-
scopeKind: existing.scopeKind,
|
|
1481
|
-
parentFlowId: params.parentFlowId
|
|
1482
|
-
});
|
|
1483
|
-
patch.parentFlowId = params.parentFlowId.trim();
|
|
1484
|
-
}
|
|
1485
|
-
if (params.parentTaskId?.trim() && !existing.parentTaskId?.trim()) patch.parentTaskId = params.parentTaskId.trim();
|
|
1486
|
-
if (params.agentId?.trim() && !existing.agentId?.trim()) patch.agentId = params.agentId.trim();
|
|
1487
|
-
const nextLabel = params.label?.trim();
|
|
1488
|
-
if (params.preferMetadata) {
|
|
1489
|
-
if (nextLabel && (normalizeOptionalString(existing.label) ?? "") !== nextLabel) patch.label = nextLabel;
|
|
1490
|
-
const nextTask = params.task.trim();
|
|
1491
|
-
if (nextTask && (normalizeOptionalString(existing.task) ?? "") !== nextTask) patch.task = nextTask;
|
|
1492
|
-
} else if (nextLabel && !existing.label?.trim()) patch.label = nextLabel;
|
|
1493
|
-
if (params.deliveryStatus === "pending" && existing.deliveryStatus !== "delivered") patch.deliveryStatus = "pending";
|
|
1494
|
-
const notifyPolicy = ensureNotifyPolicy({
|
|
1495
|
-
notifyPolicy: params.notifyPolicy,
|
|
1496
|
-
deliveryStatus: params.deliveryStatus,
|
|
1497
|
-
ownerKey: existing.ownerKey,
|
|
1498
|
-
scopeKind: existing.scopeKind
|
|
1499
|
-
});
|
|
1500
|
-
if (notifyPolicy !== existing.notifyPolicy && existing.notifyPolicy === "silent") patch.notifyPolicy = notifyPolicy;
|
|
1501
|
-
if (Object.keys(patch).length === 0) return cloneTaskRecord(existing);
|
|
1502
|
-
return updateTask(existing.taskId, patch) ?? cloneTaskRecord(existing);
|
|
1503
|
-
}
|
|
1504
|
-
function resolveTaskAgentId(params) {
|
|
1505
|
-
return normalizeOptionalString(params.explicitAgentId) ?? parseAgentSessionKey(params.ownerKey)?.agentId ?? parseAgentSessionKey(params.requesterSessionKey)?.agentId;
|
|
1506
|
-
}
|
|
1507
|
-
function taskTerminalDeliveryIdempotencyKey(task) {
|
|
1508
|
-
const outcome = task.status === "succeeded" ? task.terminalOutcome ?? "default" : "default";
|
|
1509
|
-
return `task-terminal:${task.taskId}:${task.status}:${outcome}`;
|
|
1510
|
-
}
|
|
1511
|
-
function resolveTaskStateChangeIdempotencyKey(params) {
|
|
1512
|
-
if (params.owner.flowId) return `flow-event:${params.owner.flowId}:${params.task.taskId}:${params.latestEvent.at}:${params.latestEvent.kind}`;
|
|
1513
|
-
return `task-event:${params.task.taskId}:${params.latestEvent.at}:${params.latestEvent.kind}`;
|
|
1514
|
-
}
|
|
1515
|
-
function resolveTaskTerminalIdempotencyKey(task) {
|
|
1516
|
-
const owner = resolveTaskDeliveryOwner(task);
|
|
1517
|
-
if (owner.flowId) {
|
|
1518
|
-
const outcome = task.status === "succeeded" ? task.terminalOutcome ?? "default" : "default";
|
|
1519
|
-
return `flow-terminal:${owner.flowId}:${task.taskId}:${task.status}:${outcome}`;
|
|
1520
|
-
}
|
|
1521
|
-
return taskTerminalDeliveryIdempotencyKey(task);
|
|
1522
|
-
}
|
|
1523
|
-
function getLinkedFlowForDelivery(task) {
|
|
1524
|
-
const flowId = task.parentFlowId?.trim();
|
|
1525
|
-
if (!flowId || task.scopeKind !== "session") return;
|
|
1526
|
-
const flow = getTaskFlowById(flowId);
|
|
1527
|
-
if (!flow) return;
|
|
1528
|
-
if (normalizeOptionalString(flow.ownerKey) !== normalizeOptionalString(task.ownerKey)) return;
|
|
1529
|
-
return flow;
|
|
1530
|
-
}
|
|
1531
|
-
function resolveTaskDeliveryOwner(task) {
|
|
1532
|
-
const flow = getLinkedFlowForDelivery(task);
|
|
1533
|
-
if (flow) return {
|
|
1534
|
-
sessionKey: flow.ownerKey.trim(),
|
|
1535
|
-
requesterOrigin: normalizeDeliveryContext(flow.requesterOrigin ?? taskDeliveryStates.get(task.taskId)?.requesterOrigin),
|
|
1536
|
-
flowId: flow.flowId
|
|
1537
|
-
};
|
|
1538
|
-
if (task.scopeKind !== "session") return {};
|
|
1539
|
-
return {
|
|
1540
|
-
sessionKey: task.ownerKey.trim(),
|
|
1541
|
-
requesterOrigin: normalizeDeliveryContext(taskDeliveryStates.get(task.taskId)?.requesterOrigin)
|
|
1542
|
-
};
|
|
1543
|
-
}
|
|
1544
|
-
function syncManagedFlowCancellationFromTask(task) {
|
|
1545
|
-
const flowId = task.parentFlowId?.trim();
|
|
1546
|
-
if (!flowId) return;
|
|
1547
|
-
let flow = getTaskFlowById(flowId);
|
|
1548
|
-
if (!flow || flow.syncMode !== "managed" || flow.cancelRequestedAt == null || isTerminalFlowStatus(flow.status)) return;
|
|
1549
|
-
if (listTasksForFlowId(flowId).some((candidate) => isActiveTaskStatus(candidate.status))) return;
|
|
1550
|
-
const endedAt = task.endedAt ?? task.lastEventAt ?? Date.now();
|
|
1551
|
-
for (let attempt = 0; attempt < 2; attempt += 1) {
|
|
1552
|
-
const result = updateFlowRecordByIdExpectedRevision({
|
|
1553
|
-
flowId,
|
|
1554
|
-
expectedRevision: flow.revision,
|
|
1555
|
-
patch: {
|
|
1556
|
-
status: "cancelled",
|
|
1557
|
-
blockedTaskId: null,
|
|
1558
|
-
blockedSummary: null,
|
|
1559
|
-
waitJson: null,
|
|
1560
|
-
endedAt,
|
|
1561
|
-
updatedAt: endedAt
|
|
1562
|
-
}
|
|
1563
|
-
});
|
|
1564
|
-
if (result.applied || result.reason === "not_found") return;
|
|
1565
|
-
flow = result.current;
|
|
1566
|
-
if (!flow || flow.syncMode !== "managed" || flow.cancelRequestedAt == null || isTerminalFlowStatus(flow.status)) return;
|
|
1567
|
-
if (listTasksForFlowId(flowId).some((candidate) => isActiveTaskStatus(candidate.status))) return;
|
|
1568
|
-
}
|
|
1569
|
-
}
|
|
1570
|
-
function restoreTaskRegistryOnce() {
|
|
1571
|
-
if (restoreAttempted) return;
|
|
1572
|
-
restoreAttempted = true;
|
|
1573
|
-
try {
|
|
1574
|
-
const restored = getTaskRegistryStore().loadSnapshot();
|
|
1575
|
-
if (restored.tasks.size === 0 && restored.deliveryStates.size === 0) return;
|
|
1576
|
-
for (const [taskId, task] of restored.tasks.entries()) tasks.set(taskId, normalizeTaskTimestamps(task));
|
|
1577
|
-
for (const [taskId, state] of restored.deliveryStates.entries()) taskDeliveryStates.set(taskId, state);
|
|
1578
|
-
rebuildRunIdIndex();
|
|
1579
|
-
rebuildOwnerKeyIndex();
|
|
1580
|
-
rebuildParentFlowIdIndex();
|
|
1581
|
-
rebuildRelatedSessionKeyIndex();
|
|
1582
|
-
emitTaskRegistryObserverEvent(() => ({
|
|
1583
|
-
kind: "restored",
|
|
1584
|
-
tasks: snapshotTaskRecords(tasks)
|
|
1585
|
-
}));
|
|
1586
|
-
} catch (error) {
|
|
1587
|
-
log.warn("Failed to restore task registry", { error });
|
|
1588
|
-
}
|
|
1589
|
-
}
|
|
1590
|
-
function ensureTaskRegistryReady() {
|
|
1591
|
-
restoreTaskRegistryOnce();
|
|
1592
|
-
ensureListener();
|
|
1593
|
-
}
|
|
1594
|
-
function reloadTaskRegistryFromStore() {
|
|
1595
|
-
clearTaskRegistryMemory();
|
|
1596
|
-
restoreAttempted = false;
|
|
1597
|
-
restoreTaskRegistryOnce();
|
|
1598
|
-
}
|
|
1599
|
-
function updateTask(taskId, patch) {
|
|
1600
|
-
const current = tasks.get(taskId);
|
|
1601
|
-
if (!current) return null;
|
|
1602
|
-
const next = normalizeTaskTimestamps({
|
|
1603
|
-
...current,
|
|
1604
|
-
...patch
|
|
1605
|
-
});
|
|
1606
|
-
if (isTerminalTaskStatus(next.status) && typeof next.cleanupAfter !== "number") next.cleanupAfter = resolveTaskCleanupAfter({
|
|
1607
|
-
...next,
|
|
1608
|
-
createdAt: next.createdAt ?? Date.now()
|
|
1609
|
-
});
|
|
1610
|
-
const sessionIndexChanged = normalizeOptionalString(current.ownerKey) !== normalizeOptionalString(next.ownerKey) || normalizeOptionalString(current.childSessionKey) !== normalizeOptionalString(next.childSessionKey);
|
|
1611
|
-
const parentFlowIndexChanged = current.parentFlowId?.trim() !== next.parentFlowId?.trim();
|
|
1612
|
-
tasks.set(taskId, next);
|
|
1613
|
-
if (patch.runId && patch.runId !== current.runId) rebuildRunIdIndex();
|
|
1614
|
-
if (sessionIndexChanged) {
|
|
1615
|
-
deleteOwnerKeyIndex(taskId, current);
|
|
1616
|
-
addOwnerKeyIndex(taskId, next);
|
|
1617
|
-
deleteRelatedSessionKeyIndex(taskId, current);
|
|
1618
|
-
addRelatedSessionKeyIndex(taskId, next);
|
|
1619
|
-
}
|
|
1620
|
-
if (parentFlowIndexChanged) {
|
|
1621
|
-
deleteParentFlowIdIndex(taskId, current);
|
|
1622
|
-
addParentFlowIdIndex(taskId, next);
|
|
1623
|
-
}
|
|
1624
|
-
persistTaskUpsert(next);
|
|
1625
|
-
try {
|
|
1626
|
-
syncFlowFromTask(next);
|
|
1627
|
-
} catch (error) {
|
|
1628
|
-
log.warn("Failed to sync parent flow from task update", {
|
|
1629
|
-
taskId,
|
|
1630
|
-
flowId: next.parentFlowId,
|
|
1631
|
-
error
|
|
1632
|
-
});
|
|
1633
|
-
}
|
|
1634
|
-
try {
|
|
1635
|
-
syncManagedFlowCancellationFromTask(next);
|
|
1636
|
-
} catch (error) {
|
|
1637
|
-
log.warn("Failed to finalize managed flow cancellation from task update", {
|
|
1638
|
-
taskId,
|
|
1639
|
-
flowId: next.parentFlowId,
|
|
1640
|
-
error
|
|
1641
|
-
});
|
|
1642
|
-
}
|
|
1643
|
-
emitTaskRegistryObserverEvent(() => ({
|
|
1644
|
-
kind: "upserted",
|
|
1645
|
-
task: cloneTaskRecord(next),
|
|
1646
|
-
previous: cloneTaskRecord(current)
|
|
1647
|
-
}));
|
|
1648
|
-
return cloneTaskRecord(next);
|
|
1649
|
-
}
|
|
1650
|
-
function upsertTaskDeliveryState(state) {
|
|
1651
|
-
const current = taskDeliveryStates.get(state.taskId);
|
|
1652
|
-
const next = {
|
|
1653
|
-
taskId: state.taskId,
|
|
1654
|
-
...state.requesterOrigin ? { requesterOrigin: normalizeDeliveryContext(state.requesterOrigin) } : {},
|
|
1655
|
-
...state.lastNotifiedEventAt != null ? { lastNotifiedEventAt: state.lastNotifiedEventAt } : {}
|
|
1656
|
-
};
|
|
1657
|
-
if (!next.requesterOrigin && typeof next.lastNotifiedEventAt !== "number" && !current) return cloneTaskDeliveryState({ taskId: state.taskId });
|
|
1658
|
-
taskDeliveryStates.set(state.taskId, next);
|
|
1659
|
-
persistTaskDeliveryStateUpsert(next);
|
|
1660
|
-
return cloneTaskDeliveryState(next);
|
|
1661
|
-
}
|
|
1662
|
-
function getTaskDeliveryState(taskId) {
|
|
1663
|
-
const state = taskDeliveryStates.get(taskId);
|
|
1664
|
-
return state ? cloneTaskDeliveryState(state) : void 0;
|
|
1665
|
-
}
|
|
1666
|
-
function canDeliverTaskToRequesterOrigin(task) {
|
|
1667
|
-
const owner = resolveTaskDeliveryOwner(task);
|
|
1668
|
-
if (shouldRouteCompletionThroughRequesterSession(owner.sessionKey)) return false;
|
|
1669
|
-
const origin = owner.requesterOrigin;
|
|
1670
|
-
const channel = origin?.channel?.trim();
|
|
1671
|
-
const to = origin?.to?.trim();
|
|
1672
|
-
return Boolean(channel && to && isDeliverableMessageChannel(channel));
|
|
1673
|
-
}
|
|
1674
|
-
function resolveMissingOwnerDeliveryStatus(task) {
|
|
1675
|
-
return task.scopeKind === "system" ? "not_applicable" : "parent_missing";
|
|
1676
|
-
}
|
|
1677
|
-
function queueTaskSystemEvent(task, text) {
|
|
1678
|
-
const owner = resolveTaskDeliveryOwner(task);
|
|
1679
|
-
const ownerKey = owner.sessionKey?.trim();
|
|
1680
|
-
if (!ownerKey) return false;
|
|
1681
|
-
enqueueSystemEvent(text, {
|
|
1682
|
-
sessionKey: ownerKey,
|
|
1683
|
-
contextKey: `task:${task.taskId}`,
|
|
1684
|
-
deliveryContext: owner.requesterOrigin
|
|
1685
|
-
});
|
|
1686
|
-
requestHeartbeat({
|
|
1687
|
-
source: "background-task",
|
|
1688
|
-
intent: "immediate",
|
|
1689
|
-
reason: "background-task",
|
|
1690
|
-
sessionKey: ownerKey
|
|
1691
|
-
});
|
|
1692
|
-
return true;
|
|
1693
|
-
}
|
|
1694
|
-
function queueBlockedTaskFollowup(task) {
|
|
1695
|
-
const followupText = formatTaskBlockedFollowupMessage(task);
|
|
1696
|
-
if (!followupText) return false;
|
|
1697
|
-
const owner = resolveTaskDeliveryOwner(task);
|
|
1698
|
-
const ownerKey = owner.sessionKey?.trim();
|
|
1699
|
-
if (!ownerKey) return false;
|
|
1700
|
-
enqueueSystemEvent(followupText, {
|
|
1701
|
-
sessionKey: ownerKey,
|
|
1702
|
-
contextKey: `task:${task.taskId}:blocked-followup`,
|
|
1703
|
-
deliveryContext: owner.requesterOrigin
|
|
1704
|
-
});
|
|
1705
|
-
requestHeartbeat({
|
|
1706
|
-
source: "background-task-blocked",
|
|
1707
|
-
intent: "immediate",
|
|
1708
|
-
reason: "background-task-blocked",
|
|
1709
|
-
sessionKey: ownerKey
|
|
1710
|
-
});
|
|
1711
|
-
return true;
|
|
1712
|
-
}
|
|
1713
|
-
async function maybeDeliverTaskTerminalUpdate(taskId) {
|
|
1714
|
-
ensureTaskRegistryReady();
|
|
1715
|
-
const current = tasks.get(taskId);
|
|
1716
|
-
if (!current || !shouldAutoDeliverTaskTerminalUpdate(current)) return current ? cloneTaskRecord(current) : null;
|
|
1717
|
-
if (tasksWithPendingDelivery.has(taskId)) return cloneTaskRecord(current);
|
|
1718
|
-
tasksWithPendingDelivery.add(taskId);
|
|
1719
|
-
try {
|
|
1720
|
-
const latest = tasks.get(taskId);
|
|
1721
|
-
if (!latest || !shouldAutoDeliverTaskTerminalUpdate(latest)) return latest ? cloneTaskRecord(latest) : null;
|
|
1722
|
-
if (shouldSuppressDuplicateTerminalDelivery({
|
|
1723
|
-
task: latest,
|
|
1724
|
-
preferredTaskId: (latest.runId ? pickPreferredRunIdTask(getPeerTasksForDelivery(latest)) : void 0)?.taskId
|
|
1725
|
-
})) return updateTask(taskId, {
|
|
1726
|
-
deliveryStatus: "not_applicable",
|
|
1727
|
-
lastEventAt: Date.now()
|
|
1728
|
-
});
|
|
1729
|
-
const owner = resolveTaskDeliveryOwner(latest);
|
|
1730
|
-
const ownerSessionKey = owner.sessionKey?.trim();
|
|
1731
|
-
if (!ownerSessionKey) return updateTask(taskId, {
|
|
1732
|
-
deliveryStatus: resolveMissingOwnerDeliveryStatus(latest),
|
|
1733
|
-
lastEventAt: Date.now()
|
|
1734
|
-
});
|
|
1735
|
-
const shouldRouteParentReview = shouldUseParentReviewTaskTerminalMessage(latest);
|
|
1736
|
-
const canDeliverDirect = canDeliverTaskToRequesterOrigin(latest);
|
|
1737
|
-
const directEventText = formatTaskTerminalMessage(latest);
|
|
1738
|
-
const sessionEventText = formatTaskTerminalMessage(latest, shouldRouteParentReview ? { surface: "parent_session" } : void 0);
|
|
1739
|
-
if (shouldRouteParentReview || !canDeliverDirect) try {
|
|
1740
|
-
queueTaskSystemEvent(latest, sessionEventText);
|
|
1741
|
-
if (latest.terminalOutcome === "blocked") queueBlockedTaskFollowup(latest);
|
|
1742
|
-
return updateTask(taskId, {
|
|
1743
|
-
deliveryStatus: shouldRouteParentReview && canDeliverDirect ? "pending" : "session_queued",
|
|
1744
|
-
lastEventAt: Date.now()
|
|
1745
|
-
});
|
|
1746
|
-
} catch (error) {
|
|
1747
|
-
log.warn("Failed to queue background task session delivery", {
|
|
1748
|
-
taskId,
|
|
1749
|
-
ownerKey: latest.ownerKey,
|
|
1750
|
-
error
|
|
1751
|
-
});
|
|
1752
|
-
return updateTask(taskId, {
|
|
1753
|
-
deliveryStatus: "failed",
|
|
1754
|
-
lastEventAt: Date.now()
|
|
1755
|
-
});
|
|
1756
|
-
}
|
|
1757
|
-
try {
|
|
1758
|
-
const { sendMessage } = await loadTaskRegistryDeliveryRuntime();
|
|
1759
|
-
const requesterAgentId = parseAgentSessionKey(ownerSessionKey)?.agentId;
|
|
1760
|
-
const idempotencyKey = resolveTaskTerminalIdempotencyKey(latest);
|
|
1761
|
-
await sendMessage({
|
|
1762
|
-
channel: owner.requesterOrigin?.channel,
|
|
1763
|
-
to: owner.requesterOrigin?.to ?? "",
|
|
1764
|
-
accountId: owner.requesterOrigin?.accountId,
|
|
1765
|
-
threadId: owner.requesterOrigin?.threadId,
|
|
1766
|
-
content: directEventText,
|
|
1767
|
-
agentId: requesterAgentId,
|
|
1768
|
-
idempotencyKey,
|
|
1769
|
-
mirror: {
|
|
1770
|
-
sessionKey: ownerSessionKey,
|
|
1771
|
-
agentId: requesterAgentId,
|
|
1772
|
-
idempotencyKey
|
|
1773
|
-
}
|
|
1774
|
-
});
|
|
1775
|
-
if (latest.terminalOutcome === "blocked") queueBlockedTaskFollowup(latest);
|
|
1776
|
-
return updateTask(taskId, {
|
|
1777
|
-
deliveryStatus: "delivered",
|
|
1778
|
-
lastEventAt: Date.now()
|
|
1779
|
-
});
|
|
1780
|
-
} catch (error) {
|
|
1781
|
-
log.warn("Failed to deliver background task update", {
|
|
1782
|
-
taskId,
|
|
1783
|
-
ownerKey: ownerSessionKey,
|
|
1784
|
-
requesterOrigin: owner.requesterOrigin,
|
|
1785
|
-
error
|
|
1786
|
-
});
|
|
1787
|
-
try {
|
|
1788
|
-
queueTaskSystemEvent(latest, sessionEventText);
|
|
1789
|
-
if (latest.terminalOutcome === "blocked") queueBlockedTaskFollowup(latest);
|
|
1790
|
-
} catch (fallbackError) {
|
|
1791
|
-
log.warn("Failed to queue background task fallback event", {
|
|
1792
|
-
taskId,
|
|
1793
|
-
ownerKey: latest.ownerKey,
|
|
1794
|
-
error: fallbackError
|
|
1795
|
-
});
|
|
1796
|
-
}
|
|
1797
|
-
return updateTask(taskId, {
|
|
1798
|
-
deliveryStatus: "failed",
|
|
1799
|
-
lastEventAt: Date.now()
|
|
1800
|
-
});
|
|
1801
|
-
}
|
|
1802
|
-
} finally {
|
|
1803
|
-
tasksWithPendingDelivery.delete(taskId);
|
|
1804
|
-
}
|
|
1805
|
-
}
|
|
1806
|
-
async function maybeDeliverTaskStateChangeUpdate(taskId, latestEvent) {
|
|
1807
|
-
ensureTaskRegistryReady();
|
|
1808
|
-
const current = tasks.get(taskId);
|
|
1809
|
-
if (!current || !shouldAutoDeliverTaskStateChange(current)) return current ? cloneTaskRecord(current) : null;
|
|
1810
|
-
const deliveryState = getTaskDeliveryState(taskId);
|
|
1811
|
-
if (!latestEvent || (deliveryState?.lastNotifiedEventAt ?? 0) >= latestEvent.at) return cloneTaskRecord(current);
|
|
1812
|
-
const eventText = formatTaskStateChangeMessage(current, latestEvent);
|
|
1813
|
-
if (!eventText) return cloneTaskRecord(current);
|
|
1814
|
-
try {
|
|
1815
|
-
const owner = resolveTaskDeliveryOwner(current);
|
|
1816
|
-
const ownerSessionKey = owner.sessionKey?.trim();
|
|
1817
|
-
if (!ownerSessionKey) return updateTask(taskId, {
|
|
1818
|
-
deliveryStatus: resolveMissingOwnerDeliveryStatus(current),
|
|
1819
|
-
lastEventAt: Date.now()
|
|
1820
|
-
});
|
|
1821
|
-
if (!canDeliverTaskToRequesterOrigin(current)) {
|
|
1822
|
-
queueTaskSystemEvent(current, eventText);
|
|
1823
|
-
upsertTaskDeliveryState({
|
|
1824
|
-
taskId,
|
|
1825
|
-
requesterOrigin: deliveryState?.requesterOrigin,
|
|
1826
|
-
lastNotifiedEventAt: latestEvent.at
|
|
1827
|
-
});
|
|
1828
|
-
return updateTask(taskId, { lastEventAt: Date.now() });
|
|
1829
|
-
}
|
|
1830
|
-
const { sendMessage } = await loadTaskRegistryDeliveryRuntime();
|
|
1831
|
-
const requesterAgentId = parseAgentSessionKey(ownerSessionKey)?.agentId;
|
|
1832
|
-
const idempotencyKey = resolveTaskStateChangeIdempotencyKey({
|
|
1833
|
-
task: current,
|
|
1834
|
-
latestEvent,
|
|
1835
|
-
owner
|
|
1836
|
-
});
|
|
1837
|
-
await sendMessage({
|
|
1838
|
-
channel: owner.requesterOrigin?.channel,
|
|
1839
|
-
to: owner.requesterOrigin?.to ?? "",
|
|
1840
|
-
accountId: owner.requesterOrigin?.accountId,
|
|
1841
|
-
threadId: owner.requesterOrigin?.threadId,
|
|
1842
|
-
content: eventText,
|
|
1843
|
-
agentId: requesterAgentId,
|
|
1844
|
-
idempotencyKey,
|
|
1845
|
-
mirror: {
|
|
1846
|
-
sessionKey: ownerSessionKey,
|
|
1847
|
-
agentId: requesterAgentId,
|
|
1848
|
-
idempotencyKey
|
|
1849
|
-
}
|
|
1850
|
-
});
|
|
1851
|
-
upsertTaskDeliveryState({
|
|
1852
|
-
taskId,
|
|
1853
|
-
requesterOrigin: deliveryState?.requesterOrigin,
|
|
1854
|
-
lastNotifiedEventAt: latestEvent.at
|
|
1855
|
-
});
|
|
1856
|
-
return updateTask(taskId, { lastEventAt: Date.now() });
|
|
1857
|
-
} catch (error) {
|
|
1858
|
-
log.warn("Failed to deliver background task state change", {
|
|
1859
|
-
taskId,
|
|
1860
|
-
ownerKey: current.ownerKey,
|
|
1861
|
-
error
|
|
1862
|
-
});
|
|
1863
|
-
return cloneTaskRecord(current);
|
|
1864
|
-
}
|
|
1865
|
-
}
|
|
1866
|
-
function setTaskCleanupAfterById(params) {
|
|
1867
|
-
ensureTaskRegistryReady();
|
|
1868
|
-
return updateTask(params.taskId, { cleanupAfter: params.cleanupAfter });
|
|
1869
|
-
}
|
|
1870
|
-
function markTaskTerminalById(params) {
|
|
1871
|
-
ensureTaskRegistryReady();
|
|
1872
|
-
return updateTask(params.taskId, {
|
|
1873
|
-
status: params.status,
|
|
1874
|
-
endedAt: params.endedAt,
|
|
1875
|
-
lastEventAt: params.lastEventAt ?? params.endedAt,
|
|
1876
|
-
...params.error !== void 0 ? { error: params.error } : {},
|
|
1877
|
-
...params.terminalSummary !== void 0 ? { terminalSummary: normalizeTaskSummary(params.terminalSummary) } : {},
|
|
1878
|
-
...params.terminalOutcome !== void 0 ? { terminalOutcome: resolveTaskTerminalOutcome({
|
|
1879
|
-
status: params.status,
|
|
1880
|
-
terminalOutcome: params.terminalOutcome
|
|
1881
|
-
}) } : {}
|
|
1882
|
-
});
|
|
1883
|
-
}
|
|
1884
|
-
function markTaskLostById(params) {
|
|
1885
|
-
ensureTaskRegistryReady();
|
|
1886
|
-
return updateTask(params.taskId, {
|
|
1887
|
-
status: "lost",
|
|
1888
|
-
endedAt: params.endedAt,
|
|
1889
|
-
lastEventAt: params.lastEventAt ?? params.endedAt,
|
|
1890
|
-
...params.error !== void 0 ? { error: params.error } : {},
|
|
1891
|
-
...params.cleanupAfter !== void 0 ? { cleanupAfter: params.cleanupAfter } : {}
|
|
1892
|
-
});
|
|
1893
|
-
}
|
|
1894
|
-
function updateTasksByRunId(params) {
|
|
1895
|
-
const matches = getTasksByRunScope(params);
|
|
1896
|
-
if (matches.length === 0) return [];
|
|
1897
|
-
const updated = [];
|
|
1898
|
-
for (const match of matches) {
|
|
1899
|
-
const task = updateTask(match.taskId, params.patch);
|
|
1900
|
-
if (task) updated.push(task);
|
|
1901
|
-
}
|
|
1902
|
-
return updated;
|
|
1903
|
-
}
|
|
1904
|
-
function ensureListener() {
|
|
1905
|
-
if (listenerStarted) return;
|
|
1906
|
-
listenerStarted = true;
|
|
1907
|
-
onAgentEvent((evt) => {
|
|
1908
|
-
restoreTaskRegistryOnce();
|
|
1909
|
-
const scopedTasks = getTasksByRunScope({
|
|
1910
|
-
runId: evt.runId,
|
|
1911
|
-
sessionKey: evt.sessionKey
|
|
1912
|
-
});
|
|
1913
|
-
if (scopedTasks.length === 0) return;
|
|
1914
|
-
const now = evt.ts || Date.now();
|
|
1915
|
-
for (const current of scopedTasks) {
|
|
1916
|
-
if (isTerminalTaskStatus(current.status)) continue;
|
|
1917
|
-
const patch = { lastEventAt: now };
|
|
1918
|
-
if (evt.stream === "lifecycle") {
|
|
1919
|
-
const phase = typeof evt.data?.phase === "string" ? evt.data.phase : void 0;
|
|
1920
|
-
const startedAt = typeof evt.data?.startedAt === "number" ? evt.data.startedAt : current.startedAt;
|
|
1921
|
-
const endedAt = typeof evt.data?.endedAt === "number" ? evt.data.endedAt : void 0;
|
|
1922
|
-
if (startedAt) patch.startedAt = startedAt;
|
|
1923
|
-
if (phase === "start") patch.status = "running";
|
|
1924
|
-
else if (phase === "end") {
|
|
1925
|
-
const terminal = buildTaskLifecycleTerminalOutcome({
|
|
1926
|
-
phase,
|
|
1927
|
-
data: evt.data,
|
|
1928
|
-
startedAt,
|
|
1929
|
-
endedAt: endedAt ?? now
|
|
1930
|
-
});
|
|
1931
|
-
patch.status = mapAgentRunTerminalOutcomeToTaskStatus(terminal);
|
|
1932
|
-
patch.endedAt = terminal.endedAt ?? now;
|
|
1933
|
-
if (terminal.error) patch.error = terminal.error;
|
|
1934
|
-
} else if (phase === "error") {
|
|
1935
|
-
const terminal = buildTaskLifecycleTerminalOutcome({
|
|
1936
|
-
phase,
|
|
1937
|
-
data: evt.data,
|
|
1938
|
-
startedAt,
|
|
1939
|
-
endedAt: endedAt ?? now
|
|
1940
|
-
});
|
|
1941
|
-
patch.status = mapAgentRunTerminalOutcomeToTaskStatus(terminal);
|
|
1942
|
-
patch.endedAt = terminal.endedAt ?? now;
|
|
1943
|
-
patch.error = terminal.error ?? current.error;
|
|
1944
|
-
}
|
|
1945
|
-
} else if (evt.stream === "error") patch.error = typeof evt.data?.error === "string" ? evt.data.error : current.error;
|
|
1946
|
-
const stateChangeEvent = patch.status && patch.status !== current.status ? appendTaskEvent({
|
|
1947
|
-
at: now,
|
|
1948
|
-
kind: patch.status,
|
|
1949
|
-
summary: patch.status === "failed" ? patch.error ?? current.error : patch.status === "succeeded" ? current.terminalSummary : void 0
|
|
1950
|
-
}) : void 0;
|
|
1951
|
-
if (updateTask(current.taskId, patch)) {
|
|
1952
|
-
maybeDeliverTaskStateChangeUpdate(current.taskId, stateChangeEvent);
|
|
1953
|
-
maybeDeliverTaskTerminalUpdate(current.taskId);
|
|
1954
|
-
}
|
|
1955
|
-
}
|
|
1956
|
-
});
|
|
1957
|
-
}
|
|
1958
|
-
function createTaskRecord(params) {
|
|
1959
|
-
ensureTaskRegistryReady();
|
|
1960
|
-
const requesterSessionKey = resolveTaskRequesterSessionKey(params);
|
|
1961
|
-
const scopeKind = resolveTaskScopeKind({
|
|
1962
|
-
scopeKind: params.scopeKind,
|
|
1963
|
-
requesterSessionKey
|
|
1964
|
-
});
|
|
1965
|
-
const ownerKey = resolveTaskOwnerKey({
|
|
1966
|
-
requesterSessionKey,
|
|
1967
|
-
ownerKey: params.ownerKey
|
|
1968
|
-
});
|
|
1969
|
-
const agentId = resolveTaskAgentId({
|
|
1970
|
-
explicitAgentId: params.agentId,
|
|
1971
|
-
ownerKey,
|
|
1972
|
-
requesterSessionKey
|
|
1973
|
-
});
|
|
1974
|
-
assertTaskOwner({
|
|
1975
|
-
ownerKey,
|
|
1976
|
-
scopeKind
|
|
1977
|
-
});
|
|
1978
|
-
assertParentFlowLinkAllowed({
|
|
1979
|
-
ownerKey,
|
|
1980
|
-
scopeKind,
|
|
1981
|
-
parentFlowId: params.parentFlowId
|
|
1982
|
-
});
|
|
1983
|
-
const existing = findExistingTaskForCreate({
|
|
1984
|
-
runtime: params.runtime,
|
|
1985
|
-
ownerKey,
|
|
1986
|
-
scopeKind,
|
|
1987
|
-
childSessionKey: params.childSessionKey,
|
|
1988
|
-
parentFlowId: params.parentFlowId,
|
|
1989
|
-
runId: params.runId,
|
|
1990
|
-
label: params.label,
|
|
1991
|
-
task: params.task
|
|
1992
|
-
});
|
|
1993
|
-
if (existing) return mergeExistingTaskForCreate(existing, {
|
|
1994
|
-
...params,
|
|
1995
|
-
agentId
|
|
1996
|
-
});
|
|
1997
|
-
const now = Date.now();
|
|
1998
|
-
const taskId = crypto.randomUUID();
|
|
1999
|
-
const status = normalizeTaskStatus(params.status);
|
|
2000
|
-
const deliveryStatus = params.deliveryStatus ?? ensureDeliveryStatus({
|
|
2001
|
-
ownerKey,
|
|
2002
|
-
scopeKind
|
|
2003
|
-
});
|
|
2004
|
-
const notifyPolicy = ensureNotifyPolicy({
|
|
2005
|
-
notifyPolicy: params.notifyPolicy,
|
|
2006
|
-
deliveryStatus,
|
|
2007
|
-
ownerKey,
|
|
2008
|
-
scopeKind
|
|
2009
|
-
});
|
|
2010
|
-
const lastEventAt = params.lastEventAt ?? params.startedAt ?? now;
|
|
2011
|
-
const record = normalizeTaskTimestamps({
|
|
2012
|
-
taskId,
|
|
2013
|
-
runtime: params.runtime,
|
|
2014
|
-
taskKind: normalizeOptionalString(params.taskKind),
|
|
2015
|
-
sourceId: normalizeOptionalString(params.sourceId),
|
|
2016
|
-
requesterSessionKey,
|
|
2017
|
-
ownerKey,
|
|
2018
|
-
scopeKind,
|
|
2019
|
-
childSessionKey: params.childSessionKey,
|
|
2020
|
-
parentFlowId: normalizeOptionalString(params.parentFlowId),
|
|
2021
|
-
parentTaskId: normalizeOptionalString(params.parentTaskId),
|
|
2022
|
-
agentId,
|
|
2023
|
-
runId: normalizeOptionalString(params.runId),
|
|
2024
|
-
label: normalizeOptionalString(params.label),
|
|
2025
|
-
task: params.task,
|
|
2026
|
-
status,
|
|
2027
|
-
deliveryStatus,
|
|
2028
|
-
notifyPolicy,
|
|
2029
|
-
createdAt: now,
|
|
2030
|
-
startedAt: params.startedAt,
|
|
2031
|
-
lastEventAt,
|
|
2032
|
-
cleanupAfter: params.cleanupAfter,
|
|
2033
|
-
progressSummary: normalizeTaskSummary(params.progressSummary),
|
|
2034
|
-
terminalSummary: normalizeTaskSummary(params.terminalSummary),
|
|
2035
|
-
terminalOutcome: resolveTaskTerminalOutcome({
|
|
2036
|
-
status,
|
|
2037
|
-
terminalOutcome: params.terminalOutcome
|
|
2038
|
-
})
|
|
2039
|
-
});
|
|
2040
|
-
if (isTerminalTaskStatus(record.status) && typeof record.cleanupAfter !== "number") record.cleanupAfter = resolveTaskCleanupAfter(record);
|
|
2041
|
-
tasks.set(taskId, record);
|
|
2042
|
-
const requesterOrigin = normalizeDeliveryContext(params.requesterOrigin);
|
|
2043
|
-
if (requesterOrigin) taskDeliveryStates.set(taskId, {
|
|
2044
|
-
taskId,
|
|
2045
|
-
requesterOrigin
|
|
2046
|
-
});
|
|
2047
|
-
addRunIdIndex(taskId, record.runId);
|
|
2048
|
-
addOwnerKeyIndex(taskId, record);
|
|
2049
|
-
addParentFlowIdIndex(taskId, record);
|
|
2050
|
-
addRelatedSessionKeyIndex(taskId, record);
|
|
2051
|
-
persistTaskUpsert(record);
|
|
2052
|
-
try {
|
|
2053
|
-
syncFlowFromTask(record);
|
|
2054
|
-
} catch (error) {
|
|
2055
|
-
log.warn("Failed to sync parent flow from task create", {
|
|
2056
|
-
taskId: record.taskId,
|
|
2057
|
-
flowId: record.parentFlowId,
|
|
2058
|
-
error
|
|
2059
|
-
});
|
|
2060
|
-
}
|
|
2061
|
-
emitTaskRegistryObserverEvent(() => ({
|
|
2062
|
-
kind: "upserted",
|
|
2063
|
-
task: cloneTaskRecord(record)
|
|
2064
|
-
}));
|
|
2065
|
-
if (isTerminalTaskStatus(record.status)) maybeDeliverTaskTerminalUpdate(taskId);
|
|
2066
|
-
return cloneTaskRecord(record);
|
|
2067
|
-
}
|
|
2068
|
-
function updateTaskStateByRunId(params) {
|
|
2069
|
-
ensureTaskRegistryReady();
|
|
2070
|
-
const matches = getTasksByRunScope(params);
|
|
2071
|
-
if (matches.length === 0) return [];
|
|
2072
|
-
const updated = [];
|
|
2073
|
-
for (const current of matches) {
|
|
2074
|
-
const patch = {};
|
|
2075
|
-
const nextStatus = params.status ? normalizeTaskStatus(params.status) : current.status;
|
|
2076
|
-
if (params.status && !shouldApplyRunScopedStatusUpdate({
|
|
2077
|
-
currentStatus: current.status,
|
|
2078
|
-
nextStatus
|
|
2079
|
-
})) continue;
|
|
2080
|
-
const eventAt = params.lastEventAt ?? params.endedAt ?? Date.now();
|
|
2081
|
-
if (params.status) patch.status = normalizeTaskStatus(params.status);
|
|
2082
|
-
if (params.startedAt != null) patch.startedAt = params.startedAt;
|
|
2083
|
-
if (params.endedAt != null) patch.endedAt = params.endedAt;
|
|
2084
|
-
if (params.lastEventAt != null) patch.lastEventAt = params.lastEventAt;
|
|
2085
|
-
if (params.error !== void 0) patch.error = params.error;
|
|
2086
|
-
if (params.progressSummary !== void 0) patch.progressSummary = normalizeTaskSummary(params.progressSummary);
|
|
2087
|
-
if (params.terminalSummary !== void 0) patch.terminalSummary = normalizeTaskSummary(params.terminalSummary);
|
|
2088
|
-
if (params.terminalOutcome !== void 0) patch.terminalOutcome = resolveTaskTerminalOutcome({
|
|
2089
|
-
status: nextStatus,
|
|
2090
|
-
terminalOutcome: params.terminalOutcome
|
|
2091
|
-
});
|
|
2092
|
-
const eventSummary = normalizeTaskSummary(params.eventSummary) ?? (nextStatus === "failed" ? normalizeTaskSummary(params.error ?? current.error) : nextStatus === "succeeded" ? normalizeTaskSummary(params.terminalSummary ?? current.terminalSummary) : void 0);
|
|
2093
|
-
const nextEvent = params.status && params.status !== current.status || Boolean(normalizeTaskSummary(params.eventSummary)) ? appendTaskEvent({
|
|
2094
|
-
at: eventAt,
|
|
2095
|
-
kind: params.status && normalizeTaskStatus(params.status) !== current.status ? normalizeTaskStatus(params.status) : "progress",
|
|
2096
|
-
summary: eventSummary
|
|
2097
|
-
}) : void 0;
|
|
2098
|
-
const task = updateTask(current.taskId, patch);
|
|
2099
|
-
if (task) {
|
|
2100
|
-
updated.push(task);
|
|
2101
|
-
maybeDeliverTaskStateChangeUpdate(task.taskId, nextEvent);
|
|
2102
|
-
maybeDeliverTaskTerminalUpdate(task.taskId);
|
|
2103
|
-
}
|
|
2104
|
-
}
|
|
2105
|
-
return updated;
|
|
2106
|
-
}
|
|
2107
|
-
function updateTaskDeliveryByRunId(params) {
|
|
2108
|
-
ensureTaskRegistryReady();
|
|
2109
|
-
const patch = { deliveryStatus: params.deliveryStatus };
|
|
2110
|
-
if (params.error !== void 0) patch.error = params.error;
|
|
2111
|
-
return updateTasksByRunId({
|
|
2112
|
-
runId: params.runId,
|
|
2113
|
-
runtime: params.runtime,
|
|
2114
|
-
sessionKey: params.sessionKey,
|
|
2115
|
-
patch
|
|
2116
|
-
});
|
|
2117
|
-
}
|
|
2118
|
-
function markTaskRunningByRunId(params) {
|
|
2119
|
-
return updateTaskStateByRunId({
|
|
2120
|
-
runId: params.runId,
|
|
2121
|
-
runtime: params.runtime,
|
|
2122
|
-
sessionKey: params.sessionKey,
|
|
2123
|
-
status: "running",
|
|
2124
|
-
startedAt: params.startedAt,
|
|
2125
|
-
lastEventAt: params.lastEventAt,
|
|
2126
|
-
progressSummary: params.progressSummary,
|
|
2127
|
-
eventSummary: params.eventSummary
|
|
2128
|
-
});
|
|
2129
|
-
}
|
|
2130
|
-
function recordTaskProgressByRunId(params) {
|
|
2131
|
-
return updateTaskStateByRunId({
|
|
2132
|
-
runId: params.runId,
|
|
2133
|
-
runtime: params.runtime,
|
|
2134
|
-
sessionKey: params.sessionKey,
|
|
2135
|
-
lastEventAt: params.lastEventAt,
|
|
2136
|
-
progressSummary: params.progressSummary,
|
|
2137
|
-
eventSummary: params.eventSummary
|
|
2138
|
-
});
|
|
2139
|
-
}
|
|
2140
|
-
function finalizeTaskRunByRunId(params) {
|
|
2141
|
-
return updateTaskStateByRunId({
|
|
2142
|
-
runId: params.runId,
|
|
2143
|
-
runtime: params.runtime,
|
|
2144
|
-
sessionKey: params.sessionKey,
|
|
2145
|
-
status: params.status,
|
|
2146
|
-
startedAt: params.startedAt,
|
|
2147
|
-
endedAt: params.endedAt,
|
|
2148
|
-
lastEventAt: params.lastEventAt,
|
|
2149
|
-
error: params.error,
|
|
2150
|
-
progressSummary: params.progressSummary,
|
|
2151
|
-
terminalSummary: params.terminalSummary,
|
|
2152
|
-
terminalOutcome: params.terminalOutcome
|
|
2153
|
-
});
|
|
2154
|
-
}
|
|
2155
|
-
function setTaskRunDeliveryStatusByRunId(params) {
|
|
2156
|
-
return updateTaskDeliveryByRunId(params);
|
|
2157
|
-
}
|
|
2158
|
-
function updateTaskNotifyPolicyById(params) {
|
|
2159
|
-
ensureTaskRegistryReady();
|
|
2160
|
-
return updateTask(params.taskId, {
|
|
2161
|
-
notifyPolicy: params.notifyPolicy,
|
|
2162
|
-
lastEventAt: Date.now()
|
|
2163
|
-
});
|
|
2164
|
-
}
|
|
2165
|
-
function linkTaskToFlowById(params) {
|
|
2166
|
-
ensureTaskRegistryReady();
|
|
2167
|
-
const flowId = params.flowId.trim();
|
|
2168
|
-
if (!flowId) return null;
|
|
2169
|
-
const current = tasks.get(params.taskId);
|
|
2170
|
-
if (!current) return null;
|
|
2171
|
-
if (current.parentFlowId?.trim()) return cloneTaskRecord(current);
|
|
2172
|
-
assertParentFlowLinkAllowed({
|
|
2173
|
-
ownerKey: current.ownerKey,
|
|
2174
|
-
scopeKind: current.scopeKind,
|
|
2175
|
-
parentFlowId: flowId
|
|
2176
|
-
});
|
|
2177
|
-
return updateTask(params.taskId, { parentFlowId: flowId });
|
|
2178
|
-
}
|
|
2179
|
-
async function cancelTaskById(params) {
|
|
2180
|
-
ensureTaskRegistryReady();
|
|
2181
|
-
const task = tasks.get(params.taskId.trim());
|
|
2182
|
-
if (!task) return {
|
|
2183
|
-
found: false,
|
|
2184
|
-
cancelled: false,
|
|
2185
|
-
reason: "Task not found."
|
|
2186
|
-
};
|
|
2187
|
-
if (task.status === "succeeded" || task.status === "failed" || task.status === "timed_out" || task.status === "lost" || task.status === "cancelled") return {
|
|
2188
|
-
found: true,
|
|
2189
|
-
cancelled: false,
|
|
2190
|
-
reason: "Task is already terminal.",
|
|
2191
|
-
task: cloneTaskRecord(task)
|
|
2192
|
-
};
|
|
2193
|
-
const childSessionKey = task.childSessionKey?.trim();
|
|
2194
|
-
try {
|
|
2195
|
-
if (task.runtime !== "cli") {
|
|
2196
|
-
if (!childSessionKey) {
|
|
2197
|
-
if (!isChildlessCodexNativeSubagentTask(task)) return {
|
|
2198
|
-
found: true,
|
|
2199
|
-
cancelled: false,
|
|
2200
|
-
reason: "Task has no cancellable child session.",
|
|
2201
|
-
task: cloneTaskRecord(task)
|
|
2202
|
-
};
|
|
2203
|
-
}
|
|
2204
|
-
if (!childSessionKey) {} else if (task.runtime === "acp") {
|
|
2205
|
-
const { getAcpSessionManager } = await loadTaskRegistryControlRuntime();
|
|
2206
|
-
await getAcpSessionManager().cancelSession({
|
|
2207
|
-
cfg: params.cfg,
|
|
2208
|
-
sessionKey: childSessionKey,
|
|
2209
|
-
reason: params.reason?.trim() || "task-cancel"
|
|
2210
|
-
});
|
|
2211
|
-
} else if (task.runtime === "subagent") {
|
|
2212
|
-
const { killSubagentRunAdmin } = await loadTaskRegistryControlRuntime();
|
|
2213
|
-
const result = await killSubagentRunAdmin({
|
|
2214
|
-
cfg: params.cfg,
|
|
2215
|
-
sessionKey: childSessionKey
|
|
2216
|
-
});
|
|
2217
|
-
if (!result.found || !result.killed) return {
|
|
2218
|
-
found: true,
|
|
2219
|
-
cancelled: false,
|
|
2220
|
-
reason: result.found ? "Subagent was not running." : "Subagent task not found.",
|
|
2221
|
-
task: cloneTaskRecord(task)
|
|
2222
|
-
};
|
|
2223
|
-
} else return {
|
|
2224
|
-
found: true,
|
|
2225
|
-
cancelled: false,
|
|
2226
|
-
reason: "Task runtime does not support cancellation yet.",
|
|
2227
|
-
task: cloneTaskRecord(task)
|
|
2228
|
-
};
|
|
2229
|
-
}
|
|
2230
|
-
const updated = updateTask(task.taskId, {
|
|
2231
|
-
status: "cancelled",
|
|
2232
|
-
endedAt: Date.now(),
|
|
2233
|
-
lastEventAt: Date.now(),
|
|
2234
|
-
error: params.reason?.trim() || "Cancelled by operator."
|
|
2235
|
-
});
|
|
2236
|
-
if (updated) maybeDeliverTaskTerminalUpdate(updated.taskId);
|
|
2237
|
-
return {
|
|
2238
|
-
found: true,
|
|
2239
|
-
cancelled: true,
|
|
2240
|
-
task: updated ?? cloneTaskRecord(task)
|
|
2241
|
-
};
|
|
2242
|
-
} catch (error) {
|
|
2243
|
-
return {
|
|
2244
|
-
found: true,
|
|
2245
|
-
cancelled: false,
|
|
2246
|
-
reason: formatErrorMessage(error),
|
|
2247
|
-
task: cloneTaskRecord(task)
|
|
2248
|
-
};
|
|
2249
|
-
}
|
|
2250
|
-
}
|
|
2251
|
-
function listTaskRecords() {
|
|
2252
|
-
ensureTaskRegistryReady();
|
|
2253
|
-
return [...tasks.values()].map((task, insertionIndex) => Object.assign({}, cloneTaskRecord(task), { insertionIndex })).toSorted(compareTasksNewestFirst).map(({ insertionIndex: _, ...task }) => task);
|
|
2254
|
-
}
|
|
2255
|
-
function hasActiveTaskForChildSessionKey(params) {
|
|
2256
|
-
ensureTaskRegistryReady();
|
|
2257
|
-
const sessionKey = normalizeOptionalString(params.sessionKey);
|
|
2258
|
-
if (!sessionKey) return false;
|
|
2259
|
-
const ids = taskIdsByRelatedSessionKey.get(sessionKey);
|
|
2260
|
-
if (!ids) return false;
|
|
2261
|
-
for (const taskId of ids) {
|
|
2262
|
-
if (taskId === params.excludeTaskId) continue;
|
|
2263
|
-
const task = tasks.get(taskId);
|
|
2264
|
-
if (task && isActiveTaskStatus(task.status) && normalizeOptionalString(task.childSessionKey) === sessionKey) return true;
|
|
2265
|
-
}
|
|
2266
|
-
return false;
|
|
2267
|
-
}
|
|
2268
|
-
function getTaskById(taskId) {
|
|
2269
|
-
ensureTaskRegistryReady();
|
|
2270
|
-
const task = tasks.get(taskId.trim());
|
|
2271
|
-
return task ? cloneTaskRecord(task) : void 0;
|
|
2272
|
-
}
|
|
2273
|
-
function findTaskByRunId(runId) {
|
|
2274
|
-
ensureTaskRegistryReady();
|
|
2275
|
-
const task = pickPreferredRunIdTask(getTasksByRunId(runId));
|
|
2276
|
-
return task ? cloneTaskRecord(task) : void 0;
|
|
2277
|
-
}
|
|
2278
|
-
function listTasksFromIndex(index, key) {
|
|
2279
|
-
const ids = index.get(key);
|
|
2280
|
-
if (!ids || ids.size === 0) return [];
|
|
2281
|
-
return [...ids].map((taskId, insertionIndex) => {
|
|
2282
|
-
const task = tasks.get(taskId);
|
|
2283
|
-
return task ? Object.assign({}, cloneTaskRecord(task), { insertionIndex }) : null;
|
|
2284
|
-
}).filter((task) => Boolean(task)).toSorted(compareTasksNewestFirst).map(({ insertionIndex: _, ...task }) => task);
|
|
2285
|
-
}
|
|
2286
|
-
function listTasksForSessionKey(sessionKey) {
|
|
2287
|
-
ensureTaskRegistryReady();
|
|
2288
|
-
const key = normalizeOptionalString(sessionKey);
|
|
2289
|
-
if (!key) return [];
|
|
2290
|
-
return listTasksFromIndex(taskIdsByRelatedSessionKey, key);
|
|
2291
|
-
}
|
|
2292
|
-
function listTasksForAgentId(agentId) {
|
|
2293
|
-
ensureTaskRegistryReady();
|
|
2294
|
-
const lookup = agentId.trim();
|
|
2295
|
-
if (!lookup) return [];
|
|
2296
|
-
return snapshotTaskRecords(tasks).filter((task) => task.agentId?.trim() === lookup).toSorted(compareTasksNewestFirst);
|
|
2297
|
-
}
|
|
2298
|
-
function listTasksForOwnerKey(ownerKey) {
|
|
2299
|
-
ensureTaskRegistryReady();
|
|
2300
|
-
const key = normalizeOptionalString(ownerKey);
|
|
2301
|
-
if (!key) return [];
|
|
2302
|
-
return listTasksFromIndex(taskIdsByOwnerKey, key);
|
|
2303
|
-
}
|
|
2304
|
-
function listFreshTasksForOwnerKey(ownerKey) {
|
|
2305
|
-
ensureTaskRegistryReady();
|
|
2306
|
-
const key = normalizeOptionalString(ownerKey);
|
|
2307
|
-
if (!key) return [];
|
|
2308
|
-
const store = getTaskRegistryStore();
|
|
2309
|
-
if (store.listTasksForOwnerKey) try {
|
|
2310
|
-
const merged = /* @__PURE__ */ new Map();
|
|
2311
|
-
for (const task of store.listTasksForOwnerKey(key)) merged.set(task.taskId, cloneTaskRecord(normalizeTaskTimestamps(task)));
|
|
2312
|
-
return [...merged.values()].map((task, insertionIndex) => Object.assign({}, task, { insertionIndex })).toSorted(compareTasksNewestFirst).map(({ insertionIndex: _, ...task }) => task);
|
|
2313
|
-
} catch (error) {
|
|
2314
|
-
log.warn("Failed to read fresh owner task registry records", {
|
|
2315
|
-
ownerKey: key,
|
|
2316
|
-
error
|
|
2317
|
-
});
|
|
2318
|
-
}
|
|
2319
|
-
return listTasksFromIndex(taskIdsByOwnerKey, key);
|
|
2320
|
-
}
|
|
2321
|
-
function listTasksForFlowId(flowId) {
|
|
2322
|
-
ensureTaskRegistryReady();
|
|
2323
|
-
const key = flowId.trim();
|
|
2324
|
-
if (!key) return [];
|
|
2325
|
-
return listTasksFromIndex(taskIdsByParentFlowId, key);
|
|
2326
|
-
}
|
|
2327
|
-
function findLatestTaskForRelatedSessionKey(sessionKey) {
|
|
2328
|
-
const task = listTasksForRelatedSessionKey(sessionKey)[0];
|
|
2329
|
-
return task ? cloneTaskRecord(task) : void 0;
|
|
2330
|
-
}
|
|
2331
|
-
function listTasksForRelatedSessionKey(sessionKey) {
|
|
2332
|
-
ensureTaskRegistryReady();
|
|
2333
|
-
const key = normalizeOptionalString(sessionKey);
|
|
2334
|
-
if (!key) return [];
|
|
2335
|
-
return listTasksFromIndex(taskIdsByRelatedSessionKey, key);
|
|
2336
|
-
}
|
|
2337
|
-
function resolveTaskForLookupToken(token) {
|
|
2338
|
-
const lookup = token.trim();
|
|
2339
|
-
if (!lookup) return;
|
|
2340
|
-
return getTaskById(lookup) ?? findTaskByRunId(lookup) ?? findLatestTaskForRelatedSessionKey(lookup);
|
|
2341
|
-
}
|
|
2342
|
-
function deleteTaskRecordById(taskId) {
|
|
2343
|
-
ensureTaskRegistryReady();
|
|
2344
|
-
const current = tasks.get(taskId);
|
|
2345
|
-
if (!current) return false;
|
|
2346
|
-
deleteOwnerKeyIndex(taskId, current);
|
|
2347
|
-
deleteParentFlowIdIndex(taskId, current);
|
|
2348
|
-
deleteRelatedSessionKeyIndex(taskId, current);
|
|
2349
|
-
tasks.delete(taskId);
|
|
2350
|
-
taskDeliveryStates.delete(taskId);
|
|
2351
|
-
rebuildRunIdIndex();
|
|
2352
|
-
persistTaskDelete(taskId);
|
|
2353
|
-
persistTaskDeliveryStateDelete(taskId);
|
|
2354
|
-
emitTaskRegistryObserverEvent(() => ({
|
|
2355
|
-
kind: "deleted",
|
|
2356
|
-
taskId: current.taskId,
|
|
2357
|
-
previous: cloneTaskRecord(current)
|
|
2358
|
-
}));
|
|
2359
|
-
return true;
|
|
2360
|
-
}
|
|
2361
|
-
//#endregion
|
|
2362
|
-
export { deleteTaskFlowRecordById as A, resumeFlow as B, reloadTaskRegistryFromStore as C, updateTaskNotifyPolicyById as D, setTaskRunDeliveryStatusByRunId as E, getTaskFlowRegistryRestoreFailure as F, updateFlowRecordByIdExpectedRevision as H, listTaskFlowRecords as I, listTaskFlowsForOwnerKey as L, findLatestTaskFlowForOwnerKey as M, finishFlow as N, createManagedTaskFlow as O, getTaskFlowById as P, requestFlowCancel as R, recordTaskProgressByRunId as S, setTaskCleanupAfterById as T, CODEX_NATIVE_SUBAGENT_STALE_ERROR as U, setFlowWaiting as V, isChildlessCodexNativeSubagentTask as W, listTasksForSessionKey as _, finalizeTaskRunByRunId as a, markTaskTerminalById as b, hasActiveTaskForChildSessionKey as c, listFreshTasksForOwnerKey as d, listTaskRecords as f, listTasksForRelatedSessionKey as g, listTasksForOwnerKey as h, ensureTaskRegistryReady as i, failFlow as j, createTaskFlowForTask as k, isParentFlowLinkError as l, listTasksForFlowId as m, createTaskRecord as n, findTaskByRunId as o, listTasksForAgentId as p, deleteTaskRecordById as r, getTaskById as s, cancelTaskById as t, linkTaskToFlowById as u, markTaskLostById as v, resolveTaskForLookupToken as w, maybeDeliverTaskTerminalUpdate as x, markTaskRunningByRunId as y, resolveTaskFlowForLookupToken as z };
|