@tutti-os/agent-gui 0.0.14 → 0.0.16

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 (69) hide show
  1. package/dist/AgentMentionSearchController-DqssJ2-b.d.ts +218 -0
  2. package/dist/agent-conversation/index.d.ts +4 -2
  3. package/dist/agent-conversation/index.js +5 -4
  4. package/dist/agent-conversation/index.js.map +1 -1
  5. package/dist/agent-message-center/index.d.ts +3 -2
  6. package/dist/agent-message-center/index.js +547 -287
  7. package/dist/agent-message-center/index.js.map +1 -1
  8. package/dist/app/renderer/agentactivity.css +177 -17
  9. package/dist/{chunk-GZHQPPK2.js → chunk-267VY3EJ.js} +130 -43
  10. package/dist/chunk-267VY3EJ.js.map +1 -0
  11. package/dist/{chunk-KEKPOVQD.js → chunk-CABHBFYH.js} +2 -2
  12. package/dist/{chunk-HSXDSFKB.js → chunk-EKATXC3W.js} +2 -2
  13. package/dist/{chunk-RLPVFX7V.js → chunk-FJYH2ZPX.js} +196 -322
  14. package/dist/chunk-FJYH2ZPX.js.map +1 -0
  15. package/dist/{chunk-ASAZDEQE.js → chunk-GWR6WGZY.js} +72 -22
  16. package/dist/chunk-GWR6WGZY.js.map +1 -0
  17. package/dist/{chunk-YXSO4ITT.js → chunk-HIREVEZM.js} +1 -1
  18. package/dist/chunk-HIREVEZM.js.map +1 -0
  19. package/dist/{chunk-VDNMTW2E.js → chunk-IXIGWLQY.js} +1 -1
  20. package/dist/chunk-IXIGWLQY.js.map +1 -0
  21. package/dist/{chunk-ZO3SZCIX.js → chunk-JNGYJ7GM.js} +6 -3
  22. package/dist/chunk-JNGYJ7GM.js.map +1 -0
  23. package/dist/{chunk-MU2LODEV.js → chunk-KWPL3JYS.js} +131 -13
  24. package/dist/chunk-KWPL3JYS.js.map +1 -0
  25. package/dist/{chunk-WME2V26J.js → chunk-LW2S255I.js} +21 -36
  26. package/dist/chunk-LW2S255I.js.map +1 -0
  27. package/dist/{chunk-3YZX5EUC.js → chunk-LWRYYGPZ.js} +610 -480
  28. package/dist/chunk-LWRYYGPZ.js.map +1 -0
  29. package/dist/{chunk-GEXHKJK5.js → chunk-MUZMBEFO.js} +35 -17
  30. package/dist/chunk-MUZMBEFO.js.map +1 -0
  31. package/dist/chunk-O5TUTXHT.js +196 -0
  32. package/dist/chunk-O5TUTXHT.js.map +1 -0
  33. package/dist/{chunk-FSTZDNRM.js → chunk-SIDWRR5I.js} +281 -183
  34. package/dist/chunk-SIDWRR5I.js.map +1 -0
  35. package/dist/context-mention-palette/index.d.ts +11 -170
  36. package/dist/context-mention-palette/index.js +7 -6
  37. package/dist/context-mention-provider.d.ts +6 -1
  38. package/dist/context-mention-provider.js +1 -1
  39. package/dist/i18n/index.d.ts +277 -179
  40. package/dist/i18n/index.js +1 -1
  41. package/dist/index.d.ts +56 -3
  42. package/dist/index.js +2706 -1700
  43. package/dist/index.js.map +1 -1
  44. package/dist/workbench/contribution.d.ts +7 -1
  45. package/dist/workbench/contribution.js +6 -4
  46. package/dist/workbench/index.d.ts +5 -2
  47. package/dist/workbench/index.js +6 -4
  48. package/dist/workbench/launch.d.ts +2 -0
  49. package/dist/workbench/launch.js +2 -2
  50. package/dist/workbench/state.d.ts +3 -2
  51. package/dist/workbench/state.js +1 -1
  52. package/dist/workbench/types.d.ts +3 -0
  53. package/dist/workbench/types.js +1 -1
  54. package/dist/workspace-agent-generated-files.js +2 -2
  55. package/dist/{workspaceLinkActions-BlLN8Pvz.d.ts → workspaceLinkActions-Mjktl_Be.d.ts} +3 -0
  56. package/package.json +15 -13
  57. package/dist/chunk-3YZX5EUC.js.map +0 -1
  58. package/dist/chunk-ASAZDEQE.js.map +0 -1
  59. package/dist/chunk-FSTZDNRM.js.map +0 -1
  60. package/dist/chunk-GEXHKJK5.js.map +0 -1
  61. package/dist/chunk-GZHQPPK2.js.map +0 -1
  62. package/dist/chunk-MU2LODEV.js.map +0 -1
  63. package/dist/chunk-RLPVFX7V.js.map +0 -1
  64. package/dist/chunk-VDNMTW2E.js.map +0 -1
  65. package/dist/chunk-WME2V26J.js.map +0 -1
  66. package/dist/chunk-YXSO4ITT.js.map +0 -1
  67. package/dist/chunk-ZO3SZCIX.js.map +0 -1
  68. /package/dist/{chunk-KEKPOVQD.js.map → chunk-CABHBFYH.js.map} +0 -0
  69. /package/dist/{chunk-HSXDSFKB.js.map → chunk-EKATXC3W.js.map} +0 -0
