@songsid/agend 2.4.0-beta.11 → 2.4.0-beta.13

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 (214) hide show
  1. package/dist/accounts-view.d.ts +29 -0
  2. package/dist/accounts-view.js +2 -14
  3. package/dist/accounts-view.js.map +1 -1
  4. package/dist/agent-endpoint.d.ts +1 -0
  5. package/dist/agent-endpoint.js +4 -2
  6. package/dist/agent-endpoint.js.map +1 -1
  7. package/dist/auth-api.d.ts +2 -0
  8. package/dist/auth-api.js +33 -2
  9. package/dist/auth-api.js.map +1 -1
  10. package/dist/backend/codex.js +11 -0
  11. package/dist/backend/codex.js.map +1 -1
  12. package/dist/backend/types.d.ts +1 -1
  13. package/dist/build-provenance.json +1 -1
  14. package/dist/channel/mcp-server.js +1 -1
  15. package/dist/channel/mcp-server.js.map +1 -1
  16. package/dist/channel/mcp-tools.js +3 -1
  17. package/dist/channel/mcp-tools.js.map +1 -1
  18. package/dist/claude-install-kind.d.ts +19 -0
  19. package/dist/claude-install-kind.js +54 -0
  20. package/dist/claude-install-kind.js.map +1 -0
  21. package/dist/daemon.d.ts +13 -1
  22. package/dist/daemon.js +54 -9
  23. package/dist/daemon.js.map +1 -1
  24. package/dist/dispatcher-liveness.js +2 -2
  25. package/dist/dispatcher-liveness.js.map +1 -1
  26. package/dist/fleet-manager.d.ts +110 -1
  27. package/dist/fleet-manager.js +387 -25
  28. package/dist/fleet-manager.js.map +1 -1
  29. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +7 -0
  30. package/dist/general-knowledge/skills/hub/SKILL.md +25 -0
  31. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +6 -0
  32. package/dist/hub/agent-intro-model.d.ts +38 -0
  33. package/dist/hub/agent-intro-model.js +14 -0
  34. package/dist/hub/agent-intro-model.js.map +1 -0
  35. package/dist/hub/agent-intro-tool.d.ts +35 -0
  36. package/dist/hub/agent-intro-tool.js +83 -0
  37. package/dist/hub/agent-intro-tool.js.map +1 -0
  38. package/dist/hub/client.d.ts +1 -0
  39. package/dist/hub/client.js +26 -0
  40. package/dist/hub/client.js.map +1 -1
  41. package/dist/hub/compose/member.d.ts +13 -5
  42. package/dist/hub/compose/member.js +28 -5
  43. package/dist/hub/compose/member.js.map +1 -1
  44. package/dist/hub/compose/server.d.ts +1 -0
  45. package/dist/hub/compose/server.js +5 -1
  46. package/dist/hub/compose/server.js.map +1 -1
  47. package/dist/hub/http/compose.d.ts +1 -0
  48. package/dist/hub/http/compose.js +28 -5
  49. package/dist/hub/http/compose.js.map +1 -1
  50. package/dist/hub/http/schema.js +6 -0
  51. package/dist/hub/http/schema.js.map +1 -1
  52. package/dist/hub/member/agent-intro.d.ts +28 -0
  53. package/dist/hub/member/agent-intro.js +66 -0
  54. package/dist/hub/member/agent-intro.js.map +1 -0
  55. package/dist/hub/member/room-ask.d.ts +10 -0
  56. package/dist/hub/member/room-ask.js +70 -7
  57. package/dist/hub/member/room-ask.js.map +1 -1
  58. package/dist/hub/member/room-notification.d.ts +1 -1
  59. package/dist/hub/member/room-post.d.ts +6 -3
  60. package/dist/hub/member/room-post.js +9 -3
  61. package/dist/hub/member/room-post.js.map +1 -1
  62. package/dist/hub/protocol.d.ts +172 -4
  63. package/dist/hub/protocol.js +10 -5
  64. package/dist/hub/protocol.js.map +1 -1
  65. package/dist/hub/room-answer-status-model.d.ts +3 -0
  66. package/dist/hub/room-answer-status-model.js +4 -0
  67. package/dist/hub/room-answer-status-model.js.map +1 -0
  68. package/dist/hub/room-brief-model.d.ts +30 -0
  69. package/dist/hub/room-brief-model.js +37 -0
  70. package/dist/hub/room-brief-model.js.map +1 -0
  71. package/dist/hub/room-context-model.d.ts +2 -0
  72. package/dist/hub/room-context-model.js +2 -2
  73. package/dist/hub/room-context-model.js.map +1 -1
  74. package/dist/hub/room-members-model.d.ts +63 -0
  75. package/dist/hub/room-members-model.js +7 -0
  76. package/dist/hub/room-members-model.js.map +1 -0
  77. package/dist/hub/rooms/agents.js +50 -10
  78. package/dist/hub/rooms/agents.js.map +1 -1
  79. package/dist/hub/rooms/brief.d.ts +18 -0
  80. package/dist/hub/rooms/brief.js +39 -0
  81. package/dist/hub/rooms/brief.js.map +1 -0
  82. package/dist/hub/rooms/members-page.d.ts +33 -0
  83. package/dist/hub/rooms/members-page.js +37 -0
  84. package/dist/hub/rooms/members-page.js.map +1 -0
  85. package/dist/hub/rooms/purpose.d.ts +7 -0
  86. package/dist/hub/rooms/purpose.js +14 -0
  87. package/dist/hub/rooms/purpose.js.map +1 -0
  88. package/dist/hub/rooms/service.d.ts +11 -0
  89. package/dist/hub/rooms/service.js +56 -12
  90. package/dist/hub/rooms/service.js.map +1 -1
  91. package/dist/hub/rooms/types.d.ts +6 -2
  92. package/dist/hub/runtime.d.ts +1 -1
  93. package/dist/hub/server.js +27 -1
  94. package/dist/hub/server.js.map +1 -1
  95. package/dist/hub/types.d.ts +9 -5
  96. package/dist/hub-room-reply-warning.d.ts +2 -0
  97. package/dist/hub-room-reply-warning.js +16 -0
  98. package/dist/hub-room-reply-warning.js.map +1 -0
  99. package/dist/instance-lifecycle.d.ts +18 -0
  100. package/dist/instance-lifecycle.js +43 -4
  101. package/dist/instance-lifecycle.js.map +1 -1
  102. package/dist/locale.js +26 -0
  103. package/dist/locale.js.map +1 -1
  104. package/dist/login-controller.d.ts +26 -0
  105. package/dist/login-controller.js +72 -2
  106. package/dist/login-controller.js.map +1 -1
  107. package/dist/native-mcp.js +1 -1
  108. package/dist/native-mcp.js.map +1 -1
  109. package/dist/needs-you-hub.js +1 -1
  110. package/dist/needs-you-hub.js.map +1 -1
  111. package/dist/needs-you.d.ts +12 -1
  112. package/dist/needs-you.js +9 -0
  113. package/dist/needs-you.js.map +1 -1
  114. package/dist/office-share-page.js +1 -1
  115. package/dist/office-share-page.js.map +1 -1
  116. package/dist/outbound-handlers.d.ts +2 -1
  117. package/dist/outbound-handlers.js +19 -4
  118. package/dist/outbound-handlers.js.map +1 -1
  119. package/dist/outbound-schemas.d.ts +10 -0
  120. package/dist/outbound-schemas.js +3 -1
  121. package/dist/outbound-schemas.js.map +1 -1
  122. package/dist/pause-marker.d.ts +1 -1
  123. package/dist/pause-marker.js +1 -1
  124. package/dist/pause-marker.js.map +1 -1
  125. package/dist/public-web-gateway.d.ts +20 -0
  126. package/dist/public-web-gateway.js +66 -5
  127. package/dist/public-web-gateway.js.map +1 -1
  128. package/dist/restart-progress.d.ts +6 -0
  129. package/dist/restart-progress.js +5 -0
  130. package/dist/restart-progress.js.map +1 -1
  131. package/dist/settings-effect.js +17 -1
  132. package/dist/settings-effect.js.map +1 -1
  133. package/dist/tool-permissions.js +3 -3
  134. package/dist/tool-permissions.js.map +1 -1
  135. package/dist/ui/accounts-keepalive.js +2 -1
  136. package/dist/ui/accounts-view.js +2 -1
  137. package/dist/ui/chat-quote.js +3 -261
  138. package/dist/ui/fleet-canvas.js +3 -1
  139. package/dist/ui/fleet-office-skin.js +4 -3
  140. package/dist/ui/fleet-route.js +44 -6
  141. package/dist/ui/fleet-task-view.js +2 -1
  142. package/dist/ui/host-install.js +82 -5
  143. package/dist/ui/hub-agent-intro.js +15 -6
  144. package/dist/ui/hub-ai-apps.js +2 -1
  145. package/dist/ui/hub-attachments.js +81 -3
  146. package/dist/ui/hub-chat-strings.js +2 -1
  147. package/dist/ui/hub-client.js +4 -0
  148. package/dist/ui/hub-grant-picker.js +2 -1
  149. package/dist/ui/hub-group-strings.js +2 -1
  150. package/dist/ui/hub-intro-notice.js +16 -0
  151. package/dist/ui/hub-my-agents.js +7 -3
  152. package/dist/ui/hub-owner-strings.js +2 -1
  153. package/dist/ui/hub-personal-agent.js +2 -1
  154. package/dist/ui/hub-quota.js +2 -1
  155. package/dist/ui/hub-roles-strings.js +2 -1
  156. package/dist/ui/hub-room-composer.js +10 -2
  157. package/dist/ui/hub-room-list.js +1 -1
  158. package/dist/ui/hub-room-members.js +2 -0
  159. package/dist/ui/hub-room-new-strings.js +2 -1
  160. package/dist/ui/hub-room-new.js +7 -4
  161. package/dist/ui/hub-room-purpose.js +19 -0
  162. package/dist/ui/hub-room-search.js +1 -1
  163. package/dist/ui/hub-room-settings.js +9 -0
  164. package/dist/ui/hub-room-source.js +2 -1
  165. package/dist/ui/hub-room-strings.js +6 -4
  166. package/dist/ui/hub-room-thread.js +68 -17
  167. package/dist/ui/hub-strings.js +2 -1
  168. package/dist/ui/hub-teams.js +2 -1
  169. package/dist/ui/model-picker.js +3 -2
  170. package/dist/ui/panel-chat.js +25 -7
  171. package/dist/ui/panel-hub.js +67 -20
  172. package/dist/ui/panel-needs.js +3 -2
  173. package/dist/ui/panel-runtimes.js +2 -1
  174. package/dist/ui/reply-file-preview.js +2 -1
  175. package/dist/ui/settings-access-overview.js +2 -1
  176. package/dist/ui/settings-connector.js +2 -1
  177. package/dist/ui/shared/agent-sheet.js +2 -1
  178. package/dist/ui/shared/app-i18n.js +2 -2
  179. package/dist/ui/shared/app-shell.js +39 -9
  180. package/dist/ui/shared/app.css +11 -0
  181. package/dist/ui/shared/app.js +3 -1
  182. package/dist/ui/shared/asset-url.d.ts +2 -0
  183. package/dist/ui/shared/asset-url.js +20 -0
  184. package/dist/ui/shared/chat-msg-actions.js +3 -1
  185. package/dist/ui/shared/chat-quote.js +261 -0
  186. package/dist/ui/shared/chat-table-select.js +175 -0
  187. package/dist/ui/shared/hub-chat.css +28 -0
  188. package/dist/ui/shared/hub-rooms-u2.css +5 -0
  189. package/dist/ui/shared/image-annotate.js +2 -1
  190. package/dist/ui/shared/module-warm.d.ts +3 -0
  191. package/dist/ui/shared/module-warm.js +39 -0
  192. package/dist/ui/shared/ui-states.js +3 -2
  193. package/dist/ui/shared/view-history.js +2 -1
  194. package/dist/ui/subagent-row.js +3 -2
  195. package/dist/ui/usage-pool.js +2 -1
  196. package/dist/ui/workspace-panel.js +2 -1
  197. package/dist/wake-coordinator.js +3 -2
  198. package/dist/wake-coordinator.js.map +1 -1
  199. package/dist/web-api.d.ts +17 -4
  200. package/dist/web-api.js +83 -6
  201. package/dist/web-api.js.map +1 -1
  202. package/dist/web-asset-version.d.ts +65 -0
  203. package/dist/web-asset-version.js +259 -0
  204. package/dist/web-asset-version.js.map +1 -0
  205. package/dist/web-host-guard.js +3 -1
  206. package/dist/web-host-guard.js.map +1 -1
  207. package/dist/web-host-install.d.ts +30 -3
  208. package/dist/web-host-install.js +50 -4
  209. package/dist/web-host-install.js.map +1 -1
  210. package/dist/web-terminal.d.ts +5 -0
  211. package/dist/web-terminal.js +11 -0
  212. package/dist/web-terminal.js.map +1 -1
  213. package/launcher/agend-install.cjs +48 -7
  214. package/package.json +1 -1
