@wowyuarm/dsh-agent-team 0.1.4 → 0.1.6

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 (77) hide show
  1. package/README.md +15 -1
  2. package/README.zh.md +20 -3
  3. package/package.json +7 -2
  4. package/packages/agent-team/README.md +6 -0
  5. package/packages/agent-team/README.zh.md +6 -0
  6. package/packages/agent-team/core-skills/member-skill-manager/SKILL.md +41 -0
  7. package/packages/agent-team/core-skills/member-skill-manager/references/auth-and-config.md +30 -0
  8. package/packages/agent-team/core-skills/member-skill-manager/references/writing-great-skills.md +17 -0
  9. package/packages/agent-team/lib/auto-compaction.js +39 -1
  10. package/packages/agent-team/lib/index.js +340 -7
  11. package/packages/agent-team/lib/ledger.js +219 -7
  12. package/packages/agent-team/lib/member-context.js +2 -2
  13. package/packages/agent-team/lib/member-skills.js +94 -0
  14. package/packages/agent-team/lib/spec.js +38 -0
  15. package/packages/agent-team/lib/typert.host.js +202 -27
  16. package/packages/agent-team/lib/typert.remote-client.d.ts +3 -1
  17. package/packages/agent-team/lib/typert.remote-client.d.ts.map +1 -1
  18. package/packages/agent-team/lib/typert.remote-client.js +155 -22
  19. package/packages/agent-team/lib/types/auto-compaction.d.ts +9 -0
  20. package/packages/agent-team/lib/types/auto-compaction.d.ts.map +1 -1
  21. package/packages/agent-team/lib/types/index.d.ts +81 -1
  22. package/packages/agent-team/lib/types/index.d.ts.map +1 -1
  23. package/packages/agent-team/lib/types/ledger.d.ts +49 -1
  24. package/packages/agent-team/lib/types/ledger.d.ts.map +1 -1
  25. package/packages/agent-team/lib/types/member-skills.d.ts +45 -0
  26. package/packages/agent-team/lib/types/member-skills.d.ts.map +1 -0
  27. package/packages/agent-team/lib/types/spec.d.ts.map +1 -1
  28. package/packages/agent-team/lib/types/types.d.ts +127 -2
  29. package/packages/agent-team/lib/types/types.d.ts.map +1 -1
  30. package/packages/agent-team/preset/team-member/agent.cordis.yml +7 -4
  31. package/packages/client-agent-team/README.md +1 -1
  32. package/packages/client-agent-team/README.zh.md +1 -1
  33. package/packages/client-agent-team/lib/client.js +677 -363
  34. package/packages/client-agent-team/lib/client.js.map +1 -1
  35. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts +2 -4
  36. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts.map +1 -1
  37. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.js +48 -24
  38. package/packages/client-agent-team/lib/types/client/TeamChannelPage.d.ts.map +1 -1
  39. package/packages/client-agent-team/lib/types/client/TeamChannelPage.js +20 -0
  40. package/packages/client-agent-team/lib/types/client/TeamChannelsPanel.d.ts.map +1 -1
  41. package/packages/client-agent-team/lib/types/client/TeamChannelsPanel.js +3 -1
  42. package/packages/client-agent-team/lib/types/client/TeamComposer.d.ts.map +1 -1
  43. package/packages/client-agent-team/lib/types/client/TeamComposer.js +73 -17
  44. package/packages/client-agent-team/lib/types/client/TeamMemberEditor.d.ts +4 -8
  45. package/packages/client-agent-team/lib/types/client/TeamMemberEditor.d.ts.map +1 -1
  46. package/packages/client-agent-team/lib/types/client/TeamMemberEditor.js +7 -40
  47. package/packages/client-agent-team/lib/types/client/TeamMemberSessionComposer.d.ts.map +1 -1
  48. package/packages/client-agent-team/lib/types/client/TeamMemberSessionComposer.js +16 -1
  49. package/packages/client-agent-team/lib/types/client/TeamMessage.d.ts.map +1 -1
  50. package/packages/client-agent-team/lib/types/client/TeamMessage.js +48 -18
  51. package/packages/client-agent-team/lib/types/client/TeamRowMenu.d.ts +3 -2
  52. package/packages/client-agent-team/lib/types/client/TeamRowMenu.d.ts.map +1 -1
  53. package/packages/client-agent-team/lib/types/client/TeamSidebarSection.d.ts +5 -2
  54. package/packages/client-agent-team/lib/types/client/TeamSidebarSection.d.ts.map +1 -1
  55. package/packages/client-agent-team/lib/types/client/TeamSidebarSection.js +2 -4
  56. package/packages/client-agent-team/lib/types/client/TeamThreadPage.d.ts.map +1 -1
  57. package/packages/client-agent-team/lib/types/client/TeamThreadPage.js +82 -22
  58. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts +1 -1
  59. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts.map +1 -1
  60. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.js +4 -2
  61. package/packages/client-agent-team/lib/types/client/index.d.ts.map +1 -1
  62. package/packages/client-agent-team/lib/types/client/index.js +15 -13
  63. package/packages/client-agent-team/lib/types/client/locales.d.ts +20 -16
  64. package/packages/client-agent-team/lib/types/client/locales.d.ts.map +1 -1
  65. package/packages/client-agent-team/lib/types/client/locales.js +20 -16
  66. package/packages/client-agent-team/lib/types/client/sidebar-sections.d.ts +16 -0
  67. package/packages/client-agent-team/lib/types/client/sidebar-sections.d.ts.map +1 -0
  68. package/packages/client-agent-team/lib/types/client/sidebar-sections.js +102 -0
  69. package/packages/client-agent-team/lib/types/client/slots.d.ts +2 -1
  70. package/packages/client-agent-team/lib/types/client/slots.d.ts.map +1 -1
  71. package/packages/client-agent-team/lib/types/client/team-formatters.d.ts.map +1 -1
  72. package/packages/client-agent-team/lib/types/client/team-formatters.js +9 -2
  73. package/packages/client-agent-team/lib/types/client/timeline-scroll.d.ts +5 -7
  74. package/packages/client-agent-team/lib/types/client/timeline-scroll.d.ts.map +1 -1
  75. package/packages/client-agent-team/lib/types/client/timeline-scroll.js +9 -22
  76. package/packages/tool-agent-team/lib/index.js +25 -5
  77. package/packages/tool-agent-team/lib/types/index.d.ts.map +1 -1
@@ -4092,6 +4092,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4092
4092
  "model": string().readonly(),
4093
4093
  "reasoningEffort": intersection(string(), unknown()).readonly().optional()
4094
4094
  }).readonly().optional(),
4095
+ "capabilities": object({
4096
+ "tools": union([_undefined(), object({ "allow": array(string()).readonly().optional() })]).readonly().optional(),
4097
+ "skills": union([_undefined(), object({ "allow": array(string()).readonly().optional() })]).readonly().optional()
4098
+ }).readonly().optional(),
4095
4099
  "channelRefs": array(intersection(string(), unknown())).readonly()
4096
4100
  });
4097
4101
  const _wowyuarm_dsh_agent_team_agentTeam_addMember_result$schema = object({
@@ -4113,6 +4117,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4113
4117
  "model": string().readonly(),
4114
4118
  "reasoningEffort": intersection(string(), unknown()).readonly().optional()
4115
4119
  })]).readonly().optional(),
4120
+ "capabilities": union([_undefined(), object({
4121
+ "tools": union([_undefined(), object({ "allow": array(string()).readonly().optional() })]).readonly().optional(),
4122
+ "skills": union([_undefined(), object({ "allow": array(string()).readonly().optional() })]).readonly().optional()
4123
+ })]).readonly().optional(),
4116
4124
  "privateMemoryPath": string().readonly(),
4117
4125
  "state": union([
4118
4126
  literal("enabled"),
@@ -4132,7 +4140,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4132
4140
  literal("working"),
4133
4141
  literal("error")
4134
4142
  ]).readonly(),
4135
- "diagnostic": string().readonly().optional()
4143
+ "diagnostic": string().readonly().optional(),
4144
+ "capabilityWarnings": union([_undefined(), array(object({
4145
+ "name": string().readonly(),
4146
+ "knownNames": array(string()).readonly()
4147
+ }))]).readonly().optional()
4136
4148
  }).readonly()
4137
4149
  });
4138
4150
  const _wowyuarm_dsh_agent_team_agentTeam_changeAttention_parameter_0$schema = object({
@@ -4281,6 +4293,60 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4281
4293
  "revision": number().readonly()
4282
4294
  })
4283
4295
  ]);
4296
+ const _wowyuarm_dsh_agent_team_agentTeam_clearMemberContext_parameter_0$schema = object({
4297
+ "requestId": intersection(string(), unknown()).readonly(),
4298
+ "workspaceId": intersection(string(), unknown()).readonly(),
4299
+ "memberId": intersection(string(), unknown()).readonly()
4300
+ });
4301
+ const _wowyuarm_dsh_agent_team_agentTeam_clearMemberContext_result$schema = object({
4302
+ "receipt": object({
4303
+ "operationId": intersection(string(), unknown()).readonly(),
4304
+ "requestId": intersection(string(), unknown()).readonly(),
4305
+ "sequence": number().readonly()
4306
+ }).readonly(),
4307
+ "status": object({
4308
+ "member": object({
4309
+ "memberId": intersection(string(), unknown()).readonly(),
4310
+ "sessionId": intersection(string(), unknown()).readonly(),
4311
+ "workspaceId": intersection(string(), unknown()).readonly(),
4312
+ "handle": string().readonly(),
4313
+ "description": string().readonly(),
4314
+ "presetId": string().readonly(),
4315
+ "model": union([_undefined(), object({
4316
+ "provider": string().readonly(),
4317
+ "model": string().readonly(),
4318
+ "reasoningEffort": intersection(string(), unknown()).readonly().optional()
4319
+ })]).readonly().optional(),
4320
+ "capabilities": union([_undefined(), object({
4321
+ "tools": union([_undefined(), object({ "allow": array(string()).readonly().optional() })]).readonly().optional(),
4322
+ "skills": union([_undefined(), object({ "allow": array(string()).readonly().optional() })]).readonly().optional()
4323
+ })]).readonly().optional(),
4324
+ "privateMemoryPath": string().readonly(),
4325
+ "state": union([
4326
+ literal("enabled"),
4327
+ literal("suspended"),
4328
+ literal("inactive")
4329
+ ]).readonly()
4330
+ }).readonly(),
4331
+ "availability": union([
4332
+ literal("suspended"),
4333
+ literal("inactive"),
4334
+ literal("active"),
4335
+ literal("unavailable")
4336
+ ]).readonly(),
4337
+ "presence": union([
4338
+ literal("unavailable"),
4339
+ literal("available"),
4340
+ literal("working"),
4341
+ literal("error")
4342
+ ]).readonly(),
4343
+ "diagnostic": string().readonly().optional(),
4344
+ "capabilityWarnings": union([_undefined(), array(object({
4345
+ "name": string().readonly(),
4346
+ "knownNames": array(string()).readonly()
4347
+ }))]).readonly().optional()
4348
+ }).readonly()
4349
+ });
4284
4350
  const _wowyuarm_dsh_agent_team_agentTeam_createChannel_parameter_0$schema = object({
4285
4351
  "requestId": intersection(string(), unknown()).readonly(),
4286
4352
  "workspaceId": intersection(string(), unknown()).readonly(),
@@ -4381,6 +4447,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4381
4447
  "model": string().readonly(),
4382
4448
  "reasoningEffort": intersection(string(), unknown()).readonly().optional()
4383
4449
  })]).readonly().optional(),
4450
+ "capabilities": union([_undefined(), object({
4451
+ "tools": union([_undefined(), object({ "allow": array(string()).readonly().optional() })]).readonly().optional(),
4452
+ "skills": union([_undefined(), object({ "allow": array(string()).readonly().optional() })]).readonly().optional()
4453
+ })]).readonly().optional(),
4384
4454
  "state": union([
4385
4455
  literal("enabled"),
4386
4456
  literal("suspended"),
@@ -4399,7 +4469,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4399
4469
  literal("working"),
4400
4470
  literal("error")
4401
4471
  ]).readonly(),
4402
- "diagnostic": string().readonly().optional()
4472
+ "diagnostic": string().readonly().optional(),
4473
+ "capabilityWarnings": union([_undefined(), array(object({
4474
+ "name": string().readonly(),
4475
+ "knownNames": array(string()).readonly()
4476
+ }))]).readonly().optional()
4403
4477
  }));
4404
4478
  const _wowyuarm_dsh_agent_team_agentTeam_promoteThread_parameter_0$schema = object({
4405
4479
  "requestId": intersection(string(), unknown()).readonly(),
@@ -4649,6 +4723,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4649
4723
  "model": string().readonly(),
4650
4724
  "reasoningEffort": intersection(string(), unknown()).readonly().optional()
4651
4725
  })]).readonly().optional(),
4726
+ "capabilities": union([_undefined(), object({
4727
+ "tools": union([_undefined(), object({ "allow": array(string()).readonly().optional() })]).readonly().optional(),
4728
+ "skills": union([_undefined(), object({ "allow": array(string()).readonly().optional() })]).readonly().optional()
4729
+ })]).readonly().optional(),
4652
4730
  "privateMemoryPath": string().readonly(),
4653
4731
  "state": union([
4654
4732
  literal("enabled"),
@@ -4668,7 +4746,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4668
4746
  literal("working"),
4669
4747
  literal("error")
4670
4748
  ]).readonly(),
4671
- "diagnostic": string().readonly().optional()
4749
+ "diagnostic": string().readonly().optional(),
4750
+ "capabilityWarnings": union([_undefined(), array(object({
4751
+ "name": string().readonly(),
4752
+ "knownNames": array(string()).readonly()
4753
+ }))]).readonly().optional()
4672
4754
  }).readonly() });
4673
4755
  const _wowyuarm_dsh_agent_team_agentTeam_removeChannelMember_parameter_0$schema = object({
4674
4756
  "requestId": intersection(string(), unknown()).readonly(),
@@ -5081,6 +5163,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5081
5163
  "provider": string().readonly(),
5082
5164
  "model": string().readonly(),
5083
5165
  "reasoningEffort": intersection(string(), unknown()).readonly().optional()
5166
+ }).readonly().optional(),
5167
+ "capabilities": object({
5168
+ "tools": union([_undefined(), object({ "allow": array(string()).readonly().optional() })]).readonly().optional(),
5169
+ "skills": union([_undefined(), object({ "allow": array(string()).readonly().optional() })]).readonly().optional()
5084
5170
  }).readonly().optional()
