@deepseek-harness-tui/dsh-tui 0.19.0 → 0.20.1

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 (224) hide show
  1. package/README.md +67 -57
  2. package/bin/dsh-tui.js +26 -8
  3. package/cordis.patch.yml +5 -3
  4. package/cordis.yml +3 -2
  5. package/guide/dsh-tui-guide/claude-backend.en.md +6 -5
  6. package/guide/dsh-tui-guide/claude-backend.md +5 -5
  7. package/guide/dsh-tui-guide/configuration.en.md +1 -1
  8. package/guide/dsh-tui-guide/configuration.md +1 -1
  9. package/guide/dsh-tui-guide/getting-started.en.md +2 -2
  10. package/guide/dsh-tui-guide/getting-started.md +2 -2
  11. package/guide/dsh-tui-guide/migrate.en.md +5 -0
  12. package/guide/dsh-tui-guide/migrate.md +4 -0
  13. package/guide/dsh-tui-guide/plugins.en.md +17 -1
  14. package/guide/dsh-tui-guide/plugins.md +12 -1
  15. package/guide/dsh-tui-guide/user-guide.en.md +7 -2
  16. package/guide/dsh-tui-guide/user-guide.md +7 -2
  17. package/lib/settings.json +24 -8
  18. package/lib/types/adapter/kernel/host-facade.d.ts +3 -1
  19. package/lib/types/adapter/kernel/host-facade.d.ts.map +1 -1
  20. package/lib/types/adapter/kernel/host-facade.js +6 -0
  21. package/lib/types/adapter/kernel/runtime.d.ts.map +1 -1
  22. package/lib/types/adapter/kernel/runtime.js +5 -0
  23. package/lib/types/adapter/kernel/slices/extensions.d.ts +1 -0
  24. package/lib/types/adapter/kernel/slices/extensions.d.ts.map +1 -1
  25. package/lib/types/adapter/kernel/slices/extensions.js +6 -1
  26. package/lib/types/adapter/kernel/slices/index.d.ts +1 -1
  27. package/lib/types/adapter/kernel/slices/index.d.ts.map +1 -1
  28. package/lib/types/adapter/kernel/slices/index.js +3 -2
  29. package/lib/types/adapter/ports/channel-catalog.d.ts +19 -0
  30. package/lib/types/adapter/ports/channel-catalog.d.ts.map +1 -1
  31. package/lib/types/adapter/ports/channel-view.d.ts +39 -3
  32. package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
  33. package/lib/types/adapter/ports/extensions.d.ts +9 -0
  34. package/lib/types/adapter/ports/extensions.d.ts.map +1 -1
  35. package/lib/types/adapter/ports/index.d.ts +1 -1
  36. package/lib/types/adapter/ports/index.d.ts.map +1 -1
  37. package/lib/types/adapter/upstream/extensions-driver.d.ts +4 -1
  38. package/lib/types/adapter/upstream/extensions-driver.d.ts.map +1 -1
  39. package/lib/types/adapter/upstream/extensions-driver.js +111 -1
  40. package/lib/types/adapter/upstream/index.d.ts +1 -1
  41. package/lib/types/adapter/upstream/index.d.ts.map +1 -1
  42. package/lib/types/adapter/upstream/index.js +1 -1
  43. package/lib/types/agent/events.d.ts +3 -1
  44. package/lib/types/agent/events.d.ts.map +1 -1
  45. package/lib/types/api.d.ts +1 -1
  46. package/lib/types/api.d.ts.map +1 -1
  47. package/lib/types/backends/claude/backend.d.ts.map +1 -1
  48. package/lib/types/backends/claude/backend.js +7 -2
  49. package/lib/types/backends/claude/tools.d.ts.map +1 -1
  50. package/lib/types/backends/claude/tools.js +8 -3
  51. package/lib/types/backends/codex/translate/presentation.d.ts.map +1 -1
  52. package/lib/types/backends/codex/translate/presentation.js +5 -2
  53. package/lib/types/channel/interaction.d.ts.map +1 -1
  54. package/lib/types/channel/interaction.js +1 -0
  55. package/lib/types/channel/permissions.d.ts +15 -0
  56. package/lib/types/channel/permissions.d.ts.map +1 -1
  57. package/lib/types/channel/permissions.js +28 -0
  58. package/lib/types/channel/projection.d.ts.map +1 -1
  59. package/lib/types/channel/projection.js +11 -1
  60. package/lib/types/channel/questions.d.ts +26 -0
  61. package/lib/types/channel/questions.d.ts.map +1 -1
  62. package/lib/types/channel/questions.js +43 -0
  63. package/lib/types/commands.js +1 -1
  64. package/lib/types/components/FileSuggestions.d.ts +2 -2
  65. package/lib/types/components/FileSuggestions.d.ts.map +1 -1
  66. package/lib/types/components/FileSuggestions.js +25 -5
  67. package/lib/types/components/MessageList.d.ts.map +1 -1
  68. package/lib/types/components/MessageList.js +3 -3
  69. package/lib/types/components/PromptInput.d.ts +7 -1
  70. package/lib/types/components/PromptInput.d.ts.map +1 -1
  71. package/lib/types/components/PromptInput.js +81 -23
  72. package/lib/types/components/SplitDiffView.d.ts.map +1 -1
  73. package/lib/types/components/SplitDiffView.js +3 -2
  74. package/lib/types/components/StarPrompt.d.ts +5 -3
  75. package/lib/types/components/StarPrompt.d.ts.map +1 -1
  76. package/lib/types/components/StarPrompt.js +56 -6
  77. package/lib/types/components/SubagentCard.d.ts.map +1 -1
  78. package/lib/types/components/SubagentCard.js +1 -1
  79. package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
  80. package/lib/types/components/SubagentDashboard.js +3 -2
  81. package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
  82. package/lib/types/components/SubagentDetailScene.js +1 -1
  83. package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
  84. package/lib/types/components/messages/AssistantToolUseMessage.js +121 -23
  85. package/lib/types/components/teamRoster.d.ts +6 -3
  86. package/lib/types/components/teamRoster.d.ts.map +1 -1
  87. package/lib/types/dsh-adapter/approvals.d.ts +19 -0
  88. package/lib/types/dsh-adapter/approvals.d.ts.map +1 -1
  89. package/lib/types/dsh-adapter/approvals.js +17 -1
  90. package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
  91. package/lib/types/dsh-adapter/backend/translate.js +15 -3
  92. package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
  93. package/lib/types/dsh-adapter/channel/extensions.js +7 -4
  94. package/lib/types/dsh-adapter/channel/local-actions.d.ts.map +1 -1
  95. package/lib/types/dsh-adapter/channel/local-actions.js +7 -3
  96. package/lib/types/dsh-adapter/channel/projection-helpers.d.ts.map +1 -1
  97. package/lib/types/dsh-adapter/channel/projection-helpers.js +4 -2
  98. package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
  99. package/lib/types/dsh-adapter/channel/settings-host.js +179 -33
  100. package/lib/types/dsh-adapter/channel/subagent-projection.d.ts +55 -4
  101. package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
  102. package/lib/types/dsh-adapter/channel/subagent-projection.js +80 -16
  103. package/lib/types/dsh-adapter/channel/subagent-transcript.d.ts +1 -1
  104. package/lib/types/dsh-adapter/channel/subagent-transcript.d.ts.map +1 -1
  105. package/lib/types/dsh-adapter/channel/subagent-transcript.js +6 -5
  106. package/lib/types/dsh-adapter/channel/task-completion.js +2 -10
  107. package/lib/types/dsh-adapter/childStderr.d.ts +1 -1
  108. package/lib/types/dsh-adapter/childStderr.d.ts.map +1 -1
  109. package/lib/types/dsh-adapter/childStderr.js +5 -0
  110. package/lib/types/dsh-adapter/compat/compaction-previews.d.ts +11 -0
  111. package/lib/types/dsh-adapter/compat/compaction-previews.d.ts.map +1 -0
  112. package/lib/types/dsh-adapter/compat/compaction-previews.js +38 -0
  113. package/lib/types/dsh-adapter/compat/messages.d.ts +1 -1
  114. package/lib/types/dsh-adapter/compat/messages.d.ts.map +1 -1
  115. package/lib/types/dsh-adapter/compat/messages.js +2 -2
  116. package/lib/types/dsh-adapter/contract.d.ts +12 -5
  117. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  118. package/lib/types/dsh-adapter/contract.js +15 -4
  119. package/lib/types/dsh-adapter/experimental-bundles.d.ts +5 -0
  120. package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -1
  121. package/lib/types/dsh-adapter/experimental-bundles.js +0 -2
  122. package/lib/types/dsh-adapter/extensions.d.ts +3 -2
  123. package/lib/types/dsh-adapter/extensions.d.ts.map +1 -1
  124. package/lib/types/dsh-adapter/extensions.js +5 -2
  125. package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
  126. package/lib/types/dsh-adapter/host-contract.js +2 -2
  127. package/lib/types/dsh-adapter/host-dsh.d.ts +6 -0
  128. package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -1
  129. package/lib/types/dsh-adapter/host-dsh.js +29 -0
  130. package/lib/types/dsh-adapter/index.d.ts +9 -1
  131. package/lib/types/dsh-adapter/index.d.ts.map +1 -1
  132. package/lib/types/dsh-adapter/index.js +5 -0
  133. package/lib/types/dsh-adapter/mention-providers.d.ts +91 -0
  134. package/lib/types/dsh-adapter/mention-providers.d.ts.map +1 -0
  135. package/lib/types/dsh-adapter/mention-providers.js +214 -0
  136. package/lib/types/dsh-adapter/migrate/entry.d.ts +2 -0
  137. package/lib/types/dsh-adapter/migrate/entry.d.ts.map +1 -0
  138. package/lib/types/dsh-adapter/migrate/entry.js +46 -0
  139. package/lib/types/dsh-adapter/oauth/account-notifications.d.ts +73 -0
  140. package/lib/types/dsh-adapter/oauth/account-notifications.d.ts.map +1 -0
  141. package/lib/types/dsh-adapter/oauth/account-notifications.js +250 -0
  142. package/lib/types/dsh-adapter/oauth/bonus.d.ts +34 -9
  143. package/lib/types/dsh-adapter/oauth/bonus.d.ts.map +1 -1
  144. package/lib/types/dsh-adapter/oauth/bonus.js +47 -5
  145. package/lib/types/dsh-adapter/oauth/deepseek.d.ts +7 -2
  146. package/lib/types/dsh-adapter/oauth/deepseek.d.ts.map +1 -1
  147. package/lib/types/dsh-adapter/oauth/deepseek.js +6 -1
  148. package/lib/types/dsh-adapter/oauth/index.d.ts.map +1 -1
  149. package/lib/types/dsh-adapter/oauth/index.js +44 -0
  150. package/lib/types/dsh-adapter/oauth/service.d.ts.map +1 -1
  151. package/lib/types/dsh-adapter/oauth/service.js +5 -6
  152. package/lib/types/dsh-adapter/plugin-manage.d.ts +6 -4
  153. package/lib/types/dsh-adapter/plugin-manage.d.ts.map +1 -1
  154. package/lib/types/dsh-adapter/plugin-manage.js +3 -2
  155. package/lib/types/dsh-adapter/plugin.d.ts +237 -6
  156. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  157. package/lib/types/dsh-adapter/plugin.js +611 -23
  158. package/lib/types/dsh-adapter/session-projection-store.d.ts +1 -1
  159. package/lib/types/dsh-adapter/session-projection-store.d.ts.map +1 -1
  160. package/lib/types/dsh-adapter/session-projection-store.js +30 -23
  161. package/lib/types/dsh-adapter/sessionTree.d.ts.map +1 -1
  162. package/lib/types/dsh-adapter/sessionTree.js +4 -1
  163. package/lib/types/dsh-adapter/subagents.d.ts +1 -0
  164. package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
  165. package/lib/types/dsh-adapter/subagents.js +10 -2
  166. package/lib/types/dsh-adapter/team-mode.d.ts +29 -17
  167. package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
  168. package/lib/types/dsh-adapter/team-mode.js +138 -17
  169. package/lib/types/dsh-adapter/team-roster.d.ts +53 -18
  170. package/lib/types/dsh-adapter/team-roster.d.ts.map +1 -1
  171. package/lib/types/dsh-adapter/team-roster.js +206 -39
  172. package/lib/types/dsh-adapter/team-tools.d.ts +25 -12
  173. package/lib/types/dsh-adapter/team-tools.d.ts.map +1 -1
  174. package/lib/types/dsh-adapter/team-tools.js +81 -26
  175. package/lib/types/extensions.d.ts +2 -0
  176. package/lib/types/extensions.d.ts.map +1 -1
  177. package/lib/types/extensions.js +4 -1
  178. package/lib/types/i18n.d.ts +71 -11
  179. package/lib/types/i18n.d.ts.map +1 -1
  180. package/lib/types/i18n.js +32 -9
  181. package/lib/types/ink/dom.d.ts.map +1 -1
  182. package/lib/types/ink/dom.js +13 -3
  183. package/lib/types/ink/flush-tick.d.ts +6 -0
  184. package/lib/types/ink/flush-tick.d.ts.map +1 -1
  185. package/lib/types/ink/flush-tick.js +31 -0
  186. package/lib/types/ink/hooks/use-terminal-title.d.ts +15 -0
  187. package/lib/types/ink/hooks/use-terminal-title.d.ts.map +1 -1
  188. package/lib/types/ink/hooks/use-terminal-title.js +23 -3
  189. package/lib/types/ink/ink.js +2 -2
  190. package/lib/types/ink/jumpback-state.d.ts +33 -0
  191. package/lib/types/ink/jumpback-state.d.ts.map +1 -0
  192. package/lib/types/ink/jumpback-state.js +51 -0
  193. package/lib/types/ink/jumpback.d.ts +78 -0
  194. package/lib/types/ink/jumpback.d.ts.map +1 -0
  195. package/lib/types/ink/jumpback.js +515 -0
  196. package/lib/types/ink/log-update.js +37 -14
  197. package/lib/types/ink/notify-helper/activate.cs +836 -0
  198. package/lib/types/ink/notify-helper/compile.d.ts +30 -0
  199. package/lib/types/ink/notify-helper/compile.d.ts.map +1 -0
  200. package/lib/types/ink/notify-helper/compile.js +235 -0
  201. package/lib/types/ink/terminal-notification-windows.d.ts +8 -4
  202. package/lib/types/ink/terminal-notification-windows.d.ts.map +1 -1
  203. package/lib/types/ink/terminal-notification-windows.js +14 -21
  204. package/lib/types/ink/terminal-notification.d.ts +31 -2
  205. package/lib/types/ink/terminal-notification.d.ts.map +1 -1
  206. package/lib/types/ink/terminal-notification.js +51 -0
  207. package/lib/types/ink/terminal.d.ts +2 -1
  208. package/lib/types/ink/terminal.d.ts.map +1 -1
  209. package/lib/types/ink/terminal.js +9 -4
  210. package/lib/types/screens/AgentTranscriptScene.d.ts.map +1 -1
  211. package/lib/types/screens/AgentTranscriptScene.js +1 -1
  212. package/lib/types/screens/Chat.d.ts +8 -4
  213. package/lib/types/screens/Chat.d.ts.map +1 -1
  214. package/lib/types/screens/Chat.js +40 -11
  215. package/lib/types/settings/definitions.d.ts +12 -0
  216. package/lib/types/settings/definitions.d.ts.map +1 -1
  217. package/lib/types/settings/definitions.js +15 -7
  218. package/lib/types/utils/fileSuggestions.d.ts +14 -3
  219. package/lib/types/utils/fileSuggestions.d.ts.map +1 -1
  220. package/lib/types/utils/fileSuggestions.js +33 -0
  221. package/package.json +117 -112
  222. package/presets/liangshen/agent.cordis.yml +4 -0
  223. package/tui-profile/feed/README.md +1 -1
  224. package/tui-profile/feed/first-party.json +1 -1
