@symerian/symi 2.5.1 → 2.5.2

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 (170) hide show
  1. package/dist/{agents-Cf7lxbx4.js → agents-DfyzZKBc.js} +4 -4
  2. package/dist/{agents.config-CsltNAhl.js → agents.config-Dzr8Us0l.js} +1 -1
  3. package/dist/{agents.config-aAHTt-cM.js → agents.config-VjZQr5GP.js} +1 -1
  4. package/dist/{audio-preflight-CPBOQV4I.js → audio-preflight-C40mKAp7.js} +4 -4
  5. package/dist/{auth-choice-Cy78Q2jy.js → auth-choice-BJPRC23V.js} +1 -1
  6. package/dist/{auth-choice-wU5fEl73.js → auth-choice-C01glnpg.js} +1 -1
  7. package/dist/{banner-BRzyFiIY.js → banner-B4wP-CCZ.js} +1 -1
  8. package/dist/build-info.json +3 -3
  9. package/dist/bundled/boot-md/handler.js +1 -1
  10. package/dist/bundled/session-memory/handler.js +1 -1
  11. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  12. package/dist/{channel-options-up8R2ST5.js → channel-options-Bb2WRpn4.js} +1 -1
  13. package/dist/{channel-options-BcCKOiwh.js → channel-options-DRK05uet.js} +1 -1
  14. package/dist/{channel-web-CrH0yvww.js → channel-web-Cv1L-jTo.js} +1 -1
  15. package/dist/{channels-cli-BiHu6J16.js → channels-cli-CPvaBiNE.js} +4 -4
  16. package/dist/{channels-cli-DG3sTlC7.js → channels-cli-Dnwswsi2.js} +4 -4
  17. package/dist/{chrome-D2SKJnR7.js → chrome-CDJYxX5a.js} +7 -7
  18. package/dist/{cli-YBkGYxfg.js → cli-CgQySW2m.js} +1 -1
  19. package/dist/{cli-BUkGaPzi.js → cli-hT0g_Q65.js} +1 -1
  20. package/dist/{command-registry-YX9EbrJh.js → command-registry-D7MjQKMD.js} +9 -9
  21. package/dist/{completion-cli-DZf03KrT.js → completion-cli-BLYlpN4p.js} +1 -1
  22. package/dist/{completion-cli-Cm8iWdRA.js → completion-cli-Bcv09Yuh.js} +2 -2
  23. package/dist/{config-cli-1PDMhq8v.js → config-cli-CIkKTucr.js} +1 -1
  24. package/dist/{config-cli-Dx3mtUwm.js → config-cli-CtKkpyHu.js} +1 -1
  25. package/dist/{configure-DZn4tz03.js → configure-BP4M7T_e.js} +3 -3
  26. package/dist/{configure-DKN7f4VI.js → configure-Bhm7x3Ri.js} +3 -3
  27. package/dist/{deliver-C-37cZUe.js → deliver-BH0l3UKW.js} +1 -1
  28. package/dist/{doctor-completion--aLGEAgK.js → doctor-completion-DVs_xVw4.js} +1 -1
  29. package/dist/{doctor-completion-D4SLAoAE.js → doctor-completion-bTUb2Em4.js} +1 -1
  30. package/dist/entry.js +1 -1
  31. package/dist/extensionAPI.js +6 -6
  32. package/dist/{gateway-cli-ZbqwB66o.js → gateway-cli-BPf1OUhU.js} +9 -9
  33. package/dist/{gateway-cli-CMVvut5c.js → gateway-cli-CY_R8dGA.js} +9 -9
  34. package/dist/{glass-ui-ws-Bg6ek2Vs.js → glass-ui-ws-Cx9mt64o.js} +7 -7
  35. package/dist/{glass-ui-ws-Cykb9Xv4.js → glass-ui-ws-DMQldmwk.js} +7 -7
  36. package/dist/{health-BMKu3MJz.js → health-CM3gPoYN.js} +1 -1
  37. package/dist/{health-CGoPVhko.js → health-vuMM-FAs.js} +1 -1
  38. package/dist/{hooks-cli-CFtgfZBU.js → hooks-cli-B8kuyvML.js} +2 -2
  39. package/dist/{hooks-cli-CQUjUbF8.js → hooks-cli-tLOOQscu.js} +2 -2
  40. package/dist/{image-DcpMiprB.js → image-CHzdaNJ4.js} +1 -1
  41. package/dist/index.js +6 -6
  42. package/dist/llm-slug-generator.js +1 -1
  43. package/dist/{models-BPJ5Z5tU.js → models-CBtd5YaQ.js} +2 -2
  44. package/dist/{models-cli-D9miPqtu.js → models-cli-B8Fq0Of1.js} +2 -2
  45. package/dist/{models-cli-I7FIJUNa.js → models-cli-CIp8mElS.js} +3 -3
  46. package/dist/{onboard-CCZ5n-rI.js → onboard-CjSHwvTP.js} +2 -2
  47. package/dist/{onboard-BU6-iBln.js → onboard-DBCSZwxu.js} +2 -2
  48. package/dist/{onboard-channels-CaRYhl9J.js → onboard-channels-BgMpB9vX.js} +1 -1
  49. package/dist/{onboard-channels-B188R3F1.js → onboard-channels-eCCJophA.js} +1 -1
  50. package/dist/{onboarding-CNgU4kg8.js → onboarding-3iCiOVeb.js} +3 -3
  51. package/dist/{onboarding-Gsj-iMyY.js → onboarding-ztTrPGQa.js} +3 -3
  52. package/dist/{onboarding.finalize-C64KHESC.js → onboarding.finalize-DsOBEKtX.js} +6 -6
  53. package/dist/{onboarding.finalize-BvPgcu7R.js → onboarding.finalize-bcSfd4yw.js} +5 -5
  54. package/dist/{pi-embedded-DXSWVPEZ.js → pi-embedded-Ch-LcMWg.js} +107 -2
  55. package/dist/{pi-embedded-RoXbo73e.js → pi-embedded-CpI5F8DC.js} +121 -16
  56. package/dist/{pi-embedded-helpers-B8kqLWns.js → pi-embedded-helpers-lgx_U5KS.js} +4 -4
  57. package/dist/{plugin-registry-dNrBrnR0.js → plugin-registry-BfqJjw6d.js} +1 -1
  58. package/dist/{plugin-registry-ByLEBcK_.js → plugin-registry-CL--iTFl.js} +1 -1
  59. package/dist/plugin-sdk/{accounts-BtaOa4z_.js → accounts-BToL3HlP.js} +1 -1
  60. package/dist/plugin-sdk/{accounts-Ddm33hQm.js → accounts-D9zGZU5t.js} +3 -3
  61. package/dist/plugin-sdk/{accounts-s-AdhXVR.js → accounts-Dtszw3Zn.js} +1 -1
  62. package/dist/plugin-sdk/{active-listener-BXYeALs0.js → active-listener-bEk__wbB.js} +1 -1
  63. package/dist/plugin-sdk/{agent-scope-CYYpcO9W.js → agent-scope-C3gMMKCU.js} +2 -2
  64. package/dist/plugin-sdk/agents/session-version.d.ts +48 -0
  65. package/dist/plugin-sdk/{api-key-rotation-D_sMvI5W.js → api-key-rotation-CVBMpnPc.js} +1 -1
  66. package/dist/plugin-sdk/{audio-preflight-VpItkiy3.js → audio-preflight-DoQQKlxa.js} +24 -24
  67. package/dist/plugin-sdk/{bindings-C7hRtgYW.js → bindings-BbwoUGPx.js} +2 -2
  68. package/dist/plugin-sdk/{channel-activity-DoC1xtDu.js → channel-activity-Ji7f0gqq.js} +1 -1
  69. package/dist/plugin-sdk/{channel-web-Dn3ufSyq.js → channel-web-mO5qO05p.js} +22 -22
  70. package/dist/plugin-sdk/{chrome-B7RdxmJ0.js → chrome-C7c_0I5M.js} +3 -3
  71. package/dist/plugin-sdk/{chunk-Dw2XBYXv.js → chunk-jvk9axTQ.js} +1 -1
  72. package/dist/plugin-sdk/{command-format-GKSevep4.js → command-format-DSdvQ_M5.js} +1 -1
  73. package/dist/plugin-sdk/{commands-registry-COIaslGl.js → commands-registry-CQFbmUMs.js} +4 -4
  74. package/dist/plugin-sdk/{config-KlTNfkFF.js → config-DDkdiUOR.js} +9 -9
  75. package/dist/plugin-sdk/{deliver-BZ99UKQq.js → deliver-BZ6iNLl7.js} +10 -10
  76. package/dist/plugin-sdk/{diagnostic-05pm5Rxi.js → diagnostic-mFf4i4G9.js} +1 -1
  77. package/dist/plugin-sdk/{image-CLOPx7yW.js → image-BOYy0Ump.js} +4 -4
  78. package/dist/plugin-sdk/{image-ops-BlQR__MN.js → image-ops-Bnp6LXEx.js} +1 -1
  79. package/dist/plugin-sdk/index.js +53 -53
  80. package/dist/plugin-sdk/{ir-BJ6BHE5b.js → ir-Fb3qpcis.js} +4 -4
  81. package/dist/plugin-sdk/{local-roots-BHLNSI8U.js → local-roots-Ckk1QfzI.js} +3 -3
  82. package/dist/plugin-sdk/{login-DQMXuxOk.js → login-Bh3DZPam.js} +7 -7
  83. package/dist/plugin-sdk/{login-qr-BjVZSoCi.js → login-qr-DbR7odSr.js} +9 -9
  84. package/dist/plugin-sdk/{manager-CBSBFuFz.js → manager-DckktAQ3.js} +8 -8
  85. package/dist/plugin-sdk/{manifest-registry-CPnHl_K3.js → manifest-registry-B3ugY9-f.js} +1 -1
  86. package/dist/plugin-sdk/{markdown-tables-BoYFajMu.js → markdown-tables-Dfaqilz6.js} +1 -1
  87. package/dist/plugin-sdk/{message-channel-COTAJzHd.js → message-channel-BdI5Ra9S.js} +1 -1
  88. package/dist/plugin-sdk/{model-selection-CsbEfrS0.js → model-selection-OpU8HN50.js} +4 -4
  89. package/dist/plugin-sdk/{outbound-attachment-CnslKL38.js → outbound-attachment-DnVQfTG2.js} +2 -2
  90. package/dist/plugin-sdk/{outbound-B0e8KdaR.js → outbound-rF6G8Xpr.js} +7 -7
  91. package/dist/plugin-sdk/{pi-auth-json-qWi7ZIYV.js → pi-auth-json-CJk8t14T.js} +5 -5
  92. package/dist/plugin-sdk/{pi-embedded-helpers-CW630epe.js → pi-embedded-helpers-BveUP4hk.js} +17 -17
  93. package/dist/plugin-sdk/{plugins-BNByVCIH.js → plugins-BbAvhC25.js} +4 -4
  94. package/dist/plugin-sdk/{pw-ai-CnbPIPY9.js → pw-ai-DjGUsee-.js} +8 -8
  95. package/dist/plugin-sdk/{qmd-manager-CH0XbIHf.js → qmd-manager-mjKcdwVr.js} +4 -4
  96. package/dist/plugin-sdk/{registry-D0xTnUWt.js → registry--_pGht6S.js} +2 -2
  97. package/dist/plugin-sdk/{replies-LLcQL3w6.js → replies-fI39rPGa.js} +3 -3
  98. package/dist/plugin-sdk/{reply-DqjPcp_q.js → reply-B4uPw1l4.js} +183 -78
  99. package/dist/plugin-sdk/{reply-prefix-uxfMZW4p.js → reply-prefix-BHuV5t70.js} +1 -1
  100. package/dist/plugin-sdk/{resolve-outbound-target-BiyAyTWz.js → resolve-outbound-target-BkCUbYGV.js} +2 -2
  101. package/dist/plugin-sdk/{resolve-route-B3CCBumQ.js → resolve-route-D3JH_D2N.js} +3 -3
  102. package/dist/plugin-sdk/{retry-CwQ_iIj8.js → retry-ilSJqnz9.js} +1 -1
  103. package/dist/plugin-sdk/{runner-CGBT7tgF.js → runner-BVqnEfNe.js} +9 -9
  104. package/dist/plugin-sdk/{send-C5h_YxNb.js → send-BHbXh8Ly.js} +7 -7
  105. package/dist/plugin-sdk/{send-pYqe432l.js → send-BMfJIhCk.js} +6 -6
  106. package/dist/plugin-sdk/{send-B2CEnVLL.js → send-BtANzsAo.js} +6 -6
  107. package/dist/plugin-sdk/{send-CjOBB3Vo.js → send-Bxdu6ZZy.js} +10 -10
  108. package/dist/plugin-sdk/{send-CRsR8-vO.js → send-D6LMZJ_h.js} +10 -10
  109. package/dist/plugin-sdk/{session-BsOrxiMj.js → session-kI0tzViQ.js} +4 -4
  110. package/dist/plugin-sdk/{skill-commands-ff_01_r3.js → skill-commands-DCNXVERE.js} +5 -5
  111. package/dist/plugin-sdk/{skills-_yTP47Cd.js → skills-B1GeRYlu.js} +7 -7
  112. package/dist/plugin-sdk/{sqlite-CxAR5ttJ.js → sqlite-Cq_7Cg4E.js} +1 -1
  113. package/dist/plugin-sdk/{store-BdrNabcU.js → store-Do3t33-c.js} +2 -2
  114. package/dist/plugin-sdk/{subsystem-B2uDN3TV.js → subsystem-Coz2AgU8.js} +1 -1
  115. package/dist/plugin-sdk/{tables-DNwXwNFa.js → tables-DR0NmBeH.js} +1 -1
  116. package/dist/plugin-sdk/{target-errors-Paro1BjP.js → target-errors-B7YyMnIi.js} +2 -2
  117. package/dist/plugin-sdk/{thinking-CXqf7WTe.js → thinking-DCNUIAHY.js} +5 -5
  118. package/dist/plugin-sdk/{tokens-bC3UVmVH.js → tokens-CWMflosr.js} +1 -1
  119. package/dist/plugin-sdk/{tool-images-HJ2sfZDV.js → tool-images-D7Lno-TE.js} +2 -2
  120. package/dist/plugin-sdk/{tool-loop-detection-BVA6fax-.js → tool-loop-detection-edmW8ZiF.js} +2 -2
  121. package/dist/plugin-sdk/web-BkEJ_MjB.js +65 -0
  122. package/dist/plugin-sdk/{whatsapp-actions-DfseosPO.js → whatsapp-actions-CcBzDuL-.js} +21 -21
  123. package/dist/{plugins-cli-BJRG_tkQ.js → plugins-cli-DVLIR6IN.js} +2 -2
  124. package/dist/{plugins-cli-DPaKpbZ0.js → plugins-cli-MaXVJ6uV.js} +2 -2
  125. package/dist/{program-context-27mCl36z.js → program-context-C0vN6LYk.js} +17 -17
  126. package/dist/{program-DCyh129g.js → program-v4cRnLjP.js} +7 -7
  127. package/dist/{prompt-select-styled-JUdZMeZI.js → prompt-select-styled-CEmtUvNV.js} +4 -4
  128. package/dist/{prompt-select-styled-kpNeUDud.js → prompt-select-styled-D48W5rxp.js} +4 -4
  129. package/dist/{provider-auth-helpers-DyW_7UGQ.js → provider-auth-helpers-C4-EqP9W.js} +1 -1
  130. package/dist/{provider-auth-helpers-C9GRYN-o.js → provider-auth-helpers-CPbCxhvj.js} +1 -1
  131. package/dist/{push-apns-DSpV-UMg.js → push-apns-DpdcOumU.js} +1 -1
  132. package/dist/{push-apns-CZw1UMXk.js → push-apns-glbAu-g9.js} +1 -1
  133. package/dist/{pw-ai-1htA-NnS.js → pw-ai-De-KR9_s.js} +1 -1
  134. package/dist/{register.agent-B7jOO00w.js → register.agent-2jRwf1Rt.js} +5 -5
  135. package/dist/{register.agent-Dt-fGSRM.js → register.agent-DrocnT2d.js} +6 -6
  136. package/dist/{register.configure-BB1NVcZv.js → register.configure-DULdexW6.js} +6 -6
  137. package/dist/{register.configure-B4ssKdGP.js → register.configure-yy5Qb8fJ.js} +6 -6
  138. package/dist/{register.maintenance-ICQUl02l.js → register.maintenance-CI3D-c8a.js} +8 -8
  139. package/dist/{register.maintenance-B6JGjudV.js → register.maintenance-v_G9yCLf.js} +7 -7
  140. package/dist/{register.message-BEP0P-gF.js → register.message-DkwXioit.js} +2 -2
  141. package/dist/{register.message-B-hq0-gd.js → register.message-UoA7D74J.js} +2 -2
  142. package/dist/{register.onboard-Dgsu5_C8.js → register.onboard-D3qTCyiW.js} +4 -4
  143. package/dist/{register.onboard-CrgzRM5X.js → register.onboard-DFe3IAjB.js} +4 -4
  144. package/dist/{register.setup-B3pPkZ-g.js → register.setup-DO3vwGHY.js} +4 -4
  145. package/dist/{register.setup-C8xPuOMY.js → register.setup-DXT4OS3N.js} +4 -4
  146. package/dist/{register.status-health-sessions-DzM7DkCi.js → register.status-health-sessions-C5IRI7-t.js} +3 -3
  147. package/dist/{register.status-health-sessions-RqNzd4Pm.js → register.status-health-sessions-DGLfWuS4.js} +3 -3
  148. package/dist/{register.subclis-DcJgaLOK.js → register.subclis-PQ2Ulz3J.js} +9 -9
  149. package/dist/{reply-DiFKjgpz.js → reply-kuehpmXb.js} +107 -2
  150. package/dist/{run-main-Ck0iMwKh.js → run-main-BHKGY1KH.js} +14 -14
  151. package/dist/{runner-BcQ0sF9T.js → runner-DUBExAb5.js} +1 -1
  152. package/dist/{server-methods-pP1Q9SDn.js → server-methods-BHjqwsiI.js} +7 -7
  153. package/dist/{server-methods-CBQha8Aw.js → server-methods-rmWST_iV.js} +7 -7
  154. package/dist/{server-node-events-aW9AFIXA.js → server-node-events-KVX4S5Md.js} +2 -2
  155. package/dist/{server-node-events-CfY2QTYr.js → server-node-events-za7_iA-n.js} +2 -2
  156. package/dist/{status-iwhTBXbZ.js → status-BJITmlhZ.js} +2 -2
  157. package/dist/{status-DYp8kqmj.js → status-Bow6kS56.js} +2 -2
  158. package/dist/{status-BKc593Qu.js → status-CRuOmtVo.js} +1 -1
  159. package/dist/{status-BNOqNwMY.js → status-DJhmJYSu.js} +1 -1
  160. package/dist/{subagent-registry-yBrXpTO-.js → subagent-registry-BxM7J5m6.js} +107 -2
  161. package/dist/{update-cli-B8lS5-Z5.js → update-cli-BfGdSZRk.js} +8 -8
  162. package/dist/{update-cli-Cma87YH0.js → update-cli-Dqh498qQ.js} +7 -7
  163. package/dist/{update-runner-DZmjPgW-.js → update-runner-C0iELmzo.js} +1 -1
  164. package/dist/{update-runner-Cx6XjioC.js → update-runner-YRJPtj9J.js} +1 -1
  165. package/dist/{web-C5liFFox.js → web-9AS0DiSZ.js} +1 -1
  166. package/dist/{web-CycbZoQb.js → web-CVAyVZBT.js} +2 -2
  167. package/dist/{web-BWuN3c4n.js → web-CubghJNN.js} +1 -1
  168. package/dist/{web-B9ciy43q.js → web-DFqKskm8.js} +6 -6
  169. package/package.json +1 -1
  170. package/dist/plugin-sdk/web-GvAx9MMo.js +0 -65
