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

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 (256) hide show
  1. package/dist/agent-cli-instructions.md +1 -1
  2. package/dist/backend/claude-carry.d.ts +11 -0
  3. package/dist/backend/claude-carry.js +88 -6
  4. package/dist/backend/claude-carry.js.map +1 -1
  5. package/dist/backend/claude-code.js +3 -0
  6. package/dist/backend/claude-code.js.map +1 -1
  7. package/dist/build-provenance.json +1 -1
  8. package/dist/cache-ledger.d.ts +23 -21
  9. package/dist/cache-ledger.js +70 -6
  10. package/dist/cache-ledger.js.map +1 -1
  11. package/dist/cache-prices.d.ts +8 -6
  12. package/dist/cache-prices.js +12 -5
  13. package/dist/cache-prices.js.map +1 -1
  14. package/dist/cache-service.d.ts +9 -5
  15. package/dist/cache-service.js +202 -50
  16. package/dist/cache-service.js.map +1 -1
  17. package/dist/channel/mcp-tools.js +6 -4
  18. package/dist/channel/mcp-tools.js.map +1 -1
  19. package/dist/cli-audited.js +2 -1
  20. package/dist/cli-audited.js.map +1 -1
  21. package/dist/cli.js +4 -1
  22. package/dist/cli.js.map +1 -1
  23. package/dist/contact-auth-policy.js +1 -1
  24. package/dist/contact-auth-policy.js.map +1 -1
  25. package/dist/contact-auth-service.js +8 -2
  26. package/dist/contact-auth-service.js.map +1 -1
  27. package/dist/contact-auth-store.d.ts +3 -0
  28. package/dist/contact-auth-store.js +34 -8
  29. package/dist/contact-auth-store.js.map +1 -1
  30. package/dist/contact-auth-types.d.ts +3 -2
  31. package/dist/contact-auth-types.js.map +1 -1
  32. package/dist/contact-change-proposals.d.ts +47 -0
  33. package/dist/contact-change-proposals.js +132 -0
  34. package/dist/contact-change-proposals.js.map +1 -0
  35. package/dist/daemon.d.ts +31 -0
  36. package/dist/daemon.js +149 -2
  37. package/dist/daemon.js.map +1 -1
  38. package/dist/delivery-outbox.d.ts +10 -0
  39. package/dist/delivery-outbox.js +21 -0
  40. package/dist/delivery-outbox.js.map +1 -1
  41. package/dist/fleet-manager.d.ts +65 -1
  42. package/dist/fleet-manager.js +338 -20
  43. package/dist/fleet-manager.js.map +1 -1
  44. package/dist/general-knowledge/skills/concepts/SKILL.md +2 -1
  45. package/dist/general-knowledge/skills/hub/SKILL.md +45 -5
  46. package/dist/general-knowledge/skills/task-board/SKILL.md +4 -0
  47. package/dist/general-knowledge/skills/web-appearance/SKILL.md +1 -1
  48. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +16 -6
  49. package/dist/hub/agent-pictures-model.d.ts +275 -0
  50. package/dist/hub/agent-pictures-model.js +103 -0
  51. package/dist/hub/agent-pictures-model.js.map +1 -0
  52. package/dist/hub/agent-pictures.d.ts +64 -0
  53. package/dist/hub/agent-pictures.js +255 -0
  54. package/dist/hub/agent-pictures.js.map +1 -0
  55. package/dist/hub/client.d.ts +4 -0
  56. package/dist/hub/client.js +23 -2
  57. package/dist/hub/client.js.map +1 -1
  58. package/dist/hub/compose/member.d.ts +14 -3
  59. package/dist/hub/compose/member.js +46 -10
  60. package/dist/hub/compose/member.js.map +1 -1
  61. package/dist/hub/compose/server.d.ts +6 -5
  62. package/dist/hub/compose/server.js +7 -3
  63. package/dist/hub/compose/server.js.map +1 -1
  64. package/dist/hub/direct-posts-model.d.ts +1 -0
  65. package/dist/hub/direct-posts-model.js +2 -0
  66. package/dist/hub/direct-posts-model.js.map +1 -0
  67. package/dist/hub/direct-posts.d.ts +36 -0
  68. package/dist/hub/direct-posts.js +145 -0
  69. package/dist/hub/direct-posts.js.map +1 -0
  70. package/dist/hub/http/compose.d.ts +5 -0
  71. package/dist/hub/http/compose.js +158 -20
  72. package/dist/hub/http/compose.js.map +1 -1
  73. package/dist/hub/http/core.d.ts +9 -1
  74. package/dist/hub/http/core.js +21 -1
  75. package/dist/hub/http/core.js.map +1 -1
  76. package/dist/hub/http/deps.d.ts +1 -0
  77. package/dist/hub/http/schema.js +7 -0
  78. package/dist/hub/http/schema.js.map +1 -1
  79. package/dist/hub/init/text.js +1 -1
  80. package/dist/hub/join/service.d.ts +2 -0
  81. package/dist/hub/join/service.js +7 -3
  82. package/dist/hub/join/service.js.map +1 -1
  83. package/dist/hub/member/agent-pictures.d.ts +76 -0
  84. package/dist/hub/member/agent-pictures.js +196 -0
  85. package/dist/hub/member/agent-pictures.js.map +1 -0
  86. package/dist/hub/member/direct-rooms.d.ts +9 -0
  87. package/dist/hub/member/direct-rooms.js +14 -0
  88. package/dist/hub/member/direct-rooms.js.map +1 -0
  89. package/dist/hub/member/room-ask.d.ts +22 -1
  90. package/dist/hub/member/room-ask.js +99 -5
  91. package/dist/hub/member/room-ask.js.map +1 -1
  92. package/dist/hub/member/room-asker-store.d.ts +48 -0
  93. package/dist/hub/member/room-asker-store.js +181 -0
  94. package/dist/hub/member/room-asker-store.js.map +1 -0
  95. package/dist/hub/member/room-post.d.ts +11 -10
  96. package/dist/hub/member/room-post.js +51 -7
  97. package/dist/hub/member/room-post.js.map +1 -1
  98. package/dist/hub/policy.d.ts +11 -2
  99. package/dist/hub/policy.js +60 -7
  100. package/dist/hub/policy.js.map +1 -1
  101. package/dist/hub/protocol.d.ts +254 -1
  102. package/dist/hub/protocol.js +20 -8
  103. package/dist/hub/protocol.js.map +1 -1
  104. package/dist/hub/representative.d.ts +38 -0
  105. package/dist/hub/representative.js +140 -12
  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.d.ts +2 -0
  114. package/dist/hub/rooms/agents.js +30 -3
  115. package/dist/hub/rooms/agents.js.map +1 -1
  116. package/dist/hub/rooms/asker-identity.d.ts +21 -0
  117. package/dist/hub/rooms/asker-identity.js +86 -0
  118. package/dist/hub/rooms/asker-identity.js.map +1 -0
  119. package/dist/hub/rooms/direct-view.d.ts +3 -2
  120. package/dist/hub/rooms/direct-view.js +23 -8
  121. package/dist/hub/rooms/direct-view.js.map +1 -1
  122. package/dist/hub/rooms/office.d.ts +27 -0
  123. package/dist/hub/rooms/office.js +12 -2
  124. package/dist/hub/rooms/office.js.map +1 -1
  125. package/dist/hub/rooms/service.d.ts +38 -1
  126. package/dist/hub/rooms/service.js +56 -3
  127. package/dist/hub/rooms/service.js.map +1 -1
  128. package/dist/hub/rooms/types.d.ts +5 -2
  129. package/dist/hub/rooms.d.ts +9 -0
  130. package/dist/hub/rooms.js +97 -26
  131. package/dist/hub/rooms.js.map +1 -1
  132. package/dist/hub/runtime.d.ts +1 -1
  133. package/dist/hub/server.js +24 -2
  134. package/dist/hub/server.js.map +1 -1
  135. package/dist/hub/session-directory-transition.d.ts +1 -0
  136. package/dist/hub/session-directory-transition.js +15 -9
  137. package/dist/hub/session-directory-transition.js.map +1 -1
  138. package/dist/hub/session-limits.d.ts +58 -0
  139. package/dist/hub/session-limits.js +121 -0
  140. package/dist/hub/session-limits.js.map +1 -0
  141. package/dist/hub/sessions.d.ts +1 -1
  142. package/dist/hub/sessions.js +13 -7
  143. package/dist/hub/sessions.js.map +1 -1
  144. package/dist/hub/settings-directory-decision.js +1 -1
  145. package/dist/hub/settings-directory-decision.js.map +1 -1
  146. package/dist/hub/types.d.ts +9 -2
  147. package/dist/hub-character-plan.d.ts +47 -0
  148. package/dist/hub-character-plan.js +70 -0
  149. package/dist/hub-character-plan.js.map +1 -0
  150. package/dist/hub-contact-windows.d.ts +13 -1
  151. package/dist/hub-contact-windows.js +35 -2
  152. package/dist/hub-contact-windows.js.map +1 -1
  153. package/dist/hub-picture-reduce.d.ts +34 -0
  154. package/dist/hub-picture-reduce.js +101 -0
  155. package/dist/hub-picture-reduce.js.map +1 -0
  156. package/dist/hub-picture-worker.d.ts +1 -0
  157. package/dist/hub-picture-worker.js +19 -0
  158. package/dist/hub-picture-worker.js.map +1 -0
  159. package/dist/hub-report-target.d.ts +6 -0
  160. package/dist/hub-report-target.js +6 -0
  161. package/dist/hub-report-target.js.map +1 -1
  162. package/dist/locale.js +357 -265
  163. package/dist/locale.js.map +1 -1
  164. package/dist/ls-rows.d.ts +2 -0
  165. package/dist/ls-rows.js.map +1 -1
  166. package/dist/needs-you.d.ts +6 -0
  167. package/dist/needs-you.js +3 -1
  168. package/dist/needs-you.js.map +1 -1
  169. package/dist/outbound-handlers.d.ts +8 -0
  170. package/dist/outbound-handlers.js +53 -6
  171. package/dist/outbound-handlers.js.map +1 -1
  172. package/dist/outbound-schemas.d.ts +2 -0
  173. package/dist/outbound-schemas.js +6 -4
  174. package/dist/outbound-schemas.js.map +1 -1
  175. package/dist/runtime-cli-install.js +4 -4
  176. package/dist/runtime-cli-install.js.map +1 -1
  177. package/dist/task-board-tool.d.ts +17 -0
  178. package/dist/task-board-tool.js +58 -6
  179. package/dist/task-board-tool.js.map +1 -1
  180. package/dist/tips.js +3 -3
  181. package/dist/tool-permissions.js +2 -2
  182. package/dist/tool-permissions.js.map +1 -1
  183. package/dist/ui/agent-export-strings.js +1 -1
  184. package/dist/ui/agent-page-strings.js +5 -5
  185. package/dist/ui/contact-auth-client.js +2 -2
  186. package/dist/ui/contact-tool-groups.js +1 -1
  187. package/dist/ui/fleet-cache.js +5 -5
  188. package/dist/ui/fleet-canvas.js +3 -2
  189. package/dist/ui/fleet-office-card.js +46 -7
  190. package/dist/ui/fleet-office-dialogue.d.ts +6 -3
  191. package/dist/ui/fleet-office-dialogue.js +13 -3
  192. package/dist/ui/fleet-office-layout.js +15 -15
  193. package/dist/ui/fleet-office-model.js +3 -2
  194. package/dist/ui/fleet-office-overview.js +1 -1
  195. package/dist/ui/fleet-office-pack.d.ts +17 -7
  196. package/dist/ui/fleet-office-pack.js +106 -38
  197. package/dist/ui/fleet-office-play.js +11 -4
  198. package/dist/ui/fleet-office-skin.js +41 -11
  199. package/dist/ui/fleet-office-store.js +10 -1
  200. package/dist/ui/fleet-office-talk.js +423 -0
  201. package/dist/ui/fleet-office-view.js +58 -17
  202. package/dist/ui/fleet-office-zones.js +20 -12
  203. package/dist/ui/fleet-office.js +250 -65
  204. package/dist/ui/fleet-org.js +3 -3
  205. package/dist/ui/fleet-task-common.js +3 -3
  206. package/dist/ui/fleet-task-sort.js +88 -0
  207. package/dist/ui/fleet-task-view.js +38 -9
  208. package/dist/ui/fleet-tasks.js +47 -15
  209. package/dist/ui/fleet-usage.js +6 -6
  210. package/dist/ui/hub-admin-overview.js +1 -1
  211. package/dist/ui/hub-chat-store.js +4 -3
  212. package/dist/ui/hub-chat-strings.js +3 -1
  213. package/dist/ui/hub-client.js +3 -0
  214. package/dist/ui/hub-my-agents-strings.js +2 -2
  215. package/dist/ui/hub-my-agents.js +3 -0
  216. package/dist/ui/hub-room-composer.js +24 -4
  217. package/dist/ui/hub-room-members.js +7 -3
  218. package/dist/ui/hub-room-office.js +71 -2
  219. package/dist/ui/hub-room-presence.js +14 -0
  220. package/dist/ui/hub-room-strings.js +18 -2
  221. package/dist/ui/hub-room-thread.js +82 -13
  222. package/dist/ui/hub-room-working.js +37 -0
  223. package/dist/ui/hub-session-limits.js +79 -0
  224. package/dist/ui/panel-fleet.js +5 -5
  225. package/dist/ui/panel-hub.js +41 -6
  226. package/dist/ui/panel-log.js +3 -3
  227. package/dist/ui/panel-needs.js +28 -2
  228. package/dist/ui/panel-runtimes.js +2 -2
  229. package/dist/ui/runtime-cli-install.js +1 -1
  230. package/dist/ui/runtime-update-status.js +1 -1
  231. package/dist/ui/settings-access-strings.js +1 -1
  232. package/dist/ui/settings-hub-setup-strings.js +1 -1
  233. package/dist/ui/settings-layout.js +2 -2
  234. package/dist/ui/settings-named-test.js +16 -16
  235. package/dist/ui/settings-public-session-strings.js +2 -2
  236. package/dist/ui/settings-revoke-strings.js +1 -1
  237. package/dist/ui/settings-shared-strings.js +2 -2
  238. package/dist/ui/settings-strings.js +40 -40
  239. package/dist/ui/shared/app-shell.js +1 -1
  240. package/dist/ui/shared/app.css +106 -6
  241. package/dist/ui/shared/chat-strings.js +9 -9
  242. package/dist/ui/shared/hub-owner.css +5 -0
  243. package/dist/ui/shared/hub-rooms-u2.css +3 -0
  244. package/dist/ui/shared/instance-nav.js +36 -2
  245. package/dist/ui/shared/office-dialogue.css +110 -0
  246. package/dist/ui/shared/task-board.css +103 -7
  247. package/dist/ui/shared/view-strings.js +27 -9
  248. package/dist/web-api.d.ts +5 -0
  249. package/dist/web-api.js +29 -0
  250. package/dist/web-api.js.map +1 -1
  251. package/dist/web-office-skins.d.ts +8 -2
  252. package/dist/web-office-skins.js +33 -14
  253. package/dist/web-office-skins.js.map +1 -1
  254. package/dist/web-office-store.js +5 -3
  255. package/dist/web-office-store.js.map +1 -1
  256. package/package.json +1 -1
