Add Nocturne debug web UI, core process control, and web QR login

This commit is contained in:
Fisto
2026-09-13 15:47:47 +02:00
parent 4e1046fae7
commit 2bcd8c6d7a
16 changed files with 4806 additions and 198 deletions
+24 -9
View File
@@ -15,7 +15,7 @@ pnpm install
| Command | Purpose |
| --- | --- |
| `pnpm poc:qr` | QR login. Writes the token file. |
| `pnpm control:bridge` | Start the daemon. It listens on `http://127.0.0.1:8788/mcp`. |
| `pnpm control:bridge` | Start the daemon. MCP on `http://127.0.0.1:8788/mcp`, web UI on `http://0.0.0.0:8789/`. The web UI can start/stop the client and run QR login. |
| `pnpm control:mock` | Start the mock core. Test the daemon without Electron. |
| `pnpm test:trigger` | Inject a trigger event into the mock core. |
| `pnpm poc:dm` | Send one test DM to zzib. |
@@ -36,9 +36,11 @@ core-side guardrails. Use it for debugging only.
## Pacing
Every command gets a random delay of 500 to 2800 ms. One queue serializes the commands. The queue
coalesces identical concurrent reads. State reads use the cache. `DEBUG=1` logs each command and
its delay.
Outbound sends use a human-emulation policy: the first send of a burst waits 30 to 200 ms, later
sends wait 500 to 2800 ms, and a burst ends after a random 5 to 20 seconds of quiet. Read queries
are serialized with a 100 to 300 ms gap and do not reset the burst. One queue serializes
everything. The queue coalesces identical concurrent reads. State reads use the cache. `DEBUG=1`
logs each command and its delay. See [../docs/daemon.md](../docs/daemon.md).
## Live test target
@@ -50,12 +52,25 @@ The only permitted live-send target is user zzib. See
- QR login works end-to-end. The token came from a phone scan.
- The core bridge works live. `get_state` returned the real account and 7 guilds. `send_dm` reached
zzib. A synthetic owner message reached the daemon log with the command parsed.
- The mock path works. The daemon handles state, sends, commands, tiers, continuation, polls,
context, and the action log.
- Pacing stayed inside the 500 to 2800 ms window.
- The mock path works. The daemon handles state, sends, commands, tiers, continuation, user search,
voice state, context, and the action log.
- The web UI API and the SSE stream work against the mock core.
- The web UI follows the Nocturne design handoff (`WebUIMockup.zip`). The 7a shell, the
locked/unlocked composer, the console drawer, and the Settings slide-over were verified by
rendering the page headless in Electron under Xvfb.
- Core process control works live: the web UI start spawned the client under auto-Xvfb, the bridge
connected, `state.get` returned the real account and guilds, and stop exited with code 0.
Electron needs `libasound2`; Xvfb is auto-started when `DISPLAY` is unset.
- The QR login session reaches `pending` with a scannable QR against the real gateway, and cancels
cleanly. A full approval was not run in this environment.
- Pacing follows the burst policy: 30-200 ms for the first send, 500-2800 ms afterwards.
Open live item: `reaction.add` and the message ID return are mock-verified only. The first live run
must confirm Discord's internal `addReaction` lookup.
Open live items:
- `reaction.add` and the message ID return are mock-verified only. The first live run must confirm
Discord's internal `addReaction` lookup.
- `user.search`, `voice.overview`, and `VOICE_STATE_UPDATE` are mock-verified only.
- Voice join, leave, and move are not implemented.
## Findings