krnell 3.0.0 → 3.0.3

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.
@@ -94,6 +94,9 @@ const MODELS = [
94
94
  endpoint: 'kimi-k3_1-pro',
95
95
  fnId: 'b79234a1-64e1-479e-87e7-1c8e3af74262',
96
96
  pageUrl: 'https://build.nvidia.com/moonshotai/kimi-k3_1-pro/playground',
97
+ tiers: ['low', 'medium', 'high', 'max'],
98
+ vision: true,
99
+ inputs: ['text', 'image'],
97
100
  },
98
101
  {
99
102
  id: 'minimax-m3.1-flash',
@@ -102,6 +105,9 @@ const MODELS = [
102
105
  endpoint: 'minimax-m3.1-flash',
103
106
  fnId: 'eb8265c4-e47d-4047-918d-c12746cc2cee',
104
107
  pageUrl: 'https://build.nvidia.com/minimaxai/minimax-m3.1-flash/playground',
108
+ tiers: ['low', 'medium', 'high', 'max'],
109
+ vision: true,
110
+ inputs: ['text', 'image'],
105
111
  },
106
112
  ];
107
113
 
@@ -661,7 +667,7 @@ function installOpencodePlugin(cfgDir) {
661
667
  } else if (fs.existsSync(dst)) {
662
668
  installedDir = dstDir;
663
669
  }
664
- // Se o usuario colocou um AGENTS.md junto com a pasta da bridge (ou na raiz do nyxo) e ainda nao
670
+ // Se o usuario colocou um AGENTS.md junto com a pasta da bridge (ou na raiz do krnell) e ainda nao
665
671
  // existe AGENTS.md no OpenCode, copia automaticamente sem sobrescrever.
666
672
  const promptCandidates = [
667
673
  path.join(APP_DIR, 'AGENTS.md'),
@@ -1394,7 +1400,18 @@ function isSummaryRequest(messages) {
1394
1400
  }
1395
1401
 
1396
1402
  function toUpstream(body, model = MODELS[0]) {
1397
- const reasoning = REASONING_LEVELS.has(body.reasoning_effort) ? body.reasoning_effort : CFG.reasoning;
1403
+ const allowed = Array.isArray(model.tiers) && model.tiers.length ? model.tiers : ['low', 'medium', 'high', 'max'];
1404
+ const rawEffort = String(body.reasoning_effort || '').trim().toLowerCase();
1405
+ if (rawEffort && !allowed.includes(rawEffort)) {
1406
+ const err = new Error(
1407
+ `O modelo ${model.id} não suporta reasoning_effort="${rawEffort}". ` +
1408
+ `Níveis aceitos: ${allowed.join(', ')}.`
1409
+ );
1410
+ err.status = 400;
1411
+ err.code = 'unsupported_reasoning_effort';
1412
+ throw err;
1413
+ }
1414
+ const reasoning = rawEffort || (allowed.includes(CFG.reasoning) ? CFG.reasoning : allowed[allowed.length - 1]);
1398
1415
  let maxTokens = Math.min(Math.max(Number(body.max_tokens ?? body.max_completion_tokens) || CFG.maxTokens, 1), 65536);
1399
1416
 
1400
1417
  const tools = Array.isArray(body.tools) && body.tools.length && body.tool_choice !== 'none' ? body.tools : null;
@@ -1743,8 +1760,9 @@ function agRuntime(acct) {
1743
1760
  if (!rt) {
1744
1761
  rt = {
1745
1762
  refreshing: null,
1763
+ discovering: null,
1746
1764
  lastDiscoverAt: 0,
1747
- quota: { at: 0, models: {}, groups: [], description: null, defaultModel: null, error: null },
1765
+ quota: { at: 0, summaryAt: 0, summaryError: null, models: {}, groups: [], description: null, defaultModel: null, error: null },
1748
1766
  cooldowns: new Map(), // bucket/wire -> { until, resetTime, reason }
1749
1767
  };
1750
1768
  AG_RT.set(id, rt);
@@ -2062,7 +2080,7 @@ function agAccountAvailability(acct, model, wire) {
2062
2080
  return { exhausted: true, until: resetMs, resetTime: mq.resetTime, reason: 'quota_0', remainingFraction: 0 };
2063
2081
  }
2064
2082
  // Reset ja passou: dispara atualizacao em background e libera a conta!
2065
- agDiscoverAccount(acct, true).catch(() => {});
2083
+ agDiscoverAccount(acct, false).catch(() => {});
2066
2084
  }
2067
2085
  }
2068
2086
 
@@ -2076,7 +2094,7 @@ function agAccountAvailability(acct, model, wire) {
2076
2094
  if (resetMs > now) {
2077
2095
  return { exhausted: true, until: resetMs, resetTime: b.resetTime, reason: `group_${b.window || 'quota'}_0`, remainingFraction: 0 };
2078
2096
  }
2079
- agDiscoverAccount(acct, true).catch(() => {});
2097
+ agDiscoverAccount(acct, false).catch(() => {});
2080
2098
  }
2081
2099
  }
2082
2100
  }
