@wowyuarm/dsh-agent-team 0.1.10 → 0.1.11

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 (110) hide show
  1. package/README.md +13 -0
  2. package/README.zh.md +13 -0
  3. package/package.json +52 -47
  4. package/packages/agent-team/README.md +4 -2
  5. package/packages/agent-team/README.zh.md +4 -2
  6. package/packages/agent-team/lib/context-management.js +40 -50
  7. package/packages/agent-team/lib/context-projection.js +10 -0
  8. package/packages/agent-team/lib/index.js +235 -112
  9. package/packages/agent-team/lib/invariant.js +38 -4
  10. package/packages/agent-team/lib/ledger.js +554 -271
  11. package/packages/agent-team/lib/member-context.js +6 -2
  12. package/packages/agent-team/lib/member-time-context.js +20 -5
  13. package/packages/agent-team/lib/pressure-policy.js +33 -9
  14. package/packages/agent-team/lib/session-event-cursor.js +116 -0
  15. package/packages/agent-team/lib/session-remediation.js +38 -26
  16. package/packages/agent-team/lib/spec.js +46 -34
  17. package/packages/agent-team/lib/stored-session-reader.js +138 -0
  18. package/packages/agent-team/lib/typert.host.js +107 -40
  19. package/packages/agent-team/lib/typert.remote-client.d.ts.map +1 -1
  20. package/packages/agent-team/lib/typert.remote-client.js +84 -32
  21. package/packages/agent-team/lib/types/context-management.d.ts +7 -0
  22. package/packages/agent-team/lib/types/context-management.d.ts.map +1 -1
  23. package/packages/agent-team/lib/types/context-projection.d.ts +8 -0
  24. package/packages/agent-team/lib/types/context-projection.d.ts.map +1 -1
  25. package/packages/agent-team/lib/types/index.d.ts +78 -2
  26. package/packages/agent-team/lib/types/index.d.ts.map +1 -1
  27. package/packages/agent-team/lib/types/invariant.d.ts.map +1 -1
  28. package/packages/agent-team/lib/types/ledger.d.ts +180 -7
  29. package/packages/agent-team/lib/types/ledger.d.ts.map +1 -1
  30. package/packages/agent-team/lib/types/member-context.d.ts.map +1 -1
  31. package/packages/agent-team/lib/types/member-time-context.d.ts.map +1 -1
  32. package/packages/agent-team/lib/types/pressure-policy.d.ts +18 -0
  33. package/packages/agent-team/lib/types/pressure-policy.d.ts.map +1 -1
  34. package/packages/agent-team/lib/types/session-event-cursor.d.ts +119 -0
  35. package/packages/agent-team/lib/types/session-event-cursor.d.ts.map +1 -0
  36. package/packages/agent-team/lib/types/session-remediation.d.ts +23 -0
  37. package/packages/agent-team/lib/types/session-remediation.d.ts.map +1 -1
  38. package/packages/agent-team/lib/types/spec.d.ts.map +1 -1
  39. package/packages/agent-team/lib/types/stored-session-reader.d.ts +92 -0
  40. package/packages/agent-team/lib/types/stored-session-reader.d.ts.map +1 -0
  41. package/packages/agent-team/lib/types/types/entities.d.ts +28 -2
  42. package/packages/agent-team/lib/types/types/entities.d.ts.map +1 -1
  43. package/packages/agent-team/lib/types/types/operations.d.ts +45 -19
  44. package/packages/agent-team/lib/types/types/operations.d.ts.map +1 -1
  45. package/packages/agent-team/lib/types/types/requests-results.d.ts +44 -3
  46. package/packages/agent-team/lib/types/types/requests-results.d.ts.map +1 -1
  47. package/packages/agent-team/preset/team-member/agent.cordis.yml +3 -1
  48. package/packages/client-agent-team/README.md +1 -1
  49. package/packages/client-agent-team/README.zh.md +1 -1
  50. package/packages/client-agent-team/lib/client.js +1068 -375
  51. package/packages/client-agent-team/lib/client.js.map +1 -1
  52. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts.map +1 -1
  53. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.js +24 -4
  54. package/packages/client-agent-team/lib/types/client/TeamChannelPage.d.ts.map +1 -1
  55. package/packages/client-agent-team/lib/types/client/TeamChannelPage.js +42 -22
  56. package/packages/client-agent-team/lib/types/client/TeamChannelsPanel.d.ts.map +1 -1
  57. package/packages/client-agent-team/lib/types/client/TeamChannelsPanel.js +13 -24
  58. package/packages/client-agent-team/lib/types/client/TeamComposer.d.ts +11 -5
  59. package/packages/client-agent-team/lib/types/client/TeamComposer.d.ts.map +1 -1
  60. package/packages/client-agent-team/lib/types/client/TeamComposer.js +15 -9
  61. package/packages/client-agent-team/lib/types/client/TeamConversation.d.ts +1 -1
  62. package/packages/client-agent-team/lib/types/client/TeamConversation.d.ts.map +1 -1
  63. package/packages/client-agent-team/lib/types/client/TeamConversation.js +8 -1
  64. package/packages/client-agent-team/lib/types/client/TeamInboxPage.d.ts +21 -0
  65. package/packages/client-agent-team/lib/types/client/TeamInboxPage.d.ts.map +1 -0
  66. package/packages/client-agent-team/lib/types/client/TeamInboxPage.js +71 -0
  67. package/packages/client-agent-team/lib/types/client/TeamMemberEditor.d.ts.map +1 -1
  68. package/packages/client-agent-team/lib/types/client/TeamMemberEditor.js +8 -24
  69. package/packages/client-agent-team/lib/types/client/TeamMessage.d.ts +9 -2
  70. package/packages/client-agent-team/lib/types/client/TeamMessage.d.ts.map +1 -1
  71. package/packages/client-agent-team/lib/types/client/TeamMessage.js +11 -4
  72. package/packages/client-agent-team/lib/types/client/TeamPresenceDot.d.ts +8 -0
  73. package/packages/client-agent-team/lib/types/client/TeamPresenceDot.d.ts.map +1 -1
  74. package/packages/client-agent-team/lib/types/client/TeamPresenceDot.js +21 -1
  75. package/packages/client-agent-team/lib/types/client/TeamThreadPage.d.ts.map +1 -1
  76. package/packages/client-agent-team/lib/types/client/TeamThreadPage.js +102 -28
  77. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts +1 -1
  78. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts.map +1 -1
  79. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.js +50 -7
  80. package/packages/client-agent-team/lib/types/client/index.d.ts.map +1 -1
  81. package/packages/client-agent-team/lib/types/client/index.js +17 -6
  82. package/packages/client-agent-team/lib/types/client/locales.d.ts +18 -0
  83. package/packages/client-agent-team/lib/types/client/locales.d.ts.map +1 -1
  84. package/packages/client-agent-team/lib/types/client/locales.js +18 -0
  85. package/packages/client-agent-team/lib/types/client/navigation.d.ts +10 -0
  86. package/packages/client-agent-team/lib/types/client/navigation.d.ts.map +1 -1
  87. package/packages/client-agent-team/lib/types/client/navigation.js +18 -7
  88. package/packages/client-agent-team/lib/types/client/scope-coverage.d.ts +41 -0
  89. package/packages/client-agent-team/lib/types/client/scope-coverage.d.ts.map +1 -0
  90. package/packages/client-agent-team/lib/types/client/scope-coverage.js +64 -0
  91. package/packages/client-agent-team/lib/types/client/slots.d.ts +7 -1
  92. package/packages/client-agent-team/lib/types/client/slots.d.ts.map +1 -1
  93. package/packages/client-agent-team/lib/types/client/team-changes.d.ts +26 -1
  94. package/packages/client-agent-team/lib/types/client/team-changes.d.ts.map +1 -1
  95. package/packages/client-agent-team/lib/types/client/team-changes.js +66 -15
  96. package/packages/client-agent-team/lib/types/client/team-dialog-save.d.ts +20 -0
  97. package/packages/client-agent-team/lib/types/client/team-dialog-save.d.ts.map +1 -0
  98. package/packages/client-agent-team/lib/types/client/team-dialog-save.js +36 -0
  99. package/packages/client-agent-team/lib/types/client/team-formatters.d.ts +9 -0
  100. package/packages/client-agent-team/lib/types/client/team-formatters.d.ts.map +1 -1
  101. package/packages/client-agent-team/lib/types/client/team-formatters.js +34 -6
  102. package/packages/tool-agent-team/README.md +1 -1
  103. package/packages/tool-agent-team/README.zh.md +1 -1
  104. package/packages/tool-agent-team/lib/context-tools.js +18 -14
  105. package/packages/tool-agent-team/lib/host-access.js +20 -0
  106. package/packages/tool-agent-team/lib/index.js +16 -17
  107. package/packages/tool-agent-team/lib/types/context-tools.d.ts.map +1 -1
  108. package/packages/tool-agent-team/lib/types/host-access.d.ts +14 -0
  109. package/packages/tool-agent-team/lib/types/host-access.d.ts.map +1 -0
  110. package/packages/tool-agent-team/lib/types/index.d.ts.map +1 -1
@@ -4143,7 +4143,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4143
4143
  literal("working"),
4144
4144
  literal("error")
4145
4145
  ]).readonly(),
4146
- "diagnostic": string().readonly().optional(),
4146
+ "diagnostic": object({
4147
+ "class": union([
4148
+ literal("session-refused"),
4149
+ literal("session-unreadable"),
4150
+ literal("preset-composition"),
4151
+ literal("rollover"),
4152
+ literal("runtime"),
4153
+ literal("activation")
4154
+ ]).readonly(),
4155
+ "detail": string().readonly(),
4156
+ "location": object({
4157
+ "kind": string().readonly(),
4158
+ "path": string().readonly()
4159
+ }).readonly().optional(),
4160
+ "sessionId": intersection(string(), unknown()).readonly().optional(),
4161
+ "remediable": boolean().readonly().optional()
4162
+ }).readonly().optional(),
4147
4163
  "capabilityWarnings": union([_undefined(), array(object({
4148
4164
  "name": string().readonly(),
4149
4165
  "knownNames": array(string()).readonly()
@@ -4294,6 +4310,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4294
4310
  object({
4295
4311
  "kind": literal("thread").readonly(),
4296
4312
  "threadRef": intersection(string(), unknown()).readonly()
4313
+ }),
4314
+ object({
4315
+ "kind": literal("presence").readonly(),
4316
+ "workspaceId": intersection(string(), unknown()).readonly()
4297
4317
  })
4298
4318
  ]).readonly().optional()
4299
4319
  });
@@ -4436,7 +4456,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4436
4456
  literal("working"),
4437
4457
  literal("error")
4438
4458
  ]).readonly(),
4439
- "diagnostic": string().readonly().optional(),
4459
+ "diagnostic": object({
4460
+ "class": union([
4461
+ literal("session-refused"),
4462
+ literal("session-unreadable"),
4463
+ literal("preset-composition"),
4464
+ literal("rollover"),
4465
+ literal("runtime"),
4466
+ literal("activation")
4467
+ ]).readonly(),
4468
+ "detail": string().readonly(),
4469
+ "location": object({
4470
+ "kind": string().readonly(),
4471
+ "path": string().readonly()
4472
+ }).readonly().optional(),
4473
+ "sessionId": intersection(string(), unknown()).readonly().optional(),
4474
+ "remediable": boolean().readonly().optional()
4475
+ }).readonly().optional(),
4440
4476
  "capabilityWarnings": union([_undefined(), array(object({
4441
4477
  "name": string().readonly(),
4442
4478
  "knownNames": array(string()).readonly()
@@ -4476,11 +4512,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4476
4512
  });
4477
4513
  const _wowyuarm_dsh_agent_team_agentTeam_inbox_parameter_0$schema = object({
4478
4514
  "workspaceId": intersection(string(), unknown()).readonly(),
4479
- "limit": number().readonly().optional()
4515
+ "limit": number().readonly().optional(),
4516
+ "directOnly": boolean().readonly().optional()
4480
4517
  });
4481
4518
  const _wowyuarm_dsh_agent_team_agentTeam_inbox_result$schema = object({
4482
4519
  "items": array(object({
4483
4520
  "channelRef": intersection(string(), unknown()).readonly(),
4521
+ "channelName": string().readonly().optional(),
4484
4522
  "task": object({
4485
4523
  "taskRef": intersection(string(), unknown()).readonly(),
4486
4524
  "channelRef": intersection(string(), unknown()).readonly(),
@@ -4498,6 +4536,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4498
4536
  literal("accepted")
4499
4537
  ]).readonly()
4500
4538
  }).readonly().optional(),
4539
+ "taskNumber": number().readonly().optional(),
4501
4540
  "thread": object({
4502
4541
  "threadRef": intersection(string(), unknown()).readonly(),
4503
4542
  "taskRef": intersection(string(), unknown()).readonly().optional(),
@@ -4505,6 +4544,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4505
4544
  }).readonly(),
4506
4545
  "unreadCount": number().readonly(),
4507
4546
  "directCount": number().readonly(),
4547
+ "previewText": string().readonly().optional(),
4508
4548
  "newestSequence": number().readonly(),
4509
4549
  "newestOccurredAt": string().readonly(),
4510
4550
  "attention": object({
@@ -4571,7 +4611,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4571
4611
  literal("working"),
4572
4612
  literal("error")
4573
4613
  ]).readonly(),
4574
- "diagnostic": string().readonly().optional(),
4614
+ "diagnostic": object({
4615
+ "class": union([
4616
+ literal("session-refused"),
4617
+ literal("session-unreadable"),
4618
+ literal("preset-composition"),
4619
+ literal("rollover"),
4620
+ literal("runtime"),
4621
+ literal("activation")
4622
+ ]).readonly(),
4623
+ "detail": string().readonly(),
4624
+ "location": object({
4625
+ "kind": string().readonly(),
4626
+ "path": string().readonly()
4627
+ }).readonly().optional(),
4628
+ "sessionId": intersection(string(), unknown()).readonly().optional(),
4629
+ "remediable": boolean().readonly().optional()
4630
+ }).readonly().optional(),
4575
4631
  "capabilityWarnings": union([_undefined(), array(object({
4576
4632
  "name": string().readonly(),
4577
4633
  "knownNames": array(string()).readonly()
@@ -4673,7 +4729,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4673
4729
  "requestId": intersection(string(), unknown()).readonly(),
4674
4730
  "sequence": number().readonly(),
4675
4731
  "occurredAt": string().readonly()
4676
- }).readonly(),
4732
+ }).readonly().optional(),
4677
4733
  "task": object({
4678
4734
  "taskRef": intersection(string(), unknown()).readonly(),
4679
4735
  "channelRef": intersection(string(), unknown()).readonly(),
@@ -4819,8 +4875,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4819
4875
  "hardLimit": union([_undefined(), number()]).readonly().optional(),
4820
4876
  "action": union([
4821
4877
  literal("unavailable"),
4822
- literal("keep"),
4823
4878
  literal("rollover"),
4879
+ literal("keep"),
4824
4880
  literal("handoff-now")
4825
4881
  ]).readonly(),
4826
4882
  "guidance": string().readonly()
@@ -4869,7 +4925,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4869
4925
  literal("working"),
4870
4926
  literal("error")
4871
4927
  ]).readonly(),
4872
- "diagnostic": string().readonly().optional(),
4928
+ "diagnostic": object({
4929
+ "class": union([
4930
+ literal("session-refused"),
4931
+ literal("session-unreadable"),
4932
+ literal("preset-composition"),
4933
+ literal("rollover"),
4934
+ literal("runtime"),
4935
+ literal("activation")
4936
+ ]).readonly(),
4937
+ "detail": string().readonly(),
4938
+ "location": object({
4939
+ "kind": string().readonly(),
4940
+ "path": string().readonly()
4941
+ }).readonly().optional(),
4942
+ "sessionId": intersection(string(), unknown()).readonly().optional(),
4943
+ "remediable": boolean().readonly().optional()
4944
+ }).readonly().optional(),
4873
4945
  "capabilityWarnings": union([_undefined(), array(object({
4874
4946
  "name": string().readonly(),
4875
4947
  "knownNames": array(string()).readonly()
@@ -5348,7 +5420,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5348
5420
  literal("working"),
5349
5421
  literal("error")
5350
5422
  ]).readonly(),
5351
- "diagnostic": string().readonly().optional(),
5423
+ "diagnostic": object({
5424
+ "class": union([
5425
+ literal("session-refused"),
5426
+ literal("session-unreadable"),
5427
+ literal("preset-composition"),
5428
+ literal("rollover"),
5429
+ literal("runtime"),
5430
+ literal("activation")
5431
+ ]).readonly(),
5432
+ "detail": string().readonly(),
5433
+ "location": object({
5434
+ "kind": string().readonly(),
5435
+ "path": string().readonly()
5436
+ }).readonly().optional(),
5437
+ "sessionId": intersection(string(), unknown()).readonly().optional(),
5438
+ "remediable": boolean().readonly().optional()
5439
+ }).readonly().optional(),
5352
5440
  "capabilityWarnings": union([_undefined(), array(object({
5353
5441
  "name": string().readonly(),
5354
5442
  "knownNames": array(string()).readonly()
@@ -5532,7 +5620,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5532
5620
  },
5533
5621
  sourceLocation: {
5534
5622
  "file": "packages/agent-team/src/index.ts",
5535
- "line": 653,
5623
+ "line": 718,
5536
5624
  "column": 9
5537
5625
  }
5538
5626
  },
@@ -5559,7 +5647,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5559
5647
  },
5560
5648
  sourceLocation: {
5561
5649
  "file": "packages/agent-team/src/index.ts",
5562
- "line": 643,
5650
+ "line": 708,
5563
5651
  "column": 9
5564
5652
  }
5565
5653
  },
@@ -5586,7 +5674,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5586
5674
  },
5587
5675
  sourceLocation: {
5588
5676
  "file": "packages/agent-team/src/index.ts",
5589
- "line": 1024,
5677
+ "line": 1105,
5590
5678
  "column": 9
5591
5679
  }
5592
5680
  },
@@ -5613,7 +5701,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5613
5701
  },
5614
5702
  sourceLocation: {
5615
5703
  "file": "packages/agent-team/src/index.ts",
5616
- "line": 1146,
5704
+ "line": 1227,
5617
5705
  "column": 9
5618
5706
  }
5619
5707
  },
@@ -5641,7 +5729,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5641
5729
  },
5642
5730
  sourceLocation: {
5643
5731
  "file": "packages/agent-team/src/index.ts",
5644
- "line": 575,
5732
+ "line": 639,
5645
5733
  "column": 9
5646
5734
  }
5647
5735
  },
@@ -5668,7 +5756,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5668
5756
  },
5669
5757
  sourceLocation: {
5670
5758
  "file": "packages/agent-team/src/index.ts",
5671
- "line": 1036,
5759
+ "line": 1117,
5672
5760
  "column": 9
5673
5761
  }
5674
5762
  },
@@ -5695,7 +5783,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5695
5783
  },
5696
5784
  sourceLocation: {
5697
5785
  "file": "packages/agent-team/src/index.ts",
5698
- "line": 752,
5786
+ "line": 833,
5699
5787
  "column": 9
5700
5788
  }
5701
5789
  },
@@ -5722,7 +5810,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5722
5810
  },
5723
5811
  sourceLocation: {
5724
5812
  "file": "packages/agent-team/src/index.ts",
5725
- "line": 616,
5813
+ "line": 681,
5726
5814
  "column": 9
5727
5815
  }
5728
5816
  },
@@ -5749,7 +5837,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5749
5837
  },
5750
5838
  sourceLocation: {
5751
5839
  "file": "packages/agent-team/src/index.ts",
5752
- "line": 1132,
5840
+ "line": 1213,
5753
5841
  "column": 9
5754
5842
  }
5755
5843
  },
@@ -5776,7 +5864,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5776
5864
  },
5777
5865
  sourceLocation: {
5778
5866
  "file": "packages/agent-team/src/index.ts",
5779
- "line": 1155,
5867
+ "line": 1236,
5780
5868
  "column": 3
5781
5869
  }
5782
5870
  },
@@ -5803,7 +5891,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5803
5891
  },
5804
5892
  sourceLocation: {
5805
5893
  "file": "packages/agent-team/src/index.ts",
5806
- "line": 1056,
5894
+ "line": 1137,
5807
5895
  "column": 9
5808
5896
  }
5809
5897
  },
@@ -5831,7 +5919,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5831
5919
  },
5832
5920
  sourceLocation: {
5833
5921
  "file": "packages/agent-team/src/index.ts",
5834
- "line": 566,
5922
+ "line": 630,
5835
5923
  "column": 3
5836
5924
  }
5837
5925
  },
@@ -5858,7 +5946,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5858
5946
  },
5859
5947
  sourceLocation: {
5860
5948
  "file": "packages/agent-team/src/index.ts",
5861
- "line": 1046,
5949
+ "line": 1127,
5862
5950
  "column": 9
5863
5951
  }
5864
5952
  },
@@ -5885,7 +5973,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5885
5973
  },
5886
5974
  sourceLocation: {
5887
5975
  "file": "packages/agent-team/src/index.ts",
5888
- "line": 1119,
5976
+ "line": 1200,
5889
5977
  "column": 9
5890
5978
  }
5891
5979
  },
@@ -5912,7 +6000,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5912
6000
  },
5913
6001
  sourceLocation: {
5914
6002
  "file": "packages/agent-team/src/index.ts",
5915
- "line": 1162,
6003
+ "line": 1243,
5916
6004
  "column": 9
5917
6005
  }
5918
6006
  },
@@ -5939,7 +6027,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5939
6027
  },
5940
6028
  sourceLocation: {
5941
6029
  "file": "packages/agent-team/src/index.ts",
5942
- "line": 713,
6030
+ "line": 778,
5943
6031
  "column": 9
5944
6032
  }
5945
6033
  },
@@ -5966,7 +6054,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5966
6054
  },
5967
6055
  sourceLocation: {
5968
6056
  "file": "packages/agent-team/src/index.ts",
5969
- "line": 1067,
6057
+ "line": 1148,
5970
6058
  "column": 9
5971
6059
  }
5972
6060
  },
@@ -5993,7 +6081,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5993
6081
  },
