@deepseek-harness-tui/dsh-tui 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (638) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +235 -0
  3. package/bin/dsh-tui.js +95 -0
  4. package/cordis.patch.yml +218 -0
  5. package/cordis.yml +185 -0
  6. package/lib/invariant.js +28 -0
  7. package/lib/types/activityPrefs.d.ts +29 -0
  8. package/lib/types/activityPrefs.d.ts.map +1 -0
  9. package/lib/types/activityPrefs.js +60 -0
  10. package/lib/types/bootstrap/state.d.ts +13 -0
  11. package/lib/types/bootstrap/state.d.ts.map +1 -0
  12. package/lib/types/bootstrap/state.js +12 -0
  13. package/lib/types/cc/cliHighlight.d.ts +20 -0
  14. package/lib/types/cc/cliHighlight.d.ts.map +1 -0
  15. package/lib/types/cc/cliHighlight.js +53 -0
  16. package/lib/types/cc/figures.d.ts +59 -0
  17. package/lib/types/cc/figures.d.ts.map +1 -0
  18. package/lib/types/cc/figures.js +69 -0
  19. package/lib/types/cc/format.d.ts +26 -0
  20. package/lib/types/cc/format.d.ts.map +1 -0
  21. package/lib/types/cc/format.js +55 -0
  22. package/lib/types/cc/hash.d.ts +25 -0
  23. package/lib/types/cc/hash.d.ts.map +1 -0
  24. package/lib/types/cc/hash.js +41 -0
  25. package/lib/types/cc/hyperlink.d.ts +21 -0
  26. package/lib/types/cc/hyperlink.d.ts.map +1 -0
  27. package/lib/types/cc/hyperlink.js +31 -0
  28. package/lib/types/cc/markdown.d.ts +43 -0
  29. package/lib/types/cc/markdown.d.ts.map +1 -0
  30. package/lib/types/cc/markdown.js +345 -0
  31. package/lib/types/cc/spinnerVerbs.d.ts +3 -0
  32. package/lib/types/cc/spinnerVerbs.d.ts.map +1 -0
  33. package/lib/types/cc/spinnerVerbs.js +190 -0
  34. package/lib/types/cc/terminal.d.ts +15 -0
  35. package/lib/types/cc/terminal.d.ts.map +1 -0
  36. package/lib/types/cc/terminal.js +84 -0
  37. package/lib/types/channel.d.ts +672 -0
  38. package/lib/types/channel.d.ts.map +1 -0
  39. package/lib/types/channel.js +2427 -0
  40. package/lib/types/childStderr.d.ts +63 -0
  41. package/lib/types/childStderr.d.ts.map +1 -0
  42. package/lib/types/childStderr.js +161 -0
  43. package/lib/types/commands.d.ts +55 -0
  44. package/lib/types/commands.d.ts.map +1 -0
  45. package/lib/types/commands.js +101 -0
  46. package/lib/types/components/ActivityLine.d.ts +29 -0
  47. package/lib/types/components/ActivityLine.d.ts.map +1 -0
  48. package/lib/types/components/ActivityLine.js +47 -0
  49. package/lib/types/components/ActivityPicker.d.ts +13 -0
  50. package/lib/types/components/ActivityPicker.d.ts.map +1 -0
  51. package/lib/types/components/ActivityPicker.js +24 -0
  52. package/lib/types/components/CommandSuggestions.d.ts +14 -0
  53. package/lib/types/components/CommandSuggestions.d.ts.map +1 -0
  54. package/lib/types/components/CommandSuggestions.js +33 -0
  55. package/lib/types/components/FileSuggestions.d.ts +12 -0
  56. package/lib/types/components/FileSuggestions.d.ts.map +1 -0
  57. package/lib/types/components/FileSuggestions.js +26 -0
  58. package/lib/types/components/GoalTodoPanel.d.ts +13 -0
  59. package/lib/types/components/GoalTodoPanel.d.ts.map +1 -0
  60. package/lib/types/components/GoalTodoPanel.js +57 -0
  61. package/lib/types/components/HelpMenu.d.ts +12 -0
  62. package/lib/types/components/HelpMenu.d.ts.map +1 -0
  63. package/lib/types/components/HelpMenu.js +12 -0
  64. package/lib/types/components/HistorySearchDialog.d.ts +16 -0
  65. package/lib/types/components/HistorySearchDialog.d.ts.map +1 -0
  66. package/lib/types/components/HistorySearchDialog.js +31 -0
  67. package/lib/types/components/InterruptedByUser.d.ts +7 -0
  68. package/lib/types/components/InterruptedByUser.d.ts.map +1 -0
  69. package/lib/types/components/InterruptedByUser.js +9 -0
  70. package/lib/types/components/LoadedContextPanel.d.ts +20 -0
  71. package/lib/types/components/LoadedContextPanel.d.ts.map +1 -0
  72. package/lib/types/components/LoadedContextPanel.js +30 -0
  73. package/lib/types/components/LogoV2.d.ts +23 -0
  74. package/lib/types/components/LogoV2.d.ts.map +1 -0
  75. package/lib/types/components/LogoV2.js +95 -0
  76. package/lib/types/components/Markdown.d.ts +24 -0
  77. package/lib/types/components/Markdown.d.ts.map +1 -0
  78. package/lib/types/components/Markdown.js +106 -0
  79. package/lib/types/components/MarkdownTable.d.ts +17 -0
  80. package/lib/types/components/MarkdownTable.d.ts.map +1 -0
  81. package/lib/types/components/MarkdownTable.js +272 -0
  82. package/lib/types/components/MessageList.d.ts +41 -0
  83. package/lib/types/components/MessageList.d.ts.map +1 -0
  84. package/lib/types/components/MessageList.js +303 -0
  85. package/lib/types/components/ModelPicker.d.ts +14 -0
  86. package/lib/types/components/ModelPicker.d.ts.map +1 -0
  87. package/lib/types/components/ModelPicker.js +15 -0
  88. package/lib/types/components/PresetPicker.d.ts +17 -0
  89. package/lib/types/components/PresetPicker.d.ts.map +1 -0
  90. package/lib/types/components/PresetPicker.js +25 -0
  91. package/lib/types/components/PromptInput.d.ts +67 -0
  92. package/lib/types/components/PromptInput.d.ts.map +1 -0
  93. package/lib/types/components/PromptInput.js +778 -0
  94. package/lib/types/components/ResumePicker.d.ts +15 -0
  95. package/lib/types/components/ResumePicker.d.ts.map +1 -0
  96. package/lib/types/components/ResumePicker.js +34 -0
  97. package/lib/types/components/RewindPicker.d.ts +14 -0
  98. package/lib/types/components/RewindPicker.d.ts.map +1 -0
  99. package/lib/types/components/RewindPicker.js +23 -0
  100. package/lib/types/components/SearchBox.d.ts +20 -0
  101. package/lib/types/components/SearchBox.d.ts.map +1 -0
  102. package/lib/types/components/SearchBox.js +33 -0
  103. package/lib/types/components/Select.d.ts +22 -0
  104. package/lib/types/components/Select.d.ts.map +1 -0
  105. package/lib/types/components/Select.js +19 -0
  106. package/lib/types/components/Spinner/GlimmerMessage.d.ts +19 -0
  107. package/lib/types/components/Spinner/GlimmerMessage.d.ts.map +1 -0
  108. package/lib/types/components/Spinner/GlimmerMessage.js +78 -0
  109. package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts +31 -0
  110. package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts.map +1 -0
  111. package/lib/types/components/Spinner/SpinnerAnimationRow.js +162 -0
  112. package/lib/types/components/Spinner/SpinnerGlyph.d.ts +16 -0
  113. package/lib/types/components/Spinner/SpinnerGlyph.d.ts.map +1 -0
  114. package/lib/types/components/Spinner/SpinnerGlyph.js +36 -0
  115. package/lib/types/components/Spinner/spinnerMode.d.ts +6 -0
  116. package/lib/types/components/Spinner/spinnerMode.d.ts.map +1 -0
  117. package/lib/types/components/Spinner/spinnerMode.js +1 -0
  118. package/lib/types/components/Spinner/spinnerUtils.d.ts +41 -0
  119. package/lib/types/components/Spinner/spinnerUtils.d.ts.map +1 -0
  120. package/lib/types/components/Spinner/spinnerUtils.js +104 -0
  121. package/lib/types/components/Spinner/useStalledAnimation.d.ts +16 -0
  122. package/lib/types/components/Spinner/useStalledAnimation.d.ts.map +1 -0
  123. package/lib/types/components/Spinner/useStalledAnimation.js +71 -0
  124. package/lib/types/components/StreamingMarkdown.d.ts +12 -0
  125. package/lib/types/components/StreamingMarkdown.d.ts.map +1 -0
  126. package/lib/types/components/StreamingMarkdown.js +39 -0
  127. package/lib/types/components/ThemePicker.d.ts +22 -0
  128. package/lib/types/components/ThemePicker.d.ts.map +1 -0
  129. package/lib/types/components/ThemePicker.js +51 -0
  130. package/lib/types/components/ThinkingToggle.d.ts +17 -0
  131. package/lib/types/components/ThinkingToggle.d.ts.map +1 -0
  132. package/lib/types/components/ThinkingToggle.js +30 -0
  133. package/lib/types/components/ToolUseLoader.d.ts +13 -0
  134. package/lib/types/components/ToolUseLoader.d.ts.map +1 -0
  135. package/lib/types/components/ToolUseLoader.js +17 -0
  136. package/lib/types/components/Whale.d.ts +22 -0
  137. package/lib/types/components/Whale.d.ts.map +1 -0
  138. package/lib/types/components/Whale.js +78 -0
  139. package/lib/types/components/WorkingSpinner.d.ts +26 -0
  140. package/lib/types/components/WorkingSpinner.d.ts.map +1 -0
  141. package/lib/types/components/WorkingSpinner.js +68 -0
  142. package/lib/types/components/activityFrames.d.ts +31 -0
  143. package/lib/types/components/activityFrames.d.ts.map +1 -0
  144. package/lib/types/components/activityFrames.js +83 -0
  145. package/lib/types/components/bigfont.d.ts +28 -0
  146. package/lib/types/components/bigfont.d.ts.map +1 -0
  147. package/lib/types/components/bigfont.js +91 -0
  148. package/lib/types/components/design-system/Byline.d.ts +14 -0
  149. package/lib/types/components/design-system/Byline.d.ts.map +1 -0
  150. package/lib/types/components/design-system/Byline.js +17 -0
  151. package/lib/types/components/design-system/Divider.d.ts +40 -0
  152. package/lib/types/components/design-system/Divider.d.ts.map +1 -0
  153. package/lib/types/components/design-system/Divider.js +24 -0
  154. package/lib/types/components/design-system/KeyboardShortcutHint.d.ts +19 -0
  155. package/lib/types/components/design-system/KeyboardShortcutHint.d.ts.map +1 -0
  156. package/lib/types/components/design-system/KeyboardShortcutHint.js +14 -0
  157. package/lib/types/components/design-system/ListItem.d.ts +36 -0
  158. package/lib/types/components/design-system/ListItem.d.ts.map +1 -0
  159. package/lib/types/components/design-system/ListItem.js +48 -0
  160. package/lib/types/components/design-system/LoadingState.d.ts +19 -0
  161. package/lib/types/components/design-system/LoadingState.d.ts.map +1 -0
  162. package/lib/types/components/design-system/LoadingState.js +22 -0
  163. package/lib/types/components/design-system/Pane.d.ts +17 -0
  164. package/lib/types/components/design-system/Pane.d.ts.map +1 -0
  165. package/lib/types/components/design-system/Pane.js +15 -0
  166. package/lib/types/components/design-system/ProgressBar.d.ts +22 -0
  167. package/lib/types/components/design-system/ProgressBar.d.ts.map +1 -0
  168. package/lib/types/components/design-system/ProgressBar.js +27 -0
  169. package/lib/types/components/design-system/StatusIcon.d.ts +15 -0
  170. package/lib/types/components/design-system/StatusIcon.d.ts.map +1 -0
  171. package/lib/types/components/design-system/StatusIcon.js +20 -0
  172. package/lib/types/components/design-system/ThemeProvider.d.ts +11 -0
  173. package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -0
  174. package/lib/types/components/design-system/ThemeProvider.js +135 -0
  175. package/lib/types/components/design-system/ThemedBox.d.ts +37 -0
  176. package/lib/types/components/design-system/ThemedBox.d.ts.map +1 -0
  177. package/lib/types/components/design-system/ThemedBox.js +26 -0
  178. package/lib/types/components/design-system/ThemedText.d.ts +56 -0
  179. package/lib/types/components/design-system/ThemedText.d.ts.map +1 -0
  180. package/lib/types/components/design-system/ThemedText.js +45 -0
  181. package/lib/types/components/messages/AssistantTextMessage.d.ts +18 -0
  182. package/lib/types/components/messages/AssistantTextMessage.d.ts.map +1 -0
  183. package/lib/types/components/messages/AssistantTextMessage.js +15 -0
  184. package/lib/types/components/messages/AssistantThinkingMessage.d.ts +23 -0
  185. package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -0
  186. package/lib/types/components/messages/AssistantThinkingMessage.js +23 -0
  187. package/lib/types/components/messages/AssistantToolUseMessage.d.ts +23 -0
  188. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -0
  189. package/lib/types/components/messages/AssistantToolUseMessage.js +220 -0
  190. package/lib/types/components/messages/MessageMetadata.d.ts +15 -0
  191. package/lib/types/components/messages/MessageMetadata.d.ts.map +1 -0
  192. package/lib/types/components/messages/MessageMetadata.js +20 -0
  193. package/lib/types/components/messages/UserPromptMessage.d.ts +19 -0
  194. package/lib/types/components/messages/UserPromptMessage.d.ts.map +1 -0
  195. package/lib/types/components/messages/UserPromptMessage.js +15 -0
  196. package/lib/types/components/questions/AskUserQuestionPanel.d.ts +39 -0
  197. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -0
  198. package/lib/types/components/questions/AskUserQuestionPanel.js +228 -0
  199. package/lib/types/components/shimmer.d.ts +35 -0
  200. package/lib/types/components/shimmer.d.ts.map +1 -0
  201. package/lib/types/components/shimmer.js +43 -0
  202. package/lib/types/components/whaleFrames.d.ts +25 -0
  203. package/lib/types/components/whaleFrames.d.ts.map +1 -0
  204. package/lib/types/components/whaleFrames.js +419 -0
  205. package/lib/types/customTheme.d.ts +104 -0
  206. package/lib/types/customTheme.d.ts.map +1 -0
  207. package/lib/types/customTheme.js +268 -0
  208. package/lib/types/effortPrefs.d.ts +22 -0
  209. package/lib/types/effortPrefs.d.ts.map +1 -0
  210. package/lib/types/effortPrefs.js +45 -0
  211. package/lib/types/history.d.ts +24 -0
  212. package/lib/types/history.d.ts.map +1 -0
  213. package/lib/types/history.js +75 -0
  214. package/lib/types/hooks/useBlink.d.ts +11 -0
  215. package/lib/types/hooks/useBlink.d.ts.map +1 -0
  216. package/lib/types/hooks/useBlink.js +20 -0
  217. package/lib/types/i18n.d.ts +926 -0
  218. package/lib/types/i18n.d.ts.map +1 -0
  219. package/lib/types/i18n.js +356 -0
  220. package/lib/types/index.d.ts +70 -0
  221. package/lib/types/index.d.ts.map +1 -0
  222. package/lib/types/index.js +31 -0
  223. package/lib/types/ink/Ansi.d.ts +11 -0
  224. package/lib/types/ink/Ansi.d.ts.map +1 -0
  225. package/lib/types/ink/Ansi.js +269 -0
  226. package/lib/types/ink/bidi.d.ts +18 -0
  227. package/lib/types/ink/bidi.d.ts.map +1 -0
  228. package/lib/types/ink/bidi.js +119 -0
  229. package/lib/types/ink/clearTerminal.d.ts +22 -0
  230. package/lib/types/ink/clearTerminal.d.ts.map +1 -0
  231. package/lib/types/ink/clearTerminal.js +72 -0
  232. package/lib/types/ink/colorize.d.ts +33 -0
  233. package/lib/types/ink/colorize.d.ts.map +1 -0
  234. package/lib/types/ink/colorize.js +213 -0
  235. package/lib/types/ink/components/AlternateScreen.d.ts +22 -0
  236. package/lib/types/ink/components/AlternateScreen.d.ts.map +1 -0
  237. package/lib/types/ink/components/AlternateScreen.js +74 -0
  238. package/lib/types/ink/components/App.d.ts +73 -0
  239. package/lib/types/ink/components/App.d.ts.map +1 -0
  240. package/lib/types/ink/components/App.js +597 -0
  241. package/lib/types/ink/components/AppContext.d.ts +15 -0
  242. package/lib/types/ink/components/AppContext.d.ts.map +1 -0
  243. package/lib/types/ink/components/AppContext.js +11 -0
  244. package/lib/types/ink/components/Box.d.ts +49 -0
  245. package/lib/types/ink/components/Box.d.ts.map +1 -0
  246. package/lib/types/ink/components/Box.js +153 -0
  247. package/lib/types/ink/components/Button.d.ts +37 -0
  248. package/lib/types/ink/components/Button.d.ts.map +1 -0
  249. package/lib/types/ink/components/Button.js +166 -0
  250. package/lib/types/ink/components/ClockContext.d.ts +10 -0
  251. package/lib/types/ink/components/ClockContext.d.ts.map +1 -0
  252. package/lib/types/ink/components/ClockContext.js +108 -0
  253. package/lib/types/ink/components/CursorDeclarationContext.d.ts +30 -0
  254. package/lib/types/ink/components/CursorDeclarationContext.d.ts.map +1 -0
  255. package/lib/types/ink/components/CursorDeclarationContext.js +6 -0
  256. package/lib/types/ink/components/ErrorOverview.d.ts +7 -0
  257. package/lib/types/ink/components/ErrorOverview.d.ts.map +1 -0
  258. package/lib/types/ink/components/ErrorOverview.js +49 -0
  259. package/lib/types/ink/components/Link.d.ts +8 -0
  260. package/lib/types/ink/components/Link.d.ts.map +1 -0
  261. package/lib/types/ink/components/Link.js +33 -0
  262. package/lib/types/ink/components/Newline.d.ts +13 -0
  263. package/lib/types/ink/components/Newline.d.ts.map +1 -0
  264. package/lib/types/ink/components/Newline.js +29 -0
  265. package/lib/types/ink/components/NoSelect.d.ts +20 -0
  266. package/lib/types/ink/components/NoSelect.d.ts.map +1 -0
  267. package/lib/types/ink/components/NoSelect.js +56 -0
  268. package/lib/types/ink/components/RawAnsi.d.ts +17 -0
  269. package/lib/types/ink/components/RawAnsi.d.ts.map +1 -0
  270. package/lib/types/ink/components/RawAnsi.js +45 -0
  271. package/lib/types/ink/components/ScrollBox.d.ts +78 -0
  272. package/lib/types/ink/components/ScrollBox.d.ts.map +1 -0
  273. package/lib/types/ink/components/ScrollBox.js +174 -0
  274. package/lib/types/ink/components/Spacer.d.ts +6 -0
  275. package/lib/types/ink/components/Spacer.d.ts.map +1 -0
  276. package/lib/types/ink/components/Spacer.js +19 -0
  277. package/lib/types/ink/components/StdinContext.d.ts +32 -0
  278. package/lib/types/ink/components/StdinContext.d.ts.map +1 -0
  279. package/lib/types/ink/components/StdinContext.js +16 -0
  280. package/lib/types/ink/components/TerminalFocusContext.d.ts +11 -0
  281. package/lib/types/ink/components/TerminalFocusContext.d.ts.map +1 -0
  282. package/lib/types/ink/components/TerminalFocusContext.js +45 -0
  283. package/lib/types/ink/components/TerminalSizeContext.d.ts +6 -0
  284. package/lib/types/ink/components/TerminalSizeContext.d.ts.map +1 -0
  285. package/lib/types/ink/components/TerminalSizeContext.js +3 -0
  286. package/lib/types/ink/components/Text.d.ts +56 -0
  287. package/lib/types/ink/components/Text.d.ts.map +1 -0
  288. package/lib/types/ink/components/Text.js +194 -0
  289. package/lib/types/ink/constants.d.ts +3 -0
  290. package/lib/types/ink/constants.d.ts.map +1 -0
  291. package/lib/types/ink/constants.js +2 -0
  292. package/lib/types/ink/cursor.d.ts +11 -0
  293. package/lib/types/ink/cursor.d.ts.map +1 -0
  294. package/lib/types/ink/cursor.js +1 -0
  295. package/lib/types/ink/devtools.d.ts +7 -0
  296. package/lib/types/ink/devtools.d.ts.map +1 -0
  297. package/lib/types/ink/devtools.js +1 -0
  298. package/lib/types/ink/dom.d.ts +178 -0
  299. package/lib/types/ink/dom.d.ts.map +1 -0
  300. package/lib/types/ink/dom.js +424 -0
  301. package/lib/types/ink/events/click-event.d.ts +32 -0
  302. package/lib/types/ink/events/click-event.d.ts.map +1 -0
  303. package/lib/types/ink/events/click-event.js +36 -0
  304. package/lib/types/ink/events/dispatcher.d.ts +63 -0
  305. package/lib/types/ink/events/dispatcher.d.ts.map +1 -0
  306. package/lib/types/ink/events/dispatcher.js +194 -0
  307. package/lib/types/ink/events/emitter.d.ts +20 -0
  308. package/lib/types/ink/events/emitter.d.ts.map +1 -0
  309. package/lib/types/ink/events/emitter.js +43 -0
  310. package/lib/types/ink/events/event-handlers.d.ts +47 -0
  311. package/lib/types/ink/events/event-handlers.d.ts.map +1 -0
  312. package/lib/types/ink/events/event-handlers.js +30 -0
  313. package/lib/types/ink/events/event.d.ts +19 -0
  314. package/lib/types/ink/events/event.d.ts.map +1 -0
  315. package/lib/types/ink/events/event.js +22 -0
  316. package/lib/types/ink/events/focus-event.d.ts +19 -0
  317. package/lib/types/ink/events/focus-event.d.ts.map +1 -0
  318. package/lib/types/ink/events/focus-event.js +21 -0
  319. package/lib/types/ink/events/input-event.d.ts +53 -0
  320. package/lib/types/ink/events/input-event.d.ts.map +1 -0
  321. package/lib/types/ink/events/input-event.js +180 -0
  322. package/lib/types/ink/events/keyboard-event.d.ts +40 -0
  323. package/lib/types/ink/events/keyboard-event.d.ts.map +1 -0
  324. package/lib/types/ink/events/keyboard-event.js +65 -0
  325. package/lib/types/ink/events/paste-event.d.ts +11 -0
  326. package/lib/types/ink/events/paste-event.d.ts.map +1 -0
  327. package/lib/types/ink/events/paste-event.js +13 -0
  328. package/lib/types/ink/events/resize-event.d.ts +13 -0
  329. package/lib/types/ink/events/resize-event.d.ts.map +1 -0
  330. package/lib/types/ink/events/resize-event.js +16 -0
  331. package/lib/types/ink/events/terminal-event.d.ts +112 -0
  332. package/lib/types/ink/events/terminal-event.d.ts.map +1 -0
  333. package/lib/types/ink/events/terminal-event.js +131 -0
  334. package/lib/types/ink/events/terminal-focus-event.d.ts +21 -0
  335. package/lib/types/ink/events/terminal-focus-event.d.ts.map +1 -0
  336. package/lib/types/ink/events/terminal-focus-event.js +18 -0
  337. package/lib/types/ink/focus.d.ts +74 -0
  338. package/lib/types/ink/focus.d.ts.map +1 -0
  339. package/lib/types/ink/focus.js +188 -0
  340. package/lib/types/ink/frame.d.ts +119 -0
  341. package/lib/types/ink/frame.d.ts.map +1 -0
  342. package/lib/types/ink/frame.js +43 -0
  343. package/lib/types/ink/get-max-width.d.ts +20 -0
  344. package/lib/types/ink/get-max-width.d.ts.map +1 -0
  345. package/lib/types/ink/get-max-width.js +25 -0
  346. package/lib/types/ink/hit-test.d.ts +47 -0
  347. package/lib/types/ink/hit-test.d.ts.map +1 -0
  348. package/lib/types/ink/hit-test.js +126 -0
  349. package/lib/types/ink/hooks/use-animation-frame.d.ts +27 -0
  350. package/lib/types/ink/hooks/use-animation-frame.d.ts.map +1 -0
  351. package/lib/types/ink/hooks/use-animation-frame.js +48 -0
  352. package/lib/types/ink/hooks/use-app.d.ts +8 -0
  353. package/lib/types/ink/hooks/use-app.d.ts.map +1 -0
  354. package/lib/types/ink/hooks/use-app.js +8 -0
  355. package/lib/types/ink/hooks/use-copy-on-select.d.ts +22 -0
  356. package/lib/types/ink/hooks/use-copy-on-select.d.ts.map +1 -0
  357. package/lib/types/ink/hooks/use-copy-on-select.js +40 -0
  358. package/lib/types/ink/hooks/use-declared-cursor.d.ts +31 -0
  359. package/lib/types/ink/hooks/use-declared-cursor.d.ts.map +1 -0
  360. package/lib/types/ink/hooks/use-declared-cursor.js +65 -0
  361. package/lib/types/ink/hooks/use-input.d.ts +41 -0
  362. package/lib/types/ink/hooks/use-input.d.ts.map +1 -0
  363. package/lib/types/ink/hooks/use-input.js +73 -0
  364. package/lib/types/ink/hooks/use-interval.d.ts +23 -0
  365. package/lib/types/ink/hooks/use-interval.d.ts.map +1 -0
  366. package/lib/types/ink/hooks/use-interval.js +58 -0
  367. package/lib/types/ink/hooks/use-search-highlight.d.ts +34 -0
  368. package/lib/types/ink/hooks/use-search-highlight.d.ts.map +1 -0
  369. package/lib/types/ink/hooks/use-search-highlight.js +35 -0
  370. package/lib/types/ink/hooks/use-selection.d.ts +44 -0
  371. package/lib/types/ink/hooks/use-selection.d.ts.map +1 -0
  372. package/lib/types/ink/hooks/use-selection.js +64 -0
  373. package/lib/types/ink/hooks/use-stdin.d.ts +8 -0
  374. package/lib/types/ink/hooks/use-stdin.d.ts.map +1 -0
  375. package/lib/types/ink/hooks/use-stdin.js +8 -0
  376. package/lib/types/ink/hooks/use-tab-status.d.ts +18 -0
  377. package/lib/types/ink/hooks/use-tab-status.d.ts.map +1 -0
  378. package/lib/types/ink/hooks/use-tab-status.js +58 -0
  379. package/lib/types/ink/hooks/use-terminal-focus.d.ts +11 -0
  380. package/lib/types/ink/hooks/use-terminal-focus.d.ts.map +1 -0
  381. package/lib/types/ink/hooks/use-terminal-focus.js +15 -0
  382. package/lib/types/ink/hooks/use-terminal-size.d.ts +6 -0
  383. package/lib/types/ink/hooks/use-terminal-size.d.ts.map +1 -0
  384. package/lib/types/ink/hooks/use-terminal-size.js +12 -0
  385. package/lib/types/ink/hooks/use-terminal-title.d.ts +14 -0
  386. package/lib/types/ink/hooks/use-terminal-title.d.ts.map +1 -0
  387. package/lib/types/ink/hooks/use-terminal-title.js +30 -0
  388. package/lib/types/ink/hooks/use-terminal-viewport.d.ts +32 -0
  389. package/lib/types/ink/hooks/use-terminal-viewport.d.ts.map +1 -0
  390. package/lib/types/ink/hooks/use-terminal-viewport.js +79 -0
  391. package/lib/types/ink/ink.d.ts +370 -0
  392. package/lib/types/ink/ink.d.ts.map +1 -0
  393. package/lib/types/ink/ink.js +1665 -0
  394. package/lib/types/ink/instances.d.ts +10 -0
  395. package/lib/types/ink/instances.d.ts.map +1 -0
  396. package/lib/types/ink/instances.js +13 -0
  397. package/lib/types/ink/layout/engine.d.ts +7 -0
  398. package/lib/types/ink/layout/engine.d.ts.map +1 -0
  399. package/lib/types/ink/layout/engine.js +8 -0
  400. package/lib/types/ink/layout/geometry.d.ts +86 -0
  401. package/lib/types/ink/layout/geometry.d.ts.map +1 -0
  402. package/lib/types/ink/layout/geometry.js +95 -0
  403. package/lib/types/ink/layout/node.d.ts +151 -0
  404. package/lib/types/ink/layout/node.d.ts.map +1 -0
  405. package/lib/types/ink/layout/node.js +72 -0
  406. package/lib/types/ink/layout/yoga.d.ts +69 -0
  407. package/lib/types/ink/layout/yoga.d.ts.map +1 -0
  408. package/lib/types/ink/layout/yoga.js +249 -0
  409. package/lib/types/ink/line-width-cache.d.ts +9 -0
  410. package/lib/types/ink/line-width-cache.d.ts.map +1 -0
  411. package/lib/types/ink/line-width-cache.js +45 -0
  412. package/lib/types/ink/log-update.d.ts +57 -0
  413. package/lib/types/ink/log-update.d.ts.map +1 -0
  414. package/lib/types/ink/log-update.js +710 -0
  415. package/lib/types/ink/measure-element.d.ts +19 -0
  416. package/lib/types/ink/measure-element.d.ts.map +1 -0
  417. package/lib/types/ink/measure-element.js +10 -0
  418. package/lib/types/ink/measure-text.d.ts +13 -0
  419. package/lib/types/ink/measure-text.d.ts.map +1 -0
  420. package/lib/types/ink/measure-text.js +38 -0
  421. package/lib/types/ink/node-cache.d.ts +33 -0
  422. package/lib/types/ink/node-cache.d.ts.map +1 -0
  423. package/lib/types/ink/node-cache.js +42 -0
  424. package/lib/types/ink/optimizer.d.ts +18 -0
  425. package/lib/types/ink/optimizer.d.ts.map +1 -0
  426. package/lib/types/ink/optimizer.js +83 -0
  427. package/lib/types/ink/output.d.ts +200 -0
  428. package/lib/types/ink/output.d.ts.map +1 -0
  429. package/lib/types/ink/output.js +663 -0
  430. package/lib/types/ink/parse-keypress.d.ts +132 -0
  431. package/lib/types/ink/parse-keypress.d.ts.map +1 -0
  432. package/lib/types/ink/parse-keypress.js +707 -0
  433. package/lib/types/ink/reconciler.d.ts +43 -0
  434. package/lib/types/ink/reconciler.d.ts.map +1 -0
  435. package/lib/types/ink/reconciler.js +413 -0
  436. package/lib/types/ink/render-border.d.ts +36 -0
  437. package/lib/types/ink/render-border.d.ts.map +1 -0
  438. package/lib/types/ink/render-border.js +143 -0
  439. package/lib/types/ink/render-node-to-output.d.ts +93 -0
  440. package/lib/types/ink/render-node-to-output.d.ts.map +1 -0
  441. package/lib/types/ink/render-node-to-output.js +1290 -0
  442. package/lib/types/ink/render-to-screen.d.ts +65 -0
  443. package/lib/types/ink/render-to-screen.d.ts.map +1 -0
  444. package/lib/types/ink/render-to-screen.js +189 -0
  445. package/lib/types/ink/renderer.d.ts +24 -0
  446. package/lib/types/ink/renderer.d.ts.map +1 -0
  447. package/lib/types/ink/renderer.js +136 -0
  448. package/lib/types/ink/root.d.ts +91 -0
  449. package/lib/types/ink/root.d.ts.map +1 -0
  450. package/lib/types/ink/root.js +93 -0
  451. package/lib/types/ink/screen.d.ts +443 -0
  452. package/lib/types/ink/screen.d.ts.map +1 -0
  453. package/lib/types/ink/screen.js +1295 -0
  454. package/lib/types/ink/searchHighlight.d.ts +25 -0
  455. package/lib/types/ink/searchHighlight.d.ts.map +1 -0
  456. package/lib/types/ink/searchHighlight.js +82 -0
  457. package/lib/types/ink/selection.d.ts +323 -0
  458. package/lib/types/ink/selection.d.ts.map +1 -0
  459. package/lib/types/ink/selection.js +881 -0
  460. package/lib/types/ink/squash-text-nodes.d.ts +30 -0
  461. package/lib/types/ink/squash-text-nodes.d.ts.map +1 -0
  462. package/lib/types/ink/squash-text-nodes.js +63 -0
  463. package/lib/types/ink/stringWidth.d.ts +11 -0
  464. package/lib/types/ink/stringWidth.d.ts.map +1 -0
  465. package/lib/types/ink/stringWidth.js +209 -0
  466. package/lib/types/ink/styles.d.ts +324 -0
  467. package/lib/types/ink/styles.d.ts.map +1 -0
  468. package/lib/types/ink/styles.js +307 -0
  469. package/lib/types/ink/supports-hyperlinks.d.ts +20 -0
  470. package/lib/types/ink/supports-hyperlinks.d.ts.map +1 -0
  471. package/lib/types/ink/supports-hyperlinks.js +44 -0
  472. package/lib/types/ink/tabstops.d.ts +9 -0
  473. package/lib/types/ink/tabstops.d.ts.map +1 -0
  474. package/lib/types/ink/tabstops.js +46 -0
  475. package/lib/types/ink/terminal-focus-state.d.ts +35 -0
  476. package/lib/types/ink/terminal-focus-state.d.ts.map +1 -0
  477. package/lib/types/ink/terminal-focus-state.js +57 -0
  478. package/lib/types/ink/terminal-querier.d.ts +161 -0
  479. package/lib/types/ink/terminal-querier.d.ts.map +1 -0
  480. package/lib/types/ink/terminal-querier.js +204 -0
  481. package/lib/types/ink/terminal.d.ts +80 -0
  482. package/lib/types/ink/terminal.d.ts.map +1 -0
  483. package/lib/types/ink/terminal.js +268 -0
  484. package/lib/types/ink/termio/ansi.d.ts +75 -0
  485. package/lib/types/ink/termio/ansi.d.ts.map +1 -0
  486. package/lib/types/ink/termio/ansi.js +79 -0
  487. package/lib/types/ink/termio/csi.d.ts +253 -0
  488. package/lib/types/ink/termio/csi.d.ts.map +1 -0
  489. package/lib/types/ink/termio/csi.js +347 -0
  490. package/lib/types/ink/termio/dec.d.ts +61 -0
  491. package/lib/types/ink/termio/dec.d.ts.map +1 -0
  492. package/lib/types/ink/termio/dec.js +76 -0
  493. package/lib/types/ink/termio/esc.d.ts +15 -0
  494. package/lib/types/ink/termio/esc.d.ts.map +1 -0
  495. package/lib/types/ink/termio/esc.js +57 -0
  496. package/lib/types/ink/termio/osc.d.ts +208 -0
  497. package/lib/types/ink/termio/osc.d.ts.map +1 -0
  498. package/lib/types/ink/termio/osc.js +466 -0
  499. package/lib/types/ink/termio/parser.d.ts +46 -0
  500. package/lib/types/ink/termio/parser.d.ts.map +1 -0
  501. package/lib/types/ink/termio/parser.js +366 -0
  502. package/lib/types/ink/termio/sgr.d.ts +17 -0
  503. package/lib/types/ink/termio/sgr.d.ts.map +1 -0
  504. package/lib/types/ink/termio/sgr.js +300 -0
  505. package/lib/types/ink/termio/tokenize.d.ts +50 -0
  506. package/lib/types/ink/termio/tokenize.d.ts.map +1 -0
  507. package/lib/types/ink/termio/tokenize.js +266 -0
  508. package/lib/types/ink/termio/types.d.ts +211 -0
  509. package/lib/types/ink/termio/types.d.ts.map +1 -0
  510. package/lib/types/ink/termio/types.js +68 -0
  511. package/lib/types/ink/termio.d.ts +25 -0
  512. package/lib/types/ink/termio.d.ts.map +1 -0
  513. package/lib/types/ink/termio.js +24 -0
  514. package/lib/types/ink/truncateToWidth.d.ts +7 -0
  515. package/lib/types/ink/truncateToWidth.d.ts.map +1 -0
  516. package/lib/types/ink/truncateToWidth.js +18 -0
  517. package/lib/types/ink/useTerminalNotification.d.ts +45 -0
  518. package/lib/types/ink/useTerminalNotification.d.ts.map +1 -0
  519. package/lib/types/ink/useTerminalNotification.js +70 -0
  520. package/lib/types/ink/warn.d.ts +7 -0
  521. package/lib/types/ink/warn.d.ts.map +1 -0
  522. package/lib/types/ink/warn.js +15 -0
  523. package/lib/types/ink/widest-line.d.ts +7 -0
  524. package/lib/types/ink/widest-line.d.ts.map +1 -0
  525. package/lib/types/ink/widest-line.js +19 -0
  526. package/lib/types/ink/wrap-text.d.ts +10 -0
  527. package/lib/types/ink/wrap-text.d.ts.map +1 -0
  528. package/lib/types/ink/wrap-text.js +61 -0
  529. package/lib/types/ink/wrapAnsi.d.ts +18 -0
  530. package/lib/types/ink/wrapAnsi.d.ts.map +1 -0
  531. package/lib/types/ink/wrapAnsi.js +16 -0
  532. package/lib/types/invariant.d.ts +20 -0
  533. package/lib/types/invariant.d.ts.map +1 -0
  534. package/lib/types/invariant.js +26 -0
  535. package/lib/types/modelPrefs.d.ts +37 -0
  536. package/lib/types/modelPrefs.d.ts.map +1 -0
  537. package/lib/types/modelPrefs.js +66 -0
  538. package/lib/types/modelRoute.d.ts +79 -0
  539. package/lib/types/modelRoute.d.ts.map +1 -0
  540. package/lib/types/modelRoute.js +96 -0
  541. package/lib/types/native-ts/yoga-layout/enums.d.ts +183 -0
  542. package/lib/types/native-ts/yoga-layout/enums.d.ts.map +1 -0
  543. package/lib/types/native-ts/yoga-layout/enums.js +150 -0
  544. package/lib/types/native-ts/yoga-layout/index.d.ts +788 -0
  545. package/lib/types/native-ts/yoga-layout/index.d.ts.map +1 -0
  546. package/lib/types/native-ts/yoga-layout/index.js +2571 -0
  547. package/lib/types/packaged-skills.d.ts +10 -0
  548. package/lib/types/packaged-skills.d.ts.map +1 -0
  549. package/lib/types/packaged-skills.js +63 -0
  550. package/lib/types/plugin.d.ts +33 -0
  551. package/lib/types/plugin.d.ts.map +1 -0
  552. package/lib/types/plugin.js +454 -0
  553. package/lib/types/presetPrefs.d.ts +29 -0
  554. package/lib/types/presetPrefs.d.ts.map +1 -0
  555. package/lib/types/presetPrefs.js +61 -0
  556. package/lib/types/presets.d.ts +110 -0
  557. package/lib/types/presets.d.ts.map +1 -0
  558. package/lib/types/presets.js +114 -0
  559. package/lib/types/questions.d.ts +97 -0
  560. package/lib/types/questions.d.ts.map +1 -0
  561. package/lib/types/questions.js +201 -0
  562. package/lib/types/screens/Chat.d.ts +23 -0
  563. package/lib/types/screens/Chat.d.ts.map +1 -0
  564. package/lib/types/screens/Chat.js +1263 -0
  565. package/lib/types/screens/StatusLine.d.ts +16 -0
  566. package/lib/types/screens/StatusLine.d.ts.map +1 -0
  567. package/lib/types/screens/StatusLine.js +105 -0
  568. package/lib/types/screens/StatusMetrics.d.ts +87 -0
  569. package/lib/types/screens/StatusMetrics.d.ts.map +1 -0
  570. package/lib/types/screens/StatusMetrics.js +252 -0
  571. package/lib/types/sessionHistory.d.ts +32 -0
  572. package/lib/types/sessionHistory.d.ts.map +1 -0
  573. package/lib/types/sessionHistory.js +87 -0
  574. package/lib/types/theme.d.ts +115 -0
  575. package/lib/types/theme.d.ts.map +1 -0
  576. package/lib/types/theme.js +300 -0
  577. package/lib/types/themePrefs.d.ts +28 -0
  578. package/lib/types/themePrefs.d.ts.map +1 -0
  579. package/lib/types/themePrefs.js +59 -0
  580. package/lib/types/ui.d.ts +28 -0
  581. package/lib/types/ui.d.ts.map +1 -0
  582. package/lib/types/ui.js +25 -0
  583. package/lib/types/update.d.ts +76 -0
  584. package/lib/types/update.d.ts.map +1 -0
  585. package/lib/types/update.js +203 -0
  586. package/lib/types/utils/clipboard.d.ts +43 -0
  587. package/lib/types/utils/clipboard.d.ts.map +1 -0
  588. package/lib/types/utils/clipboard.js +82 -0
  589. package/lib/types/utils/debug.d.ts +8 -0
  590. package/lib/types/utils/debug.d.ts.map +1 -0
  591. package/lib/types/utils/debug.js +12 -0
  592. package/lib/types/utils/earlyInput.d.ts +7 -0
  593. package/lib/types/utils/earlyInput.d.ts.map +1 -0
  594. package/lib/types/utils/earlyInput.js +6 -0
  595. package/lib/types/utils/env.d.ts +10 -0
  596. package/lib/types/utils/env.d.ts.map +1 -0
  597. package/lib/types/utils/env.js +9 -0
  598. package/lib/types/utils/envUtils.d.ts +8 -0
  599. package/lib/types/utils/envUtils.d.ts.map +1 -0
  600. package/lib/types/utils/envUtils.js +13 -0
  601. package/lib/types/utils/execFileNoThrow.d.ts +34 -0
  602. package/lib/types/utils/execFileNoThrow.d.ts.map +1 -0
  603. package/lib/types/utils/execFileNoThrow.js +31 -0
  604. package/lib/types/utils/fullscreen.d.ts +8 -0
  605. package/lib/types/utils/fullscreen.d.ts.map +1 -0
  606. package/lib/types/utils/fullscreen.js +10 -0
  607. package/lib/types/utils/intl.d.ts +7 -0
  608. package/lib/types/utils/intl.d.ts.map +1 -0
  609. package/lib/types/utils/intl.js +9 -0
  610. package/lib/types/utils/loaded-context.d.ts +20 -0
  611. package/lib/types/utils/loaded-context.d.ts.map +1 -0
  612. package/lib/types/utils/loaded-context.js +36 -0
  613. package/lib/types/utils/log.d.ts +7 -0
  614. package/lib/types/utils/log.d.ts.map +1 -0
  615. package/lib/types/utils/log.js +9 -0
  616. package/lib/types/utils/mentions.d.ts +30 -0
  617. package/lib/types/utils/mentions.d.ts.map +1 -0
  618. package/lib/types/utils/mentions.js +72 -0
  619. package/lib/types/utils/narration.d.ts +11 -0
  620. package/lib/types/utils/narration.d.ts.map +1 -0
  621. package/lib/types/utils/narration.js +16 -0
  622. package/lib/types/utils/semver.d.ts +9 -0
  623. package/lib/types/utils/semver.d.ts.map +1 -0
  624. package/lib/types/utils/semver.js +24 -0
  625. package/lib/types/utils/sliceAnsi.d.ts +12 -0
  626. package/lib/types/utils/sliceAnsi.d.ts.map +1 -0
  627. package/lib/types/utils/sliceAnsi.js +79 -0
  628. package/lib/types/working-activity.d.ts +19 -0
  629. package/lib/types/working-activity.d.ts.map +1 -0
  630. package/lib/types/working-activity.js +18 -0
  631. package/package.json +141 -0
  632. package/skills/audit/SKILL.md +24 -0
  633. package/skills/bug/SKILL.md +27 -0
  634. package/skills/pr-comments/SKILL.md +20 -0
  635. package/skills/practice/SKILL.md +22 -0
  636. package/skills/release-notes/SKILL.md +25 -0
  637. package/skills/review/SKILL.md +25 -0
  638. package/skills/vuln-check/SKILL.md +25 -0
