M-Obs 1: Event bus in @shade/core - ShadeEventEmitter with typed event union, ring buffer for replay - 12 event types covering session lifecycle, ratchet operations, prekey changes, identity rotation, trust changes - Wired into ShadeSessionManager (zero overhead when not enabled) - shortHash helper for safe display of public keys - Security test: regex-checks event payloads contain no key material M-Obs 2: Prekey server event hooks - PrekeyServerEvents emitter mirroring core's pattern - 5 server event types: registered, fetched, replenished, deleted, rate_limited - Wired into all routes including the rate-limit error handler - shortHash helper using crypto.subtle directly (no provider dep) M-Obs 3: @shade/observer package - StateAggregator subscribes to client + server events, builds rolling snapshot - Hono routes: GET /api/state (snapshot), GET /api/events (SSE stream) - Bearer token auth via SHADE_OBSERVER_TOKEN, query string for SSE - Refuses to start with token < 16 chars (ConfigurationError) - Static file serving for bundled dashboard at /dashboard/ - Placeholder dashboard renders when no built SPA present 220 tests passing, 0 failures. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
16 lines
312 B
JSON
16 lines
312 B
JSON
{
|
|
"name": "@shade/observer",
|
|
"version": "0.1.0",
|
|
"type": "module",
|
|
"main": "src/index.ts",
|
|
"types": "src/index.ts",
|
|
"dependencies": {
|
|
"@shade/core": "workspace:*",
|
|
"@shade/server": "workspace:*",
|
|
"hono": "^4.12.12"
|
|
},
|
|
"devDependencies": {
|
|
"@shade/crypto-web": "workspace:*"
|
|
}
|
|
}
|