5994
6082
  sourceLocation: {
5995
6083
  "file": "packages/agent-team/src/index.ts",
5996
- "line": 1140,
6084
+ "line": 1221,
5997
6085
  "column": 9
5998
6086
  }
5999
6087
  },
@@ -6020,7 +6108,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6020
6108
  },
6021
6109
  sourceLocation: {
6022
6110
  "file": "packages/agent-team/src/index.ts",
6023
- "line": 553,
6111
+ "line": 617,
6024
6112
  "column": 3
6025
6113
  }
6026
6114
  },
@@ -6047,7 +6135,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6047
6135
  },
6048
6136
  sourceLocation: {
6049
6137
  "file": "packages/agent-team/src/index.ts",
6050
- "line": 1076,
6138
+ "line": 1157,
6051
6139
  "column": 9
6052
6140
  }
6053
6141
  },
@@ -6074,7 +6162,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6074
6162
  },
6075
6163
  sourceLocation: {
6076
6164
  "file": "packages/agent-team/src/index.ts",
6077
- "line": 1178,
6165
+ "line": 1261,
6078
6166
  "column": 3
6079
6167
  }
6080
6168
  },
@@ -6101,7 +6189,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6101
6189
  },
6102
6190
  sourceLocation: {
6103
6191
  "file": "packages/agent-team/src/index.ts",
6104
- "line": 1171,
6192
+ "line": 1254,
6105
6193
  "column": 3
6106
6194
  }
6107
6195
  },
@@ -6128,7 +6216,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6128
6216
  },
6129
6217
  sourceLocation: {
6130
6218
  "file": "packages/agent-team/src/index.ts",
6131
- "line": 628,
6219
+ "line": 693,
6132
6220
  "column": 9
6133
6221
  }
6134
6222
  },
@@ -6155,7 +6243,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6155
6243
  },
6156
6244
  sourceLocation: {
6157
6245
  "file": "packages/agent-team/src/index.ts",
6158
- "line": 964,
6246
+ "line": 1045,
6159
6247
  "column": 9
6160
6248
  }
6161
6249
  },
@@ -6182,7 +6270,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6182
6270
  },
6183
6271
  sourceLocation: {
6184
6272
  "file": "packages/agent-team/src/index.ts",
6185
- "line": 1185,
6273
+ "line": 1268,
6186
6274
  "column": 3
6187
6275
  }
6188
6276
  }
@@ -6200,6 +6288,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6200
6288
  mode: parsed.mode === "team" ? "team" : "conversation",
6201
6289
  ...typeof parsed.workspaceId === "string" ? { workspaceId: parsed.workspaceId } : {},
6202
6290
  ...typeof parsed.channelRef === "string" ? { channelRef: parsed.channelRef } : {},
6291
+ ...parsed.inbox === true ? { inbox: true } : {},
6203
6292
  ...hasThread ? {
6204
6293
  threadRef: parsed.threadRef,
6205
6294
  ...typeof parsed.taskRef === "string" ? { taskRef: parsed.taskRef } : {},
@@ -6213,11 +6302,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6213
6302
  function persistSnapshot(snapshot) {
6214
6303
  if (typeof localStorage === "undefined") return;
6215
6304
  try {
6216
- const { mode, workspaceId, channelRef, taskRef, threadRef, taskNumber } = snapshot;
6305
+ const { mode, workspaceId, channelRef, taskRef, threadRef, taskNumber, inbox } = snapshot;
6217
6306
  localStorage.setItem(STORAGE_KEY$3, JSON.stringify({
6218
6307
  mode,
6219
6308
  ...workspaceId === void 0 ? {} : { workspaceId },
6220
6309
  ...channelRef === void 0 ? {} : { channelRef },
6310
+ ...inbox === true ? { inbox: true } : {},
6221
6311
  ...taskRef === void 0 ? {} : { taskRef },
6222
6312
  ...threadRef === void 0 ? {} : { threadRef },
6223
6313
  ...taskNumber === void 0 ? {} : { taskNumber }
@@ -6256,6 +6346,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6256
6346
  this.clearMemberSession();
6257
6347
  this.setThread(threadRef, channelRef, taskRef, taskNumber);
6258
6348
  },
6349
+ selectInbox: () => {
6350
+ this.clearMemberSession();
6351
+ this.setInbox();
6352
+ },
6259
6353
  backToWorkspace: () => {
6260
6354
  this.clearMemberSession();
6261
6355
  this.setThread(void 0);
@@ -6302,8 +6396,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6302
6396
  this.commit();
6303
6397
  }
6304
6398
  setWorkspace(workspaceId) {
6305
- if (this.snapshot.workspaceId === workspaceId) return;
6306
- const { channelRef: _channelRef, taskRef: _taskRef, threadRef: _threadRef, taskNumber: _taskNumber, ...base } = this.snapshot;
6399
+ if (this.snapshot.workspaceId === workspaceId && this.snapshot.inbox !== true) return;
6400
+ const { channelRef: _channelRef, taskRef: _taskRef, threadRef: _threadRef, taskNumber: _taskNumber, inbox: _inbox, ...base } = this.snapshot;
6307
6401
  this.snapshot = {
6308
6402
  ...base,
6309
6403
  workspaceId
@@ -6311,14 +6405,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6311
6405
  this.commit();
6312
6406
  }
6313
6407
  setChannel(channelRef) {
6314
- if (this.snapshot.channelRef === channelRef && this.snapshot.threadRef === void 0) return;
6315
- const { taskRef: _taskRef, threadRef: _threadRef, taskNumber: _taskNumber, ...base } = this.snapshot;
6408
+ if (this.snapshot.channelRef === channelRef && this.snapshot.threadRef === void 0 && this.snapshot.inbox !== true) return;
6409
+ const { taskRef: _taskRef, threadRef: _threadRef, taskNumber: _taskNumber, inbox: _inbox, ...base } = this.snapshot;
6316
6410
  this.snapshot = {
6317
6411
  ...base,
6318
6412
  channelRef
6319
6413
  };
6320
6414
  this.commit();
6321
6415
  }
6416
+ /** The Inbox is a face, not workspace content: selecting a Workspace leaves it. */
6417
+ setInbox() {
6418
+ if (this.snapshot.inbox === true && this.snapshot.channelRef === void 0 && this.snapshot.threadRef === void 0) return;
6419
+ const { channelRef: _channelRef, taskRef: _taskRef, threadRef: _threadRef, taskNumber: _taskNumber, ...base } = this.snapshot;
6420
+ this.snapshot = {
6421
+ ...base,
6422
+ inbox: true
6423
+ };
6424
+ this.commit();
6425
+ }
6322
6426
  clearChannel() {
6323
6427
  const { channelRef: _channelRef, ...base } = this.snapshot;
6324
6428
  if (this.snapshot.channelRef === void 0) return;
@@ -6326,12 +6430,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6326
6430
  this.commit();
6327
6431
  }
6328
6432
  setThread(threadRef, channelRef, taskRef, taskNumber) {
6329
- if (this.snapshot.threadRef === threadRef && this.snapshot.taskRef === taskRef && this.snapshot.channelRef === channelRef && this.snapshot.taskNumber === taskNumber) return;
6433
+ if (this.snapshot.threadRef === threadRef && this.snapshot.taskRef === taskRef && this.snapshot.channelRef === channelRef && this.snapshot.taskNumber === taskNumber && this.snapshot.inbox !== true) return;
6330
6434
  if (threadRef === void 0) {
6331
6435
  const { taskRef: _taskRef, threadRef: _threadRef, taskNumber: _taskNumber, ...base } = this.snapshot;
6332
6436
  this.snapshot = base;
6333
6437
  } else {
6334
- const { channelRef: _channelRef, taskRef: _taskRef, threadRef: _threadRef, taskNumber: _taskNumber, ...base } = this.snapshot;
6438
+ const { channelRef: _channelRef, taskRef: _taskRef, threadRef: _threadRef, taskNumber: _taskNumber, inbox: _inbox, ...base } = this.snapshot;
6335
6439
  this.snapshot = {
6336
6440
  ...base,
6337
6441
  threadRef,
@@ -6350,16 +6454,27 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6350
6454
  //#endregion
6351
6455
  //#region src/client/team-changes.ts
6352
6456
  function scopeKey(scope) {
6353
- return scope.kind === "workspace" ? `workspace:${scope.workspaceId}` : scope.kind === "channel" ? `channel:${scope.channelRef}` : `thread:${scope.threadRef}`;
6457
+ return scope === void 0 ? "all" : scope.kind === "workspace" ? `workspace:${scope.workspaceId}` : scope.kind === "channel" ? `channel:${scope.channelRef}` : scope.kind === "presence" ? `presence:${scope.workspaceId}` : `thread:${scope.threadRef}`;
6354
6458
  }
6355
6459
  /**
6356
6460
  * One long-poll per change scope, shared by every listening surface: panels
6357
6461
  * and pages never open parallel `changes` requests for the same scope, and
6358
6462
  * the poll is aborted as soon as the last subscriber leaves.
6463
+ *
6464
+ * Each poll keeps its own cursor, and a cursor only means something inside the
6465
+ * scope it was issued for: the Host answers a presence scope from a
6466
+ * process-local wake epoch and every other scope from a durable ledger
6467
+ * position.
6359
6468
  */
6360
6469
  var TeamChangeStream = class {
6361
6470
  changes;
6362
6471
  polls = /* @__PURE__ */ new Map();
6472
+ /**
6473
+ * The last version each scope key answered with, kept after that scope's poll
6474
+ * is torn down: a commit landing while no poll exists is otherwise folded into
6475
+ * the replacement poll's opening sample, which reports nothing.
6476
+ */
6477
+ observed = /* @__PURE__ */ new Map();
6363
6478
  constructor(changes) {
6364
6479
  this.changes = changes;
6365
6480
  }
@@ -6369,7 +6484,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6369
6484
  if (poll === void 0) {
6370
6485
  poll = {
6371
6486
  controller: new AbortController(),
6372
- listeners: /* @__PURE__ */ new Set()
6487
+ listeners: /* @__PURE__ */ new Set(),
6488
+ resumeFrom: this.observed.get(key)
6373
6489
  };
6374
6490
  this.polls.set(key, poll);
6375
6491
  this.run(key, scope, poll);
@@ -6386,27 +6502,30 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6386
6502
  }
6387
6503
  async run(key, scope, poll) {
6388
6504
  const { signal } = poll.controller;
6389
- const probe = await this.changes({
6390
- afterVersion: 0,
6391
- scope
6392
- }, signal);
6393
- if (signal.aborted) return;
6394
- if (!probe.ok) {
6395
- this.fail(key, poll, probe.error.message);
6396
- return;
6505
+ const request = (afterVersion) => ({
6506
+ afterVersion,
6507
+ ...scope === void 0 ? {} : { scope }
6508
+ });
6509
+ let version = poll.resumeFrom;
6510
+ if (version === void 0) {
6511
+ const probe = await this.changes(request(0), signal);
6512
+ if (signal.aborted) return;
6513
+ if (!probe.ok) {
6514
+ this.fail(key, poll, probe.error.message);
6515
+ return;
6516
+ }
6517
+ version = probe.value.version;
6518
+ this.observed.set(key, version);
6397
6519
  }
6398
- let version = probe.value.version;
6399
6520
  while (!signal.aborted) {
6400
- const result = await this.changes({
6401
- afterVersion: version,
6402
- scope
6403
- }, signal);
6521
+ const result = await this.changes(request(version), signal);
6404
6522
  if (signal.aborted) return;
6405
6523
  if (!result.ok) {
6406
6524
  this.fail(key, poll, result.error.message);
6407
6525
  return;
6408
6526
  }
6409
- if (result.value.version > version) {
6527
+ this.observed.set(key, result.value.version);
6528
+ if (result.value.version !== version) {
6410
6529
  version = result.value.version;
6411
6530
  for (const listener of poll.listeners) listener({
6412
6531
  type: "changed",
@@ -6423,6 +6542,27 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6423
6542
  });
6424
6543
  }
6425
6544
  };
6545
+ /**
6546
+ * The Host's `changes` stream never wakes on a Thread read — a read advances
6547
+ * only the reader's private watermark, so no shared projection changes. A
6548
+ * durable read does consume the reader's own mention markers, so the Human's
6549
+ * badge and Inbox page refresh from the completed read itself instead of
6550
+ * waiting for the next unrelated commit.
6551
+ */
6552
+ var TeamReadStream = class {
6553
+ version = 0;
6554
+ listeners = /* @__PURE__ */ new Set();
6555
+ bump() {
6556
+ this.version += 1;
6557
+ for (const listener of this.listeners) listener();
6558
+ }
6559
+ subscribe(listener) {
6560
+ this.listeners.add(listener);
6561
+ return () => {
6562
+ this.listeners.delete(listener);
6563
+ };
6564
+ }
6565
+ };
6426
6566
  //#endregion
6427
6567
  //#region src/client/drafts.ts
6428
6568
  const STORAGE_KEY$2 = "dsh.agent-team.drafts.v1";
@@ -6555,13 +6695,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6555
6695
  };
6556
6696
  //#endregion
6557
6697
  //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/team.module.css.mjs
6558
- const css$9 = ".YvAbSa_footerStack{flex:none;width:100%;height:42px;margin:8px 0 0;display:flex}.YvAbSa_footerAction,.YvAbSa_settingsAction{box-sizing:border-box;color:var(--dsw-alias-label-primary);cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:8px;width:calc(100% + 4px);height:42px;padding:0 10px 0 8px;font-family:inherit;font-size:14px;line-height:22px;display:flex;overflow:hidden}.YvAbSa_footerAction{margin:0 -2px}.YvAbSa_settingsAction{margin:4px -2px}.YvAbSa_footerAction:hover,.YvAbSa_footerAction:focus-visible,.YvAbSa_settingsAction:hover,.YvAbSa_settingsAction:focus-visible{background:var(--dsw-alias-interactive-bg-hover);outline:none}.YvAbSa_footerAction.YvAbSa_rail,.YvAbSa_settingsAction.YvAbSa_rail{border-radius:50%;justify-content:center;width:36px;height:36px;padding:0}.YvAbSa_footerAction.YvAbSa_rail{margin:0}.YvAbSa_settingsAction.YvAbSa_rail{margin:8px 0 10px}.YvAbSa_railStack{align-items:center;width:36px;height:36px;margin:0}";
6559
- const tagId$9 = "@wowyuarm/dsh-agent-team/team.module.css";
6560
- if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$9) + "]") === null) {
6698
+ const css$10 = ".YvAbSa_footerStack{flex:none;width:100%;height:42px;margin:8px 0 0;display:flex}.YvAbSa_footerAction,.YvAbSa_settingsAction{box-sizing:border-box;color:var(--dsw-alias-label-primary);cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:8px;width:calc(100% + 4px);height:42px;padding:0 10px 0 8px;font-family:inherit;font-size:14px;line-height:22px;display:flex;overflow:hidden}.YvAbSa_footerAction{margin:0 -2px}.YvAbSa_settingsAction{margin:4px -2px}.YvAbSa_footerAction:hover,.YvAbSa_footerAction:focus-visible,.YvAbSa_settingsAction:hover,.YvAbSa_settingsAction:focus-visible{background:var(--dsw-alias-interactive-bg-hover)}.YvAbSa_footerAction:focus-visible,.YvAbSa_settingsAction:focus-visible{outline:2px solid var(--dsw-alias-label-primary);outline-offset:-2px}.YvAbSa_footerAction.YvAbSa_rail,.YvAbSa_settingsAction.YvAbSa_rail{corner-shape:round;border-radius:50%;justify-content:center;width:36px;height:36px;padding:0}.YvAbSa_footerAction.YvAbSa_rail{margin:0}.YvAbSa_settingsAction.YvAbSa_rail{margin:8px 0 10px}.YvAbSa_railStack{align-items:center;width:36px;height:36px;margin:0}";
6699
+ const tagId$10 = "@wowyuarm/dsh-agent-team/team.module.css";
6700
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$10) + "]") === null) {
6561
6701
  const tag = document.createElement("style");
6562
6702
  tag.dataset.plugin = "@wowyuarm/dsh-agent-team";
6563
- tag.dataset.pluginCss = tagId$9;
6564
- tag.textContent = css$9;
6703
+ tag.dataset.pluginCss = tagId$10;
6704
+ tag.textContent = css$10;
6565
6705
  document.head.appendChild(tag);
6566
6706
  }
6567
6707
  var team_module_css_default = {
@@ -6605,13 +6745,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6605
6745
  }
6606
6746
  //#endregion
6607
6747
  //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/state-dot.module.css.mjs
6608
- const css$8 = ".DalNWW_quiet{border-radius:50%;flex:none;display:inline-block;position:relative}.DalNWW_quiet[data-variant=todo]{border:1px solid var(--dsw-alias-label-tertiary)}.DalNWW_quiet[data-variant=quiet]{color:var(--dsw-alias-label-tertiary)}.DalNWW_quiet[data-variant=quiet]:before{content:\"\";opacity:.1;background:currentColor;border-radius:50%;position:absolute;inset:0}.DalNWW_quiet[data-variant=quiet]:after{content:\"\";background:currentColor;border-radius:50%;position:absolute;inset:20%}";
6609
- const tagId$8 = "@wowyuarm/dsh-agent-team/state-dot.module.css";
6610
- if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$8) + "]") === null) {
6748
+ const css$9 = ".DalNWW_quiet{corner-shape:round;border-radius:50%;flex:none;display:inline-block;position:relative}.DalNWW_quiet[data-variant=todo]{border:1px solid var(--dsw-alias-label-tertiary)}.DalNWW_quiet[data-variant=quiet]{color:var(--dsw-alias-label-tertiary)}.DalNWW_quiet[data-variant=quiet]:before{corner-shape:round;content:\"\";opacity:.1;background:currentColor;border-radius:50%;position:absolute;inset:0}.DalNWW_quiet[data-variant=quiet]:after{corner-shape:round;content:\"\";background:currentColor;border-radius:50%;position:absolute;inset:20%}";
6749
+ const tagId$9 = "@wowyuarm/dsh-agent-team/state-dot.module.css";
6750
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$9) + "]") === null) {
6611
6751
  const tag = document.createElement("style");
6612
6752
  tag.dataset.plugin = "@wowyuarm/dsh-agent-team";
6613
- tag.dataset.pluginCss = tagId$8;
6614
- tag.textContent = css$8;
6753
+ tag.dataset.pluginCss = tagId$9;
6754
+ tag.textContent = css$9;
6615
6755
  document.head.appendChild(tag);
6616
6756
  }
6617
6757
  var state_dot_module_css_default = { "quiet": "DalNWW_quiet" };
@@ -6640,13 +6780,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6640
6780
  }
6641
6781
  //#endregion
6642
6782
  //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/presence.module.css.mjs
6643
- const css$7 = ".-\\36 lQ-q_target{flex:0 0 14px;justify-content:center;align-items:center;display:inline-flex}";
6644
- const tagId$7 = "@wowyuarm/dsh-agent-team/presence.module.css";
6645
- if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$7) + "]") === null) {
6783
+ const css$8 = ".-\\36 lQ-q_target{flex:0 0 14px;justify-content:center;align-items:center;display:inline-flex}";
6784
+ const tagId$8 = "@wowyuarm/dsh-agent-team/presence.module.css";
6785
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$8) + "]") === null) {
6646
6786
  const tag = document.createElement("style");
6647
6787
  tag.dataset.plugin = "@wowyuarm/dsh-agent-team";
6648
- tag.dataset.pluginCss = tagId$7;
6649
- tag.textContent = css$7;
6788
+ tag.dataset.pluginCss = tagId$8;
6789
+ tag.textContent = css$8;
6650
6790
  document.head.appendChild(tag);
6651
6791
  }
6652
6792
  var presence_module_css_default = { "target": "-6lQ-q_target" };
@@ -6654,7 +6794,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6654
6794
  //#region src/client/TeamPresenceDot.tsx
6655
6795
  function presenceLabel(status, t) {
6656
6796
  const label = status.presence === "available" ? t("statusAvailable") : status.presence === "working" ? t("statusWorking") : status.presence === "error" ? t("statusError") : t("statusUnavailable");
6657
- return status.diagnostic === void 0 ? label : `${label}: ${status.diagnostic}`;
6797
+ return status.diagnostic === void 0 ? label : `${label}: ${diagnosticText(status)}`;
6798
+ }
6799
+ /** One line of human-readable diagnostic text: the reason, plus the refused artifact path when one was reported. */
6800
+ function diagnosticText(status) {
6801
+ const diagnostic = status.diagnostic;
6802
+ if (diagnostic === void 0) return "";
6803
+ return diagnostic.location === void 0 ? diagnostic.detail : `${diagnostic.detail} (${diagnostic.location.path})`;
6804
+ }
6805
+ /**
6806
+ * Whether the restart action can help an unavailable Member: it heals
6807
+ * transient and repairable failures, but not a transient rollover window
6808
+ * (which resolves on its own) or a refusal already proven non-remediable.
6809
+ */
6810
+ function restartOffered(status) {
6811
+ const diagnostic = status.diagnostic;
6812
+ if (diagnostic === void 0) return true;
6813
+ if (diagnostic.class === "rollover") return false;
6814
+ return !(diagnostic.class === "session-refused" && diagnostic.remediable === false);
6658
6815
  }
6659
6816
  /** Shared presence → indicator mapping for dots and avatar badges. */
6660
6817
  function presenceDotState(presence) {
@@ -6675,13 +6832,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6675
6832
  }
6676
6833
  //#endregion
6677
6834
  //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/members.module.css.mjs