@@ -2,7 +2,7 @@
2
2
  // furniture, the door and the walkable graph's waypoints — and adds or removes waypoints and the corridors between
3
3
  // them. The pack stays as it was uploaded: what differs from it is kept as the office's `overrides` (fleet-office-pack.js
4
4
  // overridesBetween), saved with the whole list and the rev read (PUT /ui/offices; a change made meanwhile is a 409).
5
- // Reset goes back to the pack's own positions. A "show coordinates" overlay draws the 1280×720 logical grid.
5
+ // Reset goes back to the pack's own positions. A "show coordinates" overlay draws the logical grid (1280×720, or the pack's own canvas).
6
6
  //
7
7
  // #2665: an item with a `night` (#2568) has a night handle too — its night strip drawn faint on the canvas (as the
8
8
  // seats' figures, #2558), a moon, and a thin line to its day place. One that sleeps in place shows it on its day place
@@ -24,7 +24,7 @@
24
24
  import { html, useEffect, useLayoutEffect, useMemo, useRef, useState } from "/assets/app-html.js";
25
25
  import { t, register } from "/assets/app-i18n.js";
26
26
  import { SidePanel } from "/assets/side-panel.js";
27
- import { LOGICAL, overridesBetween, own } from "./fleet-office-pack.js";
27
+ import { canvasOf, overridesBetween, own } from "./fleet-office-pack.js";
28
28
  import { dropPoint } from "./fleet-office-zones.js";
