@symerian/symi 2.6.11 → 2.6.13

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 (167) hide show
  1. package/dist/{accounts-dRUMQQrB.js → accounts-3dCrO3oZ.js} +1 -1
  2. package/dist/{accounts-D1r2dq1t.js → accounts-BRw8yhIW.js} +21 -21
  3. package/dist/{accounts-wSphH5gv.js → accounts-BuZxOb3B.js} +1 -1
  4. package/dist/{active-listener-DFUTUjxt.js → active-listener-CfHHV2SU.js} +1 -1
  5. package/dist/{agent-scope-D68_xfTL.js → agent-scope-CpEJ0B88.js} +3 -3
  6. package/dist/{agents-DRRBdgqz.js → agents-CrSpoNsS.js} +4 -4
  7. package/dist/{agents.config-GCucbcBy.js → agents.config-B3GILTs5.js} +1 -1
  8. package/dist/{agents.config-BO1N5Z_6.js → agents.config-Co1CO8fA.js} +1 -1
  9. package/dist/{audio-preflight-CjV36MUe.js → audio-preflight-BVaaZWkg.js} +29 -29
  10. package/dist/{auth-choice-C1sul2-I.js → auth-choice-BBmXnDnK.js} +1 -1
  11. package/dist/{auth-choice-i7tTgbDd.js → auth-choice-BHWxDJh7.js} +1 -1
  12. package/dist/{auth-profiles-Bl9aU7fc.js → auth-profiles-DdK1Hxaa.js} +17 -17
  13. package/dist/{banner-VbhMdl-b.js → banner-RLiOIu-3.js} +1 -1
  14. package/dist/{bindings-Bat2RnAR.js → bindings-BsHoBLIE.js} +2 -2
  15. package/dist/build-info.json +3 -3
  16. package/dist/bundled/boot-md/handler.js +53 -53
  17. package/dist/bundled/bootstrap-extra-files/handler.js +5 -5
  18. package/dist/bundled/command-logger/handler.js +1 -1
  19. package/dist/bundled/session-memory/handler.js +53 -53
  20. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  21. package/dist/{channel-activity-DK0AV-r9.js → channel-activity-B6G1jnQT.js} +1 -1
  22. package/dist/{channel-options-CsXOvqAc.js → channel-options-BCK41AON.js} +1 -1
  23. package/dist/{channel-options-Esf0QB4M.js → channel-options-PDf46S-K.js} +1 -1
  24. package/dist/{channel-web-DDC84nZg.js → channel-web-C3XZ7c2q.js} +1 -1
  25. package/dist/{channels-cli-DomEe8uI.js → channels-cli-723vy6L6.js} +4 -4
  26. package/dist/{channels-cli-C989dAD4.js → channels-cli-CUWuD7qf.js} +4 -4
  27. package/dist/{chrome-DRHvMBbb.js → chrome-DkaXoP36.js} +14 -14
  28. package/dist/{chunk-DR8ukp6r.js → chunk-09egQapi.js} +1 -1
  29. package/dist/{cli-CPRCkEdK.js → cli-CAzmrOs0.js} +1 -1
  30. package/dist/{cli-RXswESw1.js → cli-DYdRSi_j.js} +1 -1
  31. package/dist/{command-registry-DwBw5-nh.js → command-registry-B2aO0Q7_.js} +9 -9
  32. package/dist/{commands-registry-DIakZUZb.js → commands-registry-Bfc7Uz0o.js} +4 -4
  33. package/dist/{completion-cli-Cwx8MtF9.js → completion-cli-BKm12loU.js} +1 -1
  34. package/dist/{completion-cli-C43sjF75.js → completion-cli-BsKD_vBb.js} +2 -2
  35. package/dist/{config-CvmE3Yx1.js → config-5SdHIcHU.js} +12 -12
  36. package/dist/{config-cli-DG0xBZhs.js → config-cli-Bynmd81Q.js} +1 -1
  37. package/dist/{config-cli-CkkIU7AY.js → config-cli-D47lU7kU.js} +1 -1
  38. package/dist/{configure-DlVtomYJ.js → configure-B3vS2Iz5.js} +3 -3
  39. package/dist/{configure-nxnXIUVI.js → configure-Df6GmKAR.js} +3 -3
  40. package/dist/{deliver-UMgfGLxW.js → deliver-C46-vyqg.js} +20 -20
  41. package/dist/{diagnostic-spWOtH_g.js → diagnostic-rPhsBoZz.js} +1 -1
  42. package/dist/{doctor-completion-Dd5P0i9L.js → doctor-completion-DyiRkYT4.js} +1 -1
  43. package/dist/{doctor-completion-CWr51Q4O.js → doctor-completion-SEerte2S.js} +1 -1
  44. package/dist/entry.js +1 -1
  45. package/dist/{env-xmBFQPBP.js → env-BDXYbTKj.js} +1 -1
  46. package/dist/extensionAPI.js +1 -1
  47. package/dist/{frontmatter-CV0YkjoY.js → frontmatter-CTR5f_Ez.js} +2 -2
  48. package/dist/{gateway-cli-BBJjWKyu.js → gateway-cli-PjmG0pFo.js} +9 -9
  49. package/dist/{gateway-cli-B1h1FhD-.js → gateway-cli-k19iT2vJ.js} +9 -9
  50. package/dist/{gemini-auth-C6Z-2T42.js → gemini-auth-Dy12ZAH3.js} +1 -1
  51. package/dist/{github-copilot-token-B8B2pmph.js → github-copilot-token-cCYzSU9h.js} +7 -7
  52. package/dist/{glass-ui-ws-UewDPjVh.js → glass-ui-ws-D0Yv090T.js} +7 -7
  53. package/dist/{glass-ui-ws-Bk01KSVI.js → glass-ui-ws-iCEtluQU.js} +7 -7
  54. package/dist/{health-Dzi6letr.js → health-B32Q-KYM.js} +1 -1
  55. package/dist/{health-BiipZUOd.js → health-CXjAtn1-.js} +1 -1
  56. package/dist/{hooks-cli-BdelOAPH.js → hooks-cli-DA6zOGNz.js} +2 -2
  57. package/dist/{hooks-cli-DxRXaSHR.js → hooks-cli-DfRmFenH.js} +2 -2
  58. package/dist/{image-CK4oZUJJ.js → image-CuzFLQWC.js} +4 -4
  59. package/dist/{image-ops-M5agStZn.js → image-ops-C7CauEK8.js} +16 -16
  60. package/dist/index.js +6 -6
  61. package/dist/{ir-B-XXcYFe.js → ir-CTiz95Vb.js} +4 -4
  62. package/dist/llm-slug-generator.js +53 -53
  63. package/dist/{local-roots-CdXg5-Cx.js → local-roots-DhZz0Ybs.js} +5 -5
  64. package/dist/{login-qr-BKIOHn1V.js → login-qr-AP9agO-i.js} +12 -12
  65. package/dist/{login-BHUrERYo.js → login-ul8zaw_S.js} +7 -7
  66. package/dist/{manager-DW3JqFpY.js → manager-PprhCvO_.js} +22 -22
  67. package/dist/{manifest-registry-0J48biqr.js → manifest-registry-yb7sAlu4.js} +19 -19
  68. package/dist/{markdown-tables-tW9bGjLM.js → markdown-tables-C-BmIap8.js} +1 -1
  69. package/dist/{message-channel-DwDSKGn4.js → message-channel-OlFBYAw8.js} +1 -1
  70. package/dist/{models-cli-CF0KZtK4.js → models-cli-BgCUViRO.js} +2 -2
  71. package/dist/{models-cli-D5KE-evn.js → models-cli-CbJUD_L1.js} +3 -3
  72. package/dist/{models-DUrbBEOU.js → models-zowe4LXa.js} +2 -2
  73. package/dist/{onboard-DK-oOqRl.js → onboard-CYvIpUXQ.js} +2 -2
  74. package/dist/{onboard-Bizq_LAS.js → onboard-DsKgcThj.js} +2 -2
  75. package/dist/{onboard-channels-B6yLPqH5.js → onboard-channels-DLiV4Y0t.js} +1 -1
  76. package/dist/{onboard-channels-DSZzjOo1.js → onboard-channels-DxCGWgB0.js} +1 -1
  77. package/dist/{onboarding-CkWWIQA7.js → onboarding-BA5v1JEG.js} +3 -3
  78. package/dist/{onboarding-DGSCNnGY.js → onboarding-DioGtMFo.js} +3 -3
  79. package/dist/{onboarding.finalize-Dj0noUgo.js → onboarding.finalize-CAbRXb0h.js} +5 -5
  80. package/dist/{onboarding.finalize-BMGwhjIR.js → onboarding.finalize-DMXCA49f.js} +6 -6
  81. package/dist/{outbound-CIVsLpJK.js → outbound-CtMCmwxR.js} +7 -7
  82. package/dist/{outbound-attachment-CHcmlip8.js → outbound-attachment-DJldbweZ.js} +2 -2
  83. package/dist/{paths-DEuVuViW.js → paths-CbQV9WEg.js} +1 -1
  84. package/dist/{pi-auth-json-BYuCWAs0.js → pi-auth-json-Bk8ERadJ.js} +8 -8
  85. package/dist/{pi-embedded-DLma-HLn.js → pi-embedded-CFFnZEcA.js} +14 -4
  86. package/dist/{pi-embedded-helpers-BU8EZuwx.js → pi-embedded-helpers-CfqDGQ9J.js} +73 -73
  87. package/dist/{plugin-registry-D8PAS3Sx.js → plugin-registry-Bt5YCgFq.js} +1 -1
  88. package/dist/{plugin-registry-BcgpVdtC.js → plugin-registry-HFOrv3KN.js} +1 -1
  89. package/dist/plugin-sdk/{channel-web-DgNOPxkV.js → channel-web-C2w1HotM.js} +1 -1
  90. package/dist/plugin-sdk/index.js +2 -2
  91. package/dist/plugin-sdk/{reply-DJN8Xcq2.js → reply-D5CxbzCs.js} +14 -4
  92. package/dist/plugin-sdk/{web-HkDBSFef.js → web-ClsKdqx-.js} +2 -2
  93. package/dist/{plugins-Bkr5ZdYs.js → plugins-BzmbgY7s.js} +9 -9
  94. package/dist/{plugins-cli-Bcmq1fs1.js → plugins-cli-C7xTf9NV.js} +2 -2
  95. package/dist/{plugins-cli-B_ln22KG.js → plugins-cli-CXz_UApK.js} +2 -2
  96. package/dist/{program-C_rxRb1M.js → program-8hWr4qGZ.js} +7 -7
  97. package/dist/{program-context-BqH8IVSK.js → program-context-BBtSJunF.js} +17 -17
  98. package/dist/{prompt-select-styled-DMRbQO0q.js → prompt-select-styled-CwfroEHp.js} +4 -4
  99. package/dist/{prompt-select-styled-D8WAeDQY.js → prompt-select-styled-DUXeA9Zp.js} +4 -4
  100. package/dist/{provider-auth-helpers-DstpUAya.js → provider-auth-helpers-Dc7jBEOA.js} +1 -1
  101. package/dist/{provider-auth-helpers-DiuVmtmQ.js → provider-auth-helpers-DhLHWjNU.js} +1 -1
  102. package/dist/{push-apns-be2xWY22.js → push-apns-CVZe5WVN.js} +1 -1
  103. package/dist/{push-apns-DKU4DgbI.js → push-apns-CflJh75N.js} +1 -1
  104. package/dist/{pw-ai-BTgmcNVp.js → pw-ai-m0mj2KWK.js} +11 -11
  105. package/dist/{qmd-manager-BKu9rOuB.js → qmd-manager-iDLSiI4Z.js} +7 -7
  106. package/dist/{register.agent-Dcd_oFsG.js → register.agent-BnuJQ5lg.js} +6 -6
  107. package/dist/{register.agent-k7WxtPOd.js → register.agent-DV7IR1rI.js} +5 -5
  108. package/dist/{register.configure-BOgCp-h4.js → register.configure-BhncI0ij.js} +6 -6
  109. package/dist/{register.configure-DMHVPA-T.js → register.configure-DaIrJXWo.js} +6 -6
  110. package/dist/{register.maintenance-Bsbgpe-Z.js → register.maintenance-BO1XWhVb.js} +7 -7
  111. package/dist/{register.maintenance-BdBlQQ6G.js → register.maintenance-DK_p-7so.js} +8 -8
  112. package/dist/{register.message-BE0gDUQZ.js → register.message-B194ue2R.js} +2 -2
  113. package/dist/{register.message-DAyubW1M.js → register.message-B4CGCAn_.js} +2 -2
  114. package/dist/{register.onboard-CqavyaNa.js → register.onboard-DidMCka8.js} +4 -4
  115. package/dist/{register.onboard-CTKa4O9W.js → register.onboard-Dt53qGB5.js} +4 -4
  116. package/dist/{register.setup-DpkI2F6r.js → register.setup-CLV1kk2-.js} +4 -4
  117. package/dist/{register.setup-BO3CD8Pz.js → register.setup-DgUxMRZR.js} +4 -4
  118. package/dist/{register.status-health-sessions-C5Qa-DmU.js → register.status-health-sessions-CB10JLY6.js} +3 -3
  119. package/dist/{register.status-health-sessions-ClDUpT3j.js → register.status-health-sessions-TvGuwVoR.js} +3 -3
  120. package/dist/{register.subclis-Bvil7KuO.js → register.subclis-elNdyQio.js} +9 -9
  121. package/dist/{registry-UkL38jvt.js → registry-DYq1AYOv.js} +17 -17
  122. package/dist/{replies-mfnbLu2p.js → replies-LSmuwOhA.js} +3 -3
  123. package/dist/{reply-4ilKYVzu.js → reply-DUZvOCsG.js} +14 -4
  124. package/dist/{reply-prefix-DkGsdyBm.js → reply-prefix-DpqZu44Z.js} +1 -1
  125. package/dist/{resolve-route-q8AFnU5c.js → resolve-route-C4_I4GFI.js} +4 -4
  126. package/dist/{retry-CqMeDhyp.js → retry-BBVXkKBV.js} +1 -1
  127. package/dist/{run-main-D1n_tgGX.js → run-main-gBPGqO8r.js} +14 -14
  128. package/dist/{runner-CKYly94z.js → runner-CU9l0uJh.js} +22 -22
  129. package/dist/{send-Cd81AY_Z.js → send-CQAKg_12.js} +7 -7
  130. package/dist/{send-qItpAHcI.js → send-CVMyYPQw.js} +6 -6
  131. package/dist/{send-D3zDmQim.js → send-CvhXrdgS.js} +10 -10
  132. package/dist/{send-XRUYukww.js → send-DAN9hA5h.js} +6 -6
  133. package/dist/{send-B7z8CDbr.js → send-DYj_o4_F.js} +18 -18
  134. package/dist/{server-methods-BRdl4pcP.js → server-methods-BG0N79yY.js} +7 -7
  135. package/dist/{server-methods-VC0ahxUh.js → server-methods-dgW-8gC7.js} +7 -7
  136. package/dist/{server-node-events-Y5xFGvsj.js → server-node-events-B_hsQw_N.js} +2 -2
  137. package/dist/{server-node-events-Bq2fr8Z3.js → server-node-events-ZtQKBPo3.js} +2 -2
  138. package/dist/{session-Dh2wWQkD.js → session-DSU1vxxi.js} +8 -8
  139. package/dist/{skill-commands-B_f8uGi7.js → skill-commands-DcVwOafC.js} +16 -16
  140. package/dist/{skills-CGHRETGF.js → skills-Bs0AW1g3.js} +24 -24
  141. package/dist/{sqlite-Bv87EXeg.js → sqlite-D_mz1_-y.js} +16 -16
  142. package/dist/{status-BxNHXm7T.js → status-BqhJ-HsW.js} +1 -1
  143. package/dist/{status-DOCg6R55.js → status-Cd9-xWsZ.js} +2 -2
  144. package/dist/{status-CRCD2RpZ.js → status-D-IvYfjk.js} +2 -2
  145. package/dist/{status-DNJBoKuu.js → status-D4Lr90yH.js} +1 -1
  146. package/dist/{store-Ea3zM6xK.js → store-01F_JM7O.js} +6 -6
  147. package/dist/{subagent-registry-7wPEZQKK.js → subagent-registry-J2pIBQF7.js} +14 -4
  148. package/dist/{subsystem-DN75fnEF.js → subsystem-BjyjJF-d.js} +1 -1
  149. package/dist/{tables-BX7_aBvN.js → tables-qMwbq29u.js} +1 -1
  150. package/dist/{target-errors-7KhTCTdS.js → target-errors-Bbr9rlzN.js} +2 -2
  151. package/dist/{thinking-C9-JAUzD.js → thinking-BprCy23Z.js} +5 -5
  152. package/dist/{tokens-BZGy4v--.js → tokens-Bux9Y_xD.js} +1 -1
  153. package/dist/{tool-images-B1qVCntj.js → tool-images-SqqWIT22.js} +2 -2
  154. package/dist/{tool-loop-detection-C8FBZVVx.js → tool-loop-detection-DR_rrIA1.js} +3 -3
  155. package/dist/{unified-runner-quomT1T-.js → unified-runner-oH9Pt-cO.js} +232 -222
  156. package/dist/{update-cli-CcyCWvCB.js → update-cli-B7TLu25J.js} +8 -8
  157. package/dist/{update-cli-FOE23Lo4.js → update-cli-D8nA6U7C.js} +7 -7
  158. package/dist/{update-runner-CJg-OANA.js → update-runner-D8AFB8Oi.js} +1 -1
  159. package/dist/{update-runner-Dcjlf0aY.js → update-runner-DvZOsoQs.js} +1 -1
  160. package/dist/{web-DcHxbz2H.js → web-0xZpP0WA.js} +57 -57
  161. package/dist/{web-CuNZExQK.js → web-CAy-xQv2.js} +1 -1
  162. package/dist/{web-BTmqdXgt.js → web-DDiOPIdv.js} +2 -2
  163. package/dist/{web-DPBfrIzo.js → web-mQInjWbW.js} +1 -1
  164. package/dist/{whatsapp-actions-SXenaJIn.js → whatsapp-actions-BIeSWsCF.js} +23 -23
  165. package/dist/{workspace-DqJ5h-ZB.js → workspace-DscDraUb.js} +27 -27
  166. package/package.json +1 -1
  167. package/dist/paths-CYmyCDsE.js +0 -212
@@ -1,76 +1,76 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
2
- import { c as expandHomePrefix, i as resolveGatewayPort, n as resolveConfigPath, s as resolveStateDir, t as STATE_DIR, u as resolveRequiredHomeDir } from "./paths-CYmyCDsE.js";
2
+ import { c as expandHomePrefix, i as resolveGatewayPort, n as resolveConfigPath, s as resolveStateDir, t as STATE_DIR, u as resolveRequiredHomeDir } from "./paths-CE7eVGHg.js";
3
3
  import { _ as isCronSessionKey, b as resolveThreadParentSessionKey, c as normalizeMainKey, d as sanitizeAgentId, f as DEFAULT_ACCOUNT_ID, g as isAcpSessionKey, h as getSubagentDepth, l as resolveAgentIdFromSessionKey, o as classifySessionKeyShape, p as normalizeAccountId$2, r as buildAgentMainSessionKey, s as normalizeAgentId, t as DEFAULT_AGENT_ID, u as resolveThreadSessionKeys, v as isSubagentSessionKey, y as parseAgentSessionKey } from "./session-key-BCzIW1Y2.js";