@@ -60,6 +60,7 @@ import { applyTheme, clearAmbient, resolvedMode, themeFor, themeImageUrl, themeM
60
60
  import { colorMenuItem } from "/assets/identity-color.js";
61
61
  import { brokenPictures, cardFoldable, IdentityCard, useCard } from "/assets/identity-card.js";
62
62
  import { AgentWidget, instanceBinds, widgetFor } from "/assets/agent-widget.js";
63
+ import { assetUrl } from "/assets/asset-url.js";
63
64
  // #1629 r4 §1: the identity card under the chat's header — hidden by default; shown or not is this device's choice.
64
65
  // #2217 (the user, 2026-10-19): no row of its own; its picture and bio can be folded away (the banner stays) — this
65
66
  // device's choice too, kept the same way. The user (2026-10-20): no control on the card — one card button in the header
@@ -164,6 +165,7 @@ import { createThread, msgKey } from "/assets/chat-thread.js";
164
165
  import { ComposerInput, WorkBarView, touchScreen } from "/assets/chat-composer.js";
165
166
  import { installMessageActions } from "/assets/chat-msg-actions.js";
166
167
  import { composerCaret, insertQuote, installQuoteSelection, showCaret } from "./chat-quote.js";
168
+ import { installTableSelection } from "/assets/chat-table-select.js";
167
169
  import { createEmojiIndex } from "./chat-emojis.js";
168
170
  import { pollPublicPreview } from "./preview-status.js";
169
171
  import { createMentionIndex } from "./chat-mentions.js";
@@ -187,7 +189,7 @@ export function linkWorkBarCss(doc = typeof document !== "undefined" ? document
187
189
  try {
188
190
  if (!doc || !doc.head || doc.querySelector('link[data-chat-work-bar-css="1"]')) return;
189
191
  const link = doc.createElement("link");
190
- link.setAttribute("rel", "stylesheet"); link.setAttribute("href", "/assets/chat-work-bar.css"); link.setAttribute("data-chat-work-bar-css", "1");
192
+ link.setAttribute("rel", "stylesheet"); link.setAttribute("href", assetUrl("/assets/chat-work-bar.css")); link.setAttribute("data-chat-work-bar-css", "1");
191
193
  doc.head.appendChild(link);
192
194
  } catch { /* Stop still works without it */ }
193
195
  }
@@ -722,7 +724,9 @@ function useMedia(query) {
722
724
  /** M-3167: the model's short name for the composer's chip on a desk ("Opus 5.5 (claude-opus-5-5)" → "Opus 5.5"). */
723
725
  export function shortModelName(label) {
724
726
  const s = String(label || "").replace(/\s*\([^)]*\)\s*$/, "").trim();
725
- const family = /^claude-(opus|sonnet|haiku|fable)-(\d+)(?:-(\d+))?/i.exec(s);
727
+ // M-3304: a version is one or two digits each (`5`, `5-5`); a dated id's date is not a minor version —
728
+ // "claude-sonnet-6-20270101" is "Sonnet 6" (was "Sonnet 6.20270101"), "claude-opus-5-5-20261201" "Opus 5.5".
729
+ const family = /^claude-(opus|sonnet|haiku|fable)-(\d{1,2})(?:-(\d{1,2}))?(?![\d.])/i.exec(s);
726
730
  if (family) return `${family[1][0].toUpperCase()}${family[1].slice(1).toLowerCase()} ${family[2]}${family[3] ? `.${family[3]}` : ""}`;
727
731
  return s;
728
732
  }
@@ -875,6 +879,8 @@ function Thread({ name, label = name, th, bindings }) {
875
879
  pinned: (x) => isPinned(name, msgKey(x)),
876
880
  canPin: (x) => !guestPage() && pinOffered(name) && (x.role === "agent" || x.role === "user") && /^[0-9a-f]{1,32}-\d{1,15}$/.test(msgKey(x)),
877
881
  });
882
+ // M-3326: a table's cells selected as a spreadsheet's (a desk: drag down a column or across a block; Ctrl/Cmd+C as TSV).
883
+ const offCells = installTableSelection(ls, { phone: () => typeof matchMedia === "function" && matchMedia("(pointer: coarse)").matches });
878
884
  // M-2789: select a passage in a message → 「引用」 → it goes into the composer as a quote at the caret, repeatable.
