@ensocode/server 0.3.3 → 0.3.5

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 (378) hide show
  1. package/README.md +10 -0
  2. package/out/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +117 -0
  3. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic-messages-MGNURJ72.js +6 -0
  4. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{azure-openai-responses-FSC6BAW3.js → azure-openai-responses-4WDOP7MF.js} +1 -1
  5. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/bedrock-converse-stream.js +3 -3
  6. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-4KSTFUIK.js +19 -0
  7. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-4UNPP53I.js +55 -0
  8. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-CCYGJPSU.js +2 -0
  9. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-4EYXVSA5.js → chunk-FF6XOTWB.js} +9 -9
  10. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-FMPAMX2W.js +82 -0
  11. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-GFUN2N5K.js +2 -0
  12. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-C2WU32PX.js → chunk-H4W2F2IO.js} +1 -1
  13. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-IEBK4HQA.js +2 -0
  14. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-EOO47QGR.js → chunk-JLFZH7C6.js} +1 -1
  15. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-LCB5FO32.js +4 -0
  16. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-GN3QYODH.js → chunk-LQUBM7HF.js} +1 -1
  17. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-MABPTPMF.js +30 -0
  18. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-MPEFJ3RP.js +2 -0
  19. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-EBFHJFEE.js → chunk-PYBKJQVF.js} +1 -1
  20. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-VKJQ6CME.js +8 -0
  21. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-B46VJEHW.js → chunk-VUPOM3AH.js} +1 -1
  22. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-3TGLJEWK.js → chunk-WL4TUXY7.js} +1 -1
  23. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-V6KH5QG4.js → chunk-XM4MQFQV.js} +1 -1
  24. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-YZKQS34S.js → chunk-Y55SJART.js} +5 -1
  25. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-ZG74NES2.js +2 -0
  26. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-ZKNSXGL5.js +1243 -0
  27. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{cli-MCOUW5WS.js → cli-35W4A75E.js} +7 -7
  28. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{cloudflare-workers-ai-system-one-WLAFJSP6.js → cloudflare-workers-ai-system-one-WKRH5HZA.js} +1 -1
  29. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/codemode-worker.js +2 -0
  30. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{easter-egg-3d-WMBNSJ4M.js → easter-egg-3d-GEVPKQF6.js} +1 -1
  31. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{execute-4CEBORGZ.js → execute-L2EEDV3L.js} +5 -3
  32. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/github-copilot.js +1 -1
  33. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{google-generative-ai-INGKNW72.js → google-generative-ai-VSMFCHJU.js} +1 -1
  34. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{google-vertex-IBTX6MBF.js → google-vertex-35UTLZJN.js} +1 -1
  35. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{llama-cpp-classify-V5U3QKXI.js → llama-cpp-classify-Z3SS4FP4.js} +1 -1
  36. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{mistral-conversations-S4OWXIXQ.js → mistral-conversations-LWJTUFIM.js} +1 -1
  37. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex-responses-YYIXDJWF.js +10 -0
  38. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openai-completions-EJNYB6IX.js → openai-completions-X2I4TQ2L.js} +3 -3
  39. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openai-decisions-IXI34BYG.js → openai-decisions-GG3FBAIF.js} +1 -1
  40. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-responses-5CX3GG6R.js +4 -0
  41. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{openrouter-images-PISKSFMS.js → openrouter-images-WHNK2UQG.js} +1 -1
  42. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{pi-messages-NORUKF4E.js → pi-messages-5CXWY5I7.js} +1 -1
  43. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{runtime-FQB7RU7U.js → runtime-J5ZSBGTX.js} +1 -1
  44. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{typesafe-system-one-CHVC2UUI.js → typesafe-system-one-KA2SBSSD.js} +1 -1
  45. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/virtual-modules-7ZY53V4K.js +2 -0
  46. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli-runtime.js +1 -1
  47. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/index.js +1 -1
  48. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/rpc-entry.js +1 -1
  49. package/out/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js +1 -1
  50. package/out/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-command.js +26 -2
  51. package/out/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-login.d.ts +15 -0
  52. package/out/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-login.js +232 -0
  53. package/out/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-logout.d.ts +14 -0
  54. package/out/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-logout.js +57 -0
  55. package/out/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-terminal.d.ts +17 -0
  56. package/out/node_modules/@earendil-works/pi-coding-agent/dist/cli/auth-terminal.js +63 -0
  57. package/out/node_modules/@earendil-works/pi-coding-agent/dist/cli/config-selector.js +3 -1
  58. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.d.ts +5 -0
  59. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.js +7 -0
  60. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts +25 -6
  61. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +139 -50
  62. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +3 -2
  63. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/bash-executor.js +3 -1
  64. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/cache-warmer.d.ts +4 -37
  65. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/cache-warmer.js +11 -89
  66. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js +2 -1
  67. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/index.d.ts +1 -1
  68. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js +10 -5
  69. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts +1 -0
  70. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js +9 -1
  71. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts +28 -6
  72. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.d.ts +2 -2
  73. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/keybindings.js +1 -1
  74. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.d.ts +12 -37
  75. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/mcp-servers.js +42 -121
  76. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/model-config.d.ts +52 -0
  77. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +20 -19
  78. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.d.ts +5 -0
  79. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/model-runtime.js +11 -4
  80. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts +10 -1
  81. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +50 -5
  82. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/pi-ai-schemas.d.ts +4 -0
  83. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/preferred-providers.d.ts +17 -0
  84. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/preferred-providers.js +24 -0
  85. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.js +18 -2
  86. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-composer.js +3 -1
  87. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-matching.d.ts +6 -0
  88. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/provider-matching.js +8 -0
  89. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/radius-mcp.d.ts +13 -0
  90. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/radius-mcp.js +29 -0
  91. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/remote-catalog-provider.js +2 -0
  92. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/runtime-credentials.d.ts +8 -0
  93. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/runtime-credentials.js +15 -1
  94. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.d.ts +1 -1
  95. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-defaults.js +1 -1
  96. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +35 -5
  97. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit-diff.d.ts +23 -14
  98. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit-diff.js +182 -41
  99. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js +8 -7
  100. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js +82 -36
  101. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.d.ts +5 -3
  102. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js +87 -75
  103. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js +2 -1
  104. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/powershell.js +15 -2
  105. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts +8 -0
  106. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +141 -25
  107. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/truncate.d.ts +4 -14
  108. package/out/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/truncate.js +23 -29
  109. package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/execute.js +4 -4
  110. package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/codemode/tool.js +34 -12
  111. package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/client.d.ts +2 -0
  112. package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/client.js +23 -2
  113. package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/llama/ui.js +15 -3
  114. package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/cli.d.ts +2 -0
  115. package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/cli.js +49 -14
  116. package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/config.js +4 -7
  117. package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/index.js +4 -3
  118. package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.d.ts +11 -49
  119. package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/oauth.js +56 -319
  120. package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.d.ts +1 -1
  121. package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/resources.js +4 -3
  122. package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.d.ts +4 -3
  123. package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/runtime.js +7 -5
  124. package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.d.ts +2 -23
  125. package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/mcp/tools.js +6 -58
  126. package/out/node_modules/@earendil-works/pi-coding-agent/dist/extensions/tool-search/tool.js +18 -6
  127. package/out/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts +1 -1
  128. package/out/node_modules/@earendil-works/pi-coding-agent/dist/main.js +46 -0
  129. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts +5 -1
  130. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js +12 -4
  131. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts +5 -1
  132. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js +12 -4
  133. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-message.d.ts +5 -2
  134. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/custom-message.js +10 -3
  135. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/diff.js +11 -5
  136. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/extension-selector.js +9 -1
  137. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +1 -18
  138. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/mermaid.d.ts +2 -1
  139. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/mermaid.js +25 -20
  140. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/model-selector.js +14 -6
  141. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/oauth-selector.d.ts +10 -3
  142. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/oauth-selector.js +32 -5
  143. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/provider-brand.d.ts +14 -0
  144. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/provider-brand.js +66 -0
  145. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/radius-login-selector.d.ts +1 -2
  146. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/radius-login-selector.js +6 -37
  147. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts +5 -1
  148. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js +12 -4
  149. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tree-selector.d.ts +1 -0
  150. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/tree-selector.js +19 -10
  151. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +11 -1
  152. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +110 -63
  153. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js +4 -0
  154. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/print-mode.js +19 -10
  155. package/out/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +53 -23
  156. package/out/node_modules/@earendil-works/pi-coding-agent/dist/package-manager-cli.js +39 -8
  157. package/out/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.d.ts +2 -2
  158. package/out/node_modules/@earendil-works/pi-coding-agent/dist/utils/changelog.js +12 -6
  159. package/out/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js +3 -1
  160. package/out/node_modules/@earendil-works/pi-coding-agent/dist/utils/terminal-question.d.ts +8 -0
  161. package/out/node_modules/@earendil-works/pi-coding-agent/dist/utils/terminal-question.js +24 -0
  162. package/out/node_modules/@earendil-works/pi-coding-agent/dist/utils/web-url.d.ts +12 -0
  163. package/out/node_modules/@earendil-works/pi-coding-agent/dist/utils/web-url.js +20 -0
  164. package/out/node_modules/@earendil-works/pi-coding-agent/docs/cli.md +14 -1
  165. package/out/node_modules/@earendil-works/pi-coding-agent/docs/extensions.md +27 -7
  166. package/out/node_modules/@earendil-works/pi-coding-agent/docs/keybindings.md +1 -1
  167. package/out/node_modules/@earendil-works/pi-coding-agent/docs/llama-cpp.md +4 -7
  168. package/out/node_modules/@earendil-works/pi-coding-agent/docs/models-configuration.md +6 -1
  169. package/out/node_modules/@earendil-works/pi-coding-agent/docs/models.md +2 -1
  170. package/out/node_modules/@earendil-works/pi-coding-agent/docs/prompt-templates.md +1 -1
  171. package/out/node_modules/@earendil-works/pi-coding-agent/docs/providers.md +1 -1
  172. package/out/node_modules/@earendil-works/pi-coding-agent/docs/rpc.md +4 -2
  173. package/out/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +1 -1
  174. package/out/node_modules/@earendil-works/pi-coding-agent/docs/tui.md +1 -1
  175. package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  176. package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
  177. package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  178. package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package-lock.json +2 -2
  179. package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/gondolin/package.json +1 -1
  180. package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/plan-mode/index.ts +23 -13
  181. package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/plan-mode/utils.ts +42 -16
  182. package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/subagent/README.md +14 -11
  183. package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/subagent/index.ts +392 -171
  184. package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package-lock.json +2 -2
  185. package/out/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
  186. package/out/node_modules/@earendil-works/pi-coding-agent/examples/tsconfig.json +63 -35
  187. package/out/node_modules/@earendil-works/pi-coding-agent/package.json +7 -7
  188. package/out/node_modules/@earendil-works/pi-coding-agent/schemas/models.schema.json +29 -0
  189. package/out/node_modules/@earendil-works/pi-coding-agent/schemas/settings.schema.json +1 -1
  190. package/out/phone/assets/{abnfDiagram-VCTEODGH-CLgfII9z.js → abnfDiagram-VCTEODGH-k76opPl1.js} +1 -1
  191. package/out/phone/assets/architecture-7GRP2DOG-DFA8x3QF.js +1 -0
  192. package/out/phone/assets/{architectureDiagram-5GKGNRK7-I2RDn32D.js → architectureDiagram-5GKGNRK7-yxQH9IuZ.js} +1 -1
  193. package/out/phone/assets/{blockDiagram-I7D4REHJ-D5xNQZkS.js → blockDiagram-I7D4REHJ-DoHteZpO.js} +1 -1
  194. package/out/phone/assets/{c4Diagram-7LVT6UL2-CRKpzdlA.js → c4Diagram-7LVT6UL2-DQVO6L4q.js} +1 -1
  195. package/out/phone/assets/channel-BBjWfdZr.js +1 -0
  196. package/out/phone/assets/{chunk-4HAMMTFA-CcezrqKz.js → chunk-4HAMMTFA-N9Rw4SGW.js} +1 -1
  197. package/out/phone/assets/{chunk-75Z2AOVW-DDCXp4y1.js → chunk-75Z2AOVW-DKJ8pOxp.js} +1 -1
  198. package/out/phone/assets/{chunk-DU6HZSFF-CjWveEkB.js → chunk-DU6HZSFF-BqGW8Nbd.js} +1 -1
  199. package/out/phone/assets/{chunk-F27PBJKO-Bgl_xI02.js → chunk-F27PBJKO-PkFmkghF.js} +1 -1
  200. package/out/phone/assets/{chunk-GMAD6QVW-EmL8nOme.js → chunk-GMAD6QVW-C9VeD3Jk.js} +1 -1
  201. package/out/phone/assets/{chunk-GVQU2GXP-Dox_nphF.js → chunk-GVQU2GXP-COhntOeE.js} +1 -1
  202. package/out/phone/assets/{chunk-IMKFNOWR-BapGpI4S.js → chunk-IMKFNOWR-B87ghLVD.js} +1 -1
  203. package/out/phone/assets/{chunk-L3NEJ4N5-Cq_UZI8A.js → chunk-L3NEJ4N5-C3N2izjg.js} +1 -1
  204. package/out/phone/assets/{chunk-OSK3NFVY-2VVlErAd.js → chunk-OSK3NFVY-DaAlvVhz.js} +1 -1
  205. package/out/phone/assets/{chunk-P2QGCYS3-Cci-G-p1.js → chunk-P2QGCYS3-BQpKr8IZ.js} +1 -1
  206. package/out/phone/assets/{chunk-POPQ4Y6H-CJ47EOfE.js → chunk-POPQ4Y6H-B2TZMY6U.js} +1 -1
  207. package/out/phone/assets/{chunk-PWAF6VOD-D9dLdFqC.js → chunk-PWAF6VOD-CgRhpUJy.js} +1 -1
  208. package/out/phone/assets/{chunk-SHT3W25Y-BlGSiWZn.js → chunk-SHT3W25Y-BySMFA99.js} +1 -1
  209. package/out/phone/assets/{chunk-SVP7TREG-C0zdsa_A.js → chunk-SVP7TREG-EDGanDUX.js} +1 -1
  210. package/out/phone/assets/{chunk-TICWLB2K-DAQW8nQU.js → chunk-TICWLB2K-BtCZ8R2k.js} +1 -1
  211. package/out/phone/assets/classDiagram-ZZMXUADV-CXXjdIIU.js +1 -0
  212. package/out/phone/assets/classDiagram-v2-VYDZK3BY-CXXjdIIU.js +1 -0
  213. package/out/phone/assets/{cynefin-OW5HDTMX-_zsx5mdV.js → cynefin-OW5HDTMX-CdZmp44V.js} +1 -1
  214. package/out/phone/assets/{cynefinDiagram-5FMLGOSQ-Cww-w0ex.js → cynefinDiagram-5FMLGOSQ-BCz9KwUb.js} +1 -1
  215. package/out/phone/assets/{dagre-GXQ25YYZ-C0i7DPqX.js → dagre-GXQ25YYZ-CgFeNgh6.js} +1 -1
  216. package/out/phone/assets/desk-C_b7mE6l.js +2 -0
  217. package/out/phone/assets/{diagram-S7CK7UJ4-Bx-G5hYz.js → diagram-S7CK7UJ4-CwvaZIBf.js} +1 -1
  218. package/out/phone/assets/{diagram-UQ7AKVKN-DaTblkjV.js → diagram-UQ7AKVKN-DqnD4XoZ.js} +1 -1
  219. package/out/phone/assets/{diagram-VSXAHHWV-gmN2e1b4.js → diagram-VSXAHHWV-Kqc9GudQ.js} +1 -1
  220. package/out/phone/assets/{diagram-VX7I27RA-WYtRtOo8.js → diagram-VX7I27RA-B_0DLDQ0.js} +1 -1
  221. package/out/phone/assets/{diagram-Z3DM3KII-Cr6uUB5B.js → diagram-Z3DM3KII-CppKBEPW.js} +1 -1
  222. package/out/phone/assets/{ebnfDiagram-PWID7BFC-BCicfvpA.js → ebnfDiagram-PWID7BFC-DeYPNCu9.js} +1 -1
  223. package/out/phone/assets/{erDiagram-RLTQ6QDP-B3QlJvfQ.js → erDiagram-RLTQ6QDP-MsfxDUmk.js} +1 -1
  224. package/out/phone/assets/eventmodeling-NTZA5JFV-D4a6gbOs.js +1 -0
  225. package/out/phone/assets/flowDiagram-HODETNUW-BBTtB5oX.js +1 -0
  226. package/out/phone/assets/{ganttDiagram-EL5Y4UJY-LYy2mfCh.js → ganttDiagram-EL5Y4UJY-DaScS1os.js} +1 -1
  227. package/out/phone/assets/{gitGraph-4MIJSDKK-dT22Z2jG.js → gitGraph-4MIJSDKK-C-FzqpZm.js} +1 -1
  228. package/out/phone/assets/{gitGraphDiagram-WWUBYQGX-DHNdY57l.js → gitGraphDiagram-WWUBYQGX-4Yv-hAwf.js} +1 -1
  229. package/out/phone/assets/{info-A6RAGUB7-nIu8NSOs.js → info-A6RAGUB7-CGLEP4t7.js} +1 -1
  230. package/out/phone/assets/{infoDiagram-27XIBGKW-DGkWZIMT.js → infoDiagram-27XIBGKW-DapEgYQa.js} +1 -1
  231. package/out/phone/assets/{ishikawaDiagram-5VMMS53U-C8EPXru-.js → ishikawaDiagram-5VMMS53U-D1B2lZSG.js} +1 -1
  232. package/out/phone/assets/{journeyDiagram-3NMN7TZE-Dyd9L3l3.js → journeyDiagram-3NMN7TZE-BSAtMVJw.js} +1 -1
  233. package/out/phone/assets/{kanban-definition-UXKFOSKX-DehTYcsL.js → kanban-definition-UXKFOSKX-CfZ4oI7A.js} +1 -1
  234. package/out/phone/assets/{line-Db4SulF4.js → line-DAXmUM4p.js} +1 -1
  235. package/out/phone/assets/main-B0yD1pMI.js +1643 -0
  236. package/out/phone/assets/main-DNRbLxEx.css +1 -0
  237. package/out/phone/assets/{mermaid-parser.core-D7h_8WV8.js → mermaid-parser.core-IObm7oM0.js} +3 -3
  238. package/out/phone/assets/{mermaid.core-Dw_E5kj4.js → mermaid.core-C1wA-mhD.js} +4 -4
  239. package/out/phone/assets/{mindmap-definition-YA3MSWOX-_5Mxqxsy.js → mindmap-definition-YA3MSWOX-3ph0EaB9.js} +1 -1
  240. package/out/phone/assets/{packet-AYTQ26CC-_cgeMDdN.js → packet-AYTQ26CC-BbDAe9Au.js} +1 -1
  241. package/out/phone/assets/{pegDiagram-XKGWAZYB-BhBwaNEr.js → pegDiagram-XKGWAZYB-EsuDcX_3.js} +1 -1
  242. package/out/phone/assets/{pie-WAS4IAKB-BepY80_0.js → pie-WAS4IAKB-BQfIj1fu.js} +1 -1
  243. package/out/phone/assets/{pieDiagram-E7YTZNPT-CQQgqmI8.js → pieDiagram-E7YTZNPT-Cw19z5Ip.js} +1 -1
  244. package/out/phone/assets/{quadrantDiagram-AXDQQJYC-DEEatC1J.js → quadrantDiagram-AXDQQJYC-Bqwz_sa8.js} +1 -1
  245. package/out/phone/assets/{radar-RG4KPBEZ-BqsiI_qQ.js → radar-RG4KPBEZ-Dmp-89iD.js} +1 -1
  246. package/out/phone/assets/{railroad-74A4TZTK-C_2pEUjD.js → railroad-74A4TZTK-dq2H8w8Y.js} +1 -1
  247. package/out/phone/assets/railroad-abnf-HS5TGJTU-DddVaVQM.js +1 -0
  248. package/out/phone/assets/railroad-ebnf-LZEXJU2U-BjvyqMjh.js +1 -0
  249. package/out/phone/assets/railroad-peg-WCYAUIDC-lBl4CV1_.js +1 -0
  250. package/out/phone/assets/{railroadDiagram-O6MQD6OU-B7786u7W.js → railroadDiagram-O6MQD6OU-D2Sbc7Wn.js} +1 -1
  251. package/out/phone/assets/{requirementDiagram-BXWQKSXE-Ci3b5uwm.js → requirementDiagram-BXWQKSXE-CLNUqxbl.js} +1 -1
  252. package/out/phone/assets/{sankeyDiagram-P5KCCOFB-PwT2gJjH.js → sankeyDiagram-P5KCCOFB-Dme5iwcw.js} +1 -1
  253. package/out/phone/assets/{sequenceDiagram-WJ2MYXX4-H6sgB5RI.js → sequenceDiagram-WJ2MYXX4-C5dYSwPE.js} +1 -1
  254. package/out/phone/assets/{stateDiagram-D77RDMKH-BxyRe7OB.js → stateDiagram-D77RDMKH-BuxkPvJ6.js} +1 -1
  255. package/out/phone/assets/stateDiagram-v2-MP3YSRHH-Exd8xDBD.js +1 -0
  256. package/out/phone/assets/storage-p-WxHA1h.js +1 -0
  257. package/out/phone/assets/{swimlanes-42K2YHIH-DWT3f1Hk.js → swimlanes-42K2YHIH-DHyXnytv.js} +1 -1
  258. package/out/phone/assets/swimlanesDiagram-VR7AAH4N-B62_42fO.js +8 -0
  259. package/out/phone/assets/{timeline-definition-24CTP7MA-D67esSVY.js → timeline-definition-24CTP7MA-Bm8Z0u2Z.js} +1 -1
  260. package/out/phone/assets/{treeView-Q6P3EWNA-BTIfu3Qr.js → treeView-Q6P3EWNA-DFUxvDDO.js} +1 -1
  261. package/out/phone/assets/{treemap-WGGIJYW6-DkPf6LQc.js → treemap-WGGIJYW6-CMC-hwzt.js} +1 -1
  262. package/out/phone/assets/{vennDiagram-4TSXK5OY-DRMRxJ4f.js → vennDiagram-4TSXK5OY-CNL4gZsd.js} +1 -1
  263. package/out/phone/assets/{wardley-WFR3VGLG-hOvC_8-W.js → wardley-WFR3VGLG-CHQoq9KJ.js} +1 -1
  264. package/out/phone/assets/{wardleyDiagram-VM6X3IG4-a5aYRgrw.js → wardleyDiagram-VM6X3IG4-DAuBfK1O.js} +1 -1
  265. package/out/phone/assets/{xychartDiagram-S5SC5T6Z-DXjoRFDL.js → xychartDiagram-S5SC5T6Z-B2T9ECKd.js} +1 -1
  266. package/out/phone/desk.html +2 -2
  267. package/out/phone/index.html +3 -3
  268. package/out/renderer/assets/{abnfDiagram-VCTEODGH-DhskujJf.js → abnfDiagram-VCTEODGH-gdhrQbX6.js} +1 -1
  269. package/out/renderer/assets/{arc-BcW67t47.js → arc-D6-Q4l2d.js} +1 -1
  270. package/out/renderer/assets/{architectureDiagram-5GKGNRK7-D-x057Ia.js → architectureDiagram-5GKGNRK7-C4y0SbLT.js} +1 -1
  271. package/out/renderer/assets/{blockDiagram-I7D4REHJ-DR3sZkhW.js → blockDiagram-I7D4REHJ-DrsoSFRK.js} +1 -1
  272. package/out/renderer/assets/{c4Diagram-7LVT6UL2-CQ4lScWs.js → c4Diagram-7LVT6UL2-1DD8BlM8.js} +1 -1
  273. package/out/renderer/assets/channel-Sck-tAAK.js +1 -0
  274. package/out/renderer/assets/{chunk-2Q5K7J3B-CtT0yqF3.js → chunk-2Q5K7J3B-DRyc0B7g.js} +1 -1
  275. package/out/renderer/assets/{chunk-5VM5RSS4-DlCfddrY.js → chunk-5VM5RSS4-BJe8SghE.js} +1 -1
  276. package/out/renderer/assets/{chunk-F27PBJKO-BAJ5dGzo.js → chunk-F27PBJKO-BIipq4SK.js} +1 -1
  277. package/out/renderer/assets/{chunk-IMKFNOWR-Dlah_YbP.js → chunk-IMKFNOWR-D5Ak3Xd9.js} +1 -1
  278. package/out/renderer/assets/{chunk-JWPE2WC7-BiXd3nUZ.js → chunk-JWPE2WC7-BcaWCpW-.js} +1 -1
  279. package/out/renderer/assets/{chunk-POPQ4Y6H-Ch86i4EJ.js → chunk-POPQ4Y6H-C1TwLrrN.js} +1 -1
  280. package/out/renderer/assets/{chunk-SVP7TREG-z3inDV-H.js → chunk-SVP7TREG-DDOXG_t3.js} +1 -1
  281. package/out/renderer/assets/{chunk-TICWLB2K-B34A2AKD.js → chunk-TICWLB2K-BqT15hZi.js} +1 -1
  282. package/out/renderer/assets/{chunk-XXDRQBXY-Do_L0wRR.js → chunk-XXDRQBXY-D01ts6SC.js} +1 -1
  283. package/out/renderer/assets/classDiagram-ZZMXUADV-DnB4QNNe.js +1 -0
  284. package/out/renderer/assets/classDiagram-v2-VYDZK3BY-DnB4QNNe.js +1 -0
  285. package/out/renderer/assets/{cose-bilkent-JH36ORCC-BQraKmgl.js → cose-bilkent-JH36ORCC-C7NVrT2_.js} +1 -1
  286. package/out/renderer/assets/{cynefin-OW5HDTMX-BwixoR4r.js → cynefin-OW5HDTMX-2LxdFmSk.js} +1 -1
  287. package/out/renderer/assets/{cynefinDiagram-5FMLGOSQ-BLTBma3J.js → cynefinDiagram-5FMLGOSQ-_AN_Mulc.js} +1 -1
  288. package/out/renderer/assets/{cytoscape-fcose-BRpJ5tyq.js → cytoscape-fcose-COZkZZmX.js} +1 -1
  289. package/out/renderer/assets/{dagre-GXQ25YYZ-aWsjA_wn.js → dagre-GXQ25YYZ-BUTwlM6j.js} +1 -1
  290. package/out/renderer/assets/{diagram-S7CK7UJ4-Cur2zK4q.js → diagram-S7CK7UJ4-CseZZ-y2.js} +1 -1
  291. package/out/renderer/assets/{diagram-UQ7AKVKN-DlrY8YcD.js → diagram-UQ7AKVKN-Cb7llS-8.js} +1 -1
  292. package/out/renderer/assets/{diagram-VSXAHHWV-BBdjreqR.js → diagram-VSXAHHWV-CtuGqQvp.js} +1 -1
  293. package/out/renderer/assets/{diagram-VX7I27RA-XiWMdc8S.js → diagram-VX7I27RA-BA8eov-1.js} +1 -1
  294. package/out/renderer/assets/{diagram-Z3DM3KII-CBB5leat.js → diagram-Z3DM3KII-VZOjj6Hg.js} +1 -1
  295. package/out/renderer/assets/{ebnfDiagram-PWID7BFC-nl8RPo8j.js → ebnfDiagram-PWID7BFC-YBIrle6d.js} +1 -1
  296. package/out/renderer/assets/{erDiagram-RLTQ6QDP-C_oaG80x.js → erDiagram-RLTQ6QDP-BiKyPEqW.js} +1 -1
  297. package/out/renderer/assets/{flowDiagram-HODETNUW-nDoVZFS7.js → flowDiagram-HODETNUW-7wmZyLHw.js} +1 -1
  298. package/out/renderer/assets/{ganttDiagram-EL5Y4UJY-DOrcuM3Q.js → ganttDiagram-EL5Y4UJY-D4j4GJaT.js} +1 -1
  299. package/out/renderer/assets/{gitGraphDiagram-WWUBYQGX-D_DB3jro.js → gitGraphDiagram-WWUBYQGX-BqveM1NI.js} +1 -1
  300. package/out/renderer/assets/globals-C9M_MZZV.js +2539 -0
  301. package/out/renderer/assets/globals-l3kDGoYH.css +1 -0
  302. package/out/renderer/assets/index-BzSTiwH2.js +117 -0
  303. package/out/renderer/assets/{infoDiagram-27XIBGKW-BbBrANxo.js → infoDiagram-27XIBGKW-DLPLnIFP.js} +1 -1
  304. package/out/renderer/assets/{ishikawaDiagram-5VMMS53U-7UlfWlWV.js → ishikawaDiagram-5VMMS53U-48drIAMR.js} +1 -1
  305. package/out/renderer/assets/{journeyDiagram-3NMN7TZE-CJP9bosH.js → journeyDiagram-3NMN7TZE-vjigqUq_.js} +1 -1
  306. package/out/renderer/assets/{kanban-definition-UXKFOSKX-D772kW7T.js → kanban-definition-UXKFOSKX-CpsYVONZ.js} +1 -1
  307. package/out/renderer/assets/{layout-BzVfJEvx.js → layout-DqfoORoO.js} +1 -1
  308. package/out/renderer/assets/{linear-DBjhr05m.js → linear-CJzBBHcp.js} +1 -1
  309. package/out/renderer/assets/{mermaid.core-CJpNSowm.js → mermaid.core-DdrGP-Hn.js} +5 -5
  310. package/out/renderer/assets/{mindmap-definition-YA3MSWOX-C2oqlH5E.js → mindmap-definition-YA3MSWOX-D68tLNxp.js} +1 -1
  311. package/out/renderer/assets/{pegDiagram-XKGWAZYB-CcZ8Hae-.js → pegDiagram-XKGWAZYB-DkgLTcrv.js} +1 -1
  312. package/out/renderer/assets/{pieDiagram-E7YTZNPT-DTw-_k2D.js → pieDiagram-E7YTZNPT-bz5NuX1w.js} +1 -1
  313. package/out/renderer/assets/{quadrantDiagram-AXDQQJYC-D5eX0DO7.js → quadrantDiagram-AXDQQJYC-o_VKLyJA.js} +1 -1
  314. package/out/renderer/assets/{railroadDiagram-O6MQD6OU-DzpBB_Re.js → railroadDiagram-O6MQD6OU-Dkf03e07.js} +1 -1
  315. package/out/renderer/assets/{requirementDiagram-BXWQKSXE-UbOUXLgl.js → requirementDiagram-BXWQKSXE-CBUz_3YU.js} +1 -1
  316. package/out/renderer/assets/{sankeyDiagram-P5KCCOFB-jRbXLLsa.js → sankeyDiagram-P5KCCOFB-B0pjUr9g.js} +1 -1
  317. package/out/renderer/assets/{sequenceDiagram-WJ2MYXX4-s0WBQQPf.js → sequenceDiagram-WJ2MYXX4-ClugIL0e.js} +1 -1
  318. package/out/renderer/assets/settings-DvhrDn2q.js +34 -0
  319. package/out/renderer/assets/{sizeCapture-INFHLROL-DvUs5rDx.js → sizeCapture-INFHLROL-D6y0rctc.js} +1 -1
  320. package/out/renderer/assets/{stateDiagram-D77RDMKH-C1_V497y.js → stateDiagram-D77RDMKH-DiftQepS.js} +1 -1
  321. package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-DxB2-9tl.js +1 -0
  322. package/out/renderer/assets/{swimlanes-42K2YHIH-BulPeZ6y.js → swimlanes-42K2YHIH-DhuTjCNj.js} +1 -1
  323. package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-CYDUqExO.js +8 -0
  324. package/out/renderer/assets/{timeline-definition-24CTP7MA-gQ5OygZn.js → timeline-definition-24CTP7MA-CrXqgptd.js} +1 -1
  325. package/out/renderer/assets/{vennDiagram-4TSXK5OY-A8QyA5Ix.js → vennDiagram-4TSXK5OY-CDm8SO8U.js} +1 -1
  326. package/out/renderer/assets/{wardleyDiagram-VM6X3IG4-CfP6E41T.js → wardleyDiagram-VM6X3IG4-CxyunHwQ.js} +1 -1
  327. package/out/renderer/assets/{xychartDiagram-S5SC5T6Z-DTG5UHh7.js → xychartDiagram-S5SC5T6Z-CvC5YMSy.js} +1 -1
  328. package/out/renderer/index.html +3 -3
  329. package/out/renderer/plugin-view.html +39 -0
  330. package/out/renderer/settings.html +4 -4
  331. package/out/renderer/web-preload.js +1 -1
  332. package/out/server/agent.js +2022 -860
  333. package/out/server/chunks/{agent-BhQn6jGA.js → agent-_G_O-Cpa.js} +359 -227
  334. package/out/server/chunks/{gpuBackendInstall-CdExgjGi.js → gpuBackendInstall-Cb6TFh_8.js} +11 -9
  335. package/out/server/chunks/{loadProvider-BnkyjMSW.js → loadProvider-Be9Lu1Oi.js} +7 -20
  336. package/out/server/chunks/{manifest-2odvnxjZ.js → manifest-CB63GQ-i.js} +129 -6
  337. package/out/server/chunks/{workflowPresets-DqSsjOj6.js → workflowPresets-Djlp5LPV.js} +4004 -2054
  338. package/out/server/index.js +8251 -6660
  339. package/out/server/plugin-host.js +36 -26
  340. package/package.json +10 -10
  341. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/anthropic-messages-BWGCKOF4.js +0 -6
  342. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-44DLKSKE.js +0 -1234
  343. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-62VOPMLK.js +0 -65
  344. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-7O7QKK6A.js +0 -2
  345. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-CHWNPHIS.js +0 -82
  346. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-NL4X6LBY.js +0 -4
  347. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-NZY7EIPA.js +0 -4
  348. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-R2EGYMOO.js +0 -7
  349. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-UKVNB6C4.js +0 -2
  350. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-USJZMAIR.js +0 -2
  351. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/chunk-VOLAXWGI.js +0 -2
  352. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-codex-responses-QAWLOQSN.js +0 -10
  353. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/openai-responses-MD3562FB.js +0 -4
  354. package/out/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/virtual-modules-O76XM3OB.js +0 -2
  355. package/out/phone/assets/architecture-7GRP2DOG-CQOPTv6S.js +0 -1
  356. package/out/phone/assets/channel-DdXebl9x.js +0 -1
  357. package/out/phone/assets/classDiagram-ZZMXUADV-BCctWEp1.js +0 -1
  358. package/out/phone/assets/classDiagram-v2-VYDZK3BY-BCctWEp1.js +0 -1
  359. package/out/phone/assets/desk-mfuEW2n4.js +0 -2
  360. package/out/phone/assets/eventmodeling-NTZA5JFV-BtfapP6M.js +0 -1
  361. package/out/phone/assets/flowDiagram-HODETNUW-BsyiyBtD.js +0 -1
  362. package/out/phone/assets/main-Dv9ve8mT.css +0 -1
  363. package/out/phone/assets/main-uMMbioCA.js +0 -1638
  364. package/out/phone/assets/railroad-abnf-HS5TGJTU-TmODpceI.js +0 -1
  365. package/out/phone/assets/railroad-ebnf-LZEXJU2U-BTCjNR9u.js +0 -1
  366. package/out/phone/assets/railroad-peg-WCYAUIDC-DjhKNo8j.js +0 -1
  367. package/out/phone/assets/stateDiagram-v2-MP3YSRHH-Cncmf_cL.js +0 -1
  368. package/out/phone/assets/storage-D9RW_4__.js +0 -1
  369. package/out/phone/assets/swimlanesDiagram-VR7AAH4N-DAahG4fH.js +0 -8
  370. package/out/renderer/assets/channel-CudRig7z.js +0 -1
  371. package/out/renderer/assets/classDiagram-ZZMXUADV-DL20WkD0.js +0 -1
  372. package/out/renderer/assets/classDiagram-v2-VYDZK3BY-DL20WkD0.js +0 -1
  373. package/out/renderer/assets/globals-Bkw7iiQG.css +0 -1
  374. package/out/renderer/assets/globals-D1ocHHQV.js +0 -2533
  375. package/out/renderer/assets/index-Cm5iq85v.js +0 -117
  376. package/out/renderer/assets/settings-DxYo7s4h.js +0 -34
  377. package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-C9dfLXR8.js +0 -1
  378. package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-LXwy6qGO.js +0 -8