5085
5171
  });
5086
5172
  const _wowyuarm_dsh_agent_team_agentTeam_updateMember_result$schema = object({
@@ -5102,6 +5188,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5102
5188
  "model": string().readonly(),
5103
5189
  "reasoningEffort": intersection(string(), unknown()).readonly().optional()
5104
5190
  })]).readonly().optional(),
5191
+ "capabilities": union([_undefined(), object({
5192
+ "tools": union([_undefined(), object({ "allow": array(string()).readonly().optional() })]).readonly().optional(),
5193
+ "skills": union([_undefined(), object({ "allow": array(string()).readonly().optional() })]).readonly().optional()
5194
+ })]).readonly().optional(),
5105
5195
  "privateMemoryPath": string().readonly(),
5106
5196
  "state": union([
5107
5197
  literal("enabled"),
@@ -5121,7 +5211,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5121
5211
  literal("working"),
5122
5212
  literal("error")
5123
5213
  ]).readonly(),
5124
- "diagnostic": string().readonly().optional()
5214
+ "diagnostic": string().readonly().optional(),
5215
+ "capabilityWarnings": union([_undefined(), array(object({
5216
+ "name": string().readonly(),
5217
+ "knownNames": array(string()).readonly()
5218
+ }))]).readonly().optional()
5125
5219
  }).readonly()
5126
5220
  });
5127
5221
  const _wowyuarm_dsh_agent_team_agentTeam_view_parameter_0$schema = object({
@@ -5298,7 +5392,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5298
5392
  },
5299
5393
  sourceLocation: {
5300
5394
  "file": "packages/agent-team/src/index.ts",
5301
- "line": 380,
5395
+ "line": 460,
5302
5396
  "column": 9
5303
5397
  }
5304
5398
  },
@@ -5325,7 +5419,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5325
5419
  },
5326
5420
  sourceLocation: {
5327
5421
  "file": "packages/agent-team/src/index.ts",
5328
- "line": 664,
5422
+ "line": 848,
5329
5423
  "column": 9
5330
5424
  }
5331
5425
  },
@@ -5353,7 +5447,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5353
5447
  },
5354
5448
  sourceLocation: {
5355
5449
  "file": "packages/agent-team/src/index.ts",
5356
- "line": 317,
5450
+ "line": 397,
5357
5451
  "column": 9
5358
5452
  }
5359
5453
  },
@@ -5380,7 +5474,34 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5380
5474
  },
5381
5475
  sourceLocation: {
5382
5476
  "file": "packages/agent-team/src/index.ts",
5383
- "line": 554,
5477
+ "line": 738,
5478
+ "column": 9
5479
+ }
5480
+ },
5481
+ {
5482
+ id: "@wowyuarm/dsh-agent-team#agentTeam/clearMemberContext",
5483
+ service: "agentTeam",
5484
+ namespace: "agentTeam",
5485
+ method: "clearMemberContext",
5486
+ invocation: { kind: "direct" },
5487
+ parameters: [{
5488
+ name: "request",
5489
+ wire: "request",
5490
+ source: "json",
5491
+ codec: {
5492
+ mode: "strict",
5493
+ typeSymbol: "@wowyuarm/dsh-agent-team/types#AgentTeamClearMemberContextRequest",
5494
+ schema: _wowyuarm_dsh_agent_team_agentTeam_clearMemberContext_parameter_0$schema
5495
+ }
5496
+ }],
5497
+ result: {
5498
+ mode: "strict",
5499
+ typeSymbol: "@wowyuarm/dsh-agent-team/types#AgentTeamClearMemberContextResult",
5500
+ schema: _wowyuarm_dsh_agent_team_agentTeam_clearMemberContext_result$schema
5501
+ },
5502
+ sourceLocation: {
5503
+ "file": "packages/agent-team/src/index.ts",
5504
+ "line": 553,
5384
5505
  "column": 9
5385
5506
  }
5386
5507
  },
@@ -5407,7 +5528,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5407
5528
  },
5408
5529
  sourceLocation: {
5409
5530
  "file": "packages/agent-team/src/index.ts",
5410
- "line": 358,
5531
+ "line": 438,
5411
5532
  "column": 9
5412
5533
  }
5413
5534
  },
@@ -5434,7 +5555,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5434
5555
  },
5435
5556
  sourceLocation: {
5436
5557
  "file": "packages/agent-team/src/index.ts",
5437
- "line": 650,
5558
+ "line": 834,
5438
5559
  "column": 9
5439
5560
  }
5440
5561
  },
@@ -5461,7 +5582,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5461
5582
  },
5462
5583
  sourceLocation: {
5463
5584
  "file": "packages/agent-team/src/index.ts",
5464
- "line": 673,
5585
+ "line": 857,
5465
5586
  "column": 3
5466
5587
  }
5467
5588
  },
@@ -5488,7 +5609,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5488
5609
  },
5489
5610
  sourceLocation: {
5490
5611
  "file": "packages/agent-team/src/index.ts",
5491
- "line": 574,
5612
+ "line": 758,
5492
5613
  "column": 9
5493
5614
  }
5494
5615
  },
@@ -5516,7 +5637,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5516
5637
  },
5517
5638
  sourceLocation: {
5518
5639
  "file": "packages/agent-team/src/index.ts",
5519
- "line": 308,
5640
+ "line": 388,
5520
5641
  "column": 3
5521
5642
  }
5522
5643
  },
@@ -5543,7 +5664,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5543
5664
  },
5544
5665
  sourceLocation: {
5545
5666
  "file": "packages/agent-team/src/index.ts",
5546
- "line": 564,
5667
+ "line": 748,
5547
5668
  "column": 9
5548
5669
  }
5549
5670
  },
@@ -5570,7 +5691,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5570
5691
  },
5571
5692
  sourceLocation: {
5572
5693
  "file": "packages/agent-team/src/index.ts",
5573
- "line": 637,
5694
+ "line": 821,
5574
5695
  "column": 9
5575
5696
  }
5576
5697
  },
@@ -5597,7 +5718,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5597
5718
  },
5598
5719
  sourceLocation: {
5599
5720
  "file": "packages/agent-team/src/index.ts",
5600
- "line": 680,
5721
+ "line": 864,
5601
5722
  "column": 9
5602
5723
  }
5603
5724
  },
@@ -5624,7 +5745,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5624
5745
  },
5625
5746
  sourceLocation: {
5626
5747
  "file": "packages/agent-team/src/index.ts",
5627
- "line": 433,
5748
+ "line": 514,
5628
5749
  "column": 9
5629
5750
  }
5630
5751
  },
@@ -5651,7 +5772,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5651
5772
  },
5652
5773
  sourceLocation: {
5653
5774
  "file": "packages/agent-team/src/index.ts",
5654
- "line": 585,
5775
+ "line": 769,
5655
5776
  "column": 9
5656
5777
  }
5657
5778
  },
@@ -5678,7 +5799,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5678
5799
  },
5679
5800
  sourceLocation: {
5680
5801
  "file": "packages/agent-team/src/index.ts",
5681
- "line": 658,
5802
+ "line": 842,
5682
5803
  "column": 9
5683
5804
  }
5684
5805
  },
@@ -5705,7 +5826,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5705
5826
  },
5706
5827
  sourceLocation: {
5707
5828
  "file": "packages/agent-team/src/index.ts",
5708
- "line": 295,
5829
+ "line": 375,
5709
5830
  "column": 3
5710
5831
  }
5711
5832
  },
@@ -5732,7 +5853,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5732
5853
  },
5733
5854
  sourceLocation: {
5734
5855
  "file": "packages/agent-team/src/index.ts",
5735
- "line": 594,
5856
+ "line": 778,
5736
5857
  "column": 9
5737
5858
  }
5738
5859
  },
@@ -5759,7 +5880,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5759
5880
  },
5760
5881
  sourceLocation: {
5761
5882
  "file": "packages/agent-team/src/index.ts",
5762
- "line": 696,
5883
+ "line": 880,
5763
5884
  "column": 3
5764
5885
  }
5765
5886
  },
@@ -5786,7 +5907,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5786
5907
  },
5787
5908
  sourceLocation: {
5788
5909
  "file": "packages/agent-team/src/index.ts",
5789
- "line": 689,
5910
+ "line": 873,
5790
5911
  "column": 3
5791
5912
  }
5792
5913
  },
@@ -5813,7 +5934,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5813
5934
  },
5814
5935
  sourceLocation: {
5815
5936
  "file": "packages/agent-team/src/index.ts",
5816
- "line": 370,
5937
+ "line": 450,
5817
5938
  "column": 9
5818
5939
  }
5819
5940
  },
@@ -5840,7 +5961,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5840
5961
  },
5841
5962
  sourceLocation: {
5842
5963
  "file": "packages/agent-team/src/index.ts",
5843
- "line": 524,
5964
+ "line": 665,
5844
5965
  "column": 9
5845
5966
  }
5846
5967
  },
@@ -5867,7 +5988,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5867
5988
  },
5868
5989
  sourceLocation: {
5869
5990
  "file": "packages/agent-team/src/index.ts",
5870
- "line": 703,
5991
+ "line": 887,
5871
5992
  "column": 3
5872
5993
  }
5873
5994
  }
@@ -5875,7 +5996,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5875
5996
  };
5876
5997
  //#endregion
5877
5998
  //#region src/client/navigation.ts
