@agi-fans/dsh-tui 0.21.0 → 0.22.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 (243) hide show
  1. package/lib/CHANGELOG.md +158 -1
  2. package/lib/chrome/box.d.ts +47 -16
  3. package/lib/chrome/box.js +172 -130
  4. package/lib/chrome/box.js.map +1 -1
  5. package/lib/chrome/code-highlight.d.ts +15 -0
  6. package/lib/chrome/code-highlight.js +60 -4
  7. package/lib/chrome/code-highlight.js.map +1 -1
  8. package/lib/chrome/command-output.d.ts +29 -2
  9. package/lib/chrome/command-output.js +100 -4
  10. package/lib/chrome/command-output.js.map +1 -1
  11. package/lib/chrome/main-screen-renderer.d.ts +16 -0
  12. package/lib/chrome/main-screen-renderer.js +53 -5
  13. package/lib/chrome/main-screen-renderer.js.map +1 -1
  14. package/lib/chrome/markdown.js +30 -10
  15. package/lib/chrome/markdown.js.map +1 -1
  16. package/lib/chrome/relative-time.d.ts +17 -0
  17. package/lib/chrome/relative-time.js +36 -0
  18. package/lib/chrome/relative-time.js.map +1 -1
  19. package/lib/chrome/secret-mask.d.ts +35 -0
  20. package/lib/chrome/secret-mask.js +180 -0
  21. package/lib/chrome/secret-mask.js.map +1 -0
  22. package/lib/chrome/status-config.d.ts +161 -51
  23. package/lib/chrome/status-config.js +237 -126
  24. package/lib/chrome/status-config.js.map +1 -1
  25. package/lib/chrome/status-line.d.ts +3 -2
  26. package/lib/chrome/status-line.js +105 -63
  27. package/lib/chrome/status-line.js.map +1 -1
  28. package/lib/chrome/terminal-colors.d.ts +85 -0
  29. package/lib/chrome/terminal-colors.js +230 -0
  30. package/lib/chrome/terminal-colors.js.map +1 -0
  31. package/lib/chrome/terminal-images.d.ts +9 -1
  32. package/lib/chrome/terminal-images.js +27 -4
  33. package/lib/chrome/terminal-images.js.map +1 -1
  34. package/lib/chrome/theme.d.ts +32 -9
  35. package/lib/chrome/theme.js +595 -498
  36. package/lib/chrome/theme.js.map +1 -1
  37. package/lib/chrome/tool-renderers.js +69 -13
  38. package/lib/chrome/tool-renderers.js.map +1 -1
  39. package/lib/chrome/tools-list.d.ts +1 -4
  40. package/lib/chrome/tools-list.js +1 -41
  41. package/lib/chrome/tools-list.js.map +1 -1
  42. package/lib/chrome/welcome-tips.d.ts +20 -8
  43. package/lib/chrome/welcome-tips.js +22 -42
  44. package/lib/chrome/welcome-tips.js.map +1 -1
  45. package/lib/commands/auth-ids.d.ts +25 -0
  46. package/lib/commands/auth-ids.js +27 -0
  47. package/lib/commands/auth-ids.js.map +1 -0
  48. package/lib/commands/auth-input.d.ts +34 -0
  49. package/lib/commands/auth-input.js +96 -0
  50. package/lib/commands/auth-input.js.map +1 -0
  51. package/lib/commands/auth-providers.d.ts +39 -0
  52. package/lib/commands/auth-providers.js +125 -0
  53. package/lib/commands/auth-providers.js.map +1 -0
  54. package/lib/commands/auth.d.ts +12 -20
  55. package/lib/commands/auth.js +42 -229
  56. package/lib/commands/auth.js.map +1 -1
  57. package/lib/commands/btw.d.ts +13 -1
  58. package/lib/commands/btw.js +37 -104
  59. package/lib/commands/btw.js.map +1 -1
  60. package/lib/commands/diff.js +1 -96
  61. package/lib/commands/diff.js.map +1 -1
  62. package/lib/commands/export.d.ts +1 -1
  63. package/lib/commands/export.js +3 -27
  64. package/lib/commands/export.js.map +1 -1
  65. package/lib/commands/files.d.ts +17 -1
  66. package/lib/commands/files.js +67 -107
  67. package/lib/commands/files.js.map +1 -1
  68. package/lib/commands/jobs.d.ts +19 -4
  69. package/lib/commands/jobs.js +50 -7
  70. package/lib/commands/jobs.js.map +1 -1
  71. package/lib/commands/model.js +108 -76
  72. package/lib/commands/model.js.map +1 -1
  73. package/lib/commands/permission.js +15 -16
  74. package/lib/commands/permission.js.map +1 -1
  75. package/lib/commands/plugins.js +133 -16
  76. package/lib/commands/plugins.js.map +1 -1
  77. package/lib/commands/schedule.d.ts +10 -0
  78. package/lib/commands/schedule.js +45 -14
  79. package/lib/commands/schedule.js.map +1 -1
  80. package/lib/commands/session-configuration.js +2 -10
  81. package/lib/commands/session-configuration.js.map +1 -1
  82. package/lib/commands/session.js +14 -38
  83. package/lib/commands/session.js.map +1 -1
  84. package/lib/commands/terminal.d.ts +14 -8
  85. package/lib/commands/terminal.js +19 -178
  86. package/lib/commands/terminal.js.map +1 -1
  87. package/lib/commands/trajectory.js +4 -1
  88. package/lib/commands/trajectory.js.map +1 -1
  89. package/lib/definition.d.ts +122 -22
  90. package/lib/definition.js.map +1 -1
  91. package/lib/index.d.ts +1 -0
  92. package/lib/index.js +1 -0
  93. package/lib/index.js.map +1 -1
  94. package/lib/input/actions.d.ts +51 -0
  95. package/lib/input/actions.js +120 -0
  96. package/lib/input/actions.js.map +1 -0
  97. package/lib/input/editor.d.ts +0 -10
  98. package/lib/input/editor.js +11 -9
  99. package/lib/input/editor.js.map +1 -1
  100. package/lib/input/image-paste.d.ts +19 -1
  101. package/lib/input/image-paste.js +82 -1
  102. package/lib/input/image-paste.js.map +1 -1
  103. package/lib/input/keybindings-config.d.ts +12 -5
  104. package/lib/input/keybindings-config.js +30 -57
  105. package/lib/input/keybindings-config.js.map +1 -1
  106. package/lib/input/keys.d.ts +16 -0
  107. package/lib/input/keys.js +38 -3
  108. package/lib/input/keys.js.map +1 -1
  109. package/lib/input/wheel-scroll.d.ts +46 -0
  110. package/lib/input/wheel-scroll.js +69 -0
  111. package/lib/input/wheel-scroll.js.map +1 -0
  112. package/lib/prompt-intents.d.ts +182 -0
  113. package/lib/prompt-intents.js +127 -0
  114. package/lib/prompt-intents.js.map +1 -0
  115. package/lib/runtime/cancellable.d.ts +75 -0
  116. package/lib/runtime/cancellable.js +76 -0
  117. package/lib/runtime/cancellable.js.map +1 -0
  118. package/lib/runtime/composer-images.js +5 -4
  119. package/lib/runtime/composer-images.js.map +1 -1
  120. package/lib/runtime/composer-shell.d.ts +17 -2
  121. package/lib/runtime/composer-shell.js +109 -43
  122. package/lib/runtime/composer-shell.js.map +1 -1
  123. package/lib/runtime/file-recovery-review.d.ts +0 -1
  124. package/lib/runtime/file-recovery-review.js +29 -30
  125. package/lib/runtime/file-recovery-review.js.map +1 -1
  126. package/lib/runtime/file-recovery-store.js +5 -1
  127. package/lib/runtime/file-recovery-store.js.map +1 -1
  128. package/lib/runtime/file-review.js +1 -1
  129. package/lib/runtime/file-review.js.map +1 -1
  130. package/lib/runtime/hook-settings.d.ts +2 -2
  131. package/lib/runtime/plain-tui.d.ts +2 -0
  132. package/lib/runtime/plain-tui.js +7 -1
  133. package/lib/runtime/plain-tui.js.map +1 -1
  134. package/lib/runtime/plugin-settings.d.ts +1 -1
  135. package/lib/runtime/plugin-settings.js +10 -8
  136. package/lib/runtime/plugin-settings.js.map +1 -1
  137. package/lib/runtime/provider-local.d.ts +57 -15
  138. package/lib/runtime/provider-local.js +1112 -471
  139. package/lib/runtime/provider-local.js.map +1 -1
  140. package/lib/runtime/runner.js +5 -11
  141. package/lib/runtime/runner.js.map +1 -1
  142. package/lib/runtime/settings-preferences.js +1 -1
  143. package/lib/runtime/settings-preferences.js.map +1 -1
  144. package/lib/runtime/startup-notices.js +2 -0
  145. package/lib/runtime/startup-notices.js.map +1 -1
  146. package/lib/runtime/terminal-modes.d.ts +47 -0
  147. package/lib/runtime/terminal-modes.js +86 -0
  148. package/lib/runtime/terminal-modes.js.map +1 -0
  149. package/lib/runtime/terminal-notifications.d.ts +3 -5
  150. package/lib/runtime/terminal-notifications.js +4 -8
  151. package/lib/runtime/terminal-notifications.js.map +1 -1
  152. package/lib/runtime/terminal-probe.d.ts +36 -0
  153. package/lib/runtime/terminal-probe.js +37 -0
  154. package/lib/runtime/terminal-probe.js.map +1 -0
  155. package/lib/runtime/terminal-session.d.ts +57 -0
  156. package/lib/runtime/terminal-session.js +164 -0
  157. package/lib/runtime/terminal-session.js.map +1 -0
  158. package/lib/session/interaction-adapter.js +7 -8
  159. package/lib/session/interaction-adapter.js.map +1 -1
  160. package/lib/session/message-queue.js +1 -1
  161. package/lib/session/message-queue.js.map +1 -1
  162. package/lib/session/package-metadata.d.ts +8 -0
  163. package/lib/session/package-metadata.js +8 -0
  164. package/lib/session/package-metadata.js.map +1 -1
  165. package/lib/session/session-controller.d.ts +10 -11
  166. package/lib/session/session-controller.js +95 -13
  167. package/lib/session/session-controller.js.map +1 -1
  168. package/lib/session/session-tree.d.ts +2 -0
  169. package/lib/session/session-tree.js +2 -0
  170. package/lib/session/session-tree.js.map +1 -1
  171. package/lib/session/tui-settings.d.ts +40 -11
  172. package/lib/session/tui-settings.js +73 -34
  173. package/lib/session/tui-settings.js.map +1 -1
  174. package/lib/views/autocomplete.d.ts +18 -2
  175. package/lib/views/autocomplete.js +51 -38
  176. package/lib/views/autocomplete.js.map +1 -1
  177. package/lib/views/copy-targets.d.ts +12 -13
  178. package/lib/views/copy-targets.js +16 -46
  179. package/lib/views/copy-targets.js.map +1 -1
  180. package/lib/views/document-reader.js +18 -5
  181. package/lib/views/document-reader.js.map +1 -1
  182. package/lib/views/event-views.js +42 -6
  183. package/lib/views/event-views.js.map +1 -1
  184. package/lib/views/history-search.js +15 -21
  185. package/lib/views/history-search.js.map +1 -1
  186. package/lib/views/hotkeys.d.ts +7 -1
  187. package/lib/views/hotkeys.js +49 -25
  188. package/lib/views/hotkeys.js.map +1 -1
  189. package/lib/views/list-navigation.d.ts +62 -0
  190. package/lib/views/list-navigation.js +73 -0
  191. package/lib/views/list-navigation.js.map +1 -0
  192. package/lib/views/list-view.d.ts +99 -0
  193. package/lib/views/list-view.js +165 -0
  194. package/lib/views/list-view.js.map +1 -0
  195. package/lib/views/prompt-selector.d.ts +31 -3
  196. package/lib/views/prompt-selector.js +249 -125
  197. package/lib/views/prompt-selector.js.map +1 -1
  198. package/lib/views/session-files.d.ts +1 -2
  199. package/lib/views/session-files.js +1 -11
  200. package/lib/views/session-files.js.map +1 -1
  201. package/lib/views/settings-list.d.ts +10 -8
  202. package/lib/views/settings-list.js +116 -283
  203. package/lib/views/settings-list.js.map +1 -1
  204. package/lib/views/trajectory-timeline.d.ts +72 -0
  205. package/lib/views/trajectory-timeline.js +133 -0
  206. package/lib/views/trajectory-timeline.js.map +1 -0
  207. package/lib/views/trajectory.d.ts +15 -4
  208. package/lib/views/trajectory.js +557 -123
  209. package/lib/views/trajectory.js.map +1 -1
  210. package/lib/views/transcript-render.d.ts +95 -25
  211. package/lib/views/transcript-render.js +501 -167
  212. package/lib/views/transcript-render.js.map +1 -1
  213. package/lib/views/transcript-search.d.ts +39 -6
  214. package/lib/views/transcript-search.js +46 -11
  215. package/lib/views/transcript-search.js.map +1 -1
  216. package/lib/views/transcript-types.d.ts +63 -5
  217. package/lib/views/transcript-types.js +23 -11
  218. package/lib/views/transcript-types.js.map +1 -1
  219. package/package.json +67 -86
  220. package/lib/commands/advisor.d.ts +0 -15
  221. package/lib/commands/advisor.js +0 -200
  222. package/lib/commands/advisor.js.map +0 -1
  223. package/lib/commands/loop.d.ts +0 -52
  224. package/lib/commands/loop.js +0 -307
  225. package/lib/commands/loop.js.map +0 -1
  226. package/lib/commands/rate.d.ts +0 -33
  227. package/lib/commands/rate.js +0 -212
  228. package/lib/commands/rate.js.map +0 -1
  229. package/lib/commands/steer.d.ts +0 -5
  230. package/lib/commands/steer.js +0 -24
  231. package/lib/commands/steer.js.map +0 -1
  232. package/lib/commands/worktree.d.ts +0 -5
  233. package/lib/commands/worktree.js +0 -103
  234. package/lib/commands/worktree.js.map +0 -1
  235. package/lib/runtime/terminal-reader.d.ts +0 -11
  236. package/lib/runtime/terminal-reader.js +0 -87
  237. package/lib/runtime/terminal-reader.js.map +0 -1
  238. package/lib/views/agent-hub.d.ts +0 -32
  239. package/lib/views/agent-hub.js +0 -209
  240. package/lib/views/agent-hub.js.map +0 -1
  241. package/lib/views/copy-selector.d.ts +0 -54
  242. package/lib/views/copy-selector.js +0 -170
  243. package/lib/views/copy-selector.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"transcript-search.js","sourceRoot":"","sources":["../../src/views/transcript-search.ts"],"names":[],"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