6678
- const css$6 = ".UkovOW_body{max-height:min(65vh,560px);overflow-y:auto}.UkovOW_content{outline:none;gap:12px;display:grid}.UkovOW_group{gap:3px;display:grid}.UkovOW_group+.UkovOW_group{border-top:1px solid var(--dsw-alias-border-l2);padding-top:10px}.UkovOW_group h3{color:var(--dsw-alias-label-secondary);margin:0 0 3px;font-size:12px;font-weight:600;line-height:18px}.UkovOW_member{border-radius:6px;grid-template-columns:14px minmax(0,1fr);align-items:center;gap:0 8px;min-height:36px;padding:4px 6px;display:grid}.UkovOW_member:hover{background:var(--dsw-alias-interactive-bg-hover)}.UkovOW_copy{min-width:0;display:grid}.UkovOW_copy strong{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:18px;overflow:hidden}.UkovOW_copy small{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:10px;line-height:14px;overflow:hidden}.UkovOW_state,.UkovOW_error{margin:0;padding:6px 0;font-size:12px;line-height:18px}.UkovOW_state{color:var(--dsw-alias-label-tertiary)}.UkovOW_error{color:var(--dsw-alias-state-error-primary)}@media (width<=600px){.UkovOW_body{max-height:calc(100vh - 160px)}}";
6679
- const tagId$6 = "@wowyuarm/dsh-agent-team/members.module.css";
6680
- if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$6) + "]") === null) {
6835
+ const css$7 = ".UkovOW_body{max-height:min(65vh,560px);overflow-y:auto}.UkovOW_content{outline:none;gap:12px;display:grid}.UkovOW_group{gap:3px;display:grid}.UkovOW_group+.UkovOW_group{border-top:1px solid var(--dsw-alias-border-l2);padding-top:10px}.UkovOW_group h3{color:var(--dsw-alias-label-secondary);margin:0 0 3px;font-size:12px;font-weight:600;line-height:18px}.UkovOW_member{border-radius:6px;grid-template-columns:14px minmax(0,1fr);align-items:center;gap:0 8px;min-height:36px;padding:4px 6px;display:grid}.UkovOW_member:hover{background:var(--dsw-alias-interactive-bg-hover)}.UkovOW_copy{min-width:0;display:grid}.UkovOW_copy strong{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:18px;overflow:hidden}.UkovOW_copy small{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:10px;line-height:14px;overflow:hidden}.UkovOW_state,.UkovOW_error{margin:0;padding:6px 0;font-size:12px;line-height:18px}.UkovOW_state{color:var(--dsw-alias-label-tertiary)}.UkovOW_error{color:var(--dsw-alias-state-error-primary)}@media (width<=600px){.UkovOW_body{max-height:calc(100vh - 160px)}}";
6836
+ const tagId$7 = "@wowyuarm/dsh-agent-team/members.module.css";
6837
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$7) + "]") === null) {
6681
6838
  const tag = document.createElement("style");
6682
6839
  tag.dataset.plugin = "@wowyuarm/dsh-agent-team";
6683
- tag.dataset.pluginCss = tagId$6;
6684
- tag.textContent = css$6;
6840
+ tag.dataset.pluginCss = tagId$7;
6841
+ tag.textContent = css$7;
6685
6842
  document.head.appendChild(tag);
6686
6843
  }
6687
6844
  var members_module_css_default = {
@@ -6828,19 +6985,46 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6828
6985
  //#region src/client/requests.ts
6829
6986
  /** Fresh idempotency identity for one Client-initiated durable request. */
6830
6987
  const mintRequestId = () => crypto.randomUUID();
6988
+ /**
6989
+ * Upload composer files in order. One failure stops with the error text; the
6990
+ * caller keeps its chips so a retry uploads only the still-pending files.
6991
+ */
6992
+ const uploadComposerFiles = async (putAttachment, workspaceId, files) => {
6993
+ const attachmentIds = [];
6994
+ for (const file of files) {
6995
+ const uploaded = await putAttachment({
6996
+ requestId: mintRequestId(),
6997
+ workspaceId,
6998
+ name: file.name,
6999
+ mediaType: file.type === "" ? void 0 : file.type,
7000
+ bytesBase64: bytesToBase64(new Uint8Array(await file.arrayBuffer()))
7001
+ });
7002
+ if (!uploaded.ok) return {
7003
+ ok: false,
7004
+ error: uploaded.error.message
7005
+ };
7006
+ attachmentIds.push(uploaded.value.attachmentId);
7007
+ }
7008
+ return {
7009
+ ok: true,
7010
+ attachmentIds
7011
+ };
7012
+ };
6831
7013
  //#endregion
6832
7014
  //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/composer.module.css.mjs
6833
- 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_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}}";
6834
- const tagId$5 = "@wowyuarm/dsh-agent-team/composer.module.css";
6835
- if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$5) + "]") === null) {
7015
+ const css$6 = ".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_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{corner-shape:round;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:12px;min-height:34px;padding:2px 8px 6px;display:flex;container-type:inline-size}.x9jGQq_asTaskPill{color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:24px;flex:none;align-items:center;gap:4px;height:28px;padding:0 10px 0 8px;font-size:13px;font-weight:500;line-height:20px;display:inline-flex}.x9jGQq_asTaskPill:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.x9jGQq_asTaskPill:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-border-l3)}.x9jGQq_asTaskPill:disabled{color:var(--dsw-alias-label-dimmed);cursor:default}.x9jGQq_asTaskPillOn,.x9jGQq_asTaskPillOn:hover:not(:disabled){background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground)}.x9jGQq_asTaskLabel{white-space:nowrap}@container (width<=460px){.x9jGQq_asTaskPill .x9jGQq_asTaskLabel{display:none}}.x9jGQq_attachButton{background:var(--dsw-specific-selector);corner-shape:round;color:var(--dsw-alias-label-primary);cursor:pointer;border:0;border-radius:999px;flex:none;place-items:center;width:28px;height:28px;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)}.x9jGQq_fileChipRemove:focus-visible{outline:2px solid var(--dsw-alias-label-primary);outline-offset:1px}.x9jGQq_sendButton{background:var(--dsw-alias-button-info-fill,var(--dsw-alias-button-primary-fill));corner-shape:round;color:#fff;cursor:pointer;border:0;border-radius:999px;justify-content:center;align-items:center;width:34px;height:34px;margin-left:auto;padding:0;transition:background-color .1s,opacity .1s;display:inline-flex;transform:translateY(-2px)}.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:default;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}}";
7016
+ const tagId$6 = "@wowyuarm/dsh-agent-team/composer.module.css";
7017
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$6) + "]") === null) {
6836
7018
  const tag = document.createElement("style");
6837
7019
  tag.dataset.plugin = "@wowyuarm/dsh-agent-team";
6838
- tag.dataset.pluginCss = tagId$5;
6839
- tag.textContent = css$5;
7020
+ tag.dataset.pluginCss = tagId$6;
7021
+ tag.textContent = css$6;
6840
7022
  document.head.appendChild(tag);
6841
7023
  }
6842
7024
  var composer_module_css_default = {
6843
- "asTaskOn": "x9jGQq_asTaskOn",
7025
+ "asTaskLabel": "x9jGQq_asTaskLabel",
7026
+ "asTaskPill": "x9jGQq_asTaskPill",
7027
+ "asTaskPillOn": "x9jGQq_asTaskPillOn",
6844
7028
  "attachButton": "x9jGQq_attachButton",
6845
7029
  "card": "x9jGQq_card",
6846
7030
  "confirmation": "x9jGQq_confirmation",
@@ -6913,13 +7097,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6913
7097
  }
6914
7098
  return url;
6915
7099
  }
6916
- function TeamComposer({ members, followerMemberIds, recipients, draft, pending, confirmation, error, onDraftChange, onRecipientsChange, onSubmit, placeholder, pendingFiles, onFilesChange, asTask, onAsTaskChange, t }) {
7100
+ function TeamComposer({ members, followerMemberIds, drafts, draftKey, pending, confirmation, error, onEdit, onSubmit, placeholder, pendingFiles, onFilesChange, asTask, onAsTaskChange, t }) {
6917
7101
  const inputRef = (0, react.useRef)(null);
6918
7102
  const fileInputRef = (0, react.useRef)(null);
6919
7103
  const rootRef = (0, react.useRef)(null);
6920
7104
  const menuRef = (0, react.useRef)(null);
6921
7105
  const activeOptionRef = (0, react.useRef)(null);
6922
7106
  const composingRef = (0, react.useRef)(false);
7107
+ const { draft, recipients } = (0, react.useSyncExternalStore)(drafts.subscribe, () => drafts.getSnapshot(draftKey));
6923
7108
  const [mention, setMention] = (0, react.useState)();
6924
7109
  const [highlight, setHighlight] = (0, react.useState)(0);
6925
7110
  const memberCandidates = mention === void 0 ? [] : rankMentionCandidates(mentionCandidates(members, mention.query), followerMemberIds);
@@ -6976,7 +7161,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6976
7161
  const member = knownMembers.get(memberId);
6977
7162
  return member !== void 0 && containsMention(nextDraft, member.handle);
6978
7163
  }));
6979
- if (next.size !== recipients.size) onRecipientsChange(next);
7164
+ if (next.size !== recipients.size) drafts.writeRecipients(draftKey, next);
6980
7165
  };
6981
7166
  (0, react.useEffect)(() => {
6982
7167
  if (members.length === 0) return;
@@ -6993,13 +7178,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6993
7178
  };
6994
7179
  const onChange = (event) => {
6995
7180
  const nextDraft = event.target.value;
6996
- onDraftChange(nextDraft);
7181
+ drafts.writeDraft(draftKey, nextDraft);
7182
+ onEdit?.();
6997
7183
  pruneRecipients(nextDraft);
6998
7184
  updateMention(nextDraft, event.target.selectionStart ?? nextDraft.length);
6999
7185
  };
7000
7186
  const commitMention = (nextDraft, nextCaret, nextRecipients) => {
7001
- onDraftChange(nextDraft);
7002
- onRecipientsChange(nextRecipients);
7187
+ drafts.writeDraft(draftKey, nextDraft);
7188
+ drafts.writeRecipients(draftKey, nextRecipients);
7189
+ onEdit?.();
7003
7190
  setMention(void 0);
7004
7191
  setHighlight(0);
7005
7192
  requestAnimationFrame(() => {
@@ -7217,17 +7404,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7217
7404
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
7218
7405
  className: composer_module_css_default.toolbar,
7219
7406
  children: [
7220
- onAsTaskChange !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
7221
- size: "sm",
7222
- variant: "outline",
7223
- className: asTask === true ? composer_module_css_default.asTaskOn : void 0,
7224
- "aria-pressed": asTask === true,
7225
- disabled: pending,
7226
- onClick: () => {
7227
- onAsTaskChange(asTask !== true);
7228
- },
7229
- children: t("asTask")
7230
- }),
7231
7407
  onFilesChange !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
7232
7408
  ref: fileInputRef,
7233
7409
  type: "file",
@@ -7240,17 +7416,36 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7240
7416
  if (chosen.length > 0 && pendingFiles !== void 0) onFilesChange([...pendingFiles, ...chosen]);
7241
7417
  event.target.value = "";
7242
7418
  }
7243
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
7419
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
7420
+ label: t("attachFiles"),
7421
+ side: "top",
7422
+ delayMs: 500,
7423
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
7424
+ type: "button",
7425
+ className: composer_module_css_default.attachButton,
7426
+ "aria-label": t("attachFiles"),
7427
+ disabled: pending,
7428
+ onClick: () => {
7429
+ fileInputRef.current?.click();
7430
+ },
7431
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPaperclipOutline16, { size: 14 })
7432
+ })
7433
+ })] }),
7434
+ onAsTaskChange !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
7244
7435
  type: "button",
7245
- className: composer_module_css_default.attachButton,
7246
- "aria-label": t("attachFiles"),
7247
- title: t("attachFiles"),
7436
+ className: asTask === true ? `${composer_module_css_default.asTaskPill} ${composer_module_css_default.asTaskPillOn}` : composer_module_css_default.asTaskPill,
7437
+ "aria-label": t("asTask"),
7438
+ "aria-pressed": asTask === true,
7439
+ title: t("asTask"),
7248
7440
  disabled: pending,
7249
7441
  onClick: () => {
7250
- fileInputRef.current?.click();
7442
+ onAsTaskChange(asTask !== true);
7251
7443
  },
7252
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPlusOutline16, { size: 14 })
7253
- })] }),
7444
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChecklistOutline14, { size: 14 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
7445
+ className: composer_module_css_default.asTaskLabel,
7446
+ children: t("asTask")
7447
+ })]
7448
+ }),
7254
7449
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
7255
7450
  type: "submit",
7256
7451
  className: composer_module_css_default.sendButton,
@@ -7516,6 +7711,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7516
7711
  return !(MARKDOWN_BLOCK_CONSTRUCT.test(text) || MARKDOWN_INLINE_CONSTRUCT.test(text));
7517
7712
  }
7518
7713
  const pad$1 = (value) => String(value).padStart(2, "0");
7714
+ /** Absolute local `YYYY-MM-DD HH:mm` label: the precise instant behind every shorter form. */
7715
+ function formatAbsoluteTime(occurredAt) {
7716
+ const at = new Date(occurredAt);
7717
+ if (Number.isNaN(at.getTime())) return "";
7718
+ return `${at.getFullYear()}-${pad$1(at.getMonth() + 1)}-${pad$1(at.getDate())} ${pad$1(at.getHours())}:${pad$1(at.getMinutes())}`;
7719
+ }
7519
7720
  /**
7520
7721
  * Wall-clock label for one Message instant: time within the current day,
7521
7722
  * month-day time within the year, full date otherwise.
@@ -7523,11 +7724,30 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7523
7724
  function formatMessageTime(occurredAt, now = /* @__PURE__ */ new Date()) {
7524
7725
  const at = new Date(occurredAt);
7525
7726
  if (Number.isNaN(at.getTime())) return "";
7526
- const time = `${pad$1(at.getHours())}:${pad$1(at.getMinutes())}`;
7527
- if (at.getFullYear() === now.getFullYear() && at.getMonth() === now.getMonth() && at.getDate() === now.getDate()) return time;
7528
- const date = `${at.getFullYear()}-${pad$1(at.getMonth() + 1)}-${pad$1(at.getDate())}`;
7529
- if (at.getFullYear() === now.getFullYear()) return `${date.slice(5)} ${time}`;
7530
- return `${date} ${time}`;
7727
+ if (at.getFullYear() === now.getFullYear() && at.getMonth() === now.getMonth() && at.getDate() === now.getDate()) return `${pad$1(at.getHours())}:${pad$1(at.getMinutes())}`;
7728
+ const absolute = formatAbsoluteTime(occurredAt);
7729
+ return at.getFullYear() === now.getFullYear() ? absolute.slice(5) : absolute;
7730
+ }
7731
+ /**
7732
+ * Calendar days between two instants in the viewer's own zone, so "yesterday"
7733
+ * means yesterday locally rather than 24 hours earlier.
7734
+ */
7735
+ function calendarDayDelta(at, now) {
7736
+ const midnight = (date) => new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
7737
+ return Math.round((midnight(now) - midnight(at)) / 864e5);
7738
+ }
7739
+ /**
7740
+ * Queue label for one Inbox row's newest mention. The mention queue scans by
7741
+ * recency, so the two days a reader reasons about by name are named ("今天" /
7742
+ * "昨天") while everything older keeps the Message date form, so the row and
7743
+ * the Thread it opens agree about the same instant.
7744
+ */
7745
+ function formatInboxTime(occurredAt, t, now = /* @__PURE__ */ new Date()) {
7746
+ const at = new Date(occurredAt);
7747
+ if (Number.isNaN(at.getTime())) return "";
7748
+ const days = calendarDayDelta(at, now);
7749
+ if (days === 0 || days === 1) return `${t(days === 0 ? "inboxTimeToday" : "inboxTimeYesterday")} ${pad$1(at.getHours())}:${pad$1(at.getMinutes())}`;
7750
+ return formatMessageTime(occurredAt, now);
7531
7751
  }
7532
7752
  function formatActivity(activity, options) {
7533
7753
  const actor = options.actorName(activity.actor);
@@ -7592,13 +7812,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7592
7812
  }
7593
7813
  //#endregion
7594
7814
  //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/conversation.module.css.mjs