4
- import { $ as warn, B as sleep$1, D as escapeRegExp, E as ensureDir$3, G as danger, I as resolveUserPath, J as logVerbose, M as normalizeE164, O as formatTerminalLink, R as shortenHomeInString, S as CONFIG_DIR, U as truncateUtf16Safe, V as sliceUtf16Safe, W as isPlainObject, X as setVerbose, Z as shouldLogVerbose, _ as matchPluginCommand, a as normalizeAnyChannelId, d as createPluginRegistry, dt as resolvePreferredSymiTmpDir, et as colorize, f as normalizePluginHttpPath, g as listPluginCommands, h as getPluginCommandSpecs, k as isRecord$1, l as requireActivePluginRegistry, lt as normalizeLogLevel, m as executePluginCommand, n as CHAT_CHANNEL_ORDER, nt as theme, o as normalizeChannelId, p as clearPluginCommands, r as DEFAULT_CHAT_CHANNEL, rt as getChildLogger, tt as isRich, u as setActivePluginRegistry, v as createInternalHookEvent, w as clampInt, x as triggerInternalHook, z as shortenHomePath } from "./registry-UkL38jvt.js";
5
- import { a as resolveAgentModelPrimary, c as resolveDefaultAgentId, d as resolveSessionAgentIds, i as resolveAgentModelFallbacksOverride, l as resolveEffectiveModelFallbacks, n as resolveAgentConfig, o as resolveAgentSkillsFilter, r as resolveAgentDir, s as resolveAgentWorkspaceDir, t as listAgentIds, u as resolveSessionAgentId } from "./agent-scope-D68_xfTL.js";
6
- import { a as registerActiveProgressLine, i as clearActiveProgressLine, n as createNonExitingRuntime, o as unregisterActiveProgressLine, r as defaultRuntime, t as createSubsystemLogger } from "./subsystem-DN75fnEF.js";
7
- import { S as logWarn, _ as runExec, b as logError, f as loadWorkspaceBootstrapFiles, g as runCommandWithTimeout, i as DEFAULT_IDENTITY_FILENAME, l as ensureAgentWorkspace, m as resolveSymiPackageRoot, n as DEFAULT_AGENT_WORKSPACE_DIR, r as DEFAULT_BOOTSTRAP_FILENAME, u as filterBootstrapFilesForSession, v as spawnWithFallback, x as logInfo, y as logDebug } from "./workspace-DqJ5h-ZB.js";
8
- import { i as resolveSessionTranscriptPath, n as resolveSessionFilePath, o as resolveSessionTranscriptsDirForAgent, r as resolveSessionFilePathOptions, s as resolveStorePath, t as resolveDefaultSessionStorePath } from "./paths-DEuVuViW.js";
9
- import { $ as resolveSymiAgentDir, B as resolveApiKeyForProvider, C as normalizeProviderId, D as resolveModelRefFromString, E as resolveDefaultModelForAgent, F as OLLAMA_NATIVE_BASE_URL, H as resolveModelAuthMode, I as createOllamaStreamFn, K as resolveShellEnvFallbackTimeoutMs, L as getApiKeyForModel, O as resolveSubagentSpawnModelSelection, Q as resolveAuthProfileDisplayLabel, R as getCustomProviderApiKey, S as normalizeModelRef$2, T as resolveConfiguredModelRef, U as normalizeSecretInput, V as resolveEnvApiKey, W as getShellPathFromLoginShell, X as DEFAULT_MODEL, Y as DEFAULT_CONTEXT_TOKENS, Z as DEFAULT_PROVIDER, _ as buildConfiguredAllowlistKeys, a as markAuthProfileFailure, b as isCliProvider, c as dedupeProfileIds, d as ensureAuthProfileStore, f as resolveAuthStorePathForDisplay, g as buildAllowedModelSet, i as isProfileInCooldown, k as resolveThinkingDefault, l as listProfilesForProvider, n as resolveAuthProfileOrder, o as markAuthProfileUsed, p as withFileLock, r as getSoonestCooldownExpiry, s as resolveApiKeyForProfile, u as markAuthProfileGood, v as buildModelAliasIndex, x as modelKey, y as findNormalizedProviderValue, z as requireApiKey } from "./auth-profiles-Bl9aU7fc.js";
10
- import { n as formatCliCommand, r as resolveCliName, t as isTruthyEnvValue } from "./env-xmBFQPBP.js";
11
- import { a as saveJsonFile, i as loadJsonFile } from "./github-copilot-token-B8B2pmph.js";
4
+ import { $ as warn, B as sleep$1, D as escapeRegExp, E as ensureDir$3, G as danger, I as resolveUserPath, J as logVerbose, M as normalizeE164, O as formatTerminalLink, R as shortenHomeInString, S as CONFIG_DIR, U as truncateUtf16Safe, V as sliceUtf16Safe, W as isPlainObject, X as setVerbose, Z as shouldLogVerbose, _ as matchPluginCommand, a as normalizeAnyChannelId, d as createPluginRegistry, dt as resolvePreferredSymiTmpDir, et as colorize, f as normalizePluginHttpPath, g as listPluginCommands, h as getPluginCommandSpecs, k as isRecord$1, l as requireActivePluginRegistry, lt as normalizeLogLevel, m as executePluginCommand, n as CHAT_CHANNEL_ORDER, nt as theme, o as normalizeChannelId, p as clearPluginCommands, r as DEFAULT_CHAT_CHANNEL, rt as getChildLogger, tt as isRich, u as setActivePluginRegistry, v as createInternalHookEvent, w as clampInt, x as triggerInternalHook, z as shortenHomePath } from "./registry-DYq1AYOv.js";
5
+ import { a as resolveAgentModelPrimary, c as resolveDefaultAgentId, d as resolveSessionAgentIds, i as resolveAgentModelFallbacksOverride, l as resolveEffectiveModelFallbacks, n as resolveAgentConfig, o as resolveAgentSkillsFilter, r as resolveAgentDir, s as resolveAgentWorkspaceDir, t as listAgentIds, u as resolveSessionAgentId } from "./agent-scope-CpEJ0B88.js";
6
+ import { a as registerActiveProgressLine, i as clearActiveProgressLine, n as createNonExitingRuntime, o as unregisterActiveProgressLine, r as defaultRuntime, t as createSubsystemLogger } from "./subsystem-BjyjJF-d.js";
7
+ import { S as logWarn, _ as runExec, b as logError, f as loadWorkspaceBootstrapFiles, g as runCommandWithTimeout, i as DEFAULT_IDENTITY_FILENAME, l as ensureAgentWorkspace, m as resolveSymiPackageRoot, n as DEFAULT_AGENT_WORKSPACE_DIR, r as DEFAULT_BOOTSTRAP_FILENAME, u as filterBootstrapFilesForSession, v as spawnWithFallback, x as logInfo, y as logDebug } from "./workspace-DscDraUb.js";
8
+ import { i as resolveSessionTranscriptPath, n as resolveSessionFilePath, o as resolveSessionTranscriptsDirForAgent, r as resolveSessionFilePathOptions, s as resolveStorePath, t as resolveDefaultSessionStorePath } from "./paths-CbQV9WEg.js";
9
+ import { $ as resolveSymiAgentDir, B as resolveApiKeyForProvider, C as normalizeProviderId, D as resolveModelRefFromString, E as resolveDefaultModelForAgent, F as OLLAMA_NATIVE_BASE_URL, H as resolveModelAuthMode, I as createOllamaStreamFn, K as resolveShellEnvFallbackTimeoutMs, L as getApiKeyForModel, O as resolveSubagentSpawnModelSelection, Q as resolveAuthProfileDisplayLabel, R as getCustomProviderApiKey, S as normalizeModelRef$2, T as resolveConfiguredModelRef, U as normalizeSecretInput, V as resolveEnvApiKey, W as getShellPathFromLoginShell, X as DEFAULT_MODEL, Y as DEFAULT_CONTEXT_TOKENS, Z as DEFAULT_PROVIDER, _ as buildConfiguredAllowlistKeys, a as markAuthProfileFailure, b as isCliProvider, c as dedupeProfileIds, d as ensureAuthProfileStore, f as resolveAuthStorePathForDisplay, g as buildAllowedModelSet, i as isProfileInCooldown, k as resolveThinkingDefault, l as listProfilesForProvider, n as resolveAuthProfileOrder, o as markAuthProfileUsed, p as withFileLock, r as getSoonestCooldownExpiry, s as resolveApiKeyForProfile, u as markAuthProfileGood, v as buildModelAliasIndex, x as modelKey, y as findNormalizedProviderValue, z as requireApiKey } from "./auth-profiles-DdK1Hxaa.js";
10
+ import { n as formatCliCommand, r as resolveCliName, t as isTruthyEnvValue } from "./env-BDXYbTKj.js";
11
+ import { a as saveJsonFile, i as loadJsonFile } from "./github-copilot-token-cCYzSU9h.js";
12
12
  import { t as parseBooleanValue$1 } from "./boolean-CE7i9tBR.js";
13
- import { $ as normalizeDeliveryContext, A as isTransientHttpError, At as DEFAULT_UPLOAD_DIR, Bt as expandToolGroups, C as isContextOverflowError, Ct as resolveGroupSessionKey, D as isRateLimitAssistantError, Dt as registerBrowserRoutes, E as isLikelyContextOverflowError, Et as createBrowserRouteContext, F as resolveSandboxContext, Ft as resolveSandboxConfigForAgent, G as updateLastRoute, Gt as compileGlobPatterns, H as loadSessionStore, Ht as normalizeToolName, I as resolveSandboxRuntimeStatus, It as applyOwnerOnlyToolPolicy, J as isCacheEnabled, Jt as ensureSessionHeader, K as updateSessionStore, Kt as matchesAnyGlobPattern, L as extractDeliveryInfo, Lt as buildPluginToolGroups, M as parseImageSizeError, Mt as getBridgeAuthForPort, N as sanitizeUserFacingText, Nt as ensureBrowserControlAuth, O as isRawApiErrorPayload, Ot as resolveBrowserConfig, P as ensureSandboxWorkspaceForSession, Pt as resolveBrowserControlAuth, Q as mergeDeliveryContext, R as parseSessionThreadInfo, Rt as collectExplicitAllowlist, S as isCompactionFailureError, St as deriveSessionMetaPatch, T as isFailoverErrorMessage, Tt as resolveSessionLockMaxHoldFromTimeout, U as readSessionUpdatedAt, Ut as resolveToolProfilePolicy, V as resolveAndPersistSessionFile, Vt as mergeAlsoAllowPolicy, W as recordSessionMetaFromInbound, Wt as stripPluginOnlyAllowlist, X as deliveryContextFromSession, Xt as resolveBootstrapTotalMaxChars, Y as resolveCacheTtlMs$1, Yt as resolveBootstrapMaxChars, Z as deliveryContextKey, Zt as sanitizeGoogleTurnOrdering, _ as formatRawAssistantErrorForUi, _t as resolveFreshSessionTotalTokens, a as isMessagingToolDuplicateNormalized, at as extractToolCallNames, b as isBillingAssistantError, bt as resolveExplicitAgentSessionKey, c as extractToolCallsFromAssistant, ct as hasInterSessionUserProvenance, d as isAntigravityClaude, dt as evaluateSessionFreshness, et as normalizeSessionDeliveryFields, f as isGoogleModelApi, ft as resolveChannelResetConfig, g as formatBillingErrorMessage, gt as DEFAULT_RESET_TRIGGERS, h as formatAssistantErrorText, ht as resolveThreadFlag, it as countToolResults, j as parseImageDimensionError, jt as resolveExistingPathsWithinRoot, k as isTimeoutErrorMessage, kt as resolveProfile, l as extractToolResultId, lt as normalizeInputProvenance, m as classifyFailoverReason, mt as resolveSessionResetType, n as validateGeminiTurns, nt as archiveSessionTranscripts, o as normalizeTextForComparison, ot as INPUT_PROVENANCE_KIND_VALUES, p as BILLING_ERROR_USER_MESSAGE, pt as resolveSessionResetPolicy, q as updateSessionStoreEntry, qt as buildBootstrapContextFiles, r as pickFallbackThinkingLevel, rt as capArrayByJsonBytes, s as sanitizeSessionMessagesImages, st as applyInputProvenanceToUserMessage, t as validateAnthropicTurns, tt as normalizeAccountId$3, u as downgradeOpenAIReasoningBlocks, ut as resolveSessionKey, v as getApiErrorPayloadFingerprint, vt as canonicalizeMainSessionAlias, w as isFailoverAssistantError, wt as acquireSessionWriteLock, x as isCloudCodeAssistFormatError, xt as resolveMainSessionKey, y as isAuthAssistantError, z as appendAssistantMessageToSessionTranscript, zt as expandPolicyWithPluginGroups } from "./pi-embedded-helpers-BU8EZuwx.js";
14
- import { A as VERSION, C as getConfigValueAtPath, D as isSafeExecutableValue, E as unsetConfigValueAtPath, O as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, S as unsetConfigOverride, T as setConfigValueAtPath, _ as parseDurationMs, a as writeConfigFile, b as resetConfigOverrides, c as TELEGRAM_COMMAND_NAME_PATTERN, f as isInboundPathAllowed, g as normalizeScpRemoteHost, h as resolveIMessageRemoteAttachmentRoots, i as resolveConfigSnapshotHash, k as resolveAgentMaxConcurrent, l as normalizeTelegramCommandName, m as resolveIMessageAttachmentRoots, n as loadConfig, o as validateConfigObjectWithPlugins, r as readConfigFileSnapshot, u as resolveTelegramCustomCommands, v as validateJsonSchemaValue, w as parseConfigPath, x as setConfigOverride, y as getConfigOverrides } from "./config-CvmE3Yx1.js";
15
- import { a as applyTestPluginDefaults, c as resolveMemorySlotDecision, d as isDangerousHostEnvVarName, i as safeStatSync, n as discoverSymiPlugins, o as normalizePluginsConfig, r as isPathInside, s as resolveEnableState, t as loadPluginManifestRegistry, u as isPathInsideWithRealpath } from "./manifest-registry-0J48biqr.js";
16
- import { C as rawDataToString, O as DEFAULT_AI_SNAPSHOT_MAX_CHARS, T as isSecureWebSocketUrl, x as ensureChromeExtensionRelayServer } from "./chrome-DRHvMBbb.js";
17
- import { c as assertSandboxPath, d as resolveSandboxedMediaSource, f as applySkillEnvOverrides, i as resolveSkillsPromptForRun, l as resolveSandboxInputPath, n as buildWorkspaceSkillSnapshot, p as applySkillEnvOverridesFromSnapshot, r as loadWorkspaceSkillEntries, s as assertMediaNotDataUrl } from "./skills-CGHRETGF.js";
13
+ import { $ as normalizeDeliveryContext, A as isTransientHttpError, At as DEFAULT_UPLOAD_DIR, Bt as expandToolGroups, C as isContextOverflowError, Ct as resolveGroupSessionKey, D as isRateLimitAssistantError, Dt as registerBrowserRoutes, E as isLikelyContextOverflowError, Et as createBrowserRouteContext, F as resolveSandboxContext, Ft as resolveSandboxConfigForAgent, G as updateLastRoute, Gt as compileGlobPatterns, H as loadSessionStore, Ht as normalizeToolName, I as resolveSandboxRuntimeStatus, It as applyOwnerOnlyToolPolicy, J as isCacheEnabled, Jt as ensureSessionHeader, K as updateSessionStore, Kt as matchesAnyGlobPattern, L as extractDeliveryInfo, Lt as buildPluginToolGroups, M as parseImageSizeError, Mt as getBridgeAuthForPort, N as sanitizeUserFacingText, Nt as ensureBrowserControlAuth, O as isRawApiErrorPayload, Ot as resolveBrowserConfig, P as ensureSandboxWorkspaceForSession, Pt as resolveBrowserControlAuth, Q as mergeDeliveryContext, R as parseSessionThreadInfo, Rt as collectExplicitAllowlist, S as isCompactionFailureError, St as deriveSessionMetaPatch, T as isFailoverErrorMessage, Tt as resolveSessionLockMaxHoldFromTimeout, U as readSessionUpdatedAt, Ut as resolveToolProfilePolicy, V as resolveAndPersistSessionFile, Vt as mergeAlsoAllowPolicy, W as recordSessionMetaFromInbound, Wt as stripPluginOnlyAllowlist, X as deliveryContextFromSession, Xt as resolveBootstrapTotalMaxChars, Y as resolveCacheTtlMs$1, Yt as resolveBootstrapMaxChars, Z as deliveryContextKey, Zt as sanitizeGoogleTurnOrdering, _ as formatRawAssistantErrorForUi, _t as resolveFreshSessionTotalTokens, a as isMessagingToolDuplicateNormalized, at as extractToolCallNames, b as isBillingAssistantError, bt as resolveExplicitAgentSessionKey, c as extractToolCallsFromAssistant, ct as hasInterSessionUserProvenance, d as isAntigravityClaude, dt as evaluateSessionFreshness, et as normalizeSessionDeliveryFields, f as isGoogleModelApi, ft as resolveChannelResetConfig, g as formatBillingErrorMessage, gt as DEFAULT_RESET_TRIGGERS, h as formatAssistantErrorText, ht as resolveThreadFlag, it as countToolResults, j as parseImageDimensionError, jt as resolveExistingPathsWithinRoot, k as isTimeoutErrorMessage, kt as resolveProfile, l as extractToolResultId, lt as normalizeInputProvenance, m as classifyFailoverReason, mt as resolveSessionResetType, n as validateGeminiTurns, nt as archiveSessionTranscripts, o as normalizeTextForComparison, ot as INPUT_PROVENANCE_KIND_VALUES, p as BILLING_ERROR_USER_MESSAGE, pt as resolveSessionResetPolicy, q as updateSessionStoreEntry, qt as buildBootstrapContextFiles, r as pickFallbackThinkingLevel, rt as capArrayByJsonBytes, s as sanitizeSessionMessagesImages, st as applyInputProvenanceToUserMessage, t as validateAnthropicTurns, tt as normalizeAccountId$3, u as downgradeOpenAIReasoningBlocks, ut as resolveSessionKey, v as getApiErrorPayloadFingerprint, vt as canonicalizeMainSessionAlias, w as isFailoverAssistantError, wt as acquireSessionWriteLock, x as isCloudCodeAssistFormatError, xt as resolveMainSessionKey, y as isAuthAssistantError, z as appendAssistantMessageToSessionTranscript, zt as expandPolicyWithPluginGroups } from "./pi-embedded-helpers-CfqDGQ9J.js";
14
+ import { A as VERSION, C as getConfigValueAtPath, D as isSafeExecutableValue, E as unsetConfigValueAtPath, O as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, S as unsetConfigOverride, T as setConfigValueAtPath, _ as parseDurationMs, a as writeConfigFile, b as resetConfigOverrides, c as TELEGRAM_COMMAND_NAME_PATTERN, f as isInboundPathAllowed, g as normalizeScpRemoteHost, h as resolveIMessageRemoteAttachmentRoots, i as resolveConfigSnapshotHash, k as resolveAgentMaxConcurrent, l as normalizeTelegramCommandName, m as resolveIMessageAttachmentRoots, n as loadConfig, o as validateConfigObjectWithPlugins, r as readConfigFileSnapshot, u as resolveTelegramCustomCommands, v as validateJsonSchemaValue, w as parseConfigPath, x as setConfigOverride, y as getConfigOverrides } from "./config-5SdHIcHU.js";
15
+ import { a as applyTestPluginDefaults, c as resolveMemorySlotDecision, d as isDangerousHostEnvVarName, i as safeStatSync, n as discoverSymiPlugins, o as normalizePluginsConfig, r as isPathInside, s as resolveEnableState, t as loadPluginManifestRegistry, u as isPathInsideWithRealpath } from "./manifest-registry-yb7sAlu4.js";
16
+ import { C as rawDataToString, O as DEFAULT_AI_SNAPSHOT_MAX_CHARS, T as isSecureWebSocketUrl, x as ensureChromeExtensionRelayServer } from "./chrome-DkaXoP36.js";
17
+ import { c as assertSandboxPath, d as resolveSandboxedMediaSource, f as applySkillEnvOverrides, i as resolveSkillsPromptForRun, l as resolveSandboxInputPath, n as buildWorkspaceSkillSnapshot, p as applySkillEnvOverridesFromSnapshot, r as loadWorkspaceSkillEntries, s as assertMediaNotDataUrl } from "./skills-Bs0AW1g3.js";
18
18
  import { n as formatErrorMessage, r as formatUncaughtError } from "./errors-XIsvXeC-.js";
