gsd-pi 2.8.3 → 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 (1162) hide show
  1. package/README.md +2 -1
  2. package/dist/cli.js +5 -0
  3. package/dist/loader.js +1 -1
  4. package/dist/update-check.d.ts +24 -0
  5. package/dist/update-check.js +93 -0
  6. package/node_modules/@gsd/native/package.json +59 -0
  7. package/node_modules/@gsd/native/src/__tests__/clipboard.test.mjs +79 -0
  8. package/node_modules/@gsd/native/src/__tests__/fd.test.mjs +164 -0
  9. package/node_modules/@gsd/native/src/__tests__/glob.test.mjs +237 -0
  10. package/node_modules/@gsd/native/src/__tests__/grep.test.mjs +162 -0
  11. package/node_modules/@gsd/native/src/__tests__/highlight.test.mjs +156 -0
  12. package/node_modules/@gsd/native/src/__tests__/html.test.mjs +98 -0
  13. package/node_modules/@gsd/native/src/__tests__/image.test.mjs +137 -0
  14. package/node_modules/@gsd/native/src/__tests__/ps.test.mjs +109 -0
  15. package/node_modules/@gsd/native/src/__tests__/text.test.mjs +262 -0
  16. package/node_modules/@gsd/native/src/ast/index.ts +12 -0
  17. package/node_modules/@gsd/native/src/ast/types.ts +75 -0
  18. package/node_modules/@gsd/native/src/clipboard/index.ts +40 -0
  19. package/node_modules/@gsd/native/src/clipboard/types.ts +7 -0
  20. package/node_modules/@gsd/native/src/fd/index.ts +35 -0
  21. package/node_modules/@gsd/native/src/fd/types.ts +31 -0
  22. package/node_modules/@gsd/native/src/glob/index.ts +44 -0
  23. package/node_modules/@gsd/native/src/glob/types.ts +53 -0
  24. package/node_modules/@gsd/native/src/grep/index.ts +48 -0
  25. package/node_modules/@gsd/native/src/grep/types.ts +105 -0
  26. package/node_modules/@gsd/native/src/highlight/index.ts +44 -0
  27. package/node_modules/@gsd/native/src/highlight/types.ts +25 -0
  28. package/node_modules/@gsd/native/src/html/index.ts +24 -0
  29. package/node_modules/@gsd/native/src/html/types.ts +7 -0
  30. package/node_modules/@gsd/native/src/image/index.ts +28 -0
  31. package/node_modules/@gsd/native/src/image/types.ts +41 -0
  32. package/node_modules/@gsd/native/src/index.ts +88 -0
  33. package/node_modules/@gsd/native/src/native.ts +94 -0
  34. package/node_modules/@gsd/native/src/ps/index.ts +52 -0
  35. package/node_modules/@gsd/native/src/ps/types.ts +5 -0
  36. package/node_modules/@gsd/native/src/text/index.ts +125 -0
  37. package/node_modules/@gsd/native/src/text/types.ts +29 -0
  38. package/node_modules/@gsd/native/src/ttsr/index.ts +39 -0
  39. package/node_modules/@gsd/native/src/ttsr/types.ts +10 -0
  40. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/client.d.ts +46 -0
  41. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/client.d.ts.map +1 -0
  42. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/client.js +758 -0
  43. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/client.js.map +1 -0
  44. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/config.d.ts +23 -0
  45. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/config.d.ts.map +1 -0
  46. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/config.js +267 -0
  47. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/config.js.map +1 -0
  48. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/defaults.json +456 -0
  49. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/edits.d.ts +17 -0
  50. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/edits.d.ts.map +1 -0
  51. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/edits.js +101 -0
  52. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/edits.js.map +1 -0
  53. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/helpers.d.ts +15 -0
  54. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/helpers.d.ts.map +1 -0
  55. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/helpers.js +46 -0
  56. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/helpers.js.map +1 -0
  57. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/index.d.ts +35 -0
  58. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/index.d.ts.map +1 -0
  59. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/index.js +709 -0
  60. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/index.js.map +1 -0
  61. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lsp-integration.test.d.ts +2 -0
  62. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lsp-integration.test.d.ts.map +1 -0
  63. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lsp-integration.test.js +308 -0
  64. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lsp-integration.test.js.map +1 -0
  65. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lsp.md +33 -0
  66. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lspmux.d.ts +34 -0
  67. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lspmux.d.ts.map +1 -0
  68. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lspmux.js +136 -0
  69. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lspmux.js.map +1 -0
  70. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/types.d.ts +262 -0
  71. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/types.d.ts.map +1 -0
  72. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/types.js +64 -0
  73. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/types.js.map +1 -0
  74. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/utils.d.ts +50 -0
  75. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/utils.d.ts.map +1 -0
  76. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/utils.js +574 -0
  77. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/utils.js.map +1 -0
  78. package/node_modules/@gsd/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -1
  79. package/node_modules/@gsd/pi-coding-agent/dist/core/slash-commands.js +1 -0
  80. package/node_modules/@gsd/pi-coding-agent/dist/core/slash-commands.js.map +1 -1
  81. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/find.d.ts +1 -1
  82. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
  83. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/find.js +12 -77
  84. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/find.js.map +1 -1
  85. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-edit.d.ts +60 -0
  86. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-edit.d.ts.map +1 -0
  87. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-edit.js +247 -0
  88. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-edit.js.map +1 -0
  89. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-read.d.ts +43 -0
  90. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-read.d.ts.map +1 -0
  91. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-read.js +146 -0
  92. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-read.js.map +1 -0
  93. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.d.ts +114 -0
  94. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.d.ts.map +1 -0
  95. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.js +522 -0
  96. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.js.map +1 -0
  97. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.test.d.ts +2 -0
  98. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.test.d.ts.map +1 -0
  99. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.test.js +376 -0
  100. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.test.js.map +1 -0
  101. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/index.d.ts +38 -0
  102. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/index.d.ts.map +1 -1
  103. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/index.js +27 -0
  104. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/index.js.map +1 -1
  105. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +10 -1
  106. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  107. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +2 -2
  108. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
  109. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  110. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +6 -3
  111. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  112. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +2 -1
  113. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  114. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/interactive-mode.js +54 -10
  115. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  116. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  117. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/theme/theme.js +25 -40
  118. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  119. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-image.d.ts.map +1 -1
  120. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-image.js +17 -21
  121. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-image.js.map +1 -1
  122. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-native.d.ts +7 -6
  123. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-native.d.ts.map +1 -1
  124. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-native.js +7 -13
  125. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-native.js.map +1 -1
  126. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard.d.ts.map +1 -1
  127. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard.js +3 -56
  128. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard.js.map +1 -1
  129. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-convert.d.ts.map +1 -1
  130. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-convert.js +7 -17
  131. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-convert.js.map +1 -1
  132. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-resize.d.ts +1 -2
  133. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-resize.d.ts.map +1 -1
  134. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-resize.js +21 -29
  135. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-resize.js.map +1 -1
  136. package/node_modules/@gsd/pi-coding-agent/package.json +2 -5
  137. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/client.ts +880 -0
  138. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/config.ts +325 -0
  139. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/defaults.json +456 -0
  140. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/edits.ts +109 -0
  141. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/helpers.ts +54 -0
  142. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/index.ts +943 -0
  143. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/lsp-integration.test.ts +407 -0
  144. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/lsp.md +33 -0
  145. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/lspmux.ts +199 -0
  146. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/types.ts +421 -0
  147. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/utils.ts +682 -0
  148. package/node_modules/@gsd/pi-coding-agent/src/core/slash-commands.ts +1 -0
  149. package/node_modules/@gsd/pi-coding-agent/src/core/tools/find.ts +13 -88
  150. package/node_modules/@gsd/pi-coding-agent/src/core/tools/hashline-edit.ts +318 -0
  151. package/node_modules/@gsd/pi-coding-agent/src/core/tools/hashline-read.ts +196 -0
  152. package/node_modules/@gsd/pi-coding-agent/src/core/tools/hashline.test.ts +456 -0
  153. package/node_modules/@gsd/pi-coding-agent/src/core/tools/hashline.ts +594 -0
  154. package/node_modules/@gsd/pi-coding-agent/src/core/tools/index.ts +63 -0
  155. package/node_modules/@gsd/pi-coding-agent/src/modes/interactive/components/settings-selector.ts +2 -2
  156. package/node_modules/@gsd/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +5 -3
  157. package/node_modules/@gsd/pi-coding-agent/src/modes/interactive/interactive-mode.ts +66 -12
  158. package/node_modules/@gsd/pi-coding-agent/src/modes/interactive/theme/theme.ts +26 -42
  159. package/node_modules/@gsd/pi-coding-agent/src/utils/clipboard-image.ts +17 -24
  160. package/node_modules/@gsd/pi-coding-agent/src/utils/clipboard-native.ts +11 -21
  161. package/node_modules/@gsd/pi-coding-agent/src/utils/clipboard.ts +3 -51
  162. package/node_modules/@gsd/pi-coding-agent/src/utils/image-convert.ts +7 -17
  163. package/node_modules/@gsd/pi-coding-agent/src/utils/image-resize.ts +28 -34
  164. package/node_modules/@gsd/pi-tui/dist/autocomplete.d.ts +1 -3
  165. package/node_modules/@gsd/pi-tui/dist/autocomplete.d.ts.map +1 -1
  166. package/node_modules/@gsd/pi-tui/dist/autocomplete.js +16 -95
  167. package/node_modules/@gsd/pi-tui/dist/autocomplete.js.map +1 -1
  168. package/node_modules/@gsd/pi-tui/dist/components/image.d.ts +7 -0
  169. package/node_modules/@gsd/pi-tui/dist/components/image.d.ts.map +1 -1
  170. package/node_modules/@gsd/pi-tui/dist/components/image.js +20 -1
  171. package/node_modules/@gsd/pi-tui/dist/components/image.js.map +1 -1
  172. package/node_modules/@gsd/pi-tui/dist/index.d.ts +1 -1
  173. package/node_modules/@gsd/pi-tui/dist/index.d.ts.map +1 -1
  174. package/node_modules/@gsd/pi-tui/dist/index.js +1 -1
  175. package/node_modules/@gsd/pi-tui/dist/index.js.map +1 -1
  176. package/node_modules/@gsd/pi-tui/dist/terminal-image.d.ts +5 -5
  177. package/node_modules/@gsd/pi-tui/dist/terminal-image.d.ts.map +1 -1
  178. package/node_modules/@gsd/pi-tui/dist/terminal-image.js +9 -120
  179. package/node_modules/@gsd/pi-tui/dist/terminal-image.js.map +1 -1
  180. package/node_modules/@gsd/pi-tui/dist/utils.d.ts +23 -26
  181. package/node_modules/@gsd/pi-tui/dist/utils.d.ts.map +1 -1
  182. package/node_modules/@gsd/pi-tui/dist/utils.js +47 -716
  183. package/node_modules/@gsd/pi-tui/dist/utils.js.map +1 -1
  184. package/node_modules/@gsd/pi-tui/package.json +1 -0
  185. package/node_modules/@gsd/pi-tui/src/autocomplete.ts +17 -112
  186. package/node_modules/@gsd/pi-tui/src/components/image.ts +23 -1
  187. package/node_modules/@gsd/pi-tui/src/index.ts +0 -4
  188. package/node_modules/@gsd/pi-tui/src/terminal-image.ts +9 -135
  189. package/node_modules/@gsd/pi-tui/src/utils.ts +51 -775
  190. package/package.json +4 -1
  191. package/packages/native/package.json +59 -0
  192. package/packages/native/src/__tests__/clipboard.test.mjs +79 -0
  193. package/packages/native/src/__tests__/fd.test.mjs +164 -0
  194. package/packages/native/src/__tests__/glob.test.mjs +237 -0
  195. package/packages/native/src/__tests__/grep.test.mjs +162 -0
  196. package/packages/native/src/__tests__/highlight.test.mjs +156 -0
  197. package/packages/native/src/__tests__/html.test.mjs +98 -0
  198. package/packages/native/src/__tests__/image.test.mjs +137 -0
  199. package/packages/native/src/__tests__/ps.test.mjs +109 -0
  200. package/packages/native/src/__tests__/text.test.mjs +262 -0
  201. package/packages/native/src/ast/index.ts +12 -0
  202. package/packages/native/src/ast/types.ts +75 -0
  203. package/packages/native/src/clipboard/index.ts +40 -0
  204. package/packages/native/src/clipboard/types.ts +7 -0
  205. package/packages/native/src/fd/index.ts +35 -0
  206. package/packages/native/src/fd/types.ts +31 -0
  207. package/packages/native/src/glob/index.ts +44 -0
  208. package/packages/native/src/glob/types.ts +53 -0
  209. package/packages/native/src/grep/index.ts +48 -0
  210. package/packages/native/src/grep/types.ts +105 -0
  211. package/packages/native/src/highlight/index.ts +44 -0
  212. package/packages/native/src/highlight/types.ts +25 -0
  213. package/packages/native/src/html/index.ts +24 -0
  214. package/packages/native/src/html/types.ts +7 -0
  215. package/packages/native/src/image/index.ts +28 -0
  216. package/packages/native/src/image/types.ts +41 -0
  217. package/packages/native/src/index.ts +88 -0
  218. package/packages/native/src/native.ts +94 -0
  219. package/packages/native/src/ps/index.ts +52 -0
  220. package/packages/native/src/ps/types.ts +5 -0
  221. package/packages/native/src/text/index.ts +125 -0
  222. package/packages/native/src/text/types.ts +29 -0
  223. package/packages/native/src/ttsr/index.ts +39 -0
  224. package/packages/native/src/ttsr/types.ts +10 -0
  225. package/packages/native/tsconfig.json +8 -0
  226. package/packages/pi-coding-agent/dist/core/lsp/client.d.ts +46 -0
  227. package/packages/pi-coding-agent/dist/core/lsp/client.d.ts.map +1 -0
  228. package/packages/pi-coding-agent/dist/core/lsp/client.js +758 -0
  229. package/packages/pi-coding-agent/dist/core/lsp/client.js.map +1 -0
  230. package/packages/pi-coding-agent/dist/core/lsp/config.d.ts +23 -0
  231. package/packages/pi-coding-agent/dist/core/lsp/config.d.ts.map +1 -0
  232. package/packages/pi-coding-agent/dist/core/lsp/config.js +267 -0
  233. package/packages/pi-coding-agent/dist/core/lsp/config.js.map +1 -0
  234. package/packages/pi-coding-agent/dist/core/lsp/defaults.json +456 -0
  235. package/packages/pi-coding-agent/dist/core/lsp/edits.d.ts +17 -0
  236. package/packages/pi-coding-agent/dist/core/lsp/edits.d.ts.map +1 -0
  237. package/packages/pi-coding-agent/dist/core/lsp/edits.js +101 -0
  238. package/packages/pi-coding-agent/dist/core/lsp/edits.js.map +1 -0
  239. package/packages/pi-coding-agent/dist/core/lsp/helpers.d.ts +15 -0
  240. package/packages/pi-coding-agent/dist/core/lsp/helpers.d.ts.map +1 -0
  241. package/packages/pi-coding-agent/dist/core/lsp/helpers.js +46 -0
  242. package/packages/pi-coding-agent/dist/core/lsp/helpers.js.map +1 -0
  243. package/packages/pi-coding-agent/dist/core/lsp/index.d.ts +35 -0
  244. package/packages/pi-coding-agent/dist/core/lsp/index.d.ts.map +1 -0
  245. package/packages/pi-coding-agent/dist/core/lsp/index.js +709 -0
  246. package/packages/pi-coding-agent/dist/core/lsp/index.js.map +1 -0
  247. package/packages/pi-coding-agent/dist/core/lsp/lsp-integration.test.d.ts +2 -0
  248. package/packages/pi-coding-agent/dist/core/lsp/lsp-integration.test.d.ts.map +1 -0
  249. package/packages/pi-coding-agent/dist/core/lsp/lsp-integration.test.js +308 -0
  250. package/packages/pi-coding-agent/dist/core/lsp/lsp-integration.test.js.map +1 -0
  251. package/packages/pi-coding-agent/dist/core/lsp/lsp.md +33 -0
  252. package/packages/pi-coding-agent/dist/core/lsp/lspmux.d.ts +34 -0
  253. package/packages/pi-coding-agent/dist/core/lsp/lspmux.d.ts.map +1 -0
  254. package/packages/pi-coding-agent/dist/core/lsp/lspmux.js +136 -0
  255. package/packages/pi-coding-agent/dist/core/lsp/lspmux.js.map +1 -0
  256. package/packages/pi-coding-agent/dist/core/lsp/types.d.ts +262 -0
  257. package/packages/pi-coding-agent/dist/core/lsp/types.d.ts.map +1 -0
  258. package/packages/pi-coding-agent/dist/core/lsp/types.js +64 -0
  259. package/packages/pi-coding-agent/dist/core/lsp/types.js.map +1 -0
  260. package/packages/pi-coding-agent/dist/core/lsp/utils.d.ts +50 -0
  261. package/packages/pi-coding-agent/dist/core/lsp/utils.d.ts.map +1 -0
  262. package/packages/pi-coding-agent/dist/core/lsp/utils.js +574 -0
  263. package/packages/pi-coding-agent/dist/core/lsp/utils.js.map +1 -0
  264. package/packages/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -1
  265. package/packages/pi-coding-agent/dist/core/slash-commands.js +1 -0
  266. package/packages/pi-coding-agent/dist/core/slash-commands.js.map +1 -1
  267. package/packages/pi-coding-agent/dist/core/tools/find.d.ts +1 -1
  268. package/packages/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
  269. package/packages/pi-coding-agent/dist/core/tools/find.js +12 -77
  270. package/packages/pi-coding-agent/dist/core/tools/find.js.map +1 -1
  271. package/packages/pi-coding-agent/dist/core/tools/hashline-edit.d.ts +60 -0
  272. package/packages/pi-coding-agent/dist/core/tools/hashline-edit.d.ts.map +1 -0
  273. package/packages/pi-coding-agent/dist/core/tools/hashline-edit.js +247 -0
  274. package/packages/pi-coding-agent/dist/core/tools/hashline-edit.js.map +1 -0
  275. package/packages/pi-coding-agent/dist/core/tools/hashline-read.d.ts +43 -0
  276. package/packages/pi-coding-agent/dist/core/tools/hashline-read.d.ts.map +1 -0
  277. package/packages/pi-coding-agent/dist/core/tools/hashline-read.js +146 -0
  278. package/packages/pi-coding-agent/dist/core/tools/hashline-read.js.map +1 -0
  279. package/packages/pi-coding-agent/dist/core/tools/hashline.d.ts +114 -0
  280. package/packages/pi-coding-agent/dist/core/tools/hashline.d.ts.map +1 -0
  281. package/packages/pi-coding-agent/dist/core/tools/hashline.js +522 -0
  282. package/packages/pi-coding-agent/dist/core/tools/hashline.js.map +1 -0
  283. package/packages/pi-coding-agent/dist/core/tools/hashline.test.d.ts +2 -0
  284. package/packages/pi-coding-agent/dist/core/tools/hashline.test.d.ts.map +1 -0
  285. package/packages/pi-coding-agent/dist/core/tools/hashline.test.js +376 -0
  286. package/packages/pi-coding-agent/dist/core/tools/hashline.test.js.map +1 -0
  287. package/packages/pi-coding-agent/dist/core/tools/index.d.ts +38 -0
  288. package/packages/pi-coding-agent/dist/core/tools/index.d.ts.map +1 -1
  289. package/packages/pi-coding-agent/dist/core/tools/index.js +27 -0
  290. package/packages/pi-coding-agent/dist/core/tools/index.js.map +1 -1
  291. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +10 -1
  292. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  293. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +2 -2
  294. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
  295. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  296. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +6 -3
  297. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  298. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +2 -1
  299. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  300. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +54 -10
  301. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  302. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  303. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +25 -40
  304. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  305. package/packages/pi-coding-agent/dist/utils/clipboard-image.d.ts.map +1 -1
  306. package/packages/pi-coding-agent/dist/utils/clipboard-image.js +17 -21
  307. package/packages/pi-coding-agent/dist/utils/clipboard-image.js.map +1 -1
  308. package/packages/pi-coding-agent/dist/utils/clipboard-native.d.ts +7 -6
  309. package/packages/pi-coding-agent/dist/utils/clipboard-native.d.ts.map +1 -1
  310. package/packages/pi-coding-agent/dist/utils/clipboard-native.js +7 -13
  311. package/packages/pi-coding-agent/dist/utils/clipboard-native.js.map +1 -1
  312. package/packages/pi-coding-agent/dist/utils/clipboard.d.ts.map +1 -1
  313. package/packages/pi-coding-agent/dist/utils/clipboard.js +3 -56
  314. package/packages/pi-coding-agent/dist/utils/clipboard.js.map +1 -1
  315. package/packages/pi-coding-agent/dist/utils/image-convert.d.ts.map +1 -1
  316. package/packages/pi-coding-agent/dist/utils/image-convert.js +7 -17
  317. package/packages/pi-coding-agent/dist/utils/image-convert.js.map +1 -1
  318. package/packages/pi-coding-agent/dist/utils/image-resize.d.ts +1 -2
  319. package/packages/pi-coding-agent/dist/utils/image-resize.d.ts.map +1 -1
  320. package/packages/pi-coding-agent/dist/utils/image-resize.js +21 -29
  321. package/packages/pi-coding-agent/dist/utils/image-resize.js.map +1 -1
  322. package/packages/pi-coding-agent/package.json +2 -5
  323. package/packages/pi-coding-agent/src/core/lsp/client.ts +880 -0
  324. package/packages/pi-coding-agent/src/core/lsp/config.ts +325 -0
  325. package/packages/pi-coding-agent/src/core/lsp/defaults.json +456 -0
  326. package/packages/pi-coding-agent/src/core/lsp/edits.ts +109 -0
  327. package/packages/pi-coding-agent/src/core/lsp/helpers.ts +54 -0
  328. package/packages/pi-coding-agent/src/core/lsp/index.ts +943 -0
  329. package/packages/pi-coding-agent/src/core/lsp/lsp-integration.test.ts +407 -0
  330. package/packages/pi-coding-agent/src/core/lsp/lsp.md +33 -0
  331. package/packages/pi-coding-agent/src/core/lsp/lspmux.ts +199 -0
  332. package/packages/pi-coding-agent/src/core/lsp/types.ts +421 -0
  333. package/packages/pi-coding-agent/src/core/lsp/utils.ts +682 -0
  334. package/packages/pi-coding-agent/src/core/slash-commands.ts +1 -0
  335. package/packages/pi-coding-agent/src/core/tools/find.ts +13 -88
  336. package/packages/pi-coding-agent/src/core/tools/hashline-edit.ts +318 -0
  337. package/packages/pi-coding-agent/src/core/tools/hashline-read.ts +196 -0
  338. package/packages/pi-coding-agent/src/core/tools/hashline.test.ts +456 -0
  339. package/packages/pi-coding-agent/src/core/tools/hashline.ts +594 -0
  340. package/packages/pi-coding-agent/src/core/tools/index.ts +63 -0
  341. package/packages/pi-coding-agent/src/modes/interactive/components/settings-selector.ts +2 -2
  342. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +5 -3
  343. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +66 -12
  344. package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +26 -42
  345. package/packages/pi-coding-agent/src/utils/clipboard-image.ts +17 -24
  346. package/packages/pi-coding-agent/src/utils/clipboard-native.ts +11 -21
  347. package/packages/pi-coding-agent/src/utils/clipboard.ts +3 -51
  348. package/packages/pi-coding-agent/src/utils/image-convert.ts +7 -17
  349. package/packages/pi-coding-agent/src/utils/image-resize.ts +28 -34
  350. package/packages/pi-tui/dist/autocomplete.d.ts +1 -3
  351. package/packages/pi-tui/dist/autocomplete.d.ts.map +1 -1
  352. package/packages/pi-tui/dist/autocomplete.js +16 -95
  353. package/packages/pi-tui/dist/autocomplete.js.map +1 -1
  354. package/packages/pi-tui/dist/components/image.d.ts +7 -0
  355. package/packages/pi-tui/dist/components/image.d.ts.map +1 -1
  356. package/packages/pi-tui/dist/components/image.js +20 -1
  357. package/packages/pi-tui/dist/components/image.js.map +1 -1
  358. package/packages/pi-tui/dist/index.d.ts +1 -1
  359. package/packages/pi-tui/dist/index.d.ts.map +1 -1
  360. package/packages/pi-tui/dist/index.js +1 -1
  361. package/packages/pi-tui/dist/index.js.map +1 -1
  362. package/packages/pi-tui/dist/terminal-image.d.ts +5 -5
  363. package/packages/pi-tui/dist/terminal-image.d.ts.map +1 -1
  364. package/packages/pi-tui/dist/terminal-image.js +9 -120
  365. package/packages/pi-tui/dist/terminal-image.js.map +1 -1
  366. package/packages/pi-tui/dist/utils.d.ts +23 -26
  367. package/packages/pi-tui/dist/utils.d.ts.map +1 -1
  368. package/packages/pi-tui/dist/utils.js +47 -716
  369. package/packages/pi-tui/dist/utils.js.map +1 -1
  370. package/packages/pi-tui/package.json +1 -0
  371. package/packages/pi-tui/src/autocomplete.ts +17 -112
  372. package/packages/pi-tui/src/components/image.ts +23 -1
  373. package/packages/pi-tui/src/index.ts +0 -4
  374. package/packages/pi-tui/src/terminal-image.ts +9 -135
  375. package/packages/pi-tui/src/utils.ts +51 -775
  376. package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  377. package/pkg/dist/modes/interactive/theme/theme.js +25 -40
  378. package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
  379. package/src/resources/extensions/ask-user-questions.ts +2 -2
  380. package/src/resources/extensions/bg-shell/index.ts +377 -51
  381. package/src/resources/extensions/browser-tools/core.d.ts +205 -0
  382. package/src/resources/extensions/browser-tools/index.ts +2 -2
  383. package/src/resources/extensions/browser-tools/refs.ts +1 -1
  384. package/src/resources/extensions/browser-tools/tools/session.ts +1 -1
  385. package/src/resources/extensions/context7/index.ts +2 -2
  386. package/src/resources/extensions/get-secrets-from-user.ts +3 -2
  387. package/src/resources/extensions/google-search/index.ts +1 -1
  388. package/src/resources/extensions/gsd/auto.ts +41 -4
  389. package/src/resources/extensions/gsd/commands.ts +218 -3
  390. package/src/resources/extensions/gsd/doctor.ts +1 -1
  391. package/src/resources/extensions/gsd/git-service.ts +129 -5
  392. package/src/resources/extensions/gsd/guided-flow.ts +19 -9
  393. package/src/resources/extensions/gsd/index.ts +17 -7
  394. package/src/resources/extensions/gsd/preferences.ts +1 -1
  395. package/src/resources/extensions/gsd/tests/git-service.test.ts +226 -0
  396. package/src/resources/extensions/gsd/tests/migrate-command.test.ts +2 -2
  397. package/src/resources/extensions/gsd/tests/migrate-transformer.test.ts +1 -1
  398. package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +10 -10
  399. package/src/resources/extensions/gsd/tests/next-milestone-id.test.ts +87 -0
  400. package/src/resources/extensions/gsd/tests/worktree.test.ts +352 -0
  401. package/src/resources/extensions/gsd/types.ts +1 -0
  402. package/src/resources/extensions/gsd/worktree.ts +20 -1
  403. package/src/resources/extensions/mac-tools/index.ts +1 -1
  404. package/src/resources/extensions/search-the-web/format.ts +1 -1
  405. package/src/resources/extensions/search-the-web/index.ts +5 -5
  406. package/src/resources/extensions/search-the-web/tool-fetch-page.ts +7 -7
  407. package/src/resources/extensions/search-the-web/tool-llm-context.ts +11 -11
  408. package/src/resources/extensions/search-the-web/tool-search.ts +10 -10
  409. package/src/resources/extensions/shared/interview-ui.ts +2 -2
  410. package/src/resources/extensions/universal-config/discovery.ts +78 -0
  411. package/src/resources/extensions/universal-config/format.ts +160 -0
  412. package/src/resources/extensions/universal-config/index.ts +118 -0
  413. package/src/resources/extensions/universal-config/package.json +11 -0
  414. package/src/resources/extensions/universal-config/scanners.ts +579 -0
  415. package/src/resources/extensions/universal-config/tests/discovery.test.ts +111 -0
  416. package/src/resources/extensions/universal-config/tests/format.test.ts +111 -0
  417. package/src/resources/extensions/universal-config/tests/scanners.test.ts +438 -0
  418. package/src/resources/extensions/universal-config/tools.ts +60 -0
  419. package/src/resources/extensions/universal-config/types.ts +116 -0
  420. package/node_modules/@mariozechner/clipboard/.yarnrc.yml +0 -1
  421. package/node_modules/@mariozechner/clipboard/Cargo.toml +0 -26
  422. package/node_modules/@mariozechner/clipboard/README.md +0 -58
  423. package/node_modules/@mariozechner/clipboard/build.rs +0 -5
  424. package/node_modules/@mariozechner/clipboard/exp.ts +0 -12
  425. package/node_modules/@mariozechner/clipboard/index.d.ts +0 -23
  426. package/node_modules/@mariozechner/clipboard/index.js +0 -317
  427. package/node_modules/@mariozechner/clipboard/package.json +0 -56
  428. package/node_modules/@mariozechner/clipboard/src/lib.rs +0 -191
  429. package/node_modules/@mariozechner/clipboard-darwin-arm64/README.md +0 -3
  430. package/node_modules/@mariozechner/clipboard-darwin-arm64/clipboard.darwin-arm64.node +0 -0
  431. package/node_modules/@mariozechner/clipboard-darwin-arm64/package.json +0 -22
  432. package/node_modules/@mariozechner/clipboard-darwin-universal/README.md +0 -3
  433. package/node_modules/@mariozechner/clipboard-darwin-universal/clipboard.darwin-universal.node +0 -0
  434. package/node_modules/@mariozechner/clipboard-darwin-universal/package.json +0 -19
  435. package/node_modules/ansi-styles/index.d.ts +0 -345
  436. package/node_modules/ansi-styles/index.js +0 -163
  437. package/node_modules/ansi-styles/license +0 -9
  438. package/node_modules/ansi-styles/package.json +0 -56
  439. package/node_modules/ansi-styles/readme.md +0 -152
  440. package/node_modules/any-promise/.jshintrc +0 -4
  441. package/node_modules/any-promise/.npmignore +0 -7
  442. package/node_modules/any-promise/LICENSE +0 -19
  443. package/node_modules/any-promise/README.md +0 -161
  444. package/node_modules/any-promise/implementation.d.ts +0 -3
  445. package/node_modules/any-promise/implementation.js +0 -1
  446. package/node_modules/any-promise/index.d.ts +0 -73
  447. package/node_modules/any-promise/index.js +0 -1
  448. package/node_modules/any-promise/loader.js +0 -78
  449. package/node_modules/any-promise/optional.js +0 -6
  450. package/node_modules/any-promise/package.json +0 -45
  451. package/node_modules/any-promise/register/bluebird.d.ts +0 -1
  452. package/node_modules/any-promise/register/bluebird.js +0 -2
  453. package/node_modules/any-promise/register/es6-promise.d.ts +0 -1
  454. package/node_modules/any-promise/register/es6-promise.js +0 -2
  455. package/node_modules/any-promise/register/lie.d.ts +0 -1
  456. package/node_modules/any-promise/register/lie.js +0 -2
  457. package/node_modules/any-promise/register/native-promise-only.d.ts +0 -1
  458. package/node_modules/any-promise/register/native-promise-only.js +0 -2
  459. package/node_modules/any-promise/register/pinkie.d.ts +0 -1
  460. package/node_modules/any-promise/register/pinkie.js +0 -2
  461. package/node_modules/any-promise/register/promise.d.ts +0 -1
  462. package/node_modules/any-promise/register/promise.js +0 -2
  463. package/node_modules/any-promise/register/q.d.ts +0 -1
  464. package/node_modules/any-promise/register/q.js +0 -2
  465. package/node_modules/any-promise/register/rsvp.d.ts +0 -1
  466. package/node_modules/any-promise/register/rsvp.js +0 -2
  467. package/node_modules/any-promise/register/vow.d.ts +0 -1
  468. package/node_modules/any-promise/register/vow.js +0 -2
  469. package/node_modules/any-promise/register/when.d.ts +0 -1
  470. package/node_modules/any-promise/register/when.js +0 -2
  471. package/node_modules/any-promise/register-shim.js +0 -18
  472. package/node_modules/any-promise/register.d.ts +0 -17
  473. package/node_modules/any-promise/register.js +0 -94
  474. package/node_modules/cli-highlight/LICENSE.txt +0 -15
  475. package/node_modules/cli-highlight/README.md +0 -88
  476. package/node_modules/cli-highlight/bin/highlight +0 -2
  477. package/node_modules/cli-highlight/dist/cli.d.ts +0 -1
  478. package/node_modules/cli-highlight/dist/cli.js +0 -102
  479. package/node_modules/cli-highlight/dist/cli.js.map +0 -1
  480. package/node_modules/cli-highlight/dist/index.d.ts +0 -53
  481. package/node_modules/cli-highlight/dist/index.js +0 -112
  482. package/node_modules/cli-highlight/dist/index.js.map +0 -1
  483. package/node_modules/cli-highlight/dist/test/test.d.ts +0 -1
  484. package/node_modules/cli-highlight/dist/test/test.js +0 -62
  485. package/node_modules/cli-highlight/dist/test/test.js.map +0 -1
  486. package/node_modules/cli-highlight/dist/theme.d.ts +0 -270
  487. package/node_modules/cli-highlight/dist/theme.js +0 -265
  488. package/node_modules/cli-highlight/dist/theme.js.map +0 -1
  489. package/node_modules/cli-highlight/node_modules/chalk/index.d.ts +0 -415
  490. package/node_modules/cli-highlight/node_modules/chalk/license +0 -9
  491. package/node_modules/cli-highlight/node_modules/chalk/package.json +0 -68
  492. package/node_modules/cli-highlight/node_modules/chalk/readme.md +0 -341
  493. package/node_modules/cli-highlight/node_modules/chalk/source/index.js +0 -229
  494. package/node_modules/cli-highlight/node_modules/chalk/source/templates.js +0 -134
  495. package/node_modules/cli-highlight/node_modules/chalk/source/util.js +0 -39
  496. package/node_modules/cli-highlight/package.json +0 -129
  497. package/node_modules/cliui/CHANGELOG.md +0 -121
  498. package/node_modules/cliui/LICENSE.txt +0 -14
  499. package/node_modules/cliui/README.md +0 -141
  500. package/node_modules/cliui/build/index.cjs +0 -302
  501. package/node_modules/cliui/build/lib/index.js +0 -287
  502. package/node_modules/cliui/build/lib/string-utils.js +0 -27
  503. package/node_modules/cliui/index.mjs +0 -13
  504. package/node_modules/cliui/node_modules/ansi-regex/index.d.ts +0 -37
  505. package/node_modules/cliui/node_modules/ansi-regex/index.js +0 -10
  506. package/node_modules/cliui/node_modules/ansi-regex/license +0 -9
  507. package/node_modules/cliui/node_modules/ansi-regex/package.json +0 -55
  508. package/node_modules/cliui/node_modules/ansi-regex/readme.md +0 -78
  509. package/node_modules/cliui/node_modules/strip-ansi/index.d.ts +0 -17
  510. package/node_modules/cliui/node_modules/strip-ansi/index.js +0 -4
  511. package/node_modules/cliui/node_modules/strip-ansi/license +0 -9
  512. package/node_modules/cliui/node_modules/strip-ansi/package.json +0 -54
  513. package/node_modules/cliui/node_modules/strip-ansi/readme.md +0 -46
  514. package/node_modules/cliui/package.json +0 -83
  515. package/node_modules/color-convert/CHANGELOG.md +0 -54
  516. package/node_modules/color-convert/LICENSE +0 -21
  517. package/node_modules/color-convert/README.md +0 -68
  518. package/node_modules/color-convert/conversions.js +0 -839
  519. package/node_modules/color-convert/index.js +0 -81
  520. package/node_modules/color-convert/package.json +0 -48
  521. package/node_modules/color-convert/route.js +0 -97
  522. package/node_modules/color-name/LICENSE +0 -8
  523. package/node_modules/color-name/README.md +0 -11
  524. package/node_modules/color-name/index.js +0 -152
  525. package/node_modules/color-name/package.json +0 -28
  526. package/node_modules/emoji-regex/LICENSE-MIT.txt +0 -20
  527. package/node_modules/emoji-regex/README.md +0 -73
  528. package/node_modules/emoji-regex/es2015/index.js +0 -6
  529. package/node_modules/emoji-regex/es2015/text.js +0 -6
  530. package/node_modules/emoji-regex/index.d.ts +0 -23
  531. package/node_modules/emoji-regex/index.js +0 -6
  532. package/node_modules/emoji-regex/package.json +0 -50
  533. package/node_modules/emoji-regex/text.js +0 -6
  534. package/node_modules/escalade/dist/index.js +0 -22
  535. package/node_modules/escalade/dist/index.mjs +0 -22
  536. package/node_modules/escalade/index.d.mts +0 -11
  537. package/node_modules/escalade/index.d.ts +0 -15
  538. package/node_modules/escalade/license +0 -9
  539. package/node_modules/escalade/package.json +0 -74
  540. package/node_modules/escalade/readme.md +0 -211
  541. package/node_modules/escalade/sync/index.d.mts +0 -9
  542. package/node_modules/escalade/sync/index.d.ts +0 -13
  543. package/node_modules/escalade/sync/index.js +0 -18
  544. package/node_modules/escalade/sync/index.mjs +0 -18
  545. package/node_modules/esprima/ChangeLog +0 -235
  546. package/node_modules/get-caller-file/LICENSE.md +0 -6
  547. package/node_modules/get-caller-file/README.md +0 -41
  548. package/node_modules/get-caller-file/index.d.ts +0 -2
  549. package/node_modules/get-caller-file/index.js +0 -22
  550. package/node_modules/get-caller-file/index.js.map +0 -1
  551. package/node_modules/get-caller-file/package.json +0 -42
  552. package/node_modules/has-flag/index.d.ts +0 -39
  553. package/node_modules/has-flag/index.js +0 -8
  554. package/node_modules/has-flag/license +0 -9
  555. package/node_modules/has-flag/package.json +0 -46
  556. package/node_modules/has-flag/readme.md +0 -89
  557. package/node_modules/highlight.js/LICENSE +0 -29
  558. package/node_modules/highlight.js/README.md +0 -371
  559. package/node_modules/highlight.js/lib/core.js +0 -2517
  560. package/node_modules/highlight.js/lib/highlight.js +0 -2
  561. package/node_modules/highlight.js/lib/index.js +0 -195
  562. package/node_modules/highlight.js/lib/languages/1c.js +0 -521
  563. package/node_modules/highlight.js/lib/languages/abnf.js +0 -103
  564. package/node_modules/highlight.js/lib/languages/accesslog.js +0 -127
  565. package/node_modules/highlight.js/lib/languages/actionscript.js +0 -113
  566. package/node_modules/highlight.js/lib/languages/ada.js +0 -194
  567. package/node_modules/highlight.js/lib/languages/angelscript.js +0 -123
  568. package/node_modules/highlight.js/lib/languages/apache.js +0 -89
  569. package/node_modules/highlight.js/lib/languages/applescript.js +0 -189
  570. package/node_modules/highlight.js/lib/languages/arcade.js +0 -165
  571. package/node_modules/highlight.js/lib/languages/arduino.js +0 -576
  572. package/node_modules/highlight.js/lib/languages/armasm.js +0 -131
  573. package/node_modules/highlight.js/lib/languages/asciidoc.js +0 -303
  574. package/node_modules/highlight.js/lib/languages/aspectj.js +0 -186
  575. package/node_modules/highlight.js/lib/languages/autohotkey.js +0 -84
  576. package/node_modules/highlight.js/lib/languages/autoit.js +0 -183
  577. package/node_modules/highlight.js/lib/languages/avrasm.js +0 -80
  578. package/node_modules/highlight.js/lib/languages/awk.js +0 -73
  579. package/node_modules/highlight.js/lib/languages/axapta.js +0 -179
  580. package/node_modules/highlight.js/lib/languages/bash.js +0 -169
  581. package/node_modules/highlight.js/lib/languages/basic.js +0 -65
  582. package/node_modules/highlight.js/lib/languages/bnf.js +0 -38
  583. package/node_modules/highlight.js/lib/languages/brainfuck.js +0 -46
  584. package/node_modules/highlight.js/lib/languages/c-like.js +0 -501
  585. package/node_modules/highlight.js/lib/languages/c.js +0 -309
  586. package/node_modules/highlight.js/lib/languages/cal.js +0 -104
  587. package/node_modules/highlight.js/lib/languages/capnproto.js +0 -64
  588. package/node_modules/highlight.js/lib/languages/ceylon.js +0 -82
  589. package/node_modules/highlight.js/lib/languages/clean.js +0 -40
  590. package/node_modules/highlight.js/lib/languages/clojure-repl.js +0 -27
  591. package/node_modules/highlight.js/lib/languages/clojure.js +0 -158
  592. package/node_modules/highlight.js/lib/languages/cmake.js +0 -64
  593. package/node_modules/highlight.js/lib/languages/coffeescript.js +0 -356
  594. package/node_modules/highlight.js/lib/languages/coq.js +0 -79
  595. package/node_modules/highlight.js/lib/languages/cos.js +0 -138
  596. package/node_modules/highlight.js/lib/languages/cpp.js +0 -464
  597. package/node_modules/highlight.js/lib/languages/crmsh.js +0 -102
  598. package/node_modules/highlight.js/lib/languages/crystal.js +0 -326
  599. package/node_modules/highlight.js/lib/languages/csharp.js +0 -441
  600. package/node_modules/highlight.js/lib/languages/csp.js +0 -37
  601. package/node_modules/highlight.js/lib/languages/css.js +0 -608
  602. package/node_modules/highlight.js/lib/languages/d.js +0 -271
  603. package/node_modules/highlight.js/lib/languages/dart.js +0 -199
  604. package/node_modules/highlight.js/lib/languages/delphi.js +0 -126
  605. package/node_modules/highlight.js/lib/languages/diff.js +0 -85
  606. package/node_modules/highlight.js/lib/languages/django.js +0 -77
  607. package/node_modules/highlight.js/lib/languages/dns.js +0 -46
  608. package/node_modules/highlight.js/lib/languages/dockerfile.js +0 -34
  609. package/node_modules/highlight.js/lib/languages/dos.js +0 -70
  610. package/node_modules/highlight.js/lib/languages/dsconfig.js +0 -66
  611. package/node_modules/highlight.js/lib/languages/dts.js +0 -153
  612. package/node_modules/highlight.js/lib/languages/dust.js +0 -45
  613. package/node_modules/highlight.js/lib/languages/ebnf.js +0 -53
  614. package/node_modules/highlight.js/lib/languages/elixir.js +0 -259
  615. package/node_modules/highlight.js/lib/languages/elm.js +0 -129
  616. package/node_modules/highlight.js/lib/languages/erb.js +0 -29
  617. package/node_modules/highlight.js/lib/languages/erlang-repl.js +0 -86
  618. package/node_modules/highlight.js/lib/languages/erlang.js +0 -199
  619. package/node_modules/highlight.js/lib/languages/excel.js +0 -64
  620. package/node_modules/highlight.js/lib/languages/fix.js +0 -37
  621. package/node_modules/highlight.js/lib/languages/flix.js +0 -54
  622. package/node_modules/highlight.js/lib/languages/fortran.js +0 -159
  623. package/node_modules/highlight.js/lib/languages/fsharp.js +0 -86
  624. package/node_modules/highlight.js/lib/languages/gams.js +0 -208
  625. package/node_modules/highlight.js/lib/languages/gauss.js +0 -316
  626. package/node_modules/highlight.js/lib/languages/gcode.js +0 -88
  627. package/node_modules/highlight.js/lib/languages/gherkin.js +0 -49
  628. package/node_modules/highlight.js/lib/languages/glsl.js +0 -128
  629. package/node_modules/highlight.js/lib/languages/gml.js +0 -885
  630. package/node_modules/highlight.js/lib/languages/go.js +0 -74
  631. package/node_modules/highlight.js/lib/languages/golo.js +0 -33
  632. package/node_modules/highlight.js/lib/languages/gradle.js +0 -44
  633. package/node_modules/highlight.js/lib/languages/groovy.js +0 -174
  634. package/node_modules/highlight.js/lib/languages/haml.js +0 -117
  635. package/node_modules/highlight.js/lib/languages/handlebars.js +0 -324
  636. package/node_modules/highlight.js/lib/languages/haskell.js +0 -173
  637. package/node_modules/highlight.js/lib/languages/haxe.js +0 -157
  638. package/node_modules/highlight.js/lib/languages/hsp.js +0 -65
  639. package/node_modules/highlight.js/lib/languages/htmlbars.js +0 -352
  640. package/node_modules/highlight.js/lib/languages/http.js +0 -121
  641. package/node_modules/highlight.js/lib/languages/hy.js +0 -109
  642. package/node_modules/highlight.js/lib/languages/inform7.js +0 -70
  643. package/node_modules/highlight.js/lib/languages/ini.js +0 -173
  644. package/node_modules/highlight.js/lib/languages/irpf90.js +0 -141
  645. package/node_modules/highlight.js/lib/languages/isbl.js +0 -3207
  646. package/node_modules/highlight.js/lib/languages/java.js +0 -181
  647. package/node_modules/highlight.js/lib/languages/javascript.js +0 -604
  648. package/node_modules/highlight.js/lib/languages/jboss-cli.js +0 -63
  649. package/node_modules/highlight.js/lib/languages/json.js +0 -63
  650. package/node_modules/highlight.js/lib/languages/julia-repl.js +0 -50
  651. package/node_modules/highlight.js/lib/languages/julia.js +0 -416
  652. package/node_modules/highlight.js/lib/languages/kotlin.js +0 -284
  653. package/node_modules/highlight.js/lib/languages/lasso.js +0 -187
  654. package/node_modules/highlight.js/lib/languages/latex.js +0 -276
  655. package/node_modules/highlight.js/lib/languages/ldif.js +0 -42
  656. package/node_modules/highlight.js/lib/languages/leaf.js +0 -49
  657. package/node_modules/highlight.js/lib/languages/less.js +0 -666
  658. package/node_modules/highlight.js/lib/languages/lisp.js +0 -111
  659. package/node_modules/highlight.js/lib/languages/livecodeserver.js +0 -189
  660. package/node_modules/highlight.js/lib/languages/livescript.js +0 -374
  661. package/node_modules/highlight.js/lib/languages/llvm.js +0 -154
  662. package/node_modules/highlight.js/lib/languages/lsl.js +0 -95
  663. package/node_modules/highlight.js/lib/languages/lua.js +0 -82
  664. package/node_modules/highlight.js/lib/languages/makefile.js +0 -92
  665. package/node_modules/highlight.js/lib/languages/markdown.js +0 -258
  666. package/node_modules/highlight.js/lib/languages/mathematica.js +0 -6797
  667. package/node_modules/highlight.js/lib/languages/matlab.js +0 -106
  668. package/node_modules/highlight.js/lib/languages/maxima.js +0 -417
  669. package/node_modules/highlight.js/lib/languages/mel.js +0 -236
  670. package/node_modules/highlight.js/lib/languages/mercury.js +0 -121
  671. package/node_modules/highlight.js/lib/languages/mipsasm.js +0 -109
  672. package/node_modules/highlight.js/lib/languages/mizar.js +0 -29
  673. package/node_modules/highlight.js/lib/languages/mojolicious.js +0 -36
  674. package/node_modules/highlight.js/lib/languages/monkey.js +0 -89
  675. package/node_modules/highlight.js/lib/languages/moonscript.js +0 -147
  676. package/node_modules/highlight.js/lib/languages/n1ql.js +0 -77
  677. package/node_modules/highlight.js/lib/languages/nginx.js +0 -140
  678. package/node_modules/highlight.js/lib/languages/nim.js +0 -79
  679. package/node_modules/highlight.js/lib/languages/nix.js +0 -65
  680. package/node_modules/highlight.js/lib/languages/node-repl.js +0 -37
  681. package/node_modules/highlight.js/lib/languages/nsis.js +0 -119
  682. package/node_modules/highlight.js/lib/languages/objectivec.js +0 -121
  683. package/node_modules/highlight.js/lib/languages/ocaml.js +0 -82
  684. package/node_modules/highlight.js/lib/languages/openscad.js +0 -81
  685. package/node_modules/highlight.js/lib/languages/oxygene.js +0 -101
  686. package/node_modules/highlight.js/lib/languages/parser3.js +0 -57
  687. package/node_modules/highlight.js/lib/languages/perl.js +0 -515
  688. package/node_modules/highlight.js/lib/languages/pf.js +0 -59
  689. package/node_modules/highlight.js/lib/languages/pgsql.js +0 -630
  690. package/node_modules/highlight.js/lib/languages/php-template.js +0 -54
  691. package/node_modules/highlight.js/lib/languages/php.js +0 -204
  692. package/node_modules/highlight.js/lib/languages/plaintext.js +0 -19
  693. package/node_modules/highlight.js/lib/languages/pony.js +0 -89
  694. package/node_modules/highlight.js/lib/languages/powershell.js +0 -331
  695. package/node_modules/highlight.js/lib/languages/processing.js +0 -58
  696. package/node_modules/highlight.js/lib/languages/profile.js +0 -43
  697. package/node_modules/highlight.js/lib/languages/prolog.js +0 -102
  698. package/node_modules/highlight.js/lib/languages/properties.js +0 -85
  699. package/node_modules/highlight.js/lib/languages/protobuf.js +0 -47
  700. package/node_modules/highlight.js/lib/languages/puppet.js +0 -147
  701. package/node_modules/highlight.js/lib/languages/purebasic.js +0 -101
  702. package/node_modules/highlight.js/lib/languages/python-repl.js +0 -36
  703. package/node_modules/highlight.js/lib/languages/python.js +0 -446
  704. package/node_modules/highlight.js/lib/languages/q.js +0 -37
  705. package/node_modules/highlight.js/lib/languages/qml.js +0 -225
  706. package/node_modules/highlight.js/lib/languages/r.js +0 -231
  707. package/node_modules/highlight.js/lib/languages/reasonml.js +0 -321
  708. package/node_modules/highlight.js/lib/languages/rib.js +0 -37
  709. package/node_modules/highlight.js/lib/languages/roboconf.js +0 -82
  710. package/node_modules/highlight.js/lib/languages/routeros.js +0 -172
  711. package/node_modules/highlight.js/lib/languages/rsl.js +0 -49
  712. package/node_modules/highlight.js/lib/languages/ruby.js +0 -387
  713. package/node_modules/highlight.js/lib/languages/ruleslanguage.js +0 -78
  714. package/node_modules/highlight.js/lib/languages/rust.js +0 -146
  715. package/node_modules/highlight.js/lib/languages/sas.js +0 -133
  716. package/node_modules/highlight.js/lib/languages/scala.js +0 -140
  717. package/node_modules/highlight.js/lib/languages/scheme.js +0 -207
  718. package/node_modules/highlight.js/lib/languages/scilab.js +0 -73
  719. package/node_modules/highlight.js/lib/languages/scss.js +0 -545
  720. package/node_modules/highlight.js/lib/languages/shell.js +0 -30
  721. package/node_modules/highlight.js/lib/languages/smali.js +0 -135
  722. package/node_modules/highlight.js/lib/languages/smalltalk.js +0 -63
  723. package/node_modules/highlight.js/lib/languages/sml.js +0 -81
  724. package/node_modules/highlight.js/lib/languages/sqf.js +0 -448
  725. package/node_modules/highlight.js/lib/languages/sql.js +0 -699
  726. package/node_modules/highlight.js/lib/languages/sql_more.js +0 -183
  727. package/node_modules/highlight.js/lib/languages/stan.js +0 -548
  728. package/node_modules/highlight.js/lib/languages/stata.js +0 -60
  729. package/node_modules/highlight.js/lib/languages/step21.js +0 -66
  730. package/node_modules/highlight.js/lib/languages/stylus.js +0 -609
  731. package/node_modules/highlight.js/lib/languages/subunit.js +0 -51
  732. package/node_modules/highlight.js/lib/languages/swift.js +0 -873
  733. package/node_modules/highlight.js/lib/languages/taggerscript.js +0 -52
  734. package/node_modules/highlight.js/lib/languages/tap.js +0 -55
  735. package/node_modules/highlight.js/lib/languages/tcl.js +0 -115
  736. package/node_modules/highlight.js/lib/languages/thrift.js +0 -51
  737. package/node_modules/highlight.js/lib/languages/tp.js +0 -95
  738. package/node_modules/highlight.js/lib/languages/twig.js +0 -77
  739. package/node_modules/highlight.js/lib/languages/typescript.js +0 -697
  740. package/node_modules/highlight.js/lib/languages/vala.js +0 -61
  741. package/node_modules/highlight.js/lib/languages/vbnet.js +0 -214
  742. package/node_modules/highlight.js/lib/languages/vbscript-html.js +0 -24
  743. package/node_modules/highlight.js/lib/languages/vbscript.js +0 -109
  744. package/node_modules/highlight.js/lib/languages/verilog.js +0 -131
  745. package/node_modules/highlight.js/lib/languages/vhdl.js +0 -71
  746. package/node_modules/highlight.js/lib/languages/vim.js +0 -123
  747. package/node_modules/highlight.js/lib/languages/x86asm.js +0 -163
  748. package/node_modules/highlight.js/lib/languages/xl.js +0 -92
  749. package/node_modules/highlight.js/lib/languages/xml.js +0 -287
  750. package/node_modules/highlight.js/lib/languages/xquery.js +0 -197
  751. package/node_modules/highlight.js/lib/languages/yaml.js +0 -176
  752. package/node_modules/highlight.js/lib/languages/zephir.js +0 -140
  753. package/node_modules/highlight.js/package.json +0 -86
  754. package/node_modules/highlight.js/scss/a11y-dark.scss +0 -99
  755. package/node_modules/highlight.js/scss/a11y-light.scss +0 -99
  756. package/node_modules/highlight.js/scss/agate.scss +0 -108
  757. package/node_modules/highlight.js/scss/an-old-hope.scss +0 -89
  758. package/node_modules/highlight.js/scss/androidstudio.scss +0 -66
  759. package/node_modules/highlight.js/scss/arduino-light.scss +0 -87
  760. package/node_modules/highlight.js/scss/arta.scss +0 -73
  761. package/node_modules/highlight.js/scss/ascetic.scss +0 -45
  762. package/node_modules/highlight.js/scss/atelier-cave-dark.scss +0 -83
  763. package/node_modules/highlight.js/scss/atelier-cave-light.scss +0 -85
  764. package/node_modules/highlight.js/scss/atelier-dune-dark.scss +0 -69
  765. package/node_modules/highlight.js/scss/atelier-dune-light.scss +0 -69
  766. package/node_modules/highlight.js/scss/atelier-estuary-dark.scss +0 -84
  767. package/node_modules/highlight.js/scss/atelier-estuary-light.scss +0 -84
  768. package/node_modules/highlight.js/scss/atelier-forest-dark.scss +0 -69
  769. package/node_modules/highlight.js/scss/atelier-forest-light.scss +0 -69
  770. package/node_modules/highlight.js/scss/atelier-heath-dark.scss +0 -69
  771. package/node_modules/highlight.js/scss/atelier-heath-light.scss +0 -69
  772. package/node_modules/highlight.js/scss/atelier-lakeside-dark.scss +0 -69
  773. package/node_modules/highlight.js/scss/atelier-lakeside-light.scss +0 -69
  774. package/node_modules/highlight.js/scss/atelier-plateau-dark.scss +0 -84
  775. package/node_modules/highlight.js/scss/atelier-plateau-light.scss +0 -84
  776. package/node_modules/highlight.js/scss/atelier-savanna-dark.scss +0 -84
  777. package/node_modules/highlight.js/scss/atelier-savanna-light.scss +0 -84
  778. package/node_modules/highlight.js/scss/atelier-seaside-dark.scss +0 -69
  779. package/node_modules/highlight.js/scss/atelier-seaside-light.scss +0 -69
  780. package/node_modules/highlight.js/scss/atelier-sulphurpool-dark.scss +0 -69
  781. package/node_modules/highlight.js/scss/atelier-sulphurpool-light.scss +0 -69
  782. package/node_modules/highlight.js/scss/atom-one-dark-reasonable.scss +0 -75
  783. package/node_modules/highlight.js/scss/atom-one-dark.scss +0 -96
  784. package/node_modules/highlight.js/scss/atom-one-light.scss +0 -96
  785. package/node_modules/highlight.js/scss/brown-paper.scss +0 -64
  786. package/node_modules/highlight.js/scss/brown-papersq.png +0 -0
  787. package/node_modules/highlight.js/scss/codepen-embed.scss +0 -60
  788. package/node_modules/highlight.js/scss/color-brewer.scss +0 -71
  789. package/node_modules/highlight.js/scss/darcula.scss +0 -74
  790. package/node_modules/highlight.js/scss/dark.scss +0 -63
  791. package/node_modules/highlight.js/scss/default.scss +0 -99
  792. package/node_modules/highlight.js/scss/docco.scss +0 -97
  793. package/node_modules/highlight.js/scss/dracula.scss +0 -76
  794. package/node_modules/highlight.js/scss/far.scss +0 -71
  795. package/node_modules/highlight.js/scss/foundation.scss +0 -89
  796. package/node_modules/highlight.js/scss/github-gist.scss +0 -79
  797. package/node_modules/highlight.js/scss/github.scss +0 -99
  798. package/node_modules/highlight.js/scss/gml.scss +0 -78
  799. package/node_modules/highlight.js/scss/googlecode.scss +0 -89
  800. package/node_modules/highlight.js/scss/gradient-dark.scss +0 -122
  801. package/node_modules/highlight.js/scss/gradient-light.scss +0 -130
  802. package/node_modules/highlight.js/scss/grayscale.scss +0 -101
  803. package/node_modules/highlight.js/scss/gruvbox-dark.scss +0 -108
  804. package/node_modules/highlight.js/scss/gruvbox-light.scss +0 -108
  805. package/node_modules/highlight.js/scss/hopscotch.scss +0 -84
  806. package/node_modules/highlight.js/scss/hybrid.scss +0 -102
  807. package/node_modules/highlight.js/scss/idea.scss +0 -97
  808. package/node_modules/highlight.js/scss/ir-black.scss +0 -73
  809. package/node_modules/highlight.js/scss/isbl-editor-dark.scss +0 -112
  810. package/node_modules/highlight.js/scss/isbl-editor-light.scss +0 -111
  811. package/node_modules/highlight.js/scss/kimbie.dark.scss +0 -74
  812. package/node_modules/highlight.js/scss/kimbie.light.scss +0 -74
  813. package/node_modules/highlight.js/scss/lightfair.scss +0 -88
  814. package/node_modules/highlight.js/scss/lioshi.scss +0 -88
  815. package/node_modules/highlight.js/scss/magula.scss +0 -70
  816. package/node_modules/highlight.js/scss/mono-blue.scss +0 -56
  817. package/node_modules/highlight.js/scss/monokai-sublime.scss +0 -83
  818. package/node_modules/highlight.js/scss/monokai.scss +0 -71
  819. package/node_modules/highlight.js/scss/night-owl.scss +0 -182
  820. package/node_modules/highlight.js/scss/nnfx-dark.scss +0 -106
  821. package/node_modules/highlight.js/scss/nnfx.scss +0 -106
  822. package/node_modules/highlight.js/scss/nord.scss +0 -309
  823. package/node_modules/highlight.js/scss/obsidian.scss +0 -88
  824. package/node_modules/highlight.js/scss/ocean.scss +0 -74
  825. package/node_modules/highlight.js/scss/paraiso-dark.scss +0 -72
  826. package/node_modules/highlight.js/scss/paraiso-light.scss +0 -72
  827. package/node_modules/highlight.js/scss/pojoaque.jpg +0 -0
  828. package/node_modules/highlight.js/scss/pojoaque.scss +0 -83
  829. package/node_modules/highlight.js/scss/purebasic.scss +0 -96
  830. package/node_modules/highlight.js/scss/qtcreator_dark.scss +0 -83
  831. package/node_modules/highlight.js/scss/qtcreator_light.scss +0 -83
  832. package/node_modules/highlight.js/scss/railscasts.scss +0 -106
  833. package/node_modules/highlight.js/scss/rainbow.scss +0 -85
  834. package/node_modules/highlight.js/scss/routeros.scss +0 -108
  835. package/node_modules/highlight.js/scss/school-book.png +0 -0
  836. package/node_modules/highlight.js/scss/school-book.scss +0 -69
  837. package/node_modules/highlight.js/scss/shades-of-purple.scss +0 -96
  838. package/node_modules/highlight.js/scss/solarized-dark.scss +0 -84
  839. package/node_modules/highlight.js/scss/solarized-light.scss +0 -84
  840. package/node_modules/highlight.js/scss/srcery.scss +0 -78
  841. package/node_modules/highlight.js/scss/stackoverflow-dark.scss +0 -78
  842. package/node_modules/highlight.js/scss/stackoverflow-light.scss +0 -78
  843. package/node_modules/highlight.js/scss/sunburst.scss +0 -102
  844. package/node_modules/highlight.js/scss/tomorrow-night-blue.scss +0 -75
  845. package/node_modules/highlight.js/scss/tomorrow-night-bright.scss +0 -74
  846. package/node_modules/highlight.js/scss/tomorrow-night-eighties.scss +0 -74
  847. package/node_modules/highlight.js/scss/tomorrow-night.scss +0 -75
  848. package/node_modules/highlight.js/scss/tomorrow.scss +0 -72
  849. package/node_modules/highlight.js/scss/vs.scss +0 -68
  850. package/node_modules/highlight.js/scss/vs2015.scss +0 -115
  851. package/node_modules/highlight.js/scss/xcode.scss +0 -104
  852. package/node_modules/highlight.js/scss/xt256.scss +0 -92
  853. package/node_modules/highlight.js/scss/zenburn.scss +0 -80
  854. package/node_modules/highlight.js/styles/a11y-dark.css +0 -99
  855. package/node_modules/highlight.js/styles/a11y-light.css +0 -99
  856. package/node_modules/highlight.js/styles/agate.css +0 -108
  857. package/node_modules/highlight.js/styles/an-old-hope.css +0 -89
  858. package/node_modules/highlight.js/styles/androidstudio.css +0 -66
  859. package/node_modules/highlight.js/styles/arduino-light.css +0 -87
  860. package/node_modules/highlight.js/styles/arta.css +0 -73
  861. package/node_modules/highlight.js/styles/ascetic.css +0 -45
  862. package/node_modules/highlight.js/styles/atelier-cave-dark.css +0 -83
  863. package/node_modules/highlight.js/styles/atelier-cave-light.css +0 -85
  864. package/node_modules/highlight.js/styles/atelier-dune-dark.css +0 -69
  865. package/node_modules/highlight.js/styles/atelier-dune-light.css +0 -69
  866. package/node_modules/highlight.js/styles/atelier-estuary-dark.css +0 -84
  867. package/node_modules/highlight.js/styles/atelier-estuary-light.css +0 -84
  868. package/node_modules/highlight.js/styles/atelier-forest-dark.css +0 -69
  869. package/node_modules/highlight.js/styles/atelier-forest-light.css +0 -69
  870. package/node_modules/highlight.js/styles/atelier-heath-dark.css +0 -69
  871. package/node_modules/highlight.js/styles/atelier-heath-light.css +0 -69
  872. package/node_modules/highlight.js/styles/atelier-lakeside-dark.css +0 -69
  873. package/node_modules/highlight.js/styles/atelier-lakeside-light.css +0 -69
  874. package/node_modules/highlight.js/styles/atelier-plateau-dark.css +0 -84
  875. package/node_modules/highlight.js/styles/atelier-plateau-light.css +0 -84
  876. package/node_modules/highlight.js/styles/atelier-savanna-dark.css +0 -84
  877. package/node_modules/highlight.js/styles/atelier-savanna-light.css +0 -84
  878. package/node_modules/highlight.js/styles/atelier-seaside-dark.css +0 -69
  879. package/node_modules/highlight.js/styles/atelier-seaside-light.css +0 -69
  880. package/node_modules/highlight.js/styles/atelier-sulphurpool-dark.css +0 -69
  881. package/node_modules/highlight.js/styles/atelier-sulphurpool-light.css +0 -69
  882. package/node_modules/highlight.js/styles/atom-one-dark-reasonable.css +0 -75
  883. package/node_modules/highlight.js/styles/atom-one-dark.css +0 -96
  884. package/node_modules/highlight.js/styles/atom-one-light.css +0 -96
  885. package/node_modules/highlight.js/styles/brown-paper.css +0 -64
  886. package/node_modules/highlight.js/styles/brown-papersq.png +0 -0
  887. package/node_modules/highlight.js/styles/codepen-embed.css +0 -60
  888. package/node_modules/highlight.js/styles/color-brewer.css +0 -71
  889. package/node_modules/highlight.js/styles/darcula.css +0 -74
  890. package/node_modules/highlight.js/styles/dark.css +0 -63
  891. package/node_modules/highlight.js/styles/default.css +0 -99
  892. package/node_modules/highlight.js/styles/docco.css +0 -97
  893. package/node_modules/highlight.js/styles/dracula.css +0 -76
  894. package/node_modules/highlight.js/styles/far.css +0 -71
  895. package/node_modules/highlight.js/styles/foundation.css +0 -89
  896. package/node_modules/highlight.js/styles/github-gist.css +0 -79
  897. package/node_modules/highlight.js/styles/github.css +0 -99
  898. package/node_modules/highlight.js/styles/gml.css +0 -78
  899. package/node_modules/highlight.js/styles/googlecode.css +0 -89
  900. package/node_modules/highlight.js/styles/gradient-dark.css +0 -122
  901. package/node_modules/highlight.js/styles/gradient-light.css +0 -130
  902. package/node_modules/highlight.js/styles/grayscale.css +0 -101
  903. package/node_modules/highlight.js/styles/gruvbox-dark.css +0 -108
  904. package/node_modules/highlight.js/styles/gruvbox-light.css +0 -108
  905. package/node_modules/highlight.js/styles/hopscotch.css +0 -84
  906. package/node_modules/highlight.js/styles/hybrid.css +0 -102
  907. package/node_modules/highlight.js/styles/idea.css +0 -97
  908. package/node_modules/highlight.js/styles/ir-black.css +0 -73
  909. package/node_modules/highlight.js/styles/isbl-editor-dark.css +0 -112
  910. package/node_modules/highlight.js/styles/isbl-editor-light.css +0 -111
  911. package/node_modules/highlight.js/styles/kimbie.dark.css +0 -74
  912. package/node_modules/highlight.js/styles/kimbie.light.css +0 -74
  913. package/node_modules/highlight.js/styles/lightfair.css +0 -88
  914. package/node_modules/highlight.js/styles/lioshi.css +0 -88
  915. package/node_modules/highlight.js/styles/magula.css +0 -70
  916. package/node_modules/highlight.js/styles/mono-blue.css +0 -56
  917. package/node_modules/highlight.js/styles/monokai-sublime.css +0 -83
  918. package/node_modules/highlight.js/styles/monokai.css +0 -71
  919. package/node_modules/highlight.js/styles/night-owl.css +0 -182
  920. package/node_modules/highlight.js/styles/nnfx-dark.css +0 -106
  921. package/node_modules/highlight.js/styles/nnfx.css +0 -106
  922. package/node_modules/highlight.js/styles/nord.css +0 -309
  923. package/node_modules/highlight.js/styles/obsidian.css +0 -88
  924. package/node_modules/highlight.js/styles/ocean.css +0 -74
  925. package/node_modules/highlight.js/styles/paraiso-dark.css +0 -72
  926. package/node_modules/highlight.js/styles/paraiso-light.css +0 -72
  927. package/node_modules/highlight.js/styles/pojoaque.css +0 -83
  928. package/node_modules/highlight.js/styles/pojoaque.jpg +0 -0
  929. package/node_modules/highlight.js/styles/purebasic.css +0 -96
  930. package/node_modules/highlight.js/styles/qtcreator_dark.css +0 -83
  931. package/node_modules/highlight.js/styles/qtcreator_light.css +0 -83
  932. package/node_modules/highlight.js/styles/railscasts.css +0 -106
  933. package/node_modules/highlight.js/styles/rainbow.css +0 -85
  934. package/node_modules/highlight.js/styles/routeros.css +0 -108
  935. package/node_modules/highlight.js/styles/school-book.css +0 -69
  936. package/node_modules/highlight.js/styles/school-book.png +0 -0
  937. package/node_modules/highlight.js/styles/shades-of-purple.css +0 -96
  938. package/node_modules/highlight.js/styles/solarized-dark.css +0 -84
  939. package/node_modules/highlight.js/styles/solarized-light.css +0 -84
  940. package/node_modules/highlight.js/styles/srcery.css +0 -78
  941. package/node_modules/highlight.js/styles/stackoverflow-dark.css +0 -78
  942. package/node_modules/highlight.js/styles/stackoverflow-light.css +0 -78
  943. package/node_modules/highlight.js/styles/sunburst.css +0 -102
  944. package/node_modules/highlight.js/styles/tomorrow-night-blue.css +0 -75
  945. package/node_modules/highlight.js/styles/tomorrow-night-bright.css +0 -74
  946. package/node_modules/highlight.js/styles/tomorrow-night-eighties.css +0 -74
  947. package/node_modules/highlight.js/styles/tomorrow-night.css +0 -75
  948. package/node_modules/highlight.js/styles/tomorrow.css +0 -72
  949. package/node_modules/highlight.js/styles/vs.css +0 -68
  950. package/node_modules/highlight.js/styles/vs2015.css +0 -115
  951. package/node_modules/highlight.js/styles/xcode.css +0 -104
  952. package/node_modules/highlight.js/styles/xt256.css +0 -92
  953. package/node_modules/highlight.js/styles/zenburn.css +0 -80
  954. package/node_modules/highlight.js/types/index.d.ts +0 -261
  955. package/node_modules/is-fullwidth-code-point/index.d.ts +0 -17
  956. package/node_modules/is-fullwidth-code-point/index.js +0 -50
  957. package/node_modules/is-fullwidth-code-point/license +0 -9
  958. package/node_modules/is-fullwidth-code-point/package.json +0 -42
  959. package/node_modules/is-fullwidth-code-point/readme.md +0 -39
  960. package/node_modules/mz/HISTORY.md +0 -66
  961. package/node_modules/mz/LICENSE +0 -22
  962. package/node_modules/mz/README.md +0 -106
  963. package/node_modules/mz/child_process.js +0 -8
  964. package/node_modules/mz/crypto.js +0 -9
  965. package/node_modules/mz/dns.js +0 -16
  966. package/node_modules/mz/fs.js +0 -62
  967. package/node_modules/mz/index.js +0 -8
  968. package/node_modules/mz/package.json +0 -44
  969. package/node_modules/mz/readline.js +0 -64
  970. package/node_modules/mz/zlib.js +0 -13
  971. package/node_modules/object-assign/index.js +0 -90
  972. package/node_modules/object-assign/license +0 -21
  973. package/node_modules/object-assign/package.json +0 -42
  974. package/node_modules/object-assign/readme.md +0 -61
  975. package/node_modules/parse5/LICENSE +0 -19
  976. package/node_modules/parse5/README.md +0 -38
  977. package/node_modules/parse5/lib/common/doctype.js +0 -162
  978. package/node_modules/parse5/lib/common/error-codes.js +0 -65
  979. package/node_modules/parse5/lib/common/foreign-content.js +0 -265
  980. package/node_modules/parse5/lib/common/html.js +0 -272
  981. package/node_modules/parse5/lib/common/unicode.js +0 -109
  982. package/node_modules/parse5/lib/extensions/error-reporting/mixin-base.js +0 -43
  983. package/node_modules/parse5/lib/extensions/error-reporting/parser-mixin.js +0 -52
  984. package/node_modules/parse5/lib/extensions/error-reporting/preprocessor-mixin.js +0 -24
  985. package/node_modules/parse5/lib/extensions/error-reporting/tokenizer-mixin.js +0 -17
  986. package/node_modules/parse5/lib/extensions/location-info/open-element-stack-mixin.js +0 -35
  987. package/node_modules/parse5/lib/extensions/location-info/parser-mixin.js +0 -222
  988. package/node_modules/parse5/lib/extensions/location-info/tokenizer-mixin.js +0 -146
  989. package/node_modules/parse5/lib/extensions/position-tracking/preprocessor-mixin.js +0 -64
  990. package/node_modules/parse5/lib/index.js +0 -29
  991. package/node_modules/parse5/lib/parser/formatting-element-list.js +0 -181
  992. package/node_modules/parse5/lib/parser/index.js +0 -2956
  993. package/node_modules/parse5/lib/parser/open-element-stack.js +0 -482
  994. package/node_modules/parse5/lib/serializer/index.js +0 -176
  995. package/node_modules/parse5/lib/tokenizer/index.js +0 -2196
  996. package/node_modules/parse5/lib/tokenizer/named-entity-data.js +0 -5
  997. package/node_modules/parse5/lib/tokenizer/preprocessor.js +0 -159
  998. package/node_modules/parse5/lib/tree-adapters/default.js +0 -217
  999. package/node_modules/parse5/lib/utils/merge-options.js +0 -13
  1000. package/node_modules/parse5/lib/utils/mixin.js +0 -39
  1001. package/node_modules/parse5/package.json +0 -35
  1002. package/node_modules/parse5-htmlparser2-tree-adapter/LICENSE +0 -19
  1003. package/node_modules/parse5-htmlparser2-tree-adapter/README.md +0 -34
  1004. package/node_modules/parse5-htmlparser2-tree-adapter/lib/index.js +0 -348
  1005. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/LICENSE +0 -19
  1006. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/README.md +0 -38
  1007. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/doctype.js +0 -162
  1008. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/error-codes.js +0 -65
  1009. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/foreign-content.js +0 -265
  1010. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/html.js +0 -272
  1011. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/unicode.js +0 -109
  1012. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/error-reporting/mixin-base.js +0 -43
  1013. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/error-reporting/parser-mixin.js +0 -52
  1014. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/error-reporting/preprocessor-mixin.js +0 -24
  1015. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/error-reporting/tokenizer-mixin.js +0 -17
  1016. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/location-info/open-element-stack-mixin.js +0 -35
  1017. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/location-info/parser-mixin.js +0 -223
  1018. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/location-info/tokenizer-mixin.js +0 -146
  1019. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/position-tracking/preprocessor-mixin.js +0 -64
  1020. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/index.js +0 -29
  1021. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/parser/formatting-element-list.js +0 -181
  1022. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/parser/index.js +0 -2956
  1023. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/parser/open-element-stack.js +0 -482
  1024. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/serializer/index.js +0 -176
  1025. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/tokenizer/index.js +0 -2196
  1026. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/tokenizer/named-entity-data.js +0 -5
  1027. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/tokenizer/preprocessor.js +0 -159
  1028. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/tree-adapters/default.js +0 -221
  1029. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/utils/merge-options.js +0 -13
  1030. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/utils/mixin.js +0 -39
  1031. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/package.json +0 -35
  1032. package/node_modules/parse5-htmlparser2-tree-adapter/package.json +0 -27
  1033. package/node_modules/proper-lockfile/CHANGELOG.md +0 -108
  1034. package/node_modules/require-directory/.jshintrc +0 -67
  1035. package/node_modules/require-directory/.npmignore +0 -1
  1036. package/node_modules/require-directory/.travis.yml +0 -3
  1037. package/node_modules/require-directory/LICENSE +0 -22
  1038. package/node_modules/require-directory/README.markdown +0 -184
  1039. package/node_modules/require-directory/index.js +0 -86
  1040. package/node_modules/require-directory/package.json +0 -40
  1041. package/node_modules/source-map/CHANGELOG.md +0 -301
  1042. package/node_modules/string-width/index.d.ts +0 -29
  1043. package/node_modules/string-width/index.js +0 -47
  1044. package/node_modules/string-width/license +0 -9
  1045. package/node_modules/string-width/node_modules/ansi-regex/index.d.ts +0 -37
  1046. package/node_modules/string-width/node_modules/ansi-regex/index.js +0 -10
  1047. package/node_modules/string-width/node_modules/ansi-regex/license +0 -9
  1048. package/node_modules/string-width/node_modules/ansi-regex/package.json +0 -55
  1049. package/node_modules/string-width/node_modules/ansi-regex/readme.md +0 -78
  1050. package/node_modules/string-width/node_modules/strip-ansi/index.d.ts +0 -17
  1051. package/node_modules/string-width/node_modules/strip-ansi/index.js +0 -4
  1052. package/node_modules/string-width/node_modules/strip-ansi/license +0 -9
  1053. package/node_modules/string-width/node_modules/strip-ansi/package.json +0 -54
  1054. package/node_modules/string-width/node_modules/strip-ansi/readme.md +0 -46
  1055. package/node_modules/string-width/package.json +0 -56
  1056. package/node_modules/string-width/readme.md +0 -50
  1057. package/node_modules/supports-color/browser.js +0 -5
  1058. package/node_modules/supports-color/index.js +0 -135
  1059. package/node_modules/supports-color/license +0 -9
  1060. package/node_modules/supports-color/package.json +0 -53
  1061. package/node_modules/supports-color/readme.md +0 -76
  1062. package/node_modules/thenify/History.md +0 -11
  1063. package/node_modules/thenify/LICENSE +0 -22
  1064. package/node_modules/thenify/README.md +0 -120
  1065. package/node_modules/thenify/index.js +0 -77
  1066. package/node_modules/thenify/package.json +0 -31
  1067. package/node_modules/thenify-all/History.md +0 -11
  1068. package/node_modules/thenify-all/LICENSE +0 -22
  1069. package/node_modules/thenify-all/README.md +0 -66
  1070. package/node_modules/thenify-all/index.js +0 -73
  1071. package/node_modules/thenify-all/package.json +0 -34
  1072. package/node_modules/wrap-ansi/index.js +0 -216
  1073. package/node_modules/wrap-ansi/license +0 -9
  1074. package/node_modules/wrap-ansi/node_modules/ansi-regex/index.d.ts +0 -37
  1075. package/node_modules/wrap-ansi/node_modules/ansi-regex/index.js +0 -10
  1076. package/node_modules/wrap-ansi/node_modules/ansi-regex/license +0 -9
  1077. package/node_modules/wrap-ansi/node_modules/ansi-regex/package.json +0 -55
  1078. package/node_modules/wrap-ansi/node_modules/ansi-regex/readme.md +0 -78
  1079. package/node_modules/wrap-ansi/node_modules/strip-ansi/index.d.ts +0 -17
  1080. package/node_modules/wrap-ansi/node_modules/strip-ansi/index.js +0 -4
  1081. package/node_modules/wrap-ansi/node_modules/strip-ansi/license +0 -9
  1082. package/node_modules/wrap-ansi/node_modules/strip-ansi/package.json +0 -54
  1083. package/node_modules/wrap-ansi/node_modules/strip-ansi/readme.md +0 -46
  1084. package/node_modules/wrap-ansi/package.json +0 -62
  1085. package/node_modules/wrap-ansi/readme.md +0 -91
  1086. package/node_modules/y18n/CHANGELOG.md +0 -100
  1087. package/node_modules/y18n/LICENSE +0 -13
  1088. package/node_modules/y18n/README.md +0 -127
  1089. package/node_modules/y18n/build/index.cjs +0 -203
  1090. package/node_modules/y18n/build/lib/cjs.js +0 -6
  1091. package/node_modules/y18n/build/lib/index.js +0 -174
  1092. package/node_modules/y18n/build/lib/platform-shims/node.js +0 -19
  1093. package/node_modules/y18n/index.mjs +0 -8
  1094. package/node_modules/y18n/package.json +0 -70
  1095. package/node_modules/yargs/CHANGELOG.md +0 -88
  1096. package/node_modules/yargs/LICENSE +0 -21
  1097. package/node_modules/yargs/README.md +0 -202
  1098. package/node_modules/yargs/browser.mjs +0 -7
  1099. package/node_modules/yargs/build/index.cjs +0 -2920
  1100. package/node_modules/yargs/build/lib/argsert.js +0 -62
  1101. package/node_modules/yargs/build/lib/command.js +0 -382
  1102. package/node_modules/yargs/build/lib/completion-templates.js +0 -47
  1103. package/node_modules/yargs/build/lib/completion.js +0 -128
  1104. package/node_modules/yargs/build/lib/middleware.js +0 -53
  1105. package/node_modules/yargs/build/lib/parse-command.js +0 -32
  1106. package/node_modules/yargs/build/lib/typings/common-types.js +0 -9
  1107. package/node_modules/yargs/build/lib/typings/yargs-parser-types.js +0 -1
  1108. package/node_modules/yargs/build/lib/usage.js +0 -548
  1109. package/node_modules/yargs/build/lib/utils/apply-extends.js +0 -59
  1110. package/node_modules/yargs/build/lib/utils/is-promise.js +0 -5
  1111. package/node_modules/yargs/build/lib/utils/levenshtein.js +0 -26
  1112. package/node_modules/yargs/build/lib/utils/obj-filter.js +0 -10
  1113. package/node_modules/yargs/build/lib/utils/process-argv.js +0 -17
  1114. package/node_modules/yargs/build/lib/utils/set-blocking.js +0 -12
  1115. package/node_modules/yargs/build/lib/utils/which-module.js +0 -10
  1116. package/node_modules/yargs/build/lib/validation.js +0 -308
  1117. package/node_modules/yargs/build/lib/yargs-factory.js +0 -1143
  1118. package/node_modules/yargs/build/lib/yerror.js +0 -7
  1119. package/node_modules/yargs/helpers/helpers.mjs +0 -10
  1120. package/node_modules/yargs/helpers/index.js +0 -14
  1121. package/node_modules/yargs/helpers/package.json +0 -3
  1122. package/node_modules/yargs/index.cjs +0 -39
  1123. package/node_modules/yargs/index.mjs +0 -8
  1124. package/node_modules/yargs/lib/platform-shims/browser.mjs +0 -92
  1125. package/node_modules/yargs/lib/platform-shims/esm.mjs +0 -67
  1126. package/node_modules/yargs/locales/be.json +0 -46
  1127. package/node_modules/yargs/locales/de.json +0 -46
  1128. package/node_modules/yargs/locales/en.json +0 -51
  1129. package/node_modules/yargs/locales/es.json +0 -46
  1130. package/node_modules/yargs/locales/fi.json +0 -49
  1131. package/node_modules/yargs/locales/fr.json +0 -53
  1132. package/node_modules/yargs/locales/hi.json +0 -49
  1133. package/node_modules/yargs/locales/hu.json +0 -46
  1134. package/node_modules/yargs/locales/id.json +0 -50
  1135. package/node_modules/yargs/locales/it.json +0 -46
  1136. package/node_modules/yargs/locales/ja.json +0 -51
  1137. package/node_modules/yargs/locales/ko.json +0 -49
  1138. package/node_modules/yargs/locales/nb.json +0 -44
  1139. package/node_modules/yargs/locales/nl.json +0 -49
  1140. package/node_modules/yargs/locales/nn.json +0 -44
  1141. package/node_modules/yargs/locales/pirate.json +0 -13
  1142. package/node_modules/yargs/locales/pl.json +0 -49
  1143. package/node_modules/yargs/locales/pt.json +0 -45
  1144. package/node_modules/yargs/locales/pt_BR.json +0 -48
  1145. package/node_modules/yargs/locales/ru.json +0 -46
  1146. package/node_modules/yargs/locales/th.json +0 -46
  1147. package/node_modules/yargs/locales/tr.json +0 -48
  1148. package/node_modules/yargs/locales/zh_CN.json +0 -48
  1149. package/node_modules/yargs/locales/zh_TW.json +0 -47
  1150. package/node_modules/yargs/package.json +0 -122
  1151. package/node_modules/yargs/yargs +0 -9
  1152. package/node_modules/yargs-parser/CHANGELOG.md +0 -263
  1153. package/node_modules/yargs-parser/LICENSE.txt +0 -14
  1154. package/node_modules/yargs-parser/README.md +0 -518
  1155. package/node_modules/yargs-parser/browser.js +0 -29
  1156. package/node_modules/yargs-parser/build/index.cjs +0 -1042
  1157. package/node_modules/yargs-parser/build/lib/index.js +0 -59
  1158. package/node_modules/yargs-parser/build/lib/string-utils.js +0 -65
  1159. package/node_modules/yargs-parser/build/lib/tokenize-arg-string.js +0 -40
  1160. package/node_modules/yargs-parser/build/lib/yargs-parser-types.js +0 -12
  1161. package/node_modules/yargs-parser/build/lib/yargs-parser.js +0 -1037
  1162. package/node_modules/yargs-parser/package.json +0 -87