7595
- const css$4 = ".omcBaG_surface{grid-template-rows:auto minmax(0,1fr) auto;min-width:0;height:100%;min-height:0;display:grid;overflow:hidden}.omcBaG_surfaceHeader{border-bottom:1px solid var(--dsw-alias-border-l2);min-width:0;padding:14px clamp(18px,3vw,36px) 12px}.omcBaG_headerRow{justify-content:space-between;align-items:flex-start;gap:16px;min-width:0;max-width:880px;margin:0 auto;display:flex}.omcBaG_headerCopy{min-width:0}.omcBaG_headerCopy h1{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;margin:0;font-size:20px;font-weight:600;line-height:28px}.omcBaG_headerCopy p{color:var(--dsw-alias-label-secondary);margin:3px 0 0;font-size:13px;line-height:20px}.omcBaG_headerActions{flex:none;align-items:center;gap:6px;display:flex}.omcBaG_backRow{max-width:880px;margin:0 auto 8px}.omcBaG_timeline{overscroll-behavior:contain;scrollbar-gutter:stable;min-height:0;padding:12px clamp(18px,3vw,36px) 24px;overflow:hidden auto}.omcBaG_timelineContent{flex-direction:column;min-width:0;max-width:880px;min-height:100%;margin:0 auto;display:flex}.omcBaG_emptySurface{margin:auto;padding:32px 0}.omcBaG_emptySurface .omcBaG_emptyState{text-align:center;justify-items:center}.omcBaG_timelineAction{justify-content:center;padding:2px 0 8px;display:flex}.omcBaG_messageRow{gap:10px;padding:10px 0;display:flex}.omcBaG_messageRow[data-grouped]{padding-top:2px}.omcBaG_messageRow[data-grouped] .omcBaG_messageBody>:first-child,.omcBaG_messageRow[data-grouped] .omcBaG_messageBody>:first-child>:first-child{margin-top:0}.omcBaG_messageIdentity{background:hsl(var(--team-avatar-hue,212) 42% 46%);color:#fff;border-radius:50%;flex:0 0 28px;justify-content:center;align-items:center;height:28px;font-size:12px;font-weight:600;display:flex}.omcBaG_messageRow[data-human] .omcBaG_messageIdentity{background:var(--dsw-alias-state-business-primary)}.omcBaG_messageRow[data-grouped] .omcBaG_messageIdentity{visibility:hidden}.omcBaG_messageBody{min-width:0}.omcBaG_nameRow{flex-wrap:wrap;align-items:baseline;gap:8px;display:flex}.omcBaG_nameRow strong{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600;line-height:20px}.omcBaG_messageTime{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:20px}.omcBaG_messageText{white-space:pre-wrap;word-break:break-word;margin:6px 0;font-size:14px;line-height:22px}.omcBaG_messageClamp{max-height:176px;overflow:hidden;-webkit-mask-image:linear-gradient(#000 72%,#0000 100%);mask-image:linear-gradient(#000 72%,#0000 100%)}.omcBaG_messageExpand{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;width:fit-content;margin-top:4px;padding:0;font-size:12px;line-height:20px;display:block}.omcBaG_messageExpand:hover,.omcBaG_messageExpand:focus-visible{color:var(--dsw-alias-label-primary);text-underline-offset:2px;outline:none;text-decoration:underline}.omcBaG_messageBody .omcBaG_messageMarkdown{font-size:14px;line-height:22px}.omcBaG_messageBody .omcBaG_messageMarkdown>div:first-child{color:var(--dsw-alias-label-primary);font:inherit}.omcBaG_messageBody .omcBaG_messageMarkdown p{margin:6px 0}.omcBaG_messageBody .omcBaG_messageMarkdown :where(ul,ol){margin:6px 0;padding-left:22px}.omcBaG_messageBody .omcBaG_messageMarkdown li+li{margin-top:2px}.omcBaG_messageBody .omcBaG_messageMarkdown strong{font-weight:600}.omcBaG_messageBody .omcBaG_messageMarkdown :where(h1,h2,h3,h4,h5,h6){margin:12px 0 4px}.omcBaG_messageBody .omcBaG_messageMarkdown :where(h1){font-size:17px;line-height:26px}.omcBaG_messageBody .omcBaG_messageMarkdown :where(h2){font-size:16px;line-height:24px}.omcBaG_messageBody .omcBaG_messageMarkdown :where(h3,h4,h5,h6){font-size:15px;line-height:22px}.omcBaG_messageBody .omcBaG_messageMarkdown pre{margin:8px 0;padding:10px 12px;font-size:13px}.omcBaG_messageBody .omcBaG_messageMarkdown blockquote{margin:6px 0}.omcBaG_messageBody .omcBaG_messageMarkdown :where(th,td){padding-block:5px}.omcBaG_emptyState,.omcBaG_loadingState{color:var(--dsw-alias-label-tertiary);margin:0;padding:14px 0;font-size:13px;line-height:20px}.omcBaG_emptyState{gap:3px;display:grid}.omcBaG_emptyState strong{color:var(--dsw-alias-label-secondary);font-weight:500}.omcBaG_emptyState span{font-size:12px}.omcBaG_loadingState{align-items:center;gap:8px;display:flex}.omcBaG_loadingMark{background:var(--dsw-alias-bg-skeleton);border-radius:50%;width:8px;height:8px;animation:1.2s ease-in-out infinite omcBaG_pulse}.omcBaG_error,.omcBaG_errorState{color:var(--dsw-alias-state-error-primary);max-width:880px;margin:0 auto;padding-top:6px;font-size:12px;line-height:18px}.omcBaG_errorState{justify-content:space-between;align-items:center;gap:8px;display:flex}.omcBaG_welcomeSurface{justify-content:center;align-items:center;min-width:0;height:100%;padding:32px;display:flex}.omcBaG_welcome{text-align:center;max-width:420px}.omcBaG_welcomeEyebrow{color:var(--dsw-alias-label-tertiary);text-transform:uppercase;font-size:12px;line-height:18px}.omcBaG_welcome h1{color:var(--dsw-alias-label-primary);margin:8px 0;font-size:24px;font-weight:600;line-height:32px}.omcBaG_welcome p{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px;line-height:20px}@keyframes omcBaG_pulse{0%,to{opacity:.35}50%{opacity:1}}@media (width<=600px){.omcBaG_surfaceHeader{padding:12px 12px 10px}.omcBaG_headerRow{flex-direction:column;align-items:stretch;gap:8px}.omcBaG_headerActions{flex-wrap:wrap}.omcBaG_backRow{margin-bottom:6px}.omcBaG_timeline{scrollbar-gutter:auto;padding:8px 12px 16px}.omcBaG_messageRow{padding:8px 0}}@media (prefers-reduced-motion:reduce){.omcBaG_loadingMark{animation:none}}.omcBaG_messageRun{margin:2px 0;padding:3px 0}.omcBaG_messageRow[data-grouped]:has(.omcBaG_messageBody>button:not([data-message-expand])){margin-top:3px;padding-top:7px;position:relative}.omcBaG_messageRow[data-grouped]:has(.omcBaG_messageBody>button:not([data-message-expand])):before{background:var(--dsw-alias-border-l2);content:\"\";height:1px;position:absolute;inset:0 0 auto 38px}.omcBaG_runDivider{border-top:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-tertiary);margin:2px 0 0 38px;padding:5px 0 0;font-size:11px;line-height:16px}.omcBaG_runDivider+.omcBaG_messageRow[data-grouped]:has(.omcBaG_messageBody>button:not([data-message-expand])){margin-top:0}.omcBaG_runDivider+.omcBaG_messageRow[data-grouped]:has(.omcBaG_messageBody>button:not([data-message-expand])):before{content:none}.omcBaG_mention{background:color-mix(in srgb, var(--dsw-alias-state-business-primary) 12%, transparent);color:var(--dsw-alias-state-business-primary);border-radius:5px;padding:0 4px;font-weight:500;box-shadow:0 1px 2px #00000014}.omcBaG_mentionsRow{gap:4px;width:fit-content;margin-top:3px;font-size:.85em;display:flex}.omcBaG_attachmentStrip{flex-wrap:wrap;gap:6px;margin-top:4px;display:flex}.omcBaG_attachmentThumb{cursor:zoom-in;border:0;border-radius:8px;padding:0}.omcBaG_attachmentThumb img{object-fit:cover;border-radius:8px;width:128px;height:96px;display:block}.omcBaG_attachmentThumb:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,currentColor);outline-offset:1px}.omcBaG_confirmBody{margin:0 0 8px}.omcBaG_confirmList{gap:6px;margin:0;padding-left:18px;display:grid}.omcBaG_refLink{color:var(--dsw-alias-state-business-primary);cursor:pointer;font:inherit;text-align:left;text-underline-offset:3px;background:0 0;border:none;border-radius:4px;padding:0;text-decoration:underline}.omcBaG_refLink:hover{text-decoration-thickness:2px}.omcBaG_refLink:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:1px}.omcBaG_attachmentModal{width:min(1100px,92vw)}.omcBaG_attachmentZoom{object-fit:contain;border-radius:12px;max-width:100%;max-height:78vh;margin:0 auto;display:block}.omcBaG_attachmentChip{background:var(--dsw-alias-interactive-bg-hover);border-radius:6px;align-items:baseline;gap:6px;max-width:100%;padding:3px 8px;display:inline-flex}.omcBaG_attachmentChipName{text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:17px;overflow:hidden}.omcBaG_attachmentChipSize{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-size:11px;line-height:17px}";
7596
- const tagId$4 = "@wowyuarm/dsh-agent-team/conversation.module.css";
7597
- if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$4) + "]") === null) {
7815
+ const css$5 = ".omcBaG_surface{grid-template-rows:auto minmax(0,1fr) auto;min-width:0;height:100%;min-height:0;display:grid;overflow:hidden}.omcBaG_surfaceHeader{border-bottom:1px solid var(--dsw-alias-border-l2);min-width:0;padding:14px clamp(18px,3vw,36px) 12px}.omcBaG_headerRow{justify-content:space-between;align-items:flex-start;gap:16px;min-width:0;max-width:880px;margin:0 auto;display:flex}.omcBaG_headerCopy{min-width:0}.omcBaG_headerCopy h1{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;margin:0;font-size:20px;font-weight:600;line-height:28px}.omcBaG_headerCopy p{color:var(--dsw-alias-label-secondary);margin:3px 0 0;font-size:13px;line-height:20px}.omcBaG_headerActions{flex:none;align-items:center;gap:6px;display:flex}.omcBaG_backRow{max-width:880px;margin:0 auto 8px}.omcBaG_timeline{overscroll-behavior:contain;scrollbar-gutter:stable;min-height:0;padding:12px clamp(18px,3vw,36px) 24px;overflow:hidden auto}.omcBaG_timelineContent{flex-direction:column;min-width:0;max-width:880px;min-height:100%;margin:0 auto;display:flex}.omcBaG_emptySurface{margin:auto;padding:32px 0}.omcBaG_emptySurface .omcBaG_emptyState{text-align:center;justify-items:center}.omcBaG_timelineAction{justify-content:center;padding:2px 0 8px;display:flex}.omcBaG_messageRow{gap:10px;padding:10px 0;display:flex}.omcBaG_messageRow[data-grouped]{padding-top:2px}.omcBaG_messageRow[data-grouped] .omcBaG_messageBody>:first-child,.omcBaG_messageRow[data-grouped] .omcBaG_messageBody>:first-child>:first-child{margin-top:0}.omcBaG_messageIdentity{background:hsl(var(--team-avatar-hue,212) 42% 46%);corner-shape:round;color:#fff;border-radius:50%;flex:0 0 28px;justify-content:center;align-items:center;height:28px;font-size:12px;font-weight:600;display:flex}.omcBaG_messageRow[data-human] .omcBaG_messageIdentity{background:var(--dsw-alias-state-business-primary)}.omcBaG_messageRow[data-grouped] .omcBaG_messageIdentity{visibility:hidden}.omcBaG_messageBody{min-width:0}.omcBaG_nameRow{flex-wrap:wrap;align-items:baseline;gap:8px;display:flex}.omcBaG_nameRow strong{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600;line-height:20px}.omcBaG_messageTime{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:20px}.omcBaG_messageText{white-space:pre-wrap;word-break:break-word;margin:6px 0;font-size:14px;line-height:22px}.omcBaG_messageClamp{max-height:176px;overflow:hidden;-webkit-mask-image:linear-gradient(#000 72%,#0000 100%);mask-image:linear-gradient(#000 72%,#0000 100%)}.omcBaG_messageExpand{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;width:fit-content;margin-top:4px;padding:0;font-size:12px;line-height:20px;display:block}.omcBaG_messageExpand:hover,.omcBaG_messageExpand:focus-visible{color:var(--dsw-alias-label-primary);text-underline-offset:2px;outline:none;text-decoration:underline}.omcBaG_messageBody .omcBaG_messageMarkdown{font-size:14px;line-height:22px}.omcBaG_messageBody .omcBaG_messageMarkdown>div:first-child{color:var(--dsw-alias-label-primary);font:inherit}.omcBaG_messageBody .omcBaG_messageMarkdown p{margin:6px 0}.omcBaG_messageBody .omcBaG_messageMarkdown :where(ul,ol){margin:6px 0;padding-left:22px}.omcBaG_messageBody .omcBaG_messageMarkdown li+li{margin-top:2px}.omcBaG_messageBody .omcBaG_messageMarkdown strong{font-weight:600}.omcBaG_messageBody .omcBaG_messageMarkdown :where(h1,h2,h3,h4,h5,h6){margin:12px 0 4px}.omcBaG_messageBody .omcBaG_messageMarkdown :where(h1){font-size:17px;line-height:26px}.omcBaG_messageBody .omcBaG_messageMarkdown :where(h2){font-size:16px;line-height:24px}.omcBaG_messageBody .omcBaG_messageMarkdown :where(h3,h4,h5,h6){font-size:15px;line-height:22px}.omcBaG_messageBody .omcBaG_messageMarkdown pre{margin:8px 0;padding:10px 12px;font-size:13px}.omcBaG_messageBody .omcBaG_messageMarkdown blockquote{margin:6px 0}.omcBaG_messageBody .omcBaG_messageMarkdown :where(th,td){padding-block:5px}.omcBaG_emptyState,.omcBaG_loadingState{color:var(--dsw-alias-label-tertiary);margin:0;padding:14px 0;font-size:13px;line-height:20px}.omcBaG_emptyState{gap:3px;display:grid}.omcBaG_emptyState strong{color:var(--dsw-alias-label-secondary);font-weight:500}.omcBaG_emptyState span{font-size:12px}.omcBaG_loadingState{align-items:center;gap:8px;display:flex}.omcBaG_loadingMark{background:var(--dsw-alias-bg-skeleton);corner-shape:round;border-radius:50%;width:8px;height:8px;animation:1.2s ease-in-out infinite omcBaG_pulse}.omcBaG_error,.omcBaG_errorState{color:var(--dsw-alias-state-error-primary);max-width:880px;margin:0 auto;padding-top:6px;font-size:12px;line-height:18px}.omcBaG_errorState{justify-content:space-between;align-items:center;gap:8px;display:flex}.omcBaG_welcomeSurface{justify-content:center;align-items:center;min-width:0;height:100%;padding:32px;display:flex}.omcBaG_welcome{text-align:center;max-width:420px}.omcBaG_welcomeEyebrow{color:var(--dsw-alias-label-tertiary);text-transform:uppercase;font-size:12px;line-height:18px}.omcBaG_welcome h1{color:var(--dsw-alias-label-primary);margin:8px 0;font-size:24px;font-weight:600;line-height:32px}.omcBaG_welcome p{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px;line-height:20px}@keyframes omcBaG_pulse{0%,to{opacity:.35}50%{opacity:1}}@media (width<=600px){.omcBaG_surfaceHeader{padding:12px 12px 10px}.omcBaG_headerRow{flex-direction:column;align-items:stretch;gap:8px}.omcBaG_headerActions{flex-wrap:wrap}.omcBaG_backRow{margin-bottom:6px}.omcBaG_timeline{scrollbar-gutter:auto;padding:8px 12px 16px}.omcBaG_messageRow{padding:8px 0}}@media (prefers-reduced-motion:reduce){.omcBaG_loadingMark{animation:none}}.omcBaG_messageRun{margin:2px 0;padding:3px 0}.omcBaG_messageRow[data-grouped]:has(.omcBaG_messageBody>button:not([data-message-expand])){margin-top:3px;padding-top:7px;position:relative}.omcBaG_messageRow[data-grouped]:has(.omcBaG_messageBody>button:not([data-message-expand])):before{background:var(--dsw-alias-border-l2);content:\"\";height:1px;position:absolute;inset:0 0 auto 38px}.omcBaG_runDivider{border-top:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-tertiary);margin:2px 0 0 38px;padding:5px 0 0;font-size:11px;line-height:16px}.omcBaG_runDivider+.omcBaG_messageRow[data-grouped]:has(.omcBaG_messageBody>button:not([data-message-expand])){margin-top:0}.omcBaG_runDivider+.omcBaG_messageRow[data-grouped]:has(.omcBaG_messageBody>button:not([data-message-expand])):before{content:none}.omcBaG_mention{background:color-mix(in srgb, var(--dsw-alias-state-business-primary) 12%, transparent);color:var(--dsw-alias-state-business-primary);border-radius:6px;padding:0 4px;font-weight:500;box-shadow:0 1px 2px #00000014}.omcBaG_mentionsRow{gap:4px;width:fit-content;margin-top:3px;font-size:.85em;display:flex}.omcBaG_attachmentStrip{flex-wrap:wrap;gap:6px;margin-top:4px;display:flex}.omcBaG_attachmentThumb{cursor:zoom-in;border:0;border-radius:8px;padding:0}.omcBaG_attachmentThumb img{object-fit:cover;border-radius:8px;width:128px;height:96px;display:block}.omcBaG_attachmentThumb:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,currentColor);outline-offset:1px}.omcBaG_confirmBody{margin:0 0 8px}.omcBaG_confirmList{gap:6px;margin:0;padding-left:18px;display:grid}.omcBaG_refLink{color:var(--dsw-alias-state-business-primary);cursor:pointer;font:inherit;text-align:left;text-underline-offset:3px;background:0 0;border:none;border-radius:4px;padding:0;text-decoration:underline}.omcBaG_refLink:hover{text-decoration-thickness:2px}.omcBaG_refLink:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:1px}.omcBaG_attachmentModal{width:min(1100px,92vw)}.omcBaG_attachmentZoom{object-fit:contain;border-radius:12px;max-width:100%;max-height:78vh;margin:0 auto;display:block}.omcBaG_attachmentChip{background:var(--dsw-alias-interactive-bg-hover);border-radius:6px;align-items:baseline;gap:6px;max-width:100%;padding:3px 8px;display:inline-flex}.omcBaG_attachmentChipName{text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:17px;overflow:hidden}.omcBaG_attachmentChipSize{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-size:11px;line-height:17px}";
7816
+ const tagId$5 = "@wowyuarm/dsh-agent-team/conversation.module.css";
7817
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$5) + "]") === null) {
7598
7818
  const tag = document.createElement("style");
7599
7819
  tag.dataset.plugin = "@wowyuarm/dsh-agent-team";
7600
- tag.dataset.pluginCss = tagId$4;
7601
- tag.textContent = css$4;
7820
+ tag.dataset.pluginCss = tagId$5;
7821
+ tag.textContent = css$5;
7602
7822
  document.head.appendChild(tag);
7603
7823
  }
7604
7824
  var conversation_module_css_default = {
@@ -7647,8 +7867,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7647
7867
  };
7648
7868
  //#endregion
7649
7869
  //#region src/client/TeamMessage.tsx
7650
- /** One chat message row with identity chrome and sender-appropriate rendering. */
7651
- function TeamMessage({ senderName, memberId, human, body, occurredAt, mentionNames, senderTitle, grouped, showGroupedTime, attachments, loadAttachment, t, onOpenRef, onResolveTaskRefs, children }) {
7870
+ /**
7871
+ * One chat message row with identity chrome and sender-appropriate rendering.
7872
+ *
7873
+ * Memoized because a timeline row is rendered by the page that owns the whole
7874
+ * Thread: the Task-ref subscription below lives inside this component, so
7875
+ * skipping a render here never detaches it. Callers must therefore keep the
7876
+ * props they derive per render (mention names, ref callbacks) identity-stable.
7877
+ */
7878
+ const TeamMessage = (0, react.memo)(function TeamMessage({ senderName, memberId, human, body, occurredAt, mentionNames, senderTitle, grouped, showGroupedTime, attachments, loadAttachment, t, onOpenRef, onResolveTaskRefs, children }) {
7652
7879
  const avatarStyle = human ? void 0 : { "--team-avatar-hue": memberHue(memberId) };
7653
7880
  const plan = planMessageBody(body, {
7654
7881
  human,
@@ -7801,7 +8028,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7801
8028
  ]
7802
8029
  })]
7803
8030
  });
7804
- }
8031
+ });
7805
8032
  /** Text nodes that Markdown rendered as prose rather than code or a link. */
7806
8033
  function markdownProseTextNodes(root) {
7807
8034
  const nodes = [];
@@ -8163,13 +8390,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8163
8390
  }
8164
8391
  //#endregion
8165
8392
  //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/channel.module.css.mjs
8166
- const css$3 = ".MYaRJa_headerMeta{color:var(--dsw-alias-label-tertiary);flex-wrap:wrap;align-items:center;gap:6px;margin-top:7px;font-size:12px;line-height:18px;display:flex}.MYaRJa_headerMeta span+span:before{content:\"·\";margin-right:6px}.MYaRJa_taskFooter{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);cursor:pointer;text-align:left;background:0 0;border-radius:999px;align-items:center;gap:6px;max-width:100%;margin:6px 0 0;padding:2px 10px;transition:background-color .12s,border-color .12s,color .12s;display:inline-flex}.MYaRJa_taskFooter:hover,.MYaRJa_taskFooter:focus-visible{background:var(--dsw-alias-interactive-bg-hover);border-color:var(--dsw-alias-border-l3);color:var(--dsw-alias-label-primary)}.MYaRJa_taskFooter:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.MYaRJa_taskNumber{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:600;line-height:18px}.MYaRJa_taskStatus,.MYaRJa_taskCount{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:18px}.MYaRJa_taskDot{flex:none;align-items:center;width:8px;display:inline-flex}.MYaRJa_taskArrow{color:var(--dsw-alias-label-tertiary);align-items:center;transition:transform .12s;display:inline-flex}.MYaRJa_taskFooter:hover .MYaRJa_taskArrow,.MYaRJa_taskFooter:focus-visible .MYaRJa_taskArrow{transform:translate(2px)}.MYaRJa_memberList{gap:3px;display:grid}.MYaRJa_memberRow{border-radius:6px;grid-template-columns:14px minmax(0,1fr) auto;align-items:center;gap:0 8px;min-height:40px;padding:4px 6px;display:grid}.MYaRJa_memberRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.MYaRJa_memberCopy{min-width:0;display:grid}.MYaRJa_memberCopy strong{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:18px;overflow:hidden}.MYaRJa_memberCopy small{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:10px;line-height:14px;overflow:hidden}.MYaRJa_memberAction{min-width:60px}.MYaRJa_memberError{color:var(--dsw-alias-state-error-primary);grid-column:2/-1;margin:2px 0;font-size:11px;line-height:16px}.MYaRJa_modalBody{max-height:min(65vh,520px);overflow-y:auto}@media (width<=600px){.MYaRJa_memberRow{grid-template-columns:14px minmax(0,1fr)}.MYaRJa_memberAction{grid-column:2;justify-self:start;margin-top:3px}}@media (prefers-reduced-motion:reduce){.MYaRJa_taskFooter,.MYaRJa_taskArrow{transition:none}.MYaRJa_taskFooter:hover .MYaRJa_taskArrow,.MYaRJa_taskFooter:focus-visible .MYaRJa_taskArrow{transform:none}}";
8167
- const tagId$3 = "@wowyuarm/dsh-agent-team/channel.module.css";
8168
- if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
8393
+ const css$4 = ".MYaRJa_headerMeta{color:var(--dsw-alias-label-tertiary);flex-wrap:wrap;align-items:center;gap:6px;margin-top:7px;font-size:12px;line-height:18px;display:flex}.MYaRJa_headerMeta span+span:before{content:\"·\";margin-right:6px}.MYaRJa_taskFooter{border:1px solid var(--dsw-alias-border-l2);corner-shape:round;color:var(--dsw-alias-label-secondary);cursor:pointer;text-align:left;background:0 0;border-radius:999px;align-items:center;gap:6px;max-width:100%;margin:6px 0 0;padding:2px 10px;transition:background-color .12s,border-color .12s,color .12s;display:inline-flex}.MYaRJa_taskFooter:hover,.MYaRJa_taskFooter:focus-visible{background:var(--dsw-alias-interactive-bg-hover);border-color:var(--dsw-alias-border-l3);color:var(--dsw-alias-label-primary)}.MYaRJa_taskFooter:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.MYaRJa_taskNumber{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:600;line-height:18px}.MYaRJa_taskStatus,.MYaRJa_taskCount{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:18px}.MYaRJa_taskDot{flex:none;align-items:center;width:8px;display:inline-flex}.MYaRJa_taskArrow{color:var(--dsw-alias-label-tertiary);align-items:center;transition:transform .12s;display:inline-flex}.MYaRJa_taskFooter:hover .MYaRJa_taskArrow,.MYaRJa_taskFooter:focus-visible .MYaRJa_taskArrow{transform:translate(2px)}.MYaRJa_memberList{gap:3px;display:grid}.MYaRJa_memberRow{border-radius:6px;grid-template-columns:14px minmax(0,1fr) auto;align-items:center;gap:0 8px;min-height:40px;padding:4px 6px;display:grid}.MYaRJa_memberRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.MYaRJa_memberCopy{min-width:0;display:grid}.MYaRJa_memberCopy strong{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:18px;overflow:hidden}.MYaRJa_memberCopy small{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:10px;line-height:14px;overflow:hidden}.MYaRJa_memberAction{min-width:60px}.MYaRJa_memberError{color:var(--dsw-alias-state-error-primary);grid-column:2/-1;margin:2px 0;font-size:11px;line-height:16px}.MYaRJa_modalBody{max-height:min(65vh,520px);overflow-y:auto}@media (width<=600px){.MYaRJa_memberRow{grid-template-columns:14px minmax(0,1fr)}.MYaRJa_memberAction{grid-column:2;justify-self:start;margin-top:3px}}@media (prefers-reduced-motion:reduce){.MYaRJa_taskFooter,.MYaRJa_taskArrow{transition:none}.MYaRJa_taskFooter:hover .MYaRJa_taskArrow,.MYaRJa_taskFooter:focus-visible .MYaRJa_taskArrow{transform:none}}";
8394
+ const tagId$4 = "@wowyuarm/dsh-agent-team/channel.module.css";
8395
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$4) + "]") === null) {
8169
8396
  const tag = document.createElement("style");
8170
8397
  tag.dataset.plugin = "@wowyuarm/dsh-agent-team";
8171
- tag.dataset.pluginCss = tagId$3;
8172
- tag.textContent = css$3;
8398
+ tag.dataset.pluginCss = tagId$4;
8399
+ tag.textContent = css$4;
8173
8400
  document.head.appendChild(tag);
8174
8401
  }
8175
8402
  var channel_module_css_default = {
@@ -8189,13 +8416,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8189
8416
  };
8190
8417
  //#endregion
8191
8418
  //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/thread.module.css.mjs
8192
- 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)}}";
8193
- const tagId$2 = "@wowyuarm/dsh-agent-team/thread.module.css";
8194
- if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
8419
+ const css$3 = ".-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);corner-shape:round;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);corner-shape:round;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)}}";
8420
+ const tagId$3 = "@wowyuarm/dsh-agent-team/thread.module.css";
8421
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
8195
8422
  const tag = document.createElement("style");
8196
8423
  tag.dataset.plugin = "@wowyuarm/dsh-agent-team";
8197
- tag.dataset.pluginCss = tagId$2;
8198
- tag.textContent = css$2;
8424
+ tag.dataset.pluginCss = tagId$3;
8425
+ tag.textContent = css$3;
8199
8426
  document.head.appendChild(tag);
8200
8427
  }
