mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 17:01:02 +00:00
Add Anthropic prompt caching, pluggable storage, and CORS proxy support
Storage Architecture:
- New pluggable storage system with backends (LocalStorage, ChromeStorage, IndexedDB)
- SettingsRepository for app settings (proxy config, etc.)
- ProviderKeysRepository for API key management
- AppStorage with global accessors (getAppStorage, setAppStorage, initAppStorage)
Transport Refactoring:
- Renamed DirectTransport → ProviderTransport (calls LLM providers with optional CORS proxy)
- Renamed ProxyTransport → AppTransport (uses app server with user auth)
- Updated TransportMode: "direct" → "provider", "proxy" → "app"
CORS Proxy Integration:
- ProviderTransport checks proxy.enabled/proxy.url from storage
- When enabled, modifies model baseUrl to route through proxy: {proxyUrl}/?url={originalBaseUrl}
- ProviderKeyInput test function also honors proxy settings
- Settings dialog with Proxy tab (Switch toggle, URL input, explanatory description)
Anthropic Prompt Caching:
- System prompt cached with cache_control markers (both OAuth and regular API keys)
- Last user message cached to cache conversation history
- Saves 90% on input tokens for cached content (10x cost reduction)
Settings Dialog Improvements:
- Configurable tab system with SettingsTab base class
- ApiKeysTab and ProxyTab as custom elements
- Switch toggle for proxy enable (instead of Checkbox)
- Explanatory paragraphs for each tab
- ApiKeyPromptDialog reuses ProviderKeyInput component
Removed:
- Deprecated ApiKeysDialog (replaced by ProviderKeyInput in SettingsDialog)
- Old storage-adapter and key-store (replaced by new storage architecture)
This commit is contained in:
parent
66f092c0c6
commit
0496651308
31 changed files with 1141 additions and 488 deletions
11
package-lock.json
generated
11
package-lock.json
generated
|
|
@ -11,7 +11,8 @@
|
|||
"packages/*"
|
||||
],
|
||||
"dependencies": {
|
||||
"@mariozechner/jailjs": "^0.1.1"
|
||||
"@mariozechner/jailjs": "^0.1.1",
|
||||
"@mariozechner/mini-lit": "^0.1.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^2.1.4",
|
||||
|
|
@ -816,9 +817,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@mariozechner/mini-lit": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@mariozechner/mini-lit/-/mini-lit-0.1.7.tgz",
|
||||
"integrity": "sha512-P77V7xTaJrc3mocG7wWtxFrhidkBGirD0hRq0aFWpOf+lpjFinkMCnzgY3uB2HcngajDDJpZk5OlvNl+SoiHaw==",
|
||||
"version": "0.1.8",
|
||||
"resolved": "https://registry.npmjs.org/@mariozechner/mini-lit/-/mini-lit-0.1.8.tgz",
|
||||
"integrity": "sha512-7jG0ESWq7emYgyp2xj7osN+DLXGfFkepPZE0nRCoIc7idLXWAGumSz/k7cZxoNyb50iVUGdVzT3rZPr8HtGClw==",
|
||||
"dependencies": {
|
||||
"@preact/signals-core": "^1.12.1",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
|
|
@ -5516,7 +5517,7 @@
|
|||
"version": "0.5.43",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@mariozechner/mini-lit": "^0.1.7",
|
||||
"@mariozechner/mini-lit": "^0.1.8",
|
||||
"@mariozechner/pi-ai": "^0.5.43",
|
||||
"docx-preview": "^0.3.7",
|
||||
"jszip": "^3.10.1",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue