@bitseek/claw 1.3.6 → 1.3.8-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/dist/{accounts-CX1yOBOk.js → accounts-BTexwKe8.js} +1 -1
  2. package/dist/{accounts-Bwq1wvds.js → accounts-DMvETf-t.js} +1 -1
  3. package/dist/{accounts-CaiECgq3.js → accounts-ubG6irXZ.js} +16 -16
  4. package/dist/{active-listener-neKWQsOO.js → active-listener-Hd9sOu9T.js} +1 -1
  5. package/dist/{agent-scope-CTbRzU1C.js → agent-scope-C6hps0r3.js} +4 -4
  6. package/dist/{agents-BqONdWNu.js → agents-4yiCX5vO.js} +4 -4
  7. package/dist/{agents.config-2cTTTDPj.js → agents.config-C26BMyOA.js} +1 -1
  8. package/dist/{agents.config-DhIvFsFv.js → agents.config-C4xJzUcO.js} +1 -1
  9. package/dist/{api-key-rotation-BbZD-rsQ.js → api-key-rotation-Cv5_SG_o.js} +2 -2
  10. package/dist/{audio-preflight-C5Crv38h.js → audio-preflight-C2pZmbnM.js} +39 -39
  11. package/dist/{audio-transcription-runner-eVtEKUPC.js → audio-transcription-runner-CQ4BMvGX.js} +11 -11
  12. package/dist/{auth-choice-D6WGnKQk.js → auth-choice-Cpai95xS.js} +1 -1
  13. package/dist/{auth-choice-lhaABxGx.js → auth-choice-D9W2yx7x.js} +1 -1
  14. package/dist/{banner-CMCfl-_K.js → banner-DtaJorEc.js} +1 -1
  15. package/dist/{bindings-Daa-Etag.js → bindings-CsIiIjqN.js} +2 -2
  16. package/dist/build-info.json +2 -2
  17. package/dist/bundled/boot-md/handler.js +65 -65
  18. package/dist/bundled/bootstrap-extra-files/handler.js +7 -7
  19. package/dist/bundled/command-logger/handler.js +2 -2
  20. package/dist/bundled/session-memory/handler.js +65 -65
  21. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  22. package/dist/{channel-activity-D0BHmeoE.js → channel-activity-Dwc2BBvs.js} +3 -3
  23. package/dist/{channel-options-gDhT85r4.js → channel-options-D3Ck-1W2.js} +1 -1
  24. package/dist/{channel-options-Didnr81h.js → channel-options-DffMDeTp.js} +1 -1
  25. package/dist/{channel-web-C45x6ahP.js → channel-web-BB66exAr.js} +1 -1
  26. package/dist/{channel-web-rP0VBNIt.js → channel-web-zni8DLt7.js} +1 -1
  27. package/dist/{channels-cli-CZQbGl-H.js → channels-cli-D_gj850i.js} +6 -6
  28. package/dist/{channels-cli-BpiA2BQE.js → channels-cli-IQCAixeN.js} +6 -6
  29. package/dist/{chrome-BRjY_MCc.js → chrome-DWfXErGH.js} +26 -26
  30. package/dist/{chunk-Dfkbh8wX.js → chunk-2ZxftpDd.js} +1 -1
  31. package/dist/{cli-Cvdtw0CY.js → cli-BlPS7kZ9.js} +1 -1
  32. package/dist/{cli-D5yg1LCm.js → cli-CrgfzbyT.js} +1 -1
  33. package/dist/{command-registry-BSN6zVlZ.js → command-registry-CjTwwZuF.js} +11 -11
  34. package/dist/{commands-registry-NyRDVN7s.js → commands-registry-CTkboeeC.js} +5 -5
  35. package/dist/{completion-cli-BDeiV4p9.js → completion-cli-CgjnsXtn.js} +1 -1
  36. package/dist/{completion-cli-lZ6S6oKA.js → completion-cli-Clj1_156.js} +2 -2
  37. package/dist/{config-cli-C-yIXgGr.js → config-cli-CE1eTqAM.js} +1 -1
  38. package/dist/{config-cli-BtvOIDkG.js → config-cli-DwKVeQtE.js} +1 -1
  39. package/dist/{configure-DflayaB2.js → configure-BCUvl2Zf.js} +3 -3
  40. package/dist/{configure-CgbTpfrx.js → configure-D2KyFnr8.js} +3 -3
  41. package/dist/{deliver-DlLNT2iR.js → deliver-zrYSWfQ5.js} +22 -22
  42. package/dist/{diagnostic-DpOlXoSr.js → diagnostic-BO1GQJJf.js} +2 -2
  43. package/dist/{dock-DXlPVrMo.js → dock-Bm23mfim.js} +6 -6
  44. package/dist/{doctor-completion-BKCOmkBi.js → doctor-completion-BoZbJ2cC.js} +1 -1
  45. package/dist/{doctor-completion-Bim4XRFT.js → doctor-completion-CACrVkvp.js} +1 -1
  46. package/dist/entry.js +2 -2
  47. package/dist/{env-Bn6pmvjK.js → env-DNMZEG57.js} +2 -2
  48. package/dist/{errors-Ct2kCLWx.js → errors-B11yhRo6.js} +1 -1
  49. package/dist/extensionAPI.js +1 -1
  50. package/dist/{fetch-2cO0rj7X.js → fetch-4RonjgqX.js} +5 -5
  51. package/dist/{fetch-guard-iigSYt3Q.js → fetch-guard-B1EGEHan.js} +2 -2
  52. package/dist/{frontmatter-rlCI8Hmw.js → frontmatter-D6vByAHn.js} +2 -2
  53. package/dist/{fs-safe-CM9EhGvi.js → fs-safe-C77EShMC.js} +4 -4
  54. package/dist/{gateway-cli-CDgld1qp.js → gateway-cli-BUFxEad5.js} +8 -8
  55. package/dist/{gateway-cli-8DmbQc9V.js → gateway-cli-D9mIlXNc.js} +8 -8
  56. package/dist/{github-copilot-token-CPjAmbfr.js → github-copilot-token-DLGN-8YS.js} +7 -7
  57. package/dist/{health-Gkd0akfz.js → health-Cjj_F37M.js} +1 -1
  58. package/dist/{health-DaN3xECS.js → health-CpbNiL9A.js} +1 -1
  59. package/dist/{hooks-cli-gRM8FMyG.js → hooks-cli-C0lC4Kj0.js} +2 -2
  60. package/dist/{hooks-cli-n5Weiheq.js → hooks-cli-DRkHJxMs.js} +2 -2
  61. package/dist/{image-BWlmyhr-.js → image-DnxYCkHO.js} +6 -6
  62. package/dist/{image-ops-jvmQoiyw.js → image-ops-DCpyia_K.js} +1 -1
  63. package/dist/index.js +6 -6
  64. package/dist/{internal-hooks-oLQ2m8YT.js → internal-hooks-yQe6H47q.js} +1 -1
  65. package/dist/{ir-pR36nI-3.js → ir-DcDVAFj3.js} +6 -6
  66. package/dist/llm-slug-generator.js +65 -65
  67. package/dist/{logger-DelEB7MK.js → logger-BlH5MJiV.js} +1 -1
  68. package/dist/{login-Cm2zDfEU.js → login-CgEHUE7h.js} +6 -6
  69. package/dist/{login-qr-iS1jPDpP.js → login-qr-DUJfhbUe.js} +13 -13
  70. package/dist/{manager-BX3KtavU.js → manager-tozHviEd.js} +15 -15
  71. package/dist/{markdown-tables-pfs_NCNh.js → markdown-tables-BHONoo6S.js} +1 -1
  72. package/dist/{message-channel-DB68nc40.js → message-channel-pbgFFUNm.js} +1 -1
  73. package/dist/{model-selection-DfZMxaX3.js → model-selection-D_Si2Ict.js} +44 -44
  74. package/dist/{models-CJodAVSF.js → models-De_qVfBK.js} +2 -2
  75. package/dist/{models-cli-B1Dwj01V.js → models-cli-By7lFchJ.js} +2 -2
  76. package/dist/{models-cli-Ceb37L0t.js → models-cli-aJswKT_o.js} +3 -3
  77. package/dist/{npm-resolution-B5fqS6mO.js → npm-resolution-BiJCUhct.js} +1 -1
  78. package/dist/{npm-resolution-dNC8uD0I.js → npm-resolution-Ez_78UD2.js} +1 -1
  79. package/dist/{onboard-sKY5jwsH.js → onboard-CIrRD9vz.js} +2 -2
  80. package/dist/{onboard-BcaFvsav.js → onboard-DQJ6ZB5N.js} +2 -2
  81. package/dist/{onboard-channels-DPIysHDh.js → onboard-channels-AbBziYo3.js} +1 -1
  82. package/dist/{onboard-channels-DQ1rkv4c.js → onboard-channels-yslMqzIm.js} +1 -1
  83. package/dist/{onboarding-BRfS3PSa.js → onboarding-CIsQzEx6.js} +3 -3
  84. package/dist/{onboarding-JNyox6ZE.js → onboarding-exdNo-8e.js} +3 -3
  85. package/dist/{onboarding.finalize-CG9tTRyw.js → onboarding.finalize-BqpH39L7.js} +5 -5
  86. package/dist/{onboarding.finalize-hBg4b8IC.js → onboarding.finalize-spYqvVP0.js} +6 -6
  87. package/dist/{outbound-N9_vLIGT.js → outbound-9rXkgGZM.js} +7 -7
  88. package/dist/{outbound-attachment-CEt49GWZ.js → outbound-attachment-Cy8rvvJE.js} +2 -2
  89. package/dist/{path-alias-guards-xY_GOJVd.js → path-alias-guards-Cpb5gMG6.js} +1 -1
  90. package/dist/{paths-Bi8MJ8NM.js → paths-BHEVctLd.js} +3 -3
  91. package/dist/{paths-DKuX7-1L.js → paths-aGRLvQx9.js} +5 -5
  92. package/dist/{pi-embedded-cmJctBve.js → pi-embedded-BW8O-Z_R.js} +109 -15
  93. package/dist/{pi-embedded-CDXssetE.js → pi-embedded-DLrpQftt.js} +292 -198
  94. package/dist/{pi-embedded-helpers-DSPiPpLM.js → pi-embedded-helpers-Bo7e-QzJ.js} +29 -29
  95. package/dist/{pi-model-discovery-N7o4F93J.js → pi-model-discovery-DA46fxhD.js} +7 -7
  96. package/dist/{plugin-registry-NaHPDM1s.js → plugin-registry-CgjiDSJy.js} +1 -1
  97. package/dist/{plugin-registry-2CmN8Jv2.js → plugin-registry-DXEjCmXY.js} +1 -1
  98. package/dist/plugin-sdk/agents/pi-tools.read.d.ts +1 -0
  99. package/dist/plugin-sdk/{channel-web-Dn5fneOY.js → channel-web-BhgjzJX5.js} +1 -1
  100. package/dist/plugin-sdk/index.js +2 -2
  101. package/dist/plugin-sdk/{reply-rsLB0nJs.js → reply-CLQkx08P.js} +107 -13
  102. package/dist/plugin-sdk/{web-RBob4uU1.js → web-D5yQYvYF.js} +2 -2
  103. package/dist/{plugins-D63QYxW6.js → plugins-CJoaoIHc.js} +11 -11
  104. package/dist/{plugins-cli-DwKgp7q7.js → plugins-cli-CpSINdz-.js} +2 -2
  105. package/dist/{plugins-cli-o6KJO4Qe.js → plugins-cli-DKIC54hQ.js} +2 -2
  106. package/dist/{program-B_-eFyJE.js → program-R4eCXcVV.js} +7 -7
  107. package/dist/{program-context-BJQXRZ1w.js → program-context-XIBDpYkH.js} +19 -19
  108. package/dist/{prompt-select-styled-QH4mD93d.js → prompt-select-styled-CSGsMtmW.js} +4 -4
  109. package/dist/{prompt-select-styled-asxoqY78.js → prompt-select-styled-CxcE42jh.js} +4 -4
  110. package/dist/{provider-auth-helpers-hI1pbI9r.js → provider-auth-helpers-BPwzCB_M.js} +1 -1
  111. package/dist/{provider-auth-helpers-CzSm0FSu.js → provider-auth-helpers-BqRZaAgE.js} +1 -1
  112. package/dist/{proxy-jINniQBi.js → proxy-DfJJLvch.js} +1 -1
  113. package/dist/{proxy-env-Drg9J503.js → proxy-env-ynOWOBHx.js} +1 -1
  114. package/dist/{proxy-fetch-AvkSvetA.js → proxy-fetch-xlbVQYN_.js} +1 -1
  115. package/dist/{push-apns-DZ0qaSFA.js → push-apns-BFPYim-z.js} +1 -1
  116. package/dist/{push-apns-DMeB2M_b.js → push-apns-D_JirvZj.js} +1 -1
  117. package/dist/{pw-ai-gDXxKGzT.js → pw-ai-Cu3cnNF0.js} +17 -17
  118. package/dist/{qmd-manager-DXbV8CPG.js → qmd-manager-n4jauq3A.js} +11 -11
  119. package/dist/{query-expansion-C0A4WwZX.js → query-expansion-CdDUaBcQ.js} +5 -5
  120. package/dist/{redact-BC9R18Uw.js → redact-CaZQhKzI.js} +1 -1
  121. package/dist/{register.agent-D9rmYCMS.js → register.agent-Cls5qjTc.js} +6 -6
  122. package/dist/{register.agent-BBOmACUM.js → register.agent-rU2v36L0.js} +7 -7
  123. package/dist/{register.configure-CZF2XAPO.js → register.configure-BMDzBahu.js} +7 -7
  124. package/dist/{register.configure-BJ7l1h-A.js → register.configure-BUhyYBGQ.js} +7 -7
  125. package/dist/{register.init-BdPckTb9.js → register.init-CFdcOH88.js} +1 -0
  126. package/dist/{register.init-CNKrbvCo.js → register.init-pWy0PRza.js} +1 -0
  127. package/dist/{register.maintenance-B0nZqqML.js → register.maintenance-CofdyNUx.js} +7 -7
  128. package/dist/{register.maintenance-DvWoKstb.js → register.maintenance-Cy17SXVH.js} +8 -8
  129. package/dist/{register.message-BME4m1Jr.js → register.message-3BQdcipC.js} +2 -2
  130. package/dist/{register.message-Cs0mwtTw.js → register.message-Ce33qQCZ.js} +2 -2
  131. package/dist/{register.onboard-DOhvWYV7.js → register.onboard-BlcK7F0u.js} +2 -2
  132. package/dist/{register.onboard-B1-O21vU.js → register.onboard-ESEjBMtx.js} +2 -2
  133. package/dist/{register.setup-ixDBzvTR.js → register.setup-CUxHFPRL.js} +2 -2
  134. package/dist/{register.setup-KPZYo_I1.js → register.setup-N8V5bjG1.js} +2 -2
  135. package/dist/{register.start-Df91ZVJJ.js → register.start-CI8ol0Mk.js} +1 -1
  136. package/dist/{register.start-DErNT3nQ.js → register.start-D5trBtN0.js} +1 -1
  137. package/dist/{register.status-health-sessions-Czq26k6E.js → register.status-health-sessions-BKFS62CW.js} +3 -3
  138. package/dist/{register.status-health-sessions-wp3A615j.js → register.status-health-sessions-Bj4rUQRe.js} +3 -3
  139. package/dist/{register.subclis-BSGvOwqU.js → register.subclis-lEqV1Knw.js} +9 -9
  140. package/dist/{registry-C2GEGa2t.js → registry-CJCkqTms.js} +3 -3
  141. package/dist/{replies-B6I1tT5t.js → replies-D6zARd6r.js} +3 -3
  142. package/dist/{reply-OEcNPoWd.js → reply-CAA6gLtt.js} +109 -15
  143. package/dist/{reply-prefix-9mzt89Cf.js → reply-prefix-DK1i6bCJ.js} +1 -1
  144. package/dist/{resolve-route-BNElrVxR.js → resolve-route-C5hVstLo.js} +4 -4
  145. package/dist/{retry-Ayb7e4XG.js → retry-DTeP7C3h.js} +1 -1
  146. package/dist/{run-main-CdI1kXKr.js → run-main-BTmP3wme.js} +14 -14
  147. package/dist/{send-BMzVXosN.js → send--Gq-Uh-l.js} +7 -7
  148. package/dist/{send-DC_e_Iev.js → send-BpyiQEov.js} +6 -6
  149. package/dist/{send-B6QQ8XfC.js → send-CcQZM0c7.js} +8 -8
  150. package/dist/{send-Buidj_8L.js → send-D2zYssqK.js} +27 -27
  151. package/dist/{send-BQETStDl.js → send-DcL81tZr.js} +10 -10
  152. package/dist/{server-node-events-BE-B31Iv.js → server-node-events-CD_Wo8L4.js} +2 -2
  153. package/dist/{server-node-events-h5NyibKC.js → server-node-events-ap09x8RZ.js} +2 -2
  154. package/dist/{session-meta-DAMj6ZRX.js → session-meta-BbCwXniv.js} +2 -2
  155. package/dist/{session-TVb8hgJP.js → session-xKPVUYQP.js} +9 -9
  156. package/dist/{sessions-Ck4ZR4dY.js → sessions-D7EjW0sG.js} +31 -31
  157. package/dist/{skill-commands-KesfMtZ9.js → skill-commands-Cea3CZFF.js} +9 -9
  158. package/dist/{skills-BYmEoxNo.js → skills-BttlqUXr.js} +22 -22
  159. package/dist/{status-CmNVuywF.js → status-CB2Fs5iL.js} +2 -2
  160. package/dist/{status-D_I-fLJF.js → status-DCtLhxlh.js} +2 -2
  161. package/dist/{store-KLMMBnKE.js → store-B7PaqfvZ.js} +2 -2
  162. package/dist/{subagent-registry-D4xGq2uc.js → subagent-registry-B4xJjOu2.js} +109 -15
  163. package/dist/{subsystem-CAatx5oo.js → subsystem-BRjuJbbM.js} +14 -14
  164. package/dist/{tables-DqechQWF.js → tables-BJ0XAman.js} +1 -1
  165. package/dist/{target-errors-C-KolUyX.js → target-errors-Dad0aUFR.js} +2 -2
  166. package/dist/{tokens-BvzZdrVJ.js → tokens-B9EDT4jv.js} +1 -1
  167. package/dist/{tool-images-DiKIlElg.js → tool-images-ArXzv82F.js} +2 -2
  168. package/dist/{tool-loop-detection-C4V990MS.js → tool-loop-detection-CLoYKYIq.js} +3 -3
  169. package/dist/{update-cli-CfeiDzYx.js → update-cli-BIMys5Ua.js} +7 -7
  170. package/dist/{update-cli-DKmrzt8l.js → update-cli-BuVnlit7.js} +8 -8
  171. package/dist/{update-runner-D5vyQGte.js → update-runner-C4bLqctv.js} +1 -1
  172. package/dist/{update-runner-BUth8QlB.js → update-runner-DGqZqXVF.js} +1 -1
  173. package/dist/{utils-Bo1RFF0l.js → utils-BFZnl-5N.js} +6 -6
  174. package/dist/{web-CQqnJkMB.js → web-BCpNE4aE.js} +2 -2
  175. package/dist/{web-BYeS4JNp.js → web-BJQKWHqO.js} +1 -1
  176. package/dist/{web-BPI4HIht.js → web-Bun-T89j.js} +69 -69
  177. package/dist/{web-Bc1AWW4q.js → web-Cb4sindp.js} +2 -2
  178. package/dist/{whatsapp-actions-Bf61u88d.js → whatsapp-actions-Be9uvUUL.js} +28 -28
  179. package/dist/{workspace-CswOYN9T.js → workspace-D6mrCnXi.js} +21 -21
  180. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import os from "node:os";
2
2
  import path from "node:path";
3
- import fs from "node:fs";
3
+ import syncFs from "node:fs";
4
4
 
5
5
  //#region src/cli/cli-name.ts
6
6
  const DEFAULT_CLI_NAME = "openclaw";
@@ -124,10 +124,10 @@ function resolveStateDir(env = process.env, homedir = envHomedir(env)) {
124
124
  const newDir = defaultStateDirForEnv(env, effectiveHomedir);
125
125
  if (env.OPENCLAW_TEST_FAST === "1") return newDir;
126
126
  const legacyDirs = legacyStateDirs(effectiveHomedir);
127
- if (fs.existsSync(newDir)) return newDir;
127
+ if (syncFs.existsSync(newDir)) return newDir;
128
128
  const existingLegacy = legacyDirs.find((dir) => {
129
129
  try {
130
- return fs.existsSync(dir);
130
+ return syncFs.existsSync(dir);
131
131
  } catch {
132
132
  return false;
133
133
  }
@@ -167,7 +167,7 @@ function resolveConfigPathCandidate(env = process.env, homedir = envHomedir(env)
167
167
  if (env.OPENCLAW_TEST_FAST === "1") return resolveCanonicalConfigPath(env, resolveStateDir(env, homedir));
168
168
  const existing = resolveDefaultConfigCandidates(env, homedir).find((candidate) => {
169
169
  try {
170
- return fs.existsSync(candidate);
170
+ return syncFs.existsSync(candidate);
171
171
  } catch {
172
172
  return false;
173
173
  }
@@ -185,7 +185,7 @@ function resolveConfigPath(env = process.env, stateDir = resolveStateDir(env, en
185
185
  const stateOverride = env.OPENCLAW_STATE_DIR?.trim();
186
186
  const existing = [path.join(stateDir, CONFIG_FILENAME), ...LEGACY_CONFIG_FILENAMES.map((name) => path.join(stateDir, name))].find((candidate) => {
187
187
  try {
188
- return fs.existsSync(candidate);
188
+ return syncFs.existsSync(candidate);
189
189
  } catch {
190
190
  return false;
191
191
  }
@@ -1,11 +1,11 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
2
- import { A as spawnWithFallback, C as loadWorkspaceBootstrapFiles, E as resolveOpenClawPackageRoot, G as resolveAgentModelPrimaryValue, H as normalizeWindowsPathForComparison, K as toAgentModelListLike, M as openBoundaryFile, N as openBoundaryFileSync, O as runCommandWithTimeout, S as filterBootstrapFilesForSession, W as resolveAgentModelFallbackValues, _ as DEFAULT_IDENTITY_FILENAME, c as resolveDefaultAgentId, d as resolveSessionAgentId, f as resolveSessionAgentIds, h as DEFAULT_BOOTSTRAP_FILENAME, i as resolveAgentDir, k as runExec, l as resolveEffectiveModelFallbacks, m as DEFAULT_AGENT_WORKSPACE_DIR, n as listAgentIds, o as resolveAgentSkillsFilter, r as resolveAgentConfig, s as resolveAgentWorkspaceDir, t as hasConfiguredModelFallbacks, u as resolveRunModelFallbacksOverride, w as resolveWorkspaceAttachmentsRoot, x as ensureAgentWorkspace } from "./agent-scope-BV1a5xUb.js";
2
+ import { A as spawnWithFallback, B as isPathInside, C as loadWorkspaceBootstrapFiles, E as resolveOpenClawPackageRoot, G as resolveAgentModelPrimaryValue, H as normalizeWindowsPathForComparison, K as toAgentModelListLike, M as openBoundaryFile, N as openBoundaryFileSync, O as runCommandWithTimeout, R as hasNodeErrorCode, S as filterBootstrapFilesForSession, W as resolveAgentModelFallbackValues, _ as DEFAULT_IDENTITY_FILENAME, c as resolveDefaultAgentId, d as resolveSessionAgentId, f as resolveSessionAgentIds, h as DEFAULT_BOOTSTRAP_FILENAME, i as resolveAgentDir, k as runExec, l as resolveEffectiveModelFallbacks, m as DEFAULT_AGENT_WORKSPACE_DIR, n as listAgentIds, o as resolveAgentSkillsFilter, r as resolveAgentConfig, s as resolveAgentWorkspaceDir, t as hasConfiguredModelFallbacks, u as resolveRunModelFallbacksOverride, w as resolveWorkspaceAttachmentsRoot, x as ensureAgentWorkspace, z as isNotFoundPathError } from "./agent-scope-BV1a5xUb.js";
3
3
  import { a as resolveGatewayPort, c as resolveStateDir, d as resolveRequiredHomeDir, l as expandHomePrefix, n as STATE_DIR, p as resolveCliName, r as resolveConfigPath } from "./paths-De1_4l4O.js";
4
4
  import { C as normalizeLogLevel, E as consumeRootOptionToken, T as FLAG_TERMINATOR, _ as isRich, a as clearActiveProgressLine, c as danger, f as setVerbose, g as colorize, h as warn, i as defaultRuntime, o as registerActiveProgressLine, p as shouldLogVerbose, r as createNonExitingRuntime, s as unregisterActiveProgressLine, t as createSubsystemLogger, u as logVerbose, v as theme, w as resolvePreferredOpenClawTmpDir, y as getChildLogger } from "./subsystem-CVmydYhZ.js";
5
5
  import { C as resolveThreadParentSessionKey, S as parseAgentSessionKey, _ as deriveSessionChatType, b as isCronSessionKey, c as normalizeAgentId, d as resolveThreadSessionKeys, f as sanitizeAgentId, g as isBlockedObjectKey, h as normalizeOptionalAccountId, l as normalizeMainKey, m as normalizeAccountId$2, o as classifySessionKeyShape, p as DEFAULT_ACCOUNT_ID, r as buildAgentMainSessionKey, s as isValidAgentId, t as DEFAULT_AGENT_ID, u as resolveAgentIdFromSessionKey, v as getSubagentDepth, x as isSubagentSessionKey, y as isAcpSessionKey } from "./session-key-a6av96Fj.js";
6
6
  import { C as isPlainObject, S as truncateUtf16Safe, _ as shortenHomeInString, a as ensureDir$3, b as sliceUtf16Safe, c as isRecord$1, d as normalizeE164, h as resolveUserPath, o as escapeRegExp, r as clampInt, s as formatTerminalLink, t as CONFIG_DIR, v as shortenHomePath, y as sleep$1 } from "./utils-CM9uSTVd.js";
7
7
  import { i as logWarn, n as logError, r as logInfo, t as logDebug } from "./logger-9KuF7Fqb.js";
8
- import { $ as resolveIMessageAttachmentRoots, $t as resolveCommandResolutionFromArgv, A as resolveEnvApiKey, An as resolveOpenClawAgentDir, At as normalizePluginsConfig, Bn as DEFAULT_MODEL, Bt as unsetConfigValueAtPath, C as buildAssistantMessageWithZeroUsage, Cn as isDangerousHostEnvVarName, Ct as loadPluginManifestRegistry, D as getCustomProviderApiKey, Dn as markAuthProfileGood, E as getApiKeyForModel, En as listProfilesForProvider, Et as safeStatSync, F as isProfileInCooldown, Fn as resolveAuthProfileDisplayLabel, Ft as setConfigOverride, G as writeConfigFile, Gt as validateSafeBinArgv, H as readConfigFileSnapshot, Ht as isTrustedSafeBinPath, I as markAuthProfileFailure, It as unsetConfigOverride, J as normalizeTelegramCommandName, Jt as isWindowsPlatform, K as validateConfigObjectWithPlugins, Kt as analyzeShellCommand, L as markAuthProfileUsed, Ln as normalizeSecretInput, Lt as getConfigValueAtPath, Mt as resolveMemorySlotDecision, N as resolveAuthProfileOrder, Nt as getConfigOverrides, O as requireApiKey, On as ensureAuthProfileStore, Ot as MANIFEST_KEY, P as getSoonestCooldownExpiry, Pt as resetConfigOverrides, Qt as resolveAllowlistCandidatePath, R as resolveProfilesUnavailableReason, Rn as splitTrailingAuthProfile, Rt as parseConfigPath, S as buildAssistantMessage, Sn as resolveShellEnvFallbackTimeoutMs, St as validateJsonSchemaValue, T as buildUsageWithNoCost, Tn as dedupeProfileIds, Tt as isPathInside, Ut as listWritableExplicitTrustedSafeBinDirs, V as loadConfig, Vn as DEFAULT_PROVIDER, Vt as getTrustedSafeBinDirs, W as resolveConfigSnapshotHash, Wt as normalizeTrustedSafeBinDirs, Xt as DEFAULT_SAFE_BINS, Y as resolveTelegramCustomCommands, Yt as splitCommandChain, Z as isInboundPathAllowed, Zt as matchAllowlist, _t as AVATAR_MAX_BYTES, a as isCliProvider, an as splitShellArgs, b as OLLAMA_NATIVE_BASE_URL, bn as VERSION, bt as isPathWithinRoot, c as normalizeProviderId, cn as resolveSafeBinProfiles, d as resolveModelRefFromString, dn as mapStreamingModeToSlackLegacyDraftStreamMode, en as extractShellWrapperInlineCommand, et as resolveIMessageRemoteAttachmentRoots, f as resolveReasoningDefault, fn as resolveDiscordPreviewStreamMode, i as findNormalizedProviderValue, in as unwrapKnownShellMultiplexerInvocation, it as parseDurationMs, j as resolveModelAuthMode, jn as withFileLock, jt as resolveEffectiveEnableState, k as resolveApiKeyForProvider, kn as resolveAuthStorePathForDisplay, kt as applyTestPluginDefaults, l as resolveConfiguredModelRef, ln as applyMergePatch, m as resolveThinkingDefault, mn as resolveSlackStreamingMode, n as buildConfiguredAllowlistKeys, nn as isShellWrapperExecutable, nt as parseNonNegativeByteSize, o as modelKey, on as SAFE_BIN_PROFILES, p as resolveSubagentSpawnModelSelection, pn as resolveSlackNativeStreaming, q as TELEGRAM_COMMAND_NAME_PATTERN, qt as buildEnforcedShellCommand, r as buildModelAliasIndex, rn as unwrapKnownDispatchWrapperInvocation, s as normalizeModelRef$2, sn as normalizeSafeBinProfileFixtures, t as buildAllowedModelSet, tn as isDispatchWrapperExecutable, tt as normalizeScpRemoteHost, u as resolveDefaultModelForAgent, un as isSafeExecutableValue, vn as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, vt as isAvatarDataUrl, w as buildStreamErrorAssistantMessage, wn as resolveOwnerDisplaySetting, wt as discoverOpenClawPlugins, x as createOllamaStreamFn, xn as getShellPathFromLoginShell, xt as isSupportedLocalAvatarExtension, yn as resolveAgentMaxConcurrent, yt as isAvatarHttpUrl, z as resolveApiKeyForProfile, zn as DEFAULT_CONTEXT_TOKENS, zt as setConfigValueAtPath } from "./model-selection-D5OFBCTr.js";
8
+ import { $ as resolveIMessageAttachmentRoots, $t as resolveCommandResolutionFromArgv, A as resolveEnvApiKey, An as resolveOpenClawAgentDir, At as normalizePluginsConfig, Bn as DEFAULT_MODEL, Bt as unsetConfigValueAtPath, C as buildAssistantMessageWithZeroUsage, Cn as isDangerousHostEnvVarName, Ct as loadPluginManifestRegistry, D as getCustomProviderApiKey, Dn as markAuthProfileGood, E as getApiKeyForModel, En as listProfilesForProvider, Et as safeStatSync, F as isProfileInCooldown, Fn as resolveAuthProfileDisplayLabel, Ft as setConfigOverride, G as writeConfigFile, Gt as validateSafeBinArgv, H as readConfigFileSnapshot, Ht as isTrustedSafeBinPath, I as markAuthProfileFailure, It as unsetConfigOverride, J as normalizeTelegramCommandName, Jt as isWindowsPlatform, K as validateConfigObjectWithPlugins, Kt as analyzeShellCommand, L as markAuthProfileUsed, Ln as normalizeSecretInput, Lt as getConfigValueAtPath, Mt as resolveMemorySlotDecision, N as resolveAuthProfileOrder, Nt as getConfigOverrides, O as requireApiKey, On as ensureAuthProfileStore, Ot as MANIFEST_KEY, P as getSoonestCooldownExpiry, Pt as resetConfigOverrides, Qt as resolveAllowlistCandidatePath, R as resolveProfilesUnavailableReason, Rn as splitTrailingAuthProfile, Rt as parseConfigPath, S as buildAssistantMessage, Sn as resolveShellEnvFallbackTimeoutMs, St as validateJsonSchemaValue, T as buildUsageWithNoCost, Tn as dedupeProfileIds, Tt as isPathInside$1, Ut as listWritableExplicitTrustedSafeBinDirs, V as loadConfig, Vn as DEFAULT_PROVIDER, Vt as getTrustedSafeBinDirs, W as resolveConfigSnapshotHash, Wt as normalizeTrustedSafeBinDirs, Xt as DEFAULT_SAFE_BINS, Y as resolveTelegramCustomCommands, Yt as splitCommandChain, Z as isInboundPathAllowed, Zt as matchAllowlist, _t as AVATAR_MAX_BYTES, a as isCliProvider, an as splitShellArgs, b as OLLAMA_NATIVE_BASE_URL, bn as VERSION, bt as isPathWithinRoot, c as normalizeProviderId, cn as resolveSafeBinProfiles, d as resolveModelRefFromString, dn as mapStreamingModeToSlackLegacyDraftStreamMode, en as extractShellWrapperInlineCommand, et as resolveIMessageRemoteAttachmentRoots, f as resolveReasoningDefault, fn as resolveDiscordPreviewStreamMode, i as findNormalizedProviderValue, in as unwrapKnownShellMultiplexerInvocation, it as parseDurationMs, j as resolveModelAuthMode, jn as withFileLock, jt as resolveEffectiveEnableState, k as resolveApiKeyForProvider, kn as resolveAuthStorePathForDisplay, kt as applyTestPluginDefaults, l as resolveConfiguredModelRef, ln as applyMergePatch, m as resolveThinkingDefault, mn as resolveSlackStreamingMode, n as buildConfiguredAllowlistKeys, nn as isShellWrapperExecutable, nt as parseNonNegativeByteSize, o as modelKey, on as SAFE_BIN_PROFILES, p as resolveSubagentSpawnModelSelection, pn as resolveSlackNativeStreaming, q as TELEGRAM_COMMAND_NAME_PATTERN, qt as buildEnforcedShellCommand, r as buildModelAliasIndex, rn as unwrapKnownDispatchWrapperInvocation, s as normalizeModelRef$2, sn as normalizeSafeBinProfileFixtures, t as buildAllowedModelSet, tn as isDispatchWrapperExecutable, tt as normalizeScpRemoteHost, u as resolveDefaultModelForAgent, un as isSafeExecutableValue, vn as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, vt as isAvatarDataUrl, w as buildStreamErrorAssistantMessage, wn as resolveOwnerDisplaySetting, wt as discoverOpenClawPlugins, x as createOllamaStreamFn, xn as getShellPathFromLoginShell, xt as isSupportedLocalAvatarExtension, yn as resolveAgentMaxConcurrent, yt as isAvatarHttpUrl, z as resolveApiKeyForProfile, zn as DEFAULT_CONTEXT_TOKENS, zt as setConfigValueAtPath } from "./model-selection-D5OFBCTr.js";
9
9
  import { a as resolveAgentIdentity, i as resolveAckReaction, o as resolveEffectiveMessagesConfig, r as resolveResponsePrefixTemplate, s as resolveHumanDelayConfig, t as createReplyPrefixOptions } from "./reply-prefix-BDSRMl8C.js";
10
10
  import { a as saveJsonFile, i as loadJsonFile } from "./github-copilot-token-CwIS0zs9.js";
11
11
  import { n as parseBooleanValue$1, r as formatCliCommand, t as isTruthyEnvValue } from "./env-zky96nK6.js";
@@ -61007,7 +61007,7 @@ function createOutboundSendDepsFromCliSource(deps) {
61007
61007
  function createDefaultDeps() {
61008
61008
  return {
61009
61009
  sendMessageWhatsApp: async (...args) => {
61010
- const { sendMessageWhatsApp } = await import("./web-BYeS4JNp.js");
61010
+ const { sendMessageWhatsApp } = await import("./web-BJQKWHqO.js");
61011
61011
  return await sendMessageWhatsApp(...args);
61012
61012
  },
61013
61013
  sendMessageTelegram: async (...args) => {
@@ -79265,7 +79265,7 @@ function loadWebLoginQr() {
79265
79265
  return webLoginQrPromise;
79266
79266
  }
79267
79267
  function loadWebChannel() {
79268
- webChannelPromise ??= import("./web-BYeS4JNp.js");
79268
+ webChannelPromise ??= import("./web-BJQKWHqO.js");
79269
79269
  return webChannelPromise;
79270
79270
  }
79271
79271
  function loadWhatsAppActions() {
@@ -80894,7 +80894,7 @@ function addPathToMatcher(matcher, rawPath) {
80894
80894
  }
80895
80895
  function matchesPathMatcher(matcher, sourcePath) {
80896
80896
  if (matcher.exact.has(sourcePath)) return true;
80897
- return matcher.dirs.some((dirPath) => isPathInside(dirPath, sourcePath));
80897
+ return matcher.dirs.some((dirPath) => isPathInside$1(dirPath, sourcePath));
80898
80898
  }
80899
80899
  function buildProvenanceIndex(params) {
80900
80900
  const loadPathMatcher = createPathMatcher();
@@ -82450,6 +82450,82 @@ function stripReadTruncationContentDetails(result) {
82450
82450
  }
82451
82451
  };
82452
82452
  }
82453
+ function extractRequestedReadPath(record) {
82454
+ const trimmed = (typeof record?.path === "string" ? record.path : typeof record?.file_path === "string" ? record.file_path : void 0)?.trim();
82455
+ return trimmed ? trimmed : void 0;
82456
+ }
82457
+ function normalizeReadPathCandidate(filePath) {
82458
+ const trimmed = filePath.trim();
82459
+ const withoutAt = trimmed.startsWith("@") ? trimmed.slice(1) : trimmed;
82460
+ if (/^file:\/\//i.test(withoutAt)) try {
82461
+ return fileURLToPath(withoutAt);
82462
+ } catch {
82463
+ return withoutAt;
82464
+ }
82465
+ return withoutAt;
82466
+ }
82467
+ function normalizeRelativeReadPath(filePath) {
82468
+ return filePath.replace(/\\/g, "/").replace(/^(?:\.\/)+/, "").replace(/^\/+/, "").replace(/\/+$/, "");
82469
+ }
82470
+ function getReadPathRelativeToWorkspace(filePath, workspaceRoot) {
82471
+ const normalized = normalizeReadPathCandidate(filePath);
82472
+ if (!path.isAbsolute(normalized)) return normalizeRelativeReadPath(normalized);
82473
+ if (!workspaceRoot) return;
82474
+ const root = path.resolve(workspaceRoot);
82475
+ const resolved = path.resolve(normalized);
82476
+ if (!isPathInside(root, resolved)) return;
82477
+ return normalizeRelativeReadPath(path.relative(root, resolved));
82478
+ }
82479
+ function isMemoryReadPath(filePath, workspaceRoot) {
82480
+ const relative = getReadPathRelativeToWorkspace(filePath, workspaceRoot);
82481
+ return relative === "memory" || Boolean(relative?.startsWith("memory/"));
82482
+ }
82483
+ function resolveReadPathWithinWorkspace(filePath, workspaceRoot) {
82484
+ if (!workspaceRoot) return;
82485
+ const normalized = normalizeReadPathCandidate(filePath);
82486
+ const resolved = path.isAbsolute(normalized) ? path.resolve(normalized) : path.resolve(workspaceRoot, normalized);
82487
+ return isPathInside(path.resolve(workspaceRoot), resolved) ? resolved : void 0;
82488
+ }
82489
+ function createMemoryDirectoryReadResult(filePath) {
82490
+ return {
82491
+ content: [{
82492
+ type: "text",
82493
+ text: `${filePath} is a directory, not a file. Read a specific file such as MEMORY.md or memory/YYYY-MM-DD.md instead.`
82494
+ }],
82495
+ details: {}
82496
+ };
82497
+ }
82498
+ function createMissingMemoryReadResult(filePath) {
82499
+ return {
82500
+ content: [{
82501
+ type: "text",
82502
+ text: `No memory file exists at ${filePath} yet. Continue normally, or create a file such as memory/YYYY-MM-DD.md when you want to save notes.`
82503
+ }],
82504
+ details: {}
82505
+ };
82506
+ }
82507
+ async function maybeCreateMemoryReadCompatibilityResult(params) {
82508
+ if (!isMemoryReadPath(params.filePath, params.workspaceRoot)) return null;
82509
+ const absolutePath = resolveReadPathWithinWorkspace(params.filePath, params.workspaceRoot);
82510
+ if (!absolutePath) return null;
82511
+ try {
82512
+ if ((await fs.stat(absolutePath)).isDirectory()) return createMemoryDirectoryReadResult(params.filePath);
82513
+ return null;
82514
+ } catch (error) {
82515
+ if (isNotFoundPathError(error)) return createMissingMemoryReadResult(params.filePath);
82516
+ throw error;
82517
+ }
82518
+ }
82519
+ function maybeRecoverMemoryReadError(params) {
82520
+ if (!isMemoryReadPath(params.filePath, params.workspaceRoot)) return null;
82521
+ if (params.error instanceof SafeOpenError) {
82522
+ if (params.error.code === "not-file") return createMemoryDirectoryReadResult(params.filePath);
82523
+ if (params.error.code === "not-found") return createMissingMemoryReadResult(params.filePath);
82524
+ }
82525
+ if (hasNodeErrorCode(params.error, "EISDIR")) return createMemoryDirectoryReadResult(params.filePath);
82526
+ if (isNotFoundPathError(params.error)) return createMissingMemoryReadResult(params.filePath);
82527
+ return null;
82528
+ }
82453
82529
  async function executeReadWithAdaptivePaging(params) {
82454
82530
  const userLimit = params.args.limit;
82455
82531
  if (typeof userLimit === "number" && Number.isFinite(userLimit) && userLimit > 0) return await params.base.execute(params.toolCallId, params.args, params.signal);
@@ -82725,7 +82801,8 @@ function wrapToolWorkspaceRootGuardWithOptions(tool, root, options) {
82725
82801
  function createSandboxedReadTool(params) {
82726
82802
  return createOpenClawReadTool(createReadTool(params.root, { operations: createSandboxReadOperations(params) }), {
82727
82803
  modelContextWindowTokens: params.modelContextWindowTokens,
82728
- imageSanitization: params.imageSanitization
82804
+ imageSanitization: params.imageSanitization,
82805
+ workspaceRoot: params.root
82729
82806
  });
82730
82807
  }
82731
82808
  function createSandboxedWriteTool(params) {
@@ -82791,14 +82868,30 @@ function createOpenClawReadTool(base, options) {
82791
82868
  const normalized = normalizeToolParams(params);
82792
82869
  const record = normalized ?? (params && typeof params === "object" ? params : void 0);
82793
82870
  assertRequiredParams(record, CLAUDE_PARAM_GROUPS.read, base.name);
82794
- const result = await executeReadWithAdaptivePaging({
82795
- base,
82796
- toolCallId,
82797
- args: normalized ?? params ?? {},
82798
- signal,
82799
- maxBytes: resolveAdaptiveReadMaxBytes(options)
82800
- });
82801
- const filePath = typeof record?.path === "string" ? String(record.path) : "<unknown>";
82871
+ const filePath = extractRequestedReadPath(record) ?? "<unknown>";
82872
+ const memoryCompatibilityResult = filePath !== "<unknown>" ? await maybeCreateMemoryReadCompatibilityResult({
82873
+ filePath,
82874
+ workspaceRoot: options?.workspaceRoot
82875
+ }) : null;
82876
+ if (memoryCompatibilityResult) return memoryCompatibilityResult;
82877
+ let result;
82878
+ try {
82879
+ result = await executeReadWithAdaptivePaging({
82880
+ base,
82881
+ toolCallId,
82882
+ args: normalized ?? params ?? {},
82883
+ signal,
82884
+ maxBytes: resolveAdaptiveReadMaxBytes(options)
82885
+ });
82886
+ } catch (error) {
82887
+ const recovered = filePath !== "<unknown>" ? maybeRecoverMemoryReadError({
82888
+ filePath,
82889
+ workspaceRoot: options?.workspaceRoot,
82890
+ error
82891
+ }) : null;
82892
+ if (recovered) return recovered;
82893
+ throw error;
82894
+ }
82802
82895
  return sanitizeToolResultImages(await normalizeReadImageResult(stripReadTruncationContentDetails(result), filePath), `read:${filePath}`, options?.imageSanitization);
82803
82896
  }
82804
82897
  };
@@ -83564,7 +83657,8 @@ function createOpenClawCodingTools(options) {
83564
83657
  }
83565
83658
  const wrapped = createOpenClawReadTool(createReadTool(workspaceRoot), {
83566
83659
  modelContextWindowTokens: options?.modelContextWindowTokens,
83567
- imageSanitization
83660
+ imageSanitization,
83661
+ workspaceRoot
83568
83662
  });
83569
83663
  return [workspaceOnly ? wrapToolWorkspaceRootGuard(wrapped, workspaceRoot) : wrapped];
83570
83664
  }