@songsid/agend 2.4.0-beta.21 → 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 (276) 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/backend/claude-code.js +3 -0
  10. package/dist/backend/claude-code.js.map +1 -1
  11. package/dist/build-provenance.json +1 -1
  12. package/dist/cache-ledger.d.ts +23 -21
  13. package/dist/cache-ledger.js +70 -6
  14. package/dist/cache-ledger.js.map +1 -1
  15. package/dist/cache-prices.d.ts +8 -6
  16. package/dist/cache-prices.js +12 -5
  17. package/dist/cache-prices.js.map +1 -1
  18. package/dist/cache-service.d.ts +9 -5
  19. package/dist/cache-service.js +202 -50
  20. package/dist/cache-service.js.map +1 -1
  21. package/dist/channel/mcp-tools.js +8 -1
  22. package/dist/channel/mcp-tools.js.map +1 -1
  23. package/dist/classic-channel-manager.d.ts +1 -1
  24. package/dist/classic-channel-manager.js +2 -2
  25. package/dist/classic-channel-manager.js.map +1 -1
  26. package/dist/cli-audited.js +2 -1
  27. package/dist/cli-audited.js.map +1 -1
  28. package/dist/cli.js +4 -1
  29. package/dist/cli.js.map +1 -1
  30. package/dist/contact-auth-api.js +3 -1
  31. package/dist/contact-auth-api.js.map +1 -1
  32. package/dist/contact-auth-policy.js +1 -1
  33. package/dist/contact-auth-policy.js.map +1 -1
  34. package/dist/contact-auth-service.js +8 -2
  35. package/dist/contact-auth-service.js.map +1 -1
  36. package/dist/contact-auth-store.d.ts +31 -2
  37. package/dist/contact-auth-store.js +106 -12
  38. package/dist/contact-auth-store.js.map +1 -1
  39. package/dist/contact-auth-types.d.ts +3 -2
  40. package/dist/contact-auth-types.js.map +1 -1
  41. package/dist/contact-change-proposals.d.ts +18 -1
  42. package/dist/contact-change-proposals.js +41 -6
  43. package/dist/contact-change-proposals.js.map +1 -1
  44. package/dist/contact-state-view.d.ts +103 -0
  45. package/dist/contact-state-view.js +80 -0
  46. package/dist/contact-state-view.js.map +1 -0
  47. package/dist/daemon.d.ts +31 -0
  48. package/dist/daemon.js +149 -2
  49. package/dist/daemon.js.map +1 -1
  50. package/dist/delivery-outbox.d.ts +10 -0
  51. package/dist/delivery-outbox.js +21 -0
  52. package/dist/delivery-outbox.js.map +1 -1
  53. package/dist/fleet-manager.d.ts +183 -15
  54. package/dist/fleet-manager.js +628 -96
  55. package/dist/fleet-manager.js.map +1 -1
  56. package/dist/general-knowledge/skills/admin/SKILL.md +52 -0
  57. package/dist/general-knowledge/skills/concepts/SKILL.md +14 -17
  58. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +6 -3
  59. package/dist/general-knowledge/skills/hub/SKILL.md +12 -4
  60. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +54 -9
  61. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +1 -1
  62. package/dist/general-role.d.ts +1 -1
  63. package/dist/general-role.js +1 -0
  64. package/dist/general-role.js.map +1 -1
  65. package/dist/hub/agent-pictures-model.d.ts +128 -0
  66. package/dist/hub/agent-pictures-model.js +43 -4
  67. package/dist/hub/agent-pictures-model.js.map +1 -1
  68. package/dist/hub/agent-pictures.d.ts +14 -2
  69. package/dist/hub/agent-pictures.js +65 -12
  70. package/dist/hub/agent-pictures.js.map +1 -1
  71. package/dist/hub/client.d.ts +2 -0
  72. package/dist/hub/client.js +14 -2
  73. package/dist/hub/client.js.map +1 -1
  74. package/dist/hub/compose/member.d.ts +6 -2
  75. package/dist/hub/compose/member.js +19 -6
  76. package/dist/hub/compose/member.js.map +1 -1
  77. package/dist/hub/compose/server.d.ts +5 -5
  78. package/dist/hub/compose/server.js +6 -3
  79. package/dist/hub/compose/server.js.map +1 -1
  80. package/dist/hub/group-policy/resources.d.ts +1 -1
  81. package/dist/hub/http/compose.d.ts +3 -0
  82. package/dist/hub/http/compose.js +14 -7
  83. package/dist/hub/http/compose.js.map +1 -1
  84. package/dist/hub/http/deps.d.ts +1 -0
  85. package/dist/hub/http/schema.js +2 -1
  86. package/dist/hub/http/schema.js.map +1 -1
  87. package/dist/hub/init/text.js +1 -1
  88. package/dist/hub/mcp/policy.d.ts +1 -1
  89. package/dist/hub/member/agent-pictures.d.ts +34 -1
  90. package/dist/hub/member/agent-pictures.js +80 -9
  91. package/dist/hub/member/agent-pictures.js.map +1 -1
  92. package/dist/hub/member/room-ask.d.ts +22 -1
  93. package/dist/hub/member/room-ask.js +99 -5
  94. package/dist/hub/member/room-ask.js.map +1 -1
  95. package/dist/hub/member/room-asker-store.d.ts +48 -0
  96. package/dist/hub/member/room-asker-store.js +181 -0
  97. package/dist/hub/member/room-asker-store.js.map +1 -0
  98. package/dist/hub/protocol.d.ts +152 -0
  99. package/dist/hub/protocol.js +6 -1
  100. package/dist/hub/protocol.js.map +1 -1
  101. package/dist/hub/question-close-model.d.ts +17 -0
  102. package/dist/hub/question-close-model.js +7 -0
  103. package/dist/hub/question-close-model.js.map +1 -0
  104. package/dist/hub/representative.d.ts +15 -0
  105. package/dist/hub/representative.js +64 -1
  106. package/dist/hub/representative.js.map +1 -1
  107. package/dist/hub/room-asker-identity-model.d.ts +53 -0
  108. package/dist/hub/room-asker-identity-model.js +14 -0
  109. package/dist/hub/room-asker-identity-model.js.map +1 -0
  110. package/dist/hub/room-asker-identity.d.ts +22 -0
  111. package/dist/hub/room-asker-identity.js +43 -0
  112. package/dist/hub/room-asker-identity.js.map +1 -0
  113. package/dist/hub/rooms/agents.js +16 -0
  114. package/dist/hub/rooms/agents.js.map +1 -1
  115. package/dist/hub/rooms/asker-identity.d.ts +21 -0
  116. package/dist/hub/rooms/asker-identity.js +86 -0
  117. package/dist/hub/rooms/asker-identity.js.map +1 -0
  118. package/dist/hub/rooms/direct-view.js +1 -0
  119. package/dist/hub/rooms/direct-view.js.map +1 -1
  120. package/dist/hub/rooms/office.d.ts +18 -0
  121. package/dist/hub/rooms/office.js +3 -1
  122. package/dist/hub/rooms/office.js.map +1 -1
  123. package/dist/hub/rooms/service.d.ts +6 -0
  124. package/dist/hub/rooms/service.js +19 -0
  125. package/dist/hub/rooms/service.js.map +1 -1
  126. package/dist/hub/rooms/types.d.ts +1 -1
  127. package/dist/hub/rooms.d.ts +3 -0
  128. package/dist/hub/rooms.js +27 -1
  129. package/dist/hub/rooms.js.map +1 -1
  130. package/dist/hub/server.js +12 -2
  131. package/dist/hub/server.js.map +1 -1
  132. package/dist/hub/types.d.ts +3 -2
  133. package/dist/hub-character-plan.d.ts +47 -0
  134. package/dist/hub-character-plan.js +70 -0
  135. package/dist/hub-character-plan.js.map +1 -0
  136. package/dist/hub-contact-windows.d.ts +13 -1
  137. package/dist/hub-contact-windows.js +35 -2
  138. package/dist/hub-contact-windows.js.map +1 -1
  139. package/dist/hub-picture-reduce.d.ts +21 -1
  140. package/dist/hub-picture-reduce.js +65 -13
  141. package/dist/hub-picture-reduce.js.map +1 -1
  142. package/dist/hub-picture-worker.js +12 -4
  143. package/dist/hub-picture-worker.js.map +1 -1
  144. package/dist/human-delivery-receipts.d.ts +12 -2
  145. package/dist/human-delivery-receipts.js +19 -4
  146. package/dist/human-delivery-receipts.js.map +1 -1
  147. package/dist/instructions.d.ts +1 -1
  148. package/dist/instructions.js +1 -1
  149. package/dist/instructions.js.map +1 -1
  150. package/dist/locale.js +367 -275
  151. package/dist/locale.js.map +1 -1
  152. package/dist/ls-rows.d.ts +2 -0
  153. package/dist/ls-rows.js.map +1 -1
  154. package/dist/needs-you.d.ts +4 -0
  155. package/dist/needs-you.js +3 -2
  156. package/dist/needs-you.js.map +1 -1
  157. package/dist/office-share-page.js +1 -1
  158. package/dist/office-share-page.js.map +1 -1
  159. package/dist/outbound-handlers.d.ts +8 -0
  160. package/dist/outbound-handlers.js +56 -7
  161. package/dist/outbound-handlers.js.map +1 -1
  162. package/dist/outbound-schemas.d.ts +2 -1
  163. package/dist/outbound-schemas.js +3 -2
  164. package/dist/outbound-schemas.js.map +1 -1
  165. package/dist/public-web-gateway.js +18 -0
  166. package/dist/public-web-gateway.js.map +1 -1
  167. package/dist/reply-buttons-controller.d.ts +2 -1
  168. package/dist/reply-buttons-controller.js +1 -1
  169. package/dist/reply-buttons-controller.js.map +1 -1
  170. package/dist/runtime-cli-install.js +4 -4
  171. package/dist/runtime-cli-install.js.map +1 -1
  172. package/dist/tips.js +3 -3
  173. package/dist/tool-permissions.js +1 -1
  174. package/dist/tool-permissions.js.map +1 -1
  175. package/dist/ui/accounts-keepalive.js +2 -1
  176. package/dist/ui/agent-export-strings.js +1 -1
  177. package/dist/ui/agent-page-strings.js +5 -5
  178. package/dist/ui/chat-activity.js +2 -1
  179. package/dist/ui/chat-pins.js +2 -1
  180. package/dist/ui/claude-credentials.js +2 -1
  181. package/dist/ui/contact-auth-client.js +2 -2
  182. package/dist/ui/contact-auth-strings.js +28 -17
  183. package/dist/ui/contact-authorizations.js +6 -4
  184. package/dist/ui/contact-needs.js +6 -1
  185. package/dist/ui/contact-permissions.js +6 -4
  186. package/dist/ui/contact-tool-groups.js +1 -1
  187. package/dist/ui/contact-verify-need.js +46 -0
  188. package/dist/ui/fleet-cache.js +7 -6
  189. package/dist/ui/fleet-canvas.js +1 -1
  190. package/dist/ui/fleet-office-card.js +26 -2
  191. package/dist/ui/fleet-office-layout.js +2 -2
  192. package/dist/ui/fleet-office-skin.js +26 -6
  193. package/dist/ui/fleet-office-view.js +32 -0
  194. package/dist/ui/fleet-office-zones.js +22 -9
  195. package/dist/ui/fleet-office.js +92 -29
  196. package/dist/ui/fleet-org.js +9 -4
  197. package/dist/ui/fleet-tab-icons.js +19 -0
  198. package/dist/ui/fleet-task-activity.js +2 -1
  199. package/dist/ui/fleet-task-common.js +2 -2
  200. package/dist/ui/fleet-task-view.js +2 -1
  201. package/dist/ui/fleet-usage.js +8 -7
  202. package/dist/ui/hub-admin-overview.js +3 -2
  203. package/dist/ui/hub-agent-intro.js +2 -1
  204. package/dist/ui/hub-assistant-admin.js +2 -1
  205. package/dist/ui/hub-chat-strings.js +1 -1
  206. package/dist/ui/hub-directory-notices.js +2 -1
  207. package/dist/ui/hub-enrolment-code.js +2 -1
  208. package/dist/ui/hub-my-agents-strings.js +2 -2
  209. package/dist/ui/hub-my-agents.js +3 -2
  210. package/dist/ui/hub-quick-pairing.js +2 -1
  211. package/dist/ui/hub-role-audit.js +2 -1
  212. package/dist/ui/hub-role-forms.js +3 -2
  213. package/dist/ui/hub-role-view.js +3 -2
  214. package/dist/ui/hub-roles.js +2 -1
  215. package/dist/ui/hub-room-agent-strings.js +2 -1
  216. package/dist/ui/hub-room-list.js +2 -1
  217. package/dist/ui/hub-room-office.js +70 -2
  218. package/dist/ui/hub-room-owner-requests.js +2 -1
  219. package/dist/ui/hub-room-pins.js +2 -1
  220. package/dist/ui/hub-room-presence.js +5 -0
  221. package/dist/ui/hub-room-strings.js +2 -2
  222. package/dist/ui/hub-room-thread.js +1 -1
  223. package/dist/ui/log-row.js +4 -3
  224. package/dist/ui/office-share-dialog.js +2 -1
  225. package/dist/ui/office-share-page.js +2 -1
  226. package/dist/ui/page-share-dialog.js +3 -2
  227. package/dist/ui/panel-chat.js +2 -1
  228. package/dist/ui/panel-details.js +2 -1
  229. package/dist/ui/panel-fleet.js +15 -10
  230. package/dist/ui/panel-hub.js +2 -1
  231. package/dist/ui/panel-log.js +3 -3
  232. package/dist/ui/panel-needs.js +31 -3
  233. package/dist/ui/panel-notices.js +2 -1
  234. package/dist/ui/panel-runtimes.js +4 -3
  235. package/dist/ui/panel-windows-cli.js +3 -2
  236. package/dist/ui/runtime-cli-install.js +3 -2
  237. package/dist/ui/runtime-update-status.js +1 -1
  238. package/dist/ui/settings-access-strings.js +1 -1
  239. package/dist/ui/settings-appearance.js +2 -1
  240. package/dist/ui/settings-guests.js +4 -3
  241. package/dist/ui/settings-hub-member-address.js +2 -1
  242. package/dist/ui/settings-hub-setup-strings.js +1 -1
  243. package/dist/ui/settings-hub-setup.js +2 -1
  244. package/dist/ui/settings-hub-web-address.js +2 -1
  245. package/dist/ui/settings-hub.js +2 -1
  246. package/dist/ui/settings-layout.js +2 -2
  247. package/dist/ui/settings-named-test.js +16 -16
  248. package/dist/ui/settings-public-session-strings.js +2 -2
  249. package/dist/ui/settings-revoke-strings.js +1 -1
  250. package/dist/ui/settings-shared-strings.js +2 -2
  251. package/dist/ui/settings-strings.js +40 -40
  252. package/dist/ui/settings-update.js +2 -1
  253. package/dist/ui/settings-web-authority.js +2 -1
  254. package/dist/ui/shared/agent-sheet.js +2 -1
  255. package/dist/ui/shared/app-session.js +4 -3
  256. package/dist/ui/shared/app-shell.js +7 -3
  257. package/dist/ui/shared/app.css +60 -11
  258. package/dist/ui/shared/chat-strings.js +8 -8
  259. package/dist/ui/shared/chat-time.js +7 -4
  260. package/dist/ui/shared/clock-text.js +57 -0
  261. package/dist/ui/shared/device-roles.js +6 -5
  262. package/dist/ui/shared/instance-nav.js +31 -2
  263. package/dist/ui/shared/usage-dialog.js +2 -1
  264. package/dist/ui/shared/view-strings.js +13 -9
  265. package/dist/ui/shared/web-authorize.js +3 -2
  266. package/dist/ui/subagent-row.js +2 -1
  267. package/dist/web-api.d.ts +15 -2
  268. package/dist/web-api.js +62 -13
  269. package/dist/web-api.js.map +1 -1
  270. package/dist/web-login.d.ts +6 -1
  271. package/dist/web-login.js +8 -3
  272. package/dist/web-login.js.map +1 -1
  273. package/dist/web-session-authorization.d.ts +3 -0
  274. package/dist/web-session-authorization.js +1 -1
  275. package/dist/web-session-authorization.js.map +1 -1
  276. package/package.json +1 -1