19
- import { c as detectMime, d as imageMimeFromFormat, f as isAudioFileName, g as MAX_IMAGE_BYTES, i as getImageMetadata, l as extensionForMime, p as isGifMedia, s as resizeToJpeg, v as mediaKindFromMime } from "./image-ops-M5agStZn.js";
19
+ import { c as detectMime, d as imageMimeFromFormat, f as isAudioFileName, g as MAX_IMAGE_BYTES, i as getImageMetadata, l as extensionForMime, p as isGifMedia, s as resizeToJpeg, v as mediaKindFromMime } from "./image-ops-C7CauEK8.js";
20
20
  import { i as isBlockedHostnameOrIp, o as normalizeHostname, t as SsrFBlockedError } from "./ssrf-DpUUUgkK.js";
21
- import { n as getMediaDir, r as saveMediaBuffer } from "./store-Ea3zM6xK.js";
22
- import { _ as normalizeAtHashSlug, a as normalizeReasoningLevel, b as normalizeStringEntriesLower, c as normalizeVerboseLevel, d as getChannelDock, f as listChannelDocks, g as resolveChannelGroupToolsPolicy, h as resolveChannelGroupRequireMention, i as normalizeElevatedLevel, l as resolveResponseUsageMode, m as resolveChannelGroupPolicy, n as formatXHighModelHint, o as normalizeThinkLevel, p as normalizeSignalMessagingTarget, s as normalizeUsageDisplay, t as formatThinkingLevels, u as supportsXHighThinking, v as normalizeHyphenSlug, y as normalizeStringEntries } from "./thinking-C9-JAUzD.js";
23
- import { a as isMarkdownCapableMessageChannel, c as resolveGatewayMessageChannel, d as GATEWAY_CLIENT_MODES, f as GATEWAY_CLIENT_NAMES, i as isInternalMessageChannel, l as resolveMessageChannel, n as isDeliverableMessageChannel, o as listDeliverableMessageChannels, r as isGatewayMessageChannel, s as normalizeMessageChannel, t as INTERNAL_MESSAGE_CHANNEL, u as GATEWAY_CLIENT_IDS } from "./message-channel-DwDSKGn4.js";
21
+ import { n as getMediaDir, r as saveMediaBuffer } from "./store-01F_JM7O.js";
22
+ import { _ as normalizeAtHashSlug, a as normalizeReasoningLevel, b as normalizeStringEntriesLower, c as normalizeVerboseLevel, d as getChannelDock, f as listChannelDocks, g as resolveChannelGroupToolsPolicy, h as resolveChannelGroupRequireMention, i as normalizeElevatedLevel, l as resolveResponseUsageMode, m as resolveChannelGroupPolicy, n as formatXHighModelHint, o as normalizeThinkLevel, p as normalizeSignalMessagingTarget, s as normalizeUsageDisplay, t as formatThinkingLevels, u as supportsXHighThinking, v as normalizeHyphenSlug, y as normalizeStringEntries } from "./thinking-BprCy23Z.js";
23
+ import { a as isMarkdownCapableMessageChannel, c as resolveGatewayMessageChannel, d as GATEWAY_CLIENT_MODES, f as GATEWAY_CLIENT_NAMES, i as isInternalMessageChannel, l as resolveMessageChannel, n as isDeliverableMessageChannel, o as listDeliverableMessageChannels, r as isGatewayMessageChannel, s as normalizeMessageChannel, t as INTERNAL_MESSAGE_CHANNEL, u as GATEWAY_CLIENT_IDS } from "./message-channel-OlFBYAw8.js";
24
24
  import { t as normalizeChatType } from "./chat-type-3FRbbjbq.js";
25
25
  import { n as resolveConversationLabel } from "./conversation-label-Onz2hiJh.js";
26
- import { _ as resolveDiscordAccount, a as normalizeWhatsAppTarget, c as listTelegramAccountIds, d as resolveSlackAccount, g as listEnabledDiscordAccounts, h as createDiscordActionGate, i as isWhatsAppGroupJid, l as resolveTelegramAccount, m as resolveSlackBotToken, n as listChannelPlugins, o as createTelegramActionGate, p as resolveSlackAppToken, r as normalizeChannelId$1, s as listEnabledTelegramAccounts, t as getChannelPlugin, u as resolveTelegramToken, v as normalizeDiscordToken } from "./plugins-Bkr5ZdYs.js";
27
- import { a as logoutWeb, i as logWebSelfId, l as readWebSelfId, p as webAuthExists, r as getWebAuthAgeMs, t as resolveWhatsAppAccount } from "./accounts-D1r2dq1t.js";
28
- import { t as resolveIMessageAccount } from "./accounts-dRUMQQrB.js";
29
- import { n as resolveSignalAccount, t as listEnabledSignalAccounts } from "./accounts-wSphH5gv.js";
30
- import { a as resolveSlackWebClientOptions, c as buildSlackBlocksFallbackText, i as createSlackWebClient, l as parseSlackTarget, o as parseSlackBlocksInput, s as validateSlackBlocksArray, t as sendMessageSlack, u as resolveSlackChannelId } from "./send-qItpAHcI.js";
31
- import { $ as fetchChannelPermissionsDiscord, A as unpinMessageDiscord, B as listScheduledEventsDiscord, C as editMessageDiscord, Ct as resolveTimestampMs, D as pinMessageDiscord, Dt as normalizeChannelSlug, E as listThreadsDiscord, Et as buildChannelKeyCandidates, F as fetchMemberInfoDiscord, G as uploadStickerDiscord, H as timeoutMemberDiscord, I as fetchRoleInfoDiscord, J as editChannelDiscord, K as createChannelDiscord, L as fetchVoiceStatusDiscord, M as banMemberDiscord, N as createScheduledEventDiscord, O as readMessagesDiscord, Ot as resolveChannelEntryMatchWithFallback, P as fetchChannelInfoDiscord, Q as stripUndefinedFields, R as kickMemberDiscord, S as deleteMessageDiscord, St as resolveDiscordSystemLocation, T as listPinsDiscord, Tt as applyChannelMatchMeta, U as listGuildEmojisDiscord, V as removeRoleDiscord, W as uploadEmojiDiscord, X as removeChannelPermissionDiscord, Y as moveChannelDiscord, Z as setChannelPermissionDiscord, _ as sendPollDiscord, _t as resolveDiscordShouldRequireMention, a as removeReactionDiscord, at as resolveDiscordChannelId, b as sendWebhookMessageDiscord, bt as formatDiscordReactionEmoji, c as formatDiscordComponentEventText, ct as allowListMatches$1, d as parseDiscordModalCustomId, dt as normalizeDiscordSlug, et as hasAnyGuildPermissionDiscord, f as parseDiscordModalCustomIdForCarbon, ft as resolveDiscordAllowListMatch, g as sendMessageDiscord, gt as resolveDiscordOwnerAllowFrom, h as resolveDiscordModalEntry, ht as resolveDiscordMemberAccessState, i as removeOwnReactionsDiscord, it as parseDiscordTarget, j as addRoleDiscord, k as searchMessagesDiscord, l as parseDiscordComponentCustomId, lt as isDiscordGroupAllowedByPolicy, m as resolveDiscordComponentEntry, mt as resolveDiscordGuildEntry, n as fetchReactionsDiscord, nt as createDiscordClient, o as sendDiscordComponentMessage, ot as listDiscordDirectoryGroupsLive, p as readDiscordComponentSpec, pt as resolveDiscordChannelConfigWithFallback, q as deleteChannelDiscord, r as reactMessageDiscord, rt as createDiscordRestClient, s as createDiscordFormModal, st as listDiscordDirectoryPeersLive, tt as chunkDiscordTextWithMode, u as parseDiscordComponentCustomIdForCarbon, ut as normalizeDiscordAllowList, v as sendStickerDiscord, vt as resolveGroupDmAllow, w as fetchMessageDiscord, wt as fetchDiscord, x as createThreadDiscord, xt as formatDiscordUserTag, y as sendVoiceMessageDiscord, yt as shouldEmitDiscordReactionNotification, z as listGuildChannelsDiscord } from "./send-D3zDmQim.js";
26
+ import { _ as resolveDiscordAccount, a as normalizeWhatsAppTarget, c as listTelegramAccountIds, d as resolveSlackAccount, g as listEnabledDiscordAccounts, h as createDiscordActionGate, i as isWhatsAppGroupJid, l as resolveTelegramAccount, m as resolveSlackBotToken, n as listChannelPlugins, o as createTelegramActionGate, p as resolveSlackAppToken, r as normalizeChannelId$1, s as listEnabledTelegramAccounts, t as getChannelPlugin, u as resolveTelegramToken, v as normalizeDiscordToken } from "./plugins-BzmbgY7s.js";
27
+ import { a as logoutWeb, i as logWebSelfId, l as readWebSelfId, p as webAuthExists, r as getWebAuthAgeMs, t as resolveWhatsAppAccount } from "./accounts-BRw8yhIW.js";
28
+ import { t as resolveIMessageAccount } from "./accounts-3dCrO3oZ.js";
29
+ import { n as resolveSignalAccount, t as listEnabledSignalAccounts } from "./accounts-BuZxOb3B.js";
30
+ import { a as resolveSlackWebClientOptions, c as buildSlackBlocksFallbackText, i as createSlackWebClient, l as parseSlackTarget, o as parseSlackBlocksInput, s as validateSlackBlocksArray, t as sendMessageSlack, u as resolveSlackChannelId } from "./send-CVMyYPQw.js";
31
+ import { $ as fetchChannelPermissionsDiscord, A as unpinMessageDiscord, B as listScheduledEventsDiscord, C as editMessageDiscord, Ct as resolveTimestampMs, D as pinMessageDiscord, Dt as normalizeChannelSlug, E as listThreadsDiscord, Et as buildChannelKeyCandidates, F as fetchMemberInfoDiscord, G as uploadStickerDiscord, H as timeoutMemberDiscord, I as fetchRoleInfoDiscord, J as editChannelDiscord, K as createChannelDiscord, L as fetchVoiceStatusDiscord, M as banMemberDiscord, N as createScheduledEventDiscord, O as readMessagesDiscord, Ot as resolveChannelEntryMatchWithFallback, P as fetchChannelInfoDiscord, Q as stripUndefinedFields, R as kickMemberDiscord, S as deleteMessageDiscord, St as resolveDiscordSystemLocation, T as listPinsDiscord, Tt as applyChannelMatchMeta, U as listGuildEmojisDiscord, V as removeRoleDiscord, W as uploadEmojiDiscord, X as removeChannelPermissionDiscord, Y as moveChannelDiscord, Z as setChannelPermissionDiscord, _ as sendPollDiscord, _t as resolveDiscordShouldRequireMention, a as removeReactionDiscord, at as resolveDiscordChannelId, b as sendWebhookMessageDiscord, bt as formatDiscordReactionEmoji, c as formatDiscordComponentEventText, ct as allowListMatches$1, d as parseDiscordModalCustomId, dt as normalizeDiscordSlug, et as hasAnyGuildPermissionDiscord, f as parseDiscordModalCustomIdForCarbon, ft as resolveDiscordAllowListMatch, g as sendMessageDiscord, gt as resolveDiscordOwnerAllowFrom, h as resolveDiscordModalEntry, ht as resolveDiscordMemberAccessState, i as removeOwnReactionsDiscord, it as parseDiscordTarget, j as addRoleDiscord, k as searchMessagesDiscord, l as parseDiscordComponentCustomId, lt as isDiscordGroupAllowedByPolicy, m as resolveDiscordComponentEntry, mt as resolveDiscordGuildEntry, n as fetchReactionsDiscord, nt as createDiscordClient, o as sendDiscordComponentMessage, ot as listDiscordDirectoryGroupsLive, p as readDiscordComponentSpec, pt as resolveDiscordChannelConfigWithFallback, q as deleteChannelDiscord, r as reactMessageDiscord, rt as createDiscordRestClient, s as createDiscordFormModal, st as listDiscordDirectoryPeersLive, tt as chunkDiscordTextWithMode, u as parseDiscordComponentCustomIdForCarbon, ut as normalizeDiscordAllowList, v as sendStickerDiscord, vt as resolveGroupDmAllow, w as fetchMessageDiscord, wt as fetchDiscord, x as createThreadDiscord, xt as formatDiscordUserTag, y as sendVoiceMessageDiscord, yt as shouldEmitDiscordReactionNotification, z as listGuildChannelsDiscord } from "./send-CvhXrdgS.js";
32
32
  import { t as emitSessionTranscriptUpdate } from "./transcript-events-BBh3Gsrx.js";
33
- import { i as resolveImageSanitizationLimits, n as sanitizeImageBlocks, r as sanitizeToolResultImages } from "./tool-images-B1qVCntj.js";
34
- import { C as getGlobalHookRunner, S as parseInlineDirectives$1, _ as normalizeTargetForProvider, a as normalizeOutboundPayloadsForJson, b as MEDIA_TOKEN_RE, c as applyReplyThreading, d as isRenderablePayload, f as shouldSuppressMessagingToolReplies, g as normalizeChannelTargetInput, h as buildTargetResolverSignature, i as normalizeOutboundPayloads, l as filterMessagingToolDuplicates, m as resolveReplyToMode, o as normalizeReplyPayloadsForDelivery, p as createReplyToModeFilterForChannel, r as formatOutboundPayloadLog, s as applyReplyTagsToPayload, t as deliverOutboundPayloads, u as filterMessagingToolMediaDuplicates, v as throwIfAborted, w as initializeGlobalHookRunner, x as splitMediaFromOutput, y as parseReplyDirectives } from "./deliver-UMgfGLxW.js";
35
- import { a as logMessageProcessed, c as logWebhookError, d as startDiagnosticHeartbeat, f as stopDiagnosticHeartbeat, i as logLaneEnqueue, l as logWebhookProcessed, m as isDiagnosticsEnabled, o as logMessageQueued, p as emitDiagnosticEvent, r as logLaneDequeue, s as logSessionStateChange, t as diag, u as logWebhookReceived } from "./diagnostic-spWOtH_g.js";
33
+ import { i as resolveImageSanitizationLimits, n as sanitizeImageBlocks, r as sanitizeToolResultImages } from "./tool-images-SqqWIT22.js";
34
+ import { C as getGlobalHookRunner, S as parseInlineDirectives$1, _ as normalizeTargetForProvider, a as normalizeOutboundPayloadsForJson, b as MEDIA_TOKEN_RE, c as applyReplyThreading, d as isRenderablePayload, f as shouldSuppressMessagingToolReplies, g as normalizeChannelTargetInput, h as buildTargetResolverSignature, i as normalizeOutboundPayloads, l as filterMessagingToolDuplicates, m as resolveReplyToMode, o as normalizeReplyPayloadsForDelivery, p as createReplyToModeFilterForChannel, r as formatOutboundPayloadLog, s as applyReplyTagsToPayload, t as deliverOutboundPayloads, u as filterMessagingToolMediaDuplicates, v as throwIfAborted, w as initializeGlobalHookRunner, x as splitMediaFromOutput, y as parseReplyDirectives } from "./deliver-C46-vyqg.js";
35
+ import { a as logMessageProcessed, c as logWebhookError, d as startDiagnosticHeartbeat, f as stopDiagnosticHeartbeat, i as logLaneEnqueue, l as logWebhookProcessed, m as isDiagnosticsEnabled, o as logMessageQueued, p as emitDiagnosticEvent, r as logLaneDequeue, s as logSessionStateChange, t as diag, u as logWebhookReceived } from "./diagnostic-rPhsBoZz.js";
36
36
  import { r as getDiagnosticSessionState } from "./diagnostic-session-state-Zw87xFym.js";