8201
8428
  var thread_module_css_default = {
@@ -8250,10 +8477,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8250
8477
  const [loadingOlder, setLoadingOlder] = (0, react.useState)(false);
8251
8478
  const [managingMembers, setManagingMembers] = (0, react.useState)(false);
8252
8479
  const draftKey = `channel:${channelRef}`;
8253
- const { draft, recipients } = (0, react.useSyncExternalStore)(drafts.subscribe, () => drafts.getSnapshot(draftKey));
8254
8480
  const manageTriggerRef = (0, react.useRef)(null);
8255
8481
  const memberListRef = (0, react.useRef)(null);
8256
8482
  const mountedRef = (0, react.useRef)(false);
8483
+ const loadedRef = (0, react.useRef)(false);
8257
8484
  const refreshSequenceRef = (0, react.useRef)(0);
8258
8485
  const channelLastItem = view?.items[view.items.length - 1];
8259
8486
  const openRef = (ref) => {
@@ -8303,7 +8530,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8303
8530
  if (!mountedRef.current) return false;
8304
8531
  const sequence = refreshSequenceRef.current + 1;
8305
8532
  refreshSequenceRef.current = sequence;
8306
- setLoading(true);
8533
+ if (!loadedRef.current) setLoading(true);
8307
8534
  if (clearError) {
8308
8535
  setError(void 0);
8309
8536
  setStatusMessage(void 0);
@@ -8318,8 +8545,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8318
8545
  limit: 20
8319
8546
  }), loadMembers({ workspaceId })]);
8320
8547
  if (!mountedRef.current || sequence !== refreshSequenceRef.current) return false;
8321
- if (loaded.ok) setView((current) => current === void 0 ? loaded.value : mergeChannelView(current, loaded.value));
8322
- else setError(loaded.error.message);
8548
+ if (loaded.ok) {
8549
+ setView((current) => current === void 0 ? loaded.value : mergeChannelView(current, loaded.value));
8550
+ loadedRef.current = true;
8551
+ } else setError(loaded.error.message);
8323
8552
  if (loadedMembers.ok) setMembers(loadedMembers.value);
8324
8553
  else setError(loadedMembers.error.message);
8325
8554
  return loaded.ok && loadedMembers.ok;
@@ -8343,32 +8572,47 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8343
8572
  };
8344
8573
  (0, react.useEffect)(() => {
8345
8574
  mountedRef.current = true;
8575
+ loadedRef.current = false;
8346
8576
  setView(void 0);
8347
8577
  setError(void 0);
8348
8578
  setLoading(true);
8349
8579
  setManagingMembers(false);
8350
8580
  refresh();
8351
- const disposers = [subscribeChanges({
8352
- kind: "channel",
8353
- channelRef
8354
- }, (update) => {
8355
- if (!mountedRef.current) return;
8356
- if (update.type === "failed") {
8357
- setError(update.message);
8358
- return;
8359
- }
8360
- refresh();
8361
- }), subscribeChanges({
8362
- kind: "workspace",
8363
- workspaceId
8364
- }, (update) => {
8365
- if (!mountedRef.current) return;
8366
- if (update.type === "failed") {
8367
- setError(update.message);
8368
- return;
8369
- }
8370
- refreshMembers();
8371
- })];
8581
+ const disposers = [
8582
+ subscribeChanges({
8583
+ kind: "channel",
8584
+ channelRef
8585
+ }, (update) => {
8586
+ if (!mountedRef.current) return;
8587
+ if (update.type === "failed") {
8588
+ setError(update.message);
8589
+ return;
8590
+ }
8591
+ refresh();
8592
+ }),
8593
+ subscribeChanges({
8594
+ kind: "workspace",
8595
+ workspaceId
8596
+ }, (update) => {
8597
+ if (!mountedRef.current) return;
8598
+ if (update.type === "failed") {
8599
+ setError(update.message);
8600
+ return;
8601
+ }
8602
+ refreshMembers();
8603
+ }),
8604
+ subscribeChanges({
8605
+ kind: "presence",
8606
+ workspaceId
8607
+ }, (update) => {
8608
+ if (!mountedRef.current) return;
8609
+ if (update.type === "failed") {
8610
+ setError(update.message);
8611
+ return;
8612
+ }
8613
+ refreshMembers();
8614
+ })
8615
+ ];
8372
8616
  return () => {
8373
8617
  mountedRef.current = false;
8374
8618
  refreshSequenceRef.current += 1;
@@ -8419,7 +8663,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8419
8663
  await refresh();
8420
8664
  });
8421
8665
  const pendingSendId = (0, react.useRef)();
8666
+ const clearSendState = (0, react.useCallback)(() => {
8667
+ setStatusMessage((current) => current === void 0 ? current : void 0);
8668
+ }, []);
8422
8669
  const send = async () => {
8670
+ const { draft, recipients } = drafts.getSnapshot(draftKey);
8423
8671
  if (pending || draft.trim() === "") return;
8424
8672
  const recipientIds = [...recipients].sort();
8425
8673
  const requestId = pendingSendId.current ?? mintRequestId();
@@ -8428,22 +8676,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8428
8676
  setError(void 0);
8429
8677
  setStatusMessage(void 0);
8430
8678
  try {
8431
- const attachmentIds = [];
8432
- for (const file of pendingFiles) {
8433
- const uploaded = await putAttachment({
8434
- requestId: mintRequestId(),
8435
- workspaceId,
8436
- name: file.name,
8437
- mediaType: file.type === "" ? void 0 : file.type,
8438
- bytesBase64: bytesToBase64(new Uint8Array(await file.arrayBuffer()))
8439
- });
8440
- if (!uploaded.ok) {
8441
- pendingSendId.current = void 0;
8442
- setError(uploaded.error.message);
8443
- return;
8444
- }
8445
- attachmentIds.push(uploaded.value.attachmentId);
8679
+ const upload = await uploadComposerFiles(putAttachment, workspaceId, pendingFiles);
8680
+ if (!upload.ok) {
8681
+ pendingSendId.current = void 0;
8682
+ setError(upload.error);
8683
+ return;
8446
8684
  }
8685
+ const attachmentIds = upload.attachmentIds;
8447
8686
  const result = await sendMessage({
8448
8687
  requestId,
8449
8688
  workspaceId,
@@ -8708,19 +8947,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8708
8947
  }),
8709
8948
  channel !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamComposer, {
8710
8949
  members: channelMembers,
8711
- recipients,
8712
- draft,
8950
+ drafts,
8951
+ draftKey,
8713
8952
  pending,
8714
8953
  ...statusMessage === void 0 ? {} : { confirmation: statusMessage },
8715
8954
  ...error === void 0 ? {} : { error },
8716
- onDraftChange: (next) => {
8717
- drafts.writeDraft(draftKey, next);
8718
- setStatusMessage(void 0);
8719
- },
8720
- onRecipientsChange: (next) => {
8721
- drafts.writeRecipients(draftKey, next);
8722
- setStatusMessage(void 0);
8723
- },
8955
+ onEdit: clearSendState,
8724
8956
  onSubmit: () => {
8725
8957
  send();
8726
8958
  },
@@ -8734,6 +8966,260 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8734
8966
  });
8735
8967
  }
8736
8968
  //#endregion
8969
+ //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/inbox.module.css.mjs
8970
+ const css$2 = ".s2ibaa_list{flex-direction:column;gap:2px;display:flex}.s2ibaa_headerMeta{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.s2ibaa_row{color:inherit;cursor:pointer;font:inherit;text-align:left;background:0 0;border:0;border-radius:8px;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;gap:2px 12px;width:100%;padding:9px 8px;display:grid}.s2ibaa_row:hover,.s2ibaa_row:focus-visible{background:var(--dsw-alias-interactive-bg-hover)}.s2ibaa_row:focus-visible{outline:2px solid var(--dsw-alias-label-primary);outline-offset:-2px}.s2ibaa_rowCrumb{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;grid-column:1;min-width:0;font-size:12px;line-height:18px;overflow:hidden}.s2ibaa_rowChannel{color:var(--dsw-alias-label-secondary);font-weight:600}.s2ibaa_rowTask{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);white-space:nowrap;border-radius:6px;margin-left:8px;padding:0 5px;font-size:11px;font-weight:600;line-height:15px}.s2ibaa_rowPreview{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;grid-column:1/-1;min-width:0;font-size:14px;line-height:22px;overflow:hidden}.s2ibaa_rowTime{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;white-space:nowrap;grid-area:1/2;font-size:11px;line-height:18px}";
8971
+ const tagId$2 = "@wowyuarm/dsh-agent-team/inbox.module.css";
8972
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
8973
+ const tag = document.createElement("style");
8974
+ tag.dataset.plugin = "@wowyuarm/dsh-agent-team";
8975
+ tag.dataset.pluginCss = tagId$2;
8976
+ tag.textContent = css$2;
8977
+ document.head.appendChild(tag);
8978
+ }
8979
+ var inbox_module_css_default = {
8980
+ "headerMeta": "s2ibaa_headerMeta",
8981
+ "list": "s2ibaa_list",
8982
+ "row": "s2ibaa_row",
8983
+ "rowChannel": "s2ibaa_rowChannel",
8984
+ "rowCrumb": "s2ibaa_rowCrumb",
8985
+ "rowPreview": "s2ibaa_rowPreview",
8986
+ "rowTask": "s2ibaa_rowTask",
8987
+ "rowTime": "s2ibaa_rowTime"
8988
+ };
8989
+ //#endregion
8990
+ //#region src/client/TeamInboxPage.tsx
8991
+ /**
8992
+ * Queue order: newest mention first, one total order across Workspaces. Each
8993
+ * Workspace slice arrives in the Host's own order (that order is the Host's
8994
+ * truncation policy); the merged display order is decided here, where the
8995
+ * merge happens, and the ledger sequence breaks ties so the queue never
8996
+ * reshuffles two rows that share an instant.
8997
+ */
8998
+ function compareInboxRows(left, right) {
8999
+ const leftAt = Date.parse(left.item.newestOccurredAt);
9000
+ const rightAt = Date.parse(right.item.newestOccurredAt);
9001
+ const byTime = (Number.isNaN(rightAt) ? 0 : rightAt) - (Number.isNaN(leftAt) ? 0 : leftAt);
9002
+ return byTime !== 0 ? byTime : right.item.newestSequence - left.item.newestSequence;
9003
+ }
9004
+ /**
9005
+ * The Human 「提到我」 queue: one direct-only Inbox call per visible Workspace,
9006
+ * merged into a single recency-ordered list — newest mention first across every
9007
+ * Workspace, since a queue is read by recency rather than by Workspace.
9008
+ * Opening the page never acknowledges anything — only a durable Thread read
9009
+ * consumes a mention marker, so rows and the badge drop after the Thread is
9010
+ * opened through the existing auto-ack path.
9011
+ */
9012
+ function TeamInboxPage({ useWorkspaces, loadInbox, subscribeChanges, selectWorkspace, selectThread, t }) {
9013
+ const workspaces = useWorkspaces((state) => state.items);
9014
+ const [rows, setRows] = (0, react.useState)();
9015
+ const [loading, setLoading] = (0, react.useState)(true);
9016
+ const [error, setError] = (0, react.useState)();
9017
+ const loadedRef = (0, react.useRef)(false);
9018
+ const refresh = (0, react.useCallback)(async () => {
9019
+ if (!loadedRef.current) setLoading(true);
9020
+ const results = await Promise.all(workspaces.map(async (workspace) => {
9021
+ const result = await loadInbox({
9022
+ workspaceId: workspace.workspaceId,
9023
+ directOnly: true,
9024
+ limit: 100
9025
+ });
9026
+ return result.ok ? {
9027
+ ok: true,
9028
+ workspaceId: workspace.workspaceId,
9029
+ workspaceTitle: workspace.title,
9030
+ items: result.value.items
9031
+ } : {
9032
+ ok: false,
9033
+ message: result.error.message
9034
+ };
9035
+ }));
9036
+ const failure = results.find((result) => !result.ok);
9037
+ setRows(results.flatMap((result) => result.ok ? result.items.map((item) => ({
9038
+ workspaceId: result.workspaceId,
9039
+ workspaceTitle: result.workspaceTitle,
9040
+ item
9041
+ })) : []).sort(compareInboxRows));
9042
+ setError(failure?.ok === false ? failure.message : void 0);
9043
+ loadedRef.current = true;
9044
+ setLoading(false);
9045
+ }, [loadInbox, workspaces]);
9046
+ (0, react.useEffect)(() => {
9047
+ refresh();
9048
+ }, [refresh]);
9049
+ (0, react.useEffect)(() => subscribeChanges(void 0, (update) => {
9050
+ if (update.type === "failed") {
9051
+ setError(update.message);
9052
+ return;
9053
+ }
9054
+ refresh();
9055
+ }), [subscribeChanges, refresh]);
9056
+ const open = (row) => {
9057
+ selectWorkspace(row.workspaceId);
9058
+ selectThread(row.item.thread.threadRef, row.item.channelRef, row.item.task?.taskRef, row.item.taskNumber);
9059
+ };
9060
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("main", {
9061
+ className: conversation_module_css_default.surface,
9062
+ "data-team-inbox": true,
9063
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9064
+ className: conversation_module_css_default.surfaceHeader,
9065
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("header", {
9066
+ className: conversation_module_css_default.headerRow,
9067
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9068
+ className: conversation_module_css_default.headerCopy,
9069
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", { children: t("mentionsOfMe") }), rows !== void 0 && rows.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
9070
+ className: inbox_module_css_default.headerMeta,
9071
+ children: t("inboxHeaderMeta", {
9072
+ threads: rows.length,
9073
+ mentions: rows.reduce((sum, row) => sum + row.item.directCount, 0)
9074
+ })
9075
+ })]
9076
+ })
9077
+ })
9078
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9079
+ className: conversation_module_css_default.timeline,
9080
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9081
+ className: conversation_module_css_default.timelineContent,
9082
+ children: [
9083
+ loading && rows === void 0 && error === void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9084
+ className: conversation_module_css_default.emptySurface,
9085
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
9086
+ className: conversation_module_css_default.loadingState,
9087
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9088
+ className: conversation_module_css_default.loadingMark,
9089
+ "aria-hidden": "true"
9090
+ }), t("loadingInbox")]
9091
+ })
9092
+ }),
9093
+ !loading && rows === void 0 && error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9094
+ className: conversation_module_css_default.errorState,
9095
+ role: "alert",
9096
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: error }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
9097
+ size: "sm",
9098
+ variant: "outline",
9099
+ onClick: () => {
9100
+ refresh();
9101
+ },
9102
+ children: t("retry")
9103
+ })]
9104
+ }),
9105
+ rows !== void 0 && (rows.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9106
+ className: conversation_module_css_default.emptySurface,
9107
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9108
+ className: conversation_module_css_default.emptyState,
9109
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t("inboxEmptyTitle") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("inboxEmptyHint") })]
9110
+ })
9111
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9112
+ className: inbox_module_css_default.list,
9113
+ children: rows.map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
9114
+ type: "button",
9115
+ className: inbox_module_css_default.row,
9116
+ onClick: () => {
9117
+ open(row);
9118
+ },
9119
+ children: [
9120
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
9121
+ className: inbox_module_css_default.rowCrumb,
9122
+ children: [
9123
+ row.workspaceTitle,
9124
+ " / ",
9125
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
9126
+ className: inbox_module_css_default.rowChannel,
9127
+ children: ["#", row.item.channelName]
9128
+ }),
9129
+ row.item.taskNumber !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9130
+ className: inbox_module_css_default.rowTask,
9131
+ children: t("taskLabel", { number: row.item.taskNumber })
9132
+ })
9133
+ ]
9134
+ }),
9135
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9136
+ className: inbox_module_css_default.rowPreview,
9137
+ children: row.item.previewText
9138
+ }),
9139
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("time", {
9140
+ className: inbox_module_css_default.rowTime,
9141
+ dateTime: row.item.newestOccurredAt,
9142
+ title: formatAbsoluteTime(row.item.newestOccurredAt),
9143
+ children: formatInboxTime(row.item.newestOccurredAt, t)
9144
+ })
9145
+ ]
9146
+ }, `${row.workspaceId} ${row.item.thread.threadRef}`))
9147
+ })),
9148
+ rows !== void 0 && error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
9149
+ className: conversation_module_css_default.error,
9150
+ role: "alert",
9151
+ children: error
9152
+ })
9153
+ ]
9154
+ })
9155
+ })]
9156
+ });
9157
+ }
9158
+ //#endregion
9159
+ //#region src/client/scope-coverage.ts
9160
+ /**
9161
+ * Per-scope coverage of the change versions one surface has already answered.
9162
+ *
9163
+ * A version is only comparable inside the scope that issued it: the Host
9164
+ * answers a workspace scope from the durable ledger position and a presence
9165
+ * scope from its process-local wake epoch, which starts low and climbs on every
9166
+ * Agent transition. One high-water mark shared by both would therefore let a
9167
+ * presence epoch swallow a later, smaller ledger sequence and park the surface
9168
+ * on stale data, so coverage and pending versions are kept per scope.
9169
+ *
9170
+ * One round answers one version per scope. The Host delivers one event to every
9171
+ * matching scope, so the first version a round sees in a scope it has not
9172
+ * answered yet is that event reaching a second scope, and joins the round
9173
+ * already fetching instead of earning a second identical read. A newer version
9174
+ * in a scope the round has answered arrived after the round issued its fetch,
9175
+ * so it owes one trailing round.
9176
+ */
9177
+ var ScopeCoverage = class {
9178
+ covered = /* @__PURE__ */ new Map();
9179
+ pending = /* @__PURE__ */ new Map();
9180
+ /** The scopes the open round has an answer for. */
9181
+ answered = /* @__PURE__ */ new Set();
9182
+ fetching = false;
9183
+ /** Folds one wake in and answers whether it opens a round. */
9184
+ wake(scope, version) {
9185
+ if (version <= this.coveredOf(scope)) return false;
9186
+ if (this.fetching && this.answered.has(scope)) {
9187
+ this.pending.set(scope, Math.max(this.pending.get(scope) ?? 0, version));
9188
+ return false;
9189
+ }
9190
+ this.answered.add(scope);
9191
+ this.covered.set(scope, version);
9192
+ return !this.fetching;
9193
+ }
9194
+ /** Opens a round's fetch window; versions observed from here on are pending. */
9195
+ beginRound() {
9196
+ this.pending.clear();
9197
+ this.fetching = true;
9198
+ }
9199
+ /** Closes a round's fetch window and answers whether a trailing round is owed. */
9200
+ finishRound() {
9201
+ this.fetching = false;
9202
+ this.answered.clear();
9203
+ let owed = false;
9204
+ for (const [scope, version] of this.pending) {
9205
+ if (version <= this.coveredOf(scope)) continue;
9206
+ this.covered.set(scope, version);
9207
+ owed = true;
9208
+ }
9209
+ return owed;
9210
+ }
9211
+ /** Drops every observation: a new owner starts with nothing covered. */
9212
+ reset() {
9213
+ this.covered.clear();
9214
+ this.pending.clear();
9215
+ this.answered.clear();
9216
+ this.fetching = false;
9217
+ }
9218
+ coveredOf(scope) {
9219
+ return this.covered.get(scope) ?? 0;
9220
+ }
9221
+ };
9222
+ //#endregion
8737
9223
  //#region src/client/TeamThreadPage.tsx
8738
9224
  function factKey(fact) {
8739
9225
  return fact.kind === "message" ? `message:${fact.message.messageRef}` : `activity:${fact.activity.activityRef}`;
@@ -8747,6 +9233,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8747
9233
  occurredAt: message.occurredAt
8748
9234
  };
8749
9235
  }
