@deepseek-harness-tui/dsh-tui 0.20.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 (85) hide show
  1. package/README.md +5 -1
  2. package/bin/dsh-tui.js +26 -8
  3. package/guide/dsh-tui-guide/claude-backend.en.md +6 -5
  4. package/guide/dsh-tui-guide/claude-backend.md +5 -5
  5. package/guide/dsh-tui-guide/configuration.en.md +1 -1
  6. package/guide/dsh-tui-guide/configuration.md +1 -1
  7. package/guide/dsh-tui-guide/getting-started.en.md +2 -2
  8. package/guide/dsh-tui-guide/getting-started.md +2 -2
  9. package/guide/dsh-tui-guide/migrate.en.md +5 -0
  10. package/guide/dsh-tui-guide/migrate.md +4 -0
  11. package/guide/dsh-tui-guide/plugins.en.md +17 -1
  12. package/guide/dsh-tui-guide/plugins.md +12 -1
  13. package/guide/dsh-tui-guide/user-guide.en.md +1 -1
  14. package/guide/dsh-tui-guide/user-guide.md +1 -1
  15. package/lib/settings.json +1 -1
  16. package/lib/types/adapter/kernel/host-facade.d.ts +3 -1
  17. package/lib/types/adapter/kernel/host-facade.d.ts.map +1 -1
  18. package/lib/types/adapter/kernel/host-facade.js +6 -0
  19. package/lib/types/adapter/kernel/runtime.d.ts.map +1 -1
  20. package/lib/types/adapter/kernel/runtime.js +5 -0
  21. package/lib/types/adapter/kernel/slices/extensions.d.ts +1 -0
  22. package/lib/types/adapter/kernel/slices/extensions.d.ts.map +1 -1
  23. package/lib/types/adapter/kernel/slices/extensions.js +6 -1
  24. package/lib/types/adapter/kernel/slices/index.d.ts +1 -1
  25. package/lib/types/adapter/kernel/slices/index.d.ts.map +1 -1
  26. package/lib/types/adapter/kernel/slices/index.js +3 -2
  27. package/lib/types/adapter/ports/channel-catalog.d.ts +19 -0
  28. package/lib/types/adapter/ports/channel-catalog.d.ts.map +1 -1
  29. package/lib/types/adapter/ports/extensions.d.ts +9 -0
  30. package/lib/types/adapter/ports/extensions.d.ts.map +1 -1
  31. package/lib/types/adapter/ports/index.d.ts +1 -1
  32. package/lib/types/adapter/ports/index.d.ts.map +1 -1
  33. package/lib/types/adapter/upstream/extensions-driver.d.ts +4 -1
  34. package/lib/types/adapter/upstream/extensions-driver.d.ts.map +1 -1
  35. package/lib/types/adapter/upstream/extensions-driver.js +111 -1
  36. package/lib/types/adapter/upstream/index.d.ts +1 -1
  37. package/lib/types/adapter/upstream/index.d.ts.map +1 -1
  38. package/lib/types/adapter/upstream/index.js +1 -1
  39. package/lib/types/api.d.ts +1 -1
  40. package/lib/types/api.d.ts.map +1 -1
  41. package/lib/types/backends/claude/backend.d.ts.map +1 -1
  42. package/lib/types/backends/claude/backend.js +7 -2
  43. package/lib/types/components/FileSuggestions.d.ts +2 -2
  44. package/lib/types/components/FileSuggestions.d.ts.map +1 -1
  45. package/lib/types/components/FileSuggestions.js +25 -5
  46. package/lib/types/components/PromptInput.d.ts +7 -1
  47. package/lib/types/components/PromptInput.d.ts.map +1 -1
  48. package/lib/types/components/PromptInput.js +81 -23
  49. package/lib/types/dsh-adapter/childStderr.d.ts +1 -1
  50. package/lib/types/dsh-adapter/childStderr.d.ts.map +1 -1
  51. package/lib/types/dsh-adapter/childStderr.js +5 -0
  52. package/lib/types/dsh-adapter/contract.d.ts +9 -5
  53. package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
  54. package/lib/types/dsh-adapter/contract.js +11 -4
  55. package/lib/types/dsh-adapter/extensions.d.ts +3 -2
  56. package/lib/types/dsh-adapter/extensions.d.ts.map +1 -1
  57. package/lib/types/dsh-adapter/extensions.js +5 -2
  58. package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
  59. package/lib/types/dsh-adapter/host-contract.js +1 -1
  60. package/lib/types/dsh-adapter/host-dsh.d.ts +4 -0
  61. package/lib/types/dsh-adapter/host-dsh.d.ts.map +1 -1
  62. package/lib/types/dsh-adapter/host-dsh.js +26 -0
  63. package/lib/types/dsh-adapter/mention-providers.d.ts +91 -0
  64. package/lib/types/dsh-adapter/mention-providers.d.ts.map +1 -0
  65. package/lib/types/dsh-adapter/mention-providers.js +214 -0
  66. package/lib/types/dsh-adapter/migrate/entry.d.ts +2 -0
  67. package/lib/types/dsh-adapter/migrate/entry.d.ts.map +1 -0
  68. package/lib/types/dsh-adapter/migrate/entry.js +46 -0
  69. package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
  70. package/lib/types/dsh-adapter/plugin.js +3 -0
  71. package/lib/types/extensions.d.ts +2 -0
  72. package/lib/types/extensions.d.ts.map +1 -1
  73. package/lib/types/extensions.js +4 -1
  74. package/lib/types/i18n.d.ts +6 -2
  75. package/lib/types/i18n.d.ts.map +1 -1
  76. package/lib/types/i18n.js +3 -1
  77. package/lib/types/screens/Chat.d.ts +4 -1
  78. package/lib/types/screens/Chat.d.ts.map +1 -1
  79. package/lib/types/screens/Chat.js +2 -2
  80. package/lib/types/utils/fileSuggestions.d.ts +14 -3
  81. package/lib/types/utils/fileSuggestions.d.ts.map +1 -1
  82. package/lib/types/utils/fileSuggestions.js +33 -0
  83. package/package.json +114 -109
  84. package/tui-profile/feed/README.md +1 -1
  85. package/tui-profile/feed/first-party.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"extensions-driver.d.ts","sourceRoot":"","sources":["../../../../src/adapter/upstream/extensions-driver.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAeH,OAAO,KAAK,EAAE,SAAS,EAAqB,MAAM,gBAAgB,CAAA;AAClE,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,aAAa,CAAA;AAwCtE,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,CAiB9D;AA+ED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,CAiBjE;AAsFD,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,CAiBjE;AAmED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,C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B7B,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,cAmB1B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,cAmBzB,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,cAmBhC,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,cAmB5B,CAAA"}
