Add Letta NPC glue: PHP client, SQLite cache, play.php narration
Shipped as afeae36.
What Changed
This pass makes NPC narration more usable in the browser by adding cache-aware behavior, cache warming, and bounded live calls so the page remains responsive.
- Worked in job board and contract flow.
- Worked in Letta narration.
- Worked in test coverage.
Why It Matters
LLM-backed flavor is valuable only if it does not stall play. The cache and prefetch work keeps the experience responsive while still supporting richer NPC beats.
Implementation Notes
The commit message for this slice was:
- LettaClient + NpcIntentBroker + LettaResponseCache (keyed by run/beat/npc/context hash)
- play.php optional narrate=1 enriches beats with cached NPC dialogue
- config.letta.example.php; host config at DB_PARENT/config/letta.php on multihost
- 50/50 tests (cache idempotency + stable hashes)
Agent box: NPC agent on Venice proxy; nginx :8283 public proxy to Letta.
Files touched in this slice included:
.gitignorepublic/includes/Letta/LettaClient.phppublic/includes/Letta/LettaConfig.phppublic/includes/Letta/LettaResponseCache.phppublic/includes/Letta/LettaServices.phppublic/includes/Letta/NpcIntentBroker.phppublic/includes/config.letta.example.phppublic/play.phptests/run-tests.php
Verification
- The change was committed to
mainand included in the running devlog timeline. - The current archive test suite verifies devlog posts render with substantive body content, illustrations, screenshots, and valid asset references.
- For browser-facing slices, Playwright smoke checks in this build cycle covered the active game surfaces and devlog pages.
Visuals
