refactor: derive agentStates from AGENT_DEFS in agents.js
Some checks failed
CI / Typecheck & Lint (pull_request) Failing after 0s

Import AGENT_DEFS from agent-defs.js and dynamically build the
agentStates map instead of hardcoding agent IDs. Adding a new agent
now only requires editing agent-defs.js.

Fixes #59

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alexander Whitestone
2026-03-22 21:40:14 -04:00
parent 609acc8f66
commit 871ab15db7

View File

@@ -1,10 +1,11 @@
import * as THREE from 'three';
import { AGENT_DEFS } from './agent-defs.js';
const TIMMY_POS = new THREE.Vector3(0, 0, -2);
export const TIMMY_WORLD_POS = TIMMY_POS.clone();
const CRYSTAL_POS = new THREE.Vector3(0.6, 1.15, -4.1);
const agentStates = { alpha: 'idle', beta: 'idle', gamma: 'idle', delta: 'idle' };
const agentStates = Object.fromEntries(AGENT_DEFS.map(d => [d.id, 'idle']));
function deriveTimmyState() {
if (agentStates.gamma === 'working') return 'working';