@@ -2,7 +2,8 @@
2
2
  * Upstream drivers for the TUI extension seams.
3
3
  *
4
4
  * Each driver is a per-capability adapter over a legacy host-only facade:
5
- * status, shortcuts, renderers, themes, toast, and command trees. All
5
+ * status, shortcuts, renderers, themes, toast, command trees, and mention
6
+ * providers. All
6
7
  * register/subscribe probes use a unique temporary id, verify visibility,
7
8
  * dispose, then prove the same id is again available (no residue). Read-only
8
9
  * drivers only issue host-internal reads.
@@ -15,6 +16,7 @@ import { getHostRenderers } from '../../dsh-adapter/renderers.js';
15
16
  import { getHostThemes } from '../../dsh-adapter/themes.js';
16
17
  import { getHostToastStore } from '../../dsh-adapter/toast.js';
17
18
  import { getHostCommandTrees } from '../../dsh-adapter/command-trees.js';
19
+ import { getHostMentions } from '../../dsh-adapter/mention-providers.js';
18
20
  function serviceEvidence(id) {
19
21
  return { kind: 'service', id };
20
22
  }
@@ -568,6 +570,93 @@ function createCommandTreesPort(host) {
568
570
  descriptions: root => host.descriptions(root),
569
571
  });
570
572
  }
