pantheon-opencode 2.0.0 → 2.0.2
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/CHANGELOG.md +62 -9
- package/README.md +13 -2
- package/README.pt-BR.md +13 -2
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/pyproject.toml +1 -1
- package/scripts/probe-pantheon-cost.mjs +4 -0
- package/scripts/test-opencode-sandbox.sh +7 -1
- package/src/agents/athena.md +14 -7
- package/src/instructions/zeus-council-synthesis.instructions.md +28 -9
- package/src/plugins/tui/dist/tui.js +164 -103
- package/src/plugins/tui/dist/tui.js.map +1 -1
- package/src/plugins/tui/package-lock.json +2 -2
- package/src/plugins/tui/package.json +1 -1
- package/src/plugins/tui/src/autonomy-state.ts +51 -22
- package/src/plugins/tui/src/decision-router-state.ts +59 -24
- package/src/plugins/tui/src/j1-gate-status.ts +26 -9
- package/src/plugins/tui/src/pantheon-settings.tsx +24 -21
- package/src/plugins/tui/src/settings-i18n.ts +238 -0
- package/src/plugins/tui/src/tui-prefs.ts +90 -47
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* settings-i18n.ts — Bilingual (PT-BR / EN) internationalization for TUI settings.
|
|
3
|
+
*
|
|
4
|
+
* Provides localized titles, labels, and explanations for:
|
|
5
|
+
* - Decision Router & Jev model selection
|
|
6
|
+
* - Autonomy & Budgets
|
|
7
|
+
* - Safety & J1 Risk Gate
|
|
8
|
+
*
|
|
9
|
+
* Automatically detects environment locale (LANG / LC_ALL) while allowing
|
|
10
|
+
* manual override in TUI preferences.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export type SettingsLanguage = 'auto' | 'pt-BR' | 'en'
|
|
14
|
+
|
|
15
|
+
export const SETTINGS_LANGUAGES_CYCLE: readonly string[] = Object.freeze(['auto', 'pt-BR', 'en'])
|
|
16
|
+
export const SUPPORTED_LANGUAGES = SETTINGS_LANGUAGES_CYCLE
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Resolve effective language: 'pt-BR' or 'en'.
|
|
20
|
+
* Defaults to 'pt-BR' if system locale contains 'pt', if Intl locale is pt,
|
|
21
|
+
* or if system timezone is Brazilian/Portuguese; otherwise 'en'.
|
|
22
|
+
*/
|
|
23
|
+
export function resolveLanguage(
|
|
24
|
+
preference: string = 'auto',
|
|
25
|
+
env: Record<string, string | undefined> = process.env,
|
|
26
|
+
): 'pt-BR' | 'en' {
|
|
27
|
+
if (preference === 'pt-BR') return 'pt-BR'
|
|
28
|
+
if (preference === 'en') return 'en'
|
|
29
|
+
|
|
30
|
+
// 1. Auto-detection based on environment locale variables
|
|
31
|
+
const lang = (env.LC_ALL ?? env.LC_MESSAGES ?? env.LANG ?? env.LANGUAGE ?? '').toLowerCase()
|
|
32
|
+
if (lang.startsWith('pt')) return 'pt-BR'
|
|
33
|
+
|
|
34
|
+
// 2. Auto-detection based on Intl locale
|
|
35
|
+
try {
|
|
36
|
+
const intlLocale = Intl.DateTimeFormat().resolvedOptions().locale.toLowerCase()
|
|
37
|
+
if (intlLocale.startsWith('pt')) return 'pt-BR'
|
|
38
|
+
} catch {}
|
|
39
|
+
|
|
40
|
+
// 3. Auto-detection based on timezone (Brazil & Portugal)
|
|
41
|
+
try {
|
|
42
|
+
const tz = (env.TZ ?? Intl.DateTimeFormat().resolvedOptions().timeZone ?? '').toLowerCase()
|
|
43
|
+
if (
|
|
44
|
+
tz.includes('sao_paulo') ||
|
|
45
|
+
tz.includes('brazil') ||
|
|
46
|
+
tz.includes('fortaleza') ||
|
|
47
|
+
tz.includes('recife') ||
|
|
48
|
+
tz.includes('manaus') ||
|
|
49
|
+
tz.includes('belem') ||
|
|
50
|
+
tz.includes('cuiaba') ||
|
|
51
|
+
tz.includes('campo_grande') ||
|
|
52
|
+
tz.includes('porto_velho') ||
|
|
53
|
+
tz.includes('rio_branco') ||
|
|
54
|
+
tz.includes('boa_vista') ||
|
|
55
|
+
tz.includes('maceio') ||
|
|
56
|
+
tz.includes('bahia') ||
|
|
57
|
+
tz.includes('noronha') ||
|
|
58
|
+
tz.includes('araguaina') ||
|
|
59
|
+
tz.includes('santarem') ||
|
|
60
|
+
tz.includes('lisbon') ||
|
|
61
|
+
tz.includes('madeira') ||
|
|
62
|
+
tz.includes('azores')
|
|
63
|
+
) {
|
|
64
|
+
return 'pt-BR'
|
|
65
|
+
}
|
|
66
|
+
} catch {}
|
|
67
|
+
|
|
68
|
+
return 'en'
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface I18nStringPair {
|
|
72
|
+
en: string
|
|
73
|
+
pt: string
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export const I18N = {
|
|
77
|
+
tabs: {
|
|
78
|
+
decision: { en: 'Decision (Jev)', pt: 'Decisão (Jev)' },
|
|
79
|
+
autonomy: { en: 'Autonomy', pt: 'Autonomia' },
|
|
80
|
+
safety: { en: 'Safety (J1)', pt: 'Segurança (J1)' },
|
|
81
|
+
tui: { en: 'TUI', pt: 'TUI' },
|
|
82
|
+
},
|
|
83
|
+
decision: {
|
|
84
|
+
groupRouter: {
|
|
85
|
+
en: 'Decision Router (Jev Assistant)',
|
|
86
|
+
pt: 'Assistente de Decisão (Jev)',
|
|
87
|
+
},
|
|
88
|
+
groupCredentials: {
|
|
89
|
+
en: 'Credentials (status only — values never enter the window)',
|
|
90
|
+
pt: 'Credenciais (apenas status — valores protegidos)',
|
|
91
|
+
},
|
|
92
|
+
routerName: {
|
|
93
|
+
en: 'Router (Decision Assistant)',
|
|
94
|
+
pt: 'Assistente Jev',
|
|
95
|
+
},
|
|
96
|
+
routerNote: {
|
|
97
|
+
en: 'applies live — enables intelligent route arbitration and candidate ranking',
|
|
98
|
+
pt: 'aplica em tempo real — motor de arbitragem inteligente e ranking de rotas',
|
|
99
|
+
},
|
|
100
|
+
modelName: {
|
|
101
|
+
en: 'Decision model',
|
|
102
|
+
pt: 'Modelo de Decisão',
|
|
103
|
+
},
|
|
104
|
+
modelNote: {
|
|
105
|
+
en: 'local routes on-device (free); auto/explicit pick a remote decision model',
|
|
106
|
+
pt: 'local decide no seu PC (grátis); auto/explícito usa modelo nuvem (OpenRouter)',
|
|
107
|
+
},
|
|
108
|
+
selectionModeName: {
|
|
109
|
+
en: 'Selection mode',
|
|
110
|
+
pt: 'Modo de operação',
|
|
111
|
+
},
|
|
112
|
+
selectionModeNote: {
|
|
113
|
+
en: 'local routes on-device; auto/explicit pick a remote decision model',
|
|
114
|
+
pt: 'local decide no dispositivo; auto/explícito usa modelo remoto',
|
|
115
|
+
},
|
|
116
|
+
egressName: {
|
|
117
|
+
en: 'Cloud API access (Egress)',
|
|
118
|
+
pt: 'Acesso à Nuvem (Egress)',
|
|
119
|
+
},
|
|
120
|
+
egressNoteGranted: {
|
|
121
|
+
en: 'granted = remote decision routes may call their gateway (budget-capped)',
|
|
122
|
+
pt: 'permitido = rotas remotas podem consultar a API (com limite de orçamento)',
|
|
123
|
+
},
|
|
124
|
+
egressNoteNotGranted: {
|
|
125
|
+
en: 'not granted = remote routes blocked; local heuristic decisions only',
|
|
126
|
+
pt: 'não permitido = chamadas remotas bloqueadas; apenas heurística local',
|
|
127
|
+
},
|
|
128
|
+
candidatesName: {
|
|
129
|
+
en: 'Active candidates',
|
|
130
|
+
pt: 'Candidatos ativos',
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
autonomy: {
|
|
134
|
+
groupGoalLoop: {
|
|
135
|
+
en: 'Goal loop (multi-turn session auto-continuation)',
|
|
136
|
+
pt: 'Execução Contínua (Goal Loop)',
|
|
137
|
+
},
|
|
138
|
+
goalLoopName: {
|
|
139
|
+
en: 'Goal loop',
|
|
140
|
+
pt: 'Loop contínuo',
|
|
141
|
+
},
|
|
142
|
+
goalLoopNote: {
|
|
143
|
+
en: 'auto-continues multi-turn tasks when session goes idle · applies after OpenCode restart',
|
|
144
|
+
pt: 'continua tarefas de múltiplos passos automaticamente · requer reinício',
|
|
145
|
+
},
|
|
146
|
+
maxContinuationsName: {
|
|
147
|
+
en: 'Max continuations',
|
|
148
|
+
pt: 'Limite de turnos',
|
|
149
|
+
},
|
|
150
|
+
maxContinuationsNote: {
|
|
151
|
+
en: '1..200 — safety ceiling to prevent runaway tasks',
|
|
152
|
+
pt: '1..200 — teto de segurança contra tarefas infinitas',
|
|
153
|
+
},
|
|
154
|
+
cooldownName: {
|
|
155
|
+
en: 'Cooldown (ms)',
|
|
156
|
+
pt: 'Intervalo (ms)',
|
|
157
|
+
},
|
|
158
|
+
cooldownNote: {
|
|
159
|
+
en: 'delay between autonomous turns (min 1000ms)',
|
|
160
|
+
pt: 'tempo de espera entre turnos autônomos (mín 1000ms)',
|
|
161
|
+
},
|
|
162
|
+
groupBudgets: {
|
|
163
|
+
en: 'Decision budgets (applies live per gated call)',
|
|
164
|
+
pt: 'Orçamento Jev (teto financeiro de proteção)',
|
|
165
|
+
},
|
|
166
|
+
monthlyCapName: {
|
|
167
|
+
en: 'Monthly cap',
|
|
168
|
+
pt: 'Teto mensal (USD)',
|
|
169
|
+
},
|
|
170
|
+
monthlyCapNote: {
|
|
171
|
+
en: 'monthly USD ceiling for gated arbitrator decisions',
|
|
172
|
+
pt: 'teto mensal em dólares para decisões do assistente Jev',
|
|
173
|
+
},
|
|
174
|
+
perDecisionCapName: {
|
|
175
|
+
en: 'Per-decision cap',
|
|
176
|
+
pt: 'Teto por consulta (USD)',
|
|
177
|
+
},
|
|
178
|
+
perDecisionCapNote: {
|
|
179
|
+
en: 'price cap — gated decisions above this are refused',
|
|
180
|
+
pt: 'teto por decisão — consultas remotas que excederem são recusadas',
|
|
181
|
+
},
|
|
182
|
+
groupGradient: {
|
|
183
|
+
en: 'Decision gradient (reference policy · J1 owns the risk axis)',
|
|
184
|
+
pt: 'Níveis de Decisão & Segurança (Referência)',
|
|
185
|
+
},
|
|
186
|
+
soloName: {
|
|
187
|
+
en: 'Decide solo',
|
|
188
|
+
pt: 'Decisão direta',
|
|
189
|
+
},
|
|
190
|
+
soloNote: {
|
|
191
|
+
en: 'reversible & low-risk edits, routine fixes (no gate)',
|
|
192
|
+
pt: 'edições reversíveis e baixo risco, sem portão de bloqueio',
|
|
193
|
+
},
|
|
194
|
+
jevName: {
|
|
195
|
+
en: 'Jev decides',
|
|
196
|
+
pt: 'Decisão Jev',
|
|
197
|
+
},
|
|
198
|
+
jevNote: {
|
|
199
|
+
en: 'typed ambiguity & candidate ranking (budget-capped)',
|
|
200
|
+
pt: 'ambiguidade e ranking de skills com teto de orçamento',
|
|
201
|
+
},
|
|
202
|
+
humanName: {
|
|
203
|
+
en: 'Human decides',
|
|
204
|
+
pt: 'Aprovação humana',
|
|
205
|
+
},
|
|
206
|
+
humanNote: {
|
|
207
|
+
en: 'high-risk & destructive operations (J1 gate)',
|
|
208
|
+
pt: 'ações de alto risco e destrutivas (portão de segurança J1)',
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
safety: {
|
|
212
|
+
groupSafety: {
|
|
213
|
+
en: 'Safety & Risk Level (J1 Gate)',
|
|
214
|
+
pt: 'Nível de Proteção & Portão de Risco (J1)',
|
|
215
|
+
},
|
|
216
|
+
modeName: {
|
|
217
|
+
en: 'Protection mode',
|
|
218
|
+
pt: 'Modo de proteção',
|
|
219
|
+
},
|
|
220
|
+
thresholdName: {
|
|
221
|
+
en: 'Enforce threshold',
|
|
222
|
+
pt: 'Teto para bloqueio',
|
|
223
|
+
},
|
|
224
|
+
thresholdNote: {
|
|
225
|
+
en: 'deny at or above · 0..1 · default 0.8',
|
|
226
|
+
pt: 'bloqueia em ou acima de · 0..1 · padrão 0.8',
|
|
227
|
+
},
|
|
228
|
+
gateName: {
|
|
229
|
+
en: 'Safety gate',
|
|
230
|
+
pt: 'Portão de segurança',
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
} as const
|
|
234
|
+
|
|
235
|
+
/** Helper to get localized text */
|
|
236
|
+
export function t(entry: I18nStringPair, lang: 'pt-BR' | 'en'): string {
|
|
237
|
+
return lang === 'pt-BR' ? entry.pt : entry.en
|
|
238
|
+
}
|
|
@@ -17,6 +17,7 @@ import type { Context } from '@opencode/plugin/tui/context'
|
|
|
17
17
|
import type { Accessor, Setter } from 'solid-js'
|
|
18
18
|
import { createSignal } from 'solid-js'
|
|
19
19
|
import type { SettingsDraft, SettingsRow, SettingsTab } from './pantheon-settings-state.ts'
|
|
20
|
+
import { resolveLanguage } from './settings-i18n.ts'
|
|
20
21
|
|
|
21
22
|
// ── The durable store handle (host storage, one per plugin) ────────────
|
|
22
23
|
// Created once at setup and stashed under a globalThis symbol so
|
|
@@ -180,6 +181,9 @@ export type BarWidthPref = 'standard' | 'compact' | 'wide' | 'full'
|
|
|
180
181
|
export type LayoutPresetPref = 'comfortable' | 'compact'
|
|
181
182
|
export type SeparatorStylePref = 'spaces' | 'pipes' | 'dots' | 'slashes'
|
|
182
183
|
export type SettingsViewModePref = 'docked' | 'fullscreen' | 'dialog'
|
|
184
|
+
export type LanguagePref = 'auto' | 'pt-BR' | 'en'
|
|
185
|
+
|
|
186
|
+
export const LANGUAGE_CYCLE: readonly string[] = Object.freeze(['auto', 'pt-BR', 'en'])
|
|
183
187
|
|
|
184
188
|
export interface TuiPrefs {
|
|
185
189
|
version: 1
|
|
@@ -187,6 +191,7 @@ export interface TuiPrefs {
|
|
|
187
191
|
preset: LayoutPresetPref
|
|
188
192
|
separator: SeparatorStylePref
|
|
189
193
|
settingsView?: SettingsViewModePref
|
|
194
|
+
language?: LanguagePref
|
|
190
195
|
}
|
|
191
196
|
sidebar: {
|
|
192
197
|
header: { version: boolean; preset: boolean; session: boolean }
|
|
@@ -212,6 +217,7 @@ export const DEFAULT_TUI_PREFS: TuiPrefs = {
|
|
|
212
217
|
preset: 'comfortable',
|
|
213
218
|
separator: 'spaces',
|
|
214
219
|
settingsView: 'fullscreen',
|
|
220
|
+
language: 'auto',
|
|
215
221
|
},
|
|
216
222
|
sidebar: {
|
|
217
223
|
header: { version: true, preset: true, session: true },
|
|
@@ -267,6 +273,11 @@ export function normalizeTuiPrefs(raw: unknown): TuiPrefs {
|
|
|
267
273
|
? layout.settingsView
|
|
268
274
|
: DEFAULT_TUI_PREFS.layout.settingsView
|
|
269
275
|
) as SettingsViewModePref
|
|
276
|
+
const language = (
|
|
277
|
+
LANGUAGE_CYCLE.includes(layout.language as string)
|
|
278
|
+
? layout.language
|
|
279
|
+
: DEFAULT_TUI_PREFS.layout.language
|
|
280
|
+
) as LanguagePref
|
|
270
281
|
const gauge = GAUGE_STYLES.includes(context.gauge as string)
|
|
271
282
|
? (context.gauge as GaugeStyle)
|
|
272
283
|
: DEFAULT_TUI_PREFS.sidebar.context.gauge
|
|
@@ -284,6 +295,7 @@ export function normalizeTuiPrefs(raw: unknown): TuiPrefs {
|
|
|
284
295
|
preset,
|
|
285
296
|
separator,
|
|
286
297
|
settingsView,
|
|
298
|
+
language,
|
|
287
299
|
},
|
|
288
300
|
sidebar: {
|
|
289
301
|
header: {
|
|
@@ -327,63 +339,83 @@ const row = (id: string, name: string, value: boolean, note: string): SettingsRo
|
|
|
327
339
|
note,
|
|
328
340
|
})
|
|
329
341
|
|
|
330
|
-
export function buildTuiTab(prefs: TuiPrefs): SettingsTab {
|
|
342
|
+
export function buildTuiTab(prefs: TuiPrefs, languagePref?: string): SettingsTab {
|
|
343
|
+
const isPt = resolveLanguage(languagePref ?? prefs.layout?.language) === 'pt-BR'
|
|
331
344
|
return {
|
|
332
345
|
id: 'tui',
|
|
333
346
|
title: 'TUI',
|
|
334
347
|
groups: [
|
|
335
348
|
{
|
|
336
|
-
title: 'Preset & Layout',
|
|
349
|
+
title: isPt ? 'Predefinição & Layout' : 'Preset & Layout',
|
|
337
350
|
rows: [
|
|
338
351
|
{
|
|
339
352
|
id: 'tui.layout.preset',
|
|
340
|
-
name: 'Layout preset',
|
|
353
|
+
name: isPt ? 'Predefinição de layout' : 'Layout preset',
|
|
341
354
|
value: prefs.layout?.preset ?? DEFAULT_TUI_PREFS.layout.preset,
|
|
342
355
|
cycle: LAYOUT_PRESETS_CYCLE,
|
|
343
|
-
note:
|
|
356
|
+
note: isPt
|
|
357
|
+
? 'comfortable | compact — define espaçamento e bordas'
|
|
358
|
+
: 'comfortable | compact — sets spacing & borders',
|
|
344
359
|
},
|
|
345
360
|
{
|
|
346
361
|
id: 'tui.layout.separator',
|
|
347
|
-
name: 'Separator',
|
|
362
|
+
name: isPt ? 'Separador' : 'Separator',
|
|
348
363
|
value: prefs.layout?.separator ?? DEFAULT_TUI_PREFS.layout.separator,
|
|
349
364
|
cycle: SEPARATOR_STYLES_CYCLE,
|
|
350
|
-
note:
|
|
365
|
+
note: isPt
|
|
366
|
+
? 'spaces | pipes | dots | slashes — glifos na linha de status'
|
|
367
|
+
: 'spaces | pipes | dots | slashes — status line glyphs',
|
|
351
368
|
},
|
|
352
369
|
{
|
|
353
370
|
id: 'tui.layout.settingsView',
|
|
354
|
-
name: 'Settings surface',
|
|
371
|
+
name: isPt ? 'Superfície de configurações' : 'Settings surface',
|
|
355
372
|
value: tuiRowValue(prefs, 'tui.layout.settingsView') ?? 'docked',
|
|
356
373
|
cycle: SETTINGS_VIEW_MODES,
|
|
357
|
-
note:
|
|
374
|
+
note: isPt
|
|
375
|
+
? 'docked (acima do prompt) | fullscreen | dialog'
|
|
376
|
+
: 'docked (above prompt) | fullscreen router page | dialog overlay',
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
id: 'tui.layout.language',
|
|
380
|
+
name: isPt ? 'Idioma / Language' : 'Language / Idioma',
|
|
381
|
+
value: tuiRowValue(prefs, 'tui.layout.language') ?? 'auto',
|
|
382
|
+
cycle: LANGUAGE_CYCLE,
|
|
383
|
+
note: isPt
|
|
384
|
+
? 'auto (detecta via fuso/locale) | pt-BR (Português) | en (English)'
|
|
385
|
+
: 'auto (detect via timezone/locale) | pt-BR (Português) | en (English)',
|
|
358
386
|
},
|
|
359
387
|
],
|
|
360
388
|
},
|
|
361
389
|
{
|
|
362
|
-
title: 'Bars & Gauges',
|
|
390
|
+
title: isPt ? 'Barras & Medidores' : 'Bars & Gauges',
|
|
363
391
|
rows: [
|
|
364
392
|
{
|
|
365
393
|
id: 'tui.sidebar.context.barShape',
|
|
366
|
-
name: 'Bar shape',
|
|
394
|
+
name: isPt ? 'Formato da barra' : 'Bar shape',
|
|
367
395
|
value: prefs.sidebar.context.barShape,
|
|
368
396
|
cycle: BAR_SHAPES_CYCLE,
|
|
369
397
|
note: 'line (━─) | block (▰▱) | smooth (█░) | ascii (=) | dots (●○) | braille',
|
|
370
398
|
},
|
|
371
399
|
{
|
|
372
400
|
id: 'tui.sidebar.context.barWidth',
|
|
373
|
-
name: 'Bar width',
|
|
401
|
+
name: isPt ? 'Largura da barra' : 'Bar width',
|
|
374
402
|
value: prefs.sidebar.context.barWidth,
|
|
375
403
|
cycle: BAR_WIDTHS_CYCLE,
|
|
376
|
-
note:
|
|
404
|
+
note: isPt
|
|
405
|
+
? 'standard (12) | compact (8) | wide (16) | full (20 células)'
|
|
406
|
+
: 'standard (12) | compact (8) | wide (16) | full (20 cells)',
|
|
377
407
|
},
|
|
378
408
|
row(
|
|
379
409
|
'tui.sidebar.context.evenMark',
|
|
380
|
-
'Even-use mark',
|
|
410
|
+
isPt ? 'Marca central (50%)' : 'Even-use mark',
|
|
381
411
|
prefs.sidebar.context.evenMark,
|
|
382
|
-
|
|
412
|
+
isPt
|
|
413
|
+
? '| indicador aos 50% nas barras de medição'
|
|
414
|
+
: '| indicator at 50% midpoint in gauge bars',
|
|
383
415
|
),
|
|
384
416
|
{
|
|
385
417
|
id: 'tui.sidebar.context.gauge',
|
|
386
|
-
name: 'Gauge style',
|
|
418
|
+
name: isPt ? 'Estilo do medidor' : 'Gauge style',
|
|
387
419
|
value: prefs.sidebar.context.gauge,
|
|
388
420
|
cycle: GAUGE_STYLES,
|
|
389
421
|
note: 'both | bar | percent | off — `▰▱ 42% of 200k`',
|
|
@@ -391,106 +423,110 @@ export function buildTuiTab(prefs: TuiPrefs): SettingsTab {
|
|
|
391
423
|
],
|
|
392
424
|
},
|
|
393
425
|
{
|
|
394
|
-
title: 'Sidebar header',
|
|
426
|
+
title: isPt ? 'Cabeçalho da barra lateral' : 'Sidebar header',
|
|
395
427
|
rows: [
|
|
396
428
|
row(
|
|
397
429
|
'tui.sidebar.header.version',
|
|
398
|
-
'Version line',
|
|
430
|
+
isPt ? 'Linha de versão' : 'Version line',
|
|
399
431
|
prefs.sidebar.header.version,
|
|
400
|
-
'the `Pantheon v…` line',
|
|
432
|
+
isPt ? 'linha `Pantheon v…`' : 'the `Pantheon v…` line',
|
|
401
433
|
),
|
|
402
434
|
row(
|
|
403
435
|
'tui.sidebar.header.preset',
|
|
404
|
-
'Preset line',
|
|
436
|
+
isPt ? 'Linha de preset' : 'Preset line',
|
|
405
437
|
prefs.sidebar.header.preset,
|
|
406
|
-
'the `▸ preset · provider` line',
|
|
438
|
+
isPt ? 'linha `▸ preset · provider`' : 'the `▸ preset · provider` line',
|
|
407
439
|
),
|
|
408
440
|
row(
|
|
409
441
|
'tui.sidebar.header.session',
|
|
410
|
-
'Session line',
|
|
442
|
+
isPt ? 'Linha de sessão' : 'Session line',
|
|
411
443
|
prefs.sidebar.header.session,
|
|
412
|
-
'the active session title',
|
|
444
|
+
isPt ? 'título da sessão ativa' : 'the active session title',
|
|
413
445
|
),
|
|
414
446
|
],
|
|
415
447
|
},
|
|
416
448
|
{
|
|
417
|
-
title: 'Sidebar blocks',
|
|
449
|
+
title: isPt ? 'Blocos da barra lateral' : 'Sidebar blocks',
|
|
418
450
|
rows: [
|
|
419
451
|
row(
|
|
420
452
|
'tui.sidebar.block.context',
|
|
421
|
-
'Context block',
|
|
453
|
+
isPt ? 'Bloco de contexto' : 'Context block',
|
|
422
454
|
prefs.sidebar.blocks.context,
|
|
423
|
-
'tokens, gauge, spend, model usage',
|
|
455
|
+
isPt ? 'tokens, medidor, custo, uso de modelos' : 'tokens, gauge, spend, model usage',
|
|
424
456
|
),
|
|
425
457
|
row(
|
|
426
458
|
'tui.sidebar.block.git',
|
|
427
|
-
'Git block',
|
|
459
|
+
isPt ? 'Bloco do Git' : 'Git block',
|
|
428
460
|
prefs.sidebar.blocks.git,
|
|
429
|
-
'branch + working-tree counts',
|
|
461
|
+
isPt ? 'branch + contagem de alterações' : 'branch + working-tree counts',
|
|
430
462
|
),
|
|
431
463
|
row(
|
|
432
464
|
'tui.sidebar.block.todo',
|
|
433
|
-
'Todo block',
|
|
465
|
+
isPt ? 'Bloco Todo' : 'Todo block',
|
|
434
466
|
prefs.sidebar.blocks.todo,
|
|
435
|
-
'the newest todowrite',
|
|
467
|
+
isPt ? 'tarefas pendentes mais recentes' : 'the newest todowrite',
|
|
436
468
|
),
|
|
437
469
|
row(
|
|
438
470
|
'tui.sidebar.block.dispatch',
|
|
439
|
-
'Dispatch block',
|
|
471
|
+
isPt ? 'Bloco Dispatch' : 'Dispatch block',
|
|
440
472
|
prefs.sidebar.blocks.dispatch,
|
|
441
|
-
'live delegations + rollup',
|
|
473
|
+
isPt ? 'delegações em tempo real' : 'live delegations + rollup',
|
|
442
474
|
),
|
|
443
475
|
],
|
|
444
476
|
},
|
|
445
477
|
{
|
|
446
|
-
title: 'Context block detail',
|
|
478
|
+
title: isPt ? 'Detalhe do bloco de contexto' : 'Context block detail',
|
|
447
479
|
rows: [
|
|
448
480
|
row(
|
|
449
481
|
'tui.sidebar.context.tokens',
|
|
450
|
-
'Tokens row',
|
|
482
|
+
isPt ? 'Linha de tokens' : 'Tokens row',
|
|
451
483
|
prefs.sidebar.context.tokens,
|
|
452
|
-
'the raw token count line',
|
|
484
|
+
isPt ? 'contagem bruta de tokens' : 'the raw token count line',
|
|
453
485
|
),
|
|
454
486
|
row(
|
|
455
487
|
'tui.sidebar.context.spent',
|
|
456
|
-
'Spent row',
|
|
488
|
+
isPt ? 'Linha de custo' : 'Spent row',
|
|
457
489
|
prefs.sidebar.context.spent,
|
|
458
|
-
'the `$… spent in session` line',
|
|
490
|
+
isPt ? 'linha `$… gastos na sessão`' : 'the `$… spent in session` line',
|
|
459
491
|
),
|
|
460
492
|
row(
|
|
461
493
|
'tui.sidebar.context.modelUsage',
|
|
462
|
-
'Model usage table',
|
|
494
|
+
isPt ? 'Tabela de uso de modelos' : 'Model usage table',
|
|
463
495
|
prefs.sidebar.context.modelUsage,
|
|
464
|
-
'per-model tokens/USD',
|
|
496
|
+
isPt ? 'resumo de chamadas por modelo' : 'per-model tokens/USD',
|
|
465
497
|
),
|
|
466
498
|
row(
|
|
467
499
|
'tui.sidebar.context.performance',
|
|
468
|
-
'Performance
|
|
500
|
+
isPt ? 'Linha de desempenho' : 'Performance row',
|
|
469
501
|
prefs.sidebar.context.performance,
|
|
470
|
-
'cache % + tok/s',
|
|
502
|
+
isPt ? 'tokens/segundo e latência' : 'cache % + tok/s',
|
|
471
503
|
),
|
|
472
504
|
row(
|
|
473
505
|
'tui.sidebar.context.localSpend',
|
|
474
|
-
'Local spend',
|
|
506
|
+
isPt ? 'Linha de custo local' : 'Local spend row',
|
|
475
507
|
prefs.sidebar.context.localSpend,
|
|
476
|
-
'hoje / 30d totals',
|
|
508
|
+
isPt ? 'totais de hoje / 30 dias' : 'hoje / 30d totals',
|
|
477
509
|
),
|
|
478
510
|
],
|
|
479
511
|
},
|
|
480
512
|
{
|
|
481
|
-
title: 'Footers',
|
|
513
|
+
title: isPt ? 'Rodapés' : 'Footers',
|
|
482
514
|
rows: [
|
|
483
515
|
row(
|
|
484
516
|
'tui.footer.prompt',
|
|
485
|
-
'Prompt footer',
|
|
517
|
+
isPt ? 'Prompt inferior' : 'Prompt footer',
|
|
486
518
|
prefs.footer.prompt,
|
|
487
|
-
|
|
519
|
+
isPt
|
|
520
|
+
? 'linha `▸preset · ✦n ativos` durante delegações'
|
|
521
|
+
: 'the `▸preset · ✦n ativos` line while delegations run',
|
|
488
522
|
),
|
|
489
523
|
row(
|
|
490
524
|
'tui.footer.home',
|
|
491
|
-
'Home status',
|
|
525
|
+
isPt ? 'Status inicial' : 'Home status',
|
|
492
526
|
prefs.footer.home,
|
|
493
|
-
|
|
527
|
+
isPt
|
|
528
|
+
? 'linha `Pantheon v…` sob o prompt inicial'
|
|
529
|
+
: 'the `Pantheon v…` line under the home prompt',
|
|
494
530
|
),
|
|
495
531
|
],
|
|
496
532
|
},
|
|
@@ -523,6 +559,12 @@ export function applyTuiRow(draft: TuiPrefs, id: string, value: string): void {
|
|
|
523
559
|
draft.layout.settingsView = value as SettingsViewModePref
|
|
524
560
|
}
|
|
525
561
|
return
|
|
562
|
+
case 'tui.layout.language':
|
|
563
|
+
if (LANGUAGE_CYCLE.includes(value)) {
|
|
564
|
+
if (!draft.layout) draft.layout = { ...DEFAULT_TUI_PREFS.layout }
|
|
565
|
+
draft.layout.language = value as LanguagePref
|
|
566
|
+
}
|
|
567
|
+
return
|
|
526
568
|
case 'tui.sidebar.context.barShape':
|
|
527
569
|
if (BAR_SHAPES_CYCLE.includes(value)) draft.sidebar.context.barShape = value as BarShapePref
|
|
528
570
|
return
|
|
@@ -589,6 +631,7 @@ export function tuiRowValue(prefs: TuiPrefs, id: string): string | undefined {
|
|
|
589
631
|
return prefs.layout?.separator ?? DEFAULT_TUI_PREFS.layout.separator
|
|
590
632
|
if (id === 'tui.layout.settingsView')
|
|
591
633
|
return prefs.layout?.settingsView ?? DEFAULT_TUI_PREFS.layout.settingsView ?? 'docked'
|
|
634
|
+
if (id === 'tui.layout.language') return prefs.layout?.language ?? 'auto'
|
|
592
635
|
if (id === 'tui.sidebar.context.barShape') return prefs.sidebar.context.barShape
|
|
593
636
|
if (id === 'tui.sidebar.context.barWidth') return prefs.sidebar.context.barWidth
|
|
594
637
|
if (id === 'tui.sidebar.context.gauge') return prefs.sidebar.context.gauge
|