@@ -1,14 +1,8 @@
1
- import { createRequire } from "module";
2
- const require = createRequire(import.meta.url);
3
- let clipboard = null;
4
- const hasDisplay = process.platform !== "linux" || Boolean(process.env.DISPLAY || process.env.WAYLAND_DISPLAY);
5
- if (!process.env.TERMUX_VERSION && hasDisplay) {
6
- try {
7
- clipboard = require("@mariozechner/clipboard");
8
- }
9
- catch {
10
- clipboard = null;
11
- }
12
- }
13
- export { clipboard };
1
+ /**
2
+ * Re-export native clipboard utilities from @gsd/native.
3
+ *
4
+ * This module exists for backward compatibility. Prefer importing
5
+ * directly from "@gsd/native/clipboard" in new code.
6
+ */
7
+ export { copyToClipboard, readTextFromClipboard, readImageFromClipboard, } from "@gsd/native/clipboard";
14
8
  //# sourceMappingURL=clipboard-native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clipboard-native.js","sourceRoot":"","sources":["../../src/utils/clipboard-native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAOvC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,IAAI,SAAS,GAA2B,IAAI,CAAC;AAE7C,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AAE/G,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,UAAU,EAAE,CAAC;IAC/C,IAAI,CAAC;QACJ,SAAS,GAAG,OAAO,CAAC,yBAAyB,CAAoB,CAAC;IACnE,CAAC;IAAC,MAAM,CAAC;QACR,SAAS,GAAG,IAAI,CAAC;IAClB,CAAC;AACF,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,CAAC","sourcesContent":["import { createRequire } from \"module\";\n\nexport type ClipboardModule = {\n\thasImage: () => boolean;\n\tgetImageBinary: () => Promise<Array<number>>;\n};\n\nconst require = createRequire(import.meta.url);\nlet clipboard: ClipboardModule | null = null;\n\nconst hasDisplay = process.platform !== \"linux\" || Boolean(process.env.DISPLAY || process.env.WAYLAND_DISPLAY);\n\nif (!process.env.TERMUX_VERSION && hasDisplay) {\n\ttry {\n\t\tclipboard = require(\"@mariozechner/clipboard\") as ClipboardModule;\n\t} catch {\n\t\tclipboard = null;\n\t}\n}\n\nexport { clipboard };\n"]}
