@wowyuarm/dsh-agent-team 0.1.4 → 0.1.5

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 (56) hide show
  1. package/README.zh.md +5 -2
  2. package/package.json +1 -1
  3. package/packages/agent-team/lib/auto-compaction.js +39 -1
  4. package/packages/agent-team/lib/index.js +85 -5
  5. package/packages/agent-team/lib/ledger.js +80 -2
  6. package/packages/agent-team/lib/spec.js +12 -0
  7. package/packages/agent-team/lib/typert.host.js +94 -22
  8. package/packages/agent-team/lib/typert.remote-client.d.ts +3 -1
  9. package/packages/agent-team/lib/typert.remote-client.d.ts.map +1 -1
  10. package/packages/agent-team/lib/typert.remote-client.js +79 -22
  11. package/packages/agent-team/lib/types/auto-compaction.d.ts +9 -0
  12. package/packages/agent-team/lib/types/auto-compaction.d.ts.map +1 -1
  13. package/packages/agent-team/lib/types/index.d.ts +13 -1
  14. package/packages/agent-team/lib/types/index.d.ts.map +1 -1
  15. package/packages/agent-team/lib/types/ledger.d.ts +20 -0
  16. package/packages/agent-team/lib/types/ledger.d.ts.map +1 -1
  17. package/packages/agent-team/lib/types/spec.d.ts.map +1 -1
  18. package/packages/agent-team/lib/types/types.d.ts +41 -1
  19. package/packages/agent-team/lib/types/types.d.ts.map +1 -1
  20. package/packages/client-agent-team/lib/client.js +486 -90
  21. package/packages/client-agent-team/lib/client.js.map +1 -1
  22. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts +2 -1
  23. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts.map +1 -1
  24. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.js +41 -5
  25. package/packages/client-agent-team/lib/types/client/TeamChannelPage.d.ts.map +1 -1
  26. package/packages/client-agent-team/lib/types/client/TeamChannelPage.js +20 -0
  27. package/packages/client-agent-team/lib/types/client/TeamChannelsPanel.d.ts.map +1 -1
  28. package/packages/client-agent-team/lib/types/client/TeamChannelsPanel.js +3 -1
  29. package/packages/client-agent-team/lib/types/client/TeamComposer.d.ts.map +1 -1
  30. package/packages/client-agent-team/lib/types/client/TeamComposer.js +73 -17
  31. package/packages/client-agent-team/lib/types/client/TeamMemberSessionComposer.d.ts.map +1 -1
  32. package/packages/client-agent-team/lib/types/client/TeamMemberSessionComposer.js +16 -1
  33. package/packages/client-agent-team/lib/types/client/TeamMessage.d.ts.map +1 -1
  34. package/packages/client-agent-team/lib/types/client/TeamMessage.js +48 -18
  35. package/packages/client-agent-team/lib/types/client/TeamRowMenu.d.ts +3 -2
  36. package/packages/client-agent-team/lib/types/client/TeamRowMenu.d.ts.map +1 -1
  37. package/packages/client-agent-team/lib/types/client/TeamSidebarSection.d.ts +5 -2
  38. package/packages/client-agent-team/lib/types/client/TeamSidebarSection.d.ts.map +1 -1
  39. package/packages/client-agent-team/lib/types/client/TeamSidebarSection.js +2 -4
  40. package/packages/client-agent-team/lib/types/client/TeamThreadPage.d.ts.map +1 -1
  41. package/packages/client-agent-team/lib/types/client/TeamThreadPage.js +21 -2
  42. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts +1 -1
  43. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts.map +1 -1
  44. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.js +4 -2
  45. package/packages/client-agent-team/lib/types/client/index.d.ts.map +1 -1
  46. package/packages/client-agent-team/lib/types/client/index.js +15 -13
  47. package/packages/client-agent-team/lib/types/client/locales.d.ts +16 -0
  48. package/packages/client-agent-team/lib/types/client/locales.d.ts.map +1 -1
  49. package/packages/client-agent-team/lib/types/client/locales.js +16 -0
  50. package/packages/client-agent-team/lib/types/client/sidebar-sections.d.ts +16 -0
  51. package/packages/client-agent-team/lib/types/client/sidebar-sections.d.ts.map +1 -0
  52. package/packages/client-agent-team/lib/types/client/sidebar-sections.js +102 -0
  53. package/packages/client-agent-team/lib/types/client/slots.d.ts +2 -1
  54. package/packages/client-agent-team/lib/types/client/slots.d.ts.map +1 -1
  55. package/packages/client-agent-team/lib/types/client/team-formatters.d.ts.map +1 -1
  56. package/packages/client-agent-team/lib/types/client/team-formatters.js +9 -2
@@ -4281,6 +4281,52 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4281
4281
  "revision": number().readonly()
4282
4282
  })
4283
4283
  ]);
4284
+ const _wowyuarm_dsh_agent_team_agentTeam_clearMemberContext_parameter_0$schema = object({
4285
+ "requestId": intersection(string(), unknown()).readonly(),
4286
+ "workspaceId": intersection(string(), unknown()).readonly(),
4287
+ "memberId": intersection(string(), unknown()).readonly()
4288
+ });
4289
+ const _wowyuarm_dsh_agent_team_agentTeam_clearMemberContext_result$schema = object({
4290
+ "receipt": object({
4291
+ "operationId": intersection(string(), unknown()).readonly(),
4292
+ "requestId": intersection(string(), unknown()).readonly(),
4293
+ "sequence": number().readonly()
4294
+ }).readonly(),
4295
+ "status": object({
4296
+ "member": object({
4297
+ "memberId": intersection(string(), unknown()).readonly(),
4298
+ "sessionId": intersection(string(), unknown()).readonly(),
4299
+ "workspaceId": intersection(string(), unknown()).readonly(),
4300
+ "handle": string().readonly(),
4301
+ "description": string().readonly(),
4302
+ "presetId": string().readonly(),
4303
+ "model": union([_undefined(), object({
4304
+ "provider": string().readonly(),
4305
+ "model": string().readonly(),
4306
+ "reasoningEffort": intersection(string(), unknown()).readonly().optional()
4307
+ })]).readonly().optional(),
4308
+ "privateMemoryPath": string().readonly(),
4309
+ "state": union([
4310
+ literal("enabled"),
4311
+ literal("suspended"),
4312
+ literal("inactive")
4313
+ ]).readonly()
4314
+ }).readonly(),
4315
+ "availability": union([
4316
+ literal("suspended"),
4317
+ literal("inactive"),
4318
+ literal("active"),
4319
+ literal("unavailable")
4320
+ ]).readonly(),
4321
+ "presence": union([
4322
+ literal("unavailable"),
4323
+ literal("available"),
4324
+ literal("working"),
4325
+ literal("error")
4326
+ ]).readonly(),
4327
+ "diagnostic": string().readonly().optional()
4328
+ }).readonly()
4329
+ });
4284
4330
  const _wowyuarm_dsh_agent_team_agentTeam_createChannel_parameter_0$schema = object({
4285
4331
  "requestId": intersection(string(), unknown()).readonly(),
4286
4332
  "workspaceId": intersection(string(), unknown()).readonly(),
@@ -5298,7 +5344,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5298
5344
  },
5299
5345
  sourceLocation: {
5300
5346
  "file": "packages/agent-team/src/index.ts",
5301
- "line": 380,
5347
+ "line": 397,
5302
5348
  "column": 9
5303
5349
  }
5304
5350
  },
@@ -5325,7 +5371,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5325
5371
  },
5326
5372
  sourceLocation: {
5327
5373
  "file": "packages/agent-team/src/index.ts",
5328
- "line": 664,
5374
+ "line": 738,
5329
5375
  "column": 9
5330
5376
  }
5331
5377
  },
@@ -5353,7 +5399,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5353
5399
  },
5354
5400
  sourceLocation: {
5355
5401
  "file": "packages/agent-team/src/index.ts",
5356
- "line": 317,
5402
+ "line": 334,
5357
5403
  "column": 9
5358
5404
  }
5359
5405
  },
@@ -5380,7 +5426,34 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5380
5426
  },
5381
5427
  sourceLocation: {
5382
5428
  "file": "packages/agent-team/src/index.ts",
5383
- "line": 554,
5429
+ "line": 628,
5430
+ "column": 9
5431
+ }
5432
+ },
5433
+ {
5434
+ id: "@wowyuarm/dsh-agent-team#agentTeam/clearMemberContext",
5435
+ service: "agentTeam",
5436
+ namespace: "agentTeam",
5437
+ method: "clearMemberContext",
5438
+ invocation: { kind: "direct" },
5439
+ parameters: [{
5440
+ name: "request",
5441
+ wire: "request",
5442
+ source: "json",
5443
+ codec: {
5444
+ mode: "strict",
5445
+ typeSymbol: "@wowyuarm/dsh-agent-team/types#AgentTeamClearMemberContextRequest",
5446
+ schema: _wowyuarm_dsh_agent_team_agentTeam_clearMemberContext_parameter_0$schema
5447
+ }
5448
+ }],
5449
+ result: {
5450
+ mode: "strict",
5451
+ typeSymbol: "@wowyuarm/dsh-agent-team/types#AgentTeamClearMemberContextResult",
5452
+ schema: _wowyuarm_dsh_agent_team_agentTeam_clearMemberContext_result$schema
5453
+ },
5454
+ sourceLocation: {
5455
+ "file": "packages/agent-team/src/index.ts",
5456
+ "line": 489,
5384
5457
  "column": 9
5385
5458
  }
5386
5459
  },
@@ -5407,7 +5480,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5407
5480
  },
5408
5481
  sourceLocation: {
5409
5482
  "file": "packages/agent-team/src/index.ts",
5410
- "line": 358,
5483
+ "line": 375,
5411
5484
  "column": 9
5412
5485
  }
5413
5486
  },
@@ -5434,7 +5507,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5434
5507
  },
5435
5508
  sourceLocation: {
5436
5509
  "file": "packages/agent-team/src/index.ts",
5437
- "line": 650,
5510
+ "line": 724,
5438
5511
  "column": 9
5439
5512
  }