@@ -26180,6 +26180,109 @@ function guardSessionManager(sessionManager, opts) {
26180
26180
  return sessionManager;
26181
26181
  }
26182
26182
 
26183
+ //#endregion
26184
+ //#region src/agents/session-version.ts
26185
+ /**
26186
+ * Session Versioning — version-based session migration.
26187
+ *
26188
+ * Each session gets a `symiVersion` field in its JSONL header.
26189
+ * On session load, if the session was created by a known-poison version
26190
+ * (2.3.0-2.3.4), it's archived and a fresh session starts.
26191
+ *
26192
+ * Sessions without `symiVersion` predate 2.3.0 and were created with Claude,
26193
+ * which does not produce corrupted tool args or looping output. Do NOT
26194
+ * archive unversioned sessions — they are safe. Only sessions with an
26195
+ * explicit symiVersion in the known-poison range are archived.
26196
+ *
26197
+ * @module
26198
+ */
26199
+ /** Versions that produced corrupted sessions (tool arg garbage, looping). */
26200
+ const POISON_VERSION_MIN = [
26201
+ 2,
26202
+ 3,
26203
+ 0
26204
+ ];
26205
+ const POISON_VERSION_MAX = [
26206
+ 2,
26207
+ 3,
26208
+ 4
26209
+ ];
26210
+ function parseVersion(v) {
26211
+ return v.split(".").map((s) => parseInt(s, 10)).filter((n) => !Number.isNaN(n));
26212
+ }
26213
+ function compareVersions(a, b) {
26214
+ for (let i = 0; i < Math.max(a.length, b.length); i++) {
26215
+ const av = a[i] ?? 0;
26216
+ const bv = b[i] ?? 0;
26217
+ if (av < bv) return -1;
26218
+ if (av > bv) return 1;
26219
+ }
26220
+ return 0;
26221
+ }
26222
+ function isInPoisonRange(version) {
26223
+ const v = parseVersion(version);
26224
+ if (v.length < 3) return false;
26225
+ return compareVersions(v, POISON_VERSION_MIN) >= 0 && compareVersions(v, POISON_VERSION_MAX) <= 0;
26226
+ }
26227
+ /**
26228
+ * Check if a session file was created by a poisoned Symi version.
26229
+ * Returns the symiVersion if poisoned, null if safe.
26230
+ */
26231
+ async function checkSessionPoison(sessionFile) {
26232
+ try {
26233
+ const firstLine = (await fs$1.readFile(sessionFile, "utf-8")).split("\n")[0];
26234
+ if (!firstLine) return null;
26235
+ const header = JSON.parse(firstLine);
26236
+ if (header.type !== "session") return null;
26237
+ const symiVersion = header.symiVersion;
26238
+ if (typeof symiVersion !== "string") return null;
26239
+ if (isInPoisonRange(symiVersion)) return symiVersion;
26240
+ return null;
26241
+ } catch {
26242
+ return null;
26243
+ }
26244
+ }
26245
+ /**
26246
+ * Archive a poisoned session file by renaming it.
26247
+ * The archived file can be inspected later but won't be loaded.
26248
+ */
26249
+ async function archivePoisonedSession(sessionFile) {
26250
+ const archiveName = `${sessionFile}.archived-poison.${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}`;
26251
+ await fs$1.rename(sessionFile, archiveName);
26252
+ return archiveName;
26253
+ }
26254
+ /**
26255
+ * Stamp the current Symi version into a session file's header.
26256
+ * Reads the first line, adds/updates symiVersion, rewrites the line.
26257
+ */
26258
+ async function stampSessionVersion(sessionFile) {
26259
+ try {
26260
+ const lines = (await fs$1.readFile(sessionFile, "utf-8")).split("\n");
26261
+ if (lines.length === 0) return;
26262
+ const header = JSON.parse(lines[0]);
26263
+ if (header.type !== "session") return;
26264
+ if (header.symiVersion === VERSION) return;
26265
+ header.symiVersion = VERSION;
26266
+ lines[0] = JSON.stringify(header);
26267
+ await fs$1.writeFile(sessionFile, lines.join("\n"), "utf-8");
26268
+ } catch {}
26269
+ }
26270
+ /**
26271
+ * Check and handle a session file before use.
26272
+ * If poisoned: archive it and return { archived: true }.
26273
+ * Otherwise: stamp the current version and return { archived: false }.
26274
+ */
26275
+ async function handleSessionVersion(sessionFile) {
26276
+ const poison = await checkSessionPoison(sessionFile);
26277
+ if (poison) return {
26278
+ archived: true,
26279
+ archivePath: await archivePoisonedSession(sessionFile),
26280
+ poisonVersion: poison
26281
+ };
26282
+ await stampSessionVersion(sessionFile);
26283
+ return { archived: false };
26284
+ }
26285
+
26183
26286
  //#endregion
