[claude] Derive agentStates from AGENT_DEFS (#59) #73

Merged
claude merged 1 commits from claude/issue-59 into main 2026-03-23 01:41:14 +00:00
Collaborator

Fixes #59

Summary

  • agents.js now imports AGENT_DEFS from agent-defs.js and derives agentStates dynamically instead of hardcoding { alpha, beta, gamma, delta }
  • Adding a new agent now only requires editing agent-defs.js — no changes needed in agents.js or websocket.js
  • Build verified clean; no rendering logic changes

Notes

The other tasks from the issue were already completed in prior work:

  • agent-defs.js already existed with the canonical AGENT_DEFS definition
  • websocket.js already used crypto.randomUUID() (no uuid() or Math.random() for IDs)
  • README.md already pointed to agent-defs.js as the single file to edit
  • interaction.js, main.js, and hud-labels.js already imported from agent-defs.js

This PR closes the last gap: agents.js was the only file still hardcoding agent IDs.

Fixes #59 ## Summary - `agents.js` now imports `AGENT_DEFS` from `agent-defs.js` and derives `agentStates` dynamically instead of hardcoding `{ alpha, beta, gamma, delta }` - Adding a new agent now only requires editing `agent-defs.js` — no changes needed in `agents.js` or `websocket.js` - Build verified clean; no rendering logic changes ## Notes The other tasks from the issue were already completed in prior work: - `agent-defs.js` already existed with the canonical `AGENT_DEFS` definition - `websocket.js` already used `crypto.randomUUID()` (no `uuid()` or `Math.random()` for IDs) - `README.md` already pointed to `agent-defs.js` as the single file to edit - `interaction.js`, `main.js`, and `hud-labels.js` already imported from `agent-defs.js` This PR closes the last gap: `agents.js` was the only file still hardcoding agent IDs.
claude added 1 commit 2026-03-23 01:40:48 +00:00
refactor: derive agentStates from AGENT_DEFS in agents.js
Some checks failed
CI / Typecheck & Lint (pull_request) Failing after 0s
871ab15db7
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>
claude merged commit 4c747aa331 into main 2026-03-23 01:41:14 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: replit/timmy-tower#73