@deepseek-harness-tui/dsh-tui 0.10.2 → 0.11.1

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 (351) hide show
  1. package/README.md +175 -123
  2. package/bin/dsh-tui.js +748 -22
  3. package/cordis.patch.yml +42 -13
  4. package/cordis.yml +5 -2
  5. package/lib/types/activityPrefs.d.ts +24 -0
  6. package/lib/types/activityPrefs.d.ts.map +1 -1
  7. package/lib/types/activityPrefs.js +50 -1
  8. package/lib/types/adapter/channel/session-projection.d.ts.map +1 -1
  9. package/lib/types/adapter/channel/session-projection.js +2 -0
  10. package/lib/types/adapter/channel/state.d.ts.map +1 -1
  11. package/lib/types/adapter/channel/state.js +3 -1
  12. package/lib/types/adapter/channel/ui-policy.d.ts +4 -1
  13. package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
  14. package/lib/types/adapter/channel/ui-policy.js +6 -2
  15. package/lib/types/adapter/kernel/host-facade.d.ts.map +1 -1
  16. package/lib/types/adapter/kernel/host-facade.js +1 -0
  17. package/lib/types/adapter/kernel/replay.d.ts.map +1 -1
  18. package/lib/types/adapter/kernel/replay.js +3 -0
  19. package/lib/types/adapter/kernel/runtime.d.ts.map +1 -1
  20. package/lib/types/adapter/kernel/runtime.js +2 -0
  21. package/lib/types/adapter/kernel/slices/workspace.d.ts.map +1 -1
  22. package/lib/types/adapter/kernel/slices/workspace.js +1 -0
  23. package/lib/types/adapter/ports/channel-ui.d.ts +29 -5
  24. package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
  25. package/lib/types/adapter/ports/channel-view.d.ts +66 -12
  26. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  27. package/lib/types/adapter/ports/channel-workspace.d.ts +23 -0
  28. package/lib/types/adapter/ports/channel-workspace.d.ts.map +1 -1
  29. package/lib/types/adapter/ports/channel.d.ts +4 -1
  30. package/lib/types/adapter/ports/channel.d.ts.map +1 -1
  31. package/lib/types/adapter/ports/workspace.d.ts +2 -0
  32. package/lib/types/adapter/ports/workspace.d.ts.map +1 -1
  33. package/lib/types/adapter/upstream/workspace-driver.d.ts.map +1 -1
  34. package/lib/types/adapter/upstream/workspace-driver.js +10 -2
  35. package/lib/types/commands.d.ts.map +1 -1
  36. package/lib/types/commands.js +1 -0
  37. package/lib/types/components/ActivityLine.d.ts +7 -2
  38. package/lib/types/components/ActivityLine.d.ts.map +1 -1
  39. package/lib/types/components/ActivityLine.js +0 -8
  40. package/lib/types/components/ContextBarView.d.ts +15 -7
  41. package/lib/types/components/ContextBarView.d.ts.map +1 -1
  42. package/lib/types/components/ContextBarView.js +26 -22
  43. package/lib/types/components/ImagePreviewOverlay.d.ts.map +1 -1
  44. package/lib/types/components/ImagePreviewOverlay.js +11 -5
  45. package/lib/types/components/Markdown.d.ts +11 -1
  46. package/lib/types/components/Markdown.d.ts.map +1 -1
  47. package/lib/types/components/Markdown.js +20 -2
  48. package/lib/types/components/MermaidDiagram.d.ts +13 -0
  49. package/lib/types/components/MermaidDiagram.d.ts.map +1 -0
  50. package/lib/types/components/MermaidDiagram.js +61 -0
  51. package/lib/types/components/MessageList.d.ts +26 -1
  52. package/lib/types/components/MessageList.d.ts.map +1 -1
  53. package/lib/types/components/MessageList.js +74 -8
  54. package/lib/types/components/PageMargin.d.ts +1 -1
  55. package/lib/types/components/PromptInput.d.ts +37 -1
  56. package/lib/types/components/PromptInput.d.ts.map +1 -1
  57. package/lib/types/components/PromptInput.js +291 -30
  58. package/lib/types/components/ScrollbarGutter.d.ts +20 -5
  59. package/lib/types/components/ScrollbarGutter.d.ts.map +1 -1
  60. package/lib/types/components/ScrollbarGutter.js +88 -10
  61. package/lib/types/components/SplitDiffView.d.ts.map +1 -1
  62. package/lib/types/components/SplitDiffView.js +2 -1
  63. package/lib/types/components/StreamingMarkdown.d.ts.map +1 -1
  64. package/lib/types/components/StreamingMarkdown.js +30 -28
  65. package/lib/types/components/SubagentCard.d.ts.map +1 -1
  66. package/lib/types/components/SubagentCard.js +12 -6
  67. package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
  68. package/lib/types/components/SubagentDetailScene.js +8 -3
  69. package/lib/types/components/Tooltip.d.ts.map +1 -1
  70. package/lib/types/components/Tooltip.js +45 -7
  71. package/lib/types/components/design-system/HintLine.d.ts +1 -2
  72. package/lib/types/components/design-system/HintLine.d.ts.map +1 -1
  73. package/lib/types/components/design-system/HintLine.js +1 -2
  74. package/lib/types/components/messages/AssistantThinkingMessage.d.ts +2 -1
  75. package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
  76. package/lib/types/components/messages/AssistantThinkingMessage.js +2 -1
  77. package/lib/types/components/messages/AssistantToolUseMessage.d.ts +2 -2
  78. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  79. package/lib/types/components/messages/AssistantToolUseMessage.js +30 -26
  80. package/lib/types/components/messages/UserPromptMessage.d.ts.map +1 -1
  81. package/lib/types/components/messages/UserPromptMessage.js +5 -7
  82. package/lib/types/components/messages/useImageInspection.d.ts.map +1 -1
  83. package/lib/types/components/messages/useImageInspection.js +19 -9
  84. package/lib/types/components/promptDraftCache.d.ts +102 -0
  85. package/lib/types/components/promptDraftCache.d.ts.map +1 -0
  86. package/lib/types/components/promptDraftCache.js +76 -0
  87. package/lib/types/components/questions/AskUserQuestionPanel.d.ts +17 -1
  88. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
  89. package/lib/types/components/questions/AskUserQuestionPanel.js +40 -7
  90. package/lib/types/components/questions/QuestionMinimizedBar.d.ts +12 -0
  91. package/lib/types/components/questions/QuestionMinimizedBar.d.ts.map +1 -0
  92. package/lib/types/components/questions/QuestionMinimizedBar.js +43 -0
  93. package/lib/types/components/sessions/SessionListRow.d.ts +23 -1
  94. package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
  95. package/lib/types/components/sessions/SessionListRow.js +52 -5
  96. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts +49 -0
  97. package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -0
  98. package/lib/types/components/workspaces/HomeWorkspaceRow.js +50 -0
  99. package/lib/types/dsh-adapter/activity-store.d.ts +221 -0
  100. package/lib/types/dsh-adapter/activity-store.d.ts.map +1 -0
  101. package/lib/types/dsh-adapter/activity-store.js +359 -0
  102. package/lib/types/dsh-adapter/bundled-presets.d.ts +10 -0
  103. package/lib/types/dsh-adapter/bundled-presets.d.ts.map +1 -0
  104. package/lib/types/dsh-adapter/bundled-presets.js +80 -0
  105. package/lib/types/dsh-adapter/channel/action-readiness.d.ts +1 -1
  106. package/lib/types/dsh-adapter/channel/action-readiness.d.ts.map +1 -1
  107. package/lib/types/dsh-adapter/channel/action-readiness.js +3 -0
  108. package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts +1 -1
  109. package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts.map +1 -1
  110. package/lib/types/dsh-adapter/channel/agent-view-projection.js +19 -2
  111. package/lib/types/dsh-adapter/channel/background-action.d.ts +1 -1
  112. package/lib/types/dsh-adapter/channel/background-action.d.ts.map +1 -1
  113. package/lib/types/dsh-adapter/channel/background-action.js +53 -29
  114. package/lib/types/dsh-adapter/channel/binding-events.d.ts +8 -6
  115. package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
  116. package/lib/types/dsh-adapter/channel/binding-events.js +5 -4
  117. package/lib/types/dsh-adapter/channel/binding.d.ts +19 -2
  118. package/lib/types/dsh-adapter/channel/binding.d.ts.map +1 -1
  119. package/lib/types/dsh-adapter/channel/binding.js +78 -18
  120. package/lib/types/dsh-adapter/channel/compaction.d.ts +0 -1
  121. package/lib/types/dsh-adapter/channel/compaction.d.ts.map +1 -1
  122. package/lib/types/dsh-adapter/channel/compaction.js +0 -2
  123. package/lib/types/dsh-adapter/channel/composer-images.d.ts +5 -0
  124. package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
  125. package/lib/types/dsh-adapter/channel/composer-images.js +105 -6
  126. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +8 -0
  127. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
  128. package/lib/types/dsh-adapter/channel/context-bookkeeping.js +3 -2
  129. package/lib/types/dsh-adapter/channel/ide-selection.d.ts +58 -0
  130. package/lib/types/dsh-adapter/channel/ide-selection.d.ts.map +1 -0
  131. package/lib/types/dsh-adapter/channel/ide-selection.js +226 -0
  132. package/lib/types/dsh-adapter/channel/input-delivery.d.ts +6 -1
  133. package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
  134. package/lib/types/dsh-adapter/channel/input-delivery.js +9 -1
  135. package/lib/types/dsh-adapter/channel/local-actions.d.ts +3 -19
  136. package/lib/types/dsh-adapter/channel/local-actions.d.ts.map +1 -1
  137. package/lib/types/dsh-adapter/channel/local-actions.js +2 -1
  138. package/lib/types/dsh-adapter/channel/model-actions.d.ts +4 -1
  139. package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
  140. package/lib/types/dsh-adapter/channel/model-actions.js +82 -6
  141. package/lib/types/dsh-adapter/channel/model-switch.d.ts +1 -2
  142. package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
  143. package/lib/types/dsh-adapter/channel/model-switch.js +49 -31
  144. package/lib/types/dsh-adapter/channel/projection.d.ts +4 -0
  145. package/lib/types/dsh-adapter/channel/projection.d.ts.map +1 -1
  146. package/lib/types/dsh-adapter/channel/projection.js +29 -19
  147. package/lib/types/dsh-adapter/channel/reports.d.ts.map +1 -1
  148. package/lib/types/dsh-adapter/channel/reports.js +4 -12
  149. package/lib/types/dsh-adapter/channel/session-adoption.d.ts +1 -1
  150. package/lib/types/dsh-adapter/channel/session-adoption.d.ts.map +1 -1
  151. package/lib/types/dsh-adapter/channel/session-adoption.js +1 -0
  152. package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -1
  153. package/lib/types/dsh-adapter/channel/session-fork.js +26 -2
  154. package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +4 -1
  155. package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -1
  156. package/lib/types/dsh-adapter/channel/session-live-adoption.js +2 -0
  157. package/lib/types/dsh-adapter/channel/session-metadata.d.ts +10 -0
  158. package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
  159. package/lib/types/dsh-adapter/channel/session-metadata.js +6 -4
  160. package/lib/types/dsh-adapter/channel/session-reset.d.ts +1 -1
  161. package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
  162. package/lib/types/dsh-adapter/channel/session-reset.js +0 -1
  163. package/lib/types/dsh-adapter/channel/session-resume.d.ts +12 -3
  164. package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
  165. package/lib/types/dsh-adapter/channel/session-resume.js +292 -94
  166. package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
  167. package/lib/types/dsh-adapter/channel/session-rewind.js +34 -16
  168. package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
  169. package/lib/types/dsh-adapter/channel/session-tree-actions.js +19 -3
  170. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
  171. package/lib/types/dsh-adapter/channel/settings-host.js +4 -3
  172. package/lib/types/dsh-adapter/channel/state.d.ts +6 -1
  173. package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
  174. package/lib/types/dsh-adapter/channel/state.js +3 -3
  175. package/lib/types/dsh-adapter/channel/subagent-projection.d.ts +21 -1
  176. package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
  177. package/lib/types/dsh-adapter/channel/subagent-projection.js +173 -6
  178. package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -1
  179. package/lib/types/dsh-adapter/channel/transcript.js +6 -12
  180. package/lib/types/dsh-adapter/channel/types.d.ts +6 -1
  181. package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
  182. package/lib/types/dsh-adapter/channel/workspace-actions.d.ts +4 -1
  183. package/lib/types/dsh-adapter/channel/workspace-actions.d.ts.map +1 -1
  184. package/lib/types/dsh-adapter/channel/workspace-actions.js +41 -1
  185. package/lib/types/dsh-adapter/channel.d.ts +1 -1
  186. package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
  187. package/lib/types/dsh-adapter/channel.js +82 -20
  188. package/lib/types/dsh-adapter/compat/index.d.ts +1 -1
  189. package/lib/types/dsh-adapter/compat/index.d.ts.map +1 -1
  190. package/lib/types/dsh-adapter/compat/index.js +1 -1
  191. package/lib/types/dsh-adapter/compat/messages.d.ts +15 -0
  192. package/lib/types/dsh-adapter/compat/messages.d.ts.map +1 -0
  193. package/lib/types/dsh-adapter/compat/messages.js +15 -0
  194. package/lib/types/dsh-adapter/compat/sessionLog.d.ts +18 -0
  195. package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
  196. package/lib/types/dsh-adapter/compat/sessionLog.js +18 -3
  197. package/lib/types/dsh-adapter/compat/settings.d.ts +35 -0
  198. package/lib/types/dsh-adapter/compat/settings.d.ts.map +1 -0
  199. package/lib/types/dsh-adapter/compat/settings.js +57 -0
  200. package/lib/types/dsh-adapter/compat/shell.d.ts +25 -0
  201. package/lib/types/dsh-adapter/compat/shell.d.ts.map +1 -0
  202. package/lib/types/dsh-adapter/compat/shell.js +11 -0
  203. package/lib/types/dsh-adapter/contract.d.ts +5 -4
  204. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  205. package/lib/types/dsh-adapter/contract.js +17 -6
  206. package/lib/types/dsh-adapter/ide-channel.d.ts +224 -0
  207. package/lib/types/dsh-adapter/ide-channel.d.ts.map +1 -0
  208. package/lib/types/dsh-adapter/ide-channel.js +556 -0
  209. package/lib/types/dsh-adapter/index.d.ts +18 -3
  210. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  211. package/lib/types/dsh-adapter/index.js +32 -5
  212. package/lib/types/dsh-adapter/plugin.d.ts +4 -1
  213. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  214. package/lib/types/dsh-adapter/plugin.js +197 -49
  215. package/lib/types/dsh-adapter/preset-resolution.d.ts +8 -0
  216. package/lib/types/dsh-adapter/preset-resolution.d.ts.map +1 -1
  217. package/lib/types/dsh-adapter/preset-resolution.js +10 -0
  218. package/lib/types/dsh-adapter/session-mount-heartbeat.d.ts +53 -0
  219. package/lib/types/dsh-adapter/session-mount-heartbeat.d.ts.map +1 -0
  220. package/lib/types/dsh-adapter/session-mount-heartbeat.js +100 -0
  221. package/lib/types/dsh-adapter/sessionTree.d.ts.map +1 -1
  222. package/lib/types/dsh-adapter/sessionTree.js +3 -2
  223. package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
  224. package/lib/types/dsh-adapter/settings-sections.js +7 -4
  225. package/lib/types/dsh-adapter/subagents.d.ts +16 -3
  226. package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
  227. package/lib/types/dsh-adapter/subagents.js +92 -29
  228. package/lib/types/dsh-adapter/workspaces.d.ts +46 -3
  229. package/lib/types/dsh-adapter/workspaces.d.ts.map +1 -1
  230. package/lib/types/dsh-adapter/workspaces.js +116 -0
  231. package/lib/types/effortPrefs.d.ts +15 -3
  232. package/lib/types/effortPrefs.d.ts.map +1 -1
  233. package/lib/types/effortPrefs.js +37 -3
  234. package/lib/types/history.d.ts +13 -1
  235. package/lib/types/history.d.ts.map +1 -1
  236. package/lib/types/history.js +15 -2
  237. package/lib/types/homePrefs.d.ts +15 -0
  238. package/lib/types/homePrefs.d.ts.map +1 -0
  239. package/lib/types/homePrefs.js +53 -0
  240. package/lib/types/i18n.d.ts +347 -297
  241. package/lib/types/i18n.d.ts.map +1 -1
  242. package/lib/types/i18n.js +133 -85
  243. package/lib/types/ink/colorize.d.ts +10 -0
  244. package/lib/types/ink/colorize.d.ts.map +1 -1
  245. package/lib/types/ink/colorize.js +21 -0
  246. package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
  247. package/lib/types/ink/components/ScrollBox.js +12 -1
  248. package/lib/types/ink/dom.d.ts +1 -0
  249. package/lib/types/ink/dom.d.ts.map +1 -1
  250. package/lib/types/ink/hooks/use-copy-on-select.d.ts +5 -1
  251. package/lib/types/ink/hooks/use-copy-on-select.d.ts.map +1 -1
  252. package/lib/types/ink/hooks/use-copy-on-select.js +15 -1
  253. package/lib/types/ink/ink.d.ts.map +1 -1
  254. package/lib/types/ink/ink.js +36 -1
  255. package/lib/types/ink/log-update.d.ts.map +1 -1
  256. package/lib/types/ink/log-update.js +19 -1
  257. package/lib/types/ink/output.d.ts +10 -1
  258. package/lib/types/ink/output.d.ts.map +1 -1
  259. package/lib/types/ink/output.js +109 -17
  260. package/lib/types/ink/render-border.d.ts +6 -1
  261. package/lib/types/ink/render-border.d.ts.map +1 -1
  262. package/lib/types/ink/render-border.js +25 -9
  263. package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
  264. package/lib/types/ink/render-node-to-output.js +48 -6
  265. package/lib/types/ink/renderer.d.ts +6 -0
  266. package/lib/types/ink/renderer.d.ts.map +1 -1
  267. package/lib/types/ink/renderer.js +2 -1
  268. package/lib/types/ink/selection.d.ts +88 -0
  269. package/lib/types/ink/selection.d.ts.map +1 -1
  270. package/lib/types/ink/selection.js +164 -0
  271. package/lib/types/ink/sixel-graphics.d.ts +19 -1
  272. package/lib/types/ink/sixel-graphics.d.ts.map +1 -1
  273. package/lib/types/ink/sixel-graphics.js +124 -12
  274. package/lib/types/ink/terminal-image.d.ts +18 -1
  275. package/lib/types/ink/terminal-image.d.ts.map +1 -1
  276. package/lib/types/ink/terminal.d.ts +17 -0
  277. package/lib/types/ink/terminal.d.ts.map +1 -1
  278. package/lib/types/ink/terminal.js +20 -1
  279. package/lib/types/screens/Chat.d.ts +20 -1
  280. package/lib/types/screens/Chat.d.ts.map +1 -1
  281. package/lib/types/screens/Chat.js +296 -76
  282. package/lib/types/screens/SessionSupervisor.d.ts +84 -0
  283. package/lib/types/screens/SessionSupervisor.d.ts.map +1 -0
  284. package/lib/types/screens/SessionSupervisor.js +350 -0
  285. package/lib/types/screens/SessionTree.js +2 -2
  286. package/lib/types/screens/Settings.d.ts.map +1 -1
  287. package/lib/types/screens/Settings.js +32 -9
  288. package/lib/types/screens/StatusLine.d.ts +18 -1
  289. package/lib/types/screens/StatusLine.d.ts.map +1 -1
  290. package/lib/types/screens/StatusLine.js +38 -19
  291. package/lib/types/screens/StatusMetrics.d.ts +79 -22
  292. package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
  293. package/lib/types/screens/StatusMetrics.js +153 -88
  294. package/lib/types/screens/sessionSupervisor/model.d.ts +83 -0
  295. package/lib/types/screens/sessionSupervisor/model.d.ts.map +1 -0
  296. package/lib/types/screens/sessionSupervisor/model.js +69 -0
  297. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +120 -0
  298. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -0
  299. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +593 -0
  300. package/lib/types/sessionMounts.d.ts +272 -0
  301. package/lib/types/sessionMounts.d.ts.map +1 -0
  302. package/lib/types/sessionMounts.js +706 -0
  303. package/lib/types/sessions/format.d.ts.map +1 -1
  304. package/lib/types/sessions/format.js +4 -1
  305. package/lib/types/sessions/resumeFailure.d.ts +38 -0
  306. package/lib/types/sessions/resumeFailure.d.ts.map +1 -0
  307. package/lib/types/sessions/resumeFailure.js +58 -0
  308. package/lib/types/terminal-utils/mermaid.d.ts +44 -0
  309. package/lib/types/terminal-utils/mermaid.d.ts.map +1 -0
  310. package/lib/types/terminal-utils/mermaid.js +83 -0
  311. package/lib/types/tips.d.ts.map +1 -1
  312. package/lib/types/tips.js +175 -19
  313. package/lib/types/tuiDisplayPrefs.d.ts +7 -9
  314. package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
  315. package/lib/types/tuiDisplayPrefs.js +31 -28
  316. package/lib/types/update.d.ts +61 -0
  317. package/lib/types/update.d.ts.map +1 -1
  318. package/lib/types/update.js +194 -0
  319. package/lib/types/utils/fold-long-lines.d.ts +1 -1
  320. package/lib/types/utils/fold-long-lines.js +1 -1
  321. package/lib/types/utils/imageResize.d.ts +90 -0
  322. package/lib/types/utils/imageResize.d.ts.map +1 -0
  323. package/lib/types/utils/imageResize.js +272 -0
  324. package/lib/types/utils/keymap.d.ts +5 -1
  325. package/lib/types/utils/keymap.d.ts.map +1 -1
  326. package/lib/types/utils/keymap.js +23 -0
  327. package/lib/types/working-activity.d.ts +10 -9
  328. package/lib/types/working-activity.d.ts.map +1 -1
  329. package/lib/types/working-activity.js +17 -10
  330. package/lib/types/workspaces.d.ts +2 -1
  331. package/lib/types/workspaces.d.ts.map +1 -1
  332. package/lib/types/workspaces.js +1 -1
  333. package/node_modules/@deepseek-harness-tui/dsh-auth/package.json +10 -10
  334. package/package.json +126 -105
  335. package/presets/liangshen/.dsh-tui-managed.json +1 -1
  336. package/presets/liangshen/agent.cordis.yml +15 -0
  337. package/lib/types/components/design-system/KeyboardShortcutHint.d.ts +0 -19
  338. package/lib/types/components/design-system/KeyboardShortcutHint.d.ts.map +0 -1
  339. package/lib/types/components/design-system/KeyboardShortcutHint.js +0 -14
  340. package/lib/types/dsh-adapter/channel/activity.d.ts +0 -20
  341. package/lib/types/dsh-adapter/channel/activity.d.ts.map +0 -1
  342. package/lib/types/dsh-adapter/channel/activity.js +0 -113
  343. package/lib/types/screens/AgentView.d.ts +0 -23
  344. package/lib/types/screens/AgentView.d.ts.map +0 -1
  345. package/lib/types/screens/AgentView.js +0 -546
  346. package/lib/types/screens/SessionBrowser.d.ts +0 -42
  347. package/lib/types/screens/SessionBrowser.d.ts.map +0 -1
  348. package/lib/types/screens/SessionBrowser.js +0 -911
  349. package/lib/types/terminal-utils/terminal.d.ts +0 -18
  350. package/lib/types/terminal-utils/terminal.d.ts.map +0 -1
  351. package/lib/types/terminal-utils/terminal.js +0 -96
