mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 17:00:59 +00:00
- Remove old TUI implementation and components (LoadingAnimation, MarkdownComponent, TextComponent, TextEditor, WhitespaceComponent) - Rename components-new to components with new API (Loader, Markdown, Text, Editor, Spacer) - Move Text and Input components to separate files in src/components/ - Add render caching to Text component (similar to Markdown) - Add proper ANSI code handling in Text component using stripVTControlCharacters - Update coding-agent to use new TUI API (requires ProcessTerminal, uses custom Editor subclass for key handling) - Remove old test files, keep only chat-simple.ts and virtual-terminal.ts - Update README.md with new minimal API documentation - Switch from tsc to tsgo for type checking - Update package dependencies across monorepo |
||
|---|---|---|
| .. | ||
| src | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
@mariozechner/pi-proxy
CORS and authentication proxy for pi-ai. Enables browser clients to access OAuth-protected endpoints.
Usage
CORS Proxy
Zero-config CORS proxy for development:
# Run directly with tsx
npx tsx packages/proxy/src/cors-proxy.ts 3001
# Or use npm script
npm run dev -w @mariozechner/pi-proxy
# Or install globally and use CLI
npm install -g @mariozechner/pi-proxy
pi-proxy 3001
The proxy will forward requests to any URL:
// Instead of:
fetch('https://api.anthropic.com/v1/messages', { ... })
// Use:
fetch('http://localhost:3001?url=https://api.anthropic.com/v1/messages', { ... })
OAuth Integration
For Anthropic OAuth tokens, configure your client to use the proxy:
import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic({
apiKey: 'oauth_token_here',
baseURL: 'http://localhost:3001?url=https://api.anthropic.com'
});
Future Proxy Types
- BunnyCDN Edge Function: Deploy as edge function
- Managed Proxy: Self-hosted with provider key management and credential auth
- Cloudflare Worker: Deploy as CF worker
Architecture
The proxy:
- Accepts requests with
?url=<target>query parameter - Forwards all headers (except
host,origin) - Forwards request body for non-GET/HEAD requests
- Returns response with CORS headers enabled
- Strips CORS headers from upstream response
Development
npm install
npm run build
npm run check