@deepseek-harness-tui/dsh-tui 0.9.0 → 0.9.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 (307) hide show
  1. package/README.md +69 -256
  2. package/bin/dsh-tui.js +172 -5
  3. package/cordis.patch.yml +16 -4
  4. package/dsh-ecosystem-spec/protocols/profile-definitions.d.ts +13 -13
  5. package/dsh-ecosystem-spec/protocols/profile-definitions.js +59 -59
  6. package/dsh-ecosystem-spec/protocols/tui-channel-http.d.ts +15 -15
  7. package/dsh-ecosystem-spec/protocols/tui-channel-http.js +32 -32
  8. package/dsh-ecosystem-spec/protocols/tui-channel.d.ts +59 -59
  9. package/dsh-ecosystem-spec/protocols/tui-channel.js +166 -166
  10. package/dsh-ecosystem-spec/protocols/tui-contributions.d.ts +42 -42
  11. package/dsh-ecosystem-spec/protocols/tui-contributions.js +143 -143
  12. package/dsh-ecosystem-spec/registry/README.md +14 -14
  13. package/dsh-ecosystem-spec/registry/host-descriptor.tui.example.json +56 -56
  14. package/dsh-ecosystem-spec/registry/permissions-0.1.json +13 -13
  15. package/dsh-ecosystem-spec/registry/registry-0.15.json +149 -149
  16. package/lib/types/cc/hyperlink.d.ts +7 -1
  17. package/lib/types/cc/hyperlink.d.ts.map +1 -1
  18. package/lib/types/cc/hyperlink.js +3 -2
  19. package/lib/types/cc/markdown.d.ts.map +1 -1
  20. package/lib/types/cc/markdown.js +33 -3
  21. package/lib/types/cc/sessionColors.d.ts +27 -0
  22. package/lib/types/cc/sessionColors.d.ts.map +1 -0
  23. package/lib/types/cc/sessionColors.js +39 -0
  24. package/lib/types/commands.d.ts.map +1 -1
  25. package/lib/types/commands.js +6 -0
  26. package/lib/types/components/AutoRecapRow.d.ts +23 -0
  27. package/lib/types/components/AutoRecapRow.d.ts.map +1 -0
  28. package/lib/types/components/AutoRecapRow.js +23 -0
  29. package/lib/types/components/ColorPicker.d.ts +17 -0
  30. package/lib/types/components/ColorPicker.d.ts.map +1 -0
  31. package/lib/types/components/ColorPicker.js +20 -0
  32. package/lib/types/components/CommandSuggestions.d.ts +3 -1
  33. package/lib/types/components/CommandSuggestions.d.ts.map +1 -1
  34. package/lib/types/components/ContextBarView.d.ts +33 -0
  35. package/lib/types/components/ContextBarView.d.ts.map +1 -0
  36. package/lib/types/components/ContextBarView.js +46 -0
  37. package/lib/types/components/EffortInputBorder.d.ts +12 -1
  38. package/lib/types/components/EffortInputBorder.d.ts.map +1 -1
  39. package/lib/types/components/EffortInputBorder.js +22 -5
  40. package/lib/types/components/FileActionsPanel.d.ts +22 -0
  41. package/lib/types/components/FileActionsPanel.d.ts.map +1 -0
  42. package/lib/types/components/FileActionsPanel.js +28 -0
  43. package/lib/types/components/FileSuggestions.d.ts +3 -1
  44. package/lib/types/components/FileSuggestions.d.ts.map +1 -1
  45. package/lib/types/components/MessageList.d.ts +3 -1
  46. package/lib/types/components/MessageList.d.ts.map +1 -1
  47. package/lib/types/components/MessageList.js +13 -6
  48. package/lib/types/components/ModelPicker.d.ts +26 -4
  49. package/lib/types/components/ModelPicker.d.ts.map +1 -1
  50. package/lib/types/components/ModelPicker.js +26 -6
  51. package/lib/types/components/PromptInput.d.ts.map +1 -1
  52. package/lib/types/components/PromptInput.js +365 -57
  53. package/lib/types/components/RecapPanel.d.ts +25 -0
  54. package/lib/types/components/RecapPanel.d.ts.map +1 -0
  55. package/lib/types/components/RecapPanel.js +55 -0
  56. package/lib/types/components/ScrollbarGutter.d.ts.map +1 -1
  57. package/lib/types/components/ScrollbarGutter.js +55 -4
  58. package/lib/types/components/SubagentCard.d.ts.map +1 -1
  59. package/lib/types/components/SubagentCard.js +6 -4
  60. package/lib/types/components/SuggestionCard.d.ts +4 -2
  61. package/lib/types/components/SuggestionCard.d.ts.map +1 -1
  62. package/lib/types/components/TimelineRail.d.ts.map +1 -1
  63. package/lib/types/components/TimelineRail.js +9 -2
  64. package/lib/types/components/design-system/ThemeProvider.d.ts +7 -0
  65. package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -1
  66. package/lib/types/components/design-system/ThemeProvider.js +2 -1
  67. package/lib/types/components/messages/AssistantToolUseMessage.d.ts +8 -1
  68. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  69. package/lib/types/components/messages/AssistantToolUseMessage.js +36 -8
  70. package/lib/types/components/questions/AskUserQuestionPanel.d.ts +7 -3
  71. package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
  72. package/lib/types/components/questions/AskUserQuestionPanel.js +41 -9
  73. package/lib/types/dsh-adapter/channel.d.ts +101 -2
  74. package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
  75. package/lib/types/dsh-adapter/channel.js +969 -93
  76. package/lib/types/dsh-adapter/compat/index.d.ts +8 -6
  77. package/lib/types/dsh-adapter/compat/index.d.ts.map +1 -1
  78. package/lib/types/dsh-adapter/compat/index.js +8 -6
  79. package/lib/types/dsh-adapter/compat/sessionLog.d.ts +150 -0
  80. package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
  81. package/lib/types/dsh-adapter/compat/sessionLog.js +518 -41
  82. package/lib/types/dsh-adapter/contract.d.ts +1 -1
  83. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  84. package/lib/types/dsh-adapter/contract.js +1 -0
  85. package/lib/types/dsh-adapter/extension-events.d.ts +1 -1
  86. package/lib/types/dsh-adapter/extension-events.d.ts.map +1 -1
  87. package/lib/types/dsh-adapter/index.d.ts +10 -0
  88. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  89. package/lib/types/dsh-adapter/index.js +5 -0
  90. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  91. package/lib/types/dsh-adapter/plugin.js +317 -8
  92. package/lib/types/dsh-adapter/presets.d.ts +18 -0
  93. package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
  94. package/lib/types/dsh-adapter/presets.js +31 -0
  95. package/lib/types/dsh-adapter/providerWizard.d.ts +29 -1
  96. package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
  97. package/lib/types/dsh-adapter/providerWizard.js +89 -5
  98. package/lib/types/dsh-adapter/questions.d.ts +19 -2
  99. package/lib/types/dsh-adapter/questions.d.ts.map +1 -1
  100. package/lib/types/dsh-adapter/questions.js +53 -10
  101. package/lib/types/dsh-adapter/recap.d.ts +49 -0
  102. package/lib/types/dsh-adapter/recap.d.ts.map +1 -0
  103. package/lib/types/dsh-adapter/recap.js +121 -0
  104. package/lib/types/dsh-adapter/sessionTree.d.ts +314 -0
  105. package/lib/types/dsh-adapter/sessionTree.d.ts.map +1 -0
  106. package/lib/types/dsh-adapter/sessionTree.js +954 -0
  107. package/lib/types/dsh-adapter/shortcuts.d.ts +15 -44
  108. package/lib/types/dsh-adapter/shortcuts.d.ts.map +1 -1
  109. package/lib/types/dsh-adapter/shortcuts.js +28 -165
  110. package/lib/types/dsh-adapter/types.d.ts +1 -1
  111. package/lib/types/dsh-adapter/types.d.ts.map +1 -1
  112. package/lib/types/herdr.js +1 -1
  113. package/lib/types/i18n.d.ts +604 -176
  114. package/lib/types/i18n.d.ts.map +1 -1
  115. package/lib/types/i18n.js +206 -72
  116. package/lib/types/ink/log-update.d.ts.map +1 -1
  117. package/lib/types/ink/log-update.js +21 -0
  118. package/lib/types/migrationPrefs.d.ts +60 -0
  119. package/lib/types/migrationPrefs.d.ts.map +1 -0
  120. package/lib/types/migrationPrefs.js +97 -0
  121. package/lib/types/modelGroups.d.ts +72 -0
  122. package/lib/types/modelGroups.d.ts.map +1 -0
  123. package/lib/types/modelGroups.js +97 -0
  124. package/lib/types/modelRecents.d.ts +39 -0
  125. package/lib/types/modelRecents.d.ts.map +1 -0
  126. package/lib/types/modelRecents.js +97 -0
  127. package/lib/types/native-ts/yoga-layout/index.d.ts +11 -0
  128. package/lib/types/native-ts/yoga-layout/index.d.ts.map +1 -1
  129. package/lib/types/native-ts/yoga-layout/index.js +31 -1
  130. package/lib/types/oauth.d.ts +15 -0
  131. package/lib/types/oauth.d.ts.map +1 -0
  132. package/lib/types/oauth.js +14 -0
  133. package/lib/types/plugin-spec/registry.d.ts +1 -1
  134. package/lib/types/plugin-spec/registry.js +1 -1
  135. package/lib/types/reload.d.ts +109 -0
  136. package/lib/types/reload.d.ts.map +1 -0
  137. package/lib/types/reload.js +118 -0
  138. package/lib/types/screens/Chat.d.ts +3 -1
  139. package/lib/types/screens/Chat.d.ts.map +1 -1
  140. package/lib/types/screens/Chat.js +588 -64
  141. package/lib/types/screens/SessionTree.d.ts +27 -0
  142. package/lib/types/screens/SessionTree.d.ts.map +1 -0
  143. package/lib/types/screens/SessionTree.js +555 -0
  144. package/lib/types/screens/StatusLine.d.ts +0 -9
  145. package/lib/types/screens/StatusLine.d.ts.map +1 -1
  146. package/lib/types/screens/StatusLine.js +215 -52
  147. package/lib/types/screens/StatusMetrics.d.ts +35 -3
  148. package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
  149. package/lib/types/screens/StatusMetrics.js +63 -8
  150. package/lib/types/screens/chatOverlay.d.ts +17 -1
  151. package/lib/types/screens/chatOverlay.d.ts.map +1 -1
  152. package/lib/types/screens/chatOverlay.js +3 -1
  153. package/lib/types/tips.d.ts.map +1 -1
  154. package/lib/types/tips.js +22 -4
  155. package/lib/types/update.d.ts +159 -0
  156. package/lib/types/update.d.ts.map +1 -1
  157. package/lib/types/update.js +496 -30
  158. package/lib/types/utils/debug.d.ts +1 -1
  159. package/lib/types/utils/debug.js +3 -3
  160. package/lib/types/utils/fileTarget.d.ts +46 -0
  161. package/lib/types/utils/fileTarget.d.ts.map +1 -0
  162. package/lib/types/utils/fileTarget.js +178 -0
  163. package/lib/types/utils/keymap.d.ts +134 -0
  164. package/lib/types/utils/keymap.d.ts.map +1 -0
  165. package/lib/types/utils/keymap.js +311 -0
  166. package/lib/types/utils/mentions.d.ts +25 -2
  167. package/lib/types/utils/mentions.d.ts.map +1 -1
  168. package/lib/types/utils/mentions.js +69 -10
  169. package/lib/types/utils/openExternal.d.ts +50 -0
  170. package/lib/types/utils/openExternal.d.ts.map +1 -0
  171. package/lib/types/utils/openExternal.js +170 -0
  172. package/node_modules/@deepseek-harness-tui/dsh-auth/LICENSE +21 -0
  173. package/node_modules/@deepseek-harness-tui/dsh-auth/README.md +140 -0
  174. package/node_modules/@deepseek-harness-tui/dsh-auth/cordis.patch.yml +11 -0
  175. package/node_modules/@deepseek-harness-tui/dsh-auth/dsh-plugin.json +44 -0
  176. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/command.d.ts +14 -0
  177. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/command.js +67 -0
  178. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/credentials.d.ts +64 -0
  179. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/credentials.js +170 -0
  180. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/index.d.ts +79 -0
  181. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/index.js +196 -0
  182. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/interaction.d.ts +68 -0
  183. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/interaction.js +193 -0
  184. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/opener.d.ts +32 -0
  185. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/opener.js +101 -0
  186. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/profiles.d.ts +31 -0
  187. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/profiles.js +68 -0
  188. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/service.d.ts +69 -0
  189. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/service.js +129 -0
  190. package/node_modules/@deepseek-harness-tui/dsh-auth/package.json +70 -0
  191. package/node_modules/@dsh-std/command/CHANGELOG.md +8 -8
  192. package/node_modules/@dsh-std/command/LICENSE +21 -21
  193. package/node_modules/@dsh-std/command/README.md +26 -26
  194. package/node_modules/@dsh-std/command/README.zh.md +28 -28
  195. package/node_modules/@dsh-std/command/lib/index.js.map +1 -1
  196. package/node_modules/@dsh-std/command/package.json +22 -22
  197. package/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
  198. package/node_modules/@dsh-std/connection/LICENSE +21 -21
  199. package/node_modules/@dsh-std/connection/README.md +42 -42
  200. package/node_modules/@dsh-std/connection/README.zh.md +42 -42
  201. package/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
  202. package/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
  203. package/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
  204. package/node_modules/@dsh-std/connection/package.json +20 -20
  205. package/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  206. package/node_modules/@dsh-std/core/LICENSE +21 -21
  207. package/node_modules/@dsh-std/core/README.md +13 -13
  208. package/node_modules/@dsh-std/core/README.zh.md +13 -13
  209. package/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  210. package/node_modules/@dsh-std/core/package.json +21 -21
  211. package/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -9
  212. package/node_modules/@dsh-std/manifest/LICENSE +21 -21
  213. package/node_modules/@dsh-std/manifest/README.md +5 -5
  214. package/node_modules/@dsh-std/manifest/README.zh.md +5 -5
  215. package/node_modules/@dsh-std/manifest/lib/index.js.map +1 -1
  216. package/node_modules/@dsh-std/manifest/package.json +20 -20
  217. package/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -144
  218. package/node_modules/@dsh-std/messages/CHANGELOG.md +8 -8
  219. package/node_modules/@dsh-std/messages/LICENSE +21 -21
  220. package/node_modules/@dsh-std/messages/README.md +5 -5
  221. package/node_modules/@dsh-std/messages/README.zh.md +7 -7
  222. package/node_modules/@dsh-std/messages/lib/index.js.map +1 -1
  223. package/node_modules/@dsh-std/messages/package.json +20 -20
  224. package/node_modules/@dsh-std/messages/schema/message-observer-envelope-0.15.schema.json +54 -54
  225. package/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -9
  226. package/node_modules/@dsh-std/presentation/LICENSE +21 -21
  227. package/node_modules/@dsh-std/presentation/README.md +27 -27
  228. package/node_modules/@dsh-std/presentation/README.zh.md +29 -29
  229. package/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -1
  230. package/node_modules/@dsh-std/presentation/lib/index.js.map +1 -1
  231. package/node_modules/@dsh-std/presentation/package.json +25 -25
  232. package/node_modules/@dsh-std/storage/CHANGELOG.md +8 -8
  233. package/node_modules/@dsh-std/storage/LICENSE +21 -21
  234. package/node_modules/@dsh-std/storage/README.md +5 -5
  235. package/node_modules/@dsh-std/storage/README.zh.md +7 -7
  236. package/node_modules/@dsh-std/storage/lib/index.js.map +1 -1
  237. package/node_modules/@dsh-std/storage/package.json +20 -20
  238. package/node_modules/@dsh-std/storage/schema/local-storage-0.15.schema.json +56 -56
  239. package/package.json +17 -5
  240. package/presets/liangshen/.dsh-tui-managed.json +1 -1
  241. package/presets/liangshen/instruction-hint.mjs +8 -0
  242. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
  243. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/LICENSE +21 -21
  244. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.md +42 -42
  245. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.zh.md +42 -42
  246. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
  247. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
  248. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
  249. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/package.json +20 -20
  250. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  251. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/LICENSE +21 -21
  252. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.md +13 -13
  253. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.zh.md +13 -13
  254. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  255. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/package.json +21 -21
  256. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -9
  257. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/LICENSE +21 -21
  258. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.md +5 -5
  259. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.zh.md +5 -5
  260. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.js.map +1 -1
  261. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/package.json +20 -20
  262. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -144
  263. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -9
  264. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/LICENSE +21 -21
  265. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.md +27 -27
  266. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.zh.md +29 -29
  267. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -1
  268. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js.map +1 -1
  269. package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/package.json +25 -25
  270. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  271. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/LICENSE +21 -21
  272. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.md +13 -13
  273. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.zh.md +13 -13
  274. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  275. package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/package.json +21 -21
  276. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  277. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/LICENSE +21 -21
  278. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.md +13 -13
  279. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.zh.md +13 -13
  280. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  281. package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/package.json +21 -21
  282. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  283. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/LICENSE +21 -21
  284. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.md +13 -13
  285. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.zh.md +13 -13
  286. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  287. package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/package.json +21 -21
  288. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
  289. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/LICENSE +21 -21
  290. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.md +42 -42
  291. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.zh.md +42 -42
  292. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
  293. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
  294. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
  295. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/package.json +20 -20
  296. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  297. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/LICENSE +21 -21
  298. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.md +13 -13
  299. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.zh.md +13 -13
  300. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  301. package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/package.json +21 -21
  302. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
  303. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/LICENSE +21 -21
  304. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.md +13 -13
  305. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.zh.md +13 -13
  306. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.js.map +1 -1
  307. package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/package.json +21 -21
