bridge: ask_gm tool, gm answers as tool results, direct apiKey config, line-queue input

This commit is contained in:
2026-11-11 21:33:18 +00:00
parent 9d7273c599
commit f169d92eba
3 changed files with 75 additions and 42 deletions
+11 -5
View File
@@ -93,7 +93,9 @@ Two interleaved stories calibrate the memory system against itself:
record work (`((q:))`, `((file:))`, `((amend:))`, `((discard:))`) to
`search`/`file`/`amend`/`discard` — `--gm` marks GM-authorized writes.
The full play protocol — format, one-thing-per-turn, thoughts off the
page, intent-form, immersion over realism — lives in `system.md`.
page, intent-form, immersion over realism — lives in `system.md`. In
bridge mode, the model's OOC is the `ask_gm` tool; the GM's own OOC
stays `((...))` in their turns.
4. **Close a window:** just stop. No in-band ritual; the player-model has no
end-of-session duties.
5. **Housekeep (fresh model, new context):** send `housekeeper.md`, then
@@ -263,14 +265,18 @@ pedantic, whatever housekeeping needs. The two prompts are independent.
**Substrate:** `tool/bridge.mjs` is the thin bridge — a player session with
native tools, no UI. It assembles the bundle from the run's files (views
refreshed), offers the player tools (status and a coin-flip roll always;
records only when the run's gate allows — the tool list is the capability
surface), executes
refreshed), offers the player tools (status, a coin-flip roll, and ask_gm
always; records only when the run's gate allows — the tool list is the
capability surface), executes
model tool calls against the clerk, logs the full exchange to
`runs/<story>/sessions/<stamp>.jsonl` (the housekeeping transcript), and
elides old tool results to stubs in the live context (use-and-discard).
Model-initiated OOC is the `ask_gm` tool: the GM types the reply as the
tool result, so the prose channel stays pure fiction — and ask_gm answers
are exempt from elision, because a ruling must not vanish mid-session.
Config: copy `bridge.example.json` to `bridge.json` — any OpenAI-compatible
endpoint, key via the env var it names. `--mock` runs a scripted fake model
endpoint; put the key in the `apiKey` field (bridge.json is gitignored) or
name an env var via `apiKeyEnv`. `--mock` runs a scripted fake model
that proves the loop without a key. The SPA is the bridge plus a
fiction-first UI, a GM console, and the housekeeping job runner — and the
tool-calling part is the smallest component, because the provider does the