@wowyuarm/dsh-agent-team 0.1.14-alpha.2 → 0.1.15

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 (106) hide show
  1. package/README.md +6 -4
  2. package/README.zh.md +6 -4
  3. package/cordis.patch.yml +3 -1
  4. package/package.json +51 -46
  5. package/packages/agent-team/README.md +2 -2
  6. package/packages/agent-team/README.zh.md +2 -2
  7. package/packages/agent-team/core-skills/member-memory-manager/SKILL.md +30 -0
  8. package/packages/agent-team/lib/context-continuity-host.js +90 -0
  9. package/packages/agent-team/lib/context-projection.js +266 -489
  10. package/packages/agent-team/lib/context-source.js +4 -72
  11. package/packages/agent-team/lib/human-avatar.js +61 -0
  12. package/packages/agent-team/lib/human-profile.js +157 -0
  13. package/packages/agent-team/lib/human-update-check.js +119 -0
  14. package/packages/agent-team/lib/index.js +464 -254
  15. package/packages/agent-team/lib/ledger.js +120 -15
  16. package/packages/agent-team/lib/member-context.js +6 -3
  17. package/packages/agent-team/lib/member-runtime.js +1 -1
  18. package/packages/agent-team/lib/pressure-policy.js +6 -1
  19. package/packages/agent-team/lib/typert.host.js +489 -33
  20. package/packages/agent-team/lib/typert.remote-client.d.ts +15 -3
  21. package/packages/agent-team/lib/typert.remote-client.d.ts.map +1 -1
  22. package/packages/agent-team/lib/typert.remote-client.js +250 -28
  23. package/packages/agent-team/lib/types/context-continuity-host.d.ts +84 -0
  24. package/packages/agent-team/lib/types/context-continuity-host.d.ts.map +1 -0
  25. package/packages/agent-team/lib/types/context-projection.d.ts +130 -185
  26. package/packages/agent-team/lib/types/context-projection.d.ts.map +1 -1
  27. package/packages/agent-team/lib/types/context-source.d.ts +4 -35
  28. package/packages/agent-team/lib/types/context-source.d.ts.map +1 -1
  29. package/packages/agent-team/lib/types/human-avatar.d.ts +29 -0
  30. package/packages/agent-team/lib/types/human-avatar.d.ts.map +1 -0
  31. package/packages/agent-team/lib/types/human-profile.d.ts +116 -0
  32. package/packages/agent-team/lib/types/human-profile.d.ts.map +1 -0
  33. package/packages/agent-team/lib/types/human-update-check.d.ts +73 -0
  34. package/packages/agent-team/lib/types/human-update-check.d.ts.map +1 -0
  35. package/packages/agent-team/lib/types/index.d.ts +153 -41
  36. package/packages/agent-team/lib/types/index.d.ts.map +1 -1
  37. package/packages/agent-team/lib/types/ledger.d.ts +31 -2
  38. package/packages/agent-team/lib/types/ledger.d.ts.map +1 -1
  39. package/packages/agent-team/lib/types/member-context.d.ts.map +1 -1
  40. package/packages/agent-team/lib/types/pressure-policy.d.ts +6 -0
  41. package/packages/agent-team/lib/types/pressure-policy.d.ts.map +1 -1
  42. package/packages/agent-team/lib/types/types/entities.d.ts +17 -0
  43. package/packages/agent-team/lib/types/types/entities.d.ts.map +1 -1
  44. package/packages/agent-team/lib/types/types/requests-results.d.ts +81 -0
  45. package/packages/agent-team/lib/types/types/requests-results.d.ts.map +1 -1
  46. package/packages/client-agent-team/README.md +1 -1
  47. package/packages/client-agent-team/README.zh.md +1 -1
  48. package/packages/client-agent-team/lib/client.js +1545 -303
  49. package/packages/client-agent-team/lib/client.js.map +1 -1
  50. package/packages/client-agent-team/lib/types/client/HumanSettingsSection.d.ts +15 -0
  51. package/packages/client-agent-team/lib/types/client/HumanSettingsSection.d.ts.map +1 -0
  52. package/packages/client-agent-team/lib/types/client/HumanSettingsSection.js +115 -0
  53. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts.map +1 -1
  54. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.js +6 -2
  55. package/packages/client-agent-team/lib/types/client/TeamAvatarStack.d.ts +22 -1
  56. package/packages/client-agent-team/lib/types/client/TeamAvatarStack.d.ts.map +1 -1
  57. package/packages/client-agent-team/lib/types/client/TeamAvatarStack.js +25 -2
  58. package/packages/client-agent-team/lib/types/client/TeamChannelPage.d.ts +6 -1
  59. package/packages/client-agent-team/lib/types/client/TeamChannelPage.d.ts.map +1 -1
  60. package/packages/client-agent-team/lib/types/client/TeamChannelPage.js +67 -29
  61. package/packages/client-agent-team/lib/types/client/TeamComposer.js +2 -2
  62. package/packages/client-agent-team/lib/types/client/TeamConversation.d.ts +1 -1
  63. package/packages/client-agent-team/lib/types/client/TeamConversation.d.ts.map +1 -1
  64. package/packages/client-agent-team/lib/types/client/TeamConversation.js +12 -5
  65. package/packages/client-agent-team/lib/types/client/TeamInboxPage.d.ts +4 -1
  66. package/packages/client-agent-team/lib/types/client/TeamInboxPage.d.ts.map +1 -1
  67. package/packages/client-agent-team/lib/types/client/TeamInboxPage.js +22 -7
  68. package/packages/client-agent-team/lib/types/client/TeamMemberEditor.d.ts +11 -1
  69. package/packages/client-agent-team/lib/types/client/TeamMemberEditor.d.ts.map +1 -1
  70. package/packages/client-agent-team/lib/types/client/TeamMemberEditor.js +66 -5
  71. package/packages/client-agent-team/lib/types/client/TeamMessage.d.ts +18 -3
  72. package/packages/client-agent-team/lib/types/client/TeamMessage.d.ts.map +1 -1
  73. package/packages/client-agent-team/lib/types/client/TeamMessage.js +213 -67
  74. package/packages/client-agent-team/lib/types/client/TeamThreadPage.d.ts +5 -0
  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 +52 -26
  77. package/packages/client-agent-team/lib/types/client/avatar-image.d.ts +21 -0
  78. package/packages/client-agent-team/lib/types/client/avatar-image.d.ts.map +1 -0
  79. package/packages/client-agent-team/lib/types/client/avatar-image.js +9 -0
  80. package/packages/client-agent-team/lib/types/client/human-identity.d.ts +90 -0
  81. package/packages/client-agent-team/lib/types/client/human-identity.d.ts.map +1 -0
  82. package/packages/client-agent-team/lib/types/client/human-identity.js +96 -0
  83. package/packages/client-agent-team/lib/types/client/index.d.ts.map +1 -1
  84. package/packages/client-agent-team/lib/types/client/index.js +76 -4
  85. package/packages/client-agent-team/lib/types/client/locales.d.ts +72 -2
  86. package/packages/client-agent-team/lib/types/client/locales.d.ts.map +1 -1
  87. package/packages/client-agent-team/lib/types/client/locales.js +78 -2
  88. package/packages/client-agent-team/lib/types/client/refs.d.ts +71 -0
  89. package/packages/client-agent-team/lib/types/client/refs.d.ts.map +1 -0
  90. package/packages/client-agent-team/lib/types/client/refs.js +181 -0
  91. package/packages/client-agent-team/lib/types/client/slots.d.ts +9 -3
  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-formatters.d.ts +57 -9
  94. package/packages/client-agent-team/lib/types/client/team-formatters.d.ts.map +1 -1
  95. package/packages/client-agent-team/lib/types/client/team-formatters.js +85 -17
  96. package/packages/tool-agent-team/README.md +2 -2
  97. package/packages/tool-agent-team/README.zh.md +2 -2
  98. package/packages/tool-agent-team/lib/context-tools.js +20 -6
  99. package/packages/tool-agent-team/lib/index.js +2 -2
  100. package/packages/tool-agent-team/lib/types/context-tools.d.ts.map +1 -1
  101. package/packages/agent-team/lib/context-management.js +0 -371
  102. package/packages/agent-team/lib/types/context-management.d.ts +0 -154
  103. package/packages/agent-team/lib/types/context-management.d.ts.map +0 -1
  104. package/packages/client-agent-team/lib/types/client/task-refs.d.ts +0 -31
  105. package/packages/client-agent-team/lib/types/client/task-refs.d.ts.map +0 -1
  106. package/packages/client-agent-team/lib/types/client/task-refs.js +0 -99
@@ -4,10 +4,10 @@ window.__ModuleLoader__.load({
4
4
  var module = { exports: {} };
5
5
  var exports = module.exports;
6
6
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
- let _deepseek_ai_dsh_api_gateway_client = require("@deepseek-ai/dsh-api-gateway/client");
8
7
  let react = require("react");
9
8
  let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
10
9
  let react_jsx_runtime = require("react/jsx-runtime");
10
+ let _deepseek_ai_dsh_api_gateway_client = require("@deepseek-ai/dsh-api-gateway/client");
11
11
  //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
12
12
  var _a$1;
13
13
  function $constructor(name, initializer, params) {
@@ -1008,7 +1008,7 @@ window.__ModuleLoader__.load({
1008
1008
  };
1009
1009
  //#endregion
1010
1010
  //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js
1011
- const version$1 = {
1011
+ const version = {
1012
1012
  major: 4,
1013
1013
  minor: 4,
1014
1014
  patch: 3
@@ -1020,7 +1020,7 @@ window.__ModuleLoader__.load({
1020
1020
  inst ?? (inst = {});
1021
1021
  inst._zod.def = def;
1022
1022
  inst._zod.bag = inst._zod.bag || {};
1023
- inst._zod.version = version$1;
1023
+ inst._zod.version = version;
1024
1024
  const checks = [...inst._zod.def.checks ?? []];
1025
1025
  if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst);
1026
1026
  for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
@@ -4102,6 +4102,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4102
4102
  });
4103
4103
  let _wowyuarm_dsh_agent_team_agentTeam_addMember_result$schema$value;
4104
4104
  const _wowyuarm_dsh_agent_team_agentTeam_addMember_result$schema = () => _wowyuarm_dsh_agent_team_agentTeam_addMember_result$schema$value ??= object({
4105
+ "workspaceIds": array(intersection(string(), unknown())).readonly(),
4105
4106
  "receipt": object({
4106
4107
  "operationId": intersection(string(), unknown()).readonly(),
4107
4108
  "requestId": intersection(string(), unknown()).readonly(),
@@ -4526,6 +4527,26 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4526
4527
  "byteSize": number().readonly(),
4527
4528
  "bytesBase64": string().readonly()
4528
4529
  });
4530
+ let _wowyuarm_dsh_agent_team_agentTeam_getHumanAvatar_parameter_0$schema$value;
4531
+ const _wowyuarm_dsh_agent_team_agentTeam_getHumanAvatar_parameter_0$schema = () => _wowyuarm_dsh_agent_team_agentTeam_getHumanAvatar_parameter_0$schema$value ??= object({ "avatarRef": string().readonly() });
4532
+ let _wowyuarm_dsh_agent_team_agentTeam_getHumanAvatar_result$schema$value;
4533
+ const _wowyuarm_dsh_agent_team_agentTeam_getHumanAvatar_result$schema = () => _wowyuarm_dsh_agent_team_agentTeam_getHumanAvatar_result$schema$value ??= object({
4534
+ "name": string().readonly(),
4535
+ "mediaType": string().readonly(),
4536
+ "byteSize": number().readonly(),
4537
+ "bytesBase64": string().readonly()
4538
+ });
4539
+ let _wowyuarm_dsh_agent_team_agentTeam_humanProfile_parameter_0$schema$value;
4540
+ const _wowyuarm_dsh_agent_team_agentTeam_humanProfile_parameter_0$schema = () => _wowyuarm_dsh_agent_team_agentTeam_humanProfile_parameter_0$schema$value ??= object({});
4541
+ let _wowyuarm_dsh_agent_team_agentTeam_humanProfile_result$schema$value;
4542
+ const _wowyuarm_dsh_agent_team_agentTeam_humanProfile_result$schema = () => _wowyuarm_dsh_agent_team_agentTeam_humanProfile_result$schema$value ??= object({
4543
+ "name": string().readonly(),
4544
+ "avatarRef": union([_undefined(), string()]).readonly().optional(),
4545
+ "version": string().readonly(),
4546
+ "repoUrl": string().readonly(),
4547
+ "updateAvailable": boolean().readonly(),
4548
+ "latestVersion": union([_undefined(), string()]).readonly().optional()
4549
+ });
4529
4550
  let _wowyuarm_dsh_agent_team_agentTeam_inbox_parameter_0$schema$value;
4530
4551
  const _wowyuarm_dsh_agent_team_agentTeam_inbox_parameter_0$schema = () => _wowyuarm_dsh_agent_team_agentTeam_inbox_parameter_0$schema$value ??= object({
4531
4552
  "workspaceId": intersection(string(), unknown()).readonly(),
@@ -4533,6 +4554,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4533
4554
  });
4534
4555
  let _wowyuarm_dsh_agent_team_agentTeam_inbox_result$schema$value;
4535
4556
  const _wowyuarm_dsh_agent_team_agentTeam_inbox_result$schema = () => _wowyuarm_dsh_agent_team_agentTeam_inbox_result$schema$value ??= object({
4557
+ "humanMemberId": intersection(string(), unknown()).readonly(),
4536
4558
  "items": array(object({
4537
4559
  "workspaceId": intersection(string(), unknown()).readonly(),
4538
4560
  "channelRef": intersection(string(), unknown()).readonly(),
@@ -4850,6 +4872,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4850
4872
  "byteSize": number().readonly(),
4851
4873
  "mediaType": string().readonly()
4852
4874
  });
4875
+ let _wowyuarm_dsh_agent_team_agentTeam_putHumanAvatar_parameter_0$schema$value;
4876
+ const _wowyuarm_dsh_agent_team_agentTeam_putHumanAvatar_parameter_0$schema = () => _wowyuarm_dsh_agent_team_agentTeam_putHumanAvatar_parameter_0$schema$value ??= object({
4877
+ "name": string().readonly(),
4878
+ "mediaType": union([_undefined(), string()]).readonly().optional(),
4879
+ "bytesBase64": string().readonly()
4880
+ });
4881
+ let _wowyuarm_dsh_agent_team_agentTeam_putHumanAvatar_result$schema$value;
4882
+ const _wowyuarm_dsh_agent_team_agentTeam_putHumanAvatar_result$schema = () => _wowyuarm_dsh_agent_team_agentTeam_putHumanAvatar_result$schema$value ??= object({
4883
+ "avatarRef": string().readonly(),
4884
+ "path": string().readonly(),
4885
+ "name": string().readonly(),
4886
+ "byteSize": number().readonly(),
4887
+ "mediaType": string().readonly()
4888
+ });
4853
4889
  let _wowyuarm_dsh_agent_team_agentTeam_readThread_parameter_0$schema$value;
4854
4890
  const _wowyuarm_dsh_agent_team_agentTeam_readThread_parameter_0$schema = () => _wowyuarm_dsh_agent_team_agentTeam_readThread_parameter_0$schema$value ??= object({
4855
4891
  "requestId": intersection(string(), unknown()).readonly(),
@@ -5120,6 +5156,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5120
5156
  "threadRef": intersection(string(), unknown()).readonly()
5121
5157
  })).readonly()
5122
5158
  });
5159
+ let _wowyuarm_dsh_agent_team_agentTeam_removeHumanAvatar_parameter_0$schema$value;
5160
+ const _wowyuarm_dsh_agent_team_agentTeam_removeHumanAvatar_parameter_0$schema = () => _wowyuarm_dsh_agent_team_agentTeam_removeHumanAvatar_parameter_0$schema$value ??= object({ "avatarRef": string().readonly() });
5161
+ let _wowyuarm_dsh_agent_team_agentTeam_removeHumanAvatar_result$schema$value;
5162
+ const _wowyuarm_dsh_agent_team_agentTeam_removeHumanAvatar_result$schema = () => _wowyuarm_dsh_agent_team_agentTeam_removeHumanAvatar_result$schema$value ??= object({ "removed": boolean().readonly() });
5123
5163
  let _wowyuarm_dsh_agent_team_agentTeam_reply_parameter_0$schema$value;
5124
5164
  const _wowyuarm_dsh_agent_team_agentTeam_reply_parameter_0$schema = () => _wowyuarm_dsh_agent_team_agentTeam_reply_parameter_0$schema$value ??= object({
5125
5165
  "requestId": intersection(string(), unknown()).readonly(),
@@ -5243,6 +5283,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5243
5283
  "threadRef": intersection(string(), unknown()).readonly(),
5244
5284
  "taskNumber": number().readonly()
5245
5285
  })).readonly() });
5286
+ let _wowyuarm_dsh_agent_team_agentTeam_resolveThreadRefs_parameter_0$schema$value;
5287
+ const _wowyuarm_dsh_agent_team_agentTeam_resolveThreadRefs_parameter_0$schema = () => _wowyuarm_dsh_agent_team_agentTeam_resolveThreadRefs_parameter_0$schema$value ??= object({
5288
+ "workspaceId": intersection(string(), unknown()).readonly(),
5289
+ "threadRefs": array(intersection(string(), unknown())).readonly()
5290
+ });
5291
+ let _wowyuarm_dsh_agent_team_agentTeam_resolveThreadRefs_result$schema$value;
5292
+ const _wowyuarm_dsh_agent_team_agentTeam_resolveThreadRefs_result$schema = () => _wowyuarm_dsh_agent_team_agentTeam_resolveThreadRefs_result$schema$value ??= object({ "resolved": array(object({
5293
+ "threadRef": intersection(string(), unknown()).readonly(),
5294
+ "channelRef": intersection(string(), unknown()).readonly(),
5295
+ "taskRef": intersection(string(), unknown()).readonly().optional(),
5296
+ "taskNumber": number().readonly().optional(),
5297
+ "title": string().readonly()
5298
+ })).readonly() });
5246
5299
  let _wowyuarm_dsh_agent_team_agentTeam_sendMessage_parameter_0$schema$value;
5247
5300
  const _wowyuarm_dsh_agent_team_agentTeam_sendMessage_parameter_0$schema = () => _wowyuarm_dsh_agent_team_agentTeam_sendMessage_parameter_0$schema$value ??= object({
5248
5301
  "requestId": intersection(string(), unknown()).readonly(),
@@ -5337,6 +5390,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5337
5390
  "revision": number().readonly().optional()
5338
5391
  })
5339
5392
  ]);
5393
+ let _wowyuarm_dsh_agent_team_agentTeam_setHumanProfile_parameter_0$schema$value;
5394
+ const _wowyuarm_dsh_agent_team_agentTeam_setHumanProfile_parameter_0$schema = () => _wowyuarm_dsh_agent_team_agentTeam_setHumanProfile_parameter_0$schema$value ??= object({
5395
+ "name": union([_undefined(), string()]).readonly().optional(),
5396
+ "avatarRef": union([
5397
+ _undefined(),
5398
+ literal(null),
5399
+ string()
5400
+ ]).readonly().optional()
5401
+ });
5402
+ let _wowyuarm_dsh_agent_team_agentTeam_setHumanProfile_result$schema$value;
5403
+ const _wowyuarm_dsh_agent_team_agentTeam_setHumanProfile_result$schema = () => _wowyuarm_dsh_agent_team_agentTeam_setHumanProfile_result$schema$value ??= object({
5404
+ "name": string().readonly(),
5405
+ "avatarRef": union([_undefined(), string()]).readonly().optional()
5406
+ });
5340
5407
  let _wowyuarm_dsh_agent_team_agentTeam_threadHistory_parameter_0$schema$value;
5341
5408
  const _wowyuarm_dsh_agent_team_agentTeam_threadHistory_parameter_0$schema = () => _wowyuarm_dsh_agent_team_agentTeam_threadHistory_parameter_0$schema$value ??= object({
5342
5409
  "workspaceId": intersection(string(), unknown()).readonly(),
@@ -5781,12 +5848,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5781
5848
  }],
5782
5849
  result: {
5783
5850
  mode: "strict",
5784
- typeSymbol: "@wowyuarm/dsh-agent-team/types#AgentTeamMemberResult",
5851
+ typeSymbol: "@wowyuarm/dsh-agent-team/types#AgentTeamAddMemberResult",
5785
5852
  create: _wowyuarm_dsh_agent_team_agentTeam_addMember_result$schema
5786
5853
  },
5787
5854
  sourceLocation: {
5788
5855
  "file": "packages/agent-team/src/index.ts",
5789
- "line": 708,
5856
+ "line": 891,
5790
5857
  "column": 9
5791
5858
  }
5792
5859
  },
@@ -5813,7 +5880,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5813
5880
  },
5814
5881
  sourceLocation: {
5815
5882
  "file": "packages/agent-team/src/index.ts",
5816
- "line": 698,
5883
+ "line": 881,
5817
5884
  "column": 9
5818
5885
  }
5819
5886
  },
@@ -5840,7 +5907,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5840
5907
  },
5841
5908
  sourceLocation: {
5842
5909
  "file": "packages/agent-team/src/index.ts",
5843
- "line": 1077,
5910
+ "line": 1271,
5844
5911
  "column": 9
5845
5912
  }
5846
5913
  },
@@ -5867,7 +5934,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5867
5934
  },
5868
5935
  sourceLocation: {
5869
5936
  "file": "packages/agent-team/src/index.ts",
5870
- "line": 1217,
5937
+ "line": 1500,
5871
5938
  "column": 9
5872
5939
  }
5873
5940
  },
@@ -5896,7 +5963,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5896
5963
  },
5897
5964
  sourceLocation: {
5898
5965
  "file": "packages/agent-team/src/index.ts",
5899
- "line": 631,
5966
+ "line": 814,
5900
5967
  "column": 11
5901
5968
  }
5902
5969
  },
@@ -5923,7 +5990,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5923
5990
  },
5924
5991
  sourceLocation: {
5925
5992
  "file": "packages/agent-team/src/index.ts",
5926
- "line": 1089,
5993
+ "line": 1283,
5927
5994
  "column": 9
5928
5995
  }
5929
5996
  },
@@ -5950,7 +6017,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5950
6017
  },
5951
6018
  sourceLocation: {
5952
6019
  "file": "packages/agent-team/src/index.ts",
5953
- "line": 811,
6020
+ "line": 997,
5954
6021
  "column": 9
5955
6022
  }
5956
6023
  },
@@ -5977,7 +6044,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5977
6044
  },
5978
6045
  sourceLocation: {
5979
6046
  "file": "packages/agent-team/src/index.ts",
5980
- "line": 671,
6047
+ "line": 854,
5981
6048
  "column": 9
5982
6049
  }