9236
+ /**
9237
+ * A fact owns its mention array, so the rendered name list is cached against
9238
+ * that array. Every roster refresh replaces the handles map with a fresh Map of
9239
+ * identical content, so the cache compares the resolved names rather than the
9240
+ * map identity: identity stays stable while the names are unchanged, which is
9241
+ * what keeps a memoized row from re-rendering on every refresh.
9242
+ */
9243
+ const mentionNamesCache = /* @__PURE__ */ new WeakMap();
9244
+ function stableMentionNames(mentions, handles) {
9245
+ const names = mentionNamesOf(mentions, handles);
9246
+ const cached = mentionNamesCache.get(mentions);
9247
+ if (cached !== void 0 && cached.length === names.length && cached.every((name, index) => name === names[index])) return cached;
9248
+ mentionNamesCache.set(mentions, names);
9249
+ return names;
9250
+ }
8750
9251
  function mergeFacts(...groups) {
8751
9252
  const byKey = /* @__PURE__ */ new Map();
8752
9253
  for (const group of groups) for (const fact of group) byKey.set(factKey(fact), fact);
@@ -8777,7 +9278,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8777
9278
  const [autoReadExhausted, setAutoReadExhausted] = (0, react.useState)(false);
8778
9279
  const [newFactsCount, setNewFactsCount] = (0, react.useState)(0);
8779
9280
  const draftKey = `thread:${threadRef}`;
8780
- const { draft, recipients } = (0, react.useSyncExternalStore)(drafts.subscribe, () => drafts.getSnapshot(draftKey));
8781
9281
  const [claimsOpen, setClaimsOpen] = (0, react.useState)(false);
8782
9282
  const [confirmingAccept, setConfirmingAccept] = (0, react.useState)(false);
8783
9283
  (0, react.useEffect)(() => {
@@ -8847,7 +9347,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8847
9347
  if (mountedRef.current && sequence === sequenceRef.current) setLoading(false);
8848
9348
  }
8849
9349
  };
8850
- const refreshSupplemental = async () => {
9350
+ /** One roster + view read. Answers false once the page is gone. */
9351
+ const applySupplemental = async () => {
8851
9352
  try {
8852
9353
  const [loadedMembers, loadedView] = await Promise.all([loadMembers({ workspaceId }), loadChannels({
8853
9354
  workspaceId,
@@ -8856,15 +9357,36 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8856
9357
  includeActivities: false,
8857
9358
  limit: 1
8858
9359
  })]);
8859
- if (!mountedRef.current) return;
9360
+ if (!mountedRef.current) return false;
8860
9361
  if (loadedMembers.ok) setMembers(loadedMembers.value);
8861
9362
  if (loadedView.ok) setChannelView(loadedView.value);
8862
9363
  const failure = [loadedMembers, loadedView].find((result) => !result.ok);
8863
9364
  if (failure !== void 0 && !failure.ok) setError(failure.error.message);
9365
+ return true;
8864
9366
  } catch (cause) {
8865
9367
  if (mountedRef.current) setError(cause instanceof Error ? cause.message : String(cause));
9368
+ return mountedRef.current;
8866
9369
  }
8867
9370
  };
9371
+ const supplementalRef = (0, react.useRef)();
9372
+ const supplementalCoverageRef = (0, react.useRef)(new ScopeCoverage());
9373
+ const refreshSupplemental = (wake) => {
9374
+ const inFlight = supplementalRef.current;
9375
+ if (wake === void 0) {
9376
+ if (inFlight !== void 0) return inFlight;
9377
+ } else if (!supplementalCoverageRef.current.wake(wake.scope, wake.version)) return inFlight ?? Promise.resolve();
9378
+ const coverage = supplementalCoverageRef.current;
9379
+ const round = (async () => {
9380
+ for (;;) {
9381
+ coverage.beginRound();
9382
+ if (!await applySupplemental() || !coverage.finishRound()) return;
9383
+ }
9384
+ })().finally(() => {
9385
+ if (supplementalRef.current === round) supplementalRef.current = void 0;
9386
+ });
9387
+ supplementalRef.current = round;
9388
+ return round;
9389
+ };
8868
9390
  const refreshPassiveFacts = async () => {
8869
9391
  try {
8870
9392
  const result = await loadThreadHistory({
@@ -8911,6 +9433,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8911
9433
  };
8912
9434
  (0, react.useEffect)(() => {
8913
9435
  mountedRef.current = true;
9436
+ supplementalRef.current = void 0;
9437
+ supplementalCoverageRef.current.reset();
8914
9438
  projectionRef.current = void 0;
8915
9439
  setProjection(void 0);
8916
9440
  setChannelView(void 0);
@@ -8969,28 +9493,48 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8969
9493
  await drainUnread();
8970
9494
  })();
8971
9495
  refreshSupplemental();
8972
- const disposers = [subscribeChanges({
8973
- kind: "thread",
8974
- threadRef
8975
- }, (update) => {
8976
- if (!mountedRef.current) return;
8977
- if (update.type === "failed") {
8978
- setError(update.message);
8979
- return;
8980
- }
8981
- refreshPassiveFacts();
8982
- refreshFollowers();
8983
- }), subscribeChanges({
8984
- kind: "workspace",
8985
- workspaceId
8986
- }, (update) => {
8987
- if (!mountedRef.current) return;
8988
- if (update.type === "failed") {
8989
- setError(update.message);
8990
- return;
8991
- }
8992
- refreshSupplemental();
8993
- })];
9496
+ const disposers = [
9497
+ subscribeChanges({
9498
+ kind: "thread",
9499
+ threadRef
9500
+ }, (update) => {
9501
+ if (!mountedRef.current) return;
9502
+ if (update.type === "failed") {
9503
+ setError(update.message);
9504
+ return;
9505
+ }
9506
+ refreshPassiveFacts();
9507
+ refreshFollowers();
9508
+ }),
9509
+ subscribeChanges({
9510
+ kind: "workspace",
9511
+ workspaceId
9512
+ }, (update) => {
9513
+ if (!mountedRef.current) return;
9514
+ if (update.type === "failed") {
9515
+ setError(update.message);
9516
+ return;
9517
+ }
9518
+ refreshSupplemental({
9519
+ scope: "workspace",
9520
+ version: update.version
9521
+ });
9522
+ }),
9523
+ subscribeChanges({
9524
+ kind: "presence",
9525
+ workspaceId
9526
+ }, (update) => {
9527
+ if (!mountedRef.current) return;
9528
+ if (update.type === "failed") {
9529
+ setError(update.message);
9530
+ return;
9531
+ }
9532
+ refreshSupplemental({
9533
+ scope: "presence",
9534
+ version: update.version
9535
+ });
9536
+ })
9537
+ ];
8994
9538
  return () => {
8995
9539
  mountedRef.current = false;
8996
9540
  sequenceRef.current += 1;
@@ -9066,7 +9610,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9066
9610
  };
9067
9611
  const messageSender = (fact) => fact.kind === "message" ? fact.message.sender : void 0;
9068
9612
  const [pendingFiles, setPendingFiles] = (0, react.useState)([]);
9069
- const openRef = (ref) => {
9613
+ const openRef = (0, react.useCallback)((ref) => {
9070
9614
  if (ref.startsWith("channel:") && ref !== channelRef) {
9071
9615
  selectChannel(ref);
9072
9616
  return;
@@ -9087,8 +9631,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9087
9631
  return;
9088
9632
  }
9089
9633
  if (ref.startsWith("task:") && ref !== taskRef) jumpToTaskThread(resolveTaskRefs, workspaceId, ref, selectThread);
9090
- };
9091
- const lookupTaskRefs = hostTaskRefLookup(resolveTaskRefs, workspaceId);
9634
+ }, [
9635
+ channelRef,
9636
+ threadRef,
9637
+ taskRef,
9638
+ workspaceId,
9639
+ selectChannel,
9640
+ selectThread,
9641
+ loadChannels,
9642
+ resolveTaskRefs
9643
+ ]);
9644
+ const lookupTaskRefs = (0, react.useMemo)(() => hostTaskRefLookup(resolveTaskRefs, workspaceId), [resolveTaskRefs, workspaceId]);
9092
9645
  const renderFact = (fact, grouped = false) => {
9093
9646
  if (fact.kind === "message") {
9094
9647
  const sender = memberName(fact.message.sender);
@@ -9102,7 +9655,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9102
9655
  loadAttachment: getAttachment,
9103
9656
  t,
9104
9657
  occurredAt: fact.message.occurredAt,
9105
- mentionNames: mentionNamesOf(fact.mentions, mentionHandlesMap),
9658
+ mentionNames: stableMentionNames(fact.mentions, mentionHandlesMap),
9106
9659
  onOpenRef: openRef,
9107
9660
  onResolveTaskRefs: lookupTaskRefs,
9108
9661
  grouped,
@@ -9287,28 +9840,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9287
9840
  setMutating(void 0);
9288
9841
  }
9289
9842
  };
9843
+ const clearSendState = (0, react.useCallback)(() => {
9844
+ setConfirmation((current) => current === void 0 ? current : void 0);
9845
+ setReplyRequestId((current) => current === void 0 ? current : void 0);
9846
+ setStatusMessage((current) => current === void 0 ? current : void 0);
9847
+ }, []);
9290
9848
  const sendReply = async () => {
9849
+ const { draft, recipients } = drafts.getSnapshot(draftKey);
9291
9850
  if (pending || thread === void 0 || draft.trim() === "") return;
9292
9851
  const id = replyRequestId ?? mintRequestId();
9293
9852
  setReplyRequestId(id);
9294
9853
  setPending(true);
9295
9854
  setError(void 0);
9296
9855
  try {
9297
- const attachmentIds = [];
9298
- for (const file of pendingFiles) {
9299
- const uploaded = await putAttachment({
9300
- requestId: mintRequestId(),
9301
- workspaceId,
9302
- name: file.name,
9303
- mediaType: file.type === "" ? void 0 : file.type,
9304
- bytesBase64: bytesToBase64(new Uint8Array(await file.arrayBuffer()))
9305
- });
9306
- if (!uploaded.ok) {
9307
- setError(uploaded.error.message);
9308
- return;
9309
- }
9310
- attachmentIds.push(uploaded.value.attachmentId);
9856
+ const upload = await uploadComposerFiles(putAttachment, workspaceId, pendingFiles);
9857
+ if (!upload.ok) {
9858
+ setError(upload.error);
9859
+ return;
9311
9860
  }
9861
+ const attachmentIds = upload.attachmentIds;
9312
9862
  const result = await reply({
9313
9863
  requestId: id,
9314
9864
  workspaceId,
@@ -9477,7 +10027,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9477
10027
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
9478
10028
  t("runtimeRiskDetail", {
9479
10029
  member: status.member.handle,
9480
- diagnostic: status.diagnostic ?? t("statusError")
10030
+ diagnostic: diagnosticText(status) || t("statusError")
9481
10031
  }),
9482
10032
  " · ",
9483
10033
  claim.direction
@@ -9667,23 +10217,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9667
10217
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamComposer, {
9668
10218
  members: channelMembers,
9669
10219
  followerMemberIds: followerIds,
9670
- recipients,
9671
- draft,
10220
+ drafts,
10221
+ draftKey,
9672
10222
  pending,
9673
10223
  ...statusMessage === void 0 ? {} : { confirmation: statusMessage },
9674
10224
  ...error === void 0 ? {} : { error },
9675
- onDraftChange: (next) => {
9676
- drafts.writeDraft(draftKey, next);
9677
- setConfirmation(void 0);
9678
- setReplyRequestId(void 0);
9679
- setStatusMessage(void 0);
9680
- },
9681
- onRecipientsChange: (next) => {
9682
- drafts.writeRecipients(draftKey, next);
9683
- setConfirmation(void 0);
9684
- setReplyRequestId(void 0);
9685
- setStatusMessage(void 0);
9686
- },
10225
+ onEdit: clearSendState,
9687
10226
  onSubmit: () => {
9688
10227
  sendReply();
9689
10228
  },
@@ -9697,9 +10236,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9697
10236
  }
9698
10237
  //#endregion
9699
10238
  //#region src/client/TeamConversation.tsx
9700
- function TeamConversation({ t, useWorkspaces, navigation, drafts, putAttachment, getAttachment, loadChannels, readThread, loadThreadHistory, threadObservations, subscribeChanges, loadMembers, sendMessage, joinChannel, removeChannelMember, reply, changeTask, promoteThread, selectThread, selectChannel, backToWorkspace, backToChannels, resolveTaskRefs }) {
10239
+ function TeamConversation({ t, useWorkspaces, navigation, drafts, putAttachment, getAttachment, loadChannels, readThread, loadThreadHistory, threadObservations, subscribeChanges, loadMembers, loadInbox, sendMessage, joinChannel, removeChannelMember, reply, changeTask, promoteThread, selectThread, selectChannel, selectWorkspace, backToWorkspace, backToChannels, resolveTaskRefs }) {
9701
10240
  const navigationState = (0, react.useSyncExternalStore)(navigation.subscribe, navigation.getSnapshot, navigation.getSnapshot);
9702
10241
  const current = useWorkspaces((state) => state.items).find((workspace) => workspace.workspaceId === navigationState.workspaceId);
10242
+ if (navigationState.inbox === true) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamInboxPage, {
10243
+ useWorkspaces,
10244
+ loadInbox,
10245
+ subscribeChanges,
10246
+ selectWorkspace,
10247
+ selectThread,
10248
+ t
10249
+ }, "inbox");
9703
10250
  if (current !== void 0 && navigationState.threadRef !== void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamThreadPage, {
9704
10251
  workspaceId: current.workspaceId,
9705
10252
  putAttachment,
@@ -9769,7 +10316,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9769
10316
  }
9770
10317
  //#endregion
9771
10318
  //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/sidebar.module.css.mjs
9772
- const css$1 = "html[data-agent-team-mode=team] button[class*=newSession]{display:none}.d0xfxa_workspaceBrowser{flex-direction:column;height:100%;min-height:0;padding:0 8px 8px;display:flex}.d0xfxa_railButton{color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;justify-content:center;align-items:center;padding:0;display:inline-flex}.d0xfxa_railButton:hover,.d0xfxa_railButton:focus-visible{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);outline:none}.d0xfxa_workspaceList{flex-direction:column;gap:2px;padding-bottom:2px;display:flex}.d0xfxa_workspaceRow{color:var(--dsw-alias-label-primary);cursor:pointer;text-align:left;background:0 0;border:0;border-radius:8px;align-items:center;gap:6px;width:100%;height:34px;padding:0 8px;display:flex}.d0xfxa_workspaceRow:hover,.d0xfxa_workspaceRow:focus-visible,.d0xfxa_workspaceRow[aria-current=page]{background:var(--dsw-alias-interactive-bg-hover);outline:none}.d0xfxa_workspaceRow:focus-visible{box-shadow:inset 0 0 0 1px var(--dsw-alias-border-l3)}.d0xfxa_workspaceIcon{color:var(--dsw-alias-label-tertiary);flex:0 0 16px;justify-content:center;align-items:center;height:20px;display:inline-flex}.d0xfxa_workspaceRow[data-selected] .d0xfxa_workspaceIcon{color:var(--dsw-alias-state-business-primary)}.d0xfxa_workspaceCopy{min-width:0;display:flex}.d0xfxa_workspaceCopy strong{text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:400;line-height:20px;overflow:hidden}.d0xfxa_emptyState{color:var(--dsw-alias-label-tertiary);margin:8px;font-size:12px;line-height:18px}.d0xfxa_railWorkspace{flex-direction:column;align-items:center;gap:8px;padding-top:8px;display:flex}.d0xfxa_railButton{border-radius:50%;width:36px;height:36px}.d0xfxa_railButton[data-active]{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.d0xfxa_workspaceSection{flex-direction:column;flex:1;gap:4px;min-height:0;margin-top:2px;display:flex;overflow-y:auto}.d0xfxa_section{flex-direction:column;display:flex}.d0xfxa_sectionHeader{align-items:center;min-height:26px;padding-right:2px;display:flex}.d0xfxa_sectionToggle{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;align-items:center;gap:4px;min-width:0;min-height:24px;padding:0 6px;font-size:12px;line-height:18px;display:inline-flex}.d0xfxa_sectionToggle:focus-visible{outline:none}.d0xfxa_sectionToggle:hover .d0xfxa_sectionChevron,.d0xfxa_sectionToggle:focus-visible .d0xfxa_sectionChevron{color:var(--dsw-alias-label-primary)}.d0xfxa_sectionChevron{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .12s,color .12s}.d0xfxa_sectionToggle[aria-expanded=false] .d0xfxa_sectionChevron{transform:rotate(-90deg)}.d0xfxa_sectionTitle{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.d0xfxa_sectionActions{align-items:center;margin-left:auto;display:inline-flex}.d0xfxa_panel{flex-direction:column;display:flex}.d0xfxa_iconButton{color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:50%;justify-content:center;align-items:center;width:24px;height:24px;padding:0;display:inline-flex}.d0xfxa_iconButton:hover,.d0xfxa_iconButton:focus-visible{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);outline:none}.d0xfxa_textButton{color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:5px;padding:2px 5px;font-size:11px;line-height:18px}.d0xfxa_textButton:hover,.d0xfxa_textButton:focus-visible{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);outline:none}.d0xfxa_textButton:disabled{cursor:not-allowed;opacity:.4}.d0xfxa_channelList,.d0xfxa_agentList{flex-direction:column;gap:1px;padding:0 4px 4px;display:flex}.d0xfxa_sidebarRowDragging{opacity:.5}.d0xfxa_sidebarRowDropBefore,.d0xfxa_sidebarRowDropAfter{position:relative}.d0xfxa_sidebarRowDropBefore:before,.d0xfxa_sidebarRowDropAfter:after{content:\"\";z-index:1;background:linear-gradient(55deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / 5px 7px no-repeat, linear-gradient(125deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 5px / 5px 7px no-repeat, linear-gradient(var(--dsw-alias-state-business-primary) 0 0) 4px 5px / calc(100% - 4px) 2px no-repeat;pointer-events:none;height:12px;position:absolute;left:0;right:4px}.d0xfxa_sidebarRowDropBefore:before{top:-7px}.d0xfxa_sidebarRowDropAfter:after{bottom:-7px}.d0xfxa_channelRow{color:var(--dsw-alias-label-primary);border-radius:8px;align-items:center;min-height:30px;display:flex;position:relative}.d0xfxa_channelSelect{box-sizing:border-box;color:inherit;cursor:pointer;text-align:left;background:0 0;border:0;flex:1;align-items:center;min-width:0;min-height:30px;padding:3px 4px 3px 8px;display:flex}.d0xfxa_channelSelect:focus-visible{outline:none}.d0xfxa_channelName{text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:400;line-height:18px;overflow:hidden}.d0xfxa_agentRow{color:var(--dsw-alias-label-primary);border-radius:8px;align-items:center;min-height:38px;display:flex;position:relative}.d0xfxa_agentSelect{box-sizing:border-box;color:inherit;cursor:pointer;text-align:left;background:0 0;border:0;flex:1;grid-template-columns:24px minmax(0,1fr);align-items:center;gap:0 8px;min-width:0;min-height:38px;padding:3px 4px 3px 8px;display:grid}.d0xfxa_agentSelect:focus-visible{outline:none}.d0xfxa_agentSelect[aria-current=page]{background:var(--dsw-alias-interactive-bg-hover);border-radius:8px}.d0xfxa_agentRow:hover .d0xfxa_agentSelect[aria-current=page],.d0xfxa_agentRow:focus-within .d0xfxa_agentSelect[aria-current=page],.d0xfxa_agentRow[data-menu-open] .d0xfxa_agentSelect[aria-current=page]{background:0 0}.d0xfxa_agentAvatar{background:hsl(var(--team-avatar-hue,212) 42% 46%);color:#fff;cursor:default;border-radius:50%;flex:0 0 24px;justify-content:center;align-items:center;width:24px;height:24px;font-size:11px;font-weight:600;display:inline-flex;position:relative}.d0xfxa_agentAvatarBadge{background:var(--dsw-specific-sidebar-fill);box-shadow:0 0 0 1px var(--dsw-specific-sidebar-fill);border-radius:50%;justify-content:center;align-items:center;width:12px;height:12px;padding:1px;line-height:0;display:inline-flex;position:absolute;bottom:-3px;right:-3px}.d0xfxa_agentCopy{flex-direction:column;min-width:0;display:flex}.d0xfxa_agentCopy strong{text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:400;line-height:17px;overflow:hidden}.d0xfxa_agentCopy small{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:10px;line-height:13px;overflow:hidden}.d0xfxa_unavailableDot{background:var(--dsw-alias-label-tertiary);border-radius:50%;width:7px;height:7px;display:inline-block}.d0xfxa_rowMenu{flex:none;align-items:center;padding-right:4px;display:none}.d0xfxa_channelRow:hover .d0xfxa_rowMenu,.d0xfxa_channelRow:focus-within .d0xfxa_rowMenu,.d0xfxa_channelRow[data-menu-open] .d0xfxa_rowMenu,.d0xfxa_agentRow:hover .d0xfxa_rowMenu,.d0xfxa_agentRow:focus-within .d0xfxa_rowMenu,.d0xfxa_agentRow[data-menu-open] .d0xfxa_rowMenu{display:inline-flex}.d0xfxa_channelRow[data-menu-open],.d0xfxa_agentRow[data-menu-open],.d0xfxa_channelRow:hover,.d0xfxa_agentRow:hover,.d0xfxa_channelRow:focus-within,.d0xfxa_agentRow:focus-within,.d0xfxa_channelRow[aria-current=page]{background:var(--dsw-alias-interactive-bg-hover)}.d0xfxa_rowMenuButton{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;border-radius:4px;justify-content:center;align-items:center;width:20px;height:20px;padding:0;display:inline-flex}.d0xfxa_rowMenuButton:hover,.d0xfxa_rowMenuButton:focus-visible{color:var(--dsw-alias-label-primary);outline:none}.d0xfxa_retryError{color:var(--dsw-alias-state-error-primary);justify-content:space-between;align-items:center;gap:8px;padding:8px;font-size:11px;display:flex}.d0xfxa_rowAlert{color:var(--dsw-alias-state-error-primary);overflow-wrap:anywhere;padding:2px 8px 6px;font-size:11px}.d0xfxa_editDescription{color:var(--dsw-alias-label-secondary);margin:0 0 10px;font-size:12px;line-height:18px}.d0xfxa_editMemberList{gap:3px;display:grid}.d0xfxa_editMemberRow{border-radius:6px;grid-template-columns:14px minmax(0,1fr) auto;align-items:center;gap:0 8px;min-height:40px;padding:3px 6px;display:grid}.d0xfxa_editMemberRowChannels{grid-template-columns:minmax(0,1fr) auto}.d0xfxa_editMemberRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.d0xfxa_editMemberCopy{min-width:0;display:grid}.d0xfxa_editMemberCopy strong{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:18px;overflow:hidden}.d0xfxa_editMemberCopy small{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:10px;line-height:14px;overflow:hidden}.d0xfxa_editChannelName{text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:400;line-height:18px;overflow:hidden}.d0xfxa_editMemberRow button{min-width:60px}.d0xfxa_editHint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:11px;line-height:16px}.d0xfxa_menuHint{color:var(--dsw-alias-label-tertiary);margin-left:4px;font-size:10px;line-height:14px}.d0xfxa_rowError{color:var(--dsw-alias-state-error-primary);grid-column:1/-1;margin:2px 0;font-size:11px;line-height:16px}";
10319
+ const css$1 = "html[data-agent-team-mode=team] button[class*=newSession]{display:none}.d0xfxa_workspaceBrowser{flex-direction:column;height:100%;min-height:0;padding:0 8px 8px;display:flex}.d0xfxa_railButton{color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;justify-content:center;align-items:center;padding:0;display:inline-flex}.d0xfxa_railButton:hover,.d0xfxa_railButton:focus-visible{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.d0xfxa_railButton:focus-visible{outline:2px solid var(--dsw-alias-label-primary);outline-offset:1px}.d0xfxa_workspaceList{flex-direction:column;gap:2px;padding-bottom:2px;display:flex}.d0xfxa_workspaceRow{color:var(--dsw-alias-label-primary);cursor:pointer;text-align:left;background:0 0;border:0;border-radius:8px;align-items:center;gap:6px;width:100%;height:34px;padding:0 8px;display:flex}.d0xfxa_workspaceRow:hover,.d0xfxa_workspaceRow:focus-visible,.d0xfxa_workspaceRow[aria-current=page]{background:var(--dsw-alias-interactive-bg-hover)}.d0xfxa_workspaceRow:focus-visible{outline:2px solid var(--dsw-alias-label-primary);outline-offset:-2px}.d0xfxa_workspaceIcon{color:var(--dsw-alias-label-tertiary);flex:0 0 16px;justify-content:center;align-items:center;height:20px;display:inline-flex}.d0xfxa_workspaceRow[data-selected] .d0xfxa_workspaceIcon{color:var(--dsw-alias-state-business-primary)}.d0xfxa_workspaceCopy{min-width:0;display:flex}.d0xfxa_workspaceCopy strong{text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:400;line-height:20px;overflow:hidden}.d0xfxa_emptyState{color:var(--dsw-alias-label-tertiary);margin:8px;font-size:12px;line-height:18px}.d0xfxa_inboxCard{color:var(--dsw-alias-label-primary);cursor:pointer;text-align:left;background:0 0;border:0;border-radius:8px;flex:none;align-items:center;gap:6px;width:100%;height:34px;margin:4px 0 2px;padding:0 8px;display:flex}.d0xfxa_inboxCard:hover,.d0xfxa_inboxCard:focus-visible,.d0xfxa_inboxCard[aria-current=page]{background:var(--dsw-alias-interactive-bg-hover)}.d0xfxa_inboxCard:focus-visible{outline:2px solid var(--dsw-alias-label-primary);outline-offset:-2px}.d0xfxa_inboxCard>svg{color:var(--dsw-alias-label-tertiary);flex:0 0 16px}.d0xfxa_inboxCardLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:14px;line-height:20px;overflow:hidden}.d0xfxa_inboxBadge{background:var(--dsw-alias-state-business-primary);box-sizing:border-box;color:var(--dsw-alias-label-primary-foreground);corner-shape:round;border-radius:999px;flex:none;justify-content:center;align-items:center;min-width:18px;height:18px;margin-left:auto;padding:0 5px;font-size:11px;font-weight:600;line-height:18px;display:inline-flex}.d0xfxa_railButton .d0xfxa_inboxBadge{margin-left:0;position:absolute;top:0;right:0}.d0xfxa_railWorkspace{flex-direction:column;align-items:center;gap:8px;padding-top:8px;display:flex}.d0xfxa_railButton{corner-shape:round;border-radius:50%;width:36px;height:36px;position:relative}.d0xfxa_railButton[data-active]{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.d0xfxa_workspaceSection{flex-direction:column;flex:1;gap:4px;min-height:0;margin-top:2px;display:flex;overflow-y:auto}.d0xfxa_section{flex-direction:column;display:flex}.d0xfxa_sectionHeader{align-items:center;min-height:26px;padding-right:2px;display:flex}.d0xfxa_sectionToggle{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;border-radius:4px;align-items:center;gap:4px;min-width:0;min-height:24px;padding:0 6px;font-size:12px;line-height:18px;display:inline-flex}.d0xfxa_sectionToggle:focus-visible{outline:2px solid var(--dsw-alias-label-primary);outline-offset:1px}.d0xfxa_sectionToggle:hover .d0xfxa_sectionChevron,.d0xfxa_sectionToggle:focus-visible .d0xfxa_sectionChevron{color:var(--dsw-alias-label-primary)}.d0xfxa_sectionChevron{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .12s,color .12s}.d0xfxa_sectionToggle[aria-expanded=false] .d0xfxa_sectionChevron{transform:rotate(-90deg)}.d0xfxa_sectionTitle{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.d0xfxa_sectionActions{align-items:center;margin-left:auto;display:inline-flex}.d0xfxa_panel{flex-direction:column;display:flex}.d0xfxa_iconButton{corner-shape:round;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:50%;justify-content:center;align-items:center;width:24px;height:24px;padding:0;display:inline-flex}.d0xfxa_iconButton:hover,.d0xfxa_iconButton:focus-visible{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.d0xfxa_iconButton:focus-visible{outline:2px solid var(--dsw-alias-label-primary);outline-offset:1px}.d0xfxa_textButton{color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:5px;padding:2px 5px;font-size:11px;line-height:18px}.d0xfxa_textButton:hover,.d0xfxa_textButton:focus-visible{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.d0xfxa_textButton:focus-visible{outline:2px solid var(--dsw-alias-label-primary);outline-offset:1px}.d0xfxa_textButton:disabled{cursor:not-allowed;opacity:.4}.d0xfxa_channelList,.d0xfxa_agentList{flex-direction:column;gap:1px;padding:0 4px 4px;display:flex}.d0xfxa_sidebarRowDragging{opacity:.5}.d0xfxa_sidebarRowDropBefore,.d0xfxa_sidebarRowDropAfter{position:relative}.d0xfxa_sidebarRowDropBefore:before,.d0xfxa_sidebarRowDropAfter:after{content:\"\";z-index:1;background:linear-gradient(55deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / 5px 7px no-repeat, linear-gradient(125deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 5px / 5px 7px no-repeat, linear-gradient(var(--dsw-alias-state-business-primary) 0 0) 4px 5px / calc(100% - 4px) 2px no-repeat;pointer-events:none;height:12px;position:absolute;left:0;right:4px}.d0xfxa_sidebarRowDropBefore:before{top:-7px}.d0xfxa_sidebarRowDropAfter:after{bottom:-7px}.d0xfxa_channelRow{color:var(--dsw-alias-label-primary);border-radius:8px;align-items:center;min-height:30px;display:flex;position:relative}.d0xfxa_channelSelect{box-sizing:border-box;color:inherit;cursor:pointer;text-align:left;background:0 0;border:0;border-radius:8px;flex:1;align-items:center;min-width:0;min-height:30px;padding:3px 4px 3px 8px;display:flex}.d0xfxa_channelSelect:focus-visible{outline:2px solid var(--dsw-alias-label-primary);outline-offset:-2px}.d0xfxa_channelName{text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:400;line-height:18px;overflow:hidden}.d0xfxa_agentRow{color:var(--dsw-alias-label-primary);border-radius:8px;align-items:center;min-height:38px;display:flex;position:relative}.d0xfxa_agentSelect{box-sizing:border-box;color:inherit;cursor:pointer;text-align:left;background:0 0;border:0;border-radius:8px;flex:1;grid-template-columns:24px minmax(0,1fr);align-items:center;gap:0 8px;min-width:0;min-height:38px;padding:3px 4px 3px 8px;display:grid}.d0xfxa_agentSelect:focus-visible{outline:2px solid var(--dsw-alias-label-primary);outline-offset:-2px}.d0xfxa_agentSelect[aria-current=page]{background:var(--dsw-alias-interactive-bg-hover);border-radius:8px}.d0xfxa_agentRow:hover .d0xfxa_agentSelect[aria-current=page],.d0xfxa_agentRow:focus-within .d0xfxa_agentSelect[aria-current=page],.d0xfxa_agentRow[data-menu-open] .d0xfxa_agentSelect[aria-current=page]{background:0 0}.d0xfxa_agentAvatar{background:hsl(var(--team-avatar-hue,212) 42% 46%);corner-shape:round;color:#fff;cursor:default;border-radius:50%;flex:0 0 24px;justify-content:center;align-items:center;width:24px;height:24px;font-size:11px;font-weight:600;display:inline-flex;position:relative}.d0xfxa_agentAvatarBadge{background:var(--dsw-specific-sidebar-fill);corner-shape:round;box-shadow:0 0 0 1px var(--dsw-specific-sidebar-fill);border-radius:50%;justify-content:center;align-items:center;width:12px;height:12px;padding:1px;line-height:0;display:inline-flex;position:absolute;bottom:-3px;right:-3px}.d0xfxa_agentCopy{flex-direction:column;min-width:0;display:flex}.d0xfxa_agentCopy strong{text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:400;line-height:17px;overflow:hidden}.d0xfxa_agentCopy small{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:10px;line-height:13px;overflow:hidden}.d0xfxa_unavailableDot{background:var(--dsw-alias-label-tertiary);corner-shape:round;border-radius:50%;width:7px;height:7px;display:inline-block}.d0xfxa_rowMenu{flex:none;align-items:center;padding-right:4px;display:none}.d0xfxa_channelRow:hover .d0xfxa_rowMenu,.d0xfxa_channelRow:focus-within .d0xfxa_rowMenu,.d0xfxa_channelRow[data-menu-open] .d0xfxa_rowMenu,.d0xfxa_agentRow:hover .d0xfxa_rowMenu,.d0xfxa_agentRow:focus-within .d0xfxa_rowMenu,.d0xfxa_agentRow[data-menu-open] .d0xfxa_rowMenu{display:inline-flex}.d0xfxa_channelRow[data-menu-open],.d0xfxa_agentRow[data-menu-open],.d0xfxa_channelRow:hover,.d0xfxa_agentRow:hover,.d0xfxa_channelRow:focus-within,.d0xfxa_agentRow:focus-within,.d0xfxa_channelRow[aria-current=page]{background:var(--dsw-alias-interactive-bg-hover)}.d0xfxa_rowMenuButton{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;border-radius:4px;justify-content:center;align-items:center;width:20px;height:20px;padding:0;display:inline-flex}.d0xfxa_rowMenuButton:hover,.d0xfxa_rowMenuButton:focus-visible{color:var(--dsw-alias-label-primary)}.d0xfxa_rowMenuButton:focus-visible{outline:2px solid var(--dsw-alias-label-primary);outline-offset:1px}.d0xfxa_retryError{color:var(--dsw-alias-state-error-primary);justify-content:space-between;align-items:center;gap:8px;padding:8px;font-size:11px;display:flex}.d0xfxa_rowAlert{color:var(--dsw-alias-state-error-primary);overflow-wrap:anywhere;padding:2px 8px 6px;font-size:11px}.d0xfxa_editDescription{color:var(--dsw-alias-label-secondary);margin:0 0 10px;font-size:12px;line-height:18px}.d0xfxa_editMemberList{gap:3px;display:grid}.d0xfxa_editMemberRow{border-radius:6px;grid-template-columns:14px minmax(0,1fr) auto;align-items:center;gap:0 8px;min-height:40px;padding:3px 6px;display:grid}.d0xfxa_editMemberRowChannels{grid-template-columns:minmax(0,1fr) auto}.d0xfxa_editMemberRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.d0xfxa_editMemberCopy{min-width:0;display:grid}.d0xfxa_editMemberCopy strong{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:18px;overflow:hidden}.d0xfxa_editMemberCopy small{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:10px;line-height:14px;overflow:hidden}.d0xfxa_editChannelName{text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:400;line-height:18px;overflow:hidden}.d0xfxa_editMemberRow button{min-width:60px}.d0xfxa_editHint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:11px;line-height:16px}.d0xfxa_menuHint{color:var(--dsw-alias-label-tertiary);margin-left:4px;font-size:10px;line-height:14px}.d0xfxa_rowError{color:var(--dsw-alias-state-error-primary);grid-column:1/-1;margin:2px 0;font-size:11px;line-height:16px}";
9773
10320
  const tagId$1 = "@wowyuarm/dsh-agent-team/sidebar.module.css";
9774
10321
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
9775
10322
  const tag = document.createElement("style");
@@ -9798,6 +10345,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9798
10345
  "editMemberRowChannels": "d0xfxa_editMemberRowChannels",
9799
10346
  "emptyState": "d0xfxa_emptyState",
9800
10347
  "iconButton": "d0xfxa_iconButton",
10348
+ "inboxBadge": "d0xfxa_inboxBadge",
10349
+ "inboxCard": "d0xfxa_inboxCard",
10350
+ "inboxCardLabel": "d0xfxa_inboxCardLabel",
9801
10351
  "menuHint": "d0xfxa_menuHint",
9802
10352
  "panel": "d0xfxa_panel",
9803
10353
  "railButton": "d0xfxa_railButton",
@@ -10260,8 +10810,45 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10260
10810
  });
10261
10811
  }
10262
10812
  //#endregion
10813
+ //#region src/client/team-dialog-save.ts
10814
+ /**
10815
+ * Shared edit-dialog save lifecycle: one in-flight durable update, the dialog
10816
+ * held disabled while it runs, a refusal reported in place, and a close only
10817
+ * after the parent has re-read the committed state. Callers keep their own
10818
+ * payload and request reuse, and hold `pendingRequest` so that editing a field
10819
+ * drops a request the Host may already have committed.
10820
+ */
10821
+ function useEditDialogSave({ save, onCommitted, onClose }) {
10822
+ const [saving, setSaving] = (0, react.useState)(false);
10823
+ const [error, setError] = (0, react.useState)();
10824
+ const pendingRequest = (0, react.useRef)();
10825
+ const submit = async (request) => {
10826
+ pendingRequest.current = request;
10827
+ setSaving(true);
10828
+ setError(void 0);
10829
+ try {
10830
+ const result = await save(request);
10831
+ if (result.ok) {
10832
+ pendingRequest.current = void 0;
10833
+ await onCommitted();
10834
+ onClose();
10835
+ } else setError(result.error.message);
10836
+ } catch (cause) {
10837
+ setError(cause instanceof Error ? cause.message : String(cause));
10838
+ } finally {
10839
+ setSaving(false);
10840
+ }
10841
+ };
10842
+ return {
10843
+ saving,
10844
+ error,
10845
+ pendingRequest,
10846
+ save: submit
10847
+ };
10848
+ }
10849
+ //#endregion
10263
10850
  //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/create.module.css.mjs
10264
- const css = "._1henIG_form{gap:16px;display:grid}._1henIG_field{color:var(--dsw-alias-label-secondary);gap:6px;font-size:12px;line-height:18px;display:grid}._1henIG_input{box-sizing:border-box;width:100%}._1henIG_menuCap{max-height:min(320px,56vh)}._1henIG_selectTrigger{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);box-sizing:border-box;color:var(--dsw-alias-label-primary);cursor:pointer;text-align:left;border-radius:8px;justify-content:space-between;align-items:center;gap:8px;min-height:32px;padding:4px 10px;font-size:14px;line-height:22px;display:flex}._1henIG_selectTrigger:disabled{cursor:default;opacity:.6}._1henIG_selectTrigger:focus-visible{border-color:var(--dsw-alias-brand-primary);outline:none}._1henIG_selectValue{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}._1henIG_chevron{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .12s;display:inline-flex}._1henIG_chevronOpen{transform:rotate(180deg)}._1henIG_memberPicker{border:0;gap:4px;max-height:220px;margin:0;padding:0;display:grid;overflow-y:auto}._1henIG_memberPicker legend{color:var(--dsw-alias-label-secondary);padding:0 0 6px;font-size:12px;line-height:18px}._1henIG_memberOption{color:var(--dsw-alias-label-primary);border-radius:6px;grid-template-columns:auto 14px minmax(0,1fr);align-items:center;gap:0 7px;min-height:32px;padding:3px 6px;display:grid}._1henIG_memberOption:hover{background:var(--dsw-alias-interactive-bg-hover)}._1henIG_memberOption input{margin:0}._1henIG_memberOption small{color:var(--dsw-alias-label-tertiary);grid-column:3;font-size:10px;line-height:14px}._1henIG_unavailableDot{background:var(--dsw-alias-label-tertiary);border-radius:50%;justify-self:center;width:7px;height:7px;display:inline-block}._1henIG_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px;line-height:18px}._1henIG_dialogContent{max-height:min(70vh,560px);overflow-y:auto}@media (width<=600px){._1henIG_dialogContent{max-height:calc(100vh - 180px)}._1henIG_memberPicker{max-height:180px}}";
10851
+ const css = "._1henIG_form{gap:16px;display:grid}._1henIG_field{color:var(--dsw-alias-label-secondary);gap:6px;font-size:12px;line-height:18px;display:grid}._1henIG_input{box-sizing:border-box;width:100%}._1henIG_menuCap{max-height:min(320px,56vh)}._1henIG_selectTrigger{background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);box-sizing:border-box;color:var(--dsw-alias-label-primary);cursor:pointer;text-align:left;border-radius:8px;justify-content:space-between;align-items:center;gap:8px;min-height:32px;padding:4px 10px;font-size:14px;line-height:22px;display:flex}._1henIG_selectTrigger:disabled{cursor:default;opacity:.6}._1henIG_selectTrigger:focus-visible{border-color:var(--dsw-alias-brand-primary);outline:none}._1henIG_selectValue{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}._1henIG_chevron{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .12s;display:inline-flex}._1henIG_chevronOpen{transform:rotate(180deg)}._1henIG_memberPicker{border:0;gap:4px;max-height:220px;margin:0;padding:0;display:grid;overflow-y:auto}._1henIG_memberPicker legend{color:var(--dsw-alias-label-secondary);padding:0 0 6px;font-size:12px;line-height:18px}._1henIG_memberOption{color:var(--dsw-alias-label-primary);border-radius:6px;grid-template-columns:auto 14px minmax(0,1fr);align-items:center;gap:0 7px;min-height:32px;padding:3px 6px;display:grid}._1henIG_memberOption:hover{background:var(--dsw-alias-interactive-bg-hover)}._1henIG_memberOption input{margin:0}._1henIG_memberOption small{color:var(--dsw-alias-label-tertiary);grid-column:3;font-size:10px;line-height:14px}._1henIG_unavailableDot{background:var(--dsw-alias-label-tertiary);corner-shape:round;border-radius:50%;justify-self:center;width:7px;height:7px;display:inline-block}._1henIG_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px;line-height:18px}._1henIG_dialogContent{max-height:min(70vh,560px);overflow-y:auto}@media (width<=600px){._1henIG_dialogContent{max-height:calc(100vh - 180px)}._1henIG_memberPicker{max-height:180px}}";
10265
10852
  const tagId = "@wowyuarm/dsh-agent-team/create.module.css";
10266
10853
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
10267
10854
  const tag = document.createElement("style");
@@ -10454,9 +11041,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10454
11041
  const [handle, setHandle] = (0, react.useState)(status.member.handle);
10455
11042
  const [description, setDescription] = (0, react.useState)(status.member.description);
10456
11043
  const [model, setModel] = (0, react.useState)(status.member.model);
10457
- const [saving, setSaving] = (0, react.useState)(false);
10458
- const [error, setError] = (0, react.useState)();
10459
- const pendingRequest = (0, react.useRef)();
11044
+ const { saving, error, pendingRequest, save } = useEditDialogSave({
11045
+ save: updateMember,
11046
+ onCommitted,
11047
+ onClose
11048
+ });
10460
11049
  const dirty = handle.trim() !== status.member.handle || description.trim() !== status.member.description || !sameModel(model, status.member.model);
10461
11050
  const submit = async (event) => {
10462
11051
  event.preventDefault();
@@ -10470,25 +11059,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10470
11059
  ...model === void 0 ? {} : { model },
10471
11060
  ...status.member.capabilities === void 0 ? {} : { capabilities: status.member.capabilities }
10472
11061
  };
10473
- 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 : {
11062
+ await save(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 : {
10474
11063
  requestId: mintRequestId(),
10475
11064
  ...payload
10476
- };
10477
- pendingRequest.current = request;
10478
- setSaving(true);
10479
- setError(void 0);
10480
- try {
10481
- const result = await updateMember(request);
10482
- if (result.ok) {
10483
- pendingRequest.current = void 0;
10484
- await onCommitted();
10485
- onClose();
10486
- } else setError(result.error.message);
10487
- } catch (cause) {
10488
- setError(cause instanceof Error ? cause.message : String(cause));
10489
- } finally {
10490
- setSaving(false);
10491
- }
11065
+ });
10492
11066
  };
10493
11067
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
10494
11068
  open: true,
@@ -10623,14 +11197,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10623
11197
  }
10624
11198
  }
10625
11199
  }, []);
11200
+ const loadedRef = (0, react.useRef)(false);
10626
11201
  const refresh = (0, react.useCallback)(async () => {
10627
- setLoading(true);
11202
+ if (!loadedRef.current) setLoading(true);
10628
11203
  const result = await loadMembers({ workspaceId });
10629
11204
  if (result.ok) {
10630
11205
  const next = result.value.filter((status) => status.member.state !== "inactive" && status.member.state !== "archived");
10631
11206
  setMembers(next);
10632
11207
  followRollover(next);
10633
11208
  setError(void 0);
11209
+ loadedRef.current = true;
10634
11210
  } else setError(result.error.message);
10635
11211
  setLoading(false);
10636
11212
  }, [
@@ -10655,6 +11231,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10655
11231
  refresh,
10656
11232
  workspaceId
10657
11233
  ]);
11234
+ (0, react.useEffect)(() => subscribeChanges({
11235
+ kind: "presence",
11236
+ workspaceId
11237
+ }, (update) => {
11238
+ if (update.type === "failed") {
11239
+ setError(update.message);
11240
+ return;
11241
+ }
11242
+ refresh();
11243
+ }), [
11244
+ subscribeChanges,
11245
+ refresh,
11246
+ workspaceId
11247
+ ]);
10658
11248
  const closeForm = () => {
10659
11249
  if (creating) return;
10660
11250
  setFormOpen(false);
@@ -10678,7 +11268,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10678
11268
  setDescription("");
10679
11269
  setModel(void 0);
10680
11270
  setFormOpen(false);
10681
- if (result.value.status.presence === "unavailable") setError(result.value.status.diagnostic ?? t("statusUnavailable"));
11271
+ if (result.value.status.presence === "unavailable") setError(diagnosticText(result.value.status) || t("statusUnavailable"));
10682
11272
  else setRetryRequest(void 0);
10683
11273
  queueMicrotask(() => {
10684
11274
  triggerRef.current?.focus();
@@ -10870,7 +11460,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10870
11460
  return;
10871
11461
  }
10872
11462
  if (result.value.status.availability === "unavailable") {
10873
- setRowAlert(t("restartStillUnavailable", { diagnostic: result.value.status.diagnostic ?? t("statusUnavailable") }));
11463
+ const diagnostic = result.value.status.diagnostic;
11464
+ if (diagnostic?.class === "session-refused" && diagnostic.remediable === false) {
11465
+ setRowAlert(t("restartRefusedNoRestart", { detail: diagnosticText(result.value.status) }));
11466
+ return;
11467
+ }
11468
+ setRowAlert(t("restartStillUnavailable", { diagnostic: diagnosticText(result.value.status) || t("statusUnavailable") }));
10874
11469
  return;
10875
11470
  }
10876
11471
  setRowAlert(void 0);
@@ -10926,7 +11521,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10926
11521
  label: t("resumeAgent"),
10927
11522
  icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPlayOutline16, {})
10928
11523
  }] : [],
10929
- ...status.availability === "unavailable" ? [{
11524
+ ...status.availability === "unavailable" && restartOffered(status) ? [{
10930
11525
  id: "restart",
10931
11526
  label: t("restartAgent"),
10932
11527
  icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutline16, {})
@@ -11083,8 +11678,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11083
11678
  onCommit: applyMove
11084
11679
  });
11085
11680
  const sectionOpen = useSidebarSectionOpen(workspaceId, "channels");
11681
+ const loadedRef = (0, react.useRef)(false);
11086
11682
  const refresh = (0, react.useCallback)(async () => {
11087
- setLoading(true);
11683
+ if (!loadedRef.current) setLoading(true);
11088
11684
  const [channelResult, memberResult] = await Promise.all([loadChannels({
11089
11685
  workspaceId,
11090
11686
  limit: 1
@@ -11096,6 +11692,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11096
11692
  const selectable = new Set(visibleMembers.filter((status) => status.presence !== "unavailable").map((status) => status.member.memberId));
11097
11693
  setSelected((current) => new Set([...current].filter((memberId) => selectable.has(memberId))));
11098
11694
  setError(void 0);
11695
+ loadedRef.current = true;
11099
11696
  } else if (!channelResult.ok) setError(channelResult.error.message);
11100
11697
  else if (!memberResult.ok) setError(memberResult.error.message);
11101
11698
  setLoading(false);
@@ -11452,9 +12049,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11452
12049
  function ChannelEditorDialog({ channel, members, joinedIds, updateChannel, joinChannel, removeChannelMember, onCommitted, onClose, t }) {
11453
12050
  const [name, setName] = (0, react.useState)(channel.name);
11454
12051
  const [description, setDescription] = (0, react.useState)(channel.description);
11455
- const [saving, setSaving] = (0, react.useState)(false);
11456
- const [error, setError] = (0, react.useState)();
11457
- const pendingRequest = (0, react.useRef)();
12052
+ const { saving, error, pendingRequest, save } = useEditDialogSave({
12053
+ save: updateChannel,
12054
+ onCommitted,
12055
+ onClose
12056
+ });
11458
12057
  const membership = useChannelMembership({
11459
12058
  joinChannel,
11460
12059
  removeChannelMember
@@ -11467,28 +12066,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11467
12066
  const normalizedName = name.trim();
11468
12067
  const normalizedDescription = description.trim();
11469
12068
  if (saving || !dirty || normalizedName === "") return;
11470
- const request = pendingRequest.current !== void 0 && pendingRequest.current.channelRef === channel.channelRef && pendingRequest.current.name === normalizedName && pendingRequest.current.description === normalizedDescription ? pendingRequest.current : {
12069
+ await save(pendingRequest.current !== void 0 && pendingRequest.current.channelRef === channel.channelRef && pendingRequest.current.name === normalizedName && pendingRequest.current.description === normalizedDescription ? pendingRequest.current : {
11471
12070
  requestId: mintRequestId(),
11472
12071
  workspaceId: channel.workspaceId,
11473
12072
  channelRef: channel.channelRef,
11474
12073
  name: normalizedName,
11475
12074
  description: normalizedDescription
11476
- };
11477
- pendingRequest.current = request;
11478
- setSaving(true);
11479
- setError(void 0);
11480
- try {
11481
- const result = await updateChannel(request);
11482
- if (result.ok) {
11483
- pendingRequest.current = void 0;
11484
- await onCommitted();
11485
- onClose();
11486
- } else setError(result.error.message);
11487
- } catch (cause) {
11488
- setError(cause instanceof Error ? cause.message : String(cause));
11489
- } finally {
11490
- setSaving(false);
11491
- }
12075
+ });
11492
12076
  };
11493
12077
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
11494
12078
  open: true,
@@ -11595,20 +12179,60 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11595
12179
  }
11596
12180
  //#endregion
11597
12181
  //#region src/client/TeamWorkspaceBrowser.tsx
11598
- function TeamWorkspaceBrowser({ wide, expandSidebar, navigation, selectWorkspace, selectChannel, t, useWorkspaces, loadMembers, subscribeChanges, addMember, loadChannels, createChannel, updateChannel, archiveChannel, updateMember, recoverMember, archiveMember, joinChannel, removeChannelMember, loadModels, openMemberSession }) {
12182
+ function TeamWorkspaceBrowser({ wide, expandSidebar, navigation, selectWorkspace, selectChannel, selectInbox, t, useWorkspaces, loadMembers, loadInbox, subscribeChanges, subscribeReads, addMember, loadChannels, createChannel, updateChannel, archiveChannel, updateMember, recoverMember, archiveMember, joinChannel, removeChannelMember, loadModels, openMemberSession }) {
11599
12183
  const navigationState = (0, react.useSyncExternalStore)(navigation.subscribe, navigation.getSnapshot, navigation.getSnapshot);
11600
12184
  const workspaces = useWorkspaces((state) => state.items);
11601
12185
  const selected = navigationState.workspaceId;
11602
12186
  const selectedId = selected !== void 0 && workspaces.some((workspace) => workspace.workspaceId === selected) ? selected : workspaces[0]?.workspaceId;
11603
- const overviewIsCurrent = navigationState.channelRef === void 0 && navigationState.memberSessionId === void 0;
12187
+ const overviewIsCurrent = navigationState.channelRef === void 0 && navigationState.memberSessionId === void 0 && navigationState.inbox !== true;
12188
+ const inboxIsCurrent = navigationState.inbox === true;
11604
12189
  const [creatingAgents, setCreatingAgents] = (0, react.useState)([]);
11605
12190
  const [pendingSection, setPendingSection] = (0, react.useState)();
11606
12191
  const channelsRef = (0, react.useRef)(null);
11607
12192
  const agentsRef = (0, react.useRef)(null);
11608
12193
  const workspacesOpen = useSidebarSectionOpen(void 0, "workspaces");
12194
+ const [inboxTotal, setInboxTotal] = (0, react.useState)(0);
11609
12195
  (0, react.useEffect)(() => {
12196
+ let disposed = false;
12197
+ let scheduled;
12198
+ const refresh = async () => {
12199
+ const results = await Promise.all(workspaces.map((workspace) => loadInbox({
12200
+ workspaceId: workspace.workspaceId,
12201
+ directOnly: true,
12202
+ limit: 1
12203
+ })));
12204
+ if (disposed) return;
12205
+ setInboxTotal(results.reduce((sum, result) => result.ok ? sum + result.value.totalUnreadCount : sum, 0));
12206
+ };
12207
+ const schedule = () => {
12208
+ if (scheduled !== void 0) return;
12209
+ scheduled = setTimeout(() => {
12210
+ scheduled = void 0;
12211
+ refresh();
12212
+ }, 200);
12213
+ };
12214
+ refresh();
12215
+ const unsubscribe = subscribeChanges(void 0, (update) => {
12216
+ if (update.type === "changed") schedule();
12217
+ });
12218
+ const unsubscribeReads = subscribeReads(schedule);
12219
+ return () => {
12220
+ disposed = true;
12221
+ if (scheduled !== void 0) clearTimeout(scheduled);
12222
+ unsubscribe();
12223
+ unsubscribeReads();
12224
+ };
12225
+ }, [
12226
+ loadInbox,
12227
+ subscribeChanges,
12228
+ subscribeReads,
12229
+ workspaces
12230
+ ]);
12231
+ (0, react.useEffect)(() => {
12232
+ if (navigationState.inbox === true) return;
11610
12233
  if (navigationState.mode === "team" && selectedId !== void 0 && selectedId !== selected) selectWorkspace(selectedId);
11611
12234
  }, [
12235
+ navigationState.inbox,
11612
12236
  navigationState.mode,
11613
12237
  selected,
11614
12238
  selectedId,
@@ -11625,96 +12249,140 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11625
12249
  if (!wide) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("nav", {
11626
12250
  className: sidebar_module_css_default.railWorkspace,
11627
12251
  "aria-label": t("workspaceSections"),
11628
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
11629
- label: t("channels"),
11630
- side: "right",
11631
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
11632
- type: "button",
11633
- className: sidebar_module_css_default.railButton,
11634
- "aria-label": t("channels"),
11635
- onClick: () => {
11636
- setPendingSection("channels");
11637
- expandSidebar();
11638
- },
11639
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconListPenOutline16, { size: 16 })
11640
- })
11641
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
11642
- label: t("agents"),
11643
- side: "right",
11644
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
11645
- type: "button",
11646
- className: sidebar_module_css_default.railButton,
11647
- "aria-label": t("agents"),
11648
- onClick: () => {
11649
- setPendingSection("agents");
11650
- expandSidebar();
11651
- },
11652
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconAgentPresetOutline16, { size: 16 })
12252
+ children: [
12253
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
12254
+ label: t("mentionsOfMe"),
12255
+ side: "right",
12256
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
12257
+ type: "button",
12258
+ className: sidebar_module_css_default.railButton,
12259
+ "aria-label": inboxTotal > 0 ? t("mentionsOfMeWithCount", { count: inboxTotal }) : t("mentionsOfMe"),
12260
+ "aria-current": inboxIsCurrent ? "page" : void 0,
12261
+ onClick: () => {
12262
+ selectInbox();
12263
+ expandSidebar();
12264
+ },
12265
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconQueueOutline14, { size: 16 }), inboxTotal > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
12266
+ className: sidebar_module_css_default.inboxBadge,
12267
+ "aria-hidden": "true",
12268
+ children: inboxTotal > 99 ? "99+" : inboxTotal
12269
+ })]
12270
+ })
12271
+ }),
12272
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
12273
+ label: t("channels"),
12274
+ side: "right",
12275
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
12276
+ type: "button",
12277
+ className: sidebar_module_css_default.railButton,
12278
+ "aria-label": t("channels"),
12279
+ onClick: () => {
12280
+ setPendingSection("channels");
12281
+ expandSidebar();
12282
+ },
12283
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconListPenOutline16, { size: 16 })
12284
+ })
12285
+ }),
12286
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
12287
+ label: t("agents"),
12288
+ side: "right",
12289
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
12290
+ type: "button",
12291
+ className: sidebar_module_css_default.railButton,
12292
+ "aria-label": t("agents"),
12293
+ onClick: () => {
12294
+ setPendingSection("agents");
12295
+ expandSidebar();
12296
+ },
12297
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconAgentPresetOutline16, { size: 16 })
12298
+ })
11653
12299
  })