@@ -2629,6 +2629,16 @@ aside.workspace-agents-status-panel
2629
2629
  white-space: nowrap;
2630
2630
  }
2631
2631
 
2632
+ .agent-gui-chrome__goal-hint {
2633
+ flex: 0 0 auto;
2634
+ white-space: nowrap;
2635
+ font-size: 11px;
2636
+ font-weight: 400;
2637
+ line-height: 16px;
2638
+ color: var(--agent-gui-text-tertiary, var(--text-tertiary));
2639
+ opacity: 0.8;
2640
+ }
2641
+
2632
2642
  .agent-gui-chrome__message-slot {
2633
2643
  display: flex;
2634
2644
  min-width: 0;
@@ -2826,6 +2836,7 @@ aside.workspace-agents-status-panel
2826
2836
  text-align: left;
2827
2837
  transition:
2828
2838
  background-color 150ms ease,
2839
+ box-shadow 150ms ease,
2829
2840
  color 150ms ease;
2830
2841
  }
2831
2842
 
@@ -2834,6 +2845,11 @@ aside.workspace-agents-status-panel
2834
2845
  background: var(--transparency-hover);
2835
2846
  }
2836
2847
 
2848
+ .agent-gui-conversation__interactive-option-button[data-active="true"] {
2849
+ box-shadow: inset 0 0 0 1px
2850
+ color-mix(in srgb, var(--text-primary) 24%, transparent);
2851
+ }
2852
+
2837
2853
  .agent-gui-conversation__interactive-option-display {
2838
2854
  position: relative;
2839
2855
  display: grid;
@@ -3067,6 +3083,13 @@ aside.workspace-agents-status-panel
3067
3083
  padding: 6px 12px;
3068
3084
  }
3069
3085
 
3086
+ .agent-gui-conversation__interactive-prompt-actions button:disabled {
3087
+ cursor: not-allowed;
3088
+ background: var(--transparency-block);
3089
+ color: var(--text-disabled);
3090
+ opacity: 0.58;
3091
+ }
3092
+
3070
3093
  .agent-gui-conversation__user-message-flow,
3071
3094
  .agent-gui-conversation__assistant-message-flow {
3072
3095
  display: grid;
@@ -3090,20 +3113,25 @@ aside.workspace-agents-status-panel
3090
3113
  top: 100%;
3091
3114
  right: 0;
3092
3115
  left: 0;
3093
- height: 10px;
3116
+ height: 26px;
3094
3117
  content: "";
3095
3118
  }
3096
3119
 
3097
3120
  .agent-gui-conversation__message-group:has(
3098
3121
  > .agent-gui-conversation__message-copy-button
3099
3122
  ) {
3100
- margin-bottom: 36px;
3123
+ margin-bottom: 26px;
3101
3124
  }
3102
3125
 
3103
3126
  .agent-gui-conversation__message-copy-button {
3104
3127
  position: absolute;
3105
- top: calc(100% + 8px);
3128
+ top: calc(100% + 4px);
3106
3129
  z-index: 1;
3130
+ width: 22px;
3131
+ min-width: 22px;
3132
+ height: 22px;
3133
+ min-height: 22px;
3134
+ border-radius: 5px;
3107
3135
  opacity: 0;
3108
3136
  pointer-events: none;
3109
3137
  transform: translateY(-2px);
@@ -3374,7 +3402,8 @@ aside.workspace-agents-status-panel
3374
3402
 
3375
3403
  .tsh-agent-object-token {
3376
3404
  min-width: 0;
3377
- max-width: 100%;
3405
+ /* 超出最大展示宽度时截断为省略号(标签 __main 已有 ellipsis);hover 经原生 title 看完整文本。 */
3406
+ max-width: min(100%, var(--agent-mention-max-width, 16rem));
3378
3407
  text-decoration: none;
3379
3408
  }
3380
3409
 
@@ -3582,6 +3611,38 @@ aside.workspace-agents-status-panel
3582
3611
  color: var(--tutti-purple);
3583
3612
  }
3584
3613
 
