@didim365/agent-cli 0.1.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 (2286) hide show
  1. package/dist/.last_build +0 -0
  2. package/dist/index.d.ts +7 -0
  3. package/dist/index.js +50 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/package.json +97 -0
  6. package/dist/src/commands/extensions/configure.d.ts +13 -0
  7. package/dist/src/commands/extensions/configure.js +131 -0
  8. package/dist/src/commands/extensions/configure.js.map +1 -0
  9. package/dist/src/commands/extensions/configure.test.d.ts +1 -0
  10. package/dist/src/commands/extensions/configure.test.js +197 -0
  11. package/dist/src/commands/extensions/configure.test.js.map +1 -0
  12. package/dist/src/commands/extensions/disable.d.ts +13 -0
  13. package/dist/src/commands/extensions/disable.js +69 -0
  14. package/dist/src/commands/extensions/disable.js.map +1 -0
  15. package/dist/src/commands/extensions/disable.test.d.ts +6 -0
  16. package/dist/src/commands/extensions/disable.test.js +169 -0
  17. package/dist/src/commands/extensions/disable.test.js.map +1 -0
  18. package/dist/src/commands/extensions/enable.d.ts +13 -0
  19. package/dist/src/commands/extensions/enable.js +84 -0
  20. package/dist/src/commands/extensions/enable.js.map +1 -0
  21. package/dist/src/commands/extensions/enable.test.d.ts +6 -0
  22. package/dist/src/commands/extensions/enable.test.js +199 -0
  23. package/dist/src/commands/extensions/enable.test.js.map +1 -0
  24. package/dist/src/commands/extensions/examples/context/GEMINI.md +14 -0
  25. package/dist/src/commands/extensions/examples/context/gemini-extension.json +4 -0
  26. package/dist/src/commands/extensions/examples/custom-commands/commands/fs/grep-code.toml +6 -0
  27. package/dist/src/commands/extensions/examples/custom-commands/gemini-extension.json +4 -0
  28. package/dist/src/commands/extensions/examples/exclude-tools/gemini-extension.json +5 -0
  29. package/dist/src/commands/extensions/examples/hooks/gemini-extension.json +4 -0
  30. package/dist/src/commands/extensions/examples/hooks/hooks/hooks.json +14 -0
  31. package/dist/src/commands/extensions/examples/hooks/scripts/on-start.js +8 -0
  32. package/dist/src/commands/extensions/examples/mcp-server/README.md +35 -0
  33. package/dist/src/commands/extensions/examples/mcp-server/example.js +60 -0
  34. package/dist/src/commands/extensions/examples/mcp-server/gemini-extension.json +11 -0
  35. package/dist/src/commands/extensions/examples/mcp-server/package.json +11 -0
  36. package/dist/src/commands/extensions/examples/skills/gemini-extension.json +4 -0
  37. package/dist/src/commands/extensions/examples/skills/skills/greeter/SKILL.md +7 -0
  38. package/dist/src/commands/extensions/install.d.ts +16 -0
  39. package/dist/src/commands/extensions/install.js +87 -0
  40. package/dist/src/commands/extensions/install.js.map +1 -0
  41. package/dist/src/commands/extensions/install.test.d.ts +6 -0
  42. package/dist/src/commands/extensions/install.test.js +140 -0
  43. package/dist/src/commands/extensions/install.test.js.map +1 -0
  44. package/dist/src/commands/extensions/link.d.ts +13 -0
  45. package/dist/src/commands/extensions/link.js +64 -0
  46. package/dist/src/commands/extensions/link.js.map +1 -0
  47. package/dist/src/commands/extensions/link.test.d.ts +6 -0
  48. package/dist/src/commands/extensions/link.test.js +137 -0
  49. package/dist/src/commands/extensions/link.test.js.map +1 -0
  50. package/dist/src/commands/extensions/list.d.ts +10 -0
  51. package/dist/src/commands/extensions/list.js +63 -0
  52. package/dist/src/commands/extensions/list.js.map +1 -0
  53. package/dist/src/commands/extensions/list.test.d.ts +6 -0
  54. package/dist/src/commands/extensions/list.test.js +148 -0
  55. package/dist/src/commands/extensions/list.test.js.map +1 -0
  56. package/dist/src/commands/extensions/new.d.ts +7 -0
  57. package/dist/src/commands/extensions/new.js +86 -0
  58. package/dist/src/commands/extensions/new.js.map +1 -0
  59. package/dist/src/commands/extensions/new.test.d.ts +6 -0
  60. package/dist/src/commands/extensions/new.test.js +62 -0
  61. package/dist/src/commands/extensions/new.test.js.map +1 -0
  62. package/dist/src/commands/extensions/uninstall.d.ts +12 -0
  63. package/dist/src/commands/extensions/uninstall.js +67 -0
  64. package/dist/src/commands/extensions/uninstall.js.map +1 -0
  65. package/dist/src/commands/extensions/uninstall.test.d.ts +6 -0
  66. package/dist/src/commands/extensions/uninstall.test.js +199 -0
  67. package/dist/src/commands/extensions/uninstall.test.js.map +1 -0
  68. package/dist/src/commands/extensions/update.d.ts +13 -0
  69. package/dist/src/commands/extensions/update.js +107 -0
  70. package/dist/src/commands/extensions/update.js.map +1 -0
  71. package/dist/src/commands/extensions/update.test.d.ts +6 -0
  72. package/dist/src/commands/extensions/update.test.js +170 -0
  73. package/dist/src/commands/extensions/update.test.js.map +1 -0
  74. package/dist/src/commands/extensions/utils.d.ts +14 -0
  75. package/dist/src/commands/extensions/utils.js +33 -0
  76. package/dist/src/commands/extensions/utils.js.map +1 -0
  77. package/dist/src/commands/extensions/validate.d.ts +12 -0
  78. package/dist/src/commands/extensions/validate.js +85 -0
  79. package/dist/src/commands/extensions/validate.js.map +1 -0
  80. package/dist/src/commands/extensions/validate.test.d.ts +6 -0
  81. package/dist/src/commands/extensions/validate.test.js +96 -0
  82. package/dist/src/commands/extensions/validate.test.js.map +1 -0
  83. package/dist/src/commands/extensions.d.ts +7 -0
  84. package/dist/src/commands/extensions.js +44 -0
  85. package/dist/src/commands/extensions.js.map +1 -0
  86. package/dist/src/commands/extensions.test.d.ts +6 -0
  87. package/dist/src/commands/extensions.test.js +67 -0
  88. package/dist/src/commands/extensions.test.js.map +1 -0
  89. package/dist/src/commands/hooks/migrate.d.ts +11 -0
  90. package/dist/src/commands/hooks/migrate.js +205 -0
  91. package/dist/src/commands/hooks/migrate.js.map +1 -0
  92. package/dist/src/commands/hooks/migrate.test.d.ts +6 -0
  93. package/dist/src/commands/hooks/migrate.test.js +388 -0
  94. package/dist/src/commands/hooks/migrate.test.js.map +1 -0
  95. package/dist/src/commands/hooks.d.ts +7 -0
  96. package/dist/src/commands/hooks.js +25 -0
  97. package/dist/src/commands/hooks.js.map +1 -0
  98. package/dist/src/commands/mcp/add.d.ts +7 -0
  99. package/dist/src/commands/mcp/add.js +178 -0
  100. package/dist/src/commands/mcp/add.js.map +1 -0
  101. package/dist/src/commands/mcp/add.test.d.ts +6 -0
  102. package/dist/src/commands/mcp/add.test.js +274 -0
  103. package/dist/src/commands/mcp/add.test.js.map +1 -0
  104. package/dist/src/commands/mcp/enableDisable.d.ts +13 -0
  105. package/dist/src/commands/mcp/enableDisable.js +106 -0
  106. package/dist/src/commands/mcp/enableDisable.js.map +1 -0
  107. package/dist/src/commands/mcp/list.d.ts +10 -0
  108. package/dist/src/commands/mcp/list.js +129 -0
  109. package/dist/src/commands/mcp/list.js.map +1 -0
  110. package/dist/src/commands/mcp/list.test.d.ts +6 -0
  111. package/dist/src/commands/mcp/list.test.js +150 -0
  112. package/dist/src/commands/mcp/list.test.js.map +1 -0
  113. package/dist/src/commands/mcp/remove.d.ts +7 -0
  114. package/dist/src/commands/mcp/remove.js +47 -0
  115. package/dist/src/commands/mcp/remove.js.map +1 -0
  116. package/dist/src/commands/mcp/remove.test.d.ts +6 -0
  117. package/dist/src/commands/mcp/remove.test.js +189 -0
  118. package/dist/src/commands/mcp/remove.test.js.map +1 -0
  119. package/dist/src/commands/mcp.d.ts +7 -0
  120. package/dist/src/commands/mcp.js +32 -0
  121. package/dist/src/commands/mcp.js.map +1 -0
  122. package/dist/src/commands/mcp.test.d.ts +6 -0
  123. package/dist/src/commands/mcp.test.js +65 -0
  124. package/dist/src/commands/mcp.test.js.map +1 -0
  125. package/dist/src/commands/skills/disable.d.ts +14 -0
  126. package/dist/src/commands/skills/disable.js +47 -0
  127. package/dist/src/commands/skills/disable.js.map +1 -0
  128. package/dist/src/commands/skills/disable.test.d.ts +6 -0
  129. package/dist/src/commands/skills/disable.test.js +96 -0
  130. package/dist/src/commands/skills/disable.test.js.map +1 -0
  131. package/dist/src/commands/skills/enable.d.ts +12 -0
  132. package/dist/src/commands/skills/enable.js +35 -0
  133. package/dist/src/commands/skills/enable.js.map +1 -0
  134. package/dist/src/commands/skills/enable.test.d.ts +6 -0
  135. package/dist/src/commands/skills/enable.test.js +107 -0
  136. package/dist/src/commands/skills/enable.test.js.map +1 -0
  137. package/dist/src/commands/skills/install.d.ts +15 -0
  138. package/dist/src/commands/skills/install.js +76 -0
  139. package/dist/src/commands/skills/install.js.map +1 -0
  140. package/dist/src/commands/skills/install.test.d.ts +6 -0
  141. package/dist/src/commands/skills/install.test.js +95 -0
  142. package/dist/src/commands/skills/install.test.js.map +1 -0
  143. package/dist/src/commands/skills/list.d.ts +10 -0
  144. package/dist/src/commands/skills/list.js +60 -0
  145. package/dist/src/commands/skills/list.js.map +1 -0
  146. package/dist/src/commands/skills/list.test.d.ts +6 -0
  147. package/dist/src/commands/skills/list.test.js +136 -0
  148. package/dist/src/commands/skills/list.test.js.map +1 -0
  149. package/dist/src/commands/skills/uninstall.d.ts +13 -0
  150. package/dist/src/commands/skills/uninstall.js +56 -0
  151. package/dist/src/commands/skills/uninstall.js.map +1 -0
  152. package/dist/src/commands/skills/uninstall.test.d.ts +6 -0
  153. package/dist/src/commands/skills/uninstall.test.js +61 -0
  154. package/dist/src/commands/skills/uninstall.test.js.map +1 -0
  155. package/dist/src/commands/skills.d.ts +7 -0
  156. package/dist/src/commands/skills.js +34 -0
  157. package/dist/src/commands/skills.js.map +1 -0
  158. package/dist/src/commands/skills.test.d.ts +6 -0
  159. package/dist/src/commands/skills.test.js +49 -0
  160. package/dist/src/commands/skills.test.js.map +1 -0
  161. package/dist/src/commands/utils.d.ts +6 -0
  162. package/dist/src/commands/utils.js +11 -0
  163. package/dist/src/commands/utils.js.map +1 -0
  164. package/dist/src/commands/utils.test.d.ts +6 -0
  165. package/dist/src/commands/utils.test.js +35 -0
  166. package/dist/src/commands/utils.test.js.map +1 -0
  167. package/dist/src/config/auth.d.ts +6 -0
  168. package/dist/src/config/auth.js +35 -0
  169. package/dist/src/config/auth.js.map +1 -0
  170. package/dist/src/config/auth.test.d.ts +6 -0
  171. package/dist/src/config/auth.test.js +89 -0
  172. package/dist/src/config/auth.test.js.map +1 -0
  173. package/dist/src/config/config.d.ts +47 -0
  174. package/dist/src/config/config.integration.test.d.ts +6 -0
  175. package/dist/src/config/config.integration.test.js +205 -0
  176. package/dist/src/config/config.integration.test.js.map +1 -0
  177. package/dist/src/config/config.js +618 -0
  178. package/dist/src/config/config.js.map +1 -0
  179. package/dist/src/config/config.test.d.ts +6 -0
  180. package/dist/src/config/config.test.js +2413 -0
  181. package/dist/src/config/config.test.js.map +1 -0
  182. package/dist/src/config/extension-manager-agents.test.d.ts +6 -0
  183. package/dist/src/config/extension-manager-agents.test.js +114 -0
  184. package/dist/src/config/extension-manager-agents.test.js.map +1 -0
  185. package/dist/src/config/extension-manager-scope.test.d.ts +6 -0
  186. package/dist/src/config/extension-manager-scope.test.js +153 -0
  187. package/dist/src/config/extension-manager-scope.test.js.map +1 -0
  188. package/dist/src/config/extension-manager-skills.test.d.ts +6 -0
  189. package/dist/src/config/extension-manager-skills.test.js +148 -0
  190. package/dist/src/config/extension-manager-skills.test.js.map +1 -0
  191. package/dist/src/config/extension-manager.d.ts +70 -0
  192. package/dist/src/config/extension-manager.js +648 -0
  193. package/dist/src/config/extension-manager.js.map +1 -0
  194. package/dist/src/config/extension.d.ts +28 -0
  195. package/dist/src/config/extension.js +20 -0
  196. package/dist/src/config/extension.js.map +1 -0
  197. package/dist/src/config/extension.test.d.ts +6 -0
  198. package/dist/src/config/extension.test.js +1671 -0
  199. package/dist/src/config/extension.test.js.map +1 -0
  200. package/dist/src/config/extensions/consent.d.ts +44 -0
  201. package/dist/src/config/extensions/consent.js +173 -0
  202. package/dist/src/config/extensions/consent.js.map +1 -0
  203. package/dist/src/config/extensions/consent.test.d.ts +6 -0
  204. package/dist/src/config/extensions/consent.test.js +280 -0
  205. package/dist/src/config/extensions/consent.test.js.map +1 -0
  206. package/dist/src/config/extensions/extensionEnablement.d.ts +47 -0
  207. package/dist/src/config/extensions/extensionEnablement.js +190 -0
  208. package/dist/src/config/extensions/extensionEnablement.js.map +1 -0
  209. package/dist/src/config/extensions/extensionEnablement.test.d.ts +6 -0
  210. package/dist/src/config/extensions/extensionEnablement.test.js +404 -0
  211. package/dist/src/config/extensions/extensionEnablement.test.js.map +1 -0
  212. package/dist/src/config/extensions/extensionSettings.d.ts +23 -0
  213. package/dist/src/config/extensions/extensionSettings.js +204 -0
  214. package/dist/src/config/extensions/extensionSettings.js.map +1 -0
  215. package/dist/src/config/extensions/extensionSettings.test.d.ts +6 -0
  216. package/dist/src/config/extensions/extensionSettings.test.js +493 -0
  217. package/dist/src/config/extensions/extensionSettings.test.js.map +1 -0
  218. package/dist/src/config/extensions/extensionUpdates.test.d.ts +6 -0
  219. package/dist/src/config/extensions/extensionUpdates.test.js +230 -0
  220. package/dist/src/config/extensions/extensionUpdates.test.js.map +1 -0
  221. package/dist/src/config/extensions/github.d.ts +50 -0
  222. package/dist/src/config/extensions/github.js +416 -0
  223. package/dist/src/config/extensions/github.js.map +1 -0
  224. package/dist/src/config/extensions/github.test.d.ts +6 -0
  225. package/dist/src/config/extensions/github.test.js +441 -0
  226. package/dist/src/config/extensions/github.test.js.map +1 -0
  227. package/dist/src/config/extensions/github_fetch.d.ts +7 -0
  228. package/dist/src/config/extensions/github_fetch.js +46 -0
  229. package/dist/src/config/extensions/github_fetch.js.map +1 -0
  230. package/dist/src/config/extensions/github_fetch.test.d.ts +6 -0
  231. package/dist/src/config/extensions/github_fetch.test.js +169 -0
  232. package/dist/src/config/extensions/github_fetch.test.js.map +1 -0
  233. package/dist/src/config/extensions/storage.d.ts +14 -0
  234. package/dist/src/config/extensions/storage.js +32 -0
  235. package/dist/src/config/extensions/storage.js.map +1 -0
  236. package/dist/src/config/extensions/storage.test.d.ts +6 -0
  237. package/dist/src/config/extensions/storage.test.js +64 -0
  238. package/dist/src/config/extensions/storage.test.js.map +1 -0
  239. package/dist/src/config/extensions/update.d.ts +20 -0
  240. package/dist/src/config/extensions/update.js +120 -0
  241. package/dist/src/config/extensions/update.js.map +1 -0
  242. package/dist/src/config/extensions/update.test.d.ts +6 -0
  243. package/dist/src/config/extensions/update.test.js +231 -0
  244. package/dist/src/config/extensions/update.test.js.map +1 -0
  245. package/dist/src/config/extensions/variableSchema.d.ts +32 -0
  246. package/dist/src/config/extensions/variableSchema.js +22 -0
  247. package/dist/src/config/extensions/variableSchema.js.map +1 -0
  248. package/dist/src/config/extensions/variables.d.ts +21 -0
  249. package/dist/src/config/extensions/variables.js +46 -0
  250. package/dist/src/config/extensions/variables.js.map +1 -0
  251. package/dist/src/config/extensions/variables.test.d.ts +6 -0
  252. package/dist/src/config/extensions/variables.test.js +103 -0
  253. package/dist/src/config/extensions/variables.test.js.map +1 -0
  254. package/dist/src/config/keyBindings.d.ts +107 -0
  255. package/dist/src/config/keyBindings.js +400 -0
  256. package/dist/src/config/keyBindings.js.map +1 -0
  257. package/dist/src/config/keyBindings.test.d.ts +6 -0
  258. package/dist/src/config/keyBindings.test.js +108 -0
  259. package/dist/src/config/keyBindings.test.js.map +1 -0
  260. package/dist/src/config/mcp/index.d.ts +6 -0
  261. package/dist/src/config/mcp/index.js +7 -0
  262. package/dist/src/config/mcp/index.js.map +1 -0
  263. package/dist/src/config/mcp/mcpServerEnablement.d.ts +150 -0
  264. package/dist/src/config/mcp/mcpServerEnablement.js +278 -0
  265. package/dist/src/config/mcp/mcpServerEnablement.js.map +1 -0
  266. package/dist/src/config/mcp/mcpServerEnablement.test.d.ts +6 -0
  267. package/dist/src/config/mcp/mcpServerEnablement.test.js +147 -0
  268. package/dist/src/config/mcp/mcpServerEnablement.test.js.map +1 -0
  269. package/dist/src/config/policy-engine.integration.test.d.ts +6 -0
  270. package/dist/src/config/policy-engine.integration.test.js +353 -0
  271. package/dist/src/config/policy-engine.integration.test.js.map +1 -0
  272. package/dist/src/config/policy.d.ts +9 -0
  273. package/dist/src/config/policy.js +21 -0
  274. package/dist/src/config/policy.js.map +1 -0
  275. package/dist/src/config/sandboxConfig.d.ts +12 -0
  276. package/dist/src/config/sandboxConfig.js +74 -0
  277. package/dist/src/config/sandboxConfig.js.map +1 -0
  278. package/dist/src/config/sandboxConfig.test.d.ts +6 -0
  279. package/dist/src/config/sandboxConfig.test.js +184 -0
  280. package/dist/src/config/sandboxConfig.test.js.map +1 -0
  281. package/dist/src/config/settingPaths.d.ts +10 -0
  282. package/dist/src/config/settingPaths.js +11 -0
  283. package/dist/src/config/settingPaths.js.map +1 -0
  284. package/dist/src/config/settingPaths.test.d.ts +6 -0
  285. package/dist/src/config/settingPaths.test.js +22 -0
  286. package/dist/src/config/settingPaths.test.js.map +1 -0
  287. package/dist/src/config/settings-validation.d.ts +23 -0
  288. package/dist/src/config/settings-validation.js +249 -0
  289. package/dist/src/config/settings-validation.js.map +1 -0
  290. package/dist/src/config/settings-validation.test.d.ts +6 -0
  291. package/dist/src/config/settings-validation.test.js +370 -0
  292. package/dist/src/config/settings-validation.test.js.map +1 -0
  293. package/dist/src/config/settings.d.ts +105 -0
  294. package/dist/src/config/settings.js +677 -0
  295. package/dist/src/config/settings.js.map +1 -0
  296. package/dist/src/config/settings.test.d.ts +6 -0
  297. package/dist/src/config/settings.test.js +1822 -0
  298. package/dist/src/config/settings.test.js.map +1 -0
  299. package/dist/src/config/settingsSchema.d.ts +1748 -0
  300. package/dist/src/config/settingsSchema.js +2032 -0
  301. package/dist/src/config/settingsSchema.js.map +1 -0
  302. package/dist/src/config/settingsSchema.test.d.ts +6 -0
  303. package/dist/src/config/settingsSchema.test.js +309 -0
  304. package/dist/src/config/settingsSchema.test.js.map +1 -0
  305. package/dist/src/config/settings_repro.test.d.ts +6 -0
  306. package/dist/src/config/settings_repro.test.js +166 -0
  307. package/dist/src/config/settings_repro.test.js.map +1 -0
  308. package/dist/src/config/settings_validation_warning.test.d.ts +6 -0
  309. package/dist/src/config/settings_validation_warning.test.js +123 -0
  310. package/dist/src/config/settings_validation_warning.test.js.map +1 -0
  311. package/dist/src/config/skills-backward-compatibility.test.d.ts +6 -0
  312. package/dist/src/config/skills-backward-compatibility.test.js +99 -0
  313. package/dist/src/config/skills-backward-compatibility.test.js.map +1 -0
  314. package/dist/src/config/trustedFolders.d.ts +56 -0
  315. package/dist/src/config/trustedFolders.js +190 -0
  316. package/dist/src/config/trustedFolders.js.map +1 -0
  317. package/dist/src/config/trustedFolders.test.d.ts +6 -0
  318. package/dist/src/config/trustedFolders.test.js +385 -0
  319. package/dist/src/config/trustedFolders.test.js.map +1 -0
  320. package/dist/src/core/auth.d.ts +13 -0
  321. package/dist/src/core/auth.js +32 -0
  322. package/dist/src/core/auth.js.map +1 -0
  323. package/dist/src/core/auth.test.d.ts +6 -0
  324. package/dist/src/core/auth.test.js +47 -0
  325. package/dist/src/core/auth.test.js.map +1 -0
  326. package/dist/src/core/initializer.d.ts +21 -0
  327. package/dist/src/core/initializer.js +36 -0
  328. package/dist/src/core/initializer.js.map +1 -0
  329. package/dist/src/core/initializer.test.d.ts +6 -0
  330. package/dist/src/core/initializer.test.js +101 -0
  331. package/dist/src/core/initializer.test.js.map +1 -0
  332. package/dist/src/core/theme.d.ts +12 -0
  333. package/dist/src/core/theme.js +20 -0
  334. package/dist/src/core/theme.js.map +1 -0
  335. package/dist/src/core/theme.test.d.ts +6 -0
  336. package/dist/src/core/theme.test.js +46 -0
  337. package/dist/src/core/theme.test.js.map +1 -0
  338. package/dist/src/deferred.d.ts +19 -0
  339. package/dist/src/deferred.js +50 -0
  340. package/dist/src/deferred.js.map +1 -0
  341. package/dist/src/deferred.test.d.ts +6 -0
  342. package/dist/src/deferred.test.js +164 -0
  343. package/dist/src/deferred.test.js.map +1 -0
  344. package/dist/src/gemini.d.ts +14 -0
  345. package/dist/src/gemini.js +580 -0
  346. package/dist/src/gemini.js.map +1 -0
  347. package/dist/src/gemini.test.d.ts +6 -0
  348. package/dist/src/gemini.test.js +1334 -0
  349. package/dist/src/gemini.test.js.map +1 -0
  350. package/dist/src/gemini_cleanup.test.d.ts +6 -0
  351. package/dist/src/gemini_cleanup.test.js +208 -0
  352. package/dist/src/gemini_cleanup.test.js.map +1 -0
  353. package/dist/src/generated/git-commit.d.ts +7 -0
  354. package/dist/src/generated/git-commit.js +10 -0
  355. package/dist/src/generated/git-commit.js.map +1 -0
  356. package/dist/src/nonInteractiveCli.d.ts +16 -0
  357. package/dist/src/nonInteractiveCli.js +393 -0
  358. package/dist/src/nonInteractiveCli.js.map +1 -0
  359. package/dist/src/nonInteractiveCli.test.d.ts +6 -0
  360. package/dist/src/nonInteractiveCli.test.js +1687 -0
  361. package/dist/src/nonInteractiveCli.test.js.map +1 -0
  362. package/dist/src/nonInteractiveCliCommands.d.ts +17 -0
  363. package/dist/src/nonInteractiveCliCommands.js +83 -0
  364. package/dist/src/nonInteractiveCliCommands.js.map +1 -0
  365. package/dist/src/patches/is-in-ci.d.ts +7 -0
  366. package/dist/src/patches/is-in-ci.js +15 -0
  367. package/dist/src/patches/is-in-ci.js.map +1 -0
  368. package/dist/src/services/BuiltinCommandLoader.d.ts +24 -0
  369. package/dist/src/services/BuiltinCommandLoader.js +158 -0
  370. package/dist/src/services/BuiltinCommandLoader.js.map +1 -0
  371. package/dist/src/services/BuiltinCommandLoader.test.d.ts +6 -0
  372. package/dist/src/services/BuiltinCommandLoader.test.js +254 -0
  373. package/dist/src/services/BuiltinCommandLoader.test.js.map +1 -0
  374. package/dist/src/services/CommandService.d.ts +55 -0
  375. package/dist/src/services/CommandService.js +91 -0
  376. package/dist/src/services/CommandService.js.map +1 -0
  377. package/dist/src/services/CommandService.test.d.ts +6 -0
  378. package/dist/src/services/CommandService.test.js +234 -0
  379. package/dist/src/services/CommandService.test.js.map +1 -0
  380. package/dist/src/services/FileCommandLoader.d.ts +51 -0
  381. package/dist/src/services/FileCommandLoader.js +238 -0
  382. package/dist/src/services/FileCommandLoader.js.map +1 -0
  383. package/dist/src/services/FileCommandLoader.test.d.ts +6 -0
  384. package/dist/src/services/FileCommandLoader.test.js +1102 -0
  385. package/dist/src/services/FileCommandLoader.test.js.map +1 -0
  386. package/dist/src/services/McpPromptLoader.d.ts +35 -0
  387. package/dist/src/services/McpPromptLoader.js +256 -0
  388. package/dist/src/services/McpPromptLoader.js.map +1 -0
  389. package/dist/src/services/McpPromptLoader.test.d.ts +6 -0
  390. package/dist/src/services/McpPromptLoader.test.js +411 -0
  391. package/dist/src/services/McpPromptLoader.test.js.map +1 -0
  392. package/dist/src/services/prompt-processors/argumentProcessor.d.ts +16 -0
  393. package/dist/src/services/prompt-processors/argumentProcessor.js +21 -0
  394. package/dist/src/services/prompt-processors/argumentProcessor.js.map +1 -0
  395. package/dist/src/services/prompt-processors/argumentProcessor.test.d.ts +6 -0
  396. package/dist/src/services/prompt-processors/argumentProcessor.test.js +40 -0
  397. package/dist/src/services/prompt-processors/argumentProcessor.test.js.map +1 -0
  398. package/dist/src/services/prompt-processors/atFileProcessor.d.ts +12 -0
  399. package/dist/src/services/prompt-processors/atFileProcessor.js +63 -0
  400. package/dist/src/services/prompt-processors/atFileProcessor.js.map +1 -0
  401. package/dist/src/services/prompt-processors/atFileProcessor.test.d.ts +6 -0
  402. package/dist/src/services/prompt-processors/atFileProcessor.test.js +174 -0
  403. package/dist/src/services/prompt-processors/atFileProcessor.test.js.map +1 -0
  404. package/dist/src/services/prompt-processors/injectionParser.d.ts +29 -0
  405. package/dist/src/services/prompt-processors/injectionParser.js +60 -0
  406. package/dist/src/services/prompt-processors/injectionParser.js.map +1 -0
  407. package/dist/src/services/prompt-processors/injectionParser.test.d.ts +6 -0
  408. package/dist/src/services/prompt-processors/injectionParser.test.js +189 -0
  409. package/dist/src/services/prompt-processors/injectionParser.test.js.map +1 -0
  410. package/dist/src/services/prompt-processors/shellProcessor.d.ts +27 -0
  411. package/dist/src/services/prompt-processors/shellProcessor.js +130 -0
  412. package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -0
  413. package/dist/src/services/prompt-processors/shellProcessor.test.d.ts +6 -0
  414. package/dist/src/services/prompt-processors/shellProcessor.test.js +514 -0
  415. package/dist/src/services/prompt-processors/shellProcessor.test.js.map +1 -0
  416. package/dist/src/services/prompt-processors/types.d.ts +45 -0
  417. package/dist/src/services/prompt-processors/types.js +20 -0
  418. package/dist/src/services/prompt-processors/types.js.map +1 -0
  419. package/dist/src/services/types.d.ts +22 -0
  420. package/dist/src/services/types.js +7 -0
  421. package/dist/src/services/types.js.map +1 -0
  422. package/dist/src/test-utils/async.d.ts +9 -0
  423. package/dist/src/test-utils/async.js +29 -0
  424. package/dist/src/test-utils/async.js.map +1 -0
  425. package/dist/src/test-utils/createExtension.d.ts +17 -0
  426. package/dist/src/test-utils/createExtension.js +25 -0
  427. package/dist/src/test-utils/createExtension.js.map +1 -0
  428. package/dist/src/test-utils/customMatchers.d.ts +14 -0
  429. package/dist/src/test-utils/customMatchers.js +40 -0
  430. package/dist/src/test-utils/customMatchers.js.map +1 -0
  431. package/dist/src/test-utils/mockCommandContext.d.ts +18 -0
  432. package/dist/src/test-utils/mockCommandContext.js +96 -0
  433. package/dist/src/test-utils/mockCommandContext.js.map +1 -0
  434. package/dist/src/test-utils/mockCommandContext.test.d.ts +6 -0
  435. package/dist/src/test-utils/mockCommandContext.test.js +51 -0
  436. package/dist/src/test-utils/mockCommandContext.test.js.map +1 -0
  437. package/dist/src/test-utils/persistentStateFake.d.ts +26 -0
  438. package/dist/src/test-utils/persistentStateFake.js +39 -0
  439. package/dist/src/test-utils/persistentStateFake.js.map +1 -0
  440. package/dist/src/test-utils/render.d.ts +67 -0
  441. package/dist/src/test-utils/render.js +261 -0
  442. package/dist/src/test-utils/render.js.map +1 -0
  443. package/dist/src/test-utils/render.test.d.ts +6 -0
  444. package/dist/src/test-utils/render.test.js +79 -0
  445. package/dist/src/test-utils/render.test.js.map +1 -0
  446. package/dist/src/ui/App.d.ts +6 -0
  447. package/dist/src/ui/App.js +29 -0
  448. package/dist/src/ui/App.js.map +1 -0
  449. package/dist/src/ui/App.test.d.ts +6 -0
  450. package/dist/src/ui/App.test.js +218 -0
  451. package/dist/src/ui/App.test.js.map +1 -0
  452. package/dist/src/ui/AppContainer.d.ts +16 -0
  453. package/dist/src/ui/AppContainer.js +1452 -0
  454. package/dist/src/ui/AppContainer.js.map +1 -0
  455. package/dist/src/ui/AppContainer.test.d.ts +6 -0
  456. package/dist/src/ui/AppContainer.test.js +2072 -0
  457. package/dist/src/ui/AppContainer.test.js.map +1 -0
  458. package/dist/src/ui/IdeIntegrationNudge.d.ts +16 -0
  459. package/dist/src/ui/IdeIntegrationNudge.js +50 -0
  460. package/dist/src/ui/IdeIntegrationNudge.js.map +1 -0
  461. package/dist/src/ui/IdeIntegrationNudge.test.d.ts +6 -0
  462. package/dist/src/ui/IdeIntegrationNudge.test.js +158 -0
  463. package/dist/src/ui/IdeIntegrationNudge.test.js.map +1 -0
  464. package/dist/src/ui/auth/ApiAuthDialog.d.ts +14 -0
  465. package/dist/src/ui/auth/ApiAuthDialog.js +59 -0
  466. package/dist/src/ui/auth/ApiAuthDialog.js.map +1 -0
  467. package/dist/src/ui/auth/ApiAuthDialog.test.d.ts +6 -0
  468. package/dist/src/ui/auth/ApiAuthDialog.test.js +109 -0
  469. package/dist/src/ui/auth/ApiAuthDialog.test.js.map +1 -0
  470. package/dist/src/ui/auth/AuthDialog.d.ts +21 -0
  471. package/dist/src/ui/auth/AuthDialog.js +141 -0
  472. package/dist/src/ui/auth/AuthDialog.js.map +1 -0
  473. package/dist/src/ui/auth/AuthDialog.test.d.ts +6 -0
  474. package/dist/src/ui/auth/AuthDialog.test.js +309 -0
  475. package/dist/src/ui/auth/AuthDialog.test.js.map +1 -0
  476. package/dist/src/ui/auth/AuthInProgress.d.ts +11 -0
  477. package/dist/src/ui/auth/AuthInProgress.js +23 -0
  478. package/dist/src/ui/auth/AuthInProgress.js.map +1 -0
  479. package/dist/src/ui/auth/AuthInProgress.test.d.ts +6 -0
  480. package/dist/src/ui/auth/AuthInProgress.test.js +81 -0
  481. package/dist/src/ui/auth/AuthInProgress.test.js.map +1 -0
  482. package/dist/src/ui/auth/LoginWithGoogleRestartDialog.d.ts +10 -0
  483. package/dist/src/ui/auth/LoginWithGoogleRestartDialog.js +27 -0
  484. package/dist/src/ui/auth/LoginWithGoogleRestartDialog.js.map +1 -0
  485. package/dist/src/ui/auth/LoginWithGoogleRestartDialog.test.d.ts +6 -0
  486. package/dist/src/ui/auth/LoginWithGoogleRestartDialog.test.js +66 -0
  487. package/dist/src/ui/auth/LoginWithGoogleRestartDialog.test.js.map +1 -0
  488. package/dist/src/ui/auth/useAuth.d.ts +17 -0
  489. package/dist/src/ui/auth/useAuth.js +114 -0
  490. package/dist/src/ui/auth/useAuth.js.map +1 -0
  491. package/dist/src/ui/auth/useAuth.test.d.ts +6 -0
  492. package/dist/src/ui/auth/useAuth.test.js +189 -0
  493. package/dist/src/ui/auth/useAuth.test.js.map +1 -0
  494. package/dist/src/ui/colors.d.ts +7 -0
  495. package/dist/src/ui/colors.js +57 -0
  496. package/dist/src/ui/colors.js.map +1 -0
  497. package/dist/src/ui/commands/aboutCommand.d.ts +7 -0
  498. package/dist/src/ui/commands/aboutCommand.js +58 -0
  499. package/dist/src/ui/commands/aboutCommand.js.map +1 -0
  500. package/dist/src/ui/commands/aboutCommand.test.d.ts +6 -0
  501. package/dist/src/ui/commands/aboutCommand.test.js +143 -0
  502. package/dist/src/ui/commands/aboutCommand.test.js.map +1 -0
  503. package/dist/src/ui/commands/agentsCommand.d.ts +7 -0
  504. package/dist/src/ui/commands/agentsCommand.js +307 -0
  505. package/dist/src/ui/commands/agentsCommand.js.map +1 -0
  506. package/dist/src/ui/commands/agentsCommand.test.d.ts +6 -0
  507. package/dist/src/ui/commands/agentsCommand.test.js +344 -0
  508. package/dist/src/ui/commands/agentsCommand.test.js.map +1 -0
  509. package/dist/src/ui/commands/authCommand.d.ts +7 -0
  510. package/dist/src/ui/commands/authCommand.js +44 -0
  511. package/dist/src/ui/commands/authCommand.js.map +1 -0
  512. package/dist/src/ui/commands/authCommand.test.d.ts +6 -0
  513. package/dist/src/ui/commands/authCommand.test.js +98 -0
  514. package/dist/src/ui/commands/authCommand.test.js.map +1 -0
  515. package/dist/src/ui/commands/bugCommand.d.ts +7 -0
  516. package/dist/src/ui/commands/bugCommand.js +108 -0
  517. package/dist/src/ui/commands/bugCommand.js.map +1 -0
  518. package/dist/src/ui/commands/bugCommand.test.d.ts +6 -0
  519. package/dist/src/ui/commands/bugCommand.test.js +186 -0
  520. package/dist/src/ui/commands/bugCommand.test.js.map +1 -0
  521. package/dist/src/ui/commands/chatCommand.d.ts +8 -0
  522. package/dist/src/ui/commands/chatCommand.js +326 -0
  523. package/dist/src/ui/commands/chatCommand.js.map +1 -0
  524. package/dist/src/ui/commands/chatCommand.test.d.ts +6 -0
  525. package/dist/src/ui/commands/chatCommand.test.js +620 -0
  526. package/dist/src/ui/commands/chatCommand.test.js.map +1 -0
  527. package/dist/src/ui/commands/clearCommand.d.ts +7 -0
  528. package/dist/src/ui/commands/clearCommand.js +65 -0
  529. package/dist/src/ui/commands/clearCommand.js.map +1 -0
  530. package/dist/src/ui/commands/clearCommand.test.d.ts +6 -0
  531. package/dist/src/ui/commands/clearCommand.test.js +87 -0
  532. package/dist/src/ui/commands/clearCommand.test.js.map +1 -0
  533. package/dist/src/ui/commands/compressCommand.d.ts +7 -0
  534. package/dist/src/ui/commands/compressCommand.js +67 -0
  535. package/dist/src/ui/commands/compressCommand.js.map +1 -0
  536. package/dist/src/ui/commands/compressCommand.test.d.ts +6 -0
  537. package/dist/src/ui/commands/compressCommand.test.js +98 -0
  538. package/dist/src/ui/commands/compressCommand.test.js.map +1 -0
  539. package/dist/src/ui/commands/copyCommand.d.ts +7 -0
  540. package/dist/src/ui/commands/copyCommand.js +61 -0
  541. package/dist/src/ui/commands/copyCommand.js.map +1 -0
  542. package/dist/src/ui/commands/copyCommand.test.d.ts +6 -0
  543. package/dist/src/ui/commands/copyCommand.test.js +242 -0
  544. package/dist/src/ui/commands/copyCommand.test.js.map +1 -0
  545. package/dist/src/ui/commands/corgiCommand.d.ts +7 -0
  546. package/dist/src/ui/commands/corgiCommand.js +17 -0
  547. package/dist/src/ui/commands/corgiCommand.js.map +1 -0
  548. package/dist/src/ui/commands/corgiCommand.test.d.ts +6 -0
  549. package/dist/src/ui/commands/corgiCommand.test.js +28 -0
  550. package/dist/src/ui/commands/corgiCommand.test.js.map +1 -0
  551. package/dist/src/ui/commands/directoryCommand.d.ts +7 -0
  552. package/dist/src/ui/commands/directoryCommand.js +219 -0
  553. package/dist/src/ui/commands/directoryCommand.js.map +1 -0
  554. package/dist/src/ui/commands/directoryCommand.test.d.ts +6 -0
  555. package/dist/src/ui/commands/directoryCommand.test.js +353 -0
  556. package/dist/src/ui/commands/directoryCommand.test.js.map +1 -0
  557. package/dist/src/ui/commands/docsCommand.d.ts +7 -0
  558. package/dist/src/ui/commands/docsCommand.js +32 -0
  559. package/dist/src/ui/commands/docsCommand.js.map +1 -0
  560. package/dist/src/ui/commands/docsCommand.test.d.ts +6 -0
  561. package/dist/src/ui/commands/docsCommand.test.js +72 -0
  562. package/dist/src/ui/commands/docsCommand.test.js.map +1 -0
  563. package/dist/src/ui/commands/editorCommand.d.ts +7 -0
  564. package/dist/src/ui/commands/editorCommand.js +17 -0
  565. package/dist/src/ui/commands/editorCommand.js.map +1 -0
  566. package/dist/src/ui/commands/editorCommand.test.d.ts +6 -0
  567. package/dist/src/ui/commands/editorCommand.test.js +27 -0
  568. package/dist/src/ui/commands/editorCommand.test.js.map +1 -0
  569. package/dist/src/ui/commands/extensionsCommand.d.ts +12 -0
  570. package/dist/src/ui/commands/extensionsCommand.js +597 -0
  571. package/dist/src/ui/commands/extensionsCommand.js.map +1 -0
  572. package/dist/src/ui/commands/extensionsCommand.test.d.ts +6 -0
  573. package/dist/src/ui/commands/extensionsCommand.test.js +778 -0
  574. package/dist/src/ui/commands/extensionsCommand.test.js.map +1 -0
  575. package/dist/src/ui/commands/helpCommand.d.ts +7 -0
  576. package/dist/src/ui/commands/helpCommand.js +22 -0
  577. package/dist/src/ui/commands/helpCommand.js.map +1 -0
  578. package/dist/src/ui/commands/helpCommand.test.d.ts +6 -0
  579. package/dist/src/ui/commands/helpCommand.test.js +42 -0
  580. package/dist/src/ui/commands/helpCommand.test.js.map +1 -0
  581. package/dist/src/ui/commands/hooksCommand.d.ts +7 -0
  582. package/dist/src/ui/commands/hooksCommand.js +342 -0
  583. package/dist/src/ui/commands/hooksCommand.js.map +1 -0
  584. package/dist/src/ui/commands/hooksCommand.test.d.ts +6 -0
  585. package/dist/src/ui/commands/hooksCommand.test.js +572 -0
  586. package/dist/src/ui/commands/hooksCommand.test.js.map +1 -0
  587. package/dist/src/ui/commands/ideCommand.d.ts +7 -0
  588. package/dist/src/ui/commands/ideCommand.js +233 -0
  589. package/dist/src/ui/commands/ideCommand.js.map +1 -0
  590. package/dist/src/ui/commands/ideCommand.test.d.ts +6 -0
  591. package/dist/src/ui/commands/ideCommand.test.js +203 -0
  592. package/dist/src/ui/commands/ideCommand.test.js.map +1 -0
  593. package/dist/src/ui/commands/initCommand.d.ts +7 -0
  594. package/dist/src/ui/commands/initCommand.js +37 -0
  595. package/dist/src/ui/commands/initCommand.js.map +1 -0
  596. package/dist/src/ui/commands/initCommand.test.d.ts +6 -0
  597. package/dist/src/ui/commands/initCommand.test.js +84 -0
  598. package/dist/src/ui/commands/initCommand.test.js.map +1 -0
  599. package/dist/src/ui/commands/mcpCommand.d.ts +7 -0
  600. package/dist/src/ui/commands/mcpCommand.js +406 -0
  601. package/dist/src/ui/commands/mcpCommand.js.map +1 -0
  602. package/dist/src/ui/commands/mcpCommand.test.d.ts +6 -0
  603. package/dist/src/ui/commands/mcpCommand.test.js +189 -0
  604. package/dist/src/ui/commands/mcpCommand.test.js.map +1 -0
  605. package/dist/src/ui/commands/memoryCommand.d.ts +7 -0
  606. package/dist/src/ui/commands/memoryCommand.js +94 -0
  607. package/dist/src/ui/commands/memoryCommand.js.map +1 -0
  608. package/dist/src/ui/commands/memoryCommand.test.d.ts +6 -0
  609. package/dist/src/ui/commands/memoryCommand.test.js +350 -0
  610. package/dist/src/ui/commands/memoryCommand.test.js.map +1 -0
  611. package/dist/src/ui/commands/modelCommand.d.ts +7 -0
  612. package/dist/src/ui/commands/modelCommand.js +22 -0
  613. package/dist/src/ui/commands/modelCommand.js.map +1 -0
  614. package/dist/src/ui/commands/modelCommand.test.d.ts +6 -0
  615. package/dist/src/ui/commands/modelCommand.test.js +41 -0
  616. package/dist/src/ui/commands/modelCommand.test.js.map +1 -0
  617. package/dist/src/ui/commands/permissionsCommand.d.ts +7 -0
  618. package/dist/src/ui/commands/permissionsCommand.js +75 -0
  619. package/dist/src/ui/commands/permissionsCommand.js.map +1 -0
  620. package/dist/src/ui/commands/permissionsCommand.test.d.ts +6 -0
  621. package/dist/src/ui/commands/permissionsCommand.test.js +86 -0
  622. package/dist/src/ui/commands/permissionsCommand.test.js.map +1 -0
  623. package/dist/src/ui/commands/policiesCommand.d.ts +7 -0
  624. package/dist/src/ui/commands/policiesCommand.js +77 -0
  625. package/dist/src/ui/commands/policiesCommand.js.map +1 -0
  626. package/dist/src/ui/commands/policiesCommand.test.d.ts +6 -0
  627. package/dist/src/ui/commands/policiesCommand.test.js +87 -0
  628. package/dist/src/ui/commands/policiesCommand.test.js.map +1 -0
  629. package/dist/src/ui/commands/privacyCommand.d.ts +7 -0
  630. package/dist/src/ui/commands/privacyCommand.js +17 -0
  631. package/dist/src/ui/commands/privacyCommand.js.map +1 -0
  632. package/dist/src/ui/commands/privacyCommand.test.d.ts +6 -0
  633. package/dist/src/ui/commands/privacyCommand.test.js +32 -0
  634. package/dist/src/ui/commands/privacyCommand.test.js.map +1 -0
  635. package/dist/src/ui/commands/profileCommand.d.ts +7 -0
  636. package/dist/src/ui/commands/profileCommand.js +24 -0
  637. package/dist/src/ui/commands/profileCommand.js.map +1 -0
  638. package/dist/src/ui/commands/quitCommand.d.ts +7 -0
  639. package/dist/src/ui/commands/quitCommand.js +35 -0
  640. package/dist/src/ui/commands/quitCommand.js.map +1 -0
  641. package/dist/src/ui/commands/quitCommand.test.d.ts +6 -0
  642. package/dist/src/ui/commands/quitCommand.test.js +50 -0
  643. package/dist/src/ui/commands/quitCommand.test.js.map +1 -0
  644. package/dist/src/ui/commands/restoreCommand.d.ts +8 -0
  645. package/dist/src/ui/commands/restoreCommand.js +130 -0
  646. package/dist/src/ui/commands/restoreCommand.js.map +1 -0
  647. package/dist/src/ui/commands/restoreCommand.test.d.ts +6 -0
  648. package/dist/src/ui/commands/restoreCommand.test.js +190 -0
  649. package/dist/src/ui/commands/restoreCommand.test.js.map +1 -0
  650. package/dist/src/ui/commands/resumeCommand.d.ts +7 -0
  651. package/dist/src/ui/commands/resumeCommand.js +17 -0
  652. package/dist/src/ui/commands/resumeCommand.js.map +1 -0
  653. package/dist/src/ui/commands/rewindCommand.d.ts +7 -0
  654. package/dist/src/ui/commands/rewindCommand.js +132 -0
  655. package/dist/src/ui/commands/rewindCommand.js.map +1 -0
  656. package/dist/src/ui/commands/rewindCommand.test.d.ts +6 -0
  657. package/dist/src/ui/commands/rewindCommand.test.js +242 -0
  658. package/dist/src/ui/commands/rewindCommand.test.js.map +1 -0
  659. package/dist/src/ui/commands/settingsCommand.d.ts +7 -0
  660. package/dist/src/ui/commands/settingsCommand.js +17 -0
  661. package/dist/src/ui/commands/settingsCommand.js.map +1 -0
  662. package/dist/src/ui/commands/settingsCommand.test.d.ts +6 -0
  663. package/dist/src/ui/commands/settingsCommand.test.js +30 -0
  664. package/dist/src/ui/commands/settingsCommand.test.js.map +1 -0
  665. package/dist/src/ui/commands/setupGithubCommand.d.ts +10 -0
  666. package/dist/src/ui/commands/setupGithubCommand.js +195 -0
  667. package/dist/src/ui/commands/setupGithubCommand.js.map +1 -0
  668. package/dist/src/ui/commands/setupGithubCommand.test.d.ts +6 -0
  669. package/dist/src/ui/commands/setupGithubCommand.test.js +238 -0
  670. package/dist/src/ui/commands/setupGithubCommand.test.js.map +1 -0
  671. package/dist/src/ui/commands/skillsCommand.d.ts +7 -0
  672. package/dist/src/ui/commands/skillsCommand.js +237 -0
  673. package/dist/src/ui/commands/skillsCommand.js.map +1 -0
  674. package/dist/src/ui/commands/skillsCommand.test.d.ts +6 -0
  675. package/dist/src/ui/commands/skillsCommand.test.js +426 -0
  676. package/dist/src/ui/commands/skillsCommand.test.js.map +1 -0
  677. package/dist/src/ui/commands/statsCommand.d.ts +7 -0
  678. package/dist/src/ui/commands/statsCommand.js +75 -0
  679. package/dist/src/ui/commands/statsCommand.js.map +1 -0
  680. package/dist/src/ui/commands/statsCommand.test.d.ts +6 -0
  681. package/dist/src/ui/commands/statsCommand.test.js +70 -0
  682. package/dist/src/ui/commands/statsCommand.test.js.map +1 -0
  683. package/dist/src/ui/commands/terminalSetupCommand.d.ts +13 -0
  684. package/dist/src/ui/commands/terminalSetupCommand.js +43 -0
  685. package/dist/src/ui/commands/terminalSetupCommand.js.map +1 -0
  686. package/dist/src/ui/commands/terminalSetupCommand.test.d.ts +6 -0
  687. package/dist/src/ui/commands/terminalSetupCommand.test.js +66 -0
  688. package/dist/src/ui/commands/terminalSetupCommand.test.js.map +1 -0
  689. package/dist/src/ui/commands/themeCommand.d.ts +7 -0
  690. package/dist/src/ui/commands/themeCommand.js +17 -0
  691. package/dist/src/ui/commands/themeCommand.js.map +1 -0
  692. package/dist/src/ui/commands/themeCommand.test.d.ts +6 -0
  693. package/dist/src/ui/commands/themeCommand.test.js +32 -0
  694. package/dist/src/ui/commands/themeCommand.test.js.map +1 -0
  695. package/dist/src/ui/commands/toolsCommand.d.ts +7 -0
  696. package/dist/src/ui/commands/toolsCommand.js +43 -0
  697. package/dist/src/ui/commands/toolsCommand.js.map +1 -0
  698. package/dist/src/ui/commands/toolsCommand.test.d.ts +6 -0
  699. package/dist/src/ui/commands/toolsCommand.test.js +100 -0
  700. package/dist/src/ui/commands/toolsCommand.test.js.map +1 -0
  701. package/dist/src/ui/commands/types.d.ts +147 -0
  702. package/dist/src/ui/commands/types.js +13 -0
  703. package/dist/src/ui/commands/types.js.map +1 -0
  704. package/dist/src/ui/commands/vimCommand.d.ts +7 -0
  705. package/dist/src/ui/commands/vimCommand.js +24 -0
  706. package/dist/src/ui/commands/vimCommand.js.map +1 -0
  707. package/dist/src/ui/components/AboutBox.d.ts +19 -0
  708. package/dist/src/ui/components/AboutBox.js +10 -0
  709. package/dist/src/ui/components/AboutBox.js.map +1 -0
  710. package/dist/src/ui/components/AboutBox.test.d.ts +6 -0
  711. package/dist/src/ui/components/AboutBox.test.js +59 -0
  712. package/dist/src/ui/components/AboutBox.test.js.map +1 -0
  713. package/dist/src/ui/components/AdminSettingsChangedDialog.d.ts +6 -0
  714. package/dist/src/ui/components/AdminSettingsChangedDialog.js +22 -0
  715. package/dist/src/ui/components/AdminSettingsChangedDialog.js.map +1 -0
  716. package/dist/src/ui/components/AdminSettingsChangedDialog.test.d.ts +6 -0
  717. package/dist/src/ui/components/AdminSettingsChangedDialog.test.js +43 -0
  718. package/dist/src/ui/components/AdminSettingsChangedDialog.test.js.map +1 -0
  719. package/dist/src/ui/components/AgentConfigDialog.d.ts +18 -0
  720. package/dist/src/ui/components/AgentConfigDialog.js +296 -0
  721. package/dist/src/ui/components/AgentConfigDialog.js.map +1 -0
  722. package/dist/src/ui/components/AgentConfigDialog.test.d.ts +6 -0
  723. package/dist/src/ui/components/AgentConfigDialog.test.js +241 -0
  724. package/dist/src/ui/components/AgentConfigDialog.test.js.map +1 -0
  725. package/dist/src/ui/components/AlternateBufferQuittingDisplay.d.ts +6 -0
  726. package/dist/src/ui/components/AlternateBufferQuittingDisplay.js +31 -0
  727. package/dist/src/ui/components/AlternateBufferQuittingDisplay.js.map +1 -0
  728. package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.d.ts +6 -0
  729. package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js +190 -0
  730. package/dist/src/ui/components/AlternateBufferQuittingDisplay.test.js.map +1 -0
  731. package/dist/src/ui/components/AnsiOutput.d.ts +14 -0
  732. package/dist/src/ui/components/AnsiOutput.js +12 -0
  733. package/dist/src/ui/components/AnsiOutput.js.map +1 -0
  734. package/dist/src/ui/components/AnsiOutput.test.d.ts +6 -0
  735. package/dist/src/ui/components/AnsiOutput.test.js +92 -0
  736. package/dist/src/ui/components/AnsiOutput.test.js.map +1 -0
  737. package/dist/src/ui/components/AppHeader.d.ts +10 -0
  738. package/dist/src/ui/components/AppHeader.js +25 -0
  739. package/dist/src/ui/components/AppHeader.js.map +1 -0
  740. package/dist/src/ui/components/AppHeader.test.d.ts +6 -0
  741. package/dist/src/ui/components/AppHeader.test.js +225 -0
  742. package/dist/src/ui/components/AppHeader.test.js.map +1 -0
  743. package/dist/src/ui/components/ApprovalModeIndicator.d.ts +12 -0
  744. package/dist/src/ui/components/ApprovalModeIndicator.js +31 -0
  745. package/dist/src/ui/components/ApprovalModeIndicator.js.map +1 -0
  746. package/dist/src/ui/components/ApprovalModeIndicator.test.d.ts +6 -0
  747. package/dist/src/ui/components/ApprovalModeIndicator.test.js +37 -0
  748. package/dist/src/ui/components/ApprovalModeIndicator.test.js.map +1 -0
  749. package/dist/src/ui/components/AsciiArt.d.ts +11 -0
  750. package/dist/src/ui/components/AsciiArt.js +31 -0
  751. package/dist/src/ui/components/AsciiArt.js.map +1 -0
  752. package/dist/src/ui/components/AskUserDialog.d.ts +39 -0
  753. package/dist/src/ui/components/AskUserDialog.js +618 -0
  754. package/dist/src/ui/components/AskUserDialog.js.map +1 -0
  755. package/dist/src/ui/components/AskUserDialog.test.d.ts +6 -0
  756. package/dist/src/ui/components/AskUserDialog.test.js +598 -0
  757. package/dist/src/ui/components/AskUserDialog.test.js.map +1 -0
  758. package/dist/src/ui/components/Banner.d.ts +14 -0
  759. package/dist/src/ui/components/Banner.js +28 -0
  760. package/dist/src/ui/components/Banner.js.map +1 -0
  761. package/dist/src/ui/components/Banner.test.d.ts +6 -0
  762. package/dist/src/ui/components/Banner.test.js +24 -0
  763. package/dist/src/ui/components/Banner.test.js.map +1 -0
  764. package/dist/src/ui/components/CliSpinner.d.ts +9 -0
  765. package/dist/src/ui/components/CliSpinner.js +28 -0
  766. package/dist/src/ui/components/CliSpinner.js.map +1 -0
  767. package/dist/src/ui/components/CliSpinner.test.d.ts +6 -0
  768. package/dist/src/ui/components/CliSpinner.test.js +28 -0
  769. package/dist/src/ui/components/CliSpinner.test.js.map +1 -0
  770. package/dist/src/ui/components/Composer.d.ts +8 -0
  771. package/dist/src/ui/components/Composer.js +60 -0
  772. package/dist/src/ui/components/Composer.js.map +1 -0
  773. package/dist/src/ui/components/Composer.test.d.ts +6 -0
  774. package/dist/src/ui/components/Composer.test.js +383 -0
  775. package/dist/src/ui/components/Composer.test.js.map +1 -0
  776. package/dist/src/ui/components/ConfigInitDisplay.d.ts +8 -0
  777. package/dist/src/ui/components/ConfigInitDisplay.js +54 -0
  778. package/dist/src/ui/components/ConfigInitDisplay.js.map +1 -0
  779. package/dist/src/ui/components/ConfigInitDisplay.test.d.ts +6 -0
  780. package/dist/src/ui/components/ConfigInitDisplay.test.js +117 -0
  781. package/dist/src/ui/components/ConfigInitDisplay.test.js.map +1 -0
  782. package/dist/src/ui/components/ConsentPrompt.d.ts +13 -0
  783. package/dist/src/ui/components/ConsentPrompt.js +19 -0
  784. package/dist/src/ui/components/ConsentPrompt.js.map +1 -0
  785. package/dist/src/ui/components/ConsentPrompt.test.d.ts +6 -0
  786. package/dist/src/ui/components/ConsentPrompt.test.js +77 -0
  787. package/dist/src/ui/components/ConsentPrompt.test.js.map +1 -0
  788. package/dist/src/ui/components/ConsoleSummaryDisplay.d.ts +11 -0
  789. package/dist/src/ui/components/ConsoleSummaryDisplay.js +11 -0
  790. package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +1 -0
  791. package/dist/src/ui/components/ConsoleSummaryDisplay.test.d.ts +6 -0
  792. package/dist/src/ui/components/ConsoleSummaryDisplay.test.js +26 -0
  793. package/dist/src/ui/components/ConsoleSummaryDisplay.test.js.map +1 -0
  794. package/dist/src/ui/components/ContextSummaryDisplay.d.ts +20 -0
  795. package/dist/src/ui/components/ContextSummaryDisplay.js +63 -0
  796. package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -0
  797. package/dist/src/ui/components/ContextSummaryDisplay.test.d.ts +6 -0
  798. package/dist/src/ui/components/ContextSummaryDisplay.test.js +102 -0
  799. package/dist/src/ui/components/ContextSummaryDisplay.test.js.map +1 -0
  800. package/dist/src/ui/components/ContextUsageDisplay.d.ts +10 -0
  801. package/dist/src/ui/components/ContextUsageDisplay.js +16 -0
  802. package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -0
  803. package/dist/src/ui/components/ContextUsageDisplay.test.d.ts +6 -0
  804. package/dist/src/ui/components/ContextUsageDisplay.test.js +43 -0
  805. package/dist/src/ui/components/ContextUsageDisplay.test.js.map +1 -0
  806. package/dist/src/ui/components/CopyModeWarning.d.ts +7 -0
  807. package/dist/src/ui/components/CopyModeWarning.js +12 -0
  808. package/dist/src/ui/components/CopyModeWarning.js.map +1 -0
  809. package/dist/src/ui/components/CopyModeWarning.test.d.ts +6 -0
  810. package/dist/src/ui/components/CopyModeWarning.test.js +33 -0
  811. package/dist/src/ui/components/CopyModeWarning.test.js.map +1 -0
  812. package/dist/src/ui/components/DebugProfiler.d.ts +25 -0
  813. package/dist/src/ui/components/DebugProfiler.js +177 -0
  814. package/dist/src/ui/components/DebugProfiler.js.map +1 -0
  815. package/dist/src/ui/components/DebugProfiler.test.d.ts +6 -0
  816. package/dist/src/ui/components/DebugProfiler.test.js +229 -0
  817. package/dist/src/ui/components/DebugProfiler.test.js.map +1 -0
  818. package/dist/src/ui/components/DetailedMessagesDisplay.d.ts +15 -0
  819. package/dist/src/ui/components/DetailedMessagesDisplay.js +54 -0
  820. package/dist/src/ui/components/DetailedMessagesDisplay.js.map +1 -0
  821. package/dist/src/ui/components/DetailedMessagesDisplay.test.d.ts +6 -0
  822. package/dist/src/ui/components/DetailedMessagesDisplay.test.js +39 -0
  823. package/dist/src/ui/components/DetailedMessagesDisplay.test.js.map +1 -0
  824. package/dist/src/ui/components/DialogManager.d.ts +12 -0
  825. package/dist/src/ui/components/DialogManager.js +124 -0
  826. package/dist/src/ui/components/DialogManager.js.map +1 -0
  827. package/dist/src/ui/components/DialogManager.test.d.ts +6 -0
  828. package/dist/src/ui/components/DialogManager.test.js +177 -0
  829. package/dist/src/ui/components/DialogManager.test.js.map +1 -0
  830. package/dist/src/ui/components/EditorSettingsDialog.d.ts +15 -0
  831. package/dist/src/ui/components/EditorSettingsDialog.js +81 -0
  832. package/dist/src/ui/components/EditorSettingsDialog.js.map +1 -0
  833. package/dist/src/ui/components/EditorSettingsDialog.test.d.ts +6 -0
  834. package/dist/src/ui/components/EditorSettingsDialog.test.js +119 -0
  835. package/dist/src/ui/components/EditorSettingsDialog.test.js.map +1 -0
  836. package/dist/src/ui/components/ExitWarning.d.ts +7 -0
  837. package/dist/src/ui/components/ExitWarning.js +9 -0
  838. package/dist/src/ui/components/ExitWarning.js.map +1 -0
  839. package/dist/src/ui/components/ExitWarning.test.d.ts +6 -0
  840. package/dist/src/ui/components/ExitWarning.test.js +54 -0
  841. package/dist/src/ui/components/ExitWarning.test.js.map +1 -0
  842. package/dist/src/ui/components/FolderTrustDialog.d.ts +17 -0
  843. package/dist/src/ui/components/FolderTrustDialog.js +71 -0
  844. package/dist/src/ui/components/FolderTrustDialog.js.map +1 -0
  845. package/dist/src/ui/components/FolderTrustDialog.test.d.ts +6 -0
  846. package/dist/src/ui/components/FolderTrustDialog.test.js +102 -0
  847. package/dist/src/ui/components/FolderTrustDialog.test.js.map +1 -0
  848. package/dist/src/ui/components/Footer.d.ts +7 -0
  849. package/dist/src/ui/components/Footer.js +49 -0
  850. package/dist/src/ui/components/Footer.js.map +1 -0
  851. package/dist/src/ui/components/Footer.test.d.ts +6 -0
  852. package/dist/src/ui/components/Footer.test.js +321 -0
  853. package/dist/src/ui/components/Footer.test.js.map +1 -0
  854. package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +22 -0
  855. package/dist/src/ui/components/GeminiRespondingSpinner.js +23 -0
  856. package/dist/src/ui/components/GeminiRespondingSpinner.js.map +1 -0
  857. package/dist/src/ui/components/GeminiRespondingSpinner.test.d.ts +6 -0
  858. package/dist/src/ui/components/GeminiRespondingSpinner.test.js +61 -0
  859. package/dist/src/ui/components/GeminiRespondingSpinner.test.js.map +1 -0
  860. package/dist/src/ui/components/GradientRegression.test.d.ts +6 -0
  861. package/dist/src/ui/components/GradientRegression.test.js +105 -0
  862. package/dist/src/ui/components/GradientRegression.test.js.map +1 -0
  863. package/dist/src/ui/components/Header.d.ts +13 -0
  864. package/dist/src/ui/components/Header.js +31 -0
  865. package/dist/src/ui/components/Header.js.map +1 -0
  866. package/dist/src/ui/components/Header.test.d.ts +6 -0
  867. package/dist/src/ui/components/Header.test.js +147 -0
  868. package/dist/src/ui/components/Header.test.js.map +1 -0
  869. package/dist/src/ui/components/Help.d.ts +12 -0
  870. package/dist/src/ui/components/Help.js +17 -0
  871. package/dist/src/ui/components/Help.js.map +1 -0
  872. package/dist/src/ui/components/Help.test.d.ts +6 -0
  873. package/dist/src/ui/components/Help.test.js +67 -0
  874. package/dist/src/ui/components/Help.test.js.map +1 -0
  875. package/dist/src/ui/components/HistoryItemDisplay.d.ts +21 -0
  876. package/dist/src/ui/components/HistoryItemDisplay.js +33 -0
  877. package/dist/src/ui/components/HistoryItemDisplay.js.map +1 -0
  878. package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +6 -0
  879. package/dist/src/ui/components/HistoryItemDisplay.test.js +207 -0
  880. package/dist/src/ui/components/HistoryItemDisplay.test.js.map +1 -0
  881. package/dist/src/ui/components/HookStatusDisplay.d.ts +12 -0
  882. package/dist/src/ui/components/HookStatusDisplay.js +20 -0
  883. package/dist/src/ui/components/HookStatusDisplay.js.map +1 -0
  884. package/dist/src/ui/components/HookStatusDisplay.test.d.ts +6 -0
  885. package/dist/src/ui/components/HookStatusDisplay.test.js +51 -0
  886. package/dist/src/ui/components/HookStatusDisplay.test.js.map +1 -0
  887. package/dist/src/ui/components/IdeTrustChangeDialog.d.ts +11 -0
  888. package/dist/src/ui/components/IdeTrustChangeDialog.js +34 -0
  889. package/dist/src/ui/components/IdeTrustChangeDialog.js.map +1 -0
  890. package/dist/src/ui/components/IdeTrustChangeDialog.test.d.ts +6 -0
  891. package/dist/src/ui/components/IdeTrustChangeDialog.test.js +58 -0
  892. package/dist/src/ui/components/IdeTrustChangeDialog.test.js.map +1 -0
  893. package/dist/src/ui/components/InputPrompt.d.ts +50 -0
  894. package/dist/src/ui/components/InputPrompt.js +926 -0
  895. package/dist/src/ui/components/InputPrompt.js.map +1 -0
  896. package/dist/src/ui/components/InputPrompt.test.d.ts +6 -0
  897. package/dist/src/ui/components/InputPrompt.test.js +2596 -0
  898. package/dist/src/ui/components/InputPrompt.test.js.map +1 -0
  899. package/dist/src/ui/components/LoadingIndicator.d.ts +15 -0
  900. package/dist/src/ui/components/LoadingIndicator.js +30 -0
  901. package/dist/src/ui/components/LoadingIndicator.js.map +1 -0
  902. package/dist/src/ui/components/LoadingIndicator.test.d.ts +6 -0
  903. package/dist/src/ui/components/LoadingIndicator.test.js +207 -0
  904. package/dist/src/ui/components/LoadingIndicator.test.js.map +1 -0
  905. package/dist/src/ui/components/LogoutConfirmationDialog.d.ts +15 -0
  906. package/dist/src/ui/components/LogoutConfirmationDialog.js +37 -0
  907. package/dist/src/ui/components/LogoutConfirmationDialog.js.map +1 -0
  908. package/dist/src/ui/components/LogoutConfirmationDialog.test.d.ts +6 -0
  909. package/dist/src/ui/components/LogoutConfirmationDialog.test.js +59 -0
  910. package/dist/src/ui/components/LogoutConfirmationDialog.test.js.map +1 -0
  911. package/dist/src/ui/components/LoopDetectionConfirmation.d.ts +13 -0
  912. package/dist/src/ui/components/LoopDetectionConfirmation.js +37 -0
  913. package/dist/src/ui/components/LoopDetectionConfirmation.js.map +1 -0
  914. package/dist/src/ui/components/LoopDetectionConfirmation.test.d.ts +6 -0
  915. package/dist/src/ui/components/LoopDetectionConfirmation.test.js +25 -0
  916. package/dist/src/ui/components/LoopDetectionConfirmation.test.js.map +1 -0
  917. package/dist/src/ui/components/MainContent.d.ts +6 -0
  918. package/dist/src/ui/components/MainContent.js +78 -0
  919. package/dist/src/ui/components/MainContent.js.map +1 -0
  920. package/dist/src/ui/components/MainContent.test.d.ts +6 -0
  921. package/dist/src/ui/components/MainContent.test.js +83 -0
  922. package/dist/src/ui/components/MainContent.test.js.map +1 -0
  923. package/dist/src/ui/components/MemoryUsageDisplay.d.ts +7 -0
  924. package/dist/src/ui/components/MemoryUsageDisplay.js +24 -0
  925. package/dist/src/ui/components/MemoryUsageDisplay.js.map +1 -0
  926. package/dist/src/ui/components/MemoryUsageDisplay.test.d.ts +6 -0
  927. package/dist/src/ui/components/MemoryUsageDisplay.test.js +49 -0
  928. package/dist/src/ui/components/MemoryUsageDisplay.test.js.map +1 -0
  929. package/dist/src/ui/components/ModelDialog.d.ts +11 -0
  930. package/dist/src/ui/components/ModelDialog.js +147 -0
  931. package/dist/src/ui/components/ModelDialog.js.map +1 -0
  932. package/dist/src/ui/components/ModelDialog.test.d.ts +6 -0
  933. package/dist/src/ui/components/ModelDialog.test.js +197 -0
  934. package/dist/src/ui/components/ModelDialog.test.js.map +1 -0
  935. package/dist/src/ui/components/ModelStatsDisplay.d.ts +7 -0
  936. package/dist/src/ui/components/ModelStatsDisplay.js +87 -0
  937. package/dist/src/ui/components/ModelStatsDisplay.js.map +1 -0
  938. package/dist/src/ui/components/ModelStatsDisplay.test.d.ts +6 -0
  939. package/dist/src/ui/components/ModelStatsDisplay.test.js +343 -0
  940. package/dist/src/ui/components/ModelStatsDisplay.test.js.map +1 -0
  941. package/dist/src/ui/components/MultiFolderTrustDialog.d.ts +23 -0
  942. package/dist/src/ui/components/MultiFolderTrustDialog.js +92 -0
  943. package/dist/src/ui/components/MultiFolderTrustDialog.js.map +1 -0
  944. package/dist/src/ui/components/MultiFolderTrustDialog.test.d.ts +6 -0
  945. package/dist/src/ui/components/MultiFolderTrustDialog.test.js +162 -0
  946. package/dist/src/ui/components/MultiFolderTrustDialog.test.js.map +1 -0
  947. package/dist/src/ui/components/NewAgentsNotification.d.ts +16 -0
  948. package/dist/src/ui/components/NewAgentsNotification.js +35 -0
  949. package/dist/src/ui/components/NewAgentsNotification.js.map +1 -0
  950. package/dist/src/ui/components/NewAgentsNotification.test.d.ts +6 -0
  951. package/dist/src/ui/components/NewAgentsNotification.test.js +48 -0
  952. package/dist/src/ui/components/NewAgentsNotification.test.js.map +1 -0
  953. package/dist/src/ui/components/Notifications.d.ts +6 -0
  954. package/dist/src/ui/components/Notifications.js +61 -0
  955. package/dist/src/ui/components/Notifications.js.map +1 -0
  956. package/dist/src/ui/components/Notifications.test.d.ts +6 -0
  957. package/dist/src/ui/components/Notifications.test.js +164 -0
  958. package/dist/src/ui/components/Notifications.test.js.map +1 -0
  959. package/dist/src/ui/components/PermissionsModifyTrustDialog.d.ts +16 -0
  960. package/dist/src/ui/components/PermissionsModifyTrustDialog.js +58 -0
  961. package/dist/src/ui/components/PermissionsModifyTrustDialog.js.map +1 -0
  962. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.d.ts +6 -0
  963. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js +162 -0
  964. package/dist/src/ui/components/PermissionsModifyTrustDialog.test.js.map +1 -0
  965. package/dist/src/ui/components/ProQuotaDialog.d.ts +16 -0
  966. package/dist/src/ui/components/ProQuotaDialog.js +77 -0
  967. package/dist/src/ui/components/ProQuotaDialog.js.map +1 -0
  968. package/dist/src/ui/components/ProQuotaDialog.test.d.ts +6 -0
  969. package/dist/src/ui/components/ProQuotaDialog.test.js +191 -0
  970. package/dist/src/ui/components/ProQuotaDialog.test.js.map +1 -0
  971. package/dist/src/ui/components/QueuedMessageDisplay.d.ts +9 -0
  972. package/dist/src/ui/components/QueuedMessageDisplay.js +20 -0
  973. package/dist/src/ui/components/QueuedMessageDisplay.js.map +1 -0
  974. package/dist/src/ui/components/QueuedMessageDisplay.test.d.ts +6 -0
  975. package/dist/src/ui/components/QueuedMessageDisplay.test.js +65 -0
  976. package/dist/src/ui/components/QueuedMessageDisplay.test.js.map +1 -0
  977. package/dist/src/ui/components/QuittingDisplay.d.ts +6 -0
  978. package/dist/src/ui/components/QuittingDisplay.js +20 -0
  979. package/dist/src/ui/components/QuittingDisplay.js.map +1 -0
  980. package/dist/src/ui/components/QuittingDisplay.test.d.ts +6 -0
  981. package/dist/src/ui/components/QuittingDisplay.test.js +49 -0
  982. package/dist/src/ui/components/QuittingDisplay.test.js.map +1 -0
  983. package/dist/src/ui/components/RawMarkdownIndicator.d.ts +7 -0
  984. package/dist/src/ui/components/RawMarkdownIndicator.js +8 -0
  985. package/dist/src/ui/components/RawMarkdownIndicator.js.map +1 -0
  986. package/dist/src/ui/components/RawMarkdownIndicator.test.d.ts +6 -0
  987. package/dist/src/ui/components/RawMarkdownIndicator.test.js +34 -0
  988. package/dist/src/ui/components/RawMarkdownIndicator.test.js.map +1 -0
  989. package/dist/src/ui/components/RewindConfirmation.d.ts +21 -0
  990. package/dist/src/ui/components/RewindConfirmation.js +63 -0
  991. package/dist/src/ui/components/RewindConfirmation.js.map +1 -0
  992. package/dist/src/ui/components/RewindConfirmation.test.d.ts +6 -0
  993. package/dist/src/ui/components/RewindConfirmation.test.js +53 -0
  994. package/dist/src/ui/components/RewindConfirmation.test.js.map +1 -0
  995. package/dist/src/ui/components/RewindViewer.d.ts +15 -0
  996. package/dist/src/ui/components/RewindViewer.js +127 -0
  997. package/dist/src/ui/components/RewindViewer.js.map +1 -0
  998. package/dist/src/ui/components/RewindViewer.test.d.ts +6 -0
  999. package/dist/src/ui/components/RewindViewer.test.js +241 -0
  1000. package/dist/src/ui/components/RewindViewer.test.js.map +1 -0
  1001. package/dist/src/ui/components/SessionBrowser.d.ts +98 -0
  1002. package/dist/src/ui/components/SessionBrowser.js +460 -0
  1003. package/dist/src/ui/components/SessionBrowser.js.map +1 -0
  1004. package/dist/src/ui/components/SessionBrowser.test.d.ts +6 -0
  1005. package/dist/src/ui/components/SessionBrowser.test.js +256 -0
  1006. package/dist/src/ui/components/SessionBrowser.test.js.map +1 -0
  1007. package/dist/src/ui/components/SessionSummaryDisplay.d.ts +11 -0
  1008. package/dist/src/ui/components/SessionSummaryDisplay.js +4 -0
  1009. package/dist/src/ui/components/SessionSummaryDisplay.js.map +1 -0
  1010. package/dist/src/ui/components/SessionSummaryDisplay.test.d.ts +6 -0
  1011. package/dist/src/ui/components/SessionSummaryDisplay.test.js +75 -0
  1012. package/dist/src/ui/components/SessionSummaryDisplay.test.js.map +1 -0
  1013. package/dist/src/ui/components/SettingsDialog.d.ts +18 -0
  1014. package/dist/src/ui/components/SettingsDialog.js +474 -0
  1015. package/dist/src/ui/components/SettingsDialog.js.map +1 -0
  1016. package/dist/src/ui/components/SettingsDialog.test.d.ts +6 -0
  1017. package/dist/src/ui/components/SettingsDialog.test.js +1150 -0
  1018. package/dist/src/ui/components/SettingsDialog.test.js.map +1 -0
  1019. package/dist/src/ui/components/ShellInputPrompt.d.ts +11 -0
  1020. package/dist/src/ui/components/ShellInputPrompt.js +36 -0
  1021. package/dist/src/ui/components/ShellInputPrompt.js.map +1 -0
  1022. package/dist/src/ui/components/ShellInputPrompt.test.d.ts +6 -0
  1023. package/dist/src/ui/components/ShellInputPrompt.test.js +91 -0
  1024. package/dist/src/ui/components/ShellInputPrompt.test.js.map +1 -0
  1025. package/dist/src/ui/components/ShellModeIndicator.d.ts +7 -0
  1026. package/dist/src/ui/components/ShellModeIndicator.js +5 -0
  1027. package/dist/src/ui/components/ShellModeIndicator.js.map +1 -0
  1028. package/dist/src/ui/components/ShellModeIndicator.test.d.ts +6 -0
  1029. package/dist/src/ui/components/ShellModeIndicator.test.js +17 -0
  1030. package/dist/src/ui/components/ShellModeIndicator.test.js.map +1 -0
  1031. package/dist/src/ui/components/ShowMoreLines.d.ts +10 -0
  1032. package/dist/src/ui/components/ShowMoreLines.js +24 -0
  1033. package/dist/src/ui/components/ShowMoreLines.js.map +1 -0
  1034. package/dist/src/ui/components/ShowMoreLines.test.d.ts +6 -0
  1035. package/dist/src/ui/components/ShowMoreLines.test.js +40 -0
  1036. package/dist/src/ui/components/ShowMoreLines.test.js.map +1 -0
  1037. package/dist/src/ui/components/StatsDisplay.d.ts +14 -0
  1038. package/dist/src/ui/components/StatsDisplay.js +119 -0
  1039. package/dist/src/ui/components/StatsDisplay.js.map +1 -0
  1040. package/dist/src/ui/components/StatsDisplay.test.d.ts +6 -0
  1041. package/dist/src/ui/components/StatsDisplay.test.js +438 -0
  1042. package/dist/src/ui/components/StatsDisplay.test.js.map +1 -0
  1043. package/dist/src/ui/components/StatusDisplay.d.ts +11 -0
  1044. package/dist/src/ui/components/StatusDisplay.js +45 -0
  1045. package/dist/src/ui/components/StatusDisplay.js.map +1 -0
  1046. package/dist/src/ui/components/StatusDisplay.test.d.ts +6 -0
  1047. package/dist/src/ui/components/StatusDisplay.test.js +155 -0
  1048. package/dist/src/ui/components/StatusDisplay.test.js.map +1 -0
  1049. package/dist/src/ui/components/StickyHeader.d.ts +16 -0
  1050. package/dist/src/ui/components/StickyHeader.js +5 -0
  1051. package/dist/src/ui/components/StickyHeader.js.map +1 -0
  1052. package/dist/src/ui/components/StickyHeader.test.d.ts +6 -0
  1053. package/dist/src/ui/components/StickyHeader.test.js +17 -0
  1054. package/dist/src/ui/components/StickyHeader.test.js.map +1 -0
  1055. package/dist/src/ui/components/SuggestionsDisplay.d.ts +27 -0
  1056. package/dist/src/ui/components/SuggestionsDisplay.js +46 -0
  1057. package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -0
  1058. package/dist/src/ui/components/SuggestionsDisplay.test.d.ts +6 -0
  1059. package/dist/src/ui/components/SuggestionsDisplay.test.js +56 -0
  1060. package/dist/src/ui/components/SuggestionsDisplay.test.js.map +1 -0
  1061. package/dist/src/ui/components/Table.d.ts +21 -0
  1062. package/dist/src/ui/components/Table.js +7 -0
  1063. package/dist/src/ui/components/Table.js.map +1 -0
  1064. package/dist/src/ui/components/Table.test.d.ts +6 -0
  1065. package/dist/src/ui/components/Table.test.js +53 -0
  1066. package/dist/src/ui/components/Table.test.js.map +1 -0
  1067. package/dist/src/ui/components/ThemeDialog.d.ts +21 -0
  1068. package/dist/src/ui/components/ThemeDialog.js +181 -0
  1069. package/dist/src/ui/components/ThemeDialog.js.map +1 -0
  1070. package/dist/src/ui/components/ThemeDialog.test.d.ts +6 -0
  1071. package/dist/src/ui/components/ThemeDialog.test.js +167 -0
  1072. package/dist/src/ui/components/ThemeDialog.test.js.map +1 -0
  1073. package/dist/src/ui/components/ThemedGradient.d.ts +8 -0
  1074. package/dist/src/ui/components/ThemedGradient.js +16 -0
  1075. package/dist/src/ui/components/ThemedGradient.js.map +1 -0
  1076. package/dist/src/ui/components/ThemedGradient.test.d.ts +6 -0
  1077. package/dist/src/ui/components/ThemedGradient.test.js +30 -0
  1078. package/dist/src/ui/components/ThemedGradient.test.js.map +1 -0
  1079. package/dist/src/ui/components/Tips.d.ts +12 -0
  1080. package/dist/src/ui/components/Tips.js +9 -0
  1081. package/dist/src/ui/components/Tips.js.map +1 -0
  1082. package/dist/src/ui/components/Tips.test.d.ts +6 -0
  1083. package/dist/src/ui/components/Tips.test.js +23 -0
  1084. package/dist/src/ui/components/Tips.test.js.map +1 -0
  1085. package/dist/src/ui/components/ToolConfirmationQueue.d.ts +12 -0
  1086. package/dist/src/ui/components/ToolConfirmationQueue.js +30 -0
  1087. package/dist/src/ui/components/ToolConfirmationQueue.js.map +1 -0
  1088. package/dist/src/ui/components/ToolConfirmationQueue.test.d.ts +6 -0
  1089. package/dist/src/ui/components/ToolConfirmationQueue.test.js +71 -0
  1090. package/dist/src/ui/components/ToolConfirmationQueue.test.js.map +1 -0
  1091. package/dist/src/ui/components/ToolStatsDisplay.d.ts +7 -0
  1092. package/dist/src/ui/components/ToolStatsDisplay.js +41 -0
  1093. package/dist/src/ui/components/ToolStatsDisplay.js.map +1 -0
  1094. package/dist/src/ui/components/ToolStatsDisplay.test.d.ts +6 -0
  1095. package/dist/src/ui/components/ToolStatsDisplay.test.js +227 -0
  1096. package/dist/src/ui/components/ToolStatsDisplay.test.js.map +1 -0
  1097. package/dist/src/ui/components/UpdateNotification.d.ts +10 -0
  1098. package/dist/src/ui/components/UpdateNotification.js +10 -0
  1099. package/dist/src/ui/components/UpdateNotification.js.map +1 -0
  1100. package/dist/src/ui/components/UpdateNotification.test.d.ts +6 -0
  1101. package/dist/src/ui/components/UpdateNotification.test.js +16 -0
  1102. package/dist/src/ui/components/UpdateNotification.test.js.map +1 -0
  1103. package/dist/src/ui/components/ValidationDialog.d.ts +15 -0
  1104. package/dist/src/ui/components/ValidationDialog.js +86 -0
  1105. package/dist/src/ui/components/ValidationDialog.js.map +1 -0
  1106. package/dist/src/ui/components/ValidationDialog.test.d.ts +6 -0
  1107. package/dist/src/ui/components/ValidationDialog.test.js +153 -0
  1108. package/dist/src/ui/components/ValidationDialog.test.js.map +1 -0
  1109. package/dist/src/ui/components/messages/CompressionMessage.d.ts +10 -0
  1110. package/dist/src/ui/components/messages/CompressionMessage.js +48 -0
  1111. package/dist/src/ui/components/messages/CompressionMessage.js.map +1 -0
  1112. package/dist/src/ui/components/messages/CompressionMessage.test.d.ts +6 -0
  1113. package/dist/src/ui/components/messages/CompressionMessage.test.js +191 -0
  1114. package/dist/src/ui/components/messages/CompressionMessage.test.js.map +1 -0
  1115. package/dist/src/ui/components/messages/DiffRenderer.d.ts +17 -0
  1116. package/dist/src/ui/components/messages/DiffRenderer.js +250 -0
  1117. package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -0
  1118. package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +6 -0
  1119. package/dist/src/ui/components/messages/DiffRenderer.test.js +240 -0
  1120. package/dist/src/ui/components/messages/DiffRenderer.test.js.map +1 -0
  1121. package/dist/src/ui/components/messages/ErrorMessage.d.ts +11 -0
  1122. package/dist/src/ui/components/messages/ErrorMessage.js +9 -0
  1123. package/dist/src/ui/components/messages/ErrorMessage.js.map +1 -0
  1124. package/dist/src/ui/components/messages/ErrorMessage.test.d.ts +6 -0
  1125. package/dist/src/ui/components/messages/ErrorMessage.test.js +23 -0
  1126. package/dist/src/ui/components/messages/ErrorMessage.test.js.map +1 -0
  1127. package/dist/src/ui/components/messages/GeminiMessage.d.ts +14 -0
  1128. package/dist/src/ui/components/messages/GeminiMessage.js +15 -0
  1129. package/dist/src/ui/components/messages/GeminiMessage.js.map +1 -0
  1130. package/dist/src/ui/components/messages/GeminiMessage.test.d.ts +6 -0
  1131. package/dist/src/ui/components/messages/GeminiMessage.test.js +35 -0
  1132. package/dist/src/ui/components/messages/GeminiMessage.test.js.map +1 -0
  1133. package/dist/src/ui/components/messages/GeminiMessageContent.d.ts +14 -0
  1134. package/dist/src/ui/components/messages/GeminiMessageContent.js +19 -0
  1135. package/dist/src/ui/components/messages/GeminiMessageContent.js.map +1 -0
  1136. package/dist/src/ui/components/messages/InfoMessage.d.ts +13 -0
  1137. package/dist/src/ui/components/messages/InfoMessage.js +11 -0
  1138. package/dist/src/ui/components/messages/InfoMessage.js.map +1 -0
  1139. package/dist/src/ui/components/messages/InfoMessage.test.d.ts +6 -0
  1140. package/dist/src/ui/components/messages/InfoMessage.test.js +28 -0
  1141. package/dist/src/ui/components/messages/InfoMessage.test.js.map +1 -0
  1142. package/dist/src/ui/components/messages/ModelMessage.d.ts +11 -0
  1143. package/dist/src/ui/components/messages/ModelMessage.js +5 -0
  1144. package/dist/src/ui/components/messages/ModelMessage.js.map +1 -0
  1145. package/dist/src/ui/components/messages/RedirectionConfirmation.test.d.ts +6 -0
  1146. package/dist/src/ui/components/messages/RedirectionConfirmation.test.js +33 -0
  1147. package/dist/src/ui/components/messages/RedirectionConfirmation.test.js.map +1 -0
  1148. package/dist/src/ui/components/messages/ShellToolMessage.d.ts +14 -0
  1149. package/dist/src/ui/components/messages/ShellToolMessage.js +44 -0
  1150. package/dist/src/ui/components/messages/ShellToolMessage.js.map +1 -0
  1151. package/dist/src/ui/components/messages/ShellToolMessage.test.d.ts +6 -0
  1152. package/dist/src/ui/components/messages/ShellToolMessage.test.js +123 -0
  1153. package/dist/src/ui/components/messages/ShellToolMessage.test.js.map +1 -0
  1154. package/dist/src/ui/components/messages/Todo.d.ts +7 -0
  1155. package/dist/src/ui/components/messages/Todo.js +91 -0
  1156. package/dist/src/ui/components/messages/Todo.js.map +1 -0
  1157. package/dist/src/ui/components/messages/Todo.test.d.ts +6 -0
  1158. package/dist/src/ui/components/messages/Todo.test.js +114 -0
  1159. package/dist/src/ui/components/messages/Todo.test.js.map +1 -0
  1160. package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +16 -0
  1161. package/dist/src/ui/components/messages/ToolConfirmationMessage.js +266 -0
  1162. package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -0
  1163. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +6 -0
  1164. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +232 -0
  1165. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +1 -0
  1166. package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +19 -0
  1167. package/dist/src/ui/components/messages/ToolGroupMessage.js +96 -0
  1168. package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -0
  1169. package/dist/src/ui/components/messages/ToolGroupMessage.test.d.ts +6 -0
  1170. package/dist/src/ui/components/messages/ToolGroupMessage.test.js +529 -0
  1171. package/dist/src/ui/components/messages/ToolGroupMessage.test.js.map +1 -0
  1172. package/dist/src/ui/components/messages/ToolMessage.d.ts +24 -0
  1173. package/dist/src/ui/components/messages/ToolMessage.js +18 -0
  1174. package/dist/src/ui/components/messages/ToolMessage.js.map +1 -0
  1175. package/dist/src/ui/components/messages/ToolMessage.test.d.ts +6 -0
  1176. package/dist/src/ui/components/messages/ToolMessage.test.js +217 -0
  1177. package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -0
  1178. package/dist/src/ui/components/messages/ToolMessageFocusHint.test.d.ts +6 -0
  1179. package/dist/src/ui/components/messages/ToolMessageFocusHint.test.js +89 -0
  1180. package/dist/src/ui/components/messages/ToolMessageFocusHint.test.js.map +1 -0
  1181. package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.d.ts +6 -0
  1182. package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.js +62 -0
  1183. package/dist/src/ui/components/messages/ToolMessageRawMarkdown.test.js.map +1 -0
  1184. package/dist/src/ui/components/messages/ToolResultDisplay.d.ts +13 -0
  1185. package/dist/src/ui/components/messages/ToolResultDisplay.js +71 -0
  1186. package/dist/src/ui/components/messages/ToolResultDisplay.js.map +1 -0
  1187. package/dist/src/ui/components/messages/ToolResultDisplay.test.d.ts +6 -0
  1188. package/dist/src/ui/components/messages/ToolResultDisplay.test.js +114 -0
  1189. package/dist/src/ui/components/messages/ToolResultDisplay.test.js.map +1 -0
  1190. package/dist/src/ui/components/messages/ToolShared.d.ts +49 -0
  1191. package/dist/src/ui/components/messages/ToolShared.js +93 -0
  1192. package/dist/src/ui/components/messages/ToolShared.js.map +1 -0
  1193. package/dist/src/ui/components/messages/ToolStickyHeaderRegression.test.d.ts +6 -0
  1194. package/dist/src/ui/components/messages/ToolStickyHeaderRegression.test.js +134 -0
  1195. package/dist/src/ui/components/messages/ToolStickyHeaderRegression.test.js.map +1 -0
  1196. package/dist/src/ui/components/messages/UserMessage.d.ts +12 -0
  1197. package/dist/src/ui/components/messages/UserMessage.js +18 -0
  1198. package/dist/src/ui/components/messages/UserMessage.js.map +1 -0
  1199. package/dist/src/ui/components/messages/UserMessage.test.d.ts +6 -0
  1200. package/dist/src/ui/components/messages/UserMessage.test.js +32 -0
  1201. package/dist/src/ui/components/messages/UserMessage.test.js.map +1 -0
  1202. package/dist/src/ui/components/messages/UserShellMessage.d.ts +12 -0
  1203. package/dist/src/ui/components/messages/UserShellMessage.js +14 -0
  1204. package/dist/src/ui/components/messages/UserShellMessage.js.map +1 -0
  1205. package/dist/src/ui/components/messages/WarningMessage.d.ts +11 -0
  1206. package/dist/src/ui/components/messages/WarningMessage.js +10 -0
  1207. package/dist/src/ui/components/messages/WarningMessage.js.map +1 -0
  1208. package/dist/src/ui/components/messages/WarningMessage.test.d.ts +6 -0
  1209. package/dist/src/ui/components/messages/WarningMessage.test.js +23 -0
  1210. package/dist/src/ui/components/messages/WarningMessage.test.js.map +1 -0
  1211. package/dist/src/ui/components/shared/BaseSelectionList.d.ts +40 -0
  1212. package/dist/src/ui/components/shared/BaseSelectionList.js +74 -0
  1213. package/dist/src/ui/components/shared/BaseSelectionList.js.map +1 -0
  1214. package/dist/src/ui/components/shared/BaseSelectionList.test.d.ts +6 -0
  1215. package/dist/src/ui/components/shared/BaseSelectionList.test.js +386 -0
  1216. package/dist/src/ui/components/shared/BaseSelectionList.test.js.map +1 -0
  1217. package/dist/src/ui/components/shared/BaseSettingsDialog.d.ts +72 -0
  1218. package/dist/src/ui/components/shared/BaseSettingsDialog.js +293 -0
  1219. package/dist/src/ui/components/shared/BaseSettingsDialog.js.map +1 -0
  1220. package/dist/src/ui/components/shared/BaseSettingsDialog.test.d.ts +6 -0
  1221. package/dist/src/ui/components/shared/BaseSettingsDialog.test.js +434 -0
  1222. package/dist/src/ui/components/shared/BaseSettingsDialog.test.js.map +1 -0
  1223. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.d.ts +35 -0
  1224. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js +13 -0
  1225. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.js.map +1 -0
  1226. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.d.ts +6 -0
  1227. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js +79 -0
  1228. package/dist/src/ui/components/shared/DescriptiveRadioButtonSelect.test.js.map +1 -0
  1229. package/dist/src/ui/components/shared/EnumSelector.d.ts +18 -0
  1230. package/dist/src/ui/components/shared/EnumSelector.js +44 -0
  1231. package/dist/src/ui/components/shared/EnumSelector.js.map +1 -0
  1232. package/dist/src/ui/components/shared/EnumSelector.test.d.ts +6 -0
  1233. package/dist/src/ui/components/shared/EnumSelector.test.js +70 -0
  1234. package/dist/src/ui/components/shared/EnumSelector.test.js.map +1 -0
  1235. package/dist/src/ui/components/shared/ExpandableText.d.ts +17 -0
  1236. package/dist/src/ui/components/shared/ExpandableText.js +87 -0
  1237. package/dist/src/ui/components/shared/ExpandableText.js.map +1 -0
  1238. package/dist/src/ui/components/shared/ExpandableText.test.d.ts +6 -0
  1239. package/dist/src/ui/components/shared/ExpandableText.test.js +88 -0
  1240. package/dist/src/ui/components/shared/ExpandableText.test.js.map +1 -0
  1241. package/dist/src/ui/components/shared/HalfLinePaddedBox.d.ts +26 -0
  1242. package/dist/src/ui/components/shared/HalfLinePaddedBox.js +39 -0
  1243. package/dist/src/ui/components/shared/HalfLinePaddedBox.js.map +1 -0
  1244. package/dist/src/ui/components/shared/HalfLinePaddedBox.test.d.ts +6 -0
  1245. package/dist/src/ui/components/shared/HalfLinePaddedBox.test.js +34 -0
  1246. package/dist/src/ui/components/shared/HalfLinePaddedBox.test.js.map +1 -0
  1247. package/dist/src/ui/components/shared/MaxSizedBox.d.ts +25 -0
  1248. package/dist/src/ui/components/shared/MaxSizedBox.js +67 -0
  1249. package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -0
  1250. package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +6 -0
  1251. package/dist/src/ui/components/shared/MaxSizedBox.test.js +90 -0
  1252. package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +1 -0
  1253. package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +48 -0
  1254. package/dist/src/ui/components/shared/RadioButtonSelect.js +22 -0
  1255. package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -0
  1256. package/dist/src/ui/components/shared/RadioButtonSelect.test.d.ts +6 -0
  1257. package/dist/src/ui/components/shared/RadioButtonSelect.test.js +134 -0
  1258. package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +1 -0
  1259. package/dist/src/ui/components/shared/ScopeSelector.d.ts +19 -0
  1260. package/dist/src/ui/components/shared/ScopeSelector.js +14 -0
  1261. package/dist/src/ui/components/shared/ScopeSelector.js.map +1 -0
  1262. package/dist/src/ui/components/shared/Scrollable.d.ts +18 -0
  1263. package/dist/src/ui/components/shared/Scrollable.js +84 -0
  1264. package/dist/src/ui/components/shared/Scrollable.js.map +1 -0
  1265. package/dist/src/ui/components/shared/Scrollable.test.d.ts +6 -0
  1266. package/dist/src/ui/components/shared/Scrollable.test.js +74 -0
  1267. package/dist/src/ui/components/shared/Scrollable.test.js.map +1 -0
  1268. package/dist/src/ui/components/shared/ScrollableList.d.ts +27 -0
  1269. package/dist/src/ui/components/shared/ScrollableList.js +152 -0
  1270. package/dist/src/ui/components/shared/ScrollableList.js.map +1 -0
  1271. package/dist/src/ui/components/shared/ScrollableList.test.d.ts +6 -0
  1272. package/dist/src/ui/components/shared/ScrollableList.test.js +241 -0
  1273. package/dist/src/ui/components/shared/ScrollableList.test.js.map +1 -0
  1274. package/dist/src/ui/components/shared/TabHeader.d.ts +51 -0
  1275. package/dist/src/ui/components/shared/TabHeader.js +42 -0
  1276. package/dist/src/ui/components/shared/TabHeader.js.map +1 -0
  1277. package/dist/src/ui/components/shared/TabHeader.test.d.ts +6 -0
  1278. package/dist/src/ui/components/shared/TabHeader.test.js +106 -0
  1279. package/dist/src/ui/components/shared/TabHeader.test.js.map +1 -0
  1280. package/dist/src/ui/components/shared/TextInput.d.ts +15 -0
  1281. package/dist/src/ui/components/shared/TextInput.js +38 -0
  1282. package/dist/src/ui/components/shared/TextInput.js.map +1 -0
  1283. package/dist/src/ui/components/shared/TextInput.test.d.ts +6 -0
  1284. package/dist/src/ui/components/shared/TextInput.test.js +242 -0
  1285. package/dist/src/ui/components/shared/TextInput.test.js.map +1 -0
  1286. package/dist/src/ui/components/shared/VirtualizedList.d.ts +44 -0
  1287. package/dist/src/ui/components/shared/VirtualizedList.js +312 -0
  1288. package/dist/src/ui/components/shared/VirtualizedList.js.map +1 -0
  1289. package/dist/src/ui/components/shared/VirtualizedList.test.d.ts +6 -0
  1290. package/dist/src/ui/components/shared/VirtualizedList.test.js +171 -0
  1291. package/dist/src/ui/components/shared/VirtualizedList.test.js.map +1 -0
  1292. package/dist/src/ui/components/shared/performance.test.d.ts +1 -0
  1293. package/dist/src/ui/components/shared/performance.test.js +67 -0
  1294. package/dist/src/ui/components/shared/performance.test.js.map +1 -0
  1295. package/dist/src/ui/components/shared/text-buffer.d.ts +597 -0
  1296. package/dist/src/ui/components/shared/text-buffer.js +2292 -0
  1297. package/dist/src/ui/components/shared/text-buffer.js.map +1 -0
  1298. package/dist/src/ui/components/shared/text-buffer.test.d.ts +6 -0
  1299. package/dist/src/ui/components/shared/text-buffer.test.js +2490 -0
  1300. package/dist/src/ui/components/shared/text-buffer.test.js.map +1 -0
  1301. package/dist/src/ui/components/shared/vim-buffer-actions.d.ts +72 -0
  1302. package/dist/src/ui/components/shared/vim-buffer-actions.js +552 -0
  1303. package/dist/src/ui/components/shared/vim-buffer-actions.js.map +1 -0
  1304. package/dist/src/ui/components/shared/vim-buffer-actions.test.d.ts +6 -0
  1305. package/dist/src/ui/components/shared/vim-buffer-actions.test.js +964 -0
  1306. package/dist/src/ui/components/shared/vim-buffer-actions.test.js.map +1 -0
  1307. package/dist/src/ui/components/views/AgentsStatus.d.ts +13 -0
  1308. package/dist/src/ui/components/views/AgentsStatus.js +23 -0
  1309. package/dist/src/ui/components/views/AgentsStatus.js.map +1 -0
  1310. package/dist/src/ui/components/views/ChatList.d.ts +12 -0
  1311. package/dist/src/ui/components/views/ChatList.js +17 -0
  1312. package/dist/src/ui/components/views/ChatList.js.map +1 -0
  1313. package/dist/src/ui/components/views/ChatList.test.d.ts +6 -0
  1314. package/dist/src/ui/components/views/ChatList.test.js +45 -0
  1315. package/dist/src/ui/components/views/ChatList.test.js.map +1 -0
  1316. package/dist/src/ui/components/views/ExtensionsList.d.ts +12 -0
  1317. package/dist/src/ui/components/views/ExtensionsList.js +45 -0
  1318. package/dist/src/ui/components/views/ExtensionsList.js.map +1 -0
  1319. package/dist/src/ui/components/views/ExtensionsList.test.d.ts +6 -0
  1320. package/dist/src/ui/components/views/ExtensionsList.test.js +148 -0
  1321. package/dist/src/ui/components/views/ExtensionsList.test.js.map +1 -0
  1322. package/dist/src/ui/components/views/HooksList.d.ts +24 -0
  1323. package/dist/src/ui/components/views/HooksList.js +28 -0
  1324. package/dist/src/ui/components/views/HooksList.js.map +1 -0
  1325. package/dist/src/ui/components/views/McpStatus.d.ts +28 -0
  1326. package/dist/src/ui/components/views/McpStatus.js +104 -0
  1327. package/dist/src/ui/components/views/McpStatus.js.map +1 -0
  1328. package/dist/src/ui/components/views/McpStatus.test.d.ts +6 -0
  1329. package/dist/src/ui/components/views/McpStatus.test.js +153 -0
  1330. package/dist/src/ui/components/views/McpStatus.test.js.map +1 -0
  1331. package/dist/src/ui/components/views/SkillsList.d.ts +13 -0
  1332. package/dist/src/ui/components/views/SkillsList.js +17 -0
  1333. package/dist/src/ui/components/views/SkillsList.js.map +1 -0
  1334. package/dist/src/ui/components/views/SkillsList.test.d.ts +6 -0
  1335. package/dist/src/ui/components/views/SkillsList.test.js +97 -0
  1336. package/dist/src/ui/components/views/SkillsList.test.js.map +1 -0
  1337. package/dist/src/ui/components/views/ToolsList.d.ts +14 -0
  1338. package/dist/src/ui/components/views/ToolsList.js +7 -0
  1339. package/dist/src/ui/components/views/ToolsList.js.map +1 -0
  1340. package/dist/src/ui/components/views/ToolsList.test.d.ts +6 -0
  1341. package/dist/src/ui/components/views/ToolsList.test.js +45 -0
  1342. package/dist/src/ui/components/views/ToolsList.test.js.map +1 -0
  1343. package/dist/src/ui/constants/tips.d.ts +6 -0
  1344. package/dist/src/ui/constants/tips.js +164 -0
  1345. package/dist/src/ui/constants/tips.js.map +1 -0
  1346. package/dist/src/ui/constants/wittyPhrases.d.ts +6 -0
  1347. package/dist/src/ui/constants/wittyPhrases.js +137 -0
  1348. package/dist/src/ui/constants/wittyPhrases.js.map +1 -0
  1349. package/dist/src/ui/constants.d.ts +25 -0
  1350. package/dist/src/ui/constants.js +32 -0
  1351. package/dist/src/ui/constants.js.map +1 -0
  1352. package/dist/src/ui/contexts/AppContext.d.ts +11 -0
  1353. package/dist/src/ui/contexts/AppContext.js +15 -0
  1354. package/dist/src/ui/contexts/AppContext.js.map +1 -0
  1355. package/dist/src/ui/contexts/ConfigContext.d.ts +9 -0
  1356. package/dist/src/ui/contexts/ConfigContext.js +16 -0
  1357. package/dist/src/ui/contexts/ConfigContext.js.map +1 -0
  1358. package/dist/src/ui/contexts/KeypressContext.d.ts +32 -0
  1359. package/dist/src/ui/contexts/KeypressContext.js +616 -0
  1360. package/dist/src/ui/contexts/KeypressContext.js.map +1 -0
  1361. package/dist/src/ui/contexts/KeypressContext.test.d.ts +6 -0
  1362. package/dist/src/ui/contexts/KeypressContext.test.js +957 -0
  1363. package/dist/src/ui/contexts/KeypressContext.test.js.map +1 -0
  1364. package/dist/src/ui/contexts/MouseContext.d.ts +21 -0
  1365. package/dist/src/ui/contexts/MouseContext.js +104 -0
  1366. package/dist/src/ui/contexts/MouseContext.js.map +1 -0
  1367. package/dist/src/ui/contexts/MouseContext.test.d.ts +6 -0
  1368. package/dist/src/ui/contexts/MouseContext.test.js +198 -0
  1369. package/dist/src/ui/contexts/MouseContext.test.js.map +1 -0
  1370. package/dist/src/ui/contexts/OverflowContext.d.ts +19 -0
  1371. package/dist/src/ui/contexts/OverflowContext.js +38 -0
  1372. package/dist/src/ui/contexts/OverflowContext.js.map +1 -0
  1373. package/dist/src/ui/contexts/ScrollProvider.d.ts +25 -0
  1374. package/dist/src/ui/contexts/ScrollProvider.drag.test.d.ts +6 -0
  1375. package/dist/src/ui/contexts/ScrollProvider.drag.test.js +319 -0
  1376. package/dist/src/ui/contexts/ScrollProvider.drag.test.js.map +1 -0
  1377. package/dist/src/ui/contexts/ScrollProvider.js +242 -0
  1378. package/dist/src/ui/contexts/ScrollProvider.js.map +1 -0
  1379. package/dist/src/ui/contexts/ScrollProvider.test.d.ts +6 -0
  1380. package/dist/src/ui/contexts/ScrollProvider.test.js +377 -0
  1381. package/dist/src/ui/contexts/ScrollProvider.test.js.map +1 -0
  1382. package/dist/src/ui/contexts/SessionContext.d.ts +46 -0
  1383. package/dist/src/ui/contexts/SessionContext.js +158 -0
  1384. package/dist/src/ui/contexts/SessionContext.js.map +1 -0
  1385. package/dist/src/ui/contexts/SessionContext.test.d.ts +6 -0
  1386. package/dist/src/ui/contexts/SessionContext.test.js +198 -0
  1387. package/dist/src/ui/contexts/SessionContext.test.js.map +1 -0
  1388. package/dist/src/ui/contexts/SettingsContext.d.ts +9 -0
  1389. package/dist/src/ui/contexts/SettingsContext.js +15 -0
  1390. package/dist/src/ui/contexts/SettingsContext.js.map +1 -0
  1391. package/dist/src/ui/contexts/ShellFocusContext.d.ts +7 -0
  1392. package/dist/src/ui/contexts/ShellFocusContext.js +9 -0
  1393. package/dist/src/ui/contexts/ShellFocusContext.js.map +1 -0
  1394. package/dist/src/ui/contexts/StreamingContext.d.ts +9 -0
  1395. package/dist/src/ui/contexts/StreamingContext.js +15 -0
  1396. package/dist/src/ui/contexts/StreamingContext.js.map +1 -0
  1397. package/dist/src/ui/contexts/ToolActionsContext.d.ts +21 -0
  1398. package/dist/src/ui/contexts/ToolActionsContext.js +87 -0
  1399. package/dist/src/ui/contexts/ToolActionsContext.js.map +1 -0
  1400. package/dist/src/ui/contexts/ToolActionsContext.test.d.ts +6 -0
  1401. package/dist/src/ui/contexts/ToolActionsContext.test.js +166 -0
  1402. package/dist/src/ui/contexts/ToolActionsContext.test.js.map +1 -0
  1403. package/dist/src/ui/contexts/UIActionsContext.d.ts +59 -0
  1404. package/dist/src/ui/contexts/UIActionsContext.js +22 -0
  1405. package/dist/src/ui/contexts/UIActionsContext.js.map +1 -0
  1406. package/dist/src/ui/contexts/UIStateContext.d.ts +138 -0
  1407. package/dist/src/ui/contexts/UIStateContext.js +17 -0
  1408. package/dist/src/ui/contexts/UIStateContext.js.map +1 -0
  1409. package/dist/src/ui/contexts/VimModeContext.d.ts +19 -0
  1410. package/dist/src/ui/contexts/VimModeContext.js +48 -0
  1411. package/dist/src/ui/contexts/VimModeContext.js.map +1 -0
  1412. package/dist/src/ui/debug.d.ts +8 -0
  1413. package/dist/src/ui/debug.js +11 -0
  1414. package/dist/src/ui/debug.js.map +1 -0
  1415. package/dist/src/ui/editors/editorSettingsManager.d.ts +18 -0
  1416. package/dist/src/ui/editors/editorSettingsManager.js +37 -0
  1417. package/dist/src/ui/editors/editorSettingsManager.js.map +1 -0
  1418. package/dist/src/ui/hooks/atCommandProcessor.d.ts +32 -0
  1419. package/dist/src/ui/hooks/atCommandProcessor.js +528 -0
  1420. package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -0
  1421. package/dist/src/ui/hooks/atCommandProcessor.test.d.ts +6 -0
  1422. package/dist/src/ui/hooks/atCommandProcessor.test.js +1032 -0
  1423. package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -0
  1424. package/dist/src/ui/hooks/atCommandProcessor_agents.test.d.ts +6 -0
  1425. package/dist/src/ui/hooks/atCommandProcessor_agents.test.js +183 -0
  1426. package/dist/src/ui/hooks/atCommandProcessor_agents.test.js.map +1 -0
  1427. package/dist/src/ui/hooks/keyToAnsi.d.ts +15 -0
  1428. package/dist/src/ui/hooks/keyToAnsi.js +67 -0
  1429. package/dist/src/ui/hooks/keyToAnsi.js.map +1 -0
  1430. package/dist/src/ui/hooks/shellCommandProcessor.d.ts +19 -0
  1431. package/dist/src/ui/hooks/shellCommandProcessor.js +285 -0
  1432. package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -0
  1433. package/dist/src/ui/hooks/shellCommandProcessor.test.d.ts +6 -0
  1434. package/dist/src/ui/hooks/shellCommandProcessor.test.js +521 -0
  1435. package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +1 -0
  1436. package/dist/src/ui/hooks/slashCommandProcessor.d.ts +46 -0
  1437. package/dist/src/ui/hooks/slashCommandProcessor.js +510 -0
  1438. package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -0
  1439. package/dist/src/ui/hooks/slashCommandProcessor.test.d.ts +6 -0
  1440. package/dist/src/ui/hooks/slashCommandProcessor.test.js +796 -0
  1441. package/dist/src/ui/hooks/slashCommandProcessor.test.js.map +1 -0
  1442. package/dist/src/ui/hooks/toolMapping.d.ts +14 -0
  1443. package/dist/src/ui/hooks/toolMapping.js +100 -0
  1444. package/dist/src/ui/hooks/toolMapping.js.map +1 -0
  1445. package/dist/src/ui/hooks/toolMapping.test.d.ts +6 -0
  1446. package/dist/src/ui/hooks/toolMapping.test.js +209 -0
  1447. package/dist/src/ui/hooks/toolMapping.test.js.map +1 -0
  1448. package/dist/src/ui/hooks/useAlternateBuffer.d.ts +8 -0
  1449. package/dist/src/ui/hooks/useAlternateBuffer.js +12 -0
  1450. package/dist/src/ui/hooks/useAlternateBuffer.js.map +1 -0
  1451. package/dist/src/ui/hooks/useAnimatedScrollbar.d.ts +10 -0
  1452. package/dist/src/ui/hooks/useAnimatedScrollbar.js +91 -0
  1453. package/dist/src/ui/hooks/useAnimatedScrollbar.js.map +1 -0
  1454. package/dist/src/ui/hooks/useAnimatedScrollbar.test.d.ts +6 -0
  1455. package/dist/src/ui/hooks/useAnimatedScrollbar.test.js +85 -0
  1456. package/dist/src/ui/hooks/useAnimatedScrollbar.test.js.map +1 -0
  1457. package/dist/src/ui/hooks/useApprovalModeIndicator.d.ts +14 -0
  1458. package/dist/src/ui/hooks/useApprovalModeIndicator.js +75 -0
  1459. package/dist/src/ui/hooks/useApprovalModeIndicator.js.map +1 -0
  1460. package/dist/src/ui/hooks/useApprovalModeIndicator.test.d.ts +6 -0
  1461. package/dist/src/ui/hooks/useApprovalModeIndicator.test.js +435 -0
  1462. package/dist/src/ui/hooks/useApprovalModeIndicator.test.js.map +1 -0
  1463. package/dist/src/ui/hooks/useAtCompletion.d.ts +23 -0
  1464. package/dist/src/ui/hooks/useAtCompletion.js +280 -0
  1465. package/dist/src/ui/hooks/useAtCompletion.js.map +1 -0
  1466. package/dist/src/ui/hooks/useAtCompletion.test.d.ts +6 -0
  1467. package/dist/src/ui/hooks/useAtCompletion.test.js +417 -0
  1468. package/dist/src/ui/hooks/useAtCompletion.test.js.map +1 -0
  1469. package/dist/src/ui/hooks/useAtCompletion_agents.test.d.ts +6 -0
  1470. package/dist/src/ui/hooks/useAtCompletion_agents.test.js +87 -0
  1471. package/dist/src/ui/hooks/useAtCompletion_agents.test.js.map +1 -0
  1472. package/dist/src/ui/hooks/useBanner.d.ts +14 -0
  1473. package/dist/src/ui/hooks/useBanner.js +48 -0
  1474. package/dist/src/ui/hooks/useBanner.js.map +1 -0
  1475. package/dist/src/ui/hooks/useBanner.test.d.ts +6 -0
  1476. package/dist/src/ui/hooks/useBanner.test.js +92 -0
  1477. package/dist/src/ui/hooks/useBanner.test.js.map +1 -0
  1478. package/dist/src/ui/hooks/useBatchedScroll.d.ts +14 -0
  1479. package/dist/src/ui/hooks/useBatchedScroll.js +27 -0
  1480. package/dist/src/ui/hooks/useBatchedScroll.js.map +1 -0
  1481. package/dist/src/ui/hooks/useBatchedScroll.test.d.ts +6 -0
  1482. package/dist/src/ui/hooks/useBatchedScroll.test.js +62 -0
  1483. package/dist/src/ui/hooks/useBatchedScroll.test.js.map +1 -0
  1484. package/dist/src/ui/hooks/useCommandCompletion.d.ts +42 -0
  1485. package/dist/src/ui/hooks/useCommandCompletion.js +237 -0
  1486. package/dist/src/ui/hooks/useCommandCompletion.js.map +1 -0
  1487. package/dist/src/ui/hooks/useCommandCompletion.test.d.ts +6 -0
  1488. package/dist/src/ui/hooks/useCommandCompletion.test.js +462 -0
  1489. package/dist/src/ui/hooks/useCommandCompletion.test.js.map +1 -0
  1490. package/dist/src/ui/hooks/useCompletion.d.ts +24 -0
  1491. package/dist/src/ui/hooks/useCompletion.js +88 -0
  1492. package/dist/src/ui/hooks/useCompletion.js.map +1 -0
  1493. package/dist/src/ui/hooks/useConfirmingTool.d.ts +16 -0
  1494. package/dist/src/ui/hooks/useConfirmingTool.js +39 -0
  1495. package/dist/src/ui/hooks/useConfirmingTool.js.map +1 -0
  1496. package/dist/src/ui/hooks/useConsoleMessages.d.ts +11 -0
  1497. package/dist/src/ui/hooks/useConsoleMessages.js +101 -0
  1498. package/dist/src/ui/hooks/useConsoleMessages.js.map +1 -0
  1499. package/dist/src/ui/hooks/useConsoleMessages.test.d.ts +6 -0
  1500. package/dist/src/ui/hooks/useConsoleMessages.test.js +159 -0
  1501. package/dist/src/ui/hooks/useConsoleMessages.test.js.map +1 -0
  1502. package/dist/src/ui/hooks/useEditorSettings.d.ts +16 -0
  1503. package/dist/src/ui/hooks/useEditorSettings.js +44 -0
  1504. package/dist/src/ui/hooks/useEditorSettings.js.map +1 -0
  1505. package/dist/src/ui/hooks/useEditorSettings.test.d.ts +6 -0
  1506. package/dist/src/ui/hooks/useEditorSettings.test.js +179 -0
  1507. package/dist/src/ui/hooks/useEditorSettings.test.js.map +1 -0
  1508. package/dist/src/ui/hooks/useExtensionUpdates.d.ts +31 -0
  1509. package/dist/src/ui/hooks/useExtensionUpdates.js +173 -0
  1510. package/dist/src/ui/hooks/useExtensionUpdates.js.map +1 -0
  1511. package/dist/src/ui/hooks/useExtensionUpdates.test.d.ts +6 -0
  1512. package/dist/src/ui/hooks/useExtensionUpdates.test.js +279 -0
  1513. package/dist/src/ui/hooks/useExtensionUpdates.test.js.map +1 -0
  1514. package/dist/src/ui/hooks/useFlickerDetector.d.ts +14 -0
  1515. package/dist/src/ui/hooks/useFlickerDetector.js +37 -0
  1516. package/dist/src/ui/hooks/useFlickerDetector.js.map +1 -0
  1517. package/dist/src/ui/hooks/useFlickerDetector.test.d.ts +6 -0
  1518. package/dist/src/ui/hooks/useFlickerDetector.test.js +106 -0
  1519. package/dist/src/ui/hooks/useFlickerDetector.test.js.map +1 -0
  1520. package/dist/src/ui/hooks/useFocus.d.ts +10 -0
  1521. package/dist/src/ui/hooks/useFocus.js +51 -0
  1522. package/dist/src/ui/hooks/useFocus.js.map +1 -0
  1523. package/dist/src/ui/hooks/useFocus.test.d.ts +6 -0
  1524. package/dist/src/ui/hooks/useFocus.test.js +131 -0
  1525. package/dist/src/ui/hooks/useFocus.test.js.map +1 -0
  1526. package/dist/src/ui/hooks/useFolderTrust.d.ts +14 -0
  1527. package/dist/src/ui/hooks/useFolderTrust.js +76 -0
  1528. package/dist/src/ui/hooks/useFolderTrust.js.map +1 -0
  1529. package/dist/src/ui/hooks/useFolderTrust.test.d.ts +6 -0
  1530. package/dist/src/ui/hooks/useFolderTrust.test.js +218 -0
  1531. package/dist/src/ui/hooks/useFolderTrust.test.js.map +1 -0
  1532. package/dist/src/ui/hooks/useGeminiStream.d.ts +37 -0
  1533. package/dist/src/ui/hooks/useGeminiStream.js +909 -0
  1534. package/dist/src/ui/hooks/useGeminiStream.js.map +1 -0
  1535. package/dist/src/ui/hooks/useGeminiStream.test.d.ts +6 -0
  1536. package/dist/src/ui/hooks/useGeminiStream.test.js +2149 -0
  1537. package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -0
  1538. package/dist/src/ui/hooks/useGitBranchName.d.ts +6 -0
  1539. package/dist/src/ui/hooks/useGitBranchName.js +65 -0
  1540. package/dist/src/ui/hooks/useGitBranchName.js.map +1 -0
  1541. package/dist/src/ui/hooks/useGitBranchName.test.d.ts +6 -0
  1542. package/dist/src/ui/hooks/useGitBranchName.test.js +183 -0
  1543. package/dist/src/ui/hooks/useGitBranchName.test.js.map +1 -0
  1544. package/dist/src/ui/hooks/useHistoryManager.d.ts +25 -0
  1545. package/dist/src/ui/hooks/useHistoryManager.js +108 -0
  1546. package/dist/src/ui/hooks/useHistoryManager.js.map +1 -0
  1547. package/dist/src/ui/hooks/useHistoryManager.test.d.ts +6 -0
  1548. package/dist/src/ui/hooks/useHistoryManager.test.js +188 -0
  1549. package/dist/src/ui/hooks/useHistoryManager.test.js.map +1 -0
  1550. package/dist/src/ui/hooks/useHookDisplayState.d.ts +7 -0
  1551. package/dist/src/ui/hooks/useHookDisplayState.js +83 -0
  1552. package/dist/src/ui/hooks/useHookDisplayState.js.map +1 -0
  1553. package/dist/src/ui/hooks/useHookDisplayState.test.d.ts +6 -0
  1554. package/dist/src/ui/hooks/useHookDisplayState.test.js +180 -0
  1555. package/dist/src/ui/hooks/useHookDisplayState.test.js.map +1 -0
  1556. package/dist/src/ui/hooks/useIdeTrustListener.d.ts +16 -0
  1557. package/dist/src/ui/hooks/useIdeTrustListener.js +67 -0
  1558. package/dist/src/ui/hooks/useIdeTrustListener.js.map +1 -0
  1559. package/dist/src/ui/hooks/useIdeTrustListener.test.d.ts +6 -0
  1560. package/dist/src/ui/hooks/useIdeTrustListener.test.js +214 -0
  1561. package/dist/src/ui/hooks/useIdeTrustListener.test.js.map +1 -0
  1562. package/dist/src/ui/hooks/useInactivityTimer.d.ts +14 -0
  1563. package/dist/src/ui/hooks/useInactivityTimer.js +30 -0
  1564. package/dist/src/ui/hooks/useInactivityTimer.js.map +1 -0
  1565. package/dist/src/ui/hooks/useIncludeDirsTrust.d.ts +8 -0
  1566. package/dist/src/ui/hooks/useIncludeDirsTrust.js +110 -0
  1567. package/dist/src/ui/hooks/useIncludeDirsTrust.js.map +1 -0
  1568. package/dist/src/ui/hooks/useIncludeDirsTrust.test.d.ts +6 -0
  1569. package/dist/src/ui/hooks/useIncludeDirsTrust.test.js +172 -0
  1570. package/dist/src/ui/hooks/useIncludeDirsTrust.test.js.map +1 -0
  1571. package/dist/src/ui/hooks/useInputHistory.d.ts +19 -0
  1572. package/dist/src/ui/hooks/useInputHistory.js +84 -0
  1573. package/dist/src/ui/hooks/useInputHistory.js.map +1 -0
  1574. package/dist/src/ui/hooks/useInputHistory.test.d.ts +6 -0
  1575. package/dist/src/ui/hooks/useInputHistory.test.js +208 -0
  1576. package/dist/src/ui/hooks/useInputHistory.test.js.map +1 -0
  1577. package/dist/src/ui/hooks/useInputHistoryStore.d.ts +19 -0
  1578. package/dist/src/ui/hooks/useInputHistoryStore.js +82 -0
  1579. package/dist/src/ui/hooks/useInputHistoryStore.js.map +1 -0
  1580. package/dist/src/ui/hooks/useInputHistoryStore.test.d.ts +6 -0
  1581. package/dist/src/ui/hooks/useInputHistoryStore.test.js +238 -0
  1582. package/dist/src/ui/hooks/useInputHistoryStore.test.js.map +1 -0
  1583. package/dist/src/ui/hooks/useKeypress.d.ts +17 -0
  1584. package/dist/src/ui/hooks/useKeypress.js +27 -0
  1585. package/dist/src/ui/hooks/useKeypress.js.map +1 -0
  1586. package/dist/src/ui/hooks/useKeypress.test.d.ts +6 -0
  1587. package/dist/src/ui/hooks/useKeypress.test.js +205 -0
  1588. package/dist/src/ui/hooks/useKeypress.test.js.map +1 -0
  1589. package/dist/src/ui/hooks/useKittyKeyboardProtocol.d.ts +14 -0
  1590. package/dist/src/ui/hooks/useKittyKeyboardProtocol.js +19 -0
  1591. package/dist/src/ui/hooks/useKittyKeyboardProtocol.js.map +1 -0
  1592. package/dist/src/ui/hooks/useLoadingIndicator.d.ts +17 -0
  1593. package/dist/src/ui/hooks/useLoadingIndicator.js +48 -0
  1594. package/dist/src/ui/hooks/useLoadingIndicator.js.map +1 -0
  1595. package/dist/src/ui/hooks/useLoadingIndicator.test.d.ts +6 -0
  1596. package/dist/src/ui/hooks/useLoadingIndicator.test.js +145 -0
  1597. package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +1 -0
  1598. package/dist/src/ui/hooks/useLogger.d.ts +11 -0
  1599. package/dist/src/ui/hooks/useLogger.js +29 -0
  1600. package/dist/src/ui/hooks/useLogger.js.map +1 -0
  1601. package/dist/src/ui/hooks/useMcpStatus.d.ts +11 -0
  1602. package/dist/src/ui/hooks/useMcpStatus.js +34 -0
  1603. package/dist/src/ui/hooks/useMcpStatus.js.map +1 -0
  1604. package/dist/src/ui/hooks/useMcpStatus.test.d.ts +6 -0
  1605. package/dist/src/ui/hooks/useMcpStatus.test.js +69 -0
  1606. package/dist/src/ui/hooks/useMcpStatus.test.js.map +1 -0
  1607. package/dist/src/ui/hooks/useMemoryMonitor.d.ts +13 -0
  1608. package/dist/src/ui/hooks/useMemoryMonitor.js +28 -0
  1609. package/dist/src/ui/hooks/useMemoryMonitor.js.map +1 -0
  1610. package/dist/src/ui/hooks/useMemoryMonitor.test.d.ts +6 -0
  1611. package/dist/src/ui/hooks/useMemoryMonitor.test.js +62 -0
  1612. package/dist/src/ui/hooks/useMemoryMonitor.test.js.map +1 -0
  1613. package/dist/src/ui/hooks/useMessageQueue.d.ts +25 -0
  1614. package/dist/src/ui/hooks/useMessageQueue.js +68 -0
  1615. package/dist/src/ui/hooks/useMessageQueue.js.map +1 -0
  1616. package/dist/src/ui/hooks/useMessageQueue.test.d.ts +6 -0
  1617. package/dist/src/ui/hooks/useMessageQueue.test.js +327 -0
  1618. package/dist/src/ui/hooks/useMessageQueue.test.js.map +1 -0
  1619. package/dist/src/ui/hooks/useModelCommand.d.ts +12 -0
  1620. package/dist/src/ui/hooks/useModelCommand.js +21 -0
  1621. package/dist/src/ui/hooks/useModelCommand.js.map +1 -0
  1622. package/dist/src/ui/hooks/useModelCommand.test.d.ts +6 -0
  1623. package/dist/src/ui/hooks/useModelCommand.test.js +45 -0
  1624. package/dist/src/ui/hooks/useModelCommand.test.js.map +1 -0
  1625. package/dist/src/ui/hooks/useMouse.d.ts +17 -0
  1626. package/dist/src/ui/hooks/useMouse.js +27 -0
  1627. package/dist/src/ui/hooks/useMouse.js.map +1 -0
  1628. package/dist/src/ui/hooks/useMouse.test.d.ts +6 -0
  1629. package/dist/src/ui/hooks/useMouse.test.js +57 -0
  1630. package/dist/src/ui/hooks/useMouse.test.js.map +1 -0
  1631. package/dist/src/ui/hooks/useMouseClick.d.ts +12 -0
  1632. package/dist/src/ui/hooks/useMouseClick.js +28 -0
  1633. package/dist/src/ui/hooks/useMouseClick.js.map +1 -0
  1634. package/dist/src/ui/hooks/useMouseClick.test.d.ts +6 -0
  1635. package/dist/src/ui/hooks/useMouseClick.test.js +59 -0
  1636. package/dist/src/ui/hooks/useMouseClick.test.js.map +1 -0
  1637. package/dist/src/ui/hooks/useMouseDoubleClick.d.ts +11 -0
  1638. package/dist/src/ui/hooks/useMouseDoubleClick.js +49 -0
  1639. package/dist/src/ui/hooks/useMouseDoubleClick.js.map +1 -0
  1640. package/dist/src/ui/hooks/useMouseDoubleClick.test.d.ts +6 -0
  1641. package/dist/src/ui/hooks/useMouseDoubleClick.test.js +125 -0
  1642. package/dist/src/ui/hooks/useMouseDoubleClick.test.js.map +1 -0
  1643. package/dist/src/ui/hooks/usePermissionsModifyTrust.d.ts +17 -0
  1644. package/dist/src/ui/hooks/usePermissionsModifyTrust.js +115 -0
  1645. package/dist/src/ui/hooks/usePermissionsModifyTrust.js.map +1 -0
  1646. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.d.ts +6 -0
  1647. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js +291 -0
  1648. package/dist/src/ui/hooks/usePermissionsModifyTrust.test.js.map +1 -0
  1649. package/dist/src/ui/hooks/usePhraseCycler.d.ts +16 -0
  1650. package/dist/src/ui/hooks/usePhraseCycler.js +81 -0
  1651. package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -0
  1652. package/dist/src/ui/hooks/usePhraseCycler.test.d.ts +6 -0
  1653. package/dist/src/ui/hooks/usePhraseCycler.test.js +208 -0
  1654. package/dist/src/ui/hooks/usePhraseCycler.test.js.map +1 -0
  1655. package/dist/src/ui/hooks/usePrivacySettings.d.ts +16 -0
  1656. package/dist/src/ui/hooks/usePrivacySettings.js +103 -0
  1657. package/dist/src/ui/hooks/usePrivacySettings.js.map +1 -0
  1658. package/dist/src/ui/hooks/usePrivacySettings.test.d.ts +6 -0
  1659. package/dist/src/ui/hooks/usePrivacySettings.test.js +104 -0
  1660. package/dist/src/ui/hooks/usePrivacySettings.test.js.map +1 -0
  1661. package/dist/src/ui/hooks/usePromptCompletion.d.ts +23 -0
  1662. package/dist/src/ui/hooks/usePromptCompletion.js +169 -0
  1663. package/dist/src/ui/hooks/usePromptCompletion.js.map +1 -0
  1664. package/dist/src/ui/hooks/useQuotaAndFallback.d.ts +22 -0
  1665. package/dist/src/ui/hooks/useQuotaAndFallback.js +149 -0
  1666. package/dist/src/ui/hooks/useQuotaAndFallback.js.map +1 -0
  1667. package/dist/src/ui/hooks/useQuotaAndFallback.test.d.ts +6 -0
  1668. package/dist/src/ui/hooks/useQuotaAndFallback.test.js +477 -0
  1669. package/dist/src/ui/hooks/useQuotaAndFallback.test.js.map +1 -0
  1670. package/dist/src/ui/hooks/useReactToolScheduler.d.ts +43 -0
  1671. package/dist/src/ui/hooks/useReactToolScheduler.js +98 -0
  1672. package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -0
  1673. package/dist/src/ui/hooks/useReactToolScheduler.test.d.ts +6 -0
  1674. package/dist/src/ui/hooks/useReactToolScheduler.test.js +58 -0
  1675. package/dist/src/ui/hooks/useReactToolScheduler.test.js.map +1 -0
  1676. package/dist/src/ui/hooks/useRefreshMemoryCommand.d.ts +6 -0
  1677. package/dist/src/ui/hooks/useRefreshMemoryCommand.js +7 -0
  1678. package/dist/src/ui/hooks/useRefreshMemoryCommand.js.map +1 -0
  1679. package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +19 -0
  1680. package/dist/src/ui/hooks/useReverseSearchCompletion.js +103 -0
  1681. package/dist/src/ui/hooks/useReverseSearchCompletion.js.map +1 -0
  1682. package/dist/src/ui/hooks/useReverseSearchCompletion.test.d.ts +6 -0
  1683. package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +169 -0
  1684. package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +1 -0
  1685. package/dist/src/ui/hooks/useRewind.d.ts +14 -0
  1686. package/dist/src/ui/hooks/useRewind.js +31 -0
  1687. package/dist/src/ui/hooks/useRewind.js.map +1 -0
  1688. package/dist/src/ui/hooks/useRewind.test.d.ts +6 -0
  1689. package/dist/src/ui/hooks/useRewind.test.js +100 -0
  1690. package/dist/src/ui/hooks/useRewind.test.js.map +1 -0
  1691. package/dist/src/ui/hooks/useSelectionList.d.ts +37 -0
  1692. package/dist/src/ui/hooks/useSelectionList.js +312 -0
  1693. package/dist/src/ui/hooks/useSelectionList.js.map +1 -0
  1694. package/dist/src/ui/hooks/useSelectionList.test.d.ts +6 -0
  1695. package/dist/src/ui/hooks/useSelectionList.test.js +848 -0
  1696. package/dist/src/ui/hooks/useSelectionList.test.js.map +1 -0
  1697. package/dist/src/ui/hooks/useSessionBrowser.d.ts +35 -0
  1698. package/dist/src/ui/hooks/useSessionBrowser.js +224 -0
  1699. package/dist/src/ui/hooks/useSessionBrowser.js.map +1 -0
  1700. package/dist/src/ui/hooks/useSessionBrowser.test.d.ts +6 -0
  1701. package/dist/src/ui/hooks/useSessionBrowser.test.js +203 -0
  1702. package/dist/src/ui/hooks/useSessionBrowser.test.js.map +1 -0
  1703. package/dist/src/ui/hooks/useSessionResume.d.ts +31 -0
  1704. package/dist/src/ui/hooks/useSessionResume.js +67 -0
  1705. package/dist/src/ui/hooks/useSessionResume.js.map +1 -0
  1706. package/dist/src/ui/hooks/useSessionResume.test.d.ts +6 -0
  1707. package/dist/src/ui/hooks/useSessionResume.test.js +336 -0
  1708. package/dist/src/ui/hooks/useSessionResume.test.js.map +1 -0
  1709. package/dist/src/ui/hooks/useSettingsCommand.d.ts +10 -0
  1710. package/dist/src/ui/hooks/useSettingsCommand.js +21 -0
  1711. package/dist/src/ui/hooks/useSettingsCommand.js.map +1 -0
  1712. package/dist/src/ui/hooks/useShellHistory.d.ts +14 -0
  1713. package/dist/src/ui/hooks/useShellHistory.js +113 -0
  1714. package/dist/src/ui/hooks/useShellHistory.js.map +1 -0
  1715. package/dist/src/ui/hooks/useShellHistory.test.d.ts +6 -0
  1716. package/dist/src/ui/hooks/useShellHistory.test.js +223 -0
  1717. package/dist/src/ui/hooks/useShellHistory.test.js.map +1 -0
  1718. package/dist/src/ui/hooks/useShellInactivityStatus.d.ts +26 -0
  1719. package/dist/src/ui/hooks/useShellInactivityStatus.js +46 -0
  1720. package/dist/src/ui/hooks/useShellInactivityStatus.js.map +1 -0
  1721. package/dist/src/ui/hooks/useShellInactivityStatus.test.d.ts +6 -0
  1722. package/dist/src/ui/hooks/useShellInactivityStatus.test.js +84 -0
  1723. package/dist/src/ui/hooks/useShellInactivityStatus.test.js.map +1 -0
  1724. package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +9 -0
  1725. package/dist/src/ui/hooks/useShowMemoryCommand.js +59 -0
  1726. package/dist/src/ui/hooks/useShowMemoryCommand.js.map +1 -0
  1727. package/dist/src/ui/hooks/useSlashCompletion.d.ts +23 -0
  1728. package/dist/src/ui/hooks/useSlashCompletion.js +397 -0
  1729. package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -0
  1730. package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +9 -0
  1731. package/dist/src/ui/hooks/useSlashCompletion.test.js +845 -0
  1732. package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -0
  1733. package/dist/src/ui/hooks/useSnowfall.d.ts +6 -0
  1734. package/dist/src/ui/hooks/useSnowfall.js +126 -0
  1735. package/dist/src/ui/hooks/useSnowfall.js.map +1 -0
  1736. package/dist/src/ui/hooks/useSnowfall.test.d.ts +6 -0
  1737. package/dist/src/ui/hooks/useSnowfall.test.js +88 -0
  1738. package/dist/src/ui/hooks/useSnowfall.test.js.map +1 -0
  1739. package/dist/src/ui/hooks/useStateAndRef.d.ts +7 -0
  1740. package/dist/src/ui/hooks/useStateAndRef.js +26 -0
  1741. package/dist/src/ui/hooks/useStateAndRef.js.map +1 -0
  1742. package/dist/src/ui/hooks/useTabbedNavigation.d.ts +53 -0
  1743. package/dist/src/ui/hooks/useTabbedNavigation.js +150 -0
  1744. package/dist/src/ui/hooks/useTabbedNavigation.js.map +1 -0
  1745. package/dist/src/ui/hooks/useTabbedNavigation.test.d.ts +6 -0
  1746. package/dist/src/ui/hooks/useTabbedNavigation.test.js +187 -0
  1747. package/dist/src/ui/hooks/useTabbedNavigation.test.js.map +1 -0
  1748. package/dist/src/ui/hooks/useTerminalSize.d.ts +9 -0
  1749. package/dist/src/ui/hooks/useTerminalSize.js +26 -0
  1750. package/dist/src/ui/hooks/useTerminalSize.js.map +1 -0
  1751. package/dist/src/ui/hooks/useThemeCommand.d.ts +16 -0
  1752. package/dist/src/ui/hooks/useThemeCommand.js +74 -0
  1753. package/dist/src/ui/hooks/useThemeCommand.js.map +1 -0
  1754. package/dist/src/ui/hooks/useTimer.d.ts +12 -0
  1755. package/dist/src/ui/hooks/useTimer.js +58 -0
  1756. package/dist/src/ui/hooks/useTimer.js.map +1 -0
  1757. package/dist/src/ui/hooks/useTimer.test.d.ts +6 -0
  1758. package/dist/src/ui/hooks/useTimer.test.js +119 -0
  1759. package/dist/src/ui/hooks/useTimer.test.js.map +1 -0
  1760. package/dist/src/ui/hooks/useTips.d.ts +10 -0
  1761. package/dist/src/ui/hooks/useTips.js +18 -0
  1762. package/dist/src/ui/hooks/useTips.js.map +1 -0
  1763. package/dist/src/ui/hooks/useTips.test.d.ts +6 -0
  1764. package/dist/src/ui/hooks/useTips.test.js +33 -0
  1765. package/dist/src/ui/hooks/useTips.test.js.map +1 -0
  1766. package/dist/src/ui/hooks/useToolExecutionScheduler.d.ts +30 -0
  1767. package/dist/src/ui/hooks/useToolExecutionScheduler.js +149 -0
  1768. package/dist/src/ui/hooks/useToolExecutionScheduler.js.map +1 -0
  1769. package/dist/src/ui/hooks/useToolExecutionScheduler.test.d.ts +6 -0
  1770. package/dist/src/ui/hooks/useToolExecutionScheduler.test.js +376 -0
  1771. package/dist/src/ui/hooks/useToolExecutionScheduler.test.js.map +1 -0
  1772. package/dist/src/ui/hooks/useToolScheduler.d.ts +29 -0
  1773. package/dist/src/ui/hooks/useToolScheduler.js +30 -0
  1774. package/dist/src/ui/hooks/useToolScheduler.js.map +1 -0
  1775. package/dist/src/ui/hooks/useToolScheduler.test.d.ts +6 -0
  1776. package/dist/src/ui/hooks/useToolScheduler.test.js +881 -0
  1777. package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -0
  1778. package/dist/src/ui/hooks/useToolSchedulerFacade.test.d.ts +6 -0
  1779. package/dist/src/ui/hooks/useToolSchedulerFacade.test.js +45 -0
  1780. package/dist/src/ui/hooks/useToolSchedulerFacade.test.js.map +1 -0
  1781. package/dist/src/ui/hooks/useTurnActivityMonitor.d.ts +16 -0
  1782. package/dist/src/ui/hooks/useTurnActivityMonitor.js +49 -0
  1783. package/dist/src/ui/hooks/useTurnActivityMonitor.js.map +1 -0
  1784. package/dist/src/ui/hooks/useTurnActivityMonitor.test.d.ts +6 -0
  1785. package/dist/src/ui/hooks/useTurnActivityMonitor.test.js +97 -0
  1786. package/dist/src/ui/hooks/useTurnActivityMonitor.test.js.map +1 -0
  1787. package/dist/src/ui/hooks/vim.d.ts +28 -0
  1788. package/dist/src/ui/hooks/vim.js +667 -0
  1789. package/dist/src/ui/hooks/vim.js.map +1 -0
  1790. package/dist/src/ui/hooks/vim.test.d.ts +6 -0
  1791. package/dist/src/ui/hooks/vim.test.js +1384 -0
  1792. package/dist/src/ui/hooks/vim.test.js.map +1 -0
  1793. package/dist/src/ui/keyMatchers.d.ts +27 -0
  1794. package/dist/src/ui/keyMatchers.js +45 -0
  1795. package/dist/src/ui/keyMatchers.js.map +1 -0
  1796. package/dist/src/ui/keyMatchers.test.d.ts +6 -0
  1797. package/dist/src/ui/keyMatchers.test.js +386 -0
  1798. package/dist/src/ui/keyMatchers.test.js.map +1 -0
  1799. package/dist/src/ui/layouts/DefaultAppLayout.d.ts +7 -0
  1800. package/dist/src/ui/layouts/DefaultAppLayout.js +29 -0
  1801. package/dist/src/ui/layouts/DefaultAppLayout.js.map +1 -0
  1802. package/dist/src/ui/layouts/ScreenReaderAppLayout.d.ts +7 -0
  1803. package/dist/src/ui/layouts/ScreenReaderAppLayout.js +17 -0
  1804. package/dist/src/ui/layouts/ScreenReaderAppLayout.js.map +1 -0
  1805. package/dist/src/ui/noninteractive/nonInteractiveUi.d.ts +12 -0
  1806. package/dist/src/ui/noninteractive/nonInteractiveUi.js +30 -0
  1807. package/dist/src/ui/noninteractive/nonInteractiveUi.js.map +1 -0
  1808. package/dist/src/ui/privacy/CloudFreePrivacyNotice.d.ts +12 -0
  1809. package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +42 -0
  1810. package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +1 -0
  1811. package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.d.ts +6 -0
  1812. package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.js +121 -0
  1813. package/dist/src/ui/privacy/CloudFreePrivacyNotice.test.js.map +1 -0
  1814. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.d.ts +10 -0
  1815. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +18 -0
  1816. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +1 -0
  1817. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.d.ts +6 -0
  1818. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.js +34 -0
  1819. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.test.js.map +1 -0
  1820. package/dist/src/ui/privacy/GeminiPrivacyNotice.d.ts +10 -0
  1821. package/dist/src/ui/privacy/GeminiPrivacyNotice.js +18 -0
  1822. package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +1 -0
  1823. package/dist/src/ui/privacy/GeminiPrivacyNotice.test.d.ts +6 -0
  1824. package/dist/src/ui/privacy/GeminiPrivacyNotice.test.js +34 -0
  1825. package/dist/src/ui/privacy/GeminiPrivacyNotice.test.js.map +1 -0
  1826. package/dist/src/ui/privacy/PrivacyNotice.d.ts +12 -0
  1827. package/dist/src/ui/privacy/PrivacyNotice.js +25 -0
  1828. package/dist/src/ui/privacy/PrivacyNotice.js.map +1 -0
  1829. package/dist/src/ui/privacy/PrivacyNotice.test.d.ts +6 -0
  1830. package/dist/src/ui/privacy/PrivacyNotice.test.js +62 -0
  1831. package/dist/src/ui/privacy/PrivacyNotice.test.js.map +1 -0
  1832. package/dist/src/ui/semantic-colors.d.ts +7 -0
  1833. package/dist/src/ui/semantic-colors.js +24 -0
  1834. package/dist/src/ui/semantic-colors.js.map +1 -0
  1835. package/dist/src/ui/state/extensions.d.ts +67 -0
  1836. package/dist/src/ui/state/extensions.js +97 -0
  1837. package/dist/src/ui/state/extensions.js.map +1 -0
  1838. package/dist/src/ui/state/extensions.test.d.ts +6 -0
  1839. package/dist/src/ui/state/extensions.test.js +219 -0
  1840. package/dist/src/ui/state/extensions.test.js.map +1 -0
  1841. package/dist/src/ui/textConstants.d.ts +13 -0
  1842. package/dist/src/ui/textConstants.js +14 -0
  1843. package/dist/src/ui/textConstants.js.map +1 -0
  1844. package/dist/src/ui/themes/ansi-light.d.ts +7 -0
  1845. package/dist/src/ui/themes/ansi-light.js +143 -0
  1846. package/dist/src/ui/themes/ansi-light.js.map +1 -0
  1847. package/dist/src/ui/themes/ansi.d.ts +7 -0
  1848. package/dist/src/ui/themes/ansi.js +153 -0
  1849. package/dist/src/ui/themes/ansi.js.map +1 -0
  1850. package/dist/src/ui/themes/atom-one-dark.d.ts +7 -0
  1851. package/dist/src/ui/themes/atom-one-dark.js +140 -0
  1852. package/dist/src/ui/themes/atom-one-dark.js.map +1 -0
  1853. package/dist/src/ui/themes/ayu-light.d.ts +7 -0
  1854. package/dist/src/ui/themes/ayu-light.js +132 -0
  1855. package/dist/src/ui/themes/ayu-light.js.map +1 -0
  1856. package/dist/src/ui/themes/ayu.d.ts +7 -0
  1857. package/dist/src/ui/themes/ayu.js +106 -0
  1858. package/dist/src/ui/themes/ayu.js.map +1 -0
  1859. package/dist/src/ui/themes/color-utils.d.ts +30 -0
  1860. package/dist/src/ui/themes/color-utils.js +270 -0
  1861. package/dist/src/ui/themes/color-utils.js.map +1 -0
  1862. package/dist/src/ui/themes/color-utils.test.d.ts +6 -0
  1863. package/dist/src/ui/themes/color-utils.test.js +245 -0
  1864. package/dist/src/ui/themes/color-utils.test.js.map +1 -0
  1865. package/dist/src/ui/themes/default-light.d.ts +7 -0
  1866. package/dist/src/ui/themes/default-light.js +100 -0
  1867. package/dist/src/ui/themes/default-light.js.map +1 -0
  1868. package/dist/src/ui/themes/default.d.ts +7 -0
  1869. package/dist/src/ui/themes/default.js +143 -0
  1870. package/dist/src/ui/themes/default.js.map +1 -0
  1871. package/dist/src/ui/themes/dracula.d.ts +7 -0
  1872. package/dist/src/ui/themes/dracula.js +117 -0
  1873. package/dist/src/ui/themes/dracula.js.map +1 -0
  1874. package/dist/src/ui/themes/github-dark.d.ts +7 -0
  1875. package/dist/src/ui/themes/github-dark.js +140 -0
  1876. package/dist/src/ui/themes/github-dark.js.map +1 -0
  1877. package/dist/src/ui/themes/github-light.d.ts +7 -0
  1878. package/dist/src/ui/themes/github-light.js +142 -0
  1879. package/dist/src/ui/themes/github-light.js.map +1 -0
  1880. package/dist/src/ui/themes/googlecode.d.ts +7 -0
  1881. package/dist/src/ui/themes/googlecode.js +139 -0
  1882. package/dist/src/ui/themes/googlecode.js.map +1 -0
  1883. package/dist/src/ui/themes/holiday.d.ts +7 -0
  1884. package/dist/src/ui/themes/holiday.js +162 -0
  1885. package/dist/src/ui/themes/holiday.js.map +1 -0
  1886. package/dist/src/ui/themes/no-color.d.ts +7 -0
  1887. package/dist/src/ui/themes/no-color.js +118 -0
  1888. package/dist/src/ui/themes/no-color.js.map +1 -0
  1889. package/dist/src/ui/themes/semantic-tokens.d.ts +39 -0
  1890. package/dist/src/ui/themes/semantic-tokens.js +100 -0
  1891. package/dist/src/ui/themes/semantic-tokens.js.map +1 -0
  1892. package/dist/src/ui/themes/shades-of-purple.d.ts +11 -0
  1893. package/dist/src/ui/themes/shades-of-purple.js +306 -0
  1894. package/dist/src/ui/themes/shades-of-purple.js.map +1 -0
  1895. package/dist/src/ui/themes/theme-manager.d.ts +71 -0
  1896. package/dist/src/ui/themes/theme-manager.js +271 -0
  1897. package/dist/src/ui/themes/theme-manager.js.map +1 -0
  1898. package/dist/src/ui/themes/theme-manager.test.d.ts +6 -0
  1899. package/dist/src/ui/themes/theme-manager.test.js +150 -0
  1900. package/dist/src/ui/themes/theme-manager.test.js.map +1 -0
  1901. package/dist/src/ui/themes/theme.d.ts +145 -0
  1902. package/dist/src/ui/themes/theme.js +420 -0
  1903. package/dist/src/ui/themes/theme.js.map +1 -0
  1904. package/dist/src/ui/themes/theme.test.d.ts +6 -0
  1905. package/dist/src/ui/themes/theme.test.js +174 -0
  1906. package/dist/src/ui/themes/theme.test.js.map +1 -0
  1907. package/dist/src/ui/themes/xcode.d.ts +7 -0
  1908. package/dist/src/ui/themes/xcode.js +147 -0
  1909. package/dist/src/ui/themes/xcode.js.map +1 -0
  1910. package/dist/src/ui/types.d.ts +336 -0
  1911. package/dist/src/ui/types.js +70 -0
  1912. package/dist/src/ui/types.js.map +1 -0
  1913. package/dist/src/ui/utils/CodeColorizer.d.ts +25 -0
  1914. package/dist/src/ui/utils/CodeColorizer.js +123 -0
  1915. package/dist/src/ui/utils/CodeColorizer.js.map +1 -0
  1916. package/dist/src/ui/utils/CodeColorizer.test.d.ts +6 -0
  1917. package/dist/src/ui/utils/CodeColorizer.test.js +38 -0
  1918. package/dist/src/ui/utils/CodeColorizer.test.js.map +1 -0
  1919. package/dist/src/ui/utils/ConsolePatcher.d.ts +25 -0
  1920. package/dist/src/ui/utils/ConsolePatcher.js +50 -0
  1921. package/dist/src/ui/utils/ConsolePatcher.js.map +1 -0
  1922. package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +17 -0
  1923. package/dist/src/ui/utils/InlineMarkdownRenderer.js +113 -0
  1924. package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -0
  1925. package/dist/src/ui/utils/InlineMarkdownRenderer.test.d.ts +6 -0
  1926. package/dist/src/ui/utils/InlineMarkdownRenderer.test.js +21 -0
  1927. package/dist/src/ui/utils/InlineMarkdownRenderer.test.js.map +1 -0
  1928. package/dist/src/ui/utils/MarkdownDisplay.d.ts +15 -0
  1929. package/dist/src/ui/utils/MarkdownDisplay.js +242 -0
  1930. package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -0
  1931. package/dist/src/ui/utils/MarkdownDisplay.test.d.ts +6 -0
  1932. package/dist/src/ui/utils/MarkdownDisplay.test.js +159 -0
  1933. package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -0
  1934. package/dist/src/ui/utils/TableRenderer.d.ts +17 -0
  1935. package/dist/src/ui/utils/TableRenderer.js +84 -0
  1936. package/dist/src/ui/utils/TableRenderer.js.map +1 -0
  1937. package/dist/src/ui/utils/clipboardUtils.d.ts +47 -0
  1938. package/dist/src/ui/utils/clipboardUtils.js +444 -0
  1939. package/dist/src/ui/utils/clipboardUtils.js.map +1 -0
  1940. package/dist/src/ui/utils/clipboardUtils.test.d.ts +6 -0
  1941. package/dist/src/ui/utils/clipboardUtils.test.js +359 -0
  1942. package/dist/src/ui/utils/clipboardUtils.test.js.map +1 -0
  1943. package/dist/src/ui/utils/clipboardUtils.windows.test.d.ts +6 -0
  1944. package/dist/src/ui/utils/clipboardUtils.windows.test.js +55 -0
  1945. package/dist/src/ui/utils/clipboardUtils.windows.test.js.map +1 -0
  1946. package/dist/src/ui/utils/commandUtils.d.ts +36 -0
  1947. package/dist/src/ui/utils/commandUtils.js +245 -0
  1948. package/dist/src/ui/utils/commandUtils.js.map +1 -0
  1949. package/dist/src/ui/utils/commandUtils.test.d.ts +6 -0
  1950. package/dist/src/ui/utils/commandUtils.test.js +479 -0
  1951. package/dist/src/ui/utils/commandUtils.test.js.map +1 -0
  1952. package/dist/src/ui/utils/computeStats.d.ts +10 -0
  1953. package/dist/src/ui/utils/computeStats.js +62 -0
  1954. package/dist/src/ui/utils/computeStats.js.map +1 -0
  1955. package/dist/src/ui/utils/computeStats.test.d.ts +6 -0
  1956. package/dist/src/ui/utils/computeStats.test.js +271 -0
  1957. package/dist/src/ui/utils/computeStats.test.js.map +1 -0
  1958. package/dist/src/ui/utils/directoryUtils.d.ts +24 -0
  1959. package/dist/src/ui/utils/directoryUtils.js +125 -0
  1960. package/dist/src/ui/utils/directoryUtils.js.map +1 -0
  1961. package/dist/src/ui/utils/directoryUtils.test.d.ts +6 -0
  1962. package/dist/src/ui/utils/directoryUtils.test.js +244 -0
  1963. package/dist/src/ui/utils/directoryUtils.test.js.map +1 -0
  1964. package/dist/src/ui/utils/displayUtils.d.ts +18 -0
  1965. package/dist/src/ui/utils/displayUtils.js +27 -0
  1966. package/dist/src/ui/utils/displayUtils.js.map +1 -0
  1967. package/dist/src/ui/utils/displayUtils.test.d.ts +6 -0
  1968. package/dist/src/ui/utils/displayUtils.test.js +61 -0
  1969. package/dist/src/ui/utils/displayUtils.test.js.map +1 -0
  1970. package/dist/src/ui/utils/formatters.d.ts +22 -0
  1971. package/dist/src/ui/utils/formatters.js +81 -0
  1972. package/dist/src/ui/utils/formatters.js.map +1 -0
  1973. package/dist/src/ui/utils/formatters.test.d.ts +6 -0
  1974. package/dist/src/ui/utils/formatters.test.js +124 -0
  1975. package/dist/src/ui/utils/formatters.test.js.map +1 -0
  1976. package/dist/src/ui/utils/highlight.d.ts +12 -0
  1977. package/dist/src/ui/utils/highlight.js +115 -0
  1978. package/dist/src/ui/utils/highlight.js.map +1 -0
  1979. package/dist/src/ui/utils/highlight.test.d.ts +6 -0
  1980. package/dist/src/ui/utils/highlight.test.js +198 -0
  1981. package/dist/src/ui/utils/highlight.test.js.map +1 -0
  1982. package/dist/src/ui/utils/historyExportUtils.d.ts +21 -0
  1983. package/dist/src/ui/utils/historyExportUtils.js +59 -0
  1984. package/dist/src/ui/utils/historyExportUtils.js.map +1 -0
  1985. package/dist/src/ui/utils/input.d.ts +17 -0
  1986. package/dist/src/ui/utils/input.js +51 -0
  1987. package/dist/src/ui/utils/input.js.map +1 -0
  1988. package/dist/src/ui/utils/input.test.d.ts +6 -0
  1989. package/dist/src/ui/utils/input.test.js +44 -0
  1990. package/dist/src/ui/utils/input.test.js.map +1 -0
  1991. package/dist/src/ui/utils/isNarrowWidth.d.ts +6 -0
  1992. package/dist/src/ui/utils/isNarrowWidth.js +9 -0
  1993. package/dist/src/ui/utils/isNarrowWidth.js.map +1 -0
  1994. package/dist/src/ui/utils/markdownUtilities.d.ts +6 -0
  1995. package/dist/src/ui/utils/markdownUtilities.js +110 -0
  1996. package/dist/src/ui/utils/markdownUtilities.js.map +1 -0
  1997. package/dist/src/ui/utils/markdownUtilities.test.d.ts +6 -0
  1998. package/dist/src/ui/utils/markdownUtilities.test.js +42 -0
  1999. package/dist/src/ui/utils/markdownUtilities.test.js.map +1 -0
  2000. package/dist/src/ui/utils/mouse.d.ts +32 -0
  2001. package/dist/src/ui/utils/mouse.js +181 -0
  2002. package/dist/src/ui/utils/mouse.js.map +1 -0
  2003. package/dist/src/ui/utils/mouse.test.d.ts +6 -0
  2004. package/dist/src/ui/utils/mouse.test.js +136 -0
  2005. package/dist/src/ui/utils/mouse.test.js.map +1 -0
  2006. package/dist/src/ui/utils/rewindFileOps.d.ts +47 -0
  2007. package/dist/src/ui/utils/rewindFileOps.js +190 -0
  2008. package/dist/src/ui/utils/rewindFileOps.js.map +1 -0
  2009. package/dist/src/ui/utils/rewindFileOps.test.d.ts +6 -0
  2010. package/dist/src/ui/utils/rewindFileOps.test.js +375 -0
  2011. package/dist/src/ui/utils/rewindFileOps.test.js.map +1 -0
  2012. package/dist/src/ui/utils/terminalCapabilityManager.d.ts +40 -0
  2013. package/dist/src/ui/utils/terminalCapabilityManager.js +203 -0
  2014. package/dist/src/ui/utils/terminalCapabilityManager.js.map +1 -0
  2015. package/dist/src/ui/utils/terminalCapabilityManager.test.d.ts +6 -0
  2016. package/dist/src/ui/utils/terminalCapabilityManager.test.js +220 -0
  2017. package/dist/src/ui/utils/terminalCapabilityManager.test.js.map +1 -0
  2018. package/dist/src/ui/utils/terminalSetup.d.ts +34 -0
  2019. package/dist/src/ui/utils/terminalSetup.js +305 -0
  2020. package/dist/src/ui/utils/terminalSetup.js.map +1 -0
  2021. package/dist/src/ui/utils/terminalSetup.test.d.ts +6 -0
  2022. package/dist/src/ui/utils/terminalSetup.test.js +147 -0
  2023. package/dist/src/ui/utils/terminalSetup.test.js.map +1 -0
  2024. package/dist/src/ui/utils/terminalUtils.d.ts +23 -0
  2025. package/dist/src/ui/utils/terminalUtils.js +40 -0
  2026. package/dist/src/ui/utils/terminalUtils.js.map +1 -0
  2027. package/dist/src/ui/utils/terminalUtils.test.d.ts +6 -0
  2028. package/dist/src/ui/utils/terminalUtils.test.js +40 -0
  2029. package/dist/src/ui/utils/terminalUtils.test.js.map +1 -0
  2030. package/dist/src/ui/utils/textOutput.d.ts +27 -0
  2031. package/dist/src/ui/utils/textOutput.js +53 -0
  2032. package/dist/src/ui/utils/textOutput.js.map +1 -0
  2033. package/dist/src/ui/utils/textOutput.test.d.ts +6 -0
  2034. package/dist/src/ui/utils/textOutput.test.js +79 -0
  2035. package/dist/src/ui/utils/textOutput.test.js.map +1 -0
  2036. package/dist/src/ui/utils/textUtils.d.ts +47 -0
  2037. package/dist/src/ui/utils/textUtils.js +213 -0
  2038. package/dist/src/ui/utils/textUtils.js.map +1 -0
  2039. package/dist/src/ui/utils/textUtils.test.d.ts +6 -0
  2040. package/dist/src/ui/utils/textUtils.test.js +168 -0
  2041. package/dist/src/ui/utils/textUtils.test.js.map +1 -0
  2042. package/dist/src/ui/utils/ui-sizing.d.ts +7 -0
  2043. package/dist/src/ui/utils/ui-sizing.js +14 -0
  2044. package/dist/src/ui/utils/ui-sizing.js.map +1 -0
  2045. package/dist/src/ui/utils/ui-sizing.test.d.ts +6 -0
  2046. package/dist/src/ui/utils/ui-sizing.test.js +38 -0
  2047. package/dist/src/ui/utils/ui-sizing.test.js.map +1 -0
  2048. package/dist/src/ui/utils/updateCheck.d.ts +19 -0
  2049. package/dist/src/ui/utils/updateCheck.js +86 -0
  2050. package/dist/src/ui/utils/updateCheck.js.map +1 -0
  2051. package/dist/src/ui/utils/updateCheck.test.d.ts +6 -0
  2052. package/dist/src/ui/utils/updateCheck.test.js +134 -0
  2053. package/dist/src/ui/utils/updateCheck.test.js.map +1 -0
  2054. package/dist/src/utils/activityLogger.d.ts +47 -0
  2055. package/dist/src/utils/activityLogger.js +297 -0
  2056. package/dist/src/utils/activityLogger.js.map +1 -0
  2057. package/dist/src/utils/agentSettings.d.ts +31 -0
  2058. package/dist/src/utils/agentSettings.js +102 -0
  2059. package/dist/src/utils/agentSettings.js.map +1 -0
  2060. package/dist/src/utils/agentUtils.d.ts +15 -0
  2061. package/dist/src/utils/agentUtils.js +50 -0
  2062. package/dist/src/utils/agentUtils.js.map +1 -0
  2063. package/dist/src/utils/agentUtils.test.d.ts +6 -0
  2064. package/dist/src/utils/agentUtils.test.js +121 -0
  2065. package/dist/src/utils/agentUtils.test.js.map +1 -0
  2066. package/dist/src/utils/checks.d.ts +19 -0
  2067. package/dist/src/utils/checks.js +24 -0
  2068. package/dist/src/utils/checks.js.map +1 -0
  2069. package/dist/src/utils/checks.test.d.ts +6 -0
  2070. package/dist/src/utils/checks.test.js +29 -0
  2071. package/dist/src/utils/checks.test.js.map +1 -0
  2072. package/dist/src/utils/cleanup.d.ts +21 -0
  2073. package/dist/src/utils/cleanup.js +101 -0
  2074. package/dist/src/utils/cleanup.js.map +1 -0
  2075. package/dist/src/utils/cleanup.test.d.ts +6 -0
  2076. package/dist/src/utils/cleanup.test.js +92 -0
  2077. package/dist/src/utils/cleanup.test.js.map +1 -0
  2078. package/dist/src/utils/commands.d.ts +20 -0
  2079. package/dist/src/utils/commands.js +53 -0
  2080. package/dist/src/utils/commands.js.map +1 -0
  2081. package/dist/src/utils/commands.test.d.ts +6 -0
  2082. package/dist/src/utils/commands.test.js +115 -0
  2083. package/dist/src/utils/commands.test.js.map +1 -0
  2084. package/dist/src/utils/commentJson.d.ts +9 -0
  2085. package/dist/src/utils/commentJson.js +130 -0
  2086. package/dist/src/utils/commentJson.js.map +1 -0
  2087. package/dist/src/utils/commentJson.test.d.ts +6 -0
  2088. package/dist/src/utils/commentJson.test.js +308 -0
  2089. package/dist/src/utils/commentJson.test.js.map +1 -0
  2090. package/dist/src/utils/deepMerge.d.ts +9 -0
  2091. package/dist/src/utils/deepMerge.js +63 -0
  2092. package/dist/src/utils/deepMerge.js.map +1 -0
  2093. package/dist/src/utils/deepMerge.test.d.ts +6 -0
  2094. package/dist/src/utils/deepMerge.test.js +201 -0
  2095. package/dist/src/utils/deepMerge.test.js.map +1 -0
  2096. package/dist/src/utils/dialogScopeUtils.d.ts +25 -0
  2097. package/dist/src/utils/dialogScopeUtils.js +50 -0
  2098. package/dist/src/utils/dialogScopeUtils.js.map +1 -0
  2099. package/dist/src/utils/dialogScopeUtils.test.d.ts +6 -0
  2100. package/dist/src/utils/dialogScopeUtils.test.js +81 -0
  2101. package/dist/src/utils/dialogScopeUtils.test.js.map +1 -0
  2102. package/dist/src/utils/envVarResolver.d.ts +39 -0
  2103. package/dist/src/utils/envVarResolver.js +100 -0
  2104. package/dist/src/utils/envVarResolver.js.map +1 -0
  2105. package/dist/src/utils/envVarResolver.test.d.ts +6 -0
  2106. package/dist/src/utils/envVarResolver.test.js +221 -0
  2107. package/dist/src/utils/envVarResolver.test.js.map +1 -0
  2108. package/dist/src/utils/errors.d.ts +33 -0
  2109. package/dist/src/utils/errors.js +185 -0
  2110. package/dist/src/utils/errors.js.map +1 -0
  2111. package/dist/src/utils/errors.test.d.ts +6 -0
  2112. package/dist/src/utils/errors.test.js +435 -0
  2113. package/dist/src/utils/errors.test.js.map +1 -0
  2114. package/dist/src/utils/events.d.ts +19 -0
  2115. package/dist/src/utils/events.js +15 -0
  2116. package/dist/src/utils/events.js.map +1 -0
  2117. package/dist/src/utils/events.test.d.ts +6 -0
  2118. package/dist/src/utils/events.test.js +24 -0
  2119. package/dist/src/utils/events.test.js.map +1 -0
  2120. package/dist/src/utils/gitUtils.d.ts +30 -0
  2121. package/dist/src/utils/gitUtils.js +90 -0
  2122. package/dist/src/utils/gitUtils.js.map +1 -0
  2123. package/dist/src/utils/gitUtils.test.d.ts +6 -0
  2124. package/dist/src/utils/gitUtils.test.js +113 -0
  2125. package/dist/src/utils/gitUtils.test.js.map +1 -0
  2126. package/dist/src/utils/handleAutoUpdate.d.ts +11 -0
  2127. package/dist/src/utils/handleAutoUpdate.js +113 -0
  2128. package/dist/src/utils/handleAutoUpdate.js.map +1 -0
  2129. package/dist/src/utils/handleAutoUpdate.test.d.ts +6 -0
  2130. package/dist/src/utils/handleAutoUpdate.test.js +310 -0
  2131. package/dist/src/utils/handleAutoUpdate.test.js.map +1 -0
  2132. package/dist/src/utils/installationInfo.d.ts +24 -0
  2133. package/dist/src/utils/installationInfo.js +163 -0
  2134. package/dist/src/utils/installationInfo.js.map +1 -0
  2135. package/dist/src/utils/installationInfo.test.d.ts +6 -0
  2136. package/dist/src/utils/installationInfo.test.js +296 -0
  2137. package/dist/src/utils/installationInfo.test.js.map +1 -0
  2138. package/dist/src/utils/jsonoutput.d.ts +7 -0
  2139. package/dist/src/utils/jsonoutput.js +42 -0
  2140. package/dist/src/utils/jsonoutput.js.map +1 -0
  2141. package/dist/src/utils/jsonoutput.test.d.ts +6 -0
  2142. package/dist/src/utils/jsonoutput.test.js +74 -0
  2143. package/dist/src/utils/jsonoutput.test.js.map +1 -0
  2144. package/dist/src/utils/math.d.ts +13 -0
  2145. package/dist/src/utils/math.js +14 -0
  2146. package/dist/src/utils/math.js.map +1 -0
  2147. package/dist/src/utils/math.test.d.ts +6 -0
  2148. package/dist/src/utils/math.test.js +23 -0
  2149. package/dist/src/utils/math.test.js.map +1 -0
  2150. package/dist/src/utils/persistentState.d.ts +21 -0
  2151. package/dist/src/utils/persistentState.js +65 -0
  2152. package/dist/src/utils/persistentState.js.map +1 -0
  2153. package/dist/src/utils/persistentState.test.d.ts +6 -0
  2154. package/dist/src/utils/persistentState.test.js +68 -0
  2155. package/dist/src/utils/persistentState.test.js.map +1 -0
  2156. package/dist/src/utils/processUtils.d.ts +13 -0
  2157. package/dist/src/utils/processUtils.js +18 -0
  2158. package/dist/src/utils/processUtils.js.map +1 -0
  2159. package/dist/src/utils/processUtils.test.d.ts +6 -0
  2160. package/dist/src/utils/processUtils.test.js +20 -0
  2161. package/dist/src/utils/processUtils.test.js.map +1 -0
  2162. package/dist/src/utils/readStdin.d.ts +6 -0
  2163. package/dist/src/utils/readStdin.js +68 -0
  2164. package/dist/src/utils/readStdin.js.map +1 -0
  2165. package/dist/src/utils/readStdin.test.d.ts +6 -0
  2166. package/dist/src/utils/readStdin.test.js +117 -0
  2167. package/dist/src/utils/readStdin.test.js.map +1 -0
  2168. package/dist/src/utils/readStdin_safety.test.d.ts +6 -0
  2169. package/dist/src/utils/readStdin_safety.test.js +68 -0
  2170. package/dist/src/utils/readStdin_safety.test.js.map +1 -0
  2171. package/dist/src/utils/relaunch.d.ts +8 -0
  2172. package/dist/src/utils/relaunch.js +62 -0
  2173. package/dist/src/utils/relaunch.js.map +1 -0
  2174. package/dist/src/utils/relaunch.test.d.ts +6 -0
  2175. package/dist/src/utils/relaunch.test.js +279 -0
  2176. package/dist/src/utils/relaunch.test.js.map +1 -0
  2177. package/dist/src/utils/resolvePath.d.ts +6 -0
  2178. package/dist/src/utils/resolvePath.js +21 -0
  2179. package/dist/src/utils/resolvePath.js.map +1 -0
  2180. package/dist/src/utils/resolvePath.test.d.ts +6 -0
  2181. package/dist/src/utils/resolvePath.test.js +34 -0
  2182. package/dist/src/utils/resolvePath.test.js.map +1 -0
  2183. package/dist/src/utils/sandbox-macos-permissive-closed.sb +32 -0
  2184. package/dist/src/utils/sandbox-macos-permissive-open.sb +27 -0
  2185. package/dist/src/utils/sandbox-macos-permissive-proxied.sb +37 -0
  2186. package/dist/src/utils/sandbox-macos-restrictive-closed.sb +93 -0
  2187. package/dist/src/utils/sandbox-macos-restrictive-open.sb +96 -0
  2188. package/dist/src/utils/sandbox-macos-restrictive-proxied.sb +98 -0
  2189. package/dist/src/utils/sandbox.d.ts +7 -0
  2190. package/dist/src/utils/sandbox.js +626 -0
  2191. package/dist/src/utils/sandbox.js.map +1 -0
  2192. package/dist/src/utils/sandbox.test.d.ts +6 -0
  2193. package/dist/src/utils/sandbox.test.js +314 -0
  2194. package/dist/src/utils/sandbox.test.js.map +1 -0
  2195. package/dist/src/utils/sandboxUtils.d.ts +14 -0
  2196. package/dist/src/utils/sandboxUtils.js +121 -0
  2197. package/dist/src/utils/sandboxUtils.js.map +1 -0
  2198. package/dist/src/utils/sandboxUtils.test.d.ts +6 -0
  2199. package/dist/src/utils/sandboxUtils.test.js +122 -0
  2200. package/dist/src/utils/sandboxUtils.test.js.map +1 -0
  2201. package/dist/src/utils/sessionCleanup.d.ts +22 -0
  2202. package/dist/src/utils/sessionCleanup.integration.test.d.ts +6 -0
  2203. package/dist/src/utils/sessionCleanup.integration.test.js +182 -0
  2204. package/dist/src/utils/sessionCleanup.integration.test.js.map +1 -0
  2205. package/dist/src/utils/sessionCleanup.js +226 -0
  2206. package/dist/src/utils/sessionCleanup.js.map +1 -0
  2207. package/dist/src/utils/sessionCleanup.test.d.ts +6 -0
  2208. package/dist/src/utils/sessionCleanup.test.js +1298 -0
  2209. package/dist/src/utils/sessionCleanup.test.js.map +1 -0
  2210. package/dist/src/utils/sessionUtils.d.ts +170 -0
  2211. package/dist/src/utils/sessionUtils.js +334 -0
  2212. package/dist/src/utils/sessionUtils.js.map +1 -0
  2213. package/dist/src/utils/sessionUtils.test.d.ts +6 -0
  2214. package/dist/src/utils/sessionUtils.test.js +503 -0
  2215. package/dist/src/utils/sessionUtils.test.js.map +1 -0
  2216. package/dist/src/utils/sessions.d.ts +8 -0
  2217. package/dist/src/utils/sessions.js +69 -0
  2218. package/dist/src/utils/sessions.js.map +1 -0
  2219. package/dist/src/utils/sessions.test.d.ts +6 -0
  2220. package/dist/src/utils/sessions.test.js +581 -0
  2221. package/dist/src/utils/sessions.test.js.map +1 -0
  2222. package/dist/src/utils/settingsUtils.d.ts +151 -0
  2223. package/dist/src/utils/settingsUtils.js +352 -0
  2224. package/dist/src/utils/settingsUtils.js.map +1 -0
  2225. package/dist/src/utils/settingsUtils.test.d.ts +6 -0
  2226. package/dist/src/utils/settingsUtils.test.js +808 -0
  2227. package/dist/src/utils/settingsUtils.test.js.map +1 -0
  2228. package/dist/src/utils/skillSettings.d.ts +33 -0
  2229. package/dist/src/utils/skillSettings.js +101 -0
  2230. package/dist/src/utils/skillSettings.js.map +1 -0
  2231. package/dist/src/utils/skillUtils.d.ts +30 -0
  2232. package/dist/src/utils/skillUtils.js +146 -0
  2233. package/dist/src/utils/skillUtils.js.map +1 -0
  2234. package/dist/src/utils/skillUtils.test.d.ts +6 -0
  2235. package/dist/src/utils/skillUtils.test.js +70 -0
  2236. package/dist/src/utils/skillUtils.test.js.map +1 -0
  2237. package/dist/src/utils/spawnWrapper.d.ts +7 -0
  2238. package/dist/src/utils/spawnWrapper.js +8 -0
  2239. package/dist/src/utils/spawnWrapper.js.map +1 -0
  2240. package/dist/src/utils/startupWarnings.d.ts +6 -0
  2241. package/dist/src/utils/startupWarnings.js +40 -0
  2242. package/dist/src/utils/startupWarnings.js.map +1 -0
  2243. package/dist/src/utils/startupWarnings.test.d.ts +6 -0
  2244. package/dist/src/utils/startupWarnings.test.js +61 -0
  2245. package/dist/src/utils/startupWarnings.test.js.map +1 -0
  2246. package/dist/src/utils/terminalTheme.d.ts +15 -0
  2247. package/dist/src/utils/terminalTheme.js +50 -0
  2248. package/dist/src/utils/terminalTheme.js.map +1 -0
  2249. package/dist/src/utils/updateEventEmitter.d.ts +11 -0
  2250. package/dist/src/utils/updateEventEmitter.js +12 -0
  2251. package/dist/src/utils/updateEventEmitter.js.map +1 -0
  2252. package/dist/src/utils/updateEventEmitter.test.d.ts +6 -0
  2253. package/dist/src/utils/updateEventEmitter.test.js +18 -0
  2254. package/dist/src/utils/updateEventEmitter.test.js.map +1 -0
  2255. package/dist/src/utils/userStartupWarnings.d.ts +7 -0
  2256. package/dist/src/utils/userStartupWarnings.js +64 -0
  2257. package/dist/src/utils/userStartupWarnings.js.map +1 -0
  2258. package/dist/src/utils/userStartupWarnings.test.d.ts +6 -0
  2259. package/dist/src/utils/userStartupWarnings.test.js +98 -0
  2260. package/dist/src/utils/userStartupWarnings.test.js.map +1 -0
  2261. package/dist/src/utils/windowTitle.d.ts +22 -0
  2262. package/dist/src/utils/windowTitle.js +84 -0
  2263. package/dist/src/utils/windowTitle.js.map +1 -0
  2264. package/dist/src/utils/windowTitle.test.d.ts +6 -0
  2265. package/dist/src/utils/windowTitle.test.js +216 -0
  2266. package/dist/src/utils/windowTitle.test.js.map +1 -0
  2267. package/dist/src/validateNonInterActiveAuth.d.ts +9 -0
  2268. package/dist/src/validateNonInterActiveAuth.js +58 -0
  2269. package/dist/src/validateNonInterActiveAuth.js.map +1 -0
  2270. package/dist/src/validateNonInterActiveAuth.test.d.ts +6 -0
  2271. package/dist/src/validateNonInterActiveAuth.test.js +319 -0
  2272. package/dist/src/validateNonInterActiveAuth.test.js.map +1 -0
  2273. package/dist/src/zed-integration/fileSystemService.d.ts +19 -0
  2274. package/dist/src/zed-integration/fileSystemService.js +41 -0
  2275. package/dist/src/zed-integration/fileSystemService.js.map +1 -0
  2276. package/dist/src/zed-integration/fileSystemService.test.d.ts +6 -0
  2277. package/dist/src/zed-integration/fileSystemService.test.js +88 -0
  2278. package/dist/src/zed-integration/fileSystemService.test.js.map +1 -0
  2279. package/dist/src/zed-integration/zedIntegration.d.ts +39 -0
  2280. package/dist/src/zed-integration/zedIntegration.js +774 -0
  2281. package/dist/src/zed-integration/zedIntegration.js.map +1 -0
  2282. package/dist/src/zed-integration/zedIntegration.test.d.ts +6 -0
  2283. package/dist/src/zed-integration/zedIntegration.test.js +625 -0
  2284. package/dist/src/zed-integration/zedIntegration.test.js.map +1 -0
  2285. package/dist/tsconfig.tsbuildinfo +1 -0
  2286. package/package.json +97 -0
