pantheon-opencode 2.0.0-rc.1 → 2.0.1

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.
Files changed (73) hide show
  1. package/AGENTS.global.md +2 -2
  2. package/AGENTS.md +8 -8
  3. package/CHANGELOG.md +92 -0
  4. package/README.md +15 -2
  5. package/README.pt-BR.md +15 -2
  6. package/bin/pantheon-init.mjs +13 -0
  7. package/commands/pantheon-audit.md +1 -1
  8. package/commands/pantheon-deepwork.md +1 -1
  9. package/commands/pantheon-optimize.md +41 -63
  10. package/package.json +4 -3
  11. package/plugin.json +1 -1
  12. package/prompts/optimize-database.prompt.md +5 -5
  13. package/prompts/plan-architecture.prompt.md +6 -6
  14. package/pyproject.toml +1 -1
  15. package/scripts/build-agents-md.mjs +10 -10
  16. package/scripts/build-plugin.mjs +26 -0
  17. package/scripts/install/opencode-version.mjs +17 -5
  18. package/scripts/install/opencode.mjs +8 -1
  19. package/scripts/optimize.mjs +322 -0
  20. package/scripts/prune.mjs +105 -14
  21. package/scripts/update.mjs +20 -15
  22. package/skills-lock.json +11 -11
  23. package/src/agents/aphrodite.md +15 -14
  24. package/src/agents/apollo.md +2 -1
  25. package/src/agents/athena.md +19 -12
  26. package/src/agents/demeter.md +2 -0
  27. package/src/agents/hephaestus.md +1 -0
  28. package/src/agents/hermes.md +19 -95
  29. package/src/agents/iris.md +3 -0
  30. package/src/agents/nyx.md +1 -0
  31. package/src/agents/prometheus.md +2 -0
  32. package/src/agents/talos.md +3 -0
  33. package/src/agents/themis.md +91 -87
  34. package/src/agents/zeus.md +41 -266
  35. package/src/instructions/agent-return-format.instructions.md +1 -1
  36. package/src/instructions/memory-protocol.instructions.md +1 -1
  37. package/src/instructions/zeus-anti-stall.instructions.md +3 -3
  38. package/src/instructions/zeus-communication-rules.instructions.md +1 -1
  39. package/src/instructions/zeus-council-synthesis.instructions.md +29 -10
  40. package/src/instructions/zeus-timeout-retry.instructions.md +10 -10
  41. package/src/pantheon/model-command.ts +12 -12
  42. package/src/pantheon/tools.ts +4 -0
  43. package/src/pantheon/tui-version-check.ts +1 -1
  44. package/src/pantheon/update-notifier.ts +13 -8
  45. package/src/pantheon/vision.ts +20 -20
  46. package/src/plugin/index.js +14594 -0
  47. package/src/plugins/tui/dist/tui.d.ts +3 -3
  48. package/src/plugins/tui/dist/tui.d.ts.map +1 -1
  49. package/src/plugins/tui/dist/tui.js +1028 -393
  50. package/src/plugins/tui/dist/tui.js.map +1 -1
  51. package/src/plugins/tui/package-lock.json +2 -2
  52. package/src/plugins/tui/package.json +1 -1
  53. package/src/plugins/tui/src/autonomy-state.ts +66 -25
  54. package/src/plugins/tui/src/decision-router-state.ts +59 -24
  55. package/src/plugins/tui/src/index.tsx +44 -23
  56. package/src/plugins/tui/src/j1-gate-status.ts +26 -9
  57. package/src/plugins/tui/src/pantheon-settings.tsx +484 -124
  58. package/src/plugins/tui/src/settings-i18n.ts +203 -0
  59. package/src/plugins/tui/src/tui-prefs.ts +131 -4
  60. package/src/plugins/tui/src/update-notice.ts +9 -6
  61. package/src/plugins/tui/src/whats-new-open.ts +4 -4
  62. package/src/plugins/tui/src/whats-new.tsx +119 -17
  63. package/src/skills/agent-coordination/SKILL.md +6 -6
  64. package/src/skills/artifact-management/SKILL.md +43 -39
  65. package/src/skills/artifact-management/references/artifact-templates.md +103 -48
  66. package/src/skills/auto-continue/references/auto-continue-details.md +13 -13
  67. package/src/skills/code-review-checklist/SKILL.md +6 -6
  68. package/src/skills/incremental-implementation/SKILL.md +13 -13
  69. package/src/skills/memory-bank/references/anti-patterns.md +3 -3
  70. package/src/skills/spec-driven-development/SKILL.md +12 -14
  71. package/src/skills/tdd-with-agents/SKILL.md +6 -5
  72. package/src/skills/visual-review-pipeline/SKILL.md +1 -1
  73. package/src/skills/visual-review-pipeline/references/workflow-steps.md +1 -1
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pantheon-tui",
3
- "version": "2.0.0-rc.1",
3
+ "version": "2.0.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pantheon-tui",
9
- "version": "2.0.0-rc.1",
9
+ "version": "2.0.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@opencode/plugin": "2.0.26",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pantheon-tui",
3
3
  "type": "module",