@@ -10,6 +10,8 @@
10
10
  import { html, useEffect, useState } from "/assets/app-html.js";
11
11
  import { detailsPath } from "/assets/app-route.js";
12
12
  import { Icon } from "/assets/ui-icons.js";
13
+ import { appStore, useStore } from "/assets/app-store.js";
14
+ import { labelOf } from "/assets/instance-nav.js";
13
15
  import { toast } from "/assets/ui-toast.js";
14
16
  import { confirmDialog } from "/assets/ui-confirm.js";
15
17
  import { ca } from "./contact-auth-strings.js";
@@ -22,12 +24,15 @@ const ID = /^[A-Za-z0-9_-]{1,64}$/;
22
24
  function RequestNeed({ item }) {
23
25
  const ref = item.contactTicket || {};
24
26
  const [tk, setTk] = useState(null);
27
+ // M-3680: the agents by the names the page shows them (the request card below does the same).
28
+ const { instances } = useStore(appStore);
29
+ const agent = (name) => (name ? labelOf((instances || []).find((i) => i.name === name) || { name }) : "");
25
30
  useEffect(() => {
26
31
  let live = true;
27
32
  if (ID.test(String(ref.id || ""))) void getTicket(ref.id).then((r) => { if (live && r.ok) setTk(r.data); });
28
33
  return () => { live = false; };
29
34
  }, [ref.id]);
30
- return html`<div class="n-title"><strong>${ca("needsTitle", ref.source || "", ref.target || "")}</strong></div>
35
+ return html`<div class="n-title"><strong>${ca("needsTitle", agent(ref.source), agent(ref.target))}</strong></div>
31
36
  ${tk ? html`<${TicketCard} ticket=${tk} onChange=${setTk} />` : null}
32
37
  <div class="n-actions">${ID.test(String(ref.id || "")) ? html`<a class="btn btn-sm btn-ghost" href=${`/ui/fleet/authorizations?ticket=${encodeURIComponent(ref.id)}`}>${ca("needsOpen")}</a>` : null}</div>`;
33
38
  }
@@ -19,8 +19,9 @@ import { labelOf } from "/assets/instance-nav.js";
19
19
  import { ContactGrantEditor } from "./contact-grant-editor.js";
20
20
  import { REASONS } from "./contact-authorizations.js";
21
21
  import { groupWouldDisable } from "./contact-tool-groups.js";
22
+ import { dateTimeText } from "/assets/clock-text.js";
22
23
 
23
- const when = (iso) => { const d = new Date(iso); return Number.isFinite(d.getTime()) ? d.toLocaleString([], { dateStyle: "medium", timeStyle: "short" }) : ""; };
24
+ const when = (iso) => { const d = new Date(iso); return Number.isFinite(d.getTime()) ? dateTimeText(d, { dateStyle: "medium", timeStyle: "short" }, []) : ""; };
24
25
  /** A3's guard reason codes (ContactGuardStatus.reason), each said in words (contact-auth-strings.js guardReason_<code>). */
25
26
  const GUARD_REASONS = new Set(["legacy-mode", "unsupported-backend", "unsupported-platform", "unsupported-version", "cli-mode", "load-not-verified", "stale-policy",
26
27
  "stale-launch", "not-running", "invalid-policy", "missing-bound-mcp", "missing-selected-mcp", "guard-files-changed", "invalid-load-receipt", "guard-unavailable", "binary-changed"]);
@@ -105,7 +106,8 @@ export function ContactPermissionsPanel({ name }) {
105
106
  const p = perm.data;
106
107
  useEffect(() => { setEditing(null); }, [name, p?.revision]);
107
108
  if (!p && perm.loading !== false && !perm.error) return html`<${Skeleton} lines=${5} label=${ca("loading")} />`;
108
- if (!p) return perm.error === "forbidden" ? html`<p class="note contact-forbidden">${ca("forbidden")}</p>`
109
+ if (!p) return perm.error === "verification-required" ? html`<p class="note contact-verify">${ca("verifyFirst")}</p>`
110
+ : perm.error === "forbidden" ? html`<p class="note contact-forbidden">${ca("forbidden")}</p>`
109
111
  : html`<${ErrorState} message=${ca(perm.error === "unavailable" ? "unavailable" : "loadFailed")} onRetry=${() => void perm.read()} />`;
110
112
  // Who may change what (the server says; Sentinel's seam): the source room's admins its mode and tools (canSetMode); the
111
113
  // target's approvers its approvers and allowed contacts (canManage).
@@ -119,7 +121,7 @@ export function ContactPermissionsPanel({ name }) {
119
121
  setBusy(false);
120
122
  if (r.ok) { perm.setData(r.data); toast(ca("saved"), true); return true; }
121
123
  if (r.code === "conflict") { await perm.read(); toast(ca("stale"), false); return false; }
122
- toast(ca(r.code === "forbidden" ? "forbidden" : r.code === "unavailable" ? "unavailable" : r.code === "invalid-approver" ? "invalidApprover" : "saveFailed"), false);
124
+ toast(ca(r.code === "verification-required" ? "verifyFirst" : r.code === "forbidden" ? "forbidden" : r.code === "unavailable" ? "unavailable" : r.code === "invalid-approver" ? "invalidApprover" : "saveFailed"), false);
123
125
  return false;
124
126
  };
125
127
  const switchMode = async (mode) => {
@@ -140,7 +142,7 @@ export function ContactPermissionsPanel({ name }) {
140
142
  setBusy(false);
141
143
  if (r.ok) { perm.setData(r.data); toast(ca("originCleared"), true); return; }
142
144
  if (r.code === "conflict") { await perm.read(); toast(ca("stale"), false); return; }
143
- toast(ca(r.code === "forbidden" ? "forbidden" : r.code === "unavailable" ? "unavailable" : "saveFailed"), false);
145
+ toast(ca(r.code === "verification-required" ? "verifyFirst" : r.code === "forbidden" ? "forbidden" : r.code === "unavailable" ? "unavailable" : "saveFailed"), false);
144
146
  };
145
147
  const tools = p.roomTools || { publicRead: false, allowedMcpTools: [], wouldDisable: [] };
146
148
  const setTools = (next) => write({ roomTools: { publicRead: next.publicRead, allowedMcpTools: next.allowedMcpTools } });
@@ -11,7 +11,7 @@
11
11
  /** The kinds of AgEnD tools a restricted room loses, in the order they are shown; each tool in exactly one. */
12
12
  export const TOOL_GROUPS = Object.freeze([
13
13
  { id: "fleet", tools: ["get_fleet_status", "get_fleet_config", "validate_config", "get_effort", "list_models", "kiro_engine_status",
14
- "update_instance_config", "update_fleet_defaults", "migrate_kiro_instance", "reconcile_kiro_instance", "get_web_settings", "set_web_settings", "propose_contact_change"] },
14
+ "update_instance_config", "update_fleet_defaults", "migrate_kiro_instance", "reconcile_kiro_instance", "get_web_settings", "set_web_settings", "propose_contact_change", "contact_state"] },
15
15
  { id: "agents", tools: ["create_instance", "delete_instance", "replace_instance", "start_instance", "stop_instance", "restart_instance",
16
16
  "pause_instance", "wake_instance", "create_team", "update_team", "delete_team"] },
17
17
  { id: "usage", tools: ["get_usage", "get_usage_report", "get_cache_report", "get_instance_logs"] },
@@ -0,0 +1,46 @@
1
+ // M-3710 (R21079937, 11-25: a pending contact request was in no list, not even on this computer). Needs you's line for an
2
+ // admin session with no verified person behind it: how many requests wait (the server sends the count only —
3
+ // reason "contact_verify_needed", contactVerify { count }; never which, who or what), and this browser's own
4
+ // "Authorize this browser" (web-authorize.js: the button, or why it can't be authorized here and where to fix that).
5
+ // Once the account confirms, the server sends Needs you again and the requests themselves replace this line.
6
+ // A module of its own, with its own words (#4447 review): a page still holding an older contact-needs.js or
7
+ // contact-auth-strings.js keeps working and says these words, never their keys.
8
+ import { html } from "/assets/app-html.js";
9
+ import { register, t } from "/assets/app-i18n.js";
10
+ import { Icon } from "/assets/ui-icons.js";
11
+ import { AuthorizeChip } from "/assets/web-authorize.js";
12
+
13
+ register("contactVerifyNeed", {
14
+ en: {
15
+ one: "1 contact request needs a verified browser", many: "{0} contact requests need a verified browser",
16
+ body: "Authorize this browser to see who is asking, and to approve or decline.",
17
+ },
18
+ "zh-TW": {
19
+ one: "有 1 個聯絡申請需要已驗證的瀏覽器", many: "有 {0} 個聯絡申請需要已驗證的瀏覽器",
20
+ body: "授權這個瀏覽器後,才能看到是誰提出,並核准或拒絕。",
21
+ },
22
+ });
23
+ const tv = (k, ...a) => t(`contactVerifyNeed.${k}`, ...a);
24
+ /** The line's title for `count` waiting requests (at least 1). */
25
+ export const verifyNeedTitle = (count) => (count === 1 ? tv("one") : tv("many", count));
26
+ export const verifyNeedBody = () => tv("body");
27
+
28
+ /** A Needs you item that says contact requests wait for a verified browser. */
29
+ export const isContactVerify = (item) => item?.type === "contact" && item.reason === "contact_verify_needed";
30
+ /** How many requests the line stands for: what Needs you's counts add for it (#4447 capture check). */
31
+ export const contactVerifyCount = (item) => Math.max(1, Math.floor(Number(item?.contactVerify?.count) || 1));
32
+
33
+ export function ContactVerifyNeed({ item }) {
34
+ const count = contactVerifyCount(item);
35
+ const title = verifyNeedTitle(count);
36
+ return html`<section class="n-group n-contact-verify" aria-label=${title}>
37
+ <article data-trust="permission" class="n-item contact-need contact-verify-need" data-reason="contact_verify_needed">
38
+ <span class="n-icon"><${Icon} name="key" size=${18} /></span>
39
+ <div class="n-body">
40
+ <div class="n-title"><strong>${title}</strong></div>
41
+ <p class="n-detail">${verifyNeedBody()}</p>
42
+ <${AuthorizeChip} />
43
+ </div>
44
+ </article>
45
+ </section>`;
46
+ }
@@ -8,6 +8,7 @@ import { html } from "/assets/app-html.js";
8
8
  import { t, register } from "/assets/app-i18n.js";
9
9
  import { Empty } from "/assets/ui-states.js";
10
10
  import { Icon } from "/assets/ui-icons.js";
11
+ import { unitText } from "/assets/clock-text.js";
11
12
 
12
13
  register("cache", {
13
14
  en: {
@@ -43,19 +44,19 @@ register("cache", {
43
44
  pricesNote: "牌價查證日期:{0}。", quotaNote: "訂閱方案:Anthropic 與 OpenAI 未公布快取讀取如何計入方案額度,因此節省金額以牌價計算為準,換算成額度則是估算。",
44
45
  estimateNote: "估算:Codex 不記錄快取寫入,寫入量以該次請求未命中快取的輸入估算。",
45
46
  notPricedNote: "有些模型不在價目表中,這些 Agent 以「輸入價格單位」比較。",
46
- scanning: "仍在讀取 transcript——還剩 {0}。重新整理可看到更多。", scanningFirst: "第一次讀取 transcript 中——重新整理可看到更多。", refresh: "重新整理",
47
+ scanning: "仍在讀取對話紀錄——還剩 {0}。重新整理可看到更多。", scanningFirst: "第一次讀取對話紀錄中——重新整理可看到更多。", refresh: "重新整理",
47
48
  keepWarm: "建議保溫", leaveOff: "不需保溫", estimate: "估算", notPriced: "未定價",
48
49
  requests: "請求數", pastTtl: "超過 TTL({0})", expired: "已過期(重寫)", rewritten: "重寫的 token",
49
- expiryCost: "過期成本", share: "占其成本 {0}", pings: "保溫 ping 次數", pingsAfter: "其中 {0} 次在最後一次請求之後",
50
+ expiryCost: "過期成本", share: "佔其成本 {0}", pings: "保溫 ping 次數", pingsAfter: "其中 {0} 次在最後一次請求之後",
50
51
  pingCost: "ping 成本", net: "保溫後淨額", gaps: "請求間隔", ttlLine: "TTL {0}",
51
52
  quiet: "這段期間活動太少,無法判斷。",
52
53
  neverExpired: "沒有任何間隔超過 {0} 的快取時效。", survived: "有 {0} 個間隔超過 {1} TTL,但快取仍在。",
53
- onlyIdle: "沒有任何請求在快取過期後回來使用:每個 session 閒置後就不再使用。保溫只會送出 {0} 次沒人讀的 ping。",
54
+ onlyIdle: "沒有任何請求在快取過期後回來使用:每個工作階段閒置後就不再使用。保溫只會送出 {0} 次沒人讀的 ping。",
54
55
  saves: "常閒置超過 {0} TTL 後又再使用:保溫可省 {1}(過期成本的 {2})。",
55
56
  costsMore: "每次過期約需送 {0} 次 ping——保溫的花費比省下的多 {1}。",
56
57
  costsMoreUnits: "每次過期約需送 {0} 次 ping——保溫的花費比省下的多。",
57
- unavailable: "不提供", creditBilled: "以 credit 計費,沒有快取資料", unsupported: "這個 CLI 沒有快取資料", noData: "尚未讀到任何請求",
58
- shared: "與 {0} 共用工作目錄,無法分辨各自的 transcript",
58
+ unavailable: "不提供", creditBilled: "以點數計費,沒有快取資料", unsupported: "這個 CLI 沒有快取資料", noData: "尚未讀到任何請求",
59
+ shared: "與 {0} 共用工作目錄,無法分辨各自的對話紀錄",
59
60
  empty: "沒有 Agent", emptyHint: "fleet 有 Agent 後會顯示在這裡。",
60
61
  b0: "≤5分", b1: "≤30分", b2: "≤1時", b3: "≤2時", b4: "≤6時", b5: "≤24時", b6: ">24時", tokensUnit: "輸入 token 當量",
61
62
  writeMix: "快取寫入 5 分 / 1 時", effectiveTtl: "實際存活", gapMiss: "{1} 個 5–60 分鐘空檔中有 {0} 個重寫", gapMissNone: "還沒有 5–60 分鐘的空檔",
@@ -82,7 +83,7 @@ export function tokens(n) {
82
83
  return String(Math.round(n));
83
84
  }
84
85
  export function bytes(n) { return n >= 1e9 ? `${(n / 1e9).toFixed(1)} GB` : n >= 1e6 ? `${Math.round(n / 1e6)} MB` : `${Math.max(1, Math.round(n / 1e3))} KB`; }
85
- export function ttlText(sec) { return sec >= 3600 ? `${sec / 3600} h` : `${Math.round(sec / 60)} min`; }
86
+ export function ttlText(sec) { return sec >= 3600 ? unitText(sec / 3600, "h") : unitText(Math.round(sec / 60), "min"); }
86
87
  const pct = (x) => `${x >= 0.1 ? Math.round(x * 100) : (x * 100).toFixed(1)}%`;
87
88
 
88
89
  /** The one line under an instance's recommendation. */
@@ -56,7 +56,7 @@ register("orgc", {
56
56
  expand: "展開", collapse: "收合", members: "{0} 名成員", member: "1 名成員", inFolded: "找到 {0} 個 · 展開", noMembers: "沒有成員",
57
57
  openChat: "開啟聊天", minimap: "總覽:點一下移到那裡",
58
58
  live: "即時", liveOn: "隱藏即時往來", liveOff: "顯示即時往來", lgTask: "delegate_task", lgSend: "send_to_instance",
59
- lgReport: "report_result", lgBroadcast: "broadcast", lgQueued: "排隊中", lgFading: "已送達", lgTeam: "team 之間", legend: "圖例",
59
+ lgReport: "report_result", lgBroadcast: "broadcast", lgQueued: "排隊中", lgFading: "已送達", lgTeam: "團隊之間", legend: "圖例",
60
60
  lgWork: "進行中(直到回報)", lgReturn: "完成(回報送回)", lgStale: "尚未回報",
61
61
  },
62
62
  });
@@ -411,8 +411,32 @@ export function OfficeCard({ model: m, avatar, sheet, place, onChat, onFind, onC
411
411
  const placeNow = useRef(place);
412
412
  placeNow.current = place;
413
413
  useEffect(() => () => { if (placeNow.current) placeNow.current(null); }, []);
414
- // A bottom sheet closes on a swipe down (60 px or more).
415
- const down = (e) => { if (sheet) swipe.current = e.clientY; };
414
+ // A bottom sheet closes on a swipe down (60 px or more). M-3633 (Prism #4414): a sheet whose content scrolls lets the
415
+ // browser scroll it (touch-action pan-y — and a browser that takes a touch for scrolling cancels the pointer, so a
416
+ // swipe there could never finish): it closes from its grip, a handle the browser leaves to the page (touch-action
417
+ // none, kept at its top). One that fits closes from anywhere, as before. `data-scrolls` says which (the CSS).
418
+ const scrolls = () => { const t = box.current, sc = t && ((typeof t.querySelector === "function" && t.querySelector(".oo-card-body")) || t); return !!sc && sc.scrollHeight > sc.clientHeight + 1; };
419
+ // …and (Leader #4414) a card whose content scrolls — a sheet, or a desk card held shorter under an area's name —
420
+ // says there is more below: `data-more` while it is not scrolled to its end, a fade over the pinned actions (the CSS).
421
+ useLayoutEffect(() => {
422
+ const t = box.current;
423
+ if (!t || typeof t.setAttribute !== "function") return undefined;
424
+ const sc = (typeof t.querySelector === "function" && t.querySelector(".oo-card-body")) || t;
425
+ const mark = () => {
426
+ if (sheet && scrolls()) t.setAttribute("data-scrolls", ""); else t.removeAttribute("data-scrolls");
427
+ if (sc.scrollHeight - sc.scrollTop - sc.clientHeight > 2) t.setAttribute("data-more", ""); else t.removeAttribute("data-more");
428
+ };
429
+ mark();
430
+ const RO = globalThis.ResizeObserver, ro = typeof RO === "function" ? new RO(mark) : null;
431
+ if (ro) { ro.observe(t); for (const el of t.querySelectorAll?.(".oo-card-body, .oo-card-body > *, .oo-card > *") ?? []) ro.observe(el); }
432
+ if (typeof sc.addEventListener === "function") sc.addEventListener("scroll", mark, { passive: true });
433
+ return () => { if (ro) ro.disconnect(); if (typeof sc.removeEventListener === "function") sc.removeEventListener("scroll", mark); };
434
+ });
435
+ const down = (e) => {
436
+ if (!sheet) return;
437
+ const onGrip = !!(e.target && typeof e.target.closest === "function" && e.target.closest(".oo-card-grip"));
438
+ swipe.current = onGrip || !scrolls() ? e.clientY : null;
439
+ };
416
440
  const up = (e) => { if (sheet && swipe.current !== null && e.clientY - swipe.current > 60) onClose(); swipe.current = null; };
417
441
 
418
442
  // Legacy default path (packs without `card`): preserve exact markup and classes.
@@ -42,9 +42,9 @@ register("orgl", {
42
42
  "zh-TW": {
43
43
  edit: "編輯配置", title: "編輯配置", coords: "顯示座標", addWaypoint: "新增路徑點", removeWaypoint: "移除路徑點",
44
44
  joinTo: "連到", join: "連接", unjoin: "取消連接 {0}", corridors: "走道", none: "尚未選取:請選座位、家具、門、信件落點或路徑點。",
45
- reset: "還原成 pack 的配置", save: "儲存配置", cancel: "取消", saved: "配置已儲存。", hint: "拖曳,或用方向鍵移動(Shift:一次 10)。",
45
+ reset: "還原成外觀包的配置", save: "儲存配置", cancel: "取消", saved: "配置已儲存。", hint: "拖曳,或用方向鍵移動(Shift:一次 10)。",
46
46
  seat: "{1} 的座位 {0}", furniture: "家具 {0}", night: "家具 {0}(夜間)", door: "門", mail: "信件落點", mailAuto: "信件落點(目前信件落下的位置;拖曳即可指定)", waypoint: "路徑點 {0}", at: "{0},位置 {1}, {2}",
47
- nightReset: "回到 pack 的夜間位置",
47
+ nightReset: "回到外觀包的夜間位置",
48
48
  seatFor: "{1} 的座位 {0},保留給 {2}", reservedFor: "保留給", lend: "不在時借給別人", nobody: "沒有可選的成員。",
49
49
  changed: "有人在這期間修改了辦公室。你的配置已保留:再按一次儲存,會套用到目前的清單。",
50
50
  failed: "配置沒有儲存({0})。", rateLimited: "儲存太頻繁,請一分鐘後再試。",
@@ -38,7 +38,7 @@
38
38
  // @property {(look, at) => {x, y, w, h}} [charBox] zones: the box drawCharacter covers with the feet at `at`
39
39
  // ({ x, y, walking, heading }): what hover and click hit (fleet-office-zones.js personAt)
40
40
  // @property {(ctx, prop, ms, env) => void} drawProp a traffic item in the air: { kind, hue, x, y, t }
41
- // @property {(ctx, x, y, text, env, lift?) => void} drawBubble a speech bubble whose tail points at (x, y), its box `lift` px higher
41
+ // @property {(ctx, x, y, text, env, lift?, flip?) => void} drawBubble a speech bubble whose tail points at (x, y), its box `lift` px higher (`flip`: on the tail's left)
42
42
  // @property {(env) => string} matte #2540: the colour around the scene (the Office fills the panel; the scene is 16:9)
43
43
  // @property {object|null} [backdrop] a pack's loaded background picture (the page samples its edges for the matte)
44
44
  // The desks layout's back and front layers change only when the fleet (or the zoom) does: the renderer keeps them as
@@ -343,19 +343,23 @@ const BUBBLE_FONT = "600 11px system-ui, sans-serif";
343
343
  * The box a speech bubble with its tail at (x, y) takes for `text` (its tail excluded): what drawBubble draws, and what
344
344
  * the Office places so no two overlap (#2431: two neighbours' bubbles covered each other on a phone).
345
345
  */
346
- export function bubbleBox(ctx, x, y, text, lift = 0) {
346
+ export function bubbleBox(ctx, x, y, text, lift = 0, flip = false) {
347
347
  ctx.save();
348
348
  ctx.font = BUBBLE_FONT;
349
349
  const t = fitText(ctx, text, 150), w = Math.ceil((ctx.measureText ? ctx.measureText(t).width : t.length * 6) + 14), h = 19;
350
350
  ctx.restore();
351
- const bx = Math.round(x - 10), by = Math.round(y - h - 6 - lift);
351
+ // M-3722: `flip` puts the box on the tail's left (its tail still under it), for a call whose usual place covers a name.
352
+ const bx = Math.round(flip ? x - w + 14 : x - 10), by = Math.round(y - h - 6 - lift);
352
353
  return { x: bx, y: by, w, h, text: t };
353
354
  }
354
355
 
355
- /** A speech bubble, its tail at (x, y): short words on light paper in either theme; `lift` raises the box (its tail longer). */
356
- function drawBubble(ctx, x, y, text, env, lift = 0) {
356
+ /**
357
+ * A speech bubble, its tail at (x, y): short words on light paper in either theme; `lift` raises the box (its tail
358
+ * longer); `flip` (M-3722) draws the box on the tail's left.
359
+ */
360
+ function drawBubble(ctx, x, y, text, env, lift = 0, flip = false) {
357
361
  if (!text) return;
358
- const { x: bx, y: by, w, h, text: t } = bubbleBox(ctx, x, y, text, lift);
362
+ const { x: bx, y: by, w, h, text: t } = bubbleBox(ctx, x, y, text, lift, flip);
359
363
  ctx.save();
360
364
  ctx.font = BUBBLE_FONT;
361
365
  ctx.fillStyle = "#fffdf6"; ctx.strokeStyle = env.mode === "light" ? "rgba(0, 0, 0, 0.35)" : "rgba(0, 0, 0, 0.6)"; ctx.lineWidth = 1;
@@ -983,6 +987,22 @@ export function loadBuiltInSkin(id, { image = defaultImage } = {}) {
983
987
  }, () => { p.job = null; return null; });
984
988
  return p.job;
985
989
  }
990
+ /**
991
+ * M-3533 R2c: a style with some people drawn in their own characters (a Hub room office: each agent's set from its owner's
992
+ * pack, hub-character-plan.ts). `sets`: name → { pose: strip } (strips as a checked pack's, each a single sheet);
993
+ * `images`: src → a loaded picture. Only the drawing of people changes — the style's scene, desks, tags and words are its
994
+ * own. Someone without a set, or whose set is not wholly loaded, is the style's figure. Set ids are made here, so a name
995
+ * (even "default") never becomes everyone's fallback.
996
+ */
997
+ export function withCharacters(base, sets, images) {
998
+ const names = sets ? Object.keys(sets) : [];
999
+ if (!names.length) return base;
1000
+ const characters = Object.create(null), byInstance = Object.create(null);
1001
+ names.forEach((name, i) => { characters[`set${i}`] = sets[name]; byInstance[name] = `set${i}`; });
1002
+ const sk = spriteSkin({ id: base.id, characters, byInstance, props: {}, room: {}, desk: {} }, images, base);
1003
+ // `ownCharacters`: the scene keeps their speech bubbles inside their area (a taller character's would rise above it).
1004
+ return { ...base, drawCharacter: sk.drawCharacter, charBox: sk.charBox, ownCharacters: true };
1005
+ }
986
1006
  /** #2631: the cozy's picture (loadBuiltInSkin for "cozy"). */
987
1007
  export const loadCozySkin = (opts = {}) => loadBuiltInSkin("cozy", opts);
988
1008
  /** A skin by id: a built-in one, else a pack loaded here (`packs`: id → skin), else the default (pixel). */
@@ -79,6 +79,38 @@ export const desksK = (dpr = 1) => Math.max(1, Math.round(dpr)) / dpr;
79
79
  export const openingView = (w, h, size, dpr, zones, mode = "contain") => (zones ? fitScene(w, h, size, mode) : { k: desksK(dpr), x: 0, y: 0 });
80
80
  /** One axis of clampPan: offset `o` of a scene `s` long in a viewport `n` long. */
81
81
  const clampAxis = (o, s, n) => (s >= n ? Math.min(0, Math.max(n - s, o)) : (n - s) / 2);
82
+ /** How much of the area labels a `cw`×`ch` box at (x, y) covers (px²). */
83
+ const covered = (x, y, cw, ch, avoid) => avoid.reduce((a, r) => a + Math.max(0, Math.min(x + cw, r.x + r.w) - Math.max(x, r.x)) * Math.max(0, Math.min(y + ch, r.y + r.h) - Math.max(y, r.y)), 0);
84
+ /**
85
+ * M-3633: where a person's floating card goes (stage px): beside them — right of `px` by `gap`, else left — level with
86
+ * their head (`py` − 24), inside the stage (`w`×`h`, 8 px clear). Clear of the areas' labels (`avoid`, rects on the
87
+ * stage) where it can be: the same spot when it covers none, else that side lower (just under the label it met), else
88
+ * the other side; else held shorter under a label (`maxH`: it scrolls; at least CARD_MIN_H); with none clear, the spot
89
+ * covering the least.
90
+ */
91
+ export const CARD_MIN_H = 240;
92
+ export function cardSpot({ px, py, gap, cw, ch, w, h, avoid = [] }) {
93
+ const cx = (x) => Math.max(8, Math.min(x, w - cw - 8)), cy = (y) => Math.max(8, Math.min(y, h - ch - 8));
94
+ const right = px + gap, left = px - gap - cw;
95
+ const sides = right + cw > w - 8 ? [left, right] : [right, left];
96
+ const spots = [];
97
+ for (const s of sides) {
98
+ const x = cx(s), y = cy(py - 24);
99
+ spots.push({ x, y });
100
+ for (const r of avoid) if (r.y + r.h + 6 > y && r.y + r.h + 6 + ch <= h - 8) spots.push({ x, y: r.y + r.h + 6 });
101
+ }
102
+ for (const s of sides) for (const r of avoid) {
103
+ const y = r.y + r.h + 6, room = h - 8 - y;
104
+ if (room >= CARD_MIN_H && room < ch) spots.push({ x: cx(s), y, maxH: room });
105
+ }
106
+ let best = spots[0], least = Infinity;
107
+ for (const p of spots) {
108
+ const c = covered(p.x, p.y, cw, p.maxH ?? ch, avoid);
109
+ if (c === 0) return p;
110
+ if (c < least) { least = c; best = p; }
111
+ }
112
+ return best;
113
+ }
82
114
  /**
83
115
  * The view kept on the scene: along an axis where the scene is at least the viewport it covers the viewport (no gap at
84
116
  * either edge); where it is smaller it is centred on that axis. Nothing can be scrolled off-screen.
@@ -610,22 +610,35 @@ export function bubbleAt(name, state, ms, lines) {
610
610
  * another bubble (no two bubbles overlap) — so a name alone never keeps a call out (on Cozy a stuck agent stands right
611
611
  * under "Help desk", and its "Hmm, stuck?" went missing in beta.20).
612
612
  */
613
- export function placeBubbles(items, lift = 22, blocked = [], soft = []) {
613
+ /** M-3722: the space (logical px) a bubble's box keeps off an area's name (placeBubbles' `air`). */
614
+ export const NAME_AIR = 3;
615
+ export function placeBubbles(items, lift = 22, blocked = [], soft = [], air = 0) {
616
+ if (air) soft = soft.map((b) => ({ x: b.x - air, y: b.y - air, w: b.w + 2 * air, h: b.h + 2 * air }));
614
617
  const rank = (it) => (it.rank ?? (it.calling ? 0 : 2));
615
618
  const order = [...items].sort((a, b) => (rank(a) - rank(b)) || (b.shown - a.shown) || (a.key < b.key ? -1 : a.key > b.key ? 1 : 0));
616
619
  const taken = [...blocked], out = [];
617
620
  const hit = (list, r) => list.some((t) => r.x < t.x + t.w && t.x < r.x + r.w && r.y < t.y + t.h && t.y < r.y + r.h);
618
- const at = (it, dy) => {
619
- const r = { x: it.box.x, y: it.box.y + dy, w: it.box.w, h: it.box.h };
621
+ // M-3722: `flipBox` (the box on the tail's left) is a call's other side: tried before a call covers an area's name.
622
+ const at = (it, dy, flip = false) => {
623
+ const box = flip && it.flipBox ? it.flipBox : it.box;
624
+ const r = { x: box.x, y: box.y + dy, w: box.w, h: box.h };
620
625
  return { r, t: it.tail ? { x: it.tail.x - 1, y: r.y + r.h, w: 9, h: Math.max(0, it.tail.y - (r.y + r.h)) } : null };
621
626
  };
622
- const first = (it, dys, lists) => dys.find((dy) => { const { r, t } = at(it, dy); return !lists.some((l) => hit(l, r) || (t && hit(l, t))); });
627
+ // M-3722: an area's name (`soft`) keeps a bubble's BOX off it; a tail may cross a name (the Office writes the name again
628
+ // over it) — a caller standing at a name's height would otherwise always cover it.
629
+ const free = (it, [dy, flip], names) => { const { r, t } = at(it, dy, flip); return !hit(taken, r) && !(t && hit(taken, t)) && !(names && hit(soft, r)); };
630
+ const first = (it, spots, names) => spots.find((spot) => free(it, spot, names));
631
+ const sides = (dys) => dys.map((dy) => [dy, false]);
623
632
  for (const it of order) {
624
- let dy = first(it, [0, -lift], [taken, soft]);
625
- if (dy === undefined && it.calling) dy = first(it, [-2 * lift], [taken, soft]) ?? first(it, [0, -lift, -2 * lift], [taken]);
626
- if (dy === undefined) continue;
627
- const { r, t } = at(it, dy);
628
- taken.push(r); if (t) taken.push(t); out.push({ ...it, dy });
633
+ let spot = first(it, sides([0, -lift]), true);
634
+ if (spot === undefined && it.calling) {
635
+ spot = (it.flipBox ? first(it, [[0, true], [-lift, true]], true) : undefined)
636
+ ?? first(it, [[-2 * lift, false], ...(it.flipBox ? [[-2 * lift, true]] : [])], true)
637
+ ?? first(it, sides([0, -lift, -2 * lift]), false); // M-3648: a name never keeps a call out
638
+ }
639
+ if (spot === undefined) continue;
640
+ const [dy, flip] = spot, { r, t } = at(it, dy, flip);
641
+ taken.push(r); if (t) taken.push(t); out.push({ ...it, dy, ...(flip ? { flip: true } : {}) });
629
642
  }
630
643
  return out;
631
644
  }