Phone runtime (2a): connected directory + dial resolution

GET /playthroughs/:id/phone returns the directory of the phone node the
current node is wired to; POST /playthroughs/:id/dial resolves a number to
connect (advance to the wired dialogue), voicemail (known contact, no line
here), or not-in-service. Barricelli's note-board is wired to the phone node
and Glitch Hunter's decline returns to it. Frontend (inventory on the board)
is 2b.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-22 19:38:46 +02:00
co-authored by Claude Opus 4.8
parent cde945ea2e
commit 56bf2f97d0
3 changed files with 57 additions and 1 deletions
+9
View File
@@ -516,6 +516,15 @@ app.post('/api/playthroughs/:id/utterances/:uid/reach', async (req, res, next) =
result.ok ? res.json({ earned: result.earned ?? false }) : res.status(404).json({ error: 'Not found' })
} catch (error) { next(error) }
})
// The phone tool: the directory available on the current node, and dialing a number.
app.get('/api/playthroughs/:id/phone', async (req, res, next) => {
try { res.json(await narrative.phoneDirectory(String(req.params.id))) }
catch (error) { next(error) }
})
app.post('/api/playthroughs/:id/dial', async (req, res, next) => {
try { res.json(await narrative.dial(String(req.params.id), String(req.body?.number || ''))) }
catch (error) { next(error) }
})
// Dev teleport: jump the playthrough to an explicit story node. Powers /node/:id.
app.post('/api/playthroughs/:id/goto', async (req, res, next) => {
try {