@deepseek-harness-tui/dsh-tui 0.6.1 → 0.7.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 (379) hide show
  1. package/README.md +74 -21
  2. package/bin/dsh-tui.js +115 -25
  3. package/cordis.patch.yml +69 -17
  4. package/cordis.yml +50 -12
  5. package/lib/types/activityPrefs.d.ts +1 -1
  6. package/lib/types/activityPrefs.js +3 -3
  7. package/lib/types/cc/figures.d.ts +27 -20
  8. package/lib/types/cc/figures.d.ts.map +1 -1
  9. package/lib/types/cc/figures.js +43 -34
  10. package/lib/types/cc/format.d.ts +18 -9
  11. package/lib/types/cc/format.d.ts.map +1 -1
  12. package/lib/types/cc/format.js +26 -18
  13. package/lib/types/cc/markdown.d.ts +31 -16
  14. package/lib/types/cc/markdown.d.ts.map +1 -1
  15. package/lib/types/cc/markdown.js +283 -260
  16. package/lib/types/cc/terminal.d.ts +10 -7
  17. package/lib/types/cc/terminal.d.ts.map +1 -1
  18. package/lib/types/cc/terminal.js +62 -50
  19. package/lib/types/command-trees.d.ts +3 -0
  20. package/lib/types/command-trees.d.ts.map +1 -0
  21. package/lib/types/command-trees.js +4 -0
  22. package/lib/types/commands.d.ts +37 -1
  23. package/lib/types/commands.d.ts.map +1 -1
  24. package/lib/types/commands.js +68 -3
  25. package/lib/types/components/ActivityLine.d.ts +1 -1
  26. package/lib/types/components/ActivityLine.d.ts.map +1 -1
  27. package/lib/types/components/ActivityPicker.d.ts.map +1 -1
  28. package/lib/types/components/ActivityPicker.js +3 -4
  29. package/lib/types/components/BtwPanel.d.ts +16 -0
  30. package/lib/types/components/BtwPanel.d.ts.map +1 -0
  31. package/lib/types/components/BtwPanel.js +47 -0
  32. package/lib/types/components/CommandSuggestions.d.ts +4 -2
  33. package/lib/types/components/CommandSuggestions.d.ts.map +1 -1
  34. package/lib/types/components/CommandSuggestions.js +2 -2
  35. package/lib/types/components/EffortSlider.d.ts +15 -0
  36. package/lib/types/components/EffortSlider.d.ts.map +1 -0
  37. package/lib/types/components/EffortSlider.js +17 -0
  38. package/lib/types/components/GoalTodoPanel.d.ts +1 -1
  39. package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
  40. package/lib/types/components/HelpMenu.d.ts +5 -2
  41. package/lib/types/components/HelpMenu.d.ts.map +1 -1
  42. package/lib/types/components/HelpMenu.js +8 -3
  43. package/lib/types/components/HistorySearchDialog.d.ts +1 -1
  44. package/lib/types/components/HistorySearchDialog.d.ts.map +1 -1
  45. package/lib/types/components/HistorySearchDialog.js +21 -10
  46. package/lib/types/components/InterruptedByUser.d.ts +2 -2
  47. package/lib/types/components/InterruptedByUser.d.ts.map +1 -1
  48. package/lib/types/components/InterruptedByUser.js +4 -3
  49. package/lib/types/components/LoadedContextPanel.d.ts +1 -1
  50. package/lib/types/components/LoadedContextPanel.d.ts.map +1 -1
  51. package/lib/types/components/LogoV2.d.ts.map +1 -1
  52. package/lib/types/components/LogoV2.js +2 -1
  53. package/lib/types/components/Markdown.d.ts +11 -11
  54. package/lib/types/components/Markdown.d.ts.map +1 -1
  55. package/lib/types/components/Markdown.js +63 -57
  56. package/lib/types/components/MarkdownTable.d.ts +1 -1
  57. package/lib/types/components/MarkdownTable.js +2 -2
  58. package/lib/types/components/MessageList.d.ts +10 -2
  59. package/lib/types/components/MessageList.d.ts.map +1 -1
  60. package/lib/types/components/MessageList.js +17 -10
  61. package/lib/types/components/ModelPicker.d.ts +4 -1
  62. package/lib/types/components/ModelPicker.d.ts.map +1 -1
  63. package/lib/types/components/ModelPicker.js +16 -4
  64. package/lib/types/components/OverlayAbove.d.ts +20 -0
  65. package/lib/types/components/OverlayAbove.d.ts.map +1 -0
  66. package/lib/types/components/OverlayAbove.js +18 -0
  67. package/lib/types/components/PresetPicker.d.ts +1 -1
  68. package/lib/types/components/PresetPicker.d.ts.map +1 -1
  69. package/lib/types/components/PresetPicker.js +2 -3
  70. package/lib/types/components/PromptInput.d.ts +5 -4
  71. package/lib/types/components/PromptInput.d.ts.map +1 -1
  72. package/lib/types/components/PromptInput.js +186 -39
  73. package/lib/types/components/ResumePicker.d.ts +15 -4
  74. package/lib/types/components/ResumePicker.d.ts.map +1 -1
  75. package/lib/types/components/ResumePicker.js +25 -9
  76. package/lib/types/components/RewindPicker.d.ts +1 -1
  77. package/lib/types/components/RewindPicker.d.ts.map +1 -1
  78. package/lib/types/components/RewindPicker.js +14 -5
  79. package/lib/types/components/SearchBox.d.ts +1 -1
  80. package/lib/types/components/SearchBox.js +1 -1
  81. package/lib/types/components/Spinner/GlimmerMessage.d.ts +1 -2
  82. package/lib/types/components/Spinner/GlimmerMessage.d.ts.map +1 -1
  83. package/lib/types/components/Spinner/GlimmerMessage.js +1 -2
  84. package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts +1 -1
  85. package/lib/types/components/Spinner/SpinnerAnimationRow.js +2 -2
  86. package/lib/types/components/Spinner/SpinnerGlyph.d.ts +1 -1
  87. package/lib/types/components/Spinner/SpinnerGlyph.js +1 -1
  88. package/lib/types/components/Spinner/spinnerUtils.d.ts +13 -18
  89. package/lib/types/components/Spinner/spinnerUtils.d.ts.map +1 -1
  90. package/lib/types/components/Spinner/spinnerUtils.js +67 -71
  91. package/lib/types/components/Spinner/useStalledAnimation.d.ts +1 -2
  92. package/lib/types/components/Spinner/useStalledAnimation.d.ts.map +1 -1
  93. package/lib/types/components/Spinner/useStalledAnimation.js +1 -2
  94. package/lib/types/components/StreamingMarkdown.d.ts +1 -1
  95. package/lib/types/components/StreamingMarkdown.js +1 -1
  96. package/lib/types/components/ThemePicker.d.ts +13 -9
  97. package/lib/types/components/ThemePicker.d.ts.map +1 -1
  98. package/lib/types/components/ThemePicker.js +21 -15
  99. package/lib/types/components/ThinkingToggle.d.ts +1 -1
  100. package/lib/types/components/ThinkingToggle.d.ts.map +1 -1
  101. package/lib/types/components/ThinkingToggle.js +8 -8
  102. package/lib/types/components/ToolUseLoader.d.ts +1 -1
  103. package/lib/types/components/ToolUseLoader.js +1 -1
  104. package/lib/types/components/WorkingSpinner.d.ts +2 -2
  105. package/lib/types/components/WorkingSpinner.js +2 -2
  106. package/lib/types/components/WorkspaceFlowPicker.d.ts +15 -0
  107. package/lib/types/components/WorkspaceFlowPicker.d.ts.map +1 -0
  108. package/lib/types/components/WorkspaceFlowPicker.js +19 -0
  109. package/lib/types/components/WorkspacePicker.d.ts +9 -0
  110. package/lib/types/components/WorkspacePicker.d.ts.map +1 -0
  111. package/lib/types/components/WorkspacePicker.js +13 -0
  112. package/lib/types/components/approvals/ApprovalPanel.d.ts +1 -1
  113. package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -1
  114. package/lib/types/components/approvals/ApprovalPanel.js +2 -1
  115. package/lib/types/components/design-system/Byline.d.ts +1 -1
  116. package/lib/types/components/design-system/Byline.js +1 -1
  117. package/lib/types/components/design-system/Divider.d.ts +1 -1
  118. package/lib/types/components/design-system/Divider.js +1 -1
  119. package/lib/types/components/design-system/HintLine.d.ts +12 -0
  120. package/lib/types/components/design-system/HintLine.d.ts.map +1 -0
  121. package/lib/types/components/design-system/HintLine.js +15 -0
  122. package/lib/types/components/design-system/KeyboardShortcutHint.d.ts +1 -1
  123. package/lib/types/components/design-system/KeyboardShortcutHint.js +1 -1
  124. package/lib/types/components/design-system/ListItem.d.ts +2 -2
  125. package/lib/types/components/design-system/ListItem.d.ts.map +1 -1
  126. package/lib/types/components/design-system/ListItem.js +35 -3
  127. package/lib/types/components/design-system/LoadingState.d.ts +1 -2
  128. package/lib/types/components/design-system/LoadingState.d.ts.map +1 -1
  129. package/lib/types/components/design-system/LoadingState.js +1 -2
  130. package/lib/types/components/design-system/Pane.d.ts +2 -2
  131. package/lib/types/components/design-system/Pane.js +2 -2
  132. package/lib/types/components/design-system/ProgressBar.d.ts +1 -2
  133. package/lib/types/components/design-system/ProgressBar.d.ts.map +1 -1
  134. package/lib/types/components/design-system/ProgressBar.js +1 -2
  135. package/lib/types/components/design-system/StatusIcon.d.ts +2 -2
  136. package/lib/types/components/design-system/StatusIcon.js +2 -2
  137. package/lib/types/components/design-system/ThemeProvider.d.ts +1 -1
  138. package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -1
  139. package/lib/types/components/design-system/ThemeProvider.js +87 -26
  140. package/lib/types/components/design-system/ThemedBox.d.ts +1 -1
  141. package/lib/types/components/design-system/ThemedBox.js +1 -1
  142. package/lib/types/components/design-system/ThemedText.d.ts +2 -2
  143. package/lib/types/components/design-system/ThemedText.js +2 -2
  144. package/lib/types/components/listWindow.d.ts +26 -0
  145. package/lib/types/components/listWindow.d.ts.map +1 -0
  146. package/lib/types/components/listWindow.js +47 -0
  147. package/lib/types/components/messages/AssistantTextMessage.d.ts +1 -2
  148. package/lib/types/components/messages/AssistantTextMessage.d.ts.map +1 -1
  149. package/lib/types/components/messages/AssistantTextMessage.js +1 -2
  150. package/lib/types/components/messages/AssistantThinkingMessage.d.ts +2 -2
  151. package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
  152. package/lib/types/components/messages/AssistantThinkingMessage.js +6 -6
  153. package/lib/types/components/messages/AssistantToolUseMessage.d.ts +12 -4
  154. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  155. package/lib/types/components/messages/AssistantToolUseMessage.js +9 -5
  156. package/lib/types/components/messages/MessageMetadata.d.ts +1 -1
  157. package/lib/types/components/messages/MessageMetadata.js +1 -1
  158. package/lib/types/components/messages/UserPromptMessage.d.ts +1 -1
  159. package/lib/types/components/messages/UserPromptMessage.js +1 -1
  160. package/lib/types/components/questions/AskUserQuestionPanel.d.ts +5 -1
  161. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
  162. package/lib/types/components/questions/AskUserQuestionPanel.js +11 -9
  163. package/lib/types/components/questions/PlanReviewPanel.d.ts +1 -1
  164. package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
  165. package/lib/types/components/questions/PlanReviewPanel.js +3 -2
  166. package/lib/types/components/trajectory/HotspotView.d.ts +14 -0
  167. package/lib/types/components/trajectory/HotspotView.d.ts.map +1 -0
  168. package/lib/types/components/trajectory/HotspotView.js +83 -0
  169. package/lib/types/components/trajectory/Inspector.d.ts +31 -0
  170. package/lib/types/components/trajectory/Inspector.d.ts.map +1 -0
  171. package/lib/types/components/trajectory/Inspector.js +67 -0
  172. package/lib/types/components/trajectory/Ledger.d.ts +20 -0
  173. package/lib/types/components/trajectory/Ledger.d.ts.map +1 -0
  174. package/lib/types/components/trajectory/Ledger.js +112 -0
  175. package/lib/types/components/trajectory/MiniWake.d.ts +24 -0
  176. package/lib/types/components/trajectory/MiniWake.d.ts.map +1 -0
  177. package/lib/types/components/trajectory/MiniWake.js +99 -0
  178. package/lib/types/components/trajectory/WaveBand.d.ts +33 -0
  179. package/lib/types/components/trajectory/WaveBand.d.ts.map +1 -0
  180. package/lib/types/components/trajectory/WaveBand.js +145 -0
  181. package/lib/types/customTheme.d.ts +6 -6
  182. package/lib/types/customTheme.d.ts.map +1 -1
  183. package/lib/types/customTheme.js +15 -12
  184. package/lib/types/dsh-adapter/approvals.d.ts.map +1 -0
  185. package/lib/types/{channel.d.ts → dsh-adapter/channel.d.ts} +184 -43
  186. package/lib/types/dsh-adapter/channel.d.ts.map +1 -0
  187. package/lib/types/{channel.js → dsh-adapter/channel.js} +972 -201
  188. package/lib/types/dsh-adapter/childStderr.d.ts.map +1 -0
  189. package/lib/types/{childStderr.js → dsh-adapter/childStderr.js} +1 -1
  190. package/lib/types/dsh-adapter/command-trees.d.ts +27 -0
  191. package/lib/types/dsh-adapter/command-trees.d.ts.map +1 -0
  192. package/lib/types/dsh-adapter/command-trees.js +42 -0
  193. package/lib/types/dsh-adapter/compat/index.d.ts +22 -0
  194. package/lib/types/dsh-adapter/compat/index.d.ts.map +1 -0
  195. package/lib/types/{compat → dsh-adapter/compat}/index.js +7 -4
  196. package/lib/types/dsh-adapter/compat/sessionLog.d.ts +86 -0
  197. package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -0
  198. package/lib/types/dsh-adapter/compat/sessionLog.js +347 -0
  199. package/lib/types/dsh-adapter/contract.d.ts +20 -0
  200. package/lib/types/dsh-adapter/contract.d.ts.map +1 -0
  201. package/lib/types/dsh-adapter/contract.js +109 -0
  202. package/lib/types/dsh-adapter/index.d.ts +80 -0
  203. package/lib/types/dsh-adapter/index.d.ts.map +1 -0
  204. package/lib/types/dsh-adapter/index.js +45 -0
  205. package/lib/types/dsh-adapter/invariant.d.ts.map +1 -0
  206. package/lib/types/dsh-adapter/packaged-skills.d.ts.map +1 -0
  207. package/lib/types/{plugin.d.ts → dsh-adapter/plugin.d.ts} +17 -0
  208. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -0
  209. package/lib/types/{plugin.js → dsh-adapter/plugin.js} +280 -80
  210. package/lib/types/dsh-adapter/presets.d.ts.map +1 -0
  211. package/lib/types/dsh-adapter/providerWizard.d.ts +91 -0
  212. package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -0
  213. package/lib/types/dsh-adapter/providerWizard.js +332 -0
  214. package/lib/types/{questions.d.ts → dsh-adapter/questions.d.ts} +7 -2
  215. package/lib/types/dsh-adapter/questions.d.ts.map +1 -0
  216. package/lib/types/{questions.js → dsh-adapter/questions.js} +15 -7
  217. package/lib/types/dsh-adapter/sideQuestion.d.ts +38 -0
  218. package/lib/types/dsh-adapter/sideQuestion.d.ts.map +1 -0
  219. package/lib/types/dsh-adapter/sideQuestion.js +69 -0
  220. package/lib/types/dsh-adapter/trajectory/aggregate.d.ts +46 -0
  221. package/lib/types/dsh-adapter/trajectory/aggregate.d.ts.map +1 -0
  222. package/lib/types/dsh-adapter/trajectory/aggregate.js +207 -0
  223. package/lib/types/dsh-adapter/trajectory/guards.d.ts +177 -0
  224. package/lib/types/dsh-adapter/trajectory/guards.d.ts.map +1 -0
  225. package/lib/types/dsh-adapter/trajectory/guards.js +235 -0
  226. package/lib/types/dsh-adapter/trajectory/index.d.ts +16 -0
  227. package/lib/types/dsh-adapter/trajectory/index.d.ts.map +1 -0
  228. package/lib/types/dsh-adapter/trajectory/index.js +15 -0
  229. package/lib/types/dsh-adapter/trajectory/inspect.d.ts +40 -0
  230. package/lib/types/dsh-adapter/trajectory/inspect.d.ts.map +1 -0
  231. package/lib/types/dsh-adapter/trajectory/inspect.js +160 -0
  232. package/lib/types/dsh-adapter/trajectory/projection.d.ts +128 -0
  233. package/lib/types/dsh-adapter/trajectory/projection.d.ts.map +1 -0
  234. package/lib/types/dsh-adapter/trajectory/projection.js +653 -0
  235. package/lib/types/dsh-adapter/trajectory/types.d.ts +232 -0
  236. package/lib/types/dsh-adapter/trajectory/types.d.ts.map +1 -0
  237. package/lib/types/dsh-adapter/trajectory/types.js +70 -0
  238. package/lib/types/dsh-adapter/trajectory/wave.d.ts +45 -0
  239. package/lib/types/dsh-adapter/trajectory/wave.d.ts.map +1 -0
  240. package/lib/types/dsh-adapter/trajectory/wave.js +210 -0
  241. package/lib/types/dsh-adapter/types.d.ts +23 -0
  242. package/lib/types/dsh-adapter/types.d.ts.map +1 -0
  243. package/lib/types/dsh-adapter/types.js +1 -0
  244. package/lib/types/dsh-adapter/workspace.d.ts +22 -0
  245. package/lib/types/dsh-adapter/workspace.d.ts.map +1 -0
  246. package/lib/types/dsh-adapter/workspace.js +16 -0
  247. package/lib/types/dsh-adapter/workspaces.d.ts +118 -0
  248. package/lib/types/dsh-adapter/workspaces.d.ts.map +1 -0
  249. package/lib/types/dsh-adapter/workspaces.js +290 -0
  250. package/lib/types/effortPrefs.d.ts +1 -1
  251. package/lib/types/effortPrefs.js +3 -3
  252. package/lib/types/history.js +2 -2
  253. package/lib/types/hooks/useBlink.d.ts +1 -1
  254. package/lib/types/hooks/useBlink.js +1 -1
  255. package/lib/types/i18n.d.ts +977 -36
  256. package/lib/types/i18n.d.ts.map +1 -1
  257. package/lib/types/i18n.js +307 -30
  258. package/lib/types/index.d.ts +1 -69
  259. package/lib/types/index.d.ts.map +1 -1
  260. package/lib/types/index.js +3 -31
  261. package/lib/types/ink/components/App.d.ts.map +1 -1
  262. package/lib/types/ink/components/App.js +33 -19
  263. package/lib/types/ink/dom.d.ts +15 -0
  264. package/lib/types/ink/dom.d.ts.map +1 -1
  265. package/lib/types/ink/dom.js +32 -0
  266. package/lib/types/ink/hooks/use-input.d.ts.map +1 -1
  267. package/lib/types/ink/hooks/use-input.js +8 -0
  268. package/lib/types/ink/hooks/use-terminal-size.d.ts +1 -1
  269. package/lib/types/ink/hooks/use-terminal-size.js +1 -1
  270. package/lib/types/ink/ink.d.ts.map +1 -1
  271. package/lib/types/ink/ink.js +109 -28
  272. package/lib/types/ink/input-suppression.d.ts +20 -0
  273. package/lib/types/ink/input-suppression.d.ts.map +1 -0
  274. package/lib/types/ink/input-suppression.js +26 -0
  275. package/lib/types/ink/log-update.js +21 -6
  276. package/lib/types/ink/parse-keypress.d.ts +31 -0
  277. package/lib/types/ink/parse-keypress.d.ts.map +1 -1
  278. package/lib/types/ink/parse-keypress.js +442 -8
  279. package/lib/types/ink/terminal-querier.d.ts +5 -1
  280. package/lib/types/ink/terminal-querier.d.ts.map +1 -1
  281. package/lib/types/ink/terminal-querier.js +27 -3
  282. package/lib/types/ink/terminal.d.ts +18 -0
  283. package/lib/types/ink/terminal.d.ts.map +1 -1
  284. package/lib/types/ink/terminal.js +32 -4
  285. package/lib/types/ink/termio/csi.d.ts +10 -0
  286. package/lib/types/ink/termio/csi.d.ts.map +1 -1
  287. package/lib/types/ink/termio/csi.js +20 -0
  288. package/lib/types/ink/termio/tokenize.js +10 -0
  289. package/lib/types/modelPrefs.d.ts +1 -1
  290. package/lib/types/modelPrefs.js +3 -3
  291. package/lib/types/presetPrefs.d.ts +1 -1
  292. package/lib/types/presetPrefs.js +3 -3
  293. package/lib/types/screens/Chat.d.ts +20 -4
  294. package/lib/types/screens/Chat.d.ts.map +1 -1
  295. package/lib/types/screens/Chat.js +655 -55
  296. package/lib/types/screens/StatusLine.d.ts +17 -2
  297. package/lib/types/screens/StatusLine.d.ts.map +1 -1
  298. package/lib/types/screens/StatusLine.js +12 -4
  299. package/lib/types/screens/TrajectoryScene.d.ts +16 -0
  300. package/lib/types/screens/TrajectoryScene.d.ts.map +1 -0
  301. package/lib/types/screens/TrajectoryScene.js +305 -0
  302. package/lib/types/sessionHistory.d.ts +9 -1
  303. package/lib/types/sessionHistory.d.ts.map +1 -1
  304. package/lib/types/sessionHistory.js +56 -16
  305. package/lib/types/sessionModes.d.ts +29 -0
  306. package/lib/types/sessionModes.d.ts.map +1 -0
  307. package/lib/types/sessionModes.js +45 -0
  308. package/lib/types/theme.d.ts +27 -3
  309. package/lib/types/theme.d.ts.map +1 -1
  310. package/lib/types/theme.js +48 -4
  311. package/lib/types/themePrefs.d.ts +3 -3
  312. package/lib/types/themePrefs.js +5 -5
  313. package/lib/types/trajectory/format.d.ts +100 -0
  314. package/lib/types/trajectory/format.d.ts.map +1 -0
  315. package/lib/types/trajectory/format.js +213 -0
  316. package/lib/types/trajectory/motion.d.ts +99 -0
  317. package/lib/types/trajectory/motion.d.ts.map +1 -0
  318. package/lib/types/trajectory/motion.js +143 -0
  319. package/lib/types/trajectory/query.d.ts +83 -0
  320. package/lib/types/trajectory/query.d.ts.map +1 -0
  321. package/lib/types/trajectory/query.js +187 -0
  322. package/lib/types/trajectoryPrefs.d.ts +36 -0
  323. package/lib/types/trajectoryPrefs.d.ts.map +1 -0
  324. package/lib/types/trajectoryPrefs.js +65 -0
  325. package/lib/types/update.d.ts +3 -3
  326. package/lib/types/update.d.ts.map +1 -1
  327. package/lib/types/update.js +18 -7
  328. package/lib/types/utils/clipboard.d.ts +101 -29
  329. package/lib/types/utils/clipboard.d.ts.map +1 -1
  330. package/lib/types/utils/clipboard.js +533 -55
  331. package/lib/types/utils/debug.d.ts +1 -1
  332. package/lib/types/utils/debug.js +2 -2
  333. package/lib/types/utils/execFileNoThrow.d.ts.map +1 -1
  334. package/lib/types/utils/execFileNoThrow.js +16 -6
  335. package/lib/types/utils/externalEditor.d.ts +115 -0
  336. package/lib/types/utils/externalEditor.d.ts.map +1 -0
  337. package/lib/types/utils/externalEditor.js +270 -0
  338. package/lib/types/utils/fullscreen.d.ts +2 -2
  339. package/lib/types/utils/fullscreen.js +3 -3
  340. package/lib/types/utils/loaded-context.d.ts +1 -1
  341. package/lib/types/utils/loaded-context.d.ts.map +1 -1
  342. package/lib/types/utils/modifiers.d.ts +24 -0
  343. package/lib/types/utils/modifiers.d.ts.map +1 -1
  344. package/lib/types/utils/modifiers.js +27 -0
  345. package/lib/types/utils/paths.d.ts +45 -0
  346. package/lib/types/utils/paths.d.ts.map +1 -0
  347. package/lib/types/utils/paths.js +69 -0
  348. package/lib/types/utils/shellQuote.d.ts +14 -0
  349. package/lib/types/utils/shellQuote.d.ts.map +1 -0
  350. package/lib/types/utils/shellQuote.js +39 -0
  351. package/lib/types/utils/workspaceRoot.d.ts +21 -0
  352. package/lib/types/utils/workspaceRoot.d.ts.map +1 -0
  353. package/lib/types/utils/workspaceRoot.js +47 -0
  354. package/lib/types/workspaces.d.ts +3 -0
  355. package/lib/types/workspaces.d.ts.map +1 -0
  356. package/lib/types/workspaces.js +4 -0
  357. package/package.json +25 -7
  358. package/lib/types/approvals.d.ts.map +0 -1
  359. package/lib/types/channel.d.ts.map +0 -1
  360. package/lib/types/childStderr.d.ts.map +0 -1
  361. package/lib/types/compat/index.d.ts +0 -20
  362. package/lib/types/compat/index.d.ts.map +0 -1
  363. package/lib/types/compat/sessionLog.d.ts +0 -40
  364. package/lib/types/compat/sessionLog.d.ts.map +0 -1
  365. package/lib/types/compat/sessionLog.js +0 -226
  366. package/lib/types/invariant.d.ts.map +0 -1
  367. package/lib/types/packaged-skills.d.ts.map +0 -1
  368. package/lib/types/plugin.d.ts.map +0 -1
  369. package/lib/types/presets.d.ts.map +0 -1
  370. package/lib/types/questions.d.ts.map +0 -1
  371. /package/lib/types/{approvals.d.ts → dsh-adapter/approvals.d.ts} +0 -0
  372. /package/lib/types/{approvals.js → dsh-adapter/approvals.js} +0 -0
  373. /package/lib/types/{childStderr.d.ts → dsh-adapter/childStderr.d.ts} +0 -0
  374. /package/lib/types/{invariant.d.ts → dsh-adapter/invariant.d.ts} +0 -0
  375. /package/lib/types/{invariant.js → dsh-adapter/invariant.js} +0 -0
  376. /package/lib/types/{packaged-skills.d.ts → dsh-adapter/packaged-skills.d.ts} +0 -0
  377. /package/lib/types/{packaged-skills.js → dsh-adapter/packaged-skills.js} +0 -0
  378. /package/lib/types/{presets.d.ts → dsh-adapter/presets.d.ts} +0 -0
  379. /package/lib/types/{presets.js → dsh-adapter/presets.js} +0 -0
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Inspector detail — full content, resolved on demand.
3
+ *
4
+ * The projection stores no message bodies: a node keeps `seq` (and `endSeq`)
5
+ * and nothing else about content, so a ten-thousand-row session costs a few
6
+ * hundred kilobytes of index rather than a second copy of the transcript. The
7
+ * price is that opening a row has to go back to the log — which is free,
8
+ * because the log is the same in-memory immutable array the fold read.
9
+ *
10
+ * That is also why this module lives in the adapter: it is the only place that
11
+ * reads raw event payloads for display, and the boundary gate keeps it here.
12
+ * The scene renders the returned sections without knowing what an event is.
13
+ */
14
+ import type { TrajNode } from './types.js';
15
+ import type { SessionEvent } from '@deepseek-ai/dsh-session';
16
+ /** One titled block of full content. */
17
+ export interface InspectSection {
18
+ readonly title: string;
19
+ /** Raw body; the view truncates to its own box. */
20
+ readonly body: string;
21
+ /** Render hint: `error` for failures, `dim` for supporting material. */
22
+ readonly tone?: 'error' | 'dim';
23
+ }
24
+ /** Everything the inspector shows for one row. */
25
+ export interface InspectDetail {
26
+ readonly title: string;
27
+ /** Short `key value` facts rendered on the header line. */
28
+ readonly facts: readonly string[];
29
+ readonly sections: readonly InspectSection[];
30
+ }
31
+ /**
32
+ * Resolve the full detail for one ledger row.
33
+ *
34
+ * @param node - The focused row.
35
+ * @param events - The session's current event snapshot.
36
+ * @returns Display-ready sections. Always succeeds: a row whose owning event
37
+ * has been compacted away still yields its header facts.
38
+ */
39
+ export declare function inspectNode(node: TrajNode, events: readonly SessionEvent[]): InspectDetail;
40
+ //# sourceMappingURL=inspect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/trajectory/inspect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE5D,wCAAwC;AACxC,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,mDAAmD;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,wEAAwE;IACxE,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;CAChC;AAED,kDAAkD;AAClD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,2DAA2D;IAC3D,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC,QAAQ,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAA;CAC7C;AAwCD;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,aAAa,CA2F1F"}
@@ -0,0 +1,160 @@
1
+ /**
2
+ * Inspector detail — full content, resolved on demand.
3
+ *
4
+ * The projection stores no message bodies: a node keeps `seq` (and `endSeq`)
5
+ * and nothing else about content, so a ten-thousand-row session costs a few
6
+ * hundred kilobytes of index rather than a second copy of the transcript. The
7
+ * price is that opening a row has to go back to the log — which is free,
8
+ * because the log is the same in-memory immutable array the fold read.
9
+ *
10
+ * That is also why this module lives in the adapter: it is the only place that
11
+ * reads raw event payloads for display, and the boundary gate keeps it here.
12
+ * The scene renders the returned sections without knowing what an event is.
13
+ */
14
+ import { asRawEvents, readRetry } from './guards.js';
15
+ /** Binary search for an event by seq; the log is seq-monotonic. */
16
+ function findBySeq(events, seq) {
17
+ let low = 0;
18
+ let high = events.length - 1;
19
+ while (low <= high) {
20
+ const mid = (low + high) >> 1;
21
+ const candidate = events[mid];
22
+ if (candidate.seq === seq)
23
+ return candidate;
24
+ if (candidate.seq < seq)
25
+ low = mid + 1;
26
+ else
27
+ high = mid - 1;
28
+ }
29
+ return undefined;
30
+ }
31
+ /** Pretty-print a JSON string; returns the input unchanged when it is not JSON. */
32
+ function prettyJson(text) {
33
+ const trimmed = text.trim();
34
+ if (!trimmed.startsWith('{') && !trimmed.startsWith('['))
35
+ return text;
36
+ try {
37
+ return JSON.stringify(JSON.parse(trimmed), null, 2);
38
+ }
39
+ catch {
40
+ return text;
41
+ }
42
+ }
43
+ /** Concatenate every text block of a message content array. */
44
+ function allText(content) {
45
+ if (!Array.isArray(content))
46
+ return '';
47
+ const parts = [];
48
+ for (const block of content) {
49
+ if (typeof block !== 'object' || block === null)
50
+ continue;
51
+ const record = block;
52
+ if (typeof record.text === 'string')
53
+ parts.push(record.text);
54
+ else if (record.type === 'image')
55
+ parts.push('[image]');
56
+ }
57
+ return parts.join('\n');
58
+ }
59
+ /**
60
+ * Resolve the full detail for one ledger row.
61
+ *
62
+ * @param node - The focused row.
63
+ * @param events - The session's current event snapshot.
64
+ * @returns Display-ready sections. Always succeeds: a row whose owning event
65
+ * has been compacted away still yields its header facts.
66
+ */
67
+ export function inspectNode(node, events) {
68
+ const raw = asRawEvents(events);
69
+ const open = findBySeq(raw, node.seq);
70
+ const close = node.endSeq === undefined ? undefined : findBySeq(raw, node.endSeq);
71
+ const data = open?.data;
72
+ const facts = [];
73
+ if (node.turn > 0)
74
+ facts.push(node.step === undefined ? `turn ${node.turn}` : `turn ${node.turn} · step ${node.step}`);
75
+ if (node.callId !== undefined)
76
+ facts.push(node.callId.slice(0, 12));
77
+ if (node.tokens !== undefined) {
78
+ const { input, output, think, cacheRead } = node.tokens;
79
+ facts.push(`in ${input} · out ${output}${think > 0 ? ` · think ${think}` : ''}${cacheRead > 0 ? ` · cache ${cacheRead}` : ''}`);
80
+ }
81
+ const sections = [];
82
+ switch (node.kind) {
83
+ case 'tool':
84
+ case 'subtool': {
85
+ const args = node.detail;
86
+ if (args !== undefined && args !== '')
87
+ sections.push({ title: 'input', body: prettyJson(args) });
88
+ const message = close?.data?.message;
89
+ const body = typeof message === 'object' && message !== null
90
+ ? allText(message.content)
91
+ : (node.outcome ?? '');
92
+ if (body !== '')
93
+ sections.push({ title: 'output', body, tone: node.status === 'error' ? 'error' : undefined });
94
+ if (node.errorCode !== undefined)
95
+ sections.push({ title: 'error', body: node.errorCode, tone: 'error' });
96
+ break;
97
+ }
98
+ case 'retry': {
99
+ const payload = open === undefined ? undefined : readRetry(open.data);
100
+ if (payload !== undefined) {
101
+ facts.push(`${node.attempts ?? 1} attempts`);
102
+ if (payload.provider !== undefined)
103
+ facts.push(payload.provider);
104
+ sections.push({
105
+ title: 'cause',
106
+ body: `${payload.code ?? 'unknown'} — ${payload.message ?? ''}`.trim(),
107
+ tone: 'error',
108
+ });
109
+ }
110
+ // Every attempt of this sequence, so the backoff ladder is visible.
111
+ const ladder = [];
112
+ for (const event of raw) {
113
+ if (event.type !== 'llm/retry')
114
+ continue;
115
+ const attempt = readRetry(event.data);
116
+ if (attempt === undefined || payload === undefined || attempt.retryId !== payload.retryId)
117
+ continue;
118
+ ladder.push(`#${attempt.retry} → ${Math.round(attempt.delayMs)}ms`);
119
+ }
120
+ if (ladder.length > 0)
121
+ sections.push({ title: 'backoff', body: ladder.join(' ') });
122
+ break;
123
+ }
124
+ case 'approval': {
125
+ if (node.detail !== undefined)
126
+ sections.push({ title: 'reason', body: node.detail });
127
+ if (node.outcome !== undefined) {
128
+ sections.push({ title: 'outcome', body: node.outcome, tone: node.status === 'error' ? 'error' : undefined });
129
+ }
130
+ break;
131
+ }
132
+ case 'user':
133
+ case 'assistant':
134
+ case 'thinking':
135
+ case 'context': {
136
+ const content = data?.content ?? data?.message?.content;
137
+ const body = allText(content);
138
+ sections.push({ title: node.kind, body: body === '' ? (node.detail ?? '') : body });
139
+ break;
140
+ }
141
+ default: {
142
+ if (node.detail !== undefined && node.detail !== '')
143
+ sections.push({ title: 'detail', body: node.detail });
144
+ if (node.outcome !== undefined && node.outcome !== '')
145
+ sections.push({ title: 'outcome', body: node.outcome });
146
+ break;
147
+ }
148
+ }
149
+ if (node.burst !== undefined) {
150
+ sections.unshift({
151
+ title: `${node.burst.members.length} calls`,
152
+ body: node.burst.members
153
+ .map((member, position) => `${position + 1}. ${(member.detail ?? '').replace(/\s+/g, ' ').slice(0, 120)}`)
154
+ .join('\n'),
155
+ tone: 'dim',
156
+ });
157
+ }
158
+ const title = node.label === '' ? node.kind : node.label;
159
+ return { title, facts, sections };
160
+ }
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Trajectory projection — folding the session event log into ledger nodes.
3
+ *
4
+ * ## What this is
5
+ *
6
+ * The DSH session log is an append-only stream of ~44 event types. This
7
+ * module folds it into the flat, turn-annotated node list the trajectory
8
+ * scene renders, pairing every bracket (`tool/call` ↔ `tool/result`,
9
+ * `step/start` ↔ `step/end`, `llm/retry` ↔ `llm/retry-started`,
10
+ * `approval/asked` ↔ `approval/decided`, `compaction/start` ↔
11
+ * `compaction/end`, `tool/code-dispatch-start` ↔ `tool/code-dispatch`) so a
12
+ * row can show its own wall-clock duration and outcome.
13
+ *
14
+ * ## Incrementality
15
+ *
16
+ * `agent.session.events` is an immutable snapshot whose element objects are
17
+ * frozen at append and REUSED until the next append. {@link extendTrajectory}
18
+ * exploits exactly that: when the incoming snapshot prefix-extends the one the
19
+ * previous build consumed — proven by *object identity* at the previous last
20
+ * index, never by `seq` arithmetic, which a fork can rewind — only the new
21
+ * tail is folded. Any other relationship (agent swap on `/resume`, `/rewind`,
22
+ * `/new`) rebuilds from scratch. A long session therefore never pays an O(n)
23
+ * refold per frame, and `verify-trace-projection` asserts that the incremental
24
+ * and from-scratch results are field-for-field identical at every split point.
25
+ *
26
+ * ## What it deliberately does not do
27
+ *
28
+ * No node holds derived text. `detail`/`outcome` are references into strings
29
+ * the log already owns, and the view flattens only the rows it paints (see
30
+ * {@link previewText}). Full content is not held at all — `seq`/`endSeq`
31
+ * address the owning events for the inspector to re-read on demand.
32
+ *
33
+ * Storage-level chunk packing (`text-chunks`, `reasoning-chunks`,
34
+ * `tool-call-chunks`) is a durable *encoding*, not an event vocabulary: the
35
+ * persistence reader expands those rows back into `assistant/chunk` events
36
+ * before they reach `Session.events`, so this fold only ever sees the
37
+ * expanded form.
38
+ */
39
+ import { type RawTrajEvent } from './guards.js';
40
+ import { type TrajNode } from './types.js';
41
+ import type { SessionEvent } from '@deepseek-ai/dsh-session';
42
+ /** Per-step streaming timestamps, the source of TTFT and decode duration. */
43
+ export interface StepTiming {
44
+ /** `step/start` time. */
45
+ readonly startTime: number;
46
+ /** First `assistant/chunk` time — the model's first observable output. */
47
+ firstChunk?: number;
48
+ /** Last `assistant/chunk` time. */
49
+ lastChunk?: number;
50
+ /** `step/end` time, when the step closed. */
51
+ endTime?: number;
52
+ }
53
+ /**
54
+ * One assembled projection. Carries everything a continuation needs, so an
55
+ * append folds only its tail; treat every field as owned by this module.
56
+ */
57
+ export interface TrajBuild {
58
+ /** The snapshot this build consumed; identity-compared on the next append. */
59
+ readonly source: readonly RawTrajEvent[];
60
+ /** The ledger, in log order, after burst folding. */
61
+ readonly nodes: TrajNode[];
62
+ /** Per-step timing keyed `${turn}:${step}`, for the hotspot aggregate. */
63
+ readonly timing: Map<string, StepTiming>;
64
+ /**
65
+ * Running counters, maintained O(1) per event.
66
+ *
67
+ * The status-line badge needs "how many rows, how many failed" on every
68
+ * chat frame; deriving that with a scan would make an idle conversation pay
69
+ * O(session) per repaint, which is exactly the cost the incremental fold
70
+ * exists to avoid.
71
+ */
72
+ readonly counts: TrajCounts;
73
+ /** Open brackets and fold state; internal, but reused across appends. */
74
+ readonly state: FoldState;
75
+ }
76
+ /** Cheap session counters the chat chrome reads every frame. */
77
+ export interface TrajCounts {
78
+ /** Ledger rows, after burst folding. */
79
+ rows: number;
80
+ /** Rows that ended in failure, plus retry sequences. */
81
+ errors: number;
82
+ /** Retry attempts across the session. */
83
+ retries: number;
84
+ }
85
+ /** Mutable fold bookkeeping carried between incremental appends. */
86
+ interface FoldState {
87
+ counts: TrajCounts;
88
+ tools: Map<string, TrajNode>;
89
+ subtools: Map<string, TrajNode>;
90
+ steps: Map<string, TrajNode>;
91
+ turns: Map<number, TrajNode>;
92
+ retries: Map<string, TrajNode>;
93
+ approvals: Map<string, TrajNode>;
94
+ hooks: Map<string, TrajNode>;
95
+ /** Compaction brackets carry no observed id — a stack pairs them by nesting. */
96
+ compactions: TrajNode[];
97
+ /** Live turn context for events that carry none. */
98
+ turn: number;
99
+ /** Live step context; cleared at `step/end`. */
100
+ step: number | undefined;
101
+ /** True until the first `session/end-seed`; marks replayed history. */
102
+ seeding: boolean;
103
+ /** `${kind}:${name}` of the run being folded, or undefined. */
104
+ runKey: string | undefined;
105
+ /** Length of the current run. */
106
+ runCount: number;
107
+ /** Index in `nodes` of the run's first row (or its burst stand-in). */
108
+ runStart: number;
109
+ /** Members of the run, kept so the burst node can adopt them. */
110
+ runMembers: TrajNode[];
111
+ }
112
+ /** An empty build, used as the identity element and for empty sessions. */
113
+ export declare function emptyTrajectory(): TrajBuild;
114
+ /**
115
+ * Extend a previous projection with the session's current event snapshot.
116
+ *
117
+ * @param previous - The prior build, or `null` to fold from scratch.
118
+ * @param events - The session's current immutable event snapshot.
119
+ * @returns A build over `events`; `previous` itself when nothing was appended.
120
+ */
121
+ export declare function extendTrajectory(previous: TrajBuild | null, events: readonly SessionEvent[]): TrajBuild;
122
+ /**
123
+ * Fold from scratch — the one-shot form used by tests and by consumers that
124
+ * hold no previous build.
125
+ */
126
+ export declare function buildTrajectory(events: readonly SessionEvent[]): TrajBuild;
127
+ export {};
128
+ //# sourceMappingURL=projection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/trajectory/projection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EAeL,KAAK,YAAY,EAClB,MAAM,aAAa,CAAA;AACpB,OAAO,EAA4B,KAAK,QAAQ,EAAmB,MAAM,YAAY,CAAA;AACrF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE5D,6EAA6E;AAC7E,MAAM,WAAW,UAAU;IACzB,yBAAyB;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAA;IACxC,qDAAqD;IACrD,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAA;IAC1B,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IACxC;;;;;;;OAOG;IACH,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;IAC3B,yEAAyE;IACzE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;CAC1B;AAED,gEAAgE;AAChE,MAAM,WAAW,UAAU;IACzB,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAA;IACZ,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAA;IACd,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,oEAAoE;AACpE,UAAU,SAAS;IACjB,MAAM,EAAE,UAAU,CAAA;IAClB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IAC5B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IAC/B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IAC5B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IAC5B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IAC9B,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IAChC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IAC5B,gFAAgF;IAChF,WAAW,EAAE,QAAQ,EAAE,CAAA;IACvB,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAA;IACZ,gDAAgD;IAChD,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,uEAAuE;IACvE,OAAO,EAAE,OAAO,CAAA;IAChB,+DAA+D;IAC/D,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAA;IAChB,iEAAiE;IACjE,UAAU,EAAE,QAAQ,EAAE,CAAA;CACvB;AA6kBD,2EAA2E;AAC3E,wBAAgB,eAAe,IAAI,SAAS,CAG3C;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,SAAS,GAAG,IAAI,EAC1B,MAAM,EAAE,SAAS,YAAY,EAAE,GAC9B,SAAS,CAwBX;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,CAE1E"}