5878
- const STORAGE_KEY$2 = "dsh.agent-team.navigation";
5999
+ const STORAGE_KEY$3 = "dsh.agent-team.navigation";
5879
6000
  function readSnapshot() {
5880
6001
  if (typeof localStorage === "undefined") return { mode: "conversation" };
5881
6002
  try {
@@ -5899,7 +6020,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5899
6020
  if (typeof localStorage === "undefined") return;
5900
6021
  try {
5901
6022
  const { mode, workspaceId, channelRef, taskRef, threadRef, taskNumber } = snapshot;
5902
- localStorage.setItem(STORAGE_KEY$2, JSON.stringify({
6023
+ localStorage.setItem(STORAGE_KEY$3, JSON.stringify({
5903
6024
  mode,
5904
6025
  ...workspaceId === void 0 ? {} : { workspaceId },
5905
6026
  ...channelRef === void 0 ? {} : { channelRef },
@@ -6110,7 +6231,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6110
6231
  };
6111
6232
  //#endregion
6112
6233
  //#region src/client/drafts.ts
6113
- const STORAGE_KEY$1 = "dsh.agent-team.drafts.v1";
6234
+ const STORAGE_KEY$2 = "dsh.agent-team.drafts.v1";
6114
6235
  /** Retention ceiling; the oldest savedAt entries fall out first. */
6115
6236
  const LIMIT = 50;
6116
6237
  const EMPTY = Object.freeze({
@@ -6145,7 +6266,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6145
6266
  if (typeof localStorage === "undefined") return;
6146
6267
  try {
6147
6268
  const payload = Object.fromEntries([...entries].map(([key, entry]) => [key, entry]));
6148
- localStorage.setItem(STORAGE_KEY$1, JSON.stringify(payload));
6269
+ localStorage.setItem(STORAGE_KEY$2, JSON.stringify(payload));
6149
6270
  } catch {}
6150
6271
  }
6151
6272
  /**
@@ -6197,7 +6318,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6197
6318
  reset() {
6198
6319
  this.entries = /* @__PURE__ */ new Map();
6199
6320
  this.snapshots.clear();
6200
- if (typeof localStorage !== "undefined") localStorage.removeItem(STORAGE_KEY$1);
6321
+ if (typeof localStorage !== "undefined") localStorage.removeItem(STORAGE_KEY$2);
6201
6322
  for (const listener of this.listeners) listener();
6202
6323
  }
6203
6324
  /** Re-read persisted content — what a fresh page load starts from. */
@@ -6487,7 +6608,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6487
6608
  const mintRequestId = () => crypto.randomUUID();
6488
6609
  //#endregion
6489
6610
  //#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}}";
6611
+ 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
6612
  const tagId$5 = "@wowyuarm/dsh-agent-team/composer.module.css";
6492
6613
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$5) + "]") === null) {
6493
6614
  const tag = document.createElement("style");
@@ -6517,6 +6638,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6517
6638
  "memberSessionRoot": "x9jGQq_memberSessionRoot",
6518
6639
  "memberSessionStatus": "x9jGQq_memberSessionStatus",
6519
6640
  "memberSessionToolbar": "x9jGQq_memberSessionToolbar",
6641
+ "mentionAllDot": "x9jGQq_mentionAllDot",
6520
6642
  "mentionDescription": "x9jGQq_mentionDescription",
6521
6643
  "mentionMenu": "x9jGQq_mentionMenu",
6522
6644
  "mentionName": "x9jGQq_mentionName",
@@ -6552,6 +6674,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6552
6674
  const normalized = query.toLocaleLowerCase();
6553
6675
  return members.filter((status) => status.presence !== "unavailable" && status.member.state !== "inactive" && status.member.handle.toLocaleLowerCase().startsWith(normalized));
6554
6676
  }
6677
+ /** Every member a manual handle pick could reach: the @all expansion snapshot. */
6678
+ function allMentionMembers(members) {
6679
+ return members.filter((status) => status.presence !== "unavailable" && status.member.state !== "inactive");
6680
+ }
6681
+ function containsAllMention(draft) {
6682
+ return /(?:^|[^\p{L}\p{N}_])@all(?=$|[^\p{L}\p{N}_])/u.test(draft);
6683
+ }
6555
6684
  /** One object URL per draft file; revoked when the draft is removed. */
6556
6685
  const draftPreviewUrls = /* @__PURE__ */ new WeakMap();
6557
6686
  function draftPreviewUrl(file) {
@@ -6571,9 +6700,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6571
6700
  const composingRef = (0, react.useRef)(false);
6572
6701
  const [mention, setMention] = (0, react.useState)();
6573
6702
  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];
6703
+ const memberCandidates = mention === void 0 ? [] : mentionCandidates(members, mention.query);
6704
+ const options = mention !== void 0 && "all".startsWith(mention.query.toLocaleLowerCase()) ? [{ kind: "all" }, ...memberCandidates.map((status) => ({
6705
+ kind: "member",
6706
+ status
6707
+ }))] : memberCandidates.map((status) => ({
6708
+ kind: "member",
6709
+ status
6710
+ }));
6711
+ const menuOpen = mention !== void 0 && options.length > 0;
6712
+ const activeOption = options[highlight];
6713
+ const allCount = allMentionMembers(members).length;
6577
6714
  const listId = "team-mention-suggestions";
6578
6715
  const menuMaxHeight = (0, _deepseek_ai_dsh_client_ui_primitives.useAnchoredMaxHeight)(menuRef, 320, menuOpen ? draft : null);
6579
6716
  (0, _deepseek_ai_dsh_client_ui_primitives.useDismissOnOutsidePointer)(rootRef, menuOpen, (open) => {
@@ -6586,12 +6723,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6586
6723
  input.style.height = `${Math.min(input.scrollHeight, 180)}px`;
6587
6724
  }, [draft]);
6588
6725
  (0, react.useEffect)(() => {
6589
- if (mention === void 0 || candidates.length === 0) {
6726
+ if (mention === void 0 || options.length === 0) {
6590
6727
  setHighlight(0);
6591
6728
  return;
6592
6729
  }
6593
- setHighlight((current) => Math.min(current, candidates.length - 1));
6594
- }, [mention, candidates.length]);
6730
+ setHighlight((current) => Math.min(current, options.length - 1));
6731
+ }, [mention, options.length]);
6595
6732
  (0, react.useEffect)(() => {
6596
6733
  const active = document.activeElement;
6597
6734
  if (active !== document.body && active?.closest("[aria-current=\"page\"]") === null) return;
@@ -6602,6 +6739,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6602
6739
  inputRef.current?.focus({ preventScroll: true });
6603
6740
  }, [confirmation, pending]);
6604
6741
  const pruneRecipients = (nextDraft) => {
6742
+ if (containsAllMention(nextDraft)) return;
6605
6743
  const knownMembers = new Map(members.map((status) => [status.member.memberId, status.member]));
6606
6744
  const next = new Set([...recipients].filter((memberId) => {
6607
6745
  const member = knownMembers.get(memberId);
@@ -6628,8 +6766,26 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6628
6766
  pruneRecipients(nextDraft);
6629
6767
  updateMention(nextDraft, event.target.selectionStart ?? nextDraft.length);
6630
6768
  };
6631
- const selectMention = (member) => {
6769
+ const selectOption = (option) => {
6632
6770
  if (mention === void 0) return;
6771
+ if (option.kind === "all") {
6772
+ const nextDraft = `${draft.slice(0, mention.start)}@all ${draft.slice(mention.end)}`;
6773
+ const nextCaret = mention.start + 5;
6774
+ const nextRecipients = new Set(recipients);
6775
+ for (const status of allMentionMembers(members)) nextRecipients.add(status.member.memberId);
6776
+ onDraftChange(nextDraft);
6777
+ onRecipientsChange(nextRecipients);
6778
+ setMention(void 0);
6779
+ setHighlight(0);
6780
+ requestAnimationFrame(() => {
6781
+ const input = inputRef.current;
6782
+ if (input === null) return;
6783
+ input.focus({ preventScroll: true });
6784
+ input.setSelectionRange(nextCaret, nextCaret);
6785
+ });
6786
+ return;
6787
+ }
6788
+ const member = option.status;
6633
6789
  const inserted = `@${member.member.handle} `;
6634
6790
  const nextDraft = `${draft.slice(0, mention.start)}${inserted}${draft.slice(mention.end)}`;
6635
6791
  const nextCaret = mention.start + inserted.length;
@@ -6645,16 +6801,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6645
6801
  input.setSelectionRange(nextCaret, nextCaret);
6646
6802
  });
6647
6803
  };
6804
+ const onPaste = (event) => {
6805
+ if (pending || onFilesChange === void 0 || pendingFiles === void 0) return;
6806
+ const files = Array.from(event.clipboardData.items).filter((item) => item.kind === "file").map((item) => item.getAsFile()).filter((file) => file !== null);
6807
+ if (files.length === 0) return;
6808
+ event.preventDefault();
6809
+ onFilesChange([...pendingFiles, ...files]);
6810
+ };
6648
6811
  const onKeyDown = (event) => {
6649
6812
  const composing = composingRef.current || event.nativeEvent.isComposing || event.nativeEvent.keyCode === 229;
6650
6813
  if (menuOpen && event.key === "ArrowDown") {
6651
6814
  event.preventDefault();
6652
- setHighlight((current) => (current + 1) % candidates.length);
6815
+ setHighlight((current) => (current + 1) % options.length);
6653
6816
  return;
6654
6817
  }
6655
6818
  if (menuOpen && event.key === "ArrowUp") {
6656
6819
  event.preventDefault();
6657
- setHighlight((current) => (current - 1 + candidates.length) % candidates.length);
6820
+ setHighlight((current) => (current - 1 + options.length) % options.length);
6658
6821
  return;
6659
6822
  }
6660
6823
  if (event.key === "Escape" && menuOpen) {
@@ -6664,13 +6827,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6664
6827
  }
6665
6828
  if (menuOpen && event.key === "Tab" && !event.shiftKey) {
6666
6829
  event.preventDefault();
6667
- if (activeCandidate !== void 0) selectMention(activeCandidate);
6830
+ if (activeOption !== void 0) selectOption(activeOption);
6668
6831
  return;
6669
6832
  }
6670
6833
  if (event.key !== "Enter" || event.shiftKey || composing || event.repeat) return;
6671
- if (menuOpen && activeCandidate !== void 0) {
6834
+ if (menuOpen && activeOption !== void 0) {
6672
6835
  event.preventDefault();
6673
- selectMention(activeCandidate);
6836
+ selectOption(activeOption);
6674
6837
  return;
6675
6838
  }
6676
6839
  event.preventDefault();
@@ -6701,47 +6864,76 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6701
6864
  role: "listbox",
6702
6865
  "aria-label": t("mentionSuggestions"),
6703
6866
  style: { maxHeight: menuMaxHeight },
6704
- children: candidates.map((status, index) => {
6705
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
6706
- id: `${listId}-${status.member.memberId}`,
6867
+ children: options.map((option, index) => {
6868
+ const optionId = option.kind === "all" ? `${listId}-all` : `${listId}-${option.status.member.memberId}`;
6869
+ const selected = index === highlight;
6870
+ return option.kind === "all" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
6871
+ id: optionId,
6872
+ type: "button",
6873
+ role: "option",
6874
+ "aria-selected": selected,
6875
+ className: composer_module_css_default.mentionOption,
6876
+ onMouseDown: (event) => {
6877
+ event.preventDefault();
6878
+ },
6879
+ onClick: () => {
6880
+ selectOption(option);
6881
+ },
6882
+ children: [
6883
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6884
+ className: composer_module_css_default.mentionAllDot,
6885
+ "aria-hidden": "true"
6886
+ }),
6887
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6888
+ className: composer_module_css_default.mentionName,
6889
+ children: "@all"
6890
+ }),
6891
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6892
+ className: composer_module_css_default.mentionDescription,
6893
+ children: t("mentionAll", { count: allCount })
6894
+ })
6895
+ ]
6896
+ }, "all") : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
6897
+ id: optionId,
6707
6898
  type: "button",
6708
6899
  role: "option",
6709
- "aria-selected": index === highlight,
6900
+ "aria-selected": selected,
6710
6901
  className: composer_module_css_default.mentionOption,
6711
6902
  onMouseDown: (event) => {
6712
6903
  event.preventDefault();
6713
6904
  },
6714
6905
  onClick: () => {
6715
- selectMention(status);
6906
+ selectOption(option);
6716
6907
  },
6717
6908
  children: [
6718
6909
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamPresenceDot, {
6719
- status,
6910
+ status: option.status,
6720
6911
  t
6721
6912
  }),
6722
6913
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
6723
6914
  className: composer_module_css_default.mentionName,
6724
- children: ["@", status.member.handle]
6915
+ children: ["@", option.status.member.handle]
6725
6916
  }),
6726
6917
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
6727
6918
  className: composer_module_css_default.mentionDescription,
6728
- children: status.member.description
6919
+ children: option.status.member.description
6729
6920
  })
6730
6921
  ]
6731
- }, status.member.memberId);
6922
+ }, option.status.member.memberId);
6732
6923
  })
6733
6924
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
6734
6925
  ref: inputRef,
6735
6926
  "aria-label": t("messageDraft"),
6736
6927
  "aria-autocomplete": "list",
6737
6928
  "aria-controls": menuOpen ? listId : void 0,
6738
- "aria-activedescendant": menuOpen && activeCandidate !== void 0 ? `${listId}-${activeCandidate.member.memberId}` : void 0,
6929
+ "aria-activedescendant": menuOpen && activeOption !== void 0 ? activeOption.kind === "all" ? `${listId}-all` : `${listId}-${activeOption.status.member.memberId}` : void 0,
6739
6930
  "aria-expanded": menuOpen,
6740
6931
  value: draft,
6741
6932
  readOnly: pending,
6742
6933
  placeholder: placeholder ?? t("messagePlaceholder"),
6743
6934
  rows: 1,
6744
6935
  onChange,
6936
+ onPaste,
6745
6937
  onKeyDown,
6746
6938
  onSelect: (event) => {
6747
6939
  updateMention(event.currentTarget.value, event.currentTarget.selectionStart ?? event.currentTarget.value.length);
@@ -6862,16 +7054,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6862
7054
  const pending = /* @__PURE__ */ new Set();
6863
7055
  /** Refs the Host did not recognize; never re-queried (no retry loops). */
6864
7056
  const unresolvable = /* @__PURE__ */ new Set();
6865
- const listeners$1 = /* @__PURE__ */ new Set();
7057
+ const listeners$2 = /* @__PURE__ */ new Set();
6866
7058
  let version = 0;
6867
7059
  const emit = () => {
6868
7060
  version += 1;
6869
- for (const listener of listeners$1) listener();
7061
+ for (const listener of listeners$2) listener();
6870
7062
  };
6871
7063
  const subscribe = (listener) => {
6872
- listeners$1.add(listener);
7064
+ listeners$2.add(listener);
6873
7065
  return () => {
6874
- listeners$1.delete(listener);
7066
+ listeners$2.delete(listener);
6875
7067
  };
6876
7068
  };
6877
7069
  /** Stable snapshot token; the map is read directly after this changes. */
@@ -7064,7 +7256,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7064
7256
  }
7065
7257
  /** Canonical chip handles for one Message's structured mention refs. */
7066
7258
  function mentionNamesOf(mentions, handles) {
7067
- return mentions.map((memberId) => handles.get(memberId)).filter((name) => name !== void 0);
7259
+ return mentions.map((memberId) => memberId === "member:human" ? "human" : handles.get(memberId)).filter((name) => name !== void 0);
7068
7260
  }
7069
7261
  const MARKDOWN_BLOCK_CONSTRUCT = /(^|\n)[ \t]{0,3}(?:#{1,6}[ \t]|>[ \t]|[-*+][ \t]|\d+[.)][ \t])|^[ \t]*\|.+\|/m;
7070
7262
  const MARKDOWN_INLINE_CONSTRUCT = /[`*_[\]!]|~~~|```/;
@@ -7149,7 +7341,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7149
7341
  render: inline !== void 0 ? "inline" : options.human || options.canOpenRefs && !richAgentBody && refs.length > 0 ? "literal" : "markdown",
7150
7342
  ...inline === void 0 ? {} : { inline },
7151
7343
  fallbackNames,
7152
- fallbackRefs: richAgentBody && options.canOpenRefs ? refs.filter((ref) => !ref.startsWith("task:")) : [],
7344
+ fallbackRefs: richAgentBody && !options.canOpenRefs ? refs : [],
7153
7345
  taskRefs: options.canOpenRefs && !richAgentBody ? refs.filter((ref) => ref.startsWith("task:")).map((ref) => ref) : []
7154
7346
  };
7155
7347
  }
@@ -7232,6 +7424,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7232
7424
  refVersion
7233
7425
  ]);
7234
7426
  const taskLabel = (0, react.useCallback)((taskNumber) => t?.("taskLabel", { number: taskNumber }) ?? `Task #${taskNumber}`, [t]);
7427
+ const refLabel = (0, react.useCallback)((ref) => ref.startsWith("thread:") ? t?.("threadLabel") ?? "Thread" : ref.startsWith("channel:") ? t?.("channels") ?? "Channels" : ref, [t]);
7235
7428
  const [expanded, setExpanded] = (0, react.useState)(false);
7236
7429
  const clampable = shouldClampMessage(displayBody);
7237
7430
  const clamped = clampable && !expanded;
@@ -7243,8 +7436,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7243
7436
  const styledRefCodes = markdownStyledRefCodeElements(root);
7244
7437
  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
7438
  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);
7439
+ for (const code of styledRefCodes) renderResolvedMarkdownCodeRef(code, taskLabel, refLabel);
7440
+ for (const node of textNodes) renderResolvedMarkdownText(node, mentionNames ?? [], taskLabel, refLabel);
7248
7441
  for (const button of root.querySelectorAll("button[data-task-ref]")) {
7249
7442
  const taskRef = button.dataset.taskRef;
7250
7443
  const hit = taskRef === void 0 ? void 0 : cachedResolvedTaskRef(taskRef);
@@ -7256,6 +7449,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7256
7449
  onResolveTaskRefs,
7257
7450
  refVersion,
7258
7451
  taskLabel,
7452
+ refLabel,
7259
7453
  mentionNames
7260
7454
  ]);
