thebird 1.2.93 → 1.2.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/app.js +7 -5
- package/docs/chat-providers.js +1 -0
- package/package.json +1 -1
package/docs/app.js
CHANGED
|
@@ -29,7 +29,7 @@ class BirdChat extends HTMLElement {
|
|
|
29
29
|
connectedCallback() {
|
|
30
30
|
this.render();
|
|
31
31
|
Object.assign(window.__debug, { acp: { baseUrl: this.state.baseUrl, provider: this.state.providerType } });
|
|
32
|
-
if (this.state.apiKey) this.loadModels();
|
|
32
|
+
if (this.state.apiKey || ['kilo','opencode','acp2openai'].includes(this.state.providerType)) this.loadModels();
|
|
33
33
|
this.statsTimer = setInterval(() => this.updateStats(), 250);
|
|
34
34
|
}
|
|
35
35
|
disconnectedCallback() { if (this.statsTimer) clearInterval(this.statsTimer); }
|
|
@@ -62,18 +62,20 @@ class BirdChat extends HTMLElement {
|
|
|
62
62
|
localStorage.setItem('provider_base_url', baseUrl);
|
|
63
63
|
localStorage.setItem('provider_model', model);
|
|
64
64
|
this.setState({ providerType: type, baseUrl, model, models: [], apiKey: localStorage.getItem('provider_api_key') || '' });
|
|
65
|
+
if (['kilo','opencode','acp2openai'].includes(type)) this.loadModels();
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
renderBaseUrlInput() {
|
|
68
69
|
const { providerType, baseUrl } = this.state;
|
|
69
|
-
if (providerType !== 'custom' && providerType !== 'kilo' && providerType !== 'opencode') return null;
|
|
70
|
-
const
|
|
70
|
+
if (providerType !== 'custom' && providerType !== 'kilo' && providerType !== 'opencode' && providerType !== 'acp2openai') return null;
|
|
71
|
+
const phMap = { kilo: 'http://localhost:4780', opencode: 'http://localhost:4790', acp2openai: 'http://localhost:4800/v1', custom: 'https://your-endpoint/v1' };
|
|
72
|
+
const ph = phMap[providerType] || phMap.custom;
|
|
71
73
|
return html`<input type="text" class="tui-input" style="flex:1;min-width:140px" placeholder=${ph} value=${baseUrl}
|
|
72
74
|
onchange=${e => { localStorage.setItem('provider_base_url', e.target.value); this.setState({ baseUrl: e.target.value }); }} />`;
|
|
73
75
|
}
|
|
74
76
|
renderApiKeyInput() {
|
|
75
77
|
const { providerType, apiKey } = this.state;
|
|
76
|
-
if (providerType === 'kilo' || providerType === 'opencode') return null;
|
|
78
|
+
if (providerType === 'kilo' || providerType === 'opencode' || providerType === 'acp2openai') return null;
|
|
77
79
|
const provDef = PROVIDERS[providerType] || PROVIDERS.custom;
|
|
78
80
|
return html`<input id="api-key-input" type="password" class="tui-input" style="flex:1;min-width:120px" placeholder=${provDef.keyPlaceholder} value=${apiKey}
|
|
79
81
|
onchange=${e => { const v = e.target.value.trim(); localStorage.setItem('provider_api_key', v); this.setState({ apiKey: v }); if (v) this.loadModels(); }} />`;
|
|
@@ -128,7 +130,7 @@ class BirdChat extends HTMLElement {
|
|
|
128
130
|
const text = input?.value.trim();
|
|
129
131
|
if (!text || this.state.streaming) return;
|
|
130
132
|
const { apiKey, model, providerType, baseUrl } = this.state;
|
|
131
|
-
if (!apiKey && providerType !== 'kilo' && providerType !== 'opencode') { this.setState({ status: 'Enter an API key above.' }); return; }
|
|
133
|
+
if (!apiKey && providerType !== 'kilo' && providerType !== 'opencode' && providerType !== 'acp2openai') { this.setState({ status: 'Enter an API key above.' }); return; }
|
|
132
134
|
input.value = '';
|
|
133
135
|
input.style.height = 'auto';
|
|
134
136
|
const normalizedMessages = [...this.state.messages, { role: 'user', content: text }].map(m => ({
|
package/docs/chat-providers.js
CHANGED
|
@@ -8,6 +8,7 @@ export const PROVIDERS = {
|
|
|
8
8
|
cerebras: { label: 'Cerebras', baseUrl: 'https://api.cerebras.ai/v1', keyPlaceholder: 'CEREBRAS_API_KEY', models: ['gpt-oss-120b', 'llama3.1-8b'] },
|
|
9
9
|
kilo: { label: 'Kilo Code', baseUrl: 'http://localhost:4780', keyPlaceholder: '(no key needed)', models: ['x-ai/grok-code-fast-1:optimized:free', 'kilo-auto/free', 'openrouter/free', 'stepfun/step-3.5-flash:free', 'nvidia/nemotron-3-super-120b-a12b:free', 'bytedance-seed/dola-seed-2.0-pro:free'] },
|
|
10
10
|
opencode: { label: 'opencode (zen)', baseUrl: 'http://localhost:4790', keyPlaceholder: '(needs opencode auth login)', models: ['minimax-m2.5-free', 'nemotron-3-super-free'] },
|
|
11
|
+
acp2openai: { label: 'acp2openai (OpenAI-compat)', baseUrl: 'http://localhost:4800/v1', keyPlaceholder: '(no key needed)', models: ['kilo/x-ai/grok-code-fast-1:optimized:free', 'kilo/kilo-auto/free', 'kilo/openrouter/free', 'opencode/minimax-m2.5-free'] },
|
|
11
12
|
custom: { label: 'Custom (OpenAI-compat)', baseUrl: '', keyPlaceholder: 'API_KEY', models: [] },
|
|
12
13
|
};
|
|
13
14
|
|
package/package.json
CHANGED