5983
6050
  },
@@ -6004,10 +6071,65 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6004
6071
  },
6005
6072
  sourceLocation: {
6006
6073
  "file": "packages/agent-team/src/index.ts",
6007
- "line": 1203,
6074
+ "line": 1397,
6075
+ "column": 9
6076
+ }
6077
+ },
6078
+ {
6079
+ id: "@wowyuarm/dsh-agent-team#agentTeam/getHumanAvatar",
6080
+ service: "agentTeam",
6081
+ namespace: "agentTeam",
6082
+ method: "getHumanAvatar",
6083
+ invocation: { kind: "direct" },
6084
+ parameters: [{
6085
+ name: "request",
6086
+ wire: "request",
6087
+ source: "json",
6088
+ codec: {
6089
+ mode: "strict",
6090
+ typeSymbol: "@wowyuarm/dsh-agent-team/types#AgentTeamGetHumanAvatarRequest",
6091
+ create: _wowyuarm_dsh_agent_team_agentTeam_getHumanAvatar_parameter_0$schema
6092
+ }
6093
+ }],
6094
+ result: {
6095
+ mode: "strict",
6096
+ typeSymbol: "@wowyuarm/dsh-agent-team/types#AgentTeamGetHumanAvatarResult",
6097
+ create: _wowyuarm_dsh_agent_team_agentTeam_getHumanAvatar_result$schema
6098
+ },
6099
+ sourceLocation: {
6100
+ "file": "packages/agent-team/src/index.ts",
6101
+ "line": 1440,
6008
6102
  "column": 9
6009
6103
  }
6010
6104
  },
6105
+ {
6106
+ id: "@wowyuarm/dsh-agent-team#agentTeam/humanProfile",
6107
+ service: "agentTeam",
6108
+ namespace: "agentTeam",
6109
+ method: "humanProfile",
6110
+ implementation: "humanProfileForClient",
6111
+ invocation: { kind: "direct" },
6112
+ parameters: [{
6113
+ name: "_request",
6114
+ wire: "_request",
6115
+ source: "json",
6116
+ codec: {
6117
+ mode: "strict",
6118
+ typeSymbol: "@wowyuarm/dsh-agent-team/types#AgentTeamHumanProfileRequest",
6119
+ create: _wowyuarm_dsh_agent_team_agentTeam_humanProfile_parameter_0$schema
6120
+ }
6121
+ }],
6122
+ result: {
6123
+ mode: "strict",
6124
+ typeSymbol: "@wowyuarm/dsh-agent-team/types#AgentTeamHumanProfileResult",
6125
+ create: _wowyuarm_dsh_agent_team_agentTeam_humanProfile_result$schema
6126
+ },
6127
+ sourceLocation: {
6128
+ "file": "packages/agent-team/src/index.ts",
6129
+ "line": 1412,
6130
+ "column": 3
6131
+ }
6132
+ },
6011
6133
  {
6012
6134
  id: "@wowyuarm/dsh-agent-team#agentTeam/inbox",
6013
6135
  service: "agentTeam",
@@ -6031,7 +6153,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6031
6153
  },
6032
6154
  sourceLocation: {
6033
6155
  "file": "packages/agent-team/src/index.ts",
6034
- "line": 1226,
6156
+ "line": 1509,
6035
6157
  "column": 3
6036
6158
  }
6037
6159
  },
@@ -6058,7 +6180,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6058
6180
  },
6059
6181
  sourceLocation: {
6060
6182
  "file": "packages/agent-team/src/index.ts",
6061
- "line": 1109,
6183
+ "line": 1303,
6062
6184
  "column": 9
6063
6185
  }
6064
6186
  },
@@ -6085,7 +6207,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6085
6207
  },
6086
6208
  sourceLocation: {
6087
6209
  "file": "packages/agent-team/src/index.ts",
6088
- "line": 1129,
6210
+ "line": 1323,
6089
6211
  "column": 9
6090
6212
  }
6091
6213
  },
@@ -6112,7 +6234,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6112
6234
  },
6113
6235
  sourceLocation: {
6114
6236
  "file": "packages/agent-team/src/index.ts",
6115
- "line": 1138,
6237
+ "line": 1332,
6116
6238
  "column": 9
6117
6239
  }
6118
6240
  },
@@ -6140,7 +6262,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6140
6262
  },
6141
6263
  sourceLocation: {
6142
6264
  "file": "packages/agent-team/src/index.ts",
6143
- "line": 621,
6265
+ "line": 804,
6144
6266
  "column": 3
6145
6267
  }
6146
6268
  },
@@ -6167,7 +6289,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6167
6289
  },
6168
6290
  sourceLocation: {
6169
6291
  "file": "packages/agent-team/src/index.ts",
6170
- "line": 1099,
6292
+ "line": 1293,
6171
6293
  "column": 9
6172
6294
  }
6173
6295
  },
@@ -6194,7 +6316,34 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6194
6316
  },
6195
6317
  sourceLocation: {
6196
6318
  "file": "packages/agent-team/src/index.ts",
6197
- "line": 1190,
6319
+ "line": 1384,
6320
+ "column": 9
6321
+ }
6322
+ },
6323
+ {
6324
+ id: "@wowyuarm/dsh-agent-team#agentTeam/putHumanAvatar",
6325
+ service: "agentTeam",
6326
+ namespace: "agentTeam",
6327
+ method: "putHumanAvatar",
6328
+ invocation: { kind: "direct" },
6329
+ parameters: [{
6330
+ name: "request",
6331
+ wire: "request",
6332
+ source: "json",
6333
+ codec: {
6334
+ mode: "strict",
6335
+ typeSymbol: "@wowyuarm/dsh-agent-team/types#AgentTeamPutHumanAvatarRequest",
6336
+ create: _wowyuarm_dsh_agent_team_agentTeam_putHumanAvatar_parameter_0$schema
6337
+ }
6338
+ }],
6339
+ result: {
6340
+ mode: "strict",
6341
+ typeSymbol: "@wowyuarm/dsh-agent-team/types#AgentTeamPutHumanAvatarResult",
6342
+ create: _wowyuarm_dsh_agent_team_agentTeam_putHumanAvatar_result$schema
6343
+ },
6344
+ sourceLocation: {
6345
+ "file": "packages/agent-team/src/index.ts",
6346
+ "line": 1432,
6198
6347
  "column": 9
6199
6348
  }
6200
6349
  },
@@ -6221,7 +6370,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6221
6370
  },
6222
6371
  sourceLocation: {
6223
6372
  "file": "packages/agent-team/src/index.ts",
6224
- "line": 1233,
6373
+ "line": 1516,
6225
6374
  "column": 9
6226
6375
  }
6227
6376
  },
@@ -6248,7 +6397,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6248
6397
  },
6249
6398
  sourceLocation: {
6250
6399
  "file": "packages/agent-team/src/index.ts",
6251
- "line": 768,
6400
+ "line": 954,
6252
6401
  "column": 9
6253
6402
  }
6254
6403
  },
@@ -6275,7 +6424,34 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6275
6424
  },
6276
6425
  sourceLocation: {
6277
6426
  "file": "packages/agent-team/src/index.ts",
6278
- "line": 1120,
6427
+ "line": 1314,
6428
+ "column": 9
6429
+ }
6430
+ },
6431
+ {
6432
+ id: "@wowyuarm/dsh-agent-team#agentTeam/removeHumanAvatar",
6433
+ service: "agentTeam",
6434
+ namespace: "agentTeam",
6435
+ method: "removeHumanAvatar",
6436
+ invocation: { kind: "direct" },
6437
+ parameters: [{
6438
+ name: "request",
6439
+ wire: "request",
6440
+ source: "json",
6441
+ codec: {
6442
+ mode: "strict",
6443
+ typeSymbol: "@wowyuarm/dsh-agent-team/types#AgentTeamRemoveHumanAvatarRequest",
6444
+ create: _wowyuarm_dsh_agent_team_agentTeam_removeHumanAvatar_parameter_0$schema
6445
+ }
6446
+ }],
6447
+ result: {
6448
+ mode: "strict",
6449
+ typeSymbol: "@wowyuarm/dsh-agent-team/types#AgentTeamRemoveHumanAvatarResult",
6450
+ create: _wowyuarm_dsh_agent_team_agentTeam_removeHumanAvatar_result$schema
6451
+ },
6452
+ sourceLocation: {
6453
+ "file": "packages/agent-team/src/index.ts",
6454
+ "line": 1448,
6279
6455
  "column": 9
6280
6456
  }
6281
6457
  },
@@ -6302,7 +6478,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6302
6478
  },
6303
6479
  sourceLocation: {
6304
6480
  "file": "packages/agent-team/src/index.ts",
6305
- "line": 1211,
6481
+ "line": 1494,
6306
6482
  "column": 9
6307
6483
  }
6308
6484
  },
@@ -6329,7 +6505,34 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6329
6505
  },
6330
6506
  sourceLocation: {
6331
6507
  "file": "packages/agent-team/src/index.ts",
6332
- "line": 608,
6508
+ "line": 778,
6509
+ "column": 3
6510
+ }
6511
+ },
6512
+ {
6513
+ id: "@wowyuarm/dsh-agent-team#agentTeam/resolveThreadRefs",
6514
+ service: "agentTeam",
6515
+ namespace: "agentTeam",
6516
+ method: "resolveThreadRefs",
6517
+ invocation: { kind: "direct" },
6518
+ parameters: [{
6519
+ name: "request",
6520
+ wire: "request",
6521
+ source: "json",
6522
+ codec: {
6523
+ mode: "strict",
6524
+ typeSymbol: "@wowyuarm/dsh-agent-team/types#AgentTeamResolveThreadRefsRequest",
6525
+ create: _wowyuarm_dsh_agent_team_agentTeam_resolveThreadRefs_parameter_0$schema
6526
+ }
6527
+ }],
6528
+ result: {
6529
+ mode: "strict",
6530
+ typeSymbol: "@wowyuarm/dsh-agent-team/types#AgentTeamResolveThreadRefsResult",
6531
+ create: _wowyuarm_dsh_agent_team_agentTeam_resolveThreadRefs_result$schema
6532
+ },
6533
+ sourceLocation: {
6534
+ "file": "packages/agent-team/src/index.ts",
6535
+ "line": 791,
6333
6536
  "column": 3
6334
6537
  }
6335
6538
  },
@@ -6356,7 +6559,34 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6356
6559
  },
6357
6560
  sourceLocation: {
6358
6561
  "file": "packages/agent-team/src/index.ts",
6359
- "line": 1147,
6562
+ "line": 1341,
6563
+ "column": 9
6564
+ }
6565
+ },
6566
+ {
6567
+ id: "@wowyuarm/dsh-agent-team#agentTeam/setHumanProfile",
6568
+ service: "agentTeam",
6569
+ namespace: "agentTeam",
6570
+ method: "setHumanProfile",
6571
+ invocation: { kind: "direct" },
6572
+ parameters: [{
6573
+ name: "request",
6574
+ wire: "request",
6575
+ source: "json",
6576
+ codec: {
6577
+ mode: "strict",
6578
+ typeSymbol: "@wowyuarm/dsh-agent-team/types#AgentTeamSetHumanProfileRequest",
6579
+ create: _wowyuarm_dsh_agent_team_agentTeam_setHumanProfile_parameter_0$schema
6580
+ }
6581
+ }],
6582
+ result: {
6583
+ mode: "strict",
6584
+ typeSymbol: "@wowyuarm/dsh-agent-team/types#AgentTeamSetHumanProfileResult",
6585
+ create: _wowyuarm_dsh_agent_team_agentTeam_setHumanProfile_result$schema
6586
+ },
6587
+ sourceLocation: {
6588
+ "file": "packages/agent-team/src/index.ts",
6589
+ "line": 1470,
6360
6590
  "column": 9
6361
6591
  }
6362
6592
  },
@@ -6383,7 +6613,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6383
6613
  },
6384
6614
  sourceLocation: {
6385
6615
  "file": "packages/agent-team/src/index.ts",
6386
- "line": 1251,
6616
+ "line": 1534,
6387
6617
  "column": 3
6388
6618
  }
6389
6619
  },
@@ -6410,7 +6640,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6410
6640
  },
6411
6641
  sourceLocation: {
6412
6642
  "file": "packages/agent-team/src/index.ts",
6413
- "line": 1244,
6643
+ "line": 1527,
6414
6644
  "column": 3
6415
6645
  }
6416
6646
  },
@@ -6437,7 +6667,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6437
6667
  },
6438
6668
  sourceLocation: {
6439
6669
  "file": "packages/agent-team/src/index.ts",
6440
- "line": 683,
6670
+ "line": 866,
6441
6671
  "column": 9
6442
6672
  }
6443
6673
  },
@@ -6464,7 +6694,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6464
6694
  },
6465
6695
  sourceLocation: {
6466
6696
  "file": "packages/agent-team/src/index.ts",
6467
- "line": 1017,
6697
+ "line": 1211,
6468
6698
  "column": 9
6469
6699
  }
6470
6700
  },
@@ -6491,13 +6721,427 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6491
6721
  },
6492
6722
  sourceLocation: {
6493
6723
  "file": "packages/agent-team/src/index.ts",
6494
- "line": 1258,
6724
+ "line": 1541,
6495
6725
  "column": 3
6496
6726
  }
6497
6727
  }
6498
6728
  ]
6499
6729
  };
6500
6730
  //#endregion
