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
|
@@ -111,6 +111,21 @@ function formatSpent(cost) {
|
|
|
111
111
|
const MODEL_USAGE_VISIBLE_CEILING = 3;
|
|
112
112
|
const MODEL_USAGE_MESSAGE_LIMIT = 400;
|
|
113
113
|
const MODEL_USAGE_SESSION_LIMIT = 8;
|
|
114
|
+
Object.freeze([
|
|
115
|
+
"auto",
|
|
116
|
+
"pt-BR",
|
|
117
|
+
"en"
|
|
118
|
+
]);
|
|
119
|
+
/**
|
|
120
|
+
* Resolve effective language: 'pt-BR' or 'en'.
|
|
121
|
+
* Defaults to 'pt-BR' if system locale contains 'pt', otherwise 'en'.
|
|
122
|
+
*/
|
|
123
|
+
function resolveLanguage(preference = "auto", env = process.env) {
|
|
124
|
+
if (preference === "pt-BR") return "pt-BR";
|
|
125
|
+
if (preference === "en") return "en";
|
|
126
|
+
if ((env.LC_ALL ?? env.LC_MESSAGES ?? env.LANG ?? "").toLowerCase().startsWith("pt")) return "pt-BR";
|
|
127
|
+
return "en";
|
|
128
|
+
}
|
|
114
129
|
//#endregion
|
|
115
130
|
//#region src/autonomy-state.ts
|
|
116
131
|
const DEFAULT_GOAL_LOOP_PREFS = {
|
|
@@ -119,6 +134,19 @@ const DEFAULT_GOAL_LOOP_PREFS = {
|
|
|
119
134
|
maxContinuations: 25
|
|
120
135
|
};
|
|
121
136
|
const GOAL_LOOP_ENABLED_CYCLE = Object.freeze(["enabled", "disabled"]);
|
|
137
|
+
const MAX_CONTINUATIONS_CYCLE = Object.freeze([
|
|
138
|
+
"10",
|
|
139
|
+
"25",
|
|
140
|
+
"50",
|
|
141
|
+
"100",
|
|
142
|
+
"200"
|
|
143
|
+
]);
|
|
144
|
+
const COOLDOWN_MS_CYCLE = Object.freeze([
|
|
145
|
+
"1000",
|
|
146
|
+
"2000",
|
|
147
|
+
"5000",
|
|
148
|
+
"10000"
|
|
149
|
+
]);
|
|
122
150
|
const DEFAULT_DECISION_BUDGETS = {
|
|
123
151
|
monthlyUsd: 5,
|
|
124
152
|
perDecisionUsd: .1
|
|
@@ -152,70 +180,73 @@ function parseUsd(cell) {
|
|
|
152
180
|
return Number.isFinite(value) && value > 0 ? value : null;
|
|
153
181
|
}
|
|
154
182
|
function buildAutonomyTab(input) {
|
|
183
|
+
const isPt = resolveLanguage(input.languagePref) === "pt-BR";
|
|
155
184
|
return {
|
|
156
185
|
id: "autonomy",
|
|
157
|
-
title: "Autonomy",
|
|
186
|
+
title: isPt ? "Autonomia" : "Autonomy",
|
|
158
187
|
groups: [
|
|
159
188
|
{
|
|
160
|
-
title: "Goal loop (
|
|
189
|
+
title: isPt ? "Goal loop (auto-continuação de sessões multi-turn)" : "Goal loop (multi-turn session auto-continuation)",
|
|
161
190
|
rows: [
|
|
162
191
|
{
|
|
163
192
|
id: "autonomy.goal_loop.enabled",
|
|
164
|
-
name: "Goal loop",
|
|
193
|
+
name: isPt ? "Goal loop" : "Goal loop",
|
|
165
194
|
value: input.goalLoop.enabled ? "enabled" : "disabled",
|
|
166
195
|
cycle: GOAL_LOOP_ENABLED_CYCLE,
|
|
167
|
-
note: "
|
|
196
|
+
note: isPt ? "continua tarefas multi-turn quando a sessão fica ociosa" + (input.goalLoopRestartPending ? " · [!] reinício necessário para aplicar (restart)" : " · aplicado após reiniciar o OpenCode") : "auto-continues multi-turn tasks when session goes idle" + (input.goalLoopRestartPending ? " · [!] restart required to apply" : " · applies after OpenCode restart")
|
|
168
197
|
},
|
|
169
198
|
{
|
|
170
199
|
id: "autonomy.goal_loop.maxContinuations",
|
|
171
|
-
name: "Max continuations",
|
|
200
|
+
name: isPt ? "Limite continuações" : "Max continuations",
|
|
172
201
|
value: String(input.goalLoop.maxContinuations),
|
|
173
|
-
|
|
202
|
+
cycle: MAX_CONTINUATIONS_CYCLE,
|
|
203
|
+
note: isPt ? "1..200 — teto de segurança contra loops infinitos" : "1..200 — safety ceiling to prevent runaway tasks"
|
|
174
204
|
},
|
|
175
205
|
{
|
|
176
206
|
id: "autonomy.goal_loop.cooldownMs",
|
|
177
|
-
name: "Cooldown (ms)",
|
|
207
|
+
name: isPt ? "Pausa entre turnos (ms)" : "Cooldown (ms)",
|
|
178
208
|
value: String(input.goalLoop.cooldownMs),
|
|
179
|
-
|
|
209
|
+
cycle: COOLDOWN_MS_CYCLE,
|
|
210
|
+
note: isPt ? "intervalo entre turnos autônomos (mín 1000ms)" : "delay between autonomous turns (min 1000ms)"
|
|
180
211
|
}
|
|
181
212
|
]
|
|
182
213
|
},
|
|
183
214
|
{
|
|
184
|
-
title: "Decision budgets (applies live)",
|
|
215
|
+
title: isPt ? "Orçamento Jev (aplicado em tempo real por decisão)" : "Decision budgets (applies live per gated call)",
|
|
185
216
|
rows: [{
|
|
186
217
|
id: "autonomy.budget.monthly",
|
|
187
|
-
name: "Monthly cap",
|
|
218
|
+
name: isPt ? "Teto mensal" : "Monthly cap",
|
|
188
219
|
value: formatUsd(input.budgets.monthlyUsd),
|
|
189
220
|
cycle: MONTHLY_USD_CYCLE,
|
|
190
|
-
note: "
|
|
221
|
+
note: isPt ? "teto mensal em USD para arbitragem do Jev" : "monthly USD ceiling for gated arbitrator decisions"
|
|
191
222
|
}, {
|
|
192
223
|
id: "autonomy.budget.perDecision",
|
|
193
|
-
name: "Per-decision cap",
|
|
224
|
+
name: isPt ? "Teto por decisão" : "Per-decision cap",
|
|
194
225
|
value: formatUsd(input.budgets.perDecisionUsd),
|
|
195
226
|
cycle: PER_DECISION_USD_CYCLE,
|
|
196
|
-
note: "
|
|
227
|
+
note: isPt ? "teto de custo por decisão — acima disso é recusada" : "price cap — gated decisions above this are refused"
|
|
197
228
|
}]
|
|
198
229
|
},
|
|
199
230
|
{
|
|
200
|
-
title: "Decision gradient (
|
|
231
|
+
title: isPt ? "Gradiente de decisão (política de referência · J1 governa o risco)" : "Decision gradient (reference policy · J1 owns the risk axis)",
|
|
201
232
|
rows: [
|
|
202
233
|
{
|
|
203
234
|
id: "autonomy.gradient.solo",
|
|
204
235
|
name: "Decide solo",
|
|
205
|
-
value: "
|
|
206
|
-
note: "edits, routine fixes
|
|
236
|
+
value: "autonomous",
|
|
237
|
+
note: isPt ? "edições reversíveis e rotineiras, sem travas (baixo risco)" : "reversible & low-risk edits, routine fixes (no gate)"
|
|
207
238
|
},
|
|
208
239
|
{
|
|
209
240
|
id: "autonomy.gradient.jev",
|
|
210
241
|
name: "Jev decides",
|
|
211
|
-
value: "
|
|
212
|
-
note: "
|
|
242
|
+
value: "arbitrated",
|
|
243
|
+
note: isPt ? "ambiguidade de tipos e ranqueamento de candidatos (com teto de custo)" : "typed ambiguity & candidate ranking (budget-capped)"
|
|
213
244
|
},
|
|
214
245
|
{
|
|
215
246
|
id: "autonomy.gradient.human",
|
|
216
247
|
name: "Human decides",
|
|
217
|
-
value: "
|
|
218
|
-
note: "
|
|
248
|
+
value: "human review",
|
|
249
|
+
note: isPt ? "operações de alto risco ou destrutivas (portão J1)" : "high-risk & destructive operations (J1 gate)"
|
|
219
250
|
}
|
|
220
251
|
]
|
|
221
252
|
}
|
|
@@ -490,49 +521,51 @@ function credentialStatus(provider, env, authProviders, configProviders) {
|
|
|
490
521
|
if (provider === "opencode-console-jev") return "auth store";
|
|
491
522
|
return "missing";
|
|
492
523
|
}
|
|
493
|
-
function buildDecisionTab(read, env = process.env, authProviders = /* @__PURE__ */ new Set(), configProviders = /* @__PURE__ */ new Set()) {
|
|
524
|
+
function buildDecisionTab(read, env = process.env, authProviders = /* @__PURE__ */ new Set(), configProviders = /* @__PURE__ */ new Set(), languagePref) {
|
|
525
|
+
const isPt = resolveLanguage(languagePref, env) === "pt-BR";
|
|
494
526
|
const { config, corrupt } = read;
|
|
495
527
|
const rows = [{
|
|
496
528
|
id: "decision.enabled",
|
|
497
|
-
name: "Router",
|
|
529
|
+
name: isPt ? "Assistente Jev" : "Router",
|
|
498
530
|
value: config.enabled ? "enabled" : "disabled",
|
|
499
531
|
...corrupt ? {} : { cycle: DECISION_ENABLED_CYCLE },
|
|
500
|
-
note: corrupt ? "config unreadable/invalid — runtime fail-closes; repair via `decision-router setup-model`" : "applies live — the runtime re-reads this on every gated call"
|
|
532
|
+
note: corrupt ? isPt ? "config inválida — runtime fail-closes; repair via `decision-router setup-model`" : "config unreadable/invalid — runtime fail-closes; repair via `decision-router setup-model`" : isPt ? "applies live — arbitragem de decisões relida em tempo real a cada chamada" : "applies live — the runtime re-reads this on every gated call"
|
|
501
533
|
}, {
|
|
502
534
|
id: "decision.selection.mode",
|
|
503
|
-
name: "Selection mode",
|
|
535
|
+
name: isPt ? "Modo de operação" : "Selection mode",
|
|
504
536
|
value: config.selection.mode,
|
|
505
537
|
...corrupt ? {} : { cycle: DECISION_SELECTION_CYCLE },
|
|
506
|
-
note: "local routes on-device; auto/explicit pick a remote decision model"
|
|
538
|
+
note: isPt ? "local = no seu PC (grátis); auto/explícito = modelo nuvem (OpenRouter)" : "local routes on-device; auto/explicit pick a remote decision model"
|
|
507
539
|
}];
|
|
508
|
-
|
|
540
|
+
const explicitTarget = config.selection.provider ? `${config.selection.provider}/${config.selection.model ?? ""}` : DECISION_TARGET_CYCLE[0] ?? "openrouter-jev/typesafe/jev-1.13";
|
|
541
|
+
rows.push({
|
|
509
542
|
id: "decision.selection.target",
|
|
510
|
-
name: "Explicit target",
|
|
511
|
-
value: config.selection.provider ? `${config.selection.provider}/${config.selection.model ?? ""}` : "
|
|
512
|
-
...corrupt
|
|
513
|
-
note: "provider/model — sets the candidate list"
|
|
543
|
+
name: isPt ? "Modelo de decisão" : "Explicit target",
|
|
544
|
+
value: config.selection.mode === "local" ? config.selection.provider ? `${config.selection.provider}/${config.selection.model ?? ""}` : "local (on-device)" : explicitTarget,
|
|
545
|
+
...corrupt ? {} : { cycle: DECISION_TARGET_CYCLE },
|
|
546
|
+
note: isPt ? config.selection.mode === "local" ? "ciclar seleciona modelo remoto e ativa modo explícito" : "provedor/modelo ativo — define candidato para arbitragem" : config.selection.mode === "local" ? "cycle to select a remote model and activate explicit mode" : "provider/model — sets the candidate list"
|
|
514
547
|
});
|
|
515
|
-
if (config.enabled_candidates
|
|
548
|
+
if ((config.enabled_candidates?.length ?? 0) > 0) rows.push({
|
|
516
549
|
id: "decision.candidates",
|
|
517
|
-
name: "Candidates",
|
|
550
|
+
name: isPt ? "Candidatos ativos" : "Candidates",
|
|
518
551
|
value: String(config.enabled_candidates.length),
|
|
519
|
-
note: config.egress_consent ? config.enabled_candidates.map((candidate) => `${candidate.provider}/${candidate.model}`).join(", ") : "egress consent NOT granted — remote routes fail closed"
|
|
552
|
+
note: config.egress_consent ? config.enabled_candidates.map((candidate) => `${candidate.provider}/${candidate.model}`).join(", ") : isPt ? "egress consent NÃO concedido — rotas remotas bloqueadas" : "egress consent NOT granted — remote routes fail closed"
|
|
520
553
|
});
|
|
521
554
|
rows.push({
|
|
522
555
|
id: "decision.consent",
|
|
523
|
-
name: "Egress consent",
|
|
556
|
+
name: isPt ? "Acesso à nuvem (Egress)" : "Egress consent",
|
|
524
557
|
value: config.egress_consent ? "granted" : "not granted",
|
|
525
558
|
...corrupt ? {} : { cycle: DECISION_CONSENT_CYCLE },
|
|
526
|
-
note: "granted = remote decision routes may call their gateway (budget-capped)"
|
|
559
|
+
note: isPt ? config.egress_consent ? "granted = rotas remotas podem consultar gateway de API (com teto de custo)" : "not granted = chamadas remotas bloqueadas; requer granted para nuvem" : config.egress_consent ? "granted = remote decision routes may call their gateway (budget-capped)" : "not granted = remote routes fail closed; grant to allow cloud calls"
|
|
527
560
|
});
|
|
528
561
|
return {
|
|
529
562
|
id: "decision",
|
|
530
|
-
title: "Decision",
|
|
563
|
+
title: isPt ? "Decisão" : "Decision",
|
|
531
564
|
groups: [{
|
|
532
|
-
title: "Decision router",
|
|
565
|
+
title: isPt ? "Assistente de Decisão" : "Decision router",
|
|
533
566
|
rows
|
|
534
567
|
}, {
|
|
535
|
-
title: "Credentials (status only — values never enter the window)",
|
|
568
|
+
title: isPt ? "Credenciais (status apenas — valores nunca gravados na janela)" : "Credentials (status only — values never enter the window)",
|
|
536
569
|
rows: DECISION_KNOWN_PROVIDERS.map((provider) => {
|
|
537
570
|
const status = credentialStatus(provider, env, authProviders, configProviders);
|
|
538
571
|
const credential = DECISION_PROVIDER_CREDENTIALS[provider] ?? { note: "" };
|
|
@@ -657,6 +690,9 @@ const EMPTY_TAB = {
|
|
|
657
690
|
function tabRows(tab) {
|
|
658
691
|
return tab.groups.flatMap((group) => group.rows);
|
|
659
692
|
}
|
|
693
|
+
function findRow(tab, id) {
|
|
694
|
+
return tabRows(tab).find((row) => row.id === id);
|
|
695
|
+
}
|
|
660
696
|
/** Step through the cycle with wrap-around; non-cyclable rows return the input. */
|
|
661
697
|
function cycleValue(value, cycle, direction) {
|
|
662
698
|
if (cycle.length === 0) return value;
|
|
@@ -839,19 +875,21 @@ function buildChangelogTab(version, items = []) {
|
|
|
839
875
|
}]
|
|
840
876
|
};
|
|
841
877
|
}
|
|
842
|
-
/** Semver-ish compare for X.Y.Z[-beta.N];
|
|
878
|
+
/** Semver-ish compare for X.Y.Z[-(beta|rc).N]; prereleases sort before their release. */
|
|
843
879
|
function comparePantheonVersions(left, right) {
|
|
844
880
|
const parse = (version) => {
|
|
845
|
-
const match = String(version).trim().match(/^(\d+)\.(\d+)\.(\d+)(?:-beta\.(\d+))?$/);
|
|
881
|
+
const match = String(version).trim().match(/^(\d+)\.(\d+)\.(\d+)(?:-(beta|rc)\.(\d+))?$/);
|
|
846
882
|
if (!match) return null;
|
|
847
|
-
const [, major = "", minor = "", patch = "",
|
|
883
|
+
const [, major = "", minor = "", patch = "", stage = "", stageNum = ""] = match;
|
|
884
|
+
const stageRank = stage === "beta" ? 1 : stage === "rc" ? 2 : 3;
|
|
848
885
|
return {
|
|
849
886
|
core: [
|
|
850
887
|
+major,
|
|
851
888
|
+minor,
|
|
852
889
|
+patch
|
|
853
890
|
],
|
|
854
|
-
|
|
891
|
+
stageRank,
|
|
892
|
+
stageNum: stage !== "" ? +stageNum : Number.POSITIVE_INFINITY
|
|
855
893
|
};
|
|
856
894
|
};
|
|
857
895
|
const a = parse(left);
|
|
@@ -862,14 +900,15 @@ function comparePantheonVersions(left, right) {
|
|
|
862
900
|
if (aMajor !== bMajor) return aMajor - bMajor;
|
|
863
901
|
if (aMinor !== bMinor) return aMinor - bMinor;
|
|
864
902
|
if (aPatch !== bPatch) return aPatch - bPatch;
|
|
865
|
-
return a.
|
|
903
|
+
if (a.stageRank !== b.stageRank) return a.stageRank - b.stageRank;
|
|
904
|
+
return a.stageNum - b.stageNum;
|
|
866
905
|
}
|
|
867
906
|
function pickUpdateNotice(input) {
|
|
868
907
|
const { currentVersion, latestVersion, state = {}, nowMs = Date.now() } = input;
|
|
869
908
|
const ttlMs = input.ttlMs ?? 216e5;
|
|
870
909
|
if (nowMs - (state.lastCheckMs ?? 0) < ttlMs) return null;
|
|
871
910
|
if (state.lastNotifiedVersion === latestVersion) return null;
|
|
872
|
-
const stable = (version) => !/-beta\.\d+$/.test(version);
|
|
911
|
+
const stable = (version) => !/-(?:beta|rc)\.\d+$/.test(version);
|
|
873
912
|
if (stable(currentVersion) && !stable(latestVersion)) return null;
|
|
874
913
|
if (comparePantheonVersions(latestVersion, currentVersion) <= 0) return null;
|
|
875
914
|
return {
|
|
@@ -1052,39 +1091,47 @@ function j1ThresholdFromEnv(env = process.env) {
|
|
|
1052
1091
|
if (!Number.isFinite(raw) || raw < 0 || raw > 1) return J1_THRESHOLD_DEFAULT;
|
|
1053
1092
|
return raw;
|
|
1054
1093
|
}
|
|
1055
|
-
const
|
|
1094
|
+
const MODE_DESCRIPTION_EN = {
|
|
1056
1095
|
off: "nothing fires (hard zero)",
|
|
1057
1096
|
shadow: "observe + record; invisible in the session",
|
|
1058
1097
|
warn: "RESERVED — behaves as shadow in this release",
|
|
1059
1098
|
enforce: "high-risk scores DENY the tool call (fail-open on gate unavailability)"
|
|
1060
1099
|
};
|
|
1061
|
-
|
|
1100
|
+
const MODE_DESCRIPTION_PT = {
|
|
1101
|
+
off: "desativado (hard zero)",
|
|
1102
|
+
shadow: "observa + registra telemetria (modo silencioso)",
|
|
1103
|
+
warn: "RESERVADO (RESERVED) — comporta-se como shadow nesta versão",
|
|
1104
|
+
enforce: "alto risco bloqueia a ferramenta (fail-open se indisponível)"
|
|
1105
|
+
};
|
|
1106
|
+
function buildJ1Tab(env, disabledByOverride, languagePref) {
|
|
1107
|
+
const isPt = resolveLanguage(languagePref) === "pt-BR";
|
|
1062
1108
|
const mode = j1ModeFromEnv(env);
|
|
1063
1109
|
const threshold = j1ThresholdFromEnv(env);
|
|
1064
1110
|
const gateState = disabledByOverride ? "disabled via overrides" : mode === "off" ? "off (env unset)" : "active";
|
|
1111
|
+
const desc = isPt ? MODE_DESCRIPTION_PT[mode] : MODE_DESCRIPTION_EN[mode];
|
|
1065
1112
|
return {
|
|
1066
1113
|
id: "j1",
|
|
1067
|
-
title: "J1",
|
|
1114
|
+
title: isPt ? "Segurança J1" : "J1",
|
|
1068
1115
|
groups: [{
|
|
1069
|
-
title: "
|
|
1116
|
+
title: isPt ? "Nível de Segurança e Portão de Risco J1 (env-only)" : "Safety Level & Risk Gate (J1) (env-only — never written here)",
|
|
1070
1117
|
rows: [
|
|
1071
1118
|
{
|
|
1072
1119
|
id: "j1.mode",
|
|
1073
|
-
name: "Mode",
|
|
1120
|
+
name: isPt ? "Modo de execução" : "Mode",
|
|
1074
1121
|
value: mode,
|
|
1075
|
-
note: `${
|
|
1122
|
+
note: `${desc} · ${isPt ? "reinício necessário (restart applies)" : "restart applies"}`
|
|
1076
1123
|
},
|
|
1077
1124
|
{
|
|
1078
1125
|
id: "j1.threshold",
|
|
1079
|
-
name: "Enforce threshold",
|
|
1126
|
+
name: isPt ? "Limiar de bloqueio" : "Enforce threshold",
|
|
1080
1127
|
value: String(threshold),
|
|
1081
|
-
note: "deny at or above · 0..1 · default 0.8"
|
|
1128
|
+
note: isPt ? "bloqueia em ou acima · 0..1 · padrão 0.8" : "deny at or above · 0..1 · default 0.8"
|
|
1082
1129
|
},
|
|
1083
1130
|
{
|
|
1084
1131
|
id: "j1.gate",
|
|
1085
|
-
name: "Gate",
|
|
1132
|
+
name: isPt ? "Estado do portão" : "Gate",
|
|
1086
1133
|
value: gateState,
|
|
1087
|
-
note: `${J1_FLAG_ENV} / ${J1_THRESHOLD_ENV} · read once at startup`
|
|
1134
|
+
note: `${J1_FLAG_ENV} / ${J1_THRESHOLD_ENV} · ${isPt ? "lido na inicialização" : "read once at startup"}`
|
|
1088
1135
|
}
|
|
1089
1136
|
]
|
|
1090
1137
|
}]
|
|
@@ -1193,9 +1240,30 @@ function buildPresetTab(input) {
|
|
|
1193
1240
|
//#endregion
|
|
1194
1241
|
//#region src/tui-prefs.ts
|
|
1195
1242
|
const PREFS_SYMBOL = Symbol.for("pantheon.tui.prefs.v1");
|
|
1243
|
+
const DRAFT_PREVIEW_SYMBOL = Symbol.for("pantheon.tui.draft_preview.v1");
|
|
1196
1244
|
function stash() {
|
|
1197
1245
|
return globalThis[PREFS_SYMBOL];
|
|
1198
1246
|
}
|
|
1247
|
+
function getDraftPreviewSignal() {
|
|
1248
|
+
const g = globalThis;
|
|
1249
|
+
if (!g[DRAFT_PREVIEW_SYMBOL]) g[DRAFT_PREVIEW_SYMBOL] = createSignal(void 0);
|
|
1250
|
+
return g[DRAFT_PREVIEW_SYMBOL];
|
|
1251
|
+
}
|
|
1252
|
+
/** Set the active draft preview overlay (used by settings window to provide live preview). */
|
|
1253
|
+
function setTuiDraftPreview(draft) {
|
|
1254
|
+
const [, setDraft] = getDraftPreviewSignal();
|
|
1255
|
+
setDraft(draft && Object.keys(draft).length > 0 ? { ...draft } : void 0);
|
|
1256
|
+
}
|
|
1257
|
+
/** Clear the active draft preview overlay. */
|
|
1258
|
+
function clearTuiDraftPreview() {
|
|
1259
|
+
const [, setDraft] = getDraftPreviewSignal();
|
|
1260
|
+
setDraft(void 0);
|
|
1261
|
+
}
|
|
1262
|
+
/** The active draft preview accessor. */
|
|
1263
|
+
function tuiDraftPreview() {
|
|
1264
|
+
const [draft] = getDraftPreviewSignal();
|
|
1265
|
+
return draft();
|
|
1266
|
+
}
|
|
1199
1267
|
/** Create (or reuse) the durable prefs store. Fail-open: without host
|
|
1200
1268
|
* storage the consumers fall back to DEFAULT_TUI_PREFS (read-only). */
|
|
1201
1269
|
function initTuiPrefs(context) {
|
|
@@ -1210,8 +1278,31 @@ function initTuiPrefs(context) {
|
|
|
1210
1278
|
}
|
|
1211
1279
|
} catch {}
|
|
1212
1280
|
}
|
|
1213
|
-
/**
|
|
1214
|
-
function
|
|
1281
|
+
/** Deep clone and overlay staged settings draft onto base TuiPrefs. */
|
|
1282
|
+
function previewTuiPrefs(base, draft) {
|
|
1283
|
+
if (!draft || Object.keys(draft).length === 0) return base;
|
|
1284
|
+
let hasTui = false;
|
|
1285
|
+
for (const k of Object.keys(draft)) if (k.startsWith("tui.")) {
|
|
1286
|
+
hasTui = true;
|
|
1287
|
+
break;
|
|
1288
|
+
}
|
|
1289
|
+
if (!hasTui) return base;
|
|
1290
|
+
const normalized = normalizeTuiPrefs(base);
|
|
1291
|
+
const effective = {
|
|
1292
|
+
version: 1,
|
|
1293
|
+
layout: { ...normalized.layout },
|
|
1294
|
+
sidebar: {
|
|
1295
|
+
header: { ...normalized.sidebar.header },
|
|
1296
|
+
blocks: { ...normalized.sidebar.blocks },
|
|
1297
|
+
context: { ...normalized.sidebar.context }
|
|
1298
|
+
},
|
|
1299
|
+
footer: { ...normalized.footer }
|
|
1300
|
+
};
|
|
1301
|
+
for (const [id, value] of Object.entries(draft)) if (id.startsWith("tui.")) applyTuiRow(effective, id, value);
|
|
1302
|
+
return effective;
|
|
1303
|
+
}
|
|
1304
|
+
/** The raw persisted prefs from host storage (no draft overlay). */
|
|
1305
|
+
function savedTuiPrefs() {
|
|
1215
1306
|
const s = stash()?.[0];
|
|
1216
1307
|
if (!s) return DEFAULT_TUI_PREFS;
|
|
1217
1308
|
if (!s.layout) return {
|
|
@@ -1220,6 +1311,15 @@ function tuiPrefs() {
|
|
|
1220
1311
|
};
|
|
1221
1312
|
return s;
|
|
1222
1313
|
}
|
|
1314
|
+
/** The live reactive prefs (read properties inside memos/JSX — tracked).
|
|
1315
|
+
* When a settings window has an active draft, preview overlays on top
|
|
1316
|
+
* of durable storage in real time. */
|
|
1317
|
+
function tuiPrefs() {
|
|
1318
|
+
const base = savedTuiPrefs();
|
|
1319
|
+
const preview = tuiDraftPreview();
|
|
1320
|
+
if (!preview) return base;
|
|
1321
|
+
return previewTuiPrefs(base, preview);
|
|
1322
|
+
}
|
|
1223
1323
|
/** Stage a mutation against the durable store; resolves when persisted. */
|
|
1224
1324
|
function mutateTuiPrefs(mutation) {
|
|
1225
1325
|
const handle = stash();
|
|
@@ -1254,11 +1354,23 @@ const SEPARATOR_STYLES_CYCLE = Object.freeze([
|
|
|
1254
1354
|
"dots",
|
|
1255
1355
|
"slashes"
|
|
1256
1356
|
]);
|
|
1357
|
+
const SETTINGS_VIEW_MODES = Object.freeze([
|
|
1358
|
+
"docked",
|
|
1359
|
+
"fullscreen",
|
|
1360
|
+
"dialog"
|
|
1361
|
+
]);
|
|
1362
|
+
const LANGUAGE_CYCLE = Object.freeze([
|
|
1363
|
+
"auto",
|
|
1364
|
+
"pt-BR",
|
|
1365
|
+
"en"
|
|
1366
|
+
]);
|
|
1257
1367
|
const DEFAULT_TUI_PREFS = {
|
|
1258
1368
|
version: 1,
|
|
1259
1369
|
layout: {
|
|
1260
1370
|
preset: "comfortable",
|
|
1261
|
-
separator: "spaces"
|
|
1371
|
+
separator: "spaces",
|
|
1372
|
+
settingsView: "fullscreen",
|
|
1373
|
+
language: "auto"
|
|
1262
1374
|
},
|
|
1263
1375
|
sidebar: {
|
|
1264
1376
|
header: {
|
|
@@ -1289,6 +1401,64 @@ const DEFAULT_TUI_PREFS = {
|
|
|
1289
1401
|
home: true
|
|
1290
1402
|
}
|
|
1291
1403
|
};
|
|
1404
|
+
function asBool(value, fallback) {
|
|
1405
|
+
return typeof value === "boolean" ? value : fallback;
|
|
1406
|
+
}
|
|
1407
|
+
/** Deep-merge stored JSON over the defaults; unknown keys and junk are ignored. */
|
|
1408
|
+
function normalizeTuiPrefs(raw) {
|
|
1409
|
+
const stored = typeof raw === "object" && raw !== null ? raw : {};
|
|
1410
|
+
const layout = typeof stored.layout === "object" && stored.layout !== null ? stored.layout : {};
|
|
1411
|
+
const sidebar = typeof stored.sidebar === "object" && stored.sidebar !== null ? stored.sidebar : {};
|
|
1412
|
+
const header = typeof sidebar.header === "object" && sidebar.header !== null ? sidebar.header : {};
|
|
1413
|
+
const blocks = typeof sidebar.blocks === "object" && sidebar.blocks !== null ? sidebar.blocks : {};
|
|
1414
|
+
const context = typeof sidebar.context === "object" && sidebar.context !== null ? sidebar.context : {};
|
|
1415
|
+
const footer = typeof stored.footer === "object" && stored.footer !== null ? stored.footer : {};
|
|
1416
|
+
const preset = LAYOUT_PRESETS_CYCLE.includes(layout.preset) ? layout.preset : DEFAULT_TUI_PREFS.layout.preset;
|
|
1417
|
+
const separator = SEPARATOR_STYLES_CYCLE.includes(layout.separator) ? layout.separator : DEFAULT_TUI_PREFS.layout.separator;
|
|
1418
|
+
const settingsView = SETTINGS_VIEW_MODES.includes(layout.settingsView) ? layout.settingsView : DEFAULT_TUI_PREFS.layout.settingsView;
|
|
1419
|
+
const language = LANGUAGE_CYCLE.includes(layout.language) ? layout.language : DEFAULT_TUI_PREFS.layout.language;
|
|
1420
|
+
const gauge = GAUGE_STYLES.includes(context.gauge) ? context.gauge : DEFAULT_TUI_PREFS.sidebar.context.gauge;
|
|
1421
|
+
const barShape = BAR_SHAPES_CYCLE.includes(context.barShape) ? context.barShape : DEFAULT_TUI_PREFS.sidebar.context.barShape;
|
|
1422
|
+
const barWidth = BAR_WIDTHS_CYCLE.includes(context.barWidth) ? context.barWidth : DEFAULT_TUI_PREFS.sidebar.context.barWidth;
|
|
1423
|
+
const evenMark = asBool(context.evenMark, DEFAULT_TUI_PREFS.sidebar.context.evenMark);
|
|
1424
|
+
return {
|
|
1425
|
+
version: 1,
|
|
1426
|
+
layout: {
|
|
1427
|
+
preset,
|
|
1428
|
+
separator,
|
|
1429
|
+
settingsView,
|
|
1430
|
+
language
|
|
1431
|
+
},
|
|
1432
|
+
sidebar: {
|
|
1433
|
+
header: {
|
|
1434
|
+
version: asBool(header.version, true),
|
|
1435
|
+
preset: asBool(header.preset, true),
|
|
1436
|
+
session: asBool(header.session, true)
|
|
1437
|
+
},
|
|
1438
|
+
blocks: {
|
|
1439
|
+
context: asBool(blocks.context, true),
|
|
1440
|
+
git: asBool(blocks.git, true),
|
|
1441
|
+
todo: asBool(blocks.todo, true),
|
|
1442
|
+
dispatch: asBool(blocks.dispatch, true)
|
|
1443
|
+
},
|
|
1444
|
+
context: {
|
|
1445
|
+
gauge,
|
|
1446
|
+
barShape,
|
|
1447
|
+
barWidth,
|
|
1448
|
+
evenMark,
|
|
1449
|
+
tokens: asBool(context.tokens, true),
|
|
1450
|
+
spent: asBool(context.spent, true),
|
|
1451
|
+
modelUsage: asBool(context.modelUsage, true),
|
|
1452
|
+
performance: asBool(context.performance, true),
|
|
1453
|
+
localSpend: asBool(context.localSpend, true)
|
|
1454
|
+
}
|
|
1455
|
+
},
|
|
1456
|
+
footer: {
|
|
1457
|
+
prompt: asBool(footer.prompt, true),
|
|
1458
|
+
home: asBool(footer.home, true)
|
|
1459
|
+
}
|
|
1460
|
+
};
|
|
1461
|
+
}
|
|
1292
1462
|
const onOff = ENABLED_CYCLE;
|
|
1293
1463
|
const row = (id, name, value, note) => ({
|
|
1294
1464
|
id,
|
|
@@ -1304,19 +1474,36 @@ function buildTuiTab(prefs) {
|
|
|
1304
1474
|
groups: [
|
|
1305
1475
|
{
|
|
1306
1476
|
title: "Preset & Layout",
|
|
1307
|
-
rows: [
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1477
|
+
rows: [
|
|
1478
|
+
{
|
|
1479
|
+
id: "tui.layout.preset",
|
|
1480
|
+
name: "Layout preset",
|
|
1481
|
+
value: prefs.layout?.preset ?? DEFAULT_TUI_PREFS.layout.preset,
|
|
1482
|
+
cycle: LAYOUT_PRESETS_CYCLE,
|
|
1483
|
+
note: "comfortable | compact — sets spacing & borders"
|
|
1484
|
+
},
|
|
1485
|
+
{
|
|
1486
|
+
id: "tui.layout.separator",
|
|
1487
|
+
name: "Separator",
|
|
1488
|
+
value: prefs.layout?.separator ?? DEFAULT_TUI_PREFS.layout.separator,
|
|
1489
|
+
cycle: SEPARATOR_STYLES_CYCLE,
|
|
1490
|
+
note: "spaces | pipes | dots | slashes — status line glyphs"
|
|
1491
|
+
},
|
|
1492
|
+
{
|
|
1493
|
+
id: "tui.layout.settingsView",
|
|
1494
|
+
name: "Settings surface",
|
|
1495
|
+
value: tuiRowValue(prefs, "tui.layout.settingsView") ?? "docked",
|
|
1496
|
+
cycle: SETTINGS_VIEW_MODES,
|
|
1497
|
+
note: "docked (above prompt) | fullscreen router page | dialog overlay"
|
|
1498
|
+
},
|
|
1499
|
+
{
|
|
1500
|
+
id: "tui.layout.language",
|
|
1501
|
+
name: "Language / Idioma",
|
|
1502
|
+
value: tuiRowValue(prefs, "tui.layout.language") ?? "auto",
|
|
1503
|
+
cycle: LANGUAGE_CYCLE,
|
|
1504
|
+
note: "auto (LANG/LC_ALL) | pt-BR (Português) | en (English)"
|
|
1505
|
+
}
|
|
1506
|
+
]
|
|
1320
1507
|
},
|
|
1321
1508
|
{
|
|
1322
1509
|
title: "Bars & Gauges",
|
|
@@ -1366,7 +1553,7 @@ function buildTuiTab(prefs) {
|
|
|
1366
1553
|
title: "Context block detail",
|
|
1367
1554
|
rows: [
|
|
1368
1555
|
row("tui.sidebar.context.tokens", "Tokens row", prefs.sidebar.context.tokens, "the raw token count line"),
|
|
1369
|
-
row("tui.sidebar.context.spent", "Spent row", prefs.sidebar.context.spent, "the `$…
|
|
1556
|
+
row("tui.sidebar.context.spent", "Spent row", prefs.sidebar.context.spent, "the `$… spent in session` line"),
|
|
1370
1557
|
row("tui.sidebar.context.modelUsage", "Model usage table", prefs.sidebar.context.modelUsage, "per-model tokens/USD"),
|
|
1371
1558
|
row("tui.sidebar.context.performance", "Performance line", prefs.sidebar.context.performance, "cache % + tok/s"),
|
|
1372
1559
|
row("tui.sidebar.context.localSpend", "Local spend", prefs.sidebar.context.localSpend, "hoje / 30d totals")
|
|
@@ -1398,6 +1585,18 @@ function applyTuiRow(draft, id, value) {
|
|
|
1398
1585
|
draft.layout.separator = value;
|
|
1399
1586
|
}
|
|
1400
1587
|
return;
|
|
1588
|
+
case "tui.layout.settingsView":
|
|
1589
|
+
if (SETTINGS_VIEW_MODES.includes(value)) {
|
|
1590
|
+
if (!draft.layout) draft.layout = { ...DEFAULT_TUI_PREFS.layout };
|
|
1591
|
+
draft.layout.settingsView = value;
|
|
1592
|
+
}
|
|
1593
|
+
return;
|
|
1594
|
+
case "tui.layout.language":
|
|
1595
|
+
if (LANGUAGE_CYCLE.includes(value)) {
|
|
1596
|
+
if (!draft.layout) draft.layout = { ...DEFAULT_TUI_PREFS.layout };
|
|
1597
|
+
draft.layout.language = value;
|
|
1598
|
+
}
|
|
1599
|
+
return;
|
|
1401
1600
|
case "tui.sidebar.context.barShape":
|
|
1402
1601
|
if (BAR_SHAPES_CYCLE.includes(value)) draft.sidebar.context.barShape = value;
|
|
1403
1602
|
return;
|
|
@@ -1455,6 +1654,37 @@ function applyTuiRow(draft, id, value) {
|
|
|
1455
1654
|
default: return;
|
|
1456
1655
|
}
|
|
1457
1656
|
}
|
|
1657
|
+
/** Read the current pref value for a row id ('enabled'/'disabled'/gauge/custom). */
|
|
1658
|
+
function tuiRowValue(prefs, id) {
|
|
1659
|
+
if (id === "tui.layout.preset") return prefs.layout?.preset ?? DEFAULT_TUI_PREFS.layout.preset;
|
|
1660
|
+
if (id === "tui.layout.separator") return prefs.layout?.separator ?? DEFAULT_TUI_PREFS.layout.separator;
|
|
1661
|
+
if (id === "tui.layout.settingsView") return prefs.layout?.settingsView ?? DEFAULT_TUI_PREFS.layout.settingsView ?? "docked";
|
|
1662
|
+
if (id === "tui.layout.language") return prefs.layout?.language ?? "auto";
|
|
1663
|
+
if (id === "tui.sidebar.context.barShape") return prefs.sidebar.context.barShape;
|
|
1664
|
+
if (id === "tui.sidebar.context.barWidth") return prefs.sidebar.context.barWidth;
|
|
1665
|
+
if (id === "tui.sidebar.context.gauge") return prefs.sidebar.context.gauge;
|
|
1666
|
+
if (id === "tui.sidebar.context.evenMark") return prefs.sidebar.context.evenMark ? "enabled" : "disabled";
|
|
1667
|
+
const enabled = (() => {
|
|
1668
|
+
switch (id) {
|
|
1669
|
+
case "tui.sidebar.header.version": return prefs.sidebar.header.version;
|
|
1670
|
+
case "tui.sidebar.header.preset": return prefs.sidebar.header.preset;
|
|
1671
|
+
case "tui.sidebar.header.session": return prefs.sidebar.header.session;
|
|
1672
|
+
case "tui.sidebar.block.context": return prefs.sidebar.blocks.context;
|
|
1673
|
+
case "tui.sidebar.block.git": return prefs.sidebar.blocks.git;
|
|
1674
|
+
case "tui.sidebar.block.todo": return prefs.sidebar.blocks.todo;
|
|
1675
|
+
case "tui.sidebar.block.dispatch": return prefs.sidebar.blocks.dispatch;
|
|
1676
|
+
case "tui.sidebar.context.tokens": return prefs.sidebar.context.tokens;
|
|
1677
|
+
case "tui.sidebar.context.spent": return prefs.sidebar.context.spent;
|
|
1678
|
+
case "tui.sidebar.context.modelUsage": return prefs.sidebar.context.modelUsage;
|
|
1679
|
+
case "tui.sidebar.context.performance": return prefs.sidebar.context.performance;
|
|
1680
|
+
case "tui.sidebar.context.localSpend": return prefs.sidebar.context.localSpend;
|
|
1681
|
+
case "tui.footer.prompt": return prefs.footer.prompt;
|
|
1682
|
+
case "tui.footer.home": return prefs.footer.home;
|
|
1683
|
+
default: return;
|
|
1684
|
+
}
|
|
1685
|
+
})();
|
|
1686
|
+
return enabled === void 0 ? void 0 : enabled ? "enabled" : "disabled";
|
|
1687
|
+
}
|
|
1458
1688
|
//#endregion
|
|
1459
1689
|
//#region src/update-status.ts
|
|
1460
1690
|
/** The running version's channel: a `-beta.N` suffix rides the beta dist-tag. */
|
|
@@ -1711,7 +1941,7 @@ async function readChangelogForBundle(bundleUrl) {
|
|
|
1711
1941
|
}
|
|
1712
1942
|
/** The ambient build-time version, or null outside a tsdown build. */
|
|
1713
1943
|
function embeddedVersion() {
|
|
1714
|
-
return "2.0.
|
|
1944
|
+
return "2.0.1";
|
|
1715
1945
|
}
|
|
1716
1946
|
/**
|
|
1717
1947
|
* Resolve the running Pantheon version for the what's-new window: the plugin
|
|
@@ -1936,113 +2166,118 @@ function persistUpdateCheckState(previous, latest) {
|
|
|
1936
2166
|
} catch {}
|
|
1937
2167
|
}
|
|
1938
2168
|
function resolveRunningVersion() {
|
|
1939
|
-
return "2.0.
|
|
2169
|
+
return "2.0.1";
|
|
1940
2170
|
}
|
|
1941
|
-
const VALUE_WIDTH =
|
|
2171
|
+
const VALUE_WIDTH = 24;
|
|
1942
2172
|
function SettingsWindow(props) {
|
|
1943
2173
|
const tab = () => props.tabs()[props.page()] ?? props.tabs()[0] ?? EMPTY_TAB;
|
|
1944
2174
|
return (() => {
|
|
1945
|
-
var _el$ = createElement("box"), _el$2 = createElement("box"), _el$3 = createElement("text"), _el$4 = createElement("
|
|
2175
|
+
var _el$ = createElement("box"), _el$2 = createElement("box"), _el$3 = createElement("text"), _el$4 = createElement("b"), _el$6 = createElement("span"), _el$7 = createElement("box"), _el$8 = createElement("box"), _el$9 = createElement("box"), _el$0 = createElement("text"), _el$10 = createElement("box"), _el$11 = createElement("scrollbox");
|
|
1946
2176
|
insertNode(_el$, _el$2);
|
|
1947
|
-
insertNode(_el$, _el$8);
|
|
1948
2177
|
insertNode(_el$, _el$10);
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
2178
|
+
spread(_el$, mergeProps(() => props.boxRef !== void 0 ? { ref: props.boxRef } : {}, {
|
|
2179
|
+
"focusable": true,
|
|
2180
|
+
"flexDirection": "column"
|
|
2181
|
+
}, () => props.height !== void 0 ? { height: props.height } : {
|
|
2182
|
+
flexGrow: 1,
|
|
2183
|
+
flexBasis: 0
|
|
2184
|
+
}, {
|
|
2185
|
+
"minHeight": 0,
|
|
2186
|
+
get border() {
|
|
2187
|
+
return !props.isDialog;
|
|
2188
|
+
}
|
|
2189
|
+
}, () => props.isDialog ? {} : { borderStyle: "rounded" }, {
|
|
2190
|
+
get borderColor() {
|
|
2191
|
+
return memo(() => !!props.isDialog)() ? void 0 : memo(() => !!props.hasKeyboard?.())() ? props.warn ?? "#fba970" : props.muted ?? "#52525b";
|
|
2192
|
+
},
|
|
2193
|
+
"paddingLeft": 1,
|
|
2194
|
+
"paddingRight": 1,
|
|
2195
|
+
"paddingTop": 0,
|
|
2196
|
+
"paddingBottom": 0
|
|
2197
|
+
}, () => props.onMouseDown !== void 0 ? { onMouseDown: props.onMouseDown } : {}), true);
|
|
1953
2198
|
insertNode(_el$2, _el$3);
|
|
1954
|
-
insertNode(_el$2, _el$
|
|
1955
|
-
insertNode(_el$2, _el$
|
|
1956
|
-
insertNode(_el$2, _el$
|
|
2199
|
+
insertNode(_el$2, _el$7);
|
|
2200
|
+
insertNode(_el$2, _el$8);
|
|
2201
|
+
insertNode(_el$2, _el$9);
|
|
1957
2202
|
setProp(_el$2, "flexDirection", "row");
|
|
2203
|
+
setProp(_el$2, "flexWrap", "wrap");
|
|
1958
2204
|
setProp(_el$2, "alignItems", "center");
|
|
2205
|
+
setProp(_el$2, "flexShrink", 0);
|
|
2206
|
+
setProp(_el$2, "marginBottom", 1);
|
|
2207
|
+
setProp(_el$2, "rowGap", 1);
|
|
2208
|
+
insertNode(_el$3, _el$4);
|
|
2209
|
+
insertNode(_el$3, _el$6);
|
|
1959
2210
|
setProp(_el$3, "attributes", 1);
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
setProp(_el$
|
|
1964
|
-
setProp(_el$
|
|
1965
|
-
|
|
2211
|
+
setProp(_el$3, "wrapMode", "none");
|
|
2212
|
+
insertNode(_el$4, createTextNode(`Pantheon`));
|
|
2213
|
+
insert(_el$6, () => ` v${props.version}`);
|
|
2214
|
+
setProp(_el$7, "width", 2);
|
|
2215
|
+
setProp(_el$8, "flexDirection", "row");
|
|
2216
|
+
setProp(_el$8, "flexWrap", "wrap");
|
|
2217
|
+
setProp(_el$8, "flexGrow", 1);
|
|
2218
|
+
setProp(_el$8, "flexShrink", 0);
|
|
2219
|
+
setProp(_el$8, "columnGap", 1);
|
|
2220
|
+
setProp(_el$8, "rowGap", 1);
|
|
2221
|
+
insert(_el$8, createComponent(For, {
|
|
1966
2222
|
get each() {
|
|
1967
2223
|
return props.tabs();
|
|
1968
2224
|
},
|
|
1969
2225
|
children: (t, index) => {
|
|
1970
2226
|
const isActive = () => index() === props.page();
|
|
1971
2227
|
return (() => {
|
|
1972
|
-
var _el$
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
2228
|
+
var _el$32 = createElement("box"), _el$33 = createElement("text");
|
|
2229
|
+
insertNode(_el$32, _el$33);
|
|
2230
|
+
setProp(_el$32, "onMouseDown", () => props.onJumpTab?.(index()));
|
|
2231
|
+
setProp(_el$32, "paddingLeft", 1);
|
|
2232
|
+
setProp(_el$32, "paddingRight", 1);
|
|
2233
|
+
setProp(_el$32, "flexShrink", 0);
|
|
2234
|
+
spread(_el$32, mergeProps(() => isActive() ? { backgroundColor: "#262626" } : {}), true);
|
|
2235
|
+
setProp(_el$33, "wrapMode", "none");
|
|
2236
|
+
spread(_el$33, mergeProps({ get fg() {
|
|
2237
|
+
return memo(() => !!isActive())() ? props.warn ?? "#fba970" : props.muted;
|
|
1976
2238
|
} }, () => isActive() ? { attributes: 1 } : {}), true);
|
|
1977
|
-
insert(_el$
|
|
1978
|
-
return _el$
|
|
2239
|
+
insert(_el$33, () => `${t.title}${tabDirty(props.draft(), t) ? " ●" : ""}`);
|
|
2240
|
+
return _el$32;
|
|
1979
2241
|
})();
|
|
1980
2242
|
}
|
|
1981
2243
|
}));
|
|
1982
|
-
insertNode(_el$6, createTextNode(`esc`));
|
|
1983
|
-
insertNode(_el$8, _el$9);
|
|
1984
|
-
setProp(_el$8, "flexDirection", "row");
|
|
1985
|
-
setProp(_el$8, "height", 1);
|
|
1986
2244
|
insertNode(_el$9, _el$0);
|
|
1987
|
-
setProp(_el$9, "
|
|
1988
|
-
|
|
2245
|
+
setProp(_el$9, "onMouseDown", () => props.onClose?.());
|
|
2246
|
+
setProp(_el$9, "paddingLeft", 1);
|
|
2247
|
+
setProp(_el$9, "flexShrink", 0);
|
|
2248
|
+
insertNode(_el$0, createTextNode(`esc`));
|
|
2249
|
+
setProp(_el$0, "wrapMode", "none");
|
|
1989
2250
|
insertNode(_el$10, _el$11);
|
|
1990
|
-
|
|
1991
|
-
setProp(_el$10, "
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
setProp(_el$11, "
|
|
1996
|
-
setProp(_el$11, "
|
|
2251
|
+
setProp(_el$10, "flexDirection", "column");
|
|
2252
|
+
setProp(_el$10, "flexGrow", 1);
|
|
2253
|
+
setProp(_el$10, "flexBasis", 0);
|
|
2254
|
+
setProp(_el$10, "minHeight", 0);
|
|
2255
|
+
setProp(_el$10, "overflow", "hidden");
|
|
2256
|
+
setProp(_el$11, "flexGrow", 1);
|
|
2257
|
+
setProp(_el$11, "flexBasis", 0);
|
|
2258
|
+
setProp(_el$11, "minHeight", 0);
|
|
2259
|
+
spread(_el$11, mergeProps(() => props.maxHeight !== void 0 ? { maxHeight: props.maxHeight } : {}), true);
|
|
1997
2260
|
insert(_el$11, createComponent(For, {
|
|
1998
|
-
get each() {
|
|
1999
|
-
return props.tabs();
|
|
2000
|
-
},
|
|
2001
|
-
children: (t, index) => {
|
|
2002
|
-
const isActive = () => index() === props.page();
|
|
2003
|
-
return (() => {
|
|
2004
|
-
var _el$42 = createElement("text");
|
|
2005
|
-
spread(_el$42, mergeProps({ get fg() {
|
|
2006
|
-
return memo(() => !!isActive())() ? props.warn ?? props.fg : props.muted;
|
|
2007
|
-
} }, () => isActive() ? { attributes: 1 } : {}), true);
|
|
2008
|
-
insert(_el$42, () => `${isActive() ? "▸ " : " "}${t.title}${tabDirty(props.draft(), t) ? " ●" : ""}`);
|
|
2009
|
-
return _el$42;
|
|
2010
|
-
})();
|
|
2011
|
-
}
|
|
2012
|
-
}), _el$12);
|
|
2013
|
-
setProp(_el$12, "height", 1);
|
|
2014
|
-
insertNode(_el$13, createTextNode(`1-9: tab`));
|
|
2015
|
-
insertNode(_el$15, createTextNode(`tab: next`));
|
|
2016
|
-
insertNode(_el$17, _el$18);
|
|
2017
|
-
insertNode(_el$17, _el$19);
|
|
2018
|
-
setProp(_el$17, "flexGrow", 1);
|
|
2019
|
-
setProp(_el$17, "flexShrink", 1);
|
|
2020
|
-
setProp(_el$17, "flexDirection", "column");
|
|
2021
|
-
setProp(_el$17, "paddingLeft", 1);
|
|
2022
|
-
setProp(_el$18, "attributes", 1);
|
|
2023
|
-
insert(_el$18, () => tab().title);
|
|
2024
|
-
insertNode(_el$19, createTextNode(`────────────────────────────────────────`));
|
|
2025
|
-
insert(_el$17, createComponent(For, {
|
|
2026
2261
|
get each() {
|
|
2027
2262
|
return tab().groups;
|
|
2028
2263
|
},
|
|
2029
2264
|
children: (group) => (() => {
|
|
2030
|
-
var _el$
|
|
2031
|
-
|
|
2032
|
-
setProp(_el$
|
|
2033
|
-
insert(_el$
|
|
2265
|
+
var _el$34 = createElement("box");
|
|
2266
|
+
setProp(_el$34, "flexDirection", "column");
|
|
2267
|
+
setProp(_el$34, "marginBottom", 1);
|
|
2268
|
+
insert(_el$34, createComponent(Show, {
|
|
2034
2269
|
get when() {
|
|
2035
2270
|
return group.title !== void 0;
|
|
2036
2271
|
},
|
|
2037
2272
|
get children() {
|
|
2038
|
-
var _el$
|
|
2039
|
-
setProp(_el$
|
|
2040
|
-
insert(_el$
|
|
2041
|
-
effect((_$p) => setProp(_el$
|
|
2042
|
-
return _el$
|
|
2273
|
+
var _el$35 = createElement("text");
|
|
2274
|
+
setProp(_el$35, "attributes", 1);
|
|
2275
|
+
insert(_el$35, () => group.title);
|
|
2276
|
+
effect((_$p) => setProp(_el$35, "fg", props.warn ?? props.fg, _$p));
|
|
2277
|
+
return _el$35;
|
|
2043
2278
|
}
|
|
2044
|
-
}),
|
|
2045
|
-
insert(_el$
|
|
2279
|
+
}), null);
|
|
2280
|
+
insert(_el$34, createComponent(For, {
|
|
2046
2281
|
get each() {
|
|
2047
2282
|
return group.rows;
|
|
2048
2283
|
},
|
|
@@ -2050,60 +2285,70 @@ function SettingsWindow(props) {
|
|
|
2050
2285
|
const isSelected = () => row.id === props.selectedId();
|
|
2051
2286
|
const display = () => props.draft()[row.id] ?? row.value;
|
|
2052
2287
|
const staged = () => props.draft()[row.id] !== void 0;
|
|
2053
|
-
const gutter = () => isSelected() ? "
|
|
2054
|
-
const valueCell = () =>
|
|
2288
|
+
const gutter = () => isSelected() ? "▸ " : " ";
|
|
2289
|
+
const valueCell = () => {
|
|
2290
|
+
if (row.cycle !== void 0) return `< ${display()} >`;
|
|
2291
|
+
if (row.action !== void 0) return `[ ${display()} ]`;
|
|
2292
|
+
if (row.id.startsWith("autonomy.gradient.")) return `[ref] ${display()}`;
|
|
2293
|
+
return display();
|
|
2294
|
+
};
|
|
2055
2295
|
return (() => {
|
|
2056
|
-
var _el$
|
|
2057
|
-
insertNode(_el$
|
|
2058
|
-
insertNode(_el$
|
|
2059
|
-
setProp(_el$
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2296
|
+
var _el$36 = createElement("box"), _el$37 = createElement("box"), _el$38 = createElement("text"), _el$39 = createElement("box"), _el$40 = createElement("text");
|
|
2297
|
+
insertNode(_el$36, _el$37);
|
|
2298
|
+
insertNode(_el$36, _el$39);
|
|
2299
|
+
setProp(_el$36, "flexDirection", "row");
|
|
2300
|
+
spread(_el$36, mergeProps(() => isSelected() ? { backgroundColor: "#262626" } : {}, { "onMouseDown": () => {
|
|
2301
|
+
props.onSelectRow?.(row.id);
|
|
2302
|
+
} }), true);
|
|
2303
|
+
insertNode(_el$37, _el$38);
|
|
2304
|
+
setProp(_el$37, "width", 28);
|
|
2305
|
+
spread(_el$38, mergeProps({ get fg() {
|
|
2306
|
+
return memo(() => !!isSelected())() ? props.warn ?? "#fba970" : props.fg;
|
|
2064
2307
|
} }, () => isSelected() ? { attributes: 1 } : {}), true);
|
|
2065
|
-
insert(_el$
|
|
2066
|
-
insertNode(_el$
|
|
2067
|
-
setProp(_el$
|
|
2068
|
-
|
|
2069
|
-
|
|
2308
|
+
insert(_el$38, () => `${gutter()}${row.name}`.padEnd(28));
|
|
2309
|
+
insertNode(_el$39, _el$40);
|
|
2310
|
+
setProp(_el$39, "width", 24);
|
|
2311
|
+
setProp(_el$39, "onMouseDown", () => {
|
|
2312
|
+
props.onSelectRow?.(row.id);
|
|
2313
|
+
props.onCycleValue?.(row.id, 1);
|
|
2314
|
+
});
|
|
2315
|
+
spread(_el$40, mergeProps({ get fg() {
|
|
2316
|
+
return memo(() => !!isSelected())() ? "#ffffff" : memo(() => !!staged())() ? props.warn ?? props.fg : props.muted;
|
|
2070
2317
|
} }, () => isSelected() || staged() ? { attributes: 1 } : {}), true);
|
|
2071
|
-
insert(_el$
|
|
2072
|
-
insert(_el$
|
|
2318
|
+
insert(_el$40, () => `${valueCell()}${staged() ? " ●" : ""}`.padEnd(VALUE_WIDTH));
|
|
2319
|
+
insert(_el$36, createComponent(Show, {
|
|
2073
2320
|
get when() {
|
|
2074
2321
|
return row.note !== void 0;
|
|
2075
2322
|
},
|
|
2076
2323
|
get children() {
|
|
2077
|
-
var _el$
|
|
2078
|
-
insertNode(_el$
|
|
2079
|
-
setProp(_el$
|
|
2080
|
-
setProp(_el$
|
|
2081
|
-
insert(_el$
|
|
2082
|
-
effect((_$p) => setProp(_el$
|
|
2083
|
-
return _el$
|
|
2324
|
+
var _el$41 = createElement("box"), _el$42 = createElement("text");
|
|
2325
|
+
insertNode(_el$41, _el$42);
|
|
2326
|
+
setProp(_el$41, "flexGrow", 1);
|
|
2327
|
+
setProp(_el$41, "flexShrink", 1);
|
|
2328
|
+
insert(_el$42, () => row.note);
|
|
2329
|
+
effect((_$p) => setProp(_el$42, "fg", isSelected() ? "#e5e7eb" : props.muted, _$p));
|
|
2330
|
+
return _el$41;
|
|
2084
2331
|
}
|
|
2085
2332
|
}), null);
|
|
2086
|
-
|
|
2087
|
-
return _el$46;
|
|
2333
|
+
return _el$36;
|
|
2088
2334
|
})();
|
|
2089
2335
|
}
|
|
2090
|
-
}),
|
|
2091
|
-
|
|
2092
|
-
return _el$43;
|
|
2336
|
+
}), null);
|
|
2337
|
+
return _el$34;
|
|
2093
2338
|
})()
|
|
2094
|
-
})
|
|
2339
|
+
}));
|
|
2095
2340
|
insert(_el$, createComponent(Show, {
|
|
2096
2341
|
get when() {
|
|
2097
2342
|
return props.notice() !== void 0;
|
|
2098
2343
|
},
|
|
2099
2344
|
get children() {
|
|
2100
|
-
var _el$
|
|
2101
|
-
insert(_el$
|
|
2102
|
-
var _c$ = memo(() => !!(props.notice()?.startsWith("
|
|
2103
|
-
return () => _c$() ? props.notice() :
|
|
2345
|
+
var _el$12 = createElement("text");
|
|
2346
|
+
insert(_el$12, (() => {
|
|
2347
|
+
var _c$ = memo(() => !!(props.notice()?.startsWith("[OK]") || props.notice()?.startsWith("saved")));
|
|
2348
|
+
return () => _c$() ? props.notice() : `[WARN] ${props.notice()}`;
|
|
2104
2349
|
})());
|
|
2105
|
-
effect((_$p) => setProp(_el$
|
|
2106
|
-
return _el$
|
|
2350
|
+
effect((_$p) => setProp(_el$12, "fg", props.notice()?.startsWith("[OK]") || props.notice()?.startsWith("saved") ? props.fg : props.warn ?? props.muted, _$p));
|
|
2351
|
+
return _el$12;
|
|
2107
2352
|
}
|
|
2108
2353
|
}), null);
|
|
2109
2354
|
insert(_el$, createComponent(Show, {
|
|
@@ -2112,134 +2357,170 @@ function SettingsWindow(props) {
|
|
|
2112
2357
|
},
|
|
2113
2358
|
get fallback() {
|
|
2114
2359
|
return (() => {
|
|
2115
|
-
var _el$
|
|
2116
|
-
insertNode(_el$
|
|
2117
|
-
setProp(_el$
|
|
2118
|
-
insert(_el$
|
|
2360
|
+
var _el$43 = createElement("box"), _el$61 = createElement("text");
|
|
2361
|
+
insertNode(_el$43, _el$61);
|
|
2362
|
+
setProp(_el$43, "flexDirection", "column");
|
|
2363
|
+
insert(_el$43, createComponent(Show, {
|
|
2119
2364
|
get when() {
|
|
2120
2365
|
return draftDirty(props.draft());
|
|
2121
2366
|
},
|
|
2122
2367
|
get fallback() {
|
|
2123
2368
|
return (() => {
|
|
2124
|
-
var _el$
|
|
2369
|
+
var _el$62 = createElement("box"), _el$63 = createElement("box"), _el$64 = createElement("text"), _el$66 = createElement("text"), _el$68 = createElement("box"), _el$69 = createElement("text"), _el$71 = createElement("text"), _el$73 = createElement("box"), _el$74 = createElement("text"), _el$76 = createElement("box"), _el$77 = createElement("text");
|
|
2370
|
+
insertNode(_el$62, _el$63);
|
|
2371
|
+
insertNode(_el$62, _el$66);
|
|
2372
|
+
insertNode(_el$62, _el$68);
|
|
2373
|
+
insertNode(_el$62, _el$71);
|
|
2374
|
+
insertNode(_el$62, _el$73);
|
|
2375
|
+
insertNode(_el$62, _el$76);
|
|
2376
|
+
insertNode(_el$62, _el$77);
|
|
2377
|
+
setProp(_el$62, "flexDirection", "row");
|
|
2378
|
+
setProp(_el$62, "flexWrap", "wrap");
|
|
2379
|
+
setProp(_el$62, "alignItems", "center");
|
|
2380
|
+
setProp(_el$62, "flexShrink", 0);
|
|
2381
|
+
setProp(_el$62, "rowGap", 1);
|
|
2382
|
+
insertNode(_el$63, _el$64);
|
|
2383
|
+
setProp(_el$63, "backgroundColor", "#262626");
|
|
2384
|
+
setProp(_el$63, "flexShrink", 0);
|
|
2385
|
+
setProp(_el$63, "onMouseDown", () => props.onClose?.());
|
|
2386
|
+
insertNode(_el$64, createTextNode(` Close `));
|
|
2387
|
+
setProp(_el$64, "fg", "#ffffff");
|
|
2388
|
+
insertNode(_el$66, createTextNode(` `));
|
|
2389
|
+
setProp(_el$66, "flexShrink", 0);
|
|
2390
|
+
insertNode(_el$68, _el$69);
|
|
2391
|
+
setProp(_el$68, "backgroundColor", "#262626");
|
|
2392
|
+
setProp(_el$68, "flexShrink", 0);
|
|
2393
|
+
setProp(_el$68, "onMouseDown", () => props.onResetPage?.());
|
|
2394
|
+
insertNode(_el$69, createTextNode(` Reset page `));
|
|
2395
|
+
setProp(_el$69, "fg", "#ffffff");
|
|
2396
|
+
insertNode(_el$71, createTextNode(` `));
|
|
2397
|
+
setProp(_el$71, "flexShrink", 0);
|
|
2125
2398
|
insertNode(_el$73, _el$74);
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
insertNode(_el$
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
setProp(_el$
|
|
2133
|
-
insertNode(_el$
|
|
2134
|
-
setProp(_el$
|
|
2135
|
-
insertNode(_el$75, createTextNode(` Close `));
|
|
2136
|
-
setProp(_el$75, "fg", "#ffffff");
|
|
2137
|
-
insertNode(_el$77, createTextNode(` `));
|
|
2138
|
-
insertNode(_el$79, _el$80);
|
|
2139
|
-
setProp(_el$79, "backgroundColor", "#262626");
|
|
2140
|
-
insertNode(_el$80, createTextNode(` Reset page `));
|
|
2141
|
-
setProp(_el$80, "fg", "#ffffff");
|
|
2142
|
-
insertNode(_el$82, createTextNode(` `));
|
|
2143
|
-
insertNode(_el$84, _el$85);
|
|
2144
|
-
setProp(_el$84, "backgroundColor", "#262626");
|
|
2145
|
-
insertNode(_el$85, createTextNode(` Defaults `));
|
|
2146
|
-
setProp(_el$85, "fg", "#ffffff");
|
|
2147
|
-
setProp(_el$87, "flexGrow", 1);
|
|
2148
|
-
insertNode(_el$88, createTextNode(`no staged changes`));
|
|
2399
|
+
setProp(_el$73, "backgroundColor", "#262626");
|
|
2400
|
+
setProp(_el$73, "flexShrink", 0);
|
|
2401
|
+
setProp(_el$73, "onMouseDown", () => props.onStageDefaults?.());
|
|
2402
|
+
insertNode(_el$74, createTextNode(` Defaults `));
|
|
2403
|
+
setProp(_el$74, "fg", "#ffffff");
|
|
2404
|
+
setProp(_el$76, "flexGrow", 1);
|
|
2405
|
+
setProp(_el$76, "minWidth", 1);
|
|
2406
|
+
insertNode(_el$77, createTextNode(`no staged changes`));
|
|
2407
|
+
setProp(_el$77, "flexShrink", 0);
|
|
2149
2408
|
effect((_p$) => {
|
|
2150
|
-
var _v$
|
|
2151
|
-
_v$
|
|
2152
|
-
_v$
|
|
2153
|
-
_v$
|
|
2409
|
+
var _v$1 = props.muted, _v$10 = props.muted, _v$11 = props.muted;
|
|
2410
|
+
_v$1 !== _p$.e && (_p$.e = setProp(_el$66, "fg", _v$1, _p$.e));
|
|
2411
|
+
_v$10 !== _p$.t && (_p$.t = setProp(_el$71, "fg", _v$10, _p$.t));
|
|
2412
|
+
_v$11 !== _p$.a && (_p$.a = setProp(_el$77, "fg", _v$11, _p$.a));
|
|
2154
2413
|
return _p$;
|
|
2155
2414
|
}, {
|
|
2156
2415
|
e: void 0,
|
|
2157
2416
|
t: void 0,
|
|
2158
2417
|
a: void 0
|
|
2159
2418
|
});
|
|
2160
|
-
return _el$
|
|
2419
|
+
return _el$62;
|
|
2161
2420
|
})();
|
|
2162
2421
|
},
|
|
2163
2422
|
get children() {
|
|
2164
|
-
var _el$
|
|
2165
|
-
insertNode(_el$
|
|
2166
|
-
insertNode(_el$
|
|
2167
|
-
insertNode(_el$
|
|
2168
|
-
insertNode(_el$
|
|
2169
|
-
insertNode(_el$
|
|
2170
|
-
insertNode(_el$
|
|
2171
|
-
insertNode(_el$
|
|
2172
|
-
setProp(_el$
|
|
2423
|
+
var _el$44 = createElement("box"), _el$45 = createElement("box"), _el$46 = createElement("text"), _el$48 = createElement("text"), _el$50 = createElement("box"), _el$51 = createElement("text"), _el$53 = createElement("text"), _el$55 = createElement("box"), _el$56 = createElement("text"), _el$58 = createElement("box"), _el$59 = createElement("text");
|
|
2424
|
+
insertNode(_el$44, _el$45);
|
|
2425
|
+
insertNode(_el$44, _el$48);
|
|
2426
|
+
insertNode(_el$44, _el$50);
|
|
2427
|
+
insertNode(_el$44, _el$53);
|
|
2428
|
+
insertNode(_el$44, _el$55);
|
|
2429
|
+
insertNode(_el$44, _el$58);
|
|
2430
|
+
insertNode(_el$44, _el$59);
|
|
2431
|
+
setProp(_el$44, "flexDirection", "row");
|
|
2432
|
+
setProp(_el$44, "flexWrap", "wrap");
|
|
2433
|
+
setProp(_el$44, "alignItems", "center");
|
|
2434
|
+
setProp(_el$44, "flexShrink", 0);
|
|
2435
|
+
setProp(_el$44, "rowGap", 1);
|
|
2436
|
+
insertNode(_el$45, _el$46);
|
|
2437
|
+
setProp(_el$45, "backgroundColor", "#fba970");
|
|
2438
|
+
setProp(_el$45, "flexShrink", 0);
|
|
2439
|
+
setProp(_el$45, "onMouseDown", () => props.onSave?.());
|
|
2440
|
+
insertNode(_el$46, createTextNode(` Save `));
|
|
2441
|
+
setProp(_el$46, "fg", "#000000");
|
|
2442
|
+
insertNode(_el$48, createTextNode(` `));
|
|
2443
|
+
setProp(_el$48, "flexShrink", 0);
|
|
2444
|
+
insertNode(_el$50, _el$51);
|
|
2445
|
+
setProp(_el$50, "backgroundColor", "#262626");
|
|
2446
|
+
setProp(_el$50, "flexShrink", 0);
|
|
2447
|
+
setProp(_el$50, "onMouseDown", () => props.onDiscard?.());
|
|
2448
|
+
insertNode(_el$51, createTextNode(` Discard `));
|
|
2449
|
+
setProp(_el$51, "fg", "#ffffff");
|
|
2450
|
+
insertNode(_el$53, createTextNode(` `));
|
|
2451
|
+
setProp(_el$53, "flexShrink", 0);
|
|
2173
2452
|
insertNode(_el$55, _el$56);
|
|
2174
|
-
setProp(_el$55, "backgroundColor", "#
|
|
2175
|
-
|
|
2176
|
-
setProp(_el$
|
|
2177
|
-
insertNode(_el$
|
|
2178
|
-
|
|
2179
|
-
setProp(_el$
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
insertNode(_el$65, _el$66);
|
|
2184
|
-
setProp(_el$65, "backgroundColor", "#262626");
|
|
2185
|
-
insertNode(_el$66, createTextNode(` Reset page `));
|
|
2186
|
-
setProp(_el$66, "fg", "#ffffff");
|
|
2187
|
-
setProp(_el$68, "flexGrow", 1);
|
|
2188
|
-
insertNode(_el$69, createTextNode(`unsaved changes`));
|
|
2453
|
+
setProp(_el$55, "backgroundColor", "#262626");
|
|
2454
|
+
setProp(_el$55, "flexShrink", 0);
|
|
2455
|
+
setProp(_el$55, "onMouseDown", () => props.onResetPage?.());
|
|
2456
|
+
insertNode(_el$56, createTextNode(` Reset page `));
|
|
2457
|
+
setProp(_el$56, "fg", "#ffffff");
|
|
2458
|
+
setProp(_el$58, "flexGrow", 1);
|
|
2459
|
+
setProp(_el$58, "minWidth", 1);
|
|
2460
|
+
insertNode(_el$59, createTextNode(`unsaved changes`));
|
|
2461
|
+
setProp(_el$59, "flexShrink", 0);
|
|
2189
2462
|
effect((_p$) => {
|
|
2190
|
-
var _v$
|
|
2191
|
-
_v$
|
|
2192
|
-
_v$
|
|
2193
|
-
_v$
|
|
2463
|
+
var _v$8 = props.muted, _v$9 = props.muted, _v$0 = props.warn ?? "#f59e0b";
|
|
2464
|
+
_v$8 !== _p$.e && (_p$.e = setProp(_el$48, "fg", _v$8, _p$.e));
|
|
2465
|
+
_v$9 !== _p$.t && (_p$.t = setProp(_el$53, "fg", _v$9, _p$.t));
|
|
2466
|
+
_v$0 !== _p$.a && (_p$.a = setProp(_el$59, "fg", _v$0, _p$.a));
|
|
2194
2467
|
return _p$;
|
|
2195
2468
|
}, {
|
|
2196
2469
|
e: void 0,
|
|
2197
2470
|
t: void 0,
|
|
2198
2471
|
a: void 0
|
|
2199
2472
|
});
|
|
2200
|
-
return _el$
|
|
2473
|
+
return _el$44;
|
|
2201
2474
|
}
|
|
2202
|
-
}), _el$
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2475
|
+
}), _el$61);
|
|
2476
|
+
insert(_el$61, () => {
|
|
2477
|
+
const currentRow = findRow(tab(), props.selectedId() ?? "");
|
|
2478
|
+
if (currentRow?.cycle !== void 0) return "click or ›/←/→ change · ↑↓ select · tab next tab · ctrl+s save · ctrl+r reset page · esc close";
|
|
2479
|
+
if (currentRow?.action !== void 0) return "enter or space run action · ↑↓ select · tab next tab · ctrl+s save · ctrl+r reset page · esc close";
|
|
2480
|
+
return "[ref] documented reference (read-only) · ↑↓ select · tab next tab · esc close";
|
|
2481
|
+
});
|
|
2482
|
+
effect((_$p) => setProp(_el$61, "fg", props.muted, _$p));
|
|
2483
|
+
return _el$43;
|
|
2206
2484
|
})();
|
|
2207
2485
|
},
|
|
2208
2486
|
get children() {
|
|
2209
|
-
var _el$
|
|
2487
|
+
var _el$13 = createElement("box"), _el$14 = createElement("box"), _el$15 = createElement("text"), _el$17 = createElement("box"), _el$18 = createElement("text"), _el$20 = createElement("text"), _el$22 = createElement("box"), _el$23 = createElement("text"), _el$25 = createElement("text"), _el$27 = createElement("box"), _el$28 = createElement("text"), _el$30 = createElement("text");
|
|
2488
|
+
insertNode(_el$13, _el$14);
|
|
2489
|
+
insertNode(_el$13, _el$30);
|
|
2490
|
+
setProp(_el$13, "flexDirection", "column");
|
|
2491
|
+
insertNode(_el$14, _el$15);
|
|
2492
|
+
insertNode(_el$14, _el$17);
|
|
2493
|
+
insertNode(_el$14, _el$20);
|
|
2494
|
+
insertNode(_el$14, _el$22);
|
|
2495
|
+
insertNode(_el$14, _el$25);
|
|
2496
|
+
insertNode(_el$14, _el$27);
|
|
2497
|
+
setProp(_el$14, "flexDirection", "row");
|
|
2498
|
+
insertNode(_el$15, createTextNode(`Keep your changes? `));
|
|
2499
|
+
setProp(_el$15, "attributes", 1);
|
|
2500
|
+
insertNode(_el$17, _el$18);
|
|
2501
|
+
setProp(_el$17, "backgroundColor", "#fba970");
|
|
2502
|
+
setProp(_el$17, "onMouseDown", () => props.onSave?.());
|
|
2503
|
+
insertNode(_el$18, createTextNode(` Save `));
|
|
2504
|
+
setProp(_el$18, "fg", "#000000");
|
|
2505
|
+
insertNode(_el$20, createTextNode(` `));
|
|
2210
2506
|
insertNode(_el$22, _el$23);
|
|
2211
|
-
|
|
2212
|
-
setProp(_el$22, "
|
|
2213
|
-
insertNode(_el$23,
|
|
2214
|
-
|
|
2215
|
-
insertNode(_el$
|
|
2216
|
-
insertNode(_el$
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
insertNode(_el$26, _el$27);
|
|
2223
|
-
setProp(_el$26, "backgroundColor", "#fba970");
|
|
2224
|
-
insertNode(_el$27, createTextNode(` Save `));
|
|
2225
|
-
setProp(_el$27, "fg", "#000000");
|
|
2226
|
-
insertNode(_el$29, createTextNode(` `));
|
|
2227
|
-
insertNode(_el$31, _el$32);
|
|
2228
|
-
setProp(_el$31, "backgroundColor", "#262626");
|
|
2229
|
-
insertNode(_el$32, createTextNode(` Discard `));
|
|
2230
|
-
setProp(_el$32, "fg", "#ffffff");
|
|
2231
|
-
insertNode(_el$34, createTextNode(` `));
|
|
2232
|
-
insertNode(_el$36, _el$37);
|
|
2233
|
-
setProp(_el$36, "backgroundColor", "#262626");
|
|
2234
|
-
insertNode(_el$37, createTextNode(` Keep editing `));
|
|
2235
|
-
setProp(_el$37, "fg", "#ffffff");
|
|
2236
|
-
insertNode(_el$39, createTextNode(`ctrl+s save · d discard the changes · esc keep editing`));
|
|
2507
|
+
setProp(_el$22, "backgroundColor", "#262626");
|
|
2508
|
+
setProp(_el$22, "onMouseDown", () => props.onDiscard?.());
|
|
2509
|
+
insertNode(_el$23, createTextNode(` Discard `));
|
|
2510
|
+
setProp(_el$23, "fg", "#ffffff");
|
|
2511
|
+
insertNode(_el$25, createTextNode(` `));
|
|
2512
|
+
insertNode(_el$27, _el$28);
|
|
2513
|
+
setProp(_el$27, "backgroundColor", "#262626");
|
|
2514
|
+
setProp(_el$27, "onMouseDown", () => props.onCancelExit?.());
|
|
2515
|
+
insertNode(_el$28, createTextNode(` Keep editing `));
|
|
2516
|
+
setProp(_el$28, "fg", "#ffffff");
|
|
2517
|
+
insertNode(_el$30, createTextNode(`ctrl+s save · d discard the changes · esc keep editing`));
|
|
2237
2518
|
effect((_p$) => {
|
|
2238
2519
|
var _v$ = props.warn ?? "#f59e0b", _v$2 = props.muted, _v$3 = props.muted, _v$4 = props.muted;
|
|
2239
|
-
_v$ !== _p$.e && (_p$.e = setProp(_el$
|
|
2240
|
-
_v$2 !== _p$.t && (_p$.t = setProp(_el$
|
|
2241
|
-
_v$3 !== _p$.a && (_p$.a = setProp(_el$
|
|
2242
|
-
_v$4 !== _p$.o && (_p$.o = setProp(_el$
|
|
2520
|
+
_v$ !== _p$.e && (_p$.e = setProp(_el$15, "fg", _v$, _p$.e));
|
|
2521
|
+
_v$2 !== _p$.t && (_p$.t = setProp(_el$20, "fg", _v$2, _p$.t));
|
|
2522
|
+
_v$3 !== _p$.a && (_p$.a = setProp(_el$25, "fg", _v$3, _p$.a));
|
|
2523
|
+
_v$4 !== _p$.o && (_p$.o = setProp(_el$30, "fg", _v$4, _p$.o));
|
|
2243
2524
|
return _p$;
|
|
2244
2525
|
}, {
|
|
2245
2526
|
e: void 0,
|
|
@@ -2247,27 +2528,19 @@ function SettingsWindow(props) {
|
|
|
2247
2528
|
a: void 0,
|
|
2248
2529
|
o: void 0
|
|
2249
2530
|
});
|
|
2250
|
-
return _el$
|
|
2531
|
+
return _el$13;
|
|
2251
2532
|
}
|
|
2252
2533
|
}), null);
|
|
2253
2534
|
effect((_p$) => {
|
|
2254
|
-
var _v$5 = props.fg, _v$6 =
|
|
2535
|
+
var _v$5 = props.fg, _v$6 = { fg: props.muted }, _v$7 = props.muted;
|
|
2255
2536
|
_v$5 !== _p$.e && (_p$.e = setProp(_el$3, "fg", _v$5, _p$.e));
|
|
2256
|
-
_v$6 !== _p$.t && (_p$.t = setProp(_el$6, "
|
|
2537
|
+
_v$6 !== _p$.t && (_p$.t = setProp(_el$6, "style", _v$6, _p$.t));
|
|
2257
2538
|
_v$7 !== _p$.a && (_p$.a = setProp(_el$0, "fg", _v$7, _p$.a));
|
|
2258
|
-
_v$8 !== _p$.o && (_p$.o = setProp(_el$13, "fg", _v$8, _p$.o));
|
|
2259
|
-
_v$9 !== _p$.i && (_p$.i = setProp(_el$15, "fg", _v$9, _p$.i));
|
|
2260
|
-
_v$0 !== _p$.n && (_p$.n = setProp(_el$18, "fg", _v$0, _p$.n));
|
|
2261
|
-
_v$1 !== _p$.s && (_p$.s = setProp(_el$19, "fg", _v$1, _p$.s));
|
|
2262
2539
|
return _p$;
|
|
2263
2540
|
}, {
|
|
2264
2541
|
e: void 0,
|
|
2265
2542
|
t: void 0,
|
|
2266
|
-
a: void 0
|
|
2267
|
-
o: void 0,
|
|
2268
|
-
i: void 0,
|
|
2269
|
-
n: void 0,
|
|
2270
|
-
s: void 0
|
|
2543
|
+
a: void 0
|
|
2271
2544
|
});
|
|
2272
2545
|
return _el$;
|
|
2273
2546
|
})();
|
|
@@ -2291,6 +2564,9 @@ function createWindowController(context, exit) {
|
|
|
2291
2564
|
const [draft, setDraft] = createSignal({});
|
|
2292
2565
|
const [notice, setNotice] = createSignal(void 0);
|
|
2293
2566
|
const [confirmExit, setConfirmExit] = createSignal(false);
|
|
2567
|
+
createEffect(() => {
|
|
2568
|
+
setTuiDraftPreview(draft());
|
|
2569
|
+
});
|
|
2294
2570
|
readChangelogForBundle(import.meta.url).then((text) => {
|
|
2295
2571
|
if (!text) return;
|
|
2296
2572
|
const hl = extractHighlights(text, currentVersion);
|
|
@@ -2328,26 +2604,30 @@ function createWindowController(context, exit) {
|
|
|
2328
2604
|
if (seen !== void 0) input.lastCheckedVersion = seen;
|
|
2329
2605
|
return input;
|
|
2330
2606
|
};
|
|
2331
|
-
const tabs = () =>
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2607
|
+
const tabs = () => {
|
|
2608
|
+
const lang = savedTuiPrefs().layout?.language;
|
|
2609
|
+
return [
|
|
2610
|
+
buildGatesTab(load()),
|
|
2611
|
+
buildDecisionTab(decision(), process.env, readAuthProviders(), readConfigProviders(), lang),
|
|
2612
|
+
buildPresetTab(presetInput()),
|
|
2613
|
+
buildTuiTab(savedTuiPrefs()),
|
|
2614
|
+
buildAutonomyTab({
|
|
2615
|
+
goalLoop: goalLoop(),
|
|
2616
|
+
budgets: budgets(),
|
|
2617
|
+
goalLoopRestartPending: autonomyRestartPending(),
|
|
2618
|
+
languagePref: lang
|
|
2619
|
+
}),
|
|
2620
|
+
buildJ1Tab(process.env, false, lang),
|
|
2621
|
+
buildUpdatesTab(updatesInput()),
|
|
2622
|
+
buildChangelogTab(currentVersion, changelogItems()),
|
|
2623
|
+
buildDoctorTab({
|
|
2624
|
+
runningVersion: currentVersion,
|
|
2625
|
+
nodeVersion: process.versions.node,
|
|
2626
|
+
load: load()
|
|
2627
|
+
}),
|
|
2628
|
+
buildAboutTab(currentVersion)
|
|
2629
|
+
];
|
|
2630
|
+
};
|
|
2351
2631
|
const rows = () => tabRows(tabs()[page()] ?? tabs()[0] ?? EMPTY_TAB);
|
|
2352
2632
|
const move = (delta) => {
|
|
2353
2633
|
if (confirmExit()) setConfirmExit(false);
|
|
@@ -2392,7 +2672,7 @@ function createWindowController(context, exit) {
|
|
|
2392
2672
|
});
|
|
2393
2673
|
} catch {}
|
|
2394
2674
|
} else {
|
|
2395
|
-
setNotice("
|
|
2675
|
+
setNotice("[OK] update complete — restart OpenCode or run `npx pantheon-opencode init`");
|
|
2396
2676
|
try {
|
|
2397
2677
|
context.ui.toast?.show?.({
|
|
2398
2678
|
variant: "info",
|
|
@@ -2609,6 +2889,7 @@ function createWindowController(context, exit) {
|
|
|
2609
2889
|
return;
|
|
2610
2890
|
}
|
|
2611
2891
|
if (staged > 0) {
|
|
2892
|
+
clearTuiDraftPreview();
|
|
2612
2893
|
setDraft({});
|
|
2613
2894
|
try {
|
|
2614
2895
|
context.ui.toast?.show?.({
|
|
@@ -2621,6 +2902,7 @@ function createWindowController(context, exit) {
|
|
|
2621
2902
|
};
|
|
2622
2903
|
const discard = () => {
|
|
2623
2904
|
const staged = draftCount(draft());
|
|
2905
|
+
clearTuiDraftPreview();
|
|
2624
2906
|
setDraft({});
|
|
2625
2907
|
setConfirmExit(false);
|
|
2626
2908
|
if (staged > 0) try {
|
|
@@ -2635,6 +2917,26 @@ function createWindowController(context, exit) {
|
|
|
2635
2917
|
setConfirmExit(false);
|
|
2636
2918
|
};
|
|
2637
2919
|
const selectedId = () => rows()[selected()]?.id;
|
|
2920
|
+
const selectById = (id) => {
|
|
2921
|
+
if (confirmExit()) setConfirmExit(false);
|
|
2922
|
+
const index = rows().findIndex((r) => r.id === id);
|
|
2923
|
+
if (index !== -1) setSelected(index);
|
|
2924
|
+
};
|
|
2925
|
+
const cycleRowById = (id, direction) => {
|
|
2926
|
+
if (confirmExit()) setConfirmExit(false);
|
|
2927
|
+
const list = rows();
|
|
2928
|
+
const index = list.findIndex((r) => r.id === id);
|
|
2929
|
+
if (index !== -1) {
|
|
2930
|
+
setSelected(index);
|
|
2931
|
+
const row = list[index];
|
|
2932
|
+
if (row?.action === "update-check") checkUpdatesNow();
|
|
2933
|
+
else if (row?.action === "update-run") runUpdateNow();
|
|
2934
|
+
else if (row) {
|
|
2935
|
+
setNotice(void 0);
|
|
2936
|
+
setDraft(stageValue(draft(), row, direction));
|
|
2937
|
+
}
|
|
2938
|
+
}
|
|
2939
|
+
};
|
|
2638
2940
|
return {
|
|
2639
2941
|
tabs,
|
|
2640
2942
|
page,
|
|
@@ -2645,6 +2947,8 @@ function createWindowController(context, exit) {
|
|
|
2645
2947
|
api: {
|
|
2646
2948
|
move,
|
|
2647
2949
|
step,
|
|
2950
|
+
selectById,
|
|
2951
|
+
cycleRowById,
|
|
2648
2952
|
actuate: () => {
|
|
2649
2953
|
if (confirmExit()) setConfirmExit(false);
|
|
2650
2954
|
const row = rows()[selected()];
|
|
@@ -2653,6 +2957,14 @@ function createWindowController(context, exit) {
|
|
|
2653
2957
|
else step(1);
|
|
2654
2958
|
},
|
|
2655
2959
|
nextTab,
|
|
2960
|
+
prevTab: () => {
|
|
2961
|
+
if (confirmExit()) setConfirmExit(false);
|
|
2962
|
+
const count = tabs().length;
|
|
2963
|
+
if (count > 0) {
|
|
2964
|
+
setPage((current) => (current - 1 + count) % count);
|
|
2965
|
+
setSelected(0);
|
|
2966
|
+
}
|
|
2967
|
+
},
|
|
2656
2968
|
jumpTab: (index) => {
|
|
2657
2969
|
if (confirmExit()) setConfirmExit(false);
|
|
2658
2970
|
if (index >= 0 && index < tabs().length) {
|
|
@@ -2669,6 +2981,7 @@ function createWindowController(context, exit) {
|
|
|
2669
2981
|
confirmExit: () => confirmExit()
|
|
2670
2982
|
},
|
|
2671
2983
|
cleanup: () => {
|
|
2984
|
+
clearTuiDraftPreview();
|
|
2672
2985
|
pageApi = void 0;
|
|
2673
2986
|
setBlocking(false);
|
|
2674
2987
|
}
|
|
@@ -2715,7 +3028,16 @@ function SettingsPage(props) {
|
|
|
2715
3028
|
get muted() {
|
|
2716
3029
|
return theme.muted;
|
|
2717
3030
|
},
|
|
2718
|
-
warn
|
|
3031
|
+
warn,
|
|
3032
|
+
onJumpTab: (idx) => controller.api.jumpTab(idx),
|
|
3033
|
+
onSelectRow: (id) => controller.api.selectById?.(id),
|
|
3034
|
+
onCycleValue: (id, dir) => controller.api.cycleRowById?.(id, dir),
|
|
3035
|
+
onSave: () => controller.api.save(),
|
|
3036
|
+
onResetPage: () => controller.api.resetPage(),
|
|
3037
|
+
onStageDefaults: () => controller.api.stageDefaults(),
|
|
3038
|
+
onClose: () => controller.api.close(),
|
|
3039
|
+
onDiscard: () => controller.api.discard?.(),
|
|
3040
|
+
onCancelExit: () => controller.api.cancelExit?.()
|
|
2719
3041
|
});
|
|
2720
3042
|
}
|
|
2721
3043
|
function navigateBack(context, data) {
|
|
@@ -2746,6 +3068,8 @@ function openSettingsDialog(context) {
|
|
|
2746
3068
|
setBlocking(true);
|
|
2747
3069
|
setDialogOpen(true);
|
|
2748
3070
|
pageApi = controller.api;
|
|
3071
|
+
const rendererHeight = () => context.renderer?.height ?? 30;
|
|
3072
|
+
const maxHeight = () => Math.min(16, Math.max(8, Math.floor(rendererHeight() * .55)));
|
|
2749
3073
|
try {
|
|
2750
3074
|
context.ui.dialog.show(() => createComponent(SettingsWindow, {
|
|
2751
3075
|
get version() {
|
|
@@ -2775,10 +3099,171 @@ function openSettingsDialog(context) {
|
|
|
2775
3099
|
get muted() {
|
|
2776
3100
|
return theme.muted;
|
|
2777
3101
|
},
|
|
2778
|
-
warn
|
|
3102
|
+
warn,
|
|
3103
|
+
isDialog: true,
|
|
3104
|
+
get maxHeight() {
|
|
3105
|
+
return maxHeight();
|
|
3106
|
+
},
|
|
3107
|
+
onJumpTab: (idx) => controller.api.jumpTab(idx),
|
|
3108
|
+
onSelectRow: (id) => controller.api.selectById?.(id),
|
|
3109
|
+
onCycleValue: (id, dir) => controller.api.cycleRowById?.(id, dir),
|
|
3110
|
+
onSave: () => controller.api.save(),
|
|
3111
|
+
onResetPage: () => controller.api.resetPage(),
|
|
3112
|
+
onStageDefaults: () => controller.api.stageDefaults(),
|
|
3113
|
+
onClose: () => controller.api.close(),
|
|
3114
|
+
onDiscard: () => controller.api.discard?.(),
|
|
3115
|
+
onCancelExit: () => controller.api.cancelExit?.()
|
|
2779
3116
|
}), close);
|
|
3117
|
+
context.ui.dialog.set({ size: "large" });
|
|
2780
3118
|
} catch {}
|
|
2781
3119
|
}
|
|
3120
|
+
const [settingsOpen, setSettingsOpen] = createSignal(false);
|
|
3121
|
+
const [activeSessionId, setActiveSessionId] = createSignal();
|
|
3122
|
+
function routeSessionID(context) {
|
|
3123
|
+
try {
|
|
3124
|
+
const route = context?.ui?.router?.current?.();
|
|
3125
|
+
return route?.type === "session" ? route?.sessionID : void 0;
|
|
3126
|
+
} catch {
|
|
3127
|
+
return;
|
|
3128
|
+
}
|
|
3129
|
+
}
|
|
3130
|
+
function closePantheonSettings() {
|
|
3131
|
+
if (pageApi) {
|
|
3132
|
+
pageApi.close();
|
|
3133
|
+
if (pageApi.confirmExit?.()) return;
|
|
3134
|
+
}
|
|
3135
|
+
setSettingsOpen(false);
|
|
3136
|
+
setBlocking(false);
|
|
3137
|
+
}
|
|
3138
|
+
function PantheonSettingsSlot(props) {
|
|
3139
|
+
onMount(() => {
|
|
3140
|
+
setActiveSessionId(props.sessionID);
|
|
3141
|
+
});
|
|
3142
|
+
onCleanup(() => {
|
|
3143
|
+
if (activeSessionId() === props.sessionID) setActiveSessionId(void 0);
|
|
3144
|
+
});
|
|
3145
|
+
return createComponent(Show, {
|
|
3146
|
+
get when() {
|
|
3147
|
+
return memo(() => !!settingsOpen())() && (activeSessionId() === props.sessionID || !activeSessionId());
|
|
3148
|
+
},
|
|
3149
|
+
get children() {
|
|
3150
|
+
return createComponent(InSessionSettingsWindow, {
|
|
3151
|
+
get context() {
|
|
3152
|
+
return props.context;
|
|
3153
|
+
},
|
|
3154
|
+
get sessionID() {
|
|
3155
|
+
return props.sessionID;
|
|
3156
|
+
}
|
|
3157
|
+
});
|
|
3158
|
+
}
|
|
3159
|
+
});
|
|
3160
|
+
}
|
|
3161
|
+
function InSessionSettingsWindow(props) {
|
|
3162
|
+
let windowBox;
|
|
3163
|
+
const context = props.context;
|
|
3164
|
+
const initialRoom = () => Math.max(14, (context.renderer?.height ?? 30) - 10);
|
|
3165
|
+
const [roomHeight, setRoomHeight] = createSignal(initialRoom());
|
|
3166
|
+
const [hasKeyboard, setHasKeyboard] = createSignal(false);
|
|
3167
|
+
function measureRoom() {
|
|
3168
|
+
const box = windowBox;
|
|
3169
|
+
if (!box || box.isDestroyed) return;
|
|
3170
|
+
let child = box;
|
|
3171
|
+
for (let parent = box.parent; parent; child = parent, parent = parent.parent) {
|
|
3172
|
+
const siblings = parent.getChildren?.() ?? [];
|
|
3173
|
+
const messages = siblings[0];
|
|
3174
|
+
if (messages === child || !messages?.getChildren?.().some((item) => "scrollChildIntoView" in item)) continue;
|
|
3175
|
+
const otherRows = siblings.filter((item) => item !== child && item !== messages).reduce((total, item) => total + (item.height ?? 0), 0);
|
|
3176
|
+
const room = Math.max(12, (parent.height ?? 24) - 1 - otherRows - ((child.height ?? 0) - (box.height ?? 0)));
|
|
3177
|
+
if (room !== roomHeight()) queueMicrotask(() => setRoomHeight(room));
|
|
3178
|
+
return;
|
|
3179
|
+
}
|
|
3180
|
+
}
|
|
3181
|
+
onMount(() => {
|
|
3182
|
+
try {
|
|
3183
|
+
context.renderer?.root?.on?.("layout-changed", measureRoom);
|
|
3184
|
+
context.renderer?.on?.("resize", measureRoom);
|
|
3185
|
+
onCleanup(() => {
|
|
3186
|
+
try {
|
|
3187
|
+
context.renderer?.root?.off?.("layout-changed", measureRoom);
|
|
3188
|
+
context.renderer?.off?.("resize", measureRoom);
|
|
3189
|
+
} catch {}
|
|
3190
|
+
});
|
|
3191
|
+
} catch {}
|
|
3192
|
+
measureRoom();
|
|
3193
|
+
setTimeout(() => {
|
|
3194
|
+
try {
|
|
3195
|
+
windowBox?.focus?.();
|
|
3196
|
+
} catch {}
|
|
3197
|
+
}, 50);
|
|
3198
|
+
});
|
|
3199
|
+
try {
|
|
3200
|
+
const popMode = context.keymap?.mode?.push?.(ROUTE_MODE);
|
|
3201
|
+
if (popMode !== void 0) onCleanup(() => popMode());
|
|
3202
|
+
} catch {}
|
|
3203
|
+
const controller = createWindowController(context, () => {
|
|
3204
|
+
setSettingsOpen(false);
|
|
3205
|
+
setBlocking(false);
|
|
3206
|
+
});
|
|
3207
|
+
onCleanup(controller.cleanup);
|
|
3208
|
+
pageApi = controller.api;
|
|
3209
|
+
const theme = context.theme?.text ?? {};
|
|
3210
|
+
const warn = theme?.feedback?.warning?.base ?? "#fba970";
|
|
3211
|
+
return createComponent(SettingsWindow, {
|
|
3212
|
+
boxRef: (el) => {
|
|
3213
|
+
windowBox = el;
|
|
3214
|
+
if (el) {
|
|
3215
|
+
el.on?.("focused", () => setHasKeyboard(true));
|
|
3216
|
+
el.on?.("blurred", () => setHasKeyboard(false));
|
|
3217
|
+
}
|
|
3218
|
+
},
|
|
3219
|
+
get height() {
|
|
3220
|
+
return roomHeight();
|
|
3221
|
+
},
|
|
3222
|
+
get version() {
|
|
3223
|
+
return resolveRunningVersion();
|
|
3224
|
+
},
|
|
3225
|
+
get tabs() {
|
|
3226
|
+
return controller.tabs;
|
|
3227
|
+
},
|
|
3228
|
+
get page() {
|
|
3229
|
+
return controller.page;
|
|
3230
|
+
},
|
|
3231
|
+
get selectedId() {
|
|
3232
|
+
return controller.selectedId;
|
|
3233
|
+
},
|
|
3234
|
+
get draft() {
|
|
3235
|
+
return controller.draft;
|
|
3236
|
+
},
|
|
3237
|
+
get notice() {
|
|
3238
|
+
return controller.notice;
|
|
3239
|
+
},
|
|
3240
|
+
get confirmExit() {
|
|
3241
|
+
return controller.confirmExit;
|
|
3242
|
+
},
|
|
3243
|
+
get fg() {
|
|
3244
|
+
return theme.base;
|
|
3245
|
+
},
|
|
3246
|
+
get muted() {
|
|
3247
|
+
return theme.muted;
|
|
3248
|
+
},
|
|
3249
|
+
warn,
|
|
3250
|
+
hasKeyboard,
|
|
3251
|
+
onJumpTab: (idx) => controller.api.jumpTab(idx),
|
|
3252
|
+
onSelectRow: (id) => controller.api.selectById?.(id),
|
|
3253
|
+
onCycleValue: (id, dir) => controller.api.cycleRowById?.(id, dir),
|
|
3254
|
+
onSave: () => controller.api.save(),
|
|
3255
|
+
onResetPage: () => controller.api.resetPage(),
|
|
3256
|
+
onStageDefaults: () => controller.api.stageDefaults(),
|
|
3257
|
+
onClose: () => closePantheonSettings(),
|
|
3258
|
+
onDiscard: () => controller.api.discard?.(),
|
|
3259
|
+
onCancelExit: () => controller.api.cancelExit?.(),
|
|
3260
|
+
onMouseDown: () => {
|
|
3261
|
+
try {
|
|
3262
|
+
windowBox?.focus?.();
|
|
3263
|
+
} catch {}
|
|
3264
|
+
}
|
|
3265
|
+
});
|
|
3266
|
+
}
|
|
2782
3267
|
function setupPantheonSettings(context) {
|
|
2783
3268
|
try {
|
|
2784
3269
|
context.ui.router?.register?.({
|
|
@@ -2806,26 +3291,15 @@ function setupPantheonSettings(context) {
|
|
|
2806
3291
|
title: "Close settings",
|
|
2807
3292
|
bind: "escape,q",
|
|
2808
3293
|
run: () => {
|
|
2809
|
-
try {
|
|
2810
|
-
context.ui.toast?.show?.({
|
|
2811
|
-
variant: "info",
|
|
2812
|
-
message: "settings: close command fired"
|
|
2813
|
-
});
|
|
2814
|
-
} catch {}
|
|
2815
3294
|
if (pageApi === void 0) {
|
|
2816
|
-
|
|
2817
|
-
context.ui.toast?.show?.({
|
|
2818
|
-
variant: "warning",
|
|
2819
|
-
message: "settings: no window controller bound"
|
|
2820
|
-
});
|
|
2821
|
-
} catch {}
|
|
3295
|
+
closePantheonSettings();
|
|
2822
3296
|
return;
|
|
2823
3297
|
}
|
|
2824
3298
|
if (pageApi.confirmExit?.()) {
|
|
2825
3299
|
pageApi.cancelExit?.();
|
|
2826
3300
|
return;
|
|
2827
3301
|
}
|
|
2828
|
-
|
|
3302
|
+
closePantheonSettings();
|
|
2829
3303
|
}
|
|
2830
3304
|
},
|
|
2831
3305
|
{
|
|
@@ -2887,6 +3361,14 @@ function setupPantheonSettings(context) {
|
|
|
2887
3361
|
pageApi?.nextTab();
|
|
2888
3362
|
}
|
|
2889
3363
|
},
|
|
3364
|
+
{
|
|
3365
|
+
id: "pantheon.settings.prev.tab",
|
|
3366
|
+
title: "Previous settings tab",
|
|
3367
|
+
bind: "shift+tab",
|
|
3368
|
+
run: () => {
|
|
3369
|
+
pageApi?.prevTab?.();
|
|
3370
|
+
}
|
|
3371
|
+
},
|
|
2890
3372
|
{
|
|
2891
3373
|
id: "pantheon.settings.save",
|
|
2892
3374
|
title: "Save staged changes",
|
|
@@ -2924,7 +3406,7 @@ function setupPantheonSettings(context) {
|
|
|
2924
3406
|
context.keymap.layer(() => ({
|
|
2925
3407
|
mode: ROUTE_MODE,
|
|
2926
3408
|
priority: 1,
|
|
2927
|
-
enabled: () => routeGated(),
|
|
3409
|
+
enabled: () => routeGated() || settingsOpen(),
|
|
2928
3410
|
commands
|
|
2929
3411
|
}));
|
|
2930
3412
|
} catch {}
|
|
@@ -2932,14 +3414,15 @@ function setupPantheonSettings(context) {
|
|
|
2932
3414
|
context.keymap.layer(() => ({
|
|
2933
3415
|
mode: "global",
|
|
2934
3416
|
priority: 1,
|
|
2935
|
-
enabled: () => dialogOpen(),
|
|
3417
|
+
enabled: () => dialogOpen() || settingsOpen(),
|
|
2936
3418
|
commands
|
|
2937
3419
|
}));
|
|
2938
3420
|
} catch {}
|
|
2939
3421
|
}
|
|
2940
3422
|
async function openPantheonSettings(context) {
|
|
2941
3423
|
try {
|
|
2942
|
-
|
|
3424
|
+
const viewMode = tuiPrefs().layout?.settingsView ?? "docked";
|
|
3425
|
+
if (viewMode === "fullscreen" && routerAvailable && context.ui?.router?.navigate) {
|
|
2943
3426
|
let returnRoute;
|
|
2944
3427
|
try {
|
|
2945
3428
|
const current = context.ui.router.current();
|
|
@@ -2954,8 +3437,27 @@ async function openPantheonSettings(context) {
|
|
|
2954
3437
|
});
|
|
2955
3438
|
return;
|
|
2956
3439
|
}
|
|
3440
|
+
if (viewMode === "dialog") {
|
|
3441
|
+
openSettingsDialog(context);
|
|
3442
|
+
return;
|
|
3443
|
+
}
|
|
2957
3444
|
} catch {}
|
|
2958
|
-
|
|
3445
|
+
if (!(context?.sessionID ?? routeSessionID(context) ?? activeSessionId())) {
|
|
3446
|
+
try {
|
|
3447
|
+
context.ui?.toast?.show?.({
|
|
3448
|
+
variant: "info",
|
|
3449
|
+
title: "Pantheon",
|
|
3450
|
+
message: "Open a session first: Pantheon settings opens above the prompt box."
|
|
3451
|
+
});
|
|
3452
|
+
} catch {}
|
|
3453
|
+
return;
|
|
3454
|
+
}
|
|
3455
|
+
if (settingsOpen()) {
|
|
3456
|
+
closePantheonSettings();
|
|
3457
|
+
return;
|
|
3458
|
+
}
|
|
3459
|
+
setSettingsOpen(true);
|
|
3460
|
+
setBlocking(true);
|
|
2959
3461
|
}
|
|
2960
3462
|
//#endregion
|
|
2961
3463
|
//#region src/sidebar-width.ts
|
|
@@ -3205,10 +3707,10 @@ async function defaultWhatsNewStatePath(env = process.env, home = homedir()) {
|
|
|
3205
3707
|
* - never throws on its own inputs; I/O failures inside the state module
|
|
3206
3708
|
* are fail-open there.
|
|
3207
3709
|
*/
|
|
3208
|
-
/** Muted footer hint teaching the dismiss bind
|
|
3209
|
-
const WHATS_NEW_CLOSE_HINT = "esc/q
|
|
3710
|
+
/** Muted footer hint teaching the dismiss bind. */
|
|
3711
|
+
const WHATS_NEW_CLOSE_HINT = "esc/q close";
|
|
3210
3712
|
/** Hint variant when the highlights span more than one page. */
|
|
3211
|
-
const WHATS_NEW_PAGES_HINT = "esc/q
|
|
3713
|
+
const WHATS_NEW_PAGES_HINT = "esc/q close · n next · p back";
|
|
3212
3714
|
/** Hard-wrap one display line into rows of at most `width` columns (>= 10). */
|
|
3213
3715
|
function wrapWhatsNewLine(line, width) {
|
|
3214
3716
|
const bounded = Number.isInteger(width) && width > 10 ? width : 76;
|
|
@@ -3287,54 +3789,154 @@ async function openWhatsNew(input) {
|
|
|
3287
3789
|
* CHANGELOG.md, unreadable state, a host API that throws — the window simply
|
|
3288
3790
|
* does not show (fail-open, like the rest of the plugin).
|
|
3289
3791
|
*/
|
|
3290
|
-
/** Window body: title, rule, the current page (wrapped), footer
|
|
3792
|
+
/** Window body: title, rule, the current page (wrapped), footer action bar with OK button. */
|
|
3291
3793
|
function WhatsNewContent(props) {
|
|
3292
3794
|
const rows = () => {
|
|
3293
3795
|
const current = props.data.pages[Math.min(props.page(), props.pageCount() - 1)] ?? [];
|
|
3294
3796
|
const wrapped = [];
|
|
3295
|
-
for (const line of current) wrapped.push(...wrapWhatsNewLine(line,
|
|
3797
|
+
for (const line of current) wrapped.push(...wrapWhatsNewLine(line, 72));
|
|
3296
3798
|
return wrapped;
|
|
3297
3799
|
};
|
|
3298
3800
|
return (() => {
|
|
3299
|
-
var _el$ = createElement("box"), _el$2 = createElement("
|
|
3801
|
+
var _el$ = createElement("box"), _el$2 = createElement("box"), _el$3 = createElement("box"), _el$4 = createElement("box"), _el$5 = createElement("text"), _el$7 = createElement("text"), _el$8 = createElement("box"), _el$9 = createElement("text"), _el$1 = createElement("box"), _el$10 = createElement("text"), _el$12 = createElement("box"), _el$13 = createElement("box"), _el$14 = createElement("text"), _el$16 = createElement("box"), _el$17 = createElement("box"), _el$25 = createElement("text"), _el$27 = createElement("box"), _el$28 = createElement("text");
|
|
3300
3802
|
insertNode(_el$, _el$2);
|
|
3301
|
-
insertNode(_el$, _el$
|
|
3302
|
-
insertNode(_el$, _el$
|
|
3303
|
-
insertNode(_el$, _el$
|
|
3803
|
+
insertNode(_el$, _el$1);
|
|
3804
|
+
insertNode(_el$, _el$12);
|
|
3805
|
+
insertNode(_el$, _el$13);
|
|
3806
|
+
insertNode(_el$, _el$16);
|
|
3304
3807
|
setProp(_el$, "flexDirection", "column");
|
|
3305
|
-
setProp(_el$, "
|
|
3306
|
-
setProp(_el$, "
|
|
3808
|
+
setProp(_el$, "borderStyle", "rounded");
|
|
3809
|
+
setProp(_el$, "paddingLeft", 2);
|
|
3810
|
+
setProp(_el$, "paddingRight", 2);
|
|
3307
3811
|
setProp(_el$, "paddingTop", 1);
|
|
3308
|
-
setProp(_el
|
|
3309
|
-
|
|
3310
|
-
insertNode(_el$
|
|
3311
|
-
|
|
3812
|
+
setProp(_el$, "paddingBottom", 1);
|
|
3813
|
+
insertNode(_el$2, _el$3);
|
|
3814
|
+
insertNode(_el$2, _el$8);
|
|
3815
|
+
setProp(_el$2, "flexDirection", "row");
|
|
3816
|
+
setProp(_el$2, "alignItems", "center");
|
|
3817
|
+
setProp(_el$2, "justifyContent", "space-between");
|
|
3818
|
+
insertNode(_el$3, _el$4);
|
|
3819
|
+
insertNode(_el$3, _el$7);
|
|
3820
|
+
setProp(_el$3, "flexDirection", "row");
|
|
3821
|
+
setProp(_el$3, "alignItems", "center");
|
|
3822
|
+
insertNode(_el$4, _el$5);
|
|
3823
|
+
setProp(_el$4, "paddingLeft", 1);
|
|
3824
|
+
setProp(_el$4, "paddingRight", 1);
|
|
3825
|
+
setProp(_el$4, "marginRight", 1);
|
|
3826
|
+
insertNode(_el$5, createTextNode(`NOVIDADES`));
|
|
3827
|
+
setProp(_el$5, "fg", "#000000");
|
|
3828
|
+
setProp(_el$5, "attributes", 1);
|
|
3829
|
+
setProp(_el$7, "attributes", 1);
|
|
3830
|
+
insert(_el$7, () => props.data.title);
|
|
3831
|
+
insertNode(_el$8, _el$9);
|
|
3832
|
+
setProp(_el$8, "onMouseDown", () => props.onClose?.());
|
|
3833
|
+
insertNode(_el$9, createTextNode(`[ Esc / Q ]`));
|
|
3834
|
+
insertNode(_el$1, _el$10);
|
|
3835
|
+
setProp(_el$1, "flexDirection", "row");
|
|
3836
|
+
setProp(_el$1, "height", 1);
|
|
3837
|
+
setProp(_el$1, "marginTop", 1);
|
|
3838
|
+
setProp(_el$1, "marginBottom", 1);
|
|
3839
|
+
insertNode(_el$10, createTextNode(`────────────────────────────────────────────────────────────────────────`));
|
|
3840
|
+
setProp(_el$12, "flexDirection", "column");
|
|
3841
|
+
setProp(_el$12, "minHeight", 8);
|
|
3842
|
+
insert(_el$12, createComponent(For, {
|
|
3312
3843
|
get each() {
|
|
3313
3844
|
return rows();
|
|
3314
3845
|
},
|
|
3315
|
-
children: (line) =>
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
})
|
|
3327
|
-
|
|
3846
|
+
children: (line) => {
|
|
3847
|
+
const isBullet = line.startsWith("• ");
|
|
3848
|
+
return (() => {
|
|
3849
|
+
var _el$30 = createElement("text");
|
|
3850
|
+
spread(_el$30, mergeProps({ get fg() {
|
|
3851
|
+
return isBullet ? props.fg : props.muted;
|
|
3852
|
+
} }, isBullet ? { attributes: 1 } : {}), true);
|
|
3853
|
+
insert(_el$30, line);
|
|
3854
|
+
return _el$30;
|
|
3855
|
+
})();
|
|
3856
|
+
}
|
|
3857
|
+
}));
|
|
3858
|
+
insertNode(_el$13, _el$14);
|
|
3859
|
+
setProp(_el$13, "flexDirection", "row");
|
|
3860
|
+
setProp(_el$13, "height", 1);
|
|
3861
|
+
setProp(_el$13, "marginTop", 1);
|
|
3862
|
+
insertNode(_el$14, createTextNode(`────────────────────────────────────────────────────────────────────────`));
|
|
3863
|
+
insertNode(_el$16, _el$17);
|
|
3864
|
+
insertNode(_el$16, _el$27);
|
|
3865
|
+
setProp(_el$16, "flexDirection", "row");
|
|
3866
|
+
setProp(_el$16, "alignItems", "center");
|
|
3867
|
+
setProp(_el$16, "justifyContent", "space-between");
|
|
3868
|
+
setProp(_el$16, "marginTop", 1);
|
|
3869
|
+
insertNode(_el$17, _el$25);
|
|
3870
|
+
setProp(_el$17, "flexDirection", "row");
|
|
3871
|
+
setProp(_el$17, "alignItems", "center");
|
|
3872
|
+
insert(_el$17, createComponent(Show, {
|
|
3873
|
+
get when() {
|
|
3874
|
+
return props.pageCount() > 1;
|
|
3875
|
+
},
|
|
3876
|
+
get children() {
|
|
3877
|
+
return [
|
|
3878
|
+
(() => {
|
|
3879
|
+
var _el$18 = createElement("box"), _el$19 = createElement("text");
|
|
3880
|
+
insertNode(_el$18, _el$19);
|
|
3881
|
+
setProp(_el$18, "backgroundColor", "#262626");
|
|
3882
|
+
setProp(_el$18, "paddingLeft", 1);
|
|
3883
|
+
setProp(_el$18, "paddingRight", 1);
|
|
3884
|
+
setProp(_el$18, "marginRight", 1);
|
|
3885
|
+
setProp(_el$18, "onMouseDown", () => props.onPrev?.());
|
|
3886
|
+
insertNode(_el$19, createTextNode(`‹ Prev`));
|
|
3887
|
+
setProp(_el$19, "fg", "#ffffff");
|
|
3888
|
+
return _el$18;
|
|
3889
|
+
})(),
|
|
3890
|
+
(() => {
|
|
3891
|
+
var _el$21 = createElement("text");
|
|
3892
|
+
setProp(_el$21, "marginRight", 1);
|
|
3893
|
+
insert(_el$21, () => `${props.page() + 1} / ${props.pageCount()}`);
|
|
3894
|
+
effect((_$p) => setProp(_el$21, "fg", props.muted, _$p));
|
|
3895
|
+
return _el$21;
|
|
3896
|
+
})(),
|
|
3897
|
+
(() => {
|
|
3898
|
+
var _el$22 = createElement("box"), _el$23 = createElement("text");
|
|
3899
|
+
insertNode(_el$22, _el$23);
|
|
3900
|
+
setProp(_el$22, "backgroundColor", "#262626");
|
|
3901
|
+
setProp(_el$22, "paddingLeft", 1);
|
|
3902
|
+
setProp(_el$22, "paddingRight", 1);
|
|
3903
|
+
setProp(_el$22, "marginRight", 1);
|
|
3904
|
+
setProp(_el$22, "onMouseDown", () => props.onNext?.());
|
|
3905
|
+
insertNode(_el$23, createTextNode(`Next ›`));
|
|
3906
|
+
setProp(_el$23, "fg", "#ffffff");
|
|
3907
|
+
return _el$22;
|
|
3908
|
+
})()
|
|
3909
|
+
];
|
|
3910
|
+
}
|
|
3911
|
+
}), _el$25);
|
|
3912
|
+
insertNode(_el$25, createTextNode(`Enter / Esc / Q close`));
|
|
3913
|
+
insertNode(_el$27, _el$28);
|
|
3914
|
+
setProp(_el$27, "paddingLeft", 2);
|
|
3915
|
+
setProp(_el$27, "paddingRight", 2);
|
|
3916
|
+
setProp(_el$27, "onMouseDown", () => props.onClose?.());
|
|
3917
|
+
insertNode(_el$28, createTextNode(`OK, Got it`));
|
|
3918
|
+
setProp(_el$28, "fg", "#000000");
|
|
3919
|
+
setProp(_el$28, "attributes", 1);
|
|
3328
3920
|
effect((_p$) => {
|
|
3329
|
-
var _v$ = props.
|
|
3330
|
-
_v$ !== _p$.e && (_p$.e = setProp(_el
|
|
3331
|
-
_v$2 !== _p$.t && (_p$.t = setProp(_el$
|
|
3332
|
-
_v$3 !== _p$.a && (_p$.a = setProp(_el$
|
|
3921
|
+
var _v$ = props.warn ?? "#fba970", _v$2 = props.warn ?? "#fba970", _v$3 = props.fg, _v$4 = props.muted, _v$5 = props.muted, _v$6 = props.muted, _v$7 = props.muted, _v$8 = props.warn ?? "#fba970";
|
|
3922
|
+
_v$ !== _p$.e && (_p$.e = setProp(_el$, "borderColor", _v$, _p$.e));
|
|
3923
|
+
_v$2 !== _p$.t && (_p$.t = setProp(_el$4, "backgroundColor", _v$2, _p$.t));
|
|
3924
|
+
_v$3 !== _p$.a && (_p$.a = setProp(_el$7, "fg", _v$3, _p$.a));
|
|
3925
|
+
_v$4 !== _p$.o && (_p$.o = setProp(_el$9, "fg", _v$4, _p$.o));
|
|
3926
|
+
_v$5 !== _p$.i && (_p$.i = setProp(_el$10, "fg", _v$5, _p$.i));
|
|
3927
|
+
_v$6 !== _p$.n && (_p$.n = setProp(_el$14, "fg", _v$6, _p$.n));
|
|
3928
|
+
_v$7 !== _p$.s && (_p$.s = setProp(_el$25, "fg", _v$7, _p$.s));
|
|
3929
|
+
_v$8 !== _p$.h && (_p$.h = setProp(_el$27, "backgroundColor", _v$8, _p$.h));
|
|
3333
3930
|
return _p$;
|
|
3334
3931
|
}, {
|
|
3335
3932
|
e: void 0,
|
|
3336
3933
|
t: void 0,
|
|
3337
|
-
a: void 0
|
|
3934
|
+
a: void 0,
|
|
3935
|
+
o: void 0,
|
|
3936
|
+
i: void 0,
|
|
3937
|
+
n: void 0,
|
|
3938
|
+
s: void 0,
|
|
3939
|
+
h: void 0
|
|
3338
3940
|
});
|
|
3339
3941
|
return _el$;
|
|
3340
3942
|
})();
|
|
@@ -3359,9 +3961,18 @@ async function maybeShowWhatsNewV2(context) {
|
|
|
3359
3961
|
mode: "global",
|
|
3360
3962
|
enabled: () => open(),
|
|
3361
3963
|
commands: [
|
|
3964
|
+
{
|
|
3965
|
+
id: "pantheon.whats-new.confirm",
|
|
3966
|
+
title: "Confirm and close what is new",
|
|
3967
|
+
bind: "enter,space",
|
|
3968
|
+
run: () => {
|
|
3969
|
+
if (!open()) return false;
|
|
3970
|
+
dismiss();
|
|
3971
|
+
}
|
|
3972
|
+
},
|
|
3362
3973
|
{
|
|
3363
3974
|
id: "pantheon.whats-new.close",
|
|
3364
|
-
title: "
|
|
3975
|
+
title: "Close what is new",
|
|
3365
3976
|
bind: "escape,q",
|
|
3366
3977
|
run: () => {
|
|
3367
3978
|
if (!open()) return false;
|
|
@@ -3409,6 +4020,7 @@ async function maybeShowWhatsNewV2(context) {
|
|
|
3409
4020
|
setOpen(true);
|
|
3410
4021
|
try {
|
|
3411
4022
|
const theme = context.theme?.text ?? {};
|
|
4023
|
+
const warn = theme?.feedback?.warning?.base ?? "#fba970";
|
|
3412
4024
|
context.ui.dialog.show(() => createComponent(WhatsNewContent, {
|
|
3413
4025
|
data: viewData,
|
|
3414
4026
|
page,
|
|
@@ -3418,7 +4030,11 @@ async function maybeShowWhatsNewV2(context) {
|
|
|
3418
4030
|
},
|
|
3419
4031
|
get muted() {
|
|
3420
4032
|
return theme.muted;
|
|
3421
|
-
}
|
|
4033
|
+
},
|
|
4034
|
+
warn,
|
|
4035
|
+
onClose: dismiss,
|
|
4036
|
+
onNext: () => setPage((current) => Math.min(current + 1, pageCount() - 1)),
|
|
4037
|
+
onPrev: () => setPage((current) => Math.max(current - 1, 0))
|
|
3422
4038
|
}), close);
|
|
3423
4039
|
} catch {}
|
|
3424
4040
|
}
|
|
@@ -3437,7 +4053,7 @@ const SPINNER_INTERVAL_MS = 80;
|
|
|
3437
4053
|
/** Bounded warm-up: sync at most this many sessions at plugin load. */
|
|
3438
4054
|
const WARMUP_SESSION_LIMIT = 24;
|
|
3439
4055
|
/** Sidebar body shown while the host has not published a session yet. */
|
|
3440
|
-
const SIDEBAR_WAITING_LABEL = "
|
|
4056
|
+
const SIDEBAR_WAITING_LABEL = "Waiting for session…";
|
|
3441
4057
|
/** Delegate-completion toast title. */
|
|
3442
4058
|
const TOAST_TITLE = "Pantheon";
|
|
3443
4059
|
/** Marker before the preset label (fixed header, home status, prompt footer).
|
|
@@ -3913,7 +4529,7 @@ function contextBlockRows(usage, cost, gaugeStyle = "both", barOptions) {
|
|
|
3913
4529
|
lead: null,
|
|
3914
4530
|
value: spentValue,
|
|
3915
4531
|
tail: null,
|
|
3916
|
-
suffix: "
|
|
4532
|
+
suffix: " spent in session",
|
|
3917
4533
|
tone: null
|
|
3918
4534
|
};
|
|
3919
4535
|
if (usage === null) return spent === null ? null : {
|
|
@@ -5137,7 +5753,7 @@ function buildDispatchBlock(views, now = Date.now(), frame = 0, max = 34) {
|
|
|
5137
5753
|
const DISPATCH_PANEL_NAME = "pantheon.dispatch";
|
|
5138
5754
|
/** Toast shown when `ui.panel.open` refuses (no session route is active). The
|
|
5139
5755
|
* panel only exists inside a session, so there is no alternative route. */
|
|
5140
|
-
const DISPATCH_PANEL_TOAST = "
|
|
5756
|
+
const DISPATCH_PANEL_TOAST = "Open a session to view Dispatch";
|
|
5141
5757
|
/** Panel title marker — the same glyph the sidebar block header uses. */
|
|
5142
5758
|
const DISPATCH_PANEL_HEADER_MARKER = "◈";
|
|
5143
5759
|
/** Selected-row gutter marker (`▸`, one cell). */
|
|
@@ -5149,7 +5765,7 @@ const DISPATCH_PANEL_RULE_CHAR = "─";
|
|
|
5149
5765
|
/** Em dash for any datum the host did not publish. */
|
|
5150
5766
|
const DISPATCH_PANEL_DASH = "—";
|
|
5151
5767
|
/** Body of an empty panel (the claim still renders, the list is just empty). */
|
|
5152
|
-
const DISPATCH_PANEL_EMPTY_TEXT = "
|
|
5768
|
+
const DISPATCH_PANEL_EMPTY_TEXT = "No delegated sessions";
|
|
5153
5769
|
/** Width at or above which the list and the detail sit side by side. */
|
|
5154
5770
|
const DISPATCH_PANEL_WIDE_MIN_WIDTH = 72;
|
|
5155
5771
|
/** Rows the viewport holds; pageup/pagedown move by exactly this many rows. */
|
|
@@ -5361,55 +5977,55 @@ const DISPATCH_PANEL_COMMANDS = [
|
|
|
5361
5977
|
{
|
|
5362
5978
|
action: "up",
|
|
5363
5979
|
id: "pantheon.dispatch.up",
|
|
5364
|
-
title: "Dispatch:
|
|
5980
|
+
title: "Dispatch: select previous",
|
|
5365
5981
|
bind: "k,up"
|
|
5366
5982
|
},
|
|
5367
5983
|
{
|
|
5368
5984
|
action: "down",
|
|
5369
5985
|
id: "pantheon.dispatch.down",
|
|
5370
|
-
title: "Dispatch:
|
|
5986
|
+
title: "Dispatch: select next",
|
|
5371
5987
|
bind: "j,down"
|
|
5372
5988
|
},
|
|
5373
5989
|
{
|
|
5374
5990
|
action: "home",
|
|
5375
5991
|
id: "pantheon.dispatch.home",
|
|
5376
|
-
title: "Dispatch:
|
|
5992
|
+
title: "Dispatch: first",
|
|
5377
5993
|
bind: "home"
|
|
5378
5994
|
},
|
|
5379
5995
|
{
|
|
5380
5996
|
action: "end",
|
|
5381
5997
|
id: "pantheon.dispatch.end",
|
|
5382
|
-
title: "Dispatch:
|
|
5998
|
+
title: "Dispatch: last",
|
|
5383
5999
|
bind: "end"
|
|
5384
6000
|
},
|
|
5385
6001
|
{
|
|
5386
6002
|
action: "pageup",
|
|
5387
6003
|
id: "pantheon.dispatch.pageup",
|
|
5388
|
-
title: "Dispatch:
|
|
6004
|
+
title: "Dispatch: page up",
|
|
5389
6005
|
bind: "pageup"
|
|
5390
6006
|
},
|
|
5391
6007
|
{
|
|
5392
6008
|
action: "pagedown",
|
|
5393
6009
|
id: "pantheon.dispatch.pagedown",
|
|
5394
|
-
title: "Dispatch:
|
|
6010
|
+
title: "Dispatch: page down",
|
|
5395
6011
|
bind: "pagedown"
|
|
5396
6012
|
},
|
|
5397
6013
|
{
|
|
5398
6014
|
action: "toggle",
|
|
5399
6015
|
id: "pantheon.dispatch.toggle",
|
|
5400
|
-
title: "Dispatch:
|
|
6016
|
+
title: "Dispatch: expand detail",
|
|
5401
6017
|
bind: "enter"
|
|
5402
6018
|
},
|
|
5403
6019
|
{
|
|
5404
6020
|
action: "fullscreen",
|
|
5405
6021
|
id: "pantheon.dispatch.fullscreen",
|
|
5406
|
-
title: "Dispatch:
|
|
6022
|
+
title: "Dispatch: fullscreen",
|
|
5407
6023
|
bind: "f"
|
|
5408
6024
|
},
|
|
5409
6025
|
{
|
|
5410
6026
|
action: "close",
|
|
5411
6027
|
id: "pantheon.dispatch.close",
|
|
5412
|
-
title: "Dispatch:
|
|
6028
|
+
title: "Dispatch: close",
|
|
5413
6029
|
bind: "escape,q"
|
|
5414
6030
|
}
|
|
5415
6031
|
];
|
|
@@ -5464,10 +6080,10 @@ function dispatchPanelFooter(shortcutsOf) {
|
|
|
5464
6080
|
return text === "" ? "—" : text;
|
|
5465
6081
|
};
|
|
5466
6082
|
return [
|
|
5467
|
-
`${keys("pantheon.dispatch.up")} ${keys("pantheon.dispatch.down")}
|
|
5468
|
-
`${keys("pantheon.dispatch.toggle")}
|
|
6083
|
+
`${keys("pantheon.dispatch.up")} ${keys("pantheon.dispatch.down")} move`,
|
|
6084
|
+
`${keys("pantheon.dispatch.toggle")} detail`,
|
|
5469
6085
|
`${keys("pantheon.dispatch.fullscreen")} fullscreen`,
|
|
5470
|
-
`${keys("pantheon.dispatch.close")}
|
|
6086
|
+
`${keys("pantheon.dispatch.close")} close`
|
|
5471
6087
|
].join(SPEND_LINE_SEPARATOR);
|
|
5472
6088
|
}
|
|
5473
6089
|
/** The subset of `PanelInput` the model reads, so tests can drive it with a
|
|
@@ -5716,7 +6332,7 @@ async function checkForPantheonUpdate(context) {
|
|
|
5716
6332
|
const latest = String((await response.json())?.version ?? "");
|
|
5717
6333
|
if (!latest) return;
|
|
5718
6334
|
const notice = pickUpdateNotice({
|
|
5719
|
-
currentVersion: "2.0.
|
|
6335
|
+
currentVersion: "2.0.1",
|
|
5720
6336
|
latestVersion: latest,
|
|
5721
6337
|
state: readState(),
|
|
5722
6338
|
nowMs: Date.now()
|
|
@@ -5780,8 +6396,19 @@ function useActivePreset(context) {
|
|
|
5780
6396
|
clearInterval(timer);
|
|
5781
6397
|
});
|
|
5782
6398
|
});
|
|
6399
|
+
const effectivePreset = () => {
|
|
6400
|
+
const preview = tuiDraftPreview();
|
|
6401
|
+
if (preview && "preset" in preview) {
|
|
6402
|
+
const stagedName = preview.preset;
|
|
6403
|
+
return {
|
|
6404
|
+
...preset(),
|
|
6405
|
+
name: stagedName === "none" ? null : stagedName
|
|
6406
|
+
};
|
|
6407
|
+
}
|
|
6408
|
+
return preset();
|
|
6409
|
+
};
|
|
5783
6410
|
return {
|
|
5784
|
-
preset,
|
|
6411
|
+
preset: effectivePreset,
|
|
5785
6412
|
overrides
|
|
5786
6413
|
};
|
|
5787
6414
|
}
|
|
@@ -6339,7 +6966,7 @@ function ContextRowView(props) {
|
|
|
6339
6966
|
const fullWidth = () => cellWidth(`${props.row.lead ?? ""}${props.row.tail ?? ""}${props.row.value}${props.row.suffix ?? ""}`);
|
|
6340
6967
|
return createComponent(Show, {
|
|
6341
6968
|
get when() {
|
|
6342
|
-
return props.row.suffix !== "
|
|
6969
|
+
return props.row.suffix !== " spent in session";
|
|
6343
6970
|
},
|
|
6344
6971
|
get fallback() {
|
|
6345
6972
|
return (() => {
|
|
@@ -6347,7 +6974,7 @@ function ContextRowView(props) {
|
|
|
6347
6974
|
setProp(_el$3, "flexDirection", "column");
|
|
6348
6975
|
insert(_el$3, createComponent(For, {
|
|
6349
6976
|
get each() {
|
|
6350
|
-
return sidebarMoneyLines("
|
|
6977
|
+
return sidebarMoneyLines("spent in session", props.row.value);
|
|
6351
6978
|
},
|
|
6352
6979
|
children: (line) => (() => {
|
|
6353
6980
|
var _el$4 = createElement("text");
|
|
@@ -6517,7 +7144,7 @@ function Sidebar(props) {
|
|
|
6517
7144
|
get children() {
|
|
6518
7145
|
var _el$13 = createElement("text");
|
|
6519
7146
|
setProp(_el$13, "attributes", 1);
|
|
6520
|
-
insert(_el$13, `Pantheon v2.0.
|
|
7147
|
+
insert(_el$13, `Pantheon v2.0.1`);
|
|
6521
7148
|
effect((_$p) => setProp(_el$13, "fg", text(), _$p));
|
|
6522
7149
|
return _el$13;
|
|
6523
7150
|
}
|
|
@@ -6559,7 +7186,7 @@ function Sidebar(props) {
|
|
|
6559
7186
|
},
|
|
6560
7187
|
children: (current) => (() => {
|
|
6561
7188
|
var _el$27 = createElement("text");
|
|
6562
|
-
insert(_el$27, () => `
|
|
7189
|
+
insert(_el$27, () => `Session: ${truncateLabel(current().title || current().id)}`);
|
|
6563
7190
|
effect((_$p) => setProp(_el$27, "fg", text(), _$p));
|
|
6564
7191
|
return _el$27;
|
|
6565
7192
|
})()
|
|
@@ -6665,12 +7292,12 @@ function Sidebar(props) {
|
|
|
6665
7292
|
get children() {
|
|
6666
7293
|
return [(() => {
|
|
6667
7294
|
var _el$29 = createElement("text");
|
|
6668
|
-
insertNode(_el$29, createTextNode(`
|
|
7295
|
+
insertNode(_el$29, createTextNode(`Session · reported cost`));
|
|
6669
7296
|
effect((_$p) => setProp(_el$29, "fg", muted(), _$p));
|
|
6670
7297
|
return _el$29;
|
|
6671
7298
|
})(), (() => {
|
|
6672
7299
|
var _el$31 = createElement("text");
|
|
6673
|
-
insertNode(_el$31, createTextNode(`
|
|
7300
|
+
insertNode(_el$31, createTextNode(`Model Tokens USD`));
|
|
6674
7301
|
effect((_$p) => setProp(_el$31, "fg", muted(), _$p));
|
|
6675
7302
|
return _el$31;
|
|
6676
7303
|
})()];
|
|
@@ -7112,7 +7739,7 @@ function DispatchPanel(props) {
|
|
|
7112
7739
|
});
|
|
7113
7740
|
const empty = () => (() => {
|
|
7114
7741
|
var _el$58 = createElement("text");
|
|
7115
|
-
insertNode(_el$58, createTextNode(`
|
|
7742
|
+
insertNode(_el$58, createTextNode(`No delegated sessions`));
|
|
7116
7743
|
effect((_$p) => setProp(_el$58, "fg", muted(), _$p));
|
|
7117
7744
|
return _el$58;
|
|
7118
7745
|
})();
|
|
@@ -7289,7 +7916,7 @@ function HomeStatus(props) {
|
|
|
7289
7916
|
},
|
|
7290
7917
|
get children() {
|
|
7291
7918
|
var _el$73 = createElement("text");
|
|
7292
|
-
insert(_el$73, () => `Pantheon v2.0.
|
|
7919
|
+
insert(_el$73, () => `Pantheon v2.0.1${preset().name ? ` ▸ ${preset().name}` : ""}`);
|
|
7293
7920
|
effect((_$p) => setProp(_el$73, "fg", muted(), _$p));
|
|
7294
7921
|
return _el$73;
|
|
7295
7922
|
}
|
|
@@ -7408,6 +8035,13 @@ const plugin = Plugin.define({
|
|
|
7408
8035
|
try {
|
|
7409
8036
|
setupPantheonSettings(context);
|
|
7410
8037
|
} catch {}
|
|
8038
|
+
const unregisterSettingsSlot = context.ui.slot({
|
|
8039
|
+
append: "session.composer.top",
|
|
8040
|
+
render: ({ sessionID }) => createComponent(PantheonSettingsSlot, {
|
|
8041
|
+
context,
|
|
8042
|
+
sessionID
|
|
8043
|
+
})
|
|
8044
|
+
});
|
|
7411
8045
|
maybeShowWhatsNewV2(context);
|
|
7412
8046
|
return () => {
|
|
7413
8047
|
clearTimeout(updateNoticeTimer);
|
|
@@ -7415,6 +8049,7 @@ const plugin = Plugin.define({
|
|
|
7415
8049
|
if (typeof unregisterHome === "function") unregisterHome();
|
|
7416
8050
|
if (typeof unregisterPromptFooter === "function") unregisterPromptFooter();
|
|
7417
8051
|
if (typeof unregisterPanel === "function") unregisterPanel();
|
|
8052
|
+
if (typeof unregisterSettingsSlot === "function") unregisterSettingsSlot();
|
|
7418
8053
|
if (typeof unregisterCommands === "function") unregisterCommands();
|
|
7419
8054
|
if (typeof unregisterSettingsCommands === "function") unregisterSettingsCommands();
|
|
7420
8055
|
delete globalState[SINGLETON];
|