5440
5513
  },
@@ -5461,7 +5534,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5461
5534
  },
5462
5535
  sourceLocation: {
5463
5536
  "file": "packages/agent-team/src/index.ts",
5464
- "line": 673,
5537
+ "line": 747,
5465
5538
  "column": 3
5466
5539
  }
5467
5540
  },
@@ -5488,7 +5561,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5488
5561
  },
5489
5562
  sourceLocation: {
5490
5563
  "file": "packages/agent-team/src/index.ts",
5491
- "line": 574,
5564
+ "line": 648,
5492
5565
  "column": 9
5493
5566
  }
5494
5567
  },
@@ -5516,7 +5589,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5516
5589
  },
5517
5590
  sourceLocation: {
5518
5591
  "file": "packages/agent-team/src/index.ts",
5519
- "line": 308,
5592
+ "line": 325,
5520
5593
  "column": 3
5521
5594
  }
5522
5595
  },
@@ -5543,7 +5616,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5543
5616
  },
5544
5617
  sourceLocation: {
5545
5618
  "file": "packages/agent-team/src/index.ts",
5546
- "line": 564,
5619
+ "line": 638,
5547
5620
  "column": 9
5548
5621
  }
5549
5622
  },
@@ -5570,7 +5643,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5570
5643
  },
5571
5644
  sourceLocation: {
5572
5645
  "file": "packages/agent-team/src/index.ts",
5573
- "line": 637,
5646
+ "line": 711,
5574
5647
  "column": 9
5575
5648
  }
5576
5649
  },
@@ -5597,7 +5670,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5597
5670
  },
5598
5671
  sourceLocation: {
5599
5672
  "file": "packages/agent-team/src/index.ts",
5600
- "line": 680,
5673
+ "line": 754,
5601
5674
  "column": 9
5602
5675
  }
5603
5676
  },
@@ -5624,7 +5697,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5624
5697
  },
5625
5698
  sourceLocation: {
5626
5699
  "file": "packages/agent-team/src/index.ts",
5627
- "line": 433,
5700
+ "line": 450,
5628
5701
  "column": 9
5629
5702
  }
5630
5703
  },
@@ -5651,7 +5724,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5651
5724
  },
5652
5725
  sourceLocation: {
5653
5726
  "file": "packages/agent-team/src/index.ts",
5654
- "line": 585,
5727
+ "line": 659,
5655
5728
  "column": 9
5656
5729
  }
5657
5730
  },
@@ -5678,7 +5751,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5678
5751
  },
5679
5752
  sourceLocation: {
5680
5753
  "file": "packages/agent-team/src/index.ts",
5681
- "line": 658,
5754
+ "line": 732,
5682
5755
  "column": 9
5683
5756
  }
5684
5757
  },
@@ -5705,7 +5778,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5705
5778
  },
5706
5779
  sourceLocation: {
5707
5780
  "file": "packages/agent-team/src/index.ts",
5708
- "line": 295,
5781
+ "line": 312,
5709
5782
  "column": 3
5710
5783
  }
5711
5784
  },
@@ -5732,7 +5805,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5732
5805
  },
5733
5806
  sourceLocation: {
5734
5807
  "file": "packages/agent-team/src/index.ts",
5735
- "line": 594,
5808
+ "line": 668,
5736
5809
  "column": 9
5737
5810
  }
5738
5811
  },
@@ -5759,7 +5832,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5759
5832
  },
5760
5833
  sourceLocation: {
5761
5834
  "file": "packages/agent-team/src/index.ts",
5762
- "line": 696,
5835
+ "line": 770,
5763
5836
  "column": 3
5764
5837
  }
5765
5838
  },
@@ -5786,7 +5859,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5786
5859
  },
5787
5860
  sourceLocation: {
5788
5861
  "file": "packages/agent-team/src/index.ts",
5789
- "line": 689,
5862
+ "line": 763,
5790
5863
  "column": 3
5791
5864
  }
5792
5865
  },
@@ -5813,7 +5886,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5813
5886
  },
5814
5887
  sourceLocation: {
5815
5888
  "file": "packages/agent-team/src/index.ts",
5816
- "line": 370,
5889
+ "line": 387,
5817
5890
  "column": 9
5818
5891
  }
5819
5892
  },
@@ -5840,7 +5913,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5840
5913
  },
5841
5914
  sourceLocation: {
5842
5915
  "file": "packages/agent-team/src/index.ts",
5843
- "line": 524,
5916
+ "line": 598,
5844
5917
  "column": 9
5845
5918
  }
5846
5919
  },
@@ -5867,7 +5940,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5867
5940
  },
5868
5941
  sourceLocation: {
5869
5942
  "file": "packages/agent-team/src/index.ts",
5870
- "line": 703,
5943
+ "line": 777,
5871
5944
  "column": 3
5872
5945
  }
5873
5946
  }
@@ -5875,7 +5948,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5875
5948
  };
5876
5949
  //#endregion
5877
5950
  //#region src/client/navigation.ts