6731
+ //#region src/client/human-identity.ts
6732
+ const INITIAL = {
6733
+ status: "loading",
6734
+ updateAvailable: false
6735
+ };
6736
+ var TeamHumanIdentity = class {
6737
+ snapshot = INITIAL;
6738
+ listeners = /* @__PURE__ */ new Set();
6739
+ reading;
6740
+ loader;
6741
+ constructor(loader) {
6742
+ this.loader = loader;
6743
+ }
6744
+ getSnapshot = () => this.snapshot;
6745
+ /**
6746
+ * Observe the identity, starting the first read when nobody has read yet.
6747
+ * @param listener - invoked after every snapshot replacement.
6748
+ * @returns the disposer removing this listener.
6749
+ */
6750
+ subscribe = (listener) => {
6751
+ this.listeners.add(listener);
6752
+ if (this.snapshot.status === "loading" && this.reading === void 0) this.refresh();
6753
+ return () => {
6754
+ this.listeners.delete(listener);
6755
+ };
6756
+ };
6757
+ /**
6758
+ * Re-read the Host projection. Concurrent callers share one round trip, and a
6759
+ * failed refresh keeps the last accepted value beside the reported error —
6760
+ * the seats never blank out because a background read failed.
6761
+ * @returns settlement of this read (or of the read already in flight).
6762
+ */
6763
+ refresh() {
6764
+ if (this.reading !== void 0) return this.reading;
6765
+ const reading = this.read().finally(() => {
6766
+ if (this.reading === reading) this.reading = void 0;
6767
+ });
6768
+ this.reading = reading;
6769
+ return reading;
6770
+ }
6771
+ dispose() {
6772
+ this.listeners.clear();
6773
+ }
6774
+ async read() {
6775
+ let profile;
6776
+ try {
6777
+ const result = await this.loader.loadProfile();
6778
+ if (!result.ok) {
6779
+ this.fail(result.error.message);
6780
+ return;
6781
+ }
6782
+ profile = result.value;
6783
+ } catch (error) {
6784
+ this.fail(error instanceof Error ? error.message : String(error));
6785
+ return;
6786
+ }
6787
+ const avatarUrl = profile.avatarRef === void 0 ? void 0 : profile.avatarRef === this.snapshot.avatarRef && this.snapshot.avatarUrl !== void 0 ? this.snapshot.avatarUrl : await this.loader.loadAvatarUrl(profile.avatarRef) ?? void 0;
6788
+ this.commit({
6789
+ status: "ready",
6790
+ name: profile.name,
6791
+ ...profile.avatarRef === void 0 ? {} : { avatarRef: profile.avatarRef },
6792
+ ...avatarUrl === void 0 ? {} : { avatarUrl },
6793
+ version: profile.version,
6794
+ repoUrl: profile.repoUrl,
6795
+ updateAvailable: profile.updateAvailable,
6796
+ ...profile.latestVersion === void 0 ? {} : { latestVersion: profile.latestVersion }
6797
+ });
6798
+ }
6799
+ /**
6800
+ * Record one read failure. A value that was already accepted stays on screen
6801
+ * (the seats never blank out over a background read), and only an identity
6802
+ * that never loaded becomes `unavailable` — the state that offers a retry.
6803
+ */
6804
+ fail(message) {
6805
+ const held = this.snapshot;
6806
+ this.commit(held.name === void 0 ? {
6807
+ ...held,
6808
+ status: "unavailable",
6809
+ error: message
6810
+ } : {
6811
+ ...held,
6812
+ status: "ready",
6813
+ error: message
6814
+ });
6815
+ }
6816
+ commit(snapshot) {
6817
+ this.snapshot = snapshot;
6818
+ for (const listener of this.listeners) listener();
6819
+ }
6820
+ };
6821
+ /** Subscribe one rendered seat to the identity. */
6822
+ function useHumanIdentity(identity) {
6823
+ return (0, react.useSyncExternalStore)(identity.subscribe, identity.getSnapshot, identity.getSnapshot);
6824
+ }
6825
+ //#endregion
6826
+ //#region src/client/avatar-image.ts
6827
+ function useAvatarImage(url) {
6828
+ const [broken, setBroken] = (0, react.useState)(void 0);
6829
+ return {
6830
+ src: url === void 0 || url === broken ? void 0 : url,
6831
+ failed: () => {
6832
+ if (url !== void 0) setBroken(url);
6833
+ }
6834
+ };
6835
+ }
6836
+ //#endregion
6837
+ //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/human-settings.module.css.mjs
6838
+ const css$14 = ".HwTxra_section{max-width:760px;color:var(--dsw-alias-label-primary);flex-direction:column;gap:12px;display:flex;container-type:inline-size}.HwTxra_heading{margin:0;font-size:18px;font-weight:600}.HwTxra_intro{color:var(--dsw-alias-label-tertiary);margin:0;font-size:13px;line-height:20px}.HwTxra_rows{flex-direction:column;display:flex}.HwTxra_row{border-bottom:1px solid var(--dsw-alias-border-l2);align-items:center;gap:12px;padding:16px 0;display:flex}.HwTxra_row:last-child{border-bottom:none}.HwTxra_rowText{flex-direction:column;flex:1;gap:4px;min-width:0;padding-right:48px;display:flex}.HwTxra_title{font-size:14px;line-height:22px}.HwTxra_desc{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}.HwTxra_controls{flex:none;align-items:center;gap:12px;display:inline-flex}.HwTxra_nameInput{width:200px;height:36px}.HwTxra_identity{corner-shape:round;border-radius:50%;flex:none;width:40px;height:40px}.HwTxra_identityImage{object-fit:cover;display:block}.HwTxra_identityFallback{background:var(--dsw-alias-state-business-primary);color:var(--dsw-static-neutral-bluish-00);justify-content:center;align-items:center;font-size:16px;font-weight:600;line-height:40px;display:inline-flex}.HwTxra_footnote{color:var(--dsw-alias-label-tertiary);flex-wrap:wrap;align-items:center;gap:8px;font-size:12px;line-height:18px;display:flex}.HwTxra_link{color:var(--dsw-alias-brand-primary);cursor:pointer;text-decoration:none}.HwTxra_link:hover{text-decoration:underline}.HwTxra_link:focus-visible{outline:2px solid var(--dsw-alias-label-primary);outline-offset:2px}.HwTxra_notice{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px;line-height:18px}.HwTxra_state{color:var(--dsw-alias-label-tertiary);margin:0;font-size:13px;line-height:20px}.HwTxra_stateAction{align-items:center;gap:12px;display:flex}@container (width<=420px){.HwTxra_row{flex-direction:column;align-items:stretch;gap:12px}.HwTxra_rowText{padding-right:0}.HwTxra_nameInput{width:100%}.HwTxra_controls{flex-wrap:wrap}}";
6839
+ const tagId$14 = "@wowyuarm/dsh-agent-team/human-settings.module.css";
6840
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$14) + "]") === null) {
6841
+ const tag = document.createElement("style");
6842
+ tag.dataset.plugin = "@wowyuarm/dsh-agent-team";
6843
+ tag.dataset.pluginCss = tagId$14;
6844
+ tag.textContent = css$14;
6845
+ document.head.appendChild(tag);
6846
+ }
6847
+ var human_settings_module_css_default = {
6848
+ "controls": "HwTxra_controls",
6849
+ "desc": "HwTxra_desc",
6850
+ "footnote": "HwTxra_footnote",
6851
+ "heading": "HwTxra_heading",
6852
+ "identity": "HwTxra_identity",
6853
+ "identityFallback": "HwTxra_identityFallback",
6854
+ "identityImage": "HwTxra_identityImage",
6855
+ "intro": "HwTxra_intro",
6856
+ "link": "HwTxra_link",
6857
+ "nameInput": "HwTxra_nameInput",
6858
+ "notice": "HwTxra_notice",
6859
+ "row": "HwTxra_row",
6860
+ "rowText": "HwTxra_rowText",
6861
+ "rows": "HwTxra_rows",
6862
+ "section": "HwTxra_section",
6863
+ "state": "HwTxra_state",
6864
+ "stateAction": "HwTxra_stateAction",
6865
+ "title": "HwTxra_title"
6866
+ };
6867
+ //#endregion
6868
+ //#region src/client/HumanSettingsSection.tsx
6869
+ /**
6870
+ * The Human's own settings page: display name, avatar, and the version
6871
+ * footnote.
6872
+ *
6873
+ * The page owns no durable fact and no copy of one. Name, avatar, and version
6874
+ * all arrive from the shared identity projection, so a save here moves the
6875
+ * message rows and member refs at the same moment; a failed write keeps the
6876
+ * typed name in the field and reports the Host's own reason.
6877
+ */
6878
+ /** Host-side avatar ceiling (`ATTACHMENT_MAX_BYTES`): the settings page refuses larger files before the round trip. */
6879
+ const AVATAR_MAX_BYTES = 10 * 1024 * 1024;
6880
+ /**
6881
+ * Run one durable write and reduce every failure to the message the page
6882
+ * reports. A rejected Remote call (a dropped carrier, a refused write) is a
6883
+ * failure like any other: without this the field would sit on "saving" forever
6884
+ * and report nothing.
6885
+ */
6886
+ async function failureOf(action) {
6887
+ try {
6888
+ return await action();
6889
+ } catch (error) {
6890
+ return error instanceof Error ? error.message : String(error);
6891
+ }
6892
+ }
6893
+ /** First visible character of a display name, or the neutral `H` before one is known. */
6894
+ function avatarInitial(name) {
6895
+ const trimmed = (name ?? "").replace(/^@/, "").trim();
6896
+ return trimmed === "" ? "H" : trimmed.slice(0, 1).toUpperCase();
6897
+ }
6898
+ function HumanSettingsSection(props) {
6899
+ const { t, identity } = props;
6900
+ const profile = useHumanIdentity(identity);
6901
+ const [draft, setDraft] = (0, react.useState)(void 0);
6902
+ const [saving, setSaving] = (0, react.useState)(false);
6903
+ const [uploading, setUploading] = (0, react.useState)(false);
6904
+ const [notice, setNotice] = (0, react.useState)(null);
6905
+ const filePicker = (0, react.useRef)(null);
6906
+ const name = draft ?? profile.name ?? "";
6907
+ const dirty = draft !== void 0 && draft.trim() !== (profile.name ?? "");
6908
+ const emptyName = draft !== void 0 && draft.trim() === "";
6909
+ const hasAvatar = profile.avatarRef !== void 0;
6910
+ const avatar = useAvatarImage(profile.avatarUrl);
6911
+ const submitName = async () => {
6912
+ if (!dirty || emptyName || saving) return;
6913
+ setSaving(true);
6914
+ setNotice(null);
6915
+ const failure = await failureOf(() => props.saveName(name.trim()));
6916
+ setSaving(false);
6917
+ if (failure !== void 0) {
6918
+ setNotice(t("humanSettingsNameFailed", { message: failure }));
6919
+ return;
6920
+ }
6921
+ setDraft(void 0);
6922
+ };
6923
+ const pickAvatar = async (file) => {
6924
+ if (file === void 0) return;
6925
+ setNotice(null);
6926
+ if (!file.type.startsWith("image/")) {
6927
+ setNotice(t("humanSettingsAvatarNotImage"));
6928
+ return;
6929
+ }
6930
+ if (file.size > AVATAR_MAX_BYTES) {
6931
+ setNotice(t("humanSettingsAvatarTooLarge"));
6932
+ return;
6933
+ }
6934
+ setUploading(true);
6935
+ const failure = await failureOf(() => props.uploadAvatar(file));
6936
+ setUploading(false);
6937
+ if (failure !== void 0) setNotice(t("humanSettingsAvatarFailed", { message: failure }));
6938
+ };
6939
+ const removeAvatar = async () => {
6940
+ setNotice(null);
6941
+ const failure = await failureOf(() => props.removeAvatar());
6942
+ if (failure !== void 0) setNotice(t("humanSettingsAvatarFailed", { message: failure }));
6943
+ };
6944
+ const pageHeader = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
6945
+ className: human_settings_module_css_default.heading,
6946
+ children: t("humanSettingsTitle")
6947
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
6948
+ className: human_settings_module_css_default.intro,
6949
+ children: t("humanSettingsIntro")
6950
+ })] });
6951
+ if (profile.status === "loading" && profile.name === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6952
+ className: human_settings_module_css_default.section,
6953
+ children: [pageHeader, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
6954
+ className: human_settings_module_css_default.state,
6955
+ role: "status",
6956
+ children: t("humanSettingsLoading")
6957
+ })]
6958
+ });
6959
+ if (profile.name === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6960
+ className: human_settings_module_css_default.section,
6961
+ children: [
6962
+ pageHeader,
6963
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
6964
+ className: human_settings_module_css_default.state,
6965
+ role: "alert",
6966
+ children: t("humanSettingsUnavailable", { message: profile.error ?? "" })
6967
+ }),
6968
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6969
+ className: human_settings_module_css_default.stateAction,
6970
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
6971
+ variant: "outline",
6972
+ onClick: () => {
6973
+ identity.refresh();
6974
+ },
6975
+ children: t("retry")
6976
+ })
6977
+ })
6978
+ ]
6979
+ });
6980
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6981
+ className: human_settings_module_css_default.section,
6982
+ children: [
6983
+ pageHeader,
6984
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6985
+ className: human_settings_module_css_default.rows,
6986
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6987
+ className: human_settings_module_css_default.row,
6988
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
6989
+ className: human_settings_module_css_default.rowText,
6990
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6991
+ className: human_settings_module_css_default.title,
6992
+ children: t("humanSettingsName")
6993
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6994
+ className: human_settings_module_css_default.desc,
6995
+ children: t("humanSettingsNameHint")
6996
+ })]
6997
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
6998
+ className: human_settings_module_css_default.controls,
6999
+ onSubmit: (event) => {
7000
+ event.preventDefault();
7001
+ submitName();
7002
+ },
7003
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
7004
+ className: human_settings_module_css_default.nameInput,
7005
+ "aria-label": t("humanSettingsName"),
7006
+ "aria-invalid": emptyName || void 0,
7007
+ value: name,
7008
+ disabled: saving,
7009
+ onChange: (event) => {
7010
+ setDraft(event.target.value);
7011
+ }
7012
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
7013
+ type: "submit",
7014
+ variant: "primary",
7015
+ disabled: saving || !dirty || emptyName,
7016
+ children: saving ? t("humanSettingsSaving") : t("humanSettingsSave")
7017
+ })]
7018
+ })]
7019
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
7020
+ className: human_settings_module_css_default.row,
7021
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
7022
+ className: human_settings_module_css_default.rowText,
7023
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
7024
+ className: human_settings_module_css_default.title,
7025
+ children: t("humanSettingsAvatar")
7026
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
7027
+ className: human_settings_module_css_default.desc,
7028
+ children: t("humanSettingsAvatarHint")
7029
+ })]
7030
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
7031
+ className: human_settings_module_css_default.controls,
7032
+ children: [
7033
+ avatar.src === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
7034
+ className: `${human_settings_module_css_default.identity} ${human_settings_module_css_default.identityFallback}`,
7035
+ "data-avatar": "initial",
7036
+ "aria-hidden": "true",
7037
+ children: avatarInitial(profile.name)
7038
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
7039
+ className: `${human_settings_module_css_default.identity} ${human_settings_module_css_default.identityImage}`,
7040
+ "data-avatar": "image",
7041
+ src: avatar.src,
7042
+ alt: "",
7043
+ onError: avatar.failed
7044
+ }),
7045
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
7046
+ ref: filePicker,
7047
+ type: "file",
7048
+ accept: "image/*",
7049
+ tabIndex: -1,
7050
+ "aria-hidden": "true",
7051
+ hidden: true,
7052
+ onChange: (event) => {
7053
+ pickAvatar(event.target.files?.[0]);
7054
+ event.target.value = "";
7055
+ }
7056
+ }),
7057
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
7058
+ variant: "outline",
7059
+ disabled: uploading,
7060
+ onClick: () => {
7061
+ filePicker.current?.click();
7062
+ },
7063
+ children: uploading ? t("humanSettingsUploading") : hasAvatar ? t("humanSettingsReplace") : t("humanSettingsUpload")
7064
+ }),
7065
+ hasAvatar && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
7066
+ disabled: uploading,
7067
+ onClick: () => {
7068
+ removeAvatar();
7069
+ },
7070
+ children: t("humanSettingsRemoveAvatar")
7071
+ })
7072
+ ]
7073
+ })]
7074
+ })]
7075
+ }),
7076
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
7077
+ className: human_settings_module_css_default.footnote,
7078
+ children: [
7079
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("humanSettingsVersion", { version: profile.version ?? "" }) }),
7080
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
7081
+ "aria-hidden": "true",
7082
+ children: "·"
7083
+ }),
7084
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
7085
+ className: human_settings_module_css_default.link,
7086
+ href: profile.repoUrl ?? "",
7087
+ target: "_blank",
7088
+ rel: "noreferrer",
7089
+ children: "GitHub"
7090
+ }),
7091
+ profile.updateAvailable && profile.latestVersion !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
7092
+ className: human_settings_module_css_default.link,
7093
+ href: `${profile.repoUrl ?? ""}/releases`,
7094
+ target: "_blank",
7095
+ rel: "noreferrer",
7096
+ children: t("humanSettingsUpdateAvailable", { version: profile.latestVersion })
7097
+ }) : null
7098
+ ]
7099
+ }),
7100
+ emptyName && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
7101
+ className: human_settings_module_css_default.notice,
7102
+ children: t("humanSettingsNameEmpty")
7103
+ }),
7104
+ notice === null ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
7105
+ className: human_settings_module_css_default.notice,
7106
+ role: "alert",
7107
+ children: notice
7108
+ })
7109
+ ]
7110
+ });
7111
+ }
7112
+ //#endregion
7113
+ //#region src/client/attachment-preview.ts
7114
+ /** Base64 one file payload in chunks so large uploads stay off the call-stack limit. */
7115
+ function bytesToBase64(bytes) {
7116
+ let binary = "";
7117
+ const chunk = 32768;
7118
+ for (let start = 0; start < bytes.length; start += chunk) binary += String.fromCharCode(...bytes.subarray(start, start + chunk));
7119
+ return btoa(binary);
7120
+ }
7121
+ /**
7122
+ * Thumbnail data URLs live in one session-wide cache: message lists re-render
7123
+ * often, and each miss costs a Host round-trip plus a base64 decode. Failed
7124
+ * loads (bytes already GC'd) are cached as `null` so the chip fallback is stable.
7125
+ */
7126
+ const dataUrlCache = /* @__PURE__ */ new Map();
7127
+ function cachedAttachmentDataUrl(attachmentId) {
7128
+ return dataUrlCache.get(attachmentId);
7129
+ }
7130
+ async function loadAttachmentDataUrl(getAttachment, attachment) {
7131
+ const cached = dataUrlCache.get(attachment.attachmentId);
7132
+ if (cached !== void 0) return cached;
7133
+ const result = await getAttachment({ attachmentId: attachment.attachmentId });
7134
+ const url = result.ok && attachment.mediaType.startsWith("image/") ? `data:${attachment.mediaType};base64,${result.value.bytesBase64}` : null;
7135
+ dataUrlCache.set(attachment.attachmentId, url);
7136
+ return url;
7137
+ }
7138
+ /** Human-readable byte size for attachment chips. */
7139
+ function formatByteSize(byteSize) {
7140
+ if (byteSize < 1024) return `${byteSize} B`;
7141
+ if (byteSize < 1024 * 1024) return `${(byteSize / 1024).toFixed(0)} KB`;
7142
+ return `${(byteSize / (1024 * 1024)).toFixed(1)} MB`;
7143
+ }
7144
+ //#endregion
6501
7145
  //#region src/client/navigation.ts
6502
7146
  const STORAGE_KEY$3 = "dsh.agent-team.navigation";
6503
7147
  function readSnapshot() {
@@ -6917,7 +7561,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6917
7561
  };
6918
7562
  //#endregion
6919
7563
  //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/team.module.css.mjs
6920
- const css$13 = ".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}";
7564
+ const css$13 = ".YvAbSa_footerStack{flex:none;align-self:flex-end;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}";
6921
7565
  const tagId$13 = "@wowyuarm/dsh-agent-team/team.module.css";
6922
7566
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$13) + "]") === null) {
6923
7567
  const tag = document.createElement("style");
@@ -7069,6 +7713,40 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7069
7713
  released: "claimStateReleased"
7070
7714
  }[state]);
7071
7715
  }
7716
+ const RISK_CLASS_KEYS = {
7717
+ "session-refused": ["riskClassSessionRefused", "riskSessionRefused"],
7718
+ "session-unreadable": ["riskClassSessionUnreadable", "riskSessionUnreadable"],
7719
+ "preset-composition": ["riskClassPresetComposition", "riskPresetComposition"],
7720
+ "rollover": ["riskClassRollover", "riskRollover"],
7721
+ "runtime": ["riskClassRuntime", "riskRuntime"],
7722
+ "activation": ["riskClassActivation", "riskActivation"]
7723
+ };
7724
+ /**
7725
+ * The two localized halves of one runtime-risk statement: the class label names
7726
+ * what kind of problem this is, and the sentence key states it of the Member
7727
+ * (it keeps its `{member}` placeholder so the caller supplies the handle). The
7728
+ * Host's own diagnostic stays English and belongs in the row's title, so the
7729
+ * visible line reads in the interface language.
7730
+ */
7731
+ function formatRiskClass(status, t) {
7732
+ const [labelKey, sentenceKey] = RISK_CLASS_KEYS[status.diagnostic?.class ?? "runtime"];
7733
+ return {
7734
+ label: t(labelKey),
7735
+ sentenceKey
7736
+ };
7737
+ }
7738
+ /**
7739
+ * The first sentence of a Host diagnostic: risk rows read one line, and the
7740
+ * Host writes the reason as its first sentence with recovery context after it.
7741
+ * A terminator the Host used mid-sentence becomes a full stop so the clamped
7742
+ * line reads as a sentence; the untouched text stays in the row's title.
7743
+ */
7744
+ function firstSentence(detail) {
7745
+ const trimmed = detail.trim();
7746
+ const end = trimmed.search(/[.。;;]/);
7747
+ if (end === -1) return trimmed;
7748
+ return trimmed[end] === "." || trimmed[end] === "。" ? trimmed.slice(0, end + 1) : `${trimmed.slice(0, end)}.`;
7749
+ }
7072
7750
  /**
7073
7751
  * Status indicator for a Task status, the dot every Task surface renders.
7074
7752
  * Active states map to StateDot variants; every status renders a dot so they
@@ -7095,7 +7773,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7095
7773
  for (let index = 0; index < memberId.length; index += 1) hash = (hash * 31 + memberId.charCodeAt(index)) % 360;
7096
7774
  return hash;
7097
7775
  }
7098
- const BRANDED_REF_PATTERN = /\b(task|channel|thread):{1,2}[0-9a-f]{6,}(?:-[0-9a-f]{1,})*\b/gi;
7776
+ const BRANDED_REF_PATTERN = /\b(task|channel|thread|member):{1,2}[0-9a-f]{6,}(?:-[0-9a-f]{1,})*\b/gi;
7099
7777
  /**
7100
7778
  * Canonical form of one matched ref: models occasionally double the colon or
7101
7779
  * uppercase the UUID when citing a ref in prose, while Host lookups and
@@ -7138,36 +7816,59 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7138
7816
  const matches = [...trimmed.matchAll(BRANDED_REF_PATTERN)];
7139
7817
  return matches.length === 1 && matches[0][0] === trimmed;
7140
7818
  }
7819
+ /** The Human's handle before they could rename themselves; the Host keeps it as an alias. */
7820
+ const HUMAN_HISTORIC_HANDLE = "human";
7821
+ /** Normalize one mention entry into its printed name and every handle that matches it. */
7822
+ function mentionHandlesOf(mention) {
7823
+ return typeof mention === "string" ? {
7824
+ name: mention,
7825
+ handles: [mention]
7826
+ } : {
7827
+ name: mention.name,
7828
+ handles: [mention.name, ...mention.also]
7829
+ };
7830
+ }
7831
+ /** The printed name of one mention entry; its aliases follow that name, never the body. */
7832
+ function mentionNameOf(mention) {
7833
+ return typeof mention === "string" ? mention : mention.name;
7834
+ }
7141
7835
  /**
7142
7836
  * Locate one Message's delivered mention names inside its literal body. Matching
7143
7837
  * is the shared Host delivery scan — an authored `@`, case-insensitive on Unicode
7144
7838
  * word boundaries, longest handle first, code quoted rather than called — so a chip
7145
- * never lands where delivery would not reach. Mention segments render the canonical
7146
- * `@Handle`; names absent from the body come back unmatched so the consumer can
7147
- * append them as a fallback chip row.
7839
+ * never lands where delivery would not reach. A chip names the person by their
7840
+ * current name, the way member refs do: a body that wrote an older handle of a
7841
+ * renamed Human chips as the name they answer to today. A person whose entry
7842
+ * matched through any of their handles counts as matched, so the fallback row
7843
+ * never repeats someone already chipped inline; names absent from the body come
7844
+ * back unmatched so the consumer can append them as a fallback chip row.
7148
7845
  */
7149
- function splitMentionNames(text, names) {
7150
- if (names.length === 0) return {
7846
+ function splitMentionNames(text, mentions) {
7847
+ if (mentions.length === 0) return {
7151
7848
  segments: [{
7152
7849
  text,
7153
7850
  mention: false
7154
7851
  }],
7155
7852
  unmatched: []
7156
7853
  };
7854
+ const entries = mentions.map(mentionHandlesOf);
7157
7855
  const segments = [];
7158
7856
  const matched = /* @__PURE__ */ new Set();
7159
7857
  let cursor = 0;
7160
- for (const match of scanBodyHandles(text, names)) {
7858
+ for (const match of scanBodyHandles(text, entries.flatMap((entry) => entry.handles))) {
7161
7859
  if (match.start > cursor) segments.push({
7162
7860
  text: text.slice(cursor, match.start),
7163
7861
  mention: false
7164
7862
  });
7863
+ const handle = match.handle.toLowerCase();
7864
+ const owner = entries.find((entry) => entry.handles.some((candidate) => candidate.toLowerCase() === handle));
7865
+ const printed = owner === void 0 || owner.name.toLowerCase() === handle ? match.handle : owner.name;
7165
7866
  segments.push({
7166
- text: `@${match.handle}`,
7867
+ text: `@${printed}`,
7167
7868
  mention: true,
7168
- name: match.handle
7869
+ name: printed
7169
7870
  });
7170
- matched.add(match.handle.toLowerCase());
7871
+ if (owner !== void 0) matched.add(owner.name.toLowerCase());
7171
7872
  cursor = match.end;
7172
7873
  }
7173
7874
  if (cursor < text.length) segments.push({
@@ -7176,7 +7877,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7176
7877
  });
7177
7878
  return {
7178
7879
  segments,
7179
- unmatched: names.filter((name) => !matched.has(name.toLowerCase()))
7880
+ unmatched: entries.map((entry) => entry.name).filter((name) => !matched.has(name.toLowerCase()))
7180
7881
  };
7181
7882
  }
7182
7883
  /**
@@ -7218,9 +7919,22 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7218
7919
  handle: status.member.handle
7219
7920
  })), "member:human").memberIds;
7220
7921
  }
7221
- /** Canonical chip handles for one Message's structured mention refs. */
7222
- function mentionNamesOf(mentions, handles) {
7223
- return mentions.map((memberId) => memberId === "member:human" ? "human" : handles.get(memberId)).filter((name) => name !== void 0);
7922
+ /**
7923
+ * Canonical chip handles for one Message's structured mention refs. The Human
7924
+ * is Team authority, not an Agent projection, so `members()` does not include
7925
+ * it: the caller hands over the profile name every seat names them by, so a
7926
+ * rename reaches old mention chips the same way it reaches the roster.
7927
+ *
7928
+ * A renamed Human also keeps the historic `human` handle, because the Host
7929
+ * accepts it as an alias and Message bodies written before the rename say
7930
+ * exactly that: without the alias those mentions would stop chipping inline and
7931
+ * reappear as a trailing chip under a name the body never used.
7932
+ */
7933
+ function mentionNamesOf(mentions, handles, humanName) {
7934
+ return mentions.map((memberId) => memberId === "member:human" ? humanName.toLowerCase() === "human" ? humanName : {
7935
+ name: humanName,
7936
+ also: [HUMAN_HISTORIC_HANDLE]
7937
+ } : handles.get(memberId)).filter((name) => name !== void 0);
7224
7938
  }
7225
7939
  /** Accessible label for one "who is on this work" stack: its owners' handles, comma-separated. */
7226
7940
  function claimersLabel(owners, t) {
@@ -7330,7 +8044,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7330
8044
  const displayBody = stripped === "" ? body : stripped;
7331
8045
  const richAgentBody = !options.human && !isPlainTextBody(displayBody);
7332
8046
  const inline = (options.human || isPlainTextBody(displayBody)) && options.mentionNames !== void 0 && options.mentionNames.length > 0 ? splitMentionNames(displayBody, options.mentionNames) : void 0;
7333
- const fallbackNames = inline !== void 0 ? inline.unmatched : richAgentBody && options.canOpenRefs && options.mentionNames !== void 0 ? splitMentionNames(displayBody, options.mentionNames).unmatched : options.mentionNames ?? [];
8047
+ const fallbackNames = inline !== void 0 ? inline.unmatched : richAgentBody && options.canOpenRefs && options.mentionNames !== void 0 ? splitMentionNames(displayBody, options.mentionNames).unmatched : (options.mentionNames ?? []).map(mentionNameOf);
7334
8048
  const refs = splitBrandedRefs(displayBody).flatMap((segment) => segment.ref === void 0 ? [] : [segment.ref]);
7335
8049
  return {
7336
8050
  displayBody,
@@ -7339,7 +8053,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7339
8053
  ...inline === void 0 ? {} : { inline },
7340
8054
  fallbackNames,
7341
8055
  fallbackRefs: richAgentBody && !options.canOpenRefs ? refs : [],
7342
- taskRefs: options.canOpenRefs && !richAgentBody ? refs.filter((ref) => ref.startsWith("task:")).map((ref) => ref) : []
8056
+ taskRefs: options.canOpenRefs && !richAgentBody ? refs.filter((ref) => ref.startsWith("task:")).map((ref) => ref) : [],
8057
+ threadRefs: options.canOpenRefs && !richAgentBody ? refs.filter((ref) => ref.startsWith("thread:")).map((ref) => ref) : []
7343
8058
  };
7344
8059
  }
7345
8060
  //#endregion
@@ -7431,7 +8146,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7431
8146
  }
7432
8147
  //#endregion
7433
8148
  //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/sidebar.module.css.mjs
7434
- const css$10 = "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{--team-mark-ring:var(--dsw-alias-interactive-bg-hover);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_workspaceTrigger{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;align-items:center;gap:6px;width:100%;min-height:34px;margin:0 0 2px;padding:4px 8px;font-size:14px;line-height:22px;display:flex}.d0xfxa_workspaceTrigger:hover,.d0xfxa_workspaceTrigger[aria-current=page]{background:var(--dsw-alias-interactive-bg-hover)}.d0xfxa_workspaceTrigger:focus-visible{border-color:var(--dsw-alias-brand-primary);outline:2px solid var(--dsw-alias-label-primary);outline-offset:-2px}.d0xfxa_workspaceIcon{color:var(--dsw-alias-state-business-primary);flex:0 0 16px;justify-content:center;align-items:center;height:20px;display:inline-flex}.d0xfxa_workspaceValue{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.d0xfxa_workspaceChevron{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .12s;display:inline-flex}.d0xfxa_workspaceChevronOpen{transform:rotate(180deg)}@media (prefers-reduced-motion:reduce){.d0xfxa_workspaceChevron{transition:none}}.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]{--team-mark-ring:var(--dsw-alias-interactive-bg-hover);background:var(--dsw-alias-interactive-bg-hover)}.d0xfxa_inboxCard:focus-visible{outline:2px solid var(--dsw-alias-label-primary);outline-offset:-2px}.d0xfxa_inboxCard .d0xfxa_inboxMark{color:var(--dsw-alias-label-tertiary)}.d0xfxa_inboxCardLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:14px;line-height:20px;overflow:hidden}.d0xfxa_inboxMark{flex:0 0 16px;display:inline-flex;position:relative}.d0xfxa_inboxDot{background:var(--dsw-alias-state-business-primary);box-shadow:0 0 0 2px var(--team-mark-ring,var(--dsw-alias-bg-base));corner-shape:round;border-radius:50%;width:8px;height:8px;position:absolute;top:-2px;left:-2px}.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[aria-current=page]{--team-mark-ring:var(--dsw-alias-interactive-bg-hover);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;justify-content:flex-start;min-width:0;display:flex}.d0xfxa_agentCopy strong{text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:500;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 12px;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_error{color:var(--dsw-alias-state-error-primary);overflow-wrap:anywhere;margin:0;padding:4px 12px 6px;font-size:11px;line-height:16px}.d0xfxa_editDescription{color:var(--dsw-alias-label-secondary);margin:0 0 10px;font-size:12px;line-height:18px}.d0xfxa_editMemberList{gap:2px;display:grid}.d0xfxa_editChannelName{text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:400;line-height:18px;overflow:hidden}.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}";
8149
+ const css$10 = "html[data-agent-team-mode=team] button[class*=newSession]{display:none}html[data-agent-team-mode=team] nav[class*=panelList]{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{--team-mark-ring:var(--dsw-alias-interactive-bg-hover);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_workspaceTrigger{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:12px;align-items:center;gap:6px;width:100%;min-height:34px;margin:0 0 2px;padding:4px 8px;font-size:14px;line-height:22px;display:flex}.d0xfxa_workspaceTrigger:hover,.d0xfxa_workspaceTrigger[aria-current=page]{background:var(--dsw-alias-interactive-bg-hover)}.d0xfxa_workspaceTrigger:focus-visible{border-color:var(--dsw-alias-brand-primary);outline:2px solid var(--dsw-alias-label-primary);outline-offset:-2px}.d0xfxa_workspaceIcon{color:var(--dsw-alias-state-business-primary);flex:0 0 16px;justify-content:center;align-items:center;height:20px;display:inline-flex}.d0xfxa_workspaceValue{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.d0xfxa_workspaceChevron{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .12s;display:inline-flex}.d0xfxa_workspaceChevronOpen{transform:rotate(180deg)}@media (prefers-reduced-motion:reduce){.d0xfxa_workspaceChevron{transition:none}}.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:12px;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]{--team-mark-ring:var(--dsw-alias-interactive-bg-hover);background:var(--dsw-alias-interactive-bg-hover)}.d0xfxa_inboxCard:focus-visible{outline:2px solid var(--dsw-alias-label-primary);outline-offset:-2px}.d0xfxa_inboxCard .d0xfxa_inboxMark{color:var(--dsw-alias-label-tertiary)}.d0xfxa_inboxCardLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:14px;line-height:20px;overflow:hidden}.d0xfxa_inboxMark{flex:0 0 16px;display:inline-flex;position:relative}.d0xfxa_inboxDot{background:var(--dsw-alias-state-business-primary);box-shadow:0 0 0 2px var(--team-mark-ring,var(--dsw-specific-sidebar-fill)), 0 0 0 2px var(--dsw-specific-sidebar-fill);corner-shape:round;border-radius:50%;width:8px;height:8px;position:absolute;top:-2px;left:-2px}.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[aria-current=page]{--team-mark-ring:var(--dsw-alias-interactive-bg-hover);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:12px;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:12px;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:12px;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:12px;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:12px}.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;justify-content:flex-start;min-width:0;display:flex}.d0xfxa_agentCopy strong{text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:500;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 12px;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_error{color:var(--dsw-alias-state-error-primary);overflow-wrap:anywhere;margin:0;padding:4px 12px 6px;font-size:11px;line-height:16px}.d0xfxa_editDescription{color:var(--dsw-alias-label-secondary);margin:0 0 10px;font-size:12px;line-height:18px}.d0xfxa_editMemberList{gap:2px;display:grid}.d0xfxa_editChannelName{text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:400;line-height:18px;overflow:hidden}.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}";
7435
8150
  const tagId$10 = "@wowyuarm/dsh-agent-team/sidebar.module.css";
7436
8151
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$10) + "]") === null) {
7437
8152
  const tag = document.createElement("style");
@@ -7518,7 +8233,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7518
8233
  }