7261
7455
  (0, react.useEffect)(() => {
@@ -7264,10 +7458,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7264
7458
  const openTask = (event) => {
7265
7459
  const target = event.target;
7266
7460
  if (!(target instanceof Element)) return;
7267
- const button = target.closest("button[data-task-ref]");
7461
+ const button = target.closest("button[data-ref], button[data-task-ref]");
7268
7462
  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);
7463
+ const ref = button instanceof HTMLElement ? button.dataset.ref ?? button.dataset.taskRef : void 0;
7464
+ if (ref !== void 0) onOpenRef(ref);
7271
7465
  };
7272
7466
  root.addEventListener("click", openTask);
7273
7467
  return () => {
@@ -7279,10 +7473,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7279
7473
  children: plan.inline.segments.map((segment, index) => segment.mention ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
7280
7474
  className: conversation_module_css_default.mention,
7281
7475
  children: segment.text
7282
- }, index) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: renderRefs(segment.text, onOpenRef, taskLabel) }, index))
7476
+ }, index) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: renderRefs(segment.text, onOpenRef, taskLabel, refLabel) }, index))
7283
7477
  }) : plan.render === "literal" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
7284
7478
  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)
7479
+ 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
7480
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
7287
7481
  ref: markdownRef,
7288
7482
  className: conversation_module_css_default.messageMarkdown,
@@ -7387,16 +7581,27 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7387
7581
  return button;
7388
7582
  }
7389
7583
  /** Replace a whole-ref code span with its resolved Task chip once known. */
7390
- function renderResolvedMarkdownCodeRef(code, taskLabel) {
7584
+ function renderResolvedMarkdownCodeRef(code, taskLabel, refLabel) {
7391
7585
  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;
7586
+ const ref = (segments.length === 1 ? segments[0] : void 0)?.ref;
7587
+ if (ref === void 0) return;
7588
+ const taskRef = ref.startsWith("task:") === true ? ref : void 0;
7394
7589
  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)));
7590
+ if (taskRef !== void 0 && resolved === void 0) return;
7591
+ if (taskRef !== void 0) {
7592
+ code.replaceWith(resolvedTaskRefButton(taskRef, taskLabel(resolved.taskNumber)));
7593
+ return;
7594
+ }
7595
+ const button = document.createElement("button");
7596
+ button.type = "button";
7597
+ if (conversation_module_css_default.refLink !== void 0) button.className = conversation_module_css_default.refLink;
7598
+ button.dataset.ref = ref;
7599
+ button.title = ref;
7600
+ button.textContent = refLabel(ref);
7601
+ code.replaceWith(button);
7397
7602
  }
7398
7603
  /** Replace resolved Task refs and structured mention handles in one prose text node without changing Markdown structure. */