4
- "version": "2.0.0-rc.1",
4
+ "version": "2.0.1",
5
5
  "description": "Pantheon TUI plugin \u2014 V1 rich sidebar and usage gauges; native V2 status, session and delegation sidebar",
6
6
  "license": "MIT",
7
7
  "engines": {
@@ -21,6 +21,7 @@
21
21
  * shows where the thresholds sit today.
22
22
  */
23
23
  import type { SettingsTab } from './pantheon-settings-state.ts'
24
+ import { resolveLanguage } from './settings-i18n.ts'
24
25
 
25
26
  export interface GoalLoopPrefs {
26
27
  enabled: boolean
@@ -36,6 +37,16 @@ export const DEFAULT_GOAL_LOOP_PREFS: GoalLoopPrefs = {
36
37
 
37
38
  export const GOAL_LOOP_ENABLED_CYCLE: readonly string[] = Object.freeze(['enabled', 'disabled'])
38
39
 
40
+ export const MAX_CONTINUATIONS_CYCLE: readonly string[] = Object.freeze([
41
+ '10',
42
+ '25',
43
+ '50',
44
+ '100',
45
+ '200',
46
+ ])
47
+
48
+ export const COOLDOWN_MS_CYCLE: readonly string[] = Object.freeze(['1000', '2000', '5000', '10000'])
49
+
39
50
  export interface DecisionBudgets {
40
51
  monthlyUsd: number
41
52
  perDecisionUsd: number
@@ -68,79 +79,109 @@ export function parseUsd(cell: string): number | null {
68
79
  export function buildAutonomyTab(input: {
69
80
  goalLoop: GoalLoopPrefs
70
81
  budgets: DecisionBudgets
71
- goalLoopRestartPending?: boolean
82
+ goalLoopRestartPending?: boolean | undefined
83
+ languagePref?: string | undefined
72
84
  }): SettingsTab {
85
+ const lang = resolveLanguage(input.languagePref)
86
+ const isPt = lang === 'pt-BR'
87
+
73
88
  return {
74
89
  id: 'autonomy',
75
- title: 'Autonomy',
90
+ title: isPt ? 'Autonomia' : 'Autonomy',
76
91
  groups: [
77
92
  {
78
- title: 'Goal loop (persisted mission, long sessions)',
93
+ title: isPt
94
+ ? 'Goal loop (auto-continuação de sessões multi-turn)'
95
+ : 'Goal loop (multi-turn session auto-continuation)',
79
96
  rows: [
80
97
  {
81
98
  id: 'autonomy.goal_loop.enabled',
82
- name: 'Goal loop',
99
+ name: isPt ? 'Goal loop' : 'Goal loop',
83
100
  value: input.goalLoop.enabled ? 'enabled' : 'disabled',
84
101
  cycle: GOAL_LOOP_ENABLED_CYCLE,
85
- note:
86
- 'mission persists in .pantheon/goals; auto-continues with cooldown' +
87
- (input.goalLoopRestartPending
88
- ? ' · ⚠ saved value applies after OpenCode restart'
89
- : ' · applies after OpenCode restart'),
102
+ note: isPt
103
+ ? 'continua tarefas multi-turn quando a sessão fica ociosa' +
104
+ (input.goalLoopRestartPending
105
+ ? ' · [!] reinício necessário para aplicar (restart)'
106
+ : ' · aplicado após reiniciar o OpenCode')
107
+ : 'auto-continues multi-turn tasks when session goes idle' +
108
+ (input.goalLoopRestartPending
109
+ ? ' · [!] restart required to apply'
110
+ : ' · applies after OpenCode restart'),
90
111
  },
91
112
  {
92
113
  id: 'autonomy.goal_loop.maxContinuations',
93
- name: 'Max continuations',
114
+ name: isPt ? 'Limite continuações' : 'Max continuations',
94
115
  value: String(input.goalLoop.maxContinuations),
95
- note: '1..200 — the anti-runaway cap per mission',
116
+ cycle: MAX_CONTINUATIONS_CYCLE,
117
+ note: isPt
118
+ ? '1..200 — teto de segurança contra loops infinitos'
119
+ : '1..200 — safety ceiling to prevent runaway tasks',
96
120
  },
97
121
  {
98
122
  id: 'autonomy.goal_loop.cooldownMs',
99
- name: 'Cooldown (ms)',
123
+ name: isPt ? 'Pausa entre turnos (ms)' : 'Cooldown (ms)',
100
124
  value: String(input.goalLoop.cooldownMs),
101
- note: 'min 1000ms · between continuations',
125
+ cycle: COOLDOWN_MS_CYCLE,
126
+ note: isPt
127
+ ? 'intervalo entre turnos autônomos (mín 1000ms)'
128
+ : 'delay between autonomous turns (min 1000ms)',
102
129
  },
103
130
  ],
104
131
  },
105
132
  {
106
- title: 'Decision budgets (applies live)',
133
+ title: isPt
134
+ ? 'Orçamento Jev (aplicado em tempo real por decisão)'
135
+ : 'Decision budgets (applies live per gated call)',
107
136
  rows: [
108
137
  {
109
138
  id: 'autonomy.budget.monthly',
110
- name: 'Monthly cap',
139
+ name: isPt ? 'Teto mensal' : 'Monthly cap',
111
140
  value: formatUsd(input.budgets.monthlyUsd),
112
141
  cycle: MONTHLY_USD_CYCLE,
113
- note: 'the ledger refuses gated calls past this',
142
+ note: isPt
143
+ ? 'teto mensal em USD para arbitragem do Jev'
144
+ : 'monthly USD ceiling for gated arbitrator decisions',
114
145
  },
115
146
  {
116
147
  id: 'autonomy.budget.perDecision',
117
- name: 'Per-decision cap',
148
+ name: isPt ? 'Teto por decisão' : 'Per-decision cap',
118
149
  value: formatUsd(input.budgets.perDecisionUsd),
119
150
  cycle: PER_DECISION_USD_CYCLE,
120
- note: 'each gated call above this is refused',
151
+ note: isPt
152
+ ? 'teto de custo por decisão — acima disso é recusada'
153
+ : 'price cap — gated decisions above this are refused',
121
154
  },
122
155
  ],
123
156
  },
124
157
  {
125
- title: 'Decision gradient (documented — J1 owns the risk axis)',
158
+ title: isPt
159
+ ? 'Gradiente de decisão (política de referência · J1 governa o risco)'
160
+ : 'Decision gradient (reference policy · J1 owns the risk axis)',
126
161
  rows: [
127
162
  {
128
163
  id: 'autonomy.gradient.solo',
129
164
  name: 'Decide solo',
130
- value: 'reversible + low risk',
131
- note: 'edits, routine fixes, ordering ties — no gate',
165
+ value: 'autonomous',
166
+ note: isPt
167
+ ? 'edições reversíveis e rotineiras, sem travas (baixo risco)'
168
+ : 'reversible & low-risk edits, routine fixes (no gate)',
132
169
  },
133
170
  {
134
171
  id: 'autonomy.gradient.jev',
135
172
  name: 'Jev decides',
136
- value: 'typed ambiguity',
137
- note: 'readings, ranking, verification — budget-capped',
173
+ value: 'arbitrated',
174
+ note: isPt
175
+ ? 'ambiguidade de tipos e ranqueamento de candidatos (com teto de custo)'
176
+ : 'typed ambiguity & candidate ranking (budget-capped)',
138
177
  },
139
178
  {
140
179
  id: 'autonomy.gradient.human',
141
180
  name: 'Human decides',
142
- value: 'high risk (J1)',
143
- note: 'enforce ladder via PANTHEON_J1_* (J1 tab)',
181
+ value: 'human review',
182
+ note: isPt
183
+ ? 'operações de alto risco ou destrutivas (portão J1)'
184
+ : 'high-risk & destructive operations (J1 gate)',
144
185
  },
145
186
  ],
146
187
  },
@@ -17,6 +17,7 @@
17
17
  import { chmodSync, mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs'
18
18
  import { dirname, join } from 'node:path'
19
19
  import type { SettingsRow, SettingsTab } from './pantheon-settings-state.ts'
20
+ import { resolveLanguage } from './settings-i18n.ts'
20
21
 
21
22
  export const DECISION_ENABLED_CYCLE: readonly string[] = Object.freeze(['enabled', 'disabled'])
22
23
 
@@ -340,64 +341,98 @@ export function buildDecisionTab(
340
341
  env: Record<string, string | undefined> = process.env,
341
342
  authProviders: ReadonlySet<string> = new Set(),
342
343
  configProviders: ReadonlySet<string> = new Set(),
344
+ languagePref?: string | undefined,
343
345
  ): SettingsTab {
346
+ const lang = resolveLanguage(languagePref, env)
347
+ const isPt = lang === 'pt-BR'
344
348
  const { config, corrupt } = read
345
349
  const rows: SettingsRow[] = [
346
350
  {
347
351
  id: 'decision.enabled',
348
- name: 'Router',
352
+ name: isPt ? 'Assistente Jev' : 'Router',
349
353
  value: config.enabled ? 'enabled' : 'disabled',
350
354
  // Corrupt config → read-only; the notice (glue) carries the remedy.
351
355
  ...(corrupt ? {} : { cycle: DECISION_ENABLED_CYCLE }),
352
356
  note: corrupt
353
- ? 'config unreadable/invalid — runtime fail-closes; repair via `decision-router setup-model`'
354
- : 'applies live — the runtime re-reads this on every gated call',
357
+ ? isPt
358
+ ? 'config inválida — runtime fail-closes; repair via `decision-router setup-model`'
359
+ : 'config unreadable/invalid — runtime fail-closes; repair via `decision-router setup-model`'
360
+ : isPt
361
+ ? 'applies live — arbitragem de decisões relida em tempo real a cada chamada'
362
+ : 'applies live — the runtime re-reads this on every gated call',
355
363
  },
356
364
  {
357
365
  id: 'decision.selection.mode',
358
- name: 'Selection mode',
366
+ name: isPt ? 'Modo de operação' : 'Selection mode',
359
367
  value: config.selection.mode,
360
368
  ...(corrupt ? {} : { cycle: DECISION_SELECTION_CYCLE }),
361
- note: 'local routes on-device; auto/explicit pick a remote decision model',
369
+ note: isPt
370
+ ? 'local = no seu PC (grátis); auto/explícito = modelo nuvem (OpenRouter)'
371
+ : 'local routes on-device; auto/explicit pick a remote decision model',
362
372
  },
363
373
  ]
364
- if (config.selection.mode === 'explicit' || config.selection.provider !== undefined) {
365
- rows.push({
366
- id: 'decision.selection.target',
367
- name: 'Explicit target',
368
- value: config.selection.provider
369
- ? `${config.selection.provider}/${config.selection.model ?? ''}`
370
- : 'none',
371
- ...(corrupt || config.selection.mode !== 'explicit' ? {} : { cycle: DECISION_TARGET_CYCLE }),
372
- note: 'provider/model — sets the candidate list',
373
- })
374
- }
375
- if (config.enabled_candidates.length > 0) {
374
+
375
+ // Model selection row: always visible so the user can choose the decision model
376
+ const explicitTarget = config.selection.provider
377
+ ? `${config.selection.provider}/${config.selection.model ?? ''}`
378
+ : (DECISION_TARGET_CYCLE[0] ?? 'openrouter-jev/typesafe/jev-1.13')
379
+ rows.push({
380
+ id: 'decision.selection.target',
381
+ name: isPt ? 'Modelo de decisão' : 'Explicit target',
382
+ value:
383
+ config.selection.mode === 'local'
384
+ ? config.selection.provider
385
+ ? `${config.selection.provider}/${config.selection.model ?? ''}`
386
+ : 'local (on-device)'
387
+ : explicitTarget,
388
+ ...(corrupt ? {} : { cycle: DECISION_TARGET_CYCLE }),
389
+ note: isPt
390
+ ? config.selection.mode === 'local'
391
+ ? 'ciclar seleciona modelo remoto e ativa modo explícito'
392
+ : 'provedor/modelo ativo — define candidato para arbitragem'
393
+ : config.selection.mode === 'local'
394
+ ? 'cycle to select a remote model and activate explicit mode'
395
+ : 'provider/model — sets the candidate list',
396
+ })
397
+
398
+ if ((config.enabled_candidates?.length ?? 0) > 0) {
376
399
  rows.push({
377
400
  id: 'decision.candidates',
378
- name: 'Candidates',
401
+ name: isPt ? 'Candidatos ativos' : 'Candidates',
379
402
  value: String(config.enabled_candidates.length),
380
403
  note: config.egress_consent
381
404
  ? config.enabled_candidates
382
405
  .map((candidate) => `${candidate.provider}/${candidate.model}`)
383
406
  .join(', ')
384
- : 'egress consent NOT granted — remote routes fail closed',
407
+ : isPt
408
+ ? 'egress consent NÃO concedido — rotas remotas bloqueadas'
409
+ : 'egress consent NOT granted — remote routes fail closed',
385
410
  })
386
411
  }
412
+
387
413
  rows.push({
388
414
  id: 'decision.consent',
389
- name: 'Egress consent',
415
+ name: isPt ? 'Acesso à nuvem (Egress)' : 'Egress consent',
390
416
  value: config.egress_consent ? 'granted' : 'not granted',
391
417
  ...(corrupt ? {} : { cycle: DECISION_CONSENT_CYCLE }),
392
- note: 'granted = remote decision routes may call their gateway (budget-capped)',
418
+ note: isPt
419
+ ? config.egress_consent
420
+ ? 'granted = rotas remotas podem consultar gateway de API (com teto de custo)'
421
+ : 'not granted = chamadas remotas bloqueadas; requer granted para nuvem'
422
+ : config.egress_consent
423
+ ? 'granted = remote decision routes may call their gateway (budget-capped)'
424
+ : 'not granted = remote routes fail closed; grant to allow cloud calls',
393
425
  })
426
+
394
427
  return {
395
428
  id: 'decision',
396
- title: 'Decision',
429
+ title: isPt ? 'Decisão' : 'Decision',
397
430
  groups: [
398
- { title: 'Decision router', rows },
431
+ { title: isPt ? 'Assistente de Decisão' : 'Decision router', rows },
399
432
  {
400
- title: 'Credentials (status only — values never enter the window)',
433
+ title: isPt
434
+ ? 'Credenciais (status apenas — valores nunca gravados na janela)'
435
+ : 'Credentials (status only — values never enter the window)',
401
436
  rows: DECISION_KNOWN_PROVIDERS.map((provider) => {
402
437
  const status = credentialStatus(provider, env, authProviders, configProviders)
403
438
  const credential = DECISION_PROVIDER_CREDENTIALS[provider] ?? { note: '' }
@@ -27,11 +27,13 @@ import {
27
27
  } from './model-usage-limits'
28
28
  import {
29
29
  openPantheonSettings,
30
+ PantheonSettingsSlot,
30
31
  pantheonSettingsBlocking,
31
32
  setupPantheonSettings,
32
33
  } from './pantheon-settings'
34
+ import { PRESET_NONE } from './preset-state'
33
35
  import { cellWidth, GRAPHEMES, SIDEBAR_CONTENT_WIDTH } from './sidebar-width'
34
- import { initTuiPrefs, tuiPrefs } from './tui-prefs'
36
+ import { initTuiPrefs, tuiDraftPreview, tuiPrefs } from './tui-prefs'
35
37
  import { nextCheckState, pickUpdateNotice, type UpdateCheckState } from './update-notice.ts'
36
38
  import { maybeShowWhatsNewV2 } from './whats-new'
37
39
 
@@ -66,7 +68,7 @@ const SPINNER_INTERVAL_MS = 80
66
68
  /** Bounded warm-up: sync at most this many sessions at plugin load. */
67
69
  const WARMUP_SESSION_LIMIT = 24
68
70
  /** Sidebar body shown while the host has not published a session yet. */
69
- export const SIDEBAR_WAITING_LABEL = 'Aguardando sessão…'
71
+ export const SIDEBAR_WAITING_LABEL = 'Waiting for session…'
70
72
  /** Delegate-completion toast title. */
71
73
  const TOAST_TITLE = 'Pantheon'
72
74
  /** Marker before the preset label (fixed header, home status, prompt footer).
@@ -700,7 +702,7 @@ export function contextBlockRows(
700
702
  const spent: ContextRow | null =
701
703
  spentValue === null
702
704
  ? null
703
- : { lead: null, value: spentValue, tail: null, suffix: ' gasto na sessão', tone: null }
705
+ : { lead: null, value: spentValue, tail: null, suffix: ' spent in session', tone: null }
704
706
  if (usage === null) return spent === null ? null : { tokens: null, percent: null, spent }
705
707
 
706
708
  const tokensValue = formatTokenCount(usage.tokens)
@@ -2323,7 +2325,7 @@ export function buildDispatchBlock(
2323
2325
  export const DISPATCH_PANEL_NAME = 'pantheon.dispatch'
2324
2326
  /** Toast shown when `ui.panel.open` refuses (no session route is active). The
2325
2327
  * panel only exists inside a session, so there is no alternative route. */
2326
- export const DISPATCH_PANEL_TOAST = 'Abra uma sessão para ver o Dispatch'
2328
+ export const DISPATCH_PANEL_TOAST = 'Open a session to view Dispatch'
2327
2329
  /** Panel title marker — the same glyph the sidebar block header uses. */
2328
2330
  export const DISPATCH_PANEL_HEADER_MARKER = '\u25C8'
2329
2331
  /** Selected-row gutter marker (`▸`, one cell). */
@@ -2335,7 +2337,7 @@ export const DISPATCH_PANEL_RULE_CHAR = '\u2500'
2335
2337
  /** Em dash for any datum the host did not publish. */
2336
2338
  export const DISPATCH_PANEL_DASH = '\u2014'
2337
2339
  /** Body of an empty panel (the claim still renders, the list is just empty). */
2338
- export const DISPATCH_PANEL_EMPTY_TEXT = 'Nenhuma sessão delegada'
2340
+ export const DISPATCH_PANEL_EMPTY_TEXT = 'No delegated sessions'
2339
2341
  /** Width at or above which the list and the detail sit side by side. */
2340
2342
  export const DISPATCH_PANEL_WIDE_MIN_WIDTH = 72
2341
2343
  /** Rows the viewport holds; pageup/pagedown move by exactly this many rows. */
@@ -2643,42 +2645,42 @@ export const DISPATCH_PANEL_COMMANDS: readonly DispatchPanelCommandSpec[] = [
2643
2645
  {
2644
2646
  action: 'up',
2645
2647
  id: 'pantheon.dispatch.up',
2646
- title: 'Dispatch: selecionar anterior',
2648
+ title: 'Dispatch: select previous',
2647
2649
  bind: 'k,up',
2648
2650
  },
2649
2651
  {
2650
2652
  action: 'down',
2651
2653
  id: 'pantheon.dispatch.down',
2652
- title: 'Dispatch: selecionar próxima',
2654
+ title: 'Dispatch: select next',
2653
2655
  bind: 'j,down',
2654
2656
  },
2655
- { action: 'home', id: 'pantheon.dispatch.home', title: 'Dispatch: primeira', bind: 'home' },
2656
- { action: 'end', id: 'pantheon.dispatch.end', title: 'Dispatch: última', bind: 'end' },
2657
+ { action: 'home', id: 'pantheon.dispatch.home', title: 'Dispatch: first', bind: 'home' },
2658
+ { action: 'end', id: 'pantheon.dispatch.end', title: 'Dispatch: last', bind: 'end' },
2657
2659
  {
2658
2660
  action: 'pageup',
2659
2661
  id: 'pantheon.dispatch.pageup',
2660
- title: 'Dispatch: página acima',
2662
+ title: 'Dispatch: page up',
2661
2663
  bind: 'pageup',
2662
2664
  },
2663
2665
  {
2664
2666
  action: 'pagedown',
2665
2667
  id: 'pantheon.dispatch.pagedown',
2666
- title: 'Dispatch: página abaixo',
2668
+ title: 'Dispatch: page down',
2667
2669
  bind: 'pagedown',
2668
2670
  },
2669
2671
  {
2670
2672
  action: 'toggle',
2671
2673
  id: 'pantheon.dispatch.toggle',
2672
- title: 'Dispatch: expandir detalhe',
2674
+ title: 'Dispatch: expand detail',
2673
2675
  bind: 'enter',
2674
2676
  },
2675
2677
  {
2676
2678
  action: 'fullscreen',
2677
2679
  id: 'pantheon.dispatch.fullscreen',
2678
- title: 'Dispatch: tela cheia',
2680
+ title: 'Dispatch: fullscreen',
2679
2681
  bind: 'f',
2680
2682
  },
2681
- { action: 'close', id: 'pantheon.dispatch.close', title: 'Dispatch: fechar', bind: 'escape,q' },
2683
+ { action: 'close', id: 'pantheon.dispatch.close', title: 'Dispatch: close', bind: 'escape,q' },
2682
2684
  ]
2683
2685
 
2684
2686
  /** Run one action against the model and the host-owned panel input. Kept apart
@@ -2741,10 +2743,10 @@ export function dispatchPanelFooter(shortcutsOf: (id: string) => readonly string
2741
2743
  return text === '' ? DISPATCH_PANEL_DASH : text
2742
2744
  }
2743
2745
  return [
2744
- `${keys('pantheon.dispatch.up')} ${keys('pantheon.dispatch.down')} mover`,
2745
- `${keys('pantheon.dispatch.toggle')} detalhe`,
2746
+ `${keys('pantheon.dispatch.up')} ${keys('pantheon.dispatch.down')} move`,
2747
+ `${keys('pantheon.dispatch.toggle')} detail`,
2746
2748
  `${keys('pantheon.dispatch.fullscreen')} fullscreen`,
2747
- `${keys('pantheon.dispatch.close')} fechar`,
2749
+ `${keys('pantheon.dispatch.close')} close`,
2748
2750
  ].join(SPEND_LINE_SEPARATOR)
2749
2751
  }
2750
2752
 
@@ -3166,7 +3168,18 @@ function useActivePreset(context: any): {
3166
3168
  clearInterval(timer)
3167
3169
  })
3168
3170
  })
3169
- return { preset, overrides }
3171
+ const effectivePreset = () => {
3172
+ const preview = tuiDraftPreview()
3173
+ if (preview && 'preset' in preview) {
3174
+ const stagedName = preview.preset
3175
+ return {
3176
+ ...preset(),
3177
+ name: stagedName === PRESET_NONE ? null : stagedName,
3178
+ }
3179
+ }
3180
+ return preset()
3181
+ }
3182
+ return { preset: effectivePreset, overrides }
3170
3183
  }
3171
3184
 
3172
3185
  /** Debounce for the git file-count revalidation. `vcs.status` is an HTTP call;
@@ -3939,10 +3952,10 @@ function ContextRowView(props: { row: ContextRow; fg: string; muted: string }) {
3939
3952
  )
3940
3953
  return (
3941
3954
  <Show
3942
- when={props.row.suffix !== ' gasto na sessão'}
3955
+ when={props.row.suffix !== ' spent in session'}
3943
3956
  fallback={
3944
3957
  <box flexDirection="column">
3945
- <For each={sidebarMoneyLines('gasto na sessão', props.row.value)}>
3958
+ <For each={sidebarMoneyLines('spent in session', props.row.value)}>
3946
3959
  {(line) => <text fg={props.fg}>{line}</text>}
3947
3960
  </For>
3948
3961
  </box>
@@ -4094,7 +4107,7 @@ function Sidebar(props: SidebarProps): JSX.Element {
4094
4107
  }
4095
4108
  >
4096
4109
  {(current: any) => (
4097
- <text fg={text()}>{`Sessão: ${truncateLabel(current().title || current().id)}`}</text>
4110
+ <text fg={text()}>{`Session: ${truncateLabel(current().title || current().id)}`}</text>
4098
4111
  )}
4099
4112
  </Show>
4100
4113
 
@@ -4133,9 +4146,9 @@ function Sidebar(props: SidebarProps): JSX.Element {
4133
4146
  single accent. When no message carries cost this loop is empty
4134
4147
  and the block keeps its original token/spend rows. */}
4135
4148
  <Show when={tuiPrefs().sidebar.context.modelUsage && usageRows().length > 0}>
4136
- <text fg={muted()}>Sessão · custo reportado</text>
4149
+ <text fg={muted()}>Session · reported cost</text>
4137
4150
  <text fg={muted()}>
4138
- {'Modelo'.padEnd(MODEL_USAGE_MODEL_WIDTH) +
4151
+ {'Model'.padEnd(MODEL_USAGE_MODEL_WIDTH) +
4139
4152
  ' Tokens'.padStart(8) +
4140
4153
  ' USD'.padStart(10)}
4141
4154
  </text>
@@ -4651,6 +4664,13 @@ const plugin = Plugin.define({
4651
4664
  } catch {
4652
4665
  /* settings unavailable on this host — the command toasts/fails open */
4653
4666
  }
4667
+ // In-session settings docked above prompt (session.composer.top)
4668
+ const unregisterSettingsSlot = context.ui.slot({
4669
+ append: 'session.composer.top',
4670
+ render: ({ sessionID }: { sessionID: string }) => (
4671
+ <PantheonSettingsSlot context={context} sessionID={sessionID} />
4672
+ ),
4673
+ })
4654
4674
  // One-time "What's new" window (per Pantheon version) — fire-and-forget:
4655
4675
  // resolves the running version and the shipped CHANGELOG.md, then opens a
4656
4676
  // host dialog when the version changed since the last dismissal. Fail-open;
@@ -4662,6 +4682,7 @@ const plugin = Plugin.define({
4662
4682
  if (typeof unregisterHome === 'function') unregisterHome()
4663
4683
  if (typeof unregisterPromptFooter === 'function') unregisterPromptFooter()
4664
4684
  if (typeof unregisterPanel === 'function') unregisterPanel()
4685
+ if (typeof unregisterSettingsSlot === 'function') unregisterSettingsSlot()
4665
4686
  if (typeof unregisterCommands === 'function') unregisterCommands()
4666
4687
  if (typeof unregisterSettingsCommands === 'function') unregisterSettingsCommands()
4667
4688
  delete globalState[SINGLETON]
@@ -11,6 +11,7 @@
11
11
  * (beta.3 candidate), not a window change.
12
12
  */
13
13
  import type { SettingsTab } from './pantheon-settings-state.ts'
14
+ import { resolveLanguage } from './settings-i18n.ts'
14
15
 
15
16
  export const J1_FLAG_ENV = 'PANTHEON_J1_RISK_SCORE'
16
17
  export const J1_THRESHOLD_ENV = 'PANTHEON_J1_ENFORCE_THRESHOLD'
@@ -37,17 +38,27 @@ export function j1ThresholdFromEnv(env: Record<string, string | undefined> = pro
37
38
  return raw
38
39
  }
39
40
 
40
- const MODE_DESCRIPTION: Record<J1Mode, string> = {
41
+ const MODE_DESCRIPTION_EN: Record<J1Mode, string> = {
41
42
  off: 'nothing fires (hard zero)',
42
43
  shadow: 'observe + record; invisible in the session',
43
44
  warn: 'RESERVED — behaves as shadow in this release',
44
45
  enforce: 'high-risk scores DENY the tool call (fail-open on gate unavailability)',
45
46
  }
46
47
 
48
+ const MODE_DESCRIPTION_PT: Record<J1Mode, string> = {
49
+ off: 'desativado (hard zero)',
50
+ shadow: 'observa + registra telemetria (modo silencioso)',
51
+ warn: 'RESERVADO (RESERVED) — comporta-se como shadow nesta versão',
52
+ enforce: 'alto risco bloqueia a ferramenta (fail-open se indisponível)',
53
+ }
54
+
47
55
  export function buildJ1Tab(
48
56
  env: Record<string, string | undefined>,
49
57
  disabledByOverride: boolean,
58
+ languagePref?: string | undefined,
50
59
  ): SettingsTab {
60
+ const lang = resolveLanguage(languagePref)
61
+ const isPt = lang === 'pt-BR'
51
62
  const mode = j1ModeFromEnv(env)
52
63
  const threshold = j1ThresholdFromEnv(env)
53
64
  const gateState = disabledByOverride
@@ -55,30 +66,36 @@ export function buildJ1Tab(
55
66
  : mode === 'off'
56
67
  ? 'off (env unset)'
57
68
  : 'active'
69
+ const desc = isPt ? MODE_DESCRIPTION_PT[mode] : MODE_DESCRIPTION_EN[mode]
70
+
58
71
  return {
59
72
  id: 'j1',
60
- title: 'J1',
73
+ title: isPt ? 'Segurança J1' : 'J1',
61
74
  groups: [
62
75
  {
63
- title: 'Ladder (env-only — never written here)',
76
+ title: isPt
77
+ ? 'Nível de Segurança e Portão de Risco J1 (env-only)'
78
+ : 'Safety Level & Risk Gate (J1) (env-only — never written here)',
64
79
  rows: [
65
80
  {
66
81
  id: 'j1.mode',
67
- name: 'Mode',
82
+ name: isPt ? 'Modo de execução' : 'Mode',
68
83
  value: mode,
69
- note: `${MODE_DESCRIPTION[mode]} · restart applies`,
84
+ note: `${desc} · ${isPt ? 'reinício necessário (restart applies)' : 'restart applies'}`,
70
85
  },
71
86
  {
72
87
  id: 'j1.threshold',
73
- name: 'Enforce threshold',
88
+ name: isPt ? 'Limiar de bloqueio' : 'Enforce threshold',
74
89
  value: String(threshold),
75
- note: 'deny at or above · 0..1 · default 0.8',
90
+ note: isPt
91
+ ? 'bloqueia em ou acima · 0..1 · padrão 0.8'
92
+ : 'deny at or above · 0..1 · default 0.8',
76
93
  },
77
94
  {
78
95
  id: 'j1.gate',
79
- name: 'Gate',
96
+ name: isPt ? 'Estado do portão' : 'Gate',
80
97
  value: gateState,
81
- note: `${J1_FLAG_ENV} / ${J1_THRESHOLD_ENV} · read once at startup`,
98
+ note: `${J1_FLAG_ENV} / ${J1_THRESHOLD_ENV} · ${isPt ? 'lido na inicialização' : 'read once at startup'}`,
82
99
  },
83
100
  ],
84
101
  },