@@ -2162,7 +2180,7 @@ function agTrackUsage(wire, usage, acct = null) {
2162
2180
  }
2163
2181
 
2164
2182
  function agQuotaView(acct = agActiveAccount()) {
2165
- const qState = acct ? agRuntime(acct).quota : { at: 0, models: {}, groups: [], description: null, defaultModel: null, error: null };
2183
+ const qState = acct ? agRuntime(acct).quota : { at: 0, summaryAt: 0, summaryError: null, models: {}, groups: [], description: null, defaultModel: null, error: null };
2166
2184
  const now = Date.now();
2167
2185
  const formatBucket = (b) => {
2168
2186
  const resetSec = b.resetTime ? Math.max(0, Math.round((Date.parse(b.resetTime) - now) / 1000)) : null;
@@ -2214,6 +2232,8 @@ function agQuotaView(acct = agActiveAccount()) {
2214
2232
  }
2215
2233
  return {
2216
2234
  checkedAt: qState.at ? new Date(qState.at).toISOString() : null,
2235
+ summaryAt: qState.summaryAt ? new Date(qState.summaryAt).toISOString() : null,
2236
+ summaryError: qState.summaryError || null,
2217
2237
  error: qState.error,
2218
2238
  defaultModel: qState.defaultModel,
2219
2239
  description: qState.description,
@@ -2224,14 +2244,16 @@ function agQuotaView(acct = agActiveAccount()) {
2224
2244
  }
2225
2245
 
2226
2246
  const AG_TIER_ORDER = ['low', 'medium', 'high', 'xhigh', 'max'];
2227
- function agTier(effort, tiers) {
2247
+ function agTier(effort, tiers, modelId = '') {
2228
2248
  const list = Array.isArray(tiers) && tiers.length ? tiers : ['high'];
2229
2249
  if (list.includes(effort)) return effort;
2230
- // max <-> xhigh: cada familia usa um nome para o topo. Se o topo pedido
2231
- // nao existe, cai no mais alto que a familia serve.
2232
- const top = list[list.length - 1];
2233
- if (effort === 'max' || effort === 'xhigh') return top;
2234
- return list.includes('high') ? 'high' : top;
2250
+ const err = new Error(
2251
+ `O modelo ${modelId || 'Antigravity'} não suporta reasoning_effort="${effort}". ` +
2252
+ `Níveis aceitos: ${list.join(', ')}.`
2253
+ );
2254
+ err.status = 400;
2255
+ err.code = 'unsupported_reasoning_effort';
2256
+ throw err;
2235
2257
  }
2236
2258
 
2237
2259
  async function agRefreshPlanAccount(acct) {
@@ -2254,11 +2276,9 @@ async function agRefreshPlanAccount(acct) {
2254
2276
  } catch {}
2255
2277
  }
2256
2278
 
2257
- async function agDiscoverAccount(acct, force = true) {
2279
+ async function agDiscoverAccountRemote(acct) {
2258
2280
  if (!acct || (!acct.accessToken && !acct.refreshToken)) return;
2259
2281
  const rt = agRuntime(acct);
2260
- if (!force && Date.now() - rt.lastDiscoverAt < 30000) return;
2261
- rt.lastDiscoverAt = Date.now();
2262
2282
  const tag = acct.email || acct.id;
2263
2283
  let tok;
2264
2284
  try {
@@ -2317,7 +2337,13 @@ async function agDiscoverAccount(acct, force = true) {
2317
2337
  const qs = JSON.parse(await summaryRes.text());
2318
2338
  rt.quota.groups = Array.isArray(qs.groups) ? qs.groups : [];
2319
2339
  rt.quota.description = qs.description || null;
2320
- } catch {}
2340
+ rt.quota.summaryAt = Date.now();
2341
+ rt.quota.summaryError = null;
2342
+ } catch (e) {
2343
+ rt.quota.summaryError = `retrieveUserQuotaSummary JSON: ${e.message}`;
2344
+ }
2345
+ } else {
2346
+ rt.quota.summaryError = summaryRes.err ? summaryRes.err.message : `retrieveUserQuotaSummary ${summaryRes.status}`;
2321
2347
  }
2322
2348
 
2323
2349
  for (const m of MODELS.filter((x) => x.provider === 'antigravity')) {
@@ -2344,6 +2370,26 @@ async function agDiscoverAccount(acct, force = true) {
2344
2370
  }
2345
2371
  }
2346
2372
 
2373
+ async function agDiscoverAccount(acct, force = true) {
2374
+ if (!acct || (!acct.accessToken && !acct.refreshToken)) return;
2375
+ const rt = agRuntime(acct);
2376
+ if (rt.discovering) return rt.discovering;
2377
+ if (!force && Date.now() - rt.lastDiscoverAt < 5000) return;
2378
+ rt.discovering = (async () => {
2379
+ try {
2380
+ await agDiscoverAccountRemote(acct);
2381
+ } catch (e) {
2382
+ rt.quota.error = e.message;
2383
+ log(`antigravity[${acct.email || acct.id}]: descoberta falhou:`, e.message);
2384
+ } finally {
2385
+ // TTL contado do fim: upstream lento não gera descobertas em sequência.
2386
+ rt.lastDiscoverAt = Date.now();
2387
+ rt.discovering = null;
2388
+ }
2389
+ })();
2390
+ return rt.discovering;
2391
+ }
2392
+
2347
2393
  async function agDiscover(force = true) {
2348
2394
  await Promise.all(agStore.accounts.map((a) => agDiscoverAccount(a, force)));
2349
2395
  }
@@ -2750,9 +2796,14 @@ function agUsage(um) {
2750
2796
 
2751
2797
  function agResolveWire(body, model) {
2752
2798
  const fromName = extractTierFromModelName(body.model, model);
2753
- const rawEffort = String(body.reasoning_effort || fromName || '').toLowerCase();
2754
- const effort = AG_TIER_ORDER.includes(rawEffort) ? rawEffort : String(CFG.reasoning || 'high').toLowerCase();
2755
- const tier = agTier(effort, model.tiers);
2799
+ const explicitRaw = String(body.reasoning_effort || fromName || '').trim().toLowerCase();
2800
+ const list = Array.isArray(model.tiers) && model.tiers.length ? model.tiers : ['high'];
2801
+ if (explicitRaw) {
2802
+ const tier = agTier(explicitRaw, list, model.id);
2803
+ return { tier, wire: `${model.wire}-${tier}` };
2804
+ }
2805
+ const def = String(CFG.reasoning || '').toLowerCase();
2806
+ const tier = list.includes(def) ? def : list[list.length - 1];
2756
2807
  return { tier, wire: `${model.wire}-${tier}` };
2757
2808
  }
2758
2809
 
@@ -2961,7 +3012,7 @@ async function agCallForAccount(acct, model, envelope, signal, hasMoreAccounts =
2961
3012
  if (hardQuota || n >= maxRetries) {
2962
3013
  const until = parsedReset || (hardQuota ? Date.now() + 10 * 60 * 1000 : Date.now() + 60 * 1000);
2963
3014
  agMarkCooldown(acct, model, envelope.model, until, hardQuota ? 'hard_429' : 'soft_429');
2964
- agDiscoverAccount(acct, true).catch(() => {});
3015
+ agDiscoverAccount(acct, false).catch(() => {});
2965
3016
  log(`antigravity[${tag}]: 429 para ${envelope.model} (hardQuota=${hardQuota}, tentativas=${n}, failover=${hasMoreAccounts}): ${t.slice(0, 200)}`);
2966
3017
  return { ok: false, status: 429, failover: hasMoreAccounts, resetUntil: until, errorText: t || 'Quota exhausted (429)' };
2967
3018
  }
@@ -3226,7 +3277,14 @@ async function handleAntigravityChat(body, model, res, reqAbort, preferredHint =
3226
3277
  });
3227
3278
  }
3228
3279
 
3229
- const { wire } = agResolveWire(body, model);
3280
+ let wire;
3281
+ try {
3282
+ ({ wire } = agResolveWire(body, model));
3283
+ } catch (e) {
3284
+ return sendJson(e.status || 400, {
3285
+ error: { message: e.message, type: 'invalid_request_error', code: e.code || 'unsupported_reasoning_effort' },
3286
+ });
3287
+ }
3230
3288
  let { available, exhausted } = agSelectAccounts(model, wire, preferredHint);
3231
3289
 
3232
3290
  // Se todas as contas constam sem quota, reconsulta uma vez o upstream caso
@@ -4016,7 +4074,10 @@ const server = http.createServer(async (req, res) => {
4016
4074
  }
4017
4075
  // Retrato da cota: remainingFraction/resetTime por modelo e por conta.
4018
4076
  if (req.method === 'GET' && url.pathname === '/antigravity/quota') {
4019
- if (agLogged()) await agDiscover(true);
4077
+ if (agLogged()) {
4078
+ if (url.searchParams.get('refresh') === '1') await agDiscover(true);
4079
+ else agDiscover(false).catch(() => {}); // stale-while-revalidate: HTTP local nunca espera upstream
4080
+ }
4020
4081
  const active = agActiveAccount();
4021
4082
  return json(200, {
4022
4083
  quota: agQuotaView(active),
@@ -4037,6 +4098,7 @@ const server = http.createServer(async (req, res) => {
4037
4098
  pruneExpiredTokens();
4038
4099
  return json(200, {
4039
4100
  ok: true,
4101
+ pid: process.pid,
4040
4102
  ready: state.ready,
4041
4103
  tokens: state.tokens,
4042
4104
  lastError: state.lastError,
@@ -4096,7 +4158,14 @@ const server = http.createServer(async (req, res) => {
4096
4158
  const preferredHint = acctHdr || (/^bearer\s+ag:/i.test(authHdr) ? authHdr : '');
4097
4159
  return await handleAntigravityChat(body, model, res, reqAbort, preferredHint);
4098
4160
  }
4099
- const { payload, trim, compact } = toUpstream(body, model);
4161
+ let payload, trim, compact;
4162
+ try {
4163
+ ({ payload, trim, compact } = toUpstream(body, model));
4164
+ } catch (e) {
4165
+ return json(e.status || 400, {
4166
+ error: { message: e.message, type: 'invalid_request_error', code: e.code || 'unsupported_reasoning_effort' },
4167
+ });
4168
+ }
4100
4169
  const id = rid();
4101
4170
  const t0 = Date.now();
4102
4171
  log(
@@ -4258,7 +4327,7 @@ server.listen(CFG.port, CFG.host, async () => {
4258
4327
  await setupOpencode();
4259
4328
  await installAutostart();
4260
4329
  } else {
4261
- log('modo supervisionado pelo nyxo (setupOpencode/installAutostart gerenciados pelo painel)');
4330
+ log('modo supervisionado pelo krnell (setupOpencode/installAutostart gerenciados pelo painel)');
4262
4331
  }
4263
4332
  // O navegador leve (headless_shell) sobe sob demanda na primeira chamada
4264
4333
  // NVIDIA e hiberna automaticamente apos browserIdleCloseMs sem uso (0 MB RAM
@@ -1,155 +1,27 @@
1
- """Catálogo de provedores padrão (estilo /connect do OpenCode) para o Nyxo.
2
-
3
- Cada preset define:
4
- - slug: identificador interno salvo em config.json ("provedores")
5
- - nome: rótulo exibido no /connect
6
- - base_url: endpoint OpenAI-compatible
7
- - modelo_padrao: sugestão inicial de modelo ao ativar
8
- - detalhe: resumo curto exibido à direita no diálogo /connect
9
- """
1
+ """Catálogo minimalista de provedores (estilo /connect do OpenCode)."""
10
2
  from __future__ import annotations
11
3
 
12
4
  PROVEDORES_API_PRESETS: list[dict[str, str]] = [
13
- {
14
- 'slug': 'openai',
15
- 'nome': 'OpenAI (API / ChatGPT)',
16
- 'base_url': 'https://api.openai.com/v1',
17
- 'modelo_padrao': 'gpt-5',
18
- 'detalhe': 'GPT-5, Codex, o3 · cole sua API key',
19
- },
20
- {
21
- 'slug': 'anthropic',
22
- 'nome': 'Anthropic (Claude API)',
23
- 'base_url': 'https://api.anthropic.com/v1',
24
- 'modelo_padrao': 'claude-sonnet-4-5',
25
- 'detalhe': 'Claude Sonnet / Opus · cole sua API key',
26
- },
27
- {
28
- 'slug': 'openrouter',
29
- 'nome': 'OpenRouter',
30
- 'base_url': 'https://openrouter.ai/api/v1',
31
- 'modelo_padrao': 'deepseek/deepseek-r1:free',
32
- 'detalhe': '300+ modelos (incluindo free) · API key',
33
- },
34
- {
35
- 'slug': 'google',
36
- 'nome': 'Google Gemini API',
37
- 'base_url': 'https://generativelanguage.googleapis.com/v1beta/openai',
38
- 'modelo_padrao': 'gemini-2.5-pro',
39
- 'detalhe': 'Gemini 2.5 Pro/Flash · AI Studio key',
40
- },
41
- {
42
- 'slug': 'deepseek',
43
- 'nome': 'DeepSeek API',
44
- 'base_url': 'https://api.deepseek.com/v1',
45
- 'modelo_padrao': 'deepseek-reasoner',
46
- 'detalhe': 'DeepSeek R1 / V3 · API key',
47
- },
48
- {
49
- 'slug': 'xai',
50
- 'nome': 'xAI (Grok)',
51
- 'base_url': 'https://api.x.ai/v1',
52
- 'modelo_padrao': 'grok-3',
53
- 'detalhe': 'Grok 3 / Mini · API key',
54
- },
55
- {
56
- 'slug': 'groq',
57
- 'nome': 'Groq (ultra-rápido)',
58
- 'base_url': 'https://api.groq.com/openai/v1',
59
- 'modelo_padrao': 'llama-3.3-70b-versatile',
60
- 'detalhe': 'Llama / Qwen / DeepSeek · API key',
61
- },
62
- {
63
- 'slug': 'mistral',
64
- 'nome': 'Mistral AI',
65
- 'base_url': 'https://api.mistral.ai/v1',
66
- 'modelo_padrao': 'mistral-large-latest',
67
- 'detalhe': 'Mistral Large / Codestral · API key',
68
- },
69
- {
70
- 'slug': 'nvidia_api',
71
- 'nome': 'NVIDIA NIM (API oficial)',
72
- 'base_url': 'https://integrate.api.nvidia.com/v1',
73
- 'modelo_padrao': 'moonshotai/kimi-k3.1-pro',
74
- 'detalhe': 'integrate.api.nvidia.com · API key',
75
- },
76
- {
77
- 'slug': 'moonshot',
78
- 'nome': 'Moonshot AI (Kimi API)',
79
- 'base_url': 'https://api.moonshot.ai/v1',
80
- 'modelo_padrao': 'kimi-k2-thinking',
81
- 'detalhe': 'Kimi oficial · API key',
82
- },
83
- {
84
- 'slug': 'cerebras',
85
- 'nome': 'Cerebras',
86
- 'base_url': 'https://api.cerebras.ai/v1',
87
- 'modelo_padrao': 'llama-3.3-70b',
88
- 'detalhe': 'Inferência ultrarrápida · API key',
89
- },
90
- {
91
- 'slug': 'together',
92
- 'nome': 'Together AI',
93
- 'base_url': 'https://api.together.xyz/v1',
94
- 'modelo_padrao': 'deepseek-ai/DeepSeek-R1',
95
- 'detalhe': 'Modelos open-weights · API key',
96
- },
97
- {
98
- 'slug': 'fireworks',
99
- 'nome': 'Fireworks AI',
100
- 'base_url': 'https://api.fireworks.ai/inference/v1',
101
- 'modelo_padrao': 'accounts/fireworks/models/deepseek-r1',
102
- 'detalhe': 'Inferência baixa latência · API key',
103
- },
104
- {
105
- 'slug': 'perplexity',
106
- 'nome': 'Perplexity',
107
- 'base_url': 'https://api.perplexity.ai',
108
- 'modelo_padrao': 'sonar-pro',
109
- 'detalhe': 'Sonar busca web · API key',
110
- },
111
- {
112
- 'slug': 'siliconflow',
113
- 'nome': 'SiliconFlow',
114
- 'base_url': 'https://api.siliconflow.cn/v1',
115
- 'modelo_padrao': 'deepseek-ai/DeepSeek-R1',
116
- 'detalhe': 'DeepSeek / Qwen · API key',
117
- },
118
- {
119
- 'slug': 'zhipuai',
120
- 'nome': 'Zhipu AI (GLM)',
121
- 'base_url': 'https://open.bigmodel.cn/api/paas/v4',
122
- 'modelo_padrao': 'glm-4-plus',
123
- 'detalhe': 'GLM-4 / CodeGeeX · API key',
124
- },
125
- {
126
- 'slug': 'minimax_api',
127
- 'nome': 'MiniMax API',
128
- 'base_url': 'https://api.minimax.io/v1',
129
- 'modelo_padrao': 'MiniMax-M1',
130
- 'detalhe': 'MiniMax oficial · API key',
131
- },
132
- {
133
- 'slug': 'cometapi',
134
- 'nome': 'CometAPI',
135
- 'base_url': 'https://api.cometapi.com/v1',
136
- 'modelo_padrao': 'gpt-4o',
137
- 'detalhe': 'Agregador multi-modelo · API key',
138
- },
139
- {
140
- 'slug': 'venice',
141
- 'nome': 'Venice AI',
142
- 'base_url': 'https://api.venice.ai/api/v1',
143
- 'modelo_padrao': 'llama-3.3-70b',
144
- 'detalhe': 'Privacidade / sem filtro · API key',
145
- },
146
- {
147
- 'slug': 'ollama',
148
- 'nome': 'Ollama (local · sem chave)',
149
- 'base_url': 'http://127.0.0.1:11434/v1',
150
- 'modelo_padrao': 'llama3.2',
151
- 'detalhe': 'Modelos locais em 127.0.0.1:11434',
152
- },
5
+ {'slug': 'openai', 'nome': 'OpenAI', 'base_url': 'https://api.openai.com/v1', 'modelo_padrao': 'gpt-5', 'detalhe': 'API key'},
6
+ {'slug': 'anthropic', 'nome': 'Anthropic', 'base_url': 'https://api.anthropic.com/v1', 'modelo_padrao': 'claude-sonnet-4-5', 'detalhe': 'API key'},
7
+ {'slug': 'openrouter', 'nome': 'OpenRouter', 'base_url': 'https://openrouter.ai/api/v1', 'modelo_padrao': 'deepseek/deepseek-r1:free', 'detalhe': 'API key'},
8
+ {'slug': 'google', 'nome': 'Google Gemini', 'base_url': 'https://generativelanguage.googleapis.com/v1beta/openai', 'modelo_padrao': 'gemini-2.5-pro', 'detalhe': 'API key'},
9
+ {'slug': 'deepseek', 'nome': 'DeepSeek', 'base_url': 'https://api.deepseek.com/v1', 'modelo_padrao': 'deepseek-reasoner', 'detalhe': 'API key'},
10
+ {'slug': 'xai', 'nome': 'xAI', 'base_url': 'https://api.x.ai/v1', 'modelo_padrao': 'grok-3', 'detalhe': 'API key'},
11
+ {'slug': 'groq', 'nome': 'Groq', 'base_url': 'https://api.groq.com/openai/v1', 'modelo_padrao': 'llama-3.3-70b-versatile', 'detalhe': 'API key'},
12
+ {'slug': 'mistral', 'nome': 'Mistral', 'base_url': 'https://api.mistral.ai/v1', 'modelo_padrao': 'mistral-large-latest', 'detalhe': 'API key'},
13
+ {'slug': 'nvidia_api', 'nome': 'NVIDIA NIM', 'base_url': 'https://integrate.api.nvidia.com/v1', 'modelo_padrao': 'moonshotai/kimi-k3.1-pro', 'detalhe': 'API key'},
14
+ {'slug': 'moonshot', 'nome': 'Moonshot', 'base_url': 'https://api.moonshot.ai/v1', 'modelo_padrao': 'kimi-k2-thinking', 'detalhe': 'API key'},
15
+ {'slug': 'cerebras', 'nome': 'Cerebras', 'base_url': 'https://api.cerebras.ai/v1', 'modelo_padrao': 'llama-3.3-70b', 'detalhe': 'API key'},
16
+ {'slug': 'together', 'nome': 'Together', 'base_url': 'https://api.together.xyz/v1', 'modelo_padrao': 'deepseek-ai/DeepSeek-R1', 'detalhe': 'API key'},
17
+ {'slug': 'fireworks', 'nome': 'Fireworks', 'base_url': 'https://api.fireworks.ai/inference/v1', 'modelo_padrao': 'accounts/fireworks/models/deepseek-r1', 'detalhe': 'API key'},
18
+ {'slug': 'perplexity', 'nome': 'Perplexity', 'base_url': 'https://api.perplexity.ai', 'modelo_padrao': 'sonar-pro', 'detalhe': 'API key'},
19
+ {'slug': 'siliconflow', 'nome': 'SiliconFlow', 'base_url': 'https://api.siliconflow.cn/v1', 'modelo_padrao': 'deepseek-ai/DeepSeek-R1', 'detalhe': 'API key'},
20
+ {'slug': 'zhipuai', 'nome': 'Zhipu AI', 'base_url': 'https://open.bigmodel.cn/api/paas/v4', 'modelo_padrao': 'glm-4-plus', 'detalhe': 'API key'},
21
+ {'slug': 'minimax_api', 'nome': 'MiniMax', 'base_url': 'https://api.minimax.io/v1', 'modelo_padrao': 'MiniMax-M1', 'detalhe': 'API key'},
22
+ {'slug': 'cometapi', 'nome': 'CometAPI', 'base_url': 'https://api.cometapi.com/v1', 'modelo_padrao': 'gpt-4o', 'detalhe': 'API key'},
23
+ {'slug': 'venice', 'nome': 'Venice', 'base_url': 'https://api.venice.ai/api/v1', 'modelo_padrao': 'llama-3.3-70b', 'detalhe': 'API key'},
24
+ {'slug': 'ollama', 'nome': 'Ollama', 'base_url': 'http://127.0.0.1:11434/v1', 'modelo_padrao': 'llama3.2', 'detalhe': 'Local'},
153
25
  ]
154
26
 
155
27
  PRESET_POR_SLUG: dict[str, dict[str, str]] = {p['slug']: p for p in PROVEDORES_API_PRESETS}
package/tls_proxy.py CHANGED
@@ -112,7 +112,7 @@ def start_for_bridge(cfg, base_path):
112
112
  TLS precisa acompanhar o core tambem quando ele e aberto pelo painel.
113
113
  Retorna apenas o servidor criado aqui, para o core encerrar o que e seu.
114
114
  """
115
- logger = logging.getLogger('deepseek_universal_bridge')
115
+ logger = logging.getLogger('krnell_bridge')
116
116
  public = urlsplit(str(cfg.get('link_publico') or ''))
117
117
  if public.scheme != 'https':
118
118
  return None
package/tui_core.py CHANGED
@@ -1,4 +1,4 @@
1
- """Núcleo visual e de entrada multiplataforma do Nyxo TUI (estilo OpenCode).
1
+ """Núcleo visual e de entrada multiplataforma do Krnell TUI (estilo OpenCode).
2
2
 
3
3
  Fornece:
4
4
  - TerminalPosix: leitor raw-mode (termios + select) com suporte completo a
@@ -578,9 +578,13 @@ def construir_dialogo_opencode(
578
578
  mapa_clique[len(linhas)] = pos
579
579
  linhas.append(frame_line(t))
580
580
 
581
- # Indicador de paginação se houver mais itens
581
+ # Indicador visual de barra de rolagem / posição quando a lista é maior que a janela
582
582
  if total_sel > len(vis_sel_indices):
583
- pag = f'▲▼ {topo + 1}–{topo + len(vis_sel_indices)} de {total_sel}'
583
+ frac_pos = topo / max(1, total_sel - len(vis_sel_indices))
584
+ trilha = 12
585
+ pos_bar = min(trilha - 1, max(0, int(round(frac_pos * (trilha - 1)))))
586
+ barra_scroll = '─' * pos_bar + '━' * 2 + '─' * max(0, trilha - pos_bar - 1)
587
+ pag = f'{topo + 1}–{topo + len(vis_sel_indices)} de {total_sel} {barra_scroll}'
584
588
  pag_vis = truncate_vis(pag, inner - 4)
585
589
  pt = Text()
586
590
  pt.append(' ' + pag_vis, style=f'{fraco}{bg}')