573
+ // ── mention providers ─────────────────────────────────────────────────────
574
+ export function detectMentionsCapability(ctx) {
575
+ const service = ctx?.get?.('tuiMentions');
576
+ if (service === undefined)
577
+ return { state: 'unsupported', reason: 'tuiMentions service is not mounted' };
578
+ const evidence = [serviceEvidence('tuiMentions')];
579
+ let host;
580
+ try {
581
+ host = getHostMentions(service);
582
+ }
583
+ catch {
584
+ host = undefined;
585
+ }
586
+ if (host === undefined)
587
+ return { state: 'degraded', missing: ['tuiMentions host facade'], evidence };
588
+ for (const method of ['register', 'size', 'complete']) {
589
+ if (typeof host[method] !== 'function') {
590
+ return { state: 'degraded', missing: [`tuiMentions.${method}()`], evidence };
591
+ }
592
+ }
593
+ return { state: 'supported', evidence };
594
+ }
595
+ async function verifyMentionsLive(ctx) {
596
+ const service = ctx?.get?.('tuiMentions');
597
+ const host = service === undefined ? undefined : (() => {
598
+ try {
599
+ return getHostMentions(service);
600
+ }
601
+ catch {
602
+ return undefined;
603
+ }
604
+ })();
605
+ const baseEvidence = [serviceEvidence('tuiMentions')];
606
+ if (host === undefined) {
607
+ return [
608
+ degradedFeature('host.mentions.register', baseEvidence, 'tuiMentions host facade'),
609
+ degradedFeature('host.mentions.complete', baseEvidence, 'tuiMentions host facade'),
610
+ ];
611
+ }
612
+ const evidence = [serviceEvidence('tuiMentions')];
613
+ const id = `dshtuiprobe${randomUUID().replace(/-/g, '').slice(0, 8)}`;
614
+ const probeText = `${id}-row`;
615
+ let dispose;
616
+ let live = false;
617
+ try {
618
+ dispose = host.register({ id, title: id, complete: () => [{ label: probeText, insertText: probeText }] });
619
+ const rows = await host.complete('', new AbortController().signal);
620
+ if (!rows.some(row => row.providerId === id && row.insertText === probeText)) {
621
+ throw new Error('temporary mention provider did not contribute its row');
622
+ }
623
+ evidence.push(probeEvidence(`tuiMentions.register+complete(${id})`, 'temporary provider registered and answered'));
624
+ dispose();
625
+ dispose = undefined;
626
+ const after = await host.complete('', new AbortController().signal);
627
+ if (after.some(row => row.providerId === id))
628
+ throw new Error('temporary mention provider left residue after dispose');
629
+ evidence.push(probeEvidence(`tuiMentions.dispose(${id})`, 'temporary provider removed; complete() no longer lists it'));
630
+ live = true;
631
+ }
632
+ catch (error) {
633
+ try {
634
+ dispose?.();
635
+ }
636
+ catch {
637
+ // ignore
638
+ }
639
+ evidence.push(probeEvidence('tuiMentions.reversible-live-probe', errorText(error)));
640
+ }
641
+ return [
642
+ live
643
+ ? liveFeature('host.mentions.register', evidence)
644
+ : degradedFeature('host.mentions.register', evidence, 'tuiMentions.reversible-live-probe'),
645
+ live
646
+ ? liveFeature('host.mentions.complete', [
647
+ serviceEvidence('tuiMentions'),
648
+ methodEvidence('tuiMentions', 'complete'),
649
+ probeEvidence('tuiMentions.complete()', 'temporary provider answered and cleaned up'),
650
+ ])
651
+ : degradedFeature('host.mentions.complete', [serviceEvidence('tuiMentions'), methodEvidence('tuiMentions', 'complete')], 'tuiMentions.complete() live-probe'),
652
+ ];
653
+ }
654
+ function createMentionsPort(host) {
655
+ return Object.freeze({
656
+ register: provider => host.register(provider),
657
+ complete: (query, signal) => host.complete(query, signal),
658
+ });
659
+ }
571
660
  // ── driver objects ────────────────────────────────────────────────────────
572
661
  export const statusDriver = {
573
662
  id: 'dsh-tui-status',
@@ -695,3 +784,24 @@ export const commandTreesDriver = {
695
784
  return { disposer: () => undefined, ...(ports === undefined ? {} : { ports }) };
696
785
  },
697
786
  };
