@symerian/symi 2.4.4 → 2.5.0

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.
Files changed (117) hide show
  1. package/dist/{agents-D0WIqYlR.js → agents-BEPfMqrg.js} +4 -4
  2. package/dist/{agents.config-DijsN6pE.js → agents.config-D60gMagv.js} +1 -1
  3. package/dist/{agents.config-BJhlUUzn.js → agents.config-DPv-AmZD.js} +1 -1
  4. package/dist/{audio-preflight-C40mKAp7.js → audio-preflight-CPBOQV4I.js} +4 -4
  5. package/dist/{audio-preflight-O3ASWbaG.js → audio-preflight-D02HwB-I.js} +4 -4
  6. package/dist/{auth-choice-CBrZeM8N.js → auth-choice-BeHaRQfM.js} +1 -1
  7. package/dist/{auth-choice-CzrXJoq0.js → auth-choice-CTeG2A5P.js} +1 -1
  8. package/dist/{banner-DBCyc2l3.js → banner-DihS8WHF.js} +1 -1
  9. package/dist/build-info.json +3 -3
  10. package/dist/bundled/boot-md/handler.js +6 -6
  11. package/dist/bundled/session-memory/handler.js +6 -6
  12. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  13. package/dist/{channel-options-CcNcqLfp.js → channel-options-BJphNYiq.js} +1 -1
  14. package/dist/{channel-options-D4b4yiR3.js → channel-options-D2Zf6a2L.js} +1 -1
  15. package/dist/{channel-web-BxgOSVS3.js → channel-web-BnZ6c0_u.js} +1 -1
  16. package/dist/{channels-cli-CH8FgCHM.js → channels-cli-CF9LDCSC.js} +4 -4
  17. package/dist/{channels-cli-DahG1tUQ.js → channels-cli-COMko9mZ.js} +4 -4
  18. package/dist/{chrome-CDJYxX5a.js → chrome-D2SKJnR7.js} +7 -7
  19. package/dist/{chrome-BFekevcE.js → chrome-EyvdASWt.js} +7 -7
  20. package/dist/{cli-xjbQGnY4.js → cli-DXpAHJS4.js} +1 -1
  21. package/dist/{cli-BG5jr57F.js → cli-DYNTJxmZ.js} +1 -1
  22. package/dist/{command-registry-jAjzb3Ub.js → command-registry-X_FmrHib.js} +9 -9
  23. package/dist/{completion-cli-C5YhoKGC.js → completion-cli-D1aObtjM.js} +1 -1
  24. package/dist/{completion-cli-zIGxgk1g.js → completion-cli-Dhj0jCR_.js} +2 -2
  25. package/dist/{config-cli-3hyKITmM.js → config-cli-BDpBT1b-.js} +1 -1
  26. package/dist/{config-cli-CPhmjH-O.js → config-cli-BrmaXVj4.js} +1 -1
  27. package/dist/{configure-C39-I7AH.js → configure-CkCFJCKp.js} +3 -3
  28. package/dist/{configure-S9KIFkj-.js → configure-oMqP6jIk.js} +3 -3
  29. package/dist/{deliver-BH0l3UKW.js → deliver-C-37cZUe.js} +1 -1
  30. package/dist/{deliver-CvCK5Mm9.js → deliver-D1ZN6-fl.js} +1 -1
  31. package/dist/{doctor-completion-DMcB-j3Q.js → doctor-completion-vhqAoURB.js} +1 -1
  32. package/dist/{doctor-completion-DjNFcAWO.js → doctor-completion-wGoyzRH8.js} +1 -1
  33. package/dist/entry.js +1 -1
  34. package/dist/extensionAPI.js +6 -6
  35. package/dist/{gateway-cli-CptbhYJ1.js → gateway-cli-BBPEwiAc.js} +9 -9
  36. package/dist/{gateway-cli-Bwd_To8f.js → gateway-cli-uDuGdJsH.js} +9 -9
  37. package/dist/{glass-ui-ws-B4jT1ok5.js → glass-ui-ws-DiqQflvy.js} +7 -7
  38. package/dist/{glass-ui-ws-B8ap5D2v.js → glass-ui-ws-TCkne4L4.js} +7 -7
  39. package/dist/{health-DhqSQMPI.js → health-1KsVR3eN.js} +1 -1
  40. package/dist/{health-DCb7BG-3.js → health-CPYlV7Zg.js} +1 -1
  41. package/dist/{hooks-cli-D5W9ERxc.js → hooks-cli-CL266d2E.js} +2 -2
  42. package/dist/{hooks-cli-DK2j2rIy.js → hooks-cli-PKy2h3eb.js} +2 -2
  43. package/dist/{image-B0wGflxA.js → image-Cp3JDEBB.js} +1 -1
  44. package/dist/{image-CHzdaNJ4.js → image-DcpMiprB.js} +1 -1
  45. package/dist/index.js +6 -6
  46. package/dist/llm-slug-generator.js +6 -6
  47. package/dist/{models-Bh86hVEJ.js → models-BsS_l1gY.js} +2 -2
  48. package/dist/{models-cli-DNLCTKv1.js → models-cli-CmR7k-2e.js} +2 -2
  49. package/dist/{models-cli-DLEKxIbC.js → models-cli-CvxkLybz.js} +3 -3
  50. package/dist/{onboard-CYMyc_UX.js → onboard-Bgo_BcMo.js} +2 -2
  51. package/dist/{onboard-ey37IWby.js → onboard-D2GpwLzg.js} +2 -2
  52. package/dist/{onboard-channels-Dj_lMj0q.js → onboard-channels-3WFDi7Ts.js} +1 -1
  53. package/dist/{onboard-channels-BmoLkeU6.js → onboard-channels-BNTeFCna.js} +1 -1
  54. package/dist/{onboarding-Dm9fej7n.js → onboarding-BUumoJYB.js} +3 -3
  55. package/dist/{onboarding-DLyAGYc6.js → onboarding-CbkyewZp.js} +3 -3
  56. package/dist/{onboarding.finalize-CEBQJBqF.js → onboarding.finalize-B2_mgA4K.js} +6 -6
  57. package/dist/{onboarding.finalize-csPp9wn_.js → onboarding.finalize-sESCY9Iq.js} +5 -5
  58. package/dist/{pi-embedded-Lrmi4POJ.js → pi-embedded-BIIdwXKr.js} +316 -85
  59. package/dist/{pi-embedded-BUYWm5p1.js → pi-embedded-BOF7XlCO.js} +316 -85
  60. package/dist/{pi-embedded-helpers-lgx_U5KS.js → pi-embedded-helpers-B8kqLWns.js} +4 -4
  61. package/dist/{pi-embedded-helpers-DLFjnVBb.js → pi-embedded-helpers-ag2bosuj.js} +4 -4
  62. package/dist/{plugin-registry-D1vzxXON.js → plugin-registry-BDfC2z-e.js} +1 -1
  63. package/dist/{plugin-registry-ChH5CJIw.js → plugin-registry-IXa-nyg0.js} +1 -1
  64. package/dist/plugin-sdk/agents/output-normalizer.d.ts +69 -0
  65. package/dist/plugin-sdk/{channel-web-DOZ-G9xX.js → channel-web-HznAZS1r.js} +1 -1
  66. package/dist/plugin-sdk/index.js +2 -2
  67. package/dist/plugin-sdk/{reply-BIMkrLWh.js → reply-DpnW-aMb.js} +302 -71
  68. package/dist/plugin-sdk/{web-BsZ7_Dy0.js → web-CGNEXRkp.js} +2 -2
  69. package/dist/{plugins-cli-CCMRc0SH.js → plugins-cli-DAxj0T7n.js} +2 -2
  70. package/dist/{plugins-cli-0PARfFDh.js → plugins-cli-DsYvb9az.js} +2 -2
  71. package/dist/{program-CTvCt90X.js → program-C_UFd0ph.js} +7 -7
  72. package/dist/{program-context-LQmFqAP2.js → program-context-C-1s9IMf.js} +17 -17
  73. package/dist/{prompt-select-styled-M1mZT6zR.js → prompt-select-styled-CYRG7OzR.js} +4 -4
  74. package/dist/{prompt-select-styled-Dk4KU3bk.js → prompt-select-styled-uEjL8GAK.js} +4 -4
  75. package/dist/{provider-auth-helpers-DM1hfi20.js → provider-auth-helpers-CJUiVhCt.js} +1 -1
  76. package/dist/{provider-auth-helpers-CXq_C8eC.js → provider-auth-helpers-CpOR6tLS.js} +1 -1
  77. package/dist/{push-apns-7t_aUx_g.js → push-apns-21LKYvkS.js} +1 -1
  78. package/dist/{push-apns-D-D1fcAb.js → push-apns-Ciljlk7J.js} +1 -1
  79. package/dist/{pw-ai-De-KR9_s.js → pw-ai-1htA-NnS.js} +1 -1
  80. package/dist/{pw-ai-BnAKvSuw.js → pw-ai-Ch7liUOW.js} +1 -1
  81. package/dist/{register.agent-nABNjBav.js → register.agent-BSv7WO-U.js} +6 -6
  82. package/dist/{register.agent-CWwXTRwB.js → register.agent-stsk6Gip.js} +5 -5
  83. package/dist/{register.configure-FljQTqAv.js → register.configure-C8oDtnaI.js} +6 -6
  84. package/dist/{register.configure-CV6utD3b.js → register.configure-DNQTd6SJ.js} +6 -6
  85. package/dist/{register.maintenance-BxRP1viU.js → register.maintenance-B3f3jkUo.js} +7 -7
  86. package/dist/{register.maintenance-CAACXueD.js → register.maintenance-dTI3y4Eh.js} +8 -8
  87. package/dist/{register.message-uz5SnsUO.js → register.message-Cbb4nH_0.js} +2 -2
  88. package/dist/{register.message-D_Cc5Hcu.js → register.message-K9BDeFyy.js} +2 -2
  89. package/dist/{register.onboard-BGsi8HVc.js → register.onboard-BBfmwa3j.js} +4 -4
  90. package/dist/{register.onboard-C8C1xEuj.js → register.onboard-Djz7Di9K.js} +4 -4
  91. package/dist/{register.setup-CbPytgHL.js → register.setup-B6hkCLH0.js} +4 -4
  92. package/dist/{register.setup-CyxXsD-4.js → register.setup-Dmu1jt3n.js} +4 -4
  93. package/dist/{register.status-health-sessions-DW422lcn.js → register.status-health-sessions-CvwhBkbb.js} +3 -3
  94. package/dist/{register.status-health-sessions-B_BYvadL.js → register.status-health-sessions-DaSrMm3l.js} +3 -3
  95. package/dist/{register.subclis-DAEtHKAL.js → register.subclis-Dv1WM9Kj.js} +9 -9
  96. package/dist/{reply-BWno_mxL.js → reply-BvVsPU7v.js} +303 -72
  97. package/dist/{run-main-GCA3ZWtS.js → run-main-55CDVAv6.js} +14 -14
  98. package/dist/{runner-DUBExAb5.js → runner-BcQ0sF9T.js} +1 -1
  99. package/dist/{runner-odEv83vv.js → runner-D0QUGA_X.js} +1 -1
  100. package/dist/{server-methods-C0qS1GBg.js → server-methods-Bf8SpXoW.js} +7 -7
  101. package/dist/{server-methods-BgZzcT_t.js → server-methods-CDDLS3ke.js} +7 -7
  102. package/dist/{server-node-events-BqTGMdx6.js → server-node-events-B9iZK3qE.js} +2 -2
  103. package/dist/{server-node-events-CCfQHLwH.js → server-node-events-Dx0L419d.js} +2 -2
  104. package/dist/{status-uaQ9lnOb.js → status-5XgxbiNb.js} +1 -1
  105. package/dist/{status-C0ghzWRG.js → status-C-kU0UFm.js} +1 -1
  106. package/dist/{status-BzeN5Od7.js → status-C-vthqzQ.js} +2 -2
  107. package/dist/{status-C_eTc_yp.js → status-DEymUALi.js} +2 -2
  108. package/dist/{subagent-registry-CtKDHowr.js → subagent-registry-CZah-77E.js} +303 -72
  109. package/dist/{update-cli-B2AkRDy-.js → update-cli-B21iNb0v.js} +7 -7
  110. package/dist/{update-cli-CYjjpmcv.js → update-cli-BSk-OFnI.js} +8 -8
  111. package/dist/{update-runner-C71_pwI8.js → update-runner-B5bKK21U.js} +1 -1
  112. package/dist/{update-runner-Co1TMSnd.js → update-runner-DPwXk0QQ.js} +1 -1
  113. package/dist/{web-DyULVUaV.js → web-CB23XCVF.js} +2 -2
  114. package/dist/{web-YnBBOOGf.js → web-DSgWG_2m.js} +6 -6
  115. package/dist/{web-DOlZ2V8e.js → web-DVvZ_mDC.js} +6 -6
  116. package/dist/{web-x4zdMRTu.js → web-mkZpWfVs.js} +1 -1
  117. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import "./paths-Cqn-zk3M.js";