3614
+ [data-agent-mention-kind="skill"].tsh-agent-object-token--entity,
3615
+ [data-agent-mention-kind="capability"].tsh-agent-object-token--entity {
3616
+ top: -1px;
3617
+ gap: 0;
3618
+ padding: 0 4px 0 0;
3619
+ background: transparent;
3620
+ color: var(--tutti-purple);
3621
+ }
3622
+
3623
+ [data-agent-mention-kind="skill"].tsh-agent-object-token--entity
3624
+ .tsh-agent-object-token__main,
3625
+ [data-agent-mention-kind="capability"].tsh-agent-object-token--entity
3626
+ .tsh-agent-object-token__main {
3627
+ padding: 0 6px;
3628
+ border-radius: 6px;
3629
+ background: var(--tutti-purple-bg);
3630
+ }
3631
+
3632
+ [data-agent-mention-kind="skill"].tsh-agent-object-token--entity.ProseMirror-selectednode
3633
+ .tsh-agent-object-token__main,
3634
+ [data-agent-mention-kind="capability"].tsh-agent-object-token--entity.ProseMirror-selectednode
3635
+ .tsh-agent-object-token__main {
3636
+ background: color-mix(in srgb, var(--tutti-purple) 20%, transparent);
3637
+ }
3638
+
3639
+ [data-agent-mention-kind="skill"].tsh-agent-object-token--entity
3640
+ .tsh-agent-object-token__kind,
3641
+ [data-agent-mention-kind="capability"].tsh-agent-object-token--entity
3642
+ .tsh-agent-object-token__kind {
3643
+ display: none;
3644
+ }
3645
+
3585
3646
  [data-agent-mention-kind="workspace-app"]
3586
3647
  [data-agent-mention-app-icon="true"]
3587
3648
  .tsh-agent-object-token__kind-icon {
@@ -3604,6 +3665,7 @@ aside.workspace-agents-status-panel
3604
3665
  color: inherit;
3605
3666
  }
3606
3667
 
3668
+ .agent-gui-node__composer-textarea [data-slot="mention-pill"],
3607
3669
  .agent-gui-node__composer-textarea
3608
3670
  [data-agent-file-mention="true"].tsh-agent-object-token {
3609
3671
  cursor: pointer;
@@ -4335,6 +4397,46 @@ button.agent-gui-node__conversation-section-toggle:hover
4335
4397
  pointer-events: auto;
4336
4398
  }
4337
4399
 
4400
+ .agent-gui-node__conversation-section-action-tooltip-wrap {
4401
+ position: relative;
4402
+ display: inline-flex;
4403
+ flex: none;
4404
+ }
4405
+
4406
+ .agent-gui-node__conversation-section-action-tooltip {
4407
+ position: absolute;
4408
+ top: calc(100% + 6px);
4409
+ left: 50%;
4410
+ z-index: var(--z-tooltip);
4411
+ max-width: 180px;
4412
+ padding: 5px 8px;
4413
+ border: 1px solid var(--line-2, var(--tutti-line-2));
4414
+ border-radius: 6px;
4415
+ background: var(--background-fronted);
4416
+ box-shadow: 0 10px 26px rgb(0 0 0 / 0.18);
4417
+ color: var(--text-primary);
4418
+ font-size: 11px;
4419
+ font-weight: 500;
4420
+ line-height: 1.2;
4421
+ opacity: 0;
4422
+ overflow: hidden;
4423
+ pointer-events: none;
4424
+ text-overflow: ellipsis;
4425
+ transform: translate(-50%, -2px);
4426
+ transition:
4427
+ opacity 120ms ease,
4428
+ transform 120ms ease;
4429
+ white-space: nowrap;
4430
+ }
4431
+
4432
+ .agent-gui-node__conversation-section-action-tooltip-wrap:hover
4433
+ .agent-gui-node__conversation-section-action-tooltip,
4434
+ .agent-gui-node__conversation-section-action-tooltip-wrap:focus-within
4435
+ .agent-gui-node__conversation-section-action-tooltip {
4436
+ opacity: 1;
4437
+ transform: translate(-50%, 0);
4438
+ }
4439
+
4338
4440
  .agent-gui-node__conversation-section-more-button {
4339
4441
  flex: none;
4340
4442
  opacity: 0;
@@ -4597,7 +4699,7 @@ button.agent-gui-node__conversation-section-toggle:hover
4597
4699
 
4598
4700
  .agent-gui-node__conversation-item:hover .agent-gui-node__conversation-select {
4599
4701
  grid-template-columns: minmax(0, 1fr) 0;
4600
- padding-right: 72px;
4702
+ padding-right: 96px;
4601
4703
  }
4602
4704
 
4603
4705
  .agent-gui-node__conversation-item[data-pending-delete="true"]
@@ -4639,7 +4741,7 @@ button.agent-gui-node__conversation-section-toggle:hover
4639
4741
  justify-content: flex-start;
4640
4742
  gap: 0;
4641
4743
  box-sizing: border-box;
4642
- min-width: 48px;
4744
+ min-width: 72px;
4643
4745
  max-width: calc(100% - 20px);
4644
4746
  opacity: 0;
4645
4747
  transform: translateY(-50%);
@@ -4647,6 +4749,7 @@ button.agent-gui-node__conversation-section-toggle:hover
4647
4749
  }
4648
4750
 
