fss-link 1.2.1 → 1.2.3

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 (996) hide show
  1. package/bundle/fss-link.js +127361 -0
  2. package/package.json +109 -44
  3. package/dist/.last_build +0 -0
  4. package/dist/index.d.ts +0 -7
  5. package/dist/index.js +0 -14
  6. package/dist/index.js.map +0 -1
  7. package/dist/package.json +0 -89
  8. package/dist/src/commands/mcp/add.d.ts +0 -7
  9. package/dist/src/commands/mcp/add.js +0 -166
  10. package/dist/src/commands/mcp/add.js.map +0 -1
  11. package/dist/src/commands/mcp/list.d.ts +0 -8
  12. package/dist/src/commands/mcp/list.js +0 -110
  13. package/dist/src/commands/mcp/list.js.map +0 -1
  14. package/dist/src/commands/mcp/remove.d.ts +0 -7
  15. package/dist/src/commands/mcp/remove.js +0 -44
  16. package/dist/src/commands/mcp/remove.js.map +0 -1
  17. package/dist/src/commands/mcp.d.ts +0 -7
  18. package/dist/src/commands/mcp.js +0 -23
  19. package/dist/src/commands/mcp.js.map +0 -1
  20. package/dist/src/config/archive-repository-pattern/README.md +0 -26
  21. package/dist/src/config/archive-repository-pattern/base-repository.d.ts +0 -252
  22. package/dist/src/config/archive-repository-pattern/base-repository.js +0 -280
  23. package/dist/src/config/archive-repository-pattern/base-repository.js.map +0 -1
  24. package/dist/src/config/archive-repository-pattern/model-repository.d.ts +0 -274
  25. package/dist/src/config/archive-repository-pattern/model-repository.js +0 -482
  26. package/dist/src/config/archive-repository-pattern/model-repository.js.map +0 -1
  27. package/dist/src/config/archive-repository-pattern/preferences-repository.d.ts +0 -307
  28. package/dist/src/config/archive-repository-pattern/preferences-repository.js +0 -604
  29. package/dist/src/config/archive-repository-pattern/preferences-repository.js.map +0 -1
  30. package/dist/src/config/archive-repository-pattern/repository-types.d.ts +0 -166
  31. package/dist/src/config/archive-repository-pattern/repository-types.js +0 -67
  32. package/dist/src/config/archive-repository-pattern/repository-types.js.map +0 -1
  33. package/dist/src/config/archive-repository-pattern/settings-repository.d.ts +0 -274
  34. package/dist/src/config/archive-repository-pattern/settings-repository.js +0 -531
  35. package/dist/src/config/archive-repository-pattern/settings-repository.js.map +0 -1
  36. package/dist/src/config/async-mutex.d.ts +0 -61
  37. package/dist/src/config/async-mutex.js +0 -121
  38. package/dist/src/config/async-mutex.js.map +0 -1
  39. package/dist/src/config/async-mutex.test.d.ts +0 -6
  40. package/dist/src/config/async-mutex.test.js +0 -271
  41. package/dist/src/config/async-mutex.test.js.map +0 -1
  42. package/dist/src/config/auth-stress-simplified.test.d.ts +0 -6
  43. package/dist/src/config/auth-stress-simplified.test.js +0 -329
  44. package/dist/src/config/auth-stress-simplified.test.js.map +0 -1
  45. package/dist/src/config/auth-stress.test.d.ts +0 -9
  46. package/dist/src/config/auth-stress.test.js +0 -544
  47. package/dist/src/config/auth-stress.test.js.map +0 -1
  48. package/dist/src/config/auth.d.ts +0 -96
  49. package/dist/src/config/auth.js +0 -371
  50. package/dist/src/config/auth.js.map +0 -1
  51. package/dist/src/config/auth.test.d.ts +0 -6
  52. package/dist/src/config/auth.test.js +0 -61
  53. package/dist/src/config/auth.test.js.map +0 -1
  54. package/dist/src/config/base-repository.d.ts +0 -252
  55. package/dist/src/config/base-repository.js +0 -272
  56. package/dist/src/config/base-repository.js.map +0 -1
  57. package/dist/src/config/config.d.ts +0 -51
  58. package/dist/src/config/config.js +0 -553
  59. package/dist/src/config/config.js.map +0 -1
  60. package/dist/src/config/core-database.d.ts +0 -112
  61. package/dist/src/config/core-database.js +0 -370
  62. package/dist/src/config/core-database.js.map +0 -1
  63. package/dist/src/config/database-integration.test.d.ts +0 -6
  64. package/dist/src/config/database-integration.test.js +0 -547
  65. package/dist/src/config/database-integration.test.js.map +0 -1
  66. package/dist/src/config/database-legacy-wrapper.d.ts +0 -202
  67. package/dist/src/config/database-legacy-wrapper.js +0 -391
  68. package/dist/src/config/database-legacy-wrapper.js.map +0 -1
  69. package/dist/src/config/database-monitor.d.ts +0 -135
  70. package/dist/src/config/database-monitor.js +0 -306
  71. package/dist/src/config/database-monitor.js.map +0 -1
  72. package/dist/src/config/database-queue.d.ts +0 -106
  73. package/dist/src/config/database-queue.js +0 -187
  74. package/dist/src/config/database-queue.js.map +0 -1
  75. package/dist/src/config/database-queue.test.d.ts +0 -6
  76. package/dist/src/config/database-queue.test.js +0 -344
  77. package/dist/src/config/database-queue.test.js.map +0 -1
  78. package/dist/src/config/database-regression-simple.test.d.ts +0 -6
  79. package/dist/src/config/database-regression-simple.test.js +0 -335
  80. package/dist/src/config/database-regression-simple.test.js.map +0 -1
  81. package/dist/src/config/database-regression.test.d.ts +0 -6
  82. package/dist/src/config/database-regression.test.js +0 -523
  83. package/dist/src/config/database-regression.test.js.map +0 -1
  84. package/dist/src/config/database-stress.test.d.ts +0 -6
  85. package/dist/src/config/database-stress.test.js +0 -522
  86. package/dist/src/config/database-stress.test.js.map +0 -1
  87. package/dist/src/config/database-utils.d.ts +0 -281
  88. package/dist/src/config/database-utils.js +0 -664
  89. package/dist/src/config/database-utils.js.map +0 -1
  90. package/dist/src/config/database-utils.test.d.ts +0 -6
  91. package/dist/src/config/database-utils.test.js +0 -278
  92. package/dist/src/config/database-utils.test.js.map +0 -1
  93. package/dist/src/config/database.d.ts +0 -212
  94. package/dist/src/config/database.js +0 -458
  95. package/dist/src/config/database.js.map +0 -1
  96. package/dist/src/config/databaseBackup.d.ts +0 -114
  97. package/dist/src/config/databaseBackup.js +0 -334
  98. package/dist/src/config/databaseBackup.js.map +0 -1
  99. package/dist/src/config/databaseHealthMonitor.d.ts +0 -86
  100. package/dist/src/config/databaseHealthMonitor.js +0 -180
  101. package/dist/src/config/databaseHealthMonitor.js.map +0 -1
  102. package/dist/src/config/databaseMetrics.d.ts +0 -147
  103. package/dist/src/config/databaseMetrics.js +0 -369
  104. package/dist/src/config/databaseMetrics.js.map +0 -1
  105. package/dist/src/config/databaseMigrations.d.ts +0 -75
  106. package/dist/src/config/databaseMigrations.js +0 -405
  107. package/dist/src/config/databaseMigrations.js.map +0 -1
  108. package/dist/src/config/databasePool.d.ts +0 -72
  109. package/dist/src/config/databasePool.js +0 -226
  110. package/dist/src/config/databasePool.js.map +0 -1
  111. package/dist/src/config/databaseSchemaValidator.d.ts +0 -114
  112. package/dist/src/config/databaseSchemaValidator.js +0 -497
  113. package/dist/src/config/databaseSchemaValidator.js.map +0 -1
  114. package/dist/src/config/extension.d.ts +0 -23
  115. package/dist/src/config/extension.js +0 -126
  116. package/dist/src/config/extension.js.map +0 -1
  117. package/dist/src/config/health-database.d.ts +0 -172
  118. package/dist/src/config/health-database.js +0 -283
  119. package/dist/src/config/health-database.js.map +0 -1
  120. package/dist/src/config/keyBindings.d.ts +0 -66
  121. package/dist/src/config/keyBindings.js +0 -141
  122. package/dist/src/config/keyBindings.js.map +0 -1
  123. package/dist/src/config/keyBindings.test.d.ts +0 -6
  124. package/dist/src/config/keyBindings.test.js +0 -51
  125. package/dist/src/config/keyBindings.test.js.map +0 -1
  126. package/dist/src/config/model-database.d.ts +0 -157
  127. package/dist/src/config/model-database.js +0 -379
  128. package/dist/src/config/model-database.js.map +0 -1
  129. package/dist/src/config/model-repository.d.ts +0 -274
  130. package/dist/src/config/model-repository.js +0 -482
  131. package/dist/src/config/model-repository.js.map +0 -1
  132. package/dist/src/config/modelManager.d.ts +0 -146
  133. package/dist/src/config/modelManager.js +0 -573
  134. package/dist/src/config/modelManager.js.map +0 -1
  135. package/dist/src/config/preferences-database.d.ts +0 -101
  136. package/dist/src/config/preferences-database.js +0 -209
  137. package/dist/src/config/preferences-database.js.map +0 -1
  138. package/dist/src/config/preferences-repository.d.ts +0 -307
  139. package/dist/src/config/preferences-repository.js +0 -604
  140. package/dist/src/config/preferences-repository.js.map +0 -1
  141. package/dist/src/config/provider-database.d.ts +0 -102
  142. package/dist/src/config/provider-database.js +0 -250
  143. package/dist/src/config/provider-database.js.map +0 -1
  144. package/dist/src/config/providerPersistence.d.ts +0 -82
  145. package/dist/src/config/providerPersistence.js +0 -62
  146. package/dist/src/config/providerPersistence.js.map +0 -1
  147. package/dist/src/config/queryOptimizer.d.ts +0 -127
  148. package/dist/src/config/queryOptimizer.js +0 -330
  149. package/dist/src/config/queryOptimizer.js.map +0 -1
  150. package/dist/src/config/repository-types.d.ts +0 -166
  151. package/dist/src/config/repository-types.js +0 -67
  152. package/dist/src/config/repository-types.js.map +0 -1
  153. package/dist/src/config/sandboxConfig.d.ts +0 -13
  154. package/dist/src/config/sandboxConfig.js +0 -75
  155. package/dist/src/config/sandboxConfig.js.map +0 -1
  156. package/dist/src/config/settings-repository.d.ts +0 -274
  157. package/dist/src/config/settings-repository.js +0 -531
  158. package/dist/src/config/settings-repository.js.map +0 -1
  159. package/dist/src/config/settings.d.ts +0 -56
  160. package/dist/src/config/settings.js +0 -411
  161. package/dist/src/config/settings.js.map +0 -1
  162. package/dist/src/config/settingsSchema.d.ts +0 -703
  163. package/dist/src/config/settingsSchema.js +0 -679
  164. package/dist/src/config/settingsSchema.js.map +0 -1
  165. package/dist/src/config/settingsSchema.test.d.ts +0 -6
  166. package/dist/src/config/settingsSchema.test.js +0 -195
  167. package/dist/src/config/settingsSchema.test.js.map +0 -1
  168. package/dist/src/config/trustedFolders.d.ts +0 -37
  169. package/dist/src/config/trustedFolders.js +0 -118
  170. package/dist/src/config/trustedFolders.js.map +0 -1
  171. package/dist/src/config/trustedFolders.test.d.ts +0 -6
  172. package/dist/src/config/trustedFolders.test.js +0 -160
  173. package/dist/src/config/trustedFolders.test.js.map +0 -1
  174. package/dist/src/config/unified-database.d.ts +0 -383
  175. package/dist/src/config/unified-database.js +0 -651
  176. package/dist/src/config/unified-database.js.map +0 -1
  177. package/dist/src/config/unified-database.test.d.ts +0 -6
  178. package/dist/src/config/unified-database.test.js +0 -162
  179. package/dist/src/config/unified-database.test.js.map +0 -1
  180. package/dist/src/gemini.d.ts +0 -9
  181. package/dist/src/gemini.js +0 -334
  182. package/dist/src/gemini.js.map +0 -1
  183. package/dist/src/gemini.test.d.ts +0 -6
  184. package/dist/src/gemini.test.js +0 -193
  185. package/dist/src/gemini.test.js.map +0 -1
  186. package/dist/src/generated/git-commit.d.ts +0 -7
  187. package/dist/src/generated/git-commit.js +0 -10
  188. package/dist/src/generated/git-commit.js.map +0 -1
  189. package/dist/src/nonInteractiveCli.d.ts +0 -7
  190. package/dist/src/nonInteractiveCli.js +0 -103
  191. package/dist/src/nonInteractiveCli.js.map +0 -1
  192. package/dist/src/patches/is-in-ci.d.ts +0 -7
  193. package/dist/src/patches/is-in-ci.js +0 -15
  194. package/dist/src/patches/is-in-ci.js.map +0 -1
  195. package/dist/src/services/BuiltinCommandLoader.d.ts +0 -24
  196. package/dist/src/services/BuiltinCommandLoader.js +0 -92
  197. package/dist/src/services/BuiltinCommandLoader.js.map +0 -1
  198. package/dist/src/services/BuiltinCommandLoader.test.d.ts +0 -6
  199. package/dist/src/services/BuiltinCommandLoader.test.js +0 -108
  200. package/dist/src/services/BuiltinCommandLoader.test.js.map +0 -1
  201. package/dist/src/services/CommandService.d.ts +0 -55
  202. package/dist/src/services/CommandService.js +0 -90
  203. package/dist/src/services/CommandService.js.map +0 -1
  204. package/dist/src/services/CommandService.test.d.ts +0 -6
  205. package/dist/src/services/CommandService.test.js +0 -232
  206. package/dist/src/services/CommandService.test.js.map +0 -1
  207. package/dist/src/services/FileCommandLoader.d.ts +0 -49
  208. package/dist/src/services/FileCommandLoader.js +0 -210
  209. package/dist/src/services/FileCommandLoader.js.map +0 -1
  210. package/dist/src/services/McpPromptLoader.d.ts +0 -25
  211. package/dist/src/services/McpPromptLoader.js +0 -192
  212. package/dist/src/services/McpPromptLoader.js.map +0 -1
  213. package/dist/src/services/SearchEngineConfigProvider.d.ts +0 -33
  214. package/dist/src/services/SearchEngineConfigProvider.js +0 -82
  215. package/dist/src/services/SearchEngineConfigProvider.js.map +0 -1
  216. package/dist/src/services/prompt-processors/argumentProcessor.d.ts +0 -16
  217. package/dist/src/services/prompt-processors/argumentProcessor.js +0 -20
  218. package/dist/src/services/prompt-processors/argumentProcessor.js.map +0 -1
  219. package/dist/src/services/prompt-processors/shellProcessor.d.ts +0 -35
  220. package/dist/src/services/prompt-processors/shellProcessor.js +0 -162
  221. package/dist/src/services/prompt-processors/shellProcessor.js.map +0 -1
  222. package/dist/src/services/prompt-processors/types.d.ts +0 -40
  223. package/dist/src/services/prompt-processors/types.js +0 -16
  224. package/dist/src/services/prompt-processors/types.js.map +0 -1
  225. package/dist/src/services/types.d.ts +0 -22
  226. package/dist/src/services/types.js +0 -7
  227. package/dist/src/services/types.js.map +0 -1
  228. package/dist/src/test-utils/customMatchers.d.ts +0 -14
  229. package/dist/src/test-utils/customMatchers.js +0 -46
  230. package/dist/src/test-utils/customMatchers.js.map +0 -1
  231. package/dist/src/test-utils/mockCommandContext.d.ts +0 -18
  232. package/dist/src/test-utils/mockCommandContext.js +0 -87
  233. package/dist/src/test-utils/mockCommandContext.js.map +0 -1
  234. package/dist/src/test-utils/mockCommandContext.test.d.ts +0 -6
  235. package/dist/src/test-utils/mockCommandContext.test.js +0 -51
  236. package/dist/src/test-utils/mockCommandContext.test.js.map +0 -1
  237. package/dist/src/test-utils/render.d.ts +0 -8
  238. package/dist/src/test-utils/render.js +0 -10
  239. package/dist/src/test-utils/render.js.map +0 -1
  240. package/dist/src/ui/App.d.ts +0 -15
  241. package/dist/src/ui/App.js +0 -687
  242. package/dist/src/ui/App.js.map +0 -1
  243. package/dist/src/ui/IdeIntegrationNudge.d.ts +0 -16
  244. package/dist/src/ui/IdeIntegrationNudge.js +0 -52
  245. package/dist/src/ui/IdeIntegrationNudge.js.map +0 -1
  246. package/dist/src/ui/colors.d.ts +0 -7
  247. package/dist/src/ui/colors.js +0 -54
  248. package/dist/src/ui/colors.js.map +0 -1
  249. package/dist/src/ui/commands/aboutCommand.d.ts +0 -7
  250. package/dist/src/ui/commands/aboutCommand.js +0 -43
  251. package/dist/src/ui/commands/aboutCommand.js.map +0 -1
  252. package/dist/src/ui/commands/authCommand.d.ts +0 -7
  253. package/dist/src/ui/commands/authCommand.js +0 -16
  254. package/dist/src/ui/commands/authCommand.js.map +0 -1
  255. package/dist/src/ui/commands/bugCommand.d.ts +0 -7
  256. package/dist/src/ui/commands/bugCommand.js +0 -71
  257. package/dist/src/ui/commands/bugCommand.js.map +0 -1
  258. package/dist/src/ui/commands/chatCommand.d.ts +0 -7
  259. package/dist/src/ui/commands/chatCommand.js +0 -234
  260. package/dist/src/ui/commands/chatCommand.js.map +0 -1
  261. package/dist/src/ui/commands/clearCommand.d.ts +0 -7
  262. package/dist/src/ui/commands/clearCommand.js +0 -27
  263. package/dist/src/ui/commands/clearCommand.js.map +0 -1
  264. package/dist/src/ui/commands/compressCommand.d.ts +0 -7
  265. package/dist/src/ui/commands/compressCommand.js +0 -64
  266. package/dist/src/ui/commands/compressCommand.js.map +0 -1
  267. package/dist/src/ui/commands/contextCommand.d.ts +0 -7
  268. package/dist/src/ui/commands/contextCommand.js +0 -115
  269. package/dist/src/ui/commands/contextCommand.js.map +0 -1
  270. package/dist/src/ui/commands/copyCommand.d.ts +0 -7
  271. package/dist/src/ui/commands/copyCommand.js +0 -59
  272. package/dist/src/ui/commands/copyCommand.js.map +0 -1
  273. package/dist/src/ui/commands/corgiCommand.d.ts +0 -7
  274. package/dist/src/ui/commands/corgiCommand.js +0 -15
  275. package/dist/src/ui/commands/corgiCommand.js.map +0 -1
  276. package/dist/src/ui/commands/directoryCommand.d.ts +0 -8
  277. package/dist/src/ui/commands/directoryCommand.js +0 -133
  278. package/dist/src/ui/commands/directoryCommand.js.map +0 -1
  279. package/dist/src/ui/commands/docsCommand.d.ts +0 -7
  280. package/dist/src/ui/commands/docsCommand.js +0 -31
  281. package/dist/src/ui/commands/docsCommand.js.map +0 -1
  282. package/dist/src/ui/commands/editorCommand.d.ts +0 -7
  283. package/dist/src/ui/commands/editorCommand.js +0 -16
  284. package/dist/src/ui/commands/editorCommand.js.map +0 -1
  285. package/dist/src/ui/commands/extensionsCommand.d.ts +0 -7
  286. package/dist/src/ui/commands/extensionsCommand.js +0 -31
  287. package/dist/src/ui/commands/extensionsCommand.js.map +0 -1
  288. package/dist/src/ui/commands/helpCommand.d.ts +0 -7
  289. package/dist/src/ui/commands/helpCommand.js +0 -21
  290. package/dist/src/ui/commands/helpCommand.js.map +0 -1
  291. package/dist/src/ui/commands/ideCommand.d.ts +0 -8
  292. package/dist/src/ui/commands/ideCommand.js +0 -218
  293. package/dist/src/ui/commands/ideCommand.js.map +0 -1
  294. package/dist/src/ui/commands/initCommand.d.ts +0 -7
  295. package/dist/src/ui/commands/initCommand.js +0 -105
  296. package/dist/src/ui/commands/initCommand.js.map +0 -1
  297. package/dist/src/ui/commands/mcpCommand.d.ts +0 -7
  298. package/dist/src/ui/commands/mcpCommand.js +0 -424
  299. package/dist/src/ui/commands/mcpCommand.js.map +0 -1
  300. package/dist/src/ui/commands/memoryCommand.d.ts +0 -7
  301. package/dist/src/ui/commands/memoryCommand.js +0 -224
  302. package/dist/src/ui/commands/memoryCommand.js.map +0 -1
  303. package/dist/src/ui/commands/privacyCommand.d.ts +0 -7
  304. package/dist/src/ui/commands/privacyCommand.js +0 -16
  305. package/dist/src/ui/commands/privacyCommand.js.map +0 -1
  306. package/dist/src/ui/commands/quitCommand.d.ts +0 -7
  307. package/dist/src/ui/commands/quitCommand.js +0 -34
  308. package/dist/src/ui/commands/quitCommand.js.map +0 -1
  309. package/dist/src/ui/commands/restoreCommand.d.ts +0 -8
  310. package/dist/src/ui/commands/restoreCommand.js +0 -128
  311. package/dist/src/ui/commands/restoreCommand.js.map +0 -1
  312. package/dist/src/ui/commands/searchEngineSetupCommand.d.ts +0 -7
  313. package/dist/src/ui/commands/searchEngineSetupCommand.js +0 -17
  314. package/dist/src/ui/commands/searchEngineSetupCommand.js.map +0 -1
  315. package/dist/src/ui/commands/settingsCommand.d.ts +0 -7
  316. package/dist/src/ui/commands/settingsCommand.js +0 -16
  317. package/dist/src/ui/commands/settingsCommand.js.map +0 -1
  318. package/dist/src/ui/commands/setupGithubCommand.d.ts +0 -9
  319. package/dist/src/ui/commands/setupGithubCommand.js +0 -154
  320. package/dist/src/ui/commands/setupGithubCommand.js.map +0 -1
  321. package/dist/src/ui/commands/setupGithubCommand.test.d.ts +0 -6
  322. package/dist/src/ui/commands/setupGithubCommand.test.js +0 -167
  323. package/dist/src/ui/commands/setupGithubCommand.test.js.map +0 -1
  324. package/dist/src/ui/commands/speakCommand.d.ts +0 -7
  325. package/dist/src/ui/commands/speakCommand.js +0 -136
  326. package/dist/src/ui/commands/speakCommand.js.map +0 -1
  327. package/dist/src/ui/commands/statsCommand.d.ts +0 -7
  328. package/dist/src/ui/commands/statsCommand.js +0 -54
  329. package/dist/src/ui/commands/statsCommand.js.map +0 -1
  330. package/dist/src/ui/commands/terminalSetupCommand.d.ts +0 -13
  331. package/dist/src/ui/commands/terminalSetupCommand.js +0 -41
  332. package/dist/src/ui/commands/terminalSetupCommand.js.map +0 -1
  333. package/dist/src/ui/commands/themeCommand.d.ts +0 -7
  334. package/dist/src/ui/commands/themeCommand.js +0 -16
  335. package/dist/src/ui/commands/themeCommand.js.map +0 -1
  336. package/dist/src/ui/commands/toolsCommand.d.ts +0 -7
  337. package/dist/src/ui/commands/toolsCommand.js +0 -56
  338. package/dist/src/ui/commands/toolsCommand.js.map +0 -1
  339. package/dist/src/ui/commands/ttsCommand.d.ts +0 -7
  340. package/dist/src/ui/commands/ttsCommand.js +0 -122
  341. package/dist/src/ui/commands/ttsCommand.js.map +0 -1
  342. package/dist/src/ui/commands/types.d.ts +0 -157
  343. package/dist/src/ui/commands/types.js +0 -12
  344. package/dist/src/ui/commands/types.js.map +0 -1
  345. package/dist/src/ui/commands/vimCommand.d.ts +0 -7
  346. package/dist/src/ui/commands/vimCommand.js +0 -23
  347. package/dist/src/ui/commands/vimCommand.js.map +0 -1
  348. package/dist/src/ui/commands/voiceCommand.d.ts +0 -7
  349. package/dist/src/ui/commands/voiceCommand.js +0 -95
  350. package/dist/src/ui/commands/voiceCommand.js.map +0 -1
  351. package/dist/src/ui/components/AboutBox.d.ts +0 -17
  352. package/dist/src/ui/components/AboutBox.js +0 -6
  353. package/dist/src/ui/components/AboutBox.js.map +0 -1
  354. package/dist/src/ui/components/AsciiArt.d.ts +0 -8
  355. package/dist/src/ui/components/AsciiArt.js +0 -53
  356. package/dist/src/ui/components/AsciiArt.js.map +0 -1
  357. package/dist/src/ui/components/AuthDialog.d.ts +0 -15
  358. package/dist/src/ui/components/AuthDialog.js +0 -174
  359. package/dist/src/ui/components/AuthDialog.js.map +0 -1
  360. package/dist/src/ui/components/AuthDialog.test.d.ts +0 -6
  361. package/dist/src/ui/components/AuthDialog.test.js +0 -220
  362. package/dist/src/ui/components/AuthDialog.test.js.map +0 -1
  363. package/dist/src/ui/components/AuthInProgress.d.ts +0 -11
  364. package/dist/src/ui/components/AuthInProgress.js +0 -28
  365. package/dist/src/ui/components/AuthInProgress.js.map +0 -1
  366. package/dist/src/ui/components/AutoAcceptIndicator.d.ts +0 -12
  367. package/dist/src/ui/components/AutoAcceptIndicator.js +0 -26
  368. package/dist/src/ui/components/AutoAcceptIndicator.js.map +0 -1
  369. package/dist/src/ui/components/ConsoleSummaryDisplay.d.ts +0 -11
  370. package/dist/src/ui/components/ConsoleSummaryDisplay.js +0 -11
  371. package/dist/src/ui/components/ConsoleSummaryDisplay.js.map +0 -1
  372. package/dist/src/ui/components/ContextSummaryDisplay.d.ts +0 -20
  373. package/dist/src/ui/components/ContextSummaryDisplay.js +0 -65
  374. package/dist/src/ui/components/ContextSummaryDisplay.js.map +0 -1
  375. package/dist/src/ui/components/ContextUsageDisplay.d.ts +0 -11
  376. package/dist/src/ui/components/ContextUsageDisplay.js +0 -100
  377. package/dist/src/ui/components/ContextUsageDisplay.js.map +0 -1
  378. package/dist/src/ui/components/DebugProfiler.d.ts +0 -6
  379. package/dist/src/ui/components/DebugProfiler.js +0 -27
  380. package/dist/src/ui/components/DebugProfiler.js.map +0 -1
  381. package/dist/src/ui/components/DetailedMessagesDisplay.d.ts +0 -14
  382. package/dist/src/ui/components/DetailedMessagesDisplay.js +0 -34
  383. package/dist/src/ui/components/DetailedMessagesDisplay.js.map +0 -1
  384. package/dist/src/ui/components/EditorSettingsDialog.d.ts +0 -15
  385. package/dist/src/ui/components/EditorSettingsDialog.js +0 -74
  386. package/dist/src/ui/components/EditorSettingsDialog.js.map +0 -1
  387. package/dist/src/ui/components/FolderTrustDialog.d.ts +0 -16
  388. package/dist/src/ui/components/FolderTrustDialog.js +0 -39
  389. package/dist/src/ui/components/FolderTrustDialog.js.map +0 -1
  390. package/dist/src/ui/components/FolderTrustDialog.test.d.ts +0 -6
  391. package/dist/src/ui/components/FolderTrustDialog.test.js +0 -26
  392. package/dist/src/ui/components/FolderTrustDialog.test.js.map +0 -1
  393. package/dist/src/ui/components/Footer.d.ts +0 -24
  394. package/dist/src/ui/components/Footer.js +0 -25
  395. package/dist/src/ui/components/Footer.js.map +0 -1
  396. package/dist/src/ui/components/GeminiRespondingSpinner.d.ts +0 -17
  397. package/dist/src/ui/components/GeminiRespondingSpinner.js +0 -16
  398. package/dist/src/ui/components/GeminiRespondingSpinner.js.map +0 -1
  399. package/dist/src/ui/components/Header.d.ts +0 -13
  400. package/dist/src/ui/components/Header.js +0 -28
  401. package/dist/src/ui/components/Header.js.map +0 -1
  402. package/dist/src/ui/components/Header.test.d.ts +0 -6
  403. package/dist/src/ui/components/Header.test.js +0 -37
  404. package/dist/src/ui/components/Header.test.js.map +0 -1
  405. package/dist/src/ui/components/Help.d.ts +0 -12
  406. package/dist/src/ui/components/Help.js +0 -10
  407. package/dist/src/ui/components/Help.js.map +0 -1
  408. package/dist/src/ui/components/HistoryItemDisplay.d.ts +0 -20
  409. package/dist/src/ui/components/HistoryItemDisplay.js +0 -18
  410. package/dist/src/ui/components/HistoryItemDisplay.js.map +0 -1
  411. package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +0 -6
  412. package/dist/src/ui/components/HistoryItemDisplay.test.js +0 -91
  413. package/dist/src/ui/components/HistoryItemDisplay.test.js.map +0 -1
  414. package/dist/src/ui/components/InputPrompt.d.ts +0 -28
  415. package/dist/src/ui/components/InputPrompt.js +0 -440
  416. package/dist/src/ui/components/InputPrompt.js.map +0 -1
  417. package/dist/src/ui/components/LMStudioModelPrompt.d.ts +0 -12
  418. package/dist/src/ui/components/LMStudioModelPrompt.js +0 -100
  419. package/dist/src/ui/components/LMStudioModelPrompt.js.map +0 -1
  420. package/dist/src/ui/components/LoadingIndicator.d.ts +0 -15
  421. package/dist/src/ui/components/LoadingIndicator.js +0 -25
  422. package/dist/src/ui/components/LoadingIndicator.js.map +0 -1
  423. package/dist/src/ui/components/LoadingIndicator.test.d.ts +0 -6
  424. package/dist/src/ui/components/LoadingIndicator.test.js +0 -190
  425. package/dist/src/ui/components/LoadingIndicator.test.js.map +0 -1
  426. package/dist/src/ui/components/MemoryUsageDisplay.d.ts +0 -7
  427. package/dist/src/ui/components/MemoryUsageDisplay.js +0 -27
  428. package/dist/src/ui/components/MemoryUsageDisplay.js.map +0 -1
  429. package/dist/src/ui/components/ModelStatsDisplay.d.ts +0 -7
  430. package/dist/src/ui/components/ModelStatsDisplay.js +0 -33
  431. package/dist/src/ui/components/ModelStatsDisplay.js.map +0 -1
  432. package/dist/src/ui/components/OllamaModelPrompt.d.ts +0 -12
  433. package/dist/src/ui/components/OllamaModelPrompt.js +0 -94
  434. package/dist/src/ui/components/OllamaModelPrompt.js.map +0 -1
  435. package/dist/src/ui/components/OpenAIEndpointDialog.d.ts +0 -18
  436. package/dist/src/ui/components/OpenAIEndpointDialog.js +0 -77
  437. package/dist/src/ui/components/OpenAIEndpointDialog.js.map +0 -1
  438. package/dist/src/ui/components/OpenAIKeyPrompt.d.ts +0 -13
  439. package/dist/src/ui/components/OpenAIKeyPrompt.js +0 -118
  440. package/dist/src/ui/components/OpenAIKeyPrompt.js.map +0 -1
  441. package/dist/src/ui/components/OpenAIKeyPrompt.test.d.ts +0 -6
  442. package/dist/src/ui/components/OpenAIKeyPrompt.test.js +0 -44
  443. package/dist/src/ui/components/OpenAIKeyPrompt.test.js.map +0 -1
  444. package/dist/src/ui/components/PrepareLabel.d.ts +0 -15
  445. package/dist/src/ui/components/PrepareLabel.js +0 -16
  446. package/dist/src/ui/components/PrepareLabel.js.map +0 -1
  447. package/dist/src/ui/components/SearchEngineConfigDialog.d.ts +0 -18
  448. package/dist/src/ui/components/SearchEngineConfigDialog.js +0 -180
  449. package/dist/src/ui/components/SearchEngineConfigDialog.js.map +0 -1
  450. package/dist/src/ui/components/SessionSummaryDisplay.d.ts +0 -11
  451. package/dist/src/ui/components/SessionSummaryDisplay.js +0 -4
  452. package/dist/src/ui/components/SessionSummaryDisplay.js.map +0 -1
  453. package/dist/src/ui/components/SettingsDialog.d.ts +0 -14
  454. package/dist/src/ui/components/SettingsDialog.js +0 -519
  455. package/dist/src/ui/components/SettingsDialog.js.map +0 -1
  456. package/dist/src/ui/components/SettingsDialog.test.d.ts +0 -6
  457. package/dist/src/ui/components/SettingsDialog.test.js +0 -568
  458. package/dist/src/ui/components/SettingsDialog.test.js.map +0 -1
  459. package/dist/src/ui/components/ShellConfirmationDialog.d.ts +0 -15
  460. package/dist/src/ui/components/ShellConfirmationDialog.js +0 -46
  461. package/dist/src/ui/components/ShellConfirmationDialog.js.map +0 -1
  462. package/dist/src/ui/components/ShellConfirmationDialog.test.d.ts +0 -6
  463. package/dist/src/ui/components/ShellConfirmationDialog.test.js +0 -40
  464. package/dist/src/ui/components/ShellConfirmationDialog.test.js.map +0 -1
  465. package/dist/src/ui/components/ShellModeIndicator.d.ts +0 -7
  466. package/dist/src/ui/components/ShellModeIndicator.js +0 -5
  467. package/dist/src/ui/components/ShellModeIndicator.js.map +0 -1
  468. package/dist/src/ui/components/ShowMoreLines.d.ts +0 -10
  469. package/dist/src/ui/components/ShowMoreLines.js +0 -24
  470. package/dist/src/ui/components/ShowMoreLines.js.map +0 -1
  471. package/dist/src/ui/components/StatsDisplay.d.ts +0 -12
  472. package/dist/src/ui/components/StatsDisplay.js +0 -43
  473. package/dist/src/ui/components/StatsDisplay.js.map +0 -1
  474. package/dist/src/ui/components/SuggestionsDisplay.d.ts +0 -22
  475. package/dist/src/ui/components/SuggestionsDisplay.js +0 -32
  476. package/dist/src/ui/components/SuggestionsDisplay.js.map +0 -1
  477. package/dist/src/ui/components/ThemeDialog.d.ts +0 -19
  478. package/dist/src/ui/components/ThemeDialog.js +0 -143
  479. package/dist/src/ui/components/ThemeDialog.js.map +0 -1
  480. package/dist/src/ui/components/Tips.d.ts +0 -12
  481. package/dist/src/ui/components/Tips.js +0 -8
  482. package/dist/src/ui/components/Tips.js.map +0 -1
  483. package/dist/src/ui/components/TodoDisplay.d.ts +0 -16
  484. package/dist/src/ui/components/TodoDisplay.js +0 -27
  485. package/dist/src/ui/components/TodoDisplay.js.map +0 -1
  486. package/dist/src/ui/components/TodoDisplay.test.d.ts +0 -6
  487. package/dist/src/ui/components/TodoDisplay.test.js +0 -77
  488. package/dist/src/ui/components/TodoDisplay.test.js.map +0 -1
  489. package/dist/src/ui/components/ToolStatsDisplay.d.ts +0 -7
  490. package/dist/src/ui/components/ToolStatsDisplay.js +0 -41
  491. package/dist/src/ui/components/ToolStatsDisplay.js.map +0 -1
  492. package/dist/src/ui/components/UpdateNotification.d.ts +0 -10
  493. package/dist/src/ui/components/UpdateNotification.js +0 -10
  494. package/dist/src/ui/components/UpdateNotification.js.map +0 -1
  495. package/dist/src/ui/components/WelcomeBackDialog.d.ts +0 -36
  496. package/dist/src/ui/components/WelcomeBackDialog.js +0 -109
  497. package/dist/src/ui/components/WelcomeBackDialog.js.map +0 -1
  498. package/dist/src/ui/components/messages/CompressionMessage.d.ts +0 -11
  499. package/dist/src/ui/components/messages/CompressionMessage.js +0 -16
  500. package/dist/src/ui/components/messages/CompressionMessage.js.map +0 -1
  501. package/dist/src/ui/components/messages/DiffRenderer.d.ts +0 -16
  502. package/dist/src/ui/components/messages/DiffRenderer.js +0 -222
  503. package/dist/src/ui/components/messages/DiffRenderer.js.map +0 -1
  504. package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +0 -6
  505. package/dist/src/ui/components/messages/DiffRenderer.test.js +0 -239
  506. package/dist/src/ui/components/messages/DiffRenderer.test.js.map +0 -1
  507. package/dist/src/ui/components/messages/ErrorMessage.d.ts +0 -11
  508. package/dist/src/ui/components/messages/ErrorMessage.js +0 -9
  509. package/dist/src/ui/components/messages/ErrorMessage.js.map +0 -1
  510. package/dist/src/ui/components/messages/GeminiMessage.d.ts +0 -14
  511. package/dist/src/ui/components/messages/GeminiMessage.js +0 -10
  512. package/dist/src/ui/components/messages/GeminiMessage.js.map +0 -1
  513. package/dist/src/ui/components/messages/GeminiMessageContent.d.ts +0 -14
  514. package/dist/src/ui/components/messages/GeminiMessageContent.js +0 -15
  515. package/dist/src/ui/components/messages/GeminiMessageContent.js.map +0 -1
  516. package/dist/src/ui/components/messages/InfoMessage.d.ts +0 -11
  517. package/dist/src/ui/components/messages/InfoMessage.js +0 -10
  518. package/dist/src/ui/components/messages/InfoMessage.js.map +0 -1
  519. package/dist/src/ui/components/messages/ToolConfirmationMessage.d.ts +0 -15
  520. package/dist/src/ui/components/messages/ToolConfirmationMessage.js +0 -145
  521. package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +0 -1
  522. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +0 -6
  523. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +0 -37
  524. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +0 -1
  525. package/dist/src/ui/components/messages/ToolGroupMessage.d.ts +0 -18
  526. package/dist/src/ui/components/messages/ToolGroupMessage.js +0 -55
  527. package/dist/src/ui/components/messages/ToolGroupMessage.js.map +0 -1
  528. package/dist/src/ui/components/messages/ToolMessage.d.ts +0 -15
  529. package/dist/src/ui/components/messages/ToolMessage.js +0 -111
  530. package/dist/src/ui/components/messages/ToolMessage.js.map +0 -1
  531. package/dist/src/ui/components/messages/ToolMessage.test.d.ts +0 -6
  532. package/dist/src/ui/components/messages/ToolMessage.test.js +0 -118
  533. package/dist/src/ui/components/messages/ToolMessage.test.js.map +0 -1
  534. package/dist/src/ui/components/messages/UserMessage.d.ts +0 -11
  535. package/dist/src/ui/components/messages/UserMessage.js +0 -12
  536. package/dist/src/ui/components/messages/UserMessage.js.map +0 -1
  537. package/dist/src/ui/components/messages/UserShellMessage.d.ts +0 -11
  538. package/dist/src/ui/components/messages/UserShellMessage.js +0 -9
  539. package/dist/src/ui/components/messages/UserShellMessage.js.map +0 -1
  540. package/dist/src/ui/components/shared/MaxSizedBox.d.ts +0 -61
  541. package/dist/src/ui/components/shared/MaxSizedBox.js +0 -451
  542. package/dist/src/ui/components/shared/MaxSizedBox.js.map +0 -1
  543. package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +0 -6
  544. package/dist/src/ui/components/shared/MaxSizedBox.test.js +0 -154
  545. package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +0 -1
  546. package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +0 -46
  547. package/dist/src/ui/components/shared/RadioButtonSelect.js +0 -121
  548. package/dist/src/ui/components/shared/RadioButtonSelect.js.map +0 -1
  549. package/dist/src/ui/components/shared/RadioButtonSelect.test.d.ts +0 -6
  550. package/dist/src/ui/components/shared/RadioButtonSelect.test.js +0 -111
  551. package/dist/src/ui/components/shared/RadioButtonSelect.test.js.map +0 -1
  552. package/dist/src/ui/components/shared/text-buffer.d.ts +0 -467
  553. package/dist/src/ui/components/shared/text-buffer.js +0 -1533
  554. package/dist/src/ui/components/shared/text-buffer.js.map +0 -1
  555. package/dist/src/ui/components/shared/vim-buffer-actions.d.ts +0 -72
  556. package/dist/src/ui/components/shared/vim-buffer-actions.js +0 -552
  557. package/dist/src/ui/components/shared/vim-buffer-actions.js.map +0 -1
  558. package/dist/src/ui/constants.d.ts +0 -9
  559. package/dist/src/ui/constants.js +0 -13
  560. package/dist/src/ui/constants.js.map +0 -1
  561. package/dist/src/ui/contexts/KeypressContext.d.ts +0 -30
  562. package/dist/src/ui/contexts/KeypressContext.js +0 -331
  563. package/dist/src/ui/contexts/KeypressContext.js.map +0 -1
  564. package/dist/src/ui/contexts/KeypressContext.test.d.ts +0 -6
  565. package/dist/src/ui/contexts/KeypressContext.test.js +0 -275
  566. package/dist/src/ui/contexts/KeypressContext.test.js.map +0 -1
  567. package/dist/src/ui/contexts/OverflowContext.d.ts +0 -19
  568. package/dist/src/ui/contexts/OverflowContext.js +0 -43
  569. package/dist/src/ui/contexts/OverflowContext.js.map +0 -1
  570. package/dist/src/ui/contexts/SessionContext.d.ts +0 -39
  571. package/dist/src/ui/contexts/SessionContext.js +0 -60
  572. package/dist/src/ui/contexts/SessionContext.js.map +0 -1
  573. package/dist/src/ui/contexts/SettingsContext.d.ts +0 -9
  574. package/dist/src/ui/contexts/SettingsContext.js +0 -15
  575. package/dist/src/ui/contexts/SettingsContext.js.map +0 -1
  576. package/dist/src/ui/contexts/StreamingContext.d.ts +0 -9
  577. package/dist/src/ui/contexts/StreamingContext.js +0 -15
  578. package/dist/src/ui/contexts/StreamingContext.js.map +0 -1
  579. package/dist/src/ui/contexts/VimModeContext.d.ts +0 -19
  580. package/dist/src/ui/contexts/VimModeContext.js +0 -48
  581. package/dist/src/ui/contexts/VimModeContext.js.map +0 -1
  582. package/dist/src/ui/editors/editorSettingsManager.d.ts +0 -19
  583. package/dist/src/ui/editors/editorSettingsManager.js +0 -47
  584. package/dist/src/ui/editors/editorSettingsManager.js.map +0 -1
  585. package/dist/src/ui/hooks/atCommandProcessor.d.ts +0 -31
  586. package/dist/src/ui/hooks/atCommandProcessor.js +0 -365
  587. package/dist/src/ui/hooks/atCommandProcessor.js.map +0 -1
  588. package/dist/src/ui/hooks/atCommandProcessor.test.d.ts +0 -6
  589. package/dist/src/ui/hooks/atCommandProcessor.test.js +0 -824
  590. package/dist/src/ui/hooks/atCommandProcessor.test.js.map +0 -1
  591. package/dist/src/ui/hooks/shellCommandProcessor.d.ts +0 -17
  592. package/dist/src/ui/hooks/shellCommandProcessor.js +0 -233
  593. package/dist/src/ui/hooks/shellCommandProcessor.js.map +0 -1
  594. package/dist/src/ui/hooks/shellCommandProcessor.test.d.ts +0 -6
  595. package/dist/src/ui/hooks/shellCommandProcessor.test.js +0 -328
  596. package/dist/src/ui/hooks/shellCommandProcessor.test.js.map +0 -1
  597. package/dist/src/ui/hooks/slashCommandProcessor.d.ts +0 -28
  598. package/dist/src/ui/hooks/slashCommandProcessor.js +0 -459
  599. package/dist/src/ui/hooks/slashCommandProcessor.js.map +0 -1
  600. package/dist/src/ui/hooks/useAtCompletion.d.ts +0 -23
  601. package/dist/src/ui/hooks/useAtCompletion.js +0 -179
  602. package/dist/src/ui/hooks/useAtCompletion.js.map +0 -1
  603. package/dist/src/ui/hooks/useAuthCommand.d.ts +0 -14
  604. package/dist/src/ui/hooks/useAuthCommand.js +0 -100
  605. package/dist/src/ui/hooks/useAuthCommand.js.map +0 -1
  606. package/dist/src/ui/hooks/useAutoAcceptIndicator.d.ts +0 -10
  607. package/dist/src/ui/hooks/useAutoAcceptIndicator.js +0 -37
  608. package/dist/src/ui/hooks/useAutoAcceptIndicator.js.map +0 -1
  609. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.d.ts +0 -6
  610. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js +0 -190
  611. package/dist/src/ui/hooks/useAutoAcceptIndicator.test.js.map +0 -1
  612. package/dist/src/ui/hooks/useBracketedPaste.d.ts +0 -12
  613. package/dist/src/ui/hooks/useBracketedPaste.js +0 -32
  614. package/dist/src/ui/hooks/useBracketedPaste.js.map +0 -1
  615. package/dist/src/ui/hooks/useCommandCompletion.d.ts +0 -29
  616. package/dist/src/ui/hooks/useCommandCompletion.js +0 -165
  617. package/dist/src/ui/hooks/useCommandCompletion.js.map +0 -1
  618. package/dist/src/ui/hooks/useCompletion.d.ts +0 -24
  619. package/dist/src/ui/hooks/useCompletion.js +0 -88
  620. package/dist/src/ui/hooks/useCompletion.js.map +0 -1
  621. package/dist/src/ui/hooks/useConsoleMessages.d.ts +0 -12
  622. package/dist/src/ui/hooks/useConsoleMessages.js +0 -76
  623. package/dist/src/ui/hooks/useConsoleMessages.js.map +0 -1
  624. package/dist/src/ui/hooks/useEditorSettings.d.ts +0 -16
  625. package/dist/src/ui/hooks/useEditorSettings.js +0 -43
  626. package/dist/src/ui/hooks/useEditorSettings.js.map +0 -1
  627. package/dist/src/ui/hooks/useEditorSettings.test.d.ts +0 -6
  628. package/dist/src/ui/hooks/useEditorSettings.test.js +0 -164
  629. package/dist/src/ui/hooks/useEditorSettings.test.js.map +0 -1
  630. package/dist/src/ui/hooks/useFocus.d.ts +0 -10
  631. package/dist/src/ui/hooks/useFocus.js +0 -41
  632. package/dist/src/ui/hooks/useFocus.js.map +0 -1
  633. package/dist/src/ui/hooks/useFolderTrust.d.ts +0 -12
  634. package/dist/src/ui/hooks/useFolderTrust.js +0 -55
  635. package/dist/src/ui/hooks/useFolderTrust.js.map +0 -1
  636. package/dist/src/ui/hooks/useGeminiStream.d.ts +0 -24
  637. package/dist/src/ui/hooks/useGeminiStream.js +0 -653
  638. package/dist/src/ui/hooks/useGeminiStream.js.map +0 -1
  639. package/dist/src/ui/hooks/useGitBranchName.d.ts +0 -6
  640. package/dist/src/ui/hooks/useGitBranchName.js +0 -61
  641. package/dist/src/ui/hooks/useGitBranchName.js.map +0 -1
  642. package/dist/src/ui/hooks/useGitBranchName.test.d.ts +0 -6
  643. package/dist/src/ui/hooks/useGitBranchName.test.js +0 -215
  644. package/dist/src/ui/hooks/useGitBranchName.test.js.map +0 -1
  645. package/dist/src/ui/hooks/useHistoryManager.d.ts +0 -22
  646. package/dist/src/ui/hooks/useHistoryManager.js +0 -72
  647. package/dist/src/ui/hooks/useHistoryManager.js.map +0 -1
  648. package/dist/src/ui/hooks/useHistoryManager.test.d.ts +0 -6
  649. package/dist/src/ui/hooks/useHistoryManager.test.js +0 -171
  650. package/dist/src/ui/hooks/useHistoryManager.test.js.map +0 -1
  651. package/dist/src/ui/hooks/useInputHistory.d.ts +0 -19
  652. package/dist/src/ui/hooks/useInputHistory.js +0 -84
  653. package/dist/src/ui/hooks/useInputHistory.js.map +0 -1
  654. package/dist/src/ui/hooks/useInputHistory.test.d.ts +0 -6
  655. package/dist/src/ui/hooks/useInputHistory.test.js +0 -207
  656. package/dist/src/ui/hooks/useInputHistory.test.js.map +0 -1
  657. package/dist/src/ui/hooks/useKeypress.d.ts +0 -17
  658. package/dist/src/ui/hooks/useKeypress.js +0 -27
  659. package/dist/src/ui/hooks/useKeypress.js.map +0 -1
  660. package/dist/src/ui/hooks/useKittyKeyboardProtocol.d.ts +0 -15
  661. package/dist/src/ui/hooks/useKittyKeyboardProtocol.js +0 -20
  662. package/dist/src/ui/hooks/useKittyKeyboardProtocol.js.map +0 -1
  663. package/dist/src/ui/hooks/useLoadingIndicator.d.ts +0 -10
  664. package/dist/src/ui/hooks/useLoadingIndicator.js +0 -44
  665. package/dist/src/ui/hooks/useLoadingIndicator.js.map +0 -1
  666. package/dist/src/ui/hooks/useLoadingIndicator.test.d.ts +0 -6
  667. package/dist/src/ui/hooks/useLoadingIndicator.test.js +0 -91
  668. package/dist/src/ui/hooks/useLoadingIndicator.test.js.map +0 -1
  669. package/dist/src/ui/hooks/useLogger.d.ts +0 -10
  670. package/dist/src/ui/hooks/useLogger.js +0 -29
  671. package/dist/src/ui/hooks/useLogger.js.map +0 -1
  672. package/dist/src/ui/hooks/useMessageQueue.d.ts +0 -22
  673. package/dist/src/ui/hooks/useMessageQueue.js +0 -49
  674. package/dist/src/ui/hooks/useMessageQueue.js.map +0 -1
  675. package/dist/src/ui/hooks/useMessageQueue.test.d.ts +0 -6
  676. package/dist/src/ui/hooks/useMessageQueue.test.js +0 -158
  677. package/dist/src/ui/hooks/useMessageQueue.test.js.map +0 -1
  678. package/dist/src/ui/hooks/usePhraseCycler.d.ts +0 -14
  679. package/dist/src/ui/hooks/usePhraseCycler.js +0 -187
  680. package/dist/src/ui/hooks/usePhraseCycler.js.map +0 -1
  681. package/dist/src/ui/hooks/usePrivacySettings.d.ts +0 -16
  682. package/dist/src/ui/hooks/usePrivacySettings.js +0 -119
  683. package/dist/src/ui/hooks/usePrivacySettings.js.map +0 -1
  684. package/dist/src/ui/hooks/usePrivacySettings.test.d.ts +0 -6
  685. package/dist/src/ui/hooks/usePrivacySettings.test.js +0 -154
  686. package/dist/src/ui/hooks/usePrivacySettings.test.js.map +0 -1
  687. package/dist/src/ui/hooks/useReactToolScheduler.d.ts +0 -33
  688. package/dist/src/ui/hooks/useReactToolScheduler.js +0 -187
  689. package/dist/src/ui/hooks/useReactToolScheduler.js.map +0 -1
  690. package/dist/src/ui/hooks/useRefreshMemoryCommand.d.ts +0 -6
  691. package/dist/src/ui/hooks/useRefreshMemoryCommand.js +0 -7
  692. package/dist/src/ui/hooks/useRefreshMemoryCommand.js.map +0 -1
  693. package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +0 -19
  694. package/dist/src/ui/hooks/useReverseSearchCompletion.js +0 -56
  695. package/dist/src/ui/hooks/useReverseSearchCompletion.js.map +0 -1
  696. package/dist/src/ui/hooks/useReverseSearchCompletion.test.d.ts +0 -6
  697. package/dist/src/ui/hooks/useReverseSearchCompletion.test.js +0 -163
  698. package/dist/src/ui/hooks/useReverseSearchCompletion.test.js.map +0 -1
  699. package/dist/src/ui/hooks/useSettingsCommand.d.ts +0 -10
  700. package/dist/src/ui/hooks/useSettingsCommand.js +0 -21
  701. package/dist/src/ui/hooks/useSettingsCommand.js.map +0 -1
  702. package/dist/src/ui/hooks/useShellHistory.d.ts +0 -13
  703. package/dist/src/ui/hooks/useShellHistory.js +0 -112
  704. package/dist/src/ui/hooks/useShellHistory.js.map +0 -1
  705. package/dist/src/ui/hooks/useShellHistory.test.d.ts +0 -6
  706. package/dist/src/ui/hooks/useShellHistory.test.js +0 -162
  707. package/dist/src/ui/hooks/useShellHistory.test.js.map +0 -1
  708. package/dist/src/ui/hooks/useShowMemoryCommand.d.ts +0 -9
  709. package/dist/src/ui/hooks/useShowMemoryCommand.js +0 -58
  710. package/dist/src/ui/hooks/useShowMemoryCommand.js.map +0 -1
  711. package/dist/src/ui/hooks/useSlashCompletion.d.ts +0 -20
  712. package/dist/src/ui/hooks/useSlashCompletion.js +0 -135
  713. package/dist/src/ui/hooks/useSlashCompletion.js.map +0 -1
  714. package/dist/src/ui/hooks/useSlashCompletion.test.d.ts +0 -6
  715. package/dist/src/ui/hooks/useSlashCompletion.test.js +0 -272
  716. package/dist/src/ui/hooks/useSlashCompletion.test.js.map +0 -1
  717. package/dist/src/ui/hooks/useStateAndRef.d.ts +0 -7
  718. package/dist/src/ui/hooks/useStateAndRef.js +0 -26
  719. package/dist/src/ui/hooks/useStateAndRef.js.map +0 -1
  720. package/dist/src/ui/hooks/useTerminalSize.d.ts +0 -9
  721. package/dist/src/ui/hooks/useTerminalSize.js +0 -27
  722. package/dist/src/ui/hooks/useTerminalSize.js.map +0 -1
  723. package/dist/src/ui/hooks/useThemeCommand.d.ts +0 -15
  724. package/dist/src/ui/hooks/useThemeCommand.js +0 -79
  725. package/dist/src/ui/hooks/useThemeCommand.js.map +0 -1
  726. package/dist/src/ui/hooks/useTimer.d.ts +0 -12
  727. package/dist/src/ui/hooks/useTimer.js +0 -58
  728. package/dist/src/ui/hooks/useTimer.js.map +0 -1
  729. package/dist/src/ui/hooks/useTimer.test.d.ts +0 -6
  730. package/dist/src/ui/hooks/useTimer.test.js +0 -90
  731. package/dist/src/ui/hooks/useTimer.test.js.map +0 -1
  732. package/dist/src/ui/hooks/useToolScheduler.test.d.ts +0 -6
  733. package/dist/src/ui/hooks/useToolScheduler.test.js +0 -845
  734. package/dist/src/ui/hooks/useToolScheduler.test.js.map +0 -1
  735. package/dist/src/ui/hooks/useWelcomeBack.d.ts +0 -52
  736. package/dist/src/ui/hooks/useWelcomeBack.js +0 -214
  737. package/dist/src/ui/hooks/useWelcomeBack.js.map +0 -1
  738. package/dist/src/ui/hooks/vim.d.ts +0 -28
  739. package/dist/src/ui/hooks/vim.js +0 -639
  740. package/dist/src/ui/hooks/vim.js.map +0 -1
  741. package/dist/src/ui/keyMatchers.d.ts +0 -26
  742. package/dist/src/ui/keyMatchers.js +0 -68
  743. package/dist/src/ui/keyMatchers.js.map +0 -1
  744. package/dist/src/ui/keyMatchers.test.d.ts +0 -6
  745. package/dist/src/ui/keyMatchers.test.js +0 -276
  746. package/dist/src/ui/keyMatchers.test.js.map +0 -1
  747. package/dist/src/ui/privacy/CloudFreePrivacyNotice.d.ts +0 -12
  748. package/dist/src/ui/privacy/CloudFreePrivacyNotice.js +0 -41
  749. package/dist/src/ui/privacy/CloudFreePrivacyNotice.js.map +0 -1
  750. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.d.ts +0 -10
  751. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js +0 -18
  752. package/dist/src/ui/privacy/CloudPaidPrivacyNotice.js.map +0 -1
  753. package/dist/src/ui/privacy/GeminiPrivacyNotice.d.ts +0 -10
  754. package/dist/src/ui/privacy/GeminiPrivacyNotice.js +0 -18
  755. package/dist/src/ui/privacy/GeminiPrivacyNotice.js.map +0 -1
  756. package/dist/src/ui/privacy/PrivacyNotice.d.ts +0 -12
  757. package/dist/src/ui/privacy/PrivacyNotice.js +0 -25
  758. package/dist/src/ui/privacy/PrivacyNotice.js.map +0 -1
  759. package/dist/src/ui/semantic-colors.d.ts +0 -7
  760. package/dist/src/ui/semantic-colors.js +0 -24
  761. package/dist/src/ui/semantic-colors.js.map +0 -1
  762. package/dist/src/ui/themes/ansi-light.d.ts +0 -7
  763. package/dist/src/ui/themes/ansi-light.js +0 -142
  764. package/dist/src/ui/themes/ansi-light.js.map +0 -1
  765. package/dist/src/ui/themes/ansi.d.ts +0 -7
  766. package/dist/src/ui/themes/ansi.js +0 -152
  767. package/dist/src/ui/themes/ansi.js.map +0 -1
  768. package/dist/src/ui/themes/atom-one-dark.d.ts +0 -7
  769. package/dist/src/ui/themes/atom-one-dark.js +0 -139
  770. package/dist/src/ui/themes/atom-one-dark.js.map +0 -1
  771. package/dist/src/ui/themes/ayu-light.d.ts +0 -7
  772. package/dist/src/ui/themes/ayu-light.js +0 -131
  773. package/dist/src/ui/themes/ayu-light.js.map +0 -1
  774. package/dist/src/ui/themes/ayu.d.ts +0 -7
  775. package/dist/src/ui/themes/ayu.js +0 -105
  776. package/dist/src/ui/themes/ayu.js.map +0 -1
  777. package/dist/src/ui/themes/color-utils.d.ts +0 -21
  778. package/dist/src/ui/themes/color-utils.js +0 -221
  779. package/dist/src/ui/themes/color-utils.js.map +0 -1
  780. package/dist/src/ui/themes/color-utils.test.d.ts +0 -6
  781. package/dist/src/ui/themes/color-utils.test.js +0 -197
  782. package/dist/src/ui/themes/color-utils.test.js.map +0 -1
  783. package/dist/src/ui/themes/default-light.d.ts +0 -7
  784. package/dist/src/ui/themes/default-light.js +0 -101
  785. package/dist/src/ui/themes/default-light.js.map +0 -1
  786. package/dist/src/ui/themes/default.d.ts +0 -7
  787. package/dist/src/ui/themes/default.js +0 -144
  788. package/dist/src/ui/themes/default.js.map +0 -1
  789. package/dist/src/ui/themes/dracula.d.ts +0 -7
  790. package/dist/src/ui/themes/dracula.js +0 -116
  791. package/dist/src/ui/themes/dracula.js.map +0 -1
  792. package/dist/src/ui/themes/fss-code-dark.d.ts +0 -7
  793. package/dist/src/ui/themes/fss-code-dark.js +0 -148
  794. package/dist/src/ui/themes/fss-code-dark.js.map +0 -1
  795. package/dist/src/ui/themes/fss-dark.d.ts +0 -7
  796. package/dist/src/ui/themes/fss-dark.js +0 -105
  797. package/dist/src/ui/themes/fss-dark.js.map +0 -1
  798. package/dist/src/ui/themes/fss-light.d.ts +0 -7
  799. package/dist/src/ui/themes/fss-light.js +0 -131
  800. package/dist/src/ui/themes/fss-light.js.map +0 -1
  801. package/dist/src/ui/themes/github-dark.d.ts +0 -7
  802. package/dist/src/ui/themes/github-dark.js +0 -139
  803. package/dist/src/ui/themes/github-dark.js.map +0 -1
  804. package/dist/src/ui/themes/github-light.d.ts +0 -7
  805. package/dist/src/ui/themes/github-light.js +0 -141
  806. package/dist/src/ui/themes/github-light.js.map +0 -1
  807. package/dist/src/ui/themes/googlecode.d.ts +0 -7
  808. package/dist/src/ui/themes/googlecode.js +0 -138
  809. package/dist/src/ui/themes/googlecode.js.map +0 -1
  810. package/dist/src/ui/themes/no-color.d.ts +0 -7
  811. package/dist/src/ui/themes/no-color.js +0 -115
  812. package/dist/src/ui/themes/no-color.js.map +0 -1
  813. package/dist/src/ui/themes/qwen-dark.d.ts +0 -7
  814. package/dist/src/ui/themes/qwen-dark.js +0 -109
  815. package/dist/src/ui/themes/qwen-dark.js.map +0 -1
  816. package/dist/src/ui/themes/qwen-light.d.ts +0 -7
  817. package/dist/src/ui/themes/qwen-light.js +0 -135
  818. package/dist/src/ui/themes/qwen-light.js.map +0 -1
  819. package/dist/src/ui/themes/semantic-tokens.d.ts +0 -37
  820. package/dist/src/ui/themes/semantic-tokens.js +0 -94
  821. package/dist/src/ui/themes/semantic-tokens.js.map +0 -1
  822. package/dist/src/ui/themes/shades-of-purple.d.ts +0 -11
  823. package/dist/src/ui/themes/shades-of-purple.js +0 -305
  824. package/dist/src/ui/themes/shades-of-purple.js.map +0 -1
  825. package/dist/src/ui/themes/theme-manager.d.ts +0 -64
  826. package/dist/src/ui/themes/theme-manager.js +0 -209
  827. package/dist/src/ui/themes/theme-manager.js.map +0 -1
  828. package/dist/src/ui/themes/theme-manager.test.d.ts +0 -6
  829. package/dist/src/ui/themes/theme-manager.test.js +0 -83
  830. package/dist/src/ui/themes/theme-manager.test.js.map +0 -1
  831. package/dist/src/ui/themes/theme.d.ts +0 -130
  832. package/dist/src/ui/themes/theme.js +0 -351
  833. package/dist/src/ui/themes/theme.js.map +0 -1
  834. package/dist/src/ui/themes/xcode.d.ts +0 -7
  835. package/dist/src/ui/themes/xcode.js +0 -146
  836. package/dist/src/ui/themes/xcode.js.map +0 -1
  837. package/dist/src/ui/types.d.ts +0 -191
  838. package/dist/src/ui/types.js +0 -44
  839. package/dist/src/ui/types.js.map +0 -1
  840. package/dist/src/ui/utils/CodeColorizer.d.ts +0 -17
  841. package/dist/src/ui/utils/CodeColorizer.js +0 -110
  842. package/dist/src/ui/utils/CodeColorizer.js.map +0 -1
  843. package/dist/src/ui/utils/ConsolePatcher.d.ts +0 -25
  844. package/dist/src/ui/utils/ConsolePatcher.js +0 -52
  845. package/dist/src/ui/utils/ConsolePatcher.js.map +0 -1
  846. package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +0 -16
  847. package/dist/src/ui/utils/InlineMarkdownRenderer.js +0 -111
  848. package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +0 -1
  849. package/dist/src/ui/utils/MarkdownDisplay.d.ts +0 -14
  850. package/dist/src/ui/utils/MarkdownDisplay.js +0 -207
  851. package/dist/src/ui/utils/MarkdownDisplay.js.map +0 -1
  852. package/dist/src/ui/utils/MarkdownDisplay.test.d.ts +0 -6
  853. package/dist/src/ui/utils/MarkdownDisplay.test.js +0 -151
  854. package/dist/src/ui/utils/MarkdownDisplay.test.js.map +0 -1
  855. package/dist/src/ui/utils/TableRenderer.d.ts +0 -17
  856. package/dist/src/ui/utils/TableRenderer.js +0 -84
  857. package/dist/src/ui/utils/TableRenderer.js.map +0 -1
  858. package/dist/src/ui/utils/clipboardUtils.d.ts +0 -22
  859. package/dist/src/ui/utils/clipboardUtils.js +0 -127
  860. package/dist/src/ui/utils/clipboardUtils.js.map +0 -1
  861. package/dist/src/ui/utils/clipboardUtils.test.d.ts +0 -6
  862. package/dist/src/ui/utils/clipboardUtils.test.js +0 -65
  863. package/dist/src/ui/utils/clipboardUtils.test.js.map +0 -1
  864. package/dist/src/ui/utils/commandUtils.d.ts +0 -24
  865. package/dist/src/ui/utils/commandUtils.js +0 -93
  866. package/dist/src/ui/utils/commandUtils.js.map +0 -1
  867. package/dist/src/ui/utils/commandUtils.test.d.ts +0 -6
  868. package/dist/src/ui/utils/commandUtils.test.js +0 -294
  869. package/dist/src/ui/utils/commandUtils.test.js.map +0 -1
  870. package/dist/src/ui/utils/computeStats.d.ts +0 -10
  871. package/dist/src/ui/utils/computeStats.js +0 -57
  872. package/dist/src/ui/utils/computeStats.js.map +0 -1
  873. package/dist/src/ui/utils/displayUtils.d.ts +0 -17
  874. package/dist/src/ui/utils/displayUtils.js +0 -24
  875. package/dist/src/ui/utils/displayUtils.js.map +0 -1
  876. package/dist/src/ui/utils/displayUtils.test.d.ts +0 -6
  877. package/dist/src/ui/utils/displayUtils.test.js +0 -42
  878. package/dist/src/ui/utils/displayUtils.test.js.map +0 -1
  879. package/dist/src/ui/utils/formatters.d.ts +0 -13
  880. package/dist/src/ui/utils/formatters.js +0 -56
  881. package/dist/src/ui/utils/formatters.js.map +0 -1
  882. package/dist/src/ui/utils/formatters.test.d.ts +0 -6
  883. package/dist/src/ui/utils/formatters.test.js +0 -56
  884. package/dist/src/ui/utils/formatters.test.js.map +0 -1
  885. package/dist/src/ui/utils/isNarrowWidth.d.ts +0 -6
  886. package/dist/src/ui/utils/isNarrowWidth.js +0 -9
  887. package/dist/src/ui/utils/isNarrowWidth.js.map +0 -1
  888. package/dist/src/ui/utils/kittyProtocolDetector.d.ts +0 -13
  889. package/dist/src/ui/utils/kittyProtocolDetector.js +0 -88
  890. package/dist/src/ui/utils/kittyProtocolDetector.js.map +0 -1
  891. package/dist/src/ui/utils/markdownUtilities.d.ts +0 -6
  892. package/dist/src/ui/utils/markdownUtilities.js +0 -110
  893. package/dist/src/ui/utils/markdownUtilities.js.map +0 -1
  894. package/dist/src/ui/utils/markdownUtilities.test.d.ts +0 -6
  895. package/dist/src/ui/utils/markdownUtilities.test.js +0 -42
  896. package/dist/src/ui/utils/markdownUtilities.test.js.map +0 -1
  897. package/dist/src/ui/utils/platformConstants.d.ts +0 -45
  898. package/dist/src/ui/utils/platformConstants.js +0 -46
  899. package/dist/src/ui/utils/platformConstants.js.map +0 -1
  900. package/dist/src/ui/utils/terminalSetup.d.ts +0 -30
  901. package/dist/src/ui/utils/terminalSetup.js +0 -281
  902. package/dist/src/ui/utils/terminalSetup.js.map +0 -1
  903. package/dist/src/ui/utils/textUtils.d.ts +0 -14
  904. package/dist/src/ui/utils/textUtils.js +0 -36
  905. package/dist/src/ui/utils/textUtils.js.map +0 -1
  906. package/dist/src/ui/utils/updateCheck.d.ts +0 -12
  907. package/dist/src/ui/utils/updateCheck.js +0 -78
  908. package/dist/src/ui/utils/updateCheck.js.map +0 -1
  909. package/dist/src/ui/utils/updateCheck.test.d.ts +0 -6
  910. package/dist/src/ui/utils/updateCheck.test.js +0 -145
  911. package/dist/src/ui/utils/updateCheck.test.js.map +0 -1
  912. package/dist/src/utils/checks.d.ts +0 -19
  913. package/dist/src/utils/checks.js +0 -24
  914. package/dist/src/utils/checks.js.map +0 -1
  915. package/dist/src/utils/cleanup.d.ts +0 -8
  916. package/dist/src/utils/cleanup.js +0 -34
  917. package/dist/src/utils/cleanup.js.map +0 -1
  918. package/dist/src/utils/dialogScopeUtils.d.ts +0 -31
  919. package/dist/src/utils/dialogScopeUtils.js +0 -48
  920. package/dist/src/utils/dialogScopeUtils.js.map +0 -1
  921. package/dist/src/utils/events.d.ts +0 -11
  922. package/dist/src/utils/events.js +0 -13
  923. package/dist/src/utils/events.js.map +0 -1
  924. package/dist/src/utils/gitUtils.d.ts +0 -30
  925. package/dist/src/utils/gitUtils.js +0 -89
  926. package/dist/src/utils/gitUtils.js.map +0 -1
  927. package/dist/src/utils/gitUtils.test.d.ts +0 -6
  928. package/dist/src/utils/gitUtils.test.js +0 -113
  929. package/dist/src/utils/gitUtils.test.js.map +0 -1
  930. package/dist/src/utils/handleAutoUpdate.d.ts +0 -11
  931. package/dist/src/utils/handleAutoUpdate.js +0 -101
  932. package/dist/src/utils/handleAutoUpdate.js.map +0 -1
  933. package/dist/src/utils/installationInfo.d.ts +0 -23
  934. package/dist/src/utils/installationInfo.js +0 -169
  935. package/dist/src/utils/installationInfo.js.map +0 -1
  936. package/dist/src/utils/installationInfo.test.d.ts +0 -6
  937. package/dist/src/utils/installationInfo.test.js +0 -242
  938. package/dist/src/utils/installationInfo.test.js.map +0 -1
  939. package/dist/src/utils/package.d.ts +0 -12
  940. package/dist/src/utils/package.js +0 -24
  941. package/dist/src/utils/package.js.map +0 -1
  942. package/dist/src/utils/readStdin.d.ts +0 -6
  943. package/dist/src/utils/readStdin.js +0 -44
  944. package/dist/src/utils/readStdin.js.map +0 -1
  945. package/dist/src/utils/resolvePath.d.ts +0 -6
  946. package/dist/src/utils/resolvePath.js +0 -21
  947. package/dist/src/utils/resolvePath.js.map +0 -1
  948. package/dist/src/utils/sandbox.d.ts +0 -7
  949. package/dist/src/utils/sandbox.js +0 -739
  950. package/dist/src/utils/sandbox.js.map +0 -1
  951. package/dist/src/utils/settingsUtils.d.ts +0 -134
  952. package/dist/src/utils/settingsUtils.js +0 -336
  953. package/dist/src/utils/settingsUtils.js.map +0 -1
  954. package/dist/src/utils/settingsUtils.test.d.ts +0 -6
  955. package/dist/src/utils/settingsUtils.test.js +0 -514
  956. package/dist/src/utils/settingsUtils.test.js.map +0 -1
  957. package/dist/src/utils/spawnWrapper.d.ts +0 -7
  958. package/dist/src/utils/spawnWrapper.js +0 -8
  959. package/dist/src/utils/spawnWrapper.js.map +0 -1
  960. package/dist/src/utils/startupWarnings.d.ts +0 -6
  961. package/dist/src/utils/startupWarnings.js +0 -40
  962. package/dist/src/utils/startupWarnings.js.map +0 -1
  963. package/dist/src/utils/updateEventEmitter.d.ts +0 -11
  964. package/dist/src/utils/updateEventEmitter.js +0 -12
  965. package/dist/src/utils/updateEventEmitter.js.map +0 -1
  966. package/dist/src/utils/userStartupWarnings.d.ts +0 -6
  967. package/dist/src/utils/userStartupWarnings.js +0 -54
  968. package/dist/src/utils/userStartupWarnings.js.map +0 -1
  969. package/dist/src/utils/userStartupWarnings.test.d.ts +0 -6
  970. package/dist/src/utils/userStartupWarnings.test.js +0 -67
  971. package/dist/src/utils/userStartupWarnings.test.js.map +0 -1
  972. package/dist/src/utils/version.d.ts +0 -6
  973. package/dist/src/utils/version.js +0 -11
  974. package/dist/src/utils/version.js.map +0 -1
  975. package/dist/src/validateNonInterActiveAuth.d.ts +0 -7
  976. package/dist/src/validateNonInterActiveAuth.js +0 -51
  977. package/dist/src/validateNonInterActiveAuth.js.map +0 -1
  978. package/dist/src/zed-integration/acp.d.ts +0 -63
  979. package/dist/src/zed-integration/acp.js +0 -225
  980. package/dist/src/zed-integration/acp.js.map +0 -1
  981. package/dist/src/zed-integration/fileSystemService.d.ts +0 -19
  982. package/dist/src/zed-integration/fileSystemService.js +0 -43
  983. package/dist/src/zed-integration/fileSystemService.js.map +0 -1
  984. package/dist/src/zed-integration/schema.d.ts +0 -11782
  985. package/dist/src/zed-integration/schema.js +0 -311
  986. package/dist/src/zed-integration/schema.js.map +0 -1
  987. package/dist/src/zed-integration/zedIntegration.d.ts +0 -10
  988. package/dist/src/zed-integration/zedIntegration.js +0 -765
  989. package/dist/src/zed-integration/zedIntegration.js.map +0 -1
  990. package/dist/tsconfig.tsbuildinfo +0 -1
  991. /package/{dist/src/utils → bundle}/sandbox-macos-permissive-closed.sb +0 -0
  992. /package/{dist/src/utils → bundle}/sandbox-macos-permissive-open.sb +0 -0
  993. /package/{dist/src/utils → bundle}/sandbox-macos-permissive-proxied.sb +0 -0
  994. /package/{dist/src/utils → bundle}/sandbox-macos-restrictive-closed.sb +0 -0
  995. /package/{dist/src/utils → bundle}/sandbox-macos-restrictive-open.sb +0 -0
  996. /package/{dist/src/utils → bundle}/sandbox-macos-restrictive-proxied.sb +0 -0
