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.
- package/AGENTS.global.md +2 -2
- package/AGENTS.md +8 -8
- package/CHANGELOG.md +92 -0
- package/README.md +15 -2
- package/README.pt-BR.md +15 -2
- package/bin/pantheon-init.mjs +13 -0
- package/commands/pantheon-audit.md +1 -1
- package/commands/pantheon-deepwork.md +1 -1
- package/commands/pantheon-optimize.md +41 -63
- package/package.json +4 -3
- package/plugin.json +1 -1
- package/prompts/optimize-database.prompt.md +5 -5
- package/prompts/plan-architecture.prompt.md +6 -6
- package/pyproject.toml +1 -1
- package/scripts/build-agents-md.mjs +10 -10
- package/scripts/build-plugin.mjs +26 -0
- package/scripts/install/opencode-version.mjs +17 -5
- package/scripts/install/opencode.mjs +8 -1
- package/scripts/optimize.mjs +322 -0
- package/scripts/prune.mjs +105 -14
- package/scripts/update.mjs +20 -15
- package/skills-lock.json +11 -11
- package/src/agents/aphrodite.md +15 -14
- package/src/agents/apollo.md +2 -1
- package/src/agents/athena.md +19 -12
- package/src/agents/demeter.md +2 -0
- package/src/agents/hephaestus.md +1 -0
- package/src/agents/hermes.md +19 -95
- package/src/agents/iris.md +3 -0
- package/src/agents/nyx.md +1 -0
- package/src/agents/prometheus.md +2 -0
- package/src/agents/talos.md +3 -0
- package/src/agents/themis.md +91 -87
- package/src/agents/zeus.md +41 -266
- package/src/instructions/agent-return-format.instructions.md +1 -1
- package/src/instructions/memory-protocol.instructions.md +1 -1
- package/src/instructions/zeus-anti-stall.instructions.md +3 -3
- package/src/instructions/zeus-communication-rules.instructions.md +1 -1
- package/src/instructions/zeus-council-synthesis.instructions.md +29 -10
- package/src/instructions/zeus-timeout-retry.instructions.md +10 -10
- package/src/pantheon/model-command.ts +12 -12
- package/src/pantheon/tools.ts +4 -0
- package/src/pantheon/tui-version-check.ts +1 -1
- package/src/pantheon/update-notifier.ts +13 -8
- package/src/pantheon/vision.ts +20 -20
- package/src/plugin/index.js +14594 -0
- package/src/plugins/tui/dist/tui.d.ts +3 -3
- package/src/plugins/tui/dist/tui.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui.js +1028 -393
- 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 +66 -25
- package/src/plugins/tui/src/decision-router-state.ts +59 -24
- package/src/plugins/tui/src/index.tsx +44 -23
- package/src/plugins/tui/src/j1-gate-status.ts +26 -9
- package/src/plugins/tui/src/pantheon-settings.tsx +484 -124
- package/src/plugins/tui/src/settings-i18n.ts +203 -0
- package/src/plugins/tui/src/tui-prefs.ts +131 -4
- package/src/plugins/tui/src/update-notice.ts +9 -6
- package/src/plugins/tui/src/whats-new-open.ts +4 -4
- package/src/plugins/tui/src/whats-new.tsx +119 -17
- package/src/skills/agent-coordination/SKILL.md +6 -6
- package/src/skills/artifact-management/SKILL.md +43 -39
- package/src/skills/artifact-management/references/artifact-templates.md +103 -48
- package/src/skills/auto-continue/references/auto-continue-details.md +13 -13
- package/src/skills/code-review-checklist/SKILL.md +6 -6
- package/src/skills/incremental-implementation/SKILL.md +13 -13
- package/src/skills/memory-bank/references/anti-patterns.md +3 -3
- package/src/skills/spec-driven-development/SKILL.md +12 -14
- package/src/skills/tdd-with-agents/SKILL.md +6 -5
- package/src/skills/visual-review-pipeline/SKILL.md +1 -1
- package/src/skills/visual-review-pipeline/references/workflow-steps.md +1 -1
|
@@ -0,0 +1,203 @@
|
|
|
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', otherwise 'en'.
|
|
21
|
+
*/
|
|
22
|
+
export function resolveLanguage(
|
|
23
|
+
preference: string = 'auto',
|
|
24
|
+
env: Record<string, string | undefined> = process.env,
|
|
25
|
+
): 'pt-BR' | 'en' {
|
|
26
|
+
if (preference === 'pt-BR') return 'pt-BR'
|
|
27
|
+
if (preference === 'en') return 'en'
|
|
28
|
+
|
|
29
|
+
// Auto-detection based on environment locale
|
|
30
|
+
const lang = (env.LC_ALL ?? env.LC_MESSAGES ?? env.LANG ?? '').toLowerCase()
|
|
31
|
+
if (lang.startsWith('pt')) return 'pt-BR'
|
|
32
|
+
|
|
33
|
+
return 'en'
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface I18nStringPair {
|
|
37
|
+
en: string
|
|
38
|
+
pt: string
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const I18N = {
|
|
42
|
+
tabs: {
|
|
43
|
+
decision: { en: 'Decision (Jev)', pt: 'Decisão (Jev)' },
|
|
44
|
+
autonomy: { en: 'Autonomy', pt: 'Autonomia' },
|
|
45
|
+
safety: { en: 'Safety (J1)', pt: 'Segurança (J1)' },
|
|
46
|
+
tui: { en: 'TUI', pt: 'TUI' },
|
|
47
|
+
},
|
|
48
|
+
decision: {
|
|
49
|
+
groupRouter: {
|
|
50
|
+
en: 'Decision Router (Jev Assistant)',
|
|
51
|
+
pt: 'Assistente de Decisão (Jev)',
|
|
52
|
+
},
|
|
53
|
+
groupCredentials: {
|
|
54
|
+
en: 'Credentials (status only — values never enter the window)',
|
|
55
|
+
pt: 'Credenciais (apenas status — valores protegidos)',
|
|
56
|
+
},
|
|
57
|
+
routerName: {
|
|
58
|
+
en: 'Router (Decision Assistant)',
|
|
59
|
+
pt: 'Assistente Jev',
|
|
60
|
+
},
|
|
61
|
+
routerNote: {
|
|
62
|
+
en: 'applies live — enables intelligent route arbitration and candidate ranking',
|
|
63
|
+
pt: 'aplica em tempo real — motor de arbitragem inteligente e ranking de rotas',
|
|
64
|
+
},
|
|
65
|
+
modelName: {
|
|
66
|
+
en: 'Decision model',
|
|
67
|
+
pt: 'Modelo de Decisão',
|
|
68
|
+
},
|
|
69
|
+
modelNote: {
|
|
70
|
+
en: 'local routes on-device (free); auto/explicit pick a remote decision model',
|
|
71
|
+
pt: 'local decide no seu PC (grátis); auto/explícito usa modelo nuvem (OpenRouter)',
|
|
72
|
+
},
|
|
73
|
+
selectionModeName: {
|
|
74
|
+
en: 'Selection mode',
|
|
75
|
+
pt: 'Modo de operação',
|
|
76
|
+
},
|
|
77
|
+
selectionModeNote: {
|
|
78
|
+
en: 'local routes on-device; auto/explicit pick a remote decision model',
|
|
79
|
+
pt: 'local decide no dispositivo; auto/explícito usa modelo remoto',
|
|
80
|
+
},
|
|
81
|
+
egressName: {
|
|
82
|
+
en: 'Cloud API access (Egress)',
|
|
83
|
+
pt: 'Acesso à Nuvem (Egress)',
|
|
84
|
+
},
|
|
85
|
+
egressNoteGranted: {
|
|
86
|
+
en: 'granted = remote decision routes may call their gateway (budget-capped)',
|
|
87
|
+
pt: 'permitido = rotas remotas podem consultar a API (com limite de orçamento)',
|
|
88
|
+
},
|
|
89
|
+
egressNoteNotGranted: {
|
|
90
|
+
en: 'not granted = remote routes blocked; local heuristic decisions only',
|
|
91
|
+
pt: 'não permitido = chamadas remotas bloqueadas; apenas heurística local',
|
|
92
|
+
},
|
|
93
|
+
candidatesName: {
|
|
94
|
+
en: 'Active candidates',
|
|
95
|
+
pt: 'Candidatos ativos',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
autonomy: {
|
|
99
|
+
groupGoalLoop: {
|
|
100
|
+
en: 'Goal loop (multi-turn session auto-continuation)',
|
|
101
|
+
pt: 'Execução Contínua (Goal Loop)',
|
|
102
|
+
},
|
|
103
|
+
goalLoopName: {
|
|
104
|
+
en: 'Goal loop',
|
|
105
|
+
pt: 'Loop contínuo',
|
|
106
|
+
},
|
|
107
|
+
goalLoopNote: {
|
|
108
|
+
en: 'auto-continues multi-turn tasks when session goes idle · applies after OpenCode restart',
|
|
109
|
+
pt: 'continua tarefas de múltiplos passos automaticamente · requer reinício',
|
|
110
|
+
},
|
|
111
|
+
maxContinuationsName: {
|
|
112
|
+
en: 'Max continuations',
|
|
113
|
+
pt: 'Limite de turnos',
|
|
114
|
+
},
|
|
115
|
+
maxContinuationsNote: {
|
|
116
|
+
en: '1..200 — safety ceiling to prevent runaway tasks',
|
|
117
|
+
pt: '1..200 — teto de segurança contra tarefas infinitas',
|
|
118
|
+
},
|
|
119
|
+
cooldownName: {
|
|
120
|
+
en: 'Cooldown (ms)',
|
|
121
|
+
pt: 'Intervalo (ms)',
|
|
122
|
+
},
|
|
123
|
+
cooldownNote: {
|
|
124
|
+
en: 'delay between autonomous turns (min 1000ms)',
|
|
125
|
+
pt: 'tempo de espera entre turnos autônomos (mín 1000ms)',
|
|
126
|
+
},
|
|
127
|
+
groupBudgets: {
|
|
128
|
+
en: 'Decision budgets (applies live per gated call)',
|
|
129
|
+
pt: 'Orçamento Jev (teto financeiro de proteção)',
|
|
130
|
+
},
|
|
131
|
+
monthlyCapName: {
|
|
132
|
+
en: 'Monthly cap',
|
|
133
|
+
pt: 'Teto mensal (USD)',
|
|
134
|
+
},
|
|
135
|
+
monthlyCapNote: {
|
|
136
|
+
en: 'monthly USD ceiling for gated arbitrator decisions',
|
|
137
|
+
pt: 'teto mensal em dólares para decisões do assistente Jev',
|
|
138
|
+
},
|
|
139
|
+
perDecisionCapName: {
|
|
140
|
+
en: 'Per-decision cap',
|
|
141
|
+
pt: 'Teto por consulta (USD)',
|
|
142
|
+
},
|
|
143
|
+
perDecisionCapNote: {
|
|
144
|
+
en: 'price cap — gated decisions above this are refused',
|
|
145
|
+
pt: 'teto por decisão — consultas remotas que excederem são recusadas',
|
|
146
|
+
},
|
|
147
|
+
groupGradient: {
|
|
148
|
+
en: 'Decision gradient (reference policy · J1 owns the risk axis)',
|
|
149
|
+
pt: 'Níveis de Decisão & Segurança (Referência)',
|
|
150
|
+
},
|
|
151
|
+
soloName: {
|
|
152
|
+
en: 'Decide solo',
|
|
153
|
+
pt: 'Decisão direta',
|
|
154
|
+
},
|
|
155
|
+
soloNote: {
|
|
156
|
+
en: 'reversible & low-risk edits, routine fixes (no gate)',
|
|
157
|
+
pt: 'edições reversíveis e baixo risco, sem portão de bloqueio',
|
|
158
|
+
},
|
|
159
|
+
jevName: {
|
|
160
|
+
en: 'Jev decides',
|
|
161
|
+
pt: 'Decisão Jev',
|
|
162
|
+
},
|
|
163
|
+
jevNote: {
|
|
164
|
+
en: 'typed ambiguity & candidate ranking (budget-capped)',
|
|
165
|
+
pt: 'ambiguidade e ranking de skills com teto de orçamento',
|
|
166
|
+
},
|
|
167
|
+
humanName: {
|
|
168
|
+
en: 'Human decides',
|
|
169
|
+
pt: 'Aprovação humana',
|
|
170
|
+
},
|
|
171
|
+
humanNote: {
|
|
172
|
+
en: 'high-risk & destructive operations (J1 gate)',
|
|
173
|
+
pt: 'ações de alto risco e destrutivas (portão de segurança J1)',
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
safety: {
|
|
177
|
+
groupSafety: {
|
|
178
|
+
en: 'Safety & Risk Level (J1 Gate)',
|
|
179
|
+
pt: 'Nível de Proteção & Portão de Risco (J1)',
|
|
180
|
+
},
|
|
181
|
+
modeName: {
|
|
182
|
+
en: 'Protection mode',
|
|
183
|
+
pt: 'Modo de proteção',
|
|
184
|
+
},
|
|
185
|
+
thresholdName: {
|
|
186
|
+
en: 'Enforce threshold',
|
|
187
|
+
pt: 'Teto para bloqueio',
|
|
188
|
+
},
|
|
189
|
+
thresholdNote: {
|
|
190
|
+
en: 'deny at or above · 0..1 · default 0.8',
|
|
191
|
+
pt: 'bloqueia em ou acima de · 0..1 · padrão 0.8',
|
|
192
|
+
},
|
|
193
|
+
gateName: {
|
|
194
|
+
en: 'Safety gate',
|
|
195
|
+
pt: 'Portão de segurança',
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
} as const
|
|
199
|
+
|
|
200
|
+
/** Helper to get localized text */
|
|
201
|
+
export function t(entry: I18nStringPair, lang: 'pt-BR' | 'en'): string {
|
|
202
|
+
return lang === 'pt-BR' ? entry.pt : entry.en
|
|
203
|
+
}
|
|
@@ -12,8 +12,11 @@
|
|
|
12
12
|
* sub-lines and gauge style, and the two Pantheon footer lines. Everything
|
|
13
13
|
* defaults to on — the window exists to turn things OFF.
|
|
14
14
|
*/
|
|
15
|
+
|
|
15
16
|
import type { Context } from '@opencode/plugin/tui/context'
|
|
16
|
-
import type {
|
|
17
|
+
import type { Accessor, Setter } from 'solid-js'
|
|
18
|
+
import { createSignal } from 'solid-js'
|
|
19
|
+
import type { SettingsDraft, SettingsRow, SettingsTab } from './pantheon-settings-state.ts'
|
|
17
20
|
|
|
18
21
|
// ── The durable store handle (host storage, one per plugin) ────────────
|
|
19
22
|
// Created once at setup and stashed under a globalThis symbol so
|
|
@@ -21,12 +24,40 @@ import type { SettingsRow, SettingsTab } from './pantheon-settings-state.ts'
|
|
|
21
24
|
// singleton doctrine as the plugin's SINGLETON guard).
|
|
22
25
|
|
|
23
26
|
const PREFS_SYMBOL = Symbol.for('pantheon.tui.prefs.v1')
|
|
27
|
+
const DRAFT_PREVIEW_SYMBOL = Symbol.for('pantheon.tui.draft_preview.v1')
|
|
24
28
|
type PrefsStore = readonly [TuiPrefs, (mutation: (draft: TuiPrefs) => void) => Promise<void>]
|
|
29
|
+
type DraftSignal = [Accessor<SettingsDraft | undefined>, Setter<SettingsDraft | undefined>]
|
|
25
30
|
|
|
26
31
|
function stash(): PrefsStore | undefined {
|
|
27
32
|
return (globalThis as Record<PropertyKey, unknown>)[PREFS_SYMBOL] as PrefsStore | undefined
|
|
28
33
|
}
|
|
29
34
|
|
|
35
|
+
function getDraftPreviewSignal(): DraftSignal {
|
|
36
|
+
const g = globalThis as Record<PropertyKey, unknown>
|
|
37
|
+
if (!g[DRAFT_PREVIEW_SYMBOL]) {
|
|
38
|
+
g[DRAFT_PREVIEW_SYMBOL] = createSignal<SettingsDraft | undefined>(undefined)
|
|
39
|
+
}
|
|
40
|
+
return g[DRAFT_PREVIEW_SYMBOL] as DraftSignal
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Set the active draft preview overlay (used by settings window to provide live preview). */
|
|
44
|
+
export function setTuiDraftPreview(draft: SettingsDraft | undefined): void {
|
|
45
|
+
const [, setDraft] = getDraftPreviewSignal()
|
|
46
|
+
setDraft(draft && Object.keys(draft).length > 0 ? { ...draft } : undefined)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Clear the active draft preview overlay. */
|
|
50
|
+
export function clearTuiDraftPreview(): void {
|
|
51
|
+
const [, setDraft] = getDraftPreviewSignal()
|
|
52
|
+
setDraft(undefined)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** The active draft preview accessor. */
|
|
56
|
+
export function tuiDraftPreview(): SettingsDraft | undefined {
|
|
57
|
+
const [draft] = getDraftPreviewSignal()
|
|
58
|
+
return draft()
|
|
59
|
+
}
|
|
60
|
+
|
|
30
61
|
/** Create (or reuse) the durable prefs store. Fail-open: without host
|
|
31
62
|
* storage the consumers fall back to DEFAULT_TUI_PREFS (read-only). */
|
|
32
63
|
export function initTuiPrefs(context: Context): void {
|
|
@@ -51,8 +82,40 @@ export function initTuiPrefs(context: Context): void {
|
|
|
51
82
|
}
|
|
52
83
|
}
|
|
53
84
|
|
|
54
|
-
/**
|
|
55
|
-
export function
|
|
85
|
+
/** Deep clone and overlay staged settings draft onto base TuiPrefs. */
|
|
86
|
+
export function previewTuiPrefs(base: TuiPrefs, draft?: SettingsDraft): TuiPrefs {
|
|
87
|
+
if (!draft || Object.keys(draft).length === 0) return base
|
|
88
|
+
let hasTui = false
|
|
89
|
+
for (const k of Object.keys(draft)) {
|
|
90
|
+
if (k.startsWith('tui.')) {
|
|
91
|
+
hasTui = true
|
|
92
|
+
break
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (!hasTui) return base
|
|
96
|
+
|
|
97
|
+
const normalized = normalizeTuiPrefs(base)
|
|
98
|
+
const effective: TuiPrefs = {
|
|
99
|
+
version: 1,
|
|
100
|
+
layout: { ...normalized.layout },
|
|
101
|
+
sidebar: {
|
|
102
|
+
header: { ...normalized.sidebar.header },
|
|
103
|
+
blocks: { ...normalized.sidebar.blocks },
|
|
104
|
+
context: { ...normalized.sidebar.context },
|
|
105
|
+
},
|
|
106
|
+
footer: { ...normalized.footer },
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
for (const [id, value] of Object.entries(draft)) {
|
|
110
|
+
if (id.startsWith('tui.')) {
|
|
111
|
+
applyTuiRow(effective, id, value)
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return effective
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** The raw persisted prefs from host storage (no draft overlay). */
|
|
118
|
+
export function savedTuiPrefs(): TuiPrefs {
|
|
56
119
|
const s = stash()?.[0]
|
|
57
120
|
if (!s) return DEFAULT_TUI_PREFS
|
|
58
121
|
if (!s.layout) {
|
|
@@ -64,6 +127,16 @@ export function tuiPrefs(): TuiPrefs {
|
|
|
64
127
|
return s
|
|
65
128
|
}
|
|
66
129
|
|
|
130
|
+
/** The live reactive prefs (read properties inside memos/JSX — tracked).
|
|
131
|
+
* When a settings window has an active draft, preview overlays on top
|
|
132
|
+
* of durable storage in real time. */
|
|
133
|
+
export function tuiPrefs(): TuiPrefs {
|
|
134
|
+
const base = savedTuiPrefs()
|
|
135
|
+
const preview = tuiDraftPreview()
|
|
136
|
+
if (!preview) return base
|
|
137
|
+
return previewTuiPrefs(base, preview)
|
|
138
|
+
}
|
|
139
|
+
|
|
67
140
|
/** Stage a mutation against the durable store; resolves when persisted. */
|
|
68
141
|
export function mutateTuiPrefs(mutation: (draft: TuiPrefs) => void): Promise<void> {
|
|
69
142
|
const handle = stash()
|
|
@@ -95,18 +168,29 @@ export const SEPARATOR_STYLES_CYCLE: readonly string[] = Object.freeze([
|
|
|
95
168
|
'dots',
|
|
96
169
|
'slashes',
|
|
97
170
|
])
|
|
171
|
+
export const SETTINGS_VIEW_MODES: readonly string[] = Object.freeze([
|
|
172
|
+
'docked',
|
|
173
|
+
'fullscreen',
|
|
174
|
+
'dialog',
|
|
175
|
+
])
|
|
98
176
|
|
|
99
177
|
export type GaugeStyle = 'both' | 'bar' | 'percent' | 'off'
|
|
100
178
|
export type BarShapePref = 'line' | 'block' | 'smooth' | 'ascii' | 'dots' | 'braille'
|
|
101
179
|
export type BarWidthPref = 'standard' | 'compact' | 'wide' | 'full'
|
|
102
180
|
export type LayoutPresetPref = 'comfortable' | 'compact'
|
|
103
181
|
export type SeparatorStylePref = 'spaces' | 'pipes' | 'dots' | 'slashes'
|
|
182
|
+
export type SettingsViewModePref = 'docked' | 'fullscreen' | 'dialog'
|
|
183
|
+
export type LanguagePref = 'auto' | 'pt-BR' | 'en'
|
|
184
|
+
|
|
185
|
+
export const LANGUAGE_CYCLE: readonly string[] = Object.freeze(['auto', 'pt-BR', 'en'])
|
|
104
186
|
|
|
105
187
|
export interface TuiPrefs {
|
|
106
188
|
version: 1
|
|
107
189
|
layout: {
|
|
108
190
|
preset: LayoutPresetPref
|
|
109
191
|
separator: SeparatorStylePref
|
|
192
|
+
settingsView?: SettingsViewModePref
|
|
193
|
+
language?: LanguagePref
|
|
110
194
|
}
|
|
111
195
|
sidebar: {
|
|
112
196
|
header: { version: boolean; preset: boolean; session: boolean }
|
|
@@ -131,6 +215,8 @@ export const DEFAULT_TUI_PREFS: TuiPrefs = {
|
|
|
131
215
|
layout: {
|
|
132
216
|
preset: 'comfortable',
|
|
133
217
|
separator: 'spaces',
|
|
218
|
+
settingsView: 'fullscreen',
|
|
219
|
+
language: 'auto',
|
|
134
220
|
},
|
|
135
221
|
sidebar: {
|
|
136
222
|
header: { version: true, preset: true, session: true },
|
|
@@ -181,6 +267,16 @@ export function normalizeTuiPrefs(raw: unknown): TuiPrefs {
|
|
|
181
267
|
const separator = SEPARATOR_STYLES_CYCLE.includes(layout.separator as string)
|
|
182
268
|
? (layout.separator as SeparatorStylePref)
|
|
183
269
|
: DEFAULT_TUI_PREFS.layout.separator
|
|
270
|
+
const settingsView = (
|
|
271
|
+
SETTINGS_VIEW_MODES.includes(layout.settingsView as string)
|
|
272
|
+
? layout.settingsView
|
|
273
|
+
: DEFAULT_TUI_PREFS.layout.settingsView
|
|
274
|
+
) as SettingsViewModePref
|
|
275
|
+
const language = (
|
|
276
|
+
LANGUAGE_CYCLE.includes(layout.language as string)
|
|
277
|
+
? layout.language
|
|
278
|
+
: DEFAULT_TUI_PREFS.layout.language
|
|
279
|
+
) as LanguagePref
|
|
184
280
|
const gauge = GAUGE_STYLES.includes(context.gauge as string)
|
|
185
281
|
? (context.gauge as GaugeStyle)
|
|
186
282
|
: DEFAULT_TUI_PREFS.sidebar.context.gauge
|
|
@@ -197,6 +293,8 @@ export function normalizeTuiPrefs(raw: unknown): TuiPrefs {
|
|
|
197
293
|
layout: {
|
|
198
294
|
preset,
|
|
199
295
|
separator,
|
|
296
|
+
settingsView,
|
|
297
|
+
language,
|
|
200
298
|
},
|
|
201
299
|
sidebar: {
|
|
202
300
|
header: {
|
|
@@ -262,6 +360,20 @@ export function buildTuiTab(prefs: TuiPrefs): SettingsTab {
|
|
|
262
360
|
cycle: SEPARATOR_STYLES_CYCLE,
|
|
263
361
|
note: 'spaces | pipes | dots | slashes — status line glyphs',
|
|
264
362
|
},
|
|
363
|
+
{
|
|
364
|
+
id: 'tui.layout.settingsView',
|
|
365
|
+
name: 'Settings surface',
|
|
366
|
+
value: tuiRowValue(prefs, 'tui.layout.settingsView') ?? 'docked',
|
|
367
|
+
cycle: SETTINGS_VIEW_MODES,
|
|
368
|
+
note: 'docked (above prompt) | fullscreen router page | dialog overlay',
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
id: 'tui.layout.language',
|
|
372
|
+
name: 'Language / Idioma',
|
|
373
|
+
value: tuiRowValue(prefs, 'tui.layout.language') ?? 'auto',
|
|
374
|
+
cycle: LANGUAGE_CYCLE,
|
|
375
|
+
note: 'auto (LANG/LC_ALL) | pt-BR (Português) | en (English)',
|
|
376
|
+
},
|
|
265
377
|
],
|
|
266
378
|
},
|
|
267
379
|
{
|
|
@@ -361,7 +473,7 @@ export function buildTuiTab(prefs: TuiPrefs): SettingsTab {
|
|
|
361
473
|
'tui.sidebar.context.spent',
|
|
362
474
|
'Spent row',
|
|
363
475
|
prefs.sidebar.context.spent,
|
|
364
|
-
'the `$…
|
|
476
|
+
'the `$… spent in session` line',
|
|
365
477
|
),
|
|
366
478
|
row(
|
|
367
479
|
'tui.sidebar.context.modelUsage',
|
|
@@ -423,6 +535,18 @@ export function applyTuiRow(draft: TuiPrefs, id: string, value: string): void {
|
|
|
423
535
|
draft.layout.separator = value as SeparatorStylePref
|
|
424
536
|
}
|
|
425
537
|
return
|
|
538
|
+
case 'tui.layout.settingsView':
|
|
539
|
+
if (SETTINGS_VIEW_MODES.includes(value)) {
|
|
540
|
+
if (!draft.layout) draft.layout = { ...DEFAULT_TUI_PREFS.layout }
|
|
541
|
+
draft.layout.settingsView = value as SettingsViewModePref
|
|
542
|
+
}
|
|
543
|
+
return
|
|
544
|
+
case 'tui.layout.language':
|
|
545
|
+
if (LANGUAGE_CYCLE.includes(value)) {
|
|
546
|
+
if (!draft.layout) draft.layout = { ...DEFAULT_TUI_PREFS.layout }
|
|
547
|
+
draft.layout.language = value as LanguagePref
|
|
548
|
+
}
|
|
549
|
+
return
|
|
426
550
|
case 'tui.sidebar.context.barShape':
|
|
427
551
|
if (BAR_SHAPES_CYCLE.includes(value)) draft.sidebar.context.barShape = value as BarShapePref
|
|
428
552
|
return
|
|
@@ -487,6 +611,9 @@ export function tuiRowValue(prefs: TuiPrefs, id: string): string | undefined {
|
|
|
487
611
|
if (id === 'tui.layout.preset') return prefs.layout?.preset ?? DEFAULT_TUI_PREFS.layout.preset
|
|
488
612
|
if (id === 'tui.layout.separator')
|
|
489
613
|
return prefs.layout?.separator ?? DEFAULT_TUI_PREFS.layout.separator
|
|
614
|
+
if (id === 'tui.layout.settingsView')
|
|
615
|
+
return prefs.layout?.settingsView ?? DEFAULT_TUI_PREFS.layout.settingsView ?? 'docked'
|
|
616
|
+
if (id === 'tui.layout.language') return prefs.layout?.language ?? 'auto'
|
|
490
617
|
if (id === 'tui.sidebar.context.barShape') return prefs.sidebar.context.barShape
|
|
491
618
|
if (id === 'tui.sidebar.context.barWidth') return prefs.sidebar.context.barWidth
|
|
492
619
|
if (id === 'tui.sidebar.context.gauge') return prefs.sidebar.context.gauge
|
|
@@ -29,17 +29,19 @@ export interface UpdateNotice {
|
|
|
29
29
|
message: string
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
/** Semver-ish compare for X.Y.Z[-beta.N];
|
|
32
|
+
/** Semver-ish compare for X.Y.Z[-(beta|rc).N]; prereleases sort before their release. */
|
|
33
33
|
export function comparePantheonVersions(left: string, right: string): number {
|
|
34
34
|
const parse = (version: string) => {
|
|
35
35
|
const match = String(version)
|
|
36
36
|
.trim()
|
|
37
|
-
.match(/^(\d+)\.(\d+)\.(\d+)(?:-beta\.(\d+))?$/)
|
|
37
|
+
.match(/^(\d+)\.(\d+)\.(\d+)(?:-(beta|rc)\.(\d+))?$/)
|
|
38
38
|
if (!match) return null
|
|
39
|
-
const [, major = '', minor = '', patch = '',
|
|
39
|
+
const [, major = '', minor = '', patch = '', stage = '', stageNum = ''] = match
|
|
40
|
+
const stageRank = stage === 'beta' ? 1 : stage === 'rc' ? 2 : 3
|
|
40
41
|
return {
|
|
41
42
|
core: [+major, +minor, +patch] as [number, number, number],
|
|
42
|
-
|
|
43
|
+
stageRank,
|
|
44
|
+
stageNum: stage !== '' ? +stageNum : Number.POSITIVE_INFINITY,
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
47
|
const a = parse(left)
|
|
@@ -50,7 +52,8 @@ export function comparePantheonVersions(left: string, right: string): number {
|
|
|
50
52
|
if (aMajor !== bMajor) return aMajor - bMajor
|
|
51
53
|
if (aMinor !== bMinor) return aMinor - bMinor
|
|
52
54
|
if (aPatch !== bPatch) return aPatch - bPatch
|
|
53
|
-
return a.
|
|
55
|
+
if (a.stageRank !== b.stageRank) return a.stageRank - b.stageRank
|
|
56
|
+
return a.stageNum - b.stageNum
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
export function pickUpdateNotice(input: UpdateNoticeInput): UpdateNotice | null {
|
|
@@ -61,7 +64,7 @@ export function pickUpdateNotice(input: UpdateNoticeInput): UpdateNotice | null
|
|
|
61
64
|
if (nowMs - lastCheck < ttlMs) return null
|
|
62
65
|
if (state.lastNotifiedVersion === latestVersion) return null
|
|
63
66
|
|
|
64
|
-
const stable = (version: string) => !/-beta\.\d+$/.test(version)
|
|
67
|
+
const stable = (version: string) => !/-(?:beta|rc)\.\d+$/.test(version)
|
|
65
68
|
// A stable install is never advertised a beta: the update guard owns that
|
|
66
69
|
// crossing and requires explicit opt-in there.
|
|
67
70
|
if (stable(currentVersion) && !stable(latestVersion)) return null
|
|
@@ -24,14 +24,14 @@ import {
|
|
|
24
24
|
} from './whats-new-highlights.ts'
|
|
25
25
|
import { markSeenWhatsNew, shouldShowWhatsNew } from './whats-new-state.ts'
|
|
26
26
|
|
|
27
|
-
/** Muted footer hint teaching the dismiss bind
|
|
28
|
-
export const WHATS_NEW_CLOSE_HINT = 'esc/q
|
|
27
|
+
/** Muted footer hint teaching the dismiss bind. */
|
|
28
|
+
export const WHATS_NEW_CLOSE_HINT = 'esc/q close'
|
|
29
29
|
|
|
30
30
|
/** Hint variant when the highlights span more than one page. */
|
|
31
|
-
export const WHATS_NEW_PAGES_HINT = 'esc/q
|
|
31
|
+
export const WHATS_NEW_PAGES_HINT = 'esc/q close · n next · p back'
|
|
32
32
|
|
|
33
33
|
/** The CHANGELOG pointer shown under the highlights (the window summarizes; the file is complete). */
|
|
34
|
-
export const WHATS_NEW_MORE_HINT = 'CHANGELOG
|
|
34
|
+
export const WHATS_NEW_MORE_HINT = 'Full CHANGELOG: CHANGELOG.md in package'
|
|
35
35
|
|
|
36
36
|
/** Rows per page — bounded so no changelog can overflow the terminal. */
|
|
37
37
|
export const WHATS_NEW_PAGE_SIZE = 14
|
|
@@ -32,39 +32,126 @@
|
|
|
32
32
|
* does not show (fail-open, like the rest of the plugin).
|
|
33
33
|
*/
|
|
34
34
|
import type { Context } from '@opencode/plugin/tui/context'
|
|
35
|
-
import { createSignal, For } from 'solid-js'
|
|
35
|
+
import { createSignal, For, Show } from 'solid-js'
|
|
36
36
|
import { readChangelogForBundle, resolveRunningVersion } from './whats-new-highlights.ts'
|
|
37
37
|
import { openWhatsNew, type WhatsNewViewData, wrapWhatsNewLine } from './whats-new-open.ts'
|
|
38
38
|
import { defaultWhatsNewStatePath } from './whats-new-state.ts'
|
|
39
39
|
|
|
40
|
-
/** Window body: title, rule, the current page (wrapped), footer
|
|
40
|
+
/** Window body: title, rule, the current page (wrapped), footer action bar with OK button. */
|
|
41
41
|
export function WhatsNewContent(props: {
|
|
42
42
|
data: WhatsNewViewData
|
|
43
43
|
page: () => number
|
|
44
44
|
pageCount: () => number
|
|
45
45
|
fg?: any
|
|
46
46
|
muted?: any
|
|
47
|
+
warn?: any
|
|
48
|
+
onClose?: () => void
|
|
49
|
+
onNext?: () => void
|
|
50
|
+
onPrev?: () => void
|
|
47
51
|
}) {
|
|
48
52
|
const rows = () => {
|
|
49
53
|
const current = props.data.pages[Math.min(props.page(), props.pageCount() - 1)] ?? []
|
|
50
54
|
const wrapped: string[] = []
|
|
51
|
-
for (const line of current) wrapped.push(...wrapWhatsNewLine(line,
|
|
55
|
+
for (const line of current) wrapped.push(...wrapWhatsNewLine(line, 72))
|
|
52
56
|
return wrapped
|
|
53
57
|
}
|
|
54
58
|
return (
|
|
55
|
-
<box
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
<box
|
|
60
|
+
flexDirection="column"
|
|
61
|
+
borderStyle="rounded"
|
|
62
|
+
borderColor={props.warn ?? '#fba970'}
|
|
63
|
+
paddingLeft={2}
|
|
64
|
+
paddingRight={2}
|
|
65
|
+
paddingTop={1}
|
|
66
|
+
paddingBottom={1}
|
|
67
|
+
>
|
|
68
|
+
{/* Header with Title and close hint */}
|
|
69
|
+
<box flexDirection="row" alignItems="center" justifyContent="space-between">
|
|
70
|
+
<box flexDirection="row" alignItems="center">
|
|
71
|
+
<box
|
|
72
|
+
backgroundColor={props.warn ?? '#fba970'}
|
|
73
|
+
paddingLeft={1}
|
|
74
|
+
paddingRight={1}
|
|
75
|
+
marginRight={1}
|
|
76
|
+
>
|
|
77
|
+
<text fg="#000000" attributes={1}>
|
|
78
|
+
{'NOVIDADES'}
|
|
79
|
+
</text>
|
|
80
|
+
</box>
|
|
81
|
+
<text attributes={1} fg={props.fg}>
|
|
82
|
+
{props.data.title}
|
|
83
|
+
</text>
|
|
84
|
+
</box>
|
|
85
|
+
<box onMouseDown={() => props.onClose?.()}>
|
|
86
|
+
<text fg={props.muted}>{'[ Esc / Q ]'}</text>
|
|
87
|
+
</box>
|
|
88
|
+
</box>
|
|
89
|
+
|
|
90
|
+
{/* Divider */}
|
|
91
|
+
<box flexDirection="row" height={1} marginTop={1} marginBottom={1}>
|
|
92
|
+
<text fg={props.muted}>{'─'.repeat(72)}</text>
|
|
93
|
+
</box>
|
|
94
|
+
|
|
95
|
+
{/* Content items */}
|
|
96
|
+
<box flexDirection="column" minHeight={8}>
|
|
97
|
+
<For each={rows()}>
|
|
98
|
+
{(line: string) => {
|
|
99
|
+
const isBullet = line.startsWith('• ')
|
|
100
|
+
return (
|
|
101
|
+
<text fg={isBullet ? props.fg : props.muted} {...(isBullet ? { attributes: 1 } : {})}>
|
|
102
|
+
{line}
|
|
103
|
+
</text>
|
|
104
|
+
)
|
|
105
|
+
}}
|
|
106
|
+
</For>
|
|
107
|
+
</box>
|
|
108
|
+
|
|
109
|
+
{/* Divider before footer */}
|
|
110
|
+
<box flexDirection="row" height={1} marginTop={1}>
|
|
111
|
+
<text fg={props.muted}>{'─'.repeat(72)}</text>
|
|
112
|
+
</box>
|
|
113
|
+
|
|
114
|
+
{/* Bottom Action Bar: Pagination + Modern OK Button */}
|
|
115
|
+
<box flexDirection="row" alignItems="center" justifyContent="space-between" marginTop={1}>
|
|
116
|
+
<box flexDirection="row" alignItems="center">
|
|
117
|
+
<Show when={props.pageCount() > 1}>
|
|
118
|
+
<box
|
|
119
|
+
backgroundColor="#262626"
|
|
120
|
+
paddingLeft={1}
|
|
121
|
+
paddingRight={1}
|
|
122
|
+
marginRight={1}
|
|
123
|
+
onMouseDown={() => props.onPrev?.()}
|
|
124
|
+
>
|
|
125
|
+
<text fg="#ffffff">{'‹ Prev'}</text>
|
|
126
|
+
</box>
|
|
127
|
+
<text fg={props.muted} marginRight={1}>
|
|
128
|
+
{`${props.page() + 1} / ${props.pageCount()}`}
|
|
129
|
+
</text>
|
|
130
|
+
<box
|
|
131
|
+
backgroundColor="#262626"
|
|
132
|
+
paddingLeft={1}
|
|
133
|
+
paddingRight={1}
|
|
134
|
+
marginRight={1}
|
|
135
|
+
onMouseDown={() => props.onNext?.()}
|
|
136
|
+
>
|
|
137
|
+
<text fg="#ffffff">{'Next ›'}</text>
|
|
138
|
+
</box>
|
|
139
|
+
</Show>
|
|
140
|
+
<text fg={props.muted}>{'Enter / Esc / Q close'}</text>
|
|
141
|
+
</box>
|
|
142
|
+
|
|
143
|
+
{/* Prominent OK Button */}
|
|
144
|
+
<box
|
|
145
|
+
backgroundColor={props.warn ?? '#fba970'}
|
|
146
|
+
paddingLeft={2}
|
|
147
|
+
paddingRight={2}
|
|
148
|
+
onMouseDown={() => props.onClose?.()}
|
|
149
|
+
>
|
|
150
|
+
<text fg="#000000" attributes={1}>
|
|
151
|
+
{'OK, Got it'}
|
|
152
|
+
</text>
|
|
153
|
+
</box>
|
|
154
|
+
</box>
|
|
68
155
|
</box>
|
|
69
156
|
)
|
|
70
157
|
}
|
|
@@ -91,9 +178,19 @@ export async function maybeShowWhatsNewV2(context: Context): Promise<void> {
|
|
|
91
178
|
mode: 'global',
|
|
92
179
|
enabled: () => open(),
|
|
93
180
|
commands: [
|
|
181
|
+
{
|
|
182
|
+
id: 'pantheon.whats-new.confirm',
|
|
183
|
+
title: 'Confirm and close what is new',
|
|
184
|
+
bind: 'enter,space',
|
|
185
|
+
run: () => {
|
|
186
|
+
if (!open()) return false
|
|
187
|
+
dismiss()
|
|
188
|
+
return undefined
|
|
189
|
+
},
|
|
190
|
+
},
|
|
94
191
|
{
|
|
95
192
|
id: 'pantheon.whats-new.close',
|
|
96
|
-
title: '
|
|
193
|
+
title: 'Close what is new',
|
|
97
194
|
bind: 'escape,q',
|
|
98
195
|
run: () => {
|
|
99
196
|
if (!open()) return false
|
|
@@ -149,6 +246,7 @@ export async function maybeShowWhatsNewV2(context: Context): Promise<void> {
|
|
|
149
246
|
setOpen(true)
|
|
150
247
|
try {
|
|
151
248
|
const theme = context.theme?.text ?? {}
|
|
249
|
+
const warn = (theme?.feedback as any)?.warning?.base ?? '#fba970'
|
|
152
250
|
context.ui.dialog.show(
|
|
153
251
|
() => (
|
|
154
252
|
<WhatsNewContent
|
|
@@ -157,6 +255,10 @@ export async function maybeShowWhatsNewV2(context: Context): Promise<void> {
|
|
|
157
255
|
pageCount={pageCount}
|
|
158
256
|
fg={theme.base}
|
|
159
257
|
muted={theme.muted}
|
|
258
|
+
warn={warn}
|
|
259
|
+
onClose={dismiss}
|
|
260
|
+
onNext={() => setPage((current) => Math.min(current + 1, pageCount() - 1))}
|
|
261
|
+
onPrev={() => setPage((current) => Math.max(current - 1, 0))}
|
|
160
262
|
/>
|
|
161
263
|
),
|
|
162
264
|
close,
|