@songsid/agend 2.4.0-beta.22 → 2.4.0-beta.23

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 (172) hide show
  1. package/dist/agent-whats-new.js +6 -0
  2. package/dist/agent-whats-new.js.map +1 -1
  3. package/dist/auth-api.d.ts +2 -0
  4. package/dist/auth-api.js +5 -2
  5. package/dist/auth-api.js.map +1 -1
  6. package/dist/authority/web-authority.d.ts +17 -3
  7. package/dist/authority/web-authority.js +56 -3
  8. package/dist/authority/web-authority.js.map +1 -1
  9. package/dist/build-provenance.json +1 -1
  10. package/dist/channel/mcp-tools.js +8 -1
  11. package/dist/channel/mcp-tools.js.map +1 -1
  12. package/dist/classic-channel-manager.d.ts +1 -1
  13. package/dist/classic-channel-manager.js +2 -2
  14. package/dist/classic-channel-manager.js.map +1 -1
  15. package/dist/contact-auth-api.js +3 -1
  16. package/dist/contact-auth-api.js.map +1 -1
  17. package/dist/contact-auth-service.js +1 -1
  18. package/dist/contact-auth-service.js.map +1 -1
  19. package/dist/contact-auth-store.d.ts +28 -2
  20. package/dist/contact-auth-store.js +72 -4
  21. package/dist/contact-auth-store.js.map +1 -1
  22. package/dist/contact-change-proposals.d.ts +18 -1
  23. package/dist/contact-change-proposals.js +38 -4
  24. package/dist/contact-change-proposals.js.map +1 -1
  25. package/dist/contact-state-view.d.ts +103 -0
  26. package/dist/contact-state-view.js +80 -0
  27. package/dist/contact-state-view.js.map +1 -0
  28. package/dist/fleet-manager.d.ts +143 -15
  29. package/dist/fleet-manager.js +455 -78
  30. package/dist/fleet-manager.js.map +1 -1
  31. package/dist/general-knowledge/skills/admin/SKILL.md +52 -0
  32. package/dist/general-knowledge/skills/concepts/SKILL.md +14 -17
  33. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +6 -3
  34. package/dist/general-knowledge/skills/hub/SKILL.md +6 -1
  35. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +54 -9
  36. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +1 -1
  37. package/dist/general-role.d.ts +1 -1
  38. package/dist/general-role.js +1 -0
  39. package/dist/general-role.js.map +1 -1
  40. package/dist/hub/client.js +6 -1
  41. package/dist/hub/client.js.map +1 -1
  42. package/dist/hub/compose/member.d.ts +2 -1
  43. package/dist/hub/compose/member.js +3 -2
  44. package/dist/hub/compose/member.js.map +1 -1
  45. package/dist/hub/compose/server.js +2 -1
  46. package/dist/hub/compose/server.js.map +1 -1
  47. package/dist/hub/group-policy/resources.d.ts +1 -1
  48. package/dist/hub/http/compose.js +5 -0
  49. package/dist/hub/http/compose.js.map +1 -1
  50. package/dist/hub/protocol.d.ts +21 -0
  51. package/dist/hub/protocol.js +3 -0
  52. package/dist/hub/protocol.js.map +1 -1
  53. package/dist/hub/question-close-model.d.ts +17 -0
  54. package/dist/hub/question-close-model.js +7 -0
  55. package/dist/hub/question-close-model.js.map +1 -0
  56. package/dist/hub/representative.d.ts +5 -0
  57. package/dist/hub/representative.js +51 -1
  58. package/dist/hub/representative.js.map +1 -1
  59. package/dist/hub/rooms/direct-view.js +1 -0
  60. package/dist/hub/rooms/direct-view.js.map +1 -1
  61. package/dist/hub/rooms/types.d.ts +1 -1
  62. package/dist/hub/rooms.d.ts +3 -0
  63. package/dist/hub/rooms.js +27 -1
  64. package/dist/hub/rooms.js.map +1 -1
  65. package/dist/hub/server.js +6 -1
  66. package/dist/hub/server.js.map +1 -1
  67. package/dist/hub/types.d.ts +2 -2
  68. package/dist/human-delivery-receipts.d.ts +12 -2
  69. package/dist/human-delivery-receipts.js +19 -4
  70. package/dist/human-delivery-receipts.js.map +1 -1
  71. package/dist/instructions.d.ts +1 -1
  72. package/dist/instructions.js +1 -1
  73. package/dist/instructions.js.map +1 -1
  74. package/dist/locale.js +100 -12
  75. package/dist/locale.js.map +1 -1
  76. package/dist/needs-you.d.ts +2 -0
  77. package/dist/needs-you.js +2 -1
  78. package/dist/needs-you.js.map +1 -1
  79. package/dist/office-share-page.js +1 -1
  80. package/dist/office-share-page.js.map +1 -1
  81. package/dist/outbound-handlers.d.ts +4 -0
  82. package/dist/outbound-handlers.js +40 -5
  83. package/dist/outbound-handlers.js.map +1 -1
  84. package/dist/outbound-schemas.d.ts +2 -1
  85. package/dist/outbound-schemas.js +3 -2
  86. package/dist/outbound-schemas.js.map +1 -1
  87. package/dist/public-web-gateway.js +18 -0
  88. package/dist/public-web-gateway.js.map +1 -1
  89. package/dist/reply-buttons-controller.d.ts +2 -1
  90. package/dist/reply-buttons-controller.js +1 -1
  91. package/dist/reply-buttons-controller.js.map +1 -1
  92. package/dist/tool-permissions.js +1 -1
  93. package/dist/tool-permissions.js.map +1 -1
  94. package/dist/ui/accounts-keepalive.js +2 -1
  95. package/dist/ui/chat-activity.js +2 -1
  96. package/dist/ui/chat-pins.js +2 -1
  97. package/dist/ui/claude-credentials.js +2 -1
  98. package/dist/ui/contact-auth-strings.js +28 -17
  99. package/dist/ui/contact-authorizations.js +6 -4
  100. package/dist/ui/contact-needs.js +6 -1
  101. package/dist/ui/contact-permissions.js +6 -4
  102. package/dist/ui/contact-tool-groups.js +1 -1
  103. package/dist/ui/contact-verify-need.js +46 -0
  104. package/dist/ui/fleet-cache.js +2 -1
  105. package/dist/ui/fleet-office-skin.js +10 -6
  106. package/dist/ui/fleet-office-zones.js +22 -9
  107. package/dist/ui/fleet-office.js +16 -9
  108. package/dist/ui/fleet-org.js +6 -1
  109. package/dist/ui/fleet-tab-icons.js +19 -0
  110. package/dist/ui/fleet-task-activity.js +2 -1
  111. package/dist/ui/fleet-task-view.js +2 -1
  112. package/dist/ui/fleet-usage.js +2 -1
  113. package/dist/ui/hub-admin-overview.js +2 -1
  114. package/dist/ui/hub-agent-intro.js +2 -1
  115. package/dist/ui/hub-assistant-admin.js +2 -1
  116. package/dist/ui/hub-directory-notices.js +2 -1
  117. package/dist/ui/hub-enrolment-code.js +2 -1
  118. package/dist/ui/hub-my-agents.js +2 -1
  119. package/dist/ui/hub-quick-pairing.js +2 -1
  120. package/dist/ui/hub-role-audit.js +2 -1
  121. package/dist/ui/hub-role-forms.js +3 -2
  122. package/dist/ui/hub-role-view.js +3 -2
  123. package/dist/ui/hub-roles.js +2 -1
  124. package/dist/ui/hub-room-agent-strings.js +2 -1
  125. package/dist/ui/hub-room-list.js +2 -1
  126. package/dist/ui/hub-room-owner-requests.js +2 -1
  127. package/dist/ui/hub-room-pins.js +2 -1
  128. package/dist/ui/hub-room-strings.js +2 -2
  129. package/dist/ui/hub-room-thread.js +1 -1
  130. package/dist/ui/log-row.js +4 -3
  131. package/dist/ui/office-share-dialog.js +2 -1
  132. package/dist/ui/office-share-page.js +2 -1
  133. package/dist/ui/page-share-dialog.js +3 -2
  134. package/dist/ui/panel-chat.js +2 -1
  135. package/dist/ui/panel-details.js +2 -1
  136. package/dist/ui/panel-fleet.js +10 -5
  137. package/dist/ui/panel-hub.js +2 -1
  138. package/dist/ui/panel-needs.js +31 -3
  139. package/dist/ui/panel-notices.js +2 -1
  140. package/dist/ui/panel-runtimes.js +2 -1
  141. package/dist/ui/panel-windows-cli.js +3 -2
  142. package/dist/ui/runtime-cli-install.js +2 -1
  143. package/dist/ui/settings-appearance.js +2 -1
  144. package/dist/ui/settings-guests.js +4 -3
  145. package/dist/ui/settings-hub-member-address.js +2 -1
  146. package/dist/ui/settings-hub-setup.js +2 -1
  147. package/dist/ui/settings-hub-web-address.js +2 -1
  148. package/dist/ui/settings-hub.js +2 -1
  149. package/dist/ui/settings-update.js +2 -1
  150. package/dist/ui/settings-web-authority.js +2 -1
  151. package/dist/ui/shared/agent-sheet.js +2 -1
  152. package/dist/ui/shared/app-session.js +4 -3
  153. package/dist/ui/shared/app-shell.js +6 -2
  154. package/dist/ui/shared/app.css +38 -8
  155. package/dist/ui/shared/chat-time.js +7 -4
  156. package/dist/ui/shared/clock-text.js +57 -0
  157. package/dist/ui/shared/device-roles.js +6 -5
  158. package/dist/ui/shared/instance-nav.js +17 -22
  159. package/dist/ui/shared/usage-dialog.js +2 -1
  160. package/dist/ui/shared/view-strings.js +0 -14
  161. package/dist/ui/shared/web-authorize.js +3 -2
  162. package/dist/ui/subagent-row.js +2 -1
  163. package/dist/web-api.d.ts +15 -2
  164. package/dist/web-api.js +62 -13
  165. package/dist/web-api.js.map +1 -1
  166. package/dist/web-login.d.ts +6 -1
  167. package/dist/web-login.js +8 -3
  168. package/dist/web-login.js.map +1 -1
  169. package/dist/web-session-authorization.d.ts +3 -0
  170. package/dist/web-session-authorization.js +1 -1
  171. package/dist/web-session-authorization.js.map +1 -1
  172. package/package.json +1 -1