11654
- })]
12300
+ ]
11655
12301
  });
11656
12302
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
11657
12303
  className: sidebar_module_css_default.workspaceBrowser,
11658
12304
  "aria-label": t("workspaces"),
11659
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamSidebarSection, {
11660
- title: t("workspaces"),
11661
- open: workspacesOpen,
11662
- onToggle: (open) => {
11663
- setSidebarSectionOpen(void 0, "workspaces", open);
11664
- },
11665
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11666
- className: sidebar_module_css_default.workspaceList,
11667
- children: [workspaces.map((workspace) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamWorkspaceRow, {
11668
- workspaceId: workspace.workspaceId,
11669
- title: workspace.title,
11670
- path: workspace.path,
11671
- selected: workspace.workspaceId === selectedId,
11672
- current: workspace.workspaceId === selectedId && overviewIsCurrent,
11673
- onSelect: selectWorkspace
11674
- }, workspace.workspaceId)), workspaces.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11675
- className: sidebar_module_css_default.emptyState,
11676
- children: t("empty")
12305
+ children: [
12306
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
12307
+ type: "button",
12308
+ className: sidebar_module_css_default.inboxCard,
12309
+ "aria-label": inboxTotal > 0 ? t("mentionsOfMeWithCount", { count: inboxTotal }) : t("mentionsOfMe"),
12310
+ "aria-current": inboxIsCurrent ? "page" : void 0,
12311
+ onClick: selectInbox,
12312
+ children: [
12313
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconQueueOutline14, { size: 16 }),
12314
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
12315
+ className: sidebar_module_css_default.inboxCardLabel,
12316
+ children: t("mentionsOfMe")
12317
+ }),
12318
+ inboxTotal > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
12319
+ className: sidebar_module_css_default.inboxBadge,
12320
+ "aria-hidden": "true",
12321
+ children: inboxTotal > 99 ? "99+" : inboxTotal
12322
+ })
12323
+ ]
12324
+ }),
12325
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamSidebarSection, {
12326
+ title: t("workspaces"),
12327
+ open: workspacesOpen,
12328
+ onToggle: (open) => {
12329
+ setSidebarSectionOpen(void 0, "workspaces", open);
12330
+ },
12331
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
12332
+ className: sidebar_module_css_default.workspaceList,
12333
+ children: [workspaces.map((workspace) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamWorkspaceRow, {
12334
+ workspaceId: workspace.workspaceId,
12335
+ title: workspace.title,
12336
+ path: workspace.path,
12337
+ selected: workspace.workspaceId === selectedId,
12338
+ current: workspace.workspaceId === selectedId && overviewIsCurrent,
12339
+ onSelect: selectWorkspace
12340
+ }, workspace.workspaceId)), workspaces.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
12341
+ className: sidebar_module_css_default.emptyState,
12342
+ children: t("empty")
12343
+ })]
12344
+ })
12345
+ }),
12346
+ selectedId !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
12347
+ className: sidebar_module_css_default.workspaceSection,
12348
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
12349
+ ref: channelsRef,
12350
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamChannelsPanel, {
12351
+ workspaceId: selectedId,
12352
+ loadMembers,
12353
+ loadChannels,
12354
+ subscribeChanges,
12355
+ createChannel,
12356
+ updateChannel,
12357
+ archiveChannel,
12358
+ joinChannel,
12359
+ removeChannelMember,
12360
+ creatingAgents: creatingAgents.filter((request) => request.workspaceId === selectedId),
12361
+ ...navigationState.memberSessionId !== void 0 || navigationState.channelRef === void 0 ? {} : { selectedChannelRef: navigationState.channelRef },
12362
+ selectChannel,
12363
+ t
12364
+ }, selectedId)
12365
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
12366
+ ref: agentsRef,
12367
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamAgentsPanel, {
12368
+ workspaceId: selectedId,
12369
+ loadMembers,
12370
+ subscribeChanges,
12371
+ addMember,
12372
+ updateMember,
12373
+ recoverMember,
12374
+ archiveMember,
12375
+ loadModels,
12376
+ ...navigationState.memberSessionId === void 0 ? {} : { memberSessionId: navigationState.memberSessionId },
12377
+ openMemberSession,
12378
+ onCreatingChange: (request, creating) => {
12379
+ setCreatingAgents((current) => creating ? [...current.filter((item) => item.requestId !== request.requestId), request] : current.filter((item) => item.requestId !== request.requestId));
12380
+ },
12381
+ t
12382
+ }, selectedId)
11677
12383
  })]
