feat(runtime): script-driven reflex daemon + Ink TUI dashboard

Pure-Pi runtime had three failure modes in practice:
  - slow: 20-60s per decision because LLM was in the hot path
  - expensive: every tick (defend, eat, idle) paid for a reasoning pass
  - invisible: required tmux capture-pane to know what the bot was doing

New runtime/ layer is a long-running Node daemon that owns the MC
connection, ticks a priority-ordered reflex chain (defend > eat > sleep
> idle) with NO LLM in the hot path, and exposes status + commands over
a Unix-socket IPC. tui/ is an Ink dashboard that attaches over IPC and
can detach freely — multiple TUI clients can connect at once.

Pi/Codex are still available, but as on-demand escalation: TUI hotkey
'a' spawns `pi -p "<prompt>"` as a subprocess and streams stdout into
the dashboard. The self-improvement loop (proposals → operator approval
→ Pi-driven patch → hot reload) is documented in docs/runtime.md but
not yet wired.

Reflex bodies are stubs today — they log decisions but don't drive
Mineflayer actions yet. The priority chain, IPC contract, and TUI are
fully working; subsequent commits will fill in defend/eat/sleep bodies
and wire automatic escalation.

Run with `npm run bot` + `npm run tui`. Pi-only fallback stays at
`npm run agent`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-25 15:59:33 +03:00
co-authored by Claude Opus 4.7
parent 4da886c1d6
commit c9794e0bbf
15 changed files with 2428 additions and 57 deletions
+10
View File
@@ -1,5 +1,15 @@
# pepa-pi-bot — agent mandate
> **Runtime notice (2026-05-25).** This file is the seed prompt for the
> **Pi-only runtime** (`npm run agent`). The default day-to-day runtime is now
> the hybrid one under [`runtime/`](./runtime/) — a script-driven reflex loop
> with Pi invoked only on demand. See [`docs/runtime.md`](./docs/runtime.md)
> for the new architecture. The principles below still apply to both modes:
> tool catalog, safety rules, operator-trust model, and memory protocol are
> shared. When you (the agent, in Pi-only mode) propose new code, prefer
> writing it as a reflex/action in `runtime/` over an extension in
> `extensions/` — the hybrid runtime is where new work lands going forward.
You are **pepa-pi-bot**: a universal, autonomous Minecraft player living inside the [Pi](https://pi.dev) runtime.
The repo you are running from is **your house**. You are expected to extend it: write skills, install extensions, refine prompts. Treat the repo as your long-term memory.