1
+ {"version":3,"file":"clipboard-native.js","sourceRoot":"","sources":["../../src/utils/clipboard-native.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACN,eAAe,EACf,qBAAqB,EACrB,sBAAsB,GACtB,MAAM,uBAAuB,CAAC","sourcesContent":["/**\n * Re-export native clipboard utilities from @gsd/native.\n *\n * This module exists for backward compatibility. Prefer importing\n * directly from \"@gsd/native/clipboard\" in new code.\n */\nexport {\n\tcopyToClipboard,\n\treadTextFromClipboard,\n\treadImageFromClipboard,\n} from \"@gsd/native/clipboard\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../src/utils/clipboard.ts"],"names":[],"mappings":"AAIA,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAyDlD"}
1
+ {"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../src/utils/clipboard.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAWlD"}
@@ -1,64 +1,11 @@
1
- import { execSync, spawn } from "child_process";
2
- import { platform } from "os";
3
- import { isWaylandSession } from "./clipboard-image.js";
1
+ import { copyToClipboard as nativeCopy } from "@gsd/native/clipboard";
4
2
  export function copyToClipboard(text) {
5
3
  // Always emit OSC 52 - works over SSH/mosh, harmless locally
6
4
  const encoded = Buffer.from(text).toString("base64");
7
5
  process.stdout.write(`\x1b]52;c;${encoded}\x07`);
8
- // Also try native tools (best effort for local sessions)
9
- const p = platform();
10
- const options = { input: text, timeout: 5000 };
6
+ // Use native clipboard for local sessions (best effort)
11
7
  try {
12
- if (p === "darwin") {
13
- execSync("pbcopy", options);
14
- }
15
- else if (p === "win32") {
16
- execSync("clip", options);
17
- }
18
- else {
19
- // Linux. Try Termux, Wayland, or X11 clipboard tools.
20
- if (process.env.TERMUX_VERSION) {
21
- try {
22
- execSync("termux-clipboard-set", options);
23
- return;
24
- }
25
- catch {
26
- // Fall back to Wayland or X11 tools.
27
- }
28
- }
29
- const isWayland = isWaylandSession();
30
- if (isWayland) {
31
- try {
32
- // Verify wl-copy exists (spawn errors are async and won't be caught)
33
- execSync("which wl-copy", { stdio: "ignore" });
34
- // wl-copy with execSync hangs due to fork behavior; use spawn instead
35
- const proc = spawn("wl-copy", [], { stdio: ["pipe", "ignore", "ignore"] });
36
- proc.stdin.on("error", () => {
37
- // Ignore EPIPE errors if wl-copy exits early
38
- });
39
- proc.stdin.write(text);
40
- proc.stdin.end();
41
- proc.unref();
42
- }
43
- catch {
44
- // Fall back to xclip/xsel (works on XWayland)
45
- try {
46
- execSync("xclip -selection clipboard", options);
47
- }
48
- catch {
49
- execSync("xsel --clipboard --input", options);
50
- }
51
- }
52
- }
53
- else {
54
- try {
55
- execSync("xclip -selection clipboard", options);
56
- }
57
- catch {
58
- execSync("xsel --clipboard --input", options);
59
- }
60
- }
61
- }
8
+ nativeCopy(text);
62
9
  }
63
10
  catch {
64
11
  // Ignore - OSC 52 already em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E,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;oBAC/C,sEAAsE;oBACtE,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;oBAC3E,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;wBAC3B,6CAA6C;oBAC9C,CAAC,CAAC,CAAC;oBACH,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;oBACvB,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;oBACjB,IAAI,CAAC,KAAK,EAAE,CAAC;gBACd,CAAC;gBAAC,MAAM,CAAC;oBACR,8CAA8C;oBAC9C,IAAI,CAAC;wBACJ,QAAQ,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;oBACjD,CAAC;oBAAC,MAAM,CAAC;wBACR,QAAQ,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;oBAC/C,CAAC;gBACF,CAAC;YACF,CAAC;iBAAM,CAAC;gBACP,IAAI,CAAC;oBACJ,QAAQ,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;gBACjD,CAAC;gBAAC,MAAM,CAAC;oBACR,QAAQ,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;gBAC/C,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;IAAC,MAAM,CAAC;QACR,8CAA8C;IAC/C,CAAC;AACF,CAAC","sourcesContent":["import { execSync, spawn } from \"child_process\";\nimport { platform } from \"os\";\nimport { isWaylandSession } from \"./clipboard-image.js\";\n\nexport function copyToClipboard(text: string): void {\n\t// Always emit OSC 52 - works over SSH/mosh, harmless locally\n\tconst encoded = Buffer.from(text).toString(\"base64\");\n\tprocess.stdout.write(`\\x1b]52;c;${encoded}\\x07`);\n\n\t// Also try native tools (best effort for local sessions)\n\tconst p = platform();\n\tconst options = { input: text, timeout: 5000 };\n\n\ttry {\n\t\tif (p === \"darwin\") {\n\t\t\texecSync(\"pbcopy\", options);\n\t\t} else if (p === \"win32\") {\n\t\t\texecSync(\"clip\", options);\n\t\t} else {\n\t\t\t// Linux. Try Termux, Wayland, or X11 clipboard tools.\n\t\t\tif (process.env.TERMUX_VERSION) {\n\t\t\t\ttry {\n\t\t\t\t\texecSync(\"termux-clipboard-set\", options);\n\t\t\t\t\treturn;\n\t\t\t\t} catch {\n\t\t\t\t\t// Fall back to Wayland or X11 tools.\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst isWayland = isWaylandSession();\n\t\t\tif (isWayland) {\n\t\t\t\ttry {\n\t\t\t\t\t// Verify wl-copy exists (spawn errors are async and won't be caught)\n\t\t\t\t\texecSync(\"which wl-copy\", { stdio: \"ignore\" });\n\t\t\t\t\t// wl-copy with execSync hangs due to fork behavior; use spawn instead\n\t\t\t\t\tconst proc = spawn(\"wl-copy\", [], { stdio: [\"pipe\", \"ignore\", \"ignore\"] });\n\t\t\t\t\tproc.stdin.on(\"error\", () => {\n\t\t\t\t\t\t// Ignore EPIPE errors if wl-copy exits early\n\t\t\t\t\t});\n\t\t\t\t\tproc.stdin.write(text);\n\t\t\t\t\tproc.stdin.end();\n\t\t\t\t\tproc.unref();\n\t\t\t\t} catch {\n\t\t\t\t\t// Fall back to xclip/xsel (works on XWayland)\n\t\t\t\t\ttry {\n\t\t\t\t\t\texecSync(\"xclip -selection clipboard\", options);\n\t\t\t\t\t} catch {\n\t\t\t\t\t\texecSync(\"xsel --clipboard --input\", options);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\texecSync(\"xclip -selection clipboard\", options);\n\t\t\t\t} catch {\n\t\t\t\t\texecSync(\"xsel --clipboard --input\", options);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} catch {\n\t\t// Ignore - OSC 52 already emitted as fallback\n\t}\n}\n"]}
1
+ {"version":3,"file":"clipboard.js","sourceRoot":"","sources":["../../src/utils/clipboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEtE,MAAM,UAAU,eAAe,CAAC,IAAY;IAC3C,6DAA6D;IAC7D,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,OAAO,MAAM,CAAC,CAAC;IAEjD,wDAAwD;IACxD,IAAI,CAAC;QACJ,UAAU,CAAC,IAAI,CAAC,CAAC;IAClB,CAAC;IAAC,MAAM,CAAC;QACR,8CAA8C;IAC/C,CAAC;AACF,CAAC","sourcesContent":["import { copyToClipboard as nativeCopy } from \"@gsd/native/clipboard\";\n\nexport function copyToClipboard(text: string): void {\n\t// Always emit OSC 52 - works over SSH/mosh, harmless locally\n\tconst encoded = Buffer.from(text).toString(\"base64\");\n\tprocess.stdout.write(`\\x1b]52;c;${encoded}\\x07`);\n\n\t// Use native clipboard for local sessions (best effort)\n\ttry {\n\t\tnativeCopy(text);\n\t} catch {\n\t\t// Ignore - OSC 52 already emitted as fallback\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"image-convert.d.ts","sourceRoot":"","sources":["../../src/utils/image-convert.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAsB,YAAY,CACjC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CA4BpD"}
1
+ {"version":3,"file":"image-convert.d.ts","sourceRoot":"","sources":["../../src/utils/image-convert.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAsB,YAAY,CACjC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAkBpD"}
@@ -1,4 +1,4 @@
1
- import { loadPhoton } from "./photon.js";
1
+ import { ImageFormat, parseImage } from "@gsd/native/image";
2
2
  /**
3
3
  * Convert image to PNG format for terminal display.
4
4
  * Kitty graphics protocol requires PNG format (f=100).
@@ -8,24 +8,14 @@ export async function convertToPng(base64Data, mimeType) {
8
8
  if (mimeType === "image/png") {
9
9
  return { data: base64Data, mimeType };
10
10
  }
11
- const photon = await loadPhoton();
12
- if (!photon) {
13
- // Photon not available, can't convert
14
- return null;
15
- }
16
11
  try {
17
12
  const bytes = new Uint8Array(Buffer.from(base64Data, "base64"));
18
- const image = photon.PhotonImage.new_from_byteslice(bytes);
19
- try {
20
- const pngBuffer = image.get_bytes();
21
- return {
22
- data: Buffer.from(pngBuffer).toString("base64"),
23
- mimeType: "image/png",
24
- };
25
- }
26
- finally {
27
- image.free();
28
- }
13
+ const image = await parseImage(bytes);
14
+ const pngBytes = await image.encode(ImageFormat.PNG, 100);
15
+ return {
16
+ data: Buffer.from(new Uint8Array(pngBytes)).toString("base64"),
17
+ mimeType: "image/png",
18
+ };
29
19
  }
30
20
  catch {
31
21
  // Conversion failed
@@ -1 +1 @@
1
- {"version":3,"file":"image-convert.js","sourceRoot":"","sources":["../../src/utils/image-convert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CACjC,UAAkB,EAClB,QAAgB;IAEhB,oCAAoC;IACpC,IAAI,QAAQ,KAAK,WAAW,EAAE,CAAC;QAC9B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;IACvC,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,UAAU,EAAE,CAAC;IAClC,IAAI,CAAC,MAAM,EAAE,CAAC;QACb,sCAAsC;QACtC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAI,CAAC;QACJ,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;QAChE,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC3D,IAAI,CAAC;YACJ,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;YACpC,OAAO;gBACN,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;gBAC/C,QAAQ,EAAE,WAAW;aACrB,CAAC;QACH,CAAC;gBAAS,CAAC;YACV,KAAK,CAAC,IAAI,EAAE,CAAC;QACd,CAAC;IACF,CAAC;IAAC,MAAM,CAAC;QACR,oBAAoB;QACpB,OAAO,IAAI,CAAC;IACb,CAAC;AACF,CAAC","sourcesContent":["import { loadPhoton } from \"./photon.js\";\n\n/**\n * Convert image to PNG format for terminal display.\n * Kitty graphics protocol requires PNG format (f=100).\n */\nexport async function convertToPng(\n\tbase64Data: string,\n\tmimeType: string,\n): Promise<{ data: string; mimeType: string } | null> {\n\t// Already PNG, no conversion needed\n\tif (mimeType === \"image/png\") {\n\t\treturn { data: base64Data, mimeType };\n\t}\n\n\tconst photon = await loadPhoton();\n\tif (!photon) {\n\t\t// Photon not available, can't convert\n\t\treturn null;\n\t}\n\n\ttry {\n\t\tconst bytes = new Uint8Array(Buffer.from(base64Data, \"base64\"));\n\t\tconst image = photon.PhotonImage.new_from_byteslice(bytes);\n\t\ttry {\n\t\t\tconst pngBuffer = image.get_bytes();\n\t\t\treturn {\n\t\t\t\tdata: Buffer.from(pngBuffer).toString(\"base64\"),\n\t\t\t\tmimeType: \"image/png\",\n\t\t\t};\n\t\t} finally {\n\t\t\timage.free();\n\t\t}\n\t} catch {\n\t\t// Conversion failed\n\t\treturn null;\n\t}\n}\n"]}
1
+ {"version":3,"file":"image-convert.js","sourceRoot":"","sources":["../../src/utils/image-convert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE5D;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CACjC,UAAkB,EAClB,QAAgB;IAEhB,oCAAoC;IACpC,IAAI,QAAQ,KAAK,WAAW,EAAE,CAAC;QAC9B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;IACvC,CAAC;IAED,IAAI,CAAC;QACJ,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;QAChE,MAAM,KAAK,GAAG,MAAM,UAAU,CAAC,KAAK,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC1D,OAAO;YACN,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAC9D,QAAQ,EAAE,WAAW;SACrB,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACR,oBAAoB;QACpB,OAAO,IAAI,CAAC;IACb,CAAC;AACF,CAAC","sourcesContent":["import { ImageFormat, parseImage } from \"@gsd/native/image\";\n\n/**\n * Convert image to PNG format for terminal display.\n * Kitty graphics protocol requires PNG format (f=100).\n */\nexport async function convertToPng(\n\tbase64Data: string,\n\tmimeType: string,\n): Promise<{ data: string; mimeType: string } | null> {\n\t// Already PNG, no conversion needed\n\tif (mimeType === \"image/png\") {\n\t\treturn { data: base64Data, mimeType };\n\t}\n\n\ttry {\n\t\tconst bytes = new Uint8Array(Buffer.from(base64Data, \"base64\"));\n\t\tconst image = await parseImage(bytes);\n\t\tconst pngBytes = await image.encode(ImageFormat.PNG, 100);\n\t\treturn {\n\t\t\tdata: Buffer.from(new Uint8Array(pngBytes)).toString(\"base64\"),\n\t\t\tmimeType: \"image/png\",\n\t\t};\n\t} catch {\n\t\t// Conversion failed\n\t\treturn null;\n\t}\n}\n"]}
@@ -18,8 +18,7 @@ export interface ResizedImage {
18
18
  * Resize an image to fit within the specified max dimensions and file size.
19
19
  * Returns the original image if it already fits within the limits.
20
20
  *
21
- * Uses Photon (Rust/WASM) for image processing. If Photon is not available,
22
- * returns the original image unchanged.
21
+ * Uses the native Rust image module (N-API) for image processing.
23
22
  *
24
23
  * Strategy for staying under maxBytes:
25
24
  * 1. First resize to maxWidth/maxHeight
@@ -1 +1 @@
1
- {"version":3,"file":"image-resize.d.ts","sourceRoot":"","sources":["../../src/utils/image-resize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;CACpB;AAoBD;;;;;;;;;;;;GAYG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC,CAsKxG;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAO5E"}
1
+ {"version":3,"file":"image-resize.d.ts","sourceRoot":"","sources":["../../src/utils/image-resize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI/C,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;CACpB;AAoBD;;;;;;;;;;;GAWG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC,CAgKxG;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAO5E"}
@@ -1,4 +1,4 @@
1
- import { loadPhoton } from "./photon.js";
1
+ import { ImageFormat, parseImage, SamplingFilter } from "@gsd/native/image";
2
2
  // 4.5MB - provides headroom below Anthropic's 5MB limit
3
3
  const DEFAULT_MAX_BYTES = 4.5 * 1024 * 1024;
4
4
  const DEFAULT_OPTIONS = {
@@ -15,8 +15,7 @@ function pickSmaller(a, b) {
15
15
  * Resize an image to fit within the specified max dimensions and file size.
16
16
  * Returns the original image if it already fits within the limits.
17
17
  *
18
- * Uses Photon (Rust/WASM) for image processing. If Photon is not available,
19
- * returns the original image unchanged.
18
+ * Uses the native Rust image module (N-API) for image processing.
20
19
  *
21
20
  * Strategy for staying under maxBytes:
22
21
  * 1. First resize to maxWidth/maxHeight
@@ -27,9 +26,12 @@ function pickSmaller(a, b) {
27
26
  export async function resizeImage(img, options) {
28
27
  const opts = { ...DEFAULT_OPTIONS, ...options };
29
28
  const inputBuffer = Buffer.from(img.data, "base64");
30
- const photon = await loadPhoton();
31
- if (!photon) {
32
- // Photon not available, return original image
29
+ let image;
30
+ try {
31
+ image = await parseImage(new Uint8Array(inputBuffer));
32
+ }
33
+ catch {
34
+ // Failed to decode image
33
35
  return {
34
36
  data: img.data,
35
37
  mimeType: img.mimeType,
@@ -40,11 +42,9 @@ export async function resizeImage(img, options) {
40
42
  wasResized: false,
41
43
  };
42
44
  }
43
- let image;
44
45
  try {
45
- image = photon.PhotonImage.new_from_byteslice(new Uint8Array(inputBuffer));
46
- const originalWidth = image.get_width();
47
- const originalHeight = image.get_height();
46
+ const originalWidth = image.width;
47
+ const originalHeight = image.height;
48
48
  const format = img.mimeType?.split("/")[1] ?? "png";
49
49
  // Check if already within all limits (dimensions AND size)
50
50
  const originalSize = inputBuffer.length;
@@ -71,16 +71,13 @@ export async function resizeImage(img, options) {
71
71
  targetHeight = opts.maxHeight;
72
72
  }
73
73
  // Helper to resize and encode in both formats, returning the smaller one
74
- function tryBothFormats(width, height, jpegQuality) {
75
- const resized = photon.resize(image, width, height, photon.SamplingFilter.Lanczos3);
76
- try {
77
- const pngBuffer = resized.get_bytes();
78
- const jpegBuffer = resized.get_bytes_jpeg(jpegQuality);
79
- return pickSmaller({ buffer: pngBuffer, mimeType: "image/png" }, { buffer: jpegBuffer, mimeType: "image/jpeg" });
80
- }
81
- finally {
82
- resized.free();
83
- }
74
+ async function tryBothFormats(width, height, jpegQuality) {
75
+ const resized = await image.resize(width, height, SamplingFilter.Lanczos3);
76
+ const pngBytes = await resized.encode(ImageFormat.PNG, 100);
77
+ const jpegBytes = await resized.encode(ImageFormat.JPEG, jpegQuality);
78
+ const pngBuffer = new Uint8Array(pngBytes);
79
+ const jpegBuffer = new Uint8Array(jpegBytes);
80
+ return pickSmaller({ buffer: pngBuffer, mimeType: "image/png" }, { buffer: jpegBuffer, mimeType: "image/jpeg" });
84
81
  }
85
82
  // Try to produce an image under maxBytes
86
83
  const qualitySteps = [85, 70, 55, 40];
@@ -89,7 +86,7 @@ export async function resizeImage(img, options) {
89
86
  let finalWidth = targetWidth;
90
87
  let finalHeight = targetHeight;
91
88
  // First attempt: resize to target dimensions, try both formats
92
- best = tryBothFormats(targetWidth, targetHeight, opts.jpegQuality);
89
+ best = await tryBothFormats(targetWidth, targetHeight, opts.jpegQuality);
93
90
  if (best.buffer.length <= opts.maxBytes) {
94
91
  return {
95
92
  data: Buffer.from(best.buffer).toString("base64"),
@@ -103,7 +100,7 @@ export async function resizeImage(img, options) {
103
100
  }
104
101
  // Still too large - try JPEG with decreasing quality
105
102
  for (const quality of qualitySteps) {
106
- best = tryBothFormats(targetWidth, targetHeight, quality);
103
+ best = await tryBothFormats(targetWidth, targetHeight, quality);
107
104
  if (best.buffer.length <= opts.maxBytes) {
108
105
  return {
109
106
  data: Buffer.from(best.buffer).toString("base64"),
@@ -124,7 +121,7 @@ export async function resizeImage(img, options) {
124
121
  break;
125
122
  }
126
123
  for (const quality of qualitySteps) {
127
- best = tryBothFormats(finalWidth, finalHeight, quality);
124
+ best = await tryBothFormats(finalWidth, finalHeight, quality);
128
125
  if (best.buffer.length <= opts.maxBytes) {
129
126
  return {
130
127
  data: Buffer.from(best.buffer).toString("base64"),
@@ -150,7 +147,7 @@ export async function resizeImage(img, options) {
150
147
  };
151
148
  }
152
149
  catch {
153
- // Failed to load image
150
+ // Failed to process image
154
151
  return {
155
152
  data: img.data,
156
153
  mimeType: img.mimeType,
@@ -161,11 +158,6 @@ export async function resizeImage(img, options) {
161
158
  wasResized: false,
162
159
  };
163
160
  }
164
- finally {
165
- if (image) {
166
- image.free();
167
- }
168
- }
169
161
  }
170
162
  /**
171
163
  * Format a dimension note for resized images.
@@ -1 +1 @@
1
- {"version":3,"file":"image-resize.js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AAU;wBACjB,MAAM,EAAE,WAAW;wBACnB,UAAU,EAAE,IAAI;qBAChB,CAAC;gBACH,CAAC;YACF,CAAC;QACF,CAAC;QAED,mDAAmD;QACnD,OAAO;YACN,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;YACjD,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,aAAa;YACb,cAAc;YACd,KAAK,EAAE,UAAU;YACjB,MAAM,EAAE,WAAW;YACnB,UAAU,EAAE,IAAI;SAChB,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACR,uBAAuB;QACvB,OAAO;YACN,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,aAAa,EAAE,CAAC;YAChB,cAAc,EAAE,CAAC;YACjB,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,UAAU,EAAE,KAAK;SACjB,CAAC;IACH,CAAC;YAAS,CAAC;QACV,IAAI,KAAK,EAAE,CAAC;YACX,KAAK,CAAC,IAAI,EAAE,CAAC;QACd,CAAC;IACF,CAAC;AACF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAoB;IACvD,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC;IAClD,OAAO,oBAAoB,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,cAAc,kBAAkB,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,6BAA6B,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,6BAA6B,CAAC;AACnM,CAAC","sourcesContent":["import type { ImageContent } from \"@gsd/pi-ai\";\nimport { loadPhoton } from \"./photon.js\";\n\nexport interface ImageResizeOptions {\n\tmaxWidth?: number; // Default: 2000\n\tmaxHeight?: number; // Default: 2000\n\tmaxBytes?: number; // Default: 4.5MB (below Anthropic's 5MB limit)\n\tjpegQuality?: number; // Default: 80\n}\n\nexport interface ResizedImage {\n\tdata: string; // base64\n\tmimeType: string;\n\toriginalWidth: number;\n\toriginalHeight: number;\n\twidth: number;\n\theight: number;\n\twasResized: boolean;\n}\n\n// 4.5MB - provides headroom below Anthropic's 5MB limit\nconst DEFAULT_MAX_BYTES = 4.5 * 1024 * 1024;\n\nconst DEFAULT_OPTIONS: Required<ImageResizeOptions> = {\n\tmaxWidth: 2000,\n\tmaxHeight: 2000,\n\tmaxBytes: DEFAULT_MAX_BYTES,\n\tjpegQuality: 80,\n};\n\n/** Helper to pick the smaller of two buffers */\nfunction pickSmaller(\n\ta: { buffer: Uint8Array; mimeType: string },\n\tb: { buffer: Uint8Array; mimeType: string },\n): { buffer: Uint8Array; mimeType: string } {\n\treturn a.buffer.length <= b.buffer.length ? a : b;\n}\n\n/**\n * Resize an image to fit within the specified max dimensions and file size.\n * Returns the original image if it already fits within the limits.\n *\n * Uses Photon (Rust/WASM) for image processing. If Photon is not available,\n * returns the original image unchanged.\n *\n * Strategy for staying under maxBytes:\n * 1. First resize to maxWidth/maxHeight\n * 2. Try both PNG and JPEG formats, pick the smaller one\n * 3. If still too large, try JPEG with decreasing quality\n * 4. If still too large, progressively reduce dimensions\n */\nexport async function resizeImage(img: ImageContent, options?: ImageResizeOptions): Promise<ResizedImage> {\n\tconst opts = { ...DEFAULT_OPTIONS, ...options };\n\tconst inputBuffer = Buffer.from(img.data, \"base64\");\n\n\tconst photon = await loadPhoton();\n\tif (!photon) {\n\t\t// Photon not available, return original image\n\t\treturn {\n\t\t\tdata: img.data,\n\t\t\tmimeType: img.mimeType,\n\t\t\toriginalWidth: 0,\n\t\t\toriginalHeight: 0,\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t\twasResized: false,\n\t\t};\n\t}\n\n\tlet image: ReturnType<typeof photon.PhotonImage.new_from_byteslice> | undefined;\n\ttry {\n\t\timage = photon.PhotonImage.new_from_byteslice(new Uint8Array(inputBuffer));\n\n\t\tconst originalWidth = image.get_width();\n\t\tconst originalHeight = image.get_height();\n\t\tconst format = img.mimeType?.split(\"/\")[1] ?? \"png\";\n\n\t\t// Check if already within all limits (dimensions AND size)\n\t\tconst originalSize = inputBuffer.length;\n\t\tif (originalWidth <= opts.maxWidth && originalHeight <= opts.maxHeight && originalSize <= opts.maxBytes) {\n\t\t\treturn {\n\t\t\t\tdata: img.data,\n\t\t\t\tmimeType: img.mimeType ?? `image/${format}`,\n\t\t\t\toriginalWidth,\n\t\t\t\toriginalHeight,\n\t\t\t\twidth: originalWidth,\n\t\t\t\theight: originalHeight,\n\t\t\t\twasResized: false,\n\t\t\t};\n\t\t}\n\n\t\t// Calculate initial dimensions respecting max limits\n\t\tlet targetWidth = originalWidth;\n\t\tlet targetHeight = originalHeight;\n\n\t\tif (targetWidth > opts.maxWidth) {\n\t\t\ttargetHeight = Math.round((targetHeight * opts.maxWidth) / targetWidth);\n\t\t\ttargetWidth = opts.maxWidth;\n\t\t}\n\t\tif (targetHeight > opts.maxHeight) {\n\t\t\ttargetWidth = Math.round((targetWidth * opts.maxHeight) / targetHeight);\n\t\t\ttargetHeight = opts.maxHeight;\n\t\t}\n\n\t\t// Helper to resize and encode in both formats, returning the smaller one\n\t\tfunction tryBothFormats(\n\t\t\twidth: number,\n\t\t\theight: number,\n\t\t\tjpegQuality: number,\n\t\t): { buffer: Uint8Array; mimeType: string } {\n\t\t\tconst resized = photon!.resize(image!, width, height, photon!.SamplingFilter.Lanczos3);\n\n\t\t\ttry {\n\t\t\t\tconst pngBuffer = resized.get_bytes();\n\t\t\t\tconst jpegBuffer = resized.get_bytes_jpeg(jpegQuality);\n\n\t\t\t\treturn pickSmaller(\n\t\t\t\t\t{ buffer: pngBuffer, mimeType: \"image/png\" },\n\t\t\t\t\t{ buffer: jpegBuffer, mimeType: \"image/jpeg\" },\n\t\t\t\t);\n\t\t\t} finally {\n\t\t\t\tresized.free();\n\t\t\t}\n\t\t}\n\n\t\t// Try to produce an image under maxBytes\n\t\tconst qualitySteps = [85, 70, 55, 40];\n\t\tconst scaleSteps = [1.0, 0.75, 0.5, 0.35, 0.25];\n\n\t\tlet best: { buffer: Uint8Array; mimeType: string };\n\t\tlet finalWidth = targetWidth;\n\t\tlet finalHeight = targetHeight;\n\n\t\t// First attempt: resize to target dimensions, try both formats\n\t\tbest = tryBothFormats(targetWidth, targetHeight, opts.jpegQuality);\n\n\t\tif (best.buffer.length <= opts.maxBytes) {\n\t\t\treturn {\n\t\t\t\tdata: Buffer.from(best.buffer).toString(\"base64\"),\n\t\t\t\tmimeType: best.mimeType,\n\t\t\t\toriginalWidth,\n\t\t\t\toriginalHeight,\n\t\t\t\twidth: finalWidth,\n\t\t\t\theight: finalHeight,\n\t\t\t\twasResized: true,\n\t\t\t};\n\t\t}\n\n\t\t// Still too large - try JPEG with decreasing quality\n\t\tfor (const quality of qualitySteps) {\n\t\t\tbest = tryBothFormats(targetWidth, targetHeight, quality);\n\n\t\t\tif (best.buffer.length <= opts.maxBytes) {\n\t\t\t\treturn {\n\t\t\t\t\tdata: Buffer.from(best.buffer).toString(\"base64\"),\n\t\t\t\t\tmimeType: best.mimeType,\n\t\t\t\t\toriginalWidth,\n\t\t\t\t\toriginalHeight,\n\t\t\t\t\twidth: finalWidth,\n\t\t\t\t\theight: finalHeight,\n\t\t\t\t\twasResized: true,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// Still too large - reduce dimensions progressively\n\t\tfor (const scale of scaleSteps) {\n\t\t\tfinalWidth = Math.round(targetWidth * scale);\n\t\t\tfinalHeight = Math.round(targetHeight * scale);\n\n\t\t\tif (finalWidth < 100 || finalHeight < 100) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tfor (const quality of qualitySteps) {\n\t\t\t\tbest = tryBothFormats(finalWidth, finalHeight, quality);\n\n\t\t\t\tif (best.buffer.length <= opts.maxBytes) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdata: Buffer.from(best.buffer).toString(\"base64\"),\n\t\t\t\t\t\tmimeType: best.mimeType,\n\t\t\t\t\t\toriginalWidth,\n\t\t\t\t\t\toriginalHeight,\n\t\t\t\t\t\twidth: finalWidth,\n\t\t\t\t\t\theight: finalHeight,\n\t\t\t\t\t\twasResized: true,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Last resort: return smallest version we produced\n\t\treturn {\n\t\t\tdata: Buffer.from(best.buffer).toString(\"base64\"),\n\t\t\tmimeType: best.mimeType,\n\t\t\toriginalWidth,\n\t\t\toriginalHeight,\n\t\t\twidth: finalWidth,\n\t\t\theight: finalHeight,\n\t\t\twasResized: true,\n\t\t};\n\t} catch {\n\t\t// Failed to load image\n\t\treturn {\n\t\t\tdata: img.data,\n\t\t\tmimeType: img.mimeType,\n\t\t\toriginalWidth: 0,\n\t\t\toriginalHeight: 0,\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t\twasResized: false,\n\t\t};\n\t} finally {\n\t\tif (image) {\n\t\t\timage.free();\n\t\t}\n\t}\n}\n\n/**\n * Format a dimension note for resized images.\n * This helps the model understand the coordinate mapping.\n */\nexport function formatDimensionNote(result: ResizedImage): string | undefined {\n\tif (!result.wasResized) {\n\t\treturn undefined;\n\t}\n\n\tconst scale = result.originalWidth / result.width;\n\treturn `[Image: original ${result.originalWidth}x${result.originalHeight}, displayed at ${result.width}x${result.height}. Multiply coordinates by ${scale.toFixed(2)} to map to original image.]`;\n}\n"]}
1
+ {"version":3,"file":"image-resize.js","sourceRoot":"","sources":["../../src/utils/image-resize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAoB5E,wDAAwD;AACxD,MAAM,iBAAiB,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C,MAAM,eA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CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;YACjD,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,aAAa;YACb,cAAc;YACd,KAAK,EAAE,UAAU;YACjB,MAAM,EAAE,WAAW;YACnB,UAAU,EAAE,IAAI;SAChB,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACR,0BAA0B;QAC1B,OAAO;YACN,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,aAAa,EAAE,CAAC;YAChB,cAAc,EAAE,CAAC;YACjB,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,UAAU,EAAE,KAAK;SACjB,CAAC;IACH,CAAC;AACF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAoB;IACvD,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC;IAClD,OAAO,oBAAoB,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,cAAc,kBAAkB,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,6BAA6B,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,6BAA6B,CAAC;AACnM,CAAC","sourcesContent":["import type { ImageContent } from \"@gsd/pi-ai\";\nimport { ImageFormat, parseImage, SamplingFilter } from \"@gsd/native/image\";\nimport type { NativeImageHandle } from \"@gsd/native/image\";\n\nexport interface ImageResizeOptions {\n\tmaxWidth?: number; // Default: 2000\n\tmaxHeight?: number; // Default: 2000\n\tmaxBytes?: number; // Default: 4.5MB (below Anthropic's 5MB limit)\n\tjpegQuality?: number; // Default: 80\n}\n\nexport interface ResizedImage {\n\tdata: string; // base64\n\tmimeType: string;\n\toriginalWidth: number;\n\toriginalHeight: number;\n\twidth: number;\n\theight: number;\n\twasResized: boolean;\n}\n\n// 4.5MB - provides headroom below Anthropic's 5MB limit\nconst DEFAULT_MAX_BYTES = 4.5 * 1024 * 1024;\n\nconst DEFAULT_OPTIONS: Required<ImageResizeOptions> = {\n\tmaxWidth: 2000,\n\tmaxHeight: 2000,\n\tmaxBytes: DEFAULT_MAX_BYTES,\n\tjpegQuality: 80,\n};\n\n/** Helper to pick the smaller of two buffers */\nfunction pickSmaller(\n\ta: { buffer: Uint8Array; mimeType: string },\n\tb: { buffer: Uint8Array; mimeType: string },\n): { buffer: Uint8Array; mimeType: string } {\n\treturn a.buffer.length <= b.buffer.length ? a : b;\n}\n\n/**\n * Resize an image to fit within the specified max dimensions and file size.\n * Returns the original image if it already fits within the limits.\n *\n * Uses the native Rust image module (N-API) for image processing.\n *\n * Strategy for staying under maxBytes:\n * 1. First resize to maxWidth/maxHeight\n * 2. Try both PNG and JPEG formats, pick the smaller one\n * 3. If still too large, try JPEG with decreasing quality\n * 4. If still too large, progressively reduce dimensions\n */\nexport async function resizeImage(img: ImageContent, options?: ImageResizeOptions): Promise<ResizedImage> {\n\tconst opts = { ...DEFAULT_OPTIONS, ...options };\n\tconst inputBuffer = Buffer.from(img.data, \"base64\");\n\n\tlet image: NativeImageHandle;\n\ttry {\n\t\timage = await parseImage(new Uint8Array(inputBuffer));\n\t} catch {\n\t\t// Failed to decode image\n\t\treturn {\n\t\t\tdata: img.data,\n\t\t\tmimeType: img.mimeType,\n\t\t\toriginalWidth: 0,\n\t\t\toriginalHeight: 0,\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t\twasResized: false,\n\t\t};\n\t}\n\n\ttry {\n\t\tconst originalWidth = image.width;\n\t\tconst originalHeight = image.height;\n\t\tconst format = img.mimeType?.split(\"/\")[1] ?? \"png\";\n\n\t\t// Check if already within all limits (dimensions AND size)\n\t\tconst originalSize = inputBuffer.length;\n\t\tif (originalWidth <= opts.maxWidth && originalHeight <= opts.maxHeight && originalSize <= opts.maxBytes) {\n\t\t\treturn {\n\t\t\t\tdata: img.data,\n\t\t\t\tmimeType: img.mimeType ?? `image/${format}`,\n\t\t\t\toriginalWidth,\n\t\t\t\toriginalHeight,\n\t\t\t\twidth: originalWidth,\n\t\t\t\theight: originalHeight,\n\t\t\t\twasResized: false,\n\t\t\t};\n\t\t}\n\n\t\t// Calculate initial dimensions respecting max limits\n\t\tlet targetWidth = originalWidth;\n\t\tlet targetHeight = originalHeight;\n\n\t\tif (targetWidth > opts.maxWidth) {\n\t\t\ttargetHeight = Math.round((targetHeight * opts.maxWidth) / targetWidth);\n\t\t\ttargetWidth = opts.maxWidth;\n\t\t}\n\t\tif (targetHeight > opts.maxHeight) {\n\t\t\ttargetWidth = Math.round((targetWidth * opts.maxHeight) / targetHeight);\n\t\t\ttargetHeight = opts.maxHeight;\n\t\t}\n\n\t\t// Helper to resize and encode in both formats, returning the smaller one\n\t\tasync function tryBothFormats(\n\t\t\twidth: number,\n\t\t\theight: number,\n\t\t\tjpegQuality: number,\n\t\t): Promise<{ buffer: Uint8Array; mimeType: string }> {\n\t\t\tconst resized = await image.resize(width, height, SamplingFilter.Lanczos3);\n\n\t\t\tconst pngBytes = await resized.encode(ImageFormat.PNG, 100);\n\t\t\tconst jpegBytes = await resized.encode(ImageFormat.JPEG, jpegQuality);\n\n\t\t\tconst pngBuffer = new Uint8Array(pngBytes);\n\t\t\tconst jpegBuffer = new Uint8Array(jpegBytes);\n\n\t\t\treturn pickSmaller(\n\t\t\t\t{ buffer: pngBuffer, mimeType: \"image/png\" },\n\t\t\t\t{ buffer: jpegBuffer, mimeType: \"image/jpeg\" },\n\t\t\t);\n\t\t}\n\n\t\t// Try to produce an image under maxBytes\n\t\tconst qualitySteps = [85, 70, 55, 40];\n\t\tconst scaleSteps = [1.0, 0.75, 0.5, 0.35, 0.25];\n\n\t\tlet best: { buffer: Uint8Array; mimeType: string };\n\t\tlet finalWidth = targetWidth;\n\t\tlet finalHeight = targetHeight;\n\n\t\t// First attempt: resize to target dimensions, try both formats\n\t\tbest = await tryBothFormats(targetWidth, targetHeight, opts.jpegQuality);\n\n\t\tif (best.buffer.length <= opts.maxBytes) {\n\t\t\treturn {\n\t\t\t\tdata: Buffer.from(best.buffer).toString(\"base64\"),\n\t\t\t\tmimeType: best.mimeType,\n\t\t\t\toriginalWidth,\n\t\t\t\toriginalHeight,\n\t\t\t\twidth: finalWidth,\n\t\t\t\theight: finalHeight,\n\t\t\t\twasResized: true,\n\t\t\t};\n\t\t}\n\n\t\t// Still too large - try JPEG with decreasing quality\n\t\tfor (const quality of qualitySteps) {\n\t\t\tbest = await tryBothFormats(targetWidth, targetHeight, quality);\n\n\t\t\tif (best.buffer.length <= opts.maxBytes) {\n\t\t\t\treturn {\n\t\t\t\t\tdata: Buffer.from(best.buffer).toString(\"base64\"),\n\t\t\t\t\tmimeType: best.mimeType,\n\t\t\t\t\toriginalWidth,\n\t\t\t\t\toriginalHeight,\n\t\t\t\t\twidth: finalWidth,\n\t\t\t\t\theight: finalHeight,\n\t\t\t\t\twasResized: true,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// Still too large - reduce dimensions progressively\n\t\tfor (const scale of scaleSteps) {\n\t\t\tfinalWidth = Math.round(targetWidth * scale);\n\t\t\tfinalHeight = Math.round(targetHeight * scale);\n\n\t\t\tif (finalWidth < 100 || finalHeight < 100) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tfor (const quality of qualitySteps) {\n\t\t\t\tbest = await tryBothFormats(finalWidth, finalHeight, quality);\n\n\t\t\t\tif (best.buffer.length <= opts.maxBytes) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdata: Buffer.from(best.buffer).toString(\"base64\"),\n\t\t\t\t\t\tmimeType: best.mimeType,\n\t\t\t\t\t\toriginalWidth,\n\t\t\t\t\t\toriginalHeight,\n\t\t\t\t\t\twidth: finalWidth,\n\t\t\t\t\t\theight: finalHeight,\n\t\t\t\t\t\twasResized: true,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Last resort: return smallest version we produced\n\t\treturn {\n\t\t\tdata: Buffer.from(best.buffer).toString(\"base64\"),\n\t\t\tmimeType: best.mimeType,\n\t\t\toriginalWidth,\n\t\t\toriginalHeight,\n\t\t\twidth: finalWidth,\n\t\t\theight: finalHeight,\n\t\t\twasResized: true,\n\t\t};\n\t} catch {\n\t\t// Failed to process image\n\t\treturn {\n\t\t\tdata: img.data,\n\t\t\tmimeType: img.mimeType,\n\t\t\toriginalWidth: 0,\n\t\t\toriginalHeight: 0,\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t\twasResized: false,\n\t\t};\n\t}\n}\n\n/**\n * Format a dimension note for resized images.\n * This helps the model understand the coordinate mapping.\n */\nexport function formatDimensionNote(result: ResizedImage): string | undefined {\n\tif (!result.wasResized) {\n\t\treturn undefined;\n\t}\n\n\tconst scale = result.originalWidth / result.width;\n\treturn `[Image: original ${result.originalWidth}x${result.originalHeight}, displayed at ${result.width}x${result.height}. Multiply coordinates by ${scale.toFixed(2)} to map to original image.]`;\n}\n"]}
@@ -21,16 +21,16 @@
21
21
  },
22
22
  "scripts": {
23
23
  "build": "tsc -p tsconfig.json && npm run copy-assets",
24
- "copy-assets": "node -e \"const{mkdirSync,cpSync}=require('fs');mkdirSync('dist/modes/interactive/theme',{recursive:true});cpSync('src/modes/interactive/theme','dist/modes/interactive/theme',{recursive:true,filter:(s)=>!s.endsWith('.ts')});mkdirSync('dist/core/export-html/vendor',{recursive:true});cpSync('src/core/export-html/template.html','dist/core/export-html/template.html');cpSync('src/core/export-html/template.css','dist/core/export-html/template.css');cpSync('src/core/export-html/template.js','dist/core/export-html/template.js');cpSync('src/core/export-html/vendor','dist/core/export-html/vendor',{recursive:true,filter:(s)=>!s.endsWith('.ts')})\""
24
+ "copy-assets": "node -e \"const{mkdirSync,cpSync}=require('fs');mkdirSync('dist/modes/interactive/theme',{recursive:true});cpSync('src/modes/interactive/theme','dist/modes/interactive/theme',{recursive:true,filter:(s)=>!s.endsWith('.ts')});mkdirSync('dist/core/export-html/vendor',{recursive:true});cpSync('src/core/export-html/template.html','dist/core/export-html/template.html');cpSync('src/core/export-html/template.css','dist/core/export-html/template.css');cpSync('src/core/export-html/template.js','dist/core/export-html/template.js');cpSync('src/core/export-html/vendor','dist/core/export-html/vendor',{recursive:true,filter:(s)=>!s.endsWith('.ts')});mkdirSync('dist/core/lsp',{recursive:true});cpSync('src/core/lsp/defaults.json','dist/core/lsp/defaults.json');cpSync('src/core/lsp/lsp.md','dist/core/lsp/lsp.md')\""
25
25
  },
26
26
  "dependencies": {
27
+ "@gsd/native": "*",
27
28
  "@gsd/pi-agent-core": "*",
28
29
  "@gsd/pi-ai": "*",
29
30
  "@gsd/pi-tui": "*",
30
31
  "@mariozechner/jiti": "^2.6.2",
31
32
  "@silvia-odwyer/photon-node": "^0.3.4",
32
33
  "chalk": "^5.5.0",
33
- "cli-highlight": "^2.1.11",
34
34
  "diff": "^8.0.2",
35
35
  "extract-zip": "^2.0.1",
36
36
  "file-type": "^21.1.1",
@@ -44,9 +44,6 @@
44
44
  "undici": "^7.19.1",
45
45
  "yaml": "^2.8.2"
46
46
  },
47
- "optionalDependencies": {
48
- "@mariozechner/clipboard": "^0.3.2"
49
- },
50
47
  "devDependencies": {
51
48
  "@types/diff": "^7.0.2",
52
49
  "@types/hosted-git-info": "^3.0.5",