2
2
  import { B as theme, S as shortenHomePath } from "./utils-B-0b9bGM.js";
3
3
  import "./thinking-EAliFiVK.js";
4
- import "./reply-BWno_mxL.js";
4
+ import "./reply-BvVsPU7v.js";
5
5
  import "./registry-Cja8eT7G.js";
6
6
  import { f as defaultRuntime } from "./subsystem-D9vIQve0.js";
7
7
  import "./exec-CWkblSrI.js";
@@ -108,8 +108,8 @@ import "./clack-prompter-B7pN13HV.js";
108
108
  import "./daemon-runtime-2mwX-jqj.js";
109
109
  import "./systemd-riq8uNJQ.js";
110
110
  import "./service-Cl74hx8J.js";
111
- import "./health-DhqSQMPI.js";
112
- import "./onboarding-DLyAGYc6.js";
111
+ import "./health-1KsVR3eN.js";
112
+ import "./onboarding-CbkyewZp.js";
113
113
  import "./shared-Knv1hy6h.js";
114
114
  import "./auth-token-BnOynwk4.js";
115
115
  import { n as logConfigUpdated, t as formatConfigPath } from "./logging-BzzwiKjv.js";
@@ -117,7 +117,7 @@ import "./openai-model-default-DMjQRsb1.js";
117
117
  import "./model-picker-Ddo3jHe-.js";
118
118
  import "./systemd-linger-aQ75ZlXY.js";
119
119
  import "./onboard-custom-C7O-zfQ1.js";