7519
8234
  //#endregion
7520
8235
  //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/member-row.module.css.mjs
7521
- const css$9 = ".xnbzeW_row{border-radius:8px;grid-template-columns:24px minmax(0,1fr);align-items:center;gap:0 10px;min-height:40px;padding:8px 10px;display:grid}.xnbzeW_row:has(button){grid-template-columns:24px minmax(0,1fr) auto}.xnbzeW_row:hover{background:var(--dsw-alias-interactive-bg-hover)}.xnbzeW_copy{min-width:0;display:grid}.xnbzeW_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}.xnbzeW_copy small{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:16px;overflow:hidden}.xnbzeW_action{justify-self:end;min-width:64px}.xnbzeW_error{color:var(--dsw-alias-state-error-primary);grid-column:2/-1;margin:2px 0 0;font-size:11px;line-height:16px}@media (width<=600px){.xnbzeW_row,.xnbzeW_row:has(button){grid-template-columns:24px minmax(0,1fr);align-items:start}.xnbzeW_action{grid-column:2;justify-self:start;margin-top:6px}}";
8236
+ const css$9 = ".xnbzeW_row{border-radius:12px;grid-template-columns:24px minmax(0,1fr);align-items:center;gap:0 10px;min-height:40px;padding:8px 10px;display:grid}.xnbzeW_row:has(button){grid-template-columns:24px minmax(0,1fr) auto}.xnbzeW_row:hover{background:var(--dsw-alias-interactive-bg-hover)}.xnbzeW_copy{min-width:0;display:grid}.xnbzeW_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}.xnbzeW_copy small{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:16px;overflow:hidden}.xnbzeW_action{justify-self:end;min-width:64px}.xnbzeW_error{color:var(--dsw-alias-state-error-primary);grid-column:2/-1;margin:2px 0 0;font-size:11px;line-height:16px}@media (width<=600px){.xnbzeW_row,.xnbzeW_row:has(button){grid-template-columns:24px minmax(0,1fr);align-items:start}.xnbzeW_action{grid-column:2;justify-self:start;margin-top:6px}}";
7522
8237
  const tagId$9 = "@wowyuarm/dsh-agent-team/member-row.module.css";
7523
8238
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$9) + "]") === null) {
7524
8239
  const tag = document.createElement("style");
@@ -7691,38 +8406,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7691
8406
  })] });
7692
8407
  }
7693
8408
  //#endregion
7694
- //#region src/client/attachment-preview.ts
7695
- /** Base64 one file payload in chunks so large uploads stay off the call-stack limit. */
7696
- function bytesToBase64(bytes) {
7697
- let binary = "";
7698
- const chunk = 32768;
7699
- for (let start = 0; start < bytes.length; start += chunk) binary += String.fromCharCode(...bytes.subarray(start, start + chunk));
7700
- return btoa(binary);
7701
- }
7702
- /**
7703
- * Thumbnail data URLs live in one session-wide cache: message lists re-render
7704
- * often, and each miss costs a Host round-trip plus a base64 decode. Failed
7705
- * loads (bytes already GC'd) are cached as `null` so the chip fallback is stable.
7706
- */
7707
- const dataUrlCache = /* @__PURE__ */ new Map();
7708
- function cachedAttachmentDataUrl(attachmentId) {
7709
- return dataUrlCache.get(attachmentId);
7710
- }
7711
- async function loadAttachmentDataUrl(getAttachment, attachment) {
7712
- const cached = dataUrlCache.get(attachment.attachmentId);
7713
- if (cached !== void 0) return cached;
7714
- const result = await getAttachment({ attachmentId: attachment.attachmentId });
7715
- const url = result.ok && attachment.mediaType.startsWith("image/") ? `data:${attachment.mediaType};base64,${result.value.bytesBase64}` : null;
7716
- dataUrlCache.set(attachment.attachmentId, url);
7717
- return url;
7718
- }
7719
- /** Human-readable byte size for attachment chips. */
7720
- function formatByteSize(byteSize) {
7721
- if (byteSize < 1024) return `${byteSize} B`;
7722
- if (byteSize < 1024 * 1024) return `${(byteSize / 1024).toFixed(0)} KB`;
7723
- return `${(byteSize / (1024 * 1024)).toFixed(1)} MB`;
7724
- }
7725
- //#endregion
7726
8409
  //#region src/client/requests.ts
7727
8410
  /** Fresh idempotency identity for one Client-initiated durable request. */
7728
8411
  const mintRequestId = () => crypto.randomUUID();
@@ -7753,7 +8436,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7753
8436
  };
7754
8437
  //#endregion
7755
8438
  //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/composer.module.css.mjs
7756
- const css$7 = ".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}}";
8439
+ const css$7 = ".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);--dsw-elevation-stroke-color:var(--dsw-alias-border-l2);background:var(--dsw-specific-input-major,var(--dsw-alias-bg-layer-1));box-shadow:var(--dsw-elevation-soft);border:0;border-radius:22px;flex-direction:column;gap:6px;padding:10px 0 0;display:flex;position:relative;container-type:inline-size}.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;background:var(--dsw-specific-menu);max-height:min(320px,40vh);backdrop-filter:var(--dsw-menu-backdrop-filter);--dsw-elevation-stroke-color:var(--dsw-alias-border-l1);box-shadow:var(--dsw-elevation-prominent);border:0;border-radius:16px;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:8px;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}.x9jGQq_asTaskPill{color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:8px;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<=560px){.x9jGQq_toolbar{gap:8px}}.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}}";
7757
8440
  const tagId$7 = "@wowyuarm/dsh-agent-team/composer.module.css";
7758
8441
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$7) + "]") === null) {
7759
8442
  const tag = document.createElement("style");
@@ -8157,7 +8840,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8157
8840
  onClick: () => {
8158
8841
  fileInputRef.current?.click();
8159
8842
  },
8160
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPaperclipOutlineRegular, { size: 14 })
8843
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPaperclipOutlineMedium, { size: 14 })
8161
8844
  })
8162
8845
  })] }),
8163
8846
  onAsTaskChange !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
@@ -8170,7 +8853,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8170
8853
  onClick: () => {
8171
8854
  onAsTaskChange(asTask !== true);
8172
8855
  },
8173
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChecklistOutlineRegular, { size: 14 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8856
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChecklistOutlineMedium, { size: 14 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8174
8857
  className: composer_module_css_default.asTaskLabel,
8175
8858
  children: t("asTask")
8176
8859
  })]
@@ -8197,65 +8880,145 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8197
8880
  });
8198
8881
  }
8199
8882
  //#endregion