5878
- const STORAGE_KEY$2 = "dsh.agent-team.navigation";
5951
+ const STORAGE_KEY$3 = "dsh.agent-team.navigation";
5879
5952
  function readSnapshot() {
5880
5953
  if (typeof localStorage === "undefined") return { mode: "conversation" };
5881
5954
  try {
@@ -5899,7 +5972,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5899
5972
  if (typeof localStorage === "undefined") return;
5900
5973
  try {
5901
5974
  const { mode, workspaceId, channelRef, taskRef, threadRef, taskNumber } = snapshot;
5902
- localStorage.setItem(STORAGE_KEY$2, JSON.stringify({
5975
+ localStorage.setItem(STORAGE_KEY$3, JSON.stringify({
5903
5976
  mode,
5904
5977
  ...workspaceId === void 0 ? {} : { workspaceId },
5905
5978
  ...channelRef === void 0 ? {} : { channelRef },
@@ -6110,7 +6183,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6110
6183
  };
6111
6184
  //#endregion
6112
6185
  //#region src/client/drafts.ts
6113
- const STORAGE_KEY$1 = "dsh.agent-team.drafts.v1";
6186
+ const STORAGE_KEY$2 = "dsh.agent-team.drafts.v1";
6114
6187
  /** Retention ceiling; the oldest savedAt entries fall out first. */
6115
6188
  const LIMIT = 50;
6116
6189
  const EMPTY = Object.freeze({
@@ -6145,7 +6218,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6145
6218
  if (typeof localStorage === "undefined") return;
6146
6219
  try {
6147
6220
  const payload = Object.fromEntries([...entries].map(([key, entry]) => [key, entry]));
6148
- localStorage.setItem(STORAGE_KEY$1, JSON.stringify(payload));
6221
+ localStorage.setItem(STORAGE_KEY$2, JSON.stringify(payload));
6149
6222
  } catch {}
6150
6223
  }
6151
6224
  /**
@@ -6197,7 +6270,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6197
6270
  reset() {
6198
6271
  this.entries = /* @__PURE__ */ new Map();
6199
6272
  this.snapshots.clear();
6200
- if (typeof localStorage !== "undefined") localStorage.removeItem(STORAGE_KEY$1);
6273
+ if (typeof localStorage !== "undefined") localStorage.removeItem(STORAGE_KEY$2);
6201
6274
  for (const listener of this.listeners) listener();
6202
6275
  }
6203
6276
  /** Re-read persisted content — what a fresh page load starts from. */
@@ -6487,7 +6560,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6487
6560
  const mintRequestId = () => crypto.randomUUID();
6488
6561
  //#endregion
6489
6562
  //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/composer.module.css.mjs
6490
- const css$5 = ".x9jGQq_root{padding:0 var(--dsh-composer-side-clearance,16px) 8px;flex-direction:column;align-items:center;display:flex}.x9jGQq_card{box-sizing:border-box;width:100%;max-width:var(--dsh-composer-card-max-width,780px);border:1px solid var(--dsw-alias-border-l2-darkmode-thin);background:var(--dsw-specific-input-major,var(--dsw-alias-bg-layer-1));box-shadow:var(--dsw-shadow-lv2);border-radius:22px;flex-direction:column;gap:6px;padding:10px 0 0;display:flex;position:relative}.x9jGQq_inputArea{min-height:28px;position:relative}.x9jGQq_inputArea textarea{box-sizing:border-box;resize:none;width:100%;min-height:28px;max-height:336px;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-primary));font:inherit;white-space:pre-wrap;overflow-wrap:anywhere;background:0 0;border:0;outline:0;padding:4px 12px 0 16px;font-size:15px;line-height:24px;display:block;overflow-y:auto}.x9jGQq_inputArea textarea::placeholder{color:var(--dsw-alias-label-caption,var(--dsw-alias-label-tertiary))}.x9jGQq_memberSessionRoot{padding:0 var(--dsh-composer-side-clearance) 8px}.x9jGQq_memberSessionCard{font-family:var(--dsw-font-family);gap:6px;padding-top:10px;font-size:16px;line-height:24px}.x9jGQq_memberSessionInputArea textarea{min-height:28px;color:var(--dsw-alias-label-primary);caret-color:var(--dsw-alias-state-business-primary);font-family:var(--dsw-font-family);font-size:inherit;line-height:inherit;padding:4px 12px 0 16px}.x9jGQq_memberSessionStatus{width:100%;max-width:var(--dsh-composer-card-max-width);background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-state-error-primary);border-radius:8px;margin:0 0 6px;padding:4px 8px;font-size:12px;line-height:18px}.x9jGQq_memberSessionToolbar{min-width:0;padding:2px 8px 6px}.x9jGQq_memberSessionPrimary{background:var(--dsw-alias-button-info-fill);border-radius:999px;place-items:center;display:grid;transform:translateY(-2px)}.x9jGQq_memberSessionPrimary:hover:not(:disabled){background:var(--dsw-alias-button-info-hover)}.x9jGQq_memberSessionPrimary:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.x9jGQq_memberSessionPrimary:disabled{cursor:default;opacity:.4}.x9jGQq_inputArea textarea:disabled{cursor:not-allowed;opacity:.55}.x9jGQq_mentionMenu{z-index:10;border:1px solid var(--dsw-alias-border-inverted);background:var(--dsw-specific-menu);max-height:min(320px,40vh);box-shadow:var(--dsw-shadow-lv3);border-radius:12px;padding:4px;position:absolute;bottom:calc(100% + 12px);left:0;right:0;overflow-y:auto}.x9jGQq_mentionOption{width:100%;min-height:40px;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-primary));cursor:pointer;text-align:left;background:0 0;border:0;border-radius:10px;grid-template-columns:16px minmax(0,auto) minmax(0,1fr);align-items:center;gap:8px;padding:8px 10px;font-size:14px;line-height:22px;display:grid}.x9jGQq_mentionOption:hover,.x9jGQq_mentionOption[aria-selected=true]{background:var(--dsw-alias-interactive-bg-hover)}.x9jGQq_mentionName{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.x9jGQq_mentionDescription{min-width:0;color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-tertiary));text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.x9jGQq_toolbar{justify-content:flex-end;align-items:center;gap:6px;min-height:34px;padding:2px 8px 6px;display:flex}.x9jGQq_asTaskOn[aria-pressed=true],.x9jGQq_asTaskOn[aria-pressed=true]:hover:not(:disabled){background:var(--dsw-alias-button-primary-fill);border-color:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground)}.x9jGQq_attachButton{background:var(--dsw-specific-selector);color:var(--dsw-alias-label-primary);cursor:pointer;border:0;border-radius:999px;flex:none;place-items:center;width:28px;height:28px;margin-right:auto;display:grid}.x9jGQq_attachButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-solid)}.x9jGQq_attachButton:disabled{cursor:default;opacity:.5}.x9jGQq_attachButton:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,var(--dsw-specific-selector));outline-offset:1px}.x9jGQq_fileInput{display:none}.x9jGQq_fileChips{flex-wrap:wrap;gap:4px;margin:0;padding:4px 8px 0;list-style:none;display:flex}.x9jGQq_fileChip{background:var(--dsw-alias-interactive-bg-hover);border-radius:6px;align-items:center;gap:4px;max-width:100%;padding:2px 4px 2px 8px;display:inline-flex}.x9jGQq_fileChipSize{color:var(--dsw-alias-label-tertiary);margin-left:6px}.x9jGQq_imageChip{align-items:center;display:flex}.x9jGQq_imageChipPreview{border:1px solid var(--dsw-alias-border-l2);object-fit:cover;border-radius:4px;width:56px;height:40px}.x9jGQq_fileChipName{text-overflow:ellipsis;white-space:nowrap;max-width:220px;font-size:11px;line-height:16px;overflow:hidden}.x9jGQq_fileChipRemove{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;border-radius:4px;justify-content:center;align-items:center;width:16px;height:16px;padding:0;font-size:12px;display:inline-flex}.x9jGQq_fileChipRemove:hover,.x9jGQq_fileChipRemove:focus-visible{color:var(--dsw-alias-label-primary);outline:none}.x9jGQq_sendButton{background:var(--dsw-alias-button-info-fill,var(--dsw-alias-button-primary-fill));color:#fff;cursor:pointer;border:0;border-radius:50%;justify-content:center;align-items:center;width:34px;height:34px;padding:0;transition:background-color .1s,opacity .1s;display:inline-flex}.x9jGQq_sendButton:hover:not(:disabled){background:var(--dsw-alias-button-info-hover,var(--dsw-alias-button-primary-hover))}.x9jGQq_sendButton:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.x9jGQq_sendButton:disabled{cursor:not-allowed;opacity:.4}.x9jGQq_confirmation{color:var(--dsw-alias-label-tertiary);align-self:stretch;margin:0;padding:0 16px;font-size:12px;line-height:18px}.x9jGQq_notifyRow{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-tertiary));overflow-wrap:anywhere;margin:0;padding:0 16px;font-size:12px;line-height:18px}.x9jGQq_error{color:var(--dsw-alias-state-error-primary);align-self:stretch;margin:0;padding:0 4px 2px;font-size:12px;line-height:18px}@media (width<=600px){.x9jGQq_mentionOption{grid-template-columns:16px minmax(0,1fr);min-height:36px;padding-block:6px}.x9jGQq_mentionDescription{display:none}}@media (prefers-reduced-motion:reduce){.x9jGQq_sendButton{transition:none}}";
6563
+ const css$5 = ".x9jGQq_root{padding:0 var(--dsh-composer-side-clearance,16px) 8px;flex-direction:column;align-items:center;display:flex}.x9jGQq_card{box-sizing:border-box;width:100%;max-width:var(--dsh-composer-card-max-width,780px);border:1px solid var(--dsw-alias-border-l2-darkmode-thin);background:var(--dsw-specific-input-major,var(--dsw-alias-bg-layer-1));box-shadow:var(--dsw-shadow-lv2);border-radius:22px;flex-direction:column;gap:6px;padding:10px 0 0;display:flex;position:relative}.x9jGQq_inputArea{min-height:28px;position:relative}.x9jGQq_inputArea textarea{box-sizing:border-box;resize:none;width:100%;min-height:28px;max-height:336px;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-primary));font:inherit;white-space:pre-wrap;overflow-wrap:anywhere;background:0 0;border:0;outline:0;padding:4px 12px 0 16px;font-size:15px;line-height:24px;display:block;overflow-y:auto}.x9jGQq_inputArea textarea::placeholder{color:var(--dsw-alias-label-caption,var(--dsw-alias-label-tertiary))}.x9jGQq_memberSessionRoot{padding:0 var(--dsh-composer-side-clearance) 8px}.x9jGQq_memberSessionCard{font-family:var(--dsw-font-family);gap:6px;padding-top:10px;font-size:16px;line-height:24px}.x9jGQq_memberSessionInputArea textarea{min-height:28px;color:var(--dsw-alias-label-primary);caret-color:var(--dsw-alias-state-business-primary);font-family:var(--dsw-font-family);font-size:inherit;line-height:inherit;padding:4px 12px 0 16px}.x9jGQq_memberSessionStatus{width:100%;max-width:var(--dsh-composer-card-max-width);background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-state-error-primary);border-radius:8px;margin:0 0 6px;padding:4px 8px;font-size:12px;line-height:18px}.x9jGQq_memberSessionToolbar{min-width:0;padding:2px 8px 6px}.x9jGQq_memberSessionPrimary{background:var(--dsw-alias-button-info-fill);border-radius:999px;place-items:center;display:grid;transform:translateY(-2px)}.x9jGQq_memberSessionPrimary:hover:not(:disabled){background:var(--dsw-alias-button-info-hover)}.x9jGQq_memberSessionPrimary:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.x9jGQq_memberSessionPrimary:disabled{cursor:default;opacity:.4}.x9jGQq_inputArea textarea:disabled{cursor:not-allowed;opacity:.55}.x9jGQq_mentionMenu{z-index:10;border:1px solid var(--dsw-alias-border-inverted);background:var(--dsw-specific-menu);max-height:min(320px,40vh);box-shadow:var(--dsw-shadow-lv3);border-radius:12px;padding:4px;position:absolute;bottom:calc(100% + 12px);left:0;right:0;overflow-y:auto}.x9jGQq_mentionOption{width:100%;min-height:40px;color:var(--dsw-alias-label-primary,var(--dsw-alias-label-primary));cursor:pointer;text-align:left;background:0 0;border:0;border-radius:10px;grid-template-columns:16px minmax(0,auto) minmax(0,1fr);align-items:center;gap:8px;padding:8px 10px;font-size:14px;line-height:22px;display:grid}.x9jGQq_mentionOption:hover,.x9jGQq_mentionOption[aria-selected=true]{background:var(--dsw-alias-interactive-bg-hover)}.x9jGQq_mentionName{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.x9jGQq_mentionAllDot{background:var(--dsw-alias-label-primary);border-radius:50%;justify-self:center;width:8px;height:8px}.x9jGQq_mentionDescription{min-width:0;color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-tertiary));text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.x9jGQq_toolbar{justify-content:flex-end;align-items:center;gap:6px;min-height:34px;padding:2px 8px 6px;display:flex}.x9jGQq_asTaskOn[aria-pressed=true],.x9jGQq_asTaskOn[aria-pressed=true]:hover:not(:disabled){background:var(--dsw-alias-button-primary-fill);border-color:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground)}.x9jGQq_attachButton{background:var(--dsw-specific-selector);color:var(--dsw-alias-label-primary);cursor:pointer;border:0;border-radius:999px;flex:none;place-items:center;width:28px;height:28px;margin-right:auto;display:grid}.x9jGQq_attachButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-solid)}.x9jGQq_attachButton:disabled{cursor:default;opacity:.5}.x9jGQq_attachButton:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,var(--dsw-specific-selector));outline-offset:1px}.x9jGQq_fileInput{display:none}.x9jGQq_fileChips{flex-wrap:wrap;gap:4px;margin:0;padding:4px 8px 0;list-style:none;display:flex}.x9jGQq_fileChip{background:var(--dsw-alias-interactive-bg-hover);border-radius:6px;align-items:center;gap:4px;max-width:100%;padding:2px 4px 2px 8px;display:inline-flex}.x9jGQq_fileChipSize{color:var(--dsw-alias-label-tertiary);margin-left:6px}.x9jGQq_imageChip{align-items:center;display:flex}.x9jGQq_imageChipPreview{border:1px solid var(--dsw-alias-border-l2);object-fit:cover;border-radius:4px;width:56px;height:40px}.x9jGQq_fileChipName{text-overflow:ellipsis;white-space:nowrap;max-width:220px;font-size:11px;line-height:16px;overflow:hidden}.x9jGQq_fileChipRemove{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;border-radius:4px;justify-content:center;align-items:center;width:16px;height:16px;padding:0;font-size:12px;display:inline-flex}.x9jGQq_fileChipRemove:hover,.x9jGQq_fileChipRemove:focus-visible{color:var(--dsw-alias-label-primary);outline:none}.x9jGQq_sendButton{background:var(--dsw-alias-button-info-fill,var(--dsw-alias-button-primary-fill));color:#fff;cursor:pointer;border:0;border-radius:50%;justify-content:center;align-items:center;width:34px;height:34px;padding:0;transition:background-color .1s,opacity .1s;display:inline-flex}.x9jGQq_sendButton:hover:not(:disabled){background:var(--dsw-alias-button-info-hover,var(--dsw-alias-button-primary-hover))}.x9jGQq_sendButton:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.x9jGQq_sendButton:disabled{cursor:not-allowed;opacity:.4}.x9jGQq_confirmation{color:var(--dsw-alias-label-tertiary);align-self:stretch;margin:0;padding:0 16px;font-size:12px;line-height:18px}.x9jGQq_notifyRow{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-tertiary));overflow-wrap:anywhere;margin:0;padding:0 16px;font-size:12px;line-height:18px}.x9jGQq_error{color:var(--dsw-alias-state-error-primary);align-self:stretch;margin:0;padding:0 4px 2px;font-size:12px;line-height:18px}@media (width<=600px){.x9jGQq_mentionOption{grid-template-columns:16px minmax(0,1fr);min-height:36px;padding-block:6px}.x9jGQq_mentionDescription{display:none}}@media (prefers-reduced-motion:reduce){.x9jGQq_sendButton{transition:none}}";
6491
6564
  const tagId$5 = "@wowyuarm/dsh-agent-team/composer.module.css";
6492
6565
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$5) + "]") === null) {
6493
6566
  const tag = document.createElement("style");
@@ -6517,6 +6590,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6517
6590
  "memberSessionRoot": "x9jGQq_memberSessionRoot",
6518
6591
  "memberSessionStatus": "x9jGQq_memberSessionStatus",
6519
6592
  "memberSessionToolbar": "x9jGQq_memberSessionToolbar",
6593
+ "mentionAllDot": "x9jGQq_mentionAllDot",
6520
6594
  "mentionDescription": "x9jGQq_mentionDescription",
6521
6595
  "mentionMenu": "x9jGQq_mentionMenu",
6522
6596
  "mentionName": "x9jGQq_mentionName",
@@ -6552,6 +6626,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6552
6626
  const normalized = query.toLocaleLowerCase();
6553
6627
  return members.filter((status) => status.presence !== "unavailable" && status.member.state !== "inactive" && status.member.handle.toLocaleLowerCase().startsWith(normalized));
6554
6628
  }
6629
+ /** Every member a manual handle pick could reach: the @all expansion snapshot. */
6630
+ function allMentionMembers(members) {
6631
+ return members.filter((status) => status.presence !== "unavailable" && status.member.state !== "inactive");
6632
+ }
6633
+ function containsAllMention(draft) {
6634
+ return /(?:^|[^\p{L}\p{N}_])@all(?=$|[^\p{L}\p{N}_])/u.test(draft);
6635
+ }
6555
6636
  /** One object URL per draft file; revoked when the draft is removed. */
6556
6637
  const draftPreviewUrls = /* @__PURE__ */ new WeakMap();
6557
6638
  function draftPreviewUrl(file) {
@@ -6571,9 +6652,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6571
6652
  const composingRef = (0, react.useRef)(false);
6572
6653
  const [mention, setMention] = (0, react.useState)();
6573
6654
  const [highlight, setHighlight] = (0, react.useState)(0);
6574
- const candidates = mention === void 0 ? [] : mentionCandidates(members, mention.query);
6575
- const menuOpen = mention !== void 0 && candidates.length > 0;
6576
- const activeCandidate = candidates[highlight];
6655
+ const memberCandidates = mention === void 0 ? [] : mentionCandidates(members, mention.query);
6656
+ const options = mention !== void 0 && "all".startsWith(mention.query.toLocaleLowerCase()) ? [{ kind: "all" }, ...memberCandidates.map((status) => ({
6657
+ kind: "member",
6658
+ status
6659
+ }))] : memberCandidates.map((status) => ({
6660
+ kind: "member",
6661
+ status
6662
+ }));
6663
+ const menuOpen = mention !== void 0 && options.length > 0;
6664
+ const activeOption = options[highlight];
6665
+ const allCount = allMentionMembers(members).length;
6577
6666
  const listId = "team-mention-suggestions";
6578
6667
  const menuMaxHeight = (0, _deepseek_ai_dsh_client_ui_primitives.useAnchoredMaxHeight)(menuRef, 320, menuOpen ? draft : null);
6579
6668
  (0, _deepseek_ai_dsh_client_ui_primitives.useDismissOnOutsidePointer)(rootRef, menuOpen, (open) => {
@@ -6586,12 +6675,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6586
6675
  input.style.height = `${Math.min(input.scrollHeight, 180)}px`;
6587
6676
  }, [draft]);
6588
6677
  (0, react.useEffect)(() => {
6589
- if (mention === void 0 || candidates.length === 0) {
6678
+ if (mention === void 0 || options.length === 0) {
6590
6679
  setHighlight(0);
6591
6680
  return;
6592
6681
  }
6593
- setHighlight((current) => Math.min(current, candidates.length - 1));
6594
- }, [mention, candidates.length]);
6682
+ setHighlight((current) => Math.min(current, options.length - 1));
6683
+ }, [mention, options.length]);
6595
6684
  (0, react.useEffect)(() => {
6596
6685
  const active = document.activeElement;
6597
6686
  if (active !== document.body && active?.closest("[aria-current=\"page\"]") === null) return;
@@ -6602,6 +6691,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6602
6691
  inputRef.current?.focus({ preventScroll: true });
6603
6692
  }, [confirmation, pending]);
6604
6693
  const pruneRecipients = (nextDraft) => {
6694
+ if (containsAllMention(nextDraft)) return;
6605
6695
  const knownMembers = new Map(members.map((status) => [status.member.memberId, status.member]));
6606
6696
  const next = new Set([...recipients].filter((memberId) => {
6607
6697
  const member = knownMembers.get(memberId);
@@ -6628,8 +6718,26 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6628
6718
  pruneRecipients(nextDraft);
6629
6719
  updateMention(nextDraft, event.target.selectionStart ?? nextDraft.length);
6630
6720
  };
6631
- const selectMention = (member) => {
6721
+ const selectOption = (option) => {
6632
6722
  if (mention === void 0) return;
6723
+ if (option.kind === "all") {
6724
+ const nextDraft = `${draft.slice(0, mention.start)}@all ${draft.slice(mention.end)}`;
6725
+ const nextCaret = mention.start + 5;
6726
+ const nextRecipients = new Set(recipients);
6727
+ for (const status of allMentionMembers(members)) nextRecipients.add(status.member.memberId);
6728
+ onDraftChange(nextDraft);
6729
+ onRecipientsChange(nextRecipients);
6730
+ setMention(void 0);
6731
+ setHighlight(0);
6732
+ requestAnimationFrame(() => {
6733
+ const input = inputRef.current;
6734
+ if (input === null) return;
6735
+ input.focus({ preventScroll: true });
6736
+ input.setSelectionRange(nextCaret, nextCaret);
6737
+ });
6738
+ return;
6739
+ }
6740
+ const member = option.status;
6633
6741
  const inserted = `@${member.member.handle} `;
6634
6742
  const nextDraft = `${draft.slice(0, mention.start)}${inserted}${draft.slice(mention.end)}`;
6635
6743
  const nextCaret = mention.start + inserted.length;
@@ -6645,16 +6753,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6645
6753
  input.setSelectionRange(nextCaret, nextCaret);
6646
6754
  });
6647
6755
  };
6756
+ const onPaste = (event) => {
6757
+ if (pending || onFilesChange === void 0 || pendingFiles === void 0) return;
6758
+ const files = Array.from(event.clipboardData.items).filter((item) => item.kind === "file").map((item) => item.getAsFile()).filter((file) => file !== null);
6759
+ if (files.length === 0) return;
6760
+ event.preventDefault();
6761
+ onFilesChange([...pendingFiles, ...files]);
6762
+ };
6648
6763
  const onKeyDown = (event) => {
6649
6764
  const composing = composingRef.current || event.nativeEvent.isComposing || event.nativeEvent.keyCode === 229;
6650
6765
  if (menuOpen && event.key === "ArrowDown") {
6651
6766
  event.preventDefault();
6652
- setHighlight((current) => (current + 1) % candidates.length);
6767
+ setHighlight((current) => (current + 1) % options.length);
6653
6768
  return;
6654
6769
  }
6655
6770
  if (menuOpen && event.key === "ArrowUp") {
6656
6771
  event.preventDefault();
6657
- setHighlight((current) => (current - 1 + candidates.length) % candidates.length);
6772
+ setHighlight((current) => (current - 1 + options.length) % options.length);
6658
6773
  return;
6659
6774
  }
6660
6775
  if (event.key === "Escape" && menuOpen) {
@@ -6664,13 +6779,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6664
6779
  }
6665
6780
  if (menuOpen && event.key === "Tab" && !event.shiftKey) {
6666
6781
  event.preventDefault();
6667
- if (activeCandidate !== void 0) selectMention(activeCandidate);
6782
+ if (activeOption !== void 0) selectOption(activeOption);
6668
6783
  return;
6669
6784
  }
6670
6785
  if (event.key !== "Enter" || event.shiftKey || composing || event.repeat) return;
6671
- if (menuOpen && activeCandidate !== void 0) {
6786
+ if (menuOpen && activeOption !== void 0) {
6672
6787
  event.preventDefault();
6673
- selectMention(activeCandidate);
6788
+ selectOption(activeOption);
6674
6789
  return;
6675
6790
  }
6676
6791
  event.preventDefault();
@@ -6701,47 +6816,76 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6701
6816
  role: "listbox",
6702
6817
  "aria-label": t("mentionSuggestions"),
6703
6818
  style: { maxHeight: menuMaxHeight },
6704
- children: candidates.map((status, index) => {
6705
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
6706
- id: `${listId}-${status.member.memberId}`,
6819
+ children: options.map((option, index) => {
6820
+ const optionId = option.kind === "all" ? `${listId}-all` : `${listId}-${option.status.member.memberId}`;
6821
+ const selected = index === highlight;
6822
+ return option.kind === "all" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
6823
+ id: optionId,
6707
6824
  type: "button",
6708
6825
  role: "option",
6709
- "aria-selected": index === highlight,
6826
+ "aria-selected": selected,
6710
6827
  className: composer_module_css_default.mentionOption,
6711
6828
  onMouseDown: (event) => {
6712
6829
  event.preventDefault();
6713
6830
  },
6714
6831
  onClick: () => {
6715
- selectMention(status);
6832
+ selectOption(option);
6833
+ },
6834
+ children: [
6835
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6836
+ className: composer_module_css_default.mentionAllDot,
6837
+ "aria-hidden": "true"
6838
+ }),
6839
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6840
+ className: composer_module_css_default.mentionName,
6841
+ children: "@all"
6842
+ }),
6843
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6844
+ className: composer_module_css_default.mentionDescription,
6845
+ children: t("mentionAll", { count: allCount })
6846
+ })
6847
+ ]
6848
+ }, "all") : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
6849
+ id: optionId,
6850
+ type: "button",
6851
+ role: "option",
6852
+ "aria-selected": selected,
6853
+ className: composer_module_css_default.mentionOption,
6854
+ onMouseDown: (event) => {
6855
+ event.preventDefault();
6856
+ },
6857
+ onClick: () => {
6858
+ selectOption(option);
6716
6859
  },
6717
6860
  children: [
6718
6861
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamPresenceDot, {
6719
- status,
6862
+ status: option.status,
6720
6863
  t
6721
6864
  }),
6722
6865
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
6723
6866
  className: composer_module_css_default.mentionName,
6724
- children: ["@", status.member.handle]
6867
+ children: ["@", option.status.member.handle]
6725
6868
  }),
6726
6869
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6727
6870
  className: composer_module_css_default.mentionDescription,
6728
- children: status.member.description
6871
+ children: option.status.member.description
6729
6872
  })
6730
6873
  ]
