From bba68f992ff9fdac9d1939f621a8d857143755e3 Mon Sep 17 00:00:00 2001 From: Fathah KA <48355244+fathah@users.noreply.github.com> Date: Tue, 21 Jul 2026 23:29:16 +0530 Subject: [PATCH 1/3] AGent Interaction --- lat.md/lat.md | 1 + lat.md/office-3d-interiors.md | 2 +- lat.md/office-interactions.md | 4 +- lat.md/office-world-actions.md | 62 +++++++ src/renderer/src/screens/Office/Office.tsx | 81 ++++++++- .../src/screens/Office/OneChatModal.tsx | 87 ++++++--- .../screens/Office/RepInteractionPanel.tsx | 37 +++- .../office3d/interactions/missionBus.test.ts | 60 ++++++ .../office3d/interactions/missionBus.ts | 76 ++++++++ .../interactions/worldActions.test.ts | 100 ++++++++++ .../office3d/interactions/worldActions.ts | 171 ++++++++++++++++++ .../Office/office3d/objects/AgentsLayer.tsx | 139 +++++++++++++- .../src/screens/Office/office3d/trips.ts | 50 ++++- 13 files changed, 827 insertions(+), 43 deletions(-) create mode 100644 lat.md/office-world-actions.md create mode 100644 src/renderer/src/screens/Office/office3d/interactions/missionBus.test.ts create mode 100644 src/renderer/src/screens/Office/office3d/interactions/missionBus.ts create mode 100644 src/renderer/src/screens/Office/office3d/interactions/worldActions.test.ts create mode 100644 src/renderer/src/screens/Office/office3d/interactions/worldActions.ts diff --git a/lat.md/lat.md b/lat.md/lat.md index 3e103331d..8c1635da7 100644 --- a/lat.md/lat.md +++ b/lat.md/lat.md @@ -25,4 +25,5 @@ This directory defines the high-level concepts, business logic, and architecture - [[office-3d-interiors]] — enterable office/bank/showroom interiors: per-location conditional mounting (city unmounts while indoors), camera fly-in rig, interactable objects (ATM → wallet, desk → agent, car → spec card), and idle-agent walking trips between buildings. - [[office-3d-walk-mode]] — GTA-style walk mode: glass roofs over the enterable buildings, the user's own third-person avatar (WASD + chase camera, shared crowd/collision), doorway-driven interior loading, and proximity Press-E interactions. - [[office-interactions]] — space representatives: interactive bank tellers whose menu runs account status, balances, and account creation against the hermes-one backend for a chosen agent; the extensible pattern for future spaces (showroom sales, building space). +- [[office-world-actions]] — chat-commanded errands: the agent's LLM emits world-action blocks from the office chat, its avatar walks the trip route to the bank/showroom, and the rep modal auto-opens running the requested action on arrival. - [[mcp-servers]] — add / edit / remove / enable / test MCP servers from the Capabilities → MCP tab; the shared add+edit modal and the in-place atomic `updateMcpServer` upsert (config.yaml locally, gateway REST in Remote/SSH). diff --git a/lat.md/office-3d-interiors.md b/lat.md/office-3d-interiors.md index 0f865b947..520c110e3 100644 --- a/lat.md/office-3d-interiors.md +++ b/lat.md/office-3d-interiors.md @@ -64,6 +64,6 @@ Idle agents occasionally walk out of the office to the bank or showroom, wander The canvas↔world mapping ([[src/renderer/src/screens/Office/office3d/core/geometry.ts#worldToCanvas]]) is linear, so waypoints far outside the office's 0..1800 rectangle work unchanged — no second coordinate system. -The controller in [[src/renderer/src/screens/Office/office3d/objects/AgentsLayer.tsx#AgentsLayer]] adds a "trip" mode (phases out → wander → back) beside toSeat/seated. Only idle (non-working) seated agents start trips, capped at `TRIP_MAX_TRAVELLERS`; if an agent's gateway starts mid-trip it walks the route home in reverse rather than teleporting. Each agent's `place` ("office" | "bank" | "showroom" | "outside") is derived from route progress. +The controller in [[src/renderer/src/screens/Office/office3d/objects/AgentsLayer.tsx#AgentsLayer]] adds a "trip" mode (phases out → wander → back) beside toSeat/seated. Only idle (non-working) seated agents start trips, capped at `TRIP_MAX_TRAVELLERS`; if an agent's gateway starts mid-trip it walks the route home in reverse rather than teleporting. Each agent's `place` ("office" | "bank" | "showroom" | "outside") is derived from route progress. Trips can also be commanded from the office chat — a mission replaces the wander with a "visit" at a named interaction stop; see [[office-world-actions#Office World Actions#Commanded trips]]. The simulation always runs for every agent; the `visiblePlace` prop only toggles per-agent wrapper-group visibility each frame, so each interior view shows exactly the agents actually in that building and the city view shows everyone, including walkers on the street. diff --git a/lat.md/office-interactions.md b/lat.md/office-interactions.md index 48f588151..2b36e3bc8 100644 --- a/lat.md/office-interactions.md +++ b/lat.md/office-interactions.md @@ -2,7 +2,7 @@ Interactables in the Office tab's bank that agents do business with. Clicking the bank teller or the self-service ATM opens a shared action modal (balances, account status, and more) run against the hermes-one backend for the chosen agent. -The bank is the first transaction space; future spaces (car showroom sales, building space) reuse the same pieces: a registry entry, an [[src/renderer/src/screens/Office/office3d/objects/Interactable.tsx#Interactable]] hookup in the interior, and action wiring in the panel. Coming-soon actions (the ATM's withdraw/deposit) are registered with a `disabled` flag and render as muted "Soon" chips until their flows land. +The bank is the first transaction space; future spaces (car showroom sales, building space) reuse the same pieces: a registry entry, an [[src/renderer/src/screens/Office/office3d/objects/Interactable.tsx#Interactable]] hookup in the interior, and action wiring in the panel. Coming-soon actions (the ATM's withdraw/deposit) are registered with a `disabled` flag and render as muted "Soon" chips until their flows land. Beyond clicking, the panel can also be opened by an agent itself: a chat-commanded errand walks the agent to the rep and auto-opens the panel with the requested action — see [[office-world-actions]]. ## Representative Registry @@ -22,6 +22,8 @@ A centered modal shared by every representative (bank teller, ATM): a dimmed bac [[src/renderer/src/screens/Office/RepInteractionPanel.tsx#RepInteractionPanel]] takes the rep, the agent list, and an initial agent. Office passes `selectedId ?? defaultAgentId`, where `defaultAgentId` is the active profile (the `profile` prop, matched by agent id) or the first agent — so the picker opens pre-selected on the current profile instead of an empty "Choose an agent…". It renders a fixed inset-0 backdrop (dismiss on backdrop click or Escape) centering the card; the card fades/scales in on mount and its layout is self-contained inline styles (not Tailwind classes) so positioning can't break. The header identity is per-representative: a `REP_ICONS` glyph (bank landmark for the teller, card for the ATM), the rep's name, a live status line with a green dot (teller "Open · serving {agent}", ATM "Online · {agent}") and an agent-picker chip (an avatar + native `