@@ -6,20 +6,64 @@ import { constants } from "fs";
6
6
  import { access, readFile } from "fs/promises";
7
7
  import { splitBom } from "../../utils/text.js";
8
8
  import { resolveToCwd } from "./path-utils.js";
9
- export function detectLineEnding(content) {
10
- const crlfIdx = content.indexOf("\r\n");
11
- const lfIdx = content.indexOf("\n");
12
- if (lfIdx === -1)
13
- return "\n";
14
- if (crlfIdx === -1)
15
- return "\n";
16
- return crlfIdx < lfIdx ? "\r\n" : "\n";
17
- }
18
9
  export function normalizeToLF(text) {
19
10
  return text.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
20
11
  }
21
- export function restoreLineEndings(text, ending) {
22
- return ending === "\r\n" ? text.replace(/\n/g, "\r\n") : text;
12
+ /**
13
+ * Apply replacements matched in `normalizeToLF(originalContent)` to `originalContent` itself.
14
+ * Text outside the replaced ranges keeps its bytes, including its line endings. Line breaks in
15
+ * the new text get the line ending of the line where the replaced range starts. The result,
16
+ * normalized to LF, equals the replacements applied to the normalized content.
17
+ */
18
+ export function applyReplacementsToOriginal(originalContent, replacements) {
19
+ // Only CRLF changes length when normalizing: the LF of the n-th CRLF (at original offset p) is at
20
+ // p - n in the normalized text. Adding the number of CRLFs before a normalized offset gives the
21
+ // original offset, and a range that covers that LF covers the whole CRLF.
22
+ let crlfBefore = 0;
23
+ let nextCrlf = originalContent.indexOf("\r\n");
24
+ const toOriginal = (offset) => {
25
+ while (nextCrlf !== -1 && nextCrlf - crlfBefore < offset) {
26
+ crlfBefore++;
27
+ nextCrlf = originalContent.indexOf("\r\n", nextCrlf + 2);
28
+ }
29
+ return offset + crlfBefore;
30
+ };
31
+ const parts = [];
32
+ let endsWithCr = false;
33
+ const push = (part) => {
34
+ if (part.length === 0)
35
+ return;
36
+ // A CR before a seam and an LF after it would merge into one CRLF line break, for example a kept
37
+ // lone CR followed by inserted text that starts with LF, or both sides of a deleted range. Adding
38
+ // an LF turns the CR into a CRLF of its own, so the written file has the line breaks the diff shows.
39
+ if (endsWithCr && part[0] === "\n")
40
+ parts.push("\n");
41
+ parts.push(part);
42
+ endsWithCr = part[part.length - 1] === "\r";
43
+ };
44
+ let position = 0;
45
+ for (const replacement of replacements) {
46
+ const start = toOriginal(replacement.matchIndex);
47
+ push(originalContent.slice(position, start));
48
+ const ending = getLineEndingAt(originalContent, start);
49
+ push(ending === "\n" ? replacement.newText : replacement.newText.replaceAll("\n", ending));
50
+ position = toOriginal(replacement.matchIndex + replacement.matchLength);
51
+ }
52
+ push(originalContent.slice(position));
53
+ return parts.join("");
54
+ }
55
+ /**
56
+ * Line ending of the line containing `offset`: its own LF or CRLF, or that of the line before
57
+ * for an unterminated last line. A lone CR only counts in files without any LF (classic Mac
58
+ * line endings); elsewhere it is more likely a control character inside a line.
59
+ */
60
+ function getLineEndingAt(content, offset) {
61
+ let lineFeed = content.indexOf("\n", offset);
62
+ if (lineFeed === -1)
63
+ lineFeed = content.lastIndexOf("\n", offset);
64
+ if (lineFeed === -1)
65
+ return content.includes("\r") ? "\r" : "\n";
66
+ return content[lineFeed - 1] === "\r" ? "\r\n" : "\n";
23
67
  }
24
68
  /**
25
69
  * Normalize text for fuzzy matching. Applies progressive transformations:
@@ -93,17 +137,17 @@ function applyReplacements(content, replacements, offset = 0) {
93
137
  return result;
94
138
  }
95
139
  /**
96
- * Apply replacements matched against `baseContent` to `originalContent` while
97
- * preserving unchanged line blocks from the original.
140
+ * Turn replacements matched against `baseContent` into replacements of
141
+ * `originalContent` that keep unchanged line blocks from the original.
98
142
  *
99
143
  * This is useful when `baseContent` is a normalized view of the original. Each
100
- * replacement is widened to the lines it actually touches, those touched lines
101
- * are rewritten from the normalized base, and all other lines are copied back
102
- * from `originalContent`. The actual replacement ranges drive preservation so
144
+ * replacement is widened to the lines it actually touches, and those touched
145
+ * lines are rewritten from the normalized base; all other lines keep their
146
+ * original text. The actual replacement ranges drive preservation so
103
147
  * duplicate normalized lines cannot be aligned to the wrong occurrence.
104
148
  */
105
- export function applyReplacementsPreservingUnchangedLines(originalContent, baseContent, replacements) {
106
- const originalLines = splitLinesWithEndings(originalContent);
149
+ function widenReplacementsToLines(originalContent, baseContent, replacements) {
150
+ const originalLines = getLineSpans(originalContent);
107
151
  const baseLines = getLineSpans(baseContent);
108
152
  if (originalLines.length !== baseLines.length) {
109
153
  throw new Error("Cannot preserve unchanged lines because the base content has a different line count.");
@@ -120,17 +164,16 @@ export function applyReplacementsPreservingUnchangedLines(originalContent, baseC
120
164
  }
121
165
  groups.push({ ...range, replacements: [replacement] });
122
166
  }
123
- let originalLineIndex = 0;
124
- let result = "";
125
- for (const group of groups) {
126
- result += originalLines.slice(originalLineIndex, group.startLine).join("");
167
+ return groups.map((group) => {
127
168
  const groupStartOffset = baseLines[group.startLine].start;
128
169
  const groupEndOffset = baseLines[group.endLine - 1].end;
129
- result += applyReplacements(baseContent.slice(groupStartOffset, groupEndOffset), group.replacements, groupStartOffset);
130
- originalLineIndex = group.endLine;
131
- }
132
- result += originalLines.slice(originalLineIndex).join("");
133
- return result;
170
+ const originalStart = originalLines[group.startLine].start;
171
+ return {
172
+ matchIndex: originalStart,
173
+ matchLength: originalLines[group.endLine - 1].end - originalStart,
174
+ newText: applyReplacements(baseContent.slice(groupStartOffset, groupEndOffset), group.replacements, groupStartOffset),
175
+ };
176
+ });
134
177
  }
135
178
  /**
136
179
  * Find oldText in content, trying exact match first, then fuzzy match.
@@ -252,13 +295,14 @@ export function applyEditsToNormalizedContent(normalizedContent, edits, path) {
252
295
  }
253
296
  }
254
297
  const baseContent = normalizedContent;
255
- const newContent = usedFuzzyMatch
256
- ? applyReplacementsPreservingUnchangedLines(normalizedContent, replacementBaseContent, matchedEdits)
257
- : applyReplacements(replacementBaseContent, matchedEdits);
298
+ const replacements = usedFuzzyMatch
299
+ ? widenReplacementsToLines(normalizedContent, replacementBaseContent, matchedEdits)
300
+ : matchedEdits;
301
+ const newContent = applyReplacements(baseContent, replacements);
258
302
  if (baseContent === newContent) {
259
303
  throw getNoChangeError(path, normalizedEdits.length);
260
304
  }
261
- return { baseContent, newContent };
305
+ return { baseContent, newContent, replacements };
262
306
  }
263
307
  /** Generate a standard unified patch. */
264
308
  export function generateUnifiedPatch(path, oldContent, newContent, contextLines = 4) {
@@ -272,14 +316,26 @@ export function generateUnifiedPatch(path, oldContent, newContent, contextLines
272
316
  * Returns both the diff string and the first changed line number (in the new file).
273
317
  */
274
318
  export function generateDiffString(oldContent, newContent, contextLines = 4) {
275
- const parts = Diff.diffLines(oldContent, newContent);
319
+ const lineNumWidth = String(Math.max(countLines(oldContent), countLines(newContent))).length;
320
+ const { output, firstChangedLine } = formatDisplayDiff(Diff.diffLines(oldContent, newContent), 1, 1, lineNumWidth, contextLines);
321
+ return { diff: output.join("\n"), firstChangedLine };
322
+ }
323
+ /** Number of lines as `text.split("\n").length` counts them, without building the array. */
324
+ function countLines(text) {
325
+ return countLineFeeds(text, 0, text.length) + 1;
326
+ }
327
+ function countLineFeeds(text, start, end) {
328
+ let count = 0;
329
+ for (let index = text.indexOf("\n", start); index !== -1 && index < end; index = text.indexOf("\n", index + 1)) {
330
+ count++;
331
+ }
332
+ return count;
333
+ }
334
+ /** Format jsdiff line parts as display diff lines, numbering from the given 1-based old and new lines. */
335
+ function formatDisplayDiff(parts, oldStartLine, newStartLine, lineNumWidth, contextLines) {
276
336
  const output = [];
277
- const oldLines = oldContent.split("\n");
278
- const newLines = newContent.split("\n");
279
- const maxLineNum = Math.max(oldLines.length, newLines.length);
280
- const lineNumWidth = String(maxLineNum).length;
281
- let oldLineNum = 1;
282
- let newLineNum = 1;
337
+ let oldLineNum = oldStartLine;
338
+ let newLineNum = newStartLine;
283
339
  let lastWasChange = false;
284
340
  let firstChangedLine;
285
341
  for (let i = 0; i < parts.length; i++) {
@@ -381,7 +437,91 @@ export function generateDiffString(oldContent, newContent, contextLines = 4) {
381
437
  lastWasChange = false;
382
438
  }
383
439
  }
384
- return { diff: output.join("\n"), firstChangedLine };
440
+ return { output, firstChangedLine };
441
+ }
442
+ /**
443
+ * Unchanged lines diffed on each side of a replacement. Well above the 4 context lines shown, so jsdiff
444
+ * aligns a change within its window as it would over the whole file.
445
+ */
446
+ const DIFF_WINDOW_MARGIN_LINES = 32;
447
+ /**
448
+ * Diff an edit only around its replacements, so time and memory follow the size of the change instead of
449
+ * the file. The result matches generateDiffString and generateUnifiedPatch over the whole contents, except
450
+ * that jsdiff may align runs of repeated lines differently within a window.
451
+ */
452
+ export function generateEditDiff(path, baseContent, newContent, replacements, contextLines = 4) {
453
+ const lineNumWidth = String(Math.max(countLines(baseContent), countLines(newContent))).length;
454
+ const skipMarker = ` ${"".padStart(lineNumWidth, " ")} ...`;
455
+ const output = [];
456
+ const hunks = [];
457
+ let firstChangedLine;
458
+ for (const window of getDiffWindows(baseContent, replacements)) {
459
+ const oldText = baseContent.slice(window.oldStart, window.oldEnd);
460
+ const newText = newContent.slice(window.newStart, window.newEnd);
461
+ const shown = formatDisplayDiff(Diff.diffLines(oldText, newText), window.oldLine + 1, window.newLine + 1, lineNumWidth, contextLines);
462
+ firstChangedLine ??= shown.firstChangedLine;
463
+ // Both windows around a run of unchanged lines mark it as skipped; the whole-file diff shows one marker.
464
+ if (output.at(-1) === skipMarker && shown.output[0] === skipMarker)
465
+ shown.output.shift();
466
+ // A loop, not push(...lines): spreading a replacement of many lines overflows the call stack.
467
+ for (const line of shown.output)
468
+ output.push(line);
469
+ const patch = Diff.structuredPatch(path, path, oldText, newText, undefined, undefined, { context: contextLines });
470
+ for (const hunk of patch.hunks) {
471
+ hunks.push({ ...hunk, oldStart: hunk.oldStart + window.oldLine, newStart: hunk.newStart + window.newLine });
472
+ }
473
+ }
474
+ const patch = Diff.formatPatch({ oldFileName: path, newFileName: path, oldHeader: undefined, newHeader: undefined, hunks }, Diff.FILE_HEADERS_ONLY);
475
+ return { diff: output.join("\n"), patch, firstChangedLine };
476
+ }
477
+ /** Start of the line that contains `offset`. */
478
+ function lineStartBefore(text, offset) {
479
+ // lastIndexOf treats a negative position as 0 and would find a line feed at offset 0.
480
+ return offset === 0 ? 0 : text.lastIndexOf("\n", offset - 1) + 1;
481
+ }
482
+ /** Whole-line windows with margin around the replacements, which are sorted and disjoint; overlapping windows merge. */
483
+ function getDiffWindows(baseContent, replacements) {
484
+ const windows = [];
485
+ // Offset and line deltas of the replacements before the current one, and a line-counting cursor.
486
+ let offsetDelta = 0;
487
+ let lineDelta = 0;
488
+ let cursorOffset = 0;
489
+ let cursorLine = 0;
490
+ for (const replacement of replacements) {
491
+ const matchEnd = replacement.matchIndex + replacement.matchLength;
492
+ let start = lineStartBefore(baseContent, replacement.matchIndex);
493
+ for (let i = 0; i < DIFF_WINDOW_MARGIN_LINES && start > 0; i++) {
494
+ start = lineStartBefore(baseContent, start - 1);
495
+ }
496
+ let end = matchEnd;
497
+ for (let i = 0; i <= DIFF_WINDOW_MARGIN_LINES && end < baseContent.length; i++) {
498
+ const lineFeed = baseContent.indexOf("\n", i === 0 ? Math.max(matchEnd - 1, replacement.matchIndex) : end);
499
+ end = lineFeed === -1 ? baseContent.length : lineFeed + 1;
500
+ }
501
+ const replacementOffsetDelta = replacement.newText.length - replacement.matchLength;
502
+ const replacementLineDelta = countLineFeeds(replacement.newText, 0, replacement.newText.length) -
503
+ countLineFeeds(baseContent, replacement.matchIndex, matchEnd);
504
+ const previous = windows.at(-1);
505
+ if (previous && start <= previous.oldEnd) {
506
+ previous.oldEnd = Math.max(previous.oldEnd, end);
507
+ previous.newEnd = previous.oldEnd + offsetDelta + replacementOffsetDelta;
508
+ }
509
+ else {
510
+ cursorLine += countLineFeeds(baseContent, cursorOffset, start);
511
+ cursorOffset = start;
512
+ windows.push({
513
+ oldStart: start,
514
+ oldEnd: end,
515
+ oldLine: cursorLine,
516
+ newStart: start + offsetDelta,
517
+ newEnd: end + offsetDelta + replacementOffsetDelta,
518
+ newLine: cursorLine + lineDelta,
519
+ });
520
+ }
521
+ offsetDelta += replacementOffsetDelta;
522
+ lineDelta += replacementLineDelta;
523
+ }
524
+ return windows;
385
525
  }
386
526
  /**
387
527
  * Compute the diff for one or more edit operations without applying them.
@@ -403,9 +543,10 @@ export async function computeEditsDiff(path, edits, cwd) {
403
543
  // Strip BOM before matching (LLM won't include invisible BOM in oldText)
404
544
  const { text: content } = splitBom(rawContent);
405
545
  const normalizedContent = normalizeToLF(content);
406
- const { baseContent, newContent } = applyEditsToNormalizedContent(normalizedContent, edits, path);
546
+ const { baseContent, newContent, replacements } = applyEditsToNormalizedContent(normalizedContent, edits, path);
407
547
  // Generate the diff
408
- return generateDiffString(baseContent, newContent);
548
+ const { diff, firstChangedLine } = generateEditDiff(path, baseContent, newContent, replacements);
549
+ return { diff, firstChangedLine };
409
550
  }
410
551
  catch (err) {
411
552
  return { error: err instanceof Error ? err.message : String(err) };
@@ -2,7 +2,7 @@ import { constants } from "fs";
2
2
  import { access as fsAccess, readFile as fsReadFile, writeFile as fsWriteFile } from "fs/promises";
3
3
  import { Type } from "typebox";
4
4
  import { splitBom } from "../../utils/text.js";
5
- import { applyEditsToNormalizedContent, detectLineEnding, generateDiffString, generateUnifiedPatch, normalizeToLF, restoreLineEndings, } from "./edit-diff.js";
5
+ import { applyEditsToNormalizedContent, applyReplacementsToOriginal, generateEditDiff, normalizeToLF, } from "./edit-diff.js";
6
6
  import { withFileMutationQueue } from "./file-mutation-queue.js";
7
7
  import { resolveToCwd } from "./path-utils.js";
8
8
  import { editRenderers } from "./renderers/edit.js";
@@ -116,15 +116,16 @@ export function createEditToolDefinition(cwd, options) {
116
116
  throwIfAborted();
117
117
  // Strip BOM before matching. The model will not include an invisible BOM in oldText.
118
118
  const { bom, text: content } = splitBom(rawContent);
119
- const originalEnding = detectLineEnding(content);
120
119
  const normalizedContent = normalizeToLF(content);
121
- const { baseContent, newContent } = applyEditsToNormalizedContent(normalizedContent, edits, path);
120
+ const { baseContent, newContent, replacements } = applyEditsToNormalizedContent(normalizedContent, edits, path);
121
+ // Diff before writing, so diff computation cannot fail after the write.
122
+ const editDiff = generateEditDiff(path, baseContent, newContent, replacements);
122
123
  throwIfAborted();
123
- const finalContent = bom + restoreLineEndings(newContent, originalEnding);
124
+ // Splice into the original text, so untouched lines keep their line endings. Without any CR
125
+ // the original is the normalized text, and the normalized result is already final.
126
+ const finalContent = bom + (content === normalizedContent ? newContent : applyReplacementsToOriginal(content, replacements));
124
127
  await ops.writeFile(absolutePath, finalContent);
125
128
  throwIfAborted();
126
- const diffResult = generateDiffString(baseContent, newContent);
127
- const patch = generateUnifiedPatch(path, baseContent, newContent);
128
129
  return {
129
130
  content: [
130
131
  {
@@ -132,7 +133,7 @@ export function createEditToolDefinition(cwd, options) {
132
133
  text: `Successfully replaced ${edits.length} block(s) in ${path}.`,
133
134
  },
134
135
  ],
135
- details: { diff: diffResult.diff, patch, firstChangedLine: diffResult.firstChangedLine },
136
+ details: editDiff,
136
137
  };
137
138
  });
138
139
  },
@@ -1,5 +1,6 @@
1
1
  import { createInterface } from "node:readline";
2
2
  import { spawn } from "child_process";
3
+ import { Minimatch } from "minimatch";
3
4
  import path from "path";
4
5
  import { Type } from "typebox";
5
6
  import { ensureTool } from "../../utils/tools-manager.js";
@@ -63,7 +64,8 @@ export function createFindToolDefinition(cwd, options) {
63
64
  (async () => {
64
65
  try {
65
66
  const searchPath = resolveToCwd(searchDir || ".", ctx?.cwd || cwd);
66
- const effectiveLimit = limit ?? DEFAULT_LIMIT;
67
+ // fd treats --max-results 0 as unlimited, so a limit below 1 means 1.
68
+ const effectiveLimit = Math.max(1, Math.floor(limit ?? DEFAULT_LIMIT));
67
69
  const ops = customOps ?? defaultFindOperations;
68
70
  // If custom operations provide glob(), use that instead of fd.
69
71
  if (customOps?.glob) {
@@ -75,9 +77,10 @@ export function createFindToolDefinition(cwd, options) {
75
77
  settle(() => reject(new Error("Operation aborted")));
76
78
  return;
77
79
  }
80
+ // One result past the limit tells "exactly N matches" apart from "more than N".
78
81
  const results = await ops.glob(pattern, searchPath, {
79
82
  ignore: ["**/node_modules/**", "**/.git/**"],
80
- limit: effectiveLimit,
83
+ limit: effectiveLimit + 1,
81
84
  });
82
85
  if (signal?.aborted) {
83
86
  settle(() => reject(new Error("Operation aborted")));
@@ -90,9 +93,11 @@ export function createFindToolDefinition(cwd, options) {
90
93
  }));
91
94
  return;
92
95
  }
96
+ const resultLimitReached = results.length > effectiveLimit;
93
97
  // Relativize paths against the search root for stable output.
94
- const relativized = results.map((p) => relativizeFindResultPath(p, searchPath));
95
- const resultLimitReached = relativized.length >= effectiveLimit;
98
+ const relativized = results
99
+ .slice(0, effectiveLimit)
100
+ .map((p) => relativizeFindResultPath(p, searchPath));
96
101
  const rawOutput = relativized.join("\n");
97
102
  const truncation = truncateHead(rawOutput, { maxLines: Number.MAX_SAFE_INTEGER });
98
103
  let resultOutput = truncation.content;
@@ -125,7 +130,7 @@ export function createFindToolDefinition(cwd, options) {
125
130
  settle(() => reject(new Error("fd is not available and could not be downloaded")));
126
131
  return;
127
132
  }
128
- const args = ["--glob", "--color=never", "--hidden"];
133
+ const args = ["--color=never", "--hidden"];
129
134
  // fd normally ignores .gitignore outside git repos, so keep --no-require-git
130
135
  // there. Inside repos, use fd's default git-aware behavior so parent
131
136
  // .gitignore rules stop at nested repo boundaries:
@@ -143,25 +148,56 @@ export function createFindToolDefinition(cwd, options) {
143
148
  }
144
149
  if (!insideGitRepo)
145
150
  args.push("--no-require-git");
146
- args.push("--max-results", String(effectiveLimit));
147
151
  // fd --glob matches against the basename unless --full-path is set; in --full-path
148
152
  // mode it matches against the absolute candidate path, so a path-containing
149
153
  // pattern like 'src/**/*.spec.ts' needs a leading '**/' to match anything.
150
- let effectivePattern = pattern;
151
- if (pattern.includes("/")) {
152
- args.push("--full-path");
153
- if (!pattern.startsWith("/") && !pattern.startsWith("**/") && pattern !== "**") {
154
- effectivePattern = `**/${pattern}`;
155
- }
156
- // fd matches full paths using native separators on Windows.
157
- if (process.platform === "win32")
158
- effectivePattern = effectivePattern.replaceAll("/", String.raw `[/\\]`);
154
+ // On Windows `\` is a path separator, so native patterns like 'src\**\*.ts' are
155
+ // normalized to '/' (#9262). On POSIX `\` stays a glob escape character.
156
+ let effectivePattern = process.platform === "win32" ? pattern.replaceAll("\\", "/") : pattern;
157
+ const isPathPattern = effectivePattern.includes("/");
158
+ if (isPathPattern &&
159
+ !effectivePattern.startsWith("/") &&
160
+ !effectivePattern.startsWith("**/") &&
161
+ effectivePattern !== "**") {
162
+ effectivePattern = `**/${effectivePattern}`;
159
163
  }
160
- args.push("--", effectivePattern, searchPath);
164
+ // fd before 10.5.1 never matches --full-path globs on Windows, and workarounds for that
165
+ // break on fd 10.5.1 (sharkdp/fd#2067). pi cannot rely on either fd version, so on
166
+ // Windows fd lists every entry and minimatch matches path patterns. The options keep
167
+ // fd's glob behavior: `*` matches dotfiles, `+(a|b)` is literal, and an all-lowercase
168
+ // pattern matches case-insensitively (smart case). A trailing '/**' becomes '/**/*'
169
+ // because minimatch's 'src/**' also matches 'src' itself and fd's does not.
170
+ const windowsPathMatcher = process.platform === "win32" && isPathPattern
171
+ ? new Minimatch(effectivePattern.replace(/\/\*\*$/, "/**/*"), {
172
+ dot: true,
173
+ noext: true,
174
+ nocase: effectivePattern === effectivePattern.toLowerCase(),
175
+ })
176
+ : undefined;
177
+ if (windowsPathMatcher) {
178
+ args.push("--", "", searchPath);
179
+ }
180
+ else {
181
+ // One result past the limit tells "exactly N matches" apart from "more than N" (#7121).
182
+ args.push("--glob", "--max-results", String(effectiveLimit + 1));
183
+ if (isPathPattern)
184
+ args.push("--full-path");
185
+ args.push("--", effectivePattern, searchPath);
186
+ }
187
+ // An abort during the .git lookup above already rejected the call, but there was no
188
+ // child to stop yet. Do not start fd.
189
+ if (signal?.aborted)
190
+ return;
161
191
  const child = spawn(fdPath, args, { stdio: ["ignore", "pipe", "pipe"] });
162
192
  const rl = createInterface({ input: child.stdout });
163
193
  let stderr = "";
164
- const lines = [];
194
+ // Results within the limit, stored only up to the first one past the byte cap:
195
+ // truncateHead drops the rest anyway, so they are counted but not kept.
196
+ const storedResults = [];
197
+ let resultCount = 0;
198
+ // Byte size of all results within the limit, each counted with a trailing newline.
199
+ let outputBytes = 0;
200
+ let resultLimitReached = false;
165
201
  stopChild = () => {
166
202
  if (!child.killed) {
167
203
  child.kill();
@@ -173,8 +209,24 @@ export function createFindToolDefinition(cwd, options) {
173
209
  child.stderr?.on("data", (chunk) => {
174
210
  stderr += chunk.toString();
175
211
  });
176
- rl.on("line", (line) => {
177
- lines.push(line);
212
+ rl.on("line", (rawLine) => {
213
+ const line = rawLine.replace(/\r$/, "").trim();
214
+ if (!line)
215
+ return;
216
+ if (windowsPathMatcher && !windowsPathMatcher.match(line))
217
+ return;
218
+ if (resultCount === effectiveLimit) {
219
+ resultLimitReached = true;
220
+ // Without --max-results, fd keeps listing after the limit.
221
+ if (windowsPathMatcher)
222
+ stopChild?.();
223
+ return;
224
+ }
225
+ const result = relativizeFindResultPath(line, searchPath);
226
+ resultCount++;
227
+ if (outputBytes - 1 <= DEFAULT_MAX_BYTES)
228
+ storedResults.push(result);
229
+ outputBytes += Buffer.byteLength(result, "utf-8") + 1;
178
230
  });
179
231
  child.on("error", (error) => {
180
232
  cleanup();
@@ -186,31 +238,25 @@ export function createFindToolDefinition(cwd, options) {
186
238
  settle(() => reject(new Error("Operation aborted")));
187
239
  return;
188
240
  }
189
- const output = lines.join("\n");
190
- if (code !== 0) {
241
+ if (code !== 0 && resultCount === 0) {
191
242
  const errorMsg = stderr.trim() || `fd exited with code ${code}`;
192
- if (!output) {
193
- settle(() => reject(new Error(errorMsg)));
194
- return;
195
- }
243
+ settle(() => reject(new Error(errorMsg)));
244
+ return;
196
245
  }
197
- if (!output) {
246
+ if (resultCount === 0) {
198
247
  settle(() => resolve({
199
248
  content: [{ type: "text", text: "No files found matching pattern" }],
200
249
  details: undefined,
201
250
  }));
202
251
  return;
203
252
  }
204
- const relativized = [];
205
- for (const rawLine of lines) {
206
- const line = rawLine.replace(/\r$/, "").trim();
207
- if (!line)
208
- continue;
209
- relativized.push(relativizeFindResultPath(line, searchPath));
210
- }
211
- const resultLimitReached = relativized.length >= effectiveLimit;
212
- const rawOutput = relativized.join("\n");
213
- const truncation = truncateHead(rawOutput, { maxLines: Number.MAX_SAFE_INTEGER });
253
+ // Stored results extend past the byte cap when more exist, so truncateHead decides
254
+ // truncation as for the full output; only the totals need the unstored rest.
255
+ const truncation = {
256
+ ...truncateHead(storedResults.join("\n"), { maxLines: Number.MAX_SAFE_INTEGER }),
257
+ totalLines: resultCount,
258
+ totalBytes: outputBytes - 1,
259
+ };
214
260
  let resultOutput = truncation.content;
215
261
  const details = {};
216
262
  const notices = [];
@@ -23,13 +23,15 @@ export interface GrepToolDetails {
23
23
  }
24
24
  /**
25
25
  * Pluggable operations for the grep tool.
26
- * Override these to delegate search to remote systems (for example SSH).
26
+ * The search itself always runs the local ripgrep; to search a remote system, override the tool's execute().
27
27
  */
28
28
  export interface GrepOperations {
29
29
  /** Check if path is a directory. Throws if path does not exist. */
30
30
  isDirectory: (absolutePath: string) => Promise<boolean> | boolean;
31
- /** Read file contents for context lines */
32
- readFile: (absolutePath: string) => Promise<string> | string;
31
+ /**
32
+ * @deprecated Ignored. Context lines come directly from ripgrep. Override the tool's execute() for remote search.
33
+ */
34
+ readFile?: (absolutePath: string) => Promise<string> | string;
33
35
  }
34
36
  export interface GrepToolOptions {
35
37
  /** Custom operations for grep. Default: local filesystem plus ripgrep */