7399
- function renderResolvedMarkdownText(node, mentionNames, taskLabel) {
7604
+ function renderResolvedMarkdownText(node, mentionNames, taskLabel, refLabel) {
7400
7605
  let changed = false;
7401
7606
  const fragment = document.createDocumentFragment();
7402
7607
  for (const refSegment of splitBrandedRefs(node.data)) {
@@ -7416,22 +7621,31 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7416
7621
  }
7417
7622
  const taskRef = refSegment.ref.startsWith("task:") === true ? refSegment.ref : void 0;
7418
7623
  const resolved = taskRef === void 0 ? void 0 : cachedResolvedTaskRef(taskRef);
7419
- if (resolved === void 0) {
7624
+ if (taskRef !== void 0 && resolved === void 0) {
7420
7625
  fragment.append(refSegment.text);
7421
7626
  continue;
7422
7627
  }
7423
7628
  changed = true;
7424
- fragment.append(resolvedTaskRefButton(taskRef, taskLabel(resolved.taskNumber)));
7629
+ if (taskRef !== void 0) fragment.append(resolvedTaskRefButton(taskRef, taskLabel(resolved.taskNumber)));
7630
+ else {
7631
+ const button = document.createElement("button");
7632
+ button.type = "button";
7633
+ if (conversation_module_css_default.refLink !== void 0) button.className = conversation_module_css_default.refLink;
7634
+ button.dataset.ref = refSegment.ref;
7635
+ button.title = refSegment.ref;
7636
+ button.textContent = refLabel(refSegment.ref);
7637
+ fragment.append(button);
7638
+ }
7425
7639
  }
7426
7640
  if (changed) node.replaceWith(fragment);
7427
7641
  }
7428
7642
  /** Render one literal text run, linkifying branded refs when navigation is available. */
7429
- function renderRefs(text, onOpenRef, taskLabel) {
7643
+ function renderRefs(text, onOpenRef, taskLabel, refLabel) {
7430
7644
  if (onOpenRef === void 0) return text;
7431
7645
  return splitBrandedRefs(text).map((segment, index) => {
7432
7646
  if (segment.ref === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: segment.text }, index);
7433
7647
  const resolved = cachedResolvedTaskRef(segment.ref);
7434
- const label = resolved !== void 0 && segment.ref.startsWith("task:") ? taskLabel(resolved.taskNumber) : segment.ref;
7648
+ const label = resolved !== void 0 && segment.ref.startsWith("task:") ? taskLabel(resolved.taskNumber) : refLabel(segment.ref);
7435
7649
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
7436
7650
  type: "button",
7437
7651
  className: conversation_module_css_default.refLink,
@@ -7584,46 +7798,32 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7584
7798
  //#endregion
7585
7799
  //#region src/client/timeline-scroll.ts
7586
7800
  const BOTTOM_MARGIN_PX = 48;
7587
- const BOUNDARY_OFFSET_PX = 12;
7588
7801
  /**
7589
7802
  * Chat-timeline scroll policy shared by the Channel and Thread pages: follow
7590
- * new facts only while the reader stays pinned to the bottom, keep prepended
7591
- * history visually stable, and honor explicit jump requests exactly once per
7592
- * content commit. The content key must change whenever rendered facts change.
7803
+ * new facts only while the reader stays pinned to the bottom, and keep
7804
+ * prepended history visually stable. The content key must change whenever
7805
+ * rendered facts change.
7593
7806
  */
7594
7807
  function useTimelineScroll(contentKey) {
7595
7808
  const ref = (0, react.useRef)(null);
7596
7809
  const pinnedRef = (0, react.useRef)(true);
7597
7810
  const heightRef = (0, react.useRef)(0);
7598
- const jumpRef = (0, react.useRef)();
7599
7811
  const onScroll = (0, react.useCallback)(() => {
7600
7812
  const element = ref.current;
7601
7813
  if (element === null) return;
7602
7814
  pinnedRef.current = element.scrollHeight - element.scrollTop - element.clientHeight < BOTTOM_MARGIN_PX;
7603
7815
  }, []);
7604
- const jumpToBoundary = (0, react.useCallback)(() => {
7605
- jumpRef.current = "boundary";
7606
- pinnedRef.current = false;
7607
- }, []);
7608
- const jumpToLatest = (0, react.useCallback)(() => {
7609
- jumpRef.current = "latest";
7816
+ const scrollToBottom = (0, react.useCallback)(() => {
7817
+ const element = ref.current;
7610
7818
  pinnedRef.current = true;
7819
+ if (element !== null) element.scrollTop = element.scrollHeight;
7611
7820
  }, []);
7612
7821
  (0, react.useEffect)(() => {
7613
7822
  const element = ref.current;
7614
7823
  if (element === null) return;
7615
7824
  const previousHeight = heightRef.current;
7616
7825
  heightRef.current = element.scrollHeight;
7617
- const jump = jumpRef.current;
7618
- jumpRef.current = void 0;
7619
- if (jump === "boundary") {
7620
- const marker = element.querySelector("[data-thread-boundary]");
7621
- if (marker !== null) {
7622
- element.scrollTop += marker.getBoundingClientRect().top - element.getBoundingClientRect().top - BOUNDARY_OFFSET_PX;
7623
- return;
7624
- }
7625
- }
7626
- if (jump === "latest" || pinnedRef.current) {
7826
+ if (pinnedRef.current) {
7627
7827
  element.scrollTop = element.scrollHeight;
7628
7828
  return;
7629
7829
  }
@@ -7633,8 +7833,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7633
7833
  ref,
7634
7834
  onScroll,
7635
7835
  isPinned: () => pinnedRef.current,
7636
- jumpToBoundary,
7637
- jumpToLatest
7836
+ scrollToBottom
7638
7837
  };
7639
7838
  }
7640
7839
  /**
@@ -7734,7 +7933,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7734
7933
  };
7735
7934
  //#endregion
7736
7935
  //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/thread.module.css.mjs
7737
- const css$2 = ".-Qiwua_titleLine{flex-wrap:wrap;align-items:center;gap:10px;display:flex}.-Qiwua_titleLine h1{margin:0}.-Qiwua_workSection{border-top:1px solid var(--dsw-alias-border-l2);max-width:880px;margin:12px auto 0;padding-top:8px}.-Qiwua_riskSection{border-top:1px solid var(--dsw-alias-border-l2);max-width:880px;margin:12px auto 0;padding-top:10px}.-Qiwua_riskSection h2{color:var(--dsw-alias-state-error-primary);margin:0 0 5px;font-size:12px;font-weight:600;line-height:18px}.-Qiwua_riskRow{color:var(--dsw-alias-label-secondary);align-items:center;gap:8px;margin:3px 0;font-size:12px;line-height:18px;display:flex}.-Qiwua_claimList{gap:4px;padding:4px 0 2px 22px;display:grid}.-Qiwua_claimRow{border-radius:6px;grid-template-columns:14px minmax(96px,auto) minmax(0,1fr) auto auto;align-items:center;gap:4px 8px;min-height:36px;padding:4px 6px;display:grid}.-Qiwua_claimRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.-Qiwua_claimOwner{color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:500;line-height:18px;overflow:hidden}.-Qiwua_claimDirection{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;min-width:0;font-size:12px;line-height:18px}.-Qiwua_claimState{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-size:11px;line-height:18px}.-Qiwua_emptyClaims{color:var(--dsw-alias-label-tertiary);margin:0;padding:5px 6px;font-size:11px;line-height:18px}.-Qiwua_activityRow{color:var(--dsw-alias-label-tertiary);text-align:center;justify-content:center;align-items:center;gap:8px;max-width:100%;margin:4px auto;padding:5px 12px;font-size:11px;line-height:18px;display:flex}.-Qiwua_activityText{overflow-wrap:anywhere;min-width:0}.-Qiwua_activityMark{background:var(--dsw-alias-border-l3);border-radius:50%;flex:0 0 5px;width:5px;height:5px}.-Qiwua_activityRow:has(+.-Qiwua_activityRow),.-Qiwua_activityRow+.-Qiwua_activityRow{text-align:left;justify-content:flex-start;padding-left:38px}.-Qiwua_historySection{border-bottom:1px solid var(--dsw-alias-border-l2);max-width:100%;margin:0 auto 12px;padding-bottom:10px}.-Qiwua_historySection h2{color:var(--dsw-alias-label-tertiary);letter-spacing:.02em;text-transform:uppercase;margin:0 0 4px;font-size:11px;font-weight:600;line-height:16px}.-Qiwua_publicSection{min-width:0}.-Qiwua_unreadBoundary{color:var(--dsw-alias-label-tertiary);align-items:center;gap:10px;margin:10px 0 6px;font-size:11px;line-height:16px;display:flex}.-Qiwua_unreadBoundary:before,.-Qiwua_unreadBoundary:after{background:var(--dsw-alias-border-l3);content:\"\";flex:1;height:1px}.-Qiwua_unreadBoundary span{flex:none}.-Qiwua_daySeparator{color:var(--dsw-alias-label-tertiary);letter-spacing:.02em;align-items:center;gap:10px;margin:12px 0 4px;font-size:11px;line-height:16px;display:flex}.-Qiwua_daySeparator:before,.-Qiwua_daySeparator:after{background:var(--dsw-alias-border-l2);content:\"\";flex:1;height:1px}.-Qiwua_daySeparator span{flex:none}.-Qiwua_newUpdates{background:var(--dsw-specific-input-major,var(--dsw-alias-bg-layer-1));border:1px solid var(--dsw-alias-border-l2-darkmode-thin);box-shadow:var(--dsw-shadow-lv2);color:var(--dsw-alias-label-secondary);z-index:2;border-radius:999px;justify-content:center;align-items:center;gap:8px;width:fit-content;margin:8px auto;padding:4px 6px 4px 12px;font-size:12px;line-height:18px;display:flex;position:sticky;bottom:8px}.-Qiwua_taskTitle{color:var(--dsw-alias-label-secondary);-webkit-line-clamp:2;overflow-wrap:anywhere;-webkit-box-orient:vertical;margin:2px 0 0;font-size:13px;line-height:20px;display:-webkit-box;overflow:hidden}.-Qiwua_closedBar{flex-direction:column;align-items:center;display:flex}.-Qiwua_closedNotice{color:var(--dsw-alias-label-tertiary);flex-wrap:wrap;justify-content:center;align-items:center;gap:12px;padding:10px 16px 14px;font-size:13px;line-height:20px;display:flex}@media (width<=600px){.-Qiwua_claimRow{grid-template-columns:14px minmax(0,1fr) auto;align-items:start}.-Qiwua_claimState{grid-area:1/3;justify-self:end}.-Qiwua_claimDirection{grid-column:2/-1}.-Qiwua_activityRow{padding-inline:0}.-Qiwua_newUpdates{max-width:calc(100% - 16px)}}";
7936
+ const css$2 = ".-Qiwua_titleLine{flex-wrap:wrap;align-items:center;gap:10px;display:flex}.-Qiwua_titleLine h1{margin:0}.-Qiwua_workSection{border-top:1px solid var(--dsw-alias-border-l2);max-width:880px;margin:12px auto 0;padding-top:8px}.-Qiwua_riskSection{border-top:1px solid var(--dsw-alias-border-l2);max-width:880px;margin:12px auto 0;padding-top:10px}.-Qiwua_riskSection h2{color:var(--dsw-alias-state-error-primary);margin:0 0 5px;font-size:12px;font-weight:600;line-height:18px}.-Qiwua_riskRow{color:var(--dsw-alias-label-secondary);align-items:center;gap:8px;margin:3px 0;font-size:12px;line-height:18px;display:flex}.-Qiwua_claimList{gap:4px;padding:4px 0 2px 22px;display:grid}.-Qiwua_claimRow{border-radius:6px;grid-template-columns:14px minmax(96px,auto) minmax(0,1fr) auto auto;align-items:center;gap:4px 8px;min-height:36px;padding:4px 6px;display:grid}.-Qiwua_claimRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.-Qiwua_claimOwner{color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:500;line-height:18px;overflow:hidden}.-Qiwua_claimDirection{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;min-width:0;font-size:12px;line-height:18px}.-Qiwua_claimState{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-size:11px;line-height:18px}.-Qiwua_emptyClaims{color:var(--dsw-alias-label-tertiary);margin:0;padding:5px 6px;font-size:11px;line-height:18px}.-Qiwua_activityRow{color:var(--dsw-alias-label-tertiary);text-align:center;justify-content:center;align-items:center;gap:8px;max-width:100%;margin:4px auto;padding:5px 12px;font-size:11px;line-height:18px;display:flex}.-Qiwua_activityText{overflow-wrap:anywhere;min-width:0}.-Qiwua_activityMark{background:var(--dsw-alias-border-l3);border-radius:50%;flex:0 0 5px;width:5px;height:5px}.-Qiwua_activityRow:has(+.-Qiwua_activityRow),.-Qiwua_activityRow+.-Qiwua_activityRow{text-align:left;justify-content:flex-start;padding-left:38px}.-Qiwua_historySection{border-bottom:1px solid var(--dsw-alias-border-l2);max-width:100%;margin:0 auto 12px;padding-bottom:10px}.-Qiwua_historySection h2{color:var(--dsw-alias-label-tertiary);letter-spacing:.02em;text-transform:uppercase;margin:0 0 4px;font-size:11px;font-weight:600;line-height:16px}.-Qiwua_publicSection{min-width:0}.-Qiwua_unreadBoundary{color:var(--dsw-alias-label-tertiary);align-items:center;gap:10px;margin:10px 0 6px;font-size:11px;line-height:16px;display:flex}.-Qiwua_unreadBoundary:before,.-Qiwua_unreadBoundary:after{background:var(--dsw-alias-border-l3);content:\"\";flex:1;height:1px}.-Qiwua_unreadBoundary span{flex:none}.-Qiwua_daySeparator{color:var(--dsw-alias-label-tertiary);letter-spacing:.02em;align-items:center;gap:10px;margin:12px 0 4px;font-size:11px;line-height:16px;display:flex}.-Qiwua_daySeparator:before,.-Qiwua_daySeparator:after{background:var(--dsw-alias-border-l2);content:\"\";flex:1;height:1px}.-Qiwua_daySeparator span{flex:none}.-Qiwua_newUpdates{background:var(--dsw-specific-input-major,var(--dsw-alias-bg-layer-1));border:1px solid var(--dsw-alias-border-l2-darkmode-thin);box-shadow:var(--dsw-shadow-lv2);z-index:2;border-radius:999px;justify-content:center;align-items:center;width:fit-content;margin:8px auto;padding:4px 12px;font-size:12px;line-height:18px;display:flex;position:sticky;bottom:8px}.-Qiwua_newUpdatesJump{color:var(--dsw-alias-label-secondary);cursor:pointer;font:inherit;line-height:inherit;background:0 0;border:0;padding:0}.-Qiwua_newUpdatesJump:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px;border-radius:6px}.-Qiwua_taskTitle{color:var(--dsw-alias-label-secondary);-webkit-line-clamp:2;overflow-wrap:anywhere;-webkit-box-orient:vertical;margin:2px 0 0;font-size:13px;line-height:20px;display:-webkit-box;overflow:hidden}.-Qiwua_closedBar{flex-direction:column;align-items:center;display:flex}.-Qiwua_closedNotice{color:var(--dsw-alias-label-tertiary);flex-wrap:wrap;justify-content:center;align-items:center;gap:12px;padding:10px 16px 14px;font-size:13px;line-height:20px;display:flex}@media (width<=600px){.-Qiwua_claimRow{grid-template-columns:14px minmax(0,1fr) auto;align-items:start}.-Qiwua_claimState{grid-area:1/3;justify-self:end}.-Qiwua_claimDirection{grid-column:2/-1}.-Qiwua_activityRow{padding-inline:0}.-Qiwua_newUpdates{max-width:calc(100% - 16px)}}";
7738
7937
  const tagId$2 = "@wowyuarm/dsh-agent-team/thread.module.css";
7739
7938
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
7740
7939
  const tag = document.createElement("style");
@@ -7758,6 +7957,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7758
7957
  "emptyClaims": "-Qiwua_emptyClaims",
7759
7958
  "historySection": "-Qiwua_historySection",
7760
7959
  "newUpdates": "-Qiwua_newUpdates",
7960
+ "newUpdatesJump": "-Qiwua_newUpdatesJump",
7761
7961
  "publicSection": "-Qiwua_publicSection",
7762
7962
  "riskRow": "-Qiwua_riskRow",
7763
7963
  "riskSection": "-Qiwua_riskSection",
@@ -7805,6 +8005,27 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7805
8005
  if (ref !== channelRef) selectChannel(ref);
7806
8006
  return;
7807
8007
  }
8008
+ if (ref.startsWith("thread:")) {
8009
+ const match = view?.items.find((item) => item.thread.threadRef === ref);
8010
+ if (match !== void 0) {
8011
+ selectThread(match.thread.threadRef, channelRef, match.task?.taskRef, match.taskNumber);
8012
+ return;
8013
+ }
8014
+ loadChannels({
8015
+ workspaceId,
8016
+ threadRef: ref,
8017
+ includeActivities: false,
8018
+ limit: 1
8019
+ }).then((result) => {
8020
+ if (!result.ok) return;
8021
+ const target = result.value.items[0];
8022
+ if (target !== void 0) {
8023
+ const targetChannel = result.value.channels.find((channel) => channel.channelRef === target.message.channelRef);
8024
+ if (targetChannel !== void 0) selectThread(target.thread.threadRef, targetChannel.channelRef, target.task?.taskRef, target.taskNumber);
8025
+ }
8026
+ });
8027
+ return;
8028
+ }
7808
8029
  if (ref.startsWith("task:")) {
7809
8030
  const match = view?.items.find((item) => item.task?.taskRef === ref);
7810
8031
  if (match !== void 0) {
@@ -8300,7 +8521,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8300
8521
  const [readFacts, setReadFacts] = (0, react.useState)([]);
8301
8522
  const [historyCursor, setHistoryCursor] = (0, react.useState)();
8302
8523
  const [historyHasMore, setHistoryHasMore] = (0, react.useState)(false);
8303
- const [remainingUnreadCount, setRemainingUnreadCount] = (0, react.useState)(0);
8524
+ const MAX_AUTO_READ_ROUNDS = 50;
8525
+ const [autoReadExhausted, setAutoReadExhausted] = (0, react.useState)(false);
8304
8526
  const [newFactsCount, setNewFactsCount] = (0, react.useState)(0);
8305
8527
  const draftKey = `thread:${threadRef}`;
8306
8528
  const { draft, recipients } = (0, react.useSyncExternalStore)(drafts.subscribe, () => drafts.getSnapshot(draftKey));
@@ -8320,20 +8542,31 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8320
8542
  const currentFactsRef = (0, react.useRef)([]);
8321
8543
  const sequenceRef = (0, react.useRef)(0);
8322
8544
  const readRequestIdRef = (0, react.useRef)(mintRequestId());
8545
+ const projectionRef = (0, react.useRef)();
8323
8546
  const mutationRequests = (0, react.useRef)(/* @__PURE__ */ new Map());
8324
8547
  const threadLastFact = currentFacts[currentFacts.length - 1];
8325
8548
  const timeline = useTimelineScroll(`${currentFacts.length}:${olderFacts.length}:${threadLastFact === void 0 ? "" : factKey(threadLastFact)}`);
8326
8549
  const updateProjection = (next) => {
8550
+ projectionRef.current = next;
8327
8551
  setProjection(next);
8328
8552
  setReadFacts(next.facts);
8329
- setRemainingUnreadCount(next.remainingUnreadCount);
8330
8553
  const batch = [messageFact(next.anchor, next.anchorMentions), ...next.facts.map((fact) => fact.fact)];
8331
8554
  setCurrentFacts((current) => {
8332
8555
  const merged = mergeFacts(current, batch);
8333
8556
  currentFactsRef.current = merged;
8334
8557
  return merged;
8335
8558
  });
8336
- setNewFactsCount(0);
8559
+ };
8560
+ const drainUnread = async () => {
8561
+ for (let round = 1; round <= MAX_AUTO_READ_ROUNDS; round += 1) {
8562
+ const snapshot = projectionRef.current;
8563
+ if (snapshot === void 0 || snapshot.remainingUnreadCount <= 0) return;
8564
+ const beforeSequence = sequenceRef.current;
8565
+ if (!await readCurrent(true)) return;
8566
+ if (!mountedRef.current || sequenceRef.current !== beforeSequence + 1) return;
8567
+ if (projectionRef.current?.remainingUnreadCount === snapshot.remainingUnreadCount) return;
8568
+ }
8569
+ setAutoReadExhausted(true);
8337
8570
  };
8338
8571
  const readCurrent = async (newRequest = false) => {
8339
8572
  if (!mountedRef.current) return false;
@@ -8399,17 +8632,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8399
8632
  currentFactsRef.current = merged;
8400
8633
  return merged;
8401
8634
  });
8402
- setProjection((current) => current === void 0 ? current : {
8403
- ...current,
8404
- ...result.value.task === void 0 ? {} : { task: result.value.task },
8405
- thread: result.value.thread,
8406
- claims: result.value.claims
8635
+ setProjection((current) => {
8636
+ const next = current === void 0 ? current : {
8637
+ ...current,
8638
+ ...result.value.task === void 0 ? {} : { task: result.value.task },
8639
+ thread: result.value.thread,
8640
+ claims: result.value.claims
8641
+ };
8642
+ if (next !== void 0) projectionRef.current = next;
8643
+ return next;
8407
8644
  });
8408
8645
  if (additions.length === 0) return;
8409
- if (!timeline.isPinned()) {
8410
- setNewFactsCount((current) => current + additions.length);
8411
- return;
8412
- }
8646
+ if (!timeline.isPinned()) setNewFactsCount((current) => current + additions.length);
8413
8647
  const priorSequence = sequenceRef.current;
8414
8648
  if (await readCurrent(true)) return;
8415
8649
  if (!mountedRef.current || sequenceRef.current !== priorSequence + 1) return;
@@ -8418,6 +8652,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8418
8652
  };
8419
8653
  (0, react.useEffect)(() => {
8420
8654
  mountedRef.current = true;
8655
+ projectionRef.current = void 0;
8421
8656
  setProjection(void 0);
8422
8657
  setChannelView(void 0);
8423
8658
  setMembers([]);
@@ -8427,7 +8662,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8427
8662
  setReadFacts([]);
8428
8663
  setHistoryCursor(void 0);
8429
8664
  setHistoryHasMore(false);
8430
- setRemainingUnreadCount(0);
8665
+ setAutoReadExhausted(false);
8431
8666
  setNewFactsCount(0);
8432
8667
  setError(void 0);
8433
8668
  setStatusMessage(void 0);
@@ -8451,7 +8686,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8451
8686
  return;
8452
8687
  }
8453
8688
  updateProjection(read.value);
8454
- if (read.value.facts.some((fact) => fact.unread)) timeline.jumpToBoundary();
8689
+ timeline.scrollToBottom();
8455
8690
  if (history !== void 0 && history.ok) {
8456
8691
  setCurrentFacts((current) => {
8457
8692
  const merged = mergeFacts(current, history.value.facts);
@@ -8463,6 +8698,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8463
8698
  }
8464
8699
  setError(void 0);
8465
8700
  setLoading(false);
8701
+ await drainUnread();
8466
8702
  })();
8467
8703
  refreshSupplemental();
8468
8704
  const disposers = [subscribeChanges({
@@ -8496,6 +8732,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8496
8732
  taskRef,
8497
8733
  threadRef
8498
8734
  ]);
8735
+ (0, react.useEffect)(() => {
8736
+ if (newFactsCount > 0 && timeline.isPinned()) setNewFactsCount(0);
8737
+ }, [
8738
+ newFactsCount,
8739
+ currentFacts,
8740
+ olderFacts,
8741
+ timeline
8742
+ ]);
8499
8743
  const loadOlder = async () => {
8500
8744
  if (historyHasMore === false && historyCursor === void 0) return;
8501
8745
  const beforeSequence = historyCursor ?? minSequence(currentFactsRef.current);
@@ -8550,7 +8794,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8550
8794
  const messageSender = (fact) => fact.kind === "message" ? fact.message.sender : void 0;
8551
8795
  const [pendingFiles, setPendingFiles] = (0, react.useState)([]);
8552
8796
  const openRef = (ref) => {
8553
- if (ref.startsWith("channel:") && ref !== channelRef) selectChannel(ref);
8797
+ if (ref.startsWith("channel:") && ref !== channelRef) {
8798
+ selectChannel(ref);
8799
+ return;
8800
+ }
8801
+ if (ref.startsWith("thread:") && ref !== threadRef) {
8802
+ loadChannels({
8803
+ workspaceId,
8804
+ threadRef: ref,
8805
+ includeActivities: false,
8806
+ limit: 1
8807
+ }).then((result) => {
8808
+ if (!result.ok) return;
8809
+ const target = result.value.items[0];
8810
+ if (target === void 0) return;
8811
+ const targetChannel = result.value.channels.find((channel) => channel.channelRef === target.message.channelRef);
8812
+ if (targetChannel !== void 0) selectThread(target.thread.threadRef, targetChannel.channelRef, target.task?.taskRef, target.taskNumber);
8813
+ });
8814
+ return;
8815
+ }
8554
8816
  if (ref.startsWith("task:") && ref !== taskRef) jumpToTaskThread(resolveTaskRefs, workspaceId, ref, selectThread);
8555
8817
  };
8556
8818
  const lookupTaskRefs = hostTaskRefLookup(resolveTaskRefs, workspaceId);
@@ -8626,7 +8888,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8626
8888
  if (boundaryIndex === index) nodes.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8627
8889
  className: thread_module_css_default.unreadBoundary,
8628
8890
  role: "separator",
8629
- "data-thread-boundary": true,
8630
8891
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("unreadBoundary") })
8631
8892
  }, `boundary-${index}`));
8632
8893
  if (sender !== void 0) run.push(fact);
@@ -8636,9 +8897,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8636
8897
  return nodes;
8637
8898
  };
8638
8899
  const refreshAfterFence = async () => {
8639
- timeline.jumpToLatest();
8900
+ timeline.scrollToBottom();
8640
8901
  await readCurrent(true);
8641
8902
  await refreshSupplemental();
8903
+ await drainUnread();
8642
8904
  };
8643
8905
  const convertToTask = async () => {
8644
8906
  if (pending || thread === void 0 || task !== void 0) return;
@@ -8894,7 +9156,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8894
9156
  children: [(() => {
8895
9157
  const activeClaims = projection?.claims.filter((claim) => claim.taskRef === task.taskRef && claim.state === "active") ?? [];
8896
9158
  const earlyAccept = task.resolution === "open" && task.status === "in_progress" && activeClaims.length > 0;
8897
- if (!(task.status === "in_review" || earlyAccept) || task.resolution !== "open") return null;
9159
+ if (!(task.status === "in_review" || task.status === "todo" || earlyAccept) || task.resolution !== "open") return null;
8898
9160
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
8899
9161
  size: "sm",
8900
9162
  variant: "primary",
@@ -9075,32 +9337,28 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9075
9337
  className: thread_module_css_default.publicSection,
9076
9338
  children: renderFactBlocks(currentFactsWithAnchor, unreadBoundary)
9077
9339
  }),
9078
- newFactsCount > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9079
- className: thread_module_css_default.newUpdates,
9080
- role: "status",
9081
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("readNewUpdates", { count: newFactsCount }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9082
- size: "sm",
9083
- variant: "outline",
9084
- disabled: loading,
9085
- onClick: () => {
9086
- timeline.jumpToLatest();
9087
- readCurrent(true);
9088
- },
9089
- children: t("markRead")
9090
- })]
9091
- }),
9092
- remainingUnreadCount > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9340
+ autoReadExhausted && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9093
9341
  className: conversation_module_css_default.timelineAction,
9094
- role: "status",
9095
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("remainingUnread", { count: remainingUnreadCount }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9342
+ role: "alert",
9343
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("autoReadIncomplete") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9096
9344
  size: "sm",
9097
9345
  onClick: () => {
9098
- timeline.jumpToBoundary();
9099
- readCurrent(true);
9346
+ setAutoReadExhausted(false);
9347
+ drainUnread();
9100
9348
  },
9101
9349
  disabled: loading,
9102
- children: t("continueReading")
9350
+ children: t("retry")
9103
9351
  })]