@@ -0,0 +1,272 @@
1
+ /**
2
+ * Cross-process session mounting ledger, kept at
3
+ * `~/.dsh-tui/session-mounts.json`.
4
+ *
5
+ * A TUI terminal hosts SEVERAL agent sessions at once (the attached one plus
6
+ * every parked background session), and sessions are durable: another TUI, or
7
+ * `dsh web`, can list the same logs. Nothing in the DSH session store says
8
+ * *who is currently driving a log*, so two TUI processes resuming the same
9
+ * session would interleave writes into one append-only event log and corrupt
10
+ * the transcript. This file is that missing fact: each TUI process publishes
11
+ * the set of sessions it has mounted, and a reader that sees a foreign entry
12
+ * treats the session as OCCUPIED and refuses to mount it.
13
+ *
14
+ * Liveness is one witness, `process.kill(pid, 0)`: it catches a clean exit and
15
+ * a `kill -9`. There is no heartbeat timestamp, because a timestamp only stays
16
+ * truthful while a timer keeps refreshing it, and the process that cannot
17
+ * refresh it is exactly the one whose record should expire. The cost is pid
18
+ * REUSE — a recycled pid keeps a dead owner's record alive — which errs toward
19
+ * refusing a session that is in fact free and costs one restart; the opposite
20
+ * error interleaves two writers into one transcript. This is a same-machine
21
+ * guard only: the host's own session write lock stays the authority that
22
+ * actually separates writers.
23
+ *
24
+ * Reads never write. Pruning a dead owner happens on the write path, because a
25
+ * reader that wrote its snapshot back could erase a peer's record published
26
+ * between its read and its replace — silently dropping a live session from the
27
+ * occupancy table while its process kept writing.
28
+ *
29
+ * Writes take a short cross-process lock, re-read the file under it, and replace
30
+ * it atomically. The lock is token-checked, so a holder whose lock was reclaimed
31
+ * as stale cannot write over — or delete — the new holder's lock. A CLAIM
32
+ * re-derives its conflict under that lock ({@link claimMount}), because
33
+ * "check, then publish" is not atomic across processes.
34
+ *
35
+ * "I could not read the ledger" is NOT "nobody holds the session". Granting a
36
+ * write handle on a damaged or unreadable ledger is exactly the failure this
37
+ * module exists to prevent, and it is unrecoverable, so the authoritative
38
+ * paths refuse instead of degrading ({@link readMountLedgerStrict},
39
+ * {@link MountFailure}). Only the display surface reads best-effort.
40
+ *
41
+ * The lock is reclaimable only from a holder that is provably gone: its token
42
+ * carries the holder pid, so a lock whose holder is still ALIVE is never stolen
43
+ * from — not even by a peer that finds it old. That closes the window where a
44
+ * paused holder resumed after its lock had been reclaimed and committed a
45
+ * snapshot derived before the steal. The price is pid REUSE on a lock: a
46
+ * recycled pid keeps a dead holder's lock alive, and the remedy is to delete
47
+ * `session-mounts.lock` while every process sharing this data directory is
48
+ * stopped.
49
+ */
50
+ /** One process's published claim: the sessions it currently has mounted. */
51
+ export interface SessionMountOwner {
52
+ /** Operating-system process id of the TUI holding these sessions. */
53
+ readonly pid: number;
54
+ /** Epoch ms when this process first published a record (diagnostics). */
55
+ readonly startedAt: number;
56
+ /** Session ids this process has mounted, in no significant order. */
57
+ readonly sessionIds: readonly string[];
58
+ }
59
+ /** Whether a published record was written by THIS process. */
60
+ export declare function ownerIsSelf(owner: SessionMountOwner): boolean;
61
+ /** Why a session cannot be mounted by this process. */
62
+ export type SessionOccupancy = {
63
+ readonly kind: 'free';
64
+ } | {
65
+ readonly kind: 'mine';
66
+ } | {
67
+ readonly kind: 'occupied';
68
+ readonly pid: number;
69
+ };
70
+ /**
71
+ * Why a claim did not succeed.
72
+ *
73
+ * The three cases are kept apart because the caller has to answer them
74
+ * differently: `occupied` names a terminal the user can go close, `busy`
75
+ * names a transient collision worth retrying, and `unavailable` means the
76
+ * occupancy question could not be answered at all. Folding them together is
77
+ * how "we did not manage to check" turns into "there was nothing to check".
78
+ */
79
+ export type MountFailure = {
80
+ readonly ok: false;
81
+ readonly reason: 'occupied';
82
+ readonly holders: readonly number[];
83
+ } | {
84
+ readonly ok: false;
85
+ readonly reason: 'busy';
86
+ } | {
87
+ readonly ok: false;
88
+ readonly reason: 'unavailable';
89
+ readonly detail: string;
90
+ };
91
+ /**
92
+ * Outcome of {@link claimMount}: either this process now owns the session, or
93
+ * a {@link MountFailure} says why it does not.
94
+ *
95
+ * `fresh` says whether the claim is what PUT the session in this process's
96
+ * published set. Claiming a session this process already holds is legal and
97
+ * common (a parked handle, a re-resume, a claim a publisher beat has already
98
+ * mirrored), and the difference matters on the way out: a caller may only give
99
+ * back what it took. Releasing an inherited claim would hand a session this
100
+ * process is still driving to the next peer that asks.
101
+ */
102
+ export type MountClaim = {
103
+ readonly ok: true;
104
+ readonly fresh: boolean;
105
+ } | MountFailure;
106
+ /**
107
+ * Whether a process id is still alive. `process.kill(pid, 0)` sends no signal
108
+ * and throws `ESRCH` when the process is gone; `EPERM` means it exists but is
109
+ * owned by another user, which still counts as alive here.
110
+ */
111
+ export declare function pidAlive(pid: number): boolean;
112
+ /**
113
+ * Read the ledger for DISPLAY, keeping every record the shape check accepts.
114
+ * A missing, empty, truncated or foreign-shaped document reads as an empty
115
+ * ledger, because a screen that cannot read the occupancy table should still
116
+ * paint the sessions it does know about.
117
+ *
118
+ * Never use this to decide whether a session may be mounted: "the read failed"
119
+ * and "nobody holds it" are the same answer here. Authoritative callers use
120
+ * {@link readMountLedgerStrict}.
121
+ */
122
+ export declare function readMountLedger(): readonly SessionMountOwner[];
123
+ /**
124
+ * Outcome of the authoritative read. `unavailable` carries a sentence naming
125
+ * what was wrong, so a refusal can say "cannot verify occupancy" instead of
126
+ * inventing a holder.
127
+ */
128
+ export type MountLedgerRead = {
129
+ readonly ok: true;
130
+ readonly owners: readonly SessionMountOwner[];
131
+ } | {
132
+ readonly ok: false;
133
+ readonly detail: string;
134
+ };
135
+ /**
136
+ * Read the ledger for DECIDING, where "I could not read it" must not pass for
137
+ * "it is empty".
138
+ *
139
+ * Only a missing file is an empty ledger — that is the genuine first run.
140
+ * Everything else (unreadable, malformed JSON, unknown version, a record whose
141
+ * shape does not parse) is `unavailable`, and the caller must refuse. Skipping
142
+ * a bad record and writing the ledger anyway is not an option either: the
143
+ * record that failed to parse may be another writer's only claim, so the safe
144
+ * move is to leave the file exactly as it is and ask the user to repair it.
145
+ */
146
+ export declare function readMountLedgerStrict(): MountLedgerRead;
147
+ /**
148
+ * Which process has each session mounted, considering only owners whose pid is
149
+ * still alive. A session claimed by several live owners keeps the record that
150
+ * started last: the protocol forbids that state, and picking one
151
+ * deterministically beats reporting whichever the file happened to list first.
152
+ */
153
+ export declare function readSessionOwners(): ReadonlyMap<string, SessionMountOwner>;
154
+ /**
155
+ * The occupancy of one session, from THIS process's point of view.
156
+ * @param sessionId - Session id to look up.
157
+ * @param owners - A snapshot from {@link readSessionOwners}, so a screen can
158
+ * resolve a whole listing from one read instead of one per row.
159
+ * @returns `mine` for a self-held session, `occupied` for a foreign one.
160
+ */
161
+ export declare function occupancyOf(sessionId: string, owners: ReadonlyMap<string, SessionMountOwner>): SessionOccupancy;
162
+ /**
163
+ * Publish this process's mounted set. Call at boot, whenever the set changes,
164
+ * and just before teardown, so a peer always reads a current answer without a
165
+ * timer keeping it fresh.
166
+ *
167
+ * The argument is the set the caller can OBSERVE (the live agent roster). Any
168
+ * session with an in-flight operation is added on top, because a claim is
169
+ * published before its agent exists: without that union a beat landing inside
170
+ * a resume would delete the reservation this process just committed.
171
+ * @param sessionIds - The sessions currently mounted (replaces the prior set).
172
+ * @returns True when the ledger was updated.
173
+ */
174
+ export declare function publishMounts(sessionIds: Iterable<string>): boolean;
175
+ /**
176
+ * Claim one session for THIS process, atomically.
177
+ *
178
+ * The occupancy check and the claim have to be one lock-protected step: two
179
+ * processes that each check first and publish second can both observe `free`
180
+ * and both publish, which is exactly the state this ledger exists to prevent.
181
+ * Inside the lock the conflict is re-derived from the file, and a session that
182
+ * is genuinely ours is accepted — a second mount of our own parked handle is
183
+ * not a conflict. When a live PEER holds it, nothing is written.
184
+ *
185
+ * A refusal that cannot name a peer is reported as `busy` (the lock was taken)
186
+ * or `unavailable` (the ledger could not be read or replaced) — never as an
187
+ * empty holder list, because callers have to be able to tell "somebody else
188
+ * has it" from "we could not find out".
189
+ * @param sessionId - Session id to claim.
190
+ * @returns `ok`, or why the session is not ours.
191
+ */
192
+ export declare function claimMount(sessionId: string): MountClaim;
193
+ /**
194
+ * Drop one session from this process's published set. Used when a session is
195
+ * explicitly closed; an ordinary session switch KEEPS its session mounted
196
+ * (that is the point of parking), so most switches do not call this.
197
+ * @param sessionId - Session id to release.
198
+ * @returns True when the ledger was updated.
199
+ */
200
+ export declare function releaseMount(sessionId: string): boolean;
201
+ /**
202
+ * Remove this process's record entirely, so every session it held is
203
+ * immediately mountable by another TUI. Called from the teardown funnel; a
204
+ * crashed process skips this and its record is pruned by the next write
205
+ * instead, which is why both paths must work.
206
+ * @returns True when the ledger was updated.
207
+ */
208
+ export declare function clearOwnMounts(): boolean;
209
+ /**
210
+ * {@link reserveMount} for a session id this process just minted, where a
211
+ * refusal is a loss of ANNOUNCEMENT rather than a conflict.
212
+ *
213
+ * A brand-new id cannot be held by anybody, so a create must not be blocked by
214
+ * a ledger it cannot write — but it still has to be announced before the
215
+ * factory runs, because from the moment the factory returns this process owns
216
+ * the only write handle and the publisher will not name the session until its
217
+ * next beat. A refusal therefore yields a no-op reservation and the caller
218
+ * carries on; `failure` reports what happened so the caller can say so.
219
+ * @param sessionId - Freshly minted session id.
220
+ * @returns A reservation (never a refusal) plus the failure, if any.
221
+ */
222
+ export declare function reserveNewSession(sessionId: string): Promise<{
223
+ readonly reservation: MountReservation;
224
+ readonly failure?: MountFailure;
225
+ }>;
226
+ /**
227
+ * The sessions this process has published, for the diagnostics surface.
228
+ * @returns The ids last handed to {@link publishMounts}.
229
+ */
230
+ export declare function ownMounts(): readonly string[];
231
+ /**
232
+ * {@link claimMount} with a bounded retry for `busy`.
233
+ *
234
+ * `busy` means a peer held the ledger lock for the instant we wanted it, which
235
+ * says nothing about occupancy and is worth waiting out. `occupied` and
236
+ * `unavailable` are answers, not collisions, and are returned immediately.
237
+ * @param sessionId - Session id to claim.
238
+ * @returns The final claim, `busy` only when the whole budget was spent.
239
+ */
240
+ export declare function claimMountWithRetry(sessionId: string): Promise<MountClaim>;
241
+ /**
242
+ * What a caller holds after {@link reserveMount} succeeds.
243
+ *
244
+ * A reservation ends one of two ways, and they are not the same act. `settle`
245
+ * hands the session over to the agent registry — the mount happened, and from
246
+ * then on the publisher derives the set from the roster. `abandon` gives it
247
+ * back — the mount never happened, so nothing may be left claiming it. Both
248
+ * are idempotent, so a `finally` can call either without tracking which.
249
+ */
250
+ export interface MountReservation {
251
+ readonly settle: () => void;
252
+ readonly abandon: () => void;
253
+ }
254
+ /** Outcome of {@link reserveMount}: the reservation, or why there is none. */
255
+ export type MountReservationResult = {
256
+ readonly ok: true;
257
+ readonly reservation: MountReservation;
258
+ } | MountFailure;
259
+ /**
260
+ * Claim `sessionId` and pin it for the WHOLE mount attempt, not just the claim
261
+ * call.
262
+ *
263
+ * Everything that opens a writer goes through here, so that the rules live in
264
+ * one place: the claim is atomic (nothing is opened on a refusal), the pin
265
+ * survives a publisher beat while the agent does not exist yet, and the
266
+ * reservation ends explicitly — `settle` on a commit, `abandon` on every path
267
+ * that does not commit.
268
+ * @param sessionId - Session about to be mounted.
269
+ * @returns The reservation, or the {@link MountFailure} to report back.
270
+ */
271
+ export declare function reserveMount(sessionId: string): Promise<MountReservationResult>;
272
+ //# sourceMappingURL=sessionMounts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessionMounts.d.ts","sourceRoot":"","sources":["../../src/sessionMounts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAwCH,4EAA4E;AAC5E,MAAM,WAAW,iBAAiB;IAChC,qEAAqE;IACrE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,yEAAyE;IACzE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;CACvC;AAED,8DAA8D;AAC9D,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAE7D;AAED,uDAAuD;AACvD,MAAM,MAAM,gBAAgB,GACxB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAA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