@@ -1,1533 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2025 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
- import stripAnsi from 'strip-ansi';
7
- import { stripVTControlCharacters } from 'util';
8
- import { spawnSync } from 'child_process';
9
- import fs from 'fs';
10
- import os from 'os';
11
- import pathMod from 'path';
12
- import { useState, useCallback, useEffect, useMemo, useReducer } from 'react';
13
- import stringWidth from 'string-width';
14
- import { unescapePath } from 'fss-link-core';
15
- import { toCodePoints, cpLen, cpSlice } from '../../utils/textUtils.js';
16
- import { handleVimAction } from './vim-buffer-actions.js';
17
- // Simple helper for word‑wise ops.
18
- function isWordChar(ch) {
19
- if (ch === undefined) {
20
- return false;
21
- }
22
- return !/[\s,.;!?]/.test(ch);
23
- }
24
- // Helper functions for line-based word navigation
25
- 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
26
- export const isWhitespace = (char) => /\s/.test(char);
27
- // Check if a character is a combining mark (only diacritics for now)
28
- export const isCombiningMark = (char) => /\p{M}/u.test(char);
29
- // Check if a character should be considered part of a word (including combining marks)
30
- export const isWordCharWithCombining = (char) => isWordCharStrict(char) || isCombiningMark(char);
31
- // Get the script of a character (simplified for common scripts)
32
- export const getCharScript = (char) => {
33
- if (/[\p{Script=Latin}]/u.test(char))
34
- return 'latin'; // All Latin script chars including diacritics
35
- if (/[\p{Script=Han}]/u.test(char))
36
- return 'han'; // Chinese
37
- if (/[\p{Script=Arabic}]/u.test(char))
38
- return 'arabic';
39
- if (/[\p{Script=Hiragana}]/u.test(char))
40
- return 'hiragana';
41
- if (/[\p{Script=Katakana}]/u.test(char))
42
- return 'katakana';
43
- if (/[\p{Script=Cyrillic}]/u.test(char))
44
- return 'cyrillic';
45
- return 'other';
46
- };
47
- // Check if two characters are from different scripts (indicating word boundary)
48
- export const isDifferentScript = (char1, char2) => {
49
- if (!isWordCharStrict(char1) || !isWordCharStrict(char2))
50
- return false;
51
- return getCharScript(char1) !== getCharScript(char2);
52
- };
53
- // Find next word start within a line, starting from col
54
- export const findNextWordStartInLine = (line, col) => {
55
- const chars = toCodePoints(line);
56
- let i = col;
57
- if (i >= chars.length)
58
- return null;
59
- const currentChar = chars[i];
60
- // Skip current word/sequence based on character type
61
- if (isWordCharStrict(currentChar)) {
62
- while (i < chars.length && isWordCharWithCombining(chars[i])) {
63
- // Check for script boundary - if next character is from different script, stop here
64
- if (i + 1 < chars.length &&
65
- isWordCharStrict(chars[i + 1]) &&
66
- isDifferentScript(chars[i], chars[i + 1])) {
67
- i++; // Include current character
68
- break; // Stop at script boundary
69
- }
70
- i++;
71
- }
72
- }
73
- else if (!isWhitespace(currentChar)) {
74
- while (i < chars.length &&
75
- !isWordCharStrict(chars[i]) &&
76
- !isWhitespace(chars[i])) {
77
- i++;
78
- }
79
- }
80
- // Skip whitespace
81
- while (i < chars.length && isWhitespace(chars[i])) {
82
- i++;
83
- }
84
- return i < chars.length ? i : null;
85
- };
86
- // Find previous word start within a line
87
- export const findPrevWordStartInLine = (line, col) => {
88
- const chars = toCodePoints(line);
89
- let i = col;
90
- if (i <= 0)
91
- return null;
92
- i--;
93
- // Skip whitespace moving backwards
94
- while (i >= 0 && isWhitespace(chars[i])) {
95
- i--;
96
- }
97
- if (i < 0)
98
- return null;
99
- if (isWordCharStrict(chars[i])) {
100
- // We're in a word, move to its beginning
101
- while (i >= 0 && isWordCharStrict(chars[i])) {
102
- // Check for script boundary - if previous character is from different script, stop here
103
- if (i - 1 >= 0 &&
104
- isWordCharStrict(chars[i - 1]) &&
105
- isDifferentScript(chars[i], chars[i - 1])) {
106
- return i; // Return current position at script boundary
107
- }
108
- i--;
109
- }
110
- return i + 1;
111
- }
112
- else {
113
- // We're in punctuation, move to its beginning
114
- while (i >= 0 && !isWordCharStrict(chars[i]) && !isWhitespace(chars[i])) {
115
- i--;
116
- }
117
- return i + 1;
118
- }
119
- };
120
- // Find word end within a line
121
- export const findWordEndInLine = (line, col) => {
122
- const chars = toCodePoints(line);
123
- let i = col;
124
- // If we're already at the end of a word (including punctuation sequences), advance to next word
125
- // This includes both regular word endings and script boundaries
126
- const atEndOfWordChar = i < chars.length &&
127
- isWordCharWithCombining(chars[i]) &&
128
- (i + 1 >= chars.length ||
129
- !isWordCharWithCombining(chars[i + 1]) ||
130
- (isWordCharStrict(chars[i]) &&
131
- i + 1 < chars.length &&
132
- isWordCharStrict(chars[i + 1]) &&
133
- isDifferentScript(chars[i], chars[i + 1])));
134
- const atEndOfPunctuation = i < chars.length &&
135
- !isWordCharWithCombining(chars[i]) &&
136
- !isWhitespace(chars[i]) &&
137
- (i + 1 >= chars.length ||
138
- isWhitespace(chars[i + 1]) ||
139
- isWordCharWithCombining(chars[i + 1]));
140
- if (atEndOfWordChar || atEndOfPunctuation) {
141
- // We're at the end of a word or punctuation sequence, move forward to find next word
142
- i++;
143
- // Skip whitespace to find next word or punctuation
144
- while (i < chars.length && isWhitespace(chars[i])) {
145
- i++;
146
- }
147
- }
148
- // If we're not on a word character, find the next word or punctuation sequence
149
- if (i < chars.length && !isWordCharWithCombining(chars[i])) {
150
- // Skip whitespace to find next word or punctuation
151
- while (i < chars.length && isWhitespace(chars[i])) {
152
- i++;
153
- }
154
- }
155
- // Move to end of current word (including combining marks, but stop at script boundaries)
156
- let foundWord = false;
157
- let lastBaseCharPos = -1;
158
- if (i < chars.length && isWordCharWithCombining(chars[i])) {
159
- // Handle word characters
160
- while (i < chars.length && isWordCharWithCombining(chars[i])) {
161
- foundWord = true;
162
- // Track the position of the last base character (not combining mark)
163
- if (isWordCharStrict(chars[i])) {
164
- lastBaseCharPos = i;
165
- }
166
- // Check if next character is from a different script (word boundary)
167
- if (i + 1 < chars.length &&
168
- isWordCharStrict(chars[i + 1]) &&
169
- isDifferentScript(chars[i], chars[i + 1])) {
170
- i++; // Include current character
171
- if (isWordCharStrict(chars[i - 1])) {
172
- lastBaseCharPos = i - 1;
173
- }
174
- break; // Stop at script boundary
175
- }
176
- i++;
177
- }
178
- }
179
- else if (i < chars.length && !isWhitespace(chars[i])) {
180
- // Handle punctuation sequences (like ████)
181
- while (i < chars.length &&
182
- !isWordCharStrict(chars[i]) &&
183
- !isWhitespace(chars[i])) {
184
- foundWord = true;
185
- lastBaseCharPos = i;
186
- i++;
187
- }
188
- }
189
- // Only return a position if we actually found a word
190
- // Return the position of the last base character, not combining marks
191
- if (foundWord && lastBaseCharPos >= col) {
192
- return lastBaseCharPos;
193
- }
194
- return null;
195
- };
196
- // Find next word across lines
197
- export const findNextWordAcrossLines = (lines, cursorRow, cursorCol, searchForWordStart) => {
198
- // First try current line
199
- const currentLine = lines[cursorRow] || '';
200
- const colInCurrentLine = searchForWordStart
201
- ? findNextWordStartInLine(currentLine, cursorCol)
202
- : findWordEndInLine(currentLine, cursorCol);
203
- if (colInCurrentLine !== null) {
204
- return { row: cursorRow, col: colInCurrentLine };
205
- }
206
- // Search subsequent lines
207
- for (let row = cursorRow + 1; row < lines.length; row++) {
208
- const line = lines[row] || '';
209
- const chars = toCodePoints(line);
210
- // For empty lines, if we haven't found any words yet, return the empty line
211
- if (chars.length === 0) {
212
- // Check if there are any words in remaining lines
213
- let hasWordsInLaterLines = false;
214
- for (let laterRow = row + 1; laterRow < lines.length; laterRow++) {
215
- const laterLine = lines[laterRow] || '';
216
- const laterChars = toCodePoints(laterLine);
217
- let firstNonWhitespace = 0;
218
- while (firstNonWhitespace < laterChars.length &&
219
- isWhitespace(laterChars[firstNonWhitespace])) {
220
- firstNonWhitespace++;
221
- }
222
- if (firstNonWhitespace < laterChars.length) {
223
- hasWordsInLaterLines = true;
224
- break;
225
- }
226
- }
227
- // If no words in later lines, return the empty line
228
- if (!hasWordsInLaterLines) {
229
- return { row, col: 0 };
230
- }
231
- continue;
232
- }
233
- // Find first non-whitespace
234
- let firstNonWhitespace = 0;
235
- while (firstNonWhitespace < chars.length &&
236
- isWhitespace(chars[firstNonWhitespace])) {
237
- firstNonWhitespace++;
238
- }
239
- if (firstNonWhitespace < chars.length) {
240
- if (searchForWordStart) {
241
- return { row, col: firstNonWhitespace };
242
- }
243
- else {
244
- // For word end, find the end of the first word
245
- const endCol = findWordEndInLine(line, firstNonWhitespace);
246
- if (endCol !== null) {
247
- return { row, col: endCol };
248
- }
249
- }
250
- }
251
- }
252
- return null;
253
- };
254
- // Find previous word across lines
255
- export const findPrevWordAcrossLines = (lines, cursorRow, cursorCol) => {
256
- // First try current line
257
- const currentLine = lines[cursorRow] || '';
258
- const colInCurrentLine = findPrevWordStartInLine(currentLine, cursorCol);
259
- if (colInCurrentLine !== null) {
260
- return { row: cursorRow, col: colInCurrentLine };
261
- }
262
- // Search previous lines
263
- for (let row = cursorRow - 1; row >= 0; row--) {
264
- const line = lines[row] || '';
265
- const chars = toCodePoints(line);
266
- if (chars.length === 0)
267
- continue;
268
- // Find last word start
269
- let lastWordStart = chars.length;
270
- while (lastWordStart > 0 && isWhitespace(chars[lastWordStart - 1])) {
271
- lastWordStart--;
272
- }
273
- if (lastWordStart > 0) {
274
- // Find start of this word
275
- const wordStart = findPrevWordStartInLine(line, lastWordStart);
276
- if (wordStart !== null) {
277
- return { row, col: wordStart };
278
- }
279
- }
280
- }
281
- return null;
282
- };
283
- // Helper functions for vim line operations
284
- export const getPositionFromOffsets = (startOffset, endOffset, lines) => {
285
- let offset = 0;
286
- let startRow = 0;
287
- let startCol = 0;
288
- let endRow = 0;
289
- let endCol = 0;
290
- // Find start position
291
- for (let i = 0; i < lines.length; i++) {
292
- const lineLength = lines[i].length + 1; // +1 for newline
293
- if (offset + lineLength > startOffset) {
294
- startRow = i;
295
- startCol = startOffset - offset;
296
- break;
297
- }
298
- offset += lineLength;
299
- }
300
- // Find end position
301
- offset = 0;
302
- for (let i = 0; i < lines.length; i++) {
303
- const lineLength = lines[i].length + (i < lines.length - 1 ? 1 : 0); // +1 for newline except last line
304
- if (offset + lineLength >= endOffset) {
305
- endRow = i;
306
- endCol = endOffset - offset;
307
- break;
308
- }
309
- offset += lineLength;
310
- }
311
- return { startRow, startCol, endRow, endCol };
312
- };
313
- export const getLineRangeOffsets = (startRow, lineCount, lines) => {
314
- let startOffset = 0;
315
- // Calculate start offset
316
- for (let i = 0; i < startRow; i++) {
317
- startOffset += lines[i].length + 1; // +1 for newline
318
- }
319
- // Calculate end offset
320
- let endOffset = startOffset;
321
- for (let i = 0; i < lineCount; i++) {
322
- const lineIndex = startRow + i;
323
- if (lineIndex < lines.length) {
324
- endOffset += lines[lineIndex].length;
325
- if (lineIndex < lines.length - 1) {
326
- endOffset += 1; // +1 for newline
327
- }
328
- }
329
- }
330
- return { startOffset, endOffset };
331
- };
332
- export const replaceRangeInternal = (state, startRow, startCol, endRow, endCol, text) => {
333
- const currentLine = (row) => state.lines[row] || '';
334
- const currentLineLen = (row) => cpLen(currentLine(row));
335
- const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
336
- if (startRow > endRow ||
337
- (startRow === endRow && startCol > endCol) ||
338
- startRow < 0 ||
339
- startCol < 0 ||
340
- endRow >= state.lines.length ||
341
- (endRow < state.lines.length && endCol > currentLineLen(endRow))) {
342
- return state; // Invalid range
343
- }
344
- const newLines = [...state.lines];
345
- const sCol = clamp(startCol, 0, currentLineLen(startRow));
346
- const eCol = clamp(endCol, 0, currentLineLen(endRow));
347
- const prefix = cpSlice(currentLine(startRow), 0, sCol);
348
- const suffix = cpSlice(currentLine(endRow), eCol);
349
- const normalisedReplacement = text
350
- .replace(/\r\n/g, '\n')
351
- .replace(/\r/g, '\n');
352
- const replacementParts = normalisedReplacement.split('\n');
353
- // The combined first line of the new text
354
- const firstLine = prefix + replacementParts[0];
355
- if (replacementParts.length === 1) {
356
- // No newlines in replacement: combine prefix, replacement, and suffix on one line.
357
- newLines.splice(startRow, endRow - startRow + 1, firstLine + suffix);
358
- }
359
- else {
360
- // Newlines in replacement: create new lines.
361
- const lastLine = replacementParts[replacementParts.length - 1] + suffix;
362
- const middleLines = replacementParts.slice(1, -1);
363
- newLines.splice(startRow, endRow - startRow + 1, firstLine, ...middleLines, lastLine);
364
- }
365
- const finalCursorRow = startRow + replacementParts.length - 1;
366
- const finalCursorCol = (replacementParts.length > 1 ? 0 : sCol) +
367
- cpLen(replacementParts[replacementParts.length - 1]);
368
- return {
369
- ...state,
370
- lines: newLines,
371
- cursorRow: Math.min(Math.max(finalCursorRow, 0), newLines.length - 1),
372
- cursorCol: Math.max(0, Math.min(finalCursorCol, cpLen(newLines[finalCursorRow] || ''))),
373
- preferredCol: null,
374
- };
375
- };
376
- /**
377
- * Strip characters that can break terminal rendering.
378
- *
379
- * Uses Node.js built-in stripVTControlCharacters to handle VT sequences,
380
- * then filters remaining control characters that can disrupt display.
381
- *
382
- * Characters stripped:
383
- * - ANSI escape sequences (via strip-ansi)
384
- * - VT control sequences (via Node.js util.stripVTControlCharacters)
385
- * - C0 control chars (0x00-0x1F) except CR/LF which are handled elsewhere
386
- * - C1 control chars (0x80-0x9F) that can cause display issues
387
- *
388
- * Characters preserved:
389
- * - All printable Unicode including emojis
390
- * - DEL (0x7F) - handled functionally by applyOperations, not a display issue
391
- * - CR/LF (0x0D/0x0A) - needed for line breaks
392
- */
393
- function stripUnsafeCharacters(str) {
394
- const strippedAnsi = stripAnsi(str);
395
- const strippedVT = stripVTControlCharacters(strippedAnsi);
396
- return toCodePoints(strippedVT)
397
- .filter((char) => {
398
- const code = char.codePointAt(0);
399
- if (code === undefined)
400
- return false;
401
- // Preserve CR/LF for line handling
402
- if (code === 0x0a || code === 0x0d)
403
- return true;
404
- // Remove C0 control chars (except CR/LF) that can break display
405
- // Examples: BELL(0x07) makes noise, BS(0x08) moves cursor, VT(0x0B), FF(0x0C)
406
- if (code >= 0x00 && code <= 0x1f)
407
- return false;
408
- // Remove C1 control chars (0x80-0x9F) - legacy 8-bit control codes
409
- if (code >= 0x80 && code <= 0x9f)
410
- return false;
411
- // Preserve DEL (0x7F) - it's handled functionally by applyOperations as backspace
412
- // and doesn't cause rendering issues when displayed
413
- // Preserve all other characters including Unicode/emojis
414
- return true;
415
- })
416
- .join('');
417
- }
418
- function clamp(v, min, max) {
419
- return v < min ? min : v > max ? max : v;
420
- }
421
- function calculateInitialCursorPosition(initialLines, offset) {
422
- let remainingChars = offset;
423
- let row = 0;
424
- while (row < initialLines.length) {
425
- const lineLength = cpLen(initialLines[row]);
426
- // Add 1 for the newline character (except for the last line)
427
- const totalCharsInLineAndNewline = lineLength + (row < initialLines.length - 1 ? 1 : 0);
428
- if (remainingChars <= lineLength) {
429
- // Cursor is on this line
430
- return [row, remainingChars];
431
- }
432
- remainingChars -= totalCharsInLineAndNewline;
433
- row++;
434
- }
435
- // Offset is beyond the text, place cursor at the end of the last line
436
- if (initialLines.length > 0) {
437
- const lastRow = initialLines.length - 1;
438
- return [lastRow, cpLen(initialLines[lastRow])];
439
- }
440
- return [0, 0]; // Default for empty text
441
- }
442
- export function offsetToLogicalPos(text, offset) {
443
- let row = 0;
444
- let col = 0;
445
- let currentOffset = 0;
446
- if (offset === 0)
447
- return [0, 0];
448
- const lines = text.split('\n');
449
- for (let i = 0; i < lines.length; i++) {
450
- const line = lines[i];
451
- const lineLength = cpLen(line);
452
- const lineLengthWithNewline = lineLength + (i < lines.length - 1 ? 1 : 0);
453
- if (offset <= currentOffset + lineLength) {
454
- // Check against lineLength first
455
- row = i;
456
- col = offset - currentOffset;
457
- return [row, col];
458
- }
459
- else if (offset <= currentOffset + lineLengthWithNewline) {
460
- // Check if offset is the newline itself
461
- row = i;
462
- col = lineLength; // Position cursor at the end of the current line content
463
- // If the offset IS the newline, and it's not the last line, advance to next line, col 0
464
- if (offset === currentOffset + lineLengthWithNewline &&
465
- i < lines.length - 1) {
466
- return [i + 1, 0];
467
- }
468
- return [row, col]; // Otherwise, it's at the end of the current line content
469
- }
470
- currentOffset += lineLengthWithNewline;
471
- }
472
- // If offset is beyond the text length, place cursor at the end of the last line
473
- // or [0,0] if text is empty
474
- if (lines.length > 0) {
475
- row = lines.length - 1;
476
- col = cpLen(lines[row]);
477
- }
478
- else {
479
- row = 0;
480
- col = 0;
481
- }
482
- return [row, col];
483
- }
484
- /**
485
- * Converts logical row/col position to absolute text offset
486
- * Inverse operation of offsetToLogicalPos
487
- */
488
- export function logicalPosToOffset(lines, row, col) {
489
- let offset = 0;
490
- // Clamp row to valid range
491
- const actualRow = Math.min(row, lines.length - 1);
492
- // Add lengths of all lines before the target row
493
- for (let i = 0; i < actualRow; i++) {
494
- offset += cpLen(lines[i]) + 1; // +1 for newline
495
- }
496
- // Add column offset within the target row
497
- if (actualRow >= 0 && actualRow < lines.length) {
498
- offset += Math.min(col, cpLen(lines[actualRow]));
499
- }
500
- return offset;
501
- }
502
- // Helper to calculate visual lines and map cursor positions
503
- function calculateVisualLayout(logicalLines, logicalCursor, viewportWidth) {
504
- const visualLines = [];
505
- const logicalToVisualMap = [];
506
- const visualToLogicalMap = [];
507
- let currentVisualCursor = [0, 0];
508
- logicalLines.forEach((logLine, logIndex) => {
509
- logicalToVisualMap[logIndex] = [];
510
- if (logLine.length === 0) {
511
- // Handle empty logical line
512
- logicalToVisualMap[logIndex].push([visualLines.length, 0]);
513
- visualToLogicalMap.push([logIndex, 0]);
514
- visualLines.push('');
515
- if (logIndex === logicalCursor[0] && logicalCursor[1] === 0) {
516
- currentVisualCursor = [visualLines.length - 1, 0];
517
- }
518
- }
519
- else {
520
- // Non-empty logical line
521
- let currentPosInLogLine = 0; // Tracks position within the current logical line (code point index)
522
- const codePointsInLogLine = toCodePoints(logLine);
523
- while (currentPosInLogLine < codePointsInLogLine.length) {
524
- let currentChunk = '';
525
- let currentChunkVisualWidth = 0;
526
- let numCodePointsInChunk = 0;
527
- let lastWordBreakPoint = -1; // Index in codePointsInLogLine for word break
528
- let numCodePointsAtLastWordBreak = 0;
529
- // Iterate through code points to build the current visual line (chunk)
530
- for (let i = currentPosInLogLine; i < codePointsInLogLine.length; i++) {
531
- const char = codePointsInLogLine[i];
532
- const charVisualWidth = stringWidth(char);
533
- if (currentChunkVisualWidth + charVisualWidth > viewportWidth) {
534
- // Character would exceed viewport width
535
- if (lastWordBreakPoint !== -1 &&
536
- numCodePointsAtLastWordBreak > 0 &&
537
- currentPosInLogLine + numCodePointsAtLastWordBreak < i) {
538
- // We have a valid word break point to use, and it's not the start of the current segment
539
- currentChunk = codePointsInLogLine
540
- .slice(currentPosInLogLine, currentPosInLogLine + numCodePointsAtLastWordBreak)
541
- .join('');
542
- numCodePointsInChunk = numCodePointsAtLastWordBreak;
543
- }
544
- else {
545
- // No word break, or word break is at the start of this potential chunk, or word break leads to empty chunk.
546
- // Hard break: take characters up to viewportWidth, or just the current char if it alone is too wide.
547
- if (numCodePointsInChunk === 0 &&
548
- charVisualWidth > viewportWidth) {
549
- // Single character is wider than viewport, take it anyway
550
- currentChunk = char;
551
- numCodePointsInChunk = 1;
552
- }
553
- else if (numCodePointsInChunk === 0 &&
554
- charVisualWidth <= viewportWidth) {
555
- // This case should ideally be caught by the next iteration if the char fits.
556
- // If it doesn't fit (because currentChunkVisualWidth was already > 0 from a previous char that filled the line),
557
- // then numCodePointsInChunk would not be 0.
558
- // This branch means the current char *itself* doesn't fit an empty line, which is handled by the above.
559
- // If we are here, it means the loop should break and the current chunk (which is empty) is finalized.
560
- }
561
- }
562
- break; // Break from inner loop to finalize this chunk
563
- }
564
- currentChunk += char;
565
- currentChunkVisualWidth += charVisualWidth;
566
- numCodePointsInChunk++;
567
- // Check for word break opportunity (space)
568
- if (char === ' ') {
569
- lastWordBreakPoint = i; // Store code point index of the space
570
- // Store the state *before* adding the space, if we decide to break here.
571
- numCodePointsAtLastWordBreak = numCodePointsInChunk - 1; // Chars *before* the space
572
- }
573
- }
574
- // If the inner loop completed without breaking (i.e., remaining text fits)
575
- // or if the loop broke but numCodePointsInChunk is still 0 (e.g. first char too wide for empty line)
576
- if (numCodePointsInChunk === 0 &&
577
- currentPosInLogLine < codePointsInLogLine.length) {
578
- // This can happen if the very first character considered for a new visual line is wider than the viewport.
579
- // In this case, we take that single character.
580
- const firstChar = codePointsInLogLine[currentPosInLogLine];
581
- currentChunk = firstChar;
582
- numCodePointsInChunk = 1; // Ensure we advance
583
- }
584
- // If after everything, numCodePointsInChunk is still 0 but we haven't processed the whole logical line,
585
- // it implies an issue, like viewportWidth being 0 or less. Avoid infinite loop.
586
- if (numCodePointsInChunk === 0 &&
587
- currentPosInLogLine < codePointsInLogLine.length) {
588
- // Force advance by one character to prevent infinite loop if something went wrong
589
- currentChunk = codePointsInLogLine[currentPosInLogLine];
590
- numCodePointsInChunk = 1;
591
- }
592
- logicalToVisualMap[logIndex].push([
593
- visualLines.length,
594
- currentPosInLogLine,
595
- ]);
596
- visualToLogicalMap.push([logIndex, currentPosInLogLine]);
597
- visualLines.push(currentChunk);
598
- // Cursor mapping logic
599
- // Note: currentPosInLogLine here is the start of the currentChunk within the logical line.
600
- if (logIndex === logicalCursor[0]) {
601
- const cursorLogCol = logicalCursor[1]; // This is a code point index
602
- if (cursorLogCol >= currentPosInLogLine &&
603
- cursorLogCol < currentPosInLogLine + numCodePointsInChunk // Cursor is within this chunk
604
- ) {
605
- currentVisualCursor = [
606
- visualLines.length - 1,
607
- cursorLogCol - currentPosInLogLine, // Visual col is also code point index within visual line
608
- ];
609
- }
610
- else if (cursorLogCol === currentPosInLogLine + numCodePointsInChunk &&
611
- numCodePointsInChunk > 0) {
612
- // Cursor is exactly at the end of this non-empty chunk
613
- currentVisualCursor = [
614
- visualLines.length - 1,
615
- numCodePointsInChunk,
616
- ];
617
- }
618
- }
619
- const logicalStartOfThisChunk = currentPosInLogLine;
620
- currentPosInLogLine += numCodePointsInChunk;
621
- // If the chunk processed did not consume the entire logical line,
622
- // and the character immediately following the chunk is a space,
623
- // advance past this space as it acted as a delimiter for word wrapping.
624
- if (logicalStartOfThisChunk + numCodePointsInChunk <
625
- codePointsInLogLine.length &&
626
- currentPosInLogLine < codePointsInLogLine.length && // Redundant if previous is true, but safe
627
- codePointsInLogLine[currentPosInLogLine] === ' ') {
628
- currentPosInLogLine++;
629
- }
630
- }
631
- // After all chunks of a non-empty logical line are processed,
632
- // if the cursor is at the very end of this logical line, update visual cursor.
633
- if (logIndex === logicalCursor[0] &&
634
- logicalCursor[1] === codePointsInLogLine.length // Cursor at end of logical line
635
- ) {
636
- const lastVisualLineIdx = visualLines.length - 1;
637
- if (lastVisualLineIdx >= 0 &&
638
- visualLines[lastVisualLineIdx] !== undefined) {
639
- currentVisualCursor = [
640
- lastVisualLineIdx,
641
- cpLen(visualLines[lastVisualLineIdx]), // Cursor at end of last visual line for this logical line
642
- ];
643
- }
644
- }
645
- }
646
- });
647
- // If the entire logical text was empty, ensure there's one empty visual line.
648
- if (logicalLines.length === 0 ||
649
- (logicalLines.length === 1 && logicalLines[0] === '')) {
650
- if (visualLines.length === 0) {
651
- visualLines.push('');
652
- if (!logicalToVisualMap[0])
653
- logicalToVisualMap[0] = [];
654
- logicalToVisualMap[0].push([0, 0]);
655
- visualToLogicalMap.push([0, 0]);
656
- }
657
- currentVisualCursor = [0, 0];
658
- }
659
- // Handle cursor at the very end of the text (after all processing)
660
- // This case might be covered by the loop end condition now, but kept for safety.
661
- else if (logicalCursor[0] === logicalLines.length - 1 &&
662
- logicalCursor[1] === cpLen(logicalLines[logicalLines.length - 1]) &&
663
- visualLines.length > 0) {
664
- const lastVisLineIdx = visualLines.length - 1;
665
- currentVisualCursor = [lastVisLineIdx, cpLen(visualLines[lastVisLineIdx])];
666
- }
667
- return {
668
- visualLines,
669
- visualCursor: currentVisualCursor,
670
- logicalToVisualMap,
671
- visualToLogicalMap,
672
- };
673
- }
674
- const historyLimit = 100;
675
- export const pushUndo = (currentState) => {
676
- const snapshot = {
677
- lines: [...currentState.lines],
678
- cursorRow: currentState.cursorRow,
679
- cursorCol: currentState.cursorCol,
680
- };
681
- const newStack = [...currentState.undoStack, snapshot];
682
- if (newStack.length > historyLimit) {
683
- newStack.shift();
684
- }
685
- return { ...currentState, undoStack: newStack, redoStack: [] };
686
- };
687
- export function textBufferReducer(state, action) {
688
- const pushUndoLocal = pushUndo;
689
- const currentLine = (r) => state.lines[r] ?? '';
690
- const currentLineLen = (r) => cpLen(currentLine(r));
691
- switch (action.type) {
692
- case 'set_text': {
693
- let nextState = state;
694
- if (action.pushToUndo !== false) {
695
- nextState = pushUndoLocal(state);
696
- }
697
- const newContentLines = action.payload
698
- .replace(/\r\n?/g, '\n')
699
- .split('\n');
700
- const lines = newContentLines.length === 0 ? [''] : newContentLines;
701
- const lastNewLineIndex = lines.length - 1;
702
- return {
703
- ...nextState,
704
- lines,
705
- cursorRow: lastNewLineIndex,
706
- cursorCol: cpLen(lines[lastNewLineIndex] ?? ''),
707
- preferredCol: null,
708
- };
709
- }
710
- case 'insert': {
711
- const nextState = pushUndoLocal(state);
712
- const newLines = [...nextState.lines];
713
- let newCursorRow = nextState.cursorRow;
714
- let newCursorCol = nextState.cursorCol;
715
- const currentLine = (r) => newLines[r] ?? '';
716
- const str = stripUnsafeCharacters(action.payload.replace(/\r\n/g, '\n').replace(/\r/g, '\n'));
717
- const parts = str.split('\n');
718
- const lineContent = currentLine(newCursorRow);
719
- const before = cpSlice(lineContent, 0, newCursorCol);
720
- const after = cpSlice(lineContent, newCursorCol);
721
- if (parts.length > 1) {
722
- newLines[newCursorRow] = before + parts[0];
723
- const remainingParts = parts.slice(1);
724
- const lastPartOriginal = remainingParts.pop() ?? '';
725
- newLines.splice(newCursorRow + 1, 0, ...remainingParts);
726
- newLines.splice(newCursorRow + parts.length - 1, 0, lastPartOriginal + after);
727
- newCursorRow = newCursorRow + parts.length - 1;
728
- newCursorCol = cpLen(lastPartOriginal);
729
- }
730
- else {
731
- newLines[newCursorRow] = before + parts[0] + after;
732
- newCursorCol = cpLen(before) + cpLen(parts[0]);
733
- }
734
- return {
735
- ...nextState,
736
- lines: newLines,
737
- cursorRow: newCursorRow,
738
- cursorCol: newCursorCol,
739
- preferredCol: null,
740
- };
741
- }
742
- case 'backspace': {
743
- const nextState = pushUndoLocal(state);
744
- const newLines = [...nextState.lines];
745
- let newCursorRow = nextState.cursorRow;
746
- let newCursorCol = nextState.cursorCol;
747
- const currentLine = (r) => newLines[r] ?? '';
748
- if (newCursorCol === 0 && newCursorRow === 0)
749
- return state;
750
- if (newCursorCol > 0) {
751
- const lineContent = currentLine(newCursorRow);
752
- newLines[newCursorRow] =
753
- cpSlice(lineContent, 0, newCursorCol - 1) +
754
- cpSlice(lineContent, newCursorCol);
755
- newCursorCol--;
756
- }
757
- else if (newCursorRow > 0) {
758
- const prevLineContent = currentLine(newCursorRow - 1);
759
- const currentLineContentVal = currentLine(newCursorRow);
760
- const newCol = cpLen(prevLineContent);
761
- newLines[newCursorRow - 1] = prevLineContent + currentLineContentVal;
762
- newLines.splice(newCursorRow, 1);
763
- newCursorRow--;
764
- newCursorCol = newCol;
765
- }
766
- return {
767
- ...nextState,
768
- lines: newLines,
769
- cursorRow: newCursorRow,
770
- cursorCol: newCursorCol,
771
- preferredCol: null,
772
- };
773
- }
774
- case 'set_viewport_width': {
775
- if (action.payload === state.viewportWidth) {
776
- return state;
777
- }
778
- return { ...state, viewportWidth: action.payload };
779
- }
780
- case 'move': {
781
- const { dir } = action.payload;
782
- const { lines, cursorRow, cursorCol, viewportWidth } = state;
783
- const visualLayout = calculateVisualLayout(lines, [cursorRow, cursorCol], viewportWidth);
784
- const { visualLines, visualCursor, visualToLogicalMap } = visualLayout;
785
- let newVisualRow = visualCursor[0];
786
- let newVisualCol = visualCursor[1];
787
- let newPreferredCol = state.preferredCol;
788
- const currentVisLineLen = cpLen(visualLines[newVisualRow] ?? '');
789
- switch (dir) {
790
- case 'left':
791
- newPreferredCol = null;
792
- if (newVisualCol > 0) {
793
- newVisualCol--;
794
- }
795
- else if (newVisualRow > 0) {
796
- newVisualRow--;
797
- newVisualCol = cpLen(visualLines[newVisualRow] ?? '');
798
- }
799
- break;
800
- case 'right':
801
- newPreferredCol = null;
802
- if (newVisualCol < currentVisLineLen) {
803
- newVisualCol++;
804
- }
805
- else if (newVisualRow < visualLines.length - 1) {
806
- newVisualRow++;
807
- newVisualCol = 0;
808
- }
809
- break;
810
- case 'up':
811
- if (newVisualRow > 0) {
812
- if (newPreferredCol === null)
813
- newPreferredCol = newVisualCol;
814
- newVisualRow--;
815
- newVisualCol = clamp(newPreferredCol, 0, cpLen(visualLines[newVisualRow] ?? ''));
816
- }
817
- break;
818
- case 'down':
819
- if (newVisualRow < visualLines.length - 1) {
820
- if (newPreferredCol === null)
821
- newPreferredCol = newVisualCol;
822
- newVisualRow++;
823
- newVisualCol = clamp(newPreferredCol, 0, cpLen(visualLines[newVisualRow] ?? ''));
824
- }
825
- break;
826
- case 'home':
827
- newPreferredCol = null;
828
- newVisualCol = 0;
829
- break;
830
- case 'end':
831
- newPreferredCol = null;
832
- newVisualCol = currentVisLineLen;
833
- break;
834
- case 'wordLeft': {
835
- const { cursorRow, cursorCol, lines } = state;
836
- if (cursorCol === 0 && cursorRow === 0)
837
- return state;
838
- let newCursorRow = cursorRow;
839
- let newCursorCol = cursorCol;
840
- if (cursorCol === 0) {
841
- newCursorRow--;
842
- newCursorCol = cpLen(lines[newCursorRow] ?? '');
843
- }
844
- else {
845
- const lineContent = lines[cursorRow];
846
- const arr = toCodePoints(lineContent);
847
- let start = cursorCol;
848
- let onlySpaces = true;
849
- for (let i = 0; i < start; i++) {
850
- if (isWordChar(arr[i])) {
851
- onlySpaces = false;
852
- break;
853
- }
854
- }
855
- if (onlySpaces && start > 0) {
856
- start--;
857
- }
858
- else {
859
- while (start > 0 && !isWordChar(arr[start - 1]))
860
- start--;
861
- while (start > 0 && isWordChar(arr[start - 1]))
862
- start--;
863
- }
864
- newCursorCol = start;
865
- }
866
- return {
867
- ...state,
868
- cursorRow: newCursorRow,
869
- cursorCol: newCursorCol,
870
- preferredCol: null,
871
- };
872
- }
873
- case 'wordRight': {
874
- const { cursorRow, cursorCol, lines } = state;
875
- if (cursorRow === lines.length - 1 &&
876
- cursorCol === cpLen(lines[cursorRow] ?? '')) {
877
- return state;
878
- }
879
- let newCursorRow = cursorRow;
880
- let newCursorCol = cursorCol;
881
- const lineContent = lines[cursorRow] ?? '';
882
- const arr = toCodePoints(lineContent);
883
- if (cursorCol >= arr.length) {
884
- newCursorRow++;
885
- newCursorCol = 0;
886
- }
887
- else {
888
- let end = cursorCol;
889
- while (end < arr.length && !isWordChar(arr[end]))
890
- end++;
891
- while (end < arr.length && isWordChar(arr[end]))
892
- end++;
893
- newCursorCol = end;
894
- }
895
- return {
896
- ...state,
897
- cursorRow: newCursorRow,
898
- cursorCol: newCursorCol,
899
- preferredCol: null,
900
- };
901
- }
902
- default:
903
- break;
904
- }
905
- if (visualToLogicalMap[newVisualRow]) {
906
- const [logRow, logStartCol] = visualToLogicalMap[newVisualRow];
907
- return {
908
- ...state,
909
- cursorRow: logRow,
910
- cursorCol: clamp(logStartCol + newVisualCol, 0, cpLen(state.lines[logRow] ?? '')),
911
- preferredCol: newPreferredCol,
912
- };
913
- }
914
- return state;
915
- }
916
- case 'delete': {
917
- const { cursorRow, cursorCol, lines } = state;
918
- const lineContent = currentLine(cursorRow);
919
- if (cursorCol < currentLineLen(cursorRow)) {
920
- const nextState = pushUndoLocal(state);
921
- const newLines = [...nextState.lines];
922
- newLines[cursorRow] =
923
- cpSlice(lineContent, 0, cursorCol) +
924
- cpSlice(lineContent, cursorCol + 1);
925
- return { ...nextState, lines: newLines, preferredCol: null };
926
- }
927
- else if (cursorRow < lines.length - 1) {
928
- const nextState = pushUndoLocal(state);
929
- const nextLineContent = currentLine(cursorRow + 1);
930
- const newLines = [...nextState.lines];
931
- newLines[cursorRow] = lineContent + nextLineContent;
932
- newLines.splice(cursorRow + 1, 1);
933
- return { ...nextState, lines: newLines, preferredCol: null };
934
- }
935
- return state;
936
- }
937
- case 'delete_word_left': {
938
- const { cursorRow, cursorCol } = state;
939
- if (cursorCol === 0 && cursorRow === 0)
940
- return state;
941
- if (cursorCol === 0) {
942
- // Act as a backspace
943
- const nextState = pushUndoLocal(state);
944
- const prevLineContent = currentLine(cursorRow - 1);
945
- const currentLineContentVal = currentLine(cursorRow);
946
- const newCol = cpLen(prevLineContent);
947
- const newLines = [...nextState.lines];
948
- newLines[cursorRow - 1] = prevLineContent + currentLineContentVal;
949
- newLines.splice(cursorRow, 1);
950
- return {
951
- ...nextState,
952
- lines: newLines,
953
- cursorRow: cursorRow - 1,
954
- cursorCol: newCol,
955
- preferredCol: null,
956
- };
957
- }
958
- const nextState = pushUndoLocal(state);
959
- const lineContent = currentLine(cursorRow);
960
- const arr = toCodePoints(lineContent);
961
- let start = cursorCol;
962
- let onlySpaces = true;
963
- for (let i = 0; i < start; i++) {
964
- if (isWordChar(arr[i])) {
965
- onlySpaces = false;
966
- break;
967
- }
968
- }
969
- if (onlySpaces && start > 0) {
970
- start--;
971
- }
972
- else {
973
- while (start > 0 && !isWordChar(arr[start - 1]))
974
- start--;
975
- while (start > 0 && isWordChar(arr[start - 1]))
976
- start--;
977
- }
978
- const newLines = [...nextState.lines];
979
- newLines[cursorRow] =
980
- cpSlice(lineContent, 0, start) + cpSlice(lineContent, cursorCol);
981
- return {
982
- ...nextState,
983
- lines: newLines,
984
- cursorCol: start,
985
- preferredCol: null,
986
- };
987
- }
988
- case 'delete_word_right': {
989
- const { cursorRow, cursorCol, lines } = state;
990
- const lineContent = currentLine(cursorRow);
991
- const arr = toCodePoints(lineContent);
992
- if (cursorCol >= arr.length && cursorRow === lines.length - 1)
993
- return state;
994
- if (cursorCol >= arr.length) {
995
- // Act as a delete
996
- const nextState = pushUndoLocal(state);
997
- const nextLineContent = currentLine(cursorRow + 1);
998
- const newLines = [...nextState.lines];
999
- newLines[cursorRow] = lineContent + nextLineContent;
1000
- newLines.splice(cursorRow + 1, 1);
1001
- return { ...nextState, lines: newLines, preferredCol: null };
1002
- }
1003
- const nextState = pushUndoLocal(state);
1004
- let end = cursorCol;
1005
- while (end < arr.length && !isWordChar(arr[end]))
1006
- end++;
1007
- while (end < arr.length && isWordChar(arr[end]))
1008
- end++;
1009
- const newLines = [...nextState.lines];
1010
- newLines[cursorRow] =
1011
- cpSlice(lineContent, 0, cursorCol) + cpSlice(lineContent, end);
1012
- return { ...nextState, lines: newLines, preferredCol: null };
1013
- }
1014
- case 'kill_line_right': {
1015
- const { cursorRow, cursorCol, lines } = state;
1016
- const lineContent = currentLine(cursorRow);
1017
- if (cursorCol < currentLineLen(cursorRow)) {
1018
- const nextState = pushUndoLocal(state);
1019
- const newLines = [...nextState.lines];
1020
- newLines[cursorRow] = cpSlice(lineContent, 0, cursorCol);
1021
- return { ...nextState, lines: newLines };
1022
- }
1023
- else if (cursorRow < lines.length - 1) {
1024
- // Act as a delete
1025
- const nextState = pushUndoLocal(state);
1026
- const nextLineContent = currentLine(cursorRow + 1);
1027
- const newLines = [...nextState.lines];
1028
- newLines[cursorRow] = lineContent + nextLineContent;
1029
- newLines.splice(cursorRow + 1, 1);
1030
- return { ...nextState, lines: newLines, preferredCol: null };
1031
- }
1032
- return state;
1033
- }
1034
- case 'kill_line_left': {
1035
- const { cursorRow, cursorCol } = state;
1036
- if (cursorCol > 0) {
1037
- const nextState = pushUndoLocal(state);
1038
- const lineContent = currentLine(cursorRow);
1039
- const newLines = [...nextState.lines];
1040
- newLines[cursorRow] = cpSlice(lineContent, cursorCol);
1041
- return {
1042
- ...nextState,
1043
- lines: newLines,
1044
- cursorCol: 0,
1045
- preferredCol: null,
1046
- };
1047
- }
1048
- return state;
1049
- }
1050
- case 'undo': {
1051
- const stateToRestore = state.undoStack[state.undoStack.length - 1];
1052
- if (!stateToRestore)
1053
- return state;
1054
- const currentSnapshot = {
1055
- lines: [...state.lines],
1056
- cursorRow: state.cursorRow,
1057
- cursorCol: state.cursorCol,
1058
- };
1059
- return {
1060
- ...state,
1061
- ...stateToRestore,
1062
- undoStack: state.undoStack.slice(0, -1),
1063
- redoStack: [...state.redoStack, currentSnapshot],
1064
- };
1065
- }
1066
- case 'redo': {
1067
- const stateToRestore = state.redoStack[state.redoStack.length - 1];
1068
- if (!stateToRestore)
1069
- return state;
1070
- const currentSnapshot = {
1071
- lines: [...state.lines],
1072
- cursorRow: state.cursorRow,
1073
- cursorCol: state.cursorCol,
1074
- };
1075
- return {
1076
- ...state,
1077
- ...stateToRestore,
1078
- redoStack: state.redoStack.slice(0, -1),
1079
- undoStack: [...state.undoStack, currentSnapshot],
1080
- };
1081
- }
1082
- case 'replace_range': {
1083
- const { startRow, startCol, endRow, endCol, text } = action.payload;
1084
- const nextState = pushUndoLocal(state);
1085
- return replaceRangeInternal(nextState, startRow, startCol, endRow, endCol, text);
1086
- }
1087
- case 'move_to_offset': {
1088
- const { offset } = action.payload;
1089
- const [newRow, newCol] = offsetToLogicalPos(state.lines.join('\n'), offset);
1090
- return {
1091
- ...state,
1092
- cursorRow: newRow,
1093
- cursorCol: newCol,
1094
- preferredCol: null,
1095
- };
1096
- }
1097
- case 'create_undo_snapshot': {
1098
- return pushUndoLocal(state);
1099
- }
1100
- // Vim-specific operations
1101
- case 'vim_delete_word_forward':
1102
- case 'vim_delete_word_backward':
1103
- case 'vim_delete_word_end':
1104
- case 'vim_change_word_forward':
1105
- case 'vim_change_word_backward':
1106
- case 'vim_change_word_end':
1107
- case 'vim_delete_line':
1108
- case 'vim_change_line':
1109
- case 'vim_delete_to_end_of_line':
1110
- case 'vim_change_to_end_of_line':
1111
- case 'vim_change_movement':
1112
- case 'vim_move_left':
1113
- case 'vim_move_right':
1114
- case 'vim_move_up':
1115
- case 'vim_move_down':
1116
- case 'vim_move_word_forward':
1117
- case 'vim_move_word_backward':
1118
- case 'vim_move_word_end':
1119
- case 'vim_delete_char':
1120
- case 'vim_insert_at_cursor':
1121
- case 'vim_append_at_cursor':
1122
- case 'vim_open_line_below':
1123
- case 'vim_open_line_above':
1124
- case 'vim_append_at_line_end':
1125
- case 'vim_insert_at_line_start':
1126
- case 'vim_move_to_line_start':
1127
- case 'vim_move_to_line_end':
1128
- case 'vim_move_to_first_nonwhitespace':
1129
- case 'vim_move_to_first_line':
1130
- case 'vim_move_to_last_line':
1131
- case 'vim_move_to_line':
1132
- case 'vim_escape_insert_mode':
1133
- return handleVimAction(state, action);
1134
- default: {
1135
- const exhaustiveCheck = action;
1136
- console.error(`Unknown action encountered: ${exhaustiveCheck}`);
1137
- return state;
1138
- }
1139
- }
1140
- }
1141
- // --- End of reducer logic ---
1142
- export function useTextBuffer({ initialText = '', initialCursorOffset = 0, viewport, stdin, setRawMode, onChange, isValidPath, shellModeActive = false, }) {
1143
- const initialState = useMemo(() => {
1144
- const lines = initialText.split('\n');
1145
- const [initialCursorRow, initialCursorCol] = calculateInitialCursorPosition(lines.length === 0 ? [''] : lines, initialCursorOffset);
1146
- return {
1147
- lines: lines.length === 0 ? [''] : lines,
1148
- cursorRow: initialCursorRow,
1149
- cursorCol: initialCursorCol,
1150
- preferredCol: null,
1151
- undoStack: [],
1152
- redoStack: [],
1153
- clipboard: null,
1154
- selectionAnchor: null,
1155
- viewportWidth: viewport.width,
1156
- };
1157
- }, [initialText, initialCursorOffset, viewport.width]);
1158
- const [state, dispatch] = useReducer(textBufferReducer, initialState);
1159
- const { lines, cursorRow, cursorCol, preferredCol, selectionAnchor } = state;
1160
- const text = useMemo(() => lines.join('\n'), [lines]);
1161
- const visualLayout = useMemo(() => calculateVisualLayout(lines, [cursorRow, cursorCol], state.viewportWidth), [lines, cursorRow, cursorCol, state.viewportWidth]);
1162
- const { visualLines, visualCursor } = visualLayout;
1163
- const [visualScrollRow, setVisualScrollRow] = useState(0);
1164
- useEffect(() => {
1165
- if (onChange) {
1166
- onChange(text);
1167
- }
1168
- }, [text, onChange]);
1169
- useEffect(() => {
1170
- dispatch({ type: 'set_viewport_width', payload: viewport.width });
1171
- }, [viewport.width]);
1172
- // Update visual scroll (vertical)
1173
- useEffect(() => {
1174
- const { height } = viewport;
1175
- let newVisualScrollRow = visualScrollRow;
1176
- if (visualCursor[0] < visualScrollRow) {
1177
- newVisualScrollRow = visualCursor[0];
1178
- }
1179
- else if (visualCursor[0] >= visualScrollRow + height) {
1180
- newVisualScrollRow = visualCursor[0] - height + 1;
1181
- }
1182
- if (newVisualScrollRow !== visualScrollRow) {
1183
- setVisualScrollRow(newVisualScrollRow);
1184
- }
1185
- }, [visualCursor, visualScrollRow, viewport]);
1186
- const insert = useCallback((ch, { paste = false } = {}) => {
1187
- if (/[\n\r]/.test(ch)) {
1188
- dispatch({ type: 'insert', payload: ch });
1189
- return;
1190
- }
1191
- const minLengthToInferAsDragDrop = 3;
1192
- if (ch.length >= minLengthToInferAsDragDrop &&
1193
- !shellModeActive &&
1194
- paste) {
1195
- let potentialPath = ch.trim();
1196
- const quoteMatch = potentialPath.match(/^'(.*)'$/);
1197
- if (quoteMatch) {
1198
- potentialPath = quoteMatch[1];
1199
- }
1200
- potentialPath = potentialPath.trim();
1201
- if (isValidPath(unescapePath(potentialPath))) {
1202
- ch = `@${potentialPath} `;
1203
- }
1204
- }
1205
- let currentText = '';
1206
- for (const char of toCodePoints(ch)) {
1207
- if (char.codePointAt(0) === 127) {
1208
- if (currentText.length > 0) {
1209
- dispatch({ type: 'insert', payload: currentText });
1210
- currentText = '';
1211
- }
1212
- dispatch({ type: 'backspace' });
1213
- }
1214
- else {
1215
- currentText += char;
1216
- }
1217
- }
1218
- if (currentText.length > 0) {
1219
- dispatch({ type: 'insert', payload: currentText });
1220
- }
1221
- }, [isValidPath, shellModeActive]);
1222
- const newline = useCallback(() => {
1223
- dispatch({ type: 'insert', payload: '\n' });
1224
- }, []);
1225
- const backspace = useCallback(() => {
1226
- dispatch({ type: 'backspace' });
1227
- }, []);
1228
- const del = useCallback(() => {
1229
- dispatch({ type: 'delete' });
1230
- }, []);
1231
- const move = useCallback((dir) => {
1232
- dispatch({ type: 'move', payload: { dir } });
1233
- }, []);
1234
- const undo = useCallback(() => {
1235
- dispatch({ type: 'undo' });
1236
- }, []);
1237
- const redo = useCallback(() => {
1238
- dispatch({ type: 'redo' });
1239
- }, []);
1240
- const setText = useCallback((newText) => {
1241
- dispatch({ type: 'set_text', payload: newText });
1242
- }, []);
1243
- const deleteWordLeft = useCallback(() => {
1244
- dispatch({ type: 'delete_word_left' });
1245
- }, []);
1246
- const deleteWordRight = useCallback(() => {
1247
- dispatch({ type: 'delete_word_right' });
1248
- }, []);
1249
- const killLineRight = useCallback(() => {
1250
- dispatch({ type: 'kill_line_right' });
1251
- }, []);
1252
- const killLineLeft = useCallback(() => {
1253
- dispatch({ type: 'kill_line_left' });
1254
- }, []);
1255
- // Vim-specific operations
1256
- const vimDeleteWordForward = useCallback((count) => {
1257
- dispatch({ type: 'vim_delete_word_forward', payload: { count } });
1258
- }, []);
1259
- const vimDeleteWordBackward = useCallback((count) => {
1260
- dispatch({ type: 'vim_delete_word_backward', payload: { count } });
1261
- }, []);
1262
- const vimDeleteWordEnd = useCallback((count) => {
1263
- dispatch({ type: 'vim_delete_word_end', payload: { count } });
1264
- }, []);
1265
- const vimChangeWordForward = useCallback((count) => {
1266
- dispatch({ type: 'vim_change_word_forward', payload: { count } });
1267
- }, []);
1268
- const vimChangeWordBackward = useCallback((count) => {
1269
- dispatch({ type: 'vim_change_word_backward', payload: { count } });
1270
- }, []);
1271
- const vimChangeWordEnd = useCallback((count) => {
1272
- dispatch({ type: 'vim_change_word_end', payload: { count } });
1273
- }, []);
1274
- const vimDeleteLine = useCallback((count) => {
1275
- dispatch({ type: 'vim_delete_line', payload: { count } });
1276
- }, []);
1277
- const vimChangeLine = useCallback((count) => {
1278
- dispatch({ type: 'vim_change_line', payload: { count } });
1279
- }, []);
1280
- const vimDeleteToEndOfLine = useCallback(() => {
1281
- dispatch({ type: 'vim_delete_to_end_of_line' });
1282
- }, []);
1283
- const vimChangeToEndOfLine = useCallback(() => {
1284
- dispatch({ type: 'vim_change_to_end_of_line' });
1285
- }, []);
1286
- const vimChangeMovement = useCallback((movement, count) => {
1287
- dispatch({ type: 'vim_change_movement', payload: { movement, count } });
1288
- }, []);
1289
- // New vim navigation and operation methods
1290
- const vimMoveLeft = useCallback((count) => {
1291
- dispatch({ type: 'vim_move_left', payload: { count } });
1292
- }, []);
1293
- const vimMoveRight = useCallback((count) => {
1294
- dispatch({ type: 'vim_move_right', payload: { count } });
1295
- }, []);
1296
- const vimMoveUp = useCallback((count) => {
1297
- dispatch({ type: 'vim_move_up', payload: { count } });
1298
- }, []);
1299
- const vimMoveDown = useCallback((count) => {
1300
- dispatch({ type: 'vim_move_down', payload: { count } });
1301
- }, []);
1302
- const vimMoveWordForward = useCallback((count) => {
1303
- dispatch({ type: 'vim_move_word_forward', payload: { count } });
1304
- }, []);
1305
- const vimMoveWordBackward = useCallback((count) => {
1306
- dispatch({ type: 'vim_move_word_backward', payload: { count } });
1307
- }, []);
1308
- const vimMoveWordEnd = useCallback((count) => {
1309
- dispatch({ type: 'vim_move_word_end', payload: { count } });
1310
- }, []);
1311
- const vimDeleteChar = useCallback((count) => {
1312
- dispatch({ type: 'vim_delete_char', payload: { count } });
1313
- }, []);
1314
- const vimInsertAtCursor = useCallback(() => {
1315
- dispatch({ type: 'vim_insert_at_cursor' });
1316
- }, []);
1317
- const vimAppendAtCursor = useCallback(() => {
1318
- dispatch({ type: 'vim_append_at_cursor' });
1319
- }, []);
1320
- const vimOpenLineBelow = useCallback(() => {
1321
- dispatch({ type: 'vim_open_line_below' });
1322
- }, []);
1323
- const vimOpenLineAbove = useCallback(() => {
1324
- dispatch({ type: 'vim_open_line_above' });
1325
- }, []);
1326
- const vimAppendAtLineEnd = useCallback(() => {
1327
- dispatch({ type: 'vim_append_at_line_end' });
1328
- }, []);
1329
- const vimInsertAtLineStart = useCallback(() => {
1330
- dispatch({ type: 'vim_insert_at_line_start' });
1331
- }, []);
1332
- const vimMoveToLineStart = useCallback(() => {
1333
- dispatch({ type: 'vim_move_to_line_start' });
1334
- }, []);
1335
- const vimMoveToLineEnd = useCallback(() => {
1336
- dispatch({ type: 'vim_move_to_line_end' });
1337
- }, []);
1338
- const vimMoveToFirstNonWhitespace = useCallback(() => {
1339
- dispatch({ type: 'vim_move_to_first_nonwhitespace' });
1340
- }, []);
1341
- const vimMoveToFirstLine = useCallback(() => {
1342
- dispatch({ type: 'vim_move_to_first_line' });
1343
- }, []);
1344
- const vimMoveToLastLine = useCallback(() => {
1345
- dispatch({ type: 'vim_move_to_last_line' });
1346
- }, []);
1347
- const vimMoveToLine = useCallback((lineNumber) => {
1348
- dispatch({ type: 'vim_move_to_line', payload: { lineNumber } });
1349
- }, []);
1350
- const vimEscapeInsertMode = useCallback(() => {
1351
- dispatch({ type: 'vim_escape_insert_mode' });
1352
- }, []);
1353
- const openInExternalEditor = useCallback(async (opts = {}) => {
1354
- const editor = opts.editor ??
1355
- process.env['VISUAL'] ??
1356
- process.env['EDITOR'] ??
1357
- (process.platform === 'win32' ? 'notepad' : 'vi');
1358
- const tmpDir = fs.mkdtempSync(pathMod.join(os.tmpdir(), 'gemini-edit-'));
1359
- const filePath = pathMod.join(tmpDir, 'buffer.txt');
1360
- fs.writeFileSync(filePath, text, 'utf8');
1361
- dispatch({ type: 'create_undo_snapshot' });
1362
- const wasRaw = stdin?.isRaw ?? false;
1363
- try {
1364
- setRawMode?.(false);
1365
- const { status, error } = spawnSync(editor, [filePath], {
1366
- stdio: 'inherit',
1367
- });
1368
- if (error)
1369
- throw error;
1370
- if (typeof status === 'number' && status !== 0)
1371
- throw new Error(`External editor exited with status ${status}`);
1372
- let newText = fs.readFileSync(filePath, 'utf8');
1373
- newText = newText.replace(/\r\n?/g, '\n');
1374
- dispatch({ type: 'set_text', payload: newText, pushToUndo: false });
1375
- }
1376
- catch (err) {
1377
- console.error('[useTextBuffer] external editor error', err);
1378
- }
1379
- finally {
1380
- if (wasRaw)
1381
- setRawMode?.(true);
1382
- try {
1383
- fs.unlinkSync(filePath);
1384
- }
1385
- catch {
1386
- /* ignore */
1387
- }
1388
- try {
1389
- fs.rmdirSync(tmpDir);
1390
- }
1391
- catch {
1392
- /* ignore */
1393
- }
1394
- }
1395
- }, [text, stdin, setRawMode]);
1396
- const handleInput = useCallback((key) => {
1397
- const { sequence: input } = key;
1398
- if (key.paste) {
1399
- // Do not do any other processing on pastes so ensure we handle them
1400
- // before all other cases.
1401
- insert(input, { paste: key.paste });
1402
- return;
1403
- }
1404
- if (key.name === 'return' ||
1405
- input === '\r' ||
1406
- input === '\n' ||
1407
- input === '\\\r' // VSCode terminal represents shift + enter this way
1408
- )
1409
- newline();
1410
- else if (key.name === 'left' && !key.meta && !key.ctrl)
1411
- move('left');
1412
- else if (key.ctrl && key.name === 'b')
1413
- move('left');
1414
- else if (key.name === 'right' && !key.meta && !key.ctrl)
1415
- move('right');
1416
- else if (key.ctrl && key.name === 'f')
1417
- move('right');
1418
- else if (key.name === 'up')
1419
- move('up');
1420
- else if (key.name === 'down')
1421
- move('down');
1422
- else if ((key.ctrl || key.meta) && key.name === 'left')
1423
- move('wordLeft');
1424
- else if (key.meta && key.name === 'b')
1425
- move('wordLeft');
1426
- else if ((key.ctrl || key.meta) && key.name === 'right')
1427
- move('wordRight');
1428
- else if (key.meta && key.name === 'f')
1429
- move('wordRight');
1430
- else if (key.name === 'home')
1431
- move('home');
1432
- else if (key.ctrl && key.name === 'a')
1433
- move('home');
1434
- else if (key.name === 'end')
1435
- move('end');
1436
- else if (key.ctrl && key.name === 'e')
1437
- move('end');
1438
- else if (key.ctrl && key.name === 'w')
1439
- deleteWordLeft();
1440
- else if ((key.meta || key.ctrl) &&
1441
- (key.name === 'backspace' || input === '\x7f'))
1442
- deleteWordLeft();
1443
- else if ((key.meta || key.ctrl) && key.name === 'delete')
1444
- deleteWordRight();
1445
- else if (key.name === 'backspace' ||
1446
- input === '\x7f' ||
1447
- (key.ctrl && key.name === 'h'))
1448
- backspace();
1449
- else if (key.name === 'delete' || (key.ctrl && key.name === 'd'))
1450
- del();
1451
- else if (input && !key.ctrl && !key.meta) {
1452
- insert(input, { paste: key.paste });
1453
- }
1454
- }, [newline, move, deleteWordLeft, deleteWordRight, backspace, del, insert]);
1455
- const renderedVisualLines = useMemo(() => visualLines.slice(visualScrollRow, visualScrollRow + viewport.height), [visualLines, visualScrollRow, viewport.height]);
1456
- const replaceRange = useCallback((startRow, startCol, endRow, endCol, text) => {
1457
- dispatch({
1458
- type: 'replace_range',
1459
- payload: { startRow, startCol, endRow, endCol, text },
1460
- });
1461
- }, []);
1462
- const replaceRangeByOffset = useCallback((startOffset, endOffset, replacementText) => {
1463
- const [startRow, startCol] = offsetToLogicalPos(text, startOffset);
1464
- const [endRow, endCol] = offsetToLogicalPos(text, endOffset);
1465
- replaceRange(startRow, startCol, endRow, endCol, replacementText);
1466
- }, [text, replaceRange]);
1467
- const moveToOffset = useCallback((offset) => {
1468
- dispatch({ type: 'move_to_offset', payload: { offset } });
1469
- }, []);
1470
- const returnValue = {
1471
- lines,
1472
- text,
1473
- cursor: [cursorRow, cursorCol],
1474
- preferredCol,
1475
- selectionAnchor,
1476
- allVisualLines: visualLines,
1477
- viewportVisualLines: renderedVisualLines,
1478
- visualCursor,
1479
- visualScrollRow,
1480
- setText,
1481
- insert,
1482
- newline,
1483
- backspace,
1484
- del,
1485
- move,
1486
- undo,
1487
- redo,
1488
- replaceRange,
1489
- replaceRangeByOffset,
1490
- moveToOffset,
1491
- deleteWordLeft,
1492
- deleteWordRight,
1493
- killLineRight,
1494
- killLineLeft,
1495
- handleInput,
1496
- openInExternalEditor,
1497
- // Vim-specific operations
1498
- vimDeleteWordForward,
1499
- vimDeleteWordBackward,
1500
- vimDeleteWordEnd,
1501
- vimChangeWordForward,
1502
- vimChangeWordBackward,
1503
- vimChangeWordEnd,
1504
- vimDeleteLine,
1505
- vimChangeLine,
1506
- vimDeleteToEndOfLine,
1507
- vimChangeToEndOfLine,
1508
- vimChangeMovement,
1509
- vimMoveLeft,
1510
- vimMoveRight,
1511
- vimMoveUp,
1512
- vimMoveDown,
1513
- vimMoveWordForward,
1514
- vimMoveWordBackward,
1515
- vimMoveWordEnd,
1516
- vimDeleteChar,
1517
- vimInsertAtCursor,
1518
- vimAppendAtCursor,
1519
- vimOpenLineBelow,
1520
- vimOpenLineAbove,
1521
- vimAppendAtLineEnd,
1522
- vimInsertAtLineStart,
1523
- vimMoveToLineStart,
1524
- vimMoveToLineEnd,
1525
- vimMoveToFirstNonWhitespace,
1526
- vimMoveToFirstLine,
1527
- vimMoveToLastLine,
1528
- vimMoveToLine,
1529
- vimEscapeInsertMode,
1530
- };
1531
- return returnValue;
1532
- }
1533
- //# sourceMappingURL=text-buffer.js.map