787
+ export const mentionsDriver = {
788
+ id: 'dsh-tui-mentions',
789
+ upstreamFamily: 'dsh-tui',
790
+ capability: 'host.mentions',
791
+ mountEffectClass: 'register',
792
+ detect: detectMentionsCapability,
793
+ verifyLive: verifyMentionsLive,
794
+ async mount(context) {
795
+ const service = context?.get?.('tuiMentions');
796
+ const host = service === undefined ? undefined : (() => {
797
+ try {
798
+ return getHostMentions(service);
799
+ }
800
+ catch {
801
+ return undefined;
802
+ }
803
+ })();
804
+ const ports = host === undefined ? undefined : { mentions: createMentionsPort(host) };
805
+ return { disposer: () => undefined, ...(ports === undefined ? {} : { ports }) };
806
+ },
807
+ };
@@ -14,6 +14,6 @@ export { detectPanelsCapability, panelsDriver, } from './panels-driver.js';
14
14
  export { detectSettingsCapability, settingsDriver, } from './settings-driver.js';
15
15
  export { detectPresentationCapability, presentationDriver, } from './presentation-driver.js';
16
16
  export { detectDecisionsCapability, decisionsDriver, } from './decisions-driver.js';
17
- export { detectStatusCapability, detectShortcutsCapability, detectRenderersCapability, detectThemesCapability, detectToastCapability, detectCommandTreesCapability, statusDriver, shortcutsDriver, renderersDriver, themesDriver, toastDriver, commandTreesDriver, } from './extensions-driver.js';
17
+ export { detectStatusCapability, detectShortcutsCapability, detectRenderersCapability, detectThemesCapability, detectToastCapability, detectCommandTreesCapability, detectMentionsCapability, statusDriver, shortcutsDriver, renderersDriver, themesDriver, toastDriver, commandTreesDriver, mentionsDriver, } from './extensions-driver.js';
18
18
  export { detectChannelCapability, verifyChannelLive, channelDriver, } from './channel-driver.js';
19
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapter/upstream/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClF,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACtE,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,EAC/B,8BAA8B,EAC9B,oBAAoB,GACrB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACL,yBAAyB,EACzB,eAAe,GAChB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,sBAAsB,EACtB,YAAY,GACb,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,sBAAsB,EACtB,YAAY,GACb,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,wBAAwB,EACxB,cAAc,GACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,GACnB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,yBAAyB,EACzB,eAAe,GAChB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,4BAA4B,EAC5B,YAAY,EACZ,eAAe,EACf,eAAe,EACf,YAAY,EACZ,WAAW,EACX,kBAAkB,GACnB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,aAAa,GACd,MAAM,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapter/upstream/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClF,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACtE,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,EAC/B,8BAA8B,EAC9B,oBAAoB,GACrB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACL,yBAAyB,EACzB,eAAe,GAChB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,sBAAsB,EACtB,YAAY,GACb,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,sBAAsB,EACtB,YAAY,GACb,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,wBAAwB,EACxB,cAAc,GACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,GACnB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,yBAAyB,EACzB,eAAe,GAChB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,4BAA4B,EAC5B,wBAAwB,EACxB,YAAY,EACZ,eAAe,EACf,eAAe,EACf,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,cAAc,GACf,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,aAAa,GACd,MAAM,qBAAqB,CAAA"}
@@ -12,5 +12,5 @@ export { detectPanelsCapability, panelsDriver, } from './panels-driver.js';
12
12
  export { detectSettingsCapability, settingsDriver, } from './settings-driver.js';
13
13
  export { detectPresentationCapability, presentationDriver, } from './presentation-driver.js';
14
14
  export { detectDecisionsCapability, decisionsDriver, } from './decisions-driver.js';
15
- export { detectStatusCapability, detectShortcutsCapability, detectRenderersCapability, detectThemesCapability, detectToastCapability, detectCommandTreesCapability, statusDriver, shortcutsDriver, renderersDriver, themesDriver, toastDriver, commandTreesDriver, } from './extensions-driver.js';
15
+ export { detectStatusCapability, detectShortcutsCapability, detectRenderersCapability, detectThemesCapability, detectToastCapability, detectCommandTreesCapability, detectMentionsCapability, statusDriver, shortcutsDriver, renderersDriver, themesDriver, toastDriver, commandTreesDriver, mentionsDriver, } from './extensions-driver.js';
16
16
  export { detectChannelCapability, verifyChannelLive, channelDriver, } from './channel-driver.js';