37
- import { S as ensureSymiModelsJson, _ as stripMinimaxToolCallXml, a as decodeDataUrl, b as stripReasoningTagsFromText, c as extractAssistantText$1, d as extractThinkingFromTaggedText, f as formatReasoningMessage, g as stripDowngradedToolCallText, h as promoteThinkingTagsToBlocks, i as coerceImageModelConfig, l as extractAssistantThinking, m as isAssistantMessage, o as resolveProviderVisionModelFromConfig, p as inferToolMetaFromArgs, r as coerceImageAssistantText, s as minimaxUnderstandImage, u as extractThinkingFromTaggedStream, v as stripThinkingTagsFromText, x as extractTextFromChatContent, y as resolveToolDisplay } from "./image-CK4oZUJJ.js";
38
- import { a as isSilentReplyText, i as isSilentReplyPrefixText, n as SILENT_REPLY_TOKEN, r as SYMIPULSE_TOKEN, t as HEARTBEAT_TOKEN } from "./tokens-BZGy4v--.js";
39
- import { $ as isVoiceCompatibleAudio, A as extractTelegramLocation, B as normalizeAllowFromWithStore$1, C as buildTelegramGroupFrom, D as buildTypingThreadParams, E as buildTelegramThreadParams, F as resolveTelegramMediaPlaceholder, G as formatLocationText, H as firstDefined$1, I as resolveTelegramReplyId, J as readChannelAllowFromStore, K as toLocationContext, L as resolveTelegramStreamMode, M as normalizeForwardedContext, N as resolveTelegramForumThreadId, O as describeReplyTarget, P as resolveTelegramGroupAllowFromContext, Q as listPairingChannels, R as resolveTelegramThreadSpec, S as buildSenderName, T as buildTelegramParentPeer, U as isSenderIdAllowed, V as resolveSenderAllowMatch, W as mergeAllowFromSources, X as upsertChannelPairingRequest, Y as removeChannelAllowFromStoreEntry, Z as getPairingAdapter, _ as resolveTelegramFetch, a as reactMessageTelegram, b as buildGroupLabel, c as sendStickerTelegram, d as wasSentByBot, et as parseTelegramTarget, f as isRecoverableTelegramNetworkError, g as wrapFileReferencesInHtml, h as renderTelegramHtmlText, i as editMessageTelegram, j as hasBotMention, k as expandTextLinks, m as markdownToTelegramHtml, n as createForumTopicTelegram, o as sendMessageTelegram, p as markdownToTelegramChunks, q as addChannelAllowFromStoreEntry, r as deleteMessageTelegram, s as sendPollTelegram, t as buildInlineKeyboard, tt as resolveTelegramTargetChatType, u as resolveTelegramVoiceSend, v as splitTelegramCaption, w as buildTelegramGroupPeerId, x as buildSenderLabel, y as withTelegramApiErrorLogging, z as isSenderAllowed$1 } from "./send-B7z8CDbr.js";
37
+ import { S as ensureSymiModelsJson, _ as stripMinimaxToolCallXml, a as decodeDataUrl, b as stripReasoningTagsFromText, c as extractAssistantText$1, d as extractThinkingFromTaggedText, f as formatReasoningMessage, g as stripDowngradedToolCallText, h as promoteThinkingTagsToBlocks, i as coerceImageModelConfig, l as extractAssistantThinking, m as isAssistantMessage, o as resolveProviderVisionModelFromConfig, p as inferToolMetaFromArgs, r as coerceImageAssistantText, s as minimaxUnderstandImage, u as extractThinkingFromTaggedStream, v as stripThinkingTagsFromText, x as extractTextFromChatContent, y as resolveToolDisplay } from "./image-CuzFLQWC.js";
38
+ import { a as isSilentReplyText, i as isSilentReplyPrefixText, n as SILENT_REPLY_TOKEN, r as SYMIPULSE_TOKEN, t as HEARTBEAT_TOKEN } from "./tokens-Bux9Y_xD.js";
39
+ import { $ as isVoiceCompatibleAudio, A as extractTelegramLocation, B as normalizeAllowFromWithStore$1, C as buildTelegramGroupFrom, D as buildTypingThreadParams, E as buildTelegramThreadParams, F as resolveTelegramMediaPlaceholder, G as formatLocationText, H as firstDefined$1, I as resolveTelegramReplyId, J as readChannelAllowFromStore, K as toLocationContext, L as resolveTelegramStreamMode, M as normalizeForwardedContext, N as resolveTelegramForumThreadId, O as describeReplyTarget, P as resolveTelegramGroupAllowFromContext, Q as listPairingChannels, R as resolveTelegramThreadSpec, S as buildSenderName, T as buildTelegramParentPeer, U as isSenderIdAllowed, V as resolveSenderAllowMatch, W as mergeAllowFromSources, X as upsertChannelPairingRequest, Y as removeChannelAllowFromStoreEntry, Z as getPairingAdapter, _ as resolveTelegramFetch, a as reactMessageTelegram, b as buildGroupLabel, c as sendStickerTelegram, d as wasSentByBot, et as parseTelegramTarget, f as isRecoverableTelegramNetworkError, g as wrapFileReferencesInHtml, h as renderTelegramHtmlText, i as editMessageTelegram, j as hasBotMention, k as expandTextLinks, m as markdownToTelegramHtml, n as createForumTopicTelegram, o as sendMessageTelegram, p as markdownToTelegramChunks, q as addChannelAllowFromStoreEntry, r as deleteMessageTelegram, s as sendPollTelegram, t as buildInlineKeyboard, tt as resolveTelegramTargetChatType, u as resolveTelegramVoiceSend, v as splitTelegramCaption, w as buildTelegramGroupPeerId, x as buildSenderLabel, y as withTelegramApiErrorLogging, z as isSenderAllowed$1 } from "./send-DYj_o4_F.js";
40
40
  import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-Bv5YDJc8.js";
41
- import { a as resolveAgentIdentity, i as resolveAckReaction, o as resolveEffectiveMessagesConfig, r as resolveResponsePrefixTemplate, s as resolveHumanDelayConfig, t as createReplyPrefixOptions } from "./reply-prefix-DkGsdyBm.js";
42
- import { i as resolveMemorySearchConfig, n as probeOllamaEmbeddingModels, r as resolveOllamaBaseUrl } from "./manager-DW3JqFpY.js";
43
- import { d as listMemoryFiles, f as normalizeExtraMemoryPaths, g as runTasksWithConcurrency } from "./sqlite-Bv87EXeg.js";
44
- import { n as retryAsync } from "./retry-CqMeDhyp.js";
45
- import { a as createActionGate, c as jsonResult, d as readReactionParams, f as readStringArrayParam, l as parseAvailableTags, m as readStringParam, n as missingTargetError, o as imageResult, p as readStringOrNumberParam, r as unknownTargetError, s as imageResultFromFile, t as ambiguousTargetError, u as readNumberParam } from "./target-errors-7KhTCTdS.js";
46
- import { a as chunkText, c as resolveChunkMode, d as isSafeFenceBreak, f as parseFenceSpans, i as chunkMarkdownTextWithMode, l as resolveTextChunkLimit, o as chunkTextWithMode, r as chunkMarkdownText, t as chunkByNewline, u as findFenceSpanAt } from "./chunk-DR8ukp6r.js";
47
- import { n as resolveMarkdownTableMode } from "./markdown-tables-tW9bGjLM.js";
41
+ import { a as resolveAgentIdentity, i as resolveAckReaction, o as resolveEffectiveMessagesConfig, r as resolveResponsePrefixTemplate, s as resolveHumanDelayConfig, t as createReplyPrefixOptions } from "./reply-prefix-DpqZu44Z.js";
42
+ import { i as resolveMemorySearchConfig, n as probeOllamaEmbeddingModels, r as resolveOllamaBaseUrl } from "./manager-PprhCvO_.js";
43
+ import { d as listMemoryFiles, f as normalizeExtraMemoryPaths, g as runTasksWithConcurrency } from "./sqlite-D_mz1_-y.js";
44
+ import { n as retryAsync } from "./retry-BBVXkKBV.js";
45
+ import { a as createActionGate, c as jsonResult, d as readReactionParams, f as readStringArrayParam, l as parseAvailableTags, m as readStringParam, n as missingTargetError, o as imageResult, p as readStringOrNumberParam, r as unknownTargetError, s as imageResultFromFile, t as ambiguousTargetError, u as readNumberParam } from "./target-errors-Bbr9rlzN.js";
46
+ import { a as chunkText, c as resolveChunkMode, d as isSafeFenceBreak, f as parseFenceSpans, i as chunkMarkdownTextWithMode, l as resolveTextChunkLimit, o as chunkTextWithMode, r as chunkMarkdownText, t as chunkByNewline, u as findFenceSpanAt } from "./chunk-09egQapi.js";
47
+ import { n as resolveMarkdownTableMode } from "./markdown-tables-C-BmIap8.js";
48
48
  import { n as fetchWithTimeout, t as bindAbortRelay } from "./fetch-timeout-DL3f_O53.js";
49
- import { a as readResponseWithLimit, i as fetchRemoteMedia, n as getDefaultMediaLocalRoots, o as fetchWithSsrFGuard, t as getAgentScopedMediaLocalRoots } from "./local-roots-CdXg5-Cx.js";
50
- import { a as loadWebMedia, i as getDefaultLocalRoots } from "./ir-B-XXcYFe.js";
51
- import { _ as resolveNativeCommandsEnabled, a as listChatCommandsForConfig, c as normalizeCommandBody, d as resolveCommandArgMenu, f as serializeCommandArgs, g as isRestartEnabled, h as isNativeCommandsExplicitlyDisabled, i as listChatCommands, l as parseCommandArgs, m as isCommandFlagEnabled, o as listNativeCommandSpecs, p as shouldHandleTextCommands, r as findCommandByNativeName, s as listNativeCommandSpecsForConfig, t as buildCommandTextFromArgs, u as resolveCommandArgChoices, v as resolveNativeSkillsEnabled } from "./commands-registry-DIakZUZb.js";
52
- import { _ as CLI_OUTPUT_MAX_BUFFER, a as resolveMediaAttachmentLocalRoots, c as loadModelCatalog, d as resolveAttachmentKind, f as buildRandomTempFilePath, g as resolveMediaUnderstandingScope, h as normalizeMediaUnderstandingChatType, i as resolveAutoImageModel, l as modelSupportsVision, m as resolveTimeoutMs$1, n as createMediaAttachmentCache, o as runCapability, p as resolveConcurrency, r as normalizeMediaAttachments, s as findModelInCatalog, t as buildProviderRegistry, v as applyTemplate, y as registerUnhandledRejectionHandler } from "./runner-CKYly94z.js";
53
- import { c as getSkillsSnapshotVersion, d as createAsyncLock, f as readJsonFile, i as resolveSkillCommandInvocation, l as pruneExpiredPending, n as listSkillCommandsForAgents, o as getRemoteSkillEligibility, p as writeJsonAtomic, r as listSkillCommandsForWorkspace, s as ensureSkillsWatcher, t as listReservedChatSlashCommandNames, u as resolvePairingPaths } from "./skill-commands-B_f8uGi7.js";
49
+ import { a as readResponseWithLimit, i as fetchRemoteMedia, n as getDefaultMediaLocalRoots, o as fetchWithSsrFGuard, t as getAgentScopedMediaLocalRoots } from "./local-roots-DhZz0Ybs.js";
50
+ import { a as loadWebMedia, i as getDefaultLocalRoots } from "./ir-CTiz95Vb.js";
51
+ import { _ as resolveNativeCommandsEnabled, a as listChatCommandsForConfig, c as normalizeCommandBody, d as resolveCommandArgMenu, f as serializeCommandArgs, g as isRestartEnabled, h as isNativeCommandsExplicitlyDisabled, i as listChatCommands, l as parseCommandArgs, m as isCommandFlagEnabled, o as listNativeCommandSpecs, p as shouldHandleTextCommands, r as findCommandByNativeName, s as listNativeCommandSpecsForConfig, t as buildCommandTextFromArgs, u as resolveCommandArgChoices, v as resolveNativeSkillsEnabled } from "./commands-registry-Bfc7Uz0o.js";
52
+ import { _ as CLI_OUTPUT_MAX_BUFFER, a as resolveMediaAttachmentLocalRoots, c as loadModelCatalog, d as resolveAttachmentKind, f as buildRandomTempFilePath, g as resolveMediaUnderstandingScope, h as normalizeMediaUnderstandingChatType, i as resolveAutoImageModel, l as modelSupportsVision, m as resolveTimeoutMs$1, n as createMediaAttachmentCache, o as runCapability, p as resolveConcurrency, r as normalizeMediaAttachments, s as findModelInCatalog, t as buildProviderRegistry, v as applyTemplate, y as registerUnhandledRejectionHandler } from "./runner-CU9l0uJh.js";
53
+ import { c as getSkillsSnapshotVersion, d as createAsyncLock, f as readJsonFile, i as resolveSkillCommandInvocation, l as pruneExpiredPending, n as listSkillCommandsForAgents, o as getRemoteSkillEligibility, p as writeJsonAtomic, r as listSkillCommandsForWorkspace, s as ensureSkillsWatcher, t as listReservedChatSlashCommandNames, u as resolvePairingPaths } from "./skill-commands-DcVwOafC.js";
54
54
  import { r as normalizeInboundTextNewlines, t as finalizeInboundContext } from "./inbound-context-DSDTl6Kj.js";
55
55
  import { n as wrapFetchWithAbortSignal, t as resolveFetch } from "./fetch-Bso4i15F.js";
56
56
  import { n as recordCommandPoll, r as resetCommandPollCount } from "./command-poll-backoff-Bup9wS1y.js";
57
- import { n as recordChannelActivity, r as createDiscordRetryRunner, t as getChannelActivity } from "./channel-activity-DK0AV-r9.js";
57
+ import { n as recordChannelActivity, r as createDiscordRetryRunner, t as getChannelActivity } from "./channel-activity-B6G1jnQT.js";
58
58
  import { n as normalizePollInput } from "./polls-CCuCaqgv.js";
59
- import { t as convertMarkdownTables } from "./tables-BX7_aBvN.js";
60
- import { a as resolveSignalRpcContext, c as streamSignalEvents, n as sendReadReceiptSignal, o as signalCheck, r as sendTypingSignal, s as signalRpcRequest, t as sendMessageSignal } from "./send-XRUYukww.js";
61
- import { a as formatIMessageChatTarget, c as parseIMessageTarget, i as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS, o as isAllowedIMessageSender, r as createIMessageRpcClient, s as normalizeIMessageHandle, t as sendMessageIMessage } from "./send-Cd81AY_Z.js";
62
- import { n as resolveAgentRoute, t as buildAgentSessionKey } from "./resolve-route-q8AFnU5c.js";
59
+ import { t as convertMarkdownTables } from "./tables-qMwbq29u.js";
60
+ import { a as resolveSignalRpcContext, c as streamSignalEvents, n as sendReadReceiptSignal, o as signalCheck, r as sendTypingSignal, s as signalRpcRequest, t as sendMessageSignal } from "./send-DAN9hA5h.js";
61
+ import { a as formatIMessageChatTarget, c as parseIMessageTarget, i as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS, o as isAllowedIMessageSender, r as createIMessageRpcClient, s as normalizeIMessageHandle, t as sendMessageIMessage } from "./send-CQAKg_12.js";
62
+ import { n as resolveAgentRoute, t as buildAgentSessionKey } from "./resolve-route-C4_I4GFI.js";
63
63
  import { t as makeProxyFetch } from "./proxy-CBJ1upuz.js";
64
- import { a as createReplyReferencePlanner, i as resolveSlackThreadTs, n as deliverReplies$3, t as createSlackReplyDeliveryPlan } from "./replies-mfnbLu2p.js";
65
- import { t as getActiveWebListener } from "./active-listener-DFUTUjxt.js";
64
+ import { a as createReplyReferencePlanner, i as resolveSlackThreadTs, n as deliverReplies$3, t as createSlackReplyDeliveryPlan } from "./replies-LSmuwOhA.js";
65
+ import { t as getActiveWebListener } from "./active-listener-CfHHV2SU.js";
66
66
  import { createRequire } from "node:module";
67
67
  import * as path$1 from "node:path";
68
68
  import path from "node:path";