4649
4751
  .agent-gui-node__conversation-delete-button,
4752
+ .agent-gui-node__conversation-open-window-button,
4650
4753
  .agent-gui-node__conversation-pin-button {
4651
4754
  background: transparent;
4652
4755
  background-color: transparent;
@@ -4654,6 +4757,7 @@ button.agent-gui-node__conversation-section-toggle:hover
4654
4757
  }
4655
4758
 
4656
4759
  .agent-gui-node__conversation-pin-button svg,
4760
+ .agent-gui-node__conversation-open-window-button svg,
4657
4761
  .agent-gui-node__conversation-delete-button svg {
4658
4762
  width: 14px;
4659
4763
  height: 14px;
@@ -4707,6 +4811,35 @@ button.agent-gui-node__conversation-section-toggle:hover
4707
4811
  opacity: 0;
4708
4812
  }
4709
4813
 
4814
+ .agent-gui-node__conversation-actions
4815
+ > button.agent-gui-node__conversation-open-window-button:not(:disabled):hover,
4816
+ .agent-gui-node__conversation-actions
4817
+ > button.agent-gui-node__conversation-open-window-button:not(
4818
+ :disabled
4819
+ ):focus-visible,
4820
+ .agent-gui-node__conversation-actions
4821
+ > button.agent-gui-node__conversation-open-window-button:not(
4822
+ :disabled
4823
+ ):active {
4824
+ background: transparent;
4825
+ background-color: transparent;
4826
+ color: var(--text-primary);
4827
+ }
4828
+
4829
+ .agent-gui-node__conversation-actions
4830
+ > button.agent-gui-node__conversation-open-window-button:not(:disabled):hover
4831
+ svg,
4832
+ .agent-gui-node__conversation-actions
4833
+ > button.agent-gui-node__conversation-open-window-button:not(
4834
+ :disabled
4835
+ ):focus-visible
4836
+ svg,
4837
+ .agent-gui-node__conversation-actions
4838
+ > button.agent-gui-node__conversation-open-window-button:not(:disabled):active
4839
+ svg {
4840
+ color: var(--text-primary);
4841
+ }
4842
+
4710
4843
  .agent-gui-node__conversation-actions
4711
4844
  > button.agent-gui-node__conversation-pin-button:not(:disabled):hover,
4712
4845
  .agent-gui-node__conversation-actions
@@ -4760,6 +4893,7 @@ button.agent-gui-node__conversation-section-toggle:hover
4760
4893
  }
4761
4894
 
4762
4895
  .agent-gui-node__conversation-delete-button:disabled,
4896
+ .agent-gui-node__conversation-open-window-button:disabled,
4763
4897
  .agent-gui-node__conversation-pin-button:disabled {
4764
4898
  cursor: not-allowed;
4765
4899
  opacity: 0.4;
@@ -4772,7 +4906,7 @@ button.agent-gui-node__conversation-section-toggle:hover
4772
4906
  color: var(--text-primary);
4773
4907
  font-size: 13px;
4774
4908
  line-height: 18px;
4775
- font-weight: 500;
4909
+ font-weight: 400;
4776
4910
  text-overflow: ellipsis;
4777
4911
  white-space: nowrap;
4778
4912
  }
@@ -5179,7 +5313,7 @@ button.agent-gui-node__conversation-section-toggle:hover
5179
5313
  box-sizing: border-box;
5180
5314
  height: 64px;
5181
5315
  min-height: 64px;
5182
- padding: 0 32px;
5316
+ padding: 0 var(--agent-gui-detail-padding-x);
5183
5317
  }
5184
5318
 
5185
5319
  .agent-gui-node__detail-header-title-group {
@@ -5235,14 +5369,6 @@ button.agent-gui-node__conversation-section-toggle:hover
5235
5369
  outline: none;
5236
5370
  }
5237
5371
 
5238
- .agent-gui-node__detail-header-status {
5239
- color: var(--text-secondary);
5240
- font-size: 13px;
5241
- font-weight: 600;
5242
- line-height: 18px;
5243
- text-transform: capitalize;
5244
- }
5245
-
5246
5372
  .agent-gui-node__usage-alert-banner {
5247
5373
  display: flex;
5248
5374
  align-items: center;
@@ -5295,6 +5421,40 @@ button.agent-gui-node__conversation-section-toggle:hover
5295
5421
  color: inherit;
5296
5422
  }
5297
5423
 
