@cjhyy/code-shell 0.3.0 → 0.5.0-rc.2

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 (464) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/dist/cli.js +2 -0
  3. package/dist/index.d.ts +1 -68
  4. package/dist/index.js +1 -1
  5. package/package.json +25 -73
  6. package/dist/agent/coordinator.d.ts +0 -49
  7. package/dist/anthropic-DJXVKFMJ.js +0 -1
  8. package/dist/arena/arena.d.ts +0 -43
  9. package/dist/arena/context/context-tools.d.ts +0 -16
  10. package/dist/arena/detect-mode.d.ts +0 -20
  11. package/dist/arena/digest-builder.d.ts +0 -25
  12. package/dist/arena/index.d.ts +0 -29
  13. package/dist/arena/index.js +0 -1
  14. package/dist/arena/iterate/convergence.d.ts +0 -25
  15. package/dist/arena/iterate/formats/index.d.ts +0 -22
  16. package/dist/arena/iterate/index.d.ts +0 -11
  17. package/dist/arena/iterate/iterative-arena.d.ts +0 -23
  18. package/dist/arena/iterate/parse.d.ts +0 -42
  19. package/dist/arena/iterate/phases/argue.d.ts +0 -22
  20. package/dist/arena/iterate/phases/revise.d.ts +0 -16
  21. package/dist/arena/iterate/phases/tournament.d.ts +0 -34
  22. package/dist/arena/iterate/tools/web-tools.d.ts +0 -13
  23. package/dist/arena/iterate/types.d.ts +0 -152
  24. package/dist/arena/ledger.d.ts +0 -47
  25. package/dist/arena/lenses/architecture.d.ts +0 -5
  26. package/dist/arena/lenses/engineering.d.ts +0 -5
  27. package/dist/arena/lenses/general.d.ts +0 -5
  28. package/dist/arena/lenses/index.d.ts +0 -16
  29. package/dist/arena/lenses/product.d.ts +0 -5
  30. package/dist/arena/model-presets.d.ts +0 -23
  31. package/dist/arena/phases/adjudication.d.ts +0 -24
  32. package/dist/arena/phases/build-consensus.d.ts +0 -29
  33. package/dist/arena/phases/claim-registry.d.ts +0 -26
  34. package/dist/arena/phases/cross-review.d.ts +0 -45
  35. package/dist/arena/phases/debate-rounds.d.ts +0 -27
  36. package/dist/arena/phases/participant-research.d.ts +0 -38
  37. package/dist/arena/phases/planning-detail-expansion.d.ts +0 -38
  38. package/dist/arena/planner.d.ts +0 -27
  39. package/dist/arena/providers/docs.d.ts +0 -6
  40. package/dist/arena/providers/git.d.ts +0 -8
  41. package/dist/arena/providers/index.d.ts +0 -32
  42. package/dist/arena/providers/none.d.ts +0 -7
  43. package/dist/arena/providers/repo.d.ts +0 -6
  44. package/dist/arena/render/session.d.ts +0 -17
  45. package/dist/arena/render/terminal.d.ts +0 -33
  46. package/dist/arena/strategies/discussion.d.ts +0 -25
  47. package/dist/arena/strategies/index.d.ts +0 -15
  48. package/dist/arena/strategies/language-wrapper.d.ts +0 -17
  49. package/dist/arena/strategies/lens-wrapper.d.ts +0 -16
  50. package/dist/arena/strategies/planning.d.ts +0 -30
  51. package/dist/arena/strategies/review.d.ts +0 -26
  52. package/dist/arena/strategies/utils.d.ts +0 -39
  53. package/dist/arena/tools/selector.d.ts +0 -17
  54. package/dist/arena/transitions.d.ts +0 -48
  55. package/dist/arena/types.d.ts +0 -508
  56. package/dist/arena-MRBATZFD.js +0 -3
  57. package/dist/bootstrap/setup.d.ts +0 -14
  58. package/dist/bootstrap/state.d.ts +0 -160
  59. package/dist/bwrap-PVZMLHZR.js +0 -2
  60. package/dist/chunk-2OD6VR4N.js +0 -2
  61. package/dist/chunk-3QP5BQ3L.js +0 -1
  62. package/dist/chunk-5QIVXFCT.js +0 -1
  63. package/dist/chunk-AFMP73YP.js +0 -2
  64. package/dist/chunk-D3TVASD2.js +0 -4
  65. package/dist/chunk-DI26OUIU.js +0 -2
  66. package/dist/chunk-FU7AHZNN.js +0 -1
  67. package/dist/chunk-FZXY554D.js +0 -2
  68. package/dist/chunk-GGVAOPI7.js +0 -1
  69. package/dist/chunk-GKAQH2DG.js +0 -2
  70. package/dist/chunk-GYNO4R7R.js +0 -2
  71. package/dist/chunk-K4HILJ6G.js +0 -251
  72. package/dist/chunk-M7VU4YVY.js +0 -49
  73. package/dist/chunk-MLCTC53I.js +0 -1
  74. package/dist/chunk-O5HFCH2U.js +0 -1
  75. package/dist/chunk-OWBYLMDD.js +0 -1
  76. package/dist/chunk-P6JSTIFM.js +0 -1
  77. package/dist/chunk-QTWU7UNA.js +0 -5
  78. package/dist/chunk-SKIX2M5Z.js +0 -4
  79. package/dist/chunk-SNFAPSLA.js +0 -1
  80. package/dist/chunk-SV7H4FKT.js +0 -3
  81. package/dist/chunk-T222K6IV.js +0 -18
  82. package/dist/chunk-TKJA6W36.js +0 -3
  83. package/dist/chunk-WI6FSWGU.js +0 -1
  84. package/dist/chunk-WONQHE4P.js +0 -641
  85. package/dist/chunk-X2S7ASQ2.js +0 -1
  86. package/dist/chunk-Z5HKHAO7.js +0 -336
  87. package/dist/cli/commands/arena.d.ts +0 -29
  88. package/dist/cli/commands/builtin/advanced-commands.d.ts +0 -5
  89. package/dist/cli/commands/builtin/core-commands.d.ts +0 -5
  90. package/dist/cli/commands/builtin/export-md.d.ts +0 -19
  91. package/dist/cli/commands/builtin/extra-commands.d.ts +0 -6
  92. package/dist/cli/commands/builtin/git-commands.d.ts +0 -5
  93. package/dist/cli/commands/builtin/init/detect.d.ts +0 -25
  94. package/dist/cli/commands/builtin/init/index.d.ts +0 -19
  95. package/dist/cli/commands/builtin/more-commands.d.ts +0 -5
  96. package/dist/cli/commands/builtin/permissions-command.d.ts +0 -5
  97. package/dist/cli/commands/builtin/plugin-commands-registration.d.ts +0 -12
  98. package/dist/cli/commands/builtin/plugin-handler.d.ts +0 -6
  99. package/dist/cli/commands/builtin/utility-commands.d.ts +0 -5
  100. package/dist/cli/commands/registry.d.ts +0 -79
  101. package/dist/cli/commands/repl.d.ts +0 -21
  102. package/dist/cli/commands/run.d.ts +0 -21
  103. package/dist/cli/commands/runs.d.ts +0 -14
  104. package/dist/cli/cost-tracker.d.ts +0 -63
  105. package/dist/cli/exit.d.ts +0 -12
  106. package/dist/cli/input/ndjson-reader.d.ts +0 -31
  107. package/dist/cli/input-compiler.d.ts +0 -5
  108. package/dist/cli/main.d.ts +0 -5
  109. package/dist/cli/main.js +0 -415
  110. package/dist/cli/migrate-models.d.ts +0 -45
  111. package/dist/cli/onboarding.d.ts +0 -189
  112. package/dist/cli/output/renderer.d.ts +0 -28
  113. package/dist/cli/output/terminal-ui.d.ts +0 -50
  114. package/dist/cli/updater.d.ts +0 -65
  115. package/dist/client-base-GSFXPP2Y.js +0 -1
  116. package/dist/compaction-L3Y6NG4N.js +0 -1
  117. package/dist/context/compaction.d.ts +0 -116
  118. package/dist/context/manager.d.ts +0 -145
  119. package/dist/context/token-counter.d.ts +0 -27
  120. package/dist/context/tool-result-storage.d.ts +0 -96
  121. package/dist/cron/scheduler.d.ts +0 -34
  122. package/dist/data/openrouter-models.d.ts +0 -35
  123. package/dist/data/openrouter-sync.d.ts +0 -16
  124. package/dist/data/static-catalogs.d.ts +0 -25
  125. package/dist/devtools-FBX4HVVY.js +0 -1
  126. package/dist/engine/cost-store.d.ts +0 -22
  127. package/dist/engine/engine.d.ts +0 -236
  128. package/dist/engine/model-facade.d.ts +0 -24
  129. package/dist/engine/query.d.ts +0 -50
  130. package/dist/engine/streaming-tool-queue.d.ts +0 -34
  131. package/dist/engine/token-budget.d.ts +0 -22
  132. package/dist/engine/tool-summary.d.ts +0 -13
  133. package/dist/engine/turn-loop.d.ts +0 -122
  134. package/dist/engine/turn-state.d.ts +0 -20
  135. package/dist/exceptions.d.ts +0 -44
  136. package/dist/export-md-U72T7NW7.js +0 -22
  137. package/dist/file-history-7FQFEQOL.js +0 -1
  138. package/dist/git/utils.d.ts +0 -35
  139. package/dist/git/worktree.d.ts +0 -36
  140. package/dist/hooks/events.d.ts +0 -114
  141. package/dist/hooks/inject.d.ts +0 -19
  142. package/dist/hooks/registry.d.ts +0 -15
  143. package/dist/hooks/shell-runner.d.ts +0 -45
  144. package/dist/llm/api-key-sanitize.d.ts +0 -22
  145. package/dist/llm/capabilities/index.d.ts +0 -20
  146. package/dist/llm/capabilities/rules.d.ts +0 -26
  147. package/dist/llm/capabilities/types.d.ts +0 -108
  148. package/dist/llm/client-base.d.ts +0 -29
  149. package/dist/llm/client-factory.d.ts +0 -10
  150. package/dist/llm/model-cache.d.ts +0 -21
  151. package/dist/llm/model-fetcher.d.ts +0 -29
  152. package/dist/llm/model-pool.d.ts +0 -84
  153. package/dist/llm/provider-catalog.d.ts +0 -32
  154. package/dist/llm/provider-kinds.d.ts +0 -21
  155. package/dist/llm/providers/anthropic.d.ts +0 -19
  156. package/dist/llm/providers/openai.d.ts +0 -64
  157. package/dist/llm/retry.d.ts +0 -12
  158. package/dist/llm/stream-watchdog.d.ts +0 -42
  159. package/dist/llm/token-counter.d.ts +0 -17
  160. package/dist/llm/types.d.ts +0 -37
  161. package/dist/logging/logger.d.ts +0 -102
  162. package/dist/logging/session-recorder.d.ts +0 -90
  163. package/dist/lsp/client.d.ts +0 -41
  164. package/dist/lsp/manager.d.ts +0 -40
  165. package/dist/lsp/servers.d.ts +0 -16
  166. package/dist/manager-4XKLZHKE.js +0 -1
  167. package/dist/mcp-manager-3JGHEJO3.js +0 -1
  168. package/dist/memory-BNI4WEWL.js +0 -1
  169. package/dist/model-cache-HEDXI7UJ.js +0 -1
  170. package/dist/model-fetcher-X5W5EASG.js +0 -1
  171. package/dist/native-ts/yoga-layout/enums.d.ts +0 -117
  172. package/dist/native-ts/yoga-layout/index.d.ts +0 -270
  173. package/dist/off-7SDVMMXW.js +0 -1
  174. package/dist/openai-OQ6LLN5J.js +0 -1
  175. package/dist/openrouter-models-ZT4R2AE3.js +0 -1
  176. package/dist/openrouter-sync-ARMVWY7S.js +0 -1
  177. package/dist/plugin-handler-GJISMH5Q.js +0 -11
  178. package/dist/plugins/gitOps.d.ts +0 -23
  179. package/dist/plugins/installedPlugins.d.ts +0 -15
  180. package/dist/plugins/knownMarketplaces.d.ts +0 -10
  181. package/dist/plugins/loadPluginHooks.d.ts +0 -52
  182. package/dist/plugins/marketplaceManager.d.ts +0 -49
  183. package/dist/plugins/parseMarketplaceInput.d.ts +0 -16
  184. package/dist/plugins/pluginCommandHook.d.ts +0 -54
  185. package/dist/plugins/pluginCommandsLoader.d.ts +0 -25
  186. package/dist/plugins/pluginInstaller.d.ts +0 -36
  187. package/dist/plugins/schemas.d.ts +0 -9
  188. package/dist/plugins/types.d.ts +0 -75
  189. package/dist/plugins/varRewrite.d.ts +0 -42
  190. package/dist/preset/index.d.ts +0 -60
  191. package/dist/product/define.d.ts +0 -60
  192. package/dist/product/index.d.ts +0 -5
  193. package/dist/product/index.js +0 -1
  194. package/dist/product/types.d.ts +0 -111
  195. package/dist/prompt/composer.d.ts +0 -42
  196. package/dist/prompt/instruction-scanner.d.ts +0 -54
  197. package/dist/prompt/section-cache.d.ts +0 -15
  198. package/dist/prompt/section-loader.d.ts +0 -26
  199. package/dist/protocol/client.d.ts +0 -64
  200. package/dist/protocol/helpers.d.ts +0 -42
  201. package/dist/protocol/index.d.ts +0 -4
  202. package/dist/protocol/server.d.ts +0 -51
  203. package/dist/protocol/transport.d.ts +0 -36
  204. package/dist/protocol/types.d.ts +0 -192
  205. package/dist/react-compiler-runtime-shim.d.ts +0 -1
  206. package/dist/remote/bridge.d.ts +0 -37
  207. package/dist/render/Ansi.d.ts +0 -10
  208. package/dist/render/bidi.d.ts +0 -15
  209. package/dist/render/clearTerminal.d.ts +0 -19
  210. package/dist/render/colorize.d.ts +0 -16
  211. package/dist/render/components/AlternateScreen.d.ts +0 -21
  212. package/dist/render/components/App.d.ts +0 -71
  213. package/dist/render/components/AppContext.d.ts +0 -11
  214. package/dist/render/components/Box.d.ts +0 -49
  215. package/dist/render/components/Button.d.ts +0 -36
  216. package/dist/render/components/ClockContext.d.ts +0 -9
  217. package/dist/render/components/CursorDeclarationContext.d.ts +0 -22
  218. package/dist/render/components/ErrorOverview.d.ts +0 -5
  219. package/dist/render/components/Link.d.ts +0 -7
  220. package/dist/render/components/Newline.d.ts +0 -12
  221. package/dist/render/components/NoSelect.d.ts +0 -19
  222. package/dist/render/components/RawAnsi.d.ts +0 -16
  223. package/dist/render/components/ScrollBox.d.ts +0 -78
  224. package/dist/render/components/Spacer.d.ts +0 -5
  225. package/dist/render/components/Static.d.ts +0 -23
  226. package/dist/render/components/StdinContext.d.ts +0 -27
  227. package/dist/render/components/TerminalFocusContext.d.ts +0 -10
  228. package/dist/render/components/TerminalSizeContext.d.ts +0 -5
  229. package/dist/render/components/Text.d.ts +0 -55
  230. package/dist/render/constants.d.ts +0 -1
  231. package/dist/render/cursor.d.ts +0 -8
  232. package/dist/render/devtools.d.ts +0 -9
  233. package/dist/render/dom.d.ts +0 -77
  234. package/dist/render/events/click-event.d.ts +0 -31
  235. package/dist/render/events/dispatcher.d.ts +0 -40
  236. package/dist/render/events/emitter.d.ts +0 -5
  237. package/dist/render/events/event-handlers.d.ts +0 -46
  238. package/dist/render/events/event.d.ts +0 -5
  239. package/dist/render/events/focus-event.d.ts +0 -13
  240. package/dist/render/events/input-event.d.ts +0 -30
  241. package/dist/render/events/keyboard-event.d.ts +0 -19
  242. package/dist/render/events/paste-event.d.ts +0 -8
  243. package/dist/render/events/resize-event.d.ts +0 -9
  244. package/dist/render/events/terminal-event.d.ts +0 -54
  245. package/dist/render/events/terminal-focus-event.d.ts +0 -13
  246. package/dist/render/focus.d.ts +0 -43
  247. package/dist/render/frame.d.ts +0 -95
  248. package/dist/render/get-max-width.d.ts +0 -17
  249. package/dist/render/hit-test.d.ts +0 -33
  250. package/dist/render/hooks/use-animation-frame.d.ts +0 -26
  251. package/dist/render/hooks/use-app.d.ts +0 -5
  252. package/dist/render/hooks/use-declared-cursor.d.ts +0 -26
  253. package/dist/render/hooks/use-input.d.ts +0 -37
  254. package/dist/render/hooks/use-interval.d.ts +0 -18
  255. package/dist/render/hooks/use-search-highlight.d.ts +0 -30
  256. package/dist/render/hooks/use-selection.d.ts +0 -39
  257. package/dist/render/hooks/use-stdin.d.ts +0 -5
  258. package/dist/render/hooks/use-tab-status.d.ts +0 -13
  259. package/dist/render/hooks/use-terminal-focus.d.ts +0 -10
  260. package/dist/render/hooks/use-terminal-title.d.ts +0 -12
  261. package/dist/render/hooks/use-terminal-viewport.d.ts +0 -29
  262. package/dist/render/index.d.ts +0 -30
  263. package/dist/render/ink.d.ts +0 -391
  264. package/dist/render/instances.d.ts +0 -3
  265. package/dist/render/layout/engine.d.ts +0 -2
  266. package/dist/render/layout/geometry.d.ts +0 -30
  267. package/dist/render/layout/node.d.ts +0 -125
  268. package/dist/render/layout/yoga.d.ts +0 -56
  269. package/dist/render/line-width-cache.d.ts +0 -1
  270. package/dist/render/log-update.d.ts +0 -28
  271. package/dist/render/measure-element.d.ts +0 -16
  272. package/dist/render/measure-text.d.ts +0 -6
  273. package/dist/render/node-cache.d.ts +0 -20
  274. package/dist/render/optimizer.d.ts +0 -15
  275. package/dist/render/output.d.ts +0 -119
  276. package/dist/render/parse-keypress.d.ts +0 -111
  277. package/dist/render/reconciler.d.ts +0 -11
  278. package/dist/render/render-border.d.ts +0 -24
  279. package/dist/render/render-node-to-output.d.ts +0 -45
  280. package/dist/render/render-to-screen.d.ts +0 -46
  281. package/dist/render/renderer.d.ts +0 -14
  282. package/dist/render/root.d.ts +0 -74
  283. package/dist/render/screen.d.ts +0 -269
  284. package/dist/render/searchHighlight.d.ts +0 -20
  285. package/dist/render/selection.d.ts +0 -229
  286. package/dist/render/squash-text-nodes.d.ts +0 -22
  287. package/dist/render/stringWidth.d.ts +0 -1
  288. package/dist/render/styles.d.ts +0 -306
  289. package/dist/render/supports-hyperlinks.d.ts +0 -13
  290. package/dist/render/tabstops.d.ts +0 -1
  291. package/dist/render/terminal-focus-state.d.ts +0 -6
  292. package/dist/render/terminal-querier.d.ts +0 -129
  293. package/dist/render/terminal.d.ts +0 -46
  294. package/dist/render/termio/ansi.d.ts +0 -65
  295. package/dist/render/termio/csi.d.ts +0 -165
  296. package/dist/render/termio/dec.d.ts +0 -37
  297. package/dist/render/termio/esc.d.ts +0 -12
  298. package/dist/render/termio/osc.d.ts +0 -173
  299. package/dist/render/termio/parser.d.ts +0 -35
  300. package/dist/render/termio/sgr.d.ts +0 -8
  301. package/dist/render/termio/tokenize.d.ts +0 -45
  302. package/dist/render/termio/types.d.ts +0 -190
  303. package/dist/render/termio.d.ts +0 -24
  304. package/dist/render/useTerminalNotification.d.ts +0 -28
  305. package/dist/render/warn.d.ts +0 -1
  306. package/dist/render/widest-line.d.ts +0 -1
  307. package/dist/render/wrap-text.d.ts +0 -2
  308. package/dist/render/wrapAnsi.d.ts +0 -7
  309. package/dist/run/ArtifactTracker.d.ts +0 -38
  310. package/dist/run/CheckpointWriter.d.ts +0 -53
  311. package/dist/run/EngineRunner.d.ts +0 -72
  312. package/dist/run/Evaluator.d.ts +0 -56
  313. package/dist/run/FileRunStore.d.ts +0 -39
  314. package/dist/run/Heartbeat.d.ts +0 -54
  315. package/dist/run/RunApprovalBackend.d.ts +0 -53
  316. package/dist/run/RunLock.d.ts +0 -40
  317. package/dist/run/RunManager.d.ts +0 -82
  318. package/dist/run/RunQueue.d.ts +0 -27
  319. package/dist/run/RunStore.d.ts +0 -25
  320. package/dist/run/factory.d.ts +0 -63
  321. package/dist/run/index.d.ts +0 -17
  322. package/dist/run/index.js +0 -1
  323. package/dist/run/types.d.ts +0 -136
  324. package/dist/seatbelt-L54CNI2Y.js +0 -37
  325. package/dist/services/analytics.d.ts +0 -29
  326. package/dist/services/auto-dream.d.ts +0 -35
  327. package/dist/services/diagnostics.d.ts +0 -41
  328. package/dist/services/extract-memories.d.ts +0 -27
  329. package/dist/services/index.d.ts +0 -11
  330. package/dist/services/memory-orchestrator.d.ts +0 -39
  331. package/dist/services/notifier.d.ts +0 -25
  332. package/dist/services/oauth.d.ts +0 -27
  333. package/dist/services/session-memory.d.ts +0 -37
  334. package/dist/session/file-history.d.ts +0 -41
  335. package/dist/session/memory.d.ts +0 -65
  336. package/dist/session/session-manager.d.ts +0 -28
  337. package/dist/session/transcript.d.ts +0 -39
  338. package/dist/session-manager-AGWS5SMJ.js +0 -1
  339. package/dist/settings/manager.d.ts +0 -36
  340. package/dist/settings/schema.d.ts +0 -1123
  341. package/dist/skills/frontmatter.d.ts +0 -13
  342. package/dist/skills/index.d.ts +0 -7
  343. package/dist/skills/scanner.d.ts +0 -20
  344. package/dist/tool-summary-HJX6RHG4.js +0 -2
  345. package/dist/tool-system/builtin/agent-notifications.d.ts +0 -55
  346. package/dist/tool-system/builtin/agent-registry.d.ts +0 -67
  347. package/dist/tool-system/builtin/agent-transcript-translator.d.ts +0 -22
  348. package/dist/tool-system/builtin/agent.d.ts +0 -16
  349. package/dist/tool-system/builtin/apply-patch/applier.d.ts +0 -26
  350. package/dist/tool-system/builtin/apply-patch/index.d.ts +0 -19
  351. package/dist/tool-system/builtin/apply-patch/parser.d.ts +0 -17
  352. package/dist/tool-system/builtin/apply-patch/seek-sequence.d.ts +0 -18
  353. package/dist/tool-system/builtin/apply-patch/types.d.ts +0 -49
  354. package/dist/tool-system/builtin/arena.d.ts +0 -31
  355. package/dist/tool-system/builtin/ask-user.d.ts +0 -20
  356. package/dist/tool-system/builtin/bash.d.ts +0 -12
  357. package/dist/tool-system/builtin/brief.d.ts +0 -6
  358. package/dist/tool-system/builtin/config.d.ts +0 -6
  359. package/dist/tool-system/builtin/cron.d.ts +0 -10
  360. package/dist/tool-system/builtin/edit.d.ts +0 -6
  361. package/dist/tool-system/builtin/file-cache.d.ts +0 -11
  362. package/dist/tool-system/builtin/glob.d.ts +0 -6
  363. package/dist/tool-system/builtin/grep.d.ts +0 -6
  364. package/dist/tool-system/builtin/index.d.ts +0 -20
  365. package/dist/tool-system/builtin/lsp.d.ts +0 -6
  366. package/dist/tool-system/builtin/mcp-tools.d.ts +0 -10
  367. package/dist/tool-system/builtin/notebook-edit.d.ts +0 -6
  368. package/dist/tool-system/builtin/plan.d.ts +0 -18
  369. package/dist/tool-system/builtin/powershell.d.ts +0 -6
  370. package/dist/tool-system/builtin/read.d.ts +0 -6
  371. package/dist/tool-system/builtin/remote-trigger.d.ts +0 -6
  372. package/dist/tool-system/builtin/repl.d.ts +0 -6
  373. package/dist/tool-system/builtin/send-message.d.ts +0 -6
  374. package/dist/tool-system/builtin/skill-prompt.d.ts +0 -7
  375. package/dist/tool-system/builtin/skill.d.ts +0 -8
  376. package/dist/tool-system/builtin/sleep.d.ts +0 -6
  377. package/dist/tool-system/builtin/task.d.ts +0 -51
  378. package/dist/tool-system/builtin/tool-search.d.ts +0 -11
  379. package/dist/tool-system/builtin/web-fetch.d.ts +0 -6
  380. package/dist/tool-system/builtin/web-search.d.ts +0 -6
  381. package/dist/tool-system/builtin/worktree.d.ts +0 -10
  382. package/dist/tool-system/builtin/write.d.ts +0 -6
  383. package/dist/tool-system/context.d.ts +0 -133
  384. package/dist/tool-system/executor.d.ts +0 -49
  385. package/dist/tool-system/investigation-guard.d.ts +0 -46
  386. package/dist/tool-system/mcp-manager.d.ts +0 -50
  387. package/dist/tool-system/permission.d.ts +0 -104
  388. package/dist/tool-system/registry.d.ts +0 -32
  389. package/dist/tool-system/sandbox/bwrap.d.ts +0 -13
  390. package/dist/tool-system/sandbox/index.d.ts +0 -78
  391. package/dist/tool-system/sandbox/off.d.ts +0 -2
  392. package/dist/tool-system/sandbox/seatbelt.d.ts +0 -18
  393. package/dist/tool-system/task-guard.d.ts +0 -30
  394. package/dist/tool-system/validation.d.ts +0 -5
  395. package/dist/types.d.ts +0 -356
  396. package/dist/ui/App.d.ts +0 -14
  397. package/dist/ui/components/AgentBlock.d.ts +0 -35
  398. package/dist/ui/components/AgentDock.d.ts +0 -36
  399. package/dist/ui/components/AskUserPrompt.d.ts +0 -14
  400. package/dist/ui/components/BabyHand.d.ts +0 -1
  401. package/dist/ui/components/Banner.d.ts +0 -8
  402. package/dist/ui/components/CodeBlock.d.ts +0 -7
  403. package/dist/ui/components/CommandInput.d.ts +0 -24
  404. package/dist/ui/components/ContextUsageBar.d.ts +0 -7
  405. package/dist/ui/components/DiffLine.d.ts +0 -33
  406. package/dist/ui/components/DiffView.d.ts +0 -6
  407. package/dist/ui/components/DogLogo.d.ts +0 -1
  408. package/dist/ui/components/FullscreenLayout.d.ts +0 -51
  409. package/dist/ui/components/KunHead.d.ts +0 -1
  410. package/dist/ui/components/KunLogo.d.ts +0 -1
  411. package/dist/ui/components/MessageContent.d.ts +0 -26
  412. package/dist/ui/components/MessageRow.d.ts +0 -54
  413. package/dist/ui/components/ModelManager.d.ts +0 -68
  414. package/dist/ui/components/ModelSelector.d.ts +0 -10
  415. package/dist/ui/components/OnboardingPrompt.d.ts +0 -16
  416. package/dist/ui/components/PermissionDialog.d.ts +0 -8
  417. package/dist/ui/components/PermissionPrompt.d.ts +0 -11
  418. package/dist/ui/components/ProviderModelFlow.d.ts +0 -58
  419. package/dist/ui/components/ScrollView.d.ts +0 -34
  420. package/dist/ui/components/SessionPicker.d.ts +0 -16
  421. package/dist/ui/components/Spinner.d.ts +0 -8
  422. package/dist/ui/components/SpinnerWithVerb.d.ts +0 -19
  423. package/dist/ui/components/StatusLine.d.ts +0 -28
  424. package/dist/ui/components/StructuredDiff.d.ts +0 -8
  425. package/dist/ui/components/TaskList.d.ts +0 -6
  426. package/dist/ui/components/TextInput.d.ts +0 -17
  427. package/dist/ui/components/ThemedBox.d.ts +0 -19
  428. package/dist/ui/components/ThemedText.d.ts +0 -26
  429. package/dist/ui/components/ToolCall.d.ts +0 -28
  430. package/dist/ui/components/UpdateBanner.d.ts +0 -1
  431. package/dist/ui/components/VirtualMessageList.d.ts +0 -43
  432. package/dist/ui/components/WelcomeTips.d.ts +0 -5
  433. package/dist/ui/dev-seed.d.ts +0 -1
  434. package/dist/ui/fullscreen-mode.d.ts +0 -9
  435. package/dist/ui/hooks/useCostSummary.d.ts +0 -1
  436. package/dist/ui/hooks/useVirtualScroll.d.ts +0 -101
  437. package/dist/ui/index.d.ts +0 -12
  438. package/dist/ui/input-history.d.ts +0 -61
  439. package/dist/ui/onboarding-runner.d.ts +0 -2
  440. package/dist/ui/perf-probes.d.ts +0 -22
  441. package/dist/ui/query-guard.d.ts +0 -35
  442. package/dist/ui/slice-anchor.d.ts +0 -44
  443. package/dist/ui/store.d.ts +0 -108
  444. package/dist/ui/terminal-renderer.d.ts +0 -45
  445. package/dist/ui/theme.d.ts +0 -36
  446. package/dist/ui/vim-mode.d.ts +0 -25
  447. package/dist/updater-OCNU2K2Z.js +0 -1
  448. package/dist/utils/debug.d.ts +0 -41
  449. package/dist/utils/earlyInput.d.ts +0 -43
  450. package/dist/utils/env.d.ts +0 -24
  451. package/dist/utils/envUtils.d.ts +0 -51
  452. package/dist/utils/execFileNoThrow.d.ts +0 -39
  453. package/dist/utils/format.d.ts +0 -44
  454. package/dist/utils/fullscreen.d.ts +0 -47
  455. package/dist/utils/intl.d.ts +0 -22
  456. package/dist/utils/lockfile.d.ts +0 -15
  457. package/dist/utils/semver.d.ts +0 -6
  458. package/dist/utils/sliceAnsi.d.ts +0 -12
  459. package/dist/utils/systemTheme.d.ts +0 -40
  460. package/dist/utils/task-sanitizer.d.ts +0 -6
  461. package/dist/utils/theme.d.ts +0 -91
  462. package/dist/utils/toolDisplay.d.ts +0 -31
  463. package/dist/utils/truncate.d.ts +0 -40
  464. package/dist/voice/index.d.ts +0 -35
