@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,30 @@
1
+ /**
2
+ * `@` file-mention parsing (issue #15).
3
+ *
4
+ * A mention is an `@` that starts a whitespace-delimited token (string start
5
+ * or after whitespace) — `hello@world` never triggers. The token body is
6
+ * either a run of non-whitespace characters (`@src/a.ts`) or a double-quoted
7
+ * path (`@"my dir/a.ts"`, for paths containing spaces).
8
+ */
9
+ export interface MentionToken {
10
+ /** Start index of the `@` in the source text. */
11
+ start: number;
12
+ /** End index (exclusive) of the whole token, quote included. */
13
+ end: number;
14
+ /** The referenced path as typed (unquoted, no leading `@`). */
15
+ path: string;
16
+ }
17
+ /** Extract every `@` mention in `text` (typed order, duplicates kept out). */
18
+ export declare function extractMentions(text: string): MentionToken[];
19
+ /**
20
+ * The mention token the caret is currently editing, if any: an `@` token
21
+ * that starts at or before the caret with the caret inside it. Used by the
22
+ * prompt's completion trigger so `@` works mid-message, not only at the
23
+ * start of the input.
24
+ */
25
+ export declare function mentionAtCaret(value: string, cursor: number): {
26
+ start: number;
27
+ end: number;
28
+ query: string;
29
+ } | undefined;
30
+ //# sourceMappingURL=mentions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mentions.d.ts","sourceRoot":"","sources":["../../../src/utils/mentions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,YAAY;IAC3B,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAA;IACb,gEAAgE;IAChE,GAAG,EAAE,MAAM,CAAA;IACX,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAA;CACb;AAMD,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,EAAE,CA8B5D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAe3D"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * `@` file-mention parsing (issue #15).
3
+ *
4
+ * A mention is an `@` that starts a whitespace-delimited token (string start
5
+ * or after whitespace) — `hello@world` never triggers. The token body is
6
+ * either a run of non-whitespace characters (`@src/a.ts`) or a double-quoted
7
+ * path (`@"my dir/a.ts"`, for paths containing spaces).
8
+ */
9
+ /** True when `ch` delimits a token (whitespace). */
10
+ const isBoundary = (ch) => ch === undefined || /\s/.test(ch);
11
+ /** Extract every `@` mention in `text` (typed order, duplicates kept out). */
12
+ export function extractMentions(text) {
13
+ const tokens = [];
14
+ const seen = new Set();
15
+ let index = 0;
16
+ while (index < text.length) {
17
+ const at = text.indexOf('@', index);
18
+ if (at === -1)
19
+ break;
20
+ index = at + 1;
21
+ if (!isBoundary(text[at - 1]))
22
+ continue; // email-style `a@b`, mid-token
23
+ if (text[at + 1] === '"') {
24
+ const close = text.indexOf('"', at + 2);
25
+ if (close === -1)
26
+ continue; // unterminated quote — not a mention
27
+ const path = text.slice(at + 2, close);
28
+ if (path && !seen.has(path)) {
29
+ seen.add(path);
30
+ tokens.push({ start: at, end: close + 1, path });
31
+ }
32
+ index = close + 1;
33
+ continue;
34
+ }
35
+ let end = at + 1;
36
+ while (end < text.length && !isBoundary(text[end]))
37
+ end++;
38
+ const path = text.slice(at + 1, end);
39
+ // A bare `@` or another trigger char (`@@`) carries no path.
40
+ if (path && !path.startsWith('@') && !seen.has(path)) {
41
+ seen.add(path);
42
+ tokens.push({ start: at, end, path });
43
+ }
44
+ }
45
+ return tokens;
46
+ }
47
+ /**
48
+ * The mention token the caret is currently editing, if any: an `@` token
49
+ * that starts at or before the caret with the caret inside it. Used by the
50
+ * prompt's completion trigger so `@` works mid-message, not only at the
51
+ * start of the input.
52
+ */
53
+ export function mentionAtCaret(value, cursor) {
54
+ // Token start: scan back from the caret to the previous boundary.
55
+ let start = cursor;
56
+ while (start > 0 && !isBoundary(value[start - 1]))
57
+ start--;
58
+ if (value[start] !== '@')
59
+ return undefined;
60
+ // Quoted form: the caret must sit before the closing quote.
61
+ if (value[start + 1] === '"') {
62
+ const close = value.indexOf('"', start + 2);
63
+ if (close !== -1 && cursor > close)
64
+ return undefined;
65
+ return { start, end: close === -1 ? value.length : close + 1, query: value.slice(start + 2, cursor) };
66
+ }
67
+ // Token end: first boundary at/after the caret.
68
+ let end = cursor;
69
+ while (end < value.length && !isBoundary(value[end]))
70
+ end++;
71
+ return { start, end, query: value.slice(start + 1, cursor) };
72
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Strip the `⏵` self-narration line from assistant text. The
3
+ * dsh-working-activity narrate contract puts exactly one `⏵` line at the
4
+ * very top of a reply; the live working line already surfaces it, so
5
+ * showing it again in the transcript would double it. Only the FIRST line
6
+ * is checked — the contract allows one `⏵` line per reply.
7
+ * @param text - Assistant text to strip.
8
+ * @returns The text without its leading `⏵` narration line.
9
+ */
10
+ export declare function stripNarration(text: string): string;
11
+ //# sourceMappingURL=narration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"narration.d.ts","sourceRoot":"","sources":["../../../src/utils/narration.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKnD"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Strip the `⏵` self-narration line from assistant text. The
3
+ * dsh-working-activity narrate contract puts exactly one `⏵` line at the
4
+ * very top of a reply; the live working line already surfaces it, so
5
+ * showing it again in the transcript would double it. Only the FIRST line
6
+ * is checked — the contract allows one `⏵` line per reply.
7
+ * @param text - Assistant text to strip.
8
+ * @returns The text without its leading `⏵` narration line.
9
+ */
10
+ export function stripNarration(text) {
11
+ const newline = text.indexOf('\n');
12
+ const firstLine = newline === -1 ? text : text.slice(0, newline);
13
+ if (!firstLine.trimStart().startsWith('⏵'))
14
+ return text;
15
+ return newline === -1 ? '' : text.slice(newline + 1).replace(/^\n+/, '');
16
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Minimal semver `>=` comparison for the ported Ink core (ink/terminal.ts
3
+ * gates hyperlink support on TERM_PROGRAM_VERSION).
4
+ * @param a - First version string (optional `v` prefix and pre-release suffix tolerated).
5
+ * @param b - Second version string.
6
+ * @returns True when `a` is greater than or equal to `b`.
7
+ */
8
+ export declare function gte(a: string, b: string): boolean;
9
+ //# sourceMappingURL=semver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semver.d.ts","sourceRoot":"","sources":["../../../src/utils/semver.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAOjD"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Minimal semver `>=` comparison for the ported Ink core (ink/terminal.ts
3
+ * gates hyperlink support on TERM_PROGRAM_VERSION).
4
+ * @param a - First version string (optional `v` prefix and pre-release suffix tolerated).
5
+ * @param b - Second version string.
6
+ * @returns True when `a` is greater than or equal to `b`.
7
+ */
8
+ export function gte(a, b) {
9
+ const pa = parts(a);
10
+ const pb = parts(b);
11
+ for (let i = 0; i < 3; i += 1) {
12
+ if (pa[i] !== pb[i])
13
+ return pa[i] > pb[i];
14
+ }
15
+ return true;
16
+ }
17
+ function parts(version) {
18
+ const [major = 0, minor = 0, patch = 0] = version
19
+ .replace(/^v/, '')
20
+ .split('-')[0]
21
+ .split('.')
22
+ .map(part => Number.parseInt(part, 10) || 0);
23
+ return [major, minor, patch];
24
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Slice a string containing ANSI escape codes.
3
+ *
4
+ * Unlike the slice-ansi package, this properly handles OSC 8 hyperlink
5
+ * sequences because @alcalzone/ansi-tokenize tokenizes them correctly.
6
+ * @param str - The ANSI string to slice.
7
+ * @param start - Start offset in display cells.
8
+ * @param end - End offset in display cells; defaults to the end of `str`.
9
+ * @returns The sliced string with its ANSI styling preserved.
10
+ */
11
+ export default function sliceAnsi(str: string, start: number, end?: number): string;
12
+ //# sourceMappingURL=sliceAnsi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sliceAnsi.d.ts","sourceRoot":"","sources":["../../../src/utils/sliceAnsi.ts"],"names":[],"mappings":"AAmBA;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,GAAG,CAAC,EAAE,MAAM,GACX,MAAM,CA8DR"}
@@ -0,0 +1,79 @@
1
+ import { ansiCodesToString, reduceAnsiCodes, tokenize, undoAnsiCodes, } from '@alcalzone/ansi-tokenize';
2
+ import { stringWidth } from '../ink/stringWidth.js';
3
+ // A code is an "end code" if its code equals its endCode (e.g., hyperlink close)
4
+ function isEndCode(code) {
5
+ return code.code === code.endCode;
6
+ }
7
+ // Filter to only include "start codes" (not end codes)
8
+ function filterStartCodes(codes) {
9
+ return codes.filter(c => !isEndCode(c));
10
+ }
11
+ /**
12
+ * Slice a string containing ANSI escape codes.
13
+ *
14
+ * Unlike the slice-ansi package, this properly handles OSC 8 hyperlink
15
+ * sequences because @alcalzone/ansi-tokenize tokenizes them correctly.
16
+ * @param str - The ANSI string to slice.
17
+ * @param start - Start offset in display cells.
18
+ * @param end - End offset in display cells; defaults to the end of `str`.
19
+ * @returns The sliced string with its ANSI styling preserved.
20
+ */
21
+ export default function sliceAnsi(str, start, end) {
22
+ // Don't pass `end` to tokenize — it counts code units, not display cells,
23
+ // so it drops tokens early for text with zero-width combining marks.
24
+ const tokens = tokenize(str);
25
+ let activeCodes = [];
26
+ let position = 0;
27
+ let result = '';
28
+ let include = false;
29
+ for (const token of tokens) {
30
+ // Advance by display width, not code units. Combining marks (Devanagari
31
+ // matras, virama, diacritics) are width 0 — counting them via .length
32
+ // advanced position past `end` early and truncated the slice. Callers
33
+ // pass start/end in display cells (via stringWidth), so position must
34
+ // track the same units.
35
+ const width = token.type === 'ansi' || token.type === 'control' ? 0 : token.fullWidth ? 2 : stringWidth(token.value);
36
+ // Break AFTER trailing zero-width marks — a combining mark attaches to
37
+ // the preceding base char, so "भा" (भ + ा, 1 display cell) sliced at
38
+ // end=1 must include the ा. Breaking on position >= end BEFORE the
39
+ // zero-width check would drop it and render भ bare. ANSI codes are
40
+ // width 0 but must NOT be included past end (they open new style runs
41
+ // that leak into the undo sequence), so gate on char type too. The
42
+ // !include guard ensures empty slices (start===end) stay empty even
43
+ // when the string starts with a zero-width char (BOM, ZWJ).
44
+ if (end !== undefined && position >= end) {
45
+ if (token.type === 'ansi' || width > 0 || !include)
46
+ break;
47
+ }
48
+ if (token.type === 'ansi') {
49
+ activeCodes.push(token);
50
+ if (include) {
51
+ // Emit all ANSI codes during the slice
52
+ result += token.code;
53
+ }
54
+ }
55
+ else {
56
+ if (!include && position >= start) {
57
+ // Skip leading zero-width marks at the start boundary — they belong
58
+ // to the preceding base char in the left half. Without this, the
59
+ // mark appears in BOTH halves: left+right ≠ original. Only applies
60
+ // when start > 0 (otherwise there's no preceding char to own it).
61
+ if (start > 0 && width === 0)
62
+ continue;
63
+ include = true;
64
+ // Reduce and filter to only active start codes
65
+ activeCodes = filterStartCodes(reduceAnsiCodes(activeCodes));
66
+ result = ansiCodesToString(activeCodes);
67
+ }
68
+ if (include) {
69
+ // Control codes carry `code` (not `value`); keep them byte-for-byte.
70
+ result += token.type === 'control' ? token.code : token.value;
71
+ }
72
+ position += width;
73
+ }
74
+ }
75
+ // Only undo start codes that are still active
76
+ const activeStartCodes = filterStartCodes(reduceAnsiCodes(activeCodes));
77
+ result += ansiCodesToString(undoAnsiCodes(activeStartCodes));
78
+ return result;
79
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Re-export of the `dsh-working-activity` plugin under this package's own
3
+ * name, so the bundle patch layer can mount the working-activity row as
4
+ * `@deepseek-harness-tui/dsh-tui/working-activity` instead of the bare package name.
5
+ *
6
+ * The dsh Loader resolves row names from the *profile* directory
7
+ * (`~/.dsh/profiles/<name>/`): only the profile's direct dependencies are
8
+ * linked into its node_modules. npm's flat layout also hoists transitive
9
+ * dependencies there, but pnpm's isolated layout never does — so the bare
10
+ * `dsh-working-activity` name (a transitive dependency of @deepseek-harness-tui/dsh-tui) fails
11
+ * with ERR_MODULE_NOT_FOUND at boot and the loader disposes the whole app,
12
+ * exiting the TUI before any UI appears (issue #60). Mounting through this
13
+ * subpath keeps resolution anchored at @deepseek-harness-tui/dsh-tui itself — always a direct
14
+ * profile dependency — and from its real location `dsh-working-activity`
15
+ * resolves under every package-manager layout.
16
+ * @module @deepseek-harness-tui/dsh-tui/working-activity
17
+ */
18
+ export * from 'dsh-working-activity';
19
+ //# sourceMappingURL=working-activity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"working-activity.d.ts","sourceRoot":"","sources":["../../src/working-activity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,cAAc,sBAAsB,CAAA"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Re-export of the `dsh-working-activity` plugin under this package's own
3
+ * name, so the bundle patch layer can mount the working-activity row as
4
+ * `@deepseek-harness-tui/dsh-tui/working-activity` instead of the bare package name.
5
+ *
6
+ * The dsh Loader resolves row names from the *profile* directory
7
+ * (`~/.dsh/profiles/<name>/`): only the profile's direct dependencies are
8
+ * linked into its node_modules. npm's flat layout also hoists transitive
9
+ * dependencies there, but pnpm's isolated layout never does — so the bare
10
+ * `dsh-working-activity` name (a transitive dependency of @deepseek-harness-tui/dsh-tui) fails
11
+ * with ERR_MODULE_NOT_FOUND at boot and the loader disposes the whole app,
12
+ * exiting the TUI before any UI appears (issue #60). Mounting through this
13
+ * subpath keeps resolution anchored at @deepseek-harness-tui/dsh-tui itself — always a direct
14
+ * profile dependency — and from its real location `dsh-working-activity`
15
+ * resolves under every package-manager layout.
16
+ * @module @deepseek-harness-tui/dsh-tui/working-activity
17
+ */
18
+ export * from 'dsh-working-activity';
package/package.json ADDED
@@ -0,0 +1,141 @@
1
+ {
2
+ "name": "@deepseek-harness-tui/dsh-tui",
3
+ "version": "0.5.0",
4
+ "description": "Claude Code style interactive TUI front door for DeepSeek Harness agents, built on the ported Ink core.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/ccch1mneyyy/dsh-TUI.git"
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/ccch1mneyyy/dsh-TUI/issues"
12
+ },
13
+ "homepage": "https://github.com/ccch1mneyyy/dsh-TUI#readme",
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "type": "module",
18
+ "bin": {
19
+ "dsh-tui": "./bin/dsh-tui.js"
20
+ },
21
+ "main": "lib/types/index.js",
22
+ "types": "lib/types/index.d.ts",
23
+ "exports": {
24
+ ".": {
25
+ "types": "./lib/types/index.d.ts",
26
+ "import": "./lib/types/index.js"
27
+ },
28
+ "./working-activity": {
29
+ "types": "./lib/types/working-activity.d.ts",
30
+ "import": "./lib/types/working-activity.js"
31
+ },
32
+ "./invariant": {
33
+ "types": "./lib/types/invariant.d.ts",
34
+ "default": "./lib/invariant.js"
35
+ },
36
+ "./cordis.patch.yml": "./cordis.patch.yml",
37
+ "./package.json": "./package.json",
38
+ "./src/*": "./src/*"
39
+ },
40
+ "files": [
41
+ "bin",
42
+ "lib",
43
+ "cordis.patch.yml",
44
+ "cordis.yml",
45
+ "skills"
46
+ ],
47
+ "engines": {
48
+ "node": "^22.19 || >=24"
49
+ },
50
+ "peerDependencies": {
51
+ "@deepseek-ai/cordis": "^4.0.1",
52
+ "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6"
53
+ },
54
+ "dependencies": {
55
+ "@alcalzone/ansi-tokenize": "^0.3.0",
56
+ "@deepseek-ai/dsh-agent": "^0.1.0-rc.6",
57
+ "@deepseek-ai/dsh-agent-instructions": "^0.1.0-rc.6",
58
+ "@deepseek-ai/dsh-agent-presets": "^0.1.0-rc.6",
59
+ "@deepseek-ai/dsh-agent-tool-presentation": "^0.1.0-rc.6",
60
+ "@deepseek-ai/dsh-commands": "^0.1.0-rc.6",
61
+ "@deepseek-ai/dsh-cordis-host-runner": "^0.1.0-rc.6",
62
+ "@deepseek-ai/dsh-llm": "^0.1.0-rc.6",
63
+ "@deepseek-ai/dsh-persona": "^0.1.0-rc.6",
64
+ "@deepseek-ai/dsh-session": "^0.1.0-rc.6",
65
+ "@deepseek-ai/dsh-skill": "^0.1.0-rc.6",
66
+ "@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.6",
67
+ "@deepseek-ai/dsh-terminal": "^0.1.0-rc.6",
68
+ "@deepseek-ai/dsh-terminal-bash": "^0.1.0-rc.6",
69
+ "@deepseek-ai/dsh-tool-ask-user": "^0.1.0-rc.6",
70
+ "@deepseek-ai/dsh-tool-bash-persistent": "^0.1.0-rc.6",
71
+ "@deepseek-ai/dsh-tool-cordis": "^0.1.0-rc.6",
72
+ "@deepseek-ai/dsh-user-questions": "^0.1.0-rc.6",
73
+ "@deepseek-ai/schemastery": "^3.18.1",
74
+ "auto-bind": "^4.0.0 || ^5.0.0",
75
+ "bidi-js": "^1.0.0",
76
+ "chalk": "^5.0.0",
77
+ "cli-boxes": "^3.0.0 || ^4.0.0",
78
+ "cli-highlight": "^2.1.11",
79
+ "code-excerpt": "^3.0.0 || ^4.0.0",
80
+ "dsh-working-activity": "^0.2.2",
81
+ "emoji-regex": "^10.0.0",
82
+ "figures": "^6.1.0",
83
+ "get-east-asian-width": "^1.0.0",
84
+ "highlight.js": "^11.11.1",
85
+ "indent-string": "^5.0.0",
86
+ "lodash-es": "^4.17.0",
87
+ "marked": "^18.0.7",
88
+ "react": "^19.2.0",
89
+ "react-reconciler": "^0.33.0",
90
+ "semver": "^7.0.0",
91
+ "signal-exit": "^4.0.0",
92
+ "stack-utils": "^2.0.0",
93
+ "strip-ansi": "^7.0.0",
94
+ "supports-hyperlinks": "^3.0.0",
95
+ "type-fest": "^4.0.0",
96
+ "usehooks-ts": "^3.1.0",
97
+ "wrap-ansi": "^8.0.0 || ^9.0.0"
98
+ },
99
+ "devDependencies": {
100
+ "@deepseek-ai/cordis": "^4.0.1",
101
+ "@deepseek-ai/cordis-plugin-include": "^1.0.6",
102
+ "@deepseek-ai/cordis-plugin-loader": "^1.0.2",
103
+ "@deepseek-ai/dsh-atomic-write": "^0.1.0-rc.6",
104
+ "@deepseek-ai/dsh-attachment": "^0.1.0-rc.6",
105
+ "@deepseek-ai/dsh-brand": "^0.1.0-rc.6",
106
+ "@deepseek-ai/dsh-code-runtime": "^0.1.0-rc.6",
107
+ "@deepseek-ai/dsh-fs": "^0.1.0-rc.6",
108
+ "@deepseek-ai/dsh-home-paths": "^0.1.0-rc.6",
109
+ "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
110
+ "@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.0-rc.6",
111
+ "@deepseek-ai/dsh-session-persistence-sqlite": "^0.1.0-rc.6",
112
+ "@deepseek-ai/dsh-sandbox": "^0.1.0-rc.6",
113
+ "@deepseek-ai/dsh-sandbox-policy": "^0.1.0-rc.6",
114
+ "@deepseek-ai/dsh-scope": "^0.1.0-rc.6",
115
+ "@deepseek-ai/dsh-session-persistence": "^0.1.0-rc.6",
116
+ "@deepseek-ai/dsh-settings": "^0.1.0-rc.6",
117
+ "@deepseek-ai/dsh-subprocess": "^0.1.0-rc.6",
118
+ "@deepseek-ai/dsh-timeout": "^0.1.0-rc.6",
119
+ "@deepseek-ai/dsh-tools": "^0.1.0-rc.6",
120
+ "@deepseek-ai/dsh-typert-protocol": "^0.1.0-rc.6",
121
+ "@deepseek-ai/dsh-user-approval": "^0.1.0-rc.6",
122
+ "@types/lodash-es": "^4.17.0",
123
+ "@types/node": "^22.0.0",
124
+ "@types/react": "^19.0.0",
125
+ "@types/react-reconciler": "^0.33.0",
126
+ "@types/semver": "^7.0.0",
127
+ "@xterm/headless": "^6.0.0",
128
+ "tsx": "^4.0.0",
129
+ "typescript": "^6.0.3"
130
+ },
131
+ "dsh": {
132
+ "bundle": {
133
+ "patch": "./cordis.patch.yml"
134
+ }
135
+ },
136
+ "scripts": {
137
+ "build": "tsc -p tsconfig.json",
138
+ "tui": "node --import tsx/esm scripts/run.ts",
139
+ "smoke": "node --import tsx/esm scripts/smoke.tsx"
140
+ }
141
+ }
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: audit
3
+ description: Use when asked to audit a codebase, or when the /audit command runs — find security, correctness, and quality issues across a project and report them organized by severity.
4
+ ---
5
+
6
+ # Code Audit
7
+
8
+ Audit the current project for security, correctness, and quality issues. Work through the codebase systematically rather than sampling files.
9
+
10
+ ## Procedure
11
+
12
+ 1. Identify the project structure, entry points, and external attack surface (network input, file input, shell commands).
13
+ 2. Scan for common issue classes:
14
+ - **Security**: injection (command/shell, path traversal), secrets in code, unsafe deserialization, missing auth/authorization, TLS misuse, dependency vulnerabilities (lockfile advisories).
15
+ - **Correctness**: race conditions, error paths swallowing failures, off-by-one / boundary errors, resource leaks (handles, sockets), unhandled promise rejections.
16
+ - **Quality**: dead code, duplicated logic, missing validation at boundaries, poor error messages, missing tests for critical paths.
17
+ 3. Verify suspicions against the actual code — cite file paths and line-level evidence.
18
+ 4. Report findings organized by severity (critical / high / medium / low), each with: location, what's wrong, why it matters, and a concrete fix suggestion.
19
+ 5. End with a short "healthy areas" note so the audit is balanced.
20
+
21
+ ## Constraints
22
+
23
+ - Do not modify code during the audit — findings only.
24
+ - If the project is small or has no security surface, say so explicitly instead of padding the report.
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: bug
3
+ description: Use when the user reports a bug or asks to capture one — ask the minimal questions needed, then produce a structured bug report the team can act on.
4
+ ---
5
+
6
+ # Bug Report
7
+
8
+ Capture a complete, actionable bug report. Ask only the questions needed to fill genuine gaps — never interrogate the user.
9
+
10
+ ## Procedure
11
+
12
+ 1. Understand the symptom: what happened vs what was expected. If the user already gave enough detail, skip straight to the report.
13
+ 2. Fill any critical gaps with at most 2-3 targeted questions: reproduction steps, environment (OS/terminal/node version), and whether it's deterministic.
14
+ 3. If the codebase is available, inspect the suspected area to add root-cause hypotheses (with file/line evidence where possible).
15
+ 4. Produce the report:
16
+ - **标题**: one-line symptom summary
17
+ - **现象**: observed vs expected behavior
18
+ - **复现步骤**: minimal steps, with inputs
19
+ - **环境**: OS / node version / dsh-tui version / terminal
20
+ - **影响**: severity + who/what is affected
21
+ - **根因假设**: evidence-based guesses, clearly labeled as hypotheses
22
+ - **建议**: fix direction or workaround
23
+
24
+ ## Constraints
25
+
26
+ - Never invent reproduction steps or environment details — mark unknowns as "待确认".
27
+ - Keep the report tight; a bug report is a working document, not an essay.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: pr-comments
3
+ description: Use when the user asks to review pull request comments, or when the /pr_comments command runs — fetch and analyze PR review comments on the current branch and summarize actionable items.
4
+ ---
5
+
6
+ # Pull Request Comments Review
7
+
8
+ Review the pull request comments associated with the current branch and turn them into an actionable summary.
9
+
10
+ ## Procedure
11
+
12
+ 1. Identify the PR for the current branch (git remote, branch name → PR). If no PR is found or git hosting tools are unavailable, say so and fall back to reviewing local uncommitted changes.
13
+ 2. Gather review comments (inline + general) and group them by theme: blocking changes, open questions, nits.
14
+ 3. For each actionable comment: restate the concern in your own words, locate the affected code, and propose a concrete change.
15
+ 4. Produce a summary: what the reviewers want changed, what's already addressed, and a suggested order of work.
16
+
17
+ ## Constraints
18
+
19
+ - Never invent comments — summarize only what is actually there.
20
+ - Mark unresolved vs resolved comments explicitly.
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: practice
3
+ description: Use when the user asks to practice programming with dsh-tui, or wants to level up a specific skill through guided exercises.
4
+ ---
5
+
6
+ # Programming Practice
7
+
8
+ Run an interactive programming practice session with the user, adapting difficulty to their level and goals.
9
+
10
+ ## Procedure
11
+
12
+ 1. Ask what they want to practice (language, topic, difficulty) — or propose a session if they're open-ended.
13
+ 2. Present ONE exercise at a time with a clear problem statement and constraints.
14
+ 3. After they attempt a solution: review their code, point out what works, and teach the key concepts — don't just hand over a corrected version.
15
+ 4. Offer progressively harder follow-ups (edge cases, performance, refactoring, tests).
16
+ 5. Track their wins so later exercises build on them.
17
+
18
+ ## Constraints
19
+
20
+ - Keep the session interactive: one exercise, feedback, next exercise — never dump a full curriculum.
21
+ - Prefer Socratic hints over direct answers when the user is close.
22
+ - Sessions should be completable in ~10-15 minutes per exercise.
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: release-notes
3
+ description: Use when asked to generate release notes, or when the /release-notes command runs — derive user-facing release notes from the change history since the last release.
4
+ ---
5
+
6
+ # Release Notes
7
+
8
+ Generate user-facing release notes for the current project since the last release.
9
+
10
+ ## Procedure
11
+
12
+ 1. Determine the last release point (git tags) and collect the change set since then (git log / diff of user-facing surfaces).
13
+ 2. Classify changes:
14
+ - **新功能** (new features)
15
+ - **改进** (improvements / behavior changes)
16
+ - **修复** (bug fixes)
17
+ - **破坏性变更** (breaking changes — call these out first)
18
+ - **内部** (chore/refactor — omit from user-facing notes or fold into a footnote)
19
+ 3. Write notes in the user's language, focused on what changed for users — not implementation details.
20
+ 4. Reference issues/PRs where known, keep each bullet one line, group under the sections above.
21
+
22
+ ## Constraints
23
+
24
+ - Do not fabricate changes — only what the history shows.
25
+ - Breaking changes must be listed first, with migration hints.
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: review
3
+ description: Use when asked to review a codebase or a change, or when the /review command runs — assess design, correctness, maintainability, and test coverage with actionable feedback.
4
+ ---
5
+
6
+ # Code Review
7
+
8
+ Review the current project or the most recent change set and give feedback the author can act on.
9
+
10
+ ## Procedure
11
+
12
+ 1. Determine the review target: the whole project, the current branch diff (git diff against the base), or a specific area the user names.
13
+ 2. Read the code with these lenses:
14
+ - **设计**: does the structure match the problem? Clear ownership, sane seams, no over-engineering?
15
+ - **正确性**: boundary conditions, error handling, concurrency, resource lifetime.
16
+ - **可维护性**: naming, duplication, dead code, complexity hotspots, comment quality.
17
+ - **测试**: are the important behaviors covered? Are tests asserting behavior rather than implementation?
18
+ 3. For each finding: file/line, what's wrong, why it matters, concrete suggestion.
19
+ 4. Order feedback: blocking issues first, then nits. Distinguish "must fix" from "consider".
20
+ 5. End with what's good — reviews that only criticize are less useful.
21
+
22
+ ## Constraints
23
+
24
+ - Do not modify code during the review.
25
+ - If reviewing a diff, look at the diff in context (surrounding code), not just the changed lines.
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: vuln-check
3
+ description: Use when asked to check for security vulnerabilities, or when the /vuln-check command runs — scan the project for known vulnerable dependencies and security anti-patterns.
4
+ ---
5
+
6
+ # Vulnerability Check
7
+
8
+ Check the current project for security vulnerabilities: dependency advisories and code-level security anti-patterns.
9
+
10
+ ## Procedure
11
+
12
+ 1. **依赖审计**: inspect the lockfile/manifest (package-lock.json / pnpm-lock.yaml / requirements.txt…) for known-vulnerable versions. Use the local toolchain (npm audit / pnpm audit when available and network permits) or compare against known advisory data.
13
+ 2. **代码检查**: scan for security anti-patterns with file/line evidence:
14
+ - shell command injection (string interpolation into exec/spawn with shell:true)
15
+ - path traversal (user input joined into paths without normalization)
16
+ - secrets committed (API keys, tokens, private keys in the tree)
17
+ - unsafe eval / dynamic import of user input
18
+ - missing input validation at trust boundaries
19
+ 3. Report findings ordered by severity, each with: location, CVE/advisory id when applicable, impact, and remediation (upgrade to which version, or the code change needed).
20
+ 4. State explicitly when the project is clean in a category.
21
+
22
+ ## Constraints
23
+
24
+ - Distinguish "verified vulnerable" from "needs verification" — never overstate.
25
+ - Do not modify code during the check.