5424
+ .agent-gui-node__provider-setup-notice {
5425
+ display: flex;
5426
+ align-items: center;
5427
+ gap: 8px;
5428
+ box-sizing: border-box;
5429
+ margin: 16px var(--agent-gui-detail-padding-x) 8px;
5430
+ border: 1px solid
5431
+ color-mix(
5432
+ in srgb,
5433
+ var(--agent-gui-warning, var(--state-warning)) 26%,
5434
+ transparent
5435
+ );
5436
+ border-radius: 8px;
5437
+ padding: 8px 10px;
5438
+ color: var(--agent-gui-warning, var(--state-warning));
5439
+ background: color-mix(
5440
+ in srgb,
5441
+ var(--agent-gui-warning, var(--state-warning)) 9%,
5442
+ transparent
5443
+ );
5444
+ font-size: 13px;
5445
+ line-height: 18px;
5446
+ }
5447
+
5448
+ .agent-gui-node__provider-setup-notice-icon {
5449
+ flex: 0 0 auto;
5450
+ color: currentColor;
5451
+ }
5452
+
5453
+ .agent-gui-node__provider-setup-notice-text {
5454
+ min-width: 0;
5455
+ overflow-wrap: anywhere;
5456
+ }
5457
+
5298
5458
  .agent-gui-node__layout [data-slot="status-dot"],
5299
5459
  [data-testid="workspace-agent-message-center"] [data-slot="status-dot"] {
5300
5460
  --agent-gui-status-dot-color: var(
@@ -6484,7 +6644,7 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
6484
6644
  border: 0;
6485
6645
  border-radius: 6px;
6486
6646
  background: transparent;
6487
- padding: 0 2px;
6647
+ padding: 0 8px;
6488
6648
  color: var(--agent-gui-text-secondary);
6489
6649
  font-size: 13px;
6490
6650
  font-weight: 400;
@@ -6,28 +6,31 @@ import {
6
6
  ZoomableImage,
7
7
  cn,
8
8
  extractAgentMcpToolTarget,
9
- getOptionalAgentActivityRuntime,
10
9
  normalizeAskUserQuestions,
11
10
  resolveWorkspaceFileLinkAction,
12
11
  resolveWorkspaceFilePathCandidate,
13
- resolveWorkspaceLinkAction,
14
- useOptionalAgentHostApi
15
- } from "./chunk-RLPVFX7V.js";
12
+ resolveWorkspaceLinkAction
13
+ } from "./chunk-FJYH2ZPX.js";
16
14
  import {
17
15
  attrsToMentionItem,
18
16
  createAgentFileMentionExtension,
19
17
  formatAgentMentionMarkdown,
18
+ mentionItemToAttrs,
20
19
  parseAgentMentionMarkdown
21
- } from "./chunk-MU2LODEV.js";
20
+ } from "./chunk-KWPL3JYS.js";
22
21
  import {
23
22
  isWorkspaceAgentSyntheticControlMessage
24
23
  } from "./chunk-XJ34OIEQ.js";
24
+ import {
25
+ getOptionalAgentActivityRuntime,
26
+ useOptionalAgentHostApi
27
+ } from "./chunk-O5TUTXHT.js";
25
28
  import {
26
29
  workspaceAgentProviderLabel
27
30
  } from "./chunk-TYGL25EL.js";
28
31
  import {
29
32
  translate
30
- } from "./chunk-FSTZDNRM.js";
33
+ } from "./chunk-SIDWRR5I.js";
31
34
 
32
35
  // shared/imageGenerationTool.ts
