@symerian/symi 2.5.8 → 2.6.1
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/{accounts-qtxJ-6em.js → accounts-3dCrO3oZ.js} +1 -1
- package/dist/{accounts-tNElYrCH.js → accounts-BRw8yhIW.js} +21 -21
- package/dist/{accounts-CWktKM8a.js → accounts-BuZxOb3B.js} +1 -1
- package/dist/{active-listener-C9r8ZB9m.js → active-listener-CfHHV2SU.js} +1 -1
- package/dist/{agent-scope-BxoUQqgM.js → agent-scope-CpEJ0B88.js} +3 -3
- package/dist/{agents-CXloh6n_.js → agents-DQIz-_on.js} +4 -4
- package/dist/{agents.config-BuTzBaXf.js → agents.config-CIJRaVWl.js} +1 -1
- package/dist/{agents.config-BhAJXAtA.js → agents.config-D8WPDf-m.js} +1 -1
- package/dist/{audio-preflight-O3ASWbaG.js → audio-preflight-BVaaZWkg.js} +34 -34
- package/dist/{audio-preflight-C40mKAp7.js → audio-preflight-CPBOQV4I.js} +4 -4
- package/dist/{auth-choice-DvaVrSwn.js → auth-choice-BqFbNDuP.js} +1 -1
- package/dist/{auth-choice-Br6zT8iS.js → auth-choice-DTDyJL1r.js} +1 -1
- package/dist/{model-auth-DK43VicI.js → auth-profiles-DdK1Hxaa.js} +412 -412
- package/dist/{banner-BtqKaQZr.js → banner-DYDCxnDL.js} +1 -1
- package/dist/{bindings-B7Ke6LJi.js → bindings-BsHoBLIE.js} +2 -2
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +60 -60
- package/dist/bundled/bootstrap-extra-files/handler.js +6 -6
- package/dist/bundled/command-logger/handler.js +3 -3
- package/dist/bundled/session-memory/handler.js +61 -61
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-activity-CsM_hJ_s.js → channel-activity-B6G1jnQT.js} +2 -2
- package/dist/{channel-options-CfLxsV76.js → channel-options-CvHSm_Kx.js} +1 -1
- package/dist/{channel-options-DFHEgad5.js → channel-options-vBCJhJB7.js} +1 -1
- package/dist/{channel-web-D-jDDmWN.js → channel-web-CM2LyWZW.js} +1 -1
- package/dist/{channels-cli-BEZORT4N.js → channels-cli-D5H3Wcho.js} +4 -4
- package/dist/{channels-cli-CT6wdGT8.js → channels-cli-DzOjNNFn.js} +4 -4
- package/dist/{chrome-BFekevcE.js → chrome-D2SKJnR7.js} +24 -24
- package/dist/{chrome-CDJYxX5a.js → chrome-DkaXoP36.js} +5 -5
- package/dist/{chunk-BW5f05BR.js → chunk-09egQapi.js} +1 -1
- package/dist/{cli-kxxM9xT0.js → cli-8hqssnRJ.js} +1 -1
- package/dist/{cli-CkxvN9Cb.js → cli-DNZwCDRe.js} +1 -1
- package/dist/{command-registry-DsqA8NDd.js → command-registry-CHtN2HeK.js} +9 -9
- package/dist/{commands-registry-D7CTCQPm.js → commands-registry-Bfc7Uz0o.js} +4 -4
- package/dist/{completion-cli-mZMiIG7C.js → completion-cli-C8y_J5KC.js} +1 -1
- package/dist/{completion-cli-QCrjurdu.js → completion-cli-Cov6N3BO.js} +2 -2
- package/dist/{config-DRbjHIwD.js → config-5SdHIcHU.js} +6 -6
- package/dist/{config-cli-CS_0o9LY.js → config-cli-B2REEd2l.js} +1 -1
- package/dist/{config-cli-DLsLPE4o.js → config-cli-BwO0xAbV.js} +1 -1
- package/dist/{configure-T9J4bw0H.js → configure-BWSYSi2-.js} +3 -3
- package/dist/{configure-BX4aNf3w.js → configure-C6yNe33U.js} +3 -3
- package/dist/{conversation-label-DXUkoKcB.js → conversation-label-Onz2hiJh.js} +1 -1
- package/dist/{deliver-BH0l3UKW.js → deliver-C-37cZUe.js} +1 -1
- package/dist/{deliver-CvCK5Mm9.js → deliver-C46-vyqg.js} +11 -11
- package/dist/{diagnostic-CI0kRQkt.js → diagnostic-rPhsBoZz.js} +2 -2
- package/dist/{doctor-completion-BKydQfCM.js → doctor-completion-BKKzstt6.js} +1 -1
- package/dist/{doctor-completion-CTodkFg2.js → doctor-completion-D7CDLFLg.js} +1 -1
- package/dist/entry.js +1 -1
- package/dist/{command-format-BaxDnULz.js → env-BDXYbTKj.js} +10 -10
- package/dist/{errors-BoQgnc8X.js → errors-XIsvXeC-.js} +1 -1
- package/dist/extensionAPI.js +6 -6
- package/dist/{frontmatter-C_bv_0P8.js → frontmatter-CTR5f_Ez.js} +2 -2
- package/dist/{gateway-cli-CZnyhTAu.js → gateway-cli-BhFM4Bkm.js} +20 -18
- package/dist/{gateway-cli-DEpU3Bg3.js → gateway-cli-Datohp3m.js} +20 -18
- package/dist/{gemini-auth-CdSPHuLl.js → gemini-auth-Dy12ZAH3.js} +2 -2
- package/dist/{github-copilot-token-C_qUP7p5.js → github-copilot-token-cCYzSU9h.js} +1 -1
- package/dist/{glass-ui-ws-KbKXJGb5.js → glass-ui-ws-BzqfD_wX.js} +7 -7
- package/dist/{glass-ui-ws-BdBSYcsf.js → glass-ui-ws-D9yvYULL.js} +7 -7
- package/dist/{health-DQmyj-7z.js → health-BjwDRAdd.js} +1 -1
- package/dist/{health-z-YCZRhf.js → health-C5XJPwpt.js} +1 -1
- package/dist/{hooks-cli-4d-QhgRs.js → hooks-cli-CafMq9Vr.js} +2 -2
- package/dist/{hooks-cli-BRehYEXJ.js → hooks-cli-U12oVyLH.js} +2 -2
- package/dist/{image-B0wGflxA.js → image-CuzFLQWC.js} +7 -7
- package/dist/{image-CHzdaNJ4.js → image-DcpMiprB.js} +1 -1
- package/dist/{image-ops-CvJzsyvE.js → image-ops-C7CauEK8.js} +99 -99
- package/dist/{inbound-context-BlHX0H3E.js → inbound-context-DSDTl6Kj.js} +2 -2
- package/dist/index.js +6 -6
- package/dist/{ir-DccrnjsE.js → ir-CTiz95Vb.js} +5 -5
- package/dist/llm-slug-generator.js +64 -84
- package/dist/{local-roots-DMwIh5cS.js → local-roots-DhZz0Ybs.js} +6 -6
- package/dist/{login-qr-Batf3PT5.js → login-qr-AP9agO-i.js} +13 -13
- package/dist/{login-CwCoxapk.js → login-ul8zaw_S.js} +7 -7
- package/dist/{manager-D_LwXbc6.js → manager-PprhCvO_.js} +25 -25
- package/dist/{manifest-registry-D0IQ3WuX.js → manifest-registry-yb7sAlu4.js} +2 -2
- package/dist/{markdown-tables-iMQQZu4Q.js → markdown-tables-C-BmIap8.js} +1 -1
- package/dist/{message-channel-Dz5lr5b0.js → message-channel-OlFBYAw8.js} +1 -1
- package/dist/{models-CPlSSoV0.js → models-Bo4iHJy-.js} +7 -8
- package/dist/{models-cli-BM2RWTmM.js → models-cli-6aNi3eN9.js} +7 -8
- package/dist/{models-cli-DDhpJuX3.js → models-cli-B5vh-XK8.js} +3 -3
- package/dist/{onboard-DpB21qno.js → onboard-Bm-pmstf.js} +2 -2
- package/dist/{onboard-channels-DjfS9mS6.js → onboard-channels-BRd1cXye.js} +1 -1
- package/dist/{onboard-channels-S0FbC25u.js → onboard-channels-CUl5U8kV.js} +1 -1
- package/dist/{onboard-BczLOUCW.js → onboard-f-GJ26Ix.js} +2 -2
- package/dist/{onboarding-CyPkawbg.js → onboarding-CvBDWlBJ.js} +3 -3
- package/dist/{onboarding--mrKZtpR.js → onboarding-DIVKvosg.js} +3 -3
- package/dist/{onboarding.finalize-0XoI3wLH.js → onboarding.finalize-DJX6mSLa.js} +6 -6
- package/dist/{onboarding.finalize-C0ijhYbg.js → onboarding.finalize-WSac-JKd.js} +5 -5
- package/dist/{outbound-D4fN_ZlE.js → outbound-CtMCmwxR.js} +7 -7
- package/dist/{outbound-attachment-DjNDa3zn.js → outbound-attachment-DJldbweZ.js} +2 -2
- package/dist/{paths-DLyHUt31.js → paths-CbQV9WEg.js} +2 -2
- package/dist/{pi-auth-json-0SYBFZTt.js → pi-auth-json-Bk8ERadJ.js} +10 -10
- package/dist/{pi-embedded-Cg70pjmm.js → pi-embedded-BmbbC1Sb.js} +20275 -20070
- package/dist/{pi-embedded-helpers-lgx_U5KS.js → pi-embedded-helpers-B8kqLWns.js} +4 -4
- package/dist/{pi-embedded-helpers-DLFjnVBb.js → pi-embedded-helpers-CfqDGQ9J.js} +81 -81
- package/dist/{plugin-registry-VhRGXCLQ.js → plugin-registry-2zUJMasm.js} +1 -1
- package/dist/{plugin-registry-Dxo1iUfJ.js → plugin-registry-5yf-hu_W.js} +1 -1
- package/dist/plugin-sdk/agents/model-token-filter.d.ts +10 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner.d.ts +1 -1
- package/dist/plugin-sdk/agents/pi-tools.validate-wrapper.d.ts +23 -0
- package/dist/plugin-sdk/agents/pi-tools.validate.d.ts +26 -0
- package/dist/plugin-sdk/agents/tool-loop-detection.d.ts +3 -1
- package/dist/plugin-sdk/agents/unified-runner.d.ts +69 -1
- package/dist/plugin-sdk/auto-reply/reply/agent-runner-execution.d.ts +2 -2
- package/dist/plugin-sdk/{channel-web-DKo2tOO-.js → channel-web-DPyyTvFo.js} +1 -1
- package/dist/plugin-sdk/config/model-profiles.d.ts +2 -0
- package/dist/plugin-sdk/index.js +2 -2
- package/dist/plugin-sdk/infra/diagnostic-events.d.ts +1 -1
- package/dist/plugin-sdk/logging/diagnostic-session-state.d.ts +2 -0
- package/dist/plugin-sdk/logging/diagnostic.d.ts +1 -1
- package/dist/plugin-sdk/{reply-Ch4_18FZ.js → reply-QAcAd9ev.js} +536 -331
- package/dist/plugin-sdk/{tool-loop-detection-edmW8ZiF.js → tool-loop-detection-DU5sTIKg.js} +53 -3
- package/dist/plugin-sdk/{web-Dz2oyzw_.js → web-DaTTL9M0.js} +2 -2
- package/dist/{plugins-DQYI3Fr-.js → plugins-BzmbgY7s.js} +5 -5
- package/dist/{plugins-cli-zNr1ThAO.js → plugins-cli-D4eRESV2.js} +2 -2
- package/dist/{plugins-cli-DeDSnKlr.js → plugins-cli-DksVl33N.js} +2 -2
- package/dist/{program-COEKTv5u.js → program-BjORH7Cc.js} +7 -7
- package/dist/{program-context-CbM3x8lT.js → program-context-DaNGrTOm.js} +17 -17
- package/dist/{prompt-select-styled-d18_XWTb.js → prompt-select-styled-QaS2zul_.js} +4 -4
- package/dist/{prompt-select-styled-C6JLWNMU.js → prompt-select-styled-YOj4xigd.js} +4 -4
- package/dist/{provider-auth-helpers-BmH4oHwJ.js → provider-auth-helpers-BAGT_RXV.js} +1 -1
- package/dist/{provider-auth-helpers-C8cO9DLi.js → provider-auth-helpers-DCEbm2hz.js} +1 -1
- package/dist/{push-apns-CoqskfCc.js → push-apns-BECodU1i.js} +1 -1
- package/dist/{push-apns-CJtWrkQV.js → push-apns-Bek3ANJa.js} +1 -1
- package/dist/{pw-ai-De-KR9_s.js → pw-ai-1htA-NnS.js} +1 -1
- package/dist/{pw-ai-BnAKvSuw.js → pw-ai-m0mj2KWK.js} +16 -16
- package/dist/{qmd-manager-QHUP-_em.js → qmd-manager-iDLSiI4Z.js} +10 -10
- package/dist/{register.agent-C1Is84Q1.js → register.agent-B34lxx7F.js} +5 -5
- package/dist/{register.agent-fK3vOCU5.js → register.agent-DJHQo-Iq.js} +6 -6
- package/dist/{register.configure-CIwwqqt9.js → register.configure-BdhhIzb0.js} +6 -6
- package/dist/{register.configure-DFJeKFFK.js → register.configure-DC_-t5kj.js} +6 -6
- package/dist/{register.maintenance-BwTFd3Ax.js → register.maintenance-CITur3O_.js} +8 -8
- package/dist/{register.maintenance-DKDqruW6.js → register.maintenance-cs-A4kHF.js} +7 -7
- package/dist/{register.message-DYnXMP4c.js → register.message--RhtnEYn.js} +2 -2
- package/dist/{register.message-Ce57RPK8.js → register.message-PIaHm2pZ.js} +2 -2
- package/dist/{register.onboard-9glf-j43.js → register.onboard-CTJQoDcK.js} +4 -4
- package/dist/{register.onboard-Dj-_AJQr.js → register.onboard-DucZgrF7.js} +4 -4
- package/dist/{register.setup-C0CXUMFE.js → register.setup-2ZiUN7ui.js} +4 -4
- package/dist/{register.setup-Cp3DBI6D.js → register.setup-DD4Rgkt9.js} +4 -4
- package/dist/{register.status-health-sessions-DBXMyrNP.js → register.status-health-sessions-BqD7L8XL.js} +3 -3
- package/dist/{register.status-health-sessions-BncpB9Vw.js → register.status-health-sessions-sLgA92t7.js} +3 -3
- package/dist/{register.subclis-D6PmKJll.js → register.subclis-B2dGWFur.js} +9 -9
- package/dist/{registry-CK4e9hn8.js → registry-DYq1AYOv.js} +2 -2
- package/dist/{replies-BIX_isV7.js → replies-LSmuwOhA.js} +3 -3
- package/dist/{reply-BfZzgC9H.js → reply-DYnTEYoa.js} +537 -332
- package/dist/{reply-prefix-XlyuyChD.js → reply-prefix-DpqZu44Z.js} +1 -1
- package/dist/{resolve-route-CZ-1eqw0.js → resolve-route-C4_I4GFI.js} +5 -5
- package/dist/{retry-Cly39XZB.js → retry-BBVXkKBV.js} +1 -1
- package/dist/{run-main-wm3s04Xh.js → run-main-DWmu2b6D.js} +14 -14
- package/dist/{runner-DUBExAb5.js → runner-BcQ0sF9T.js} +1 -1
- package/dist/{runner-odEv83vv.js → runner-CU9l0uJh.js} +46 -46
- package/dist/{send-WyRqb4WD.js → send-CQAKg_12.js} +7 -7
- package/dist/{send-DeFniOjh.js → send-CVMyYPQw.js} +7 -7
- package/dist/{send-CiTGOvEc.js → send-CvhXrdgS.js} +12 -12
- package/dist/{send-DW96zgDL.js → send-DAN9hA5h.js} +6 -6
- package/dist/{send-B1u-LrcS.js → send-DYj_o4_F.js} +14 -14
- package/dist/{server-methods-D5zcFhng.js → server-methods-C8EWZt2g.js} +7 -7
- package/dist/{server-methods-xXv4ObXK.js → server-methods-vDGoM3xL.js} +7 -7
- package/dist/{server-node-events-BN7H6wBM.js → server-node-events-CKi12bol.js} +2 -2
- package/dist/{server-node-events-D4At7-pe.js → server-node-events-DFwGbkcO.js} +2 -2
- package/dist/{session-SM36BTsl.js → session-DSU1vxxi.js} +4 -4
- package/dist/{skill-commands-BJMb_psG.js → skill-commands-DcVwOafC.js} +17 -17
- package/dist/{skills-BFekKL7i.js → skills-Bs0AW1g3.js} +25 -25
- package/dist/{sqlite-DRbx2dhW.js → sqlite-D_mz1_-y.js} +17 -17
- package/dist/{status-XJTqV-CC.js → status--iNVOTMO.js} +2 -2
- package/dist/{status-PbQwO8SV.js → status-B1_iHrOg.js} +2 -2
- package/dist/{status-Nhvf_TEN.js → status-BQcdARV4.js} +1 -1
- package/dist/{status-C5rGEkur.js → status-DiX0DAtH.js} +1 -1
- package/dist/{store-C0wvOkae.js → store-01F_JM7O.js} +6 -6
- package/dist/{subagent-registry-DvCrN2PQ.js → subagent-registry-CXrOOgPW.js} +19438 -19233
- package/dist/{subsystem-Bs9YvKLa.js → subsystem-BjyjJF-d.js} +1 -1
- package/dist/{tables-DuZspiBu.js → tables-qMwbq29u.js} +1 -1
- package/dist/{target-errors-Be1SwYlW.js → target-errors-Bbr9rlzN.js} +2 -2
- package/dist/{thinking-CdlENGRW.js → thinking-BprCy23Z.js} +5 -5
- package/dist/{tokens-H1H1LiSQ.js → tokens-Bux9Y_xD.js} +1 -1
- package/dist/{tool-images-DXB7tqWi.js → tool-images-SqqWIT22.js} +2 -2
- package/dist/{tool-loop-detection-BgbtzUGc.js → tool-loop-detection-C7TCF2V2.js} +53 -3
- package/dist/{tool-loop-detection-BU3fbtCd.js → tool-loop-detection-D7qjFnRh.js} +53 -3
- package/dist/{tool-loop-detection-B6j1r-Wk.js → tool-loop-detection-DPVtQOfM.js} +53 -3
- package/dist/{tool-loop-detection-Cs8_HCsx.js → tool-loop-detection-DR_rrIA1.js} +56 -6
- package/dist/{pi-embedded-CTBkDXkV.js → unified-runner-CulJZMxc.js} +69924 -69719
- package/dist/{update-cli-BHxqriaA.js → update-cli-560gprSp.js} +7 -7
- package/dist/{update-cli-IqwjBYS0.js → update-cli-D1pLX3eo.js} +8 -8
- package/dist/{update-runner-BuoOzUcX.js → update-runner-BQxFFCGc.js} +1 -1
- package/dist/{update-runner-BFwirE1P.js → update-runner-CLKHrONW.js} +1 -1
- package/dist/{web-C4CDNJmR.js → web-Bqrgp43v.js} +1 -1
- package/dist/{web-OSVyyJa9.js → web-D4qJ9XKP.js} +6 -6
- package/dist/{web-Cr6E8Ych.js → web-Dr5cOn-1.js} +2 -2
- package/dist/{web-Dti17mxB.js → web-hHX9a9YO.js} +64 -64
- package/dist/{whatsapp-actions-D1RsnX7P.js → whatsapp-actions-BIeSWsCF.js} +25 -25
- package/dist/{workspace-wAaHI8-5.js → workspace-DscDraUb.js} +28 -28
- package/extensions/bluebubbles/node_modules/.bin/symi +0 -0
- package/extensions/copilot-proxy/node_modules/.bin/symi +0 -0
- package/extensions/diagnostics-otel/node_modules/.bin/acorn +0 -0
- package/extensions/diagnostics-otel/node_modules/.bin/symi +0 -0
- package/extensions/discord/node_modules/.bin/symi +0 -0
- package/extensions/feishu/node_modules/.bin/symi +0 -0
- package/extensions/google-antigravity-auth/node_modules/.bin/symi +0 -0
- package/extensions/google-gemini-cli-auth/node_modules/.bin/symi +0 -0
- package/extensions/googlechat/node_modules/.bin/symi +0 -0
- package/extensions/imessage/node_modules/.bin/symi +0 -0
- package/extensions/irc/node_modules/.bin/symi +0 -0
- package/extensions/learning-loop/node_modules/.bin/symi +0 -0
- package/extensions/line/node_modules/.bin/symi +0 -0
- package/extensions/matrix/node_modules/.bin/markdown-it +0 -0
- package/extensions/matrix/node_modules/.bin/symi +0 -0
- package/extensions/mattermost/node_modules/.bin/symi +0 -0
- package/extensions/memory-core/node_modules/.bin/symi +0 -0
- package/extensions/memory-lancedb/node_modules/.bin/arrow2csv +0 -0
- package/extensions/memory-lancedb/node_modules/.bin/openai +0 -0
- package/extensions/memory-lancedb/node_modules/.bin/symi +0 -0
- package/extensions/minimax-portal-auth/node_modules/.bin/symi +0 -0
- package/extensions/msteams/node_modules/.bin/symi +0 -0
- package/extensions/nextcloud-talk/node_modules/.bin/symi +0 -0
- package/extensions/nostr/node_modules/.bin/symi +0 -0
- package/extensions/nostr/node_modules/.bin/tsc +0 -0
- package/extensions/nostr/node_modules/.bin/tsserver +0 -0
- package/extensions/signal/node_modules/.bin/symi +0 -0
- package/extensions/slack/node_modules/.bin/symi +0 -0
- package/extensions/telegram/node_modules/.bin/symi +0 -0
- package/extensions/tlon/node_modules/.bin/symi +0 -0
- package/extensions/twitch/node_modules/.bin/symi +0 -0
- package/extensions/voice-call/node_modules/.bin/symi +0 -0
- package/extensions/whatsapp/node_modules/.bin/symi +0 -0
- package/extensions/zalo/node_modules/.bin/symi +0 -0
- package/extensions/zalouser/node_modules/.bin/symi +0 -0
- package/package.json +83 -113
- package/skills/nano-banana-pro/scripts/generate_image.py +0 -0
- package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +0 -0
- package/skills/tmux/scripts/find-sessions.sh +0 -0
- package/skills/tmux/scripts/wait-for-text.sh +0 -0
- package/dist/paths-Cce4PUkG.js +0 -212
- /package/dist/{boolean-B8-BqKGQ.js → boolean-CE7i9tBR.js} +0 -0
- /package/dist/{chat-type-C_KiWNAH.js → chat-type-3FRbbjbq.js} +0 -0
- /package/dist/{diagnostic-session-state-Bxo4UHOL.js → diagnostic-session-state-Zw87xFym.js} +0 -0
- /package/dist/{legacy-names-BHV4AoFT.js → legacy-names-CePMUvus.js} +0 -0
- /package/dist/{pi-model-discovery-DaNAekda.js → pi-model-discovery-Bv5YDJc8.js} +0 -0
- /package/dist/{redact-jSxx6Ep2.js → redact-BDMXB06K.js} +0 -0
- /package/dist/{ssrf-BTMDZjHT.js → ssrf-DpUUUgkK.js} +0 -0
- /package/dist/{targets-CFovdgJI.js → targets-DGkXkFPj.js} +0 -0
- /package/dist/{transcript-events-DDYvbmRV.js → transcript-events-BBh3Gsrx.js} +0 -0
|
@@ -22402,7 +22402,8 @@ const BUILTIN_PROFILES = [
|
|
|
22402
22402
|
"<end_of_turn>"
|
|
22403
22403
|
],
|
|
22404
22404
|
suppressMonologue: true,
|
|
22405
|
-
hasStructuredThinking: false
|
|
22405
|
+
hasStructuredThinking: false,
|
|
22406
|
+
validateToolArgs: true
|
|
22406
22407
|
},
|
|
22407
22408
|
promptAdditions: [
|
|
22408
22409
|
"CRITICAL OUTPUT RULES:",
|
|
@@ -22412,7 +22413,8 @@ const BUILTIN_PROFILES = [
|
|
|
22412
22413
|
"- Do not write verification checklists, self-assessments, or numbered assessment lists after your answer.",
|
|
22413
22414
|
"- Do not write 'Verification:', 'Requirements:', 'Status Check:', or 'Everything is correct'.",
|
|
22414
22415
|
"- If you need to verify your work, do so before writing your response, not after.",
|
|
22415
|
-
"- Send brief progress updates on long tasks so the user knows you are active."
|
|
22416
|
+
"- Send brief progress updates on long tasks so the user knows you are active.",
|
|
22417
|
+
"- When calling tools, provide arguments as clean values only. Never include <|, |>, or XML-like tags in tool argument values. For exec/bash commands, provide only valid shell syntax."
|
|
22416
22418
|
],
|
|
22417
22419
|
ui: {
|
|
22418
22420
|
badge: "Local",
|
|
@@ -22436,7 +22438,8 @@ const BUILTIN_PROFILES = [
|
|
|
22436
22438
|
filters: {
|
|
22437
22439
|
stripPatterns: [],
|
|
22438
22440
|
suppressMonologue: false,
|
|
22439
|
-
hasStructuredThinking: true
|
|
22441
|
+
hasStructuredThinking: true,
|
|
22442
|
+
validateToolArgs: false
|
|
22440
22443
|
},
|
|
22441
22444
|
promptAdditions: [],
|
|
22442
22445
|
ui: {
|
|
@@ -22470,7 +22473,8 @@ const BUILTIN_PROFILES = [
|
|
|
22470
22473
|
"^\\s*<bos>\\s*"
|
|
22471
22474
|
],
|
|
22472
22475
|
suppressMonologue: true,
|
|
22473
|
-
hasStructuredThinking: false
|
|
22476
|
+
hasStructuredThinking: false,
|
|
22477
|
+
validateToolArgs: true
|
|
22474
22478
|
},
|
|
22475
22479
|
promptAdditions: [
|
|
22476
22480
|
"CRITICAL OUTPUT RULES:",
|
|
@@ -22481,7 +22485,8 @@ const BUILTIN_PROFILES = [
|
|
|
22481
22485
|
"- Do not write 'Verification:', 'Requirements:', 'Status Check:', or 'Everything is correct'.",
|
|
22482
22486
|
"- If you need to verify your work, do so before writing your response, not after.",
|
|
22483
22487
|
"- Keep planning and reasoning internal. Only speak when you have a result or need user input.",
|
|
22484
|
-
"- When working on multi-step tasks, send a brief one-line status update so the user knows you are active."
|
|
22488
|
+
"- When working on multi-step tasks, send a brief one-line status update so the user knows you are active.",
|
|
22489
|
+
"- When calling tools, provide arguments as clean values only. Never include <|, |>, or XML-like tags in tool argument values. For exec/bash commands, provide only valid shell syntax."
|
|
22485
22490
|
],
|
|
22486
22491
|
ui: {
|
|
22487
22492
|
badge: "CoreWeave",
|
|
@@ -22509,7 +22514,8 @@ const FALLBACK_PROFILE = {
|
|
|
22509
22514
|
filters: {
|
|
22510
22515
|
stripPatterns: [],
|
|
22511
22516
|
suppressMonologue: false,
|
|
22512
|
-
hasStructuredThinking: false
|
|
22517
|
+
hasStructuredThinking: false,
|
|
22518
|
+
validateToolArgs: false
|
|
22513
22519
|
},
|
|
22514
22520
|
promptAdditions: [],
|
|
22515
22521
|
ui: {
|
|
@@ -22936,6 +22942,19 @@ function stripModelTokensAggressive(text, modelId) {
|
|
|
22936
22942
|
}
|
|
22937
22943
|
return result;
|
|
22938
22944
|
}
|
|
22945
|
+
/**
|
|
22946
|
+
* Clean residual fragments left after aggressive token stripping.
|
|
22947
|
+
* After `<|` and `|>` are removed, orphaned `<`, `"`, `|` can remain
|
|
22948
|
+
* at string boundaries (e.g., `<<|"|uname -a` → `<"uname -a`).
|
|
22949
|
+
*
|
|
22950
|
+
* Conservative: only trims leading junk before what looks like a command,
|
|
22951
|
+
* and trailing junk. Does NOT touch content in the middle of the string.
|
|
22952
|
+
* Preserves heredoc syntax (`<<EOF`, `<<"EOF"`) via negative lookahead.
|
|
22953
|
+
*/
|
|
22954
|
+
function cleanResidualTokenFragments(text) {
|
|
22955
|
+
if (!text) return text;
|
|
22956
|
+
return text.replace(/^[<"|]+(?!<[A-Z_])(?=[a-zA-Z0-9/~$.(])/gm, "").replace(/[<"|]+$/gm, "").trim();
|
|
22957
|
+
}
|
|
22939
22958
|
|
|
22940
22959
|
//#endregion
|
|
22941
22960
|
//#region src/agents/output-normalizer.ts
|
|
@@ -23021,10 +23040,14 @@ function detectRepetition(text, minBlock) {
|
|
|
23021
23040
|
const searchStart = sampleStart + minBlock;
|
|
23022
23041
|
return text.indexOf(sample, searchStart) >= 0;
|
|
23023
23042
|
}
|
|
23043
|
+
function sanitizeStringValue(value, modelId) {
|
|
23044
|
+
const stripped = stripModelTokensAggressive(value, modelId);
|
|
23045
|
+
return isGemmaModel$1(modelId) ? cleanResidualTokenFragments(stripped) : stripped;
|
|
23046
|
+
}
|
|
23024
23047
|
function sanitizeArgs(args, modelId) {
|
|
23025
23048
|
const result = {};
|
|
23026
|
-
for (const [key, value] of Object.entries(args)) if (typeof value === "string") result[key] =
|
|
23027
|
-
else if (Array.isArray(value)) result[key] = value.map((item) => typeof item === "string" ?
|
|
23049
|
+
for (const [key, value] of Object.entries(args)) if (typeof value === "string") result[key] = sanitizeStringValue(value, modelId);
|
|
23050
|
+
else if (Array.isArray(value)) result[key] = value.map((item) => typeof item === "string" ? sanitizeStringValue(item, modelId) : item && typeof item === "object" ? sanitizeArgs(item, modelId) : item);
|
|
23028
23051
|
else if (value && typeof value === "object") result[key] = sanitizeArgs(value, modelId);
|
|
23029
23052
|
else result[key] = value;
|
|
23030
23053
|
return result;
|
|
@@ -25108,7 +25131,7 @@ async function recordLoopOutcome(args) {
|
|
|
25108
25131
|
if (!args.ctx?.sessionKey) return;
|
|
25109
25132
|
try {
|
|
25110
25133
|
const { getDiagnosticSessionState } = await import("./diagnostic-session-state-CUslJyKP.js").then((n) => n.n);
|
|
25111
|
-
const { recordToolCallOutcome } = await import("./tool-loop-detection-
|
|
25134
|
+
const { recordToolCallOutcome } = await import("./tool-loop-detection-DPVtQOfM.js");
|
|
25112
25135
|
recordToolCallOutcome(getDiagnosticSessionState({
|
|
25113
25136
|
sessionKey: args.ctx.sessionKey,
|
|
25114
25137
|
sessionId: args.ctx?.agentId
|
|
@@ -25130,7 +25153,7 @@ async function runBeforeToolCallHook(args) {
|
|
|
25130
25153
|
if (args.ctx?.sessionKey) {
|
|
25131
25154
|
const { getDiagnosticSessionState } = await import("./diagnostic-session-state-CUslJyKP.js").then((n) => n.n);
|
|
25132
25155
|
const { logToolLoopAction } = await import("./diagnostic-DjBRPfu9.js").then((n) => n.n);
|
|
25133
|
-
const { detectToolCallLoop, recordToolCall } = await import("./tool-loop-detection-
|
|
25156
|
+
const { detectToolCallLoop, recordToolCall } = await import("./tool-loop-detection-DPVtQOfM.js");
|
|
25134
25157
|
const sessionState = getDiagnosticSessionState({
|
|
25135
25158
|
sessionKey: args.ctx.sessionKey,
|
|
25136
25159
|
sessionId: args.ctx?.agentId
|
|
@@ -25401,6 +25424,88 @@ function toClientToolDefinitions(tools, onClientToolCall, hookContext) {
|
|
|
25401
25424
|
});
|
|
25402
25425
|
}
|
|
25403
25426
|
|
|
25427
|
+
//#endregion
|
|
25428
|
+
//#region src/agents/pi-tools.validate.ts
|
|
25429
|
+
/**
|
|
25430
|
+
* Tool argument validation — validates that exec/bash commands contain
|
|
25431
|
+
* valid shell syntax after model token sanitization.
|
|
25432
|
+
*
|
|
25433
|
+
* Gated on ModelProfile.filters.validateToolArgs — only active for
|
|
25434
|
+
* models known to leak control tokens into structured output (Gemma, Ollama).
|
|
25435
|
+
*
|
|
25436
|
+
* @module
|
|
25437
|
+
*/
|
|
25438
|
+
/**
|
|
25439
|
+
* Validate that a command string contains extractable valid shell syntax.
|
|
25440
|
+
* Returns the cleaned command if valid, or an error reason if not.
|
|
25441
|
+
*
|
|
25442
|
+
* Does NOT attempt to parse the full shell grammar — just checks for
|
|
25443
|
+
* obvious corruption (residual control tokens, empty commands).
|
|
25444
|
+
* Preserves heredocs, redirects, pipes, and other legitimate shell syntax.
|
|
25445
|
+
*/
|
|
25446
|
+
function validateShellCommand(command) {
|
|
25447
|
+
if (!command || !command.trim()) return {
|
|
25448
|
+
valid: false,
|
|
25449
|
+
cleaned: "",
|
|
25450
|
+
reason: "empty command"
|
|
25451
|
+
};
|
|
25452
|
+
let cleaned = cleanResidualTokenFragments(command);
|
|
25453
|
+
if (/(?:^|[^<])<\|/.test(cleaned) || /\|>/.test(cleaned)) {
|
|
25454
|
+
cleaned = cleaned.replace(/<\|[^|>]*(?:\|>)?/g, "").trim();
|
|
25455
|
+
cleaned = cleanResidualTokenFragments(cleaned);
|
|
25456
|
+
}
|
|
25457
|
+
if (!cleaned || !cleaned.trim()) return {
|
|
25458
|
+
valid: false,
|
|
25459
|
+
cleaned: "",
|
|
25460
|
+
reason: "command is empty after removing control tokens"
|
|
25461
|
+
};
|
|
25462
|
+
if (!/[a-zA-Z0-9_/.~-]/.test(cleaned)) return {
|
|
25463
|
+
valid: false,
|
|
25464
|
+
cleaned,
|
|
25465
|
+
reason: "no recognizable shell command found"
|
|
25466
|
+
};
|
|
25467
|
+
return {
|
|
25468
|
+
valid: true,
|
|
25469
|
+
cleaned: cleaned.trim()
|
|
25470
|
+
};
|
|
25471
|
+
}
|
|
25472
|
+
|
|
25473
|
+
//#endregion
|
|
25474
|
+
//#region src/agents/pi-tools.validate-wrapper.ts
|
|
25475
|
+
const EXEC_TOOL_NAMES = new Set(["exec", "bash"]);
|
|
25476
|
+
/**
|
|
25477
|
+
* Wrap tools with argument validation. Only exec/bash tools are validated.
|
|
25478
|
+
* Other tools pass through unchanged.
|
|
25479
|
+
*
|
|
25480
|
+
* Call this AFTER tools are created and the model profile is resolved.
|
|
25481
|
+
*/
|
|
25482
|
+
function wrapToolsWithArgValidation(tools, profile) {
|
|
25483
|
+
if (!profile.filters?.validateToolArgs) return tools;
|
|
25484
|
+
return tools.map((tool) => wrapToolWithArgValidation(tool));
|
|
25485
|
+
}
|
|
25486
|
+
/**
|
|
25487
|
+
* Wrap a single tool with argument validation for exec/bash commands.
|
|
25488
|
+
*/
|
|
25489
|
+
function wrapToolWithArgValidation(tool) {
|
|
25490
|
+
const toolName = (tool.name ?? "").toLowerCase().trim();
|
|
25491
|
+
if (!EXEC_TOOL_NAMES.has(toolName)) return tool;
|
|
25492
|
+
const originalExecute = tool.execute;
|
|
25493
|
+
return {
|
|
25494
|
+
...tool,
|
|
25495
|
+
execute(toolCallId, params, ...rest) {
|
|
25496
|
+
const command = params.command ?? params.cmd;
|
|
25497
|
+
if (typeof command !== "string") return originalExecute.call(tool, toolCallId, params, ...rest);
|
|
25498
|
+
const result = validateShellCommand(command);
|
|
25499
|
+
if (!result.valid) return Promise.resolve({ output: `Error: ${result.reason}. The command appears to contain model control tokens. Please provide a clean shell command without any <|, |>, or XML-like tags. Only valid shell syntax is accepted.` });
|
|
25500
|
+
if (result.cleaned !== command) return originalExecute.call(tool, toolCallId, {
|
|
25501
|
+
...params,
|
|
25502
|
+
command: result.cleaned
|
|
25503
|
+
}, ...rest);
|
|
25504
|
+
return originalExecute.call(tool, toolCallId, params, ...rest);
|
|
25505
|
+
}
|
|
25506
|
+
};
|
|
25507
|
+
}
|
|
25508
|
+
|
|
25404
25509
|
//#endregion
|
|
25405
25510
|
//#region src/agents/plan-mode.ts
|
|
25406
25511
|
/**
|
|
@@ -29483,10 +29588,11 @@ async function runEmbeddedAttempt(params) {
|
|
|
29483
29588
|
await resourceLoader.reload();
|
|
29484
29589
|
}
|
|
29485
29590
|
const hookRunner = getGlobalHookRunner();
|
|
29486
|
-
const { builtInTools, customTools } = splitSdkTools({
|
|
29591
|
+
const { builtInTools: rawBuiltInTools, customTools } = splitSdkTools({
|
|
29487
29592
|
tools,
|
|
29488
29593
|
sandboxEnabled: !!sandbox?.enabled
|
|
29489
29594
|
});
|
|
29595
|
+
const builtInTools = wrapToolsWithArgValidation(rawBuiltInTools, modelProfile);
|
|
29490
29596
|
let clientToolCallDetected = null;
|
|
29491
29597
|
const clientToolLoopDetection = resolveToolLoopDetectionConfig({
|
|
29492
29598
|
cfg: params.config,
|
|
@@ -31034,7 +31140,8 @@ async function runAgentTurn(params) {
|
|
|
31034
31140
|
const cb = params.callbacks;
|
|
31035
31141
|
const sessionFile = resolveSessionFilePath(params.sessionId, void 0, { agentId });
|
|
31036
31142
|
const profile = resolveModelProfile(params.provider && params.modelId ? `${params.provider}/${params.modelId}` : params.config.agents?.defaults?.model?.primary ?? "", params.config.models?.profiles);
|
|
31037
|
-
const
|
|
31143
|
+
const toolsUsed = [];
|
|
31144
|
+
const buildInternalParams = (providerOverride, modelOverride) => ({
|
|
31038
31145
|
sessionId: params.sessionId,
|
|
31039
31146
|
sessionKey: params.sessionKey,
|
|
31040
31147
|
agentId,
|
|
@@ -31049,14 +31156,28 @@ async function runAgentTurn(params) {
|
|
|
31049
31156
|
extraSystemPrompt: params.extraSystemPrompt,
|
|
31050
31157
|
clientTools: params.clientTools,
|
|
31051
31158
|
disableTools: params.disableTools,
|
|
31052
|
-
provider: params.provider,
|
|
31053
|
-
model: params.modelId,
|
|
31159
|
+
provider: providerOverride ?? params.provider,
|
|
31160
|
+
model: modelOverride ?? params.modelId,
|
|
31054
31161
|
authProfileId: params.authProfileId,
|
|
31055
31162
|
authProfileIdSource: params.authProfileIdSource,
|
|
31056
31163
|
thinkLevel: params.thinkLevel,
|
|
31057
31164
|
reasoningLevel: params.reasoningLevel,
|
|
31058
31165
|
timeoutMs: params.timeoutMs,
|
|
31059
31166
|
abortSignal: params.abortSignal,
|
|
31167
|
+
lane: params.lane,
|
|
31168
|
+
toolResultFormat: params.toolResultFormat,
|
|
31169
|
+
verboseLevel: params.verboseLevel,
|
|
31170
|
+
ownerNumbers: params.ownerNumbers,
|
|
31171
|
+
enforceFinalTag: params.enforceFinalTag,
|
|
31172
|
+
execOverrides: params.execOverrides,
|
|
31173
|
+
bashElevated: params.bashElevated,
|
|
31174
|
+
suppressToolErrorWarnings: params.suppressToolErrorWarnings,
|
|
31175
|
+
streamParams: params.streamParams,
|
|
31176
|
+
blockReplyBreak: params.blockReplyBreak,
|
|
31177
|
+
blockReplyChunking: params.blockReplyChunking,
|
|
31178
|
+
requireExplicitMessageTarget: params.requireExplicitMessageTarget,
|
|
31179
|
+
disableMessageTool: params.disableMessageTool,
|
|
31180
|
+
symipulseMs: params.symipulseMs,
|
|
31060
31181
|
messageChannel: ch?.messageChannel,
|
|
31061
31182
|
messageProvider: ch?.messageProvider,
|
|
31062
31183
|
agentAccountId: ch?.agentAccountId,
|
|
@@ -31078,26 +31199,92 @@ async function runAgentTurn(params) {
|
|
|
31078
31199
|
onPartialReply: cb?.onDelta ? (payload) => {
|
|
31079
31200
|
if (payload.text) cb.onDelta(payload.text);
|
|
31080
31201
|
} : void 0,
|
|
31202
|
+
onAssistantMessageStart: cb?.onTypingStart ? () => {
|
|
31203
|
+
cb.onTypingStart();
|
|
31204
|
+
cb?.onLifecycle?.("streaming");
|
|
31205
|
+
} : cb?.onLifecycle ? () => {
|
|
31206
|
+
cb.onLifecycle("streaming");
|
|
31207
|
+
} : void 0,
|
|
31081
31208
|
onToolResult: cb?.onToolResult ? (payload) => {
|
|
31082
31209
|
if (payload.text) cb.onToolResult("tool", payload.text);
|
|
31083
31210
|
} : void 0,
|
|
31084
31211
|
onReasoningStream: cb?.onThinking ? (payload) => {
|
|
31085
31212
|
if (payload.text) cb.onThinking(payload.text);
|
|
31086
31213
|
} : void 0,
|
|
31087
|
-
|
|
31214
|
+
onBlockReply: cb?.onBlockReply ? (payload) => {
|
|
31215
|
+
cb.onBlockReply({
|
|
31216
|
+
...payload,
|
|
31217
|
+
isFinal: false
|
|
31218
|
+
});
|
|
31219
|
+
} : void 0,
|
|
31220
|
+
onBlockReplyFlush: cb?.onBlockReplyFlush,
|
|
31221
|
+
onAgentEvent: (evt) => {
|
|
31222
|
+
cb?.onAgentEvent?.(evt);
|
|
31223
|
+
const stream = evt.stream;
|
|
31224
|
+
const data = evt.data;
|
|
31225
|
+
const phase = typeof data?.phase === "string" ? data.phase : "";
|
|
31226
|
+
if (stream === "lifecycle") {
|
|
31227
|
+
if (phase === "start") {
|
|
31228
|
+
cb?.onLifecycle?.("start");
|
|
31229
|
+
cb?.onTypingStart?.();
|
|
31230
|
+
} else if (phase === "end") cb?.onTypingStop?.();
|
|
31231
|
+
else if (phase === "error") {
|
|
31232
|
+
cb?.onLifecycle?.("error");
|
|
31233
|
+
cb?.onTypingStop?.();
|
|
31234
|
+
if (cb?.onError && typeof data?.error === "string") cb.onError(new Error(data.error));
|
|
31235
|
+
}
|
|
31236
|
+
}
|
|
31237
|
+
if (stream === "tool") {
|
|
31238
|
+
const toolName = typeof data?.name === "string" ? data.name : "";
|
|
31239
|
+
if (phase === "start" && toolName) {
|
|
31240
|
+
toolsUsed.push(toolName);
|
|
31241
|
+
cb?.onToolStart?.(toolName, data?.args ?? {});
|
|
31242
|
+
cb?.onTypingStart?.();
|
|
31243
|
+
}
|
|
31244
|
+
}
|
|
31245
|
+
if (stream === "compaction" && phase === "end") cb?.onCompaction?.({
|
|
31246
|
+
tokensBefore: typeof data?.tokensBefore === "number" ? data.tokensBefore : 0,
|
|
31247
|
+
tokensAfter: typeof data?.tokensAfter === "number" ? data.tokensAfter : 0
|
|
31248
|
+
});
|
|
31249
|
+
}
|
|
31088
31250
|
});
|
|
31251
|
+
let result;
|
|
31252
|
+
let fallbackProvider;
|
|
31253
|
+
let fallbackModel;
|
|
31254
|
+
const TRANSIENT_RETRY_DELAY_MS = 2500;
|
|
31255
|
+
const maxAttempts = params.retryOnTransientError ? 2 : 1;
|
|
31256
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) try {
|
|
31257
|
+
if (params.fallbackModels?.length) {
|
|
31258
|
+
const fallbackResult = await runWithModelFallback({
|
|
31259
|
+
cfg: params.config,
|
|
31260
|
+
provider: params.provider ?? "",
|
|
31261
|
+
model: params.modelId ?? "",
|
|
31262
|
+
agentDir,
|
|
31263
|
+
fallbacksOverride: params.fallbackModels,
|
|
31264
|
+
run: (provider, model) => runEmbeddedPiAgent(buildInternalParams(provider, model)),
|
|
31265
|
+
onError: async (fallbackAttempt) => {
|
|
31266
|
+
const fromModel = `${fallbackAttempt.provider}/${fallbackAttempt.model}`;
|
|
31267
|
+
cb?.onFallback?.(fromModel, "(next)", String(fallbackAttempt.error));
|
|
31268
|
+
}
|
|
31269
|
+
});
|
|
31270
|
+
result = fallbackResult.result;
|
|
31271
|
+
fallbackProvider = fallbackResult.provider;
|
|
31272
|
+
fallbackModel = fallbackResult.model;
|
|
31273
|
+
} else result = await runEmbeddedPiAgent(buildInternalParams());
|
|
31274
|
+
break;
|
|
31275
|
+
} catch (err) {
|
|
31276
|
+
const errMsg = err instanceof Error ? err.message : String(err);
|
|
31277
|
+
if (params.retryOnTransientError && attempt < maxAttempts - 1 && isTransientHttpError(errMsg)) {
|
|
31278
|
+
await new Promise((resolve) => setTimeout(resolve, TRANSIENT_RETRY_DELAY_MS));
|
|
31279
|
+
continue;
|
|
31280
|
+
}
|
|
31281
|
+
throw err;
|
|
31282
|
+
}
|
|
31283
|
+
result = result;
|
|
31089
31284
|
const responseText = (result.payloads ?? []).filter((p) => p.text && !p.isError).map((p) => p.text).join("\n").trim();
|
|
31090
|
-
const resolvedProvider = result.meta.agentMeta?.provider ?? params.provider ?? "";
|
|
31091
|
-
const resolvedModel = result.meta.agentMeta?.model ?? params.modelId ?? "";
|
|
31092
|
-
|
|
31093
|
-
provider: resolvedProvider,
|
|
31094
|
-
modelId: resolvedModel,
|
|
31095
|
-
tokenCount: result.meta.agentMeta?.usage?.total ?? 0,
|
|
31096
|
-
durationMs: Date.now() - startTime,
|
|
31097
|
-
toolsUsed: []
|
|
31098
|
-
});
|
|
31099
|
-
if (cb?.onLifecycle) await cb.onLifecycle(result.meta.error ? "error" : "end");
|
|
31100
|
-
return {
|
|
31285
|
+
const resolvedProvider = fallbackProvider ?? result.meta.agentMeta?.provider ?? params.provider ?? "";
|
|
31286
|
+
const resolvedModel = fallbackModel ?? result.meta.agentMeta?.model ?? params.modelId ?? "";
|
|
31287
|
+
const turnResult = {
|
|
31101
31288
|
text: responseText,
|
|
31102
31289
|
durationMs: Date.now() - startTime,
|
|
31103
31290
|
provider: resolvedProvider,
|
|
@@ -31106,6 +31293,23 @@ async function runAgentTurn(params) {
|
|
|
31106
31293
|
didSendViaMessagingTool: result.didSendViaMessagingTool ?? false,
|
|
31107
31294
|
rawResult: result
|
|
31108
31295
|
};
|
|
31296
|
+
if (params.postRunHooks?.length) {
|
|
31297
|
+
for (const hook of params.postRunHooks) if (hook.shouldRun(turnResult)) try {
|
|
31298
|
+
await hook.execute(turnResult, params);
|
|
31299
|
+
} catch (hookErr) {
|
|
31300
|
+
if (cb?.onError && hookErr instanceof Error) cb.onError(hookErr);
|
|
31301
|
+
}
|
|
31302
|
+
turnResult.durationMs = Date.now() - startTime;
|
|
31303
|
+
}
|
|
31304
|
+
if (cb?.onFinal) await cb.onFinal(responseText, {
|
|
31305
|
+
provider: resolvedProvider,
|
|
31306
|
+
modelId: resolvedModel,
|
|
31307
|
+
tokenCount: result.meta.agentMeta?.usage?.total ?? 0,
|
|
31308
|
+
durationMs: turnResult.durationMs,
|
|
31309
|
+
toolsUsed
|
|
31310
|
+
});
|
|
31311
|
+
if (cb?.onLifecycle) await cb.onLifecycle(result.meta.error ? "error" : "end");
|
|
31312
|
+
return turnResult;
|
|
31109
31313
|
}
|
|
31110
31314
|
|
|
31111
31315
|
//#endregion
|
|
@@ -31113,7 +31317,7 @@ async function runAgentTurn(params) {
|
|
|
31113
31317
|
function createDefaultDeps() {
|
|
31114
31318
|
return {
|
|
31115
31319
|
sendMessageWhatsApp: async (...args) => {
|
|
31116
|
-
const { sendMessageWhatsApp } = await import("./web-
|
|
31320
|
+
const { sendMessageWhatsApp } = await import("./web-Dr5cOn-1.js");
|
|
31117
31321
|
return await sendMessageWhatsApp(...args);
|
|
31118
31322
|
},
|
|
31119
31323
|
sendMessageTelegram: async (...args) => {
|
|
@@ -49544,7 +49748,7 @@ function loadWebLoginQr() {
|
|
|
49544
49748
|
return webLoginQrPromise;
|
|
49545
49749
|
}
|
|
49546
49750
|
function loadWebChannel() {
|
|
49547
|
-
webChannelPromise ??= import("./web-
|
|
49751
|
+
webChannelPromise ??= import("./web-Dr5cOn-1.js");
|
|
49548
49752
|
return webChannelPromise;
|
|
49549
49753
|
}
|
|
49550
49754
|
function loadWhatsAppActions() {
|
|
@@ -70141,7 +70345,6 @@ function createBlockReplyDeliveryHandler(params) {
|
|
|
70141
70345
|
//#endregion
|
|
70142
70346
|
//#region src/auto-reply/reply/agent-runner-execution.ts
|
|
70143
70347
|
async function runAgentTurnWithFallback(params) {
|
|
70144
|
-
const TRANSIENT_HTTP_RETRY_DELAY_MS = 2500;
|
|
70145
70348
|
let didLogHeartbeatStrip = false;
|
|
70146
70349
|
let autoCompactionCompleted = false;
|
|
70147
70350
|
const directlySentBlockKeys = /* @__PURE__ */ new Set();
|
|
@@ -70162,199 +70365,216 @@ async function runAgentTurnWithFallback(params) {
|
|
|
70162
70365
|
let fallbackModel = params.followupRun.run.model;
|
|
70163
70366
|
let fallbackAttempts = [];
|
|
70164
70367
|
let didResetAfterCompactionFailure = false;
|
|
70165
|
-
|
|
70166
|
-
|
|
70167
|
-
|
|
70168
|
-
|
|
70169
|
-
if (
|
|
70170
|
-
|
|
70171
|
-
|
|
70172
|
-
didLogHeartbeatStrip = true;
|
|
70173
|
-
logVerbose("Stripped stray SYMIPULSE_OK token from reply");
|
|
70174
|
-
}
|
|
70175
|
-
if (stripped.shouldSkip && (payload.mediaUrls?.length ?? 0) === 0) return { skip: true };
|
|
70176
|
-
text = stripped.text;
|
|
70177
|
-
}
|
|
70178
|
-
if (isSilentReplyText(text, SILENT_REPLY_TOKEN)) return { skip: true };
|
|
70179
|
-
if (!text) {
|
|
70180
|
-
if ((payload.mediaUrls?.length ?? 0) > 0) return {
|
|
70181
|
-
text: void 0,
|
|
70182
|
-
skip: false
|
|
70183
|
-
};
|
|
70184
|
-
return { skip: true };
|
|
70368
|
+
const normalizeStreamingText = (payload) => {
|
|
70369
|
+
let text = payload.text;
|
|
70370
|
+
if (!params.isHeartbeat && text?.includes("SYMIPULSE_OK")) {
|
|
70371
|
+
const stripped = stripHeartbeatToken(text, { mode: "message" });
|
|
70372
|
+
if (stripped.didStrip && !didLogHeartbeatStrip) {
|
|
70373
|
+
didLogHeartbeatStrip = true;
|
|
70374
|
+
logVerbose("Stripped stray SYMIPULSE_OK token from reply");
|
|
70185
70375
|
}
|
|
70186
|
-
|
|
70187
|
-
|
|
70188
|
-
|
|
70189
|
-
|
|
70376
|
+
if (stripped.shouldSkip && (payload.mediaUrls?.length ?? 0) === 0) return { skip: true };
|
|
70377
|
+
text = stripped.text;
|
|
70378
|
+
}
|
|
70379
|
+
if (isSilentReplyText(text, SILENT_REPLY_TOKEN)) return { skip: true };
|
|
70380
|
+
if (!text) {
|
|
70381
|
+
if ((payload.mediaUrls?.length ?? 0) > 0) return {
|
|
70382
|
+
text: void 0,
|
|
70190
70383
|
skip: false
|
|
70191
70384
|
};
|
|
70385
|
+
return { skip: true };
|
|
70386
|
+
}
|
|
70387
|
+
const sanitized = sanitizeUserFacingText(text, { errorContext: Boolean(payload.isError) });
|
|
70388
|
+
if (!sanitized.trim()) return { skip: true };
|
|
70389
|
+
return {
|
|
70390
|
+
text: sanitized,
|
|
70391
|
+
skip: false
|
|
70192
70392
|
};
|
|
70193
|
-
|
|
70194
|
-
|
|
70195
|
-
|
|
70196
|
-
|
|
70393
|
+
};
|
|
70394
|
+
const blockReplyPipeline = params.blockReplyPipeline;
|
|
70395
|
+
const onToolResult = params.opts?.onToolResult;
|
|
70396
|
+
let toolResultChain = Promise.resolve();
|
|
70397
|
+
const serializedOnToolResult = onToolResult ? (name, resultText) => {
|
|
70398
|
+
toolResultChain = toolResultChain.then(async () => {
|
|
70399
|
+
const { text, skip } = normalizeStreamingText({ text: resultText });
|
|
70400
|
+
if (skip) return;
|
|
70197
70401
|
await params.typingSignals.signalTextDelta(text);
|
|
70198
|
-
|
|
70199
|
-
|
|
70200
|
-
|
|
70201
|
-
|
|
70202
|
-
|
|
70203
|
-
|
|
70204
|
-
|
|
70205
|
-
|
|
70206
|
-
|
|
70207
|
-
|
|
70208
|
-
|
|
70209
|
-
|
|
70210
|
-
|
|
70211
|
-
|
|
70212
|
-
|
|
70213
|
-
|
|
70214
|
-
|
|
70215
|
-
|
|
70216
|
-
|
|
70217
|
-
|
|
70218
|
-
|
|
70219
|
-
|
|
70220
|
-
|
|
70221
|
-
|
|
70222
|
-
|
|
70223
|
-
let lifecycleTerminalEmitted = false;
|
|
70224
|
-
try {
|
|
70225
|
-
const result = await runCliAgent({
|
|
70226
|
-
sessionId: params.followupRun.run.sessionId,
|
|
70227
|
-
sessionKey: params.sessionKey,
|
|
70228
|
-
agentId: params.followupRun.run.agentId,
|
|
70229
|
-
sessionFile: params.followupRun.run.sessionFile,
|
|
70230
|
-
workspaceDir: params.followupRun.run.workspaceDir,
|
|
70231
|
-
config: params.followupRun.run.config,
|
|
70232
|
-
prompt: params.commandBody,
|
|
70233
|
-
provider,
|
|
70234
|
-
model,
|
|
70235
|
-
thinkLevel: params.followupRun.run.thinkLevel,
|
|
70236
|
-
timeoutMs: params.followupRun.run.timeoutMs,
|
|
70237
|
-
runId,
|
|
70238
|
-
extraSystemPrompt: params.followupRun.run.extraSystemPrompt,
|
|
70239
|
-
ownerNumbers: params.followupRun.run.ownerNumbers,
|
|
70240
|
-
cliSessionId,
|
|
70241
|
-
images: params.opts?.images
|
|
70242
|
-
});
|
|
70243
|
-
const cliText = result.payloads?.[0]?.text?.trim();
|
|
70244
|
-
if (cliText) emitAgentEvent({
|
|
70245
|
-
runId,
|
|
70246
|
-
stream: "assistant",
|
|
70247
|
-
data: { text: cliText }
|
|
70248
|
-
});
|
|
70249
|
-
emitAgentEvent({
|
|
70250
|
-
runId,
|
|
70251
|
-
stream: "lifecycle",
|
|
70252
|
-
data: {
|
|
70253
|
-
phase: "end",
|
|
70254
|
-
startedAt,
|
|
70255
|
-
endedAt: Date.now()
|
|
70256
|
-
}
|
|
70257
|
-
});
|
|
70258
|
-
lifecycleTerminalEmitted = true;
|
|
70259
|
-
return result;
|
|
70260
|
-
} catch (err) {
|
|
70261
|
-
emitAgentEvent({
|
|
70262
|
-
runId,
|
|
70263
|
-
stream: "lifecycle",
|
|
70264
|
-
data: {
|
|
70265
|
-
phase: "error",
|
|
70266
|
-
startedAt,
|
|
70267
|
-
endedAt: Date.now(),
|
|
70268
|
-
error: String(err)
|
|
70269
|
-
}
|
|
70270
|
-
});
|
|
70271
|
-
lifecycleTerminalEmitted = true;
|
|
70272
|
-
throw err;
|
|
70273
|
-
} finally {
|
|
70274
|
-
if (!lifecycleTerminalEmitted) emitAgentEvent({
|
|
70275
|
-
runId,
|
|
70276
|
-
stream: "lifecycle",
|
|
70277
|
-
data: {
|
|
70278
|
-
phase: "error",
|
|
70279
|
-
startedAt,
|
|
70280
|
-
endedAt: Date.now(),
|
|
70281
|
-
error: "CLI run completed without lifecycle terminal event"
|
|
70282
|
-
}
|
|
70283
|
-
});
|
|
70284
|
-
}
|
|
70285
|
-
})();
|
|
70402
|
+
await onToolResult({
|
|
70403
|
+
text,
|
|
70404
|
+
mediaUrls: void 0
|
|
70405
|
+
});
|
|
70406
|
+
}).catch((err) => {
|
|
70407
|
+
logVerbose(`tool result delivery failed: ${String(err)}`);
|
|
70408
|
+
});
|
|
70409
|
+
const task = toolResultChain.finally(() => {
|
|
70410
|
+
params.pendingToolTasks.delete(task);
|
|
70411
|
+
});
|
|
70412
|
+
params.pendingToolTasks.add(task);
|
|
70413
|
+
} : void 0;
|
|
70414
|
+
while (true) try {
|
|
70415
|
+
const run = params.followupRun.run;
|
|
70416
|
+
const resolvedProvider = run.provider;
|
|
70417
|
+
const resolvedModel = run.model;
|
|
70418
|
+
if (isCliProvider(resolvedProvider, run.config)) {
|
|
70419
|
+
const startedAt = Date.now();
|
|
70420
|
+
notifyAgentRunStart();
|
|
70421
|
+
emitAgentEvent({
|
|
70422
|
+
runId,
|
|
70423
|
+
stream: "lifecycle",
|
|
70424
|
+
data: {
|
|
70425
|
+
phase: "start",
|
|
70426
|
+
startedAt
|
|
70286
70427
|
}
|
|
70287
|
-
|
|
70288
|
-
|
|
70289
|
-
|
|
70290
|
-
|
|
70291
|
-
|
|
70428
|
+
});
|
|
70429
|
+
const cliSessionId = getCliSessionId(params.getActiveSessionEntry(), resolvedProvider);
|
|
70430
|
+
let lifecycleTerminalEmitted = false;
|
|
70431
|
+
try {
|
|
70432
|
+
const cliResult = await runCliAgent({
|
|
70433
|
+
sessionId: run.sessionId,
|
|
70434
|
+
sessionKey: params.sessionKey,
|
|
70435
|
+
agentId: run.agentId,
|
|
70436
|
+
sessionFile: run.sessionFile,
|
|
70437
|
+
workspaceDir: run.workspaceDir,
|
|
70438
|
+
config: run.config,
|
|
70439
|
+
prompt: params.commandBody,
|
|
70440
|
+
provider: resolvedProvider,
|
|
70441
|
+
model: resolvedModel,
|
|
70442
|
+
thinkLevel: run.thinkLevel,
|
|
70443
|
+
timeoutMs: run.timeoutMs,
|
|
70444
|
+
runId,
|
|
70445
|
+
extraSystemPrompt: run.extraSystemPrompt,
|
|
70446
|
+
ownerNumbers: run.ownerNumbers,
|
|
70447
|
+
cliSessionId,
|
|
70448
|
+
images: params.opts?.images
|
|
70292
70449
|
});
|
|
70293
|
-
const
|
|
70294
|
-
|
|
70295
|
-
provider,
|
|
70296
|
-
model,
|
|
70450
|
+
const cliText = cliResult.payloads?.[0]?.text?.trim();
|
|
70451
|
+
if (cliText) emitAgentEvent({
|
|
70297
70452
|
runId,
|
|
70298
|
-
|
|
70453
|
+
stream: "assistant",
|
|
70454
|
+
data: { text: cliText }
|
|
70299
70455
|
});
|
|
70300
|
-
|
|
70301
|
-
|
|
70302
|
-
|
|
70303
|
-
|
|
70304
|
-
|
|
70305
|
-
|
|
70306
|
-
|
|
70307
|
-
|
|
70308
|
-
|
|
70309
|
-
|
|
70310
|
-
|
|
70311
|
-
|
|
70312
|
-
|
|
70313
|
-
|
|
70314
|
-
|
|
70315
|
-
|
|
70316
|
-
|
|
70317
|
-
|
|
70318
|
-
|
|
70319
|
-
|
|
70320
|
-
|
|
70321
|
-
|
|
70322
|
-
|
|
70323
|
-
|
|
70324
|
-
|
|
70325
|
-
|
|
70326
|
-
|
|
70327
|
-
|
|
70328
|
-
|
|
70329
|
-
|
|
70330
|
-
|
|
70331
|
-
|
|
70332
|
-
|
|
70333
|
-
|
|
70334
|
-
|
|
70335
|
-
|
|
70336
|
-
|
|
70337
|
-
|
|
70338
|
-
|
|
70339
|
-
|
|
70340
|
-
|
|
70341
|
-
|
|
70342
|
-
|
|
70343
|
-
|
|
70344
|
-
|
|
70345
|
-
|
|
70346
|
-
|
|
70347
|
-
|
|
70348
|
-
|
|
70349
|
-
|
|
70350
|
-
|
|
70351
|
-
|
|
70352
|
-
|
|
70353
|
-
|
|
70354
|
-
|
|
70355
|
-
|
|
70356
|
-
|
|
70357
|
-
|
|
70456
|
+
emitAgentEvent({
|
|
70457
|
+
runId,
|
|
70458
|
+
stream: "lifecycle",
|
|
70459
|
+
data: {
|
|
70460
|
+
phase: "end",
|
|
70461
|
+
startedAt,
|
|
70462
|
+
endedAt: Date.now()
|
|
70463
|
+
}
|
|
70464
|
+
});
|
|
70465
|
+
lifecycleTerminalEmitted = true;
|
|
70466
|
+
runResult = cliResult;
|
|
70467
|
+
break;
|
|
70468
|
+
} catch (err) {
|
|
70469
|
+
emitAgentEvent({
|
|
70470
|
+
runId,
|
|
70471
|
+
stream: "lifecycle",
|
|
70472
|
+
data: {
|
|
70473
|
+
phase: "error",
|
|
70474
|
+
startedAt,
|
|
70475
|
+
endedAt: Date.now(),
|
|
70476
|
+
error: String(err)
|
|
70477
|
+
}
|
|
70478
|
+
});
|
|
70479
|
+
lifecycleTerminalEmitted = true;
|
|
70480
|
+
throw err;
|
|
70481
|
+
} finally {
|
|
70482
|
+
if (!lifecycleTerminalEmitted) emitAgentEvent({
|
|
70483
|
+
runId,
|
|
70484
|
+
stream: "lifecycle",
|
|
70485
|
+
data: {
|
|
70486
|
+
phase: "error",
|
|
70487
|
+
startedAt,
|
|
70488
|
+
endedAt: Date.now(),
|
|
70489
|
+
error: "CLI run completed without lifecycle terminal event"
|
|
70490
|
+
}
|
|
70491
|
+
});
|
|
70492
|
+
}
|
|
70493
|
+
}
|
|
70494
|
+
params.opts?.onModelSelected?.({
|
|
70495
|
+
provider: resolvedProvider,
|
|
70496
|
+
model: resolvedModel,
|
|
70497
|
+
thinkLevel: run.thinkLevel
|
|
70498
|
+
});
|
|
70499
|
+
const toolResultFormat = (() => {
|
|
70500
|
+
const channel = resolveMessageChannel(params.sessionCtx.Surface, params.sessionCtx.Provider);
|
|
70501
|
+
return !channel || isMarkdownCapableMessageChannel(channel) ? "markdown" : "plain";
|
|
70502
|
+
})();
|
|
70503
|
+
const turnResult = await runAgentTurn({
|
|
70504
|
+
sessionId: run.sessionId,
|
|
70505
|
+
sessionKey: params.sessionKey ?? run.sessionKey ?? run.sessionId,
|
|
70506
|
+
agentId: run.agentId,
|
|
70507
|
+
workspaceDir: run.workspaceDir,
|
|
70508
|
+
agentDir: run.agentDir,
|
|
70509
|
+
config: run.config,
|
|
70510
|
+
skillsSnapshot: run.skillsSnapshot,
|
|
70511
|
+
prompt: params.commandBody,
|
|
70512
|
+
extraSystemPrompt: run.extraSystemPrompt,
|
|
70513
|
+
images: params.opts?.images,
|
|
70514
|
+
provider: resolvedProvider,
|
|
70515
|
+
modelId: resolvedModel,
|
|
70516
|
+
authProfileId: run.authProfileId,
|
|
70517
|
+
authProfileIdSource: run.authProfileIdSource,
|
|
70518
|
+
thinkLevel: run.thinkLevel,
|
|
70519
|
+
verboseLevel: run.verboseLevel,
|
|
70520
|
+
reasoningLevel: run.reasoningLevel,
|
|
70521
|
+
timeoutMs: run.timeoutMs,
|
|
70522
|
+
runId,
|
|
70523
|
+
abortSignal: params.opts?.abortSignal,
|
|
70524
|
+
toolResultFormat,
|
|
70525
|
+
ownerNumbers: run.ownerNumbers,
|
|
70526
|
+
enforceFinalTag: run.enforceFinalTag,
|
|
70527
|
+
execOverrides: run.execOverrides,
|
|
70528
|
+
bashElevated: run.bashElevated,
|
|
70529
|
+
suppressToolErrorWarnings: params.opts?.suppressToolErrorWarnings,
|
|
70530
|
+
blockReplyBreak: params.resolvedBlockStreamingBreak,
|
|
70531
|
+
blockReplyChunking: params.blockReplyChunking,
|
|
70532
|
+
retryOnTransientError: true,
|
|
70533
|
+
fallbackModels: resolveModelFallbackOptions(run).fallbacksOverride,
|
|
70534
|
+
channel: {
|
|
70535
|
+
messageChannel: resolveMessageChannel(params.sessionCtx.Surface, params.sessionCtx.Provider) ?? void 0,
|
|
70536
|
+
messageProvider: params.sessionCtx.Provider?.trim().toLowerCase() || void 0,
|
|
70537
|
+
agentAccountId: params.sessionCtx.AccountId,
|
|
70538
|
+
messageTo: params.sessionCtx.OriginatingTo ?? params.sessionCtx.To,
|
|
70539
|
+
messageThreadId: params.sessionCtx.MessageThreadId ?? void 0,
|
|
70540
|
+
groupId: resolveGroupSessionKey(params.sessionCtx)?.id,
|
|
70541
|
+
groupChannel: params.sessionCtx.GroupChannel?.trim() ?? params.sessionCtx.GroupSubject?.trim(),
|
|
70542
|
+
groupSpace: params.sessionCtx.GroupSpace?.trim() ?? void 0,
|
|
70543
|
+
senderId: params.sessionCtx.SenderId?.trim() || void 0,
|
|
70544
|
+
senderName: params.sessionCtx.SenderName?.trim() || void 0,
|
|
70545
|
+
senderUsername: params.sessionCtx.SenderUsername?.trim() || void 0,
|
|
70546
|
+
senderE164: params.sessionCtx.SenderE164?.trim() || void 0,
|
|
70547
|
+
senderIsOwner: run.senderIsOwner,
|
|
70548
|
+
currentChannelId: params.sessionCtx.CurrentChannelId,
|
|
70549
|
+
currentThreadTs: params.sessionCtx.CurrentThreadTs,
|
|
70550
|
+
hasRepliedRef: params.opts?.hasRepliedRef
|
|
70551
|
+
},
|
|
70552
|
+
callbacks: {
|
|
70553
|
+
onDelta: async (text) => {
|
|
70554
|
+
if (isSilentReplyPrefixText(text, SILENT_REPLY_TOKEN)) return;
|
|
70555
|
+
const { text: normalized, skip } = normalizeStreamingText({ text });
|
|
70556
|
+
if (skip || !normalized) return;
|
|
70557
|
+
await params.typingSignals.signalTextDelta(normalized);
|
|
70558
|
+
await params.opts?.onPartialReply?.({ text: normalized });
|
|
70559
|
+
},
|
|
70560
|
+
onToolStart: async (name) => {
|
|
70561
|
+
notifyAgentRunStart();
|
|
70562
|
+
await params.typingSignals.signalToolStart();
|
|
70563
|
+
await params.opts?.onToolStart?.({
|
|
70564
|
+
name,
|
|
70565
|
+
phase: "start"
|
|
70566
|
+
});
|
|
70567
|
+
},
|
|
70568
|
+
onToolResult: serializedOnToolResult,
|
|
70569
|
+
onThinking: params.typingSignals.shouldStartOnReasoning || params.opts?.onReasoningStream ? async (text) => {
|
|
70570
|
+
await params.typingSignals.signalReasoningDelta();
|
|
70571
|
+
await params.opts?.onReasoningStream?.({ text });
|
|
70572
|
+
} : void 0,
|
|
70573
|
+
onLifecycle: async (phase) => {
|
|
70574
|
+
if (phase === "start" || phase === "streaming") notifyAgentRunStart();
|
|
70575
|
+
},
|
|
70576
|
+
onBlockReply: params.opts?.onBlockReply ? async (payload) => {
|
|
70577
|
+
await createBlockReplyDeliveryHandler({
|
|
70358
70578
|
onBlockReply: params.opts.onBlockReply,
|
|
70359
70579
|
currentMessageId: params.sessionCtx.MessageSidFull ?? params.sessionCtx.MessageSid,
|
|
70360
70580
|
normalizeStreamingText,
|
|
@@ -70363,46 +70583,22 @@ async function runAgentTurnWithFallback(params) {
|
|
|
70363
70583
|
blockStreamingEnabled: params.blockStreamingEnabled,
|
|
70364
70584
|
blockReplyPipeline,
|
|
70365
70585
|
directlySentBlockKeys
|
|
70366
|
-
})
|
|
70367
|
-
|
|
70368
|
-
|
|
70369
|
-
|
|
70370
|
-
|
|
70371
|
-
|
|
70372
|
-
|
|
70373
|
-
|
|
70374
|
-
|
|
70375
|
-
|
|
70376
|
-
|
|
70377
|
-
if (skip) return;
|
|
70378
|
-
await params.typingSignals.signalTextDelta(text);
|
|
70379
|
-
await onToolResult({
|
|
70380
|
-
text,
|
|
70381
|
-
mediaUrls: payload.mediaUrls
|
|
70382
|
-
});
|
|
70383
|
-
}).catch((err) => {
|
|
70384
|
-
logVerbose(`tool result delivery failed: ${String(err)}`);
|
|
70385
|
-
});
|
|
70386
|
-
const task = toolResultChain.finally(() => {
|
|
70387
|
-
params.pendingToolTasks.delete(task);
|
|
70388
|
-
});
|
|
70389
|
-
params.pendingToolTasks.add(task);
|
|
70390
|
-
};
|
|
70391
|
-
})() : void 0
|
|
70392
|
-
});
|
|
70586
|
+
})(payload);
|
|
70587
|
+
} : void 0,
|
|
70588
|
+
onBlockReplyFlush: params.blockStreamingEnabled && blockReplyPipeline ? async () => {
|
|
70589
|
+
await blockReplyPipeline.flush({ force: true });
|
|
70590
|
+
} : void 0,
|
|
70591
|
+
onCompaction: () => {
|
|
70592
|
+
autoCompactionCompleted = true;
|
|
70593
|
+
},
|
|
70594
|
+
onAgentEvent: (evt) => {
|
|
70595
|
+
if (evt.stream !== "lifecycle") notifyAgentRunStart();
|
|
70596
|
+
}
|
|
70393
70597
|
}
|
|
70394
70598
|
});
|
|
70395
|
-
runResult =
|
|
70396
|
-
fallbackProvider =
|
|
70397
|
-
fallbackModel =
|
|
70398
|
-
fallbackAttempts = Array.isArray(fallbackResult.attempts) ? fallbackResult.attempts.map((attempt) => ({
|
|
70399
|
-
provider: String(attempt.provider ?? ""),
|
|
70400
|
-
model: String(attempt.model ?? ""),
|
|
70401
|
-
error: String(attempt.error ?? ""),
|
|
70402
|
-
reason: attempt.reason ? String(attempt.reason) : void 0,
|
|
70403
|
-
status: typeof attempt.status === "number" ? attempt.status : void 0,
|
|
70404
|
-
code: attempt.code ? String(attempt.code) : void 0
|
|
70405
|
-
})) : [];
|
|
70599
|
+
runResult = turnResult.rawResult;
|
|
70600
|
+
fallbackProvider = turnResult.provider;
|
|
70601
|
+
fallbackModel = turnResult.modelId;
|
|
70406
70602
|
const embeddedError = runResult.meta?.error;
|
|
70407
70603
|
if (embeddedError && isContextOverflowError(embeddedError.message) && !didResetAfterCompactionFailure && await params.resetSessionAfterCompactionFailure(embeddedError.message)) {
|
|
70408
70604
|
didResetAfterCompactionFailure = true;
|
|
@@ -70461,14 +70657,6 @@ async function runAgentTurnWithFallback(params) {
|
|
|
70461
70657
|
payload: { text: "⚠️ Session history was corrupted. I've reset the conversation - please try again!" }
|
|
70462
70658
|
};
|
|
70463
70659
|
}
|
|
70464
|
-
if (isTransientHttp && !didRetryTransientHttpError) {
|
|
70465
|
-
didRetryTransientHttpError = true;
|
|
70466
|
-
defaultRuntime.error(`Transient HTTP provider error before reply (${message}). Retrying once in ${TRANSIENT_HTTP_RETRY_DELAY_MS}ms.`);
|
|
70467
|
-
await new Promise((resolve) => {
|
|
70468
|
-
setTimeout(resolve, TRANSIENT_HTTP_RETRY_DELAY_MS);
|
|
70469
|
-
});
|
|
70470
|
-
continue;
|
|
70471
|
-
}
|
|
70472
70660
|
defaultRuntime.error(`Embedded agent failed before reply: ${message}`);
|
|
70473
70661
|
const trimmedMessage = (isTransientHttp ? sanitizeUserFacingText(message, { errorContext: true }) : message).replace(/\.\s*$/, "");
|
|
70474
70662
|
return {
|
|
@@ -70660,7 +70848,7 @@ async function runMemoryFlushIfNeeded(params) {
|
|
|
70660
70848
|
try {
|
|
70661
70849
|
await runWithModelFallback({
|
|
70662
70850
|
...resolveModelFallbackOptions(params.followupRun.run),
|
|
70663
|
-
run: (provider, model) => {
|
|
70851
|
+
run: async (provider, model) => {
|
|
70664
70852
|
const { authProfile, embeddedContext, senderContext } = buildEmbeddedRunContexts({
|
|
70665
70853
|
run: params.followupRun.run,
|
|
70666
70854
|
sessionCtx: params.sessionCtx,
|
|
@@ -70674,21 +70862,46 @@ async function runMemoryFlushIfNeeded(params) {
|
|
|
70674
70862
|
runId: flushRunId,
|
|
70675
70863
|
authProfile
|
|
70676
70864
|
});
|
|
70677
|
-
return
|
|
70678
|
-
|
|
70679
|
-
|
|
70680
|
-
|
|
70865
|
+
return (await runAgentTurn({
|
|
70866
|
+
sessionId: embeddedContext.sessionId,
|
|
70867
|
+
sessionKey: embeddedContext.sessionKey ?? embeddedContext.sessionId ?? "",
|
|
70868
|
+
workspaceDir: runBaseParams.workspaceDir,
|
|
70869
|
+
agentDir: runBaseParams.agentDir,
|
|
70870
|
+
config: runBaseParams.config ?? params.cfg,
|
|
70871
|
+
skillsSnapshot: runBaseParams.skillsSnapshot,
|
|
70681
70872
|
prompt: resolveMemoryFlushPromptForRun({
|
|
70682
70873
|
prompt: memoryFlushSettings.prompt,
|
|
70683
70874
|
cfg: params.cfg
|
|
70684
70875
|
}),
|
|
70685
70876
|
extraSystemPrompt: flushSystemPrompt,
|
|
70686
|
-
|
|
70687
|
-
|
|
70688
|
-
|
|
70689
|
-
|
|
70690
|
-
|
|
70691
|
-
|
|
70877
|
+
provider,
|
|
70878
|
+
modelId: model,
|
|
70879
|
+
authProfileId: runBaseParams.authProfileId,
|
|
70880
|
+
authProfileIdSource: runBaseParams.authProfileIdSource,
|
|
70881
|
+
thinkLevel: runBaseParams.thinkLevel,
|
|
70882
|
+
verboseLevel: runBaseParams.verboseLevel,
|
|
70883
|
+
reasoningLevel: runBaseParams.reasoningLevel,
|
|
70884
|
+
timeoutMs: runBaseParams.timeoutMs,
|
|
70885
|
+
runId: runBaseParams.runId,
|
|
70886
|
+
ownerNumbers: runBaseParams.ownerNumbers,
|
|
70887
|
+
enforceFinalTag: runBaseParams.enforceFinalTag,
|
|
70888
|
+
execOverrides: runBaseParams.execOverrides,
|
|
70889
|
+
bashElevated: runBaseParams.bashElevated,
|
|
70890
|
+
channel: {
|
|
70891
|
+
messageProvider: embeddedContext.messageProvider,
|
|
70892
|
+
agentAccountId: embeddedContext.agentAccountId,
|
|
70893
|
+
messageTo: embeddedContext.messageTo,
|
|
70894
|
+
messageThreadId: embeddedContext.messageThreadId,
|
|
70895
|
+
senderId: senderContext.senderId,
|
|
70896
|
+
senderName: senderContext.senderName,
|
|
70897
|
+
senderUsername: senderContext.senderUsername,
|
|
70898
|
+
senderE164: senderContext.senderE164,
|
|
70899
|
+
senderIsOwner: runBaseParams.senderIsOwner
|
|
70900
|
+
},
|
|
70901
|
+
callbacks: { onCompaction: () => {
|
|
70902
|
+
memoryCompactionCompleted = true;
|
|
70903
|
+
} }
|
|
70904
|
+
})).rawResult;
|
|
70692
70905
|
}
|
|
70693
70906
|
});
|
|
70694
70907
|
let memoryFlushCompactionCount = activeSessionEntry?.compactionCount ?? (params.sessionKey ? activeSessionStore?.[params.sessionKey]?.compactionCount : 0) ?? 0;
|
|
@@ -71003,81 +71216,73 @@ function createFollowupRunner(params) {
|
|
|
71003
71216
|
let fallbackProvider = queued.run.provider;
|
|
71004
71217
|
let fallbackModel = queued.run.model;
|
|
71005
71218
|
try {
|
|
71006
|
-
|
|
71007
|
-
|
|
71008
|
-
|
|
71009
|
-
|
|
71219
|
+
runResult = await runAgentTurn({
|
|
71220
|
+
sessionId: queued.run.sessionId,
|
|
71221
|
+
sessionKey: queued.run.sessionKey ?? queued.run.sessionId,
|
|
71222
|
+
workspaceDir: queued.run.workspaceDir,
|
|
71010
71223
|
agentDir: queued.run.agentDir,
|
|
71011
|
-
|
|
71012
|
-
|
|
71013
|
-
|
|
71014
|
-
|
|
71015
|
-
|
|
71016
|
-
|
|
71017
|
-
|
|
71018
|
-
|
|
71019
|
-
|
|
71020
|
-
|
|
71021
|
-
|
|
71022
|
-
|
|
71023
|
-
|
|
71024
|
-
|
|
71025
|
-
|
|
71026
|
-
|
|
71027
|
-
|
|
71028
|
-
|
|
71029
|
-
|
|
71030
|
-
|
|
71031
|
-
|
|
71032
|
-
|
|
71033
|
-
|
|
71034
|
-
|
|
71035
|
-
|
|
71036
|
-
|
|
71037
|
-
|
|
71038
|
-
|
|
71039
|
-
|
|
71040
|
-
|
|
71041
|
-
|
|
71042
|
-
|
|
71043
|
-
|
|
71044
|
-
|
|
71045
|
-
|
|
71046
|
-
|
|
71047
|
-
|
|
71048
|
-
runId,
|
|
71049
|
-
blockReplyBreak: queued.run.blockReplyBreak,
|
|
71050
|
-
onAgentEvent: (evt) => {
|
|
71051
|
-
if (evt.stream !== "compaction") return;
|
|
71052
|
-
if ((typeof evt.data.phase === "string" ? evt.data.phase : "") === "end") autoCompactionCompleted = true;
|
|
71053
|
-
}
|
|
71054
|
-
});
|
|
71055
|
-
}
|
|
71224
|
+
config: queued.run.config,
|
|
71225
|
+
skillsSnapshot: queued.run.skillsSnapshot,
|
|
71226
|
+
prompt: queued.prompt,
|
|
71227
|
+
extraSystemPrompt: queued.run.extraSystemPrompt,
|
|
71228
|
+
provider: queued.run.provider,
|
|
71229
|
+
modelId: queued.run.model,
|
|
71230
|
+
authProfileId: queued.run.authProfileId,
|
|
71231
|
+
authProfileIdSource: queued.run.authProfileIdSource,
|
|
71232
|
+
thinkLevel: queued.run.thinkLevel,
|
|
71233
|
+
verboseLevel: queued.run.verboseLevel,
|
|
71234
|
+
reasoningLevel: queued.run.reasoningLevel,
|
|
71235
|
+
timeoutMs: queued.run.timeoutMs,
|
|
71236
|
+
runId,
|
|
71237
|
+
ownerNumbers: queued.run.ownerNumbers,
|
|
71238
|
+
enforceFinalTag: queued.run.enforceFinalTag,
|
|
71239
|
+
execOverrides: queued.run.execOverrides,
|
|
71240
|
+
bashElevated: queued.run.bashElevated,
|
|
71241
|
+
suppressToolErrorWarnings: opts?.suppressToolErrorWarnings,
|
|
71242
|
+
blockReplyBreak: queued.run.blockReplyBreak,
|
|
71243
|
+
fallbackModels: resolveAgentModelFallbacksOverride(queued.run.config, resolveAgentIdFromSessionKey(queued.run.sessionKey)),
|
|
71244
|
+
channel: {
|
|
71245
|
+
messageProvider: queued.run.messageProvider,
|
|
71246
|
+
agentAccountId: queued.run.agentAccountId,
|
|
71247
|
+
messageTo: queued.originatingTo,
|
|
71248
|
+
messageThreadId: queued.originatingThreadId,
|
|
71249
|
+
groupId: queued.run.groupId,
|
|
71250
|
+
groupChannel: queued.run.groupChannel,
|
|
71251
|
+
groupSpace: queued.run.groupSpace,
|
|
71252
|
+
senderId: queued.run.senderId,
|
|
71253
|
+
senderName: queued.run.senderName,
|
|
71254
|
+
senderUsername: queued.run.senderUsername,
|
|
71255
|
+
senderE164: queued.run.senderE164,
|
|
71256
|
+
senderIsOwner: queued.run.senderIsOwner
|
|
71257
|
+
},
|
|
71258
|
+
callbacks: { onCompaction: () => {
|
|
71259
|
+
autoCompactionCompleted = true;
|
|
71260
|
+
} }
|
|
71056
71261
|
});
|
|
71057
|
-
|
|
71058
|
-
|
|
71059
|
-
fallbackModel = fallbackResult.model;
|
|
71262
|
+
fallbackProvider = runResult.provider;
|
|
71263
|
+
fallbackModel = runResult.modelId;
|
|
71060
71264
|
} catch (err) {
|
|
71061
71265
|
const message = err instanceof Error ? err.message : String(err);
|
|
71062
71266
|
defaultRuntime.error?.(`Followup agent failed before reply: ${message}`);
|
|
71063
71267
|
return;
|
|
71064
71268
|
}
|
|
71065
|
-
const
|
|
71066
|
-
const
|
|
71067
|
-
const
|
|
71269
|
+
const rawResult = runResult.rawResult;
|
|
71270
|
+
const usage = rawResult.meta?.agentMeta?.usage;
|
|
71271
|
+
const promptTokens = rawResult.meta?.agentMeta?.promptTokens;
|
|
71272
|
+
const modelUsed = rawResult.meta?.agentMeta?.model ?? fallbackModel ?? defaultModel;
|
|
71068
71273
|
const contextTokensUsed = agentCfgContextTokens ?? lookupContextTokens(modelUsed) ?? sessionEntry?.contextTokens ?? DEFAULT_CONTEXT_TOKENS;
|
|
71069
71274
|
if (storePath && sessionKey) await persistRunSessionUsage({
|
|
71070
71275
|
storePath,
|
|
71071
71276
|
sessionKey,
|
|
71072
71277
|
usage,
|
|
71073
|
-
lastCallUsage:
|
|
71278
|
+
lastCallUsage: rawResult.meta?.agentMeta?.lastCallUsage,
|
|
71074
71279
|
promptTokens,
|
|
71075
71280
|
modelUsed,
|
|
71076
71281
|
providerUsed: fallbackProvider,
|
|
71077
71282
|
contextTokensUsed,
|
|
71078
71283
|
logLabel: "followup"
|
|
71079
71284
|
});
|
|
71080
|
-
const payloadArray =
|
|
71285
|
+
const payloadArray = rawResult.payloads ?? [];
|
|
71081
71286
|
if (payloadArray.length === 0) return;
|
|
71082
71287
|
const sanitizedPayloads = payloadArray.flatMap((payload) => {
|
|
71083
71288
|
const text = payload.text;
|
|
@@ -71098,13 +71303,13 @@ function createFollowupRunner(params) {
|
|
|
71098
71303
|
replyToMode: resolveReplyToMode(queued.run.config, replyToChannel, queued.originatingAccountId, queued.originatingChatType),
|
|
71099
71304
|
replyToChannel
|
|
71100
71305
|
}),
|
|
71101
|
-
sentTexts:
|
|
71306
|
+
sentTexts: rawResult.messagingToolSentTexts ?? []
|
|
71102
71307
|
}),
|
|
71103
|
-
sentMediaUrls:
|
|
71308
|
+
sentMediaUrls: rawResult.messagingToolSentMediaUrls ?? []
|
|
71104
71309
|
});
|
|
71105
71310
|
const finalPayloads = shouldSuppressMessagingToolReplies({
|
|
71106
71311
|
messageProvider: queued.run.messageProvider,
|
|
71107
|
-
messagingToolSentTargets:
|
|
71312
|
+
messagingToolSentTargets: rawResult.messagingToolSentTargets,
|
|
71108
71313
|
originatingTo: queued.originatingTo,
|
|
71109
71314
|
accountId: queued.run.agentAccountId
|
|
71110
71315
|
}) ? [] : mediaFilteredPayloads;
|
|
@@ -71115,7 +71320,7 @@ function createFollowupRunner(params) {
|
|
|
71115
71320
|
sessionStore,
|
|
71116
71321
|
sessionKey,
|
|
71117
71322
|
storePath,
|
|
71118
|
-
lastCallUsage:
|
|
71323
|
+
lastCallUsage: rawResult.meta?.agentMeta?.lastCallUsage,
|
|
71119
71324
|
contextTokensUsed
|
|
71120
71325
|
});
|
|
71121
71326
|
if (queued.run.verboseLevel && queued.run.verboseLevel !== "off") {
|
|
@@ -73101,4 +73306,4 @@ async function getReplyFromConfig(ctx, opts, configOverride) {
|
|
|
73101
73306
|
}
|
|
73102
73307
|
|
|
73103
73308
|
//#endregion
|
|
73104
|
-
export { buildDeliveryFromLegacyPayload as $, OPENAI_TTS_MODELS as $n, parseIdentityMarkdown as $t, emitGatewayRestart as A, initSubagentRegistry as An, extractImageContentFromSource as Ar, resolveHeartbeatDeliveryTarget as At, summarizeRestartSentinel as B, registerAgentRunContext as Bn, abortEmbeddedPiRun as Bt, ensureOutboundSessionEntry as C, shouldComputeCommandAuthorized as Cn, peekSystemEventEntries as Cr, requestBodyErrorToText as Ct, CHANNEL_MESSAGE_ACTION_NAMES as D, normalizeMentionText as Dn, DEFAULT_INPUT_MAX_REDIRECTS as Dr, resolveSessionKeyForRequest as Dt, resetDirectoryCache as E, buildMentionRegexes as En, DEFAULT_INPUT_IMAGE_MIMES as Er, agentCommand as Et, setPreRestartDeferralCheck as F, readLatestAssistantReply as Fn, normalizeSendPolicy as Ft, normalizeCronJobPatch as G, resolveTtsApiKey as Gn, getCliSessionId as Gt, writeRestartSentinel as H, getTtsProvider as Hn, waitForEmbeddedPiRunEnd as Ht, consumeRestartSentinel as I, clearAgentRunContext as In, resolveSendPolicy as It, normalizeOptionalSessionKey as J, resolveTtsPrefsPath as Jn, sha256HexPrefix as Jt, inferLegacyName as K, resolveTtsAutoMode as Kn, setCliSessionId as Kt, formatDoctorNonInteractiveHint as L, emitAgentEvent as Ln, createDefaultDeps as Lt, markGatewaySigusr1RestartHandled as M, listSubagentRunsForRequester as Mn, resolveInputFileLimits as Mr, resolveOutboundTarget as Mt, scheduleGatewaySigusr1Restart as N, subagent_registry_exports as Nn, estimateBase64DecodedBytes as Nr, resolveSessionDeliveryTarget as Nt, consumeGatewaySigusr1RestartAuthorization as O, countActiveDescendantRuns as On, DEFAULT_INPUT_TIMEOUT_MS as Or, resolveAgentDeliveryPlan as Ot, setGatewaySigusr1RestartPolicy as P, runSubagentAnnounceFlow as Pn, resolveAgentTimeoutMs as Pr, createOutboundSendDeps as Pt, migrateLegacyCronPayload as Q, textToSpeech as Qn, loadAgentIdentityFromWorkspace as Qt, formatRestartSentinelMessage as R, getAgentRunContext as Rn, createOutboundSendDeps$1 as Rt, runMessageAction as S, hasControlCommand as Sn, isSystemEventContextChanged as Sr, readJsonBodyWithLimit as St, formatTargetDisplay as T, stopSubagentsForRequester as Tn, DEFAULT_INPUT_IMAGE_MAX_BYTES as Tr, sleepWithAbort as Tt, normalizeHttpWebhookUrl as U, isTtsEnabled as Un, resolveModelProfile as Ut, trimLogTail as V, resolveUserTimezone as Vn, getActiveEmbeddedRunCount as Vt, normalizeCronJobCreate as W, isTtsProviderConfigured as Wn, runWithModelFallback as Wt, normalizePayloadToSystemText as X, setTtsEnabled as Xn, resolveAgentAvatar as Xt, normalizeOptionalText as Y, resolveTtsProviderOrder as Yn, describeFailoverError as Yt, normalizeRequiredName as Z, setTtsProvider as Zn, identityHasValues as Zt, loadCombinedSessionStoreForGateway as _, createInboundDebouncer as _n, formatRemainingShort as _r, formatUsageReportLines as _t, buildChannelSummary as a, buildPairingReply as an, setCommandLaneConcurrency as ar, persistBrowserProxyFiles as at, resolveGatewaySessionStoreTarget as b, resolveEnvelopeFormatOptions as bn, parseVerboseOverride as br, resolveCommitHash as bt, clearSessionQueues as c, buildHistoryContextFromEntries as cn, DEFAULT_HEARTBEAT_ACK_MAX_CHARS as cr, setHeartbeatWakeHandler as ct, createSymiTools as d, dispatchReplyWithBufferedBlockDispatcher as dn, resolveHeartbeatPrompt as dr, createPluginLoaderLogger as dt, buildSafeExternalPrompt as en, OPENAI_TTS_VOICES as er, hasLegacyDeliveryHints as et, resolveAnnounceTargetFromKey as f, provider_dispatcher_exports as fn, stripHeartbeatToken as fr, loadSymiPlugins as ft, listSessionsFromStore as g, createDedupeCache as gn, buildAuthHealthSummary as gr, loadProviderUsageSummary as gt, listAgentsForGateway as h, getTotalPendingReplies as hn, DEFAULT_OAUTH_WARN_MS as hr, parseActivationCommand as ht, resolveCronStyleNow as i, unbindThreadBindingsBySessionKey as in, resetAllLanes as ir, applyBrowserProxyPaths as it, isGatewaySigusr1RestartExternallyAllowed as j, listDescendantRunsForRequester as jn, normalizeMimeList as jr, resolveHeartbeatSenderContext as jt, deferGatewayRestartUntilIdle as k, countActiveRunsForSession as kn, extractFileContentFromSource as kr, resolveAgentOutboundTarget as kt, applyToolPolicyPipeline as l, recordPendingHistoryEntryIfEnabled as ln, DEFAULT_HEARTBEAT_EVERY as lr, resolveHeartbeatReasonKind as lt, classifySessionKey as m, createReplyDispatcher as mn, maskApiKey as mr, normalizeGroupActivation as mt, BARE_SESSION_RESET_PROMPT as n, getHookType as nn, getQueueSize as nr, CHANNEL_TARGETS_DESCRIPTION as nt, buildChannelAccountSnapshot as o, resolveMentionGating as on, waitForActiveTasks as or, sniffMimeFromBase64 as ot, canonicalizeSpawnedByForAgent as p, dispatchInboundMessage as pn, lookupContextTokens as pr, deleteTelegramUpdateOffset as pt, normalizeOptionalAgentId as q, resolveTtsConfig as qn, runCliAgent as qt, appendCronStyleCurrentTimeLine as r, isExternalHookSession as rn, getTotalQueueSize as rr, CHANNEL_TARGET_DESCRIPTION as rt, formatChannelAllowFrom as s, DEFAULT_GROUP_HISTORY_LIMIT as sn, CommandLane as sr, requestHeartbeatNow as st, getReplyFromConfig as t, detectSuspiciousPatterns as tn, getActiveTaskCount as tr, stripLegacyDeliveryFields as tt, buildDefaultToolPolicyPipelineSteps as u, shouldAckReactionForWhatsApp as un, isHeartbeatContentEffectivelyEmpty as ur, getPluginToolMeta as ut, loadSessionEntry as v, resolveInboundDebounceMs as vn, applyModelOverrideToSessionEntry as vr, formatUsageWindowSummary as vt, resolveOutboundSessionRoute as w, isAbortTrigger as wn, peekSystemEvents as wr, computeBackoff as wt, resolveSessionModelRef as x, formatZonedTimestamp as xn, enqueueSystemEvent as xr, handleSlackHttpRequest as xt, pruneLegacyStoreKeys as y, formatInboundEnvelope as yn, applyVerboseOverride as yr, resolveUsageProviderId as yt, readRestartSentinel as z, onAgentEvent as zn,
|
|
73309
|
+
export { buildDeliveryFromLegacyPayload as $, OPENAI_TTS_MODELS as $n, parseIdentityMarkdown as $t, emitGatewayRestart as A, initSubagentRegistry as An, extractImageContentFromSource as Ar, resolveHeartbeatDeliveryTarget as At, summarizeRestartSentinel as B, registerAgentRunContext as Bn, abortEmbeddedPiRun as Bt, ensureOutboundSessionEntry as C, shouldComputeCommandAuthorized as Cn, peekSystemEventEntries as Cr, requestBodyErrorToText as Ct, CHANNEL_MESSAGE_ACTION_NAMES as D, normalizeMentionText as Dn, DEFAULT_INPUT_MAX_REDIRECTS as Dr, resolveSessionKeyForRequest as Dt, resetDirectoryCache as E, buildMentionRegexes as En, DEFAULT_INPUT_IMAGE_MIMES as Er, agentCommand as Et, setPreRestartDeferralCheck as F, readLatestAssistantReply as Fn, normalizeSendPolicy as Ft, normalizeCronJobPatch as G, resolveTtsApiKey as Gn, getCliSessionId as Gt, writeRestartSentinel as H, getTtsProvider as Hn, waitForEmbeddedPiRunEnd as Ht, consumeRestartSentinel as I, clearAgentRunContext as In, resolveSendPolicy as It, normalizeOptionalSessionKey as J, resolveTtsPrefsPath as Jn, sha256HexPrefix as Jt, inferLegacyName as K, resolveTtsAutoMode as Kn, setCliSessionId as Kt, formatDoctorNonInteractiveHint as L, emitAgentEvent as Ln, createDefaultDeps as Lt, markGatewaySigusr1RestartHandled as M, listSubagentRunsForRequester as Mn, resolveInputFileLimits as Mr, resolveOutboundTarget as Mt, scheduleGatewaySigusr1Restart as N, subagent_registry_exports as Nn, estimateBase64DecodedBytes as Nr, resolveSessionDeliveryTarget as Nt, consumeGatewaySigusr1RestartAuthorization as O, countActiveDescendantRuns as On, DEFAULT_INPUT_TIMEOUT_MS as Or, resolveAgentDeliveryPlan as Ot, setGatewaySigusr1RestartPolicy as P, runSubagentAnnounceFlow as Pn, resolveAgentTimeoutMs as Pr, createOutboundSendDeps as Pt, migrateLegacyCronPayload as Q, textToSpeech as Qn, loadAgentIdentityFromWorkspace as Qt, formatRestartSentinelMessage as R, getAgentRunContext as Rn, createOutboundSendDeps$1 as Rt, runMessageAction as S, hasControlCommand as Sn, isSystemEventContextChanged as Sr, readJsonBodyWithLimit as St, formatTargetDisplay as T, stopSubagentsForRequester as Tn, DEFAULT_INPUT_IMAGE_MAX_BYTES as Tr, sleepWithAbort as Tt, normalizeHttpWebhookUrl as U, isTtsEnabled as Un, resolveModelProfile as Ut, trimLogTail as V, resolveUserTimezone as Vn, getActiveEmbeddedRunCount as Vt, normalizeCronJobCreate as W, isTtsProviderConfigured as Wn, runWithModelFallback as Wt, normalizePayloadToSystemText as X, setTtsEnabled as Xn, resolveAgentAvatar as Xt, normalizeOptionalText as Y, resolveTtsProviderOrder as Yn, describeFailoverError as Yt, normalizeRequiredName as Z, setTtsProvider as Zn, identityHasValues as Zt, loadCombinedSessionStoreForGateway as _, createInboundDebouncer as _n, formatRemainingShort as _r, formatUsageReportLines as _t, buildChannelSummary as a, buildPairingReply as an, setCommandLaneConcurrency as ar, persistBrowserProxyFiles as at, resolveGatewaySessionStoreTarget as b, resolveEnvelopeFormatOptions as bn, parseVerboseOverride as br, resolveCommitHash as bt, clearSessionQueues as c, buildHistoryContextFromEntries as cn, DEFAULT_HEARTBEAT_ACK_MAX_CHARS as cr, setHeartbeatWakeHandler as ct, createSymiTools as d, dispatchReplyWithBufferedBlockDispatcher as dn, resolveHeartbeatPrompt as dr, createPluginLoaderLogger as dt, buildSafeExternalPrompt as en, OPENAI_TTS_VOICES as er, hasLegacyDeliveryHints as et, resolveAnnounceTargetFromKey as f, provider_dispatcher_exports as fn, stripHeartbeatToken as fr, loadSymiPlugins as ft, listSessionsFromStore as g, createDedupeCache as gn, buildAuthHealthSummary as gr, loadProviderUsageSummary as gt, listAgentsForGateway as h, getTotalPendingReplies as hn, DEFAULT_OAUTH_WARN_MS as hr, parseActivationCommand as ht, resolveCronStyleNow as i, unbindThreadBindingsBySessionKey as in, resetAllLanes as ir, applyBrowserProxyPaths as it, isGatewaySigusr1RestartExternallyAllowed as j, listDescendantRunsForRequester as jn, normalizeMimeList as jr, resolveHeartbeatSenderContext as jt, deferGatewayRestartUntilIdle as k, countActiveRunsForSession as kn, extractFileContentFromSource as kr, resolveAgentOutboundTarget as kt, applyToolPolicyPipeline as l, recordPendingHistoryEntryIfEnabled as ln, DEFAULT_HEARTBEAT_EVERY as lr, resolveHeartbeatReasonKind as lt, classifySessionKey as m, createReplyDispatcher as mn, maskApiKey as mr, normalizeGroupActivation as mt, BARE_SESSION_RESET_PROMPT as n, getHookType as nn, getQueueSize as nr, CHANNEL_TARGETS_DESCRIPTION as nt, buildChannelAccountSnapshot as o, resolveMentionGating as on, waitForActiveTasks as or, sniffMimeFromBase64 as ot, canonicalizeSpawnedByForAgent as p, dispatchInboundMessage as pn, lookupContextTokens as pr, deleteTelegramUpdateOffset as pt, normalizeOptionalAgentId as q, resolveTtsConfig as qn, runCliAgent as qt, appendCronStyleCurrentTimeLine as r, isExternalHookSession as rn, getTotalQueueSize as rr, CHANNEL_TARGET_DESCRIPTION as rt, formatChannelAllowFrom as s, DEFAULT_GROUP_HISTORY_LIMIT as sn, CommandLane as sr, requestHeartbeatNow as st, getReplyFromConfig as t, detectSuspiciousPatterns as tn, getActiveTaskCount as tr, stripLegacyDeliveryFields as tt, buildDefaultToolPolicyPipelineSteps as u, shouldAckReactionForWhatsApp as un, isHeartbeatContentEffectivelyEmpty as ur, getPluginToolMeta as ut, loadSessionEntry as v, resolveInboundDebounceMs as vn, applyModelOverrideToSessionEntry as vr, formatUsageWindowSummary as vt, resolveOutboundSessionRoute as w, isAbortTrigger as wn, peekSystemEvents as wr, computeBackoff as wt, resolveSessionModelRef as x, formatZonedTimestamp as xn, enqueueSystemEvent as xr, handleSlackHttpRequest as xt, pruneLegacyStoreKeys as y, formatInboundEnvelope as yn, applyVerboseOverride as yr, resolveUsageProviderId as yt, readRestartSentinel as z, onAgentEvent as zn, runAgentTurn as zt };
|