120
- import { t as onboardCommand } from "./onboard-ey37IWby.js";
120
+ import { t as onboardCommand } from "./onboard-D2GpwLzg.js";
121
121
  import JSON5 from "json5";
122
122
  import fs from "node:fs/promises";
123
123
 
@@ -14,7 +14,7 @@ import "./client-DMBZpU6X.js";
14
14
  import "./call-BcE47FtD.js";
15
15
  import "./message-channel-C9dERklz.js";
16
16
  import "./pairing-token-Byh6drgn.js";
17
- import "./subagent-registry-CtKDHowr.js";
17
+ import "./subagent-registry-CZah-77E.js";
18
18
  import "./sessions-CJXnZVjR.js";
19
19
  import "./tokens-Csntmwwn.js";
20
20
  import "./plugins-CwSlLxM8.js";
@@ -108,8 +108,8 @@ import "./service-Cm9j9WzQ.js";
108
108
  import "./diagnostics-CS1ov_hH.js";
109
109
  import "./table-D01d2GuY.js";
110
110
  import "./audit-Byo5jCLN.js";
111
- import { n as statusCommand } from "./status-BzeN5Od7.js";
112
- import { r as healthCommand } from "./health-DCb7BG-3.js";
111
+ import { n as statusCommand } from "./status-C-vthqzQ.js";
112
+ import { r as healthCommand } from "./health-CPYlV7Zg.js";
113
113
  import "./update-check-ZdimP1aU.js";
114
114
  import "./dm-policy-shared-DJ-61hCT.js";
115
115
  import "./node-service-fcZExd22.js";
@@ -1,7 +1,7 @@
1
1
  import "./paths-Cqn-zk3M.js";
2
2
  import { B as theme, P as setVerbose, k as info, z as isRich } from "./utils-B-0b9bGM.js";
3
3
  import "./thinking-EAliFiVK.js";
4
- import { m as classifySessionKey, mr as lookupContextTokens, x as resolveSessionModelRef } from "./reply-BWno_mxL.js";
4
+ import { m as classifySessionKey, mr as lookupContextTokens, x as resolveSessionModelRef } from "./reply-BvVsPU7v.js";
5
5
  import { S as parseAgentSessionKey } from "./session-key-DCt45XZa.js";
6
6
  import "./registry-Cja8eT7G.js";
7
7
  import { f as defaultRuntime } from "./subsystem-D9vIQve0.js";
@@ -114,8 +114,8 @@ import "./service-Cl74hx8J.js";
114
114
  import "./diagnostics-BAMlsVVX.js";
115
115
  import "./table-BTgkRafz.js";
116
116
  import "./audit-CrITRV6w.js";
117
- import { t as statusCommand } from "./status-C_eTc_yp.js";
118
- import { r as healthCommand } from "./health-DhqSQMPI.js";
117
+ import { t as statusCommand } from "./status-DEymUALi.js";
118
+ import { r as healthCommand } from "./health-1KsVR3eN.js";
119
119
  import "./update-check-CtckACbb.js";
120
120
  import "./dm-policy-shared-Bh3TbexU.js";
121
121
  import "./node-service-Cxz4e-Qd.js";
@@ -49,7 +49,7 @@ const entries = [
49
49
  description: "Run, inspect, and query the WebSocket Gateway",
50
50
  hasSubcommands: true,
51
51
  register: async (program) => {
52
- (await import("./gateway-cli-CptbhYJ1.js")).registerGatewayCli(program);
52
+ (await import("./gateway-cli-BBPEwiAc.js")).registerGatewayCli(program);
53
53
  }
54
54
  },