26184
26287
  //#region src/agents/stream-monitor.ts
26185
26288
  /**
@@ -29328,6 +29431,8 @@ async function runEmbeddedAttempt(params) {
29328
29431
  provider: params.provider,
29329
29432
  modelId: params.modelId
29330
29433
  });
29434
+ const versionCheck = await handleSessionVersion(params.sessionFile);
29435
+ if (versionCheck.archived) log$6.warn(`session archived: created by ${versionCheck.poisonVersion}, known corruption range → ${versionCheck.archivePath}`);
29331
29436
  await prewarmSessionFile(params.sessionFile);
29332
29437
  sessionManager = guardSessionManager(SessionManager.open(params.sessionFile), {
29333
29438
  agentId: sessionAgentId,
@@ -30999,7 +31104,7 @@ async function runAgentTurn(params) {
30999
31104
  function createDefaultDeps() {
31000
31105
  return {
31001
31106
  sendMessageWhatsApp: async (...args) => {
31002
- const { sendMessageWhatsApp } = await import("./web-CycbZoQb.js");
31107
+ const { sendMessageWhatsApp } = await import("./web-CVAyVZBT.js");
31003
31108
  return await sendMessageWhatsApp(...args);
31004
31109
  },
31005
31110
  sendMessageTelegram: async (...args) => {
@@ -49430,7 +49535,7 @@ function loadWebLoginQr() {
49430
49535
  return webLoginQrPromise;
49431
49536
  }
49432
49537
  function loadWebChannel() {
49433
- webChannelPromise ??= import("./web-CycbZoQb.js");
49538
+ webChannelPromise ??= import("./web-CVAyVZBT.js");
49434
49539
  return webChannelPromise;
49435
49540
  }
49436
49541
  function loadWhatsAppActions() {
@@ -13,7 +13,7 @@ import "./client-DMBZpU6X.js";
13
13
  import "./call-BcE47FtD.js";
14
14
  import "./message-channel-C9dERklz.js";
15
15
  import "./pairing-token-Byh6drgn.js";
16
- import "./subagent-registry-yBrXpTO-.js";
16
+ import "./subagent-registry-BxM7J5m6.js";
17
17
  import "./sessions-CJXnZVjR.js";
18
18
  import "./tokens-Csntmwwn.js";
19
19
  import "./plugins-CwSlLxM8.js";
@@ -101,9 +101,9 @@ import { t as ensureSymiCliOnPath } from "./path-env-Bic_wXs9.js";
101
101
  import "./catalog-DLQFKucJ.js";
102
102
  import "./note-DDecZomM.js";
103
103
  import "./plugin-auto-enable-D6ENR3Xg.js";
104
- import { t as ensurePluginRegistryLoaded } from "./plugin-registry-ByLEBcK_.js";
104
+ import { t as ensurePluginRegistryLoaded } from "./plugin-registry-CL--iTFl.js";
105
105
  import { t as assertSupportedRuntime } from "./runtime-guard-D7waq_Ho.js";
106
- import { t as emitCliBanner } from "./banner-BRzyFiIY.js";
106
+ import { t as emitCliBanner } from "./banner-B4wP-CCZ.js";
107
107
  import "./doctor-config-flow-CA3eiKhd.js";
108
108
  import { n as ensureConfigReady } from "./config-guard-CPHvOzsC.js";
109
109
  import process$1 from "node:process";
@@ -118,7 +118,7 @@ const routeHealth = {
118
118
  const verbose = getVerboseFlag(argv, { includeDebug: true });
119
119
  const timeoutMs = getPositiveIntFlagValue(argv, "--timeout");
120
120
  if (timeoutMs === null) return false;
121
- const { healthCommand } = await import("./health-CGoPVhko.js").then((n) => n.i);
121
+ const { healthCommand } = await import("./health-vuMM-FAs.js").then((n) => n.i);
122
122
  await healthCommand({
123
123
  json,
124
124
  timeoutMs,
@@ -138,7 +138,7 @@ const routeStatus = {
138
138
  const verbose = getVerboseFlag(argv, { includeDebug: true });
139
139
  const timeoutMs = getPositiveIntFlagValue(argv, "--timeout");
140
140
  if (timeoutMs === null) return false;
141
- const { statusCommand } = await import("./status-iwhTBXbZ.js").then((n) => n.t);
141
+ const { statusCommand } = await import("./status-BJITmlhZ.js").then((n) => n.t);
142
142
  await statusCommand({
143
143
  json,
144
144
  deep,
@@ -172,7 +172,7 @@ const routeAgentsList = {
172
172
  run: async (argv) => {
173
173
  const json = hasFlag(argv, "--json");
174
174
  const bindings = hasFlag(argv, "--bindings");
175
- const { agentsListCommand } = await import("./agents-Cf7lxbx4.js").then((n) => n.t);
175
+ const { agentsListCommand } = await import("./agents-DfyzZKBc.js").then((n) => n.t);
176
176
  await agentsListCommand({
177
177
  json,
178
178
  bindings
@@ -243,7 +243,7 @@ const routes = [
243
243
  const pathArg = getCommandPositionals(argv)[2];
244
244
  if (!pathArg) return false;
245
245
  const json = hasFlag(argv, "--json");
246
- const { runConfigGet } = await import("./config-cli-Dx3mtUwm.js");
246
+ const { runConfigGet } = await import("./config-cli-CtKkpyHu.js");
247
247
  await runConfigGet({
248
248
  path: pathArg,
249
249
  json
@@ -256,7 +256,7 @@ const routes = [
256
256
  run: async (argv) => {
257
257
  const pathArg = getCommandPositionals(argv)[2];
258
258
  if (!pathArg) return false;
259
- const { runConfigUnset } = await import("./config-cli-Dx3mtUwm.js");
259
+ const { runConfigUnset } = await import("./config-cli-CtKkpyHu.js");
260
260
  await runConfigUnset({ path: pathArg });
261
261
  return true;
262
262
  }
@@ -270,7 +270,7 @@ const routes = [
270
270
  const local = hasFlag(argv, "--local");
271
271
  const json = hasFlag(argv, "--json");
272
272
  const plain = hasFlag(argv, "--plain");
273
- const { modelsListCommand } = await import("./models-BPJ5Z5tU.js").then((n) => n.t);
273
+ const { modelsListCommand } = await import("./models-CBtd5YaQ.js").then((n) => n.t);
274
274
  await modelsListCommand({
275
275
  all,
276
276
  local,
@@ -301,7 +301,7 @@ const routes = [
301
301
  const plain = hasFlag(argv, "--plain");
302
302
  const check = hasFlag(argv, "--check");
303
303
  const probe = hasFlag(argv, "--probe");
304
- const { modelsStatusCommand } = await import("./models-BPJ5Z5tU.js").then((n) => n.t);
304
+ const { modelsStatusCommand } = await import("./models-CBtd5YaQ.js").then((n) => n.t);
305
305
  await modelsStatusCommand({
306
306
  json,
307
307
  plain,
@@ -379,7 +379,7 @@ async function runCli(argv = process$1.argv) {
379
379
  assertSupportedRuntime();
380
380
  if (await tryRouteCli(normalizedArgv)) return;
381
381
  enableConsoleCapture();
382
- const { buildProgram } = await import("./program-DCyh129g.js");
382
+ const { buildProgram } = await import("./program-v4cRnLjP.js");
383
383
  const program = buildProgram();
384
384
  installUnhandledRejectionHandler();
385
385
  process$1.on("uncaughtException", (error) => {
@@ -411,10 +411,10 @@ async function runCli(argv = process$1.argv) {
411
411
  const { getProgramContext } = await import("./program-context-CqzR_m-7.js").then((n) => n.n);
412
412
  const ctx = getProgramContext(program);
413
413
  if (ctx) {
414
- const { registerCoreCliByName } = await import("./command-registry-YX9EbrJh.js").then((n) => n.t);
414
+ const { registerCoreCliByName } = await import("./command-registry-D7MjQKMD.js").then((n) => n.t);
415
415
  await registerCoreCliByName(program, ctx, primary, parseArgv);
416
416
  }
417
- const { registerSubCliByName } = await import("./register.subclis-DcJgaLOK.js").then((n) => n.a);
417
+ const { registerSubCliByName } = await import("./register.subclis-PQ2Ulz3J.js").then((n) => n.a);
418
418
  await registerSubCliByName(program, primary);
419
419
  }
420
420
  const hasBuiltinPrimary = primary !== null && program.commands.some((command) => command.name() === primary);
@@ -423,7 +423,7 @@ async function runCli(argv = process$1.argv) {
423
423
  primary,
424
424
  hasBuiltinPrimary
425
425
  })) {
426
- const { registerPluginCliCommands } = await import("./cli-BUkGaPzi.js");
426
+ const { registerPluginCliCommands } = await import("./cli-hT0g_Q65.js");
427
427
  const { loadConfig } = await import("./config-DHBLS1Hl.js").then((n) => n.t);
428
428
  registerPluginCliCommands(program, loadConfig());
429
429
  }
@@ -4,7 +4,7 @@ import { G as resolveSymiAgentDir, T as resolveApiKeyForProvider, c as normalize
4
4
  import { t as normalizeChatType } from "./chat-type-DFDuk3FY.js";
5
5
  import { _ as kindFromMime, d as detectMime, h as isAudioFileName, p as getFileExtension } from "./image-ops-ByaQt43P.js";
6
6
  import { d as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS, f as isInboundPathAllowed, m as resolveIMessageAttachmentRoots, n as loadConfig, p as mergeInboundPathRoots } from "./config-BmV60pPT.js";
7
- import { S as ensureSymiModelsJson, t as describeImageWithModel } from "./image-DcpMiprB.js";
7
+ import { S as ensureSymiModelsJson, t as describeImageWithModel } from "./image-CHzdaNJ4.js";
8
8
  import { n as collectProviderApiKeysForExecution, r as executeWithApiKeyRotation, t as parseGeminiAuth } from "./gemini-auth-CSlZZ1Pw.js";
9
9
  import { n as fetchWithTimeout } from "./fetch-timeout-BheTNyes.js";
10
10
  import { i as fetchRemoteMedia, n as getDefaultMediaLocalRoots, o as fetchWithSsrFGuard, r as MediaFetchError } from "./local-roots-CC8jiKDk.js";
@@ -1,7 +1,7 @@
1
1
  import { g as resolveStateDir, t as CONFIG_PATH } from "./paths-Cqn-zk3M.js";
2
2
  import { D as isPlainObject, U as getResolvedLoggerSettings, r as clamp, y as resolveUserPath } from "./utils-B-0b9bGM.js";
3
3
  import { a as normalizeElevatedLevel, c as normalizeUsageDisplay, d as supportsXHighThinking, n as formatXHighModelHint, o as normalizeReasoningLevel, s as normalizeThinkLevel, t as formatThinkingLevels } from "./thinking-EAliFiVK.js";
4
- import { $n as OPENAI_TTS_MODELS, Bn as registerAgentRunContext, Bt as abortEmbeddedPiRun, C as ensureOutboundSessionEntry, Et as agentCommand, Ft as normalizeSendPolicy, G as normalizeCronJobPatch, Gn as resolveTtsApiKey, H as writeRestartSentinel, Hn as getTtsProvider, Ht as waitForEmbeddedPiRunEnd, It as resolveSendPolicy, Jn as resolveTtsPrefsPath, Kn as resolveTtsAutoMode, L as formatDoctorNonInteractiveHint, Mn as listSubagentRunsForRequester, Mt as resolveOutboundTarget, N as scheduleGatewaySigusr1Restart, Ot as resolveAgentDeliveryPlan, Pr as resolveAgentTimeoutMs, Qn as textToSpeech, Rt as createOutboundSendDeps, Sr as isSystemEventContextChanged, Tn as stopSubagentsForRequester, Un as isTtsEnabled, Vn as resolveUserTimezone, W as normalizeCronJobCreate, Wn as isTtsProviderConfigured, Xn as setTtsEnabled, Yn as resolveTtsProviderOrder, Zn as setTtsProvider, _ as loadCombinedSessionStoreForGateway, at as persistBrowserProxyFiles, b as resolveGatewaySessionStoreTarget, br as parseVerboseOverride, c as clearSessionQueues, er as OPENAI_TTS_VOICES, ft as loadSymiPlugins, g as listSessionsFromStore, gt as loadProviderUsageSummary, h as listAgentsForGateway, in as unbindThreadBindingsBySessionKey, it as applyBrowserProxyPaths, jn as listDescendantRunsForRequester, kt as resolveAgentOutboundTarget, mn as createReplyDispatcher, mt as normalizeGroupActivation, n as BARE_SESSION_RESET_PROMPT, p as canonicalizeSpawnedByForAgent, pn as dispatchInboundMessage, qn as resolveTtsConfig, v as loadSessionEntry, vr as applyModelOverrideToSessionEntry, w as resolveOutboundSessionRoute, wn as isAbortTrigger, x as resolveSessionModelRef, xn as formatZonedTimestamp, xr as enqueueSystemEvent, y as pruneLegacyStoreKeys, yr as applyVerboseOverride, zn as onAgentEvent } from "./reply-DiFKjgpz.js";
4
+ import { $n as OPENAI_TTS_MODELS, Bn as registerAgentRunContext, Bt as abortEmbeddedPiRun, C as ensureOutboundSessionEntry, Et as agentCommand, Ft as normalizeSendPolicy, G as normalizeCronJobPatch, Gn as resolveTtsApiKey, H as writeRestartSentinel, Hn as getTtsProvider, Ht as waitForEmbeddedPiRunEnd, It as resolveSendPolicy, Jn as resolveTtsPrefsPath, Kn as resolveTtsAutoMode, L as formatDoctorNonInteractiveHint, Mn as listSubagentRunsForRequester, Mt as resolveOutboundTarget, N as scheduleGatewaySigusr1Restart, Ot as resolveAgentDeliveryPlan, Pr as resolveAgentTimeoutMs, Qn as textToSpeech, Rt as createOutboundSendDeps, Sr as isSystemEventContextChanged, Tn as stopSubagentsForRequester, Un as isTtsEnabled, Vn as resolveUserTimezone, W as normalizeCronJobCreate, Wn as isTtsProviderConfigured, Xn as setTtsEnabled, Yn as resolveTtsProviderOrder, Zn as setTtsProvider, _ as loadCombinedSessionStoreForGateway, at as persistBrowserProxyFiles, b as resolveGatewaySessionStoreTarget, br as parseVerboseOverride, c as clearSessionQueues, er as OPENAI_TTS_VOICES, ft as loadSymiPlugins, g as listSessionsFromStore, gt as loadProviderUsageSummary, h as listAgentsForGateway, in as unbindThreadBindingsBySessionKey, it as applyBrowserProxyPaths, jn as listDescendantRunsForRequester, kt as resolveAgentOutboundTarget, mn as createReplyDispatcher, mt as normalizeGroupActivation, n as BARE_SESSION_RESET_PROMPT, p as canonicalizeSpawnedByForAgent, pn as dispatchInboundMessage, qn as resolveTtsConfig, v as loadSessionEntry, vr as applyModelOverrideToSessionEntry, w as resolveOutboundSessionRoute, wn as isAbortTrigger, x as resolveSessionModelRef, xn as formatZonedTimestamp, xr as enqueueSystemEvent, y as pruneLegacyStoreKeys, yr as applyVerboseOverride, zn as onAgentEvent } from "./reply-kuehpmXb.js";
5
5
  import { S as parseAgentSessionKey, l as resolveAgentIdFromSessionKey, m as DEFAULT_ACCOUNT_ID, o as classifySessionKeyShape, s as normalizeAgentId, t as DEFAULT_AGENT_ID, x as isSubagentSessionKey } from "./session-key-DCt45XZa.js";
6
6
  import { t as resolveSymiPackageRoot } from "./symi-root-CrGJbkzf.js";
7
7
  import { C as createInternalHookEvent, T as triggerInternalHook, d as getActivePluginRegistry, r as DEFAULT_CHAT_CHANNEL, t as CHANNEL_IDS } from "./registry-Cja8eT7G.js";
@@ -39,14 +39,14 @@ import { t as WizardCancelledError } from "./prompts-Xu2Sveka.js";
39
39
  import { t as resolveChannelDefaultAccountId } from "./helpers-BcGbMZD1.js";
40
40
  import { t as buildChannelAccountSnapshot } from "./status-BrV-afZE.js";
41
41
  import { o as isNodeCommandAllowed, s as resolveNodeCommandAllowlist } from "./audit-CrITRV6w.js";
42
- import { n as getStatusSummary } from "./status-DYp8kqmj.js";
43
- import { s as setHeartbeatsEnabled } from "./health-BMKu3MJz.js";
42
+ import { n as getStatusSummary } from "./status-Bow6kS56.js";
43
+ import { s as setHeartbeatsEnabled } from "./health-CM3gPoYN.js";
44
44
  import { m as normalizeUpdateChannel } from "./update-check-CtckACbb.js";
45
- import { a as sendApnsAlert, c as parseMessageWithAttachments, i as resolveApnsAuthConfigFromEnv, l as formatForLog, n as normalizeApnsEnvironment, o as sendApnsBackgroundWake, s as normalizeRpcAttachmentsToChatAttachments, t as loadApnsRegistration } from "./push-apns-CZw1UMXk.js";
46
- import { a as pruneAgentConfig, i as loadAgentIdentity, r as findAgentEntryIndex, t as applyAgentConfig } from "./agents.config-CsltNAhl.js";
45
+ import { a as sendApnsAlert, c as parseMessageWithAttachments, i as resolveApnsAuthConfigFromEnv, l as formatForLog, n as normalizeApnsEnvironment, o as sendApnsBackgroundWake, s as normalizeRpcAttachmentsToChatAttachments, t as loadApnsRegistration } from "./push-apns-glbAu-g9.js";
46
+ import { a as pruneAgentConfig, i as loadAgentIdentity, r as findAgentEntryIndex, t as applyAgentConfig } from "./agents.config-Dzr8Us0l.js";
47
47
  import { t as resolveSystemRunCommand } from "./system-run-command-ByVa3txU.js";
48
48
  import { t as installSkill } from "./skills-install-D67isO1L.js";
49
- import { t as runGatewayUpdate } from "./update-runner-DZmjPgW-.js";
49
+ import { t as runGatewayUpdate } from "./update-runner-C0iELmzo.js";
50
50
  import * as fs$2 from "node:fs";
51
51
  import fs from "node:fs";
52
52
  import * as os$1 from "node:os";
@@ -6853,7 +6853,7 @@ const nodeHandlers = {
6853
6853
  const p = params;
6854
6854
  const payloadJSON = typeof p.payloadJSON === "string" ? p.payloadJSON : p.payload !== void 0 ? JSON.stringify(p.payload) : null;
6855
6855
  await respondUnavailableOnThrow(respond, async () => {
6856
- const { handleNodeEvent } = await import("./server-node-events-aW9AFIXA.js");
6856
+ const { handleNodeEvent } = await import("./server-node-events-KVX4S5Md.js");
6857
6857
  const nodeId = client?.connect?.device?.id ?? client?.connect?.client?.id ?? "node";
6858
6858
  await handleNodeEvent({
6859
6859
  deps: context.deps,
@@ -12,7 +12,7 @@ import { f as GATEWAY_CLIENT_CAPS, g as hasGatewayClientCap, i as isGatewayMessa
12
12
  import { c as writeJsonAtomic, o as createAsyncLock, s as readJsonFile } from "./pairing-token-Byh6drgn.js";
13
13
  import { s as pickPrimaryLanIPv4 } from "./net-DZ5Ayk-W.js";
14
14
  import { i as normalizeInputProvenance } from "./input-provenance-D0lNkCf6.js";
15
- import { $n as resolveTtsAutoMode, C as resolveAgentDeliveryPlan, Cn as enqueueSystemEvent, Cr as onAgentEvent, D as createOutboundSendDeps, Dt as normalizeCronJobPatch, Et as normalizeCronJobCreate, G as dispatchInboundMessage, Gn as stopSubagentsForRequester, Gt as persistBrowserProxyFiles, In as resolveAgentTimeoutMs, Jn as resolveUserTimezone, K as createReplyDispatcher, Qn as resolveTtsApiKey, Sn as parseVerboseOverride, Vn as formatZonedTimestamp, Wn as isAbortTrigger, Wt as applyBrowserProxyPaths, X as BARE_SESSION_RESET_PROMPT, Xn as isTtsEnabled, Yn as getTtsProvider, Zn as isTtsProviderConfigured, Zt as scheduleGatewaySigusr1Restart, a as listSubagentRunsForRequester, ar as textToSpeech, bn as applyModelOverrideToSessionEntry, c as clearSessionQueues, ct as resolveOutboundSessionRoute, dt as resolveOutboundTarget, en as unbindThreadBindingsBySessionKey, er as resolveTtsConfig, hn as resolveSendPolicy, i as listDescendantRunsForRequester, ir as setTtsProvider, j as waitForEmbeddedPiRunEnd, k as abortEmbeddedPiRun, m as loadSymiPlugins, mn as normalizeSendPolicy, nr as resolveTtsProviderOrder, or as OPENAI_TTS_MODELS, rn as loadProviderUsageSummary, rr as setTtsEnabled, sr as OPENAI_TTS_VOICES, st as ensureOutboundSessionEntry, tn as normalizeGroupActivation, tr as resolveTtsPrefsPath, w as resolveAgentOutboundTarget, wn as isSystemEventContextChanged, wr as registerAgentRunContext, wt as writeRestartSentinel, x as agentCommand, xn as applyVerboseOverride, yt as formatDoctorNonInteractiveHint } from "./subagent-registry-yBrXpTO-.js";
15
+ import { $n as resolveTtsAutoMode, C as resolveAgentDeliveryPlan, Cn as enqueueSystemEvent, Cr as onAgentEvent, D as createOutboundSendDeps, Dt as normalizeCronJobPatch, Et as normalizeCronJobCreate, G as dispatchInboundMessage, Gn as stopSubagentsForRequester, Gt as persistBrowserProxyFiles, In as resolveAgentTimeoutMs, Jn as resolveUserTimezone, K as createReplyDispatcher, Qn as resolveTtsApiKey, Sn as parseVerboseOverride, Vn as formatZonedTimestamp, Wn as isAbortTrigger, Wt as applyBrowserProxyPaths, X as BARE_SESSION_RESET_PROMPT, Xn as isTtsEnabled, Yn as getTtsProvider, Zn as isTtsProviderConfigured, Zt as scheduleGatewaySigusr1Restart, a as listSubagentRunsForRequester, ar as textToSpeech, bn as applyModelOverrideToSessionEntry, c as clearSessionQueues, ct as resolveOutboundSessionRoute, dt as resolveOutboundTarget, en as unbindThreadBindingsBySessionKey, er as resolveTtsConfig, hn as resolveSendPolicy, i as listDescendantRunsForRequester, ir as setTtsProvider, j as waitForEmbeddedPiRunEnd, k as abortEmbeddedPiRun, m as loadSymiPlugins, mn as normalizeSendPolicy, nr as resolveTtsProviderOrder, or as OPENAI_TTS_MODELS, rn as loadProviderUsageSummary, rr as setTtsEnabled, sr as OPENAI_TTS_VOICES, st as ensureOutboundSessionEntry, tn as normalizeGroupActivation, tr as resolveTtsPrefsPath, w as resolveAgentOutboundTarget, wn as isSystemEventContextChanged, wr as registerAgentRunContext, wt as writeRestartSentinel, x as agentCommand, xn as applyVerboseOverride, yt as formatDoctorNonInteractiveHint } from "./subagent-registry-BxM7J5m6.js";
16
16
  import { F as resolveMainSessionKey, I as resolveMainSessionKeyFromConfig, J as normalizeSessionDeliveryFields, N as resolveAgentMainSessionKey, P as resolveExplicitAgentSessionKey, R as snapshotSessionOrigin, S as stripEnvelopeFromMessages, _ as capArrayByJsonBytes, d as updateSessionStore, g as archiveSessionTranscripts, h as archiveFileOnDisk, o as loadSessionStore, t as extractDeliveryInfo, v as readSessionMessages, x as resolveSessionTranscriptCandidates, y as readSessionPreviewItemsFromTranscript } from "./sessions-CJXnZVjR.js";
17
17
  import { n as listChannelPlugins, r as normalizeChannelId, t as getChannelPlugin } from "./plugins-CwSlLxM8.js";
18
18
  import { n as createBrowserRouteDispatcher } from "./with-timeout-Di0nddLY.js";
@@ -37,14 +37,14 @@ import { t as WizardCancelledError } from "./prompts-m1IJwIAx.js";
37
37
  import { t as resolveChannelDefaultAccountId } from "./helpers-cLP5YLeQ.js";
38
38
  import { t as buildChannelAccountSnapshot } from "./status-BUedPCLb.js";
39
39
  import { o as isNodeCommandAllowed, s as resolveNodeCommandAllowlist } from "./audit-Byo5jCLN.js";
40
- import { r as getStatusSummary } from "./status-iwhTBXbZ.js";
41
- import { c as setHeartbeatsEnabled } from "./health-CGoPVhko.js";
40
+ import { r as getStatusSummary } from "./status-BJITmlhZ.js";
41
+ import { c as setHeartbeatsEnabled } from "./health-vuMM-FAs.js";
42
42
  import { m as normalizeUpdateChannel } from "./update-check-ZdimP1aU.js";
43
- import { a as sendApnsAlert, c as parseMessageWithAttachments, i as resolveApnsAuthConfigFromEnv, l as formatForLog, n as normalizeApnsEnvironment, o as sendApnsBackgroundWake, s as normalizeRpcAttachmentsToChatAttachments, t as loadApnsRegistration } from "./push-apns-DSpV-UMg.js";
44
- import { a as pruneAgentConfig, i as loadAgentIdentity, r as findAgentEntryIndex, t as applyAgentConfig } from "./agents.config-aAHTt-cM.js";
43
+ import { a as sendApnsAlert, c as parseMessageWithAttachments, i as resolveApnsAuthConfigFromEnv, l as formatForLog, n as normalizeApnsEnvironment, o as sendApnsBackgroundWake, s as normalizeRpcAttachmentsToChatAttachments, t as loadApnsRegistration } from "./push-apns-DpdcOumU.js";
44
+ import { a as pruneAgentConfig, i as loadAgentIdentity, r as findAgentEntryIndex, t as applyAgentConfig } from "./agents.config-VjZQr5GP.js";
45
45
  import { t as resolveSystemRunCommand } from "./system-run-command-ByVa3txU.js";
46
46
  import { t as installSkill } from "./skills-install-1ZdwGTnh.js";
47
- import { t as runGatewayUpdate } from "./update-runner-Cx6XjioC.js";
47
+ import { t as runGatewayUpdate } from "./update-runner-YRJPtj9J.js";
48
48
  import { spawnSync } from "node:child_process";
49
49
  import * as os$1 from "node:os";
50
50
  import os from "node:os";
@@ -6851,7 +6851,7 @@ const nodeHandlers = {
6851
6851
  const p = params;
6852
6852
  const payloadJSON = typeof p.payloadJSON === "string" ? p.payloadJSON : p.payload !== void 0 ? JSON.stringify(p.payload) : null;
6853
6853
  await respondUnavailableOnThrow(respond, async () => {
6854
- const { handleNodeEvent } = await import("./server-node-events-CfY2QTYr.js");
6854
+ const { handleNodeEvent } = await import("./server-node-events-za7_iA-n.js");
6855
6855
  const nodeId = client?.connect?.device?.id ?? client?.connect?.client?.id ?? "node";
6856
6856
  await handleNodeEvent({
6857
6857
  deps: context.deps,
@@ -1,7 +1,7 @@
1
1
  import "./paths-Cqn-zk3M.js";
2
2
  import "./utils-B-0b9bGM.js";
3
3
  import "./thinking-EAliFiVK.js";
4
- import { Et as agentCommand, Mt as resolveOutboundTarget, Pt as createOutboundSendDeps, b as resolveGatewaySessionStoreTarget, st as requestHeartbeatNow, v as loadSessionEntry, xr as enqueueSystemEvent, y as pruneLegacyStoreKeys } from "./reply-DiFKjgpz.js";
4
+ import { Et as agentCommand, Mt as resolveOutboundTarget, Pt as createOutboundSendDeps, b as resolveGatewaySessionStoreTarget, st as requestHeartbeatNow, v as loadSessionEntry, xr as enqueueSystemEvent, y as pruneLegacyStoreKeys } from "./reply-kuehpmXb.js";
5
5
  import { c as normalizeMainKey } from "./session-key-DCt45XZa.js";
6
6
  import "./registry-Cja8eT7G.js";
7
7
  import { f as defaultRuntime } from "./subsystem-D9vIQve0.js";
@@ -102,7 +102,7 @@ import "./pi-tools.policy-CIDBbw6x.js";
102
102
  import "./control-service-Bz7rxLWq.js";
103
103
  import "./stagger-BUClb97_.js";
104
104
  import "./channel-selection-DuWs0Aak.js";
105
- import { c as parseMessageWithAttachments, l as formatForLog, r as registerApnsToken, s as normalizeRpcAttachmentsToChatAttachments } from "./push-apns-CZw1UMXk.js";
105
+ import { c as parseMessageWithAttachments, l as formatForLog, r as registerApnsToken, s as normalizeRpcAttachmentsToChatAttachments } from "./push-apns-glbAu-g9.js";
106
106
  import { randomUUID } from "node:crypto";
107
107
 
108
108
  //#region src/gateway/server-node-events.ts
@@ -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 { Cn as enqueueSystemEvent, T as createOutboundSendDeps, dn as requestHeartbeatNow, dt as resolveOutboundTarget, x as agentCommand } from "./subagent-registry-yBrXpTO-.js";
17
+ import { Cn as enqueueSystemEvent, T as createOutboundSendDeps, dn as requestHeartbeatNow, dt as resolveOutboundTarget, x as agentCommand } from "./subagent-registry-BxM7J5m6.js";
18
18
  import { d as updateSessionStore } from "./sessions-CJXnZVjR.js";
19
19
  import "./tokens-Csntmwwn.js";
20
20
  import { r as normalizeChannelId } from "./plugins-CwSlLxM8.js";
@@ -98,7 +98,7 @@ import "./onboard-helpers-_pit1NZW.js";
98
98
  import "./prompt-style-DwCXob2h.js";
99
99
  import "./pairing-labels-D1HDboV2.js";
100
100
  import "./pi-tools.policy-De00gPXt.js";
101
- import { c as parseMessageWithAttachments, l as formatForLog, r as registerApnsToken, s as normalizeRpcAttachmentsToChatAttachments } from "./push-apns-DSpV-UMg.js";
101
+ import { c as parseMessageWithAttachments, l as formatForLog, r as registerApnsToken, s as normalizeRpcAttachmentsToChatAttachments } from "./push-apns-DpdcOumU.js";
102
102
  import { randomUUID } from "node:crypto";
103
103
 
104
104
  //#region src/gateway/server-node-events.ts
@@ -9,7 +9,7 @@ import { c as resolveAgentWorkspaceDir } from "./agent-scope-D-jRCY0d.js";
9
9
  import { t as buildWorkspaceSkillStatus } from "./skills-status-DKXJ-tbi.js";
10
10
  import { H as VERSION, i as loadConfig, o as readConfigFileSnapshot } from "./config-DHBLS1Hl.js";
11
11
  import { n as callGateway, t as buildGatewayConnectionDetails } from "./call-BcE47FtD.js";
12
- import { En as peekSystemEvents, St as summarizeRestartSentinel, cn as buildChannelAccountSnapshot, in as formatUsageReportLines, ln as formatChannelAllowFrom, nt as sha256HexPrefix, rn as loadProviderUsageSummary, sn as buildChannelSummary, xt as readRestartSentinel } from "./subagent-registry-yBrXpTO-.js";
12
+ import { En as peekSystemEvents, St as summarizeRestartSentinel, cn as buildChannelAccountSnapshot, in as formatUsageReportLines, ln as formatChannelAllowFrom, nt as sha256HexPrefix, rn as loadProviderUsageSummary, sn as buildChannelSummary, xt as readRestartSentinel } from "./subagent-registry-BxM7J5m6.js";
13
13
  import { F as resolveMainSessionKey, j as resolveFreshSessionTotalTokens, o as loadSessionStore } from "./sessions-CJXnZVjR.js";
14
14
  import { n as listChannelPlugins } from "./plugins-CwSlLxM8.js";
15
15
  import { o as getTailnetHostname, s as readTailscaleStatusJson } from "./tailscale-CbbvYNVw.js";
@@ -29,7 +29,7 @@ import { t as formatRuntimeStatusWithDetails } from "./runtime-status-hFVEC3wO.j
29
29
  import { t as readLastGatewayErrorLine } from "./diagnostics-CS1ov_hH.js";
30
30
  import { t as renderTable } from "./table-D01d2GuY.js";
31
31
  import { a as resolveGatewayProbeAuth$1, c as probeGateway, t as runSecurityAudit } from "./audit-Byo5jCLN.js";
32
- import { o as resolveHeartbeatSummaryForAgent, t as formatHealthChannelLines } from "./health-CGoPVhko.js";
32
+ import { o as resolveHeartbeatSummaryForAgent, t as formatHealthChannelLines } from "./health-vuMM-FAs.js";
33
33
  import { g as resolveUpdateChannelDisplay, i as formatGitInstallLabel, m as normalizeUpdateChannel, t as checkUpdateStatus } from "./update-check-ZdimP1aU.js";
34
34
  import { t as resolveNodeService } from "./node-service-fcZExd22.js";
35
35
  import { n as redactSecrets, t as formatGatewayAuthUsed } from "./format-DVLB9DNB.js";
@@ -1,6 +1,6 @@
1
1
  import { u as resolveGatewayPort } from "./paths-Cqn-zk3M.js";
2
2
  import { B as theme, k as info, z as isRich } from "./utils-B-0b9bGM.js";
3
- import { B as summarizeRestartSentinel, Jt as sha256HexPrefix, _t as formatUsageReportLines, a as buildChannelSummary, gt as loadProviderUsageSummary, h as listAgentsForGateway, m as classifySessionKey, o as buildChannelAccountSnapshot, pr as lookupContextTokens, s as formatChannelAllowFrom, wr as peekSystemEvents, x as resolveSessionModelRef, z as readRestartSentinel } from "./reply-DiFKjgpz.js";
3
+ import { B as summarizeRestartSentinel, Jt as sha256HexPrefix, _t as formatUsageReportLines, a as buildChannelSummary, gt as loadProviderUsageSummary, h as listAgentsForGateway, m as classifySessionKey, o as buildChannelAccountSnapshot, pr as lookupContextTokens, s as formatChannelAllowFrom, wr as peekSystemEvents, x as resolveSessionModelRef, z as readRestartSentinel } from "./reply-kuehpmXb.js";
4
4
  import { S as parseAgentSessionKey } from "./session-key-DCt45XZa.js";
5
5
  import { t as resolveSymiPackageRoot } from "./symi-root-CrGJbkzf.js";
6
6
  import { n as runExec } from "./exec-CWkblSrI.js";
@@ -28,7 +28,7 @@ import { t as formatRuntimeStatusWithDetails } from "./runtime-status-CR9445g5.j
28
28
  import { t as readLastGatewayErrorLine } from "./diagnostics-BAMlsVVX.js";
29
29
  import { t as renderTable } from "./table-BTgkRafz.js";
30
30
  import { a as resolveGatewayProbeAuth$1, c as probeGateway, t as runSecurityAudit } from "./audit-CrITRV6w.js";
31
- import { a as resolveHeartbeatSummaryForAgent, t as formatHealthChannelLines } from "./health-BMKu3MJz.js";
31
+ import { a as resolveHeartbeatSummaryForAgent, t as formatHealthChannelLines } from "./health-CM3gPoYN.js";
32
32
  import { g as resolveUpdateChannelDisplay, i as formatGitInstallLabel, m as normalizeUpdateChannel, t as checkUpdateStatus } from "./update-check-CtckACbb.js";
33
33
  import { t as resolveNodeService } from "./node-service-Cxz4e-Qd.js";
34
34
  import { n as redactSecrets, t as formatGatewayAuthUsed } from "./format-yQZNwAF2.js";
@@ -1,4 +1,4 @@
1
- import { dt as createPluginLoaderLogger, ft as loadSymiPlugins } from "./reply-DiFKjgpz.js";
1
+ import { dt as createPluginLoaderLogger, ft as loadSymiPlugins } from "./reply-kuehpmXb.js";
2
2
  import { t as createSubsystemLogger } from "./subsystem-D9vIQve0.js";
3
3
  import { D as resolveDefaultAgentWorkspaceDir, c as resolveAgentWorkspaceDir, l as resolveDefaultAgentId } from "./agent-scope-CgUHAtCo.js";
4
4
  import { i as loadConfig } from "./config-CHwyw6l5.js";
@@ -1,7 +1,7 @@
1
1
  import { o as createSubsystemLogger } from "./entry.js";
2
2
  import { D as resolveDefaultAgentWorkspaceDir, c as resolveAgentWorkspaceDir, l as resolveDefaultAgentId } from "./agent-scope-D-jRCY0d.js";
3
3
  import { i as loadConfig } from "./config-DHBLS1Hl.js";
4
- import { m as loadSymiPlugins, p as createPluginLoaderLogger } from "./subagent-registry-yBrXpTO-.js";
4
+ import { m as loadSymiPlugins, p as createPluginLoaderLogger } from "./subagent-registry-BxM7J5m6.js";
5
5
 
6
6
  //#region src/plugins/status.ts
7
7
  const log = createSubsystemLogger("plugins");
@@ -48001,6 +48001,109 @@ function guardSessionManager(sessionManager, opts) {
48001
48001
  return sessionManager;
48002
48002
  }
48003
48003
 
48004
+ //#endregion
48005
+ //#region src/agents/session-version.ts
48006
+ /**
48007
+ * Session Versioning — version-based session migration.
48008
+ *
48009
+ * Each session gets a `symiVersion` field in its JSONL header.
48010
+ * On session load, if the session was created by a known-poison version
48011
+ * (2.3.0-2.3.4), it's archived and a fresh session starts.
48012
+ *
48013
+ * Sessions without `symiVersion` predate 2.3.0 and were created with Claude,
48014
+ * which does not produce corrupted tool args or looping output. Do NOT
48015
+ * archive unversioned sessions — they are safe. Only sessions with an
48016
+ * explicit symiVersion in the known-poison range are archived.
48017
+ *
48018
+ * @module
48019
+ */
48020
+ /** Versions that produced corrupted sessions (tool arg garbage, looping). */
48021
+ const POISON_VERSION_MIN = [
48022
+ 2,
48023
+ 3,
48024
+ 0
48025
+ ];
48026
+ const POISON_VERSION_MAX = [
48027
+ 2,
48028
+ 3,
48029
+ 4
48030
+ ];
48031
+ function parseVersion(v) {
48032
+ return v.split(".").map((s) => parseInt(s, 10)).filter((n) => !Number.isNaN(n));
48033
+ }
48034
+ function compareVersions(a, b) {
48035
+ for (let i = 0; i < Math.max(a.length, b.length); i++) {
48036
+ const av = a[i] ?? 0;
48037
+ const bv = b[i] ?? 0;
48038
+ if (av < bv) return -1;
48039
+ if (av > bv) return 1;
48040
+ }
48041
+ return 0;
48042
+ }
48043
+ function isInPoisonRange(version) {
48044
+ const v = parseVersion(version);
48045
+ if (v.length < 3) return false;
48046
+ return compareVersions(v, POISON_VERSION_MIN) >= 0 && compareVersions(v, POISON_VERSION_MAX) <= 0;
48047
+ }
48048
+ /**
48049
+ * Check if a session file was created by a poisoned Symi version.
48050
+ * Returns the symiVersion if poisoned, null if safe.
48051
+ */
48052
+ async function checkSessionPoison(sessionFile) {
48053
+ try {
48054
+ const firstLine = (await fs$1.readFile(sessionFile, "utf-8")).split("\n")[0];
48055
+ if (!firstLine) return null;
48056
+ const header = JSON.parse(firstLine);
48057
+ if (header.type !== "session") return null;
48058
+ const symiVersion = header.symiVersion;
48059
+ if (typeof symiVersion !== "string") return null;
48060
+ if (isInPoisonRange(symiVersion)) return symiVersion;
48061
+ return null;
48062
+ } catch {
48063
+ return null;
48064
+ }
48065
+ }
48066
+ /**
48067
+ * Archive a poisoned session file by renaming it.
48068
+ * The archived file can be inspected later but won't be loaded.
48069
+ */
48070
+ async function archivePoisonedSession(sessionFile) {
48071
+ const archiveName = `${sessionFile}.archived-poison.${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}`;
48072
+ await fs$1.rename(sessionFile, archiveName);
48073
+ return archiveName;
48074
+ }
48075
+ /**
48076
+ * Stamp the current Symi version into a session file's header.
48077
+ * Reads the first line, adds/updates symiVersion, rewrites the line.
48078
+ */
48079
+ async function stampSessionVersion(sessionFile) {
48080
+ try {
48081
+ const lines = (await fs$1.readFile(sessionFile, "utf-8")).split("\n");
48082
+ if (lines.length === 0) return;
48083
+ const header = JSON.parse(lines[0]);
48084
+ if (header.type !== "session") return;
48085
+ if (header.symiVersion === VERSION) return;
48086
+ header.symiVersion = VERSION;
48087
+ lines[0] = JSON.stringify(header);
48088
+ await fs$1.writeFile(sessionFile, lines.join("\n"), "utf-8");
48089
+ } catch {}
48090
+ }
48091
+ /**
48092
+ * Check and handle a session file before use.
48093
+ * If poisoned: archive it and return { archived: true }.
48094
+ * Otherwise: stamp the current version and return { archived: false }.
48095
+ */
48096
+ async function handleSessionVersion(sessionFile) {
48097
+ const poison = await checkSessionPoison(sessionFile);
48098
+ if (poison) return {
48099
+ archived: true,
48100
+ archivePath: await archivePoisonedSession(sessionFile),
48101
+ poisonVersion: poison
48102
+ };
48103
+ await stampSessionVersion(sessionFile);
48104
+ return { archived: false };
48105
+ }
48106
+
48004
48107
  //#endregion