33
36
  var KNOWN_IMAGE_GENERATION_TOOL_NAMES = /* @__PURE__ */ new Set([
@@ -2890,7 +2893,8 @@ function computeAgentToolGroups(sequence, {
2890
2893
  }) {
2891
2894
  const groups = /* @__PURE__ */ new Map();
2892
2895
  const groupedIndices = /* @__PURE__ */ new Set();
2893
- const suppressedIndices = allowTrailingFinalization ? /* @__PURE__ */ new Set() : findActiveTailSuppressedToolIndices(sequence);
2896
+ const suppressedIndices = /* @__PURE__ */ new Set();
2897
+ const splitFromIndex = allowTrailingFinalization ? -1 : findActiveTailRunStartIndex(sequence);
2894
2898
  let currentCalls = [];
2895
2899
  let currentEntries = [];
2896
2900
  let currentIndices = [];
@@ -2920,7 +2924,8 @@ function computeAgentToolGroups(sequence, {
2920
2924
  if (!item) {
2921
2925
  continue;
2922
2926
  }
2923
- if (suppressedIndices.has(index)) {
2927
+ if (splitFromIndex >= 0 && index >= splitFromIndex) {
2928
+ finalizeGroup();
2924
2929
  continue;
2925
2930
  }
2926
2931
  if (item.kind === "tool-call" && isGroupableToolCall2(item.call)) {
@@ -3040,27 +3045,22 @@ function isGroupableToolCall2(call) {
3040
3045
  return true;
3041
3046
  }
3042
3047
  }
3043
- function findActiveTailSuppressedToolIndices(sequence) {
3044
- const suppressedIndices = /* @__PURE__ */ new Set();
3045
- let latestTailToolIndex = -1;
3048
+ function findActiveTailRunStartIndex(sequence) {
3049
+ let tailIndex = -1;
3046
3050
  for (let index = sequence.length - 1; index >= 0; index -= 1) {
3047
3051
  const item = sequence[index];
3048
3052
  if (!item) {
3049
3053
  continue;
3050
3054
  }
3051
- if (item.kind !== "tool-call") {
3052
- break;
3053
- }
3054
- latestTailToolIndex = Math.max(latestTailToolIndex, index);
3055
- }
3056
- if (latestTailToolIndex < 0) {
3057
- return suppressedIndices;
3055
+ tailIndex = index;
3056
+ break;
3058
3057
  }
3059
- const latestTailTool = sequence[latestTailToolIndex];
3060
- if (latestTailTool?.kind !== "tool-call" || !isSuppressingActiveTailTool(latestTailTool.call)) {
3061
- return suppressedIndices;
3058
+ const tailItem = tailIndex >= 0 ? sequence[tailIndex] : void 0;
3059
+ if (tailItem?.kind !== "tool-call" || !isActiveTailTool(tailItem.call)) {
3060
+ return -1;
3062
3061
  }
3063
- for (let index = latestTailToolIndex - 1; index >= 0; index -= 1) {
3062
+ let startIndex = tailIndex;
3063
+ for (let index = tailIndex - 1; index >= 0; index -= 1) {
3064
3064
  const item = sequence[index];
3065
3065
  if (!item) {
3066
3066
  continue;
@@ -3068,11 +3068,11 @@ function findActiveTailSuppressedToolIndices(sequence) {
3068
3068
  if (item.kind !== "tool-call") {
3069
3069
  break;
3070
3070
  }
3071
- suppressedIndices.add(index);
3071
+ startIndex = index;
3072
3072
  }
3073
- return suppressedIndices;
3073
+ return startIndex;
3074
3074
  }
3075
- function isSuppressingActiveTailTool(call) {
3075
+ function isActiveTailTool(call) {
3076
3076
  if (call.statusKind !== "working" && call.statusKind !== "waiting") {
3077
3077
  return false;
3078
3078
  }
@@ -4874,7 +4874,7 @@ function createAgentSkillTokenExtension(options = {}) {
4874
4874
  group: "inline",
4875
4875
  inline: true,
4876
4876
  atom: true,
4877
- selectable: false,
4877
+ selectable: true,
4878
4878
  addOptions() {
4879
4879
  return options;
4880
4880
  },
@@ -4890,6 +4890,7 @@ function createAgentSkillTokenExtension(options = {}) {
4890
4890
  },
4891
4891
  renderHTML({ HTMLAttributes }) {
4892
4892
  const attrs = attrsToSkillTokenAttrs(HTMLAttributes);
4893
+ const displayLabel = skillTokenDisplayLabel(attrs);
4893
4894
  return [
4894
4895
  "span",
4895
4896
  mergeAttributes(HTMLAttributes, {
@@ -4915,7 +4916,7 @@ function createAgentSkillTokenExtension(options = {}) {
4915
4916
  ""
4916
4917
  ]
4917
4918
  ],
4918
- ["span", { class: "tsh-agent-object-token__main" }, attrs.label]
4919
+ ["span", { class: "tsh-agent-object-token__main" }, displayLabel]
4919
4920
  ];
4920
4921
  },
4921
4922
  renderText({ node }) {
@@ -4971,6 +4972,13 @@ function attrsToSkillTokenAttrs(attrs) {
4971
4972
  trigger: typeof attrs.trigger === "string" ? attrs.trigger : ""
4972
4973
  };
4973
4974
  }
4975
+ function skillTokenDisplayLabel(attrs) {
4976
+ const label = attrs.label.trim() || attrs.trigger.trim();
4977
+ if (!label || label.startsWith("/") || label.startsWith("$")) {
4978
+ return label;
4979
+ }
4980
+ return `/${label}`;
4981
+ }
4974
4982
 
4975
4983
  // agent-gui/agentGuiNode/agentRichText/agentCapabilityTokenExtension.ts
4976
4984
  import { mergeAttributes as mergeAttributes2, Node as Node2 } from "@tiptap/core";
@@ -4980,7 +4988,7 @@ function createAgentCapabilityTokenExtension(options = {}) {
4980
4988
  group: "inline",
4981
4989
  inline: true,
4982
4990
  atom: true,
4983
- selectable: false,
4991
+ selectable: true,
4984
4992
  addOptions() {
4985
4993
  return options;
4986
4994
  },
@@ -4997,6 +5005,7 @@ function createAgentCapabilityTokenExtension(options = {}) {
4997
5005
  },
4998
5006
  renderHTML({ HTMLAttributes }) {
4999
5007
  const attrs = attrsToCapabilityTokenAttrs(HTMLAttributes);
5008
+ const displayLabel = capabilityTokenDisplayLabel(attrs);
5000
5009
  return [
5001
5010
  "span",
5002
5011
  mergeAttributes2(HTMLAttributes, {
@@ -5022,7 +5031,7 @@ function createAgentCapabilityTokenExtension(options = {}) {
5022
5031
  ""
5023
5032
  ]
5024
5033
  ],
5025
- ["span", { class: "tsh-agent-object-token__main" }, attrs.label]
5034
+ ["span", { class: "tsh-agent-object-token__main" }, displayLabel]
5026
5035
  ];
5027
5036
  },
5028
5037
  renderText({ node }) {
@@ -5078,6 +5087,13 @@ function attrsToCapabilityTokenAttrs(attrs) {
5078
5087
  trigger: typeof attrs.trigger === "string" ? attrs.trigger : ""
5079
5088
  };
5080
5089
  }
5090
+ function capabilityTokenDisplayLabel(attrs) {
5091
+ const label = attrs.label.trim() || attrs.trigger.trim();
5092
+ if (!label || label.startsWith("/") || label.startsWith("$")) {
5093
+ return label;
5094
+ }
5095
+ return `/${label}`;
5096
+ }
5081
5097
 
5082
5098
  // agent-gui/agentGuiNode/agentRichText/agentRichTextDocument.ts
5083
5099
  function createEmptyDocument() {
@@ -5110,7 +5126,9 @@ function createParagraphFromText(text, options = {}) {
5110
5126
  flushTextBuffer();
5111
5127
  content.push({
5112
5128
  type: "agentFileMention",
5113
- attrs: parsedMention.item
5129
+ // 转成规范 node attrs(如 workspace-reference 的 source/groupId/fileCount),
5130
+ // 否则只读回显里的 reference chip 拿不到文件数 → 不显示「N 个文件」角标。
5131
+ attrs: mentionItemToAttrs(parsedMention.item)
5114
5132
  });
5115
5133
  index = parsedMention.end;
5116
5134
  continue;
@@ -5170,7 +5188,7 @@ function agentRichTextDocToPromptText(doc) {
5170
5188
  if (blocks.length === 0) {
5171
5189
  return "";
5172
5190
  }
5173
- return blocks.map(nodeToPromptText).join("\n");
5191
+ return blocks.map((block) => nodeToPromptText(block)).join("\n");
5174
5192
  }
5175
5193
  function editorToPromptText(editor) {
5176
5194
  return agentRichTextDocToPromptText(editor.getJSON());
@@ -5194,10 +5212,13 @@ function nodeToPromptText(node) {
5194
5212
  if (!node.content || node.content.length === 0) {
5195
5213
  return "";
5196
5214
  }
5197
- return node.content.map(nodeToPromptText).join("");
5215
+ return node.content.map((child) => nodeToPromptText(child)).join("");
5198
5216
  }
5199
5217
 
5200
5218
  // agent-gui/agentGuiNode/agentRichText/agentRichTextExtensions.ts
5219
+ import { Extension } from "@tiptap/core";
5220
+ import { NodeSelection, TextSelection } from "@tiptap/pm/state";
5221
+ import { Plugin } from "@tiptap/pm/state";
5201
5222
  import StarterKit from "@tiptap/starter-kit";
5202
5223
  function createAgentPromptStarterKit() {
5203
5224
  return StarterKit.configure({
@@ -5220,8 +5241,63 @@ function createAgentPromptStarterKit() {
5220
5241
  underline: false
5221
5242
  });
5222
5243
  }
5244
+ function createAgentTokenKeyboardExtension() {
5245
+ return Extension.create({
5246
+ name: "agentTokenKeyboard",
5247
+ addProseMirrorPlugins() {
5248
+ return [
5249
+ new Plugin({
5250
+ props: {
5251
+ handleKeyDown(view, event) {
5252
+ if (event.key !== "Backspace" && event.key !== "ArrowLeft") {
5253
+ return false;
5254
+ }
5255
+ const { doc, selection } = view.state;
5256
+ if (selection instanceof NodeSelection && isSelectableAgentToken(selection.node)) {
5257
+ event.preventDefault();
5258
+ if (event.key === "ArrowLeft") {
5259
+ view.dispatch(
5260
+ view.state.tr.setSelection(
5261
+ TextSelection.create(doc, selection.from)
5262
+ )
5263
+ );
5264
+ } else {
5265
+ view.dispatch(
5266
+ view.state.tr.delete(selection.from, selection.to)
5267
+ );
5268
+ }
5269
+ return true;
5270
+ }
5271
+ if (!selection.empty) {
5272
+ return false;
5273
+ }
5274
+ const nodeBefore = selection.$from.nodeBefore;
5275
+ if (!nodeBefore || !isSelectableAgentToken(nodeBefore)) {
5276
+ return false;
5277
+ }
5278
+ event.preventDefault();
5279
+ view.dispatch(
5280
+ view.state.tr.setSelection(
5281
+ NodeSelection.create(
5282
+ doc,
5283
+ selection.from - nodeBefore.nodeSize
5284
+ )
5285
+ )
5286
+ );
5287
+ return true;
5288
+ }
5289
+ }
5290
+ })
5291
+ ];
5292
+ }
5293
+ });
5294
+ }
5295
+ function isSelectableAgentToken(node) {
5296
+ return node?.type.name === "agentSkillToken" || node?.type.name === "agentCapabilityToken";
5297
+ }
5223
5298
  function createAgentRichTextInputExtensions(fileMentionOptions, skillTokenOptions, capabilityTokenOptions) {
5224
5299
  return [
5300
+ createAgentTokenKeyboardExtension(),
5225
5301
  createAgentPromptStarterKit(),
5226
5302
  createAgentFileMentionExtension(fileMentionOptions),
5227
5303
  createAgentCapabilityTokenExtension(capabilityTokenOptions),
@@ -7944,9 +8020,8 @@ function getSearchRenderData(call) {
7944
8020
  stringValue8(call.error?.aggregated_output),
7945
8021
  stringValue8(call.error?.stdout),
7946
8022
  stringValue8(call.error?.formatted_output),
7947
- stringValue8(call.error?.message),
7948
- ""
7949
- )
8023
+ stringValue8(call.error?.message)
8024
+ ) ?? ""
7950
8025
  };
7951
8026
  }
7952
8027
  function getWebSearchRenderData(call) {
@@ -7971,13 +8046,12 @@ function getWebSearchRenderData(call) {
7971
8046
  stringValue8(call.output?.stdout),
7972
8047
  stringValue8(call.output?.output),
7973
8048
  stringValue8(call.output?.content),
7974
- ""
7975
- ),
8049
+ contentText(call.output?.content)
8050
+ ) ?? "",
7976
8051
  error: firstString4(
7977
8052
  stringValue8(call.error?.message),
7978
- stringValue8(call.error?.stdout),
7979
- ""
7980
- )
8053
+ stringValue8(call.error?.stdout)
8054
+ ) ?? ""
7981
8055
  };
7982
8056
  }
7983
8057
  function getWebFetchRenderData(call, maxContentLength = 3e3) {
@@ -9483,8 +9557,9 @@ function hasAgentToolContent(call) {
9483
9557
  return hasEditContent(call);
9484
9558
  case "bash":
9485
9559
  case "search":
9486
- case "web-search":
9487
9560
  return hasGenericStructuredContent(call);
9561
+ case "web-search":
9562
+ return hasWebSearchContent(call);
9488
9563
  case "web-fetch":
9489
9564
  return hasWebFetchContent(call) || hasGenericStructuredContent(call);
9490
9565
  case "image-generation": {
@@ -9511,6 +9586,12 @@ function hasWebFetchContent(call) {
9511
9586
  const web = getWebFetchRenderData(call);
9512
9587
  return Boolean(web.url || web.visibleContent);
9513
9588
  }
9589
+ function hasWebSearchContent(call) {
9590
+ const web = getWebSearchRenderData(call);
9591
+ return Boolean(
9592
+ web.query || web.queries.length > 0 || web.output.trim() || web.error || arrayValue8(call.output?.links)?.length
9593
+ );
9594
+ }
9514
9595
  function hasReadContent(call) {
9515
9596
  const file = objectValue6(call.output?.file);
9516
9597
  return Boolean(
@@ -10622,10 +10703,16 @@ function AgentWebSearchContent({
10622
10703
  "use memo";
10623
10704
  const web = getWebSearchRenderData(call);
10624
10705
  const queries = web.queries;
10625
- const outputText = web.output ?? "";
10706
+ const outputText = web.output;
10626
10707
  const links = normalizeLinks(call.output?.links, outputText);
10627
10708
  const summary = extractSummary(outputText) ?? (call.summary.trim() || null);
10628
10709
  const visibleSummary = summary ? summary.slice(0, MAX_SUMMARY_LENGTH) : null;
10710
+ const hasRenderableContent = Boolean(
10711
+ web.query || queries.length > 0 || links.length > 0 || visibleSummary || web.error
10712
+ );
10713
+ if (!hasRenderableContent) {
10714
+ return null;
10715
+ }
10629
10716
  return /* @__PURE__ */ jsxs33("div", { className: "workspace-agents-status-panel__detail-tool-body", children: [
10630
10717
  web.query ? /* @__PURE__ */ jsx44(ToolSection, { title: translate("agentHost.agentTool.details.query"), children: /* @__PURE__ */ jsx44(ToolMarkdownBlock, { content: web.query, onLinkClick }) }) : null,
10631
10718
  queries.length > 0 ? /* @__PURE__ */ jsx44(ToolSection, { title: translate("agentHost.agentTool.details.results"), children: /* @__PURE__ */ jsx44("div", { className: "workspace-agents-status-panel__detail-tool-result-list overflow-hidden rounded-[8px] border border-[var(--line-2)] bg-[var(--transparency-block)]", children: queries.map((candidate, index) => /* @__PURE__ */ jsx44(
@@ -11998,4 +12085,4 @@ export {
11998
12085
  AgentConversationFlow,
11999
12086
  useProjectedAgentConversation
12000
12087
  };
12001
- //# sourceMappingURL=chunk-GZHQPPK2.js.map
12088
+ //# sourceMappingURL=chunk-267VY3EJ.js.map