@@ -0,0 +1,2292 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { spawnSync } from 'node:child_process';
7
+ import fs from 'node:fs';
8
+ import os from 'node:os';
9
+ import pathMod from 'node:path';
10
+ import * as path from 'node:path';
11
+ import { useState, useCallback, useEffect, useMemo, useReducer } from 'react';
12
+ import { LRUCache } from 'mnemonist';
13
+ import { coreEvents, CoreEvent, debugLogger, unescapePath, getEditorCommand, isGuiEditor, } from '@didim365/agent-cli-core';
14
+ import { toCodePoints, cpLen, cpSlice, stripUnsafeCharacters, getCachedStringWidth, } from '../../utils/textUtils.js';
15
+ import { parsePastedPaths } from '../../utils/clipboardUtils.js';
16
+ import { keyMatchers, Command } from '../../keyMatchers.js';
17
+ import { handleVimAction } from './vim-buffer-actions.js';
18
+ import { LRU_BUFFER_PERF_CACHE_LIMIT } from '../../constants.js';
19
+ const LARGE_PASTE_LINE_THRESHOLD = 5;
20
+ const LARGE_PASTE_CHAR_THRESHOLD = 500;
21
+ // Regex to match paste placeholders like [Pasted Text: 6 lines] or [Pasted Text: 501 chars #2]
22
+ export const PASTED_TEXT_PLACEHOLDER_REGEX = /\[Pasted Text: \d+ (?:lines|chars)(?: #\d+)?\]/g;
23
+ // Helper functions for line-based word navigation
24
+ export const isWordCharStrict = (char) => /[\w\p{L}\p{N}]/u.test(char); // Matches a single character that is any Unicode letter, any Unicode number, or an underscore
25
+ export const isWhitespace = (char) => /\s/.test(char);
26
+ // Check if a character is a combining mark (only diacritics for now)
27
+ export const isCombiningMark = (char) => /\p{M}/u.test(char);
28
+ // Check if a character should be considered part of a word (including combining marks)
29
+ export const isWordCharWithCombining = (char) => isWordCharStrict(char) || isCombiningMark(char);
30
+ // Get the script of a character (simplified for common scripts)
31
+ export const getCharScript = (char) => {
32
+ if (/[\p{Script=Latin}]/u.test(char))
33
+ return 'latin'; // All Latin script chars including diacritics
34
+ if (/[\p{Script=Han}]/u.test(char))
35
+ return 'han'; // Chinese
36
+ if (/[\p{Script=Arabic}]/u.test(char))
37
+ return 'arabic';
38
+ if (/[\p{Script=Hiragana}]/u.test(char))
39
+ return 'hiragana';
40
+ if (/[\p{Script=Katakana}]/u.test(char))
41
+ return 'katakana';
42
+ if (/[\p{Script=Cyrillic}]/u.test(char))
43
+ return 'cyrillic';
44
+ return 'other';
45
+ };
46
+ // Check if two characters are from different scripts (indicating word boundary)
47
+ export const isDifferentScript = (char1, char2) => {
48
+ if (!isWordCharStrict(char1) || !isWordCharStrict(char2))
49
+ return false;
50
+ return getCharScript(char1) !== getCharScript(char2);
51
+ };
52
+ // Find next word start within a line, starting from col
53
+ export const findNextWordStartInLine = (line, col) => {
54
+ const chars = toCodePoints(line);
55
+ let i = col;
56
+ if (i >= chars.length)
57
+ return null;
58
+ const currentChar = chars[i];
59
+ // Skip current word/sequence based on character type
60
+ if (isWordCharStrict(currentChar)) {
61
+ while (i < chars.length && isWordCharWithCombining(chars[i])) {
62
+ // Check for script boundary - if next character is from different script, stop here
63
+ if (i + 1 < chars.length &&
64
+ isWordCharStrict(chars[i + 1]) &&
65
+ isDifferentScript(chars[i], chars[i + 1])) {
66
+ i++; // Include current character
67
+ break; // Stop at script boundary
68
+ }
69
+ i++;
70
+ }
71
+ }
72
+ else if (!isWhitespace(currentChar)) {
73
+ while (i < chars.length &&
74
+ !isWordCharStrict(chars[i]) &&
75
+ !isWhitespace(chars[i])) {
76
+ i++;
77
+ }
78
+ }
79
+ // Skip whitespace
80
+ while (i < chars.length && isWhitespace(chars[i])) {
81
+ i++;
82
+ }
83
+ return i < chars.length ? i : null;
84
+ };
85
+ // Find previous word start within a line
86
+ export const findPrevWordStartInLine = (line, col) => {
87
+ const chars = toCodePoints(line);
88
+ let i = col;
89
+ if (i <= 0)
90
+ return null;
91
+ i--;
92
+ // Skip whitespace moving backwards
93
+ while (i >= 0 && isWhitespace(chars[i])) {
94
+ i--;
95
+ }
96
+ if (i < 0)
97
+ return null;
98
+ if (isWordCharStrict(chars[i])) {
99
+ // We're in a word, move to its beginning
100
+ while (i >= 0 && isWordCharStrict(chars[i])) {
101
+ // Check for script boundary - if previous character is from different script, stop here
102
+ if (i - 1 >= 0 &&
103
+ isWordCharStrict(chars[i - 1]) &&
104
+ isDifferentScript(chars[i], chars[i - 1])) {
105
+ return i; // Return current position at script boundary
106
+ }
107
+ i--;
108
+ }
109
+ return i + 1;
110
+ }
111
+ else {
112
+ // We're in punctuation, move to its beginning
113
+ while (i >= 0 && !isWordCharStrict(chars[i]) && !isWhitespace(chars[i])) {
114
+ i--;
115
+ }
116
+ return i + 1;
117
+ }
118
+ };
119
+ // Find word end within a line
120
+ export const findWordEndInLine = (line, col) => {
121
+ const chars = toCodePoints(line);
122
+ let i = col;
123
+ // If we're already at the end of a word (including punctuation sequences), advance to next word
124
+ // This includes both regular word endings and script boundaries
125
+ const atEndOfWordChar = i < chars.length &&
126
+ isWordCharWithCombining(chars[i]) &&
127
+ (i + 1 >= chars.length ||
128
+ !isWordCharWithCombining(chars[i + 1]) ||
129
+ (isWordCharStrict(chars[i]) &&
130
+ i + 1 < chars.length &&
131
+ isWordCharStrict(chars[i + 1]) &&
132
+ isDifferentScript(chars[i], chars[i + 1])));
133
+ const atEndOfPunctuation = i < chars.length &&
134
+ !isWordCharWithCombining(chars[i]) &&
135
+ !isWhitespace(chars[i]) &&
136
+ (i + 1 >= chars.length ||
137
+ isWhitespace(chars[i + 1]) ||
138
+ isWordCharWithCombining(chars[i + 1]));
139
+ if (atEndOfWordChar || atEndOfPunctuation) {
140
+ // We're at the end of a word or punctuation sequence, move forward to find next word
141
+ i++;
142
+ // Skip whitespace to find next word or punctuation
143
+ while (i < chars.length && isWhitespace(chars[i])) {
144
+ i++;
145
+ }
146
+ }
147
+ // If we're not on a word character, find the next word or punctuation sequence
148
+ if (i < chars.length && !isWordCharWithCombining(chars[i])) {
149
+ // Skip whitespace to find next word or punctuation
150
+ while (i < chars.length && isWhitespace(chars[i])) {
151
+ i++;
152
+ }
153
+ }
154
+ // Move to end of current word (including combining marks, but stop at script boundaries)
155
+ let foundWord = false;
156
+ let lastBaseCharPos = -1;
157
+ if (i < chars.length && isWordCharWithCombining(chars[i])) {
158
+ // Handle word characters
159
+ while (i < chars.length && isWordCharWithCombining(chars[i])) {
160
+ foundWord = true;
161
+ // Track the position of the last base character (not combining mark)
162
+ if (isWordCharStrict(chars[i])) {
163
+ lastBaseCharPos = i;
164
+ }
165
+ // Check if next character is from a different script (word boundary)
166
+ if (i + 1 < chars.length &&
167
+ isWordCharStrict(chars[i + 1]) &&
168
+ isDifferentScript(chars[i], chars[i + 1])) {
169
+ i++; // Include current character
170
+ if (isWordCharStrict(chars[i - 1])) {
171
+ lastBaseCharPos = i - 1;
172
+ }
173
+ break; // Stop at script boundary
174
+ }
175
+ i++;
176
+ }
177
+ }
178
+ else if (i < chars.length && !isWhitespace(chars[i])) {
179
+ // Handle punctuation sequences (like ████)
180
+ while (i < chars.length &&
181
+ !isWordCharStrict(chars[i]) &&
182
+ !isWhitespace(chars[i])) {
183
+ foundWord = true;
184
+ lastBaseCharPos = i;
185
+ i++;
186
+ }
187
+ }
188
+ // Only return a position if we actually found a word
189
+ // Return the position of the last base character, not combining marks
190
+ if (foundWord && lastBaseCharPos >= col) {
191
+ return lastBaseCharPos;
192
+ }
193
+ return null;
194
+ };
195
+ // Initialize segmenter for word boundary detection
196
+ const segmenter = new Intl.Segmenter(undefined, { granularity: 'word' });
197
+ function findPrevWordBoundary(line, cursorCol) {
198
+ const codePoints = toCodePoints(line);
199
+ // Convert cursorCol (CP index) to string index
200
+ const prefix = codePoints.slice(0, cursorCol).join('');
201
+ const cursorIdx = prefix.length;
202
+ let targetIdx = 0;
203
+ for (const seg of segmenter.segment(line)) {
204
+ // We want the last word start strictly before the cursor.
205
+ // If we've reached or passed the cursor, we stop.
206
+ if (seg.index >= cursorIdx)
207
+ break;
208
+ if (seg.isWordLike) {
209
+ targetIdx = seg.index;
210
+ }
211
+ }
212
+ return toCodePoints(line.slice(0, targetIdx)).length;
213
+ }
214
+ function findNextWordBoundary(line, cursorCol) {
215
+ const codePoints = toCodePoints(line);
216
+ const prefix = codePoints.slice(0, cursorCol).join('');
217
+ const cursorIdx = prefix.length;
218
+ let targetIdx = line.length;
219
+ for (const seg of segmenter.segment(line)) {
220
+ const segEnd = seg.index + seg.segment.length;
221
+ if (segEnd > cursorIdx) {
222
+ if (seg.isWordLike) {
223
+ targetIdx = segEnd;
224
+ break;
225
+ }
226
+ }
227
+ }
228
+ return toCodePoints(line.slice(0, targetIdx)).length;
229
+ }
230
+ // Find next word across lines
231
+ export const findNextWordAcrossLines = (lines, cursorRow, cursorCol, searchForWordStart) => {
232
+ // First try current line
233
+ const currentLine = lines[cursorRow] || '';
234
+ const colInCurrentLine = searchForWordStart
235
+ ? findNextWordStartInLine(currentLine, cursorCol)
236
+ : findWordEndInLine(currentLine, cursorCol);
237
+ if (colInCurrentLine !== null) {
238
+ return { row: cursorRow, col: colInCurrentLine };
239
+ }
240
+ // Search subsequent lines
241
+ for (let row = cursorRow + 1; row < lines.length; row++) {
242
+ const line = lines[row] || '';
243
+ const chars = toCodePoints(line);
244
+ // For empty lines, if we haven't found any words yet, return the empty line
245
+ if (chars.length === 0) {
246
+ // Check if there are any words in remaining lines
247
+ let hasWordsInLaterLines = false;
248
+ for (let laterRow = row + 1; laterRow < lines.length; laterRow++) {
249
+ const laterLine = lines[laterRow] || '';
250
+ const laterChars = toCodePoints(laterLine);
251
+ let firstNonWhitespace = 0;
252
+ while (firstNonWhitespace < laterChars.length &&
253
+ isWhitespace(laterChars[firstNonWhitespace])) {
254
+ firstNonWhitespace++;
255
+ }
256
+ if (firstNonWhitespace < laterChars.length) {
257
+ hasWordsInLaterLines = true;
258
+ break;
259
+ }
260
+ }
261
+ // If no words in later lines, return the empty line
262
+ if (!hasWordsInLaterLines) {
263
+ return { row, col: 0 };
264
+ }
265
+ continue;
266
+ }
267
+ // Find first non-whitespace
268
+ let firstNonWhitespace = 0;
269
+ while (firstNonWhitespace < chars.length &&
270
+ isWhitespace(chars[firstNonWhitespace])) {
271
+ firstNonWhitespace++;
272
+ }
273
+ if (firstNonWhitespace < chars.length) {
274
+ if (searchForWordStart) {
275
+ return { row, col: firstNonWhitespace };
276
+ }
277
+ else {
278
+ // For word end, find the end of the first word
279
+ const endCol = findWordEndInLine(line, firstNonWhitespace);
280
+ if (endCol !== null) {
281
+ return { row, col: endCol };
282
+ }
283
+ }
284
+ }
285
+ }
286
+ return null;
287
+ };
288
+ // Find previous word across lines
289
+ export const findPrevWordAcrossLines = (lines, cursorRow, cursorCol) => {
290
+ // First try current line
291
+ const currentLine = lines[cursorRow] || '';
292
+ const colInCurrentLine = findPrevWordStartInLine(currentLine, cursorCol);
293
+ if (colInCurrentLine !== null) {
294
+ return { row: cursorRow, col: colInCurrentLine };
295
+ }
296
+ // Search previous lines
297
+ for (let row = cursorRow - 1; row >= 0; row--) {
298
+ const line = lines[row] || '';
299
+ const chars = toCodePoints(line);
300
+ if (chars.length === 0)
301
+ continue;
302
+ // Find last word start
303
+ let lastWordStart = chars.length;
304
+ while (lastWordStart > 0 && isWhitespace(chars[lastWordStart - 1])) {
305
+ lastWordStart--;
306
+ }
307
+ if (lastWordStart > 0) {
308
+ // Find start of this word
309
+ const wordStart = findPrevWordStartInLine(line, lastWordStart);
310
+ if (wordStart !== null) {
311
+ return { row, col: wordStart };
312
+ }
313
+ }
314
+ }
315
+ return null;
316
+ };
317
+ // Helper functions for vim line operations
318
+ export const getPositionFromOffsets = (startOffset, endOffset, lines) => {
319
+ let offset = 0;
320
+ let startRow = 0;
321
+ let startCol = 0;
322
+ let endRow = 0;
323
+ let endCol = 0;
324
+ // Find start position
325
+ for (let i = 0; i < lines.length; i++) {
326
+ const lineLength = lines[i].length + 1; // +1 for newline
327
+ if (offset + lineLength > startOffset) {
328
+ startRow = i;
329
+ startCol = startOffset - offset;
330
+ break;
331
+ }
332
+ offset += lineLength;
333
+ }
334
+ // Find end position
335
+ offset = 0;
336
+ for (let i = 0; i < lines.length; i++) {
337
+ const lineLength = lines[i].length + (i < lines.length - 1 ? 1 : 0); // +1 for newline except last line
338
+ if (offset + lineLength >= endOffset) {
339
+ endRow = i;
340
+ endCol = endOffset - offset;
341
+ break;
342
+ }
343
+ offset += lineLength;
344
+ }
345
+ return { startRow, startCol, endRow, endCol };
346
+ };
347
+ export const getLineRangeOffsets = (startRow, lineCount, lines) => {
348
+ let startOffset = 0;
349
+ // Calculate start offset
350
+ for (let i = 0; i < startRow; i++) {
351
+ startOffset += lines[i].length + 1; // +1 for newline
352
+ }
353
+ // Calculate end offset
354
+ let endOffset = startOffset;
355
+ for (let i = 0; i < lineCount; i++) {
356
+ const lineIndex = startRow + i;
357
+ if (lineIndex < lines.length) {
358
+ endOffset += lines[lineIndex].length;
359
+ if (lineIndex < lines.length - 1) {
360
+ endOffset += 1; // +1 for newline
361
+ }
362
+ }
363
+ }
364
+ return { startOffset, endOffset };
365
+ };
366
+ export const replaceRangeInternal = (state, startRow, startCol, endRow, endCol, text) => {
367
+ const currentLine = (row) => state.lines[row] || '';
368
+ const currentLineLen = (row) => cpLen(currentLine(row));
369
+ const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
370
+ if (startRow > endRow ||
371
+ (startRow === endRow && startCol > endCol) ||
372
+ startRow < 0 ||
373
+ startCol < 0 ||
374
+ endRow >= state.lines.length ||
375
+ (endRow < state.lines.length && endCol > currentLineLen(endRow))) {
376
+ return state; // Invalid range
377
+ }
378
+ const newLines = [...state.lines];
379
+ const sCol = clamp(startCol, 0, currentLineLen(startRow));
380
+ const eCol = clamp(endCol, 0, currentLineLen(endRow));
381
+ const prefix = cpSlice(currentLine(startRow), 0, sCol);
382
+ const suffix = cpSlice(currentLine(endRow), eCol);
383
+ const normalisedReplacement = text
384
+ .replace(/\r\n/g, '\n')
385
+ .replace(/\r/g, '\n');
386
+ const replacementParts = normalisedReplacement.split('\n');
387
+ // The combined first line of the new text
388
+ const firstLine = prefix + replacementParts[0];
389
+ if (replacementParts.length === 1) {
390
+ // No newlines in replacement: combine prefix, replacement, and suffix on one line.
391
+ newLines.splice(startRow, endRow - startRow + 1, firstLine + suffix);
392
+ }
393
+ else {
394
+ // Newlines in replacement: create new lines.
395
+ const lastLine = replacementParts[replacementParts.length - 1] + suffix;
396
+ const middleLines = replacementParts.slice(1, -1);
397
+ newLines.splice(startRow, endRow - startRow + 1, firstLine, ...middleLines, lastLine);
398
+ }
399
+ const finalCursorRow = startRow + replacementParts.length - 1;
400
+ const finalCursorCol = (replacementParts.length > 1 ? 0 : sCol) +
401
+ cpLen(replacementParts[replacementParts.length - 1]);
402
+ return {
403
+ ...state,
404
+ lines: newLines,
405
+ cursorRow: Math.min(Math.max(finalCursorRow, 0), newLines.length - 1),
406
+ cursorCol: Math.max(0, Math.min(finalCursorCol, cpLen(newLines[finalCursorRow] || ''))),
407
+ preferredCol: null,
408
+ };
409
+ };
410
+ function clamp(v, min, max) {
411
+ return v < min ? min : v > max ? max : v;
412
+ }
413
+ function calculateInitialCursorPosition(initialLines, offset) {
414
+ let remainingChars = offset;
415
+ let row = 0;
416
+ while (row < initialLines.length) {
417
+ const lineLength = cpLen(initialLines[row]);
418
+ // Add 1 for the newline character (except for the last line)
419
+ const totalCharsInLineAndNewline = lineLength + (row < initialLines.length - 1 ? 1 : 0);
420
+ if (remainingChars <= lineLength) {
421
+ // Cursor is on this line
422
+ return [row, remainingChars];
423
+ }
424
+ remainingChars -= totalCharsInLineAndNewline;
425
+ row++;
426
+ }
427
+ // Offset is beyond the text, place cursor at the end of the last line
428
+ if (initialLines.length > 0) {
429
+ const lastRow = initialLines.length - 1;
430
+ return [lastRow, cpLen(initialLines[lastRow])];
431
+ }
432
+ return [0, 0]; // Default for empty text
433
+ }
434
+ export function offsetToLogicalPos(text, offset) {
435
+ let row = 0;
436
+ let col = 0;
437
+ let currentOffset = 0;
438
+ if (offset === 0)
439
+ return [0, 0];
440
+ const lines = text.split('\n');
441
+ for (let i = 0; i < lines.length; i++) {
442
+ const line = lines[i];
443
+ const lineLength = cpLen(line);
444
+ const lineLengthWithNewline = lineLength + (i < lines.length - 1 ? 1 : 0);
445
+ if (offset <= currentOffset + lineLength) {
446
+ // Check against lineLength first
447
+ row = i;
448
+ col = offset - currentOffset;
449
+ return [row, col];
450
+ }
451
+ else if (offset <= currentOffset + lineLengthWithNewline) {
452
+ // Check if offset is the newline itself
453
+ row = i;
454
+ col = lineLength; // Position cursor at the end of the current line content
455
+ // If the offset IS the newline, and it's not the last line, advance to next line, col 0
456
+ if (offset === currentOffset + lineLengthWithNewline &&
457
+ i < lines.length - 1) {
458
+ return [i + 1, 0];
459
+ }
460
+ return [row, col]; // Otherwise, it's at the end of the current line content
461
+ }
462
+ currentOffset += lineLengthWithNewline;
463
+ }
464
+ // If offset is beyond the text length, place cursor at the end of the last line
465
+ // or [0,0] if text is empty
466
+ if (lines.length > 0) {
467
+ row = lines.length - 1;
468
+ col = cpLen(lines[row]);
469
+ }
470
+ else {
471
+ row = 0;
472
+ col = 0;
473
+ }
474
+ return [row, col];
475
+ }
476
+ /**
477
+ * Converts logical row/col position to absolute text offset
478
+ * Inverse operation of offsetToLogicalPos
479
+ */
480
+ export function logicalPosToOffset(lines, row, col) {
481
+ let offset = 0;
482
+ // Clamp row to valid range
483
+ const actualRow = Math.min(row, lines.length - 1);
484
+ // Add lengths of all lines before the target row
485
+ for (let i = 0; i < actualRow; i++) {
486
+ offset += cpLen(lines[i]) + 1; // +1 for newline
487
+ }
488
+ // Add column offset within the target row
489
+ if (actualRow >= 0 && actualRow < lines.length) {
490
+ offset += Math.min(col, cpLen(lines[actualRow]));
491
+ }
492
+ return offset;
493
+ }
494
+ export const imagePathRegex = /@((?:\\.|[^\s\r\n\\])+?\.(?:png|jpg|jpeg|gif|webp|svg|bmp))\b/gi;
495
+ export function getTransformedImagePath(filePath) {
496
+ const raw = filePath;
497
+ // Ignore leading @ when stripping directories, but keep it for simple '@file.png'
498
+ const withoutAt = raw.startsWith('@') ? raw.slice(1) : raw;
499
+ // Unescape the path to handle escaped spaces and other characters
500
+ const unescaped = unescapePath(withoutAt);
501
+ // Find last directory separator, supporting both POSIX and Windows styles
502
+ const lastSepIndex = Math.max(unescaped.lastIndexOf('/'), unescaped.lastIndexOf('\\'));
503
+ // If we saw a separator, take the segment after it; otherwise fall back to the unescaped string
504
+ const fileName = lastSepIndex >= 0 ? unescaped.slice(lastSepIndex + 1) : unescaped;
505
+ const extension = path.extname(fileName);
506
+ const baseName = path.basename(fileName, extension);
507
+ const maxBaseLength = 10;
508
+ const truncatedBase = baseName.length > maxBaseLength
509
+ ? `...${baseName.slice(-maxBaseLength)}`
510
+ : baseName;
511
+ return `[Image ${truncatedBase}${extension}]`;
512
+ }
513
+ const transformationsCache = new LRUCache(LRU_BUFFER_PERF_CACHE_LIMIT);
514
+ export function calculateTransformationsForLine(line) {
515
+ const cached = transformationsCache.get(line);
516
+ if (cached) {
517
+ return cached;
518
+ }
519
+ const transformations = [];
520
+ // 1. Detect image paths
521
+ imagePathRegex.lastIndex = 0;
522
+ let match;
523
+ while ((match = imagePathRegex.exec(line)) !== null) {
524
+ const logicalText = match[0];
525
+ const logStart = cpLen(line.substring(0, match.index));
526
+ const logEnd = logStart + cpLen(logicalText);
527
+ transformations.push({
528
+ logStart,
529
+ logEnd,
530
+ logicalText,
531
+ collapsedText: getTransformedImagePath(logicalText),
532
+ type: 'image',
533
+ });
534
+ }
535
+ // 2. Detect paste placeholders
536
+ const pasteRegex = new RegExp(PASTED_TEXT_PLACEHOLDER_REGEX.source, 'g');
537
+ while ((match = pasteRegex.exec(line)) !== null) {
538
+ const logicalText = match[0];
539
+ const logStart = cpLen(line.substring(0, match.index));
540
+ const logEnd = logStart + cpLen(logicalText);
541
+ transformations.push({
542
+ logStart,
543
+ logEnd,
544
+ logicalText,
545
+ collapsedText: logicalText,
546
+ type: 'paste',
547
+ id: logicalText,
548
+ });
549
+ }
550
+ // Sort transformations by logStart to maintain consistency
551
+ transformations.sort((a, b) => a.logStart - b.logStart);
552
+ transformationsCache.set(line, transformations);
553
+ return transformations;
554
+ }
555
+ export function calculateTransformations(lines) {
556
+ return lines.map((ln) => calculateTransformationsForLine(ln));
557
+ }
558
+ export function getTransformUnderCursor(row, col, spansByLine) {
559
+ const spans = spansByLine[row];
560
+ if (!spans || spans.length === 0)
561
+ return null;
562
+ for (const span of spans) {
563
+ if (col >= span.logStart && col <= span.logEnd) {
564
+ return span;
565
+ }
566
+ if (col < span.logStart)
567
+ break;
568
+ }
569
+ return null;
570
+ }
571
+ /**
572
+ * Check if a line index falls within an expanded paste region.
573
+ * Returns the paste placeholder ID if found, null otherwise.
574
+ */
575
+ export function getExpandedPasteAtLine(lineIndex, expandedPasteInfo) {
576
+ for (const [id, info] of expandedPasteInfo) {
577
+ if (lineIndex >= info.startLine &&
578
+ lineIndex < info.startLine + info.lineCount) {
579
+ return id;
580
+ }
581
+ }
582
+ return null;
583
+ }
584
+ /**
585
+ * Surgery for expanded paste regions when lines are added or removed.
586
+ * Adjusts startLine indices and detaches any region that is partially or fully deleted.
587
+ */
588
+ export function shiftExpandedRegions(expandedPasteInfo, changeStartLine, lineDelta, changeEndLine) {
589
+ const newInfo = new Map();
590
+ const detachedIds = new Set();
591
+ if (expandedPasteInfo.size === 0)
592
+ return { newInfo, detachedIds };
593
+ const effectiveEndLine = changeEndLine ?? changeStartLine;
594
+ for (const [id, info] of expandedPasteInfo) {
595
+ const infoEndLine = info.startLine + info.lineCount - 1;
596
+ // 1. Check for overlap/intersection with the changed range
597
+ const isOverlapping = changeStartLine <= infoEndLine && effectiveEndLine >= info.startLine;
598
+ if (isOverlapping) {
599
+ // If the change is a deletion (lineDelta < 0) that touches this region, we detach.
600
+ // If it's an insertion, we only detach if it's a multi-line insertion (lineDelta > 0)
601
+ // that isn't at the very start of the region (which would shift it).
602
+ // Regular character typing (lineDelta === 0) does NOT detach.
603
+ if (lineDelta < 0 ||
604
+ (lineDelta > 0 &&
605
+ changeStartLine > info.startLine &&
606
+ changeStartLine <= infoEndLine)) {
607
+ detachedIds.add(id);
608
+ continue; // Detach by not adding to newInfo
609
+ }
610
+ }
611
+ // 2. Shift regions that start at or after the change point
612
+ if (info.startLine >= changeStartLine) {
613
+ newInfo.set(id, {
614
+ ...info,
615
+ startLine: info.startLine + lineDelta,
616
+ });
617
+ }
618
+ else {
619
+ newInfo.set(id, info);
620
+ }
621
+ }
622
+ return { newInfo, detachedIds };
623
+ }
624
+ /**
625
+ * Detach any expanded paste region if the cursor is within it.
626
+ * This converts the expanded content to regular text that can no longer be collapsed.
627
+ * Returns the state unchanged if cursor is not in an expanded region.
628
+ */
629
+ export function detachExpandedPaste(state) {
630
+ const expandedId = getExpandedPasteAtLine(state.cursorRow, state.expandedPasteInfo);
631
+ if (!expandedId)
632
+ return state;
633
+ const newExpandedInfo = new Map(state.expandedPasteInfo);
634
+ newExpandedInfo.delete(expandedId);
635
+ const { [expandedId]: _, ...newPastedContent } = state.pastedContent;
636
+ return {
637
+ ...state,
638
+ expandedPasteInfo: newExpandedInfo,
639
+ pastedContent: newPastedContent,
640
+ };
641
+ }
642
+ /**
643
+ * Find atomic placeholder at cursor for backspace (cursor at end).
644
+ * Checks all placeholder types in priority order.
645
+ */
646
+ function findAtomicPlaceholderForBackspace(line, cursorCol, transformations) {
647
+ for (const transform of transformations) {
648
+ if (cursorCol === transform.logEnd) {
649
+ return {
650
+ start: transform.logStart,
651
+ end: transform.logEnd,
652
+ type: transform.type,
653
+ id: transform.id,
654
+ };
655
+ }
656
+ }
657
+ return null;
658
+ }
659
+ /**
660
+ * Find atomic placeholder at cursor for delete (cursor at start).
661
+ */
662
+ function findAtomicPlaceholderForDelete(line, cursorCol, transformations) {
663
+ for (const transform of transformations) {
664
+ if (cursorCol === transform.logStart) {
665
+ return {
666
+ start: transform.logStart,
667
+ end: transform.logEnd,
668
+ type: transform.type,
669
+ id: transform.id,
670
+ };
671
+ }
672
+ }
673
+ return null;
674
+ }
675
+ export function calculateTransformedLine(logLine, logIndex, logicalCursor, transformations) {
676
+ let transformedLine = '';
677
+ const transformedToLogMap = [];
678
+ let lastLogPos = 0;
679
+ const cursorIsOnThisLine = logIndex === logicalCursor[0];
680
+ const cursorCol = logicalCursor[1];
681
+ for (const transform of transformations) {
682
+ const textBeforeTransformation = cpSlice(logLine, lastLogPos, transform.logStart);
683
+ transformedLine += textBeforeTransformation;
684
+ for (let i = 0; i < cpLen(textBeforeTransformation); i++) {
685
+ transformedToLogMap.push(lastLogPos + i);
686
+ }
687
+ const isExpanded = transform.type === 'image' &&
688
+ cursorIsOnThisLine &&
689
+ cursorCol >= transform.logStart &&
690
+ cursorCol <= transform.logEnd;
691
+ const transformedText = isExpanded
692
+ ? transform.logicalText
693
+ : transform.collapsedText;
694
+ transformedLine += transformedText;
695
+ // Map transformed characters back to logical characters
696
+ const transformedLen = cpLen(transformedText);
697
+ if (isExpanded) {
698
+ for (let i = 0; i < transformedLen; i++) {
699
+ transformedToLogMap.push(transform.logStart + i);
700
+ }
701
+ }
702
+ else {
703
+ // Collapsed: distribute transformed positions monotonically across the raw span.
704
+ // This preserves ordering across wrapped slices so logicalToVisualMap has
705
+ // increasing startColInLogical and visual cursor mapping remains consistent.
706
+ const logicalLength = Math.max(0, transform.logEnd - transform.logStart);
707
+ for (let i = 0; i < transformedLen; i++) {
708
+ // Map the i-th transformed code point into [logStart, logEnd)
709
+ const transformationToLogicalOffset = logicalLength === 0
710
+ ? 0
711
+ : Math.floor((i * logicalLength) / transformedLen);
712
+ const transformationToLogicalIndex = transform.logStart +
713
+ Math.min(transformationToLogicalOffset, Math.max(logicalLength - 1, 0));
714
+ transformedToLogMap.push(transformationToLogicalIndex);
715
+ }
716
+ }
717
+ lastLogPos = transform.logEnd;
718
+ }
719
+ // Append text after last transform
720
+ const remainingUntransformedText = cpSlice(logLine, lastLogPos);
721
+ transformedLine += remainingUntransformedText;
722
+ for (let i = 0; i < cpLen(remainingUntransformedText); i++) {
723
+ transformedToLogMap.push(lastLogPos + i);
724
+ }
725
+ // For a cursor at the very end of the transformed line
726
+ transformedToLogMap.push(cpLen(logLine));
727
+ return { transformedLine, transformedToLogMap };
728
+ }
729
+ const lineLayoutCache = new LRUCache(LRU_BUFFER_PERF_CACHE_LIMIT);
730
+ function getLineLayoutCacheKey(line, viewportWidth, isCursorOnLine, cursorCol) {
731
+ // Most lines (99.9% in a large buffer) are not cursor lines.
732
+ // We use a simpler key for them to reduce string allocation overhead.
733
+ if (!isCursorOnLine) {
734
+ return `${viewportWidth}:N:${line}`;
735
+ }
736
+ return `${viewportWidth}:C:${cursorCol}:${line}`;
737
+ }
738
+ // Calculates the visual wrapping of lines and the mapping between logical and visual coordinates.
739
+ // This is an expensive operation and should be memoized.
740
+ function calculateLayout(logicalLines, viewportWidth, logicalCursor) {
741
+ const visualLines = [];
742
+ const logicalToVisualMap = [];
743
+ const visualToLogicalMap = [];
744
+ const transformedToLogicalMaps = [];
745
+ const visualToTransformedMap = [];
746
+ logicalLines.forEach((logLine, logIndex) => {
747
+ logicalToVisualMap[logIndex] = [];
748
+ const isCursorOnLine = logIndex === logicalCursor[0];
749
+ const cacheKey = getLineLayoutCacheKey(logLine, viewportWidth, isCursorOnLine, logicalCursor[1]);
750
+ const cached = lineLayoutCache.get(cacheKey);
751
+ if (cached) {
752
+ const visualLineOffset = visualLines.length;
753
+ visualLines.push(...cached.visualLines);
754
+ cached.logicalToVisualMap.forEach(([relVisualIdx, logCol]) => {
755
+ logicalToVisualMap[logIndex].push([
756
+ visualLineOffset + relVisualIdx,
757
+ logCol,
758
+ ]);
759
+ });
760
+ cached.visualToLogicalMap.forEach(([, logCol]) => {
761
+ visualToLogicalMap.push([logIndex, logCol]);
762
+ });
763
+ transformedToLogicalMaps[logIndex] = cached.transformedToLogMap;
764
+ visualToTransformedMap.push(...cached.visualToTransformedMap);
765
+ return;
766
+ }
767
+ // Not in cache, calculate
768
+ const transformations = calculateTransformationsForLine(logLine);
769
+ const { transformedLine, transformedToLogMap } = calculateTransformedLine(logLine, logIndex, logicalCursor, transformations);
770
+ const lineVisualLines = [];
771
+ const lineLogicalToVisualMap = [];
772
+ const lineVisualToLogicalMap = [];
773
+ const lineVisualToTransformedMap = [];
774
+ if (transformedLine.length === 0) {
775
+ // Handle empty logical line
776
+ lineLogicalToVisualMap.push([0, 0]);
777
+ lineVisualToLogicalMap.push([logIndex, 0]);
778
+ lineVisualToTransformedMap.push(0);
779
+ lineVisualLines.push('');
780
+ }
781
+ else {
782
+ // Non-empty logical line
783
+ let currentPosInLogLine = 0; // Tracks position within the current logical line (code point index)
784
+ const codePointsInLogLine = toCodePoints(transformedLine);
785
+ while (currentPosInLogLine < codePointsInLogLine.length) {
786
+ let currentChunk = '';
787
+ let currentChunkVisualWidth = 0;
788
+ let numCodePointsInChunk = 0;
789
+ let lastWordBreakPoint = -1; // Index in codePointsInLogLine for word break
790
+ let numCodePointsAtLastWordBreak = 0;
791
+ // Iterate through code points to build the current visual line (chunk)
792
+ for (let i = currentPosInLogLine; i < codePointsInLogLine.length; i++) {
793
+ const char = codePointsInLogLine[i];
794
+ const charVisualWidth = getCachedStringWidth(char);
795
+ if (currentChunkVisualWidth + charVisualWidth > viewportWidth) {
796
+ // Character would exceed viewport width
797
+ if (lastWordBreakPoint !== -1 &&
798
+ numCodePointsAtLastWordBreak > 0 &&
799
+ currentPosInLogLine + numCodePointsAtLastWordBreak < i) {
800
+ // We have a valid word break point to use, and it's not the start of the current segment
801
+ currentChunk = codePointsInLogLine
802
+ .slice(currentPosInLogLine, currentPosInLogLine + numCodePointsAtLastWordBreak)
803
+ .join('');
804
+ numCodePointsInChunk = numCodePointsAtLastWordBreak;
805
+ }
806
+ else {
807
+ // No word break, or word break is at the start of this potential chunk, or word break leads to empty chunk.
808
+ // Hard break: take characters up to viewportWidth, or just the current char if it alone is too wide.
809
+ if (numCodePointsInChunk === 0 &&
810
+ charVisualWidth > viewportWidth) {
811
+ // Single character is wider than viewport, take it anyway
812
+ currentChunk = char;
813
+ numCodePointsInChunk = 1;
814
+ }
815
+ }
816
+ break; // Break from inner loop to finalize this chunk
817
+ }
818
+ currentChunk += char;
819
+ currentChunkVisualWidth += charVisualWidth;
820
+ numCodePointsInChunk++;
821
+ // Check for word break opportunity (space)
822
+ if (char === ' ') {
823
+ lastWordBreakPoint = i; // Store code point index of the space
824
+ // Store the state *before* adding the space, if we decide to break here.
825
+ numCodePointsAtLastWordBreak = numCodePointsInChunk - 1; // Chars *before* the space
826
+ }
827
+ }
828
+ if (numCodePointsInChunk === 0 &&
829
+ currentPosInLogLine < codePointsInLogLine.length) {
830
+ const firstChar = codePointsInLogLine[currentPosInLogLine];
831
+ currentChunk = firstChar;
832
+ numCodePointsInChunk = 1;
833
+ }
834
+ const logicalStartCol = transformedToLogMap[currentPosInLogLine] ?? 0;
835
+ lineLogicalToVisualMap.push([lineVisualLines.length, logicalStartCol]);
836
+ lineVisualToLogicalMap.push([logIndex, logicalStartCol]);
837
+ lineVisualToTransformedMap.push(currentPosInLogLine);
838
+ lineVisualLines.push(currentChunk);
839
+ const logicalStartOfThisChunk = currentPosInLogLine;
840
+ currentPosInLogLine += numCodePointsInChunk;
841
+ if (logicalStartOfThisChunk + numCodePointsInChunk <
842
+ codePointsInLogLine.length &&
843
+ currentPosInLogLine < codePointsInLogLine.length &&
844
+ codePointsInLogLine[currentPosInLogLine] === ' ') {
845
+ currentPosInLogLine++;
846
+ }
847
+ }
848
+ }
849
+ // Cache the result for this line
850
+ lineLayoutCache.set(cacheKey, {
851
+ visualLines: lineVisualLines,
852
+ logicalToVisualMap: lineLogicalToVisualMap,
853
+ visualToLogicalMap: lineVisualToLogicalMap,
854
+ transformedToLogMap,
855
+ visualToTransformedMap: lineVisualToTransformedMap,
856
+ });
857
+ const visualLineOffset = visualLines.length;
858
+ visualLines.push(...lineVisualLines);
859
+ lineLogicalToVisualMap.forEach(([relVisualIdx, logCol]) => {
860
+ logicalToVisualMap[logIndex].push([
861
+ visualLineOffset + relVisualIdx,
862
+ logCol,
863
+ ]);
864
+ });
865
+ lineVisualToLogicalMap.forEach(([, logCol]) => {
866
+ visualToLogicalMap.push([logIndex, logCol]);
867
+ });
868
+ transformedToLogicalMaps[logIndex] = transformedToLogMap;
869
+ visualToTransformedMap.push(...lineVisualToTransformedMap);
870
+ });
871
+ // If the entire logical text was empty, ensure there's one empty visual line.
872
+ if (logicalLines.length === 0 ||
873
+ (logicalLines.length === 1 && logicalLines[0] === '')) {
874
+ if (visualLines.length === 0) {
875
+ visualLines.push('');
876
+ if (!logicalToVisualMap[0])
877
+ logicalToVisualMap[0] = [];
878
+ logicalToVisualMap[0].push([0, 0]);
879
+ visualToLogicalMap.push([0, 0]);
880
+ visualToTransformedMap.push(0);
881
+ }
882
+ }
883
+ return {
884
+ visualLines,
885
+ logicalToVisualMap,
886
+ visualToLogicalMap,
887
+ transformedToLogicalMaps,
888
+ visualToTransformedMap,
889
+ };
890
+ }
891
+ // Calculates the visual cursor position based on a pre-calculated layout.
892
+ // This is a lightweight operation.
893
+ function calculateVisualCursorFromLayout(layout, logicalCursor) {
894
+ const { logicalToVisualMap, visualLines, transformedToLogicalMaps } = layout;
895
+ const [logicalRow, logicalCol] = logicalCursor;
896
+ const segmentsForLogicalLine = logicalToVisualMap[logicalRow];
897
+ if (!segmentsForLogicalLine || segmentsForLogicalLine.length === 0) {
898
+ // This can happen for an empty document.
899
+ return [0, 0];
900
+ }
901
+ // Find the segment where the logical column fits.
902
+ // The segments are sorted by startColInLogical.
903
+ let targetSegmentIndex = segmentsForLogicalLine.findIndex(([, startColInLogical], index) => {
904
+ const nextStartColInLogical = index + 1 < segmentsForLogicalLine.length
905
+ ? segmentsForLogicalLine[index + 1][1]
906
+ : Infinity;
907
+ return (logicalCol >= startColInLogical && logicalCol < nextStartColInLogical);
908
+ });
909
+ // If not found, it means the cursor is at the end of the logical line.
910
+ if (targetSegmentIndex === -1) {
911
+ if (logicalCol === 0) {
912
+ targetSegmentIndex = 0;
913
+ }
914
+ else {
915
+ targetSegmentIndex = segmentsForLogicalLine.length - 1;
916
+ }
917
+ }
918
+ const [visualRow, startColInLogical] = segmentsForLogicalLine[targetSegmentIndex];
919
+ // Find the coordinates in transformed space in order to conver to visual
920
+ const transformedToLogicalMap = transformedToLogicalMaps[logicalRow] ?? [];
921
+ let transformedCol = 0;
922
+ for (let i = 0; i < transformedToLogicalMap.length; i++) {
923
+ if (transformedToLogicalMap[i] > logicalCol) {
924
+ transformedCol = Math.max(0, i - 1);
925
+ break;
926
+ }
927
+ if (i === transformedToLogicalMap.length - 1) {
928
+ transformedCol = transformedToLogicalMap.length - 1;
929
+ }
930
+ }
931
+ let startColInTransformed = 0;
932
+ while (startColInTransformed < transformedToLogicalMap.length &&
933
+ transformedToLogicalMap[startColInTransformed] < startColInLogical) {
934
+ startColInTransformed++;
935
+ }
936
+ const clampedTransformedCol = Math.min(transformedCol, Math.max(0, transformedToLogicalMap.length - 1));
937
+ const visualCol = clampedTransformedCol - startColInTransformed;
938
+ const clampedVisualCol = Math.min(Math.max(visualCol, 0), cpLen(visualLines[visualRow] ?? ''));
939
+ return [visualRow, clampedVisualCol];
940
+ }
941
+ const historyLimit = 100;
942
+ export const pushUndo = (currentState) => {
943
+ const snapshot = {
944
+ lines: [...currentState.lines],
945
+ cursorRow: currentState.cursorRow,
946
+ cursorCol: currentState.cursorCol,
947
+ pastedContent: { ...currentState.pastedContent },
948
+ expandedPasteInfo: new Map(currentState.expandedPasteInfo),
949
+ };
950
+ const newStack = [...currentState.undoStack, snapshot];
951
+ if (newStack.length > historyLimit) {
952
+ newStack.shift();
953
+ }
954
+ return { ...currentState, undoStack: newStack, redoStack: [] };
955
+ };
956
+ function generatePastedTextId(content, lineCount, pastedContent) {
957
+ const base = lineCount > LARGE_PASTE_LINE_THRESHOLD
958
+ ? `[Pasted Text: ${lineCount} lines]`
959
+ : `[Pasted Text: ${content.length} chars]`;
960
+ let id = base;
961
+ let suffix = 2;
962
+ while (pastedContent[id]) {
963
+ id = base.replace(']', ` #${suffix}]`);
964
+ suffix++;
965
+ }
966
+ return id;
967
+ }
968
+ function textBufferReducerLogic(state, action, options = {}) {
969
+ const pushUndoLocal = pushUndo;
970
+ const currentLine = (r) => state.lines[r] ?? '';
971
+ const currentLineLen = (r) => cpLen(currentLine(r));
972
+ switch (action.type) {
973
+ case 'set_text': {
974
+ let nextState = state;
975
+ if (action.pushToUndo !== false) {
976
+ nextState = pushUndoLocal(state);
977
+ }
978
+ const newContentLines = action.payload
979
+ .replace(/\r\n?/g, '\n')
980
+ .split('\n');
981
+ const lines = newContentLines.length === 0 ? [''] : newContentLines;
982
+ const lastNewLineIndex = lines.length - 1;
983
+ return {
984
+ ...nextState,
985
+ lines,
986
+ cursorRow: lastNewLineIndex,
987
+ cursorCol: cpLen(lines[lastNewLineIndex] ?? ''),
988
+ preferredCol: null,
989
+ pastedContent: action.payload === '' ? {} : nextState.pastedContent,
990
+ };
991
+ }
992
+ case 'insert': {
993
+ const nextState = detachExpandedPaste(pushUndoLocal(state));
994
+ const newLines = [...nextState.lines];
995
+ let newCursorRow = nextState.cursorRow;
996
+ let newCursorCol = nextState.cursorCol;
997
+ const currentLine = (r) => newLines[r] ?? '';
998
+ let payload = action.payload;
999
+ let newPastedContent = nextState.pastedContent;
1000
+ if (action.isPaste) {
1001
+ // Normalize line endings for pastes
1002
+ payload = payload.replace(/\r\n|\r/g, '\n');
1003
+ const lineCount = payload.split('\n').length;
1004
+ if (lineCount > LARGE_PASTE_LINE_THRESHOLD ||
1005
+ payload.length > LARGE_PASTE_CHAR_THRESHOLD) {
1006
+ const id = generatePastedTextId(payload, lineCount, newPastedContent);
1007
+ newPastedContent = {
1008
+ ...newPastedContent,
1009
+ [id]: payload,
1010
+ };
1011
+ payload = id;
1012
+ }
1013
+ }
1014
+ if (options.singleLine) {
1015
+ payload = payload.replace(/[\r\n]/g, '');
1016
+ }
1017
+ if (options.inputFilter) {
1018
+ payload = options.inputFilter(payload);
1019
+ }
1020
+ if (payload.length === 0) {
1021
+ return state;
1022
+ }
1023
+ const str = stripUnsafeCharacters(payload.replace(/\r\n/g, '\n').replace(/\r/g, '\n'));
1024
+ const parts = str.split('\n');
1025
+ const lineContent = currentLine(newCursorRow);
1026
+ const before = cpSlice(lineContent, 0, newCursorCol);
1027
+ const after = cpSlice(lineContent, newCursorCol);
1028
+ let lineDelta = 0;
1029
+ if (parts.length > 1) {
1030
+ newLines[newCursorRow] = before + parts[0];
1031
+ const remainingParts = parts.slice(1);
1032
+ const lastPartOriginal = remainingParts.pop() ?? '';
1033
+ newLines.splice(newCursorRow + 1, 0, ...remainingParts);
1034
+ newLines.splice(newCursorRow + parts.length - 1, 0, lastPartOriginal + after);
1035
+ lineDelta = parts.length - 1;
1036
+ newCursorRow = newCursorRow + parts.length - 1;
1037
+ newCursorCol = cpLen(lastPartOriginal);
1038
+ }
1039
+ else {
1040
+ newLines[newCursorRow] = before + parts[0] + after;
1041
+ newCursorCol = cpLen(before) + cpLen(parts[0]);
1042
+ }
1043
+ const { newInfo: newExpandedInfo, detachedIds } = shiftExpandedRegions(nextState.expandedPasteInfo, nextState.cursorRow, lineDelta);
1044
+ for (const id of detachedIds) {
1045
+ delete newPastedContent[id];
1046
+ }
1047
+ return {
1048
+ ...nextState,
1049
+ lines: newLines,
1050
+ cursorRow: newCursorRow,
1051
+ cursorCol: newCursorCol,
1052
+ preferredCol: null,
1053
+ pastedContent: newPastedContent,
1054
+ expandedPasteInfo: newExpandedInfo,
1055
+ };
1056
+ }
1057
+ case 'add_pasted_content': {
1058
+ const { id, text } = action.payload;
1059
+ return {
1060
+ ...state,
1061
+ pastedContent: {
1062
+ ...state.pastedContent,
1063
+ [id]: text,
1064
+ },
1065
+ };
1066
+ }
1067
+ case 'backspace': {
1068
+ const stateWithUndo = pushUndoLocal(state);
1069
+ const currentState = detachExpandedPaste(stateWithUndo);
1070
+ const { cursorRow, cursorCol, lines, transformationsByLine } = currentState;
1071
+ // Early return if at start of buffer
1072
+ if (cursorCol === 0 && cursorRow === 0)
1073
+ return currentState;
1074
+ // Check if cursor is at end of an atomic placeholder
1075
+ const transformations = transformationsByLine[cursorRow] ?? [];
1076
+ const placeholder = findAtomicPlaceholderForBackspace(lines[cursorRow], cursorCol, transformations);
1077
+ if (placeholder) {
1078
+ const nextState = currentState;
1079
+ const newLines = [...nextState.lines];
1080
+ newLines[cursorRow] =
1081
+ cpSlice(newLines[cursorRow], 0, placeholder.start) +
1082
+ cpSlice(newLines[cursorRow], placeholder.end);
1083
+ // Recalculate transformations for the modified line
1084
+ const newTransformations = [...nextState.transformationsByLine];
1085
+ newTransformations[cursorRow] = calculateTransformationsForLine(newLines[cursorRow]);
1086
+ // Clean up pastedContent if this was a paste placeholder
1087
+ let newPastedContent = nextState.pastedContent;
1088
+ if (placeholder.type === 'paste' && placeholder.id) {
1089
+ const { [placeholder.id]: _, ...remaining } = nextState.pastedContent;
1090
+ newPastedContent = remaining;
1091
+ }
1092
+ return {
1093
+ ...nextState,
1094
+ lines: newLines,
1095
+ cursorCol: placeholder.start,
1096
+ preferredCol: null,
1097
+ transformationsByLine: newTransformations,
1098
+ pastedContent: newPastedContent,
1099
+ };
1100
+ }
1101
+ // Standard backspace logic
1102
+ const nextState = currentState;
1103
+ const newLines = [...nextState.lines];
1104
+ let newCursorRow = nextState.cursorRow;
1105
+ let newCursorCol = nextState.cursorCol;
1106
+ const currentLine = (r) => newLines[r] ?? '';
1107
+ let lineDelta = 0;
1108
+ if (newCursorCol > 0) {
1109
+ const lineContent = currentLine(newCursorRow);
1110
+ newLines[newCursorRow] =
1111
+ cpSlice(lineContent, 0, newCursorCol - 1) +
1112
+ cpSlice(lineContent, newCursorCol);
1113
+ newCursorCol--;
1114
+ }
1115
+ else if (newCursorRow > 0) {
1116
+ const prevLineContent = currentLine(newCursorRow - 1);
1117
+ const currentLineContentVal = currentLine(newCursorRow);
1118
+ const newCol = cpLen(prevLineContent);
1119
+ newLines[newCursorRow - 1] = prevLineContent + currentLineContentVal;
1120
+ newLines.splice(newCursorRow, 1);
1121
+ lineDelta = -1;
1122
+ newCursorRow--;
1123
+ newCursorCol = newCol;
1124
+ }
1125
+ const { newInfo: newExpandedInfo, detachedIds } = shiftExpandedRegions(nextState.expandedPasteInfo, nextState.cursorRow + lineDelta, // shift based on the line that was removed
1126
+ lineDelta, nextState.cursorRow);
1127
+ const newPastedContent = { ...nextState.pastedContent };
1128
+ for (const id of detachedIds) {
1129
+ delete newPastedContent[id];
1130
+ }
1131
+ return {
1132
+ ...nextState,
1133
+ lines: newLines,
1134
+ cursorRow: newCursorRow,
1135
+ cursorCol: newCursorCol,
1136
+ preferredCol: null,
1137
+ pastedContent: newPastedContent,
1138
+ expandedPasteInfo: newExpandedInfo,
1139
+ };
1140
+ }
1141
+ case 'set_viewport': {
1142
+ const { width, height } = action.payload;
1143
+ if (width === state.viewportWidth && height === state.viewportHeight) {
1144
+ return state;
1145
+ }
1146
+ return {
1147
+ ...state,
1148
+ viewportWidth: width,
1149
+ viewportHeight: height,
1150
+ };
1151
+ }
1152
+ case 'move': {
1153
+ const { dir } = action.payload;
1154
+ const { cursorRow, cursorCol, lines, visualLayout, preferredCol } = state;
1155
+ // Visual movements
1156
+ if (dir === 'left' ||
1157
+ dir === 'right' ||
1158
+ dir === 'up' ||
1159
+ dir === 'down' ||
1160
+ dir === 'home' ||
1161
+ dir === 'end') {
1162
+ const visualCursor = calculateVisualCursorFromLayout(visualLayout, [
1163
+ cursorRow,
1164
+ cursorCol,
1165
+ ]);
1166
+ const { visualLines, visualToLogicalMap } = visualLayout;
1167
+ let newVisualRow = visualCursor[0];
1168
+ let newVisualCol = visualCursor[1];
1169
+ let newPreferredCol = preferredCol;
1170
+ const currentVisLineLen = cpLen(visualLines[newVisualRow] ?? '');
1171
+ switch (dir) {
1172
+ case 'left':
1173
+ newPreferredCol = null;
1174
+ if (newVisualCol > 0) {
1175
+ newVisualCol--;
1176
+ }
1177
+ else if (newVisualRow > 0) {
1178
+ newVisualRow--;
1179
+ newVisualCol = cpLen(visualLines[newVisualRow] ?? '');
1180
+ }
1181
+ break;
1182
+ case 'right':
1183
+ newPreferredCol = null;
1184
+ if (newVisualCol < currentVisLineLen) {
1185
+ newVisualCol++;
1186
+ }
1187
+ else if (newVisualRow < visualLines.length - 1) {
1188
+ newVisualRow++;
1189
+ newVisualCol = 0;
1190
+ }
1191
+ break;
1192
+ case 'up':
1193
+ if (newVisualRow > 0) {
1194
+ if (newPreferredCol === null)
1195
+ newPreferredCol = newVisualCol;
1196
+ newVisualRow--;
1197
+ newVisualCol = clamp(newPreferredCol, 0, cpLen(visualLines[newVisualRow] ?? ''));
1198
+ }
1199
+ break;
1200
+ case 'down':
1201
+ if (newVisualRow < visualLines.length - 1) {
1202
+ if (newPreferredCol === null)
1203
+ newPreferredCol = newVisualCol;
1204
+ newVisualRow++;
1205
+ newVisualCol = clamp(newPreferredCol, 0, cpLen(visualLines[newVisualRow] ?? ''));
1206
+ }
1207
+ break;
1208
+ case 'home':
1209
+ newPreferredCol = null;
1210
+ newVisualCol = 0;
1211
+ break;
1212
+ case 'end':
1213
+ newPreferredCol = null;
1214
+ newVisualCol = currentVisLineLen;
1215
+ break;
1216
+ default: {
1217
+ const exhaustiveCheck = dir;
1218
+ debugLogger.error(`Unknown visual movement direction: ${exhaustiveCheck}`);
1219
+ return state;
1220
+ }
1221
+ }
1222
+ if (visualToLogicalMap[newVisualRow]) {
1223
+ const [logRow, logicalStartCol] = visualToLogicalMap[newVisualRow];
1224
+ const transformedToLogicalMap = visualLayout.transformedToLogicalMaps?.[logRow] ?? [];
1225
+ let transformedStartCol = 0;
1226
+ while (transformedStartCol < transformedToLogicalMap.length &&
1227
+ transformedToLogicalMap[transformedStartCol] < logicalStartCol) {
1228
+ transformedStartCol++;
1229
+ }
1230
+ const clampedTransformedCol = Math.min(transformedStartCol + newVisualCol, Math.max(0, transformedToLogicalMap.length - 1));
1231
+ const newLogicalCol = transformedToLogicalMap[clampedTransformedCol] ??
1232
+ cpLen(lines[logRow] ?? '');
1233
+ return {
1234
+ ...state,
1235
+ cursorRow: logRow,
1236
+ cursorCol: newLogicalCol,
1237
+ preferredCol: newPreferredCol,
1238
+ };
1239
+ }
1240
+ return state;
1241
+ }
1242
+ // Logical movements
1243
+ switch (dir) {
1244
+ case 'wordLeft': {
1245
+ if (cursorCol === 0 && cursorRow === 0)
1246
+ return state;
1247
+ let newCursorRow = cursorRow;
1248
+ let newCursorCol = cursorCol;
1249
+ if (cursorCol === 0) {
1250
+ newCursorRow--;
1251
+ newCursorCol = cpLen(lines[newCursorRow] ?? '');
1252
+ }
1253
+ else {
1254
+ const lineContent = lines[cursorRow];
1255
+ newCursorCol = findPrevWordBoundary(lineContent, cursorCol);
1256
+ }
1257
+ return {
1258
+ ...state,
1259
+ cursorRow: newCursorRow,
1260
+ cursorCol: newCursorCol,
1261
+ preferredCol: null,
1262
+ };
1263
+ }
1264
+ case 'wordRight': {
1265
+ const lineContent = lines[cursorRow] ?? '';
1266
+ if (cursorRow === lines.length - 1 &&
1267
+ cursorCol === cpLen(lineContent)) {
1268
+ return state;
1269
+ }
1270
+ let newCursorRow = cursorRow;
1271
+ let newCursorCol = cursorCol;
1272
+ const lineLen = cpLen(lineContent);
1273
+ if (cursorCol >= lineLen) {
1274
+ newCursorRow++;
1275
+ newCursorCol = 0;
1276
+ }
1277
+ else {
1278
+ newCursorCol = findNextWordBoundary(lineContent, cursorCol);
1279
+ }
1280
+ return {
1281
+ ...state,
1282
+ cursorRow: newCursorRow,
1283
+ cursorCol: newCursorCol,
1284
+ preferredCol: null,
1285
+ };
1286
+ }
1287
+ default:
1288
+ return state;
1289
+ }
1290
+ }
1291
+ case 'set_cursor': {
1292
+ return {
1293
+ ...state,
1294
+ ...action.payload,
1295
+ };
1296
+ }
1297
+ case 'delete': {
1298
+ const stateWithUndo = pushUndoLocal(state);
1299
+ const currentState = detachExpandedPaste(stateWithUndo);
1300
+ const { cursorRow, cursorCol, lines, transformationsByLine } = currentState;
1301
+ // Check if cursor is at start of an atomic placeholder
1302
+ const transformations = transformationsByLine[cursorRow] ?? [];
1303
+ const placeholder = findAtomicPlaceholderForDelete(lines[cursorRow], cursorCol, transformations);
1304
+ if (placeholder) {
1305
+ const nextState = currentState;
1306
+ const newLines = [...nextState.lines];
1307
+ newLines[cursorRow] =
1308
+ cpSlice(newLines[cursorRow], 0, placeholder.start) +
1309
+ cpSlice(newLines[cursorRow], placeholder.end);
1310
+ // Recalculate transformations for the modified line
1311
+ const newTransformations = [...nextState.transformationsByLine];
1312
+ newTransformations[cursorRow] = calculateTransformationsForLine(newLines[cursorRow]);
1313
+ // Clean up pastedContent if this was a paste placeholder
1314
+ let newPastedContent = nextState.pastedContent;
1315
+ if (placeholder.type === 'paste' && placeholder.id) {
1316
+ const { [placeholder.id]: _, ...remaining } = nextState.pastedContent;
1317
+ newPastedContent = remaining;
1318
+ }
1319
+ return {
1320
+ ...nextState,
1321
+ lines: newLines,
1322
+ // cursorCol stays the same
1323
+ preferredCol: null,
1324
+ transformationsByLine: newTransformations,
1325
+ pastedContent: newPastedContent,
1326
+ };
1327
+ }
1328
+ // Standard delete logic
1329
+ const lineContent = currentLine(cursorRow);
1330
+ let lineDelta = 0;
1331
+ const nextState = currentState;
1332
+ const newLines = [...nextState.lines];
1333
+ if (cursorCol < currentLineLen(cursorRow)) {
1334
+ newLines[cursorRow] =
1335
+ cpSlice(lineContent, 0, cursorCol) +
1336
+ cpSlice(lineContent, cursorCol + 1);
1337
+ }
1338
+ else if (cursorRow < lines.length - 1) {
1339
+ const nextLineContent = currentLine(cursorRow + 1);
1340
+ newLines[cursorRow] = lineContent + nextLineContent;
1341
+ newLines.splice(cursorRow + 1, 1);
1342
+ lineDelta = -1;
1343
+ }
1344
+ else {
1345
+ return currentState;
1346
+ }
1347
+ const { newInfo: newExpandedInfo, detachedIds } = shiftExpandedRegions(nextState.expandedPasteInfo, nextState.cursorRow, lineDelta, nextState.cursorRow + (lineDelta < 0 ? 1 : 0));
1348
+ const newPastedContent = { ...nextState.pastedContent };
1349
+ for (const id of detachedIds) {
1350
+ delete newPastedContent[id];
1351
+ }
1352
+ return {
1353
+ ...nextState,
1354
+ lines: newLines,
1355
+ preferredCol: null,
1356
+ pastedContent: newPastedContent,
1357
+ expandedPasteInfo: newExpandedInfo,
1358
+ };
1359
+ }
1360
+ case 'delete_word_left': {
1361
+ const stateWithUndo = pushUndoLocal(state);
1362
+ const currentState = detachExpandedPaste(stateWithUndo);
1363
+ const { cursorRow, cursorCol } = currentState;
1364
+ if (cursorCol === 0 && cursorRow === 0)
1365
+ return currentState;
1366
+ const nextState = currentState;
1367
+ const newLines = [...nextState.lines];
1368
+ let newCursorRow = cursorRow;
1369
+ let newCursorCol = cursorCol;
1370
+ if (newCursorCol > 0) {
1371
+ const lineContent = currentLine(newCursorRow);
1372
+ const prevWordStart = findPrevWordStartInLine(lineContent, newCursorCol);
1373
+ const start = prevWordStart === null ? 0 : prevWordStart;
1374
+ newLines[newCursorRow] =
1375
+ cpSlice(lineContent, 0, start) + cpSlice(lineContent, newCursorCol);
1376
+ newCursorCol = start;
1377
+ }
1378
+ else {
1379
+ // Act as a backspace
1380
+ const prevLineContent = currentLine(cursorRow - 1);
1381
+ const currentLineContentVal = currentLine(cursorRow);
1382
+ const newCol = cpLen(prevLineContent);
1383
+ newLines[cursorRow - 1] = prevLineContent + currentLineContentVal;
1384
+ newLines.splice(cursorRow, 1);
1385
+ newCursorRow--;
1386
+ newCursorCol = newCol;
1387
+ }
1388
+ return {
1389
+ ...nextState,
1390
+ lines: newLines,
1391
+ cursorRow: newCursorRow,
1392
+ cursorCol: newCursorCol,
1393
+ preferredCol: null,
1394
+ };
1395
+ }
1396
+ case 'delete_word_right': {
1397
+ const stateWithUndo = pushUndoLocal(state);
1398
+ const currentState = detachExpandedPaste(stateWithUndo);
1399
+ const { cursorRow, cursorCol, lines } = currentState;
1400
+ const lineContent = currentLine(cursorRow);
1401
+ const lineLen = cpLen(lineContent);
1402
+ if (cursorCol >= lineLen && cursorRow === lines.length - 1) {
1403
+ return currentState;
1404
+ }
1405
+ const nextState = currentState;
1406
+ const newLines = [...nextState.lines];
1407
+ if (cursorCol >= lineLen) {
1408
+ // Act as a delete, joining with the next line
1409
+ const nextLineContent = currentLine(cursorRow + 1);
1410
+ newLines[cursorRow] = lineContent + nextLineContent;
1411
+ newLines.splice(cursorRow + 1, 1);
1412
+ }
1413
+ else {
1414
+ const nextWordStart = findNextWordStartInLine(lineContent, cursorCol);
1415
+ const end = nextWordStart === null ? lineLen : nextWordStart;
1416
+ newLines[cursorRow] =
1417
+ cpSlice(lineContent, 0, cursorCol) + cpSlice(lineContent, end);
1418
+ }
1419
+ return {
1420
+ ...nextState,
1421
+ lines: newLines,
1422
+ preferredCol: null,
1423
+ };
1424
+ }
1425
+ case 'kill_line_right': {
1426
+ const stateWithUndo = pushUndoLocal(state);
1427
+ const currentState = detachExpandedPaste(stateWithUndo);
1428
+ const { cursorRow, cursorCol, lines } = currentState;
1429
+ const lineContent = currentLine(cursorRow);
1430
+ if (cursorCol < currentLineLen(cursorRow)) {
1431
+ const nextState = currentState;
1432
+ const newLines = [...nextState.lines];
1433
+ newLines[cursorRow] = cpSlice(lineContent, 0, cursorCol);
1434
+ return {
1435
+ ...nextState,
1436
+ lines: newLines,
1437
+ };
1438
+ }
1439
+ else if (cursorRow < lines.length - 1) {
1440
+ // Act as a delete
1441
+ const nextState = currentState;
1442
+ const nextLineContent = currentLine(cursorRow + 1);
1443
+ const newLines = [...nextState.lines];
1444
+ newLines[cursorRow] = lineContent + nextLineContent;
1445
+ newLines.splice(cursorRow + 1, 1);
1446
+ return {
1447
+ ...nextState,
1448
+ lines: newLines,
1449
+ preferredCol: null,
1450
+ };
1451
+ }
1452
+ return currentState;
1453
+ }
1454
+ case 'kill_line_left': {
1455
+ const stateWithUndo = pushUndoLocal(state);
1456
+ const currentState = detachExpandedPaste(stateWithUndo);
1457
+ const { cursorRow, cursorCol } = currentState;
1458
+ if (cursorCol > 0) {
1459
+ const nextState = currentState;
1460
+ const lineContent = currentLine(cursorRow);
1461
+ const newLines = [...nextState.lines];
1462
+ newLines[cursorRow] = cpSlice(lineContent, cursorCol);
1463
+ return {
1464
+ ...nextState,
1465
+ lines: newLines,
1466
+ cursorCol: 0,
1467
+ preferredCol: null,
1468
+ };
1469
+ }
1470
+ return currentState;
1471
+ }
1472
+ case 'undo': {
1473
+ const stateToRestore = state.undoStack[state.undoStack.length - 1];
1474
+ if (!stateToRestore)
1475
+ return state;
1476
+ const currentSnapshot = {
1477
+ lines: [...state.lines],
1478
+ cursorRow: state.cursorRow,
1479
+ cursorCol: state.cursorCol,
1480
+ pastedContent: { ...state.pastedContent },
1481
+ expandedPasteInfo: new Map(state.expandedPasteInfo),
1482
+ };
1483
+ return {
1484
+ ...state,
1485
+ ...stateToRestore,
1486
+ undoStack: state.undoStack.slice(0, -1),
1487
+ redoStack: [...state.redoStack, currentSnapshot],
1488
+ };
1489
+ }
1490
+ case 'redo': {
1491
+ const stateToRestore = state.redoStack[state.redoStack.length - 1];
1492
+ if (!stateToRestore)
1493
+ return state;
1494
+ const currentSnapshot = {
1495
+ lines: [...state.lines],
1496
+ cursorRow: state.cursorRow,
1497
+ cursorCol: state.cursorCol,
1498
+ pastedContent: { ...state.pastedContent },
1499
+ expandedPasteInfo: new Map(state.expandedPasteInfo),
1500
+ };
1501
+ return {
1502
+ ...state,
1503
+ ...stateToRestore,
1504
+ redoStack: state.redoStack.slice(0, -1),
1505
+ undoStack: [...state.undoStack, currentSnapshot],
1506
+ };
1507
+ }
1508
+ case 'replace_range': {
1509
+ const { startRow, startCol, endRow, endCol, text } = action.payload;
1510
+ const nextState = pushUndoLocal(state);
1511
+ const newState = replaceRangeInternal(nextState, startRow, startCol, endRow, endCol, text);
1512
+ const oldLineCount = endRow - startRow + 1;
1513
+ const newLineCount = newState.lines.length - (nextState.lines.length - oldLineCount);
1514
+ const lineDelta = newLineCount - oldLineCount;
1515
+ const { newInfo: newExpandedInfo, detachedIds } = shiftExpandedRegions(nextState.expandedPasteInfo, startRow, lineDelta, endRow);
1516
+ const newPastedContent = { ...newState.pastedContent };
1517
+ for (const id of detachedIds) {
1518
+ delete newPastedContent[id];
1519
+ }
1520
+ return {
1521
+ ...newState,
1522
+ pastedContent: newPastedContent,
1523
+ expandedPasteInfo: newExpandedInfo,
1524
+ };
1525
+ }
1526
+ case 'move_to_offset': {
1527
+ const { offset } = action.payload;
1528
+ const [newRow, newCol] = offsetToLogicalPos(state.lines.join('\n'), offset);
1529
+ return {
1530
+ ...state,
1531
+ cursorRow: newRow,
1532
+ cursorCol: newCol,
1533
+ preferredCol: null,
1534
+ };
1535
+ }
1536
+ case 'create_undo_snapshot': {
1537
+ return pushUndoLocal(state);
1538
+ }
1539
+ // Vim-specific operations
1540
+ case 'vim_delete_word_forward':
1541
+ case 'vim_delete_word_backward':
1542
+ case 'vim_delete_word_end':
1543
+ case 'vim_change_word_forward':
1544
+ case 'vim_change_word_backward':
1545
+ case 'vim_change_word_end':
1546
+ case 'vim_delete_line':
1547
+ case 'vim_change_line':
1548
+ case 'vim_delete_to_end_of_line':
1549
+ case 'vim_change_to_end_of_line':
1550
+ case 'vim_change_movement':
1551
+ case 'vim_move_left':
1552
+ case 'vim_move_right':
1553
+ case 'vim_move_up':
1554
+ case 'vim_move_down':
1555
+ case 'vim_move_word_forward':
1556
+ case 'vim_move_word_backward':
1557
+ case 'vim_move_word_end':
1558
+ case 'vim_delete_char':
1559
+ case 'vim_insert_at_cursor':
1560
+ case 'vim_append_at_cursor':
1561
+ case 'vim_open_line_below':
1562
+ case 'vim_open_line_above':
1563
+ case 'vim_append_at_line_end':
1564
+ case 'vim_insert_at_line_start':
1565
+ case 'vim_move_to_line_start':
1566
+ case 'vim_move_to_line_end':
1567
+ case 'vim_move_to_first_nonwhitespace':
1568
+ case 'vim_move_to_first_line':
1569
+ case 'vim_move_to_last_line':
1570
+ case 'vim_move_to_line':
1571
+ case 'vim_escape_insert_mode':
1572
+ return handleVimAction(state, action);
1573
+ case 'toggle_paste_expansion': {
1574
+ const { id } = action.payload;
1575
+ const info = state.expandedPasteInfo.get(id);
1576
+ if (info) {
1577
+ const nextState = pushUndoLocal(state);
1578
+ // COLLAPSE: Restore original line with placeholder
1579
+ const newLines = [...nextState.lines];
1580
+ newLines.splice(info.startLine, info.lineCount, info.prefix + id + info.suffix);
1581
+ const lineDelta = 1 - info.lineCount;
1582
+ const { newInfo: newExpandedInfo, detachedIds } = shiftExpandedRegions(nextState.expandedPasteInfo, info.startLine, lineDelta, info.startLine + info.lineCount - 1);
1583
+ newExpandedInfo.delete(id); // Already shifted, now remove self
1584
+ const newPastedContent = { ...nextState.pastedContent };
1585
+ for (const detachedId of detachedIds) {
1586
+ if (detachedId !== id) {
1587
+ delete newPastedContent[detachedId];
1588
+ }
1589
+ }
1590
+ // Move cursor to end of collapsed placeholder
1591
+ const newCursorRow = info.startLine;
1592
+ const newCursorCol = cpLen(info.prefix) + cpLen(id);
1593
+ return {
1594
+ ...nextState,
1595
+ lines: newLines,
1596
+ cursorRow: newCursorRow,
1597
+ cursorCol: newCursorCol,
1598
+ preferredCol: null,
1599
+ pastedContent: newPastedContent,
1600
+ expandedPasteInfo: newExpandedInfo,
1601
+ };
1602
+ }
1603
+ else {
1604
+ // EXPAND: Replace placeholder with content
1605
+ const content = state.pastedContent[id];
1606
+ if (!content)
1607
+ return state;
1608
+ // Find line and position containing exactly this placeholder
1609
+ let lineIndex = -1;
1610
+ let placeholderStart = -1;
1611
+ for (let i = 0; i < state.lines.length; i++) {
1612
+ const transforms = state.transformationsByLine[i] ?? [];
1613
+ const transform = transforms.find((t) => t.type === 'paste' && t.id === id);
1614
+ if (transform) {
1615
+ lineIndex = i;
1616
+ placeholderStart = transform.logStart;
1617
+ break;
1618
+ }
1619
+ }
1620
+ if (lineIndex === -1)
1621
+ return state;
1622
+ const nextState = pushUndoLocal(state);
1623
+ const line = nextState.lines[lineIndex];
1624
+ const prefix = cpSlice(line, 0, placeholderStart);
1625
+ const suffix = cpSlice(line, placeholderStart + cpLen(id));
1626
+ // Split content into lines
1627
+ const contentLines = content.split('\n');
1628
+ const newLines = [...nextState.lines];
1629
+ let expandedLines;
1630
+ if (contentLines.length === 1) {
1631
+ // Single-line content
1632
+ expandedLines = [prefix + contentLines[0] + suffix];
1633
+ }
1634
+ else {
1635
+ // Multi-line content
1636
+ expandedLines = [
1637
+ prefix + contentLines[0],
1638
+ ...contentLines.slice(1, -1),
1639
+ contentLines[contentLines.length - 1] + suffix,
1640
+ ];
1641
+ }
1642
+ newLines.splice(lineIndex, 1, ...expandedLines);
1643
+ const lineDelta = expandedLines.length - 1;
1644
+ const { newInfo: newExpandedInfo, detachedIds } = shiftExpandedRegions(nextState.expandedPasteInfo, lineIndex, lineDelta, lineIndex);
1645
+ const newPastedContent = { ...nextState.pastedContent };
1646
+ for (const detachedId of detachedIds) {
1647
+ delete newPastedContent[detachedId];
1648
+ }
1649
+ newExpandedInfo.set(id, {
1650
+ startLine: lineIndex,
1651
+ lineCount: expandedLines.length,
1652
+ prefix,
1653
+ suffix,
1654
+ });
1655
+ // Move cursor to end of expanded content (before suffix)
1656
+ const newCursorRow = lineIndex + expandedLines.length - 1;
1657
+ const lastExpandedLine = expandedLines[expandedLines.length - 1];
1658
+ const newCursorCol = cpLen(lastExpandedLine) - cpLen(suffix);
1659
+ return {
1660
+ ...nextState,
1661
+ lines: newLines,
1662
+ cursorRow: newCursorRow,
1663
+ cursorCol: newCursorCol,
1664
+ preferredCol: null,
1665
+ pastedContent: newPastedContent,
1666
+ expandedPasteInfo: newExpandedInfo,
1667
+ };
1668
+ }
1669
+ }
1670
+ default: {
1671
+ const exhaustiveCheck = action;
1672
+ debugLogger.error(`Unknown action encountered: ${exhaustiveCheck}`);
1673
+ return state;
1674
+ }
1675
+ }
1676
+ }
1677
+ export function textBufferReducer(state, action, options = {}) {
1678
+ const newState = textBufferReducerLogic(state, action, options);
1679
+ const newTransformedLines = newState.lines !== state.lines
1680
+ ? calculateTransformations(newState.lines)
1681
+ : state.transformationsByLine;
1682
+ const oldTransform = getTransformUnderCursor(state.cursorRow, state.cursorCol, state.transformationsByLine);
1683
+ const newTransform = getTransformUnderCursor(newState.cursorRow, newState.cursorCol, newTransformedLines);
1684
+ const oldInside = oldTransform !== null;
1685
+ const newInside = newTransform !== null;
1686
+ const movedBetweenTransforms = oldTransform !== newTransform &&
1687
+ (oldTransform !== null || newTransform !== null);
1688
+ if (newState.lines !== state.lines ||
1689
+ newState.viewportWidth !== state.viewportWidth ||
1690
+ oldInside !== newInside ||
1691
+ movedBetweenTransforms) {
1692
+ const shouldResetPreferred = oldInside !== newInside || movedBetweenTransforms;
1693
+ return {
1694
+ ...newState,
1695
+ preferredCol: shouldResetPreferred ? null : newState.preferredCol,
1696
+ visualLayout: calculateLayout(newState.lines, newState.viewportWidth, [
1697
+ newState.cursorRow,
1698
+ newState.cursorCol,
1699
+ ]),
1700
+ transformationsByLine: newTransformedLines,
1701
+ };
1702
+ }
1703
+ return newState;
1704
+ }
1705
+ // --- End of reducer logic ---
1706
+ export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewport, stdin, setRawMode, onChange, isValidPath, shellModeActive = false, inputFilter, singleLine = false, getPreferredEditor, }) {
1707
+ const initialState = useMemo(() => {
1708
+ const lines = initialText.split('\n');
1709
+ const [initialCursorRow, initialCursorCol] = calculateInitialCursorPosition(lines.length === 0 ? [''] : lines, initialCursorOffset);
1710
+ const transformationsByLine = calculateTransformations(lines.length === 0 ? [''] : lines);
1711
+ const visualLayout = calculateLayout(lines.length === 0 ? [''] : lines, viewport.width, [initialCursorRow, initialCursorCol]);
1712
+ return {
1713
+ lines: lines.length === 0 ? [''] : lines,
1714
+ cursorRow: initialCursorRow,
1715
+ cursorCol: initialCursorCol,
1716
+ transformationsByLine,
1717
+ preferredCol: null,
1718
+ undoStack: [],
1719
+ redoStack: [],
1720
+ clipboard: null,
1721
+ selectionAnchor: null,
1722
+ viewportWidth: viewport.width,
1723
+ viewportHeight: viewport.height,
1724
+ visualLayout,
1725
+ pastedContent: {},
1726
+ expandedPasteInfo: new Map(),
1727
+ };
1728
+ }, [initialText, initialCursorOffset, viewport.width, viewport.height]);
1729
+ const [state, dispatch] = useReducer((s, a) => textBufferReducer(s, a, { inputFilter, singleLine }), initialState);
1730
+ const { lines, cursorRow, cursorCol, preferredCol, selectionAnchor, visualLayout, transformationsByLine, pastedContent, expandedPasteInfo, } = state;
1731
+ const text = useMemo(() => lines.join('\n'), [lines]);
1732
+ const visualCursor = useMemo(() => calculateVisualCursorFromLayout(visualLayout, [cursorRow, cursorCol]), [visualLayout, cursorRow, cursorCol]);
1733
+ const { visualLines, visualToLogicalMap, transformedToLogicalMaps, visualToTransformedMap, } = visualLayout;
1734
+ const [visualScrollRow, setVisualScrollRow] = useState(0);
1735
+ useEffect(() => {
1736
+ if (onChange) {
1737
+ onChange(text);
1738
+ }
1739
+ }, [text, onChange]);
1740
+ useEffect(() => {
1741
+ dispatch({
1742
+ type: 'set_viewport',
1743
+ payload: { width: viewport.width, height: viewport.height },
1744
+ });
1745
+ }, [viewport.width, viewport.height]);
1746
+ // Update visual scroll (vertical)
1747
+ useEffect(() => {
1748
+ const { height } = viewport;
1749
+ const totalVisualLines = visualLines.length;
1750
+ const maxScrollStart = Math.max(0, totalVisualLines - height);
1751
+ let newVisualScrollRow = visualScrollRow;
1752
+ if (visualCursor[0] < visualScrollRow) {
1753
+ newVisualScrollRow = visualCursor[0];
1754
+ }
1755
+ else if (visualCursor[0] >= visualScrollRow + height) {
1756
+ newVisualScrollRow = visualCursor[0] - height + 1;
1757
+ }
1758
+ // When the number of visual lines shrinks (e.g., after widening the viewport),
1759
+ // ensure scroll never starts beyond the last valid start so we can render a full window.
1760
+ newVisualScrollRow = clamp(newVisualScrollRow, 0, maxScrollStart);
1761
+ if (newVisualScrollRow !== visualScrollRow) {
1762
+ setVisualScrollRow(newVisualScrollRow);
1763
+ }
1764
+ }, [visualCursor, visualScrollRow, viewport, visualLines.length]);
1765
+ const insert = useCallback((ch, { paste = false } = {}) => {
1766
+ if (typeof ch !== 'string') {
1767
+ return;
1768
+ }
1769
+ let textToInsert = ch;
1770
+ const minLengthToInferAsDragDrop = 3;
1771
+ if (ch.length >= minLengthToInferAsDragDrop &&
1772
+ !shellModeActive &&
1773
+ paste) {
1774
+ let potentialPath = ch.trim();
1775
+ const quoteMatch = potentialPath.match(/^'(.*)'$/);
1776
+ if (quoteMatch) {
1777
+ potentialPath = quoteMatch[1];
1778
+ }
1779
+ potentialPath = potentialPath.trim();
1780
+ const processed = parsePastedPaths(potentialPath, isValidPath);
1781
+ if (processed) {
1782
+ textToInsert = processed;
1783
+ }
1784
+ }
1785
+ let currentText = '';
1786
+ for (const char of toCodePoints(textToInsert)) {
1787
+ if (char.codePointAt(0) === 127) {
1788
+ if (currentText.length > 0) {
1789
+ dispatch({ type: 'insert', payload: currentText, isPaste: paste });
1790
+ currentText = '';
1791
+ }
1792
+ dispatch({ type: 'backspace' });
1793
+ }
1794
+ else {
1795
+ currentText += char;
1796
+ }
1797
+ }
1798
+ if (currentText.length > 0) {
1799
+ dispatch({ type: 'insert', payload: currentText, isPaste: paste });
1800
+ }
1801
+ }, [isValidPath, shellModeActive]);
1802
+ const newline = useCallback(() => {
1803
+ if (singleLine) {
1804
+ return;
1805
+ }
1806
+ dispatch({ type: 'insert', payload: '\n' });
1807
+ }, [singleLine]);
1808
+ const backspace = useCallback(() => {
1809
+ dispatch({ type: 'backspace' });
1810
+ }, []);
1811
+ const del = useCallback(() => {
1812
+ dispatch({ type: 'delete' });
1813
+ }, []);
1814
+ const move = useCallback((dir) => {
1815
+ dispatch({ type: 'move', payload: { dir } });
1816
+ }, [dispatch]);
1817
+ const undo = useCallback(() => {
1818
+ dispatch({ type: 'undo' });
1819
+ }, []);
1820
+ const redo = useCallback(() => {
1821
+ dispatch({ type: 'redo' });
1822
+ }, []);
1823
+ const setText = useCallback((newText) => {
1824
+ dispatch({ type: 'set_text', payload: newText });
1825
+ }, []);
1826
+ const deleteWordLeft = useCallback(() => {
1827
+ dispatch({ type: 'delete_word_left' });
1828
+ }, []);
1829
+ const deleteWordRight = useCallback(() => {
1830
+ dispatch({ type: 'delete_word_right' });
1831
+ }, []);
1832
+ const killLineRight = useCallback(() => {
1833
+ dispatch({ type: 'kill_line_right' });
1834
+ }, []);
1835
+ const killLineLeft = useCallback(() => {
1836
+ dispatch({ type: 'kill_line_left' });
1837
+ }, []);
1838
+ // Vim-specific operations
1839
+ const vimDeleteWordForward = useCallback((count) => {
1840
+ dispatch({ type: 'vim_delete_word_forward', payload: { count } });
1841
+ }, []);
1842
+ const vimDeleteWordBackward = useCallback((count) => {
1843
+ dispatch({ type: 'vim_delete_word_backward', payload: { count } });
1844
+ }, []);
1845
+ const vimDeleteWordEnd = useCallback((count) => {
1846
+ dispatch({ type: 'vim_delete_word_end', payload: { count } });
1847
+ }, []);
1848
+ const vimChangeWordForward = useCallback((count) => {
1849
+ dispatch({ type: 'vim_change_word_forward', payload: { count } });
1850
+ }, []);
1851
+ const vimChangeWordBackward = useCallback((count) => {
1852
+ dispatch({ type: 'vim_change_word_backward', payload: { count } });
1853
+ }, []);
1854
+ const vimChangeWordEnd = useCallback((count) => {
1855
+ dispatch({ type: 'vim_change_word_end', payload: { count } });
1856
+ }, []);
1857
+ const vimDeleteLine = useCallback((count) => {
1858
+ dispatch({ type: 'vim_delete_line', payload: { count } });
1859
+ }, []);
1860
+ const vimChangeLine = useCallback((count) => {
1861
+ dispatch({ type: 'vim_change_line', payload: { count } });
1862
+ }, []);
1863
+ const vimDeleteToEndOfLine = useCallback(() => {
1864
+ dispatch({ type: 'vim_delete_to_end_of_line' });
1865
+ }, []);
1866
+ const vimChangeToEndOfLine = useCallback(() => {
1867
+ dispatch({ type: 'vim_change_to_end_of_line' });
1868
+ }, []);
1869
+ const vimChangeMovement = useCallback((movement, count) => {
1870
+ dispatch({ type: 'vim_change_movement', payload: { movement, count } });
1871
+ }, []);
1872
+ // New vim navigation and operation methods
1873
+ const vimMoveLeft = useCallback((count) => {
1874
+ dispatch({ type: 'vim_move_left', payload: { count } });
1875
+ }, []);
1876
+ const vimMoveRight = useCallback((count) => {
1877
+ dispatch({ type: 'vim_move_right', payload: { count } });
1878
+ }, []);
1879
+ const vimMoveUp = useCallback((count) => {
1880
+ dispatch({ type: 'vim_move_up', payload: { count } });
1881
+ }, []);
1882
+ const vimMoveDown = useCallback((count) => {
1883
+ dispatch({ type: 'vim_move_down', payload: { count } });
1884
+ }, []);
1885
+ const vimMoveWordForward = useCallback((count) => {
1886
+ dispatch({ type: 'vim_move_word_forward', payload: { count } });
1887
+ }, []);
1888
+ const vimMoveWordBackward = useCallback((count) => {
1889
+ dispatch({ type: 'vim_move_word_backward', payload: { count } });
1890
+ }, []);
1891
+ const vimMoveWordEnd = useCallback((count) => {
1892
+ dispatch({ type: 'vim_move_word_end', payload: { count } });
1893
+ }, []);
1894
+ const vimDeleteChar = useCallback((count) => {
1895
+ dispatch({ type: 'vim_delete_char', payload: { count } });
1896
+ }, []);
1897
+ const vimInsertAtCursor = useCallback(() => {
1898
+ dispatch({ type: 'vim_insert_at_cursor' });
1899
+ }, []);
1900
+ const vimAppendAtCursor = useCallback(() => {
1901
+ dispatch({ type: 'vim_append_at_cursor' });
1902
+ }, []);
1903
+ const vimOpenLineBelow = useCallback(() => {
1904
+ dispatch({ type: 'vim_open_line_below' });
1905
+ }, []);
1906
+ const vimOpenLineAbove = useCallback(() => {
1907
+ dispatch({ type: 'vim_open_line_above' });
1908
+ }, []);
1909
+ const vimAppendAtLineEnd = useCallback(() => {
1910
+ dispatch({ type: 'vim_append_at_line_end' });
1911
+ }, []);
1912
+ const vimInsertAtLineStart = useCallback(() => {
1913
+ dispatch({ type: 'vim_insert_at_line_start' });
1914
+ }, []);
1915
+ const vimMoveToLineStart = useCallback(() => {
1916
+ dispatch({ type: 'vim_move_to_line_start' });
1917
+ }, []);
1918
+ const vimMoveToLineEnd = useCallback(() => {
1919
+ dispatch({ type: 'vim_move_to_line_end' });
1920
+ }, []);
1921
+ const vimMoveToFirstNonWhitespace = useCallback(() => {
1922
+ dispatch({ type: 'vim_move_to_first_nonwhitespace' });
1923
+ }, []);
1924
+ const vimMoveToFirstLine = useCallback(() => {
1925
+ dispatch({ type: 'vim_move_to_first_line' });
1926
+ }, []);
1927
+ const vimMoveToLastLine = useCallback(() => {
1928
+ dispatch({ type: 'vim_move_to_last_line' });
1929
+ }, []);
1930
+ const vimMoveToLine = useCallback((lineNumber) => {
1931
+ dispatch({ type: 'vim_move_to_line', payload: { lineNumber } });
1932
+ }, []);
1933
+ const vimEscapeInsertMode = useCallback(() => {
1934
+ dispatch({ type: 'vim_escape_insert_mode' });
1935
+ }, []);
1936
+ const openInExternalEditor = useCallback(async () => {
1937
+ const tmpDir = fs.mkdtempSync(pathMod.join(os.tmpdir(), 'gemini-edit-'));
1938
+ const filePath = pathMod.join(tmpDir, 'buffer.txt');
1939
+ // Expand paste placeholders so user sees full content in editor
1940
+ const expandedText = text.replace(PASTED_TEXT_PLACEHOLDER_REGEX, (match) => pastedContent[match] || match);
1941
+ fs.writeFileSync(filePath, expandedText, 'utf8');
1942
+ let command = undefined;
1943
+ const args = [filePath];
1944
+ const preferredEditorType = getPreferredEditor?.();
1945
+ if (!command && preferredEditorType) {
1946
+ command = getEditorCommand(preferredEditorType);
1947
+ if (isGuiEditor(preferredEditorType)) {
1948
+ args.unshift('--wait');
1949
+ }
1950
+ }
1951
+ if (!command) {
1952
+ command =
1953
+ process.env['VISUAL'] ??
1954
+ process.env['EDITOR'] ??
1955
+ (process.platform === 'win32' ? 'notepad' : 'vi');
1956
+ }
1957
+ dispatch({ type: 'create_undo_snapshot' });
1958
+ const wasRaw = stdin?.isRaw ?? false;
1959
+ try {
1960
+ setRawMode?.(false);
1961
+ const { status, error } = spawnSync(command, args, {
1962
+ stdio: 'inherit',
1963
+ });
1964
+ if (error)
1965
+ throw error;
1966
+ if (typeof status === 'number' && status !== 0)
1967
+ throw new Error(`External editor exited with status ${status}`);
1968
+ let newText = fs.readFileSync(filePath, 'utf8');
1969
+ newText = newText.replace(/\r\n?/g, '\n');
1970
+ // Attempt to re-collapse unchanged pasted content back into placeholders
1971
+ const sortedPlaceholders = Object.entries(pastedContent).sort((a, b) => b[1].length - a[1].length);
1972
+ for (const [id, content] of sortedPlaceholders) {
1973
+ if (newText.includes(content)) {
1974
+ newText = newText.replace(content, id);
1975
+ }
1976
+ }
1977
+ dispatch({ type: 'set_text', payload: newText, pushToUndo: false });
1978
+ }
1979
+ catch (err) {
1980
+ coreEvents.emitFeedback('error', '[useTextBuffer] external editor error', err);
1981
+ }
1982
+ finally {
1983
+ coreEvents.emit(CoreEvent.ExternalEditorClosed);
1984
+ if (wasRaw)
1985
+ setRawMode?.(true);
1986
+ try {
1987
+ fs.unlinkSync(filePath);
1988
+ }
1989
+ catch {
1990
+ /* ignore */
1991
+ }
1992
+ try {
1993
+ fs.rmdirSync(tmpDir);
1994
+ }
1995
+ catch {
1996
+ /* ignore */
1997
+ }
1998
+ }
1999
+ }, [text, pastedContent, stdin, setRawMode, getPreferredEditor]);
2000
+ const handleInput = useCallback((key) => {
2001
+ const { sequence: input } = key;
2002
+ if (key.name === 'paste')
2003
+ insert(input, { paste: true });
2004
+ else if (keyMatchers[Command.RETURN](key))
2005
+ newline();
2006
+ else if (keyMatchers[Command.NEWLINE](key))
2007
+ newline();
2008
+ else if (keyMatchers[Command.MOVE_LEFT](key))
2009
+ move('left');
2010
+ else if (keyMatchers[Command.MOVE_RIGHT](key))
2011
+ move('right');
2012
+ else if (keyMatchers[Command.MOVE_UP](key))
2013
+ move('up');
2014
+ else if (keyMatchers[Command.MOVE_DOWN](key))
2015
+ move('down');
2016
+ else if (keyMatchers[Command.MOVE_WORD_LEFT](key))
2017
+ move('wordLeft');
2018
+ else if (keyMatchers[Command.MOVE_WORD_RIGHT](key))
2019
+ move('wordRight');
2020
+ else if (keyMatchers[Command.HOME](key))
2021
+ move('home');
2022
+ else if (keyMatchers[Command.END](key))
2023
+ move('end');
2024
+ else if (keyMatchers[Command.DELETE_WORD_BACKWARD](key))
2025
+ deleteWordLeft();
2026
+ else if (keyMatchers[Command.DELETE_WORD_FORWARD](key))
2027
+ deleteWordRight();
2028
+ else if (keyMatchers[Command.DELETE_CHAR_LEFT](key))
2029
+ backspace();
2030
+ else if (keyMatchers[Command.DELETE_CHAR_RIGHT](key))
2031
+ del();
2032
+ else if (keyMatchers[Command.UNDO](key))
2033
+ undo();
2034
+ else if (keyMatchers[Command.REDO](key))
2035
+ redo();
2036
+ else if (key.insertable)
2037
+ insert(input, { paste: false });
2038
+ }, [
2039
+ newline,
2040
+ move,
2041
+ deleteWordLeft,
2042
+ deleteWordRight,
2043
+ backspace,
2044
+ del,
2045
+ insert,
2046
+ undo,
2047
+ redo,
2048
+ ]);
2049
+ const renderedVisualLines = useMemo(() => visualLines.slice(visualScrollRow, visualScrollRow + viewport.height), [visualLines, visualScrollRow, viewport.height]);
2050
+ const replaceRange = useCallback((startRow, startCol, endRow, endCol, text) => {
2051
+ dispatch({
2052
+ type: 'replace_range',
2053
+ payload: { startRow, startCol, endRow, endCol, text },
2054
+ });
2055
+ }, []);
2056
+ const replaceRangeByOffset = useCallback((startOffset, endOffset, replacementText) => {
2057
+ const [startRow, startCol] = offsetToLogicalPos(text, startOffset);
2058
+ const [endRow, endCol] = offsetToLogicalPos(text, endOffset);
2059
+ replaceRange(startRow, startCol, endRow, endCol, replacementText);
2060
+ }, [text, replaceRange]);
2061
+ const moveToOffset = useCallback((offset) => {
2062
+ dispatch({ type: 'move_to_offset', payload: { offset } });
2063
+ }, []);
2064
+ const moveToVisualPosition = useCallback((visRow, visCol) => {
2065
+ const { visualLines, visualToLogicalMap, transformedToLogicalMaps, visualToTransformedMap, } = visualLayout;
2066
+ // Clamp visRow to valid range
2067
+ const clampedVisRow = Math.max(0, Math.min(visRow, visualLines.length - 1));
2068
+ const visualLine = visualLines[clampedVisRow] || '';
2069
+ if (visualToLogicalMap[clampedVisRow]) {
2070
+ const [logRow] = visualToLogicalMap[clampedVisRow];
2071
+ const transformedToLogicalMap = transformedToLogicalMaps?.[logRow] ?? [];
2072
+ // Where does this visual line begin within the transformed line?
2073
+ const startColInTransformed = visualToTransformedMap?.[clampedVisRow] ?? 0;
2074
+ // Handle wide characters: convert visual X position to character offset
2075
+ const codePoints = toCodePoints(visualLine);
2076
+ let currentVisX = 0;
2077
+ let charOffset = 0;
2078
+ for (const char of codePoints) {
2079
+ const charWidth = getCachedStringWidth(char);
2080
+ // If the click is within this character
2081
+ if (visCol < currentVisX + charWidth) {
2082
+ // Check if we clicked the second half of a wide character
2083
+ if (charWidth > 1 && visCol >= currentVisX + charWidth / 2) {
2084
+ charOffset++;
2085
+ }
2086
+ break;
2087
+ }
2088
+ currentVisX += charWidth;
2089
+ charOffset++;
2090
+ }
2091
+ // Clamp charOffset to length
2092
+ charOffset = Math.min(charOffset, codePoints.length);
2093
+ // Map character offset through transformations to get logical position
2094
+ const transformedCol = Math.min(startColInTransformed + charOffset, Math.max(0, transformedToLogicalMap.length - 1));
2095
+ const newCursorRow = logRow;
2096
+ const newCursorCol = transformedToLogicalMap[transformedCol] ?? cpLen(lines[logRow] ?? '');
2097
+ dispatch({
2098
+ type: 'set_cursor',
2099
+ payload: {
2100
+ cursorRow: newCursorRow,
2101
+ cursorCol: newCursorCol,
2102
+ preferredCol: charOffset,
2103
+ },
2104
+ });
2105
+ }
2106
+ }, [visualLayout, lines]);
2107
+ const getLogicalPositionFromVisual = useCallback((visRow, visCol) => {
2108
+ const { visualLines, visualToLogicalMap, transformedToLogicalMaps, visualToTransformedMap, } = visualLayout;
2109
+ // Clamp visRow to valid range
2110
+ const clampedVisRow = Math.max(0, Math.min(visRow, visualLines.length - 1));
2111
+ const visualLine = visualLines[clampedVisRow] || '';
2112
+ if (!visualToLogicalMap[clampedVisRow]) {
2113
+ return null;
2114
+ }
2115
+ const [logRow] = visualToLogicalMap[clampedVisRow];
2116
+ const transformedToLogicalMap = transformedToLogicalMaps?.[logRow] ?? [];
2117
+ // Where does this visual line begin within the transformed line?
2118
+ const startColInTransformed = visualToTransformedMap?.[clampedVisRow] ?? 0;
2119
+ // Handle wide characters: convert visual X position to character offset
2120
+ const codePoints = toCodePoints(visualLine);
2121
+ let currentVisX = 0;
2122
+ let charOffset = 0;
2123
+ for (const char of codePoints) {
2124
+ const charWidth = getCachedStringWidth(char);
2125
+ if (visCol < currentVisX + charWidth) {
2126
+ if (charWidth > 1 && visCol >= currentVisX + charWidth / 2) {
2127
+ charOffset++;
2128
+ }
2129
+ break;
2130
+ }
2131
+ currentVisX += charWidth;
2132
+ charOffset++;
2133
+ }
2134
+ charOffset = Math.min(charOffset, codePoints.length);
2135
+ const transformedCol = Math.min(startColInTransformed + charOffset, Math.max(0, transformedToLogicalMap.length - 1));
2136
+ const row = logRow;
2137
+ const col = transformedToLogicalMap[transformedCol] ?? cpLen(lines[logRow] ?? '');
2138
+ return { row, col };
2139
+ }, [visualLayout, lines]);
2140
+ const getOffset = useCallback(() => logicalPosToOffset(lines, cursorRow, cursorCol), [lines, cursorRow, cursorCol]);
2141
+ const togglePasteExpansion = useCallback((id) => {
2142
+ dispatch({ type: 'toggle_paste_expansion', payload: { id } });
2143
+ }, []);
2144
+ const getExpandedPasteAtLineCallback = useCallback((lineIndex) => getExpandedPasteAtLine(lineIndex, expandedPasteInfo), [expandedPasteInfo]);
2145
+ const returnValue = useMemo(() => ({
2146
+ lines,
2147
+ text,
2148
+ cursor: [cursorRow, cursorCol],
2149
+ preferredCol,
2150
+ selectionAnchor,
2151
+ pastedContent,
2152
+ allVisualLines: visualLines,
2153
+ viewportVisualLines: renderedVisualLines,
2154
+ visualCursor,
2155
+ visualScrollRow,
2156
+ visualToLogicalMap,
2157
+ transformedToLogicalMaps,
2158
+ visualToTransformedMap,
2159
+ transformationsByLine,
2160
+ visualLayout,
2161
+ setText,
2162
+ insert,
2163
+ newline,
2164
+ backspace,
2165
+ del,
2166
+ move,
2167
+ undo,
2168
+ redo,
2169
+ replaceRange,
2170
+ replaceRangeByOffset,
2171
+ moveToOffset,
2172
+ getOffset,
2173
+ moveToVisualPosition,
2174
+ getLogicalPositionFromVisual,
2175
+ getExpandedPasteAtLine: getExpandedPasteAtLineCallback,
2176
+ togglePasteExpansion,
2177
+ expandedPasteInfo,
2178
+ deleteWordLeft,
2179
+ deleteWordRight,
2180
+ killLineRight,
2181
+ killLineLeft,
2182
+ handleInput,
2183
+ openInExternalEditor,
2184
+ // Vim-specific operations
2185
+ vimDeleteWordForward,
2186
+ vimDeleteWordBackward,
2187
+ vimDeleteWordEnd,
2188
+ vimChangeWordForward,
2189
+ vimChangeWordBackward,
2190
+ vimChangeWordEnd,
2191
+ vimDeleteLine,
2192
+ vimChangeLine,
2193
+ vimDeleteToEndOfLine,
2194
+ vimChangeToEndOfLine,
2195
+ vimChangeMovement,
2196
+ vimMoveLeft,
2197
+ vimMoveRight,
2198
+ vimMoveUp,
2199
+ vimMoveDown,
2200
+ vimMoveWordForward,
2201
+ vimMoveWordBackward,
2202
+ vimMoveWordEnd,
2203
+ vimDeleteChar,
2204
+ vimInsertAtCursor,
2205
+ vimAppendAtCursor,
2206
+ vimOpenLineBelow,
2207
+ vimOpenLineAbove,
2208
+ vimAppendAtLineEnd,
2209
+ vimInsertAtLineStart,
2210
+ vimMoveToLineStart,
2211
+ vimMoveToLineEnd,
2212
+ vimMoveToFirstNonWhitespace,
2213
+ vimMoveToFirstLine,
2214
+ vimMoveToLastLine,
2215
+ vimMoveToLine,
2216
+ vimEscapeInsertMode,
2217
+ }), [
2218
+ lines,
2219
+ text,
2220
+ cursorRow,
2221
+ cursorCol,
2222
+ preferredCol,
2223
+ selectionAnchor,
2224
+ pastedContent,
2225
+ visualLines,
2226
+ renderedVisualLines,
2227
+ visualCursor,
2228
+ visualScrollRow,
2229
+ visualToLogicalMap,
2230
+ transformedToLogicalMaps,
2231
+ visualToTransformedMap,
2232
+ transformationsByLine,
2233
+ visualLayout,
2234
+ setText,
2235
+ insert,
2236
+ newline,
2237
+ backspace,
2238
+ del,
2239
+ move,
2240
+ undo,
2241
+ redo,
2242
+ replaceRange,
2243
+ replaceRangeByOffset,
2244
+ moveToOffset,
2245
+ getOffset,
2246
+ moveToVisualPosition,
2247
+ getLogicalPositionFromVisual,
2248
+ getExpandedPasteAtLineCallback,
2249
+ togglePasteExpansion,
2250
+ expandedPasteInfo,
2251
+ deleteWordLeft,
2252
+ deleteWordRight,
2253
+ killLineRight,
2254
+ killLineLeft,
2255
+ handleInput,
2256
+ openInExternalEditor,
2257
+ vimDeleteWordForward,
2258
+ vimDeleteWordBackward,
2259
+ vimDeleteWordEnd,
2260
+ vimChangeWordForward,
2261
+ vimChangeWordBackward,
2262
+ vimChangeWordEnd,
2263
+ vimDeleteLine,
2264
+ vimChangeLine,
2265
+ vimDeleteToEndOfLine,
2266
+ vimChangeToEndOfLine,
2267
+ vimChangeMovement,
2268
+ vimMoveLeft,
2269
+ vimMoveRight,
2270
+ vimMoveUp,
2271
+ vimMoveDown,
2272
+ vimMoveWordForward,
2273
+ vimMoveWordBackward,
2274
+ vimMoveWordEnd,
2275
+ vimDeleteChar,
2276
+ vimInsertAtCursor,
2277
+ vimAppendAtCursor,
2278
+ vimOpenLineBelow,
2279
+ vimOpenLineAbove,
2280
+ vimAppendAtLineEnd,
2281
+ vimInsertAtLineStart,
2282
+ vimMoveToLineStart,
2283
+ vimMoveToLineEnd,
2284
+ vimMoveToFirstNonWhitespace,
2285
+ vimMoveToFirstLine,
2286
+ vimMoveToLastLine,
2287
+ vimMoveToLine,
2288
+ vimEscapeInsertMode,
2289
+ ]);
2290
+ return returnValue;
2291
+ }
2292
+ //# sourceMappingURL=text-buffer.js.map