9352
+ }),
9353
+ newFactsCount > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9354
+ className: thread_module_css_default.newUpdates,
9355
+ role: "status",
9356
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
9357
+ type: "button",
9358
+ className: thread_module_css_default.newUpdatesJump,
9359
+ onClick: timeline.scrollToBottom,
9360
+ children: t("newUpdatesJump", { count: newFactsCount })
9361
+ })
9104
9362
  })
9105
9363
  ]
9106
9364
  })
@@ -9308,8 +9566,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9308
9566
  //#endregion
9309
9567
  //#region src/client/TeamSidebarSection.tsx
9310
9568
  /** Collapsible sidebar section header: disclosure toggle plus trailing actions. */
9311
- function TeamSidebarSection({ title, actions, children }) {
9312
- const [open, setOpen] = (0, react.useState)(true);
9569
+ function TeamSidebarSection({ title, actions, open, onToggle, children }) {
9313
9570
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
9314
9571
  className: sidebar_module_css_default.section,
9315
9572
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -9319,7 +9576,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9319
9576
  className: sidebar_module_css_default.sectionToggle,
9320
9577
  "aria-expanded": open,
9321
9578
  onClick: () => {
9322
- setOpen((value) => !value);
9579
+ onToggle(!open);
9323
9580
  },
9324
9581
  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
9582
  className: sidebar_module_css_default.sectionTitle,
@@ -9333,6 +9590,92 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9333
9590
  });
9334
9591
  }
9335
9592
  //#endregion
9593
+ //#region src/client/sidebar-sections.ts
9594
+ /**
9595
+ * Human presentation preference for the Team sidebar: whether each disclosure
9596
+ * section (workspaces / channels / agents) is expanded. The state lives in
9597
+ * this browser only — it is UI taste, never a shared Team fact, so nothing
9598
+ * here touches the ledger. Same storage discipline as `sidebar-order.ts`: one
9599
+ * localStorage key, defensive parsing, a read-through cache over the raw
9600
+ * payload so writes from other tabs are picked up, and an in-memory fallback
9601
+ * when storage is unavailable.
9602
+ */
9603
+ const STORAGE_KEY$1 = "dsh.agent-team.sidebar-sections";
9604
+ function sectionKey(workspaceId, kind) {
9605
+ return workspaceId === void 0 ? kind === "workspaces" ? kind : void 0 : `${workspaceId}|${kind}`;
9606
+ }
9607
+ const MEMORY_ONLY$1 = Symbol("sidebar-sections.memory");
9608
+ /** Read-through parse cache over the raw persisted payload; see `sidebar-order.ts`. */
9609
+ let cachedRaw$1;
9610
+ let cachedCollapsed = /* @__PURE__ */ new Set();
9611
+ function storedCollapsed() {
9612
+ let raw = null;
9613
+ try {
9614
+ raw = typeof localStorage === "undefined" ? null : localStorage.getItem(STORAGE_KEY$1);
9615
+ } catch {
9616
+ raw = null;
9617
+ }
9618
+ if (cachedRaw$1 !== void 0 && raw !== null && raw === cachedRaw$1) return cachedCollapsed;
9619
+ if (raw === null) {
9620
+ if (cachedRaw$1 === MEMORY_ONLY$1) return cachedCollapsed;
9621
+ cachedRaw$1 = raw;
9622
+ cachedCollapsed = /* @__PURE__ */ new Set();
9623
+ return cachedCollapsed;
9624
+ }
9625
+ try {
9626
+ const parsed = JSON.parse(raw);
9627
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) throw new Error("not an object");
9628
+ const keys = parsed.collapsed;
9629
+ if (!Array.isArray(keys) || !keys.every((key) => typeof key === "string")) throw new Error("bad shape");
9630
+ cachedRaw$1 = raw;
9631
+ cachedCollapsed = new Set(keys);
9632
+ return cachedCollapsed;
9633
+ } catch {
9634
+ return /* @__PURE__ */ new Set();
9635
+ }
9636
+ }
9637
+ function writeCollapsed(collapsed) {
9638
+ cachedCollapsed = collapsed;
9639
+ try {
9640
+ if (typeof localStorage === "undefined") throw new Error("no localStorage");
9641
+ const raw = JSON.stringify({ collapsed: [...collapsed] });
9642
+ localStorage.setItem(STORAGE_KEY$1, raw);
9643
+ cachedRaw$1 = raw;
9644
+ return;
9645
+ } catch {
9646
+ cachedRaw$1 = MEMORY_ONLY$1;
9647
+ }
9648
+ }
9649
+ const listeners$1 = /* @__PURE__ */ new Set();
9650
+ /**
9651
+ * Effective expanded state for one sidebar section: `false` only when this
9652
+ * browser explicitly collapsed it. Booleans are primitives, so the snapshot
9653
+ * is naturally identity-stable for `useSyncExternalStore`.
9654
+ */
9655
+ function useSidebarSectionOpen(workspaceId, kind) {
9656
+ const key = sectionKey(workspaceId, kind);
9657
+ return (0, react.useSyncExternalStore)((0, react.useCallback)((listener) => {
9658
+ listeners$1.add(listener);
9659
+ return () => {
9660
+ listeners$1.delete(listener);
9661
+ };
9662
+ }, []), () => key === void 0 ? true : !storedCollapsed().has(key), () => key === void 0 ? true : !storedCollapsed().has(key));
9663
+ }
9664
+ /**
9665
+ * The only mutation path: record one section's expanded state for this
9666
+ * browser. Unknown keys (missing workspace) no-op so an unloaded workspace
9667
+ * never persists a phantom preference.
9668
+ */
9669
+ function setSidebarSectionOpen(workspaceId, kind, open) {
9670
+ const key = sectionKey(workspaceId, kind);
9671
+ if (key === void 0) return;
9672
+ const next = new Set(storedCollapsed());
9673
+ if (open) next.delete(key);
9674
+ else next.add(key);
9675
+ writeCollapsed(next);
9676
+ for (const listener of listeners$1) listener();
9677
+ }
9678
+ //#endregion
9336
9679
  //#region src/client/TeamMemberAvatar.tsx
9337
9680
  /**
9338
9681
  * Sidebar Member avatar reusing the conversation identity language: the
@@ -9662,69 +10005,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9662
10005
  "unavailableDot": "_1henIG_unavailableDot"
9663
10006
  };
9664
10007
  //#endregion
9665
- //#region src/client/multi-menu-field.tsx
9666
- /**
9667
- * Render the labeled multi-select Menu field.
9668
- * @param props.label - field caption; doubles as the trigger's accessible name.
9669
- * @param props.options - selectable entries in display order.
9670
- * @param props.selected - currently checked ids.
9671
- * @param props.onToggle - invoked with an id when its row is clicked.
9672
- * @param props.disabled - disables the trigger while a mutation is in flight.
9673
- * @param props.emptyText - shown instead of the picker when there is nothing to pick.
9674
- * @param props.triggerEmptyLabel - trigger caption when nothing is selected.
9675
- * @param props.formatCount - builds the trigger caption for N selections.
9676
- */
9677
- function MultiMenuField({ label, options, selected, onToggle, disabled = false, emptyText, triggerEmptyLabel, formatCount }) {
9678
- const [open, setOpen] = (0, react.useState)(false);
9679
- const items = options.map((option) => ({
9680
- id: option.id,
9681
- label: option.hint === void 0 ? option.label : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [option.label, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", {
9682
- className: sidebar_module_css_default.menuHint,
9683
- children: ` ${option.hint}`
9684
- })] }),
9685
- ...option.disabled === true ? { disabled: true } : {},
9686
- ...option.icon === void 0 ? {} : { icon: option.icon }
9687
- }));
9688
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9689
- className: create_module_css_default.field,
9690
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: label }), options.length === 0 && emptyText !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", {
9691
- className: sidebar_module_css_default.editHint,
9692
- children: emptyText
9693
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Menu, {
9694
- open,
9695
- portal: true,
9696
- className: create_module_css_default.menuCap,
9697
- items,
9698
- selectedIds: selected,
9699
- onSelect: (id) => {
9700
- onToggle(id);
9701
- },
9702
- onClose: () => {
9703
- setOpen(false);
9704
- },
9705
- anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
9706
- type: "button",
9707
- className: create_module_css_default.selectTrigger,
9708
- "aria-label": label,
9709
- "aria-haspopup": "listbox",
9710
- "aria-expanded": open,
9711
- disabled,
9712
- onClick: () => {
9713
- setOpen((value) => !value);
9714
- },
9715
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9716
- className: create_module_css_default.selectValue,
9717
- children: selected.length === 0 ? triggerEmptyLabel : formatCount(selected.length)
9718
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9719
- className: `${create_module_css_default.chevron} ${open ? create_module_css_default.chevronOpen : ""}`,
9720
- "aria-hidden": true,
9721
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, {})
9722
- })]
9723
- })
9724
- })]
9725
- });
9726
- }
9727
- //#endregion
9728
10008
  //#region src/client/TeamMemberEditor.tsx
9729
10009
  /** Model option key inside one editor; opaque and resolved against the loaded groups. */
9730
10010
  function modelKey(provider, model) {
@@ -9885,10 +10165,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9885
10165
  }
9886
10166
  /**
9887
10167
  * Agent editor: handle, description, and per-Member model selection commit
9888
- * through one durable update; Channel membership below keeps its own
9889
- * immediate add/remove flow.
10168
+ * through one durable update. Channel membership is managed from the Channel
10169
+ * side, not here.
9890
10170
  */