8200
- //#region src/client/task-refs.ts
8201
- const resolved = /* @__PURE__ */ new Map();
8202
- const pending = /* @__PURE__ */ new Set();
8203
- /** Refs the Host did not recognize; never re-queried (no retry loops). */
8204
- const unresolvable = /* @__PURE__ */ new Set();
8205
- const listeners$2 = /* @__PURE__ */ new Set();
8206
- let version = 0;
8207
- const emit = () => {
8208
- version += 1;
8209
- for (const listener of listeners$2) listener();
8210
- };
8211
- const subscribe = (listener) => {
8212
- listeners$2.add(listener);
8213
- return () => {
8214
- listeners$2.delete(listener);
8215
- };
8216
- };
8217
- /** Stable snapshot token; the map is read directly after this changes. */
8218
- const getSnapshot = () => version;
8219
- /** React binding: re-renders the caller when any ref resolution lands. */
8220
- const useResolvedTaskRefVersion = () => (0, react.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
8221
- const cachedResolvedTaskRef = (taskRef) => resolved.get(taskRef);
8222
- /** Store one resolution (click path) and wake every rendered link. */
8223
- const rememberResolvedTaskRef = (entry) => {
8224
- resolved.set(entry.taskRef, entry);
8225
- pending.delete(entry.taskRef);
8226
- emit();
8227
- };
8883
+ //#region src/client/refs.ts
8228
8884
  /** Compare refs by branded prefix plus hyphen-stripped UUID, so abbreviated spellings line up with their full form. */
8229
8885
  function refKeyOf(ref) {
8230
8886
  return ref.toLowerCase().replaceAll("-", "");
8231
8887
  }
8232
8888
  /**
8233
- * Click-path Host lookup: remember every resolved entry and hand them back
8234
- * for immediate navigation. The Host keeps `resolved` in the same order as
8235
- * the input `taskRefs` (one entry per resolvable input, unknowns omitted);
8236
- * the pairing walk below relies on that contract, so it must be preserved
8237
- * together with this implementation.
8889
+ * One versioned resolution cache per Host-resolved ref kind. Concurrent
8890
+ * callers deduplicate through the pending set; refs the Host does not know
8891
+ * are parked for the session so renders never retry-loop; a landing
8892
+ * resolution wakes every rendered link through the version token.
8238
8893
  */
8239
- const hostTaskRefLookup = (resolveTaskRefs, workspaceId) => async (taskRefs) => {
8240
- const result = await resolveTaskRefs({
8241
- workspaceId,
8242
- taskRefs
8243
- });
8894
+ function createRefStore(refOf) {
8895
+ const resolved = /* @__PURE__ */ new Map();
8896
+ const pending = /* @__PURE__ */ new Set();
8897
+ /** Refs the Host did not recognize; never re-queried (no retry loops). */
8898
+ const unresolvable = /* @__PURE__ */ new Set();
8899
+ const listeners = /* @__PURE__ */ new Set();
8900
+ let version = 0;
8901
+ const emit = () => {
8902
+ version += 1;
8903
+ for (const listener of listeners) listener();
8904
+ };
8905
+ const subscribe = (listener) => {
8906
+ listeners.add(listener);
8907
+ return () => {
8908
+ listeners.delete(listener);
8909
+ };
8910
+ };
8911
+ /** Stable snapshot token; the map is read directly after this changes. */
8912
+ const getSnapshot = () => version;
8913
+ /** React binding: re-renders the caller when any ref resolution lands. */
8914
+ const useVersion = () => (0, react.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
8915
+ const cached = (ref) => resolved.get(ref);
8916
+ /** Store one resolution (click path) and wake every rendered link. */
8917
+ const remember = (entry) => {
8918
+ resolved.set(refOf(entry), entry);
8919
+ pending.delete(refOf(entry));
8920
+ emit();
8921
+ };
8922
+ /**
8923
+ * Batch-resolve unknown refs through the Host lookup. Concurrent callers
8924
+ * deduplicate through the pending set; failures just clear the pending mark
8925
+ * so a later interaction can retry.
8926
+ */
8927
+ const resolveUnknown = async (refs, lookup) => {
8928
+ const missing = refs.filter((ref) => !resolved.has(ref) && !pending.has(ref) && !unresolvable.has(ref));
8929
+ if (missing.length === 0) return;
8930
+ for (const ref of missing) pending.add(ref);
8931
+ try {
8932
+ const entries = await lookup(missing);
8933
+ for (const entry of entries) {
8934
+ resolved.set(refOf(entry), entry);
8935
+ pending.delete(refOf(entry));
8936
+ }
8937
+ for (const ref of missing) if (!resolved.has(ref)) unresolvable.add(ref);
8938
+ if (entries.length > 0) emit();
8939
+ } finally {
8940
+ for (const ref of missing) pending.delete(ref);
8941
+ }
8942
+ };
8943
+ return {
8944
+ useVersion,
8945
+ cached,
8946
+ remember,
8947
+ resolveUnknown
8948
+ };
8949
+ }
8950
+ const taskStore = createRefStore((entry) => entry.taskRef);
8951
+ const threadStore = createRefStore((entry) => entry.threadRef);
8952
+ /** React binding: re-renders the caller when any Task ref resolution lands. */
8953
+ const useResolvedTaskRefVersion = taskStore.useVersion;
8954
+ const cachedResolvedTaskRef = taskStore.cached;
8955
+ /** Store one Task resolution (click path) and wake every rendered link. */
8956
+ const rememberResolvedTaskRef = taskStore.remember;
8957
+ const resolveUnknownTaskRefs = taskStore.resolveUnknown;
8958
+ /** React binding: re-renders the caller when any Thread ref resolution lands. */
8959
+ const useResolvedThreadRefVersion = threadStore.useVersion;
8960
+ const cachedResolvedThreadRef = threadStore.cached;
8961
+ /** Store one Thread resolution (click path) and wake every rendered link. */
8962
+ const rememberResolvedThreadRef = threadStore.remember;
8963
+ const resolveUnknownThreadRefs = threadStore.resolveUnknown;
8964
+ /**
8965
+ * Click-path Host lookup shared by both ref kinds: remember every resolved
8966
+ * entry and hand them back for immediate navigation. The Host keeps
8967
+ * `resolved` in the same order as the input refs (one entry per resolvable
8968
+ * input, unknowns omitted); the pairing walk below relies on that contract,
8969
+ * so it must be preserved together with this implementation. The Host
8970
+ * answers with full refs even for abbreviated inputs; the returned entries
8971
+ * keep the input order, so the walk remembers each authored spelling as an
8972
+ * alias of its resolution.
8973
+ */
8974
+ async function hostRefLookup(remember, refOf, alias, request, refs) {
8975
+ const result = await request(refs);
8244
8976
  if (!result.ok) return [];
8245
- const entries = result.value.resolved;
8977
+ const entries = result.value;
8246
8978
  let entryIndex = 0;
8247
- for (const requested of taskRefs) {
8979
+ for (const requested of refs) {
8248
8980
  const entry = entries[entryIndex];
8249
- if (entry === void 0 || !refKeyOf(entry.taskRef).startsWith(refKeyOf(requested))) continue;
8250
- if (entry.taskRef !== requested) rememberResolvedTaskRef({
8251
- ...entry,
8252
- taskRef: requested
8253
- });
8254
- rememberResolvedTaskRef(entry);
8981
+ if (entry === void 0 || !refKeyOf(refOf(entry)).startsWith(refKeyOf(requested))) continue;
8982
+ if (refOf(entry) !== requested) remember(alias(entry, requested));
8983
+ remember(entry);
8255
8984
  entryIndex += 1;
8256
8985
  }
8257
8986
  return entries;
8258
- };
8987
+ }
8988
+ /**
8989
+ * Click-path Task lookup: remember every resolved entry and hand them back
8990
+ * for immediate navigation (see hostRefLookup for the ordering contract).
8991
+ */
8992
+ const hostTaskRefLookup = (resolveTaskRefs, workspaceId) => async (taskRefs) => hostRefLookup(rememberResolvedTaskRef, (entry) => entry.taskRef, (entry, taskRef) => ({
8993
+ ...entry,
8994
+ taskRef
8995
+ }), async (refs) => {
8996
+ const result = await resolveTaskRefs({
8997
+ workspaceId,
8998
+ taskRefs: refs
8999
+ });
9000
+ return result.ok ? {
9001
+ ok: true,
9002
+ value: result.value.resolved
9003
+ } : result;
9004
+ }, taskRefs);
9005
+ /**
9006
+ * Click-path Thread lookup: remember every resolved entry and hand them back
9007
+ * for immediate navigation (see hostRefLookup for the ordering contract).
9008
+ */
9009
+ const hostThreadRefLookup = (resolveThreadRefs, workspaceId) => async (threadRefs) => hostRefLookup(rememberResolvedThreadRef, (entry) => entry.threadRef, (entry, threadRef) => ({
9010
+ ...entry,
9011
+ threadRef
9012
+ }), async (refs) => {
9013
+ const result = await resolveThreadRefs({
9014
+ workspaceId,
9015
+ threadRefs: refs
9016
+ });
9017
+ return result.ok ? {
9018
+ ok: true,
9019
+ value: result.value.resolved
9020
+ } : result;
9021
+ }, threadRefs);
8259
9022
  /** Resolve one Task ref through the Host and jump to its home Channel Thread. */
8260
9023
  const jumpToTaskThread = (resolveTaskRefs, workspaceId, taskRef, selectThread) => {
8261
9024
  resolveTaskRefs({
@@ -8267,30 +9030,54 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8267
9030
  if (hit !== void 0) selectThread(hit.threadRef, hit.channelRef, hit.taskRef, hit.taskNumber);
8268
9031
  });
8269
9032
  };
9033
+ /** Resolve one Thread ref through the Host and jump to its home Channel Thread. */
9034
+ const jumpToThread = (resolveThreadRefs, workspaceId, threadRef, selectThread) => {
9035
+ resolveThreadRefs({
9036
+ workspaceId,
9037
+ threadRefs: [threadRef]
9038
+ }).then((result) => {
9039
+ if (!result.ok) return;
9040
+ const hit = result.value.resolved[0];
9041
+ if (hit !== void 0) selectThread(hit.threadRef, hit.channelRef, hit.taskRef, hit.taskNumber);
9042
+ });
9043
+ };
9044
+ /** Exactly one roster entry whose full key extends the authored spelling; ambiguity resolves to nothing. */
9045
+ function uniqueByPrefix(entries, keyOf, authored) {
9046
+ const key = refKeyOf(authored);
9047
+ const hits = entries.filter((entry) => refKeyOf(keyOf(entry)).startsWith(key));
9048
+ return hits.length === 1 ? hits[0] : void 0;
9049
+ }
8270
9050
  /**
8271
- * Batch-resolve unknown refs through the Host lookup. Concurrent callers
8272
- * deduplicate through the pending set; failures just clear the pending mark
8273
- * so a later interaction can retry.
9051
+ * Display name for one authored channel ref, or undefined when the loaded
9052
+ * roster does not know it — the caller keeps plain text. Archived Channels
9053
+ * never resolve: they are gone from every Team surface, so their refs are
9054
+ * not links either.
8274
9055
  */
8275
- const resolveUnknownTaskRefs = async (refs, lookup) => {
8276
- const missing = refs.filter((taskRef) => !resolved.has(taskRef) && !pending.has(taskRef) && !unresolvable.has(taskRef));
8277
- if (missing.length === 0) return;
8278
- for (const taskRef of missing) pending.add(taskRef);
8279
- try {
8280
- const entries = await lookup(missing);
8281
- for (const entry of entries) {
8282
- resolved.set(entry.taskRef, entry);
8283
- pending.delete(entry.taskRef);
8284
- }
8285
- for (const taskRef of missing) if (!resolved.has(taskRef)) unresolvable.add(taskRef);
8286
- if (entries.length > 0) emit();
8287
- } finally {
8288
- for (const taskRef of missing) pending.delete(taskRef);
8289
- }
9056
+ const rosterChannelName = (channels, channelRef) => uniqueByPrefix(channels.filter((channel) => channel.state === "active"), (channel) => channel.channelRef, channelRef)?.name;
9057
+ /**
9058
+ * Roster facts for one authored member ref, or undefined when nobody on the
9059
+ * roster answers to it — the caller keeps plain text. The Human resolves to
9060
+ * a handle with no session: informative, never a link.
9061
+ */
9062
+ const rosterMember = (members, humanMemberId, humanHandle, memberRef) => {
9063
+ if (humanMemberId !== void 0 && refKeyOf(memberRef) === refKeyOf(humanMemberId)) return {
9064
+ memberId: humanMemberId,
9065
+ handle: humanHandle,
9066
+ openable: false
9067
+ };
9068
+ const hit = uniqueByPrefix(members, (status) => status.member.memberId, memberRef);
9069
+ if (hit === void 0) return void 0;
9070
+ const openable = hit.availability === "active";
9071
+ return {
9072
+ memberId: hit.member.memberId,
9073
+ handle: hit.member.handle.replace(/^@/, ""),
9074
+ ...openable ? { sessionId: hit.member.sessionId } : {},
9075
+ openable
9076
+ };
8290
9077
  };
8291
9078
  //#endregion
8292
9079
  //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/conversation.module.css.mjs
8293
- const css$6 = ".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_stateCluster{flex:none;align-items:center;gap:6px;display:inline-flex}.omcBaG_statusWord{color:var(--dsw-alias-label-secondary);font-size:11px;line-height:18px}.omcBaG_entryLine{flex-wrap:wrap;align-items:center;gap:8px;max-width:100%;margin:4px 0 0;display:flex}.omcBaG_entryRow{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;align-items:center;gap:6px;padding:2px 0;font-size:12px;line-height:18px;display:inline-flex}.omcBaG_entryRow:hover,.omcBaG_entryRow:focus-visible{color:var(--dsw-alias-label-primary)}.omcBaG_entryRow:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.omcBaG_entryArrow{align-items:center;transition:transform .12s;display:inline-flex}.omcBaG_entryRow:hover .omcBaG_entryArrow,.omcBaG_entryRow:focus-visible .omcBaG_entryArrow{transform:translate(2px)}.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{color:var(--dsw-alias-state-error-primary);max-width:880px;margin:0;padding-top:6px;font-size:12px;line-height:18px}.omcBaG_errorState{color:var(--dsw-alias-state-error-primary);justify-content:space-between;align-items:center;gap:8px;max-width:880px;margin:auto;padding:32px 0;font-size:12px;line-height:18px;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_entryArrow{transition:none}.omcBaG_entryRow:hover .omcBaG_entryArrow,.omcBaG_entryRow:focus-visible .omcBaG_entryArrow{transform:none}}.omcBaG_messageRun{margin:2px 0;padding:3px 0}.omcBaG_messageRow[data-grouped]:has([data-thread-entry]){margin-top:3px;padding-top:7px;position:relative}.omcBaG_messageRow[data-grouped]:has([data-thread-entry]):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([data-thread-entry]){margin-top:0}.omcBaG_runDivider+.omcBaG_messageRow[data-grouped]:has([data-thread-entry]):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}";
9080
+ const css$6 = ".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_messageIdentityImage{corner-shape:round;object-fit:cover;border-radius:50%;flex:0 0 28px;height:28px}.omcBaG_messageRow[data-grouped] .omcBaG_messageIdentity,.omcBaG_messageRow[data-grouped] .omcBaG_messageIdentityImage{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_stateCluster{flex:none;align-items:center;gap:6px;display:inline-flex}.omcBaG_statusWord{color:var(--dsw-alias-label-secondary);font-size:11px;line-height:18px}.omcBaG_entryLine{flex-wrap:wrap;align-items:center;gap:8px;max-width:100%;margin:4px 0 0;display:flex}.omcBaG_entryRow{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;align-items:center;gap:6px;padding:2px 0;font-size:12px;line-height:18px;display:inline-flex}.omcBaG_entryRow:hover,.omcBaG_entryRow:focus-visible{color:var(--dsw-alias-label-primary)}.omcBaG_entryRow:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.omcBaG_entryArrow{align-items:center;transition:transform .12s;display:inline-flex}.omcBaG_entryRow:hover .omcBaG_entryArrow,.omcBaG_entryRow:focus-visible .omcBaG_entryArrow{transform:translate(2px)}.omcBaG_messageText{font-size:var(--dsh-content-font-size,14px);line-height:calc(22px + var(--dsh-content-font-delta,0px));white-space:pre-wrap;word-break:break-word;margin:6px 0}.omcBaG_messageClamp{max-height:calc(176px + 8 * var(--dsh-content-font-delta,0px));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:var(--dsh-content-font-size,14px);line-height:calc(22px + var(--dsh-content-font-delta,0px))}.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:calc(17px + var(--dsh-content-font-delta,0px));line-height:calc(26px + var(--dsh-content-font-delta,0px))}.omcBaG_messageBody .omcBaG_messageMarkdown :where(h2){font-size:calc(16px + var(--dsh-content-font-delta,0px));line-height:calc(24px + var(--dsh-content-font-delta,0px))}.omcBaG_messageBody .omcBaG_messageMarkdown :where(h3,h4,h5,h6){font-size:calc(15px + var(--dsh-content-font-delta,0px));line-height:calc(22px + var(--dsh-content-font-delta,0px))}.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_messageBody [data-document] .omcBaG_messageMarkdown{line-height:calc(24px + var(--dsh-content-font-delta,0px))}.omcBaG_messageBody [data-document] .omcBaG_messageMarkdown p,.omcBaG_messageBody [data-document] .omcBaG_messageMarkdown :where(ul,ol){margin:16px 0}.omcBaG_messageBody [data-document] .omcBaG_messageMarkdown li+li{margin-top:6px}.omcBaG_messageBody [data-document] .omcBaG_messageMarkdown li>p{margin:8px 0}.omcBaG_messageBody [data-document] .omcBaG_messageMarkdown :where(h1,h2,h3,h4,h5,h6){margin:24px 0 8px}.omcBaG_messageBody [data-document] .omcBaG_messageMarkdown :where(h2){font-size:calc(18px + var(--dsh-content-font-delta,0px));line-height:calc(26px + var(--dsh-content-font-delta,0px))}.omcBaG_messageBody [data-document] .omcBaG_messageMarkdown :where(h3){font-size:calc(17px + var(--dsh-content-font-delta,0px));line-height:calc(24px + var(--dsh-content-font-delta,0px))}.omcBaG_messageBody [data-document] .omcBaG_messageMarkdown pre,.omcBaG_messageBody [data-document] .omcBaG_messageMarkdown blockquote{margin:16px 0}.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{color:var(--dsw-alias-state-error-primary);max-width:880px;margin:0;padding-top:6px;font-size:12px;line-height:18px}.omcBaG_errorState{color:var(--dsw-alias-state-error-primary);justify-content:space-between;align-items:center;gap:8px;max-width:880px;margin:auto;padding:32px 0;font-size:12px;line-height:18px;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_entryArrow{transition:none}.omcBaG_entryRow:hover .omcBaG_entryArrow,.omcBaG_entryRow:focus-visible .omcBaG_entryArrow{transform:none}}.omcBaG_messageRun{margin:2px 0;padding:3px 0}.omcBaG_messageRow[data-grouped]:has([data-thread-entry]){margin-top:3px;padding-top:7px;position:relative}.omcBaG_messageRow[data-grouped]:has([data-thread-entry]):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([data-thread-entry]){margin-top:0}.omcBaG_runDivider+.omcBaG_messageRow[data-grouped]:has([data-thread-entry]):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}";
8294
9081
  const tagId$6 = "@wowyuarm/dsh-agent-team/conversation.module.css";
8295
9082
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$6) + "]") === null) {
8296
9083
  const tag = document.createElement("style");
@@ -8328,6 +9115,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8328
9115
  "messageClamp": "omcBaG_messageClamp",
8329
9116
  "messageExpand": "omcBaG_messageExpand",
8330
9117
  "messageIdentity": "omcBaG_messageIdentity",
9118
+ "messageIdentityImage": "omcBaG_messageIdentityImage",
8331
9119
  "messageMarkdown": "omcBaG_messageMarkdown",
8332
9120
  "messageRow": "omcBaG_messageRow",
8333
9121
  "messageRun": "omcBaG_messageRun",
@@ -8358,8 +9146,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8358
9146
  * skipping a render here never detaches it. Callers must therefore keep the
8359
9147
  * props they derive per render (mention names, ref callbacks) identity-stable.
8360
9148
  */
8361
- const TeamMessage = (0, react.memo)(function TeamMessage({ senderName, memberId, human, body, occurredAt, mentionNames, senderTitle, grouped, showGroupedTime, attachments, loadAttachment, t, onOpenRef, onResolveTaskRefs, children }) {
9149
+ const TeamMessage = (0, react.memo)(function TeamMessage({ senderName, memberId, human, avatarUrl, body, occurredAt, mentionNames, senderTitle, grouped, showGroupedTime, attachments, loadAttachment, t, onOpenRef, onResolveTaskRefs, onResolveThreadRefs, channelNameOf, memberOf, onOpenMemberSession, children }) {
8362
9150
  const avatarStyle = human ? void 0 : { "--team-avatar-hue": memberHue(memberId) };
9151
+ const identityImage = useAvatarImage(human ? avatarUrl : void 0);
8363
9152
  const plan = planMessageBody(body, {
8364
9153
  human,
8365
9154
  ...mentionNames === void 0 ? {} : { mentionNames },
@@ -8367,19 +9156,30 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8367
9156
  });
8368
9157
  const displayBody = plan.displayBody;
8369
9158
  const { richAgentBody } = plan;
8370
- const refVersion = useResolvedTaskRefVersion();
9159
+ const taskRefVersion = useResolvedTaskRefVersion();
9160
+ const threadRefVersion = useResolvedThreadRefVersion();
8371
9161
  const bodyTaskRefs = plan.taskRefs;
8372
9162
  const bodyTaskRefKey = bodyTaskRefs.join(",");
9163
+ const bodyThreadRefs = plan.threadRefs;
9164
+ const bodyThreadRefKey = bodyThreadRefs.join(",");
8373
9165
  (0, react.useEffect)(() => {
8374
- if (onResolveTaskRefs === void 0 || bodyTaskRefKey === "") return;
8375
- resolveUnknownTaskRefs(bodyTaskRefs, onResolveTaskRefs);
9166
+ if (onResolveTaskRefs !== void 0 && bodyTaskRefKey !== "") resolveUnknownTaskRefs(bodyTaskRefs, onResolveTaskRefs);
9167
+ if (onResolveThreadRefs !== void 0 && bodyThreadRefKey !== "") resolveUnknownThreadRefs(bodyThreadRefs, onResolveThreadRefs);
8376
9168
  }, [
8377
9169
  onResolveTaskRefs,
9170
+ onResolveThreadRefs,
8378
9171
  bodyTaskRefKey,
8379
- refVersion
9172
+ bodyThreadRefKey,
9173
+ taskRefVersion,
9174
+ threadRefVersion
8380
9175
  ]);
8381
9176
  const taskLabel = (0, react.useCallback)((taskNumber) => t?.("taskLabel", { number: taskNumber }) ?? `Task #${taskNumber}`, [t]);
8382
- const refLabel = (0, react.useCallback)((ref) => ref.startsWith("thread:") ? t?.("threadLabel") ?? "Thread" : ref.startsWith("channel:") ? t?.("channels") ?? "Channels" : ref, [t]);
9177
+ const threadChipLabel = (0, react.useCallback)((title) => {
9178
+ const base = t?.("threadLabel") ?? "Thread";
9179
+ return title === "" ? base : `${base} · ${title}`;
9180
+ }, [t]);
9181
+ const channelChipLabel = (0, react.useCallback)((name) => t?.("channelLabel", { name }) ?? `Channel · ${name}`, [t]);
9182
+ const memberChipLabel = (0, react.useCallback)((name) => t?.("memberLabel", { name }) ?? `Member · @${name}`, [t]);
8383
9183
  const markdownLabels = (0, react.useMemo)(() => ({
8384
9184
  code: {
8385
9185
  copyLabel: t?.("copyCode") ?? "Copy",
@@ -8397,21 +9197,34 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8397
9197
  const textNodes = markdownProseTextNodes(root);
8398
9198
  const styledRefCodes = markdownStyledRefCodeElements(root);
8399
9199
  const taskRefs = [...new Set([...textNodes.map((node) => node.data), ...styledRefCodes.map((code) => code.textContent ?? "")].flatMap((text) => splitBrandedRefs(text).filter((segment) => segment.ref?.startsWith("task:") === true).map((segment) => segment.ref)))];
9200
+ const threadRefs = [...new Set([...textNodes.map((node) => node.data), ...styledRefCodes.map((code) => code.textContent ?? "")].flatMap((text) => splitBrandedRefs(text).filter((segment) => segment.ref?.startsWith("thread:") === true).map((segment) => segment.ref)))];
8400
9201
  if (onResolveTaskRefs !== void 0 && taskRefs.length > 0) resolveUnknownTaskRefs(taskRefs, onResolveTaskRefs);
8401
- for (const code of styledRefCodes) renderResolvedMarkdownCodeRef(code, taskLabel, refLabel);
8402
- for (const node of textNodes) renderResolvedMarkdownText(node, mentionNames ?? [], taskLabel, refLabel);
9202
+ if (onResolveThreadRefs !== void 0 && threadRefs.length > 0) resolveUnknownThreadRefs(threadRefs, onResolveThreadRefs);
9203
+ for (const code of styledRefCodes) renderResolvedMarkdownCodeRef(code, taskLabel, threadChipLabel, channelChipLabel, memberChipLabel, channelNameOf, memberOf);
9204
+ for (const node of textNodes) renderResolvedMarkdownText(node, mentionNames ?? [], taskLabel, threadChipLabel, channelChipLabel, memberChipLabel, channelNameOf, memberOf);
8403
9205
  for (const button of root.querySelectorAll("button[data-task-ref]")) {
8404
9206
  const taskRef = button.dataset.taskRef;
8405
9207
  const hit = taskRef === void 0 ? void 0 : cachedResolvedTaskRef(taskRef);
8406
9208
  if (taskRef !== void 0 && hit !== void 0) button.textContent = taskLabel(hit.taskNumber);
8407
9209
  }
9210
+ for (const button of root.querySelectorAll("button[data-thread-ref]")) {
9211
+ const threadRef = button.dataset.threadRef;
9212
+ const hit = threadRef === void 0 ? void 0 : cachedResolvedThreadRef(threadRef);
9213
+ if (threadRef !== void 0 && hit !== void 0) button.textContent = threadChipLabel(hit.title);
9214
+ }
8408
9215
  }, [
8409
9216
  richAgentBody,
8410
9217
  onOpenRef,
8411
9218
  onResolveTaskRefs,
8412
- refVersion,
9219
+ onResolveThreadRefs,
9220
+ taskRefVersion,
9221
+ threadRefVersion,
8413
9222
  taskLabel,
8414
- refLabel,
9223
+ threadChipLabel,
9224
+ channelChipLabel,
9225
+ memberChipLabel,
9226
+ channelNameOf,
9227
+ memberOf,
8415
9228
  mentionNames
8416
9229
  ]);
8417
9230
  (0, react.useEffect)(() => {
@@ -8420,25 +9233,36 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8420
9233
  const openTask = (event) => {
8421
9234
  const target = event.target;
8422
9235
  if (!(target instanceof Element)) return;
8423
- const button = target.closest("button[data-ref], button[data-task-ref]");
9236
+ const button = target.closest("button[data-ref], button[data-task-ref], button[data-thread-ref], button[data-member-session]");
8424
9237
  if (button === null || !root.contains(button)) return;
8425
- const ref = button instanceof HTMLElement ? button.dataset.ref ?? button.dataset.taskRef : void 0;
8426
- if (ref !== void 0) onOpenRef(ref);
9238
+ if (button instanceof HTMLElement) {
9239
+ const sessionId = button.dataset.memberSession;
9240
+ if (sessionId !== void 0) {
9241
+ onOpenMemberSession?.(sessionId);
9242
+ return;
9243
+ }
9244
+ const ref = button.dataset.ref ?? button.dataset.taskRef ?? button.dataset.threadRef;
9245
+ if (ref !== void 0) onOpenRef(ref);
9246
+ }
8427
9247
  };
8428
9248
  root.addEventListener("click", openTask);
8429
9249
  return () => {
8430
9250
  root.removeEventListener("click", openTask);
8431
9251
  };
8432
- }, [richAgentBody, onOpenRef]);
9252
+ }, [
9253
+ richAgentBody,
9254
+ onOpenRef,
9255
+ onOpenMemberSession
9256
+ ]);
8433
9257
  const bodyNode = plan.render === "inline" && plan.inline !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8434
9258
  className: conversation_module_css_default.messageText,
8435
9259
  children: plan.inline.segments.map((segment, index) => segment.mention ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8436
9260
  className: conversation_module_css_default.mention,
8437
9261
  children: segment.text
8438
- }, index) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: renderRefs(segment.text, onOpenRef, taskLabel, refLabel) }, index))
9262
+ }, index) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: renderRefs(segment.text, onOpenRef, onOpenMemberSession, taskLabel, threadChipLabel, channelChipLabel, memberChipLabel, channelNameOf, memberOf) }, index))
8439
9263
  }) : plan.render === "literal" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8440
9264
  className: conversation_module_css_default.messageText,
8441
- children: onOpenRef === void 0 ? displayBody : renderRefs(displayBody, onOpenRef, taskLabel, refLabel)
9265
+ children: onOpenRef === void 0 ? displayBody : renderRefs(displayBody, onOpenRef, onOpenMemberSession, taskLabel, threadChipLabel, channelChipLabel, memberChipLabel, channelNameOf, memberOf)
8442
9266
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8443
9267
  ref: markdownRef,
8444
9268
  className: conversation_module_css_default.messageMarkdown,
@@ -8451,11 +9275,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8451
9275
  className: conversation_module_css_default.messageRow,
8452
9276
  "data-human": human || void 0,
8453
9277
  "data-grouped": grouped || void 0,
8454
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9278
+ children: [identityImage.src === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8455
9279
  className: conversation_module_css_default.messageIdentity,
9280
+ "data-avatar": "initial",
8456
9281
  style: avatarStyle,
8457
9282
  "aria-hidden": "true",
8458
9283
  children: senderName.replace("@", "").slice(0, 1).toUpperCase()
9284
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
9285
+ className: conversation_module_css_default.messageIdentityImage,
9286
+ "data-avatar": "image",
9287
+ src: identityImage.src,
9288
+ alt: "",
9289
+ "aria-hidden": "true",
9290
+ onError: identityImage.failed
8459
9291
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8460
9292
  className: conversation_module_css_default.messageBody,
8461
9293
  children: [
@@ -8470,6 +9302,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8470
9302
  })]
8471
9303
  }),
8472
9304
  clampable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
9305
+ "data-document": "",
8473
9306
  className: clamped ? conversation_module_css_default.messageClamp : void 0,
8474
9307
  children: bodyNode
8475
9308
  }) : bodyNode,
@@ -8545,28 +9378,77 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8545
9378
  button.textContent = label;
8546
9379
  return button;
8547
9380
  }