@@ -1,45 +1,5 @@
1
- /**
2
- * Session-log compatibility helpers.
3
- *
4
- * Title lookup tolerates event types unknown to the current harness. Offline
5
- * rename and delete support the `/resume` picker when no live Agent owns the
6
- * selected persisted session. The resume seam registers vouched-for legacy
7
- * event types into every reachable KNOWN_SESSION_EVENT_TYPES copy so the
8
- * strict read path stops rejecting whole sessions over them (issue #153).
9
- *
10
- * Registration background: plugins like dsh-working-activity (< the publish
11
- * cut) appended `activity/status` through `session.append`, but rc.6's
12
- * append exposes no `ignorable` flag and the type is absent from
13
- * KNOWN_SESSION_EVENT_TYPES — so resume's seed validation rejects the WHOLE
14
- * session ("unknown to this harness and not marked ignorable"). Upstream's
15
- * catalog header defers a registration surface "until such a consumer
16
- * exists"; the working-activity plugin became that consumer at #119 and
17
- * registers its type at load. Logs written BEFORE that cut, resumed in a
18
- * process where the plugin's registration never ran (plugin unmounted, or
19
- * a bare cordis.yml), still hit the rejection — this module is the consumer
20
- * for exactly that residue.
21
- *
22
- * Why registration and NOT rewriting the log to mark events `ignorable`
23
- * (the #107 approach, restored then replaced after review): the store is
24
- * shared with dsh web (#24) and possibly a second TUI instance (#153), and
25
- * a whole-file tmp+rename swap (a) loses frames an already-open appender
26
- * lands on the replaced inode, (b) drops the backend's 0600 artifact mode,
27
- * (c) re-encodes frames without the writer's checksum flag, and (d) dies on
28
- * torn tails the backend itself can recover. Registration touches nothing
29
- * on disk and degrades to exactly the pre-patch behavior when no copy
30
- * resolves.
31
- *
32
- * Whitelist discipline: ONLY `activity/status` — the type the plugin
33
- * provably wrote as ephemeral UI frames. Anything else unknown stays
34
- * unknown: upstream's fail-closed ("likely written by a newer harness") is
35
- * a feature — silently skipping a REQUIRED future event would reconstruct
36
- * a wrong session. Retires the day upstream's shared catalog adopts the
37
- * type or ships a real registration API (the add() calls become no-ops).
38
- *
39
- * @module @deepseek-harness-tui/dsh-tui/compat/sessionLog
40
- */
41
1
  import { createRequire } from 'node:module';