6731
- }, status.member.memberId);
6874
+ }, option.status.member.memberId);
6732
6875
  })
6733
6876
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
6734
6877
  ref: inputRef,
6735
6878
  "aria-label": t("messageDraft"),
6736
6879
  "aria-autocomplete": "list",
6737
6880
  "aria-controls": menuOpen ? listId : void 0,
6738
- "aria-activedescendant": menuOpen && activeCandidate !== void 0 ? `${listId}-${activeCandidate.member.memberId}` : void 0,
6881
+ "aria-activedescendant": menuOpen && activeOption !== void 0 ? activeOption.kind === "all" ? `${listId}-all` : `${listId}-${activeOption.status.member.memberId}` : void 0,
6739
6882
  "aria-expanded": menuOpen,
6740
6883
  value: draft,
6741
6884
  readOnly: pending,
6742
6885
  placeholder: placeholder ?? t("messagePlaceholder"),
6743
6886
  rows: 1,
6744
6887
  onChange,
6888
+ onPaste,
6745
6889
  onKeyDown,
6746
6890
  onSelect: (event) => {
6747
6891
  updateMention(event.currentTarget.value, event.currentTarget.selectionStart ?? event.currentTarget.value.length);
@@ -6862,16 +7006,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6862
7006
  const pending = /* @__PURE__ */ new Set();
6863
7007
  /** Refs the Host did not recognize; never re-queried (no retry loops). */
6864
7008
  const unresolvable = /* @__PURE__ */ new Set();
6865
- const listeners$1 = /* @__PURE__ */ new Set();
7009
+ const listeners$2 = /* @__PURE__ */ new Set();
6866
7010
  let version = 0;
6867
7011
  const emit = () => {
6868
7012
  version += 1;
6869
- for (const listener of listeners$1) listener();
7013
+ for (const listener of listeners$2) listener();
6870
7014
  };
6871
7015
  const subscribe = (listener) => {
6872
- listeners$1.add(listener);
7016
+ listeners$2.add(listener);
6873
7017
  return () => {
6874
- listeners$1.delete(listener);
7018
+ listeners$2.delete(listener);
6875
7019
  };
6876
7020
  };
6877
7021
  /** Stable snapshot token; the map is read directly after this changes. */
@@ -7064,7 +7208,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7064
7208
  }