8548
- /** Replace a whole-ref code span with its resolved Task chip once known. */
8549
- function renderResolvedMarkdownCodeRef(code, taskLabel, refLabel) {
9381
+ /** One resolved Thread-ref chip built outside React, matching the styled ref link. */
9382
+ function resolvedThreadRefButton(threadRef, label) {
9383
+ const button = document.createElement("button");
9384
+ button.type = "button";
9385
+ if (conversation_module_css_default.refLink !== void 0) button.className = conversation_module_css_default.refLink;
9386
+ button.dataset.threadRef = threadRef;
9387
+ button.title = threadRef;
9388
+ button.textContent = label;
9389
+ return button;
9390
+ }
9391
+ /** One roster-resolved Channel chip built outside React, matching the styled ref link. */
9392
+ function resolvedChannelRefButton(channelRef, label) {
9393
+ const button = document.createElement("button");
9394
+ button.type = "button";
9395
+ if (conversation_module_css_default.refLink !== void 0) button.className = conversation_module_css_default.refLink;
9396
+ button.dataset.ref = channelRef;
9397
+ button.title = channelRef;
9398
+ button.textContent = label;
9399
+ return button;
9400
+ }
9401
+ /**
9402
+ * One roster-resolved Member chip built outside React. Openable Members jump
9403
+ * to their session through the delegated click listener; everyone else gets
9404
+ * a labelled but inert span, never a link-shaped misfire.
9405
+ */
9406
+ function resolvedMemberRefChip(memberRef, label, sessionId) {
9407
+ if (sessionId === void 0) {
9408
+ const span = document.createElement("span");
9409
+ span.title = memberRef;
9410
+ span.textContent = label;
9411
+ return span;
9412
+ }
9413
+ const button = document.createElement("button");
9414
+ button.type = "button";
9415
+ if (conversation_module_css_default.refLink !== void 0) button.className = conversation_module_css_default.refLink;
9416
+ button.dataset.memberSession = sessionId;
9417
+ button.title = memberRef;
9418
+ button.textContent = label;
9419
+ return button;
9420
+ }
9421
+ /** Replace a whole-ref code span with its resolved chip once known. */
9422
+ function renderResolvedMarkdownCodeRef(code, taskLabel, threadChipLabel, channelChipLabel, memberChipLabel, channelNameOf, memberOf) {
8550
9423
  const segments = splitBrandedRefs((code.textContent ?? "").trim());
8551
9424
  const ref = (segments.length === 1 ? segments[0] : void 0)?.ref;
8552
9425
  if (ref === void 0) return;
8553
- const taskRef = ref.startsWith("task:") === true ? ref : void 0;
8554
- const resolved = taskRef === void 0 ? void 0 : cachedResolvedTaskRef(taskRef);
8555
- if (taskRef !== void 0 && resolved === void 0) return;
8556
- if (taskRef !== void 0) {
8557
- code.replaceWith(resolvedTaskRefButton(taskRef, taskLabel(resolved.taskNumber)));
9426
+ if (ref.startsWith("task:")) {
9427
+ const resolved = cachedResolvedTaskRef(ref);
9428
+ if (resolved === void 0) return;
9429
+ code.replaceWith(resolvedTaskRefButton(ref, taskLabel(resolved.taskNumber)));
8558
9430
  return;
8559
9431
  }
8560
- const button = document.createElement("button");
8561
- button.type = "button";
8562
- if (conversation_module_css_default.refLink !== void 0) button.className = conversation_module_css_default.refLink;
8563
- button.dataset.ref = ref;
8564
- button.title = ref;
8565
- button.textContent = refLabel(ref);
8566
- code.replaceWith(button);
9432
+ if (ref.startsWith("thread:")) {
9433
+ const resolved = cachedResolvedThreadRef(ref);
9434
+ if (resolved === void 0) return;
9435
+ code.replaceWith(resolvedThreadRefButton(ref, threadChipLabel(resolved.title)));
9436
+ return;
9437
+ }
9438
+ if (ref.startsWith("channel:")) {
9439
+ const name = channelNameOf?.(ref);
9440
+ if (name === void 0) return;
9441
+ code.replaceWith(resolvedChannelRefButton(ref, channelChipLabel(name)));
9442
+ return;
9443
+ }
9444
+ if (ref.startsWith("member:")) {
9445
+ const resolved = memberOf?.(ref);
9446
+ if (resolved === void 0) return;
9447
+ code.replaceWith(resolvedMemberRefChip(ref, memberChipLabel(resolved.handle), resolved.openable ? resolved.sessionId : void 0));
9448
+ }
8567
9449
  }
8568
- /** Replace resolved Task refs and structured mention handles in one prose text node without changing Markdown structure. */
8569
- function renderResolvedMarkdownText(node, mentionNames, taskLabel, refLabel) {
9450
+ /** Replace resolved Task/Thread/Channel/Member refs and structured mention handles in one prose text node without changing Markdown structure. */
9451
+ function renderResolvedMarkdownText(node, mentionNames, taskLabel, threadChipLabel, channelChipLabel, memberChipLabel, channelNameOf, memberOf) {
8570
9452
  let changed = false;
8571
9453
  const fragment = document.createDocumentFragment();
8572
9454
  for (const refSegment of splitBrandedRefs(node.data)) {
@@ -8584,43 +9466,105 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8584
9466
  }
8585
9467
  continue;
8586
9468
  }
8587
- const taskRef = refSegment.ref.startsWith("task:") === true ? refSegment.ref : void 0;
8588
- const resolved = taskRef === void 0 ? void 0 : cachedResolvedTaskRef(taskRef);
8589
- if (taskRef !== void 0 && resolved === void 0) {
8590
- fragment.append(refSegment.text);
8591
- continue;
8592
- }
8593
- changed = true;
8594
- if (taskRef !== void 0) fragment.append(resolvedTaskRefButton(taskRef, taskLabel(resolved.taskNumber)));
8595
- else {
8596
- const button = document.createElement("button");
8597
- button.type = "button";
8598
- if (conversation_module_css_default.refLink !== void 0) button.className = conversation_module_css_default.refLink;
8599
- button.dataset.ref = refSegment.ref;
8600
- button.title = refSegment.ref;
8601
- button.textContent = refLabel(refSegment.ref);
8602
- fragment.append(button);
8603
- }
9469
+ if (refSegment.ref.startsWith("task:")) {
9470
+ const resolved = cachedResolvedTaskRef(refSegment.ref);
9471
+ if (resolved === void 0) {
9472
+ fragment.append(refSegment.text);
9473
+ continue;
9474
+ }
9475
+ changed = true;
9476
+ fragment.append(resolvedTaskRefButton(refSegment.ref, taskLabel(resolved.taskNumber)));
9477
+ } else if (refSegment.ref.startsWith("thread:")) {
9478
+ const resolved = cachedResolvedThreadRef(refSegment.ref);
9479
+ if (resolved === void 0) {
9480
+ fragment.append(refSegment.text);
9481
+ continue;
9482
+ }
9483
+ changed = true;
9484
+ fragment.append(resolvedThreadRefButton(refSegment.ref, threadChipLabel(resolved.title)));
9485
+ } else if (refSegment.ref.startsWith("channel:")) {
9486
+ const name = channelNameOf?.(refSegment.ref);
9487
+ if (name === void 0) {
9488
+ fragment.append(refSegment.text);
9489
+ continue;
9490
+ }
9491
+ changed = true;
9492
+ fragment.append(resolvedChannelRefButton(refSegment.ref, channelChipLabel(name)));
9493
+ } else if (refSegment.ref.startsWith("member:")) {
9494
+ const resolved = memberOf?.(refSegment.ref);
9495
+ if (resolved === void 0) {
9496
+ fragment.append(refSegment.text);
9497
+ continue;
9498
+ }
9499
+ changed = true;
9500
+ fragment.append(resolvedMemberRefChip(refSegment.ref, memberChipLabel(resolved.handle), resolved.openable ? resolved.sessionId : void 0));
9501
+ } else fragment.append(refSegment.text);
8604
9502
  }
8605
9503
  if (changed) node.replaceWith(fragment);
8606
9504
  }
8607
9505
  /** Render one literal text run, linkifying branded refs when navigation is available. */
8608
- function renderRefs(text, onOpenRef, taskLabel, refLabel) {
9506
+ function renderRefs(text, onOpenRef, onOpenMemberSession, taskLabel, threadChipLabel, channelChipLabel, memberChipLabel, channelNameOf, memberOf) {
8609
9507
  if (onOpenRef === void 0) return text;
8610
9508
  return splitBrandedRefs(text).map((segment, index) => {
8611
9509
  if (segment.ref === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: segment.text }, index);
8612
- const resolved = cachedResolvedTaskRef(segment.ref);
8613
- if (segment.ref.startsWith("task:") && resolved === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: segment.text }, index);
8614
- const label = resolved !== void 0 && segment.ref.startsWith("task:") ? taskLabel(resolved.taskNumber) : refLabel(segment.ref);
8615
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
8616
- type: "button",
8617
- className: conversation_module_css_default.refLink,
8618
- title: segment.ref,
8619
- onClick: () => {
8620
- onOpenRef(segment.ref);
8621
- },
8622
- children: label
8623
- }, index);
9510
+ if (segment.ref.startsWith("task:")) {
9511
+ const resolved = cachedResolvedTaskRef(segment.ref);
9512
+ if (resolved === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: segment.text }, index);
9513
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
9514
+ type: "button",
9515
+ className: conversation_module_css_default.refLink,
9516
+ title: segment.ref,
9517
+ onClick: () => {
9518
+ onOpenRef(segment.ref);
9519
+ },
9520
+ children: taskLabel(resolved.taskNumber)
9521
+ }, index);
9522
+ }
9523
+ if (segment.ref.startsWith("thread:")) {
9524
+ const resolved = cachedResolvedThreadRef(segment.ref);
9525
+ if (resolved === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: segment.text }, index);
9526
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
9527
+ type: "button",
9528
+ className: conversation_module_css_default.refLink,
9529
+ title: segment.ref,
9530
+ onClick: () => {
9531
+ onOpenRef(segment.ref);
9532
+ },
9533
+ children: threadChipLabel(resolved.title)
9534
+ }, index);
9535
+ }
9536
+ if (segment.ref.startsWith("channel:")) {
9537
+ const name = channelNameOf?.(segment.ref);
9538
+ if (name === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: segment.text }, index);
9539
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
9540
+ type: "button",
9541
+ className: conversation_module_css_default.refLink,
9542
+ title: segment.ref,
9543
+ onClick: () => {
9544
+ onOpenRef(segment.ref);
9545
+ },
9546
+ children: channelChipLabel(name)
9547
+ }, index);
9548
+ }
9549
+ if (segment.ref.startsWith("member:")) {
9550
+ const resolved = memberOf?.(segment.ref);
9551
+ if (resolved === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: segment.text }, index);
9552
+ if (!resolved.openable || resolved.sessionId === void 0 || onOpenMemberSession === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9553
+ title: segment.ref,
9554
+ children: memberChipLabel(resolved.handle)
9555
+ }, index);
9556
+ const sessionId = resolved.sessionId;
9557
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
9558
+ type: "button",
9559
+ className: conversation_module_css_default.refLink,
9560
+ title: segment.ref,
9561
+ onClick: () => {
9562
+ onOpenMemberSession(sessionId);
9563
+ },
9564
+ children: memberChipLabel(resolved.handle)
9565
+ }, index);
9566
+ }
9567
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: segment.text }, index);
8624
9568
  });
8625
9569
  }
8626
9570
  /** One message's attachment strip: image thumbnails with a large view, or name chips when bytes are gone. */
@@ -8695,7 +9639,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8695
9639
  }
8696
9640
  //#endregion
8697
9641
  //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/avatar-stack.module.css.mjs
8698
- const css$5 = ".aACNsW_stack{flex:none;align-items:center;display:inline-flex}.aACNsW_avatar,.aACNsW_overflow{box-shadow:0 0 0 2px var(--team-mark-ring,var(--dsw-alias-bg-base));corner-shape:round;border-radius:50%;justify-content:center;align-items:center;width:18px;height:18px;font-size:9px;font-weight:600;display:inline-flex}.aACNsW_avatar{background:hsl(var(--team-avatar-hue,212) 42% 46%);color:#fff}.aACNsW_overflow{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary)}.aACNsW_avatar+.aACNsW_avatar,.aACNsW_avatar+.aACNsW_overflow{margin-left:-6px}";
9642
+ const css$5 = ".aACNsW_stack{flex:none;align-items:center;display:inline-flex}.aACNsW_avatar,.aACNsW_avatarImage,.aACNsW_overflow{box-shadow:0 0 0 2px var(--team-mark-ring,var(--dsw-alias-bg-base)), 0 0 0 2px var(--dsw-alias-bg-base);corner-shape:round;border-radius:50%;justify-content:center;align-items:center;width:18px;height:18px;font-size:9px;font-weight:600;display:inline-flex}.aACNsW_avatar{background:hsl(var(--team-avatar-hue,212) 42% 46%);color:#fff}.aACNsW_avatarImage{background:hsl(var(--team-avatar-hue,212) 42% 46%);object-fit:cover}.aACNsW_overflow{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary)}.aACNsW_stack>:not(:first-child){margin-left:-6px}";
8699
9643
  const tagId$5 = "@wowyuarm/dsh-agent-team/avatar-stack.module.css";
8700
9644
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$5) + "]") === null) {
8701
9645
  const tag = document.createElement("style");
@@ -8706,6 +9650,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8706
9650
  }
8707
9651
  var avatar_stack_module_css_default = {
8708
9652
  "avatar": "aACNsW_avatar",
9653
+ "avatarImage": "aACNsW_avatarImage",
8709
9654
  "overflow": "aACNsW_overflow",
8710
9655
  "stack": "aACNsW_stack"
8711
9656
  };
@@ -8714,12 +9659,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8714
9659
  /** Distinct owners past this count collapse into one `+N` chip. */
8715
9660
  const MAX_VISIBLE = 3;
8716
9661
  /**
9662
+ * Owners as a seat names them: the Client's Human identity outranks the name
9663
+ * the Host projected for that actor, so a rename moves label and initial
9664
+ * together in every seat that draws the stack.
9665
+ */
9666
+ function namedAvatarOwners(owners, human) {
9667
+ if (human === void 0) return owners;
9668
+ return owners.map((owner) => owner.memberId === human.memberId ? {
9669
+ memberId: owner.memberId,
9670
+ name: human.name
9671
+ } : owner);
9672
+ }
9673
+ /**
8717
9674
  * The compact "who is on this work" stack: overlapping 18px Member circles in
8718
9675
  * the shared identity language, capped at three plus a `+N` chip. The circles
8719
9676
  * are presentational, so the stack is one `role="img"` whose label carries the
8720
9677
  * whole roster — three anonymous initials would read as noise.
8721
9678
  */
8722
- function TeamAvatarStack({ owners, label }) {
9679
+ function TeamAvatarStack({ owners, label, human }) {
8723
9680
  if (owners.length === 0) return null;
8724
9681
  const shown = owners.slice(0, MAX_VISIBLE);
8725
9682
  const overflow = owners.length - shown.length;
@@ -8727,16 +9684,37 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8727
9684
  className: avatar_stack_module_css_default.stack,
8728
9685
  role: "img",
8729
9686
  "aria-label": label,
8730
- children: [shown.map((owner) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8731
- className: avatar_stack_module_css_default.avatar,
8732
- style: { "--team-avatar-hue": memberHue(owner.memberId) },
8733
- children: initial(owner.name)
9687
+ children: [shown.map((owner) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OwnerAvatar, {
9688
+ owner,
9689
+ human
8734
9690
  }, owner.memberId)), overflow > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8735
9691
  className: avatar_stack_module_css_default.overflow,
8736
9692
  children: `+${overflow}`
8737
9693
  })]
8738
9694
  });
8739
9695
  }
9696
+ /**
9697
+ * One circle. Only an owner the seat identifies as the Human consults an image
9698
+ * at all, and those bytes keep the initial whenever they do not decode — the
9699
+ * same promise, and the same hook, the timeline avatar makes.
9700
+ */
9701
+ function OwnerAvatar({ owner, human }) {
9702
+ const image = useAvatarImage(human !== void 0 && owner.memberId === human.memberId ? human.avatarUrl : void 0);
9703
+ const hue = { "--team-avatar-hue": memberHue(owner.memberId) };
9704
+ if (image.src === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9705
+ className: avatar_stack_module_css_default.avatar,
9706
+ style: hue,
9707
+ children: initial(owner.name)
9708
+ });
9709
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
9710
+ className: avatar_stack_module_css_default.avatarImage,
9711
+ style: hue,
9712
+ src: image.src,
9713
+ alt: "",
9714
+ "aria-hidden": "true",
9715
+ onError: image.failed
9716
+ });
9717
+ }
8740
9718
  /** First visible character of a handle — and of a raw Member id when that is all there is. */
8741
9719
  function initial(name) {
8742
9720
  return name.replace(/^@/, "").replace(/^member:/, "").slice(0, 1).toUpperCase();
@@ -8984,7 +9962,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8984
9962
  };
8985
9963
  //#endregion
8986
9964
  //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/thread.module.css.mjs
8987
- 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);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)}}";
9965
+ const css$2 = ".-Qiwua_titleLine{flex-wrap:wrap;align-items:center;gap:10px;display:flex}.-Qiwua_titleLine h1{margin:0}.-Qiwua_workSection,.-Qiwua_riskSection{max-width:880px;margin:14px auto 0}.-Qiwua_riskSection h2{color:var(--dsw-alias-state-error-primary);margin:0 0 6px;font-size:12px;font-weight:600;line-height:18px}.-Qiwua_riskRow{color:var(--dsw-alias-label-secondary);flex-wrap:nowrap;align-items:center;gap:6px;min-width:0;margin:0 0 2px;font-size:11px;line-height:16px;display:flex;overflow:hidden}.-Qiwua_riskRow>span{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.-Qiwua_riskClass{color:var(--dsw-alias-state-error-primary);font-weight:600}.-Qiwua_claimList{gap:0;padding:4px 0 0 22px;display:grid}.-Qiwua_claimRow{border-radius:6px;grid-template-columns:14px minmax(0,1fr) auto;align-items:center;column-gap:8px;min-height:30px;padding:3px 6px 5px;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;grid-area:1/2;align-items:center;gap:4px;min-width:0;font-size:11px;font-weight:500;line-height:16px;display:inline-flex;overflow:hidden}.-Qiwua_claimDirection{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;grid-area:2/2;min-width:0;font-size:12px;line-height:18px}.-Qiwua_claimRowDone .-Qiwua_claimDirection{color:var(--dsw-alias-label-secondary)}.-Qiwua_claimState{color:var(--dsw-alias-label-tertiary);white-space:nowrap;grid-area:1/3;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:1;line-clamp:1;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{align-items:start}.-Qiwua_activityRow{padding-inline:0}.-Qiwua_newUpdates{max-width:calc(100% - 16px)}}";
8988
9966
  const tagId$2 = "@wowyuarm/dsh-agent-team/thread.module.css";
8989
9967
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
8990
9968
  const tag = document.createElement("style");
@@ -9001,6 +9979,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9001
9979
  "claimList": "-Qiwua_claimList",
9002
9980
  "claimOwner": "-Qiwua_claimOwner",
9003
9981
  "claimRow": "-Qiwua_claimRow",
9982
+ "claimRowDone": "-Qiwua_claimRowDone",
9004
9983
  "claimState": "-Qiwua_claimState",
9005
9984
  "closedBar": "-Qiwua_closedBar",
9006
9985
  "closedNotice": "-Qiwua_closedNotice",
@@ -9010,6 +9989,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9010
9989
  "newUpdates": "-Qiwua_newUpdates",
9011
9990
  "newUpdatesJump": "-Qiwua_newUpdatesJump",
9012
9991
  "publicSection": "-Qiwua_publicSection",
9992
+ "riskClass": "-Qiwua_riskClass",
9013
9993
  "riskRow": "-Qiwua_riskRow",
9014
9994
  "riskSection": "-Qiwua_riskSection",
9015
9995
  "taskTitle": "-Qiwua_taskTitle",
@@ -9044,11 +10024,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9044
10024
  const lastActivityAt = item.lastActivityAt;
9045
10025
  return lastActivityAt === void 0 || lastActivityAt === item.message.occurredAt ? void 0 : lastActivityAt;
9046
10026
  }
10027
+ /**
10028
+ * What the door prints about follow-up activity, or nothing. A resolved Task
10029
+ * stops printing it: the status word beside the door already says nothing is
10030
+ * moving, and the instant it would print is the moment it resolved — repeated
10031
+ * on every finished row. The precise instant stays on the control's title, one
10032
+ * hover away. A taskless Thread never resolves, so a discussion keeps the
10033
+ * recency that is the whole of its state line: it wears no status word, dot, or
10034
+ * owner stack.
10035
+ */
10036
+ function printedActivityAt(item) {
10037
+ const status = item.task?.status;
10038
+ return status === "done" || status === "closed" ? void 0 : followUpAt(item);
10039
+ }
9047
10040
  /** Host unread per Thread, keyed for the feed's rows: zero unread is the absence of a badge, not a row. */
9048
10041
  function unreadCounts(inbox) {
9049
10042
  return new Map(inbox.items.filter((item) => item.unreadCount > 0).map((item) => [item.thread.threadRef, item.unreadCount]));
9050
10043
  }
9051
- function TeamChannelPage({ workspaceId, channelRef, loadChannels, subscribeChanges, loadMembers, loadInbox, drafts, putAttachment, getAttachment, sendMessage, joinChannel, removeChannelMember, selectThread, selectChannel, backToChannels, resolveTaskRefs, t }) {
10044
+ function TeamChannelPage({ workspaceId, channelRef, humanName, humanAvatarUrl, loadChannels, subscribeChanges, loadMembers, loadInbox, drafts, putAttachment, getAttachment, sendMessage, joinChannel, removeChannelMember, selectThread, selectChannel, backToChannels, resolveTaskRefs, resolveThreadRefs, openMemberSession, t }) {
9052
10045
  const [view, setView] = (0, react.useState)();
9053
10046
  const [members, setMembers] = (0, react.useState)([]);
9054
10047
  const [unreadByThread, setUnreadByThread] = (0, react.useState)(/* @__PURE__ */ new Map());
@@ -9080,19 +10073,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9080
10073
  selectThread(match.thread.threadRef, channelRef, match.task?.taskRef, match.taskNumber);
9081
10074
  return;
9082
10075
  }
9083
- loadChannels({
9084
- workspaceId,
9085
- threadRef: ref,
9086
- includeActivities: false,
9087
- limit: 1
9088
- }).then((result) => {
9089
- if (!result.ok) return;
9090
- const target = result.value.items[0];
9091
- if (target !== void 0) {
9092
- const targetChannel = result.value.channels.find((channel) => channel.channelRef === target.message.channelRef);
9093
- if (targetChannel !== void 0) selectThread(target.thread.threadRef, targetChannel.channelRef, target.task?.taskRef, target.taskNumber);
9094
- }
9095
- });
10076
+ jumpToThread(resolveThreadRefs, workspaceId, ref, selectThread);
9096
10077
  return;
9097
10078
  }
9098
10079
  if (ref.startsWith("task:")) {
@@ -9105,6 +10086,26 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9105
10086
  }
9106
10087
  };
9107
10088
  const lookupTaskRefs = hostTaskRefLookup(resolveTaskRefs, workspaceId);
10089
+ const lookupThreadRefs = hostThreadRefLookup(resolveThreadRefs, workspaceId);
10090
+ const rosterKey = (0, react.useMemo)(() => [
10091
+ (view?.channels ?? []).map((channel) => `${channel.channelRef}=${channel.name}=${channel.state}`).join(","),
10092
+ members.map((status) => `${status.member.memberId}=${status.member.handle}=${status.member.sessionId}=${status.availability}`).join(","),
10093
+ view?.humanMemberId ?? ""
10094
+ ].join(";"), [view, members]);
10095
+ const channelNameOf = (0, react.useMemo)(() => {
10096
+ const channels = view?.channels ?? [];
10097
+ return (ref) => rosterChannelName(channels, ref);
10098
+ }, [rosterKey]);
10099
+ const memberOf = (0, react.useMemo)(() => {
10100
+ const humanMemberId = view?.humanMemberId;
10101
+ return (ref) => rosterMember(members, humanMemberId, humanName, ref);
10102
+ }, [rosterKey, humanName]);
10103
+ const humanMemberId = view?.humanMemberId;
10104
+ const humanIdentity = humanMemberId === void 0 ? void 0 : {
10105
+ memberId: humanMemberId,
10106
+ name: humanName,
10107
+ ...humanAvatarUrl === void 0 ? {} : { avatarUrl: humanAvatarUrl }
10108
+ };
9108
10109
  const timeline = useTimelineScroll(`${view?.items.length ?? 0}:${channelLastItem?.message.messageRef ?? ""}`);
9109
10110
  const channel = view?.channels.find((item) => item.channelRef === channelRef);
9110
10111
  const channelMemberIds = new Set(view?.members.filter((item) => item.channelRef === channelRef).map((item) => item.memberId) ?? []);