11678
12384
  })
11679
- }), selectedId !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11680
- className: sidebar_module_css_default.workspaceSection,
11681
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11682
- ref: channelsRef,
11683
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamChannelsPanel, {
11684
- workspaceId: selectedId,
11685
- loadMembers,
11686
- loadChannels,
11687
- subscribeChanges,
11688
- createChannel,
11689
- updateChannel,
11690
- archiveChannel,
11691
- joinChannel,
11692
- removeChannelMember,
11693
- creatingAgents: creatingAgents.filter((request) => request.workspaceId === selectedId),
11694
- ...navigationState.memberSessionId !== void 0 || navigationState.channelRef === void 0 ? {} : { selectedChannelRef: navigationState.channelRef },
11695
- selectChannel,
11696
- t
11697
- }, selectedId)
11698
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
11699
- ref: agentsRef,
11700
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamAgentsPanel, {
11701
- workspaceId: selectedId,
11702
- loadMembers,
11703
- subscribeChanges,
11704
- addMember,
11705
- updateMember,
11706
- recoverMember,
11707
- archiveMember,
11708
- loadModels,
11709
- ...navigationState.memberSessionId === void 0 ? {} : { memberSessionId: navigationState.memberSessionId },
11710
- openMemberSession,
11711
- onCreatingChange: (request, creating) => {
11712
- setCreatingAgents((current) => creating ? [...current.filter((item) => item.requestId !== request.requestId), request] : current.filter((item) => item.requestId !== request.requestId));
11713
- },
11714
- t
11715
- }, selectedId)
11716
- })]
11717
- })]
12385
+ ]
11718
12386
  });
11719
12387
  }
11720
12388
  //#endregion
@@ -11748,6 +12416,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11748
12416
  statusError: "错误",
11749
12417
  statusUnavailable: "不可用",
11750
12418
  addChannel: "新建频道",
12419
+ mentionsOfMe: "提到我",
12420
+ mentionsOfMeWithCount: "提到我,{count} 条未读提及",
12421
+ loadingInbox: "正在加载提到我…",
12422
+ inboxEmptyTitle: "还没有人提到你",
12423
+ inboxEmptyHint: "需要你知道或做决定时,成员会提到你",
12424
+ inboxTimeToday: "今天",
12425
+ inboxTimeYesterday: "昨天",
12426
+ inboxHeaderMeta: "共 {threads} 个 Thread · {mentions} 条提及,按最新提及排序",
11751
12427
  channelName: "名称",
11752
12428
  channelDescription: "说明",
11753
12429
  initialMembers: "初始成员",
@@ -11761,6 +12437,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11761
12437
  resumeAgent: "恢复",
11762
12438
  restartAgent: "重启",
11763
12439
  restartStillUnavailable: "重启已执行,成员仍不可用:{diagnostic}",
12440
+ restartRefusedNoRestart: "会话日志被确定拒绝,修复无可用项,重启无法解决:{detail}",
11764
12441
  restartFailed: "重启执行失败:{message}",
11765
12442
  archiveAgent: "归档",
11766
12443
  archiveAgentTitle: "归档 Agent:{name}",
@@ -11896,6 +12573,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11896
12573
  statusError: "Error",
11897
12574
  statusUnavailable: "Unavailable",
11898
12575
  addChannel: "New Channel",
12576
+ mentionsOfMe: "Mentions of me",
12577
+ mentionsOfMeWithCount: "Mentions of me, {count} unread mention(s)",
12578
+ loadingInbox: "Loading mentions…",
12579
+ inboxEmptyTitle: "Nobody has mentioned you yet",
12580
+ inboxEmptyHint: "Members will mention you when you must know or decide",
12581
+ inboxTimeToday: "Today",
12582
+ inboxTimeYesterday: "Yesterday",
12583
+ inboxHeaderMeta: "{threads} Thread(s) · {mentions} mention(s), newest first",
11899
12584
  channelName: "Name",
11900
12585
  channelDescription: "Description",
11901
12586
  initialMembers: "Initial members",
@@ -11909,6 +12594,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11909
12594
  resumeAgent: "Resume",
11910
12595
  restartAgent: "Restart",
11911
12596
  restartStillUnavailable: "Restart ran, but the Member is still unavailable: {diagnostic}",
12597
+ restartRefusedNoRestart: "The session log is deterministically refused with nothing repairable; restarting cannot fix it: {detail}",
11912
12598
  restartFailed: "Restart failed: {message}",
11913
12599
  archiveAgent: "Archive",
11914
12600
  archiveAgentTitle: "Archive Agent: {name}",
@@ -12028,7 +12714,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12028
12714
  "connection",
12029
12715
  "conversation"
12030
12716
  ];
12031
- function registerModeShadow(ctx, navigation, changes, drafts, name, component, extraInject, entryKey) {
12717
+ function registerModeShadow(ctx, navigation, changes, reads, drafts, name, component, extraInject, entryKey) {
12032
12718
  const openMemberSessionImpl = (sessionId) => {
12033
12719
  const sessions = ctx.sessions;
12034
12720
  const snapshot = navigation.getSnapshot();
@@ -12039,6 +12725,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12039
12725
  };
12040
12726
  const sharedRemotes = {
12041
12727
  loadChannels: (request) => ctx.remote.agentTeam.view(request),
12728
+ loadInbox: (request) => ctx.remote.agentTeam.inbox(request),
12729
+ subscribeReads: (listener) => reads.subscribe(listener),
12042
12730
  subscribeChanges: (scope, listener) => changes.subscribe(scope, listener),
12043
12731
  drafts,
12044
12732
  loadMembers: (request) => ctx.remote.agentTeam.members(request),
@@ -12069,7 +12757,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12069
12757
  ...navigation.actions(),
12070
12758
  ...sharedRemotes,
12071
12759
  ...name === "main" ? {
12072
- readThread: (request) => ctx.remote.agentTeam.readThread(request),
12760
+ readThread: async (request) => {
12761
+ const result = await ctx.remote.agentTeam.readThread(request);
12762
+ if (result.ok) reads.bump();
12763
+ return result;
12764
+ },
12073
12765
  loadThreadHistory: (request) => ctx.remote.agentTeam.threadHistory(request),
12074
12766
  threadObservations: (request) => ctx.remote.agentTeam.threadObservations(request),
12075
12767
  sendMessage: (request) => ctx.remote.agentTeam.sendMessage(request),
@@ -12135,6 +12827,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12135
12827
  };
12136
12828
  }, "agent-team: member session restore");
12137
12829
  const changes = new TeamChangeStream((request, signal) => ctx.remote.agentTeam.changes(request, signal));
12830
+ const reads = new TeamReadStream();
12138
12831
  const loadMemberGroups = async () => {
12139
12832
  const workspaces = ctx.workspaces.list.getSnapshot().items;
12140
12833
  return (await Promise.all(workspaces.map(async (workspace) => {
@@ -12163,9 +12856,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12163
12856
  loadMemberGroups
12164
12857
  })
12165
12858
  }, TeamFooterAction));
12166
- registerModeShadow(ctx, navigation, changes, drafts, "sidebar.workspaces", TeamWorkspaceBrowser);
12167
- registerModeShadow(ctx, navigation, changes, drafts, "main", TeamConversation, void 0, "conversation");
12168
- registerModeShadow(ctx, navigation, changes, drafts, "sidebar.settings", TeamSettings, () => ({ loadMemberGroups }));
12859
+ registerModeShadow(ctx, navigation, changes, reads, drafts, "sidebar.workspaces", TeamWorkspaceBrowser);
12860
+ registerModeShadow(ctx, navigation, changes, reads, drafts, "main", TeamConversation, void 0, "conversation");
12861
+ registerModeShadow(ctx, navigation, changes, reads, drafts, "sidebar.settings", TeamSettings, () => ({ loadMemberGroups }));
12169
12862
  }
12170
12863
  async function apply(ctx) {
12171
12864
  const disposeRemote = await ctx.remote.$mount(TYPERT_REMOTE);