@@ -8,6 +8,7 @@ import { confirmDialog } from "/assets/ui-confirm.js";
8
8
  import { Icon } from "/assets/ui-icons.js";
9
9
  import { Skeleton, ErrorState } from "/assets/ui-states.js";
10
10
  import { toast } from "/assets/ui-toast.js";
11
+ import { clockFormat } from "/assets/clock-text.js";
11
12
  register("claudeCredentials", {
12
13
  en: {
13
14
  title: "Connect Claude Code", profile: "Account", default: "Default connection",
@@ -54,7 +55,7 @@ export function credentialRequestState(metadata){
54
55
  return ["needs-replacement","unknown"].includes(metadata.state)?metadata.state:"saved-unverified";
55
56
  }
56
57
  export function credentialStatusText(metadata){const state=credentialRequestState(metadata);return credentialText(state==="verified"?"verified":state==="needs-replacement"?"needsReplacement":state==="unknown"?"requestUnknown":"notChecked");}
57
- export function credentialVerificationTime(metadata){return credentialRequestState(metadata)==="verified"?credentialText("verifiedAt",new Intl.DateTimeFormat(lang()==="zh-TW"?"zh-TW":"en",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(metadata.verifiedAt))):null;}
58
+ export function credentialVerificationTime(metadata){return credentialRequestState(metadata)==="verified"?credentialText("verifiedAt",clockFormat({year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}, lang()==="zh-TW"?"zh-TW":"en").format(new Date(metadata.verifiedAt))):null;}
58
59
  export function credentialRequestHint(metadata){const state=credentialRequestState(metadata);return state==="needs-replacement"?credentialText("authHint"):state==="unknown"?credentialText("requestUnknownHint"):null;}
59
60
 
60
61
  const e=key=>t("claudeCredentialErrors."+key);
@@ -4,20 +4,23 @@
4
4
  * zh-TW (admin is 管理員). A module of its own (namespace contactAuth); imports only app-i18n.
5
5
  */
6
6
  import { register, t, lang } from "/assets/app-i18n.js";
7
+ import { dateTimeText } from "/assets/clock-text.js";
7
8
 
8
9
  register("contactAuth", {
9
10
  en: {
10
11
  tab: "Permissions", lead: "Who may ask this agent to forward requests to other agents, and what this room may use.",
11
12
  loading: "Loading permissions…", loadFailed: "Couldn't load permissions.", retry: "Try again",
12
- forbidden: "Only this agent's managers can see its permissions.", unavailable: "Permissions are unavailable right now. Try again in a moment.",
13
+ forbidden: "Only this agent's managers can see its permissions.",
14
+ verifyFirst: "Permissions and contact requests need a verified administrator. Verify your identity in Sign-in status (Authorize this browser), then try again.",
15
+ unavailable: "Permissions are unavailable right now. Try again in a moment.",
13
16
  stale: "Someone changed these permissions just now. They have been reloaded — check them and try again.",
14
17
  saved: "Saved.", saveFailed: "Couldn't save.", readOnly: "You can see these permissions but not change them.",
15
18
  // Mode (a ClassicBot room)
16
- modeTitle: "Room mode", modeRestricted: "Restricted", modeLegacy: "Not restricted (older setting)",
19
+ modeTitle: "Room mode", modeRestricted: "Restricted", modeLegacy: "Free",
17
20
  modeRestrictedNote: "Requests from people who aren't admins to other agents wait for approval before anything is sent.",
18
- modeLegacyNote: "Requests from this room go to other agents without approval.",
19
- switchRestricted: "Switch to restricted", switchLegacy: "Turn restricted mode off",
20
- confirmRestricted: "Switch this room to restricted mode?", confirmLegacy: "Turn restricted mode off? Requests from this room will go to other agents without approval. Work already handed to another agent stays as it is.",
21
+ modeLegacyNote: "In Free mode, requests from this room go to other agents without approval.",
22
+ switchRestricted: "Switch to restricted", switchLegacy: "Switch to Free",
23
+ confirmRestricted: "Switch this room to restricted mode?", confirmLegacy: "Switch this room to Free? Requests from this room will go to other agents without approval. Work already handed to another agent stays as it is.",
21
24
  wouldDisableTitle: "These tools will stop in this room:", wouldDisableNone: "No tool this room uses now will stop.",
22
25
  // M-3387: what stops, by kind and layer.
23
26
  toolsLostTitle: "AgEnD tools this room loses ({0}):", toolGroupLine: "• {0} ({1})",
@@ -39,9 +42,9 @@ register("contactAuth", {
39
42
  guardTitle: "Command-line guard", guard_ready: "Active", "guard_restart-required": "Restart needed", "guard_not-covered": "Not covered", guard_failed: "Failed",
40
43
  guardNote: "The guard limits what the backend's own tools can do in this room. It is a policy control, not a security boundary on this computer.",
41
44
  notCoveredWarning: "This AI tool or version isn't covered by the guard: it runs with its normal permissions; only contact approval applies.",
42
- newRoomsRestricted: "New ClassicBot rooms start in restricted mode: requests from people who aren't admins to other agents wait for approval. Where the guard doesn't cover a room's AI tool or version, that tool runs with its normal permissions; only contact approval applies.",
45
+ newRoomsRestricted: "At /start you choose Free or Restricted before the room is created. For a fleet admin, Free comes first and is recommended; Restricted is still a choice, and the tap is still required. Anyone else is offered Restricted only. Change it later in the room's Settings → Permissions, or from General's contact-change card. Where the guard doesn't cover a room's AI tool or version, that tool runs with its normal permissions; only contact approval applies.",
43
46
  guardBackend: "Backend: {0}", guardReasonOther: "The guard reported a state this page doesn't know.",
44
- "guardReason_legacy-mode": "This room isn't in restricted mode, so the guard isn't used.",
47
+ "guardReason_legacy-mode": "This room is in Free mode, so the guard isn't used.",
45
48
  "guardReason_unsupported-backend": "This backend isn't covered by the guard.",
46
49
  "guardReason_unsupported-platform": "The guard isn't available on this computer's system.",
47
50
  "guardReason_unsupported-version": "This version of the backend isn't covered by the guard.",
@@ -85,8 +88,11 @@ register("contactAuth", {
85
88
  from: "From {0}", via: "Via {0}", to: "To {0}", origin_unknown: "Origin unknown", origin_mixed: "Earlier non-admin request",
86
89
  "reason_earlier-non-admin": "This agent's retained history includes non-admin input, so this contact needs approval.",
87
90
  "reason_unknown-origin": "This agent's retained history has an unknown origin, so this contact needs approval.",
91
+ "request_reason_earlier-non-admin": "{0}'s retained history includes non-admin input, so this contact needs approval.",
92
+ "request_reason_unknown-origin": "{0}'s retained history has an unknown origin, so this contact needs approval.",
88
93
  // M-3385: under the reason — what an approval leaves as it is, and the one way this agent stops needing approval.
89
- resetNote: "Approving forwards only this request and leaves the receiving agent's origin unchanged. For this agent's contacts to stop needing approval, a managing administrator can clear its retained origin in its Permissions; it never resets on its own.",
94
+ requestRecoveryNote: "Approving forwards only this request and leaves the receiving agent's origin unchanged. To accept {0}'s current conversation as its own work, open {0} → Settings → Permissions and press Clear retained origin. It never resets on its own.",
95
+ resetNote: "Approving forwards only this request and leaves the receiving agent's origin unchanged. To accept the sending agent's current conversation as their own work, a verified managing admin can use its Permissions → Clear retained origin. It never resets on its own.",
90
96
  created: "Asked {0}", expires: "Expires {0}", decided: "{0} by {1}",
91
97
 
92
98
  grantFutureExpiry: "Choose an expiry in the future.", grantValidUses: "Set a use limit from 1 to 10,000, or leave it empty for unlimited uses.",
@@ -136,14 +142,16 @@ register("contactAuth", {
136
142
  "zh-TW": {
137
143
  tab: "權限", lead: "誰可以請這個 Agent 把請求轉交給其他 Agent,以及這個房間可以使用什麼。",
138
144
  loading: "正在載入權限…", loadFailed: "無法載入權限。", retry: "重試",
139
- forbidden: "只有這個 Agent 的管理員可以查看權限。", unavailable: "目前無法取得權限,請稍後再試。",
145
+ forbidden: "只有這個 Agent 的管理員可以查看權限。",
146
+ verifyFirst: "權限和聯絡申請需要已驗證的管理員。請先在「登入狀態」按「授權這個瀏覽器」驗證身分,再試一次。",
147
+ unavailable: "目前無法取得權限,請稍後再試。",
140
148
  stale: "剛才有人修改了這些權限,已重新載入,請確認後再試一次。",
141
149
  saved: "已儲存。", saveFailed: "無法儲存。", readOnly: "你可以查看這些權限,但無法修改。",
142
- modeTitle: "房間模式", modeRestricted: "受限模式", modeLegacy: "未受限(舊設定)",
150
+ modeTitle: "房間模式", modeRestricted: "受限模式", modeLegacy: "自由模式",
143
151
  modeRestrictedNote: "非管理員對其他 Agent 的請求,要先經過核准才會送出。",
144
- modeLegacyNote: "這個房間的請求會直接送給其他 Agent,不需核准。",
145
- switchRestricted: "切換為受限模式", switchLegacy: "關閉受限模式",
146
- confirmRestricted: "要將這個房間切換為受限模式嗎?", confirmLegacy: "要關閉受限模式嗎?這個房間的請求將直接送給其他 Agent,不需核准。已交給其他 Agent 的工作不會因此改變。",
152
+ modeLegacyNote: "自由模式下,這個房間的請求會直接送給其他 Agent,不需核准。",
153
+ switchRestricted: "切換為受限模式", switchLegacy: "切換為自由模式",
154
+ confirmRestricted: "要將這個房間切換為受限模式嗎?", confirmLegacy: "要將這個房間切換為自由模式嗎?這個房間的請求將直接送給其他 Agent,不需核准。已交給其他 Agent 的工作不會因此改變。",
147
155
  wouldDisableTitle: "這個房間將停用下列工具:", wouldDisableNone: "這個房間目前使用的工具都不會停用。",
148
156
  toolsLostTitle: "這個房間會失去的 AgEnD 工具({0} 個):", toolGroupLine: "• {0}({1})",
149
157
  toolGroup_fleet: "Fleet 狀態與設定", toolGroup_agents: "建立、啟動與停止 Agent 和團隊", toolGroup_usage: "用量與紀錄",
@@ -162,9 +170,9 @@ register("contactAuth", {
162
170
  guardTitle: "命令列防護", guard_ready: "已啟用", "guard_restart-required": "需要重新啟動", "guard_not-covered": "未涵蓋", guard_failed: "失敗",
163
171
  guardNote: "防護會限制後端內建工具在這個房間能做的事。這是政策控制,不是這台電腦上的安全邊界。",
164
172
  notCoveredWarning: "這個 AI 工具或版本不在防護範圍內:它會以原本的權限執行,只有聯絡申請需要核准。",
165
- newRoomsRestricted: "新的 ClassicBot 房間預設為受限模式:非管理員對其他 Agent 的請求要先經過核准。若防護不涵蓋房間的 AI 工具或版本,該工具會以原本的權限執行,只有聯絡申請需要核准。",
173
+ newRoomsRestricted: "執行 /start 時,房間建立前要選擇自由模式或受限模式。Fleet 管理員會先看到自由模式(建議),受限模式仍是一個按鈕,仍要點選。其他人只會看到受限模式。之後可在房間的設定 → 權限,或從 General 的聯絡變更卡片更改。若防護不涵蓋房間的 AI 工具或版本,該工具會以原本的權限執行,只有聯絡申請需要核准。",
166
174
  guardBackend: "後端:{0}", guardReasonOther: "防護回報了這個頁面不認得的狀態。",
167
- "guardReason_legacy-mode": "這個房間不是受限模式,因此不使用防護。",
175
+ "guardReason_legacy-mode": "這個房間是自由模式,因此不使用防護。",
168
176
  "guardReason_unsupported-backend": "防護不支援這個後端。",
169
177
  "guardReason_unsupported-platform": "這台電腦的系統無法使用防護。",
170
178
  "guardReason_unsupported-version": "防護不支援這個版本的後端。",
@@ -204,7 +212,10 @@ register("contactAuth", {
204
212
  from: "來自 {0}", via: "經由 {0}", to: "給 {0}", origin_unknown: "來源不明", origin_mixed: "先前有非管理員的請求",
205
213
  "reason_earlier-non-admin": "這個 Agent 保留的歷史含有非管理員輸入,因此這次聯絡需要核准。",
206
214
  "reason_unknown-origin": "這個 Agent 保留的歷史來源不明,因此這次聯絡需要核准。",
207
- resetNote: "核准只會轉交這一筆,接收 Agent 的來源維持原狀。若要讓這個 Agent 之後的聯絡不再需要核准,具管理權限的管理員可以在它的「權限」頁清除保留的來源;來源不會自動重設。",
215
+ "request_reason_earlier-non-admin": "{0} 保留的歷史含有非管理員輸入,因此這次聯絡需要核准。",
216
+ "request_reason_unknown-origin": "{0} 保留的歷史來源不明,因此這次聯絡需要核准。",
217
+ requestRecoveryNote: "核准只會轉交這一筆,接收 Agent 的來源維持原狀。若要接受 {0} 目前的對話作為它自己的工作,請到 {0} 的「設定」→「權限」,按「清除保留的來源」。來源不會自動重設。",
218
+ resetNote: "核准只會轉交這一筆,接收 Agent 的來源維持原狀。若要接受發送 Agent 目前的對話作為自己的工作,管理它的已驗證管理員可以到「權限」→「清除保留的來源」確認。來源不會自動重設。",
208
219
  created: "{0} 提出", expires: "{0} 到期", decided: "{1} 於 {0} 處理",
209
220
 
210
221
  grantFutureExpiry: "請選擇未來的到期時間。", grantValidUses: "請設定 1 至 10,000 次,或留空表示不限次數。",
@@ -253,4 +264,4 @@ export const ca = (k, ...a) => t(`contactAuth.${k}`, ...a);
253
264
 
254
265
  export const contactPlatformLabel = platform => ({ discord: "Discord", telegram: "Telegram" }[platform] || platform);
255
266
  export const contactPersonLabel = person => person?.platform === "host" && person?.userId === "operator" ? ca("operator") : person?.label || person?.userId || "";
256
- export const contactWhen = value => { const d = new Date(value); return Number.isFinite(d.getTime()) ? d.toLocaleString(lang() === "zh-TW" ? "zh-TW" : "en", { dateStyle: "long", timeStyle: "short" }) : ""; };
267
+ export const contactWhen = value => { const d = new Date(value); return Number.isFinite(d.getTime()) ? dateTimeText(d, { dateStyle: "long", timeStyle: "short" }, lang() === "zh-TW" ? "zh-TW" : "en") : ""; };
@@ -18,11 +18,12 @@ import { ContactGrantEditor } from "./contact-grant-editor.js";
18
18
  import { InfoTip } from "/assets/info-tip.js";
19
19
  import { ca } from "./contact-auth-strings.js";
20
20
  import { decideTicket, getTicket, listTickets, personKey, shortTicketId } from "./contact-auth-client.js";
21
+ import { dateTimeText } from "/assets/clock-text.js";
21
22
 
22
23
  // The Fleet tab's own label (panel-fleet.js reads fleet.<tab>).
23
24
  register("fleet", { en: { authorizations: "Authorizations" }, "zh-TW": { authorizations: "授權" } });
24
25
 
25
- const when = (iso) => { const d = new Date(iso); return Number.isFinite(d.getTime()) ? d.toLocaleString([], { dateStyle: "medium", timeStyle: "short" }) : ""; };
26
+ const when = (iso) => { const d = new Date(iso); return Number.isFinite(d.getTime()) ? dateTimeText(d, { dateStyle: "medium", timeStyle: "short" }, []) : ""; };
26
27
  /** The server's reason codes (ContactTicket.reason, ContactPermissions.originRestriction.reason). */
27
28
  export const REASONS = new Set(["earlier-non-admin", "unknown-origin"]);
28
29
  const TONE = { pending: "warn", approved: "ok", delivered: "ok", declined: "bad", expired: "muted", unknown: "bad" };
@@ -51,7 +52,7 @@ export function TicketCard({ ticket, onChange, onPerson, focus = false }) {
51
52
  if (again.ok) onChange?.(again.data);
52
53
  return false;
53
54
  }
54
- toast(ca(r.code === "forbidden" ? "forbidden" : r.code === "unavailable" ? "unavailable" : "decideFailed"), false);
55
+ toast(ca(r.code === "verification-required" ? "verifyFirst" : r.code === "forbidden" ? "forbidden" : r.code === "unavailable" ? "unavailable" : "decideFailed"), false);
55
56
  };
56
57
  const people = tk.origin?.people || [];
57
58
  const grantable = ["human", "mixed"].includes(tk.origin?.kind) && people.length > 0 && people.length <= 16;
@@ -74,7 +75,7 @@ export function TicketCard({ ticket, onChange, onPerson, focus = false }) {
74
75
  <div class="contact-ticket-times"><span class="contact-time-item" title=${ca("created", when(tk.createdAt))}>${ca("created", when(tk.createdAt))}</span>
75
76
  <span class=${`contact-time-item${!tk.decidedAt && st === "pending" && waitMinutes(tk) ? " contact-time-wait" : ""}`} title=${endsText}>${endsText}</span></div>
76
77
  ${st === "delivered" ? html`<p class="note">${ca("deliveryNote")}</p>` : null}
77
- ${REASONS.has(tk.reason) ? html`<p class="note contact-reason" data-reason=${tk.reason}>${ca(`reason_${tk.reason}`)}${st === "pending" ? html`${lang() === "zh-TW" ? "" : " "}${ca("resetNote")}` : null}</p>` : null}
78
+ ${REASONS.has(tk.reason) ? html`<p class="note contact-reason" data-reason=${tk.reason}>${ca(`request_reason_${tk.reason}`, agentLabel(tk.source))}${st === "pending" ? html`${lang() === "zh-TW" ? "" : " "}${ca("requestRecoveryNote", agentLabel(tk.source))}` : null}</p>` : null}
78
79
  </div>
79
80
  ${tk.grantIds?.length ? html`<p><a class="st-link" href=${`${detailsPath(tk.target)}?cat=permissions`}>${ca("grantView")}</a></p>` : null}
80
81
  ${tk.canDecide && st === "pending" ? html`<div class="contact-decide">
@@ -131,7 +132,8 @@ export function ContactAuthorizations() {
131
132
  </div>
132
133
  ${focus ? html`<${TicketCard} ticket=${focus} focus=${true} onChange=${replace} onPerson=${setPerson} />` : null}
133
134
  ${page.loading ? html`<${Skeleton} variant="cards" lines=${2} label=${ca("loading")} />`
134
- : page.error && !page.items.length ? (page.error === "forbidden" ? html`<p class="note">${ca("forbidden")}</p>` : html`<${ErrorState} message=${ca(page.error === "unavailable" ? "unavailable" : "loadFailed")} onRetry=${() => void read()} />`)
135
+ : page.error && !page.items.length ? (page.error === "verification-required" ? html`<p class="note contact-verify">${ca("verifyFirst")}</p>`
136
+ : page.error === "forbidden" ? html`<p class="note">${ca("forbidden")}</p>` : html`<${ErrorState} message=${ca(page.error === "unavailable" ? "unavailable" : "loadFailed")} onRetry=${() => void read()} />`)
135
137
  : !list.length && !focus ? html`<${Empty} icon="key" title=${ca(status === "pending" ? "emptyPending" : "empty")} hint=${ca("emptyHint")} action=${status === "pending" ? html`<button type="button" class="btn btn-sm" onClick=${() => setStatus("all")}>${ca("viewAll")}</button>` : null} />`
136
138
  : html`<div class="contact-ticket-list">${list.map((tk) => html`<${TicketCard} key=${tk.id} ticket=${tk} onChange=${replace} onPerson=${setPerson} />`)}</div>`}
137
139
  ${page.next ? html`<div class="field-row"><button type="button" class="btn btn-sm" onClick=${() => void read(page.next)}>${ca("more")}</button></div>` : null}
@@ -10,6 +10,8 @@
10
10
  import { html, useEffect, useState } from "/assets/app-html.js";
11
11
  import { detailsPath } from "/assets/app-route.js";
12
12
  import { Icon } from "/assets/ui-icons.js";
13
+ import { appStore, useStore } from "/assets/app-store.js";
14
+ import { labelOf } from "/assets/instance-nav.js";
13
15
  import { toast } from "/assets/ui-toast.js";
14
16
  import { confirmDialog } from "/assets/ui-confirm.js";
15
17
  import { ca } from "./contact-auth-strings.js";
@@ -22,12 +24,15 @@ const ID = /^[A-Za-z0-9_-]{1,64}$/;
22
24
  function RequestNeed({ item }) {
23
25
  const ref = item.contactTicket || {};
24
26
  const [tk, setTk] = useState(null);
27
+ // M-3680: the agents by the names the page shows them (the request card below does the same).
28
+ const { instances } = useStore(appStore);
29
+ const agent = (name) => (name ? labelOf((instances || []).find((i) => i.name === name) || { name }) : "");
25
30
  useEffect(() => {
26
31
  let live = true;
27
32
  if (ID.test(String(ref.id || ""))) void getTicket(ref.id).then((r) => { if (live && r.ok) setTk(r.data); });
28
33
  return () => { live = false; };
29
34
  }, [ref.id]);
30
- return html`<div class="n-title"><strong>${ca("needsTitle", ref.source || "", ref.target || "")}</strong></div>
35
+ return html`<div class="n-title"><strong>${ca("needsTitle", agent(ref.source), agent(ref.target))}</strong></div>
31
36
  ${tk ? html`<${TicketCard} ticket=${tk} onChange=${setTk} />` : null}
32
37
  <div class="n-actions">${ID.test(String(ref.id || "")) ? html`<a class="btn btn-sm btn-ghost" href=${`/ui/fleet/authorizations?ticket=${encodeURIComponent(ref.id)}`}>${ca("needsOpen")}</a>` : null}</div>`;
33
38
  }
@@ -19,8 +19,9 @@ import { labelOf } from "/assets/instance-nav.js";
19
19
  import { ContactGrantEditor } from "./contact-grant-editor.js";
20
20
  import { REASONS } from "./contact-authorizations.js";
21
21
  import { groupWouldDisable } from "./contact-tool-groups.js";
22
+ import { dateTimeText } from "/assets/clock-text.js";
22
23
 
23
- const when = (iso) => { const d = new Date(iso); return Number.isFinite(d.getTime()) ? d.toLocaleString([], { dateStyle: "medium", timeStyle: "short" }) : ""; };
24
+ const when = (iso) => { const d = new Date(iso); return Number.isFinite(d.getTime()) ? dateTimeText(d, { dateStyle: "medium", timeStyle: "short" }, []) : ""; };
24
25
  /** A3's guard reason codes (ContactGuardStatus.reason), each said in words (contact-auth-strings.js guardReason_<code>). */
25
26
  const GUARD_REASONS = new Set(["legacy-mode", "unsupported-backend", "unsupported-platform", "unsupported-version", "cli-mode", "load-not-verified", "stale-policy",
26
27
  "stale-launch", "not-running", "invalid-policy", "missing-bound-mcp", "missing-selected-mcp", "guard-files-changed", "invalid-load-receipt", "guard-unavailable", "binary-changed"]);
@@ -105,7 +106,8 @@ export function ContactPermissionsPanel({ name }) {
105
106
  const p = perm.data;
106
107
  useEffect(() => { setEditing(null); }, [name, p?.revision]);
107
108
  if (!p && perm.loading !== false && !perm.error) return html`<${Skeleton} lines=${5} label=${ca("loading")} />`;
108
- if (!p) return perm.error === "forbidden" ? html`<p class="note contact-forbidden">${ca("forbidden")}</p>`
109
+ if (!p) return perm.error === "verification-required" ? html`<p class="note contact-verify">${ca("verifyFirst")}</p>`
110
+ : perm.error === "forbidden" ? html`<p class="note contact-forbidden">${ca("forbidden")}</p>`
109
111
  : html`<${ErrorState} message=${ca(perm.error === "unavailable" ? "unavailable" : "loadFailed")} onRetry=${() => void perm.read()} />`;
110
112
  // Who may change what (the server says; Sentinel's seam): the source room's admins its mode and tools (canSetMode); the
111
113
  // target's approvers its approvers and allowed contacts (canManage).
@@ -119,7 +121,7 @@ export function ContactPermissionsPanel({ name }) {
119
121
  setBusy(false);
120
122
  if (r.ok) { perm.setData(r.data); toast(ca("saved"), true); return true; }
121
123
  if (r.code === "conflict") { await perm.read(); toast(ca("stale"), false); return false; }
122
- toast(ca(r.code === "forbidden" ? "forbidden" : r.code === "unavailable" ? "unavailable" : r.code === "invalid-approver" ? "invalidApprover" : "saveFailed"), false);
124
+ toast(ca(r.code === "verification-required" ? "verifyFirst" : r.code === "forbidden" ? "forbidden" : r.code === "unavailable" ? "unavailable" : r.code === "invalid-approver" ? "invalidApprover" : "saveFailed"), false);
123
125
  return false;
124
126
  };
125
127
  const switchMode = async (mode) => {
@@ -140,7 +142,7 @@ export function ContactPermissionsPanel({ name }) {
140
142
  setBusy(false);
141
143
  if (r.ok) { perm.setData(r.data); toast(ca("originCleared"), true); return; }
142
144
  if (r.code === "conflict") { await perm.read(); toast(ca("stale"), false); return; }
143
- toast(ca(r.code === "forbidden" ? "forbidden" : r.code === "unavailable" ? "unavailable" : "saveFailed"), false);
145
+ toast(ca(r.code === "verification-required" ? "verifyFirst" : r.code === "forbidden" ? "forbidden" : r.code === "unavailable" ? "unavailable" : "saveFailed"), false);
144
146
  };
145
147
  const tools = p.roomTools || { publicRead: false, allowedMcpTools: [], wouldDisable: [] };
146
148
  const setTools = (next) => write({ roomTools: { publicRead: next.publicRead, allowedMcpTools: next.allowedMcpTools } });
@@ -11,7 +11,7 @@
11
11
  /** The kinds of AgEnD tools a restricted room loses, in the order they are shown; each tool in exactly one. */
12
12
  export const TOOL_GROUPS = Object.freeze([
13
13
  { id: "fleet", tools: ["get_fleet_status", "get_fleet_config", "validate_config", "get_effort", "list_models", "kiro_engine_status",
14
- "update_instance_config", "update_fleet_defaults", "migrate_kiro_instance", "reconcile_kiro_instance", "get_web_settings", "set_web_settings", "propose_contact_change"] },
14
+ "update_instance_config", "update_fleet_defaults", "migrate_kiro_instance", "reconcile_kiro_instance", "get_web_settings", "set_web_settings", "propose_contact_change", "contact_state"] },
15
15
  { id: "agents", tools: ["create_instance", "delete_instance", "replace_instance", "start_instance", "stop_instance", "restart_instance",
16
16
  "pause_instance", "wake_instance", "create_team", "update_team", "delete_team"] },
17
17
  { id: "usage", tools: ["get_usage", "get_usage_report", "get_cache_report", "get_instance_logs"] },
@@ -0,0 +1,46 @@
1
+ // M-3710 (R21079937, 11-25: a pending contact request was in no list, not even on this computer). Needs you's line for an
2
+ // admin session with no verified person behind it: how many requests wait (the server sends the count only —
3
+ // reason "contact_verify_needed", contactVerify { count }; never which, who or what), and this browser's own
4
+ // "Authorize this browser" (web-authorize.js: the button, or why it can't be authorized here and where to fix that).
5
+ // Once the account confirms, the server sends Needs you again and the requests themselves replace this line.
6
+ // A module of its own, with its own words (#4447 review): a page still holding an older contact-needs.js or
7
+ // contact-auth-strings.js keeps working and says these words, never their keys.
8
+ import { html } from "/assets/app-html.js";
9
+ import { register, t } from "/assets/app-i18n.js";
10
+ import { Icon } from "/assets/ui-icons.js";
11
+ import { AuthorizeChip } from "/assets/web-authorize.js";
12
+
13
+ register("contactVerifyNeed", {
14
+ en: {
15
+ one: "1 contact request needs a verified browser", many: "{0} contact requests need a verified browser",
16
+ body: "Authorize this browser to see who is asking, and to approve or decline.",
17
+ },
18
+ "zh-TW": {
19
+ one: "有 1 個聯絡申請需要已驗證的瀏覽器", many: "有 {0} 個聯絡申請需要已驗證的瀏覽器",
20
+ body: "授權這個瀏覽器後,才能看到是誰提出,並核准或拒絕。",
21
+ },
22
+ });
23
+ const tv = (k, ...a) => t(`contactVerifyNeed.${k}`, ...a);
24
+ /** The line's title for `count` waiting requests (at least 1). */
25
+ export const verifyNeedTitle = (count) => (count === 1 ? tv("one") : tv("many", count));
26
+ export const verifyNeedBody = () => tv("body");
27
+
28
+ /** A Needs you item that says contact requests wait for a verified browser. */
29
+ export const isContactVerify = (item) => item?.type === "contact" && item.reason === "contact_verify_needed";
30
+ /** How many requests the line stands for: what Needs you's counts add for it (#4447 capture check). */
31
+ export const contactVerifyCount = (item) => Math.max(1, Math.floor(Number(item?.contactVerify?.count) || 1));
32
+
33
+ export function ContactVerifyNeed({ item }) {
34
+ const count = contactVerifyCount(item);
35
+ const title = verifyNeedTitle(count);
36
+ return html`<section class="n-group n-contact-verify" aria-label=${title}>
37
+ <article data-trust="permission" class="n-item contact-need contact-verify-need" data-reason="contact_verify_needed">
38
+ <span class="n-icon"><${Icon} name="key" size=${18} /></span>
39
+ <div class="n-body">
40
+ <div class="n-title"><strong>${title}</strong></div>
41
+ <p class="n-detail">${verifyNeedBody()}</p>
42
+ <${AuthorizeChip} />
43
+ </div>
44
+ </article>
45
+ </section>`;
46
+ }
@@ -8,6 +8,7 @@ import { html } from "/assets/app-html.js";
8
8
  import { t, register } from "/assets/app-i18n.js";
9
9
  import { Empty } from "/assets/ui-states.js";
10
10
  import { Icon } from "/assets/ui-icons.js";
11
+ import { unitText } from "/assets/clock-text.js";
11
12
 
12
13
  register("cache", {
13
14
  en: {
@@ -82,7 +83,7 @@ export function tokens(n) {
82
83
  return String(Math.round(n));
83
84
  }
84
85
  export function bytes(n) { return n >= 1e9 ? `${(n / 1e9).toFixed(1)} GB` : n >= 1e6 ? `${Math.round(n / 1e6)} MB` : `${Math.max(1, Math.round(n / 1e3))} KB`; }
85
- export function ttlText(sec) { return sec >= 3600 ? `${sec / 3600} h` : `${Math.round(sec / 60)} min`; }
86
+ export function ttlText(sec) { return sec >= 3600 ? unitText(sec / 3600, "h") : unitText(Math.round(sec / 60), "min"); }
86
87
  const pct = (x) => `${x >= 0.1 ? Math.round(x * 100) : (x * 100).toFixed(1)}%`;
87
88
 
88
89
  /** The one line under an instance's recommendation. */
@@ -38,7 +38,7 @@
38
38
  // @property {(look, at) => {x, y, w, h}} [charBox] zones: the box drawCharacter covers with the feet at `at`
39
39
  // ({ x, y, walking, heading }): what hover and click hit (fleet-office-zones.js personAt)
40
40
  // @property {(ctx, prop, ms, env) => void} drawProp a traffic item in the air: { kind, hue, x, y, t }
41
- // @property {(ctx, x, y, text, env, lift?) => void} drawBubble a speech bubble whose tail points at (x, y), its box `lift` px higher
41
+ // @property {(ctx, x, y, text, env, lift?, flip?) => void} drawBubble a speech bubble whose tail points at (x, y), its box `lift` px higher (`flip`: on the tail's left)
42
42
  // @property {(env) => string} matte #2540: the colour around the scene (the Office fills the panel; the scene is 16:9)
43
43
  // @property {object|null} [backdrop] a pack's loaded background picture (the page samples its edges for the matte)
44
44
  // The desks layout's back and front layers change only when the fleet (or the zoom) does: the renderer keeps them as
@@ -343,19 +343,23 @@ const BUBBLE_FONT = "600 11px system-ui, sans-serif";
343
343
  * The box a speech bubble with its tail at (x, y) takes for `text` (its tail excluded): what drawBubble draws, and what
344
344
  * the Office places so no two overlap (#2431: two neighbours' bubbles covered each other on a phone).
345
345
  */
346
- export function bubbleBox(ctx, x, y, text, lift = 0) {
346
+ export function bubbleBox(ctx, x, y, text, lift = 0, flip = false) {
347
347
  ctx.save();
348
348
  ctx.font = BUBBLE_FONT;
349
349
  const t = fitText(ctx, text, 150), w = Math.ceil((ctx.measureText ? ctx.measureText(t).width : t.length * 6) + 14), h = 19;
350
350
  ctx.restore();
351
- const bx = Math.round(x - 10), by = Math.round(y - h - 6 - lift);
351
+ // M-3722: `flip` puts the box on the tail's left (its tail still under it), for a call whose usual place covers a name.
352
+ const bx = Math.round(flip ? x - w + 14 : x - 10), by = Math.round(y - h - 6 - lift);
352
353
  return { x: bx, y: by, w, h, text: t };
353
354
  }
354
355
 
355
- /** A speech bubble, its tail at (x, y): short words on light paper in either theme; `lift` raises the box (its tail longer). */
356
- function drawBubble(ctx, x, y, text, env, lift = 0) {
356
+ /**
357
+ * A speech bubble, its tail at (x, y): short words on light paper in either theme; `lift` raises the box (its tail
358
+ * longer); `flip` (M-3722) draws the box on the tail's left.
359
+ */
360
+ function drawBubble(ctx, x, y, text, env, lift = 0, flip = false) {
357
361
  if (!text) return;
358
- const { x: bx, y: by, w, h, text: t } = bubbleBox(ctx, x, y, text, lift);
362
+ const { x: bx, y: by, w, h, text: t } = bubbleBox(ctx, x, y, text, lift, flip);
359
363
  ctx.save();
360
364
  ctx.font = BUBBLE_FONT;
361
365
  ctx.fillStyle = "#fffdf6"; ctx.strokeStyle = env.mode === "light" ? "rgba(0, 0, 0, 0.35)" : "rgba(0, 0, 0, 0.6)"; ctx.lineWidth = 1;
@@ -610,22 +610,35 @@ export function bubbleAt(name, state, ms, lines) {
610
610
  * another bubble (no two bubbles overlap) — so a name alone never keeps a call out (on Cozy a stuck agent stands right
611
611
  * under "Help desk", and its "Hmm, stuck?" went missing in beta.20).
612
612
  */
613
- export function placeBubbles(items, lift = 22, blocked = [], soft = []) {
613
+ /** M-3722: the space (logical px) a bubble's box keeps off an area's name (placeBubbles' `air`). */
614
+ export const NAME_AIR = 3;
615
+ export function placeBubbles(items, lift = 22, blocked = [], soft = [], air = 0) {
616
+ if (air) soft = soft.map((b) => ({ x: b.x - air, y: b.y - air, w: b.w + 2 * air, h: b.h + 2 * air }));
614
617
  const rank = (it) => (it.rank ?? (it.calling ? 0 : 2));
615
618
  const order = [...items].sort((a, b) => (rank(a) - rank(b)) || (b.shown - a.shown) || (a.key < b.key ? -1 : a.key > b.key ? 1 : 0));
616
619
  const taken = [...blocked], out = [];
617
620
  const hit = (list, r) => list.some((t) => r.x < t.x + t.w && t.x < r.x + r.w && r.y < t.y + t.h && t.y < r.y + r.h);
618
- const at = (it, dy) => {
619
- const r = { x: it.box.x, y: it.box.y + dy, w: it.box.w, h: it.box.h };
621
+ // M-3722: `flipBox` (the box on the tail's left) is a call's other side: tried before a call covers an area's name.
622
+ const at = (it, dy, flip = false) => {
623
+ const box = flip && it.flipBox ? it.flipBox : it.box;
624
+ const r = { x: box.x, y: box.y + dy, w: box.w, h: box.h };
620
625
  return { r, t: it.tail ? { x: it.tail.x - 1, y: r.y + r.h, w: 9, h: Math.max(0, it.tail.y - (r.y + r.h)) } : null };
621
626
  };
622
- const first = (it, dys, lists) => dys.find((dy) => { const { r, t } = at(it, dy); return !lists.some((l) => hit(l, r) || (t && hit(l, t))); });
627
+ // M-3722: an area's name (`soft`) keeps a bubble's BOX off it; a tail may cross a name (the Office writes the name again
628
+ // over it) — a caller standing at a name's height would otherwise always cover it.
629
+ const free = (it, [dy, flip], names) => { const { r, t } = at(it, dy, flip); return !hit(taken, r) && !(t && hit(taken, t)) && !(names && hit(soft, r)); };
630
+ const first = (it, spots, names) => spots.find((spot) => free(it, spot, names));
631
+ const sides = (dys) => dys.map((dy) => [dy, false]);
623
632
  for (const it of order) {
624
- let dy = first(it, [0, -lift], [taken, soft]);
625
- if (dy === undefined && it.calling) dy = first(it, [-2 * lift], [taken, soft]) ?? first(it, [0, -lift, -2 * lift], [taken]);
626
- if (dy === undefined) continue;
627
- const { r, t } = at(it, dy);
628
- taken.push(r); if (t) taken.push(t); out.push({ ...it, dy });
633
+ let spot = first(it, sides([0, -lift]), true);
634
+ if (spot === undefined && it.calling) {
635
+ spot = (it.flipBox ? first(it, [[0, true], [-lift, true]], true) : undefined)
636
+ ?? first(it, [[-2 * lift, false], ...(it.flipBox ? [[-2 * lift, true]] : [])], true)
637
+ ?? first(it, sides([0, -lift, -2 * lift]), false); // M-3648: a name never keeps a call out
638
+ }
639
+ if (spot === undefined) continue;
640
+ const [dy, flip] = spot, { r, t } = at(it, dy, flip);
641
+ taken.push(r); if (t) taken.push(t); out.push({ ...it, dy, ...(flip ? { flip: true } : {}) });
629
642
  }
630
643
  return out;
631
644
  }
@@ -516,6 +516,7 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
516
516
  blit(p.layers.back);
517
517
  T();
518
518
  const speakers = [], tags = [], titleBoxes = []; // M-3539: the area names bubbles keep off too
519
+ const titleDraws = []; // M-3722: and redrawn over a bubble's tail that crosses one
519
520
  const up = still ? [] : p.flights.frame(ms, p.L);
520
521
  // Mail from another office (#2564): flying in at the door, or on the floor until its person picks it up.
521
522
  const post = still || !p.mail || !p.zones ? [] : p.mail.frame(ms > 0 ? ms : now(), p.L, p.walkers);
@@ -665,7 +666,7 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
665
666
  const crowded = (q) => over.has(q.d.area) && !pinned(q);
666
667
  const tagged = (q) => pinned(q) || !(tagsOff || over.has(q.d.area));
667
668
  const keep = [...titles.map((x) => x.box), ...(env.keepClear || [])];
668
- titleBoxes.push(...titles.map((x) => x.box));
669
+ titleBoxes.push(...titles.map((x) => x.box)); titleDraws.push(...titles);
669
670
  const taken = [];
670
671
  const touches = (b) => taken.some((o) => overlaps(b, o)) || keep.some((o) => overlaps(b, o));
671
672
  // Under an open card (`p.cover`, bitmap px; #4379 review): no tag, its level badge included, rather than a piece of one
@@ -797,27 +798,33 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
797
798
  const ar = b && sk.ownCharacters && p.zones && sp.area != null ? p.L.areas && p.L.areas[sp.area] : null;
798
799
  if (ar && ar.rect) { const bx = bubbleBox(ctx, sp.x, sp.y, b.text), min = ar.rect.y + BUBBLE_IN_AREA; if (bx.y < min) sp = { ...sp, y: sp.y + (min - bx.y) }; }
799
800
  if (b) bubbles.push({ key: sp.look.name, area: sp.area, state: sp.look.state, calling: CALLING.has(sp.look.state), rank: own ? 0 : scText ? 1 : bubbleRank(sp.look.state), shown: b.shown, ...(raSays ? { keep: true } : {}),
800
- box: bubbleBox(ctx, sp.x, sp.y, b.text), tail: { x: sp.x, y: sp.y }, sp, b });
801
+ box: bubbleBox(ctx, sp.x, sp.y, b.text), ...(CALLING.has(sp.look.state) ? { flipBox: bubbleBox(ctx, sp.x, sp.y, b.text, 0, true) } : {}), tail: { x: sp.x, y: sp.y }, sp, b });
801
802
  }
802
803
  // A crowded area speaks less (thinBubbles: calls, then work, a few at most); no bubble covers a name tag. `defer`
803
804
  // (All offices): drawn after every tile, unclipped, so a bubble at a tile's edge is whole.
804
805
  // M-3648: an area's name blocks chatter; a call may cover it (placeBubbles' `soft`): a name never keeps a call out.
805
- const placed = placeBubbles(thinBubbles(bubbles, p.zones ? p.L.over : null), 22, tags, titleBoxes);
806
+ // M-3722: and 3 px of air off a name, not just its plate (a call beside 求救區 touched its corner). A number here, not an
807
+ // import: a page still holding the older fleet-office-zones.js keeps linking (it just ignores it).
808
+ const placed = placeBubbles(thinBubbles(bubbles, p.zones ? p.L.over : null), 22, tags, titleBoxes, 3);
806
809
  // M-3533 R2c: and after placing (which lifts a bubble clear of another), a room character's bubble still stays in its area.
807
- const inArea = (sp, text, dy) => {
810
+ const inArea = (sp, text, dy, flip) => {
808
811
  const ar = sk.ownCharacters && p.zones && sp.area != null ? p.L.areas && p.L.areas[sp.area] : null;
809
812
  if (!ar || !ar.rect || !dy) return dy;
810
- const over = ar.rect.y + BUBBLE_IN_AREA - bubbleBox(ctx, sp.x, sp.y, text, -dy).y;
813
+ const over = ar.rect.y + BUBBLE_IN_AREA - bubbleBox(ctx, sp.x, sp.y, text, -dy, flip).y;
811
814
  return over > 0 ? Math.max(0, dy - over) : dy;
812
815
  };
813
- const say = () => { T(); for (const { sp, b, dy: lifted } of placed) {
814
- const text = [...b.text].slice(0, b.shown).join(""), dy = inArea(sp, b.text, lifted);
815
- sk.drawBubble(ctx, sp.x, sp.y, text, env, -dy);
816
+ const say = () => { T(); const tails = []; for (const { sp, b, dy: lifted, flip = false } of placed) {
817
+ const text = [...b.text].slice(0, b.shown).join(""), dy = inArea(sp, b.text, lifted, flip);
818
+ sk.drawBubble(ctx, sp.x, sp.y, text, env, -dy, flip);
819
+ if (text) { const box = bubbleBox(ctx, sp.x, sp.y, text, -dy, flip); tails.push({ x: sp.x - 1, y: box.y + box.h, w: 9, h: Math.max(0, sp.y - (box.y + box.h)) }); }
816
820
  if (bubbleHits && text) {
817
- const box = bubbleBox(ctx, sp.x, sp.y, text, -dy);
821
+ const box = bubbleBox(ctx, sp.x, sp.y, text, -dy, flip);
818
822
  bubbleHits.push({ name: sp.look.name, box: { x: ox + box.x * a, y: oy + box.y * a, w: box.w * a, h: box.h * a } });
819
823
  }
820
824
  }
825
+ // M-3722: a bubble keeps its box off an area's name (placeBubbles); a tail that still crosses one has the name written
826
+ // again over it (as over a figure standing on it, M-3539), so the name always reads whole.
827
+ if (sk.drawAreaTitle) for (const { ar, box } of titleDraws) if (tails.some((t) => overlaps(t, box))) sk.drawAreaTitle(ctx, ar, env);
821
828
  const bl = sk.pack && sk.pack.dialogBox ? sk.pack.dialogBox.bubble : null;
822
829
  const im = bl && bl.frame && typeof sk.picture === "function" ? sk.picture(bl.frame, () => {}) : null;
823
830
  for (const { sp, said } of replies) {
@@ -78,7 +78,12 @@ export function nodeText(n) {
78
78
  export function buildOrgView(org, app) {
79
79
  const live = new Map((app.instances || []).map((i) => [i.name, i]));
80
80
  const needs = new Map();
81
- for (const item of Array.isArray(app.needs) ? app.needs : []) needs.set(item.instance, (needs.get(item.instance) || 0) + 1);
81
+ // M-3720 (the user, 11-25): a ClassicBot room's "can switch to restricted mode" suggestion is a low-key hint (Needs you
82
+ // folds them into one quiet group), not a call — it alone never sends the room to the Help desk. Every other item does.
83
+ for (const item of Array.isArray(app.needs) ? app.needs : []) {
84
+ if (item && item.type === "contact" && item.reason === "contact_restricted_suggestion") continue;
85
+ needs.set(item.instance, (needs.get(item.instance) || 0) + 1);
86
+ }
82
87
  const awaiting = app.awaiting || {};
83
88
  const info = (org && org.instances) || {};
84
89
  const node = (name) => {
@@ -0,0 +1,19 @@
1
+ // M-3722 (#4453 review): Fleet's tabs are icons only on a phone, so each tab has its own icon — Cache, Usage and Host
2
+ // health no longer share "chart". Those three drawings live here, not in the shared ui-icons.js: a page still holding an
3
+ // older ui-icons.js (cached by URL) would draw nothing for an unknown name, and a phone's tab, its name hidden, would be
4
+ // blank. Every other tab's icon is the shared one.
5
+ import { html } from "/assets/app-html.js";
6
+ import { Icon } from "/assets/ui-icons.js";
7
+
8
+ const OWN = {
9
+ database: () => html`<ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/><path d="M3 12c0 1.66 4 3 9 3s9-1.34 9-3"/>`,
10
+ gauge: () => html`<path d="M12 14l4-4"/><path d="M3.34 19a10 10 0 1 1 17.32 0"/>`,
11
+ pulse: () => html`<path d="M22 12h-4l-3 9L9 3l-3 9H2"/>`,
12
+ };
13
+
14
+ /** A Fleet tab's icon: one of the three drawn here, else the shared Icon (same size, stroke and look). */
15
+ export function TabIcon({ name, size = 16 }) {
16
+ if (!OWN[name]) return html`<${Icon} name=${name} size=${size} />`;
17
+ return html`<svg class="icon" width=${size} height=${size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
18
+ stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${OWN[name]()}</svg>`;
19
+ }
@@ -19,6 +19,7 @@ import { BoardOffNote, boardOffTargets, relTime } from "./fleet-task-common.js";
19
19
  import { AgentTag } from "./fleet-task-run.js";
20
20
  import { WhoCard } from "./fleet-task-owner.js";
21
21
  import { insertAtTrigger, triggerAt, withoutCode } from "./trigger-complete.js";
22
+ import { dateTimeText } from "/assets/clock-text.js";
22
23
 
23
24
  export const TIMELINE_FILTERS = ["all", "comments", "log", "history"];
24
25
  const RANK = { event: 0, log: 1, comment: 2 }; // at one instant: the move first, then the words that came with it
@@ -77,7 +78,7 @@ export const insertMention = (text, m, caret, name, names = []) => insertAtTrigg
77
78
 
78
79
  // ── The timeline ──────────────────────────────────────────
79
80
 
80
- const fullTime = (iso) => { const d = new Date(iso); return Number.isFinite(d.getTime()) ? d.toLocaleString() : ""; };
81
+ const fullTime = (iso) => { const d = new Date(iso); return Number.isFinite(d.getTime()) ? dateTimeText(d) : ""; };
81
82
 
82
83
  /**
83
84
  * A run of the same history line from the same hand ("web-user changed acceptance" three times in a row) is one entry with a
@@ -13,6 +13,7 @@ import { RunMark, runOf } from "./fleet-task-run.js";
13
13
  import { OwnerChip } from "./fleet-task-owner.js";
14
14
  import { COLUMNS, ProgressBar, UNASSIGNED, Who, readStored, recentlyDone, relTime, reviewLabel, waitsForYou, waitsList, waitsOn, wrapUpText, writeStored } from "./fleet-task-common.js";
15
15
  import { assetUrl } from "/assets/asset-url.js";
16
+ import { dateTimeText } from "/assets/clock-text.js";
16
17
 
17
18
  /** The task board's stylesheet, linked once (a tab opened before an upgrade has an app.css without these rules). */
18
19
  export function linkTaskBoardCss(doc = typeof document !== "undefined" ? document : null) {
@@ -400,7 +401,7 @@ function groupHead(group, key) {
400
401
  return html`<span class=${`tb-tag p-${key}`}>${t(`tasks.${key}`)}</span>`;
401
402
  }
402
403
  const groupWord = (group, key) => (group === "assignee" ? (key === NONE ? t("tasks.nobody") : key) : t(`tasks.${key}`));
403
- const longTime = (iso) => { const d = new Date(iso); return Number.isFinite(d.getTime()) ? d.toLocaleString(lang() === "zh-TW" ? "zh-TW" : "en") : ""; };
404
+ const longTime = (iso) => { const d = new Date(iso); return Number.isFinite(d.getTime()) ? dateTimeText(d, undefined, lang() === "zh-TW" ? "zh-TW" : "en") : ""; };
404
405
 
405
406
  // The groups a person folded away, remembered on this device, per project (by what heads them: "1/status:done",
406
407
  // "none/assignee:alpha" — the project's id, or "none" for No project).
@@ -9,6 +9,7 @@ import { t, register } from "/assets/app-i18n.js";
9
9
  import { Empty, ErrorState, Skeleton } from "/assets/ui-states.js";
10
10
  import { Icon } from "/assets/ui-icons.js";
11
11
  import { money, tokens } from "./fleet-cache.js";
12
+ import { timeText } from "/assets/clock-text.js";
12
13
 
13
14
  register("fusage", {
14
15
  en: {
@@ -439,7 +440,7 @@ export function UsageReport({ report, choice, setChoice, refresh, fetchedAt }) {
439
440
  <p class="us-basis" role="note" title=${tu("basisMore")}>${tu("basis", report.pricesChecked)}</p>
440
441
  ${noDaily ? html`<p class="us-partial" role="status">${tu("noDaily")}</p>` : report.dailyTruncated ? html`<p class="us-partial" role="status">${tu("partialDays", report.dailyFrom)}</p>` : null}
441
442
  ${zones ? html`<p class="us-partial" role="status">${tu("zoneChanged", zones.join(", "), report.zone)}</p>` : null}
442
- <p class="note us-fresh">${tu("updated", new Date(fetchedAt).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }))} · ${Number.isFinite(since) ? tu("since", new Date(since).toLocaleDateString()) : tu("notYet")} · ${tu("zoneNote", report.zone)}${group === "team" ? ` ${tu("teamsNote")}` : ""}
443
+ <p class="note us-fresh">${tu("updated", timeText(fetchedAt, { hour: "2-digit", minute: "2-digit" }, []))} · ${Number.isFinite(since) ? tu("since", new Date(since).toLocaleDateString()) : tu("notYet")} · ${tu("zoneNote", report.zone)}${group === "team" ? ` ${tu("teamsNote")}` : ""}
443
444
  ${report.scanning.active && (!report.scanning.caughtUp || report.scanning.pendingBytes > 0) ? html` <span class="us-scan" role="status">${tu("scanning")} <button type="button" class="btn btn-sm" onClick=${refresh}>${tu("refresh")}</button></span>` : null}</p>
444
445
  ${empty ? html`<${Empty} icon="chart" title=${tu("empty")} hint=${tu("emptyHint")} />` : html`
445
446
  <dl class="us-totals card">
@@ -8,6 +8,7 @@
8
8
  import { html, useEffect, useRef, useState } from "/assets/app-html.js";
9
9
  import { register, t, lang } from "/assets/app-i18n.js";
10
10
  import { ErrorState, Skeleton } from "/assets/ui-states.js";
11
+ import { timeText } from "/assets/clock-text.js";
11
12
 
12
13
  register("hubOverview", {
13
14
  en: {
@@ -110,7 +111,7 @@ export function HubAdminOverview({ client, onOpen = () => {}, onGone = () => {}
110
111
  <div class="hub-ov-range" role="group" aria-label=${ho("rangeLabel")}>
111
112
  ${["today", "7d"].map((r) => html`<button key=${r} type="button" class=${`hub-ov-range-item${range === r ? " is-current" : ""}`} aria-pressed=${range === r ? "true" : "false"} onClick=${() => pick(r)}>${ho(r === "today" ? "today" : "week")}</button>`)}
112
113
  </div>
113
- ${at ? html`<span class="note hub-ov-updated">${ho("updated", new Date(at).toLocaleTimeString(lang() === "zh-TW" ? "zh-TW" : "en", { hour: "2-digit", minute: "2-digit" }))}</span>` : null}
114
+ ${at ? html`<span class="note hub-ov-updated">${ho("updated", timeText(at, { hour: "2-digit", minute: "2-digit" }, lang() === "zh-TW" ? "zh-TW" : "en"))}</span>` : null}
114
115
  </div>
115
116
  <p class="note hub-ov-privacy">${ho("privacy")}</p>`;
116
117
  if (!data) return html`<div class="hub-ov">${head}${error ? html`<${ErrorState} onRetry=${() => load(range)} />` : html`<${Skeleton} variant="rows" lines=${6} />`}</div>`;