@dsh-cc/tui 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (363) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +144 -0
  3. package/lib/bash-history.d.ts +31 -0
  4. package/lib/bash-history.d.ts.map +1 -0
  5. package/lib/bash-history.js +94 -0
  6. package/lib/bash-history.js.map +1 -0
  7. package/lib/compact-fold.d.ts +35 -0
  8. package/lib/compact-fold.d.ts.map +1 -0
  9. package/lib/compact-fold.js +60 -0
  10. package/lib/compact-fold.js.map +1 -0
  11. package/lib/components/arg-completers.d.ts +22 -0
  12. package/lib/components/arg-completers.d.ts.map +1 -0
  13. package/lib/components/arg-completers.js +75 -0
  14. package/lib/components/arg-completers.js.map +1 -0
  15. package/lib/components/code-theme.d.ts +25 -0
  16. package/lib/components/code-theme.d.ts.map +1 -0
  17. package/lib/components/code-theme.js +137 -0
  18. package/lib/components/code-theme.js.map +1 -0
  19. package/lib/components/completion.d.ts +50 -0
  20. package/lib/components/completion.d.ts.map +1 -0
  21. package/lib/components/completion.js +279 -0
  22. package/lib/components/completion.js.map +1 -0
  23. package/lib/components/diff-card.d.ts +29 -0
  24. package/lib/components/diff-card.d.ts.map +1 -0
  25. package/lib/components/diff-card.js +175 -0
  26. package/lib/components/diff-card.js.map +1 -0
  27. package/lib/components/diff-hunks.d.ts +44 -0
  28. package/lib/components/diff-hunks.d.ts.map +1 -0
  29. package/lib/components/diff-hunks.js +188 -0
  30. package/lib/components/diff-hunks.js.map +1 -0
  31. package/lib/components/editor-history.d.ts +23 -0
  32. package/lib/components/editor-history.d.ts.map +1 -0
  33. package/lib/components/editor-history.js +29 -0
  34. package/lib/components/editor-history.js.map +1 -0
  35. package/lib/components/markdown-theme.d.ts +11 -0
  36. package/lib/components/markdown-theme.d.ts.map +1 -0
  37. package/lib/components/markdown-theme.js +29 -0
  38. package/lib/components/markdown-theme.js.map +1 -0
  39. package/lib/components/masked-input.d.ts +24 -0
  40. package/lib/components/masked-input.d.ts.map +1 -0
  41. package/lib/components/masked-input.js +168 -0
  42. package/lib/components/masked-input.js.map +1 -0
  43. package/lib/components/overlay-host.d.ts +31 -0
  44. package/lib/components/overlay-host.d.ts.map +1 -0
  45. package/lib/components/overlay-host.js +128 -0
  46. package/lib/components/overlay-host.js.map +1 -0
  47. package/lib/components/overlays.d.ts +94 -0
  48. package/lib/components/overlays.d.ts.map +1 -0
  49. package/lib/components/overlays.js +450 -0
  50. package/lib/components/overlays.js.map +1 -0
  51. package/lib/components/provider-box.d.ts +23 -0
  52. package/lib/components/provider-box.d.ts.map +1 -0
  53. package/lib/components/provider-box.js +164 -0
  54. package/lib/components/provider-box.js.map +1 -0
  55. package/lib/components/read-group.d.ts +51 -0
  56. package/lib/components/read-group.d.ts.map +1 -0
  57. package/lib/components/read-group.js +105 -0
  58. package/lib/components/read-group.js.map +1 -0
  59. package/lib/components/root-bash.d.ts +36 -0
  60. package/lib/components/root-bash.d.ts.map +1 -0
  61. package/lib/components/root-bash.js +112 -0
  62. package/lib/components/root-bash.js.map +1 -0
  63. package/lib/components/root-types.d.ts +42 -0
  64. package/lib/components/root-types.d.ts.map +1 -0
  65. package/lib/components/root-types.js +8 -0
  66. package/lib/components/root-types.js.map +1 -0
  67. package/lib/components/root-utils.d.ts +22 -0
  68. package/lib/components/root-utils.d.ts.map +1 -0
  69. package/lib/components/root-utils.js +45 -0
  70. package/lib/components/root-utils.js.map +1 -0
  71. package/lib/components/root.d.ts +25 -0
  72. package/lib/components/root.d.ts.map +1 -0
  73. package/lib/components/root.js +357 -0
  74. package/lib/components/root.js.map +1 -0
  75. package/lib/components/theme.d.ts +61 -0
  76. package/lib/components/theme.d.ts.map +1 -0
  77. package/lib/components/theme.js +99 -0
  78. package/lib/components/theme.js.map +1 -0
  79. package/lib/components/transcript.d.ts +43 -0
  80. package/lib/components/transcript.d.ts.map +1 -0
  81. package/lib/components/transcript.js +203 -0
  82. package/lib/components/transcript.js.map +1 -0
  83. package/lib/components/working-line.d.ts +35 -0
  84. package/lib/components/working-line.d.ts.map +1 -0
  85. package/lib/components/working-line.js +66 -0
  86. package/lib/components/working-line.js.map +1 -0
  87. package/lib/effort-catalog.d.ts +27 -0
  88. package/lib/effort-catalog.d.ts.map +1 -0
  89. package/lib/effort-catalog.js +36 -0
  90. package/lib/effort-catalog.js.map +1 -0
  91. package/lib/export-markdown.d.ts +18 -0
  92. package/lib/export-markdown.d.ts.map +1 -0
  93. package/lib/export-markdown.js +124 -0
  94. package/lib/export-markdown.js.map +1 -0
  95. package/lib/harness/approval-preview.d.ts +33 -0
  96. package/lib/harness/approval-preview.d.ts.map +1 -0
  97. package/lib/harness/approval-preview.js +179 -0
  98. package/lib/harness/approval-preview.js.map +1 -0
  99. package/lib/harness/boot-banner.d.ts +14 -0
  100. package/lib/harness/boot-banner.d.ts.map +1 -0
  101. package/lib/harness/boot-banner.js +89 -0
  102. package/lib/harness/boot-banner.js.map +1 -0
  103. package/lib/harness/driver-agent.d.ts +78 -0
  104. package/lib/harness/driver-agent.d.ts.map +1 -0
  105. package/lib/harness/driver-agent.js +314 -0
  106. package/lib/harness/driver-agent.js.map +1 -0
  107. package/lib/harness/driver-agents.d.ts +20 -0
  108. package/lib/harness/driver-agents.d.ts.map +1 -0
  109. package/lib/harness/driver-agents.js +123 -0
  110. package/lib/harness/driver-agents.js.map +1 -0
  111. package/lib/harness/driver-approvals.d.ts +38 -0
  112. package/lib/harness/driver-approvals.d.ts.map +1 -0
  113. package/lib/harness/driver-approvals.js +277 -0
  114. package/lib/harness/driver-approvals.js.map +1 -0
  115. package/lib/harness/driver-bash.d.ts +15 -0
  116. package/lib/harness/driver-bash.d.ts.map +1 -0
  117. package/lib/harness/driver-bash.js +73 -0
  118. package/lib/harness/driver-bash.js.map +1 -0
  119. package/lib/harness/driver-catalog.d.ts +84 -0
  120. package/lib/harness/driver-catalog.d.ts.map +1 -0
  121. package/lib/harness/driver-catalog.js +256 -0
  122. package/lib/harness/driver-catalog.js.map +1 -0
  123. package/lib/harness/driver-ctx.d.ts +462 -0
  124. package/lib/harness/driver-ctx.d.ts.map +1 -0
  125. package/lib/harness/driver-ctx.js +11 -0
  126. package/lib/harness/driver-ctx.js.map +1 -0
  127. package/lib/harness/driver-hud.d.ts +31 -0
  128. package/lib/harness/driver-hud.d.ts.map +1 -0
  129. package/lib/harness/driver-hud.js +204 -0
  130. package/lib/harness/driver-hud.js.map +1 -0
  131. package/lib/harness/driver-live.d.ts +36 -0
  132. package/lib/harness/driver-live.d.ts.map +1 -0
  133. package/lib/harness/driver-live.js +44 -0
  134. package/lib/harness/driver-live.js.map +1 -0
  135. package/lib/harness/driver-modal.d.ts +52 -0
  136. package/lib/harness/driver-modal.d.ts.map +1 -0
  137. package/lib/harness/driver-modal.js +78 -0
  138. package/lib/harness/driver-modal.js.map +1 -0
  139. package/lib/harness/driver-mode.d.ts +35 -0
  140. package/lib/harness/driver-mode.d.ts.map +1 -0
  141. package/lib/harness/driver-mode.js +84 -0
  142. package/lib/harness/driver-mode.js.map +1 -0
  143. package/lib/harness/driver-pickers.d.ts +48 -0
  144. package/lib/harness/driver-pickers.d.ts.map +1 -0
  145. package/lib/harness/driver-pickers.js +249 -0
  146. package/lib/harness/driver-pickers.js.map +1 -0
  147. package/lib/harness/driver-promote.d.ts +29 -0
  148. package/lib/harness/driver-promote.d.ts.map +1 -0
  149. package/lib/harness/driver-promote.js +36 -0
  150. package/lib/harness/driver-promote.js.map +1 -0
  151. package/lib/harness/driver-queue.d.ts +19 -0
  152. package/lib/harness/driver-queue.d.ts.map +1 -0
  153. package/lib/harness/driver-queue.js +281 -0
  154. package/lib/harness/driver-queue.js.map +1 -0
  155. package/lib/harness/driver-run-local.d.ts +32 -0
  156. package/lib/harness/driver-run-local.d.ts.map +1 -0
  157. package/lib/harness/driver-run-local.js +366 -0
  158. package/lib/harness/driver-run-local.js.map +1 -0
  159. package/lib/harness/driver-sessions.d.ts +28 -0
  160. package/lib/harness/driver-sessions.d.ts.map +1 -0
  161. package/lib/harness/driver-sessions.js +386 -0
  162. package/lib/harness/driver-sessions.js.map +1 -0
  163. package/lib/harness/driver.d.ts +22 -0
  164. package/lib/harness/driver.d.ts.map +1 -0
  165. package/lib/harness/driver.js +459 -0
  166. package/lib/harness/driver.js.map +1 -0
  167. package/lib/harness/preset.d.ts +32 -0
  168. package/lib/harness/preset.d.ts.map +1 -0
  169. package/lib/harness/preset.js +34 -0
  170. package/lib/harness/preset.js.map +1 -0
  171. package/lib/harness/session-list.d.ts +65 -0
  172. package/lib/harness/session-list.d.ts.map +1 -0
  173. package/lib/harness/session-list.js +91 -0
  174. package/lib/harness/session-list.js.map +1 -0
  175. package/lib/harness/shell-output.d.ts +44 -0
  176. package/lib/harness/shell-output.d.ts.map +1 -0
  177. package/lib/harness/shell-output.js +90 -0
  178. package/lib/harness/shell-output.js.map +1 -0
  179. package/lib/harness/statusline-cc-transcript.d.ts +51 -0
  180. package/lib/harness/statusline-cc-transcript.d.ts.map +1 -0
  181. package/lib/harness/statusline-cc-transcript.js +191 -0
  182. package/lib/harness/statusline-cc-transcript.js.map +1 -0
  183. package/lib/harness/statusline-command.d.ts +54 -0
  184. package/lib/harness/statusline-command.d.ts.map +1 -0
  185. package/lib/harness/statusline-command.js +161 -0
  186. package/lib/harness/statusline-command.js.map +1 -0
  187. package/lib/harness/statusline-payload.d.ts +79 -0
  188. package/lib/harness/statusline-payload.d.ts.map +1 -0
  189. package/lib/harness/statusline-payload.js +93 -0
  190. package/lib/harness/statusline-payload.js.map +1 -0
  191. package/lib/harness/statusline-settings.d.ts +47 -0
  192. package/lib/harness/statusline-settings.d.ts.map +1 -0
  193. package/lib/harness/statusline-settings.js +57 -0
  194. package/lib/harness/statusline-settings.js.map +1 -0
  195. package/lib/harness/statusline-wiring.d.ts +45 -0
  196. package/lib/harness/statusline-wiring.d.ts.map +1 -0
  197. package/lib/harness/statusline-wiring.js +247 -0
  198. package/lib/harness/statusline-wiring.js.map +1 -0
  199. package/lib/harness/usage-view.d.ts +84 -0
  200. package/lib/harness/usage-view.d.ts.map +1 -0
  201. package/lib/harness/usage-view.js +199 -0
  202. package/lib/harness/usage-view.js.map +1 -0
  203. package/lib/harness/worktree-exit.d.ts +105 -0
  204. package/lib/harness/worktree-exit.d.ts.map +1 -0
  205. package/lib/harness/worktree-exit.js +168 -0
  206. package/lib/harness/worktree-exit.js.map +1 -0
  207. package/lib/history.d.ts +50 -0
  208. package/lib/history.d.ts.map +1 -0
  209. package/lib/history.js +139 -0
  210. package/lib/history.js.map +1 -0
  211. package/lib/index.d.ts +63 -0
  212. package/lib/index.d.ts.map +1 -0
  213. package/lib/index.js +54 -0
  214. package/lib/index.js.map +1 -0
  215. package/lib/input.d.ts +158 -0
  216. package/lib/input.d.ts.map +1 -0
  217. package/lib/input.js +400 -0
  218. package/lib/input.js.map +1 -0
  219. package/lib/invariant.d.ts +14 -0
  220. package/lib/invariant.d.ts.map +1 -0
  221. package/lib/invariant.js +20 -0
  222. package/lib/invariant.js.map +1 -0
  223. package/lib/mode-cycle.d.ts +22 -0
  224. package/lib/mode-cycle.d.ts.map +1 -0
  225. package/lib/mode-cycle.js +32 -0
  226. package/lib/mode-cycle.js.map +1 -0
  227. package/lib/model-catalog.d.ts +22 -0
  228. package/lib/model-catalog.d.ts.map +1 -0
  229. package/lib/model-catalog.js +45 -0
  230. package/lib/model-catalog.js.map +1 -0
  231. package/lib/packaged-preset.d.ts +32 -0
  232. package/lib/packaged-preset.d.ts.map +1 -0
  233. package/lib/packaged-preset.js +94 -0
  234. package/lib/packaged-preset.js.map +1 -0
  235. package/lib/plugin.d.ts +11 -0
  236. package/lib/plugin.d.ts.map +1 -0
  237. package/lib/plugin.js +88 -0
  238. package/lib/plugin.js.map +1 -0
  239. package/lib/profile.d.ts +4 -0
  240. package/lib/profile.d.ts.map +1 -0
  241. package/lib/profile.js +7 -0
  242. package/lib/profile.js.map +1 -0
  243. package/lib/project-sessions.d.ts +29 -0
  244. package/lib/project-sessions.d.ts.map +1 -0
  245. package/lib/project-sessions.js +60 -0
  246. package/lib/project-sessions.js.map +1 -0
  247. package/lib/project.d.ts +75 -0
  248. package/lib/project.d.ts.map +1 -0
  249. package/lib/project.js +196 -0
  250. package/lib/project.js.map +1 -0
  251. package/lib/provider-actions.d.ts +37 -0
  252. package/lib/provider-actions.d.ts.map +1 -0
  253. package/lib/provider-actions.js +417 -0
  254. package/lib/provider-actions.js.map +1 -0
  255. package/lib/provider-command.d.ts +109 -0
  256. package/lib/provider-command.d.ts.map +1 -0
  257. package/lib/provider-command.js +220 -0
  258. package/lib/provider-command.js.map +1 -0
  259. package/lib/provider-detail.d.ts +15 -0
  260. package/lib/provider-detail.d.ts.map +1 -0
  261. package/lib/provider-detail.js +201 -0
  262. package/lib/provider-detail.js.map +1 -0
  263. package/lib/provider-flow.d.ts +191 -0
  264. package/lib/provider-flow.d.ts.map +1 -0
  265. package/lib/provider-flow.js +192 -0
  266. package/lib/provider-flow.js.map +1 -0
  267. package/lib/provider-presets.d.ts +32 -0
  268. package/lib/provider-presets.d.ts.map +1 -0
  269. package/lib/provider-presets.js +105 -0
  270. package/lib/provider-presets.js.map +1 -0
  271. package/lib/provider-read.d.ts +63 -0
  272. package/lib/provider-read.d.ts.map +1 -0
  273. package/lib/provider-read.js +115 -0
  274. package/lib/provider-read.js.map +1 -0
  275. package/lib/provider-settings.d.ts +30 -0
  276. package/lib/provider-settings.d.ts.map +1 -0
  277. package/lib/provider-settings.js +65 -0
  278. package/lib/provider-settings.js.map +1 -0
  279. package/lib/resume-target.d.ts +59 -0
  280. package/lib/resume-target.d.ts.map +1 -0
  281. package/lib/resume-target.js +143 -0
  282. package/lib/resume-target.js.map +1 -0
  283. package/lib/slash.d.ts +44 -0
  284. package/lib/slash.d.ts.map +1 -0
  285. package/lib/slash.js +81 -0
  286. package/lib/slash.js.map +1 -0
  287. package/lib/state/driver-types.d.ts +505 -0
  288. package/lib/state/driver-types.d.ts.map +1 -0
  289. package/lib/state/driver-types.js +8 -0
  290. package/lib/state/driver-types.js.map +1 -0
  291. package/lib/state/driver-usage-types.d.ts +59 -0
  292. package/lib/state/driver-usage-types.d.ts.map +1 -0
  293. package/lib/state/driver-usage-types.js +8 -0
  294. package/lib/state/driver-usage-types.js.map +1 -0
  295. package/lib/statusline.d.ts +63 -0
  296. package/lib/statusline.d.ts.map +1 -0
  297. package/lib/statusline.js +97 -0
  298. package/lib/statusline.js.map +1 -0
  299. package/lib/store/pickers.d.ts +34 -0
  300. package/lib/store/pickers.d.ts.map +1 -0
  301. package/lib/store/pickers.js +111 -0
  302. package/lib/store/pickers.js.map +1 -0
  303. package/lib/store/provider-panel.d.ts +107 -0
  304. package/lib/store/provider-panel.d.ts.map +1 -0
  305. package/lib/store/provider-panel.js +151 -0
  306. package/lib/store/provider-panel.js.map +1 -0
  307. package/lib/store/question.d.ts +21 -0
  308. package/lib/store/question.d.ts.map +1 -0
  309. package/lib/store/question.js +59 -0
  310. package/lib/store/question.js.map +1 -0
  311. package/lib/store/queue.d.ts +27 -0
  312. package/lib/store/queue.d.ts.map +1 -0
  313. package/lib/store/queue.js +34 -0
  314. package/lib/store/queue.js.map +1 -0
  315. package/lib/store/session.d.ts +73 -0
  316. package/lib/store/session.d.ts.map +1 -0
  317. package/lib/store/session.js +172 -0
  318. package/lib/store/session.js.map +1 -0
  319. package/lib/store/subagents.d.ts +16 -0
  320. package/lib/store/subagents.d.ts.map +1 -0
  321. package/lib/store/subagents.js +44 -0
  322. package/lib/store/subagents.js.map +1 -0
  323. package/lib/store/todos.d.ts +35 -0
  324. package/lib/store/todos.d.ts.map +1 -0
  325. package/lib/store/todos.js +68 -0
  326. package/lib/store/todos.js.map +1 -0
  327. package/lib/store/usage.d.ts +15 -0
  328. package/lib/store/usage.d.ts.map +1 -0
  329. package/lib/store/usage.js +27 -0
  330. package/lib/store/usage.js.map +1 -0
  331. package/lib/store/views.d.ts +419 -0
  332. package/lib/store/views.d.ts.map +1 -0
  333. package/lib/store/views.js +3 -0
  334. package/lib/store/views.js.map +1 -0
  335. package/lib/store.d.ts +19 -0
  336. package/lib/store.d.ts.map +1 -0
  337. package/lib/store.js +10 -0
  338. package/lib/store.js.map +1 -0
  339. package/lib/terminal/lease.d.ts +33 -0
  340. package/lib/terminal/lease.d.ts.map +1 -0
  341. package/lib/terminal/lease.js +99 -0
  342. package/lib/terminal/lease.js.map +1 -0
  343. package/lib/tool-card.d.ts +75 -0
  344. package/lib/tool-card.d.ts.map +1 -0
  345. package/lib/tool-card.js +109 -0
  346. package/lib/tool-card.js.map +1 -0
  347. package/lib/tool-verbs.d.ts +12 -0
  348. package/lib/tool-verbs.d.ts.map +1 -0
  349. package/lib/tool-verbs.js +29 -0
  350. package/lib/tool-verbs.js.map +1 -0
  351. package/lib/transcript.d.ts +40 -0
  352. package/lib/transcript.d.ts.map +1 -0
  353. package/lib/transcript.js +413 -0
  354. package/lib/transcript.js.map +1 -0
  355. package/lib/working-line.d.ts +44 -0
  356. package/lib/working-line.d.ts.map +1 -0
  357. package/lib/working-line.js +56 -0
  358. package/lib/working-line.js.map +1 -0
  359. package/package.json +72 -0
  360. package/presets/cc/.dsh-cc-managed.json +5 -0
  361. package/presets/cc/agent.cordis.yml +524 -0
  362. package/presets/cc/preset.yml +3 -0
  363. package/scripts/stage-preset.mjs +26 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,144 @@