@@ -9450,7 +10451,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9450
10451
  children: block.items.map((item, index) => {
9451
10452
  const senderStatus = members.find((member) => member.member.memberId === item.message.sender);
9452
10453
  const human = item.message.sender === view.humanMemberId;
9453
- const sender = human ? t("human") : senderStatus?.member.handle ?? item.message.sender;
10454
+ const sender = human ? humanName : senderStatus?.member.handle ?? item.message.sender;
9454
10455
  const turnGap = isRunGap(index > 0 ? block.items[index - 1].message.occurredAt : void 0, item.message.occurredAt);
9455
10456
  const task = item.task;
9456
10457
  const unread = unreadByThread.get(item.thread.threadRef) ?? 0;
@@ -9458,14 +10459,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9458
10459
  senderName: sender,
9459
10460
  memberId: item.message.sender,
9460
10461
  human,
10462
+ ...humanAvatarUrl === void 0 ? {} : { avatarUrl: humanAvatarUrl },
9461
10463
  body: item.message.body,
9462
10464
  attachments: item.message.attachments,
9463
10465
  loadAttachment: getAttachment,
9464
10466
  t,
9465
10467
  occurredAt: item.message.occurredAt,
9466
- mentionNames: mentionNamesOf(item.mentions, handleByMember),
10468
+ mentionNames: mentionNamesOf(item.mentions, handleByMember, humanName),
9467
10469
  onOpenRef: openRef,
9468
10470
  onResolveTaskRefs: lookupTaskRefs,
10471
+ onResolveThreadRefs: lookupThreadRefs,
10472
+ channelNameOf,
10473
+ memberOf,
10474
+ onOpenMemberSession: openMemberSession,
9469
10475
  grouped: index > 0,
9470
10476
  showGroupedTime: item.message.topLevel === true && !turnGap,
9471
10477
  ...senderStatus === void 0 ? {} : { senderTitle: senderStatus.member.description },
@@ -9473,6 +10479,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9473
10479
  item,
9474
10480
  owners: item.claimOwners,
9475
10481
  unread,
10482
+ human: humanIdentity,
9476
10483
  t,
9477
10484
  onOpen: () => {
9478
10485
  selectThread(item.thread.threadRef, channelRef, task?.taskRef, item.taskNumber);
@@ -9513,14 +10520,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9513
10520
  * carried nothing else. The unread capsule is the only member a taskless
9514
10521
  * discussion can carry: it needs no Task.
9515
10522
  */
9516
- function ThreadStateCluster({ task, owners, unread, t }) {
10523
+ function ThreadStateCluster({ task, owners, unread, human, t }) {
9517
10524
  if (task === void 0 && unread === 0) return null;
10525
+ const namedOwners = namedAvatarOwners(owners, human);
9518
10526
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
9519
10527
  className: conversation_module_css_default.stateCluster,
9520
10528
  children: [
9521
10529
  task !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamAvatarStack, {
9522
- owners,
9523
- label: claimersLabel(owners, t)
10530
+ owners: namedOwners,
10531
+ label: claimersLabel(namedOwners, t),
10532
+ human
9524
10533
  }),
9525
10534
  task !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamStateDot, {
9526
10535
  size: 8,
@@ -9538,16 +10547,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9538
10547
  * The gate under one top-level Message: the single row that opens its Thread,
9539
10548
  * and the one line that says what stands there. State leads it, then what the
9540
10549
  * entry is: a Task entry keeps its number so the status word never floats free
9541
- * of the Task it describes, follow-up activity adds when the work last moved,
9542
- * and an unanswered Thread says only 回复. The instant uses the Inbox's own
9543
- * 今天/昨天 form with the precise local time on the control's title, and an
9544
- * unread Thread says so in the control's label rather than only in pixels.
10550
+ * of the Task it describes, follow-up activity adds when the work last moved —
10551
+ * while the work is still unfinished — and an unanswered Thread says only 回复.
10552
+ * The instant uses the Inbox's own 今天/昨天 form with the precise local time on
10553
+ * the control's title, and an unread Thread says so in the control's label
10554
+ * rather than only in pixels.
9545
10555
  */
9546
- function ThreadEntryRow({ item, owners, unread, t, onOpen }) {
10556
+ function ThreadEntryRow({ item, owners, unread, human, t, onOpen }) {
9547
10557
  const taskNumber = item.taskNumber;
9548
10558
  const followUp = followUpAt(item);
10559
+ const printedActivity = printedActivityAt(item);
9549
10560
  const label = taskNumber !== void 0 ? t("taskLabel", { number: taskNumber }) : followUp === void 0 ? t("replyAction") : t("threadLabel");
9550
- const text = followUp === void 0 ? label : `${label} · ${t("recentActivity", { time: formatInboxTime(followUp, t) })}`;
10561
+ const text = printedActivity === void 0 ? label : `${label} · ${t("recentActivity", { time: formatInboxTime(printedActivity, t) })}`;
9551
10562
  const openLabel = taskNumber === void 0 ? unread > 0 ? t("openThreadUnread", { count: unread }) : t("openThread") : unread > 0 ? t("openTaskUnread", {
9552
10563
  number: taskNumber,
9553
10564
  count: unread
@@ -9559,6 +10570,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9559
10570
  task: item.task,
9560
10571
  owners,
9561
10572
  unread,
10573
+ human,
9562
10574
  t
9563
10575
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
9564
10576
  type: "button",
@@ -9576,7 +10588,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9576
10588
  }
9577
10589
  //#endregion
9578
10590
  //#region \0dsh-css:/home/yu/projects/dsh-agent-team/packages/client-agent-team/src/client/inbox.module.css.mjs
9579
- const css$1 = ".s2ibaa_list{flex-direction:column;gap:2px;display:flex}.s2ibaa_headerMeta{font-variant-numeric:tabular-nums;flex-wrap:wrap;align-items:baseline;gap:0 10px;display:flex;overflow:hidden}.s2ibaa_headerUnread{color:var(--dsw-alias-label-primary);font-weight:600}.s2ibaa_row{color:inherit;cursor:pointer;font:inherit;text-align:left;background:0 0;border:0;border-radius:8px;grid-template-columns:max-content minmax(0,1fr);align-items:baseline;gap:1px 8px;width:100%;padding:8px;display:grid}.s2ibaa_row:hover,.s2ibaa_row:focus-visible{--team-mark-ring:var(--dsw-alias-interactive-bg-hover);background:var(--dsw-alias-interactive-bg-hover)}.s2ibaa_row:focus-visible{outline:2px solid var(--dsw-alias-label-primary);outline-offset:-2px}.s2ibaa_rowActor{grid-area:1/1;display:flex}.s2ibaa_rowLine{grid-area:1/2;align-items:baseline;gap:2px 8px;min-width:0;display:flex;container-type:inline-size}.s2ibaa_rowCrumb{text-overflow:ellipsis;white-space:nowrap;flex:auto;min-width:0;font-size:13px;line-height:20px;overflow:hidden}.s2ibaa_rowWorkspace{color:var(--dsw-alias-label-tertiary);font-size:12px}.s2ibaa_rowChannel{color:var(--dsw-alias-label-primary);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;flex:none;margin-left:3px;padding:0 5px;font-size:11px;font-weight:600;line-height:15px}.s2ibaa_rowTime{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;white-space:nowrap;flex:none;font-size:11px;line-height:18px}@container (width<=70px){.s2ibaa_rowTime{display:none}}.s2ibaa_rowPreview{color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;grid-area:2/2;min-width:0;font-size:13px;line-height:20px;overflow:hidden}.s2ibaa_section{flex-direction:column;display:flex}.s2ibaa_section+.s2ibaa_section{margin-top:20px}.s2ibaa_sectionTitle{color:var(--dsw-alias-label-tertiary);margin:0 0 4px;padding:0 8px 0 34px;font-size:12px;font-weight:600;line-height:18px}.s2ibaa_sectionCount{font-variant-numeric:tabular-nums;margin-left:6px}";
10591
+ const css$1 = ".s2ibaa_list{flex-direction:column;gap:2px;display:flex}.s2ibaa_headerMeta{font-variant-numeric:tabular-nums;flex-wrap:wrap;align-items:baseline;gap:0 10px;display:flex;overflow:hidden}.s2ibaa_headerUnread{color:var(--dsw-alias-label-primary);font-weight:600}.s2ibaa_row{color:inherit;cursor:pointer;font:inherit;text-align:left;background:0 0;border:0;border-radius:8px;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:1px 8px;width:100%;padding:8px;display:grid}.s2ibaa_row:hover,.s2ibaa_row:focus-visible{--team-mark-ring:var(--dsw-alias-interactive-bg-hover);background:var(--dsw-alias-interactive-bg-hover)}.s2ibaa_row:focus-visible{outline:2px solid var(--dsw-alias-label-primary);outline-offset:-2px}.s2ibaa_rowActor{grid-area:1/1;display:flex}.s2ibaa_rowLine{grid-area:1/2;align-items:baseline;gap:2px 8px;min-width:0;display:flex;container-type:inline-size}.s2ibaa_rowCrumb{text-overflow:ellipsis;white-space:nowrap;flex:auto;min-width:0;font-size:13px;line-height:20px;overflow:hidden}.s2ibaa_rowWorkspace{color:var(--dsw-alias-label-tertiary);font-size:12px}.s2ibaa_rowChannel{color:var(--dsw-alias-label-primary);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;flex:none;margin-left:3px;padding:0 5px;font-size:11px;font-weight:600;line-height:15px}.s2ibaa_rowTime{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;white-space:nowrap;flex:none;font-size:11px;line-height:18px}@container (width<=70px){.s2ibaa_rowTime{display:none}}.s2ibaa_rowPreview{color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;grid-area:2/2;min-width:0;font-size:13px;line-height:20px;overflow:hidden}.s2ibaa_section{flex-direction:column;display:flex}.s2ibaa_section+.s2ibaa_section{margin-top:20px}.s2ibaa_sectionTitle{color:var(--dsw-alias-label-tertiary);margin:0 0 4px;padding:0 8px 0 34px;font-size:12px;font-weight:600;line-height:18px}.s2ibaa_sectionCount{font-variant-numeric:tabular-nums;margin-left:6px}";
9580
10592
  const tagId$1 = "@wowyuarm/dsh-agent-team/inbox.module.css";
9581
10593
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
9582
10594
  const tag = document.createElement("style");
@@ -9636,10 +10648,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9636
10648
  * holding unread is only ever in the queue: the Host already excludes it from
9637
10649
  * the tail, and this page never re-derives that judgement.
9638
10650
  */
9639
- function TeamInboxPage({ useWorkspaces, loadInbox, subscribeChanges, selectWorkspace, selectThread, t }) {
10651
+ function TeamInboxPage({ useWorkspaces, loadInbox, subscribeChanges, selectWorkspace, selectThread, humanName, humanAvatarUrl, t }) {
9640
10652
  const workspaces = useWorkspaces((state) => state.items);
9641
10653
  const [rows, setRows] = (0, react.useState)();
9642
10654
  const [recentRows, setRecentRows] = (0, react.useState)([]);
10655
+ const [humanMemberId, setHumanMemberId] = (0, react.useState)();
9643
10656
  const [loading, setLoading] = (0, react.useState)(true);
9644
10657
  const [error, setError] = (0, react.useState)();
9645
10658
  const loadedRef = (0, react.useRef)(false);
@@ -9655,13 +10668,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9655
10668
  workspaceId: workspace.workspaceId,
9656
10669
  workspaceTitle: workspace.title,
9657
10670
  items: result.value.items,
9658
- recent: result.value.recent
10671
+ recent: result.value.recent,
10672
+ humanMemberId: result.value.humanMemberId
9659
10673
  } : {
9660
10674
  ok: false,
9661
10675
  message: result.error.message
9662
10676
  };
9663
10677
  }));
9664
10678
  const failure = results.find((result) => !result.ok);
10679
+ setHumanMemberId(results.find((result) => result.ok)?.humanMemberId);
9665
10680
  const asRows = (items, workspaceId, workspaceTitle) => items.map((item) => ({
9666
10681
  workspaceId,
9667
10682
  workspaceTitle,
@@ -9693,6 +10708,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9693
10708
  for (const row of rows ?? []) shownWorkspaces.add(row.workspaceTitle);
9694
10709
  for (const row of recentRows) shownWorkspaces.add(row.workspaceTitle);
9695
10710
  const showWorkspace = shownWorkspaces.size > 1;
10711
+ const human = humanMemberId === void 0 ? void 0 : {
10712
+ memberId: humanMemberId,
10713
+ name: humanName,
10714
+ ...humanAvatarUrl === void 0 ? {} : { avatarUrl: humanAvatarUrl }
10715
+ };
9696
10716
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("main", {
9697
10717
  className: conversation_module_css_default.surface,
9698
10718
  "data-team-inbox": true,
@@ -9762,6 +10782,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9762
10782
  row,
9763
10783
  t,
9764
10784
  showWorkspace,
10785
+ human,
9765
10786
  onOpen: () => {
9766
10787
  open(row);
9767
10788
  }
@@ -9781,6 +10802,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9781
10802
  row,
9782
10803
  t,
9783
10804
  showWorkspace,
10805
+ human,
9784
10806
  onOpen: () => {
9785
10807
  open(row);
9786
10808
  }
@@ -9819,10 +10841,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9819
10841
  * because a second visible count beside the first would cost the row the one
9820
10842
  * thing it needs to stay scannable.
9821
10843
  */
9822
- function InboxQueueRow({ row, t, showWorkspace, onOpen }) {
10844
+ function InboxQueueRow({ row, t, showWorkspace, human, onOpen }) {
9823
10845
  const { item } = row;
9824
10846
  const actor = item.newestActor;
9825
10847
  const owners = item.claimOwners;
10848
+ const namedOwners = namedAvatarOwners(owners, human);
10849
+ const namedActor = namedAvatarOwners([actor], human)[0];
9826
10850
  const named = item.directCount > 0;
9827
10851
  const countLabel = named ? t("inboxRowUnreadMentions", {
9828
10852
  count: item.unreadCount,
@@ -9837,11 +10861,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9837
10861
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
9838
10862
  className: inbox_module_css_default.rowActor,
9839
10863
  children: owners.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamAvatarStack, {
9840
- owners,
9841
- label: claimersLabel(owners, t)
10864
+ owners: namedOwners,
10865
+ label: claimersLabel(namedOwners, t),
10866
+ human
9842
10867
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamAvatarStack, {
9843
- owners: [actor],
9844
- label: t("inboxRowActor", { name: `@${actor.name}` })
10868
+ owners: [namedActor],
10869
+ label: t("inboxRowActor", { name: `@${namedActor.name}` }),
10870
+ human
9845
10871
  })
9846
10872
  }),
9847
10873
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
@@ -9908,10 +10934,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9908
10934
  * what keeps a memoized row from re-rendering on every refresh.
9909
10935
  */
9910
10936
  const mentionNamesCache = /* @__PURE__ */ new WeakMap();
9911
- function stableMentionNames(mentions, handles) {
9912
- const names = mentionNamesOf(mentions, handles);
10937
+ function stableMentionNames(mentions, handles, humanName) {
10938
+ const names = mentionNamesOf(mentions, handles, humanName);
9913
10939
  const cached = mentionNamesCache.get(mentions);
9914
- if (cached !== void 0 && cached.length === names.length && cached.every((name, index) => name === names[index])) return cached;
10940
+ if (cached !== void 0 && cached.length === names.length && cached.every((name, index) => mentionNameOf(name) === mentionNameOf(names[index]))) return cached;
9915
10941
  mentionNamesCache.set(mentions, names);
9916
10942
  return names;
9917
10943
  }
@@ -9927,7 +10953,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9927
10953
  return new Map(facts.map((fact) => [factKey(fact.fact), fact]));
9928
10954
  }
9929
10955
  function TeamThreadPage(props) {
9930
- const { workspaceId, channelRef, taskRef, threadRef, taskNumber, backToWorkspace, selectChannel, selectThread, resolveTaskRefs, putAttachment, loadChannels, readThread, loadThreadHistory, threadObservations, subscribeChanges, loadMembers, drafts, getAttachment, reply, changeTask, promoteThread, t } = props;
10956
+ const { workspaceId, humanName, humanAvatarUrl, channelRef, taskRef, threadRef, taskNumber, backToWorkspace, selectChannel, selectThread, resolveTaskRefs, resolveThreadRefs, openMemberSession, putAttachment, loadChannels, readThread, loadThreadHistory, threadObservations, subscribeChanges, loadMembers, drafts, getAttachment, reply, changeTask, promoteThread, t } = props;
9931
10957
  const threadRequest = {
9932
10958
  threadRef,
9933
10959
  ...taskRef === void 0 ? {} : { taskRef }
@@ -10263,7 +11289,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10263
11289
  metadata
10264
11290
  ]);
10265
11291
  const memberName = (memberId) => {
10266
- if (memberId === channelView?.humanMemberId) return t("human");
11292
+ if (memberId === channelView?.humanMemberId) return humanName;
10267
11293
  const status = members.find((candidate) => candidate.member.memberId === memberId);
10268
11294
  return status === void 0 ? t("memberUnknown") : `@${status.member.handle}`;
10269
11295
  };
@@ -10275,18 +11301,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10275
11301
  return;
10276
11302
  }
10277
11303
  if (ref.startsWith("thread:") && ref !== threadRef) {
10278
- loadChannels({
10279
- workspaceId,
10280
- threadRef: ref,
10281
- includeActivities: false,
10282
- limit: 1
10283
- }).then((result) => {
10284
- if (!result.ok) return;
10285
- const target = result.value.items[0];
10286
- if (target === void 0) return;
10287
- const targetChannel = result.value.channels.find((channel) => channel.channelRef === target.message.channelRef);
10288
- if (targetChannel !== void 0) selectThread(target.thread.threadRef, targetChannel.channelRef, target.task?.taskRef, target.taskNumber);
10289
- });
11304
+ jumpToThread(resolveThreadRefs, workspaceId, ref, selectThread);
10290
11305
  return;
10291
11306
  }
10292
11307
  if (ref.startsWith("task:") && ref !== taskRef) jumpToTaskThread(resolveTaskRefs, workspaceId, ref, selectThread);
@@ -10297,26 +11312,46 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10297
11312
  workspaceId,
10298
11313
  selectChannel,
10299
11314
  selectThread,
10300
- loadChannels,
10301
- resolveTaskRefs
11315
+ resolveTaskRefs,
11316
+ resolveThreadRefs
10302
11317
  ]);
10303
11318
  const lookupTaskRefs = (0, react.useMemo)(() => hostTaskRefLookup(resolveTaskRefs, workspaceId), [resolveTaskRefs, workspaceId]);
11319
+ const lookupThreadRefs = (0, react.useMemo)(() => hostThreadRefLookup(resolveThreadRefs, workspaceId), [resolveThreadRefs, workspaceId]);
11320
+ const rosterKey = (0, react.useMemo)(() => [
11321
+ (channelView?.channels ?? []).map((channel) => `${channel.channelRef}=${channel.name}=${channel.state}`).join(","),
11322
+ members.map((status) => `${status.member.memberId}=${status.member.handle}=${status.member.sessionId}=${status.availability}`).join(","),
11323
+ channelView?.humanMemberId ?? ""
11324
+ ].join(";"), [channelView, members]);
11325
+ const channelNameOf = (0, react.useMemo)(() => {
11326
+ const channels = channelView?.channels ?? [];
11327
+ return (ref) => rosterChannelName(channels, ref);
11328
+ }, [rosterKey]);
11329
+ const memberOf = (0, react.useMemo)(() => {
11330
+ const humanMemberId = channelView?.humanMemberId;
11331
+ return (ref) => rosterMember(members, humanMemberId, humanName, ref);
11332
+ }, [rosterKey, humanName]);
10304
11333
  const renderFact = (fact, grouped = false) => {
10305
11334
  if (fact.kind === "message") {
10306
11335
  const sender = memberName(fact.message.sender);
10307
11336
  const senderStatus = members.find((candidate) => candidate.member.memberId === fact.message.sender);
11337
+ const human = fact.message.sender === channelView?.humanMemberId;
10308
11338
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamMessage, {
10309
11339
  senderName: sender,
10310
11340
  memberId: fact.message.sender,
10311
- human: fact.message.sender === channelView?.humanMemberId,
11341
+ human,
11342
+ ...human && humanAvatarUrl !== void 0 ? { avatarUrl: humanAvatarUrl } : {},
10312
11343
  body: fact.message.body,
10313
11344
  attachments: fact.message.attachments,
10314
11345
  loadAttachment: getAttachment,
10315
11346
  t,
10316
11347
  occurredAt: fact.message.occurredAt,
10317
- mentionNames: stableMentionNames(fact.mentions, mentionHandlesMap),
11348
+ mentionNames: stableMentionNames(fact.mentions, mentionHandlesMap, humanName),
10318
11349
  onOpenRef: openRef,
10319
11350
  onResolveTaskRefs: lookupTaskRefs,
11351
+ onResolveThreadRefs: lookupThreadRefs,
11352
+ channelNameOf,
11353
+ memberOf,
11354
+ onOpenMemberSession: openMemberSession,
10320
11355
  grouped,
10321
11356
  ...senderStatus === void 0 ? {} : { senderTitle: senderStatus.member.description }
10322
11357
  }, factKey(fact));
@@ -10589,10 +11624,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10589
11624
  const unreadBoundary = unreadIndex >= 0 ? unreadIndex : void 0;
10590
11625
  const risks = taskClaims.filter((claim) => claim.state === "active").flatMap((claim) => {
10591
11626
  const status = members.find((candidate) => candidate.member.memberId === claim.owner);
10592
- return status?.presence === "error" ? [{
11627
+ if (status?.presence !== "error") return [];
11628
+ const risk = formatRiskClass(status, t);
11629
+ const detail = diagnosticText(status);
11630
+ return [{
10593
11631
  claim,
10594
- status
10595
- }] : [];
11632
+ status,
11633
+ ...risk,
11634
+ reason: detail === "" ? t("statusError") : firstSentence(detail),
11635
+ full: detail === "" ? t("statusError") : detail
11636
+ }];
10596
11637
  });
10597
11638
  const backLabel = channelRef === void 0 ? t("backToWorkspace") : t("backToChannel");
10598
11639
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("main", {
@@ -10679,19 +11720,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10679
11720
  risks.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
10680
11721
  className: thread_module_css_default.riskSection,
10681
11722
  "aria-label": t("runtimeRisk"),
10682
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", { children: t("runtimeRisk") }), risks.map(({ claim, status }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
11723
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", { children: t("runtimeRisk") }), risks.map(({ claim, status, label, sentenceKey, reason, full }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
10683
11724
  className: thread_module_css_default.riskRow,
10684
11725
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamPresenceDot, {
10685
11726
  status,
10686
11727
  t
10687
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
10688
- t("runtimeRiskDetail", {
10689
- member: status.member.handle,
10690
- diagnostic: diagnosticText(status) || t("statusError")
10691
- }),
10692
- " · ",
10693
- claim.direction
10694
- ] })]
11728
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
11729
+ title: full,
11730
+ children: [
11731
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", {
11732
+ className: thread_module_css_default.riskClass,
11733
+ children: label
11734
+ }),
11735
+ " · ",
11736
+ t(sentenceKey, { member: status.member.handle }),
11737
+ " — ",
11738
+ reason
11739
+ ]
11740
+ })]
10695
11741
  }, claim.claimRef))]
10696
11742
  }),
