gsd-pi 2.9.0 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1016) hide show
  1. package/node_modules/@gsd/native/package.json +59 -0
  2. package/node_modules/@gsd/native/src/__tests__/clipboard.test.mjs +79 -0
  3. package/node_modules/@gsd/native/src/__tests__/fd.test.mjs +164 -0
  4. package/node_modules/@gsd/native/src/__tests__/glob.test.mjs +237 -0
  5. package/node_modules/@gsd/native/src/__tests__/grep.test.mjs +162 -0
  6. package/node_modules/@gsd/native/src/__tests__/highlight.test.mjs +156 -0
  7. package/node_modules/@gsd/native/src/__tests__/html.test.mjs +98 -0
  8. package/node_modules/@gsd/native/src/__tests__/image.test.mjs +137 -0
  9. package/node_modules/@gsd/native/src/__tests__/ps.test.mjs +109 -0
  10. package/node_modules/@gsd/native/src/__tests__/text.test.mjs +262 -0
  11. package/node_modules/@gsd/native/src/ast/index.ts +12 -0
  12. package/node_modules/@gsd/native/src/ast/types.ts +75 -0
  13. package/node_modules/@gsd/native/src/clipboard/index.ts +40 -0
  14. package/node_modules/@gsd/native/src/clipboard/types.ts +7 -0
  15. package/node_modules/@gsd/native/src/fd/index.ts +35 -0
  16. package/node_modules/@gsd/native/src/fd/types.ts +31 -0
  17. package/node_modules/@gsd/native/src/glob/index.ts +44 -0
  18. package/node_modules/@gsd/native/src/glob/types.ts +53 -0
  19. package/node_modules/@gsd/native/src/grep/index.ts +48 -0
  20. package/node_modules/@gsd/native/src/grep/types.ts +105 -0
  21. package/node_modules/@gsd/native/src/highlight/index.ts +44 -0
  22. package/node_modules/@gsd/native/src/highlight/types.ts +25 -0
  23. package/node_modules/@gsd/native/src/html/index.ts +24 -0
  24. package/node_modules/@gsd/native/src/html/types.ts +7 -0
  25. package/node_modules/@gsd/native/src/image/index.ts +28 -0
  26. package/node_modules/@gsd/native/src/image/types.ts +41 -0
  27. package/node_modules/@gsd/native/src/index.ts +88 -0
  28. package/node_modules/@gsd/native/src/native.ts +94 -0
  29. package/node_modules/@gsd/native/src/ps/index.ts +52 -0
  30. package/node_modules/@gsd/native/src/ps/types.ts +5 -0
  31. package/node_modules/@gsd/native/src/text/index.ts +125 -0
  32. package/node_modules/@gsd/native/src/text/types.ts +29 -0
  33. package/node_modules/@gsd/native/src/ttsr/index.ts +39 -0
  34. package/node_modules/@gsd/native/src/ttsr/types.ts +10 -0
  35. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/defaults.json +456 -0
  36. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lsp.md +33 -0
  37. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/find.d.ts +1 -1
  38. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
  39. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/find.js +12 -77
  40. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/find.js.map +1 -1
  41. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-edit.d.ts +60 -0
  42. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-edit.d.ts.map +1 -0
  43. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-edit.js +247 -0
  44. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-edit.js.map +1 -0
  45. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-read.d.ts +43 -0
  46. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-read.d.ts.map +1 -0
  47. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-read.js +146 -0
  48. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-read.js.map +1 -0
  49. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.d.ts +114 -0
  50. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.d.ts.map +1 -0
  51. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.js +522 -0
  52. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.js.map +1 -0
  53. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.test.d.ts +2 -0
  54. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.test.d.ts.map +1 -0
  55. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.test.js +376 -0
  56. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.test.js.map +1 -0
  57. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/index.d.ts +25 -0
  58. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/index.d.ts.map +1 -1
  59. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/index.js +23 -0
  60. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/index.js.map +1 -1
  61. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  62. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +6 -3
  63. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  64. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +0 -1
  65. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  66. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/interactive-mode.js +8 -9
  67. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  68. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  69. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/theme/theme.js +25 -40
  70. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  71. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-image.d.ts.map +1 -1
  72. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-image.js +17 -21
  73. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-image.js.map +1 -1
  74. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-native.d.ts +7 -6
  75. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-native.d.ts.map +1 -1
  76. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-native.js +7 -13
  77. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-native.js.map +1 -1
  78. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard.d.ts.map +1 -1
  79. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard.js +3 -56
  80. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard.js.map +1 -1
  81. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-convert.d.ts.map +1 -1
  82. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-convert.js +7 -17
  83. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-convert.js.map +1 -1
  84. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-resize.d.ts +1 -2
  85. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-resize.d.ts.map +1 -1
  86. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-resize.js +21 -29
  87. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-resize.js.map +1 -1
  88. package/node_modules/@gsd/pi-coding-agent/package.json +2 -5
  89. package/node_modules/@gsd/pi-coding-agent/src/core/tools/find.ts +13 -88
  90. package/node_modules/@gsd/pi-coding-agent/src/core/tools/hashline-edit.ts +318 -0
  91. package/node_modules/@gsd/pi-coding-agent/src/core/tools/hashline-read.ts +196 -0
  92. package/node_modules/@gsd/pi-coding-agent/src/core/tools/hashline.test.ts +456 -0
  93. package/node_modules/@gsd/pi-coding-agent/src/core/tools/hashline.ts +594 -0
  94. package/node_modules/@gsd/pi-coding-agent/src/core/tools/index.ts +53 -0
  95. package/node_modules/@gsd/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +5 -3
  96. package/node_modules/@gsd/pi-coding-agent/src/modes/interactive/interactive-mode.ts +7 -10
  97. package/node_modules/@gsd/pi-coding-agent/src/modes/interactive/theme/theme.ts +26 -42
  98. package/node_modules/@gsd/pi-coding-agent/src/utils/clipboard-image.ts +17 -24
  99. package/node_modules/@gsd/pi-coding-agent/src/utils/clipboard-native.ts +11 -21
  100. package/node_modules/@gsd/pi-coding-agent/src/utils/clipboard.ts +3 -51
  101. package/node_modules/@gsd/pi-coding-agent/src/utils/image-convert.ts +7 -17
  102. package/node_modules/@gsd/pi-coding-agent/src/utils/image-resize.ts +28 -34
  103. package/node_modules/@gsd/pi-tui/dist/autocomplete.d.ts +1 -3
  104. package/node_modules/@gsd/pi-tui/dist/autocomplete.d.ts.map +1 -1
  105. package/node_modules/@gsd/pi-tui/dist/autocomplete.js +16 -95
  106. package/node_modules/@gsd/pi-tui/dist/autocomplete.js.map +1 -1
  107. package/node_modules/@gsd/pi-tui/dist/components/image.d.ts +7 -0
  108. package/node_modules/@gsd/pi-tui/dist/components/image.d.ts.map +1 -1
  109. package/node_modules/@gsd/pi-tui/dist/components/image.js +20 -1
  110. package/node_modules/@gsd/pi-tui/dist/components/image.js.map +1 -1
  111. package/node_modules/@gsd/pi-tui/dist/index.d.ts +1 -1
  112. package/node_modules/@gsd/pi-tui/dist/index.d.ts.map +1 -1
  113. package/node_modules/@gsd/pi-tui/dist/index.js +1 -1
  114. package/node_modules/@gsd/pi-tui/dist/index.js.map +1 -1
  115. package/node_modules/@gsd/pi-tui/dist/terminal-image.d.ts +5 -5
  116. package/node_modules/@gsd/pi-tui/dist/terminal-image.d.ts.map +1 -1
  117. package/node_modules/@gsd/pi-tui/dist/terminal-image.js +9 -120
  118. package/node_modules/@gsd/pi-tui/dist/terminal-image.js.map +1 -1
  119. package/node_modules/@gsd/pi-tui/dist/utils.d.ts +23 -26
  120. package/node_modules/@gsd/pi-tui/dist/utils.d.ts.map +1 -1
  121. package/node_modules/@gsd/pi-tui/dist/utils.js +47 -716
  122. package/node_modules/@gsd/pi-tui/dist/utils.js.map +1 -1
  123. package/node_modules/@gsd/pi-tui/package.json +1 -0
  124. package/node_modules/@gsd/pi-tui/src/autocomplete.ts +17 -112
  125. package/node_modules/@gsd/pi-tui/src/components/image.ts +23 -1
  126. package/node_modules/@gsd/pi-tui/src/index.ts +0 -4
  127. package/node_modules/@gsd/pi-tui/src/terminal-image.ts +9 -135
  128. package/node_modules/@gsd/pi-tui/src/utils.ts +51 -775
  129. package/package.json +4 -1
  130. package/packages/native/package.json +59 -0
  131. package/packages/native/src/__tests__/clipboard.test.mjs +79 -0
  132. package/packages/native/src/__tests__/fd.test.mjs +164 -0
  133. package/packages/native/src/__tests__/glob.test.mjs +237 -0
  134. package/packages/native/src/__tests__/grep.test.mjs +162 -0
  135. package/packages/native/src/__tests__/highlight.test.mjs +156 -0
  136. package/packages/native/src/__tests__/html.test.mjs +98 -0
  137. package/packages/native/src/__tests__/image.test.mjs +137 -0
  138. package/packages/native/src/__tests__/ps.test.mjs +109 -0
  139. package/packages/native/src/__tests__/text.test.mjs +262 -0
  140. package/packages/native/src/ast/index.ts +12 -0
  141. package/packages/native/src/ast/types.ts +75 -0
  142. package/packages/native/src/clipboard/index.ts +40 -0
  143. package/packages/native/src/clipboard/types.ts +7 -0
  144. package/packages/native/src/fd/index.ts +35 -0
  145. package/packages/native/src/fd/types.ts +31 -0
  146. package/packages/native/src/glob/index.ts +44 -0
  147. package/packages/native/src/glob/types.ts +53 -0
  148. package/packages/native/src/grep/index.ts +48 -0
  149. package/packages/native/src/grep/types.ts +105 -0
  150. package/packages/native/src/highlight/index.ts +44 -0
  151. package/packages/native/src/highlight/types.ts +25 -0
  152. package/packages/native/src/html/index.ts +24 -0
  153. package/packages/native/src/html/types.ts +7 -0
  154. package/packages/native/src/image/index.ts +28 -0
  155. package/packages/native/src/image/types.ts +41 -0
  156. package/packages/native/src/index.ts +88 -0
  157. package/packages/native/src/native.ts +94 -0
  158. package/packages/native/src/ps/index.ts +52 -0
  159. package/packages/native/src/ps/types.ts +5 -0
  160. package/packages/native/src/text/index.ts +125 -0
  161. package/packages/native/src/text/types.ts +29 -0
  162. package/packages/native/src/ttsr/index.ts +39 -0
  163. package/packages/native/src/ttsr/types.ts +10 -0
  164. package/packages/native/tsconfig.json +8 -0
  165. package/packages/pi-coding-agent/dist/core/lsp/defaults.json +456 -0
  166. package/packages/pi-coding-agent/dist/core/lsp/lsp.md +33 -0
  167. package/packages/pi-coding-agent/dist/core/tools/find.d.ts +1 -1
  168. package/packages/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
  169. package/packages/pi-coding-agent/dist/core/tools/find.js +12 -77
  170. package/packages/pi-coding-agent/dist/core/tools/find.js.map +1 -1
  171. package/packages/pi-coding-agent/dist/core/tools/hashline-edit.d.ts +60 -0
  172. package/packages/pi-coding-agent/dist/core/tools/hashline-edit.d.ts.map +1 -0
  173. package/packages/pi-coding-agent/dist/core/tools/hashline-edit.js +247 -0
  174. package/packages/pi-coding-agent/dist/core/tools/hashline-edit.js.map +1 -0
  175. package/packages/pi-coding-agent/dist/core/tools/hashline-read.d.ts +43 -0
  176. package/packages/pi-coding-agent/dist/core/tools/hashline-read.d.ts.map +1 -0
  177. package/packages/pi-coding-agent/dist/core/tools/hashline-read.js +146 -0
  178. package/packages/pi-coding-agent/dist/core/tools/hashline-read.js.map +1 -0
  179. package/packages/pi-coding-agent/dist/core/tools/hashline.d.ts +114 -0
  180. package/packages/pi-coding-agent/dist/core/tools/hashline.d.ts.map +1 -0
  181. package/packages/pi-coding-agent/dist/core/tools/hashline.js +522 -0
  182. package/packages/pi-coding-agent/dist/core/tools/hashline.js.map +1 -0
  183. package/packages/pi-coding-agent/dist/core/tools/hashline.test.d.ts +2 -0
  184. package/packages/pi-coding-agent/dist/core/tools/hashline.test.d.ts.map +1 -0
  185. package/packages/pi-coding-agent/dist/core/tools/hashline.test.js +376 -0
  186. package/packages/pi-coding-agent/dist/core/tools/hashline.test.js.map +1 -0
  187. package/packages/pi-coding-agent/dist/core/tools/index.d.ts +25 -0
  188. package/packages/pi-coding-agent/dist/core/tools/index.d.ts.map +1 -1
  189. package/packages/pi-coding-agent/dist/core/tools/index.js +23 -0
  190. package/packages/pi-coding-agent/dist/core/tools/index.js.map +1 -1
  191. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  192. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +6 -3
  193. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  194. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +0 -1
  195. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  196. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +8 -9
  197. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  198. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  199. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +25 -40
  200. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  201. package/packages/pi-coding-agent/dist/utils/clipboard-image.d.ts.map +1 -1
  202. package/packages/pi-coding-agent/dist/utils/clipboard-image.js +17 -21
  203. package/packages/pi-coding-agent/dist/utils/clipboard-image.js.map +1 -1
  204. package/packages/pi-coding-agent/dist/utils/clipboard-native.d.ts +7 -6
  205. package/packages/pi-coding-agent/dist/utils/clipboard-native.d.ts.map +1 -1
  206. package/packages/pi-coding-agent/dist/utils/clipboard-native.js +7 -13
  207. package/packages/pi-coding-agent/dist/utils/clipboard-native.js.map +1 -1
  208. package/packages/pi-coding-agent/dist/utils/clipboard.d.ts.map +1 -1
  209. package/packages/pi-coding-agent/dist/utils/clipboard.js +3 -56
  210. package/packages/pi-coding-agent/dist/utils/clipboard.js.map +1 -1
  211. package/packages/pi-coding-agent/dist/utils/image-convert.d.ts.map +1 -1
  212. package/packages/pi-coding-agent/dist/utils/image-convert.js +7 -17
  213. package/packages/pi-coding-agent/dist/utils/image-convert.js.map +1 -1
  214. package/packages/pi-coding-agent/dist/utils/image-resize.d.ts +1 -2
  215. package/packages/pi-coding-agent/dist/utils/image-resize.d.ts.map +1 -1
  216. package/packages/pi-coding-agent/dist/utils/image-resize.js +21 -29
  217. package/packages/pi-coding-agent/dist/utils/image-resize.js.map +1 -1
  218. package/packages/pi-coding-agent/package.json +2 -5
  219. package/packages/pi-coding-agent/src/core/tools/find.ts +13 -88
  220. package/packages/pi-coding-agent/src/core/tools/hashline-edit.ts +318 -0
  221. package/packages/pi-coding-agent/src/core/tools/hashline-read.ts +196 -0
  222. package/packages/pi-coding-agent/src/core/tools/hashline.test.ts +456 -0
  223. package/packages/pi-coding-agent/src/core/tools/hashline.ts +594 -0
  224. package/packages/pi-coding-agent/src/core/tools/index.ts +53 -0
  225. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +5 -3
  226. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +7 -10
  227. package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +26 -42
  228. package/packages/pi-coding-agent/src/utils/clipboard-image.ts +17 -24
  229. package/packages/pi-coding-agent/src/utils/clipboard-native.ts +11 -21
  230. package/packages/pi-coding-agent/src/utils/clipboard.ts +3 -51
  231. package/packages/pi-coding-agent/src/utils/image-convert.ts +7 -17
  232. package/packages/pi-coding-agent/src/utils/image-resize.ts +28 -34
  233. package/packages/pi-tui/dist/autocomplete.d.ts +1 -3
  234. package/packages/pi-tui/dist/autocomplete.d.ts.map +1 -1
  235. package/packages/pi-tui/dist/autocomplete.js +16 -95
  236. package/packages/pi-tui/dist/autocomplete.js.map +1 -1
  237. package/packages/pi-tui/dist/components/image.d.ts +7 -0
  238. package/packages/pi-tui/dist/components/image.d.ts.map +1 -1
  239. package/packages/pi-tui/dist/components/image.js +20 -1
  240. package/packages/pi-tui/dist/components/image.js.map +1 -1
  241. package/packages/pi-tui/dist/index.d.ts +1 -1
  242. package/packages/pi-tui/dist/index.d.ts.map +1 -1
  243. package/packages/pi-tui/dist/index.js +1 -1
  244. package/packages/pi-tui/dist/index.js.map +1 -1
  245. package/packages/pi-tui/dist/terminal-image.d.ts +5 -5
  246. package/packages/pi-tui/dist/terminal-image.d.ts.map +1 -1
  247. package/packages/pi-tui/dist/terminal-image.js +9 -120
  248. package/packages/pi-tui/dist/terminal-image.js.map +1 -1
  249. package/packages/pi-tui/dist/utils.d.ts +23 -26
  250. package/packages/pi-tui/dist/utils.d.ts.map +1 -1
  251. package/packages/pi-tui/dist/utils.js +47 -716
  252. package/packages/pi-tui/dist/utils.js.map +1 -1
  253. package/packages/pi-tui/package.json +1 -0
  254. package/packages/pi-tui/src/autocomplete.ts +17 -112
  255. package/packages/pi-tui/src/components/image.ts +23 -1
  256. package/packages/pi-tui/src/index.ts +0 -4
  257. package/packages/pi-tui/src/terminal-image.ts +9 -135
  258. package/packages/pi-tui/src/utils.ts +51 -775
  259. package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  260. package/pkg/dist/modes/interactive/theme/theme.js +25 -40
  261. package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
  262. package/src/resources/extensions/bg-shell/index.ts +343 -14
  263. package/src/resources/extensions/gsd/git-service.ts +13 -1
  264. package/src/resources/extensions/universal-config/discovery.ts +78 -0
  265. package/src/resources/extensions/universal-config/format.ts +160 -0
  266. package/src/resources/extensions/universal-config/index.ts +118 -0
  267. package/src/resources/extensions/universal-config/package.json +11 -0
  268. package/src/resources/extensions/universal-config/scanners.ts +579 -0
  269. package/src/resources/extensions/universal-config/tests/discovery.test.ts +111 -0
  270. package/src/resources/extensions/universal-config/tests/format.test.ts +111 -0
  271. package/src/resources/extensions/universal-config/tests/scanners.test.ts +438 -0
  272. package/src/resources/extensions/universal-config/tools.ts +60 -0
  273. package/src/resources/extensions/universal-config/types.ts +116 -0
  274. package/node_modules/@mariozechner/clipboard/.yarnrc.yml +0 -1
  275. package/node_modules/@mariozechner/clipboard/Cargo.toml +0 -26
  276. package/node_modules/@mariozechner/clipboard/README.md +0 -58
  277. package/node_modules/@mariozechner/clipboard/build.rs +0 -5
  278. package/node_modules/@mariozechner/clipboard/exp.ts +0 -12
  279. package/node_modules/@mariozechner/clipboard/index.d.ts +0 -23
  280. package/node_modules/@mariozechner/clipboard/index.js +0 -317
  281. package/node_modules/@mariozechner/clipboard/package.json +0 -56
  282. package/node_modules/@mariozechner/clipboard/src/lib.rs +0 -191
  283. package/node_modules/@mariozechner/clipboard-darwin-arm64/README.md +0 -3
  284. package/node_modules/@mariozechner/clipboard-darwin-arm64/clipboard.darwin-arm64.node +0 -0
  285. package/node_modules/@mariozechner/clipboard-darwin-arm64/package.json +0 -22
  286. package/node_modules/@mariozechner/clipboard-darwin-universal/README.md +0 -3
  287. package/node_modules/@mariozechner/clipboard-darwin-universal/clipboard.darwin-universal.node +0 -0
  288. package/node_modules/@mariozechner/clipboard-darwin-universal/package.json +0 -19
  289. package/node_modules/ansi-styles/index.d.ts +0 -345
  290. package/node_modules/ansi-styles/index.js +0 -163
  291. package/node_modules/ansi-styles/license +0 -9
  292. package/node_modules/ansi-styles/package.json +0 -56
  293. package/node_modules/ansi-styles/readme.md +0 -152
  294. package/node_modules/any-promise/.jshintrc +0 -4
  295. package/node_modules/any-promise/.npmignore +0 -7
  296. package/node_modules/any-promise/LICENSE +0 -19
  297. package/node_modules/any-promise/README.md +0 -161
  298. package/node_modules/any-promise/implementation.d.ts +0 -3
  299. package/node_modules/any-promise/implementation.js +0 -1
  300. package/node_modules/any-promise/index.d.ts +0 -73
  301. package/node_modules/any-promise/index.js +0 -1
  302. package/node_modules/any-promise/loader.js +0 -78
  303. package/node_modules/any-promise/optional.js +0 -6
  304. package/node_modules/any-promise/package.json +0 -45
  305. package/node_modules/any-promise/register/bluebird.d.ts +0 -1
  306. package/node_modules/any-promise/register/bluebird.js +0 -2
  307. package/node_modules/any-promise/register/es6-promise.d.ts +0 -1
  308. package/node_modules/any-promise/register/es6-promise.js +0 -2
  309. package/node_modules/any-promise/register/lie.d.ts +0 -1
  310. package/node_modules/any-promise/register/lie.js +0 -2
  311. package/node_modules/any-promise/register/native-promise-only.d.ts +0 -1
  312. package/node_modules/any-promise/register/native-promise-only.js +0 -2
  313. package/node_modules/any-promise/register/pinkie.d.ts +0 -1
  314. package/node_modules/any-promise/register/pinkie.js +0 -2
  315. package/node_modules/any-promise/register/promise.d.ts +0 -1
  316. package/node_modules/any-promise/register/promise.js +0 -2
  317. package/node_modules/any-promise/register/q.d.ts +0 -1
  318. package/node_modules/any-promise/register/q.js +0 -2
  319. package/node_modules/any-promise/register/rsvp.d.ts +0 -1
  320. package/node_modules/any-promise/register/rsvp.js +0 -2
  321. package/node_modules/any-promise/register/vow.d.ts +0 -1
  322. package/node_modules/any-promise/register/vow.js +0 -2
  323. package/node_modules/any-promise/register/when.d.ts +0 -1
  324. package/node_modules/any-promise/register/when.js +0 -2
  325. package/node_modules/any-promise/register-shim.js +0 -18
  326. package/node_modules/any-promise/register.d.ts +0 -17
  327. package/node_modules/any-promise/register.js +0 -94
  328. package/node_modules/cli-highlight/LICENSE.txt +0 -15
  329. package/node_modules/cli-highlight/README.md +0 -88
  330. package/node_modules/cli-highlight/bin/highlight +0 -2
  331. package/node_modules/cli-highlight/dist/cli.d.ts +0 -1
  332. package/node_modules/cli-highlight/dist/cli.js +0 -102
  333. package/node_modules/cli-highlight/dist/cli.js.map +0 -1
  334. package/node_modules/cli-highlight/dist/index.d.ts +0 -53
  335. package/node_modules/cli-highlight/dist/index.js +0 -112
  336. package/node_modules/cli-highlight/dist/index.js.map +0 -1
  337. package/node_modules/cli-highlight/dist/test/test.d.ts +0 -1
  338. package/node_modules/cli-highlight/dist/test/test.js +0 -62
  339. package/node_modules/cli-highlight/dist/test/test.js.map +0 -1
  340. package/node_modules/cli-highlight/dist/theme.d.ts +0 -270
  341. package/node_modules/cli-highlight/dist/theme.js +0 -265
  342. package/node_modules/cli-highlight/dist/theme.js.map +0 -1
  343. package/node_modules/cli-highlight/node_modules/chalk/index.d.ts +0 -415
  344. package/node_modules/cli-highlight/node_modules/chalk/license +0 -9
  345. package/node_modules/cli-highlight/node_modules/chalk/package.json +0 -68
  346. package/node_modules/cli-highlight/node_modules/chalk/readme.md +0 -341
  347. package/node_modules/cli-highlight/node_modules/chalk/source/index.js +0 -229
  348. package/node_modules/cli-highlight/node_modules/chalk/source/templates.js +0 -134
  349. package/node_modules/cli-highlight/node_modules/chalk/source/util.js +0 -39
  350. package/node_modules/cli-highlight/package.json +0 -129
  351. package/node_modules/cliui/CHANGELOG.md +0 -121
  352. package/node_modules/cliui/LICENSE.txt +0 -14
  353. package/node_modules/cliui/README.md +0 -141
  354. package/node_modules/cliui/build/index.cjs +0 -302
  355. package/node_modules/cliui/build/lib/index.js +0 -287
  356. package/node_modules/cliui/build/lib/string-utils.js +0 -27
  357. package/node_modules/cliui/index.mjs +0 -13
  358. package/node_modules/cliui/node_modules/ansi-regex/index.d.ts +0 -37
  359. package/node_modules/cliui/node_modules/ansi-regex/index.js +0 -10
  360. package/node_modules/cliui/node_modules/ansi-regex/license +0 -9
  361. package/node_modules/cliui/node_modules/ansi-regex/package.json +0 -55
  362. package/node_modules/cliui/node_modules/ansi-regex/readme.md +0 -78
  363. package/node_modules/cliui/node_modules/strip-ansi/index.d.ts +0 -17
  364. package/node_modules/cliui/node_modules/strip-ansi/index.js +0 -4
  365. package/node_modules/cliui/node_modules/strip-ansi/license +0 -9
  366. package/node_modules/cliui/node_modules/strip-ansi/package.json +0 -54
  367. package/node_modules/cliui/node_modules/strip-ansi/readme.md +0 -46
  368. package/node_modules/cliui/package.json +0 -83
  369. package/node_modules/color-convert/CHANGELOG.md +0 -54
  370. package/node_modules/color-convert/LICENSE +0 -21
  371. package/node_modules/color-convert/README.md +0 -68
  372. package/node_modules/color-convert/conversions.js +0 -839
  373. package/node_modules/color-convert/index.js +0 -81
  374. package/node_modules/color-convert/package.json +0 -48
  375. package/node_modules/color-convert/route.js +0 -97
  376. package/node_modules/color-name/LICENSE +0 -8
  377. package/node_modules/color-name/README.md +0 -11
  378. package/node_modules/color-name/index.js +0 -152
  379. package/node_modules/color-name/package.json +0 -28
  380. package/node_modules/emoji-regex/LICENSE-MIT.txt +0 -20
  381. package/node_modules/emoji-regex/README.md +0 -73
  382. package/node_modules/emoji-regex/es2015/index.js +0 -6
  383. package/node_modules/emoji-regex/es2015/text.js +0 -6
  384. package/node_modules/emoji-regex/index.d.ts +0 -23
  385. package/node_modules/emoji-regex/index.js +0 -6
  386. package/node_modules/emoji-regex/package.json +0 -50
  387. package/node_modules/emoji-regex/text.js +0 -6
  388. package/node_modules/escalade/dist/index.js +0 -22
  389. package/node_modules/escalade/dist/index.mjs +0 -22
  390. package/node_modules/escalade/index.d.mts +0 -11
  391. package/node_modules/escalade/index.d.ts +0 -15
  392. package/node_modules/escalade/license +0 -9
  393. package/node_modules/escalade/package.json +0 -74
  394. package/node_modules/escalade/readme.md +0 -211
  395. package/node_modules/escalade/sync/index.d.mts +0 -9
  396. package/node_modules/escalade/sync/index.d.ts +0 -13
  397. package/node_modules/escalade/sync/index.js +0 -18
  398. package/node_modules/escalade/sync/index.mjs +0 -18
  399. package/node_modules/esprima/ChangeLog +0 -235
  400. package/node_modules/get-caller-file/LICENSE.md +0 -6
  401. package/node_modules/get-caller-file/README.md +0 -41
  402. package/node_modules/get-caller-file/index.d.ts +0 -2
  403. package/node_modules/get-caller-file/index.js +0 -22
  404. package/node_modules/get-caller-file/index.js.map +0 -1
  405. package/node_modules/get-caller-file/package.json +0 -42
  406. package/node_modules/has-flag/index.d.ts +0 -39
  407. package/node_modules/has-flag/index.js +0 -8
  408. package/node_modules/has-flag/license +0 -9
  409. package/node_modules/has-flag/package.json +0 -46
  410. package/node_modules/has-flag/readme.md +0 -89
  411. package/node_modules/highlight.js/LICENSE +0 -29
  412. package/node_modules/highlight.js/README.md +0 -371
  413. package/node_modules/highlight.js/lib/core.js +0 -2517
  414. package/node_modules/highlight.js/lib/highlight.js +0 -2
  415. package/node_modules/highlight.js/lib/index.js +0 -195
  416. package/node_modules/highlight.js/lib/languages/1c.js +0 -521
  417. package/node_modules/highlight.js/lib/languages/abnf.js +0 -103
  418. package/node_modules/highlight.js/lib/languages/accesslog.js +0 -127
  419. package/node_modules/highlight.js/lib/languages/actionscript.js +0 -113
  420. package/node_modules/highlight.js/lib/languages/ada.js +0 -194
  421. package/node_modules/highlight.js/lib/languages/angelscript.js +0 -123
  422. package/node_modules/highlight.js/lib/languages/apache.js +0 -89
  423. package/node_modules/highlight.js/lib/languages/applescript.js +0 -189
  424. package/node_modules/highlight.js/lib/languages/arcade.js +0 -165
  425. package/node_modules/highlight.js/lib/languages/arduino.js +0 -576
  426. package/node_modules/highlight.js/lib/languages/armasm.js +0 -131
  427. package/node_modules/highlight.js/lib/languages/asciidoc.js +0 -303
  428. package/node_modules/highlight.js/lib/languages/aspectj.js +0 -186
  429. package/node_modules/highlight.js/lib/languages/autohotkey.js +0 -84
  430. package/node_modules/highlight.js/lib/languages/autoit.js +0 -183
  431. package/node_modules/highlight.js/lib/languages/avrasm.js +0 -80
  432. package/node_modules/highlight.js/lib/languages/awk.js +0 -73
  433. package/node_modules/highlight.js/lib/languages/axapta.js +0 -179
  434. package/node_modules/highlight.js/lib/languages/bash.js +0 -169
  435. package/node_modules/highlight.js/lib/languages/basic.js +0 -65
  436. package/node_modules/highlight.js/lib/languages/bnf.js +0 -38
  437. package/node_modules/highlight.js/lib/languages/brainfuck.js +0 -46
  438. package/node_modules/highlight.js/lib/languages/c-like.js +0 -501
  439. package/node_modules/highlight.js/lib/languages/c.js +0 -309
  440. package/node_modules/highlight.js/lib/languages/cal.js +0 -104
  441. package/node_modules/highlight.js/lib/languages/capnproto.js +0 -64
  442. package/node_modules/highlight.js/lib/languages/ceylon.js +0 -82
  443. package/node_modules/highlight.js/lib/languages/clean.js +0 -40
  444. package/node_modules/highlight.js/lib/languages/clojure-repl.js +0 -27
  445. package/node_modules/highlight.js/lib/languages/clojure.js +0 -158
  446. package/node_modules/highlight.js/lib/languages/cmake.js +0 -64
  447. package/node_modules/highlight.js/lib/languages/coffeescript.js +0 -356
  448. package/node_modules/highlight.js/lib/languages/coq.js +0 -79
  449. package/node_modules/highlight.js/lib/languages/cos.js +0 -138
  450. package/node_modules/highlight.js/lib/languages/cpp.js +0 -464
  451. package/node_modules/highlight.js/lib/languages/crmsh.js +0 -102
  452. package/node_modules/highlight.js/lib/languages/crystal.js +0 -326
  453. package/node_modules/highlight.js/lib/languages/csharp.js +0 -441
  454. package/node_modules/highlight.js/lib/languages/csp.js +0 -37
  455. package/node_modules/highlight.js/lib/languages/css.js +0 -608
  456. package/node_modules/highlight.js/lib/languages/d.js +0 -271
  457. package/node_modules/highlight.js/lib/languages/dart.js +0 -199
  458. package/node_modules/highlight.js/lib/languages/delphi.js +0 -126
  459. package/node_modules/highlight.js/lib/languages/diff.js +0 -85
  460. package/node_modules/highlight.js/lib/languages/django.js +0 -77
  461. package/node_modules/highlight.js/lib/languages/dns.js +0 -46
  462. package/node_modules/highlight.js/lib/languages/dockerfile.js +0 -34
  463. package/node_modules/highlight.js/lib/languages/dos.js +0 -70
  464. package/node_modules/highlight.js/lib/languages/dsconfig.js +0 -66
  465. package/node_modules/highlight.js/lib/languages/dts.js +0 -153
  466. package/node_modules/highlight.js/lib/languages/dust.js +0 -45
  467. package/node_modules/highlight.js/lib/languages/ebnf.js +0 -53
  468. package/node_modules/highlight.js/lib/languages/elixir.js +0 -259
  469. package/node_modules/highlight.js/lib/languages/elm.js +0 -129
  470. package/node_modules/highlight.js/lib/languages/erb.js +0 -29
  471. package/node_modules/highlight.js/lib/languages/erlang-repl.js +0 -86
  472. package/node_modules/highlight.js/lib/languages/erlang.js +0 -199
  473. package/node_modules/highlight.js/lib/languages/excel.js +0 -64
  474. package/node_modules/highlight.js/lib/languages/fix.js +0 -37
  475. package/node_modules/highlight.js/lib/languages/flix.js +0 -54
  476. package/node_modules/highlight.js/lib/languages/fortran.js +0 -159
  477. package/node_modules/highlight.js/lib/languages/fsharp.js +0 -86
  478. package/node_modules/highlight.js/lib/languages/gams.js +0 -208
  479. package/node_modules/highlight.js/lib/languages/gauss.js +0 -316
  480. package/node_modules/highlight.js/lib/languages/gcode.js +0 -88
  481. package/node_modules/highlight.js/lib/languages/gherkin.js +0 -49
  482. package/node_modules/highlight.js/lib/languages/glsl.js +0 -128
  483. package/node_modules/highlight.js/lib/languages/gml.js +0 -885
  484. package/node_modules/highlight.js/lib/languages/go.js +0 -74
  485. package/node_modules/highlight.js/lib/languages/golo.js +0 -33
  486. package/node_modules/highlight.js/lib/languages/gradle.js +0 -44
  487. package/node_modules/highlight.js/lib/languages/groovy.js +0 -174
  488. package/node_modules/highlight.js/lib/languages/haml.js +0 -117
  489. package/node_modules/highlight.js/lib/languages/handlebars.js +0 -324
  490. package/node_modules/highlight.js/lib/languages/haskell.js +0 -173
  491. package/node_modules/highlight.js/lib/languages/haxe.js +0 -157
  492. package/node_modules/highlight.js/lib/languages/hsp.js +0 -65
  493. package/node_modules/highlight.js/lib/languages/htmlbars.js +0 -352
  494. package/node_modules/highlight.js/lib/languages/http.js +0 -121
  495. package/node_modules/highlight.js/lib/languages/hy.js +0 -109
  496. package/node_modules/highlight.js/lib/languages/inform7.js +0 -70
  497. package/node_modules/highlight.js/lib/languages/ini.js +0 -173
  498. package/node_modules/highlight.js/lib/languages/irpf90.js +0 -141
  499. package/node_modules/highlight.js/lib/languages/isbl.js +0 -3207
  500. package/node_modules/highlight.js/lib/languages/java.js +0 -181
  501. package/node_modules/highlight.js/lib/languages/javascript.js +0 -604
  502. package/node_modules/highlight.js/lib/languages/jboss-cli.js +0 -63
  503. package/node_modules/highlight.js/lib/languages/json.js +0 -63
  504. package/node_modules/highlight.js/lib/languages/julia-repl.js +0 -50
  505. package/node_modules/highlight.js/lib/languages/julia.js +0 -416
  506. package/node_modules/highlight.js/lib/languages/kotlin.js +0 -284
  507. package/node_modules/highlight.js/lib/languages/lasso.js +0 -187
  508. package/node_modules/highlight.js/lib/languages/latex.js +0 -276
  509. package/node_modules/highlight.js/lib/languages/ldif.js +0 -42
  510. package/node_modules/highlight.js/lib/languages/leaf.js +0 -49
  511. package/node_modules/highlight.js/lib/languages/less.js +0 -666
  512. package/node_modules/highlight.js/lib/languages/lisp.js +0 -111
  513. package/node_modules/highlight.js/lib/languages/livecodeserver.js +0 -189
  514. package/node_modules/highlight.js/lib/languages/livescript.js +0 -374
  515. package/node_modules/highlight.js/lib/languages/llvm.js +0 -154
  516. package/node_modules/highlight.js/lib/languages/lsl.js +0 -95
  517. package/node_modules/highlight.js/lib/languages/lua.js +0 -82
  518. package/node_modules/highlight.js/lib/languages/makefile.js +0 -92
  519. package/node_modules/highlight.js/lib/languages/markdown.js +0 -258
  520. package/node_modules/highlight.js/lib/languages/mathematica.js +0 -6797
  521. package/node_modules/highlight.js/lib/languages/matlab.js +0 -106
  522. package/node_modules/highlight.js/lib/languages/maxima.js +0 -417
  523. package/node_modules/highlight.js/lib/languages/mel.js +0 -236
  524. package/node_modules/highlight.js/lib/languages/mercury.js +0 -121
  525. package/node_modules/highlight.js/lib/languages/mipsasm.js +0 -109
  526. package/node_modules/highlight.js/lib/languages/mizar.js +0 -29
  527. package/node_modules/highlight.js/lib/languages/mojolicious.js +0 -36
  528. package/node_modules/highlight.js/lib/languages/monkey.js +0 -89
  529. package/node_modules/highlight.js/lib/languages/moonscript.js +0 -147
  530. package/node_modules/highlight.js/lib/languages/n1ql.js +0 -77
  531. package/node_modules/highlight.js/lib/languages/nginx.js +0 -140
  532. package/node_modules/highlight.js/lib/languages/nim.js +0 -79
  533. package/node_modules/highlight.js/lib/languages/nix.js +0 -65
  534. package/node_modules/highlight.js/lib/languages/node-repl.js +0 -37
  535. package/node_modules/highlight.js/lib/languages/nsis.js +0 -119
  536. package/node_modules/highlight.js/lib/languages/objectivec.js +0 -121
  537. package/node_modules/highlight.js/lib/languages/ocaml.js +0 -82
  538. package/node_modules/highlight.js/lib/languages/openscad.js +0 -81
  539. package/node_modules/highlight.js/lib/languages/oxygene.js +0 -101
  540. package/node_modules/highlight.js/lib/languages/parser3.js +0 -57
  541. package/node_modules/highlight.js/lib/languages/perl.js +0 -515
  542. package/node_modules/highlight.js/lib/languages/pf.js +0 -59
  543. package/node_modules/highlight.js/lib/languages/pgsql.js +0 -630
  544. package/node_modules/highlight.js/lib/languages/php-template.js +0 -54
  545. package/node_modules/highlight.js/lib/languages/php.js +0 -204
  546. package/node_modules/highlight.js/lib/languages/plaintext.js +0 -19
  547. package/node_modules/highlight.js/lib/languages/pony.js +0 -89
  548. package/node_modules/highlight.js/lib/languages/powershell.js +0 -331
  549. package/node_modules/highlight.js/lib/languages/processing.js +0 -58
  550. package/node_modules/highlight.js/lib/languages/profile.js +0 -43
  551. package/node_modules/highlight.js/lib/languages/prolog.js +0 -102
  552. package/node_modules/highlight.js/lib/languages/properties.js +0 -85
  553. package/node_modules/highlight.js/lib/languages/protobuf.js +0 -47
  554. package/node_modules/highlight.js/lib/languages/puppet.js +0 -147
  555. package/node_modules/highlight.js/lib/languages/purebasic.js +0 -101
  556. package/node_modules/highlight.js/lib/languages/python-repl.js +0 -36
  557. package/node_modules/highlight.js/lib/languages/python.js +0 -446
  558. package/node_modules/highlight.js/lib/languages/q.js +0 -37
  559. package/node_modules/highlight.js/lib/languages/qml.js +0 -225
  560. package/node_modules/highlight.js/lib/languages/r.js +0 -231
  561. package/node_modules/highlight.js/lib/languages/reasonml.js +0 -321
  562. package/node_modules/highlight.js/lib/languages/rib.js +0 -37
  563. package/node_modules/highlight.js/lib/languages/roboconf.js +0 -82
  564. package/node_modules/highlight.js/lib/languages/routeros.js +0 -172
  565. package/node_modules/highlight.js/lib/languages/rsl.js +0 -49
  566. package/node_modules/highlight.js/lib/languages/ruby.js +0 -387
  567. package/node_modules/highlight.js/lib/languages/ruleslanguage.js +0 -78
  568. package/node_modules/highlight.js/lib/languages/rust.js +0 -146
  569. package/node_modules/highlight.js/lib/languages/sas.js +0 -133
  570. package/node_modules/highlight.js/lib/languages/scala.js +0 -140
  571. package/node_modules/highlight.js/lib/languages/scheme.js +0 -207
  572. package/node_modules/highlight.js/lib/languages/scilab.js +0 -73
  573. package/node_modules/highlight.js/lib/languages/scss.js +0 -545
  574. package/node_modules/highlight.js/lib/languages/shell.js +0 -30
  575. package/node_modules/highlight.js/lib/languages/smali.js +0 -135
  576. package/node_modules/highlight.js/lib/languages/smalltalk.js +0 -63
  577. package/node_modules/highlight.js/lib/languages/sml.js +0 -81
  578. package/node_modules/highlight.js/lib/languages/sqf.js +0 -448
  579. package/node_modules/highlight.js/lib/languages/sql.js +0 -699
  580. package/node_modules/highlight.js/lib/languages/sql_more.js +0 -183
  581. package/node_modules/highlight.js/lib/languages/stan.js +0 -548
  582. package/node_modules/highlight.js/lib/languages/stata.js +0 -60
  583. package/node_modules/highlight.js/lib/languages/step21.js +0 -66
  584. package/node_modules/highlight.js/lib/languages/stylus.js +0 -609
  585. package/node_modules/highlight.js/lib/languages/subunit.js +0 -51
  586. package/node_modules/highlight.js/lib/languages/swift.js +0 -873
  587. package/node_modules/highlight.js/lib/languages/taggerscript.js +0 -52
  588. package/node_modules/highlight.js/lib/languages/tap.js +0 -55
  589. package/node_modules/highlight.js/lib/languages/tcl.js +0 -115
  590. package/node_modules/highlight.js/lib/languages/thrift.js +0 -51
  591. package/node_modules/highlight.js/lib/languages/tp.js +0 -95
  592. package/node_modules/highlight.js/lib/languages/twig.js +0 -77
  593. package/node_modules/highlight.js/lib/languages/typescript.js +0 -697
  594. package/node_modules/highlight.js/lib/languages/vala.js +0 -61
  595. package/node_modules/highlight.js/lib/languages/vbnet.js +0 -214
  596. package/node_modules/highlight.js/lib/languages/vbscript-html.js +0 -24
  597. package/node_modules/highlight.js/lib/languages/vbscript.js +0 -109
  598. package/node_modules/highlight.js/lib/languages/verilog.js +0 -131
  599. package/node_modules/highlight.js/lib/languages/vhdl.js +0 -71
  600. package/node_modules/highlight.js/lib/languages/vim.js +0 -123
  601. package/node_modules/highlight.js/lib/languages/x86asm.js +0 -163
  602. package/node_modules/highlight.js/lib/languages/xl.js +0 -92
  603. package/node_modules/highlight.js/lib/languages/xml.js +0 -287
  604. package/node_modules/highlight.js/lib/languages/xquery.js +0 -197
  605. package/node_modules/highlight.js/lib/languages/yaml.js +0 -176
  606. package/node_modules/highlight.js/lib/languages/zephir.js +0 -140
  607. package/node_modules/highlight.js/package.json +0 -86
  608. package/node_modules/highlight.js/scss/a11y-dark.scss +0 -99
  609. package/node_modules/highlight.js/scss/a11y-light.scss +0 -99
  610. package/node_modules/highlight.js/scss/agate.scss +0 -108
  611. package/node_modules/highlight.js/scss/an-old-hope.scss +0 -89
  612. package/node_modules/highlight.js/scss/androidstudio.scss +0 -66
  613. package/node_modules/highlight.js/scss/arduino-light.scss +0 -87
  614. package/node_modules/highlight.js/scss/arta.scss +0 -73
  615. package/node_modules/highlight.js/scss/ascetic.scss +0 -45
  616. package/node_modules/highlight.js/scss/atelier-cave-dark.scss +0 -83
  617. package/node_modules/highlight.js/scss/atelier-cave-light.scss +0 -85
  618. package/node_modules/highlight.js/scss/atelier-dune-dark.scss +0 -69
  619. package/node_modules/highlight.js/scss/atelier-dune-light.scss +0 -69
  620. package/node_modules/highlight.js/scss/atelier-estuary-dark.scss +0 -84
  621. package/node_modules/highlight.js/scss/atelier-estuary-light.scss +0 -84
  622. package/node_modules/highlight.js/scss/atelier-forest-dark.scss +0 -69
  623. package/node_modules/highlight.js/scss/atelier-forest-light.scss +0 -69
  624. package/node_modules/highlight.js/scss/atelier-heath-dark.scss +0 -69
  625. package/node_modules/highlight.js/scss/atelier-heath-light.scss +0 -69
  626. package/node_modules/highlight.js/scss/atelier-lakeside-dark.scss +0 -69
  627. package/node_modules/highlight.js/scss/atelier-lakeside-light.scss +0 -69
  628. package/node_modules/highlight.js/scss/atelier-plateau-dark.scss +0 -84
  629. package/node_modules/highlight.js/scss/atelier-plateau-light.scss +0 -84
  630. package/node_modules/highlight.js/scss/atelier-savanna-dark.scss +0 -84
  631. package/node_modules/highlight.js/scss/atelier-savanna-light.scss +0 -84
  632. package/node_modules/highlight.js/scss/atelier-seaside-dark.scss +0 -69
  633. package/node_modules/highlight.js/scss/atelier-seaside-light.scss +0 -69
  634. package/node_modules/highlight.js/scss/atelier-sulphurpool-dark.scss +0 -69
  635. package/node_modules/highlight.js/scss/atelier-sulphurpool-light.scss +0 -69
  636. package/node_modules/highlight.js/scss/atom-one-dark-reasonable.scss +0 -75
  637. package/node_modules/highlight.js/scss/atom-one-dark.scss +0 -96
  638. package/node_modules/highlight.js/scss/atom-one-light.scss +0 -96
  639. package/node_modules/highlight.js/scss/brown-paper.scss +0 -64
  640. package/node_modules/highlight.js/scss/brown-papersq.png +0 -0
  641. package/node_modules/highlight.js/scss/codepen-embed.scss +0 -60
  642. package/node_modules/highlight.js/scss/color-brewer.scss +0 -71
  643. package/node_modules/highlight.js/scss/darcula.scss +0 -74
  644. package/node_modules/highlight.js/scss/dark.scss +0 -63
  645. package/node_modules/highlight.js/scss/default.scss +0 -99
  646. package/node_modules/highlight.js/scss/docco.scss +0 -97
  647. package/node_modules/highlight.js/scss/dracula.scss +0 -76
  648. package/node_modules/highlight.js/scss/far.scss +0 -71
  649. package/node_modules/highlight.js/scss/foundation.scss +0 -89
  650. package/node_modules/highlight.js/scss/github-gist.scss +0 -79
  651. package/node_modules/highlight.js/scss/github.scss +0 -99
  652. package/node_modules/highlight.js/scss/gml.scss +0 -78
  653. package/node_modules/highlight.js/scss/googlecode.scss +0 -89
  654. package/node_modules/highlight.js/scss/gradient-dark.scss +0 -122
  655. package/node_modules/highlight.js/scss/gradient-light.scss +0 -130
  656. package/node_modules/highlight.js/scss/grayscale.scss +0 -101
  657. package/node_modules/highlight.js/scss/gruvbox-dark.scss +0 -108
  658. package/node_modules/highlight.js/scss/gruvbox-light.scss +0 -108
  659. package/node_modules/highlight.js/scss/hopscotch.scss +0 -84
  660. package/node_modules/highlight.js/scss/hybrid.scss +0 -102
  661. package/node_modules/highlight.js/scss/idea.scss +0 -97
  662. package/node_modules/highlight.js/scss/ir-black.scss +0 -73
  663. package/node_modules/highlight.js/scss/isbl-editor-dark.scss +0 -112
  664. package/node_modules/highlight.js/scss/isbl-editor-light.scss +0 -111
  665. package/node_modules/highlight.js/scss/kimbie.dark.scss +0 -74
  666. package/node_modules/highlight.js/scss/kimbie.light.scss +0 -74
  667. package/node_modules/highlight.js/scss/lightfair.scss +0 -88
  668. package/node_modules/highlight.js/scss/lioshi.scss +0 -88
  669. package/node_modules/highlight.js/scss/magula.scss +0 -70
  670. package/node_modules/highlight.js/scss/mono-blue.scss +0 -56
  671. package/node_modules/highlight.js/scss/monokai-sublime.scss +0 -83
  672. package/node_modules/highlight.js/scss/monokai.scss +0 -71
  673. package/node_modules/highlight.js/scss/night-owl.scss +0 -182
  674. package/node_modules/highlight.js/scss/nnfx-dark.scss +0 -106
  675. package/node_modules/highlight.js/scss/nnfx.scss +0 -106
  676. package/node_modules/highlight.js/scss/nord.scss +0 -309
  677. package/node_modules/highlight.js/scss/obsidian.scss +0 -88
  678. package/node_modules/highlight.js/scss/ocean.scss +0 -74
  679. package/node_modules/highlight.js/scss/paraiso-dark.scss +0 -72
  680. package/node_modules/highlight.js/scss/paraiso-light.scss +0 -72
  681. package/node_modules/highlight.js/scss/pojoaque.jpg +0 -0
  682. package/node_modules/highlight.js/scss/pojoaque.scss +0 -83
  683. package/node_modules/highlight.js/scss/purebasic.scss +0 -96
  684. package/node_modules/highlight.js/scss/qtcreator_dark.scss +0 -83
  685. package/node_modules/highlight.js/scss/qtcreator_light.scss +0 -83
  686. package/node_modules/highlight.js/scss/railscasts.scss +0 -106
  687. package/node_modules/highlight.js/scss/rainbow.scss +0 -85
  688. package/node_modules/highlight.js/scss/routeros.scss +0 -108
  689. package/node_modules/highlight.js/scss/school-book.png +0 -0
  690. package/node_modules/highlight.js/scss/school-book.scss +0 -69
  691. package/node_modules/highlight.js/scss/shades-of-purple.scss +0 -96
  692. package/node_modules/highlight.js/scss/solarized-dark.scss +0 -84
  693. package/node_modules/highlight.js/scss/solarized-light.scss +0 -84
  694. package/node_modules/highlight.js/scss/srcery.scss +0 -78
  695. package/node_modules/highlight.js/scss/stackoverflow-dark.scss +0 -78
  696. package/node_modules/highlight.js/scss/stackoverflow-light.scss +0 -78
  697. package/node_modules/highlight.js/scss/sunburst.scss +0 -102
  698. package/node_modules/highlight.js/scss/tomorrow-night-blue.scss +0 -75
  699. package/node_modules/highlight.js/scss/tomorrow-night-bright.scss +0 -74
  700. package/node_modules/highlight.js/scss/tomorrow-night-eighties.scss +0 -74
  701. package/node_modules/highlight.js/scss/tomorrow-night.scss +0 -75
  702. package/node_modules/highlight.js/scss/tomorrow.scss +0 -72
  703. package/node_modules/highlight.js/scss/vs.scss +0 -68
  704. package/node_modules/highlight.js/scss/vs2015.scss +0 -115
  705. package/node_modules/highlight.js/scss/xcode.scss +0 -104
  706. package/node_modules/highlight.js/scss/xt256.scss +0 -92
  707. package/node_modules/highlight.js/scss/zenburn.scss +0 -80
  708. package/node_modules/highlight.js/styles/a11y-dark.css +0 -99
  709. package/node_modules/highlight.js/styles/a11y-light.css +0 -99
  710. package/node_modules/highlight.js/styles/agate.css +0 -108
  711. package/node_modules/highlight.js/styles/an-old-hope.css +0 -89
  712. package/node_modules/highlight.js/styles/androidstudio.css +0 -66
  713. package/node_modules/highlight.js/styles/arduino-light.css +0 -87
  714. package/node_modules/highlight.js/styles/arta.css +0 -73
  715. package/node_modules/highlight.js/styles/ascetic.css +0 -45
  716. package/node_modules/highlight.js/styles/atelier-cave-dark.css +0 -83
  717. package/node_modules/highlight.js/styles/atelier-cave-light.css +0 -85
  718. package/node_modules/highlight.js/styles/atelier-dune-dark.css +0 -69
  719. package/node_modules/highlight.js/styles/atelier-dune-light.css +0 -69
  720. package/node_modules/highlight.js/styles/atelier-estuary-dark.css +0 -84
  721. package/node_modules/highlight.js/styles/atelier-estuary-light.css +0 -84
  722. package/node_modules/highlight.js/styles/atelier-forest-dark.css +0 -69
  723. package/node_modules/highlight.js/styles/atelier-forest-light.css +0 -69
  724. package/node_modules/highlight.js/styles/atelier-heath-dark.css +0 -69
  725. package/node_modules/highlight.js/styles/atelier-heath-light.css +0 -69
  726. package/node_modules/highlight.js/styles/atelier-lakeside-dark.css +0 -69
  727. package/node_modules/highlight.js/styles/atelier-lakeside-light.css +0 -69
  728. package/node_modules/highlight.js/styles/atelier-plateau-dark.css +0 -84
  729. package/node_modules/highlight.js/styles/atelier-plateau-light.css +0 -84
  730. package/node_modules/highlight.js/styles/atelier-savanna-dark.css +0 -84
  731. package/node_modules/highlight.js/styles/atelier-savanna-light.css +0 -84
  732. package/node_modules/highlight.js/styles/atelier-seaside-dark.css +0 -69
  733. package/node_modules/highlight.js/styles/atelier-seaside-light.css +0 -69
  734. package/node_modules/highlight.js/styles/atelier-sulphurpool-dark.css +0 -69
  735. package/node_modules/highlight.js/styles/atelier-sulphurpool-light.css +0 -69
  736. package/node_modules/highlight.js/styles/atom-one-dark-reasonable.css +0 -75
  737. package/node_modules/highlight.js/styles/atom-one-dark.css +0 -96
  738. package/node_modules/highlight.js/styles/atom-one-light.css +0 -96
  739. package/node_modules/highlight.js/styles/brown-paper.css +0 -64
  740. package/node_modules/highlight.js/styles/brown-papersq.png +0 -0
  741. package/node_modules/highlight.js/styles/codepen-embed.css +0 -60
  742. package/node_modules/highlight.js/styles/color-brewer.css +0 -71
  743. package/node_modules/highlight.js/styles/darcula.css +0 -74
  744. package/node_modules/highlight.js/styles/dark.css +0 -63
  745. package/node_modules/highlight.js/styles/default.css +0 -99
  746. package/node_modules/highlight.js/styles/docco.css +0 -97
  747. package/node_modules/highlight.js/styles/dracula.css +0 -76
  748. package/node_modules/highlight.js/styles/far.css +0 -71
  749. package/node_modules/highlight.js/styles/foundation.css +0 -89
  750. package/node_modules/highlight.js/styles/github-gist.css +0 -79
  751. package/node_modules/highlight.js/styles/github.css +0 -99
  752. package/node_modules/highlight.js/styles/gml.css +0 -78
  753. package/node_modules/highlight.js/styles/googlecode.css +0 -89
  754. package/node_modules/highlight.js/styles/gradient-dark.css +0 -122
  755. package/node_modules/highlight.js/styles/gradient-light.css +0 -130
  756. package/node_modules/highlight.js/styles/grayscale.css +0 -101
  757. package/node_modules/highlight.js/styles/gruvbox-dark.css +0 -108
  758. package/node_modules/highlight.js/styles/gruvbox-light.css +0 -108
  759. package/node_modules/highlight.js/styles/hopscotch.css +0 -84
  760. package/node_modules/highlight.js/styles/hybrid.css +0 -102
  761. package/node_modules/highlight.js/styles/idea.css +0 -97
  762. package/node_modules/highlight.js/styles/ir-black.css +0 -73
  763. package/node_modules/highlight.js/styles/isbl-editor-dark.css +0 -112
  764. package/node_modules/highlight.js/styles/isbl-editor-light.css +0 -111
  765. package/node_modules/highlight.js/styles/kimbie.dark.css +0 -74
  766. package/node_modules/highlight.js/styles/kimbie.light.css +0 -74
  767. package/node_modules/highlight.js/styles/lightfair.css +0 -88
  768. package/node_modules/highlight.js/styles/lioshi.css +0 -88
  769. package/node_modules/highlight.js/styles/magula.css +0 -70
  770. package/node_modules/highlight.js/styles/mono-blue.css +0 -56
  771. package/node_modules/highlight.js/styles/monokai-sublime.css +0 -83
  772. package/node_modules/highlight.js/styles/monokai.css +0 -71
  773. package/node_modules/highlight.js/styles/night-owl.css +0 -182
  774. package/node_modules/highlight.js/styles/nnfx-dark.css +0 -106
  775. package/node_modules/highlight.js/styles/nnfx.css +0 -106
  776. package/node_modules/highlight.js/styles/nord.css +0 -309
  777. package/node_modules/highlight.js/styles/obsidian.css +0 -88
  778. package/node_modules/highlight.js/styles/ocean.css +0 -74
  779. package/node_modules/highlight.js/styles/paraiso-dark.css +0 -72
  780. package/node_modules/highlight.js/styles/paraiso-light.css +0 -72
  781. package/node_modules/highlight.js/styles/pojoaque.css +0 -83
  782. package/node_modules/highlight.js/styles/pojoaque.jpg +0 -0
  783. package/node_modules/highlight.js/styles/purebasic.css +0 -96
  784. package/node_modules/highlight.js/styles/qtcreator_dark.css +0 -83
  785. package/node_modules/highlight.js/styles/qtcreator_light.css +0 -83
  786. package/node_modules/highlight.js/styles/railscasts.css +0 -106
  787. package/node_modules/highlight.js/styles/rainbow.css +0 -85
  788. package/node_modules/highlight.js/styles/routeros.css +0 -108
  789. package/node_modules/highlight.js/styles/school-book.css +0 -69
  790. package/node_modules/highlight.js/styles/school-book.png +0 -0
  791. package/node_modules/highlight.js/styles/shades-of-purple.css +0 -96
  792. package/node_modules/highlight.js/styles/solarized-dark.css +0 -84
  793. package/node_modules/highlight.js/styles/solarized-light.css +0 -84
  794. package/node_modules/highlight.js/styles/srcery.css +0 -78
  795. package/node_modules/highlight.js/styles/stackoverflow-dark.css +0 -78
  796. package/node_modules/highlight.js/styles/stackoverflow-light.css +0 -78
  797. package/node_modules/highlight.js/styles/sunburst.css +0 -102
  798. package/node_modules/highlight.js/styles/tomorrow-night-blue.css +0 -75
  799. package/node_modules/highlight.js/styles/tomorrow-night-bright.css +0 -74
  800. package/node_modules/highlight.js/styles/tomorrow-night-eighties.css +0 -74
  801. package/node_modules/highlight.js/styles/tomorrow-night.css +0 -75
  802. package/node_modules/highlight.js/styles/tomorrow.css +0 -72
  803. package/node_modules/highlight.js/styles/vs.css +0 -68
  804. package/node_modules/highlight.js/styles/vs2015.css +0 -115
  805. package/node_modules/highlight.js/styles/xcode.css +0 -104
  806. package/node_modules/highlight.js/styles/xt256.css +0 -92
  807. package/node_modules/highlight.js/styles/zenburn.css +0 -80
  808. package/node_modules/highlight.js/types/index.d.ts +0 -261
  809. package/node_modules/is-fullwidth-code-point/index.d.ts +0 -17
  810. package/node_modules/is-fullwidth-code-point/index.js +0 -50
  811. package/node_modules/is-fullwidth-code-point/license +0 -9
  812. package/node_modules/is-fullwidth-code-point/package.json +0 -42
  813. package/node_modules/is-fullwidth-code-point/readme.md +0 -39
  814. package/node_modules/mz/HISTORY.md +0 -66
  815. package/node_modules/mz/LICENSE +0 -22
  816. package/node_modules/mz/README.md +0 -106
  817. package/node_modules/mz/child_process.js +0 -8
  818. package/node_modules/mz/crypto.js +0 -9
  819. package/node_modules/mz/dns.js +0 -16
  820. package/node_modules/mz/fs.js +0 -62
  821. package/node_modules/mz/index.js +0 -8
  822. package/node_modules/mz/package.json +0 -44
  823. package/node_modules/mz/readline.js +0 -64
  824. package/node_modules/mz/zlib.js +0 -13
  825. package/node_modules/object-assign/index.js +0 -90
  826. package/node_modules/object-assign/license +0 -21
  827. package/node_modules/object-assign/package.json +0 -42
  828. package/node_modules/object-assign/readme.md +0 -61
  829. package/node_modules/parse5/LICENSE +0 -19
  830. package/node_modules/parse5/README.md +0 -38
  831. package/node_modules/parse5/lib/common/doctype.js +0 -162
  832. package/node_modules/parse5/lib/common/error-codes.js +0 -65
  833. package/node_modules/parse5/lib/common/foreign-content.js +0 -265
  834. package/node_modules/parse5/lib/common/html.js +0 -272
  835. package/node_modules/parse5/lib/common/unicode.js +0 -109
  836. package/node_modules/parse5/lib/extensions/error-reporting/mixin-base.js +0 -43
  837. package/node_modules/parse5/lib/extensions/error-reporting/parser-mixin.js +0 -52
  838. package/node_modules/parse5/lib/extensions/error-reporting/preprocessor-mixin.js +0 -24
  839. package/node_modules/parse5/lib/extensions/error-reporting/tokenizer-mixin.js +0 -17
  840. package/node_modules/parse5/lib/extensions/location-info/open-element-stack-mixin.js +0 -35
  841. package/node_modules/parse5/lib/extensions/location-info/parser-mixin.js +0 -222
  842. package/node_modules/parse5/lib/extensions/location-info/tokenizer-mixin.js +0 -146
  843. package/node_modules/parse5/lib/extensions/position-tracking/preprocessor-mixin.js +0 -64
  844. package/node_modules/parse5/lib/index.js +0 -29
  845. package/node_modules/parse5/lib/parser/formatting-element-list.js +0 -181
  846. package/node_modules/parse5/lib/parser/index.js +0 -2956
  847. package/node_modules/parse5/lib/parser/open-element-stack.js +0 -482
  848. package/node_modules/parse5/lib/serializer/index.js +0 -176
  849. package/node_modules/parse5/lib/tokenizer/index.js +0 -2196
  850. package/node_modules/parse5/lib/tokenizer/named-entity-data.js +0 -5
  851. package/node_modules/parse5/lib/tokenizer/preprocessor.js +0 -159
  852. package/node_modules/parse5/lib/tree-adapters/default.js +0 -217
  853. package/node_modules/parse5/lib/utils/merge-options.js +0 -13
  854. package/node_modules/parse5/lib/utils/mixin.js +0 -39
  855. package/node_modules/parse5/package.json +0 -35
  856. package/node_modules/parse5-htmlparser2-tree-adapter/LICENSE +0 -19
  857. package/node_modules/parse5-htmlparser2-tree-adapter/README.md +0 -34
  858. package/node_modules/parse5-htmlparser2-tree-adapter/lib/index.js +0 -348
  859. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/LICENSE +0 -19
  860. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/README.md +0 -38
  861. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/doctype.js +0 -162
  862. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/error-codes.js +0 -65
  863. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/foreign-content.js +0 -265
  864. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/html.js +0 -272
  865. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/unicode.js +0 -109
  866. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/error-reporting/mixin-base.js +0 -43
  867. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/error-reporting/parser-mixin.js +0 -52
  868. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/error-reporting/preprocessor-mixin.js +0 -24
  869. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/error-reporting/tokenizer-mixin.js +0 -17
  870. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/location-info/open-element-stack-mixin.js +0 -35
  871. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/location-info/parser-mixin.js +0 -223
  872. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/location-info/tokenizer-mixin.js +0 -146
  873. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/position-tracking/preprocessor-mixin.js +0 -64
  874. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/index.js +0 -29
  875. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/parser/formatting-element-list.js +0 -181
  876. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/parser/index.js +0 -2956
  877. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/parser/open-element-stack.js +0 -482
  878. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/serializer/index.js +0 -176
  879. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/tokenizer/index.js +0 -2196
  880. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/tokenizer/named-entity-data.js +0 -5
  881. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/tokenizer/preprocessor.js +0 -159
  882. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/tree-adapters/default.js +0 -221
  883. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/utils/merge-options.js +0 -13
  884. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/utils/mixin.js +0 -39
  885. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/package.json +0 -35
  886. package/node_modules/parse5-htmlparser2-tree-adapter/package.json +0 -27
  887. package/node_modules/proper-lockfile/CHANGELOG.md +0 -108
  888. package/node_modules/require-directory/.jshintrc +0 -67
  889. package/node_modules/require-directory/.npmignore +0 -1
  890. package/node_modules/require-directory/.travis.yml +0 -3
  891. package/node_modules/require-directory/LICENSE +0 -22
  892. package/node_modules/require-directory/README.markdown +0 -184
  893. package/node_modules/require-directory/index.js +0 -86
  894. package/node_modules/require-directory/package.json +0 -40
  895. package/node_modules/source-map/CHANGELOG.md +0 -301
  896. package/node_modules/string-width/index.d.ts +0 -29
  897. package/node_modules/string-width/index.js +0 -47
  898. package/node_modules/string-width/license +0 -9
  899. package/node_modules/string-width/node_modules/ansi-regex/index.d.ts +0 -37
  900. package/node_modules/string-width/node_modules/ansi-regex/index.js +0 -10
  901. package/node_modules/string-width/node_modules/ansi-regex/license +0 -9
  902. package/node_modules/string-width/node_modules/ansi-regex/package.json +0 -55
  903. package/node_modules/string-width/node_modules/ansi-regex/readme.md +0 -78
  904. package/node_modules/string-width/node_modules/strip-ansi/index.d.ts +0 -17
  905. package/node_modules/string-width/node_modules/strip-ansi/index.js +0 -4
  906. package/node_modules/string-width/node_modules/strip-ansi/license +0 -9
  907. package/node_modules/string-width/node_modules/strip-ansi/package.json +0 -54
  908. package/node_modules/string-width/node_modules/strip-ansi/readme.md +0 -46
  909. package/node_modules/string-width/package.json +0 -56
  910. package/node_modules/string-width/readme.md +0 -50
  911. package/node_modules/supports-color/browser.js +0 -5
  912. package/node_modules/supports-color/index.js +0 -135
  913. package/node_modules/supports-color/license +0 -9
  914. package/node_modules/supports-color/package.json +0 -53
  915. package/node_modules/supports-color/readme.md +0 -76
  916. package/node_modules/thenify/History.md +0 -11
  917. package/node_modules/thenify/LICENSE +0 -22
  918. package/node_modules/thenify/README.md +0 -120
  919. package/node_modules/thenify/index.js +0 -77
  920. package/node_modules/thenify/package.json +0 -31
  921. package/node_modules/thenify-all/History.md +0 -11
  922. package/node_modules/thenify-all/LICENSE +0 -22
  923. package/node_modules/thenify-all/README.md +0 -66
  924. package/node_modules/thenify-all/index.js +0 -73
  925. package/node_modules/thenify-all/package.json +0 -34
  926. package/node_modules/wrap-ansi/index.js +0 -216
  927. package/node_modules/wrap-ansi/license +0 -9
  928. package/node_modules/wrap-ansi/node_modules/ansi-regex/index.d.ts +0 -37
  929. package/node_modules/wrap-ansi/node_modules/ansi-regex/index.js +0 -10
  930. package/node_modules/wrap-ansi/node_modules/ansi-regex/license +0 -9
  931. package/node_modules/wrap-ansi/node_modules/ansi-regex/package.json +0 -55
  932. package/node_modules/wrap-ansi/node_modules/ansi-regex/readme.md +0 -78
  933. package/node_modules/wrap-ansi/node_modules/strip-ansi/index.d.ts +0 -17
  934. package/node_modules/wrap-ansi/node_modules/strip-ansi/index.js +0 -4
  935. package/node_modules/wrap-ansi/node_modules/strip-ansi/license +0 -9
  936. package/node_modules/wrap-ansi/node_modules/strip-ansi/package.json +0 -54
  937. package/node_modules/wrap-ansi/node_modules/strip-ansi/readme.md +0 -46
  938. package/node_modules/wrap-ansi/package.json +0 -62
  939. package/node_modules/wrap-ansi/readme.md +0 -91
  940. package/node_modules/y18n/CHANGELOG.md +0 -100
  941. package/node_modules/y18n/LICENSE +0 -13
  942. package/node_modules/y18n/README.md +0 -127
  943. package/node_modules/y18n/build/index.cjs +0 -203
  944. package/node_modules/y18n/build/lib/cjs.js +0 -6
  945. package/node_modules/y18n/build/lib/index.js +0 -174
  946. package/node_modules/y18n/build/lib/platform-shims/node.js +0 -19
  947. package/node_modules/y18n/index.mjs +0 -8
  948. package/node_modules/y18n/package.json +0 -70
  949. package/node_modules/yargs/CHANGELOG.md +0 -88
  950. package/node_modules/yargs/LICENSE +0 -21
  951. package/node_modules/yargs/README.md +0 -202
  952. package/node_modules/yargs/browser.mjs +0 -7
  953. package/node_modules/yargs/build/index.cjs +0 -2920
  954. package/node_modules/yargs/build/lib/argsert.js +0 -62
  955. package/node_modules/yargs/build/lib/command.js +0 -382
  956. package/node_modules/yargs/build/lib/completion-templates.js +0 -47
  957. package/node_modules/yargs/build/lib/completion.js +0 -128
  958. package/node_modules/yargs/build/lib/middleware.js +0 -53
  959. package/node_modules/yargs/build/lib/parse-command.js +0 -32
  960. package/node_modules/yargs/build/lib/typings/common-types.js +0 -9
  961. package/node_modules/yargs/build/lib/typings/yargs-parser-types.js +0 -1
  962. package/node_modules/yargs/build/lib/usage.js +0 -548
  963. package/node_modules/yargs/build/lib/utils/apply-extends.js +0 -59
  964. package/node_modules/yargs/build/lib/utils/is-promise.js +0 -5
  965. package/node_modules/yargs/build/lib/utils/levenshtein.js +0 -26
  966. package/node_modules/yargs/build/lib/utils/obj-filter.js +0 -10
  967. package/node_modules/yargs/build/lib/utils/process-argv.js +0 -17
  968. package/node_modules/yargs/build/lib/utils/set-blocking.js +0 -12
  969. package/node_modules/yargs/build/lib/utils/which-module.js +0 -10
  970. package/node_modules/yargs/build/lib/validation.js +0 -308
  971. package/node_modules/yargs/build/lib/yargs-factory.js +0 -1143
  972. package/node_modules/yargs/build/lib/yerror.js +0 -7
  973. package/node_modules/yargs/helpers/helpers.mjs +0 -10
  974. package/node_modules/yargs/helpers/index.js +0 -14
  975. package/node_modules/yargs/helpers/package.json +0 -3
  976. package/node_modules/yargs/index.cjs +0 -39
  977. package/node_modules/yargs/index.mjs +0 -8
  978. package/node_modules/yargs/lib/platform-shims/browser.mjs +0 -92
  979. package/node_modules/yargs/lib/platform-shims/esm.mjs +0 -67
  980. package/node_modules/yargs/locales/be.json +0 -46
  981. package/node_modules/yargs/locales/de.json +0 -46
  982. package/node_modules/yargs/locales/en.json +0 -51
  983. package/node_modules/yargs/locales/es.json +0 -46
  984. package/node_modules/yargs/locales/fi.json +0 -49
  985. package/node_modules/yargs/locales/fr.json +0 -53
  986. package/node_modules/yargs/locales/hi.json +0 -49
  987. package/node_modules/yargs/locales/hu.json +0 -46
  988. package/node_modules/yargs/locales/id.json +0 -50
  989. package/node_modules/yargs/locales/it.json +0 -46
  990. package/node_modules/yargs/locales/ja.json +0 -51
  991. package/node_modules/yargs/locales/ko.json +0 -49
  992. package/node_modules/yargs/locales/nb.json +0 -44
  993. package/node_modules/yargs/locales/nl.json +0 -49
  994. package/node_modules/yargs/locales/nn.json +0 -44
  995. package/node_modules/yargs/locales/pirate.json +0 -13
  996. package/node_modules/yargs/locales/pl.json +0 -49
  997. package/node_modules/yargs/locales/pt.json +0 -45
  998. package/node_modules/yargs/locales/pt_BR.json +0 -48
  999. package/node_modules/yargs/locales/ru.json +0 -46
  1000. package/node_modules/yargs/locales/th.json +0 -46
  1001. package/node_modules/yargs/locales/tr.json +0 -48
  1002. package/node_modules/yargs/locales/zh_CN.json +0 -48
  1003. package/node_modules/yargs/locales/zh_TW.json +0 -47
  1004. package/node_modules/yargs/package.json +0 -122
  1005. package/node_modules/yargs/yargs +0 -9
  1006. package/node_modules/yargs-parser/CHANGELOG.md +0 -263
  1007. package/node_modules/yargs-parser/LICENSE.txt +0 -14
  1008. package/node_modules/yargs-parser/README.md +0 -518
  1009. package/node_modules/yargs-parser/browser.js +0 -29
  1010. package/node_modules/yargs-parser/build/index.cjs +0 -1042
  1011. package/node_modules/yargs-parser/build/lib/index.js +0 -59
  1012. package/node_modules/yargs-parser/build/lib/string-utils.js +0 -65
  1013. package/node_modules/yargs-parser/build/lib/tokenize-arg-string.js +0 -40
  1014. package/node_modules/yargs-parser/build/lib/yargs-parser-types.js +0 -12
  1015. package/node_modules/yargs-parser/build/lib/yargs-parser.js +0 -1037
  1016. package/node_modules/yargs-parser/package.json +0 -87
