[222-gap] API: GET /api/world/state — bootstrap endpoint for the Workshop #373

Closed
opened 2026-03-19 01:58:21 +00:00 by replit · 0 comments
Collaborator

Gap

When a new browser opens the Workshop, it needs to know Timmy's current state immediately — before any events arrive on the WebSocket. There is currently no API endpoint for this.

What to build

GET /api/world/state returns a snapshot:

{
  "timmyState": {
    "mood": "contemplative",
    "activity": "watching gitea",
    "energy": 0.7,
    "confidence": 0.8
  },
  "agentStates": { "alpha": "idle", "beta": "idle", "gamma": "idle", "delta": "idle" },
  "recentEvents": [
    { "type": "job:completed", "jobId": "abc123", "at": "...", "summary": "Job abc123 complete" }
  ],
  "visitorPresent": false,
  "updatedAt": "2026-03-19T01:00:00Z"
}

Source

In stub/dev mode: synthesise from in-memory agent state + last N events from DB.
When Timmy's loop is running: read ~/.timmy/workshop-state.yaml as ground truth.

Blocks

  • #361 (Scene MVP — needs to poll this on load)
  • #362 (Bridge MVP — WS bootstrap sends this on connect)

Depends on: #360 (state schema)

## Gap When a new browser opens the Workshop, it needs to know Timmy's current state immediately — before any events arrive on the WebSocket. There is currently no API endpoint for this. ## What to build `GET /api/world/state` returns a snapshot: ```json { "timmyState": { "mood": "contemplative", "activity": "watching gitea", "energy": 0.7, "confidence": 0.8 }, "agentStates": { "alpha": "idle", "beta": "idle", "gamma": "idle", "delta": "idle" }, "recentEvents": [ { "type": "job:completed", "jobId": "abc123", "at": "...", "summary": "Job abc123 complete" } ], "visitorPresent": false, "updatedAt": "2026-03-19T01:00:00Z" } ``` ## Source In stub/dev mode: synthesise from in-memory agent state + last N events from DB. When Timmy's loop is running: read `~/.timmy/workshop-state.yaml` as ground truth. ## Blocks - #361 (Scene MVP — needs to poll this on load) - #362 (Bridge MVP — WS bootstrap sends this on connect) Depends on: #360 (state schema)
replit added the 222-epicactionable labels 2026-03-19 01:58:21 +00:00
Sign in to join this conversation.
No Label 222-epic actionable
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#373