69
- import fsSync, { existsSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
69
+ import fs, { existsSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
70
70
  import os, { homedir } from "node:os";
71
71
  import JSON5 from "json5";
72
- import * as fs$1 from "node:fs/promises";
73
- import fs from "node:fs/promises";
72
+ import * as fs$2 from "node:fs/promises";
73
+ import fs$1 from "node:fs/promises";
74
74
  import { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
75
75
  import { inspect, promisify } from "node:util";
76
76
  import { fileURLToPath } from "node:url";
@@ -3895,7 +3895,7 @@ async function resolveSymiDocsPath(params) {
3895
3895
  const workspaceDir = params.workspaceDir?.trim();
3896
3896
  if (workspaceDir) {
3897
3897
  const workspaceDocs = path.join(workspaceDir, "docs");
3898
- if (fsSync.existsSync(workspaceDocs)) return workspaceDocs;
3898
+ if (fs.existsSync(workspaceDocs)) return workspaceDocs;
3899
3899
  }
3900
3900
  const packageRoot = await resolveSymiPackageRoot({
3901
3901
  cwd: params.cwd,
@@ -3904,7 +3904,7 @@ async function resolveSymiDocsPath(params) {
3904
3904
  });
3905
3905
  if (!packageRoot) return null;
3906
3906
  const packageDocs = path.join(packageRoot, "docs");
3907
- return fsSync.existsSync(packageDocs) ? packageDocs : null;
3907
+ return fs.existsSync(packageDocs) ? packageDocs : null;
3908
3908
  }
3909
3909
 
3910
3910
  //#endregion
@@ -4213,7 +4213,7 @@ async function getMemorySearchManager(params) {
4213
4213
  if (cached) return { manager: cached };
4214
4214
  }
4215
4215
  try {
4216
- const { QmdMemoryManager } = await import("./qmd-manager-BKu9rOuB.js");
4216
+ const { QmdMemoryManager } = await import("./qmd-manager-iDLSiI4Z.js");
4217
4217
  const primary = await QmdMemoryManager.create({
4218
4218
  cfg: params.cfg,
4219
4219
  agentId: params.agentId,
@@ -4225,7 +4225,7 @@ async function getMemorySearchManager(params) {
4225
4225
  const wrapper = new FallbackMemoryManager({
4226
4226
  primary,
4227
4227
  fallbackFactory: async () => {
4228
- const { MemoryIndexManager } = await import("./manager-DW3JqFpY.js").then((n) => n.t);
4228
+ const { MemoryIndexManager } = await import("./manager-PprhCvO_.js").then((n) => n.t);
4229
4229
  return await MemoryIndexManager.get(params);
4230
4230
  }
4231
4231
  }, () => QMD_MANAGER_CACHE.delete(cacheKey));
@@ -4238,7 +4238,7 @@ async function getMemorySearchManager(params) {
4238
4238
  }
4239
4239
  }
4240
4240
  try {
4241
- const { MemoryIndexManager } = await import("./manager-DW3JqFpY.js").then((n) => n.t);
4241
+ const { MemoryIndexManager } = await import("./manager-PprhCvO_.js").then((n) => n.t);
4242
4242
  return { manager: await MemoryIndexManager.get(params) };
4243
4243
  } catch (err) {
4244
4244
  return {
@@ -6786,7 +6786,7 @@ async function recordLoopOutcome(args) {
6786
6786
  if (!args.ctx?.sessionKey) return;
6787
6787
  try {
6788
6788
  const { getDiagnosticSessionState } = await import("./diagnostic-session-state-Zw87xFym.js").then((n) => n.n);
6789
- const { recordToolCallOutcome } = await import("./tool-loop-detection-C8FBZVVx.js");
6789
+ const { recordToolCallOutcome } = await import("./tool-loop-detection-DR_rrIA1.js");
6790
6790
  recordToolCallOutcome(getDiagnosticSessionState({
6791
6791
  sessionKey: args.ctx.sessionKey,
6792
6792
  sessionId: args.ctx?.agentId
@@ -6807,8 +6807,8 @@ async function runBeforeToolCallHook(args) {
6807
6807
  const params = args.params;
6808
6808
  if (args.ctx?.sessionKey) {
6809
6809
  const { getDiagnosticSessionState } = await import("./diagnostic-session-state-Zw87xFym.js").then((n) => n.n);
6810
- const { logToolLoopAction } = await import("./diagnostic-spWOtH_g.js").then((n) => n.n);
6811
- const { detectToolCallLoop, recordToolCall } = await import("./tool-loop-detection-C8FBZVVx.js");
6810
+ const { logToolLoopAction } = await import("./diagnostic-rPhsBoZz.js").then((n) => n.n);
6811
+ const { detectToolCallLoop, recordToolCall } = await import("./tool-loop-detection-DR_rrIA1.js");
6812
6812
  const sessionState = getDiagnosticSessionState({
6813
6813
  sessionKey: args.ctx.sessionKey,
6814
6814
  sessionId: args.ctx?.agentId
@@ -7095,7 +7095,7 @@ function resolveDefaultIdentityPath() {
7095
7095
  return path.join(resolveStateDir(), "identity", "device.json");
7096
7096
  }
7097
7097
  function ensureDir$2(filePath) {
7098
- fsSync.mkdirSync(path.dirname(filePath), { recursive: true });
7098
+ fs.mkdirSync(path.dirname(filePath), { recursive: true });
7099
7099
  }
7100
7100
  const ED25519_SPKI_PREFIX = Buffer.from("302a300506032b6570032100", "hex");
7101
7101
  function base64UrlEncode(buf) {
@@ -7131,8 +7131,8 @@ function generateIdentity() {
7131
7131
  }
7132
7132
  function loadOrCreateDeviceIdentity(filePath = resolveDefaultIdentityPath()) {
7133
7133
  try {
7134
- if (fsSync.existsSync(filePath)) {
7135
- const raw = fsSync.readFileSync(filePath, "utf8");
7134
+ if (fs.existsSync(filePath)) {
7135
+ const raw = fs.readFileSync(filePath, "utf8");
7136
7136
  const parsed = JSON.parse(raw);
7137
7137
  if (parsed?.version === 1 && typeof parsed.deviceId === "string" && typeof parsed.publicKeyPem === "string" && typeof parsed.privateKeyPem === "string") {
7138
7138
  const derivedId = fingerprintPublicKey(parsed.publicKeyPem);
@@ -7141,9 +7141,9 @@ function loadOrCreateDeviceIdentity(filePath = resolveDefaultIdentityPath()) {
7141
7141
  ...parsed,
7142
7142
  deviceId: derivedId
7143
7143
  };
7144
- fsSync.writeFileSync(filePath, `${JSON.stringify(updated, null, 2)}\n`, { mode: 384 });
7144
+ fs.writeFileSync(filePath, `${JSON.stringify(updated, null, 2)}\n`, { mode: 384 });
7145
7145
  try {
7146
- fsSync.chmodSync(filePath, 384);
7146
+ fs.chmodSync(filePath, 384);
7147
7147
  } catch {}
7148
7148
  return {
7149
7149
  deviceId: derivedId,
@@ -7168,9 +7168,9 @@ function loadOrCreateDeviceIdentity(filePath = resolveDefaultIdentityPath()) {
7168
7168
  privateKeyPem: identity.privateKeyPem,
7169
7169
  createdAtMs: Date.now()
7170
7170
  };
7171
- fsSync.writeFileSync(filePath, `${JSON.stringify(stored, null, 2)}\n`, { mode: 384 });
7171
+ fs.writeFileSync(filePath, `${JSON.stringify(stored, null, 2)}\n`, { mode: 384 });
7172
7172
  try {
7173
- fsSync.chmodSync(filePath, 384);
7173
+ fs.chmodSync(filePath, 384);
7174
7174
  } catch {}
7175
7175
  return identity;
7176
7176
  }
@@ -7193,7 +7193,7 @@ function normalizeFingerprint(input) {
7193
7193
  const execFileAsync = promisify(execFile);
7194
7194
  async function fileExists(filePath) {
7195
7195
  try {
7196
- await fs.access(filePath);
7196
+ await fs$1.access(filePath);
7197
7197
  return true;
7198
7198
  } catch {
7199
7199
  return false;
@@ -7220,8 +7220,8 @@ async function generateSelfSignedCert(params) {
7220
7220
  "-subj",
7221
7221
  "/CN=symi-gateway"
7222
7222
  ]);
7223
- await fs.chmod(params.keyPath, 384).catch(() => {});
7224
- await fs.chmod(params.certPath, 384).catch(() => {});
7223
+ await fs$1.chmod(params.keyPath, 384).catch(() => {});
7224
+ await fs$1.chmod(params.certPath, 384).catch(() => {});
7225
7225
  params.log?.info?.(`gateway tls: generated self-signed cert at ${shortenHomeInString(params.certPath)}`);
7226
7226
  }
7227
7227
  async function loadGatewayTlsRuntime(cfg, log) {
@@ -7259,9 +7259,9 @@ async function loadGatewayTlsRuntime(cfg, log) {
7259
7259
  error: "gateway tls: cert/key missing"
7260
7260
  };
7261
7261
  try {
7262
- const cert = await fs.readFile(certPath, "utf8");
7263
- const key = await fs.readFile(keyPath, "utf8");
7264
- const ca = caPath ? await fs.readFile(caPath, "utf8") : void 0;
7262
+ const cert = await fs$1.readFile(certPath, "utf8");
7263
+ const key = await fs$1.readFile(keyPath, "utf8");
7264
+ const ca = caPath ? await fs$1.readFile(caPath, "utf8") : void 0;
7265
7265
  const fingerprintSha256 = normalizeFingerprint(new X509Certificate(cert).fingerprint256 ?? "");
7266
7266
  if (!fingerprintSha256) return {
7267
7267
  enabled: false,
@@ -7320,8 +7320,8 @@ function resolveDeviceAuthPath(env = process.env) {
7320
7320
  }
7321
7321
  function readStore(filePath) {
7322
7322
  try {
7323
- if (!fsSync.existsSync(filePath)) return null;
7324
- const raw = fsSync.readFileSync(filePath, "utf8");
7323
+ if (!fs.existsSync(filePath)) return null;
7324
+ const raw = fs.readFileSync(filePath, "utf8");
7325
7325
  const parsed = JSON.parse(raw);
7326
7326
  if (parsed?.version !== 1 || typeof parsed.deviceId !== "string") return null;
7327
7327
  if (!parsed.tokens || typeof parsed.tokens !== "object") return null;
@@ -7331,10 +7331,10 @@ function readStore(filePath) {
7331
7331
  }
7332
7332
  }
7333
7333
  function writeStore(filePath, store) {
7334
- fsSync.mkdirSync(path.dirname(filePath), { recursive: true });
7335
- fsSync.writeFileSync(filePath, `${JSON.stringify(store, null, 2)}\n`, { mode: 384 });
7334
+ fs.mkdirSync(path.dirname(filePath), { recursive: true });
7335
+ fs.writeFileSync(filePath, `${JSON.stringify(store, null, 2)}\n`, { mode: 384 });
7336
7336
  try {
7337
- fsSync.chmodSync(filePath, 384);
7337
+ fs.chmodSync(filePath, 384);
7338
7338
  } catch {}
7339
7339
  }
7340
7340
  function loadDeviceAuthToken(params) {
@@ -10121,7 +10121,7 @@ async function routeReply(params) {
10121
10121
  const resolvedReplyToId = replyToId ?? (channelId === "slack" && threadId != null && threadId !== "" ? String(threadId) : void 0);
10122
10122
  const resolvedThreadId = channelId === "slack" ? null : threadId ?? null;
10123
10123
  try {
10124
- const { deliverOutboundPayloads } = await import("./deliver-UMgfGLxW.js").then((n) => n.n);
10124
+ const { deliverOutboundPayloads } = await import("./deliver-C46-vyqg.js").then((n) => n.n);
10125
10125
  return {
10126
10126
  ok: true,
10127
10127
  messageId: (await deliverOutboundPayloads({
@@ -10517,7 +10517,7 @@ function normalizeSessionKey(value) {
10517
10517
  }
10518
10518
  function readSessionStore(storePath) {
10519
10519
  try {
10520
- const raw = fsSync.readFileSync(storePath, "utf-8");
10520
+ const raw = fs.readFileSync(storePath, "utf-8");
10521
10521
  const parsed = JSON5.parse(raw);
10522
10522
  if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) return parsed;
10523
10523
  } catch {}
@@ -15576,7 +15576,7 @@ async function createModelSelectionState(params) {
15576
15576
  }
15577
15577
  }
15578
15578
  if (sessionEntry && sessionStore && sessionKey && sessionEntry.authProfileOverride) {
15579
- const { ensureAuthProfileStore } = await import("./auth-profiles-Bl9aU7fc.js").then((n) => n.t);
15579
+ const { ensureAuthProfileStore } = await import("./auth-profiles-DdK1Hxaa.js").then((n) => n.t);
15580
15580
  const profile = ensureAuthProfileStore(void 0, { allowKeychainPrompt: false }).profiles[sessionEntry.authProfileOverride];
15581
15581
  const providerKey = normalizeProviderId(provider);
15582
15582
  if (!profile || normalizeProviderId(profile.provider) !== providerKey) await clearSessionAuthProfileOverride({
@@ -17949,8 +17949,8 @@ const DEFAULT_SAFE_BINS = [
17949
17949
  ];
17950
17950
  function isExecutableFile(filePath) {
17951
17951
  try {
17952
- if (!fsSync.statSync(filePath).isFile()) return false;
17953
- if (process.platform !== "win32") fsSync.accessSync(filePath, fsSync.constants.X_OK);
17952
+ if (!fs.statSync(filePath).isFile()) return false;
17953
+ if (process.platform !== "win32") fs.accessSync(filePath, fs.constants.X_OK);
17954
17954
  return true;
17955
17955
  } catch {
17956
17956
  return false;
@@ -17988,7 +17988,7 @@ function normalizeMatchTarget(value) {
17988
17988
  }
17989
17989
  function tryRealpath(value) {
17990
17990
  try {
17991
- return fsSync.realpathSync(value);
17991
+ return fs.realpathSync(value);
17992
17992
  } catch {
17993
17993
  return null;
17994
17994
  }
@@ -19220,7 +19220,7 @@ function mergeLegacyAgent(current, legacy) {
19220
19220
  }
19221
19221
  function ensureDir$1(filePath) {
19222
19222
  const dir = path.dirname(filePath);
19223
- fsSync.mkdirSync(dir, { recursive: true });
19223
+ fs.mkdirSync(dir, { recursive: true });
19224
19224
  }
19225
19225
  function coerceAllowlistEntries(allowlist) {
19226
19226
  if (!Array.isArray(allowlist) || allowlist.length === 0) return Array.isArray(allowlist) ? allowlist : void 0;
@@ -19290,11 +19290,11 @@ function generateToken() {
19290
19290
  function loadExecApprovals() {
19291
19291
  const filePath = resolveExecApprovalsPath();
19292
19292
  try {
19293
- if (!fsSync.existsSync(filePath)) return normalizeExecApprovals({
19293
+ if (!fs.existsSync(filePath)) return normalizeExecApprovals({
19294
19294
  version: 1,
19295
19295
  agents: {}
19296
19296
  });
19297
- const raw = fsSync.readFileSync(filePath, "utf8");
19297
+ const raw = fs.readFileSync(filePath, "utf8");
19298
19298
  const parsed = JSON.parse(raw);
19299
19299
  if (parsed?.version !== 1) return normalizeExecApprovals({
19300
19300
  version: 1,
@@ -19311,9 +19311,9 @@ function loadExecApprovals() {
19311
19311
  function saveExecApprovals(file) {
19312
19312
  const filePath = resolveExecApprovalsPath();
19313
19313
  ensureDir$1(filePath);
19314
- fsSync.writeFileSync(filePath, `${JSON.stringify(file, null, 2)}\n`, { mode: 384 });
19314
+ fs.writeFileSync(filePath, `${JSON.stringify(file, null, 2)}\n`, { mode: 384 });
19315
19315
  try {
19316
- fsSync.chmodSync(filePath, 384);
19316
+ fs.chmodSync(filePath, 384);
19317
19317
  } catch {}
19318
19318
  }
19319
19319
  function ensureExecApprovals() {
@@ -19634,7 +19634,7 @@ function resolvePowerShellPath() {
19634
19634
  const systemRoot = process.env.SystemRoot || process.env.WINDIR;
19635
19635
  if (systemRoot) {
19636
19636
  const candidate = path.join(systemRoot, "System32", "WindowsPowerShell", "v1.0", "powershell.exe");
19637
- if (fsSync.existsSync(candidate)) return candidate;
19637
+ if (fs.existsSync(candidate)) return candidate;
19638
19638
  }
19639
19639
  return "powershell.exe";
19640
19640
  }
@@ -19672,7 +19672,7 @@ function resolveShellFromPath(name) {
19672
19672
  for (const entry of entries) {
19673
19673
  const candidate = path.join(entry, name);
19674
19674
  try {
19675
- fsSync.accessSync(candidate, fsSync.constants.X_OK);
19675
+ fs.accessSync(candidate, fs.constants.X_OK);
19676
19676
  return candidate;
19677
19677
  } catch {}
19678
19678
  }
@@ -20420,7 +20420,7 @@ async function resolveSandboxWorkdir(params) {
20420
20420
  cwd: process.cwd(),
20421
20421
  root: params.sandbox.workspaceDir
20422
20422
  });
20423
- if (!(await fs.stat(resolved.resolved)).isDirectory()) throw new Error("workdir is not a directory");
20423
+ if (!(await fs$1.stat(resolved.resolved)).isDirectory()) throw new Error("workdir is not a directory");
20424
20424
  const relative = resolved.relative ? resolved.relative.split(path.sep).join(path.posix.sep) : "";
20425
20425
  const containerWorkdir = relative ? path.posix.join(params.sandbox.containerWorkdir, relative) : params.sandbox.containerWorkdir;
20426
20426
  return {
@@ -21471,13 +21471,13 @@ async function validateScriptFileForShellBleed(params) {
21471
21471
  cwd: params.workdir,
21472
21472
  root: params.workdir
21473
21473
  });
21474
- stat = await fs.stat(absPath);
21474
+ stat = await fs$1.stat(absPath);
21475
21475
  } catch {
21476
21476
  return;
21477
21477
  }
21478
21478
  if (!stat.isFile()) return;
21479
21479
  if (stat.size > 512 * 1024) return;
21480
- const content = await fs.readFile(absPath, "utf-8");
21480
+ const content = await fs$1.readFile(absPath, "utf-8");
21481
21481
  const first = /\$[A-Z_][A-Z0-9_]{1,}/g.exec(content);
21482
21482
  if (first) {
21483
21483
  const idx = first.index;
@@ -22728,7 +22728,7 @@ function walkUpFrom(startDir, opts, resolveAtDir) {
22728
22728
  function hasGitMarker(repoRoot) {
22729
22729
  const gitPath = path.join(repoRoot, ".git");
22730
22730
  try {
22731
- const stat = fsSync.statSync(gitPath);
22731
+ const stat = fs.statSync(gitPath);
22732
22732
  return stat.isDirectory() || stat.isFile();
22733
22733
  } catch {
22734
22734
  return false;
@@ -22740,10 +22740,10 @@ function findGitRoot(startDir, opts = {}) {
22740
22740
  function resolveGitDirFromMarker(repoRoot) {
22741
22741
  const gitPath = path.join(repoRoot, ".git");
22742
22742
  try {
22743
- const stat = fsSync.statSync(gitPath);
22743
+ const stat = fs.statSync(gitPath);
22744
22744
  if (stat.isDirectory()) return gitPath;
22745
22745
  if (!stat.isFile()) return null;
22746
- const match = fsSync.readFileSync(gitPath, "utf-8").match(/gitdir:\s*(.+)/i);
22746
+ const match = fs.readFileSync(gitPath, "utf-8").match(/gitdir:\s*(.+)/i);
22747
22747
  if (!match?.[1]) return null;
22748
22748
  return path.resolve(repoRoot, match[1].trim());
22749
22749
  } catch {
@@ -22810,7 +22810,7 @@ const resolveCommitHash = (options = {}) => {
22810
22810
  cachedCommit = null;
22811
22811
  return cachedCommit;
22812
22812
  }
22813
- const head = fsSync.readFileSync(headPath, "utf-8").trim();
22813
+ const head = fs.readFileSync(headPath, "utf-8").trim();
22814
22814
  if (!head) {
22815
22815
  cachedCommit = null;
22816
22816
  return cachedCommit;
@@ -22818,7 +22818,7 @@ const resolveCommitHash = (options = {}) => {
22818
22818
  if (head.startsWith("ref:")) {
22819
22819
  const ref = head.replace(/^ref:\s*/i, "").trim();
22820
22820
  const refPath = path.resolve(path.dirname(headPath), ref);
22821
- cachedCommit = formatCommit(fsSync.readFileSync(refPath, "utf-8").trim());
22821
+ cachedCommit = formatCommit(fs.readFileSync(refPath, "utf-8").trim());
22822
22822
  return cachedCommit;
22823
22823
  }
22824
22824
  cachedCommit = formatCommit(head);
@@ -23022,9 +23022,9 @@ const readUsageFromSessionLog = (sessionId, sessionEntry, agentId, sessionKey, s
23022
23022
  } catch {
23023
23023
  return;
23024
23024
  }
23025
- if (!fsSync.existsSync(logPath)) return;
23025
+ if (!fs.existsSync(logPath)) return;
23026
23026
  try {
23027
- const lines = fsSync.readFileSync(logPath, "utf-8").split(/\n+/);
23027
+ const lines = fs.readFileSync(logPath, "utf-8").split(/\n+/);
23028
23028
  let input = 0;
23029
23029
  let output = 0;
23030
23030
  let promptTokens = 0;
@@ -24264,7 +24264,7 @@ function resolveRepoRoot(params) {
24264
24264
  const configured = params.config?.agents?.defaults?.repoRoot?.trim();
24265
24265
  if (configured) try {
24266
24266
  const resolved = path.resolve(configured);
24267
- if (fsSync.statSync(resolved).isDirectory()) return resolved;
24267
+ if (fs.statSync(resolved).isDirectory()) return resolved;
24268
24268
  } catch {}
24269
24269
  const candidates = [params.workspaceDir, params.cwd].map((value) => value?.trim()).filter(Boolean);
24270
24270
  const seen = /* @__PURE__ */ new Set();
@@ -24583,7 +24583,7 @@ async function buildContextReply(params) {
24583
24583
  //#region src/auto-reply/reply/commands-export-session.ts
24584
24584
  const EXPORT_HTML_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), "export-html");
24585
24585
  function loadTemplate(fileName) {
24586
- return fsSync.readFileSync(path.join(EXPORT_HTML_DIR, fileName), "utf-8");
24586
+ return fs.readFileSync(path.join(EXPORT_HTML_DIR, fileName), "utf-8");
24587
24587
  }
24588
24588
  function generateHtml(sessionData) {
24589
24589
  const template = loadTemplate("template.html");
@@ -24657,7 +24657,7 @@ async function buildExportSessionReply(params) {
24657
24657
  } catch (err) {
24658
24658
  return { text: `❌ Failed to resolve session file: ${err instanceof Error ? err.message : String(err)}` };
24659
24659
  }
24660
- if (!fsSync.existsSync(sessionFile)) return { text: `❌ Session file not found: ${sessionFile}` };
24660
+ if (!fs.existsSync(sessionFile)) return { text: `❌ Session file not found: ${sessionFile}` };
24661
24661
  const sessionManager = SessionManager.open(sessionFile);
24662
24662
  const entries = sessionManager.getEntries();
24663
24663
  const header = sessionManager.getHeader();
@@ -24678,8 +24678,8 @@ async function buildExportSessionReply(params) {
24678
24678
  const defaultFileName = `symi-session-${entry.sessionId.slice(0, 8)}-${timestamp}.html`;
24679
24679
  const outputPath = args.outputPath ? path.resolve(args.outputPath.startsWith("~") ? args.outputPath.replace("~", process.env.HOME ?? "") : args.outputPath) : path.join(params.workspaceDir, defaultFileName);
24680
24680
  const outputDir = path.dirname(outputPath);
24681
- if (!fsSync.existsSync(outputDir)) fsSync.mkdirSync(outputDir, { recursive: true });
24682
- fsSync.writeFileSync(outputPath, html, "utf-8");
24681
+ if (!fs.existsSync(outputDir)) fs.mkdirSync(outputDir, { recursive: true });
24682
+ fs.writeFileSync(outputPath, html, "utf-8");
24683
24683
  const relativePath = path.relative(params.workspaceDir, outputPath);
24684
24684
  return { text: [
24685
24685
  "✅ Session exported!",
@@ -24793,8 +24793,8 @@ function resolveZaiApiKey() {
24793
24793
  }
24794
24794
  try {
24795
24795
  const authPath = path.join(os.homedir(), ".pi", "agent", "auth.json");
24796
- if (!fsSync.existsSync(authPath)) return;
24797
- const data = JSON.parse(fsSync.readFileSync(authPath, "utf-8"));
24796
+ if (!fs.existsSync(authPath)) return;
24797
+ const data = JSON.parse(fs.readFileSync(authPath, "utf-8"));
24798
24798
  return data["z-ai"]?.access || data.zai?.access;
24799
24799
  } catch {
24800
24800
  return;
@@ -26359,7 +26359,7 @@ function shouldPersistAnyBindingState() {
26359
26359
  }
26360
26360
  function shouldPersistBindingMutations() {
26361
26361
  if (shouldPersistAnyBindingState()) return true;
26362
- return fsSync.existsSync(resolveThreadBindingsPath());
26362
+ return fs.existsSync(resolveThreadBindingsPath());
26363
26363
  }
26364
26364
  function saveBindingsToDisk(params = {}) {
26365
26365
  if (!params.force && !shouldPersistAnyBindingState()) return;
@@ -27347,7 +27347,7 @@ const applyCostTotal = (totals, costTotal) => {
27347
27347
  totals.totalCost += costTotal;
27348
27348
  };
27349
27349
  async function* readJsonlRecords(filePath) {
27350
- const fileStream = fsSync.createReadStream(filePath, { encoding: "utf-8" });
27350
+ const fileStream = fs.createReadStream(filePath, { encoding: "utf-8" });
27351
27351
  const rl = readline.createInterface({
27352
27352
  input: fileStream,
27353
27353
  crlfDelay: Infinity
@@ -27419,10 +27419,10 @@ async function loadCostUsageSummary(params) {
27419
27419
  const dailyMap = /* @__PURE__ */ new Map();
27420
27420
  const totals = emptyTotals();
27421
27421
  const sessionsDir = resolveSessionTranscriptsDirForAgent(params?.agentId);
27422
- const entries = await fsSync.promises.readdir(sessionsDir, { withFileTypes: true }).catch(() => []);
27422
+ const entries = await fs.promises.readdir(sessionsDir, { withFileTypes: true }).catch(() => []);
27423
27423
  const files = (await Promise.all(entries.filter((entry) => entry.isFile() && entry.name.endsWith(".jsonl")).map(async (entry) => {
27424
27424
  const filePath = path.join(sessionsDir, entry.name);
27425
- const stats = await fsSync.promises.stat(filePath).catch(() => null);
27425
+ const stats = await fs.promises.stat(filePath).catch(() => null);
27426
27426
  if (!stats) return null;
27427
27427
  if (stats.mtimeMs < sinceTime) return null;
27428
27428
  return filePath;
@@ -27455,7 +27455,7 @@ async function loadCostUsageSummary(params) {
27455
27455
  }
27456
27456
  async function loadSessionCostSummary(params) {
27457
27457
  const sessionFile = params.sessionFile ?? (params.sessionId ? resolveSessionFilePath(params.sessionId, params.sessionEntry, { agentId: params.agentId }) : void 0);
27458
- if (!sessionFile || !fsSync.existsSync(sessionFile)) return null;
27458
+ if (!sessionFile || !fs.existsSync(sessionFile)) return null;
27459
27459
  const totals = emptyTotals();
27460
27460
  let firstActivity;
27461
27461
  let lastActivity;
@@ -29327,7 +29327,7 @@ async function handleCommands(params) {
29327
29327
  try {
29328
29328
  const messages = [];
29329
29329
  if (sessionFile) {
29330
- const content = await fs.readFile(sessionFile, "utf-8");
29330
+ const content = await fs$1.readFile(sessionFile, "utf-8");
29331
29331
  for (const line of content.split("\n")) {
29332
29332
  if (!line.trim()) continue;
29333
29333
  try {
@@ -31661,7 +31661,7 @@ function asBoolean(value) {
31661
31661
  }
31662
31662
  function resolveTempPathParts(opts) {
31663
31663
  const tmpDir = opts.tmpDir ?? resolvePreferredSymiTmpDir();
31664
- if (!opts.tmpDir) fsSync.mkdirSync(tmpDir, {
31664
+ if (!opts.tmpDir) fs.mkdirSync(tmpDir, {
31665
31665
  recursive: true,
31666
31666
  mode: 448
31667
31667
  });
@@ -31727,7 +31727,7 @@ async function writeUrlToFile(filePath, url) {
31727
31727
  if (typeof contentLength === "number" && Number.isFinite(contentLength) && contentLength > MAX_CAMERA_URL_DOWNLOAD_BYTES) throw new Error(`writeUrlToFile: content-length ${contentLength} exceeds max ${MAX_CAMERA_URL_DOWNLOAD_BYTES}`);
31728
31728
  const body = res.body;
31729
31729
  if (!body) throw new Error(`failed to download ${url}: empty response body`);
31730
- const fileHandle = await fs$1.open(filePath, "w");
31730
+ const fileHandle = await fs$2.open(filePath, "w");
31731
31731
  let bytes = 0;
31732
31732
  let thrown;
31733
31733
  try {
@@ -31746,7 +31746,7 @@ async function writeUrlToFile(filePath, url) {
31746
31746
  await fileHandle.close();
31747
31747
  }
31748
31748
  if (thrown) {
31749
- await fs$1.unlink(filePath).catch(() => {});
31749
+ await fs$2.unlink(filePath).catch(() => {});
31750
31750
  throw thrown;
31751
31751
  }
31752
31752
  return {
@@ -31756,7 +31756,7 @@ async function writeUrlToFile(filePath, url) {
31756
31756
  }
31757
31757
  async function writeBase64ToFile(filePath, base64) {
31758
31758
  const buf = Buffer.from(base64, "base64");
31759
- await fs$1.writeFile(filePath, buf);
31759
+ await fs$2.writeFile(filePath, buf);
31760
31760
  return {
31761
31761
  path: filePath,
31762
31762
  bytes: buf.length
@@ -31822,7 +31822,7 @@ async function readJsonlFromPath(jsonlPath) {
31822
31822
  if (shouldLogVerbose()) logVerbose(`Blocked canvas jsonlPath outside allowed roots: ${resolved}`);
31823
31823
  throw new Error("jsonlPath outside allowed roots");
31824
31824
  }
31825
- const canonical = await fs.realpath(resolved).catch(() => resolved);
31825
+ const canonical = await fs$1.realpath(resolved).catch(() => resolved);
31826
31826
  if (!isInboundPathAllowed({
31827
31827
  filePath: canonical,
31828
31828
  roots
@@ -31830,7 +31830,7 @@ async function readJsonlFromPath(jsonlPath) {
31830
31830
  if (shouldLogVerbose()) logVerbose(`Blocked canvas jsonlPath outside allowed roots: ${canonical}`);
31831
31831
  throw new Error("jsonlPath outside allowed roots");
31832
31832
  }
31833
- return await fs.readFile(canonical, "utf8");
31833
+ return await fs$1.readFile(canonical, "utf8");
31834
31834
  }
31835
31835
  const CanvasToolSchema = Type.Object({
31836
31836
  action: stringEnum(CANVAS_ACTIONS),
@@ -32634,12 +32634,12 @@ function resolveRestartSentinelPath(env = process.env) {
32634
32634
  }
32635
32635
  async function writeRestartSentinel(payload, env = process.env) {
32636
32636
  const filePath = resolveRestartSentinelPath(env);
32637
- await fs.mkdir(path.dirname(filePath), { recursive: true });
32637
+ await fs$1.mkdir(path.dirname(filePath), { recursive: true });
32638
32638
  const data = {
32639
32639
  version: 1,
32640
32640
  payload
32641
32641
  };
32642
- await fs.writeFile(filePath, `${JSON.stringify(data, null, 2)}\n`, "utf-8");
32642
+ await fs$1.writeFile(filePath, `${JSON.stringify(data, null, 2)}\n`, "utf-8");
32643
32643
  return filePath;
32644
32644
  }
32645
32645
 
@@ -33454,7 +33454,7 @@ async function hydrateAttachmentPayload(params) {
33454
33454
  accountId: params.accountId
33455
33455
  }),
33456
33456
  sandboxValidated: true,
33457
- readFile: (filePath) => fs.readFile(filePath)
33457
+ readFile: (filePath) => fs$1.readFile(filePath)
33458
33458
  });
33459
33459
  params.args.buffer = media.buffer.toString("base64");
33460
33460
  if (!contentTypeParam && media.contentType) params.args.contentType = media.contentType;
@@ -36739,7 +36739,7 @@ function listExistingAgentIdsFromDisk() {
36739
36739
  const root = resolveStateDir();
36740
36740
  const agentsDir = path.join(root, "agents");
36741
36741
  try {
36742
- return fsSync.readdirSync(agentsDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => normalizeAgentId(entry.name)).filter(Boolean);
36742
+ return fs.readdirSync(agentsDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => normalizeAgentId(entry.name)).filter(Boolean);
36743
36743
  } catch {
36744
36744
  return [];
36745
36745
  }
@@ -40607,18 +40607,18 @@ function appendImagePathsToPrompt(prompt, paths) {
40607
40607
  return `${trimmed}${trimmed ? "\n\n" : ""}${paths.join("\n")}`;
40608
40608
  }
40609
40609
  async function writeCliImages(images) {
40610
- const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "symi-cli-images-"));
40610
+ const tempDir = await fs$1.mkdtemp(path.join(os.tmpdir(), "symi-cli-images-"));
40611
40611
  const paths = [];
40612
40612
  for (let i = 0; i < images.length; i += 1) {
40613
40613
  const image = images[i];
40614
40614
  const ext = resolveImageExtension(image.mimeType);
40615
40615
  const filePath = path.join(tempDir, `image-${i + 1}.${ext}`);
40616
40616
  const buffer = Buffer.from(image.data, "base64");
40617
- await fs.writeFile(filePath, buffer, { mode: 384 });
40617
+ await fs$1.writeFile(filePath, buffer, { mode: 384 });
40618
40618
  paths.push(filePath);
40619
40619
  }
40620
40620
  const cleanup = async () => {
40621
- await fs.rm(tempDir, {
40621
+ await fs$1.rm(tempDir, {
40622
40622
  recursive: true,
40623
40623
  force: true
40624
40624
  });
@@ -41692,7 +41692,7 @@ async function runAgentTurnWithFallback(params) {
41692
41692
  if (corruptedSessionId) {
41693
41693
  const transcriptPath = resolveSessionTranscriptPath(corruptedSessionId);
41694
41694
  try {
41695
- fsSync.unlinkSync(transcriptPath);
41695
+ fs.unlinkSync(transcriptPath);
41696
41696
  } catch {}
41697
41697
  }
41698
41698
  delete params.activeSessionStore[sessionKey];
@@ -42406,9 +42406,9 @@ function auditPostCompactionReads(readFilePaths, workspaceDir, requiredReads = D
42406
42406
  * Returns messages from the last N lines (default 100).
42407
42407
  */
42408
42408
  function readSessionMessages(sessionFile, maxLines = 100) {
42409
- if (!fsSync.existsSync(sessionFile)) return [];
42409
+ if (!fs.existsSync(sessionFile)) return [];
42410
42410
  try {
42411
- const recentLines = fsSync.readFileSync(sessionFile, "utf-8").trim().split("\n").slice(-maxLines);
42411
+ const recentLines = fs.readFileSync(sessionFile, "utf-8").trim().split("\n").slice(-maxLines);
42412
42412
  const messages = [];
42413
42413
  for (const line of recentLines) try {
42414
42414
  const entry = JSON.parse(line);
@@ -42449,8 +42449,8 @@ const MAX_CONTEXT_CHARS = 3e3;
42449
42449
  async function readPostCompactionContext(workspaceDir) {
42450
42450
  const agentsPath = path.join(workspaceDir, "AGENTS.md");
42451
42451
  try {
42452
- if (!fsSync.existsSync(agentsPath)) return null;
42453
- const sections = extractSections(await fsSync.promises.readFile(agentsPath, "utf-8"), ["Session Startup", "Red Lines"]);
42452
+ if (!fs.existsSync(agentsPath)) return null;
42453
+ const sections = extractSections(await fs.promises.readFile(agentsPath, "utf-8"), ["Session Startup", "Red Lines"]);
42454
42454
  if (sections.length === 0) return null;
42455
42455
  const combined = sections.join("\n\n");
42456
42456
  return "[Post-compaction context refresh]\n\nSession was just compacted. The conversation summary above is a hint, NOT a substitute for your startup sequence. Execute your Session Startup sequence now — read the required files before responding to the user.\n\nCritical rules from AGENTS.md:\n\n" + (combined.length > MAX_CONTEXT_CHARS ? combined.slice(0, MAX_CONTEXT_CHARS) + "\n...[truncated]..." : combined);
@@ -42654,7 +42654,7 @@ async function runReplyAgent(params) {
42654
42654
  if (resolved) transcriptCandidates.add(resolved);
42655
42655
  transcriptCandidates.add(resolveSessionTranscriptPath(prevSessionId, agentId));
42656
42656
  for (const candidate of transcriptCandidates) try {
42657
- fsSync.unlinkSync(candidate);
42657
+ fs.unlinkSync(candidate);
42658
42658
  } catch {}
42659
42659
  }
42660
42660
  return true;
@@ -43560,7 +43560,7 @@ async function deliverSessionMaintenanceWarning(params) {
43560
43560
  return;
43561
43561
  }
43562
43562
  try {
43563
- const { deliverOutboundPayloads } = await import("./deliver-UMgfGLxW.js").then((n) => n.n);
43563
+ const { deliverOutboundPayloads } = await import("./deliver-C46-vyqg.js").then((n) => n.n);
43564
43564
  await deliverOutboundPayloads({
43565
43565
  cfg: params.cfg,
43566
43566
  channel,
@@ -43586,7 +43586,7 @@ function forkSessionFromParent(params) {
43586
43586
  agentId: params.agentId,
43587
43587
  sessionsDir: params.sessionsDir
43588
43588
  });
43589
- if (!parentSessionFile || !fsSync.existsSync(parentSessionFile)) return null;
43589
+ if (!parentSessionFile || !fs.existsSync(parentSessionFile)) return null;
43590
43590
  try {
43591
43591
  const manager = SessionManager.open(parentSessionFile);
43592
43592
  const leafId = manager.getLeafId();
@@ -43610,7 +43610,7 @@ function forkSessionFromParent(params) {
43610
43610
  cwd: manager.getCwd(),
43611
43611
  parentSession: parentSessionFile
43612
43612
  };
43613
- fsSync.writeFileSync(sessionFile, `${JSON.stringify(header)}\n`, "utf-8");
43613
+ fs.writeFileSync(sessionFile, `${JSON.stringify(header)}\n`, "utf-8");
43614
43614
  return {
43615
43615
  sessionId,
43616
43616
  sessionFile
@@ -43935,7 +43935,7 @@ async function stageSandboxMedia(params) {
43935
43935
  };
43936
43936
  try {
43937
43937
  const destDir = sandbox ? path.join(effectiveWorkspaceDir, "media", "inbound") : effectiveWorkspaceDir;
43938
- await fs.mkdir(destDir, { recursive: true });
43938
+ await fs$1.mkdir(destDir, { recursive: true });
43939
43939
  const remoteAttachmentRoots = resolveIMessageRemoteAttachmentRoots({
43940
43940
  cfg,
43941
43941
  accountId: ctx.AccountId
@@ -43985,7 +43985,7 @@ async function stageSandboxMedia(params) {
43985
43985
  usedNames.add(fileName);
43986
43986
  const dest = path.join(destDir, fileName);
43987
43987
  if (ctx.MediaRemoteHost) await scpFile(ctx.MediaRemoteHost, source, dest);
43988
- else await fs.copyFile(source, dest);
43988
+ else await fs$1.copyFile(source, dest);
43989
43989
  const stagedPath = sandbox ? path.posix.join("media", "inbound", fileName) : dest;
43990
43990
  staged.set(source, stagedPath);
43991
43991
  }
@@ -47005,8 +47005,8 @@ async function describeStickerImage(params) {
47005
47005
  const { provider, model } = resolved;
47006
47006
  logVerbose(`telegram: describing sticker with ${provider}/${model}`);
47007
47007
  try {
47008
- const buffer = await fs.readFile(imagePath);
47009
- const { describeImageWithModel } = await import("./image-CK4oZUJJ.js").then((n) => n.n);
47008
+ const buffer = await fs$1.readFile(imagePath);
47009
+ const { describeImageWithModel } = await import("./image-CuzFLQWC.js").then((n) => n.n);
47010
47010
  return (await describeImageWithModel({
47011
47011
  buffer,
47012
47012
  fileName: "sticker.webp",
@@ -47429,7 +47429,7 @@ function createWhatsAppLoginTool() {
47429
47429
  force: Type.Optional(Type.Boolean())
47430
47430
  }),
47431
47431
  execute: async (_toolCallId, args) => {
47432
- const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-BKIOHn1V.js");
47432
+ const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-AP9agO-i.js");
47433
47433
  if ((args?.action ?? "start") === "wait") {
47434
47434
  const result = await waitForWebLogin({ timeoutMs: typeof args.timeoutMs === "number" ? args.timeoutMs : void 0 });
47435
47435
  return {
@@ -47711,7 +47711,7 @@ async function withMemoryManagerForAgent(params) {
47711
47711
  }
47712
47712
  async function checkReadableFile(pathname) {
47713
47713
  try {
47714
- await fs.access(pathname, fsSync.constants.R_OK);
47714
+ await fs$1.access(pathname, fs.constants.R_OK);
47715
47715
  return { exists: true };
47716
47716
  } catch (err) {
47717
47717
  const code = err.code;
@@ -47728,7 +47728,7 @@ async function scanSessionFiles(agentId) {
47728
47728
  try {
47729
47729
  return {
47730
47730
  source: "sessions",
47731
- totalFiles: (await fs.readdir(sessionsDir, { withFileTypes: true })).filter((entry) => entry.isFile() && entry.name.endsWith(".jsonl")).length,
47731
+ totalFiles: (await fs$1.readdir(sessionsDir, { withFileTypes: true })).filter((entry) => entry.isFile() && entry.name.endsWith(".jsonl")).length,
47732
47732
  issues
47733
47733
  };
47734
47734
  } catch (err) {
@@ -47760,7 +47760,7 @@ async function scanMemoryFiles(workspaceDir, extraPaths = []) {
47760
47760
  if (alt.issue) issues.push(alt.issue);
47761
47761
  const resolvedExtraPaths = normalizeExtraMemoryPaths(workspaceDir, extraPaths);
47762
47762
  for (const extraPath of resolvedExtraPaths) try {
47763
- if ((await fs.lstat(extraPath)).isSymbolicLink()) continue;
47763
+ if ((await fs$1.lstat(extraPath)).isSymbolicLink()) continue;
47764
47764
  const extraCheck = await checkReadableFile(extraPath);
47765
47765
  if (extraCheck.issue) issues.push(extraCheck.issue);
47766
47766
  } catch (err) {
@@ -47770,7 +47770,7 @@ async function scanMemoryFiles(workspaceDir, extraPaths = []) {
47770
47770
  }
47771
47771
  let dirReadable = null;
47772
47772
  try {
47773
- await fs.access(memoryDir, fsSync.constants.R_OK);
47773
+ await fs$1.access(memoryDir, fs.constants.R_OK);
47774
47774
  dirReadable = true;
47775
47775
  } catch (err) {
47776
47776
  const code = err.code;
@@ -47818,7 +47818,7 @@ async function summarizeQmdIndexArtifact(manager) {
47818
47818
  if (!dbPath) return null;
47819
47819
  let stat;
47820
47820
  try {
47821
- stat = await fs.stat(dbPath);
47821
+ stat = await fs$1.stat(dbPath);
47822
47822
  } catch (err) {
47823
47823
  const code = err.code;
47824
47824
  if (code === "ENOENT") throw new Error(`QMD index file not found: ${shortenHomePath(dbPath)}`, { cause: err });
@@ -49668,7 +49668,7 @@ async function preflightDiscordMessage(params) {
49668
49668
  let preflightTranscript;
49669
49669
  const hasAudioAttachment = message.attachments?.some((att) => att.contentType?.startsWith("audio/"));
49670
49670
  if (!isDirectMessage && shouldRequireMention && hasAudioAttachment && !baseText && mentionRegexes.length > 0) try {
49671
- const { transcribeFirstAudio } = await import("./audio-preflight-CjV36MUe.js");
49671
+ const { transcribeFirstAudio } = await import("./audio-preflight-BVaaZWkg.js");
49672
49672
  const audioPaths = message.attachments?.filter((att) => att.contentType?.startsWith("audio/")).map((att) => att.url) ?? [];
49673
49673
  if (audioPaths.length > 0) preflightTranscript = await transcribeFirstAudio({
49674
49674
  ctx: {
@@ -50631,7 +50631,7 @@ function identityHasValues(identity) {
50631
50631
  }
50632
50632
  function loadIdentityFromFile(identityPath) {
50633
50633
  try {
50634
- const parsed = parseIdentityMarkdown(fsSync.readFileSync(identityPath, "utf-8"));
50634
+ const parsed = parseIdentityMarkdown(fs.readFileSync(identityPath, "utf-8"));
50635
50635
  if (!identityHasValues(parsed)) return null;
50636
50636
  return parsed;
50637
50637
  } catch {
@@ -50670,7 +50670,7 @@ function isDataAvatar(value) {
50670
50670
  }
50671
50671
  function resolveExistingPath(value) {
50672
50672
  try {
50673
- return fsSync.realpathSync(value);
50673
+ return fs.realpathSync(value);
50674
50674
  } catch {
50675
50675
  return path.resolve(value);
50676
50676
  }
@@ -50694,7 +50694,7 @@ function resolveLocalAvatarPath(params) {
50694
50694
  reason: "unsupported_extension"
50695
50695
  };
50696
50696
  try {
50697
- if (!fsSync.statSync(realPath).isFile()) return {
50697
+ if (!fs.statSync(realPath).isFile()) return {
50698
50698
  ok: false,
50699
50699
  reason: "missing"
50700
50700
  };
@@ -51557,7 +51557,7 @@ function sanitizeRecentModels(models, limit) {
51557
51557
  }
51558
51558
  async function readJsonFileWithFallback(filePath, fallback) {
51559
51559
  try {
51560
- const raw = await fsSync.promises.readFile(filePath, "utf-8");
51560
+ const raw = await fs.promises.readFile(filePath, "utf-8");
51561
51561
  return {
51562
51562
  value: JSON.parse(raw),
51563
51563
  exists: true
@@ -51575,14 +51575,14 @@ async function readJsonFileWithFallback(filePath, fallback) {
51575
51575
  }
51576
51576
  async function writeJsonFileAtomically(filePath, value) {
51577
51577
  const dir = path.dirname(filePath);
51578
- await fsSync.promises.mkdir(dir, {
51578
+ await fs.promises.mkdir(dir, {
51579
51579
  recursive: true,
51580
51580
  mode: 448
51581
51581
  });
51582
51582
  const tmp = path.join(dir, `${path.basename(filePath)}.${crypto.randomUUID()}.tmp`);
51583
- await fsSync.promises.writeFile(tmp, `${JSON.stringify(value, null, 2)}\n`, "utf-8");
51584
- await fsSync.promises.chmod(tmp, 384);
51585
- await fsSync.promises.rename(tmp, filePath);
51583
+ await fs.promises.writeFile(tmp, `${JSON.stringify(value, null, 2)}\n`, "utf-8");
51584
+ await fs.promises.chmod(tmp, 384);
51585
+ await fs.promises.rename(tmp, filePath);
51586
51586
  }
51587
51587
  async function readPreferencesStore(filePath) {
51588
51588
  const { value } = await readJsonFileWithFallback(filePath, {
@@ -53674,27 +53674,27 @@ function isVoiceChannelType(type) {
53674
53674
  function createDefaultDeps() {
53675
53675
  return {
53676
53676
  sendMessageWhatsApp: async (...args) => {
53677
- const { sendMessageWhatsApp } = await import("./web-DcHxbz2H.js");
53677
+ const { sendMessageWhatsApp } = await import("./web-0xZpP0WA.js");
53678
53678
  return await sendMessageWhatsApp(...args);
53679
53679
  },
53680
53680
  sendMessageTelegram: async (...args) => {
53681
- const { sendMessageTelegram } = await import("./send-B7z8CDbr.js").then((n) => n.l);
53681
+ const { sendMessageTelegram } = await import("./send-DYj_o4_F.js").then((n) => n.l);
53682
53682
  return await sendMessageTelegram(...args);
53683
53683
  },
53684
53684
  sendMessageDiscord: async (...args) => {
53685
- const { sendMessageDiscord } = await import("./send-D3zDmQim.js").then((n) => n.t);
53685
+ const { sendMessageDiscord } = await import("./send-CvhXrdgS.js").then((n) => n.t);
53686
53686
  return await sendMessageDiscord(...args);
53687
53687
  },
53688
53688
  sendMessageSlack: async (...args) => {
53689
- const { sendMessageSlack } = await import("./send-qItpAHcI.js").then((n) => n.n);
53689
+ const { sendMessageSlack } = await import("./send-CVMyYPQw.js").then((n) => n.n);
53690
53690
  return await sendMessageSlack(...args);
53691
53691
  },
53692
53692
  sendMessageSignal: async (...args) => {
53693
- const { sendMessageSignal } = await import("./send-XRUYukww.js").then((n) => n.i);
53693
+ const { sendMessageSignal } = await import("./send-DAN9hA5h.js").then((n) => n.i);
53694
53694
  return await sendMessageSignal(...args);
53695
53695
  },
53696
53696
  sendMessageIMessage: async (...args) => {
53697
- const { sendMessageIMessage } = await import("./send-Cd81AY_Z.js").then((n) => n.n);
53697
+ const { sendMessageIMessage } = await import("./send-CQAKg_12.js").then((n) => n.n);
53698
53698
  return await sendMessageIMessage(...args);
53699
53699
  }
53700
53700
  };
@@ -54603,10 +54603,10 @@ function estimateDurationSeconds(pcm) {
54603
54603
  return pcm.length / (bytesPerSample * SAMPLE_RATE);
54604
54604
  }
54605
54605
  async function writeWavFile(pcm) {
54606
- const tempDir = await fs.mkdtemp(path.join(resolvePreferredSymiTmpDir(), "discord-voice-"));
54606
+ const tempDir = await fs$1.mkdtemp(path.join(resolvePreferredSymiTmpDir(), "discord-voice-"));
54607
54607
  const filePath = path.join(tempDir, `segment-${randomUUID()}.wav`);
54608
54608
  const wav = buildWavBuffer(pcm);
54609
- await fs.writeFile(filePath, wav);
54609
+ await fs$1.writeFile(filePath, wav);
54610
54610
  scheduleTempCleanup(tempDir);
54611
54611
  return {
54612
54612
  path: filePath,
@@ -54615,7 +54615,7 @@ async function writeWavFile(pcm) {
54615
54615
  }
54616
54616
  function scheduleTempCleanup(tempDir, delayMs = 1800 * 1e3) {
54617
54617
  setTimeout(() => {
54618
- fs.rm(tempDir, {
54618
+ fs$1.rm(tempDir, {
54619
54619
  recursive: true,
54620
54620
  force: true
54621
54621
  }).catch((err) => {
@@ -57679,7 +57679,7 @@ async function detectBinary(name) {
57679
57679
  if (!isSafeExecutableValue(name)) return false;
57680
57680
  const resolved = name.startsWith("~") ? resolveUserPath(name) : name;
57681
57681
  if (path.isAbsolute(resolved) || resolved.startsWith(".") || resolved.includes("/") || resolved.includes("\\")) try {
57682
- await fs.access(resolved);
57682
+ await fs$1.access(resolved);
57683
57683
  return true;
57684
57684
  } catch {
57685
57685
  return false;
@@ -58229,7 +58229,7 @@ function normalizeAllowList$1(list) {
58229
58229
  async function detectRemoteHostFromCliPath(cliPath) {
58230
58230
  try {
58231
58231
  const expanded = cliPath.startsWith("~") ? cliPath.replace(/^~/, process.env.HOME ?? "") : cliPath;
58232
- const content = await fs.readFile(expanded, "utf8");
58232
+ const content = await fs$1.readFile(expanded, "utf8");
58233
58233
  const userHostMatch = content.match(/\bssh\b[^\n]*?\s+([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/);
58234
58234
  if (userHostMatch) return userHostMatch[1];
58235
58235
  return content.match(/\bssh\b[^\n]*?\s+([a-zA-Z][a-zA-Z0-9._-]*)\s+\S*\bimsg\b/)?.[1];
@@ -58573,7 +58573,7 @@ async function monitorIMessageProvider(opts = {}) {
58573
58573
  function readFileIfExists(filePath) {
58574
58574
  if (!filePath) return;
58575
58575
  try {
58576
- return fsSync.readFileSync(filePath, "utf-8").trim();
58576
+ return fs.readFileSync(filePath, "utf-8").trim();
58577
58577
  } catch {
58578
58578
  return;
58579
58579
  }
@@ -59134,7 +59134,7 @@ async function downloadLineMedia(messageId, channelAccessToken, maxBytes = 10 *
59134
59134
  prefix: "line-media",
59135
59135
  extension: getExtensionForContentType(contentType)
59136
59136
  });
59137
- await fsSync.promises.writeFile(filePath, buffer);
59137
+ await fs.promises.writeFile(filePath, buffer);
59138
59138
  logVerbose(`line: downloaded media ${messageId} to ${filePath} (${buffer.length} bytes)`);
59139
59139
  return {
59140
59140
  path: filePath,
@@ -64121,7 +64121,7 @@ function readSlackExternalArgMenuToken(raw) {
64121
64121
  }
64122
64122
  let commandsRegistry;
64123
64123
  async function getCommandsRegistry() {
64124
- if (!commandsRegistry) commandsRegistry = await import("./commands-registry-DIakZUZb.js").then((n) => n.n);
64124
+ if (!commandsRegistry) commandsRegistry = await import("./commands-registry-Bfc7Uz0o.js").then((n) => n.n);
64125
64125
  return commandsRegistry;
64126
64126
  }
64127
64127
  function encodeSlackCommandArgValue(parts) {
@@ -64463,11 +64463,11 @@ async function registerSlackMonitorSlashCommands(params) {
64463
64463
  const channelName = channelInfo?.name;
64464
64464
  const roomLabel = channelName ? `#${channelName}` : `#${command.channel_id}`;
64465
64465
  const [{ resolveAgentRoute }, { finalizeInboundContext }, { dispatchReplyWithDispatcher }] = await Promise.all([
64466
- import("./resolve-route-q8AFnU5c.js").then((n) => n.r),
64466
+ import("./resolve-route-C4_I4GFI.js").then((n) => n.r),
64467
64467
  import("./inbound-context-DSDTl6Kj.js").then((n) => n.n),
64468
64468
  Promise.resolve().then(() => provider_dispatcher_exports)
64469
64469
  ]);
64470
- const [{ resolveConversationLabel }, { createReplyPrefixOptions }] = await Promise.all([import("./conversation-label-Onz2hiJh.js").then((n) => n.t), import("./reply-prefix-DkGsdyBm.js").then((n) => n.n)]);
64470
+ const [{ resolveConversationLabel }, { createReplyPrefixOptions }] = await Promise.all([import("./conversation-label-Onz2hiJh.js").then((n) => n.t), import("./reply-prefix-DpqZu44Z.js").then((n) => n.n)]);
64471
64471
  const route = resolveAgentRoute({
64472
64472
  cfg,
64473
64473
  channel: "slack",
@@ -64524,9 +64524,9 @@ async function registerSlackMonitorSlashCommands(params) {
64524
64524
  });
64525
64525
  const deliverSlashPayloads = async (replies) => {
64526
64526
  const [{ deliverSlackSlashReplies }, { resolveChunkMode }, { resolveMarkdownTableMode }] = await Promise.all([
64527
- import("./replies-mfnbLu2p.js").then((n) => n.r),
64528
- import("./chunk-DR8ukp6r.js").then((n) => n.s),
64529
- import("./markdown-tables-tW9bGjLM.js").then((n) => n.t)
64527
+ import("./replies-LSmuwOhA.js").then((n) => n.r),
64528
+ import("./chunk-09egQapi.js").then((n) => n.s),
64529
+ import("./markdown-tables-C-BmIap8.js").then((n) => n.t)
64530
64530
  ]);
64531
64531
  await deliverSlackSlashReplies({
64532
64532
  replies,
@@ -64579,7 +64579,7 @@ async function registerSlackMonitorSlashCommands(params) {
64579
64579
  let nativeCommands = [];
64580
64580
  if (nativeEnabled) {
64581
64581
  reg = await getCommandsRegistry();
64582
- const skillCommands = nativeSkillsEnabled ? (await import("./skill-commands-B_f8uGi7.js").then((n) => n.a)).listSkillCommandsForAgents({ cfg }) : [];
64582
+ const skillCommands = nativeSkillsEnabled ? (await import("./skill-commands-DcVwOafC.js").then((n) => n.a)).listSkillCommandsForAgents({ cfg }) : [];
64583
64583
  nativeCommands = reg.listNativeCommandSpecsForConfig(cfg, {
64584
64584
  skillCommands,
64585
64585
  provider: "slack"
@@ -66797,7 +66797,7 @@ const buildTelegramMessageContext = async ({ primaryCtx, allMedia, storeAllowFro
66797
66797
  const hasAudio = allMedia.some((media) => media.contentType?.startsWith("audio/"));
66798
66798
  let preflightTranscript;
66799
66799
  if (isGroup && requireMention && hasAudio && !hasUserText && mentionRegexes.length > 0) try {
66800
- const { transcribeFirstAudio } = await import("./audio-preflight-CjV36MUe.js");
66800
+ const { transcribeFirstAudio } = await import("./audio-preflight-BVaaZWkg.js");
66801
66801
  preflightTranscript = await transcribeFirstAudio({
66802
66802
  ctx: {
66803
66803
  MediaPaths: allMedia.length > 0 ? allMedia.map((m) => m.path) : void 0,
@@ -68565,7 +68565,7 @@ function safeParseState(raw) {
68565
68565
  async function readTelegramUpdateOffset(params) {
68566
68566
  const filePath = resolveTelegramUpdateOffsetPath(params.accountId, params.env);
68567
68567
  try {
68568
- return safeParseState(await fs.readFile(filePath, "utf-8"))?.lastUpdateId ?? null;
68568
+ return safeParseState(await fs$1.readFile(filePath, "utf-8"))?.lastUpdateId ?? null;
68569
68569
  } catch (err) {
68570
68570
  if (err.code === "ENOENT") return null;
68571
68571
  return null;
@@ -68574,7 +68574,7 @@ async function readTelegramUpdateOffset(params) {
68574
68574
  async function writeTelegramUpdateOffset(params) {
68575
68575
  const filePath = resolveTelegramUpdateOffsetPath(params.accountId, params.env);
68576
68576
  const dir = path.dirname(filePath);
68577
- await fs.mkdir(dir, {
68577
+ await fs$1.mkdir(dir, {
68578
68578
  recursive: true,
68579
68579
  mode: 448
68580
68580
  });
@@ -68583,9 +68583,9 @@ async function writeTelegramUpdateOffset(params) {
68583
68583
  version: STORE_VERSION,
68584
68584
  lastUpdateId: params.updateId
68585
68585
  };
68586
- await fs.writeFile(tmp, `${JSON.stringify(payload, null, 2)}\n`, { encoding: "utf-8" });
68587
- await fs.chmod(tmp, 384);
68588
- await fs.rename(tmp, filePath);
68586
+ await fs$1.writeFile(tmp, `${JSON.stringify(payload, null, 2)}\n`, { encoding: "utf-8" });
68587
+ await fs$1.chmod(tmp, 384);
68588
+ await fs$1.rename(tmp, filePath);
68589
68589
  }
68590
68590
 
68591
68591
  //#endregion
@@ -68942,23 +68942,23 @@ let webLoginQrPromise = null;
68942
68942
  let webChannelPromise = null;
68943
68943
  let whatsappActionsPromise = null;
68944
68944
  function loadWebOutbound() {
68945
- webOutboundPromise ??= import("./outbound-CIVsLpJK.js").then((n) => n.t);
68945
+ webOutboundPromise ??= import("./outbound-CtMCmwxR.js").then((n) => n.t);
68946
68946
  return webOutboundPromise;
68947
68947
  }
68948
68948
  function loadWebLogin() {
68949
- webLoginPromise ??= import("./login-BHUrERYo.js").then((n) => n.n);
68949
+ webLoginPromise ??= import("./login-ul8zaw_S.js").then((n) => n.n);
68950
68950
  return webLoginPromise;
68951
68951
  }
68952
68952
  function loadWebLoginQr() {
68953
- webLoginQrPromise ??= import("./login-qr-BKIOHn1V.js");
68953
+ webLoginQrPromise ??= import("./login-qr-AP9agO-i.js");
68954
68954
  return webLoginQrPromise;
68955
68955
  }
68956
68956
  function loadWebChannel() {
68957
- webChannelPromise ??= import("./web-DcHxbz2H.js");
68957
+ webChannelPromise ??= import("./web-0xZpP0WA.js");
68958
68958
  return webChannelPromise;
68959
68959
  }
68960
68960
  function loadWhatsAppActions() {
68961
- whatsappActionsPromise ??= import("./whatsapp-actions-SXenaJIn.js");
68961
+ whatsappActionsPromise ??= import("./whatsapp-actions-BIeSWsCF.js");
68962
68962
  return whatsappActionsPromise;
68963
68963
  }
68964
68964
  function createPluginRuntime() {
@@ -69179,7 +69179,7 @@ const resolvePluginSdkAliasFile = (params) => {
69179
69179
  const srcCandidate = path.join(cursor, "src", "plugin-sdk", params.srcFile);
69180
69180
  const distCandidate = path.join(cursor, "dist", "plugin-sdk", params.distFile);
69181
69181
  const orderedCandidates = isTest ? [distCandidate, srcCandidate] : [distCandidate];
69182
- for (const candidate of orderedCandidates) if (fsSync.existsSync(candidate)) return candidate;
69182
+ for (const candidate of orderedCandidates) if (fs.existsSync(candidate)) return candidate;
69183
69183
  const parent = path.dirname(cursor);
69184
69184
  if (parent === cursor) break;
69185
69185
  cursor = parent;
@@ -69725,7 +69725,7 @@ function resolvePluginTools(params) {
69725
69725
  //#endregion
69726
69726
  //#region src/agents/apply-patch-update.ts
69727
69727
  async function defaultReadFile(filePath) {
69728
- return fs.readFile(filePath, "utf8");
69728
+ return fs$1.readFile(filePath, "utf8");
69729
69729
  }
69730
69730
  async function applyUpdateHunk(filePath, chunks, options) {
69731
69731
  const originalLines = (await (options?.readFile ?? defaultReadFile)(filePath).catch((err) => {
@@ -69969,10 +69969,10 @@ function resolvePatchFileOps(options) {
69969
69969
  };
69970
69970
  }
69971
69971
  return {
69972
- readFile: (filePath) => fs.readFile(filePath, "utf8"),
69973
- writeFile: (filePath, content) => fs.writeFile(filePath, content, "utf8"),
69974
- remove: (filePath) => fs.rm(filePath),
69975
- mkdirp: (dir) => fs.mkdir(dir, { recursive: true }).then(() => {})
69972
+ readFile: (filePath) => fs$1.readFile(filePath, "utf8"),
69973
+ writeFile: (filePath, content) => fs$1.writeFile(filePath, content, "utf8"),
69974
+ remove: (filePath) => fs$1.rm(filePath),
69975
+ mkdirp: (dir) => fs$1.mkdir(dir, { recursive: true }).then(() => {})
69976
69976
  };
69977
69977
  }
69978
69978
  async function ensureDir(filePath, ops) {
@@ -71217,7 +71217,7 @@ async function repairSessionFileIfNeeded(params) {
71217
71217
  };
71218
71218
  let content;
71219
71219
  try {
71220
- content = await fs.readFile(sessionFile, "utf-8");
71220
+ content = await fs$1.readFile(sessionFile, "utf-8");
71221
71221
  } catch (err) {
71222
71222
  if (err?.code === "ENOENT") return {
71223
71223
  repaired: false,
@@ -71265,15 +71265,15 @@ async function repairSessionFileIfNeeded(params) {
71265
71265
  const backupPath = `${sessionFile}.bak-${process.pid}-${Date.now()}`;
71266
71266
  const tmpPath = `${sessionFile}.repair-${process.pid}-${Date.now()}.tmp`;
71267
71267
  try {
71268
- const stat = await fs.stat(sessionFile).catch(() => null);
71269
- await fs.writeFile(backupPath, content, "utf-8");
71270
- if (stat) await fs.chmod(backupPath, stat.mode);
71271
- await fs.writeFile(tmpPath, cleaned, "utf-8");
71272
- if (stat) await fs.chmod(tmpPath, stat.mode);
71273
- await fs.rename(tmpPath, sessionFile);
71268
+ const stat = await fs$1.stat(sessionFile).catch(() => null);
71269
+ await fs$1.writeFile(backupPath, content, "utf-8");
71270
+ if (stat) await fs$1.chmod(backupPath, stat.mode);
71271
+ await fs$1.writeFile(tmpPath, cleaned, "utf-8");
71272
+ if (stat) await fs$1.chmod(tmpPath, stat.mode);
71273
+ await fs$1.rename(tmpPath, sessionFile);
71274
71274
  } catch (err) {
71275
71275
  try {
71276
- await fs.unlink(tmpPath);
71276
+ await fs$1.unlink(tmpPath);
71277
71277
  } catch (cleanupErr) {
71278
71278
  params.warn?.(`session file repair cleanup failed: ${cleanupErr instanceof Error ? cleanupErr.message : "unknown error"} (${path.basename(tmpPath)})`);
71279
71279
  }
@@ -71957,8 +71957,8 @@ async function readWorkspaceContextForSummary() {
71957
71957
  const workspaceDir = process.cwd();
71958
71958
  const agentsPath = path.join(workspaceDir, "AGENTS.md");
71959
71959
  try {
71960
- if (!fsSync.existsSync(agentsPath)) return "";
71961
- const sections = extractSections(await fsSync.promises.readFile(agentsPath, "utf-8"), ["Session Startup", "Red Lines"]);
71960
+ if (!fs.existsSync(agentsPath)) return "";
71961
+ const sections = extractSections(await fs.promises.readFile(agentsPath, "utf-8"), ["Session Startup", "Red Lines"]);
71962
71962
  if (sections.length === 0) return "";
71963
71963
  const combined = sections.join("\n\n");
71964
71964
  return `\n\n<workspace-critical-rules>\n${combined.length > MAX_SUMMARY_CONTEXT_CHARS ? combined.slice(0, MAX_SUMMARY_CONTEXT_CHARS) + "\n...[truncated]..." : combined}\n</workspace-critical-rules>`;
@@ -72514,7 +72514,7 @@ async function prewarmSessionFile(sessionFile) {
72514
72514
  if (!isSessionManagerCacheEnabled()) return;
72515
72515
  if (isSessionManagerCached(sessionFile)) return;
72516
72516
  try {
72517
- const handle = await fs.open(sessionFile, "r");
72517
+ const handle = await fs$1.open(sessionFile, "r");
72518
72518
  try {
72519
72519
  const buffer = Buffer$1.alloc(4096);
72520
72520
  await handle.read(buffer, 0, buffer.length, 0);
@@ -72647,14 +72647,14 @@ async function compactEmbeddedPiSessionDirect(params) {
72647
72647
  if (!apiKeyInfo.apiKey) {
72648
72648
  if (apiKeyInfo.mode !== "aws-sdk") throw new Error(`No API key resolved for provider "${model.provider}" (auth mode: ${apiKeyInfo.mode}).`);
72649
72649
  } else if (model.provider === "github-copilot") {
72650
- const { resolveCopilotApiToken } = await import("./github-copilot-token-B8B2pmph.js").then((n) => n.n);
72650
+ const { resolveCopilotApiToken } = await import("./github-copilot-token-cCYzSU9h.js").then((n) => n.n);
72651
72651
  const copilotToken = await resolveCopilotApiToken({ githubToken: apiKeyInfo.apiKey });
72652
72652
  authStorage.setRuntimeApiKey(model.provider, copilotToken.token);
72653
72653
  } else authStorage.setRuntimeApiKey(model.provider, apiKeyInfo.apiKey);
72654
72654
  } catch (err) {
72655
72655
  return fail(describeUnknownError(err));
72656
72656
  }
72657
- await fs.mkdir(resolvedWorkspace, { recursive: true });
72657
+ await fs$1.mkdir(resolvedWorkspace, { recursive: true });
72658
72658
  const sandboxSessionKey = params.sessionKey?.trim() || params.sessionId;
72659
72659
  const sandbox = await resolveSandboxContext({
72660
72660
  config: params.config,
@@ -72662,7 +72662,7 @@ async function compactEmbeddedPiSessionDirect(params) {
72662
72662
  workspaceDir: resolvedWorkspace
72663
72663
  });
72664
72664
  const effectiveWorkspace = sandbox?.enabled ? sandbox.workspaceAccess === "rw" ? resolvedWorkspace : sandbox.workspaceDir : resolvedWorkspace;
72665
- await fs.mkdir(effectiveWorkspace, { recursive: true });
72665
+ await fs$1.mkdir(effectiveWorkspace, { recursive: true });
72666
72666
  await ensureSessionHeader({
72667
72667
  sessionFile: params.sessionFile,
72668
72668
  sessionId: params.sessionId,
@@ -73016,12 +73016,12 @@ function getQueuedFileWriter(writers, filePath) {
73016
73016
  const existing = writers.get(filePath);
73017
73017
  if (existing) return existing;
73018
73018
  const dir = path.dirname(filePath);
73019
- const ready = fs.mkdir(dir, { recursive: true }).catch(() => void 0);
73019
+ const ready = fs$1.mkdir(dir, { recursive: true }).catch(() => void 0);
73020
73020
  let queue = Promise.resolve();
73021
73021
  const writer = {
73022
73022
  filePath,
73023
73023
  write: (line) => {
73024
- queue = queue.then(() => ready).then(() => fs.appendFile(filePath, line, "utf8")).catch(() => void 0);
73024
+ queue = queue.then(() => ready).then(() => fs$1.appendFile(filePath, line, "utf8")).catch(() => void 0);
73025
73025
  }
73026
73026
  };
73027
73027
  writers.set(filePath, writer);
@@ -74044,11 +74044,11 @@ function appendRawStream(payload) {
74044
74044
  if (!rawStreamReady) {
74045
74045
  rawStreamReady = true;
74046
74046
  try {
74047
- fsSync.mkdirSync(path.dirname(RAW_STREAM_PATH), { recursive: true });
74047
+ fs.mkdirSync(path.dirname(RAW_STREAM_PATH), { recursive: true });
74048
74048
  } catch {}
74049
74049
  }
74050
74050
  try {
74051
- fsSync.promises.appendFile(RAW_STREAM_PATH, `${JSON.stringify(payload)}\n`);
74051
+ fs.promises.appendFile(RAW_STREAM_PATH, `${JSON.stringify(payload)}\n`);
74052
74052
  } catch {}
74053
74053
  }
74054
74054
 
@@ -75534,6 +75534,16 @@ function validateShellCommand(command) {
75534
75534
  //#endregion
75535
75535
  //#region src/agents/pi-tools.validate-wrapper.ts
75536
75536
  const log = createSubsystemLogger("agents/tool-validate");
75537
+ /**
75538
+ * Throw a tool validation error. pi-agent-core catches thrown errors in
75539
+ * execute(), formats them as { content: [{ type: "text", text: e.message }] }
75540
+ * with isError: true on the tool_execution_end event. This ensures:
75541
+ * 1. The model sees the helpful error message (e.message)
75542
+ * 2. The circuit breaker counts it as a tool failure (isError: true)
75543
+ */
75544
+ function throwToolError(message) {
75545
+ throw new Error(message);
75546
+ }
75537
75547
  const EXEC_TOOL_NAMES = new Set(["exec", "bash"]);
75538
75548
  const GEMMA_MODEL_ID = "gemma";
75539
75549
  /**
@@ -75637,7 +75647,7 @@ function wrapToolWithArgValidation(tool) {
75637
75647
  const missingFields = originalRequired.filter((field) => params[field] === void 0 || params[field] === null);
75638
75648
  if (missingFields.length > 0) {
75639
75649
  log.warn(`[validate] ${toolName} missing required fields: ${missingFields.join(", ")}`);
75640
- return Promise.resolve({ output: `Error: Missing required argument${missingFields.length > 1 ? "s" : ""}: ${missingFields.join(", ")}. Please try again with all required arguments.\nExample: ${usageExample}` });
75650
+ throwToolError(`Missing required argument${missingFields.length > 1 ? "s" : ""}: ${missingFields.join(", ")}. Please try again with all required arguments.\nExample: ${usageExample}`);
75641
75651
  }
75642
75652
  const { cleaned, changed } = sanitizeParams(params);
75643
75653
  if (changed) log.debug(`[validate] sanitized args for ${toolName}: ${Object.keys(params).filter((k) => cleaned[k] !== params[k]).join(",")}`);
@@ -75651,7 +75661,7 @@ function wrapToolWithArgValidation(tool) {
75651
75661
  const result = validateShellCommand(command);
75652
75662
  if (!result.valid) {
75653
75663
  log.warn(`[validate] exec command rejected: reason=${result.reason} raw=${command.slice(0, 100)}`);
75654
- return Promise.resolve({ output: `Error: ${result.reason}. The command appears to contain model control tokens. Please provide a clean shell command without any <|, |>, or XML-like tags. Only valid shell syntax is accepted.` });
75664
+ throwToolError(`${result.reason}. The command appears to contain model control tokens. Please provide a clean shell command without any <|, |>, or XML-like tags. Only valid shell syntax is accepted.`);
75655
75665
  }
75656
75666
  if (result.cleaned !== command) {
75657
75667
  log.debug(`[validate] exec command cleaned: raw=${command.slice(0, 80)} → cleaned=${result.cleaned.slice(0, 80)}`);
@@ -75863,7 +75873,7 @@ function isInPoisonRange(version) {
75863
75873
  */
75864
75874
  async function checkSessionPoison(sessionFile) {
75865
75875
  try {
75866
- const firstLine = (await fs.readFile(sessionFile, "utf-8")).split("\n")[0];
75876
+ const firstLine = (await fs$1.readFile(sessionFile, "utf-8")).split("\n")[0];
75867
75877
  if (!firstLine) return null;
75868
75878
  const header = JSON.parse(firstLine);
75869
75879
  if (header.type !== "session") return null;
@@ -75881,7 +75891,7 @@ async function checkSessionPoison(sessionFile) {
75881
75891
  */
75882
75892
  async function archivePoisonedSession(sessionFile) {
75883
75893
  const archiveName = `${sessionFile}.archived-poison.${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}`;
75884
- await fs.rename(sessionFile, archiveName);
75894
+ await fs$1.rename(sessionFile, archiveName);
75885
75895
  return archiveName;
75886
75896
  }
75887
75897
  /**
@@ -75890,14 +75900,14 @@ async function archivePoisonedSession(sessionFile) {
75890
75900
  */
75891
75901
  async function stampSessionVersion(sessionFile) {
75892
75902
  try {
75893
- const lines = (await fs.readFile(sessionFile, "utf-8")).split("\n");
75903
+ const lines = (await fs$1.readFile(sessionFile, "utf-8")).split("\n");
75894
75904
  if (lines.length === 0) return;
75895
75905
  const header = JSON.parse(lines[0]);
75896
75906
  if (header.type !== "session") return;
75897
75907
  if (header.symiVersion === VERSION) return;
75898
75908
  header.symiVersion = VERSION;
75899
75909
  lines[0] = JSON.stringify(header);
75900
- await fs.writeFile(sessionFile, lines.join("\n"), "utf-8");
75910
+ await fs$1.writeFile(sessionFile, lines.join("\n"), "utf-8");
75901
75911
  } catch {}
75902
75912
  }
75903
75913
  /**
@@ -76060,7 +76070,7 @@ async function prepareSessionManagerForRun(params) {
76060
76070
  return;
76061
76071
  }
76062
76072
  if (params.hadSessionFile && header && !hasAssistant) {
76063
- await fs.writeFile(params.sessionFile, "", "utf-8");
76073
+ await fs$1.writeFile(params.sessionFile, "", "utf-8");
76064
76074
  sm.fileEntries = [header];
76065
76075
  sm.byId?.clear?.();
76066
76076
  sm.labelsById?.clear?.();
@@ -76618,7 +76628,7 @@ async function runEmbeddedAttempt(params) {
76618
76628
  const prevCwd = process.cwd();
76619
76629
  const runAbortController = new AbortController();
76620
76630
  log$9.debug(`embedded run start: runId=${params.runId} sessionId=${params.sessionId} provider=${params.provider} model=${params.modelId} thinking=${params.thinkLevel} messageChannel=${params.messageChannel ?? params.messageProvider ?? "unknown"}`);
76621
- await fs.mkdir(resolvedWorkspace, { recursive: true });
76631
+ await fs$1.mkdir(resolvedWorkspace, { recursive: true });
76622
76632
  const sandboxSessionKey = params.sessionKey?.trim() || params.sessionId;
76623
76633
  const sandbox = await resolveSandboxContext({
76624
76634
  config: params.config,
@@ -76626,7 +76636,7 @@ async function runEmbeddedAttempt(params) {
76626
76636
  workspaceDir: resolvedWorkspace
76627
76637
  });
76628
76638
  const effectiveWorkspace = sandbox?.enabled ? sandbox.workspaceAccess === "rw" ? resolvedWorkspace : sandbox.workspaceDir : resolvedWorkspace;
76629
- await fs.mkdir(effectiveWorkspace, { recursive: true });
76639
+ await fs$1.mkdir(effectiveWorkspace, { recursive: true });
76630
76640
  let restoreSkillEnv;
76631
76641
  process.chdir(effectiveWorkspace);
76632
76642
  try {
@@ -76856,7 +76866,7 @@ async function runEmbeddedAttempt(params) {
76856
76866
  sessionFile: params.sessionFile,
76857
76867
  warn: (message) => log$9.warn(message)
76858
76868
  });
76859
- const hadSessionFile = await fs.stat(params.sessionFile).then(() => true).catch(() => false);
76869
+ const hadSessionFile = await fs$1.stat(params.sessionFile).then(() => true).catch(() => false);
76860
76870
  const transcriptPolicy = resolveTranscriptPolicy({
76861
76871
  modelApi: params.model?.api,
76862
76872
  provider: params.provider,
@@ -77840,7 +77850,7 @@ async function runEmbeddedPiAgent(params) {
77840
77850
  return;
77841
77851
  }
77842
77852
  if (model.provider === "github-copilot") {
77843
- const { resolveCopilotApiToken } = await import("./github-copilot-token-B8B2pmph.js").then((n) => n.n);
77853
+ const { resolveCopilotApiToken } = await import("./github-copilot-token-cCYzSU9h.js").then((n) => n.n);
77844
77854
  const copilotToken = await resolveCopilotApiToken({ githubToken: apiKeyInfo.apiKey });
77845
77855
  authStorage.setRuntimeApiKey(model.provider, copilotToken.token);
77846
77856
  } else authStorage.setRuntimeApiKey(model.provider, apiKeyInfo.apiKey);
@@ -77925,7 +77935,7 @@ async function runEmbeddedPiAgent(params) {
77925
77935
  }
77926
77936
  runLoopIterations += 1;
77927
77937
  attemptedThinking.add(thinkLevel);
77928
- await fs.mkdir(resolvedWorkspace, { recursive: true });
77938
+ await fs$1.mkdir(resolvedWorkspace, { recursive: true });
77929
77939
  const prompt = provider === "anthropic" ? scrubAnthropicRefusalMagic(params.prompt) : params.prompt;
77930
77940
  const attempt = await runEmbeddedAttempt({
77931
77941
  sessionId: params.sessionId,