879
885
  const offQuote = installQuoteSelection(ls, {
880
886
  field: () => bindings.input.current,
@@ -921,7 +927,7 @@ function Thread({ name, label = name, th, bindings }) {
921
927
  return () => {
922
928
  window.removeEventListener("hashchange", onHash);
923
929
  unfollow();
924
- offActions(); offQuote();
930
+ offActions(); offQuote(); offCells();
925
931
  sc.removeEventListener("scroll", onScroll);
926
932
  ls.removeEventListener("click", thread.onClick);
927
933
  if (mountedThreads.get(name) === owner) mountedThreads.delete(name);
@@ -1087,12 +1093,24 @@ function ModelMenu({ name, c, lease }) {
1087
1093
  // A desk: under the control that opened it (else above the box's left end); a click outside closes it.
1088
1094
  const place = (el) => {
1089
1095
  if (!el) return;
1090
- const at = modelMenuAnchor, w = el.offsetWidth || 320, h = el.offsetHeight || 0;
1096
+ const at = modelMenuAnchor, w = el.offsetWidth || 320;
1091
1097
  const vw = globalThis.innerWidth || 1280, vh = globalThis.innerHeight || 800; // (a test DOM has no viewport)
1092
1098
  let left, top;
1093
- // Under the control, or above it when it sits in the lower half (the composer's chip): never over it.
1094
- if (at) { left = Math.min(Math.max(8, at.right - w), vw - w - 8); top = at.top > vh / 2 ? Math.max(8, at.top - h - 6) : Math.min(at.bottom + 6, vh - h - 8); }
1095
- else { const box = el.closest(".p-chat")?.querySelector(".composer-box")?.getBoundingClientRect(); left = box ? box.left : 16; top = box ? Math.max(8, box.top - h - 8) : 72; }
1099
+ // M-3304 (the user, beta.11): under the control — or above it when it sits in the lower half (the composer's chip) — and
1100
+ // never over it: a list longer than the room there scrolls within the menu (its height capped to that room), instead
1101
+ // of the menu moving up over the control and the header. Its left at the control's (kept in the viewport).
1102
+ if (at) {
1103
+ const up = at.top > vh / 2, room = Math.max(160, Math.floor(up ? at.top - 6 - 8 : vh - at.bottom - 6 - 8));
1104
+ el.style.setProperty("max-height", `${room}px`);
1105
+ const h = Math.min(el.offsetHeight || 0, room);
1106
+ left = Math.min(Math.max(8, at.left), vw - w - 8);
1107
+ top = up ? Math.max(8, at.top - 6 - h) : at.bottom + 6;
1108
+ } else {
1109
+ const box = el.closest(".p-chat")?.querySelector(".composer-box")?.getBoundingClientRect();
1110
+ el.style.setProperty("max-height", `${Math.max(160, Math.floor((box ? box.top : vh) - 16))}px`);
1111
+ const h = el.offsetHeight || 0;
1112
+ left = box ? box.left : 16; top = box ? Math.max(8, box.top - h - 8) : 72;
1113
+ }
1096
1114
  el.style.setProperty("left", `${Math.round(left)}px`); el.style.setProperty("top", `${Math.round(top)}px`);
1097
1115
  };
1098
1116
  return html`<div class="model-menu-scrim" onClick=${close}></div><div class="model-menu-pop" ref=${(el) => { pop.current = el; place(el); }} onKeyDown=${onKeys}>${body}</div>`;
@@ -1,3 +1,4 @@
1
+ import { IntroNotice, introNoticeOffered } from "./hub-intro-notice.js";
1
2
  import { AgentIntroEditor, hi } from "./hub-agent-intro.js";
2
3
  import {hp,personalAgentQuestionHint} from "./hub-personal-agent-strings.js";
3
4
  import * as ownerEntryWords from "./hub-owner-strings.js";
@@ -55,7 +56,10 @@ import { createHubChatStore } from "./hub-chat-store.js";
55
56
  import { QuotaBanner, QuotaCard, QuotaChip, QuotaVisibilityRow } from "./hub-quota.js";
56
57
  import { PageHead } from "/assets/page-head.js";
57
58
  import { bindRoomFeedback, bootHubPreview, downloadHtml, draftWithLine, panelOpenFor, roomPanelKey, roomPanelOpts, setHubPreviewOptIn } from "./hub-preview.js";
58
- import { PendingFiles, hf, pageCarriesFiles, roomTakesFiles, uploadChosen } from "./hub-attachments.js";
59
+ import { DropOverlay, MAX_FILES, PendingFiles, hf, pageCarriesFiles, pasteToAttach, putBackText, roomTakesFiles, uploadChosen, useFileDrop } from "./hub-attachments.js";
60
+ import { composerCaret, insertQuote, installQuoteSelection, showCaret } from "/assets/chat-quote.js";
61
+ import { installTableSelection } from "/assets/chat-table-select.js";
62
+ import { assetUrl } from "/assets/asset-url.js";
59
63
  register("hubAccess", {
60
64
  en: { tag: "Access needs checking", refused: "Asking was refused. Check your access before trying again.", check: "Check access", limited: "Asking was refused; the previous access information needs checking." },
61
65
  "zh-TW": { tag: "需要確認權限", refused: "提問遭到拒絕。請先重新檢查權限,再試一次。", check: "重新檢查權限", limited: "提問遭到拒絕,先前的權限資訊需要重新確認。" },
@@ -209,8 +213,8 @@ export function HubPanel({ route }) {
209
213
  if (s && tab === "ask" && view === "notices" && noticesOffered(s)) return html`<div data-effect-panel="hub" class="panel p-hub p-hub-notices">
210
214
  <${PanelHeader} title=${hc("noticesTitle")}><span class="hub-head-tools"><${HubNotifyToggle} /></span></${PanelHeader}><div data-trust="panel-content" class="panel-body hub-page-body">
211
215
  <div class="col hub-owner hub-notices-col"><p class="s-page-lead hub-page-lead">${roleNoticesOffered(s, hubClient()) ? roleNoticeLead() : directoryNoticesOffered(s, hubClient()) ? dn("pageLead") : hc("noticesLead")}</p>
212
- ${pairingNoticesOffered(s) ? html`<${PairingNotices} admin=${!!s.admin} empty=${directoryNoticesOffered(s, hubClient()) || roleNoticesOffered(s, hubClient()) ? null : html`<${Empty} icon="bell" title=${hc("noNotices")} />`} />` : null}
213
- ${directoryNoticesOffered(s, hubClient()) ? html`<${DirectoryNotices} client=${hubClient()} />` : null}${roleNoticesOffered(s, hubClient()) ? html`<${RoleNotices} client=${hubClient()} />` : null}</div></div></div>`;
216
+ ${pairingNoticesOffered(s) ? html`<${PairingNotices} admin=${!!s.admin} empty=${introNoticeOffered(s,hubClient()) || directoryNoticesOffered(s, hubClient()) || roleNoticesOffered(s, hubClient()) ? null : html`<${Empty} icon="bell" title=${hc("noNotices")} />`} />` : null}
217
+ ${introNoticeOffered(s,hubClient())?html`<${IntroNotice} client=${hubClient()} />`:null}${directoryNoticesOffered(s, hubClient()) ? html`<${DirectoryNotices} client=${hubClient()} />` : null}${roleNoticesOffered(s, hubClient()) ? html`<${RoleNotices} client=${hubClient()} />` : null}</div></div></div>`;
214
218
  // M-3092: the owner's invitations (spec §8), a page of the chats like Notices.
215
219
  if (s && tab === "ask" && view === "invitations" && roomsLive()) return html`<div data-effect-panel="hub" class="panel p-hub p-hub-invitations">
216
220
  <${PanelHeader} title=${hroom("invitationsTitle")} /><div data-trust="panel-content" class="panel-body hub-page-body"><div class="col hub-owner">
@@ -259,7 +263,7 @@ function linkHubSigninCss(doc = typeof document !== "undefined" ? document : nul
259
263
  try {
260
264
  if (!doc || !doc.head || doc.querySelector('link[data-hub-signin-css="1"]')) return;
261
265
  const link = doc.createElement("link");
262
- link.setAttribute("rel", "stylesheet"); link.setAttribute("href", "/assets/hub-signin.css"); link.setAttribute("data-hub-signin-css", "1");
266
+ link.setAttribute("rel", "stylesheet"); link.setAttribute("href", assetUrl("/assets/hub-signin.css")); link.setAttribute("data-hub-signin-css", "1");
263
267
  doc.head.appendChild(link);
264
268
  } catch { /* the page still works without it */ }
265
269
  }
@@ -384,7 +388,7 @@ export const NOTICES_PATH = "/ui/hub?view=notices";
384
388
  export const INVITATIONS_PATH = "/ui/hub?view=invitations";
385
389
  export const MY_TEAMS_PATH = "/ui/hub?view=teams";
386
390
  const pairingNoticesOffered = (s) => !!s && Array.isArray(s.features) && s.features.includes("quick-pairing-v1") && !!hubClient().quickPairingV1;
387
- const noticesOffered = s => pairingNoticesOffered(s) || directoryNoticesOffered(s, hubClient()) || roleNoticesOffered(s, hubClient());
391
+ const noticesOffered = s => introNoticeOffered(s,hubClient()) || pairingNoticesOffered(s) || directoryNoticesOffered(s, hubClient()) || roleNoticesOffered(s, hubClient());
388
392
  const initial = (name) => (String(name || "?").trim()[0] || "?").toUpperCase();
389
393
  const AV_TONES = 6;
390
394
  const tone = (name) => { let h = 0; for (const c of String(name || "")) h = (h * 31 + c.codePointAt(0)) >>> 0; return h % AV_TONES; };
@@ -476,7 +480,7 @@ export function HubSide({ onPick } = {}) {
476
480
  ${/* M-3190 (Argon): 新對話 and 新房間 head the conversation list, not the primary rows. */ ""}
477
481
  <${HubRoomList} rs=${rs} q=${q} setQ=${setQ} filtering=${filtering} setFiltering=${setFiltering} filterRef=${filter} onPick=${onPick} quietEmpty=${home} foot=${roomsLive()}
478
482
  onNew=${() => { if (onPick) onPick(); navigate(NEW_CHAT_PATH); }} onNewRoom=${roomsLive() && rs.me?.canCreateRooms ? () => setNewRoom(true) : null} />
479
- ${newRoom ? html`<${LazyRoomPart} load=${() => import("./hub-room-new.js")} name="NewRoomDialog" props=${{ client: hubClient(), assistant: !!rs.me?.assistant,
483
+ ${newRoom ? html`<${LazyRoomPart} load=${() => import("./hub-room-new.js")} name="NewRoomDialog" props=${{ client: hubClient(), assistant: !!rs.me?.assistant, purposeSupported: roomPurposeLive(),
480
484
  onClose: () => setNewRoom(false), onOpenRoom: (id) => { setNewRoom(false); void refreshRooms(); navigate(roomPath(id)); } }} />` : null}`;
481
485
  }
482
486
 
@@ -523,7 +527,7 @@ function HubHomeList() {
523
527
  const filter = useRef(null);
524
528
  return html`<${HubRoomList} rs=${rs} q=${q} setQ=${setQ} filtering=${filtering} setFiltering=${setFiltering} filterRef=${filter} home=${true} onNew=${() => navigate(NEW_CHAT_PATH)}
525
529
  onNewRoom=${roomsLive() && rs.me?.canCreateRooms ? () => setNewRoom(true) : null} />
526
- ${newRoom ? html`<${LazyRoomPart} load=${() => import("./hub-room-new.js")} name="NewRoomDialog" props=${{ client: hubClient(), assistant: !!rs.me?.assistant,
530
+ ${newRoom ? html`<${LazyRoomPart} load=${() => import("./hub-room-new.js")} name="NewRoomDialog" props=${{ client: hubClient(), assistant: !!rs.me?.assistant, purposeSupported: roomPurposeLive(),
527
531
  onClose: () => setNewRoom(false), onOpenRoom: (id) => { setNewRoom(false); void refreshRooms(); navigate(roomPath(id)); } }} />` : null}`;
528
532
  }
529
533
 
@@ -655,7 +659,7 @@ function ChatLauncher() {
655
659
  <div class="hub-launch-actions">${roomsLive() && rs.me?.canCreateRooms ? html`<button type="button" class="btn btn-primary hub-launch-pill" onClick=${() => setNewRoom(true)}><${Icon} name="room" size=${16} />${hc("launchNewRoom")}</button>` : null}
656
660
  <a class="btn hub-launch-pill" href="/ui/hub/exposures" onClick=${(e) => { if (e.metaKey || e.ctrlKey) return; e.preventDefault(); navigate("/ui/hub/exposures"); }}><${Icon} name="globe" size=${16} />${hc("launchShare")}</a></div></section>` : null}
657
661
  ${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
658
- ${newRoom ? html`<${LazyRoomPart} load=${() => import("./hub-room-new.js")} name="NewRoomDialog" props=${{ client: hubClient(), assistant: !!rs.me?.assistant,
662
+ ${newRoom ? html`<${LazyRoomPart} load=${() => import("./hub-room-new.js")} name="NewRoomDialog" props=${{ client: hubClient(), assistant: !!rs.me?.assistant, purposeSupported: roomPurposeLive(),
659
663
  onClose: () => setNewRoom(false), onOpenRoom: (rid) => { setNewRoom(false); void refreshRooms(); navigate(roomPath(rid)); } }} />` : null}`;
660
664
  return html`<div class="hub-launch">${groupPolicyOn(s, hubClient())
661
665
  ? html`<${LazyGroups} pick=${(m) => m.ChatLauncherFrame || (({ children }) => children)} props=${{ admin: s.admin === true, features: s.features, children: list }} />` : list}</div>`;
@@ -775,12 +779,20 @@ function HubRoomView({ room: given }) {
775
779
  const sent = new Set(chosen.map((f) => f.key));
776
780
  setDraft(""); setFiles(filesRef.current.filter((f) => !sent.has(f.key))); refreshRooms();
777
781
  };
778
- const attach = takesFiles ? { title: hf("attach"), onFiles: async (list) => {
779
- setMsg(null);
780
- const refused = await uploadChosen(client, room.id, list, { current: () => filesRef.current, set: setFiles, alive: () => alive.current });
781
- if (!alive.current) return;
782
- if (refused.length) setMsg(refused.join(" "));
783
- } } : null;
782
+ // M-3311: a paste (#4151 review: this composer's was empty) and a drop attach as the Fleet chat's — `left` and `notice` for them.
783
+ const attach = takesFiles ? { title: hf("attach"), left: () => MAX_FILES - filesRef.current.length, notice: (text) => { if (alive.current) toast(text); },
784
+ onFiles: async (list) => {
785
+ setMsg(null);
786
+ const refused = await uploadChosen(client, room.id, list, { current: () => filesRef.current, set: setFiles, alive: () => alive.current });
787
+ if (!alive.current) return refused;
788
+ if (refused.length) setMsg(refused.join(" "));
789
+ return refused;
790
+ } } : null;
791
+ const mainRef = useRef(null);
792
+ useFileDrop(mainRef, attach);
793
+ // M-3311 (2): 「引用」 on a selected passage goes into this question's box (the thread reads it at selection time; the box is
794
+ // there only while the conversation is open).
795
+ const askExtra = useMemo(() => ({ quote: { field: () => input.current } }), []);
784
796
  const onKeyDown = (e) => { if (globalThis.AgendChatRender?.composerKey(e, { touch: touchScreen() }) === "send") { e.preventDefault(); send(); } };
785
797
  const toggleInfo = () => {
786
798
  if (!wide) { setSheet(true); return; }
@@ -795,14 +807,15 @@ function HubRoomView({ room: given }) {
795
807
  // The panel takes the info rail's place while it shows a page (the rail's button brings the rail back).
796
808
  const showRail = wide && rail && !panelOpen;
797
809
  return html`<div class=${`hub-chat${showRail ? " with-rail" : ""}`} ref=${split}>
798
- <section class="hub-chat-main" aria-label=${name}>
810
+ <section class="hub-chat-main" aria-label=${name} ref=${mainRef}>
811
+ ${attach ? html`<${DropOverlay} />` : null}
799
812
  <header class=${`hub-chat-head${room.answerOnly?" hub-answer-only-head":""}`} data-trust="panel-content">${back}<${Avatar} name=${name} size="sm" />
800
813
  <span class="hub-chat-title"><strong>${name}</strong><span class=${`s${room.answerOnly?" hub-answer-only-note":""}`}>${room.answerOnly?hp("answerOnlyAsker"):room.ownerName ? hc("answersFor", room.ownerName) : ""}</span>${room.intro?html`<span class="s hub-agent-intro-line">${room.intro}</span>`:null}</span>
801
814
  ${tag}
802
815
  <button type="button" class="icon-btn" aria-pressed=${wide ? String(showRail) : undefined} aria-label=${hc("showInfo")} title=${hc("showInfo")} onClick=${toggleInfo}><${Icon} name="info" /></button>
803
816
  <span class="hub-head-tools"><${TextSizeButton} /></span>
804
817
  </header>
805
- <${HubThread} store=${store} name=${name} panelKey=${panelKey} threadRef=${threadRef} />
818
+ <${HubThread} store=${store} name=${name} panelKey=${panelKey} threadRef=${threadRef} extra=${askExtra} />
806
819
  <div class="dock hub-dock" data-trust="composer"><div class="dock-col">
807
820
  ${closed ? html`<p class="hub-banner danger" role="status">${hc("closed")}</p>` : null}
808
821
  ${frozen ? html`<p class="hub-banner warn" role="status">${paused ? t("hubSharing.pausedChat", name) : hc("frozen", name)}</p>` : null}
@@ -812,12 +825,13 @@ function HubRoomView({ room: given }) {
812
825
  ${!closed && !frozen && !denied && !takesFiles ? html`<p class="note hub-files-off" role="status">${hf(pageFiles ? "off" : "reload")}</p>` : null}
813
826
  ${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
814
827
  ${closed ? null : html`<div class="composer-box"><${PendingFiles} files=${files} onRemove=${(key) => setFiles(filesRef.current.filter((f) => f.key !== key))}
828
+ onAsText=${(key) => { const f = filesRef.current.find((x) => x.key === key); if (!f) return; setFiles(filesRef.current.filter((x) => x.key !== key)); putBackText(input.current, f.text); input.current?.focus(); }}
815
829
  formatSize=${(n) => (globalThis.AgendChatRender?.formatSize ? globalThis.AgendChatRender.formatSize(n) : `${n} B`)} />
816
830
  <${ComposerInput} inputRef=${input} value=${draft} placeholder=${hc("composer", name)} onValue=${setDraft}
817
- onKeyDown=${onKeyDown} onPaste=${() => {}} attach=${attach}
831
+ onKeyDown=${onKeyDown} onPaste=${(e) => { if (!frozen && !denied) pasteToAttach(e, attach); }} attach=${attach}
818
832
  stop=${{ hidden: true, disabled: true, title: hc("stop"), label: hc("stop"), onClick: () => {} }}
819
833
  send=${{ hidden: false, disabled: !draft.trim() || sending || frozen || denied || uploading, label: hc("send"), onClick: send }} /></div>`}
820
- ${closed ? null : html`<div class="composer-row"><span class="hint hub-identity">${hw("roomNote")}</span></div>`}
834
+ ${closed ? null : html`<div class="composer-row hub-hints"><span class="hint hub-enter-hint">${t(touchScreen() ? "chat.nativeComposerHintTouch" : "chat.nativeComposerHint")}</span><span class="hint hub-identity">${hw("roomNote")}</span></div>`}
821
835
  </div></div>
822
836
  </section>
823
837
  <${PreviewPanel} name=${panelKey} split=${split} msgs=${() => store.messages()} subscribe=${(fn) => store.subscribe(() => fn(panelKey, "msgs"))}
@@ -894,9 +908,39 @@ function HubThread({ store, name, panelKey, threadRef, extra = null, emptyView =
894
908
  reply: (x) => ex.startReply?.(x),
895
909
  // React opens the thread's picker for that message (extra.react is the thread's own add/remove call, with an emoji).
896
910
  ...(typeof ex.react === "function" ? { react: (x) => thread.pickReaction?.(msgKey(x)), canReact: (x) => !!x.roomMessage && ex.canReact?.(x) !== false, reactLabel: ex.reactLabel } : {}),
911
+ // M-3311 (3): Copy link where the page gives a message an address (a room: extra.linkOf).
912
+ ...(typeof ex.linkOf === "function" ? { linkOf: (x) => ex.linkOf(x) } : {}),
897
913
  });
914
+ // M-3311 (2): the Fleet chat's 「引用」 — a passage selected in one message goes into this conversation's composer as a quote
915
+ // at the caret (chat-quote.js; panel-chat.js's own install), through the box's typing path. `extra.quote.field()`: the box.
916
+ const q = ex.quote;
917
+ const phone = () => typeof matchMedia === "function" && matchMedia("(pointer: coarse)").matches;
918
+ const offQuote = q ? installQuoteSelection(list, {
919
+ field: () => q.field(), canQuote: () => !!q.field() && q.can?.() !== false, phone,
920
+ composerBox: () => q.field()?.closest?.(".composer-box") || null, threadBox: () => sc,
921
+ insert: (text) => {
922
+ const field = q.field(); if (!field) return;
923
+ const value = field.value || "";
924
+ // The caret where the person left it in the box (kept when it lost the focus); never touched: the end.
925
+ const caret = field.dataset.touched === "1" ? composerCaret(field, value) : value.length;
926
+ const r = insertQuote(value, caret, text); if (!r) return;
927
+ const set = typeof HTMLTextAreaElement === "function" ? Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set : null;
928
+ if (set) set.call(field, r.value); else field.value = r.value;
929
+ field.dispatchEvent(new Event("input", { bubbles: true }));
930
+ // After the box redraws: the caret after the quote, in view. A phone keeps its keyboard down.
931
+ setTimeout(() => {
932
+ if (q.field() !== field) return;
933
+ field.dataset.touched = "1";
934
+ try { field.setSelectionRange(r.caret, r.caret); } catch { /* not a text field */ }
935
+ if (!phone()) field.focus();
936
+ showCaret(field, r.caret);
937
+ }, 0);
938
+ },
939
+ }) : () => {};
940
+ // M-3326: the Fleet chat's table cell selection (a desk; chat-table-select.js), in every Hub conversation.
941
+ const offCells = installTableSelection(list, { phone });
898
942
  return () => {
899
- offActions();
943
+ offActions(); offQuote(); offCells();
900
944
  paging = false;
901
945
  off(); offOpt(); offPanel(); sc.removeEventListener("scroll", onScroll); list.removeEventListener("click", thread.onClick);
902
946
  thread.dispose(true); list.remove(); th.current = null; if (threadRef && threadRef.current === thread) threadRef.current = null;
@@ -958,6 +1002,7 @@ function readActivity(exposureId) {
958
1002
  () => ({ ok: false, code: "unreachable" }));
959
1003
  }
960
1004
  function HubMine() {
1005
+ const introSession=useSession();
961
1006
  useStore(navStore); // ?agent= changes without a new route
962
1007
  const [cat, reload] = useRead(() => hubClient().catalog());
963
1008
  const [pairings, reloadPairings] = useRead(() => hubClient().pairings());
@@ -967,7 +1012,7 @@ function HubMine() {
967
1012
  useEffect(() => {
968
1013
  linkHubChatCss(); linkHubOwnerCss();
969
1014
  if (!document.querySelector('link[data-hub-sharing-css="1"]')) {
970
- const link = document.createElement("link"); link.rel = "stylesheet"; link.href = "/assets/hub-sharing.css";
1015
+ const link = document.createElement("link"); link.rel = "stylesheet"; link.href = assetUrl("/assets/hub-sharing.css");
971
1016
  link.setAttribute("data-hub-sharing-css", "1"); document.head.appendChild(link);
972
1017
  }
973
1018
  }, []);
@@ -1003,6 +1048,7 @@ function HubMine() {
1003
1048
  ${p.ownerConfirmed ? html`<span class="tag ok">${hw("confirmed")}</span>` : html`<button type="button" class="btn btn-sm btn-primary" onClick=${() => confirmPairing(p)}>${hw("confirmPairing")}</button>`}
1004
1049
  </div>`)}</div></section>` : null}
1005
1050
  ${!cat ? html`<${Skeleton} variant="rows" lines=${4} />` : cat.error ? html`<${ErrorState} message=${cat.error} onRetry=${reload} />` : null}
1051
+ ${introNoticeOffered(introSession,hubClient())?html`<${IntroNotice} client=${hubClient()} />`:null}
1006
1052
  ${modernSharing ? html`<${LazyRoomPart} load=${() => import("./hub-my-agents.js")} name="HubMyAgents" props=${{ client: hubClient(), scope: session.csrf, shared: mine, policy: groupPolicyOn(session, hubClient()), personal: session.features.includes("personal-agents-v1"), apps: session.features.includes("mcp-apps-v1"), pausable: session.features.includes("sharing-pause-v1"), subjects: session.features.includes("grant-subjects-v1"), onChanged: reload, onAllow: setAllowTarget }} />` : null}
1007
1053
  ${!modernSharing && cat && !cat.error && !mine.length ? html`<div class="center hub-empty"><${Empty} icon="globe" title=${hw("exposuresEmpty")} hint=${hw("exposuresHint")} /></div>` : null}
1008
1054
  ${!modernSharing && mine.length ? html`<section class="card hub-shared"><h3>${ho(mine.some(e => e.kind === "personal") ? "yourAgentsCount" : "sharedCount", mine.length)}</h3>
@@ -1176,6 +1222,7 @@ function LazyRoomPart({ load, name, props = {} }) {
1176
1222
  return C ? html`<${C} ...${props} />` : null;
1177
1223
  }
1178
1224
  const teamsLive = () => { const c = hubClient(); return typeof c.teamsLive === "function" && c.teamsLive() === true; };
1225
+ const roomPurposeLive=()=>session?.features?.includes("room-purpose-v1")&&hubClient().roomPurposeV1===true;
1179
1226
  const roomsLive = () => { const c = hubClient(); return typeof c.roomsLive === "function" && c.roomsLive() === true; };
1180
1227
  function LazyThisHub({ directory }) {
1181
1228
  const [C, setC] = useState(null);
@@ -32,8 +32,8 @@ import { HostDirectoryNotices, hostDirectoryNoticesOffered } from "./hub-host-se
32
32
 
33
33
  // A pre-upgrade tab retains app-i18n.js. Register these reasons when the updated panel is loaded, too.
34
34
  register("app", {
35
- en: { needs_reason_hub_proposal: "Hub action proposed: review locally", needs_reason_hub_execution_hold: "Hub work held: review locally", needs_reason_hub_unavailable: "Hub not running", needs_reason_tmux_hold: "Held: an old tmux server or window" },
36
- "zh-TW": { needs_reason_hub_proposal: "Hub 提議操作:請在本機檢視", needs_reason_hub_execution_hold: "Hub 工作已暫停:請在本機檢視", needs_reason_hub_unavailable: "Hub 未在執行", needs_reason_tmux_hold: "已暫停:舊的 tmux 伺服器或視窗" },
35
+ en: { needs_reason_stale_auth: "Codex needs a restart", needs_stale_auth_detail: "Codex cannot refresh this agent’s current sign-in. Restart the agent; sign in again only if Codex asks.", needs_reason_hub_proposal: "Hub action proposed: review locally", needs_reason_hub_execution_hold: "Hub work held: review locally", needs_reason_hub_unavailable: "Hub not running", needs_reason_tmux_hold: "Held: an old tmux server or window" },
36
+ "zh-TW": { needs_reason_stale_auth: "Codex 需要重新啟動", needs_stale_auth_detail: "Codex 無法更新這個 Agent 執行中使用的登入。請重新啟動 Agent;只有 Codex 要求時才需要重新登入。", needs_reason_hub_proposal: "Hub 提議操作:請在本機檢視", needs_reason_hub_execution_hold: "Hub 工作已暫停:請在本機檢視", needs_reason_hub_unavailable: "Hub 未在執行", needs_reason_tmux_hold: "已暫停:舊的 tmux 伺服器或視窗" },
37
37
  });
38
38
 
39
39
  register("needs", {
@@ -141,6 +141,7 @@ const BAD = new Set(["crashed", "delivery_failed", "hang", "exited"]);
141
141
  * its question or what it lacks; anything else is the server's own words.
142
142
  */
143
143
  function detailOf(item) {
144
+ if (item.reason === "stale_auth") return t("app.needs_stale_auth_detail");
144
145
  if (item.modelSwitch) return modelSwitchText(item.modelSwitch);
145
146
  const c = item.type === "task" ? item.card : null;
146
147
  if (!c || !c.title) return configDetail(item);
@@ -17,13 +17,14 @@ import { credentialProfileView, credentialProfileState } from "./credential-prof
17
17
  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
+ import { assetUrl } from "/assets/asset-url.js";
20
21
 
21
22
  /** 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). */
22
23
  export function linkRuntimeInstallCss(doc = typeof document !== "undefined" ? document : null) {
23
24
  try {
24
25
  if (!doc || !doc.head || doc.querySelector('link[data-runtime-install-css="1"]')) return;
25
26
  const link = doc.createElement("link");
26
- link.setAttribute("rel", "stylesheet"); link.setAttribute("href", "/assets/runtime-install.css"); link.setAttribute("data-runtime-install-css", "1");
27
+ link.setAttribute("rel", "stylesheet"); link.setAttribute("href", assetUrl("/assets/runtime-install.css")); link.setAttribute("data-runtime-install-css", "1");
27
28
  doc.head.appendChild(link);
28
29
  } catch { /* the page still works, only plainer, without it */ }
29
30
  }
@@ -6,13 +6,14 @@ import { Skeleton } from "/assets/ui-states.js";
6
6
  import { WorkspaceFileViewer, linkWorkspaceCss } from "./workspace-panel.js";
7
7
  import { openReplyPreviewImage } from "/assets/image-lightbox.js";
8
8
  import { openReplyFile, openMarkdown, panelStore, closePanel } from "/assets/preview-panel.js";
9
+ import { assetUrl } from "/assets/asset-url.js";
9
10
  register("replyPreview", {
10
11
  en: { button: "Preview {0}", title: "File preview", loading: "Loading file", unoffered: "File previews are not available for this agent.", missing: "This file is no longer in the agent's working folder.", denied: "This preview needs an administrator session and a file inside this agent's working folder.", changed: "The session or working folder changed. Open the preview again.", failed: "The file could not be loaded. Try opening the preview again.", remote: "Previews of files on a paired Windows computer aren't available yet.", lines: "Requested lines: {0}–{1}", readonly: "Read only · current file in this agent's working folder", pdf: "PDF preview" },
11
12
  "zh-TW": { button: "預覽 {0}", title: "檔案預覽", loading: "正在載入檔案", unoffered: "這個 Agent 無法提供檔案預覽。", missing: "這個檔案已不在 Agent 的工作資料夾裡。", denied: "需要管理員登入,且檔案必須在這個 Agent 的工作資料夾裡,才能預覽。", changed: "登入或工作資料夾已變更,請重新開啟預覽。", failed: "無法載入檔案,請重新開啟預覽再試一次。", remote: "目前還無法預覽已配對 Windows 電腦上的檔案。", lines: "指定行數:{0}–{1}", readonly: "唯讀 · 這個 Agent 工作資料夾裡的目前檔案", pdf: "PDF 預覽" },
12
13
  });
13
14
  function linkReplyCss() {
14
15
  if (typeof document === "undefined" || document.querySelector('link[data-reply-preview-css]')) return;
15
- const link = document.createElement("link"); link.rel = "stylesheet"; link.href = "/assets/reply-previews.css"; link.dataset.replyPreviewCss = "1"; document.head.append(link);
16
+ const link = document.createElement("link"); link.rel = "stylesheet"; link.href = assetUrl("/assets/reply-previews.css"); link.dataset.replyPreviewCss = "1"; document.head.append(link);
16
17
  }
17
18
  linkReplyCss();
18
19
  export const replyPreviewLabel = p => t("replyPreview.button", p.path + (p.line ? `:${p.line}${p.endLine && p.endLine !== p.line ? `–${p.endLine}` : ""}` : ""));
@@ -14,6 +14,7 @@ import { sectionPath } from "/assets/app-route.js";
14
14
  import { api } from "./settings-confirm.js";
15
15
  import { agoWords } from "./settings-devices.js";
16
16
  import { roleName } from "/assets/device-roles.js";
17
+ import { assetUrl } from "/assets/asset-url.js";
17
18
 
18
19
  register("accessov", {
19
20
  en: {
@@ -67,7 +68,7 @@ export function linkAccessOverviewCss(doc = typeof document !== "undefined" ? do
67
68
  try {
68
69
  if (!doc || !doc.head || doc.querySelector('link[data-access-overview-css="1"]')) return;
69
70
  const link = doc.createElement("link");
70
- link.setAttribute("rel", "stylesheet"); link.setAttribute("href", "/assets/access-overview.css"); link.setAttribute("data-access-overview-css", "1");
71
+ link.setAttribute("rel", "stylesheet"); link.setAttribute("href", assetUrl("/assets/access-overview.css")); link.setAttribute("data-access-overview-css", "1");
71
72
  doc.head.appendChild(link);
72
73
  } catch { /* the page still works without it */ }
73
74
  }
@@ -3,6 +3,7 @@ import { t } from "/assets/app-i18n.js";
3
3
  import { useLease } from "/assets/app-ctx.js";
4
4
  import { connectorPrompt } from "/assets/connector-prompt.js";
5
5
  import "./settings-connector-strings.js";
6
+ import { assetUrl } from "/assets/asset-url.js";
6
7
  const tr = key => t(`connector.${key}`);
7
8
  export function SettingsConnector() {
8
9
  const lease = useLease("settings-connector");
@@ -23,7 +24,7 @@ export function SettingsConnector() {
23
24
  try { await navigator.clipboard.writeText(prompt); if (lease.current()) setNotice("copied"); }
24
25
  catch { if (lease.current()) setNotice("failed"); }
25
26
  };
26
- return html`<section class="card s-group s-connector" id="connector"><link rel="stylesheet" href="/assets/settings-connector.css" /><div><h3>${tr("title")}</h3><p class="note">${tr("hint")}</p></div>
27
+ return html`<section class="card s-group s-connector" id="connector"><link rel="stylesheet" href=${assetUrl("/assets/settings-connector.css")} /><div><h3>${tr("title")}</h3><p class="note">${tr("hint")}</p></div>
27
28
  <p class="note">${tr("scope")}</p>
28
29
  ${error ? html`<button class="btn s-connector-action" type="button" onClick=${read}>${tr("retry")}</button>`
29
30
  : !info ? html`<p role="status">${tr("loading")}</p>`
@@ -20,6 +20,7 @@ import { Icon } from "./ui-icons.js";
20
20
  import { setTextSize, textSizeStore, TEXT_SIZES, usageOffered } from "./header-tools.js";
21
21
  import { UsageDialog } from "./usage-dialog.js";
22
22
  import { supportsInstanceFeature } from "./instance-nav.js";
23
+ import { assetUrl } from "./asset-url.js";
23
24
 
24
25
  register("agentSheet", {
25
26
  en: { sheet: "{0}: more", search: "Search", files: "Files & changes", card: "Card", usage: "Usage", model: "Model & effort", backend: "CLI backend",
@@ -36,7 +37,7 @@ register("agentSheet", {
36
37
  try {
37
38
  if (typeof document === "undefined" || !document.head || document.querySelector('link[data-chat-work-bar-css="1"]')) return;
38
39
  const link = document.createElement("link");
39
- link.setAttribute("rel", "stylesheet"); link.setAttribute("href", "/assets/chat-work-bar.css"); link.setAttribute("data-chat-work-bar-css", "1");
40
+ link.setAttribute("rel", "stylesheet"); link.setAttribute("href", assetUrl("/assets/chat-work-bar.css")); link.setAttribute("data-chat-work-bar-css", "1");
40
41
  document.head.appendChild(link);
41
42
  } catch { /* the header keeps its desk look */ }
42
43
  })();
@@ -119,7 +119,7 @@ register("app", {
119
119
  confirmTitle: "Please confirm", confirmOk: "Continue", cancel: "Cancel",
120
120
  sidePanelLeave: "Leave {0} without saving? Your changes there will be lost.", sidePanelDiscard: "Discard changes",
121
121
  // The server's own wording (src/locale.ts needs.reason.*), so the web says what Discord says.
122
- needs_reason_kiro_choice: "Kiro needs your decision", needs_reason_hang: "Not responding", needs_reason_exited: "Exited", needs_reason_assist: "Waiting at its terminal", needs_reason_question: "Asking you a question", needs_reason_permission: "Permission needed", needs_reason_dangerous_command: "Dangerous command waiting", needs_reason_login: "Waiting to connect its AI account", needs_reason_dialog: "Waiting at a dialog", needs_reason_terminal_input: "May be waiting for input", needs_reason_auth_paused: "Paused: AI account not connected", needs_reason_backend_signin: "AI account needs connecting", needs_reason_config_invalid: "Configuration file needs attention", needs_reason_hub_proposal: "Hub action proposed: review locally", needs_reason_hub_execution_hold: "Hub work held: review locally", needs_reason_hub_unavailable: "Hub not running", needs_reason_config_fallback: "Running on stored configuration", config_history_edit: "{0}, line {1}, column {2}: {3}. AgEnD is still running on the previous settings. The next restart would use the stored valid copy from {4}. Correct the YAML error; the file has not been changed by AgEnD.", config_history_no_history: "{0}, line {1}, column {2}: {3}. AgEnD is still running on the previous settings. No stored valid copy is available, so the next restart cannot recover automatically. Correct the YAML error before restarting; the file has not been changed by AgEnD.", config_history_fallback: "{0}, line {1}, column {2}: {3}. AgEnD started using the stored valid copy from {4}. Correct the YAML error and reload the settings. The file on disk has not been changed by AgEnD.", needs_reason_general_windows_offline: "General’s Windows PC is offline", needs_reason_general_location_hold: "Run General on", needs_reason_native_pane_hold: "Windows agent needs attention", needs_reason_model_switch: "Claude model switched", needs_reason_crashed: "Crashed", needs_reason_usage_limit: "Usage limit reached · reset time unknown", needs_reason_delivery_uncertain: "Could not confirm delivery", needs_reason_delivery_failed: "Delivery failed", needs_reason_missed_offline: "Missed while AgEnD was offline", needs_reason_task_review: "Waiting for your confirmation", needs_reason_task_blocked: "Blocked: asks you", needs_reason_task_stalled: "Its assignee went quiet",
122
+ needs_reason_kiro_choice: "Kiro needs your decision", needs_reason_hang: "Not responding", needs_reason_exited: "Exited", needs_reason_assist: "Waiting at its terminal", needs_reason_question: "Asking you a question", needs_reason_permission: "Permission needed", needs_reason_dangerous_command: "Dangerous command waiting", needs_reason_login: "Waiting to connect its AI account", needs_reason_dialog: "Waiting at a dialog", needs_reason_terminal_input: "May be waiting for input", needs_reason_auth_paused: "Paused: AI account not connected", needs_reason_stale_auth: "Codex needs a restart", needs_stale_auth_detail: "Codex cannot refresh this agent’s current sign-in. Restart the agent; sign in again only if Codex asks.", needs_reason_backend_signin: "AI account needs connecting", needs_reason_config_invalid: "Configuration file needs attention", needs_reason_hub_proposal: "Hub action proposed: review locally", needs_reason_hub_execution_hold: "Hub work held: review locally", needs_reason_hub_unavailable: "Hub not running", needs_reason_config_fallback: "Running on stored configuration", config_history_edit: "{0}, line {1}, column {2}: {3}. AgEnD is still running on the previous settings. The next restart would use the stored valid copy from {4}. Correct the YAML error; the file has not been changed by AgEnD.", config_history_no_history: "{0}, line {1}, column {2}: {3}. AgEnD is still running on the previous settings. No stored valid copy is available, so the next restart cannot recover automatically. Correct the YAML error before restarting; the file has not been changed by AgEnD.", config_history_fallback: "{0}, line {1}, column {2}: {3}. AgEnD started using the stored valid copy from {4}. Correct the YAML error and reload the settings. The file on disk has not been changed by AgEnD.", needs_reason_general_windows_offline: "General’s Windows PC is offline", needs_reason_general_location_hold: "Run General on", needs_reason_native_pane_hold: "Windows agent needs attention", needs_reason_model_switch: "Claude model switched", needs_reason_crashed: "Crashed", needs_reason_backend_missing: "AI CLI not installed", needs_reason_usage_limit: "Usage limit reached · reset time unknown", needs_reason_delivery_uncertain: "Could not confirm delivery", needs_reason_delivery_failed: "Delivery failed", needs_reason_missed_offline: "Missed while AgEnD was offline", needs_reason_task_review: "Waiting for your confirmation", needs_reason_task_blocked: "Blocked: asks you", needs_reason_task_stalled: "Its assignee went quiet",
123
123
  },
124
124
  "zh-TW": {
125
125
  brand: "AgEnD", fleet: "Fleet", fleetOverview: "Fleet 概覽", view: "檢視", settings: "設定", instances: "Agent", newInstance: "新增 Agent", newAgent: "新增 Agent",
@@ -167,6 +167,6 @@ register("app", {
167
167
  search: "搜尋", searchTitle: "搜尋聊天、agent 之間的訊息與任務({0})",
168
168
  confirmTitle: "請確認", confirmOk: "繼續", cancel: "取消",
169
169
  sidePanelLeave: "不儲存就離開「{0}」?你在那裡的修改會遺失。", sidePanelDiscard: "捨棄修改",
170
- needs_reason_kiro_choice: "Kiro 需要你決定", needs_reason_hang: "沒有回應", needs_reason_exited: "已結束", needs_reason_assist: "在終端機上等待", needs_reason_question: "正在問你問題", needs_reason_permission: "需要權限", needs_reason_dangerous_command: "危險指令待確認", needs_reason_login: "等待連接 AI 帳號", needs_reason_dialog: "停在對話框", needs_reason_terminal_input: "可能在等輸入", needs_reason_auth_paused: "已暫停:AI 帳號未連接", needs_reason_backend_signin: "需要連接 AI 帳號", needs_reason_config_invalid: "設定檔需要處理", needs_reason_hub_proposal: "Hub 提議操作:請在本機檢視", needs_reason_hub_execution_hold: "Hub 工作已暫停:請在本機檢視", needs_reason_hub_unavailable: "Hub 未在執行", needs_reason_config_fallback: "正在使用儲存的設定副本", config_history_edit: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 仍使用先前的設定執行。下次重新啟動會改用 {4} 儲存的有效副本。請修正 YAML 錯誤;AgEnD 未更動此檔案。", config_history_no_history: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 仍使用先前的設定執行。沒有可用的有效副本,下次重新啟動將無法自動恢復。請在重新啟動前修正 YAML 錯誤;AgEnD 未更動此檔案。", config_history_fallback: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 已使用 {4} 儲存的有效副本啟動。請修正 YAML 錯誤並重新載入設定。AgEnD 未更動磁碟上的檔案。", needs_reason_general_windows_offline: "General 所在的 Windows 電腦已離線", needs_reason_general_location_hold: "General 執行位置", needs_reason_native_pane_hold: "Windows Agent 需要處理", needs_reason_model_switch: "Claude 模型已切換", needs_reason_crashed: "已崩潰", needs_reason_usage_limit: "用量已達上限 · 恢復時間未知", needs_reason_delivery_uncertain: "無法確認是否送達", needs_reason_delivery_failed: "傳送失敗", needs_reason_missed_offline: "AgEnD 離線時錯過", needs_reason_task_review: "等你確認", needs_reason_task_blocked: "卡住,在問你", needs_reason_task_stalled: "接手者很久沒有動靜",
170
+ needs_reason_kiro_choice: "Kiro 需要你決定", needs_reason_hang: "沒有回應", needs_reason_exited: "已結束", needs_reason_assist: "在終端機上等待", needs_reason_question: "正在問你問題", needs_reason_permission: "需要權限", needs_reason_dangerous_command: "危險指令待確認", needs_reason_login: "等待連接 AI 帳號", needs_reason_dialog: "停在對話框", needs_reason_terminal_input: "可能在等輸入", needs_reason_auth_paused: "已暫停:AI 帳號未連接", needs_reason_stale_auth: "Codex 需要重新啟動", needs_stale_auth_detail: "Codex 無法更新這個 Agent 執行中使用的登入。請重新啟動 Agent;只有 Codex 要求時才需要重新登入。", needs_reason_backend_signin: "需要連接 AI 帳號", needs_reason_config_invalid: "設定檔需要處理", needs_reason_hub_proposal: "Hub 提議操作:請在本機檢視", needs_reason_hub_execution_hold: "Hub 工作已暫停:請在本機檢視", needs_reason_hub_unavailable: "Hub 未在執行", needs_reason_config_fallback: "正在使用儲存的設定副本", config_history_edit: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 仍使用先前的設定執行。下次重新啟動會改用 {4} 儲存的有效副本。請修正 YAML 錯誤;AgEnD 未更動此檔案。", config_history_no_history: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 仍使用先前的設定執行。沒有可用的有效副本,下次重新啟動將無法自動恢復。請在重新啟動前修正 YAML 錯誤;AgEnD 未更動此檔案。", config_history_fallback: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 已使用 {4} 儲存的有效副本啟動。請修正 YAML 錯誤並重新載入設定。AgEnD 未更動磁碟上的檔案。", needs_reason_general_windows_offline: "General 所在的 Windows 電腦已離線", needs_reason_general_location_hold: "General 執行位置", needs_reason_native_pane_hold: "Windows Agent 需要處理", needs_reason_model_switch: "Claude 模型已切換", needs_reason_crashed: "已崩潰", needs_reason_backend_missing: "AI CLI 沒有安裝", needs_reason_usage_limit: "用量已達上限 · 恢復時間未知", needs_reason_delivery_uncertain: "無法確認是否送達", needs_reason_delivery_failed: "傳送失敗", needs_reason_missed_offline: "AgEnD 離線時錯過", needs_reason_task_review: "等你確認", needs_reason_task_blocked: "卡住,在問你", needs_reason_task_stalled: "接手者很久沒有動靜",
171
171
  },
172
172
  });
@@ -690,6 +690,8 @@ register("pendingSummary", {
690
690
  "host_cli.install_confirm": "Install {0} on the AgEnD host",
691
691
  "host_cli.update": "Update {0} on the AgEnD computer to {1}, the release AgEnD has audited (the registry's update command, run unattended). Only this CLI changes; nothing the page sent is run.",
692
692
  "host_cli.update_latest": "Update {0} on the AgEnD computer to the LATEST release (not audited by AgEnD): the registry's update command for this CLI, run unattended; the CLI's own updater cannot choose a release. Only this CLI changes; nothing the page sent is run.",
693
+ "host_cli.native_switch": "Switch Claude Code on the AgEnD computer from its npm install to Claude's native install: run claude.ai/install.sh for {0}, the release AgEnD has audited (unattended). The npm copy stays until you remove it in a separate step.",
694
+ "host_cli.npm_remove": "Remove the npm copy of Claude Code from the AgEnD computer (npm -g uninstall @anthropic-ai/claude-code, in that copy's own npm prefix). Only after `claude` already runs from the native install.",
693
695
  "runtime_cli.install": "Install {0} {1} on the paired Windows computer {2}: the version AgEnD pins, checked on that computer (its pinned hashes, the registry's signatures, the publisher's signature). Only this CLI is installed; nothing the page sent is run. That computer's owner's own switch still has to allow it.",
694
696
  "runtime_cli.update_latest": "If {0} is already on the paired Windows computer {1}, this updates it to the vendor's LATEST release (not audited by AgEnD): the Runtime downloads the release the vendor's own manifest names and checks its checksum and the publisher's signature on that computer before switching to it.",
695
697
  "hub.browserCertificate.replace": "Replace the Hub browser certificate. The member transport identity stays the same.",
@@ -736,6 +738,8 @@ register("pendingSummary", {
736
738
  "host_cli.install_confirm": "在 AgEnD 主機上安裝 {0}",
737
739
  "host_cli.update": "在 AgEnD 這台電腦上把 {0} 更新到 {1}(AgEnD 稽核過的版本),使用登錄表裡的更新指令(無人值守執行)。只會更新這個 CLI;頁面送來的內容不會被執行。",
738
740
  "host_cli.update_latest": "在 AgEnD 這台電腦上把 {0} 更新到「最新版」(未經 AgEnD 稽核):使用登錄表裡這個 CLI 的更新指令(無人值守執行);這個 CLI 自己的更新器無法指定版本。只會更新這個 CLI;頁面送來的內容不會被執行。",
741
+ "host_cli.native_switch": "把 AgEnD 這台電腦上的 Claude Code 從 npm 安裝改成 Claude 的原生安裝:以 claude.ai/install.sh 安裝 {0}(AgEnD 稽核過的版本,無人值守執行)。npm 那份會留著,等你另外移除。",
742
+ "host_cli.npm_remove": "從 AgEnD 這台電腦移除 npm 安裝的 Claude Code(在那份所在的 npm 目錄執行 npm -g uninstall @anthropic-ai/claude-code)。只有在 `claude` 已經改用原生安裝時才會執行。",
739
743
  "runtime_cli.install": "在已配對的 Windows 電腦 {2} 上安裝 {0} {1}:AgEnD 固定的版本,並在那台電腦上檢查(固定的雜湊、registry 簽章、發行者簽章)。只會安裝這個 CLI;頁面送來的內容不會被執行。仍需要那台電腦主人自己的開關允許。",
740
744
  "runtime_cli.update_latest": "如果已配對的 Windows 電腦 {1} 上已經有 {0},這會把它更新到廠商的「最新版」(未經 AgEnD 稽核):Runtime 會下載廠商自己的 manifest 指定的版本,並在那台電腦上檢查它的雜湊與發行者簽章,才會切換過去。",
741
745
  "hub.browserCertificate.replace": "更換 Hub 瀏覽器憑證;成員傳輸身分保持不變。",
@@ -783,6 +787,8 @@ const pendingSummaryArguments = Object.fromEntries([
783
787
  ["host_cli.install_confirm", "s"],
784
788
  ["host_cli.update", "ss"],
785
789
  ["host_cli.update_latest", "s"],
790
+ ["host_cli.native_switch", "s"],
791
+ ["host_cli.npm_remove", ""],
786
792
  ["runtime_cli.install", "sss"],
787
793
  ["runtime_cli.update_latest", "ss"],
788
794
  ["hub.browserCertificate.replace", ""],
@@ -1311,7 +1317,22 @@ export function Shell({ panels, onNewInstance, viewOnly = false }) {
1311
1317
  let composedAt = -Infinity, pendH = 0, pendTop = 0;
1312
1318
  const now = () => (typeof performance !== "undefined" ? performance.now() : Date.now());
1313
1319
  const frame = typeof requestAnimationFrame === "function" ? requestAnimationFrame : null;
1314
- const unfit = (el) => { if (el?.style) { el.style.removeProperty("height"); el.style.removeProperty("transform"); } };
1320
+ // M-3327 (the user's iPhone recording, beta.11): the shell no longer chases the browser's pan with translateY(offsetTop).
1321
+ // iOS animates its pan (to show the box) and takes it back once the shell is the view's height; the transform followed
1322
+ // the readings, not the pan on screen, so the header dropped to mid-screen over a black band, the box was pushed under
1323
+ // the keyboard (which panned again: a runaway), then everything snapped back. The shell stays at the top, the view's
1324
+ // height, and a pan is undone (scrollTo 0) — the box is in view without one.
1325
+ const unpan = (top) => { if (top > 0 && typeof window.scrollTo === "function") { try { window.scrollTo(0, 0); } catch { /* not scrollable */ } } };
1326
+ // M-3327: the keyboard going away (the field left for something that is not a text field): iOS reports the taller view
1327
+ // only once the keyboard has gone (~350 ms), so following the view held the box mid-air over the page's background, then
1328
+ // dropped it in one frame. Now the shell takes its full height (the tallest view at this width) at the focusout, easing
1329
+ // down (data-kb-closing: app.css) while the keyboard slides away over it (the keyboard state is down already: no field).
1330
+ // The ease lasts its own time once started (CLOSE_MS ≥ app.css's 0.26 s), whenever iOS's late reading comes: taking the
1331
+ // attribute away mid-way would cut the transition short (a snap) — so the result never depends on the event order.
1332
+ const CLOSE_MS = 320;
1333
+ let leaving = false, closingUntil = 0;
1334
+ const closing = (el, on) => { if (el?.setAttribute) { if (on) el.setAttribute("data-kb-closing", ""); else el.removeAttribute("data-kb-closing"); } };
1335
+ const unfit = (el) => { if (el?.style) { el.style.removeProperty("height"); el.style.removeProperty("transform"); } closing(el, false); closingUntil = 0; };
1315
1336
  const fit = () => {
1316
1337
  const el = root.current;
1317
1338
  if (!el?.style) return;
@@ -1329,16 +1350,15 @@ export function Shell({ panels, onNewInstance, viewOnly = false }) {
1329
1350
  const h = composingNow && fitH && w === fitW && seen > fitH ? fitH : seen;
1330
1351
  const settled = fitH && typingNow && w === fitW && now() >= followUntil;
1331
1352
  if (settled && Math.abs(h - fitH) <= NUDGE_PX && Math.abs(top - fitTop) <= NUDGE_PX) { moveSince = 0; return; } // a nudge
1332
- if (settled && (h !== fitH || top !== fitTop) && !(fitH - h > KEYBOARD_MIN_PX)) {
1353
+ // M-3327: a pan of a keyboard's height is the keyboard coming up (a tap on a box that already had the focus: no focus
1354
+ // event, so no follow window), never a key's nudge — undone at once, like the keyboard's own height.
1355
+ if (settled && (h !== fitH || top !== fitTop) && !(fitH - h > KEYBOARD_MIN_PX) && !(top - fitTop > KEYBOARD_MIN_PX)) {
1333
1356
  if (!moveSince || Math.abs(h - pendH) > NUDGE_PX || Math.abs(top - pendTop) > NUDGE_PX) { moveSince = now(); pendH = h; pendTop = top; }
1334
1357
  const held = DOWN_HOLD_MS - (now() - moveSince);
1335
1358
  const growWait = h > fitH && h - fitH <= KEYBOARD_MIN_PX ? composedAt + IME_GROW_HOLD_MS - now() : 0;
1336
1359
  if (held > 0 || growWait > 0) { // not held yet: the shell stays as it is
1337
1360
  // Held, but a grow after a composition still waits: the place (a pan) is followed now, the height later.
1338
- if (held <= 0 && Math.abs(top - fitTop) > NUDGE_PX) {
1339
- fitTop = top;
1340
- if (top) el.style.setProperty("transform", `translateY(${top}px)`); else el.style.removeProperty("transform");
1341
- }
1361
+ if (held <= 0 && Math.abs(top - fitTop) > NUDGE_PX) { fitTop = top; unpan(top); }
1342
1362
  const left = held > 0 ? held : growWait;
1343
1363
  if (!moveTimer && typeof setTimeout === "function") moveTimer = setTimeout(() => { moveTimer = 0; fit(); }, left + 20);
1344
1364
  return;
@@ -1348,10 +1368,19 @@ export function Shell({ panels, onNewInstance, viewOnly = false }) {
1348
1368
  // A reading that says "down" while the field keeps focus is on hold (below): until it holds, the shell keeps the height
1349
1369
  // it had, so the box does not drop under a keyboard that is still there.
1350
1370
  const pending = downSince && now() - downSince < DOWN_HOLD_MS && fitH;
1351
- fitH = pending ? fitH : h;
1371
+ // Leaving the field: the full height at once (not the view, which is still the keyboard's for a while).
1372
+ // Leaving the field: the full height whatever the view says. Eased only while the view still says keyboard (iOS's
1373
+ // reading comes once it has gone: then the keyboard is still on screen, sliding away over the shell); a view already
1374
+ // grown (its reading came first) means the keyboard has gone — at once.
1375
+ const left = leaving && !typingNow && !composingNow;
1376
+ const gone = left && tallest > h;
1377
+ if (gone && !(now() < closingUntil) && tallest - fitH > KEYBOARD_MIN_PX) closingUntil = now() + CLOSE_MS;
1378
+ fitH = gone ? tallest : left ? h : pending ? fitH : h;
1352
1379
  fitTop = top; fitW = w;
1380
+ closing(el, now() < closingUntil);
1353
1381
  el.style.setProperty("height", `${fitH}px`);
1354
- if (top) el.style.setProperty("transform", `translateY(${top}px)`); else el.style.removeProperty("transform");
1382
+ el.style.removeProperty("transform");
1383
+ unpan(top);
1355
1384
  };
1356
1385
  const follow = () => {
1357
1386
  if (!frame || !coarse()) return;
@@ -1388,7 +1417,8 @@ export function Shell({ panels, onNewInstance, viewOnly = false }) {
1388
1417
  if (up !== was) shellStore.set({ keyboard: up });
1389
1418
  fit();
1390
1419
  };
1391
- const focusChanged = () => { check(); follow(); };
1420
+ // M-3327: a focusout whose focus goes to another text field is not the keyboard going away (it stays up).
1421
+ const focusChanged = (e) => { leaving = e?.type === "focusout" && !isTextEntry(e.relatedTarget); check(); follow(); };
1392
1422
  const start = (e) => { composing = (e && e.target) || document.activeElement || null; };
1393
1423
  const end = () => { composing = null; composedAt = now(); check(); };
1394
1424
  check();
@@ -62,6 +62,10 @@ a { color: inherit; text-decoration: none; }
62
62
  inside it (an .sr-only label), so its overflow: hidden clips it — an absolute element whose containing block is the
63
63
  viewport escapes every scroll container and made the whole page scroll (alpha.2: two scrollbars on /ui/chat). */
64
64
  .shell { display: flex; height: 100vh; height: 100dvh; overflow: hidden; position: relative; }
65
+ /* M-3327: the keyboard going away — the shell takes its full height at the focusout and eases down with the keyboard
66
+ (app-shell.js sets data-kb-closing only then), instead of hanging at the keyboard's height and dropping in one frame. */
67
+ .shell[data-kb-closing] { transition: height 0.26s cubic-bezier(0.32, 0.72, 0, 1); }
68
+ @media (prefers-reduced-motion: reduce) { .shell[data-kb-closing] { transition: none; } }
65
69
  html:has(.shell), html:has(.shell) body { overflow: hidden; }
66
70
  .skip { position: absolute; left: var(--s-2); top: -60px; z-index: 100; background: var(--accent-fill); color: var(--on-accent); padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); }
67
71
  .skip:focus { top: var(--s-2); }
@@ -1049,6 +1053,13 @@ html.lb-open .scroller { overflow: hidden; }
1049
1053
  wrapper instead. A column keeps at least 5em: CJK text can break between any two characters. */
1050
1054
  .msg .md th, .msg .md td, .text-card .tc-table th, .text-card .tc-table td { overflow-wrap: break-word; word-break: normal; min-width: 5em; }
1051
1055
  .msg .md .al-c { text-align: center; } .msg .md .al-r { text-align: right; }
1056
+ /* M-3326: a table's cells selected as a spreadsheet's (chat-table-select.js): while cells are selected the browser's own
1057
+ text selection stays off the table, and the selected cells show the selection's tint over their own background. */
1058
+ .msg .md table.cells-on, .msg .tc-table.cells-on { -webkit-user-select: none; user-select: none; }
1059
+ .msg .md td.cell-sel, .msg .md th.cell-sel, .msg .tc-table td.cell-sel, .msg .tc-table th.cell-sel {
1060
+ background-image: linear-gradient(var(--accent-dim), var(--accent-dim)), linear-gradient(var(--accent-dim), var(--accent-dim));
1061
+ box-shadow: inset 0 0 0 1px var(--accent);
1062
+ }
1052
1063
  .msg .md h3, .msg .md h4, .msg .md h5, .msg .md h6 { margin: var(--s-3) 0 var(--s-2); font-size: var(--fs-md); font-weight: var(--fw-semibold); }
1053
1064
  .msg .md .tk-k { color: var(--tk-k); } .msg .md .tk-s { color: var(--tk-s); } .msg .md .tk-n { color: var(--tk-n); } .msg .md .tk-c { color: var(--tk-c); font-style: italic; }
1054
1065
  .codeblock { margin: var(--s-2) 0; border-radius: var(--r-md); overflow: hidden; background: var(--code-bg); position: relative; }