10697
11743
  task !== void 0 && thread !== void 0 && (() => {
@@ -10751,7 +11797,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10751
11797
  }), taskClaims.map((claim) => {
10752
11798
  const ownerStatus = members.find((status) => status.member.memberId === claim.owner);
10753
11799
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", {
10754
- className: thread_module_css_default.claimRow,
11800
+ className: `${thread_module_css_default.claimRow}${claim.state === "done" ? ` ${thread_module_css_default.claimRowDone}` : ""}`,
10755
11801
  children: [
10756
11802
  ownerStatus === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamPresenceDot, {
10757
11803
  status: ownerStatus,
@@ -10759,6 +11805,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10759
11805
  }),
10760
11806
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", {
10761
11807
  className: thread_module_css_default.claimOwner,
11808
+ title: memberName(claim.owner),
10762
11809
  children: memberName(claim.owner)
10763
11810
  }),
10764
11811
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
@@ -10896,8 +11943,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10896
11943
  }
10897
11944
  //#endregion
10898
11945
  //#region src/client/TeamConversation.tsx
10899
- 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 }) {
11946
+ function TeamConversation({ t, useWorkspaces, navigation, drafts, humanIdentity, putAttachment, getAttachment, loadChannels, readThread, loadThreadHistory, threadObservations, subscribeChanges, loadMembers, loadInbox, sendMessage, joinChannel, removeChannelMember, reply, changeTask, promoteThread, selectThread, selectChannel, selectWorkspace, backToWorkspace, backToChannels, resolveTaskRefs, resolveThreadRefs, openMemberSession }) {
10900
11947
  const navigationState = (0, react.useSyncExternalStore)(navigation.subscribe, navigation.getSnapshot, navigation.getSnapshot);
11948
+ const identity = useHumanIdentity(humanIdentity);
11949
+ const humanName = identity.name ?? t("human");
10901
11950
  const current = useWorkspaces((state) => state.items).find((workspace) => workspace.workspaceId === navigationState.workspaceId);
10902
11951
  if (navigationState.inbox === true) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamInboxPage, {
10903
11952
  useWorkspaces,
@@ -10905,9 +11954,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10905
11954
  subscribeChanges,
10906
11955
  selectWorkspace,
10907
11956
  selectThread,
11957
+ humanName,
11958
+ ...identity.avatarUrl === void 0 ? {} : { humanAvatarUrl: identity.avatarUrl },
10908
11959
  t
10909
11960
  }, "inbox");
10910
11961
  if (current !== void 0 && navigationState.threadRef !== void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamThreadPage, {
11962
+ humanName,
11963
+ ...identity.avatarUrl === void 0 ? {} : { humanAvatarUrl: identity.avatarUrl },
10911
11964
  workspaceId: current.workspaceId,
10912
11965
  putAttachment,
10913
11966
  threadRef: navigationState.threadRef,
@@ -10915,6 +11968,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10915
11968
  selectChannel,
10916
11969
  selectThread,
10917
11970
  resolveTaskRefs,
11971
+ resolveThreadRefs,
11972
+ openMemberSession,
10918
11973
  ...navigationState.channelRef === void 0 ? {} : { channelRef: navigationState.channelRef },
10919
11974
  ...navigationState.taskRef === void 0 ? {} : { taskRef: navigationState.taskRef },
10920
11975
  ...navigationState.taskNumber === void 0 ? {} : { taskNumber: navigationState.taskNumber },
@@ -10932,6 +11987,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10932
11987
  t
10933
11988
  }, navigationState.threadRef);
10934
11989
  if (current !== void 0 && navigationState.channelRef !== void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TeamChannelPage, {
11990
+ humanName,
11991
+ ...identity.avatarUrl === void 0 ? {} : { humanAvatarUrl: identity.avatarUrl },
10935
11992
  workspaceId: current.workspaceId,
10936
11993
  channelRef: navigationState.channelRef,
10937
11994
  drafts,
@@ -10948,6 +12005,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10948
12005
  selectChannel,
10949
12006
  backToChannels,
10950
12007
  resolveTaskRefs,
12008
+ resolveThreadRefs,
12009
+ openMemberSession,
10951
12010
  t
10952
12011
  }, navigationState.channelRef);
10953
12012
  const welcome = current === void 0 ? {
@@ -11522,30 +12581,79 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11522
12581
  function modelKey(provider, model) {
11523
12582
  return `${provider}\u0000${model}`;
11524
12583
  }
12584
+ const modelCatalogCaches = /* @__PURE__ */ new WeakMap();
12585
+ function peekCatalogGroups(loadModels) {
12586
+ return modelCatalogCaches.get(loadModels)?.value?.groups;
12587
+ }
12588
+ function sharedCatalog(loadModels) {
12589
+ const cached = modelCatalogCaches.get(loadModels);
12590
+ if (cached?.inflight !== void 0) return cached.inflight;
12591
+ const next = loadModels();
12592
+ const entry = cached ?? {};
12593
+ entry.inflight = next;
12594
+ modelCatalogCaches.set(loadModels, entry);
12595
+ const forget = (result) => {
12596
+ if (modelCatalogCaches.get(loadModels) === entry && entry.inflight === next) {
12597
+ delete entry.inflight;
12598
+ if (result !== void 0 && result.ok) entry.value = result.value;
12599
+ }
12600
+ };
12601
+ next.then((result) => {
12602
+ forget(result);
12603
+ }, () => {
12604
+ forget(void 0);
12605
+ });
12606
+ return next;
12607
+ }
12608
+ /**
12609
+ * Best-effort warm of the shared catalog (the agents panel calls this while
12610
+ * the roster loads, so the pickers open with rows instead of paying the
12611
+ * first read on open). Failures belong to the picker's own error surface.
12612
+ */
12613
+ function warmModelCatalog(loadModels) {
12614
+ try {
12615
+ sharedCatalog(loadModels).catch(() => {});
12616
+ } catch {}
12617
+ }
11525
12618
  /**
11526
12619
  * Shared provider/model dropdown for the create and edit forms. The option
11527
12620
  * list rides the shared Menu primitive (one leading "follow Host default"
11528
12621
  * row, then non-selectable provider headings) with a capped, internally
11529
- * scrolling card so growing model catalogs cannot stretch the dialog.
12622
+ * scrolling card so growing model catalogs cannot stretch the dialog. Mounts
12623
+ * open with the warmed value when one exists and revalidate behind it, so a
12624
+ * slow Host read delays a refresh — never the picker itself; a refused or
12625
+ * failed read with no warmed value renders a retryable error instead of
12626
+ * stranding the field on "loading".
11530
12627
  */
11531
12628
  function ModelPickerField({ model, onModelChange, loadModels, disabled, t }) {
11532
- const [groups, setGroups] = (0, react.useState)();
12629
+ const [groups, setGroups] = (0, react.useState)(() => peekCatalogGroups(loadModels));
11533
12630
  const [modelsError, setModelsError] = (0, react.useState)();
12631
+ const [reloadToken, setReloadToken] = (0, react.useState)(0);
11534
12632
  const [open, setModelOpen] = (0, react.useState)(false);
11535
12633
  const [effortOpen, setEffortOpen] = (0, react.useState)(false);
11536
12634
  (0, react.useEffect)(() => {
11537
12635
  let mounted = true;
11538
- loadModels().then((result) => {
12636
+ let pending;
12637
+ try {
12638
+ pending = sharedCatalog(loadModels);
12639
+ } catch (error) {
12640
+ setModelsError(error instanceof Error ? error.message : String(error));
12641
+ return;
12642
+ }
12643
+ pending.then((result) => {
11539
12644
  if (!mounted) return;
11540
12645
  if (result.ok) {
11541
12646
  setGroups(result.value.groups);
11542
12647
  setModelsError(void 0);
11543
12648
  } else setModelsError(result.error.message);
12649
+ }, (error) => {
12650
+ if (!mounted) return;
12651
+ setModelsError(error instanceof Error ? error.message : String(error));
11544
12652
  });
11545
12653
  return () => {
11546
12654
  mounted = false;
11547
12655
  };
11548
- }, [loadModels]);
12656
+ }, [loadModels, reloadToken]);
11549
12657
  const items = [{
11550
12658
  id: "",
11551
12659
  label: t("modelFollowDefault")
@@ -11591,9 +12699,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11591
12699
  className: sidebar_module_css_default.editHint,
11592
12700
  children: t("modelsLoading")
11593
12701
  }),
11594
- modelsError !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", {
12702
+ modelsError !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
11595
12703
  className: sidebar_module_css_default.editHint,
11596
- children: t("modelsLoadFailed", { message: modelsError })
12704
+ children: [
12705
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
12706
+ role: "alert",
12707
+ children: t("modelsLoadFailed", { message: modelsError })
12708
+ }),
12709
+ " ",
12710
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
12711
+ size: "sm",
12712
+ variant: "outline",
12713
+ disabled,
12714
+ onClick: () => {
12715
+ setModelsError(void 0);
12716
+ setReloadToken((token) => token + 1);
12717
+ },
12718
+ children: t("retry")
12719
+ })
12720
+ ]
11597
12721
  }),
11598
12722
  groups !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Menu, {
11599
12723
  open,
@@ -11966,6 +13090,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11966
13090
  (0, react.useEffect)(() => {
11967
13091
  refresh();
11968
13092
  }, [refresh]);
13093
+ (0, react.useEffect)(() => {
13094
+ warmModelCatalog(loadModels);
13095
+ }, [loadModels]);
11969
13096
  (0, react.useEffect)(() => subscribeChanges({
11970
13097
  kind: "workspace",
11971
13098
  workspaceId
@@ -12011,7 +13138,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12011
13138
  if (result.ok) {
12012
13139
  const committed = {
12013
13140
  ...result.value.status,
12014
- workspaceIds: [result.value.status.member.workspaceId]
13141
+ workspaceIds: result.value.workspaceIds
12015
13142
  };
12016
13143
  setMembers((current) => {
12017
13144
  const retained = current.filter((status) => status.member.memberId !== committed.member.memberId);
@@ -13279,6 +14406,28 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13279
14406
  timelineLabel: "消息时间线",
13280
14407
  taskClosedNotice: "任务已关闭,重新打开后可继续讨论",
13281
14408
  human: "Human",
14409
+ humanSettingsNav: "我的资料",
14410
+ humanSettingsTitle: "我的资料",
14411
+ humanSettingsIntro: "这是 Agent Team 的资料页:名字用在 Team 的消息与成员列表里,头像出现在你发出的消息旁。",
14412
+ humanSettingsName: "名字",
14413
+ humanSettingsNameHint: "Agents 用这个名字 @ 到你;改名只对之后的消息生效。",
14414
+ humanSettingsNameEmpty: "名字不能为空。",
14415
+ humanSettingsNameFailed: "名字没保存上:{message}",
14416
+ humanSettingsAvatar: "头像",
14417
+ humanSettingsAvatarHint: "只收图片,最大 10MB;移除或损坏时回退为默认头像。",
14418
+ humanSettingsSave: "保存",
14419
+ humanSettingsSaving: "正在保存…",
14420
+ humanSettingsUpload: "上传头像",
14421
+ humanSettingsUploading: "正在上传…",
14422
+ humanSettingsReplace: "更换头像",
14423
+ humanSettingsRemoveAvatar: "移除头像",
14424
+ humanSettingsAvatarNotImage: "只收图片文件。",
14425
+ humanSettingsAvatarTooLarge: "图片不能超过 10MB。",
14426
+ humanSettingsAvatarFailed: "头像没能保存:{message}",
14427
+ humanSettingsLoading: "正在载入资料…",
14428
+ humanSettingsUnavailable: "资料读不出来:{message}",
14429
+ humanSettingsVersion: "版本 {version}",
14430
+ humanSettingsUpdateAvailable: "有新版本 {version},去查看发布说明",
13282
14431
  taskStatusTodo: "待处理",
13283
14432
  taskStatusInProgress: "进行中",
13284
14433
  taskStatusInReview: "待验收",
@@ -13291,6 +14440,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13291
14440
  openTaskUnread: "打开 Task #{number}({count} 条新动态)",
13292
14441
  openThreadUnread: "打开讨论({count} 条新动态)",
13293
14442
  threadLabel: "讨论",
14443
+ channelLabel: "频道 · {name}",
14444
+ memberLabel: "成员 · @{name}",
13294
14445
  recentActivity: "最近活动 {time}",
13295
14446
  replyAction: "回复",
13296
14447
  claimers: "由 {names} 处理",
@@ -13315,7 +14466,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13315
14466
  autoReadIncomplete: "仍有未读更新未能自动读取",
13316
14467
  olderHistory: "更早历史",
13317
14468
  runtimeRisk: "当前运行风险",
13318
- runtimeRiskDetail: "@{member} 当前不可用:{diagnostic}",
14469
+ riskClassSessionRefused: "会话被拒绝",
14470
+ riskClassSessionUnreadable: "会话不可读",
14471
+ riskClassPresetComposition: "预设装配失败",
14472
+ riskClassRollover: "上下文交接中",
14473
+ riskClassRuntime: "运行时故障",
14474
+ riskClassActivation: "激活失败",
14475
+ riskSessionRefused: "{member} 当前不可用",
14476
+ riskSessionUnreadable: "{member} 的会话无法读取",
14477
+ riskPresetComposition: "{member} 的预设无法装配",
14478
+ riskRollover: "{member} 正在交接上下文",
14479
+ riskRuntime: "{member} 遇到运行时故障",
14480
+ riskActivation: "{member} 激活失败",
13319
14481
  acceptTask: "验收",
13320
14482
  closeTask: "关闭任务",
13321
14483
  reopenTask: "重新打开",
@@ -13456,6 +14618,28 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13456
14618
  timelineLabel: "Message timeline",
13457
14619
  taskClosedNotice: "This task is closed; reopen it to continue the discussion",
13458
14620
  human: "Human",
14621
+ humanSettingsNav: "Profile",
14622
+ humanSettingsTitle: "Profile",
14623
+ humanSettingsIntro: "This is your Agent Team profile: the name applies to Team messages and member lists, and the avatar appears beside your messages.",
14624
+ humanSettingsName: "Name",
14625
+ humanSettingsNameHint: "Agents @ you by this name; a rename applies to later messages only.",
14626
+ humanSettingsNameEmpty: "A name is required.",
14627
+ humanSettingsNameFailed: "The name was not saved: {message}",
14628
+ humanSettingsAvatar: "Avatar",
14629
+ humanSettingsAvatarHint: "Images only, up to 10MB; removing it — or unreadable bytes — falls back to the default avatar.",
14630
+ humanSettingsSave: "Save",
14631
+ humanSettingsSaving: "Saving…",
14632
+ humanSettingsUpload: "Upload avatar",
14633
+ humanSettingsUploading: "Uploading…",
14634
+ humanSettingsReplace: "Replace avatar",
14635
+ humanSettingsRemoveAvatar: "Remove avatar",
14636
+ humanSettingsAvatarNotImage: "Images only.",
14637
+ humanSettingsAvatarTooLarge: "The image must be 10MB or smaller.",
14638
+ humanSettingsAvatarFailed: "The avatar was not saved: {message}",
14639
+ humanSettingsLoading: "Loading profile…",
14640
+ humanSettingsUnavailable: "The profile could not be read: {message}",
14641
+ humanSettingsVersion: "Version {version}",
14642
+ humanSettingsUpdateAvailable: "New version {version} available — see the release notes",
13459
14643
  taskStatusTodo: "To do",
13460
14644
  taskStatusInProgress: "In progress",
13461
14645
  taskStatusInReview: "In review",
@@ -13468,6 +14652,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13468
14652
  openTaskUnread: "Open Task #{number} ({count} new updates)",
13469
14653
  openThreadUnread: "Open thread ({count} new updates)",
13470
14654
  threadLabel: "Thread",
14655
+ channelLabel: "Channel · {name}",
14656
+ memberLabel: "Member · @{name}",
13471
14657
  recentActivity: "Last activity {time}",
13472
14658
  replyAction: "Reply",
13473
14659
  claimers: "Handled by {names}",
@@ -13492,7 +14678,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13492
14678
  autoReadIncomplete: "Some unread updates could not be read automatically",
13493
14679
  olderHistory: "Older history",
13494
14680
  runtimeRisk: "Current runtime risk",
13495
- runtimeRiskDetail: "@{member} is unavailable: {diagnostic}",
14681
+ riskClassSessionRefused: "Session refused",
14682
+ riskClassSessionUnreadable: "Session unreadable",
14683
+ riskClassPresetComposition: "Preset composition failed",
14684
+ riskClassRollover: "Context rollover",
14685
+ riskClassRuntime: "Runtime failure",
14686
+ riskClassActivation: "Activation failed",
14687
+ riskSessionRefused: "{member} is unavailable",
14688
+ riskSessionUnreadable: "{member} has an unreadable Session",
14689
+ riskPresetComposition: "{member} has an uncomposable preset",
14690
+ riskRollover: "{member} is rolling over its context",
14691
+ riskRuntime: "{member} hit a runtime failure",
14692
+ riskActivation: "{member} failed to activate",
13496
14693
  acceptTask: "Accept",
13497
14694
  closeTask: "Close task",
13498
14695
  reopenTask: "Reopen",
@@ -13552,7 +14749,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13552
14749
  * target.
13553
14750
  */
13554
14751
  const openedMemberSessions = /* @__PURE__ */ new WeakMap();
13555
- function registerModeShadow(ctx, navigation, changes, reads, drafts, name, component, extraInject, entryKey) {
14752
+ function registerModeShadow(ctx, navigation, changes, reads, drafts, humanIdentity, name, component, extraInject, entryKey) {
13556
14753
  const openMemberSessionImpl = (sessionId) => {
13557
14754
  const snapshot = navigation.getSnapshot();
13558
14755
  const current = currentMainSessionId(ctx);
@@ -13569,6 +14766,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13569
14766
  subscribeReads: (listener) => reads.subscribe(listener),
13570
14767
  subscribeChanges: (scope, listener) => changes.subscribe(scope, listener),
13571
14768
  drafts,
14769
+ humanIdentity,
13572
14770
  loadMembers: (request) => ctx.remote.agentTeam.members(request),
13573
14771
  joinChannel: (request) => ctx.remote.agentTeam.joinChannel(request),
13574
14772
  removeChannelMember: (request) => ctx.remote.agentTeam.removeChannelMember(request),
@@ -13612,7 +14810,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13612
14810
  reply: (request) => ctx.remote.agentTeam.reply(request),
13613
14811
  changeTask: (request) => ctx.remote.agentTeam.changeTask(request),
13614
14812
  promoteThread: (request) => ctx.remote.agentTeam.promoteThread(request),
13615
- resolveTaskRefs: (request) => ctx.remote.agentTeam.resolveTaskRefs(request)
14813
+ resolveTaskRefs: (request) => ctx.remote.agentTeam.resolveTaskRefs(request),
14814
+ resolveThreadRefs: (request) => ctx.remote.agentTeam.resolveThreadRefs(request)
13616
14815
  } : {},
13617
14816
  ...name === "sidebar.workspaces" ? {
13618
14817
  addMember: (request) => ctx.remote.agentTeam.addMember(request),
@@ -13643,9 +14842,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13643
14842
  const disposeNavigation = ctx.reflect.provide("teamNavigation", navigation);
13644
14843
  const drafts = new TeamDraftStore();
13645
14844
  const disposeDrafts = ctx.reflect.provide("teamDrafts", drafts);
14845
+ const humanIdentity = new TeamHumanIdentity({
14846
+ loadProfile: () => ctx.remote.agentTeam.humanProfile({}),
14847
+ loadAvatarUrl: async (avatarRef) => {
14848
+ const result = await ctx.remote.agentTeam.getHumanAvatar({ avatarRef });
14849
+ if (!result.ok || !result.value.mediaType.startsWith("image/")) return null;
14850
+ return `data:${result.value.mediaType};base64,${result.value.bytesBase64}`;
14851
+ }
14852
+ });
13646
14853
  ctx.effect(() => () => {
13647
14854
  navigation.dispose();
13648
14855
  drafts.dispose();
14856
+ humanIdentity.dispose();
13649
14857
  disposeNavigation();
13650
14858
  disposeDrafts();
13651
14859
  }, "agent-team: navigation service");
@@ -13699,9 +14907,43 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13699
14907
  }
13700
14908
  })
13701
14909
  }, TeamFooterAction));
13702
- registerModeShadow(ctx, navigation, changes, reads, drafts, "sidebar.workspaces", TeamWorkspaceBrowser);
13703
- registerModeShadow(ctx, navigation, changes, reads, drafts, "main", TeamConversation, void 0, "conversation");
13704
- registerModeShadow(ctx, navigation, changes, reads, drafts, "sidebar.settings", TeamMembersAction, () => ({ loadMemberGroups }));
14910
+ registerModeShadow(ctx, navigation, changes, reads, drafts, humanIdentity, "sidebar.workspaces", TeamWorkspaceBrowser);
14911
+ registerModeShadow(ctx, navigation, changes, reads, drafts, humanIdentity, "main", TeamConversation, void 0, "conversation");
14912
+ registerModeShadow(ctx, navigation, changes, reads, drafts, humanIdentity, "sidebar.settings", TeamMembersAction, () => ({ loadMemberGroups }));
14913
+ ctx.slots.inject("settings.section", () => ctx.slots.register({
14914
+ name: "settings.section",
14915
+ id: "team-human",
14916
+ order: 5,
14917
+ label: () => ctx.locale.bind(NS)("humanSettingsNav"),
14918
+ locale: NS,
14919
+ inject: () => ({
14920
+ identity: humanIdentity,
14921
+ saveName: async (name) => {
14922
+ const saved = await ctx.remote.agentTeam.setHumanProfile({ name });
14923
+ if (!saved.ok) return saved.error.message;
14924
+ await humanIdentity.refresh();
14925
+ },
14926
+ uploadAvatar: async (file) => {
14927
+ const put = await ctx.remote.agentTeam.putHumanAvatar({
14928
+ name: file.name,
14929
+ ...file.type === "" ? {} : { mediaType: file.type },
14930
+ bytesBase64: bytesToBase64(new Uint8Array(await file.arrayBuffer()))
14931
+ });
14932
+ if (!put.ok) return put.error.message;
14933
+ const saved = await ctx.remote.agentTeam.setHumanProfile({ avatarRef: put.value.avatarRef });
14934
+ if (!saved.ok) return saved.error.message;
14935
+ await humanIdentity.refresh();
14936
+ },
14937
+ removeAvatar: async () => {
14938
+ const { avatarRef } = humanIdentity.getSnapshot();
14939
+ if (avatarRef === void 0) return void 0;
14940
+ await ctx.remote.agentTeam.removeHumanAvatar({ avatarRef });
14941
+ const cleared = await ctx.remote.agentTeam.setHumanProfile({ avatarRef: null });
14942
+ if (!cleared.ok) return cleared.error.message;
14943
+ await humanIdentity.refresh();
14944
+ }
14945
+ })
14946
+ }, HumanSettingsSection));
13705
14947
  }
13706
14948
  async function apply(ctx) {
13707
14949
  const disposeRemote = await ctx.remote.$mount(TYPERT_REMOTE);