6
6
  */
7
7
  import type { ContentBlock, StreamChunk, ToolCallId, UserMessage } from '@deepseek-ai/dsh-llm';
8
+ import type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';
8
9
  import type { SessionEvent } from '@deepseek-ai/dsh-session';
9
10
  import type { WorkspaceChangesSummary } from '@deepseek-ai/dsh-workspace-changes';
10
11
  import type { TuiToolPresentation } from '../chrome/tool-renderers.ts';
11
- import type { ToolInfo } from '../chrome/tools-list.ts';
12
12
  export type TodoItem = Extract<SessionEvent, {
13
13
  type: 'todo/write';
14
14
  }>['data']['todos'][number];
@@ -32,6 +32,8 @@ export interface WorkspaceBlock {
32
32
  export type Block = {
33
33
  kind: 'user';
34
34
  text: string;
35
+ /** The first image the reader attached, kept so it can be previewed inline. */
36
+ image?: ImageAttachmentRef;
35
37
  } | {
36
38
  kind: 'assistant';
37
39
  turn: number;
@@ -54,6 +56,11 @@ export type Block = {
54
56
  status: 'completed' | 'failed' | 'killed';
55
57
  detail?: string;
56
58
  };
59
+ /**
60
+ * The first image this call returned, kept so the live view can preview it
61
+ * and the reader can still open it after the rows fall into history.
62
+ */
63
+ image?: ImageAttachmentRef;
57
64
  partial?: boolean;
58
65
  presentation?: TuiToolPresentation;
59
66
  /**
@@ -68,13 +75,46 @@ export type Block = {
68
75
  parentCallId?: ToolCallId;
69
76
  /** The turn that made the call, so two turns with no prompt between them still read as two runs. */
70
77
  turn?: number;
71
- } | {
72
- kind: 'toolCatalog';
73
- tools: readonly ToolInfo[];
74
78
  } | {
75
79
  kind: 'commandOutput';
76
80
  command: string;
77
81
  text: string;
82
+ surface?: 'aside';
83
+ } | {
84
+ /**
85
+ * A finished side question, kept as one line.
86
+ *
87
+ * The answer arrived in the pane above the composer; leaving it there would
88
+ * mean the reader has to choose between the screen space and the text. Closing
89
+ * the pane collapses it into this block instead, so the exchange stays where
90
+ * the terminal keeps everything already read: one row, with the answer behind
91
+ * the same `Ctrl+O` that opens any other fold.
92
+ *
93
+ * A local presentation block, not a session event: the side conversation has
94
+ * its own durable log, and this session's log is left untouched — which is why
95
+ * the row does not come back after a resume, exactly like any other command
96
+ * output.
97
+ */
98
+ kind: 'aside';
99
+ question: string;
100
+ text: string;
101
+ } | {
102
+ /**
103
+ * A Shell line the reader ran themselves with a leading `!`.
104
+ *
105
+ * It is a transcript block rather than a full-screen reader because the
106
+ * output is the answer to a question the reader just asked: it belongs where
107
+ * the conversation is, streams as it arrives, and is finished when the
108
+ * command exits. Nothing here waits for an exit gesture.
109
+ */
110
+ kind: 'shell';
111
+ command: string;
112
+ output: string;
113
+ status: 'running' | 'ok' | 'error';
114
+ /** Exit code, once the command settled. */
115
+ code?: number;
116
+ /** The reader asked for the output to enter the conversation. */
117
+ shared?: boolean;
78
118
  } | WorkspaceBlock | {
79
119
  kind: 'notice';
80
120
  level: 'info' | 'warning' | 'error';
@@ -150,10 +190,28 @@ export interface TranscriptState {
150
190
  start: number;
151
191
  end?: number;
152
192
  }>>;
193
+ /**
194
+ * Turns the reader stopped before they finished.
195
+ *
196
+ * Their runs keep their rows until the next submission. Interrupting is an
197
+ * action taken while watching that work, so folding at that moment takes the
198
+ * rows out from under the reader — and, because a fold shortens the document,
199
+ * it also exposes rows already committed to native history. A completed run
200
+ * folds because its summary describes finished work; an interrupted one has no
201
+ * conclusion to summarize.
202
+ */
203
+ stoppedTurns?: readonly number[];
153
204
  }
154
205
  /** Empty starting state. */
155
206
  export declare function initialTranscript(): TranscriptState;
156
- /** Extract plain text from text blocks, ignoring other block kinds. */
207
+ /**
208
+ * Extract plain text from text blocks, naming other block kinds.
209
+ *
210
+ * The name is deliberately bare, the way Pi and oh-my-pi name one: the picture
211
+ * itself is the content, so the text only says what kind of thing sits at this
212
+ * point. Dimensions, byte counts and the full MIME string belong in the tool
213
+ * that produced the file, not in every message that carries it.
214
+ */
157
215
  export declare function contentToText(content: readonly ContentBlock[]): string;
158
216
  /** Extract reasoning text from reasoning blocks. */
159
217
  export declare function contentToReasoning(content: readonly ContentBlock[]): string;
@@ -19,23 +19,35 @@ export function initialTranscript() {
19
19
  turnError: undefined,
20
20
  };
21
21
  }