@@ -1,4 +1,4 @@
1
- export type { TuiDecisionContext, TuiInputEvent, TuiInputDecision, TuiRewindPromptEvent, TuiRewindMode, TuiRewindPromptDecision, TuiRewindDoneEvent, TuiSessionSwitchEvent, TuiSessionSwitchDecision, TuiSessionSwitchedEvent, TuiCompactEvent, TuiCompactDecision, TuiDialogAnswer, TuiDialogBase, TuiDialogConfirmRequest, TuiDialogInputRequest, TuiDialogSelectOption, TuiDialogSelectRequest, TuiDialogSnapshot, TuiStatusEntry, TuiStatusFieldOptions, TuiStatusFieldSlot, TuiStatusFieldTone, TuiShortcutKey, TuiShortcutOptions, TuiEntryRenderer, TuiEntryRenderResult, TuiToastDelivery, TuiToastOptions, TuiToastSink, } from './extensions.js';
1
+ export type { TuiDecisionContext, TuiInputEvent, TuiInputDecision, TuiRewindPromptEvent, TuiRewindMode, TuiRewindPromptDecision, TuiRewindDoneEvent, TuiSessionSwitchEvent, TuiSessionSwitchDecision, TuiSessionSwitchedEvent, TuiCompactEvent, TuiCompactDecision, TuiDialogAnswer, TuiDialogBase, TuiDialogConfirmRequest, TuiDialogInputRequest, TuiDialogSelectOption, TuiDialogSelectRequest, TuiDialogSnapshot, TuiStatusEntry, TuiStatusFieldOptions, TuiStatusFieldSlot, TuiStatusFieldTone, TuiShortcutKey, TuiShortcutOptions, TuiEntryRenderer, TuiEntryRenderResult, TuiToastDelivery, TuiToastOptions, TuiToastSink, TuiMentionItem, TuiMentionProvider, } from './extensions.js';
2
2
  export type { HostContract, HostDescriptor, ContractCoordinate, ContractRef, NegotiationDecision, PermissionEntry, PermissionRegistry, TuiPluginStorage, PluginStorageErrorCode, TuiPluginStorageRuntime, MessagesObserveContentBlock, MessagesObserveEnvelope, MessagesObserveListener, MessagesObservePayload, TuiMessageObserverRuntime, LedgerEntry, LedgerOperation, LedgerResult, TuiEffectLedgerRuntime, CommandErrorCode, CodedCommandError, } from './plugin-host.js';
3
3
  export type { TuiSceneProps, TuiSceneDescriptor } from './scenes.js';
4
4
  export type { TuiPanelDescriptor, TuiPanelProps, TuiPanelCompactProps, TuiPanelMarkdownProps, TuiPanelCodeBlockProps, TuiPanelHostApi, TuiPanelSnapshot, TuiPanelKeyEvent, TuiPanelUi, TuiPanelEvent, TuiPanelSummary, } from './panels.js';
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAsCA,YAAY,EACV,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,YAAY,GACb,MAAM,iBAAiB,CAAA;AACxB,YAAY,EACV,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,WAAW,EACX,eAAe,EACf,YAAY,EACZ,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACpE,YAAY,EACV,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,eAAe,GAChB,MAAM,aAAa,CAAA;AAGpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AACnD,YAAY,EACV,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,wBAAwB,CAAA;AAC/B,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAChE,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,GACrB,MAAM,iBAAiB,CAAA"}
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAsCA,YAAY,EACV,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,kBAAkB,GACnB,MAAM,iBAAiB,CAAA;AACxB,YAAY,EACV,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,WAAW,EACX,eAAe,EACf,YAAY,EACZ,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACpE,YAAY,EACV,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,eAAe,GAChB,MAAM,aAAa,CAAA;AAGpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AACnD,YAAY,EACV,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,wBAAwB,CAAA;AAC/B,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAChE,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,GACrB,MAAM,iBAAiB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../../../src/backends/claude/backend.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,YAAY,EAA6C,MAAM,wBAAwB,CAAA;AAMrG,OAAO,EAA8B,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAA;AACnF,OAAO,EAAsC,KAAK,WAAW,EAAE,MAAM,YAAY,CAAA;AAEjF,OAAO,EAAmF,KAAK,oBAAoB,EAAuB,MAAM,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,YAAY,CAAA;AAEjF,OAAO,EAAmF,KAAK,oBAAoB,EAAuB,MAAM,eAAe,CAAA;AAE/J,OAAO,EAA0B,KAAK,YAAY,EAAiC,MAAM,aAAa,CAAA;AACtG,OAAO,EAAsC,KAAK,qBAAqB,EAAE,MAAM,UAAU,CAAA;AA4BzF;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC,EACpE,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAC7C,MAAM,EAAE,CAWV;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,CAYxG;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,IAAI,CAAC,qBAAqB,EAAE,gBAAgB,GAAG,oBAAoB,GAAG,eAAe,GAAG,qBAAqB,CAAC,EACnH,MAAM,EAAE;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,EAC7D,WAAW,EAAE,MAAM,EACnB,KAAK,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAsB,GACjD,OAAO,CAAC;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;CAAE,CAAC,CA2BlE;AAuDD,eAAO,MAAM,aAAa,EAAE,YAgM3B,CAAA"}
@@ -165,9 +165,10 @@ async function foundClaudeCli(host) {
165
165
  if (executable.path === undefined)
166
166
  return undefined;
167
167
  const version = await resolvedCliVersion(executable, host);
168
- return version === undefined
168
+ const hint = version === undefined
169
169
  ? claudeText('claude-sdk-missing-found-cli-path', { path: executable.path })
170
170
  : claudeText('claude-sdk-missing-found-cli', { version, path: executable.path });
171
+ return { hint, ...(version === undefined ? {} : { version }) };
171
172
  }