7065
7209
  /** Canonical chip handles for one Message's structured mention refs. */
7066
7210
  function mentionNamesOf(mentions, handles) {
7067
- return mentions.map((memberId) => handles.get(memberId)).filter((name) => name !== void 0);
7211
+ return mentions.map((memberId) => memberId === "member:human" ? "human" : handles.get(memberId)).filter((name) => name !== void 0);
7068
7212
  }
7069
7213
  const MARKDOWN_BLOCK_CONSTRUCT = /(^|\n)[ \t]{0,3}(?:#{1,6}[ \t]|>[ \t]|[-*+][ \t]|\d+[.)][ \t])|^[ \t]*\|.+\|/m;
7070
7214
  const MARKDOWN_INLINE_CONSTRUCT = /[`*_[\]!]|~~~|```/;
@@ -7149,7 +7293,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7149
7293
  render: inline !== void 0 ? "inline" : options.human || options.canOpenRefs && !richAgentBody && refs.length > 0 ? "literal" : "markdown",
7150
7294
  ...inline === void 0 ? {} : { inline },
7151
7295
  fallbackNames,
7152
- fallbackRefs: richAgentBody && options.canOpenRefs ? refs.filter((ref) => !ref.startsWith("task:")) : [],
7296
+ fallbackRefs: richAgentBody && !options.canOpenRefs ? refs : [],
7153
7297
  taskRefs: options.canOpenRefs && !richAgentBody ? refs.filter((ref) => ref.startsWith("task:")).map((ref) => ref) : []
7154
7298
  };
7155
7299
  }
@@ -7232,6 +7376,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7232
7376
  refVersion
7233
7377
  ]);
7234
7378
  const taskLabel = (0, react.useCallback)((taskNumber) => t?.("taskLabel", { number: taskNumber }) ?? `Task #${taskNumber}`, [t]);
7379
+ const refLabel = (0, react.useCallback)((ref) => ref.startsWith("thread:") ? t?.("threadLabel") ?? "Thread" : ref.startsWith("channel:") ? t?.("channels") ?? "Channels" : ref, [t]);
7235
7380
  const [expanded, setExpanded] = (0, react.useState)(false);
7236
7381
  const clampable = shouldClampMessage(displayBody);
7237
7382
  const clamped = clampable && !expanded;
@@ -7243,8 +7388,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7243
7388
  const styledRefCodes = markdownStyledRefCodeElements(root);
7244
7389
  const taskRefs = [...new Set([...textNodes.map((node) => node.data), ...styledRefCodes.map((code) => code.textContent ?? "")].flatMap((text) => splitBrandedRefs(text).filter((segment) => segment.ref?.startsWith("task:") === true).map((segment) => segment.ref)))];
7245
7390
  if (onResolveTaskRefs !== void 0 && taskRefs.length > 0) resolveUnknownTaskRefs(taskRefs, onResolveTaskRefs);
7246
- for (const code of styledRefCodes) renderResolvedMarkdownCodeRef(code, taskLabel);
7247
- for (const node of textNodes) renderResolvedMarkdownText(node, mentionNames ?? [], taskLabel);
7391
+ for (const code of styledRefCodes) renderResolvedMarkdownCodeRef(code, taskLabel, refLabel);
7392
+ for (const node of textNodes) renderResolvedMarkdownText(node, mentionNames ?? [], taskLabel, refLabel);
7248
7393
  for (const button of root.querySelectorAll("button[data-task-ref]")) {
7249
7394
  const taskRef = button.dataset.taskRef;
7250
7395
  const hit = taskRef === void 0 ? void 0 : cachedResolvedTaskRef(taskRef);
@@ -7256,6 +7401,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7256
7401
  onResolveTaskRefs,
7257
7402
  refVersion,
7258
7403
  taskLabel,
7404
+ refLabel,
7259
7405
  mentionNames
7260
7406
  ]);
7261
7407
  (0, react.useEffect)(() => {
@@ -7264,10 +7410,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7264
7410
  const openTask = (event) => {
7265
7411
  const target = event.target;
7266
7412
  if (!(target instanceof Element)) return;
7267
- const button = target.closest("button[data-task-ref]");
7413
+ const button = target.closest("button[data-ref], button[data-task-ref]");
7268
7414
  if (button === null || !root.contains(button)) return;
7269
- const taskRef = button instanceof HTMLElement ? button.dataset.taskRef : void 0;
7270
- if (taskRef !== void 0) onOpenRef(taskRef);
7415
+ const ref = button instanceof HTMLElement ? button.dataset.ref ?? button.dataset.taskRef : void 0;
7416
+ if (ref !== void 0) onOpenRef(ref);
7271
7417
  };
7272
7418
  root.addEventListener("click", openTask);
7273
7419
  return () => {
@@ -7279,10 +7425,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7279
7425
  children: plan.inline.segments.map((segment, index) => segment.mention ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
7280
7426
  className: conversation_module_css_default.mention,
7281
7427
  children: segment.text
7282
- }, index) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: renderRefs(segment.text, onOpenRef, taskLabel) }, index))
7428
+ }, index) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: renderRefs(segment.text, onOpenRef, taskLabel, refLabel) }, index))
7283
7429
  }) : plan.render === "literal" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
7284
7430
  className: conversation_module_css_default.messageText,
7285
- children: onOpenRef === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MessageText, { text: displayBody }) : renderRefs(displayBody, onOpenRef, taskLabel)
7431
+ children: onOpenRef === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MessageText, { text: displayBody }) : renderRefs(displayBody, onOpenRef, taskLabel, refLabel)
7286
7432
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
7287
7433
  ref: markdownRef,