@@ -1 +1 @@
1
- {"version":3,"file":"find.js","sourceRoot":"","sources":["../../../src/core/tools/find.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAyB,YAAY,EAAE,MAAM,eAAe,CAAC;AAEnG,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC;IAC9B,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC;QACpB,WAAW,EAAE,8EAA8E;KAC3F,CAAC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C,UAAU,GAAG,UAAU,CAAC;wBACjC,CAAC;wBAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;4BACxB,YAAY,IAAI,QAAQ,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;wBAC/C,CAAC;wBAED,OAAO,CAAC;4BACP,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;4BAC/C,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;yBAC9D,CAAC,CAAC;oBACJ,CAAC;oBAAC,OAAO,CAAM,EAAE,CAAC;wBACjB,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;wBAC9C,MAAM,CAAC,CAAC,CAAC,CAAC;oBACX,CAAC;gBACF,CAAC,CAAC,EAAE,CAAC;YACN,CAAC,CAAC,CAAC;QACJ,CAAC;KACD,CAAC;AACH,CAAC;AAED,0EAA0E;AAC1E,MAAM,CAAC,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC","sourcesContent":["import type { AgentTool } from \"@gsd/pi-agent-core\";\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport { spawnSync } from \"child_process\";\nimport { existsSync } from \"fs\";\nimport { globSync } from \"glob\";\nimport path from \"path\";\nimport { ensureTool } from \"../../utils/tools-manager.js\";\nimport { resolveToCwd } from \"./path-utils.js\";\nimport { DEFAULT_MAX_BYTES, formatSize, type TruncationResult, truncateHead } from \"./truncate.js\";\n\nconst findSchema = Type.Object({\n\tpattern: Type.String({\n\t\tdescription: \"Glob pattern to match files, e.g. '*.ts', '**/*.json', or 'src/**/*.spec.ts'\",\n\t}),\n\tpath: Type.Optional(Type.String({ description: \"Directory to search in (default: current directory)\" })),\n\tlimit: Type.Optional(Type.Number({ description: \"Maximum number of results (default: 1000)\" })),\n});\n\nexport type FindToolInput = Static<typeof findSchema>;\n\nconst DEFAULT_LIMIT = 1000;\n\nexport interface FindToolDetails {\n\ttruncation?: TruncationResult;\n\tresultLimitReached?: number;\n}\n\n/**\n * Pluggable operations for the find tool.\n * Override these to delegate file search to remote systems (e.g., SSH).\n */\nexport interface FindOperations {\n\t/** Check if path exists */\n\texists: (absolutePath: string) => Promise<boolean> | boolean;\n\t/** Find files matching glob pattern. Returns relative paths. */\n\tglob: (pattern: string, cwd: string, options: { ignore: string[]; limit: number }) => Promise<string[]> | string[];\n}\n\nconst defaultFindOperations: FindOperations = {\n\texists: existsSync,\n\tglob: (_pattern, _searchCwd, _options) => {\n\t\t// This is a placeholder - actual fd execution happens in execute\n\t\treturn [];\n\t},\n};\n\nexport interface FindToolOptions {\n\t/** Custom operations for find. Default: local filesystem + fd */\n\toperations?: FindOperations;\n}\n\nexport function createFindTool(cwd: string, options?: FindToolOptions): AgentTool<typeof findSchema> {\n\tconst customOps = options?.operations;\n\n\treturn {\n\t\tname: \"find\",\n\t\tlabel: \"find\",\n\t\tdescription: `Search for files by glob pattern. Returns matching file paths relative to the search directory. Respects .gitignore. Output is truncated to ${DEFAULT_LIMIT} results or ${DEFAULT_MAX_BYTES / 1024}KB (whichever is hit first).`,\n\t\tparameters: findSchema,\n\t\texecute: async (\n\t\t\t_toolCallId: string,\n\t\t\t{ pattern, path: searchDir, limit }: { pattern: string; path?: string; limit?: number },\n\t\t\tsignal?: AbortSignal,\n\t\t) => {\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\treject(new Error(\"Operation aborted\"));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst onAbort = () => reject(new Error(\"Operation aborted\"));\n\t\t\t\tsignal?.addEventListener(\"abort\", onAbort, { once: true });\n\n\t\t\t\t(async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst searchPath = resolveToCwd(searchDir || \".\", cwd);\n\t\t\t\t\t\tconst effectiveLimit = limit ?? DEFAULT_LIMIT;\n\t\t\t\t\t\tconst ops = customOps ?? defaultFindOperations;\n\n\t\t\t\t\t\t// If custom operations provided with glob, use that\n\t\t\t\t\t\tif (customOps?.glob) {\n\t\t\t\t\t\t\tif (!(await ops.exists(searchPath))) {\n\t\t\t\t\t\t\t\treject(new Error(`Path not found: ${searchPath}`));\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst results = await ops.glob(pattern, searchPath, {\n\t\t\t\t\t\t\t\tignore: [\"**/node_modules/**\", \"**/.git/**\"],\n\t\t\t\t\t\t\t\tlimit: effectiveLimit,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\n\t\t\t\t\t\t\tif (results.length === 0) {\n\t\t\t\t\t\t\t\tresolve({\n\t\t\t\t\t\t\t\t\tcontent: [{ type: \"text\", text: \"No files found matching pattern\" }],\n\t\t\t\t\t\t\t\t\tdetails: undefined,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Relativize paths\n\t\t\t\t\t\t\tconst relativized = results.map((p) => {\n\t\t\t\t\t\t\t\tif (p.startsWith(searchPath)) {\n\t\t\t\t\t\t\t\t\treturn p.slice(searchPath.length + 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn path.relative(searchPath, p);\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tconst resultLimitReached = relativized.length >= effectiveLimit;\n\t\t\t\t\t\t\tconst rawOutput = relativized.join(\"\\n\");\n\t\t\t\t\t\t\tconst truncation = truncateHead(rawOutput, { maxLines: Number.MAX_SAFE_INTEGER });\n\n\t\t\t\t\t\t\tlet resultOutput = truncation.content;\n\t\t\t\t\t\t\tconst details: FindToolDetails = {};\n\t\t\t\t\t\t\tconst notices: string[] = [];\n\n\t\t\t\t\t\t\tif (resultLimitReached) {\n\t\t\t\t\t\t\t\tnotices.push(`${effectiveLimit} results limit reached`);\n\t\t\t\t\t\t\t\tdetails.resultLimitReached = effectiveLimit;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (truncation.truncated) {\n\t\t\t\t\t\t\t\tnotices.push(`${formatSize(DEFAULT_MAX_BYTES)} limit reached`);\n\t\t\t\t\t\t\t\tdetails.truncation = truncation;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (notices.length > 0) {\n\t\t\t\t\t\t\t\tresultOutput += `\\n\\n[${notices.join(\". \")}]`;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tresolve({\n\t\t\t\t\t\t\t\tcontent: [{ type: \"text\", text: resultOutput }],\n\t\t\t\t\t\t\t\tdetails: Object.keys(details).length > 0 ? details : undefined,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Default: use fd\n\t\t\t\t\t\tconst fdPath = await ensureTool(\"fd\", true);\n\t\t\t\t\t\tif (!fdPath) {\n\t\t\t\t\t\t\treject(new Error(\"fd is not available and could not be downloaded\"));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Build fd arguments\n\t\t\t\t\t\tconst args: string[] = [\n\t\t\t\t\t\t\t\"--glob\",\n\t\t\t\t\t\t\t\"--color=never\",\n\t\t\t\t\t\t\t\"--hidden\",\n\t\t\t\t\t\t\t\"--max-results\",\n\t\t\t\t\t\t\tString(effectiveLimit),\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\t// Include .gitignore files\n\t\t\t\t\t\tconst gitignoreFiles = new Set<string>();\n\t\t\t\t\t\tconst rootGitignore = path.join(searchPath, \".gitignore\");\n\t\t\t\t\t\tif (existsSync(rootGitignore)) {\n\t\t\t\t\t\t\tgitignoreFiles.add(rootGitignore);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst nestedGitignores = globSync(\"**/.gitignore\", {\n\t\t\t\t\t\t\t\tcwd: searchPath,\n\t\t\t\t\t\t\t\tdot: true,\n\t\t\t\t\t\t\t\tabsolute: true,\n\t\t\t\t\t\t\t\tignore: [\"**/node_modules/**\", \"**/.git/**\"],\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tfor (const file of nestedGitignores) {\n\t\t\t\t\t\t\t\tgitignoreFiles.add(file);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t// Ignore glob errors\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (const gitignorePath of gitignoreFiles) {\n\t\t\t\t\t\t\targs.push(\"--ignore-file\", gitignorePath);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\targs.push(pattern, searchPath);\n\n\t\t\t\t\t\tconst result = spawnSync(fdPath, args, {\n\t\t\t\t\t\t\tencoding: \"utf-8\",\n\t\t\t\t\t\t\tmaxBuffer: 10 * 1024 * 1024,\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\n\t\t\t\t\t\tif (result.error) {\n\t\t\t\t\t\t\treject(new Error(`Failed to run fd: ${result.error.message}`));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst output = result.stdout?.trim() || \"\";\n\n\t\t\t\t\t\tif (result.status !== 0) {\n\t\t\t\t\t\t\tconst errorMsg = result.stderr?.trim() || `fd exited with code ${result.status}`;\n\t\t\t\t\t\t\tif (!output) {\n\t\t\t\t\t\t\t\treject(new Error(errorMsg));\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!output) {\n\t\t\t\t\t\t\tresolve({\n\t\t\t\t\t\t\t\tcontent: [{ type: \"text\", text: \"No files found matching pattern\" }],\n\t\t\t\t\t\t\t\tdetails: undefined,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst lines = output.split(\"\\n\");\n\t\t\t\t\t\tconst relativized: string[] = [];\n\n\t\t\t\t\t\tfor (const rawLine of lines) {\n\t\t\t\t\t\t\tconst line = rawLine.replace(/\\r$/, \"\").trim();\n\t\t\t\t\t\t\tif (!line) continue;\n\n\t\t\t\t\t\t\tconst hadTrailingSlash = line.endsWith(\"/\") || line.endsWith(\"\\\\\");\n\t\t\t\t\t\t\tlet relativePath = line;\n\t\t\t\t\t\t\tif (line.startsWith(searchPath)) {\n\t\t\t\t\t\t\t\trelativePath = line.slice(searchPath.length + 1);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trelativePath = path.relative(searchPath, line);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (hadTrailingSlash && !relativePath.endsWith(\"/\")) {\n\t\t\t\t\t\t\t\trelativePath += \"/\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\trelativized.push(relativePath);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst resultLimitReached = relativized.length >= effectiveLimit;\n\t\t\t\t\t\tconst rawOutput = relativized.join(\"\\n\");\n\t\t\t\t\t\tconst truncation = truncateHead(rawOutput, { maxLines: Number.MAX_SAFE_INTEGER });\n\n\t\t\t\t\t\tlet resultOutput = truncation.content;\n\t\t\t\t\t\tconst details: FindToolDetails = {};\n\t\t\t\t\t\tconst notices: string[] = [];\n\n\t\t\t\t\t\tif (resultLimitReached) {\n\t\t\t\t\t\t\tnotices.push(\n\t\t\t\t\t\t\t\t`${effectiveLimit} results limit reached. Use limit=${effectiveLimit * 2} for more, or refine pattern`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tdetails.resultLimitReached = effectiveLimit;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (truncation.truncated) {\n\t\t\t\t\t\t\tnotices.push(`${formatSize(DEFAULT_MAX_BYTES)} limit reached`);\n\t\t\t\t\t\t\tdetails.truncation = truncation;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (notices.length > 0) {\n\t\t\t\t\t\t\tresultOutput += `\\n\\n[${notices.join(\". \")}]`;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tresolve({\n\t\t\t\t\t\t\tcontent: [{ type: \"text\", text: resultOutput }],\n\t\t\t\t\t\t\tdetails: Object.keys(details).length > 0 ? details : undefined,\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch (e: any) {\n\t\t\t\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\t\t\t\t\treject(e);\n\t\t\t\t\t}\n\t\t\t\t})();\n\t\t\t});\n\t\t},\n\t};\n}\n\n/** Default find tool using process.cwd() - for backwards compatibility */\nexport const findTool = createFindTool(process.cwd());\n"]}
1
+ {"version":3,"file":"find.js","sourceRoot":"","sources":["../../../src/core/tools/find.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAyB,YAAY,EAAE,MAAM,eAAe,CAAC;AAEnG,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC;IAC9B,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC;QACpB,WAAW,EAAE,8EAA8E;KAC3F,CAAC;IACF,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,qDAAqD,EAAE,CAAC,CAAC;IACxG,KAAK,EAAE,IAAI,CAAC,QAAQ,C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IAAI,QAAQ,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;wBAC/C,CAAC;wBAED,OAAO,CAAC;4BACP,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;4BAC/C,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;yBAC9D,CAAC,CAAC;oBACJ,CAAC;oBAAC,OAAO,CAAM,EAAE,CAAC;wBACjB,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;wBAC9C,MAAM,CAAC,CAAC,CAAC,CAAC;oBACX,CAAC;gBACF,CAAC,CAAC,EAAE,CAAC;YACN,CAAC,CAAC,CAAC;QACJ,CAAC;KACD,CAAC;AACH,CAAC;AAED,0EAA0E;AAC1E,MAAM,CAAC,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC","sourcesContent":["import type { AgentTool } from \"@gsd/pi-agent-core\";\nimport { glob as nativeGlob } from \"@gsd/native/glob\";\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport { existsSync } from \"fs\";\nimport path from \"path\";\nimport { resolveToCwd } from \"./path-utils.js\";\nimport { DEFAULT_MAX_BYTES, formatSize, type TruncationResult, truncateHead } from \"./truncate.js\";\n\nconst findSchema = Type.Object({\n\tpattern: Type.String({\n\t\tdescription: \"Glob pattern to match files, e.g. '*.ts', '**/*.json', or 'src/**/*.spec.ts'\",\n\t}),\n\tpath: Type.Optional(Type.String({ description: \"Directory to search in (default: current directory)\" })),\n\tlimit: Type.Optional(Type.Number({ description: \"Maximum number of results (default: 1000)\" })),\n});\n\nexport type FindToolInput = Static<typeof findSchema>;\n\nconst DEFAULT_LIMIT = 1000;\n\nexport interface FindToolDetails {\n\ttruncation?: TruncationResult;\n\tresultLimitReached?: number;\n}\n\n/**\n * Pluggable operations for the find tool.\n * Override these to delegate file search to remote systems (e.g., SSH).\n */\nexport interface FindOperations {\n\t/** Check if path exists */\n\texists: (absolutePath: string) => Promise<boolean> | boolean;\n\t/** Find files matching glob pattern. Returns relative paths. */\n\tglob: (pattern: string, cwd: string, options: { ignore: string[]; limit: number }) => Promise<string[]> | string[];\n}\n\nconst defaultFindOperations: FindOperations = {\n\texists: existsSync,\n\tglob: (_pattern, _searchCwd, _options) => {\n\t\t// Placeholder — actual native glob execution happens in execute\n\t\treturn [];\n\t},\n};\n\nexport interface FindToolOptions {\n\t/** Custom operations for find. Default: local filesystem + native glob */\n\toperations?: FindOperations;\n}\n\nexport function createFindTool(cwd: string, options?: FindToolOptions): AgentTool<typeof findSchema> {\n\tconst customOps = options?.operations;\n\n\treturn {\n\t\tname: \"find\",\n\t\tlabel: \"find\",\n\t\tdescription: `Search for files by glob pattern. Returns matching file paths relative to the search directory. Respects .gitignore. Output is truncated to ${DEFAULT_LIMIT} results or ${DEFAULT_MAX_BYTES / 1024}KB (whichever is hit first).`,\n\t\tparameters: findSchema,\n\t\texecute: async (\n\t\t\t_toolCallId: string,\n\t\t\t{ pattern, path: searchDir, limit }: { pattern: string; path?: string; limit?: number },\n\t\t\tsignal?: AbortSignal,\n\t\t) => {\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\treject(new Error(\"Operation aborted\"));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst onAbort = () => reject(new Error(\"Operation aborted\"));\n\t\t\t\tsignal?.addEventListener(\"abort\", onAbort, { once: true });\n\n\t\t\t\t(async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst searchPath = resolveToCwd(searchDir || \".\", cwd);\n\t\t\t\t\t\tconst effectiveLimit = limit ?? DEFAULT_LIMIT;\n\t\t\t\t\t\tconst ops = customOps ?? defaultFindOperations;\n\n\t\t\t\t\t\t// If custom operations provided with glob, use that\n\t\t\t\t\t\tif (customOps?.glob) {\n\t\t\t\t\t\t\tif (!(await ops.exists(searchPath))) {\n\t\t\t\t\t\t\t\treject(new Error(`Path not found: ${searchPath}`));\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst results = await ops.glob(pattern, searchPath, {\n\t\t\t\t\t\t\t\tignore: [\"**/node_modules/**\", \"**/.git/**\"],\n\t\t\t\t\t\t\t\tlimit: effectiveLimit,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\n\t\t\t\t\t\t\tif (results.length === 0) {\n\t\t\t\t\t\t\t\tresolve({\n\t\t\t\t\t\t\t\t\tcontent: [{ type: \"text\", text: \"No files found matching pattern\" }],\n\t\t\t\t\t\t\t\t\tdetails: undefined,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Relativize paths\n\t\t\t\t\t\t\tconst relativized = results.map((p) => {\n\t\t\t\t\t\t\t\tif (p.startsWith(searchPath)) {\n\t\t\t\t\t\t\t\t\treturn p.slice(searchPath.length + 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn path.relative(searchPath, p);\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tconst resultLimitReached = relativized.length >= effectiveLimit;\n\t\t\t\t\t\t\tconst rawOutput = relativized.join(\"\\n\");\n\t\t\t\t\t\t\tconst truncation = truncateHead(rawOutput, { maxLines: Number.MAX_SAFE_INTEGER });\n\n\t\t\t\t\t\t\tlet resultOutput = truncation.content;\n\t\t\t\t\t\t\tconst details: FindToolDetails = {};\n\t\t\t\t\t\t\tconst notices: string[] = [];\n\n\t\t\t\t\t\t\tif (resultLimitReached) {\n\t\t\t\t\t\t\t\tnotices.push(`${effectiveLimit} results limit reached`);\n\t\t\t\t\t\t\t\tdetails.resultLimitReached = effectiveLimit;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (truncation.truncated) {\n\t\t\t\t\t\t\t\tnotices.push(`${formatSize(DEFAULT_MAX_BYTES)} limit reached`);\n\t\t\t\t\t\t\t\tdetails.truncation = truncation;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (notices.length > 0) {\n\t\t\t\t\t\t\t\tresultOutput += `\\n\\n[${notices.join(\". \")}]`;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tresolve({\n\t\t\t\t\t\t\t\tcontent: [{ type: \"text\", text: resultOutput }],\n\t\t\t\t\t\t\t\tdetails: Object.keys(details).length > 0 ? details : undefined,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Default: use native Rust glob\n\t\t\t\t\t\tconst globResult = await nativeGlob({\n\t\t\t\t\t\t\tpattern,\n\t\t\t\t\t\t\tpath: searchPath,\n\t\t\t\t\t\t\thidden: true,\n\t\t\t\t\t\t\tgitignore: true,\n\t\t\t\t\t\t\tmaxResults: effectiveLimit,\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\n\t\t\t\t\t\tif (globResult.matches.length === 0) {\n\t\t\t\t\t\t\tresolve({\n\t\t\t\t\t\t\t\tcontent: [{ type: \"text\", text: \"No files found matching pattern\" }],\n\t\t\t\t\t\t\t\tdetails: undefined,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Native glob returns paths relative to the search root\n\t\t\t\t\t\tconst relativized = globResult.matches.map((m: { path: string }) => m.path);\n\n\t\t\t\t\t\tconst resultLimitReached = relativized.length >= effectiveLimit;\n\t\t\t\t\t\tconst rawOutput = relativized.join(\"\\n\");\n\t\t\t\t\t\tconst truncation = truncateHead(rawOutput, { maxLines: Number.MAX_SAFE_INTEGER });\n\n\t\t\t\t\t\tlet resultOutput = truncation.content;\n\t\t\t\t\t\tconst details: FindToolDetails = {};\n\t\t\t\t\t\tconst notices: string[] = [];\n\n\t\t\t\t\t\tif (resultLimitReached) {\n\t\t\t\t\t\t\tnotices.push(\n\t\t\t\t\t\t\t\t`${effectiveLimit} results limit reached. Use limit=${effectiveLimit * 2} for more, or refine pattern`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tdetails.resultLimitReached = effectiveLimit;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (truncation.truncated) {\n\t\t\t\t\t\t\tnotices.push(`${formatSize(DEFAULT_MAX_BYTES)} limit reached`);\n\t\t\t\t\t\t\tdetails.truncation = truncation;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (notices.length > 0) {\n\t\t\t\t\t\t\tresultOutput += `\\n\\n[${notices.join(\". \")}]`;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tresolve({\n\t\t\t\t\t\t\tcontent: [{ type: \"text\", text: resultOutput }],\n\t\t\t\t\t\t\tdetails: Object.keys(details).length > 0 ? details : undefined,\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch (e: any) {\n\t\t\t\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\t\t\t\t\treject(e);\n\t\t\t\t\t}\n\t\t\t\t})();\n\t\t\t});\n\t\t},\n\t};\n}\n\n/** Default find tool using process.cwd() - for backwards compatibility */\nexport const findTool = createFindTool(process.cwd());\n"]}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Hashline edit tool — applies file edits using line-hash anchors.
3
+ *
4
+ * The model references lines by `LINE#ID` tags from read output.
5
+ * Each tag uniquely identifies a line, so edits remain stable even when lines shift.
6
+ */
7
+ import type { AgentTool } from "@gsd/pi-agent-core";
8
+ import { type Static } from "@sinclair/typebox";
9
+ declare const hashlineEditItemSchema: import("@sinclair/typebox").TObject<{
10
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"replace">, import("@sinclair/typebox").TLiteral<"append">, import("@sinclair/typebox").TLiteral<"prepend">]>;
11
+ pos: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
12
+ end: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
13
+ lines: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>, import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
14
+ }>;
15
+ declare const hashlineEditSchema: import("@sinclair/typebox").TObject<{
16
+ path: import("@sinclair/typebox").TString;
17
+ edits: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
18
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"replace">, import("@sinclair/typebox").TLiteral<"append">, import("@sinclair/typebox").TLiteral<"prepend">]>;
19
+ pos: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
20
+ end: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
21
+ lines: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>, import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
22
+ }>>;
23
+ delete: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
24
+ move: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
25
+ }>;
26
+ export type HashlineEditInput = Static<typeof hashlineEditSchema>;
27
+ export type HashlineEditItem = Static<typeof hashlineEditItemSchema>;
28
+ export interface HashlineEditToolDetails {
29
+ /** Unified diff of the changes made */
30
+ diff: string;
31
+ /** Line number of the first change in the new file */
32
+ firstChangedLine?: number;
33
+ }
34
+ /**
35
+ * Pluggable operations for the hashline edit tool.
36
+ */
37
+ export interface HashlineEditOperations {
38
+ readFile: (absolutePath: string) => Promise<Buffer>;
39
+ writeFile: (absolutePath: string, content: string) => Promise<void>;
40
+ access: (absolutePath: string) => Promise<void>;
41
+ unlink: (absolutePath: string) => Promise<void>;
42
+ }
43
+ export interface HashlineEditToolOptions {
44
+ operations?: HashlineEditOperations;
45
+ }
46
+ export declare function createHashlineEditTool(cwd: string, options?: HashlineEditToolOptions): AgentTool<typeof hashlineEditSchema>;
47
+ /** Default hashline edit tool using process.cwd() */
48
+ export declare const hashlineEditTool: AgentTool<import("@sinclair/typebox").TObject<{
49
+ path: import("@sinclair/typebox").TString;
50
+ edits: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
51
+ op: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"replace">, import("@sinclair/typebox").TLiteral<"append">, import("@sinclair/typebox").TLiteral<"prepend">]>;
52
+ pos: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
53
+ end: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
54
+ lines: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>, import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
55
+ }>>;
56
+ delete: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
57
+ move: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
58
+ }>, any>;
59
+ export {};
60
+ //# sourceMappingURL=hashline-edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hashline-edit.d.ts","sourceRoot":"","sources":["../../../src/core/tools/hashline-edit.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAwBtD,QAAA,MAAM,sBAAsB;;;;;EAY3B,CAAC;AAEF,QAAA,MAAM,kBAAkB;;;;;;;;;;EAQvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAClE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAErE,MAAM,WAAW,uBAAuB;IACvC,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD,SAAS,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,MAAM,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,MAAM,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD;AASD,MAAM,WAAW,uBAAuB;IACvC,UAAU,CAAC,EAAE,sBAAsB,CAAC;CACpC;AAyDD,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,SAAS,CAAC,OAAO,kBAAkB,CAAC,CA6K3H;AAED,qDAAqD;AACrD,eAAO,MAAM,gBAAgB;;;;;;;;;;QAAwC,CAAC"}
@@ -0,0 +1,247 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { constants } from "fs";
3
+ import { access as fsAccess, readFile as fsReadFile, unlink as fsUnlink, writeFile as fsWriteFile } from "fs/promises";
4
+ import { detectLineEnding, generateDiffString, normalizeToLF, restoreLineEndings, stripBom, } from "./edit-diff.js";
5
+ import { applyHashlineEdits, hashlineParseText, parseTag, } from "./hashline.js";
6
+ import { resolveToCwd } from "./path-utils.js";
7
+ // ═══════════════════════════════════════════════════════════════════════════
8
+ // Schema
9
+ // ═══════════════════════════════════════════════════════════════════════════
10
+ const hashlineEditItemSchema = Type.Object({
11
+ op: Type.Union([Type.Literal("replace"), Type.Literal("append"), Type.Literal("prepend")]),
12
+ pos: Type.Optional(Type.String({ description: "Anchor tag (e.g. \"5#QQ\")" })),
13
+ end: Type.Optional(Type.String({ description: "End anchor for range replace" })),
14
+ lines: Type.Union([
15
+ Type.Array(Type.String(), { description: "Replacement content lines" }),
16
+ Type.String(),
17
+ Type.Null(),
18
+ ]),
19
+ }, { additionalProperties: false });
20
+ const hashlineEditSchema = Type.Object({
21
+ path: Type.String({ description: "Path to the file to edit" }),
22
+ edits: Type.Array(hashlineEditItemSchema, { description: "Edits to apply (referenced by LINE#ID tags from read output)" }),
23
+ delete: Type.Optional(Type.Boolean({ description: "If true, delete the file" })),
24
+ move: Type.Optional(Type.String({ description: "If set, move/rename the file to this path" })),
25
+ }, { additionalProperties: false });
26
+ const defaultHashlineEditOperations = {
27
+ readFile: (path) => fsReadFile(path),
28
+ writeFile: (path, content) => fsWriteFile(path, content, "utf-8"),
29
+ access: (path) => fsAccess(path, constants.R_OK | constants.W_OK),
30
+ unlink: (path) => fsUnlink(path),
31
+ };
32
+ /** Parse a tag, returning undefined instead of throwing on garbage. */
33
+ function tryParseTag(raw) {
34
+ try {
35
+ return parseTag(raw);
36
+ }
37
+ catch {
38
+ return undefined;
39
+ }
40
+ }
41
+ /**
42
+ * Map flat tool-schema edits into typed HashlineEdit objects.
43
+ */
44
+ function resolveEditAnchors(edits) {
45
+ const result = [];
46
+ for (const edit of edits) {
47
+ const lines = hashlineParseText(edit.lines);
48
+ const tag = edit.pos ? tryParseTag(edit.pos) : undefined;
49
+ const end = edit.end ? tryParseTag(edit.end) : undefined;
50
+ const op = edit.op === "append" || edit.op === "prepend" ? edit.op : "replace";
51
+ switch (op) {
52
+ case "replace": {
53
+ if (tag && end) {
54
+ result.push({ op: "replace", pos: tag, end, lines });
55
+ }
56
+ else if (tag || end) {
57
+ result.push({ op: "replace", pos: tag || end, lines });
58
+ }
59
+ else {
60
+ throw new Error("Replace requires at least one anchor (pos or end).");
61
+ }
62
+ break;
63
+ }
64
+ case "append": {
65
+ result.push({ op: "append", pos: tag ?? end, lines });
66
+ break;
67
+ }
68
+ case "prepend": {
69
+ result.push({ op: "prepend", pos: end ?? tag, lines });
70
+ break;
71
+ }
72
+ }
73
+ }
74
+ return result;
75
+ }
76
+ const HASHLINE_EDIT_DESCRIPTION = `Edit a file by referencing LINE#ID tags from read output. Each tag uniquely identifies a line via content hash, so edits remain stable even when lines shift.
77
+
78
+ Read the file first to get fresh tags. Submit one edit call per file with all operations batched.
79
+
80
+ Operations:
81
+ - replace: Replace line(s) at pos (and optionally through end) with lines content
82
+ - append: Insert lines after pos (omit pos for end of file)
83
+ - prepend: Insert lines before pos (omit pos for beginning of file)
84
+
85
+ Set lines to null or [] to delete lines. Set delete:true to delete the file.`;
86
+ export function createHashlineEditTool(cwd, options) {
87
+ const ops = options?.operations ?? defaultHashlineEditOperations;
88
+ return {
89
+ name: "hashline_edit",
90
+ label: "hashline_edit",
91
+ description: HASHLINE_EDIT_DESCRIPTION,
92
+ parameters: hashlineEditSchema,
93
+ execute: async (_toolCallId, params, signal) => {
94
+ const { path, edits, delete: deleteFile, move } = params;
95
+ const absolutePath = resolveToCwd(path, cwd);
96
+ return new Promise((resolve, reject) => {
97
+ if (signal?.aborted) {
98
+ reject(new Error("Operation aborted"));
99
+ return;
100
+ }
101
+ let aborted = false;
102
+ const onAbort = () => {
103
+ aborted = true;
104
+ reject(new Error("Operation aborted"));
105
+ };
106
+ if (signal) {
107
+ signal.addEventListener("abort", onAbort, { once: true });
108
+ }
109
+ (async () => {
110
+ try {
111
+ // Handle delete
112
+ if (deleteFile) {
113
+ let fileExists = true;
114
+ try {
115
+ await ops.access(absolutePath);
116
+ }
117
+ catch {
118
+ fileExists = false;
119
+ }
120
+ if (fileExists) {
121
+ await ops.unlink(absolutePath);
122
+ }
123
+ if (signal)
124
+ signal.removeEventListener("abort", onAbort);
125
+ resolve({
126
+ content: [{ type: "text", text: fileExists ? `Deleted ${path}` : `File not found, nothing to delete: ${path}` }],
127
+ details: { diff: "" },
128
+ });
129
+ return;
130
+ }
131
+ // Handle file creation (no existing file, anchorless appends/prepends)
132
+ let fileExists = true;
133
+ try {
134
+ await ops.access(absolutePath);
135
+ }
136
+ catch {
137
+ fileExists = false;
138
+ }
139
+ if (!fileExists) {
140
+ const lines = [];
141
+ for (const edit of edits) {
142
+ if ((edit.op === "append" || edit.op === "prepend") && !edit.pos && !edit.end) {
143
+ if (edit.op === "prepend") {
144
+ lines.unshift(...hashlineParseText(edit.lines));
145
+ }
146
+ else {
147
+ lines.push(...hashlineParseText(edit.lines));
148
+ }
149
+ }
150
+ else {
151
+ throw new Error(`File not found: ${path}`);
152
+ }
153
+ }
154
+ await ops.writeFile(absolutePath, lines.join("\n"));
155
+ if (signal)
156
+ signal.removeEventListener("abort", onAbort);
157
+ resolve({
158
+ content: [{ type: "text", text: `Created ${path}` }],
159
+ details: { diff: "" },
160
+ });
161
+ return;
162
+ }
163
+ if (aborted)
164
+ return;
165
+ // Read file
166
+ const rawContent = (await ops.readFile(absolutePath)).toString("utf-8");
167
+ const { bom, text } = stripBom(rawContent);
168
+ const originalEnding = detectLineEnding(text);
169
+ const originalNormalized = normalizeToLF(text);
170
+ if (aborted)
171
+ return;
172
+ // Resolve and apply edits
173
+ const anchorEdits = resolveEditAnchors(edits);
174
+ const result = applyHashlineEdits(originalNormalized, anchorEdits);
175
+ if (originalNormalized === result.lines && !move) {
176
+ let diagnostic = `No changes made to ${path}. The edits produced identical content.`;
177
+ if (result.noopEdits && result.noopEdits.length > 0) {
178
+ const details = result.noopEdits
179
+ .map(e => `Edit ${e.editIndex}: replacement for ${e.loc} is identical to current content:\n ${e.loc}| ${e.current}`)
180
+ .join("\n");
181
+ diagnostic += `\n${details}`;
182
+ diagnostic +=
183
+ "\nYour content must differ from what the file already contains. Re-read the file to see the current state.";
184
+ }
185
+ throw new Error(diagnostic);
186
+ }
187
+ if (aborted)
188
+ return;
189
+ // Write result
190
+ const finalContent = bom + restoreLineEndings(result.lines, originalEnding);
191
+ const writePath = move ? resolveToCwd(move, cwd) : absolutePath;
192
+ // Prevent silent overwrite when moving to an existing file
193
+ if (move && writePath !== absolutePath) {
194
+ try {
195
+ await ops.access(writePath);
196
+ // If access succeeds, the file exists — refuse the move
197
+ throw new Error(`Destination file already exists: ${writePath}. Use a different path or delete the existing file first.`);
198
+ }
199
+ catch (err) {
200
+ // Re-throw our own error; swallow only "file not found"
201
+ if (err.message?.startsWith("Destination file already exists:"))
202
+ throw err;
203
+ // File doesn't exist — safe to proceed
204
+ }
205
+ }
206
+ await ops.writeFile(writePath, finalContent);
207
+ // If moved, delete original
208
+ if (move && writePath !== absolutePath) {
209
+ await ops.unlink(absolutePath);
210
+ }
211
+ if (aborted)
212
+ return;
213
+ if (signal)
214
+ signal.removeEventListener("abort", onAbort);
215
+ const diffResult = generateDiffString(originalNormalized, result.lines);
216
+ const resultText = move ? `Moved ${path} to ${move}` : `Updated ${path}`;
217
+ const warningsBlock = result.warnings?.length
218
+ ? `\nWarnings:\n${result.warnings.join("\n")}`
219
+ : "";
220
+ resolve({
221
+ content: [
222
+ {
223
+ type: "text",
224
+ text: `${resultText}${warningsBlock}`,
225
+ },
226
+ ],
227
+ details: {
228
+ diff: diffResult.diff,
229
+ firstChangedLine: result.firstChangedLine ?? diffResult.firstChangedLine,
230
+ },
231
+ });
232
+ }
233
+ catch (error) {
234
+ if (signal)
235
+ signal.removeEventListener("abort", onAbort);
236
+ if (!aborted) {
237
+ reject(error);
238
+ }
239
+ }
240
+ })();
241
+ });
242
+ },
243
+ };
244
+ }
245
+ /** Default hashline edit tool using process.cwd() */
246
+ export const hashlineEditTool = createHashlineEditTool(process.cwd());
247
+ //# sourceMappingURL=hashline-edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hashline-edit.js","sourceRoot":"","sources":["../../../src/core/tools/hashline-edit.ts"],"names":[],"mappings":"AAOA,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EAAE,MAAM,IAA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,CAAC;gBACF,CAAC,CAAC,EAAE,CAAC;YACN,CAAC,CAAC,CAAC;QACJ,CAAC;KACD,CAAC;AACH,CAAC;AAED,qDAAqD;AACrD,MAAM,CAAC,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC","sourcesContent":["/**\n * Hashline edit tool — applies file edits using line-hash anchors.\n *\n * The model references lines by `LINE#ID` tags from read output.\n * Each tag uniquely identifies a line, so edits remain stable even when lines shift.\n */\nimport type { AgentTool } from \"@gsd/pi-agent-core\";\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport { constants } from \"fs\";\nimport { access as fsAccess, readFile as fsReadFile, unlink as fsUnlink, writeFile as fsWriteFile } from \"fs/promises\";\nimport {\n\tdetectLineEnding,\n\tgenerateDiffString,\n\tnormalizeToLF,\n\trestoreLineEndings,\n\tstripBom,\n} from \"./edit-diff.js\";\nimport {\n\ttype Anchor,\n\tapplyHashlineEdits,\n\tcomputeLineHash,\n\ttype HashlineEdit,\n\thashlineParseText,\n\tparseTag,\n} from \"./hashline.js\";\nimport { resolveToCwd } from \"./path-utils.js\";\n\n// ═══════════════════════════════════════════════════════════════════════════\n// Schema\n// ═══════════════════════════════════════════════════════════════════════════\n\nconst hashlineEditItemSchema = Type.Object(\n\t{\n\t\top: Type.Union([Type.Literal(\"replace\"), Type.Literal(\"append\"), Type.Literal(\"prepend\")]),\n\t\tpos: Type.Optional(Type.String({ description: \"Anchor tag (e.g. \\\"5#QQ\\\")\" })),\n\t\tend: Type.Optional(Type.String({ description: \"End anchor for range replace\" })),\n\t\tlines: Type.Union([\n\t\t\tType.Array(Type.String(), { description: \"Replacement content lines\" }),\n\t\t\tType.String(),\n\t\t\tType.Null(),\n\t\t]),\n\t},\n\t{ additionalProperties: false },\n);\n\nconst hashlineEditSchema = Type.Object(\n\t{\n\t\tpath: Type.String({ description: \"Path to the file to edit\" }),\n\t\tedits: Type.Array(hashlineEditItemSchema, { description: \"Edits to apply (referenced by LINE#ID tags from read output)\" }),\n\t\tdelete: Type.Optional(Type.Boolean({ description: \"If true, delete the file\" })),\n\t\tmove: Type.Optional(Type.String({ description: \"If set, move/rename the file to this path\" })),\n\t},\n\t{ additionalProperties: false },\n);\n\nexport type HashlineEditInput = Static<typeof hashlineEditSchema>;\nexport type HashlineEditItem = Static<typeof hashlineEditItemSchema>;\n\nexport interface HashlineEditToolDetails {\n\t/** Unified diff of the changes made */\n\tdiff: string;\n\t/** Line number of the first change in the new file */\n\tfirstChangedLine?: number;\n}\n\n/**\n * Pluggable operations for the hashline edit tool.\n */\nexport interface HashlineEditOperations {\n\treadFile: (absolutePath: string) => Promise<Buffer>;\n\twriteFile: (absolutePath: string, content: string) => Promise<void>;\n\taccess: (absolutePath: string) => Promise<void>;\n\tunlink: (absolutePath: string) => Promise<void>;\n}\n\nconst defaultHashlineEditOperations: HashlineEditOperations = {\n\treadFile: (path) => fsReadFile(path),\n\twriteFile: (path, content) => fsWriteFile(path, content, \"utf-8\"),\n\taccess: (path) => fsAccess(path, constants.R_OK | constants.W_OK),\n\tunlink: (path) => fsUnlink(path),\n};\n\nexport interface HashlineEditToolOptions {\n\toperations?: HashlineEditOperations;\n}\n\n/** Parse a tag, returning undefined instead of throwing on garbage. */\nfunction tryParseTag(raw: string): Anchor | undefined {\n\ttry {\n\t\treturn parseTag(raw);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/**\n * Map flat tool-schema edits into typed HashlineEdit objects.\n */\nfunction resolveEditAnchors(edits: HashlineEditItem[]): HashlineEdit[] {\n\tconst result: HashlineEdit[] = [];\n\tfor (const edit of edits) {\n\t\tconst lines = hashlineParseText(edit.lines);\n\t\tconst tag = edit.pos ? tryParseTag(edit.pos) : undefined;\n\t\tconst end = edit.end ? tryParseTag(edit.end) : undefined;\n\n\t\tconst op = edit.op === \"append\" || edit.op === \"prepend\" ? edit.op : \"replace\";\n\t\tswitch (op) {\n\t\t\tcase \"replace\": {\n\t\t\t\tif (tag && end) {\n\t\t\t\t\tresult.push({ op: \"replace\", pos: tag, end, lines });\n\t\t\t\t} else if (tag || end) {\n\t\t\t\t\tresult.push({ op: \"replace\", pos: tag || end!, lines });\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(\"Replace requires at least one anchor (pos or end).\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"append\": {\n\t\t\t\tresult.push({ op: \"append\", pos: tag ?? end, lines });\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"prepend\": {\n\t\t\t\tresult.push({ op: \"prepend\", pos: end ?? tag, lines });\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}\n\nconst HASHLINE_EDIT_DESCRIPTION = `Edit a file by referencing LINE#ID tags from read output. Each tag uniquely identifies a line via content hash, so edits remain stable even when lines shift.\n\nRead the file first to get fresh tags. Submit one edit call per file with all operations batched.\n\nOperations:\n- replace: Replace line(s) at pos (and optionally through end) with lines content\n- append: Insert lines after pos (omit pos for end of file)\n- prepend: Insert lines before pos (omit pos for beginning of file)\n\nSet lines to null or [] to delete lines. Set delete:true to delete the file.`;\n\nexport function createHashlineEditTool(cwd: string, options?: HashlineEditToolOptions): AgentTool<typeof hashlineEditSchema> {\n\tconst ops = options?.operations ?? defaultHashlineEditOperations;\n\n\treturn {\n\t\tname: \"hashline_edit\",\n\t\tlabel: \"hashline_edit\",\n\t\tdescription: HASHLINE_EDIT_DESCRIPTION,\n\t\tparameters: hashlineEditSchema,\n\t\texecute: async (\n\t\t\t_toolCallId: string,\n\t\t\tparams: HashlineEditInput,\n\t\t\tsignal?: AbortSignal,\n\t\t) => {\n\t\t\tconst { path, edits, delete: deleteFile, move } = params;\n\t\t\tconst absolutePath = resolveToCwd(path, cwd);\n\n\t\t\treturn new Promise<{\n\t\t\t\tcontent: Array<{ type: \"text\"; text: string }>;\n\t\t\t\tdetails: HashlineEditToolDetails | undefined;\n\t\t\t}>((resolve, reject) => {\n\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\treject(new Error(\"Operation aborted\"));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet aborted = false;\n\t\t\t\tconst onAbort = () => {\n\t\t\t\t\taborted = true;\n\t\t\t\t\treject(new Error(\"Operation aborted\"));\n\t\t\t\t};\n\t\t\t\tif (signal) {\n\t\t\t\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\t\t}\n\n\t\t\t\t(async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// Handle delete\n\t\t\t\t\t\tif (deleteFile) {\n\t\t\t\t\t\t\tlet fileExists = true;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tawait ops.access(absolutePath);\n\t\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t\tfileExists = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (fileExists) {\n\t\t\t\t\t\t\t\tawait ops.unlink(absolutePath);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (signal) signal.removeEventListener(\"abort\", onAbort);\n\t\t\t\t\t\t\tresolve({\n\t\t\t\t\t\t\t\tcontent: [{ type: \"text\", text: fileExists ? `Deleted ${path}` : `File not found, nothing to delete: ${path}` }],\n\t\t\t\t\t\t\t\tdetails: { diff: \"\" },\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Handle file creation (no existing file, anchorless appends/prepends)\n\t\t\t\t\t\tlet fileExists = true;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait ops.access(absolutePath);\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\tfileExists = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!fileExists) {\n\t\t\t\t\t\t\tconst lines: string[] = [];\n\t\t\t\t\t\t\tfor (const edit of edits) {\n\t\t\t\t\t\t\t\tif ((edit.op === \"append\" || edit.op === \"prepend\") && !edit.pos && !edit.end) {\n\t\t\t\t\t\t\t\t\tif (edit.op === \"prepend\") {\n\t\t\t\t\t\t\t\t\t\tlines.unshift(...hashlineParseText(edit.lines));\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tlines.push(...hashlineParseText(edit.lines));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthrow new Error(`File not found: ${path}`);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tawait ops.writeFile(absolutePath, lines.join(\"\\n\"));\n\t\t\t\t\t\t\tif (signal) signal.removeEventListener(\"abort\", onAbort);\n\t\t\t\t\t\t\tresolve({\n\t\t\t\t\t\t\t\tcontent: [{ type: \"text\", text: `Created ${path}` }],\n\t\t\t\t\t\t\t\tdetails: { diff: \"\" },\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (aborted) return;\n\n\t\t\t\t\t\t// Read file\n\t\t\t\t\t\tconst rawContent = (await ops.readFile(absolutePath)).toString(\"utf-8\");\n\t\t\t\t\t\tconst { bom, text } = stripBom(rawContent);\n\t\t\t\t\t\tconst originalEnding = detectLineEnding(text);\n\t\t\t\t\t\tconst originalNormalized = normalizeToLF(text);\n\n\t\t\t\t\t\tif (aborted) return;\n\n\t\t\t\t\t\t// Resolve and apply edits\n\t\t\t\t\t\tconst anchorEdits = resolveEditAnchors(edits);\n\t\t\t\t\t\tconst result = applyHashlineEdits(originalNormalized, anchorEdits);\n\n\t\t\t\t\t\tif (originalNormalized === result.lines && !move) {\n\t\t\t\t\t\t\tlet diagnostic = `No changes made to ${path}. The edits produced identical content.`;\n\t\t\t\t\t\t\tif (result.noopEdits && result.noopEdits.length > 0) {\n\t\t\t\t\t\t\t\tconst details = result.noopEdits\n\t\t\t\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t\t\t\te =>\n\t\t\t\t\t\t\t\t\t\t\t`Edit ${e.editIndex}: replacement for ${e.loc} is identical to current content:\\n ${e.loc}| ${e.current}`,\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t.join(\"\\n\");\n\t\t\t\t\t\t\t\tdiagnostic += `\\n${details}`;\n\t\t\t\t\t\t\t\tdiagnostic +=\n\t\t\t\t\t\t\t\t\t\"\\nYour content must differ from what the file already contains. Re-read the file to see the current state.\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthrow new Error(diagnostic);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (aborted) return;\n\n\t\t\t\t\t\t// Write result\n\t\t\t\t\t\tconst finalContent = bom + restoreLineEndings(result.lines, originalEnding);\n\t\t\t\t\t\tconst writePath = move ? resolveToCwd(move, cwd) : absolutePath;\n\n\t\t\t\t\t\t// Prevent silent overwrite when moving to an existing file\n\t\t\t\t\t\tif (move && writePath !== absolutePath) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tawait ops.access(writePath);\n\t\t\t\t\t\t\t\t// If access succeeds, the file exists — refuse the move\n\t\t\t\t\t\t\t\tthrow new Error(`Destination file already exists: ${writePath}. Use a different path or delete the existing file first.`);\n\t\t\t\t\t\t\t} catch (err: any) {\n\t\t\t\t\t\t\t\t// Re-throw our own error; swallow only \"file not found\"\n\t\t\t\t\t\t\t\tif (err.message?.startsWith(\"Destination file already exists:\")) throw err;\n\t\t\t\t\t\t\t\t// File doesn't exist — safe to proceed\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tawait ops.writeFile(writePath, finalContent);\n\n\t\t\t\t\t\t// If moved, delete original\n\t\t\t\t\t\tif (move && writePath !== absolutePath) {\n\t\t\t\t\t\t\tawait ops.unlink(absolutePath);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (aborted) return;\n\n\t\t\t\t\t\tif (signal) signal.removeEventListener(\"abort\", onAbort);\n\n\t\t\t\t\t\tconst diffResult = generateDiffString(originalNormalized, result.lines);\n\t\t\t\t\t\tconst resultText = move ? `Moved ${path} to ${move}` : `Updated ${path}`;\n\t\t\t\t\t\tconst warningsBlock = result.warnings?.length\n\t\t\t\t\t\t\t? `\\nWarnings:\\n${result.warnings.join(\"\\n\")}`\n\t\t\t\t\t\t\t: \"\";\n\n\t\t\t\t\t\tresolve({\n\t\t\t\t\t\t\tcontent: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\t\t\ttext: `${resultText}${warningsBlock}`,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\tdetails: {\n\t\t\t\t\t\t\t\tdiff: diffResult.diff,\n\t\t\t\t\t\t\t\tfirstChangedLine: result.firstChangedLine ?? diffResult.firstChangedLine,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch (error: any) {\n\t\t\t\t\t\tif (signal) signal.removeEventListener(\"abort\", onAbort);\n\t\t\t\t\t\tif (!aborted) {\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})();\n\t\t\t});\n\t\t},\n\t};\n}\n\n/** Default hashline edit tool using process.cwd() */\nexport const hashlineEditTool = createHashlineEditTool(process.cwd());\n"]}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Hashline read tool — reads files with LINE#ID prefix on each line.
3
+ *
4
+ * Produces output like:
5
+ * 1#QQ:function hello() {
6
+ * 2#KX: return 42;
7
+ * 3#NW:}
8
+ *
9
+ * These tags are used by the hashline_edit tool to address lines precisely.
10
+ */
11
+ import type { AgentTool } from "@gsd/pi-agent-core";
12
+ import { type Static } from "@sinclair/typebox";
13
+ import { type TruncationResult } from "./truncate.js";
14
+ declare const readSchema: import("@sinclair/typebox").TObject<{
15
+ path: import("@sinclair/typebox").TString;
16
+ offset: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
17
+ limit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
18
+ }>;
19
+ export type HashlineReadToolInput = Static<typeof readSchema>;
20
+ export interface HashlineReadToolDetails {
21
+ truncation?: TruncationResult;
22
+ }
23
+ /**
24
+ * Pluggable operations for the hashline read tool.
25
+ */
26
+ export interface HashlineReadOperations {
27
+ readFile: (absolutePath: string) => Promise<Buffer>;
28
+ access: (absolutePath: string) => Promise<void>;
29
+ detectImageMimeType?: (absolutePath: string) => Promise<string | null | undefined>;
30
+ }
31
+ export interface HashlineReadToolOptions {
32
+ autoResizeImages?: boolean;
33
+ operations?: HashlineReadOperations;
34
+ }
35
+ export declare function createHashlineReadTool(cwd: string, options?: HashlineReadToolOptions): AgentTool<typeof readSchema>;
36
+ /** Default hashline read tool using process.cwd() */
37
+ export declare const hashlineReadTool: AgentTool<import("@sinclair/typebox").TObject<{
38
+ path: import("@sinclair/typebox").TString;
39
+ offset: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
40
+ limit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
41
+ }>, any>;
42
+ export {};
43
+ //# sourceMappingURL=hashline-read.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hashline-read.d.ts","sourceRoot":"","sources":["../../../src/core/tools/hashline-read.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAOtD,OAAO,EAAoD,KAAK,gBAAgB,EAAgB,MAAM,eAAe,CAAC;AAEtH,QAAA,MAAM,UAAU;;;;EAId,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC;AAE9D,MAAM,WAAW,uBAAuB;IACvC,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD,MAAM,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,mBAAmB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;CACnF;AAQD,MAAM,WAAW,uBAAuB;IACvC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,UAAU,CAAC,EAAE,sBAAsB,CAAC;CACpC;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,SAAS,CAAC,OAAO,UAAU,CAAC,CA2InH;AAED,qDAAqD;AACrD,eAAO,MAAM,gBAAgB;;;;QAAwC,CAAC"}
@@ -0,0 +1,146 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { constants } from "fs";
3
+ import { access as fsAccess, readFile as fsReadFile } from "fs/promises";
4
+ import { formatDimensionNote, resizeImage } from "../../utils/image-resize.js";
5
+ import { detectSupportedImageMimeTypeFromFile } from "../../utils/mime.js";
6
+ import { formatHashLines } from "./hashline.js";
7
+ import { resolveReadPath } from "./path-utils.js";
8
+ import { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, truncateHead } from "./truncate.js";
9
+ const readSchema = Type.Object({
10
+ path: Type.String({ description: "Path to the file to read (relative or absolute)" }),
11
+ offset: Type.Optional(Type.Number({ description: "Line number to start reading from (1-indexed)" })),
12
+ limit: Type.Optional(Type.Number({ description: "Maximum number of lines to read" })),
13
+ });
14
+ const defaultReadOperations = {
15
+ readFile: (path) => fsReadFile(path),
16
+ access: (path) => fsAccess(path, constants.R_OK),
17
+ detectImageMimeType: detectSupportedImageMimeTypeFromFile,
18
+ };
19
+ export function createHashlineReadTool(cwd, options) {
20
+ const autoResizeImages = options?.autoResizeImages ?? true;
21
+ const ops = options?.operations ?? defaultReadOperations;
22
+ return {
23
+ name: "read",
24
+ label: "read",
25
+ description: `Read a file with LINE#ID hash anchors on each line. These anchors are used by hashline_edit for precise edits. Output format: LINENUM#HASH:CONTENT. Supports text files and images. For text files, output is truncated to ${DEFAULT_MAX_LINES} lines or ${DEFAULT_MAX_BYTES / 1024}KB. Use offset/limit for large files.`,
26
+ parameters: readSchema,
27
+ execute: async (_toolCallId, { path, offset, limit }, signal) => {
28
+ const absolutePath = resolveReadPath(path, cwd);
29
+ return new Promise((resolve, reject) => {
30
+ if (signal?.aborted) {
31
+ reject(new Error("Operation aborted"));
32
+ return;
33
+ }
34
+ let aborted = false;
35
+ const onAbort = () => {
36
+ aborted = true;
37
+ reject(new Error("Operation aborted"));
38
+ };
39
+ if (signal) {
40
+ signal.addEventListener("abort", onAbort, { once: true });
41
+ }
42
+ (async () => {
43
+ try {
44
+ await ops.access(absolutePath);
45
+ if (aborted)
46
+ return;
47
+ const mimeType = ops.detectImageMimeType ? await ops.detectImageMimeType(absolutePath) : undefined;
48
+ let content;
49
+ let details;
50
+ if (mimeType) {
51
+ // Image handling (identical to standard read tool)
52
+ const buffer = await ops.readFile(absolutePath);
53
+ const base64 = buffer.toString("base64");
54
+ if (autoResizeImages) {
55
+ const resized = await resizeImage({ type: "image", data: base64, mimeType });
56
+ const dimensionNote = formatDimensionNote(resized);
57
+ let textNote = `Read image file [${resized.mimeType}]`;
58
+ if (dimensionNote) {
59
+ textNote += `\n${dimensionNote}`;
60
+ }
61
+ content = [
62
+ { type: "text", text: textNote },
63
+ { type: "image", data: resized.data, mimeType: resized.mimeType },
64
+ ];
65
+ }
66
+ else {
67
+ content = [
68
+ { type: "text", text: `Read image file [${mimeType}]` },
69
+ { type: "image", data: base64, mimeType },
70
+ ];
71
+ }
72
+ }
73
+ else {
74
+ // Text file — format with hashline prefixes
75
+ const buffer = await ops.readFile(absolutePath);
76
+ const textContent = buffer.toString("utf-8");
77
+ const allLines = textContent.split("\n");
78
+ const totalFileLines = allLines.length;
79
+ const startLine = offset ? Math.max(0, offset - 1) : 0;
80
+ const startLineDisplay = startLine + 1;
81
+ if (startLine >= allLines.length) {
82
+ throw new Error(`Offset ${offset} is beyond end of file (${allLines.length} lines total)`);
83
+ }
84
+ let selectedContent;
85
+ let userLimitedLines;
86
+ if (limit !== undefined) {
87
+ const endLine = Math.min(startLine + limit, allLines.length);
88
+ selectedContent = allLines.slice(startLine, endLine).join("\n");
89
+ userLimitedLines = endLine - startLine;
90
+ }
91
+ else {
92
+ selectedContent = allLines.slice(startLine).join("\n");
93
+ }
94
+ // Apply truncation
95
+ const truncation = truncateHead(selectedContent);
96
+ let outputText;
97
+ if (truncation.firstLineExceedsLimit) {
98
+ const firstLineSize = formatSize(Buffer.byteLength(allLines[startLine], "utf-8"));
99
+ outputText = `[Line ${startLineDisplay} is ${firstLineSize}, exceeds ${formatSize(DEFAULT_MAX_BYTES)} limit. Use bash: sed -n '${startLineDisplay}p' ${path} | head -c ${DEFAULT_MAX_BYTES}]`;
100
+ details = { truncation };
101
+ }
102
+ else if (truncation.truncated) {
103
+ const endLineDisplay = startLineDisplay + truncation.outputLines - 1;
104
+ const nextOffset = endLineDisplay + 1;
105
+ // Format with hashline prefixes
106
+ outputText = formatHashLines(truncation.content, startLineDisplay);
107
+ if (truncation.truncatedBy === "lines") {
108
+ outputText += `\n\n[Showing lines ${startLineDisplay}-${endLineDisplay} of ${totalFileLines}. Use offset=${nextOffset} to continue.]`;
109
+ }
110
+ else {
111
+ outputText += `\n\n[Showing lines ${startLineDisplay}-${endLineDisplay} of ${totalFileLines} (${formatSize(DEFAULT_MAX_BYTES)} limit). Use offset=${nextOffset} to continue.]`;
112
+ }
113
+ details = { truncation };
114
+ }
115
+ else if (userLimitedLines !== undefined && startLine + userLimitedLines < allLines.length) {
116
+ const remaining = allLines.length - (startLine + userLimitedLines);
117
+ const nextOffset = startLine + userLimitedLines + 1;
118
+ outputText = formatHashLines(truncation.content, startLineDisplay);
119
+ outputText += `\n\n[${remaining} more lines in file. Use offset=${nextOffset} to continue.]`;
120
+ }
121
+ else {
122
+ outputText = formatHashLines(truncation.content, startLineDisplay);
123
+ }
124
+ content = [{ type: "text", text: outputText }];
125
+ }
126
+ if (aborted)
127
+ return;
128
+ if (signal)
129
+ signal.removeEventListener("abort", onAbort);
130
+ resolve({ content, details });
131
+ }
132
+ catch (error) {
133
+ if (signal)
134
+ signal.removeEventListener("abort", onAbort);
135
+ if (!aborted) {
136
+ reject(error);
137
+ }
138
+ }
139
+ })();
140
+ });
141
+ },
142
+ };
143
+ }
144
+ /** Default hashline read tool using process.cwd() */
145
+ export const hashlineReadTool = createHashlineReadTool(process.cwd());
146
+ //# sourceMappingURL=hashline-read.js.map