@symerian/symi 2.6.2 → 2.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agents-qLMWAYwU.js → agents-DOW6IsMq.js} +4 -4
- package/dist/{agents.config-BmdFH4J5.js → agents.config-BS_3Q1aC.js} +1 -1
- package/dist/{agents.config-BfjAwFCr.js → agents.config-Begh8fIB.js} +1 -1
- package/dist/{audio-preflight-BVaaZWkg.js → audio-preflight-DHTaS5U1.js} +4 -4
- package/dist/{auth-choice-zFq3WRQ0.js → auth-choice-CfqsNRiL.js} +1 -1
- package/dist/{auth-choice-D1u_GPfQ.js → auth-choice-KBIBWGi5.js} +1 -1
- package/dist/{banner-DpH44qlJ.js → banner-D5oPK3dd.js} +1 -1
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +6 -6
- package/dist/bundled/session-memory/handler.js +6 -6
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-options-C8tKm8re.js → channel-options-CxTrwgcc.js} +1 -1
- package/dist/{channel-options-0iOfzVR3.js → channel-options-Dk60zDRr.js} +1 -1
- package/dist/{channel-web-DYinYBz4.js → channel-web-DUe1eTrq.js} +1 -1
- package/dist/{channels-cli-93tLT17t.js → channels-cli-BEAJxa39.js} +4 -4
- package/dist/{channels-cli-C8HgSMTH.js → channels-cli-Cezxcj8R.js} +4 -4
- package/dist/{chrome-DkaXoP36.js → chrome-DYZwl5Gv.js} +7 -7
- package/dist/{cli-BYJyRW2M.js → cli-Cg-uzVGj.js} +1 -1
- package/dist/{cli-DapZXGSB.js → cli-CwhdsdYh.js} +1 -1
- package/dist/{command-registry-9EhYc6da.js → command-registry-DUrtuPM6.js} +9 -9
- package/dist/{completion-cli-BFZv3K5D.js → completion-cli-CoZJtRvO.js} +2 -2
- package/dist/{completion-cli-CCeQlMlC.js → completion-cli-DmASMmCq.js} +1 -1
- package/dist/{config-cli-DbWMIBUz.js → config-cli-UoL1dwqb.js} +1 -1
- package/dist/{config-cli-Dv2mtIeM.js → config-cli-m_Qi3Frt.js} +1 -1
- package/dist/{configure-B8zV6Hxj.js → configure-BcBt8XDv.js} +3 -3
- package/dist/{configure-CVQf2UJE.js → configure-DZ47HgAy.js} +3 -3
- package/dist/{deliver-C46-vyqg.js → deliver-dODxSv3b.js} +1 -1
- package/dist/{doctor-completion-BunqvoqZ.js → doctor-completion-CZVgF2O7.js} +1 -1
- package/dist/{doctor-completion-CLeX1kaN.js → doctor-completion-p74nttr9.js} +1 -1
- package/dist/entry.js +1 -1
- package/dist/extensionAPI.js +1 -1
- package/dist/{gateway-cli-DMey_29a.js → gateway-cli-BQvWIuYZ.js} +9 -9
- package/dist/{gateway-cli-Co-tp-WC.js → gateway-cli-CvZ37LY5.js} +9 -9
- package/dist/{glass-ui-ws-C4O227UO.js → glass-ui-ws-CtvmKIGE.js} +7 -7
- package/dist/{glass-ui-ws-CKb1jTZR.js → glass-ui-ws-DpfTN1oc.js} +7 -7
- package/dist/{health-CM1asUG8.js → health-CCtEihH4.js} +1 -1
- package/dist/{health-CDGOsNeD.js → health-DCNAbUwC.js} +1 -1
- package/dist/{hooks-cli-DFKB3Z6X.js → hooks-cli-BBB59b3F.js} +2 -2
- package/dist/{hooks-cli-Tx0TzSju.js → hooks-cli-COSh_mpB.js} +2 -2
- package/dist/{image-CuzFLQWC.js → image-CXu8W39c.js} +1 -1
- package/dist/index.js +6 -6
- package/dist/llm-slug-generator.js +6 -6
- package/dist/{models-CiqHYwje.js → models-BGMa66uX.js} +2 -2
- package/dist/{models-cli-B-b-gBKG.js → models-cli-B2dfKl2c.js} +2 -2
- package/dist/{models-cli-B4ATSsNS.js → models-cli-Blngpmmw.js} +3 -3
- package/dist/{onboard-DcnGZKZX.js → onboard-DNSwJybR.js} +2 -2
- package/dist/{onboard-B_ECX48L.js → onboard-DPyRkUFi.js} +2 -2
- package/dist/{onboard-channels-FFQPpuEN.js → onboard-channels-B6LdRH-G.js} +1 -1
- package/dist/{onboard-channels-pfSGhg_C.js → onboard-channels-CwmO-fIN.js} +1 -1
- package/dist/{onboarding-BU14cspo.js → onboarding-JmJe53N1.js} +3 -3
- package/dist/{onboarding-jhZxQcZ3.js → onboarding-S0W19_rT.js} +3 -3
- package/dist/{onboarding.finalize-ByZT4dF5.js → onboarding.finalize-07S5-W8B.js} +5 -5
- package/dist/{onboarding.finalize-B8oOMfHc.js → onboarding.finalize-DSeh_xzP.js} +6 -6
- package/dist/{pi-embedded-helpers-CfqDGQ9J.js → pi-embedded-helpers-pubKo8HQ.js} +4 -4
- package/dist/{pi-embedded-BY9AnmoP.js → pi-embedded-hzH7U2lh.js} +159 -144
- package/dist/{plugin-registry-DXWJkJX6.js → plugin-registry-CSo-ZnRV.js} +1 -1
- package/dist/{plugin-registry-CNf1_8hj.js → plugin-registry-CzDaYnXD.js} +1 -1
- package/dist/plugin-sdk/{accounts-BToL3HlP.js → accounts-BtaOa4z_.js} +1 -1
- package/dist/plugin-sdk/{accounts-D9zGZU5t.js → accounts-Ddm33hQm.js} +3 -3
- package/dist/plugin-sdk/{accounts-Dtszw3Zn.js → accounts-s-AdhXVR.js} +1 -1
- package/dist/plugin-sdk/{active-listener-bEk__wbB.js → active-listener-BXYeALs0.js} +1 -1
- package/dist/plugin-sdk/{agent-scope-C3gMMKCU.js → agent-scope-CYYpcO9W.js} +2 -2
- package/dist/plugin-sdk/{api-key-rotation-CVBMpnPc.js → api-key-rotation-D_sMvI5W.js} +1 -1
- package/dist/plugin-sdk/{audio-preflight-DoQQKlxa.js → audio-preflight-VpItkiy3.js} +24 -24
- package/dist/plugin-sdk/{bindings-BbwoUGPx.js → bindings-C7hRtgYW.js} +2 -2
- package/dist/plugin-sdk/{channel-activity-Ji7f0gqq.js → channel-activity-DoC1xtDu.js} +1 -1
- package/dist/plugin-sdk/{channel-web-DZQQ0mzN.js → channel-web-ByCyqhUk.js} +22 -22
- package/dist/plugin-sdk/{chrome-C7c_0I5M.js → chrome-B7RdxmJ0.js} +3 -3
- package/dist/plugin-sdk/{chunk-jvk9axTQ.js → chunk-Dw2XBYXv.js} +1 -1
- package/dist/plugin-sdk/{command-format-DSdvQ_M5.js → command-format-GKSevep4.js} +1 -1
- package/dist/plugin-sdk/{commands-registry-CQFbmUMs.js → commands-registry-COIaslGl.js} +4 -4
- package/dist/plugin-sdk/{config-DDkdiUOR.js → config-KlTNfkFF.js} +9 -9
- package/dist/plugin-sdk/{deliver-BZ6iNLl7.js → deliver-BZ99UKQq.js} +10 -10
- package/dist/plugin-sdk/{diagnostic-mFf4i4G9.js → diagnostic-05pm5Rxi.js} +1 -1
- package/dist/plugin-sdk/{image-BOYy0Ump.js → image-CLOPx7yW.js} +4 -4
- package/dist/plugin-sdk/{image-ops-Bnp6LXEx.js → image-ops-BlQR__MN.js} +1 -1
- package/dist/plugin-sdk/index.js +53 -53
- package/dist/plugin-sdk/{ir-Fb3qpcis.js → ir-BJ6BHE5b.js} +4 -4
- package/dist/plugin-sdk/{local-roots-Ckk1QfzI.js → local-roots-BHLNSI8U.js} +3 -3
- package/dist/plugin-sdk/{login-Bh3DZPam.js → login-DQMXuxOk.js} +7 -7
- package/dist/plugin-sdk/{login-qr-DbR7odSr.js → login-qr-BjVZSoCi.js} +9 -9
- package/dist/plugin-sdk/{manager-DckktAQ3.js → manager-CBSBFuFz.js} +8 -8
- package/dist/plugin-sdk/{manifest-registry-B3ugY9-f.js → manifest-registry-CPnHl_K3.js} +1 -1
- package/dist/plugin-sdk/{markdown-tables-Dfaqilz6.js → markdown-tables-BoYFajMu.js} +1 -1
- package/dist/plugin-sdk/{message-channel-BdI5Ra9S.js → message-channel-COTAJzHd.js} +1 -1
- package/dist/plugin-sdk/{model-selection-OpU8HN50.js → model-selection-CsbEfrS0.js} +4 -4
- package/dist/plugin-sdk/{outbound-rF6G8Xpr.js → outbound-B0e8KdaR.js} +7 -7
- package/dist/plugin-sdk/{outbound-attachment-DnVQfTG2.js → outbound-attachment-CnslKL38.js} +2 -2
- package/dist/plugin-sdk/{pi-auth-json-CJk8t14T.js → pi-auth-json-qWi7ZIYV.js} +5 -5
- package/dist/plugin-sdk/{pi-embedded-helpers-BveUP4hk.js → pi-embedded-helpers-CW630epe.js} +17 -17
- package/dist/plugin-sdk/{plugins-BbAvhC25.js → plugins-BNByVCIH.js} +4 -4
- package/dist/plugin-sdk/{pw-ai-DjGUsee-.js → pw-ai-CnbPIPY9.js} +8 -8
- package/dist/plugin-sdk/{qmd-manager-mjKcdwVr.js → qmd-manager-CH0XbIHf.js} +4 -4
- package/dist/plugin-sdk/{registry--_pGht6S.js → registry-D0xTnUWt.js} +2 -2
- package/dist/plugin-sdk/{replies-fI39rPGa.js → replies-LLcQL3w6.js} +3 -3
- package/dist/plugin-sdk/{reply-DvZeyOVA.js → reply-Dcsda8Tt.js} +231 -216
- package/dist/plugin-sdk/{reply-prefix-BHuV5t70.js → reply-prefix-uxfMZW4p.js} +1 -1
- package/dist/plugin-sdk/{resolve-outbound-target-BkCUbYGV.js → resolve-outbound-target-BiyAyTWz.js} +2 -2
- package/dist/plugin-sdk/{resolve-route-D3JH_D2N.js → resolve-route-B3CCBumQ.js} +3 -3
- package/dist/plugin-sdk/{retry-ilSJqnz9.js → retry-CwQ_iIj8.js} +1 -1
- package/dist/plugin-sdk/{runner-BVqnEfNe.js → runner-CGBT7tgF.js} +9 -9
- package/dist/plugin-sdk/{send-BtANzsAo.js → send-B2CEnVLL.js} +6 -6
- package/dist/plugin-sdk/{send-BHbXh8Ly.js → send-C5h_YxNb.js} +7 -7
- package/dist/plugin-sdk/{send-D6LMZJ_h.js → send-CRsR8-vO.js} +10 -10
- package/dist/plugin-sdk/{send-Bxdu6ZZy.js → send-CjOBB3Vo.js} +10 -10
- package/dist/plugin-sdk/{send-BMfJIhCk.js → send-pYqe432l.js} +6 -6
- package/dist/plugin-sdk/{session-kI0tzViQ.js → session-BsOrxiMj.js} +4 -4
- package/dist/plugin-sdk/{skill-commands-DCNXVERE.js → skill-commands-ff_01_r3.js} +5 -5
- package/dist/plugin-sdk/{skills-B1GeRYlu.js → skills-_yTP47Cd.js} +7 -7
- package/dist/plugin-sdk/{sqlite-Cq_7Cg4E.js → sqlite-CxAR5ttJ.js} +1 -1
- package/dist/plugin-sdk/{store-Do3t33-c.js → store-BdrNabcU.js} +2 -2
- package/dist/plugin-sdk/{subsystem-Coz2AgU8.js → subsystem-B2uDN3TV.js} +1 -1
- package/dist/plugin-sdk/{tables-DR0NmBeH.js → tables-DNwXwNFa.js} +1 -1
- package/dist/plugin-sdk/{target-errors-B7YyMnIi.js → target-errors-Paro1BjP.js} +2 -2
- package/dist/plugin-sdk/{thinking-DCNUIAHY.js → thinking-CXqf7WTe.js} +5 -5
- package/dist/plugin-sdk/{tokens-CWMflosr.js → tokens-bC3UVmVH.js} +1 -1
- package/dist/plugin-sdk/{tool-images-D7Lno-TE.js → tool-images-HJ2sfZDV.js} +2 -2
- package/dist/plugin-sdk/{tool-loop-detection-DU5sTIKg.js → tool-loop-detection-at_K42K7.js} +2 -2
- package/dist/plugin-sdk/web-C39eHM3D.js +65 -0
- package/dist/plugin-sdk/{whatsapp-actions-CcBzDuL-.js → whatsapp-actions-DfseosPO.js} +21 -21
- package/dist/{plugins-cli-BiedlZMy.js → plugins-cli-62BU54hk.js} +2 -2
- package/dist/{plugins-cli-C9TYM40P.js → plugins-cli-ClKLriuv.js} +2 -2
- package/dist/{program-bnWda72r.js → program-Cr_6s-Wr.js} +7 -7
- package/dist/{program-context-CY1jWc5A.js → program-context-LakSEswZ.js} +17 -17
- package/dist/{prompt-select-styled-B_lFTtqp.js → prompt-select-styled-Bi_sLB9O.js} +4 -4
- package/dist/{prompt-select-styled-BEnZY8wI.js → prompt-select-styled-Du1GhtB8.js} +4 -4
- package/dist/{provider-auth-helpers-DApJuzBd.js → provider-auth-helpers-ZZn9gWaP.js} +1 -1
- package/dist/{provider-auth-helpers-DcNKxc7D.js → provider-auth-helpers-ywLHg2WA.js} +1 -1
- package/dist/{push-apns-DA7UMNQH.js → push-apns-3aDWyTlU.js} +1 -1
- package/dist/{push-apns-CKKHlj6j.js → push-apns-B49EFYpk.js} +1 -1
- package/dist/{pw-ai-m0mj2KWK.js → pw-ai-B5asscAD.js} +1 -1
- package/dist/{register.agent-ulu0VmOg.js → register.agent-Bq736SbZ.js} +6 -6
- package/dist/{register.agent-8lxVlmzQ.js → register.agent-CL7uT27q.js} +5 -5
- package/dist/{register.configure-rq0h5r3X.js → register.configure-CmkDzzkD.js} +6 -6
- package/dist/{register.configure-45--Sly1.js → register.configure-qTTgDLbM.js} +6 -6
- package/dist/{register.maintenance-DyEJx7NY.js → register.maintenance-C5XnP7dI.js} +7 -7
- package/dist/{register.maintenance-CXbxRtWI.js → register.maintenance-_ZVy0fEd.js} +8 -8
- package/dist/{register.message-C7Yh1uky.js → register.message-2NhFUTcM.js} +2 -2
- package/dist/{register.message-CiN_pt6K.js → register.message-BC4qZya-.js} +2 -2
- package/dist/{register.onboard-BWaRkbei.js → register.onboard-BQOCLgJo.js} +4 -4
- package/dist/{register.onboard-e_2hc2Rm.js → register.onboard-iLXzJM7V.js} +4 -4
- package/dist/{register.setup-zwh90Vn-.js → register.setup-B2-yGr1t.js} +4 -4
- package/dist/{register.setup-BIIFHtF7.js → register.setup-CcyX5j-M.js} +4 -4
- package/dist/{register.status-health-sessions-D6t5maEr.js → register.status-health-sessions-BCK-DpIZ.js} +3 -3
- package/dist/{register.status-health-sessions-O-sVAFHE.js → register.status-health-sessions-Wx568N29.js} +3 -3
- package/dist/{register.subclis-DOiZocR6.js → register.subclis-NhUwrvHD.js} +9 -9
- package/dist/{reply-05js8eGB.js → reply-lB0BEzXe.js} +150 -135
- package/dist/{run-main-u-Eyc8Wm.js → run-main-CaLWEHIe.js} +14 -14
- package/dist/{runner-CU9l0uJh.js → runner-WAG0M5s9.js} +1 -1
- package/dist/{server-methods-Bvl1xubo.js → server-methods-BLMrfe0E.js} +7 -7
- package/dist/{server-methods-Dds-iEoY.js → server-methods-antquo4f.js} +7 -7
- package/dist/{server-node-events-Qp-gJMET.js → server-node-events-CGCf_VrC.js} +2 -2
- package/dist/{server-node-events-qGqpsPxm.js → server-node-events-SU9R43JA.js} +2 -2
- package/dist/{status-CfYa1Q9K.js → status-BC-KwUC9.js} +1 -1
- package/dist/{status-BATOXGRi.js → status-C3aQLr4L.js} +2 -2
- package/dist/{status-BqQ9mm64.js → status-COOFRiRw.js} +1 -1
- package/dist/{status-BRSo-LY3.js → status-OFq7A4LY.js} +2 -2
- package/dist/{subagent-registry-lbDgDwLy.js → subagent-registry-B0mypfy9.js} +153 -138
- package/dist/{unified-runner-B4ICXRlg.js → unified-runner-B3woBNrE.js} +178 -163
- package/dist/{update-cli-BOaP4XyQ.js → update-cli-8VnoOX2I.js} +8 -8
- package/dist/{update-cli-R8-SSkbS.js → update-cli-DCcoGy6P.js} +7 -7
- package/dist/{update-runner-B8UmqtLI.js → update-runner-BOUFaEvf.js} +1 -1
- package/dist/{update-runner-CWJ4pC1b.js → update-runner-Zj0IkuvS.js} +1 -1
- package/dist/{web-CSrDbJJ7.js → web-CNlgAOtg.js} +1 -1
- package/dist/{web-DBFW0ejP.js → web-D6iv7lpW.js} +1 -1
- package/dist/{web-CQH9fSkH.js → web-DnKUPuUb.js} +6 -6
- package/dist/{web-BWybtnEa.js → web-Dtu6w-WL.js} +2 -2
- package/package.json +1 -1
- package/dist/plugin-sdk/web-BCsJFuQu.js +0 -65
|
@@ -1,72 +1,72 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
2
|
import { _ as isCronSessionKey, b as resolveThreadParentSessionKey, c as normalizeMainKey, d as sanitizeAgentId, f as DEFAULT_ACCOUNT_ID, g as isAcpSessionKey, h as getSubagentDepth, l as resolveAgentIdFromSessionKey, o as classifySessionKeyShape, p as normalizeAccountId$2, r as buildAgentMainSessionKey, s as normalizeAgentId, t as DEFAULT_AGENT_ID, u as resolveThreadSessionKeys, v as isSubagentSessionKey, y as parseAgentSessionKey } from "./session-key-C_0eELjb.js";
|
|
3
|
-
import { c as logoutWeb, f as readWebSelfId, g as webAuthExists, o as getWebAuthAgeMs, r as resolveWhatsAppAccount, s as logWebSelfId } from "./accounts-
|
|
3
|
+
import { c as logoutWeb, f as readWebSelfId, g as webAuthExists, o as getWebAuthAgeMs, r as resolveWhatsAppAccount, s as logWebSelfId } from "./accounts-Ddm33hQm.js";
|
|
4
4
|
import { c as expandHomePrefix, i as resolveGatewayPort, n as resolveConfigPath, s as resolveStateDir, t as STATE_DIR, u as resolveRequiredHomeDir } from "./paths-DR2yt_mP.js";
|
|
5
5
|
import { a as saveJsonFile, i as loadJsonFile } from "./github-copilot-token-D9X2phUj.js";
|
|
6
|
-
import { A as resolveSlackBotToken, C as resolveTelegramToken, D as resolveSlackAccount, F as resolveDiscordAccount, I as normalizeDiscordToken, N as listEnabledDiscordAccounts, S as resolveTelegramAccount, _ as normalizeWhatsAppTarget, b as listTelegramAccountIds, g as isWhatsAppGroupJid, h as resolveSlackChannelId, j as createDiscordActionGate, k as resolveSlackAppToken, m as parseSlackTarget, n as listChannelPlugins, r as normalizeChannelId, t as getChannelPlugin, v as createTelegramActionGate, y as listEnabledTelegramAccounts } from "./plugins-
|
|
6
|
+
import { A as resolveSlackBotToken, C as resolveTelegramToken, D as resolveSlackAccount, F as resolveDiscordAccount, I as normalizeDiscordToken, N as listEnabledDiscordAccounts, S as resolveTelegramAccount, _ as normalizeWhatsAppTarget, b as listTelegramAccountIds, g as isWhatsAppGroupJid, h as resolveSlackChannelId, j as createDiscordActionGate, k as resolveSlackAppToken, m as parseSlackTarget, n as listChannelPlugins, r as normalizeChannelId, t as getChannelPlugin, v as createTelegramActionGate, y as listEnabledTelegramAccounts } from "./plugins-BNByVCIH.js";
|
|
7
7
|
import { n as fetchWithTimeout, t as bindAbortRelay } from "./fetch-timeout-ChYuW7LE.js";
|
|
8
8
|
import { n as wrapFetchWithAbortSignal, t as resolveFetch } from "./fetch-CUNoPTKm.js";
|
|
9
|
-
import { $ as isRich, A as normalizeE164, D as isRecord$1, E as formatTerminalLink, H as isPlainObject, I as shortenHomeInString, J as setVerbose, K as logVerbose, L as shortenHomePath, P as resolveUserPath, Q as colorize, R as sleep$1, S as clampInt, T as escapeRegExp, U as danger, V as truncateUtf16Safe, Y as shouldLogVerbose, Z as warn, _ as matchPluginCommand, a as normalizeAnyChannelId, b as CONFIG_DIR, ct as normalizeLogLevel, d as createPluginRegistry, et as theme, f as normalizePluginHttpPath, g as listPluginCommands, h as getPluginCommandSpecs, l as requireActivePluginRegistry, m as executePluginCommand, n as CHAT_CHANNEL_ORDER, o as normalizeChannelId$1, p as clearPluginCommands, r as DEFAULT_CHAT_CHANNEL, tt as getChildLogger, u as setActivePluginRegistry, ut as resolvePreferredSymiTmpDir, v as createInternalHookEvent, w as ensureDir$3, y as triggerInternalHook, z as sliceUtf16Safe } from "./registry
|
|
10
|
-
import { n as retryAsync } from "./retry-
|
|
11
|
-
import { $ as fetchChannelPermissionsDiscord, A as unpinMessageDiscord, At as fetchDiscord, B as listScheduledEventsDiscord, C as editMessageDiscord, Ct as resolveTimestampMs, D as pinMessageDiscord, E as listThreadsDiscord, Et as normalizeChannelSlug, F as fetchMemberInfoDiscord, G as uploadStickerDiscord, H as timeoutMemberDiscord, I as fetchRoleInfoDiscord, J as editChannelDiscord, K as createChannelDiscord, L as fetchVoiceStatusDiscord, M as banMemberDiscord, N as createScheduledEventDiscord, O as readMessagesDiscord, Ot as resolveChannelEntryMatchWithFallback, P as fetchChannelInfoDiscord, Q as stripUndefinedFields, R as kickMemberDiscord, S as deleteMessageDiscord, St as resolveDiscordSystemLocation, T as listPinsDiscord, Tt as buildChannelKeyCandidates, U as listGuildEmojisDiscord, V as removeRoleDiscord, W as uploadEmojiDiscord, X as removeChannelPermissionDiscord, Y as moveChannelDiscord, Z as setChannelPermissionDiscord, _ as sendPollDiscord, _t as resolveDiscordShouldRequireMention, a as removeReactionDiscord, at as resolveDiscordChannelId, b as sendWebhookMessageDiscord, bt as formatDiscordReactionEmoji, c as formatDiscordComponentEventText, ct as allowListMatches$1, d as parseDiscordModalCustomId, dt as normalizeDiscordSlug, et as hasAnyGuildPermissionDiscord, f as parseDiscordModalCustomIdForCarbon, ft as resolveDiscordAllowListMatch, g as sendMessageDiscord, gt as resolveDiscordOwnerAllowFrom, h as resolveDiscordModalEntry, ht as resolveDiscordMemberAccessState, i as removeOwnReactionsDiscord, it as parseDiscordTarget, j as addRoleDiscord, k as searchMessagesDiscord, l as parseDiscordComponentCustomId, lt as isDiscordGroupAllowedByPolicy, m as resolveDiscordComponentEntry, mt as resolveDiscordGuildEntry, n as fetchReactionsDiscord, nt as createDiscordClient, o as sendDiscordComponentMessage, ot as listDiscordDirectoryGroupsLive, p as readDiscordComponentSpec, pt as resolveDiscordChannelConfigWithFallback, q as deleteChannelDiscord, r as reactMessageDiscord, rt as createDiscordRestClient, s as createDiscordFormModal, st as listDiscordDirectoryPeersLive, tt as chunkDiscordTextWithMode, u as parseDiscordComponentCustomIdForCarbon, ut as normalizeDiscordAllowList, v as sendStickerDiscord, vt as resolveGroupDmAllow, w as fetchMessageDiscord, wt as applyChannelMatchMeta, x as createThreadDiscord, xt as formatDiscordUserTag, y as sendVoiceMessageDiscord, yt as shouldEmitDiscordReactionNotification, z as listGuildChannelsDiscord } from "./send-
|
|
12
|
-
import { B as getConfigOverrides, C as resolveIMessageRemoteAttachmentRoots, G as parseConfigPath, H as setConfigOverride, J as isSafeExecutableValue, K as setConfigValueAtPath, R as parseDurationMs, S as resolveIMessageAttachmentRoots, U as unsetConfigOverride, V as resetConfigOverrides, W as getConfigValueAtPath, X as resolveAgentMaxConcurrent, Y as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, Z as VERSION, _ as normalizeTelegramCommandName, a as writeConfigFile, b as isInboundPathAllowed, g as TELEGRAM_COMMAND_NAME_PATTERN, i as resolveConfigSnapshotHash, n as loadConfig, o as validateConfigObjectWithPlugins, q as unsetConfigValueAtPath, r as readConfigFileSnapshot, v as resolveTelegramCustomCommands, w as normalizeScpRemoteHost, z as validateJsonSchemaValue } from "./config-
|
|
13
|
-
import { a as clearActiveProgressLine, i as defaultRuntime, o as registerActiveProgressLine, r as createNonExitingRuntime, s as unregisterActiveProgressLine, t as createSubsystemLogger } from "./subsystem-
|
|
14
|
-
import { i as parseBooleanValue$1, n as resolveCliName, r as isTruthyEnvValue, t as formatCliCommand } from "./command-format-
|
|
15
|
-
import { A as getSoonestCooldownExpiry, B as resolveSymiAgentDir, C as getCustomProviderApiKey, D as resolveModelAuthMode, E as resolveEnvApiKey, F as dedupeProfileIds, G as normalizeSecretInput, H as withFileLock, I as listProfilesForProvider, J as DEFAULT_MODEL, K as resolveAuthProfileDisplayLabel, L as markAuthProfileGood, M as markAuthProfileFailure, N as markAuthProfileUsed, P as resolveApiKeyForProfile, Q as resolveShellEnvFallbackTimeoutMs, R as ensureAuthProfileStore, S as getApiKeyForModel, T as resolveApiKeyForProvider, X as getShellPathFromLoginShell, Y as DEFAULT_PROVIDER, a as isCliProvider, b as OLLAMA_NATIVE_BASE_URL, c as normalizeProviderId, d as resolveDefaultModelForAgent, f as resolveModelRefFromString, i as findNormalizedProviderValue, j as isProfileInCooldown, k as resolveAuthProfileOrder, m as resolveThinkingDefault, n as buildConfiguredAllowlistKeys, o as modelKey, p as resolveSubagentSpawnModelSelection, q as DEFAULT_CONTEXT_TOKENS, r as buildModelAliasIndex, s as normalizeModelRef$2, t as buildAllowedModelSet, u as resolveConfiguredModelRef, w as requireApiKey, x as createOllamaStreamFn, z as resolveAuthStorePathForDisplay } from "./model-selection-
|
|
16
|
-
import { A as logInfo, C as resolveSymiPackageRoot, D as spawnWithFallback, E as runExec, O as logDebug, S as loadWorkspaceBootstrapFiles, T as runCommandWithTimeout, a as resolveAgentModelPrimary, b as ensureAgentWorkspace, c as resolveDefaultAgentId, d as resolveSessionAgentIds, h as DEFAULT_IDENTITY_FILENAME, i as resolveAgentModelFallbacksOverride, j as logWarn, k as logError, l as resolveEffectiveModelFallbacks, m as DEFAULT_BOOTSTRAP_FILENAME, n as resolveAgentConfig, o as resolveAgentSkillsFilter, p as DEFAULT_AGENT_WORKSPACE_DIR, r as resolveAgentDir, s as resolveAgentWorkspaceDir, t as listAgentIds, u as resolveSessionAgentId, x as filterBootstrapFilesForSession } from "./agent-scope-
|
|
17
|
-
import { c as normalizePluginsConfig, f as isPathInsideWithRealpath, i as safeStatSync, l as resolveEnableState, n as discoverSymiPlugins, p as isDangerousHostEnvVarName, r as isPathInside, s as applyTestPluginDefaults, t as loadPluginManifestRegistry, u as resolveMemorySlotDecision } from "./manifest-registry-
|
|
9
|
+
import { $ as isRich, A as normalizeE164, D as isRecord$1, E as formatTerminalLink, H as isPlainObject, I as shortenHomeInString, J as setVerbose, K as logVerbose, L as shortenHomePath, P as resolveUserPath, Q as colorize, R as sleep$1, S as clampInt, T as escapeRegExp, U as danger, V as truncateUtf16Safe, Y as shouldLogVerbose, Z as warn, _ as matchPluginCommand, a as normalizeAnyChannelId, b as CONFIG_DIR, ct as normalizeLogLevel, d as createPluginRegistry, et as theme, f as normalizePluginHttpPath, g as listPluginCommands, h as getPluginCommandSpecs, l as requireActivePluginRegistry, m as executePluginCommand, n as CHAT_CHANNEL_ORDER, o as normalizeChannelId$1, p as clearPluginCommands, r as DEFAULT_CHAT_CHANNEL, tt as getChildLogger, u as setActivePluginRegistry, ut as resolvePreferredSymiTmpDir, v as createInternalHookEvent, w as ensureDir$3, y as triggerInternalHook, z as sliceUtf16Safe } from "./registry-D0xTnUWt.js";
|
|
10
|
+
import { n as retryAsync } from "./retry-CwQ_iIj8.js";
|
|
11
|
+
import { $ as fetchChannelPermissionsDiscord, A as unpinMessageDiscord, At as fetchDiscord, B as listScheduledEventsDiscord, C as editMessageDiscord, Ct as resolveTimestampMs, D as pinMessageDiscord, E as listThreadsDiscord, Et as normalizeChannelSlug, F as fetchMemberInfoDiscord, G as uploadStickerDiscord, H as timeoutMemberDiscord, I as fetchRoleInfoDiscord, J as editChannelDiscord, K as createChannelDiscord, L as fetchVoiceStatusDiscord, M as banMemberDiscord, N as createScheduledEventDiscord, O as readMessagesDiscord, Ot as resolveChannelEntryMatchWithFallback, P as fetchChannelInfoDiscord, Q as stripUndefinedFields, R as kickMemberDiscord, S as deleteMessageDiscord, St as resolveDiscordSystemLocation, T as listPinsDiscord, Tt as buildChannelKeyCandidates, U as listGuildEmojisDiscord, V as removeRoleDiscord, W as uploadEmojiDiscord, X as removeChannelPermissionDiscord, Y as moveChannelDiscord, Z as setChannelPermissionDiscord, _ as sendPollDiscord, _t as resolveDiscordShouldRequireMention, a as removeReactionDiscord, at as resolveDiscordChannelId, b as sendWebhookMessageDiscord, bt as formatDiscordReactionEmoji, c as formatDiscordComponentEventText, ct as allowListMatches$1, d as parseDiscordModalCustomId, dt as normalizeDiscordSlug, et as hasAnyGuildPermissionDiscord, f as parseDiscordModalCustomIdForCarbon, ft as resolveDiscordAllowListMatch, g as sendMessageDiscord, gt as resolveDiscordOwnerAllowFrom, h as resolveDiscordModalEntry, ht as resolveDiscordMemberAccessState, i as removeOwnReactionsDiscord, it as parseDiscordTarget, j as addRoleDiscord, k as searchMessagesDiscord, l as parseDiscordComponentCustomId, lt as isDiscordGroupAllowedByPolicy, m as resolveDiscordComponentEntry, mt as resolveDiscordGuildEntry, n as fetchReactionsDiscord, nt as createDiscordClient, o as sendDiscordComponentMessage, ot as listDiscordDirectoryGroupsLive, p as readDiscordComponentSpec, pt as resolveDiscordChannelConfigWithFallback, q as deleteChannelDiscord, r as reactMessageDiscord, rt as createDiscordRestClient, s as createDiscordFormModal, st as listDiscordDirectoryPeersLive, tt as chunkDiscordTextWithMode, u as parseDiscordComponentCustomIdForCarbon, ut as normalizeDiscordAllowList, v as sendStickerDiscord, vt as resolveGroupDmAllow, w as fetchMessageDiscord, wt as applyChannelMatchMeta, x as createThreadDiscord, xt as formatDiscordUserTag, y as sendVoiceMessageDiscord, yt as shouldEmitDiscordReactionNotification, z as listGuildChannelsDiscord } from "./send-CjOBB3Vo.js";
|
|
12
|
+
import { B as getConfigOverrides, C as resolveIMessageRemoteAttachmentRoots, G as parseConfigPath, H as setConfigOverride, J as isSafeExecutableValue, K as setConfigValueAtPath, R as parseDurationMs, S as resolveIMessageAttachmentRoots, U as unsetConfigOverride, V as resetConfigOverrides, W as getConfigValueAtPath, X as resolveAgentMaxConcurrent, Y as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, Z as VERSION, _ as normalizeTelegramCommandName, a as writeConfigFile, b as isInboundPathAllowed, g as TELEGRAM_COMMAND_NAME_PATTERN, i as resolveConfigSnapshotHash, n as loadConfig, o as validateConfigObjectWithPlugins, q as unsetConfigValueAtPath, r as readConfigFileSnapshot, v as resolveTelegramCustomCommands, w as normalizeScpRemoteHost, z as validateJsonSchemaValue } from "./config-KlTNfkFF.js";
|
|
13
|
+
import { a as clearActiveProgressLine, i as defaultRuntime, o as registerActiveProgressLine, r as createNonExitingRuntime, s as unregisterActiveProgressLine, t as createSubsystemLogger } from "./subsystem-B2uDN3TV.js";
|
|
14
|
+
import { i as parseBooleanValue$1, n as resolveCliName, r as isTruthyEnvValue, t as formatCliCommand } from "./command-format-GKSevep4.js";
|
|
15
|
+
import { A as getSoonestCooldownExpiry, B as resolveSymiAgentDir, C as getCustomProviderApiKey, D as resolveModelAuthMode, E as resolveEnvApiKey, F as dedupeProfileIds, G as normalizeSecretInput, H as withFileLock, I as listProfilesForProvider, J as DEFAULT_MODEL, K as resolveAuthProfileDisplayLabel, L as markAuthProfileGood, M as markAuthProfileFailure, N as markAuthProfileUsed, P as resolveApiKeyForProfile, Q as resolveShellEnvFallbackTimeoutMs, R as ensureAuthProfileStore, S as getApiKeyForModel, T as resolveApiKeyForProvider, X as getShellPathFromLoginShell, Y as DEFAULT_PROVIDER, a as isCliProvider, b as OLLAMA_NATIVE_BASE_URL, c as normalizeProviderId, d as resolveDefaultModelForAgent, f as resolveModelRefFromString, i as findNormalizedProviderValue, j as isProfileInCooldown, k as resolveAuthProfileOrder, m as resolveThinkingDefault, n as buildConfiguredAllowlistKeys, o as modelKey, p as resolveSubagentSpawnModelSelection, q as DEFAULT_CONTEXT_TOKENS, r as buildModelAliasIndex, s as normalizeModelRef$2, t as buildAllowedModelSet, u as resolveConfiguredModelRef, w as requireApiKey, x as createOllamaStreamFn, z as resolveAuthStorePathForDisplay } from "./model-selection-CsbEfrS0.js";
|
|
16
|
+
import { A as logInfo, C as resolveSymiPackageRoot, D as spawnWithFallback, E as runExec, O as logDebug, S as loadWorkspaceBootstrapFiles, T as runCommandWithTimeout, a as resolveAgentModelPrimary, b as ensureAgentWorkspace, c as resolveDefaultAgentId, d as resolveSessionAgentIds, h as DEFAULT_IDENTITY_FILENAME, i as resolveAgentModelFallbacksOverride, j as logWarn, k as logError, l as resolveEffectiveModelFallbacks, m as DEFAULT_BOOTSTRAP_FILENAME, n as resolveAgentConfig, o as resolveAgentSkillsFilter, p as DEFAULT_AGENT_WORKSPACE_DIR, r as resolveAgentDir, s as resolveAgentWorkspaceDir, t as listAgentIds, u as resolveSessionAgentId, x as filterBootstrapFilesForSession } from "./agent-scope-CYYpcO9W.js";
|
|
17
|
+
import { c as normalizePluginsConfig, f as isPathInsideWithRealpath, i as safeStatSync, l as resolveEnableState, n as discoverSymiPlugins, p as isDangerousHostEnvVarName, r as isPathInside, s as applyTestPluginDefaults, t as loadPluginManifestRegistry, u as resolveMemorySlotDecision } from "./manifest-registry-CPnHl_K3.js";
|
|
18
18
|
import { n as formatErrorMessage, r as formatUncaughtError } from "./errors-Bv8oZiTO.js";
|
|
19
|
-
import { n as recordChannelActivity, r as createDiscordRetryRunner, t as getChannelActivity } from "./channel-activity-
|
|
19
|
+
import { n as recordChannelActivity, r as createDiscordRetryRunner, t as getChannelActivity } from "./channel-activity-DoC1xtDu.js";
|
|
20
20
|
import { n as normalizePollInput } from "./polls-3WJMd-G-.js";
|
|
21
|
-
import { c as detectMime, d as imageMimeFromFormat, f as isAudioFileName, g as MAX_IMAGE_BYTES, i as getImageMetadata, l as extensionForMime, p as isGifMedia, s as resizeToJpeg, v as mediaKindFromMime } from "./image-ops-
|
|
21
|
+
import { c as detectMime, d as imageMimeFromFormat, f as isAudioFileName, g as MAX_IMAGE_BYTES, i as getImageMetadata, l as extensionForMime, p as isGifMedia, s as resizeToJpeg, v as mediaKindFromMime } from "./image-ops-BlQR__MN.js";
|
|
22
22
|
import { a as isBlockedHostnameOrIp, c as normalizeHostname, t as SsrFBlockedError } from "./ssrf-DKZ8eBrk.js";
|
|
23
|
-
import { a as readResponseWithLimit, i as fetchRemoteMedia, n as getDefaultMediaLocalRoots, o as fetchWithSsrFGuard, t as getAgentScopedMediaLocalRoots } from "./local-roots-
|
|
24
|
-
import { a as loadWebMedia, i as getDefaultLocalRoots } from "./ir-
|
|
25
|
-
import { a as chunkText, c as resolveChunkMode, d as findFenceSpanAt, f as isSafeFenceBreak, i as chunkMarkdownTextWithMode, l as resolveTextChunkLimit, o as chunkTextWithMode, p as parseFenceSpans, r as chunkMarkdownText, t as chunkByNewline } from "./chunk-
|
|
26
|
-
import { a as isMarkdownCapableMessageChannel, c as resolveGatewayMessageChannel, d as GATEWAY_CLIENT_MODES, f as GATEWAY_CLIENT_NAMES, i as isInternalMessageChannel, l as resolveMessageChannel, n as isDeliverableMessageChannel, o as listDeliverableMessageChannels, r as isGatewayMessageChannel, s as normalizeMessageChannel, t as INTERNAL_MESSAGE_CHANNEL, u as GATEWAY_CLIENT_IDS } from "./message-channel-
|
|
23
|
+
import { a as readResponseWithLimit, i as fetchRemoteMedia, n as getDefaultMediaLocalRoots, o as fetchWithSsrFGuard, t as getAgentScopedMediaLocalRoots } from "./local-roots-BHLNSI8U.js";
|
|
24
|
+
import { a as loadWebMedia, i as getDefaultLocalRoots } from "./ir-BJ6BHE5b.js";
|
|
25
|
+
import { a as chunkText, c as resolveChunkMode, d as findFenceSpanAt, f as isSafeFenceBreak, i as chunkMarkdownTextWithMode, l as resolveTextChunkLimit, o as chunkTextWithMode, p as parseFenceSpans, r as chunkMarkdownText, t as chunkByNewline } from "./chunk-Dw2XBYXv.js";
|
|
26
|
+
import { a as isMarkdownCapableMessageChannel, c as resolveGatewayMessageChannel, d as GATEWAY_CLIENT_MODES, f as GATEWAY_CLIENT_NAMES, i as isInternalMessageChannel, l as resolveMessageChannel, n as isDeliverableMessageChannel, o as listDeliverableMessageChannels, r as isGatewayMessageChannel, s as normalizeMessageChannel, t as INTERNAL_MESSAGE_CHANNEL, u as GATEWAY_CLIENT_IDS } from "./message-channel-COTAJzHd.js";
|
|
27
27
|
import { t as normalizeChatType } from "./chat-type-CEMQNtWX.js";
|
|
28
|
-
import { n as resolveMarkdownTableMode } from "./markdown-tables-
|
|
29
|
-
import { t as convertMarkdownTables } from "./tables-
|
|
30
|
-
import { a as formatIMessageChatTarget, c as parseIMessageTarget, i as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS, o as isAllowedIMessageSender, r as createIMessageRpcClient, s as normalizeIMessageHandle, t as sendMessageIMessage } from "./send-
|
|
31
|
-
import { i as resolveImageSanitizationLimits, n as sanitizeImageBlocks, r as sanitizeToolResultImages } from "./tool-images-
|
|
32
|
-
import { a as createActionGate, c as jsonResult, d as readReactionParams, f as readStringArrayParam, l as parseAvailableTags, m as readStringParam, n as missingTargetError, o as imageResult, p as readStringOrNumberParam, r as unknownTargetError, s as imageResultFromFile, t as ambiguousTargetError, u as readNumberParam } from "./target-errors-
|
|
33
|
-
import { a as createSlackWebClient, c as validateSlackBlocksArray, i as buildSlackBlocksFallbackText, o as resolveSlackWebClientOptions, s as parseSlackBlocksInput, t as sendMessageSlack } from "./send-
|
|
34
|
-
import { $ as parseTelegramTarget, A as hasBotMention, B as resolveSenderAllowMatch, C as buildTelegramGroupPeerId, D as describeReplyTarget, E as buildTypingThreadParams, F as resolveTelegramReplyId, G as readChannelAllowFromStore, H as isSenderIdAllowed, I as resolveTelegramStreamMode, J as upsertChannelPairingRequest, L as resolveTelegramThreadSpec, M as resolveTelegramForumThreadId, N as resolveTelegramGroupAllowFromContext, O as expandTextLinks, P as resolveTelegramMediaPlaceholder, Q as isVoiceCompatibleAudio, R as isSenderAllowed$1, S as buildTelegramGroupFrom, T as buildTelegramThreadParams, U as mergeAllowFromSources, V as firstDefined$1, W as addChannelAllowFromStoreEntry, X as listPairingChannels, Y as getPairingAdapter, Z as withTelegramApiErrorLogging, _ as resolveTelegramFetch, a as reactMessageTelegram, b as buildSenderLabel, c as sendStickerTelegram, d as wasSentByBot, et as resolveTelegramTargetChatType, f as isRecoverableTelegramNetworkError, g as wrapFileReferencesInHtml, h as renderTelegramHtmlText, i as editMessageTelegram, j as normalizeForwardedContext, k as extractTelegramLocation, m as markdownToTelegramHtml, n as createForumTopicTelegram, nt as toLocationContext, o as sendMessageTelegram, p as markdownToTelegramChunks, q as removeChannelAllowFromStoreEntry, r as deleteMessageTelegram, s as sendPollTelegram, t as buildInlineKeyboard, tt as formatLocationText, u as resolveTelegramVoiceSend, v as splitTelegramCaption, w as buildTelegramParentPeer, x as buildSenderName, y as buildGroupLabel, z as normalizeAllowFromWithStore$1 } from "./send-
|
|
35
|
-
import { _ as CLI_OUTPUT_MAX_BUFFER, a as resolveMediaAttachmentLocalRoots, c as loadModelCatalog, d as resolveAttachmentKind, f as registerUnhandledRejectionHandler, g as resolveMediaUnderstandingScope, h as normalizeMediaUnderstandingChatType, i as resolveAutoImageModel, l as modelSupportsVision, m as resolveTimeoutMs$1, n as createMediaAttachmentCache, o as runCapability, p as resolveConcurrency, r as normalizeMediaAttachments, s as findModelInCatalog, t as buildProviderRegistry, v as applyTemplate, y as buildRandomTempFilePath } from "./runner-
|
|
36
|
-
import { a as resolveAckReaction, c as resolveHumanDelayConfig, i as resolveResponsePrefixTemplate, n as createReplyPrefixOptions, o as resolveAgentIdentity, s as resolveEffectiveMessagesConfig } from "./reply-prefix-
|
|
37
|
-
import { a as isSilentReplyText, i as isSilentReplyPrefixText, n as SILENT_REPLY_TOKEN, r as SYMIPULSE_TOKEN, t as HEARTBEAT_TOKEN } from "./tokens-
|
|
38
|
-
import { c as getSkillsSnapshotVersion, d as resolvePairingPaths, f as createAsyncLock, i as resolveSkillCommandInvocation, l as generatePairingToken, m as writeJsonAtomic, n as listSkillCommandsForAgents, o as getRemoteSkillEligibility, p as readJsonFile, r as listSkillCommandsForWorkspace, s as ensureSkillsWatcher, t as listReservedChatSlashCommandNames, u as pruneExpiredPending } from "./skill-commands-
|
|
39
|
-
import { c as assertSandboxPath, d as resolveSandboxedMediaSource, f as applySkillEnvOverrides, i as resolveSkillsPromptForRun, l as resolveSandboxInputPath, n as buildWorkspaceSkillSnapshot, p as applySkillEnvOverridesFromSnapshot, r as loadWorkspaceSkillEntries, s as assertMediaNotDataUrl } from "./skills-
|
|
40
|
-
import { M as isSecureWebSocketUrl, N as rawDataToString, T as DEFAULT_AI_SNAPSHOT_MAX_CHARS, x as ensureChromeExtensionRelayServer } from "./chrome-
|
|
41
|
-
import { A as normalizeHyphenSlug, F as resolveChannelGroupRequireMention, I as resolveChannelGroupToolsPolicy, M as normalizeStringEntriesLower, P as resolveChannelGroupPolicy, a as normalizeReasoningLevel, c as normalizeVerboseLevel, d as getChannelDock, f as listChannelDocks, i as normalizeElevatedLevel, j as normalizeStringEntries, k as normalizeAtHashSlug, l as resolveResponseUsageMode, m as normalizeSignalMessagingTarget, n as formatXHighModelHint, o as normalizeThinkLevel, s as normalizeUsageDisplay, t as formatThinkingLevels, u as supportsXHighThinking } from "./thinking-
|
|
42
|
-
import { r as resolveIMessageAccount } from "./accounts-
|
|
43
|
-
import { i as resolveSignalAccount, t as listEnabledSignalAccounts } from "./accounts-
|
|
44
|
-
import { C as getGlobalHookRunner, S as parseInlineDirectives$1, _ as normalizeChannelTargetInput, a as normalizeOutboundPayloadsForJson, b as MEDIA_TOKEN_RE, c as applyReplyThreading, d as isRenderablePayload, f as shouldSuppressMessagingToolReplies, g as buildTargetResolverSignature, h as throwIfAborted, i as normalizeOutboundPayloads, l as filterMessagingToolDuplicates, m as resolveReplyToMode, o as normalizeReplyPayloadsForDelivery, p as createReplyToModeFilterForChannel, r as formatOutboundPayloadLog, s as applyReplyTagsToPayload, t as deliverOutboundPayloads, u as filterMessagingToolMediaDuplicates, v as normalizeTargetForProvider, w as initializeGlobalHookRunner, x as splitMediaFromOutput, y as parseReplyDirectives } from "./deliver-
|
|
45
|
-
import { $ as normalizeToolName, A as isTransientHttpError, At as countToolResults, B as resolveProfile, Bt as resolveChannelResetConfig, C as isContextOverflowError, Ct as deliveryContextKey, D as isRateLimitAssistantError, Dt as normalizeAccountId$3, E as isLikelyContextOverflowError, Et as normalizeSessionDeliveryFields, F as resolveSandboxContext, Ft as normalizeInputProvenance, G as resolveBrowserControlAuth, Gt as resolveFreshSessionTotalTokens, H as resolveExistingPathsWithinRoot, Ht as resolveSessionResetType, I as resolveSandboxRuntimeStatus, It as acquireSessionWriteLock, J as buildPluginToolGroups, Jt as resolveMainSessionKey, K as resolveSandboxConfigForAgent, Kt as canonicalizeMainSessionAlias, L as createBrowserRouteContext, Lt as resolveSessionLockMaxHoldFromTimeout, M as parseImageSizeError, Mt as INPUT_PROVENANCE_KIND_VALUES, N as sanitizeUserFacingText, Nt as applyInputProvenanceToUserMessage, O as isRawApiErrorPayload, Ot as archiveSessionTranscripts, P as ensureSandboxWorkspaceForSession, Pt as hasInterSessionUserProvenance, Q as mergeAlsoAllowPolicy, R as registerBrowserRoutes, Rt as resolveSessionKey, S as isCompactionFailureError, St as deliveryContextFromSession, T as isFailoverErrorMessage, Tt as normalizeDeliveryContext, U as getBridgeAuthForPort, Ut as resolveThreadFlag, V as DEFAULT_UPLOAD_DIR, Vt as resolveSessionResetPolicy, W as ensureBrowserControlAuth, Wt as DEFAULT_RESET_TRIGGERS, X as expandPolicyWithPluginGroups, Xt as resolveGroupSessionKey, Y as collectExplicitAllowlist, Yt as deriveSessionMetaPatch, Z as expandToolGroups, _ as formatRawAssistantErrorForUi, _t as updateLastRoute, a as isMessagingToolDuplicateNormalized, at as ensureSessionHeader, b as isBillingAssistantError, bt as isCacheEnabled, c as extractToolCallsFromAssistant, ct as sanitizeGoogleTurnOrdering, d as isAntigravityClaude, dt as appendAssistantMessageToSessionTranscript, et as resolveToolProfilePolicy, f as isGoogleModelApi, g as formatBillingErrorMessage, gt as recordSessionMetaFromInbound, h as formatAssistantErrorText, ht as readSessionUpdatedAt, it as buildBootstrapContextFiles, j as parseImageDimensionError, jt as extractToolCallNames, k as isTimeoutErrorMessage, kt as capArrayByJsonBytes, l as extractToolResultId, lt as extractDeliveryInfo, m as classifyFailoverReason, mt as loadSessionStore, n as validateGeminiTurns, nt as compileGlobPatterns, o as normalizeTextForComparison, ot as resolveBootstrapMaxChars, p as BILLING_ERROR_USER_MESSAGE, pt as resolveAndPersistSessionFile, q as applyOwnerOnlyToolPolicy, qt as resolveExplicitAgentSessionKey, r as pickFallbackThinkingLevel, rt as matchesAnyGlobPattern, s as sanitizeSessionMessagesImages, st as resolveBootstrapTotalMaxChars, t as validateAnthropicTurns, tt as stripPluginOnlyAllowlist, u as downgradeOpenAIReasoningBlocks, ut as parseSessionThreadInfo, v as getApiErrorPayloadFingerprint, vt as updateSessionStore, w as isFailoverAssistantError, wt as mergeDeliveryContext, x as isCloudCodeAssistFormatError, xt as resolveCacheTtlMs$1, y as isAuthAssistantError, yt as updateSessionStoreEntry, z as resolveBrowserConfig, zt as evaluateSessionFreshness } from "./pi-embedded-helpers-
|
|
28
|
+
import { n as resolveMarkdownTableMode } from "./markdown-tables-BoYFajMu.js";
|
|
29
|
+
import { t as convertMarkdownTables } from "./tables-DNwXwNFa.js";
|
|
30
|
+
import { a as formatIMessageChatTarget, c as parseIMessageTarget, i as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS, o as isAllowedIMessageSender, r as createIMessageRpcClient, s as normalizeIMessageHandle, t as sendMessageIMessage } from "./send-C5h_YxNb.js";
|
|
31
|
+
import { i as resolveImageSanitizationLimits, n as sanitizeImageBlocks, r as sanitizeToolResultImages } from "./tool-images-HJ2sfZDV.js";
|
|
32
|
+
import { a as createActionGate, c as jsonResult, d as readReactionParams, f as readStringArrayParam, l as parseAvailableTags, m as readStringParam, n as missingTargetError, o as imageResult, p as readStringOrNumberParam, r as unknownTargetError, s as imageResultFromFile, t as ambiguousTargetError, u as readNumberParam } from "./target-errors-Paro1BjP.js";
|
|
33
|
+
import { a as createSlackWebClient, c as validateSlackBlocksArray, i as buildSlackBlocksFallbackText, o as resolveSlackWebClientOptions, s as parseSlackBlocksInput, t as sendMessageSlack } from "./send-B2CEnVLL.js";
|
|
34
|
+
import { $ as parseTelegramTarget, A as hasBotMention, B as resolveSenderAllowMatch, C as buildTelegramGroupPeerId, D as describeReplyTarget, E as buildTypingThreadParams, F as resolveTelegramReplyId, G as readChannelAllowFromStore, H as isSenderIdAllowed, I as resolveTelegramStreamMode, J as upsertChannelPairingRequest, L as resolveTelegramThreadSpec, M as resolveTelegramForumThreadId, N as resolveTelegramGroupAllowFromContext, O as expandTextLinks, P as resolveTelegramMediaPlaceholder, Q as isVoiceCompatibleAudio, R as isSenderAllowed$1, S as buildTelegramGroupFrom, T as buildTelegramThreadParams, U as mergeAllowFromSources, V as firstDefined$1, W as addChannelAllowFromStoreEntry, X as listPairingChannels, Y as getPairingAdapter, Z as withTelegramApiErrorLogging, _ as resolveTelegramFetch, a as reactMessageTelegram, b as buildSenderLabel, c as sendStickerTelegram, d as wasSentByBot, et as resolveTelegramTargetChatType, f as isRecoverableTelegramNetworkError, g as wrapFileReferencesInHtml, h as renderTelegramHtmlText, i as editMessageTelegram, j as normalizeForwardedContext, k as extractTelegramLocation, m as markdownToTelegramHtml, n as createForumTopicTelegram, nt as toLocationContext, o as sendMessageTelegram, p as markdownToTelegramChunks, q as removeChannelAllowFromStoreEntry, r as deleteMessageTelegram, s as sendPollTelegram, t as buildInlineKeyboard, tt as formatLocationText, u as resolveTelegramVoiceSend, v as splitTelegramCaption, w as buildTelegramParentPeer, x as buildSenderName, y as buildGroupLabel, z as normalizeAllowFromWithStore$1 } from "./send-CRsR8-vO.js";
|
|
35
|
+
import { _ as CLI_OUTPUT_MAX_BUFFER, a as resolveMediaAttachmentLocalRoots, c as loadModelCatalog, d as resolveAttachmentKind, f as registerUnhandledRejectionHandler, g as resolveMediaUnderstandingScope, h as normalizeMediaUnderstandingChatType, i as resolveAutoImageModel, l as modelSupportsVision, m as resolveTimeoutMs$1, n as createMediaAttachmentCache, o as runCapability, p as resolveConcurrency, r as normalizeMediaAttachments, s as findModelInCatalog, t as buildProviderRegistry, v as applyTemplate, y as buildRandomTempFilePath } from "./runner-CGBT7tgF.js";
|
|
36
|
+
import { a as resolveAckReaction, c as resolveHumanDelayConfig, i as resolveResponsePrefixTemplate, n as createReplyPrefixOptions, o as resolveAgentIdentity, s as resolveEffectiveMessagesConfig } from "./reply-prefix-uxfMZW4p.js";
|
|
37
|
+
import { a as isSilentReplyText, i as isSilentReplyPrefixText, n as SILENT_REPLY_TOKEN, r as SYMIPULSE_TOKEN, t as HEARTBEAT_TOKEN } from "./tokens-bC3UVmVH.js";
|
|
38
|
+
import { c as getSkillsSnapshotVersion, d as resolvePairingPaths, f as createAsyncLock, i as resolveSkillCommandInvocation, l as generatePairingToken, m as writeJsonAtomic, n as listSkillCommandsForAgents, o as getRemoteSkillEligibility, p as readJsonFile, r as listSkillCommandsForWorkspace, s as ensureSkillsWatcher, t as listReservedChatSlashCommandNames, u as pruneExpiredPending } from "./skill-commands-ff_01_r3.js";
|
|
39
|
+
import { c as assertSandboxPath, d as resolveSandboxedMediaSource, f as applySkillEnvOverrides, i as resolveSkillsPromptForRun, l as resolveSandboxInputPath, n as buildWorkspaceSkillSnapshot, p as applySkillEnvOverridesFromSnapshot, r as loadWorkspaceSkillEntries, s as assertMediaNotDataUrl } from "./skills-_yTP47Cd.js";
|
|
40
|
+
import { M as isSecureWebSocketUrl, N as rawDataToString, T as DEFAULT_AI_SNAPSHOT_MAX_CHARS, x as ensureChromeExtensionRelayServer } from "./chrome-B7RdxmJ0.js";
|
|
41
|
+
import { A as normalizeHyphenSlug, F as resolveChannelGroupRequireMention, I as resolveChannelGroupToolsPolicy, M as normalizeStringEntriesLower, P as resolveChannelGroupPolicy, a as normalizeReasoningLevel, c as normalizeVerboseLevel, d as getChannelDock, f as listChannelDocks, i as normalizeElevatedLevel, j as normalizeStringEntries, k as normalizeAtHashSlug, l as resolveResponseUsageMode, m as normalizeSignalMessagingTarget, n as formatXHighModelHint, o as normalizeThinkLevel, s as normalizeUsageDisplay, t as formatThinkingLevels, u as supportsXHighThinking } from "./thinking-CXqf7WTe.js";
|
|
42
|
+
import { r as resolveIMessageAccount } from "./accounts-s-AdhXVR.js";
|
|
43
|
+
import { i as resolveSignalAccount, t as listEnabledSignalAccounts } from "./accounts-BtaOa4z_.js";
|
|
44
|
+
import { C as getGlobalHookRunner, S as parseInlineDirectives$1, _ as normalizeChannelTargetInput, a as normalizeOutboundPayloadsForJson, b as MEDIA_TOKEN_RE, c as applyReplyThreading, d as isRenderablePayload, f as shouldSuppressMessagingToolReplies, g as buildTargetResolverSignature, h as throwIfAborted, i as normalizeOutboundPayloads, l as filterMessagingToolDuplicates, m as resolveReplyToMode, o as normalizeReplyPayloadsForDelivery, p as createReplyToModeFilterForChannel, r as formatOutboundPayloadLog, s as applyReplyTagsToPayload, t as deliverOutboundPayloads, u as filterMessagingToolMediaDuplicates, v as normalizeTargetForProvider, w as initializeGlobalHookRunner, x as splitMediaFromOutput, y as parseReplyDirectives } from "./deliver-BZ99UKQq.js";
|
|
45
|
+
import { $ as normalizeToolName, A as isTransientHttpError, At as countToolResults, B as resolveProfile, Bt as resolveChannelResetConfig, C as isContextOverflowError, Ct as deliveryContextKey, D as isRateLimitAssistantError, Dt as normalizeAccountId$3, E as isLikelyContextOverflowError, Et as normalizeSessionDeliveryFields, F as resolveSandboxContext, Ft as normalizeInputProvenance, G as resolveBrowserControlAuth, Gt as resolveFreshSessionTotalTokens, H as resolveExistingPathsWithinRoot, Ht as resolveSessionResetType, I as resolveSandboxRuntimeStatus, It as acquireSessionWriteLock, J as buildPluginToolGroups, Jt as resolveMainSessionKey, K as resolveSandboxConfigForAgent, Kt as canonicalizeMainSessionAlias, L as createBrowserRouteContext, Lt as resolveSessionLockMaxHoldFromTimeout, M as parseImageSizeError, Mt as INPUT_PROVENANCE_KIND_VALUES, N as sanitizeUserFacingText, Nt as applyInputProvenanceToUserMessage, O as isRawApiErrorPayload, Ot as archiveSessionTranscripts, P as ensureSandboxWorkspaceForSession, Pt as hasInterSessionUserProvenance, Q as mergeAlsoAllowPolicy, R as registerBrowserRoutes, Rt as resolveSessionKey, S as isCompactionFailureError, St as deliveryContextFromSession, T as isFailoverErrorMessage, Tt as normalizeDeliveryContext, U as getBridgeAuthForPort, Ut as resolveThreadFlag, V as DEFAULT_UPLOAD_DIR, Vt as resolveSessionResetPolicy, W as ensureBrowserControlAuth, Wt as DEFAULT_RESET_TRIGGERS, X as expandPolicyWithPluginGroups, Xt as resolveGroupSessionKey, Y as collectExplicitAllowlist, Yt as deriveSessionMetaPatch, Z as expandToolGroups, _ as formatRawAssistantErrorForUi, _t as updateLastRoute, a as isMessagingToolDuplicateNormalized, at as ensureSessionHeader, b as isBillingAssistantError, bt as isCacheEnabled, c as extractToolCallsFromAssistant, ct as sanitizeGoogleTurnOrdering, d as isAntigravityClaude, dt as appendAssistantMessageToSessionTranscript, et as resolveToolProfilePolicy, f as isGoogleModelApi, g as formatBillingErrorMessage, gt as recordSessionMetaFromInbound, h as formatAssistantErrorText, ht as readSessionUpdatedAt, it as buildBootstrapContextFiles, j as parseImageDimensionError, jt as extractToolCallNames, k as isTimeoutErrorMessage, kt as capArrayByJsonBytes, l as extractToolResultId, lt as extractDeliveryInfo, m as classifyFailoverReason, mt as loadSessionStore, n as validateGeminiTurns, nt as compileGlobPatterns, o as normalizeTextForComparison, ot as resolveBootstrapMaxChars, p as BILLING_ERROR_USER_MESSAGE, pt as resolveAndPersistSessionFile, q as applyOwnerOnlyToolPolicy, qt as resolveExplicitAgentSessionKey, r as pickFallbackThinkingLevel, rt as matchesAnyGlobPattern, s as sanitizeSessionMessagesImages, st as resolveBootstrapTotalMaxChars, t as validateAnthropicTurns, tt as stripPluginOnlyAllowlist, u as downgradeOpenAIReasoningBlocks, ut as parseSessionThreadInfo, v as getApiErrorPayloadFingerprint, vt as updateSessionStore, w as isFailoverAssistantError, wt as mergeDeliveryContext, x as isCloudCodeAssistFormatError, xt as resolveCacheTtlMs$1, y as isAuthAssistantError, yt as updateSessionStoreEntry, z as resolveBrowserConfig, zt as evaluateSessionFreshness } from "./pi-embedded-helpers-CW630epe.js";
|
|
46
46
|
import { n as resolveConversationLabel } from "./conversation-label-yNSj43Jt.js";
|
|
47
47
|
import { i as resolveSessionTranscriptPath, n as resolveSessionFilePath, o as resolveSessionTranscriptsDirForAgent, r as resolveSessionFilePathOptions, s as resolveStorePath, t as resolveDefaultSessionStorePath } from "./paths-A0xdf3yk.js";
|
|
48
48
|
import { t as emitSessionTranscriptUpdate } from "./transcript-events-x1D4Vniz.js";
|
|
49
|
-
import { a as logMessageProcessed, c as logWebhookError, d as startDiagnosticHeartbeat, f as stopDiagnosticHeartbeat, i as logLaneEnqueue, l as logWebhookProcessed, m as isDiagnosticsEnabled, o as logMessageQueued, p as emitDiagnosticEvent, r as logLaneDequeue, s as logSessionStateChange, t as diag, u as logWebhookReceived } from "./diagnostic-
|
|
50
|
-
import { i as saveMediaBuffer, r as getMediaDir } from "./store-
|
|
49
|
+
import { a as logMessageProcessed, c as logWebhookError, d as startDiagnosticHeartbeat, f as stopDiagnosticHeartbeat, i as logLaneEnqueue, l as logWebhookProcessed, m as isDiagnosticsEnabled, o as logMessageQueued, p as emitDiagnosticEvent, r as logLaneDequeue, s as logSessionStateChange, t as diag, u as logWebhookReceived } from "./diagnostic-05pm5Rxi.js";
|
|
50
|
+
import { i as saveMediaBuffer, r as getMediaDir } from "./store-BdrNabcU.js";
|
|
51
51
|
import { r as normalizeInboundTextNewlines, t as finalizeInboundContext } from "./inbound-context-D5EzMeL_.js";
|
|
52
|
-
import { S as minimaxUnderstandImage, _ as stripThinkingTagsFromText, a as decodeDataUrl, b as extractTextFromChatContent, c as extractAssistantThinking, d as formatReasoningMessage, f as inferToolMetaFromArgs, g as stripMinimaxToolCallXml, h as stripDowngradedToolCallText, i as coerceImageModelConfig, l as extractThinkingFromTaggedStream, m as promoteThinkingTagsToBlocks, o as resolveProviderVisionModelFromConfig, p as isAssistantMessage, r as coerceImageAssistantText, s as extractAssistantText$1, u as extractThinkingFromTaggedText, v as resolveToolDisplay, x as ensureSymiModelsJson, y as stripReasoningTagsFromText } from "./image-
|
|
52
|
+
import { S as minimaxUnderstandImage, _ as stripThinkingTagsFromText, a as decodeDataUrl, b as extractTextFromChatContent, c as extractAssistantThinking, d as formatReasoningMessage, f as inferToolMetaFromArgs, g as stripMinimaxToolCallXml, h as stripDowngradedToolCallText, i as coerceImageModelConfig, l as extractThinkingFromTaggedStream, m as promoteThinkingTagsToBlocks, o as resolveProviderVisionModelFromConfig, p as isAssistantMessage, r as coerceImageAssistantText, s as extractAssistantText$1, u as extractThinkingFromTaggedText, v as resolveToolDisplay, x as ensureSymiModelsJson, y as stripReasoningTagsFromText } from "./image-CLOPx7yW.js";
|
|
53
53
|
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-LbcEa65a.js";
|
|
54
|
-
import { d as listMemoryFiles, f as normalizeExtraMemoryPaths, v as runTasksWithConcurrency } from "./sqlite-
|
|
54
|
+
import { d as listMemoryFiles, f as normalizeExtraMemoryPaths, v as runTasksWithConcurrency } from "./sqlite-CxAR5ttJ.js";
|
|
55
55
|
import { r as getDiagnosticSessionState } from "./diagnostic-session-state-Wd5tNeQG.js";
|
|
56
|
-
import { i as resolveMemorySearchConfig, n as probeOllamaEmbeddingModels, r as resolveOllamaBaseUrl } from "./manager-
|
|
57
|
-
import { _ as resolveNativeCommandsEnabled, a as listChatCommandsForConfig, c as normalizeCommandBody, d as resolveCommandArgMenu, f as serializeCommandArgs, g as isRestartEnabled, h as isNativeCommandsExplicitlyDisabled, i as listChatCommands, l as parseCommandArgs, m as isCommandFlagEnabled, o as listNativeCommandSpecs, p as shouldHandleTextCommands, r as findCommandByNativeName, s as listNativeCommandSpecsForConfig, t as buildCommandTextFromArgs, u as resolveCommandArgChoices, v as resolveNativeSkillsEnabled } from "./commands-registry-
|
|
58
|
-
import { c as signalRpcRequest, l as streamSignalEvents, n as sendReadReceiptSignal, o as resolveSignalRpcContext, r as sendTypingSignal, s as signalCheck, t as sendMessageSignal } from "./send-
|
|
56
|
+
import { i as resolveMemorySearchConfig, n as probeOllamaEmbeddingModels, r as resolveOllamaBaseUrl } from "./manager-CBSBFuFz.js";
|
|
57
|
+
import { _ as resolveNativeCommandsEnabled, a as listChatCommandsForConfig, c as normalizeCommandBody, d as resolveCommandArgMenu, f as serializeCommandArgs, g as isRestartEnabled, h as isNativeCommandsExplicitlyDisabled, i as listChatCommands, l as parseCommandArgs, m as isCommandFlagEnabled, o as listNativeCommandSpecs, p as shouldHandleTextCommands, r as findCommandByNativeName, s as listNativeCommandSpecsForConfig, t as buildCommandTextFromArgs, u as resolveCommandArgChoices, v as resolveNativeSkillsEnabled } from "./commands-registry-COIaslGl.js";
|
|
58
|
+
import { c as signalRpcRequest, l as streamSignalEvents, n as sendReadReceiptSignal, o as resolveSignalRpcContext, r as sendTypingSignal, s as signalCheck, t as sendMessageSignal } from "./send-pYqe432l.js";
|
|
59
59
|
import { t as makeProxyFetch } from "./proxy-MquBDehr.js";
|
|
60
|
-
import { n as resolveAgentRoute, t as buildAgentSessionKey } from "./resolve-route-
|
|
61
|
-
import { a as createReplyReferencePlanner, i as resolveSlackThreadTs, n as deliverReplies$3, t as createSlackReplyDeliveryPlan } from "./replies-
|
|
62
|
-
import { t as getActiveWebListener } from "./active-listener-
|
|
60
|
+
import { n as resolveAgentRoute, t as buildAgentSessionKey } from "./resolve-route-B3CCBumQ.js";
|
|
61
|
+
import { a as createReplyReferencePlanner, i as resolveSlackThreadTs, n as deliverReplies$3, t as createSlackReplyDeliveryPlan } from "./replies-LLcQL3w6.js";
|
|
62
|
+
import { t as getActiveWebListener } from "./active-listener-BXYeALs0.js";
|
|
63
63
|
import { n as recordCommandPoll, r as resetCommandPollCount } from "./command-poll-backoff-CBq0jVRw.js";
|
|
64
64
|
import { createRequire } from "node:module";
|
|
65
65
|
import fs, { existsSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
66
66
|
import * as path$1 from "node:path";
|
|
67
67
|
import path from "node:path";
|
|
68
68
|
import os, { homedir } from "node:os";
|
|
69
|
-
import
|
|
69
|
+
import JSON5 from "json5";
|
|
70
70
|
import { ApplicationCommandOptionType, ButtonStyle, ChannelType, PermissionFlagsBits, Routes, StickerFormatType } from "discord-api-types/v10";
|
|
71
71
|
import { Button, ChannelSelectMenu, ChannelType as ChannelType$1, Client, Command, CommandWithSubcommands, Container, MentionableSelectMenu, MessageCreateListener, MessageReactionAddListener, MessageReactionRemoveListener, MessageType, Modal, PresenceUpdateListener, ReadyListener, RoleSelectMenu, Row, Separator, StringSelectMenu, TextDisplay, UserSelectMenu, serializePayload } from "@buape/carbon";
|
|
72
72
|
import crypto, { X509Certificate, createHash, createHmac, randomBytes, randomUUID } from "node:crypto";
|
|
@@ -7792,7 +7792,7 @@ async function createModelSelectionState(params) {
|
|
|
7792
7792
|
}
|
|
7793
7793
|
}
|
|
7794
7794
|
if (sessionEntry && sessionStore && sessionKey && sessionEntry.authProfileOverride) {
|
|
7795
|
-
const { ensureAuthProfileStore } = await import("./model-selection-
|
|
7795
|
+
const { ensureAuthProfileStore } = await import("./model-selection-CsbEfrS0.js").then((n) => n.O);
|
|
7796
7796
|
const profile = ensureAuthProfileStore(void 0, { allowKeychainPrompt: false }).profiles[sessionEntry.authProfileOverride];
|
|
7797
7797
|
const providerKey = normalizeProviderId(provider);
|
|
7798
7798
|
if (!profile || normalizeProviderId(profile.provider) !== providerKey) await clearSessionAuthProfileOverride({
|
|
@@ -11532,7 +11532,7 @@ function resolveMemoryBackendConfig(params) {
|
|
|
11532
11532
|
|
|
11533
11533
|
//#endregion
|
|
11534
11534
|
//#region src/memory/search-manager.ts
|
|
11535
|
-
const log$
|
|
11535
|
+
const log$10 = createSubsystemLogger("memory");
|
|
11536
11536
|
const QMD_MANAGER_CACHE = /* @__PURE__ */ new Map();
|
|
11537
11537
|
async function getMemorySearchManager(params) {
|
|
11538
11538
|
const resolved = resolveMemoryBackendConfig(params);
|
|
@@ -11544,7 +11544,7 @@ async function getMemorySearchManager(params) {
|
|
|
11544
11544
|
if (cached) return { manager: cached };
|
|
11545
11545
|
}
|
|
11546
11546
|
try {
|
|
11547
|
-
const { QmdMemoryManager } = await import("./qmd-manager-
|
|
11547
|
+
const { QmdMemoryManager } = await import("./qmd-manager-CH0XbIHf.js");
|
|
11548
11548
|
const primary = await QmdMemoryManager.create({
|
|
11549
11549
|
cfg: params.cfg,
|
|
11550
11550
|
agentId: params.agentId,
|
|
@@ -11556,7 +11556,7 @@ async function getMemorySearchManager(params) {
|
|
|
11556
11556
|
const wrapper = new FallbackMemoryManager({
|
|
11557
11557
|
primary,
|
|
11558
11558
|
fallbackFactory: async () => {
|
|
11559
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
11559
|
+
const { MemoryIndexManager } = await import("./manager-CBSBFuFz.js").then((n) => n.t);
|
|
11560
11560
|
return await MemoryIndexManager.get(params);
|
|
11561
11561
|
}
|
|
11562
11562
|
}, () => QMD_MANAGER_CACHE.delete(cacheKey));
|
|
@@ -11565,11 +11565,11 @@ async function getMemorySearchManager(params) {
|
|
|
11565
11565
|
}
|
|
11566
11566
|
} catch (err) {
|
|
11567
11567
|
const message = err instanceof Error ? err.message : String(err);
|
|
11568
|
-
log$
|
|
11568
|
+
log$10.warn(`qmd memory unavailable; falling back to builtin: ${message}`);
|
|
11569
11569
|
}
|
|
11570
11570
|
}
|
|
11571
11571
|
try {
|
|
11572
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
11572
|
+
const { MemoryIndexManager } = await import("./manager-CBSBFuFz.js").then((n) => n.t);
|
|
11573
11573
|
return { manager: await MemoryIndexManager.get(params) };
|
|
11574
11574
|
} catch (err) {
|
|
11575
11575
|
return {
|
|
@@ -11592,7 +11592,7 @@ var FallbackMemoryManager = class {
|
|
|
11592
11592
|
} catch (err) {
|
|
11593
11593
|
this.primaryFailed = true;
|
|
11594
11594
|
this.lastError = err instanceof Error ? err.message : String(err);
|
|
11595
|
-
log$
|
|
11595
|
+
log$10.warn(`qmd memory failed; switching to builtin index: ${this.lastError}`);
|
|
11596
11596
|
await this.deps.primary.close?.().catch(() => {});
|
|
11597
11597
|
this.evictCacheEntry();
|
|
11598
11598
|
}
|
|
@@ -11672,12 +11672,12 @@ var FallbackMemoryManager = class {
|
|
|
11672
11672
|
try {
|
|
11673
11673
|
fallback = await this.deps.fallbackFactory();
|
|
11674
11674
|
if (!fallback) {
|
|
11675
|
-
log$
|
|
11675
|
+
log$10.warn("memory fallback requested but builtin index is unavailable");
|
|
11676
11676
|
return null;
|
|
11677
11677
|
}
|
|
11678
11678
|
} catch (err) {
|
|
11679
11679
|
const message = err instanceof Error ? err.message : String(err);
|
|
11680
|
-
log$
|
|
11680
|
+
log$10.warn(`memory fallback unavailable: ${message}`);
|
|
11681
11681
|
return null;
|
|
11682
11682
|
}
|
|
11683
11683
|
this.fallback = fallback;
|
|
@@ -12628,7 +12628,7 @@ function normalizeSessionKey(value) {
|
|
|
12628
12628
|
function readSessionStore(storePath) {
|
|
12629
12629
|
try {
|
|
12630
12630
|
const raw = fs.readFileSync(storePath, "utf-8");
|
|
12631
|
-
const parsed =
|
|
12631
|
+
const parsed = JSON5.parse(raw);
|
|
12632
12632
|
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) return parsed;
|
|
12633
12633
|
} catch {}
|
|
12634
12634
|
return {};
|
|
@@ -15485,7 +15485,7 @@ async function routeReply(params) {
|
|
|
15485
15485
|
const resolvedReplyToId = replyToId ?? (channelId === "slack" && threadId != null && threadId !== "" ? String(threadId) : void 0);
|
|
15486
15486
|
const resolvedThreadId = channelId === "slack" ? null : threadId ?? null;
|
|
15487
15487
|
try {
|
|
15488
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
15488
|
+
const { deliverOutboundPayloads } = await import("./deliver-BZ99UKQq.js").then((n) => n.n);
|
|
15489
15489
|
return {
|
|
15490
15490
|
ok: true,
|
|
15491
15491
|
messageId: (await deliverOutboundPayloads({
|
|
@@ -17959,7 +17959,7 @@ async function describeStickerImage(params) {
|
|
|
17959
17959
|
logVerbose(`telegram: describing sticker with ${provider}/${model}`);
|
|
17960
17960
|
try {
|
|
17961
17961
|
const buffer = await fs$1.readFile(imagePath);
|
|
17962
|
-
const { describeImageWithModel } = await import("./image-
|
|
17962
|
+
const { describeImageWithModel } = await import("./image-CLOPx7yW.js").then((n) => n.n);
|
|
17963
17963
|
return (await describeImageWithModel({
|
|
17964
17964
|
buffer,
|
|
17965
17965
|
fileName: "sticker.webp",
|
|
@@ -18370,7 +18370,7 @@ function createWhatsAppLoginTool() {
|
|
|
18370
18370
|
force: Type.Optional(Type.Boolean())
|
|
18371
18371
|
}),
|
|
18372
18372
|
execute: async (_toolCallId, args) => {
|
|
18373
|
-
const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-
|
|
18373
|
+
const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-BjVZSoCi.js");
|
|
18374
18374
|
if ((args?.action ?? "start") === "wait") {
|
|
18375
18375
|
const result = await waitForWebLogin({ timeoutMs: typeof args.timeoutMs === "number" ? args.timeoutMs : void 0 });
|
|
18376
18376
|
return {
|
|
@@ -20438,7 +20438,7 @@ async function preflightDiscordMessage(params) {
|
|
|
20438
20438
|
let preflightTranscript;
|
|
20439
20439
|
const hasAudioAttachment = message.attachments?.some((att) => att.contentType?.startsWith("audio/"));
|
|
20440
20440
|
if (!isDirectMessage && shouldRequireMention && hasAudioAttachment && !baseText && mentionRegexes.length > 0) try {
|
|
20441
|
-
const { transcribeFirstAudio } = await import("./audio-preflight-
|
|
20441
|
+
const { transcribeFirstAudio } = await import("./audio-preflight-VpItkiy3.js");
|
|
20442
20442
|
const audioPaths = message.attachments?.filter((att) => att.contentType?.startsWith("audio/")).map((att) => att.url) ?? [];
|
|
20443
20443
|
if (audioPaths.length > 0) preflightTranscript = await transcribeFirstAudio({
|
|
20444
20444
|
ctx: {
|
|
@@ -25112,7 +25112,7 @@ function createRunRegistry(options) {
|
|
|
25112
25112
|
|
|
25113
25113
|
//#endregion
|
|
25114
25114
|
//#region src/process/supervisor/supervisor.ts
|
|
25115
|
-
const log$
|
|
25115
|
+
const log$9 = createSubsystemLogger("process/supervisor");
|
|
25116
25116
|
function clampTimeout(value) {
|
|
25117
25117
|
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return;
|
|
25118
25118
|
return Math.max(1, Math.floor(value));
|
|
@@ -25298,7 +25298,7 @@ function createProcessSupervisor() {
|
|
|
25298
25298
|
exitCode: null,
|
|
25299
25299
|
exitSignal: null
|
|
25300
25300
|
});
|
|
25301
|
-
log$
|
|
25301
|
+
log$9.warn(`spawn failed: runId=${runId} reason=${String(err)}`);
|
|
25302
25302
|
throw err;
|
|
25303
25303
|
}
|
|
25304
25304
|
};
|
|
@@ -26597,7 +26597,7 @@ function resolveRunWorkspaceDir(params) {
|
|
|
26597
26597
|
|
|
26598
26598
|
//#endregion
|
|
26599
26599
|
//#region src/agents/cli-runner.ts
|
|
26600
|
-
const log$
|
|
26600
|
+
const log$8 = createSubsystemLogger("agent/claude-cli");
|
|
26601
26601
|
async function runCliAgent(params) {
|
|
26602
26602
|
const started = Date.now();
|
|
26603
26603
|
const workspaceResolution = resolveRunWorkspaceDir({
|
|
@@ -26610,7 +26610,7 @@ async function runCliAgent(params) {
|
|
|
26610
26610
|
const redactedSessionId = redactRunIdentifier(params.sessionId);
|
|
26611
26611
|
const redactedSessionKey = redactRunIdentifier(params.sessionKey);
|
|
26612
26612
|
const redactedWorkspace = redactRunIdentifier(resolvedWorkspace);
|
|
26613
|
-
if (workspaceResolution.usedFallback) log$
|
|
26613
|
+
if (workspaceResolution.usedFallback) log$8.warn(`[workspace-fallback] caller=runCliAgent reason=${workspaceResolution.fallbackReason} run=${params.runId} session=${redactedSessionId} sessionKey=${redactedSessionKey} agent=${workspaceResolution.agentId} workspace=${redactedWorkspace}`);
|
|
26614
26614
|
const workspaceDir = resolvedWorkspace;
|
|
26615
26615
|
const backendResolved = resolveCliBackendConfig(params.provider, params.config);
|
|
26616
26616
|
if (!backendResolved) throw new Error(`Unknown CLI backend: ${params.provider}`);
|
|
@@ -26627,7 +26627,7 @@ async function runCliAgent(params) {
|
|
|
26627
26627
|
sessionId: params.sessionId,
|
|
26628
26628
|
warn: makeBootstrapWarn({
|
|
26629
26629
|
sessionLabel,
|
|
26630
|
-
warn: (message) => log$
|
|
26630
|
+
warn: (message) => log$8.warn(message)
|
|
26631
26631
|
})
|
|
26632
26632
|
});
|
|
26633
26633
|
const { defaultAgentId, sessionAgentId } = resolveSessionAgentIds({
|
|
@@ -26693,7 +26693,7 @@ async function runCliAgent(params) {
|
|
|
26693
26693
|
const queueKey = backend.serialize ?? true ? backendResolved.id : `${backendResolved.id}:${params.runId}`;
|
|
26694
26694
|
try {
|
|
26695
26695
|
const output = await enqueueCliRun(queueKey, async () => {
|
|
26696
|
-
log$
|
|
26696
|
+
log$8.info(`cli exec: provider=${params.provider} model=${normalizedModel} promptChars=${params.prompt.length}`);
|
|
26697
26697
|
const logOutputText = isTruthyEnvValue(process.env.SYMI_CLAUDE_CLI_LOG_OUTPUT);
|
|
26698
26698
|
if (logOutputText) {
|
|
26699
26699
|
const logArgs = [];
|
|
@@ -26726,7 +26726,7 @@ async function runCliAgent(params) {
|
|
|
26726
26726
|
const promptIndex = logArgs.indexOf(argsPrompt);
|
|
26727
26727
|
if (promptIndex >= 0) logArgs[promptIndex] = `<prompt:${argsPrompt.length} chars>`;
|
|
26728
26728
|
}
|
|
26729
|
-
log$
|
|
26729
|
+
log$8.info(`cli argv: ${backend.command} ${logArgs.join(" ")}`);
|
|
26730
26730
|
}
|
|
26731
26731
|
const env = (() => {
|
|
26732
26732
|
const next = {
|
|
@@ -26764,17 +26764,17 @@ async function runCliAgent(params) {
|
|
|
26764
26764
|
const stdout = result.stdout.trim();
|
|
26765
26765
|
const stderr = result.stderr.trim();
|
|
26766
26766
|
if (logOutputText) {
|
|
26767
|
-
if (stdout) log$
|
|
26768
|
-
if (stderr) log$
|
|
26767
|
+
if (stdout) log$8.info(`cli stdout:\n${stdout}`);
|
|
26768
|
+
if (stderr) log$8.info(`cli stderr:\n${stderr}`);
|
|
26769
26769
|
}
|
|
26770
26770
|
if (shouldLogVerbose()) {
|
|
26771
|
-
if (stdout) log$
|
|
26772
|
-
if (stderr) log$
|
|
26771
|
+
if (stdout) log$8.debug(`cli stdout:\n${stdout}`);
|
|
26772
|
+
if (stderr) log$8.debug(`cli stderr:\n${stderr}`);
|
|
26773
26773
|
}
|
|
26774
26774
|
if (result.exitCode !== 0 || result.reason !== "exit") {
|
|
26775
26775
|
if (result.reason === "no-output-timeout" || result.noOutputTimedOut) {
|
|
26776
26776
|
const timeoutReason = `CLI produced no output for ${Math.round(noOutputTimeoutMs / 1e3)}s and was terminated.`;
|
|
26777
|
-
log$
|
|
26777
|
+
log$8.warn(`cli watchdog timeout: provider=${params.provider} model=${modelId} session=${cliSessionIdToSend ?? params.sessionId} noOutputTimeoutMs=${noOutputTimeoutMs} pid=${managedRun.pid ?? "unknown"}`);
|
|
26778
26778
|
throw new FailoverError(timeoutReason, {
|
|
26779
26779
|
reason: "timeout",
|
|
26780
26780
|
provider: params.provider,
|
|
@@ -27404,7 +27404,7 @@ function resolveEmbeddedSessionLane(key) {
|
|
|
27404
27404
|
|
|
27405
27405
|
//#endregion
|
|
27406
27406
|
//#region src/agents/pi-embedded-runner/logger.ts
|
|
27407
|
-
const log$
|
|
27407
|
+
const log$7 = createSubsystemLogger("agent/embedded");
|
|
27408
27408
|
|
|
27409
27409
|
//#endregion
|
|
27410
27410
|
//#region src/utils/safe-json.ts
|
|
@@ -27450,7 +27450,7 @@ function getQueuedFileWriter(writers, filePath) {
|
|
|
27450
27450
|
//#endregion
|
|
27451
27451
|
//#region src/agents/anthropic-payload-log.ts
|
|
27452
27452
|
const writers$1 = /* @__PURE__ */ new Map();
|
|
27453
|
-
const log$
|
|
27453
|
+
const log$6 = createSubsystemLogger("agent/anthropic-payload");
|
|
27454
27454
|
function resolvePayloadLogConfig(env) {
|
|
27455
27455
|
const enabled = parseBooleanValue$1(env.SYMI_ANTHROPIC_PAYLOAD_LOG) ?? false;
|
|
27456
27456
|
const fileOverride = env.SYMI_ANTHROPIC_PAYLOAD_LOG_FILE?.trim();
|
|
@@ -27540,13 +27540,13 @@ function createAnthropicPayloadLogger(params) {
|
|
|
27540
27540
|
usage,
|
|
27541
27541
|
error: errorMessage
|
|
27542
27542
|
});
|
|
27543
|
-
log$
|
|
27543
|
+
log$6.info("anthropic usage", {
|
|
27544
27544
|
runId: params.runId,
|
|
27545
27545
|
sessionId: params.sessionId,
|
|
27546
27546
|
usage
|
|
27547
27547
|
});
|
|
27548
27548
|
};
|
|
27549
|
-
log$
|
|
27549
|
+
log$6.info("anthropic payload logger enabled", { filePath: writer.filePath });
|
|
27550
27550
|
return {
|
|
27551
27551
|
enabled: true,
|
|
27552
27552
|
wrapStreamFn,
|
|
@@ -29428,7 +29428,7 @@ function createEmbeddedPiSessionEventHandler(ctx) {
|
|
|
29428
29428
|
//#region src/agents/pi-embedded-subscribe.ts
|
|
29429
29429
|
const THINKING_TAG_SCAN_RE = /<\s*(\/?)\s*(?:think(?:ing)?|thought|antthinking)\s*>/gi;
|
|
29430
29430
|
const FINAL_TAG_SCAN_RE = /<\s*(\/?)\s*final\s*>/gi;
|
|
29431
|
-
const log$
|
|
29431
|
+
const log$5 = createSubsystemLogger("agent/embedded");
|
|
29432
29432
|
function subscribeEmbeddedPiSession(params) {
|
|
29433
29433
|
const reasoningMode = params.reasoningMode ?? "off";
|
|
29434
29434
|
const useMarkdown = (params.toolResultFormat ?? "markdown") === "markdown";
|
|
@@ -29585,7 +29585,7 @@ function subscribeEmbeddedPiSession(params) {
|
|
|
29585
29585
|
state.compactionRetryReject = reject;
|
|
29586
29586
|
});
|
|
29587
29587
|
state.compactionRetryPromise.catch((err) => {
|
|
29588
|
-
log$
|
|
29588
|
+
log$5.debug(`compaction promise rejected (no waiter): ${String(err)}`);
|
|
29589
29589
|
});
|
|
29590
29590
|
}
|
|
29591
29591
|
};
|
|
@@ -29737,7 +29737,7 @@ function subscribeEmbeddedPiSession(params) {
|
|
|
29737
29737
|
if (!chunk) return;
|
|
29738
29738
|
if (chunk === state.lastBlockReplyText) return;
|
|
29739
29739
|
if (isMessagingToolDuplicateNormalized(normalizeTextForComparison(chunk), messagingToolSentTextsNormalized)) {
|
|
29740
|
-
log$
|
|
29740
|
+
log$5.debug(`Skipping block reply - already sent via messaging tool: ${chunk.slice(0, 50)}...`);
|
|
29741
29741
|
return;
|
|
29742
29742
|
}
|
|
29743
29743
|
if (shouldSkipAssistantText(chunk)) return;
|
|
@@ -29815,7 +29815,7 @@ function subscribeEmbeddedPiSession(params) {
|
|
|
29815
29815
|
const ctx = {
|
|
29816
29816
|
params,
|
|
29817
29817
|
state,
|
|
29818
|
-
log: log$
|
|
29818
|
+
log: log$5,
|
|
29819
29819
|
blockChunking,
|
|
29820
29820
|
blockChunker,
|
|
29821
29821
|
hookRunner: params.hookRunner,
|
|
@@ -29848,7 +29848,7 @@ function subscribeEmbeddedPiSession(params) {
|
|
|
29848
29848
|
if (state.unsubscribed) return;
|
|
29849
29849
|
state.unsubscribed = true;
|
|
29850
29850
|
if (state.compactionRetryPromise) {
|
|
29851
|
-
log$
|
|
29851
|
+
log$5.debug(`unsubscribe: rejecting compaction wait runId=${params.runId}`);
|
|
29852
29852
|
const reject = state.compactionRetryReject;
|
|
29853
29853
|
state.compactionRetryResolve = void 0;
|
|
29854
29854
|
state.compactionRetryReject = void 0;
|
|
@@ -29858,11 +29858,11 @@ function subscribeEmbeddedPiSession(params) {
|
|
|
29858
29858
|
reject?.(abortErr);
|
|
29859
29859
|
}
|
|
29860
29860
|
if (params.session.isCompacting) {
|
|
29861
|
-
log$
|
|
29861
|
+
log$5.debug(`unsubscribe: aborting in-flight compaction runId=${params.runId}`);
|
|
29862
29862
|
try {
|
|
29863
29863
|
params.session.abortCompaction();
|
|
29864
29864
|
} catch (err) {
|
|
29865
|
-
log$
|
|
29865
|
+
log$5.warn(`unsubscribe: compaction abort failed runId=${params.runId} err=${String(err)}`);
|
|
29866
29866
|
}
|
|
29867
29867
|
}
|
|
29868
29868
|
sessionUnsubscribe();
|
|
@@ -29911,7 +29911,7 @@ function subscribeEmbeddedPiSession(params) {
|
|
|
29911
29911
|
|
|
29912
29912
|
//#endregion
|
|
29913
29913
|
//#region src/agents/pi-tools.before-tool-call.ts
|
|
29914
|
-
const log$
|
|
29914
|
+
const log$4 = createSubsystemLogger("agents/tools");
|
|
29915
29915
|
const BEFORE_TOOL_CALL_WRAPPED = Symbol("beforeToolCallWrapped");
|
|
29916
29916
|
const adjustedParamsByToolCallId = /* @__PURE__ */ new Map();
|
|
29917
29917
|
const MAX_TRACKED_ADJUSTED_PARAMS = 1024;
|
|
@@ -29932,7 +29932,7 @@ async function recordLoopOutcome(args) {
|
|
|
29932
29932
|
if (!args.ctx?.sessionKey) return;
|
|
29933
29933
|
try {
|
|
29934
29934
|
const { getDiagnosticSessionState } = await import("./diagnostic-session-state-Wd5tNeQG.js").then((n) => n.n);
|
|
29935
|
-
const { recordToolCallOutcome } = await import("./tool-loop-detection-
|
|
29935
|
+
const { recordToolCallOutcome } = await import("./tool-loop-detection-at_K42K7.js");
|
|
29936
29936
|
recordToolCallOutcome(getDiagnosticSessionState({
|
|
29937
29937
|
sessionKey: args.ctx.sessionKey,
|
|
29938
29938
|
sessionId: args.ctx?.agentId
|
|
@@ -29945,7 +29945,7 @@ async function recordLoopOutcome(args) {
|
|
|
29945
29945
|
config: args.ctx.loopDetection
|
|
29946
29946
|
});
|
|
29947
29947
|
} catch (err) {
|
|
29948
|
-
log$
|
|
29948
|
+
log$4.warn(`tool loop outcome tracking failed: tool=${args.toolName} error=${String(err)}`);
|
|
29949
29949
|
}
|
|
29950
29950
|
}
|
|
29951
29951
|
async function runBeforeToolCallHook(args) {
|
|
@@ -29953,8 +29953,8 @@ async function runBeforeToolCallHook(args) {
|
|
|
29953
29953
|
const params = args.params;
|
|
29954
29954
|
if (args.ctx?.sessionKey) {
|
|
29955
29955
|
const { getDiagnosticSessionState } = await import("./diagnostic-session-state-Wd5tNeQG.js").then((n) => n.n);
|
|
29956
|
-
const { logToolLoopAction } = await import("./diagnostic-
|
|
29957
|
-
const { detectToolCallLoop, recordToolCall } = await import("./tool-loop-detection-
|
|
29956
|
+
const { logToolLoopAction } = await import("./diagnostic-05pm5Rxi.js").then((n) => n.n);
|
|
29957
|
+
const { detectToolCallLoop, recordToolCall } = await import("./tool-loop-detection-at_K42K7.js");
|
|
29958
29958
|
const sessionState = getDiagnosticSessionState({
|
|
29959
29959
|
sessionKey: args.ctx.sessionKey,
|
|
29960
29960
|
sessionId: args.ctx?.agentId
|
|
@@ -29962,7 +29962,7 @@ async function runBeforeToolCallHook(args) {
|
|
|
29962
29962
|
const loopResult = detectToolCallLoop(sessionState, toolName, params, args.ctx.loopDetection);
|
|
29963
29963
|
if (loopResult.stuck) {
|
|
29964
29964
|
if (loopResult.level === "critical") {
|
|
29965
|
-
log$
|
|
29965
|
+
log$4.error(`Blocking ${toolName} due to critical loop: ${loopResult.message}`);
|
|
29966
29966
|
logToolLoopAction({
|
|
29967
29967
|
sessionKey: args.ctx.sessionKey,
|
|
29968
29968
|
sessionId: args.ctx?.agentId,
|
|
@@ -29979,7 +29979,7 @@ async function runBeforeToolCallHook(args) {
|
|
|
29979
29979
|
reason: loopResult.message
|
|
29980
29980
|
};
|
|
29981
29981
|
} else if (shouldEmitLoopWarning(sessionState, loopResult.warningKey ?? `${loopResult.detector}:${toolName}`, loopResult.count)) {
|
|
29982
|
-
log$
|
|
29982
|
+
log$4.warn(`Loop warning for ${toolName}: ${loopResult.message}`);
|
|
29983
29983
|
logToolLoopAction({
|
|
29984
29984
|
sessionKey: args.ctx.sessionKey,
|
|
29985
29985
|
sessionId: args.ctx?.agentId,
|
|
@@ -30029,7 +30029,7 @@ async function runBeforeToolCallHook(args) {
|
|
|
30029
30029
|
}
|
|
30030
30030
|
} catch (err) {
|
|
30031
30031
|
const toolCallId = args.toolCallId ? ` toolCallId=${args.toolCallId}` : "";
|
|
30032
|
-
log$
|
|
30032
|
+
log$4.warn(`before_tool_call hook failed: tool=${toolName}${toolCallId} error=${String(err)}`);
|
|
30033
30033
|
}
|
|
30034
30034
|
return {
|
|
30035
30035
|
blocked: false,
|
|
@@ -30273,6 +30273,7 @@ function validateShellCommand(command) {
|
|
|
30273
30273
|
|
|
30274
30274
|
//#endregion
|
|
30275
30275
|
//#region src/agents/pi-tools.validate-wrapper.ts
|
|
30276
|
+
const log$3 = createSubsystemLogger("agents/tool-validate");
|
|
30276
30277
|
const EXEC_TOOL_NAMES = new Set(["exec", "bash"]);
|
|
30277
30278
|
const FILE_TOOL_NAMES = new Set([
|
|
30278
30279
|
"write",
|
|
@@ -30297,8 +30298,14 @@ const FILE_PATH_KEYS = [
|
|
|
30297
30298
|
* Call this AFTER tools are created and the model profile is resolved.
|
|
30298
30299
|
*/
|
|
30299
30300
|
function wrapToolsWithArgValidation(tools, profile) {
|
|
30300
|
-
if (!profile.filters?.validateToolArgs)
|
|
30301
|
-
|
|
30301
|
+
if (!profile.filters?.validateToolArgs) {
|
|
30302
|
+
log$3.debug(`[validate] skipped — validateToolArgs=${profile.filters?.validateToolArgs ?? "undefined"} profile=${profile.label}`);
|
|
30303
|
+
return tools;
|
|
30304
|
+
}
|
|
30305
|
+
const wrapped = tools.map((tool) => wrapToolWithArgValidation(tool));
|
|
30306
|
+
const wrappedNames = wrapped.filter((t, i) => t !== tools[i]).map((t) => t.name);
|
|
30307
|
+
log$3.debug(`[validate] applied to ${wrappedNames.length} tools: ${wrappedNames.join(",") || "(none matched)"}`);
|
|
30308
|
+
return wrapped;
|
|
30302
30309
|
}
|
|
30303
30310
|
/**
|
|
30304
30311
|
* Clean a file path by stripping control token fragments.
|
|
@@ -30331,13 +30338,22 @@ function wrapToolWithArgValidation(tool) {
|
|
|
30331
30338
|
execute(toolCallId, params, ...rest) {
|
|
30332
30339
|
if (isExecTool) {
|
|
30333
30340
|
const command = params.command ?? params.cmd;
|
|
30334
|
-
if (typeof command !== "string")
|
|
30341
|
+
if (typeof command !== "string") {
|
|
30342
|
+
log$3.debug(`[validate] exec called without string command: keys=${Object.keys(params).join(",")}`);
|
|
30343
|
+
return originalExecute.call(tool, toolCallId, params, ...rest);
|
|
30344
|
+
}
|
|
30335
30345
|
const result = validateShellCommand(command);
|
|
30336
|
-
if (!result.valid)
|
|
30337
|
-
|
|
30338
|
-
|
|
30339
|
-
|
|
30340
|
-
|
|
30346
|
+
if (!result.valid) {
|
|
30347
|
+
log$3.warn(`[validate] exec command rejected: reason=${result.reason} raw=${command.slice(0, 100)}`);
|
|
30348
|
+
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.` });
|
|
30349
|
+
}
|
|
30350
|
+
if (result.cleaned !== command) {
|
|
30351
|
+
log$3.debug(`[validate] exec command cleaned: raw=${command.slice(0, 80)} → cleaned=${result.cleaned.slice(0, 80)}`);
|
|
30352
|
+
return originalExecute.call(tool, toolCallId, {
|
|
30353
|
+
...params,
|
|
30354
|
+
command: result.cleaned
|
|
30355
|
+
}, ...rest);
|
|
30356
|
+
}
|
|
30341
30357
|
return originalExecute.call(tool, toolCallId, params, ...rest);
|
|
30342
30358
|
}
|
|
30343
30359
|
const pathKey = FILE_PATH_KEYS.find((k) => typeof params[k] === "string");
|
|
@@ -30708,7 +30724,7 @@ async function truncateOversizedToolResultsInSession(params) {
|
|
|
30708
30724
|
const textLength = getToolResultTextLength(msg);
|
|
30709
30725
|
if (textLength > maxChars) {
|
|
30710
30726
|
oversizedIndices.push(i);
|
|
30711
|
-
log$
|
|
30727
|
+
log$7.info(`[tool-result-truncation] Found oversized tool result: entry=${entry.id} chars=${textLength} maxChars=${maxChars} sessionKey=${params.sessionKey ?? params.sessionId ?? "unknown"}`);
|
|
30712
30728
|
}
|
|
30713
30729
|
}
|
|
30714
30730
|
if (oversizedIndices.length === 0) return {
|
|
@@ -30730,7 +30746,7 @@ async function truncateOversizedToolResultsInSession(params) {
|
|
|
30730
30746
|
message = truncateToolResultMessage(message, maxChars);
|
|
30731
30747
|
truncatedCount++;
|
|
30732
30748
|
const newLength = getToolResultTextLength(message);
|
|
30733
|
-
log$
|
|
30749
|
+
log$7.info(`[tool-result-truncation] Truncated tool result: originalEntry=${entry.id} newChars=${newLength} sessionKey=${params.sessionKey ?? params.sessionId ?? "unknown"}`);
|
|
30734
30750
|
}
|
|
30735
30751
|
sessionManager.appendMessage(message);
|
|
30736
30752
|
} else if (entry.type === "compaction") sessionManager.appendCompaction(entry.summary, entry.firstKeptEntryId, entry.tokensBefore, entry.details, entry.fromHook);
|
|
@@ -30744,14 +30760,14 @@ async function truncateOversizedToolResultsInSession(params) {
|
|
|
30744
30760
|
if (entry.name) sessionManager.appendSessionInfo(entry.name);
|
|
30745
30761
|
}
|
|
30746
30762
|
}
|
|
30747
|
-
log$
|
|
30763
|
+
log$7.info(`[tool-result-truncation] Truncated ${truncatedCount} tool result(s) in session (contextWindow=${contextWindowTokens} maxChars=${maxChars}) sessionKey=${params.sessionKey ?? params.sessionId ?? "unknown"}`);
|
|
30748
30764
|
return {
|
|
30749
30765
|
truncated: true,
|
|
30750
30766
|
truncatedCount
|
|
30751
30767
|
};
|
|
30752
30768
|
} catch (err) {
|
|
30753
30769
|
const errMsg = err instanceof Error ? err.message : String(err);
|
|
30754
|
-
log$
|
|
30770
|
+
log$7.warn(`[tool-result-truncation] Failed to truncate: ${errMsg}`);
|
|
30755
30771
|
return {
|
|
30756
30772
|
truncated: false,
|
|
30757
30773
|
truncatedCount: 0,
|
|
@@ -32527,7 +32543,7 @@ function resolveAnthropicBetas(extraParams, provider, modelId) {
|
|
|
32527
32543
|
for (const beta of configured) if (typeof beta === "string" && beta.trim()) betas.add(beta.trim());
|
|
32528
32544
|
}
|
|
32529
32545
|
if (extraParams?.context1m === true) if (isAnthropic1MModel(modelId)) betas.add(ANTHROPIC_CONTEXT_1M_BETA);
|
|
32530
|
-
else log$
|
|
32546
|
+
else log$7.warn(`ignoring context1m for non-opus/sonnet model: ${provider}/${modelId}`);
|
|
32531
32547
|
return betas.size > 0 ? [...betas] : void 0;
|
|
32532
32548
|
}
|
|
32533
32549
|
function mergeAnthropicBetaHeader(headers, betas) {
|
|
@@ -33138,14 +33154,14 @@ function logToolSchemasForGoogle(params) {
|
|
|
33138
33154
|
if (params.provider !== "google-antigravity" && params.provider !== "google-gemini-cli") return;
|
|
33139
33155
|
const toolNames = params.tools.map((tool, index) => `${index}:${tool.name}`);
|
|
33140
33156
|
const tools = sanitizeToolsForGoogle(params);
|
|
33141
|
-
log$
|
|
33157
|
+
log$7.info("google tool schema snapshot", {
|
|
33142
33158
|
provider: params.provider,
|
|
33143
33159
|
toolCount: tools.length,
|
|
33144
33160
|
tools: toolNames
|
|
33145
33161
|
});
|
|
33146
33162
|
for (const [index, tool] of tools.entries()) {
|
|
33147
33163
|
const violations = findUnsupportedSchemaKeywords(tool.parameters, `${tool.name}.parameters`);
|
|
33148
|
-
if (violations.length > 0) log$
|
|
33164
|
+
if (violations.length > 0) log$7.warn("google tool schema has unsupported keywords", {
|
|
33149
33165
|
index,
|
|
33150
33166
|
tool: tool.name,
|
|
33151
33167
|
violations: violations.slice(0, 12),
|
|
@@ -33157,7 +33173,7 @@ const compactionFailureEmitter = new EventEmitter();
|
|
|
33157
33173
|
registerUnhandledRejectionHandler((reason) => {
|
|
33158
33174
|
const message = describeUnknownError(reason);
|
|
33159
33175
|
if (!isCompactionFailureError(message)) return false;
|
|
33160
|
-
log$
|
|
33176
|
+
log$7.error(`Auto-compaction failed (unhandled): ${message}`);
|
|
33161
33177
|
compactionFailureEmitter.emit("failure", message);
|
|
33162
33178
|
return true;
|
|
33163
33179
|
});
|
|
@@ -33209,7 +33225,7 @@ function applyGoogleTurnOrderingFix(params) {
|
|
|
33209
33225
|
const sanitized = sanitizeGoogleTurnOrdering(params.messages);
|
|
33210
33226
|
const didPrepend = sanitized !== params.messages;
|
|
33211
33227
|
if (didPrepend && !hasGoogleTurnOrderingMarker(params.sessionManager)) {
|
|
33212
|
-
(params.warn ?? ((message) => log$
|
|
33228
|
+
(params.warn ?? ((message) => log$7.warn(message)))(`google turn ordering fixup: prepended user bootstrap (sessionId=${params.sessionId})`);
|
|
33213
33229
|
markGoogleTurnOrderingMarker(params.sessionManager);
|
|
33214
33230
|
}
|
|
33215
33231
|
return {
|
|
@@ -33829,7 +33845,7 @@ function isImageExtension(filePath) {
|
|
|
33829
33845
|
}
|
|
33830
33846
|
async function sanitizeImagesWithLog(images, label, imageSanitization) {
|
|
33831
33847
|
const { images: sanitized, dropped } = await sanitizeImageBlocks(images, label, imageSanitization);
|
|
33832
|
-
if (dropped > 0) log$
|
|
33848
|
+
if (dropped > 0) log$7.warn(`Native image: dropped ${dropped} image(s) after sanitization (${label}).`);
|
|
33833
33849
|
return sanitized;
|
|
33834
33850
|
}
|
|
33835
33851
|
/**
|
|
@@ -33904,7 +33920,7 @@ async function loadImageFromRef(ref, workspaceDir, options) {
|
|
|
33904
33920
|
try {
|
|
33905
33921
|
let targetPath = ref.resolved;
|
|
33906
33922
|
if (ref.type === "url") {
|
|
33907
|
-
log$
|
|
33923
|
+
log$7.debug(`Native image: rejecting remote URL (local-only): ${ref.resolved}`);
|
|
33908
33924
|
return null;
|
|
33909
33925
|
}
|
|
33910
33926
|
if (ref.type === "path") {
|
|
@@ -33914,7 +33930,7 @@ async function loadImageFromRef(ref, workspaceDir, options) {
|
|
|
33914
33930
|
cwd: options.sandbox.root
|
|
33915
33931
|
}).hostPath;
|
|
33916
33932
|
} catch (err) {
|
|
33917
|
-
log$
|
|
33933
|
+
log$7.debug(`Native image: sandbox validation failed for ${ref.resolved}: ${err instanceof Error ? err.message : String(err)}`);
|
|
33918
33934
|
return null;
|
|
33919
33935
|
}
|
|
33920
33936
|
else if (!path.isAbsolute(targetPath)) targetPath = path.resolve(workspaceDir, targetPath);
|
|
@@ -33928,7 +33944,7 @@ async function loadImageFromRef(ref, workspaceDir, options) {
|
|
|
33928
33944
|
})
|
|
33929
33945
|
}) : await loadWebMedia(targetPath, options?.maxBytes);
|
|
33930
33946
|
if (media.kind !== "image") {
|
|
33931
|
-
log$
|
|
33947
|
+
log$7.debug(`Native image: not an image file: ${targetPath} (got ${media.kind})`);
|
|
33932
33948
|
return null;
|
|
33933
33949
|
}
|
|
33934
33950
|
const mimeType = media.contentType ?? "image/jpeg";
|
|
@@ -33938,7 +33954,7 @@ async function loadImageFromRef(ref, workspaceDir, options) {
|
|
|
33938
33954
|
mimeType
|
|
33939
33955
|
};
|
|
33940
33956
|
} catch (err) {
|
|
33941
|
-
log$
|
|
33957
|
+
log$7.debug(`Native image: failed to load ${ref.resolved}: ${err instanceof Error ? err.message : String(err)}`);
|
|
33942
33958
|
return null;
|
|
33943
33959
|
}
|
|
33944
33960
|
}
|
|
@@ -34037,7 +34053,7 @@ async function detectAndLoadPromptImages(params) {
|
|
|
34037
34053
|
loadedCount: 0,
|
|
34038
34054
|
skippedCount: 0
|
|
34039
34055
|
};
|
|
34040
|
-
log$
|
|
34056
|
+
log$7.debug(`Native image: detected ${allRefs.length} image refs (${promptRefs.length} in prompt, ${uniqueHistoryRefs.length} in history)`);
|
|
34041
34057
|
const promptImages = [...params.existingImages ?? []];
|
|
34042
34058
|
const historyImagesByIndex = /* @__PURE__ */ new Map();
|
|
34043
34059
|
let loadedCount = 0;
|
|
@@ -34054,7 +34070,7 @@ async function detectAndLoadPromptImages(params) {
|
|
|
34054
34070
|
else historyImagesByIndex.set(ref.messageIndex, [image]);
|
|
34055
34071
|
} else promptImages.push(image);
|
|
34056
34072
|
loadedCount++;
|
|
34057
|
-
log$
|
|
34073
|
+
log$7.debug(`Native image: loaded ${ref.type} ${ref.resolved}`);
|
|
34058
34074
|
} else skippedCount++;
|
|
34059
34075
|
}
|
|
34060
34076
|
const imageSanitization = { maxDimensionPx: params.maxDimensionPx };
|
|
@@ -34150,7 +34166,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
34150
34166
|
const resolvedWorkspace = resolveUserPath(params.workspaceDir);
|
|
34151
34167
|
const prevCwd = process.cwd();
|
|
34152
34168
|
const runAbortController = new AbortController();
|
|
34153
|
-
log$
|
|
34169
|
+
log$7.debug(`embedded run start: runId=${params.runId} sessionId=${params.sessionId} provider=${params.provider} model=${params.modelId} thinking=${params.thinkLevel} messageChannel=${params.messageChannel ?? params.messageProvider ?? "unknown"}`);
|
|
34154
34170
|
await fs$1.mkdir(resolvedWorkspace, { recursive: true });
|
|
34155
34171
|
const sandboxSessionKey = params.sessionKey?.trim() || params.sessionId;
|
|
34156
34172
|
const sandbox = await resolveSandboxContext({
|
|
@@ -34186,7 +34202,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
34186
34202
|
sessionId: params.sessionId,
|
|
34187
34203
|
warn: makeBootstrapWarn({
|
|
34188
34204
|
sessionLabel,
|
|
34189
|
-
warn: (message) => log$
|
|
34205
|
+
warn: (message) => log$7.warn(message)
|
|
34190
34206
|
})
|
|
34191
34207
|
});
|
|
34192
34208
|
const workspaceNotes = hookAdjustedBootstrapFiles.some((file) => file.name === DEFAULT_BOOTSTRAP_FILENAME && !file.missing) ? ["Reminder: commit your changes in this workspace after edits."] : void 0;
|
|
@@ -34373,7 +34389,9 @@ async function runEmbeddedAttempt(params) {
|
|
|
34373
34389
|
skillsPrompt,
|
|
34374
34390
|
tools
|
|
34375
34391
|
});
|
|
34376
|
-
const
|
|
34392
|
+
const profileModelKey = params.modelId ?? "";
|
|
34393
|
+
const modelProfile = resolveModelProfile(profileModelKey, params.config?.models?.profiles);
|
|
34394
|
+
log$7.debug(`[profile] resolved: modelId=${profileModelKey} → profile=${modelProfile.label} validateToolArgs=${modelProfile.filters?.validateToolArgs ?? false}`);
|
|
34377
34395
|
const systemPromptText = createSystemPromptOverride(appendPrompt + (modelProfile.promptAdditions.length > 0 ? "\n\n" + modelProfile.promptAdditions.join("\n") : ""))();
|
|
34378
34396
|
const sessionLock = await acquireSessionWriteLock({
|
|
34379
34397
|
sessionFile: params.sessionFile,
|
|
@@ -34385,7 +34403,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
34385
34403
|
try {
|
|
34386
34404
|
await repairSessionFileIfNeeded({
|
|
34387
34405
|
sessionFile: params.sessionFile,
|
|
34388
|
-
warn: (message) => log$
|
|
34406
|
+
warn: (message) => log$7.warn(message)
|
|
34389
34407
|
});
|
|
34390
34408
|
const hadSessionFile = await fs$1.stat(params.sessionFile).then(() => true).catch(() => false);
|
|
34391
34409
|
const transcriptPolicy = resolveTranscriptPolicy({
|
|
@@ -34394,7 +34412,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
34394
34412
|
modelId: params.modelId
|
|
34395
34413
|
});
|
|
34396
34414
|
const versionCheck = await handleSessionVersion(params.sessionFile);
|
|
34397
|
-
if (versionCheck.archived) log$
|
|
34415
|
+
if (versionCheck.archived) log$7.warn(`session archived: created by ${versionCheck.poisonVersion}, known corruption range → ${versionCheck.archivePath}`);
|
|
34398
34416
|
await prewarmSessionFile(params.sessionFile);
|
|
34399
34417
|
sessionManager = guardSessionManager(SessionManager.open(params.sessionFile), {
|
|
34400
34418
|
agentId: sessionAgentId,
|
|
@@ -34438,6 +34456,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
34438
34456
|
sandboxEnabled: !!sandbox?.enabled
|
|
34439
34457
|
});
|
|
34440
34458
|
const builtInTools = wrapToolsWithArgValidation(rawBuiltInTools, modelProfile);
|
|
34459
|
+
log$7.debug(`[tool-validate] profile=${modelProfile.label} validateToolArgs=${modelProfile.filters?.validateToolArgs ?? false} builtInTools=${builtInTools.length} toolNames=${builtInTools.map((t) => t.name).join(",")}`);
|
|
34441
34460
|
let clientToolCallDetected = null;
|
|
34442
34461
|
const clientToolLoopDetection = resolveToolLoopDetectionConfig({
|
|
34443
34462
|
cfg: params.config,
|
|
@@ -34649,7 +34668,6 @@ async function runEmbeddedAttempt(params) {
|
|
|
34649
34668
|
const TOOL_ERROR_ABORT_THRESHOLD = 5;
|
|
34650
34669
|
const TOOL_ERROR_WARN_THRESHOLD = 3;
|
|
34651
34670
|
let consecutiveToolErrors = 0;
|
|
34652
|
-
let lastErrorToolName = "";
|
|
34653
34671
|
const subscription = subscribeEmbeddedPiSession({
|
|
34654
34672
|
session: activeSession,
|
|
34655
34673
|
runId: params.runId,
|
|
@@ -34673,26 +34691,23 @@ async function runEmbeddedAttempt(params) {
|
|
|
34673
34691
|
params.onAgentEvent?.(evt);
|
|
34674
34692
|
if (evt.stream === "tool" && !aborted) {
|
|
34675
34693
|
const phase = typeof evt.data?.phase === "string" ? evt.data.phase : "";
|
|
34676
|
-
const toolName = typeof evt.data?.name === "string" ? evt.data.name : "";
|
|
34677
34694
|
const isError = evt.data?.isError === true;
|
|
34678
|
-
if (phase === "result"
|
|
34679
|
-
if (isError
|
|
34680
|
-
else
|
|
34681
|
-
consecutiveToolErrors = 1;
|
|
34682
|
-
lastErrorToolName = toolName;
|
|
34683
|
-
} else {
|
|
34684
|
-
consecutiveToolErrors = 0;
|
|
34685
|
-
lastErrorToolName = "";
|
|
34686
|
-
}
|
|
34695
|
+
if (phase === "result") {
|
|
34696
|
+
if (isError) consecutiveToolErrors++;
|
|
34697
|
+
else consecutiveToolErrors = 0;
|
|
34687
34698
|
if (consecutiveToolErrors >= TOOL_ERROR_ABORT_THRESHOLD) {
|
|
34688
|
-
|
|
34689
|
-
|
|
34690
|
-
|
|
34699
|
+
const toolName = typeof evt.data?.name === "string" ? evt.data.name : "unknown";
|
|
34700
|
+
log$7.error(`Agent-loop circuit breaker: ${consecutiveToolErrors} consecutive tool errors (last: ${toolName}). Aborting run ${params.runId}.`);
|
|
34701
|
+
abortRun(false, /* @__PURE__ */ new Error(`${consecutiveToolErrors} consecutive tool errors. The model may be generating corrupted tool arguments. Run aborted to prevent infinite loop.`));
|
|
34702
|
+
} else if (consecutiveToolErrors === TOOL_ERROR_WARN_THRESHOLD) {
|
|
34703
|
+
const toolName = typeof evt.data?.name === "string" ? evt.data.name : "unknown";
|
|
34704
|
+
log$7.warn(`Agent-loop tool error warning: ${consecutiveToolErrors} consecutive failures (last: ${toolName}). runId=${params.runId}`);
|
|
34705
|
+
}
|
|
34691
34706
|
}
|
|
34692
34707
|
}
|
|
34693
34708
|
if (evt.stream === "assistant" && typeof evt.data?.text === "string" && !aborted) {
|
|
34694
34709
|
streamMonitor.onChunk(evt.data.text);
|
|
34695
|
-
if (streamMonitor.shouldStop()) log$
|
|
34710
|
+
if (streamMonitor.shouldStop()) log$7.debug(`stream monitor detection (log-only, no abort): runId=${params.runId} reason=${streamMonitor.getStopReason()}`);
|
|
34696
34711
|
}
|
|
34697
34712
|
},
|
|
34698
34713
|
enforceFinalTag: params.enforceFinalTag,
|
|
@@ -34712,7 +34727,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
34712
34727
|
let abortWarnTimer;
|
|
34713
34728
|
const isProbeSession = params.sessionId?.startsWith("probe-") ?? false;
|
|
34714
34729
|
const abortTimer = setTimeout(() => {
|
|
34715
|
-
if (!isProbeSession) log$
|
|
34730
|
+
if (!isProbeSession) log$7.warn(`embedded run timeout: runId=${params.runId} sessionId=${params.sessionId} timeoutMs=${params.timeoutMs}`);
|
|
34716
34731
|
if (shouldFlagCompactionTimeout({
|
|
34717
34732
|
isTimeout: true,
|
|
34718
34733
|
isCompactionPendingOrRetrying: subscription.isCompacting(),
|
|
@@ -34721,7 +34736,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
34721
34736
|
abortRun(true);
|
|
34722
34737
|
if (!abortWarnTimer) abortWarnTimer = setTimeout(() => {
|
|
34723
34738
|
if (!activeSession.isStreaming) return;
|
|
34724
|
-
if (!isProbeSession) log$
|
|
34739
|
+
if (!isProbeSession) log$7.warn(`embedded run abort still streaming: runId=${params.runId} sessionId=${params.sessionId}`);
|
|
34725
34740
|
}, 1e4);
|
|
34726
34741
|
}, Math.max(1, params.timeoutMs));
|
|
34727
34742
|
armSymipulseTimer = () => {
|
|
@@ -34729,7 +34744,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
34729
34744
|
clearSymipulseTimer();
|
|
34730
34745
|
symipulseTimer = setTimeout(() => {
|
|
34731
34746
|
if (aborted) return;
|
|
34732
|
-
if (!isProbeSession) log$
|
|
34747
|
+
if (!isProbeSession) log$7.warn(`symipulse timeout: runId=${params.runId} sessionId=${params.sessionId} symipulseMs=${symipulseMs} (no activity)`);
|
|
34733
34748
|
if (shouldFlagCompactionTimeout({
|
|
34734
34749
|
isTimeout: true,
|
|
34735
34750
|
isCompactionPendingOrRetrying: subscription.isCompacting(),
|
|
@@ -34773,13 +34788,13 @@ async function runEmbeddedAttempt(params) {
|
|
|
34773
34788
|
prompt: params.prompt,
|
|
34774
34789
|
messages: activeSession.messages
|
|
34775
34790
|
}, hookCtx).catch((hookErr) => {
|
|
34776
|
-
log$
|
|
34791
|
+
log$7.warn(`before_prompt_build hook failed: ${String(hookErr)}`);
|
|
34777
34792
|
}) : void 0;
|
|
34778
34793
|
const legacyResult = hookRunner?.hasHooks("before_agent_start") ? await hookRunner.runBeforeAgentStart({
|
|
34779
34794
|
prompt: params.prompt,
|
|
34780
34795
|
messages: activeSession.messages
|
|
34781
34796
|
}, hookCtx).catch((hookErr) => {
|
|
34782
|
-
log$
|
|
34797
|
+
log$7.warn(`before_agent_start hook (legacy prompt build path) failed: ${String(hookErr)}`);
|
|
34783
34798
|
}) : void 0;
|
|
34784
34799
|
const hookResult = {
|
|
34785
34800
|
systemPrompt: promptBuildResult?.systemPrompt ?? legacyResult?.systemPrompt,
|
|
@@ -34787,7 +34802,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
34787
34802
|
};
|
|
34788
34803
|
if (hookResult?.prependContext) {
|
|
34789
34804
|
effectivePrompt = `${hookResult.prependContext}\n\n${params.prompt}`;
|
|
34790
|
-
log$
|
|
34805
|
+
log$7.debug(`hooks: prepended context to prompt (${hookResult.prependContext.length} chars)`);
|
|
34791
34806
|
}
|
|
34792
34807
|
{
|
|
34793
34808
|
const autoRecallAgentId = normalizeAgentId(params.sessionKey);
|
|
@@ -34804,11 +34819,11 @@ async function runEmbeddedAttempt(params) {
|
|
|
34804
34819
|
if (recallResults.length > 0) {
|
|
34805
34820
|
const recallBlock = `<memory_context>\nThe following memory snippets were automatically retrieved as relevant context:\n\n${recallResults.map((r) => `[${r.path}#L${r.startLine}-L${r.endLine}]\n${r.snippet}`).join("\n---\n")}\n</memory_context>`;
|
|
34806
34821
|
effectivePrompt = `${recallBlock}\n\n${effectivePrompt}`;
|
|
34807
|
-
log$
|
|
34822
|
+
log$7.debug(`auto-recall: injected ${recallResults.length} snippets (${recallBlock.length} chars)`);
|
|
34808
34823
|
}
|
|
34809
34824
|
}
|
|
34810
34825
|
} catch (recallErr) {
|
|
34811
|
-
log$
|
|
34826
|
+
log$7.debug(`auto-recall: skipped (${String(recallErr)})`);
|
|
34812
34827
|
}
|
|
34813
34828
|
}
|
|
34814
34829
|
{
|
|
@@ -34820,10 +34835,10 @@ async function runEmbeddedAttempt(params) {
|
|
|
34820
34835
|
if (planResult.enter) {
|
|
34821
34836
|
if (planResult.stripped != null) effectivePrompt = planResult.stripped;
|
|
34822
34837
|
effectivePrompt = `${PLAN_MODE_SYSTEM_PROMPT}\n\n${effectivePrompt}`;
|
|
34823
|
-
log$
|
|
34838
|
+
log$7.info(`plan-mode: activated (${planResult.reason}) for runId=${params.runId}`);
|
|
34824
34839
|
} else if (planResult.stripped != null) effectivePrompt = planResult.stripped;
|
|
34825
34840
|
}
|
|
34826
|
-
log$
|
|
34841
|
+
log$7.debug(`embedded run prompt start: runId=${params.runId} sessionId=${params.sessionId}`);
|
|
34827
34842
|
cacheTrace?.recordStage("prompt:before", {
|
|
34828
34843
|
prompt: effectivePrompt,
|
|
34829
34844
|
messages: activeSession.messages
|
|
@@ -34835,7 +34850,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
34835
34850
|
const sessionContext = sessionManager.buildSessionContext();
|
|
34836
34851
|
const sanitizedOrphan = transcriptPolicy.sanitizeThinkingSignatures ? sanitizeAntigravityThinkingBlocks(sessionContext.messages) : sessionContext.messages;
|
|
34837
34852
|
activeSession.agent.replaceMessages(sanitizedOrphan);
|
|
34838
|
-
log$
|
|
34853
|
+
log$7.warn(`Removed orphaned user message to prevent consecutive user turns. runId=${params.runId} sessionId=${params.sessionId}`);
|
|
34839
34854
|
}
|
|
34840
34855
|
try {
|
|
34841
34856
|
const imageResult = await detectAndLoadPromptImages({
|
|
@@ -34857,12 +34872,12 @@ async function runEmbeddedAttempt(params) {
|
|
|
34857
34872
|
messages: activeSession.messages,
|
|
34858
34873
|
note: `images: prompt=${imageResult.images.length} history=${imageResult.historyImagesByIndex.size}`
|
|
34859
34874
|
});
|
|
34860
|
-
if (log$
|
|
34875
|
+
if (log$7.isEnabled("debug")) {
|
|
34861
34876
|
const msgCount = activeSession.messages.length;
|
|
34862
34877
|
const systemLen = systemPromptText?.length ?? 0;
|
|
34863
34878
|
const promptLen = effectivePrompt.length;
|
|
34864
34879
|
const sessionSummary = summarizeSessionContext(activeSession.messages);
|
|
34865
|
-
log$
|
|
34880
|
+
log$7.debug(`[context-diag] pre-prompt: sessionKey=${params.sessionKey ?? params.sessionId} messages=${msgCount} roleCounts=${sessionSummary.roleCounts} historyTextChars=${sessionSummary.totalTextChars} maxMessageTextChars=${sessionSummary.maxMessageTextChars} historyImageBlocks=${sessionSummary.totalImageBlocks} systemPromptChars=${systemLen} promptChars=${promptLen} promptImages=${imageResult.images.length} historyImageMessages=${imageResult.historyImagesByIndex.size} provider=${params.provider}/${params.modelId} sessionFile=${params.sessionFile}`);
|
|
34866
34881
|
}
|
|
34867
34882
|
if (hookRunner?.hasHooks("llm_input")) hookRunner.runLlmInput({
|
|
34868
34883
|
runId: params.runId,
|
|
@@ -34880,7 +34895,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
34880
34895
|
workspaceDir: params.workspaceDir,
|
|
34881
34896
|
messageProvider: params.messageProvider ?? void 0
|
|
34882
34897
|
}).catch((err) => {
|
|
34883
|
-
log$
|
|
34898
|
+
log$7.warn(`llm_input hook failed: ${String(err)}`);
|
|
34884
34899
|
});
|
|
34885
34900
|
if (imageResult.images.length > 0) await abortable(activeSession.prompt(effectivePrompt, { images: imageResult.images }));
|
|
34886
34901
|
else await abortable(activeSession.prompt(effectivePrompt));
|
|
@@ -34888,7 +34903,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
34888
34903
|
promptError = err;
|
|
34889
34904
|
promptErrorSource = "prompt";
|
|
34890
34905
|
} finally {
|
|
34891
|
-
log$
|
|
34906
|
+
log$7.debug(`embedded run prompt end: runId=${params.runId} sessionId=${params.sessionId} durationMs=${Date.now() - promptStartedAt}`);
|
|
34892
34907
|
}
|
|
34893
34908
|
const wasCompactingBefore = activeSession.isCompacting;
|
|
34894
34909
|
const snapshot = activeSession.messages.slice();
|
|
@@ -34903,7 +34918,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
34903
34918
|
promptError = err;
|
|
34904
34919
|
promptErrorSource = "compaction";
|
|
34905
34920
|
}
|
|
34906
|
-
if (!isProbeSession) log$
|
|
34921
|
+
if (!isProbeSession) log$7.debug(`compaction wait aborted: runId=${params.runId} sessionId=${params.sessionId}`);
|
|
34907
34922
|
} else throw err;
|
|
34908
34923
|
}
|
|
34909
34924
|
if (!timedOutDuringCompaction) {
|
|
@@ -34921,7 +34936,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
34921
34936
|
currentSessionId: activeSession.sessionId
|
|
34922
34937
|
});
|
|
34923
34938
|
if (timedOutDuringCompaction) {
|
|
34924
|
-
if (!isProbeSession) log$
|
|
34939
|
+
if (!isProbeSession) log$7.warn(`using ${snapshotSelection.source} snapshot: timed out during compaction runId=${params.runId} sessionId=${params.sessionId}`);
|
|
34925
34940
|
}
|
|
34926
34941
|
messagesSnapshot = snapshotSelection.messagesSnapshot;
|
|
34927
34942
|
sessionIdUsed = snapshotSelection.sessionIdUsed;
|
|
@@ -34936,7 +34951,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
34936
34951
|
error: describeUnknownError(promptError)
|
|
34937
34952
|
});
|
|
34938
34953
|
} catch (entryErr) {
|
|
34939
|
-
log$
|
|
34954
|
+
log$7.warn(`failed to persist prompt error entry: ${String(entryErr)}`);
|
|
34940
34955
|
}
|
|
34941
34956
|
cacheTrace?.recordStage("session:after", {
|
|
34942
34957
|
messages: messagesSnapshot,
|
|
@@ -34955,17 +34970,17 @@ async function runEmbeddedAttempt(params) {
|
|
|
34955
34970
|
workspaceDir: params.workspaceDir,
|
|
34956
34971
|
messageProvider: params.messageProvider ?? void 0
|
|
34957
34972
|
}).catch((err) => {
|
|
34958
|
-
log$
|
|
34973
|
+
log$7.warn(`agent_end hook failed: ${err}`);
|
|
34959
34974
|
});
|
|
34960
34975
|
} finally {
|
|
34961
34976
|
clearTimeout(abortTimer);
|
|
34962
34977
|
clearSymipulseTimer();
|
|
34963
34978
|
if (abortWarnTimer) clearTimeout(abortWarnTimer);
|
|
34964
|
-
if (!isProbeSession && (aborted || timedOut) && !timedOutDuringCompaction) log$
|
|
34979
|
+
if (!isProbeSession && (aborted || timedOut) && !timedOutDuringCompaction) log$7.debug(`run cleanup: runId=${params.runId} sessionId=${params.sessionId} aborted=${aborted} timedOut=${timedOut}`);
|
|
34965
34980
|
try {
|
|
34966
34981
|
unsubscribe();
|
|
34967
34982
|
} catch (err) {
|
|
34968
|
-
log$
|
|
34983
|
+
log$7.error(`CRITICAL: unsubscribe failed, possible resource leak: runId=${params.runId} ${String(err)}`);
|
|
34969
34984
|
}
|
|
34970
34985
|
clearActiveEmbeddedRun(params.sessionId, queueHandle, params.sessionKey);
|
|
34971
34986
|
params.abortSignal?.removeEventListener?.("abort", onAbort);
|
|
@@ -34990,7 +35005,7 @@ async function runEmbeddedAttempt(params) {
|
|
|
34990
35005
|
workspaceDir: params.workspaceDir,
|
|
34991
35006
|
messageProvider: params.messageProvider ?? void 0
|
|
34992
35007
|
}).catch((err) => {
|
|
34993
|
-
log$
|
|
35008
|
+
log$7.warn(`llm_output hook failed: ${String(err)}`);
|
|
34994
35009
|
});
|
|
34995
35010
|
return {
|
|
34996
35011
|
aborted,
|
|
@@ -35251,7 +35266,7 @@ async function runEmbeddedPiAgent(params) {
|
|
|
35251
35266
|
const redactedSessionId = redactRunIdentifier(params.sessionId);
|
|
35252
35267
|
const redactedSessionKey = redactRunIdentifier(params.sessionKey);
|
|
35253
35268
|
const redactedWorkspace = redactRunIdentifier(resolvedWorkspace);
|
|
35254
|
-
if (workspaceResolution.usedFallback) log$
|
|
35269
|
+
if (workspaceResolution.usedFallback) log$7.warn(`[workspace-fallback] caller=runEmbeddedPiAgent reason=${workspaceResolution.fallbackReason} run=${params.runId} session=${redactedSessionId} sessionKey=${redactedSessionKey} agent=${workspaceResolution.agentId} workspace=${redactedWorkspace}`);
|
|
35255
35270
|
const prevCwd = process.cwd();
|
|
35256
35271
|
let provider = (params.provider ?? DEFAULT_PROVIDER).trim() || DEFAULT_PROVIDER;
|
|
35257
35272
|
let modelId = (params.model ?? DEFAULT_MODEL).trim() || DEFAULT_MODEL;
|
|
@@ -35270,7 +35285,7 @@ async function runEmbeddedPiAgent(params) {
|
|
|
35270
35285
|
if (hookRunner?.hasHooks("before_model_resolve")) try {
|
|
35271
35286
|
modelResolveOverride = await hookRunner.runBeforeModelResolve({ prompt: params.prompt }, hookCtx);
|
|
35272
35287
|
} catch (hookErr) {
|
|
35273
|
-
log$
|
|
35288
|
+
log$7.warn(`before_model_resolve hook failed: ${String(hookErr)}`);
|
|
35274
35289
|
}
|
|
35275
35290
|
if (hookRunner?.hasHooks("before_agent_start")) try {
|
|
35276
35291
|
const legacyResult = await hookRunner.runBeforeAgentStart({ prompt: params.prompt }, hookCtx);
|
|
@@ -35279,15 +35294,15 @@ async function runEmbeddedPiAgent(params) {
|
|
|
35279
35294
|
modelOverride: modelResolveOverride?.modelOverride ?? legacyResult?.modelOverride
|
|
35280
35295
|
};
|
|
35281
35296
|
} catch (hookErr) {
|
|
35282
|
-
log$
|
|
35297
|
+
log$7.warn(`before_agent_start hook (legacy model resolve path) failed: ${String(hookErr)}`);
|
|
35283
35298
|
}
|
|
35284
35299
|
if (modelResolveOverride?.providerOverride) {
|
|
35285
35300
|
provider = modelResolveOverride.providerOverride;
|
|
35286
|
-
log$
|
|
35301
|
+
log$7.info(`[hooks] provider overridden to ${provider}`);
|
|
35287
35302
|
}
|
|
35288
35303
|
if (modelResolveOverride?.modelOverride) {
|
|
35289
35304
|
modelId = modelResolveOverride.modelOverride;
|
|
35290
|
-
log$
|
|
35305
|
+
log$7.info(`[hooks] model overridden to ${modelId}`);
|
|
35291
35306
|
}
|
|
35292
35307
|
const { model, error, authStorage, modelRegistry } = resolveModel(provider, modelId, agentDir, params.config);
|
|
35293
35308
|
if (!model) throw new FailoverError(error ?? `Unknown model: ${provider}/${modelId}`, {
|
|
@@ -35307,9 +35322,9 @@ async function runEmbeddedPiAgent(params) {
|
|
|
35307
35322
|
warnBelowTokens: CONTEXT_WINDOW_WARN_BELOW_TOKENS,
|
|
35308
35323
|
hardMinTokens: CONTEXT_WINDOW_HARD_MIN_TOKENS
|
|
35309
35324
|
});
|
|
35310
|
-
if (ctxGuard.shouldWarn) log$
|
|
35325
|
+
if (ctxGuard.shouldWarn) log$7.warn(`low context window: ${provider}/${modelId} ctx=${ctxGuard.tokens} (warn<${CONTEXT_WINDOW_WARN_BELOW_TOKENS}) source=${ctxGuard.source}`);
|
|
35311
35326
|
if (ctxGuard.shouldBlock) {
|
|
35312
|
-
log$
|
|
35327
|
+
log$7.error(`blocked model (context window too small): ${provider}/${modelId} ctx=${ctxGuard.tokens} (min=${CONTEXT_WINDOW_HARD_MIN_TOKENS}) source=${ctxGuard.source}`);
|
|
35313
35328
|
throw new FailoverError(`Model context window too small (${ctxGuard.tokens} tokens). Minimum is ${CONTEXT_WINDOW_HARD_MIN_TOKENS}.`, {
|
|
35314
35329
|
reason: "unknown",
|
|
35315
35330
|
provider,
|
|
@@ -35439,7 +35454,7 @@ async function runEmbeddedPiAgent(params) {
|
|
|
35439
35454
|
while (true) {
|
|
35440
35455
|
if (runLoopIterations >= MAX_RUN_LOOP_ITERATIONS) {
|
|
35441
35456
|
const message = `Exceeded retry limit after ${runLoopIterations} attempts (max=${MAX_RUN_LOOP_ITERATIONS}).`;
|
|
35442
|
-
log$
|
|
35457
|
+
log$7.error(`[run-retry-limit] sessionKey=${params.sessionKey ?? params.sessionId} provider=${provider}/${modelId} attempts=${runLoopIterations} maxAttempts=${MAX_RUN_LOOP_ITERATIONS}`);
|
|
35443
35458
|
return {
|
|
35444
35459
|
payloads: [{
|
|
35445
35460
|
text: "Request failed after repeated internal retries. Please try again, or use /new to start a fresh session.",
|
|
@@ -35560,18 +35575,18 @@ async function runEmbeddedPiAgent(params) {
|
|
|
35560
35575
|
const overflowDiagId = createCompactionDiagId$1();
|
|
35561
35576
|
const errorText = contextOverflowError.text;
|
|
35562
35577
|
const msgCount = attempt.messagesSnapshot?.length ?? 0;
|
|
35563
|
-
log$
|
|
35578
|
+
log$7.warn(`[context-overflow-diag] sessionKey=${params.sessionKey ?? params.sessionId} provider=${provider}/${modelId} source=${contextOverflowError.source} messages=${msgCount} sessionFile=${params.sessionFile} diagId=${overflowDiagId} compactionAttempts=${overflowCompactionAttempts} error=${errorText.slice(0, 200)}`);
|
|
35564
35579
|
const isCompactionFailure = isCompactionFailureError(errorText);
|
|
35565
35580
|
const hadAttemptLevelCompaction = attemptCompactionCount > 0;
|
|
35566
35581
|
if (!isCompactionFailure && hadAttemptLevelCompaction && overflowCompactionAttempts < MAX_OVERFLOW_COMPACTION_ATTEMPTS) {
|
|
35567
35582
|
overflowCompactionAttempts++;
|
|
35568
|
-
log$
|
|
35583
|
+
log$7.warn(`context overflow persisted after in-attempt compaction (attempt ${overflowCompactionAttempts}/${MAX_OVERFLOW_COMPACTION_ATTEMPTS}); retrying prompt without additional compaction for ${provider}/${modelId}`);
|
|
35569
35584
|
continue;
|
|
35570
35585
|
}
|
|
35571
35586
|
if (!isCompactionFailure && !hadAttemptLevelCompaction && overflowCompactionAttempts < MAX_OVERFLOW_COMPACTION_ATTEMPTS) {
|
|
35572
|
-
if (log$
|
|
35587
|
+
if (log$7.isEnabled("debug")) log$7.debug(`[compaction-diag] decision diagId=${overflowDiagId} branch=compact isCompactionFailure=${isCompactionFailure} hasOversizedToolResults=unknown attempt=${overflowCompactionAttempts + 1} maxAttempts=${MAX_OVERFLOW_COMPACTION_ATTEMPTS}`);
|
|
35573
35588
|
overflowCompactionAttempts++;
|
|
35574
|
-
log$
|
|
35589
|
+
log$7.warn(`context overflow detected (attempt ${overflowCompactionAttempts}/${MAX_OVERFLOW_COMPACTION_ATTEMPTS}); attempting auto-compaction for ${provider}/${modelId}`);
|
|
35575
35590
|
const compactResult = await compactEmbeddedPiSessionDirect({
|
|
35576
35591
|
sessionId: params.sessionId,
|
|
35577
35592
|
sessionKey: params.sessionKey,
|
|
@@ -35600,10 +35615,10 @@ async function runEmbeddedPiAgent(params) {
|
|
|
35600
35615
|
});
|
|
35601
35616
|
if (compactResult.compacted) {
|
|
35602
35617
|
autoCompactionCount += 1;
|
|
35603
|
-
log$
|
|
35618
|
+
log$7.info(`auto-compaction succeeded for ${provider}/${modelId}; retrying prompt`);
|
|
35604
35619
|
continue;
|
|
35605
35620
|
}
|
|
35606
|
-
log$
|
|
35621
|
+
log$7.warn(`auto-compaction failed for ${provider}/${modelId}: ${compactResult.reason ?? "nothing to compact"}`);
|
|
35607
35622
|
}
|
|
35608
35623
|
if (!toolResultTruncationAttempted) {
|
|
35609
35624
|
const contextWindowTokens = ctxInfo.tokens;
|
|
@@ -35612,9 +35627,9 @@ async function runEmbeddedPiAgent(params) {
|
|
|
35612
35627
|
contextWindowTokens
|
|
35613
35628
|
}) : false;
|
|
35614
35629
|
if (hasOversized) {
|
|
35615
|
-
if (log$
|
|
35630
|
+
if (log$7.isEnabled("debug")) log$7.debug(`[compaction-diag] decision diagId=${overflowDiagId} branch=truncate_tool_results isCompactionFailure=${isCompactionFailure} hasOversizedToolResults=${hasOversized} attempt=${overflowCompactionAttempts} maxAttempts=${MAX_OVERFLOW_COMPACTION_ATTEMPTS}`);
|
|
35616
35631
|
toolResultTruncationAttempted = true;
|
|
35617
|
-
log$
|
|
35632
|
+
log$7.warn(`[context-overflow-recovery] Attempting tool result truncation for ${provider}/${modelId} (contextWindow=${contextWindowTokens} tokens)`);
|
|
35618
35633
|
const truncResult = await truncateOversizedToolResultsInSession({
|
|
35619
35634
|
sessionFile: params.sessionFile,
|
|
35620
35635
|
contextWindowTokens,
|
|
@@ -35622,13 +35637,13 @@ async function runEmbeddedPiAgent(params) {
|
|
|
35622
35637
|
sessionKey: params.sessionKey
|
|
35623
35638
|
});
|
|
35624
35639
|
if (truncResult.truncated) {
|
|
35625
|
-
log$
|
|
35640
|
+
log$7.info(`[context-overflow-recovery] Truncated ${truncResult.truncatedCount} tool result(s); retrying prompt`);
|
|
35626
35641
|
continue;
|
|
35627
35642
|
}
|
|
35628
|
-
log$
|
|
35629
|
-
} else if (log$
|
|
35643
|
+
log$7.warn(`[context-overflow-recovery] Tool result truncation did not help: ${truncResult.reason ?? "unknown"}`);
|
|
35644
|
+
} else if (log$7.isEnabled("debug")) log$7.debug(`[compaction-diag] decision diagId=${overflowDiagId} branch=give_up isCompactionFailure=${isCompactionFailure} hasOversizedToolResults=${hasOversized} attempt=${overflowCompactionAttempts} maxAttempts=${MAX_OVERFLOW_COMPACTION_ATTEMPTS}`);
|
|
35630
35645
|
}
|
|
35631
|
-
if ((isCompactionFailure || overflowCompactionAttempts >= MAX_OVERFLOW_COMPACTION_ATTEMPTS || toolResultTruncationAttempted) && log$
|
|
35646
|
+
if ((isCompactionFailure || overflowCompactionAttempts >= MAX_OVERFLOW_COMPACTION_ATTEMPTS || toolResultTruncationAttempted) && log$7.isEnabled("debug")) log$7.debug(`[compaction-diag] decision diagId=${overflowDiagId} branch=give_up isCompactionFailure=${isCompactionFailure} hasOversizedToolResults=unknown attempt=${overflowCompactionAttempts} maxAttempts=${MAX_OVERFLOW_COMPACTION_ATTEMPTS}`);
|
|
35632
35647
|
const kind = isCompactionFailure ? "compaction_failure" : "context_overflow";
|
|
35633
35648
|
return {
|
|
35634
35649
|
payloads: [{
|
|
@@ -35709,7 +35724,7 @@ async function runEmbeddedPiAgent(params) {
|
|
|
35709
35724
|
attempted: attemptedThinking
|
|
35710
35725
|
});
|
|
35711
35726
|
if (fallbackThinking) {
|
|
35712
|
-
log$
|
|
35727
|
+
log$7.warn(`unsupported thinking level for ${provider}/${modelId}; retrying with ${fallbackThinking}`);
|
|
35713
35728
|
thinkLevel = fallbackThinking;
|
|
35714
35729
|
continue;
|
|
35715
35730
|
}
|
|
@@ -35727,7 +35742,7 @@ async function runEmbeddedPiAgent(params) {
|
|
|
35727
35742
|
attempted: attemptedThinking
|
|
35728
35743
|
});
|
|
35729
35744
|
if (fallbackThinking && !aborted) {
|
|
35730
|
-
log$
|
|
35745
|
+
log$7.warn(`unsupported thinking level for ${provider}/${modelId}; retrying with ${fallbackThinking}`);
|
|
35731
35746
|
thinkLevel = fallbackThinking;
|
|
35732
35747
|
continue;
|
|
35733
35748
|
}
|
|
@@ -35744,7 +35759,7 @@ async function runEmbeddedPiAgent(params) {
|
|
|
35744
35759
|
imageDimensionError.contentIndex !== void 0 ? `content=${imageDimensionError.contentIndex}` : null,
|
|
35745
35760
|
imageDimensionError.maxDimensionPx !== void 0 ? `limit=${imageDimensionError.maxDimensionPx}px` : null
|
|
35746
35761
|
].filter(Boolean).join(" ");
|
|
35747
|
-
log$
|
|
35762
|
+
log$7.warn(`Profile ${lastProfileId} rejected image payload${details ? ` (${details})` : ""}.`);
|
|
35748
35763
|
}
|
|
35749
35764
|
const isLocalOllamaTimeout = timedOut && model.api === "ollama";
|
|
35750
35765
|
if (!aborted && failoverFailure || timedOut && !timedOutDuringCompaction && !isLocalOllamaTimeout) {
|
|
@@ -35756,8 +35771,8 @@ async function runEmbeddedPiAgent(params) {
|
|
|
35756
35771
|
cfg: params.config,
|
|
35757
35772
|
agentDir: params.agentDir
|
|
35758
35773
|
});
|
|
35759
|
-
if (timedOut && !isProbeSession) log$
|
|
35760
|
-
if (cloudCodeAssistFormatError) log$
|
|
35774
|
+
if (timedOut && !isProbeSession) log$7.warn(`Profile ${lastProfileId} timed out (possible rate limit). Trying next account...`);
|
|
35775
|
+
if (cloudCodeAssistFormatError) log$7.warn(`Profile ${lastProfileId} hit Cloud Code Assist format error. Tool calls will be sanitized on retry.`);
|
|
35761
35776
|
}
|
|
35762
35777
|
if (await advanceAuthProfile()) continue;
|
|
35763
35778
|
if (fallbackConfigured) {
|
|
@@ -35823,7 +35838,7 @@ async function runEmbeddedPiAgent(params) {
|
|
|
35823
35838
|
const hasCodeBlocks = attempt.assistantTexts.some((text) => /```[\s\S]*?```/.test(text));
|
|
35824
35839
|
if (hasCodeToolUsage || hasCodeBlocks) {
|
|
35825
35840
|
verificationPassCompleted = true;
|
|
35826
|
-
log$
|
|
35841
|
+
log$7.debug(`[verification] starting verification pass: runId=${params.runId} sessionId=${params.sessionId} trigger=${hasCodeToolUsage ? "tool_usage" : "code_blocks"}`);
|
|
35827
35842
|
const verificationPrompt = "Review your response against the original user request. Check: (1) Did you address every requirement? (2) Did you include tests if requested? (3) Did you run and verify the code works? If you missed anything, fix it now. If everything looks correct, briefly confirm.";
|
|
35828
35843
|
try {
|
|
35829
35844
|
const verifyAttempt = await runEmbeddedAttempt({
|
|
@@ -35909,10 +35924,10 @@ async function runEmbeddedPiAgent(params) {
|
|
|
35909
35924
|
payloads.length = 0;
|
|
35910
35925
|
payloads.push(...verifyPayloads);
|
|
35911
35926
|
}
|
|
35912
|
-
log$
|
|
35913
|
-
} else log$
|
|
35927
|
+
log$7.debug(`[verification] verification produced corrections: runId=${params.runId} tools=${verifyAttempt.toolMetas.length} texts=${verifyAttempt.assistantTexts.length}`);
|
|
35928
|
+
} else log$7.debug(`[verification] verification confirmed original response: runId=${params.runId}`);
|
|
35914
35929
|
} catch (verifyErr) {
|
|
35915
|
-
log$
|
|
35930
|
+
log$7.warn(`[verification] verification pass failed, keeping original response: runId=${params.runId} error=${String(verifyErr)}`);
|
|
35916
35931
|
}
|
|
35917
35932
|
}
|
|
35918
35933
|
}
|
|
@@ -35933,7 +35948,7 @@ async function runEmbeddedPiAgent(params) {
|
|
|
35933
35948
|
messagingToolSentTargets: attempt.messagingToolSentTargets,
|
|
35934
35949
|
successfulCronAdds: attempt.successfulCronAdds
|
|
35935
35950
|
};
|
|
35936
|
-
log$
|
|
35951
|
+
log$7.debug(`embedded run done: runId=${params.runId} sessionId=${params.sessionId} durationMs=${Date.now() - started} aborted=${aborted}`);
|
|
35937
35952
|
if (lastProfileId) {
|
|
35938
35953
|
await markAuthProfileGood({
|
|
35939
35954
|
store: authStore,
|
|
@@ -36185,27 +36200,27 @@ async function runAgentTurn(params) {
|
|
|
36185
36200
|
function createDefaultDeps() {
|
|
36186
36201
|
return {
|
|
36187
36202
|
sendMessageWhatsApp: async (...args) => {
|
|
36188
|
-
const { sendMessageWhatsApp } = await import("./web-
|
|
36203
|
+
const { sendMessageWhatsApp } = await import("./web-C39eHM3D.js");
|
|
36189
36204
|
return await sendMessageWhatsApp(...args);
|
|
36190
36205
|
},
|
|
36191
36206
|
sendMessageTelegram: async (...args) => {
|
|
36192
|
-
const { sendMessageTelegram } = await import("./send-
|
|
36207
|
+
const { sendMessageTelegram } = await import("./send-CRsR8-vO.js").then((n) => n.l);
|
|
36193
36208
|
return await sendMessageTelegram(...args);
|
|
36194
36209
|
},
|
|
36195
36210
|
sendMessageDiscord: async (...args) => {
|
|
36196
|
-
const { sendMessageDiscord } = await import("./send-
|
|
36211
|
+
const { sendMessageDiscord } = await import("./send-CjOBB3Vo.js").then((n) => n.t);
|
|
36197
36212
|
return await sendMessageDiscord(...args);
|
|
36198
36213
|
},
|
|
36199
36214
|
sendMessageSlack: async (...args) => {
|
|
36200
|
-
const { sendMessageSlack } = await import("./send-
|
|
36215
|
+
const { sendMessageSlack } = await import("./send-B2CEnVLL.js").then((n) => n.n);
|
|
36201
36216
|
return await sendMessageSlack(...args);
|
|
36202
36217
|
},
|
|
36203
36218
|
sendMessageSignal: async (...args) => {
|
|
36204
|
-
const { sendMessageSignal } = await import("./send-
|
|
36219
|
+
const { sendMessageSignal } = await import("./send-pYqe432l.js").then((n) => n.i);
|
|
36205
36220
|
return await sendMessageSignal(...args);
|
|
36206
36221
|
},
|
|
36207
36222
|
sendMessageIMessage: async (...args) => {
|
|
36208
|
-
const { sendMessageIMessage } = await import("./send-
|
|
36223
|
+
const { sendMessageIMessage } = await import("./send-C5h_YxNb.js").then((n) => n.n);
|
|
36209
36224
|
return await sendMessageIMessage(...args);
|
|
36210
36225
|
}
|
|
36211
36226
|
};
|
|
@@ -46357,7 +46372,7 @@ function readSlackExternalArgMenuToken(raw) {
|
|
|
46357
46372
|
}
|
|
46358
46373
|
let commandsRegistry;
|
|
46359
46374
|
async function getCommandsRegistry() {
|
|
46360
|
-
if (!commandsRegistry) commandsRegistry = await import("./commands-registry-
|
|
46375
|
+
if (!commandsRegistry) commandsRegistry = await import("./commands-registry-COIaslGl.js").then((n) => n.n);
|
|
46361
46376
|
return commandsRegistry;
|
|
46362
46377
|
}
|
|
46363
46378
|
function encodeSlackCommandArgValue(parts) {
|
|
@@ -46699,11 +46714,11 @@ async function registerSlackMonitorSlashCommands(params) {
|
|
|
46699
46714
|
const channelName = channelInfo?.name;
|
|
46700
46715
|
const roomLabel = channelName ? `#${channelName}` : `#${command.channel_id}`;
|
|
46701
46716
|
const [{ resolveAgentRoute }, { finalizeInboundContext }, { dispatchReplyWithDispatcher }] = await Promise.all([
|
|
46702
|
-
import("./resolve-route-
|
|
46717
|
+
import("./resolve-route-B3CCBumQ.js").then((n) => n.r),
|
|
46703
46718
|
import("./inbound-context-D5EzMeL_.js").then((n) => n.n),
|
|
46704
46719
|
Promise.resolve().then(() => provider_dispatcher_exports)
|
|
46705
46720
|
]);
|
|
46706
|
-
const [{ resolveConversationLabel }, { createReplyPrefixOptions }] = await Promise.all([import("./conversation-label-yNSj43Jt.js").then((n) => n.t), import("./reply-prefix-
|
|
46721
|
+
const [{ resolveConversationLabel }, { createReplyPrefixOptions }] = await Promise.all([import("./conversation-label-yNSj43Jt.js").then((n) => n.t), import("./reply-prefix-uxfMZW4p.js").then((n) => n.r)]);
|
|
46707
46722
|
const route = resolveAgentRoute({
|
|
46708
46723
|
cfg,
|
|
46709
46724
|
channel: "slack",
|
|
@@ -46760,9 +46775,9 @@ async function registerSlackMonitorSlashCommands(params) {
|
|
|
46760
46775
|
});
|
|
46761
46776
|
const deliverSlashPayloads = async (replies) => {
|
|
46762
46777
|
const [{ deliverSlackSlashReplies }, { resolveChunkMode }, { resolveMarkdownTableMode }] = await Promise.all([
|
|
46763
|
-
import("./replies-
|
|
46764
|
-
import("./chunk-
|
|
46765
|
-
import("./markdown-tables-
|
|
46778
|
+
import("./replies-LLcQL3w6.js").then((n) => n.r),
|
|
46779
|
+
import("./chunk-Dw2XBYXv.js").then((n) => n.s),
|
|
46780
|
+
import("./markdown-tables-BoYFajMu.js").then((n) => n.t)
|
|
46766
46781
|
]);
|
|
46767
46782
|
await deliverSlackSlashReplies({
|
|
46768
46783
|
replies,
|
|
@@ -46815,7 +46830,7 @@ async function registerSlackMonitorSlashCommands(params) {
|
|
|
46815
46830
|
let nativeCommands = [];
|
|
46816
46831
|
if (nativeEnabled) {
|
|
46817
46832
|
reg = await getCommandsRegistry();
|
|
46818
|
-
const skillCommands = nativeSkillsEnabled ? (await import("./skill-commands-
|
|
46833
|
+
const skillCommands = nativeSkillsEnabled ? (await import("./skill-commands-ff_01_r3.js").then((n) => n.a)).listSkillCommandsForAgents({ cfg }) : [];
|
|
46819
46834
|
nativeCommands = reg.listNativeCommandSpecsForConfig(cfg, {
|
|
46820
46835
|
skillCommands,
|
|
46821
46836
|
provider: "slack"
|
|
@@ -51466,7 +51481,7 @@ const buildTelegramMessageContext = async ({ primaryCtx, allMedia, storeAllowFro
|
|
|
51466
51481
|
const hasAudio = allMedia.some((media) => media.contentType?.startsWith("audio/"));
|
|
51467
51482
|
let preflightTranscript;
|
|
51468
51483
|
if (isGroup && requireMention && hasAudio && !hasUserText && mentionRegexes.length > 0) try {
|
|
51469
|
-
const { transcribeFirstAudio } = await import("./audio-preflight-
|
|
51484
|
+
const { transcribeFirstAudio } = await import("./audio-preflight-VpItkiy3.js");
|
|
51470
51485
|
preflightTranscript = await transcribeFirstAudio({
|
|
51471
51486
|
ctx: {
|
|
51472
51487
|
MediaPaths: allMedia.length > 0 ? allMedia.map((m) => m.path) : void 0,
|
|
@@ -53611,23 +53626,23 @@ let webLoginQrPromise = null;
|
|
|
53611
53626
|
let webChannelPromise = null;
|
|
53612
53627
|
let whatsappActionsPromise = null;
|
|
53613
53628
|
function loadWebOutbound() {
|
|
53614
|
-
webOutboundPromise ??= import("./outbound-
|
|
53629
|
+
webOutboundPromise ??= import("./outbound-B0e8KdaR.js").then((n) => n.t);
|
|
53615
53630
|
return webOutboundPromise;
|
|
53616
53631
|
}
|
|
53617
53632
|
function loadWebLogin() {
|
|
53618
|
-
webLoginPromise ??= import("./login-
|
|
53633
|
+
webLoginPromise ??= import("./login-DQMXuxOk.js").then((n) => n.n);
|
|
53619
53634
|
return webLoginPromise;
|
|
53620
53635
|
}
|
|
53621
53636
|
function loadWebLoginQr() {
|
|
53622
|
-
webLoginQrPromise ??= import("./login-qr-
|
|
53637
|
+
webLoginQrPromise ??= import("./login-qr-BjVZSoCi.js");
|
|
53623
53638
|
return webLoginQrPromise;
|
|
53624
53639
|
}
|
|
53625
53640
|
function loadWebChannel() {
|
|
53626
|
-
webChannelPromise ??= import("./web-
|
|
53641
|
+
webChannelPromise ??= import("./web-C39eHM3D.js");
|
|
53627
53642
|
return webChannelPromise;
|
|
53628
53643
|
}
|
|
53629
53644
|
function loadWhatsAppActions() {
|
|
53630
|
-
whatsappActionsPromise ??= import("./whatsapp-actions-
|
|
53645
|
+
whatsappActionsPromise ??= import("./whatsapp-actions-DfseosPO.js");
|
|
53631
53646
|
return whatsappActionsPromise;
|
|
53632
53647
|
}
|
|
53633
53648
|
function createPluginRuntime() {
|
|
@@ -69834,7 +69849,7 @@ async function compactEmbeddedPiSessionDirect(params) {
|
|
|
69834
69849
|
const provider = (params.provider ?? DEFAULT_PROVIDER).trim() || DEFAULT_PROVIDER;
|
|
69835
69850
|
const modelId = (params.model ?? DEFAULT_MODEL).trim() || DEFAULT_MODEL;
|
|
69836
69851
|
const fail = (reason) => {
|
|
69837
|
-
log$
|
|
69852
|
+
log$7.warn(`[compaction-diag] end runId=${runId} sessionKey=${params.sessionKey ?? params.sessionId} diagId=${diagId} trigger=${trigger} provider=${provider}/${modelId} attempt=${attempt} maxAttempts=${maxAttempts} outcome=failed reason=${classifyCompactionReason(reason)} durationMs=${Date.now() - startedAt}`);
|
|
69838
69853
|
return {
|
|
69839
69854
|
ok: false,
|
|
69840
69855
|
compacted: false,
|
|
@@ -69902,7 +69917,7 @@ async function compactEmbeddedPiSessionDirect(params) {
|
|
|
69902
69917
|
sessionId: params.sessionId,
|
|
69903
69918
|
warn: makeBootstrapWarn({
|
|
69904
69919
|
sessionLabel,
|
|
69905
|
-
warn: (message) => log$
|
|
69920
|
+
warn: (message) => log$7.warn(message)
|
|
69906
69921
|
})
|
|
69907
69922
|
});
|
|
69908
69923
|
const runAbortController = new AbortController();
|
|
@@ -70042,7 +70057,7 @@ async function compactEmbeddedPiSessionDirect(params) {
|
|
|
70042
70057
|
try {
|
|
70043
70058
|
await repairSessionFileIfNeeded({
|
|
70044
70059
|
sessionFile: params.sessionFile,
|
|
70045
|
-
warn: (message) => log$
|
|
70060
|
+
warn: (message) => log$7.warn(message)
|
|
70046
70061
|
});
|
|
70047
70062
|
await prewarmSessionFile(params.sessionFile);
|
|
70048
70063
|
const transcriptPolicy = resolveTranscriptPolicy({
|
|
@@ -70127,13 +70142,13 @@ async function compactEmbeddedPiSessionDirect(params) {
|
|
|
70127
70142
|
messages: preCompactionMessages,
|
|
70128
70143
|
sessionFile: params.sessionFile
|
|
70129
70144
|
}, hookCtx).catch((hookErr) => {
|
|
70130
|
-
log$
|
|
70145
|
+
log$7.warn(`before_compaction hook failed: ${String(hookErr)}`);
|
|
70131
70146
|
});
|
|
70132
|
-
const diagEnabled = log$
|
|
70147
|
+
const diagEnabled = log$7.isEnabled("debug");
|
|
70133
70148
|
const preMetrics = diagEnabled ? summarizeCompactionMessages(session.messages) : void 0;
|
|
70134
70149
|
if (diagEnabled && preMetrics) {
|
|
70135
|
-
log$
|
|
70136
|
-
log$
|
|
70150
|
+
log$7.debug(`[compaction-diag] start runId=${runId} sessionKey=${params.sessionKey ?? params.sessionId} diagId=${diagId} trigger=${trigger} provider=${provider}/${modelId} attempt=${attempt} maxAttempts=${maxAttempts} pre.messages=${preMetrics.messages} pre.historyTextChars=${preMetrics.historyTextChars} pre.toolResultChars=${preMetrics.toolResultChars} pre.estTokens=${preMetrics.estTokens ?? "unknown"}`);
|
|
70151
|
+
log$7.debug(`[compaction-diag] contributors diagId=${diagId} top=${JSON.stringify(preMetrics.contributors)}`);
|
|
70137
70152
|
}
|
|
70138
70153
|
const compactStartedAt = Date.now();
|
|
70139
70154
|
const result = await compactWithSafetyTimeout(() => session.compact(params.customInstructions));
|
|
@@ -70151,10 +70166,10 @@ async function compactEmbeddedPiSessionDirect(params) {
|
|
|
70151
70166
|
compactedCount: limited.length - session.messages.length,
|
|
70152
70167
|
sessionFile: params.sessionFile
|
|
70153
70168
|
}, hookCtx).catch((hookErr) => {
|
|
70154
|
-
log$
|
|
70169
|
+
log$7.warn(`after_compaction hook failed: ${hookErr}`);
|
|
70155
70170
|
});
|
|
70156
70171
|
const postMetrics = diagEnabled ? summarizeCompactionMessages(session.messages) : void 0;
|
|
70157
|
-
if (diagEnabled && preMetrics && postMetrics) log$
|
|
70172
|
+
if (diagEnabled && preMetrics && postMetrics) log$7.debug(`[compaction-diag] end runId=${runId} sessionKey=${params.sessionKey ?? params.sessionId} diagId=${diagId} trigger=${trigger} provider=${provider}/${modelId} attempt=${attempt} maxAttempts=${maxAttempts} outcome=compacted reason=none durationMs=${Date.now() - compactStartedAt} retrying=false post.messages=${postMetrics.messages} post.historyTextChars=${postMetrics.historyTextChars} post.toolResultChars=${postMetrics.toolResultChars} post.estTokens=${postMetrics.estTokens ?? "unknown"} delta.messages=${postMetrics.messages - preMetrics.messages} delta.historyTextChars=${postMetrics.historyTextChars - preMetrics.historyTextChars} delta.toolResultChars=${postMetrics.toolResultChars - preMetrics.toolResultChars} delta.estTokens=${typeof preMetrics.estTokens === "number" && typeof postMetrics.estTokens === "number" ? postMetrics.estTokens - preMetrics.estTokens : "unknown"}`);
|
|
70158
70173
|
return {
|
|
70159
70174
|
ok: true,
|
|
70160
70175
|
compacted: true,
|
|
@@ -78070,7 +78085,7 @@ async function deliverSessionMaintenanceWarning(params) {
|
|
|
78070
78085
|
return;
|
|
78071
78086
|
}
|
|
78072
78087
|
try {
|
|
78073
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
78088
|
+
const { deliverOutboundPayloads } = await import("./deliver-BZ99UKQq.js").then((n) => n.n);
|
|
78074
78089
|
await deliverOutboundPayloads({
|
|
78075
78090
|
cfg: params.cfg,
|
|
78076
78091
|
channel,
|