Skip to content

an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions

feat(ui): UI enhancements

Chaitanya Girif4fb51f4b550
diff --git a/README.md b/README.md
index 0b8b3472..29977cc7 100644
--- a/README.md
+++ b/README.md
@@ -47,7 +47,7 @@ Each agent you spawn becomes a Sims-style avatar living on a shared 2D office fl
- Not a replacement for the `claude` CLI — the CLI is the runtime, this app is the viewer/controller.
- Not a remote dashboard — local sessions only, no auth, no network surface.
-- Not an agent-to-agent message bus — avatars don't hand work off to each other yet.
+- Not an agent-to-agent task scheduler — agents message each other (and you *see* an envelope fly desk-to-desk when they do), but the floor doesn't reassign or load-balance work between them yet.
---
@@ -57,6 +57,7 @@ Each agent you spawn becomes a Sims-style avatar living on a shared 2D office fl
|---|---|
| **Real terminals** | Spawn any command (default: `claude`) in a `node-pty` PTY. Full read/write/resize/kill, live data + exit streaming over IPC, multi-agent. |
| **Office floor** | Pixi.js scene rendering a Tiled office map, camera, recolored character cast, pathfinding, seat assignment, and tool-bubble overlays. |
+| **Message handoffs** | When the hive routes a message, an envelope flies from the sender's desk to each recipient (tinted by speech-act; escalations fly to the door) and pops an arrival sparkle — the multi-agent collaboration made visible. |
| **Agent panel** | Per-agent detail panel with terminal view, command bar, and a fullscreen terminal mode. |
| **File browser** | Sandboxed `listDir` / `readFile` / `writeFile` rooted at each agent's cwd, with a file tree and a syntax-highlighting CodeMirror editor (JS/TS, HTML, CSS, JSON, Markdown, Python, YAML). |
| **Git tab** | Branch, working-tree status, commit log, branch list, ahead/behind, and a rendered commit graph. |
diff --git a/src/main/hive.ts b/src/main/hive.ts
index 868c43b0..d2b3f01c 100644
--- a/src/main/hive.ts
+++ b/src/main/hive.ts
@@ -83,8 +83,16 @@ function shortRand(): string {
// ─── HiveManager ────────────────────────────────────────────────────────────
export class HiveManager {
- /** Lazily resolve harnessHome so the hive follows config changes. */
- constructor(private getHome: () => string | null) {}
+ /**
+ * @param getHome Lazily resolve harnessHome so the hive follows config changes.
+ * @param emit Optional sink for renderer-facing events (set by the main
+ * process to `webContents.send`). Used to animate routed
+ * messages on the office floor; a no-op in tests/headless.
+ */
+ constructor(
+ private getHome: () => string | null,
+ private emit?: (channel: string, payload: unknown) => void
+ ) {}
private routerTimer: NodeJS.Timeout | null = null;
@@ -335,6 +343,7 @@ export class HiveManager {
if (msg.needs_human) {
this.atomicWriteJson(join(this.root()!, 'approvals', `${msg.id}.json`), msg);
this.appendLog({ kind: 'escalate', from: msg.from, to: msg.to, subject: msg.subject, id: msg.id });
+ this.emitMessage(msg, ['human']);
return;
}
const reg = this.registry();
@@ -343,6 +352,21 @@ export class HiveManager {
: [msg.to === 'god' ? (reg.godId ?? 'god') : msg.to];
for (const t of targets) this.deliver(msg, t);
this.appendLog({ kind: 'message', from: msg.from, to: msg.to, act: msg.act, subject: msg.subject, id: msg.id });
+ this.emitMessage(msg, targets);
+ }
+
+ /** Tell the renderer a message was routed, with its resolved recipients, so
+ * the floor can fly an envelope from the sender to each one. Best-effort. */
+ private emitMessage(msg: HiveMessage, targets: string[]): void {
+ this.emit?.('hive:message', {
+ id: msg.id,
+ from: msg.from,
+ to: msg.to,
+ act: msg.act,
+ subject: msg.subject,
+ targets,
+ needsHuman: msg.needs_human
+ });
}
// — router: drain outboxes → inboxes —
diff --git a/src/main/index.ts b/src/main/index.ts
index 0e1725ac..e871342e 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -16,7 +16,10 @@ import { MemoryManager } from './memory';
const isDev = !!process.env.ELECTRON_RENDERER_URL;
const ptyManager = new PtyManager();
-const hive = new HiveManager(() => readConfig().harnessHome);
+const hive = new HiveManager(
+ () => readConfig().harnessHome,
+ (channel, payload) => mainWindow?.webContents?.send(channel, payload)
+);
const hookServer = new HookServer(hive, () => mainWindow?.webContents ?? null);
const memory = new MemoryManager(
() => readConfig().harnessHome,
diff --git a/src/preload/index.ts b/src/preload/index.ts
index ab70f8e6..1e39af88 100644
--- a/src/preload/index.ts
+++ b/src/preload/index.ts
@@ -29,6 +29,19 @@ export interface HiveRegistry {
agents: Record<string, HiveAgentMeta & { status: string; lastSeen: number }>;
}
+/** A message the router just delivered, with its resolved recipient ids. Drives
+ * the envelope-handoff animation on the office floor. `targets` is `['human']`
+ * when the message was escalated to the human approval queue. */
+export interface HiveRouteEvent {
+ id: string;
+ from: string;
+ to: string;
+ act: 'request' | 'inform' | 'propose' | 'query' | 'agree' | 'refuse' | 'done';
+ subject: string;
+ targets: string[];
+ needsHuman: boolean;
+}
+
export interface SpawnPtyOptions {
id: string;
cwd: string;
@@ -175,6 +188,11 @@ const api = {
ipcRenderer.on('hive:hookEvent', listener);
return () => ipcRenderer.removeListener('hive:hookEvent', listener);
},
+ onHiveMessage: (cb: (e: HiveRouteEvent) => void): (() => void) => {
+ const listener = (_e: IpcRendererEvent, payload: HiveRouteEvent) => cb(payload);
+ ipcRenderer.on('hive:message', listener);
+ return () => ipcRenderer.removeListener('hive:message', listener);
+ },
// ─── Quit confirmation ───────────────────────────────────────────────────
onCloseRequested: (cb: (info: { ptyCount: number }) => void): (() => void) => {
diff --git a/src/renderer/src/assets/maps/office.tmj b/src/renderer/src/assets/maps/office.tmj
index 3be50b67..3a3a71b4 100644
--- a/src/renderer/src/assets/maps/office.tmj
+++ b/src/renderer/src/assets/maps/office.tmj
@@ -1,669 +1 @@
-{ "compressionlevel":-1,
- "height":21,
- "infinite":false,
- "layers":[
- {
- "data":[514, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 0,
- 0, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 0,
- 0, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 0,
- 0, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 0,
- 0, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 0,
- 0, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 0,
- 0, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 0,
- 0, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 0,
- 0, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 0,
- 0, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 0,
- 0, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 0,
- 0, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 0,
- 0, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 0,
- 0, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 0,
- 0, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 0,
- 0, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 0,
- 0, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 0,
- 0, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 0,
- 0, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 0,
- 0, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- "height":21,
- "id":1,
- "name":"floor",
- "opacity":1,
- "type":"tilelayer",
- "visible":true,
- "width":28,
- "x":0,
- "y":0
- },
- {
- "data":[514, 522, 522, 522, 522, 522, 522, 522, 619, 620, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 517,
- 530, 554, 554, 554, 554, 554, 554, 554, 635, 636, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 533,
- 530, 563, 570, 570, 570, 570, 570, 570, 635, 636, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 533,
- 530, 0, 0, 0, 0, 0, 0, 0, 651, 652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
- 530, 0, 0, 0, 0, 0, 0, 0, 667, 684, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
- 530, 0, 0, 0, 0, 0, 0, 0, 683, 684, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
- 530, 0, 0, 0, 0, 0, 0, 0, 699, 700, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
- 530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
- 530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
- 530, 0, 0, 0, 0, 0, 0, 0, 653, 654, 0, 0, 0, 0, 0, 611, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
- 530, 0, 0, 0, 0, 0, 0, 0, 669, 670, 0, 0, 0, 0, 0, 627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
- 530, 523, 523, 523, 523, 523, 523, 523, 522, 522, 522, 524, 0, 0, 0, 627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
- 530, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 540, 0, 0, 0, 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
- 530, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 540, 0, 0, 0, 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
- 530, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 572, 0, 0, 0, 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
- 530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
- 530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
- 530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
- 530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
- 530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 565,
- 578, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 0, 0, 585, 579, 579, 581],
- "height":21,
- "id":2,
- "locked":true,
- "name":"walls",
- "opacity":1,
- "type":"tilelayer",
- "visible":true,
- "width":28,
- "x":0,
- "y":0
- },
- {
- "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 269, 191, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 266, 0,
- 0, 0, 0, 0, 0, 0, 0, 281, 0, 0, 38, 40, 39, 285, 207, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 281, 282, 0,
- 0, 0, 0, 0, 0, 0, 0, 297, 0, 0, 54, 56, 55, 301, 223, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 297, 298, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 289, 0, 0, 0, 0, 0, 0, 261, 261, 0, 261, 261, 0, 0, 0, 2, 3, 4, 0, 2, 3, 4, 0, 0,
- 0, 0, 0, 2, 3, 4, 0, 0, 0, 0, 0, 309, 310, 0, 309, 310, 0, 0, 0, 0, 289, 0, 0, 0, 289, 0, 0, 0,
- 0, 0, 0, 18, 289, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 305, 0, 0, 0, 305, 0, 0, 0,
- 0, 0, 0, 0, 305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 2, 3, 4, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 289, 0, 0, 0, 289, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 305, 0, 0, 0, 305, 0, 0, 0,
- 0, 0, 0, 0, 421, 422, 0, 417, 418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 437, 438, 0, 433, 434, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 2, 3, 4, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 289, 0, 0, 0, 289, 0, 0, 0,
- 0, 0, 0, 0, 257, 257, 257, 257, 0, 0, 0, 0, 0, 0, 0, 0, 1029, 1026, 1027, 0, 305, 0, 0, 0, 305, 0, 0, 0,
- 0, 0, 0, 1610612898, 1610612914, 2684354789, 2684354789, 1610612914, 1610612930, 260, 0, 0, 0, 0, 0, 0, 1041, 1042, 1043, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1610612897, 1610612913, 1610612965, 1610612965, 1610612913, 1610612929, 276, 0, 0, 0, 0, 0, 0, 1044, 0, 1061, 0, 2248, 2249, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 274, 274, 274, 274, 0, 0, 0, 0, 0, 0, 0, 0, 1073, 1074, 1075, 0, 2264, 2265, 0, 0, 0, 463, 464, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2280, 2281, 499, 500, 0, 479, 480, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- "height":21,
- "id":3,
- "name":"furniture-below",
- "opacity":1,
- "type":"tilelayer",
- "visible":true,
- "width":28,
- "x":0,
- "y":0
- },
- {
- "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 354, 0, 327, 328, 0, 0, 0, 313, 0, 0, 0, 0, 0, 0, 327, 328, 0, 0, 0, 389, 0, 0, 0, 0, 0,
- 0, 0, 0, 370, 0, 343, 344, 0, 0, 0, 329, 330, 0, 0, 0, 0, 0, 343, 344, 0, 0, 0, 405, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 365, 366, 0, 0, 365, 366, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 293, 294, 0, 293, 294, 0, 0, 0, 0, 381, 382, 0, 0, 381, 382, 0, 0,
- 0, 0, 0, 431, 432, 349, 0, 0, 0, 0, 0, 262, 262, 0, 262, 262, 0, 0, 0, 18, 19, 20, 0, 18, 19, 20, 0, 0,
- 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 365, 366, 0, 0, 365, 366, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 381, 382, 0, 0, 381, 382, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 19, 20, 0, 18, 19, 20, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 421, 422, 0, 417, 418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 365, 366, 0, 0, 365, 366, 0, 0,
- 0, 0, 0, 0, 437, 438, 0, 433, 434, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 381, 382, 0, 0, 381, 382, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 19, 20, 0, 18, 19, 20, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1610614415, 1610614431, 0, 451, 0, 0, 0, 0, 395, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1610614414, 1610614430, 0, 467, 258, 258, 258, 258, 411, 0, 0, 0, 0, 0, 0, 0, 0, 1610613812, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- "height":21,
- "id":4,
- "name":"furniture-above",
- "opacity":1,
- "type":"tilelayer",
- "visible":true,
- "width":28,
- "x":0,
- "y":0
- },
- {
- "data":[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,
- 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1,
- 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1,
- 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1],
- "height":21,
- "id":5,
- "name":"collision",
- "opacity":1,
- "type":"tilelayer",
- "visible":true,
- "width":28,
- "x":0,
- "y":0
- },
- {
- "draworder":"topdown",
- "id":10,
- "name":"monitor-glow",
- "objects":[
- {
- "height":6.9674867769692,
- "id":108,
- "name":"monitor-pc-1",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":12.059709072272,
- "x":322.003438079071,
- "y":75.1270793350506
- },
- {
- "height":6.71338634240608,
- "id":109,
- "name":"monitor-pc-2",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":11.7217557282024,
- "x":386.234683258917,
- "y":75.2196746324589
- },
- {
- "height":6.96749,
- "id":114,
- "name":"monitor-pc-3",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":12.0597,
- "x":321.94560357524,
- "y":139.081178514763
- },
- {
- "height":6.96749,
- "id":115,
- "name":"monitor-pc-4",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":12.0597,
- "x":385.797613536108,
- "y":138.903305871576
- },
- {
- "height":6.96749,
- "id":116,
- "name":"monitor-pc-5",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":12.0597,
- "x":321.967304037709,
- "y":203.026393740662
- },
- {
- "height":6.96749,
- "id":117,
- "name":"monitor-pc-6",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":12.0597,
- "x":385.912519263607,
- "y":203.026393740662
- }],
- "opacity":1,
- "type":"objectgroup",
- "visible":true,
- "x":0,
- "y":0
- },
- {
- "draworder":"topdown",
- "id":6,
- "name":"spawn-points",
- "objects":[
- {
- "height":0,
- "id":1,
- "name":"desk-ceo",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":0,
- "x":70.578947368421,
- "y":89.6315789473684
- },
- {
- "height":0,
- "id":2,
- "name":"desk-product-manager",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":0,
- "x":327.894736842105,
- "y":168.789473684211
- },
- {
- "height":0,
- "id":3,
- "name":"desk-market-researcher",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":0,
- "x":149.578947368421,
- "y":264.842105263158
- },
- {
- "height":0,
- "id":4,
- "name":"desk-chief-architect",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":0,
- "x":328.22111218126,
- "y":107.814429021949
- },
- {
- "height":0,
- "id":5,
- "name":"desk-agent-organizer",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":0,
- "x":279.117740826764,
- "y":276.843465714893
- },
- {
- "height":0,
- "id":6,
- "name":"desk-project-manager",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":0,
- "x":74.0263157894737,
- "y":252.052631578947
- },
- {
- "height":0,
- "id":7,
- "name":"desk-team-lead",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":0,
- "x":393.710526315789,
- "y":109.289473684211
- },
- {
- "height":0,
- "id":8,
- "name":"desk-backend-engineer",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":0,
- "x":391.026315789474,
- "y":171.315789473684
- },
- {
- "height":0,
- "id":11,
- "name":"desk-ui-ux-expert",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":0,
- "x":326.578947368421,
- "y":233.842105263158
- },
- {
- "height":0,
- "id":12,
- "name":"desk-data-engineer",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":0,
- "x":392.105263157895,
- "y":234.5
- },
- {
- "height":0,
- "id":99,
- "name":"entrance",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":0,
- "x":367.643758867828,
- "y":319.272383308473
- },
- {
- "height":0,
- "id":101,
- "name":"warroom-seat",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":0,
- "x":150.115898303838,
- "y":266.014202141359
- },
- {
- "height":0,
- "id":102,
- "name":"pc-1",
- "opacity":1,
- "point":true,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":0,
- "x":327.488151658768,
- "y":106.161137440758
- },
- {
- "height":0,
- "id":103,
- "name":"pc-2",
- "opacity":1,
- "point":true,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":0,
- "x":391.469194312796,
- "y":106.161137440758
- },
- {
- "height":0,
- "id":104,
- "name":"pc-3",
- "opacity":1,
- "point":true,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":0,
- "x":327.488151658768,
- "y":169.668246445498
- },
- {
- "height":0,
- "id":105,
- "name":"pc-4",
- "opacity":1,
- "point":true,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":0,
- "x":391.943127962085,
- "y":170.142180094787
- },
- {
- "height":0,
- "id":106,
- "name":"pc-5",
- "opacity":1,
- "point":true,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":0,
- "x":327.488151658768,
- "y":233.649289099526
- },
- {
- "height":0,
- "id":107,
- "name":"pc-6",
- "opacity":1,
- "point":true,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":0,
- "x":391.943127962085,
- "y":232.701421800948
- }],
- "opacity":1,
- "type":"objectgroup",
- "visible":true,
- "x":0,
- "y":0
- },
- {
- "draworder":"topdown",
- "id":7,
- "locked":true,
- "name":"zones",
- "objects":[
- {
- "height":144,
- "id":50,
- "name":"ceo-room",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":112,
- "x":16,
- "y":32
- },
- {
- "height":84.1315789473684,
- "id":51,
- "name":"boardroom",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":177.368421052632,
- "x":13.7368421052632,
- "y":237.263157894737
- },
- {
- "height":196.631578947368,
- "id":52,
- "name":"open-work-area",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":129.710526315789,
- "x":291,
- "y":58
- }],
- "opacity":1,
- "type":"objectgroup",
- "visible":true,
- "x":0,
- "y":0
- },
- {
- "draworder":"topdown",
- "id":8,
- "name":"interactive-objects",
- "objects":[
- {
- "height":9.2643868487153,
- "id":100,
- "name":"artifact-vision-brief",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":8.28210993081966,
- "x":80.8419516439106,
- "y":99
- },
- {
- "height":17.2635228848821,
- "id":101,
- "name":"artifact-prd",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":22.5145631067961,
- "x":116.670045045045,
- "y":201.637387387387
- },
- {
- "height":19.1060967740663,
- "id":102,
- "name":"artifact-market-analysis",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":26.2623605845729,
- "x":66.969087357346,
- "y":201.031810625091
- },
- {
- "height":26.8550848910993,
- "id":103,
- "name":"artifact-system-design",
- "opacity":1,
- "rotation":0,
- "type":"",
- "visible":true,
- "width":21.417938604013,
- "x":7.95180929514663,
- "y":258.710341279369
- }],
- "opacity":1,
- "type":"objectgroup",
- "visible":false,
- "x":0,
- "y":0
- },
- {
- "draworder":"topdown",
- "id":8,
- "name":"war-room-objects",
- "objects":[
- {
- "height":0,
- "id":100,
- "name":"war-room-pc",
- "opacity":1,
- "polygon":[
- {
- "x":0,
- "y":0
- },
- {
- "x":5.31680692514101,
- "y":4.56913095129306
- },
- {
- "x":13.1258670964419,
- "y":4.56913095129306
- },
- {
- "x":13.2089422046472,
- "y":17.8611482641456
- },
- {
- "x":4.73528116770373,
- "y":17.8611482641456
- },
- {
- "x":-0.249225324615978,
- "y":12.5443413390046
- }],
- "rotation":0,
- "type":"",
- "visible":true,
- "width":0,
- "x":128.018741744411,
- "y":256.203633705233
- }],
- "opacity":1,
- "type":"objectgroup",
- "visible":false,
- "x":0,
- "y":0
- }],
- "nextlayerid":11,
- "nextobjectid":118,
- "orientation":"orthogonal",
- "renderorder":"right-down",
- "tiledversion":"1.12.0",
- "tileheight":16,
- "tilesets":[
- {
- "columns":16,
- "firstgid":1,
- "image":"..\/tilesets\/office-tileset.png",
- "imageheight":512,
- "imagewidth":256,
- "margin":0,
- "name":"office-tileset",
- "spacing":0,
- "tilecount":512,
- "tileheight":16,
- "tilewidth":16
- },
- {
- "firstgid":513,
- "source":"A5 Office Floors & Walls.tsx"
- },
- {
- "firstgid":1025,
- "source":"interiors.tsx"
- }],
- "tilewidth":16,
- "type":"map",
- "version":"1.10",
- "width":28
-}
\ No newline at end of file
+{"compressionlevel":-1,"height":22,"infinite":false,"layers":[{"data":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,0,0,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,0,0,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,0,0,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,0,0,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,0,0,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,0,0,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,0,0,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,0,0,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,0,0,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,0,0,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,0,0,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,1698,1699,799,800,799,800,0,0,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,1714,1715,783,784,783,784,0,0,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,0,0,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,0,0,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,0,0,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,783,784,0,0,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,799,800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"height":22,"id":1,"name":"floor","opacity":1,"type":"tilelayer","visible":true,"width":34,"x":0,"y":0},{"data":[514,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,517,530,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,554,533,530,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,570,533,530,0,0,0,0,0,0,611,611,0,0,0,0,0,0,0,0,0,611,0,0,0,0,0,0,611,0,0,0,0,0,0,0,533,530,0,0,0,0,0,0,643,643,0,0,0,0,0,0,0,0,0,643,0,0,0,0,0,0,643,0,0,0,0,0,0,0,533,530,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,0,0,0,0,0,0,643,0,0,0,0,0,0,0,533,530,0,0,0,0,0,0,643,643,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,0,0,0,0,0,0,0,533,530,0,0,0,0,0,0,643,643,0,0,0,0,0,0,0,0,0,643,0,0,0,0,0,0,643,0,0,0,0,0,0,0,533,530,522,522,522,522,0,522,522,522,522,522,522,522,0,522,522,522,522,522,0,0,0,0,0,0,643,0,0,0,0,0,0,0,533,530,554,554,554,554,0,554,554,554,554,554,554,554,0,554,554,554,554,554,0,0,0,0,0,0,522,0,522,522,522,522,522,522,533,530,570,570,570,570,0,570,570,570,570,570,570,570,0,570,570,570,570,570,0,0,0,0,0,0,554,0,554,554,554,554,554,554,533,530,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,570,570,0,570,570,570,570,570,570,533,530,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,611,0,0,0,0,0,0,0,0,533,530,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,0,0,0,0,0,0,0,0,533,530,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,0,0,0,0,0,0,0,0,533,530,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,533,530,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,0,0,0,0,0,0,0,0,533,530,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,0,0,0,0,0,0,0,0,533,530,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,0,0,0,0,0,0,0,0,533,530,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,0,0,0,0,0,0,0,0,533,530,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,643,0,0,0,0,0,0,0,0,533,578,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,0,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,579,581],"height":22,"id":2,"name":"walls","opacity":1,"type":"tilelayer","visible":true,"width":34,"x":0,"y":0},{"data":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,266,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,281,282,0,0,0,0,0,0,0,0,0,0,0,0,257,257,257,257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,297,298,0,0,0,0,289,0,0,0,0,0,0,1610612898,1610612914,2684354789,2684354789,1610612914,1610612930,260,0,0,0,0,0,0,0,0,0,2,3,4,2,3,4,0,0,0,0,2,3,4,0,0,0,0,0,1610612897,1610612913,1610612965,1610612965,1610612913,1610612929,276,0,0,0,0,0,0,0,0,0,0,289,0,0,289,0,0,0,0,0,18,289,20,0,0,0,0,0,0,274,274,274,274,0,0,0,0,2,3,4,2,3,4,0,0,305,0,0,305,0,0,0,0,0,0,305,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,289,0,0,289,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,305,0,0,305,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1029,1026,1027,0,0,2,3,4,0,2,3,4,0,2,3,4,0,2,3,4,0,2,3,4,0,2,3,4,0,0,0,0,0,0,1041,1042,1043,0,0,0,289,0,0,0,289,0,0,0,289,0,0,0,289,0,0,0,289,0,0,0,289,0,0,0,0,0,0,0,1044,0,1061,0,0,0,305,0,0,0,305,0,0,0,305,0,0,0,305,0,0,0,305,0,0,0,305,0,0,0,0,305,305,0,1073,1074,1075,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,305,305,0,0,0,0,0,0,2,3,4,0,2,3,4,0,2,3,4,0,2,3,4,0,2,3,4,0,2,3,4,0,0,0,0,0,269,191,192,0,0,0,0,289,0,0,0,289,0,0,0,289,0,0,0,289,0,0,0,289,0,0,0,289,0,0,0,38,40,39,285,207,208,2248,0,0,0,305,0,0,0,305,0,0,0,305,0,0,0,305,0,0,0,305,0,0,0,305,0,0,0,54,56,55,301,223,224,2264,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2280,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"height":22,"id":3,"name":"furniture-below","opacity":1,"type":"tilelayer","visible":true,"width":34,"x":0,"y":0},{"data":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,327,328,0,0,0,0,0,0,327,328,0,0,327,328,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,343,344,0,0,0,0,0,0,343,344,0,0,343,344,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,354,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,365,366,0,365,366,0,0,0,370,0,0,0,0,0,0,0,0,451,0,0,0,0,395,0,0,0,0,0,0,0,0,0,0,0,381,382,0,381,382,0,0,0,0,431,432,349,0,0,0,0,0,467,258,258,258,258,411,0,0,0,0,365,366,0,365,366,0,18,19,20,18,19,20,0,0,0,0,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,381,382,0,381,382,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,19,20,18,19,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,365,366,0,0,365,366,0,0,365,366,0,0,365,366,0,0,365,366,0,0,365,366,0,0,0,0,0,0,0,0,0,0,0,0,381,382,0,0,381,382,0,0,381,382,0,0,381,382,0,0,381,382,0,0,381,382,0,0,0,0,0,0,0,0,0,0,0,18,19,20,0,18,19,20,0,18,19,20,0,18,19,20,0,18,19,20,0,18,19,20,0,313,0,0,0,0,0,1610613812,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,329,330,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1650,1650,0,0,0,0,0,0,0,365,366,0,0,365,366,0,0,365,366,0,0,365,366,0,0,365,366,0,0,365,366,0,0,0,0,0,0,0,0,0,0,0,0,381,382,0,0,381,382,0,0,381,382,0,0,381,382,0,0,381,382,0,0,381,382,0,0,313,0,0,0,0,0,0,0,0,18,19,20,0,18,19,20,0,18,19,20,0,18,19,20,0,18,19,20,0,18,19,20,0,0,329,330,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"height":22,"id":4,"name":"furniture-above","opacity":1,"type":"tilelayer","visible":true,"width":34,"x":0,"y":0},{"data":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,0,0,1,1,1,1,0,0,0,1,0,0,0,0,0,0,1,0,1,1,0,1,1,1,1,1,1,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,1,1,1,1,1,1,1,0,1,1,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,0,1,0,1,1,0,1,1,1,1,0,1,1,0,1,0,1,1,0,1,1,1,0,0,1,1,0,0,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,1,0,1,0,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"height":22,"id":5,"name":"collision","opacity":1,"type":"tilelayer","visible":true,"width":34,"x":0,"y":0},{"draworder":"topdown","id":6,"name":"spawn-points","objects":[{"id":0,"name":"desk-ceo","type":"","x":48,"y":64,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"pc-1","type":"","x":32,"y":208,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"pc-2","type":"","x":96,"y":208,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"pc-3","type":"","x":160,"y":208,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"pc-4","type":"","x":224,"y":208,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"pc-5","type":"","x":288,"y":208,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"pc-6","type":"","x":352,"y":208,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"desk-team-lead","type":"","x":32,"y":288,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"desk-backend-engineer","type":"","x":96,"y":288,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"desk-product-manager","type":"","x":160,"y":288,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"desk-data-engineer","type":"","x":224,"y":288,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"desk-project-manager","type":"","x":288,"y":288,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"desk-market-researcher","type":"","x":352,"y":288,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"desk-agent-organizer","type":"","x":320,"y":112,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"warroom-seat","type":"","x":368,"y":112,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"desk-chief-architect","type":"","x":432,"y":80,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"desk-ui-ux-expert","type":"","x":480,"y":80,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"entrance","type":"","x":256,"y":320,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"cafe-seat-1","type":"","x":432,"y":224,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"cafe-seat-2","type":"","x":432,"y":256,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"cafe-seat-3","type":"","x":448,"y":224,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"cafe-seat-4","type":"","x":448,"y":256,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"cafe-stand-coffee","type":"","x":400,"y":240,"width":0,"height":0,"rotation":0,"visible":true,"point":true},{"id":0,"name":"cafe-stand-vending","type":"","x":464,"y":208,"width":0,"height":0,"rotation":0,"visible":true,"point":true}],"opacity":1,"type":"objectgroup","visible":true,"x":0,"y":0},{"draworder":"topdown","id":7,"name":"zones","objects":[{"id":0,"name":"boardroom","type":"","x":144,"y":48,"width":144,"height":80,"rotation":0,"visible":true},{"id":0,"name":"cafeteria","type":"","x":384,"y":192,"width":128,"height":128,"rotation":0,"visible":true}],"opacity":1,"type":"objectgroup","visible":true,"x":0,"y":0}],"nextlayerid":8,"nextobjectid":1,"orientation":"orthogonal","renderorder":"right-down","tiledversion":"1.12.0","tileheight":16,"tilesets":[{"columns":16,"firstgid":1,"image":"../tilesets/office-tileset.png","imageheight":512,"imagewidth":256,"margin":0,"name":"office-tileset","spacing":0,"tilecount":512,"tileheight":16,"tilewidth":16},{"firstgid":513,"source":"A5 Office Floors & Walls.tsx"},{"firstgid":1025,"source":"interiors.tsx"}],"tilewidth":16,"type":"map","version":"1.10","width":34}
\ No newline at end of file
diff --git a/src/renderer/src/components/MemoryPanel.tsx b/src/renderer/src/components/MemoryPanel.tsx
index caddcbcd..b55465c2 100644
--- a/src/renderer/src/components/MemoryPanel.tsx
+++ b/src/renderer/src/components/MemoryPanel.tsx
@@ -12,10 +12,19 @@ interface MemoryStatus {
bin: string | null;
}
+type ModelId = 'minilm' | 'embeddinggemma';
+
+// Plain-language framing of each model — lead with the benefit the user actually
+// chooses between, not the model's codename.
+const MODELS: { id: ModelId; title: string; detail: string }[] = [
+ { id: 'minilm', title: 'Fast', detail: 'English only · ~90 MB' },
+ { id: 'embeddinggemma', title: 'Multilingual', detail: 'all languages · ~300 MB' },
+];
+
/**
- * Collapsible panel to search the hive's shared semantic memory (MemPalace) and
- * see whether the CLI is detected. Agents use the CLI directly; this lets the
- * human query the same palace.
+ * Lets the human search the shared memory agents build up across sessions, turn
+ * it on/off, and pick how it searches. Agents read/write it directly; this is
+ * the human-facing window into the same memory.
*/
export function MemoryPanel() {
const [open, setOpen] = useState(false);
@@ -29,7 +38,7 @@ export function MemoryPanel() {
};
useEffect(() => { refreshStatus(); }, []);
- const setModel = async (model: 'minilm' | 'embeddinggemma') => {
+ const setModel = async (model: ModelId) => {
await window.cth.updateConfig({ embeddingModel: model });
await refreshStatus();
};
@@ -44,7 +53,7 @@ export function MemoryPanel() {
setResult('');
try {
const res = await window.cth.searchMemory(query.trim());
- setResult(res.ok ? (res.output || '(no matches)') : `error: ${res.error}`);
+ setResult(res.ok ? (res.output || 'Nothing matched yet.') : `Couldn't search: ${res.error}`);
} finally {
setBusy(false);
}
@@ -53,12 +62,23 @@ export function MemoryPanel() {
const active = status?.active;
const pill = active ? `🧠 memory · ${status?.model}` : '🧠 memory';
+ // One clear state line: is memory working, off, or not set up?
+ const state: { dot: string; label: string } = !status?.available
+ ? { dot: 'var(--cth-coral)', label: 'Not set up' }
+ : !status.enabled
+ ? { dot: 'var(--cth-ink-500)', label: 'Off' }
+ : status.initialized
+ ? { dot: 'var(--cth-mint)', label: 'On · ready' }
+ : { dot: 'var(--cth-lemon)', label: 'On · getting ready…' };
+
+ const canSearch = !!status?.available && !!status?.enabled;
+
return (
- <div style={{ position: 'absolute', bottom: 12, left: 12, width: open ? 360 : 'auto', zIndex: 40 }}>
+ <div style={{ position: 'absolute', bottom: 12, left: 12, width: open ? 380 : 'auto', zIndex: 40 }}>
{!open ? (
<button
onClick={() => { setOpen(true); refreshStatus(); }}
- title="Search the hive's shared memory"
+ title="Search the shared memory your agents build up"
style={{
padding: '5px 10px 3px',
background: active ? 'var(--cth-lemon-light)' : 'var(--cth-cream-200)',
@@ -74,56 +94,95 @@ export function MemoryPanel() {
</button>
) : (
<PixelPanel variant="dialog" title="HIVE MEMORY" noPadding>
- <div style={{ display: 'flex', flexDirection: 'column', gap: 8, padding: 12 }}>
- <div style={{ fontSize: 12, color: 'var(--cth-ink-700)' }}>
- {status?.available
- ? <>MemPalace detected · model <b>{status.model}</b> · {status.initialized ? 'palace ready' : 'palace initializing…'}</>
- : <>MemPalace CLI not found. Install with <code>uv tool install mempalace</code> to enable semantic search. Markdown memory still works.</>}
+ <div style={{ display: 'flex', flexDirection: 'column', gap: 12, padding: 14 }}>
+
+ {/* What this is — one plain line. */}
+ <div style={{ fontSize: 12, color: 'var(--cth-ink-700)', lineHeight: 1.5 }}>
+ What your agents remember across sessions, shared between them. Search it by meaning, not just exact words.
</div>
- {/* Settings: enable + embedding model toggle */}
- <div style={{ display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap' }}>
- <button
- onClick={toggleEnabled}
- title="Turn semantic memory on/off"
- style={{
- padding: '4px 8px 2px', cursor: 'pointer', border: 'none',
- fontFamily: 'var(--cth-font-ui)', fontSize: 12,
- background: status?.enabled ? 'var(--cth-mint-light)' : 'var(--cth-cream-200)',
- boxShadow: `inset 0 0 0 1px ${status?.enabled ? 'var(--cth-mint)' : 'var(--cth-ink-500)'}`
- }}
- >
- {status?.enabled ? 'enabled' : 'disabled'}
- </button>
- <span style={{ fontSize: 11, color: 'var(--cth-ink-500)', fontFamily: 'var(--cth-font-display)', textTransform: 'uppercase' }}>model</span>
- {(['minilm', 'embeddinggemma'] as const).map((m) => (
- <button
- key={m}
- onClick={() => setModel(m)}
- title={m === 'minilm' ? 'Light, English, ~90 MB — best for low-RAM Macs' : 'Multilingual, ~300 MB'}
- style={{
- padding: '4px 8px 2px', cursor: 'pointer', border: 'none',
- fontFamily: 'var(--cth-font-ui)', fontSize: 12,
- background: status?.model === m ? 'var(--cth-lemon-light)' : 'var(--cth-cream-100)',
- boxShadow: status?.model === m ? 'inset 0 0 0 2px var(--cth-ink-900)' : 'inset 0 0 0 1px var(--cth-ink-700)'
- }}
+ {/* Status + on/off — the two things the user controls at a glance. */}
+ <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8 }}>
+ <span style={{ display: 'inline-flex', alignItems: 'center', gap: 7, fontSize: 13, color: 'var(--cth-ink-900)', fontFamily: 'var(--cth-font-ui)' }}>
+ <span style={{ width: 9, height: 9, background: state.dot, boxShadow: 'inset 0 0 0 1px var(--cth-ink-900)' }} />
+ {state.label}
+ </span>
+ {status?.available && (
+ <PixelButton
+ variant={status.enabled ? 'secondary' : 'primary'}
+ size="sm"
+ onClick={toggleEnabled}
>
- {m}
- </button>
- ))}
- </div>
- <div style={{ fontSize: 11, color: 'var(--cth-ink-500)' }}>
- Switching models re-indexes new writes going forward; existing entries keep their old embeddings until re-mined.
+ {status.enabled ? 'Turn off' : 'Turn on'}
+ </PixelButton>
+ )}
</div>
+ {/* Not installed: tell the user how to enable it, nothing else. */}
+ {!status?.available && (
+ <div style={{
+ fontSize: 12, color: 'var(--cth-ink-700)', lineHeight: 1.6,
+ background: 'var(--cth-cream-100)', boxShadow: 'inset 0 0 0 1px var(--cth-ink-300)', padding: 10
+ }}>
+ Meaning-based search isn’t installed yet. Enable it with:
+ <div style={{ marginTop: 6 }}>
+ <code style={{
+ fontFamily: 'var(--cth-font-mono)', fontSize: 12, color: 'var(--cth-ink-900)',
+ background: 'var(--cth-paper-100)', padding: '2px 6px', boxShadow: 'inset 0 0 0 1px var(--cth-ink-300)'
+ }}>uv tool install mempalace</code>
+ </div>
+ <div style={{ marginTop: 8, color: 'var(--cth-ink-500)' }}>
+ Agents still keep plain notes without it.
+ </div>
+ </div>
+ )}
+
+ {/* Model: a benefit-framed choice, not a codename dump. */}
{status?.available && (
- <>
+ <div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
+ <span style={{ fontSize: 11, color: 'var(--cth-ink-500)', fontFamily: 'var(--cth-font-display)', textTransform: 'uppercase', letterSpacing: 0.5 }}>
+ Search language
+ </span>
+ <div style={{ display: 'flex', gap: 8 }}>
+ {MODELS.map((m) => {
+ const sel = status.model === m.id;
+ return (
+ <button
+ key={m.id}
+ onClick={() => setModel(m.id)}
+ style={{
+ flex: 1, textAlign: 'left', cursor: 'pointer', border: 'none',
+ padding: '7px 9px 6px',
+ background: sel ? 'var(--cth-lemon-light)' : 'var(--cth-cream-100)',
+ boxShadow: sel ? 'inset 0 0 0 2px var(--cth-ink-900)' : 'inset 0 0 0 1px var(--cth-ink-300)',
+ fontFamily: 'var(--cth-font-ui)'
+ }}
+ >
+ <div style={{ display: 'flex', alignItems: 'center', gap: 5, fontSize: 13, color: 'var(--cth-ink-900)' }}>
+ <span style={{
+ width: 8, height: 8, flexShrink: 0,
+ background: sel ? 'var(--cth-ink-900)' : 'transparent',
+ boxShadow: 'inset 0 0 0 1px var(--cth-ink-700)'
+ }} />
+ {m.title}
+ </div>
+ <div style={{ fontSize: 11, color: 'var(--cth-ink-500)', marginTop: 3 }}>{m.detail}</div>
+ </button>
+ );
+ })}
+ </div>
+ </div>
+ )}
+
+ {/* Search the memory. */}
+ {canSearch && (
+ <div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
<div style={{ display: 'flex', gap: 6 }}>
<input
value={query}
onChange={(e) => setQuery(e.target.value)}
onKeyDown={(e) => { if (e.key === 'Enter') run(); }}
- placeholder="search the hive's memory by meaning…"
+ placeholder="Search by meaning…"
style={{
flex: 1, padding: '6px 8px 4px',
background: 'var(--cth-paper-100)', border: 'none',
@@ -133,7 +192,7 @@ export function MemoryPanel() {
}}
/>
<PixelButton variant="primary" size="sm" onClick={run} disabled={busy}>
- {busy ? '…' : 'search'}
+ {busy ? '…' : 'Search'}
</PixelButton>
</div>
{result && (
@@ -145,11 +204,11 @@ export function MemoryPanel() {
whiteSpace: 'pre-wrap', color: 'var(--cth-ink-900)'
}}>{result}</pre>
)}
- </>
+ </div>
)}
- <div style={{ display: 'flex', justifyContent: 'flex-end' }}>
- <PixelButton variant="ghost" size="sm" onClick={() => setOpen(false)}>close</PixelButton>
+ <div style={{ display: 'flex', justifyContent: 'flex-end', borderTop: '1px solid var(--cth-ink-300)', paddingTop: 10 }}>
+ <PixelButton variant="ghost" size="sm" onClick={() => setOpen(false)}>Close</PixelButton>
</div>
</div>
</PixelPanel>
diff --git a/src/renderer/src/design/global.css b/src/renderer/src/design/global.css
index fe9934fb..df5a44ec 100644
--- a/src/renderer/src/design/global.css
+++ b/src/renderer/src/design/global.css
@@ -83,3 +83,16 @@ canvas, img, svg { image-rendering: pixelated; image-rendering: crisp-edges; }
@media (prefers-reduced-motion: reduce) {
* { animation-duration: 0s !important; transition-duration: 0s !important; }
}
+
+/* xterm: disable font ligatures.
+ * Some browsers (e.g. Firefox 130+) treat sequences like "ff"/"ft"/"fi" as
+ * ligatures, which breaks xterm's per-char width measuring: an "f" gets measured
+ * too narrow and renders with a trailing gap ("f or" instead of "for"). Forcing
+ * ligatures off on both the measure container and the rendered rows keeps the
+ * monospace grid correct. See xtermjs/xterm.js#5156. */
+.xterm,
+.xterm-rows,
+.xterm-width-cache-measure-container {
+ font-variant-ligatures: none !important;
+ font-feature-settings: "liga" 0, "clig" 0, "calt" 0 !important;
+}
diff --git a/src/renderer/src/scene/office/Character.ts b/src/renderer/src/scene/office/Character.ts
index ce606e7f..f15ebbe9 100644
--- a/src/renderer/src/scene/office/Character.ts
+++ b/src/renderer/src/scene/office/Character.ts
@@ -2,7 +2,7 @@ import { Container, Graphics, Texture } from 'pixi.js';
import { CharacterSprite, type Direction, type AnimState } from './CharacterSprite';
import { findPath } from './pathfinding';
import type { TiledMapRenderer } from './TiledMapRenderer';
-import { ToolBubble } from './ToolBubble';
+import { ThoughtBubble } from './ThoughtBubble';
// Adapted from shahar061/the-office (office/characters/Character.ts).
// Differences: keyed by our dynamic agentId (not a fixed role); seat tile +
@@ -37,6 +37,13 @@ const SIT_OFFSET_SIDE = 4; // left/right: a smaller drop plus the sideways tuck
const SEAT_LEG_CROP = 8;
const SEAT_BACK_CROP = 2;
+// Idle 30/30 loop: between tasks an agent alternates roaming the floor with
+// resting at its own desk — for every IDLE_LINGER_SECONDS it spends lingering it
+// then sits at its desk for DESK_REST_SECONDS, and repeats. Working agents skip
+// this entirely (they stay seated via sitAtDesk).
+const IDLE_LINGER_SECONDS = 30;
+const DESK_REST_SECONDS = 30;
+
interface CharacterOptions {
agentId: string;
mapRenderer: TiledMapRenderer;
@@ -67,6 +74,10 @@ export class Character {
private wandering = false;
private idleTimer = 0;
private idleWanderDelay = 1 + Math.random() * 3;
+ // Idle 30/30 loop state (see constants above). Active only between tasks.
+ private idleLoop = false;
+ private idleLoopPhase: 'linger' | 'toDesk' | 'resting' = 'linger';
+ private idleLoopTimer = 0;
private direction: Direction = 'down';
private arrivalCallback: (() => void) | null = null;
@@ -76,7 +87,7 @@ export class Character {
private fadeElapsed = 0;
private hideTimer: ReturnType<typeof setTimeout> | null = null;
- private toolBubble: ToolBubble;
+ private thoughtBubble: ThoughtBubble;
private workGlow: Graphics;
private workGlowElapsed = 0;
private glowOn = false;
@@ -101,7 +112,7 @@ export class Character {
this.py = pos.y + this.mapRenderer.tileSize;
this.sprite.setPosition(this.px, this.py);
- this.toolBubble = new ToolBubble();
+ this.thoughtBubble = new ThoughtBubble();
this.workGlow = new Graphics();
this.workGlow.circle(0, 0, 14);
@@ -133,14 +144,29 @@ export class Character {
}
walkToAndThen(tile: { x: number; y: number }, callback: () => void): void {
+ this.idleLoop = false; // a directed walk-and-do (e.g. a café break) owns the avatar
this.arrivalCallback = callback;
this.moveTo(tile);
+ if (this.state !== 'walk') {
+ // No path produced. If we're already on the tile, fire the callback now;
+ // otherwise it's unreachable — drop it so we don't "arrive" somewhere else.
+ this.arrivalCallback = null;
+ const t = this.getTilePosition();
+ if (t.x === tile.x && t.y === tile.y) callback();
+ }
}
/** Sit at the assigned desk, facing the monitor. Walks there first if away.
* `working` toggles the pulsing focus halo. This is the default pose — agents
* stay seated unless blocked. */
sitAtDesk(working: boolean): void {
+ this.idleLoop = false; // an explicit desk command ends the idle loop
+ this.walkToDeskAndSit(working);
+ }
+
+ /** Walk to the home desk (if away) and sit. `working` toggles the focus halo.
+ * Shared by sitAtDesk (real work/wait) and the idle-loop rest. */
+ private walkToDeskAndSit(working: boolean): void {
this.glowOn = working;
this.wandering = false;
const t = this.getTilePosition();
@@ -156,27 +182,60 @@ export class Character {
/** Snap into the seated pose at the current (desk) tile. */
private applySit(): void {
+ this.applySitPose(this.seatDirection);
+ }
+
+ /** Snap into a seated pose facing `dir` at the current tile. Shared by the
+ * home desk (applySit) and any café seat (sitInPlace). */
+ private applySitPose(dir: Direction): void {
this.state = 'idle';
this.pendingWork = null;
this.pendingSit = false;
this.path = [];
this.sitting = true;
- this.direction = this.seatDirection;
- this.sprite.setAnimation('idle', this.seatDirection);
+ this.direction = dir;
+ this.sprite.setAnimation('idle', dir);
// Slide toward the desk so the agent tucks in instead of floating in the
// aisle, then crop the legs so they read as seated (no standing legs).
let dx = 0, dy = 0;
- switch (this.seatDirection) {
+ switch (dir) {
case 'down': dy = SIT_OFFSET_DOWN; break;
case 'up': dy = SIT_OFFSET_UP; break;
case 'left': dx = -SIT_OFFSET; dy = SIT_OFFSET_SIDE; break;
case 'right': dx = SIT_OFFSET; dy = SIT_OFFSET_SIDE; break;
}
this.sprite.setPosition(this.px + dx, this.py + dy);
- this.sprite.setSeatedCrop(this.seatDirection === 'down' ? SEAT_LEG_CROP : SEAT_BACK_CROP);
+ this.sprite.setSeatedCrop(dir === 'down' ? SEAT_LEG_CROP : SEAT_BACK_CROP);
+ }
+
+ /** Sit on a café seat at the CURRENT tile, facing `dir`. The agent must have
+ * already walked onto the seat tile (drive this from walkToAndThen). Unlike
+ * sitAtDesk this leaves the agent's home desk untouched and never lights the
+ * focus halo — it's a break, not work. */
+ sitInPlace(dir: Direction): void {
+ this.idleLoop = false;
+ this.wandering = false;
+ this.glowOn = false;
+ this.arrivalCallback = null;
+ this.applySitPose(dir);
+ }
+
+ /** True while the avatar is parked in a seated pose (desk or café). */
+ isSitting(): boolean {
+ return this.sitting;
+ }
+
+ /** Turn a standing/idle avatar to face `dir` (e.g. toward the coffee machine
+ * while taking a standing break). No-op mid-walk or while seated. */
+ faceDirection(dir: Direction): void {
+ this.direction = dir;
+ if (!this.sitting && this.state !== 'walk') {
+ this.sprite.setAnimation('idle', dir);
+ }
}
setIdle(): void {
+ this.idleLoop = false;
this.state = 'idle';
this.pendingWork = null;
this.pendingSit = false;
@@ -192,6 +251,17 @@ export class Character {
/** Roam the office between tasks. Picks random walkable tiles and strolls
* to them until the agent is given work again. */
startWandering(): void {
+ if (this.idleLoop && this.wandering) return; // already in the linger phase
+ // (Re)enter the idle loop at its linger phase, then begin roaming.
+ this.idleLoop = true;
+ this.idleLoopPhase = 'linger';
+ this.idleLoopTimer = 0;
+ this.beginWander();
+ }
+
+ /** Low-level: start roaming the floor now. Drives the linger phase of the
+ * idle loop (and is reused when a rest ends). Does not touch the loop state. */
+ private beginWander(): void {
if (this.wandering) return;
this.glowOn = false;
this.sitting = false;
@@ -210,6 +280,7 @@ export class Character {
/** Walk to an arbitrary tile (e.g. the waiting area when blocked); stands on arrival. */
walkToTile(tile: { x: number; y: number }): void {
+ this.idleLoop = false;
this.pendingWork = null;
this.pendingSit = false;
this.sitting = false;
@@ -218,11 +289,6 @@ export class Character {
this.moveTo(tile);
}
- /** Show a plain-text card (the last user prompt) above the seated agent. */
- showPrompt(text: string): void {
- this.toolBubble.showText(text);
- }
-
repositionTo(tx: number, ty: number): void {
this.deskTile = { x: tx, y: ty };
const pos = this.mapRenderer.tileToPixel(tx, ty);
@@ -231,12 +297,26 @@ export class Character {
this.sprite.setPosition(this.px, this.py);
}
- showToolBubble(toolName: string, target: string): void {
- this.toolBubble.show(toolName, target);
+ /** Show what the agent is doing right now in the thought cloud above its head.
+ * Empty text renders an animated "…" (thinking); `tool` adds a small glyph. */
+ showThought(text: string, tool?: string): void {
+ this.thoughtBubble.show(text, tool);
+ }
+
+ /** Fade the thought cloud out after a short linger — the agent went quiet. */
+ hideThought(): void {
+ this.thoughtBubble.startLinger();
}
- hideToolBubble(): void {
- this.toolBubble.startLinger();
+ /** The thought cloud's current base screen rect (no lift), or null if hidden.
+ * The scene uses this to detect and resolve overlapping bubbles. */
+ getThoughtLayout(): { x: number; y: number; w: number; h: number } | null {
+ return this.thoughtBubble.getLayout(this.px, this.py);
+ }
+
+ /** Shift this avatar's thought cloud up by `px` so it clears a nearby one. */
+ setThoughtLift(px: number): void {
+ this.thoughtBubble.setLift(px);
}
setStatusGlyph(glyph: StatusGlyph): void {
@@ -267,7 +347,7 @@ export class Character {
parent.addChild(this.workGlow);
parent.addChild(this.sprite.container);
this.sprite.container.addChild(this.overlay);
- parent.addChild(this.toolBubble.container);
+ parent.addChild(this.thoughtBubble.container);
this.enableClick();
this.fadeDirection = 'in';
this.fadeDuration = 0.5;
@@ -298,8 +378,8 @@ export class Character {
if (reachedZero) {
this.isVisible = false;
this.sprite.container.parent?.removeChild(this.sprite.container);
- this.toolBubble.hide();
- this.toolBubble.container.parent?.removeChild(this.toolBubble.container);
+ this.thoughtBubble.hide();
+ this.thoughtBubble.container.parent?.removeChild(this.thoughtBubble.container);
this.workGlow.parent?.removeChild(this.workGlow);
}
}
@@ -311,15 +391,16 @@ export class Character {
}
}
- this.toolBubble.update(dt);
+ this.thoughtBubble.update(dt);
if (!this.isVisible) return;
// Working agents stay seated; between tasks they wander the office.
if (this.state === 'walk') this.updateWalk(dt);
else if (this.wandering) this.updateWander(dt);
+ if (this.idleLoop) this.updateIdleLoop(dt);
this.sprite.container.zIndex = this.py;
- this.toolBubble.setPosition(this.px, this.py);
+ this.thoughtBubble.setPosition(this.px, this.py);
// work glow
const ts = this.mapRenderer.tileSize;
@@ -409,6 +490,43 @@ export class Character {
this.sprite.setPosition(this.px, this.py);
}
+ /** Drive the idle 30/30 loop: linger on the floor, then rest at the desk,
+ * then linger again — independent of the low-level walk/wander animation. */
+ private updateIdleLoop(dt: number): void {
+ switch (this.idleLoopPhase) {
+ case 'linger':
+ // Roaming (beginWander) handles the motion; we just time the phase.
+ this.idleLoopTimer += dt;
+ if (this.idleLoopTimer >= IDLE_LINGER_SECONDS) {
+ this.idleLoopPhase = 'toDesk';
+ this.idleLoopTimer = 0;
+ this.walkToDeskAndSit(false); // head home and sit (no focus halo)
+ }
+ break;
+ case 'toDesk':
+ // Wait until we've actually arrived and sat down, then start the rest
+ // clock. Watchdog: if the desk is somehow unreachable, resume lingering.
+ this.idleLoopTimer += dt;
+ if (this.sitting) {
+ this.idleLoopPhase = 'resting';
+ this.idleLoopTimer = 0;
+ } else if (this.idleLoopTimer >= 20) {
+ this.idleLoopPhase = 'linger';
+ this.idleLoopTimer = 0;
+ this.beginWander();
+ }
+ break;
+ case 'resting':
+ this.idleLoopTimer += dt;
+ if (this.idleLoopTimer >= DESK_REST_SECONDS) {
+ this.idleLoopPhase = 'linger';
+ this.idleLoopTimer = 0;
+ this.beginWander(); // stand up and roam again
+ }
+ break;
+ }
+ }
+
private updateWander(dt: number): void {
this.idleTimer += dt;
if (this.idleTimer < this.idleWanderDelay) return;
@@ -431,7 +549,7 @@ export class Character {
destroy(): void {
if (this.hideTimer) { clearTimeout(this.hideTimer); this.hideTimer = null; }
- this.toolBubble.destroy();
+ this.thoughtBubble.destroy();
this.sprite.destroy();
this.workGlow.destroy();
this.overlay.destroy();
diff --git a/src/renderer/src/scene/office/MessageEnvelope.ts b/src/renderer/src/scene/office/MessageEnvelope.ts
new file mode 100644
index 00000000..6a38e23d
--- /dev/null
+++ b/src/renderer/src/scene/office/MessageEnvelope.ts
@@ -0,0 +1,146 @@
+import { Container, Graphics } from 'pixi.js';
+import { colors } from '@/design/tokens';
+
+/** Hive speech-acts (mirrors HiveMessage['act'] in the main process). */
+export type MessageAct = 'request' | 'inform' | 'propose' | 'query' | 'agree' | 'refuse' | 'done';
+
+// A little pixel-art envelope that flies from a sender's desk to a recipient's
+// desk when the hive routes a message, then pops a small arrival burst. Lives in
+// world space on the character layer so the camera transforms it like everything
+// else. Fully self-contained: spawn it, tick it, and drop it when done() is true.
+//
+// Aesthetic per DESIGN.md — hard edges, integer pixels, no border-radius, ink
+// outline, status colour by speech-act so a glance reads "who's asking whom".
+
+/** Speech-act → envelope tint. Mirrors the floor's status palette intent:
+ * asks are cool, answers are warm/positive, refusals are red. */
+const ACT_COLOR: Record<MessageAct, number> = {
+ request: colors.accent.sky,
+ query: colors.accent.lilac,
+ propose: colors.accent.lemon,
+ inform: colors.cream[200],
+ agree: colors.accent.mint,
+ done: colors.accent.mint,
+ refuse: colors.accent.coral
+};
+
+const OUTLINE = colors.ink[900];
+const HUMAN_COLOR = colors.accent.coral; // escalations to the human
+
+const FLY_HEIGHT = 22; // px above the feet anchor the envelope rides at
+const ARC_LIFT = 38; // peak of the travel arc (negative y)
+const SPEED = 230; // px/sec — duration derives from travel distance
+const MIN_DURATION = 0.8;
+const MAX_DURATION = 2.0;
+const FADE_IN = 0.14;
+const FADE_OUT = 0.22;
+const BURST_DURATION = 0.34; // arrival sparkle ring
+
+function easeInOut(t: number): number {
+ return t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2;
+}
+
+export class MessageEnvelope {
+ readonly container: Container;
+ private body: Graphics;
+ private burst: Graphics;
+
+ private sx: number; private sy: number;
+ private ex: number; private ey: number;
+ private duration: number;
+ private elapsed = 0;
+ private bursting = false;
+ private burstElapsed = 0;
+ private finished = false;
+
+ /** start/end are world-pixel feet anchors of sender & recipient. */
+ constructor(
+ start: { x: number; y: number },
+ end: { x: number; y: number },
+ act: MessageAct,
+ needsHuman: boolean
+ ) {
+ this.sx = start.x; this.sy = start.y - FLY_HEIGHT;
+ this.ex = end.x; this.ey = end.y - FLY_HEIGHT;
+ const dist = Math.hypot(this.ex - this.sx, this.ey - this.sy);
+ this.duration = Math.min(MAX_DURATION, Math.max(MIN_DURATION, dist / SPEED));
+
+ const fill = needsHuman ? HUMAN_COLOR : (ACT_COLOR[act] ?? colors.cream[200]);
+
+ this.container = new Container();
+ this.container.zIndex = 1_000_000; // always above the cast
+ this.container.eventMode = 'none';
+ this.container.alpha = 0;
+
+ // Envelope: a 14×10 rect with an ink outline and a "flap" chevron. Drawn
+ // centered so rotation/scale pivot at the middle.
+ this.body = new Graphics();
+ const w = 14, h = 10;
+ this.body.rect(-w / 2, -h / 2, w, h).fill({ color: fill }).stroke({ color: OUTLINE, width: 1 });
+ // flap — two lines from the top corners meeting at the centre
+ this.body.moveTo(-w / 2, -h / 2).lineTo(0, h / 2 - 3).lineTo(w / 2, -h / 2)
+ .stroke({ color: OUTLINE, width: 1 });
+ this.container.addChild(this.body);
+
+ this.burst = new Graphics();
+ this.burst.visible = false;
+ this.container.addChild(this.burst);
+
+ this.setPos(this.sx, this.sy);
+ }
+
+ private setPos(x: number, y: number): void {
+ this.container.x = Math.round(x);
+ this.container.y = Math.round(y);
+ }
+
+ /** Advance the animation. Returns true once it has fully played out. */
+ update(dt: number): boolean {
+ if (this.finished) return true;
+
+ if (!this.bursting) {
+ this.elapsed += dt;
+ const t = Math.min(this.elapsed / this.duration, 1);
+ const e = easeInOut(t);
+ // quadratic arc: lerp the endpoints, lift the midpoint
+ const x = this.sx + (this.ex - this.sx) * e;
+ const lift = -ARC_LIFT * Math.sin(Math.PI * e);
+ const y = this.sy + (this.ey - this.sy) * e + lift;
+ this.setPos(x, y);
+
+ // fade in at the start, out near the end; gentle bob rotation
+ const fadeIn = Math.min(this.elapsed / FADE_IN, 1);
+ const fadeOut = t > 1 - FADE_OUT / this.duration
+ ? Math.max(0, (1 - t) / (FADE_OUT / this.duration))
+ : 1;
+ this.container.alpha = Math.min(fadeIn, fadeOut);
+ this.body.rotation = Math.sin(this.elapsed * 6) * 0.12;
+
+ if (t >= 1) {
+ this.bursting = true;
+ this.body.visible = false;
+ this.burst.visible = true;
+ this.container.alpha = 1;
+ this.setPos(this.ex, this.ey);
+ }
+ return false;
+ }
+
+ // arrival burst — an expanding ink ring that fades out
+ this.burstElapsed += dt;
+ const bt = Math.min(this.burstElapsed / BURST_DURATION, 1);
+ const r = 3 + bt * 12;
+ this.burst.clear();
+ this.burst.circle(0, 0, r).stroke({ color: colors.accent.lemon, width: 2, alpha: 1 - bt });
+ this.container.alpha = 1 - bt;
+ if (bt >= 1) {
+ this.finished = true;
+ return true;
+ }
+ return false;
+ }
+
+ destroy(): void {
+ this.container.destroy({ children: true });
+ }
+}
diff --git a/src/renderer/src/scene/office/OfficeFloor.tsx b/src/renderer/src/scene/office/OfficeFloor.tsx
index a9950166..77b26959 100644
--- a/src/renderer/src/scene/office/OfficeFloor.tsx
+++ b/src/renderer/src/scene/office/OfficeFloor.tsx
@@ -6,7 +6,9 @@ import { useStore, type Agent } from '@/store/store';
import { TiledMapRenderer, type TiledMap } from './TiledMapRenderer';
import { Camera } from './Camera';
import { Character } from './Character';
+import { MessageEnvelope, type MessageAct } from './MessageEnvelope';
import { getCastFrames, CAST_BY_NAME, hexToNumber, DEFAULT_CHARACTER } from './cast';
+import { pickSoloLine, pickExchange, type BreakSpot } from './cafeteriaLines';
import { colors } from '@/design/tokens';
import officeTilesetUrl from '@/assets/tilesets/office-tileset.png?url';
@@ -30,6 +32,25 @@ const PRIMARY_SEAT_NAMES = [
];
interface Tile { x: number; y: number; }
+type Facing = 'up' | 'down' | 'left' | 'right';
+
+/** A cafeteria break in progress for one agent — set by the coffee-break
+ * director, cleared when the agent leaves or gets pulled back to work. */
+interface CafeChat {
+ lines: readonly string[]; // alternating beats: even = initiator, odd = partner
+ partnerId: string;
+ idx: number; // next beat to speak
+ beat: number; // seconds until the next beat
+}
+
+interface CafeBreak {
+ spotIdx: number; // index into cafeSpots
+ phase: 'walking' | 'lingering';
+ timer: number; // walking → elapsed watchdog; lingering → countdown
+ quipTimer: number; // until the next solo quip swap
+ chat?: CafeChat; // set on the conversation's initiator
+ chattingWith?: string; // set on the partner: stays put & stays quiet
+}
interface Runtime {
character: Character;
@@ -40,6 +61,7 @@ interface Runtime {
prevAction?: string;
prevCarrying?: string;
prevPrompt?: string;
+ brk?: CafeBreak;
}
/** Patch the map's external (.tsx) tileset refs with the inline metadata the
@@ -72,6 +94,16 @@ function loadTexture(url: string): Promise<Texture> {
});
}
+/** What the agent is doing right now, for the thought cloud. Prefer the live
+ * `action` (e.g. "edit App.tsx", "bash npm test"), fall back to the prompt we
+ * gave it, then to a caller-supplied generic. Returns '' for the working state
+ * with nothing concrete yet — the bubble renders an animated "…" for that. */
+function liveActivity(agent: Agent, fallback = ''): string {
+ const action = (agent.action || '').trim();
+ if (action) return action;
+ return firstWords(agent.lastPrompt) || fallback;
+}
+
/** First few words of the last user prompt, for the desk card. */
function firstWords(prompt: string | undefined, maxWords = 6, maxChars = 42): string {
if (!prompt) return '';
@@ -99,6 +131,10 @@ export function OfficeFloor() {
const runtimes = new Map<string, Runtime>();
const seatClaims = new Set<number>();
+ // In-flight message envelopes (sender desk → recipient desk). Capped so a
+ // broadcast doesn't bury the floor in paper.
+ const envelopes: MessageEnvelope[] = [];
+ const MAX_ENVELOPES = 16;
const init = async () => {
await app.init({
@@ -135,8 +171,8 @@ export function OfficeFloor() {
camera.fitToScreen();
// Build the ordered seat list once: PC desks + named desks first, then
- // conference-room chairs, then open-floor / cafeteria overflow. Each agent
- // claims one and stays there; they never wander off it (except when blocked).
+ // conference-room chairs as overflow. Each agent claims one and stays there;
+ // they never wander off it (except when blocked, or on a coffee break).
const seatTiles: Tile[] = [];
const seatSeen = new Set<string>();
const addSeat = (t?: Tile) => {
@@ -157,7 +193,9 @@ export function OfficeFloor() {
}
};
addZoneSeats('boardroom'); // conference room overflow
- addZoneSeats('open-work-area'); // cafeteria / open-floor overflow
+ // The bottom-right open area is the cafeteria (break room) — see the
+ // coffee-break director below. It is deliberately NOT added as overflow
+ // desk seating, so the café tables stay free for breaks.
// Waiting spots near the entrance — where a blocked agent walks to signal
// it needs the user. Collected as walkable tiles in rings around the door.
@@ -203,6 +241,192 @@ export function OfficeFloor() {
return 'up'; // open-floor overflow seat — no desk, just face away
};
+ // ─── Cafeteria: purposeful coffee breaks ───────────────────────────────
+ // Idle / finished agents occasionally stroll to the break area, sit at a
+ // café table (or stand at the coffee machine / vending machine), emit an
+ // in-character one-liner, then head back. Two agents at the same table
+ // trade a two-beat quip. This is what makes "lingering" feel purposeful.
+ interface CafeSpot { tile: Tile; facing: Facing; spot: BreakSpot; seated: boolean; partner: number; }
+ const cafeSpots: CafeSpot[] = [];
+
+ // Stand spots face the first adjacent non-walkable tile (the appliance).
+ const faceFurniture = (t: Tile): Facing => {
+ if (!mapRenderer.isWalkable(t.x + 1, t.y)) return 'right';
+ if (!mapRenderer.isWalkable(t.x - 1, t.y)) return 'left';
+ if (!mapRenderer.isWalkable(t.x, t.y - 1)) return 'up';
+ return 'down';
+ };
+
+ // Seats first (so partner indices are stable), then the standing spots.
+ for (const name of ['cafe-seat-1', 'cafe-seat-2', 'cafe-seat-3', 'cafe-seat-4']) {
+ const p = mapRenderer.getSpawnPoint(name);
+ if (p) cafeSpots.push({ tile: p, facing: facingForSeat(p), spot: 'table', seated: true, partner: -1 });
+ }
+ // Pair the two seats that share a table (same column, two tiles apart).
+ for (let i = 0; i < cafeSpots.length; i++) {
+ for (let j = i + 1; j < cafeSpots.length; j++) {
+ const a = cafeSpots[i].tile, b = cafeSpots[j].tile;
+ if (a.x === b.x && Math.abs(a.y - b.y) === 2) { cafeSpots[i].partner = j; cafeSpots[j].partner = i; }
+ }
+ }
+ for (const [name, spot] of [['cafe-stand-coffee', 'coffee'], ['cafe-stand-vending', 'vending']] as const) {
+ const p = mapRenderer.getSpawnPoint(name);
+ if (p) cafeSpots.push({ tile: p, facing: faceFurniture(p), spot, seated: false, partner: -1 });
+ }
+ const cafeTaken: (string | null)[] = new Array(cafeSpots.length).fill(null);
+
+ const agentById = (id: string): Agent | undefined =>
+ useStore.getState().agents.find((a) => a.id === id);
+
+ const emitQuip = (id: string, rt: Runtime, spotIdx: number): void => {
+ const spot = cafeSpots[spotIdx];
+ const character = agentById(id)?.character ?? DEFAULT_CHARACTER;
+ const seed = Math.floor(Math.random() * 1e6);
+ rt.character.showThought(pickSoloLine(character, spot.spot, seed));
+ };
+
+ // If the newcomer's table-mate is already lingering (and neither is mid-
+ // conversation), start a multi-beat exchange. The newcomer is the
+ // initiator and owns the script; the partner just gets marked engaged.
+ // Returns true if a chat was started.
+ const maybePairChat = (id: string, rt: Runtime, spotIdx: number): boolean => {
+ const spot = cafeSpots[spotIdx];
+ if (spot.partner < 0 || !rt.brk) return false;
+ const partnerId = cafeTaken[spot.partner];
+ if (!partnerId) return false;
+ const prt = runtimes.get(partnerId);
+ if (!prt?.brk || prt.brk.phase !== 'lingering') return false;
+ if (rt.brk.chat || rt.brk.chattingWith || prt.brk.chat || prt.brk.chattingWith) return false;
+ const character = agentById(id)?.character ?? DEFAULT_CHARACTER;
+ const lines = pickExchange(character, Math.floor(Math.random() * 1e6));
+ rt.brk.chat = { lines, partnerId, idx: 0, beat: 0 };
+ prt.brk.chattingWith = id;
+ return true;
+ };
+
+ // Free a café seat and tidy up any conversation links so neither agent is
+ // left mid-chat. Called when a break ends OR is interrupted by real work.
+ const releaseBreak = (rt: Runtime): void => {
+ if (!rt.brk) return;
+ if (rt.brk.chat) {
+ const p = runtimes.get(rt.brk.chat.partnerId);
+ if (p?.brk) p.brk.chattingWith = undefined;
+ }
+ if (rt.brk.chattingWith) {
+ const o = runtimes.get(rt.brk.chattingWith);
+ if (o?.brk) o.brk.chat = undefined;
+ }
+ cafeTaken[rt.brk.spotIdx] = null;
+ rt.brk = undefined;
+ };
+
+ // End a break gracefully: free the seat, drop the bubble, resume normal idle.
+ const endBreak = (id: string, rt: Runtime): void => {
+ releaseBreak(rt);
+ rt.character.hideThought();
+ const agent = agentById(id);
+ if (agent?.isGod) rt.character.sitAtDesk(true);
+ else rt.character.startWandering();
+ };
+
+ const startBreak = (id: string, rt: Runtime): void => {
+ // Prefer (≈half the time) a seat whose table-mate is already there, so
+ // pairs form and chat; otherwise any free spot.
+ const free: number[] = [];
+ const social: number[] = [];
+ for (let i = 0; i < cafeSpots.length; i++) {
+ if (cafeTaken[i]) continue;
+ free.push(i);
+ const p = cafeSpots[i].partner;
+ if (p >= 0 && cafeTaken[p]) social.push(i);
+ }
+ if (free.length === 0) return;
+ const pool = (social.length && Math.random() < 0.55) ? social : free;
+ const idx = pool[Math.floor(Math.random() * pool.length)];
+ const spot = cafeSpots[idx];
+ cafeTaken[idx] = id;
+ rt.brk = { spotIdx: idx, phase: 'walking', timer: 0, quipTimer: 0 };
+ const c = rt.character;
+ c.walkToAndThen(spot.tile, () => {
+ // Bail if the break was cancelled or reassigned while walking.
+ if (!rt.brk || rt.brk.spotIdx !== idx) return;
+ if (spot.seated) c.sitInPlace(spot.facing);
+ else { c.setIdle(); c.faceDirection(spot.facing); }
+ rt.brk.phase = 'lingering';
+ rt.brk.timer = 8 + Math.random() * 8; // 8–16s of lingering
+ rt.brk.quipTimer = 4 + Math.random() * 4;
+ // Start a conversation if the table-mate is here; otherwise a solo quip.
+ if (!maybePairChat(id, rt, idx)) emitQuip(id, rt, idx);
+ });
+ };
+
+ const breakEligible = (agent: Agent, rt: Runtime): boolean => {
+ if (agent.isGod || rt.brk) return false;
+ if (agent.status !== 'idle' && agent.status !== 'success') return false;
+ return !rt.character.isSitting(); // already parked at a desk → leave it
+ };
+
+ let cafeCooldown = 5;
+ const updateCafeteria = (dt: number): void => {
+ // Advance every in-progress break.
+ for (const [id, rt] of runtimes) {
+ const b = rt.brk;
+ if (!b) continue;
+ if (b.phase === 'walking') {
+ b.timer += dt;
+ if (b.timer > 20) endBreak(id, rt); // never arrived — give up
+ continue;
+ }
+ // lingering
+ if (b.chat) {
+ // Play the conversation one beat at a time, alternating speakers.
+ b.chat.beat -= dt;
+ if (b.chat.beat <= 0) {
+ if (b.chat.idx < b.chat.lines.length) {
+ const speaker = (b.chat.idx % 2 === 0) ? rt : runtimes.get(b.chat.partnerId);
+ speaker?.character.showThought(b.chat.lines[b.chat.idx]);
+ b.chat.idx++;
+ b.chat.beat = 2.4; // seconds per line
+ b.timer = Math.max(b.timer, 3.5); // keep both around to finish
+ const prt = runtimes.get(b.chat.partnerId);
+ if (prt?.brk) prt.brk.timer = Math.max(prt.brk.timer, 3.5);
+ } else {
+ // Conversation over — release the partner and resume solo quips.
+ const prt = runtimes.get(b.chat.partnerId);
+ if (prt?.brk) prt.brk.chattingWith = undefined;
+ b.chat = undefined;
+ }
+ }
+ } else if (!b.chattingWith) {
+ // Not in a conversation (and not being spoken to) — swap a solo quip.
+ b.quipTimer -= dt;
+ if (b.quipTimer <= 0) {
+ b.quipTimer = 4 + Math.random() * 4;
+ emitQuip(id, rt, b.spotIdx);
+ }
+ // Occasionally strike up a chat with a table-mate who arrived too.
+ else if (Math.random() < 0.004) maybePairChat(id, rt, b.spotIdx);
+ }
+ b.timer -= dt;
+ if (b.timer <= 0) endBreak(id, rt);
+ }
+
+ // Periodically send one idle agent on a break — but cap the room at 4.
+ cafeCooldown -= dt;
+ if (cafeCooldown > 0) return;
+ cafeCooldown = 6 + Math.random() * 6;
+ if (cafeTaken.filter(Boolean).length >= 4) return;
+ if (Math.random() >= 0.7) return; // not every window — keep it casual
+ const candidates: Array<[Agent, Runtime]> = [];
+ for (const agent of useStore.getState().agents) {
+ const rt = runtimes.get(agent.id);
+ if (rt && breakEligible(agent, rt)) candidates.push([agent, rt]);
+ }
+ if (candidates.length === 0) return;
+ const [agent, rt] = candidates[Math.floor(Math.random() * candidates.length)];
+ startBreak(agent.id, rt);
+ };
+
const addCharacter = async (agent: Agent) => {
const charName = CAST_BY_NAME[agent.character] ? agent.character : DEFAULT_CHARACTER;
const member = CAST_BY_NAME[charName];
@@ -236,6 +460,7 @@ export function OfficeFloor() {
const removeCharacter = (id: string) => {
const rt = runtimes.get(id);
if (!rt) return;
+ releaseBreak(rt); // free any café seat it was holding
if (rt.seatIndex != null) seatClaims.delete(rt.seatIndex);
rt.character.hide(0);
// give the fade-out a moment, then destroy
@@ -259,17 +484,27 @@ export function OfficeFloor() {
const c = rt.character;
c.setBaseAlpha(agent.status === 'ghost' ? 0.5 : 1);
- // While working, agents sit at their desk (face toward the user) with a
- // card showing the last prompt we gave them. Blocked → walk to the door
- // and flash "!". Done/idle → wander the office until a new task arrives.
- const promptCard = firstWords(agent.lastPrompt);
+ // While an agent is on a coffee break the director owns its avatar — a
+ // mere idle/success refresh must not yank it back to wandering. Any
+ // other live status (work, blocked, …) cancels the break and falls
+ // through to normal handling, sending it back to its desk / the door.
+ if (rt.brk) {
+ if (agent.status === 'idle' || agent.status === 'success') {
+ c.setStatusGlyph(agent.status === 'success' ? 'success' : 'none');
+ return;
+ }
+ releaseBreak(rt);
+ }
+
+ // A thought cloud above the head shows what the agent is doing RIGHT NOW
+ // (its live `action`, e.g. "edit App.tsx"). Working → sit at the desk;
+ // blocked → walk to the door and flash "!"; done/idle → wander.
switch (agent.status) {
case 'working':
case 'thinking':
c.setStatusGlyph('none');
c.sitAtDesk(true);
- if (promptCard) c.showPrompt(promptCard);
- else c.showToolBubble('', '...');
+ c.showThought(liveActivity(agent), agent.carrying);
break;
case 'waiting':
// Parked at the desk awaiting god / another agent — not actively
@@ -277,30 +512,29 @@ export function OfficeFloor() {
// agents that need the human).
c.setStatusGlyph('none');
c.sitAtDesk(false);
- c.showToolBubble('', '⏳');
+ c.showThought(liveActivity(agent, 'waiting'), agent.carrying);
break;
case 'blocked':
c.setStatusGlyph('blocked');
- c.hideToolBubble();
+ c.showThought(liveActivity(agent, 'needs you'));
c.walkToTile(rt.waitTile);
break;
case 'success':
c.setStatusGlyph('success');
- c.hideToolBubble();
+ c.hideThought();
if (agent.isGod) c.sitAtDesk(true); else c.startWandering();
break;
case 'ghost':
c.setStatusGlyph('none');
- c.hideToolBubble();
+ c.hideThought();
c.setIdle();
break;
case 'idle':
default:
c.setStatusGlyph('none');
- c.hideToolBubble();
// The god runs the floor from its desk; everyone else wanders when idle.
- if (agent.isGod) { c.sitAtDesk(true); c.showToolBubble('', '☰'); }
- else c.startWandering();
+ if (agent.isGod) { c.sitAtDesk(true); c.showThought(liveActivity(agent, 'running the floor')); }
+ else { c.startWandering(); c.showThought(liveActivity(agent, 'idle')); }
break;
}
};
@@ -334,10 +568,94 @@ export function OfficeFloor() {
});
(app as any).__unsub = unsubscribe;
+ // Fly an envelope from a sender's desk to each recipient when the hive
+ // routes a message. Endpoints are snapshotted at spawn, so the paper flies
+ // a clean arc even if the avatars wander mid-flight. 'human' recipients
+ // (escalations) fly to the office door.
+ const ts = mapRenderer.tileSize;
+ const humanPos = { x: entrance.x * ts + ts / 2, y: entrance.y * ts + ts };
+ const posFor = (id: string): { x: number; y: number } | null => {
+ if (id === 'human') return humanPos;
+ const rt = runtimes.get(id);
+ return rt ? rt.character.getPixelPosition() : null;
+ };
+ const spawnHandoff = (fromId: string, toId: string, act: MessageAct, needsHuman: boolean) => {
+ if (envelopes.length >= MAX_ENVELOPES) return;
+ if (toId === fromId) return; // never mail yourself
+ const from = posFor(fromId);
+ const to = posFor(toId);
+ if (!from || !to) return; // sender or recipient not on the floor
+ const env = new MessageEnvelope(from, to, act, needsHuman);
+ charLayer.addChild(env.container);
+ envelopes.push(env);
+ };
+
+ // Real path: the main-process router emits one event per routed message.
+ // Guarded so a stale preload bridge (e.g. before a dev-server restart adds
+ // this method) degrades to "no envelopes" rather than crashing the floor.
+ const offMessage = window.cth.onHiveMessage
+ ? window.cth.onHiveMessage((e) => {
+ for (const target of e.targets) spawnHandoff(e.from, target, e.act, e.needsHuman);
+ })
+ : () => { /* onHiveMessage unavailable — real handoffs disabled this session */ };
+ // Demo path: with no live hive, the mock loop dispatches synthetic handoffs
+ // so the animation is still visible. Clearly demo-only, fed by mockEvents.ts.
+ const onDemoHandoff = (ev: Event) => {
+ const d = (ev as CustomEvent<{ from: string; to: string; act: MessageAct }>).detail;
+ if (d) spawnHandoff(d.from, d.to, d.act, false);
+ };
+ window.addEventListener('cth:demo-handoff', onDemoHandoff);
+ (app as any).__offMessage = () => {
+ offMessage();
+ window.removeEventListener('cth:demo-handoff', onDemoHandoff);
+ };
+
+ // Keep two nearby thought clouds from covering each other: stack the
+ // overlapping ones upward. Computed from each bubble's BASE rect (ignoring
+ // the lift already applied) so the result is stable frame-to-frame.
+ const resolveBubbleOverlaps = () => {
+ const items: Array<{ rt: Runtime; x: number; y: number; w: number; h: number }> = [];
+ for (const rt of runtimes.values()) {
+ const lay = rt.character.getThoughtLayout();
+ if (lay) items.push({ rt, ...lay });
+ }
+ if (items.length < 2) {
+ for (const it of items) it.rt.character.setThoughtLift(0);
+ return;
+ }
+ // Lower bubbles (greater bottom edge) and left-most ones hold their spot;
+ // the rest get pushed above them. Deterministic ordering → no flicker.
+ items.sort((a, b) => (b.y + b.h) - (a.y + a.h) || a.x - b.x);
+ const placed: Array<{ x: number; y: number; w: number; h: number }> = [];
+ const pad = 2;
+ for (const it of items) {
+ let y = it.y;
+ let moved = true, guard = 0;
+ while (moved && guard++ < 12) {
+ moved = false;
+ for (const p of placed) {
+ const overlapX = it.x < p.x + p.w + pad && it.x + it.w + pad > p.x;
+ const overlapY = y < p.y + p.h + pad && y + it.h + pad > p.y;
+ if (overlapX && overlapY) { y = p.y - it.h - pad; moved = true; }
+ }
+ }
+ placed.push({ x: it.x, y, w: it.w, h: it.h });
+ it.rt.character.setThoughtLift(it.y - y); // positive → shift up
+ }
+ };
+
const onTick = (ticker: Ticker) => {
const dt = ticker.deltaMS / 1000;
camera.update(dt);
for (const rt of runtimes.values()) rt.character.update(dt);
+ updateCafeteria(dt);
+ resolveBubbleOverlaps();
+ for (let i = envelopes.length - 1; i >= 0; i--) {
+ if (envelopes[i].update(dt)) {
+ envelopes[i].destroy();
+ envelopes.splice(i, 1);
+ }
+ }
};
app.ticker.add(onTick);
@@ -370,6 +688,7 @@ export function OfficeFloor() {
if (a) {
(a as any).__resize?.disconnect?.();
try { (a as any).__unsub?.(); } catch { /* noop */ }
+ try { (a as any).__offMessage?.(); } catch { /* noop */ }
safeDestroy(a);
}
appRef.current = null;
diff --git a/src/renderer/src/scene/office/ThoughtBubble.ts b/src/renderer/src/scene/office/ThoughtBubble.ts
new file mode 100644
index 00000000..d1fe4b1e
--- /dev/null
+++ b/src/renderer/src/scene/office/ThoughtBubble.ts
@@ -0,0 +1,208 @@
+import { Container, Graphics, Text } from 'pixi.js';
+import { colors } from '@/design/tokens';
+import { toolIcon } from './ToolBubble';
+
+// A comic "thought cloud" pinned above an avatar's head showing what it's doing
+// RIGHT NOW (the agent's live `action`, e.g. "edit App.tsx" / "bash npm test").
+// Distinct from the darker ToolBubble speech bubble: a light cream cloud with a
+// trailing-puff tail — the visual shorthand for "thinking". Built to DESIGN.md:
+// integer pixels, hard 1px ink outline, limited palette, no soft shadows.
+//
+// Shares ToolBubble's fade state machine and text truncation so behaviour reads
+// consistently; the differences are the look (cloud + tail, light fill) and that
+// it stays put until the action changes (no auto-linger while the agent works).
+
+const PADDING_X = 6;
+const PADDING_Y = 3;
+const CORNER_RADIUS = 5;
+const MAX_WIDTH = 150;
+const FILL_COLOR = colors.cream[50]; // light cloud
+const OUTLINE_COLOR = colors.ink[900];
+const TEXT_COLOR = '#3d2e4a'; // ink-700
+const FONT_SIZE = 11;
+const RENDER_SCALE = 0.5; // render at 2x, scale down for crispness
+const OFFSET_Y = -38; // a touch higher than the tool bubble
+const FADE_IN_DURATION = 0.15;
+const FADE_OUT_DURATION = 0.3;
+const LINGER_DURATION = 1.2; // only used when hide() is requested
+const DOTS_CYCLE_SPEED = 0.45;
+
+type BubbleState = 'hidden' | 'fading-in' | 'visible' | 'lingering' | 'fading-out';
+
+export class ThoughtBubble {
+ readonly container: Container;
+ private inner: Container;
+ private bg: Graphics;
+ private tail: Graphics;
+ private label: Text;
+ private state: BubbleState = 'hidden';
+ private fadeElapsed = 0;
+ private lingerElapsed = 0;
+ private bgW = 0;
+ private bgH = 0;
+ private isThinking = false;
+ private dotsElapsed = 0;
+ private dotsPhase = 0;
+ // Extra upward shift (px) applied on top of OFFSET_Y so two nearby bubbles can
+ // stack instead of overlapping. Set each frame by the scene's overlap pass.
+ private extraLift = 0;
+
+ constructor() {
+ this.container = new Container();
+ this.container.zIndex = 100000;
+ this.container.eventMode = 'none';
+ this.container.alpha = 0;
+ this.container.visible = false;
+
+ this.inner = new Container();
+ this.inner.scale.set(RENDER_SCALE);
+ this.container.addChild(this.inner);
+
+ this.tail = new Graphics();
+ this.bg = new Graphics();
+ this.label = new Text({
+ text: '',
+ style: { fontSize: FONT_SIZE, fill: TEXT_COLOR, fontFamily: 'monospace' }
+ });
+ this.label.x = PADDING_X;
+ this.label.y = PADDING_Y;
+
+ // tail first so it sits behind the body
+ this.inner.addChild(this.tail, this.bg, this.label);
+ }
+
+ /** Show the current activity. Empty text → an animated "…" (model thinking).
+ * `tool` (an agent's `carrying`) prefixes a small glyph when present. */
+ show(text: string, tool?: string): void {
+ this.isThinking = !text.trim();
+ if (this.isThinking) {
+ this.dotsElapsed = 0;
+ this.dotsPhase = 0;
+ this.label.text = '.';
+ } else {
+ const display = tool ? `${toolIcon(tool)} ${text}` : text;
+ this.label.text = display;
+ const maxTextW = MAX_WIDTH / RENDER_SCALE - PADDING_X * 2;
+ let iterations = 0;
+ let truncated = display;
+ while (truncated.length > 3 && this.label.width > maxTextW && iterations++ < 60) {
+ truncated = truncated.slice(0, -2) + '…';
+ this.label.text = truncated;
+ }
+ }
+ this.redraw();
+ this.reveal();
+ }
+
+ private reveal(): void {
+ if (this.state === 'hidden' || this.state === 'fading-out') {
+ this.state = 'fading-in';
+ this.fadeElapsed = 0;
+ this.container.visible = true;
+ } else {
+ // already up — swap text in place without re-fading
+ this.state = 'visible';
+ this.container.alpha = 1;
+ }
+ this.lingerElapsed = 0;
+ }
+
+ /** Begin fading out (after a short linger) — call when the agent goes quiet. */
+ startLinger(): void {
+ if (this.state === 'hidden') return;
+ this.state = 'lingering';
+ this.lingerElapsed = 0;
+ }
+
+ setPosition(px: number, py: number): void {
+ const halfBubble = (this.bgW * RENDER_SCALE) / 2;
+ this.container.x = Math.round(px - halfBubble);
+ this.container.y = Math.round(py + OFFSET_Y - this.bgH * RENDER_SCALE - this.extraLift);
+ }
+
+ /** Extra upward shift (px), set by the scene's bubble-overlap pass. */
+ setLift(px: number): void {
+ this.extraLift = px;
+ }
+
+ /** The bubble's base screen rect (ignoring any lift) for a given anchor, or
+ * null when hidden. Used by the scene to detect and resolve overlaps. */
+ getLayout(px: number, py: number): { x: number; y: number; w: number; h: number } | null {
+ if (this.state === 'hidden') return null;
+ const w = this.bgW * RENDER_SCALE;
+ const h = this.bgH * RENDER_SCALE;
+ return { x: px - w / 2, y: py + OFFSET_Y - h, w, h };
+ }
+
+ hide(): void {
+ this.state = 'hidden';
+ this.isThinking = false;
+ this.container.alpha = 0;
+ this.container.visible = false;
+ }
+
+ isHidden(): boolean {
+ return this.state === 'hidden';
+ }
+
+ update(dt: number): void {
+ if (this.isThinking && (this.state === 'visible' || this.state === 'fading-in')) {
+ this.dotsElapsed += dt;
+ const newPhase = Math.floor(this.dotsElapsed / DOTS_CYCLE_SPEED) % 3;
+ if (newPhase !== this.dotsPhase) {
+ this.dotsPhase = newPhase;
+ this.label.text = ['.', '..', '...'][this.dotsPhase];
+ this.redraw();
+ }
+ }
+
+ switch (this.state) {
+ case 'fading-in': {
+ this.fadeElapsed += dt;
+ const t = Math.min(this.fadeElapsed / FADE_IN_DURATION, 1);
+ this.container.alpha = t;
+ if (t >= 1) this.state = 'visible';
+ break;
+ }
+ case 'lingering': {
+ this.lingerElapsed += dt;
+ if (this.lingerElapsed >= LINGER_DURATION) {
+ this.state = 'fading-out';
+ this.fadeElapsed = 0;
+ }
+ break;
+ }
+ case 'fading-out': {
+ this.fadeElapsed += dt;
+ const t = Math.min(this.fadeElapsed / FADE_OUT_DURATION, 1);
+ this.container.alpha = 1 - t;
+ if (t >= 1) this.hide();
+ break;
+ }
+ }
+ }
+
+ destroy(): void {
+ this.container.destroy({ children: true });
+ }
+
+ private redraw(): void {
+ this.bgW = Math.min(this.label.width + PADDING_X * 2, MAX_WIDTH / RENDER_SCALE);
+ this.bgH = this.label.height + PADDING_Y * 2;
+
+ this.bg.clear();
+ this.bg.roundRect(0, 0, this.bgW, this.bgH, CORNER_RADIUS);
+ this.bg.fill({ color: FILL_COLOR });
+ this.bg.stroke({ color: OUTLINE_COLOR, width: 1 });
+
+ // Thought-cloud tail: two shrinking puffs trailing down from the bubble's
+ // lower-left toward the head below — the cue that says "thinking", not "speech".
+ this.tail.clear();
+ const baseX = this.bgW * 0.32;
+ const puff = (cx: number, cy: number, r: number) => {
+ this.tail.circle(cx, cy, r).fill({ color: FILL_COLOR }).stroke({ color: OUTLINE_COLOR, width: 1 });
+ };
+ puff(baseX, this.bgH + 4, 3);
+ puff(baseX - 5, this.bgH + 9, 2);
+ }
+}
diff --git a/src/renderer/src/scene/office/cafeteriaLines.ts b/src/renderer/src/scene/office/cafeteriaLines.ts
new file mode 100644
index 00000000..8f71c92c
--- /dev/null
+++ b/src/renderer/src/scene/office/cafeteriaLines.ts
@@ -0,0 +1,237 @@
+// Cafeteria small-talk — The Office edition.
+//
+// The cast ARE Dunder Mifflin (see cast.ts), so an agent's coffee break is an
+// excuse for a one-liner in character. Two kinds of line:
+// • solo — one quip shown above a single agent at a break spot
+// • pair — a two-beat exchange between two agents at the same table
+//
+// Lines are kept short so they fit the ThoughtBubble (≈MAX_WIDTH). Character
+// keys match OfficeCharacterName; anyone without bespoke lines falls back to the
+// shared GENERIC pool so the floor never feels empty.
+
+import type { OfficeCharacterName } from './cast';
+
+/** Where an agent is lingering — picks a contextual line pool. */
+export type BreakSpot = 'coffee' | 'vending' | 'snack' | 'table';
+
+const pick = <T,>(arr: readonly T[], seed: number): T =>
+ arr[((seed % arr.length) + arr.length) % arr.length];
+
+// ─── solo lines, by spot ─────────────────────────────────────────────────────
+
+const COFFEE: readonly string[] = [
+ 'is this… decaf?? who did this',
+ "we're out of beans again",
+ 'World’s Best Boss mug',
+ 'first cup of the day. and the fifth.',
+ 'the coffee here is basically a hug',
+ 'who took my mug?',
+];
+
+const VENDING: readonly string[] = [
+ 'the machine ate my dollar',
+ 'B4… please be the pretzels',
+ 'it’s stuck. classic.',
+ 'shaking it. gently. respectfully.',
+ 'one (1) emotional-support snack',
+ 'A1 again. living dangerously.',
+];
+
+const SNACK: readonly string[] = [
+ 'is it Pretzel Day?',
+ 'who finished the chips??',
+ 'just a little treat',
+ 'these are everyone’s? cool cool cool',
+ 'second breakfast',
+];
+
+const TABLE: readonly string[] = [
+ 'big day. lots of meetings.',
+ 'just five more minutes',
+ 'did you see the standup notes?',
+ 'pretending to read my notes',
+ 'I needed this break, honestly',
+ 'do NOT tell Michael I’m in here',
+];
+
+const SPOT_POOL: Record<BreakSpot, readonly string[]> = {
+ coffee: COFFEE, vending: VENDING, snack: SNACK, table: TABLE,
+};
+
+// ─── character flavour — overrides the generic pool when present ─────────────
+
+const BY_CHARACTER: Partial<Record<OfficeCharacterName, readonly string[]>> = {
+ michael: ['I DECLARE… BANKRUPTCY!', "that's what she said", "I'm not superstitious. just a little stitious.", 'no meetings before coffee. that’s the rule.'],
+ dwight: ['FALSE.', 'identity theft is not a joke', 'that mug is regulation', 'this fridge needs a beet drawer', 'Schrute Farms has better coffee'],
+ jim: ["...that's what she said", 'bears. beets. Battlestar Galactica.', 'I moved Dwight’s stapler again', 'just here for the gossip'],
+ pam: ['Dunder Mifflin, this is Pam', 'sketching the vending machine', 'the watercolor of the break room'],
+ kevin: ['the chili is NOT ready', 'why waste time say lot word', 'me want snack', 'cookie? cookie.'],
+ angela: ['this break room is filthy', 'party planning committee, 3pm', 'I’m judging the fridge'],
+ oscar: ['actually, it’s “espresso”', 'well, actually…', 'the budget for snacks is concerning'],
+ stanley: ['is it Pretzel Day?', 'did I stutter?', 'crossword and coffee. leave me be.', "I'll retire before this brews"],
+ phyllis: ['Bob is picking me up at five', 'knitting and a nice cup of tea'],
+ andy: ['Cornell, ever heard of it?', 'rit-dit-dit, coffee break!', 'Big Tuna, grab a chair'],
+ kelly: ['did you HEAR what happened??', 'so. much. to tell you.', 'I am the GOSSIP queen'],
+ ryan: ['I’m kind of a big deal', 'the temp needs caffeine', 'starting a coffee startup, actually'],
+ toby: ['I should write that up…', 'HR-wise this break is fine', 'no one ever sits with me'],
+ creed: ['which one of you is the new guy?', 'I’ve eaten worse out of that fridge', 'mung beans. under my desk.'],
+ meredith: ['is it 5 o’clock yet?', 'someone spike the coffee?'],
+};
+
+/** A solo break-room line. Character flavour ~60% of the time, else the line
+ * fits the spot the agent is standing at. `seed` keeps it deterministic per
+ * call site (avoids Math.random, which Pixi/Electron CSP-safe code prefers). */
+export function pickSoloLine(character: OfficeCharacterName, spot: BreakSpot, seed: number): string {
+ const flavour = BY_CHARACTER[character];
+ if (flavour && seed % 5 < 3) return pick(flavour, Math.floor(seed / 5));
+ return pick(SPOT_POOL[spot], seed);
+}
+
+// ─── paired exchanges (two agents at one table) ──────────────────────────────
+//
+// Each exchange is a list of beats that ALTERNATE between the two agents:
+// beat[0] = the speaker who sat down, beat[1] = their table-mate, beat[2] =
+// speaker again, and so on. The director plays them out one beat at a time.
+// Lines are trimmed to fit the thought cloud; longer ones auto-truncate.
+
+type Exchange = readonly string[];
+
+// Generic banter — works between any two agents (they're all Dunder Mifflin).
+const EXCHANGES: readonly Exchange[] = [
+ ['world’s best boss.', 'you are. I had the mug made.', 'and I cherish it.'],
+ ['would an idiot do this?', '...if yes, I don’t.', 'that’s my boy.'],
+ ['feared or loved? both.', 'that’s beautiful.', 'I know.'],
+ ['I edited your wiki page again.', 'I know. thank you.'],
+ ['question. how many bears?', 'one.', 'that’s too many.'],
+ ['fact: bears eat beets.', 'bears. beets. Galactica.', 'what is happening.'],
+ ['I grew up on a beet farm.', 'shocking.', '...not shocking at all.'],
+ ['what’s Schrute Farms smell like?', 'victory. and beets.'],
+ ['did you just throw your phone?', 'didn’t like what it said.', 'cool.'],
+ ['is a hot dog a sandwich?', 'it is.', 'I know, right?'],
+ ['three-hole-punch Jim returns.', 'never gets old.'],
+ ['why few word when lot word?', '...genuinely profound.', 'I know.'],
+ ['I am not a bad person.', '...', 'not a great person either.', 'there it is.'],
+ ['I love my cats more than people.', 'including us?', 'especially you.'],
+ ['cats are better than dogs.', 'dogs are better.', '...sorry.'],
+ ['do you love me?', 'I love… being here.', 'that’s a yes.'],
+ ['I’m kind of a big deal.', 'you are?', 'in my mind. yes.'],
+ ['did you miss me?', 'no.', 'a little?', '...there it is.'],
+ ['did you just roll your eyes?', 'I did.', 'why?', 'muscle memory.'],
+ ['I’ve watched that clock since 4.', 'weren’t you working?', 'watching the clock.'],
+ ['what do we sell again?', 'paper.', 'sure, yeah.'],
+ ['how old are you?', 'yeah.', 'that’s not an answer.', 'sure it is.'],
+ ['that’s not how math works.', 'I know.', 'then why?', 'faster.'],
+ ['I’m not an alcoholic.', 'you went to a meeting.', 'for the food.'],
+ ['I went to Cornell.', 'nobody cares.', 'I went to Cornell.', 'still nobody cares.'],
+ ['I have a lot of feelings.', 'I can tell.', 'is that bad?', 'for us? yes.'],
+ ['why are you the way you are?', '...', 'honestly.'],
+ ['your cat died.', 'I know.', 'I’m sorry.', '...thank you.'],
+ ['stop looking at me.', 'you stop looking at me.'],
+ ['sign this.', 'what is it?', 'doesn’t matter.', '...fine.'],
+ ['you can’t say that.', 'I just did.', 'gonna stop me?', '...no.'],
+ ['that’s a fire lane.', 'fire hasn’t happened yet.'],
+ ['I wrapped your stapler in Jello.', 'I’ll eat around it.', 'fair.'],
+ ['zombie attack plan?', 'especially that.', 'of course.'],
+ ['just seeing if you’d answer.', 'I hate you.', 'I know.'],
+ ['a little stitious, not super.', 'that’s not a word.', 'it is now.'],
+ ['funniest person in the office?', 'and other times?', 'other times I know it.'],
+ ['that’s what she said.', '...every time.', 'come on.'],
+ ['I started the fire.', 'no you didn’t.', 'in our hearts, I did.'],
+ ['is today a day ending in Y?', 'yes.', 'then no.'],
+ ['Bob Vance.', 'Phyllis Vance.', 'Vance Refrigeration.'],
+ ['you look beautiful today.', '...I know.'],
+ ['I’m better than you in every way.', 'probably.', 'definitely.', 'sure.'],
+ ['I’m a nice guy.', 'you’re okay.', 'nicest thing you’ve said.'],
+ ['are you okay?', 'I’ve been worse.', 'when?', 'can’t narrow it down.'],
+ ['there’s a spider on your desk.', 'where?', '...you ate it.', 'protein.'],
+ ['soul mates can be bosses.', 'you’re my boss.', 'exactly.'],
+ ['standup ran 40 minutes.', 'could’ve been an email.'],
+ ['is the build green yet?', '...don’t look.'],
+ ['who reply-all’d everyone?', 'we don’t talk about it.'],
+];
+
+// ─── "that's what she said" ──────────────────────────────────────────────────
+//
+// The office's favourite bit. These are generic (added to the shared pool
+// below) so ANY two agents at a table can run them: whoever sits down first
+// delivers the innocent setup (beat 0) and their table-mate lands the punchline
+// (beat 1). Some carry the show's follow-up beats — a sheepish clarification and
+// the inevitable "still counts." Setups are trimmed to fit the thought cloud.
+const TWSS_EXCHANGES: readonly Exchange[] = [
+ ['taking way longer than I expected.', 'that’s what she said.'],
+ ['it’s too big, can’t fit it in my mouth.', 'that’s what she said.'],
+ ['you really need to slow down.', 'that’s what she said.'],
+ ['gonna need a bigger one.', 'that’s what she said.'],
+ ['help, I can’t get it to go in.', 'that’s what she said.'],
+ ['it’s not that hard if you just push.', 'that’s what she said.'],
+ ['I can’t do this all night.', 'that’s what she said.'],
+ ['I need it now, I can’t wait.', 'that’s what she said.'],
+ ['so hot in here, I’m sweating.', 'that’s what she said.'],
+ ['it keeps slipping out of my hands.', 'that’s what she said.'],
+ ['why not just stick it in already?', 'that’s what she said.', '*looks at camera*'],
+ ['I just need a few more inches.', 'that’s what she said.', 'for the shelf!', 'still counts.'],
+ ['make it louder, I can barely feel it.', 'that’s what she said.'],
+ ['can we get this over with quickly?', 'that’s what she said.', 'I meant the meeting.', 'sure.'],
+ ['I just need you to hold it steady.', 'that’s what she said.'],
+ ['can’t believe I did that all morning.', 'that’s what she said.'],
+ ['my hands are cramping.', 'that’s what she said.', 'from typing!', 'that’s what she said.'],
+ ['hours in and barely halfway done.', 'that’s what she said.'],
+ ['surprisingly heavy for its size.', 'that’s what she said.'],
+ ['be more precise. less sloppy.', 'that’s what she said.', 'I meant the spreadsheet.', 'I know.'],
+ ['how long was it?', 'that’s what she said.', '*the whole room goes quiet*', 'I’m sorry, I can’t help it.'],
+ ['too tight, cutting off my circulation.', 'that’s what she said.', '*mouths thank you*'],
+ ['I don’t think it’ll fit.', 'that’s what she said.', '*stands up and applauds*'],
+ ['stop, you’re doing it wrong.', 'that’s what she said.', 'never been prouder.'],
+ ['this just keeps getting harder.', 'that’s what she said.', 'he’s ready.'],
+ ['not wide enough, I need more room.', 'that’s what she said.'],
+ ['I can hold it a really long time.', 'that’s what she said.', 'my breath!', 'still.'],
+ ['why is it taking so long?', 'that’s what she said.', 'I hate you.', 'then why set me up?'],
+ ['I can’t do it with people watching.', 'that’s what she said.', 'the presentation!', 'sure.'],
+ ['it’s deeper than it looks.', 'that’s what she said.', 'the pothole, Michael!', 'doesn’t matter.'],
+ ['so much longer than last time.', 'that’s what she said.', 'the report, Michael.', 'right, right.'],
+ ['oh my god, it went on FOREVER.', 'that’s what she said.', 'the Twilight movie!', 'classic.'],
+ ['can’t believe how thick this is.', 'that’s what she said.', 'the folder. *stares*'],
+ ['I fit all THAT in one day?', 'that’s what she said.', 'that’s actually what I said!', 'meta.'],
+ ['I went at it hard this morning.', 'that’s what she said.', 'at the gym!', 'irrelevant.'],
+ ['someone help me finish this off.', 'that’s what she said.', 'the leftover cake!', 'still works.'],
+ ['get in, do my thing, get out.', 'that’s what she said.', '*doesn’t look up from crossword*'],
+ ['can’t believe it took this long.', 'that’s what she said.', 'the raise. eight years.', 'that one’s on me.'],
+ ['do it slower, it’ll hurt less.', 'that’s what she said.', 'for the quarterly review.', 'sure, Oscar.'],
+ ['didn’t realize how big it’d be.', 'that’s what she said.', 'the calzone, it’s enormous!', 'I love this office.'],
+ ['*to no one* that’s what she said.', 'nobody said anything.', 'just thinking about earlier.'],
+ ['*on the phone* that’s what she said.', 'who was that?', 'my mother. about a sandwich.'],
+ ['too hot in here! that’s what she said.', 'you said both parts.', 'I contain multitudes.'],
+ ['*at the TV* that’s what she said.', 'you’re alone, Michael.', 'she doesn’t know that.'],
+ ['you need to be more professional.', 'that’s what she said.', 'I am she.', '...that’s what she said.'],
+ ['stop. just stop. every time—', 'that’s what she said.', '*leaves the room*', '*whispers* that’s what she said.'],
+ ['as you can see, it’s going up.', 'that’s what she said.', '*everyone groans*', 'set that one up myself.'],
+ ['I declared bankruptcy once. felt good.', 'what does that have to do with—', 'that’s what she said.', 'it doesn’t.', 'I know.'],
+ ['you didn’t say it.', 'I know.', 'why not?', 'I’m growing.', '...that’s what she said.', 'there it is.'],
+ ['impressive you held back today.', 'thank you.', 'I counted zero times.', 'that’s what she said.', 'still counts.'],
+];
+
+// Everything any table-mate pair can draw from.
+const PAIR_POOL: readonly Exchange[] = [...EXCHANGES, ...TWSS_EXCHANGES];
+
+// Keyed off the SPEAKER so, when the right character sits down first, they get
+// to open with their signature bit.
+const KEYED_EXCHANGES: Partial<Record<OfficeCharacterName, Exchange>> = {
+ michael: ['that’s what she said.', '...there it is.'],
+ dwight: ['identity theft is not a joke.', 'nobody touched your stapler, Dwight.'],
+ kevin: ['why few word when lot word?', '...just use the words, Kevin.'],
+ kelly: ['okay don’t freak out, but—', 'I’m already freaking out.'],
+ oscar: ['well, actually—', '...here we go.'],
+ angela: ['this table is filthy.', 'it’s a break room, Angela.'],
+ creed: ['which one are you again?', '...we sit next to each other.'],
+ stanley: ['is it Pretzel Day?', 'no, Stanley.', '...did I stutter?'],
+ andy: ['I went to Cornell.', 'nobody cares.', '...I went to Cornell.'],
+ jim: ['question.', 'yes.', 'nothing. just checking.'],
+};
+
+/** A multi-beat exchange for two agents sharing a table. Beats alternate:
+ * index 0 = `speaker`, 1 = the table-mate, 2 = speaker, … */
+export function pickExchange(speaker: OfficeCharacterName, seed: number): Exchange {
+ const keyed = KEYED_EXCHANGES[speaker];
+ if (keyed && seed % 4 === 0) return keyed;
+ return pick(PAIR_POOL, seed);
+}
diff --git a/src/renderer/src/scene/office/portraitArt.ts b/src/renderer/src/scene/office/portraitArt.ts
index 303f4cd8..d76fa887 100644
--- a/src/renderer/src/scene/office/portraitArt.ts
+++ b/src/renderer/src/scene/office/portraitArt.ts
@@ -79,12 +79,20 @@ function drawHead(buf: Buf, skin: string): void {
type Brow = 'flat' | 'angry' | 'raised' | 'soft';
type Mouth = 'neutral' | 'smile' | 'frown' | 'grin';
-function drawFace(buf: Buf, skin: string, brow: Brow, mouth: Mouth, blush: boolean): void {
+function drawFace(buf: Buf, skin: string, brow: Brow, mouth: Mouth, blush: boolean, lashes = false): void {
const s = SKIN[skin];
const white: RGB = [250, 248, 244], pup: RGB = [46, 38, 42];
for (const [a, b, p] of [[5, 6, 6], [10, 11, 10]] as const) {
set(buf, a, 9, white); set(buf, b, 9, white); set(buf, p, 9, pup);
}
+ // Feminine eyes: a dark upper lash line + an outer flick, and a bright glint
+ // in each pupil so they read as bigger, rounder, more expressive.
+ if (lashes) {
+ const lash: RGB = [54, 40, 48], glint: RGB = [252, 250, 248];
+ for (const x of [5, 6, 10, 11]) set(buf, x, 8, lash);
+ set(buf, 4, 8, lash); set(buf, 12, 8, lash);
+ set(buf, 5, 9, glint); set(buf, 10, 9, glint);
+ }
if (brow === 'flat') for (const x of [5, 6, 10, 11]) set(buf, x, 7, s.line);
else if (brow === 'angry') { set(buf, 5, 8, s.line); set(buf, 6, 7, s.line); set(buf, 10, 7, s.line); set(buf, 11, 8, s.line); }
else if (brow === 'raised') for (const x of [5, 6, 10, 11]) set(buf, x, 6, s.line);
@@ -213,7 +221,29 @@ const styleSpiky: HairFn = (buf, color, skinBase) => {
for (const [x, y] of spikes) set(buf, x, y, hi);
};
-const HAIR_FNS = { styleShort, styleFloppy, styleFrame, styleBun, styleCurly, styleMessy, styleRecede, styleSpiky };
+// Bald: a rounded skin crown (with a sheen) and only a low horseshoe fringe of
+// hair around the temples / back of the head.
+const styleBald: HairFn = (buf, color, skinBase, a) => {
+ const [shi, sbase, ssh] = shades(skinBase, 1.1, 0.82);
+ // rounded skin dome above the forehead
+ for (let x = 6; x <= 11; x++) set(buf, x, 2, sbase);
+ for (let x = 5; x <= 12; x++) set(buf, x, 3, sbase);
+ for (let x = HX0; x <= HX1; x++) set(buf, x, 4, sbase);
+ // bald-head sheen + side falloff
+ for (const x of [7, 8, 9]) set(buf, x, 2, shi);
+ set(buf, 6, 3, shi); set(buf, 7, 3, shi);
+ set(buf, 5, 3, ssh); set(buf, 12, 3, ssh); set(buf, HX1, 4, ssh);
+ // low horseshoe hair fringe — sides only, leaving the crown bald.
+ const [, base, sh] = shades(color);
+ const top = a.recede ? 8 : 6; // recede:1 → only a thin fringe very low
+ for (let y = top; y <= 10; y++) {
+ set(buf, HX0 - 1, y, base); set(buf, HX0, y, base);
+ set(buf, HX1, y, base); set(buf, HX1 + 1, y, base);
+ }
+ for (let y = top; y <= 10; y++) { set(buf, HX0 - 1, y, sh); set(buf, HX1 + 1, y, sh); }
+};
+
+const HAIR_FNS = { styleShort, styleFloppy, styleFrame, styleBun, styleCurly, styleMessy, styleRecede, styleSpiky, styleBald };
type HairStyle = keyof typeof HAIR_FNS;
// ─── facial hair ─────────────────────────────────────────────────────────────
@@ -236,28 +266,41 @@ function drawFacial(buf: Buf, kind: Facial, color: RGB): void {
}
// ─── glasses ─────────────────────────────────────────────────────────────────
+// Clear prescription glasses (NOT sunglasses): a thin rim that frames each eye
+// without covering it. The lens interior keeps the eye/skin already drawn, plus
+// a small white glint so the lens reads as transparent glass.
function drawGlasses(buf: Buf): void {
- for (const x of [4, 5, 6, 7]) set(buf, x, 8, OUTLINE);
- set(buf, 4, 9, OUTLINE); set(buf, 7, 9, OUTLINE);
- for (const x of [4, 5, 6, 7]) set(buf, x, 10, OUTLINE);
- for (const x of [9, 10, 11, 12]) set(buf, x, 8, OUTLINE);
- set(buf, 9, 9, OUTLINE); set(buf, 12, 9, OUTLINE);
- for (const x of [9, 10, 11, 12]) set(buf, x, 10, OUTLINE);
- set(buf, 8, 9, OUTLINE);
- set(buf, 3, 9, OUTLINE); set(buf, 13, 9, OUTLINE);
+ const frame: RGB = [60, 54, 62];
+ const glint: RGB = [236, 240, 246];
+ // Left lens rim around the eye at (5-6, 9): top, bottom, outer + inner edge.
+ for (const x of [5, 6]) { set(buf, x, 8, frame); set(buf, x, 10, frame); }
+ set(buf, 4, 9, frame); set(buf, 7, 9, frame);
+ set(buf, 4, 8, frame); set(buf, 7, 8, frame);
+ // Right lens rim around the eye at (10-11, 9).
+ for (const x of [10, 11]) { set(buf, x, 8, frame); set(buf, x, 10, frame); }
+ set(buf, 9, 9, frame); set(buf, 12, 9, frame);
+ set(buf, 9, 8, frame); set(buf, 12, 8, frame);
+ // Bridge over the nose + temple arms out to the hair.
+ set(buf, 8, 8, frame);
+ set(buf, 3, 9, frame); set(buf, 13, 9, frame);
+ // Glass glint on each rim's top-outer corner so the lens reads as clear glass.
+ set(buf, 4, 8, glint); set(buf, 9, 8, glint);
}
// ─── clothing ────────────────────────────────────────────────────────────────
type Cloth = 'suit' | 'dressshirt' | 'polo' | 'blouse' | 'cardigan' | 'sweater';
-function bodyShape(buf: Buf, col: RGB): void {
+function bodyShape(buf: Buf, col: RGB, heavy = false): void {
const [, base, sh] = shades(col);
- const rows: [number, number, number][] = [[19, 6, 11], [20, 4, 13], [21, 3, 14], [22, 2, 15], [23, 2, 15], [24, 1, 16], [25, 1, 16], [26, 1, 16], [27, 1, 16]];
+ const rows: [number, number, number][] = heavy
+ ? [[19, 5, 12], [20, 3, 14], [21, 2, 15], [22, 1, 16], [23, 1, 16], [24, 0, 17], [25, 0, 17], [26, 0, 17], [27, 0, 17]]
+ : [[19, 6, 11], [20, 4, 13], [21, 3, 14], [22, 2, 15], [23, 2, 15], [24, 1, 16], [25, 1, 16], [26, 1, 16], [27, 1, 16]];
for (const [y, a, b] of rows) rect(buf, a, y, b, y, base);
- for (let y = 22; y < 28; y++) { set(buf, 2, y, sh); set(buf, 15, y, sh); }
+ const [lo, hi] = heavy ? [1, 16] : [2, 15];
+ for (let y = 22; y < 28; y++) { set(buf, lo, y, sh); set(buf, hi, y, sh); }
}
-function drawClothing(buf: Buf, kind: Cloth, c1: RGB, c2: RGB | undefined, tie: RGB | undefined, skin: string): void {
+function drawClothing(buf: Buf, kind: Cloth, c1: RGB, c2: RGB | undefined, tie: RGB | undefined, skin: string, heavy = false): void {
const [hi, base, sh] = shades(c1);
- bodyShape(buf, c1);
+ bodyShape(buf, c1, heavy);
if (kind === 'suit') {
const white: RGB = [238, 238, 236];
for (const [x, y] of [[8, 19], [9, 19], [7, 20], [8, 20], [9, 20], [10, 20], [8, 21], [9, 21]] as const) set(buf, x, y, white);
@@ -309,11 +352,18 @@ function drawSceneLegs(buf: Buf, pants: RGB, phase: number): void {
function drawSceneTorso(buf: Buf, r: Recipe, back: boolean): void {
const [hi, base, sh] = shades(r.c1);
- // shoulders → torso, narrower than the portrait bust
- rect(buf, 4, 18, 13, 18, base);
- rect(buf, 3, 19, 14, 19, base);
- rect(buf, 4, 20, 13, 24, base);
- for (let y = 20; y <= 24; y++) { set(buf, 3, y, sh); set(buf, 14, y, sh); set(buf, 13, y, sh); } // arms / right shade
+ // shoulders → torso, narrower than the portrait bust (wider + rounder if heavy)
+ if (r.heavy) {
+ rect(buf, 3, 18, 14, 18, base);
+ rect(buf, 2, 19, 15, 19, base);
+ rect(buf, 2, 20, 15, 24, base);
+ for (let y = 20; y <= 24; y++) { set(buf, 2, y, sh); set(buf, 15, y, sh); set(buf, 14, y, sh); }
+ } else {
+ rect(buf, 4, 18, 13, 18, base);
+ rect(buf, 3, 19, 14, 19, base);
+ rect(buf, 4, 20, 13, 24, base);
+ for (let y = 20; y <= 24; y++) { set(buf, 3, y, sh); set(buf, 14, y, sh); set(buf, 13, y, sh); } // arms / right shade
+ }
if (back) {
// plain back with a collar line + center seam
rect(buf, 6, 18, 11, 18, sh);
@@ -348,6 +398,7 @@ function drawSceneTorso(buf: Buf, r: Recipe, back: boolean): void {
/** Back of the head: a rounded hair-covered skull with crown sheen + nape, no face. */
function drawHeadBack(buf: Buf, r: Recipe): void {
const s = SKIN[r.skin];
+ if (r.hair === 'styleBald') { drawHeadBackBald(buf, r); return; }
const [hi, base, sh] = shades(r.hairc);
// rounded skull silhouette (narrow at crown + nape, full through the middle)
const rows: [number, number, number][] = [
@@ -372,6 +423,27 @@ function drawHeadBack(buf: Buf, r: Recipe): void {
rect(buf, 7, 15, 9, 15, s.base);
}
+/** Back of a bald head: a skin skull with a sheen and a low hair fringe ring. */
+function drawHeadBackBald(buf: Buf, r: Recipe): void {
+ const s = SKIN[r.skin];
+ const [shi, sbase, ssh] = shades(s.base, 1.1, 0.82);
+ const rows: [number, number, number][] = [
+ [2, 6, 11], [3, 5, 12], [4, 4, 13], [5, 4, 13], [6, 4, 13], [7, 4, 13], [8, 4, 13],
+ [9, 4, 13], [10, 4, 13], [11, 4, 13], [12, 4, 13], [13, 5, 12], [14, 6, 11],
+ ];
+ for (const [y, a, b] of rows) rect(buf, a, y, b, y, sbase);
+ for (let y = 4; y <= 12; y++) { set(buf, 4, y, ssh); set(buf, 13, y, ssh); }
+ for (const [x, y] of [[7, 2], [8, 2], [9, 2], [8, 3], [9, 4], [9, 5]] as const) set(buf, x, y, shi);
+ // low hair fringe ring around the back/sides
+ const [, base, sh] = shades(r.hairc);
+ for (let x = 4; x <= 13; x++) { set(buf, x, 11, base); set(buf, x, 12, base); }
+ for (const x of [4, 13]) { set(buf, x, 11, sh); set(buf, x, 12, sh); }
+ // nape + neck (skin)
+ rect(buf, 7, 14, 10, 14, s.sh);
+ rect(buf, 7, 15, 10, 17, s.sh);
+ rect(buf, 7, 15, 9, 15, s.base);
+}
+
function drawSceneBody(buf: Buf, r: Recipe, phase: number, back: boolean): void {
drawSceneTorso(buf, r, back);
drawSceneLegs(buf, defaultPants(r), phase);
@@ -396,31 +468,52 @@ interface Recipe {
skin: string; hairc: RGB; hair: HairStyle; hairargs?: HairArgs;
cloth: Cloth; c1: RGB; c2?: RGB; tie?: RGB; pants?: RGB;
brow?: Brow; mouth?: Mouth; blush?: boolean; facial?: Facial; glasses?: boolean;
+ /** Bigger, lashed eyes for a more feminine, expressive face. */
+ lashes?: boolean;
+ /** Heavier build: chubby cheeks, a double chin, and a wider torso. */
+ heavy?: boolean;
+}
+
+// Puff the lower face into round cheeks + a double chin so a character reads as
+// heavier. Runs after drawHead (adds skin at the jaw) and is safe before the
+// face features, which sit higher (eyes y9, mouth y14).
+function drawHeavyFace(buf: Buf, skin: string): void {
+ const s = SKIN[skin];
+ // Chubby cheeks: bulge the jaw outward past the normal x4..13 head box.
+ for (let y = 11; y <= 15; y++) { set(buf, HX0 - 1, y, s.base); set(buf, HX1 + 1, y, s.base); }
+ set(buf, HX0 - 1, 15, s.sh); set(buf, HX1 + 1, 15, s.sh);
+ // Fuller, rounder lower jaw.
+ for (const x of [5, 6, 11, 12]) set(buf, x, 16, s.base);
+ // Double chin: a second rounded roll under the jaw.
+ rect(buf, 6, 17, 11, 18, s.base);
+ for (const x of [6, 7, 8, 9, 10, 11]) set(buf, x, 18, s.sh);
+ set(buf, 7, 17, s.sh); set(buf, 10, 17, s.sh); // crease shadow between chin + roll
}
const RECIPES: Record<OfficeCharacterName, Recipe> = {
michael: { skin: 'light', hairc: [58, 42, 28], hair: 'styleShort', hairargs: { part: 'L' }, cloth: 'suit', c1: [58, 63, 74], tie: [170, 58, 58], brow: 'flat', mouth: 'smile' },
jim: { skin: 'light', hairc: [92, 60, 34], hair: 'styleFloppy', cloth: 'dressshirt', c1: [172, 196, 224], tie: [120, 130, 150], brow: 'flat', mouth: 'smile' },
- pam: { skin: 'light', hairc: [108, 68, 38], hair: 'styleFrame', hairargs: { length: 17 }, cloth: 'cardigan', c1: [200, 190, 172], c2: [230, 160, 150], brow: 'soft', mouth: 'smile', blush: true },
+ pam: { skin: 'light', hairc: [120, 76, 42], hair: 'styleFrame', hairargs: { length: 18, vol: 2 }, cloth: 'cardigan', c1: [236, 174, 192], c2: [244, 242, 238], brow: 'soft', mouth: 'smile', blush: true, lashes: true },
dwight: { skin: 'light', hairc: [64, 48, 28], hair: 'styleShort', hairargs: { part: 'L', recede: 1 }, cloth: 'dressshirt', c1: [184, 155, 62], tie: [120, 82, 46], glasses: true, brow: 'angry', mouth: 'neutral' },
- kevin: { skin: 'light', hairc: [58, 44, 30], hair: 'styleRecede', cloth: 'polo', c1: [110, 140, 180], c2: [90, 120, 160], brow: 'flat', mouth: 'neutral' },
- angela: { skin: 'light', hairc: [186, 154, 90], hair: 'styleBun', cloth: 'cardigan', c1: [150, 146, 170], c2: [235, 233, 226], brow: 'angry', mouth: 'frown' },
- oscar: { skin: 'tan', hairc: [28, 22, 18], hair: 'styleShort', hairargs: { part: 'L' }, cloth: 'sweater', c1: [122, 60, 74], glasses: true, brow: 'flat', mouth: 'smile' },
- stanley: { skin: 'dark', hairc: [60, 54, 48], hair: 'styleRecede', cloth: 'dressshirt', c1: [150, 120, 86], tie: [120, 78, 52], glasses: true, facial: 'mustache', brow: 'flat', mouth: 'neutral' },
- phyllis: { skin: 'light', hairc: [196, 162, 110], hair: 'styleCurly', cloth: 'blouse', c1: [202, 160, 192], glasses: true, brow: 'soft', mouth: 'smile' },
- andy: { skin: 'light', hairc: [74, 51, 32], hair: 'styleShort', hairargs: { part: 'R' }, cloth: 'polo', c1: [176, 65, 58], c2: [150, 50, 46], brow: 'raised', mouth: 'grin' },
- kelly: { skin: 'tan', hairc: [24, 18, 22], hair: 'styleFrame', hairargs: { length: 20, vol: 1 }, cloth: 'blouse', c1: [212, 90, 158], brow: 'soft', mouth: 'smile', blush: true },
+ kevin: { skin: 'light', hairc: [58, 44, 30], hair: 'styleBald', cloth: 'polo', c1: [110, 140, 180], c2: [90, 120, 160], brow: 'flat', mouth: 'neutral', heavy: true },
+ angela: { skin: 'light', hairc: [186, 154, 90], hair: 'styleBun', cloth: 'cardigan', c1: [150, 146, 170], c2: [235, 233, 226], brow: 'angry', mouth: 'frown', lashes: true },
+ oscar: { skin: 'tan', hairc: [28, 22, 18], hair: 'styleShort', hairargs: { part: 'L' }, cloth: 'sweater', c1: [122, 60, 74], brow: 'flat', mouth: 'smile' },
+ stanley: { skin: 'dark', hairc: [60, 54, 48], hair: 'styleRecede', cloth: 'dressshirt', c1: [150, 120, 86], tie: [120, 78, 52], glasses: true, facial: 'mustache', brow: 'flat', mouth: 'neutral', heavy: true },
+ phyllis: { skin: 'light', hairc: [196, 162, 110], hair: 'styleCurly', cloth: 'blouse', c1: [202, 160, 192], glasses: true, brow: 'soft', mouth: 'smile', lashes: true, heavy: true },
+ andy: { skin: 'light', hairc: [74, 51, 32], hair: 'styleShort', hairargs: { part: 'R' }, cloth: 'polo', c1: [176, 65, 58], c2: [150, 50, 46], brow: 'raised', mouth: 'smile' },
+ kelly: { skin: 'tan', hairc: [24, 18, 22], hair: 'styleFrame', hairargs: { length: 20, vol: 1 }, cloth: 'blouse', c1: [212, 90, 158], brow: 'soft', mouth: 'smile', blush: true, lashes: true },
ryan: { skin: 'light', hairc: [42, 32, 24], hair: 'styleSpiky', cloth: 'suit', c1: [58, 58, 68], tie: [40, 40, 50], brow: 'flat', mouth: 'neutral' },
- toby: { skin: 'light', hairc: [106, 90, 66], hair: 'styleShort', hairargs: { part: 'L', recede: 1 }, cloth: 'dressshirt', c1: [150, 150, 120], glasses: true, facial: 'mustacheSm', brow: 'soft', mouth: 'frown' },
- creed: { skin: 'light', hairc: [186, 182, 172], hair: 'styleMessy', hairargs: { length: 9 }, cloth: 'dressshirt', c1: [126, 130, 96], facial: 'stubble', brow: 'flat', mouth: 'neutral' },
- meredith: { skin: 'light', hairc: [154, 82, 46], hair: 'styleMessy', hairargs: { length: 15 }, cloth: 'blouse', c1: [176, 86, 74], brow: 'raised', mouth: 'smile' },
+ toby: { skin: 'light', hairc: [106, 90, 66], hair: 'styleShort', hairargs: { part: 'L', recede: 1 }, cloth: 'dressshirt', c1: [150, 150, 120], facial: 'mustacheSm', brow: 'soft', mouth: 'frown' },
+ creed: { skin: 'light', hairc: [170, 166, 156], hair: 'styleBald', cloth: 'dressshirt', c1: [126, 130, 96], facial: 'stubble', brow: 'flat', mouth: 'neutral' },
+ meredith: { skin: 'light', hairc: [154, 82, 46], hair: 'styleMessy', hairargs: { length: 15 }, cloth: 'blouse', c1: [176, 86, 74], brow: 'raised', mouth: 'smile', lashes: true },
};
/** The face/hair group (head → face → facial hair → hair → glasses), no clothing. */
function drawHeadGroup(buf: Buf, r: Recipe): void {
const skinBase = SKIN[r.skin].base;
drawHead(buf, r.skin);
- drawFace(buf, r.skin, r.brow ?? 'flat', r.mouth ?? 'neutral', r.blush ?? false);
+ if (r.heavy) drawHeavyFace(buf, r.skin);
+ drawFace(buf, r.skin, r.brow ?? 'flat', r.mouth ?? 'neutral', r.blush ?? false, r.lashes ?? false);
if (r.facial) drawFacial(buf, r.facial, r.hairc);
HAIR_FNS[r.hair](buf, r.hairc, skinBase, r.hairargs ?? {});
if (r.glasses) drawGlasses(buf);
@@ -435,7 +528,7 @@ function defaultPants(r: Recipe): RGB {
function compose(r: Recipe): Buf {
CUR_W = PORTRAIT_W; CUR_H = PORTRAIT_H;
const buf = new Uint8ClampedArray(PORTRAIT_W * PORTRAIT_H * 4);
- drawClothing(buf, r.cloth, r.c1, r.c2, r.tie, r.skin);
+ drawClothing(buf, r.cloth, r.c1, r.c2, r.tie, r.skin, r.heavy ?? false);
collarNeck(buf, r.skin);
drawHeadGroup(buf, r);
outlinePass(buf);
diff --git a/src/renderer/src/store/mockEvents.ts b/src/renderer/src/store/mockEvents.ts
index 7931090e..b05c0491 100644
--- a/src/renderer/src/store/mockEvents.ts
+++ b/src/renderer/src/store/mockEvents.ts
@@ -128,6 +128,24 @@ function stepAgent(agent: Agent) {
}
}
+const MOCK_ACTS = ['request', 'inform', 'propose', 'query', 'agree'] as const;
+
+/** Occasionally fire a synthetic agent-to-agent message so the office floor's
+ * envelope-handoff animation is visible in demo mode (no live hive routing
+ * happens without real `claude` agents). The scene listens for this event and
+ * flies an envelope between the two avatars; see OfficeFloor's demo path. */
+function maybeFlyMessage(mockIds: string[]): void {
+ if (mockIds.length < 2 || Math.random() >= 0.45) return;
+ const from = mockIds[Math.floor(Math.random() * mockIds.length)];
+ let to = from;
+ for (let i = 0; i < 6 && to === from; i++) {
+ to = mockIds[Math.floor(Math.random() * mockIds.length)];
+ }
+ if (to === from) return;
+ const act = MOCK_ACTS[Math.floor(Math.random() * MOCK_ACTS.length)];
+ window.dispatchEvent(new CustomEvent('cth:demo-handoff', { detail: { from, to, act } }));
+}
+
let interval: number | null = null;
export function startMockLoop() {
@@ -151,6 +169,8 @@ export function startMockLoop() {
});
}
}
+
+ maybeFlyMessage(a2.filter((a) => !a.ptyId).map((a) => a.id));
}, TICK_MS) as unknown as number;
}
diff --git a/tools/mapgen/build_map.py b/tools/mapgen/build_map.py
new file mode 100644
index 00000000..a7dc3eb6
--- /dev/null
+++ b/tools/mapgen/build_map.py
@@ -0,0 +1,239 @@
+#!/usr/bin/env python3
+"""Generate a Dunder Mifflin (The Office) styled office.tmj — iconic zones:
+Michael's corner office, conference room, the open bullpen with desk pods,
+accounting nook, the annex, reception, kitchen/break area, warehouse corner.
+
+Furniture is composed by copying multi-tile "stamps" out of the original
+hand-authored map (original-office.tmj) so every sprite is known-good, then
+re-placing them into a show-accurate layout. Walls/floor/collision are
+regenerated. Run: python3 tools/mapgen/build_map.py
+"""
+import json, os, copy
+
+HERE = os.path.dirname(__file__)
+ASSETS = os.path.abspath(os.path.join(HERE, '..', '..', 'src', 'renderer', 'src', 'assets'))
+MAPS = os.path.join(ASSETS, 'maps')
+SRC = os.path.join(HERE, 'original-office.tmj') # pristine copy of the original
+OUT = os.path.join(MAPS, 'office.tmj')
+
+FLIP_V = 0x40000000
+GID_MASK = 0x1FFFFFFF
+CHAIR_GIDS = {289, 305} # walkable furniture (the seat)
+
+NEW_W, NEW_H = 34, 22
+TS = 16
+
+# ── source map ────────────────────────────────────────────────────────────────
+src = json.load(open(SRC))
+SW, SHH = src['width'], src['height']
+SLAYERS = {l['name']: l['data'] for l in src['layers'] if 'data' in l}
+FURN = ['furniture-below', 'furniture-above']
+
+def copy_stamp(x0, y0, w, h, seat=None, layers=None):
+ """Pull furniture tiles from src rect → portable stamp."""
+ tiles = []
+ for layer in (layers or FURN):
+ d = SLAYERS[layer]
+ for dr in range(h):
+ for dc in range(w):
+ raw = d[(y0 + dr) * SW + (x0 + dc)]
+ if raw:
+ tiles.append((layer, dc, dr, raw))
+ return {'w': w, 'h': h, 'seat': seat, 'tiles': tiles}
+
+# Stamp library (rects in the ORIGINAL 28x21 map).
+# Every agent desk is the same forward-facing workstation (monitor north, the
+# agent seated facing it) — laid out on a uniform grid.
+PC = copy_stamp(19, 4, 3, 4, seat=(1, 2)) # workstation, agent faces UP
+EXEC = copy_stamp(3, 5, 3, 4, seat=(1, 0)) # boss desk, faces DOWN (desk to south)
+CONF = copy_stamp(3, 15, 7, 4) # long conference table
+KITCHEN = copy_stamp(10, 1, 6, 3) # fridge / counter / windows
+COPIER = copy_stamp(16, 15, 3, 4) # photocopier
+BOXES = copy_stamp(19, 17, 2, 3) # warehouse box stack
+COFFEE = copy_stamp(10, 1, 2, 2, layers=['furniture-above']) # water/coffee station
+PLANT2 = copy_stamp(3, 1, 1, 2) # barrel/plant
+WINDOW = copy_stamp(5, 1, 2, 2) # window w/ curtains (furniture-above)
+COOLER = copy_stamp(25, 1, 2, 3) # water cooler / clock
+
+# ── blank new layers ──────────────────────────────────────────────────────────
+def blank():
+ return [0] * (NEW_W * NEW_H)
+
+floor = blank()
+walls = blank()
+fb = blank() # furniture-below
+fa = blank()
+coll = blank()
+
+def idx(x, y):
+ return y * NEW_W + x
+
+def setw(layer, x, y, gid):
+ if 0 <= x < NEW_W and 0 <= y < NEW_H:
+ layer[idx(x, y)] = gid
+
+# ── floor (green checker, matches original) ───────────────────────────────────
+for y in range(3, NEW_H - 1):
+ for x in range(1, NEW_W - 1):
+ base = 799 if y % 2 == 0 else 783
+ setw(floor, x, y, base + (0 if x % 2 == 1 else 1))
+
+# ── outer shell ───────────────────────────────────────────────────────────────
+TOP_CAP, TOP_FACE, TOP_BASE = 522, 554, 570
+L, R = 530, 533
+for x in range(1, NEW_W - 1):
+ setw(walls, x, 0, TOP_CAP); setw(walls, x, 1, TOP_FACE); setw(walls, x, 2, TOP_BASE)
+setw(walls, 0, 0, 514); setw(walls, NEW_W - 1, 0, 517)
+for y in range(1, NEW_H - 1):
+ setw(walls, 0, y, L); setw(walls, NEW_W - 1, y, R)
+# bottom
+for x in range(1, NEW_W - 1):
+ setw(walls, x, NEW_H - 1, 579)
+setw(walls, 0, NEW_H - 1, 578); setw(walls, NEW_W - 1, NEW_H - 1, 581)
+
+# ── interior wall helpers ─────────────────────────────────────────────────────
+def vwall(col, r0, r1, doors=()): # thin vertical wall
+ for r in range(r0, r1 + 1):
+ if r in doors:
+ continue
+ setw(walls, col, r, 611 if r == r0 else 643)
+
+def hwall(row, c0, c1, doors=()): # 3-row south-facing wall (room above)
+ for c in range(c0, c1 + 1):
+ if c in doors:
+ continue
+ setw(walls, c, row, TOP_CAP)
+ setw(walls, c, row + 1, TOP_FACE)
+ setw(walls, c, row + 2, TOP_BASE)
+
+# ── place a furniture stamp; returns the seat tile (gx,gy) if any ─────────────
+PLACED_SEATS = []
+def place(stamp, gx, gy):
+ for (layer, dc, dr, raw) in stamp['tiles']:
+ tgt = fb if layer == 'furniture-below' else fa
+ setw(tgt, gx + dc, gy + dr, raw)
+ if stamp['seat'] is not None:
+ s = (gx + stamp['seat'][0], gy + stamp['seat'][1])
+ PLACED_SEATS.append(s)
+ return s
+ return None
+
+# ══ ROOMS ════════════════════════════════════════════════════════════════════
+# Michael's office (top-left). Interior cols 1-6 rows 3-7.
+vwall(7, 3, 10, doors=(5,))
+hwall(8, 1, 7, doors=(5,)) # south door into the floor
+michael = place(EXEC, 2, 4) # boss desk, faces room (down)
+place(PLANT2, 1, 3)
+place(WINDOW, 2, 1)
+
+# Conference room (top-center). Interior cols 9-17 rows 3-7.
+vwall(8, 3, 10, doors=(5,))
+vwall(18, 3, 10, doors=(6,))
+hwall(8, 8, 18, doors=(13,))
+place(CONF, 10, 3)
+place(WINDOW, 10, 1); place(WINDOW, 14, 1)
+
+# Annex (top-right). Interior cols 26-32 rows 3-8. Ryan / Kelly / Toby.
+# Door is on the SOUTH wall so the front-bay desks can't block its approach.
+vwall(25, 3, 11)
+hwall(9, 25, 32, doors=(26,))
+annex = [place(PC, 26, 3), place(PC, 29, 3)] # desks up top, aisle below
+place(COOLER, 31, 1)
+
+# ══ OPEN FLOOR FURNITURE ═════════════════════════════════════════════════════
+# Bullpen — a uniform grid of identical forward-facing desks. Each desk is 3
+# tiles wide with a 1-tile aisle between columns and a wide aisle between the
+# two rows, so every workstation is evenly spaced and reachable.
+GRID_COLS = [2, 6, 10, 14, 18, 22] # seat x (desks span x-1..x+1, aisles between)
+GRID_ROWS = [13, 18] # seat y (monitor above, chair below)
+grid = []
+for sr in GRID_ROWS:
+ for sc in GRID_COLS:
+ grid.append(place(PC, sc - 1, sr - 2))
+
+# Back-office pair in the front bay (between conference and annex).
+bay = [place(PC, 19, 5), place(PC, 22, 5)]
+
+# Kitchen / break area (bottom-right, open against the wall).
+place(KITCHEN, 26, 17)
+
+# Warehouse corner decor (bottom-right).
+place(COPIER, 30, 11)
+place(BOXES, 31, 18)
+
+# Decor / breathing room in the open floor.
+place(COFFEE, 25, 13) # coffee station by the kitchen walkway
+
+# ══ COLLISION ════════════════════════════════════════════════════════════════
+for y in range(NEW_H):
+ for x in range(NEW_W):
+ solid = False
+ if walls[idx(x, y)]:
+ solid = True
+ for fl in (fb, fa):
+ g = fl[idx(x, y)] & GID_MASK
+ if g and g not in CHAIR_GIDS:
+ solid = True
+ if solid:
+ setw(coll, x, y, 1)
+# bottom entrance door (aligned with the central aisle at col 16)
+for x in (16,):
+ setw(coll, x, NEW_H - 1, 0)
+ setw(walls, x, NEW_H - 1, 0)
+# force seat tiles walkable
+for (sx, sy) in PLACED_SEATS:
+ setw(coll, sx, sy, 0)
+
+# ── spawn points (claim order set in OfficeFloor) ─────────────────────────────
+def pt(name, tile):
+ return {'id': 0, 'name': name, 'type': '', 'x': tile[0] * TS, 'y': tile[1] * TS,
+ 'width': 0, 'height': 0, 'rotation': 0, 'visible': True, 'point': True}
+
+SEATS = {
+ 'desk-ceo': michael,
+ # bullpen grid — front row then back row, left → right
+ 'pc-1': grid[0], 'pc-2': grid[1], 'pc-3': grid[2],
+ 'pc-4': grid[3], 'pc-5': grid[4], 'pc-6': grid[5],
+ 'desk-team-lead': grid[6], 'desk-backend-engineer': grid[7],
+ 'desk-product-manager': grid[8], 'desk-data-engineer': grid[9],
+ 'desk-project-manager': grid[10], 'desk-market-researcher': grid[11],
+ # front-bay back office + annex
+ 'desk-agent-organizer': bay[0], 'warroom-seat': bay[1],
+ 'desk-chief-architect': annex[0], 'desk-ui-ux-expert': annex[1],
+}
+spawn_objs = [pt(n, t) for n, t in SEATS.items()]
+spawn_objs.append(pt('entrance', (16, 20)))
+
+zones = [
+ {'id': 0, 'name': 'boardroom', 'type': '', 'x': 9 * TS, 'y': 3 * TS,
+ 'width': 9 * TS, 'height': 5 * TS, 'rotation': 0, 'visible': True},
+ {'id': 0, 'name': 'open-work-area', 'type': '', 'x': 24 * TS, 'y': 12 * TS,
+ 'width': 8 * TS, 'height': 8 * TS, 'rotation': 0, 'visible': True},
+]
+
+# ── assemble & write ──────────────────────────────────────────────────────────
+def tilelayer(name, data, lid):
+ return {'data': data, 'height': NEW_H, 'id': lid, 'name': name, 'opacity': 1,
+ 'type': 'tilelayer', 'visible': True, 'width': NEW_W, 'x': 0, 'y': 0}
+
+def objlayer(name, objs, lid):
+ return {'draworder': 'topdown', 'id': lid, 'name': name, 'objects': objs,
+ 'opacity': 1, 'type': 'objectgroup', 'visible': True, 'x': 0, 'y': 0}
+
+out = copy.deepcopy(src)
+out['width'] = NEW_W
+out['height'] = NEW_H
+out['layers'] = [
+ tilelayer('floor', floor, 1),
+ tilelayer('walls', walls, 2),
+ tilelayer('furniture-below', fb, 3),
+ tilelayer('furniture-above', fa, 4),
+ tilelayer('collision', coll, 5),
+ objlayer('spawn-points', spawn_objs, 6),
+ objlayer('zones', zones, 7),
+]
+out['nextlayerid'] = 8
+out['nextobjectid'] = 1
+
+json.dump(out, open(OUT, 'w'), indent=1)
+print('wrote', OUT, f'{NEW_W}x{NEW_H}, {len(PLACED_SEATS)} seats')
diff --git a/tools/mapgen/original-office.tmj b/tools/mapgen/original-office.tmj
new file mode 100644
index 00000000..3be50b67
--- /dev/null
+++ b/tools/mapgen/original-office.tmj
@@ -0,0 +1,669 @@
+{ "compressionlevel":-1,
+ "height":21,
+ "infinite":false,
+ "layers":[
+ {
+ "data":[514, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 0,
+ 0, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 0,
+ 0, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 0,
+ 0, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 0,
+ 0, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 0,
+ 0, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 0,
+ 0, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 0,
+ 0, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 0,
+ 0, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 0,
+ 0, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 0,
+ 0, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 0,
+ 0, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 0,
+ 0, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 0,
+ 0, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 0,
+ 0, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 0,
+ 0, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 0,
+ 0, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 0,
+ 0, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 0,
+ 0, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 799, 800, 0,
+ 0, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 783, 784, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ "height":21,
+ "id":1,
+ "name":"floor",
+ "opacity":1,
+ "type":"tilelayer",
+ "visible":true,
+ "width":28,
+ "x":0,
+ "y":0
+ },
+ {
+ "data":[514, 522, 522, 522, 522, 522, 522, 522, 619, 620, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 517,
+ 530, 554, 554, 554, 554, 554, 554, 554, 635, 636, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 533,
+ 530, 563, 570, 570, 570, 570, 570, 570, 635, 636, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 533,
+ 530, 0, 0, 0, 0, 0, 0, 0, 651, 652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
+ 530, 0, 0, 0, 0, 0, 0, 0, 667, 684, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
+ 530, 0, 0, 0, 0, 0, 0, 0, 683, 684, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
+ 530, 0, 0, 0, 0, 0, 0, 0, 699, 700, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
+ 530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
+ 530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
+ 530, 0, 0, 0, 0, 0, 0, 0, 653, 654, 0, 0, 0, 0, 0, 611, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
+ 530, 0, 0, 0, 0, 0, 0, 0, 669, 670, 0, 0, 0, 0, 0, 627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
+ 530, 523, 523, 523, 523, 523, 523, 523, 522, 522, 522, 524, 0, 0, 0, 627, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
+ 530, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 540, 0, 0, 0, 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
+ 530, 554, 554, 554, 554, 554, 554, 554, 554, 554, 554, 540, 0, 0, 0, 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
+ 530, 570, 570, 570, 570, 570, 570, 570, 570, 570, 570, 572, 0, 0, 0, 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
+ 530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
+ 530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
+ 530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
+ 530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533,
+ 530, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 565,
+ 578, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 0, 0, 585, 579, 579, 581],
+ "height":21,
+ "id":2,
+ "locked":true,
+ "name":"walls",
+ "opacity":1,
+ "type":"tilelayer",
+ "visible":true,
+ "width":28,
+ "x":0,
+ "y":0
+ },
+ {
+ "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 269, 191, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 266, 0,
+ 0, 0, 0, 0, 0, 0, 0, 281, 0, 0, 38, 40, 39, 285, 207, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 281, 282, 0,
+ 0, 0, 0, 0, 0, 0, 0, 297, 0, 0, 54, 56, 55, 301, 223, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 297, 298, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 289, 0, 0, 0, 0, 0, 0, 261, 261, 0, 261, 261, 0, 0, 0, 2, 3, 4, 0, 2, 3, 4, 0, 0,
+ 0, 0, 0, 2, 3, 4, 0, 0, 0, 0, 0, 309, 310, 0, 309, 310, 0, 0, 0, 0, 289, 0, 0, 0, 289, 0, 0, 0,
+ 0, 0, 0, 18, 289, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 305, 0, 0, 0, 305, 0, 0, 0,
+ 0, 0, 0, 0, 305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 2, 3, 4, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 289, 0, 0, 0, 289, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 305, 0, 0, 0, 305, 0, 0, 0,
+ 0, 0, 0, 0, 421, 422, 0, 417, 418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 437, 438, 0, 433, 434, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 2, 3, 4, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 289, 0, 0, 0, 289, 0, 0, 0,
+ 0, 0, 0, 0, 257, 257, 257, 257, 0, 0, 0, 0, 0, 0, 0, 0, 1029, 1026, 1027, 0, 305, 0, 0, 0, 305, 0, 0, 0,
+ 0, 0, 0, 1610612898, 1610612914, 2684354789, 2684354789, 1610612914, 1610612930, 260, 0, 0, 0, 0, 0, 0, 1041, 1042, 1043, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1610612897, 1610612913, 1610612965, 1610612965, 1610612913, 1610612929, 276, 0, 0, 0, 0, 0, 0, 1044, 0, 1061, 0, 2248, 2249, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 274, 274, 274, 274, 0, 0, 0, 0, 0, 0, 0, 0, 1073, 1074, 1075, 0, 2264, 2265, 0, 0, 0, 463, 464, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2280, 2281, 499, 500, 0, 479, 480, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ "height":21,
+ "id":3,
+ "name":"furniture-below",
+ "opacity":1,
+ "type":"tilelayer",
+ "visible":true,
+ "width":28,
+ "x":0,
+ "y":0
+ },
+ {
+ "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 354, 0, 327, 328, 0, 0, 0, 313, 0, 0, 0, 0, 0, 0, 327, 328, 0, 0, 0, 389, 0, 0, 0, 0, 0,
+ 0, 0, 0, 370, 0, 343, 344, 0, 0, 0, 329, 330, 0, 0, 0, 0, 0, 343, 344, 0, 0, 0, 405, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 365, 366, 0, 0, 365, 366, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 293, 294, 0, 293, 294, 0, 0, 0, 0, 381, 382, 0, 0, 381, 382, 0, 0,
+ 0, 0, 0, 431, 432, 349, 0, 0, 0, 0, 0, 262, 262, 0, 262, 262, 0, 0, 0, 18, 19, 20, 0, 18, 19, 20, 0, 0,
+ 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 365, 366, 0, 0, 365, 366, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 381, 382, 0, 0, 381, 382, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 19, 20, 0, 18, 19, 20, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 421, 422, 0, 417, 418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 365, 366, 0, 0, 365, 366, 0, 0,
+ 0, 0, 0, 0, 437, 438, 0, 433, 434, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 381, 382, 0, 0, 381, 382, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 19, 20, 0, 18, 19, 20, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1610614415, 1610614431, 0, 451, 0, 0, 0, 0, 395, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1610614414, 1610614430, 0, 467, 258, 258, 258, 258, 411, 0, 0, 0, 0, 0, 0, 0, 0, 1610613812, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ "height":21,
+ "id":4,
+ "name":"furniture-above",
+ "opacity":1,
+ "type":"tilelayer",
+ "visible":true,
+ "width":28,
+ "x":0,
+ "y":0
+ },
+ {
+ "data":[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1,
+ 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1],
+ "height":21,
+ "id":5,
+ "name":"collision",
+ "opacity":1,
+ "type":"tilelayer",
+ "visible":true,
+ "width":28,
+ "x":0,
+ "y":0
+ },
+ {
+ "draworder":"topdown",
+ "id":10,
+ "name":"monitor-glow",
+ "objects":[
+ {
+ "height":6.9674867769692,
+ "id":108,
+ "name":"monitor-pc-1",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":12.059709072272,
+ "x":322.003438079071,
+ "y":75.1270793350506
+ },
+ {
+ "height":6.71338634240608,
+ "id":109,
+ "name":"monitor-pc-2",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":11.7217557282024,
+ "x":386.234683258917,
+ "y":75.2196746324589
+ },
+ {
+ "height":6.96749,
+ "id":114,
+ "name":"monitor-pc-3",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":12.0597,
+ "x":321.94560357524,
+ "y":139.081178514763
+ },
+ {
+ "height":6.96749,
+ "id":115,
+ "name":"monitor-pc-4",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":12.0597,
+ "x":385.797613536108,
+ "y":138.903305871576
+ },
+ {
+ "height":6.96749,
+ "id":116,
+ "name":"monitor-pc-5",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":12.0597,
+ "x":321.967304037709,
+ "y":203.026393740662
+ },
+ {
+ "height":6.96749,
+ "id":117,
+ "name":"monitor-pc-6",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":12.0597,
+ "x":385.912519263607,
+ "y":203.026393740662
+ }],
+ "opacity":1,
+ "type":"objectgroup",
+ "visible":true,
+ "x":0,
+ "y":0
+ },
+ {
+ "draworder":"topdown",
+ "id":6,
+ "name":"spawn-points",
+ "objects":[
+ {
+ "height":0,
+ "id":1,
+ "name":"desk-ceo",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":0,
+ "x":70.578947368421,
+ "y":89.6315789473684
+ },
+ {
+ "height":0,
+ "id":2,
+ "name":"desk-product-manager",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":0,
+ "x":327.894736842105,
+ "y":168.789473684211
+ },
+ {
+ "height":0,
+ "id":3,
+ "name":"desk-market-researcher",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":0,
+ "x":149.578947368421,
+ "y":264.842105263158
+ },
+ {
+ "height":0,
+ "id":4,
+ "name":"desk-chief-architect",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":0,
+ "x":328.22111218126,
+ "y":107.814429021949
+ },
+ {
+ "height":0,
+ "id":5,
+ "name":"desk-agent-organizer",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":0,
+ "x":279.117740826764,
+ "y":276.843465714893
+ },
+ {
+ "height":0,
+ "id":6,
+ "name":"desk-project-manager",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":0,
+ "x":74.0263157894737,
+ "y":252.052631578947
+ },
+ {
+ "height":0,
+ "id":7,
+ "name":"desk-team-lead",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":0,
+ "x":393.710526315789,
+ "y":109.289473684211
+ },
+ {
+ "height":0,
+ "id":8,
+ "name":"desk-backend-engineer",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":0,
+ "x":391.026315789474,
+ "y":171.315789473684
+ },
+ {
+ "height":0,
+ "id":11,
+ "name":"desk-ui-ux-expert",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":0,
+ "x":326.578947368421,
+ "y":233.842105263158
+ },
+ {
+ "height":0,
+ "id":12,
+ "name":"desk-data-engineer",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":0,
+ "x":392.105263157895,
+ "y":234.5
+ },
+ {
+ "height":0,
+ "id":99,
+ "name":"entrance",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":0,
+ "x":367.643758867828,
+ "y":319.272383308473
+ },
+ {
+ "height":0,
+ "id":101,
+ "name":"warroom-seat",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":0,
+ "x":150.115898303838,
+ "y":266.014202141359
+ },
+ {
+ "height":0,
+ "id":102,
+ "name":"pc-1",
+ "opacity":1,
+ "point":true,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":0,
+ "x":327.488151658768,
+ "y":106.161137440758
+ },
+ {
+ "height":0,
+ "id":103,
+ "name":"pc-2",
+ "opacity":1,
+ "point":true,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":0,
+ "x":391.469194312796,
+ "y":106.161137440758
+ },
+ {
+ "height":0,
+ "id":104,
+ "name":"pc-3",
+ "opacity":1,
+ "point":true,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":0,
+ "x":327.488151658768,
+ "y":169.668246445498
+ },
+ {
+ "height":0,
+ "id":105,
+ "name":"pc-4",
+ "opacity":1,
+ "point":true,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":0,
+ "x":391.943127962085,
+ "y":170.142180094787
+ },
+ {
+ "height":0,
+ "id":106,
+ "name":"pc-5",
+ "opacity":1,
+ "point":true,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":0,
+ "x":327.488151658768,
+ "y":233.649289099526
+ },
+ {
+ "height":0,
+ "id":107,
+ "name":"pc-6",
+ "opacity":1,
+ "point":true,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":0,
+ "x":391.943127962085,
+ "y":232.701421800948
+ }],
+ "opacity":1,
+ "type":"objectgroup",
+ "visible":true,
+ "x":0,
+ "y":0
+ },
+ {
+ "draworder":"topdown",
+ "id":7,
+ "locked":true,
+ "name":"zones",
+ "objects":[
+ {
+ "height":144,
+ "id":50,
+ "name":"ceo-room",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":112,
+ "x":16,
+ "y":32
+ },
+ {
+ "height":84.1315789473684,
+ "id":51,
+ "name":"boardroom",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":177.368421052632,
+ "x":13.7368421052632,
+ "y":237.263157894737
+ },
+ {
+ "height":196.631578947368,
+ "id":52,
+ "name":"open-work-area",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":129.710526315789,
+ "x":291,
+ "y":58
+ }],
+ "opacity":1,
+ "type":"objectgroup",
+ "visible":true,
+ "x":0,
+ "y":0
+ },
+ {
+ "draworder":"topdown",
+ "id":8,
+ "name":"interactive-objects",
+ "objects":[
+ {
+ "height":9.2643868487153,
+ "id":100,
+ "name":"artifact-vision-brief",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":8.28210993081966,
+ "x":80.8419516439106,
+ "y":99
+ },
+ {
+ "height":17.2635228848821,
+ "id":101,
+ "name":"artifact-prd",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":22.5145631067961,
+ "x":116.670045045045,
+ "y":201.637387387387
+ },
+ {
+ "height":19.1060967740663,
+ "id":102,
+ "name":"artifact-market-analysis",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":26.2623605845729,
+ "x":66.969087357346,
+ "y":201.031810625091
+ },
+ {
+ "height":26.8550848910993,
+ "id":103,
+ "name":"artifact-system-design",
+ "opacity":1,
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":21.417938604013,
+ "x":7.95180929514663,
+ "y":258.710341279369
+ }],
+ "opacity":1,
+ "type":"objectgroup",
+ "visible":false,
+ "x":0,
+ "y":0
+ },
+ {
+ "draworder":"topdown",
+ "id":8,
+ "name":"war-room-objects",
+ "objects":[
+ {
+ "height":0,
+ "id":100,
+ "name":"war-room-pc",
+ "opacity":1,
+ "polygon":[
+ {
+ "x":0,
+ "y":0
+ },
+ {
+ "x":5.31680692514101,
+ "y":4.56913095129306
+ },
+ {
+ "x":13.1258670964419,
+ "y":4.56913095129306
+ },
+ {
+ "x":13.2089422046472,
+ "y":17.8611482641456
+ },
+ {
+ "x":4.73528116770373,
+ "y":17.8611482641456
+ },
+ {
+ "x":-0.249225324615978,
+ "y":12.5443413390046
+ }],
+ "rotation":0,
+ "type":"",
+ "visible":true,
+ "width":0,
+ "x":128.018741744411,
+ "y":256.203633705233
+ }],
+ "opacity":1,
+ "type":"objectgroup",
+ "visible":false,
+ "x":0,
+ "y":0
+ }],
+ "nextlayerid":11,
+ "nextobjectid":118,
+ "orientation":"orthogonal",
+ "renderorder":"right-down",
+ "tiledversion":"1.12.0",
+ "tileheight":16,
+ "tilesets":[
+ {
+ "columns":16,
+ "firstgid":1,
+ "image":"..\/tilesets\/office-tileset.png",
+ "imageheight":512,
+ "imagewidth":256,
+ "margin":0,
+ "name":"office-tileset",
+ "spacing":0,
+ "tilecount":512,
+ "tileheight":16,
+ "tilewidth":16
+ },
+ {
+ "firstgid":513,
+ "source":"A5 Office Floors & Walls.tsx"
+ },
+ {
+ "firstgid":1025,
+ "source":"interiors.tsx"
+ }],
+ "tilewidth":16,
+ "type":"map",
+ "version":"1.10",
+ "width":28
+}
\ No newline at end of file
diff --git a/tools/mapgen/render_map.py b/tools/mapgen/render_map.py
new file mode 100644
index 00000000..8386457d
--- /dev/null
+++ b/tools/mapgen/render_map.py
@@ -0,0 +1,105 @@
+#!/usr/bin/env python3
+"""Offline rasterizer for office.tmj — mirrors TiledMapRenderer so we can
+visually verify the map without launching Electron. Usage:
+ python3 render_map.py [map.tmj] [out.png] [--labels]
+"""
+import json, sys, os
+from PIL import Image, ImageDraw, ImageFont
+
+HERE = os.path.dirname(__file__)
+ASSETS = os.path.abspath(os.path.join(HERE, '..', '..', 'src', 'renderer', 'src', 'assets'))
+
+FLIP_H = 0x80000000
+FLIP_V = 0x40000000
+FLIP_D = 0x20000000
+GID_MASK = 0x1FFFFFFF
+
+# firstgid -> (image path, columns, tilew, tileh)
+TILESETS = [
+ (1, 'tilesets/office-tileset.png', 16, 16, 16),
+ (513, 'tilesets/a5-office-floors-walls.png',16, 16, 16),
+ (1025, 'tilesets/interiors.png', 16, 16, 16),
+]
+TILE_LAYERS = ['floor', 'walls', 'furniture-below', 'furniture-above']
+SCALE = 3
+
+def load_sheets():
+ out = []
+ for firstgid, path, cols, tw, th in TILESETS:
+ img = Image.open(os.path.join(ASSETS, path)).convert('RGBA')
+ out.append((firstgid, img, cols, tw, th))
+ return out
+
+def resolve(gid, sheets):
+ for firstgid, img, cols, tw, th in reversed(sheets):
+ if gid >= firstgid:
+ local = gid - firstgid
+ sx = (local % cols) * tw
+ sy = (local // cols) * th
+ return img.crop((sx, sy, sx+tw, sy+th)), tw, th
+ return None, 16, 16
+
+def render(mappath, outpath, labels=False):
+ m = json.load(open(mappath))
+ W, H, TS = m['width'], m['height'], m['tilewidth']
+ sheets = load_sheets()
+ canvas = Image.new('RGBA', (W*TS, H*TS), (20, 18, 30, 255))
+ layers = {l['name']: l for l in m['layers']}
+ for name in TILE_LAYERS:
+ l = layers.get(name)
+ if not l or 'data' not in l:
+ continue
+ data = l['data']
+ for y in range(H):
+ for x in range(W):
+ raw = data[y*W + x]
+ if raw == 0:
+ continue
+ fh = bool(raw & FLIP_H); fv = bool(raw & FLIP_V); fd = bool(raw & FLIP_D)
+ gid = raw & GID_MASK
+ tile, tw, th = resolve(gid, sheets)
+ if tile is None:
+ continue
+ if fd:
+ tile = tile.transpose(Image.TRANSPOSE)
+ if fh:
+ tile = tile.transpose(Image.FLIP_LEFT_RIGHT)
+ if fv:
+ tile = tile.transpose(Image.FLIP_TOP_BOTTOM)
+ canvas.alpha_composite(tile, (x*TS, y*TS))
+
+ canvas = canvas.resize((W*TS*SCALE, H*TS*SCALE), Image.NEAREST)
+ draw = ImageDraw.Draw(canvas)
+
+ # collision overlay (faint red) + grid
+ col = layers.get('collision')
+ if col and 'data' in col and labels:
+ for y in range(H):
+ for x in range(W):
+ if col['data'][y*W+x] & GID_MASK:
+ draw.rectangle([x*TS*SCALE, y*TS*SCALE, (x+1)*TS*SCALE-1, (y+1)*TS*SCALE-1],
+ outline=(255,0,0,60))
+
+ if labels:
+ try:
+ font = ImageFont.truetype('/System/Library/Fonts/Supplemental/Arial.ttf', 11)
+ except Exception:
+ font = ImageFont.load_default()
+ for l in m['layers']:
+ if l['type'] != 'objectgroup':
+ continue
+ isspawn = l['name'] == 'spawn-points'
+ for o in l['objects']:
+ px = int(o['x']/TS)*TS*SCALE
+ py = int(o['y']/TS)*TS*SCALE
+ color = (0,255,180) if isspawn else (255,200,0)
+ draw.rectangle([px+2, py+2, px+TS*SCALE-2, py+TS*SCALE-2], outline=color, width=2)
+ draw.text((px+3, py+3), o.get('name','?'), fill=color, font=font)
+
+ canvas.convert('RGB').save(outpath)
+ print('wrote', outpath, canvas.size)
+
+if __name__ == '__main__':
+ mp = sys.argv[1] if len(sys.argv) > 1 else os.path.join(ASSETS, 'maps/office.tmj')
+ out = sys.argv[2] if len(sys.argv) > 2 else os.path.join(HERE, 'preview.png')
+ render(mp, out, labels='--labels' in sys.argv)