@@ -73,6 +73,8 @@ export class QuestionStore {
73
73
  * nothing changed (a fresh object per call would loop re-renders).
74
74
  */
75
75
  snapshotCache = null;
76
+ /** Per-ask observer (see {@link setOnAsk}); undefined = no observer. */
77
+ onAsk;
76
78
  /**
77
79
  * Subscribe to store changes (useSyncExternalStore contract).
78
80
  * @param listener - Called after every mutation that changes the snapshot.
@@ -99,6 +101,30 @@ export class QuestionStore {
99
101
  stillCurrent(key) {
100
102
  return this.snapshotCache?.key === key;
101
103
  }
104
+ /**
105
+ * Whether this exact ask is still pending (the batch on screen or one queued
106
+ * behind it). A notification queued before the native transport dispatches
107
+ * uses it to drop a toast whose question was answered or cancelled in the
108
+ * meantime; object identity is the only per-ask identity the store keeps.
109
+ * @param request - The request object handed to {@link ask}.
110
+ * @returns True while the batch still waits for an answer.
111
+ */
112
+ hasPendingRequest(request) {
113
+ for (const pending of this.active === undefined ? this.queue : [this.active, ...this.queue]) {
114
+ if (pending.request === request)
115
+ return true;
116
+ }
117
+ return false;
118
+ }
119
+ /**
120
+ * Watch every ask — e.g. to raise a notification when a question needs the
121
+ * user. Called once per ask batch, a queued one included (each still needs
122
+ * an answer); answering or interrupting never calls it. Unset (the default)
123
+ * leaves the store's behaviour unchanged.
124
+ */
125
+ setOnAsk(callback) {
126
+ this.onAsk = callback;
127
+ }
102
128
  emit() {
103
129
  for (const listener of this.listeners)
104
130
  listener();
@@ -167,6 +193,7 @@ export class QuestionStore {
167
193
  request.signal?.addEventListener('abort', pending.onAbort, { once: true });
168
194
  this.queue.push(pending);
169
195
  this.startNext();
196
+ this.notifyAsk(request);
170
197
  });
171
198
  }
