@gaodefa/daocore 2026.5.29 → 2026.5.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abort-DI3P6TIb.js +277 -0
- package/dist/abort.runtime-B6Z7lDEa.js +2 -0
- package/dist/abort.runtime.js +1 -1
- package/dist/account-inspect-BFz7X0TX.js +173 -0
- package/dist/accounts-BoYYrY7x.js +107 -0
- package/dist/accounts-Busq29zW.js +107 -0
- package/dist/accounts-CuvH2tuN.js +119 -0
- package/dist/accounts-DkIcqvf7.js +2 -0
- package/dist/acp-runtime-BA8lzXzf.js +26 -0
- package/dist/acp-spawn-DPz2aX3A.js +2 -0
- package/dist/acp-spawn-DvVCsWYV.js +1275 -0
- package/dist/acp-stateful-target-driver-DcC76aZW.js +89 -0
- package/dist/action-kill-D-dVisIX.js +33 -0
- package/dist/action-runtime-BEiqwxDD.js +469 -0
- package/dist/action-runtime-api-1LzcGjcX.js +2 -0
- package/dist/action-send-c3CnDuPg.js +39 -0
- package/dist/action-spawn-Dj4kwpWs.js +47 -0
- package/dist/actions-qLccmQBc.js +161 -0
- package/dist/actions.runtime-B5vYAgNi.js +5 -0
- package/dist/agent-command-D6Ds198G.js +1367 -0
- package/dist/agent-components.runtime-xquK0B3L.js +10 -0
- package/dist/agent-components.runtime.js +1 -1
- package/dist/agent-harness-runtime-Dq1fCBOM.js +180 -0
- package/dist/agent-harness-task-runtime-DvSEqFkD.js +140 -0
- package/dist/agent-lm5ZYOFy.js +3 -0
- package/dist/agent-runner-execution-Dbh2pDhQ.js +1713 -0
- package/dist/agent-runner-utils-Di3r2T1T.js +266 -0
- package/dist/agent-runner.runtime-BW90EcGW.js +3455 -0
- package/dist/agent-runner.runtime.js +1 -1
- package/dist/agent-runtime-BgIT5Ytc.js +229 -0
- package/dist/agent-via-gateway-DMMS8-hK.js +463 -0
- package/dist/agent-ylolD8-V.js +2 -0
- package/dist/api-BB4vXLtW.js +2 -0
- package/dist/api-CUhM3KNB.js +134 -0
- package/dist/api-CewRHSbT.js +6 -0
- package/dist/api-CfKjNJlW.js +2 -0
- package/dist/api-Rsnqui1u.js +3 -0
- package/dist/api-k7AvxwHr.js +639 -0
- package/dist/apply-DQ4TQNMA.js +54 -0
- package/dist/apply-S_75Py4Y.js +41 -0
- package/dist/approval-handler.runtime-Cthxrstu.js +130 -0
- package/dist/assistant-Cp9pGaBw.js +291 -0
- package/dist/attachment-normalize-5R0bLLOj.js +225 -0
- package/dist/attempt-execution-DuyyZYsU.js +558 -0
- package/dist/attempt-execution.runtime-DF2GPgNh.js +3 -0
- package/dist/attempt-execution.runtime.js +1 -1
- package/dist/attempt-execution.shared-CwdukA3t.js +38 -0
- package/dist/attempt.prompt-helpers-CUqKtIa5.js +475 -0
- package/dist/attempt.tool-run-context-BbN4_BYO.js +2094 -0
- package/dist/binding-routing-C6Ex2Blu.js +113 -0
- package/dist/binding-targets-BqREncSL.js +121 -0
- package/dist/bot-DGMEkaIJ.js +7894 -0
- package/dist/bot-deps-BltYjeMX.js +2 -0
- package/dist/bot-deps-XvGCor9f.js +747 -0
- package/dist/bot-message-context.runtime-kK-xvLV7.js +7 -0
- package/dist/bot-message-context.runtime.js +1 -1
- package/dist/bot-message-context.session.runtime-DpOIJUae.js +12 -0
- package/dist/bot-message-context.session.runtime.js +1 -1
- package/dist/bot-native-commands.delivery.runtime-D49p5Lc1.js +4 -0
- package/dist/bot-native-commands.delivery.runtime.js +1 -1
- package/dist/bot-native-commands.runtime-8XBdSpkQ.js +13 -0
- package/dist/bot-native-commands.runtime.js +1 -1
- package/dist/bridge-server-y_XGduPx.js +113 -0
- package/dist/browser-cli-B2jmmTT3.js +230 -0
- package/dist/browser-cli-actions-input-JQt5ZQcn.js +473 -0
- package/dist/browser-cli-actions-observe-CrfKh6AX.js +81 -0
- package/dist/browser-cli-debug-DQACWlvC.js +137 -0
- package/dist/browser-cli-inspect-DDnxx0Xw.js +104 -0
- package/dist/browser-cli-lEuOnZzs.js +2 -0
- package/dist/browser-cli-manage-DogmwtYt.js +443 -0
- package/dist/browser-cli-resize-BHuV71VZ.js +26 -0
- package/dist/browser-cli-shared-CidShgoF.js +50 -0
- package/dist/browser-cli-state-i8cCGbiQ.js +337 -0
- package/dist/browser-control-auth-CKfXdXWj.js +2 -0
- package/dist/browser-profiles-ATBTvUGh.js +2 -0
- package/dist/browser-runtime-KmCT6FuL.js +384 -0
- package/dist/build-DOOT6f62.js +257 -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/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/capability-cli-DwvrwB-g.js +1782 -0
- package/dist/channel-B-wgK1bK.js +481 -0
- package/dist/channel-B1e_k1P0.js +867 -0
- package/dist/channel-BRDfa5tc.js +1777 -0
- package/dist/channel-BVEO1O4p.js +376 -0
- package/dist/channel-BYlO5l1d.js +508 -0
- package/dist/channel-Bl0sPoNx.js +653 -0
- package/dist/channel-C84xtDBy.js +1134 -0
- package/dist/channel-CLgKq4Ds.js +1556 -0
- package/dist/channel-CZT0qxLh.js +1249 -0
- package/dist/channel-CffBHWkb.js +955 -0
- package/dist/channel-D34ZJvVB.js +2126 -0
- package/dist/channel-DcdXLo_W.js +238 -0
- package/dist/channel-DnK5TrXV.js +362 -0
- package/dist/channel-Dzj4RHY2.js +740 -0
- package/dist/channel-OhZzLZCj.js +562 -0
- package/dist/channel-actions.runtime-Cdvhqc9s.js +265 -0
- package/dist/channel-actions.runtime.js +1 -1
- package/dist/channel-core-Dz9I_R4j.js +5 -0
- package/dist/channel-inbound-COGoV_aS.js +80 -0
- package/dist/channel-mP6HCIMr.js +1496 -0
- package/dist/channel-plugin-runtime-C0R46KeG.js +998 -0
- package/dist/channel-quGdgWel.js +808 -0
- package/dist/channel-runtime-FvPQoIF9.js +408 -0
- package/dist/channel.runtime-2vUz3gij.js +109 -0
- package/dist/channel.runtime-BZLDSNuQ.js +254 -0
- package/dist/channel.runtime-Bo5jO0Hj.js +4 -0
- package/dist/channel.runtime-CDgvrjM2.js +652 -0
- package/dist/channel.runtime-COf8SDFn.js +88 -0
- package/dist/channel.runtime-C_C1f8lu.js +733 -0
- package/dist/channel.runtime-CqPbsg8t.js +2528 -0
- package/dist/channel.runtime-DtV85Khx.js +1008 -0
- package/dist/channel.runtime-Spt1ukGW.js +21009 -0
- package/dist/channel.setup-Bc0LUQS1.js +1098 -0
- package/dist/channel.setup-ChTkj2hq.js +343 -0
- package/dist/channel.setup-CpMD9F8i.js +10 -0
- package/dist/chat-mUsjD5YN.js +2666 -0
- package/dist/chrome-u314zcbM.js +1503 -0
- package/dist/cli/run-main.js +5 -5
- package/dist/cli-CJMoqXrc.js +1341 -0
- package/dist/cli-compaction-qGYB7suI.js +347 -0
- package/dist/cli-metadata-BBJFpNU9.js +22 -0
- package/dist/cli-runner-C0kcts0I.js +540 -0
- package/dist/cli-runner-CTm8K6s8.js +2 -0
- package/dist/cli-runner.runtime-C8deL5FL.js +3 -0
- package/dist/cli-runner.runtime-DDAg1D0L.js +4 -0
- package/dist/cli-runner.runtime.js +1 -1
- package/dist/cli-startup-metadata.json +8 -8
- package/dist/client-CPxpgs4m.js +650 -0
- package/dist/client-adapter-CLlqOqfu.js +897 -0
- package/dist/client-factory-R7Rr2jwn.js +9 -0
- package/dist/command-auth-CkQP1buP.js +135 -0
- package/dist/command-handlers-CJEjFyMk.js +1609 -0
- package/dist/command-registry-BDgyOqDw.js +4 -0
- package/dist/command-registry-BVi5Jn1S.js +9 -0
- package/dist/command-registry-core-JCfsVRtz.js +110 -0
- package/dist/command-status.runtime-CM1JLzi6.js +90 -0
- package/dist/command-status.runtime.js +1 -1
- package/dist/commands-acp-C1-I78U6.js +74 -0
- package/dist/commands-compact.runtime-DOsNavwp.js +10 -0
- package/dist/commands-compact.runtime.js +1 -1
- package/dist/commands-handlers.runtime-BD1n2WGw.js +6154 -0
- package/dist/commands-handlers.runtime.js +1 -1
- package/dist/commands-status-DU_UTQz1.js +16 -0
- package/dist/commands-status-DejfTakp.js +3 -0
- package/dist/commands-status.runtime-DejfTakp.js +3 -0
- package/dist/commands-status.runtime.js +1 -1
- package/dist/commands-subagents-control.runtime-D7vo_2Y_.js +3 -0
- package/dist/commands-subagents-control.runtime-DGybTjJ6.js +2 -0
- package/dist/commands-subagents-control.runtime.js +1 -1
- package/dist/commands-system-prompt-BEBXAMea.js +2 -0
- package/dist/commands-system-prompt-gj3oQpQO.js +162 -0
- package/dist/commands.runtime-CgXX70IN.js +176 -0
- package/dist/commands.runtime.js +1 -1
- package/dist/commitments/runtime.js +1 -1
- package/dist/compact-C41XxMDt.js +480 -0
- package/dist/compact-DUVAF9EC.js +1141 -0
- package/dist/compact.runtime-COMRg6s3.js +12 -0
- package/dist/compact.runtime.js +1 -1
- package/dist/completion-cli-CmEYoB9a.js +315 -0
- package/dist/computer-use-BwJHu1QF.js +367 -0
- package/dist/config-ATBTvUGh.js +2 -0
- package/dist/config-DlNgjF8W.js +373 -0
- package/dist/config-mutations-tl_OqI6d.js +159 -0
- package/dist/context-engine-host-compat-BNPAIK9F.js +288 -0
- package/dist/context-engine-host-compat-C69CK7zS.js +2 -0
- package/dist/context-engine-lifecycle-iQ8f5a_-.js +1274 -0
- package/dist/control-auth-vVxyGKxY.js +114 -0
- package/dist/control-service-73nj79EW.js +145 -0
- package/dist/control-ui/assets/agents-DdWIz8Vk.js +1008 -0
- package/dist/control-ui/assets/channel-config-extras-C7ELhuDi.js +2 -0
- package/dist/control-ui/assets/channels-Bsoj-9BS.js +367 -0
- package/dist/control-ui/assets/cron-BRTEw1tT.js +1013 -0
- package/dist/control-ui/assets/debug-EKl_F8_L.js +97 -0
- package/dist/control-ui/assets/index-DSbSO7ys.js +7370 -0
- package/dist/control-ui/assets/instances-B1AoYwI5.js +57 -0
- package/dist/control-ui/assets/logs-BChOznzh.js +74 -0
- package/dist/control-ui/assets/nodes-5yebKh9k.js +436 -0
- package/dist/control-ui/assets/sessions-BlDYNThc.js +399 -0
- package/dist/control-ui/assets/skills-shared-CNFnf7KU.js +11 -0
- package/dist/control-ui/assets/skills-uxTDRmLx.js +314 -0
- package/dist/control-ui/index.html +1 -1
- package/dist/control-ui/sw.js +1 -1
- package/dist/conversation-binding-runtime-CmoTKcY1.js +4 -0
- package/dist/conversation-runtime-BxOHxuin.js +31 -0
- package/dist/core-D0Y2H55f.js +282 -0
- package/dist/core-api-BKlJUtDt.js +5 -0
- package/dist/core-api-_fiftUHn.js +2 -0
- package/dist/crestodian/crestodian.js +1 -1
- package/dist/crestodian/rescue-message.js +1 -1
- package/dist/crestodian-BJifoQiR.js +55 -0
- package/dist/daocore-tools-BMdF8RwK.js +11727 -0
- package/dist/delivery-e2ci_bcX.js +1002 -0
- package/dist/dialogue-BXayGhnz.js +37 -0
- package/dist/dir-fetch-tool-Cara5mZh.js +565 -0
- package/dist/dir-list-tool-CQ8Bo5Ez.js +100 -0
- package/dist/direct-dm-CPk6Qm9D.js +64 -0
- package/dist/directive-handling.fast-lane-BQ9aXqk8.js +68 -0
- package/dist/directive-handling.impl--a5AGurq.js +818 -0
- package/dist/directive-handling.impl-C4JqMwle.js +2 -0
- package/dist/directive-handling.model-selection-pyTYMIXn.js +122 -0
- package/dist/directive-handling.persist.runtime-B7vWT1r9.js +263 -0
- package/dist/directive-handling.persist.runtime.js +1 -1
- package/dist/dispatch-3Ru_eGq1.js +1640 -0
- package/dist/dispatch-acp-transcript.runtime-CYMP-5oE.js +40 -0
- package/dist/dispatch-acp-transcript.runtime.js +1 -1
- package/dist/dispatch-acp.runtime-BVCiklXk.js +18 -0
- package/dist/dispatch-acp.runtime.js +1 -1
- package/dist/doctor-B8mR3Sgr.js +2 -0
- package/dist/doctor-BJ6DuerV.js +6 -0
- package/dist/doctor-config-flow-BdOGs_zn.js +1741 -0
- package/dist/doctor-core-checks-CDf0stz-.js +2 -0
- package/dist/doctor-core-checks-Cpdnu2XI.js +573 -0
- package/dist/doctor-health-0qv_acBu.js +65 -0
- package/dist/doctor-health-contributions-Db1FQgFw.js +696 -0
- package/dist/doctor-lint-C1g4Llgl.js +94 -0
- package/dist/doctor-state-integrity-C8iXFLJ7.js +1231 -0
- package/dist/doctor-update-CsPu6p3d.js +58 -0
- package/dist/dynamic-tools-YQ0z0YKH.js +486 -0
- package/dist/embedded-backend-S0cahIZw.js +579 -0
- package/dist/embedded-gateway-stub.runtime-Cjw12ALm.js +12 -0
- package/dist/embedded-gateway-stub.runtime.js +1 -1
- package/dist/exec-approvals-ArHHjoE-.js +149 -0
- package/dist/extensionAPI.js +1 -1
- package/dist/extensions/active-memory/index.js +1 -1
- package/dist/extensions/admin-http-rpc/index.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 +1 -1
- package/dist/extensions/browser/browser-profiles.js +2 -2
- package/dist/extensions/browser/browser-runtime-api.js +11 -11
- package/dist/extensions/browser/cli-metadata.js +1 -1
- package/dist/extensions/browser/index.js +1 -1
- package/dist/extensions/browser/plugin-registration.js +1 -1
- package/dist/extensions/browser/register.runtime.js +4 -4
- package/dist/extensions/browser/runtime-api.js +13 -13
- package/dist/extensions/canvas/index.js +1 -1
- package/dist/extensions/clickclack/api.js +2 -2
- package/dist/extensions/clickclack/channel-plugin-api.js +1 -1
- package/dist/extensions/clickclack/runtime-api.js +2 -2
- package/dist/extensions/device-pair/api.js +1 -1
- package/dist/extensions/device-pair/pair-command-approve.js +1 -1
- package/dist/extensions/file-transfer/index.js +4 -4
- package/dist/extensions/imessage/api.js +2 -2
- package/dist/extensions/imessage/channel-plugin-api.js +1 -1
- package/dist/extensions/imessage/message-tool-api.d.ts +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/llm-task/index.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 +2 -2
- package/dist/extensions/mattermost/slash-route-api.js +1 -1
- package/dist/extensions/memory-core/cli-metadata.js +1 -1
- package/dist/extensions/migrate-claude/apply.js +1 -1
- package/dist/extensions/migrate-claude/index.js +1 -1
- package/dist/extensions/migrate-claude/plan.js +1 -1
- package/dist/extensions/migrate-claude/provider.js +1 -1
- package/dist/extensions/migrate-claude/targets.js +1 -1
- package/dist/extensions/migrate-hermes/apply.js +1 -1
- package/dist/extensions/migrate-hermes/index.js +1 -1
- package/dist/extensions/migrate-hermes/model.js +1 -1
- package/dist/extensions/migrate-hermes/plan.js +1 -1
- package/dist/extensions/migrate-hermes/provider.js +1 -1
- package/dist/extensions/migrate-hermes/secrets.js +1 -1
- package/dist/extensions/migrate-hermes/targets.js +1 -1
- package/dist/extensions/policy/api.js +1 -1
- package/dist/extensions/policy/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 +2 -2
- package/dist/extensions/telegram/account-inspect-api.js +1 -1
- package/dist/extensions/telegram/api.js +11 -11
- package/dist/extensions/telegram/channel-plugin-api.js +2 -2
- package/dist/extensions/telegram/contract-api.js +3 -3
- package/dist/extensions/telegram/runtime-api.js +7 -7
- package/dist/extensions/telegram/security-audit-contract-api.js +1 -1
- package/dist/extensions/telegram/setup-plugin-api.js +1 -1
- package/dist/extensions/telegram/test-api.js +2 -2
- package/dist/extensions/webhooks/api.js +1 -1
- package/dist/extensions/webhooks/index.js +1 -1
- package/dist/extensions/xai/index.js +4 -4
- package/dist/extensions/xai/realtime-transcription-provider.js +1 -1
- package/dist/extensions/xai/speech-provider.js +1 -1
- package/dist/extensions/xai/test-api.js +1 -1
- package/dist/extensions/xai/tts.js +1 -1
- package/dist/extensions/xai/web-search.js +1 -1
- package/dist/extensions/xai/xai-oauth.js +1 -1
- package/dist/file-fetch-tool-DQpAtjX4.js +124 -0
- package/dist/file-write-tool-CkB0oYwe.js +127 -0
- package/dist/format-DUJUpMFQ.js +1145 -0
- package/dist/gateway-cli-CQo_E4Ka.js +435 -0
- package/dist/gateway-method-runtime-1QPgVJH7.js +21 -0
- package/dist/get-reply-DfUcsC-O.js +4689 -0
- package/dist/get-reply-from-config.runtime-C95MG73O.js +2 -0
- package/dist/get-reply-from-config.runtime.js +1 -1
- package/dist/graph-users-DPJe0fPs.js +1419 -0
- package/dist/group-access-DefaNJ6L.js +112 -0
- package/dist/handle-action.guild-admin-C1sy1kGJ.js +288 -0
- package/dist/harness-BgPRdmNK.js +61 -0
- package/dist/health-DFR9A1YV.js +4 -0
- package/dist/heartbeat-runner-BiYVPs25.js +5 -0
- package/dist/heartbeat-runner.runtime-Bmaq8WUA.js +4 -0
- package/dist/heartbeat-runner.runtime.js +1 -1
- package/dist/hooks-CNJDuJUm.js +534 -0
- package/dist/inbound-direct-dm-runtime-DFt58p71.js +2 -0
- package/dist/inbound-reply-dispatch-kgSDM8ax.js +148 -0
- package/dist/index.js +1 -1
- package/dist/init-B0zO_U4r.js +59 -0
- package/dist/inline-buttons-B6zgQW3J.js +40 -0
- package/dist/internal-events-C3Q5t6hg.js +90 -0
- package/dist/isolated-agent-CaSU5GCJ.js +2 -0
- package/dist/isolated-agent-CnsD2TmP.js +1118 -0
- package/dist/lifecycle-i3WZDaIn.js +571 -0
- package/dist/list.probe-g0rUiVXW.js +449 -0
- package/dist/list.status-command-DG3PrmeO.js +789 -0
- package/dist/llm-slug-generator-CHlf69FU.js +78 -0
- package/dist/llm-slug-generator.js +1 -1
- package/dist/local-dispatch.runtime-CDeHUp_A.js +9 -0
- package/dist/local-dispatch.runtime.js +1 -1
- package/dist/manager.runtime-BlLMPUTq.js +2714 -0
- package/dist/manager.runtime.js +1 -1
- package/dist/markdown-to-line-r_mBHMdy.js +811 -0
- package/dist/mcp-http-C5UPIJGR.js +555 -0
- package/dist/mcp-http-CTy9gpfA.js +2 -0
- package/dist/media-understanding-provider-BT6TOuVa.js +339 -0
- package/dist/message-actions-BdcjjwFt.js +145 -0
- package/dist/message-handler-B29Tj2p2.js +1715 -0
- package/dist/message-handler-BhHb1FHI.js +384 -0
- package/dist/message-handler.preflight-ouZ_-3o8.js +1125 -0
- package/dist/message-handler.process-CrYiBx_F.js +1484 -0
- package/dist/model-CLbtocQX.js +74 -0
- package/dist/model-selection-BG_vU9Kl.js +272 -0
- package/dist/models-4KERn3ya.js +104 -0
- package/dist/models-BCa-ipxi.js +2 -0
- package/dist/models-cli-DtpGXEsf.js +256 -0
- package/dist/monitor-B-egsvmI.js +1657 -0
- package/dist/monitor-BJX9Yv7k.js +2 -0
- package/dist/monitor-BPrIy3pV.js +715 -0
- package/dist/monitor-BWknZZ7N.js +4377 -0
- package/dist/monitor-C3y_PtI1.js +60 -0
- package/dist/monitor-DCzfdqE4.js +1370 -0
- package/dist/monitor-P24epSwE.js +2788 -0
- package/dist/monitor-auth-CEG_xldE.js +179 -0
- package/dist/monitor-jEePJbbS.js +834 -0
- package/dist/monitor-polling.runtime-BzlHK11u.js +883 -0
- package/dist/monitor-polling.runtime.js +1 -1
- package/dist/monitor-webhook.runtime-vFEhk_Zj.js +387 -0
- package/dist/monitor-webhook.runtime.js +1 -1
- package/dist/monitor.account-BUIfgWXg.js +5233 -0
- package/dist/monitor.runtime-Cp7W4fhb.js +2 -0
- package/dist/monitor.runtime.js +1 -1
- package/dist/monitor.webhook-DzrbeR4T.js +180 -0
- package/dist/node-cli-sessions-CLbI14UA.js +1228 -0
- package/dist/openai-http-BM9BIA_g.js +824 -0
- package/dist/openresponses-http-CNoW9kk8.js +1173 -0
- package/dist/operations-DT4bsxV6.js +805 -0
- package/dist/outbound-adapter-CZRUOgY0.js +543 -0
- package/dist/outbound-session-route-DneMsGNx.js +45 -0
- package/dist/outbound.runtime-CHuoKJJI.js +2 -0
- package/dist/outbound.runtime.js +1 -1
- package/dist/pi-embedded-1-rsueO_.js +3796 -0
- package/dist/pi-embedded-BRfDncVO.js +4 -0
- package/dist/pi-embedded.runtime-DEYoa6bW.js +4 -0
- package/dist/pi-embedded.runtime.js +1 -1
- package/dist/pi-tools-C0P3NgP5.js +2413 -0
- package/dist/plan-BQUkjBMY.js +81 -0
- package/dist/plan-CRO9_2_k.js +112 -0
- package/dist/plugin-BJCmWhnh.js +12396 -0
- package/dist/plugin-app-cache-key-CXAg0F7A.js +46 -0
- package/dist/plugin-enabled-D93Z9LSo.js +233 -0
- package/dist/plugin-registration-BBrTcZnf.js +88 -0
- package/dist/plugin-sdk/.boundary-entry-shims.stamp +1 -1
- package/dist/plugin-sdk/acp-runtime-backend.js +1 -1
- package/dist/plugin-sdk/acp-runtime.js +2 -2
- package/dist/plugin-sdk/agent-harness-runtime.js +6 -6
- package/dist/plugin-sdk/agent-harness-task-runtime.js +1 -1
- package/dist/plugin-sdk/agent-harness.js +7 -7
- package/dist/plugin-sdk/agent-runtime.js +2 -2
- package/dist/plugin-sdk/channel-core.js +2 -2
- package/dist/plugin-sdk/channel-inbound.js +2 -2
- package/dist/plugin-sdk/channel-test-helpers.js +1 -1
- 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 +2 -2
- 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-method-runtime.js +1 -1
- package/dist/plugin-sdk/health.js +2 -2
- package/dist/plugin-sdk/inbound-reply-dispatch.js +1 -1
- package/dist/plugin-sdk/index.js +1 -1
- package/dist/plugin-sdk/mattermost.js +1 -1
- package/dist/plugin-sdk/plugin-test-contracts.js +2 -2
- package/dist/plugin-sdk/provider-test-contracts.js +4 -4
- package/dist/plugin-sdk/reply-runtime.js +4 -4
- package/dist/plugin-sdk/testing.js +2 -2
- package/dist/plugin-sdk/zalouser.js +1 -1
- package/dist/plugin-service-DnZEPBEA.js +1229 -0
- package/dist/plugins/runtime/index.js +4 -4
- package/dist/policy-CMv5QMPG.js +138 -0
- package/dist/policy-CeoP4t9J.js +680 -0
- package/dist/prepare.runtime-DZ55JiTt.js +732 -0
- package/dist/prepare.runtime.js +1 -1
- package/dist/preview-warnings-O08PZRxu.js +392 -0
- package/dist/probe-C6w3bP8X.js +682 -0
- package/dist/probe-Cs1_X1NA.js +47 -0
- package/dist/probe-Cuee_jyM.js +2204 -0
- package/dist/probe-DZxCnDzn.js +2 -0
- package/dist/program-C2dT8VHB.js +131 -0
- package/dist/provider-C2_vSzYh.js +32 -0
- package/dist/provider-DSfTDQbj.js +152 -0
- package/dist/provider-U8hrm9h-.js +32 -0
- package/dist/provider-_v910H8y.js +8735 -0
- package/dist/provider-dispatcher-C3kmmIEC.js +22 -0
- package/dist/provider-dispatcher.runtime.js +1 -1
- package/dist/provider-session.runtime-Mg0fx5hH.js +9 -0
- package/dist/provider-session.runtime.js +1 -1
- package/dist/provider.runtime-pSTXuHrq.js +2 -0
- package/dist/provider.runtime.js +1 -1
- package/dist/public-surface-loader-09t4TTue.js +114 -0
- package/dist/pw-ai-DjNqHV3_.js +3029 -0
- package/dist/pw-role-snapshot-DoGefdv7.js +333 -0
- package/dist/reaction-level-C8Mqxizo.js +19 -0
- package/dist/reaction-runtime-api-DOP6xOsm.js +116 -0
- package/dist/realtime-transcription-provider-BTGEXXna.js +205 -0
- package/dist/register-CbZPpqI3.js +2178 -0
- package/dist/register.agent-DrBFuPKh.js +156 -0
- package/dist/register.crestodian-DwTbmaK8.js +24 -0
- package/dist/register.maintenance-BIeoYBub.js +83 -0
- package/dist/register.runtime-B5V9_Dwz.js +54 -0
- package/dist/register.subclis-CJE9ISZY.js +31 -0
- package/dist/register.subclis-YQsKas8N.js +3 -0
- package/dist/register.subclis-core-CjwdGeGU.js +273 -0
- package/dist/repair-sequencing-C0jrL5pw.js +640 -0
- package/dist/reply-delivery-B28mTIpb.js +196 -0
- package/dist/reply-runtime-BqQX7HHw.js +11 -0
- package/dist/reply.runtime-C95MG73O.js +2 -0
- package/dist/reply.runtime.js +1 -1
- package/dist/request-BqoMvXxH.js +54 -0
- package/dist/resolve-allowlist-hbKKd_kq.js +220 -0
- package/dist/result-fallback-classifier-BrORPoxj.js +79 -0
- package/dist/route-HHRgSzVy.js +469 -0
- package/dist/route-resolution-C7bafjVc.js +274 -0
- package/dist/routes-86XGeo7a.js +2 -0
- package/dist/routes-BhVGr9ie.js +3602 -0
- package/dist/run-Bb5QP5JV.js +1162 -0
- package/dist/run-attempt-CLi0wV7j.js +7704 -0
- package/dist/run-command-Be6GAxiW.js +2 -0
- package/dist/run-command-Ds4hr3iU.js +23 -0
- package/dist/run-embedded.runtime-wX9ORojX.js +4 -0
- package/dist/run-embedded.runtime.js +1 -1
- package/dist/run-execution-cli.runtime-BmNZVB2N.js +4 -0
- package/dist/run-execution-cli.runtime.js +1 -1
- package/dist/run-executor.runtime.js +1 -1
- package/dist/run-subagent-registry.runtime-Uq5sjftu.js +2 -0
- package/dist/run-subagent-registry.runtime.js +1 -1
- package/dist/runtime-BktLQ75j.js +1287 -0
- package/dist/runtime-C9XdR62_.js +438 -0
- package/dist/runtime-CTvWDPx9.js +6179 -0
- package/dist/runtime-api-BojB3MUw.js +21 -0
- package/dist/runtime-api-C92MlAwp.js +13 -0
- package/dist/runtime-api-CFNZE9Xt.js +13 -0
- package/dist/runtime-api-Cimpgm5_.js +3 -0
- package/dist/runtime-api-D8qG_lUm.js +17 -0
- package/dist/runtime-api-DMDMnQEG.js +4 -0
- package/dist/runtime-api-DupQdIlE.js +24 -0
- package/dist/runtime-api.actions-B8i3elqu.js +3 -0
- package/dist/runtime-api.monitor-BntFzf_M.js +6 -0
- package/dist/runtime-api.send-CPlmi1jc.js +4 -0
- package/dist/runtime-api.threads-D-H_r_Nl.js +2 -0
- package/dist/runtime-channel-BGhTxnXZ.js +150 -0
- package/dist/runtime-channel-CPFxNapZ.js +2 -0
- package/dist/runtime-embedded-pi.runtime-BjnMTurB.js +2 -0
- package/dist/runtime-embedded-pi.runtime.js +1 -1
- package/dist/sanitize-outbound-BMUv1NeS.js +127 -0
- package/dist/sdk-setup-tools-Do3DkQi_.js +8 -0
- package/dist/secrets-B8YVPHhk.js +113 -0
- package/dist/security-audit-7Gg_nL4o.js +122 -0
- package/dist/security-audit-Bk3CREj-.js +118 -0
- package/dist/security-audit.runtime-BmSJrdeq.js +2 -0
- package/dist/security-audit.runtime.js +1 -1
- package/dist/selection-BFGde9-_.js +3 -0
- package/dist/selection-DrLFlbgG.js +16157 -0
- package/dist/send-4dLa-BQo.js +1631 -0
- package/dist/send-CV6gCwYP.js +192 -0
- package/dist/send-aGiK3Efu.js +143 -0
- package/dist/send-dB3CehAN.js +2 -0
- package/dist/send.components-BcG9BlkC.js +2 -0
- package/dist/send.components-rLjDlfYU.js +500 -0
- package/dist/send.runtime-D20k2MSr.js +2 -0
- package/dist/send.runtime.js +1 -1
- package/dist/server-BTRx_U1s.js +73 -0
- package/dist/server-CY0ymhBg.js +24 -0
- package/dist/server-close.runtime.js +1 -1
- package/dist/server-context-BxGT8wbK.js +955 -0
- package/dist/server-context-DYlbhAaT.js +2 -0
- package/dist/server-cron-BB_15lcP.js +2 -0
- package/dist/server-cron-CfyJX_a4.js +2989 -0
- package/dist/server-methods-Ck2ab6TC.js +16494 -0
- package/dist/server-node-events-BdRizF-5.js +596 -0
- package/dist/server-plugin-bootstrap-CPUr8NFE.js +70 -0
- package/dist/server-plugins-__5AxjzH.js +432 -0
- package/dist/server-reload-handlers-BMl9Fx9b.js +714 -0
- package/dist/server-restart-sentinel-D11M_ZsH.js +747 -0
- package/dist/server-restart-sentinel-DGptQ27c.js +2 -0
- package/dist/server-runtime-services-BwtLs-8I.js +2 -0
- package/dist/server-runtime-services-aJydixRu.js +267 -0
- package/dist/server-startup-plugins-m_P3gY4m.js +113 -0
- package/dist/server-startup-post-attach-DuXQ1AXL.js +716 -0
- package/dist/server-ws-runtime-mXmxB1W8.js +349 -0
- package/dist/server.impl-fuV8aKSP.js +2586 -0
- package/dist/service-a8cTFka4.js +1446 -0
- package/dist/session-binding-BIycxo9u.js +2 -0
- package/dist/session-binding-xHwQr9vM.js +219 -0
- package/dist/session-kill-http-DiUZhcoN.js +121 -0
- package/dist/session-reset-service-DkepDoob.js +625 -0
- package/dist/session-route-Ba5u7ecb.js +93 -0
- package/dist/session-status.runtime-Cb1X69Rl.js +2 -0
- package/dist/session-status.runtime.js +1 -1
- package/dist/session-subagent-reactivation.runtime-rbqmto4G.js +2 -0
- package/dist/session-subagent-reactivation.runtime.js +1 -1
- package/dist/session-tab-registry-DSKOoJta.js +521 -0
- package/dist/sessions-history-http-CWP88I_C.js +430 -0
- package/dist/sessions.runtime-1q1OwLn3.js +2 -0
- package/dist/sessions.runtime.js +1 -1
- package/dist/setup-api-DtrOOYeP.js +29 -0
- package/dist/setup-core-DMrJS6LP.js +174 -0
- package/dist/setup-surface-BFPNu1qA.js +405 -0
- package/dist/setup-surface-CedShqhO.js +288 -0
- package/dist/setup-surface-DLOBH1Vf.js +320 -0
- package/dist/setup-surface-MhCeEWSj.js +221 -0
- package/dist/shared-DamL-e8D.js +121 -0
- package/dist/shared-client-B48JoAsz.js +2 -0
- package/dist/shared-client-BoSiDnUo.js +629 -0
- package/dist/side-question-DQoQ_ETb.js +683 -0
- package/dist/skill-tool-dispatch.runtime-CWLloYA8.js +143 -0
- package/dist/skill-tool-dispatch.runtime.js +1 -1
- package/dist/slash-state-DrrWJQfv.js +2166 -0
- package/dist/speech-provider-8Hx1uw41.js +184 -0
- package/dist/src-BbUYOPwU.js +4256 -0
- package/dist/startup-context-opAJAamX.js +313 -0
- package/dist/status-subagents.runtime-DSo7ZK_Z.js +18 -0
- package/dist/status-subagents.runtime.js +1 -1
- package/dist/status-text-AyPuDzrO.js +296 -0
- package/dist/sticker-cache-91Tp8mLP.js +206 -0
- package/dist/sticker-vision.runtime-DjleFXi5.js +17 -0
- package/dist/sticker-vision.runtime.js +1 -1
- package/dist/subagent-announce-delivery-DS_2W9oZ.js +958 -0
- package/dist/subagent-announce-hatA_PZ2.js +354 -0
- package/dist/subagent-control-IyFIvc7T.js +508 -0
- package/dist/subagent-hooks-BCj5eB0Z.js +2 -0
- package/dist/subagent-hooks-BWjTBkox.js +146 -0
- package/dist/subagent-hooks-CdGLK9_3.js +230 -0
- package/dist/subagent-hooks-EH0tBkw9.js +2 -0
- package/dist/subagent-hooks-api-BhYaXQJV.js +23 -0
- package/dist/subagent-hooks-api-uGsV8Xn5.js +22 -0
- package/dist/subagent-hooks-api-wfJFKIPx.js +23 -0
- package/dist/subagent-hooks-l8Xd94dt.js +2 -0
- package/dist/subagent-hooks-m2eHUO_d.js +116 -0
- package/dist/subagent-orphan-recovery-Bq9zvX3L.js +352 -0
- package/dist/subagent-registry-Bcb3zy6b.js +3 -0
- package/dist/subagent-registry-CoZNTFx-.js +2351 -0
- package/dist/subagent-registry.runtime.js +1 -1
- package/dist/subagent-session-cleanup--00EjDLe.js +525 -0
- package/dist/subagent-spawn-ClJJkz3D.js +1164 -0
- package/dist/target-id-BsZLiF3x.js +107 -0
- package/dist/targets-CQMe4AZP.js +44 -0
- package/dist/targets-SmL1AU-H.js +19 -0
- package/dist/targets-Y-roiA47.js +19 -0
- package/dist/task-registry-control.runtime.js +1 -1
- package/dist/telegram/token.js +1 -1
- package/dist/testing-B5hNJDuF.js +267 -0
- package/dist/thread-bindings-BD3eE0kK.js +232 -0
- package/dist/thread-bindings-C9NNiv8K.js +571 -0
- package/dist/thread-bindings-Dl4PN1vZ.js +228 -0
- package/dist/thread-bindings-uK1LLAwy.js +8 -0
- package/dist/thread-bindings.discord-api-BHNEUbnk.js +187 -0
- package/dist/thread-bindings.manager-B0LXiH3F.js +2 -0
- package/dist/thread-bindings.manager-BTlH4XMG.js +536 -0
- package/dist/thread-lifecycle-DG8uyPHd.js +1614 -0
- package/dist/token-BbGCANnE.js +134 -0
- package/dist/tool-actions.runtime-oUUrD8HB.js +534 -0
- package/dist/tool-actions.runtime.js +1 -1
- package/dist/tool-bqg-_vYv.js +139 -0
- package/dist/tool-resolution-CSZsa3kP.js +149 -0
- package/dist/tools-effective-inventory-0CqFp-vq.js +204 -0
- package/dist/tools-invoke-http-DhYHY0Yh.js +67 -0
- package/dist/tools-invoke-shared-CbVJJUj7.js +200 -0
- package/dist/tts-C2qD-ad6.js +66 -0
- package/dist/tui-CzGY254f.js +4709 -0
- package/dist/tui-backend-fzoeoSN0.js +256 -0
- package/dist/tui-cli-B2RWb2gM.js +37 -0
- package/dist/tui-dgS8hdXU.js +2 -0
- package/dist/update-cli-BmiBDf3c.js +3664 -0
- package/dist/update-runner-CM7QVX6u.js +2379 -0
- package/dist/vision-tools-BzoBZnIc.js +1409 -0
- package/dist/web-search-DmfOd66S.js +62 -0
- package/dist/web-search-provider.runtime-3C5-pODD.js +328 -0
- package/dist/web-search-provider.runtime-Doh-Z9We.js +2 -0
- package/dist/web-search-provider.runtime.js +1 -1
- package/dist/xai-oauth-BLvQ43hx.js +479 -0
- package/dist/xai-user-agent-BdMQ_0_O.js +32 -0
- package/package.json +1 -1
- package/dist/abort-DeEb_wKd.js +0 -277
- package/dist/abort.runtime-CoYXQGPK.js +0 -2
- package/dist/account-inspect-D_06-CYS.js +0 -173
- package/dist/accounts-BCTqtj4Y.js +0 -107
- package/dist/accounts-BudLl8P2.js +0 -107
- package/dist/accounts-CUReBDA0.js +0 -2
- package/dist/accounts-PCioSzzr.js +0 -119
- package/dist/acp-runtime-B2t9_BHD.js +0 -26
- package/dist/acp-spawn-0x4Iiu1o.js +0 -2
- package/dist/acp-spawn-B2Ghe0jJ.js +0 -1275
- package/dist/acp-stateful-target-driver-C4VgcSyz.js +0 -89
- package/dist/action-kill-ClYsXEz7.js +0 -33
- package/dist/action-runtime-DrLPkNvU.js +0 -469
- package/dist/action-runtime-api-BqSflr9q.js +0 -2
- package/dist/action-send-CIy9cziD.js +0 -39
- package/dist/action-spawn-BjV6lFnX.js +0 -47
- package/dist/actions-D-QH7wq5.js +0 -161
- package/dist/actions.runtime-hzDtXQGU.js +0 -5
- package/dist/agent-Bb1DTBgv.js +0 -3
- package/dist/agent-Cnqj258q.js +0 -2
- package/dist/agent-command-BRx6ZNgJ.js +0 -1367
- package/dist/agent-components.runtime-D-g6xXJ0.js +0 -10
- package/dist/agent-harness-runtime-dKUQFuOc.js +0 -180
- package/dist/agent-harness-task-runtime-v2crUm3i.js +0 -140
- package/dist/agent-runner-execution-AOzdxvWR.js +0 -1713
- package/dist/agent-runner-utils-Byv50B4Z.js +0 -266
- package/dist/agent-runner.runtime-hhgRE0Z-.js +0 -3455
- package/dist/agent-runtime-BHmh3i0o.js +0 -229
- package/dist/agent-via-gateway-DnCqaK4a.js +0 -463
- package/dist/api-Bzyb8sFU.js +0 -3
- package/dist/api-CIEDFXZs.js +0 -2
- package/dist/api-D_dTQAu8.js +0 -2
- package/dist/api-DilBjZ9Q.js +0 -6
- package/dist/api-E5zoQMmh.js +0 -134
- package/dist/api-OJZug8gQ.js +0 -639
- package/dist/apply-C0eV5T0O.js +0 -41
- package/dist/apply-alsYvxLE.js +0 -54
- package/dist/approval-handler.runtime-C6jqZXSN.js +0 -130
- package/dist/assistant-DDXnAAB5.js +0 -291
- package/dist/attachment-normalize-Cv-_4DWU.js +0 -225
- package/dist/attempt-execution-DECEU59r.js +0 -558
- package/dist/attempt-execution.runtime-kasMxuER.js +0 -3
- package/dist/attempt-execution.shared-ClUxk52p.js +0 -38
- package/dist/attempt.prompt-helpers-Bxlv9VSu.js +0 -475
- package/dist/attempt.tool-run-context-CplQWX6g.js +0 -2094
- package/dist/binding-routing-0Obpp-Ij.js +0 -113
- package/dist/binding-targets-CZHQaZL4.js +0 -121
- package/dist/bot-BPbQ0840.js +0 -7894
- package/dist/bot-deps-Cs1M9USs.js +0 -2
- package/dist/bot-deps-xAcaOtTZ.js +0 -747
- package/dist/bot-message-context.runtime-Bji78Cbn.js +0 -7
- package/dist/bot-message-context.session.runtime-C3dyOIYH.js +0 -12
- package/dist/bot-native-commands.delivery.runtime-WshH99fy.js +0 -4
- package/dist/bot-native-commands.runtime-C1L364gU.js +0 -13
- package/dist/bridge-server-DPlM8_Lk.js +0 -113
- package/dist/browser-cli-DFNQE98N.js +0 -230
- package/dist/browser-cli-Drb5E5--.js +0 -2
- package/dist/browser-cli-actions-input-Dx-1OXmE.js +0 -473
- package/dist/browser-cli-actions-observe-BMDfE7xU.js +0 -81
- package/dist/browser-cli-debug-nu7Ih09g.js +0 -137
- package/dist/browser-cli-inspect-D5X2wohg.js +0 -104
- package/dist/browser-cli-manage-DkzYwph4.js +0 -443
- package/dist/browser-cli-resize-B30Avedl.js +0 -26
- package/dist/browser-cli-shared-cMgQoQzF.js +0 -50
- package/dist/browser-cli-state-CQLDvDy7.js +0 -337
- package/dist/browser-control-auth-D7ArmHUt.js +0 -2
- package/dist/browser-profiles-B39SIZNb.js +0 -2
- package/dist/browser-runtime-DUbSAOOS.js +0 -384
- package/dist/build-D25KqC92.js +0 -257
- package/dist/capability-cli-CuyXrlAB.js +0 -1782
- package/dist/channel-0N3YGMGg.js +0 -1496
- package/dist/channel-1UyKoLyp.js +0 -481
- package/dist/channel-BG87pSEW.js +0 -740
- package/dist/channel-BPGSaZW7.js +0 -1249
- package/dist/channel-BQMPh1J_.js +0 -376
- package/dist/channel-Bd_8V6zn.js +0 -1134
- package/dist/channel-BtBjh_ij.js +0 -362
- package/dist/channel-CpFBlVH6.js +0 -562
- package/dist/channel-CwuTrIrF.js +0 -508
- package/dist/channel-Cxl4sJA-.js +0 -1777
- package/dist/channel-D-VfU4Z2.js +0 -2126
- package/dist/channel-D9q8aYrN.js +0 -867
- package/dist/channel-DKSvVvZh.js +0 -238
- package/dist/channel-DvoFfWLx.js +0 -808
- package/dist/channel-GktTcGHm.js +0 -955
- package/dist/channel-actions.runtime-CKcRA0GW.js +0 -265
- package/dist/channel-core-nm8s1qFZ.js +0 -5
- package/dist/channel-d3t2ESlE.js +0 -653
- package/dist/channel-inbound-DKz40dq-.js +0 -80
- package/dist/channel-plugin-runtime-DKIGZWfW.js +0 -998
- package/dist/channel-runtime-Bh8_GY12.js +0 -408
- package/dist/channel-yQ8jCOb9.js +0 -1556
- package/dist/channel.runtime-BG4mM5cQ.js +0 -652
- package/dist/channel.runtime-BS6PyFFa.js +0 -1008
- package/dist/channel.runtime-CE_xECqN.js +0 -88
- package/dist/channel.runtime-Cd1Sw8U4.js +0 -254
- package/dist/channel.runtime-DIq3XOEe.js +0 -733
- package/dist/channel.runtime-Dy1cx35I.js +0 -21009
- package/dist/channel.runtime-NyIMjLnP.js +0 -109
- package/dist/channel.runtime-Zx5mfE2V.js +0 -4
- package/dist/channel.runtime-rJRibGfN.js +0 -2528
- package/dist/channel.setup--4ACadmF.js +0 -10
- package/dist/channel.setup-DzwqIlo3.js +0 -1098
- package/dist/channel.setup-FKYSJwXR.js +0 -343
- package/dist/chat-CKxSm7r1.js +0 -2666
- package/dist/chrome-rMubJwRG.js +0 -1503
- package/dist/cli-CbTod55I.js +0 -1341
- package/dist/cli-compaction-BbHgjJyW.js +0 -347
- package/dist/cli-metadata-DkOWLC_p.js +0 -22
- package/dist/cli-runner-Cwzv_RKf.js +0 -540
- package/dist/cli-runner-DdnUsgPl.js +0 -2
- package/dist/cli-runner.runtime-BlrSgbEW.js +0 -3
- package/dist/cli-runner.runtime-D8kVfvFH.js +0 -4
- package/dist/client-ClvxsWgL.js +0 -650
- package/dist/client-adapter-CsrIIjK1.js +0 -897
- package/dist/client-factory-DAYClhwm.js +0 -9
- package/dist/command-auth-CCha2ofd.js +0 -135
- package/dist/command-handlers-DCWJzHyB.js +0 -1609
- package/dist/command-registry-BIf61QNz.js +0 -9
- package/dist/command-registry-DJROBy4h.js +0 -4
- package/dist/command-registry-core-BQOWqi6S.js +0 -110
- package/dist/command-status.runtime-D88CUglL.js +0 -90
- package/dist/commands-acp-B-8dHX4Z.js +0 -74
- package/dist/commands-compact.runtime-ComX5mUk.js +0 -10
- package/dist/commands-handlers.runtime-DR3wjXHX.js +0 -6154
- package/dist/commands-status-CDyGrwsI.js +0 -3
- package/dist/commands-status-DV-i_ZIK.js +0 -16
- package/dist/commands-status.runtime-CDyGrwsI.js +0 -3
- package/dist/commands-subagents-control.runtime-B029cXAS.js +0 -3
- package/dist/commands-subagents-control.runtime-DR8Qspe0.js +0 -2
- package/dist/commands-system-prompt-C10ctsG3.js +0 -162
- package/dist/commands-system-prompt-DQlRWwnk.js +0 -2
- package/dist/commands.runtime-BYmIAuN0.js +0 -176
- package/dist/compact-14Ljaaeu.js +0 -480
- package/dist/compact-B--ovdkx.js +0 -1141
- package/dist/compact.runtime-E0Idf2Dq.js +0 -12
- package/dist/completion-cli-DMvvQGSk.js +0 -315
- package/dist/computer-use-CcLwX5SR.js +0 -367
- package/dist/config-B39SIZNb.js +0 -2
- package/dist/config-D4rsGOyV.js +0 -373
- package/dist/config-mutations-CsI3YJu7.js +0 -159
- package/dist/context-engine-host-compat-BZpDFiMJ.js +0 -2
- package/dist/context-engine-host-compat-runUdES5.js +0 -288
- package/dist/context-engine-lifecycle-D6odtNrn.js +0 -1274
- package/dist/control-auth-BPGpPtfz.js +0 -114
- package/dist/control-service-C-OmdPCe.js +0 -145
- package/dist/control-ui/assets/agents-GeyOHPuW.js +0 -1008
- package/dist/control-ui/assets/channel-config-extras-D7en6iUg.js +0 -2
- package/dist/control-ui/assets/channels-DkEyr1w5.js +0 -367
- package/dist/control-ui/assets/cron-C-wThQ1Q.js +0 -1013
- package/dist/control-ui/assets/debug-83AFRtIX.js +0 -97
- package/dist/control-ui/assets/index-CiGEhMOA.js +0 -7370
- package/dist/control-ui/assets/instances-CVl0t-1h.js +0 -57
- package/dist/control-ui/assets/logs-eybVEXxg.js +0 -74
- package/dist/control-ui/assets/nodes-C_A7eoU2.js +0 -436
- package/dist/control-ui/assets/sessions-Cq4Nc69u.js +0 -399
- package/dist/control-ui/assets/skills-ZN6hroIh.js +0 -314
- package/dist/control-ui/assets/skills-shared-DIWGwmdC.js +0 -11
- package/dist/conversation-binding-runtime-C2U1JElL.js +0 -4
- package/dist/conversation-runtime-NmIUd3Zu.js +0 -31
- package/dist/core-DGKJP1dm.js +0 -282
- package/dist/core-api-1fA4sNeC.js +0 -5
- package/dist/core-api-BY822Quq.js +0 -2
- package/dist/crestodian-Bp-NXiBC.js +0 -55
- package/dist/daocore-tools-Defpam0j.js +0 -11727
- package/dist/delivery-CEdVAUGB.js +0 -1002
- package/dist/dialogue-CZ69INPq.js +0 -37
- package/dist/dir-fetch-tool-BCicHhQE.js +0 -565
- package/dist/dir-list-tool-Cv_WktsJ.js +0 -100
- package/dist/direct-dm-Bz89rM8x.js +0 -64
- package/dist/directive-handling.fast-lane-DDnbcc5S.js +0 -68
- package/dist/directive-handling.impl-B0H52Ymr.js +0 -818
- package/dist/directive-handling.impl-CgKpwEW-.js +0 -2
- package/dist/directive-handling.model-selection-_cXAr0vt.js +0 -122
- package/dist/directive-handling.persist.runtime-Dw0mfzXT.js +0 -263
- package/dist/dispatch-C3AeYvyP.js +0 -1640
- package/dist/dispatch-acp-transcript.runtime-CP8pqBwS.js +0 -40
- package/dist/dispatch-acp.runtime-Cdap-AZI.js +0 -18
- package/dist/doctor-BZwVH97p.js +0 -2
- package/dist/doctor-BfkGBii1.js +0 -6
- package/dist/doctor-config-flow-D3JASGDt.js +0 -1741
- package/dist/doctor-core-checks-DH5AIT0Q.js +0 -573
- package/dist/doctor-core-checks-DiNu7VSh.js +0 -2
- package/dist/doctor-health-BDIJ-Nro.js +0 -65
- package/dist/doctor-health-contributions-BgmF7w8X.js +0 -696
- package/dist/doctor-lint-uIxkMUSO.js +0 -94
- package/dist/doctor-state-integrity-ws1b_BGk.js +0 -1231
- package/dist/doctor-update-Cx4CqxaX.js +0 -58
- package/dist/dynamic-tools-DiqOxhJh.js +0 -486
- package/dist/embedded-backend-C634irMl.js +0 -579
- package/dist/embedded-gateway-stub.runtime-CCfrTOeN.js +0 -12
- package/dist/exec-approvals-D85KThSg.js +0 -149
- package/dist/file-fetch-tool-BERaGYCT.js +0 -124
- package/dist/file-write-tool-BjHrMyfe.js +0 -127
- package/dist/format-DE9PuPg1.js +0 -1145
- package/dist/gateway-cli-B5hjhbUy.js +0 -435
- package/dist/gateway-method-runtime-Bu0E9Eki.js +0 -21
- package/dist/get-reply-6PtPz9hv.js +0 -4689
- package/dist/get-reply-from-config.runtime-CwprvhoR.js +0 -2
- package/dist/graph-users-DUp1kgnS.js +0 -1419
- package/dist/group-access-D5GBQ3w6.js +0 -112
- package/dist/handle-action.guild-admin-CA0Y-buD.js +0 -288
- package/dist/harness-B5nOFVfm.js +0 -61
- package/dist/health-D5heIDj3.js +0 -4
- package/dist/heartbeat-runner-BzFkIFHh.js +0 -5
- package/dist/heartbeat-runner.runtime-p6H1_xMV.js +0 -4
- package/dist/hooks-BvTyQ14X.js +0 -534
- package/dist/inbound-direct-dm-runtime-DwiDXi8L.js +0 -2
- package/dist/inbound-reply-dispatch-YoDUOC6C.js +0 -148
- package/dist/init-CPtcV5Xu.js +0 -59
- package/dist/inline-buttons-DeD5d42c.js +0 -40
- package/dist/internal-events-DEb50Sw3.js +0 -90
- package/dist/isolated-agent-CcxFFZ-Z.js +0 -1118
- package/dist/isolated-agent-CpHzq5qr.js +0 -2
- package/dist/lifecycle-DNel-oMe.js +0 -571
- package/dist/list.probe-DCa3N25d.js +0 -449
- package/dist/list.status-command-CyeAJmZW.js +0 -789
- package/dist/llm-slug-generator-CyqTY37Z.js +0 -78
- package/dist/local-dispatch.runtime-nE39kFIP.js +0 -9
- package/dist/manager.runtime-CpAPB8D5.js +0 -2714
- package/dist/markdown-to-line-Ci6TRmoZ.js +0 -811
- package/dist/mcp-http-BR0vmxFL.js +0 -2
- package/dist/mcp-http-C0oniA8h.js +0 -555
- package/dist/media-understanding-provider-BwA0XqC3.js +0 -339
- package/dist/message-actions-C9C_Ngkd.js +0 -145
- package/dist/message-handler-CUUKPC5n.js +0 -384
- package/dist/message-handler-xRTfIXWV.js +0 -1715
- package/dist/message-handler.preflight-Ch2Q7V3M.js +0 -1125
- package/dist/message-handler.process-HM3mK93q.js +0 -1484
- package/dist/model-CB8Ex5xS.js +0 -74
- package/dist/model-selection-2s0Dinux.js +0 -272
- package/dist/models-Cn-6DJ41.js +0 -2
- package/dist/models-CzszJD__.js +0 -104
- package/dist/models-cli-CbhElnA5.js +0 -256
- package/dist/monitor-7aprTsMV.js +0 -715
- package/dist/monitor-BuVhqwDS.js +0 -1370
- package/dist/monitor-C4H_YkgY.js +0 -2
- package/dist/monitor-CPQsMxgv.js +0 -1657
- package/dist/monitor-Ce0V1PiR.js +0 -4377
- package/dist/monitor-D0bcGJWI.js +0 -60
- package/dist/monitor-DEjlJqzh.js +0 -834
- package/dist/monitor-auth-DjJZsjgV.js +0 -179
- package/dist/monitor-ikSYagv3.js +0 -2788
- package/dist/monitor-polling.runtime-D7yEflMM.js +0 -883
- package/dist/monitor-webhook.runtime-CIZt-biI.js +0 -387
- package/dist/monitor.account-C2sMOBCS.js +0 -5233
- package/dist/monitor.runtime-BAi6zmcn.js +0 -2
- package/dist/monitor.webhook-BcjpfRCX.js +0 -180
- package/dist/node-cli-sessions-CIhkJRU4.js +0 -1228
- package/dist/openai-http-Dj21RwSj.js +0 -824
- package/dist/openresponses-http-COnnr1ox.js +0 -1173
- package/dist/operations-H3vUh0lM.js +0 -805
- package/dist/outbound-adapter-WLtWE7wv.js +0 -543
- package/dist/outbound-session-route-CZtd64EH.js +0 -45
- package/dist/outbound.runtime-D98P0sN1.js +0 -2
- package/dist/pi-embedded-BWJzd4mK.js +0 -4
- package/dist/pi-embedded-DeNsSqQQ.js +0 -3796
- package/dist/pi-embedded.runtime-CZnNwFpc.js +0 -4
- package/dist/pi-tools-CNHSpjBa.js +0 -2413
- package/dist/plan-B0reFFlM.js +0 -81
- package/dist/plan-CrfF-TH8.js +0 -112
- package/dist/plugin-DI_8eYOe.js +0 -12396
- package/dist/plugin-app-cache-key-WaTUD3e-.js +0 -46
- package/dist/plugin-enabled-aWLXgGGi.js +0 -233
- package/dist/plugin-registration-ByjRIVJm.js +0 -88
- package/dist/plugin-service-VQm_241d.js +0 -1229
- package/dist/policy-BmJH-swe.js +0 -680
- package/dist/policy-DE-bO1zn.js +0 -138
- package/dist/prepare.runtime-bSj3-res.js +0 -732
- package/dist/preview-warnings-CbuGYsF9.js +0 -392
- package/dist/probe-C_rWg7_m.js +0 -682
- package/dist/probe-CagOFfx6.js +0 -2
- package/dist/probe-thX1HqOh.js +0 -2204
- package/dist/probe-zU6B6gFt.js +0 -47
- package/dist/program-BtVdH743.js +0 -131
- package/dist/provider-CDoD7tO0.js +0 -8735
- package/dist/provider-CK1gMdJ2.js +0 -32
- package/dist/provider-DJqr9djy.js +0 -32
- package/dist/provider-DsOJp5bK.js +0 -152
- package/dist/provider-dispatcher-UNQ-LSx9.js +0 -22
- package/dist/provider-session.runtime-DMrkMb4x.js +0 -9
- package/dist/provider.runtime-C2-t3zm8.js +0 -2
- package/dist/public-surface-loader-hTeyyHcd.js +0 -114
- package/dist/pw-ai-BaL3eVYx.js +0 -3029
- package/dist/pw-role-snapshot-DKeBqhN1.js +0 -333
- package/dist/reaction-level-BV2potsD.js +0 -19
- package/dist/reaction-runtime-api-CCBxgM10.js +0 -116
- package/dist/realtime-transcription-provider-CHYtIXZm.js +0 -205
- package/dist/register-BJf28G9B.js +0 -2178
- package/dist/register.agent-oXAHwNQv.js +0 -156
- package/dist/register.crestodian-CQ0sqdV2.js +0 -24
- package/dist/register.maintenance-CylVRs5M.js +0 -83
- package/dist/register.runtime-CcDgwy0X.js +0 -54
- package/dist/register.subclis-CpBYNw2X.js +0 -3
- package/dist/register.subclis-N2CvieOL.js +0 -31
- package/dist/register.subclis-core-BHaGvbzg.js +0 -273
- package/dist/repair-sequencing-EBBnBdIB.js +0 -640
- package/dist/reply-delivery-BLoPALlI.js +0 -196
- package/dist/reply-runtime-D4asNTSa.js +0 -11
- package/dist/reply.runtime-CwprvhoR.js +0 -2
- package/dist/request-DlWPRUDt.js +0 -54
- package/dist/resolve-allowlist-BukQf58x.js +0 -220
- package/dist/result-fallback-classifier-DyHFnqfV.js +0 -79
- package/dist/route-BMf4keN5.js +0 -469
- package/dist/route-resolution-DWNi1QAu.js +0 -274
- package/dist/routes-C20LC8c4.js +0 -3602
- package/dist/routes-CkK7Vv_m.js +0 -2
- package/dist/run-KDF_AEza.js +0 -1162
- package/dist/run-attempt-JHYCfonU.js +0 -7704
- package/dist/run-command-3PVihYIy.js +0 -2
- package/dist/run-command-QHAXnyKY.js +0 -23
- package/dist/run-embedded.runtime-BJw-2vss.js +0 -4
- package/dist/run-execution-cli.runtime-GHClMn2g.js +0 -4
- package/dist/run-subagent-registry.runtime-BLLMrhtE.js +0 -2
- package/dist/runtime-C2u-dC1r.js +0 -1287
- package/dist/runtime-ClyfkDWT.js +0 -6179
- package/dist/runtime-WXCarlPc.js +0 -438
- package/dist/runtime-api-3QhGLpZf.js +0 -13
- package/dist/runtime-api-DRAu3mjv.js +0 -4
- package/dist/runtime-api-JE07pOem.js +0 -13
- package/dist/runtime-api-JuKylHvw.js +0 -24
- package/dist/runtime-api-bcbk4yax.js +0 -21
- package/dist/runtime-api-dDe9U2_V.js +0 -17
- package/dist/runtime-api-uMexLqGS.js +0 -3
- package/dist/runtime-api.actions-Bo7TLDFl.js +0 -3
- package/dist/runtime-api.monitor-7q78L1Em.js +0 -6
- package/dist/runtime-api.send-Bf9RR4nV.js +0 -4
- package/dist/runtime-api.threads-Dj2QuhHj.js +0 -2
- package/dist/runtime-channel-k1C0Satl.js +0 -2
- package/dist/runtime-channel-qt9t0J-J.js +0 -150
- package/dist/runtime-embedded-pi.runtime-BPB9NlTS.js +0 -2
- package/dist/sanitize-outbound-BLH_SQvg.js +0 -127
- package/dist/sdk-setup-tools-BshlBPau.js +0 -8
- package/dist/secrets-CsHXv7d3.js +0 -113
- package/dist/security-audit-CUXBQXNX.js +0 -122
- package/dist/security-audit-CzdXbRma.js +0 -118
- package/dist/security-audit.runtime-Ca0FMFJG.js +0 -2
- package/dist/selection-BmvQJlSD.js +0 -3
- package/dist/selection-BplDXc9w.js +0 -16157
- package/dist/send--qFg8a9v.js +0 -1631
- package/dist/send-BPdryPPA.js +0 -192
- package/dist/send-Bl4YaRkS.js +0 -143
- package/dist/send-Ccm7RMXC.js +0 -2
- package/dist/send.components-c3OUPSmR.js +0 -2
- package/dist/send.components-rhQJYoXs.js +0 -500
- package/dist/send.runtime-dfUkAp5d.js +0 -2
- package/dist/server-DRhyTMLe.js +0 -73
- package/dist/server-Dv4BzjGn.js +0 -24
- package/dist/server-context-4HRJy2vp.js +0 -955
- package/dist/server-context-DlxYb1G5.js +0 -2
- package/dist/server-cron-Bt8Pkc3i.js +0 -2989
- package/dist/server-cron-CtNWsa4Z.js +0 -2
- package/dist/server-methods-rye_okUW.js +0 -16494
- package/dist/server-node-events-C1yZ5a1u.js +0 -596
- package/dist/server-plugin-bootstrap-DUMyVtlP.js +0 -70
- package/dist/server-plugins-B5ZWWkRE.js +0 -432
- package/dist/server-reload-handlers-CTnMXNjT.js +0 -714
- package/dist/server-restart-sentinel-CAYxtwmY.js +0 -747
- package/dist/server-restart-sentinel-DqrtSIvy.js +0 -2
- package/dist/server-runtime-services-CuptQTe5.js +0 -2
- package/dist/server-runtime-services-aaS2IiW3.js +0 -267
- package/dist/server-startup-plugins-D0ymJgQT.js +0 -113
- package/dist/server-startup-post-attach-DlrN2uyt.js +0 -716
- package/dist/server-ws-runtime-CdpLbv4o.js +0 -349
- package/dist/server.impl-Cb4qcMTg.js +0 -2586
- package/dist/service-qxvDlMQE.js +0 -1446
- package/dist/session-binding-6bLobLHL.js +0 -219
- package/dist/session-binding-Bm6fCpoY.js +0 -2
- package/dist/session-kill-http-B6WjVo8V.js +0 -121
- package/dist/session-reset-service-GUVIhxp4.js +0 -625
- package/dist/session-route-BcRDnvzG.js +0 -93
- package/dist/session-status.runtime-BcjOunV4.js +0 -2
- package/dist/session-subagent-reactivation.runtime-BSmk_KYn.js +0 -2
- package/dist/session-tab-registry-BBYzbSOu.js +0 -521
- package/dist/sessions-history-http-bLJJfgLm.js +0 -430
- package/dist/sessions.runtime-DNRtQzCk.js +0 -2
- package/dist/setup-api-CcolVVJs.js +0 -29
- package/dist/setup-core-eJD18F3B.js +0 -174
- package/dist/setup-surface-B75C2Qtz.js +0 -221
- package/dist/setup-surface-CFuPfVHp.js +0 -405
- package/dist/setup-surface-Dyy-Mzyz.js +0 -288
- package/dist/setup-surface-ZsVF_g8W.js +0 -320
- package/dist/shared-BkCNrcLX.js +0 -121
- package/dist/shared-client-B7zqC9p2.js +0 -2
- package/dist/shared-client-yXjKgZBz.js +0 -629
- package/dist/side-question-DU3gESCb.js +0 -683
- package/dist/skill-tool-dispatch.runtime-CPBuqyvk.js +0 -143
- package/dist/slash-state-Do3bAahA.js +0 -2166
- package/dist/speech-provider-Bg9los3C.js +0 -184
- package/dist/src-D7LzUctH.js +0 -4256
- package/dist/startup-context-CCF2gIOl.js +0 -313
- package/dist/status-subagents.runtime-DX5FTymp.js +0 -18
- package/dist/status-text-B-1u5dSV.js +0 -296
- package/dist/sticker-cache-DwpU_9RJ.js +0 -206
- package/dist/sticker-vision.runtime-Bbldi_YL.js +0 -17
- package/dist/subagent-announce-BCo0VHVL.js +0 -354
- package/dist/subagent-announce-delivery-JcnuDN_N.js +0 -958
- package/dist/subagent-control-BzbA3Suz.js +0 -508
- package/dist/subagent-hooks-BIGZQWrG.js +0 -2
- package/dist/subagent-hooks-Bj4qYZfv.js +0 -230
- package/dist/subagent-hooks-C-rvhVBv.js +0 -2
- package/dist/subagent-hooks-P01_AFl5.js +0 -116
- package/dist/subagent-hooks-VEfak8nl.js +0 -2
- package/dist/subagent-hooks-api-BPnSxxN4.js +0 -23
- package/dist/subagent-hooks-api-DwIAvMoS.js +0 -22
- package/dist/subagent-hooks-api-kgyR9FOb.js +0 -23
- package/dist/subagent-hooks-oED56wqq.js +0 -146
- package/dist/subagent-orphan-recovery-D79ZzwKN.js +0 -352
- package/dist/subagent-registry-D0soBT5j.js +0 -2351
- package/dist/subagent-registry-DRJDkmty.js +0 -3
- package/dist/subagent-session-cleanup-9eAO1aJe.js +0 -525
- package/dist/subagent-spawn-D80vbogm.js +0 -1164
- package/dist/target-id-COLv5LsJ.js +0 -107
- package/dist/targets-CDW5IQ6a.js +0 -44
- package/dist/targets-Ci6O1ZdP.js +0 -19
- package/dist/targets-CsaWFBg1.js +0 -19
- package/dist/testing-BoJit-h1.js +0 -267
- package/dist/thread-bindings-CGCvw0KT.js +0 -571
- package/dist/thread-bindings-ClCTNacX.js +0 -228
- package/dist/thread-bindings-DRb7BMZ6.js +0 -8
- package/dist/thread-bindings-Xc6smav0.js +0 -232
- package/dist/thread-bindings.discord-api-DC467oeF.js +0 -187
- package/dist/thread-bindings.manager-C_mpTDIZ.js +0 -536
- package/dist/thread-bindings.manager-DkCRs612.js +0 -2
- package/dist/thread-lifecycle-DpqCXlx9.js +0 -1614
- package/dist/token-CI6HjbTA.js +0 -134
- package/dist/tool-BMe7hjBK.js +0 -139
- package/dist/tool-actions.runtime-D-h5PI_m.js +0 -534
- package/dist/tool-resolution-CnLx0CHe.js +0 -149
- package/dist/tools-effective-inventory-BR6MUMtE.js +0 -204
- package/dist/tools-invoke-http-CTTs2yMT.js +0 -67
- package/dist/tools-invoke-shared-9B1EjXWf.js +0 -200
- package/dist/tts-eGOviZ5c.js +0 -66
- package/dist/tui-Bw0HqKd7.js +0 -4709
- package/dist/tui-CIZJnPzj.js +0 -2
- package/dist/tui-backend-BJ_r7tcF.js +0 -256
- package/dist/tui-cli-BaSMBpuA.js +0 -37
- package/dist/update-cli-zuCybGNR.js +0 -3664
- package/dist/update-runner-Dek2BHmQ.js +0 -2379
- package/dist/vision-tools-1ps0BEE5.js +0 -1409
- package/dist/web-search-B7EziZXE.js +0 -62
- package/dist/web-search-provider.runtime-DGTCvGch.js +0 -328
- package/dist/web-search-provider.runtime-DWL5t39M.js +0 -2
- package/dist/xai-oauth-CRtsj2Gs.js +0 -479
- package/dist/xai-user-agent-Dndwzw2S.js +0 -32
- /package/dist/{acp-runtime-backend-DSDBcyh9.js → acp-runtime-backend-Cxo7eBHf.js} +0 -0
- /package/dist/{channel-actions-FV66JqtI.js → channel-actions-UDeVjgGz.js} +0 -0
- /package/dist/{command-status-runtime-BRWKSoG7.js → command-status-runtime-CoHd4Fws.js} +0 -0
- /package/dist/{delegate-DGqKhwB4.js → delegate-B-2xZ77o.js} +0 -0
- /package/dist/{dispatch-acp-Ceoxja_Z.js → dispatch-acp-DLPkmK7K.js} +0 -0
- /package/dist/{heartbeat-runner-CJHvr5pG.js → heartbeat-runner-D2j6JwOI.js} +0 -0
- /package/dist/{library-Bq3aDek_.js → library-DBT0cIPP.js} +0 -0
- /package/dist/{run-executor.runtime-DNJhGPbA.js → run-executor.runtime-DE4J7f4M.js} +0 -0
- /package/dist/{shared-CYxmRpq1.js → shared-xeo8Yh5n.js} +0 -0
|
@@ -1,1231 +0,0 @@
|
|
|
1
|
-
import { c as normalizeOptionalString, s as normalizeOptionalLowercaseString } from "./string-coerce-DyL154ka.js";
|
|
2
|
-
import { o as resolveRequiredHomeDir } from "./home-dir-Bs0GlzoJ.js";
|
|
3
|
-
import { g as resolveOAuthDir, v as resolveStateDir } from "./paths-ZwPDM6zn.js";
|
|
4
|
-
import { t as formatCliCommand } from "./command-format-tWmMYcvZ.js";
|
|
5
|
-
import { g as shortenHomePath } from "./utils-CNnMhEDp.js";
|
|
6
|
-
import { r as normalizeProviderId } from "./provider-id-zTW9Rdln.js";
|
|
7
|
-
import { r as resolveAgentModelFallbackValues } from "./model-input-ChW9XXsQ.js";
|
|
8
|
-
import { u as resolveAgentModelFallbacksOverride } from "./agent-scope-Dx1S0aWX.js";
|
|
9
|
-
import { a as isSubagentSessionKey, c as parseAgentSessionKey } from "./session-key-utils-Ce_xWkNq.js";
|
|
10
|
-
import { d as resolveAgentIdFromSessionKey, l as normalizeAgentId, v as toAgentStoreSessionKey } from "./session-key-Bte0mmcq.js";
|
|
11
|
-
import { c as resolveDefaultAgentId, n as listAgentIds, r as resolveAgentConfig, t as listAgentEntries } from "./agent-scope-config-CJUQxn7u.js";
|
|
12
|
-
import { t as resolveAgentHarnessPolicy } from "./policy-DqVcSoDg.js";
|
|
13
|
-
import { t as asNullableObjectRecord } from "./record-coerce-aMlBWINm.js";
|
|
14
|
-
import { i as resolveMainSessionKey, t as canonicalizeMainSessionAlias } from "./main-session-D3q_5w0B.js";
|
|
15
|
-
import { r as isPrimarySessionTranscriptFileName, t as formatSessionArchiveTimestamp } from "./artifacts-BZhcmsUl.js";
|
|
16
|
-
import { a as resolveSessionFilePathOptions, i as resolveSessionFilePath, l as resolveSessionTranscriptsDirForAgent, u as resolveStorePath } from "./paths-8MFrTNIB.js";
|
|
17
|
-
import { t as loadSessionStore } from "./store-load-B817r-3Z.js";
|
|
18
|
-
import { u as updateSessionStore } from "./store-C4uyNaPD.js";
|
|
19
|
-
import { i as parseModelRef, n as modelKey } from "./model-selection-normalize-DLmoprpp.js";
|
|
20
|
-
import { s as resolveDefaultModelForAgent } from "./model-selection-D1TyOrqK.js";
|
|
21
|
-
import { i as isSubagentRecoveryWedgedEntry, r as formatSubagentRecoveryWedgedReason, t as clearWedgedSubagentRecoveryAbort } from "./subagent-recovery-state-Bz-c9nEo.js";
|
|
22
|
-
import "./selection-BplDXc9w.js";
|
|
23
|
-
import { n as isHeartbeatOkResponse, r as isHeartbeatUserMessage } from "./heartbeat-filter-B0XYZgGB.js";
|
|
24
|
-
import { n as resolveHeartbeatIntervalMs } from "./heartbeat-summary-D4s-V11G.js";
|
|
25
|
-
import { f as listConfiguredChannelIdsForReadOnlyScope } from "./channel-plugin-ids-l7ScZ28F.js";
|
|
26
|
-
import { t as resolveHeartbeatDeliveryTarget } from "./targets-DIYZ3VNP.js";
|
|
27
|
-
import { t as resolveDaoCoreAgentDir } from "./agent-dir-compat-X9XMR4LI.js";
|
|
28
|
-
import { t as note } from "./note-CbITX52o.js";
|
|
29
|
-
import { t as resolveMemoryBackendConfig } from "./backend-config-Dgzzeq8z.js";
|
|
30
|
-
import "./engine-storage-CGtcXK3z.js";
|
|
31
|
-
import { a as listPluginDoctorSessionRouteStateOwners } from "./doctor-contract-registry-DG39WvaV.js";
|
|
32
|
-
import fs from "node:fs";
|
|
33
|
-
import path from "node:path";
|
|
34
|
-
import os from "node:os";
|
|
35
|
-
//#region src/commands/doctor-heartbeat-main-session-repair.ts
|
|
36
|
-
function countLabel$2(count, singular, plural = `${singular}s`) {
|
|
37
|
-
return `${count} ${count === 1 ? singular : plural}`;
|
|
38
|
-
}
|
|
39
|
-
function existsFile$1(filePath) {
|
|
40
|
-
try {
|
|
41
|
-
return fs.existsSync(filePath) && fs.statSync(filePath).isFile();
|
|
42
|
-
} catch {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function sessionEntryHasSyntheticHeartbeatOwnership(entry) {
|
|
47
|
-
return typeof entry.heartbeatIsolatedBaseSessionKey === "string" && entry.heartbeatIsolatedBaseSessionKey.trim().length > 0;
|
|
48
|
-
}
|
|
49
|
-
function parseTranscriptMessageLine(line) {
|
|
50
|
-
let parsed;
|
|
51
|
-
try {
|
|
52
|
-
parsed = JSON.parse(line);
|
|
53
|
-
} catch {
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
const record = asNullableObjectRecord(parsed);
|
|
57
|
-
if (!record) return null;
|
|
58
|
-
const message = asNullableObjectRecord(record.message) ?? record;
|
|
59
|
-
const role = message.role;
|
|
60
|
-
if (typeof role !== "string") return null;
|
|
61
|
-
return {
|
|
62
|
-
role,
|
|
63
|
-
content: message.content
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
function summarizeTranscriptHeartbeatMessages(transcriptPath) {
|
|
67
|
-
let raw;
|
|
68
|
-
try {
|
|
69
|
-
raw = fs.readFileSync(transcriptPath, "utf8");
|
|
70
|
-
} catch {
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
const summary = {
|
|
74
|
-
inspectedMessages: 0,
|
|
75
|
-
userMessages: 0,
|
|
76
|
-
heartbeatUserMessages: 0,
|
|
77
|
-
nonHeartbeatUserMessages: 0,
|
|
78
|
-
assistantMessages: 0,
|
|
79
|
-
heartbeatOkAssistantMessages: 0
|
|
80
|
-
};
|
|
81
|
-
for (const line of raw.split(/\r?\n/)) {
|
|
82
|
-
const trimmed = line.trim();
|
|
83
|
-
if (!trimmed) continue;
|
|
84
|
-
const message = parseTranscriptMessageLine(trimmed);
|
|
85
|
-
if (!message) continue;
|
|
86
|
-
summary.inspectedMessages += 1;
|
|
87
|
-
if (message.role === "user") {
|
|
88
|
-
summary.userMessages += 1;
|
|
89
|
-
if (isHeartbeatUserMessage(message)) summary.heartbeatUserMessages += 1;
|
|
90
|
-
else summary.nonHeartbeatUserMessages += 1;
|
|
91
|
-
} else if (message.role === "assistant") {
|
|
92
|
-
summary.assistantMessages += 1;
|
|
93
|
-
if (isHeartbeatOkResponse(message)) summary.heartbeatOkAssistantMessages += 1;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return summary.inspectedMessages > 0 ? summary : null;
|
|
97
|
-
}
|
|
98
|
-
function resolveHeartbeatMainSessionRepairCandidate(params) {
|
|
99
|
-
const { entry, transcriptPath } = params;
|
|
100
|
-
if (!entry) return null;
|
|
101
|
-
if (!(entry.lastInteractionAt === void 0)) return null;
|
|
102
|
-
const hasSyntheticHeartbeatOwnership = sessionEntryHasSyntheticHeartbeatOwnership(entry);
|
|
103
|
-
if (hasSyntheticHeartbeatOwnership && !transcriptPath) return { reason: "metadata" };
|
|
104
|
-
if (!transcriptPath) return null;
|
|
105
|
-
const summary = summarizeTranscriptHeartbeatMessages(transcriptPath);
|
|
106
|
-
if (!summary) return null;
|
|
107
|
-
if (summary.heartbeatUserMessages > 0 && summary.userMessages === summary.heartbeatUserMessages && summary.nonHeartbeatUserMessages === 0) return {
|
|
108
|
-
reason: hasSyntheticHeartbeatOwnership ? "metadata" : "transcript",
|
|
109
|
-
summary
|
|
110
|
-
};
|
|
111
|
-
return null;
|
|
112
|
-
}
|
|
113
|
-
function resolveHeartbeatMainRecoveryKey(params) {
|
|
114
|
-
const parsed = parseAgentSessionKey(params.mainKey);
|
|
115
|
-
if (!parsed) return null;
|
|
116
|
-
const stamp = formatSessionArchiveTimestamp(params.nowMs).toLowerCase();
|
|
117
|
-
const base = `agent:${parsed.agentId}:heartbeat-recovered-${stamp}`;
|
|
118
|
-
if (!params.store[base]) return base;
|
|
119
|
-
for (let index = 2; index <= 100; index += 1) {
|
|
120
|
-
const candidate = `${base}-${index}`;
|
|
121
|
-
if (!params.store[candidate]) return candidate;
|
|
122
|
-
}
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
function moveHeartbeatMainSessionEntry(params) {
|
|
126
|
-
const entry = params.store[params.mainKey];
|
|
127
|
-
if (!entry || params.store[params.recoveredKey]) return false;
|
|
128
|
-
params.store[params.recoveredKey] = entry;
|
|
129
|
-
delete params.store[params.mainKey];
|
|
130
|
-
return true;
|
|
131
|
-
}
|
|
132
|
-
function resolveTuiLastSessionPath(stateDir) {
|
|
133
|
-
return path.join(stateDir, "tui", "last-session.json");
|
|
134
|
-
}
|
|
135
|
-
function clearTuiLastSessionPointers(params) {
|
|
136
|
-
if (params.sessionKeys.size === 0 || !existsFile$1(params.filePath)) return 0;
|
|
137
|
-
let parsed;
|
|
138
|
-
try {
|
|
139
|
-
parsed = JSON.parse(fs.readFileSync(params.filePath, "utf8"));
|
|
140
|
-
} catch {
|
|
141
|
-
return 0;
|
|
142
|
-
}
|
|
143
|
-
const store = asNullableObjectRecord(parsed);
|
|
144
|
-
if (!store) return 0;
|
|
145
|
-
let removed = 0;
|
|
146
|
-
const next = {};
|
|
147
|
-
for (const [key, value] of Object.entries(store)) {
|
|
148
|
-
const sessionKey = asNullableObjectRecord(value)?.sessionKey;
|
|
149
|
-
if (typeof sessionKey === "string" && params.sessionKeys.has(sessionKey)) {
|
|
150
|
-
removed += 1;
|
|
151
|
-
continue;
|
|
152
|
-
}
|
|
153
|
-
next[key] = value;
|
|
154
|
-
}
|
|
155
|
-
if (removed === 0) return 0;
|
|
156
|
-
try {
|
|
157
|
-
fs.writeFileSync(params.filePath, `${JSON.stringify(next, null, 2)}\n`, { mode: 384 });
|
|
158
|
-
} catch {
|
|
159
|
-
return 0;
|
|
160
|
-
}
|
|
161
|
-
return removed;
|
|
162
|
-
}
|
|
163
|
-
async function repairHeartbeatPoisonedMainSession(params) {
|
|
164
|
-
const mainKey = resolveMainSessionKey(params.cfg);
|
|
165
|
-
const mainEntry = params.store[mainKey];
|
|
166
|
-
if (!mainEntry?.sessionId) return;
|
|
167
|
-
let transcriptPath;
|
|
168
|
-
try {
|
|
169
|
-
transcriptPath = resolveSessionFilePath(mainEntry.sessionId, mainEntry, params.sessionPathOpts);
|
|
170
|
-
} catch {
|
|
171
|
-
transcriptPath = void 0;
|
|
172
|
-
}
|
|
173
|
-
const candidate = resolveHeartbeatMainSessionRepairCandidate({
|
|
174
|
-
entry: mainEntry,
|
|
175
|
-
transcriptPath
|
|
176
|
-
});
|
|
177
|
-
if (!candidate) return;
|
|
178
|
-
const recoveredKey = resolveHeartbeatMainRecoveryKey({
|
|
179
|
-
mainKey,
|
|
180
|
-
store: params.store
|
|
181
|
-
});
|
|
182
|
-
if (!recoveredKey) {
|
|
183
|
-
params.warnings.push(`- Main session ${mainKey} appears heartbeat-owned, but doctor could not choose a safe recovery key.`);
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
const reason = candidate.reason === "metadata" ? "heartbeat metadata" : `${candidate.summary?.heartbeatUserMessages ?? 0} heartbeat-only user message(s)`;
|
|
187
|
-
params.warnings.push([`- Main session ${mainKey} appears to be a heartbeat-owned session (${reason}).`, ` Doctor can move it to ${recoveredKey} and let the next interactive launch create a fresh main session.`].join("\n"));
|
|
188
|
-
if (!await params.prompter.confirmRuntimeRepair({
|
|
189
|
-
message: `Move heartbeat-owned main session ${mainKey} to ${recoveredKey} and clear stale TUI restore pointers?`,
|
|
190
|
-
initialValue: true
|
|
191
|
-
})) return;
|
|
192
|
-
let movedEntry;
|
|
193
|
-
await updateSessionStore(params.absoluteStorePath, (currentStore) => {
|
|
194
|
-
const currentEntry = currentStore[mainKey];
|
|
195
|
-
if (!resolveHeartbeatMainSessionRepairCandidate({
|
|
196
|
-
entry: currentEntry,
|
|
197
|
-
transcriptPath
|
|
198
|
-
})) return;
|
|
199
|
-
if (moveHeartbeatMainSessionEntry({
|
|
200
|
-
store: currentStore,
|
|
201
|
-
mainKey,
|
|
202
|
-
recoveredKey
|
|
203
|
-
})) movedEntry = currentEntry;
|
|
204
|
-
});
|
|
205
|
-
if (!movedEntry) {
|
|
206
|
-
params.warnings.push(`- Main session ${mainKey} changed before repair could move it.`);
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
params.store[recoveredKey] = movedEntry;
|
|
210
|
-
delete params.store[mainKey];
|
|
211
|
-
const clearedPointers = clearTuiLastSessionPointers({
|
|
212
|
-
filePath: resolveTuiLastSessionPath(params.stateDir),
|
|
213
|
-
sessionKeys: new Set([mainKey])
|
|
214
|
-
});
|
|
215
|
-
params.changes.push(`- Moved heartbeat-owned main session ${mainKey} to ${recoveredKey}.`);
|
|
216
|
-
if (clearedPointers > 0) params.changes.push(`- Cleared ${countLabel$2(clearedPointers, "stale TUI last-session pointer")} for ${mainKey}.`);
|
|
217
|
-
}
|
|
218
|
-
//#endregion
|
|
219
|
-
//#region src/commands/doctor-heartbeat-session-target.ts
|
|
220
|
-
function hasExplicitHeartbeatAgents(cfg) {
|
|
221
|
-
return listAgentEntries(cfg).some((entry) => Boolean(entry?.heartbeat));
|
|
222
|
-
}
|
|
223
|
-
function resolveHeartbeatConfig(cfg, agentId) {
|
|
224
|
-
const defaults = cfg.agents?.defaults?.heartbeat;
|
|
225
|
-
const overrides = resolveAgentConfig(cfg, agentId)?.heartbeat;
|
|
226
|
-
if (!defaults && !overrides) return overrides;
|
|
227
|
-
return {
|
|
228
|
-
...defaults,
|
|
229
|
-
...overrides
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
function listHeartbeatDoctorAgents(cfg) {
|
|
233
|
-
if (hasExplicitHeartbeatAgents(cfg)) return listAgentEntries(cfg).filter((entry) => entry?.heartbeat).map((entry) => normalizeAgentId(entry.id)).filter((agentId) => agentId);
|
|
234
|
-
if (cfg.agents?.defaults?.heartbeat) return listAgentIds(cfg);
|
|
235
|
-
return [];
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Detect heartbeat configs that pin a non-existent session. The runtime
|
|
239
|
-
* resolves `heartbeat.session` to a sessionKey via `resolveHeartbeatSession`;
|
|
240
|
-
* if the entry is missing, `resolveHeartbeatDeliveryTarget` falls back to
|
|
241
|
-
* `{channel:"none", reason:"no-target"}` and the heartbeat fires a model
|
|
242
|
-
* call whose reply has nowhere to land. Common cause: the configured Slack
|
|
243
|
-
* channel ID does not match any channel the agent has ever joined (e.g.,
|
|
244
|
-
* heartbeat pins channel `c0b2eddpw95` but the agent only has sessions in
|
|
245
|
-
* `c0ag7jag35g`, or the agent has no Slack bot at all).
|
|
246
|
-
*
|
|
247
|
-
* Warning only — repair would mean rewriting the config, which is the
|
|
248
|
-
* operator's intent to express.
|
|
249
|
-
*/
|
|
250
|
-
function describeHeartbeatSessionTargetIssues(cfg) {
|
|
251
|
-
const warnings = [];
|
|
252
|
-
const sessionScope = cfg.session?.scope ?? "per-sender";
|
|
253
|
-
for (const agentId of listHeartbeatDoctorAgents(cfg)) {
|
|
254
|
-
if (!agentId) continue;
|
|
255
|
-
const resolvedAgentId = normalizeAgentId(agentId);
|
|
256
|
-
const heartbeatConfig = resolveHeartbeatConfig(cfg, resolvedAgentId);
|
|
257
|
-
if (!heartbeatConfig) continue;
|
|
258
|
-
if (!resolveHeartbeatIntervalMs(cfg, void 0, heartbeatConfig)) continue;
|
|
259
|
-
const configuredSession = normalizeOptionalString(heartbeatConfig.session);
|
|
260
|
-
if (!configuredSession) continue;
|
|
261
|
-
const normalizedSession = configuredSession.toLowerCase();
|
|
262
|
-
if (normalizedSession === "main" || normalizedSession === "global") continue;
|
|
263
|
-
if (isSubagentSessionKey(configuredSession)) continue;
|
|
264
|
-
if (sessionScope === "global") continue;
|
|
265
|
-
const target = normalizeOptionalString(heartbeatConfig.target);
|
|
266
|
-
if (!target || target === "none") continue;
|
|
267
|
-
const deliveryWithoutSession = resolveHeartbeatDeliveryTarget({
|
|
268
|
-
cfg,
|
|
269
|
-
heartbeat: heartbeatConfig
|
|
270
|
-
});
|
|
271
|
-
if (deliveryWithoutSession.channel !== "none" && deliveryWithoutSession.to) continue;
|
|
272
|
-
const candidateSession = toAgentStoreSessionKey({
|
|
273
|
-
agentId: resolvedAgentId,
|
|
274
|
-
requestKey: configuredSession,
|
|
275
|
-
mainKey: cfg.session?.mainKey
|
|
276
|
-
});
|
|
277
|
-
if (isSubagentSessionKey(candidateSession)) continue;
|
|
278
|
-
const canonicalSession = canonicalizeMainSessionAlias({
|
|
279
|
-
cfg,
|
|
280
|
-
agentId: resolvedAgentId,
|
|
281
|
-
sessionKey: candidateSession
|
|
282
|
-
});
|
|
283
|
-
if (canonicalSession === "global" || isSubagentSessionKey(canonicalSession) || resolveAgentIdFromSessionKey(canonicalSession) !== resolvedAgentId) continue;
|
|
284
|
-
const storeAgentId = resolvedAgentId;
|
|
285
|
-
const storePath = resolveStorePath(cfg.session?.store, { agentId: storeAgentId });
|
|
286
|
-
if (loadSessionStore(storePath)[canonicalSession]) continue;
|
|
287
|
-
warnings.push([
|
|
288
|
-
`- Agent ${agentId} heartbeat.session pins ${configuredSession} (resolved to ${canonicalSession}) but that session has no entry in ${storePath}.`,
|
|
289
|
-
` Heartbeats will run but resolve delivery to channel="none"/reason="no-target", so replies are dropped silently.`,
|
|
290
|
-
` Fix: point heartbeat.session at a session the agent actually owns, set heartbeat.target="none" to suppress delivery, or remove the heartbeat.session field to fall back to the agent main session.`
|
|
291
|
-
].join("\n"));
|
|
292
|
-
}
|
|
293
|
-
return warnings;
|
|
294
|
-
}
|
|
295
|
-
//#endregion
|
|
296
|
-
//#region src/commands/doctor-session-state-providers.ts
|
|
297
|
-
function countLabel$1(count, singular, plural = `${singular}s`) {
|
|
298
|
-
return `${count} ${count === 1 ? singular : plural}`;
|
|
299
|
-
}
|
|
300
|
-
function normalizeString(value) {
|
|
301
|
-
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
302
|
-
}
|
|
303
|
-
function normalizeIdSet(values) {
|
|
304
|
-
return new Set((values ?? []).map((value) => normalizeProviderId(value)));
|
|
305
|
-
}
|
|
306
|
-
function normalizePrefixList(values) {
|
|
307
|
-
return (values ?? []).map((value) => value.trim().toLowerCase()).filter(Boolean);
|
|
308
|
-
}
|
|
309
|
-
function ownsPrefixedValue(prefixes, value) {
|
|
310
|
-
const normalized = normalizeString(value)?.toLowerCase();
|
|
311
|
-
return normalized !== void 0 && prefixes.some((prefix) => normalized.startsWith(prefix));
|
|
312
|
-
}
|
|
313
|
-
function countSessionLabel(count) {
|
|
314
|
-
return countLabel$1(count, "session");
|
|
315
|
-
}
|
|
316
|
-
function repairExample(repair) {
|
|
317
|
-
return `${repair.key} (${repair.reasons.join(", ")})`;
|
|
318
|
-
}
|
|
319
|
-
function resolveSessionAgentId(cfg, sessionKey) {
|
|
320
|
-
return parseAgentSessionKey(sessionKey)?.agentId ?? resolveDefaultAgentId(cfg);
|
|
321
|
-
}
|
|
322
|
-
function resolveConfiguredDoctorSessionStateRoute(params) {
|
|
323
|
-
const agentId = resolveSessionAgentId(params.cfg, params.sessionKey);
|
|
324
|
-
const primary = resolveDefaultModelForAgent({
|
|
325
|
-
cfg: params.cfg,
|
|
326
|
-
agentId
|
|
327
|
-
});
|
|
328
|
-
const configuredModelRefs = /* @__PURE__ */ new Set();
|
|
329
|
-
const addRef = (provider, model) => {
|
|
330
|
-
configuredModelRefs.add(modelKey(provider, model));
|
|
331
|
-
};
|
|
332
|
-
addRef(primary.provider, primary.model);
|
|
333
|
-
const fallbacks = resolveAgentModelFallbacksOverride(params.cfg, agentId) ?? resolveAgentModelFallbackValues(params.cfg.agents?.defaults?.model);
|
|
334
|
-
for (const fallback of fallbacks) {
|
|
335
|
-
const parsed = parseModelRef(fallback, primary.provider, { allowPluginNormalization: false });
|
|
336
|
-
if (parsed) addRef(parsed.provider, parsed.model);
|
|
337
|
-
}
|
|
338
|
-
const runtime = resolveAgentHarnessPolicy({
|
|
339
|
-
provider: primary.provider,
|
|
340
|
-
modelId: primary.model,
|
|
341
|
-
config: params.cfg,
|
|
342
|
-
agentId,
|
|
343
|
-
sessionKey: params.sessionKey
|
|
344
|
-
}).runtime;
|
|
345
|
-
return {
|
|
346
|
-
defaultProvider: primary.provider,
|
|
347
|
-
configuredModelRefs: [...configuredModelRefs],
|
|
348
|
-
runtime
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
function resolvePluginDoctorSessionRouteStateOwners(params) {
|
|
352
|
-
return listPluginDoctorSessionRouteStateOwners({
|
|
353
|
-
config: params.cfg,
|
|
354
|
-
env: params.env
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
function entryMayContainPluginSessionRouteState(entry) {
|
|
358
|
-
const record = entry;
|
|
359
|
-
return normalizeString(record.providerOverride) !== void 0 || normalizeString(record.modelOverride) !== void 0 || normalizeString(record.modelOverrideSource) !== void 0 || record.liveModelSwitchPending !== void 0 || normalizeString(record.modelProvider) !== void 0 || normalizeString(record.model) !== void 0 || normalizeString(record.agentHarnessId) !== void 0 || normalizeString(record.agentRuntimeOverride) !== void 0 || record.cliSessionBindings !== void 0 || record.cliSessionIds !== void 0 || normalizeString(record.authProfileOverride) !== void 0 || normalizeString(record.authProfileOverrideSource) !== void 0;
|
|
360
|
-
}
|
|
361
|
-
function storeMayContainPluginSessionRouteState(store) {
|
|
362
|
-
return Object.values(store).some((entry) => entryMayContainPluginSessionRouteState(entry));
|
|
363
|
-
}
|
|
364
|
-
function resolvePersistedOverrideModelRef(params) {
|
|
365
|
-
const overrideModel = normalizeString(params.overrideModel);
|
|
366
|
-
if (!overrideModel) return null;
|
|
367
|
-
const overrideProvider = normalizeString(params.overrideProvider);
|
|
368
|
-
return parseModelRef(overrideProvider ? `${overrideProvider}/${overrideModel}` : overrideModel, params.defaultProvider, { allowPluginNormalization: false });
|
|
369
|
-
}
|
|
370
|
-
function addReason(reasons, reason) {
|
|
371
|
-
if (!reasons.includes(reason)) reasons.push(reason);
|
|
372
|
-
}
|
|
373
|
-
function routeAllowsOwnerState(params) {
|
|
374
|
-
const providerIds = normalizeIdSet(params.owner.providerIds);
|
|
375
|
-
const runtimeIds = normalizeIdSet(params.owner.runtimeIds);
|
|
376
|
-
const routeRuntime = normalizeString(params.route?.runtime);
|
|
377
|
-
if (routeRuntime && runtimeIds.has(normalizeProviderId(routeRuntime))) return true;
|
|
378
|
-
return params.route?.configuredModelRefs.some((ref) => {
|
|
379
|
-
const slash = ref.indexOf("/");
|
|
380
|
-
return slash > 0 && providerIds.has(normalizeProviderId(ref.slice(0, slash)));
|
|
381
|
-
}) ?? false;
|
|
382
|
-
}
|
|
383
|
-
function hasOwnedCliSession(params) {
|
|
384
|
-
const bindings = params.entry.cliSessionBindings;
|
|
385
|
-
const ids = params.entry.cliSessionIds;
|
|
386
|
-
return params.cliSessionKeys.some((key) => {
|
|
387
|
-
const normalized = normalizeProviderId(key);
|
|
388
|
-
return bindings !== null && typeof bindings === "object" && normalized in bindings && bindings[normalized] !== void 0 || ids !== null && typeof ids === "object" && normalized in ids && ids[normalized] !== void 0;
|
|
389
|
-
});
|
|
390
|
-
}
|
|
391
|
-
function modelRefKey(provider, model) {
|
|
392
|
-
return modelKey(provider, model).toLowerCase();
|
|
393
|
-
}
|
|
394
|
-
function scanEntryForOwner(params) {
|
|
395
|
-
const providerIds = normalizeIdSet(params.owner.providerIds);
|
|
396
|
-
const runtimeIds = normalizeIdSet(params.owner.runtimeIds);
|
|
397
|
-
const cliSessionKeys = [...normalizeIdSet(params.owner.cliSessionKeys)];
|
|
398
|
-
const authProfilePrefixes = normalizePrefixList(params.owner.authProfilePrefixes);
|
|
399
|
-
const routeAllowsOwner = routeAllowsOwnerState({
|
|
400
|
-
owner: params.owner,
|
|
401
|
-
route: params.route
|
|
402
|
-
});
|
|
403
|
-
const routeRuntime = normalizeString(params.route?.runtime);
|
|
404
|
-
const routeAllowsOwnerRuntime = routeRuntime !== void 0 && runtimeIds.has(normalizeProviderId(routeRuntime));
|
|
405
|
-
const reasons = [];
|
|
406
|
-
const pinnedRuntimeKeys = [];
|
|
407
|
-
const directOverride = resolvePersistedOverrideModelRef({
|
|
408
|
-
defaultProvider: params.route?.defaultProvider ?? "",
|
|
409
|
-
overrideProvider: params.entry.providerOverride,
|
|
410
|
-
overrideModel: params.entry.modelOverride
|
|
411
|
-
});
|
|
412
|
-
const directOverrideKey = directOverride ? modelRefKey(directOverride.provider, directOverride.model) : void 0;
|
|
413
|
-
const directOverrideIsOwned = directOverride !== null && providerIds.has(normalizeProviderId(directOverride.provider));
|
|
414
|
-
const directOverrideIsConfigured = directOverrideKey !== void 0 && (params.route?.configuredModelRefs.some((ref) => ref.toLowerCase() === directOverrideKey) ?? false);
|
|
415
|
-
const directOverrideSource = params.entry.modelOverrideSource === "user" ? "user" : params.entry.modelOverrideSource === "auto" ? "auto" : params.entry.modelOverride ? "legacy" : void 0;
|
|
416
|
-
if (directOverrideIsOwned && !directOverrideIsConfigured) {
|
|
417
|
-
if (directOverrideSource === "auto") addReason(reasons, "auto model override");
|
|
418
|
-
else if (!routeAllowsOwner && directOverride) return { manualReview: {
|
|
419
|
-
key: params.key,
|
|
420
|
-
ownerLabel: params.owner.label,
|
|
421
|
-
message: `${params.key} (${modelRefKey(directOverride.provider, directOverride.model)}, ${directOverrideSource === "user" ? "user" : "legacy"})`
|
|
422
|
-
} };
|
|
423
|
-
}
|
|
424
|
-
const explicitOwnedOverride = directOverrideIsOwned && directOverrideSource !== void 0 && directOverrideSource !== "auto";
|
|
425
|
-
if (!routeAllowsOwnerRuntime && !explicitOwnedOverride) {
|
|
426
|
-
const harnessId = normalizeString(params.entry.agentHarnessId);
|
|
427
|
-
if (harnessId && runtimeIds.has(normalizeProviderId(harnessId))) {
|
|
428
|
-
addReason(reasons, "pinned runtime");
|
|
429
|
-
pinnedRuntimeKeys.push("agentHarnessId");
|
|
430
|
-
}
|
|
431
|
-
const runtimeOverride = normalizeString(params.entry.agentRuntimeOverride);
|
|
432
|
-
if (runtimeOverride && runtimeIds.has(normalizeProviderId(runtimeOverride))) {
|
|
433
|
-
addReason(reasons, "pinned runtime");
|
|
434
|
-
pinnedRuntimeKeys.push("agentRuntimeOverride");
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
if (!routeAllowsOwner && !explicitOwnedOverride) {
|
|
438
|
-
const runtimeModel = normalizeString(params.entry.model);
|
|
439
|
-
const runtimeRef = runtimeModel ? parseModelRef(runtimeModel, normalizeString(params.entry.modelProvider) ?? "", { allowPluginNormalization: false }) : null;
|
|
440
|
-
if (runtimeRef && providerIds.has(normalizeProviderId(runtimeRef.provider))) addReason(reasons, "runtime model state");
|
|
441
|
-
if (hasOwnedCliSession({
|
|
442
|
-
entry: params.entry,
|
|
443
|
-
cliSessionKeys
|
|
444
|
-
})) addReason(reasons, "CLI session binding");
|
|
445
|
-
if (params.entry.authProfileOverrideSource === "auto" && ownsPrefixedValue(authProfilePrefixes, params.entry.authProfileOverride)) addReason(reasons, "auto auth profile override");
|
|
446
|
-
}
|
|
447
|
-
if (reasons.length === 0) return {};
|
|
448
|
-
return { repair: {
|
|
449
|
-
key: params.key,
|
|
450
|
-
ownerId: params.owner.id,
|
|
451
|
-
ownerLabel: params.owner.label,
|
|
452
|
-
reasons,
|
|
453
|
-
pinnedRuntimeKeys,
|
|
454
|
-
cliSessionKeys
|
|
455
|
-
} };
|
|
456
|
-
}
|
|
457
|
-
function scanSessionRouteStateOwners(params) {
|
|
458
|
-
const repairs = [];
|
|
459
|
-
const manualReview = [];
|
|
460
|
-
for (const [key, entry] of Object.entries(params.store)) {
|
|
461
|
-
if (!entry || typeof entry !== "object") continue;
|
|
462
|
-
for (const owner of params.owners) {
|
|
463
|
-
const scan = scanEntryForOwner({
|
|
464
|
-
key,
|
|
465
|
-
entry,
|
|
466
|
-
owner,
|
|
467
|
-
route: params.routes[key]
|
|
468
|
-
});
|
|
469
|
-
if (scan.repair) repairs.push(scan.repair);
|
|
470
|
-
if (scan.manualReview) manualReview.push(scan.manualReview);
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
return {
|
|
474
|
-
repairs,
|
|
475
|
-
manualReview
|
|
476
|
-
};
|
|
477
|
-
}
|
|
478
|
-
function clearEntryKey(entry, key) {
|
|
479
|
-
if (entry[key] !== void 0) {
|
|
480
|
-
delete entry[key];
|
|
481
|
-
return true;
|
|
482
|
-
}
|
|
483
|
-
return false;
|
|
484
|
-
}
|
|
485
|
-
function clearRecordKeys(entry, recordKey, ownedKeys) {
|
|
486
|
-
const value = entry[recordKey];
|
|
487
|
-
if (value === null || typeof value !== "object") return false;
|
|
488
|
-
const record = value;
|
|
489
|
-
let changed = false;
|
|
490
|
-
const next = { ...record };
|
|
491
|
-
for (const key of ownedKeys) {
|
|
492
|
-
const normalized = normalizeProviderId(key);
|
|
493
|
-
if (next[normalized] !== void 0) {
|
|
494
|
-
delete next[normalized];
|
|
495
|
-
changed = true;
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
if (!changed) return false;
|
|
499
|
-
entry[recordKey] = Object.keys(next).length > 0 ? next : void 0;
|
|
500
|
-
return true;
|
|
501
|
-
}
|
|
502
|
-
function applySessionRouteStateRepair(params) {
|
|
503
|
-
let changed = false;
|
|
504
|
-
const clear = (key) => {
|
|
505
|
-
changed = clearEntryKey(params.entry, key) || changed;
|
|
506
|
-
};
|
|
507
|
-
if (params.repair.reasons.includes("auto model override")) {
|
|
508
|
-
clear("providerOverride");
|
|
509
|
-
clear("modelOverride");
|
|
510
|
-
clear("modelOverrideSource");
|
|
511
|
-
clear("liveModelSwitchPending");
|
|
512
|
-
}
|
|
513
|
-
if (params.repair.reasons.includes("runtime model state")) {
|
|
514
|
-
clear("model");
|
|
515
|
-
clear("modelProvider");
|
|
516
|
-
clear("contextTokens");
|
|
517
|
-
clear("systemPromptReport");
|
|
518
|
-
clear("fallbackNoticeSelectedModel");
|
|
519
|
-
clear("fallbackNoticeActiveModel");
|
|
520
|
-
clear("fallbackNoticeReason");
|
|
521
|
-
}
|
|
522
|
-
if (params.repair.reasons.includes("pinned runtime")) for (const key of params.repair.pinnedRuntimeKeys) clear(key);
|
|
523
|
-
if (params.repair.reasons.includes("CLI session binding")) {
|
|
524
|
-
changed = clearRecordKeys(params.entry, "cliSessionBindings", params.repair.cliSessionKeys) || changed;
|
|
525
|
-
changed = clearRecordKeys(params.entry, "cliSessionIds", params.repair.cliSessionKeys) || changed;
|
|
526
|
-
}
|
|
527
|
-
if (params.repair.reasons.includes("auto auth profile override")) {
|
|
528
|
-
clear("authProfileOverride");
|
|
529
|
-
clear("authProfileOverrideSource");
|
|
530
|
-
clear("authProfileOverrideCompactionCount");
|
|
531
|
-
}
|
|
532
|
-
if (changed) params.entry.updatedAt = params.now;
|
|
533
|
-
return changed;
|
|
534
|
-
}
|
|
535
|
-
function groupRepairsByOwner(repairs) {
|
|
536
|
-
const grouped = /* @__PURE__ */ new Map();
|
|
537
|
-
for (const repair of repairs) {
|
|
538
|
-
const key = repair.ownerLabel;
|
|
539
|
-
grouped.set(key, [...grouped.get(key) ?? [], repair]);
|
|
540
|
-
}
|
|
541
|
-
return grouped;
|
|
542
|
-
}
|
|
543
|
-
async function runPluginSessionStateDoctorRepairs(params) {
|
|
544
|
-
if (!storeMayContainPluginSessionRouteState(params.store)) return;
|
|
545
|
-
const owners = resolvePluginDoctorSessionRouteStateOwners({
|
|
546
|
-
cfg: params.cfg,
|
|
547
|
-
env: params.env
|
|
548
|
-
});
|
|
549
|
-
if (owners.length === 0) return;
|
|
550
|
-
const routes = Object.fromEntries(Object.keys(params.store).map((sessionKey) => [sessionKey, resolveConfiguredDoctorSessionStateRoute({
|
|
551
|
-
cfg: params.cfg,
|
|
552
|
-
sessionKey,
|
|
553
|
-
env: params.env
|
|
554
|
-
})]));
|
|
555
|
-
const store = params.store;
|
|
556
|
-
const scan = scanSessionRouteStateOwners({
|
|
557
|
-
owners,
|
|
558
|
-
store,
|
|
559
|
-
routes
|
|
560
|
-
});
|
|
561
|
-
if (scan.repairs.length > 0) for (const [ownerLabel, repairs] of groupRepairsByOwner(scan.repairs)) {
|
|
562
|
-
const staleCount = countSessionLabel(repairs.length);
|
|
563
|
-
params.warnings.push([
|
|
564
|
-
`- Found stale ${ownerLabel} session routing state in ${staleCount} outside the current configured model/runtime route.`,
|
|
565
|
-
" This can keep later message-channel runs pinned to an old runtime/provider after defaults move elsewhere.",
|
|
566
|
-
` Examples: ${repairs.slice(0, 3).map(repairExample).join(", ")}`
|
|
567
|
-
].join("\n"));
|
|
568
|
-
if (await params.prompter.confirmRuntimeRepair({
|
|
569
|
-
message: `Clear stale ${ownerLabel} session routing state for ${staleCount}?`,
|
|
570
|
-
initialValue: true
|
|
571
|
-
})) {
|
|
572
|
-
let repaired = 0;
|
|
573
|
-
const repairedAt = Date.now();
|
|
574
|
-
const repairsByKey = new Map(repairs.map((repair) => [repair.key, repair]));
|
|
575
|
-
await updateSessionStore(params.absoluteStorePath, (currentStore) => {
|
|
576
|
-
const currentMutableStore = currentStore;
|
|
577
|
-
for (const [key, repair] of repairsByKey) {
|
|
578
|
-
const current = currentMutableStore[key];
|
|
579
|
-
if (current && applySessionRouteStateRepair({
|
|
580
|
-
entry: current,
|
|
581
|
-
repair,
|
|
582
|
-
now: repairedAt
|
|
583
|
-
})) repaired += 1;
|
|
584
|
-
}
|
|
585
|
-
});
|
|
586
|
-
if (repaired > 0) params.changes.push(`- Cleared stale ${ownerLabel} session routing state for ${countSessionLabel(repaired)}.`);
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
if (scan.manualReview.length > 0) {
|
|
590
|
-
const grouped = /* @__PURE__ */ new Map();
|
|
591
|
-
for (const hit of scan.manualReview) grouped.set(hit.ownerLabel, [...grouped.get(hit.ownerLabel) ?? [], hit]);
|
|
592
|
-
for (const [ownerLabel, hits] of grouped) params.warnings.push([
|
|
593
|
-
`- Found explicit ${ownerLabel} model overrides in ${countSessionLabel(hits.length)} outside the current configured route.`,
|
|
594
|
-
" Doctor leaves explicit or legacy user selections untouched; switch them with /model or reset the session if that provider is no longer intended.",
|
|
595
|
-
` Examples: ${hits.slice(0, 3).map((hit) => hit.message).join(", ")}`
|
|
596
|
-
].join("\n"));
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
//#endregion
|
|
600
|
-
//#region src/commands/doctor-state-integrity.ts
|
|
601
|
-
function countLabel(count, singular, plural = `${singular}s`) {
|
|
602
|
-
return `${count} ${count === 1 ? singular : plural}`;
|
|
603
|
-
}
|
|
604
|
-
function formatFilePreview(paths, limit = 3) {
|
|
605
|
-
const names = paths.slice(0, limit).map((filePath) => path.basename(filePath));
|
|
606
|
-
const remaining = paths.length - names.length;
|
|
607
|
-
if (remaining > 0) return `${names.join(", ")}, and ${remaining} more`;
|
|
608
|
-
return names.join(", ");
|
|
609
|
-
}
|
|
610
|
-
function existsDir(dir) {
|
|
611
|
-
try {
|
|
612
|
-
return fs.existsSync(dir) && fs.statSync(dir).isDirectory();
|
|
613
|
-
} catch {
|
|
614
|
-
return false;
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
function existsFile(filePath) {
|
|
618
|
-
try {
|
|
619
|
-
return fs.existsSync(filePath) && fs.statSync(filePath).isFile();
|
|
620
|
-
} catch {
|
|
621
|
-
return false;
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
function tryResolveNativeRealPath(targetPath) {
|
|
625
|
-
try {
|
|
626
|
-
return fs.realpathSync.native(targetPath);
|
|
627
|
-
} catch {
|
|
628
|
-
return null;
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
function resolveComparableTranscriptPath(filePath) {
|
|
632
|
-
return tryResolveNativeRealPath(filePath) ?? path.resolve(filePath);
|
|
633
|
-
}
|
|
634
|
-
function areComparablePathsEqual(leftPath, rightPath) {
|
|
635
|
-
const leftRealPath = tryResolveNativeRealPath(leftPath);
|
|
636
|
-
const rightRealPath = tryResolveNativeRealPath(rightPath);
|
|
637
|
-
return leftRealPath !== null && leftRealPath === rightRealPath;
|
|
638
|
-
}
|
|
639
|
-
function isReachableConfiguredAgentDir(params) {
|
|
640
|
-
if (params.dirName === params.agentId) return true;
|
|
641
|
-
const rawDir = path.join(params.agentsRoot, params.dirName, "agent");
|
|
642
|
-
const normalizedDir = path.join(params.agentsRoot, params.agentId, "agent");
|
|
643
|
-
const rawRealPath = tryResolveNativeRealPath(rawDir);
|
|
644
|
-
const normalizedRealPath = tryResolveNativeRealPath(normalizedDir);
|
|
645
|
-
return rawRealPath !== null && rawRealPath === normalizedRealPath;
|
|
646
|
-
}
|
|
647
|
-
function formatOrphanAgentDirLabel(entry) {
|
|
648
|
-
return entry.dirName === entry.agentId ? entry.agentId : `${entry.dirName} (id ${entry.agentId})`;
|
|
649
|
-
}
|
|
650
|
-
function formatOrphanAgentDirPreview(entries, limit = 3) {
|
|
651
|
-
const labels = entries.slice(0, limit).map(formatOrphanAgentDirLabel);
|
|
652
|
-
const remaining = entries.length - labels.length;
|
|
653
|
-
if (remaining > 0) return `${labels.join(", ")}, and ${remaining} more`;
|
|
654
|
-
return labels.join(", ");
|
|
655
|
-
}
|
|
656
|
-
function listOrphanAgentDirs(cfg, stateDir) {
|
|
657
|
-
const configuredIds = /* @__PURE__ */ new Set();
|
|
658
|
-
configuredIds.add(normalizeAgentId(resolveDefaultAgentId(cfg)));
|
|
659
|
-
for (const entry of listAgentEntries(cfg)) configuredIds.add(normalizeAgentId(entry.id));
|
|
660
|
-
const agentsRoot = path.join(stateDir, "agents");
|
|
661
|
-
const liveCompatibilityAgentDir = resolveDaoCoreAgentDir();
|
|
662
|
-
try {
|
|
663
|
-
return fs.readdirSync(agentsRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => ({
|
|
664
|
-
dirName: entry.name,
|
|
665
|
-
agentId: normalizeAgentId(entry.name)
|
|
666
|
-
})).filter(({ dirName, agentId }) => {
|
|
667
|
-
const nestedAgentDir = path.join(agentsRoot, dirName, "agent");
|
|
668
|
-
if (!existsDir(nestedAgentDir)) return false;
|
|
669
|
-
if (areComparablePathsEqual(nestedAgentDir, liveCompatibilityAgentDir)) return false;
|
|
670
|
-
if (!configuredIds.has(agentId)) return true;
|
|
671
|
-
return !isReachableConfiguredAgentDir({
|
|
672
|
-
agentsRoot,
|
|
673
|
-
dirName,
|
|
674
|
-
agentId
|
|
675
|
-
});
|
|
676
|
-
}).toSorted((left, right) => left.agentId.localeCompare(right.agentId) || left.dirName.localeCompare(right.dirName));
|
|
677
|
-
} catch {
|
|
678
|
-
return [];
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
function canWriteDir(dir) {
|
|
682
|
-
try {
|
|
683
|
-
fs.accessSync(dir, fs.constants.W_OK);
|
|
684
|
-
return true;
|
|
685
|
-
} catch {
|
|
686
|
-
return false;
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
function ensureDir(dir) {
|
|
690
|
-
try {
|
|
691
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
692
|
-
return { ok: true };
|
|
693
|
-
} catch (err) {
|
|
694
|
-
return {
|
|
695
|
-
ok: false,
|
|
696
|
-
error: String(err)
|
|
697
|
-
};
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
function dirPermissionHint(dir) {
|
|
701
|
-
const uid = typeof process.getuid === "function" ? process.getuid() : null;
|
|
702
|
-
const gid = typeof process.getgid === "function" ? process.getgid() : null;
|
|
703
|
-
try {
|
|
704
|
-
const stat = fs.statSync(dir);
|
|
705
|
-
if (uid !== null && stat.uid !== uid) return `Owner mismatch (uid ${stat.uid}). Run: sudo chown -R $USER "${dir}"`;
|
|
706
|
-
if (gid !== null && stat.gid !== gid) return `Group mismatch (gid ${stat.gid}). If access fails, run: sudo chown -R $USER "${dir}"`;
|
|
707
|
-
} catch {
|
|
708
|
-
return null;
|
|
709
|
-
}
|
|
710
|
-
return null;
|
|
711
|
-
}
|
|
712
|
-
function addUserRwx(mode) {
|
|
713
|
-
return mode & 511 | 448;
|
|
714
|
-
}
|
|
715
|
-
function countJsonlLines(filePath) {
|
|
716
|
-
try {
|
|
717
|
-
const raw = fs.readFileSync(filePath, "utf-8");
|
|
718
|
-
if (!raw) return 0;
|
|
719
|
-
let count = 0;
|
|
720
|
-
for (let i = 0; i < raw.length; i += 1) if (raw[i] === "\n") count += 1;
|
|
721
|
-
if (!raw.endsWith("\n")) count += 1;
|
|
722
|
-
return count;
|
|
723
|
-
} catch {
|
|
724
|
-
return 0;
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
function findOtherStateDirs(stateDir) {
|
|
728
|
-
const resolvedState = path.resolve(stateDir);
|
|
729
|
-
const roots = process.platform === "darwin" ? ["/Users"] : process.platform === "linux" ? ["/home"] : [];
|
|
730
|
-
const found = [];
|
|
731
|
-
for (const root of roots) {
|
|
732
|
-
let entries = [];
|
|
733
|
-
try {
|
|
734
|
-
entries = fs.readdirSync(root, { withFileTypes: true });
|
|
735
|
-
} catch {
|
|
736
|
-
continue;
|
|
737
|
-
}
|
|
738
|
-
for (const entry of entries) {
|
|
739
|
-
if (!entry.isDirectory()) continue;
|
|
740
|
-
if (entry.name.startsWith(".")) continue;
|
|
741
|
-
const candidates = [".daocore"].map((dir) => path.resolve(root, entry.name, dir));
|
|
742
|
-
for (const candidate of candidates) {
|
|
743
|
-
if (candidate === resolvedState) continue;
|
|
744
|
-
if (existsDir(candidate)) found.push(candidate);
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
return found;
|
|
749
|
-
}
|
|
750
|
-
function isPathUnderRoot(targetPath, rootPath) {
|
|
751
|
-
const normalizedTarget = path.resolve(targetPath);
|
|
752
|
-
const normalizedRoot = path.resolve(rootPath);
|
|
753
|
-
const rootToken = path.parse(normalizedRoot).root;
|
|
754
|
-
if (normalizedRoot === rootToken) return normalizedTarget.startsWith(rootToken);
|
|
755
|
-
return normalizedTarget === normalizedRoot || normalizedTarget.startsWith(`${normalizedRoot}${path.sep}`);
|
|
756
|
-
}
|
|
757
|
-
function tryResolveRealPath(targetPath) {
|
|
758
|
-
try {
|
|
759
|
-
return fs.realpathSync(targetPath);
|
|
760
|
-
} catch {
|
|
761
|
-
return null;
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
function decodeMountInfoPath(value) {
|
|
765
|
-
return value.replace(/\\([0-7]{3})/g, (_, octal) => String.fromCharCode(Number.parseInt(octal, 8)));
|
|
766
|
-
}
|
|
767
|
-
function escapeControlCharsForTerminal(value) {
|
|
768
|
-
let escaped = "";
|
|
769
|
-
for (const char of value) {
|
|
770
|
-
if (char === "\x1B") {
|
|
771
|
-
escaped += "\\x1b";
|
|
772
|
-
continue;
|
|
773
|
-
}
|
|
774
|
-
if (char === "\r") {
|
|
775
|
-
escaped += "\\r";
|
|
776
|
-
continue;
|
|
777
|
-
}
|
|
778
|
-
if (char === "\n") {
|
|
779
|
-
escaped += "\\n";
|
|
780
|
-
continue;
|
|
781
|
-
}
|
|
782
|
-
if (char === " ") {
|
|
783
|
-
escaped += "\\t";
|
|
784
|
-
continue;
|
|
785
|
-
}
|
|
786
|
-
const code = char.charCodeAt(0);
|
|
787
|
-
if (code >= 0 && code <= 8 || code === 11 || code === 12 || code >= 14 && code <= 31) {
|
|
788
|
-
escaped += `\\x${code.toString(16).padStart(2, "0")}`;
|
|
789
|
-
continue;
|
|
790
|
-
}
|
|
791
|
-
if (code === 127) {
|
|
792
|
-
escaped += "\\x7f";
|
|
793
|
-
continue;
|
|
794
|
-
}
|
|
795
|
-
escaped += char;
|
|
796
|
-
}
|
|
797
|
-
return escaped;
|
|
798
|
-
}
|
|
799
|
-
function parseLinuxMountInfo(rawMountInfo) {
|
|
800
|
-
const entries = [];
|
|
801
|
-
for (const line of rawMountInfo.split("\n")) {
|
|
802
|
-
const trimmed = line.trim();
|
|
803
|
-
if (!trimmed) continue;
|
|
804
|
-
const separatorIndex = trimmed.indexOf(" - ");
|
|
805
|
-
if (separatorIndex === -1) continue;
|
|
806
|
-
const left = trimmed.slice(0, separatorIndex);
|
|
807
|
-
const right = trimmed.slice(separatorIndex + 3);
|
|
808
|
-
const leftFields = left.split(" ");
|
|
809
|
-
const rightFields = right.split(" ");
|
|
810
|
-
if (leftFields.length < 5 || rightFields.length < 2) continue;
|
|
811
|
-
entries.push({
|
|
812
|
-
mountPoint: decodeMountInfoPath(leftFields[4]),
|
|
813
|
-
fsType: rightFields[0],
|
|
814
|
-
source: decodeMountInfoPath(rightFields[1])
|
|
815
|
-
});
|
|
816
|
-
}
|
|
817
|
-
return entries;
|
|
818
|
-
}
|
|
819
|
-
function isPathUnderRootWithPathOps(targetPath, rootPath, pathOps) {
|
|
820
|
-
const normalizedTarget = pathOps.resolve(targetPath);
|
|
821
|
-
const normalizedRoot = pathOps.resolve(rootPath);
|
|
822
|
-
const rootToken = pathOps.parse(normalizedRoot).root;
|
|
823
|
-
if (normalizedRoot === rootToken) return normalizedTarget.startsWith(rootToken);
|
|
824
|
-
return normalizedTarget === normalizedRoot || normalizedTarget.startsWith(`${normalizedRoot}${pathOps.sep}`);
|
|
825
|
-
}
|
|
826
|
-
function findLinuxMountInfoEntryForPath(targetPath, entries, pathOps) {
|
|
827
|
-
const normalizedTarget = pathOps.resolve(targetPath);
|
|
828
|
-
let bestMatch = null;
|
|
829
|
-
for (const entry of entries) {
|
|
830
|
-
if (!isPathUnderRootWithPathOps(normalizedTarget, entry.mountPoint, pathOps)) continue;
|
|
831
|
-
if (!bestMatch || pathOps.resolve(entry.mountPoint).length > pathOps.resolve(bestMatch.mountPoint).length) bestMatch = entry;
|
|
832
|
-
}
|
|
833
|
-
return bestMatch;
|
|
834
|
-
}
|
|
835
|
-
function isMmcDevicePath(devicePath, pathOps) {
|
|
836
|
-
const name = pathOps.basename(devicePath);
|
|
837
|
-
return /^mmcblk\d+(?:p\d+)?$/.test(name);
|
|
838
|
-
}
|
|
839
|
-
function tryReadLinuxMountInfo() {
|
|
840
|
-
try {
|
|
841
|
-
return fs.readFileSync("/proc/self/mountinfo", "utf8");
|
|
842
|
-
} catch {
|
|
843
|
-
return null;
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
function detectLinuxSdBackedStateDir(stateDir, deps) {
|
|
847
|
-
if ((deps?.platform ?? process.platform) !== "linux") return null;
|
|
848
|
-
const linuxPath = path.posix;
|
|
849
|
-
const resolvedStatePath = (deps?.resolveRealPath ?? tryResolveRealPath)(stateDir) ?? linuxPath.resolve(stateDir);
|
|
850
|
-
const mountInfo = deps?.mountInfo ?? tryReadLinuxMountInfo();
|
|
851
|
-
if (!mountInfo) return null;
|
|
852
|
-
const mountEntry = findLinuxMountInfoEntryForPath(resolvedStatePath, parseLinuxMountInfo(mountInfo), linuxPath);
|
|
853
|
-
if (!mountEntry) return null;
|
|
854
|
-
const sourceCandidates = [mountEntry.source];
|
|
855
|
-
if (mountEntry.source.startsWith("/dev/")) {
|
|
856
|
-
const resolvedDevicePath = (deps?.resolveDeviceRealPath ?? tryResolveRealPath)(mountEntry.source);
|
|
857
|
-
if (resolvedDevicePath) sourceCandidates.push(linuxPath.resolve(resolvedDevicePath));
|
|
858
|
-
}
|
|
859
|
-
if (!sourceCandidates.some((candidate) => isMmcDevicePath(candidate, linuxPath))) return null;
|
|
860
|
-
return {
|
|
861
|
-
path: linuxPath.resolve(resolvedStatePath),
|
|
862
|
-
mountPoint: linuxPath.resolve(mountEntry.mountPoint),
|
|
863
|
-
fsType: mountEntry.fsType,
|
|
864
|
-
source: mountEntry.source
|
|
865
|
-
};
|
|
866
|
-
}
|
|
867
|
-
function formatLinuxSdBackedStateDirWarning(displayStateDir, linuxSdBackedStateDir) {
|
|
868
|
-
const displayMountPoint = linuxSdBackedStateDir.mountPoint === "/" ? "/" : shortenHomePath(linuxSdBackedStateDir.mountPoint);
|
|
869
|
-
return [
|
|
870
|
-
`- State directory appears to be on SD/eMMC storage (${displayStateDir}; device ${escapeControlCharsForTerminal(linuxSdBackedStateDir.source)}, fs ${escapeControlCharsForTerminal(linuxSdBackedStateDir.fsType)}, mount ${escapeControlCharsForTerminal(displayMountPoint)}).`,
|
|
871
|
-
"- SD/eMMC media can be slower for random I/O and wear faster under session/log churn.",
|
|
872
|
-
"- For better startup and state durability, prefer SSD/NVMe (or USB SSD on Raspberry Pi) for DAOCORE_STATE_DIR."
|
|
873
|
-
].join("\n");
|
|
874
|
-
}
|
|
875
|
-
function detectMacCloudSyncedStateDir(stateDir, deps) {
|
|
876
|
-
if ((deps?.platform ?? process.platform) !== "darwin") return null;
|
|
877
|
-
const homedir = deps?.homedir ?? os.homedir();
|
|
878
|
-
const roots = [{
|
|
879
|
-
storage: "iCloud Drive",
|
|
880
|
-
root: path.join(homedir, "Library", "Mobile Documents", "com~apple~CloudDocs")
|
|
881
|
-
}, {
|
|
882
|
-
storage: "CloudStorage provider",
|
|
883
|
-
root: path.join(homedir, "Library", "CloudStorage")
|
|
884
|
-
}];
|
|
885
|
-
const realPath = (deps?.resolveRealPath ?? tryResolveRealPath)(stateDir);
|
|
886
|
-
const candidates = realPath ? [path.resolve(realPath)] : [path.resolve(stateDir)];
|
|
887
|
-
for (const candidate of candidates) for (const { storage, root } of roots) if (isPathUnderRoot(candidate, root)) return {
|
|
888
|
-
path: candidate,
|
|
889
|
-
storage
|
|
890
|
-
};
|
|
891
|
-
return null;
|
|
892
|
-
}
|
|
893
|
-
function isPairingPolicy(value) {
|
|
894
|
-
return normalizeOptionalLowercaseString(value) === "pairing";
|
|
895
|
-
}
|
|
896
|
-
function hasPairingPolicy(value) {
|
|
897
|
-
const record = asNullableObjectRecord(value);
|
|
898
|
-
if (!record) return false;
|
|
899
|
-
if (isPairingPolicy(record.dmPolicy)) return true;
|
|
900
|
-
const dm = asNullableObjectRecord(record.dm);
|
|
901
|
-
if (dm && isPairingPolicy(dm.policy)) return true;
|
|
902
|
-
const accounts = asNullableObjectRecord(record.accounts);
|
|
903
|
-
if (!accounts) return false;
|
|
904
|
-
for (const accountCfg of Object.values(accounts)) if (hasPairingPolicy(accountCfg)) return true;
|
|
905
|
-
return false;
|
|
906
|
-
}
|
|
907
|
-
function isSlashRoutingSessionKey(sessionKey) {
|
|
908
|
-
const raw = normalizeOptionalLowercaseString(sessionKey);
|
|
909
|
-
if (!raw) return false;
|
|
910
|
-
const scoped = parseAgentSessionKey(raw)?.rest ?? raw;
|
|
911
|
-
return /^[^:]+:slash:[^:]+(?:$|:)/.test(scoped);
|
|
912
|
-
}
|
|
913
|
-
function shouldRequireOAuthDir(cfg, env) {
|
|
914
|
-
if (env.DAOCORE_OAUTH_DIR?.trim()) return true;
|
|
915
|
-
const channels = asNullableObjectRecord(cfg.channels);
|
|
916
|
-
if (!channels) return false;
|
|
917
|
-
const withPersistedAuth = new Set(listConfiguredChannelIdsForReadOnlyScope({
|
|
918
|
-
config: cfg,
|
|
919
|
-
env
|
|
920
|
-
}));
|
|
921
|
-
const withoutPersistedAuth = new Set(listConfiguredChannelIdsForReadOnlyScope({
|
|
922
|
-
config: cfg,
|
|
923
|
-
env,
|
|
924
|
-
includePersistedAuthState: false
|
|
925
|
-
}));
|
|
926
|
-
if ([...withPersistedAuth].some((channelId) => !withoutPersistedAuth.has(channelId))) return true;
|
|
927
|
-
for (const [channelId, channelCfg] of Object.entries(channels)) {
|
|
928
|
-
if (channelId === "defaults" || channelId === "modelByChannel") continue;
|
|
929
|
-
if (hasPairingPolicy(channelCfg)) return true;
|
|
930
|
-
}
|
|
931
|
-
return false;
|
|
932
|
-
}
|
|
933
|
-
function shouldSuppressOrphanTranscriptWarning(cfg, agentId) {
|
|
934
|
-
const backendConfig = resolveMemoryBackendConfig({
|
|
935
|
-
cfg,
|
|
936
|
-
agentId
|
|
937
|
-
});
|
|
938
|
-
return backendConfig?.backend === "qmd" && backendConfig.qmd?.sessions.enabled === true;
|
|
939
|
-
}
|
|
940
|
-
async function noteStateIntegrity(cfg, prompter, configPath) {
|
|
941
|
-
const warnings = [];
|
|
942
|
-
const changes = [];
|
|
943
|
-
const noteFn = prompter.note ?? note;
|
|
944
|
-
const env = process.env;
|
|
945
|
-
const homedir = () => resolveRequiredHomeDir(env, os.homedir);
|
|
946
|
-
const stateDir = resolveStateDir(env, homedir);
|
|
947
|
-
const defaultStateDir = path.join(homedir(), ".daocore");
|
|
948
|
-
const oauthDir = resolveOAuthDir(env, stateDir);
|
|
949
|
-
const agentId = resolveDefaultAgentId(cfg);
|
|
950
|
-
const sessionsDir = resolveSessionTranscriptsDirForAgent(agentId, env, homedir);
|
|
951
|
-
const storePath = resolveStorePath(cfg.session?.store, { agentId });
|
|
952
|
-
const storeDir = path.dirname(storePath);
|
|
953
|
-
const absoluteStorePath = path.resolve(storePath);
|
|
954
|
-
const displayStateDir = shortenHomePath(stateDir);
|
|
955
|
-
const displayOauthDir = shortenHomePath(oauthDir);
|
|
956
|
-
const displaySessionsDir = shortenHomePath(sessionsDir);
|
|
957
|
-
const displayStoreDir = shortenHomePath(storeDir);
|
|
958
|
-
const displayConfigPath = configPath ? shortenHomePath(configPath) : void 0;
|
|
959
|
-
const requireOAuthDir = shouldRequireOAuthDir(cfg, env);
|
|
960
|
-
const cloudSyncedStateDir = detectMacCloudSyncedStateDir(stateDir);
|
|
961
|
-
const linuxSdBackedStateDir = detectLinuxSdBackedStateDir(stateDir);
|
|
962
|
-
const suppressOrphanTranscriptWarning = shouldSuppressOrphanTranscriptWarning(cfg, agentId);
|
|
963
|
-
if (cloudSyncedStateDir) warnings.push([
|
|
964
|
-
`- State directory is under macOS cloud-synced storage (${displayStateDir}; ${cloudSyncedStateDir.storage}).`,
|
|
965
|
-
"- This can cause slow I/O and sync/lock races for sessions and credentials.",
|
|
966
|
-
"- Prefer a local non-synced state dir (for example: ~/.daocore).",
|
|
967
|
-
` Set locally: DAOCORE_STATE_DIR=~/.daocore ${formatCliCommand("daocore doctor")}`
|
|
968
|
-
].join("\n"));
|
|
969
|
-
if (linuxSdBackedStateDir) warnings.push(formatLinuxSdBackedStateDirWarning(displayStateDir, linuxSdBackedStateDir));
|
|
970
|
-
let stateDirExists = existsDir(stateDir);
|
|
971
|
-
if (!stateDirExists) {
|
|
972
|
-
warnings.push(`- CRITICAL: state directory missing (${displayStateDir}). Sessions, credentials, logs, and config are stored there.`);
|
|
973
|
-
if (cfg.gateway?.mode === "remote") warnings.push("- Gateway is in remote mode; run doctor on the remote host where the gateway runs.");
|
|
974
|
-
if (await prompter.confirmRuntimeRepair({
|
|
975
|
-
message: `Create ${displayStateDir} now?`,
|
|
976
|
-
initialValue: false
|
|
977
|
-
})) {
|
|
978
|
-
const created = ensureDir(stateDir);
|
|
979
|
-
if (created.ok) {
|
|
980
|
-
changes.push(`- Created ${displayStateDir}`);
|
|
981
|
-
stateDirExists = true;
|
|
982
|
-
} else warnings.push(`- Failed to create ${displayStateDir}: ${created.error}`);
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
if (stateDirExists && !canWriteDir(stateDir)) {
|
|
986
|
-
warnings.push(`- State directory not writable (${displayStateDir}).`);
|
|
987
|
-
const hint = dirPermissionHint(stateDir);
|
|
988
|
-
if (hint) warnings.push(` ${hint}`);
|
|
989
|
-
if (await prompter.confirmRuntimeRepair({
|
|
990
|
-
message: `Repair permissions on ${displayStateDir}?`,
|
|
991
|
-
initialValue: true
|
|
992
|
-
})) try {
|
|
993
|
-
const target = addUserRwx(fs.statSync(stateDir).mode);
|
|
994
|
-
fs.chmodSync(stateDir, target);
|
|
995
|
-
changes.push(`- Repaired permissions on ${displayStateDir}`);
|
|
996
|
-
} catch (err) {
|
|
997
|
-
warnings.push(`- Failed to repair ${displayStateDir}: ${String(err)}`);
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
if (stateDirExists && process.platform !== "win32") try {
|
|
1001
|
-
const dirLstat = fs.lstatSync(stateDir);
|
|
1002
|
-
const isDirSymlink = dirLstat.isSymbolicLink();
|
|
1003
|
-
const stat = isDirSymlink ? fs.statSync(stateDir) : dirLstat;
|
|
1004
|
-
if (!(isDirSymlink ? fs.realpathSync(stateDir) : stateDir).startsWith("/nix/store/") && (stat.mode & 63) !== 0) {
|
|
1005
|
-
warnings.push(`- State directory permissions are too open (${displayStateDir}). Recommend chmod 700.`);
|
|
1006
|
-
if (await prompter.confirmRuntimeRepair({
|
|
1007
|
-
message: `Tighten permissions on ${displayStateDir} to 700?`,
|
|
1008
|
-
initialValue: true
|
|
1009
|
-
})) {
|
|
1010
|
-
fs.chmodSync(stateDir, 448);
|
|
1011
|
-
changes.push(`- Tightened permissions on ${displayStateDir} to 700`);
|
|
1012
|
-
}
|
|
1013
|
-
}
|
|
1014
|
-
} catch (err) {
|
|
1015
|
-
warnings.push(`- Failed to read ${displayStateDir} permissions: ${String(err)}`);
|
|
1016
|
-
}
|
|
1017
|
-
if (configPath && existsFile(configPath) && process.platform !== "win32") try {
|
|
1018
|
-
const configLstat = fs.lstatSync(configPath);
|
|
1019
|
-
const isSymlink = configLstat.isSymbolicLink();
|
|
1020
|
-
const stat = isSymlink ? fs.statSync(configPath) : configLstat;
|
|
1021
|
-
if (!(isSymlink ? fs.realpathSync(configPath) : configPath).startsWith("/nix/store/") && (stat.mode & 63) !== 0) {
|
|
1022
|
-
warnings.push(`- Config file is group/world readable (${displayConfigPath ?? configPath}). Recommend chmod 600.`);
|
|
1023
|
-
if (await prompter.confirmRuntimeRepair({
|
|
1024
|
-
message: `Tighten permissions on ${displayConfigPath ?? configPath} to 600?`,
|
|
1025
|
-
initialValue: true
|
|
1026
|
-
})) {
|
|
1027
|
-
fs.chmodSync(configPath, 384);
|
|
1028
|
-
changes.push(`- Tightened permissions on ${displayConfigPath ?? configPath} to 600`);
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
} catch (err) {
|
|
1032
|
-
warnings.push(`- Failed to read config permissions (${displayConfigPath ?? configPath}): ${String(err)}`);
|
|
1033
|
-
}
|
|
1034
|
-
if (stateDirExists) {
|
|
1035
|
-
const dirCandidates = /* @__PURE__ */ new Map();
|
|
1036
|
-
dirCandidates.set(sessionsDir, "Sessions dir");
|
|
1037
|
-
dirCandidates.set(storeDir, "Session store dir");
|
|
1038
|
-
if (requireOAuthDir) dirCandidates.set(oauthDir, "OAuth dir");
|
|
1039
|
-
else if (!existsDir(oauthDir)) warnings.push(`- OAuth dir not present (${displayOauthDir}). Skipping create because no WhatsApp/pairing channel config is active.`);
|
|
1040
|
-
const displayDirFor = (dir) => {
|
|
1041
|
-
if (dir === sessionsDir) return displaySessionsDir;
|
|
1042
|
-
if (dir === storeDir) return displayStoreDir;
|
|
1043
|
-
if (dir === oauthDir) return displayOauthDir;
|
|
1044
|
-
return shortenHomePath(dir);
|
|
1045
|
-
};
|
|
1046
|
-
for (const [dir, label] of dirCandidates) {
|
|
1047
|
-
const displayDir = displayDirFor(dir);
|
|
1048
|
-
if (!existsDir(dir)) {
|
|
1049
|
-
warnings.push(`- CRITICAL: ${label} missing (${displayDir}).`);
|
|
1050
|
-
if (await prompter.confirmRuntimeRepair({
|
|
1051
|
-
message: `Create ${label} at ${displayDir}?`,
|
|
1052
|
-
initialValue: true
|
|
1053
|
-
})) {
|
|
1054
|
-
const created = ensureDir(dir);
|
|
1055
|
-
if (created.ok) changes.push(`- Created ${label}: ${displayDir}`);
|
|
1056
|
-
else warnings.push(`- Failed to create ${displayDir}: ${created.error}`);
|
|
1057
|
-
}
|
|
1058
|
-
continue;
|
|
1059
|
-
}
|
|
1060
|
-
if (!canWriteDir(dir)) {
|
|
1061
|
-
warnings.push(`- ${label} not writable (${displayDir}).`);
|
|
1062
|
-
const hint = dirPermissionHint(dir);
|
|
1063
|
-
if (hint) warnings.push(` ${hint}`);
|
|
1064
|
-
if (await prompter.confirmRuntimeRepair({
|
|
1065
|
-
message: `Repair permissions on ${label}?`,
|
|
1066
|
-
initialValue: true
|
|
1067
|
-
})) try {
|
|
1068
|
-
const target = addUserRwx(fs.statSync(dir).mode);
|
|
1069
|
-
fs.chmodSync(dir, target);
|
|
1070
|
-
changes.push(`- Repaired permissions on ${label}: ${displayDir}`);
|
|
1071
|
-
} catch (err) {
|
|
1072
|
-
warnings.push(`- Failed to repair ${displayDir}: ${String(err)}`);
|
|
1073
|
-
}
|
|
1074
|
-
}
|
|
1075
|
-
}
|
|
1076
|
-
}
|
|
1077
|
-
const extraStateDirs = /* @__PURE__ */ new Set();
|
|
1078
|
-
if (path.resolve(stateDir) !== path.resolve(defaultStateDir)) {
|
|
1079
|
-
if (existsDir(defaultStateDir)) extraStateDirs.add(defaultStateDir);
|
|
1080
|
-
}
|
|
1081
|
-
for (const other of findOtherStateDirs(stateDir)) extraStateDirs.add(other);
|
|
1082
|
-
if (extraStateDirs.size > 0) warnings.push([
|
|
1083
|
-
"- Multiple state directories detected. This can split session history.",
|
|
1084
|
-
...Array.from(extraStateDirs).map((dir) => ` - ${shortenHomePath(dir)}`),
|
|
1085
|
-
` Active state dir: ${displayStateDir}`
|
|
1086
|
-
].join("\n"));
|
|
1087
|
-
const orphanAgentDirs = listOrphanAgentDirs(cfg, stateDir);
|
|
1088
|
-
if (orphanAgentDirs.length > 0) warnings.push([
|
|
1089
|
-
`- Found ${countLabel(orphanAgentDirs.length, "agent directory", "agent directories")} on disk without a matching agents.list entry.`,
|
|
1090
|
-
" These agents can still have sessions/auth state on disk, but config-driven routing, identity, and model selection will ignore them.",
|
|
1091
|
-
` Examples: ${formatOrphanAgentDirPreview(orphanAgentDirs)}`,
|
|
1092
|
-
` Restore the missing agents.list entries or remove stale dirs after confirming they are no longer needed: ${shortenHomePath(path.join(stateDir, "agents"))}`
|
|
1093
|
-
].join("\n"));
|
|
1094
|
-
const store = loadSessionStore(storePath);
|
|
1095
|
-
const sessionPathOpts = resolveSessionFilePathOptions({
|
|
1096
|
-
agentId,
|
|
1097
|
-
storePath
|
|
1098
|
-
});
|
|
1099
|
-
const entries = Object.entries(store).filter(([, entry]) => entry && typeof entry === "object");
|
|
1100
|
-
if (entries.length > 0) {
|
|
1101
|
-
const recentTranscriptCandidates = entries.slice().toSorted((a, b) => {
|
|
1102
|
-
const aUpdated = typeof a[1].updatedAt === "number" ? a[1].updatedAt : 0;
|
|
1103
|
-
return (typeof b[1].updatedAt === "number" ? b[1].updatedAt : 0) - aUpdated;
|
|
1104
|
-
}).slice(0, 5).filter(([key]) => !isSlashRoutingSessionKey(key));
|
|
1105
|
-
const missing = recentTranscriptCandidates.filter(([, entry]) => {
|
|
1106
|
-
const sessionId = entry.sessionId;
|
|
1107
|
-
if (!sessionId) return false;
|
|
1108
|
-
return !existsFile(resolveSessionFilePath(sessionId, entry, sessionPathOpts));
|
|
1109
|
-
});
|
|
1110
|
-
if (missing.length > 0) warnings.push([
|
|
1111
|
-
`- ${missing.length}/${recentTranscriptCandidates.length} recent sessions are missing transcripts.`,
|
|
1112
|
-
` Verify sessions in store: ${formatCliCommand(`daocore sessions --store "${absoluteStorePath}"`)}`,
|
|
1113
|
-
` Preview cleanup impact: ${formatCliCommand(`daocore sessions cleanup --store "${absoluteStorePath}" --dry-run`)}`,
|
|
1114
|
-
` Prune missing entries: ${formatCliCommand(`daocore sessions cleanup --store "${absoluteStorePath}" --enforce --fix-missing`)}`
|
|
1115
|
-
].join("\n"));
|
|
1116
|
-
const wedgedSubagentSessions = entries.filter(([, entry]) => isSubagentRecoveryWedgedEntry(entry));
|
|
1117
|
-
if (wedgedSubagentSessions.length > 0) {
|
|
1118
|
-
const wedgedCount = countLabel(wedgedSubagentSessions.length, "wedged subagent session");
|
|
1119
|
-
warnings.push([
|
|
1120
|
-
`- Found ${wedgedCount} with automatic restart recovery tombstoned.`,
|
|
1121
|
-
" DaoCore will not auto-resume these child sessions on restart; reconcile their task records instead.",
|
|
1122
|
-
` Examples: ${wedgedSubagentSessions.slice(0, 3).map(([key]) => key).join(", ")}`,
|
|
1123
|
-
` Fix: ${formatCliCommand("daocore tasks maintenance --apply")}`
|
|
1124
|
-
].join("\n"));
|
|
1125
|
-
if (await prompter.confirmRuntimeRepair({
|
|
1126
|
-
message: `Clear stale aborted recovery flags for ${wedgedCount}?`,
|
|
1127
|
-
initialValue: true
|
|
1128
|
-
})) {
|
|
1129
|
-
let repaired = 0;
|
|
1130
|
-
const repairedAt = Date.now();
|
|
1131
|
-
await updateSessionStore(absoluteStorePath, (currentStore) => {
|
|
1132
|
-
for (const [key] of wedgedSubagentSessions) {
|
|
1133
|
-
const current = currentStore[key];
|
|
1134
|
-
if (current && clearWedgedSubagentRecoveryAbort(current, repairedAt)) {
|
|
1135
|
-
repaired += 1;
|
|
1136
|
-
currentStore[key] = current;
|
|
1137
|
-
}
|
|
1138
|
-
}
|
|
1139
|
-
});
|
|
1140
|
-
if (repaired > 0) changes.push(`- Cleared aborted restart-recovery flags for ${countLabel(repaired, "wedged subagent session")}.`);
|
|
1141
|
-
}
|
|
1142
|
-
const wedgedReasons = wedgedSubagentSessions.map(([, entry]) => formatSubagentRecoveryWedgedReason(entry)).filter((reason, index, all) => all.indexOf(reason) === index).slice(0, 2);
|
|
1143
|
-
if (wedgedReasons.length > 0) warnings.push(wedgedReasons.map((reason) => ` Reason: ${reason}`).join("\n"));
|
|
1144
|
-
}
|
|
1145
|
-
await runPluginSessionStateDoctorRepairs({
|
|
1146
|
-
cfg,
|
|
1147
|
-
store,
|
|
1148
|
-
absoluteStorePath,
|
|
1149
|
-
prompter,
|
|
1150
|
-
env,
|
|
1151
|
-
warnings,
|
|
1152
|
-
changes
|
|
1153
|
-
});
|
|
1154
|
-
await repairHeartbeatPoisonedMainSession({
|
|
1155
|
-
cfg,
|
|
1156
|
-
store,
|
|
1157
|
-
absoluteStorePath,
|
|
1158
|
-
stateDir,
|
|
1159
|
-
sessionPathOpts,
|
|
1160
|
-
prompter,
|
|
1161
|
-
warnings,
|
|
1162
|
-
changes
|
|
1163
|
-
});
|
|
1164
|
-
for (const warning of describeHeartbeatSessionTargetIssues(cfg)) warnings.push(warning);
|
|
1165
|
-
const mainEntry = store[resolveMainSessionKey(cfg)];
|
|
1166
|
-
if (mainEntry?.sessionId) {
|
|
1167
|
-
const transcriptPath = resolveSessionFilePath(mainEntry.sessionId, mainEntry, sessionPathOpts);
|
|
1168
|
-
if (!existsFile(transcriptPath)) warnings.push(`- Main session transcript missing (${shortenHomePath(transcriptPath)}). History will appear to reset.`);
|
|
1169
|
-
else {
|
|
1170
|
-
const lineCount = countJsonlLines(transcriptPath);
|
|
1171
|
-
if (lineCount <= 1) warnings.push(`- Main session transcript has only ${lineCount} line. Session history may not be appending.`);
|
|
1172
|
-
}
|
|
1173
|
-
}
|
|
1174
|
-
}
|
|
1175
|
-
if (existsDir(sessionsDir)) {
|
|
1176
|
-
const referencedTranscriptPaths = /* @__PURE__ */ new Set();
|
|
1177
|
-
for (const [, entry] of entries) {
|
|
1178
|
-
if (!entry?.sessionId) continue;
|
|
1179
|
-
try {
|
|
1180
|
-
referencedTranscriptPaths.add(resolveComparableTranscriptPath(resolveSessionFilePath(entry.sessionId, entry, sessionPathOpts)));
|
|
1181
|
-
} catch {}
|
|
1182
|
-
}
|
|
1183
|
-
const orphanTranscriptPaths = fs.readdirSync(sessionsDir, { withFileTypes: true }).filter((entry) => entry.isFile() && isPrimarySessionTranscriptFileName(entry.name)).map((entry) => path.join(sessionsDir, entry.name)).filter((filePath) => !referencedTranscriptPaths.has(resolveComparableTranscriptPath(filePath)));
|
|
1184
|
-
if (orphanTranscriptPaths.length > 0 && !suppressOrphanTranscriptWarning) {
|
|
1185
|
-
const orphanCount = countLabel(orphanTranscriptPaths.length, "orphan transcript file");
|
|
1186
|
-
const orphanPreview = formatFilePreview(orphanTranscriptPaths);
|
|
1187
|
-
warnings.push([
|
|
1188
|
-
`- Found ${orphanCount} in ${displaySessionsDir}.`,
|
|
1189
|
-
" These .jsonl files are no longer referenced by sessions.json, so they are not part of any active session history.",
|
|
1190
|
-
" Doctor can archive them safely by renaming each file to *.deleted.<timestamp>.",
|
|
1191
|
-
` Examples: ${orphanPreview}`
|
|
1192
|
-
].join("\n"));
|
|
1193
|
-
if (await prompter.confirmRuntimeRepair({
|
|
1194
|
-
message: `Archive ${orphanCount} in ${displaySessionsDir}? This only renames them to *.deleted.<timestamp>.`,
|
|
1195
|
-
initialValue: false,
|
|
1196
|
-
requiresInteractiveConfirmation: true
|
|
1197
|
-
})) {
|
|
1198
|
-
let archived = 0;
|
|
1199
|
-
const archivedAt = formatSessionArchiveTimestamp();
|
|
1200
|
-
for (const orphanPath of orphanTranscriptPaths) {
|
|
1201
|
-
const archivedPath = `${orphanPath}.deleted.${archivedAt}`;
|
|
1202
|
-
try {
|
|
1203
|
-
fs.renameSync(orphanPath, archivedPath);
|
|
1204
|
-
archived += 1;
|
|
1205
|
-
} catch (err) {
|
|
1206
|
-
warnings.push(`- Failed to archive orphan transcript ${shortenHomePath(orphanPath)}: ${String(err)}`);
|
|
1207
|
-
}
|
|
1208
|
-
}
|
|
1209
|
-
if (archived > 0) changes.push(`- Archived ${countLabel(archived, "orphan transcript file")} in ${displaySessionsDir} as .deleted timestamped backups.`);
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
if (warnings.length > 0) noteFn(warnings.join("\n"), "State integrity");
|
|
1214
|
-
if (changes.length > 0) noteFn(changes.join("\n"), "Doctor changes");
|
|
1215
|
-
}
|
|
1216
|
-
function collectWorkspaceBackupTip(workspaceDir) {
|
|
1217
|
-
if (!existsDir(workspaceDir)) return null;
|
|
1218
|
-
const gitMarker = path.join(workspaceDir, ".git");
|
|
1219
|
-
if (fs.existsSync(gitMarker)) return null;
|
|
1220
|
-
return [
|
|
1221
|
-
"- Tip: back up the workspace in a private git repo (GitHub or GitLab).",
|
|
1222
|
-
"- Keep ~/.daocore out of git; it contains credentials and session history.",
|
|
1223
|
-
"- Details: /concepts/agent-workspace#git-backup-recommended"
|
|
1224
|
-
].join("\n");
|
|
1225
|
-
}
|
|
1226
|
-
function noteWorkspaceBackupTip(workspaceDir) {
|
|
1227
|
-
const tip = collectWorkspaceBackupTip(workspaceDir);
|
|
1228
|
-
if (tip) note(tip, "Workspace");
|
|
1229
|
-
}
|
|
1230
|
-
//#endregion
|
|
1231
|
-
export { collectWorkspaceBackupTip, noteStateIntegrity, noteWorkspaceBackupTip };
|