29
29
 
30
30
  register("orgl", {
@@ -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: "儲存太頻繁,請一分鐘後再試。",
@@ -75,7 +75,7 @@ export function handlesOf(pack) {
75
75
  out.push({ key: `night:${f.id}`, kind: "night", label: tl("night", f.id), x: n.x, y: n.y, day: { x: f.x, y: f.y }, inPlace: !n.own });
76
76
  }
77
77
  out.push({ key: "door", kind: "door", label: tl("door"), x: pack.door.x, y: pack.door.y });
78
- const md = pack.mailDrop || dropPoint({ areas: pack.areas, waypoints: pack.waypoints, width: LOGICAL.w, height: LOGICAL.h });
78
+ const md = pack.mailDrop || dropPoint({ areas: pack.areas, waypoints: pack.waypoints, width: canvasOf(pack).w, height: canvasOf(pack).h });
79
79
  if (md) out.push({ key: "mail", kind: "mail", label: tl(pack.mailDrop ? "mail" : "mailAuto"), x: md.x, y: md.y, ...(pack.mailDrop ? {} : { auto: true }) });
80
80
  for (const w of pack.waypoints) out.push({ key: `wp:${w.id}`, kind: "waypoint", label: tl("waypoint", w.id), x: w.x, y: w.y });
81
81
  return out;
@@ -83,7 +83,7 @@ export function handlesOf(pack) {
83
83
  /** The pack with handle `key` at (x, y), rounded and kept in range: a seat inside its area, anything else on the canvas. */
84
84
  export function moveHandle(pack, key, x, y) {
85
85
  const [kind, a, b] = key.split(":");
86
- const inCanvas = () => ({ x: clamp(x, 0, LOGICAL.w), y: clamp(y, 0, LOGICAL.h) });
86
+ const cv = canvasOf(pack), inCanvas = () => ({ x: clamp(x, 0, cv.w), y: clamp(y, 0, cv.h) });
87
87
  if (kind === "seat") {
88
88
  const area = own(pack.areas, a), i = Number(b);
89
89
  if (!area || !area.seats[i]) return pack;
@@ -98,12 +98,12 @@ export function moveHandle(pack, key, x, y) {
98
98
  return pack;
99
99
  }
100
100
  /** A new waypoint at (x, y), named wp-<n> (a name no other waypoint has); returns { pack, id }. */
101
- export function addWaypoint(pack, x = LOGICAL.w / 2, y = LOGICAL.h / 2) {
101
+ export function addWaypoint(pack, x = canvasOf(pack).w / 2, y = canvasOf(pack).h / 2) {
102
102
  const ids = new Set(pack.waypoints.map((w) => w.id));
103
103
  let n = pack.waypoints.length + 1;
104
104
  while (ids.has(`wp-${n}`)) n++;
105
105
  const id = `wp-${n}`;
106
- return { pack: { ...pack, waypoints: [...pack.waypoints, { id, x: clamp(x, 0, LOGICAL.w), y: clamp(y, 0, LOGICAL.h) }] }, id };
106
+ return { pack: { ...pack, waypoints: [...pack.waypoints, { id, x: clamp(x, 0, canvasOf(pack).w), y: clamp(y, 0, canvasOf(pack).h) }] }, id };
107
107
  }
108
108
  /** The pack without waypoint `id` and its corridors. */
109
109
  export function removeWaypoint(pack, id) {
@@ -171,7 +171,7 @@ export function LayoutEditor({ base, start, place = null, stale = "", dock = tru
171
171
  const toLogical = (e) => {
172
172
  const r = svg.current && svg.current.getBoundingClientRect ? svg.current.getBoundingClientRect() : null;
173
173
  if (!r || !r.width || !r.height) return null;
174
- return { x: ((e.clientX - r.left) / r.width) * LOGICAL.w, y: ((e.clientY - r.top) / r.height) * LOGICAL.h };
174
+ return { x: ((e.clientX - r.left) / r.width) * canvasOf(edited).w, y: ((e.clientY - r.top) / r.height) * canvasOf(edited).h };
175
175
  };
176
176
  const down = (key) => (e) => {
177
177
  if (busy) return;
@@ -187,7 +187,7 @@ export function LayoutEditor({ base, start, place = null, stale = "", dock = tru
187
187
  if ((e.key === "Delete" || e.key === "Backspace") && h.kind === "waypoint") { e.preventDefault(); change(removeWaypoint(edited, h.key.slice(3))); setSel(null); }
188
188
  if (e.key === "Enter" || e.key === " ") { e.preventDefault(); setSel(h.key); }
189
189
  };
190
- const add = () => { const at = selected ? { x: selected.x + 40, y: selected.y } : { x: LOGICAL.w / 2, y: LOGICAL.h / 2 }; const r = addWaypoint(edited, at.x, at.y); change(r.pack); setSel(`wp:${r.id}`); };
190
+ const add = () => { const at = selected ? { x: selected.x + 40, y: selected.y } : { x: canvasOf(edited).w / 2, y: canvasOf(edited).h / 2 }; const r = addWaypoint(edited, at.x, at.y); change(r.pack); setSel(`wp:${r.id}`); };
191
191
  const wpSel = selected && selected.kind === "waypoint" ? selected.key.slice(3) : null;
192
192
  const nightSel = selected && selected.kind === "night" ? selected.key.slice(6) : null;
193
193
  const seatSel = selected && selected.kind === "seat" ? selected : null;
@@ -209,10 +209,10 @@ export function LayoutEditor({ base, start, place = null, stale = "", dock = tru
209
209
  const reset = () => { change(base); setSel(null); setMsg(""); };
210
210
  const grid = [];
211
211
  if (coords) {
212
- for (let x = GRID; x < LOGICAL.w; x += GRID) grid.push(html`<line key=${`gx${x}`} class="ol-grid" x1=${x} y1="0" x2=${x} y2=${LOGICAL.h} />`);
213
- for (let y = GRID; y < LOGICAL.h; y += GRID) grid.push(html`<line key=${`gy${y}`} class="ol-grid" x1="0" y1=${y} x2=${LOGICAL.w} y2=${y} />`);
214
- for (let x = 0; x < LOGICAL.w; x += LABEL) grid.push(html`<text key=${`lx${x}`} class="ol-label" x=${x + 3} y="14">${x}</text>`);
215
- for (let y = LABEL; y < LOGICAL.h; y += LABEL) grid.push(html`<text key=${`ly${y}`} class="ol-label" x="3" y=${y - 3}>${y}</text>`);
212
+ for (let x = GRID; x < canvasOf(edited).w; x += GRID) grid.push(html`<line key=${`gx${x}`} class="ol-grid" x1=${x} y1="0" x2=${x} y2=${canvasOf(edited).h} />`);
213
+ for (let y = GRID; y < canvasOf(edited).h; y += GRID) grid.push(html`<line key=${`gy${y}`} class="ol-grid" x1="0" y1=${y} x2=${canvasOf(edited).w} y2=${y} />`);
214
+ for (let x = 0; x < canvasOf(edited).w; x += LABEL) grid.push(html`<text key=${`lx${x}`} class="ol-label" x=${x + 3} y="14">${x}</text>`);
215
+ for (let y = LABEL; y < canvasOf(edited).h; y += LABEL) grid.push(html`<text key=${`ly${y}`} class="ol-label" x="3" y=${y - 3}>${y}</text>`);
216
216
  }
217
217
  const at = new Map(edited.waypoints.map((w) => [w.id, w]));
218
218
  const edgeKey = (e) => `${e[0]}\u0000${e[1]}`;
@@ -256,7 +256,7 @@ export function LayoutEditor({ base, start, place = null, stale = "", dock = tru
256
256
  ${msg ? html`<p class="note ol-msg" role="status">${msg}</p>` : null}`;
257
257
  return html`<div class="ol" role="group" aria-label=${tl("title")} onKeyDown=${esc}>
258
258
  <div class="ol-overlay" ref=${overlay}>
259
- <svg ref=${svg} class="ol-svg" viewBox=${`0 0 ${LOGICAL.w} ${LOGICAL.h}`} width="100%" height="100%"
259
+ <svg ref=${svg} class="ol-svg" viewBox=${`0 0 ${canvasOf(edited).w} ${canvasOf(edited).h}`} width="100%" height="100%"
260
260
  onPointerMove=${move} onPointerUp=${up} onPointerCancel=${up} onPointerLeave=${up}>
261
261
  ${grid}
262
262
  ${Object.values(edited.areas).map((a) => html`<rect key=${`a:${a.name}`} class="ol-area" x=${a.rect.x} y=${a.rect.y} width=${a.rect.w} height=${a.rect.h} />`)}
@@ -15,7 +15,7 @@
15
15
  // the left margin) that traffic walks along (bfsPath).
16
16
  // - Poses come from the org chart's states (fleet-org.js ORG_STATES / orgState); nothing here invents a status.
17
17
  import { hue } from "./fleet-traffic.js";
18
- import { checkLayoutOverrides } from "./fleet-office-pack.js";
18
+ import { CANVAS, checkLayoutOverrides } from "./fleet-office-pack.js";
19
19
 
20
20
  // ── Poses: the org chart's states, as a character at a desk ──
21
21
 
@@ -125,7 +125,8 @@ export function officeOk(x) {
125
125
  if (!x || typeof x !== "object" || typeof x.id !== "string" || !ID.test(x.id) || x.id === AUTO_ID) return null;
126
126
  const name = typeof x.name === "string" && x.name.trim() ? x.name.trim().slice(0, 60) : x.id;
127
127
  const skin = typeof x.skin === "string" && ID.test(x.skin) ? x.skin : "pixel";
128
- const ov = x.overrides === undefined ? null : checkLayoutOverrides(x.overrides);
128
+ // The host checked them against their pack's canvas; here the largest, so a big office's layout is kept.
129
+ const ov = x.overrides === undefined ? null : checkLayoutOverrides(x.overrides, CANVAS.max);
129
130
  return { id: x.id, name, skin, members: nameList(x.members), layout: layoutOk(x.layout), ...(ov && ov.ok ? { overrides: ov.overrides } : {}),
130
131
  ...(x.stayInArea === true ? { stayInArea: true } : {}) }; // M-3286: idle people stay in their own area
131
132
  }
@@ -5,7 +5,7 @@
5
5
  //
6
6
  // - Shown when at least two offices are stored (overviewOk); an id no stored office can have (ALL_ID: '*' is not an
7
7
  // office id's character), kept per device as any office pick is.
8
- // - The tiles: each as large as its office's drawn content — a zones scene its 1280×720, a desks office its rooms'
8
+ // - The tiles: each as large as its office's drawn content — a zones scene its canvas (1280×720, or a pack's own), a desks office its rooms'
9
9
  // bounds (cropToRooms: an office of three is small) — scaled down to at most CELL_W × CELL_H, never up; a LABEL band
10
10
  // above each (the page's label sits there), GAP apart, M from the edge. Shelf packing in the stored order (the lobby
11
11
  // last): a row takes tiles while they fit a row width, each row as tall as its tallest tile and centred across. The
@@ -13,6 +13,9 @@ export interface PackStrip {
13
13
  once?: boolean;
14
14
  /** M-3394 (#4231): intro plays `0 .. loopFrom - 1` once, then loops `loopFrom .. frames - 1`. */
15
15
  loopFrom?: number;
16
+ /** Sheet cells: the strip starts at this row / column of w×h cells (both present when either was given). */
17
+ row?: number;
18
+ col?: number;
16
19
  }
17
20
  export interface PackPoint { x: number; y: number }
18
21
  /** #2691: a seat reserved for `for` (lent while they are all elsewhere when `lend`); a plain seat has neither. */
@@ -22,7 +25,7 @@ export interface PackArea { name: string; rect: { x: number; y: number; w: numbe
22
25
  export interface PackFurniture { id: string; sprite: PackStrip; x: number; y: number; depth: number | "y"; activeWhen: string[] | null; activeSprite: PackStrip | null;
23
26
  activeFor?: string[] | null; loop?: boolean; activeOn?: "state" | "seated"; hides?: boolean; label: string | null }
24
27
  export interface CheckedPack {
25
- format: 1; id: string; scale: number; background?: string; foreground?: string; matte?: string;
28
+ format: 1; id: string; scale: number; /** Its own canvas (logical units), else 1280×720. */ canvas?: { w: number; h: number }; background?: string; foreground?: string; matte?: string;
26
29
  areas: Record<string, PackArea>; stateZones: Record<string, string> | null; door: PackPoint;
27
30
  /** #2736: where a letter from another office lands, or null (the waypoint nearest the middle). */
28
31
  mailDrop: PackPoint | null;
@@ -38,7 +41,9 @@ export interface CheckedPack {
38
41
  /** #2861: the dialogue box's faces — each an expression (idle, working, needs) → file. */
39
42
  portraits?: { default?: PackPortrait; byInstance: Record<string, PackPortrait>; byUser: Record<string, PackPortrait>; npc: Record<string, PackPortrait> };
40
43
  /** #2861: the dialogue box's look — a 9-slice frame and colours (#rrggbb). */
41
- dialogBox?: { frame?: string; slice?: number; background?: string; border?: string; text?: string; name?: string };
44
+ dialogBox?: { frame?: string; slice?: number; background?: string; border?: string; text?: string; name?: string;
45
+ /** The reply over a head (the Office's "Over their head" talk): its 9-slice frame, colours and entrance. */
46
+ bubble?: { frame?: string; slice?: number; background?: string; border?: string; text?: string; name?: string; enter?: "pop" | "fade" | "none" } };
42
47
  /** #4256: optional agent profile card preset, visual style, and layout. */
43
48
  card?: PackCard;
44
49
  /** #3685: areas an idle person now and then visits (a free seat there, for minSeconds–maxSeconds); absent: none. */
@@ -69,10 +74,12 @@ export interface PackCardStyle {
69
74
  backgroundImage?: string; frame?: string; slice?: number; radius?: CardRadius;
70
75
  }
71
76
  export interface PackCardLayout {
72
- avatarSize?: CardAvatarSize; avatarSource?: CardAvatarSource; headerAlign?: CardHeaderAlign; width?: number;
77
+ avatarSize?: CardAvatarSize; avatarSource?: CardAvatarSource; headerAlign?: CardHeaderAlign; width?: number; gap?: number;
73
78
  sections?: CardSection[]; rows?: CardRowKey[]; rowColumns?: 1 | 2; hide?: CardHideKey[];
74
79
  }
75
- export interface PackCard { preset?: CardPreset; style?: PackCardStyle; layout?: PackCardLayout }
80
+ export type CardEnter = "none" | "fade" | "pop" | "rise" | "slide" | "bounce";
81
+ export interface PackCardMotion { enter: CardEnter; ms: number }
82
+ export interface PackCard { preset?: CardPreset; style?: PackCardStyle; layout?: PackCardLayout; motion?: PackCardMotion }
76
83
  /** #2861: a portrait's files by the state it is shown in (at least one). */
77
84
  export type PackPortrait = Partial<Record<"idle" | "working" | "needs", string>>;
78
85
  /** #2661: the Office levels' words (a pack's `levels`; #3679: the fleet-wide one too). */
@@ -92,6 +99,8 @@ export interface LayoutOverrides {
92
99
  edges?: Array<[string, string]>;
93
100
  }
94
101
  export const LOGICAL: { w: number; h: number };
102
+ export const CANVAS: { min: { w: number; h: number }; max: { w: number; h: number } };
103
+ export function canvasOf(pack: unknown): { w: number; h: number };
95
104
  export const CHAR_DEPTH: number;
96
105
  export const PACK_STATES: string[];
97
106
  export const BUBBLE_KEYS: string[];
@@ -105,6 +114,7 @@ export function matteOk(v: unknown): v is string;
105
114
  export function relativeLuminance(hex: string): number | null;
106
115
  export function contrastRatio(hexA: string, hexB: string): number;
107
116
  export const CARD_PRESETS: CardPreset[];
117
+ export const CARD_ENTERS: CardEnter[];
108
118
  export const CARD_RADII: CardRadius[];
109
119
  export const CARD_AVATAR_SIZES: CardAvatarSize[];
110
120
  export const CARD_AVATAR_SOURCES: CardAvatarSource[];
@@ -113,12 +123,12 @@ export const CARD_SECTIONS: CardSection[];
113
123
  export const CARD_ROWS: CardRowKey[];
114
124
  export const CARD_HIDE: CardHideKey[];
115
125
  export const CARD_STYLE_COLORS: string[];
116
- export const CARD_LIMITS: { widthMin: number; widthMax: number; sliceMax: number; textContrast: number; uiContrast: number };
126
+ export const CARD_LIMITS: { widthMin: number; widthMax: number; gapMax: number; motionMsMin: number; motionMsMax: number; sliceMax: number; textContrast: number; uiContrast: number };
117
127
  export function checkStrip(v: unknown, at?: string, scale?: number): PackStrip;
118
128
  export function stripSheets(st: PackStrip | null | undefined): PackStripSheet[];
119
129
  export function stripImages(st: PackStrip | null | undefined): string[];
120
130
  export function stripFrameAt(st: PackStrip | null | undefined, ms: number): number;
121
- export function stripCell(st: PackStrip | null | undefined, frame: number): { src: string; col: number };
131
+ export function stripCell(st: PackStrip | null | undefined, frame: number): { src: string; col: number; row?: number };
122
132
  export function stripMaxFps(st: PackStrip | null | undefined): number;
123
133
  export function packMaxFps(pack: CheckedPack | null | undefined): number;
124
134
  export function createClipClocks(): { elapsed(key: string, strip: PackStrip | null | undefined, ms: number): number; prune(seen: ReadonlySet<string>): void; clear(): void };
@@ -131,7 +141,7 @@ export function packSceneImages(pack: CheckedPack): string[];
131
141
  export function packPortraitImages(pack: CheckedPack): string[];
132
142
  export const PORTRAIT_STATES: string[];
133
143
  export function packStrips(pack: CheckedPack): Array<{ at: string; strip: PackStrip }>;
134
- export function checkLayoutOverrides(x: unknown): { ok: true; overrides: LayoutOverrides } | { ok: false; error: string };
144
+ export function checkLayoutOverrides(x: unknown, canvas?: { w: number; h: number }): { ok: true; overrides: LayoutOverrides } | { ok: false; error: string };
135
145
  export function applyOverrides(pack: CheckedPack, ov: LayoutOverrides | null | undefined): { ok: true; pack: CheckedPack } | { ok: false; error: string };
136
146
  export function fitNight<T extends LayoutOverrides | null | undefined>(pack: CheckedPack, ov: T): T;
137
147
  export function fitSeatFor<T extends LayoutOverrides | null | undefined>(pack: CheckedPack, ov: T): T;