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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (427) hide show
  1. package/README.md +50 -20
  2. package/assets/whale-girl/whale-girl-dark.png +0 -0
  3. package/assets/whale-girl/whale-girl-happy.png +0 -0
  4. package/assets/whale-girl/whale-girl.png +0 -0
  5. package/bin/dsh-tui.js +63 -3
  6. package/cordis.patch.yml +39 -17
  7. package/cordis.yml +3 -2
  8. package/lib/settings.json +1272 -0
  9. package/lib/types/adapter/channel/ui-policy.d.ts +9 -2
  10. package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
  11. package/lib/types/adapter/channel/ui-policy.js +13 -0
  12. package/lib/types/adapter/kernel/replay.d.ts.map +1 -1
  13. package/lib/types/adapter/kernel/replay.js +2 -0
  14. package/lib/types/adapter/ports/channel-display.d.ts +12 -0
  15. package/lib/types/adapter/ports/channel-display.d.ts.map +1 -1
  16. package/lib/types/adapter/ports/channel-session.d.ts +38 -0
  17. package/lib/types/adapter/ports/channel-session.d.ts.map +1 -1
  18. package/lib/types/adapter/ports/channel-settings.d.ts +12 -0
  19. package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
  20. package/lib/types/adapter/ports/channel-ui.d.ts +46 -4
  21. package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
  22. package/lib/types/adapter/ports/channel-view.d.ts +43 -0
  23. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  24. package/lib/types/commands.d.ts.map +1 -1
  25. package/lib/types/commands.js +2 -0
  26. package/lib/types/components/BalanceReportRow.d.ts +10 -2
  27. package/lib/types/components/BalanceReportRow.d.ts.map +1 -1
  28. package/lib/types/components/BalanceReportRow.js +18 -4
  29. package/lib/types/components/CompactionStatusRow.d.ts +24 -0
  30. package/lib/types/components/CompactionStatusRow.d.ts.map +1 -0
  31. package/lib/types/components/CompactionStatusRow.js +72 -0
  32. package/lib/types/components/GoalTodoPanel.js +2 -2
  33. package/lib/types/components/HelpMenu.d.ts +2 -2
  34. package/lib/types/components/HelpMenu.d.ts.map +1 -1
  35. package/lib/types/components/HelpMenu.js +5 -4
  36. package/lib/types/components/InlineMathParagraph.d.ts +22 -0
  37. package/lib/types/components/InlineMathParagraph.d.ts.map +1 -0
  38. package/lib/types/components/InlineMathParagraph.js +178 -0
  39. package/lib/types/components/LogoV2.d.ts +41 -3
  40. package/lib/types/components/LogoV2.d.ts.map +1 -1
  41. package/lib/types/components/LogoV2.js +148 -24
  42. package/lib/types/components/Markdown.d.ts +10 -3
  43. package/lib/types/components/Markdown.d.ts.map +1 -1
  44. package/lib/types/components/Markdown.js +47 -14
  45. package/lib/types/components/MathBlock.d.ts +13 -0
  46. package/lib/types/components/MathBlock.d.ts.map +1 -0
  47. package/lib/types/components/MathBlock.js +136 -0
  48. package/lib/types/components/MessageList.d.ts +10 -1
  49. package/lib/types/components/MessageList.d.ts.map +1 -1
  50. package/lib/types/components/MessageList.js +13 -4
  51. package/lib/types/components/MigratePicker.d.ts +30 -0
  52. package/lib/types/components/MigratePicker.d.ts.map +1 -0
  53. package/lib/types/components/MigratePicker.js +38 -0
  54. package/lib/types/components/PromptInput.d.ts +17 -0
  55. package/lib/types/components/PromptInput.d.ts.map +1 -1
  56. package/lib/types/components/PromptInput.js +48 -7
  57. package/lib/types/components/SplitDiffView.d.ts.map +1 -1
  58. package/lib/types/components/SplitDiffView.js +2 -1
  59. package/lib/types/components/StarPrompt.d.ts +53 -0
  60. package/lib/types/components/StarPrompt.d.ts.map +1 -0
  61. package/lib/types/components/StarPrompt.js +281 -0
  62. package/lib/types/components/StreamingMarkdown.d.ts.map +1 -1
  63. package/lib/types/components/StreamingMarkdown.js +20 -3
  64. package/lib/types/components/TimelineRail.d.ts.map +1 -1
  65. package/lib/types/components/TimelineRail.js +9 -1
  66. package/lib/types/components/Whale.d.ts +17 -8
  67. package/lib/types/components/Whale.d.ts.map +1 -1
  68. package/lib/types/components/Whale.js +25 -15
  69. package/lib/types/components/WhaleGirl.d.ts +29 -0
  70. package/lib/types/components/WhaleGirl.d.ts.map +1 -0
  71. package/lib/types/components/WhaleGirl.js +32 -0
  72. package/lib/types/components/WorkingSpinner.d.ts +4 -1
  73. package/lib/types/components/WorkingSpinner.d.ts.map +1 -1
  74. package/lib/types/components/WorkingSpinner.js +2 -2
  75. package/lib/types/components/bigfont.d.ts +47 -18
  76. package/lib/types/components/bigfont.d.ts.map +1 -1
  77. package/lib/types/components/bigfont.js +55 -40
  78. package/lib/types/components/design-system/ThemeProvider.d.ts +6 -0
  79. package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -1
  80. package/lib/types/components/design-system/ThemeProvider.js +40 -1
  81. package/lib/types/components/maidPortrait.d.ts +44 -0
  82. package/lib/types/components/maidPortrait.d.ts.map +1 -0
  83. package/lib/types/components/maidPortrait.js +178 -0
  84. package/lib/types/components/mathPreview.d.ts +25 -0
  85. package/lib/types/components/mathPreview.d.ts.map +1 -0
  86. package/lib/types/components/mathPreview.js +48 -0
  87. package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
  88. package/lib/types/components/messages/AssistantThinkingMessage.js +2 -1
  89. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  90. package/lib/types/components/messages/AssistantToolUseMessage.js +3 -2
  91. package/lib/types/components/messages/TranscriptImages.d.ts.map +1 -1
  92. package/lib/types/components/messages/TranscriptImages.js +11 -1
  93. package/lib/types/components/questions/AskUserQuestionPanel.d.ts +14 -2
  94. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
  95. package/lib/types/components/questions/AskUserQuestionPanel.js +80 -38
  96. package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
  97. package/lib/types/components/questions/PlanReviewPanel.js +3 -3
  98. package/lib/types/components/sessions/ForeignSessionRow.d.ts +34 -0
  99. package/lib/types/components/sessions/ForeignSessionRow.d.ts.map +1 -0
  100. package/lib/types/components/sessions/ForeignSessionRow.js +43 -0
  101. package/lib/types/components/sessions/SourceTabs.d.ts +52 -0
  102. package/lib/types/components/sessions/SourceTabs.d.ts.map +1 -0
  103. package/lib/types/components/sessions/SourceTabs.js +70 -0
  104. package/lib/types/components/splashEggs.d.ts +56 -0
  105. package/lib/types/components/splashEggs.d.ts.map +1 -0
  106. package/lib/types/components/splashEggs.js +67 -0
  107. package/lib/types/components/splashFonts.d.ts +119 -0
  108. package/lib/types/components/splashFonts.d.ts.map +1 -0
  109. package/lib/types/components/splashFonts.js +267 -0
  110. package/lib/types/components/splashLayout.d.ts +41 -0
  111. package/lib/types/components/splashLayout.d.ts.map +1 -0
  112. package/lib/types/components/splashLayout.js +40 -0
  113. package/lib/types/components/whaleGirlSprite.d.ts +17 -0
  114. package/lib/types/components/whaleGirlSprite.d.ts.map +1 -0
  115. package/lib/types/components/whaleGirlSprite.js +47 -0
  116. package/lib/types/deepseekPricing.d.ts +74 -0
  117. package/lib/types/deepseekPricing.d.ts.map +1 -1
  118. package/lib/types/deepseekPricing.js +110 -11
  119. package/lib/types/dsh-adapter/channel/action-readiness.d.ts +1 -1
  120. package/lib/types/dsh-adapter/channel/action-readiness.d.ts.map +1 -1
  121. package/lib/types/dsh-adapter/channel/action-readiness.js +6 -1
  122. package/lib/types/dsh-adapter/channel/background-action.d.ts +1 -0
  123. package/lib/types/dsh-adapter/channel/background-action.d.ts.map +1 -1
  124. package/lib/types/dsh-adapter/channel/background-action.js +1 -0
  125. package/lib/types/dsh-adapter/channel/binding-events.d.ts +8 -9
  126. package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
  127. package/lib/types/dsh-adapter/channel/binding-events.js +69 -21
  128. package/lib/types/dsh-adapter/channel/compaction.d.ts +2 -1
  129. package/lib/types/dsh-adapter/channel/compaction.d.ts.map +1 -1
  130. package/lib/types/dsh-adapter/channel/compaction.js +35 -2
  131. package/lib/types/dsh-adapter/channel/local-actions.d.ts.map +1 -1
  132. package/lib/types/dsh-adapter/channel/local-actions.js +6 -1
  133. package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
  134. package/lib/types/dsh-adapter/channel/model-switch.js +5 -1
  135. package/lib/types/dsh-adapter/channel/paths.d.ts.map +1 -1
  136. package/lib/types/dsh-adapter/channel/paths.js +7 -1
  137. package/lib/types/dsh-adapter/channel/preferences.d.ts +1 -1
  138. package/lib/types/dsh-adapter/channel/preferences.d.ts.map +1 -1
  139. package/lib/types/dsh-adapter/channel/preferences.js +16 -0
  140. package/lib/types/dsh-adapter/channel/projection.d.ts +1 -2
  141. package/lib/types/dsh-adapter/channel/projection.d.ts.map +1 -1
  142. package/lib/types/dsh-adapter/channel/projection.js +127 -17
  143. package/lib/types/dsh-adapter/channel/question-record.d.ts +76 -0
  144. package/lib/types/dsh-adapter/channel/question-record.d.ts.map +1 -0
  145. package/lib/types/dsh-adapter/channel/question-record.js +107 -0
  146. package/lib/types/dsh-adapter/channel/session-lineage.d.ts +42 -0
  147. package/lib/types/dsh-adapter/channel/session-lineage.d.ts.map +1 -0
  148. package/lib/types/dsh-adapter/channel/session-lineage.js +51 -0
  149. package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +2 -0
  150. package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -1
  151. package/lib/types/dsh-adapter/channel/session-live-adoption.js +9 -3
  152. package/lib/types/dsh-adapter/channel/session-metadata.d.ts +2 -1
  153. package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
  154. package/lib/types/dsh-adapter/channel/session-metadata.js +39 -7
  155. package/lib/types/dsh-adapter/channel/session-reset.d.ts +1 -1
  156. package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
  157. package/lib/types/dsh-adapter/channel/session-reset.js +7 -0
  158. package/lib/types/dsh-adapter/channel/session-resume.d.ts +1 -0
  159. package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
  160. package/lib/types/dsh-adapter/channel/session-resume.js +4 -2
  161. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
  162. package/lib/types/dsh-adapter/channel/settings-host.js +8 -0
  163. package/lib/types/dsh-adapter/channel/state.d.ts +14 -1
  164. package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
  165. package/lib/types/dsh-adapter/channel/state.js +6 -1
  166. package/lib/types/dsh-adapter/channel/subagent-projection.d.ts +30 -35
  167. package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
  168. package/lib/types/dsh-adapter/channel/subagent-projection.js +138 -4
  169. package/lib/types/dsh-adapter/channel/types.d.ts +1 -1
  170. package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
  171. package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
  172. package/lib/types/dsh-adapter/channel.js +19 -4
  173. package/lib/types/dsh-adapter/compat/messages.d.ts +6 -0
  174. package/lib/types/dsh-adapter/compat/messages.d.ts.map +1 -1
  175. package/lib/types/dsh-adapter/compat/messages.js +9 -0
  176. package/lib/types/dsh-adapter/contract.d.ts +5 -5
  177. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  178. package/lib/types/dsh-adapter/contract.js +8 -6
  179. package/lib/types/dsh-adapter/index.d.ts +36 -1
  180. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  181. package/lib/types/dsh-adapter/index.js +22 -6
  182. package/lib/types/dsh-adapter/migrate/adapters/claude-code.d.ts +3 -0
  183. package/lib/types/dsh-adapter/migrate/adapters/claude-code.d.ts.map +1 -0
  184. package/lib/types/dsh-adapter/migrate/adapters/claude-code.js +131 -0
  185. package/lib/types/dsh-adapter/migrate/adapters/claude-code.parse.d.ts +17 -0
  186. package/lib/types/dsh-adapter/migrate/adapters/claude-code.parse.d.ts.map +1 -0
  187. package/lib/types/dsh-adapter/migrate/adapters/claude-code.parse.js +329 -0
  188. package/lib/types/dsh-adapter/migrate/adapters/codex.d.ts +3 -0
  189. package/lib/types/dsh-adapter/migrate/adapters/codex.d.ts.map +1 -0
  190. package/lib/types/dsh-adapter/migrate/adapters/codex.js +102 -0
  191. package/lib/types/dsh-adapter/migrate/adapters/codex.parse.d.ts +16 -0
  192. package/lib/types/dsh-adapter/migrate/adapters/codex.parse.d.ts.map +1 -0
  193. package/lib/types/dsh-adapter/migrate/adapters/codex.parse.js +289 -0
  194. package/lib/types/dsh-adapter/migrate/adapters/grok-build.d.ts +3 -0
  195. package/lib/types/dsh-adapter/migrate/adapters/grok-build.d.ts.map +1 -0
  196. package/lib/types/dsh-adapter/migrate/adapters/grok-build.js +117 -0
  197. package/lib/types/dsh-adapter/migrate/adapters/grok-build.parse.d.ts +13 -0
  198. package/lib/types/dsh-adapter/migrate/adapters/grok-build.parse.d.ts.map +1 -0
  199. package/lib/types/dsh-adapter/migrate/adapters/grok-build.parse.js +178 -0
  200. package/lib/types/dsh-adapter/migrate/adapters/omp.d.ts +3 -0
  201. package/lib/types/dsh-adapter/migrate/adapters/omp.d.ts.map +1 -0
  202. package/lib/types/dsh-adapter/migrate/adapters/omp.js +133 -0
  203. package/lib/types/dsh-adapter/migrate/adapters/scan-fs.d.ts +60 -0
  204. package/lib/types/dsh-adapter/migrate/adapters/scan-fs.d.ts.map +1 -0
  205. package/lib/types/dsh-adapter/migrate/adapters/scan-fs.js +178 -0
  206. package/lib/types/dsh-adapter/migrate/adapters/scan.d.ts +8 -0
  207. package/lib/types/dsh-adapter/migrate/adapters/scan.d.ts.map +1 -0
  208. package/lib/types/dsh-adapter/migrate/adapters/scan.js +40 -0
  209. package/lib/types/dsh-adapter/migrate/adapters/zcode.d.ts +3 -0
  210. package/lib/types/dsh-adapter/migrate/adapters/zcode.d.ts.map +1 -0
  211. package/lib/types/dsh-adapter/migrate/adapters/zcode.js +93 -0
  212. package/lib/types/dsh-adapter/migrate/adapters/zcode.parse.d.ts +9 -0
  213. package/lib/types/dsh-adapter/migrate/adapters/zcode.parse.d.ts.map +1 -0
  214. package/lib/types/dsh-adapter/migrate/adapters/zcode.parse.js +89 -0
  215. package/lib/types/dsh-adapter/migrate/bin-path.d.ts +6 -0
  216. package/lib/types/dsh-adapter/migrate/bin-path.d.ts.map +1 -0
  217. package/lib/types/dsh-adapter/migrate/bin-path.js +30 -0
  218. package/lib/types/dsh-adapter/migrate/browse.d.ts +42 -0
  219. package/lib/types/dsh-adapter/migrate/browse.d.ts.map +1 -0
  220. package/lib/types/dsh-adapter/migrate/browse.js +90 -0
  221. package/lib/types/dsh-adapter/migrate/cli.d.ts +9 -0
  222. package/lib/types/dsh-adapter/migrate/cli.d.ts.map +1 -0
  223. package/lib/types/dsh-adapter/migrate/cli.js +106 -0
  224. package/lib/types/dsh-adapter/migrate/import-one.d.ts +89 -0
  225. package/lib/types/dsh-adapter/migrate/import-one.d.ts.map +1 -0
  226. package/lib/types/dsh-adapter/migrate/import-one.js +133 -0
  227. package/lib/types/dsh-adapter/migrate/index.d.ts +35 -0
  228. package/lib/types/dsh-adapter/migrate/index.d.ts.map +1 -0
  229. package/lib/types/dsh-adapter/migrate/index.js +107 -0
  230. package/lib/types/dsh-adapter/migrate/parse/injection.d.ts +40 -0
  231. package/lib/types/dsh-adapter/migrate/parse/injection.d.ts.map +1 -0
  232. package/lib/types/dsh-adapter/migrate/parse/injection.js +127 -0
  233. package/lib/types/dsh-adapter/migrate/parse/jsonl.d.ts +28 -0
  234. package/lib/types/dsh-adapter/migrate/parse/jsonl.d.ts.map +1 -0
  235. package/lib/types/dsh-adapter/migrate/parse/jsonl.js +40 -0
  236. package/lib/types/dsh-adapter/migrate/parse/role-turns.d.ts +28 -0
  237. package/lib/types/dsh-adapter/migrate/parse/role-turns.d.ts.map +1 -0
  238. package/lib/types/dsh-adapter/migrate/parse/role-turns.js +50 -0
  239. package/lib/types/dsh-adapter/migrate/parse/title.d.ts +18 -0
  240. package/lib/types/dsh-adapter/migrate/parse/title.d.ts.map +1 -0
  241. package/lib/types/dsh-adapter/migrate/parse/title.js +29 -0
  242. package/lib/types/dsh-adapter/migrate/parse/tools.d.ts +62 -0
  243. package/lib/types/dsh-adapter/migrate/parse/tools.d.ts.map +1 -0
  244. package/lib/types/dsh-adapter/migrate/parse/tools.js +110 -0
  245. package/lib/types/dsh-adapter/migrate/picker.d.ts +64 -0
  246. package/lib/types/dsh-adapter/migrate/picker.d.ts.map +1 -0
  247. package/lib/types/dsh-adapter/migrate/picker.js +86 -0
  248. package/lib/types/dsh-adapter/migrate/recent-agents.d.ts +40 -0
  249. package/lib/types/dsh-adapter/migrate/recent-agents.d.ts.map +1 -0
  250. package/lib/types/dsh-adapter/migrate/recent-agents.js +100 -0
  251. package/lib/types/dsh-adapter/migrate/sessionize.d.ts +39 -0
  252. package/lib/types/dsh-adapter/migrate/sessionize.d.ts.map +1 -0
  253. package/lib/types/dsh-adapter/migrate/sessionize.js +271 -0
  254. package/lib/types/dsh-adapter/migrate/types.d.ts +176 -0
  255. package/lib/types/dsh-adapter/migrate/types.d.ts.map +1 -0
  256. package/lib/types/dsh-adapter/migrate/types.js +11 -0
  257. package/lib/types/dsh-adapter/migrate/uuid.d.ts +7 -0
  258. package/lib/types/dsh-adapter/migrate/uuid.d.ts.map +1 -0
  259. package/lib/types/dsh-adapter/migrate/uuid.js +25 -0
  260. package/lib/types/dsh-adapter/plugin.d.ts +4 -2
  261. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  262. package/lib/types/dsh-adapter/plugin.js +143 -364
  263. package/lib/types/dsh-adapter/providerWizard.d.ts +17 -0
  264. package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
  265. package/lib/types/dsh-adapter/providerWizard.js +254 -66
  266. package/lib/types/dsh-adapter/questions.d.ts +22 -15
  267. package/lib/types/dsh-adapter/questions.d.ts.map +1 -1
  268. package/lib/types/dsh-adapter/questions.js +47 -45
  269. package/lib/types/dsh-adapter/sessions/digest.d.ts +11 -6
  270. package/lib/types/dsh-adapter/sessions/digest.d.ts.map +1 -1
  271. package/lib/types/dsh-adapter/sessions/digest.js +20 -13
  272. package/lib/types/dsh-adapter/sessions/frames.d.ts +3 -1
  273. package/lib/types/dsh-adapter/sessions/frames.d.ts.map +1 -1
  274. package/lib/types/dsh-adapter/sessions/frames.js +5 -4
  275. package/lib/types/dsh-adapter/sessions/list.d.ts +6 -1
  276. package/lib/types/dsh-adapter/sessions/list.d.ts.map +1 -1
  277. package/lib/types/dsh-adapter/sessions/list.js +188 -164
  278. package/lib/types/dsh-adapter/sessions/recovery.d.ts +16 -0
  279. package/lib/types/dsh-adapter/sessions/recovery.d.ts.map +1 -0
  280. package/lib/types/dsh-adapter/sessions/recovery.js +108 -0
  281. package/lib/types/dsh-adapter/sessions/snapshot.d.ts +7 -0
  282. package/lib/types/dsh-adapter/sessions/snapshot.d.ts.map +1 -0
  283. package/lib/types/dsh-adapter/sessions/snapshot.js +90 -0
  284. package/lib/types/dsh-adapter/sessions/store.d.ts +10 -4
  285. package/lib/types/dsh-adapter/sessions/store.d.ts.map +1 -1
  286. package/lib/types/dsh-adapter/sessions/store.js +62 -25
  287. package/lib/types/dsh-adapter/sideQuestion.d.ts +41 -2
  288. package/lib/types/dsh-adapter/sideQuestion.d.ts.map +1 -1
  289. package/lib/types/dsh-adapter/sideQuestion.js +98 -2
  290. package/lib/types/dsh-adapter/subagents.d.ts +28 -3
  291. package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
  292. package/lib/types/dsh-adapter/subagents.js +77 -2
  293. package/lib/types/herdr.d.ts +2 -0
  294. package/lib/types/herdr.d.ts.map +1 -1
  295. package/lib/types/herdr.js +9 -3
  296. package/lib/types/i18n.d.ts +424 -42
  297. package/lib/types/i18n.d.ts.map +1 -1
  298. package/lib/types/i18n.js +145 -20
  299. package/lib/types/ink/components/App.d.ts +2 -2
  300. package/lib/types/ink/components/App.d.ts.map +1 -1
  301. package/lib/types/ink/components/App.js +5 -1
  302. package/lib/types/ink/components/Image.d.ts +14 -1
  303. package/lib/types/ink/components/Image.d.ts.map +1 -1
  304. package/lib/types/ink/components/Image.js +2 -2
  305. package/lib/types/ink/events/input-event.js +3 -3
  306. package/lib/types/ink/hooks/use-terminal-images.d.ts +12 -0
  307. package/lib/types/ink/hooks/use-terminal-images.d.ts.map +1 -1
  308. package/lib/types/ink/hooks/use-terminal-images.js +13 -0
  309. package/lib/types/ink/ink.d.ts +6 -0
  310. package/lib/types/ink/ink.d.ts.map +1 -1
  311. package/lib/types/ink/ink.js +16 -1
  312. package/lib/types/ink/kitty-graphics.d.ts +44 -3
  313. package/lib/types/ink/kitty-graphics.d.ts.map +1 -1
  314. package/lib/types/ink/kitty-graphics.js +184 -23
  315. package/lib/types/ink/output.d.ts +24 -2
  316. package/lib/types/ink/output.d.ts.map +1 -1
  317. package/lib/types/ink/output.js +83 -5
  318. package/lib/types/ink/parse-keypress.d.ts +26 -1
  319. package/lib/types/ink/parse-keypress.d.ts.map +1 -1
  320. package/lib/types/ink/parse-keypress.js +156 -13
  321. package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
  322. package/lib/types/ink/render-node-to-output.js +8 -1
  323. package/lib/types/ink/screen.d.ts +24 -0
  324. package/lib/types/ink/screen.d.ts.map +1 -1
  325. package/lib/types/ink/screen.js +89 -0
  326. package/lib/types/ink/selection.d.ts +40 -18
  327. package/lib/types/ink/selection.d.ts.map +1 -1
  328. package/lib/types/ink/selection.js +142 -30
  329. package/lib/types/ink/sixel-codec.d.ts +12 -1
  330. package/lib/types/ink/sixel-codec.d.ts.map +1 -1
  331. package/lib/types/ink/sixel-codec.js +29 -5
  332. package/lib/types/ink/sixel-graphics.d.ts.map +1 -1
  333. package/lib/types/ink/sixel-graphics.js +5 -3
  334. package/lib/types/ink/styles.d.ts +9 -0
  335. package/lib/types/ink/styles.d.ts.map +1 -1
  336. package/lib/types/ink/terminal-image.d.ts +8 -0
  337. package/lib/types/ink/terminal-image.d.ts.map +1 -1
  338. package/lib/types/ink/terminal-querier.d.ts +7 -1
  339. package/lib/types/ink/terminal-querier.d.ts.map +1 -1
  340. package/lib/types/ink/terminal-querier.js +12 -2
  341. package/lib/types/ink/timeline-rail.d.ts +5 -0
  342. package/lib/types/ink/timeline-rail.d.ts.map +1 -1
  343. package/lib/types/math/inline-layout.d.ts +29 -0
  344. package/lib/types/math/inline-layout.d.ts.map +1 -0
  345. package/lib/types/math/inline-layout.js +106 -0
  346. package/lib/types/math/layout.d.ts +58 -0
  347. package/lib/types/math/layout.d.ts.map +1 -0
  348. package/lib/types/math/layout.js +59 -0
  349. package/lib/types/math/renderer.d.ts +64 -0
  350. package/lib/types/math/renderer.d.ts.map +1 -0
  351. package/lib/types/math/renderer.js +256 -0
  352. package/lib/types/screens/Chat.d.ts +14 -1
  353. package/lib/types/screens/Chat.d.ts.map +1 -1
  354. package/lib/types/screens/Chat.js +606 -53
  355. package/lib/types/screens/SessionSupervisor.d.ts +2 -1
  356. package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
  357. package/lib/types/screens/SessionSupervisor.js +156 -19
  358. package/lib/types/screens/Settings.d.ts.map +1 -1
  359. package/lib/types/screens/Settings.js +49 -11
  360. package/lib/types/screens/StatusLine.d.ts.map +1 -1
  361. package/lib/types/screens/StatusLine.js +45 -15
  362. package/lib/types/screens/chatOverlay.d.ts +5 -0
  363. package/lib/types/screens/chatOverlay.d.ts.map +1 -1
  364. package/lib/types/screens/chatOverlay.js +1 -0
  365. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts +47 -0
  366. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -0
  367. package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +65 -0
  368. package/lib/types/screens/sessionSupervisor/model.d.ts +12 -0
  369. package/lib/types/screens/sessionSupervisor/model.d.ts.map +1 -1
  370. package/lib/types/screens/sessionSupervisor/model.js +26 -0
  371. package/lib/types/screens/sessionSupervisor/useForeignSessions.d.ts +107 -0
  372. package/lib/types/screens/sessionSupervisor/useForeignSessions.d.ts.map +1 -0
  373. package/lib/types/screens/sessionSupervisor/useForeignSessions.js +312 -0
  374. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +4 -1
  375. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -1
  376. package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +97 -14
  377. package/lib/types/sessionHistory.d.ts +2 -2
  378. package/lib/types/sessionHistory.d.ts.map +1 -1
  379. package/lib/types/sessionHistory.js +31 -5
  380. package/lib/types/settings/definitions.d.ts +681 -0
  381. package/lib/types/settings/definitions.d.ts.map +1 -0
  382. package/lib/types/settings/definitions.js +511 -0
  383. package/lib/types/starAction.d.ts +44 -0
  384. package/lib/types/starAction.d.ts.map +1 -0
  385. package/lib/types/starAction.js +52 -0
  386. package/lib/types/terminal-utils/latex.d.ts +10 -0
  387. package/lib/types/terminal-utils/latex.d.ts.map +1 -0
  388. package/lib/types/terminal-utils/latex.js +1417 -0
  389. package/lib/types/terminal-utils/markdown.d.ts +3 -1
  390. package/lib/types/terminal-utils/markdown.d.ts.map +1 -1
  391. package/lib/types/terminal-utils/markdown.js +26 -1
  392. package/lib/types/terminal-utils/math.d.ts +66 -0
  393. package/lib/types/terminal-utils/math.d.ts.map +1 -0
  394. package/lib/types/terminal-utils/math.js +337 -0
  395. package/lib/types/tips.d.ts.map +1 -1
  396. package/lib/types/tips.js +6 -0
  397. package/lib/types/tuiDisplayPrefs.d.ts +67 -0
  398. package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
  399. package/lib/types/tuiDisplayPrefs.js +59 -0
  400. package/lib/types/ui.d.ts +1 -1
  401. package/lib/types/ui.d.ts.map +1 -1
  402. package/lib/types/ui.js +1 -1
  403. package/lib/types/usageStats.d.ts +98 -0
  404. package/lib/types/usageStats.d.ts.map +1 -0
  405. package/lib/types/usageStats.js +169 -0
  406. package/lib/types/utils/bmp.d.ts +17 -0
  407. package/lib/types/utils/bmp.d.ts.map +1 -0
  408. package/lib/types/utils/bmp.js +154 -0
  409. package/lib/types/utils/clipboard.d.ts +14 -2
  410. package/lib/types/utils/clipboard.d.ts.map +1 -1
  411. package/lib/types/utils/clipboard.js +143 -8
  412. package/lib/types/utils/fold-long-lines.d.ts.map +1 -1
  413. package/lib/types/utils/fold-long-lines.js +2 -1
  414. package/lib/types/utils/keymap.d.ts +4 -1
  415. package/lib/types/utils/keymap.d.ts.map +1 -1
  416. package/lib/types/utils/keymap.js +8 -0
  417. package/lib/types/utils/modifiers.d.ts +4 -3
  418. package/lib/types/utils/modifiers.d.ts.map +1 -1
  419. package/lib/types/utils/modifiers.js +4 -3
  420. package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/LICENSE +202 -0
  421. package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/NOTICE +20 -0
  422. package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/index.d.ts +16 -0
  423. package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/lib/bundled-packages.json +4 -0
  424. package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/lib/index.mjs +20 -0
  425. package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/lib/index.mjs.LEGAL.txt +35 -0
  426. package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/package.json +29 -0
  427. package/package.json +111 -97
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Answered-questionnaire transcript record — a PURE fold of the durable
3
+ * session log (issue #1009).
4
+ *
5
+ * `ask_user_question` renders as the interactive panel, not as a tool card,
6
+ * so its `tool/result` had no renderer at all: the answers lived only in the
7
+ * current process's view rows (the TUI used to push a summary when the panel
8
+ * closed). That violated the transcript's source-of-truth rule — `/resume`,
9
+ * rewind, `loadOlder` and any replay lost the record, and an ask that was
10
+ * never observed closing produced none at all.
11
+ *
12
+ * The record now derives from the same log every other transcript row comes
13
+ * from: the `tool/call` arguments carry the questions, the `tool/result`
14
+ * payload carries the answers. Both are parsed at the caller's edge here, so
15
+ * this module stays pure (no store, no i18n state, no projection imports) and
16
+ * is directly testable.
17
+ */
18
+ import { t } from '../../i18n.js';
19
+ /** Truncate a long answer line for the transcript summary. */
20
+ function clip(text, max = 140) {
21
+ if (text.length <= max)
22
+ return text;
23
+ return `${text.slice(0, max)}…`;
24
+ }
25
+ /**
26
+ * Fold one answered questionnaire into its transcript record.
27
+ *
28
+ * Tolerant by contract: the projection calls this on durable replay data it
29
+ * does not control (truncated logs, older hosts, a wizard-shaped caller), and
30
+ * a throw inside `renderEvent` would abort the whole transcript fold. So a
31
+ * missing/garbled question list or answer item degrades to a shorter line
32
+ * instead of raising.
33
+ *
34
+ * @param questions - The ask's questions, in the order they were answered.
35
+ * @param answers - The answers the log recorded for that same ask.
36
+ * @param options - `redact` masks answer text (local wizards collecting
37
+ * secrets such as API keys must never leak into the transcript or an
38
+ * `/export` dump); the model-side ask never sets it.
39
+ * @returns The title line plus its `· question → choice` body lines.
40
+ */
41
+ export function buildQuestionRecord(questions, answers, options) {
42
+ const list = questions ?? [];
43
+ const lines = list.flatMap((question, index) => {
44
+ const answer = answers?.[index];
45
+ if (question === undefined || question === null || answer === undefined || answer === null)
46
+ return [];
47
+ // The question text comes from durable args too — a garbled entry must
48
+ // not turn into the string "undefined" in the transcript.
49
+ const prompt = typeof question.question === 'string' ? question.question : '';
50
+ const selected = Array.isArray(answer.selected) ? answer.selected : [];
51
+ if (prompt === '' && selected.length === 0 && (answer.custom ?? '') === '')
52
+ return [];
53
+ const text = options?.redact === true
54
+ ? '••••••'
55
+ : (() => {
56
+ const labels = selected.join('、');
57
+ const custom = answer.custom ?? '';
58
+ return custom !== ''
59
+ ? labels === '' ? custom : `${labels}:${custom}`
60
+ : labels;
61
+ })();
62
+ return `· ${prompt} → ${clip(text)}`;
63
+ });
64
+ return {
65
+ title: t('questionnaire-answered', { total: list.length }),
66
+ lines,
67
+ };
68
+ }
69
+ /**
70
+ * Parse the questions out of a persisted `ask_user_question` `tool/call`
71
+ * arguments string. Returns `undefined` when the payload is not the
72
+ * `{ questions: [...] }` object the tool declares, so the caller can fall
73
+ * back to a title-only record.
74
+ */
75
+ export function parseQuestionRecordQuestions(rawArguments) {
76
+ try {
77
+ const parsed = JSON.parse(rawArguments ?? '');
78
+ if (typeof parsed !== 'object' || parsed === null)
79
+ return undefined;
80
+ const questions = parsed.questions;
81
+ return Array.isArray(questions) ? questions : undefined;
82
+ }
83
+ catch {
84
+ // Unparseable arguments are historical/foreign data, not a program bug:
85
+ // degrade to a title-only record rather than aborting the transcript fold.
86
+ return undefined;
87
+ }
88
+ }
89
+ /**
90
+ * Parse the answers out of a `tool/result` text payload. `dsh-tool-ask-user`
91
+ * renders its output as one JSON text block — the same bytes the model reads
92
+ * back — so the durable log is a sufficient source. A failed ask (or any
93
+ * non-JSON body) yields `undefined`: the caller then renders the log's own
94
+ * error text instead of fabricating an answer.
95
+ */
96
+ export function parseQuestionRecordAnswers(rawResult) {
97
+ try {
98
+ const parsed = JSON.parse(rawResult);
99
+ if (typeof parsed !== 'object' || parsed === null)
100
+ return undefined;
101
+ const answers = parsed.answers;
102
+ return Array.isArray(answers) ? answers : undefined;
103
+ }
104
+ catch {
105
+ return undefined;
106
+ }
107
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Lineage decision consulted by `/model` only.
3
+ *
4
+ * `/rewind` and the `/tree` branch also re-create the live session as a child,
5
+ * but they always record `parentSession` and do not call this helper. A blank
6
+ * log cannot reach them (`boundary < 0`). This module is not their gate.
7
+ *
8
+ * The decision is load-bearing beyond grouping. Upstream's automatic session
9
+ * title only ever runs on a session WITHOUT a parent: `dsh-session-title`
10
+ * schedules its provider on the first human message under
11
+ * `session.header.parentSession === undefined`, and a session that already has
12
+ * one is never offered a generated title again — a fork keeps the title it
13
+ * inherited, and only an explicit `ctx.sessionTitle.refresh()` retries, which
14
+ * no TUI surface calls. A route switch on a session nobody has typed into
15
+ * would therefore cost that user the title of their first real prompt, leaving
16
+ * the deterministic fallback instead (a mid-word truncation of the prompt at
17
+ * `fallbackMaxBytes`).
18
+ *
19
+ * A session with no human message has no conversation for the lineage to
20
+ * describe, so its replacement stands as its own root — the same independent-
21
+ * conversation choice `/fork` already makes (`session-fork.ts`), for the same
22
+ * reason. The seeded prefix is unaffected either way: the child still inherits
23
+ * the source's session scaffolding verbatim.
24
+ *
25
+ * @module
26
+ */
27
+ import type { SessionEvent } from '@deepseek-ai/dsh-session';
28
+ /**
29
+ * Whether a re-created child must record the session it replaces as its parent.
30
+ *
31
+ * A `user/message` whose `source` is the person at the keyboard is a human turn
32
+ * whether or not it carries text (an image-only prompt is still a prompt), so
33
+ * its session is a conversation the lineage must describe. A user-role message
34
+ * from any other producer — a plugin injection, an instruction snapshot, a
35
+ * skill catalogue — is not: the child stays in the same family rather than
36
+ * being promoted to a root on a technicality.
37
+ *
38
+ * @param seed - the exact events the child inherits.
39
+ * @returns whether the child records `parentSession`.
40
+ */
41
+ export declare function childRecordsLineage(seed: readonly SessionEvent[]): boolean;
42
+ //# sourceMappingURL=session-lineage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-lineage.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-lineage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE5D;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,YAAY,EAAE,GAAG,OAAO,CAE1E"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Lineage decision consulted by `/model` only.
3
+ *
4
+ * `/rewind` and the `/tree` branch also re-create the live session as a child,
5
+ * but they always record `parentSession` and do not call this helper. A blank
6
+ * log cannot reach them (`boundary < 0`). This module is not their gate.
7
+ *
8
+ * The decision is load-bearing beyond grouping. Upstream's automatic session
9
+ * title only ever runs on a session WITHOUT a parent: `dsh-session-title`
10
+ * schedules its provider on the first human message under
11
+ * `session.header.parentSession === undefined`, and a session that already has
12
+ * one is never offered a generated title again — a fork keeps the title it
13
+ * inherited, and only an explicit `ctx.sessionTitle.refresh()` retries, which
14
+ * no TUI surface calls. A route switch on a session nobody has typed into
15
+ * would therefore cost that user the title of their first real prompt, leaving
16
+ * the deterministic fallback instead (a mid-word truncation of the prompt at
17
+ * `fallbackMaxBytes`).
18
+ *
19
+ * A session with no human message has no conversation for the lineage to
20
+ * describe, so its replacement stands as its own root — the same independent-
21
+ * conversation choice `/fork` already makes (`session-fork.ts`), for the same
22
+ * reason. The seeded prefix is unaffected either way: the child still inherits
23
+ * the source's session scaffolding verbatim.
24
+ *
25
+ * @module
26
+ */
27
+ /**
28
+ * Whether a re-created child must record the session it replaces as its parent.
29
+ *
30
+ * A `user/message` whose `source` is the person at the keyboard is a human turn
31
+ * whether or not it carries text (an image-only prompt is still a prompt), so
32
+ * its session is a conversation the lineage must describe. A user-role message
33
+ * from any other producer — a plugin injection, an instruction snapshot, a
34
+ * skill catalogue — is not: the child stays in the same family rather than
35
+ * being promoted to a root on a technicality.
36
+ *
37
+ * @param seed - the exact events the child inherits.
38
+ * @returns whether the child records `parentSession`.
39
+ */
40
+ export function childRecordsLineage(seed) {
41
+ return seed.some(isHumanMessage);
42
+ }
43
+ /** One message the person at the keyboard sent, by `source.kind` alone. */
44
+ function isHumanMessage(event) {
45
+ if (event.type !== 'user/message')
46
+ return false;
47
+ // Durable data: the source is a merge-extensible sum type whose members are
48
+ // declared by their producers, so narrow instead of trusting the union.
49
+ const source = event.data.source;
50
+ return source?.kind === 'user';
51
+ }
@@ -13,6 +13,8 @@ export declare function createLiveAgentAdoption(state: LiveAdoptionState, deps:
13
13
  };
14
14
  resetProjector(): void;
15
15
  resetSubagents(): void;
16
+ restoreSubagents(agent: Agent): void;
17
+ parkSubagents(agent: Agent): void;
16
18
  resetJobs(): void;
17
19
  replay(events: readonly import('@deepseek-ai/dsh-session').SessionEvent[]): void;
18
20
  settleReplay(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"session-live-adoption.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-live-adoption.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK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,IAAI,CAAA;IACvB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,iBAAiB,IAAI,IAAI,CAAA;IACzB;6CACyC;IACzC,iBAAiB,IAAI,IAAI,CAAA;IACzB,qBAAqB,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7F,eAAe,IAAI,IAAI,CAAA;CACxB,IAEa,QAAQ,KAAK,KAAG,OAAO,CAAC,YAAY,CAAC,CA0DpD"}
1
+ {"version":3,"file":"session-live-adoption.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-live-adoption.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAMhE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE5D,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACtD,KAAK,iBAAiB,GAAG,IAAI,CAC3B,YAAY,EACV,QAAQ,GACR,SAAS,GACT,WAAW,GACX,KAAK,GACL,YAAY,GACZ,aAAa,GACb,UAAU,GACV,OAAO,GACP,eAAe,GACf,eAAe,GACf,cAAc,GACd,iBAAiB,GACjB,KAAK,GACL,YAAY,GACZ,WAAW,GACX,SAAS,GACT,MAAM,CACT,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAA;AAEhD,qGAAqG;AACrG,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,iBAAiB,EACxB,IAAI,EAAE;IACJ,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;IAClC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IAC3C,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IACzB,cAAc,IAAI,IAAI,CAAA;IACtB,cAAc,IAAI,IAAI,CAAA;IACtB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;IACpC,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;IACjC,SAAS,IAAI,IAAI,CAAA;IACjB,MAAM,CAAC,MAAM,EAAE,SAAS,OAAO,0BAA0B,EAAE,YAAY,EAAE,GAAG,IAAI,CAAA;IAChF,YAAY,IAAI,IAAI,CAAA;IACpB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACxD,gBAAgB,IAAI,IAAI,CAAA;IACxB,SAAS,IAAI,IAAI,CAAA;IACjB,eAAe,IAAI,IAAI,CAAA;IACvB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,iBAAiB,IAAI,IAAI,CAAA;IACzB;6CACyC;IACzC,iBAAiB,IAAI,IAAI,CAAA;IACzB,qBAAqB,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7F,eAAe,IAAI,IAAI,CAAA;CACxB,IAEa,QAAQ,KAAK,KAAG,OAAO,CAAC,YAAY,CAAC,CA+DpD"}
@@ -9,8 +9,17 @@ export function createLiveAgentAdoption(state, deps) {
9
9
  return async (target) => deps.binding.switchTo(target, deps.backgroundHandles.get(String(target.id)), (committed, disposePrevious) => {
10
10
  const previousHandle = committed.handle;
11
11
  const previousSessionId = String(committed.agent.session.id);
12
+ const keepPrevious = previousHandle !== undefined
13
+ && previousHandle.agent !== target
14
+ && (previousHandle.agent.status === 'running' || agentViewHasTurns(snapshotLiveSessionEvents(previousHandle.agent.session)));
15
+ // Registry attachment borrows an Agent without taking its upstream
16
+ // handle. Leaving that view must retain its projection independently
17
+ // of whether this channel can transfer or dispose the handle.
18
+ if (committed.agent !== target && (previousHandle === undefined || keepPrevious))
19
+ deps.parkSubagents(committed.agent);
12
20
  deps.backgroundHandles.delete(String(target.id));
13
21
  resetSessionProjection(state, deps.rowIds, deps.resetProjector, deps.resetSubagents, deps.resetJobs);
22
+ deps.restoreSubagents(target);
14
23
  state.status = target.status;
15
24
  state.agentId = target.id;
16
25
  state.sessionId = target.session.id;
@@ -43,9 +52,6 @@ export function createLiveAgentAdoption(state, deps) {
43
52
  writeResumeTarget(String(target.id));
44
53
  touchSession(target.id);
45
54
  state.emit();
46
- const keepPrevious = previousHandle !== undefined
47
- && previousHandle.agent !== target
48
- && (previousHandle.agent.status === 'running' || agentViewHasTurns(snapshotLiveSessionEvents(previousHandle.agent.session)));
49
55
  if (previousHandle !== undefined && previousHandle.agent !== target) {
50
56
  if (keepPrevious) {
51
57
  deps.backgroundHandles.set(previousSessionId, previousHandle);
@@ -54,7 +54,8 @@ export declare function createSessionMetadataActions(ctx: Context, deps: {
54
54
  cwd: string;
55
55
  };
56
56
  }): {
57
- listSessions: () => Promise<readonly SessionSummary[]>;
57
+ cachedSessions: () => readonly SessionSummary[] | undefined;
58
+ listSessions: (onEnriched?: (summary: SessionSummary) => void, onPartial?: (rows: readonly SessionSummary[]) => void) => Promise<readonly SessionSummary[]>;
58
59
  previewSession: (sessionId: string) => Promise<import("../sessions/types.js").PreviewEntry[]>;
59
60
  listSkills: () => Promise<{
60
61
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"session-metadata.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAEnD,O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C,OAAO,CAAC;iCASvB,MAAM,SAAS,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;EAcnF"}
@@ -5,7 +5,8 @@ import { appendSessionTitle, deleteSessionLog, userTitleData } from '../compat/i
5
5
  import { snapshotLiveSessionEvents } from '../compat/liveSession.js';
6
6
  import { collectRecentActivity, parseRecapResponse, RECAP_RECENT_CHARS, wrapRecapPrompt } from '../recap.js';
7
7
  import { listSummaries, locateSession, previewSession } from '../sessions/index.js';
8
- import { runSideQuestion, wrapSideQuestion } from '../sideQuestion.js';
8
+ import { openStepToolCallIds, runSideQuestion, splitUnresolvedToolCalls, wrapSideQuestion } from '../sideQuestion.js';
9
+ import { readListingSnapshot } from '../sessions/snapshot.js';
9
10
  import { isUserInvocable } from '@deepseek-ai/dsh-skill';
10
11
  const PREVIEW_ENTRIES = 8;
11
12
  /** Session-scoped metadata, persistence queries, and tool-less LLM reads. */
@@ -13,7 +14,23 @@ export function createSessionMetadataActions(ctx, deps) {
13
14
  const current = (capture) => deps.owner.current() && deps.binding.isCurrent(capture);
14
15
  const persistence = () => ctx.get('sessionPersistence');
15
16
  const withOwnerSignal = (signal) => signal === undefined ? deps.owner.signal : AbortSignal.any([signal, deps.owner.signal]);
16
- const listSessions = async () => {
17
+ let listingGeneration = 0;
18
+ let lastListing;
19
+ const remember = (source, rows) => {
20
+ lastListing = { source: source.identity ?? source, rows };
21
+ };
22
+ const cachedSessions = () => {
23
+ const source = persistence();
24
+ if (source === undefined)
25
+ return undefined;
26
+ // Providers without a durable scope still keep same-instance reopen fast.
27
+ // A replaced service never inherits this in-memory view.
28
+ return lastListing?.source === (source.identity ?? source)
29
+ ? lastListing.rows
30
+ : readListingSnapshot(source);
31
+ };
32
+ const listSessions = async (onEnriched, onPartial) => {
33
+ const generation = ++listingGeneration;
17
34
  const capture = deps.binding.capture();
18
35
  const source = persistence();
19
36
  if (!source) {
@@ -21,9 +38,21 @@ export function createSessionMetadataActions(ctx, deps) {
21
38
  deps.setPersistedSessions([]);
22
39
  return [];
23
40
  }
24
- const summaries = await listSummaries(source);
25
- if (!current(capture))
41
+ let summaries = [];
42
+ summaries = await listSummaries(source, deps.owner.signal, enriched => {
43
+ if (!current(capture) || generation !== listingGeneration)
44
+ return;
45
+ summaries = summaries.map(row => row.id === enriched.id ? enriched : row);
46
+ remember(source, summaries);
47
+ deps.setPersistedSessions(summaries);
48
+ onEnriched?.(enriched);
49
+ }, rows => {
50
+ if (current(capture) && generation === listingGeneration)
51
+ onPartial?.(rows);
52
+ });
53
+ if (!current(capture) || generation !== listingGeneration)
26
54
  return [];
55
+ remember(source, summaries);
27
56
  deps.setPersistedSessions(summaries);
28
57
  return summaries;
29
58
  };
@@ -120,11 +149,14 @@ export function createSessionMetadataActions(ctx, deps) {
120
149
  if (!llm)
121
150
  return { answer: null, error: t('btw-llm-unavailable') };
122
151
  const signal = withOwnerSignal(options?.signal);
152
+ // /btw can land mid-step; see splitUnresolvedToolCalls.
153
+ const running = openStepToolCallIds(snapshotLiveSessionEvents(capture.agent.session));
154
+ const history = splitUnresolvedToolCalls(capture.agent.session.deriveMessages(), running);
123
155
  const outcome = await runSideQuestion({
124
156
  stream: llm.stream.bind(llm),
125
157
  options: llmRequest(capture, [
126
- ...capture.agent.session.deriveMessages(),
127
- createUserMessage({ content: [{ type: 'text', text: wrapSideQuestion(question) }], source: { kind: 'dsh-tui-btw' } }),
158
+ ...history.messages,
159
+ createUserMessage({ content: [{ type: 'text', text: wrapSideQuestion(question, history.pending) }], source: { kind: 'dsh-tui-btw' } }),
128
160
  ], true, signal),
129
161
  // Do not let an old session append streamed UI facts after a switch.
130
162
  onText: delta => { if (current(capture) && !options?.signal?.aborted)
@@ -204,7 +236,7 @@ export function createSessionMetadataActions(ctx, deps) {
204
236
  return true;
205
237
  };
206
238
  return {
207
- listSessions, previewSession: preview, listSkills, describeCredential,
239
+ cachedSessions, listSessions, previewSession: preview, listSkills, describeCredential,
208
240
  sideQuestion, recapRecent, setResumeTarget: writeResumeTarget,
209
241
  renameSession, setSessionColor, deleteSession, renameSessionTo,
210
242
  };
@@ -1,5 +1,5 @@
1
1
  import type { ChannelState } from './types.js';
2
- export type SessionResetState = Pick<ChannelState, 'rows' | 'todos' | 'pending' | 'goal' | 'sessionTitle' | 'sessionColor' | 'tokens' | 'responseChars' | 'activeToolCount' | 'lastUserText' | 'working' | 'cancelPending' | 'spinnerMode' | 'tps' | 'tpsSamples' | 'lastUsage' | 'contextSegments'>;
2
+ export type SessionResetState = Pick<ChannelState, 'rows' | 'todos' | 'pending' | 'goal' | 'sessionTitle' | 'sessionColor' | 'tokens' | 'mainCost' | 'subagentCost' | 'responseChars' | 'activeToolCount' | 'lastUserText' | 'working' | 'compaction' | 'cancelPending' | 'spinnerMode' | 'tps' | 'tpsSamples' | 'lastUsage' | 'contextSegments'>;
3
3
  /**
4
4
  * Reset the projection facts shared by every foreground session adoption.
5
5
  * Target-specific route, cwd, preset, loaded-context and status fields stay
@@ -1 +1 @@
1
- {"version":3,"file":"session-reset.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-reset.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,YAAY,EACV,MAAM,GACN,OAAO,GACP,SAAS,GACT,MAAM,GACN,cAAc,GACd,cAAc,GACd,QAAQ,GACR,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,SAAS,GACT,eAAe,GACf,aAAa,GACb,KAAK,GACL,YAAY,GACZ,WAAW,GACX,iBAAiB,CACpB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,EACzB,cAAc,EAAE,MAAM,IAAI,EAC1B,cAAc,EAAE,MAAM,IAAI,EAC1B,SAAS,EAAE,MAAM,IAAI,GACpB,IAAI,CAoCN"}
1
+ {"version":3,"file":"session-reset.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-reset.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,YAAY,EACV,MAAM,GACN,OAAO,GACP,SAAS,GACT,MAAM,GACN,cAAc,GACd,cAAc,GACd,QAAQ,GACR,UAAU,GACV,cAAc,GACd,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,SAAS,GACT,YAAY,GACZ,eAAe,GACf,aAAa,GACb,KAAK,GACL,YAAY,GACZ,WAAW,GACX,iBAAiB,CACpB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,EACzB,cAAc,EAAE,MAAM,IAAI,EAC1B,cAAc,EAAE,MAAM,IAAI,EAC1B,SAAS,EAAE,MAAM,IAAI,GACpB,IAAI,CA2CN"}
@@ -24,10 +24,17 @@ export function resetSessionProjection(state, rowIds, resetProjector, resetSubag
24
24
  peak: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
25
25
  idle: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
26
26
  };
27
+ // 会话级费用累计与 tokens 同生命周期:换会话/换模型/rewind 一律清零后
28
+ // 由 replay 重建(模型切换的 replay 会按 request/header 还原各请求模型)。
29
+ state.mainCost = {};
30
+ state.subagentCost = [];
27
31
  state.responseChars = 0;
28
32
  state.activeToolCount = 0;
29
33
  state.lastUserText = '';
30
34
  state.working = false;
35
+ // The adoption path settles any in-flight compaction before it takes the
36
+ // new session over; a row that survived it would describe the old one.
37
+ state.compaction = undefined;
31
38
  state.cancelPending = false;
32
39
  state.spinnerMode = 'requesting';
33
40
  state.tps = undefined;
@@ -35,6 +35,7 @@ export declare function createSessionResumeActions(ctx: Context, state: ResumeSt
35
35
  };
36
36
  resetProjector(): void;
37
37
  resetSubagents(): void;
38
+ parkSubagents(agent: Agent): void;
38
39
  resetJobs(): void;
39
40
  replay(events: readonly SessionEvent[]): void;
40
41
  settleReplay(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"session-resume.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/session-resume.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAsB,MAAM,wBAAwB,CAAA;AAEpF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAmBvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAgC,KAAK,qBAAqB,EAAE,MAAM,iCAAiC,CAAA;AAC1G,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE5D,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACtD,KAAK,WAAW,GAAG,IAAI,CACrB,YAAY,EACV,SAAS,GACT,QAAQ,GACR,SAAS,GACT,WAAW,GACX,KAAK,GACL,YAAY,GACZ,aAAa,GACb,UAAU,GACV,OAAO,GACP,eAAe,GACf,eAAe,GACf,cAAc,GACd,iBAAiB,GACjB,SAAS,GACT,MAAM,CACT,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAA;AAEhD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,mFAAmF;IACnF,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAA;AAgBD,8DAA8D;AAC9D,wBA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a commit, which is what the outer finally keys on.
116
116
  const result = deps.binding.adopt(handle, adoption, (committedBinding, disposePrevious) => {
117
117
  const previousSessionId = String(committedBinding.agent.session.id);
118
+ const keepPrevious = keepCurrent && committedBinding.handle !== undefined
119
+ && (committedBinding.handle.agent.status === 'running' || agentViewHasTurns(snapshotLiveSessionEvents(committedBinding.handle.agent.session)));
120
+ if (keepCurrent && (committedBinding.handle === undefined || keepPrevious))
121
+ deps.parkSubagents(committedBinding.agent);
118
122
  state.cwd = handle.agent.session.header.cwd ?? state.cwd;
119
123
  state.displayCwd = deps.describeWorkspace(state.cwd).description ?? state.cwd;
120
124
  deps.resetIdeSelection();
@@ -126,8 +130,6 @@ export function createSessionResumeActions(ctx, state, options, deps) {
126
130
  writeResumeTarget(sessionId);
127
131
  touchSession(sessionId);
128
132
  state.emit();
129
- const keepPrevious = keepCurrent && committedBinding.handle !== undefined
130
- && (committedBinding.handle.agent.status === 'running' || agentViewHasTurns(snapshotLiveSessionEvents(committedBinding.handle.agent.session)));
131
133
  if (committedBinding.handle !== undefined) {
132
134
  if (keepPrevious) {
133
135
  deps.backgroundHandles.set(previousSessionId, committedBinding.handle);
@@ -1 +1 @@
1
- {"version":3,"file":"settings-host.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/settings-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAMvD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,EAAE,YAAY,GAAE,MAAM,IAAsB,GAAG,IAAI,CAAC,YAAY,EAAE,cAAc,GAAG,eAAe,GAAG,uBAAuB,CAAC,CAqT5K"}
1
+ {"version":3,"file":"settings-host.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/settings-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAMvD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,EAAE,YAAY,GAAE,MAAM,IAAsB,GAAG,IAAI,CAAC,YAAY,EAAE,cAAc,GAAG,eAAe,GAAG,uBAAuB,CAAC,CA+T5K"}
@@ -137,6 +137,7 @@ export function createSettingsHosts(ctx, assertActive = () => undefined) {
137
137
  if (providers === undefined || typeof providers !== 'object' || providers === null)
138
138
  return [];
139
139
  const catalog = catalogMembers();
140
+ const resolvedSection = settingsValue(settings, 'llm-pi-ai');
140
141
  return Object.entries(providers).flatMap(([route, profile]) => {
141
142
  // The settings section is user-editable, so a `providers.<route>`
142
143
  // entry may be null or a scalar; skip anything that is not a plain
@@ -152,6 +153,12 @@ export function createSettingsHosts(ctx, assertActive = () => undefined) {
152
153
  const api = typeof stored.api === 'string' && stored.api !== ''
153
154
  ? stored.api
154
155
  : undefined;
156
+ const resolved = resolvedSection?.providers?.[route];
157
+ const headers = typeof resolved === 'object' && resolved !== null
158
+ ? resolved.headers
159
+ : undefined;
160
+ const hasCustomHeaders = typeof headers === 'object' && headers !== null
161
+ && !Array.isArray(headers) && Object.keys(headers).length > 0;
155
162
  // Keep the raw model entries: a model-list re-selection must
156
163
  // rewrite kept ids with their stored objects, so per-model fields
157
164
  // this wizard never learned about survive the edit.
@@ -166,6 +173,7 @@ export function createSettingsHosts(ctx, assertActive = () => undefined) {
166
173
  shadowed: ref !== '' && process.env[ref] !== undefined,
167
174
  ...(baseURL !== undefined ? { baseURL } : {}),
168
175
  ...(api !== undefined ? { api } : {}),
176
+ ...(hasCustomHeaders ? { hasCustomHeaders: true } : {}),
169
177
  ...(models !== undefined ? { models } : {}),
170
178
  ...(modelEntries !== undefined && modelEntries.length > 0
171
179
  ? { modelEntries }
@@ -1,6 +1,7 @@
1
1
  import type { AgentHandle } from '@deepseek-ai/dsh-agent';
2
2
  import type { SessionModeSpec } from '../../sessionModes.js';
3
3
  import { type PageMarginSetting, type ScrollGutterMode, type StatusBarConfig, type ToolBackground } from '../../tuiDisplayPrefs.js';
4
+ import { type SplashFontSetting } from '../../components/splashFonts.js';
4
5
  import type { ChannelState } from './types.js';
5
6
  /** Launch configuration belongs to channel construction, not the composition root. */
6
7
  export interface ChannelLaunchOptions {
@@ -14,6 +15,12 @@ export interface ChannelLaunchOptions {
14
15
  * read to render its line before the next event lands. */
15
16
  seedActivity?: (session: unknown) => void;
16
17
  activityFrames?: string;
18
+ /** Settings namespace this boot registered its section under: the Config
19
+ * owner's Loader id (`resolveSettingsNamespace`), which is NOT always the
20
+ * plugin name. Read sites look the TUI's section up by it, so passing the
21
+ * literal `'dsh-tui'` here would silently miss custom mounts. Absent →
22
+ * `'dsh-tui'` (direct `createChannel` embedders and fixtures). */
23
+ settingsNs?: string;
17
24
  diffLayout?: 'auto' | 'split' | 'unified';
18
25
  thinkingFold?: 'preview' | 'full';
19
26
  toolBackground?: ToolBackground;
@@ -26,6 +33,12 @@ export interface ChannelLaunchOptions {
26
33
  statusBar?: Partial<StatusBarConfig>;
27
34
  whale?: boolean;
28
35
  whaleIdle?: boolean;
36
+ /** Big-text face (settings `dsh-tui.splashFont`); absent → `daily`, the
37
+ * date rotation. Junk normalizes to `daily` (see `normalizeSplashFont`). */
38
+ splashFont?: SplashFontSetting;
39
+ /** Maid portrait for the header splash (settings `dsh-tui.whaleGirl`;
40
+ * off by default). */
41
+ whaleGirl?: boolean;
29
42
  minimal?: boolean;
30
43
  contextBar?: boolean;
31
44
  configuredPreset?: string;
@@ -47,5 +60,5 @@ export declare function createInitialChannelView(options: ChannelLaunchOptions,
47
60
  sessionId: string;
48
61
  mode: ChannelState['mode'];
49
62
  cwdDescription: string;
50
- }): Pick<ChannelState, 'effortLevels' | 'version' | 'rows' | 'status' | 'sessionTitle' | 'sessionColor' | 'agentId' | 'sessionId' | 'agentBindingGeneration' | 'model' | 'provider' | 'tokens' | 'cwd' | 'displayCwd' | 'gitBranch' | 'working' | 'cancelPending' | 'spinnerMode' | 'responseChars' | 'activeToolCount' | 'turnStart' | 'lastUserText' | 'notifications' | 'contextWindow' | 'reasoningEffort' | 'mode' | 'modeIndex' | 'activityFrames' | 'configuredProvider' | 'configuredModel' | 'configuredPreset' | 'configuredActivityFrames' | 'configuredLang' | 'diffLayout' | 'thinkingFold' | 'toolBackground' | 'scrollGutter' | 'pageMargin' | 'foldTerminalCommand' | 'promptSessionLabel' | 'expandEditor' | 'smoothStreaming' | 'statusBar' | 'whale' | 'whaleIdle' | 'minimal' | 'activityEnabled' | 'contextBarEnabled' | 'agentPreset' | 'goal' | 'todos' | 'loadedContext' | 'pending' | 'commandList' | 'lastUsage' | 'tps' | 'tpsSamples' | 'contextSegments' | 'subagents' | 'backgroundJobs' | 'selection'>;
63
+ }): Pick<ChannelState, 'effortLevels' | 'version' | 'rows' | 'status' | 'sessionTitle' | 'sessionColor' | 'agentId' | 'sessionId' | 'agentBindingGeneration' | 'model' | 'provider' | 'tokens' | 'cwd' | 'displayCwd' | 'gitBranch' | 'working' | 'compaction' | 'cancelPending' | 'spinnerMode' | 'responseChars' | 'activeToolCount' | 'turnStart' | 'lastUserText' | 'notifications' | 'contextWindow' | 'reasoningEffort' | 'mode' | 'modeIndex' | 'activityFrames' | 'configuredProvider' | 'configuredModel' | 'configuredPreset' | 'configuredActivityFrames' | 'configuredLang' | 'diffLayout' | 'thinkingFold' | 'toolBackground' | 'scrollGutter' | 'pageMargin' | 'foldTerminalCommand' | 'promptSessionLabel' | 'expandEditor' | 'smoothStreaming' | 'statusBar' | 'whale' | 'whaleIdle' | 'splashFont' | 'minimal' | 'activityEnabled' | 'contextBarEnabled' | 'statusBar' | 'whale' | 'whaleIdle' | 'whaleGirl' | 'minimal' | 'activityEnabled' | 'contextBarEnabled' | 'agentPreset' | 'goal' | 'todos' | 'loadedContext' | 'pending' | 'commandList' | 'lastUsage' | 'tps' | 'tpsSamples' | 'contextSegments' | 'mainCost' | 'subagentCost' | 'subagents' | 'backgroundJobs' | 'selection'>;
51
64
  //# sourceMappingURL=state.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAA2F,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAE5N,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,sFAAsF;AACtF,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;+DAE2D;IAC3D,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IACzC,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;IACzC,YAAY,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;IACjC,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,YAAY,CAAC,EAAE,gBAAgB,CAAA;IAC/B,UAAU,CAAC,EAAE,iBAAiB,CAAA;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;IACpC,KAAK,CAAC,EAAE,OAAO,CAAA;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AG,WAAW,GAAG,SAAS,GAAG,YAAY,GAAG,eAAe,GAAG,aAAa,GACvF,eAAe,GAAG,iBAAiB,GAAG,WAAW,GAAG,cAAc,GAClE,eAAe,GAAG,eAAe,GAAG,iBAAiB,GAAG,MAAM,GAAG,WAAW,GAC5E,gBAAgB,GAAG,oBAAoB,GAAG,iBAAiB,GAC3D,kBAAkB,GAAG,0BAA0B,GAAG,gBAAgB,GAAG,YAAY,GACjF,cAAc,GAAG,gBAAgB,GAAG,cAAc,GAAG,YAAY,GACjE,qBAAqB,GAAG,oBAAoB,GAAG,cAAc,GAAG,iBAAiB,GACjF,WAAW,GAAG,OAAO,GAAG,WAAW,GAAG,YAAY,GAAG,SAAS,GAAG,iBAAiB,GAAG,mBAAmB,GACxG,WAAW,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,GAAG,iBAAiB,GAAG,mBAAmB,GACvG,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,eAAe,GAAG,SAAS,GAAG,aAAa,GAC9E,WAAW,GAAG,KAAK,GAAG,YAAY,GAAG,iBAAiB,GAAG,UAAU,GAAG,cAAc,GAAG,WAAW,GAAG,gBAAgB,GAAG,WAAW,CACpI,CA2BA"}
@@ -1,5 +1,6 @@
1
1
  import { normalizePageMargin, normalizeScrollGutter, normalizeStatusBar, normalizeToolBackground } from '../../tuiDisplayPrefs.js';
2
2
  import { normalizeActivityPreset } from '../../components/activityFrames.js';
3
+ import { normalizeSplashFont } from '../../components/splashFonts.js';
3
4
  /**
4
5
  * Neutral observable fields only. Behaviour is assembled explicitly by the
5
6
  * composition root after each specialist owner exists, so this factory cannot
@@ -11,6 +12,7 @@ export function createInitialChannelView(options, input) {
11
12
  agentId: input.agentId, sessionId: input.sessionId, agentBindingGeneration: 0, model: options.model, provider: options.provider,
12
13
  tokens: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, peak: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, idle: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 } },
13
14
  cwd: options.cwd, displayCwd: input.cwdDescription, gitBranch: undefined, working: false,
15
+ compaction: undefined,
14
16
  cancelPending: false, spinnerMode: 'requesting', responseChars: 0, activeToolCount: 0,
15
17
  turnStart: 0, lastUserText: '', notifications: [], contextWindow: undefined,
16
18
  reasoningEffort: options.effort, mode: input.mode, modeIndex: 0,
@@ -22,10 +24,13 @@ export function createInitialChannelView(options, input) {
22
24
  pageMargin: normalizePageMargin(options.pageMargin), foldTerminalCommand: options.foldTerminalCommand === true,
23
25
  promptSessionLabel: options.promptSessionLabel === true, expandEditor: options.expandEditor !== false,
24
26
  smoothStreaming: options.smoothStreaming !== false, statusBar: normalizeStatusBar(options.statusBar),
25
- whale: options.whale !== false, whaleIdle: options.whaleIdle !== false, minimal: options.minimal === true, activityEnabled: options.activity !== false,
27
+ whale: options.whale !== false, whaleIdle: options.whaleIdle !== false, whaleGirl: options.whaleGirl === true, splashFont: normalizeSplashFont(options.splashFont), minimal: options.minimal === true, activityEnabled: options.activity !== false,
26
28
  contextBarEnabled: options.contextBar !== false, agentPreset: options.agentPreset, goal: undefined,
27
29
  todos: [], loadedContext: undefined, pending: [], commandList: [], lastUsage: undefined,
28
30
  tps: undefined, tpsSamples: [], contextSegments: { system: 0, prompt: 0, assistant: 0, thinking: 0, tools: 0 },
31
+ // 费用估算输入:主会话按模型分桶 + 子代理快照。与 tokens 并行累计,
32
+ // tokens 的既有语义/显示不变(DESIGN D2)。
33
+ mainCost: {}, subagentCost: [],
29
34
  subagents: [], backgroundJobs: [],
30
35
  };
31
36
  }