plugins/ppq/vendor/ppq-private-mode/lib architecture
Implements the private-mode proxy, Anthropic/OpenAI protocol translation, secure backend routing, persistent API-key configuration, attestation handling, and the local status page.
Architectural role
Runtime implementation boundary of the pinned vendored proxy for the local v0.1.0 candidate. Release maintenance here should verify that exposed ai-model-source v1 behavior matches package metadata and documentation while keeping first-party orchestration outside the vendor boundary; publication remains blocked pending funded live-flow verification.
Source map
anthropic.ts— Exports Anthropic request types, request/response translators, process-local message ID generation, and a stateful OpenAI-SSE-to-Anthropic-SSE translator that buffers tool calls, maps usage and stop reasons, and emits explicit stream errors.proxy.ts— Exports proxy contracts and implements a host- and origin-restricted local OpenAI/Anthropic gateway with persistent configured credentials, published-PCR attestation resolution, private-model routing across encrypted backends, response translation, and dialect-specific streaming errors.statusPage.ts— Exports status-page state and an HTML renderer that escapes dynamic values, displays attestation and model information, never echoes the stored key, and conditionally submits API-key setup requests when persistence is enabled.
Integration details
anthropic.ts— Protocol-compatibility layer whose translation and streaming behavior forms part of the vendored implementation evidence for ai-model-source v1 capability alignment.proxy.ts— Primary vendored runtime boundary and key release-audit surface for confirming that documented routing, credential, attestation, and model-source behavior matches the v0.1.0 implementation without introducing first-party orchestration.statusPage.ts— Local operational visibility and credential-setup surface supporting release verification while preserving the proxy's security boundary.