7288
7434
  className: conversation_module_css_default.messageMarkdown,
@@ -7387,16 +7533,27 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7387
7533
  return button;
7388
7534
  }
7389
7535
  /** Replace a whole-ref code span with its resolved Task chip once known. */
7390
- function renderResolvedMarkdownCodeRef(code, taskLabel) {
7536
+ function renderResolvedMarkdownCodeRef(code, taskLabel, refLabel) {
7391
7537
  const segments = splitBrandedRefs((code.textContent ?? "").trim());
7392
- const segment = segments.length === 1 ? segments[0] : void 0;
7393
- const taskRef = segment?.ref?.startsWith("task:") === true ? segment.ref : void 0;
7538
+ const ref = (segments.length === 1 ? segments[0] : void 0)?.ref;
7539
+ if (ref === void 0) return;
7540
+ const taskRef = ref.startsWith("task:") === true ? ref : void 0;
7394
7541
  const resolved = taskRef === void 0 ? void 0 : cachedResolvedTaskRef(taskRef);
7395
- if (taskRef === void 0 || resolved === void 0) return;
7396
- code.replaceWith(resolvedTaskRefButton(taskRef, taskLabel(resolved.taskNumber)));
7542
+ if (taskRef !== void 0 && resolved === void 0) return;
7543
+ if (taskRef !== void 0) {
7544
+ code.replaceWith(resolvedTaskRefButton(taskRef, taskLabel(resolved.taskNumber)));
7545
+ return;
7546
+ }
7547
+ const button = document.createElement("button");
7548
+ button.type = "button";
7549
+ if (conversation_module_css_default.refLink !== void 0) button.className = conversation_module_css_default.refLink;
7550
+ button.dataset.ref = ref;
7551
+ button.title = ref;
7552
+ button.textContent = refLabel(ref);
7553
+ code.replaceWith(button);
7397
7554
  }
7398
7555
  /** Replace resolved Task refs and structured mention handles in one prose text node without changing Markdown structure. */
7399
- function renderResolvedMarkdownText(node, mentionNames, taskLabel) {
7556
+ function renderResolvedMarkdownText(node, mentionNames, taskLabel, refLabel) {
7400
7557
  let changed = false;
7401
7558
  const fragment = document.createDocumentFragment();
7402
7559
  for (const refSegment of splitBrandedRefs(node.data)) {
@@ -7416,22 +7573,31 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7416
7573
  }
7417
7574
  const taskRef = refSegment.ref.startsWith("task:") === true ? refSegment.ref : void 0;
7418
7575
  const resolved = taskRef === void 0 ? void 0 : cachedResolvedTaskRef(taskRef);
7419
- if (resolved === void 0) {
7576
+ if (taskRef !== void 0 && resolved === void 0) {
7420
7577
  fragment.append(refSegment.text);
7421
7578
  continue;
7422
7579
  }
7423
7580
  changed = true;
7424
- fragment.append(resolvedTaskRefButton(taskRef, taskLabel(resolved.taskNumber)));
7581
+ if (taskRef !== void 0) fragment.append(resolvedTaskRefButton(taskRef, taskLabel(resolved.taskNumber)));
7582
+ else {
7583
+ const button = document.createElement("button");
7584
+ button.type = "button";
7585
+ if (conversation_module_css_default.refLink !== void 0) button.className = conversation_module_css_default.refLink;
7586
+ button.dataset.ref = refSegment.ref;
7587
+ button.title = refSegment.ref;
7588
+ button.textContent = refLabel(refSegment.ref);
7589
+ fragment.append(button);
7590
+ }
7425
7591
  }
7426
7592
  if (changed) node.replaceWith(fragment);
7427
7593
  }
7428
7594
  /** Render one literal text run, linkifying branded refs when navigation is available. */
7429
- function renderRefs(text, onOpenRef, taskLabel) {
7595
+ function renderRefs(text, onOpenRef, taskLabel, refLabel) {
7430
7596
  if (onOpenRef === void 0) return text;
7431
7597
  return splitBrandedRefs(text).map((segment, index) => {
7432
7598
  if (segment.ref === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: segment.text }, index);
7433
7599
  const resolved = cachedResolvedTaskRef(segment.ref);
7434
- const label = resolved !== void 0 && segment.ref.startsWith("task:") ? taskLabel(resolved.taskNumber) : segment.ref;
7600
+ const label = resolved !== void 0 && segment.ref.startsWith("task:") ? taskLabel(resolved.taskNumber) : refLabel(segment.ref);
7435
7601
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
7436
7602
  type: "button",
7437
7603
  className: conversation_module_css_default.refLink,
@@ -7805,6 +7971,27 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7805
7971
  if (ref !== channelRef) selectChannel(ref);
7806
7972
  return;
7807
7973
  }
7974
+ if (ref.startsWith("thread:")) {
7975
+ const match = view?.items.find((item) => item.thread.threadRef === ref);
7976
+ if (match !== void 0) {
7977
+ selectThread(match.thread.threadRef, channelRef, match.task?.taskRef, match.taskNumber);
7978
+ return;
7979
+ }
7980
+ loadChannels({
7981
+ workspaceId,
7982
+ threadRef: ref,
7983
+ includeActivities: false,
7984
+ limit: 1
7985
+ }).then((result) => {
7986
+ if (!result.ok) return;
7987
+ const target = result.value.items[0];
7988
+ if (target !== void 0) {
7989
+ const targetChannel = result.value.channels.find((channel) => channel.channelRef === target.message.channelRef);
7990
+ if (targetChannel !== void 0) selectThread(target.thread.threadRef, targetChannel.channelRef, target.task?.taskRef, target.taskNumber);
7991
+ }
7992
+ });
7993
+ return;
7994
+ }
7808
7995
  if (ref.startsWith("task:")) {
7809
7996
  const match = view?.items.find((item) => item.task?.taskRef === ref);
7810
7997
  if (match !== void 0) {
@@ -8550,7 +8737,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8550
8737
  const messageSender = (fact) => fact.kind === "message" ? fact.message.sender : void 0;
8551
8738
  const [pendingFiles, setPendingFiles] = (0, react.useState)([]);
8552
8739
  const openRef = (ref) => {
8553
- if (ref.startsWith("channel:") && ref !== channelRef) selectChannel(ref);
8740
+ if (ref.startsWith("channel:") && ref !== channelRef) {
8741
+ selectChannel(ref);
8742
+ return;
8743
+ }
8744
+ if (ref.startsWith("thread:") && ref !== threadRef) {
8745
+ loadChannels({
8746
+ workspaceId,
8747
+ threadRef: ref,
8748
+ includeActivities: false,
8749
+ limit: 1
8750
+ }).then((result) => {
8751
+ if (!result.ok) return;
8752
+ const target = result.value.items[0];
8753
+ if (target === void 0) return;
8754
+ const targetChannel = result.value.channels.find((channel) => channel.channelRef === target.message.channelRef);
8755
+ if (targetChannel !== void 0) selectThread(target.thread.threadRef, targetChannel.channelRef, target.task?.taskRef, target.taskNumber);
8756
+ });
8757
+ return;
8758
+ }
8554
8759
  if (ref.startsWith("task:") && ref !== taskRef) jumpToTaskThread(resolveTaskRefs, workspaceId, ref, selectThread);
8555
8760
  };
8556
8761
  const lookupTaskRefs = hostTaskRefLookup(resolveTaskRefs, workspaceId);
@@ -8894,7 +9099,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8894
9099
  children: [(() => {
8895
9100
  const activeClaims = projection?.claims.filter((claim) => claim.taskRef === task.taskRef && claim.state === "active") ?? [];
8896
9101
  const earlyAccept = task.resolution === "open" && task.status === "in_progress" && activeClaims.length > 0;
8897
- if (!(task.status === "in_review" || earlyAccept) || task.resolution !== "open") return null;
9102
+ if (!(task.status === "in_review" || task.status === "todo" || earlyAccept) || task.resolution !== "open") return null;
8898
9103
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
8899
9104
  size: "sm",
8900
9105
  variant: "primary",
@@ -9308,8 +9513,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9308
9513
  //#endregion
9309
9514
  //#region src/client/TeamSidebarSection.tsx
9310
9515
  /** Collapsible sidebar section header: disclosure toggle plus trailing actions. */
9311
- function TeamSidebarSection({ title, actions, children }) {
9312
- const [open, setOpen] = (0, react.useState)(true);
9516
+ function TeamSidebarSection({ title, actions, open, onToggle, children }) {
9313
9517
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
9314
9518
  className: sidebar_module_css_default.section,
9315
9519
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -9319,7 +9523,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9319
9523
  className: sidebar_module_css_default.sectionToggle,
9320
9524
  "aria-expanded": open,
9321
9525
  onClick: () => {
9322
- setOpen((value) => !value);
9526
+ onToggle(!open);
9323
9527
  },
9324
9528
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, { className: sidebar_module_css_default.sectionChevron }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9325
9529
  className: sidebar_module_css_default.sectionTitle,
@@ -9333,6 +9537,92 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9333
9537
  });
9334
9538
  }
9335
9539
  //#endregion
9540
+ //#region src/client/sidebar-sections.ts
9541
+ /**
9542
+ * Human presentation preference for the Team sidebar: whether each disclosure
9543
+ * section (workspaces / channels / agents) is expanded. The state lives in
9544
+ * this browser only — it is UI taste, never a shared Team fact, so nothing
9545
+ * here touches the ledger. Same storage discipline as `sidebar-order.ts`: one
9546
+ * localStorage key, defensive parsing, a read-through cache over the raw
9547
+ * payload so writes from other tabs are picked up, and an in-memory fallback
9548
+ * when storage is unavailable.
9549
+ */
9550
+ const STORAGE_KEY$1 = "dsh.agent-team.sidebar-sections";
9551
+ function sectionKey(workspaceId, kind) {
9552
+ return workspaceId === void 0 ? kind === "workspaces" ? kind : void 0 : `${workspaceId}|${kind}`;
9553
+ }
9554
+ const MEMORY_ONLY$1 = Symbol("sidebar-sections.memory");
9555
+ /** Read-through parse cache over the raw persisted payload; see `sidebar-order.ts`. */
9556
+ let cachedRaw$1;
9557
+ let cachedCollapsed = /* @__PURE__ */ new Set();
9558
+ function storedCollapsed() {
9559
+ let raw = null;
9560
+ try {
9561
+ raw = typeof localStorage === "undefined" ? null : localStorage.getItem(STORAGE_KEY$1);
9562
+ } catch {
9563
+ raw = null;
9564
+ }
9565
+ if (cachedRaw$1 !== void 0 && raw !== null && raw === cachedRaw$1) return cachedCollapsed;
9566
+ if (raw === null) {
9567
+ if (cachedRaw$1 === MEMORY_ONLY$1) return cachedCollapsed;
9568
+ cachedRaw$1 = raw;
9569
+ cachedCollapsed = /* @__PURE__ */ new Set();
9570
+ return cachedCollapsed;
9571
+ }
9572
+ try {
9573
+ const parsed = JSON.parse(raw);
9574
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) throw new Error("not an object");
9575
+ const keys = parsed.collapsed;
9576
+ if (!Array.isArray(keys) || !keys.every((key) => typeof key === "string")) throw new Error("bad shape");
9577
+ cachedRaw$1 = raw;
9578
+ cachedCollapsed = new Set(keys);
9579
+ return cachedCollapsed;
9580
+ } catch {
9581
+ return /* @__PURE__ */ new Set();
9582
+ }
9583
+ }
9584
+ function writeCollapsed(collapsed) {
9585
+ cachedCollapsed = collapsed;
9586
+ try {
9587
+ if (typeof localStorage === "undefined") throw new Error("no localStorage");
9588
+ const raw = JSON.stringify({ collapsed: [...collapsed] });
9589
+ localStorage.setItem(STORAGE_KEY$1, raw);
9590
+ cachedRaw$1 = raw;
9591
+ return;
9592
+ } catch {
9593
+ cachedRaw$1 = MEMORY_ONLY$1;
9594
+ }
9595
+ }
9596
+ const listeners$1 = /* @__PURE__ */ new Set();
9597
+ /**
9598
+ * Effective expanded state for one sidebar section: `false` only when this
9599
+ * browser explicitly collapsed it. Booleans are primitives, so the snapshot
9600
+ * is naturally identity-stable for `useSyncExternalStore`.
9601
+ */
9602
+ function useSidebarSectionOpen(workspaceId, kind) {
9603
+ const key = sectionKey(workspaceId, kind);
9604
+ return (0, react.useSyncExternalStore)((0, react.useCallback)((listener) => {
9605
+ listeners$1.add(listener);
9606
+ return () => {
9607
+ listeners$1.delete(listener);
9608
+ };
9609
+ }, []), () => key === void 0 ? true : !storedCollapsed().has(key), () => key === void 0 ? true : !storedCollapsed().has(key));
9610
+ }
9611
+ /**
9612
+ * The only mutation path: record one section's expanded state for this
9613
+ * browser. Unknown keys (missing workspace) no-op so an unloaded workspace
9614
+ * never persists a phantom preference.
9615
+ */
9616
+ function setSidebarSectionOpen(workspaceId, kind, open) {
9617
+ const key = sectionKey(workspaceId, kind);
9618
+ if (key === void 0) return;
9619
+ const next = new Set(storedCollapsed());
9620
+ if (open) next.delete(key);
9621
+ else next.add(key);
9622
+ writeCollapsed(next);
9623
+ for (const listener of listeners$1) listener();
9624
+ }
9625
+ //#endregion
9336
9626
  //#region src/client/TeamMemberAvatar.tsx
9337
9627
  /**
9338
9628
  * Sidebar Member avatar reusing the conversation identity language: the
@@ -10086,7 +10376,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10086
10376
  }
10087
10377
  //#endregion
10088
10378
  //#region src/client/TeamAgentsPanel.tsx
10089
- function TeamAgentsPanel({ workspaceId, loadMembers, subscribeChanges, loadChannels, addMember, updateMember, recoverMember, joinChannel, removeChannelMember, loadModels, memberSessionId, openMemberSession, onCreatingChange, t }) {
10379
+ function TeamAgentsPanel({ workspaceId, loadMembers, subscribeChanges, loadChannels, addMember, updateMember, recoverMember, clearMemberContext, joinChannel, removeChannelMember, loadModels, memberSessionId, openMemberSession, onCreatingChange, t }) {
10090
10380
  const [members, setMembers] = (0, react.useState)([]);
10091
10381
  const [channels, setChannels] = (0, react.useState)([]);
10092
10382
  const [channelRefs, setChannelRefs] = (0, react.useState)([]);
@@ -10111,6 +10401,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10111
10401
  refs: orderedAgentRefs,
10112
10402
  onCommit: applyMove
10113
10403
  });
10404
+ const sectionOpen = useSidebarSectionOpen(workspaceId, "agents");
10114
10405
  const refresh = (0, react.useCallback)(async () => {
10115
10406
  setLoading(true);
10116
10407
  const result = await loadMembers({ workspaceId });
@@ -10293,6 +10584,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10293
10584
  }),
10294
10585
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TeamSidebarSection, {
10295
10586
  title: t("agents"),
10587
+ open: sectionOpen,
10588
+ onToggle: (open) => {
10589
+ setSidebarSectionOpen(workspaceId, "agents", open);
10590
+ },
10296
10591
  actions: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
10297
10592
  label: t("addAgent"),
10298
10593
  delayMs: 500,
@@ -10329,6 +10624,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10329
10624
  loadChannels,
10330
10625
  updateMember,
10331
10626
  recoverMember,
10627
+ clearMemberContext,
10332
10628
  joinChannel,
10333
10629
  removeChannelMember,
10334
10630
  loadModels,
@@ -10363,9 +10659,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10363
10659
  * conversation page, the avatar carries identity plus the presence badge, and
10364
10660
  * the row menu opens the editor.
10365
10661
  */
10366
- function AgentRow({ status, current, channels, loadChannels, updateMember, recoverMember, joinChannel, removeChannelMember, loadModels, openMemberSession, onUpdated, t }) {
10662
+ function AgentRow({ status, current, channels, loadChannels, updateMember, recoverMember, clearMemberContext, joinChannel, removeChannelMember, loadModels, openMemberSession, onUpdated, t }) {
10367
10663
  const [menuOpen, setMenuOpen] = (0, react.useState)(false);
10368
10664
  const [editing, setEditing] = (0, react.useState)(false);
10665
+ const [clearing, setClearing] = (0, react.useState)(false);
10369
10666
  const [rowAlert, setRowAlert] = (0, react.useState)();
10370
10667
  const recover = async () => {
10371
10668
  try {
@@ -10389,6 +10686,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10389
10686
  setRowAlert(t("restartFailed", { message: cause instanceof Error ? cause.message : String(cause) }));
10390
10687
  }
10391
10688
  };
10689
+ const clearContext = async () => {
10690
+ try {
10691
+ const result = await clearMemberContext({
10692
+ requestId: mintRequestId(),
10693
+ workspaceId: status.member.workspaceId,
10694
+ memberId: status.member.memberId
10695
+ });
10696
+ await onUpdated();
10697
+ if (!result.ok) {
10698
+ setRowAlert(t("clearContextFailed", { message: result.error.message }));
10699
+ return;
10700
+ }
10701
+ setRowAlert(void 0);
10702
+ if (current === true) openMemberSession(result.value.status.member.sessionId);
10703
+ } catch (cause) {
10704
+ setRowAlert(t("clearContextFailed", { message: cause instanceof Error ? cause.message : String(cause) }));
10705
+ }
10706
+ };
10707
+ const contextClearable = status.presence === "available" || status.presence === "error";
10392
10708
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
10393
10709
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
10394
10710
  className: sidebar_module_css_default.agentRow,
@@ -10428,10 +10744,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10428
10744
  id: "restart",
10429
10745
  label: t("restartAgent"),
10430
10746
  icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutline16, {})
10747
+ }] : [],
10748
+ {
10749
+ id: "clear-context",
10750
+ label: t("clearContextAgent"),
10751
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconNewChatOutline16, {}),
10752
+ danger: true,
10753
+ disabled: !contextClearable
10754
+ },
10755
+ ...!contextClearable ? [{
10756
+ type: "label",
10757
+ id: "clear-context-reason",
10758
+ text: status.presence === "working" ? t("clearContextWorkingReason") : t("clearContextUnavailableReason")
10431
10759
  }] : []
10432
10760
  ],
10433
10761
  onSelect: (id) => {
10434
10762
  if (id === "edit") setEditing(true);
10763
+ else if (id === "clear-context") setClearing(true);
10435
10764
  else recover();
10436
10765
  },
10437
10766
  onOpenChange: setMenuOpen
@@ -10443,6 +10772,33 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10443
10772
  role: "alert",
10444
10773
  children: rowAlert
10445
10774
  }),
10775
+ clearing && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
10776
+ open: true,
10777
+ onClose: () => {
10778
+ setClearing(false);
10779
+ },
10780
+ title: t("clearContextTitle", { name: status.member.handle }),
10781
+ closeLabel: t("close"),
10782
+ contentClassName: create_module_css_default.dialogContent,
10783
+ footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
10784
+ variant: "outline",
10785
+ onClick: () => {
10786
+ setClearing(false);
10787
+ },
10788
+ children: t("cancel")
10789
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
10790
+ variant: "primary",
10791
+ onClick: () => {
10792
+ setClearing(false);
10793
+ clearContext();
10794
+ },
10795
+ children: t("clearContextConfirm")
10796
+ })] }),
10797
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
10798
+ className: create_module_css_default.error,
10799
+ children: t("clearContextNotice", { name: status.member.handle })
10800
+ })
10801
+ }),
10446
10802
  editing && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AgentEditorDialog, {
10447
10803
  status,
10448
10804
  channels,
@@ -10487,6 +10843,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10487
10843
  refs: orderedChannelRefs,
10488
10844
  onCommit: applyMove
10489
10845
  });
