@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
@@ -31,6 +31,7 @@ import { decideProposal, installProposals } from "./agent-proposals.js";
31
31
  import { GeneralLocation } from "./general-location.js";
32
32
  import { runtimeUpdateText } from "./runtime-update-status.js";
33
33
  import { ContactNeedsItem, ContactSuggestionsGroup, isRestrictedSuggestion } from "./contact-needs.js";
34
+ import { ContactVerifyNeed, contactVerifyCount, isContactVerify } from "./contact-verify-need.js";
34
35
  import { HostDirectoryNotices, hostDirectoryNoticesOffered } from "./hub-host-security-notices.js";
35
36
 
36
37
  // A pre-upgrade tab retains app-i18n.js. Register these reasons when the updated panel is loaded, too.
@@ -44,6 +45,7 @@ register("needs", {
44
45
  otherEmpty: "No other items are waiting for you.", title: "Needs you", empty: "Nothing needs you right now", emptyHint: "When an agent waits for you, it shows here — and in your chat app's General.", emptyHintWeb: "When an agent waits for you, it shows here.",
45
46
  open: "Open chat", kiroOpen: "Open agent", kiroMigration: "Migration instructions", openCard: "Open the card", noAssignee: "Task board (nobody assigned)", fleetSignIns: "AI accounts", signIn: "Connect account",
46
47
  gap: "not wrapped up: {0}", gapUnchecked: "{0} checklist item(s) unchecked", gapNoResult: "no result", gapJoin: ", ", acknowledge: "Acknowledge", acknowledging: "Acknowledging…", answering: "Answering…",
48
+ hubClose: "Close this question", hubClosing: "Closing…", hubCloseTitle: "Close this question?", hubCloseConfirm: "Close question", hubCloseDetail: "You can close this question without sending it to the agent again.", hubCloseMessage: "The Hub will tell the asker this question will not be answered. This can't be undone. The same message can't be retried; the asker can send a new question. An answer already sent stays visible. This does not stop work the agent has already started.", hubCloseDone: "The question is closed on the Hub.", hubCloseAnswered: "An answer already reached the Hub; it was kept.", hubCloseVerify: "Verify your admin account, then close this question again.", hubCloseForbidden: "Only an admin who manages this agent can close its question.", hubCloseUnsupported: "Update the Hub to close this question. It is still held.", hubCloseUnavailable: "The Hub did not confirm closure. Check its connection and try closing again; the question was not resent.",
47
49
  hubRetry: "Try again", hubRetrying: "Trying again…", hubRetryDone: "Asked the Hub again.",
48
50
  hubRetryGone: "This item has already changed. The list will refresh.", hubRetryNot: "This one can't be tried again: the Hub refused it, or the agent changed. Ask the person to send the question again.",
49
51
  hubHoldDetail: "The Hub could not confirm this question before it reached the agent. Try again asks the Hub again; nothing is sent without its OK.",
@@ -72,6 +74,7 @@ register("needs", {
72
74
  otherEmpty: "沒有其他待處理事項。", title: "等你處理", empty: "目前沒有需要你處理的事", emptyHint: "agent 在等你時,會出現在這裡——也會出現在聊天 app 的 General。", emptyHintWeb: "agent 在等你時,會出現在這裡。",
73
75
  open: "開啟聊天", kiroOpen: "開啟 Agent", kiroMigration: "遷移說明", openCard: "打開卡片", noAssignee: "任務看板(沒有負責人)", fleetSignIns: "AI 帳號", signIn: "連接帳號",
74
76
  gap: "還沒補齊:{0}", gapUnchecked: "還有 {0} 項沒勾", gapNoResult: "沒有產出總結", gapJoin: "、", acknowledge: "確認", acknowledging: "確認中…", answering: "回覆中…",
77
+ hubClose: "不處理這題", hubClosing: "結束中…", hubCloseTitle: "不處理這題?", hubCloseConfirm: "不處理這題", hubCloseDetail: "可以結束這題,不會再把問題送給 Agent。", hubCloseMessage: "Hub 會告訴提問者這題不會回答。關閉後無法復原。同一則訊息無法再試一次;提問者可以另問一題。已經送出的答案會保留。這不會停止 Agent 已經開始的工作。", hubCloseDone: "Hub 已確認結束這題。", hubCloseAnswered: "答案已經送達 Hub,原有答案會保留。", hubCloseVerify: "請先驗證管理員帳號,再結束這題。", hubCloseForbidden: "只有管理這個 Agent 的管理員可以結束這題。", hubCloseUnsupported: "請先更新 Hub,才能結束這題。目前仍保留暫停項目。", hubCloseUnavailable: "Hub 尚未確認結束。請檢查連線後再試;問題沒有重新送出。",
75
78
  hubRetry: "再試一次", hubRetrying: "重試中…", hubRetryDone: "已重新詢問 Hub。",
76
79
  hubRetryGone: "這個項目已經有變化,清單會重新整理。", hubRetryNot: "這則無法再試:Hub 已拒絕,或 Agent 已變更。請提問的人重新送出問題。",
77
80
  hubHoldDetail: "Hub 在問題交給 Agent 之前無法確認。按「再試一次」會重新詢問 Hub,未經 Hub 同意不會送出。",
@@ -214,8 +217,11 @@ export function NeedsPanel({ navKey }) {
214
217
  const updates = items.filter(item => item.runtimeUpdate);
215
218
  // M-3381: the rooms' restricted-mode suggestions are one group (below the rest), counted once.
216
219
  const suggestions = items.filter(isRestrictedSuggestion);
217
- const groups = groupNeeds(items.filter(item => !item.runtimeUpdate && !isRestrictedSuggestion(item)));
218
- const shownCount = items.length - suggestions.length + (suggestions.length ? 1 : 0) + asks.length;
220
+ // M-3710: "N contact requests need a verified browser" — on top, under no agent's heading.
221
+ const verify = items.find(isContactVerify);
222
+ const groups = groupNeeds(items.filter(item => !item.runtimeUpdate && !isRestrictedSuggestion(item) && !isContactVerify(item)));
223
+ // M-3710: the verify line counts as the requests it stands for (as the badge and tab title do).
224
+ const shownCount = items.length - suggestions.length + (suggestions.length ? 1 : 0) + asks.length + (verify ? contactVerifyCount(verify) - 1 : 0);
219
225
  if (updates.length) groups.push({ instance: "", items: updates });
220
226
  const nowMs = Date.now();
221
227
  return html`<div data-effect-panel="needs" class="panel p-needs">
@@ -226,6 +232,7 @@ export function NeedsPanel({ navKey }) {
226
232
  ${asks.map((p) => html`<${ProposalItem} key=${p.id} proposal=${p} nowMs=${nowMs} />`)}
227
233
  ${decidedHere.map(([id, d]) => html`<${ProposalResult} key=${id} result=${d} />`)}
228
234
  </section>` : null}
235
+ ${verify ? html`<${ContactVerifyNeed} item=${verify} />` : null}
229
236
  ${(!ready || needsLoaded === false) && !items.length && !asks.length ? html`<${Skeleton} variant="rows" lines=${3} />`
230
237
  : !items.length && !asks.length && !decidedHere.length ? hostDirectoryNoticesOffered() ? html`<p class="muted">${tn("otherEmpty")}</p>` : html`<${Empty} icon="check" title=${tn("empty")} hint=${tn(chatApp ? "emptyHint" : "emptyHintWeb")} />`
231
238
  : groups.map((g) => html`<section key=${JSON.stringify([g.instance, g.items[0]?.type === "config",g.items[0]?.type === 'host', !!g.items[0]?.runtimeUpdate])} class="n-group" aria-label=${g.items[0]?.runtimeUpdate ? runtimeUpdateText("attention") : g.instance}>
@@ -288,6 +295,25 @@ function NeedsItem({ item, nowMs, owner }) {
288
295
  setClaim("acks", item.id, res && res.ok ? "done" : null);
289
296
  toast((body && (body.message || body.error)) || t("app.failed"), !!(res && res.ok));
290
297
  };
298
+ const closeKey = `hub-close:${item.id}`, closeAck = c.acks[closeKey];
299
+ const closeHub = async () => {
300
+ if (claims.get().acks[closeKey]) return;
301
+ setClaim("acks", closeKey, "confirming");
302
+ if (!await confirmDialog({ title: tn("hubCloseTitle"), message: tn("hubCloseMessage"), confirmLabel: tn("hubCloseConfirm"), danger: true })) {
303
+ setClaim("acks", closeKey, null); return;
304
+ }
305
+ setClaim("acks", closeKey, "busy");
306
+ let res = null, body = {};
307
+ try {
308
+ res = await fetch("/ui/needs/hub-close", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ id: item.id }) });
309
+ body = await res.json().catch(() => ({}));
310
+ } catch { /* clear, localised connection error below */ }
311
+ setClaim("acks", closeKey, res?.ok ? "done" : null);
312
+ const key = res?.ok ? body.code === "answered" ? "hubCloseAnswered" : "hubCloseDone"
313
+ : body.code === "verification-required" ? "hubCloseVerify" : body.code === "forbidden" ? "hubCloseForbidden"
314
+ : body.code === "unsupported" ? "hubCloseUnsupported" : body.code === "not-found" ? "hubRetryGone" : "hubCloseUnavailable";
315
+ toast(tn(key), !!res?.ok);
316
+ };
291
317
  // M-3632: held Hub work → back through the Hub's checks (the server re-asks the Hub for its lease; never delivered blind).
292
318
  const hubKey = hubRetryKey(item), hubAck = item.hubRetry ? c.acks[hubKey] : undefined;
293
319
  const retryHub = async () => {
@@ -307,6 +333,7 @@ function NeedsItem({ item, nowMs, owner }) {
307
333
  <div class="n-body">
308
334
  <div class="n-title"><strong>${item.type==='host'?hostAlertName(item.hostAlert):itemReason(item)}</strong><span class="n-age">${item.type==='host'?hostAlertText('started')+age(item.since, nowMs):age(item.since, nowMs)}</span></div>
309
335
  ${item.type==='host'&&item.hostAlert?html`<p class="n-detail">${hostAlertText(item.hostAlert.level)} · ${hostAlertDescription(item.hostAlert)}</p>`:item.type==='host'?html`<p class="n-detail">${hostAlertText('failed')}</p>`:detailOf(item)?html`<p class="n-detail">${detailOf(item)}</p>`:null}
336
+ ${item.type === "hub" && item.hubClose ? html`<p class="n-detail">${tn("hubCloseDetail")}</p>` : null}
310
337
  ${item.type === "hub" && item.hubRetry ? html`<p class="n-detail">${tn("hubHoldDetail")}</p>` : null}
311
338
  ${item.type === "hub" && item.hubProposal ? html`<p class="n-detail">${item.hubProposal.action}</p><pre>${item.hubProposal.arguments}</pre><p class="n-detail">${item.hubProposal.consequences}</p>` : null}
312
339
  ${item.generalLocation ? html`<${GeneralLocation} name=${item.instance} attentionOnly=${true} />` : null}
@@ -314,8 +341,9 @@ function NeedsItem({ item, nowMs, owner }) {
314
341
  <div class="n-actions">
315
342
  ${item.type === "prompt" && Array.isArray(item.actions) ? item.actions.filter((a) => !a.input).map((a) => html`<button key=${a.id} type="button" class="btn btn-sm"
316
343
  disabled=${promptBusy} onClick=${() => answer(a.id)}>${(p ? p.busy && !p.confirming : fallback === "busy") ? tn("answering") : a.label}</button>`) : null}
317
- ${item.type === "hub" && item.hubRetry ? html`<button type="button" class="btn btn-sm btn-primary" disabled=${!!hubAck} onClick=${retryHub}>
344
+ ${item.type === "hub" && item.hubRetry ? html`<button type="button" class="btn btn-sm btn-primary" disabled=${!!hubAck || !!closeAck} onClick=${retryHub}>
318
345
  <${Icon} name="restart" size=${14} />${hubAck === "busy" ? tn("hubRetrying") : tn("hubRetry")}</button>` : null}
346
+ ${item.type === "hub" && item.hubClose ? html`<button type="button" class="btn btn-sm hub-close" disabled=${!!closeAck || !!hubAck} onClick=${closeHub}>${tn(closeAck === "busy" ? "hubClosing" : "hubClose")}</button>` : null}
319
347
  ${item.type === "delivery" || item.type === "missed" ? html`<button type="button" class="btn btn-sm" disabled=${!!ack} onClick=${acknowledge}>
320
348
  <${Icon} name="check" size=${14} />${ack === "busy" ? tn("acknowledging") : tn("acknowledge")}</button>` : null}
321
349
  ${(item.reason === "auth_paused" || item.reason === "backend_signin") && item.signIn && signInOffered() ? html`<button type="button" class="btn btn-sm btn-primary" onClick=${() => openSignIn(item.signIn)}>${tn("signIn")}</button>` : null}
@@ -12,6 +12,7 @@ import { Empty, ErrorState, Skeleton } from "/assets/ui-states.js";
12
12
  import { Icon } from "/assets/ui-icons.js";
13
13
  import { HubSharingNotice } from "./notice-hub-sharing.js";
14
14
  import { HubUpdateNotice, useHubUpdateActions } from "./notice-hub-update.js";
15
+ import { dateTimeText } from "/assets/clock-text.js";
15
16
 
16
17
  register("notices", {
17
18
  en: {
@@ -92,7 +93,7 @@ export function NoticesPanel({ navKey }) {
92
93
  <div class="n-body">
93
94
  <div class="n-title"><strong>${tn(`kind_${n.kind}`)}${n.instance ? ` · ${n.instance}` : ""}</strong>
94
95
  ${n.id > seenAtOpen ? html`<span class="notice-new">${tn("unread")}</span>` : null}
95
- <span class="n-age" title=${new Date(n.at).toLocaleString()}>${noticeAge(n.at, nowMs)}</span></div>
96
+ <span class="n-age" title=${dateTimeText(n.at)}>${noticeAge(n.at, nowMs)}</span></div>
96
97
  ${n.hubSharing ? html`<${HubSharingNotice} notice=${n} />` : n.hubUpdate ? html`<${HubUpdateNotice} notice=${n} actions=${hubActions} />` : html`<p class="n-detail notice-text">${n.text}</p>`}
97
98
  ${n.instance && known.has(n.instance) ? html`<div class="n-actions"><a class="btn btn-sm btn-ghost" href=${chatPath(n.instance)}>${tn("open")}</a></div>` : null}
98
99
  </div>
@@ -18,6 +18,7 @@ import { identityText } from "./account-identity.js";
18
18
  import { CliInstall, offersCliInstall } from "./runtime-cli-install.js";
19
19
  import { useWindowsCliCatalog, refreshWindowsCliCatalog, useWindowsCliCatalogSnapshot } from "./windows-cli-catalog.js";
20
20
  import { assetUrl } from "/assets/asset-url.js";
21
+ import { dateTimeText } from "/assets/clock-text.js";
21
22
 
22
23
  /** The install tabs', command cards' and account list's stylesheet, linked once by this lazy page (a tab opened before an upgrade has an app.css without these rules). */
23
24
  export function linkRuntimeInstallCss(doc = typeof document !== "undefined" ? document : null) {
@@ -210,7 +211,7 @@ function paneVerificationTag(cli, text) {
210
211
  const key = cli.paneVerification === "unverified" ? "paneUnverified" : cli.paneVerification === "denied" ? "paneDenied" : "";
211
212
  return key ? html`<span class="tag" title=${text(`${key}Hint`)}>${text(key)}</span>` : null;
212
213
  }
213
- export function machineTime(value) { const date=new Date(value); return value && Number.isFinite(date.getTime()) ? date.toLocaleString() : machineText("unknown"); }
214
+ export function machineTime(value) { const date=new Date(value); return value && Number.isFinite(date.getTime()) ? dateTimeText(date) : machineText("unknown"); }
214
215
  function MachineCard({ machine, sameName, busy, action, openDiagnostics, probe, repairUpdate, lease, onChanged }) {
215
216
  const [editing,setEditing] = useState(false), [name,setName] = useState(machine.name), [info,setInfo] = useState(false);
216
217
  const detection = useWindowsCliCatalogSnapshot(machine.isLocal ? "" : machine.id);
@@ -6,6 +6,7 @@ import { Icon } from "/assets/ui-icons.js";
6
6
  import { CliPicker, CliProductMark, cliLabel } from "./cli-picker.js";
7
7
  import { ModelSelect } from "./settings-dialogs.js";
8
8
  import { useWindowsCliCatalog, WindowsCliDiscoveryStatus, WindowsCliHostIdentity } from "./windows-cli-catalog.js";
9
+ import { dateTimeText, timeText } from "/assets/clock-text.js";
9
10
 
10
11
  register("wincli", {
11
12
  "zh-TW": { intro:"在 Windows 上執行一次性任務,使用本機已安裝的 CLI 和登入。", probe:"偵測 Windows CLI", probing:"正在偵測…", newTask:"派送 Windows Codex 任務", folder:"Windows 工作目錄", prompt:"任務內容", access:"檔案存取", readOnly:"唯讀", write:"工作目錄可寫入", limits:"目前支援 Codex 單次任務,同時一個,五分鐘後請求取消。使用 CLI 的沙箱與核准政策;此頁不提供互動核准按鈕。Claude 目前提供偵測。", run:"開始任務", results:"任務與結果", refresh:"更新", signedIn:"已登入", signedOut:"尚未登入", unknown:"登入狀態未知", missing:"未找到執行檔", empty:"還沒有任務。", cancel:"取消任務", starting:"準備啟動", running:"執行中", cancelling:"正在取消", cancelled:"已取消", completed:"已完成", failed:"失敗", waiting:"正在接收 Windows CLI 的輸出…", uncertain:"提交結果不明,請按「更新」確認任務狀態,勿立即重送。" },
@@ -64,7 +65,7 @@ function TaskResult({ task, latest, cancel }) {
64
65
  const [expanded, setExpanded] = useState(latest || active(task));
65
66
  const tone = task.status === "completed" ? "ready" : task.status === "failed" ? "failed" : active(task) ? "working" : "neutral";
66
67
  return html`<details class="windows-cli-task" open=${expanded || active(task)} onToggle=${e => setExpanded(e.currentTarget.open)}>
67
- <summary><span class=${`windows-cli-task-state tone-${tone}`}><span class="windows-cli-dot"></span>${tn(task.status)}</span><time dateTime=${new Date(task.startedAt).toISOString()}>${new Date(task.startedAt).toLocaleTimeString([], { hour:"2-digit", minute:"2-digit" })}</time><${Icon} name="chevron" size=${16} /></summary>
68
+ <summary><span class=${`windows-cli-task-state tone-${tone}`}><span class="windows-cli-dot"></span>${tn(task.status)}</span><time dateTime=${new Date(task.startedAt).toISOString()}>${timeText(task.startedAt, { hour:"2-digit", minute:"2-digit" }, [])}</time><${Icon} name="chevron" size=${16} /></summary>
68
69
  <code class="windows-cli-path windows-cli-task-cwd">${task.cwd}</code>
69
70
  <div class="windows-cli-task-detail"><span class="windows-cli-output-label"><${Icon} name="view" size=${14} />${tn("output")}</span><pre class="windows-cli-output" tabIndex="0">${task.output || tn(active(task) ? "waiting" : "noOutput")}</pre>${task.error ? html`<p class="error">${task.error}</p>` : null}
70
71
  ${cancel && ["starting","running"].includes(task.status) ? html`<button type="button" class="btn btn-sm btn-ghost danger" onClick=${() => cancel(task.id)}><${Icon} name="stop" size=${14} />${tn("cancel")}</button>` : null}
@@ -152,7 +153,7 @@ export function WindowsCliPanel({ navKey, embedded = false, machineId = "", mach
152
153
  },[clis]);
153
154
  return html`<div class=${embedded ? "p-windows-cli windows-cli-settings" : "panel p-windows-cli"}>${!embedded ? html`<${PanelHeader} title="Windows CLI" />` : null}
154
155
  <div class=${embedded ? "windows-cli-settings-body" : "panel-body"}><div class="windows-cli-content">
155
- <header class="windows-cli-intro"><div>${diagnostic ? html`<p>${discovery.data?.probedAt ? t("wincli.lastDetection",new Date(discovery.data.probedAt).toLocaleString()) : tn("neverDetection")}</p>` : html`<span class="windows-cli-eyebrow"><${Icon} name="view" size=${14} />${tn("native")}</span><h2>${tn(machineId ? "remoteWorkspace" : "workspace")}</h2><p>${tn(machineId ? "remoteIntro" : "intro")}</p>`}</div>
156
+ <header class="windows-cli-intro"><div>${diagnostic ? html`<p>${discovery.data?.probedAt ? t("wincli.lastDetection",dateTimeText(discovery.data.probedAt)) : tn("neverDetection")}</p>` : html`<span class="windows-cli-eyebrow"><${Icon} name="view" size=${14} />${tn("native")}</span><h2>${tn(machineId ? "remoteWorkspace" : "workspace")}</h2><p>${tn(machineId ? "remoteIntro" : "intro")}</p>`}</div>
156
157
  <button type="button" class="btn windows-cli-probe" disabled=${probing || !online || !approved} onClick=${probe}><${Icon} name="restart" size=${16} cls=${probing ? "windows-cli-spin" : ""} />${tn(probing ? "probing" : "probe")}</button>
157
158
  </header>
158
159
  ${!diagnostic ? html`<${WindowsCliHostIdentity} inventory=${discovery.data} machineId=${machineId} machine=${machine} />` : null}
@@ -4,6 +4,7 @@ import { confirmDialog } from "/assets/ui-confirm.js";
4
4
  import { ErrorState, Skeleton } from "/assets/ui-states.js";
5
5
  import { CLI_CAPS } from "./cli-caps.js";
6
6
  import { confirmedWrite } from "./settings-confirm.js";
7
+ import { dateTimeText } from "/assets/clock-text.js";
7
8
 
8
9
  /**
9
10
  * #3190 Part 3b: install a CLI on a paired Windows computer, from Settings → Runtime. The page sends only a CLI id; the Runtime on that computer decides the
@@ -203,7 +204,7 @@ export function CliInstall({ machine, lease, onChanged }) {
203
204
  <ul class="runtime-cli-install-list" aria-label=${text("title")}>${INSTALL_CLIS.map(row)}</ul>
204
205
  ${view && !view.switches ? html`<p class="note" role="status">${text("unreadable")}</p>` : null}
205
206
  ${switchState && !allowed ? html`<p class="note runtime-cli-install-off" role="status">${text("switchOff")}</p><${CommandCard} label=${text("switchCommand")} command=${SWITCH_COMMAND} />` : null}
206
- ${allowed ? html`<p class="note">${switchState.until ? text("switchUntil", new Date(switchState.until).toLocaleString()) : text("switchOn")}</p>` : null}
207
+ ${allowed ? html`<p class="note">${switchState.until ? text("switchUntil", dateTimeText(switchState.until)) : text("switchOn")}</p>` : null}
207
208
  ${running ? html`<p class="note" role="status" aria-busy="true"><span class="out-spin" aria-hidden="true"></span> ${text("installing")}</p>` : null}
208
209
  ${note ? html`<p class="note" role="status">${note}</p>` : null}
209
210
  ${error ? html`<p class="runtime-error" role="alert">${error}</p>` : null}`}
@@ -22,6 +22,7 @@ import { ownChoiceImpact } from "./settings-model.js";
22
22
  import { confirmDialog } from "/assets/ui-confirm.js";
23
23
  import { colorsOff, defaultPlaces, identityClasses, identityOf, PLACEMENTS, paintIdentity, setColorsOff, setDefaultPlaces, useIdentityColors } from "/assets/identity-color.js";
24
24
  import { CardTitle } from "./settings-learn.js";
25
+ import { dateTimeText } from "/assets/clock-text.js";
25
26
  import "./settings-strings.js";
26
27
 
27
28
  const tn = (k, ...v) => t(`settings.${k}`, ...v);
@@ -587,7 +588,7 @@ function OwnerCssCard() {
587
588
  </div>
588
589
  ${state.versions.length ? html`<details class="s-css-versions"><summary>${tn("cssVersions", state.versions.length)}</summary>
589
590
  <ul class="s-css-list">${state.versions.map((v) => html`<li key=${v.sha}>
590
- <code>${short(v.sha)}</code><span class="muted">${new Date(v.at).toLocaleString()} · ${kib(v.bytes)}</span>
591
+ <code>${short(v.sha)}</code><span class="muted">${dateTimeText(v.at)} · ${kib(v.bytes)}</span>
591
592
  ${v.sha === state.active ? html`<span class="pill">${tn("cssCurrent")}</span>`
592
593
  : html`<button type="button" class="btn btn-sm" disabled=${busy} onClick=${() => restore(v.sha)}>${tn("cssRestore")}</button>`}
593
594
  </li>`)}</ul></details>` : null}
@@ -19,6 +19,7 @@ import { DEFAULT_SCHEMA, impactOf } from "./settings-model.js";
19
19
  import "./settings-strings.js";
20
20
  import { layoutText } from "./settings-layout.js";
21
21
  import { Feedback, Impact, InEffect } from "./settings-dialogs.js";
22
+ import { dateTimeText, timeText } from "/assets/clock-text.js";
22
23
 
23
24
  const tn = (k, ...v) => t(`settings.${k}`, ...v);
24
25
  const PLATFORMS = { discord: "Discord", telegram: "Telegram" };
@@ -112,7 +113,7 @@ function Names({ id, all, rooms = [], value, wrote = [], onChange }) {
112
113
  ${rooms.map((r) => box(r.name, r.display_name || r.name, !!r.display_name))}</div>`;
113
114
  }
114
115
 
115
- const clock = (ms) => new Date(ms).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
116
+ const clock = (ms) => timeText(ms, { hour: "2-digit", minute: "2-digit" }, []);
116
117
  const COOLDOWN_MS = 60_000;
117
118
 
118
119
  /** A draft as staged (#2365 review: carried in the staged change, so leaving the section and coming back keeps it). */
@@ -326,13 +327,13 @@ export function GuestsSection({ ctx, staged }) {
326
327
  ${people === null ? html`<${Skeleton} variant="rows" lines=${3} />` : !candidates.length ? html`<p class="note" id="grantsNoPeople">${tn("grantsNoPeople")}</p>`
327
328
  : html`<ul class="g-pick">${candidates.map((p) => html`<li key=${accountKey(p)} class="g-cand" data-account=${accountKey(p)}>
328
329
  <span class="g-av" aria-hidden="true">${(p.name || "?").slice(0, 1).toUpperCase()}</span>
329
- <div class="g-id"><strong>${p.name}</strong> <span class="note">${PLATFORMS[p.platform] || p.platform}${p.username ? ` · @${p.username}` : ""} · <span class="g-when">${tn("grantsLastSeen", new Date(p.lastSeen).toLocaleString())}</span></span>
330
+ <div class="g-id"><strong>${p.name}</strong> <span class="note">${PLATFORMS[p.platform] || p.platform}${p.username ? ` · @${p.username}` : ""} · <span class="g-when">${tn("grantsLastSeen", dateTimeText(p.lastSeen))}</span></span>
330
331
  ${p.instances && p.instances.length ? html`<div class="note">${wroteTo(p.instances)}</div>` : null}</div>
331
332
  <button type="button" class="btn btn-sm" onClick=${() => { const k = accountKey(p); setGrant(k, { ...(p.name ? { name: p.name } : {}), instances: choosable.filter((n) => (p.instances || []).includes(n)) }); setEditing(k); }}>${tn("grantsChoose")}</button></li>`)}</ul>`}</div></details>`}
332
333
  </fieldset>
333
334
  ${overview && overview.audit ? html`<details class="s-guest-audit"><summary>${tn("grantsRecent")}</summary>${!overview.audit.length ? html`<p class="note" id="grantsRecentNone">${tn("grantsRecentNone")}</p>`
334
335
  : html`<ul class="g-audit" id="grantsRecentList">${overview.audit.map((e, i) => html`<li key=${`${e.at}-${i}`} class="g-audit-row" data-kind=${e.kind}>
335
- <span class="g-when">${new Date(e.at).toLocaleString()}</span> <strong>${e.name}</strong>
336
+ <span class="g-when">${dateTimeText(e.at)}</span> <strong>${e.name}</strong>
336
337
  ${e.kind === "grant" ? html`${e.added.map((n) => html` <span key=${`+${n}`} class="g-wrote g-add">+${n}</span>`)}${e.removed.map((n) => html` <span key=${`-${n}`} class="g-wrote g-del">−${n}</span>`)}${e.level ? html` <span class="g-wrote g-level-to">${tn("grantsAuditLevel", tn(e.level === "trusted" ? "grantsLevelTrusted" : "grantsLevelChat"))}</span>` : null}
337
338
  <span class="note"> · <span class="g-wrote">${tn(e.via === "confirmed" ? "grantsAuditConfirmed" : "grantsAuditDirect")}</span>${e.endedSessions ? html` · <span class="g-wrote">${tn("grantsAuditEnded", e.endedSessions)}</span>` : null}</span>`
338
339
  : html` <span class="note">${e.outcome === "sent" ? tn("grantsAuditCodeSent") : tn("grantsAuditCodeNot", auditOutcome(e.outcome))}</span>`}</li>`)}</ul>`}</details>` : null}
@@ -9,6 +9,7 @@ import { Skeleton, ErrorState } from "/assets/ui-states.js";
9
9
  import { register, t, lang } from "/assets/app-i18n.js";
10
10
  import { api } from "./settings-confirm.js";
11
11
  import { typedOrigin, shownAddress, defaultListen } from "./settings-hub-web-address.js";
12
+ import { clockFormat } from "/assets/clock-text.js";
12
13
 
13
14
  register("hubMemberAddress", {
14
15
  en: {
@@ -94,7 +95,7 @@ const errorText = (r) => {
94
95
  if (Number.isSafeInteger(r.retryAt) && r.retryAt > 0) {
95
96
  try {
96
97
  const at = new Date(Math.ceil(r.retryAt / 60_000) * 60_000);
97
- if (!Number.isNaN(at.getTime())) time = new Intl.DateTimeFormat(lang(), { hour: "2-digit", minute: "2-digit" }).format(at);
98
+ if (!Number.isNaN(at.getTime())) time = clockFormat({ hour: "2-digit", minute: "2-digit" }, lang()).format(at);
98
99
  } catch { /* Fall back to the no-time wording. */ }
99
100
  }
100
101
  return copy(time ? "err_joining" : "err_joining_no_time", time);
@@ -5,6 +5,7 @@ import { Skeleton, ErrorState } from "/assets/ui-states.js";
5
5
  import { api } from "./settings-confirm.js";
6
6
  import { hs, setupError } from "./settings-hub-setup-strings.js";
7
7
  import { HUB_NAME_MAX } from "./hub-client.js"; // M-3235: the one Hub-name maximum (what the brand shows)
8
+ import { dateTimeText } from "/assets/clock-text.js";
8
9
  // These words travel with the new renderer, even when the tab retains the setup dictionary.
9
10
  register("hubSetupReady", {
10
11
  en: {
@@ -224,7 +225,7 @@ export function HubSetupSettings() {
224
225
  ].map(([key, value]) => html`<div class="kv"><span class="k">${hs(key)}</span><span class="v mono">${value}</span></div>`)}
225
226
  <div class="kv"><span class="k">${hs("ca")}</span><span class="v">${form.ca === "system" ? hs("system") : html`<span>${fingerprints.map(fp => html`<${Fingerprint} value=${fp} />`)}</span>`}</span></div>
226
227
  </div></details>
227
- <p class="note">${hs("expires")}: ${new Date(review.expiresAt).toLocaleString()}</p><p class="note">${hs("reviewHint")}</p>` : null}
228
+ <p class="note">${hs("expires")}: ${dateTimeText(review.expiresAt)}</p><p class="note">${hs("reviewHint")}</p>` : null}
228
229
  <div class="s-row">
229
230
  ${step > 1 ? html`<button class="btn" type="button" onClick=${() => { clearDraft(); setFailureCode(""); setStep(step === 4 ? (form.certificate === "import" ? 1 : 2) : step - 1); }}>${hs("back")}</button>` : null}
230
231
  ${step < 4 ? html`<button class="btn btn-primary" type="submit">${hs(step === 3 ? "test" : "next")}</button>` : html`<button class="btn btn-primary" type="button" disabled=${!review} onClick=${commit}>${hs("create")}</button>`}
@@ -8,6 +8,7 @@ import { html, useEffect, useState } from "/assets/app-html.js";
8
8
  import { Skeleton } from "/assets/ui-states.js";
9
9
  import { register, t, lang } from "/assets/app-i18n.js";
10
10
  import { api } from "./settings-confirm.js";
11
+ import { clockFormat } from "/assets/clock-text.js";
11
12
 
12
13
  register("hubWebAddress", {
13
14
  en: {
@@ -88,7 +89,7 @@ const errorText = (r) => {
88
89
  try {
89
90
  // Round up: the displayed minute must not invite a retry before the exact deadline.
90
91
  const at = new Date(Math.ceil(r.retryAt / 60_000) * 60_000);
91
- if (!Number.isNaN(at.getTime())) time = new Intl.DateTimeFormat(lang(), { hour: "2-digit", minute: "2-digit" }).format(at);
92
+ if (!Number.isNaN(at.getTime())) time = clockFormat({ hour: "2-digit", minute: "2-digit" }, lang()).format(at);
92
93
  } catch { /* The no-time wording also supports an older response or browser. */ }
93
94
  }
94
95
  return copy(time ? "err_joining" : "err_joining_no_time", time);
@@ -23,6 +23,7 @@ import { hp } from "./hub-pairing-progress-strings.js";
23
23
  import { hpf, pairingCodeState, pairingFailure } from "./hub-pairing-form-strings.js";
24
24
  import { HubPageSharingSettings } from "./settings-hub-page-sharing.js";
25
25
  import { HubUpdateConsent } from "./settings-hub-updates.js";
26
+ import { timeText } from "/assets/clock-text.js";
26
27
 
27
28
  register("hubSharingFleet", {
28
29
  en: { hint: "To pause and resume without clearing the allow list, open this agent under My agents on the Hub. Turning Share off stops sharing." },
@@ -170,7 +171,7 @@ export function HubConnectCard({ embedded = false, onPairing, labels = {}, prefi
170
171
  <p class="note">${hw("hubProgressHidden")}</p>`
171
172
  : html`<p class="hub-steps-lead">${hw("pendingSteps")}</p>
172
173
  <ul class="hub-steps">${step(p.ownerConfirmed, "ownerStep")}${step(p.adminApproved, "adminStep")}</ul>`}
173
- ${Number.isFinite(p.expiresAt) ? html`<p class="note">${hw("expires", new Date(p.expiresAt).toLocaleTimeString())}</p>` : null}
174
+ ${Number.isFinite(p.expiresAt) ? html`<p class="note">${hw("expires", timeText(p.expiresAt))}</p>` : null}
174
175
  <div class="field-row"><button type="button" class="btn" disabled=${busy} onClick=${cancel}>${hw("cancel")}</button></div>
175
176
  </div>`;
176
177
  } else if (p.state === "paired") {
@@ -7,6 +7,7 @@ import { register, t, lang } from "/assets/app-i18n.js";
7
7
  import { useStore } from "/assets/app-store.js";
8
8
  import { toast } from "/assets/ui-toast.js";
9
9
  import { checkUpdateNow, hubNeed, openHubUpdateDialog, openUpdateDialog, refreshUpdate, updateActive, updateStore } from "/assets/app-update.js";
10
+ import { dateTimeText } from "/assets/clock-text.js";
10
11
 
11
12
  register("supdate", {
12
13
  en: { title: "Version and update", current: "Current version", line: "Update line", latest: "Latest", checked: "Last checked",
@@ -29,7 +30,7 @@ function channelOf(version) {
29
30
  return !pre ? "latest" : pre[1] === "alpha" ? "alpha" : "beta";
30
31
  }
31
32
  function when(ms) {
32
- try { return new Date(ms).toLocaleString(lang() === "zh-TW" ? "zh-TW" : "en-US", { dateStyle: "medium", timeStyle: "short" }); } catch { return ""; }
33
+ try { return dateTimeText(ms, { dateStyle: "medium", timeStyle: "short" }, lang() === "zh-TW" ? "zh-TW" : "en-US"); } catch { return ""; }
33
34
  }
34
35
 
35
36
  export function UpdateSection() {
@@ -16,6 +16,7 @@ import { editsOf, keepDraft, syncStage } from "./settings-draft.js";
16
16
  import { resetWebAuthorization } from "/assets/web-authorize.js";
17
17
  import "./settings-strings.js";
18
18
  import { layoutText } from "./settings-layout.js";
19
+ import { dateTimeText } from "/assets/clock-text.js";
19
20
  import "./settings-revoke-strings.js"; // the revoke card's own words: a file of its own (PR #3553 review: a retained settings-access-strings.js would lack them)
20
21
  import "./settings-access-strings.js"; // revAuthorityBriefWeb / revAuthorityEnabledWeb / revAuthorityRule: an older settings-layout.js from a tab that visited Fleet first lacks them (#3061)
21
22
 
@@ -80,7 +81,7 @@ export function WebAuthorityCard({ ctx, staged, disabled = false }) {
80
81
  const hoursError = f.hours !== null && (!Number.isFinite(f.hours) || f.hours < overview.hours.min || f.hours > overview.hours.max) ? "vaHoursRange" : "";
81
82
  const stuckOff = f.enabled && original.enabled && !overview.state.enabled;
82
83
  const warnHosts = !f.loopbackOnly && overview.lanHosts.length > 0;
83
- const when = (ms) => new Date(ms).toLocaleString();
84
+ const when = (ms) => dateTimeText(ms);
84
85
  const canRevoke = !!(overview.you && overview.you.canRevoke); // AGEND-138: only the verified owner (the server decides)
85
86
 
86
87
  const fc = (cls, key) => `${cls}${!sameValue(f[key], original[key]) ? " s-dirty" : ""}`;
@@ -21,6 +21,7 @@ import { setTextSize, textSizeStore, TEXT_SIZES, usageOffered } from "./header-t
21
21
  import { UsageDialog } from "./usage-dialog.js";
22
22
  import { supportsInstanceFeature } from "./instance-nav.js";
23
23
  import { assetUrl } from "./asset-url.js";
24
+ import { timeText } from "./clock-text.js";
24
25
 
25
26
  register("agentSheet", {
26
27
  en: { sheet: "{0}: more", search: "Search", files: "Files & changes", card: "Card", usage: "Usage", model: "Model & effort", backend: "CLI backend",
@@ -59,7 +60,7 @@ export function usePhone() {
59
60
  const CONTROLS = ["start", "restart", "stop", "pause", "wake", "delete"];
60
61
  /** The item keys the sheet places itself (a tile or a row of its own), never under Appearance. */
61
62
  const PLACED = ["details", "splitChat", "settings", "workspace", "fullWidth", "pins", ...CONTROLS];
62
- const untilClock = (ms) => { try { return new Date(ms).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }); } catch { return ""; } };
63
+ const untilClock = (ms) => { try { return timeText(ms, { hour: "2-digit", minute: "2-digit" }, []); } catch { return ""; } };
63
64
 
64
65
  /**
65
66
  * The header's ⋯ on a phone, and its sheet.
@@ -9,6 +9,7 @@ import { t, lang } from "./app-i18n.js";
9
9
  import { AuthorizeChip, useWebAuthorization } from "./web-authorize.js";
10
10
  import { roleName } from "./device-roles.js"; // its own file: a retained older web-authorize.js has no roleName (PR #3553 review)
11
11
  import { appStore } from "./app-store.js";
12
+ import { timeText, unitText } from "./clock-text.js";
12
13
 
13
14
  async function getJson(url) {
14
15
  try {
@@ -16,8 +17,8 @@ async function getJson(url) {
16
17
  return r.ok ? await r.json() : null;
17
18
  } catch { return null; }
18
19
  }
19
- const clock = (ms) => new Date(ms).toLocaleTimeString(lang() === "zh-TW" ? "zh-TW" : undefined, { hour: "2-digit", minute: "2-digit" });
20
- const span = (ms) => { const m = Math.max(1, Math.round(ms / 60000)); return m >= 90 ? `${Math.round(m / 60)} h` : `${m} min`; };
20
+ const clock = (ms) => timeText(ms, { hour: "2-digit", minute: "2-digit" }, lang() === "zh-TW" ? "zh-TW" : undefined);
21
+ const span = (ms) => { const m = Math.max(1, Math.round(ms / 60000)); return m >= 90 ? unitText(Math.round(m / 60), "h") : unitText(m, "min"); };
21
22
 
22
23
  export function SessionMenu() {
23
24
  const [me, setMe] = useState(undefined); // undefined: not read yet; null: signed out
@@ -58,7 +59,7 @@ export function SessionMenu() {
58
59
  ${!me ? html`<h3>${t("app.signedOut")}</h3><a class="btn" href=${`/signin?next=${encodeURIComponent(location.pathname)}`}>${t("app.signIn")}</a>` : html`
59
60
  <h3>${t("app.signedIn")} · ${me.label}</h3>
60
61
  <p class="sub">${t("app.expires", clock(me.expiresAt), span(me.idleMs))}</p>
61
- ${me.tier === "guest" || me.tier === "read" || (me.tier === "admin" && auth.st) ? html`<p class="role" data-role=${me.tier === "admin" ? (auth.st.state === "verified" ? "owner" : "admin") : me.tier}><span class="sub">${t("webauth.role")}</span> <strong>${roleName(me.tier, !!auth.st && auth.st.state === "verified")}</strong></p>` : null}
62
+ ${me.tier === "guest" || me.tier === "read" || (me.tier === "admin" && auth.st) ? html`<p class="role" data-role=${me.tier === "admin" ? (auth.st.state === "verified" ? "owner" : "admin") : me.tier}><span class="sub">${t("webauth.role")}</span> <strong>${me.tier === "guest" ? roleName("guest", typeof me.verifiedUntil === "number", typeof me.verifiedUntil === "number" ? clock(me.verifiedUntil).replace(/ /g, "\u00a0") : undefined) : roleName(me.tier, !!auth.st && auth.st.state === "verified")}</strong></p>` : null}
62
63
  <${AuthorizeChip} />
63
64
  <div class="row">
64
65
  <button type="button" class="btn" onClick=${() => act("POST", "/auth/logout", () => { location.href = "/signin"; })}><${Icon} name="user" size=${16} />${t("app.signOut")}</button>
@@ -309,8 +309,12 @@ function drawTitle() {
309
309
  document.title = `${titleCount ? `(${titleCount}) ` : ""}${titleBase ? `${titleBase} · AgEnD` : "AgEnD"}`;
310
310
  }
311
311
  export function setTitle(text) { titleBase = text || ""; drawTitle(); }
312
+ // M-3710 (#4447 capture check): Needs you's "N contact requests need a verified browser" counts as its N requests, so a
313
+ // count stays the same when the browser is verified and the requests replace the line.
314
+ const needsWeight = (i) => (i?.type === "contact" && i.reason === "contact_verify_needed" ? Math.max(1, Math.floor(Number(i.contactVerify?.count) || 1)) : 1);
315
+ const needsTotal = (needs) => needs.reduce((n, i) => n + needsWeight(i), 0);
312
316
  appStore.subscribe((s) => {
313
- const n = Array.isArray(s.needs) ? s.needs.length : 0;
317
+ const n = Array.isArray(s.needs) ? needsTotal(s.needs) : 0;
314
318
  if (n !== titleCount) { titleCount = n; drawTitle(); }
315
319
  });
316
320
 
@@ -569,7 +573,7 @@ register("phoneNav", {
569
573
  export function needsCount(app) {
570
574
  const needs = Array.isArray(app.needs) ? app.needs : [], proposals = Array.isArray(app.proposals) ? app.proposals : [];
571
575
  const suggestions = needs.filter(i => i?.type === "contact" && i.reason === "contact_restricted_suggestion").length;
572
- return needs.length - suggestions + (suggestions ? 1 : 0) + proposals.length;
576
+ return needsTotal(needs) - suggestions + (suggestions ? 1 : 0) + proposals.length;
573
577
  }
574
578
 
575
579
  export function PanelHeader({ title, sub, children, headingRef, nav, notice, pageControls, pageActions, back = null }) {
@@ -271,7 +271,9 @@ html:has(.shell), html:has(.shell) body { overflow: hidden; }
271
271
  .pop .devices .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
272
272
  .pop .row { display: flex; gap: var(--s-2); flex-wrap: wrap; }
273
273
  .pop .err { color: var(--danger); }
274
- .pop .role { margin: 0; display: flex; gap: var(--s-2); align-items: baseline; flex-wrap: wrap; }
274
+ .pop .role { margin: 0; display: flex; gap: var(--s-2); align-items: baseline; }
275
+ /* M-3651: a long role ("Guest · Verified until 09:16 AM") wraps beside its label, never under a lone "Role". */
276
+ .pop .role strong { flex: 1; min-width: 0; }
275
277
  .pop .webauth-rebind-form { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-1); }
276
278
  .pop .webauth-rebind-form .note, .pop .webauth-rebind-form .err { margin: 0; }
277
279
  .pop .webauth-rebind-field { flex: 1; min-width: 0; } /* the shared .field input (token-sized), not a one-off box */
@@ -1443,6 +1445,8 @@ img.amb-p { object-fit: contain; }
1443
1445
  .webauth-chip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); margin: var(--s-1) 0 0; font-size: var(--fs-xs); }
1444
1446
  .webauth-chip .webauth-ok { color: var(--ok); }
1445
1447
  .webauth-chip .btn-sm { min-height: 24px; }
1448
+ /* M-3710 (#4447 review): Needs you's Authorize this browser is a full touch target on a phone. */
1449
+ @media (pointer: coarse), (max-width: 479px) { .contact-verify-need .webauth-chip .btn-sm { min-height: var(--tap); min-width: var(--tap); } }
1446
1450
  /* #1939 S2a: Settings → Web → Web authority. */
1447
1451
  .s-web-authority .s-va-sessions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
1448
1452
  .s-web-authority .s-va-sessions li { padding: var(--s-2) var(--s-3); border: 1px solid var(--border); border-radius: var(--r-sm); overflow-wrap: anywhere; }
@@ -2875,7 +2879,8 @@ html.oo-immersive .p-fleet > .panel-body { z-index: 50; }
2875
2879
  }
2876
2880
  /* M-3253 (Argon's phone review): the Office on a phone, held upright or turned sideways (a coarse pointer in a short window,
2877
2881
  as fleet-office.js OFFICE_PHONE_Q). Above the office two rows only: Fleet's header, then Find, the view switch and one
2878
- 44 px ⋯ (the Office's tools and Live in a sheet: .oo-sheet) — no wrapping bar. The stage takes the rest; its zoom pill is
2882
+ 44 px ⋯ (the Office's tools and Live in a sheet: .oo-sheet) — no wrapping bar (except under 370 px, M-3727: Find on its own
2883
+ row, the switch and ⋯ under it, so ⋯ stays on screen). The stage takes the rest; its zoom pill is
2879
2884
  −, the zoom, +, fullscreen (Fit and Fill are in the sheet), 44 px each; the zone pills along its foot. */
2880
2885
  @media (max-width: 899px), (pointer: coarse) and (max-height: 500px) and (max-width: 1023px) {
2881
2886
  .oc-office:has(.oo-more-btn) > .oc-bar { flex-wrap: nowrap; padding: var(--s-1) var(--s-3); }
@@ -2885,6 +2890,13 @@ html.oo-immersive .p-fleet > .panel-body { z-index: 50; }
2885
2890
  .oc-tools:has(.oo-more-btn) .seg-inline { flex: none; }
2886
2891
  .oc-tools .oo-more-btn { flex: none; width: var(--tap); height: var(--tap); }
2887
2892
  @media (hover: none) { .oc-tools .oo-more-btn:hover { background: none; } } /* a tap leaves :hover stuck on touch */
2893
+ /* M-3727: Find (at least 88 px), the view switch and ⋯ need about 342 px (en) — more than a 320–360 px phone has: ⋯ went
2894
+ off-screen. There, Find takes the first row and the switch and ⋯ (at the right) the second; every control stays whole. */
2895
+ @media (max-width: 369px) {
2896
+ .oc-office .oc-bar .oc-tools:has(.oo-more-btn) { flex-wrap: wrap; row-gap: var(--s-1); }
2897
+ .oc-tools:has(.oo-more-btn) .oc-find { flex: 1 0 100%; }
2898
+ .oc-tools .oo-more-btn { margin-left: auto; }
2899
+ }
2888
2900
  .oo.phone > :not(.oo-stage):not(dialog) { margin-left: var(--s-3); margin-right: var(--s-3); }
2889
2901
  .oo.phone .oo-stage { min-height: 160px; }
2890
2902
  .oo.phone .oo-mini { display: none; }
@@ -5156,16 +5168,31 @@ html.oo-immersive .p-fleet > .panel-body { z-index: 50; }
5156
5168
  .sidebar.fleet-side .side-new { position: absolute; top: calc(var(--header-h) + max(var(--s-1), env(safe-area-inset-top))); right: var(--s-2); width: var(--tap); height: var(--tap); padding: 0; justify-content: center; }
5157
5169
  .sidebar.fleet-side .side-new .grow { display: none; }
5158
5170
  .sidebar.fleet-side .inst-row-menu, .sidebar.fleet-side .av-cli, .sidebar.fleet-side .v-group-kind, .sidebar.fleet-side .v-meta { display: none !important; }
5159
- .p-fleet > .panel-head .sb-search, .p-fleet > .panel-head .panel-title h1, .p-fleet > .panel-head .panel-actions { display: none !important; }
5160
- /* The title gives way, but a host-memory warning (its subtitle) stays: a line of its own under ☰ and the tabs (#4008 review). */
5161
- .p-fleet > .panel-head .panel-title:not(:has(.host-mem)) { display: none; }
5162
- .p-fleet > .panel-head:has(.host-mem) { flex-wrap: wrap; }
5163
- .p-fleet > .panel-head .panel-title:has(.host-mem) { order: 10; flex: 1 0 100%; min-height: 0; padding-bottom: var(--s-1); }
5171
+ .p-fleet > .panel-head .sb-search, .p-fleet > .panel-head .panel-actions { display: none !important; }
5172
+ /* M-3722: two rows — ☰ and this page's name (a host-memory warning, its subtitle, under it, #4008 review), then every tab
5173
+ as an icon across the whole width, each a full touch target: eight no longer fit beside ☰ at 390 px. A tab's name stays
5174
+ its accessible name (visually hidden). */
5175
+ .p-fleet > .panel-head { flex-wrap: wrap; }
5176
+ .p-fleet > .panel-head .panel-title { flex: 1 1 0; min-width: 0; }
5177
+ .p-fleet > .panel-head .panel-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
5164
5178
  .p-fleet > .panel-head .panel-title .panel-sub:has(.host-mem) { flex: 1 1 auto; width: auto; }
5165
- .p-fleet > .panel-head .fleet-phone-tabs { flex: 1; min-width: 0; order: initial; padding: 0; margin: 0; overflow-x: auto; flex-wrap: nowrap; }
5179
+ .p-fleet > .panel-head .fleet-phone-tabs { order: 20; flex: 1 0 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; min-width: 0; padding: 0; margin: 0; overflow: visible; }
5180
+ .p-fleet > .panel-head .fleet-phone-tabs .seg-item { min-height: var(--tap); min-width: 0; padding: 0; justify-content: center; }
5181
+ /* The tab you are on: a flat accent-tinted pill and the accent icon (≥ 3:1: the cue). The grey tile alone was about 1.2:1; a
5182
+ line under it read as a raised key (the user, #4453). No line, border or shadow; the same in dark. */
5183
+ .p-fleet > .panel-head .fleet-phone-tabs .seg-item.active { color: var(--accent); background: var(--surface-2); background: color-mix(in srgb, var(--accent) 14%, var(--bg)); box-shadow: none; border-color: transparent; }
5184
+ .p-fleet > .panel-head .fleet-phone-tabs .seg-item span { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
5166
5185
  .p-fleet .oc-bar > span:first-child, .p-fleet .oc-bar .org-counts { display: none; }
5167
5186
  .p-fleet .oc-bar .oc-tools { flex-wrap: nowrap; overflow-x: auto; width: 100%; }
5168
5187
  }
5188
+ /* M-3722 (#4453 review): eight 44 px tabs need 352 px. Under 384 px (the gutters would leave less: 360 px phones, 375 px
5189
+ ones) the row runs edge to edge; under 352 px it is two rows of four. Every tab stays a 44 × 44 target. */
5190
+ @media (max-width: 383px) {
5191
+ .p-fleet > .panel-head .fleet-phone-tabs { margin-left: calc(-1 * max(var(--s-4), env(safe-area-inset-left))); margin-right: calc(-1 * max(var(--s-4), env(safe-area-inset-right))); }
5192
+ }
5193
+ @media (max-width: 351px) {
5194
+ .p-fleet > .panel-head .fleet-phone-tabs { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); }
5195
+ }
5169
5196
  /* M-3166 (Argon 2, the user's OK of round 2): on a phone a toast (an agent waiting for you, a result) is one line — a pill that a
5170
5197
  tap puts away — and none shows while the keyboard is up. */
5171
5198
  @media (max-width: 899px), (pointer: coarse) and (max-height: 500px) and (max-width: 1023px) {
@@ -5392,3 +5419,6 @@ html.oo-immersive .p-fleet > .panel-body { z-index: 50; }
5392
5419
  .p-fleet :is(.tb-head-actions, .tb-title, .tb-stats) .btn { min-height: var(--tap); }
5393
5420
  .p-fleet .tb-project-menu .icon-btn { width: var(--tap); height: var(--tap); } /* a project tile's ⋯ */
5394
5421
  }
5422
+
5423
+ /* M-3678: the new owner stop action follows the phone tap target. */
5424
+ @media (max-width: 899px), (pointer: coarse) and (max-height: 500px) and (max-width: 1023px) { .n-actions .hub-close { min-height: var(--tap); min-width: var(--tap); } }
@@ -1,18 +1,21 @@
1
1
  // #1770: the time a chat line shows, read in the fleet's zone (the one chat-logs, fleet.log and the #1586 DMs use) —
2
- // "17:38" today, "Yesterday 17:38", "10/11 17:38" earlier this year, "2025/10/11 17:38" before. The hour and minute keep
3
- // the browser's own format (12- or 24-hour), as they always had. No imports: the thread, the preview panel and the
2
+ // "17:38" today, "Yesterday 17:38", "10/11 17:38" earlier this year, "2025/10/11 17:38" before. In English the hour and
3
+ // minute keep the browser's own format (12- or 24-hour), as they always had; a zh-TW page is on the 24-hour clock
4
+ // (M-3730, the same rule as clock-text.js, read from <html lang>). No imports: the thread, the preview panel and the
4
5
  // tests read it as it is.
5
6
 
6
7
  const cache = new Map();
7
8
  /** One formatter per (kind, zone, locale): a thread may label 500 lines on every render. */
9
+ const zhPage = () => /^zh/i.test(globalThis.document?.documentElement?.lang || "");
8
10
  function fmt(kind, tz, locale) {
9
- const key = `${kind}|${tz || ""}|${locale || ""}`;
11
+ const zh = kind !== "ymd" && (locale ? /^zh/i.test(String(locale)) : zhPage());
12
+ const key = `${kind}|${tz || ""}|${locale || ""}|${zh ? "h23" : ""}`;
10
13
  let f = cache.get(key);
11
14
  if (!f) {
12
15
  const o = kind === "hm" ? { hour: "2-digit", minute: "2-digit" }
13
16
  : kind === "ymd" ? { year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric", hourCycle: "h23" }
14
17
  : { year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", timeZoneName: "short" };
15
- f = new Intl.DateTimeFormat(kind === "ymd" ? "en-US" : (locale || []), { ...o, timeZone: tz || undefined });
18
+ f = new Intl.DateTimeFormat(kind === "ymd" ? "en-US" : zh ? "zh-TW" : (locale || []), { ...o, ...(zh ? { hourCycle: "h23" } : {}), timeZone: tz || undefined });
16
19
  cache.set(key, f);
17
20
  }
18
21
  return f;