@@ -1,269 +0,0 @@
1
- import { type AnsiCode } from '@alcalzone/ansi-tokenize';
2
- import { type Point, type Rectangle, type Size } from './layout/geometry.js';
3
- export declare class CharPool {
4
- private strings;
5
- private stringMap;
6
- private ascii;
7
- intern(char: string): number;
8
- get(index: number): string;
9
- }
10
- export declare class HyperlinkPool {
11
- private strings;
12
- private stringMap;
13
- intern(hyperlink: string | undefined): number;
14
- get(id: number): string | undefined;
15
- }
16
- export declare class StylePool {
17
- private ids;
18
- private styles;
19
- private transitionCache;
20
- readonly none: number;
21
- constructor();
22
- /**
23
- * Intern a style and return its ID. Bit 0 of the ID encodes whether the
24
- * style has a visible effect on space characters (background, inverse,
25
- * underline, etc.). Foreground-only styles get even IDs; styles visible
26
- * on spaces get odd IDs. This lets the renderer skip invisible spaces
27
- * with a single bitmask check on the packed word.
28
- */
29
- intern(styles: AnsiCode[]): number;
30
- /** Recover styles from an encoded ID. Strips the bit-0 flag via >>> 1. */
31
- get(id: number): AnsiCode[];
32
- /**
33
- * Returns the pre-serialized ANSI string to transition from one style to
34
- * another. Cached by (fromId, toId) — zero allocations after first call
35
- * for a given pair.
36
- */
37
- transition(fromId: number, toId: number): string;
38
- /**
39
- * Intern a style that is `base + inverse`. Cached by base ID so
40
- * repeated calls for the same underlying style don't re-scan the
41
- * AnsiCode[] array. Used by the selection overlay.
42
- */
43
- private inverseCache;
44
- withInverse(baseId: number): number;
45
- /** Inverse + bold + yellow-bg-via-fg-swap for the CURRENT search match.
46
- * OTHER matches are plain inverse — bg inherits from the theme. Current
47
- * gets a distinct yellow bg (via fg-then-inverse swap) plus bold weight
48
- * so it stands out in a sea of inverse. Underline was too subtle. Zero
49
- * reflow risk: all pure SGR overlays, per-cell, post-layout. The yellow
50
- * overrides any existing fg (syntax highlighting) on those cells — fine,
51
- * the "you are here" signal IS the point, syntax color can yield. */
52
- private currentMatchCache;
53
- withCurrentMatch(baseId: number): number;
54
- /**
55
- * Selection overlay: REPLACE the cell's background with a solid color
56
- * while preserving its foreground (color, bold, italic, dim, underline).
57
- * Matches native terminal selection — a dedicated bg color, not SGR-7
58
- * inverse. Inverse swaps fg/bg per-cell, which fragments visually over
59
- * syntax-highlighted text (every fg color becomes a different bg stripe).
60
- *
61
- * Strips any existing bg (endCode 49m — REPLACES, so diff-added green
62
- * etc. don't bleed through) and any existing inverse (endCode 27m —
63
- * inverse on top of a solid bg would re-swap and look wrong).
64
- *
65
- * bg is set via setSelectionBg(); null → fallback to withInverse() so the
66
- * overlay still works before theme wiring sets a color (tests, first frame).
67
- * Cache is keyed by baseId only — setSelectionBg() clears it on change.
68
- */
69
- private selectionBgCode;
70
- private selectionBgCache;
71
- setSelectionBg(bg: AnsiCode | null): void;
72
- withSelectionBg(baseId: number): number;
73
- }
74
- /**
75
- * Cell width classification for handling double-wide characters (CJK, emoji,
76
- * etc.)
77
- *
78
- * We use explicit spacer cells rather than inferring width at render time. This
79
- * makes the data structure self-describing and simplifies cursor positioning
80
- * logic.
81
- *
82
- * @see https://mitchellh.com/writing/grapheme-clusters-in-terminals
83
- */
84
- export declare const enum CellWidth {
85
- Narrow = 0,
86
- Wide = 1,
87
- SpacerTail = 2,
88
- SpacerHead = 3
89
- }
90
- export type Hyperlink = string | undefined;
91
- /**
92
- * Cell is a view type returned by cellAt(). Cells are stored as packed typed
93
- * arrays internally to avoid GC pressure from allocating objects per cell.
94
- */
95
- export type Cell = {
96
- char: string;
97
- styleId: number;
98
- width: CellWidth;
99
- hyperlink: Hyperlink;
100
- };
101
- /**
102
- * Screen uses a packed Int32Array instead of Cell objects to eliminate GC
103
- * pressure. For a 200x120 screen, this avoids allocating 24,000 objects.
104
- *
105
- * Cell data is stored as 2 Int32s per cell in a single contiguous array:
106
- * word0: charId (full 32 bits — index into CharPool)
107
- * word1: styleId[31:17] | hyperlinkId[16:2] | width[1:0]
108
- *
109
- * This layout halves memory accesses in diffEach (2 int loads vs 4) and
110
- * enables future SIMD comparison via Bun.indexOfFirstDifference.
111
- */
112
- export type Screen = Size & {
113
- cells: Int32Array;
114
- cells64: BigInt64Array;
115
- charPool: CharPool;
116
- hyperlinkPool: HyperlinkPool;
117
- emptyStyleId: number;
118
- /**
119
- * Bounding box of cells that were written to (not blitted) during rendering.
120
- * Used by diff() to limit iteration to only the region that could have changed.
121
- */
122
- damage: Rectangle | undefined;
123
- /**
124
- * Per-cell noSelect bitmap — 1 byte per cell, 1 = exclude from text
125
- * selection (copy + highlight). Used by <NoSelect> to mark gutters
126
- * (line numbers, diff sigils) so click-drag over a diff yields clean
127
- * copyable code. Fully reset each frame in resetScreen; blitRegion
128
- * copies it alongside cells so the blit optimization preserves marks.
129
- */
130
- noSelect: Uint8Array;
131
- /**
132
- * Per-ROW soft-wrap continuation marker. softWrap[r]=N>0 means row r
133
- * is a word-wrap continuation of row r-1 (the `\n` before it was
134
- * inserted by wrapAnsi, not in the source), and row r-1's written
135
- * content ends at absolute column N (exclusive — cells [0..N) are the
136
- * fragment, past N is unwritten padding). 0 means row r is NOT a
137
- * continuation (hard newline or first row). Selection copy checks
138
- * softWrap[r]>0 to join row r onto row r-1 without a newline, and
139
- * reads softWrap[r+1] to know row r's content end when row r+1
140
- * continues from it. The content-end column is needed because an
141
- * unwritten cell and a written-unstyled-space are indistinguishable in
142
- * the packed typed array (both all-zero) — without it we'd either drop
143
- * the word-separator space (trim) or include trailing padding (no
144
- * trim). This encoding (continuation-on-self, prev-content-end-here)
145
- * is chosen so shiftRows preserves the is-continuation semantics: when
146
- * row r scrolls off the top and row r+1 shifts to row r, sw[r] gets
147
- * old sw[r+1] — which correctly says the new row r is a continuation
148
- * of what's now in scrolledOffAbove. Reset each frame; copied by
149
- * blitRegion/shiftRows.
150
- */
151
- softWrap: Int32Array;
152
- };
153
- export declare function isEmptyCellAt(screen: Screen, x: number, y: number): boolean;
154
- /**
155
- * Check if a Cell (view object) represents an empty cell.
156
- */
157
- export declare function isCellEmpty(screen: Screen, cell: Cell): boolean;
158
- export declare function createScreen(width: number, height: number, styles: StylePool, charPool: CharPool, hyperlinkPool: HyperlinkPool): Screen;
159
- /**
160
- * Reset an existing screen for reuse, avoiding allocation of new typed arrays.
161
- * Resizes if needed and clears all cells to empty/unwritten state.
162
- *
163
- * For double-buffering, this allows swapping between front and back buffers
164
- * without allocating new Screen objects each frame.
165
- */
166
- export declare function resetScreen(screen: Screen, width: number, height: number): void;
167
- /**
168
- * Re-intern a screen's char and hyperlink IDs into new pools.
169
- * Used for generational pool reset — after migrating, the screen's
170
- * typed arrays contain valid IDs for the new pools, and the old pools
171
- * can be GC'd.
172
- *
173
- * O(width * height) but only called occasionally (e.g., between conversation turns).
174
- */
175
- export declare function migrateScreenPools(screen: Screen, charPool: CharPool, hyperlinkPool: HyperlinkPool): void;
176
- /**
177
- * Get a Cell view at the given position. Returns a new object each call -
178
- * this is intentional as cells are stored packed, not as objects.
179
- */
180
- export declare function cellAt(screen: Screen, x: number, y: number): Cell | undefined;
181
- /**
182
- * Get a Cell view by pre-computed array index. Skips bounds checks and
183
- * index computation — caller must ensure index is valid.
184
- */
185
- export declare function cellAtIndex(screen: Screen, index: number): Cell;
186
- /**
187
- * Get a Cell at the given index, or undefined if it has no visible content.
188
- * Returns undefined for spacer cells (charId 1), empty unstyled spaces, and
189
- * fg-only styled spaces that match lastRenderedStyleId (cursor-forward
190
- * produces an identical visual result, avoiding a Cell allocation).
191
- *
192
- * @param lastRenderedStyleId - styleId of the last rendered cell on this
193
- * line, or -1 if none yet.
194
- */
195
- export declare function visibleCellAtIndex(cells: Int32Array, charPool: CharPool, hyperlinkPool: HyperlinkPool, index: number, lastRenderedStyleId: number): Cell | undefined;
196
- export declare function charInCellAt(screen: Screen, x: number, y: number): string | undefined;
197
- /**
198
- * Set a cell, optionally creating a spacer for wide characters.
199
- *
200
- * Wide characters (CJK, emoji) occupy 2 cells in the buffer:
201
- * 1. First cell: Contains the actual character with width = Wide
202
- * 2. Second cell: Spacer cell with width = SpacerTail (empty, not rendered)
203
- *
204
- * If the cell has width = Wide, this function automatically creates the
205
- * corresponding SpacerTail in the next column. This two-cell model keeps
206
- * the buffer aligned to visual columns, making cursor positioning
207
- * straightforward.
208
- *
209
- * TODO: When soft-wrapping is implemented, SpacerHead cells will be explicitly
210
- * placed by the wrapping logic at line-end positions where wide characters
211
- * wrap to the next line. This function doesn't need to handle SpacerHead
212
- * automatically - it will be set directly by the wrapping code.
213
- */
214
- export declare function setCellAt(screen: Screen, x: number, y: number, cell: Cell): void;
215
- /**
216
- * Replace the styleId of a cell in-place without disturbing char, width,
217
- * or hyperlink. Preserves empty cells as-is (char stays ' '). Tracks damage
218
- * for the cell so diffEach picks up the change.
219
- */
220
- export declare function setCellStyleId(screen: Screen, x: number, y: number, styleId: number): void;
221
- /**
222
- * Bulk-copy a rectangular region from src to dst using TypedArray.set().
223
- * Single cells.set() call per row (or one call for contiguous blocks).
224
- * Damage is computed once for the whole region.
225
- *
226
- * Clamps negative regionX/regionY to 0 (matching clearRegion) — absolute-
227
- * positioned overlays in tiny terminals can compute negative screen coords.
228
- * maxX/maxY should already be clamped to both screen bounds by the caller.
229
- */
230
- export declare function blitRegion(dst: Screen, src: Screen, regionX: number, regionY: number, maxX: number, maxY: number): void;
231
- /**
232
- * Bulk-clear a rectangular region of the screen.
233
- * Uses BigInt64Array.fill() for fast row clears.
234
- * Handles wide character boundary cleanup at region edges.
235
- */
236
- export declare function clearRegion(screen: Screen, regionX: number, regionY: number, regionWidth: number, regionHeight: number): void;
237
- /**
238
- * Shift full-width rows within [top, bottom] (inclusive, 0-indexed) by n.
239
- * n > 0 shifts UP (simulating CSI n S); n < 0 shifts DOWN (CSI n T).
240
- * Vacated rows are cleared. Does NOT update damage. Both cells and the
241
- * noSelect bitmap are shifted so text-selection markers stay aligned when
242
- * this is applied to next.screen during scroll fast path.
243
- */
244
- export declare function shiftRows(screen: Screen, top: number, bottom: number, n: number): void;
245
- export declare const OSC8_PREFIX = "\u001B]8;";
246
- export declare function extractHyperlinkFromStyles(styles: AnsiCode[]): Hyperlink | null;
247
- export declare function filterOutHyperlinkStyles(styles: AnsiCode[]): AnsiCode[];
248
- /**
249
- * Returns an array of all changes between two screens. Used by tests.
250
- * Production code should use diffEach() to avoid allocations.
251
- */
252
- export declare function diff(prev: Screen, next: Screen): [point: Point, removed: Cell | undefined, added: Cell | undefined][];
253
- type DiffCallback = (x: number, y: number, removed: Cell | undefined, added: Cell | undefined) => boolean | void;
254
- /**
255
- * Like diff(), but calls a callback for each change instead of building an array.
256
- * Reuses two Cell objects to avoid per-change allocations. The callback must not
257
- * retain references to the Cell objects — their contents are overwritten each call.
258
- *
259
- * Returns true if the callback ever returned true (early exit signal).
260
- */
261
- export declare function diffEach(prev: Screen, next: Screen, cb: DiffCallback): boolean;
262
- /**
263
- * Mark a rectangular region as noSelect (exclude from text selection).
264
- * Clamps to screen bounds. Called from output.ts when a <NoSelect> box
265
- * renders. No damage tracking — noSelect doesn't affect terminal output,
266
- * only getSelectedText/applySelectionOverlay which read it directly.
267
- */
268
- export declare function markNoSelectRegion(screen: Screen, x: number, y: number, width: number, height: number): void;
269
- export {};
@@ -1,20 +0,0 @@
1
- import { type Screen, type StylePool } from './screen.js';
2
- /**
3
- * Highlight all visible occurrences of `query` in the screen buffer by
4
- * inverting cell styles (SGR 7). Post-render, same damage-tracking machinery
5
- * as applySelectionOverlay — the diff picks up highlighted cells as ordinary
6
- * changes, LogUpdate stays a pure diff engine.
7
- *
8
- * Case-insensitive. Handles wide characters (CJK, emoji) by building a
9
- * col-of-char map per row — the Nth character isn't at col N when wide chars
10
- * are present (each occupies 2 cells: head + SpacerTail).
11
- *
12
- * This ONLY inverts — there is no "current match" logic here. The yellow
13
- * current-match overlay is handled separately by applyPositionedHighlight
14
- * (render-to-screen.ts), which writes on top using positions scanned from
15
- * the target message's DOM subtree.
16
- *
17
- * Returns true if any match was highlighted (damage gate — caller forces
18
- * full-frame damage when true).
19
- */
20
- export declare function applySearchHighlight(screen: Screen, query: string, stylePool: StylePool): boolean;
@@ -1,229 +0,0 @@
1
- /**
2
- * Text selection state for fullscreen mode.
3
- *
4
- * Tracks a linear selection in screen-buffer coordinates (0-indexed col/row).
5
- * Selection is line-based: cells from (startCol, startRow) through
6
- * (endCol, endRow) inclusive, wrapping across line boundaries. This matches
7
- * terminal-native selection behavior (not rectangular/block).
8
- *
9
- * The selection is stored as ANCHOR (where the drag started) + FOCUS (where
10
- * the cursor is now). The rendered highlight normalizes to start ≤ end.
11
- */
12
- import type { Screen, StylePool } from './screen.js';
13
- type Point = {
14
- col: number;
15
- row: number;
16
- };
17
- export type SelectionState = {
18
- /** Where the mouse-down occurred. Null when no selection. */
19
- anchor: Point | null;
20
- /** Current drag position (updated on mouse-move while dragging). */
21
- focus: Point | null;
22
- /** True between mouse-down and mouse-up. */
23
- isDragging: boolean;
24
- /** For word/line mode: the initial word/line bounds from the first
25
- * multi-click. Drag extends from this span to the word/line at the
26
- * current mouse position so the original word/line stays selected
27
- * even when dragging backward past it. Null ⇔ char mode. The kind
28
- * tells extendSelection whether to snap to word or line boundaries. */
29
- anchorSpan: {
30
- lo: Point;
31
- hi: Point;
32
- kind: 'word' | 'line';
33
- } | null;
34
- /** Text from rows that scrolled out ABOVE the viewport during
35
- * drag-to-scroll. The screen buffer only holds the current viewport,
36
- * so without this accumulator, dragging down past the bottom edge
37
- * loses the top of the selection once the anchor clamps. Prepended
38
- * to the on-screen text by getSelectedText. Reset on start/clear. */
39
- scrolledOffAbove: string[];
40
- /** Symmetric: rows scrolled out BELOW when dragging up. Appended. */
41
- scrolledOffBelow: string[];
42
- /** Soft-wrap bits parallel to scrolledOffAbove — true means the row
43
- * is a continuation of the one before it (the `\n` was inserted by
44
- * word-wrap, not in the source). Captured alongside the text at
45
- * scroll time since the screen's softWrap bitmap shifts with content.
46
- * getSelectedText uses these to join wrapped rows back into logical
47
- * lines. */
48
- scrolledOffAboveSW: boolean[];
49
- /** Parallel to scrolledOffBelow. */
50
- scrolledOffBelowSW: boolean[];
51
- /** Pre-clamp anchor row. Set when shiftSelection clamps anchor so a
52
- * reverse scroll can restore the true position and pop accumulators.
53
- * Without this, PgDn (clamps anchor) → PgUp leaves anchor at the wrong
54
- * row AND scrolledOffAbove stale — highlight ≠ copy. Undefined when
55
- * anchor is in-bounds (no clamp debt). Cleared on start/clear. */
56
- virtualAnchorRow?: number;
57
- /** Same for focus. */
58
- virtualFocusRow?: number;
59
- /** True if the mouse-down that started this selection had the alt
60
- * modifier set (SGR button bit 0x08). On macOS xterm.js this is a
61
- * signal that VS Code's macOptionClickForcesSelection is OFF — if it
62
- * were on, xterm.js would have consumed the event for native selection
63
- * and we'd never receive it. Used by the footer to show the right hint. */
64
- lastPressHadAlt: boolean;
65
- };
66
- export declare function createSelectionState(): SelectionState;
67
- export declare function startSelection(s: SelectionState, col: number, row: number): void;
68
- export declare function updateSelection(s: SelectionState, col: number, row: number): void;
69
- export declare function finishSelection(s: SelectionState): void;
70
- export declare function clearSelection(s: SelectionState): void;
71
- /**
72
- * Select the word at (col, row) by scanning the screen buffer for the
73
- * bounds of the same-class character run. Mutates the selection in place.
74
- * No-op if the click is out of bounds or lands on a noSelect cell.
75
- * Sets isDragging=true and anchorSpan so a subsequent drag extends the
76
- * selection word-by-word (native macOS behavior).
77
- */
78
- export declare function selectWordAt(s: SelectionState, screen: Screen, col: number, row: number): void;
79
- /**
80
- * Scan the screen buffer for a plain-text URL at (col, row). Mirrors the
81
- * terminal's native Cmd+Click URL detection, which fullscreen mode's mouse
82
- * tracking intercepts. Called from getHyperlinkAt as a fallback when the
83
- * cell has no OSC 8 hyperlink.
84
- */
85
- export declare function findPlainTextUrlAt(screen: Screen, col: number, row: number): string | undefined;
86
- /**
87
- * Select the entire row. Sets isDragging=true and anchorSpan so a
88
- * subsequent drag extends the selection line-by-line. The anchor/focus
89
- * span from col 0 to width-1; getSelectedText handles noSelect skipping
90
- * and trailing-whitespace trimming so the copied text is just the visible
91
- * line content.
92
- */
93
- export declare function selectLineAt(s: SelectionState, screen: Screen, row: number): void;
94
- /**
95
- * Extend a word/line-mode selection to the word/line at (col, row). The
96
- * anchor span (the original multi-clicked word/line) stays selected; the
97
- * selection grows from that span to the word/line at the current mouse
98
- * position. Word mode falls back to the raw cell when the mouse is over a
99
- * noSelect cell or out of bounds, so dragging into gutters still extends.
100
- */
101
- export declare function extendSelection(s: SelectionState, screen: Screen, col: number, row: number): void;
102
- /** Semantic keyboard focus moves. See moveSelectionFocus in ink.tsx for
103
- * how screen bounds + row-wrap are applied. */
104
- export type FocusMove = 'left' | 'right' | 'up' | 'down' | 'lineStart' | 'lineEnd';
105
- /**
106
- * Set focus to (col, row) for keyboard selection extension (shift+arrow).
107
- * Anchor stays fixed; selection grows or shrinks depending on where focus
108
- * moves relative to anchor. Drops to char mode (clears anchorSpan) —
109
- * native macOS does this too: shift+arrow after a double-click word-select
110
- * extends char-by-char from the word edge, not word-by-word. Scrolled-off
111
- * accumulators are preserved: keyboard-extending a drag-scrolled selection
112
- * keeps the off-screen rows. Caller supplies coords already clamped/wrapped.
113
- */
114
- export declare function moveFocus(s: SelectionState, col: number, row: number): void;
115
- /**
116
- * Shift anchor AND focus by dRow, clamped to [minRow, maxRow]. Used for
117
- * keyboard scroll (PgUp/PgDn/ctrl+u/d/b/f): the whole selection must track
118
- * the content, unlike drag-to-scroll where focus stays at the mouse. Any
119
- * point that hits a clamp bound gets its col reset to the full-width edge —
120
- * its original content scrolled off-screen and was captured by
121
- * captureScrolledRows, so the col constraint was already consumed. Keeping
122
- * it would truncate the NEW content now at that screen row. Clamp col is 0
123
- * for dRow<0 (scrolling down, top leaves, 'above' semantics) or width-1 for
124
- * dRow>0 (scrolling up, bottom leaves, 'below' semantics).
125
- *
126
- * If both ends overshoot the SAME viewport edge (select text → Home/End/g/G
127
- * jumps far enough that both are out of view), clear — otherwise both clamp
128
- * to the same corner cell and a ghost 1-cell highlight lingers, and
129
- * getSelectedText returns one unrelated char from that corner. Symmetric
130
- * with shiftSelectionForFollow's top-edge check, but bidirectional: keyboard
131
- * scroll can jump either way.
132
- */
133
- export declare function shiftSelection(s: SelectionState, dRow: number, minRow: number, maxRow: number, width: number, clearOnFullOvershoot?: boolean): void;
134
- /**
135
- * Shift the anchor row by dRow, clamped to [minRow, maxRow]. Used during
136
- * drag-to-scroll: when the ScrollBox scrolls by N rows, the content that
137
- * was under the anchor is now at a different viewport row, so the anchor
138
- * must follow it. Focus is left unchanged (it stays at the mouse position).
139
- */
140
- export declare function shiftAnchor(s: SelectionState, dRow: number, minRow: number, maxRow: number): void;
141
- /**
142
- * Shift the whole selection (anchor + focus + anchorSpan) by dRow, clamped
143
- * to [minRow, maxRow]. Used when sticky/auto-follow scrolls the ScrollBox
144
- * while a selection is active — native terminal behavior is for the
145
- * highlight to walk up the screen with the text (not stay at the same
146
- * screen position).
147
- *
148
- * Differs from shiftAnchor: during drag-to-scroll, focus tracks the live
149
- * mouse position and only anchor follows the text. During streaming-follow,
150
- * the selection is text-anchored at both ends — both must move. The
151
- * isDragging check in ink.tsx picks which shift to apply.
152
- *
153
- * If both ends would shift strictly BELOW minRow (unclamped), the selected
154
- * text has scrolled entirely off the top. Clear it — otherwise a single
155
- * inverted cell lingers at the viewport top as a ghost (native terminals
156
- * drop the selection when it leaves scrollback). Landing AT minRow is
157
- * still valid: that cell holds the correct text. Returns true if the
158
- * selection was cleared so the caller can notify React-land subscribers
159
- * (useHasSelection) — the caller is inside onRender so it can't use
160
- * notifySelectionChange (recursion), must fire listeners directly.
161
- */
162
- export declare function shiftSelectionForFollow(s: SelectionState, dRow: number, minRow: number, maxRow: number): boolean;
163
- export declare function hasSelection(s: SelectionState): boolean;
164
- /**
165
- * Normalized selection bounds: start is always before end in reading order.
166
- * Returns null if no active selection.
167
- */
168
- export declare function selectionBounds(s: SelectionState): {
169
- start: {
170
- col: number;
171
- row: number;
172
- };
173
- end: {
174
- col: number;
175
- row: number;
176
- };
177
- } | null;
178
- /**
179
- * Check if a cell at (col, row) is within the current selection range.
180
- * Used by the renderer to apply inverse style.
181
- */
182
- export declare function isCellSelected(s: SelectionState, col: number, row: number): boolean;
183
- /**
184
- * Extract text from the screen buffer within the selection range.
185
- * Rows are joined with newlines unless the screen's softWrap bitmap
186
- * marks a row as a word-wrap continuation — those rows are concatenated
187
- * onto the previous row so the copied text matches the logical source
188
- * line, not the visual wrapped layout. Trailing whitespace on the last
189
- * fragment of each logical line is trimmed. Wide-char spacer cells are
190
- * skipped. Rows that scrolled out of the viewport during drag-to-scroll
191
- * are joined back in from the scrolledOffAbove/Below accumulators along
192
- * with their captured softWrap bits.
193
- */
194
- export declare function getSelectedText(s: SelectionState, screen: Screen): string;
195
- /**
196
- * Capture text from rows about to scroll out of the viewport during
197
- * drag-to-scroll, BEFORE scrollBy overwrites them. Only the rows that
198
- * intersect the selection are captured, using the selection's col bounds
199
- * for the anchor-side boundary row. After capturing the anchor row, the
200
- * anchor.col AND anchorSpan cols are reset to the full-width boundary so
201
- * subsequent captures and the final getSelectedText don't re-apply a stale
202
- * col constraint to content that's no longer under the original anchor.
203
- * Both span cols are reset (not just the near side): after a blocked
204
- * reversal the drag can flip direction, and extendSelection then reads the
205
- * OPPOSITE span side — which would otherwise still hold the original word
206
- * boundary and truncate one subsequently-captured row.
207
- *
208
- * side='above': rows scrolling out the top (dragging down, anchor=start).
209
- * side='below': rows scrolling out the bottom (dragging up, anchor=end).
210
- */
211
- export declare function captureScrolledRows(s: SelectionState, screen: Screen, firstRow: number, lastRow: number, side: 'above' | 'below'): void;
212
- /**
213
- * Apply the selection overlay directly to the screen buffer by changing
214
- * the style of every cell in the selection range. Called after the
215
- * renderer produces the Frame but before the diff — the normal diffEach
216
- * then picks up the restyled cells as ordinary changes, so LogUpdate
217
- * stays a pure diff engine with no selection awareness.
218
- *
219
- * Uses a SOLID selection background (theme-provided via StylePool.
220
- * setSelectionBg) that REPLACES each cell's bg while PRESERVING its fg —
221
- * matches native terminal selection. Previously SGR-7 inverse (swapped
222
- * fg/bg per cell), which fragmented badly over syntax-highlighted text:
223
- * every distinct fg color became a different bg stripe.
224
- *
225
- * Uses StylePool caches so on drag the only work per cell is a Map
226
- * lookup + packed-int write.
227
- */
228
- export declare function applySelectionOverlay(screen: Screen, selection: SelectionState, stylePool: StylePool): void;
229
- export {};
@@ -1,22 +0,0 @@
1
- import type { DOMElement } from './dom.js';
2
- import type { TextStyles } from './styles.js';
3
- /**
4
- * A segment of text with its associated styles.
5
- * Used for structured rendering without ANSI string transforms.
6
- */
7
- export type StyledSegment = {
8
- text: string;
9
- styles: TextStyles;
10
- hyperlink?: string;
11
- };
12
- /**
13
- * Squash text nodes into styled segments, propagating styles down through the tree.
14
- * This allows structured styling without relying on ANSI string transforms.
15
- */
16
- export declare function squashTextNodesToSegments(node: DOMElement, inheritedStyles?: TextStyles, inheritedHyperlink?: string, out?: StyledSegment[]): StyledSegment[];
17
- /**
18
- * Squash text nodes into a plain string (without styles).
19
- * Used for text measurement in layout calculations.
20
- */
21
- declare function squashTextNodes(node: DOMElement): string;
22
- export default squashTextNodes;
@@ -1 +0,0 @@
1
- export declare const stringWidth: (str: string) => number;