9891
- function AgentEditorDialog({ status, channels, loadChannels, updateMember, joinChannel, removeChannelMember, loadModels, onCommitted, onClose, t }) {
10171
+ function AgentEditorDialog({ status, updateMember, loadModels, onCommitted, onClose, t }) {
9892
10172
  const memberId = status.member.memberId;
9893
10173
  const [handle, setHandle] = (0, react.useState)(status.member.handle);
9894
10174
  const [description, setDescription] = (0, react.useState)(status.member.description);
@@ -9896,39 +10176,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9896
10176
  const [saving, setSaving] = (0, react.useState)(false);
9897
10177
  const [error, setError] = (0, react.useState)();
9898
10178
  const pendingRequest = (0, react.useRef)();
9899
- const [memberships, setMemberships] = (0, react.useState)();
9900
- const [loadError, setLoadError] = (0, react.useState)();
9901
- (0, react.useEffect)(() => {
9902
- let mounted = true;
9903
- loadChannels({
9904
- workspaceId: status.member.workspaceId,
9905
- topLevelOnly: true,
9906
- includeActivities: false,
9907
- limit: 1
9908
- }).then((result) => {
9909
- if (!mounted) return;
9910
- if (result.ok) {
9911
- setMemberships(result.value.members);
9912
- setLoadError(void 0);
9913
- } else setLoadError(result.error.message);
9914
- });
9915
- return () => {
9916
- mounted = false;
9917
- };
9918
- }, [loadChannels, status.member.workspaceId]);
9919
- const membership = useChannelMembership({
9920
- joinChannel,
9921
- removeChannelMember
9922
- }, (change) => change.channelRef, (change) => {
9923
- setMemberships((current) => {
9924
- const base = current ?? [];
9925
- return change.joined ? base.filter((item) => !(item.channelRef === change.channelRef && item.memberId === change.memberId)) : [...base, {
9926
- channelRef: change.channelRef,
9927
- memberId: change.memberId
9928
- }];
9929
- });
9930
- });
9931
- const joinedChannels = new Set((memberships ?? []).filter((item) => item.memberId === memberId).map((item) => item.channelRef));
9932
10179
  const dirty = handle.trim() !== status.member.handle || description.trim() !== status.member.description || !sameModel(model, status.member.model);
9933
10180
  const submit = async (event) => {
9934
10181
  event.preventDefault();
@@ -9939,7 +10186,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9939
10186
  memberId,
9940
10187
  handle: normalizedHandle,
9941
10188
  description: normalizedDescription,
9942
- ...model === void 0 ? {} : { model }
10189
+ ...model === void 0 ? {} : { model },
10190
+ ...status.member.capabilities === void 0 ? {} : { capabilities: status.member.capabilities }
9943
10191
  };
9944
10192
  const request = pendingRequest.current !== void 0 && pendingRequest.current.memberId === payload.memberId && pendingRequest.current.handle === payload.handle && pendingRequest.current.description === payload.description && sameModel(pendingRequest.current.model, model) ? pendingRequest.current : {
9945
10193
  requestId: mintRequestId(),
@@ -10023,53 +10271,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10023
10271
  disabled: saving,
10024
10272
  t
10025
10273
  }),
10026
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("fieldset", {
10027
- className: create_module_css_default.memberPicker,
10028
- disabled: saving,
10029
- children: [
10030
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("legend", { children: t("channelMembersSection") }),
10031
- channels.map((channel) => {
10032
- const joined = joinedChannels.has(channel.channelRef);
10033
- const rowPending = membership.pending.has(channel.channelRef);
10034
- const disabled = rowPending || !joined && status.presence === "unavailable";
10035
- const rowError = membership.errors.get(channel.channelRef);
10036
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
10037
- className: `${sidebar_module_css_default.editMemberRow} ${sidebar_module_css_default.editMemberRowChannels}`,
10038
- children: [
10039
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("strong", {
10040
- className: sidebar_module_css_default.editChannelName,
10041
- children: ["# ", channel.name]
10042
- }),
10043
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
10044
- size: "sm",
10045
- variant: "outline",
10046
- disabled,
10047
- onClick: () => {
10048
- membership.change({
10049
- workspaceId: status.member.workspaceId,
10050
- channelRef: channel.channelRef,
10051
- memberId,
10052
- joined
10053
- });
10054
- },
10055
- children: rowPending ? t("membershipUpdating") : joined ? t("removeFromChannel") : t("addToChannel")
10056
- }),
10057
- rowError !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
10058
- className: sidebar_module_css_default.rowError,
10059
- role: "alert",
10060
- children: rowError
10061
- })
10062
- ]
10063
- }, channel.channelRef);
10064
- }),
10065
- channels.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", { children: t("noChannelsForAgent") }),
10066
- loadError !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
10067
- className: sidebar_module_css_default.rowError,
10068
- role: "alert",
10069
- children: loadError
10070
- })
10071
- ]
10072
- }),
10073
10274
  error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
10074
10275
  className: create_module_css_default.error,
10075
10276
  role: "alert",
@@ -10086,10 +10287,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10086
10287
  }
10087
10288
  //#endregion
10088
10289
  //#region src/client/TeamAgentsPanel.tsx
10089
- function TeamAgentsPanel({ workspaceId, loadMembers, subscribeChanges, loadChannels, addMember, updateMember, recoverMember, joinChannel, removeChannelMember, loadModels, memberSessionId, openMemberSession, onCreatingChange, t }) {
10290
+ function TeamAgentsPanel({ workspaceId, loadMembers, subscribeChanges, addMember, updateMember, recoverMember, clearMemberContext, loadModels, memberSessionId, openMemberSession, onCreatingChange, t }) {
10090
10291
  const [members, setMembers] = (0, react.useState)([]);
10091
- const [channels, setChannels] = (0, react.useState)([]);
10092
- const [channelRefs, setChannelRefs] = (0, react.useState)([]);
10093
10292
  const [loading, setLoading] = (0, react.useState)(true);
10094
10293
  const [error, setError] = (0, react.useState)();
10095
10294
  const [formOpen, setFormOpen] = (0, react.useState)(false);
@@ -10111,6 +10310,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10111
10310
  refs: orderedAgentRefs,
10112
10311
  onCommit: applyMove
10113
10312
  });
10313
+ const sectionOpen = useSidebarSectionOpen(workspaceId, "agents");
10114
10314
  const refresh = (0, react.useCallback)(async () => {
10115
10315
  setLoading(true);
10116
10316
  const result = await loadMembers({ workspaceId });
@@ -10123,18 +10323,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10123
10323
  (0, react.useEffect)(() => {
10124
10324
  refresh();
10125
10325
  }, [refresh]);
10126
- const loadWorkspaceChannels = (0, react.useCallback)(async () => {
10127
- const result = await loadChannels({
10128
- workspaceId,
10129
- topLevelOnly: true,
10130
- includeActivities: false,
10131
- limit: 1
10132
- });
10133
- if (result.ok) setChannels(result.value.channels);
10134
- }, [loadChannels, workspaceId]);
10135
- (0, react.useEffect)(() => {
10136
- loadWorkspaceChannels();
10137
- }, [loadWorkspaceChannels]);
10138
10326
  (0, react.useEffect)(() => subscribeChanges({
10139
10327
  kind: "workspace",
10140
10328
  workspaceId
@@ -10144,11 +10332,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10144
10332
  return;
10145
10333
  }
10146
10334
  refresh();
10147
- loadWorkspaceChannels();
10148
10335
  }), [
10149
10336
  subscribeChanges,
10150
10337
  refresh,
10151
- loadWorkspaceChannels,
10152
10338
  workspaceId
10153
10339
  ]);
10154
10340
  const closeForm = () => {
@@ -10172,7 +10358,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10172
10358
  setHandle("");
10173
10359
  setDescription("");
10174
10360
  setModel(void 0);
10175
- setChannelRefs([]);
10176
10361
  setFormOpen(false);
10177
10362
  if (result.value.status.presence === "unavailable") setError(result.value.status.diagnostic ?? t("statusUnavailable"));
10178
10363
  else setRetryRequest(void 0);
@@ -10195,13 +10380,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10195
10380
  const normalizedHandle = handle.trim();
10196
10381
  const normalizedDescription = description.trim();
10197
10382
  if (normalizedHandle.length === 0 || creating) return;
10198
- provision(retryRequest !== void 0 && retryRequest.workspaceId === workspaceId && retryRequest.handle === normalizedHandle && retryRequest.description === normalizedDescription && sameModel(retryRequest.model, model) && retryRequest.channelRefs.length === channelRefs.length && retryRequest.channelRefs.every((ref) => channelRefs.includes(ref)) ? retryRequest : {
10383
+ provision(retryRequest !== void 0 && retryRequest.workspaceId === workspaceId && retryRequest.handle === normalizedHandle && retryRequest.description === normalizedDescription && sameModel(retryRequest.model, model) && retryRequest.channelRefs.length === 0 ? retryRequest : {
10199
10384
  requestId: mintRequestId(),
10200
10385
  workspaceId,
10201
10386
  handle: normalizedHandle,
10202
10387
  description: normalizedDescription,
10203
10388
  presetId: "team-member",
10204
- channelRefs,
10389
+ channelRefs: [],
10205
10390
  ...model === void 0 ? {} : { model }
10206
10391
  });
10207
10392
  };
@@ -10267,22 +10452,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10267
10452
  disabled: creating,
10268
10453
  t
10269
10454
  }),
10270
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MultiMenuField, {
10271
- label: `${t("initialChannels")}${t("optionalSuffix")}`,
10272
- disabled: creating,
10273
- options: channels.map((channel) => ({
10274
- id: channel.channelRef,
10275
- label: channel.name
10276
- })),
10277
- selected: channelRefs,
10278
- onToggle: (ref) => {
10279
- setChannelRefs((current) => current.includes(ref) ? current.filter((item) => item !== ref) : [...current, ref]);
10280
- setRetryRequest(void 0);
10281
- },
10282
- emptyText: t("noChannelsForAgent"),
10283
- triggerEmptyLabel: t("channelsPickerEmpty"),
10284
- formatCount: (count) => t("channelsPickerCount", { count })
10285
- }),
10286
10455
  formOpen && error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
10287
10456
  className: create_module_css_default.error,
10288
10457
  role: "alert",
@@ -10293,6 +10462,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10293
10462
  }),
10294
10463
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TeamSidebarSection, {
10295
10464
  title: t("agents"),
10465
+ open: sectionOpen,
10466
+ onToggle: (open) => {
10467
+ setSidebarSectionOpen(workspaceId, "agents", open);
10468
+ },
10296
10469
  actions: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
10297
10470
  label: t("addAgent"),
10298
10471
  delayMs: 500,
@@ -10325,12 +10498,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10325
10498
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AgentRow, {
10326
10499
  status,
10327
10500
  ...memberSessionId === void 0 ? {} : { current: status.member.sessionId === memberSessionId },
10328
- channels,
10329
- loadChannels,
10330
10501
  updateMember,
10331
10502
  recoverMember,
10332
- joinChannel,
10333
- removeChannelMember,
10503
+ clearMemberContext,
10334
10504
  loadModels,
10335
10505
  openMemberSession,
10336
10506
  onUpdated: () => {
@@ -10363,9 +10533,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10363
10533
  * conversation page, the avatar carries identity plus the presence badge, and
10364
10534
  * the row menu opens the editor.
10365
10535
  */
10366
- function AgentRow({ status, current, channels, loadChannels, updateMember, recoverMember, joinChannel, removeChannelMember, loadModels, openMemberSession, onUpdated, t }) {
10536
+ function AgentRow({ status, current, updateMember, recoverMember, clearMemberContext, loadModels, openMemberSession, onUpdated, t }) {
10367
10537
  const [menuOpen, setMenuOpen] = (0, react.useState)(false);
10368
10538
  const [editing, setEditing] = (0, react.useState)(false);
10539
+ const [clearing, setClearing] = (0, react.useState)(false);
10369
10540
  const [rowAlert, setRowAlert] = (0, react.useState)();
10370
10541
  const recover = async () => {
10371
10542
  try {
@@ -10389,6 +10560,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10389
10560
  setRowAlert(t("restartFailed", { message: cause instanceof Error ? cause.message : String(cause) }));
10390
10561
  }
10391
10562
  };
10563
+ const clearContext = async () => {
10564
+ try {
10565
+ const result = await clearMemberContext({
10566
+ requestId: mintRequestId(),
10567
+ workspaceId: status.member.workspaceId,
10568
+ memberId: status.member.memberId
10569
+ });
10570
+ await onUpdated();
10571
+ if (!result.ok) {
10572
+ setRowAlert(t("clearContextFailed", { message: result.error.message }));
10573
+ return;
10574
+ }
10575
+ setRowAlert(void 0);
10576
+ if (current === true) openMemberSession(result.value.status.member.sessionId);
10577
+ } catch (cause) {
10578
+ setRowAlert(t("clearContextFailed", { message: cause instanceof Error ? cause.message : String(cause) }));
10579
+ }
10580
+ };
10581
+ const contextClearable = status.presence === "available" || status.presence === "error";
10392
10582
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
10393
10583
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
10394
10584
  className: sidebar_module_css_default.agentRow,
@@ -10428,10 +10618,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10428
10618
  id: "restart",
10429
10619
  label: t("restartAgent"),
10430
10620
  icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutline16, {})
10621
+ }] : [],
10622
+ {
10623
+ id: "clear-context",
10624
+ label: t("clearContextAgent"),
10625
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconNewChatOutline16, {}),
10626
+ danger: true,
10627
+ disabled: !contextClearable
10628
+ },
10629
+ ...!contextClearable ? [{
10630
+ type: "label",
10631
+ id: "clear-context-reason",
10632
+ text: status.presence === "working" ? t("clearContextWorkingReason") : t("clearContextUnavailableReason")
10431
10633
  }] : []
10432
10634
  ],
10433
10635
  onSelect: (id) => {
10434
10636
  if (id === "edit") setEditing(true);
10637
+ else if (id === "clear-context") setClearing(true);
10435
10638
  else recover();
10436
10639
  },
10437
10640
  onOpenChange: setMenuOpen
@@ -10443,13 +10646,36 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10443
10646
  role: "alert",
10444
10647
  children: rowAlert
10445
10648
  }),
10649
+ clearing && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
10650
+ open: true,
10651
+ onClose: () => {
10652
+ setClearing(false);
10653
+ },
10654
+ title: t("clearContextTitle", { name: status.member.handle }),
10655
+ closeLabel: t("close"),
10656
+ contentClassName: create_module_css_default.dialogContent,
10657
+ 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, {
10658
+ variant: "outline",
10659
+ onClick: () => {
10660
+ setClearing(false);
10661
+ },
10662
+ children: t("cancel")
10663
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
10664
+ variant: "primary",
10665
+ onClick: () => {
10666
+ setClearing(false);
10667
+ clearContext();
10668
+ },
10669
+ children: t("clearContextConfirm")
10670
+ })] }),
10671
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
10672
+ className: create_module_css_default.error,
10673
+ children: t("clearContextNotice", { name: status.member.handle })
10674
+ })
10675
+ }),
10446
10676
  editing && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AgentEditorDialog, {
10447
10677
  status,
10448
- channels,
10449
- loadChannels,
10450
10678
  updateMember,
10451
- joinChannel,
10452
- removeChannelMember,
10453
10679
  loadModels,
10454
10680
  onCommitted: onUpdated,
10455
10681
  onClose: () => {
@@ -10460,6 +10686,69 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10460
10686
  ] });
10461
10687
  }
10462
10688
  //#endregion
