@pixelzx/genesis 2026.5.5-3 → 2026.5.5-4
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 +1 -1
- package/dist/.buildstamp +1 -1
- package/dist/abort-BHSttDhY.js +201 -0
- package/dist/abort.runtime-VJ9lFsZS.js +2 -0
- package/dist/abort.runtime.js +1 -1
- package/dist/accounts-BNvagEOQ.js +104 -0
- package/dist/accounts-CPIuzenz.js +107 -0
- package/dist/accounts-r08DQWhZ.js +2 -0
- package/dist/acp-cli-i0L-eRs9.js +2193 -0
- package/dist/acp-spawn-CHzVLe9q.js +1093 -0
- package/dist/acp-spawn-CqvxDuBq.js +2 -0
- package/dist/acp-stateful-target-driver-CWRLc_NP.js +89 -0
- package/dist/action-agents-SNCscX_-.js +67 -0
- package/dist/action-focus-B2s0PF2E.js +132 -0
- package/dist/action-help-CXKbyaZ7.js +7 -0
- package/dist/action-info-B3IDKxWu.js +101 -0
- package/dist/action-kill-idGvCNhT.js +33 -0
- package/dist/action-list-Di7gO3qL.js +21 -0
- package/dist/action-log-BCsz-gFi.js +30 -0
- package/dist/action-send-DLsdZnVc.js +39 -0
- package/dist/action-spawn-DhKEOdL0.js +47 -0
- package/dist/action-unfocus-Dh7ti5UP.js +29 -0
- package/dist/actions.runtime-BPf03SN3.js +18 -0
- package/dist/actions.runtime-CJg_lweh.js +5 -0
- package/dist/actions.runtime.js +1 -1
- package/dist/agent-C3PLvvws.js +2 -0
- package/dist/agent-command-UroeNrV4.js +874 -0
- package/dist/agent-harness-runtime-MXvI9FlJ.js +144 -0
- package/dist/agent-runner-utils-CaVgLZrf.js +239 -0
- package/dist/agent-runner.runtime-Csqm3m09.js +3455 -0
- package/dist/agent-runner.runtime.js +1 -1
- package/dist/agent-runtime-B9nUYDUz.js +18 -0
- package/dist/agents-BP4p-1q2.js +5 -0
- package/dist/agents-CDiXfrfc.js +953 -0
- package/dist/aliases-BBCtCq2A.js +96 -0
- package/dist/aliases-DrFtFq1p.js +2 -0
- package/dist/api-BH0oEwR1.js +5 -0
- package/dist/api-D-4gHdrl.js +139 -0
- package/dist/api-DE6RYTxv.js +3 -0
- package/dist/approval-gateway-resolver-URpDQMld.js +29 -0
- package/dist/approval-gateway-runtime-B087BMms.js +2 -0
- package/dist/approval-handler-runtime-BEl3ua8-.js +439 -0
- package/dist/approval-native-runtime-ghjYGufu.js +729 -0
- package/dist/attempt-execution.runtime-PCTFYqLh.js +509 -0
- package/dist/attempt-execution.runtime.js +1 -1
- package/dist/attempt.prompt-helpers-CkWEozQ2.js +221 -0
- package/dist/attempt.tool-run-context-DbqVgXFk.js +933 -0
- package/dist/audit-Lb1yNEwg.js +939 -0
- package/dist/audit.runtime-DOnixKE_.js +7 -0
- package/dist/audit.runtime.js +1 -1
- package/dist/auth-BrlJ7NM9.js +2 -0
- package/dist/auth-CJoP7Yst.js +383 -0
- package/dist/auth-order-D0KFgBib.js +96 -0
- package/dist/auth-order-_xlUHzCg.js +2 -0
- package/dist/bash-tools-BEVEHCl9.js +2824 -0
- package/dist/bash-tools-DJ0D8Wr5.js +3 -0
- package/dist/binding-routing-IfKqPcfO.js +85 -0
- package/dist/binding-targets-2huR0hTX.js +121 -0
- package/dist/bridge-server-D8Y8Fzdz.js +113 -0
- package/dist/browser-control-auth-Q6UpVLEj.js +2 -0
- package/dist/browser-node-runtime-C9KvsOyx.js +12 -0
- package/dist/browser-profiles-DFcwiMEf.js +2 -0
- package/dist/browser-runtime-sbZ3hKg6.js +387 -0
- package/dist/browser-setup-tools-CP4BkZ9z.js +13 -0
- package/dist/build-DzHX2LrH.js +550 -0
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +2 -2
- package/dist/bundled/session-memory/handler.js +1 -1
- package/dist/call-ORivR4Db.js +331 -0
- package/dist/call-qzfm6lro.js +3 -0
- package/dist/call.runtime-BkzJe07B.js +2 -0
- package/dist/call.runtime.js +1 -1
- package/dist/capability-cli-BDCvm93o.js +1401 -0
- package/dist/catchup-CjZa2PrP.js +300 -0
- package/dist/channel-B3UAL9Pk.js +840 -0
- package/dist/channel-B5L9LJBF.js +453 -0
- package/dist/channel-BGXl6A-E.js +297 -0
- package/dist/channel-BNUblayu.js +1320 -0
- package/dist/channel-Bej-TN7f.js +491 -0
- package/dist/channel-BzOKSC4e.js +350 -0
- package/dist/channel-CY2xEOzR.js +1802 -0
- package/dist/channel-D2kKLWUA.js +226 -0
- package/dist/channel-DcjCe46M.js +1100 -0
- package/dist/channel-GqA96nmt.js +595 -0
- package/dist/channel-YI2aIJFQ.js +1174 -0
- package/dist/channel-core-DqPUhmTt.js +5 -0
- package/dist/channel-inbound-CzgMd2Xi.js +31 -0
- package/dist/channel-plugin-runtime-DI5uUbxx.js +771 -0
- package/dist/channel-runtime-BJqKQitD.js +425 -0
- package/dist/channel.runtime-BBn9mgbB.js +89 -0
- package/dist/channel.runtime-Bhj1b9gQ.js +34702 -0
- package/dist/channel.runtime-BzOVx90Z.js +576 -0
- package/dist/channel.runtime-CQkLKWlq.js +109 -0
- package/dist/channel.runtime-D8qT4A1x.js +4 -0
- package/dist/channel.runtime-DjK9Re1w.js +2364 -0
- package/dist/channel.runtime-tWwM8hFw.js +430 -0
- package/dist/channel.setup-gaiRZ-r8.js +10 -0
- package/dist/channels-BXIl3hBo.js +733 -0
- package/dist/channels-cli-CrmBqaul.js +268 -0
- package/dist/chat-C42usv-F.js +2758 -0
- package/dist/clawbot-cli-BGYO_ymZ.js +9 -0
- package/dist/cli/daemon-cli.js +4 -4
- package/dist/cli-BbD25CFK.js +2 -0
- package/dist/cli-CYD4Wfcq.js +219 -0
- package/dist/cli-D-6ycHAw.js +72 -0
- package/dist/cli-DX4CK-bw.js +2 -0
- package/dist/cli-runner-C5_PBTxm.js +286 -0
- package/dist/cli-runner.runtime-DE7RpQ27.js +3 -0
- package/dist/cli-runner.runtime-ueVMICzY.js +4 -0
- package/dist/cli-runner.runtime.js +1 -1
- package/dist/cli-startup-metadata.json +2 -2
- package/dist/cli.runtime-DSO8Vfrh.js +1261 -0
- package/dist/cli.runtime.js +1 -1
- package/dist/client-BKro32pr.js +138 -0
- package/dist/client-Vx7pseEY.js +713 -0
- package/dist/command-auth-CvFUTCCJ.js +76 -0
- package/dist/command-config-resolution-BnW1XGnW.js +23 -0
- package/dist/command-config-resolution-BrlfYyiN.js +2 -0
- package/dist/command-config-resolution.runtime-DYMr8J0t.js +2 -0
- package/dist/command-config-resolution.runtime.js +1 -1
- package/dist/command-registry-BFZKeOfs.js +4 -0
- package/dist/command-registry-Dx2ADG5E.js +9 -0
- package/dist/command-registry-core-D7i83K9k.js +101 -0
- package/dist/command-secret-gateway-B27Zpgo9.js +528 -0
- package/dist/command-status.runtime-fERQMzeI.js +87 -0
- package/dist/command-status.runtime.js +1 -1
- package/dist/commands-acp-BmORmf3-.js +77 -0
- package/dist/commands-compact.runtime-BUaXIw-I.js +10 -0
- package/dist/commands-compact.runtime.js +1 -1
- package/dist/commands-handlers.runtime-BxbkeuTc.js +4597 -0
- package/dist/commands-handlers.runtime.js +1 -1
- package/dist/commands-status-4OW5sqmg.js +16 -0
- package/dist/commands-status.runtime-Cl7nJp_7.js +3 -0
- package/dist/commands-status.runtime.js +1 -1
- package/dist/commands-subagents-control.runtime-BR4qBGkk.js +2 -0
- package/dist/commands-subagents-control.runtime-C8ufgKPI.js +3 -0
- package/dist/commands-subagents-control.runtime.js +1 -1
- package/dist/commands-system-prompt-BsimvjJt.js +158 -0
- package/dist/commands-system-prompt-CKrY0h7P.js +2 -0
- package/dist/commands.runtime-BHsDdaEU.js +166 -0
- package/dist/commands.runtime.js +1 -1
- package/dist/compact-BHYLQst3.js +1118 -0
- package/dist/compact.runtime-7-tZRdgw.js +12 -0
- package/dist/compact.runtime.js +1 -1
- package/dist/completion-cli-CrMeY4zt.js +328 -0
- package/dist/config-BZ3FuFjH.js +251 -0
- package/dist/config-cli-Bfvd45IK.js +1078 -0
- package/dist/configure-DiSRY2c4.js +1245 -0
- package/dist/configure-srxQxuEW.js +2 -0
- package/dist/connect-options-DlmPTyhG.js +699 -0
- package/dist/control-auth-C_zNiV10.js +125 -0
- package/dist/control-service-B1TL51jf.js +156 -0
- package/dist/conversation-id-B3lLiTfF.js +235 -0
- package/dist/conversation-id-DORmTZm_.js +38 -0
- package/dist/conversation-runtime-DDxZZZXE.js +31 -0
- package/dist/core-DbPzffGG.js +275 -0
- package/dist/cron-cli-AoH4jhFt.js +713 -0
- package/dist/daemon-cli-C9Z9wW_C.js +12 -0
- package/dist/daemon-install-CiudqvC8.js +64 -0
- package/dist/delegate-Dmdda3kT.js +64 -0
- package/dist/detached-task-runtime-BB5az34R.js +73 -0
- package/dist/devices-cli-Cy9DF-DP.js +496 -0
- package/dist/diagnostics-CTE0TWR1.js +154 -0
- package/dist/direct-dm-9jzadx9u.js +64 -0
- package/dist/dispatch-DU7cqfv6.js +1131 -0
- package/dist/dispatch-acp-Cu_nUtKg.js +981 -0
- package/dist/dispatch-acp-manager.runtime-8MOQ5BRn.js +3 -0
- package/dist/dispatch-acp-manager.runtime.js +1 -1
- package/dist/dispatch-acp.runtime-DatcHNJq.js +19 -0
- package/dist/dispatch-acp.runtime.js +1 -1
- package/dist/doctor-device-pairing-Qm-r7mwu.js +307 -0
- package/dist/doctor-gateway-daemon-flow-DJUA40sd.js +250 -0
- package/dist/doctor-gateway-health-CD7Vzth9.js +60 -0
- package/dist/doctor-gateway-services-ChajuYZL.js +316 -0
- package/dist/doctor-health-O51CFRqy.js +59 -0
- package/dist/doctor-health-contributions-CGMp0dRt.js +486 -0
- package/dist/doctor-prompter-BYIoKiZ8.js +56 -0
- package/dist/doctor-workspace-status-DL2fRPoT.js +75 -0
- package/dist/dreaming-CCctNgkQ.js +1574 -0
- package/dist/dreaming-narrative-BPtXKc2-.js +595 -0
- package/dist/embedded-gateway-stub.runtime-Hi36BeCq.js +9 -0
- package/dist/embedded-gateway-stub.runtime.js +1 -1
- package/dist/entry.js +2 -2
- package/dist/exec-approvals-cli-DyslUWtQ.js +498 -0
- package/dist/extensionAPI.js +1 -1
- package/dist/extensions/active-memory/index.js +1 -1
- package/dist/extensions/bluebubbles/api.js +3 -3
- package/dist/extensions/bluebubbles/channel-plugin-api.js +1 -1
- package/dist/extensions/browser/browser-bridge.js +1 -1
- package/dist/extensions/browser/browser-config.js +4 -4
- package/dist/extensions/browser/browser-control-auth.js +2 -2
- package/dist/extensions/browser/browser-doctor.js +2 -2
- package/dist/extensions/browser/browser-maintenance.js +2 -2
- package/dist/extensions/browser/browser-profiles.js +2 -2
- package/dist/extensions/browser/browser-runtime-api.js +10 -10
- package/dist/extensions/browser/index.js +1 -1
- package/dist/extensions/browser/plugin-registration.js +1 -1
- package/dist/extensions/browser/register.runtime.js +3 -3
- package/dist/extensions/browser/runtime-api.js +11 -11
- package/dist/extensions/browser/test-support.js +1 -1
- package/dist/extensions/device-pair/api.js +1 -1
- package/dist/extensions/device-pair/index.js +3 -3
- package/dist/extensions/device-pair/notify.js +1 -1
- package/dist/extensions/device-pair/pair-command-approve.js +1 -1
- package/dist/extensions/google-meet/index.js +2 -2
- package/dist/extensions/imessage/api.js +3 -3
- package/dist/extensions/imessage/channel-plugin-api.js +1 -1
- package/dist/extensions/imessage/runtime-api.js +3 -3
- package/dist/extensions/irc/api.js +2 -2
- package/dist/extensions/irc/channel-plugin-api.js +1 -1
- package/dist/extensions/line/api.js +2 -2
- package/dist/extensions/line/channel-plugin-api.js +1 -1
- package/dist/extensions/line/contract-api.js +1 -1
- package/dist/extensions/line/runtime-api.js +4 -4
- package/dist/extensions/line/setup-api.js +1 -1
- package/dist/extensions/llm-task/index.js +2 -2
- package/dist/extensions/lobster/index.js +3 -3
- package/dist/extensions/lobster/runtime-api.js +1 -1
- package/dist/extensions/mattermost/api.js +1 -1
- package/dist/extensions/mattermost/channel-plugin-api.js +1 -1
- package/dist/extensions/mattermost/channel-plugin-runtime.js +1 -1
- package/dist/extensions/mattermost/policy-api.js +1 -1
- package/dist/extensions/mattermost/runtime-api.js +4 -4
- package/dist/extensions/mattermost/slash-route-api.js +1 -1
- package/dist/extensions/memory-core/api.js +1 -1
- package/dist/extensions/memory-core/cli-metadata.js +2 -2
- package/dist/extensions/memory-core/index.js +3 -3
- package/dist/extensions/memory-lancedb/cli-metadata.js +1 -1
- package/dist/extensions/msteams/api.js +1 -1
- package/dist/extensions/msteams/channel-plugin-api.js +1 -1
- package/dist/extensions/msteams/runtime-api.js +3 -3
- package/dist/extensions/msteams/test-api.js +1 -1
- package/dist/extensions/nextcloud-talk/api.js +1 -1
- package/dist/extensions/nextcloud-talk/channel-plugin-api.js +1 -1
- package/dist/extensions/nextcloud-talk/runtime-api.js +2 -2
- package/dist/extensions/openshell/index.js +2 -2
- package/dist/extensions/signal/api.js +6 -6
- package/dist/extensions/signal/channel-plugin-api.js +1 -1
- package/dist/extensions/signal/reaction-runtime-api.js +1 -1
- package/dist/extensions/signal/runtime-api.js +7 -7
- package/dist/extensions/skill-workshop/api.js +1 -1
- package/dist/extensions/skill-workshop/index.js +1 -1
- package/dist/extensions/synology-chat/api.js +1 -1
- package/dist/extensions/synology-chat/channel-plugin-api.js +1 -1
- package/dist/extensions/tlon/api.js +2 -2
- package/dist/extensions/tlon/channel-plugin-api.js +1 -1
- package/dist/extensions/tlon/runtime-api.js +1 -1
- package/dist/extensions/tlon/test-api.js +1 -1
- package/dist/extensions/twitch/api.js +1 -1
- package/dist/extensions/twitch/channel-plugin-api.js +1 -1
- package/dist/extensions/twitch/setup-plugin-api.js +1 -1
- package/dist/extensions/zalo/api.js +3 -3
- package/dist/extensions/zalo/channel-plugin-api.js +1 -1
- package/dist/extensions/zalo/runtime-api.js +2 -2
- package/dist/extensions/zalo/setup-api.js +2 -2
- package/dist/extensions/zalouser/api.js +3 -3
- package/dist/extensions/zalouser/channel-plugin-api.js +1 -1
- package/dist/extensions/zalouser/runtime-api.js +6 -6
- package/dist/extensions/zalouser/setup-plugin-api.js +1 -1
- package/dist/extensions/zalouser/test-api.js +1 -1
- package/dist/fallbacks-B3xZC-ms.js +2 -0
- package/dist/fallbacks-CWDz-tSa.js +31 -0
- package/dist/fallbacks-shared-BlZBjxHL.js +111 -0
- package/dist/gateway-NYBkUx5r.js +115 -0
- package/dist/gateway-cli-DvJWNwl6.js +1325 -0
- package/dist/gateway-rpc-BrG5Lkfm.js +14 -0
- package/dist/gateway-rpc.runtime-BrTGchr9.js +23 -0
- package/dist/gateway-rpc.runtime.js +1 -1
- package/dist/gateway-runtime-DctMRv_p.js +15 -0
- package/dist/gateway-status-B6ol1agz.js +584 -0
- package/dist/genesis-tools-D_ah3Zek.js +8999 -0
- package/dist/genesis-tools.runtime-Cy7aTWEN.js +2 -0
- package/dist/genesis-tools.runtime.js +1 -1
- package/dist/get-reply-BvVkxYum.js +3879 -0
- package/dist/get-reply-from-config.runtime-DR3yiK1R.js +2 -0
- package/dist/get-reply-from-config.runtime.js +1 -1
- package/dist/graph-users-yBNugoFz.js +1337 -0
- package/dist/health-D_wk2s7j.js +3 -0
- package/dist/health-MRnjOx-_.js +469 -0
- package/dist/heartbeat-runner-NuhhYnxs.js +5 -0
- package/dist/heartbeat-runner-Y4NeUV3L.js +1292 -0
- package/dist/heartbeat-runner.runtime-eGfKtcpP.js +4 -0
- package/dist/heartbeat-runner.runtime.js +1 -1
- package/dist/hooks-cli-CtfN2vc-.js +433 -0
- package/dist/image-fallbacks-CgeDMYZo.js +2 -0
- package/dist/image-fallbacks-CzQ85Eo8.js +31 -0
- package/dist/inbound-reply-dispatch-jVlLaSqn.js +73 -0
- package/dist/index.js +2 -2
- package/dist/infra-runtime-D2Pqjk-r.js +39 -0
- package/dist/init-D_MTYqrw.js +59 -0
- package/dist/install-DLJF8qA4.js +190 -0
- package/dist/install.runtime-B_wJtoom.js +2 -0
- package/dist/launchd-OykeouWG.js +696 -0
- package/dist/library-DIykYIWD.js +45 -0
- package/dist/lifecycle-BNuFzffC.js +571 -0
- package/dist/lifecycle-DJidJ8WM.js +229 -0
- package/dist/lifecycle-core-DCeS7I2A.js +422 -0
- package/dist/lifecycle.runtime-DWcLMs_A.js +2 -0
- package/dist/lifecycle.runtime.js +1 -1
- package/dist/list-BZ3mMSpA.js +2 -0
- package/dist/list-CzQs_k0U.js +131 -0
- package/dist/list-CzTJTFOH.js +1201 -0
- package/dist/list-qDXsgKhB.js +2 -0
- package/dist/list.probe-EOZR6ueo.js +419 -0
- package/dist/llm-slug-generator-DzWIx0nh.js +79 -0
- package/dist/llm-slug-generator.js +1 -1
- package/dist/load-config-C_8uUnXU.js +35 -0
- package/dist/local-dispatch.runtime-DLd10Xb1.js +8 -0
- package/dist/local-dispatch.runtime.js +1 -1
- package/dist/logs-cli-mnOTmC9R.js +265 -0
- package/dist/logs-cli.runtime-BvP3aise.js +2 -0
- package/dist/logs-cli.runtime.js +1 -1
- package/dist/main-session-restart-recovery-D7Vxmu7e.js +206 -0
- package/dist/managed-image-attachments-BB5u0Zq8.js +2 -0
- package/dist/managed-image-attachments-BeRGNdL9.js +635 -0
- package/dist/manager-BhNWV4EC.js +2 -0
- package/dist/manager-CbZ9ncZs.js +2057 -0
- package/dist/markdown-to-line-DyB8w7ef.js +790 -0
- package/dist/mcp/plugin-tools-serve.js +1 -1
- package/dist/mcp-cli-CWzLBrDF.js +725 -0
- package/dist/mcp-http-1jD7LE0a.js +529 -0
- package/dist/memory-core-host-runtime-cli-P80xoEfr.js +9 -0
- package/dist/message-BAhd_1ud.js +232 -0
- package/dist/message-action-runner-CH2jjT21.js +1407 -0
- package/dist/message-action-runner-DW7z_bMx.js +2 -0
- package/dist/message-actions-BjBGSsJB.js +143 -0
- package/dist/message.gateway.runtime-sUc85g7X.js +2 -0
- package/dist/message.gateway.runtime.js +1 -1
- package/dist/models-auth-status-D6lrM56M.js +201 -0
- package/dist/models-cli-CmnbAk2M.js +219 -0
- package/dist/monitor-AyGe8vyk.js +1237 -0
- package/dist/monitor-DQuy2kx-.js +671 -0
- package/dist/monitor-DmtJiX5o.js +788 -0
- package/dist/monitor-GB8lcnal.js +1459 -0
- package/dist/monitor-IuVjATac.js +1661 -0
- package/dist/monitor-auth-rF7mr3Cm.js +207 -0
- package/dist/monitor-bnOvJyLN.js +2 -0
- package/dist/monitor-processing-B1ewr2qF.js +1974 -0
- package/dist/monitor.runtime-BrUD5_VN.js +2 -0
- package/dist/monitor.runtime.js +1 -1
- package/dist/monitor.webhook-BvJG6Xbh.js +180 -0
- package/dist/msteams-DUDRy3xt.js +35 -0
- package/dist/native-hook-relay-CTpTLgCA.js +519 -0
- package/dist/nextcloud-talk-BH2uWRZ2.js +17 -0
- package/dist/node-cli-CrDZkIQS.js +2506 -0
- package/dist/node-service-BhD56-7r.js +68 -0
- package/dist/nodes-cli-B7IWCrYq.js +1046 -0
- package/dist/nodes-utils-Dg2hrC3z.js +84 -0
- package/dist/nodes.helpers-CkJO5i0d.js +34 -0
- package/dist/notify-bsxfkOWp.js +315 -0
- package/dist/onboard-helpers-Cc2AnoIU.js +6 -0
- package/dist/onboard-helpers-DIxfEXNM.js +204 -0
- package/dist/onboard-plDFxTJw.js +632 -0
- package/dist/onboard-remote-CYhQbOXH.js +2 -0
- package/dist/onboard-remote-DrH3yVxE.js +193 -0
- package/dist/onboard-skills-DCI3hVXa.js +134 -0
- package/dist/onboard-skills-i4KuFzS4.js +2 -0
- package/dist/openai-http-D_7Nk3iN.js +500 -0
- package/dist/openresponses-http-BITxvD4V.js +1128 -0
- package/dist/operator-approvals-client-C0t_-2xC.js +68 -0
- package/dist/outbound.runtime-C8_lBQcx.js +2 -0
- package/dist/outbound.runtime.js +1 -1
- package/dist/pair-command-approve-D3s1W5go.js +44 -0
- package/dist/persistent-bindings.lifecycle-CCR6khHJ.js +85 -0
- package/dist/persistent-bindings.lifecycle-Dgoo5bpE.js +2 -0
- package/dist/pi-embedded-C2l80M7j.js +4 -0
- package/dist/pi-embedded-DMHGJgoQ.js +2905 -0
- package/dist/pi-embedded.runtime-fA0EsIue.js +4 -0
- package/dist/pi-embedded.runtime.js +1 -1
- package/dist/pi-tool-definition-adapter-B4hSYdYX.js +217 -0
- package/dist/pi-tools-YCHBvJG0.js +1057 -0
- package/dist/pi-tools.before-tool-call-BsyruRs4.js +433 -0
- package/dist/pi-tools.before-tool-call-D1maRTbl.js +2 -0
- package/dist/plugin-DmBZwzWQ.js +12195 -0
- package/dist/plugin-enabled-rr_Y1Kwh.js +140 -0
- package/dist/plugin-registration-J1JWqMZg.js +23 -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.js +2 -2
- package/dist/plugin-sdk/agent-harness-runtime.js +5 -5
- package/dist/plugin-sdk/agent-harness.js +6 -6
- package/dist/plugin-sdk/agent-runtime.js +2 -2
- package/dist/plugin-sdk/approval-gateway-runtime.js +2 -2
- package/dist/plugin-sdk/approval-handler-runtime.js +3 -3
- package/dist/plugin-sdk/approval-runtime.js +1 -1
- package/dist/plugin-sdk/browser-node-runtime.js +4 -4
- package/dist/plugin-sdk/browser-setup-tools.js +3 -3
- package/dist/plugin-sdk/browser-support.js +7 -7
- package/dist/plugin-sdk/channel-core.js +2 -2
- package/dist/plugin-sdk/channel-inbound.js +2 -2
- package/dist/plugin-sdk/command-auth.js +1 -1
- package/dist/plugin-sdk/command-status-runtime.js +1 -1
- package/dist/plugin-sdk/compat.js +1 -1
- package/dist/plugin-sdk/conversation-binding-runtime.js +1 -1
- package/dist/plugin-sdk/conversation-runtime.js +3 -3
- package/dist/plugin-sdk/core.js +2 -2
- package/dist/plugin-sdk/direct-dm.js +1 -1
- package/dist/plugin-sdk/gateway-runtime.js +3 -3
- package/dist/plugin-sdk/inbound-reply-dispatch.js +1 -1
- package/dist/plugin-sdk/index.js +1 -1
- package/dist/plugin-sdk/infra-runtime.js +2 -2
- package/dist/plugin-sdk/irc.js +2 -2
- package/dist/plugin-sdk/matrix.js +1 -1
- package/dist/plugin-sdk/memory-core-host-runtime-cli.js +2 -2
- package/dist/plugin-sdk/memory-core.js +2 -2
- package/dist/plugin-sdk/msteams.js +2 -2
- package/dist/plugin-sdk/nextcloud-talk.js +2 -2
- package/dist/plugin-sdk/nostr.js +1 -1
- package/dist/plugin-sdk/reply-dispatch-runtime.js +1 -1
- package/dist/plugin-sdk/reply-runtime.js +4 -4
- package/dist/plugin-sdk/runtime-secret-resolution.js +1 -1
- package/dist/plugin-sdk/runtime.js +2 -2
- package/dist/plugin-sdk/session-visibility.js +1 -1
- package/dist/plugin-sdk/testing.js +4 -4
- package/dist/plugin-sdk/tlon.js +1 -1
- package/dist/plugin-sdk/zalo.js +1 -1
- package/dist/plugin-sdk/zalouser.js +1 -1
- package/dist/plugin-service-CPY8FSW2.js +2890 -0
- package/dist/plugins/runtime/index.js +1 -1
- package/dist/policy-DDUw681i.js +328 -0
- package/dist/postinstall-inventory.json +418 -418
- package/dist/prepare.runtime-BfnpyhHB.js +815 -0
- package/dist/prepare.runtime.js +1 -1
- package/dist/probe-CCdD6_vN.js +1443 -0
- package/dist/probe-CakOsrSu.js +241 -0
- package/dist/probe-Ctrcd_Q7.js +2205 -0
- package/dist/probe-D9IFIte1.js +2 -0
- package/dist/probe-DXMI0QlZ.js +74 -0
- package/dist/probe-KtX2HjXM.js +45 -0
- package/dist/probe-OcOYm1bj.js +2 -0
- package/dist/program-BtHRWk-Q.js +111 -0
- package/dist/prompt-select-styled-CR6QJuHt.js +20 -0
- package/dist/protocol-C40iRm9c.js +2234 -0
- package/dist/provider-dispatcher-BZp3Stzr.js +2 -0
- package/dist/provider-dispatcher-JJxN7BDL.js +22 -0
- package/dist/qr-cli-IMKzycXh.js +349 -0
- package/dist/qr-cli-W8X3Ha5T.js +2 -0
- package/dist/reaction-runtime-api-D7i4oMn9.js +116 -0
- package/dist/reactions-D9eRHeXM.js +998 -0
- package/dist/register-service-commands-CaBS-AUR.js +71 -0
- package/dist/register.agent-p1q6ZWSs.js +248 -0
- package/dist/register.configure-DazZmqzO.js +15 -0
- package/dist/register.maintenance-Dv5WFjIs.js +438 -0
- package/dist/register.message-B5msOUKt.js +329 -0
- package/dist/register.onboard-CMozEUYQ.js +81 -0
- package/dist/register.runtime-D8XvwfoZ.js +81 -0
- package/dist/register.runtime.js +1 -1
- package/dist/register.setup-DMYbjy66.js +150 -0
- package/dist/register.status-health-sessions-BE_L9Dys.js +1215 -0
- package/dist/register.subclis-BKl2XnlL.js +3 -0
- package/dist/register.subclis-Dda0aZgo.js +29 -0
- package/dist/register.subclis-core-CR9n4UBd.js +249 -0
- package/dist/reply-dispatch-runtime-DcxOLr7n.js +13 -0
- package/dist/reply-runtime-B4VQJnqi.js +11 -0
- package/dist/reply.runtime-B990ty9C.js +2 -0
- package/dist/reply.runtime.js +1 -1
- package/dist/restart-health-BWUPc4R-.js +202 -0
- package/dist/restart-health-CWvsjHVN.js +2 -0
- package/dist/root-help-D9aeVXNr.js +44 -0
- package/dist/routes-BSmEgP46.js +2 -0
- package/dist/routes-Z67chkN5.js +3341 -0
- package/dist/rpc-CBQZvJME.js +61 -0
- package/dist/rpc.runtime-ClhNVRer.js +21 -0
- package/dist/rpc.runtime.js +1 -1
- package/dist/run-delivery.runtime-Bj566BTH.js +530 -0
- package/dist/run-delivery.runtime.js +1 -1
- package/dist/run-embedded.runtime-DuB-mQh2.js +4 -0
- package/dist/run-embedded.runtime.js +1 -1
- package/dist/run-execution-cli.runtime-Oy4FGfj5.js +4 -0
- package/dist/run-execution-cli.runtime.js +1 -1
- package/dist/run-executor.runtime-B7-lfFh3.js +277 -0
- package/dist/run-executor.runtime.js +1 -1
- package/dist/run-main-DW_mKhnK.js +516 -0
- package/dist/run-subagent-registry.runtime-Bx9Wga3d.js +2 -0
- package/dist/run-subagent-registry.runtime.js +1 -1
- package/dist/run-wait-C-VgbefQ.js +135 -0
- package/dist/runtime-BV7JmOaE.js +9 -0
- package/dist/runtime-D7npxl4G.js +973 -0
- package/dist/runtime-api-BkVIoPU9.js +4 -0
- package/dist/runtime-api-CdhgyHMB.js +9 -0
- package/dist/runtime-api-CmlBBCCY.js +9 -0
- package/dist/runtime-api-DnhXPE_z.js +14 -0
- package/dist/runtime-embedded-pi.runtime-DpKqDUrl.js +2 -0
- package/dist/runtime-embedded-pi.runtime.js +1 -1
- package/dist/runtime-internal-Bu1n9i4P.js +2 -0
- package/dist/runtime-options-CN4g8VJE.js +275 -0
- package/dist/runtime-schema-C3ix-VNE.js +27780 -0
- package/dist/scan-C8jthyct.js +523 -0
- package/dist/scan-DEd4q4aN.js +2 -0
- package/dist/secrets-cli-iBL8NBAq.js +2101 -0
- package/dist/security-cli-CzYBRa4n.js +486 -0
- package/dist/selection-BOalx5uy.js +2 -0
- package/dist/selection-BZFVKdFz.js +7736 -0
- package/dist/send-C4mKkkWW.js +156 -0
- package/dist/send-C_36w3lb.js +102 -0
- package/dist/send.runtime-vJT5TzDj.js +2 -0
- package/dist/send.runtime.js +1 -1
- package/dist/server-CBQVrNY0.js +77 -0
- package/dist/server-DAWF7iAc.js +13 -0
- package/dist/server-context-Dq2VA7I4.js +2 -0
- package/dist/server-context-O_WUP8OV.js +847 -0
- package/dist/server-node-events-B8PLg0eQ.js +481 -0
- package/dist/server-plugin-bootstrap-DRMyT3TQ.js +2 -0
- package/dist/server-plugin-bootstrap-E5PJcEA2.js +11333 -0
- package/dist/server-restart-sentinel-BCd6AqrQ.js +697 -0
- package/dist/server.impl-KAOuJEQa.js +12735 -0
- package/dist/service-D6nRIQp0.js +120 -0
- package/dist/service-audit-CuYUK6l5.js +2 -0
- package/dist/service-audit-FsztusUk.js +261 -0
- package/dist/service-fyUTnkAE.js +2 -0
- package/dist/session-kill-http-ChCr5CQ3.js +110 -0
- package/dist/session-reset-service-DsYIDYdh.js +471 -0
- package/dist/session-route-rem428sJ.js +93 -0
- package/dist/session-status.runtime-CFmGwoCm.js +2 -0
- package/dist/session-status.runtime.js +1 -1
- package/dist/session-subagent-reactivation.runtime-DLkpnURC.js +2 -0
- package/dist/session-subagent-reactivation.runtime.js +1 -1
- package/dist/session-tab-registry-DWyzIez5.js +491 -0
- package/dist/session-visibility-CJocpWP0.js +147 -0
- package/dist/sessions-helpers-CMf9gVTZ.js +304 -0
- package/dist/sessions-history-http-C5iZkW8x.js +383 -0
- package/dist/sessions-patch-2sBcHc9a.js +309 -0
- package/dist/sessions-resolve-D1hmolC-.js +174 -0
- package/dist/sessions.runtime-DMPmzLE0.js +2 -0
- package/dist/sessions.runtime.js +1 -1
- package/dist/setup-BCTvNOj1.js +495 -0
- package/dist/setup-api-DilgjV01.js +29 -0
- package/dist/setup-core-CFAiauCt.js +171 -0
- package/dist/setup-core-RgJfQc-C.js +176 -0
- package/dist/setup-surface-C0l9bHY3.js +286 -0
- package/dist/setup-surface-CfcFHZln.js +403 -0
- package/dist/setup-surface-CyDRXq_1.js +219 -0
- package/dist/setup.finalize-02oxjXU3.js +539 -0
- package/dist/setup.gateway-config-Df6Jm4vX.js +250 -0
- package/dist/shared-3gP_6DZV.js +76 -0
- package/dist/shared-C9fN-WCy.js +198 -0
- package/dist/shared-Cz9c46Aj.js +121 -0
- package/dist/slash-state-C7nXXf23.js +1911 -0
- package/dist/src-LnF0REtW.js +3974 -0
- package/dist/startup-context-CxTy7OzN.js +312 -0
- package/dist/status-4n9xL7HY.js +2 -0
- package/dist/status-BeHR7joL.js +209 -0
- package/dist/status-D9Njde8S.js +2 -0
- package/dist/status-Db2zz0yf.js +397 -0
- package/dist/status-QN-37T-w.js +3 -0
- package/dist/status-all-BiRJ-uPf.js +498 -0
- package/dist/status-f2DLmjOF.js +190 -0
- package/dist/status-json-DOq74jka.js +14 -0
- package/dist/status-json-command-DtaWaUPH.js +84 -0
- package/dist/status-runtime-shared-BgbbPlTW.js +257 -0
- package/dist/status-subagents.runtime-03fp3eBE.js +18 -0
- package/dist/status-subagents.runtime.js +1 -1
- package/dist/status-text-CNvz374U.js +237 -0
- package/dist/status.gateway-connection.runtime-zjQmormq.js +2 -0
- package/dist/status.gateway-connection.runtime.js +1 -1
- package/dist/status.gather-G7eWnGnc.js +2 -0
- package/dist/status.gather-nP-ItDeK.js +292 -0
- package/dist/status.runtime-IzRA68mh.js +2 -0
- package/dist/status.runtime.js +1 -1
- package/dist/status.scan-DjhdTOWP.js +65 -0
- package/dist/status.scan-overview-BYxTBsOw.js +379 -0
- package/dist/status.scan.fast-json-Dz0JcORG.js +2 -0
- package/dist/status.scan.fast-json-FroEIZ9d.js +132 -0
- package/dist/status.summary-3UVa_X5B.js +214 -0
- package/dist/status.summary-BGzGsyZB.js +2 -0
- package/dist/subagent-announce-BvRFZ87M.js +351 -0
- package/dist/subagent-announce-delivery-QvuOM46S.js +726 -0
- package/dist/subagent-announce-output-fOtzkOiP.js +364 -0
- package/dist/subagent-control-DwnzmG6T.js +506 -0
- package/dist/subagent-followup.runtime-DxR1eP_x.js +68 -0
- package/dist/subagent-followup.runtime.js +1 -1
- package/dist/subagent-orphan-recovery-CiBbDxX3.js +305 -0
- package/dist/subagent-registry-D5FrT_tn.js +3 -0
- package/dist/subagent-registry-DbPekx8d.js +1753 -0
- package/dist/subagent-registry.runtime.js +1 -1
- package/dist/subagent-spawn-W-bTaU9l.js +1005 -0
- package/dist/system-cli-B443uVHG.js +59 -0
- package/dist/targets-3Lcm8HoL.js +67 -0
- package/dist/task-executor-B5e9_Hmt.js +360 -0
- package/dist/task-owner-access-CIEssJ78.js +74 -0
- package/dist/task-registry-M1bHrFvP.js +2366 -0
- package/dist/task-registry-delivery-runtime-CiHBC7sJ.js +3 -0
- package/dist/task-registry-delivery-runtime-M4O7ffju.js +2 -0
- package/dist/task-registry.maintenance-BURvMU0r.js +2 -0
- package/dist/task-registry.maintenance-CgrLoBqi.js +416 -0
- package/dist/telegram/token.js +1 -1
- package/dist/testing-CRy_6-wt.js +575 -0
- package/dist/text-report-ClTof2oc.js +587 -0
- package/dist/tool-resolution-C52y5Qtc.js +90 -0
- package/dist/tools-effective-inventory-WlIlqM7G.js +152 -0
- package/dist/tools-invoke-http-B04Rc8tG.js +206 -0
- package/dist/trash-BV5Gcx3a.js +24 -0
- package/dist/tui-cli-DMZ07qRK.js +4575 -0
- package/dist/update-cli-CxZPAy-d.js +1759 -0
- package/dist/upgrade-C9ke1SCc.js +1226 -0
- package/dist/video-generation-task-status-I3jvAjUL.js +163 -0
- package/dist/wait-for-idle-before-flush-BZhF2ejZ.js +5986 -0
- package/dist/wizard-models-CMKeAr_M.js +161 -0
- package/package.json +1 -1
- package/dist/abort-Yw60gQ-C.js +0 -201
- package/dist/abort.runtime-DYQuut_O.js +0 -2
- package/dist/accounts-BSCHGPHp.js +0 -107
- package/dist/accounts-Bb0FqxV2.js +0 -104
- package/dist/accounts-BjGgx8lz.js +0 -2
- package/dist/acp-cli-emMnOaiO.js +0 -2193
- package/dist/acp-spawn-BmyUZuJX.js +0 -1093
- package/dist/acp-spawn-DPF5zmnN.js +0 -2
- package/dist/acp-stateful-target-driver-CJ4JyIHf.js +0 -89
- package/dist/action-agents-D1tXt8Kj.js +0 -67
- package/dist/action-focus-Bk6AJsNH.js +0 -132
- package/dist/action-help-4nFSAuVo.js +0 -7
- package/dist/action-info-D-byoefn.js +0 -101
- package/dist/action-kill-Bo-NwBVR.js +0 -33
- package/dist/action-list-lAa4rlzN.js +0 -21
- package/dist/action-log-BasoUC3L.js +0 -30
- package/dist/action-send-DwLkiz4x.js +0 -39
- package/dist/action-spawn-C70_iR8d.js +0 -47
- package/dist/action-unfocus-dUVMx5Fh.js +0 -29
- package/dist/actions.runtime-BdSo6rN8.js +0 -18
- package/dist/actions.runtime-BvY67XKu.js +0 -5
- package/dist/agent-DDBv3Vgl.js +0 -2
- package/dist/agent-command-DC7I_88W.js +0 -874
- package/dist/agent-harness-runtime-TA6YH7Ud.js +0 -144
- package/dist/agent-runner-utils-CMe-JIDq.js +0 -239
- package/dist/agent-runner.runtime-le6AmJRw.js +0 -3455
- package/dist/agent-runtime-CONy4fDD.js +0 -18
- package/dist/agents-BlbOM4XW.js +0 -953
- package/dist/agents-Byj8CDAP.js +0 -5
- package/dist/aliases-C3Ks5x38.js +0 -2
- package/dist/aliases-CxBcx9gF.js +0 -96
- package/dist/api-CLoj7nYH.js +0 -3
- package/dist/api-DZiRkVPk.js +0 -5
- package/dist/api-_Y4nIHNo.js +0 -139
- package/dist/approval-gateway-resolver-Ba_2kb3B.js +0 -29
- package/dist/approval-gateway-runtime-7VMivk0A.js +0 -2
- package/dist/approval-handler-runtime-Bh0onoHD.js +0 -439
- package/dist/approval-native-runtime-IYFyT8Hf.js +0 -729
- package/dist/attempt-execution.runtime-CpL2tsYd.js +0 -509
- package/dist/attempt.prompt-helpers-Gx9nGKbW.js +0 -221
- package/dist/attempt.tool-run-context-BmuljBMs.js +0 -933
- package/dist/audit-CsjqOEVE.js +0 -939
- package/dist/audit.runtime-BybEaYH4.js +0 -7
- package/dist/auth-BFbLz2gx.js +0 -383
- package/dist/auth-DdoNShRm.js +0 -2
- package/dist/auth-order-CtO2WQTH.js +0 -2
- package/dist/auth-order-zXIiW-Cn.js +0 -96
- package/dist/bash-tools-CnDYSbnX.js +0 -2824
- package/dist/bash-tools-DiOcKaak.js +0 -3
- package/dist/binding-routing-E9Gh_NqO.js +0 -85
- package/dist/binding-targets-C5PbBaZ6.js +0 -121
- package/dist/bridge-server-DragdaQD.js +0 -113
- package/dist/browser-control-auth-D_M31xJ1.js +0 -2
- package/dist/browser-node-runtime-Bgu82luB.js +0 -12
- package/dist/browser-profiles-C3ffkgOt.js +0 -2
- package/dist/browser-runtime-D84IBo4A.js +0 -387
- package/dist/browser-setup-tools-VC7rGCyn.js +0 -13
- package/dist/build-DeGDX_pJ.js +0 -550
- package/dist/call-CbvF41H8.js +0 -3
- package/dist/call-DuDGOVT1.js +0 -331
- package/dist/call.runtime-DztWXjMr.js +0 -2
- package/dist/capability-cli-DoJLi3eS.js +0 -1401
- package/dist/catchup-Dk-5hIwm.js +0 -300
- package/dist/channel-BJ9iEC4Y.js +0 -595
- package/dist/channel-BdvsbgZE.js +0 -453
- package/dist/channel-Bu-7KaIx.js +0 -1802
- package/dist/channel-C9vQNMK1.js +0 -350
- package/dist/channel-CZoVAZyW.js +0 -491
- package/dist/channel-Cr2KTwyo.js +0 -840
- package/dist/channel-DCeC6AEQ.js +0 -297
- package/dist/channel-DOGp2TfT.js +0 -1320
- package/dist/channel-Dfq1lxxI.js +0 -226
- package/dist/channel-core-DiltAzdr.js +0 -5
- package/dist/channel-hZDaTBpm.js +0 -1100
- package/dist/channel-inbound-DvOS-Z1s.js +0 -31
- package/dist/channel-plugin-runtime-PFRHQ61T.js +0 -771
- package/dist/channel-runtime-BAjxIEfQ.js +0 -425
- package/dist/channel-szBwbQZB.js +0 -1174
- package/dist/channel.runtime-B1Ry35gt.js +0 -89
- package/dist/channel.runtime-BNp6GxaQ.js +0 -34702
- package/dist/channel.runtime-BfjvNvbj.js +0 -2364
- package/dist/channel.runtime-BlGn4QYV.js +0 -4
- package/dist/channel.runtime-D7bv5rJl.js +0 -576
- package/dist/channel.runtime-DQ5gSgeW.js +0 -109
- package/dist/channel.runtime-IxClQMdT.js +0 -430
- package/dist/channel.setup-BsfyGPgV.js +0 -10
- package/dist/channels-Dn2VHRmZ.js +0 -733
- package/dist/channels-cli-l4xjPvDv.js +0 -268
- package/dist/chat-zUeX8mQw.js +0 -2758
- package/dist/clawbot-cli-C3BFdHJB.js +0 -9
- package/dist/cli-BTnpFsj1.js +0 -2
- package/dist/cli-CAFQ6Cwy.js +0 -72
- package/dist/cli-CiqIbwtg.js +0 -219
- package/dist/cli-DL1ppK38.js +0 -2
- package/dist/cli-runner-DO6lEPJr.js +0 -286
- package/dist/cli-runner.runtime-B-Ic4DyC.js +0 -3
- package/dist/cli-runner.runtime-C4cAORcg.js +0 -4
- package/dist/cli.runtime-CYHctHVS.js +0 -1261
- package/dist/client-Bb_miREU.js +0 -138
- package/dist/client-CrPccv7a.js +0 -713
- package/dist/command-auth-B7P-1IeA.js +0 -76
- package/dist/command-config-resolution-BB-SsCob.js +0 -23
- package/dist/command-config-resolution-DMKYb0Kh.js +0 -2
- package/dist/command-config-resolution.runtime-Coeaa9lz.js +0 -2
- package/dist/command-registry-B2JzWHqy.js +0 -9
- package/dist/command-registry-CNUpJUp8.js +0 -4
- package/dist/command-registry-core-BLap9aka.js +0 -101
- package/dist/command-secret-gateway-ChRXthnT.js +0 -528
- package/dist/command-status.runtime-D8VWyC3v.js +0 -87
- package/dist/commands-acp-QLk1cU5f.js +0 -77
- package/dist/commands-compact.runtime-BIHG2RSY.js +0 -10
- package/dist/commands-handlers.runtime-DjimbxSJ.js +0 -4597
- package/dist/commands-status-DiIQSYSt.js +0 -16
- package/dist/commands-status.runtime-DBRxICN6.js +0 -3
- package/dist/commands-subagents-control.runtime-BmqXiKHu.js +0 -3
- package/dist/commands-subagents-control.runtime-CVQSOd8H.js +0 -2
- package/dist/commands-system-prompt-2qwZc3xL.js +0 -158
- package/dist/commands-system-prompt-Clnn_Gct.js +0 -2
- package/dist/commands.runtime-DAqpiDPr.js +0 -166
- package/dist/compact-DqOkQZYr.js +0 -1118
- package/dist/compact.runtime-CC_l29j4.js +0 -12
- package/dist/completion-cli-DZFJPSiF.js +0 -328
- package/dist/config-D9XEe0Cd.js +0 -251
- package/dist/config-cli-DVDwIjKr.js +0 -1078
- package/dist/configure-39oQUHuK.js +0 -1245
- package/dist/configure-BGD8tViZ.js +0 -2
- package/dist/connect-options-Fpky6zuL.js +0 -699
- package/dist/control-auth-BlqH4IVx.js +0 -125
- package/dist/control-service-CaqDohiY.js +0 -156
- package/dist/conversation-id-BH9GFVB2.js +0 -235
- package/dist/conversation-id-UdIegcf4.js +0 -38
- package/dist/conversation-runtime-Bao0kIPf.js +0 -31
- package/dist/core-DXUh5Xbm.js +0 -275
- package/dist/cron-cli-B1mxHnGP.js +0 -713
- package/dist/daemon-cli-CaHBNwMy.js +0 -12
- package/dist/daemon-install-BBwOxf1q.js +0 -64
- package/dist/delegate-7G7R4C-C.js +0 -64
- package/dist/detached-task-runtime-BMdSrcuz.js +0 -73
- package/dist/devices-cli-DnEQH3R2.js +0 -496
- package/dist/diagnostics-C8VwSDtU.js +0 -154
- package/dist/direct-dm-BSEkIiOe.js +0 -64
- package/dist/dispatch-1gv6It-6.js +0 -1131
- package/dist/dispatch-acp-hbhR9aHr.js +0 -981
- package/dist/dispatch-acp-manager.runtime-BXQbK1cO.js +0 -3
- package/dist/dispatch-acp.runtime-Dhx090J2.js +0 -19
- package/dist/doctor-device-pairing-1gf3tk3g.js +0 -307
- package/dist/doctor-gateway-daemon-flow-LEnN6pL-.js +0 -250
- package/dist/doctor-gateway-health-DwxLkTV4.js +0 -60
- package/dist/doctor-gateway-services-BhqUOY_e.js +0 -316
- package/dist/doctor-health-CdJkaUYf.js +0 -59
- package/dist/doctor-health-contributions-BaTnIzCT.js +0 -486
- package/dist/doctor-prompter-BZTb5rOn.js +0 -56
- package/dist/doctor-workspace-status-DnBARoPa.js +0 -75
- package/dist/dreaming-BAGFdUxh.js +0 -1574
- package/dist/dreaming-narrative-XoOfVb0x.js +0 -595
- package/dist/embedded-gateway-stub.runtime-xwZ-M7Ei.js +0 -9
- package/dist/exec-approvals-cli-CWVWSMk-.js +0 -498
- package/dist/fallbacks-BKA5XrxA.js +0 -31
- package/dist/fallbacks-QvezaDAr.js +0 -2
- package/dist/fallbacks-shared-DS-qTOLR.js +0 -111
- package/dist/gateway-C0YHaLXO.js +0 -115
- package/dist/gateway-cli-DJBCD8J5.js +0 -1325
- package/dist/gateway-rpc-CmJXd4SU.js +0 -14
- package/dist/gateway-rpc.runtime-C9Fs2mSx.js +0 -23
- package/dist/gateway-runtime-Bm2_MhFn.js +0 -15
- package/dist/gateway-status-DXKMKFtB.js +0 -584
- package/dist/genesis-tools-AolFZ-0I.js +0 -8999
- package/dist/genesis-tools.runtime-CBWXJqzw.js +0 -2
- package/dist/get-reply-BpxjHQBp.js +0 -3879
- package/dist/get-reply-from-config.runtime-DJKEqLSi.js +0 -2
- package/dist/graph-users-D2Q5UTGQ.js +0 -1337
- package/dist/health-BNKpuAPB.js +0 -469
- package/dist/health-BkxZfKx8.js +0 -3
- package/dist/heartbeat-runner-Bdu2q6k3.js +0 -5
- package/dist/heartbeat-runner-C0B-c-fv.js +0 -1292
- package/dist/heartbeat-runner.runtime-Cic23eNy.js +0 -4
- package/dist/hooks-cli-BfCr2In5.js +0 -433
- package/dist/image-fallbacks-Dgy-LmDo.js +0 -2
- package/dist/image-fallbacks-RlfTqOne.js +0 -31
- package/dist/inbound-reply-dispatch-D4KJHWLG.js +0 -73
- package/dist/infra-runtime-BTJv3KK8.js +0 -39
- package/dist/init-q4INH9uv.js +0 -59
- package/dist/install-BT4BNeMX.js +0 -190
- package/dist/install.runtime-BnqPyIyn.js +0 -2
- package/dist/launchd-BM_37PLv.js +0 -698
- package/dist/library-DGd4UZKC.js +0 -45
- package/dist/lifecycle-B_RLw4uY.js +0 -229
- package/dist/lifecycle-Bw01evSl.js +0 -571
- package/dist/lifecycle-core-CTjCo-k0.js +0 -422
- package/dist/lifecycle.runtime-BxpD2Ol7.js +0 -2
- package/dist/list-BXa4zUF-.js +0 -2
- package/dist/list-BugTSXmQ.js +0 -131
- package/dist/list-CgC_rsta.js +0 -1201
- package/dist/list-D2sk1YPs.js +0 -2
- package/dist/list.probe-C6zfgLdG.js +0 -419
- package/dist/llm-slug-generator-DsWJvqNx.js +0 -79
- package/dist/load-config-D6ZKPY7I.js +0 -35
- package/dist/local-dispatch.runtime-MWMxyZKj.js +0 -8
- package/dist/logs-cli-Dn-8jl3z.js +0 -265
- package/dist/logs-cli.runtime-DwsccWUJ.js +0 -2
- package/dist/main-session-restart-recovery-6Uh4W8ZJ.js +0 -206
- package/dist/managed-image-attachments-DHawPS1-.js +0 -2
- package/dist/managed-image-attachments-DjtxwZ9o.js +0 -635
- package/dist/manager-D0tkR46e.js +0 -2057
- package/dist/manager-g_P1RDky.js +0 -2
- package/dist/markdown-to-line-7AxR7QFo.js +0 -790
- package/dist/mcp-cli-Cw2XQMOA.js +0 -725
- package/dist/mcp-http-DFKqya8U.js +0 -529
- package/dist/memory-core-host-runtime-cli-DaAsOXiU.js +0 -9
- package/dist/message-BDCG7eWj.js +0 -232
- package/dist/message-action-runner-6C7kXcC9.js +0 -2
- package/dist/message-action-runner-C2P3efhU.js +0 -1407
- package/dist/message-actions-BWQWt5gT.js +0 -143
- package/dist/message.gateway.runtime-BXChuYAf.js +0 -2
- package/dist/models-auth-status-B8lnM1PS.js +0 -201
- package/dist/models-cli-DbUA18AN.js +0 -219
- package/dist/monitor-BEJe2ceJ.js +0 -1237
- package/dist/monitor-BO9i6U5R.js +0 -1459
- package/dist/monitor-BZLrxL_x.js +0 -1661
- package/dist/monitor-CDDxHGlD.js +0 -788
- package/dist/monitor-D779kLc0.js +0 -671
- package/dist/monitor-V5ZNCrQL.js +0 -2
- package/dist/monitor-auth-D2rCHNgr.js +0 -207
- package/dist/monitor-processing-BLbsNFVv.js +0 -1974
- package/dist/monitor.runtime-RrusGXVO.js +0 -2
- package/dist/monitor.webhook-B0DuBNWa.js +0 -180
- package/dist/msteams-hh9nwLlZ.js +0 -35
- package/dist/native-hook-relay-BygYZoeR.js +0 -519
- package/dist/nextcloud-talk-AadRCqXn.js +0 -17
- package/dist/node-cli-FF1zz0JU.js +0 -2506
- package/dist/node-service-f8mmgM5L.js +0 -68
- package/dist/nodes-cli-tQ5dpecZ.js +0 -1046
- package/dist/nodes-utils-BfpGcUca.js +0 -84
- package/dist/nodes.helpers-CMXxavTs.js +0 -34
- package/dist/notify-DaNP5Zyh.js +0 -315
- package/dist/onboard-B9hx80Dm.js +0 -632
- package/dist/onboard-helpers-BlPrFJHK.js +0 -204
- package/dist/onboard-helpers-kL8mgUkl.js +0 -6
- package/dist/onboard-remote-ByHuQd1m.js +0 -193
- package/dist/onboard-remote-CRPXcrWy.js +0 -2
- package/dist/onboard-skills-ChtyNRCd.js +0 -2
- package/dist/onboard-skills-DROlYXya.js +0 -134
- package/dist/openai-http-2An5HAJU.js +0 -500
- package/dist/openresponses-http-DpbJXZP4.js +0 -1128
- package/dist/operator-approvals-client-BoN_VmkB.js +0 -68
- package/dist/outbound.runtime-D_aebUn6.js +0 -2
- package/dist/pair-command-approve-i-1VECJx.js +0 -44
- package/dist/persistent-bindings.lifecycle-eZyKQ1D8.js +0 -85
- package/dist/persistent-bindings.lifecycle-mxY73TJR.js +0 -2
- package/dist/pi-embedded-0fErjTQ7.js +0 -2905
- package/dist/pi-embedded-Bc1jC2x0.js +0 -4
- package/dist/pi-embedded.runtime-Bn_RZ5z8.js +0 -4
- package/dist/pi-tool-definition-adapter-thh7LO1t.js +0 -217
- package/dist/pi-tools-BtlLDovQ.js +0 -1057
- package/dist/pi-tools.before-tool-call-BJ_X8Dq3.js +0 -2
- package/dist/pi-tools.before-tool-call-DdPCGWCs.js +0 -433
- package/dist/plugin-CdHHk4Xn.js +0 -12195
- package/dist/plugin-enabled-DybhbjKQ.js +0 -140
- package/dist/plugin-registration-Bgwpsokw.js +0 -23
- package/dist/plugin-service-ClhrJfT3.js +0 -2890
- package/dist/policy-CoqHgREn.js +0 -328
- package/dist/prepare.runtime-CawO_32K.js +0 -815
- package/dist/probe-BP3QS65i.js +0 -74
- package/dist/probe-BdCXAH_u.js +0 -2
- package/dist/probe-Cv5tXOMP.js +0 -2205
- package/dist/probe-D-D_1oc4.js +0 -241
- package/dist/probe-DO-gll0g.js +0 -2
- package/dist/probe-T6c0F73q.js +0 -45
- package/dist/probe-dxji7IxZ.js +0 -1443
- package/dist/program-GMPfHt5E.js +0 -111
- package/dist/prompt-select-styled-BvuJNEJG.js +0 -20
- package/dist/protocol-Batc2DmY.js +0 -2234
- package/dist/provider-dispatcher-CGYoOdKf.js +0 -2
- package/dist/provider-dispatcher-iTEDM88F.js +0 -22
- package/dist/qr-cli-6IxenO1C.js +0 -349
- package/dist/qr-cli-D63piSog.js +0 -2
- package/dist/reaction-runtime-api-DgwRXTz2.js +0 -116
- package/dist/reactions-Dnh7t4Zl.js +0 -998
- package/dist/register-service-commands-D7w01SKL.js +0 -71
- package/dist/register.agent-j1Eno4xr.js +0 -248
- package/dist/register.configure-ubwxTkGt.js +0 -15
- package/dist/register.maintenance-B7FuM_ZW.js +0 -438
- package/dist/register.message-QR3u9rBl.js +0 -329
- package/dist/register.onboard-Bdcf_lH0.js +0 -81
- package/dist/register.runtime-QDduc4yj.js +0 -81
- package/dist/register.setup-DzVV6tdQ.js +0 -150
- package/dist/register.status-health-sessions-Brw3VcxG.js +0 -1215
- package/dist/register.subclis-B8qDbqPl.js +0 -29
- package/dist/register.subclis-DdoN3nZi.js +0 -3
- package/dist/register.subclis-core-CWHmnIoe.js +0 -249
- package/dist/reply-dispatch-runtime-BVLvCeJ0.js +0 -13
- package/dist/reply-runtime-BXkvfLv_.js +0 -11
- package/dist/reply.runtime-BTkpxI5R.js +0 -2
- package/dist/restart-health-6cjrRBpF.js +0 -202
- package/dist/restart-health-b6Qw43Tj.js +0 -2
- package/dist/root-help-DDa1oEtT.js +0 -44
- package/dist/routes-CoCMty69.js +0 -2
- package/dist/routes-D9uC_Zdy.js +0 -3341
- package/dist/rpc-DpLGM3FH.js +0 -61
- package/dist/rpc.runtime-B27EA5A0.js +0 -21
- package/dist/run-delivery.runtime-OmILefLX.js +0 -530
- package/dist/run-embedded.runtime-Dc43u_Z7.js +0 -4
- package/dist/run-execution-cli.runtime-DL5w7Ac8.js +0 -4
- package/dist/run-executor.runtime-Bzwt0zP-.js +0 -277
- package/dist/run-main-BLD1wTLU.js +0 -516
- package/dist/run-subagent-registry.runtime-CddCeg6W.js +0 -2
- package/dist/run-wait-D4Gxuyru.js +0 -135
- package/dist/runtime-8BuIPrSY.js +0 -973
- package/dist/runtime-Co8r21pw.js +0 -9
- package/dist/runtime-api-BG0XWkir.js +0 -4
- package/dist/runtime-api-BjBzlgns.js +0 -9
- package/dist/runtime-api-DlYbbA-n.js +0 -14
- package/dist/runtime-api-faT33SE2.js +0 -9
- package/dist/runtime-embedded-pi.runtime-QdJ7K4t0.js +0 -2
- package/dist/runtime-internal-C0xc_Zhf.js +0 -2
- package/dist/runtime-options-DLv7ygkO.js +0 -275
- package/dist/runtime-schema-CQK5R5Pl.js +0 -27780
- package/dist/scan-Yz6DoQn5.js +0 -523
- package/dist/scan-k38hL_6o.js +0 -2
- package/dist/secrets-cli-Bjvr0bOw.js +0 -2101
- package/dist/security-cli-C2gkMFcB.js +0 -486
- package/dist/selection-DC8EXnRg.js +0 -7736
- package/dist/selection-DmSFI5k4.js +0 -2
- package/dist/send-CT6EfHrc.js +0 -102
- package/dist/send-_ANvjE_C.js +0 -156
- package/dist/send.runtime-COIjG4BV.js +0 -2
- package/dist/server-COkv9Si4.js +0 -13
- package/dist/server-DHLQZJL8.js +0 -77
- package/dist/server-context-6jnr-aAw.js +0 -2
- package/dist/server-context-DK1QsdLh.js +0 -847
- package/dist/server-node-events-q8H0odkq.js +0 -481
- package/dist/server-plugin-bootstrap-Bw4a88yA.js +0 -2
- package/dist/server-plugin-bootstrap-By_w9ngt.js +0 -11333
- package/dist/server-restart-sentinel-CGLYF3mk.js +0 -697
- package/dist/server.impl-8j4SImks.js +0 -12735
- package/dist/service-CNjb_qXC.js +0 -2
- package/dist/service-CyR3mZIU.js +0 -120
- package/dist/service-audit-DIL0OiMa.js +0 -260
- package/dist/service-audit-pwloDggS.js +0 -2
- package/dist/session-kill-http-Dek5w0Ee.js +0 -110
- package/dist/session-reset-service-B_9Ps0kr.js +0 -471
- package/dist/session-route-Cr6vOd9_.js +0 -93
- package/dist/session-status.runtime-C_x1MHH5.js +0 -2
- package/dist/session-subagent-reactivation.runtime-BKWuNild.js +0 -2
- package/dist/session-tab-registry-C08V5jx6.js +0 -491
- package/dist/session-visibility-D4j8hN_B.js +0 -147
- package/dist/sessions-helpers-DmUVRk16.js +0 -304
- package/dist/sessions-history-http-DN3KzEnX.js +0 -383
- package/dist/sessions-patch-BPtlF0Lu.js +0 -309
- package/dist/sessions-resolve-D6KPfG_4.js +0 -174
- package/dist/sessions.runtime-DGL1-G20.js +0 -2
- package/dist/setup-CkYiQoP0.js +0 -495
- package/dist/setup-api-CUGYqGNT.js +0 -29
- package/dist/setup-core-BmplfubJ.js +0 -171
- package/dist/setup-core-C5ddWpfy.js +0 -176
- package/dist/setup-surface-2JmEfowI.js +0 -219
- package/dist/setup-surface-BzHQx_GD.js +0 -403
- package/dist/setup-surface-DOH6kc6w.js +0 -286
- package/dist/setup.finalize-Ci2HBkDq.js +0 -539
- package/dist/setup.gateway-config-CyG_Fzaa.js +0 -250
- package/dist/shared-BItUH43s.js +0 -121
- package/dist/shared-D7diJkX6.js +0 -198
- package/dist/shared-DJU_HCJ1.js +0 -76
- package/dist/slash-state-C4YD-tLz.js +0 -1911
- package/dist/src-8HdytGc7.js +0 -3974
- package/dist/startup-context-CfcCyUU0.js +0 -312
- package/dist/status-B94yciC9.js +0 -397
- package/dist/status-BUkUYtFm.js +0 -190
- package/dist/status-BsHC-0MV.js +0 -2
- package/dist/status-D4jNATg0.js +0 -209
- package/dist/status-U8ut-X2Q.js +0 -2
- package/dist/status-all-CIzsXQnV.js +0 -498
- package/dist/status-json-alPkfWTd.js +0 -14
- package/dist/status-json-command-CAkzWzw7.js +0 -84
- package/dist/status-jxNdVQVZ.js +0 -3
- package/dist/status-runtime-shared-BSsA48i9.js +0 -257
- package/dist/status-subagents.runtime-hIKg6PXV.js +0 -18
- package/dist/status-text-BmLJrLth.js +0 -237
- package/dist/status.gateway-connection.runtime-Dr7HJ1wZ.js +0 -2
- package/dist/status.gather-DFY0T97g.js +0 -2
- package/dist/status.gather-e6sfNh8I.js +0 -292
- package/dist/status.runtime-DBvapXQS.js +0 -2
- package/dist/status.scan-DSpkE-Q-.js +0 -65
- package/dist/status.scan-overview-Dr72bkbi.js +0 -379
- package/dist/status.scan.fast-json-C7k_m46S.js +0 -2
- package/dist/status.scan.fast-json-KHh7R3wX.js +0 -132
- package/dist/status.summary-C4r9lkCH.js +0 -214
- package/dist/status.summary-D0EJwkmX.js +0 -2
- package/dist/subagent-announce-Bu5-8O3P.js +0 -351
- package/dist/subagent-announce-delivery-4hk9P48s.js +0 -726
- package/dist/subagent-announce-output-Csyi1-Kz.js +0 -364
- package/dist/subagent-control-DAeNsV_G.js +0 -506
- package/dist/subagent-followup.runtime-Bch92LIq.js +0 -68
- package/dist/subagent-orphan-recovery-mNzyr1b-.js +0 -305
- package/dist/subagent-registry-BMjQxBxi.js +0 -3
- package/dist/subagent-registry-D4DFKQCL.js +0 -1753
- package/dist/subagent-spawn-C13uUm47.js +0 -1005
- package/dist/system-cli-BU6GhJxG.js +0 -59
- package/dist/targets-eYkepVzz.js +0 -67
- package/dist/task-executor-DzJLcm4D.js +0 -360
- package/dist/task-owner-access-DW9EbhjP.js +0 -74
- package/dist/task-registry-DBJkAtFF.js +0 -2366
- package/dist/task-registry-delivery-runtime-BdkPeGC1.js +0 -2
- package/dist/task-registry-delivery-runtime-Ov88LGnv.js +0 -3
- package/dist/task-registry.maintenance-BU6Z4V_9.js +0 -416
- package/dist/task-registry.maintenance-sEo6eYdx.js +0 -2
- package/dist/testing-B2jHeQft.js +0 -575
- package/dist/text-report-HYrgZP8-.js +0 -587
- package/dist/tool-resolution-BZxaDOKg.js +0 -90
- package/dist/tools-effective-inventory-BCvCprpD.js +0 -152
- package/dist/tools-invoke-http-Dt1rsx4a.js +0 -206
- package/dist/trash-F4tvjrKS.js +0 -24
- package/dist/tui-cli-DlQ1oejy.js +0 -4575
- package/dist/update-cli-DHMdwQWA.js +0 -1759
- package/dist/upgrade-UR-EI5pO.js +0 -1226
- package/dist/video-generation-task-status-qtHrIZLt.js +0 -163
- package/dist/wait-for-idle-before-flush-CYB_61O0.js +0 -5986
- package/dist/wizard-models-BKqMCaCm.js +0 -161
|
@@ -0,0 +1,1093 @@
|
|
|
1
|
+
import { c as normalizeOptionalString, s as normalizeOptionalLowercaseString } from "./string-coerce-C1IzJjqi.js";
|
|
2
|
+
import { t as createSubsystemLogger } from "./subsystem-DTMy5YmO.js";
|
|
3
|
+
import { r as logVerbose } from "./globals-C5IxqXPj.js";
|
|
4
|
+
import { a as loadConfig } from "./io-DNd8mbjy.js";
|
|
5
|
+
import { a as isSubagentSessionKey, o as parseAgentSessionKey } from "./session-key-utils-BT0y7mVK.js";
|
|
6
|
+
import { c as normalizeAgentId, p as scopedHeartbeatWakeOptions, u as resolveAgentIdFromSessionKey } from "./session-key-EpIbK3Oz.js";
|
|
7
|
+
import { _ as resolveAgentConfig, x as resolveDefaultAgentId } from "./agent-scope-CDjZLqNk.js";
|
|
8
|
+
import { t as parseDurationMs } from "./parse-duration-DH3x5y_9.js";
|
|
9
|
+
import "./config-3He3LWHw.js";
|
|
10
|
+
import { a as resolveSessionFilePathOptions, i as resolveSessionFilePath, u as resolveStorePath } from "./paths-DD6L4IvS.js";
|
|
11
|
+
import { t as deliveryContextFromSession } from "./delivery-context.shared-Bddxu9DN.js";
|
|
12
|
+
import { t as loadSessionStore } from "./store-load-CUqchamJ.js";
|
|
13
|
+
import "./store-CUSu4-Qr.js";
|
|
14
|
+
import { r as resolveSessionTranscriptFile } from "./transcript-Bu-SsK2V.js";
|
|
15
|
+
import { l as onAgentEvent } from "./agent-events-CrZzR8Z1.js";
|
|
16
|
+
import { a as normalizeAssistantPhase } from "./chat-message-content-f1D-O-pU.js";
|
|
17
|
+
import "./heartbeat-DFFJQW7H.js";
|
|
18
|
+
import { n as resolveSandboxRuntimeStatus } from "./runtime-status-W0lHxRqX.js";
|
|
19
|
+
import { r as callGateway } from "./call-ORivR4Db.js";
|
|
20
|
+
import { n as resolveConversationDeliveryTarget, t as formatConversationTarget } from "./delivery-context-41aFK9p7.js";
|
|
21
|
+
import { o as resolveInternalSessionKey, s as resolveMainSessionAlias } from "./sessions-helpers-CMf9gVTZ.js";
|
|
22
|
+
import { a as getSubagentDepthFromSessionStore, i as resolveSubagentCapabilityStore, r as resolveSubagentCapabilities, t as isSubagentEnvelopeSession } from "./subagent-capabilities-1ZqaiPST.js";
|
|
23
|
+
import { n as requestHeartbeatNow, t as areHeartbeatsEnabled } from "./heartbeat-wake-CrIAzATu.js";
|
|
24
|
+
import { i as enqueueSystemEvent } from "./system-events-CXxVc5Du.js";
|
|
25
|
+
import { f as listTasksForOwnerKey } from "./task-registry-M1bHrFvP.js";
|
|
26
|
+
import "./runtime-internal-Bu1n9i4P.js";
|
|
27
|
+
import { a as recordTaskRunProgressByRunId, r as createRunningTaskRun } from "./detached-task-runtime-BB5az34R.js";
|
|
28
|
+
import { i as isSessionBindingError, r as getSessionBindingService } from "./session-binding-service-DoeFMDT5.js";
|
|
29
|
+
import { r as countActiveRunsForSession, s as getSubagentRunByChildSessionKey } from "./subagent-registry-DbPekx8d.js";
|
|
30
|
+
import { i as resolveSpawnedWorkspaceInheritance } from "./spawned-context-BVg3Hskm.js";
|
|
31
|
+
import { t as resolveRequesterOriginForChild } from "./spawn-requester-origin-po8VWE1l.js";
|
|
32
|
+
import { r as resolveInboundConversationResolution, t as resolveChannelDefaultBindingPlacement } from "./conversation-resolution-DMOeoktW.js";
|
|
33
|
+
import { n as getAcpSessionManager } from "./manager-CbZ9ncZs.js";
|
|
34
|
+
import { n as readAcpSessionEntry } from "./session-meta-DHOj7FVp.js";
|
|
35
|
+
import { i as resolveThreadBindingThreadName, r as resolveThreadBindingIntroText } from "./thread-bindings-messages-BbXbfHuh.js";
|
|
36
|
+
import { c as resolveThreadBindingMaxAgeMsForChannel, n as formatThreadBindingSpawnDisabledError, o as resolveThreadBindingIdleTimeoutMsForChannel, t as formatThreadBindingDisabledError, u as resolveThreadBindingSpawnPolicy } from "./thread-bindings-policy-D5Cxn_pw.js";
|
|
37
|
+
import { i as resolveAcpAgentPolicyError, r as isAcpEnabledByPolicy } from "./policy-DZsQYBw4.js";
|
|
38
|
+
import { a as resolveAcpThreadSessionDetailLines, n as resolveAcpSessionCwd } from "./session-identifiers-DXuUlIGp.js";
|
|
39
|
+
import path from "node:path";
|
|
40
|
+
import fs, { appendFile, mkdir } from "node:fs/promises";
|
|
41
|
+
import crypto from "node:crypto";
|
|
42
|
+
//#region src/acp/control-plane/spawn.ts
|
|
43
|
+
async function cleanupFailedAcpSpawn(params) {
|
|
44
|
+
if (params.runtimeCloseHandle) await params.runtimeCloseHandle.runtime.close({
|
|
45
|
+
handle: params.runtimeCloseHandle.handle,
|
|
46
|
+
reason: "spawn-failed"
|
|
47
|
+
}).catch((err) => {
|
|
48
|
+
logVerbose(`acp-spawn: runtime cleanup close failed for ${params.sessionKey}: ${String(err)}`);
|
|
49
|
+
});
|
|
50
|
+
await getAcpSessionManager().closeSession({
|
|
51
|
+
cfg: params.cfg,
|
|
52
|
+
sessionKey: params.sessionKey,
|
|
53
|
+
reason: "spawn-failed",
|
|
54
|
+
allowBackendUnavailable: true,
|
|
55
|
+
requireAcpSession: false
|
|
56
|
+
}).catch((err) => {
|
|
57
|
+
logVerbose(`acp-spawn: manager cleanup close failed for ${params.sessionKey}: ${String(err)}`);
|
|
58
|
+
});
|
|
59
|
+
await getSessionBindingService().unbind({
|
|
60
|
+
targetSessionKey: params.sessionKey,
|
|
61
|
+
reason: "spawn-failed"
|
|
62
|
+
}).catch((err) => {
|
|
63
|
+
logVerbose(`acp-spawn: binding cleanup unbind failed for ${params.sessionKey}: ${String(err)}`);
|
|
64
|
+
});
|
|
65
|
+
if (!params.shouldDeleteSession) return;
|
|
66
|
+
await callGateway({
|
|
67
|
+
method: "sessions.delete",
|
|
68
|
+
params: {
|
|
69
|
+
key: params.sessionKey,
|
|
70
|
+
deleteTranscript: params.deleteTranscript,
|
|
71
|
+
emitLifecycleHooks: false
|
|
72
|
+
},
|
|
73
|
+
timeoutMs: 1e4
|
|
74
|
+
}).catch(() => {});
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/agents/acp-spawn-parent-stream.ts
|
|
78
|
+
const DEFAULT_STREAM_FLUSH_MS = 2500;
|
|
79
|
+
const DEFAULT_NO_OUTPUT_NOTICE_MS = 6e4;
|
|
80
|
+
const DEFAULT_NO_OUTPUT_POLL_MS = 15e3;
|
|
81
|
+
const DEFAULT_MAX_RELAY_LIFETIME_MS = 360 * 60 * 1e3;
|
|
82
|
+
const STREAM_BUFFER_MAX_CHARS = 4e3;
|
|
83
|
+
const STREAM_SNIPPET_MAX_CHARS = 220;
|
|
84
|
+
function compactWhitespace(value) {
|
|
85
|
+
return value.replace(/\s+/g, " ").trim();
|
|
86
|
+
}
|
|
87
|
+
function truncate(value, maxChars) {
|
|
88
|
+
if (value.length <= maxChars) return value;
|
|
89
|
+
if (maxChars <= 1) return value.slice(0, maxChars);
|
|
90
|
+
return `${value.slice(0, maxChars - 1)}…`;
|
|
91
|
+
}
|
|
92
|
+
function toFiniteNumber(value) {
|
|
93
|
+
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
94
|
+
}
|
|
95
|
+
function resolveAcpStreamLogPathFromSessionFile(sessionFile, sessionId) {
|
|
96
|
+
const baseDir = path.dirname(path.resolve(sessionFile));
|
|
97
|
+
return path.join(baseDir, `${sessionId}.acp-stream.jsonl`);
|
|
98
|
+
}
|
|
99
|
+
function resolveAcpSpawnStreamLogPath(params) {
|
|
100
|
+
const childSessionKey = normalizeOptionalString(params.childSessionKey);
|
|
101
|
+
if (!childSessionKey) return;
|
|
102
|
+
const storeEntry = readAcpSessionEntry({ sessionKey: childSessionKey });
|
|
103
|
+
const sessionId = normalizeOptionalString(storeEntry?.entry?.sessionId);
|
|
104
|
+
if (!storeEntry || !sessionId) return;
|
|
105
|
+
try {
|
|
106
|
+
return resolveAcpStreamLogPathFromSessionFile(resolveSessionFilePath(sessionId, storeEntry.entry, resolveSessionFilePathOptions({ storePath: storeEntry.storePath })), sessionId);
|
|
107
|
+
} catch {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function startAcpSpawnParentStreamRelay(params) {
|
|
112
|
+
const runId = normalizeOptionalString(params.runId) ?? "";
|
|
113
|
+
const parentSessionKey = normalizeOptionalString(params.parentSessionKey) ?? "";
|
|
114
|
+
if (!runId || !parentSessionKey) return {
|
|
115
|
+
dispose: () => {},
|
|
116
|
+
notifyStarted: () => {}
|
|
117
|
+
};
|
|
118
|
+
const streamFlushMs = typeof params.streamFlushMs === "number" && Number.isFinite(params.streamFlushMs) ? Math.max(0, Math.floor(params.streamFlushMs)) : DEFAULT_STREAM_FLUSH_MS;
|
|
119
|
+
const noOutputNoticeMs = typeof params.noOutputNoticeMs === "number" && Number.isFinite(params.noOutputNoticeMs) ? Math.max(0, Math.floor(params.noOutputNoticeMs)) : DEFAULT_NO_OUTPUT_NOTICE_MS;
|
|
120
|
+
const noOutputPollMs = typeof params.noOutputPollMs === "number" && Number.isFinite(params.noOutputPollMs) ? Math.max(250, Math.floor(params.noOutputPollMs)) : DEFAULT_NO_OUTPUT_POLL_MS;
|
|
121
|
+
const maxRelayLifetimeMs = typeof params.maxRelayLifetimeMs === "number" && Number.isFinite(params.maxRelayLifetimeMs) ? Math.max(1e3, Math.floor(params.maxRelayLifetimeMs)) : DEFAULT_MAX_RELAY_LIFETIME_MS;
|
|
122
|
+
const relayLabel = truncate(compactWhitespace(params.agentId), 40) || "ACP child";
|
|
123
|
+
const contextPrefix = `acp-spawn:${runId}`;
|
|
124
|
+
const logPath = normalizeOptionalString(params.logPath);
|
|
125
|
+
let logDirReady = false;
|
|
126
|
+
let pendingLogLines = "";
|
|
127
|
+
let logFlushScheduled = false;
|
|
128
|
+
let logWriteChain = Promise.resolve();
|
|
129
|
+
const flushLogBuffer = () => {
|
|
130
|
+
if (!logPath || !pendingLogLines) return;
|
|
131
|
+
const chunk = pendingLogLines;
|
|
132
|
+
pendingLogLines = "";
|
|
133
|
+
logWriteChain = logWriteChain.then(async () => {
|
|
134
|
+
if (!logDirReady) {
|
|
135
|
+
await mkdir(path.dirname(logPath), { recursive: true });
|
|
136
|
+
logDirReady = true;
|
|
137
|
+
}
|
|
138
|
+
await appendFile(logPath, chunk, {
|
|
139
|
+
encoding: "utf-8",
|
|
140
|
+
mode: 384
|
|
141
|
+
});
|
|
142
|
+
}).catch(() => {});
|
|
143
|
+
};
|
|
144
|
+
const scheduleLogFlush = () => {
|
|
145
|
+
if (!logPath || logFlushScheduled) return;
|
|
146
|
+
logFlushScheduled = true;
|
|
147
|
+
queueMicrotask(() => {
|
|
148
|
+
logFlushScheduled = false;
|
|
149
|
+
flushLogBuffer();
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
const writeLogLine = (entry) => {
|
|
153
|
+
if (!logPath) return;
|
|
154
|
+
try {
|
|
155
|
+
pendingLogLines += `${JSON.stringify(entry)}\n`;
|
|
156
|
+
if (pendingLogLines.length >= 16384) {
|
|
157
|
+
flushLogBuffer();
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
scheduleLogFlush();
|
|
161
|
+
} catch {}
|
|
162
|
+
};
|
|
163
|
+
const logEvent = (kind, fields) => {
|
|
164
|
+
writeLogLine({
|
|
165
|
+
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
166
|
+
epochMs: Date.now(),
|
|
167
|
+
runId,
|
|
168
|
+
parentSessionKey,
|
|
169
|
+
childSessionKey: params.childSessionKey,
|
|
170
|
+
agentId: params.agentId,
|
|
171
|
+
kind,
|
|
172
|
+
...fields
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
const shouldSurfaceUpdates = params.surfaceUpdates !== false;
|
|
176
|
+
const wake = () => {
|
|
177
|
+
if (!shouldSurfaceUpdates) return;
|
|
178
|
+
requestHeartbeatNow(scopedHeartbeatWakeOptions(parentSessionKey, { reason: "acp:spawn:stream" }));
|
|
179
|
+
};
|
|
180
|
+
const emit = (text, contextKey) => {
|
|
181
|
+
const cleaned = text.trim();
|
|
182
|
+
if (!cleaned) return;
|
|
183
|
+
logEvent("system_event", {
|
|
184
|
+
contextKey,
|
|
185
|
+
text: cleaned
|
|
186
|
+
});
|
|
187
|
+
if (!shouldSurfaceUpdates) return;
|
|
188
|
+
enqueueSystemEvent(cleaned, {
|
|
189
|
+
sessionKey: parentSessionKey,
|
|
190
|
+
contextKey,
|
|
191
|
+
deliveryContext: params.deliveryContext,
|
|
192
|
+
trusted: false
|
|
193
|
+
});
|
|
194
|
+
wake();
|
|
195
|
+
};
|
|
196
|
+
const emitStartNotice = () => {
|
|
197
|
+
recordTaskRunProgressByRunId({
|
|
198
|
+
runId,
|
|
199
|
+
runtime: "acp",
|
|
200
|
+
sessionKey: params.childSessionKey,
|
|
201
|
+
lastEventAt: Date.now(),
|
|
202
|
+
eventSummary: "Started."
|
|
203
|
+
});
|
|
204
|
+
emit(`Started ${relayLabel} session ${params.childSessionKey}. Streaming progress updates to parent session.`, `${contextPrefix}:start`);
|
|
205
|
+
};
|
|
206
|
+
let disposed = false;
|
|
207
|
+
let pendingText = "";
|
|
208
|
+
let lastProgressAt = Date.now();
|
|
209
|
+
let stallNotified = false;
|
|
210
|
+
let flushTimer;
|
|
211
|
+
let relayLifetimeTimer;
|
|
212
|
+
const clearFlushTimer = () => {
|
|
213
|
+
if (!flushTimer) return;
|
|
214
|
+
clearTimeout(flushTimer);
|
|
215
|
+
flushTimer = void 0;
|
|
216
|
+
};
|
|
217
|
+
const clearRelayLifetimeTimer = () => {
|
|
218
|
+
if (!relayLifetimeTimer) return;
|
|
219
|
+
clearTimeout(relayLifetimeTimer);
|
|
220
|
+
relayLifetimeTimer = void 0;
|
|
221
|
+
};
|
|
222
|
+
const flushPending = () => {
|
|
223
|
+
clearFlushTimer();
|
|
224
|
+
if (!pendingText) return;
|
|
225
|
+
const snippet = truncate(compactWhitespace(pendingText), STREAM_SNIPPET_MAX_CHARS);
|
|
226
|
+
pendingText = "";
|
|
227
|
+
if (!snippet) return;
|
|
228
|
+
emit(`${relayLabel}: ${snippet}`, `${contextPrefix}:progress`);
|
|
229
|
+
};
|
|
230
|
+
const scheduleFlush = () => {
|
|
231
|
+
if (disposed || flushTimer || streamFlushMs <= 0) return;
|
|
232
|
+
flushTimer = setTimeout(() => {
|
|
233
|
+
flushPending();
|
|
234
|
+
}, streamFlushMs);
|
|
235
|
+
flushTimer.unref?.();
|
|
236
|
+
};
|
|
237
|
+
const noOutputWatcherTimer = setInterval(() => {
|
|
238
|
+
if (disposed || noOutputNoticeMs <= 0) return;
|
|
239
|
+
if (stallNotified) return;
|
|
240
|
+
if (Date.now() - lastProgressAt < noOutputNoticeMs) return;
|
|
241
|
+
stallNotified = true;
|
|
242
|
+
recordTaskRunProgressByRunId({
|
|
243
|
+
runId,
|
|
244
|
+
runtime: "acp",
|
|
245
|
+
sessionKey: params.childSessionKey,
|
|
246
|
+
lastEventAt: Date.now(),
|
|
247
|
+
eventSummary: `No output for ${Math.round(noOutputNoticeMs / 1e3)}s. It may be waiting for input.`
|
|
248
|
+
});
|
|
249
|
+
emit(`${relayLabel} has produced no output for ${Math.round(noOutputNoticeMs / 1e3)}s. It may be waiting for interactive input.`, `${contextPrefix}:stall`);
|
|
250
|
+
}, noOutputPollMs);
|
|
251
|
+
noOutputWatcherTimer.unref?.();
|
|
252
|
+
relayLifetimeTimer = setTimeout(() => {
|
|
253
|
+
if (disposed) return;
|
|
254
|
+
emit(`${relayLabel} stream relay timed out after ${Math.max(1, Math.round(maxRelayLifetimeMs / 1e3))}s without completion.`, `${contextPrefix}:timeout`);
|
|
255
|
+
dispose();
|
|
256
|
+
}, maxRelayLifetimeMs);
|
|
257
|
+
relayLifetimeTimer.unref?.();
|
|
258
|
+
if (params.emitStartNotice !== false) emitStartNotice();
|
|
259
|
+
const unsubscribe = onAgentEvent((event) => {
|
|
260
|
+
if (disposed || event.runId !== runId) return;
|
|
261
|
+
if (event.stream === "assistant") {
|
|
262
|
+
const data = event.data;
|
|
263
|
+
const assistantPhase = normalizeAssistantPhase(data?.phase);
|
|
264
|
+
const deltaCandidate = data?.delta ?? data?.text;
|
|
265
|
+
const delta = typeof deltaCandidate === "string" ? deltaCandidate : void 0;
|
|
266
|
+
if (!delta || !delta.trim()) return;
|
|
267
|
+
logEvent("assistant_delta", {
|
|
268
|
+
delta,
|
|
269
|
+
...assistantPhase ? { phase: assistantPhase } : {}
|
|
270
|
+
});
|
|
271
|
+
if (assistantPhase === "commentary") {
|
|
272
|
+
lastProgressAt = Date.now();
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
if (stallNotified) {
|
|
276
|
+
stallNotified = false;
|
|
277
|
+
recordTaskRunProgressByRunId({
|
|
278
|
+
runId,
|
|
279
|
+
runtime: "acp",
|
|
280
|
+
sessionKey: params.childSessionKey,
|
|
281
|
+
lastEventAt: Date.now(),
|
|
282
|
+
eventSummary: "Resumed output."
|
|
283
|
+
});
|
|
284
|
+
emit(`${relayLabel} resumed output.`, `${contextPrefix}:resumed`);
|
|
285
|
+
}
|
|
286
|
+
lastProgressAt = Date.now();
|
|
287
|
+
pendingText += delta;
|
|
288
|
+
if (pendingText.length > STREAM_BUFFER_MAX_CHARS) pendingText = pendingText.slice(-STREAM_BUFFER_MAX_CHARS);
|
|
289
|
+
if (pendingText.length >= STREAM_SNIPPET_MAX_CHARS || delta.includes("\n\n")) {
|
|
290
|
+
flushPending();
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
scheduleFlush();
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
if (event.stream !== "lifecycle") return;
|
|
297
|
+
const phase = normalizeOptionalString(event.data?.phase);
|
|
298
|
+
logEvent("lifecycle", {
|
|
299
|
+
phase: phase ?? "unknown",
|
|
300
|
+
data: event.data
|
|
301
|
+
});
|
|
302
|
+
if (phase === "end") {
|
|
303
|
+
flushPending();
|
|
304
|
+
const startedAt = toFiniteNumber(event.data?.startedAt);
|
|
305
|
+
const endedAt = toFiniteNumber(event.data?.endedAt);
|
|
306
|
+
const durationMs = startedAt != null && endedAt != null && endedAt >= startedAt ? endedAt - startedAt : void 0;
|
|
307
|
+
if (durationMs != null) emit(`${relayLabel} run completed in ${Math.max(1, Math.round(durationMs / 1e3))}s.`, `${contextPrefix}:done`);
|
|
308
|
+
else emit(`${relayLabel} run completed.`, `${contextPrefix}:done`);
|
|
309
|
+
dispose();
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
if (phase === "error") {
|
|
313
|
+
flushPending();
|
|
314
|
+
const errorText = normalizeOptionalString(event.data?.error);
|
|
315
|
+
if (errorText) emit(`${relayLabel} run failed: ${errorText}`, `${contextPrefix}:error`);
|
|
316
|
+
else emit(`${relayLabel} run failed.`, `${contextPrefix}:error`);
|
|
317
|
+
dispose();
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
const dispose = () => {
|
|
321
|
+
if (disposed) return;
|
|
322
|
+
disposed = true;
|
|
323
|
+
clearFlushTimer();
|
|
324
|
+
clearRelayLifetimeTimer();
|
|
325
|
+
flushLogBuffer();
|
|
326
|
+
clearInterval(noOutputWatcherTimer);
|
|
327
|
+
unsubscribe();
|
|
328
|
+
};
|
|
329
|
+
return {
|
|
330
|
+
dispose,
|
|
331
|
+
notifyStarted: emitStartNotice
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/agents/acp-spawn.ts
|
|
336
|
+
const log = createSubsystemLogger("agents/acp-spawn");
|
|
337
|
+
const ACP_SPAWN_MODES = ["run", "session"];
|
|
338
|
+
const ACP_SPAWN_SANDBOX_MODES = ["inherit", "require"];
|
|
339
|
+
const ACP_SPAWN_STREAM_TARGETS = ["parent"];
|
|
340
|
+
const ACP_SPAWN_ERROR_CODES = [
|
|
341
|
+
"acp_disabled",
|
|
342
|
+
"requester_session_required",
|
|
343
|
+
"runtime_policy",
|
|
344
|
+
"subagent_policy",
|
|
345
|
+
"thread_required",
|
|
346
|
+
"target_agent_required",
|
|
347
|
+
"agent_forbidden",
|
|
348
|
+
"cwd_resolution_failed",
|
|
349
|
+
"thread_binding_invalid",
|
|
350
|
+
"spawn_failed",
|
|
351
|
+
"dispatch_failed"
|
|
352
|
+
];
|
|
353
|
+
function isSpawnAcpAcceptedResult(result) {
|
|
354
|
+
return result.status === "accepted";
|
|
355
|
+
}
|
|
356
|
+
const ACP_SPAWN_ACCEPTED_NOTE = "initial ACP task queued in isolated session; follow-ups continue in the bound thread.";
|
|
357
|
+
const ACP_SPAWN_SESSION_ACCEPTED_NOTE = "thread-bound ACP session stays active after this task; continue in-thread for follow-ups.";
|
|
358
|
+
function resolveAcpSpawnRuntimePolicyError(params) {
|
|
359
|
+
const sandboxMode = params.sandbox === "require" ? "require" : "inherit";
|
|
360
|
+
const requesterRuntime = resolveSandboxRuntimeStatus({
|
|
361
|
+
cfg: params.cfg,
|
|
362
|
+
sessionKey: params.requesterSessionKey
|
|
363
|
+
});
|
|
364
|
+
if (params.requesterSandboxed === true || requesterRuntime.sandboxed) return "Sandboxed sessions cannot spawn ACP sessions because runtime=\"acp\" runs on the host. Use runtime=\"subagent\" from sandboxed sessions.";
|
|
365
|
+
if (sandboxMode === "require") return "sessions_spawn sandbox=\"require\" is unsupported for runtime=\"acp\" because ACP sessions run outside the sandbox. Use runtime=\"subagent\" or sandbox=\"inherit\".";
|
|
366
|
+
}
|
|
367
|
+
function isActiveTaskStatus(status) {
|
|
368
|
+
return status === "queued" || status === "running";
|
|
369
|
+
}
|
|
370
|
+
function countUntrackedActiveAcpRunsForOwner(ownerKey) {
|
|
371
|
+
const normalizedOwnerKey = normalizeOptionalString(ownerKey);
|
|
372
|
+
if (!normalizedOwnerKey) return 0;
|
|
373
|
+
const tasks = listTasksForOwnerKey(normalizedOwnerKey);
|
|
374
|
+
const trackedChildSessionKeys = new Set(tasks.filter((task) => task.runtime === "subagent" && isActiveTaskStatus(task.status) && normalizeOptionalString(task.childSessionKey)).map((task) => normalizeOptionalString(task.childSessionKey)));
|
|
375
|
+
return new Set(tasks.flatMap((task) => {
|
|
376
|
+
const childSessionKey = normalizeOptionalString(task.childSessionKey);
|
|
377
|
+
const trackedRun = childSessionKey ? getSubagentRunByChildSessionKey(childSessionKey) : null;
|
|
378
|
+
const hasActiveRegistryRun = Boolean(trackedRun && typeof trackedRun.endedAt !== "number");
|
|
379
|
+
return task.runtime === "acp" && isActiveTaskStatus(task.status) && childSessionKey !== void 0 && !hasActiveRegistryRun && !trackedChildSessionKeys.has(childSessionKey) ? [childSessionKey] : [];
|
|
380
|
+
})).size;
|
|
381
|
+
}
|
|
382
|
+
function resolvePlacementWithoutChannelPlugin(params) {
|
|
383
|
+
return params.capabilities.placements.includes("child") ? "child" : "current";
|
|
384
|
+
}
|
|
385
|
+
function resolveSpawnMode(params) {
|
|
386
|
+
if (params.requestedMode === "run" || params.requestedMode === "session") return params.requestedMode;
|
|
387
|
+
return params.threadRequested ? "session" : "run";
|
|
388
|
+
}
|
|
389
|
+
function resolveAcpSessionMode(mode) {
|
|
390
|
+
return mode === "session" ? "persistent" : "oneshot";
|
|
391
|
+
}
|
|
392
|
+
function isHeartbeatEnabledForSessionAgent(params) {
|
|
393
|
+
if (!areHeartbeatsEnabled()) return false;
|
|
394
|
+
const requesterAgentId = parseAgentSessionKey(params.sessionKey)?.agentId;
|
|
395
|
+
if (!requesterAgentId) return true;
|
|
396
|
+
const agentEntries = params.cfg.agents?.list ?? [];
|
|
397
|
+
if (!(agentEntries.some((entry) => Boolean(entry?.heartbeat)) ? agentEntries.some((entry) => Boolean(entry?.heartbeat) && normalizeAgentId(entry?.id) === requesterAgentId) : requesterAgentId === resolveDefaultAgentId(params.cfg))) return false;
|
|
398
|
+
const trimmedEvery = normalizeOptionalString(resolveAgentConfig(params.cfg, requesterAgentId)?.heartbeat?.every ?? params.cfg.agents?.defaults?.heartbeat?.every ?? "30m") ?? "";
|
|
399
|
+
if (!trimmedEvery) return false;
|
|
400
|
+
try {
|
|
401
|
+
return parseDurationMs(trimmedEvery, { defaultUnit: "m" }) > 0;
|
|
402
|
+
} catch {
|
|
403
|
+
return false;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
function resolveHeartbeatConfigForAgent(params) {
|
|
407
|
+
const defaults = params.cfg.agents?.defaults?.heartbeat;
|
|
408
|
+
const overrides = resolveAgentConfig(params.cfg, params.agentId)?.heartbeat;
|
|
409
|
+
if (!defaults && !overrides) return;
|
|
410
|
+
return {
|
|
411
|
+
...defaults,
|
|
412
|
+
...overrides
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
function hasSessionLocalHeartbeatRelayRoute(params) {
|
|
416
|
+
if ((params.cfg.session?.scope ?? "per-sender") === "global") return false;
|
|
417
|
+
const heartbeat = resolveHeartbeatConfigForAgent({
|
|
418
|
+
cfg: params.cfg,
|
|
419
|
+
agentId: params.requesterAgentId
|
|
420
|
+
});
|
|
421
|
+
if ((heartbeat?.target ?? "none") !== "last") return false;
|
|
422
|
+
if (normalizeOptionalString(heartbeat?.to)) return false;
|
|
423
|
+
if (normalizeOptionalString(heartbeat?.accountId)) return false;
|
|
424
|
+
const parentEntry = loadSessionStore(resolveStorePath(params.cfg.session?.store, { agentId: params.requesterAgentId }))[params.parentSessionKey];
|
|
425
|
+
const parentDeliveryContext = deliveryContextFromSession(parentEntry);
|
|
426
|
+
return Boolean(parentDeliveryContext?.channel && parentDeliveryContext.to);
|
|
427
|
+
}
|
|
428
|
+
function resolveTargetAcpAgentId(params) {
|
|
429
|
+
const requested = normalizeOptionalAgentId(params.requestedAgentId);
|
|
430
|
+
if (requested) return {
|
|
431
|
+
ok: true,
|
|
432
|
+
agentId: requested
|
|
433
|
+
};
|
|
434
|
+
const configuredDefault = normalizeOptionalAgentId(params.cfg.acp?.defaultAgent);
|
|
435
|
+
if (configuredDefault) return {
|
|
436
|
+
ok: true,
|
|
437
|
+
agentId: configuredDefault
|
|
438
|
+
};
|
|
439
|
+
return {
|
|
440
|
+
ok: false,
|
|
441
|
+
error: "ACP target agent is not configured. Pass `agentId` in `sessions_spawn` or set `acp.defaultAgent` in config."
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
function normalizeOptionalAgentId(value) {
|
|
445
|
+
const trimmed = normalizeOptionalString(value) ?? "";
|
|
446
|
+
if (!trimmed) return;
|
|
447
|
+
return normalizeAgentId(trimmed);
|
|
448
|
+
}
|
|
449
|
+
function summarizeError(err) {
|
|
450
|
+
if (err instanceof Error) return err.message;
|
|
451
|
+
if (typeof err === "string") return err;
|
|
452
|
+
return "error";
|
|
453
|
+
}
|
|
454
|
+
function createAcpSpawnFailure(params) {
|
|
455
|
+
return {
|
|
456
|
+
status: params.status,
|
|
457
|
+
errorCode: params.errorCode,
|
|
458
|
+
error: params.error,
|
|
459
|
+
...params.childSessionKey ? { childSessionKey: params.childSessionKey } : {}
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
function isMissingPathError(error) {
|
|
463
|
+
const code = error instanceof Error ? error.code : void 0;
|
|
464
|
+
return code === "ENOENT" || code === "ENOTDIR";
|
|
465
|
+
}
|
|
466
|
+
async function resolveRuntimeCwdForAcpSpawn(params) {
|
|
467
|
+
if (!params.resolvedCwd) return;
|
|
468
|
+
if (normalizeOptionalString(params.explicitCwd)) return params.resolvedCwd;
|
|
469
|
+
try {
|
|
470
|
+
await fs.access(params.resolvedCwd);
|
|
471
|
+
return params.resolvedCwd;
|
|
472
|
+
} catch (error) {
|
|
473
|
+
if (isMissingPathError(error)) return;
|
|
474
|
+
throw error;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
function resolveRequesterInternalSessionKey(params) {
|
|
478
|
+
const { mainKey, alias } = resolveMainSessionAlias(params.cfg);
|
|
479
|
+
const requesterSessionKey = normalizeOptionalString(params.requesterSessionKey);
|
|
480
|
+
return requesterSessionKey ? resolveInternalSessionKey({
|
|
481
|
+
key: requesterSessionKey,
|
|
482
|
+
alias,
|
|
483
|
+
mainKey
|
|
484
|
+
}) : alias;
|
|
485
|
+
}
|
|
486
|
+
async function persistAcpSpawnSessionFileBestEffort(params) {
|
|
487
|
+
try {
|
|
488
|
+
return (await resolveSessionTranscriptFile({
|
|
489
|
+
sessionId: params.sessionId,
|
|
490
|
+
sessionKey: params.sessionKey,
|
|
491
|
+
sessionEntry: params.sessionEntry,
|
|
492
|
+
sessionStore: params.sessionStore,
|
|
493
|
+
storePath: params.storePath,
|
|
494
|
+
agentId: params.agentId,
|
|
495
|
+
threadId: params.threadId
|
|
496
|
+
})).sessionEntry;
|
|
497
|
+
} catch (error) {
|
|
498
|
+
log.warn(`ACP session-file persistence failed during ${params.stage} for ${params.sessionKey}: ${summarizeError(error)}`);
|
|
499
|
+
return params.sessionEntry;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
function resolveConversationRefForThreadBinding(params) {
|
|
503
|
+
return resolveInboundConversationResolution({
|
|
504
|
+
cfg: params.cfg,
|
|
505
|
+
channel: params.channel,
|
|
506
|
+
accountId: params.accountId,
|
|
507
|
+
to: params.to,
|
|
508
|
+
threadId: params.threadId,
|
|
509
|
+
groupId: params.groupId,
|
|
510
|
+
isGroup: true
|
|
511
|
+
})?.canonical ?? null;
|
|
512
|
+
}
|
|
513
|
+
function resolveAcpSpawnChannelAccountId(params) {
|
|
514
|
+
const channel = normalizeOptionalLowercaseString(params.channel);
|
|
515
|
+
const explicitAccountId = normalizeOptionalString(params.accountId);
|
|
516
|
+
if (explicitAccountId) return explicitAccountId;
|
|
517
|
+
if (!channel) return;
|
|
518
|
+
const configuredDefaultAccountId = params.cfg.channels?.[channel]?.defaultAccount;
|
|
519
|
+
return normalizeOptionalString(configuredDefaultAccountId) ?? "default";
|
|
520
|
+
}
|
|
521
|
+
function prepareAcpThreadBinding(params) {
|
|
522
|
+
const channel = normalizeOptionalLowercaseString(params.channel);
|
|
523
|
+
if (!channel) return {
|
|
524
|
+
ok: false,
|
|
525
|
+
error: "thread=true for ACP sessions requires a channel context."
|
|
526
|
+
};
|
|
527
|
+
const accountId = resolveAcpSpawnChannelAccountId({
|
|
528
|
+
cfg: params.cfg,
|
|
529
|
+
channel,
|
|
530
|
+
accountId: params.accountId
|
|
531
|
+
});
|
|
532
|
+
const policy = resolveThreadBindingSpawnPolicy({
|
|
533
|
+
cfg: params.cfg,
|
|
534
|
+
channel,
|
|
535
|
+
accountId,
|
|
536
|
+
kind: "acp"
|
|
537
|
+
});
|
|
538
|
+
if (!policy.enabled) return {
|
|
539
|
+
ok: false,
|
|
540
|
+
error: formatThreadBindingDisabledError({
|
|
541
|
+
channel: policy.channel,
|
|
542
|
+
accountId: policy.accountId,
|
|
543
|
+
kind: "acp"
|
|
544
|
+
})
|
|
545
|
+
};
|
|
546
|
+
if (!policy.spawnEnabled) return {
|
|
547
|
+
ok: false,
|
|
548
|
+
error: formatThreadBindingSpawnDisabledError({
|
|
549
|
+
channel: policy.channel,
|
|
550
|
+
accountId: policy.accountId,
|
|
551
|
+
kind: "acp"
|
|
552
|
+
})
|
|
553
|
+
};
|
|
554
|
+
const capabilities = getSessionBindingService().getCapabilities({
|
|
555
|
+
channel: policy.channel,
|
|
556
|
+
accountId: policy.accountId
|
|
557
|
+
});
|
|
558
|
+
if (!capabilities.adapterAvailable) return {
|
|
559
|
+
ok: false,
|
|
560
|
+
error: `Thread bindings are unavailable for ${policy.channel}.`
|
|
561
|
+
};
|
|
562
|
+
const placementToUse = resolveChannelDefaultBindingPlacement(policy.channel) ?? resolvePlacementWithoutChannelPlugin({ capabilities });
|
|
563
|
+
if (!capabilities.bindSupported || !capabilities.placements.includes(placementToUse)) return {
|
|
564
|
+
ok: false,
|
|
565
|
+
error: `Thread bindings do not support ${placementToUse} placement for ${policy.channel}.`
|
|
566
|
+
};
|
|
567
|
+
const conversationRef = resolveConversationRefForThreadBinding({
|
|
568
|
+
cfg: params.cfg,
|
|
569
|
+
channel: policy.channel,
|
|
570
|
+
accountId: policy.accountId,
|
|
571
|
+
to: params.to,
|
|
572
|
+
threadId: params.threadId,
|
|
573
|
+
groupId: params.groupId
|
|
574
|
+
});
|
|
575
|
+
if (!conversationRef?.conversationId) return {
|
|
576
|
+
ok: false,
|
|
577
|
+
error: `Could not resolve a ${policy.channel} conversation for ACP thread spawn.`
|
|
578
|
+
};
|
|
579
|
+
return {
|
|
580
|
+
ok: true,
|
|
581
|
+
binding: {
|
|
582
|
+
channel: policy.channel,
|
|
583
|
+
accountId: policy.accountId,
|
|
584
|
+
placement: placementToUse,
|
|
585
|
+
conversationId: conversationRef.conversationId,
|
|
586
|
+
...conversationRef.parentConversationId ? { parentConversationId: conversationRef.parentConversationId } : {}
|
|
587
|
+
}
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
function resolveAcpSpawnRequesterState(params) {
|
|
591
|
+
const bindingService = getSessionBindingService();
|
|
592
|
+
const requesterParsedSession = parseAgentSessionKey(params.parentSessionKey);
|
|
593
|
+
const isSubagentSession = Boolean(requesterParsedSession) && isSubagentSessionKey(params.parentSessionKey);
|
|
594
|
+
const hasActiveSubagentBinding = isSubagentSession && params.parentSessionKey ? bindingService.listBySession(params.parentSessionKey).some((record) => record.targetKind === "subagent" && record.status !== "ended") : false;
|
|
595
|
+
const hasThreadContext = typeof params.ctx.agentThreadId === "string" ? Boolean(normalizeOptionalString(params.ctx.agentThreadId)) : params.ctx.agentThreadId != null;
|
|
596
|
+
const requesterAgentId = requesterParsedSession?.agentId;
|
|
597
|
+
return {
|
|
598
|
+
parentSessionKey: params.parentSessionKey,
|
|
599
|
+
isSubagentSession,
|
|
600
|
+
hasActiveSubagentBinding,
|
|
601
|
+
hasThreadContext,
|
|
602
|
+
heartbeatEnabled: isHeartbeatEnabledForSessionAgent({
|
|
603
|
+
cfg: params.cfg,
|
|
604
|
+
sessionKey: params.parentSessionKey
|
|
605
|
+
}),
|
|
606
|
+
heartbeatRelayRouteUsable: params.parentSessionKey && requesterAgentId ? hasSessionLocalHeartbeatRelayRoute({
|
|
607
|
+
cfg: params.cfg,
|
|
608
|
+
parentSessionKey: params.parentSessionKey,
|
|
609
|
+
requesterAgentId
|
|
610
|
+
}) : false,
|
|
611
|
+
origin: resolveRequesterOriginForChild({
|
|
612
|
+
cfg: params.cfg,
|
|
613
|
+
targetAgentId: params.targetAgentId,
|
|
614
|
+
requesterAgentId: normalizeAgentId(requesterAgentId),
|
|
615
|
+
requesterChannel: params.ctx.agentChannel,
|
|
616
|
+
requesterAccountId: params.ctx.agentAccountId,
|
|
617
|
+
requesterTo: params.ctx.agentTo,
|
|
618
|
+
requesterThreadId: params.ctx.agentThreadId,
|
|
619
|
+
requesterGroupSpace: params.ctx.agentGroupSpace,
|
|
620
|
+
requesterMemberRoleIds: params.ctx.agentMemberRoleIds
|
|
621
|
+
})
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
function resolveAcpSubagentEnvelopeState(params) {
|
|
625
|
+
const requesterSessionKey = normalizeOptionalString(params.requesterSessionKey);
|
|
626
|
+
if (!requesterSessionKey) return {};
|
|
627
|
+
if (!isSubagentEnvelopeSession(requesterSessionKey, {
|
|
628
|
+
cfg: params.cfg,
|
|
629
|
+
store: params.subagentStore
|
|
630
|
+
})) return {};
|
|
631
|
+
const callerDepth = getSubagentDepthFromSessionStore(requesterSessionKey, { cfg: params.cfg });
|
|
632
|
+
const maxSpawnDepth = params.cfg.agents?.defaults?.subagents?.maxSpawnDepth ?? 1;
|
|
633
|
+
if (callerDepth >= maxSpawnDepth) return { error: `sessions_spawn is not allowed at this depth (current depth: ${callerDepth}, max: ${maxSpawnDepth})` };
|
|
634
|
+
const maxChildren = params.cfg.agents?.defaults?.subagents?.maxChildrenPerAgent ?? 5;
|
|
635
|
+
const activeChildren = countActiveRunsForSession(requesterSessionKey) + countUntrackedActiveAcpRunsForOwner(requesterSessionKey);
|
|
636
|
+
if (activeChildren >= maxChildren) return { error: `sessions_spawn has reached max active children for this session (${activeChildren}/${maxChildren})` };
|
|
637
|
+
const requesterAgentId = normalizeAgentId(parseAgentSessionKey(requesterSessionKey)?.agentId);
|
|
638
|
+
if ((resolveAgentConfig(params.cfg, requesterAgentId)?.subagents?.requireAgentId ?? params.cfg.agents?.defaults?.subagents?.requireAgentId ?? false) && !params.requestedAgentId?.trim()) return { error: "sessions_spawn requires explicit agentId when requireAgentId is configured. Use agents_list to see allowed agent ids." };
|
|
639
|
+
if (params.targetAgentId !== requesterAgentId) {
|
|
640
|
+
const allowAgents = resolveAgentConfig(params.cfg, requesterAgentId)?.subagents?.allowAgents ?? params.cfg.agents?.defaults?.subagents?.allowAgents ?? [];
|
|
641
|
+
const allowAny = allowAgents.some((value) => value.trim() === "*");
|
|
642
|
+
const normalizedTargetId = normalizeOptionalLowercaseString(params.targetAgentId) ?? "";
|
|
643
|
+
const allowSet = new Set(allowAgents.filter((value) => value.trim() && value.trim() !== "*").map((value) => normalizeOptionalLowercaseString(normalizeAgentId(value)) ?? ""));
|
|
644
|
+
if (!allowAny && !allowSet.has(normalizedTargetId)) return { error: `agentId is not allowed for sessions_spawn (allowed: ${allowSet.size > 0 ? Array.from(allowSet).join(", ") : "none"})` };
|
|
645
|
+
}
|
|
646
|
+
const childCapabilities = resolveSubagentCapabilities({
|
|
647
|
+
depth: callerDepth + 1,
|
|
648
|
+
maxSpawnDepth
|
|
649
|
+
});
|
|
650
|
+
return { childSessionPatch: {
|
|
651
|
+
spawnDepth: childCapabilities.depth,
|
|
652
|
+
subagentRole: childCapabilities.role === "main" ? null : childCapabilities.role,
|
|
653
|
+
subagentControlScope: childCapabilities.controlScope
|
|
654
|
+
} };
|
|
655
|
+
}
|
|
656
|
+
function resolveAcpSpawnStreamPlan(params) {
|
|
657
|
+
const implicitStreamToParent = !params.streamToParentRequested && params.spawnMode === "run" && !params.requestThreadBinding && params.requester.isSubagentSession && !params.requester.hasActiveSubagentBinding && !params.requester.hasThreadContext && params.requester.heartbeatEnabled && params.requester.heartbeatRelayRouteUsable;
|
|
658
|
+
return {
|
|
659
|
+
implicitStreamToParent,
|
|
660
|
+
effectiveStreamToParent: params.streamToParentRequested || implicitStreamToParent
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
async function initializeAcpSpawnRuntime(params) {
|
|
664
|
+
const storePath = resolveStorePath(params.cfg.session?.store, { agentId: params.targetAgentId });
|
|
665
|
+
const sessionStore = loadSessionStore(storePath);
|
|
666
|
+
let sessionEntry = sessionStore[params.sessionKey];
|
|
667
|
+
const sessionId = sessionEntry?.sessionId;
|
|
668
|
+
if (sessionId) sessionEntry = await persistAcpSpawnSessionFileBestEffort({
|
|
669
|
+
sessionId,
|
|
670
|
+
sessionKey: params.sessionKey,
|
|
671
|
+
sessionStore,
|
|
672
|
+
storePath,
|
|
673
|
+
sessionEntry,
|
|
674
|
+
agentId: params.targetAgentId,
|
|
675
|
+
stage: "spawn"
|
|
676
|
+
});
|
|
677
|
+
const initialized = await getAcpSessionManager().initializeSession({
|
|
678
|
+
cfg: params.cfg,
|
|
679
|
+
sessionKey: params.sessionKey,
|
|
680
|
+
agent: params.targetAgentId,
|
|
681
|
+
mode: params.runtimeMode,
|
|
682
|
+
resumeSessionId: params.resumeSessionId,
|
|
683
|
+
runtimeOptions: params.model ? { model: params.model } : void 0,
|
|
684
|
+
cwd: params.cwd,
|
|
685
|
+
backendId: params.cfg.acp?.backend
|
|
686
|
+
});
|
|
687
|
+
return {
|
|
688
|
+
initialized,
|
|
689
|
+
runtimeCloseHandle: {
|
|
690
|
+
runtime: initialized.runtime,
|
|
691
|
+
handle: initialized.handle
|
|
692
|
+
},
|
|
693
|
+
sessionId,
|
|
694
|
+
sessionEntry,
|
|
695
|
+
sessionStore,
|
|
696
|
+
storePath
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
async function bindPreparedAcpThread(params) {
|
|
700
|
+
const binding = await getSessionBindingService().bind({
|
|
701
|
+
targetSessionKey: params.sessionKey,
|
|
702
|
+
targetKind: "session",
|
|
703
|
+
conversation: {
|
|
704
|
+
channel: params.preparedBinding.channel,
|
|
705
|
+
accountId: params.preparedBinding.accountId,
|
|
706
|
+
conversationId: params.preparedBinding.conversationId,
|
|
707
|
+
...params.preparedBinding.parentConversationId ? { parentConversationId: params.preparedBinding.parentConversationId } : {}
|
|
708
|
+
},
|
|
709
|
+
placement: params.preparedBinding.placement,
|
|
710
|
+
metadata: {
|
|
711
|
+
threadName: resolveThreadBindingThreadName({
|
|
712
|
+
agentId: params.targetAgentId,
|
|
713
|
+
label: params.label || params.targetAgentId
|
|
714
|
+
}),
|
|
715
|
+
agentId: params.targetAgentId,
|
|
716
|
+
label: params.label || void 0,
|
|
717
|
+
boundBy: "system",
|
|
718
|
+
introText: resolveThreadBindingIntroText({
|
|
719
|
+
agentId: params.targetAgentId,
|
|
720
|
+
label: params.label || void 0,
|
|
721
|
+
idleTimeoutMs: resolveThreadBindingIdleTimeoutMsForChannel({
|
|
722
|
+
cfg: params.cfg,
|
|
723
|
+
channel: params.preparedBinding.channel,
|
|
724
|
+
accountId: params.preparedBinding.accountId
|
|
725
|
+
}),
|
|
726
|
+
maxAgeMs: resolveThreadBindingMaxAgeMsForChannel({
|
|
727
|
+
cfg: params.cfg,
|
|
728
|
+
channel: params.preparedBinding.channel,
|
|
729
|
+
accountId: params.preparedBinding.accountId
|
|
730
|
+
}),
|
|
731
|
+
sessionCwd: resolveAcpSessionCwd(params.initializedRuntime.initialized.meta),
|
|
732
|
+
sessionDetails: resolveAcpThreadSessionDetailLines({
|
|
733
|
+
sessionKey: params.sessionKey,
|
|
734
|
+
meta: params.initializedRuntime.initialized.meta
|
|
735
|
+
})
|
|
736
|
+
})
|
|
737
|
+
}
|
|
738
|
+
});
|
|
739
|
+
if (!binding.conversation.conversationId) throw new Error(params.preparedBinding.placement === "child" ? `Failed to create and bind a ${params.preparedBinding.channel} thread for this ACP session.` : `Failed to bind the current ${params.preparedBinding.channel} conversation for this ACP session.`);
|
|
740
|
+
let sessionEntry = params.initializedRuntime.sessionEntry;
|
|
741
|
+
if (params.initializedRuntime.sessionId && params.preparedBinding.placement === "child") {
|
|
742
|
+
const boundThreadId = normalizeOptionalString(binding.conversation.conversationId);
|
|
743
|
+
if (boundThreadId) sessionEntry = await persistAcpSpawnSessionFileBestEffort({
|
|
744
|
+
sessionId: params.initializedRuntime.sessionId,
|
|
745
|
+
sessionKey: params.sessionKey,
|
|
746
|
+
sessionStore: params.initializedRuntime.sessionStore,
|
|
747
|
+
storePath: params.initializedRuntime.storePath,
|
|
748
|
+
sessionEntry,
|
|
749
|
+
agentId: params.targetAgentId,
|
|
750
|
+
threadId: boundThreadId,
|
|
751
|
+
stage: "thread-bind"
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
return {
|
|
755
|
+
binding,
|
|
756
|
+
sessionEntry
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
function resolveAcpSpawnBootstrapDeliveryPlan(params) {
|
|
760
|
+
const boundThreadIdRaw = params.binding?.conversation.conversationId;
|
|
761
|
+
const boundThreadId = boundThreadIdRaw ? normalizeOptionalString(boundThreadIdRaw) : void 0;
|
|
762
|
+
const fallbackThreadIdRaw = params.requester.origin?.threadId;
|
|
763
|
+
const fallbackThreadId = fallbackThreadIdRaw != null ? normalizeOptionalString(String(fallbackThreadIdRaw)) : void 0;
|
|
764
|
+
const deliveryThreadId = boundThreadId ?? fallbackThreadId;
|
|
765
|
+
const requesterConversationRef = resolveConversationRefForThreadBinding({
|
|
766
|
+
cfg: params.cfg,
|
|
767
|
+
channel: params.requester.origin?.channel,
|
|
768
|
+
accountId: params.requester.origin?.accountId,
|
|
769
|
+
threadId: fallbackThreadId,
|
|
770
|
+
to: params.requester.origin?.to
|
|
771
|
+
});
|
|
772
|
+
const requesterAccountId = resolveAcpSpawnChannelAccountId({
|
|
773
|
+
cfg: params.cfg,
|
|
774
|
+
channel: params.requester.origin?.channel,
|
|
775
|
+
accountId: params.requester.origin?.accountId
|
|
776
|
+
});
|
|
777
|
+
const bindingMatchesRequesterConversation = Boolean(params.requester.origin?.channel && params.binding?.conversation.channel === params.requester.origin.channel && params.binding?.conversation.accountId === requesterAccountId && requesterConversationRef?.conversationId && params.binding?.conversation.conversationId === requesterConversationRef.conversationId && (params.binding?.conversation.parentConversationId ?? void 0) === (requesterConversationRef.parentConversationId ?? void 0));
|
|
778
|
+
const boundDeliveryTarget = resolveConversationDeliveryTarget({
|
|
779
|
+
channel: params.requester.origin?.channel ?? params.binding?.conversation.channel,
|
|
780
|
+
conversationId: params.binding?.conversation.conversationId,
|
|
781
|
+
parentConversationId: params.binding?.conversation.parentConversationId
|
|
782
|
+
});
|
|
783
|
+
const inferredDeliveryTo = (bindingMatchesRequesterConversation ? normalizeOptionalString(params.requester.origin?.to) : void 0) ?? boundDeliveryTarget.to ?? normalizeOptionalString(params.requester.origin?.to) ?? formatConversationTarget({
|
|
784
|
+
channel: params.requester.origin?.channel,
|
|
785
|
+
conversationId: deliveryThreadId
|
|
786
|
+
});
|
|
787
|
+
const resolvedDeliveryThreadId = bindingMatchesRequesterConversation ? fallbackThreadId : boundDeliveryTarget.threadId ?? deliveryThreadId;
|
|
788
|
+
const useInlineDelivery = Boolean(params.requester.origin?.channel && inferredDeliveryTo) && !params.effectiveStreamToParent && params.spawnMode === "session";
|
|
789
|
+
return {
|
|
790
|
+
useInlineDelivery,
|
|
791
|
+
channel: useInlineDelivery ? params.requester.origin?.channel : void 0,
|
|
792
|
+
accountId: useInlineDelivery ? requesterAccountId : void 0,
|
|
793
|
+
to: useInlineDelivery ? inferredDeliveryTo : void 0,
|
|
794
|
+
threadId: useInlineDelivery ? resolvedDeliveryThreadId : void 0
|
|
795
|
+
};
|
|
796
|
+
}
|
|
797
|
+
async function spawnAcpDirect(params, ctx) {
|
|
798
|
+
const cfg = loadConfig();
|
|
799
|
+
const requesterInternalKey = resolveRequesterInternalSessionKey({
|
|
800
|
+
cfg,
|
|
801
|
+
requesterSessionKey: ctx.agentSessionKey
|
|
802
|
+
});
|
|
803
|
+
if (!isAcpEnabledByPolicy(cfg)) return createAcpSpawnFailure({
|
|
804
|
+
status: "forbidden",
|
|
805
|
+
errorCode: "acp_disabled",
|
|
806
|
+
error: "ACP is disabled by policy (`acp.enabled=false`)."
|
|
807
|
+
});
|
|
808
|
+
const streamToParentRequested = params.streamTo === "parent";
|
|
809
|
+
const parentSessionKey = normalizeOptionalString(ctx.agentSessionKey);
|
|
810
|
+
if (streamToParentRequested && !parentSessionKey) return createAcpSpawnFailure({
|
|
811
|
+
status: "error",
|
|
812
|
+
errorCode: "requester_session_required",
|
|
813
|
+
error: "sessions_spawn streamTo=\"parent\" requires an active requester session context."
|
|
814
|
+
});
|
|
815
|
+
let requestThreadBinding = params.thread === true;
|
|
816
|
+
const runtimePolicyError = resolveAcpSpawnRuntimePolicyError({
|
|
817
|
+
cfg,
|
|
818
|
+
requesterSessionKey: ctx.agentSessionKey,
|
|
819
|
+
requesterSandboxed: ctx.sandboxed,
|
|
820
|
+
sandbox: params.sandbox
|
|
821
|
+
});
|
|
822
|
+
if (runtimePolicyError) return createAcpSpawnFailure({
|
|
823
|
+
status: "forbidden",
|
|
824
|
+
errorCode: "runtime_policy",
|
|
825
|
+
error: runtimePolicyError
|
|
826
|
+
});
|
|
827
|
+
const spawnMode = resolveSpawnMode({
|
|
828
|
+
requestedMode: params.mode,
|
|
829
|
+
threadRequested: requestThreadBinding
|
|
830
|
+
});
|
|
831
|
+
if (spawnMode === "session" && !requestThreadBinding) return createAcpSpawnFailure({
|
|
832
|
+
status: "error",
|
|
833
|
+
errorCode: "thread_required",
|
|
834
|
+
error: "mode=\"session\" requires thread=true so the ACP session can stay bound to a thread."
|
|
835
|
+
});
|
|
836
|
+
const targetAgentResult = resolveTargetAcpAgentId({
|
|
837
|
+
requestedAgentId: params.agentId,
|
|
838
|
+
cfg
|
|
839
|
+
});
|
|
840
|
+
if (!targetAgentResult.ok) return createAcpSpawnFailure({
|
|
841
|
+
status: "error",
|
|
842
|
+
errorCode: "target_agent_required",
|
|
843
|
+
error: targetAgentResult.error
|
|
844
|
+
});
|
|
845
|
+
const targetAgentId = targetAgentResult.agentId;
|
|
846
|
+
const agentPolicyError = resolveAcpAgentPolicyError(cfg, targetAgentId);
|
|
847
|
+
if (agentPolicyError) return createAcpSpawnFailure({
|
|
848
|
+
status: "forbidden",
|
|
849
|
+
errorCode: "agent_forbidden",
|
|
850
|
+
error: agentPolicyError.message
|
|
851
|
+
});
|
|
852
|
+
const subagentStore = resolveSubagentCapabilityStore(parentSessionKey, { cfg });
|
|
853
|
+
const requesterState = resolveAcpSpawnRequesterState({
|
|
854
|
+
cfg,
|
|
855
|
+
parentSessionKey,
|
|
856
|
+
targetAgentId,
|
|
857
|
+
ctx,
|
|
858
|
+
subagentStore
|
|
859
|
+
});
|
|
860
|
+
const subagentEnvelopeState = resolveAcpSubagentEnvelopeState({
|
|
861
|
+
cfg,
|
|
862
|
+
requesterSessionKey: requesterInternalKey,
|
|
863
|
+
targetAgentId,
|
|
864
|
+
requestedAgentId: params.agentId,
|
|
865
|
+
subagentStore
|
|
866
|
+
});
|
|
867
|
+
if (subagentEnvelopeState.error) return createAcpSpawnFailure({
|
|
868
|
+
status: "forbidden",
|
|
869
|
+
errorCode: "subagent_policy",
|
|
870
|
+
error: subagentEnvelopeState.error
|
|
871
|
+
});
|
|
872
|
+
const { effectiveStreamToParent } = resolveAcpSpawnStreamPlan({
|
|
873
|
+
spawnMode,
|
|
874
|
+
requestThreadBinding,
|
|
875
|
+
streamToParentRequested,
|
|
876
|
+
requester: requesterState
|
|
877
|
+
});
|
|
878
|
+
const sessionKey = `agent:${targetAgentId}:acp:${crypto.randomUUID()}`;
|
|
879
|
+
const runtimeMode = resolveAcpSessionMode(spawnMode);
|
|
880
|
+
const resolvedCwd = resolveSpawnedWorkspaceInheritance({
|
|
881
|
+
config: cfg,
|
|
882
|
+
targetAgentId,
|
|
883
|
+
requesterSessionKey: ctx.agentSessionKey,
|
|
884
|
+
explicitWorkspaceDir: params.cwd
|
|
885
|
+
});
|
|
886
|
+
let runtimeCwd;
|
|
887
|
+
try {
|
|
888
|
+
runtimeCwd = await resolveRuntimeCwdForAcpSpawn({
|
|
889
|
+
resolvedCwd,
|
|
890
|
+
explicitCwd: params.cwd
|
|
891
|
+
});
|
|
892
|
+
} catch (error) {
|
|
893
|
+
return createAcpSpawnFailure({
|
|
894
|
+
status: "error",
|
|
895
|
+
errorCode: "cwd_resolution_failed",
|
|
896
|
+
error: summarizeError(error)
|
|
897
|
+
});
|
|
898
|
+
}
|
|
899
|
+
let preparedBinding = null;
|
|
900
|
+
if (requestThreadBinding) {
|
|
901
|
+
const prepared = prepareAcpThreadBinding({
|
|
902
|
+
cfg,
|
|
903
|
+
channel: requesterState.origin?.channel,
|
|
904
|
+
accountId: requesterState.origin?.accountId,
|
|
905
|
+
to: requesterState.origin?.to,
|
|
906
|
+
threadId: requesterState.origin?.threadId,
|
|
907
|
+
groupId: ctx.agentGroupId
|
|
908
|
+
});
|
|
909
|
+
if (!prepared.ok) return createAcpSpawnFailure({
|
|
910
|
+
status: "error",
|
|
911
|
+
errorCode: "thread_binding_invalid",
|
|
912
|
+
error: prepared.error
|
|
913
|
+
});
|
|
914
|
+
preparedBinding = prepared.binding;
|
|
915
|
+
}
|
|
916
|
+
let binding = null;
|
|
917
|
+
let sessionCreated = false;
|
|
918
|
+
let initializedRuntime;
|
|
919
|
+
try {
|
|
920
|
+
await callGateway({
|
|
921
|
+
method: "sessions.patch",
|
|
922
|
+
params: {
|
|
923
|
+
key: sessionKey,
|
|
924
|
+
spawnedBy: requesterInternalKey,
|
|
925
|
+
...subagentEnvelopeState.childSessionPatch,
|
|
926
|
+
...params.label ? { label: params.label } : {}
|
|
927
|
+
},
|
|
928
|
+
timeoutMs: 1e4
|
|
929
|
+
});
|
|
930
|
+
sessionCreated = true;
|
|
931
|
+
const initializedSession = await initializeAcpSpawnRuntime({
|
|
932
|
+
cfg,
|
|
933
|
+
sessionKey,
|
|
934
|
+
targetAgentId,
|
|
935
|
+
runtimeMode,
|
|
936
|
+
resumeSessionId: params.resumeSessionId,
|
|
937
|
+
model: params.model,
|
|
938
|
+
cwd: runtimeCwd
|
|
939
|
+
});
|
|
940
|
+
initializedRuntime = initializedSession.runtimeCloseHandle;
|
|
941
|
+
if (preparedBinding) ({binding} = await bindPreparedAcpThread({
|
|
942
|
+
cfg,
|
|
943
|
+
sessionKey,
|
|
944
|
+
targetAgentId,
|
|
945
|
+
label: params.label,
|
|
946
|
+
preparedBinding,
|
|
947
|
+
initializedRuntime: initializedSession
|
|
948
|
+
}));
|
|
949
|
+
} catch (err) {
|
|
950
|
+
await cleanupFailedAcpSpawn({
|
|
951
|
+
cfg,
|
|
952
|
+
sessionKey,
|
|
953
|
+
shouldDeleteSession: sessionCreated,
|
|
954
|
+
deleteTranscript: true,
|
|
955
|
+
runtimeCloseHandle: initializedRuntime
|
|
956
|
+
});
|
|
957
|
+
return createAcpSpawnFailure({
|
|
958
|
+
status: "error",
|
|
959
|
+
errorCode: isSessionBindingError(err) ? "thread_binding_invalid" : "spawn_failed",
|
|
960
|
+
error: isSessionBindingError(err) ? err.message : summarizeError(err)
|
|
961
|
+
});
|
|
962
|
+
}
|
|
963
|
+
const deliveryPlan = resolveAcpSpawnBootstrapDeliveryPlan({
|
|
964
|
+
cfg,
|
|
965
|
+
spawnMode,
|
|
966
|
+
requestThreadBinding,
|
|
967
|
+
effectiveStreamToParent,
|
|
968
|
+
requester: requesterState,
|
|
969
|
+
binding
|
|
970
|
+
});
|
|
971
|
+
const childIdem = crypto.randomUUID();
|
|
972
|
+
let childRunId = childIdem;
|
|
973
|
+
const streamLogPath = effectiveStreamToParent && parentSessionKey ? resolveAcpSpawnStreamLogPath({ childSessionKey: sessionKey }) : void 0;
|
|
974
|
+
const parentDeliveryCtx = effectiveStreamToParent && parentSessionKey ? deliveryContextFromSession(loadSessionStore(resolveStorePath(cfg.session?.store, { agentId: resolveAgentIdFromSessionKey(parentSessionKey) }))[parentSessionKey]) : void 0;
|
|
975
|
+
let parentRelay;
|
|
976
|
+
if (effectiveStreamToParent && parentSessionKey) parentRelay = startAcpSpawnParentStreamRelay({
|
|
977
|
+
runId: childIdem,
|
|
978
|
+
parentSessionKey,
|
|
979
|
+
childSessionKey: sessionKey,
|
|
980
|
+
agentId: targetAgentId,
|
|
981
|
+
logPath: streamLogPath,
|
|
982
|
+
deliveryContext: parentDeliveryCtx,
|
|
983
|
+
emitStartNotice: false
|
|
984
|
+
});
|
|
985
|
+
try {
|
|
986
|
+
const responseRunId = normalizeOptionalString((await callGateway({
|
|
987
|
+
method: "agent",
|
|
988
|
+
params: {
|
|
989
|
+
message: params.task,
|
|
990
|
+
sessionKey,
|
|
991
|
+
channel: deliveryPlan.channel,
|
|
992
|
+
to: deliveryPlan.to,
|
|
993
|
+
accountId: deliveryPlan.accountId,
|
|
994
|
+
threadId: deliveryPlan.threadId,
|
|
995
|
+
idempotencyKey: childIdem,
|
|
996
|
+
deliver: deliveryPlan.useInlineDelivery,
|
|
997
|
+
label: params.label || void 0
|
|
998
|
+
},
|
|
999
|
+
timeoutMs: 1e4
|
|
1000
|
+
}))?.runId);
|
|
1001
|
+
if (responseRunId) childRunId = responseRunId;
|
|
1002
|
+
} catch (err) {
|
|
1003
|
+
parentRelay?.dispose();
|
|
1004
|
+
await cleanupFailedAcpSpawn({
|
|
1005
|
+
cfg,
|
|
1006
|
+
sessionKey,
|
|
1007
|
+
shouldDeleteSession: true,
|
|
1008
|
+
deleteTranscript: true
|
|
1009
|
+
});
|
|
1010
|
+
return createAcpSpawnFailure({
|
|
1011
|
+
status: "error",
|
|
1012
|
+
errorCode: "dispatch_failed",
|
|
1013
|
+
error: summarizeError(err),
|
|
1014
|
+
childSessionKey: sessionKey
|
|
1015
|
+
});
|
|
1016
|
+
}
|
|
1017
|
+
if (effectiveStreamToParent && parentSessionKey) {
|
|
1018
|
+
if (parentRelay && childRunId !== childIdem) {
|
|
1019
|
+
parentRelay.dispose();
|
|
1020
|
+
parentRelay = startAcpSpawnParentStreamRelay({
|
|
1021
|
+
runId: childRunId,
|
|
1022
|
+
parentSessionKey,
|
|
1023
|
+
childSessionKey: sessionKey,
|
|
1024
|
+
agentId: targetAgentId,
|
|
1025
|
+
logPath: streamLogPath,
|
|
1026
|
+
deliveryContext: parentDeliveryCtx,
|
|
1027
|
+
emitStartNotice: false
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
parentRelay?.notifyStarted();
|
|
1031
|
+
try {
|
|
1032
|
+
createRunningTaskRun({
|
|
1033
|
+
runtime: "acp",
|
|
1034
|
+
sourceId: childRunId,
|
|
1035
|
+
ownerKey: requesterInternalKey,
|
|
1036
|
+
scopeKind: "session",
|
|
1037
|
+
requesterOrigin: requesterState.origin,
|
|
1038
|
+
childSessionKey: sessionKey,
|
|
1039
|
+
runId: childRunId,
|
|
1040
|
+
label: params.label,
|
|
1041
|
+
task: params.task,
|
|
1042
|
+
preferMetadata: true,
|
|
1043
|
+
deliveryStatus: requesterInternalKey ? "pending" : "parent_missing",
|
|
1044
|
+
startedAt: Date.now()
|
|
1045
|
+
});
|
|
1046
|
+
} catch (error) {
|
|
1047
|
+
log.warn("Failed to create background task for ACP spawn", {
|
|
1048
|
+
sessionKey,
|
|
1049
|
+
runId: childRunId,
|
|
1050
|
+
error
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
return {
|
|
1054
|
+
status: "accepted",
|
|
1055
|
+
childSessionKey: sessionKey,
|
|
1056
|
+
runId: childRunId,
|
|
1057
|
+
mode: spawnMode,
|
|
1058
|
+
...streamLogPath ? { streamLogPath } : {},
|
|
1059
|
+
note: spawnMode === "session" ? ACP_SPAWN_SESSION_ACCEPTED_NOTE : ACP_SPAWN_ACCEPTED_NOTE
|
|
1060
|
+
};
|
|
1061
|
+
}
|
|
1062
|
+
try {
|
|
1063
|
+
createRunningTaskRun({
|
|
1064
|
+
runtime: "acp",
|
|
1065
|
+
sourceId: childRunId,
|
|
1066
|
+
ownerKey: requesterInternalKey,
|
|
1067
|
+
scopeKind: "session",
|
|
1068
|
+
requesterOrigin: requesterState.origin,
|
|
1069
|
+
childSessionKey: sessionKey,
|
|
1070
|
+
runId: childRunId,
|
|
1071
|
+
label: params.label,
|
|
1072
|
+
task: params.task,
|
|
1073
|
+
preferMetadata: true,
|
|
1074
|
+
deliveryStatus: requesterInternalKey ? "pending" : "parent_missing",
|
|
1075
|
+
startedAt: Date.now()
|
|
1076
|
+
});
|
|
1077
|
+
} catch (error) {
|
|
1078
|
+
log.warn("Failed to create background task for ACP spawn", {
|
|
1079
|
+
sessionKey,
|
|
1080
|
+
runId: childRunId,
|
|
1081
|
+
error
|
|
1082
|
+
});
|
|
1083
|
+
}
|
|
1084
|
+
return {
|
|
1085
|
+
status: "accepted",
|
|
1086
|
+
childSessionKey: sessionKey,
|
|
1087
|
+
runId: childRunId,
|
|
1088
|
+
mode: spawnMode,
|
|
1089
|
+
note: spawnMode === "session" ? ACP_SPAWN_SESSION_ACCEPTED_NOTE : ACP_SPAWN_ACCEPTED_NOTE
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
//#endregion
|
|
1093
|
+
export { ACP_SPAWN_SESSION_ACCEPTED_NOTE as a, resolveAcpSpawnRuntimePolicyError as c, ACP_SPAWN_SANDBOX_MODES as i, spawnAcpDirect as l, ACP_SPAWN_ERROR_CODES as n, ACP_SPAWN_STREAM_TARGETS as o, ACP_SPAWN_MODES as r, isSpawnAcpAcceptedResult as s, ACP_SPAWN_ACCEPTED_NOTE as t, cleanupFailedAcpSpawn as u };
|