Wire validated core bridge, migrate daemon to it, verify live

This commit is contained in:
Fisto
2026-09-11 14:15:03 +02:00
parent e62d3007d8
commit 7d6650ce4e
27 changed files with 754 additions and 266 deletions
+21 -16
View File
@@ -6,29 +6,27 @@ The daemon runs outside Vesktop. It holds all logic. It talks to the core bridge
| File | Role | Status |
| --- | --- | --- |
| `poc/src/control-bridge.ts` | MCP server, tool list, health endpoint | Implemented on CDP |
| `poc/src/control-bridge.ts` | MCP server, tool list, health endpoint | Implemented |
| `poc/src/puppet.ts` | Trust list, command handling, trigger log | Implemented |
| `poc/src/communication.ts` | Pure log and parser logic | Implemented |
| `poc/src/pacing.ts` | Paced queue and query coalescing | Implemented |
| `poc/src/cdp-client.ts` | Chrome DevTools Protocol client | Implemented (current transport) |
| `poc/src/discord.ts` | Client actions over CDP | Implemented (current transport) |
| `poc/src/core-client.ts` | Client actions over the core bridge | Pending (target transport) |
| `poc/src/core-client.ts` | Client actions over the core bridge | Implemented (primary transport) |
| `poc/src/cdp-client.ts` | Chrome DevTools Protocol client | Development fallback |
| `poc/src/qr-login.ts` | Terminal QR login | Implemented and verified |
| `poc/src/test-communication.ts` | Unit tests for the pure logic | Implemented |
| `poc/src/cdp-probe.ts` | CDP feasibility probe | Implemented (dev tool) |
| `poc/src/mock-core.ts` | Mock core bridge for daemon tests | Implemented |
| `poc/src/test-trigger.ts` | Inject a trigger event into the mock core | Implemented |
| `poc/src/cdp-probe.ts` | CDP feasibility probe | Development tool |
| `poc/src/cdp-dispatch.ts` | Run one CDP expression in the client | Development tool |
## Transport
The daemon supports two transports.
The primary transport is the validated core bridge. The daemon connects to
`vesktop-puppet.sock`. All actions go through the validated capability layer. See
[core-bridge.md](core-bridge.md).
1. **CDP (current)** — the daemon starts Vesktop with `--remote-debugging-port=9222`. The daemon
connects to the Discord page target. It evaluates the action code in the page and receives
events through a CDP binding. This transport needs no Vesktop patch. The project used it to
prove the concept and to test the client.
2. **Core bridge (target)** — the daemon connects to `vesktop-puppet.sock`. All actions go through
the validated capability layer. This transport gives the core-side guardrails.
The daemon logic is the same on both transports. Only the client class changes.
The CDP transport is a development fallback. It needs no Vesktop patch. It evaluates raw code in
the page, so it has no core-side guardrails. Use it for debugging only.
## Pacing
@@ -56,17 +54,24 @@ The daemon exposes MCP over Streamable HTTP. The default address is `http://127.
## Run commands
```sh
# Start the daemon. It connects to the client on CDP port 9222.
# Start the daemon. It connects to the core bridge.
pnpm control:bridge
# Start a mock core for tests without Electron.
VESKSLOP_SOCKET=/tmp/vesktop-puppet-mock.sock pnpm control:mock
# Inject a trigger event into the mock core.
VESKSLOP_SOCKET=/tmp/vesktop-puppet-mock.sock pnpm test:trigger
# Send one test DM. The only permitted live target is zzib.
pnpm poc:dm
# Run the pure-logic unit tests.
pnpm test:comm
# Probe CDP access and events.
# Development tools for the CDP fallback.
pnpm cdp:probe
CDP_EXPRESSION='...' pnpm cdp:dispatch
```
## Health endpoint