@@ -0,0 +1,707 @@
1
+ /**
2
+ * Keyboard input parser - converts terminal input to key events
3
+ *
4
+ * Uses the termio tokenizer for escape sequence boundary detection,
5
+ * then interprets sequences as keypresses.
6
+ */
7
+ import { Buffer } from 'buffer';
8
+ import { PASTE_END, PASTE_START } from './termio/csi.js';
9
+ import { createTokenizer } from './termio/tokenize.js';
10
+ // eslint-disable-next-line no-control-regex
11
+ const META_KEY_CODE_RE = /^(?:\x1b)([a-zA-Z0-9])$/;
12
+ // eslint-disable-next-line no-control-regex
13
+ const FN_KEY_RE =
14
+ // eslint-disable-next-line no-control-regex
15
+ /^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/;
16
+ // CSI u (kitty keyboard protocol): ESC [ codepoint [; modifier] u
17
+ // Example: ESC[13;2u = Shift+Enter, ESC[27u = Escape (no modifiers)
18
+ // Modifier is optional - when absent, defaults to 1 (no modifiers)
19
+ // eslint-disable-next-line no-control-regex
20
+ const CSI_U_RE = /^\x1b\[(\d+)(?:;(\d+))?u/;
21
+ // xterm modifyOtherKeys: ESC [ 27 ; modifier ; keycode ~
22
+ // Example: ESC[27;2;13~ = Shift+Enter. Emitted by Ghostty/tmux/xterm when
23
+ // modifyOtherKeys=2 is active or via user keybinds, typically over SSH where
24
+ // TERM sniffing misses Ghostty and we never push Kitty keyboard mode.
25
+ // Note param order is reversed vs CSI u (modifier first, keycode second).
26
+ // eslint-disable-next-line no-control-regex
27
+ const MODIFY_OTHER_KEYS_RE = /^\x1b\[27;(\d+);(\d+)~/;
28
+ // -- Terminal response patterns (inbound sequences from the terminal itself) --
29
+ // DECRPM: CSI ? Ps ; Pm $ y — response to DECRQM (request mode)
30
+ // eslint-disable-next-line no-control-regex
31
+ const DECRPM_RE = /^\x1b\[\?(\d+);(\d+)\$y$/;
32
+ // DA1: CSI ? Ps ; ... c — primary device attributes response
33
+ // eslint-disable-next-line no-control-regex
34
+ const DA1_RE = /^\x1b\[\?([\d;]*)c$/;
35
+ // DA2: CSI > Ps ; ... c — secondary device attributes response
36
+ // eslint-disable-next-line no-control-regex
37
+ const DA2_RE = /^\x1b\[>([\d;]*)c$/;
38
+ // Kitty keyboard flags: CSI ? flags u — response to CSI ? u query
39
+ // (private ? marker distinguishes from CSI u key events)
40
+ // eslint-disable-next-line no-control-regex
41
+ const KITTY_FLAGS_RE = /^\x1b\[\?(\d+)u$/;
42
+ // DECXCPR cursor position: CSI ? row ; col R
43
+ // The ? marker disambiguates from modified F3 keys (Shift+F3 = CSI 1;2 R,
44
+ // Ctrl+F3 = CSI 1;5 R, etc.) — plain CSI row;col R is genuinely ambiguous.
45
+ // eslint-disable-next-line no-control-regex
46
+ const CURSOR_POSITION_RE = /^\x1b\[\?(\d+);(\d+)R$/;
47
+ // OSC response: OSC code ; data (BEL|ST)
48
+ // eslint-disable-next-line no-control-regex
49
+ const OSC_RESPONSE_RE = /^\x1b\](\d+);(.*?)(?:\x07|\x1b\\)$/s;
50
+ // XTVERSION: DCS > | name ST — terminal name/version string (answer to CSI > 0 q).
51
+ // xterm.js replies "xterm.js(X.Y.Z)"; Ghostty, kitty, iTerm2, etc. reply with
52
+ // their own name. Unlike TERM_PROGRAM, this survives SSH since the query/reply
53
+ // goes through the pty, not the environment.
54
+ // eslint-disable-next-line no-control-regex
55
+ const XTVERSION_RE = /^\x1bP>\|(.*?)(?:\x07|\x1b\\)$/s;
56
+ // SGR mouse event: CSI < button ; col ; row M (press) or m (release)
57
+ // Button codes: 64=wheel-up, 65=wheel-down (0x40 | wheel-bit).
58
+ // Button 32=left-drag (0x20 | motion-bit). Plain 0/1/2 = left/mid/right click.
59
+ // eslint-disable-next-line no-control-regex
60
+ const SGR_MOUSE_RE = /^\x1b\[<(\d+);(\d+);(\d+)([Mm])$/;
61
+ function createPasteKey(content) {
62
+ return {
63
+ kind: 'key',
64
+ name: '',
65
+ fn: false,
66
+ ctrl: false,
67
+ meta: false,
68
+ shift: false,
69
+ option: false,
70
+ super: false,
71
+ sequence: content,
72
+ raw: content,
73
+ isPasted: true,
74
+ };
75
+ }
76
+ /** DECRPM status values (response to DECRQM) */
77
+ export const DECRPM_STATUS = {
78
+ NOT_RECOGNIZED: 0,
79
+ SET: 1,
80
+ RESET: 2,
81
+ PERMANENTLY_SET: 3,
82
+ PERMANENTLY_RESET: 4,
83
+ };
84
+ /**
85
+ * Try to recognize a sequence token as a terminal response.
86
+ * Returns null if the sequence is not a known response pattern
87
+ * (i.e. it should be treated as a keypress).
88
+ *
89
+ * These patterns are syntactically distinguishable from keyboard input —
90
+ * no physical key produces CSI ? ... c or CSI ? ... $ y, so they can be
91
+ * safely parsed out of the input stream at any time.
92
+ */
93
+ function parseTerminalResponse(s) {
94
+ // CSI-prefixed responses
95
+ if (s.startsWith('\x1b[')) {
96
+ let m;
97
+ if ((m = DECRPM_RE.exec(s))) {
98
+ return {
99
+ type: 'decrpm',
100
+ mode: parseInt(m[1], 10),
101
+ status: parseInt(m[2], 10),
102
+ };
103
+ }
104
+ if ((m = DA1_RE.exec(s))) {
105
+ return { type: 'da1', params: splitNumericParams(m[1]) };
106
+ }
107
+ if ((m = DA2_RE.exec(s))) {
108
+ return { type: 'da2', params: splitNumericParams(m[1]) };
109
+ }
110
+ if ((m = KITTY_FLAGS_RE.exec(s))) {
111
+ return { type: 'kittyKeyboard', flags: parseInt(m[1], 10) };
112
+ }
113
+ if ((m = CURSOR_POSITION_RE.exec(s))) {
114
+ return {
115
+ type: 'cursorPosition',
116
+ row: parseInt(m[1], 10),
117
+ col: parseInt(m[2], 10),
118
+ };
119
+ }
120
+ return null;
121
+ }
122
+ // OSC responses (e.g. OSC 11 ; rgb:... for bg color query)
123
+ if (s.startsWith('\x1b]')) {
124
+ const m = OSC_RESPONSE_RE.exec(s);
125
+ if (m) {
126
+ return { type: 'osc', code: parseInt(m[1], 10), data: m[2] };
127
+ }
128
+ }
129
+ // DCS responses (e.g. XTVERSION: DCS > | name ST)
130
+ if (s.startsWith('\x1bP')) {
131
+ const m = XTVERSION_RE.exec(s);
132
+ if (m) {
133
+ return { type: 'xtversion', name: m[1] };
134
+ }
135
+ }
136
+ return null;
137
+ }
138
+ function splitNumericParams(params) {
139
+ if (!params)
140
+ return [];
141
+ return params.split(';').map(p => parseInt(p, 10));
142
+ }
143
+ /** Initial `KeyParseState` for a fresh parser. */
144
+ export const INITIAL_STATE = {
145
+ mode: 'NORMAL',
146
+ incomplete: '',
147
+ pasteBuffer: '',
148
+ };
149
+ function inputToString(input) {
150
+ if (Buffer.isBuffer(input)) {
151
+ if (input[0] > 127 && input[1] === undefined) {
152
+ ;
153
+ input[0] -= 128;
154
+ return '\x1b' + String(input);
155
+ }
156
+ else {
157
+ return String(input);
158
+ }
159
+ }
160
+ else if (input !== undefined && typeof input !== 'string') {
161
+ return String(input);
162
+ }
163
+ else if (!input) {
164
+ return '';
165
+ }
166
+ else {
167
+ return input;
168
+ }
169
+ }
170
+ /**
171
+ * Tokenize and parse a chunk of terminal input into parsed keys, mouse
172
+ * events, and terminal responses, maintaining paste-mode state.
173
+ * @param prevState - the state returned by the previous call, or INITIAL_STATE.
174
+ * @param input - the input chunk; null flushes the tokenizer's pending input.
175
+ * @returns the parsed inputs plus the state to pass to the next call.
176
+ */
177
+ export function parseMultipleKeypresses(prevState, input = '') {
178
+ const isFlush = input === null;
179
+ const inputString = isFlush ? '' : inputToString(input);
180
+ // Get or create tokenizer
181
+ const tokenizer = prevState._tokenizer ?? createTokenizer({ x10Mouse: true });
182
+ // Tokenize the input
183
+ const tokens = isFlush ? tokenizer.flush() : tokenizer.feed(inputString);
184
+ // Convert tokens to parsed keys, handling paste mode
185
+ const keys = [];
186
+ let inPaste = prevState.mode === 'IN_PASTE';
187
+ let pasteBuffer = prevState.pasteBuffer;
188
+ for (const token of tokens) {
189
+ if (token.type === 'sequence') {
190
+ if (token.value === PASTE_START) {
191
+ inPaste = true;
192
+ pasteBuffer = '';
193
+ }
194
+ else if (token.value === PASTE_END) {
195
+ // Always emit a paste key, even for empty pastes. This allows
196
+ // downstream handlers to detect empty pastes (e.g., for clipboard
197
+ // image handling on macOS). The paste content may be empty string.
198
+ keys.push(createPasteKey(pasteBuffer));
199
+ inPaste = false;
200
+ pasteBuffer = '';
201
+ }
202
+ else if (inPaste) {
203
+ // Sequences inside paste are treated as literal text
204
+ pasteBuffer += token.value;
205
+ }
206
+ else {
207
+ const response = parseTerminalResponse(token.value);
208
+ if (response) {
209
+ keys.push({ kind: 'response', sequence: token.value, response });
210
+ }
211
+ else {
212
+ const mouse = parseMouseEvent(token.value);
213
+ if (mouse) {
214
+ keys.push(mouse);
215
+ }
216
+ else {
217
+ keys.push(parseKeypress(token.value));
218
+ }
219
+ }
220
+ }
221
+ }
222
+ else if (token.type === 'text') {
223
+ if (inPaste) {
224
+ pasteBuffer += token.value;
225
+ }
226
+ else if (/^\[<\d+;\d+;\d+[Mm]$/.test(token.value) ||
227
+ /^\[M[\x60-\x7f][\x20-\uffff]{2}$/.test(token.value)) {
228
+ // Orphaned SGR/X10 mouse tail (fullscreen only — mouse tracking is off
229
+ // otherwise). A heavy render blocked the event loop past App's 50ms
230
+ // flush timer, so the buffered ESC was flushed as a lone Escape and
231
+ // the continuation `[<btn;col;rowM` arrived as text. Re-synthesize
232
+ // with the ESC prefix so the scroll event still fires instead of
233
+ // leaking into the prompt. The spurious Escape is gone; App.tsx's
234
+ // readableLength check prevents it. The X10 Cb slot is narrowed to
235
+ // the wheel range [\x60-\x7f] (0x40|modifiers + 32) — a full [\x20-]
236
+ // range would match typed input like `[MAX]` batched into one read
237
+ // and silently drop it as a phantom click. Click/drag orphans leak
238
+ // as visible garbage instead; deletable garbage beats silent loss.
239
+ const resynthesized = '\x1b' + token.value;
240
+ const mouse = parseMouseEvent(resynthesized);
241
+ keys.push(mouse ?? parseKeypress(resynthesized));
242
+ }
243
+ else {
244
+ keys.push(parseKeypress(token.value));
245
+ }
246
+ }
247
+ }
248
+ // If flushing and still in paste mode, emit what we have
249
+ if (isFlush && inPaste && pasteBuffer) {
250
+ keys.push(createPasteKey(pasteBuffer));
251
+ inPaste = false;
252
+ pasteBuffer = '';
253
+ }
254
+ // Build new state
255
+ const newState = {
256
+ mode: inPaste ? 'IN_PASTE' : 'NORMAL',
257
+ incomplete: tokenizer.buffer(),
258
+ pasteBuffer,
259
+ _tokenizer: tokenizer,
260
+ };
261
+ return [keys, newState];
262
+ }
263
+ const keyName = {
264
+ /* xterm/gnome ESC O letter */
265
+ OP: 'f1',
266
+ OQ: 'f2',
267
+ OR: 'f3',
268
+ OS: 'f4',
269
+ /* Application keypad mode (numpad digits 0-9) */
270
+ Op: '0',
271
+ Oq: '1',
272
+ Or: '2',
273
+ Os: '3',
274
+ Ot: '4',
275
+ Ou: '5',
276
+ Ov: '6',
277
+ Ow: '7',
278
+ Ox: '8',
279
+ Oy: '9',
280
+ /* Application keypad mode (numpad operators) */
281
+ Oj: '*',
282
+ Ok: '+',
283
+ Ol: ',',
284
+ Om: '-',
285
+ On: '.',
286
+ Oo: '/',
287
+ OM: 'return',
288
+ /* xterm/rxvt ESC [ number ~ */
289
+ '[11~': 'f1',
290
+ '[12~': 'f2',
291
+ '[13~': 'f3',
292
+ '[14~': 'f4',
293
+ /* from Cygwin and used in libuv */
294
+ '[[A': 'f1',
295
+ '[[B': 'f2',
296
+ '[[C': 'f3',
297
+ '[[D': 'f4',
298
+ '[[E': 'f5',
299
+ /* common */
300
+ '[15~': 'f5',
301
+ '[17~': 'f6',
302
+ '[18~': 'f7',
303
+ '[19~': 'f8',
304
+ '[20~': 'f9',
305
+ '[21~': 'f10',
306
+ '[23~': 'f11',
307
+ '[24~': 'f12',
308
+ /* xterm ESC [ letter */
309
+ '[A': 'up',
310
+ '[B': 'down',
311
+ '[C': 'right',
312
+ '[D': 'left',
313
+ '[E': 'clear',
314
+ '[F': 'end',
315
+ '[H': 'home',
316
+ /* xterm/gnome ESC O letter */
317
+ OA: 'up',
318
+ OB: 'down',
319
+ OC: 'right',
320
+ OD: 'left',
321
+ OE: 'clear',
322
+ OF: 'end',
323
+ OH: 'home',
324
+ /* xterm/rxvt ESC [ number ~ */
325
+ '[1~': 'home',
326
+ '[2~': 'insert',
327
+ '[3~': 'delete',
328
+ '[4~': 'end',
329
+ '[5~': 'pageup',
330
+ '[6~': 'pagedown',
331
+ /* putty */
332
+ '[[5~': 'pageup',
333
+ '[[6~': 'pagedown',
334
+ /* rxvt */
335
+ '[7~': 'home',
336
+ '[8~': 'end',
337
+ /* rxvt keys with modifiers */
338
+ '[a': 'up',
339
+ '[b': 'down',
340
+ '[c': 'right',
341
+ '[d': 'left',
342
+ '[e': 'clear',
343
+ '[2$': 'insert',
344
+ '[3$': 'delete',
345
+ '[5$': 'pageup',
346
+ '[6$': 'pagedown',
347
+ '[7$': 'home',
348
+ '[8$': 'end',
349
+ Oa: 'up',
350
+ Ob: 'down',
351
+ Oc: 'right',
352
+ Od: 'left',
353
+ Oe: 'clear',
354
+ '[2^': 'insert',
355
+ '[3^': 'delete',
356
+ '[5^': 'pageup',
357
+ '[6^': 'pagedown',
358
+ '[7^': 'home',
359
+ '[8^': 'end',
360
+ /* misc. */
361
+ '[Z': 'tab',
362
+ };
363
+ /**
364
+ * Key names that never produce printable input (function keys, navigation,
365
+ * modifiers, mouse), used to filter parsed keypresses.
366
+ */
367
+ export const nonAlphanumericKeys = [
368
+ // Filter out single-character values (digits, operators from numpad) since
369
+ // those are printable characters that should produce input
370
+ ...Object.values(keyName).filter(v => v.length > 1),
371
+ // escape and backspace are assigned directly in parseKeypress (not via the
372
+ // keyName map), so the spread above misses them. Without these, ctrl+escape
373
+ // via Kitty/modifyOtherKeys leaks the literal word "escape" as input text
374
+ // (input-event.ts:58 assigns keypress.name when ctrl is set).
375
+ 'escape',
376
+ 'backspace',
377
+ 'wheelup',
378
+ 'wheeldown',
379
+ 'mouse',
380
+ ];
381
+ const isShiftKey = (code) => {
382
+ return [
383
+ '[a',
384
+ '[b',
385
+ '[c',
386
+ '[d',
387
+ '[e',
388
+ '[2$',
389
+ '[3$',
390
+ '[5$',
391
+ '[6$',
392
+ '[7$',
393
+ '[8$',
394
+ '[Z',
395
+ ].includes(code);
396
+ };
397
+ const isCtrlKey = (code) => {
398
+ return [
399
+ 'Oa',
400
+ 'Ob',
401
+ 'Oc',
402
+ 'Od',
403
+ 'Oe',
404
+ '[2^',
405
+ '[3^',
406
+ '[5^',
407
+ '[6^',
408
+ '[7^',
409
+ '[8^',
410
+ ].includes(code);
411
+ };
412
+ /**
413
+ * Decode XTerm-style modifier value to individual flags.
414
+ * Modifier encoding: 1 + (shift ? 1 : 0) + (alt ? 2 : 0) + (ctrl ? 4 : 0) + (super ? 8 : 0)
415
+ *
416
+ * Note: `meta` here means Alt/Option (bit 2). `super` is a distinct
417
+ * modifier (bit 8, i.e. Cmd on macOS / Win key). Most legacy terminal
418
+ * sequences can't express super — it only arrives via kitty keyboard
419
+ * protocol (CSI u) or xterm modifyOtherKeys.
420
+ */
421
+ function decodeModifier(modifier) {
422
+ const m = modifier - 1;
423
+ return {
424
+ shift: !!(m & 1),
425
+ meta: !!(m & 2),
426
+ ctrl: !!(m & 4),
427
+ super: !!(m & 8),
428
+ };
429
+ }
430
+ /**
431
+ * Map keycode to key name for modifyOtherKeys/CSI u sequences.
432
+ * Handles both ASCII keycodes and Kitty keyboard protocol functional keys.
433
+ *
434
+ * Numpad codepoints are from Unicode Private Use Area, defined at:
435
+ * https://sw.kovidgoyal.net/kitty/keyboard-protocol/#functional-key-definitions
436
+ */
437
+ function keycodeToName(keycode) {
438
+ switch (keycode) {
439
+ case 9:
440
+ return 'tab';
441
+ case 13:
442
+ return 'return';
443
+ case 27:
444
+ return 'escape';
445
+ case 32:
446
+ return 'space';
447
+ case 127:
448
+ return 'backspace';
449
+ // Kitty keyboard protocol numpad keys (KP_0 through KP_9)
450
+ case 57399:
451
+ return '0';
452
+ case 57400:
453
+ return '1';
454
+ case 57401:
455
+ return '2';
456
+ case 57402:
457
+ return '3';
458
+ case 57403:
459
+ return '4';
460
+ case 57404:
461
+ return '5';
462
+ case 57405:
463
+ return '6';
464
+ case 57406:
465
+ return '7';
466
+ case 57407:
467
+ return '8';
468
+ case 57408:
469
+ return '9';
470
+ case 57409: // KP_DECIMAL
471
+ return '.';
472
+ case 57410: // KP_DIVIDE
473
+ return '/';
474
+ case 57411: // KP_MULTIPLY
475
+ return '*';
476
+ case 57412: // KP_SUBTRACT
477
+ return '-';
478
+ case 57413: // KP_ADD
479
+ return '+';
480
+ case 57414: // KP_ENTER
481
+ return 'return';
482
+ case 57415: // KP_EQUAL
483
+ return '=';
484
+ default:
485
+ // Printable ASCII characters
486
+ if (keycode >= 32 && keycode <= 126) {
487
+ return String.fromCharCode(keycode).toLowerCase();
488
+ }
489
+ return undefined;
490
+ }
491
+ }
492
+ /**
493
+ * Parse an SGR mouse event sequence into a ParsedMouse, or null if not a
494
+ * mouse event or if it's a wheel event (wheel stays as ParsedKey for the
495
+ * keybinding system). Button bit 0x40 = wheel, bit 0x20 = drag/motion.
496
+ */
497
+ function parseMouseEvent(s) {
498
+ const match = SGR_MOUSE_RE.exec(s);
499
+ if (!match)
500
+ return null;
501
+ const button = parseInt(match[1], 10);
502
+ // Wheel events (bit 6 set, low bits 0/1 for up/down) stay as ParsedKey
503
+ // so the keybinding system can route them to scroll handlers.
504
+ if ((button & 0x40) !== 0)
505
+ return null;
506
+ return {
507
+ kind: 'mouse',
508
+ button,
509
+ action: match[4] === 'M' ? 'press' : 'release',
510
+ col: parseInt(match[2], 10),
511
+ row: parseInt(match[3], 10),
512
+ sequence: s,
513
+ };
514
+ }
515
+ function parseKeypress(s = '') {
516
+ let parts;
517
+ const key = {
518
+ kind: 'key',
519
+ name: '',
520
+ fn: false,
521
+ ctrl: false,
522
+ meta: false,
523
+ shift: false,
524
+ option: false,
525
+ super: false,
526
+ sequence: s,
527
+ raw: s,
528
+ isPasted: false,
529
+ };
530
+ key.sequence = key.sequence || s || key.name;
531
+ // Handle CSI u (kitty keyboard protocol): ESC [ codepoint [; modifier] u
532
+ // Example: ESC[13;2u = Shift+Enter, ESC[27u = Escape (no modifiers)
533
+ let match;
534
+ if ((match = CSI_U_RE.exec(s))) {
535
+ const codepoint = parseInt(match[1], 10);
536
+ // Modifier defaults to 1 (no modifiers) when not present
537
+ const modifier = match[2] ? parseInt(match[2], 10) : 1;
538
+ const mods = decodeModifier(modifier);
539
+ const name = keycodeToName(codepoint);
540
+ return {
541
+ kind: 'key',
542
+ name,
543
+ fn: false,
544
+ ctrl: mods.ctrl,
545
+ meta: mods.meta,
546
+ shift: mods.shift,
547
+ option: false,
548
+ super: mods.super,
549
+ sequence: s,
550
+ raw: s,
551
+ isPasted: false,
552
+ };
553
+ }
554
+ // Handle xterm modifyOtherKeys: ESC [ 27 ; modifier ; keycode ~
555
+ // Must run before FN_KEY_RE — FN_KEY_RE only allows 2 params before ~ and
556
+ // would leave the tail as garbage if it partially matched.
557
+ if ((match = MODIFY_OTHER_KEYS_RE.exec(s))) {
558
+ const mods = decodeModifier(parseInt(match[1], 10));
559
+ const name = keycodeToName(parseInt(match[2], 10));
560
+ return {
561
+ kind: 'key',
562
+ name,
563
+ fn: false,
564
+ ctrl: mods.ctrl,
565
+ meta: mods.meta,
566
+ shift: mods.shift,
567
+ option: false,
568
+ super: mods.super,
569
+ sequence: s,
570
+ raw: s,
571
+ isPasted: false,
572
+ };
573
+ }
574
+ // SGR mouse wheel events. Click/drag/release events are handled
575
+ // earlier by parseMouseEvent and emitted as ParsedMouse, so they
576
+ // never reach here. Mask with 0x43 (bits 6+1+0) to check wheel-flag
577
+ // + direction while ignoring modifier bits (Shift=0x04, Meta=0x08,
578
+ // Ctrl=0x10) — modified wheel events (e.g. Ctrl+scroll, button=80)
579
+ // should still be recognized as wheelup/wheeldown.
580
+ if ((match = SGR_MOUSE_RE.exec(s))) {
581
+ const button = parseInt(match[1], 10);
582
+ if ((button & 0x43) === 0x40)
583
+ return createNavKey(s, 'wheelup', false);
584
+ if ((button & 0x43) === 0x41)
585
+ return createNavKey(s, 'wheeldown', false);
586
+ // Shouldn't reach here (parseMouseEvent catches non-wheel) but be safe
587
+ return createNavKey(s, 'mouse', false);
588
+ }
589
+ // X10 mouse: CSI M + 3 raw bytes (Cb+32, Cx+32, Cy+32). Terminals that
590
+ // ignore DECSET 1006 (SGR) but honor 1000/1002 emit this legacy encoding.
591
+ // Button bits match SGR: 0x40 = wheel, low bit = direction. Non-wheel
592
+ // X10 events (clicks/drags) are swallowed here — we only enable mouse
593
+ // tracking in alt-screen and only need wheel for ScrollBox.
594
+ if (s.length === 6 && s.startsWith('\x1b[M')) {
595
+ const button = s.charCodeAt(3) - 32;
596
+ if ((button & 0x43) === 0x40)
597
+ return createNavKey(s, 'wheelup', false);
598
+ if ((button & 0x43) === 0x41)
599
+ return createNavKey(s, 'wheeldown', false);
600
+ return createNavKey(s, 'mouse', false);
601
+ }
602
+ if (s === '\r') {
603
+ key.raw = undefined;
604
+ key.name = 'return';
605
+ }
606
+ else if (s === '\n') {
607
+ key.name = 'enter';
608
+ }
609
+ else if (s === '\t') {
610
+ key.name = 'tab';
611
+ }
612
+ else if (s === '\b' || s === '\x1b\b') {
613
+ key.name = 'backspace';
614
+ key.meta = s.charAt(0) === '\x1b';
615
+ }
616
+ else if (s === '\x7f' || s === '\x1b\x7f') {
617
+ key.name = 'backspace';
618
+ key.meta = s.charAt(0) === '\x1b';
619
+ }
620
+ else if (s === '\x1b' || s === '\x1b\x1b') {
621
+ key.name = 'escape';
622
+ key.meta = s.length === 2;
623
+ }
624
+ else if (s === ' ' || s === '\x1b ') {
625
+ key.name = 'space';
626
+ key.meta = s.length === 2;
627
+ }
628
+ else if (s === '\x1f') {
629
+ key.name = '_';
630
+ key.ctrl = true;
631
+ }
632
+ else if (s <= '\x1a' && s.length === 1) {
633
+ key.name = String.fromCharCode(s.charCodeAt(0) + 'a'.charCodeAt(0) - 1);
634
+ key.ctrl = true;
635
+ }
636
+ else if (s.length === 1 && s >= '0' && s <= '9') {
637
+ key.name = 'number';
638
+ }
639
+ else if (s.length === 1 && s >= 'a' && s <= 'z') {
640
+ key.name = s;
641
+ }
642
+ else if (s.length === 1 && s >= 'A' && s <= 'Z') {
643
+ key.name = s.toLowerCase();
644
+ key.shift = true;
645
+ }
646
+ else if ((parts = META_KEY_CODE_RE.exec(s))) {
647
+ key.meta = true;
648
+ key.shift = /^[A-Z]$/.test(parts[1]);
649
+ }
650
+ else if ((parts = FN_KEY_RE.exec(s))) {
651
+ const segs = [...s];
652
+ if (segs[0] === '\u001b' && segs[1] === '\u001b') {
653
+ key.option = true;
654
+ }
655
+ const code = [parts[1], parts[2], parts[4], parts[6]]
656
+ .filter(Boolean)
657
+ .join('');
658
+ const modifier = (parts[3] || parts[5] || 1) - 1;
659
+ key.ctrl = !!(modifier & 4);
660
+ key.meta = !!(modifier & 2);
661
+ key.super = !!(modifier & 8);
662
+ key.shift = !!(modifier & 1);
663
+ key.code = code;
664
+ key.name = keyName[code];
665
+ key.shift = isShiftKey(code) || key.shift;
666
+ key.ctrl = isCtrlKey(code) || key.ctrl;
667
+ }
668
+ // iTerm in natural text editing mode
669
+ if (key.raw === '\x1Bb') {
670
+ key.meta = true;
671
+ key.name = 'left';
672
+ }
673
+ else if (key.raw === '\x1Bf') {
674
+ key.meta = true;
675
+ key.name = 'right';
676
+ }
677
+ switch (s) {
678
+ case '\u001b[1~':
679
+ return createNavKey(s, 'home', false);
680
+ case '\u001b[4~':
681
+ return createNavKey(s, 'end', false);
682
+ case '\u001b[5~':
683
+ return createNavKey(s, 'pageup', false);
684
+ case '\u001b[6~':
685
+ return createNavKey(s, 'pagedown', false);
686
+ case '\u001b[1;5D':
687
+ return createNavKey(s, 'left', true);
688
+ case '\u001b[1;5C':
689
+ return createNavKey(s, 'right', true);
690
+ }
691
+ return key;
692
+ }
693
+ function createNavKey(s, name, ctrl) {
694
+ return {
695
+ kind: 'key',
696
+ name,
697
+ ctrl,
698
+ meta: false,
699
+ shift: false,
700
+ option: false,
701
+ super: false,
702
+ fn: false,
703
+ sequence: s,
704
+ raw: s,
705
+ isPasted: false,
706
+ };
707
+ }