48005
48108
  //#region src/agents/stream-monitor.ts
48006
48109
  /**
@@ -50952,6 +51055,8 @@ async function runEmbeddedAttempt(params) {
50952
51055
  provider: params.provider,
50953
51056
  modelId: params.modelId
50954
51057
  });
51058
+ const versionCheck = await handleSessionVersion(params.sessionFile);
51059
+ if (versionCheck.archived) log$4.warn(`session archived: created by ${versionCheck.poisonVersion}, known corruption range → ${versionCheck.archivePath}`);
50955
51060
  await prewarmSessionFile(params.sessionFile);
50956
51061
  sessionManager = guardSessionManager(SessionManager.open(params.sessionFile), {
50957
51062
  agentId: sessionAgentId,
@@ -52623,7 +52728,7 @@ async function runAgentTurn(params) {
52623
52728
  function createDefaultDeps() {
52624
52729
  return {
52625
52730
  sendMessageWhatsApp: async (...args) => {
52626
- const { sendMessageWhatsApp } = await import("./web-C5liFFox.js");
52731
+ const { sendMessageWhatsApp } = await import("./web-9AS0DiSZ.js");
52627
52732
  return await sendMessageWhatsApp(...args);
52628
52733
  },
52629
52734
  sendMessageTelegram: async (...args) => {
@@ -67937,7 +68042,7 @@ function loadWebLoginQr() {
67937
68042
  return webLoginQrPromise;
67938
68043
  }
67939
68044
  function loadWebChannel() {
67940
- webChannelPromise ??= import("./web-C5liFFox.js");
68045
+ webChannelPromise ??= import("./web-9AS0DiSZ.js");
67941
68046
  return webChannelPromise;
67942
68047
  }
67943
68048
  function loadWhatsAppActions() {
@@ -16,7 +16,7 @@ import "./client-DMBZpU6X.js";
16
16
  import "./call-BcE47FtD.js";
17
17
  import "./message-channel-C9dERklz.js";
18
18
  import "./pairing-token-Byh6drgn.js";
19
- import { Ct as trimLogTail } from "./subagent-registry-yBrXpTO-.js";
19
+ import { Ct as trimLogTail } from "./subagent-registry-BxM7J5m6.js";
20
20
  import "./sessions-CJXnZVjR.js";
21
21
  import "./tokens-Csntmwwn.js";
22
22
  import "./plugins-CwSlLxM8.js";
@@ -111,10 +111,10 @@ import "./npm-registry-spec-DkaZNHAW.js";
111
111
  import "./skill-scanner-BGWOBqLY.js";
112
112
  import "./installs-CgQpVncj.js";
113
113
  import "./channels-status-issues-c7qZbYG5.js";
114
- import "./register.subclis-DcJgaLOK.js";
115
- import "./command-registry-YX9EbrJh.js";
114
+ import "./register.subclis-PQ2Ulz3J.js";
115
+ import "./command-registry-D7MjQKMD.js";
116
116
  import "./program-context-CqzR_m-7.js";
117
- import { r as installCompletion } from "./completion-cli-Cm8iWdRA.js";
117
+ import { r as installCompletion } from "./completion-cli-Bcv09Yuh.js";
118
118
  import "./daemon-runtime-CfRwa6qh.js";
119
119
  import { r as parseSemver } from "./runtime-guard-D7waq_Ho.js";
120
120
  import "./systemd-DlMdyFDY.js";
@@ -124,19 +124,19 @@ import "./systemd-hints-sQipWGd1.js";
124
124
  import { i as runDaemonInstall, r as runDaemonRestart } from "./daemon-cli-wWnBIQtk.js";
125
125
  import "./diagnostics-CS1ov_hH.js";
126
126
  import { t as renderTable } from "./table-D01d2GuY.js";
127
- import "./health-CGoPVhko.js";
127
+ import "./health-vuMM-FAs.js";
128
128
  import "./control-ui-assets-BseSWee1.js";
129
129
  import { a as resolveNpmChannelTag, c as DEFAULT_PACKAGE_CHANNEL, d as formatUpdateChannelLabel, g as resolveUpdateChannelDisplay, h as resolveEffectiveUpdateChannel, m as normalizeUpdateChannel, n as compareSemverStrings, r as fetchNpmTagVersion, s as DEFAULT_GIT_CHANNEL, t as checkUpdateStatus, u as channelToNpmTag } from "./update-check-ZdimP1aU.js";
130
130
  import "./dm-policy-shared-DJ-61hCT.js";
131
131
  import { i as resolveUpdateAvailability, n as formatUpdateOneLiner, t as formatUpdateAvailableHint } from "./status.update-DbmZz0Aq.js";
132
- import { a as globalInstallArgs, c as readPackageVersion, i as detectGlobalInstallManagerForRoot, n as cleanupGlobalRenameDirs, o as resolveGlobalPackageRoot, r as detectGlobalInstallManagerByPresence, s as readPackageName, t as runGatewayUpdate } from "./update-runner-Cx6XjioC.js";
132
+ import { a as globalInstallArgs, c as readPackageVersion, i as detectGlobalInstallManagerForRoot, n as cleanupGlobalRenameDirs, o as resolveGlobalPackageRoot, r as detectGlobalInstallManagerByPresence, s as readPackageName, t as runGatewayUpdate } from "./update-runner-YRJPtj9J.js";
133
133
  import "./logging-BGewRZy0.js";
134
134
  import { n as updateNpmInstalledPlugins, t as syncPluginsForUpdateChannel } from "./update-DEMKx4eC.js";
135
135
  import "./doctor-config-flow-CA3eiKhd.js";
136
136
  import "./systemd-linger-DA_LW52P.js";
137
137
  import "./health-format-CzgUHmmX.js";
138
- import { n as doctorCommand, t as selectStyled } from "./prompt-select-styled-kpNeUDud.js";
139
- import { r as ensureCompletionCacheExists, t as checkShellCompletionStatus } from "./doctor-completion-D4SLAoAE.js";
138
+ import { n as doctorCommand, t as selectStyled } from "./prompt-select-styled-D48W5rxp.js";
139
+ import { r as ensureCompletionCacheExists, t as checkShellCompletionStatus } from "./doctor-completion-bTUb2Em4.js";
140
140
  import { spawn, spawnSync } from "node:child_process";
141
141
  import os from "node:os";
142
142
  import path from "node:path";