10846
+ const sectionOpen = useSidebarSectionOpen(workspaceId, "channels");
10490
10847
  const refresh = (0, react.useCallback)(async () => {
10491
10848
  setLoading(true);
10492
10849
  const [channelResult, memberResult] = await Promise.all([loadChannels({
@@ -10679,6 +11036,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10679
11036
  }),
10680
11037
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TeamSidebarSection, {
10681
11038
  title: t("channels"),
11039
+ open: sectionOpen,
11040
+ onToggle: (open) => {
11041
+ setSidebarSectionOpen(workspaceId, "channels", open);
11042
+ },
10682
11043
  actions: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
10683
11044
  label: t("addChannel"),
10684
11045
  delayMs: 500,
@@ -10938,7 +11299,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10938
11299
  }
10939
11300
  //#endregion
10940
11301
  //#region src/client/TeamWorkspaceBrowser.tsx
10941
- function TeamWorkspaceBrowser({ wide, expandSidebar, navigation, selectWorkspace, selectChannel, t, useWorkspaces, loadMembers, subscribeChanges, addMember, loadChannels, createChannel, updateChannel, updateMember, recoverMember, joinChannel, removeChannelMember, loadModels, openMemberSession }) {
11302
+ function TeamWorkspaceBrowser({ wide, expandSidebar, navigation, selectWorkspace, selectChannel, t, useWorkspaces, loadMembers, subscribeChanges, addMember, loadChannels, createChannel, updateChannel, updateMember, recoverMember, clearMemberContext, joinChannel, removeChannelMember, loadModels, openMemberSession }) {
10942
11303
  const navigationState = (0, react.useSyncExternalStore)(navigation.subscribe, navigation.getSnapshot, navigation.getSnapshot);
10943
11304
  const workspaces = useWorkspaces((state) => state.items);
10944
11305
  const selected = navigationState.workspaceId;
@@ -10948,6 +11309,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10948
11309
  const [pendingSection, setPendingSection] = (0, react.useState)();
10949
11310
  const channelsRef = (0, react.useRef)(null);
10950
11311
  const agentsRef = (0, react.useRef)(null);
11312
+ const workspacesOpen = useSidebarSectionOpen(void 0, "workspaces");
10951
11313
  (0, react.useEffect)(() => {
10952
11314
  if (navigationState.mode === "team" && selectedId !== void 0 && selectedId !== selected) selectWorkspace(selectedId);
10953
11315
  }, [
@@ -11000,6 +11362,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11000
11362
  "aria-label": t("workspaces"),
11001
11363
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamSidebarSection, {
11002
11364
  title: t("workspaces"),
11365
+ open: workspacesOpen,
11366
+ onToggle: (open) => {
11367
+ setSidebarSectionOpen(void 0, "workspaces", open);
11368
+ },
11003
11369
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11004
11370
  className: sidebar_module_css_default.workspaceList,
11005
11371
  children: [workspaces.map((workspace) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamWorkspaceRow, {
@@ -11042,6 +11408,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11042
11408
  addMember,
11043
11409
  updateMember,
11044
11410
  recoverMember,
11411
+ clearMemberContext,
11045
11412
  joinChannel,
11046
11413
  removeChannelMember,
11047
11414
  loadModels,
@@ -11186,7 +11553,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11186
11553
  setSubmissionNotice("Compact 未执行,请重试。");
11187
11554
  return;
11188
11555
  }
11189
- if (input.phase === "plain") compactWasSubmitting.current = false;
11556
+ if (input.phase === "plain") {
11557
+ if (compactWasSubmitting.current) setSubmissionNotice(void 0);
11558
+ compactWasSubmitting.current = false;
11559
+ }
11190
11560
  }, [input?.claim?.token, input?.phase]);
11191
11561
  (0, react.useEffect)(() => {
11192
11562
  if (input === void 0) return;
@@ -11222,6 +11592,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11222
11592
  const onKeyDown = (event) => {
11223
11593
  if (event.key === "Enter" && event.shiftKey) return;
11224
11594
  if (event.repeat || composing.current || event.nativeEvent.isComposing || event.nativeEvent.keyCode === 229) return;
11595
+ if (event.key === "Tab" && !event.shiftKey) {
11596
+ const highlight = controller.menu.getSnapshot().highlight;
11597
+ if (highlight !== null) {
11598
+ event.preventDefault();
11599
+ controller.pick(highlight.source, highlight.index);
11600
+ }
11601
+ return;
11602
+ }
11225
11603
  const key = event.key === "ArrowUp" ? "up" : event.key === "ArrowDown" ? "down" : event.key === "Escape" ? "escape" : event.key === "Enter" ? "enter" : void 0;
11226
11604
  if (key !== void 0) {
11227
11605
  if (controller.arbitrate(key, false) !== "pass") {
@@ -11354,6 +11732,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11354
11732
  restartAgent: "重启",
11355
11733
  restartStillUnavailable: "重启已执行,成员仍不可用:{diagnostic}",
11356
11734
  restartFailed: "重启执行失败:{message}",
11735
+ clearContextAgent: "从全新上下文开始",
11736
+ clearContextWorkingReason: "成员正在工作中,完成后才能清空上下文",
11737
+ clearContextUnavailableReason: "成员当前不可用,恢复在线且空闲后才能清空上下文",
11738
+ clearContextTitle: "从全新上下文开始:{name}",
11739
+ clearContextNotice: "将结束 {name} 当前的会话上下文并从空白开始:旧对话会归档保留在会话记录中。{name} 的身份、私有记忆与 notes、频道和会话绑定都保持不变,后续协作从新上下文继续累积。",
11740
+ clearContextConfirm: "开始全新上下文",
11741
+ clearContextFailed: "清空上下文失败:{message}",
11357
11742
  optionalSuffix: "(可选)",
11358
11743
  agentDescriptionPlaceholder: "留空则暂无描述",
11359
11744
  channelsPickerEmpty: "选择初始频道",
@@ -11406,6 +11791,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11406
11791
  promoteToTask: "转为 Task",
11407
11792
  promotingTask: "正在转为 Task…",
11408
11793
  mentionSuggestions: "提及成员建议",
11794
+ mentionAll: "通知所有成员({count})",
11409
11795
  messageDraft: "消息内容",
11410
11796
  composerNotify: "将通知:{ids}",
11411
11797
  messagePlaceholder: "写一条消息…",
@@ -11494,6 +11880,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11494
11880
  restartAgent: "Restart",
11495
11881
  restartStillUnavailable: "Restart ran, but the Member is still unavailable: {diagnostic}",
11496
11882
  restartFailed: "Restart failed: {message}",
11883
+ clearContextAgent: "Start from new context",
11884
+ clearContextWorkingReason: "The Member is working; clear once the current turn ends",
11885
+ clearContextUnavailableReason: "The Member is unavailable; only an idle available Member can start from a new context",
11886
+ clearContextTitle: "Start from new context: {name}",
11887
+ clearContextNotice: "This ends {name}'s current session context and starts blank: the previous conversation is archived and stays in the session history. {name}'s identity, private memory and notes, channel and session bindings are untouched, and future collaboration accumulates from the new context.",
11888
+ clearContextConfirm: "Start from new context",
11889
+ clearContextFailed: "Failed to clear context: {message}",
11497
11890
  optionalSuffix: " (optional)",
11498
11891
  agentDescriptionPlaceholder: "Leave empty if not needed",
11499
11892
  channelsPickerEmpty: "Choose initial channels",
@@ -11546,6 +11939,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11546
11939
  promoteToTask: "Convert to Task",
11547
11940
  promotingTask: "Converting to Task…",
11548
11941
  mentionSuggestions: "Mention suggestions",
11942
+ mentionAll: "Notify all members ({count})",
11549
11943
  messageDraft: "Message",
11550
11944
  composerNotify: "Will notify: {ids}",
11551
11945
  messagePlaceholder: "Write a message…",
@@ -11606,6 +12000,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11606
12000
  "inputTriggers"
11607
12001
  ];
11608
12002
  function registerModeShadow(ctx, navigation, changes, drafts, name, component, extraInject) {
12003
+ const openMemberSessionImpl = (sessionId) => {
12004
+ const sessions = ctx.sessions;
12005
+ const snapshot = navigation.getSnapshot();
12006
+ const current = sessions.list.getSnapshot().current;
12007
+ const returnTo = snapshot.memberSessionId === void 0 && current !== void 0 && current !== sessionId ? current : void 0;
12008
+ navigation.actions().enterMemberSession(sessionId, returnTo);
12009
+ sessions.open(sessionId);
12010
+ };
11609
12011
  const sharedRemotes = {
11610
12012
  loadChannels: (request) => ctx.remote.agentTeam.view(request),
11611
12013
  subscribeChanges: (scope, listener) => changes.subscribe(scope, listener),
@@ -11616,17 +12018,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11616
12018
  updateChannel: (request) => ctx.remote.agentTeam.updateChannel(request),
11617
12019
  updateMember: (request) => ctx.remote.agentTeam.updateMember(request),
11618
12020
  recoverMember: (request) => ctx.remote.agentTeam.recoverMember(request),
12021
+ clearMemberContext: (request) => ctx.remote.agentTeam.clearMemberContext(request),
11619
12022
  loadModels: async () => {
11620
12023
  return (await ctx.get("connection").api.llm.models({})).result;
11621
12024
  },
11622
- openMemberSession: (sessionId) => {
11623
- const sessions = ctx.sessions;
11624
- const snapshot = navigation.getSnapshot();
11625
- const current = sessions.list.getSnapshot().current;
11626
- const returnTo = snapshot.memberSessionId === void 0 && current !== void 0 && current !== sessionId ? current : void 0;
11627
- navigation.actions().enterMemberSession(sessionId, returnTo);
11628
- sessions.open(sessionId);
11629
- }
12025
+ openMemberSession: openMemberSessionImpl
11630
12026
  };
11631
12027
  ctx.slots.inject(name, () => {
11632
12028
  let dispose;