42
- import { appendFileSync, existsSync, readdirSync, readFileSync, realpathSync, rmSync, } from 'node:fs';
2
+ import { appendFileSync, closeSync, existsSync, openSync, readdirSync, readFileSync, readSync, realpathSync, rmSync, } from 'node:fs';
43
3
  import { dirname, join, sep } from 'node:path';
44
4
  import { zstdCompressSync, zstdDecompressSync } from 'node:zlib';
45
5
  import { homeDir } from '../../utils/paths.js';
@@ -107,6 +67,523 @@ export function findSessionLogFile(sessionId) {
107
67
  }
108
68
  return undefined;
109
69
  }
70
+ let cachedDecoder;
71
+ function decodeStorageRecord(value) {
72
+ if (cachedDecoder === undefined) {
73
+ const req = createRequire(import.meta.url);
74
+ cachedDecoder = req('@deepseek-ai/dsh-session').decodeStorageRecord;
75
+ }
76
+ return cachedDecoder(value);
77
+ }
78
+ /** I/O slice for streamed log reads. */
79
+ const READ_CHUNK = 64 * 1024;
80
+ /**
81
+ * Compressed-size cap for a single zstd frame, checked DURING accumulation
82
+ * (before any decompress attempt): a bare magic prefix followed by inert
83
+ * bytes must bail instead of buffering unboundedly.
84
+ */
85
+ const MAX_FRAME_BYTES = 64 * 1024 * 1024;
86
+ /**
87
+ * Decompressed-size cap for a single frame: a tiny on-disk bomb must be
88
+ * refused, not exploded into memory.
89
+ */
90
+ const MAX_FRAME_TEXT_BYTES = 64 * 1024 * 1024;
91
+ /**
92
+ * Dual-encoding sibling of {@link findSessionLogFile} for the bounded tree
93
+ * reader: also probes `session.jsonl` (a `compression:"none"` backend),
94
+ * which the rename/delete/title-string path has no use for. Same multi-root
95
+ * scan and id whitelist; compressed still wins when both exist.
96
+ * @param sessionId - Session id (directory name under each workspace dir).
97
+ * @returns The log path and encoding, or undefined when absent.
98
+ */
99
+ function findSessionLogFileAnyEncoding(sessionId) {
100
+ if (!isSafeSessionId(sessionId))
101
+ return undefined;
102
+ for (const root of sessionsRoots()) {
103
+ let workspaces;
104
+ try {
105
+ workspaces = readdirSync(root);
106
+ }
107
+ catch {
108
+ continue;
109
+ }
110
+ for (const ws of workspaces) {
111
+ const dir = join(root, ws, sessionId);
112
+ const compressed = join(dir, 'session.jsonl.zstd');
113
+ if (existsSync(compressed))
114
+ return { path: compressed, compressed: true };
115
+ const plain = join(dir, 'session.jsonl');
116
+ if (existsSync(plain))
117
+ return { path: plain, compressed: false };
118
+ }
119
+ }
120
+ return undefined;
121
+ }
122
+ /**
123
+ * Yield a file's bytes in READ_CHUNK slices. Each yielded buffer is freshly
124
+ * allocated, so consumers may hold frames/lines across yields.
125
+ * @param fd - Open file descriptor (closed by the caller).
126
+ * @yields Raw byte slices in file order.
127
+ */
128
+ function* fileChunks(fd) {
129
+ for (;;) {
130
+ const buf = Buffer.allocUnsafe(READ_CHUNK);
131
+ const n = readSync(fd, buf, 0, READ_CHUNK, null);
132
+ if (n === 0)
133
+ return;
134
+ yield buf.subarray(0, n);
135
+ }
136
+ }
137
+ /**
138
+ * Iterate the concatenated zstd frames of a log lazily, over byte chunks,
139
+ * walking each frame's RFC 8878 structure instead of scanning for magic
140
+ * bytes: magic (4) → frame header descriptor → window descriptor →
141
+ * dictionary id → frame content size → data blocks (3-byte little-endian
142
+ * header: last-block flag, block type, block size) until the last block →
143
+ * optional 4-byte content checksum. Structure walking wins over a magic
144
+ * scan twice over: a magic sequence inside a COMPRESSED payload no longer
145
+ * mis-splits its frame, and the exact frame end is known — so a crash
146
+ * mid-flush leaves a torn FINAL frame that is dropped like the plain
147
+ * reader's unterminated tail line (uncommitted), keeping every committed
148
+ * frame before it readable. Frame bytes accumulate as SEGMENTS (references
149
+ * into the 64 KiB read chunks) with one concat per completed frame; the
150
+ * MAX_FRAME_BYTES cap is checked on the running length, so it fires while
151
+ * the frame is still being read, not after it is buffered. Throws when no
152
+ * complete frame exists at all (not a zstd log / nothing committed), on
153
+ * structural corruption (a reserved block type, non-magic bytes at a frame
154
+ * boundary), or when one frame grows past MAX_FRAME_BYTES.
155
+ * @param chunks - Raw file bytes, in order.
156
+ * @yields Each frame's original compressed byte span, in log order.
157
+ */
158
+ function* zstdFrames(chunks) {
159
+ const stream = chunks[Symbol.iterator]();
160
+ let current = null;
161
+ let pos = 0;
162
+ const advance = () => {
163
+ const next = stream.next();
164
+ if (next.done === true) {
165
+ current = null;
166
+ return false;
167
+ }
168
+ current = next.value;
169
+ pos = 0;
170
+ return true;
171
+ };
172
+ let segments = [];
173
+ let frameLength = 0;
174
+ const append = (bytes) => {
175
+ if (bytes.length === 0)
176
+ return;
177
+ segments.push(bytes);
178
+ frameLength += bytes.length;
179
+ if (frameLength > MAX_FRAME_BYTES) {
180
+ throw new Error(`zstd frame exceeds the ${MAX_FRAME_BYTES}-byte browse cap`);
181
+ }
182
+ };
183
+ /** Pull exactly n structural bytes (≤ 18, concatenating across chunk
184
+ * boundaries); fewer only at EOF. The bytes join the current frame. */
185
+ const field = (n) => {
186
+ const parts = [];
187
+ let left = n;
188
+ while (left > 0) {
189
+ if (current === null && !advance())
190
+ break;
191
+ if (current === null || current.length === pos) {
192
+ current = null;
193
+ continue;
194
+ }
195
+ const take = Math.min(current.length - pos, left);
196
+ parts.push(current.subarray(pos, pos + take));
197
+ pos += take;
198
+ left -= take;
199
+ }
200
+ const out = parts.length === 1 ? parts[0] : Buffer.concat(parts);
201
+ append(out);
202
+ return out;
203
+ };
204
+ /** Swallow exactly n payload bytes into the current frame, in per-chunk
205
+ * pieces (no concat — payloads can be megabytes). Returns the shortfall
206
+ * at EOF (0 when the payload was fully consumed). */
207
+ const payload = (n) => {
208
+ let left = n;
209
+ while (left > 0) {
210
+ if (current === null && !advance())
211
+ return left;
212
+ if (current === null || current.length === pos) {
213
+ current = null;
214
+ continue;
215
+ }
216
+ const take = Math.min(current.length - pos, left);
217
+ append(current.subarray(pos, pos + take));
218
+ pos += take;
219
+ left -= take;
220
+ }
221
+ return 0;
222
+ };
223
+ // EOF partway through a frame is a torn write: committed frames already
224
+ // yielded stay yielded, the partial frame is dropped. Before the FIRST
225
+ // frame completes it instead means "nothing committed" — the old magic
226
+ // scan threw in that case, and the contract is kept.
227
+ let frames = 0;
228
+ const torn = () => frames > 0;
229
+ for (;;) {
230
+ const magic = field(4);
231
+ if (magic.length < 4) {
232
+ // Clean EOF at a frame boundary, or a 1–3 byte torn tail.
233
+ if (magic.length === 0 && frames === 0)
234
+ throw new Error('no zstd frame found');
235
+ if (!torn())
236
+ throw new Error('no complete zstd frame found');
237
+ return;
238
+ }
239
+ if (magic.readUInt32LE(0) !== ZSTD_MAGIC) {
240
+ throw new Error('non-zstd bytes at a frame boundary');
241
+ }
242
+ const descriptor = field(1);
243
+ if (descriptor.length < 1) {
244
+ if (!torn())
245
+ throw new Error('no complete zstd frame found');
246
+ return;
247
+ }
248
+ const d = descriptor[0];
249
+ const fcsFlag = d >>> 6;
250
+ const singleSegment = (d & 0x20) !== 0;
251
+ const hasChecksum = (d & 0x04) !== 0;
252
+ // Dictionary_ID flag: 0/1/2/3 → 0/1/2/4 bytes.
253
+ const dictIdBytes = (d & 0x03) === 3 ? 4 : d & 0x03;
254
+ // Frame_Content_Size: flag 0 → 1 byte only for single-segment frames;
255
+ // flags 1/2/3 → 2/4/8 bytes.
256
+ const fcsBytes = fcsFlag === 0 ? (singleSegment ? 1 : 0) : fcsFlag === 1 ? 2 : fcsFlag === 2 ? 4 : 8;
257
+ const headerBytes = (singleSegment ? 0 : 1) + dictIdBytes + fcsBytes;
258
+ if (field(headerBytes).length < headerBytes) {
259
+ if (!torn())
260
+ throw new Error('no complete zstd frame found');
261
+ return;
262
+ }
263
+ for (;;) {
264
+ const blockHeader = field(3);
265
+ if (blockHeader.length < 3) {
266
+ if (!torn())
267
+ throw new Error('no complete zstd frame found');
268
+ return;
269
+ }
270
+ const packed = blockHeader[0] | (blockHeader[1] << 8) | (blockHeader[2] << 16);
271
+ const lastBlock = (packed & 1) !== 0;
272
+ const blockType = (packed >>> 1) & 0x03;
273
+ if (blockType === 3)
274
+ throw new Error('reserved zstd block type');
275
+ // RLE blocks carry a single byte; raw/compressed carry Block_Size.
276
+ if (payload(blockType === 1 ? 1 : packed >>> 3) > 0) {
277
+ if (!torn())
278
+ throw new Error('no complete zstd frame found');
279
+ return;
280
+ }
281
+ if (lastBlock)
282
+ break;
283
+ }
284
+ if (hasChecksum && field(4).length < 4) {
285
+ if (!torn())
286
+ throw new Error('no complete zstd frame found');
287
+ return;
288
+ }
289
+ frames += 1;
290
+ yield Buffer.concat(segments);
291
+ segments = [];
292
+ frameLength = 0;
293
+ }
294
+ }
295
+ /**
296
+ * Iterate the lines of a plain-text (compression:"none") log lazily. A
297
+ * streaming UTF-8 decoder keeps multi-byte characters intact across read
298
+ * chunks. An unterminated FINAL line is a torn write (a crash mid-append):
299
+ * the backend's own reader ignores uncommitted records, and so does this
300
+ * one — the tree must never show events persistence.load() would not
301
+ * acknowledge.
302
+ * @param chunks - Raw file bytes, in order.
303
+ * @yields Each non-empty newline-terminated line's text, in log order.
304
+ */
305
+ function* plainLines(chunks) {
306
+ const decoder = new TextDecoder('utf-8');
307
+ let pending = '';
308
+ for (const chunk of chunks) {
309
+ pending += decoder.decode(chunk, { stream: true });
310
+ let idx = pending.indexOf('\n');
311
+ while (idx !== -1) {
312
+ const line = pending.slice(0, idx);
313
+ pending = pending.slice(idx + 1);
314
+ if (line.length > 0)
315
+ yield line;
316
+ idx = pending.indexOf('\n');
317
+ }
318
+ }
319
+ // `pending` here (plus any partial code point in the decoder) is the
320
+ // unterminated torn tail — dropped, not yielded.
321
+ }
322
+ /**
323
+ * Iterate the lines of a decoded zstd frame lazily: lines are located by
324
+ * indexOf as the consumer pulls, so a reader stopping at its event budget
325
+ * never allocates the frame's remaining line strings (a single flush can be
326
+ * many MB of text). A COMPLETE frame must end newline-terminated — the
327
+ * backend flushes whole frames, so an unterminated tail line inside one is
328
+ * corruption (the strict backend rejects it too), never a torn write. The
329
+ * check runs UP FRONT, before the first line is yielded: a budget-limited
330
+ * reader returning early must not skip it and misjudge a corrupt frame as
331
+ * merely truncated.
332
+ * @param text - The frame's full decoded text.
333
+ * @yields Each non-empty line's text, in order. Throws on a torn frame.
334
+ */
335
+ function* frameLines(text) {
336
+ if (text.length > 0 && !text.endsWith('\n')) {
337
+ throw new Error('unterminated record inside a zstd frame');
338
+ }
339
+ let pos = 0;
340
+ for (;;) {
341
+ const nl = text.indexOf('\n', pos);
342
+ if (nl === -1)
343
+ return;
344
+ if (nl > pos)
345
+ yield text.slice(pos, nl);
346
+ pos = nl + 1;
347
+ }
348
+ }
349
+ /**
350
+ * Parse one log's storage records (one JSON value per line) lazily, in log
351
+ * order, from whichever on-disk encoding was located. Decompression and
352
+ * parsing happen per frame/line as the consumer pulls, so stopping early
353
+ * (event budget reached) stops the I/O too — with one honest exception: a
354
+ * zstd FRAME is the atomic unit. The next magic (or EOF) delimits it and the
355
+ * whole frame is decompressed and stringified before its first line exists,
356
+ * so a single giant flush (a big seed write, a batched append) costs its
357
+ * full frame size in time and memory regardless of the budget. The budget
358
+ * bounds ACROSS frames; within one frame it only stops line splitting and
359
+ * JSON parsing early.
360
+ * @param fd - Open file descriptor of the log.
361
+ * @param compressed - Whether the log is zstd-framed (vs plain jsonl text).
362
+ * @yields Each line's JSON.parse result, unvalidated.
363
+ */
364
+ function* logRecords(fd, compressed) {
365
+ if (compressed) {
366
+ for (const frame of zstdFrames(fileChunks(fd))) {
367
+ // maxOutputLength is the REAL resource bound: repetitive chunk deltas
368
+ // compress ~56×, so the compressed-byte cap alone says nothing about
369
+ // the text a frame inflates into. Over the limit zstd throws — the
370
+ // log degrades to unreadable rather than ballooning the TUI's RSS.
371
+ const text = zstdDecompressSync(frame, { maxOutputLength: MAX_FRAME_TEXT_BYTES }).toString('utf8');
372
+ for (const line of frameLines(text)) {
373
+ yield JSON.parse(line);
374
+ }
375
+ }
376
+ }
377
+ else {
378
+ for (const line of plainLines(fileChunks(fd))) {
379
+ yield JSON.parse(line);
380
+ }
381
+ }
382
+ }
383
+ /**
384
+ * Sniff a located artifact's encoding from its first bytes: zstd framing
385
+ * declares itself with the magic number; anything else is plain JSONL text.
386
+ * @param path - Candidate log path (must exist).
387
+ * @returns The path with its detected encoding, or undefined when unreadable.
388
+ */
389
+ function sniffLogFile(path) {
390
+ let fd;
391
+ try {
392
+ fd = openSync(path, 'r');
393
+ const head = Buffer.alloc(4);
394
+ const n = readSync(fd, head, 0, 4, 0);
395
+ return { path, compressed: n === 4 && head.readUInt32LE(0) === ZSTD_MAGIC };
396
+ }
397
+ catch {
398
+ return undefined;
399
+ }
400
+ finally {
401
+ if (fd !== undefined) {
402
+ try {
403
+ closeSync(fd);
404
+ }
405
+ catch {
406
+ // A close failure leaves nothing actionable.
407
+ }
408
+ }
409
+ }
410
+ }
411
+ /**
412
+ * Resolve a `persistence.locate()` hint to a readable log. The hint may name
413
+ * the physical artifact directly or the backend's LOGICAL name for it (the
414
+ * jsonl backend's raw-artifact filename carries no encoding suffix), so the
415
+ * compressed twin is probed as well. Encoding is sniffed from content, never
416
+ * inferred from the extension.
417
+ * @param hint - Absolute path from SessionPersistence.locate().
418
+ * @returns The readable log, or undefined when nothing materialized there.
419
+ */
420
+ function resolveLocatedPath(hint) {
421
+ const direct = existsSync(hint) ? sniffLogFile(hint) : undefined;
422
+ if (direct !== undefined)
423
+ return direct;
424
+ const twin = `${hint}.zstd`;
425
+ if (existsSync(twin))
426
+ return { path: twin, compressed: true };
427
+ return undefined;
428
+ }
429
+ /**
430
+ * Shared bounded read loop over a located log. See readSessionEventsFromLog
431
+ * for the contract; this is the file-level entry for backend-resolved paths.
432
+ * Returns undefined ONLY when the log vanished between the location scan and
433
+ * the open — every other failure lands in {@link SessionLogRead.failed}.
434
+ */
435
+ function readEvents(file, maxEvents, maxScanned, skipBelowSeq) {
436
+ let fd;
437
+ try {
438
+ fd = openSync(file.path, 'r');
439
+ }
440
+ catch {
441
+ return undefined;
442
+ }
443
+ let scanned = 0;
444
+ const events = [];
445
+ try {
446
+ for (const record of logRecords(fd, file.compressed)) {
447
+ for (const event of decodeStorageRecord(record)) {
448
+ // The SCAN budget bounds the real cost drivers — I/O, decompression,
449
+ // JSON.parse — which are paid for EVERY envelope, collected or not.
450
+ // Without it, a log carrying hundreds of thousands of skipped rows
451
+ // (ignorable-marked activity frames) forces a full parse just
452
+ // to collect a handful of events, blocking the TUI on panel open.
453
+ scanned += 1;
454
+ if (scanned > maxScanned)
455
+ return { events, complete: false, scanned };
456
+ const envelope = event;
457
+ if (typeof envelope['seq'] !== 'number' || envelope['ignorable'] === true)
458
+ continue;
459
+ // Inherited-prefix skip (session-tree dedup): seqs an ancestor
460
+ // already shows are not collected. They still cost the scan budget
461
+ // (their bytes were read and parsed), but NOT the event budget — a
462
+ // fork of a huge parent is charged only for its OWN events, so two
463
+ // small forks of a 70k-event parent both stay visible. Titles still
464
+ // collect below the cutoff: branch-head labels need them and they
465
+ // never extract into entries.
466
+ if (envelope['seq'] < skipBelowSeq && envelope['type'] !== 'session/title')
467
+ continue;
468
+ // Budget check BEFORE the push: an exact-fit log reports complete,
469
+ // and only a surviving (maxEvents+1)-th event marks truncation.
470
+ if (events.length >= maxEvents)
471
+ return { events, complete: false, scanned };
472
+ events.push(event);
473
+ }
474
+ }
475
+ return { events, complete: true, scanned };
476
+ }
477
+ catch {
478
+ // An EXISTING but undecodable log (corruption, over-cap frame, decode
479
+ // bomb): fail closed — never silently empty, never eligible for an
480
+ // unbounded fallback re-read.
481
+ return { events, complete: false, scanned, failed: true };
482
+ }
483
+ finally {
484
+ try {
485
+ closeSync(fd);
486
+ }
487
+ catch {
488
+ // A close failure leaves nothing actionable — the read already ended.
489
+ }
490
+ }
491
+ }
492
+ /**
493
+ * Default scan budget derived from the event budget: 4× headroom over the
494
+ * collectible events (legitimate logs interleave a modest share of skipped
495
+ * rows — headers, repair-marked ignorable frames), plus a floor so even a
496
+ * tiny `maxEvents` tolerates a noisy prefix. Unbounded reads stay unbounded.
497
+ */
498
+ export function defaultMaxScanned(maxEvents) {
499
+ return Number.isFinite(maxEvents) ? maxEvents * 4 + 4096 : Number.POSITIVE_INFINITY;
500
+ }
501
+ /**
502
+ * File-level sibling of {@link readSessionEventsFromLog} for paths resolved
503
+ * by the backend itself (`persistence.locate`) — covers a custom-configured
504
+ * root that none of the stock sessionsRoots() candidates describes.
505
+ * @param path - Absolute artifact path (physical or logical name).
506
+ * @param maxEvents - Stop before collecting more than this many events.
507
+ * @param maxScanned - Stop after INSPECTING this many envelopes, collected
508
+ * or skipped (default: {@link defaultMaxScanned} of maxEvents).
509
+ * @param skipBelowSeq - Inherited-prefix cutoff (session-tree dedup):
510
+ * seq'd events below it are skipped without spending the event budget —
511
+ * they still count against maxScanned. `session/title` events are always
512
+ * collected (branch-head labels need them; they never become entries).
513
+ * @returns The read outcome, or undefined ONLY when nothing materialized at
514
+ * the path — an existing-but-undecodable log reports `failed: true`.
515
+ */
516
+ export function readSessionEventsFromFile(path, maxEvents = Number.POSITIVE_INFINITY, maxScanned = defaultMaxScanned(maxEvents), skipBelowSeq = 0) {
517
+ const file = resolveLocatedPath(path);
518
+ if (file === undefined)
519
+ return undefined;
520
+ return readEvents(file, maxEvents, maxScanned, skipBelowSeq);
521
+ }
522
+ /**
523
+ * Read a session's events from its persisted log — tolerant, read-only, and
524
+ * cost-bounded. Built for the session tree (buildSessionTree), whose browse
525
+ * must satisfy three constraints the strict backend read cannot:
526
+ *
527
+ * - READ-ONLY: `persistence.inspect` rejects logs carrying third-party
528
+ * event types (working-activity's `activity/status`), and the resume
529
+ * seam's answer (in-process type registration, issue #153) must not be
530
+ * inverted here: opening a picker never rewrites a history log. This
531
+ * reader never writes; unknown types are simply passed through
532
+ * (extractEntries skips what it does not know).
533
+ * - TOLERANT: envelope-shape or decode anomalies degrade to
534
+ * `failed: true` (a structure-only tree node) instead of rejecting the
535
+ * whole log — and a torn FINAL zstd frame (crash mid-flush) is dropped
536
+ * as uncommitted, keeping the frames before it readable.
537
+ * - BOUNDED: the file is read in 64 KiB slices and frames decode lazily,
538
+ * stopping the moment `maxEvents` events have been collected — a
539
+ * 200k-event log costs budget × per-event work, not a whole-file read +
540
+ * decompress + parse. `complete: false` marks the early stop (the caller
541
+ * surfaces it as `truncated`). One honest exception: a single zstd FRAME
542
+ * is the atomic unit (see logRecords) — the budget bounds work ACROSS
543
+ * frames, never inside one giant flush.
544
+ *
545
+ * Packed rows are expanded with the backend's own `decodeStorageRecord`:
546
+ * the packChunks writer folds each run of same-block delta chunks into ONE
547
+ * `text-chunks`/`reasoning-chunks`/`tool-call-chunks` line (the default —
548
+ * the finding that motivated this reader's third revision), so a line is a
549
+ * storage record, not an event, and seq-less rows must not be dropped as if
550
+ * they were headers. The budget counts EXPANDED events, matching the tree's
551
+ * per-event cost. Malformed packed rows throw inside decodeStorageRecord —
552
+ * corrupt storage degrades to `undefined`, never to silently dropped runs.
553
+ *
554
+ * Torn-tail semantics mirror the backend's own reader: a plain log's
555
+ * unterminated final line (crash mid-append) is uncommitted data and
556
+ * ignored, while an unterminated record INSIDE a complete zstd frame is
557
+ * corruption and fails the read.
558
+ *
559
+ * Envelopes with `ignorable: true` are skipped (the read path's own skip
560
+ * signal) and the seq-less header row is metadata, not an event. Skipped
561
+ * envelopes still count against the SCAN budget (maxScanned): skipping is
562
+ * not free — the I/O, decompress and JSON.parse for them have already been
563
+ * paid — so an ignorable-heavy log cannot bypass the cost bound by keeping
564
+ * its collectible count low. Never throws; returns undefined ONLY when the
565
+ * log is absent — an existing-but-undecodable log returns `failed: true`
566
+ * so the caller degrades to a placeholder instead of escalating to an
567
+ * unbounded strict re-read.
568
+ * @param sessionId - Session whose log should be read.
569
+ * @param maxEvents - Stop before collecting more than this many events
570
+ * (default: unbounded). 0 collects nothing and reports complete: false
571
+ * whenever the log holds any collectible event.
572
+ * @param maxScanned - Stop after INSPECTING this many envelopes, collected
573
+ * or skipped (default: 4× maxEvents + 4096; unbounded when maxEvents is).
574
+ * @param skipBelowSeq - Inherited-prefix cutoff (session-tree dedup):
575
+ * seq'd events below it are skipped without spending the event budget —
576
+ * they still count against maxScanned. `session/title` events are always
577
+ * collected (branch-head labels need them; they never become entries).
578
+ * @returns The read outcome — events, completeness, real scan cost, and a
579
+ * `failed` marker for safety-cap/corruption bailouts.
580
+ */
581
+ export function readSessionEventsFromLog(sessionId, maxEvents = Number.POSITIVE_INFINITY, maxScanned = defaultMaxScanned(maxEvents), skipBelowSeq = 0) {
582
+ const file = findSessionLogFileAnyEncoding(sessionId);
583
+ if (file === undefined)
584
+ return undefined;
585
+ return readEvents(file, maxEvents, maxScanned, skipBelowSeq);
586
+ }
110
587
  /**
111
588
  * Decode a (possibly multi-frame) zstd jsonl log. Frames are split by magic
112
589
  * scan; any frame failing to decode or any line failing to parse throws, so
@@ -19,7 +19,7 @@ export declare const UPSTREAM_VALIDATED_VERSIONS: readonly ["0.1.0-rc.6", "0.1.0
19
19
  */