10689
+ //#region src/client/multi-menu-field.tsx
10690
+ /**
10691
+ * Render the labeled multi-select Menu field.
10692
+ * @param props.label - field caption; doubles as the trigger's accessible name.
10693
+ * @param props.options - selectable entries in display order.
10694
+ * @param props.selected - currently checked ids.
10695
+ * @param props.onToggle - invoked with an id when its row is clicked.
10696
+ * @param props.disabled - disables the trigger while a mutation is in flight.
10697
+ * @param props.emptyText - shown instead of the picker when there is nothing to pick.
10698
+ * @param props.triggerEmptyLabel - trigger caption when nothing is selected.
10699
+ * @param props.formatCount - builds the trigger caption for N selections.
10700
+ */
10701
+ function MultiMenuField({ label, options, selected, onToggle, disabled = false, emptyText, triggerEmptyLabel, formatCount }) {
10702
+ const [open, setOpen] = (0, react.useState)(false);
10703
+ const items = options.map((option) => ({
10704
+ id: option.id,
10705
+ label: option.hint === void 0 ? option.label : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [option.label, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", {
10706
+ className: sidebar_module_css_default.menuHint,
10707
+ children: ` ${option.hint}`
10708
+ })] }),
10709
+ ...option.disabled === true ? { disabled: true } : {},
10710
+ ...option.icon === void 0 ? {} : { icon: option.icon }
10711
+ }));
10712
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
10713
+ className: create_module_css_default.field,
10714
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: label }), options.length === 0 && emptyText !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", {
10715
+ className: sidebar_module_css_default.editHint,
10716
+ children: emptyText
10717
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Menu, {
10718
+ open,
10719
+ portal: true,
10720
+ className: create_module_css_default.menuCap,
10721
+ items,
10722
+ selectedIds: selected,
10723
+ onSelect: (id) => {
10724
+ onToggle(id);
10725
+ },
10726
+ onClose: () => {
10727
+ setOpen(false);
10728
+ },
10729
+ anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
10730
+ type: "button",
10731
+ className: create_module_css_default.selectTrigger,
10732
+ "aria-label": label,
10733
+ "aria-haspopup": "listbox",
10734
+ "aria-expanded": open,
10735
+ disabled,
10736
+ onClick: () => {
10737
+ setOpen((value) => !value);
10738
+ },
10739
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
10740
+ className: create_module_css_default.selectValue,
10741
+ children: selected.length === 0 ? triggerEmptyLabel : formatCount(selected.length)
10742
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
10743
+ className: `${create_module_css_default.chevron} ${open ? create_module_css_default.chevronOpen : ""}`,
10744
+ "aria-hidden": true,
10745
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, {})
10746
+ })]
10747
+ })
10748
+ })]
10749
+ });
10750
+ }
10751
+ //#endregion
10463
10752
  //#region src/client/TeamChannelsPanel.tsx
10464
10753
  function TeamChannelsPanel(props) {
10465
10754
  const { workspaceId, loadMembers, loadChannels, subscribeChanges, createChannel, updateChannel, creatingAgents, selectedChannelRef, selectChannel, t } = props;
@@ -10487,6 +10776,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10487
10776
  refs: orderedChannelRefs,
10488
10777
  onCommit: applyMove
10489
10778
  });
10779
+ const sectionOpen = useSidebarSectionOpen(workspaceId, "channels");
10490
10780
  const refresh = (0, react.useCallback)(async () => {
10491
10781
  setLoading(true);
10492
10782
  const [channelResult, memberResult] = await Promise.all([loadChannels({
@@ -10679,6 +10969,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10679
10969
  }),
10680
10970
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TeamSidebarSection, {
10681
10971
  title: t("channels"),
10972
+ open: sectionOpen,
10973
+ onToggle: (open) => {
10974
+ setSidebarSectionOpen(workspaceId, "channels", open);
10975
+ },
10682
10976
  actions: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
10683
10977
  label: t("addChannel"),
10684
10978
  delayMs: 500,
@@ -10938,7 +11232,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10938
11232
  }
10939
11233
  //#endregion
10940
11234
  //#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 }) {
11235
+ function TeamWorkspaceBrowser({ wide, expandSidebar, navigation, selectWorkspace, selectChannel, t, useWorkspaces, loadMembers, subscribeChanges, addMember, loadChannels, createChannel, updateChannel, updateMember, recoverMember, clearMemberContext, joinChannel, removeChannelMember, loadModels, openMemberSession }) {
10942
11236
  const navigationState = (0, react.useSyncExternalStore)(navigation.subscribe, navigation.getSnapshot, navigation.getSnapshot);
10943
11237
  const workspaces = useWorkspaces((state) => state.items);
10944
11238
  const selected = navigationState.workspaceId;
@@ -10948,6 +11242,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10948
11242
  const [pendingSection, setPendingSection] = (0, react.useState)();
10949
11243
  const channelsRef = (0, react.useRef)(null);
10950
11244
  const agentsRef = (0, react.useRef)(null);
11245
+ const workspacesOpen = useSidebarSectionOpen(void 0, "workspaces");
10951
11246
  (0, react.useEffect)(() => {
10952
11247
  if (navigationState.mode === "team" && selectedId !== void 0 && selectedId !== selected) selectWorkspace(selectedId);
10953
11248
  }, [
@@ -11000,6 +11295,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11000
11295
  "aria-label": t("workspaces"),
11001
11296
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamSidebarSection, {
11002
11297
  title: t("workspaces"),
11298
+ open: workspacesOpen,
11299
+ onToggle: (open) => {
11300
+ setSidebarSectionOpen(void 0, "workspaces", open);
11301
+ },
11003
11302
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11004
11303
  className: sidebar_module_css_default.workspaceList,
11005
11304
  children: [workspaces.map((workspace) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamWorkspaceRow, {
@@ -11038,12 +11337,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11038
11337
  workspaceId: selectedId,
11039
11338
  loadMembers,
11040
11339
  subscribeChanges,
11041
- loadChannels,
11042
11340
  addMember,
11043
11341
  updateMember,
11044
11342
  recoverMember,
11045
- joinChannel,
11046
- removeChannelMember,
11343
+ clearMemberContext,
11047
11344
  loadModels,
11048
11345
  ...navigationState.memberSessionId === void 0 ? {} : { memberSessionId: navigationState.memberSessionId },
11049
11346
  openMemberSession,
@@ -11186,7 +11483,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11186
11483
  setSubmissionNotice("Compact 未执行,请重试。");
11187
11484
  return;
11188
11485
  }
11189
- if (input.phase === "plain") compactWasSubmitting.current = false;
11486
+ if (input.phase === "plain") {
11487
+ if (compactWasSubmitting.current) setSubmissionNotice(void 0);
11488
+ compactWasSubmitting.current = false;
11489
+ }
11190
11490
  }, [input?.claim?.token, input?.phase]);
11191
11491
  (0, react.useEffect)(() => {
11192
11492
  if (input === void 0) return;
@@ -11222,6 +11522,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11222
11522
  const onKeyDown = (event) => {
11223
11523
  if (event.key === "Enter" && event.shiftKey) return;
11224
11524
  if (event.repeat || composing.current || event.nativeEvent.isComposing || event.nativeEvent.keyCode === 229) return;
11525
+ if (event.key === "Tab" && !event.shiftKey) {
11526
+ const highlight = controller.menu.getSnapshot().highlight;
11527
+ if (highlight !== null) {
11528
+ event.preventDefault();
11529
+ controller.pick(highlight.source, highlight.index);
11530
+ }
11531
+ return;
11532
+ }
11225
11533
  const key = event.key === "ArrowUp" ? "up" : event.key === "ArrowDown" ? "down" : event.key === "Escape" ? "escape" : event.key === "Enter" ? "enter" : void 0;
11226
11534
  if (key !== void 0) {
11227
11535
  if (controller.arbitrate(key, false) !== "pass") {
@@ -11329,8 +11637,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11329
11637
  retry: "重试",
11330
11638
  agentName: "名称",
11331
11639
  agentDescription: "说明",
11332
- initialChannels: "初始频道",
11333
- noChannelsForAgent: "请先创建至少一个频道",
11334
11640
  createAgent: "创建 Agent",
11335
11641
  creatingAgent: "正在创建…",
11336
11642
  loadingAgents: "正在加载 Agents…",
@@ -11354,10 +11660,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11354
11660
  restartAgent: "重启",
11355
11661
  restartStillUnavailable: "重启已执行,成员仍不可用:{diagnostic}",
11356
11662
  restartFailed: "重启执行失败:{message}",
11663
+ clearContextAgent: "从全新上下文开始",
11664
+ clearContextWorkingReason: "成员正在工作中,完成后才能清空上下文",
11665
+ clearContextUnavailableReason: "成员当前不可用,恢复在线且空闲后才能清空上下文",
11666
+ clearContextTitle: "从全新上下文开始:{name}",
11667
+ clearContextNotice: "将结束 {name} 当前的会话上下文并从空白开始:旧对话会归档保留在会话记录中。{name} 的身份、私有记忆与 notes、频道和会话绑定都保持不变,后续协作从新上下文继续累积。",
11668
+ clearContextConfirm: "开始全新上下文",
11669
+ clearContextFailed: "清空上下文失败:{message}",
11357
11670
  optionalSuffix: "(可选)",
11358
11671
  agentDescriptionPlaceholder: "留空则暂无描述",
11359
- channelsPickerEmpty: "选择初始频道",
11360
- channelsPickerCount: "已选 {count} 个频道",
11361
11672
  membersPickerEmpty: "选择初始成员",
11362
11673
  membersPickerCount: "已选 {count} 个成员",
11363
11674
  reasoningEffort: "推理强度",
@@ -11406,6 +11717,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11406
11717
  promoteToTask: "转为 Task",
11407
11718
  promotingTask: "正在转为 Task…",
11408
11719
  mentionSuggestions: "提及成员建议",
11720
+ mentionAll: "通知所有成员({count})",
11409
11721
  messageDraft: "消息内容",
11410
11722
  composerNotify: "将通知:{ids}",
11411
11723
  messagePlaceholder: "写一条消息…",
@@ -11418,10 +11730,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11418
11730
  backToWorkspace: "返回工作区",
11419
11731
  loadingThread: "正在加载 Thread…",
11420
11732
  unreadBoundary: "以下是本次打开收到的更新",
11421
- readNewUpdates: "读取 {count} 条新更新",
11422
- markRead: "标记为已读",
11423
- remainingUnread: "还有 {count} 条未读更新",
11424
- continueReading: "继续阅读",
11733
+ newUpdatesJump: " {count} 条新更新",
11734
+ autoReadIncomplete: "仍有未读更新未能自动读取",
11425
11735
  olderHistory: "更早历史",
11426
11736
  runtimeRisk: "当前运行风险",
11427
11737
  runtimeRiskDetail: "@{member} 当前不可用:{diagnostic}",
@@ -11469,8 +11779,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11469
11779
  retry: "Retry",
11470
11780
  agentName: "Name",
11471
11781
  agentDescription: "Description",
11472
- initialChannels: "Initial Channels",
11473
- noChannelsForAgent: "Create at least one Channel first",
11474
11782
  createAgent: "Create Agent",
11475
11783
  creatingAgent: "Creating…",
11476
11784
  loadingAgents: "Loading Agents…",
@@ -11494,10 +11802,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11494
11802
  restartAgent: "Restart",
11495
11803
  restartStillUnavailable: "Restart ran, but the Member is still unavailable: {diagnostic}",
11496
11804
  restartFailed: "Restart failed: {message}",
11805
+ clearContextAgent: "Start from new context",
11806
+ clearContextWorkingReason: "The Member is working; clear once the current turn ends",
11807
+ clearContextUnavailableReason: "The Member is unavailable; only an idle available Member can start from a new context",
11808
+ clearContextTitle: "Start from new context: {name}",
11809
+ 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.",
11810
+ clearContextConfirm: "Start from new context",
11811
+ clearContextFailed: "Failed to clear context: {message}",
11497
11812
  optionalSuffix: " (optional)",
11498
11813
  agentDescriptionPlaceholder: "Leave empty if not needed",
11499
- channelsPickerEmpty: "Choose initial channels",
11500
- channelsPickerCount: "{count} selected",
11501
11814
  membersPickerEmpty: "Choose initial members",
11502
11815
  membersPickerCount: "{count} selected",
11503
11816
  reasoningEffort: "Reasoning effort",
@@ -11546,6 +11859,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11546
11859
  promoteToTask: "Convert to Task",
11547
11860
  promotingTask: "Converting to Task…",
11548
11861
  mentionSuggestions: "Mention suggestions",
11862
+ mentionAll: "Notify all members ({count})",
11549
11863
  messageDraft: "Message",
11550
11864
  composerNotify: "Will notify: {ids}",
11551
11865
  messagePlaceholder: "Write a message…",
@@ -11558,10 +11872,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11558
11872
  backToWorkspace: "Back to Workspace",
11559
11873
  loadingThread: "Loading Thread…",
11560
11874
  unreadBoundary: "Updates received when you opened this Thread",
11561
- readNewUpdates: "Read {count} new update(s)",
11562
- markRead: "Mark read",
11563
- remainingUnread: "{count} unread update(s) remain",
11564
- continueReading: "Continue reading",
11875
+ newUpdatesJump: " {count} new update(s)",
11876
+ autoReadIncomplete: "Some unread updates could not be read automatically",
11565
11877
  olderHistory: "Older history",
11566
11878
  runtimeRisk: "Current runtime risk",
11567
11879
  runtimeRiskDetail: "@{member} is unavailable: {diagnostic}",
@@ -11606,6 +11918,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11606
11918
  "inputTriggers"
11607
11919
  ];
11608
11920
  function registerModeShadow(ctx, navigation, changes, drafts, name, component, extraInject) {
11921
+ const openMemberSessionImpl = (sessionId) => {
11922
+ const sessions = ctx.sessions;
11923
+ const snapshot = navigation.getSnapshot();
11924
+ const current = sessions.list.getSnapshot().current;
11925
+ const returnTo = snapshot.memberSessionId === void 0 && current !== void 0 && current !== sessionId ? current : void 0;
11926
+ navigation.actions().enterMemberSession(sessionId, returnTo);
11927
+ sessions.open(sessionId);
11928
+ };
11609
11929
  const sharedRemotes = {
11610
11930
  loadChannels: (request) => ctx.remote.agentTeam.view(request),
11611
11931
  subscribeChanges: (scope, listener) => changes.subscribe(scope, listener),
@@ -11616,17 +11936,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11616
11936
  updateChannel: (request) => ctx.remote.agentTeam.updateChannel(request),
11617
11937
  updateMember: (request) => ctx.remote.agentTeam.updateMember(request),
11618
11938
  recoverMember: (request) => ctx.remote.agentTeam.recoverMember(request),
11939
+ clearMemberContext: (request) => ctx.remote.agentTeam.clearMemberContext(request),
11619
11940
  loadModels: async () => {
11620
11941
  return (await ctx.get("connection").api.llm.models({})).result;
11621
11942
  },
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
- }
11943
+ openMemberSession: openMemberSessionImpl
11630
11944
  };
11631
11945
  ctx.slots.inject(name, () => {
11632
11946
  let dispose;