@deepseek-harness-tui/dsh-tui 0.10.0 → 0.10.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 (705) hide show
  1. package/README.md +5 -2
  2. package/bin/dsh-tui.js +99 -33
  3. package/cordis.patch.yml +25 -5
  4. package/lib/types/adapter/channel/actions.d.ts +17 -0
  5. package/lib/types/adapter/channel/actions.d.ts.map +1 -0
  6. package/lib/types/adapter/channel/actions.js +28 -0
  7. package/lib/types/adapter/channel/consumer.d.ts +34 -0
  8. package/lib/types/adapter/channel/consumer.d.ts.map +1 -0
  9. package/lib/types/adapter/channel/consumer.js +87 -0
  10. package/lib/types/adapter/channel/features.d.ts +12 -0
  11. package/lib/types/adapter/channel/features.d.ts.map +1 -0
  12. package/lib/types/adapter/channel/features.js +41 -0
  13. package/lib/types/adapter/channel/host-registry.d.ts +40 -0
  14. package/lib/types/adapter/channel/host-registry.d.ts.map +1 -0
  15. package/lib/types/adapter/channel/host-registry.js +120 -0
  16. package/lib/types/adapter/channel/index.d.ts +22 -0
  17. package/lib/types/adapter/channel/index.d.ts.map +1 -0
  18. package/lib/types/adapter/channel/index.js +21 -0
  19. package/lib/types/adapter/channel/internal-token.d.ts +12 -0
  20. package/lib/types/adapter/channel/internal-token.d.ts.map +1 -0
  21. package/lib/types/adapter/channel/internal-token.js +11 -0
  22. package/lib/types/adapter/channel/plugins.d.ts +17 -0
  23. package/lib/types/adapter/channel/plugins.d.ts.map +1 -0
  24. package/lib/types/adapter/channel/plugins.js +47 -0
  25. package/lib/types/adapter/channel/projection.d.ts +15 -0
  26. package/lib/types/adapter/channel/projection.d.ts.map +1 -0
  27. package/lib/types/adapter/channel/projection.js +59 -0
  28. package/lib/types/adapter/channel/provider.d.ts +52 -0
  29. package/lib/types/adapter/channel/provider.d.ts.map +1 -0
  30. package/lib/types/adapter/channel/provider.js +231 -0
  31. package/lib/types/adapter/channel/read-view.d.ts +4 -0
  32. package/lib/types/adapter/channel/read-view.d.ts.map +1 -0
  33. package/lib/types/adapter/channel/read-view.js +132 -0
  34. package/lib/types/adapter/channel/session-projection.d.ts +56 -0
  35. package/lib/types/adapter/channel/session-projection.d.ts.map +1 -0
  36. package/lib/types/adapter/channel/session-projection.js +247 -0
  37. package/lib/types/adapter/channel/state.d.ts +11 -0
  38. package/lib/types/adapter/channel/state.d.ts.map +1 -0
  39. package/lib/types/adapter/channel/state.js +55 -0
  40. package/lib/types/adapter/channel/transcript.d.ts +15 -0
  41. package/lib/types/adapter/channel/transcript.d.ts.map +1 -0
  42. package/lib/types/adapter/channel/transcript.js +22 -0
  43. package/lib/types/adapter/channel/ui-policy.d.ts +106 -0
  44. package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -0
  45. package/lib/types/adapter/channel/ui-policy.js +166 -0
  46. package/lib/types/adapter/channel/ui.d.ts +16 -0
  47. package/lib/types/adapter/channel/ui.d.ts.map +1 -0
  48. package/lib/types/adapter/channel/ui.js +168 -0
  49. package/lib/types/adapter/index.d.ts +20 -0
  50. package/lib/types/adapter/index.d.ts.map +1 -0
  51. package/lib/types/adapter/index.js +19 -0
  52. package/lib/types/adapter/kernel/contract-catalog.d.ts +12 -0
  53. package/lib/types/adapter/kernel/contract-catalog.d.ts.map +1 -0
  54. package/lib/types/adapter/kernel/contract-catalog.js +11 -0
  55. package/lib/types/adapter/kernel/diagnostics.d.ts +18 -0
  56. package/lib/types/adapter/kernel/diagnostics.d.ts.map +1 -0
  57. package/lib/types/adapter/kernel/diagnostics.js +16 -0
  58. package/lib/types/adapter/kernel/driver-types.d.ts +16 -0
  59. package/lib/types/adapter/kernel/driver-types.d.ts.map +1 -0
  60. package/lib/types/adapter/kernel/driver-types.js +8 -0
  61. package/lib/types/adapter/kernel/host-facade.d.ts +65 -0
  62. package/lib/types/adapter/kernel/host-facade.d.ts.map +1 -0
  63. package/lib/types/adapter/kernel/host-facade.js +215 -0
  64. package/lib/types/adapter/kernel/host-probe-access.d.ts +71 -0
  65. package/lib/types/adapter/kernel/host-probe-access.d.ts.map +1 -0
  66. package/lib/types/adapter/kernel/host-probe-access.js +121 -0
  67. package/lib/types/adapter/kernel/index.d.ts +20 -0
  68. package/lib/types/adapter/kernel/index.d.ts.map +1 -0
  69. package/lib/types/adapter/kernel/index.js +19 -0
  70. package/lib/types/adapter/kernel/kernel-runtime.d.ts +138 -0
  71. package/lib/types/adapter/kernel/kernel-runtime.d.ts.map +1 -0
  72. package/lib/types/adapter/kernel/kernel-runtime.js +572 -0
  73. package/lib/types/adapter/kernel/ledger.d.ts +55 -0
  74. package/lib/types/adapter/kernel/ledger.d.ts.map +1 -0
  75. package/lib/types/adapter/kernel/ledger.js +33 -0
  76. package/lib/types/adapter/kernel/legacy-facade.d.ts +22 -0
  77. package/lib/types/adapter/kernel/legacy-facade.d.ts.map +1 -0
  78. package/lib/types/adapter/kernel/legacy-facade.js +34 -0
  79. package/lib/types/adapter/kernel/lifecycle.d.ts +38 -0
  80. package/lib/types/adapter/kernel/lifecycle.d.ts.map +1 -0
  81. package/lib/types/adapter/kernel/lifecycle.js +53 -0
  82. package/lib/types/adapter/kernel/replay-isolation.d.ts +27 -0
  83. package/lib/types/adapter/kernel/replay-isolation.d.ts.map +1 -0
  84. package/lib/types/adapter/kernel/replay-isolation.js +45 -0
  85. package/lib/types/adapter/kernel/replay.d.ts +132 -0
  86. package/lib/types/adapter/kernel/replay.d.ts.map +1 -0
  87. package/lib/types/adapter/kernel/replay.js +425 -0
  88. package/lib/types/adapter/kernel/runtime-context.d.ts +15 -0
  89. package/lib/types/adapter/kernel/runtime-context.d.ts.map +1 -0
  90. package/lib/types/adapter/kernel/runtime-context.js +24 -0
  91. package/lib/types/adapter/kernel/runtime.d.ts +70 -0
  92. package/lib/types/adapter/kernel/runtime.d.ts.map +1 -0
  93. package/lib/types/adapter/kernel/runtime.js +325 -0
  94. package/lib/types/adapter/kernel/slices/channel.d.ts +3 -0
  95. package/lib/types/adapter/kernel/slices/channel.d.ts.map +1 -0
  96. package/lib/types/adapter/kernel/slices/channel.js +8 -0
  97. package/lib/types/adapter/kernel/slices/decisions.d.ts +3 -0
  98. package/lib/types/adapter/kernel/slices/decisions.d.ts.map +1 -0
  99. package/lib/types/adapter/kernel/slices/decisions.js +10 -0
  100. package/lib/types/adapter/kernel/slices/extensions.d.ts +8 -0
  101. package/lib/types/adapter/kernel/slices/extensions.d.ts.map +1 -0
  102. package/lib/types/adapter/kernel/slices/extensions.js +43 -0
  103. package/lib/types/adapter/kernel/slices/index.d.ts +19 -0
  104. package/lib/types/adapter/kernel/slices/index.d.ts.map +1 -0
  105. package/lib/types/adapter/kernel/slices/index.js +36 -0
  106. package/lib/types/adapter/kernel/slices/presentation.d.ts +3 -0
  107. package/lib/types/adapter/kernel/slices/presentation.d.ts.map +1 -0
  108. package/lib/types/adapter/kernel/slices/presentation.js +14 -0
  109. package/lib/types/adapter/kernel/slices/scenes.d.ts +3 -0
  110. package/lib/types/adapter/kernel/slices/scenes.d.ts.map +1 -0
  111. package/lib/types/adapter/kernel/slices/scenes.js +14 -0
  112. package/lib/types/adapter/kernel/slices/settings.d.ts +3 -0
  113. package/lib/types/adapter/kernel/slices/settings.d.ts.map +1 -0
  114. package/lib/types/adapter/kernel/slices/settings.js +12 -0
  115. package/lib/types/adapter/kernel/slices/types.d.ts +20 -0
  116. package/lib/types/adapter/kernel/slices/types.d.ts.map +1 -0
  117. package/lib/types/adapter/kernel/slices/types.js +12 -0
  118. package/lib/types/adapter/kernel/slices/workspace.d.ts +3 -0
  119. package/lib/types/adapter/kernel/slices/workspace.d.ts.map +1 -0
  120. package/lib/types/adapter/kernel/slices/workspace.js +15 -0
  121. package/lib/types/adapter/ports/channel-catalog.d.ts +90 -0
  122. package/lib/types/adapter/ports/channel-catalog.d.ts.map +1 -0
  123. package/lib/types/adapter/ports/channel-catalog.js +2 -0
  124. package/lib/types/adapter/ports/channel-display.d.ts +90 -0
  125. package/lib/types/adapter/ports/channel-display.d.ts.map +1 -0
  126. package/lib/types/adapter/ports/channel-display.js +2 -0
  127. package/lib/types/adapter/ports/channel-session.d.ts +229 -0
  128. package/lib/types/adapter/ports/channel-session.d.ts.map +1 -0
  129. package/lib/types/adapter/ports/channel-session.js +2 -0
  130. package/lib/types/adapter/ports/channel-settings.d.ts +273 -0
  131. package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -0
  132. package/lib/types/adapter/ports/channel-settings.js +1 -0
  133. package/lib/types/adapter/ports/channel-ui.d.ts +569 -0
  134. package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -0
  135. package/lib/types/adapter/ports/channel-ui.js +1 -0
  136. package/lib/types/adapter/ports/channel-view.d.ts +609 -0
  137. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -0
  138. package/lib/types/adapter/ports/channel-view.js +2 -0
  139. package/lib/types/adapter/ports/channel-workspace.d.ts +45 -0
  140. package/lib/types/adapter/ports/channel-workspace.d.ts.map +1 -0
  141. package/lib/types/adapter/ports/channel-workspace.js +2 -0
  142. package/lib/types/adapter/ports/channel.d.ts +145 -0
  143. package/lib/types/adapter/ports/channel.d.ts.map +1 -0
  144. package/lib/types/adapter/ports/channel.js +22 -0
  145. package/lib/types/adapter/ports/decisions.d.ts +18 -0
  146. package/lib/types/adapter/ports/decisions.d.ts.map +1 -0
  147. package/lib/types/adapter/ports/decisions.js +9 -0
  148. package/lib/types/adapter/ports/descriptor.d.ts +25 -0
  149. package/lib/types/adapter/ports/descriptor.d.ts.map +1 -0
  150. package/lib/types/adapter/ports/descriptor.js +11 -0
  151. package/lib/types/adapter/ports/extensions.d.ts +86 -0
  152. package/lib/types/adapter/ports/extensions.d.ts.map +1 -0
  153. package/lib/types/adapter/ports/extensions.js +9 -0
  154. package/lib/types/adapter/ports/index.d.ts +23 -0
  155. package/lib/types/adapter/ports/index.d.ts.map +1 -0
  156. package/lib/types/adapter/ports/index.js +14 -0
  157. package/lib/types/adapter/ports/owner.d.ts +19 -0
  158. package/lib/types/adapter/ports/owner.d.ts.map +1 -0
  159. package/lib/types/adapter/ports/owner.js +9 -0
  160. package/lib/types/adapter/ports/presentation.d.ts +81 -0
  161. package/lib/types/adapter/ports/presentation.d.ts.map +1 -0
  162. package/lib/types/adapter/ports/presentation.js +10 -0
  163. package/lib/types/adapter/ports/scenes.d.ts +24 -0
  164. package/lib/types/adapter/ports/scenes.d.ts.map +1 -0
  165. package/lib/types/adapter/ports/scenes.js +8 -0
  166. package/lib/types/adapter/ports/settings.d.ts +44 -0
  167. package/lib/types/adapter/ports/settings.d.ts.map +1 -0
  168. package/lib/types/adapter/ports/settings.js +9 -0
  169. package/lib/types/adapter/ports/workspace.d.ts +60 -0
  170. package/lib/types/adapter/ports/workspace.d.ts.map +1 -0
  171. package/lib/types/adapter/ports/workspace.js +8 -0
  172. package/lib/types/adapter/spec/index.d.ts +11 -0
  173. package/lib/types/adapter/spec/index.d.ts.map +1 -0
  174. package/lib/types/adapter/spec/index.js +10 -0
  175. package/lib/types/adapter/spec/profile.d.ts +10 -0
  176. package/lib/types/adapter/spec/profile.d.ts.map +1 -0
  177. package/lib/types/adapter/spec/profile.js +9 -0
  178. package/lib/types/adapter/spec/protocol-constants.d.ts +60 -0
  179. package/lib/types/adapter/spec/protocol-constants.d.ts.map +1 -0
  180. package/lib/types/adapter/spec/protocol-constants.js +129 -0
  181. package/lib/types/adapter/spec/tui-contributions.d.ts +18 -0
  182. package/lib/types/adapter/spec/tui-contributions.d.ts.map +1 -0
  183. package/lib/types/adapter/spec/tui-contributions.js +19 -0
  184. package/lib/types/adapter/standard/admission.d.ts +11 -0
  185. package/lib/types/adapter/standard/admission.d.ts.map +1 -0
  186. package/lib/types/adapter/standard/admission.js +10 -0
  187. package/lib/types/adapter/standard/descriptor.d.ts +74 -0
  188. package/lib/types/adapter/standard/descriptor.d.ts.map +1 -0
  189. package/lib/types/adapter/standard/descriptor.js +356 -0
  190. package/lib/types/{dsh-adapter → adapter/standard}/grants.d.ts +8 -3
  191. package/lib/types/adapter/standard/grants.d.ts.map +1 -0
  192. package/lib/types/{dsh-adapter → adapter/standard}/grants.js +14 -8
  193. package/lib/types/adapter/standard/index.d.ts +25 -0
  194. package/lib/types/adapter/standard/index.d.ts.map +1 -0
  195. package/lib/types/adapter/standard/index.js +24 -0
  196. package/lib/types/adapter/standard/negotiate.d.ts.map +1 -0
  197. package/lib/types/{plugin-spec → adapter/standard}/permission-scope.d.ts +3 -8
  198. package/lib/types/adapter/standard/permission-scope.d.ts.map +1 -0
  199. package/lib/types/{plugin-spec → adapter/standard}/permission-scope.js +4 -26
  200. package/lib/types/adapter/standard/protocols.d.ts +12 -0
  201. package/lib/types/adapter/standard/protocols.d.ts.map +1 -0
  202. package/lib/types/adapter/standard/protocols.js +11 -0
  203. package/lib/types/adapter/standard/registry.d.ts.map +1 -0
  204. package/lib/types/{plugin-spec → adapter/standard}/registry.js +3 -15
  205. package/lib/types/adapter/standard/schema-check.d.ts.map +1 -0
  206. package/lib/types/{plugin-spec → adapter/standard}/schema-check.js +4 -2
  207. package/lib/types/adapter/standard/tui-extension.d.ts +25 -0
  208. package/lib/types/adapter/standard/tui-extension.d.ts.map +1 -0
  209. package/lib/types/adapter/standard/tui-extension.js +45 -0
  210. package/lib/types/{plugin-spec → adapter/standard}/types.d.ts +3 -9
  211. package/lib/types/adapter/standard/types.d.ts.map +1 -0
  212. package/lib/types/{plugin-spec → adapter/standard}/validate.d.ts +3 -3
  213. package/lib/types/adapter/standard/validate.d.ts.map +1 -0
  214. package/lib/types/{plugin-spec → adapter/standard}/validate.js +14 -13
  215. package/lib/types/adapter/upstream/channel-driver.d.ts +22 -0
  216. package/lib/types/adapter/upstream/channel-driver.d.ts.map +1 -0
  217. package/lib/types/adapter/upstream/channel-driver.js +424 -0
  218. package/lib/types/adapter/upstream/decisions-driver.d.ts +15 -0
  219. package/lib/types/adapter/upstream/decisions-driver.d.ts.map +1 -0
  220. package/lib/types/adapter/upstream/decisions-driver.js +141 -0
  221. package/lib/types/adapter/upstream/detection.d.ts +26 -0
  222. package/lib/types/adapter/upstream/detection.d.ts.map +1 -0
  223. package/lib/types/adapter/upstream/detection.js +9 -0
  224. package/lib/types/adapter/upstream/driver.d.ts +50 -0
  225. package/lib/types/adapter/upstream/driver.d.ts.map +1 -0
  226. package/lib/types/adapter/upstream/driver.js +8 -0
  227. package/lib/types/adapter/upstream/extensions-driver.d.ts +24 -0
  228. package/lib/types/adapter/upstream/extensions-driver.d.ts.map +1 -0
  229. package/lib/types/adapter/upstream/extensions-driver.js +697 -0
  230. package/lib/types/adapter/upstream/host-descriptor-driver.d.ts +45 -0
  231. package/lib/types/adapter/upstream/host-descriptor-driver.d.ts.map +1 -0
  232. package/lib/types/adapter/upstream/host-descriptor-driver.js +606 -0
  233. package/lib/types/adapter/upstream/index.d.ts +18 -0
  234. package/lib/types/adapter/upstream/index.d.ts.map +1 -0
  235. package/lib/types/adapter/upstream/index.js +15 -0
  236. package/lib/types/adapter/upstream/presentation-driver.d.ts +17 -0
  237. package/lib/types/adapter/upstream/presentation-driver.d.ts.map +1 -0
  238. package/lib/types/adapter/upstream/presentation-driver.js +129 -0
  239. package/lib/types/adapter/upstream/scenes-driver.d.ts +18 -0
  240. package/lib/types/adapter/upstream/scenes-driver.d.ts.map +1 -0
  241. package/lib/types/adapter/upstream/scenes-driver.js +170 -0
  242. package/lib/types/adapter/upstream/settings-driver.d.ts +20 -0
  243. package/lib/types/adapter/upstream/settings-driver.d.ts.map +1 -0
  244. package/lib/types/adapter/upstream/settings-driver.js +173 -0
  245. package/lib/types/adapter/upstream/workspace-driver.d.ts +19 -0
  246. package/lib/types/adapter/upstream/workspace-driver.d.ts.map +1 -0
  247. package/lib/types/adapter/upstream/workspace-driver.js +190 -0
  248. package/lib/types/api.d.ts +1 -1
  249. package/lib/types/api.d.ts.map +1 -1
  250. package/lib/types/commands.d.ts +2 -41
  251. package/lib/types/commands.d.ts.map +1 -1
  252. package/lib/types/commands.js +1 -1
  253. package/lib/types/components/Chat/JobCard.d.ts.map +1 -1
  254. package/lib/types/components/Chat/JobCard.js +8 -1
  255. package/lib/types/components/GoalTodoPanel.d.ts +2 -1
  256. package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
  257. package/lib/types/components/HistorySearchDialog.d.ts.map +1 -1
  258. package/lib/types/components/HistorySearchDialog.js +7 -5
  259. package/lib/types/components/Markdown.d.ts +2 -2
  260. package/lib/types/components/Markdown.d.ts.map +1 -1
  261. package/lib/types/components/Markdown.js +28 -3
  262. package/lib/types/components/MessageList.d.ts.map +1 -1
  263. package/lib/types/components/MessageList.js +46 -17
  264. package/lib/types/components/ModelPicker.d.ts +1 -1
  265. package/lib/types/components/ModelPicker.d.ts.map +1 -1
  266. package/lib/types/components/ModelPicker.js +8 -4
  267. package/lib/types/components/OverlayAbove.d.ts +22 -1
  268. package/lib/types/components/OverlayAbove.d.ts.map +1 -1
  269. package/lib/types/components/OverlayAbove.js +74 -5
  270. package/lib/types/components/PromptInput.d.ts +2 -1
  271. package/lib/types/components/PromptInput.d.ts.map +1 -1
  272. package/lib/types/components/RewindPicker.d.ts.map +1 -1
  273. package/lib/types/components/RewindPicker.js +14 -6
  274. package/lib/types/components/SkillsPicker.d.ts.map +1 -1
  275. package/lib/types/components/SkillsPicker.js +6 -4
  276. package/lib/types/components/Spinner/spinnerMode.d.ts +1 -5
  277. package/lib/types/components/Spinner/spinnerMode.d.ts.map +1 -1
  278. package/lib/types/components/StreamingMarkdown.d.ts.map +1 -1
  279. package/lib/types/components/StreamingMarkdown.js +61 -9
  280. package/lib/types/components/design-system/ThemedBox.d.ts +4 -2
  281. package/lib/types/components/design-system/ThemedBox.d.ts.map +1 -1
  282. package/lib/types/components/design-system/ThemedBox.js +2 -2
  283. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  284. package/lib/types/components/messages/AssistantToolUseMessage.js +69 -25
  285. package/lib/types/components/overlayBudget.d.ts +39 -0
  286. package/lib/types/components/overlayBudget.d.ts.map +1 -0
  287. package/lib/types/components/overlayBudget.js +43 -0
  288. package/lib/types/deepseekBalance.d.ts +2 -36
  289. package/lib/types/deepseekBalance.d.ts.map +1 -1
  290. package/lib/types/deepseekBalance.js +0 -14
  291. package/lib/types/deepseekPricing.d.ts +2 -1
  292. package/lib/types/deepseekPricing.d.ts.map +1 -1
  293. package/lib/types/deepseekPricing.js +8 -1
  294. package/lib/types/dsh-adapter/approvals.d.ts +11 -1
  295. package/lib/types/dsh-adapter/approvals.d.ts.map +1 -1
  296. package/lib/types/dsh-adapter/approvals.js +32 -12
  297. package/lib/types/dsh-adapter/channel/action-readiness.d.ts +20 -0
  298. package/lib/types/dsh-adapter/channel/action-readiness.d.ts.map +1 -0
  299. package/lib/types/dsh-adapter/channel/action-readiness.js +83 -0
  300. package/lib/types/dsh-adapter/channel/activity.d.ts +20 -0
  301. package/lib/types/dsh-adapter/channel/activity.d.ts.map +1 -0
  302. package/lib/types/dsh-adapter/channel/activity.js +113 -0
  303. package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts +64 -0
  304. package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts.map +1 -0
  305. package/lib/types/dsh-adapter/channel/agent-view-projection.js +295 -0
  306. package/lib/types/dsh-adapter/channel/background-action.d.ts +41 -0
  307. package/lib/types/dsh-adapter/channel/background-action.d.ts.map +1 -0
  308. package/lib/types/dsh-adapter/channel/background-action.js +86 -0
  309. package/lib/types/dsh-adapter/channel/binding-events.d.ts +65 -0
  310. package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -0
  311. package/lib/types/dsh-adapter/channel/binding-events.js +169 -0
  312. package/lib/types/dsh-adapter/channel/binding.d.ts +41 -0
  313. package/lib/types/dsh-adapter/channel/binding.d.ts.map +1 -0
  314. package/lib/types/dsh-adapter/channel/binding.js +227 -0
  315. package/lib/types/dsh-adapter/channel/command-completions.d.ts +29 -0
  316. package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -0
  317. package/lib/types/dsh-adapter/channel/command-completions.js +94 -0
  318. package/lib/types/dsh-adapter/channel/commands.d.ts +8 -0
  319. package/lib/types/dsh-adapter/channel/commands.d.ts.map +1 -0
  320. package/lib/types/dsh-adapter/channel/commands.js +9 -0
  321. package/lib/types/dsh-adapter/channel/compaction.d.ts +19 -0
  322. package/lib/types/dsh-adapter/channel/compaction.d.ts.map +1 -0
  323. package/lib/types/dsh-adapter/channel/compaction.js +116 -0
  324. package/lib/types/dsh-adapter/channel/composer-images.d.ts +57 -0
  325. package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -0
  326. package/lib/types/dsh-adapter/channel/composer-images.js +217 -0
  327. package/lib/types/dsh-adapter/channel/composer-mentions.d.ts +15 -0
  328. package/lib/types/dsh-adapter/channel/composer-mentions.d.ts.map +1 -0
  329. package/lib/types/dsh-adapter/channel/composer-mentions.js +200 -0
  330. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +26 -0
  331. package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -0
  332. package/lib/types/dsh-adapter/channel/context-bookkeeping.js +30 -0
  333. package/lib/types/dsh-adapter/channel/decisions.d.ts +19 -0
  334. package/lib/types/dsh-adapter/channel/decisions.d.ts.map +1 -0
  335. package/lib/types/dsh-adapter/channel/decisions.js +90 -0
  336. package/lib/types/dsh-adapter/channel/emitter.d.ts +10 -0
  337. package/lib/types/dsh-adapter/channel/emitter.d.ts.map +1 -0
  338. package/lib/types/dsh-adapter/channel/emitter.js +71 -0
  339. package/lib/types/dsh-adapter/channel/external-commands.d.ts +31 -0
  340. package/lib/types/dsh-adapter/channel/external-commands.d.ts.map +1 -0
  341. package/lib/types/dsh-adapter/channel/external-commands.js +187 -0
  342. package/lib/types/dsh-adapter/channel/file-actions.d.ts +20 -0
  343. package/lib/types/dsh-adapter/channel/file-actions.d.ts.map +1 -0
  344. package/lib/types/dsh-adapter/channel/file-actions.js +45 -0
  345. package/lib/types/dsh-adapter/channel/input-actions.d.ts +13 -0
  346. package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -0
  347. package/lib/types/dsh-adapter/channel/input-actions.js +135 -0
  348. package/lib/types/dsh-adapter/channel/input-delivery.d.ts +37 -0
  349. package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -0
  350. package/lib/types/dsh-adapter/channel/input-delivery.js +305 -0
  351. package/lib/types/dsh-adapter/channel/job-projection.d.ts +28 -0
  352. package/lib/types/dsh-adapter/channel/job-projection.d.ts.map +1 -0
  353. package/lib/types/dsh-adapter/channel/job-projection.js +150 -0
  354. package/lib/types/dsh-adapter/channel/lifetime-resources.d.ts +9 -0
  355. package/lib/types/dsh-adapter/channel/lifetime-resources.d.ts.map +1 -0
  356. package/lib/types/dsh-adapter/channel/lifetime-resources.js +33 -0
  357. package/lib/types/dsh-adapter/channel/loaded-context.d.ts +40 -0
  358. package/lib/types/dsh-adapter/channel/loaded-context.d.ts.map +1 -0
  359. package/lib/types/dsh-adapter/channel/loaded-context.js +62 -0
  360. package/lib/types/dsh-adapter/channel/local-actions.d.ts +70 -0
  361. package/lib/types/dsh-adapter/channel/local-actions.d.ts.map +1 -0
  362. package/lib/types/dsh-adapter/channel/local-actions.js +108 -0
  363. package/lib/types/dsh-adapter/channel/mentions.d.ts +29 -0
  364. package/lib/types/dsh-adapter/channel/mentions.d.ts.map +1 -0
  365. package/lib/types/dsh-adapter/channel/mentions.js +235 -0
  366. package/lib/types/dsh-adapter/channel/mode-actions.d.ts +30 -0
  367. package/lib/types/dsh-adapter/channel/mode-actions.d.ts.map +1 -0
  368. package/lib/types/dsh-adapter/channel/mode-actions.js +247 -0
  369. package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts +35 -0
  370. package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts.map +1 -0
  371. package/lib/types/dsh-adapter/channel/mode-permission-actions.js +199 -0
  372. package/lib/types/dsh-adapter/channel/mode-permission.d.ts +58 -0
  373. package/lib/types/dsh-adapter/channel/mode-permission.d.ts.map +1 -0
  374. package/lib/types/dsh-adapter/channel/mode-permission.js +240 -0
  375. package/lib/types/dsh-adapter/channel/mode-roster.d.ts +51 -0
  376. package/lib/types/dsh-adapter/channel/mode-roster.d.ts.map +1 -0
  377. package/lib/types/dsh-adapter/channel/mode-roster.js +119 -0
  378. package/lib/types/dsh-adapter/channel/model-actions.d.ts +46 -0
  379. package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -0
  380. package/lib/types/dsh-adapter/channel/model-actions.js +275 -0
  381. package/lib/types/dsh-adapter/channel/model-switch.d.ts +32 -0
  382. package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -0
  383. package/lib/types/dsh-adapter/channel/model-switch.js +98 -0
  384. package/lib/types/dsh-adapter/channel/notifications.d.ts +9 -0
  385. package/lib/types/dsh-adapter/channel/notifications.d.ts.map +1 -0
  386. package/lib/types/dsh-adapter/channel/notifications.js +24 -0
  387. package/lib/types/dsh-adapter/channel/owner.d.ts +18 -0
  388. package/lib/types/dsh-adapter/channel/owner.d.ts.map +1 -0
  389. package/lib/types/dsh-adapter/channel/owner.js +73 -0
  390. package/lib/types/dsh-adapter/channel/paths.d.ts +31 -0
  391. package/lib/types/dsh-adapter/channel/paths.d.ts.map +1 -0
  392. package/lib/types/dsh-adapter/channel/paths.js +147 -0
  393. package/lib/types/dsh-adapter/channel/permissions.d.ts +40 -0
  394. package/lib/types/dsh-adapter/channel/permissions.d.ts.map +1 -0
  395. package/lib/types/dsh-adapter/channel/permissions.js +187 -0
  396. package/lib/types/dsh-adapter/channel/preferences.d.ts +3 -0
  397. package/lib/types/dsh-adapter/channel/preferences.d.ts.map +1 -0
  398. package/lib/types/dsh-adapter/channel/preferences.js +103 -0
  399. package/lib/types/dsh-adapter/channel/projection-helpers.d.ts +13 -0
  400. package/lib/types/dsh-adapter/channel/projection-helpers.d.ts.map +1 -0
  401. package/lib/types/dsh-adapter/channel/projection-helpers.js +63 -0
  402. package/lib/types/dsh-adapter/channel/projection.d.ts +40 -0
  403. package/lib/types/dsh-adapter/channel/projection.d.ts.map +1 -0
  404. package/lib/types/dsh-adapter/channel/projection.js +1021 -0
  405. package/lib/types/dsh-adapter/channel/reports.d.ts +32 -0
  406. package/lib/types/dsh-adapter/channel/reports.d.ts.map +1 -0
  407. package/lib/types/dsh-adapter/channel/reports.js +171 -0
  408. package/lib/types/dsh-adapter/channel/session-actions.d.ts +13 -0
  409. package/lib/types/dsh-adapter/channel/session-actions.d.ts.map +1 -0
  410. package/lib/types/dsh-adapter/channel/session-actions.js +29 -0
  411. package/lib/types/dsh-adapter/channel/session-adoption.d.ts +32 -0
  412. package/lib/types/dsh-adapter/channel/session-adoption.d.ts.map +1 -0
  413. package/lib/types/dsh-adapter/channel/session-adoption.js +35 -0
  414. package/lib/types/dsh-adapter/channel/session-fork.d.ts +19 -0
  415. package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -0
  416. package/lib/types/dsh-adapter/channel/session-fork.js +85 -0
  417. package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +32 -0
  418. package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -0
  419. package/lib/types/dsh-adapter/channel/session-live-adoption.js +62 -0
  420. package/lib/types/dsh-adapter/channel/session-metadata.d.ts +81 -0
  421. package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -0
  422. package/lib/types/dsh-adapter/channel/session-metadata.js +209 -0
  423. package/lib/types/dsh-adapter/channel/session-reset.d.ts +11 -0
  424. package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -0
  425. package/lib/types/dsh-adapter/channel/session-reset.js +44 -0
  426. package/lib/types/dsh-adapter/channel/session-resume.d.ts +56 -0
  427. package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -0
  428. package/lib/types/dsh-adapter/channel/session-resume.js +240 -0
  429. package/lib/types/dsh-adapter/channel/session-rewind.d.ts +19 -0
  430. package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -0
  431. package/lib/types/dsh-adapter/channel/session-rewind.js +128 -0
  432. package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts +19 -0
  433. package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -0
  434. package/lib/types/dsh-adapter/channel/session-tree-actions.js +138 -0
  435. package/lib/types/dsh-adapter/channel/session-tree.d.ts +10 -0
  436. package/lib/types/dsh-adapter/channel/session-tree.d.ts.map +1 -0
  437. package/lib/types/dsh-adapter/channel/session-tree.js +503 -0
  438. package/lib/types/dsh-adapter/channel/settings-host.d.ts +4 -0
  439. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -0
  440. package/lib/types/dsh-adapter/channel/settings-host.js +256 -0
  441. package/lib/types/dsh-adapter/channel/skill-catalog.d.ts +33 -0
  442. package/lib/types/dsh-adapter/channel/skill-catalog.d.ts.map +1 -0
  443. package/lib/types/dsh-adapter/channel/skill-catalog.js +215 -0
  444. package/lib/types/dsh-adapter/channel/state.d.ts +46 -0
  445. package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -0
  446. package/lib/types/dsh-adapter/channel/state.js +31 -0
  447. package/lib/types/dsh-adapter/channel/subagent-projection.d.ts +47 -0
  448. package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -0
  449. package/lib/types/dsh-adapter/channel/subagent-projection.js +140 -0
  450. package/lib/types/dsh-adapter/channel/transcript.d.ts +73 -0
  451. package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -0
  452. package/lib/types/dsh-adapter/channel/transcript.js +312 -0
  453. package/lib/types/dsh-adapter/channel/types.d.ts +162 -0
  454. package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -0
  455. package/lib/types/dsh-adapter/channel/types.js +1 -0
  456. package/lib/types/dsh-adapter/channel/usage.d.ts +13 -0
  457. package/lib/types/dsh-adapter/channel/usage.d.ts.map +1 -0
  458. package/lib/types/dsh-adapter/channel/usage.js +48 -0
  459. package/lib/types/dsh-adapter/channel/workspace-actions.d.ts +20 -0
  460. package/lib/types/dsh-adapter/channel/workspace-actions.d.ts.map +1 -0
  461. package/lib/types/dsh-adapter/channel/workspace-actions.js +56 -0
  462. package/lib/types/dsh-adapter/channel-facade-actions.d.ts +25 -0
  463. package/lib/types/dsh-adapter/channel-facade-actions.d.ts.map +1 -0
  464. package/lib/types/dsh-adapter/channel-facade-actions.js +55 -0
  465. package/lib/types/dsh-adapter/channel-scene-outlet.d.ts +6 -0
  466. package/lib/types/dsh-adapter/channel-scene-outlet.d.ts.map +1 -0
  467. package/lib/types/dsh-adapter/channel-scene-outlet.js +13 -0
  468. package/lib/types/dsh-adapter/channel-ui.d.ts +9 -0
  469. package/lib/types/dsh-adapter/channel-ui.d.ts.map +1 -0
  470. package/lib/types/dsh-adapter/channel-ui.js +128 -0
  471. package/lib/types/dsh-adapter/channel.d.ts +9 -1525
  472. package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
  473. package/lib/types/dsh-adapter/channel.js +753 -8145
  474. package/lib/types/dsh-adapter/command-trees.d.ts +1 -0
  475. package/lib/types/dsh-adapter/command-trees.d.ts.map +1 -1
  476. package/lib/types/dsh-adapter/command-trees.js +20 -1
  477. package/lib/types/dsh-adapter/compat/liveSession.d.ts +8 -4
  478. package/lib/types/dsh-adapter/compat/liveSession.d.ts.map +1 -1
  479. package/lib/types/dsh-adapter/compat/liveSession.js +28 -3
  480. package/lib/types/dsh-adapter/compat/persistence.d.ts +21 -0
  481. package/lib/types/dsh-adapter/compat/persistence.d.ts.map +1 -0
  482. package/lib/types/dsh-adapter/compat/persistence.js +17 -0
  483. package/lib/types/dsh-adapter/compat/sessionLog.d.ts +50 -11
  484. package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
  485. package/lib/types/dsh-adapter/compat/sessionLog.js +325 -36
  486. package/lib/types/dsh-adapter/component-identity.d.ts +1 -1
  487. package/lib/types/dsh-adapter/component-identity.d.ts.map +1 -1
  488. package/lib/types/dsh-adapter/component-identity.js +1 -1
  489. package/lib/types/dsh-adapter/contract.d.ts +11 -9
  490. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  491. package/lib/types/dsh-adapter/contract.js +19 -12
  492. package/lib/types/dsh-adapter/decision-guard.d.ts +56 -12
  493. package/lib/types/dsh-adapter/decision-guard.d.ts.map +1 -1
  494. package/lib/types/dsh-adapter/decision-guard.js +134 -22
  495. package/lib/types/dsh-adapter/dialogs.d.ts.map +1 -1
  496. package/lib/types/dsh-adapter/dialogs.js +13 -0
  497. package/lib/types/dsh-adapter/effect-ledger.d.ts +5 -0
  498. package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -1
  499. package/lib/types/dsh-adapter/effect-ledger.js +53 -15
  500. package/lib/types/dsh-adapter/extension-events.d.ts +2 -9
  501. package/lib/types/dsh-adapter/extension-events.d.ts.map +1 -1
  502. package/lib/types/dsh-adapter/extension-events.js +0 -20
  503. package/lib/types/dsh-adapter/extensions.d.ts.map +1 -1
  504. package/lib/types/dsh-adapter/extensions.js +3 -2
  505. package/lib/types/dsh-adapter/host-grants.d.ts +23 -0
  506. package/lib/types/dsh-adapter/host-grants.d.ts.map +1 -0
  507. package/lib/types/dsh-adapter/host-grants.js +45 -0
  508. package/lib/types/dsh-adapter/jobs.d.ts +2 -46
  509. package/lib/types/dsh-adapter/jobs.d.ts.map +1 -1
  510. package/lib/types/dsh-adapter/jobs.js +0 -25
  511. package/lib/types/dsh-adapter/message-observer.d.ts +15 -2
  512. package/lib/types/dsh-adapter/message-observer.d.ts.map +1 -1
  513. package/lib/types/dsh-adapter/message-observer.js +157 -28
  514. package/lib/types/dsh-adapter/plugin-host.d.ts +80 -11
  515. package/lib/types/dsh-adapter/plugin-host.d.ts.map +1 -1
  516. package/lib/types/dsh-adapter/plugin-host.js +438 -41
  517. package/lib/types/dsh-adapter/plugin-storage.d.ts +11 -1
  518. package/lib/types/dsh-adapter/plugin-storage.d.ts.map +1 -1
  519. package/lib/types/dsh-adapter/plugin-storage.js +150 -11
  520. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  521. package/lib/types/dsh-adapter/plugin.js +75 -34
  522. package/lib/types/dsh-adapter/plugins-info.d.ts +2 -2
  523. package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
  524. package/lib/types/dsh-adapter/plugins-info.js +11 -6
  525. package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
  526. package/lib/types/dsh-adapter/presets.js +3 -2
  527. package/lib/types/dsh-adapter/providerWizard.d.ts +2 -159
  528. package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
  529. package/lib/types/dsh-adapter/questions.d.ts +8 -0
  530. package/lib/types/dsh-adapter/questions.d.ts.map +1 -1
  531. package/lib/types/dsh-adapter/questions.js +18 -0
  532. package/lib/types/dsh-adapter/recap.d.ts +1 -9
  533. package/lib/types/dsh-adapter/recap.d.ts.map +1 -1
  534. package/lib/types/dsh-adapter/recap.js +0 -14
  535. package/lib/types/dsh-adapter/renderers.d.ts +1 -0
  536. package/lib/types/dsh-adapter/renderers.d.ts.map +1 -1
  537. package/lib/types/dsh-adapter/renderers.js +26 -1
  538. package/lib/types/dsh-adapter/scenes.d.ts +3 -1
  539. package/lib/types/dsh-adapter/scenes.d.ts.map +1 -1
  540. package/lib/types/dsh-adapter/scenes.js +31 -0
  541. package/lib/types/dsh-adapter/sessionTree.d.ts +14 -95
  542. package/lib/types/dsh-adapter/sessionTree.d.ts.map +1 -1
  543. package/lib/types/dsh-adapter/sessionTree.js +51 -36
  544. package/lib/types/dsh-adapter/sessions/digest.d.ts.map +1 -1
  545. package/lib/types/dsh-adapter/sessions/digest.js +40 -19
  546. package/lib/types/dsh-adapter/sessions/frames.js +2 -0
  547. package/lib/types/dsh-adapter/sessions/index.d.ts +1 -1
  548. package/lib/types/dsh-adapter/sessions/index.d.ts.map +1 -1
  549. package/lib/types/dsh-adapter/sessions/index.js +1 -1
  550. package/lib/types/dsh-adapter/sessions/list.d.ts +23 -0
  551. package/lib/types/dsh-adapter/sessions/list.d.ts.map +1 -1
  552. package/lib/types/dsh-adapter/sessions/list.js +28 -17
  553. package/lib/types/dsh-adapter/sessions/store.d.ts +2 -2
  554. package/lib/types/dsh-adapter/sessions/store.d.ts.map +1 -1
  555. package/lib/types/dsh-adapter/sessions/store.js +12 -11
  556. package/lib/types/dsh-adapter/sessions/types.d.ts +4 -128
  557. package/lib/types/dsh-adapter/sessions/types.d.ts.map +1 -1
  558. package/lib/types/dsh-adapter/sessions/types.js +0 -13
  559. package/lib/types/dsh-adapter/settings-sections.d.ts +4 -95
  560. package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
  561. package/lib/types/dsh-adapter/settings-sections.js +50 -13
  562. package/lib/types/dsh-adapter/settingsEditor.d.ts +2 -36
  563. package/lib/types/dsh-adapter/settingsEditor.d.ts.map +1 -1
  564. package/lib/types/dsh-adapter/settingsEditor.js +0 -18
  565. package/lib/types/dsh-adapter/shortcuts.d.ts +5 -0
  566. package/lib/types/dsh-adapter/shortcuts.d.ts.map +1 -1
  567. package/lib/types/dsh-adapter/shortcuts.js +49 -0
  568. package/lib/types/dsh-adapter/status.d.ts +5 -0
  569. package/lib/types/dsh-adapter/status.d.ts.map +1 -1
  570. package/lib/types/dsh-adapter/status.js +29 -0
  571. package/lib/types/dsh-adapter/subagents.d.ts +9 -49
  572. package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
  573. package/lib/types/dsh-adapter/subagents.js +92 -1
  574. package/lib/types/dsh-adapter/themes.d.ts +1 -0
  575. package/lib/types/dsh-adapter/themes.d.ts.map +1 -1
  576. package/lib/types/dsh-adapter/themes.js +29 -0
  577. package/lib/types/dsh-adapter/toast.d.ts +13 -0
  578. package/lib/types/dsh-adapter/toast.d.ts.map +1 -1
  579. package/lib/types/dsh-adapter/toast.js +31 -1
  580. package/lib/types/dsh-adapter/trajectory/aggregate.d.ts +2 -1
  581. package/lib/types/dsh-adapter/trajectory/aggregate.d.ts.map +1 -1
  582. package/lib/types/dsh-adapter/trajectory/aggregate.js +2 -1
  583. package/lib/types/dsh-adapter/trajectory/guards.d.ts +37 -18
  584. package/lib/types/dsh-adapter/trajectory/guards.d.ts.map +1 -1
  585. package/lib/types/dsh-adapter/trajectory/guards.js +43 -5
  586. package/lib/types/dsh-adapter/trajectory/inspect.d.ts +2 -2
  587. package/lib/types/dsh-adapter/trajectory/inspect.d.ts.map +1 -1
  588. package/lib/types/dsh-adapter/trajectory/projection.d.ts +31 -13
  589. package/lib/types/dsh-adapter/trajectory/projection.d.ts.map +1 -1
  590. package/lib/types/dsh-adapter/trajectory/projection.js +71 -14
  591. package/lib/types/dsh-adapter/trajectory/types.d.ts +1 -1
  592. package/lib/types/dsh-adapter/trajectory/types.d.ts.map +1 -1
  593. package/lib/types/dsh-adapter/transcript-images.d.ts +2 -19
  594. package/lib/types/dsh-adapter/transcript-images.d.ts.map +1 -1
  595. package/lib/types/dsh-adapter/workspaces.d.ts +2 -49
  596. package/lib/types/dsh-adapter/workspaces.d.ts.map +1 -1
  597. package/lib/types/dsh-adapter/workspaces.js +23 -3
  598. package/lib/types/i18n.d.ts +19 -7
  599. package/lib/types/i18n.d.ts.map +1 -1
  600. package/lib/types/i18n.js +8 -3
  601. package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
  602. package/lib/types/ink/components/ScrollBox.js +30 -33
  603. package/lib/types/ink/dom.d.ts.map +1 -1
  604. package/lib/types/ink/dom.js +32 -64
  605. package/lib/types/ink/get-max-width.d.ts +7 -15
  606. package/lib/types/ink/get-max-width.d.ts.map +1 -1
  607. package/lib/types/ink/get-max-width.js +7 -20
  608. package/lib/types/ink/ink.d.ts +1 -0
  609. package/lib/types/ink/ink.d.ts.map +1 -1
  610. package/lib/types/ink/ink.js +22 -3
  611. package/lib/types/ink/layout/node.d.ts +2 -0
  612. package/lib/types/ink/layout/node.d.ts.map +1 -1
  613. package/lib/types/ink/layout/yoga.d.ts +1 -0
  614. package/lib/types/ink/layout/yoga.d.ts.map +1 -1
  615. package/lib/types/ink/layout/yoga.js +3 -0
  616. package/lib/types/ink/node-cache.d.ts +11 -0
  617. package/lib/types/ink/node-cache.d.ts.map +1 -1
  618. package/lib/types/ink/node-cache.js +3 -0
  619. package/lib/types/ink/output.d.ts +6 -1
  620. package/lib/types/ink/output.d.ts.map +1 -1
  621. package/lib/types/ink/output.js +55 -65
  622. package/lib/types/ink/render-node-to-output.d.ts +24 -1
  623. package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
  624. package/lib/types/ink/render-node-to-output.js +195 -71
  625. package/lib/types/ink/renderer.d.ts.map +1 -1
  626. package/lib/types/ink/renderer.js +14 -2
  627. package/lib/types/ink/styles.d.ts +12 -0
  628. package/lib/types/ink/styles.d.ts.map +1 -1
  629. package/lib/types/ink/tabstops.d.ts +3 -2
  630. package/lib/types/ink/tabstops.d.ts.map +1 -1
  631. package/lib/types/ink/tabstops.js +5 -4
  632. package/lib/types/ink/wrap-text.js +2 -2
  633. package/lib/types/modelGroups.d.ts +1 -1
  634. package/lib/types/modelGroups.d.ts.map +1 -1
  635. package/lib/types/modelRoute.js +1 -1
  636. package/lib/types/native-ts/yoga-layout/index.d.ts +8 -3
  637. package/lib/types/native-ts/yoga-layout/index.d.ts.map +1 -1
  638. package/lib/types/native-ts/yoga-layout/index.js +23 -8
  639. package/lib/types/plugin-host.d.ts +3 -4
  640. package/lib/types/plugin-host.d.ts.map +1 -1
  641. package/lib/types/plugin-host.js +8 -6
  642. package/lib/types/screens/AgentView.d.ts +1 -1
  643. package/lib/types/screens/AgentView.d.ts.map +1 -1
  644. package/lib/types/screens/Chat.d.ts +3 -2
  645. package/lib/types/screens/Chat.d.ts.map +1 -1
  646. package/lib/types/screens/Chat.js +91 -17
  647. package/lib/types/screens/SessionBrowser.d.ts +1 -1
  648. package/lib/types/screens/SessionBrowser.d.ts.map +1 -1
  649. package/lib/types/screens/SessionTree.d.ts +1 -1
  650. package/lib/types/screens/SessionTree.d.ts.map +1 -1
  651. package/lib/types/screens/Settings.d.ts +1 -1
  652. package/lib/types/screens/Settings.d.ts.map +1 -1
  653. package/lib/types/screens/StatusLine.d.ts +1 -1
  654. package/lib/types/screens/StatusLine.d.ts.map +1 -1
  655. package/lib/types/screens/StatusLine.js +40 -1
  656. package/lib/types/screens/TrajectoryScene.d.ts +1 -1
  657. package/lib/types/screens/TrajectoryScene.d.ts.map +1 -1
  658. package/lib/types/sessionModes.d.ts +11 -15
  659. package/lib/types/sessionModes.d.ts.map +1 -1
  660. package/lib/types/sessionModes.js +11 -0
  661. package/lib/types/tuiDisplayPrefs.d.ts +2 -68
  662. package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
  663. package/lib/types/tuiDisplayPrefs.js +5 -1
  664. package/lib/types/utils/credentials.d.ts +13 -0
  665. package/lib/types/utils/credentials.d.ts.map +1 -0
  666. package/lib/types/utils/credentials.js +41 -0
  667. package/lib/types/utils/fileSuggestions.d.ts +2 -9
  668. package/lib/types/utils/fileSuggestions.d.ts.map +1 -1
  669. package/lib/types/utils/fold-long-lines.d.ts +38 -0
  670. package/lib/types/utils/fold-long-lines.d.ts.map +1 -0
  671. package/lib/types/utils/fold-long-lines.js +91 -0
  672. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/pi-ai.d.ts +1 -1
  673. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/profiles.js +4 -0
  674. package/node_modules/@deepseek-harness-tui/dsh-auth/lib/service.js +15 -2
  675. package/node_modules/@deepseek-harness-tui/dsh-auth/package.json +10 -10
  676. package/package.json +125 -81
  677. package/presets/liangshen/.dsh-tui-managed.json +1 -1
  678. package/presets/liangshen/agent.cordis.yml +20 -4
  679. package/presets/liangshen/compaction-epoch.mjs +3 -1
  680. package/presets/liangshen/instruction-hint.mjs +2 -1
  681. package/presets/liangshen/session-events.mjs +8 -0
  682. package/lib/types/dsh-adapter/grants.d.ts.map +0 -1
  683. package/lib/types/dsh-adapter/host-descriptor.d.ts +0 -24
  684. package/lib/types/dsh-adapter/host-descriptor.d.ts.map +0 -1
  685. package/lib/types/dsh-adapter/host-descriptor.js +0 -169
  686. package/lib/types/dsh-adapter/plugin-test-utils.d.ts +0 -62
  687. package/lib/types/dsh-adapter/plugin-test-utils.d.ts.map +0 -1
  688. package/lib/types/dsh-adapter/plugin-test-utils.js +0 -61
  689. package/lib/types/plugin-spec/negotiate.d.ts.map +0 -1
  690. package/lib/types/plugin-spec/permission-scope.d.ts.map +0 -1
  691. package/lib/types/plugin-spec/registry.d.ts.map +0 -1
  692. package/lib/types/plugin-spec/schema-check.d.ts.map +0 -1
  693. package/lib/types/plugin-spec/tui-extension.d.ts +0 -16
  694. package/lib/types/plugin-spec/tui-extension.d.ts.map +0 -1
  695. package/lib/types/plugin-spec/tui-extension.js +0 -79
  696. package/lib/types/plugin-spec/types.d.ts.map +0 -1
  697. package/lib/types/plugin-spec/validate.d.ts.map +0 -1
  698. package/lib/types/test-utils.d.ts +0 -2
  699. package/lib/types/test-utils.d.ts.map +0 -1
  700. package/lib/types/test-utils.js +0 -8
  701. /package/lib/types/{plugin-spec → adapter/standard}/negotiate.d.ts +0 -0
  702. /package/lib/types/{plugin-spec → adapter/standard}/negotiate.js +0 -0
  703. /package/lib/types/{plugin-spec → adapter/standard}/registry.d.ts +0 -0
  704. /package/lib/types/{plugin-spec → adapter/standard}/schema-check.d.ts +0 -0
  705. /package/lib/types/{plugin-spec → adapter/standard}/types.js +0 -0