55
55
  {
@@ -81,7 +81,7 @@ const entries = [
81
81
  description: "Discover, scan, and configure models",
82
82
  hasSubcommands: true,
83
83
  register: async (program) => {
84
- (await import("./models-cli-DLEKxIbC.js")).registerModelsCli(program);
84
+ (await import("./models-cli-CvxkLybz.js")).registerModelsCli(program);
85
85
  }
86
86
  },
87
87
  {
@@ -161,7 +161,7 @@ const entries = [
161
161
  description: "Manage internal agent hooks",
162
162
  hasSubcommands: true,
163
163
  register: async (program) => {
164
- (await import("./hooks-cli-DK2j2rIy.js")).registerHooksCli(program);
164
+ (await import("./hooks-cli-PKy2h3eb.js")).registerHooksCli(program);
165
165
  }
166
166
  },
167
167
  {
@@ -185,7 +185,7 @@ const entries = [
185
185
  description: "Secure DM pairing (approve inbound requests)",
186
186
  hasSubcommands: true,
187
187
  register: async (program) => {
188
- const { registerPluginCliCommands } = await import("./cli-xjbQGnY4.js");
188
+ const { registerPluginCliCommands } = await import("./cli-DXpAHJS4.js");
189
189
  registerPluginCliCommands(program, await loadConfig());
190
190
  (await import("./pairing-cli-CQRAnpvm.js")).registerPairingCli(program);
191
191
  }
@@ -195,8 +195,8 @@ const entries = [
195
195
  description: "Manage Symi plugins and extensions",
196
196
  hasSubcommands: true,
197
197
  register: async (program) => {
198
- (await import("./plugins-cli-CCMRc0SH.js")).registerPluginsCli(program);
199
- const { registerPluginCliCommands } = await import("./cli-xjbQGnY4.js");
198
+ (await import("./plugins-cli-DAxj0T7n.js")).registerPluginsCli(program);
199
+ const { registerPluginCliCommands } = await import("./cli-DXpAHJS4.js");
200
200
  registerPluginCliCommands(program, await loadConfig());
201
201
  }
202
202
  },
@@ -205,7 +205,7 @@ const entries = [
205
205
  description: "Manage connected chat channels (Telegram, Discord, etc.)",
206
206
  hasSubcommands: true,
207
207
  register: async (program) => {
208
- (await import("./channels-cli-DahG1tUQ.js")).registerChannelsCli(program);
208
+ (await import("./channels-cli-COMko9mZ.js")).registerChannelsCli(program);
209
209
  }
210
210
  },
211
211
  {
@@ -237,7 +237,7 @@ const entries = [
237
237
  description: "Update Symi and inspect update channel status",
238
238
  hasSubcommands: true,
239
239
  register: async (program) => {
240
- (await import("./update-cli-CYjjpmcv.js")).registerUpdateCli(program);
240
+ (await import("./update-cli-BSk-OFnI.js")).registerUpdateCli(program);
241
241
  }
242
242
  },
243
243
  {
@@ -245,7 +245,7 @@ const entries = [
245
245
  description: "Generate shell completion script",
246
246
  hasSubcommands: false,
247
247
  register: async (program) => {
248
- (await import("./completion-cli-zIGxgk1g.js").then((n) => n.n)).registerCompletionCli(program);
248
+ (await import("./completion-cli-Dhj0jCR_.js").then((n) => n.n)).registerCompletionCli(program);
249
249
  }
250
250
  }
251
251
  ];
@@ -109,7 +109,7 @@ import fs$1 from "node:fs/promises";
109
109
  import { execFileSync, spawn, spawnSync } from "node:child_process";
110
110
  import { inspect } from "node:util";
111
111
  import crypto, { createHash, createHmac, randomBytes, randomUUID } from "node:crypto";
112
- import { complete, completeSimple, streamSimple } from "@mariozechner/pi-ai";
112
+ import { complete, completeSimple, createAssistantMessageEventStream, streamSimple } from "@mariozechner/pi-ai";
113
113
  import { CURRENT_SESSION_VERSION, DefaultResourceLoader, SessionManager, SettingsManager, codingTools, createAgentSession, createEditTool, createReadTool, createWriteTool, estimateTokens, generateSummary, readTool } from "@mariozechner/pi-coding-agent";
114
114
  import { createServer } from "node:http";
115
115
  import { ProxyAgent, fetch as fetch$1 } from "undici";
@@ -22862,6 +22862,199 @@ function createCacheTrace(params) {
22862
22862
  };
22863
22863
  }
22864
22864
 
22865
+ //#endregion
22866
+ //#region src/agents/model-token-filter.ts
22867
+ /**
22868
+ * Strips model-specific control tokens from streamed text.
22869
+ *
22870
+ * Used both server-side (in the streaming pipeline) and by the Glass UI
22871
+ * (as a defense-in-depth fallback). The patterns here cover tokens known
22872
+ * to leak from Gemma 4 / vLLM; Claude output is left untouched.
22873
+ */
22874
+ const GEMMA_TOKEN_PATTERNS = [
22875
+ /<\|channel>\w*/g,
22876
+ /<channel\|>/g,
22877
+ /<start_of_turn>(?:model|user)?/g,
22878
+ /<end_of_turn>/g,
22879
+ /<\|(?:fim_prefix|fim_suffix|fim_middle)\|>/g,
22880
+ /^\s*<bos>\s*/gm,
22881
+ /<\|[^|>]{0,30}\|>/g,
22882
+ /<\|[^>]{0,30}>/g
22883
+ ];
22884
+ /**
22885
+ * Aggressively strip all fragments of model control token corruption from
22886
+ * tool arguments. This catches cases where the model produces raw garbage
22887
+ * like `<|<|"|<|<|\'` that doesn't match any known token template.
22888
+ */
22889
+ const AGGRESSIVE_TOKEN_FRAGMENTS = [/<\|/g, /\|>/g];
22890
+ const GEMMA_MODEL_HINTS$1 = ["gemma", "redsand/"];
22891
+ function isGemmaModel$1(modelId) {
22892
+ const lower = modelId.toLowerCase();
22893
+ return GEMMA_MODEL_HINTS$1.some((hint) => lower.includes(hint));
22894
+ }
22895
+ /**
22896
+ * Strip known control tokens from text. Only applies to Gemma-family models;
22897
+ * other models pass through unchanged.
22898
+ */
22899
+ /**
22900
+ * Strip known control tokens from text. Only applies to Gemma-family models;
22901
+ * other models pass through unchanged. Used for streamed text output.
22902
+ */
22903
+ function stripModelTokens(text, modelId) {
22904
+ if (!text || !isGemmaModel$1(modelId)) return text;
22905
+ let result = text;
22906
+ for (const re of GEMMA_TOKEN_PATTERNS) {
22907
+ re.lastIndex = 0;
22908
+ result = result.replace(re, "");
22909
+ }
22910
+ return result;
22911
+ }
22912
+ /**
22913
+ * Aggressively strip ALL token-like fragments from a string. Used for tool
22914
+ * call arguments where any `<|` corruption causes downstream failures.
22915
+ * More aggressive than `stripModelTokens` — removes bare `<|` and `|>` fragments
22916
+ * that don't match any known token template.
22917
+ */
22918
+ function stripModelTokensAggressive(text, modelId) {
22919
+ if (!text || !isGemmaModel$1(modelId)) return text;
22920
+ let result = stripModelTokens(text, modelId);
22921
+ for (const re of AGGRESSIVE_TOKEN_FRAGMENTS) {
22922
+ re.lastIndex = 0;
22923
+ result = result.replace(re, "");
22924
+ }
22925
+ return result;
22926
+ }
22927
+
22928
+ //#endregion
22929
+ //#region src/agents/output-normalizer.ts
22930
+ const MONOLOGUE_REGEX_PATTERNS = [
22931
+ /\n*I have addressed the request fully\.?\s*(?:\n[\s\S]*)?$/,
22932
+ /\n*I[''\u2019]ve reviewed my response[\s\S]*$/,
22933
+ /\n*\*?\*?Verification:?\*?\*?\s*\n[\s\S]*?(?:Everything is correct|All requirements met)\.?\s*\u2705?\s*$/,
22934
+ /\n*\d+\.\s*\*?\*?Requirements:?\*?\*?[\s\S]*?\d+\.\s*\*?\*?Verification:?\*?\*?[\s\S]*$/
22935
+ ];
22936
+ const SELF_REF_OPENERS = [
22937
+ "i have addressed",
22938
+ "i've reviewed",
22939
+ "i‘ve reviewed",
22940
+ "i’ve reviewed",
22941
+ "status check",
22942
+ "address requirements",
22943
+ "verification:",
22944
+ "requirements:"
22945
+ ];
22946
+ const ASSESSMENT_KEYWORDS = [
22947
+ "requirements",
22948
+ "verification",
22949
+ "correct",
22950
+ "addressed",
22951
+ "fulfilled",
22952
+ "confirmed",
22953
+ "passed"
22954
+ ];
22955
+ /**
22956
+ * Layer 2: Structural monologue detection.
22957
+ * Detects a trailing block that:
22958
+ * 1. Starts after a double newline
22959
+ * 2. Opens with a self-referential phrase
22960
+ * 3. Contains a numbered list with assessment keywords
22961
+ * 4. Sits at the end of the text
22962
+ */
22963
+ function detectMonologueStructural(text) {
22964
+ let searchFrom = Math.floor(text.length * .15);
22965
+ while (searchFrom < text.length) {
22966
+ const breakPos = text.indexOf("\n\n", searchFrom);
22967
+ if (breakPos < 0) return null;
22968
+ const trailingBlock = text.slice(breakPos).toLowerCase();
22969
+ if (!SELF_REF_OPENERS.some((opener) => trailingBlock.includes(opener))) {
22970
+ searchFrom = breakPos + 2;
22971
+ continue;
22972
+ }
22973
+ const hasNumberedList = /\d+\.\s/.test(trailingBlock);
22974
+ const hasBoldHeaders = /\*\*\w/.test(trailingBlock);
22975
+ if (!hasNumberedList && !hasBoldHeaders) {
22976
+ searchFrom = breakPos + 2;
22977
+ continue;
22978
+ }
22979
+ if (ASSESSMENT_KEYWORDS.filter((kw) => trailingBlock.includes(kw)).length < 2) {
22980
+ searchFrom = breakPos + 2;
22981
+ continue;
22982
+ }
22983
+ return breakPos;
22984
+ }
22985
+ return null;
22986
+ }
22987
+ /**
22988
+ * Strip monologue from final text using the hierarchy:
22989
+ * Layer 2 (structural) first, Layer 3 (regex) as fallback.
22990
+ * Layer 1 (prompt tuning) happens before the model produces output.
22991
+ */
22992
+ function stripMonologue(text) {
22993
+ const structuralCut = detectMonologueStructural(text);
22994
+ if (structuralCut !== null) {
22995
+ const cleaned = text.slice(0, structuralCut).trim();
22996
+ if (cleaned) return cleaned;
22997
+ }
22998
+ for (const pattern of MONOLOGUE_REGEX_PATTERNS) {
22999
+ const result = text.replace(pattern, "");
23000
+ if (result !== text && result.trim()) return result.trim();
23001
+ }
23002
+ return text;
23003
+ }
23004
+ const DEFAULT_REPETITION_MIN_BLOCK = 150;
23005
+ function detectRepetition(text, minBlock) {
23006
+ if (text.length < minBlock * 2.5) return false;
23007
+ const sampleStart = Math.floor(text.length * .25);
23008
+ const sample = text.slice(sampleStart, sampleStart + minBlock);
23009
+ const searchStart = sampleStart + minBlock;
23010
+ return text.indexOf(sample, searchStart) >= 0;
23011
+ }
23012
+ function sanitizeArgs(args, modelId) {
23013
+ const result = {};
23014
+ for (const [key, value] of Object.entries(args)) if (typeof value === "string") result[key] = stripModelTokensAggressive(value, modelId);
23015
+ else if (Array.isArray(value)) result[key] = value.map((item) => typeof item === "string" ? stripModelTokensAggressive(item, modelId) : item && typeof item === "object" ? sanitizeArgs(item, modelId) : item);
23016
+ else if (value && typeof value === "object") result[key] = sanitizeArgs(value, modelId);
23017
+ else result[key] = value;
23018
+ return result;
23019
+ }
23020
+ /**
23021
+ * Create an output normalizer configured for the given model profile.
23022
+ *
23023
+ * For Claude: passthrough (no stripping, no monologue, no aggressive cleaning).
23024
+ * For Gemma/vLLM: full normalization pipeline.
23025
+ * For unknown: conservative defaults.
23026
+ */
23027
+ function createOutputNormalizer(profile, modelId) {
23028
+ const isGemma = isGemmaModel$1(modelId);
23029
+ const shouldStrip = isGemma || profile.filters.stripPatterns.length > 0;
23030
+ const shouldSuppressMonologue = profile.filters.suppressMonologue;
23031
+ let accumulated = "";
23032
+ return {
23033
+ normalizeTextDelta(delta) {
23034
+ const text = shouldStrip ? stripModelTokens(delta, modelId) : delta;
23035
+ accumulated += text;
23036
+ if (detectRepetition(accumulated, DEFAULT_REPETITION_MIN_BLOCK)) return {
23037
+ text,
23038
+ abort: { reason: "repetition-detected" }
23039
+ };
23040
+ return { text };
23041
+ },
23042
+ normalizeToolArgs(args) {
23043
+ if (!isGemma) return args;
23044
+ return sanitizeArgs(args, modelId);
23045
+ },
23046
+ normalizeFinalText(text) {
23047
+ let result = text;
23048
+ if (shouldStrip) result = stripModelTokens(result, modelId);
23049
+ if (shouldSuppressMonologue) result = stripMonologue(result);
23050
+ return result.trim();
23051
+ },
23052
+ reset() {
23053
+ accumulated = "";
23054
+ }
23055
+ };
23056
+ }
23057
+
22865
23058
  //#endregion
22866
23059
  //#region src/agents/model-aware-stream.ts
22867
23060
  /**
@@ -22873,6 +23066,7 @@ function createCacheTrace(params) {
22873
23066
  */
22874
23067
  function createModelAwareStreamFn(opts) {
22875
23068
  const underlying = opts.baseStreamFn ?? streamSimple;
23069
+ const fullModelId = opts.provider ? `${opts.provider}/${opts.modelId}` : opts.modelId;
22876
23070
  const mergedParams = {
22877
23071
  ...opts.profile.params,
22878
23072
  ...opts.configExtraParams,
@@ -22909,9 +23103,11 @@ function createModelAwareStreamFn(opts) {
22909
23103
  }
22910
23104
  callerOnPayload?.(payload);
22911
23105
  };
23106
+ const normalizer = createOutputNormalizer(opts.profile, fullModelId);
22912
23107
  return (model, context, options) => {
22913
23108
  const callerOnPayload = options?.onPayload;
22914
- return underlying(model, context, {
23109
+ normalizer.reset();
23110
+ const streamOrPromise = underlying(model, context, {
22915
23111
  ...nativeOpts,
22916
23112
  ...options,
22917
23113
  onPayload: (payload) => onPayloadHook(payload, callerOnPayload),
@@ -22920,8 +23116,106 @@ function createModelAwareStreamFn(opts) {
22920
23116
  ...options?.headers
22921
23117
  } } : {}
22922
23118
  });
23119
+ if (streamOrPromise instanceof Promise) return streamOrPromise.then((s) => wrapStreamWithNormalizer(s, normalizer));
23120
+ return wrapStreamWithNormalizer(streamOrPromise, normalizer);
22923
23121
  };
22924
23122
  }
23123
+ /**
23124
+ * Wrap an AssistantMessageEventStream to intercept and normalize events:
23125
+ * - text_delta: strip tokens, detect repetition
23126
+ * - toolcall_end: sanitize tool call arguments
23127
+ * - done: normalize final message text
23128
+ */
23129
+ function wrapStreamWithNormalizer(rawStream, normalizer) {
23130
+ const normalized = createAssistantMessageEventStream();
23131
+ (async () => {
23132
+ try {
23133
+ for await (const event of rawStream) {
23134
+ const processed = normalizeEvent(event, normalizer);
23135
+ if (processed.abort) {
23136
+ normalized.push({
23137
+ type: "error",
23138
+ reason: "aborted",
23139
+ errorMessage: `output-normalizer: ${processed.abort.reason}`,
23140
+ usage: {
23141
+ input: 0,
23142
+ output: 0
23143
+ }
23144
+ });
23145
+ break;
23146
+ }
23147
+ normalized.push(processed.event);
23148
+ }
23149
+ } catch (err) {
23150
+ normalized.push({
23151
+ type: "error",
23152
+ reason: "error",
23153
+ errorMessage: err instanceof Error ? err.message : String(err),
23154
+ usage: {
23155
+ input: 0,
23156
+ output: 0
23157
+ }
23158
+ });
23159
+ }
23160
+ })();
23161
+ return normalized;
23162
+ }
23163
+ function normalizeEvent(event, normalizer) {
23164
+ if (event.type === "text_delta") {
23165
+ const result = normalizer.normalizeTextDelta(event.delta);
23166
+ if (result.abort) return {
23167
+ event,
23168
+ abort: result.abort
23169
+ };
23170
+ if (result.text !== event.delta) return { event: {
23171
+ ...event,
23172
+ delta: result.text
23173
+ } };
23174
+ return { event };
23175
+ }
23176
+ if (event.type === "toolcall_end" && event.toolCall) {
23177
+ const tc = event.toolCall;
23178
+ if (tc.arguments && typeof tc.arguments === "object") {
23179
+ const cleanedArgs = normalizer.normalizeToolArgs(tc.arguments);
23180
+ return { event: {
23181
+ ...event,
23182
+ toolCall: {
23183
+ ...tc,
23184
+ arguments: cleanedArgs
23185
+ }
23186
+ } };
23187
+ }
23188
+ return { event };
23189
+ }
23190
+ if (event.type === "done" && event.message) {
23191
+ const msg = event.message;
23192
+ if (Array.isArray(msg.content)) {
23193
+ let changed = false;
23194
+ const normalizedContent = msg.content.map((block) => {
23195
+ if (block.type === "text" && "text" in block) {
23196
+ const cleaned = normalizer.normalizeFinalText(block.text);
23197
+ if (cleaned !== block.text) {
23198
+ changed = true;
23199
+ return {
23200
+ ...block,
23201
+ text: cleaned
23202
+ };
23203
+ }
23204
+ }
23205
+ return block;
23206
+ });
23207
+ if (changed) return { event: {
23208
+ ...event,
23209
+ message: {
23210
+ ...msg,
23211
+ content: normalizedContent
23212
+ }
23213
+ } };
23214
+ }
23215
+ return { event };
23216
+ }
23217
+ return { event };
23218
+ }
22925
23219
  /** Detect vLLM/Gemma providers by model hints or baseUrl patterns. */
22926
23220
  function isVllmProvider(provider, modelId, config) {
22927
23221
  const lower = `${provider}/${modelId}`.toLowerCase();
@@ -26114,7 +26408,7 @@ function buildSystemPromptReport(params) {
26114
26408
 
26115
26409
  //#endregion
26116
26410
  //#region src/agents/transcript-policy.ts
26117
- const GEMMA_MODEL_HINTS$1 = ["gemma", "redsand/"];
26411
+ const GEMMA_MODEL_HINTS = ["gemma", "redsand/"];
26118
26412
  const MISTRAL_MODEL_HINTS = [
26119
26413
  "mistral",
26120
26414
  "mixtral",
@@ -26143,11 +26437,11 @@ function isAnthropicApi(modelApi, provider) {
26143
26437
  if (modelApi === "anthropic-messages") return true;
26144
26438
  return normalizeProviderId(provider ?? "") === "anthropic";
26145
26439
  }
26146
- function isGemmaModel$1(params) {
26440
+ function isGemmaModel(params) {
26147
26441
  if (normalizeProviderId(params.provider ?? "") === "redsand") return true;
26148
26442
  const modelId = (params.modelId ?? "").toLowerCase();
26149
26443
  if (!modelId) return false;
26150
- return GEMMA_MODEL_HINTS$1.some((hint) => modelId.includes(hint));
26444
+ return GEMMA_MODEL_HINTS.some((hint) => modelId.includes(hint));
26151
26445
  }
26152
26446
  function isMistralModel(params) {
26153
26447
  if (normalizeProviderId(params.provider ?? "") === "mistral") return true;
@@ -26165,7 +26459,7 @@ function resolveTranscriptPolicy(params) {
26165
26459
  provider,
26166
26460
  modelId
26167
26461
  });
26168
- const isGemma = isGemmaModel$1({
26462
+ const isGemma = isGemmaModel({
26169
26463
  provider,
26170
26464
  modelId
26171
26465
  });
@@ -30705,7 +30999,7 @@ async function runAgentTurn(params) {
30705
30999
  function createDefaultDeps() {
30706
31000
  return {
30707
31001
  sendMessageWhatsApp: async (...args) => {
30708
- const { sendMessageWhatsApp } = await import("./web-DyULVUaV.js");
31002
+ const { sendMessageWhatsApp } = await import("./web-CB23XCVF.js");
30709
31003
  return await sendMessageWhatsApp(...args);
30710
31004
  },
30711
31005
  sendMessageTelegram: async (...args) => {
@@ -49136,7 +49430,7 @@ function loadWebLoginQr() {
49136
49430
  return webLoginQrPromise;
49137
49431
  }
49138
49432
  function loadWebChannel() {
49139
- webChannelPromise ??= import("./web-DyULVUaV.js");
49433
+ webChannelPromise ??= import("./web-CB23XCVF.js");
49140
49434
  return webChannelPromise;
49141
49435
  }
49142
49436
  function loadWhatsAppActions() {
@@ -52786,69 +53080,6 @@ function createProcessTool(defaults) {
52786
53080
  }
52787
53081
  const processTool = createProcessTool();
52788
53082
 
52789
- //#endregion
52790
- //#region src/agents/model-token-filter.ts
52791
- /**
52792
- * Strips model-specific control tokens from streamed text.
52793
- *
52794
- * Used both server-side (in the streaming pipeline) and by the Glass UI
52795
- * (as a defense-in-depth fallback). The patterns here cover tokens known
52796
- * to leak from Gemma 4 / vLLM; Claude output is left untouched.
52797
- */
52798
- const GEMMA_TOKEN_PATTERNS = [
52799
- /<\|channel>\w*/g,
52800
- /<channel\|>/g,
52801
- /<start_of_turn>(?:model|user)?/g,
52802
- /<end_of_turn>/g,
52803
- /<\|(?:fim_prefix|fim_suffix|fim_middle)\|>/g,
52804
- /^\s*<bos>\s*/gm,
52805
- /<\|[^|>]{0,30}\|>/g,
52806
- /<\|[^>]{0,30}>/g
52807
- ];
52808
- /**
52809
- * Aggressively strip all fragments of model control token corruption from
52810
- * tool arguments. This catches cases where the model produces raw garbage
52811
- * like `<|<|"|<|<|\'` that doesn't match any known token template.
52812
- */
52813
- const AGGRESSIVE_TOKEN_FRAGMENTS = [/<\|/g, /\|>/g];
52814
- const GEMMA_MODEL_HINTS = ["gemma", "redsand/"];
52815
- function isGemmaModel(modelId) {
52816
- const lower = modelId.toLowerCase();
52817
- return GEMMA_MODEL_HINTS.some((hint) => lower.includes(hint));
52818
- }
52819
- /**
52820
- * Strip known control tokens from text. Only applies to Gemma-family models;
52821
- * other models pass through unchanged.
52822
- */
52823
- /**
52824
- * Strip known control tokens from text. Only applies to Gemma-family models;
52825
- * other models pass through unchanged. Used for streamed text output.
52826
- */
52827
- function stripModelTokens(text, modelId) {
52828
- if (!text || !isGemmaModel(modelId)) return text;
52829
- let result = text;
52830
- for (const re of GEMMA_TOKEN_PATTERNS) {
52831
- re.lastIndex = 0;
52832
- result = result.replace(re, "");
52833
- }
52834
- return result;
52835
- }
52836
- /**
52837
- * Aggressively strip ALL token-like fragments from a string. Used for tool
52838
- * call arguments where any `<|` corruption causes downstream failures.
52839
- * More aggressive than `stripModelTokens` — removes bare `<|` and `|>` fragments
52840
- * that don't match any known token template.
52841
- */
52842
- function stripModelTokensAggressive(text, modelId) {
52843
- if (!text || !isGemmaModel(modelId)) return text;
52844
- let result = stripModelTokens(text, modelId);
52845
- for (const re of AGGRESSIVE_TOKEN_FRAGMENTS) {
52846
- re.lastIndex = 0;
52847
- result = result.replace(re, "");
52848
- }
52849
- return result;
52850
- }
52851
-
52852
53083
  //#endregion
52853
53084
  //#region src/agents/pi-tools.abort.ts
52854
53085
  function throwAbortError() {
@@ -72785,4 +73016,4 @@ async function getReplyFromConfig(ctx, opts, configOverride) {
72785
73016
  }
72786
73017
 
72787
73018
  //#endregion
72788
- export { buildDeliveryFromLegacyPayload as $, textToSpeech as $n, loadAgentIdentityFromWorkspace as $t, emitGatewayRestart as A, countActiveRunsForSession as An, extractFileContentFromSource as Ar, resolveAgentOutboundTarget as At, summarizeRestartSentinel as B, onAgentEvent as Bn, runEmbeddedPiAgent as Bt, ensureOutboundSessionEntry as C, hasControlCommand as Cn, isSystemEventContextChanged as Cr, readJsonBodyWithLimit as Ct, CHANNEL_MESSAGE_ACTION_NAMES as D, buildMentionRegexes as Dn, DEFAULT_INPUT_IMAGE_MIMES as Dr, agentCommand as Dt, resetDirectoryCache as E, stopSubagentsForRequester as En, DEFAULT_INPUT_IMAGE_MAX_BYTES as Er, sleepWithAbort as Et, setPreRestartDeferralCheck as F, runSubagentAnnounceFlow as Fn, resolveAgentTimeoutMs as Fr, createOutboundSendDeps as Ft, normalizeCronJobPatch as G, isTtsProviderConfigured as Gn, runWithModelFallback as Gt, writeRestartSentinel as H, resolveUserTimezone as Hn, getActiveEmbeddedRunCount as Ht, consumeRestartSentinel as I, readLatestAssistantReply as In, normalizeSendPolicy as It, normalizeOptionalSessionKey as J, resolveTtsConfig as Jn, runCliAgent as Jt, inferLegacyName as K, resolveTtsApiKey as Kn, getCliSessionId as Kt, formatDoctorNonInteractiveHint as L, clearAgentRunContext as Ln, resolveSendPolicy as Lt, markGatewaySigusr1RestartHandled as M, listDescendantRunsForRequester as Mn, normalizeMimeList as Mr, resolveHeartbeatSenderContext as Mt, scheduleGatewaySigusr1Restart as N, listSubagentRunsForRequester as Nn, resolveInputFileLimits as Nr, resolveOutboundTarget as Nt, consumeGatewaySigusr1RestartAuthorization as O, normalizeMentionText as On, DEFAULT_INPUT_MAX_REDIRECTS as Or, resolveSessionKeyForRequest as Ot, setGatewaySigusr1RestartPolicy as P, subagent_registry_exports as Pn, estimateBase64DecodedBytes as Pr, resolveSessionDeliveryTarget as Pt, migrateLegacyCronPayload as Q, setTtsProvider as Qn, identityHasValues as Qt, formatRestartSentinelMessage as R, emitAgentEvent as Rn, createDefaultDeps as Rt, runMessageAction as S, formatZonedTimestamp as Sn, enqueueSystemEvent as Sr, handleSlackHttpRequest as St, formatTargetDisplay as T, isAbortTrigger as Tn, peekSystemEvents as Tr, computeBackoff as Tt, normalizeHttpWebhookUrl as U, getTtsProvider as Un, waitForEmbeddedPiRunEnd as Ut, trimLogTail as V, registerAgentRunContext as Vn, abortEmbeddedPiRun as Vt, normalizeCronJobCreate as W, isTtsEnabled as Wn, resolveModelProfile as Wt, normalizePayloadToSystemText as X, resolveTtsProviderOrder as Xn, describeFailoverError as Xt, normalizeOptionalText as Y, resolveTtsPrefsPath as Yn, sha256HexPrefix as Yt, normalizeRequiredName as Z, setTtsEnabled as Zn, resolveAgentAvatar as Zt, loadCombinedSessionStoreForGateway as _, createDedupeCache as _n, buildAuthHealthSummary as _r, loadProviderUsageSummary as _t, buildChannelSummary as a, unbindThreadBindingsBySessionKey as an, resetAllLanes as ar, persistBrowserProxyFiles as at, resolveGatewaySessionStoreTarget as b, formatInboundEnvelope as bn, applyVerboseOverride as br, resolveUsageProviderId as bt, clearSessionQueues as c, DEFAULT_GROUP_HISTORY_LIMIT as cn, CommandLane as cr, requestHeartbeatNow as ct, createSymiTools as d, shouldAckReactionForWhatsApp as dn, isHeartbeatContentEffectivelyEmpty as dr, getPluginToolMeta as dt, parseIdentityMarkdown as en, OPENAI_TTS_MODELS as er, hasLegacyDeliveryHints as et, resolveAnnounceTargetFromKey as f, dispatchReplyWithBufferedBlockDispatcher as fn, resolveHeartbeatPrompt as fr, createPluginLoaderLogger as ft, listSessionsFromStore as g, getTotalPendingReplies as gn, DEFAULT_OAUTH_WARN_MS as gr, parseActivationCommand as gt, listAgentsForGateway as h, createReplyDispatcher as hn, maskApiKey as hr, normalizeGroupActivation as ht, resolveCronStyleNow as i, isExternalHookSession as in, getTotalQueueSize as ir, applyBrowserProxyPaths as it, isGatewaySigusr1RestartExternallyAllowed as j, initSubagentRegistry as jn, extractImageContentFromSource as jr, resolveHeartbeatDeliveryTarget as jt, deferGatewayRestartUntilIdle as k, countActiveDescendantRuns as kn, DEFAULT_INPUT_TIMEOUT_MS as kr, resolveAgentDeliveryPlan as kt, applyToolPolicyPipeline as l, buildHistoryContextFromEntries as ln, DEFAULT_HEARTBEAT_ACK_MAX_CHARS as lr, setHeartbeatWakeHandler as lt, classifySessionKey as m, dispatchInboundMessage as mn, lookupContextTokens as mr, deleteTelegramUpdateOffset as mt, BARE_SESSION_RESET_PROMPT as n, detectSuspiciousPatterns as nn, getActiveTaskCount as nr, CHANNEL_TARGETS_DESCRIPTION as nt, buildChannelAccountSnapshot as o, buildPairingReply as on, setCommandLaneConcurrency as or, sniffMimeFromBase64 as ot, canonicalizeSpawnedByForAgent as p, provider_dispatcher_exports as pn, stripHeartbeatToken as pr, loadSymiPlugins as pt, normalizeOptionalAgentId as q, resolveTtsAutoMode as qn, setCliSessionId as qt, appendCronStyleCurrentTimeLine as r, getHookType as rn, getQueueSize as rr, CHANNEL_TARGET_DESCRIPTION as rt, formatChannelAllowFrom as s, resolveMentionGating as sn, waitForActiveTasks as sr, stripModelTokens as st, getReplyFromConfig as t, buildSafeExternalPrompt as tn, OPENAI_TTS_VOICES as tr, stripLegacyDeliveryFields as tt, buildDefaultToolPolicyPipelineSteps as u, recordPendingHistoryEntryIfEnabled as un, DEFAULT_HEARTBEAT_EVERY as ur, resolveHeartbeatReasonKind as ut, loadSessionEntry as v, createInboundDebouncer as vn, formatRemainingShort as vr, formatUsageReportLines as vt, resolveOutboundSessionRoute as w, shouldComputeCommandAuthorized as wn, peekSystemEventEntries as wr, requestBodyErrorToText as wt, resolveSessionModelRef as x, resolveEnvelopeFormatOptions as xn, parseVerboseOverride as xr, resolveCommitHash as xt, pruneLegacyStoreKeys as y, resolveInboundDebounceMs as yn, applyModelOverrideToSessionEntry as yr, formatUsageWindowSummary as yt, readRestartSentinel as z, getAgentRunContext as zn, createOutboundSendDeps$1 as zt };
73019
+ export { buildDeliveryFromLegacyPayload as $, textToSpeech as $n, loadAgentIdentityFromWorkspace as $t, emitGatewayRestart as A, countActiveRunsForSession as An, extractFileContentFromSource as Ar, resolveHeartbeatDeliveryTarget as At, summarizeRestartSentinel as B, onAgentEvent as Bn, abortEmbeddedPiRun as Bt, ensureOutboundSessionEntry as C, hasControlCommand as Cn, isSystemEventContextChanged as Cr, requestBodyErrorToText as Ct, CHANNEL_MESSAGE_ACTION_NAMES as D, buildMentionRegexes as Dn, DEFAULT_INPUT_IMAGE_MIMES as Dr, resolveSessionKeyForRequest as Dt, resetDirectoryCache as E, stopSubagentsForRequester as En, DEFAULT_INPUT_IMAGE_MAX_BYTES as Er, agentCommand as Et, setPreRestartDeferralCheck as F, runSubagentAnnounceFlow as Fn, resolveAgentTimeoutMs as Fr, normalizeSendPolicy as Ft, normalizeCronJobPatch as G, isTtsProviderConfigured as Gn, runWithModelFallback as Gt, writeRestartSentinel as H, resolveUserTimezone as Hn, waitForEmbeddedPiRunEnd as Ht, consumeRestartSentinel as I, readLatestAssistantReply as In, resolveSendPolicy as It, normalizeOptionalSessionKey as J, resolveTtsConfig as Jn, runCliAgent as Jt, inferLegacyName as K, resolveTtsApiKey as Kn, getCliSessionId as Kt, formatDoctorNonInteractiveHint as L, clearAgentRunContext as Ln, createDefaultDeps as Lt, markGatewaySigusr1RestartHandled as M, listDescendantRunsForRequester as Mn, normalizeMimeList as Mr, resolveOutboundTarget as Mt, scheduleGatewaySigusr1Restart as N, listSubagentRunsForRequester as Nn, resolveInputFileLimits as Nr, resolveSessionDeliveryTarget as Nt, consumeGatewaySigusr1RestartAuthorization as O, normalizeMentionText as On, DEFAULT_INPUT_MAX_REDIRECTS as Or, resolveAgentDeliveryPlan as Ot, setGatewaySigusr1RestartPolicy as P, subagent_registry_exports as Pn, estimateBase64DecodedBytes as Pr, createOutboundSendDeps as Pt, migrateLegacyCronPayload as Q, setTtsProvider as Qn, identityHasValues as Qt, formatRestartSentinelMessage as R, emitAgentEvent as Rn, createOutboundSendDeps$1 as Rt, runMessageAction as S, formatZonedTimestamp as Sn, enqueueSystemEvent as Sr, readJsonBodyWithLimit as St, formatTargetDisplay as T, isAbortTrigger as Tn, peekSystemEvents as Tr, sleepWithAbort as Tt, normalizeHttpWebhookUrl as U, getTtsProvider as Un, stripModelTokens as Ut, trimLogTail as V, registerAgentRunContext as Vn, getActiveEmbeddedRunCount as Vt, normalizeCronJobCreate as W, isTtsEnabled as Wn, resolveModelProfile as Wt, normalizePayloadToSystemText as X, resolveTtsProviderOrder as Xn, describeFailoverError as Xt, normalizeOptionalText as Y, resolveTtsPrefsPath as Yn, sha256HexPrefix as Yt, normalizeRequiredName as Z, setTtsEnabled as Zn, resolveAgentAvatar as Zt, loadCombinedSessionStoreForGateway as _, createDedupeCache as _n, buildAuthHealthSummary as _r, formatUsageReportLines as _t, buildChannelSummary as a, unbindThreadBindingsBySessionKey as an, resetAllLanes as ar, persistBrowserProxyFiles as at, resolveGatewaySessionStoreTarget as b, formatInboundEnvelope as bn, applyVerboseOverride as br, resolveCommitHash as bt, clearSessionQueues as c, DEFAULT_GROUP_HISTORY_LIMIT as cn, CommandLane as cr, setHeartbeatWakeHandler as ct, createSymiTools as d, shouldAckReactionForWhatsApp as dn, isHeartbeatContentEffectivelyEmpty as dr, createPluginLoaderLogger as dt, parseIdentityMarkdown as en, OPENAI_TTS_MODELS as er, hasLegacyDeliveryHints as et, resolveAnnounceTargetFromKey as f, dispatchReplyWithBufferedBlockDispatcher as fn, resolveHeartbeatPrompt as fr, loadSymiPlugins as ft, listSessionsFromStore as g, getTotalPendingReplies as gn, DEFAULT_OAUTH_WARN_MS as gr, loadProviderUsageSummary as gt, listAgentsForGateway as h, createReplyDispatcher as hn, maskApiKey as hr, parseActivationCommand as ht, resolveCronStyleNow as i, isExternalHookSession as in, getTotalQueueSize as ir, applyBrowserProxyPaths as it, isGatewaySigusr1RestartExternallyAllowed as j, initSubagentRegistry as jn, extractImageContentFromSource as jr, resolveHeartbeatSenderContext as jt, deferGatewayRestartUntilIdle as k, countActiveDescendantRuns as kn, DEFAULT_INPUT_TIMEOUT_MS as kr, resolveAgentOutboundTarget as kt, applyToolPolicyPipeline as l, buildHistoryContextFromEntries as ln, DEFAULT_HEARTBEAT_ACK_MAX_CHARS as lr, resolveHeartbeatReasonKind as lt, classifySessionKey as m, dispatchInboundMessage as mn, lookupContextTokens as mr, normalizeGroupActivation as mt, BARE_SESSION_RESET_PROMPT as n, detectSuspiciousPatterns as nn, getActiveTaskCount as nr, CHANNEL_TARGETS_DESCRIPTION as nt, buildChannelAccountSnapshot as o, buildPairingReply as on, setCommandLaneConcurrency as or, sniffMimeFromBase64 as ot, canonicalizeSpawnedByForAgent as p, provider_dispatcher_exports as pn, stripHeartbeatToken as pr, deleteTelegramUpdateOffset as pt, normalizeOptionalAgentId as q, resolveTtsAutoMode as qn, setCliSessionId as qt, appendCronStyleCurrentTimeLine as r, getHookType as rn, getQueueSize as rr, CHANNEL_TARGET_DESCRIPTION as rt, formatChannelAllowFrom as s, resolveMentionGating as sn, waitForActiveTasks as sr, requestHeartbeatNow as st, getReplyFromConfig as t, buildSafeExternalPrompt as tn, OPENAI_TTS_VOICES as tr, stripLegacyDeliveryFields as tt, buildDefaultToolPolicyPipelineSteps as u, recordPendingHistoryEntryIfEnabled as un, DEFAULT_HEARTBEAT_EVERY as ur, getPluginToolMeta as ut, loadSessionEntry as v, createInboundDebouncer as vn, formatRemainingShort as vr, formatUsageWindowSummary as vt, resolveOutboundSessionRoute as w, shouldComputeCommandAuthorized as wn, peekSystemEventEntries as wr, computeBackoff as wt, resolveSessionModelRef as x, resolveEnvelopeFormatOptions as xn, parseVerboseOverride as xr, handleSlackHttpRequest as xt, pruneLegacyStoreKeys as y, resolveInboundDebounceMs as yn, applyModelOverrideToSessionEntry as yr, resolveUsageProviderId as yt, readRestartSentinel as z, getAgentRunContext as zn, runEmbeddedPiAgent as zt };