172
199
  /** Advance to the next queued ask, if any. */
@@ -275,6 +302,22 @@ export class QuestionStore {
275
302
  this.fail(pending);
276
303
  this.emit();
277
304
  }
305
+ /**
306
+ * A notification callback that throws must not wedge the question queue:
307
+ * the ask stays queued and the notification is simply lost, exactly like a
308
+ * throwing settle callback.
309
+ */
310
+ notifyAsk(request) {
311
+ const callback = this.onAsk;
312
+ if (callback === undefined)
313
+ return;
314
+ try {
315
+ callback(request);
316
+ }
317
+ catch {
318
+ // A failed notification must never block the question.
319
+ }
320
+ }
278
321
  /** User-initiated cancel — the asker learns the user wants to speak. */
279
322
  cancel(pending) {
280
323
  pending.reject(this.interruption('the user cancelled ask_user_question', 'ASK_CANCELLED'));
@@ -62,7 +62,7 @@ export const LOCAL_COMMANDS = [
62
62
  { name: 'migrate', description: 'Import conversations from other coding agents (claude-code / codex / omp / zcode / grok-build)' },
63
63
  { name: 'init', description: 'Create AGENTS.md in the working directory' },
64
64
  { name: 'agents', description: 'Show subagents of this session' },
65
- { name: 'team', description: 'Agent Teams: show status while the team service is running' },
65
+ { name: 'team', description: "Agent Teams: show status or switch this session's team (on/off)" },
66
66
  { name: 'jobs', description: 'Show background jobs of this session' },
67
67
  { name: 'panel', description: 'Side panel: toggle / focus / zoom / switch panels' },
68
68
  // Model / display
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import type { Color } from '../ink/styles.js';
3
3
  import type { Theme } from '../theme.js';
4
- import type { FileCandidate } from '../utils/fileSuggestions.js';
4
+ import type { MentionCandidate } from '../utils/fileSuggestions.js';
5
5
  export declare function FileSuggestions({ files, selectedIndex, columns, query, accent, onPick, onWheelStep, }: {
6
- files: readonly FileCandidate[];
6
+ files: readonly MentionCandidate[];
7
7
  selectedIndex: number;
8
8
  columns: number;
9
9
  /** `@` 触发 token 里已输入的查询(`mention.query`),用于名字前缀高亮。 */
@@ -1 +1 @@
1
- {"version":3,"file":"FileSuggestions.d.ts","sourceRoot":"","sources":["../../../src/components/FileSuggestions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAsFhE,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,aAAa,EACb,OAAO,EACP,KAAU,EACV,MAAM,EACN,MAAM,EACN,WAAW,GACZ,EAAE;IACD,KAAK,EAAE,SAAS,aAAa,EAAE,CAAA;IAC/B,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,KAAK,GAAG,KAAK,CAAA;IAC5B;sDACkD;IAClD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,iCAAiC;IACjC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,CAAA;CACrC,GAAG,KAAK,CAAC,SAAS,CAmDlB"}
1
+ {"version":3,"file":"FileSuggestions.d.ts","sourceRoot":"","sources":["../../../src/components/FileSuggestions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAiB,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AA0GlF,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,aAAa,EACb,OAAO,EACP,KAAU,EACV,MAAM,EACN,MAAM,EACN,WAAW,GACZ,EAAE;IACD,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAA;IAClC,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,KAAK,GAAG,KAAK,CAAA;IAC5B;sDACkD;IAClD,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,iCAAiC;IACjC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,CAAA;CACrC,GAAG,KAAK,CAAC,SAAS,CAoDlB"}
@@ -22,12 +22,33 @@ import { useTooltip } from './Tooltip.js';
22
22
  * so the description column keeps its contract at narrow terminals (pinned
23
23
  * by verify-cjk-truncate.tsx); every pad/truncate uses display width, so CJK
24
24
  * names never split a glyph.
25
+ *
26
+ * Plugin provider rows (tuiMentions) share the card: `@` icon, the item's
27
+ * label in the name column, and `<provider title> · <detail>` as the
28
+ * description. Once any provider row is present the title reads 提及/mentions.
25
29
  */
26
30
  const NAME_COLUMN = 20;
27
31
  /** Display name: directories show without the trailing slash. */
28
32
  function nameOf(file) {
29
33
  return file.kind === 'directory' && file.path.endsWith('/') ? file.path.slice(0, -1) : file.path;
30
34
  }
35
+ /** The row's name column, icon, description and hover text. */
36
+ function rowParts(candidate) {
37
+ if (candidate.kind === 'provided') {
38
+ return {
39
+ name: candidate.label,
40
+ icon: '@ ',
41
+ description: candidate.detail === undefined ? candidate.section : `${candidate.section} · ${candidate.detail}`,
42
+ full: candidate.label,
43
+ };
44
+ }
45
+ return {
46
+ name: nameOf(candidate),
47
+ icon: candidate.kind === 'directory' ? '▸ ' : '+ ',
48
+ description: candidate.kind === 'directory' ? 'directory' : 'file',
49
+ full: candidate.path,
50
+ };
51
+ }
31
52
  /**
32
53
  * One candidate row: fixed-width name column + kind description. When the
33
54
  * name runs past the row's text budget (`wrap="truncate"` cuts the tail),
@@ -36,9 +57,7 @@ function nameOf(file) {
36
57
  * path is exactly the piece that decides which candidate to pick.
37
58
  */
38
59
  function FileSuggestionRow({ file, isSelected, query, usable, descriptionWidth }) {
39
- const name = nameOf(file);
40
- const icon = file.kind === 'directory' ? '▸ ' : '+ ';
41
- const description = file.kind === 'directory' ? 'directory' : 'file';
60
+ const { name, icon, description, full } = rowParts(file);
42
61
  const renderedDescription = stringWidth(description) > descriptionWidth
43
62
  ? truncateToWidth(description, Math.max(0, descriptionWidth - 1)) + '…'
44
63
  : description;
@@ -46,7 +65,7 @@ function FileSuggestionRow({ file, isSelected, query, usable, descriptionWidth }
46
65
  // is hidden exactly when it runs past the remaining budget; otherwise the
47
66
  // full path is already on screen and a float would just repeat it.
48
67
  const tooltip = useTooltip(() => 5 + stringWidth(name) > usable
49
- ? `${file.path}\n${description}`
68
+ ? `${full}\n${description}`
50
69
  : '');
51
70
  const padded = name + ' '.repeat(Math.max(1, NAME_COLUMN - stringWidth(name)));
52
71
  const parts = splitQueryMatch(name, query);
@@ -65,7 +84,8 @@ export function FileSuggestions({ files, selectedIndex, columns, query = '', acc
65
84
  const below = files.length - (startIndex + visible.length);
66
85
  // 行预算:内容宽 − 前导空格 1 − 指针列 2 − 图标列 2。
67
86
  const descriptionWidth = Math.max(0, usable - 25);
68
- const title = `${t('sugg-files-title')} · ${t('sugg-count', { n: files.length })}`;
87
+ const heading = files.some(file => file.kind === 'provided') ? t('sugg-mentions-title') : t('sugg-files-title');
88
+ const title = `${heading} · ${t('sugg-count', { n: files.length })}`;
69
89
  const footer = above > 0 || below > 0
70
90
  ? [
71
91
  above > 0 ? t('sugg-more-above', { n: above }) : null,
@@ -1 +1 @@
1
- {"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../../src/components/MessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,OAAO,EAA8B,KAAK,eAAe,EAAE,MAAM,UAAU,CAAA;AAE3E,OAAO,KAAK,EAAE,OAAO,EAA2E,MAAM,2BAA2B,CAAA;AAEjI,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAe/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAO3C,OAAO,EAAe,KAAK,gBAAgB,EAAqB,MAAM,yBAAyB,CAAA;AAC/F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AA+G3D;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBA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UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,4CAA4C;IAC5C,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAA;IACjD,qEAAqE;IACrE,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,qBAqlCA;AA4gBD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,MAAM,EACN,GAAG,EACH,MAAM,EACN,KAAY,EACZ,SAAgB,EAChB,SAAiB,EACjB,KAAK,EACL,OAAe,EACf,WAAW,EACX,OAAe,EACf,SAAiB,GAClB,EAAE;IACD,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX;oEACgE;IAChE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,wEAAwE;IACxE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,mFAAmF;IACnF,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,kDAAkD;IAClD,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;qEACiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,GAAG,KAAK,CAAC,SAAS,CASlB"}
@@ -1320,7 +1320,7 @@ export function MessageList({ rows, expanded, expandedRows, selectedId, onToggle
1320
1320
  else if (row.kind === 'reasoning' && smoothStreaming) {
1321
1321
  displayText = revealTextOf(scopeRevealKey(revealScope, `r${row.id}`), row.text, { enabled: true, active: displayStreaming });
1322
1322
  }
1323
- return (_jsx(MemoRow, { rowId: row.id, kind: row.kind, text: displayText, interruptBackend: row.interruptBackend, images: row.images, textFull: row.kind === 'reasoning' ? row.text : undefined, executionTarget: row.executionTarget, selectionAttached: row.selectionAttached, sender: teamSenderOf(row), streaming: displayStreaming, thinkingOpen: row.thinkingOpen === true, durationMs: row.durationMs, reasoningTokens: row.reasoningTokens, time: row.time, marginTopOnTurn: marginTopOnTurn, isSelected: selectedId === row.id, isExpanded: expandedRows.has(row.id), expanded: expanded, model: model, diffLayout: diffLayout, thinkingFold: thinkingFold, toolBackground: toolBackground, foldTerminalCommand: foldTerminalCommand, smoothStreaming: smoothStreaming, fresh: row.fresh === true, revealVersion: revealVersion, activityFrames: activityFrames, background: rowBackground(row.id), toolCallId: tool?.callId, toolName: tool?.name, toolArgsText: tool?.argsText, toolArgsFull: tool?.argsFull, toolStatus: tool?.status, toolResultText: tool?.resultText, toolResultFull: tool?.resultFull, toolErrorText: tool?.errorText, toolFootnote: failureHintRowId === row.id ? failureHint : undefined, toolCallView: tool?.callView, toolResultView: tool?.resultView, toolStartedAt: tool?.startedAt, toolDurationMs: tool?.durationMs, toolSourceFolded: row.folded === true, toolLiveOutput: tool?.liveOutput, toolLiveOutputDropped: tool?.liveOutputDropped, fullscreen: fullscreen, turnUsage: row.turnUsage, subagent: subagent, job: job, jobGroup: jobGroup, onToggleRow: onToggleRow, onToggleStreamView: onToggleStreamView, streamViewToggled: streamViewToggledRows.has(row.id), onOpenSubagent: onOpenSubagent, onOpenSubagentView: onOpenSubagentView, onOpenJobs: onOpenJobs, onWatchJobOutput: onWatchJobOutput, onOpenFile: onOpenFile, sessionCwd: sessionCwd, onPreviewImage: onPreviewImage, suppressImageGraphics: suppressImageGraphics, setRowRef: setRowRef }, row.id));
1323
+ return (_jsx(MemoRow, { rowId: row.id, kind: row.kind, text: displayText, compactSummaryPreview: row.compactPreview, interruptBackend: row.interruptBackend, images: row.images, textFull: row.kind === 'reasoning' ? row.text : undefined, executionTarget: row.executionTarget, selectionAttached: row.selectionAttached, sender: teamSenderOf(row), streaming: displayStreaming, thinkingOpen: row.thinkingOpen === true, durationMs: row.durationMs, reasoningTokens: row.reasoningTokens, time: row.time, marginTopOnTurn: marginTopOnTurn, isSelected: selectedId === row.id, isExpanded: expandedRows.has(row.id), expanded: expanded, model: model, diffLayout: diffLayout, thinkingFold: thinkingFold, toolBackground: toolBackground, foldTerminalCommand: foldTerminalCommand, smoothStreaming: smoothStreaming, fresh: row.fresh === true, revealVersion: revealVersion, activityFrames: activityFrames, background: rowBackground(row.id), toolCallId: tool?.callId, toolName: tool?.name, toolArgsText: tool?.argsText, toolArgsFull: tool?.argsFull, toolStatus: tool?.status, toolResultText: tool?.resultText, toolResultFull: tool?.resultFull, toolErrorText: tool?.errorText, toolFootnote: failureHintRowId === row.id ? failureHint : undefined, toolCallView: tool?.callView, toolResultView: tool?.resultView, toolStartedAt: tool?.startedAt, toolDurationMs: tool?.durationMs, toolSourceFolded: row.folded === true, toolLiveOutput: tool?.liveOutput, toolLiveOutputDropped: tool?.liveOutputDropped, fullscreen: fullscreen, turnUsage: row.turnUsage, subagent: subagent, job: job, jobGroup: jobGroup, onToggleRow: onToggleRow, onToggleStreamView: onToggleStreamView, streamViewToggled: streamViewToggledRows.has(row.id), onOpenSubagent: onOpenSubagent, onOpenSubagentView: onOpenSubagentView, onOpenJobs: onOpenJobs, onWatchJobOutput: onWatchJobOutput, onOpenFile: onOpenFile, sessionCwd: sessionCwd, onPreviewImage: onPreviewImage, suppressImageGraphics: suppressImageGraphics, setRowRef: setRowRef }, row.id));
1324
1324
  }), bottomPad > 0 && _jsx(Box, { height: bottomPad, flexShrink: 0 })] }));
1325
1325
  }
1326
1326
  /** Load-earlier / show-previous divider row with a mouse hover tint — the
@@ -1329,7 +1329,7 @@ function ClickableDivider({ title, onClick }) {
1329
1329
  const [hovered, setHovered] = useState(false);
1330
1330
  return (_jsx(Box, { marginTop: 1, onClick: onClick, onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), backgroundColor: hovered ? 'userMessageBackgroundHover' : undefined, children: _jsx(Divider, { title: title }) }));
1331
1331
  }
1332
- function TranscriptRow({ rowId, kind, text, interruptBackend, images, textFull, executionTarget, selectionAttached, sender, sessionCwd, streaming, thinkingOpen, durationMs, reasoningTokens, time, marginTopOnTurn, isSelected, isExpanded, expanded, model, diffLayout, smoothStreaming, fresh, revealVersion, thinkingFold, toolBackground, foldTerminalCommand, activityFrames, background, toolCallId, toolName, toolArgsText, toolArgsFull, toolStatus, toolResultText, toolResultFull, toolErrorText, toolFootnote, toolCallView, toolResultView, toolStartedAt, toolDurationMs, toolSourceFolded, toolLiveOutput, toolLiveOutputDropped, fullscreen, turnUsage, subagent, job, jobGroup, onToggleRow, onToggleStreamView, streamViewToggled, onOpenSubagent, onOpenSubagentView, onOpenJobs, onWatchJobOutput, onOpenFile, onPreviewImage, suppressImageGraphics, setRowRef, }) {
1332
+ function TranscriptRow({ rowId, kind, text, compactSummaryPreview, interruptBackend, images, textFull, executionTarget, selectionAttached, sender, sessionCwd, streaming, thinkingOpen, durationMs, reasoningTokens, time, marginTopOnTurn, isSelected, isExpanded, expanded, model, diffLayout, smoothStreaming, fresh, revealVersion, thinkingFold, toolBackground, foldTerminalCommand, activityFrames, background, toolCallId, toolName, toolArgsText, toolArgsFull, toolStatus, toolResultText, toolResultFull, toolErrorText, toolFootnote, toolCallView, toolResultView, toolStartedAt, toolDurationMs, toolSourceFolded, toolLiveOutput, toolLiveOutputDropped, fullscreen, turnUsage, subagent, job, jobGroup, onToggleRow, onToggleStreamView, streamViewToggled, onOpenSubagent, onOpenSubagentView, onOpenJobs, onWatchJobOutput, onOpenFile, onPreviewImage, suppressImageGraphics, setRowRef, }) {
1333
1333
  const ref = React.useCallback((el) => {
1334
1334
  setRowRef(rowId, el);
1335
1335
  }, [setRowRef, rowId]);
@@ -1452,7 +1452,7 @@ function TranscriptRow({ rowId, kind, text, interruptBackend, images, textFull,
1452
1452
  // The post-compaction summary defaults to a folded one-liner with a
1453
1453
  // text preview; Ctrl+O (global), message-selection Enter, or a click
1454
1454
  // reveals the full summary.
1455
- return (_jsx(Box, { marginTop: marginTopOnTurn ? 1 : 0, paddingLeft: 2, backgroundColor: background, ref: ref, onClick: foldOnClick, onMouseEnter: () => setCompactHovered(true), onMouseLeave: () => setCompactHovered(false), children: expanded || isExpanded ? (_jsx(Text, { dimColor: true, children: text })) : (_jsxs(Text, { dimColor: true, italic: true, color: compactHovered ? 'text' : undefined, children: [_jsx(Text, { color: compactHovered ? 'text' : undefined, children: "\u2234" }), ' ', t('compact-summary-folded'), " \u00B7 ", compactPreview(displayText), ' ', t('hint-expand-ctrl-o', { key: primaryComboString('transcript') })] })) }));
1455
+ return (_jsx(Box, { marginTop: marginTopOnTurn ? 1 : 0, paddingLeft: 2, backgroundColor: background, ref: ref, onClick: foldOnClick, onMouseEnter: () => setCompactHovered(true), onMouseLeave: () => setCompactHovered(false), children: expanded || isExpanded ? (_jsx(Text, { dimColor: true, children: text })) : (_jsxs(Text, { dimColor: true, italic: true, color: compactHovered ? 'text' : undefined, children: [_jsx(Text, { color: compactHovered ? 'text' : undefined, children: "\u2234" }), ' ', t('compact-summary-folded'), " \u00B7 ", compactPreview(compactSummaryPreview ?? displayText), ' ', t('hint-expand-ctrl-o', { key: primaryComboString('transcript') })] })) }));
1456
1456
  case 'subagent':
1457
1457
  if (!subagent)
1458
1458
  return null;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import type { ChannelUi as Channel } from '../adapter/channel/ui-policy.js';
3
3
  import type { ComposerImageRef } from '../dsh-adapter/channel.js';
4
4
  import type { TranscriptImage } from '../dsh-adapter/transcript-images.js';
5
+ import type { TuiMentionHost } from '../dsh-adapter/mention-providers.js';
5
6
  import { type PromptDraftCache } from './promptDraftCache.js';
6
7
  export { sanitizeEditableText, sanitizePastedText } from '../utils/inputPaste.js';
7
8
  /** Capabilities referenced by `text`, in first occurrence order. A raw token
@@ -53,6 +54,11 @@ export interface PromptController {
53
54
  */
54
55
  export interface PromptInputProps {
55
56
  channel: Channel;
57
+ /**
58
+ * Plugin `@` completion providers (the tuiMentions host facade). Absent or
59
+ * empty, the `@` popup is the workspace file list, byte for byte.
60
+ */
61
+ mentionProviders?: Pick<TuiMentionHost, 'size' | 'complete'>;
56
62
  /** Keep the draft mounted while another prompt-slot panel owns the UI. */
57
63
  suspended?: boolean;
58
64
  /**
@@ -200,5 +206,5 @@ export interface PromptInputProps {
200
206
  * working) interrupts the turn and delivers them right away; Ctrl+Enter
201
207
  * aborts the turn and sends the current input immediately.
202
208
  */
203
- export declare function PromptInput({ channel, toastSuppressed, suspended, cursorParking, draftCache, onInputReady, helpOpen, onToggleHelp, onRunCommand, selectionActive, fillText, onFillConsumed, onRewindRequest, onBackgroundRequest, onOpenSessions, backendLabel, backgroundAgentsNeedingInput, controllerRef, onCaretImage, caretPreviewOpen, onDismissCaretPreview, now, }: PromptInputProps): React.JSX.Element | null;
209
+ export declare function PromptInput({ channel, mentionProviders, toastSuppressed, suspended, cursorParking, draftCache, onInputReady, helpOpen, onToggleHelp, onRunCommand, selectionActive, fillText, onFillConsumed, onRewindRequest, onBackgroundRequest, onOpenSessions, backendLabel, backgroundAgentsNeedingInput, controllerRef, onCaretImage, caretPreviewOpen, onDismissCaretPreview, now, }: PromptInputProps): React.JSX.Element | null;
204
210
  //# sourceMappingURL=PromptInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PromptInput.d.ts","sourceRoot":"","sources":["../../../src/components/PromptInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AA+BzB,OAAO,KAAK,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,KAAK,EACV,gBAAgB,EAGjB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAc1E,OAAO,EAIL,KAAK,gBAAgB,EAEtB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,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AAC,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAA;IACxD;;;;;;;OAOG;IACH,YAAY,CAAC,CAAC,KAAK,EAAE,eAAe,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAAA;IAC7G;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,qBAAqB,CAAC,IAAI,IAAI,CAAA;IAC9B;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,gBAAgB,EAChB,eAAe,EACf,SAAiB,EACjB,aAAoB,EACpB,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,4BAA4B,EAC5B,aAAa,EACb,YAAY,EACZ,gBAAwB,EACxB,qBAAqB,EACrB,GAAc,GACf,EAAE,gBAAgB,4BAglIlB"}
@@ -30,7 +30,7 @@ import { setPromptEditorNode, EditorButton } from './PromptEditor.js';
30
30
  import { isBootSafeCommand, isHiddenCommandName, isLocalCommandName, isUnavailableLocalCommand, parseCommandName, workingHoldOf } from '../commands.js';
31
31
  import { appendHistory, HISTORY_LIMIT, historyProjectKey, loadHistoryOldestFirst } from '../history.js';
32
32
  import { mentionAtCaret } from '../utils/mentions.js';
33
- import { preserveSelection } from '../utils/fileSuggestions.js';
33
+ import { mergeMentionCandidates, preserveSelection, } from '../utils/fileSuggestions.js';
34
34
  import { isMod } from '../utils/modifiers.js';
35
35
  import { actionMatches } from '../utils/keymap.js';
36
36
  import { CommandSuggestions } from './CommandSuggestions.js';
@@ -306,6 +306,7 @@ const EDITOR_CHROME_ROWS = 5;
306
306
  * carries onDragStart), so the prompt detects the double-click itself.
307
307
  */
308
308
  const DOUBLE_CLICK_MS = 500;
309
+ const NO_PROVIDED_MATCHES = Object.freeze({ query: '', items: [] });
309
310
  /**
310
311
  * dsh-TUI prompt input: rounded border box (top+bottom borders
311
312
  * only), `❯ ` prompt char (dimmed while a turn is working), the text with a
@@ -336,7 +337,7 @@ const DOUBLE_CLICK_MS = 500;
336
337
  * working) interrupts the turn and delivers them right away; Ctrl+Enter
337
338
  * aborts the turn and sends the current input immediately.
338
339
  */
339
- export function PromptInput({ channel, toastSuppressed, suspended = false, cursorParking = true, draftCache, onInputReady, helpOpen, onToggleHelp, onRunCommand, selectionActive, fillText, onFillConsumed, onRewindRequest, onBackgroundRequest, onOpenSessions, backendLabel, backgroundAgentsNeedingInput, controllerRef, onCaretImage, caretPreviewOpen = false, onDismissCaretPreview, now = Date.now, }) {
340
+ export function PromptInput({ channel, mentionProviders, toastSuppressed, suspended = false, cursorParking = true, draftCache, onInputReady, helpOpen, onToggleHelp, onRunCommand, selectionActive, fillText, onFillConsumed, onRewindRequest, onBackgroundRequest, onOpenSessions, backendLabel, backgroundAgentsNeedingInput, controllerRef, onCaretImage, caretPreviewOpen = false, onDismissCaretPreview, now = Date.now, }) {
340
341
  const [themeName] = useTheme();
341
342
  const nativeCursor = useNativeCursor();
342
343
  /**
@@ -981,36 +982,81 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
981
982
  // appears.
982
983
  const [fileMatches, setFileMatches] = React.useState([]);
983
984
  const [fileSelected, setFileSelected] = React.useState(0);
985
+ // Plugin provider rows (tuiMentions) ride in the same popup; the query they
986
+ // answered is kept beside them so ranking never mixes two keystrokes.
987
+ const [providedMatches, setProvidedMatches] = React.useState(NO_PROVIDED_MATCHES);
988
+ // The latest SET values of both lists, for the async merges below.
989
+ const fileMatchesRef = React.useRef(fileMatches);
990
+ const providedMatchesRef = React.useRef(providedMatches);
984
991
  const mention = mentionAtCaret(value, cursor);
985
992
  const atTrigger = mention !== undefined;
986
993
  const fileRequestId = React.useRef(0);
987
- const selectedFile = fileMatches[fileSelected];
994
+ const providedRequestId = React.useRef(0);
995
+ /** The popup rows: files, with provider rows merged in by fuzzy score. */
996
+ const mentionMatches = React.useMemo(() => mergeMentionCandidates(fileMatches, providedMatches.query === mention?.query ? providedMatches.items : [], mention?.query ?? ''), [fileMatches, providedMatches, mention?.query]);
997
+ // Provider rows can disappear during render, before either request settles.
998
+ // Match the popup's highlight and both keyboard acceptance paths immediately.
999
+ const mentionSelected = Math.max(0, Math.min(fileSelected, mentionMatches.length - 1));
988
1000
  React.useEffect(() => {
989
1001
  const requestId = ++fileRequestId.current;
990
1002
  if (!mention) {
1003
+ fileMatchesRef.current = [];
991
1004
  setFileMatches([]);
992
1005
  setFileSelected(0);
993
1006
  return;
994
1007
  }
995
- const previous = selectedFile;
996
- // Deps key on `mention.query` (and trigger on/off) only: cursor movement
997
- // within the same token must NOT refetch, and `selectedFile`/`fileSelected`
998
- // are read as their render-time values only to seed selection preservation.
999
- // eslint-disable-next-line react-hooks/exhaustive-deps
1000
- void channel.listFileCandidates(mention.query, { topK: 50 }).then(next => {
1008
+ const query = mention.query;
1009
+ // Cursor movement within the same token does not refetch. Preserve the
1010
+ // selection at settlement, including navigation while files were pending.
1011
+ void channel.listFileCandidates(query, { topK: 50 }).then(next => {
1001
1012
  if (requestId !== fileRequestId.current)
1002
1013
  return;
1014
+ const provided = providedMatchesRef.current;
1015
+ const items = provided.query === query ? provided.items : [];
1016
+ const shown = mergeMentionCandidates(fileMatchesRef.current, items, query);
1017
+ const after = mergeMentionCandidates(next, items, query);
1018
+ fileMatchesRef.current = next;
1003
1019
  setFileMatches(next);
1004
- setFileSelected(preserveSelection(previous, next, fileSelected));
1020
+ setFileSelected(index => preserveSelection(shown[index], after, index));
1005
1021
  });
1006
1022
  }, [channel, mention?.query, atTrigger]);
1023
+ // Provider rows: one aborted-on-change call per query. With no provider
1024
+ // registered this effect never touches state, so a host without plugins
1025
+ // renders exactly the file-only popup.
1026
+ React.useEffect(() => {
1027
+ const requestId = ++providedRequestId.current;
1028
+ if (!mention || mentionProviders === undefined || mentionProviders.size() === 0) {
1029
+ if (providedMatchesRef.current.items.length > 0) {
1030
+ providedMatchesRef.current = NO_PROVIDED_MATCHES;
1031
+ setProvidedMatches(NO_PROVIDED_MATCHES);
1032
+ }
1033
+ return;
1034
+ }
1035
+ const query = mention.query;
1036
+ const controller = new AbortController();
1037
+ void mentionProviders.complete(query, controller.signal).then(items => {
1038
+ if (requestId !== providedRequestId.current || controller.signal.aborted)
1039
+ return;
1040
+ const before = providedMatchesRef.current;
1041
+ const next = { query, items };
1042
+ providedMatchesRef.current = next;
1043
+ setProvidedMatches(next);
1044
+ // Keep the row the user is on, wherever the merge moves it.
1045
+ const files = fileMatchesRef.current;
1046
+ const shown = mergeMentionCandidates(files, before.query === query ? before.items : [], query);
1047
+ const after = mergeMentionCandidates(files, items, query);
1048
+ setFileSelected(index => preserveSelection(shown[index], after, index));
1049
+ }, () => undefined);
1050
+ return () => controller.abort();
1051
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1052
+ }, [mentionProviders, mention?.query, atTrigger]);
1007
1053
  // Esc dismisses the overlay for the token being edited (it reopens once the
1008
1054
  // text changes); it must NOT clear a mid-message input.
1009
1055
  const fileEscRef = React.useRef(null);
1010
1056
  const [, refreshFileMenu] = React.useState(0);
1011
1057
  const fileMenuDismissed = (start) => fileEscRef.current?.edit === inputEditSequenceRef.current && fileEscRef.current.start === start;
1012
1058
  const fileOverlayOpen = mention !== undefined &&
1013
- fileMatches.length > 0 &&
1059
+ mentionMatches.length > 0 &&
1014
1060
  !expanded &&
1015
1061
  !helpOpen &&
1016
1062
  !selectionActive &&
@@ -1231,7 +1277,20 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
1231
1277
  */
1232
1278
  const acceptFile = (candidate) => {
1233
1279
  if (!mention)
1234
- return;
1280
+ return false;
1281
+ if (candidate.kind === 'provided') {
1282
+ // A provider row is plain text: it replaces the whole `@query` token
1283
+ // and is never resolved as a path at submit time.
1284
+ const text = valueRef.current;
1285
+ const liveMention = mentionAtCaret(text, cursorRef.current);
1286
+ if (liveMention === undefined || liveMention.query !== mention.query)
1287
+ return false;
1288
+ const insert = `${candidate.insertText} `;
1289
+ const next = text.slice(0, liveMention.start) + insert + text.slice(liveMention.end);
1290
+ setInput(next, liveMention.start + insert.length, 'step');
1291
+ setFileSelected(0);
1292
+ return true;
1293
+ }
1235
1294
  const file = candidate.path;
1236
1295
  const body = /\s/.test(file) ? `@"${file}"` : `@${file}`;
1237
1296
  // A typed `#L12-14` suffix rides along AFTER the completed body (before
@@ -1241,6 +1300,7 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
1241
1300
  const next = value.slice(0, mention.start) + insert + value.slice(mention.end);
1242
1301
  setInput(next, mention.start + insert.length, 'step');
1243
1302
  setFileSelected(0);
1303
+ return true;
1244
1304
  };
1245
1305
  const imageRefsFor = (text) => {
1246
1306
  syncImageGeneration();
@@ -1858,11 +1918,9 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
1858
1918
  // File-completion overlay open → Enter accepts the selection (same
1859
1919
  // contract as the command menu: the overlay owns Enter while open).
1860
1920
  if (fileOverlayOpen) {
1861
- const file = fileMatches[fileSelected];
1862
- if (file) {
1863
- acceptFile(file);
1921
+ const file = mentionMatches[mentionSelected];
1922
+ if (file && acceptFile(file))
1864
1923
  return;
1865
- }
1866
1924
  }
1867
1925
  // Not ready: refuse before any path that clears the draft.
1868
1926
  if (channel.ready === false && value.trim() !== '') {
@@ -1942,7 +2000,7 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
1942
2000
  return true;
1943
2001
  }
1944
2002
  const currentMention = mentionAtCaret(current, cursorRef.current);
1945
- if (currentMention !== undefined && fileMatches.length > 0 && !fileMenuDismissed(currentMention.start)) {
2003
+ if (currentMention !== undefined && mentionMatches.length > 0 && !fileMenuDismissed(currentMention.start)) {
1946
2004
  // An edit sequence makes the dismissal token-local and resets it
1947
2005
  // on the next text edit, including one in the same stdin batch.
1948
2006
  fileEscRef.current = { edit: inputEditSequenceRef.current, start: currentMention.start };
@@ -2582,7 +2640,7 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
2582
2640
  return;
2583
2641
  }
2584
2642
  if (key.tab && fileOverlayOpen) {
2585
- const file = fileMatches[fileSelected];
2643
+ const file = mentionMatches[mentionSelected];
2586
2644
  if (file)
2587
2645
  acceptFile(file);
2588
2646
  return;
@@ -2658,7 +2716,7 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
2658
2716
  // `/model`), and letting the overlay navigate here strands the stashed
2659
2717
  // draft — Down would cycle menu rows instead of walking back.
2660
2718
  if (fileOverlayOpen && historyIndex.current < 0) {
2661
- setFileSelected(index => index <= 0 ? fileMatches.length - 1 : index - 1);
2719
+ setFileSelected(index => index <= 0 ? mentionMatches.length - 1 : index - 1);
2662
2720
  return;
2663
2721
  }
2664
2722
  // With a fold block the caret in the tail walks the TAIL's lines
@@ -2738,7 +2796,7 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
2738
2796
  }
2739
2797
  // Same history-walk ownership as ↑ above.
2740
2798
  if (fileOverlayOpen && historyIndex.current < 0) {
2741
- setFileSelected(index => index >= fileMatches.length - 1 ? 0 : index + 1);
2799
+ setFileSelected(index => index >= mentionMatches.length - 1 ? 0 : index + 1);
2742
2800
  return;
2743
2801
  }
2744
2802
  // Mirror of the tail-side ↑ walk: with a fold block the caret walks
@@ -3927,16 +3985,16 @@ export function PromptInput({ channel, toastSuppressed, suspended = false, curso
3927
3985
  // 点击提示行 = 全部发送(与空输入 ⏎ 同路径)
3928
3986
  , {
3929
3987
  // 点击提示行 = 全部发送(与空输入 ⏎ 同路径)
3930
- onClick: () => { sendDocked(); }, children: _jsxs(Text, { dimColor: true, children: [' ', t(channel.status === 'disposed' ? 'input-pending-dock-hint-disposed' : channel.working ? 'input-pending-dock-hint-working' : 'input-pending-dock-hint')] }) })] })), _jsxs(Text, { dimColor: true, children: ["Alt+\u2191 ", t(channel.status === 'disposed' ? 'input-pending-actions-hint-disposed' : 'input-pending-actions-hint')] })] })), fileOverlayOpen && (_jsx(FileSuggestions, { files: fileMatches, selectedIndex: fileSelected, columns: columns, query: mention?.query ?? '', accent: promptAccent,
3988
+ onClick: () => { sendDocked(); }, children: _jsxs(Text, { dimColor: true, children: [' ', t(channel.status === 'disposed' ? 'input-pending-dock-hint-disposed' : channel.working ? 'input-pending-dock-hint-working' : 'input-pending-dock-hint')] }) })] })), _jsxs(Text, { dimColor: true, children: ["Alt+\u2191 ", t(channel.status === 'disposed' ? 'input-pending-actions-hint-disposed' : 'input-pending-actions-hint')] })] })), fileOverlayOpen && (_jsx(FileSuggestions, { files: mentionMatches, selectedIndex: mentionSelected, columns: columns, query: mention?.query ?? '', accent: promptAccent,
3931
3989
  // 点击行 = 接受该项(与 Enter 同路径)
3932
3990
  onPick: (index) => {
3933
- const file = fileMatches[index];
3991
+ const file = mentionMatches[index];
3934
3992
  if (file)
3935
3993
  acceptFile(file);
3936
3994
  },
3937
3995
  // 滚轮 = 移动选中行(与 ↑/↓ 同路径,窗口跟随)
3938
3996
  onWheelStep: (step) => {
3939
- setFileSelected(i => Math.max(0, Math.min(fileMatches.length - 1, i + step)));
3997
+ setFileSelected(i => Math.max(0, Math.min(mentionMatches.length - 1, i + step)));
3940
3998
  } })), overlayOpen && (_jsx(CommandSuggestions, { commands: suggestions, selectedIndex: selectedCommand, columns: columns, query: value, accent: promptAccent, holdFrom: suggestionsHoldFrom,
3941
3999
  // 点击行 = 运行该命令(选中行与 Enter 共用派遣)
3942
4000
  onPick: (index) => {
@@ -1 +1 @@
1
- {"version":3,"file":"SplitDiffView.d.ts","sourceRoot":"","sources":["../../../src/components/SplitDiffView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAQ7D,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AQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,qEAAqE;IACrE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAA;IACxC;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CAC3C,GAAG,KAAK,CAAC,SAAS,CA0MlB"}
@@ -393,8 +393,9 @@ function clippedGraphemes(segments, budget) {
393
393
  * the same distance from their divider; the one-cell gap between gutter and
394
394
  * text is the caller's. */
395
395
  function gutterText(kind, tone, lineNo, hasContent, lineNoWidth) {
396
- // Status gutter instead of line numbers: ToolFileDiff has no file
397
- // offsets, and an invented number misleads (issue #250, P2-3).
396
+ // Status gutter instead of line numbers: this view does not consume the
397
+ // optional oldStart/newStart offsets, and an invented number misleads
398
+ // (issue #250, P2-3).
398
399
  const marker = kind === 'context' ? ' ' : tone === 'old' ? '−' : '+';
399
400
  const numbered = lineNoWidth > 0
400
401
  ? `${(lineNo === undefined || !hasContent ? '' : String(lineNo)).padStart(lineNoWidth)} ${marker}`
@@ -1,3 +1,4 @@
1
+ import type { AccountNotificationNotice } from '../dsh-adapter/oauth/account-notifications.js';
1
2
  import React from 'react';
2
3
  import type { StarMilestone } from '../usageStats.js';
3
4
  import type { WhaleCouponNotice } from '../dsh-adapter/oauth/bonus.js';
@@ -51,9 +52,10 @@ export declare function StarPrompt({ milestone, actions, onClose, initialPhase,
51
52
  * 走这条(只演感谢,不再问一次)。 */
52
53
  readonly initialPhase?: 'ask' | 'done';
53
54
  }): React.ReactNode;
54
- export declare function WhaleCouponPrompt({ notice, onShown, onClose, }: {
55
- readonly notice: WhaleCouponNotice;
56
- readonly onShown: (orderId: WhaleCouponNotice['orderId']) => void;
55
+ /** One existing account-notice lane, with server copy when no coupon data exists. */
56
+ export declare function WhaleCouponPrompt(props: {
57
+ readonly notice: WhaleCouponNotice | AccountNotificationNotice;
58
+ readonly onShown: (orderId: string) => void;
57
59
  readonly onClose: () => void;
58
60
  }): React.ReactNode;
59
61
  //# sourceMappingURL=StarPrompt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StarPrompt.d.ts","sourceRoot":"","sources":["../../../src/components/StarPrompt.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAazB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AAuBtE,2EAA2E;AAC3E,MAAM,MAAM,WAAW,GACnB;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAChD;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACrD;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAE9E;;0DAE0D;AAC1D,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;IAChD,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,OAAO,EACP,OAAO,EACP,YAAoB,GACrB,EAAE;IACD,yEAAyE;IACzE,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAA;IACjC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAA;IACnC,Q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