@@ -0,0 +1,140 @@
1
+ import { markChannelReadDirty } from '../../adapter/channel/read-view.js';
2
+ import { SubagentActivityStore } from '../subagents.js';
3
+ /** Current-session subagent store, row projection and frame-batched stream
4
+ * bridge. The owning channel installs transport subscriptions; this module
5
+ * only accepts scoped events and never captures a replaceable agent itself. */
6
+ export function createSubagentProjection(getState, deps) {
7
+ const store = new SubagentActivityStore();
8
+ const rowsByAgentId = new Map();
9
+ const pendingTaskDescriptions = [];
10
+ let streamDirty = false;
11
+ const syncRows = (snapshot = store.snapshot()) => {
12
+ const state = getState();
13
+ for (const sub of snapshot) {
14
+ let row = rowsByAgentId.get(sub.agentId);
15
+ if (!row) {
16
+ row = { id: deps.rowIds.value++, kind: 'subagent', text: sub.description, subagent: undefined };
17
+ rowsByAgentId.set(sub.agentId, row);
18
+ state.rows.push(row);
19
+ }
20
+ const view = {
21
+ agentId: sub.agentId, runId: sub.runId, description: sub.description,
22
+ provider: sub.provider, model: sub.model || 'default', effort: sub.effort,
23
+ status: sub.status, startedAt: sub.startedAt, completedAt: sub.completedAt,
24
+ durationMs: sub.completedAt ? sub.completedAt - sub.startedAt : Date.now() - sub.startedAt,
25
+ outputLines: sub.output.slice(-3), toolCalls: sub.toolCalls, tokens: sub.tokens,
26
+ summary: sub.summary, stopReason: sub.stopReason, error: sub.error,
27
+ };
28
+ row.subagent = view;
29
+ row.text = sub.description;
30
+ markChannelReadDirty(row);
31
+ markChannelReadDirty(state.rows);
32
+ }
33
+ };
34
+ const syncNow = () => {
35
+ streamDirty = false;
36
+ const snapshot = store.snapshot();
37
+ getState().subagents = snapshot;
38
+ syncRows(snapshot);
39
+ };
40
+ const flush = () => {
41
+ if (!streamDirty)
42
+ return false;
43
+ syncNow();
44
+ return true;
45
+ };
46
+ const onSessionEvent = (session, event) => {
47
+ const id = store.getSubagentIdBySession(session);
48
+ if (id === undefined)
49
+ return false;
50
+ store.onSessionEvent(id, event);
51
+ if (event.type === 'assistant/chunk') {
52
+ streamDirty = true;
53
+ getState().emitStream();
54
+ }
55
+ else {
56
+ syncNow();
57
+ getState().emit();
58
+ }
59
+ return true;
60
+ };
61
+ // 0.1.5 live stream frames for child agents: the payload carries the Agent
62
+ // (not its session), so resolve the subagent through its bound session.
63
+ const onStreamFrame = (agent, frame) => {
64
+ const session = agent?.session;
65
+ const id = session !== undefined && session !== null ? store.getSubagentIdBySession(session) : undefined;
66
+ if (id === undefined)
67
+ return false;
68
+ store.onStreamFrame(id, frame);
69
+ if (frame.type === 'chunk') {
70
+ streamDirty = true;
71
+ getState().emitStream();
72
+ }
73
+ else {
74
+ syncNow();
75
+ getState().emit();
76
+ }
77
+ return true;
78
+ };
79
+ const onStart = (info) => {
80
+ if (!info?.id)
81
+ return;
82
+ // The fact that the host spawned a child is authoritative even when its
83
+ // optional discovery seam is absent, unloading, or throws.
84
+ store.onSpawned(info.id, info.provider || 'subagent', info.provider, {
85
+ runId: info.runId ?? info.id,
86
+ local: info.local,
87
+ description: pendingTaskDescriptions.shift() ?? `${info.provider || 'subagent'} task`,
88
+ });
89
+ try {
90
+ const child = deps.lookupChild(info.id);
91
+ if (child?.session) {
92
+ store.linkSession(info.id, child.session);
93
+ const model = child.options?.model ?? child.options?.provider;
94
+ if (model)
95
+ store.patch(info.id, { model, provider: child.options?.provider ?? info.provider });
96
+ }
97
+ }
98
+ catch { /* child enrichment is optional; the spawn remains visible */ }
99
+ syncNow();
100
+ getState().emit();
101
+ };
102
+ const onEnd = (info) => {
103
+ if (!info?.id)
104
+ return;
105
+ const output = Array.isArray(info.lastAssistantMessage)
106
+ ? info.lastAssistantMessage.map(block => typeof block === 'object' && block !== null && 'text' in block ? String(block.text ?? '') : '').filter(Boolean).join('\n')
107
+ : '';
108
+ store.flushOutput(info.id);
109
+ if (info.stopReason === 'completed')
110
+ store.onCompleted(info.id, output, info.stopReason);
111
+ else if (info.stopReason === 'cancelled' || info.stopReason === 'aborted')
112
+ store.onCancelled(info.id, info.stopReason, output);
113
+ else
114
+ store.onFailed(info.id, info.stopReason || 'Unknown error');
115
+ syncNow();
116
+ getState().emit();
117
+ };
118
+ const control = {
119
+ interrupt(agentId) {
120
+ const child = store.get(agentId);
121
+ const target = child?.sessionId ?? agentId;
122
+ const runtime = deps.subagents();
123
+ if (!runtime?.interrupt || !target)
124
+ return false;
125
+ try {
126
+ runtime.interrupt(target, { kind: 'ancestor', agent: deps.agent() });
127
+ store.onCancelled(agentId, 'interrupted');
128
+ syncNow();
129
+ getState().emit();
130
+ return true;
131
+ }
132
+ catch {
133
+ return false;
134
+ }
135
+ },
136
+ };
137
+ const dropRows = () => { streamDirty = false; rowsByAgentId.clear(); };
138
+ const reset = () => { dropRows(); pendingTaskDescriptions.length = 0; store.reset(); getState().subagents = []; };
139
+ return { store, control, pendingTaskDescriptions, onSessionEvent, onStreamFrame, onStart, onEnd, syncNow, flush, dropRows, reset };
140
+ }
@@ -0,0 +1,73 @@
1
+ import { type SessionEvent } from '@deepseek-ai/dsh-session';
2
+ import type { ChatRow, ToolResultView, ToolViewPresenter } from './types.js';
3
+ export declare const ARGS_PREVIEW_LIMIT = 160;
4
+ export declare const RESULT_PREVIEW_LIMIT = 240;
5
+ /** Local `!`-command output cap (mirrors the result preview limit). */
6
+ export declare const LOCAL_OUTPUT_LIMIT = 240;
7
+ /**
8
+ * In-memory transcript window cap. Older rows beyond this count are FOLDED:
9
+ * their full-text fields (assistant/reasoning text, tool args/results) are
10
+ * dropped and only the preview/status metadata kept, so a long merge/deploy
11
+ * turn cannot grow the TUI's RAM without bound. The session log remains the
12
+ * complete source of truth (`/export` reads it, `/resume` replays it); the
13
+ * folded row keeps its kind/id so scrolling and selection stay stable.
14
+ */
15
+ export declare const MAX_ROWS = 600;
16
+ export declare function preview(text: string, limit: number): string;
17
+ /**
18
+ * Fold the oldest rows beyond the transcript window cap: drop each row's
19
+ * full-text fields (assistant/reasoning text, tool args/results) and keep
20
+ * only its preview text, kind, id, and seq. Bounds the TUI's retained text
21
+ * without touching the session log (the source of truth for /export and
22
+ * loadOlder). Small local/notice/interrupt rows are left intact (they hold
23
+ * terminal-local text the log cannot restore). Restored rows are exempt so
24
+ * a loadOlder() restore is not instantly undone. Returns the number of rows
25
+ * folded.
26
+ */
27
+ export declare function foldRows(rows: ChatRow[], cap: number, cursor?: {
28
+ rows: unknown;
29
+ index: number;
30
+ }): number;
31
+ /**
32
+ * Restore folded rows from the session log, newest folded batch first.
33
+ * Rebuilds each folded row's full text from its source events and clears
34
+ * the folded mark, keeping row ids, scroll anchors, and selection stable.
35
+ * `views` re-derives the tool presentation views foldRows dropped (the
36
+ * presenters live on the host plane, so the channel passes them in).
37
+ * Returns the number of rows restored.
38
+ */
39
+ export declare function foldBack(rows: ChatRow[], events: readonly SessionEvent[], views?: ToolViewPresenter): number;
40
+ /** Rebuild a folded row's full text from its source session event. */
41
+ export declare function restoreRowFromEvent(row: ChatRow, event: SessionEvent): void;
42
+ /** Render the durable tool-result payload, including provider error details. */
43
+ export declare function toolResultText(event: SessionEvent<'tool/result'>): string;
44
+ /** Phase badge for the harness goal card — mirrors the panel's PhaseBadge. */
45
+ export declare const GOAL_RESULT_BADGE: Record<string, string>;
46
+ /**
47
+ * Summary cards for the harness's goal/todo tools. Their results are machine
48
+ * JSON (`{"goal":{…}}` / `{"todos":[…]}`) that would otherwise dump under the
49
+ * tool card as a raw `⎿ {"goal":…}` line. Matched by tool-name substring AND
50
+ * payload shape, so unrelated tools and plain-text results pass through to
51
+ * the registry/raw-text path untouched. Runs on the live stream and replay.
52
+ */
53
+ export declare function harnessToolResultView(name: string, data: SessionEvent<'tool/result'>['data']): ToolResultView | undefined;
54
+ export declare function toolErrorText(event: SessionEvent<'tool/result'>): string;
55
+ /** Restore a folded tool row's result text from its tool/result event. */
56
+ export declare function restoreToolResult(row: ChatRow, event: SessionEvent<'tool/result'>): void;
57
+ /**
58
+ * Prepare durable events for REPLAY (resume / rewind / model-switch fork):
59
+ * drop settled `assistant/chunk` stream deltas — the sealed
60
+ * `assistant/message` events carry the full text and reasoning blocks, so
61
+ * per-token chunks add nothing to the replayed transcript while costing a
62
+ * per-chunk renderEvent pass (a real 4.5MB session logs ~19k chunks against
63
+ * ~30 messages). The trailing chunk run AFTER the last message belongs to an
64
+ * unfinished step (crash-orphaned turn) and is kept, so a resumed session
65
+ * still shows its partial content. Storage-level packed rows
66
+ * (`text-chunks`/`reasoning-chunks`/`tool-call-chunks`) are dropped the
67
+ * same way — defensive: the jsonl reader expands them, but a future
68
+ * direct-pass path must not resurrect them. Replay-side tps sampling is
69
+ * lost with the chunks (a live metric; lastUsage comes from the message's
70
+ * own usage). Live events never go through this.
71
+ */
72
+ export declare function prepareReplayEvents(events: readonly SessionEvent[]): SessionEvent[];
73
+ //# sourceMappingURL=transcript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/transcript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAG5E,eAAO,MAAM,kBAAkB,MAAM,CAAA;AAErC,eAAO,MAAM,oBAAoB,MAAM,CAAA;AAEvC,uEAAuE;AACvE,eAAO,MAAM,kBAAkB,MAAM,CAAA;AAErC;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,MAAM,CAAA;AAE3B,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,OAAO,EAAE,EACf,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACxC,MAAM,CAsCR;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,SAAS,YAAY,EAAE,EAAE,KAAK,CAAC,EAAE,iBAAiB,GAAG,MAAM,CA8C5G;AAED,sEAAsE;AACtE,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,CA+B3E;AAED,gFAAgF;AAChF,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,CAAC,aAAa,CAAC,GAAG,MAAM,CAIzE;AAED,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAKpD,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,GACxC,cAAc,GAAG,SAAS,CA8C5B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,CAAC,aAAa,CAAC,GAAG,MAAM,CAMxE;AAED,0EAA0E;AAC1E,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,CAAC,aAAa,CAAC,GAAG,IAAI,CAWxF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,YAAY,EAAE,CA2BnF"}
@@ -0,0 +1,312 @@
1
+ import { markChannelReadDirty } from '../../adapter/channel/read-view.js';
2
+ export const ARGS_PREVIEW_LIMIT = 160;
3
+ export const RESULT_PREVIEW_LIMIT = 240;
4
+ /** Local `!`-command output cap (mirrors the result preview limit). */
5
+ export const LOCAL_OUTPUT_LIMIT = 240;
6
+ /**
7
+ * In-memory transcript window cap. Older rows beyond this count are FOLDED:
8
+ * their full-text fields (assistant/reasoning text, tool args/results) are
9
+ * dropped and only the preview/status metadata kept, so a long merge/deploy
10
+ * turn cannot grow the TUI's RAM without bound. The session log remains the
11
+ * complete source of truth (`/export` reads it, `/resume` replays it); the
12
+ * folded row keeps its kind/id so scrolling and selection stay stable.
13
+ */
14
+ export const MAX_ROWS = 600;
15
+ export function preview(text, limit) {
16
+ const flat = text.replace(/\s+/g, ' ').trim();
17
+ return flat.length <= limit ? flat : `${flat.slice(0, limit)}…`;
18
+ }
19
+ /**
20
+ * Fold the oldest rows beyond the transcript window cap: drop each row's
21
+ * full-text fields (assistant/reasoning text, tool args/results) and keep
22
+ * only its preview text, kind, id, and seq. Bounds the TUI's retained text
23
+ * without touching the session log (the source of truth for /export and
24
+ * loadOlder). Small local/notice/interrupt rows are left intact (they hold
25
+ * terminal-local text the log cannot restore). Restored rows are exempt so
26
+ * a loadOlder() restore is not instantly undone. Returns the number of rows
27
+ * folded.
28
+ */
29
+ export function foldRows(rows, cap, cursor) {
30
+ const excess = rows.length - cap;
31
+ if (excess <= 0) {
32
+ if (cursor !== undefined)
33
+ cursor.index = 0;
34
+ return 0;
35
+ }
36
+ // Incremental pass: rows only ever append past the fold line and the
37
+ // folded/restored exemptions are permanent, so everything below a cursor
38
+ // over the SAME array identity needs no re-inspection. emit/emitStream
39
+ // fold on every frame during streaming — a full rescan of a long window
40
+ // there was the O(rows) per-frame term of long-session streaming.
41
+ const from = cursor === undefined ? 0 : cursor.rows === rows ? cursor.index : 0;
42
+ if (cursor !== undefined)
43
+ cursor.rows = rows;
44
+ if (excess <= from)
45
+ return 0;
46
+ let folded = 0;
47
+ for (const row of rows.slice(from, excess)) {
48
+ if (row.folded || row.restored)
49
+ continue;
50
+ if (row.kind !== 'user' && row.kind !== 'assistant' && row.kind !== 'reasoning' && row.kind !== 'tool')
51
+ continue;
52
+ row.folded = true;
53
+ folded += 1;
54
+ if (row.kind === 'tool' && row.tool) {
55
+ row.tool.argsFull = undefined;
56
+ row.tool.resultFull = undefined;
57
+ row.tool.errorText = undefined;
58
+ // Presentation views hold duplicated content strings (diff before/
59
+ // after images, terminal output); the session log re-derives them.
60
+ row.tool.callView = undefined;
61
+ row.tool.resultView = undefined;
62
+ }
63
+ else if (row.text.length > 0) {
64
+ // Keep a short preview so the transcript reads naturally; the full
65
+ // text lives in the session log and is restored by loadOlder().
66
+ row.text = preview(row.text, 200);
67
+ }
68
+ markChannelReadDirty(row);
69
+ markChannelReadDirty(rows);
70
+ }
71
+ if (cursor !== undefined)
72
+ cursor.index = excess;
73
+ return folded;
74
+ }
75
+ /**
76
+ * Restore folded rows from the session log, newest folded batch first.
77
+ * Rebuilds each folded row's full text from its source events and clears
78
+ * the folded mark, keeping row ids, scroll anchors, and selection stable.
79
+ * `views` re-derives the tool presentation views foldRows dropped (the
80
+ * presenters live on the host plane, so the channel passes them in).
81
+ * Returns the number of rows restored.
82
+ */
83
+ export function foldBack(rows, events, views) {
84
+ const folded = rows.filter(row => row.folded);
85
+ if (folded.length === 0)
86
+ return 0;
87
+ const firstFoldedSeq = folded[0]?.seq ?? 0;
88
+ const restoreEvents = events.filter(event => event.seq >= firstFoldedSeq);
89
+ // tool results are matched by callId, not seq, because the result event
90
+ // seq differs from the call event seq that anchored the row.
91
+ const resultsByCall = new Map();
92
+ for (const event of restoreEvents) {
93
+ if (event.type === 'tool/result') {
94
+ resultsByCall.set(event.data.message.source.callId, event);
95
+ }
96
+ }
97
+ let restored = 0;
98
+ for (const row of folded) {
99
+ const rowSeq = row.seq;
100
+ if (rowSeq === undefined)
101
+ continue;
102
+ if (row.kind === 'tool' && row.tool !== undefined) {
103
+ // The tool row is anchored on its tool/call seq; its result text comes
104
+ // from the matching tool/result event.
105
+ const call = restoreEvents.find(event => event.seq === rowSeq && event.type === 'tool/call');
106
+ if (call === undefined || call.type !== 'tool/call')
107
+ continue;
108
+ restoreRowFromEvent(row, call);
109
+ const result = resultsByCall.get(row.tool.callId);
110
+ if (result !== undefined)
111
+ restoreToolResult(row, result);
112
+ row.tool.callView = views?.call(call.data.name, call.data.arguments);
113
+ row.tool.resultView = result !== undefined && result.data.error === undefined
114
+ ? views?.result(call.data.name, call.data.arguments, result.data)
115
+ : undefined;
116
+ row.folded = false;
117
+ markChannelReadDirty(row);
118
+ markChannelReadDirty(rows);
119
+ restored += 1;
120
+ continue;
121
+ }
122
+ // Text rows are anchored on their first delta chunk; the settled
123
+ // assistant/message at or after that seq carries the full text.
124
+ const message = restoreEvents.find(event => event.seq >= rowSeq && event.type === 'assistant/message');
125
+ if (message === undefined)
126
+ continue;
127
+ restoreRowFromEvent(row, message);
128
+ row.folded = false;
129
+ markChannelReadDirty(row);
130
+ markChannelReadDirty(rows);
131
+ restored += 1;
132
+ }
133
+ return restored;
134
+ }
135
+ /** Rebuild a folded row's full text from its source session event. */
136
+ export function restoreRowFromEvent(row, event) {
137
+ switch (row.kind) {
138
+ case 'user': {
139
+ if (event.type !== 'user/message')
140
+ break;
141
+ const text = event.data.content.map(block => block.type === 'text' ? block.text : '').join('').trim();
142
+ if (text)
143
+ row.text = text;
144
+ break;
145
+ }
146
+ case 'assistant': {
147
+ if (event.type !== 'assistant/message')
148
+ break;
149
+ const text = event.data.message.content.map(block => block.type === 'text' ? block.text : '').join('').trim();
150
+ if (text)
151
+ row.text = text;
152
+ break;
153
+ }
154
+ case 'reasoning': {
155
+ // Thinking text is carried by the assistant/message's reasoning
156
+ // blocks, not the (ephemeral) delta chunks, so the settled message
157
+ // restores it exactly.
158
+ if (event.type !== 'assistant/message')
159
+ break;
160
+ const text = event.data.message.content.map(block => block.type === 'reasoning' ? block.text : '').join('').trim();
161
+ if (text)
162
+ row.text = text;
163
+ break;
164
+ }
165
+ case 'tool': {
166
+ if (event.type !== 'tool/call' || row.tool === undefined)
167
+ break;
168
+ row.tool.argsFull = event.data.arguments;
169
+ break;
170
+ }
171
+ default:
172
+ break;
173
+ }
174
+ }
175
+ /** Render the durable tool-result payload, including provider error details. */
176
+ export function toolResultText(event) {
177
+ const block = event.data.message.content[0];
178
+ if (block === undefined || block.type !== 'tool-result')
179
+ return '';
180
+ return block.content.map(item => item.type === 'text' ? item.text : '').join('').trim();
181
+ }
182
+ /** Phase badge for the harness goal card — mirrors the panel's PhaseBadge. */
183
+ export const GOAL_RESULT_BADGE = {
184
+ active: '● active',
185
+ paused: '⏸ paused',
186
+ blocked: '⛔ blocked',
187
+ complete: '✓ complete',
188
+ };
189
+ /**
190
+ * Summary cards for the harness's goal/todo tools. Their results are machine
191
+ * JSON (`{"goal":{…}}` / `{"todos":[…]}`) that would otherwise dump under the
192
+ * tool card as a raw `⎿ {"goal":…}` line. Matched by tool-name substring AND
193
+ * payload shape, so unrelated tools and plain-text results pass through to
194
+ * the registry/raw-text path untouched. Runs on the live stream and replay.
195
+ */
196
+ export function harnessToolResultView(name, data) {
197
+ const lower = name.toLowerCase();
198
+ const isGoalTool = lower.includes('goal');
199
+ const isTodoTool = lower.includes('todo');
200
+ if (!isGoalTool && !isTodoTool)
201
+ return undefined;
202
+ const block = data.message.content[0];
203
+ if (block === undefined || block.type !== 'tool-result')
204
+ return undefined;
205
+ const text = block.content.map(item => item.type === 'text' ? item.text : '').join('').trim();
206
+ if (text === '' || !text.startsWith('{'))
207
+ return undefined;
208
+ let parsed;
209
+ try {
210
+ parsed = JSON.parse(text);
211
+ }
212
+ catch {
213
+ return undefined;
214
+ }
215
+ if (typeof parsed !== 'object' || parsed === null)
216
+ return undefined;
217
+ const record = parsed;
218
+ if (isGoalTool && typeof record.goal === 'object' && record.goal !== null) {
219
+ const goal = record.goal;
220
+ if (typeof goal.objective === 'string' && typeof goal.phase === 'string') {
221
+ const badge = GOAL_RESULT_BADGE[goal.phase] ?? goal.phase;
222
+ const rounds = typeof goal.roundsStarted === 'number' && typeof goal.maxGoalRounds === 'number'
223
+ ? ` · ${goal.roundsStarted}/${goal.maxGoalRounds}`
224
+ : '';
225
+ const activation = typeof record.activation === 'string' ? ` · ${record.activation}` : '';
226
+ const lines = [`🎯 ${goal.objective}`, `${badge}${rounds}${activation}`];
227
+ const blocked = goal.blockedReason?.message;
228
+ if (typeof blocked === 'string')
229
+ lines.push(`⛔ ${blocked}`);
230
+ return { card: 'generic', content: lines.map(line => ({ type: 'text', text: line })) };
231
+ }
232
+ }
233
+ if (isTodoTool && Array.isArray(record.todos)) {
234
+ const rows = record.todos;
235
+ const done = rows.filter(row => row.status === 'completed').length;
236
+ const lines = [`todos ✓ ${done}/${rows.length}`];
237
+ for (const row of rows) {
238
+ if (row.status !== 'in_progress' || typeof row.content !== 'string')
239
+ continue;
240
+ lines.push(`● ${row.content}`);
241
+ if (lines.length >= 4)
242
+ break;
243
+ }
244
+ return { card: 'generic', content: lines.map(line => ({ type: 'text', text: line })) };
245
+ }
246
+ return undefined;
247
+ }
248
+ export function toolErrorText(event) {
249
+ const failure = event.data.error;
250
+ if (failure === undefined)
251
+ return '';
252
+ const identity = `${failure.name}: ${failure.code}`;
253
+ const detail = toolResultText(event);
254
+ return detail === '' || detail === identity ? identity : `${identity} — ${detail}`;
255
+ }
256
+ /** Restore a folded tool row's result text from its tool/result event. */
257
+ export function restoreToolResult(row, event) {
258
+ if (row.tool === undefined)
259
+ return;
260
+ const failure = event.data.error;
261
+ if (failure !== undefined) {
262
+ row.tool.status = 'error';
263
+ row.tool.errorText = toolErrorText(event);
264
+ return;
265
+ }
266
+ row.tool.status = 'ok';
267
+ const result = toolResultText(event);
268
+ row.tool.resultFull = result || undefined;
269
+ }
270
+ /**
271
+ * Prepare durable events for REPLAY (resume / rewind / model-switch fork):
272
+ * drop settled `assistant/chunk` stream deltas — the sealed
273
+ * `assistant/message` events carry the full text and reasoning blocks, so
274
+ * per-token chunks add nothing to the replayed transcript while costing a
275
+ * per-chunk renderEvent pass (a real 4.5MB session logs ~19k chunks against
276
+ * ~30 messages). The trailing chunk run AFTER the last message belongs to an
277
+ * unfinished step (crash-orphaned turn) and is kept, so a resumed session
278
+ * still shows its partial content. Storage-level packed rows
279
+ * (`text-chunks`/`reasoning-chunks`/`tool-call-chunks`) are dropped the
280
+ * same way — defensive: the jsonl reader expands them, but a future
281
+ * direct-pass path must not resurrect them. Replay-side tps sampling is
282
+ * lost with the chunks (a live metric; lastUsage comes from the message's
283
+ * own usage). Live events never go through this.
284
+ */
285
+ export function prepareReplayEvents(events) {
286
+ let lastMessageSeq = -1;
287
+ for (const event of events) {
288
+ if (event.type === 'assistant/message')
289
+ lastMessageSeq = event.seq;
290
+ }
291
+ return events.filter(event => {
292
+ if (event.type === 'assistant/message')
293
+ return true;
294
+ // Pre-V3 chunk events and storage-level packed rows are not in the
295
+ // current SessionEvent union (0.1.5 embeds the stream inside
296
+ // `assistant/message`), so compare through a widened view — the filters
297
+ // below exist exactly for data the static type doesn't know.
298
+ const packedType = event.type;
299
+ if (packedType === 'assistant/chunk') {
300
+ // Keep only the in-flight tail (no message sealed after it).
301
+ return lastMessageSeq < 0 || event.seq > lastMessageSeq;
302
+ }
303
+ // Storage-level packed rows: the jsonl reader expands them, but a future
304
+ // direct-pass path must not resurrect them.
305
+ if (packedType === 'text-chunks' ||
306
+ packedType === 'reasoning-chunks' ||
307
+ packedType === 'tool-call-chunks') {
308
+ return false;
309
+ }
310
+ return true;
311
+ });
312
+ }