22
- /** Extract plain text from text blocks, ignoring other block kinds. */
22
+ /**
23
+ * Extract plain text from text blocks, naming other block kinds.
24
+ *
25
+ * The name is deliberately bare, the way Pi and oh-my-pi name one: the picture
26
+ * itself is the content, so the text only says what kind of thing sits at this
27
+ * point. Dimensions, byte counts and the full MIME string belong in the tool
28
+ * that produced the file, not in every message that carries it.
29
+ */
23
30
  export function contentToText(content) {
24
- return content
25
- .flatMap((block) => {
26
- if (block.type === 'text')
27
- return [block.text];
31
+ let text = '';
32
+ for (const block of content) {
33
+ if (block.type === 'text') {
34
+ text += block.text;
35
+ continue;
36
+ }
37
+ if (block.type !== 'image' && block.type !== 'file')
38
+ continue;
39
+ if (text !== '' && !/\s$/u.test(text))
40
+ text += ' ';
28
41
  if (block.type === 'image') {
29
42
  const ref = block.attachment;
30
- return [`[image ${ref.width}×${ref.height} · ${ref.mediaType}]`];
43
+ text += `[Image: ${ref.mediaType}]`;
31
44
  }
32
- if (block.type === 'file') {
45
+ else {
33
46
  const ref = block.attachment;
34
- return [`[file ${ref.name} · ${ref.bytes} bytes]`];
47
+ text += `[File: ${ref.name}]`;
35
48
  }
36
- return [];
37
- })
38
- .join('');
49
+ }
50
+ return text;
39
51
  }
40
52
  /** Extract reasoning text from reasoning blocks. */
41
53
  export function contentToReasoning(content) {
@@ -1 +1 @@
1
- {"version":3,"file":"transcript-types.js","sourceRoot":"","sources":["../../src/views/transcript-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAoIvD,4BAA4B;AAC5B,MAAM,UAAU,iBAAiB;IAC/B,OAAO;QACL,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,EAAE;QACT,gBAAgB,EAAE,SAAS;QAC3B,UAAU,EAAE,SAAS;QACrB,aAA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AAU,CAAA;YAC5B,IAAI,IAAI,UAAU,GAAG,CAAC,IAAI,GAAG,CAAA;QAC/B,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,kBAAkB,CAAC,OAAgC;IACjE,OAAO,UAAU,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAA;AAChE,CAAC;AAYD;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,KAA4C;IACvE,OAAO,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE,CAAA;AACtC,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAA;IACZ,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agi-fans/dsh-tui",
3
3
  "description": "Library-only Cordis plugin suite for DeepSeek Harness terminal presentation and interaction",
4
- "version": "0.21.0",
4
+ "version": "0.22.0",
5
5
  "homepage": "https://omdsh.agi.fans/",
6
6
  "keywords": [
7
7
  "omdsh",
@@ -34,10 +34,6 @@
34
34
  "types": "./lib/runtime/approval-rules.d.ts",
35
35
  "default": "./lib/runtime/approval-rules.js"
36
36
  },
37
- "./command-advisor": {
38
- "types": "./lib/commands/advisor.d.ts",
39
- "default": "./lib/commands/advisor.js"
40
- },
41
37
  ".": {
42
38
  "types": "./lib/index.d.ts",
43
39
  "default": "./lib/index.js"
@@ -78,14 +74,6 @@
78
74
  "types": "./lib/commands/session-configuration.d.ts",
79
75
  "default": "./lib/commands/session-configuration.js"
80
76
  },
81
- "./command-steer": {
82
- "types": "./lib/commands/steer.d.ts",
83
- "default": "./lib/commands/steer.js"
84
- },
85
- "./command-loop": {
86
- "types": "./lib/commands/loop.d.ts",
87
- "default": "./lib/commands/loop.js"
88
- },
89
77
  "./command-model": {
90
78
  "types": "./lib/commands/model.d.ts",
91
79
  "default": "./lib/commands/model.js"
@@ -98,14 +86,6 @@
98
86
  "types": "./lib/commands/jobs.d.ts",
99
87
  "default": "./lib/commands/jobs.js"
100
88
  },
101
- "./command-rate": {
102
- "types": "./lib/commands/rate.d.ts",
103
- "default": "./lib/commands/rate.js"
104
- },
105
- "./command-schedule": {
106
- "types": "./lib/commands/schedule.d.ts",
107
- "default": "./lib/commands/schedule.js"
108
- },
109
89
  "./model-readiness": {
110
90
  "types": "./lib/session/model-readiness.d.ts",
111
91
  "default": "./lib/session/model-readiness.js"
@@ -114,6 +94,18 @@
114
94
  "types": "./lib/commands/auth.d.ts",
115
95
  "default": "./lib/commands/auth.js"
116
96
  },
97
+ "./command-plugins": {
98
+ "types": "./lib/commands/plugins.d.ts",
99
+ "default": "./lib/commands/plugins.js"
100
+ },
101
+ "./command-schedule": {
102
+ "types": "./lib/commands/schedule.d.ts",
103
+ "default": "./lib/commands/schedule.js"
104
+ },
105
+ "./command-trajectory": {
106
+ "types": "./lib/commands/trajectory.d.ts",
107
+ "default": "./lib/commands/trajectory.js"
108
+ },
117
109
  "./command-diff": {
118
110
  "types": "./lib/commands/diff.d.ts",
119
111
  "default": "./lib/commands/diff.js"
@@ -122,10 +114,6 @@
122
114
  "types": "./lib/commands/export.d.ts",
123
115
  "default": "./lib/commands/export.js"
124
116
  },
125
- "./command-trajectory": {
126
- "types": "./lib/commands/trajectory.d.ts",
127
- "default": "./lib/commands/trajectory.js"
128
- },
129
117
  "./command-integrations": {
130
118
  "types": "./lib/commands/integrations.d.ts",
131
119
  "default": "./lib/commands/integrations.js"
@@ -135,10 +123,6 @@
135
123
  "default": "./lib/runtime/startup-notices.js"
136
124
  },
137
125
  "./package.json": "./package.json",
138
- "./command-plugins": {
139
- "types": "./lib/commands/plugins.d.ts",
140
- "default": "./lib/commands/plugins.js"
141
- },
142
126
  "./subagent-model-selection": {
143
127
  "types": "./lib/runtime/subagent-model-selection.d.ts",
144
128
  "default": "./lib/runtime/subagent-model-selection.js"
@@ -151,10 +135,6 @@
151
135
  "types": "./lib/commands/files.d.ts",
152
136
  "default": "./lib/commands/files.js"
153
137
  },
154
- "./command-worktree": {
155
- "types": "./lib/commands/worktree.d.ts",
156
- "default": "./lib/commands/worktree.js"
157
- },
158
138
  "./hook-settings": {
159
139
  "types": "./lib/runtime/hook-settings.d.ts",
160
140
  "default": "./lib/runtime/hook-settings.js"
@@ -181,71 +161,72 @@
181
161
  },
182
162
  "dependencies": {
183
163
  "@deepseek-ai/cordis-plugin-loader": "1.0.6",
184
- "@deepseek-ai/dsh-agent": "0.2.1-rc.2",
185
- "@deepseek-ai/dsh-agent-default-model": "0.2.1-rc.2",
186
- "@deepseek-ai/dsh-agent-preset-registry": "0.2.1-rc.2",
187
- "@deepseek-ai/dsh-attachment": "0.2.1-rc.2",
188
- "@deepseek-ai/dsh-authorization": "0.2.1-rc.2",
189
- "@deepseek-ai/dsh-cmdline": "0.2.1-rc.2",
190
- "@deepseek-ai/dsh-commands": "0.2.1-rc.2",
191
- "@deepseek-ai/dsh-compaction": "0.2.1-rc.2",
192
- "@deepseek-ai/dsh-credentials": "0.2.1-rc.2",
193
- "@deepseek-ai/dsh-experimental-worktree": "0.2.1-rc.2",
194
- "@deepseek-ai/dsh-file-reference": "0.2.1-rc.2",
195
- "@deepseek-ai/dsh-fs": "0.2.1-rc.2",
196
- "@deepseek-ai/dsh-goal": "0.2.1-rc.2",
197
- "@deepseek-ai/dsh-hook-protocol": "0.2.1-rc.2",
198
- "@deepseek-ai/dsh-hooks-claude-code": "0.2.1-rc.2",
199
- "@deepseek-ai/dsh-hooks-codex": "0.2.1-rc.2",
200
- "@deepseek-ai/dsh-jobs": "0.2.1-rc.2",
201
- "@deepseek-ai/dsh-llm": "0.2.1-rc.2",
202
- "@deepseek-ai/dsh-llm-retry": "0.2.1-rc.2",
203
- "@deepseek-ai/dsh-message-feedback": "0.2.1-rc.2",
204
- "@deepseek-ai/dsh-permission-presets": "0.2.1-rc.2",
205
- "@deepseek-ai/dsh-plan-mode": "0.2.1-rc.2",
206
- "@deepseek-ai/dsh-plugin-manager": "0.2.1-rc.2",
207
- "@deepseek-ai/dsh-sandbox": "0.2.1-rc.2",
208
- "@deepseek-ai/dsh-sandbox-policy": "0.2.1-rc.2",
209
- "@deepseek-ai/dsh-schedule": "0.2.1-rc.2",
210
- "@deepseek-ai/dsh-session": "0.2.1-rc.2",
211
- "@deepseek-ai/dsh-session-persistence": "0.2.1-rc.2",
212
- "@deepseek-ai/dsh-session-projection": "0.2.1-rc.2",
213
- "@deepseek-ai/dsh-session-query": "0.2.1-rc.2",
214
- "@deepseek-ai/dsh-session-reference": "0.2.1-rc.2",
215
- "@deepseek-ai/dsh-session-stats": "0.2.1-rc.2",
216
- "@deepseek-ai/dsh-session-title": "0.2.1-rc.2",
217
- "@deepseek-ai/dsh-settings": "0.2.1-rc.2",
218
- "@deepseek-ai/dsh-skill": "0.2.1-rc.2",
219
- "@deepseek-ai/dsh-subagent": "0.2.1-rc.2",
220
- "@deepseek-ai/dsh-subprocess": "0.2.1-rc.2",
221
- "@deepseek-ai/dsh-system-prompt": "0.2.1-rc.2",
222
- "@deepseek-ai/dsh-terminal": "0.2.1-rc.2",
223
- "@deepseek-ai/dsh-token-meter": "0.2.1-rc.2",
224
- "@deepseek-ai/dsh-tool-present": "0.2.1-rc.2",
225
- "@deepseek-ai/dsh-tool-subagent": "0.2.1-rc.2",
226
- "@deepseek-ai/dsh-tool-todo": "0.2.1-rc.2",
227
- "@deepseek-ai/dsh-tool-workflow": "0.2.1-rc.2",
228
- "@deepseek-ai/dsh-tools": "0.2.1-rc.2",
229
- "@deepseek-ai/dsh-user-approval": "0.2.1-rc.2",
230
- "@deepseek-ai/dsh-user-questions": "0.2.1-rc.2",
231
- "@deepseek-ai/dsh-working-directory": "0.2.1-rc.2",
232
- "@deepseek-ai/dsh-workspace": "0.2.1-rc.2",
233
- "@deepseek-ai/dsh-workspace-changes": "0.2.1-rc.2",
164
+ "@deepseek-ai/dsh-agent": "0.2.1-rc.5",
165
+ "@deepseek-ai/dsh-agent-default-model": "0.2.1-rc.5",
166
+ "@deepseek-ai/dsh-agent-preset-registry": "0.2.1-rc.5",
167
+ "@deepseek-ai/dsh-attachment": "0.2.1-rc.5",
168
+ "@deepseek-ai/dsh-authorization": "0.2.1-rc.5",
169
+ "@deepseek-ai/dsh-cmdline": "0.2.1-rc.5",
170
+ "@deepseek-ai/dsh-commands": "0.2.1-rc.5",
171
+ "@deepseek-ai/dsh-compaction": "0.2.1-rc.5",
172
+ "@deepseek-ai/dsh-credentials": "0.2.1-rc.5",
173
+ "@deepseek-ai/dsh-experimental-worktree": "0.2.1-rc.5",
174
+ "@deepseek-ai/dsh-file-reference": "0.2.1-rc.5",
175
+ "@deepseek-ai/dsh-fs": "0.2.1-rc.5",
176
+ "@deepseek-ai/dsh-goal": "0.2.1-rc.5",
177
+ "@deepseek-ai/dsh-hook-protocol": "0.2.1-rc.5",
178
+ "@deepseek-ai/dsh-hooks-claude-code": "0.2.1-rc.5",
179
+ "@deepseek-ai/dsh-hooks-codex": "0.2.1-rc.5",
180
+ "@deepseek-ai/dsh-jobs": "0.2.1-rc.5",
181
+ "@deepseek-ai/dsh-llm": "0.2.1-rc.5",
182
+ "@deepseek-ai/dsh-llm-retry": "0.2.1-rc.5",
183
+ "@deepseek-ai/dsh-message-feedback": "0.2.1-rc.5",
184
+ "@deepseek-ai/dsh-permission-presets": "0.2.1-rc.5",
185
+ "@deepseek-ai/dsh-plan-mode": "0.2.1-rc.5",
186
+ "@deepseek-ai/dsh-plugin-manager": "0.2.1-rc.5",
187
+ "@deepseek-ai/dsh-plugin-market": "0.2.1-rc.5",
188
+ "@deepseek-ai/dsh-sandbox": "0.2.1-rc.5",
189
+ "@deepseek-ai/dsh-sandbox-policy": "0.2.1-rc.5",
190
+ "@deepseek-ai/dsh-schedule": "0.2.1-rc.5",
191
+ "@deepseek-ai/dsh-session": "0.2.1-rc.5",
192
+ "@deepseek-ai/dsh-session-persistence": "0.2.1-rc.5",
193
+ "@deepseek-ai/dsh-session-projection": "0.2.1-rc.5",
194
+ "@deepseek-ai/dsh-session-query": "0.2.1-rc.5",
195
+ "@deepseek-ai/dsh-session-reference": "0.2.1-rc.5",
196
+ "@deepseek-ai/dsh-session-stats": "0.2.1-rc.5",
197
+ "@deepseek-ai/dsh-session-title": "0.2.1-rc.5",
198
+ "@deepseek-ai/dsh-settings": "0.2.1-rc.5",
199
+ "@deepseek-ai/dsh-skill": "0.2.1-rc.5",
200
+ "@deepseek-ai/dsh-subagent": "0.2.1-rc.5",
201
+ "@deepseek-ai/dsh-subprocess": "0.2.1-rc.5",
202
+ "@deepseek-ai/dsh-system-prompt": "0.2.1-rc.5",
203
+ "@deepseek-ai/dsh-terminal": "0.2.1-rc.5",
204
+ "@deepseek-ai/dsh-token-meter": "0.2.1-rc.5",
205
+ "@deepseek-ai/dsh-tool-present": "0.2.1-rc.5",
206
+ "@deepseek-ai/dsh-tool-subagent": "0.2.1-rc.5",
207
+ "@deepseek-ai/dsh-tool-todo": "0.2.1-rc.5",
208
+ "@deepseek-ai/dsh-tool-workflow": "0.2.1-rc.5",
209
+ "@deepseek-ai/dsh-tools": "0.2.1-rc.5",
210
+ "@deepseek-ai/dsh-user-approval": "0.2.1-rc.5",
211
+ "@deepseek-ai/dsh-user-questions": "0.2.1-rc.5",
212
+ "@deepseek-ai/dsh-working-directory": "0.2.1-rc.5",
213
+ "@deepseek-ai/dsh-workspace": "0.2.1-rc.5",
214
+ "@deepseek-ai/dsh-workspace-changes": "0.2.1-rc.5",
234
215
  "@deepseek-ai/schemastery": "3.18.5",
235
216
  "diff": "9.0.0",
236
217
  "fflate": "0.8.3",
237
218
  "lovely-mermaid": "0.3.3",
238
219
  "marked": "15.0.12",
239
220
  "prismjs": "1.30.0",
240
- "sharp": "0.35.3"
221
+ "sharp": "0.35.5"
241
222
  },
242
223
  "peerDependencies": {
243
224
  "@deepseek-ai/cordis": "~4.0.5"
244
225
  },
245
226
  "devDependencies": {
246
227
  "@deepseek-ai/cordis": "4.0.5",
247
- "@deepseek-ai/dsh-scope": "0.2.1-rc.2",
248
- "@deepseek-ai/dsh-session-persistence-jsonl": "0.2.1-rc.2",
228
+ "@deepseek-ai/dsh-scope": "0.2.1-rc.5",
229
+ "@deepseek-ai/dsh-session-persistence-jsonl": "0.2.1-rc.5",
249
230
  "@types/node": "^22.10.0",
250
231
  "@types/prismjs": "1.26.6",
251
232
  "@xterm/headless": "6.0.0",
@@ -1,15 +0,0 @@
1
- /** Explicit human consultation with independently attributed native advice. */
2
- import type { Context } from '@deepseek-ai/cordis';
3
- import type { CommandInvocation, CommandResult } from '@deepseek-ai/dsh-commands';
4
- import { type ContextFormed } from '@deepseek-ai/dsh-llm';
5
- declare module '@deepseek-ai/dsh-llm' {
6
- interface MessageSourceMap {
7
- 'omdsh-advisor': {
8
- kind: 'omdsh-advisor';
9
- } & ContextFormed;
10
- }
11
- }
12
- export declare const name = "omdsh-command-advisor";
13
- export declare const inject: string[];
14
- export declare function requestAdvice(ctx: Context, invocation: CommandInvocation, signal?: AbortSignal): Promise<CommandResult>;
15
- export declare function apply(ctx: Context): void;
@@ -1,200 +0,0 @@
1
- import { createUserMessage, ToolCallId } from '@deepseek-ai/dsh-llm';
2
- import { registerCommands } from "./registration.js";
3
- export const name = 'omdsh-command-advisor';
4
- export const inject = ['commands', 'tui', 'advisor'];
5
- function pushAdvisorActivity(list, next) {
6
- const last = list.at(-1);
7
- if (last !== undefined && last.text === next.text && last.status === next.status)
8
- return;
9
- if (last?.status === 'running' && next.status !== 'thinking' && last.text === next.text) {
10
- list[list.length - 1] = next;
11
- return;
12
- }
13
- if (last?.status === 'thinking' && next.status === 'thinking') {
14
- list[list.length - 1] = next;
15
- return;
16
- }
17
- list.push(next);
18
- if (list.length > 10)
19
- list.shift();
20
- }
21
- function formatAdvisorActivities(items) {
22
- return items
23
- .map(item => `${item.status === 'ok' ? '✓' : item.status === 'error' ? '✗' : item.status === 'running' ? '▸' : '·'} ${item.text}`)
24
- .join('\n');
25
- }
26
- export async function requestAdvice(ctx, invocation, signal = invocation.signal) {
27
- const raw = invocation.rawInput.trim();
28
- const directMatch = /^(codex|claude(?:-code)?)\s+([\s\S]+)$/iu.exec(raw);
29
- const providerOnlyMatch = /^(codex|claude(?:-code)?)$/iu.exec(raw);
30
- let provider, question;
31
- if (directMatch !== null) {
32
- provider = directMatch[1].toLowerCase().startsWith('claude') ? 'claude' : 'codex';
33
- question = directMatch[2].trim();
34
- }
35
- else {
36
- if (ctx.tui.interactive !== true)
37
- return { kind: 'error', text: 'Usage: /advisor codex|claude <question>' };
38
- if (providerOnlyMatch !== null) {
39
- provider = providerOnlyMatch[1].toLowerCase().startsWith('claude') ? 'claude' : 'codex';
40
- }
41
- else {
42
- const selected = await ctx.tui.prompt({
43
- title: 'Advisor',
44
- question: raw === '' ? 'Choose an independent advisor' : `Choose an advisor for: ${raw}`,
45
- options: [{ label: 'Codex', value: 'codex' }, { label: 'Claude Code', value: 'claude' }],
46
- allowCustom: false,
47
- notify: false,
48
- signal,
49
- });
50
- if (selected !== 'codex' && selected !== 'claude')
51
- return { kind: 'success' };
52
- provider = selected;
53
- }
54
- if (raw !== '' && providerOnlyMatch === null) {
55
- question = raw;
56
- }
57
- else {
58
- const input = await ctx.tui.prompt({ title: 'Advisor', question: 'Question', allowCustom: true, notify: false, signal });
59
- if (input === null || input.trim() === '' || signal.aborted)
60
- return { kind: 'success' };
61
- question = input.trim();
62
- }
63
- }
64
- const callId = ToolCallId(`advisor-${Date.now()}`);
65
- const startedAt = Date.now();
66
- const rawArgs = JSON.stringify({ provider, question });
67
- const title = provider === 'claude' ? 'Advisor · Claude Code' : 'Advisor · Codex';
68
- const activities = [];
69
- ctx.tui.event?.({
70
- seq: 0,
71
- time: startedAt,
72
- type: 'tool/call',
73
- data: { turn: 0, callId, name: 'consult_advisor', arguments: rawArgs },
74
- });
75
- ctx.tui.setStatus?.('running');
76
- let outcome = 'completed';
77
- const onProgress = (activity) => {
78
- pushAdvisorActivity(activities, activity);
79
- ctx.tui.event?.({
80
- seq: 0,
81
- time: Date.now(),
82
- type: 'tool/call',
83
- data: { turn: 0, callId, name: 'consult_advisor', arguments: rawArgs },
84
- }, {
85
- call: {
86
- card: 'generic',
87
- title,
88
- content: [{ type: 'text', text: `${question}\n\n${formatAdvisorActivities(activities)}` }],
89
- },
90
- });
91
- };
92
- try {
93
- let advice;
94
- try {
95
- advice = await ctx.advisor.consult(invocation.agent, provider, question, '', signal, onProgress);
96
- }
97
- catch (firstError) {
98
- const firstMessage = firstError instanceof Error ? firstError.message : String(firstError);
99
- const manager = ctx.get?.('pluginManager');
100
- if (ctx.tui.interactive === true && manager !== undefined && /^Enable @deepseek-ai\/dsh-subagent-(?:codex|claude-code) in \/plugins/u.test(firstMessage)) {
101
- const label = provider === 'claude' ? 'Claude Code' : 'Codex';
102
- const bundle = provider === 'claude' ? '@deepseek-ai/dsh-subagent-claude-code' : '@deepseek-ai/dsh-subagent-codex';
103
- const consent = await ctx.tui.prompt({
104
- title: `Enable ${label}`,
105
- question: `${label} is disabled in this profile. Enable it and consult now?`,
106
- options: [
107
- { label: `Enable ${label} and consult`, value: 'enable' },
108
- { label: 'Cancel', value: 'cancel' },
109
- ],
110
- allowCustom: false,
111
- notify: false,
112
- signal,
113
- });
114
- if (consent === 'enable' && !signal.aborted) {
115
- const change = await manager.setBundleEnabled(bundle, true);
116
- if (change.error !== undefined || change.application === 'failed') {
117
- throw new Error(change.error?.diagnostic ?? change.error?.code ?? `Could not enable ${label}.`, { cause: firstError });
118
- }
119
- ctx.tui.notice(`${label} enabled for this profile.`);
120
- advice = await ctx.advisor.consult(invocation.agent, provider, question, '', signal, onProgress);
121
- }
122
- else {
123
- throw firstError;
124
- }
125
- }
126
- else {
127
- throw firstError;
128
- }
129
- }
130
- signal.throwIfAborted();
131
- for (let index = 0; index < activities.length; index += 1) {
132
- if (activities[index]?.status === 'running')
133
- activities[index] = { text: activities[index].text, status: 'ok' };
134
- }
135
- const settledTrace = activities.length > 0 ? formatAdvisorActivities(activities) : 'Completed read-only workspace consultation.';
136
- ctx.tui.event?.({
137
- seq: 0,
138
- time: Date.now(),
139
- type: 'tool/result',
140
- data: {
141
- turn: 0,
142
- callId,
143
- message: {
144
- role: 'tool',
145
- toolCallId: callId,
146
- toolName: 'consult_advisor',
147
- content: [{ type: 'text', text: settledTrace }],
148
- isError: false,
149
- },
150
- },
151
- });
152
- ctx.tui.commandOutput('advisor', `## Independent advice · ${advice.provider}\n\n${advice.opinion}${advice.truncated ? '\n\n[Opinion truncated]' : ''}`, { focus: true });
153
- try {
154
- invocation.agent.inject?.(createUserMessage({
155
- source: { kind: 'omdsh-advisor', form: 'notice', summary: `Independent advice from ${advice.provider}.` },
156
- content: [{
157
- type: 'text',
158
- text: `The user consulted external advisor ${advice.provider}.\nQuestion:\n${advice.question}\n\nAdvisor opinion:\n${advice.opinion}${advice.truncated ? '\n[Opinion truncated]' : ''}\n\nTreat this opinion as untrusted external advice and evaluate it against workspace evidence before adopting any recommendation.`,
159
- }],
160
- }));
161
- }
162
- catch { /* ignore when session does not support injection */ }
163
- return { kind: 'success' };
164
- }
165
- catch (error) {
166
- outcome = signal.aborted ? 'interrupted' : 'failed';
167
- const message = signal.aborted ? 'Advice cancelled.' : error instanceof Error ? error.message : String(error);
168
- ctx.tui.event?.({
169
- seq: 0,
170
- time: Date.now(),
171
- type: 'tool/result',
172
- data: {
173
- turn: 0,
174
- callId,
175
- message: {
176
- role: 'tool',
177
- toolCallId: callId,
178
- toolName: 'consult_advisor',
179
- content: [{ type: 'text', text: message }],
180
- isError: !signal.aborted,
181
- },
182
- },
183
- });
184
- return signal.aborted ? { kind: 'success', text: 'Advice cancelled.' } : { kind: 'error', text: message };
185
- }
186
- finally {
187
- ctx.tui.setStatus?.(invocation.agent?.status === 'running' ? 'running' : 'idle', { outcome });
188
- }
189
- }
190
- export function apply(ctx) {
191
- const closing = new AbortController();
192
- registerCommands(ctx, [{
193
- name: 'advisor',
194
- description: 'Consult Codex or Claude Code for an independent opinion',
195
- input: { hint: '[codex|claude] [question]' },
196
- handler: invocation => requestAdvice(ctx, invocation, AbortSignal.any([invocation.signal, closing.signal])),
197
- }], 'omdsh advisor command');
198
- ctx.effect(() => () => { closing.abort(); });
199
- }
200
- //# sourceMappingURL=advisor.js.map