1
+ # @dsh-cc/tui
2
+
3
+ Claude Code-style terminal surface for DeepSeek Harness. Mounted by
4
+ `@dsh-cc/bundle-tui` on the **`tui`** profile; new sessions compose the
5
+ **`cc`** agent preset.
6
+
7
+ This package is a protocol driver: it observes `session/event` and drives
8
+ `Agent.followup()` / `cancel()`. It does not ship CC tools or slash commands —
9
+ those stay on `packages/preset/cc`.
10
+
11
+ ## Boot
12
+
13
+ ```sh
14
+ dsh plugin --profile tui add @dsh-cc/bundle-permissions \
15
+ @dsh-cc/bundle-shell @dsh-cc/bundle-tui
16
+ dsh --profile tui
17
+ ```
18
+
19
+ Do not add this bundle to the `web` profile. Web coexistence is two profiles,
20
+ one backend.
21
+
22
+ ## Keys
23
+
24
+ - Shift+Tab — cycle CC permission modes (`default` → `acceptEdits` → `plan` → `auto` → `bypassPermissions`)
25
+ - `1` / `y` — approve once (approval modal); `2` / `n` or Esc — reject; `3` / `a` — always allow: grants the call and persists a permission rule (see [Approval previews](#approval-previews-and-always-allow))
26
+ - Esc — interrupt the current turn; over an overlay it closes the usage panel, cancels the open question, rejects the open approval, or exits `!` shell mode without interrupting a running turn
27
+ - Ctrl+C — interrupt while a turn is running; when idle, the first press opens a 2s exit window with a hint and a second press inside it exits, so a stray Ctrl+C never kills the session
28
+ - Ctrl+S — inject every queued message into the running turn immediately
29
+ - Ctrl+T — toggle the todo panel overlay (arrow keys move the highlight; Esc or a second Ctrl+T closes it)
30
+ - Ctrl+O — toggle global collapse: thinking blocks and tool output fold to one-line summaries, and pressing it again restores them
31
+ - ↑ (empty composer) — recall the most recent queued message into the composer for editing; with a non-empty composer, ↑ walks composer history; in `!` shell mode, ↑/↓ walk the separate bash history
32
+ - Tab — complete slash-command arguments after the command name (supported for `/model`, `/effort`, `/permissions`, and `/resume`)
33
+ - `!` — run a local shell command (see [Shell mode](#shell-mode-))
34
+ - `/quit` — exit
35
+ - `/model` — list or switch the live LLM route
36
+ - `/resume [id]` — list persisted sessions, or pin the next launch id
37
+ - `/export-md [path]` — write the transcript to a Markdown file; an explicit path resolves against the session cwd, and no argument lands under `$DSH_HOME/tui/exports/<sessionId>-<timestamp>.md` (the directory is created on demand)
38
+ - `/copy` — copy the most recent assistant reply to the system clipboard via an OSC 52 sequence (terminal must support OSC 52; no reply yet degrades to a notice)
39
+ - `/usage` — open the usage panel: a context-occupancy bar, the token totals (input/output/cache buckets), and the system/tools/messages breakdown, all live while open; Esc closes it. Quota data has no source in this stack and is never shown
40
+ - `/permissions` — open a picker of the five CC permission modes (`default` / `acceptEdits` / `plan` / `auto` / `bypassPermissions`); `/permissions <mode>` still switches directly. `bypassPermissions` asks for an in-overlay confirmation first. The rule listing is no longer reachable from the TUI bare invocation (browser popupSelect parity)
41
+ - other `/commands` — harness catalog (CC preset)
42
+ - user-invocable skills from the skills registry also appear in the `/` menu
43
+ (after commands; a name claimed by a command resolves to the command). A
44
+ `/name` that is not a registered command is sent as a normal user prompt —
45
+ when it names a user-invocable skill, the host's pre-step boundary injects
46
+ the skill instructions (the same path as the web client); anything else is
47
+ ordinary prose. Known limitation: because pi-tui drops autocomplete when its
48
+ provider is replaced, an open `/` menu may close at the moment the skill
49
+ catalog arrives.
50
+
51
+ ## Rendering
52
+
53
+ - File-edit cards render diffs as hunks with gutter line numbers; long
54
+ unchanged runs between hunks collapse to a dim `… N unchanged lines …`
55
+ marker, and oversized diffs clip on hunk boundaries instead of mid-hunk.
56
+ - Consecutive completed file reads fold into one `⏺ Read N files` summary
57
+ line; a running, errored, or lone read keeps its own row.
58
+ - The footer reports exact context occupancy — `ctx 43% (86k/200k)` — when the
59
+ model's context window is known, dropping the parenthetical when the line
60
+ is too narrow to fit it.
61
+ - Notices under the composer are transient: they clear themselves after a few
62
+ seconds instead of lingering.
63
+
64
+ ## Queueing
65
+
66
+ Messages submitted while a turn is running are parked in an outbox (shown as
67
+ `⏵ queued:` chips) instead of being injected into the running turn. The outbox
68
+ flushes automatically into a new turn when the current one ends — including
69
+ after a failed turn — or immediately via Ctrl+S. Idle submits send directly and
70
+ never enter the outbox, so only unsent messages can be recalled with ↑.
71
+ Interrupting (Esc or Ctrl+C while busy) clears the outbox instead of flushing
72
+ it.
73
+
74
+ ## Approval previews and always-allow
75
+
76
+ An approval prompt shows a structured preview of what it is about to run,
77
+ recovered from the paired tool event: shell-style calls preview the command,
78
+ file edits preview per-file diffs rendered with the transcript's diff renderer,
79
+ and other tools preview their pretty-printed arguments. When the preview cannot
80
+ be recovered, the prompt degrades to the tool name and reason.
81
+
82
+ Three answers are available: `1`/`y` approves once, `2`/`n` (or Esc) rejects,
83
+ and `3`/`a` answers **always allow** — the call is granted like a one-shot
84
+ approval and a permission rule is persisted into the settings allow list. For
85
+ shell commands the rule is a first-word prefix with a trailing space
86
+ (`Bash(npm )` matches `npm install …` but never `npmx …`); every other tool
87
+ gets a whole-tool rule. The applied rule is echoed back as a notice. If the
88
+ settings write is unavailable or fails, the call still passes once and a
89
+ notice says so.
90
+
91
+ ## Modal queue
92
+
93
+ Approvals and ask-user questions share one FIFO, so exactly one modal is on
94
+ screen at a time. The title shows the queue position (`Approval (1 of 3)`); a
95
+ lone head keeps the plain `Approve <tool>?` title. Answering or aborting the
96
+ head promotes the next entry, and aborting a still-queued entry removes it
97
+ without disturbing what is on screen. Approvals raised by subagents queue and
98
+ display the same way, and switching sessions settles every parked modal.
99
+
100
+ ## Shell mode (`!`)
101
+
102
+ A composer line starting with `!` runs as a **local shell command** instead of
103
+ being sent to the model — type `!` on an empty composer or paste a `!`-prefixed
104
+ line wholesale. Typing `!` flips the editor border to the warning color;
105
+ backspacing it away or pressing Esc restores the accent border.
106
+
107
+ - Commands execute through the mounted shell executor (120s timeout, 64KB
108
+ output budget) and run even while the agent is busy, bypassing the outbox.
109
+ - Output renders as status rows — a `$ <command>` echo plus the combined
110
+ output capped at 20 lines — styled as an error on non-zero exit, signal
111
+ death, or timeout. **Nothing reaches the model or the session log.**
112
+ - While a command runs, a `⠋ running…` notice parks above the composer and the
113
+ composer swallows input (Ctrl+C still owns interrupt/quit).
114
+ - `!` mode keeps its own history: ↑/↓ browse it, and it persists to
115
+ `$DSH_HOME/tui/bash-history.txt`, separate from the composer's message
116
+ history. Esc exits the mode and never interrupts a running turn.
117
+
118
+ ## Theme
119
+
120
+ The surface's colors are configurable through the plugin's `theme` config
121
+ block. Six roles are available — `accent`, `success`, `error`, `warning`,
122
+ `muted`, and `highlight` — each accepting either a basic ANSI color name
123
+ (`red`, `brightCyan`) or a raw SGR parameter string (`31`, `1;31`,
124
+ `38;5;208`). Every role is optional; unknown names, malformed codes, and
125
+ non-string values silently fall back to the built-in palette per role, and an
126
+ absent block yields the default look exactly.
127
+
128
+ Override it from your profile patch (`~/.dsh/profiles/tui/cordis.patch.yml`,
129
+ applied after every bundle):
130
+
131
+ ```yaml
132
+ - id: tui
133
+ config:
134
+ theme:
135
+ accent: brightCyan
136
+ success: '32'
137
+ error: '1;31'
138
+ warning: '38;5;208'
139
+ muted: '2'
140
+ highlight: magenta
141
+ ```
142
+
143
+ The roles drive the editor border and autocomplete, transcript rows, diff
144
+ cards, overlay boxes, fenced-code highlighting, and the `!` shell-mode border.
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Persisted bash-mode command history. Shell commands run through the `!`
3
+ * prefix are stored separately from composer prompts (a shell command is not
4
+ * a prompt and must not dilute prompt recall) under the profile data dir so
5
+ * ↑/↓ recall in shell mode survives restarts. fs access is best-effort: a
6
+ * corrupt or unwritable file degrades silently to an empty history and never
7
+ * breaks a session.
8
+ *
9
+ * One JSON string per physical line — the encoding is unambiguous for
10
+ * multi-line commands (embedded newlines are escaped by JSON.stringify, so a
11
+ * single entry never spans multiple physical lines).
12
+ *
13
+ * @module @dsh-cc/tui/bash-history
14
+ */
15
+ import { HISTORY_CAP } from './history.ts';
16
+ export { HISTORY_CAP };
17
+ /** Absolute path to the bash history file under the data dir. */
18
+ export declare function bashHistoryFilePath(dir?: string): string;
19
+ /**
20
+ * Read persisted bash history (oldest→newest). Missing or corrupt file →
21
+ * `[]`; never throws.
22
+ */
23
+ export declare function loadBashHistory(dir?: string): string[];
24
+ /**
25
+ * Write the full list (capped, consecutive-duplicate suppressed) to disk as
26
+ * JSON-lines. Returns the normalised list so callers can keep their in-memory
27
+ * copy in sync with what was actually persisted. Best-effort: fs failures are
28
+ * swallowed (the returned list still reflects the intended state).
29
+ */
30
+ export declare function saveBashHistory(entries: readonly string[], dir?: string): string[];
31
+ //# sourceMappingURL=bash-history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bash-history.d.ts","sourceRoot":"","sources":["../src/bash-history.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE1C,OAAO,EAAE,WAAW,EAAE,CAAA;AAatB,iEAAiE;AACjE,wBAAgB,mBAAmB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAExD;AAiBD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CActD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAYlF"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Persisted bash-mode command history. Shell commands run through the `!`
3
+ * prefix are stored separately from composer prompts (a shell command is not
4
+ * a prompt and must not dilute prompt recall) under the profile data dir so
5
+ * ↑/↓ recall in shell mode survives restarts. fs access is best-effort: a
6
+ * corrupt or unwritable file degrades silently to an empty history and never
7
+ * breaks a session.
8
+ *
9
+ * One JSON string per physical line — the encoding is unambiguous for
10
+ * multi-line commands (embedded newlines are escaped by JSON.stringify, so a
11
+ * single entry never spans multiple physical lines).
12
+ *
13
+ * @module @dsh-cc/tui/bash-history
14
+ */
15
+ import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
16
+ import { homedir } from 'node:os';
17
+ import { join } from 'node:path';
18
+ import { HISTORY_CAP } from "./history.js";
19
+ export { HISTORY_CAP };
20
+ /**
21
+ * Resolve the data directory (the `tui` dir). An injected `dir` overrides;
22
+ * otherwise mirrors the composer history resolution: `$DSH_HOME/tui` or
23
+ * `~/.dsh/tui`.
24
+ */
25
+ function dataDir(dir) {
26
+ if (dir !== undefined)
27
+ return dir;
28
+ const dshHome = process.env.DSH_HOME ?? join(homedir(), '.dsh');
29
+ return join(dshHome, 'tui');
30
+ }
31
+ /** Absolute path to the bash history file under the data dir. */
32
+ export function bashHistoryFilePath(dir) {
33
+ return join(dataDir(dir), 'bash-history.txt');
34
+ }
35
+ /**
36
+ * Normalise an entry list: drop empty/whitespace-only entries, suppress
37
+ * consecutive duplicates, and cap to {@link HISTORY_CAP} (keeping the newest).
38
+ */
39
+ function normalize(entries) {
40
+ const out = [];
41
+ for (const entry of entries) {
42
+ if (typeof entry !== 'string')
43
+ continue;
44
+ if (entry.length === 0 || entry.trim().length === 0)
45
+ continue;
46
+ if (out.length > 0 && out[out.length - 1] === entry)
47
+ continue;
48
+ out.push(entry);
49
+ }
50
+ return out.slice(-HISTORY_CAP);
51
+ }
52
+ /**
53
+ * Read persisted bash history (oldest→newest). Missing or corrupt file →
54
+ * `[]`; never throws.
55
+ */
56
+ export function loadBashHistory(dir) {
57
+ try {
58
+ const content = readFileSync(bashHistoryFilePath(dir), 'utf8');
59
+ const lines = content.split('\n');
60
+ const entries = [];
61
+ for (const line of lines) {
62
+ if (line.length === 0)
63
+ continue;
64
+ const parsed = JSON.parse(line);
65
+ if (typeof parsed === 'string' && parsed.length > 0)
66
+ entries.push(parsed);
67
+ }
68
+ return entries;
69
+ }
70
+ catch {
71
+ return [];
72
+ }
73
+ }
74
+ /**
75
+ * Write the full list (capped, consecutive-duplicate suppressed) to disk as
76
+ * JSON-lines. Returns the normalised list so callers can keep their in-memory
77
+ * copy in sync with what was actually persisted. Best-effort: fs failures are
78
+ * swallowed (the returned list still reflects the intended state).
79
+ */
80
+ export function saveBashHistory(entries, dir) {
81
+ const normalized = normalize(entries);
82
+ try {
83
+ mkdirSync(dataDir(dir), { recursive: true });
84
+ const content = normalized.length === 0
85
+ ? ''
86
+ : `${normalized.map(entry => JSON.stringify(entry)).join('\n')}\n`;
87
+ writeFileSync(bashHistoryFilePath(dir), content);
88
+ }
89
+ catch {
90
+ // Persistence is best-effort; never break the session over a write.
91
+ }
92
+ return normalized;
93
+ }
94
+ //# sourceMappingURL=bash-history.js.map
@@ -0,0 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BAAmB,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAA;IAClD,CAAC;IAAC,MAAM,CAAC;QACP,oEAAoE;IACtE,CAAC;IACD,OAAO,UAAU,CAAA;AACnB,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Compact-fold helpers: duck-typed reads over the compact checkpoint shape
3
+ * and pure transcript-row operations shared by the fold and the driver's
4
+ * command-echo path. UI-layer only — no harness imports.
5
+ * @module @dsh-cc/tui/compact-fold
6
+ */
7
+ import type { TranscriptRow } from './store.ts';
8
+ /**
9
+ * Duck-type the compact checkpoint's UserMessage source: the compaction
10
+ * checkpoint lands as `source: { kind: 'plugin', plugin: 'compact', … }`.
11
+ * Unknown shapes (absent, non-object, other plugins) are not checkpoints.
12
+ */
13
+ export declare function isCompactCheckpointSource(source: unknown): boolean;
14
+ /**
15
+ * Join the text blocks of a checkpoint message's content and extract the
16
+ * body between the summary tags (trimmed). Missing/misordered tags yield ''.
17
+ */
18
+ export declare function extractCompactSummary(content: unknown): string;
19
+ /**
20
+ * Drop rows whose `seq` tag falls inside the inclusive replaced range.
21
+ * Untagged rows (historical folds without surface metadata) always stay.
22
+ */
23
+ export declare function dropRowsInRange(rows: readonly TranscriptRow[], start: number, end: number): TranscriptRow[];
24
+ /**
25
+ * Whether a host-command result should still echo as a status row. A
26
+ * successful `/compact` already painted its collapsible compact boundary —
27
+ * echoing `Compacted N history items…` on top would duplicate it. Errors
28
+ * and successes without a compact row always echo.
29
+ */
30
+ export declare function shouldEchoCommandResult(result: {
31
+ kind?: string;
32
+ text?: string;
33
+ sourceEventSeq?: number;
34
+ } | undefined, rows: readonly TranscriptRow[]): boolean;
35
+ //# sourceMappingURL=compact-fold.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compact-fold.d.ts","sourceRoot":"","sources":["../src/compact-fold.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAM/C;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAIlE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAa9D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,SAAS,aAAa,EAAE,EAC9B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,GACV,aAAa,EAAE,CAKjB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,EAC7E,IAAI,EAAE,SAAS,aAAa,EAAE,GAC7B,OAAO,CAIT"}
@@ -0,0 +1,60 @@
1
+ /** Tags wrapping the structured summary inside a compact checkpoint message. */
2
+ const SUMMARY_OPEN_TAG = '<compacted-summary>';
3
+ const SUMMARY_CLOSE_TAG = '</compacted-summary>';
4
+ /**
5
+ * Duck-type the compact checkpoint's UserMessage source: the compaction
6
+ * checkpoint lands as `source: { kind: 'plugin', plugin: 'compact', … }`.
7
+ * Unknown shapes (absent, non-object, other plugins) are not checkpoints.
8
+ */
9
+ export function isCompactCheckpointSource(source) {
10
+ if (source === null || typeof source !== 'object')
11
+ return false;
12
+ const record = source;
13
+ return record.kind === 'plugin' && record.plugin === 'compact';
14
+ }
15
+ /**
16
+ * Join the text blocks of a checkpoint message's content and extract the
17
+ * body between the summary tags (trimmed). Missing/misordered tags yield ''.
18
+ */
19
+ export function extractCompactSummary(content) {
20
+ if (!Array.isArray(content))
21
+ return '';
22
+ const parts = [];
23
+ for (const block of content) {
24
+ if (block === null || typeof block !== 'object')
25
+ continue;
26
+ const record = block;
27
+ if (record.type === 'text' && typeof record.text === 'string')
28
+ parts.push(record.text);
29
+ }
30
+ const text = parts.join('\n');
31
+ const start = text.indexOf(SUMMARY_OPEN_TAG);
32
+ const end = text.indexOf(SUMMARY_CLOSE_TAG);
33
+ if (start === -1 || end === -1 || end < start)
34
+ return '';
35
+ return text.slice(start + SUMMARY_OPEN_TAG.length, end).trim();
36
+ }
37
+ /**
38
+ * Drop rows whose `seq` tag falls inside the inclusive replaced range.
39
+ * Untagged rows (historical folds without surface metadata) always stay.
40
+ */
41
+ export function dropRowsInRange(rows, start, end) {
42
+ return rows.filter(row => {
43
+ const seq = row.seq;
44
+ return typeof seq !== 'number' || seq < start || seq > end;
45
+ });
46
+ }
47
+ /**
48
+ * Whether a host-command result should still echo as a status row. A
49
+ * successful `/compact` already painted its collapsible compact boundary —
50
+ * echoing `Compacted N history items…` on top would duplicate it. Errors
51
+ * and successes without a compact row always echo.
52
+ */
53
+ export function shouldEchoCommandResult(result, rows) {
54
+ if (result === undefined)
55
+ return false;
56
+ if (result.kind === 'success' && rows.some(row => row.kind === 'compact'))
57
+ return false;
58
+ return true;
59
+ }
60
+ //# sourceMappingURL=compact-fold.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compact-fold.js","sourceRoot":"","sources":["../src/compact-fold.ts"],"names":[],"mappings":"AAQA,gFAAgF;AAChF,MAAM,gBAAgB,GAAG,qBAAqB,CAAA;AAC9C,MAAM,iBAAiB,GAAG,sBAAsB,CAAA;AAEhD;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,MAAe;IACvD,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC/D,MAAM,MAAM,GAAG,MAA8C,CAAA;IAC7D,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,CAAA;AAChE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,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CAAA;IACtC,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC;QAAE,OAAO,KAAK,CAAA;IACvF,OAAO,IAAI,CAAA;AACb,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Driver-backed slash argument completers injected into the TUI autocomplete
3
+ * provider. `/model` completes from the live model catalog in both forms the
4
+ * arg path accepts (`provider/id`, plus a bare `id` when unique across the
5
+ * catalog — mirroring parseModelChoice); `/effort` completes live effort
6
+ * levels; `/permissions` completes the five CC rule-engine modes; `/resume`
7
+ * completes session short ids.
8
+ * Candidates are fetched per completion request, so catalog/session staleness
9
+ * is bounded by the driver calls themselves.
10
+ * @module @dsh-cc/tui/components/arg-completers
11
+ */
12
+ import type { ArgCompleterMap } from './completion.ts';
13
+ import type { Driver } from '../state/driver-types.ts';
14
+ /** The slice of the driver the completers need (structural, easy to fake). */
15
+ export type ArgCompleterDriver = Pick<Driver, 'loadModelCatalog' | 'loadModelEfforts' | 'listSessions'>;
16
+ /**
17
+ * Build the per-command argument completer map handed to
18
+ * {@link TuiAutocompleteProvider}. Only commands with meaningful arguments are
19
+ * registered; every other slash command stays at the provider's null fallback.
20
+ */
21
+ export declare function buildArgCompleters(driver: ArgCompleterDriver): ArgCompleterMap;
22
+ //# sourceMappingURL=arg-completers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arg-completers.d.ts","sourceRoot":"","sources":["../../src/components/arg-completers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAGtD,8EAA8E;AAC9E,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,GAAG,cAAc,CAAC,CAAA;AAEvG;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG,eAAe,CAqD9E"}