Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

feat(society): no house turns its back on the camera, every building turns by mouse, nobody walks through a bench

rubenluetke10-beep99faf7888dd5
diff --git a/docs/agent-society/world-art-direction.md b/docs/agent-society/world-art-direction.md
index dfe9d62cfb..c48b8c66a2 100644
--- a/docs/agent-society/world-art-direction.md
+++ b/docs/agent-society/world-art-direction.md
@@ -70,12 +70,31 @@ harbor and the gardens low at 2, the solar field on the mountain's foot terrace
**Market district (a round plateau of radius 39 tiles, level 3):**
- open square, radius 13 tiles, paved; garden beds alternate around its rim;
-- the big tree in the exact centre, a ring bench around it, the long table on the south side —
- this is the `meeting` checkpoint (MASTERPLAN §2.7);
-- the house ring at radius 19 tiles, doors facing the square; the four cardinal directions stay
- open as gates; the Plugin Docks take two north-west slots, the hub's podium the two slots
- flanking the north gate — eight houses remain, three variants cycling: solar-barrel roof,
- garden roof, glass loft;
+- the Quest Board monument in the exact centre, a ring bench around it, the long table on the
+ south side — this is the `meeting` checkpoint (MASTERPLAN §2.7);
+- the house ring at radius 19 tiles; the four cardinal directions stay open as gates; the ring
+ hubs take their slots (`RING_KIT_SLOTS`), the hub's podium the two slots flanking the north
+ gate — the remaining slots hold houses, three variants cycling: solar-barrel roof, garden
+ roof, glass loft;
+- **which way a house faces** (`houseDefaultRotation`, maintainer 2026-09-02): the door faces
+ the square — unless that turns the house's back on the camera, which looks from the south-east
+ (`CAMERA_FROM`); then the door faces the ring road instead. A door the viewer never sees is a
+ house with its back turned. The houses stand in the south-east half of the ring (the hubs took
+ the north and west), so nearly all of them face the road; a house on the far side would keep
+ its door on the square;
+- **the viewer may turn any house or ring hub** (`buildingPoses.ts`, `RotateHandle.tsx`): click a
+ house (or open a hub's drawer) and a knob appears on the front of its selection ring; drag the
+ knob around the building and it follows, Shift snaps to 15° steps, and close to the designed
+ heading it snaps back. The badge beside the knob shows the heading and, once turned, a Reset;
+ the HUD offers "reset all". Headings are per viewer (localStorage), never synced, and go
+ straight into the island model (`applyBuildingYaws`): the blocked tiles, a hub's stand tile
+ and facing all move with the building, and walkers mid-route re-plan;
+- **nothing walks through furniture:** houses and hubs block their footprints plus a 0.5 m wall
+ margin; the monument's plinth and ring bench block 6 m around the centre and the long table
+ its rectangle; the hub's wings, colonnade, planters, pool and flag masts, the harbor kiosk and
+ gate pillars, the keeper's hut, every lamp post and every hedge segment block their tiles
+ (`blockSquareFurniture`, `blockLandmarkFurniture`, `buildIsland`). A figure that finds a
+ building turned over its head steps to the nearest free tile first (`nearestWalkable`);
- the **hub** (lead agent) at the head of the square, north, on a **podium one level up**
(18 × 10 tiles): a 24 × 12 m hall with a glass band and garden roofs, a set-back upper floor,
the glass atrium under the dome, the beacon spire with its halo, two solar-roofed wings, a
diff --git a/jarvis/ui/web/frontend/src/components/society/data.ts b/jarvis/ui/web/frontend/src/components/society/data.ts
index 92f2dcda03..d7e146ee7a 100644
--- a/jarvis/ui/web/frontend/src/components/society/data.ts
+++ b/jarvis/ui/web/frontend/src/components/society/data.ts
@@ -25,7 +25,16 @@ import { announceSpawn } from "./world/spawnStore";
export type AgentTier = "lead" | "orchestrator" | "specialist";
/** Semantic place in the world (§2.7) — the backend owns this, never pixels. */
-export type AgentCheckpoint = "desk" | "meeting" | "archive" | "gate" | "idle";
+export type AgentCheckpoint =
+ | "desk"
+ | "meeting"
+ | "archive"
+ | "gate"
+ | "idle"
+ | "hub:plugins"
+ | "hub:skills"
+ | "hub:mcp"
+ | "hub:cli";
/** Coarse run state for rows and badges; the event log holds the detail. */
export type AgentRunState = "idle" | "working" | "waiting" | "paused";
diff --git a/jarvis/ui/web/frontend/src/components/society/world/AgentFoundry.tsx b/jarvis/ui/web/frontend/src/components/society/world/AgentFoundry.tsx
index 3c8997f4c1..6d05fef9d7 100644
--- a/jarvis/ui/web/frontend/src/components/society/world/AgentFoundry.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/world/AgentFoundry.tsx
@@ -25,7 +25,8 @@ import {
Object3D,
} from "three";
-import { buildIsland, groundY, type KitPlace } from "./islandLayout";
+import { useBuildingYaw } from "./buildingPoses";
+import { buildIsland, groundY, kitId, type KitPlace } from "./islandLayout";
import { KitBuilding } from "./KitBuilding";
import { PORTAL_FLARE_MS, useSpawnStore } from "./spawnStore";
@@ -180,7 +181,9 @@ export function AgentFoundry({
selected?: boolean;
}) {
const { map, content } = buildIsland();
- const { x, z, rotation } = content.kitPoses.foundry;
+ const { x, z } = content.kitPoses.foundry;
+ // The portal effects turn with the hall when the viewer turns it.
+ const rotation = useBuildingYaw(kitId("foundry"));
const y = groundY(map, x, z);
const spinners = useRef<Array<{ obj: Object3D; rate: number }>>([]);
const orb = useRef<Object3D | null>(null);
diff --git a/jarvis/ui/web/frontend/src/components/society/world/KitBuilding.tsx b/jarvis/ui/web/frontend/src/components/society/world/KitBuilding.tsx
index a1d4746215..ebd313588f 100644
--- a/jarvis/ui/web/frontend/src/components/society/world/KitBuilding.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/world/KitBuilding.tsx
@@ -18,8 +18,10 @@ import pluginDocksUrl from "@/assets/society/world/kit/plugin-docks.glb";
import relayTowerUrl from "@/assets/society/world/kit/relay-tower.glb";
import skillForgeUrl from "@/assets/society/world/kit/skill-forge.glb";
import terminalCantinaUrl from "@/assets/society/world/kit/terminal-cantina.glb";
+import { useBuildingPoses, useBuildingYaw } from "./buildingPoses";
import { useCameraStore } from "./cameraStore";
-import { buildIsland, groundY, type KitPlace } from "./islandLayout";
+import { buildIsland, groundY, kitId, type KitPlace } from "./islandLayout";
+import { RotateHandle } from "./RotateHandle";
import { createToonRamp } from "./worldMaterials";
/** Every kit file the registry knows. Adding a building = adding a row. */
@@ -121,13 +123,15 @@ export function KitBuilding({
}, [hover, gl, onClick]);
const { map, content } = buildIsland();
- const { x, z, rotation } = content.kitPoses[place];
+ const { x, z } = content.kitPoses[place];
+ // The heading: the designed one unless the viewer turned the building.
+ const rotation = useBuildingYaw(kitId(place));
const y = groundY(map, x, z);
const click = (e: ThreeEvent<MouseEvent>) => {
if (!onClick) return;
e.stopPropagation();
- if (useCameraStore.getState().dragging) return;
+ if (useCameraStore.getState().dragging || useBuildingPoses.getState().rotating) return;
onClick(place);
};
@@ -149,6 +153,7 @@ export function KitBuilding({
<meshBasicMaterial color={selected ? "#ffd166" : "#fffaf0"} transparent opacity={0.85} />
</mesh>
)}
+ {selected && <RotateHandle id={kitId(place)} x={x} y={y} z={z} radius={KIT_RING_R[kit]} />}
</group>
);
}
diff --git a/jarvis/ui/web/frontend/src/components/society/world/RotateHandle.tsx b/jarvis/ui/web/frontend/src/components/society/world/RotateHandle.tsx
new file mode 100644
index 0000000000..f6c18cceea
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/society/world/RotateHandle.tsx
@@ -0,0 +1,152 @@
+/**
+ * The handle that turns a building: a knob on the front of its selection
+ * ring, an arrow on the ground that marks the door side, and a badge with
+ * the heading and the way back to the designed one.
+ *
+ * Drag the knob around the building and the building follows the pointer —
+ * the heading is the ground point under the pointer seen from the building's
+ * centre. Shift snaps to 15° steps; close to the designed heading it snaps
+ * back to that. The drag never reaches the stage's own pointer handlers
+ * (`useWorldControls`), so the camera holds still, and it never bubbles to the
+ * building, so no drawer opens from a turn.
+ *
+ * Rendered INSIDE the building's rotated group: local +z is the front, so the
+ * knob sits at [0, ·, radius] and turns with the building for free.
+ */
+import { useEffect, useRef, useState } from "react";
+import { Html } from "@react-three/drei";
+import { useThree, type ThreeEvent } from "@react-three/fiber";
+import { RotateCcw } from "lucide-react";
+import type { Ray } from "three";
+
+import { useT } from "@/i18n";
+import { useBuildingPoses, useBuildingYaw, useIsTurned } from "./buildingPoses";
+import type { BuildingId } from "./islandLayout";
+
+const KNOB = "#ffd166";
+const KNOB_HOT = "#ffe9a8";
+
+/** Where a world-space ray meets the horizontal plane at height `y`; null when it never does. */
+export function groundPoint(ray: Ray, y: number): [number, number] | null {
+ const t = (y - ray.origin.y) / ray.direction.y;
+ if (!Number.isFinite(t) || t < 0) return null;
+ return [ray.origin.x + ray.direction.x * t, ray.origin.z + ray.direction.z * t];
+}
+
+export function RotateHandle({
+ id,
+ x,
+ y,
+ z,
+ radius,
+}: {
+ id: BuildingId;
+ /** The building's centre and ground height, world metres. */
+ x: number;
+ y: number;
+ z: number;
+ /** Radius of the selection ring the knob sits on. */
+ radius: number;
+}) {
+ const t = useT();
+ const gl = useThree((s) => s.gl);
+ const yaw = useBuildingYaw(id);
+ const turned = useIsTurned(id);
+ const [hover, setHover] = useState(false);
+ const dragging = useRef(false);
+
+ useEffect(() => {
+ if (!hover && !dragging.current) return;
+ gl.domElement.style.cursor = dragging.current ? "grabbing" : "grab";
+ return () => {
+ gl.domElement.style.cursor = "";
+ };
+ }, [hover, gl]);
+
+ const onPointerDown = (e: ThreeEvent<PointerEvent>) => {
+ if (e.button !== 0) return;
+ e.stopPropagation();
+ e.nativeEvent.stopPropagation(); // the stage must not start a pan
+ (e.target as Element).setPointerCapture(e.pointerId);
+ dragging.current = true;
+ gl.domElement.style.cursor = "grabbing";
+ useBuildingPoses.getState().setRotating(true);
+ };
+
+ const onPointerMove = (e: ThreeEvent<PointerEvent>) => {
+ if (!dragging.current) return;
+ e.stopPropagation();
+ e.nativeEvent.stopPropagation();
+ const p = groundPoint(e.ray, y);
+ if (!p) return;
+ useBuildingPoses.getState().setYaw(id, Math.atan2(p[0] - x, p[1] - z), e.shiftKey);
+ };
+
+ const onPointerUp = (e: ThreeEvent<PointerEvent>) => {
+ if (!dragging.current) return;
+ dragging.current = false;
+ e.stopPropagation();
+ e.nativeEvent.stopPropagation();
+ (e.target as Element).releasePointerCapture(e.pointerId);
+ gl.domElement.style.cursor = hover ? "grab" : "";
+ // Let the click that ends the drag pass first, then re-enable figure clicks.
+ window.setTimeout(() => useBuildingPoses.getState().setRotating(false), 0);
+ };
+
+ const degrees = Math.round((((yaw * 180) / Math.PI) % 360) + 360) % 360;
+
+ return (
+ <group>
+ {/* the door-side arrow on the ground, inside the ring */}
+ <mesh position={[0, 0.1, radius - 1.3]} rotation={[Math.PI / 2, 0, 0]}>
+ <coneGeometry args={[0.55, 1.4, 3]} />
+ <meshBasicMaterial color={KNOB} transparent opacity={0.9} />
+ </mesh>
+ {/* the stem from the ring up to the knob */}
+ <mesh position={[0, 0.45, radius + 0.3]}>
+ <cylinderGeometry args={[0.08, 0.08, 0.9, 6]} />
+ <meshBasicMaterial color={KNOB} />
+ </mesh>
+ <mesh
+ position={[0, 1.0, radius + 0.3]}
+ onPointerDown={onPointerDown}
+ onPointerMove={onPointerMove}
+ onPointerUp={onPointerUp}
+ onPointerCancel={onPointerUp}
+ onClick={(e) => e.stopPropagation()}
+ onPointerOver={(e) => {
+ e.stopPropagation();
+ setHover(true);
+ }}
+ onPointerOut={() => setHover(false)}
+ >
+ <sphereGeometry args={[0.55, 14, 10]} />
+ <meshBasicMaterial color={hover || dragging.current ? KNOB_HOT : KNOB} />
+ </mesh>
+ <Html position={[0, 1.0, radius + 2.6]} center zIndexRange={[40, 20]}>
+ <div
+ className="sw-rotate"
+ data-turned={turned || undefined}
+ onPointerDown={(e) => e.nativeEvent.stopPropagation()}
+ onClick={(e) => e.nativeEvent.stopPropagation()}
+ >
+ <span className="sw-rotate-deg" title={t("society.world.rotate_hint")}>
+ {degrees}°
+ </span>
+ {turned && (
+ <button
+ type="button"
+ className="sw-rotate-reset"
+ onClick={() => useBuildingPoses.getState().resetYaw(id)}
+ title={t("society.world.rotate_reset")}
+ aria-label={t("society.world.rotate_reset")}
+ >
+ <RotateCcw size={12} />
+ <span>{t("society.world.rotate_reset_short")}</span>
+ </button>
+ )}
+ </div>
+ </Html>
+ </group>
+ );
+}
diff --git a/jarvis/ui/web/frontend/src/components/society/world/Village.tsx b/jarvis/ui/web/frontend/src/components/society/world/Village.tsx
index 2565c67569..cab379b806 100644
--- a/jarvis/ui/web/frontend/src/components/society/world/Village.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/world/Village.tsx
@@ -7,25 +7,82 @@
* building language (docs/agent-society/world-art-direction.md §4): white
* walls, glass, solar barrels, garden roofs, wood accents, rounded shapes.
*/
-import { useMemo, useRef } from "react";
-import { useFrame } from "@react-three/fiber";
+import { useEffect, useMemo, useRef, useState } from "react";
+import { useFrame, useThree, type ThreeEvent } from "@react-three/fiber";
import { Color, InstancedMesh, Mesh, Object3D, Vector3 } from "three";
-import { LEVEL_Y, PLATEAU_LEVEL, buildIsland, groundY, type HousePlot, type Post } from "./islandLayout";
+import { useBuildingPoses, useBuildingYaw } from "./buildingPoses";
+import { useCameraStore } from "./cameraStore";
+import {
+ HEDGE_SEGMENT_M,
+ LEVEL_Y,
+ PLATEAU_LEVEL,
+ buildIsland,
+ groundY,
+ houseId,
+ type HousePlot,
+ type Post,
+} from "./islandLayout";
import { QuestMonument } from "./QuestMonument";
+import { RotateHandle } from "./RotateHandle";
import { Block, useKit, type Kit } from "./WorldKit";
import { PAL } from "./worldMaterials";
-/** One house. Local +z is the front (door side); the plot rotation points it at the square. */
+/** Radius of the hover/selection ring under a house, in metres. */
+const HOUSE_RING_R = 4.6;
+
+/**
+ * One house. Local +z is the front (door side); the heading comes from the
+ * pose store — the designed one (toward the square, or toward the road when
+ * the square side is the camera's blind side) unless the viewer turned it.
+ * A click selects the house and shows its rotate handle.
+ */
function House({ kit, plot }: { kit: Kit; plot: HousePlot }) {
const { map } = buildIsland();
+ const id = houseId(plot.slot);
+ const rotation = useBuildingYaw(id);
+ const selected = useBuildingPoses((s) => s.selected === id);
+ const gl = useThree((s) => s.gl);
+ const [hover, setHover] = useState(false);
const y = groundY(map, plot.x, plot.z);
const w = plot.w * 2; // footprint in metres
const d = plot.d * 2;
const h = plot.variant === "glass-loft" ? 3.0 : 3.4;
const shade = plot.seed > 0.5 ? PAL.wall : PAL.wallShade;
+
+ useEffect(() => {
+ if (!hover) return;
+ gl.domElement.style.cursor = "pointer";
+ return () => {
+ gl.domElement.style.cursor = "";
+ };
+ }, [hover, gl]);
+
+ const click = (e: ThreeEvent<MouseEvent>) => {
+ e.stopPropagation();
+ const poses = useBuildingPoses.getState();
+ if (useCameraStore.getState().dragging || poses.rotating) return;
+ poses.select(selected ? null : id);
+ };
+
return (
- <group position={[plot.x, y, plot.z]} rotation={[0, plot.rotation, 0]}>
+ <group
+ position={[plot.x, y, plot.z]}
+ rotation={[0, rotation, 0]}
+ onClick={click}
+ onPointerOver={(e) => {
+ e.stopPropagation();
+ setHover(true);
+ }}
+ onPointerOut={() => setHover(false)}
+ >
+ {(hover || selected) && (
+ <mesh position={[0, 0.06, 0]} rotation={[-Math.PI / 2, 0, 0]}>
+ <ringGeometry args={[HOUSE_RING_R - 0.25, HOUSE_RING_R + 0.25, 40]} />
+ <meshBasicMaterial color={selected ? "#ffd166" : "#fffaf0"} transparent opacity={0.85} />
+ </mesh>
+ )}
+ {selected && <RotateHandle id={id} x={plot.x} y={y} z={plot.z} radius={HOUSE_RING_R} />}
{/* body */}
<Block kit={kit} at={[0, h / 2, 0]} size={[w, h, d]} color={shade} />
{/* plinth */}
@@ -220,7 +277,7 @@ function Hedges({ kit, posts }: { kit: Kit; posts: Post[] }) {
posts.forEach((p, i) => {
dummy.position.set(p.x, p.y + 0.55, p.z);
dummy.rotation.set(0, p.rotation, 0);
- dummy.scale.set(2.3, 1.1, 0.8);
+ dummy.scale.set(HEDGE_SEGMENT_M[0], 1.1, HEDGE_SEGMENT_M[1]);
dummy.updateMatrix();
mesh.setMatrixAt(i, dummy.matrix);
mesh.setColorAt(i, i % 3 === 0 ? colorB : colorA);
@@ -358,8 +415,8 @@ export function Village({
const { content } = buildIsland();
return (
<group>
- {content.houses.map((plot, i) => (
- <House key={i} kit={kit} plot={plot} />
+ {content.houses.map((plot) => (
+ <House key={plot.slot} kit={kit} plot={plot} />
))}
<Hub kit={kit} paused={paused} />
<SquareCentre kit={kit} paused={paused} onQuestClick={onQuestClick} questOpen={questOpen} />
diff --git a/jarvis/ui/web/frontend/src/components/society/world/Walkers.tsx b/jarvis/ui/web/frontend/src/components/society/world/Walkers.tsx
index 5a92739588..fc758863b7 100644
--- a/jarvis/ui/web/frontend/src/components/society/world/Walkers.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/world/Walkers.tsx
@@ -13,6 +13,7 @@ import { useFrame, useThree, type ThreeEvent } from "@react-three/fiber";
import type { Group } from "three";
import type { AgentCheckpoint, AgentRunState, SocietyAgent } from "../data";
+import { useBuildingPoses } from "./buildingPoses";
import { useCameraStore } from "./cameraStore";
import {
FOUNDRY_BELT_LIFT_M,
@@ -20,6 +21,8 @@ import {
findPath,
foundryWalkOut,
groundY,
+ isWalkable,
+ nearestWalkable,
randomPlazaTile,
smoothPath,
tileToWorld,
@@ -48,6 +51,10 @@ export const CHECKPOINT_PLACE: Record<AgentCheckpoint, PlaceId | null> = {
archive: "archive",
gate: "harbor",
idle: null,
+ "hub:plugins": "plugins",
+ "hub:skills": "skills",
+ "hub:mcp": "mcp",
+ "hub:cli": "cli",
};
interface Sim {
@@ -79,10 +86,13 @@ function stateMode(state: AgentRunState, atPurpose: boolean): WalkerMode {
function pathTo(sim: Sim, target: [number, number]): boolean {
const { map } = buildIsland();
- const from = worldToTile(sim.x, sim.z);
+ let from = worldToTile(sim.x, sim.z);
+ // Caught inside a building the viewer just turned over it: step out first.
+ const escape = isWalkable(map, from[0], from[1]) ? null : nearestWalkable(map, from[0], from[1]);
+ if (escape) from = escape;
const raw = findPath(map, from, target);
if (!raw) return false;
- const smooth = smoothPath(map, raw).slice(1);
+ const smooth = smoothPath(map, raw).slice(escape ? 0 : 1);
sim.waypoints = smooth.map(([tx, tz]) => tileToWorld(tx, tz));
if (sim.waypoints.length === 0) return false;
sim.index = 0;
@@ -90,6 +100,33 @@ function pathTo(sim: Sim, target: [number, number]): boolean {
return true;
}
+/**
+ * A building was turned: a route may now cross it, a stand tile may have
+ * moved, a figure may even stand inside it. Re-plan from where the figure is.
+ */
+function replanAfterTurn(sim: Sim, state: AgentRunState): void {
+ if (sim.exiting) return;
+ const { map, content } = buildIsland();
+ const here = worldToTile(sim.x, sim.z);
+ const inside = !isWalkable(map, here[0], here[1]);
+ if (sim.mode === "walk") {
+ const end = sim.waypoints[sim.waypoints.length - 1];
+ if (end && pathTo(sim, worldToTile(end[0], end[1]))) return;
+ } else if (sim.purpose && sim.atPurpose) {
+ const stand = content.places[sim.purpose].standTile;
+ if (!inside && stand[0] === here[0] && stand[1] === here[1]) return;
+ sim.atPurpose = false;
+ sim.speed = NOMINAL_WALK_MPS;
+ if (pathTo(sim, stand)) return;
+ } else if (!inside) {
+ return;
+ } else if (pathTo(sim, randomPlazaTile(map, sim.rng))) {
+ return;
+ }
+ sim.mode = stateMode(state, sim.atPurpose);
+ sim.timer = 1;
+}
+
function Walker({
agent,
paused,
@@ -106,6 +143,8 @@ function Walker({
const gl = useThree((s) => s.gl);
const [hover, setHover] = useState(false);
const offset = useMemo(() => lateralOffset(agent.agentId), [agent.agentId]);
+ /** The building-pose generation this walker last planned against. */
+ const poseGen = useRef(useBuildingPoses.getState().generation);
const sim = useRef<Sim | null>(null);
if (sim.current === null) {
@@ -193,6 +232,11 @@ function Walker({
const step = Math.min(dt, 0.1);
if (!paused) {
+ const gen = useBuildingPoses.getState().generation;
+ if (gen !== poseGen.current) {
+ poseGen.current = gen;
+ replanAfterTurn(s, agent.state);
+ }
if (s.mode === "walk") {
const r = stepAlong(s.x, s.z, s.waypoints, s.index, s.speed, step);
s.x = r.x;
@@ -267,7 +311,7 @@ function Walker({
const onClick = (e: ThreeEvent<MouseEvent>) => {
e.stopPropagation();
- if (useCameraStore.getState().dragging) return;
+ if (useCameraStore.getState().dragging || useBuildingPoses.getState().rotating) return;
onSelect(agent.agentId);
};
diff --git a/jarvis/ui/web/frontend/src/components/society/world/WorldHud.tsx b/jarvis/ui/web/frontend/src/components/society/world/WorldHud.tsx
index 4ce3c9c02d..f5205caf6a 100644
--- a/jarvis/ui/web/frontend/src/components/society/world/WorldHud.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/world/WorldHud.tsx
@@ -5,10 +5,11 @@
* buttons and the minimap (bottom-right).
*/
import type { ReactNode } from "react";
-import { Minus, Plus, ScrollText } from "lucide-react";
+import { Minus, Plus, RotateCcw, ScrollText } from "lucide-react";
import { fill, useT } from "@/i18n";
import type { SocietyAgent } from "../data";
+import { useBuildingPoses, useTurnedCount } from "./buildingPoses";
import { useCameraStore } from "./cameraStore";
import { Minimap } from "./Minimap";
import { ZOOM_WIDTHS_M } from "./worldCamera";
@@ -38,6 +39,8 @@ export function WorldHud({
const t = useT();
const zoom = useCameraStore((s) => s.zoom);
const zoomStep = useCameraStore((s) => s.zoomStep);
+ const turned = useTurnedCount();
+ const resetAll = useBuildingPoses((s) => s.resetAll);
const active = agents.filter((a) => a.state === "working").length;
// The main locale file may override these keys with the `{0}` placeholder
// convention the society rail uses; accept both spellings.
@@ -75,7 +78,20 @@ export function WorldHud({
{topRight ? <div className="sw-hud-topright">{topRight}</div> : null}
</div>
<div className="sw-hud-bottom">
- <div className="sw-hint">{t("society.world.controls_hint")}</div>
+ <div className="sw-hint-row">
+ <div className="sw-hint">{t("society.world.controls_hint")}</div>
+ {turned > 0 && (
+ <button
+ type="button"
+ className="sw-hint sw-hint-btn"
+ onClick={resetAll}
+ title={t("society.world.rotate_reset_all")}
+ >
+ <RotateCcw size={12} aria-hidden />
+ {count("society.world.rotate_reset_all_count", turned)}
+ </button>
+ )}
+ </div>
<div className="sw-corner">
<div className="sw-zoom" role="group" aria-label={t("society.world.zoom_label")}>
<button
diff --git a/jarvis/ui/web/frontend/src/components/society/world/WorldStage.tsx b/jarvis/ui/web/frontend/src/components/society/world/WorldStage.tsx
index f142a8e2eb..7de27debad 100644
--- a/jarvis/ui/web/frontend/src/components/society/world/WorldStage.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/world/WorldStage.tsx
@@ -18,7 +18,7 @@ import "@fontsource/pixelify-sans/500.css";
import "@fontsource/pixelify-sans/600.css";
import "./world.css";
-import { useCallback, useRef, useState, type ReactNode } from "react";
+import { useCallback, useEffect, useRef, useState, type ReactNode } from "react";
import { Canvas } from "@react-three/fiber";
import { useReducedMotion } from "framer-motion";
@@ -27,6 +27,7 @@ import { useCanvasAwake } from "@/hooks/useCanvasAwake";
import { useWebglSurface } from "@/hooks/useWebglSurface";
import { useWebglSupported } from "@/lib/graphDimension";
import { useSocietyRoster } from "../data";
+import { syncBuildingPoses, useBuildingPoses } from "./buildingPoses";
import { useCameraStore } from "./cameraStore";
import { Clouds } from "./Clouds";
import { FoundryDrawer } from "./FoundryDrawer";
@@ -48,11 +49,12 @@ import { WorldCameraRig } from "./WorldCameraRig";
import { WorldComposer } from "./WorldComposer";
import { WorldHud } from "./WorldHud";
import { WorldKitProvider } from "./WorldKit";
-import { RING_KIT_SLOTS, type KitPlace, type PlaceId } from "./islandLayout";
+import { isKitPlace, type KitPlace, type PlaceId } from "./islandLayout";
-/** Only ring hubs open a drawer; other places are scenery. */
+/** Only kit hubs open a drawer; other places are scenery. */
function asHub(place: PlaceId): KitPlace | null {
- return place in RING_KIT_SLOTS ? (place as KitPlace) : null;
+ // Not "is it in the house ring" — the foundry crowns the mountain instead.
+ return isKitPlace(place) ? place : null;
}
import { cameraOffset } from "./worldCamera";
import { SKY } from "./worldPalette";
@@ -90,6 +92,8 @@ export function WorldStage({ topRight, onOpenLedger, onSelectAgent }: WorldStage
const [memoryOpen, setMemoryOpen] = useState(false);
useWorldControls(hostRef, webgl);
+ // The viewer's turned buildings go into the island before the first frame.
+ useEffect(syncBuildingPoses, []);
const select = useCallback(
(agentId: string | null) => {
@@ -141,7 +145,10 @@ export function WorldStage({ topRight, onOpenLedger, onSelectAgent }: WorldStage
gl={{ antialias: grain === 0, alpha: false, powerPreference: "high-performance", stencil: false }}
frameloop={frameloop}
onPointerMissed={() => {
- if (!useCameraStore.getState().dragging) select(null);
+ const poses = useBuildingPoses.getState();
+ if (useCameraStore.getState().dragging || poses.rotating) return;
+ select(null);
+ poses.select(null);
}}
>
<color attach="background" args={[SKY.clear]} />
@@ -212,7 +219,7 @@ export function WorldStage({ topRight, onOpenLedger, onSelectAgent }: WorldStage
<FoundryDrawer onClose={() => setOpenHub(null)} onSelectAgent={select} />
)}
{ready && memoryOpen && <MemoryDrawer onClose={() => setMemoryOpen(false)} />}
- {ready && questOpen && <QuestBoardDrawer onClose={() => setQuestOpen(false)} />}
+ {ready && questOpen && <QuestBoardDrawer onClose={() => setQuestOpen(false)} onOpenAgent={select} />}
</div>
);
}
diff --git a/jarvis/ui/web/frontend/src/components/society/world/buildingPoses.test.ts b/jarvis/ui/web/frontend/src/components/society/world/buildingPoses.test.ts
new file mode 100644
index 0000000000..744f601dc6
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/society/world/buildingPoses.test.ts
@@ -0,0 +1,93 @@
+import { beforeEach, describe, expect, it } from "vitest";
+
+import {
+ SNAP_STEP_RAD,
+ normalizeOverrides,
+ settleYaw,
+ syncBuildingPoses,
+ useBuildingPoses,
+} from "./buildingPoses";
+import {
+ buildIsland,
+ defaultBuildingYaw,
+ houseId,
+ isWalkable,
+ kitId,
+ resetIslandCache,
+ worldToTile,
+} from "./islandLayout";
+
+const KEY = "jarvis.world.poses.v1";
+
+describe("buildingPoses", () => {
+ beforeEach(() => {
+ localStorage.removeItem(KEY);
+ resetIslandCache();
+ useBuildingPoses.getState().resetAll();
+ useBuildingPoses.setState({ selected: null, rotating: false });
+ });
+
+ it("keeps only well-formed overrides from storage", () => {
+ expect(normalizeOverrides(null)).toEqual({});
+ expect(normalizeOverrides({ "house:5": 1.2, "kit:cli": -0.4, "tree:3": 1, "house:x": 1, "kit:mcp": "no" })).toEqual({
+ "house:5": 1.2,
+ "kit:cli": -0.4,
+ });
+ // Angles come back wrapped into (−π, π].
+ expect(normalizeOverrides({ "house:6": 4 })["house:6"]).toBeCloseTo(4 - 2 * Math.PI, 9);
+ });
+
+ it("snaps a drag to the designed heading when close, and to 15° steps with Shift", () => {
+ const id = houseId(6);
+ const rest = defaultBuildingYaw(id);
+ expect(settleYaw(id, rest + 0.03, false)).toBe(rest);
+ expect(settleYaw(id, rest + 0.5, false)).toBeCloseTo(rest + 0.5, 9);
+ const stepped = settleYaw(id, 0.3, true);
+ expect(stepped / SNAP_STEP_RAD).toBeCloseTo(Math.round(stepped / SNAP_STEP_RAD), 9);
+ });
+
+ it("turns a house in the island itself, so walkers route around where it now stands", () => {
+ const island = buildIsland();
+ const house = island.content.houses[0];
+ const id = houseId(house.slot);
+ const rest = house.rotation;
+ // Turn the house a quarter round: its long side now points where its short side did.
+ const before = island.map.blocked.slice();
+ const store = useBuildingPoses.getState();
+ store.setYaw(id, rest + Math.PI / 2);
+ expect(house.rotation).toBeCloseTo(rest + Math.PI / 2, 6);
+ // The footprint moved with it: the blocked layer changed, the centre stays covered.
+ expect(island.map.blocked).not.toEqual(before);
+ expect(isWalkable(island.map, ...worldToTile(house.x, house.z))).toBe(false);
+ expect(useBuildingPoses.getState().generation).toBeGreaterThan(0);
+ // Reset restores the designed heading and the exact footprint.
+ useBuildingPoses.getState().resetYaw(id);
+ expect(house.rotation).toBe(rest);
+ expect(island.map.blocked).toEqual(before);
+ expect(useBuildingPoses.getState().yaw).toEqual({});
+ });
+
+ it("moves a ring hub's stand tile with the hub and keeps it walkable", () => {
+ const island = buildIsland();
+ const before = [...island.content.places.cli.standTile] as [number, number];
+ useBuildingPoses.getState().setYaw(kitId("cli"), defaultBuildingYaw(kitId("cli")) + Math.PI);
+ const after = island.content.places.cli.standTile;
+ expect(after).not.toEqual(before);
+ expect(isWalkable(island.map, after[0], after[1])).toBe(true);
+ expect(island.content.places.cli.facing).toBeCloseTo(defaultBuildingYaw(kitId("cli")), 6);
+ useBuildingPoses.getState().resetAll();
+ expect(island.content.places.cli.standTile).toEqual(before);
+ });
+
+ it("persists per viewer and comes back through sync", () => {
+ const id = houseId(7);
+ useBuildingPoses.getState().setYaw(id, 1.0);
+ expect(JSON.parse(localStorage.getItem(KEY) ?? "{}")).toEqual({ yaw: { [id]: 1.0 } });
+ resetIslandCache();
+ const fresh = buildIsland();
+ const house = fresh.content.houses.find((h) => h.slot === 7)!;
+ expect(house.rotation).toBe(house.defaultRotation);
+ syncBuildingPoses();
+ expect(house.rotation).toBeCloseTo(1.0, 9);
+ });
+});
diff --git a/jarvis/ui/web/frontend/src/components/society/world/buildingPoses.ts b/jarvis/ui/web/frontend/src/components/society/world/buildingPoses.ts
new file mode 100644
index 0000000000..b99f878818
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/society/world/buildingPoses.ts
@@ -0,0 +1,146 @@
+/**
+ * The headings a viewer has given the island's buildings — the one store the
+ * rotate handle writes and every turned building reads.
+ *
+ * A building rests at the heading `islandLayout.ts` designs for it; dragging
+ * its handle overrides that heading here, "reset" removes the override. Every
+ * change is pushed straight into the built island (`applyBuildingYaws`), so
+ * the walkers route around the building where it now stands, and persisted
+ * per viewer in localStorage: cosmetic, local, never synced (MASTERPLAN §2.7 —
+ * pixels are the client's business).
+ */
+import { create } from "zustand";
+
+import {
+ applyBuildingYaws,
+ buildIsland,
+ defaultBuildingYaw,
+ normalizeAngle,
+ type BuildingId,
+} from "./islandLayout";
+
+const KEY = "jarvis.world.poses.v1";
+
+/** Overrides closer than this to the default snap back to it (about 4°). */
+export const SNAP_TO_DEFAULT_RAD = 0.07;
+/** Step the handle snaps to while Shift is held. */
+export const SNAP_STEP_RAD = Math.PI / 12;
+
+export type YawOverrides = Partial<Record<BuildingId, number>>;
+
+export interface BuildingPoseState {
+ /** Heading per building the viewer has turned; absent = the designed heading. */
+ yaw: YawOverrides;
+ /** Bumped on every change — a walker mid-route re-plans when it sees a new value. */
+ generation: number;
+ /** The building whose handle is showing (a house; ring hubs show theirs while their drawer is open). */
+ selected: BuildingId | null;
+ /** True while a handle is being dragged — figure clicks and camera drags stand down. */
+ rotating: boolean;
+ setYaw: (id: BuildingId, yaw: number, snapStep?: boolean) => void;
+ resetYaw: (id: BuildingId) => void;
+ resetAll: () => void;
+ select: (id: BuildingId | null) => void;
+ setRotating: (rotating: boolean) => void;
+}
+
+function read(): YawOverrides {
+ try {
+ const raw = localStorage.getItem(KEY);
+ if (!raw) return {};
+ const parsed = JSON.parse(raw) as { yaw?: unknown };
+ return normalizeOverrides(parsed?.yaw);
+ } catch {
+ return {};
+ }
+}
+
+function write(yaw: YawOverrides): void {
+ try {
+ localStorage.setItem(KEY, JSON.stringify({ yaw }));
+ } catch {
+ /* not persisted, still applied */
+ }
+}
+
+/** Keep only well-formed entries: a known id shape and a finite angle. */
+export function normalizeOverrides(v: unknown): YawOverrides {
+ if (!v || typeof v !== "object") return {};
+ const out: YawOverrides = {};
+ for (const [k, val] of Object.entries(v as Record<string, unknown>)) {
+ if (!/^(house:\d{1,2}|kit:[a-z]+)$/.test(k)) continue;
+ if (typeof val !== "number" || !Number.isFinite(val)) continue;
+ out[k as BuildingId] = normalizeAngle(val);
+ }
+ return out;
+}
+
+/**
+ * The heading a drag lands on: snapped to the designed heading when close,
+ * to 15° steps while Shift is held, free otherwise.
+ */
+export function settleYaw(id: BuildingId, raw: number, snapStep: boolean): number {
+ const fallback = defaultBuildingYaw(id);
+ let yaw = normalizeAngle(raw);
+ if (snapStep) yaw = normalizeAngle(Math.round(yaw / SNAP_STEP_RAD) * SNAP_STEP_RAD);
+ if (Math.abs(normalizeAngle(yaw - fallback)) < SNAP_TO_DEFAULT_RAD) return fallback;
+ return yaw;
+}
+
+const initial = typeof localStorage === "undefined" ? {} : read();
+
+export const useBuildingPoses = create<BuildingPoseState>((set, get) => ({
+ yaw: initial,
+ generation: 0,
+ selected: null,
+ rotating: false,
+ setYaw: (id, raw, snapStep = false) => {
+ const yaw = settleYaw(id, raw, snapStep);
+ const next = { ...get().yaw };
+ if (yaw === defaultBuildingYaw(id)) delete next[id];
+ else next[id] = yaw;
+ commit(next, set, get);
+ },
+ resetYaw: (id) => {
+ if (!(id in get().yaw)) return;
+ const next = { ...get().yaw };
+ delete next[id];
+ commit(next, set, get);
+ },
+ resetAll: () => {
+ if (Object.keys(get().yaw).length === 0) return;
+ commit({}, set, get);
+ },
+ select: (selected) => set({ selected }),
+ setRotating: (rotating) => set({ rotating }),
+}));
+
+function commit(
+ yaw: YawOverrides,
+ set: (partial: Partial<BuildingPoseState>) => void,
+ get: () => BuildingPoseState,
+): void {
+ applyBuildingYaws(buildIsland(), yaw);
+ set({ yaw, generation: get().generation + 1 });
+ write(yaw);
+}
+
+/** Push the stored overrides into the island once it exists — the stage calls this on mount. */
+export function syncBuildingPoses(): void {
+ applyBuildingYaws(buildIsland(), useBuildingPoses.getState().yaw);
+}
+
+/** The heading a building shows right now: the viewer's, else the designed one. */
+export function useBuildingYaw(id: BuildingId): number {
+ return useBuildingPoses((s) => s.yaw[id] ?? defaultBuildingYaw(id));
+}
+
+/** Whether the viewer has turned this building away from its designed heading. */
+export function useIsTurned(id: BuildingId): boolean {
+ return useBuildingPoses((s) => id in s.yaw);
+}
+
+/** How many buildings the viewer has turned. */
+export function useTurnedCount(): number {
+ return useBuildingPoses((s) => Object.keys(s.yaw).length);
+}
diff --git a/jarvis/ui/web/frontend/src/components/society/world/islandLayout.test.ts b/jarvis/ui/web/frontend/src/components/society/world/islandLayout.test.ts
index ec821a83e0..c2bd05ceb1 100644
--- a/jarvis/ui/web/frontend/src/components/society/world/islandLayout.test.ts
+++ b/jarvis/ui/web/frontend/src/components/society/world/islandLayout.test.ts
@@ -19,14 +19,22 @@ import {
PODIUM_LEVEL,
REGIONS,
RING_KIT_SLOTS,
+ SUMMIT_LEVEL,
SNOW_LEVEL,
SPOKES,
TileKind,
+ applyBuildingYaws,
buildIsland,
+ defaultBuildingYaw,
+ facesCamera,
findPath,
groundY,
hash2,
+ houseDefaultRotation,
+ houseId,
isWalkable,
+ kitId,
+ nearestWalkable,
randomPlazaTile,
smoothPath,
tileIndex,
@@ -144,27 +152,124 @@ describe("islandLayout", () => {
it("opens a paved square in the middle with a ring of houses around it", () => {
const { map, content } = island;
expect(map.kind[tileIndex(map, CENTER_TILE + 5, CENTER_TILE + 5)]).toBe(TileKind.plaza);
- expect(content.houses.length).toBe(5); // 12 slots, seven taken by the five ring hubs
+ expect(content.houses.length).toBe(7); // 12 slots, five taken by the ring hubs
for (const h of content.houses) {
const r = Math.hypot(h.x, h.z) / 2;
expect(r).toBeGreaterThan(PLAZA_RADIUS_TILES);
expect(r).toBeLessThan(HEDGE_RING_TILES);
- // Doors face the square: local +z rotated by `rotation` points at the centre.
+ // A door faces the square or the ring road: local +z rotated by
+ // `rotation` points along the radius, one way or the other …
const fx = Math.sin(h.rotation);
const fz = Math.cos(h.rotation);
- const toCentre = [-h.x, -h.z];
- const dot = fx * toCentre[0] + fz * toCentre[1];
- expect(dot).toBeGreaterThan(0);
+ const along = (fx * -h.x + fz * -h.z) / Math.hypot(h.x, h.z);
+ expect(Math.abs(along), `house ${h.slot}`).toBeCloseTo(1, 6);
+ // … and never away from the camera: no house shows the viewer its back.
+ expect(facesCamera(h.rotation), `house ${h.slot}`).toBe(true);
+ expect(h.rotation).toBe(h.defaultRotation);
+ expect(h.defaultRotation).toBeCloseTo(houseDefaultRotation(h.x, h.z), 9);
// No house stands on the hub's podium.
const [tx, tz] = worldToTile(h.x, h.z);
expect(map.level[tileIndex(map, tx, tz)]).toBe(PLATEAU_LEVEL);
}
+ // The houses stand in the south-east half, the camera's side of the ring,
+ // so most of them face the road — that is the point of the rule.
+ const towardRoad = content.houses.filter((h) => Math.sin(h.rotation) * h.x + Math.cos(h.rotation) * h.z > 0);
+ expect(towardRoad.length).toBeGreaterThanOrEqual(4);
+ // A house on the far side would keep its door on the square.
+ expect(facesCamera(houseDefaultRotation(-30, -30))).toBe(true);
+ expect(houseDefaultRotation(-30, -30)).toBeCloseTo(Math.atan2(30, 30), 9);
+ });
+
+ it("blocks the square's furniture and the landmarks' add-ons so nobody walks through a bench", () => {
+ const { map, content } = island;
+ // The Quest Board's plinth and the ring bench: nothing walkable inside 6 m.
+ for (const [x, z] of [
+ [1, 1],
+ [5, 3],
+ [-5, 1],
+ [1, -5],
+ ]) {
+ expect(isWalkable(map, ...worldToTile(x, z)), `square ${x},${z}`).toBe(false);
+ }
+ expect(isWalkable(map, ...worldToTile(7, 1))).toBe(true);
+ // The long table with its benches, south of the monument.
+ expect(isWalkable(map, ...worldToTile(0, 8.5))).toBe(false);
+ expect(isWalkable(map, ...worldToTile(-4, 7))).toBe(false);
+ expect(isWalkable(map, ...worldToTile(0, 12))).toBe(true);
+ // The meeting stand tile beside the table stays reachable.
+ const meet = content.places.market.standTile;
+ expect(isWalkable(map, meet[0], meet[1])).toBe(true);
+ // A walk from the west of the square to the east goes AROUND the middle.
+ const path = findPath(map, worldToTile(-16, 1), worldToTile(16, 1));
+ expect(path).not.toBeNull();
+ for (const [tx, tz] of path!) {
+ const [x, z] = tileToWorld(tx, tz);
+ expect(Math.hypot(x, z)).toBeGreaterThan(5);
+ }
+ // The hub's wings and reflecting pool, the harbor kiosk, the keeper's hut.
+ const [hx, hz] = tileToWorld(...content.places.hub.tile);
+ expect(isWalkable(map, ...worldToTile(hx + 15.5, hz + 1))).toBe(false);
+ expect(isWalkable(map, ...worldToTile(hx, hz + 13.2))).toBe(false);
+ const [bx, bz] = tileToWorld(...content.places.harbor.tile);
+ expect(isWalkable(map, ...worldToTile(bx - 7, bz + 2))).toBe(false);
+ const [lx, lz] = tileToWorld(...content.places.lighthouse.tile);
+ expect(isWalkable(map, ...worldToTile(lx - 6.5, lz + 3.9))).toBe(false);
+ // Every lamp post and hedge segment stands on a blocked tile — except a
+ // lamp on a dock plank (the planks stay open) or on a place's stand tile
+ // (a stand tile is always kept reachable; the figure stands at the lamp).
+ const stands = new Set(Object.values(content.places).map((p) => p.standTile.join(",")));
+ for (const l of content.lamps) {
+ const [tx, tz] = worldToTile(l.x, l.z);
+ if (map.kind[tileIndex(map, tx, tz)] === TileKind.dock || stands.has(`${tx},${tz}`)) continue;
+ expect(isWalkable(map, tx, tz), `lamp ${l.x},${l.z}`).toBe(false);
+ }
+ for (const h of content.hedges) expect(isWalkable(map, ...worldToTile(h.x, h.z))).toBe(false);
+ // Idle wandering never picks a tile inside the bench ring.
+ for (let i = 0; i < 40; i++) {
+ const [tx, tz] = randomPlazaTile(map, () => (i * 0.137) % 1);
+ const [x, z] = tileToWorld(tx, tz);
+ expect(Math.hypot(x, z)).toBeGreaterThan(6);
+ }
+ });
+
+ it("turns buildings in place and re-stamps their footprints", () => {
+ const { map, content } = island;
+ const house = content.houses[0];
+ const rest = house.defaultRotation;
+ // With no overrides the blocked layer equals the built one.
+ const before = map.blocked.slice();
+ applyBuildingYaws(island, {});
+ expect(map.blocked).toEqual(before);
+ // Turning a house a quarter round moves its blocked tiles.
+ applyBuildingYaws(island, { [houseId(house.slot)]: rest + Math.PI / 2 });
+ expect(house.rotation).toBeCloseTo(rest + Math.PI / 2, 9);
+ expect(map.blocked).not.toEqual(before);
+ // Every stand tile is still walkable, and every house tile still blocked.
+ for (const p of Object.values(content.places)) expect(isWalkable(map, p.standTile[0], p.standTile[1]), p.id).toBe(true);
+ expect(isWalkable(map, ...worldToTile(house.x, house.z))).toBe(false);
+ // Back to rest restores the exact layer.
+ applyBuildingYaws(island, {});
+ expect(house.rotation).toBe(rest);
+ expect(map.blocked).toEqual(before);
+ // Every turnable building has a designed heading to return to.
+ expect(defaultBuildingYaw(houseId(house.slot))).toBe(rest);
+ expect(defaultBuildingYaw(kitId("cli"))).toBeCloseTo(content.kitPoses.cli.rotation, 9);
+ // A figure caught inside a footprint finds the nearest free tile.
+ const inside = worldToTile(house.x, house.z);
+ const out = nearestWalkable(map, inside[0], inside[1]);
+ expect(out).not.toBeNull();
+ expect(isWalkable(map, out![0], out![1])).toBe(true);
+ expect(Math.max(Math.abs(out![0] - inside[0]), Math.abs(out![1] - inside[1]))).toBeLessThanOrEqual(3);
});
it("puts the Plugin Docks on the house ring, facing the square, with a reachable stand", () => {
const { map, content } = island;
for (const [id, pose] of Object.entries(content.kitPoses)) {
- expect(Math.hypot(pose.x, pose.z) / 2, id).toBeCloseTo(HOUSE_RING_TILES, 5);
+ // Ring hubs stand on the house ring; a hub with an anchor of its own does
+ // not — the Agent Foundry crowns the mountain (SUMMIT_TILE).
+ if (id in RING_KIT_SLOTS) {
+ expect(Math.hypot(pose.x, pose.z) / 2, id).toBeCloseTo(HOUSE_RING_TILES, 5);
+ }
const fx = Math.sin(pose.rotation);
const fz = Math.cos(pose.rotation);
// The front points at the centre, unless the building faces the road on purpose.
@@ -177,10 +282,12 @@ describe("islandLayout", () => {
// No two hubs share a slot.
const slots = Object.values(RING_KIT_SLOTS).flat();
expect(new Set(slots).size).toBe(slots.length);
- // No ring hub stands on the hub's podium.
- for (const pose of Object.values(content.kitPoses)) {
+ // No ring hub stands on the hub's podium; the summit hub stands on its own
+ // terrace on the mountain, far above the village.
+ for (const [id, pose] of Object.entries(content.kitPoses)) {
const [tx, tz] = worldToTile(pose.x, pose.z);
- expect(map.level[tileIndex(map, tx, tz)]).toBe(PLATEAU_LEVEL);
+ const level = map.level[tileIndex(map, tx, tz)];
+ expect(level, id).toBe(id in RING_KIT_SLOTS ? PLATEAU_LEVEL : SUMMIT_LEVEL);
}
});
diff --git a/jarvis/ui/web/frontend/src/components/society/world/islandLayout.ts b/jarvis/ui/web/frontend/src/components/society/world/islandLayout.ts
index 5b6e92b0b5..a5553bc29d 100644
--- a/jarvis/ui/web/frontend/src/components/society/world/islandLayout.ts
+++ b/jarvis/ui/web/frontend/src/components/society/world/islandLayout.ts
@@ -121,6 +121,8 @@ export const PODIUM_LEVEL = PLATEAU_LEVEL + 1;
export const DOCK_Y = 0.55;
/** Level from which a rock tile becomes snow. */
export const SNOW_LEVEL = 8;
+/** The terrace the Agent Foundry stands on: the mountain's top step. */
+export const SUMMIT_LEVEL = 9;
export interface IslandMap {
/** Tiles along one edge. */
@@ -131,6 +133,12 @@ export interface IslandMap {
level: Uint8Array;
/** 1 where a walker may not stand: water, rock, buildings, tree trunks. */
blocked: Uint8Array;
+ /**
+ * `blocked` without the buildings a viewer may turn (houses, ring hubs, the
+ * foundry's belt). `applyBuildingYaws` stamps those back in at their current
+ * heading, so a turned house blocks the tiles it actually covers.
+ */
+ blockedStatic: Uint8Array;
}
// ---------------------------------------------------------------------------
@@ -166,14 +174,18 @@ export interface Place {
export type HouseVariant = "solar-barrel" | "garden-roof" | "glass-loft";
export interface HousePlot {
+ /** Ring slot (0..15, clockwise from north) — the house's stable identity. */
+ slot: number;
/** Centre of the footprint, world metres. */
x: number;
z: number;
/** Footprint in tiles (w along the house's local x, d along local z). */
w: number;
d: number;
- /** Rotation about y; the door faces local +z. */
+ /** Rotation about y; the door faces local +z. The viewer may turn it (`applyBuildingYaws`). */
rotation: number;
+ /** The heading the house rests at — what "reset" returns to. */
+ defaultRotation: number;
variant: HouseVariant;
/** Deterministic 0..1 for per-house variation. */
seed: number;
@@ -336,6 +348,32 @@ export function isWalkable(map: IslandMap, tx: number, tz: number): boolean {
return map.blocked[tileIndex(map, tx, tz)] === 0;
}
+/**
+ * The walkable tile closest to (tx, tz) within `maxRadius` rings, the tile
+ * itself included; null when everything around is blocked. A figure that
+ * finds a building turned over its head steps to this tile first.
+ */
+export function nearestWalkable(map: IslandMap, tx: number, tz: number, maxRadius = 8): [number, number] | null {
+ if (isWalkable(map, tx, tz)) return [tx, tz];
+ for (let r = 1; r <= maxRadius; r++) {
+ let best: [number, number] | null = null;
+ let bestD = Infinity;
+ for (let dz = -r; dz <= r; dz++) {
+ for (let dx = -r; dx <= r; dx++) {
+ if (Math.max(Math.abs(dx), Math.abs(dz)) !== r) continue;
+ if (!isWalkable(map, tx + dx, tz + dz)) continue;
+ const d = dx * dx + dz * dz;
+ if (d < bestD) {
+ bestD = d;
+ best = [tx + dx, tz + dz];
+ }
+ }
+ }
+ if (best) return best;
+ }
+ return null;
+}
+
// ---------------------------------------------------------------------------
// Design: where things stand (tile units, from the island centre)
// ---------------------------------------------------------------------------
@@ -359,13 +397,12 @@ export const GATE_GAP_TILES = 3;
* side, and the foundry's ramp runs down onto the plaza in full view of the
* island camera (which looks from the south-east).
*/
-export const RING_KIT_SLOTS: Record<KitPlace, readonly number[]> = {
+export const RING_KIT_SLOTS: Partial<Record<KitPlace, readonly number[]>> = {
plugins: [13, 14],
- foundry: [2, 3],
// Hubs sit on the north and west of the ring so their fronts face the camera
// (it looks from the south-east); houses take the slots whose backs it sees.
skills: [15], // north, beside the docks: the Skill Forge
- mcp: [1], // north, beside the foundry: the Relay Tower
+ mcp: [1], // north-east: the Relay Tower
cli: [11], // west: the Terminal Cantina
};
@@ -393,10 +430,71 @@ export const KIT_FOOTPRINT_TILES: Record<KitPlace, { w: number; d: number }> = {
*/
export const KIT_FACING: Partial<Record<KitPlace, number>> = { foundry: Math.PI / 4 };
+/**
+ * The mountain's summit, flattened for the Agent Foundry (maintainer, 2026-09-02:
+ * "the factory sits up there on the mountain, connected by the road"). The
+ * highest tile of the snow cap; `PLOT_HALF.foundry` planes a terrace around it
+ * and `SUMMIT_ROAD` climbs to it, so the works crown the island's backdrop and
+ * a new agent walks the whole mountain road down into the village.
+ */
+export const SUMMIT_TILE: readonly [number, number] = [CENTER_TILE - 65, CENTER_TILE - 70];
+
+/** Kit buildings that stand on a plot of their own instead of in the house ring. */
+const KIT_ANCHOR: Partial<Record<KitPlace, readonly [number, number]>> = {
+ foundry: SUMMIT_TILE,
+};
+
+/** Every kit place, ring-bound or not — the world's hub roster. */
+export const KIT_PLACES: readonly KitPlace[] = ["plugins", "foundry", "skills", "mcp", "cli"];
+
+/** Whether a place id names a World Kit hub (the ones a click opens). */
+export function isKitPlace(id: string): id is KitPlace {
+ return (KIT_PLACES as readonly string[]).includes(id);
+}
+
+/**
+ * Where the island camera stands, as a unit vector on the ground: it looks
+ * from the south-east (`worldCamera.ts`, CAMERA_YAW_DEG = 45). A front that
+ * points along this vector faces the viewer; one that points against it
+ * shows its back. `worldCamera.test.ts` pins the two files to each other.
+ */
+export const CAMERA_FROM: readonly [number, number] = [Math.SQRT1_2, Math.SQRT1_2];
+
+/** Wrap an angle into (−π, π]. */
+export function normalizeAngle(a: number): number {
+ let d = a % (2 * Math.PI);
+ if (d > Math.PI) d -= 2 * Math.PI;
+ if (d <= -Math.PI) d += 2 * Math.PI;
+ return d;
+}
+
+/** Whether a front heading (rotation about y, front = local +z) faces the camera at all. */
+export function facesCamera(rotation: number): boolean {
+ return Math.sin(rotation) * CAMERA_FROM[0] + Math.cos(rotation) * CAMERA_FROM[1] > -1e-9;
+}
+
+/**
+ * A house's resting heading. Houses face the square — unless that turns their
+ * back on the viewer, in which case they face the ring road instead: a door
+ * the camera never sees is a house with its back turned (maintainer,
+ * 2026-09-02). A house seen exactly in profile keeps the square.
+ */
+export function houseDefaultRotation(x: number, z: number): number {
+ const toSquare = Math.atan2(-x, -z);
+ return facesCamera(toSquare) ? toSquare : normalizeAngle(toSquare + Math.PI);
+}
+
/** Where a kit building stands and which way it turns — the one source. */
export function kitPose(place: KitPlace): KitPose {
- const pose = ringPose(RING_KIT_SLOTS[place]);
const facing = KIT_FACING[place];
+ const anchor = KIT_ANCHOR[place];
+ if (anchor) {
+ const [x, z] = tileToWorld(anchor[0], anchor[1]);
+ return { x, z, rotation: facing ?? houseDefaultRotation(x, z) };
+ }
+ const slots = RING_KIT_SLOTS[place];
+ if (!slots) throw new Error(`kit place ${place} has neither ring slots nor an anchor`);
+ const pose = ringPose(slots);
return facing === undefined ? pose : { ...pose, rotation: facing };
}
@@ -438,7 +536,7 @@ const PLACE_TILES: Record<PlaceId, [number, number]> = {
mine: [CENTER_TILE - 32, CENTER_TILE - 60],
// Kit buildings stand in the house ring (RING_KIT_SLOTS); the tile is the ring pose's.
plugins: ringTile("plugins"),
- foundry: ringTile("foundry"),
+ foundry: [SUMMIT_TILE[0], SUMMIT_TILE[1]],
skills: ringTile("skills"),
mcp: ringTile("mcp"),
cli: ringTile("cli"),
@@ -463,7 +561,8 @@ export function foundryWalkOut(): {
to: [number, number];
heading: number;
} {
- const p = kitPose("foundry");
+ // The built island's pose, so a turned foundry delivers out of its turned portal.
+ const p = cached?.content.kitPoses.foundry ?? kitPose("foundry");
const fx = Math.sin(p.rotation);
const fz = Math.cos(p.rotation);
return {
@@ -491,7 +590,9 @@ const PLOT_HALF: Record<PlaceId, [number, number]> = {
solar: [8, 7],
mine: [5, 4],
plugins: [0, 0], // no flat plot of its own: it sits on the village plateau
- foundry: [0, 0],
+ // The foundry's terrace: the summit planed flat, wide enough for the hall,
+ // its conveyor and a rim of snow around the lot.
+ foundry: [10, 8],
skills: [0, 0],
mcp: [0, 0],
cli: [0, 0],
@@ -509,7 +610,7 @@ const PLOT_LEVEL: Record<PlaceId, number> = {
solar: 4,
mine: 4,
plugins: PLATEAU_LEVEL,
- foundry: PLATEAU_LEVEL,
+ foundry: SUMMIT_LEVEL,
skills: PLATEAU_LEVEL,
mcp: PLATEAU_LEVEL,
cli: PLATEAU_LEVEL,
@@ -528,6 +629,22 @@ const MINE_CLIFF = { dz: -8, hw: 8, hd: 3, level: 7 } as const;
/** The mine's branch road leaves the north spoke here and runs west to the forecourt. */
const MINE_ROAD = { fromX: CENTER_TILE - 1, z: CENTER_TILE - 60, length: 27 } as const;
+/**
+ * The mountain road to the Agent Foundry: three graded legs off the western
+ * end of the mine's branch, up the flank and onto the summit terrace, arriving
+ * at the foot of the works' conveyor. Straight legs only — `gradeRoad` widens
+ * across its own axis, so a diagonal would lay its shoulders lengthwise.
+ */
+const SUMMIT_ROAD: ReadonlyArray<{
+ from: [number, number];
+ dir: [number, number];
+ length: number;
+}> = [
+ { from: [CENTER_TILE - 37, CENTER_TILE - 60], dir: [-1, 0], length: 17 },
+ { from: [CENTER_TILE - 54, CENTER_TILE - 60], dir: [0, -1], length: 5 },
+ { from: [CENTER_TILE - 54, CENTER_TILE - 65], dir: [-1, 0], length: 6 },
+];
+
/** Where the dock reaches into the bay: from the harbor plot southward. */
export const DOCK_TILES = { from: CENTER_TILE + 66, to: CENTER_TILE + 80, halfWidth: 1 } as const;
@@ -821,7 +938,10 @@ function buildPlots(map: IslandMap): void {
? TileKind.rock
: id === "mine"
? TileKind.quarry
- : TileKind.plaza;
+ : // The foundry's terrace is planed mountain, not village paving.
+ id === "foundry"
+ ? TileKind.scree
+ : TileKind.plaza;
fillRect(map, px, pz, hw, hd, (i) => {
if (map.kind[i] === TileKind.water) return;
paintLand(map, i, kind, PLOT_LEVEL[id]);
@@ -895,6 +1015,17 @@ function buildVillage(map: IslandMap): void {
// The mine's branch: off the north spoke, west to the quarry, at the spoke's level there.
const junction = map.level[tileIndex(map, MINE_ROAD.fromX + 1, MINE_ROAD.z)];
gradeRoad(map, [MINE_ROAD.fromX, MINE_ROAD.z], [-1, 0], MINE_ROAD.length, junction);
+ // On up the mountain to the foundry: each leg starts at the level the last
+ // one reached, so the climb never breaks a walker's one-level step rule.
+ let climb = map.level[tileIndex(map, SUMMIT_ROAD[0].from[0] + 1, SUMMIT_ROAD[0].from[1])];
+ for (const leg of SUMMIT_ROAD) {
+ gradeRoad(map, leg.from, leg.dir, leg.length, climb);
+ const end: [number, number] = [
+ leg.from[0] + leg.dir[0] * leg.length,
+ leg.from[1] + leg.dir[1] * leg.length,
+ ];
+ if (inBounds(map, end[0], end[1])) climb = map.level[tileIndex(map, end[0], end[1])];
+ }
// Buildings block walking; their tiles keep the plot level.
for (const id of Object.keys(BUILDING_HALF) as PlaceId[]) {
@@ -945,18 +1076,17 @@ function placeHouses(): HousePlot[] {
for (let k = 0; k < slots; k++) {
if (k % 4 === 0) continue; // N, E, S, W are gates (N also holds the hub)
if (taken.has(k)) continue; // a kit building stands here
- const angle = (k / slots) * Math.PI * 2; // clockwise from north
- const r = HOUSE_RING_TILES * TILE_M;
- const x = Math.sin(angle) * r;
- const z = -Math.cos(angle) * r;
+ const [x, z] = ringSlotWorld(k);
const seed = hash2(k, 7, ISLAND_SEED);
+ const rotation = houseDefaultRotation(x, z);
houses.push({
+ slot: k,
x,
z,
w: 3,
d: 2,
- // The door (local +z) faces the square: rotate so local +z points to the centre.
- rotation: Math.atan2(-x, -z),
+ rotation,
+ defaultRotation: rotation,
variant: variants[k % variants.length],
seed,
});
@@ -964,25 +1094,63 @@ function placeHouses(): HousePlot[] {
return houses;
}
-/** Block the tiles under every house so walkers route around them. */
-function blockHouses(map: IslandMap, houses: HousePlot[]): void {
- for (const h of houses) {
- // Rasterise the rotated footprint by sampling its four quadrants.
- const hw = (h.w * TILE_M) / 2;
- const hd = (h.d * TILE_M) / 2;
- const cos = Math.cos(h.rotation);
- const sin = Math.sin(h.rotation);
- for (let lx = -hw + 0.5; lx <= hw; lx += 1) {
- for (let lz = -hd + 0.5; lz <= hd; lz += 1) {
- const wx = h.x + lx * cos + lz * sin;
- const wz = h.z - lx * sin + lz * cos;
- const [tx, tz] = worldToTile(wx, wz);
- if (inBounds(map, tx, tz)) map.blocked[tileIndex(map, tx, tz)] = 1;
- }
+/**
+ * Clearance a walker keeps from a wall, in metres: the footprint is stamped
+ * this much wider so a figure's shoulder never clips a house corner.
+ */
+export const WALL_MARGIN_M = 0.5;
+
+/**
+ * Stamp `value` over every tile a rotated rectangle covers — `w` × `d` metres
+ * at (x, z), turned by `rotation` about y (three.js convention: local +z is
+ * the front), grown by `margin` on every side. Sampled every half metre so no
+ * tile inside the footprint is skipped.
+ */
+export function stampFootprint(
+ layer: Uint8Array,
+ map: IslandMap,
+ x: number,
+ z: number,
+ w: number,
+ d: number,
+ rotation: number,
+ margin: number,
+ value: 0 | 1,
+): void {
+ const hw = w / 2 + margin;
+ const hd = d / 2 + margin;
+ const cos = Math.cos(rotation);
+ const sin = Math.sin(rotation);
+ for (let lx = -hw; lx <= hw + 1e-9; lx += 0.5) {
+ for (let lz = -hd; lz <= hd + 1e-9; lz += 0.5) {
+ const wx = x + lx * cos + lz * sin;
+ const wz = z - lx * sin + lz * cos;
+ const [tx, tz] = worldToTile(wx, wz);
+ if (inBounds(map, tx, tz)) layer[tileIndex(map, tx, tz)] = value;
}
}
}
+/** Block an axis-aligned rectangle given in world metres (x0..x1, z0..z1). */
+function blockRectM(map: IslandMap, x0: number, z0: number, x1: number, z1: number): void {
+ const [tx0, tz0] = worldToTile(Math.min(x0, x1), Math.min(z0, z1));
+ const [tx1, tz1] = worldToTile(Math.max(x0, x1) - 1e-6, Math.max(z0, z1) - 1e-6);
+ for (let tz = tz0; tz <= tz1; tz++) {
+ for (let tx = tx0; tx <= tx1; tx++) {
+ if (inBounds(map, tx, tz)) map.blocked[tileIndex(map, tx, tz)] = 1;
+ }
+ }
+}
+
+/** Block the single tile under a post (a lamp, a pillar, a mast) — never a dock plank. */
+function blockPost(map: IslandMap, x: number, z: number): void {
+ const [tx, tz] = worldToTile(x, z);
+ if (!inBounds(map, tx, tz)) return;
+ const i = tileIndex(map, tx, tz);
+ if (map.kind[i] === TileKind.dock) return;
+ map.blocked[i] = 1;
+}
+
/** The hedge ring with its four gates, and the lamps along ring and spokes. */
function placeRingFurniture(map: IslandMap): { hedges: Post[]; lamps: Post[] } {
const hedges: Post[] = [];
@@ -1265,11 +1433,24 @@ function placeBoulders(map: IslandMap): Boulder[] {
return boulders;
}
-/** A stand point `ahead` metres in front of a kit building, facing it. */
-function kitPlace(id: KitPlace, ahead: number): Place {
- const p = kitPose(id);
- const tile = worldToTile(p.x + Math.sin(p.rotation) * ahead, p.z + Math.cos(p.rotation) * ahead);
- return { id, tile: PLACE_TILES[id], standTile: tile, facing: p.rotation + Math.PI };
+/**
+ * How far in front of each kit building a visitor stands, in metres: in front
+ * of the docks' bays, at the foot of the foundry's conveyor ramp, at the
+ * others' doors.
+ */
+export const KIT_STAND_AHEAD_M: Record<KitPlace, number> = {
+ plugins: 7.5,
+ foundry: 13.5,
+ skills: 7.5,
+ mcp: 7.0,
+ cli: 7.5,
+};
+
+/** A stand point in front of a kit building at `pose`, facing it. */
+function kitPlace(id: KitPlace, pose: KitPose = kitPose(id)): Place {
+ const ahead = KIT_STAND_AHEAD_M[id];
+ const tile = worldToTile(pose.x + Math.sin(pose.rotation) * ahead, pose.z + Math.cos(pose.rotation) * ahead);
+ return { id, tile: PLACE_TILES[id], standTile: tile, facing: normalizeAngle(pose.rotation + Math.PI) };
}
function buildPlaces(map: IslandMap): Record<PlaceId, Place> {
@@ -1293,13 +1474,12 @@ function buildPlaces(map: IslandMap): Record<PlaceId, Place> {
solar: place("solar", [PLACE_TILES.solar[0] + 1, PLACE_TILES.solar[1] + 9], Math.PI),
// On the mine's road at the edge of the forecourt, facing the portal (west).
mine: place("mine", [PLACE_TILES.mine[0] + 7, PLACE_TILES.mine[1]], -Math.PI / 2),
- // In front of the docks' bays (7.5 m toward the square), facing the building.
- plugins: kitPlace("plugins", 7.5),
- // At the foot of the foundry's conveyor ramp, facing the portal.
- foundry: kitPlace("foundry", 13.5),
- skills: kitPlace("skills", 7.5),
- mcp: kitPlace("mcp", 7.0),
- cli: kitPlace("cli", 7.5),
+ // In front of the kit buildings (KIT_STAND_AHEAD_M), facing them.
+ plugins: kitPlace("plugins"),
+ foundry: kitPlace("foundry"),
+ skills: kitPlace("skills"),
+ mcp: kitPlace("mcp"),
+ cli: kitPlace("cli"),
};
// Make sure every stand tile is walkable — a place nobody can reach is a bug.
for (const p of Object.values(places)) {
@@ -1313,10 +1493,45 @@ function buildPlaces(map: IslandMap): Record<PlaceId, Place> {
return places;
}
-/** The central tree and the round table block the middle of the square. */
+/**
+ * Radius (metres) of the Quest Board's plinth and ring bench in the middle of
+ * the square, plus the walker's clearance: nobody walks through a bench.
+ */
+export const SQUARE_CENTRE_BLOCK_M = 6.0;
+/** The long table with its two benches on the square's south side, world metres. */
+export const LONG_TABLE_RECT_M = { x0: -5.2, z0: 6.6, x1: 5.2, z1: 10.4 } as const;
+
+/** The Quest Board with its ring bench and the long table block the middle of the square. */
function blockSquareFurniture(map: IslandMap): void {
const C = CENTER_TILE;
- fillRect(map, C, C, 1, 1, (i) => (map.blocked[i] = 1)); // trunk
+ paintDisc(map, C, C, 0, SQUARE_CENTRE_BLOCK_M / TILE_M, (i) => (map.blocked[i] = 1));
+ const t = LONG_TABLE_RECT_M;
+ blockRectM(map, t.x0, t.z0, t.x1, t.z1);
+}
+
+/**
+ * What the landmark components put on the ground beside their blocked
+ * building footprints — the hub's wings, colonnade, planters, pool and flag
+ * masts, the harbor's kiosk and gate pillars, the lighthouse keeper's hut.
+ * The numbers are the components' own (Village.tsx `Hub`, Landmarks.tsx
+ * `Harbor` / `Lighthouse`), in each building's local metres.
+ */
+function blockLandmarkFurniture(map: IslandMap): void {
+ const [hx, hz] = tileToWorld(...PLACE_TILES.hub);
+ // Wings, 7 × 8 m at ±15.5 m, one metre back.
+ for (const ox of [-15.5, 15.5]) blockRectM(map, hx + ox - 3.5, hz - 3, hx + ox + 3.5, hz + 5);
+ for (const px of [-10, -6, -2, 2, 6, 10]) blockPost(map, hx + px, hz + 7.4); // colonnade
+ for (const px of [-13, 13]) blockRectM(map, hx + px - 1.2, hz + 6.3, hx + px + 1.2, hz + 8.7); // planters
+ blockRectM(map, hx - 4.2, hz + 12.1, hx + 4.2, hz + 14.3); // the reflecting pool
+ for (const px of [-6.2, 6.2]) blockPost(map, hx + px, hz + 13.2); // flag masts
+
+ const [bx, bz] = tileToWorld(...PLACE_TILES.harbor);
+ blockRectM(map, bx - 9, bz + 0.25, bx - 5, bz + 3.75); // harbor master's kiosk
+ for (const px of [-3, 3]) blockPost(map, bx + px, bz + 8); // gate pillars
+
+ const [lx, lz] = tileToWorld(...PLACE_TILES.lighthouse);
+ const s = 1.3; // the lighthouse group's scale
+ blockRectM(map, lx + (-5 - 2) * s, lz + (3 - 1.7) * s, lx + (-5 + 2) * s, lz + (3 + 1.7) * s); // keeper's hut
}
export interface Island {
@@ -1335,12 +1550,12 @@ export function buildIsland(): Island {
kind: new Uint8Array(size * size),
level: new Uint8Array(size * size),
blocked: new Uint8Array(size * size),
+ blockedStatic: new Uint8Array(0), // filled once everything stands
};
buildTerrain(map);
buildPlots(map);
buildVillage(map);
const houses = placeHouses();
- blockHouses(map, houses);
const kitPoses: Record<KitPlace, KitPose> = {
plugins: kitPose("plugins"),
foundry: kitPose("foundry"),
@@ -1348,33 +1563,16 @@ export function buildIsland(): Island {
mcp: kitPose("mcp"),
cli: kitPose("cli"),
};
- // Every kit footprint blocks walking the way a house does.
- blockHouses(
- map,
- (Object.keys(kitPoses) as KitPlace[]).map((id) => ({
- ...kitPoses[id],
- ...KIT_FOOTPRINT_TILES[id],
- variant: "glass-loft" as HouseVariant,
- seed: 0,
- })),
- );
- // The foundry's conveyor deck is furniture, not floor: it keeps trees off
- // and keeps strollers beside it. A newborn rides it on fixed waypoints, so
- // the block costs the entrance nothing.
- const belt = kitPose("foundry");
- blockHouses(map, [
- {
- x: belt.x + Math.sin(belt.rotation) * FOUNDRY_RAMP_MID_M,
- z: belt.z + Math.cos(belt.rotation) * FOUNDRY_RAMP_MID_M,
- rotation: belt.rotation,
- w: 3,
- d: 3,
- variant: "glass-loft" as HouseVariant,
- seed: 0,
- },
- ]);
+ // Houses, kit halls and the foundry's belt block walking at their resting
+ // headings for now, so trees and furniture keep clear of them; the final
+ // headings are stamped again by `applyBuildingYaws` below.
+ stampTurnables(map, map.blocked, houses, kitPoses, 1);
blockSquareFurniture(map);
+ blockLandmarkFurniture(map);
const { hedges, lamps } = placeRingFurniture(map);
+ // A hedge is a wall to a walker; a lamp post is a post.
+ for (const h of hedges) stampFootprint(map.blocked, map, h.x, h.z, HEDGE_SEGMENT_M[0], HEDGE_SEGMENT_M[1], h.rotation, 0.3, 1);
+ for (const l of lamps) blockPost(map, l.x, l.z);
const { panels, greenhouses } = placeQuarterFurniture(map);
const festoonPoles = placeFestoonPoles(map);
const campfire = placeCampfire(map);
@@ -1382,6 +1580,9 @@ export function buildIsland(): Island {
const boulders = placeBoulders(map);
const reeds = placeReeds(map);
const places = buildPlaces(map);
+ // Everything that never turns: the turnable buildings lifted out again.
+ map.blockedStatic = map.blocked.slice();
+ stampTurnables(map, map.blockedStatic, houses, kitPoses, 0);
cached = {
map,
content: {
@@ -1399,6 +1600,7 @@ export function buildIsland(): Island {
kitPoses,
},
};
+ applyBuildingYaws(cached, {});
return cached;
}
@@ -1407,6 +1609,96 @@ export function resetIslandCache(): void {
cached = null;
}
+// ---------------------------------------------------------------------------
+// Turning buildings — the viewer's own headings over the designed ones
+// ---------------------------------------------------------------------------
+
+/** Stable id of a building a viewer may turn: a ring house by slot, a ring hub by place. */
+export type BuildingId = `house:${number}` | `kit:${KitPlace}`;
+
+export function houseId(slot: number): BuildingId {
+ return `house:${slot}`;
+}
+
+export function kitId(place: KitPlace): BuildingId {
+ return `kit:${place}`;
+}
+
+/** Centre of ring slot `slot` (0..15, clockwise from north), world metres. */
+export function ringSlotWorld(slot: number, radiusTiles = HOUSE_RING_TILES): [number, number] {
+ const angle = (slot / 16) * Math.PI * 2;
+ const r = radiusTiles * TILE_M;
+ return [Math.sin(angle) * r, -Math.cos(angle) * r];
+}
+
+/** The heading a building rests at — what "reset" returns to. */
+export function defaultBuildingYaw(id: BuildingId): number {
+ if (id.startsWith("kit:")) return kitPose(id.slice(4) as KitPlace).rotation;
+ const [x, z] = ringSlotWorld(Number(id.slice(6)));
+ return houseDefaultRotation(x, z);
+}
+
+/** Size of one hedge segment (along the ring × across), metres — `Village.tsx` draws it so. */
+export const HEDGE_SEGMENT_M: readonly [number, number] = [2.3, 0.8];
+
+/** Stamp the turnable buildings' footprints at their current headings into `layer`. */
+function stampTurnables(
+ map: IslandMap,
+ layer: Uint8Array,
+ houses: HousePlot[],
+ kitPoses: Record<KitPlace, KitPose>,
+ value: 0 | 1,
+): void {
+ for (const h of houses) {
+ stampFootprint(layer, map, h.x, h.z, h.w * TILE_M, h.d * TILE_M, h.rotation, WALL_MARGIN_M, value);
+ }
+ for (const id of Object.keys(kitPoses) as KitPlace[]) {
+ const p = kitPoses[id];
+ const f = KIT_FOOTPRINT_TILES[id];
+ stampFootprint(layer, map, p.x, p.z, f.w * TILE_M, f.d * TILE_M, p.rotation, WALL_MARGIN_M, value);
+ }
+ // The foundry's conveyor deck is furniture, not floor: it keeps trees off
+ // and keeps strollers beside it. A newborn rides it on fixed waypoints, so
+ // the block costs the entrance nothing.
+ const belt = kitPoses.foundry;
+ stampFootprint(
+ layer,
+ map,
+ belt.x + Math.sin(belt.rotation) * FOUNDRY_RAMP_MID_M,
+ belt.z + Math.cos(belt.rotation) * FOUNDRY_RAMP_MID_M,
+ 3 * TILE_M,
+ 3 * TILE_M,
+ belt.rotation,
+ WALL_MARGIN_M,
+ value,
+ );
+}
+
+/**
+ * Turn the buildings a viewer has turned: `yaws` maps a BuildingId to a
+ * heading (radians about y); anything absent rests at its default. Rewrites,
+ * in place, every number that depends on a heading — the house and kit poses,
+ * the blocked layer (from `blockedStatic`), the kit places' stand tiles and
+ * facings — so the renderer, the walkers and the pathfinder all see the same
+ * turned building. Pure over the island it is given; `buildingPoses.ts` is
+ * the only caller besides `buildIsland` itself.
+ */
+export function applyBuildingYaws(island: Island, yaws: Readonly<Partial<Record<BuildingId, number>>>): void {
+ const { map, content } = island;
+ for (const h of content.houses) h.rotation = yaws[houseId(h.slot)] ?? h.defaultRotation;
+ for (const id of Object.keys(content.kitPoses) as KitPlace[]) {
+ content.kitPoses[id].rotation = yaws[kitId(id)] ?? kitPose(id).rotation;
+ content.places[id] = kitPlace(id, content.kitPoses[id]);
+ }
+ map.blocked.set(map.blockedStatic);
+ stampTurnables(map, map.blocked, content.houses, content.kitPoses, 1);
+ // A stand tile stays reachable whatever turned over it — a place nobody can reach is a bug.
+ for (const p of Object.values(content.places)) {
+ const [tx, tz] = p.standTile;
+ if (inBounds(map, tx, tz)) map.blocked[tileIndex(map, tx, tz)] = 0;
+ }
+}
+
// ---------------------------------------------------------------------------
// Pathfinding — A* over walkable tiles, eight neighbours, no corner cutting
// ---------------------------------------------------------------------------
@@ -1578,7 +1870,8 @@ function lineIsWalkable(map: IslandMap, a: [number, number], b: [number, number]
export function randomPlazaTile(map: IslandMap, rng: () => number): [number, number] {
for (let attempt = 0; attempt < 32; attempt++) {
const angle = rng() * Math.PI * 2;
- const r = 3 + rng() * (PLAZA_RADIUS_TILES - 4);
+ // From just outside the ring bench to just inside the garden beds.
+ const r = 4 + rng() * (PLAZA_RADIUS_TILES - 5);
const tx = Math.floor(CENTER_TILE + Math.cos(angle) * r);
const tz = Math.floor(CENTER_TILE + Math.sin(angle) * r);
if (isWalkable(map, tx, tz)) return [tx, tz];
diff --git a/jarvis/ui/web/frontend/src/components/society/world/world.css b/jarvis/ui/web/frontend/src/components/society/world/world.css
index 19f198d93b..7feed71c1a 100644
--- a/jarvis/ui/web/frontend/src/components/society/world/world.css
+++ b/jarvis/ui/web/frontend/src/components/society/world/world.css
@@ -96,6 +96,7 @@
.sw-hud {
position: absolute;
inset: 0;
+ z-index: 22; /* above the place labels (drei Html zIndexRange tops at 20), below the drawers (30) */
display: flex;
flex-direction: column;
justify-content: space-between;
@@ -152,6 +153,24 @@
.sw-chip-btn[aria-pressed="true"] {
background: #ffd166;
}
+/* The running quest's bar breathes so "in progress" reads without a number. */
+.sw-quest-shimmer {
+ animation: sw-quest-breathe 1.6s ease-in-out infinite;
+}
+@keyframes sw-quest-breathe {
+ 0%,
+ 100% {
+ opacity: 0.55;
+ }
+ 50% {
+ opacity: 1;
+ }
+}
+@media (prefers-reduced-motion: reduce) {
+ .sw-quest-shimmer {
+ animation: none;
+ }
+}
.sw-chip-sep {
width: 1px;
height: 12px;
@@ -162,6 +181,12 @@
color: #4a5568;
background: rgba(255, 248, 220, 0.9);
}
+.sw-hint-row {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: 6px;
+}
.sw-hint {
font-size: 12px;
color: #1f2a3a;
@@ -169,6 +194,63 @@
padding: 4px 8px;
border-radius: 4px;
}
+.sw-hint-btn {
+ display: inline-flex;
+ align-items: center;
+ gap: 5px;
+ font: inherit;
+ font-size: 12px;
+ border: 1px solid rgba(31, 42, 58, 0.2);
+ background: rgba(255, 252, 245, 0.9);
+ cursor: pointer;
+}
+.sw-hint-btn:hover {
+ background: #fff8dc;
+}
+
+/* The rotate handle's badge beside a selected building: the heading and the way back. */
+.sw-rotate {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ padding: 3px 7px;
+ font-family: "Pixelify Sans", "Inter Variable", "Inter", ui-sans-serif, system-ui, sans-serif;
+ font-size: 13px;
+ line-height: 1;
+ color: #1f2a3a;
+ background: rgba(255, 252, 245, 0.92);
+ border: 1px solid rgba(31, 42, 58, 0.25);
+ border-radius: 4px;
+ box-shadow: 0 2px 0 rgba(31, 42, 58, 0.25);
+ white-space: nowrap;
+ pointer-events: auto;
+}
+.sw-rotate[data-turned] {
+ background: #fff8dc;
+ border-color: #1f2a3a;
+}
+.sw-rotate-deg {
+ min-width: 30px;
+ text-align: center;
+ font-variant-numeric: tabular-nums;
+ cursor: default;
+}
+.sw-rotate-reset {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ padding: 2px 6px;
+ font: inherit;
+ font-size: 12px;
+ color: #1f2a3a;
+ background: #ffd166;
+ border: 1px solid rgba(31, 42, 58, 0.35);
+ border-radius: 3px;
+ cursor: pointer;
+}
+.sw-rotate-reset:hover {
+ background: #ffe9a8;
+}
.sw-corner {
display: flex;
flex-direction: column;
diff --git a/jarvis/ui/web/frontend/src/components/society/world/worldCamera.test.ts b/jarvis/ui/web/frontend/src/components/society/world/worldCamera.test.ts
index 5e0d53e52b..c6fa3150d6 100644
--- a/jarvis/ui/web/frontend/src/components/society/world/worldCamera.test.ts
+++ b/jarvis/ui/web/frontend/src/components/society/world/worldCamera.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, it } from "vitest";
import { focusFromSearch } from "./cameraStore";
-import { ISLAND_HALF_M } from "./islandLayout";
+import { CAMERA_FROM, ISLAND_HALF_M, facesCamera } from "./islandLayout";
import {
CAMERA_PITCH_DEG,
CAMERA_YAW_DEG,
@@ -29,6 +29,17 @@ describe("worldCamera", () => {
expect(y).toBeGreaterThan(Math.hypot(x, z));
});
+ it("agrees with the island layout about where it stands", () => {
+ // The layout turns houses so no door faces away from THIS camera: the
+ // ground vector toward the camera is the opposite of screen-up on the ground.
+ const { forward } = groundBasis();
+ expect(-forward[0]).toBeCloseTo(CAMERA_FROM[0], 5);
+ expect(-forward[1]).toBeCloseTo(CAMERA_FROM[1], 5);
+ // A front pointing at the camera is seen; one pointing away is a back.
+ expect(facesCamera(Math.atan2(CAMERA_FROM[0], CAMERA_FROM[1]))).toBe(true);
+ expect(facesCamera(Math.atan2(-CAMERA_FROM[0], -CAMERA_FROM[1]))).toBe(false);
+ });
+
it("zooms in five fixed steps, up to the whole island, and clamps at both ends", () => {
expect(ZOOM_WIDTHS_M).toEqual([32, 64, 128, 256, 512]);
expect(ZOOM_WIDTHS_M[MAX_ZOOM]).toBe(ISLAND_HALF_M * 2);
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index b70a057642..705cf50213 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -3217,6 +3217,7 @@
"hangup_shutdown": "Shutdown"
},
"session_detail": {
+ "export_label": "Exportieren",
"copied_as": "Session kopiert als",
"copy_failed_clipboard": "Kopieren fehlgeschlagen — Clipboard-Zugriff blockiert?",
"copy_failed": "Kopieren fehlgeschlagen",
@@ -5122,7 +5123,8 @@
"empty_title": "Sprich mit {0}",
"empty_hint": "Tippen, sprechen oder einen anderen Agenten mit @ nennen — Jarvis gibt die Aufgabe weiter und meldet sich zurück.",
"thinking": "Denkt nach…",
- "thought_for": "{0} s nachgedacht",
+ "thought_for": "{0} nachgedacht",
+ "thinking_for": "Denkt seit {0}",
"thought": "Nachgedacht",
"thought_hidden": "Das Modell hält sein Denken privat; es hat hier nachgedacht.",
"tool_running": "läuft",
@@ -5141,7 +5143,12 @@
"hud_active": "{0} aktiv",
"sample_badge": "Beispieldaten",
"reduced_motion_note": "Reduzierte Bewegung: Die Insel hält still.",
- "controls_hint": "Ziehen zum Verschieben · Scrollen zum Zoomen · Pfeiltasten zum Bewegen",
+ "controls_hint": "Ziehen zum Verschieben · Scrollen zum Zoomen · Pfeiltasten zum Bewegen · Gebäude anklicken zum Drehen",
+ "rotate_hint": "Den Knopf um das Gebäude ziehen, um es zu drehen. Mit Shift rastet es in 15°-Schritten ein.",
+ "rotate_reset": "Zurück zur Standard-Ausrichtung",
+ "rotate_reset_short": "Zurücksetzen",
+ "rotate_reset_all": "Alle Gebäude auf ihre Standard-Ausrichtung zurücksetzen",
+ "rotate_reset_all_count": "{count} gedrehte zurücksetzen",
"zoom_label": "Zoom",
"zoom_in": "Vergrößern",
"zoom_out": "Verkleinern",
@@ -5150,6 +5157,11 @@
"open_ledger": "Register öffnen",
"place_quests": "Questtafel",
"hud_quests": "Quests",
+ "quest_add_placeholder": "Neue Quest… z. B. die fünf wichtigsten Mails von heute",
+ "quest_wait_approval": "{agent} wartet in seinem Chat auf deine Freigabe – danach startet die Quest sofort",
+ "quest_wait_busy": "{agent} ist beschäftigt – die Quest startet, sobald er frei ist",
+ "quest_open_agent": "{agent} öffnen",
+ "quest_group_history": "Verlauf",
"drawer_quests_title": "Questtafel",
"drawer_quests_hint": "Gib einen Auftrag auf. Der passende Agent übernimmt ihn – passt niemand, schmiedet die Foundry einen.",
"quest_compose_placeholder": "Was soll erledigt werden? Zum Beispiel: die fünf wichtigsten Mails von heute",
@@ -5240,7 +5252,11 @@
"meeting": "Besprechungspavillon",
"archive": "Archiv",
"gate": "Hafentor",
- "idle": "Unterwegs"
+ "idle": "Unterwegs",
+ "hub:plugins": "Plugin-Docks",
+ "hub:skills": "Skill-Schmiede",
+ "hub:mcp": "Relaisturm",
+ "hub:cli": "Terminal-Cantina"
},
"card": {
"brain_shared_hint": "Das Gehirn des getippten Chats, gewählt an der Modell-Pille im Chat. Sprache läuft über das Realtime-Gehirn aus den Sprach-Einstellungen.",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index 84a99e242a..d74f7edeb5 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -3217,6 +3217,7 @@
"hangup_shutdown": "Shutdown"
},
"session_detail": {
+ "export_label": "Export",
"copied_as": "Session copied as",
"copy_failed_clipboard": "Copy failed — clipboard access blocked?",
"copy_failed": "Copy failed",
@@ -5122,7 +5123,8 @@
"empty_title": "Talk to {0}",
"empty_hint": "Type, speak, or name another agent with @ — Jarvis hands the task over and reports back.",
"thinking": "Thinking…",
- "thought_for": "Thought for {0} s",
+ "thought_for": "Thought for {0}",
+ "thinking_for": "Thinking for {0}",
"thought": "Thought",
"thought_hidden": "The model keeps its reasoning private; it did think here.",
"tool_running": "running",
@@ -5141,7 +5143,12 @@
"hud_active": "{0} active",
"sample_badge": "Sample data",
"reduced_motion_note": "Motion reduced: the island holds still.",
- "controls_hint": "Drag to pan · Scroll to zoom · Arrow keys to move",
+ "controls_hint": "Drag to pan · Scroll to zoom · Arrow keys to move · Click a building to turn it",
+ "rotate_hint": "Drag the knob around the building to turn it. Shift snaps to 15° steps.",
+ "rotate_reset": "Back to the designed heading",
+ "rotate_reset_short": "Reset",
+ "rotate_reset_all": "Turn every building back to its designed heading",
+ "rotate_reset_all_count": "Reset {count} turned",
"zoom_label": "Zoom",
"zoom_in": "Zoom in",
"zoom_out": "Zoom out",
@@ -5150,6 +5157,11 @@
"open_ledger": "Open the ledger",
"place_quests": "Quest Board",
"hud_quests": "Quests",
+ "quest_add_placeholder": "New quest… e.g. the five most important mails of today",
+ "quest_wait_approval": "{agent} is waiting for your approval in its chat — the quest starts right after",
+ "quest_wait_busy": "{agent} is busy — the quest starts as soon as it is free",
+ "quest_open_agent": "Open {agent}",
+ "quest_group_history": "History",
"drawer_quests_title": "Quest Board",
"drawer_quests_hint": "Post a job. The agent who fits takes it — when nobody fits, the Foundry forges one.",
"quest_compose_placeholder": "What should be done? For example: the five most important mails of today",
@@ -5240,7 +5252,11 @@
"meeting": "Meeting pavilion",
"archive": "Archive",
"gate": "Harbor gate",
- "idle": "Wandering"
+ "idle": "Wandering",
+ "hub:plugins": "Plugin Docks",
+ "hub:skills": "Skill Forge",
+ "hub:mcp": "Relay Tower",
+ "hub:cli": "Terminal Cantina"
},
"card": {
"brain_shared_hint": "The brain of the typed chat, picked in the chat's model pill. Voice runs on the realtime brain from the voice settings.",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index 5bb86af5c8..450e61313e 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -3217,6 +3217,7 @@
"hangup_shutdown": "Apagado"
},
"session_detail": {
+ "export_label": "Exportar",
"copied_as": "Sesión copiada como",
"copy_failed_clipboard": "Error al copiar — ¿acceso al portapapeles bloqueado?",
"copy_failed": "Error al copiar",
@@ -5122,7 +5123,8 @@
"empty_title": "Habla con {0}",
"empty_hint": "Escribe, habla o nombra a otro agente con @: Jarvis le pasa la tarea e informa aquí.",
"thinking": "Pensando…",
- "thought_for": "Pensó {0} s",
+ "thought_for": "Pensó durante {0}",
+ "thinking_for": "Pensando desde hace {0}",
"thought": "Pensó",
"thought_hidden": "El modelo mantiene privado su razonamiento; aquí sí pensó.",
"tool_running": "en curso",
@@ -5141,7 +5143,12 @@
"hud_active": "{0} activos",
"sample_badge": "Datos de ejemplo",
"reduced_motion_note": "Movimiento reducido: la isla se queda quieta.",
- "controls_hint": "Arrastra para desplazar · Rueda para acercar · Flechas para mover",
+ "controls_hint": "Arrastra para desplazar · Rueda para acercar · Flechas para mover · Clic en un edificio para girarlo",
+ "rotate_hint": "Arrastra el mando alrededor del edificio para girarlo. Con Mayús se ajusta en pasos de 15°.",
+ "rotate_reset": "Volver a la orientación de diseño",
+ "rotate_reset_short": "Restablecer",
+ "rotate_reset_all": "Devolver todos los edificios a su orientación de diseño",
+ "rotate_reset_all_count": "Restablecer {count} girados",
"zoom_label": "Zoom",
"zoom_in": "Acercar",
"zoom_out": "Alejar",
@@ -5150,6 +5157,11 @@
"open_ledger": "Abrir el registro",
"place_quests": "Tablón de misiones",
"hud_quests": "Misiones",
+ "quest_add_placeholder": "Nueva misión… p. ej. los cinco correos más importantes de hoy",
+ "quest_wait_approval": "{agent} espera tu aprobación en su chat; la misión empieza justo después",
+ "quest_wait_busy": "{agent} está ocupado; la misión empieza en cuanto quede libre",
+ "quest_open_agent": "Abrir {agent}",
+ "quest_group_history": "Historial",
"drawer_quests_title": "Tablón de misiones",
"drawer_quests_hint": "Publica un encargo. El agente adecuado lo toma; si nadie encaja, la Fundición forja uno.",
"quest_compose_placeholder": "¿Qué hay que hacer? Por ejemplo: los cinco correos más importantes de hoy",
@@ -5240,7 +5252,11 @@
"meeting": "Pabellón de reuniones",
"archive": "Archivo",
"gate": "Puerta del puerto",
- "idle": "Paseando"
+ "idle": "Paseando",
+ "hub:plugins": "Muelles de plugins",
+ "hub:skills": "Forja de skills",
+ "hub:mcp": "Torre de relé",
+ "hub:cli": "Cantina de terminales"
},
"card": {
"brain_shared_hint": "El cerebro del chat escrito, elegido en la píldora de modelo del chat. La voz usa el cerebro en tiempo real de los ajustes de voz.",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/de.json b/jarvis/ui/web/frontend/src/i18n/locales/society/de.json
index 663323f85e..5670888372 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/society/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/de.json
@@ -8,7 +8,12 @@
"hud_active": "{count} aktiv",
"sample_badge": "Beispiel-Roster",
"reduced_motion_note": "Reduzierte Bewegung: die Insel steht still",
- "controls_hint": "Ziehen zum Schwenken · Scrollen zum Zoomen · Pfeiltasten zum Bewegen",
+ "controls_hint": "Ziehen zum Schwenken · Scrollen zum Zoomen · Pfeiltasten zum Bewegen · Gebäude anklicken zum Drehen",
+ "rotate_hint": "Den Knopf um das Gebäude ziehen, um es zu drehen. Mit Shift rastet es in 15°-Schritten ein.",
+ "rotate_reset": "Zurück zur Standard-Ausrichtung",
+ "rotate_reset_short": "Zurücksetzen",
+ "rotate_reset_all": "Alle Gebäude auf ihre Standard-Ausrichtung zurücksetzen",
+ "rotate_reset_all_count": "{count} gedrehte zurücksetzen",
"zoom_label": "Zoom",
"zoom_in": "Hineinzoomen",
"zoom_out": "Herauszoomen",
@@ -32,6 +37,11 @@
"drawer_close": "Schließen",
"place_quests": "Questtafel",
"hud_quests": "Quests",
+ "quest_add_placeholder": "Neue Quest… z. B. die fünf wichtigsten Mails von heute",
+ "quest_wait_approval": "{agent} wartet in seinem Chat auf deine Freigabe – danach startet die Quest sofort",
+ "quest_wait_busy": "{agent} ist beschäftigt – die Quest startet, sobald er frei ist",
+ "quest_open_agent": "{agent} öffnen",
+ "quest_group_history": "Verlauf",
"drawer_quests_title": "Questtafel",
"drawer_quests_hint": "Gib einen Auftrag auf. Der passende Agent übernimmt ihn – passt niemand, schmiedet die Foundry einen.",
"quest_compose_placeholder": "Was soll erledigt werden? Zum Beispiel: die fünf wichtigsten Mails von heute",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/en.json b/jarvis/ui/web/frontend/src/i18n/locales/society/en.json
index bfe890bc1c..f8bcc2d120 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/society/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/en.json
@@ -8,7 +8,12 @@
"hud_active": "{count} active",
"sample_badge": "Sample roster",
"reduced_motion_note": "Reduced motion: the island holds still",
- "controls_hint": "Drag to pan · Scroll to zoom · Arrow keys to move",
+ "controls_hint": "Drag to pan · Scroll to zoom · Arrow keys to move · Click a building to turn it",
+ "rotate_hint": "Drag the knob around the building to turn it. Shift snaps to 15° steps.",
+ "rotate_reset": "Back to the designed heading",
+ "rotate_reset_short": "Reset",
+ "rotate_reset_all": "Turn every building back to its designed heading",
+ "rotate_reset_all_count": "Reset {count} turned",
"zoom_label": "Zoom",
"zoom_in": "Zoom in",
"zoom_out": "Zoom out",
@@ -32,6 +37,11 @@
"drawer_close": "Close",
"place_quests": "Quest Board",
"hud_quests": "Quests",
+ "quest_add_placeholder": "New quest… e.g. the five most important mails of today",
+ "quest_wait_approval": "{agent} is waiting for your approval in its chat — the quest starts right after",
+ "quest_wait_busy": "{agent} is busy — the quest starts as soon as it is free",
+ "quest_open_agent": "Open {agent}",
+ "quest_group_history": "History",
"drawer_quests_title": "Quest Board",
"drawer_quests_hint": "Post a job. The agent who fits takes it — when nobody fits, the Foundry forges one.",
"quest_compose_placeholder": "What should be done? For example: the five most important mails of today",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/es.json b/jarvis/ui/web/frontend/src/i18n/locales/society/es.json
index 3ff7ccd649..e92afe3726 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/society/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/es.json
@@ -8,7 +8,12 @@
"hud_active": "{count} activos",
"sample_badge": "Plantilla de ejemplo",
"reduced_motion_note": "Movimiento reducido: la isla se queda quieta",
- "controls_hint": "Arrastra para desplazar · Rueda para zoom · Flechas para moverte",
+ "controls_hint": "Arrastra para desplazar · Rueda para zoom · Flechas para moverte · Clic en un edificio para girarlo",
+ "rotate_hint": "Arrastra el mando alrededor del edificio para girarlo. Con Mayús se ajusta en pasos de 15°.",
+ "rotate_reset": "Volver a la orientación de diseño",
+ "rotate_reset_short": "Restablecer",
+ "rotate_reset_all": "Devolver todos los edificios a su orientación de diseño",
+ "rotate_reset_all_count": "Restablecer {count} girados",
"zoom_label": "Zoom",
"zoom_in": "Acercar",
"zoom_out": "Alejar",
@@ -32,6 +37,11 @@
"drawer_close": "Cerrar",
"place_quests": "Tablón de misiones",
"hud_quests": "Misiones",
+ "quest_add_placeholder": "Nueva misión… p. ej. los cinco correos más importantes de hoy",
+ "quest_wait_approval": "{agent} espera tu aprobación en su chat; la misión empieza justo después",
+ "quest_wait_busy": "{agent} está ocupado; la misión empieza en cuanto quede libre",
+ "quest_open_agent": "Abrir {agent}",
+ "quest_group_history": "Historial",
"drawer_quests_title": "Tablón de misiones",
"drawer_quests_hint": "Publica un encargo. El agente adecuado lo toma; si nadie encaja, la Fundición forja uno.",
"quest_compose_placeholder": "¿Qué hay que hacer? Por ejemplo: los cinco correos más importantes de hoy",