172
173
  catch (error) {
173
174
  host.debug(`claude: native CLI probe failed (${errorText(error)})`);
@@ -188,7 +189,11 @@ export const claudeBackend = {
188
189
  // A local CLI does not remove the SDK requirement.
189
190
  const missing = claudeText('claude-sdk-missing', { version: VALIDATED_SDK_VERSION });
190
191
  const found = await foundClaudeCli(host);
191
- return { installed: false, hint: found === undefined ? missing : `${missing}\n${found}` };
192
+ return {
193
+ installed: false,
194
+ hint: found === undefined ? missing : `${missing}\n${found.hint}`,
195
+ ...(found?.version === undefined ? {} : { version: found.version }),
196
+ };
192
197
  }
193
198
  let auth = 'unknown';
194
199
  try {
@@ -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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ACrC,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,
@@ -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,CAAA;AAgLjF;gFACgF;AAChF,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACzC,gBAAgB,EAAE,CAWpB;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,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) => {
@@ -50,7 +50,7 @@ export interface ChildStderrReporterOptions {
50
50
  export interface ChildStderrReporter {
51
51
  /** Feed one raw stderr line. */
52
52
  push(line: string): void;
53
- /** Cancel pending debounce timers (teardown). */
53
+ /** Stop accepting lines and cancel pending debounce timers (teardown). */
54
54
  dispose(): void;
55
55
  }
56
56
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"childStderr.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/childStderr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAgEH;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AI,CAAA;CAChG;AAED,MAAM,WAAW,0BAA0B;IACzC,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,8EAA8E;IAC9E,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,gCAAgC;IAChC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,0EAA0E;IAC1E,OAAO,IAAI,IAAI,CAAA;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,iBAAiB,EACzB,OAAO,GAAE,0BAA+B,GACvC,mBAAmB,CAyDrB"}
@@ -132,8 +132,11 @@ export function createChildStderrReporter(notify, options = {}) {
132
132
  const maxLineLength = options.maxLineLength ?? 200;
133
133
  const groups = new Map();
134
134
  const mutedUntil = new Map();
135
+ let disposed = false;
135
136
  return {
136
137
  push(raw) {
138
+ if (disposed)
139
+ return;
137
140
  const cleaned = raw.replace(ANSI_PATTERN, '').trim();
138
141
  if (cleaned.length === 0)
139
142
  return;
@@ -172,9 +175,11 @@ export function createChildStderrReporter(notify, options = {}) {
172
175
  }
173
176
  },
174
177
  dispose() {
178
+ disposed = true;
175
179
  for (const group of groups.values())
176
180
  clearTimeout(group.timer);
177
181
  groups.clear();
182
+ mutedUntil.clear();
178
183
  },
179
184
  };
180
185
  }