20
20
  export declare const UPSTREAM_FRAMEWORK_MAJORS: Record<string, number>;
21
21
  /** Official packages the adapter consumes at runtime or as types. */
22
- export declare const UPSTREAM_BLESSED_PACKAGES: readonly ["@deepseek-ai/cordis", "@deepseek-ai/schemastery", "@deepseek-ai/dsh-invariants", "@deepseek-ai/dsh-agent", "@deepseek-ai/dsh-agent-instructions", "@deepseek-ai/dsh-agent-presets", "@deepseek-ai/dsh-atomic-write", "@deepseek-ai/dsh-commands", "@deepseek-ai/dsh-cordis-host-runner", "@deepseek-ai/dsh-llm", "@deepseek-ai/dsh-persona", "@deepseek-ai/dsh-session", "@deepseek-ai/dsh-settings", "@deepseek-ai/dsh-skill", "@deepseek-ai/dsh-storage", "@deepseek-ai/dsh-storage-domain", "@deepseek-ai/dsh-storage-json", "@deepseek-ai/dsh-workspace", "@deepseek-ai/dsh-system-prompt", "@deepseek-ai/dsh-terminal", "@deepseek-ai/dsh-terminal-bash", "@deepseek-ai/dsh-tool-ask-user", "@deepseek-ai/dsh-tool-bash-persistent", "@deepseek-ai/dsh-tool-cordis", "@deepseek-ai/dsh-user-approval", "@deepseek-ai/dsh-user-questions"];
22
+ export declare const UPSTREAM_BLESSED_PACKAGES: readonly ["@deepseek-ai/cordis", "@deepseek-ai/schemastery", "@deepseek-ai/dsh-invariants", "@deepseek-ai/dsh-agent", "@deepseek-ai/dsh-agent-instructions", "@deepseek-ai/dsh-agent-presets", "@deepseek-ai/dsh-atomic-write", "@deepseek-ai/dsh-commands", "@deepseek-ai/dsh-cordis-host-runner", "@deepseek-ai/dsh-llm", "@deepseek-ai/dsh-llm-pi-ai", "@deepseek-ai/dsh-persona", "@deepseek-ai/dsh-session", "@deepseek-ai/dsh-settings", "@deepseek-ai/dsh-skill", "@deepseek-ai/dsh-storage", "@deepseek-ai/dsh-storage-domain", "@deepseek-ai/dsh-storage-json", "@deepseek-ai/dsh-workspace", "@deepseek-ai/dsh-system-prompt", "@deepseek-ai/dsh-terminal", "@deepseek-ai/dsh-terminal-bash", "@deepseek-ai/dsh-tool-ask-user", "@deepseek-ai/dsh-tool-bash-persistent", "@deepseek-ai/dsh-tool-cordis", "@deepseek-ai/dsh-user-approval", "@deepseek-ai/dsh-user-questions"];
23
23
  export interface UpstreamDriftEntry {
24
24
  package: string;
25
25
  installed: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/contract.ts"],"names":[],"mappings":"AAiBA,gDAAgD;AAChD,eAAO,MAAM,0BAA0B,eAAe,CAAA;AAEtD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,2BAA2B,iFAM9B,CAAA;AAEV;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAG5D,CAAA;AAED,qEAAqE;AACrE,eAAO,MAAM,yBAAyB,2zBA2B5B,CAAA;AAEV,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,gFAAgF;AAChF,MAAM,MAAM,oBAAoB,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAE5E,wEAAwE;AACxE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,oBAAoB,GAAG,SAAS,CAGlG;AA4BD,uGAAuG;AACvG,eAAO,MAAM,wBAAwB,QAA6D,CAAA;AAYlG,wBAAgB,yBAAyB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAqB9E;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAE9F;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAKnF;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CAQjD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,kBAAkB,EAAE,CAuBpD;AAED;;;;;;GAMG;AAC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AIG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAKnF;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CAQjD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,kBAAkB,EAAE,CAuBpD;AAED;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEtE,wEAAwE;AACxE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,iBAAiB,CAAA;IACvB,sFAAsF;IACtF,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,oBAAoB,GAAG,SAAS,CAuBvE"}
@@ -55,6 +55,7 @@ export const UPSTREAM_BLESSED_PACKAGES = [
55
55
  '@deepseek-ai/dsh-commands',
56
56
  '@deepseek-ai/dsh-cordis-host-runner',
57
57
  '@deepseek-ai/dsh-llm',
58
+ '@deepseek-ai/dsh-llm-pi-ai',
58
59
  '@deepseek-ai/dsh-persona',
59
60
  '@deepseek-ai/dsh-session',
60
61
  '@deepseek-ai/dsh-settings',
@@ -166,7 +166,7 @@ export type TuiSessionSwitchDecision =
166
166
  * before (not currently produced — every switch has a live source).
167
167
  */
168
168
  export interface TuiSessionSwitchedEvent extends TuiDecisionContext {
169
- kind: 'new' | 'resume' | 'rewind';
169
+ kind: 'new' | 'resume' | 'rewind' | 'fork';
170
170
  /** The session that just went live. */
171
171
  sessionId: string;
172
172
  previousSessionId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"extension-events.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/extension-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAYlD;;wEAEwE;AACxE,eAA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-10,6 +10,7 @@ import type { Context } from '@deepseek-ai/cordis';
10
10
  import Schema from '@deepseek-ai/schemastery';
11
11
  import type { SessionModeSpec } from '../sessionModes.js';
12
12
  import { type ScrollGutterMode, type StatusBarConfig, type ToolBackground } from '../tuiDisplayPrefs.js';
13
+ import { type ShortcutActionId } from '../utils/keymap.js';
13
14
  export declare const name = "dsh-tui";
14
15
  export declare const inject: string[];
15
16
  /**
@@ -81,8 +82,17 @@ export interface Config {
81
82
  * `dsh-tui.scrollGutter`): `timeline` turn rail (default), `scrollbar`
82
83
  * proportional thumb, or `hidden`. */
83
84
  scrollGutter?: ScrollGutterMode;
85
+ /** Show the session name as a chip on the prompt top border's right side
86
+ * (settings `dsh-tui.promptSessionLabel`); off by default. */
87
+ promptSessionLabel?: boolean;
84
88
  /** Status-footer field visibility and compact presentation preferences. */
85
89
  statusBar?: Partial<StatusBarConfig>;
90
+ /** Built-in action-shortcut overrides (`paste: 'alt+v'`), keyed by action
91
+ * id (see src/utils/keymap.ts). Combos are `ctrl+`/`alt+`/`shift+` plus a
92
+ * key; several combos may be comma-separated. Unset actions keep their
93
+ * defaults; the `/settings` screen edits the same keys live (its user
94
+ * layer wins over this file). */
95
+ shortcuts?: Partial<Record<ShortcutActionId, string>>;
86
96
  /** Shift+Tab session-mode cycle (array order IS the cycle order; index 0
87
97
  * is the unmarked base mode). Each entry bundles any subset of the
88
98
  * `plan`/`sandbox`/`approval` atoms; absent → the built-in
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,MAAM,MAAM,0BAA0B,CAAA;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAsB,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAA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