pantheon-opencode 2.0.0-beta.4 → 2.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -68
- package/README.md +18 -5
- package/bin/pantheon-init.mjs +1 -2
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/pyproject.toml +1 -1
- package/scripts/changelog-format.mjs +345 -0
- package/scripts/changelog-merge.mjs +5 -10
- package/scripts/docs-check-changelog.mjs +36 -137
- package/scripts/install/interactive.mjs +5 -254
- package/scripts/install/opencode.mjs +19 -76
- package/scripts/release-gates.mjs +33 -13
- package/scripts/release-notes.mjs +51 -36
- package/scripts/release-retrofit.mjs +158 -0
- package/scripts/skill-search.mjs +39 -4
- package/scripts/versioning.mjs +1 -1
- package/skills-lock.json +1 -1
- package/src/pantheon/goal-loop-config.ts +55 -0
- package/src/pantheon/native-vision.ts +9 -5
- package/src/pantheon/vision.ts +14 -1
- package/src/plugin.ts +39 -7
- package/src/plugins/tui/dist/tui.d.ts +3 -2
- package/src/plugins/tui/dist/tui.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui.js +961 -312
- 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 +149 -0
- package/src/plugins/tui/src/decision-router-state.ts +128 -6
- package/src/plugins/tui/src/index.tsx +86 -29
- package/src/plugins/tui/src/pantheon-settings.tsx +296 -24
- package/src/plugins/tui/src/tui-prefs.ts +378 -0
- package/src/skills/prompt-refinery/SKILL.md +34 -4
|
@@ -60,6 +60,117 @@ const MODEL_USAGE_VISIBLE_CEILING = 3;
|
|
|
60
60
|
const MODEL_USAGE_MESSAGE_LIMIT = 400;
|
|
61
61
|
const MODEL_USAGE_SESSION_LIMIT = 8;
|
|
62
62
|
//#endregion
|
|
63
|
+
//#region src/autonomy-state.ts
|
|
64
|
+
const DEFAULT_GOAL_LOOP_PREFS = {
|
|
65
|
+
enabled: false,
|
|
66
|
+
cooldownMs: 5e3,
|
|
67
|
+
maxContinuations: 25
|
|
68
|
+
};
|
|
69
|
+
const GOAL_LOOP_ENABLED_CYCLE = Object.freeze(["enabled", "disabled"]);
|
|
70
|
+
const DEFAULT_DECISION_BUDGETS = {
|
|
71
|
+
monthlyUsd: 5,
|
|
72
|
+
perDecisionUsd: .1
|
|
73
|
+
};
|
|
74
|
+
/** Format USD compactly for a cycler cell ("$5", "$0.10"). */
|
|
75
|
+
function formatUsd(value) {
|
|
76
|
+
return `$${value < 1 ? value.toFixed(2) : String(Math.round(value))}`;
|
|
77
|
+
}
|
|
78
|
+
/** Build the USD step ladder used by the budget cyclers. */
|
|
79
|
+
const MONTHLY_USD_CYCLE = Object.freeze([
|
|
80
|
+
1,
|
|
81
|
+
2,
|
|
82
|
+
5,
|
|
83
|
+
10,
|
|
84
|
+
20,
|
|
85
|
+
50,
|
|
86
|
+
100
|
|
87
|
+
].map((value) => formatUsd(value)));
|
|
88
|
+
const PER_DECISION_USD_CYCLE = Object.freeze([
|
|
89
|
+
.01,
|
|
90
|
+
.025,
|
|
91
|
+
.05,
|
|
92
|
+
.1,
|
|
93
|
+
.25,
|
|
94
|
+
.5,
|
|
95
|
+
1
|
|
96
|
+
].map((value) => formatUsd(value)));
|
|
97
|
+
/** Parse a staged USD cell back to a number; junk keeps the input. */
|
|
98
|
+
function parseUsd(cell) {
|
|
99
|
+
const value = Number(cell.replace("$", ""));
|
|
100
|
+
return Number.isFinite(value) && value > 0 ? value : null;
|
|
101
|
+
}
|
|
102
|
+
function buildAutonomyTab(input) {
|
|
103
|
+
return {
|
|
104
|
+
id: "autonomy",
|
|
105
|
+
title: "Autonomy",
|
|
106
|
+
groups: [
|
|
107
|
+
{
|
|
108
|
+
title: "Goal loop (persisted mission, long sessions)",
|
|
109
|
+
rows: [
|
|
110
|
+
{
|
|
111
|
+
id: "autonomy.goal_loop.enabled",
|
|
112
|
+
name: "Goal loop",
|
|
113
|
+
value: input.goalLoop.enabled ? "enabled" : "disabled",
|
|
114
|
+
cycle: GOAL_LOOP_ENABLED_CYCLE,
|
|
115
|
+
note: "mission persists in .pantheon/goals; auto-continues with cooldown" + (input.goalLoopRestartPending ? " · ⚠ saved value applies after OpenCode restart" : " · applies after OpenCode restart")
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: "autonomy.goal_loop.maxContinuations",
|
|
119
|
+
name: "Max continuations",
|
|
120
|
+
value: String(input.goalLoop.maxContinuations),
|
|
121
|
+
note: "1..200 — the anti-runaway cap per mission"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
id: "autonomy.goal_loop.cooldownMs",
|
|
125
|
+
name: "Cooldown (ms)",
|
|
126
|
+
value: String(input.goalLoop.cooldownMs),
|
|
127
|
+
note: "min 1000ms · between continuations"
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
title: "Decision budgets (applies live)",
|
|
133
|
+
rows: [{
|
|
134
|
+
id: "autonomy.budget.monthly",
|
|
135
|
+
name: "Monthly cap",
|
|
136
|
+
value: formatUsd(input.budgets.monthlyUsd),
|
|
137
|
+
cycle: MONTHLY_USD_CYCLE,
|
|
138
|
+
note: "the ledger refuses gated calls past this"
|
|
139
|
+
}, {
|
|
140
|
+
id: "autonomy.budget.perDecision",
|
|
141
|
+
name: "Per-decision cap",
|
|
142
|
+
value: formatUsd(input.budgets.perDecisionUsd),
|
|
143
|
+
cycle: PER_DECISION_USD_CYCLE,
|
|
144
|
+
note: "each gated call above this is refused"
|
|
145
|
+
}]
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
title: "Decision gradient (documented — J1 owns the risk axis)",
|
|
149
|
+
rows: [
|
|
150
|
+
{
|
|
151
|
+
id: "autonomy.gradient.solo",
|
|
152
|
+
name: "Decide solo",
|
|
153
|
+
value: "reversible + low risk",
|
|
154
|
+
note: "edits, routine fixes, ordering ties — no gate"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
id: "autonomy.gradient.jev",
|
|
158
|
+
name: "Jev decides",
|
|
159
|
+
value: "typed ambiguity",
|
|
160
|
+
note: "readings, ranking, verification — budget-capped"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
id: "autonomy.gradient.human",
|
|
164
|
+
name: "Human decides",
|
|
165
|
+
value: "high risk (J1)",
|
|
166
|
+
note: "enforce ladder via PANTHEON_J1_* (J1 tab)"
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
//#endregion
|
|
63
174
|
//#region src/decision-router-state.ts
|
|
64
175
|
/**
|
|
65
176
|
* decision-router-state.ts — the Decision Model section of the settings window.
|
|
@@ -93,7 +204,8 @@ const DEFAULT_DECISION_CONFIG = Object.freeze({
|
|
|
93
204
|
egress_consent: false,
|
|
94
205
|
enabled_candidates: Object.freeze([])
|
|
95
206
|
});
|
|
96
|
-
|
|
207
|
+
/** The runtime's provider→model matrix (drift-pinned against the installer source). */
|
|
208
|
+
const DECISION_KNOWN_PROVIDERS = Object.freeze([
|
|
97
209
|
"openai-decisions",
|
|
98
210
|
"typesafe-jev",
|
|
99
211
|
"opencode-console-jev",
|
|
@@ -101,6 +213,42 @@ Object.freeze([
|
|
|
101
213
|
"vercel-gateway-jev",
|
|
102
214
|
"cloudflare-workers-jev"
|
|
103
215
|
]);
|
|
216
|
+
const DECISION_CONSENT_CYCLE = Object.freeze(["not granted", "granted"]);
|
|
217
|
+
/** provider → model, straight from the runtime matrix (drift-pinned in tests). */
|
|
218
|
+
const DECISION_KNOWN_MODELS = Object.freeze({
|
|
219
|
+
"openai-decisions": "gpt-6-luna",
|
|
220
|
+
"typesafe-jev": "jev-1.14.0",
|
|
221
|
+
"opencode-console-jev": "jev-1.13",
|
|
222
|
+
"openrouter-jev": "typesafe/jev-1.13",
|
|
223
|
+
"vercel-gateway-jev": "typesafe-ai/jev",
|
|
224
|
+
"cloudflare-workers-jev": "clef"
|
|
225
|
+
});
|
|
226
|
+
/**
|
|
227
|
+
* Credential surface per provider: the ENV VAR the host provider entry reads
|
|
228
|
+
* (`{env:VAR}` indirection — the window NEVER holds key values) plus the setup
|
|
229
|
+
* note. Drift-pinned against the installer/runtime sources in tests.
|
|
230
|
+
*/
|
|
231
|
+
const DECISION_PROVIDER_CREDENTIALS = Object.freeze({
|
|
232
|
+
"openai-decisions": { note: "host-configured model — provision via `decision-router setup-model openai-decisions`" },
|
|
233
|
+
"typesafe-jev": {
|
|
234
|
+
env: "TYPESAFE_API_KEY",
|
|
235
|
+
note: "export TYPESAFE_API_KEY=… then restart"
|
|
236
|
+
},
|
|
237
|
+
"opencode-console-jev": { note: "rides your OpenCode login — no separate key" },
|
|
238
|
+
"openrouter-jev": {
|
|
239
|
+
env: "OPENROUTER_API_KEY",
|
|
240
|
+
note: "export OPENROUTER_API_KEY=… then restart"
|
|
241
|
+
},
|
|
242
|
+
"vercel-gateway-jev": {
|
|
243
|
+
env: "AI_GATEWAY_API_KEY",
|
|
244
|
+
note: "export AI_GATEWAY_API_KEY=… then restart"
|
|
245
|
+
},
|
|
246
|
+
"cloudflare-workers-jev": {
|
|
247
|
+
env: "CLOUDFLARE_API_TOKEN",
|
|
248
|
+
note: "needs accountId (setup-model --account-id=…) + CLOUDFLARE_API_TOKEN"
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
const DECISION_TARGET_CYCLE = Object.freeze(DECISION_KNOWN_PROVIDERS.map((provider) => `${provider}/${DECISION_KNOWN_MODELS[provider]}`));
|
|
104
252
|
function decisionRouterConfigPath(env = process.env) {
|
|
105
253
|
const xdg = env.XDG_CONFIG_HOME;
|
|
106
254
|
const home = env.HOME ?? "";
|
|
@@ -198,7 +346,7 @@ function setDecisionEnabled(config, enabled) {
|
|
|
198
346
|
if (enabled) {
|
|
199
347
|
if (!(config.selection.mode === "local" || config.enabled_candidates.length === 0) && !config.egress_consent) return {
|
|
200
348
|
ok: false,
|
|
201
|
-
reason: "remote candidates need egress consent —
|
|
349
|
+
reason: "remote candidates need egress consent — toggle Egress consent in this tab, then enable"
|
|
202
350
|
};
|
|
203
351
|
}
|
|
204
352
|
return {
|
|
@@ -222,7 +370,51 @@ function writeDecisionRouterConfig(config, env = process.env) {
|
|
|
222
370
|
renameSync(temp, path);
|
|
223
371
|
chmodSync(path, 384);
|
|
224
372
|
}
|
|
225
|
-
|
|
373
|
+
const DECISION_SELECTION_CYCLE = Object.freeze([
|
|
374
|
+
"local",
|
|
375
|
+
"auto",
|
|
376
|
+
"explicit"
|
|
377
|
+
]);
|
|
378
|
+
/** Stage a selection/consent row into a config copy; unknown rows are no-ops. */
|
|
379
|
+
function applyDecisionRow(config, id, value) {
|
|
380
|
+
const next = {
|
|
381
|
+
...config,
|
|
382
|
+
selection: { ...config.selection },
|
|
383
|
+
enabled_candidates: [...config.enabled_candidates]
|
|
384
|
+
};
|
|
385
|
+
switch (id) {
|
|
386
|
+
case "decision.selection.mode": {
|
|
387
|
+
const mode = value;
|
|
388
|
+
if (mode !== "local" && mode !== "auto" && mode !== "explicit") return config;
|
|
389
|
+
next.selection.mode = mode;
|
|
390
|
+
if (mode === "local") next.enabled_candidates = [];
|
|
391
|
+
return next;
|
|
392
|
+
}
|
|
393
|
+
case "decision.selection.target": {
|
|
394
|
+
const separator = value.indexOf("/");
|
|
395
|
+
if (separator <= 0) return config;
|
|
396
|
+
const provider = value.slice(0, separator);
|
|
397
|
+
const model = value.slice(separator + 1);
|
|
398
|
+
if (!DECISION_KNOWN_PROVIDERS.includes(provider)) return config;
|
|
399
|
+
if (DECISION_KNOWN_MODELS[provider] !== model) return config;
|
|
400
|
+
next.selection = {
|
|
401
|
+
mode: "explicit",
|
|
402
|
+
provider,
|
|
403
|
+
model
|
|
404
|
+
};
|
|
405
|
+
next.enabled_candidates = [{
|
|
406
|
+
provider,
|
|
407
|
+
model
|
|
408
|
+
}];
|
|
409
|
+
return next;
|
|
410
|
+
}
|
|
411
|
+
case "decision.consent":
|
|
412
|
+
next.egress_consent = value === "granted";
|
|
413
|
+
return next;
|
|
414
|
+
default: return config;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
function buildDecisionTab(read, env = process.env) {
|
|
226
418
|
const { config, corrupt } = read;
|
|
227
419
|
const rows = [{
|
|
228
420
|
id: "decision.enabled",
|
|
@@ -231,23 +423,50 @@ function buildDecisionTab(read) {
|
|
|
231
423
|
...corrupt ? {} : { cycle: DECISION_ENABLED_CYCLE },
|
|
232
424
|
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"
|
|
233
425
|
}, {
|
|
234
|
-
id: "decision.selection",
|
|
235
|
-
name: "Selection",
|
|
236
|
-
value:
|
|
426
|
+
id: "decision.selection.mode",
|
|
427
|
+
name: "Selection mode",
|
|
428
|
+
value: config.selection.mode,
|
|
429
|
+
...corrupt ? {} : { cycle: DECISION_SELECTION_CYCLE },
|
|
237
430
|
note: "local routes on-device; auto/explicit pick a remote decision model"
|
|
238
431
|
}];
|
|
432
|
+
if (config.selection.mode === "explicit" || config.selection.provider !== void 0) rows.push({
|
|
433
|
+
id: "decision.selection.target",
|
|
434
|
+
name: "Explicit target",
|
|
435
|
+
value: config.selection.provider ? `${config.selection.provider}/${config.selection.model ?? ""}` : "none",
|
|
436
|
+
...corrupt || config.selection.mode !== "explicit" ? {} : { cycle: DECISION_TARGET_CYCLE },
|
|
437
|
+
note: "provider/model — sets the candidate list"
|
|
438
|
+
});
|
|
239
439
|
if (config.enabled_candidates.length > 0) rows.push({
|
|
240
440
|
id: "decision.candidates",
|
|
241
441
|
name: "Candidates",
|
|
242
442
|
value: String(config.enabled_candidates.length),
|
|
243
443
|
note: config.egress_consent ? config.enabled_candidates.map((candidate) => `${candidate.provider}/${candidate.model}`).join(", ") : "egress consent NOT granted — remote routes fail closed"
|
|
244
444
|
});
|
|
445
|
+
rows.push({
|
|
446
|
+
id: "decision.consent",
|
|
447
|
+
name: "Egress consent",
|
|
448
|
+
value: config.egress_consent ? "granted" : "not granted",
|
|
449
|
+
...corrupt ? {} : { cycle: DECISION_CONSENT_CYCLE },
|
|
450
|
+
note: "granted = remote decision routes may call their gateway (budget-capped)"
|
|
451
|
+
});
|
|
245
452
|
return {
|
|
246
453
|
id: "decision",
|
|
247
454
|
title: "Decision",
|
|
248
455
|
groups: [{
|
|
249
456
|
title: "Decision router",
|
|
250
457
|
rows
|
|
458
|
+
}, {
|
|
459
|
+
title: "Credentials (status only — values never enter the window)",
|
|
460
|
+
rows: DECISION_KNOWN_PROVIDERS.map((provider) => {
|
|
461
|
+
const credential = DECISION_PROVIDER_CREDENTIALS[provider] ?? { note: "" };
|
|
462
|
+
const isSet = credential.env === void 0 ? true : Boolean(env[credential.env]);
|
|
463
|
+
return {
|
|
464
|
+
id: `decision.key.${provider}`,
|
|
465
|
+
name: provider,
|
|
466
|
+
value: credential.env === void 0 ? "n/a" : isSet ? "set" : "MISSING",
|
|
467
|
+
note: credential.note
|
|
468
|
+
};
|
|
469
|
+
})
|
|
251
470
|
}]
|
|
252
471
|
};
|
|
253
472
|
}
|
|
@@ -819,6 +1038,175 @@ function buildPresetTab(input) {
|
|
|
819
1038
|
};
|
|
820
1039
|
}
|
|
821
1040
|
//#endregion
|
|
1041
|
+
//#region src/tui-prefs.ts
|
|
1042
|
+
const PREFS_SYMBOL = Symbol.for("pantheon.tui.prefs.v1");
|
|
1043
|
+
function stash() {
|
|
1044
|
+
return globalThis[PREFS_SYMBOL];
|
|
1045
|
+
}
|
|
1046
|
+
/** Create (or reuse) the durable prefs store. Fail-open: without host
|
|
1047
|
+
* storage the consumers fall back to DEFAULT_TUI_PREFS (read-only). */
|
|
1048
|
+
function initTuiPrefs(context) {
|
|
1049
|
+
if (stash() !== void 0) return;
|
|
1050
|
+
try {
|
|
1051
|
+
const handle = context.storage?.store?.("tui-prefs", { initial: DEFAULT_TUI_PREFS });
|
|
1052
|
+
if (handle !== void 0) globalThis[PREFS_SYMBOL] = handle;
|
|
1053
|
+
} catch {}
|
|
1054
|
+
}
|
|
1055
|
+
/** The live reactive prefs (read properties inside memos/JSX — tracked). */
|
|
1056
|
+
function tuiPrefs() {
|
|
1057
|
+
return stash()?.[0] ?? DEFAULT_TUI_PREFS;
|
|
1058
|
+
}
|
|
1059
|
+
/** Stage a mutation against the durable store; resolves when persisted. */
|
|
1060
|
+
function mutateTuiPrefs(mutation) {
|
|
1061
|
+
const handle = stash();
|
|
1062
|
+
if (handle === void 0) return Promise.resolve();
|
|
1063
|
+
return handle[1](mutation);
|
|
1064
|
+
}
|
|
1065
|
+
const GAUGE_STYLES = Object.freeze([
|
|
1066
|
+
"both",
|
|
1067
|
+
"bar",
|
|
1068
|
+
"percent",
|
|
1069
|
+
"off"
|
|
1070
|
+
]);
|
|
1071
|
+
const ENABLED_CYCLE = Object.freeze(["enabled", "disabled"]);
|
|
1072
|
+
const DEFAULT_TUI_PREFS = {
|
|
1073
|
+
version: 1,
|
|
1074
|
+
sidebar: {
|
|
1075
|
+
header: {
|
|
1076
|
+
version: true,
|
|
1077
|
+
preset: true,
|
|
1078
|
+
session: true
|
|
1079
|
+
},
|
|
1080
|
+
blocks: {
|
|
1081
|
+
context: true,
|
|
1082
|
+
git: true,
|
|
1083
|
+
todo: true,
|
|
1084
|
+
dispatch: true
|
|
1085
|
+
},
|
|
1086
|
+
context: {
|
|
1087
|
+
gauge: "both",
|
|
1088
|
+
tokens: true,
|
|
1089
|
+
spent: true,
|
|
1090
|
+
modelUsage: true,
|
|
1091
|
+
performance: true,
|
|
1092
|
+
localSpend: true
|
|
1093
|
+
}
|
|
1094
|
+
},
|
|
1095
|
+
footer: {
|
|
1096
|
+
prompt: true,
|
|
1097
|
+
home: true
|
|
1098
|
+
}
|
|
1099
|
+
};
|
|
1100
|
+
const onOff = ENABLED_CYCLE;
|
|
1101
|
+
const row = (id, name, value, note) => ({
|
|
1102
|
+
id,
|
|
1103
|
+
name,
|
|
1104
|
+
value: value ? "enabled" : "disabled",
|
|
1105
|
+
cycle: onOff,
|
|
1106
|
+
note
|
|
1107
|
+
});
|
|
1108
|
+
function buildTuiTab(prefs) {
|
|
1109
|
+
return {
|
|
1110
|
+
id: "tui",
|
|
1111
|
+
title: "TUI",
|
|
1112
|
+
groups: [
|
|
1113
|
+
{
|
|
1114
|
+
title: "Sidebar header",
|
|
1115
|
+
rows: [
|
|
1116
|
+
row("tui.sidebar.header.version", "Version line", prefs.sidebar.header.version, "the `Pantheon v…` line"),
|
|
1117
|
+
row("tui.sidebar.header.preset", "Preset line", prefs.sidebar.header.preset, "the `▸ preset · provider` line"),
|
|
1118
|
+
row("tui.sidebar.header.session", "Session line", prefs.sidebar.header.session, "the active session title")
|
|
1119
|
+
]
|
|
1120
|
+
},
|
|
1121
|
+
{
|
|
1122
|
+
title: "Sidebar blocks",
|
|
1123
|
+
rows: [
|
|
1124
|
+
row("tui.sidebar.block.context", "Context block", prefs.sidebar.blocks.context, "tokens, gauge, spend, model usage"),
|
|
1125
|
+
row("tui.sidebar.block.git", "Git block", prefs.sidebar.blocks.git, "branch + working-tree counts"),
|
|
1126
|
+
row("tui.sidebar.block.todo", "Todo block", prefs.sidebar.blocks.todo, "the newest todowrite"),
|
|
1127
|
+
row("tui.sidebar.block.dispatch", "Dispatch block", prefs.sidebar.blocks.dispatch, "live delegations + rollup")
|
|
1128
|
+
]
|
|
1129
|
+
},
|
|
1130
|
+
{
|
|
1131
|
+
title: "Context block detail",
|
|
1132
|
+
rows: [
|
|
1133
|
+
{
|
|
1134
|
+
id: "tui.sidebar.context.gauge",
|
|
1135
|
+
name: "Gauge style",
|
|
1136
|
+
value: prefs.sidebar.context.gauge,
|
|
1137
|
+
cycle: GAUGE_STYLES,
|
|
1138
|
+
note: "both | bar | percent | off — `▰▱ 42% of 200k`"
|
|
1139
|
+
},
|
|
1140
|
+
row("tui.sidebar.context.tokens", "Tokens row", prefs.sidebar.context.tokens, "the raw token count line"),
|
|
1141
|
+
row("tui.sidebar.context.spent", "Spent row", prefs.sidebar.context.spent, "the `$… gasto na sessão` line"),
|
|
1142
|
+
row("tui.sidebar.context.modelUsage", "Model usage table", prefs.sidebar.context.modelUsage, "per-model tokens/USD"),
|
|
1143
|
+
row("tui.sidebar.context.performance", "Performance line", prefs.sidebar.context.performance, "cache % + tok/s"),
|
|
1144
|
+
row("tui.sidebar.context.localSpend", "Local spend", prefs.sidebar.context.localSpend, "hoje / 30d totals")
|
|
1145
|
+
]
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
title: "Footers",
|
|
1149
|
+
rows: [row("tui.footer.prompt", "Prompt footer", prefs.footer.prompt, "the `▸preset · ✦n ativos` line while delegations run"), row("tui.footer.home", "Home status", prefs.footer.home, "the `Pantheon v…` line under the home prompt")]
|
|
1150
|
+
}
|
|
1151
|
+
]
|
|
1152
|
+
};
|
|
1153
|
+
}
|
|
1154
|
+
/**
|
|
1155
|
+
* Apply one staged row INTO a prefs draft (in place — the storage mutate
|
|
1156
|
+
* callback hands an immer-style draft). Unknown ids or junk values are no-ops.
|
|
1157
|
+
*/
|
|
1158
|
+
function applyTuiRow(draft, id, value) {
|
|
1159
|
+
const enabled = value === "enabled";
|
|
1160
|
+
switch (id) {
|
|
1161
|
+
case "tui.sidebar.header.version":
|
|
1162
|
+
draft.sidebar.header.version = enabled;
|
|
1163
|
+
return;
|
|
1164
|
+
case "tui.sidebar.header.preset":
|
|
1165
|
+
draft.sidebar.header.preset = enabled;
|
|
1166
|
+
return;
|
|
1167
|
+
case "tui.sidebar.header.session":
|
|
1168
|
+
draft.sidebar.header.session = enabled;
|
|
1169
|
+
return;
|
|
1170
|
+
case "tui.sidebar.block.context":
|
|
1171
|
+
draft.sidebar.blocks.context = enabled;
|
|
1172
|
+
return;
|
|
1173
|
+
case "tui.sidebar.block.git":
|
|
1174
|
+
draft.sidebar.blocks.git = enabled;
|
|
1175
|
+
return;
|
|
1176
|
+
case "tui.sidebar.block.todo":
|
|
1177
|
+
draft.sidebar.blocks.todo = enabled;
|
|
1178
|
+
return;
|
|
1179
|
+
case "tui.sidebar.block.dispatch":
|
|
1180
|
+
draft.sidebar.blocks.dispatch = enabled;
|
|
1181
|
+
return;
|
|
1182
|
+
case "tui.sidebar.context.gauge":
|
|
1183
|
+
if (GAUGE_STYLES.includes(value)) draft.sidebar.context.gauge = value;
|
|
1184
|
+
return;
|
|
1185
|
+
case "tui.sidebar.context.tokens":
|
|
1186
|
+
draft.sidebar.context.tokens = enabled;
|
|
1187
|
+
return;
|
|
1188
|
+
case "tui.sidebar.context.spent":
|
|
1189
|
+
draft.sidebar.context.spent = enabled;
|
|
1190
|
+
return;
|
|
1191
|
+
case "tui.sidebar.context.modelUsage":
|
|
1192
|
+
draft.sidebar.context.modelUsage = enabled;
|
|
1193
|
+
return;
|
|
1194
|
+
case "tui.sidebar.context.performance":
|
|
1195
|
+
draft.sidebar.context.performance = enabled;
|
|
1196
|
+
return;
|
|
1197
|
+
case "tui.sidebar.context.localSpend":
|
|
1198
|
+
draft.sidebar.context.localSpend = enabled;
|
|
1199
|
+
return;
|
|
1200
|
+
case "tui.footer.prompt":
|
|
1201
|
+
draft.footer.prompt = enabled;
|
|
1202
|
+
return;
|
|
1203
|
+
case "tui.footer.home":
|
|
1204
|
+
draft.footer.home = enabled;
|
|
1205
|
+
return;
|
|
1206
|
+
default: return;
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
//#endregion
|
|
822
1210
|
//#region src/update-status.ts
|
|
823
1211
|
/** The running version's channel: a `-beta.N` suffix rides the beta dist-tag. */
|
|
824
1212
|
function updateChannelFor(version) {
|
|
@@ -898,7 +1286,28 @@ function buildUpdatesTab(input) {
|
|
|
898
1286
|
* report beta.2: navigation "stopped working" was exactly that theft).
|
|
899
1287
|
*/
|
|
900
1288
|
const ROUTE_NAME = "pantheon-settings";
|
|
1289
|
+
/** The input mode the page pushes while mounted (composer layers sleep). */
|
|
1290
|
+
const ROUTE_MODE = "pantheon-settings";
|
|
901
1291
|
/** Loose local shape of a host route (the real Route lives in the host typings). */
|
|
1292
|
+
/**
|
|
1293
|
+
* Strip a LIVE route object down to the plain shape the route store expects.
|
|
1294
|
+
* `router.current()` returns the host's live data (reactive proxies, location
|
|
1295
|
+
* objects with cycles) and the host's navigate deep-clones via JSON.stringify
|
|
1296
|
+
* — passing the live object through throws "cyclic structures" and the
|
|
1297
|
+
* window could never close (field report beta.5, root cause).
|
|
1298
|
+
*/
|
|
1299
|
+
function plainRoute(route) {
|
|
1300
|
+
if (route === void 0) return { type: "home" };
|
|
1301
|
+
if (route.type === "session" && "sessionID" in route && typeof route.sessionID === "string") return {
|
|
1302
|
+
type: "session",
|
|
1303
|
+
sessionID: route.sessionID
|
|
1304
|
+
};
|
|
1305
|
+
if (route.type === "plugin" && typeof route.name === "string") return {
|
|
1306
|
+
type: "plugin",
|
|
1307
|
+
name: route.name
|
|
1308
|
+
};
|
|
1309
|
+
return { type: "home" };
|
|
1310
|
+
}
|
|
902
1311
|
const [blocking, setBlocking] = createSignal(false);
|
|
903
1312
|
/** True while a Pantheon settings surface (page or fallback dialog) is open. */
|
|
904
1313
|
function pantheonSettingsBlocking() {
|
|
@@ -942,6 +1351,68 @@ function readOverridesLoad() {
|
|
|
942
1351
|
function writeOverridesToDisk(load) {
|
|
943
1352
|
writeFileSync(globalOverridesPath(), serializeOverrides(load.global), "utf8");
|
|
944
1353
|
}
|
|
1354
|
+
function userOpenCodeConfigPath() {
|
|
1355
|
+
const xdgConfig = process.env.XDG_CONFIG_HOME ?? join(process.env.HOME ?? "", ".config");
|
|
1356
|
+
return join(xdgConfig, "opencode", "opencode.json");
|
|
1357
|
+
}
|
|
1358
|
+
/** Read options.goal_loop from the user's opencode.json (fail-open). */
|
|
1359
|
+
function readGoalLoopPrefs() {
|
|
1360
|
+
const fallback = { ...DEFAULT_GOAL_LOOP_PREFS };
|
|
1361
|
+
try {
|
|
1362
|
+
const raw = JSON.parse(readFileSync(userOpenCodeConfigPath(), "utf8"))?.options?.goal_loop;
|
|
1363
|
+
if (raw && typeof raw === "object") return {
|
|
1364
|
+
enabled: typeof raw.enabled === "boolean" ? raw.enabled : fallback.enabled,
|
|
1365
|
+
cooldownMs: typeof raw.cooldownMs === "number" && raw.cooldownMs >= 1e3 ? Math.floor(raw.cooldownMs) : fallback.cooldownMs,
|
|
1366
|
+
maxContinuations: typeof raw.maxContinuations === "number" && raw.maxContinuations >= 1 ? Math.min(200, Math.floor(raw.maxContinuations)) : fallback.maxContinuations
|
|
1367
|
+
};
|
|
1368
|
+
} catch {}
|
|
1369
|
+
return fallback;
|
|
1370
|
+
}
|
|
1371
|
+
/** Read the decision budgets from decision-router.json's `budget` envelope (fail-open). */
|
|
1372
|
+
function readDecisionBudgets() {
|
|
1373
|
+
const fallback = { ...DEFAULT_DECISION_BUDGETS };
|
|
1374
|
+
try {
|
|
1375
|
+
const path = join(process.env.XDG_CONFIG_HOME ?? join(process.env.HOME ?? "", ".config"), "pantheon", "decision-router.json");
|
|
1376
|
+
const raw = JSON.parse(readFileSync(path, "utf8"))?.budget;
|
|
1377
|
+
if (raw && typeof raw === "object") return {
|
|
1378
|
+
monthlyUsd: typeof raw.monthlyUsd === "number" && raw.monthlyUsd > 0 ? raw.monthlyUsd : fallback.monthlyUsd,
|
|
1379
|
+
perDecisionUsd: typeof raw.perDecisionUsd === "number" && raw.perDecisionUsd > 0 ? raw.perDecisionUsd : fallback.perDecisionUsd
|
|
1380
|
+
};
|
|
1381
|
+
} catch {}
|
|
1382
|
+
return fallback;
|
|
1383
|
+
}
|
|
1384
|
+
/**
|
|
1385
|
+
* Surgically set one key under `options` in the user's opencode.json
|
|
1386
|
+
* (preserving every other key). Startup-applied options live here — the
|
|
1387
|
+
* runtime resolves them once at plugin setup.
|
|
1388
|
+
*/
|
|
1389
|
+
function writeUserOption(key, value) {
|
|
1390
|
+
const path = userOpenCodeConfigPath();
|
|
1391
|
+
let doc = {};
|
|
1392
|
+
try {
|
|
1393
|
+
const parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
1394
|
+
if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) doc = parsed;
|
|
1395
|
+
} catch {}
|
|
1396
|
+
const options = typeof doc.options === "object" && doc.options !== null && !Array.isArray(doc.options) ? { ...doc.options } : {};
|
|
1397
|
+
options[key] = value;
|
|
1398
|
+
doc.options = options;
|
|
1399
|
+
writeFileSync(path, `${JSON.stringify(doc, null, 2)}\n`);
|
|
1400
|
+
}
|
|
1401
|
+
/** Merge the `budget` envelope into decision-router.json (0600 preserved). */
|
|
1402
|
+
function writeDecisionBudget(budgets) {
|
|
1403
|
+
const path = join(process.env.XDG_CONFIG_HOME ?? join(process.env.HOME ?? "", ".config"), "pantheon", "decision-router.json");
|
|
1404
|
+
let doc = {};
|
|
1405
|
+
try {
|
|
1406
|
+
const parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
1407
|
+
if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) doc = parsed;
|
|
1408
|
+
} catch {
|
|
1409
|
+
throw new Error("decision-router.json unreadable — repair via `decision-router setup-model`");
|
|
1410
|
+
}
|
|
1411
|
+
doc.budget = { ...budgets };
|
|
1412
|
+
const temp = `${path}.tui.tmp`;
|
|
1413
|
+
writeFileSync(temp, `${JSON.stringify(doc, null, 2)}\n`, { mode: 384 });
|
|
1414
|
+
renameSync(temp, path);
|
|
1415
|
+
}
|
|
945
1416
|
function updateCheckStatePath() {
|
|
946
1417
|
const stateDir = process.env.XDG_STATE_HOME ?? join(process.env.HOME ?? "", ".local", "state");
|
|
947
1418
|
return join(stateDir, "pantheon", "update-check.json");
|
|
@@ -972,29 +1443,27 @@ function persistUpdateCheckState(previous, latest) {
|
|
|
972
1443
|
} catch {}
|
|
973
1444
|
}
|
|
974
1445
|
function resolveRunningVersion$1() {
|
|
975
|
-
|
|
976
|
-
return JSON.parse(readFileSync(new URL("../../package.json", import.meta.url), "utf8")).version ?? "unknown";
|
|
977
|
-
} catch {
|
|
978
|
-
return "unknown";
|
|
979
|
-
}
|
|
1446
|
+
return "2.0.0-beta.6";
|
|
980
1447
|
}
|
|
981
1448
|
const VALUE_WIDTH = 22;
|
|
982
1449
|
function SettingsWindow(props) {
|
|
983
1450
|
const tab = () => props.tabs()[props.page()] ?? props.tabs()[0] ?? EMPTY_TAB;
|
|
984
1451
|
const rows = () => tabRows(tab());
|
|
985
1452
|
return (() => {
|
|
986
|
-
var _el$ = createElement("box"), _el$2 = createElement("box"), _el$3 = createElement("text"), _el$4 = createElement("
|
|
1453
|
+
var _el$ = createElement("box"), _el$2 = createElement("box"), _el$3 = createElement("text"), _el$4 = createElement("box"), _el$5 = createElement("text"), _el$7 = createElement("text"), _el$0 = createElement("text"), _el$1 = createElement("text");
|
|
987
1454
|
insertNode(_el$, _el$2);
|
|
988
|
-
insertNode(_el$, _el$
|
|
989
|
-
insertNode(_el$, _el$9);
|
|
1455
|
+
insertNode(_el$, _el$7);
|
|
990
1456
|
insertNode(_el$, _el$0);
|
|
1457
|
+
insertNode(_el$, _el$1);
|
|
991
1458
|
setProp(_el$, "flexDirection", "column");
|
|
992
1459
|
setProp(_el$, "paddingLeft", 1);
|
|
993
1460
|
setProp(_el$, "paddingRight", 1);
|
|
994
1461
|
setProp(_el$, "paddingTop", 1);
|
|
995
1462
|
insertNode(_el$2, _el$3);
|
|
996
1463
|
insertNode(_el$2, _el$4);
|
|
1464
|
+
insertNode(_el$2, _el$5);
|
|
997
1465
|
setProp(_el$2, "flexDirection", "row");
|
|
1466
|
+
setProp(_el$3, "flexShrink", 0);
|
|
998
1467
|
setProp(_el$3, "attributes", 1);
|
|
999
1468
|
insert(_el$3, () => `Pantheon v${props.version}`);
|
|
1000
1469
|
insert(_el$2, createComponent(For, {
|
|
@@ -1002,37 +1471,40 @@ function SettingsWindow(props) {
|
|
|
1002
1471
|
return props.tabs();
|
|
1003
1472
|
},
|
|
1004
1473
|
children: (t, index) => (() => {
|
|
1005
|
-
var _el$
|
|
1006
|
-
|
|
1474
|
+
var _el$11 = createElement("text");
|
|
1475
|
+
setProp(_el$11, "flexShrink", 0);
|
|
1476
|
+
spread(_el$11, mergeProps({ get fg() {
|
|
1007
1477
|
return memo(() => index() === props.page())() ? props.fg : props.muted;
|
|
1008
1478
|
} }, () => index() === props.page() ? { attributes: 1 } : {}), true);
|
|
1009
|
-
insert(_el$
|
|
1010
|
-
return _el$
|
|
1479
|
+
insert(_el$11, () => ` ${t.title}${tabDirty(props.draft(), t) ? " ●" : ""}`);
|
|
1480
|
+
return _el$11;
|
|
1011
1481
|
})()
|
|
1012
1482
|
}), _el$4);
|
|
1013
|
-
|
|
1014
|
-
insertNode(_el$
|
|
1483
|
+
setProp(_el$4, "flexGrow", 1);
|
|
1484
|
+
insertNode(_el$5, createTextNode(`esc`));
|
|
1485
|
+
setProp(_el$5, "flexShrink", 0);
|
|
1486
|
+
insertNode(_el$7, createTextNode(`────────────────────────────────────────────────────────────────────────`));
|
|
1015
1487
|
insert(_el$, createComponent(For, {
|
|
1016
1488
|
get each() {
|
|
1017
1489
|
return tab().groups;
|
|
1018
1490
|
},
|
|
1019
1491
|
children: (group) => (() => {
|
|
1020
|
-
var _el$
|
|
1021
|
-
insertNode(_el$
|
|
1022
|
-
setProp(_el$
|
|
1023
|
-
insert(_el$
|
|
1492
|
+
var _el$12 = createElement("box"), _el$14 = createElement("box");
|
|
1493
|
+
insertNode(_el$12, _el$14);
|
|
1494
|
+
setProp(_el$12, "flexDirection", "column");
|
|
1495
|
+
insert(_el$12, createComponent(Show, {
|
|
1024
1496
|
get when() {
|
|
1025
1497
|
return group.title !== void 0;
|
|
1026
1498
|
},
|
|
1027
1499
|
get children() {
|
|
1028
|
-
var _el$
|
|
1029
|
-
setProp(_el$
|
|
1030
|
-
insert(_el$
|
|
1031
|
-
effect((_$p) => setProp(_el$
|
|
1032
|
-
return _el$
|
|
1500
|
+
var _el$13 = createElement("text");
|
|
1501
|
+
setProp(_el$13, "attributes", 1);
|
|
1502
|
+
insert(_el$13, () => group.title);
|
|
1503
|
+
effect((_$p) => setProp(_el$13, "fg", props.fg, _$p));
|
|
1504
|
+
return _el$13;
|
|
1033
1505
|
}
|
|
1034
|
-
}), _el$
|
|
1035
|
-
insert(_el$
|
|
1506
|
+
}), _el$14);
|
|
1507
|
+
insert(_el$12, createComponent(For, {
|
|
1036
1508
|
get each() {
|
|
1037
1509
|
return group.rows;
|
|
1038
1510
|
},
|
|
@@ -1043,67 +1515,70 @@ function SettingsWindow(props) {
|
|
|
1043
1515
|
const gutter = () => isSelected() ? "▸ " : " ";
|
|
1044
1516
|
const valueCell = () => row.cycle !== void 0 ? `< ${display()} >` : display();
|
|
1045
1517
|
return (() => {
|
|
1046
|
-
var _el$
|
|
1047
|
-
insertNode(_el$14, _el$15);
|
|
1048
|
-
insertNode(_el$14, _el$17);
|
|
1049
|
-
setProp(_el$14, "flexDirection", "row");
|
|
1518
|
+
var _el$15 = createElement("box"), _el$16 = createElement("box"), _el$17 = createElement("text"), _el$18 = createElement("box"), _el$19 = createElement("text");
|
|
1050
1519
|
insertNode(_el$15, _el$16);
|
|
1051
|
-
|
|
1052
|
-
|
|
1520
|
+
insertNode(_el$15, _el$18);
|
|
1521
|
+
setProp(_el$15, "flexDirection", "row");
|
|
1522
|
+
insertNode(_el$16, _el$17);
|
|
1523
|
+
setProp(_el$16, "width", 30);
|
|
1524
|
+
spread(_el$17, mergeProps({ get fg() {
|
|
1053
1525
|
return props.fg;
|
|
1054
1526
|
} }, () => isSelected() ? { attributes: 1 } : {}), true);
|
|
1055
|
-
insert(_el$
|
|
1056
|
-
insertNode(_el$
|
|
1057
|
-
setProp(_el$
|
|
1058
|
-
spread(_el$
|
|
1527
|
+
insert(_el$17, () => `${gutter()}${row.name}`.padEnd(30));
|
|
1528
|
+
insertNode(_el$18, _el$19);
|
|
1529
|
+
setProp(_el$18, "width", 22);
|
|
1530
|
+
spread(_el$19, mergeProps({ get fg() {
|
|
1059
1531
|
return memo(() => !!(isSelected() || staged()))() ? props.fg : props.muted;
|
|
1060
1532
|
} }, () => isSelected() ? { attributes: 1 } : {}), true);
|
|
1061
|
-
insert(_el$
|
|
1062
|
-
insert(_el$
|
|
1533
|
+
insert(_el$19, () => `${valueCell()}${staged() ? " ●" : ""}`.padEnd(VALUE_WIDTH));
|
|
1534
|
+
insert(_el$15, createComponent(Show, {
|
|
1063
1535
|
get when() {
|
|
1064
1536
|
return row.note !== void 0;
|
|
1065
1537
|
},
|
|
1066
1538
|
get children() {
|
|
1067
|
-
var _el$
|
|
1068
|
-
insertNode(_el$
|
|
1069
|
-
setProp(_el$
|
|
1070
|
-
setProp(_el$
|
|
1071
|
-
insert(_el$
|
|
1072
|
-
effect((_$p) => setProp(_el$
|
|
1073
|
-
return _el$
|
|
1539
|
+
var _el$20 = createElement("box"), _el$21 = createElement("text");
|
|
1540
|
+
insertNode(_el$20, _el$21);
|
|
1541
|
+
setProp(_el$20, "flexGrow", 1);
|
|
1542
|
+
setProp(_el$20, "flexShrink", 1);
|
|
1543
|
+
insert(_el$21, () => row.note);
|
|
1544
|
+
effect((_$p) => setProp(_el$21, "fg", props.muted, _$p));
|
|
1545
|
+
return _el$20;
|
|
1074
1546
|
}
|
|
1075
1547
|
}), null);
|
|
1076
|
-
return _el$
|
|
1548
|
+
return _el$15;
|
|
1077
1549
|
})();
|
|
1078
1550
|
}
|
|
1079
|
-
}), _el$
|
|
1080
|
-
setProp(_el$
|
|
1081
|
-
return _el$
|
|
1551
|
+
}), _el$14);
|
|
1552
|
+
setProp(_el$14, "height", 1);
|
|
1553
|
+
return _el$12;
|
|
1082
1554
|
})()
|
|
1083
|
-
}), _el$
|
|
1555
|
+
}), _el$0);
|
|
1084
1556
|
insert(_el$, createComponent(Show, {
|
|
1085
1557
|
get when() {
|
|
1086
1558
|
return props.notice() !== void 0;
|
|
1087
1559
|
},
|
|
1088
1560
|
get children() {
|
|
1089
|
-
var _el$
|
|
1090
|
-
insert(_el$
|
|
1091
|
-
|
|
1092
|
-
|
|
1561
|
+
var _el$9 = createElement("text");
|
|
1562
|
+
insert(_el$9, (() => {
|
|
1563
|
+
var _c$ = memo(() => !!props.notice()?.startsWith("saved"));
|
|
1564
|
+
return () => _c$() ? props.notice() : `⚠ ${props.notice()}`;
|
|
1565
|
+
})());
|
|
1566
|
+
effect((_$p) => setProp(_el$9, "fg", props.notice()?.startsWith("saved") ? props.muted : props.warn ?? props.muted, _$p));
|
|
1567
|
+
return _el$9;
|
|
1093
1568
|
}
|
|
1094
|
-
}), _el$
|
|
1095
|
-
insert(_el$
|
|
1096
|
-
var _c$ = memo(() => !!draftDirty(props.draft()));
|
|
1097
|
-
return () => _c$() ? `● unsaved (${draftCount(props.draft())}) — ctrl+s save · ctrl+r reset page` : "no staged changes";
|
|
1569
|
+
}), _el$0);
|
|
1570
|
+
insert(_el$0, (() => {
|
|
1571
|
+
var _c$2 = memo(() => !!draftDirty(props.draft()));
|
|
1572
|
+
return () => _c$2() ? `● unsaved (${draftCount(props.draft())}) — ctrl+s save · ctrl+r reset page` : "no staged changes";
|
|
1098
1573
|
})());
|
|
1099
|
-
insertNode(_el$
|
|
1574
|
+
insertNode(_el$1, createTextNode(`1-9 tab · ←/→ change value · enter apply · tab next tab · ctrl+s save · ctrl+r reset page · esc/q close`));
|
|
1100
1575
|
effect((_p$) => {
|
|
1101
1576
|
var _v$ = props.fg, _v$2 = props.muted, _v$3 = props.muted, _v$4 = draftDirty(props.draft()) ? props.warn ?? props.fg : props.muted, _v$5 = props.muted;
|
|
1102
1577
|
_v$ !== _p$.e && (_p$.e = setProp(_el$3, "fg", _v$, _p$.e));
|
|
1103
|
-
_v$2 !== _p$.t && (_p$.t = setProp(_el$
|
|
1104
|
-
_v$3 !== _p$.a && (_p$.a = setProp(_el$
|
|
1105
|
-
_v$4 !== _p$.o && (_p$.o = setProp(_el$
|
|
1106
|
-
_v$5 !== _p$.i && (_p$.i = setProp(_el$
|
|
1578
|
+
_v$2 !== _p$.t && (_p$.t = setProp(_el$5, "fg", _v$2, _p$.t));
|
|
1579
|
+
_v$3 !== _p$.a && (_p$.a = setProp(_el$7, "fg", _v$3, _p$.a));
|
|
1580
|
+
_v$4 !== _p$.o && (_p$.o = setProp(_el$0, "fg", _v$4, _p$.o));
|
|
1581
|
+
_v$5 !== _p$.i && (_p$.i = setProp(_el$1, "fg", _v$5, _p$.i));
|
|
1107
1582
|
return _p$;
|
|
1108
1583
|
}, {
|
|
1109
1584
|
e: void 0,
|
|
@@ -1121,6 +1596,9 @@ function createWindowController(context, exit) {
|
|
|
1121
1596
|
const [selected, setSelected] = createSignal(0);
|
|
1122
1597
|
const [load, setLoad] = createSignal(readOverridesLoad());
|
|
1123
1598
|
const [decision, setDecision] = createSignal(readDecisionRouterConfig());
|
|
1599
|
+
const [goalLoop, setGoalLoop] = createSignal(readGoalLoopPrefs());
|
|
1600
|
+
const [budgets, setBudgets] = createSignal(readDecisionBudgets());
|
|
1601
|
+
const [autonomyRestartPending, setAutonomyRestartPending] = createSignal(false);
|
|
1124
1602
|
const [presetTick, setPresetTick] = createSignal(0);
|
|
1125
1603
|
const [lastChecked, setLastChecked] = createSignal(void 0);
|
|
1126
1604
|
const [checking, setChecking] = createSignal(false);
|
|
@@ -1149,6 +1627,12 @@ function createWindowController(context, exit) {
|
|
|
1149
1627
|
buildGatesTab(load()),
|
|
1150
1628
|
buildDecisionTab(decision()),
|
|
1151
1629
|
buildPresetTab(presetInput()),
|
|
1630
|
+
buildTuiTab(tuiPrefs()),
|
|
1631
|
+
buildAutonomyTab({
|
|
1632
|
+
goalLoop: goalLoop(),
|
|
1633
|
+
budgets: budgets(),
|
|
1634
|
+
goalLoopRestartPending: autonomyRestartPending()
|
|
1635
|
+
}),
|
|
1152
1636
|
buildJ1Tab(process.env, false),
|
|
1153
1637
|
buildUpdatesTab(updatesInput()),
|
|
1154
1638
|
buildDoctorTab({
|
|
@@ -1230,6 +1714,31 @@ function createWindowController(context, exit) {
|
|
|
1230
1714
|
};
|
|
1231
1715
|
}
|
|
1232
1716
|
}
|
|
1717
|
+
if (id === "decision.selection.mode" || id === "decision.selection.target" || id === "decision.consent") {
|
|
1718
|
+
const current = decision();
|
|
1719
|
+
if (current.corrupt) return {
|
|
1720
|
+
ok: false,
|
|
1721
|
+
reason: "decision-router.json unreadable — repair via `decision-router setup-model`"
|
|
1722
|
+
};
|
|
1723
|
+
const staged = applyDecisionRow(current.config, id, value);
|
|
1724
|
+
if (staged === current.config) return {
|
|
1725
|
+
ok: false,
|
|
1726
|
+
reason: "unknown or invalid value"
|
|
1727
|
+
};
|
|
1728
|
+
try {
|
|
1729
|
+
writeDecisionRouterConfig(staged);
|
|
1730
|
+
setDecision({
|
|
1731
|
+
config: staged,
|
|
1732
|
+
corrupt: false
|
|
1733
|
+
});
|
|
1734
|
+
return { ok: true };
|
|
1735
|
+
} catch {
|
|
1736
|
+
return {
|
|
1737
|
+
ok: false,
|
|
1738
|
+
reason: "decision-router disk write failed"
|
|
1739
|
+
};
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1233
1742
|
if (id === "preset") try {
|
|
1234
1743
|
if (value === "none") clearActivePreset(globalActivePresetPath());
|
|
1235
1744
|
else writeActivePreset(globalActivePresetPath(), value);
|
|
@@ -1241,6 +1750,65 @@ function createWindowController(context, exit) {
|
|
|
1241
1750
|
reason: error instanceof Error ? error.message : "preset marker write failed"
|
|
1242
1751
|
};
|
|
1243
1752
|
}
|
|
1753
|
+
if (id.startsWith("autonomy.goal_loop.")) {
|
|
1754
|
+
const next = { ...goalLoop() };
|
|
1755
|
+
if (id === "autonomy.goal_loop.enabled") next.enabled = value === "enabled";
|
|
1756
|
+
else if (id === "autonomy.goal_loop.maxContinuations") {
|
|
1757
|
+
const parsed = Number(value);
|
|
1758
|
+
if (!Number.isFinite(parsed) || parsed < 1 || parsed > 200) return {
|
|
1759
|
+
ok: false,
|
|
1760
|
+
reason: "max continuations must be 1..200"
|
|
1761
|
+
};
|
|
1762
|
+
next.maxContinuations = Math.floor(parsed);
|
|
1763
|
+
} else if (id === "autonomy.goal_loop.cooldownMs") {
|
|
1764
|
+
const parsed = Number(value);
|
|
1765
|
+
if (!Number.isFinite(parsed) || parsed < 1e3) return {
|
|
1766
|
+
ok: false,
|
|
1767
|
+
reason: "cooldown must be >= 1000ms"
|
|
1768
|
+
};
|
|
1769
|
+
next.cooldownMs = Math.floor(parsed);
|
|
1770
|
+
}
|
|
1771
|
+
try {
|
|
1772
|
+
writeUserOption("goal_loop", next);
|
|
1773
|
+
setGoalLoop(next);
|
|
1774
|
+
setAutonomyRestartPending(true);
|
|
1775
|
+
return { ok: true };
|
|
1776
|
+
} catch {
|
|
1777
|
+
return {
|
|
1778
|
+
ok: false,
|
|
1779
|
+
reason: "opencode.json write failed"
|
|
1780
|
+
};
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
if (id === "autonomy.budget.monthly" || id === "autonomy.budget.perDecision") {
|
|
1784
|
+
const parsed = parseUsd(value);
|
|
1785
|
+
if (parsed === null) return {
|
|
1786
|
+
ok: false,
|
|
1787
|
+
reason: "invalid USD value"
|
|
1788
|
+
};
|
|
1789
|
+
const next = { ...budgets() };
|
|
1790
|
+
if (id === "autonomy.budget.monthly") next.monthlyUsd = parsed;
|
|
1791
|
+
else next.perDecisionUsd = parsed;
|
|
1792
|
+
try {
|
|
1793
|
+
writeDecisionBudget(next);
|
|
1794
|
+
setBudgets(next);
|
|
1795
|
+
return { ok: true };
|
|
1796
|
+
} catch {
|
|
1797
|
+
return {
|
|
1798
|
+
ok: false,
|
|
1799
|
+
reason: "budget write failed"
|
|
1800
|
+
};
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
if (id.startsWith("tui.")) try {
|
|
1804
|
+
mutateTuiPrefs((prefsDraft) => applyTuiRow(prefsDraft, id, value)).then(() => setNotice(void 0)).catch(() => setNotice("tui prefs: persist failed — the change is active for this session only"));
|
|
1805
|
+
return { ok: true };
|
|
1806
|
+
} catch {
|
|
1807
|
+
return {
|
|
1808
|
+
ok: false,
|
|
1809
|
+
reason: "tui prefs storage unavailable"
|
|
1810
|
+
};
|
|
1811
|
+
}
|
|
1244
1812
|
return {
|
|
1245
1813
|
ok: false,
|
|
1246
1814
|
reason: "unknown staged row"
|
|
@@ -1273,16 +1841,15 @@ function createWindowController(context, exit) {
|
|
|
1273
1841
|
setSelected(0);
|
|
1274
1842
|
};
|
|
1275
1843
|
const close = () => {
|
|
1276
|
-
|
|
1844
|
+
const staged = draftCount(draft());
|
|
1845
|
+
if (staged > 0) {
|
|
1846
|
+
setDraft({});
|
|
1277
1847
|
try {
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
message:
|
|
1281
|
-
})).then((confirmed) => {
|
|
1282
|
-
if (confirmed === true) exit();
|
|
1848
|
+
context.ui.toast?.show?.({
|
|
1849
|
+
variant: "info",
|
|
1850
|
+
message: `settings: ${staged} staged change${staged === 1 ? "" : "s"} discarded`
|
|
1283
1851
|
});
|
|
1284
1852
|
} catch {}
|
|
1285
|
-
return;
|
|
1286
1853
|
}
|
|
1287
1854
|
exit();
|
|
1288
1855
|
};
|
|
@@ -1322,6 +1889,10 @@ function SettingsPage(props) {
|
|
|
1322
1889
|
const controller = createWindowController(context, () => navigateBack(context, returnRoute !== void 0 ? { returnRoute } : {}));
|
|
1323
1890
|
const theme = context.theme?.text ?? {};
|
|
1324
1891
|
const warn = theme?.feedback?.warning?.base ?? theme.muted;
|
|
1892
|
+
try {
|
|
1893
|
+
const popMode = context.keymap?.mode?.push?.(ROUTE_MODE);
|
|
1894
|
+
if (popMode !== void 0) onCleanup(() => popMode());
|
|
1895
|
+
} catch {}
|
|
1325
1896
|
onCleanup(controller.cleanup);
|
|
1326
1897
|
setBlocking(true);
|
|
1327
1898
|
pageApi = controller.api;
|
|
@@ -1355,7 +1926,12 @@ function SettingsPage(props) {
|
|
|
1355
1926
|
}
|
|
1356
1927
|
function navigateBack(context, data) {
|
|
1357
1928
|
try {
|
|
1358
|
-
|
|
1929
|
+
const destination = data?.returnRoute ?? { type: "home" };
|
|
1930
|
+
context.ui.toast?.show?.({
|
|
1931
|
+
variant: "info",
|
|
1932
|
+
message: `settings: navigating ${JSON.stringify(destination)}`
|
|
1933
|
+
});
|
|
1934
|
+
context.ui.router.navigate(destination);
|
|
1359
1935
|
} catch {}
|
|
1360
1936
|
}
|
|
1361
1937
|
const [dialogOpen, setDialogOpen] = createSignal(false);
|
|
@@ -1438,7 +2014,22 @@ function setupPantheonSettings(context) {
|
|
|
1438
2014
|
title: "Close settings",
|
|
1439
2015
|
bind: "escape,q",
|
|
1440
2016
|
run: () => {
|
|
1441
|
-
|
|
2017
|
+
try {
|
|
2018
|
+
context.ui.toast?.show?.({
|
|
2019
|
+
variant: "info",
|
|
2020
|
+
message: "settings: close command fired"
|
|
2021
|
+
});
|
|
2022
|
+
} catch {}
|
|
2023
|
+
if (pageApi === void 0) {
|
|
2024
|
+
try {
|
|
2025
|
+
context.ui.toast?.show?.({
|
|
2026
|
+
variant: "warning",
|
|
2027
|
+
message: "settings: no window controller bound"
|
|
2028
|
+
});
|
|
2029
|
+
} catch {}
|
|
2030
|
+
return;
|
|
2031
|
+
}
|
|
2032
|
+
pageApi.close();
|
|
1442
2033
|
}
|
|
1443
2034
|
},
|
|
1444
2035
|
{
|
|
@@ -1516,7 +2107,7 @@ function setupPantheonSettings(context) {
|
|
|
1516
2107
|
];
|
|
1517
2108
|
try {
|
|
1518
2109
|
context.keymap.layer(() => ({
|
|
1519
|
-
mode:
|
|
2110
|
+
mode: ROUTE_MODE,
|
|
1520
2111
|
priority: 1,
|
|
1521
2112
|
enabled: () => routeGated(),
|
|
1522
2113
|
commands
|
|
@@ -1537,7 +2128,7 @@ async function openPantheonSettings(context) {
|
|
|
1537
2128
|
let returnRoute;
|
|
1538
2129
|
try {
|
|
1539
2130
|
const current = context.ui.router.current();
|
|
1540
|
-
if (!(current.type === "plugin" && current.name === "pantheon-settings")) returnRoute = current;
|
|
2131
|
+
if (!(current.type === "plugin" && current.name === "pantheon-settings")) returnRoute = plainRoute(current);
|
|
1541
2132
|
} catch {
|
|
1542
2133
|
returnRoute = void 0;
|
|
1543
2134
|
}
|
|
@@ -1860,7 +2451,7 @@ async function readChangelogForBundle(bundleUrl) {
|
|
|
1860
2451
|
}
|
|
1861
2452
|
/** The ambient build-time version, or null outside a tsdown build. */
|
|
1862
2453
|
function embeddedVersion() {
|
|
1863
|
-
return "2.0.0-beta.
|
|
2454
|
+
return "2.0.0-beta.6";
|
|
1864
2455
|
}
|
|
1865
2456
|
/**
|
|
1866
2457
|
* Resolve the running Pantheon version for the what's-new window: the plugin
|
|
@@ -2707,8 +3298,9 @@ function turnTokensPerSecond(messages, position) {
|
|
|
2707
3298
|
* `$<spent> spent`. The percentage row carries the only semantic tone, the
|
|
2708
3299
|
* gauge bar (12 cells) and is omitted entirely when the percentage is
|
|
2709
3300
|
* unavailable (never `undefined%`). A block with neither tokens nor cost
|
|
2710
|
-
* yields null.
|
|
2711
|
-
|
|
3301
|
+
* yields null. `gaugeStyle` (the TUI tab's pref) picks the percent-row
|
|
3302
|
+
* shape: `both` (default), `bar`, `percent`, or `off` (row omitted). Pure. */
|
|
3303
|
+
function contextBlockRows(usage, cost, gaugeStyle = "both") {
|
|
2712
3304
|
const spentValue = formatSpent(cost);
|
|
2713
3305
|
const spent = spentValue === null ? null : {
|
|
2714
3306
|
lead: null,
|
|
@@ -2733,13 +3325,32 @@ function contextBlockRows(usage, cost) {
|
|
|
2733
3325
|
const percentValue = numberOrNull(usage.percent);
|
|
2734
3326
|
const window = formatContextWindow(usage.limit);
|
|
2735
3327
|
const bar = contextBar(percentValue);
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
3328
|
+
let percent = null;
|
|
3329
|
+
if (gaugeStyle !== "off" && bar !== null && percentValue !== null) {
|
|
3330
|
+
const suffix = window === null ? null : ` of ${window}`;
|
|
3331
|
+
const tone = contextUsageTone(percentValue);
|
|
3332
|
+
if (gaugeStyle === "bar") percent = {
|
|
3333
|
+
lead: bar.filled,
|
|
3334
|
+
value: "",
|
|
3335
|
+
tail: bar.empty,
|
|
3336
|
+
suffix,
|
|
3337
|
+
tone
|
|
3338
|
+
};
|
|
3339
|
+
else if (gaugeStyle === "percent") percent = {
|
|
3340
|
+
lead: null,
|
|
3341
|
+
value: ` ${Math.round(percentValue)}%`,
|
|
3342
|
+
tail: null,
|
|
3343
|
+
suffix: null,
|
|
3344
|
+
tone
|
|
3345
|
+
};
|
|
3346
|
+
else percent = {
|
|
3347
|
+
lead: bar.filled,
|
|
3348
|
+
value: ` ${Math.round(percentValue)}%`,
|
|
3349
|
+
tail: bar.empty,
|
|
3350
|
+
suffix,
|
|
3351
|
+
tone
|
|
3352
|
+
};
|
|
3353
|
+
}
|
|
2743
3354
|
if (tokens === null && percent === null && spent === null) return null;
|
|
2744
3355
|
return {
|
|
2745
3356
|
tokens,
|
|
@@ -4498,7 +5109,7 @@ async function checkForPantheonUpdate(context) {
|
|
|
4498
5109
|
const latest = String((await response.json())?.version ?? "");
|
|
4499
5110
|
if (!latest) return;
|
|
4500
5111
|
const notice = pickUpdateNotice({
|
|
4501
|
-
currentVersion: "2.0.0-beta.
|
|
5112
|
+
currentVersion: "2.0.0-beta.6",
|
|
4502
5113
|
latestVersion: latest,
|
|
4503
5114
|
state: readState(),
|
|
4504
5115
|
nowMs: Date.now()
|
|
@@ -5027,11 +5638,12 @@ function createSidebarModel(context, sessionID, gitExec = defaultGitExec) {
|
|
|
5027
5638
|
return buildDispatchBlock(allDelegations(), Date.now(), frame());
|
|
5028
5639
|
});
|
|
5029
5640
|
const blocks = createMemo(() => {
|
|
5641
|
+
const prefs = tuiPrefs();
|
|
5030
5642
|
const present = [];
|
|
5031
|
-
if (contextBlockRows(contextUsage(), cost()) !== null || contextSpendLine(spend()) !== null) present.push("context");
|
|
5032
|
-
if (branch() !== null || gitLine() !== null) present.push("git");
|
|
5033
|
-
if (todo().visible.length > 0) present.push("todo");
|
|
5034
|
-
if (dispatch() !== null) present.push("dispatch");
|
|
5643
|
+
if (prefs.sidebar.blocks.context && (contextBlockRows(contextUsage(), cost(), prefs.sidebar.context.gauge) !== null || prefs.sidebar.context.localSpend && contextSpendLine(spend()) !== null)) present.push("context");
|
|
5644
|
+
if (prefs.sidebar.blocks.git && (branch() !== null || gitLine() !== null)) present.push("git");
|
|
5645
|
+
if (prefs.sidebar.blocks.todo && todo().visible.length > 0) present.push("todo");
|
|
5646
|
+
if (prefs.sidebar.blocks.dispatch && dispatch() !== null) present.push("dispatch");
|
|
5035
5647
|
return withBlockSpacers(present);
|
|
5036
5648
|
});
|
|
5037
5649
|
onMount(() => {
|
|
@@ -5258,11 +5870,20 @@ function Sidebar(props) {
|
|
|
5258
5870
|
const open = (sessionID) => () => navigateToSession(context.ui?.router, sessionID);
|
|
5259
5871
|
const block = (key) => model.blocks().find((entry) => entry.key === key);
|
|
5260
5872
|
const spacer = (key) => block(key)?.spacer === true;
|
|
5261
|
-
const usageRows = () => modelUsageRows(model.modelUsage().visible);
|
|
5262
5873
|
const usageHidden = () => hiddenModelUsageText(model.modelUsage().hidden, model.modelUsage().hiddenCost);
|
|
5263
|
-
const contextRows = () =>
|
|
5264
|
-
|
|
5265
|
-
|
|
5874
|
+
const contextRows = () => {
|
|
5875
|
+
const prefs = tuiPrefs();
|
|
5876
|
+
const rows = contextBlockRows(model.contextUsage(), model.cost(), prefs.sidebar.context.gauge);
|
|
5877
|
+
if (rows === null) return null;
|
|
5878
|
+
return {
|
|
5879
|
+
tokens: prefs.sidebar.context.tokens ? rows.tokens : null,
|
|
5880
|
+
percent: rows.percent,
|
|
5881
|
+
spent: prefs.sidebar.context.spent ? rows.spent : null
|
|
5882
|
+
};
|
|
5883
|
+
};
|
|
5884
|
+
const spendLine = () => tuiPrefs().sidebar.context.localSpend ? contextSpendLine(model.spend()) : null;
|
|
5885
|
+
const performanceLine = () => tuiPrefs().sidebar.context.performance ? contextPerformanceLine(model.performance()) : null;
|
|
5886
|
+
const usageRows = () => tuiPrefs().sidebar.context.modelUsage ? modelUsageRows(model.modelUsage().visible) : [];
|
|
5266
5887
|
const gaugeFg = (row) => contextProgressColor(row.tone ?? "warning", context.theme);
|
|
5267
5888
|
const dispatchView = () => model.dispatch();
|
|
5268
5889
|
const dispatchSummary = () => {
|
|
@@ -5270,33 +5891,64 @@ function Sidebar(props) {
|
|
|
5270
5891
|
return view === null ? null : dispatchHeaderSummary(view.runningCount, view.totalCost);
|
|
5271
5892
|
};
|
|
5272
5893
|
const failedSuffix = () => failedSuffixText(dispatchView()?.failures);
|
|
5894
|
+
const header = () => tuiPrefs().sidebar.header;
|
|
5273
5895
|
return (() => {
|
|
5274
|
-
var _el$12 = createElement("box")
|
|
5275
|
-
insertNode(_el$12, _el$13);
|
|
5276
|
-
insertNode(_el$12, _el$14);
|
|
5896
|
+
var _el$12 = createElement("box");
|
|
5277
5897
|
setProp(_el$12, "flexDirection", "column");
|
|
5278
5898
|
setProp(_el$12, "width", "100%");
|
|
5279
5899
|
setProp(_el$12, "padding", 1);
|
|
5280
|
-
setProp(_el$13, "attributes", 1);
|
|
5281
|
-
insert(_el$13, `Pantheon v2.0.0-beta.4`);
|
|
5282
|
-
insert(_el$14, () => presetHeaderLine(model.preset().name ?? "", model.provider()));
|
|
5283
5900
|
insert(_el$12, createComponent(Show, {
|
|
5284
5901
|
get when() {
|
|
5285
|
-
return
|
|
5902
|
+
return header().version;
|
|
5903
|
+
},
|
|
5904
|
+
get children() {
|
|
5905
|
+
var _el$13 = createElement("text");
|
|
5906
|
+
setProp(_el$13, "attributes", 1);
|
|
5907
|
+
insert(_el$13, `Pantheon v2.0.0-beta.6`);
|
|
5908
|
+
effect((_$p) => setProp(_el$13, "fg", text(), _$p));
|
|
5909
|
+
return _el$13;
|
|
5910
|
+
}
|
|
5911
|
+
}), null);
|
|
5912
|
+
insert(_el$12, createComponent(Show, {
|
|
5913
|
+
get when() {
|
|
5914
|
+
return header().preset;
|
|
5915
|
+
},
|
|
5916
|
+
get children() {
|
|
5917
|
+
var _el$14 = createElement("text");
|
|
5918
|
+
insert(_el$14, () => presetHeaderLine(model.preset().name ?? "", model.provider()));
|
|
5919
|
+
effect((_$p) => setProp(_el$14, "fg", muted(), _$p));
|
|
5920
|
+
return _el$14;
|
|
5921
|
+
}
|
|
5922
|
+
}), null);
|
|
5923
|
+
insert(_el$12, createComponent(Show, {
|
|
5924
|
+
get when() {
|
|
5925
|
+
return memo(() => !!(header().session && model.activeSessionID() !== ""))() && model.session();
|
|
5286
5926
|
},
|
|
5287
5927
|
get fallback() {
|
|
5288
|
-
return (
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5928
|
+
return createComponent(Show, {
|
|
5929
|
+
get when() {
|
|
5930
|
+
return header().session;
|
|
5931
|
+
},
|
|
5932
|
+
get fallback() {
|
|
5933
|
+
return (() => {
|
|
5934
|
+
var _el$26 = createElement("box");
|
|
5935
|
+
setProp(_el$26, "height", 0);
|
|
5936
|
+
return _el$26;
|
|
5937
|
+
})();
|
|
5938
|
+
},
|
|
5939
|
+
get children() {
|
|
5940
|
+
var _el$25 = createElement("text");
|
|
5941
|
+
insert(_el$25, () => sidebarPlaceholder(props.sessionID));
|
|
5942
|
+
effect((_$p) => setProp(_el$25, "fg", muted(), _$p));
|
|
5943
|
+
return _el$25;
|
|
5944
|
+
}
|
|
5945
|
+
});
|
|
5294
5946
|
},
|
|
5295
5947
|
children: (current) => (() => {
|
|
5296
|
-
var _el$
|
|
5297
|
-
insert(_el$
|
|
5298
|
-
effect((_$p) => setProp(_el$
|
|
5299
|
-
return _el$
|
|
5948
|
+
var _el$27 = createElement("text");
|
|
5949
|
+
insert(_el$27, () => `Sessão: ${truncateLabel(current().title || current().id)}`);
|
|
5950
|
+
effect((_$p) => setProp(_el$27, "fg", text(), _$p));
|
|
5951
|
+
return _el$27;
|
|
5300
5952
|
})()
|
|
5301
5953
|
}), null);
|
|
5302
5954
|
insert(_el$12, createComponent(Show, {
|
|
@@ -5343,9 +5995,9 @@ function Sidebar(props) {
|
|
|
5343
5995
|
return contextRows();
|
|
5344
5996
|
},
|
|
5345
5997
|
children: (rows) => (() => {
|
|
5346
|
-
var _el$
|
|
5347
|
-
setProp(_el$
|
|
5348
|
-
insert(_el$
|
|
5998
|
+
var _el$28 = createElement("box");
|
|
5999
|
+
setProp(_el$28, "flexDirection", "column");
|
|
6000
|
+
insert(_el$28, createComponent(Show, {
|
|
5349
6001
|
get when() {
|
|
5350
6002
|
return rows().tokens;
|
|
5351
6003
|
},
|
|
@@ -5361,7 +6013,7 @@ function Sidebar(props) {
|
|
|
5361
6013
|
}
|
|
5362
6014
|
})
|
|
5363
6015
|
}), null);
|
|
5364
|
-
insert(_el$
|
|
6016
|
+
insert(_el$28, createComponent(Show, {
|
|
5365
6017
|
get when() {
|
|
5366
6018
|
return rows().percent;
|
|
5367
6019
|
},
|
|
@@ -5377,7 +6029,7 @@ function Sidebar(props) {
|
|
|
5377
6029
|
}
|
|
5378
6030
|
})
|
|
5379
6031
|
}), null);
|
|
5380
|
-
insert(_el$
|
|
6032
|
+
insert(_el$28, createComponent(Show, {
|
|
5381
6033
|
get when() {
|
|
5382
6034
|
return rows().spent;
|
|
5383
6035
|
},
|
|
@@ -5393,46 +6045,46 @@ function Sidebar(props) {
|
|
|
5393
6045
|
}
|
|
5394
6046
|
})
|
|
5395
6047
|
}), null);
|
|
5396
|
-
insert(_el$
|
|
6048
|
+
insert(_el$28, createComponent(Show, {
|
|
5397
6049
|
get when() {
|
|
5398
|
-
return usageRows().length > 0;
|
|
6050
|
+
return memo(() => !!tuiPrefs().sidebar.context.modelUsage)() && usageRows().length > 0;
|
|
5399
6051
|
},
|
|
5400
6052
|
get children() {
|
|
5401
6053
|
return [(() => {
|
|
5402
|
-
var _el$
|
|
5403
|
-
insertNode(_el$
|
|
5404
|
-
effect((_$p) => setProp(_el$
|
|
5405
|
-
return _el$
|
|
6054
|
+
var _el$29 = createElement("text");
|
|
6055
|
+
insertNode(_el$29, createTextNode(`Sessão · custo reportado`));
|
|
6056
|
+
effect((_$p) => setProp(_el$29, "fg", muted(), _$p));
|
|
6057
|
+
return _el$29;
|
|
5406
6058
|
})(), (() => {
|
|
5407
|
-
var _el$
|
|
5408
|
-
insertNode(_el$
|
|
5409
|
-
effect((_$p) => setProp(_el$
|
|
5410
|
-
return _el$
|
|
6059
|
+
var _el$31 = createElement("text");
|
|
6060
|
+
insertNode(_el$31, createTextNode(`Modelo Tokens USD`));
|
|
6061
|
+
effect((_$p) => setProp(_el$31, "fg", muted(), _$p));
|
|
6062
|
+
return _el$31;
|
|
5411
6063
|
})()];
|
|
5412
6064
|
}
|
|
5413
6065
|
}), null);
|
|
5414
|
-
insert(_el$
|
|
6066
|
+
insert(_el$28, createComponent(For, {
|
|
5415
6067
|
get each() {
|
|
5416
6068
|
return usageRows();
|
|
5417
6069
|
},
|
|
5418
6070
|
children: (row) => (() => {
|
|
5419
|
-
var _el$
|
|
5420
|
-
setProp(_el$
|
|
5421
|
-
insert(_el$
|
|
6071
|
+
var _el$33 = createElement("box");
|
|
6072
|
+
setProp(_el$33, "flexDirection", "column");
|
|
6073
|
+
insert(_el$33, createComponent(For, {
|
|
5422
6074
|
get each() {
|
|
5423
6075
|
return modelUsageRowLines(row);
|
|
5424
6076
|
},
|
|
5425
6077
|
children: (line) => (() => {
|
|
5426
|
-
var _el$
|
|
5427
|
-
insert(_el$
|
|
5428
|
-
effect((_$p) => setProp(_el$
|
|
5429
|
-
return _el$
|
|
6078
|
+
var _el$34 = createElement("text");
|
|
6079
|
+
insert(_el$34, line);
|
|
6080
|
+
effect((_$p) => setProp(_el$34, "fg", text(), _$p));
|
|
6081
|
+
return _el$34;
|
|
5430
6082
|
})()
|
|
5431
6083
|
}));
|
|
5432
|
-
return _el$
|
|
6084
|
+
return _el$33;
|
|
5433
6085
|
})()
|
|
5434
6086
|
}), null);
|
|
5435
|
-
insert(_el$
|
|
6087
|
+
insert(_el$28, createComponent(Show, {
|
|
5436
6088
|
get when() {
|
|
5437
6089
|
return usageHidden();
|
|
5438
6090
|
},
|
|
@@ -5441,14 +6093,14 @@ function Sidebar(props) {
|
|
|
5441
6093
|
return sidebarTextLines(line());
|
|
5442
6094
|
},
|
|
5443
6095
|
children: (part) => (() => {
|
|
5444
|
-
var _el$
|
|
5445
|
-
insert(_el$
|
|
5446
|
-
effect((_$p) => setProp(_el$
|
|
5447
|
-
return _el$
|
|
6096
|
+
var _el$35 = createElement("text");
|
|
6097
|
+
insert(_el$35, part);
|
|
6098
|
+
effect((_$p) => setProp(_el$35, "fg", muted(), _$p));
|
|
6099
|
+
return _el$35;
|
|
5448
6100
|
})()
|
|
5449
6101
|
})
|
|
5450
6102
|
}), null);
|
|
5451
|
-
return _el$
|
|
6103
|
+
return _el$28;
|
|
5452
6104
|
})()
|
|
5453
6105
|
}), null);
|
|
5454
6106
|
insert(_el$16, createComponent(Show, {
|
|
@@ -5456,10 +6108,10 @@ function Sidebar(props) {
|
|
|
5456
6108
|
return performanceLine();
|
|
5457
6109
|
},
|
|
5458
6110
|
children: (line) => (() => {
|
|
5459
|
-
var _el$
|
|
5460
|
-
insert(_el$
|
|
5461
|
-
effect((_$p) => setProp(_el$
|
|
5462
|
-
return _el$
|
|
6111
|
+
var _el$36 = createElement("text");
|
|
6112
|
+
insert(_el$36, line);
|
|
6113
|
+
effect((_$p) => setProp(_el$36, "fg", muted(), _$p));
|
|
6114
|
+
return _el$36;
|
|
5463
6115
|
})()
|
|
5464
6116
|
}), null);
|
|
5465
6117
|
insert(_el$16, createComponent(Show, {
|
|
@@ -5471,10 +6123,10 @@ function Sidebar(props) {
|
|
|
5471
6123
|
return contextSpendLines(line());
|
|
5472
6124
|
},
|
|
5473
6125
|
children: (part) => (() => {
|
|
5474
|
-
var _el$
|
|
5475
|
-
insert(_el$
|
|
5476
|
-
effect((_$p) => setProp(_el$
|
|
5477
|
-
return _el$
|
|
6126
|
+
var _el$37 = createElement("text");
|
|
6127
|
+
insert(_el$37, part);
|
|
6128
|
+
effect((_$p) => setProp(_el$37, "fg", muted(), _$p));
|
|
6129
|
+
return _el$37;
|
|
5478
6130
|
})()
|
|
5479
6131
|
})
|
|
5480
6132
|
}), null);
|
|
@@ -5515,22 +6167,22 @@ function Sidebar(props) {
|
|
|
5515
6167
|
return model.branch();
|
|
5516
6168
|
},
|
|
5517
6169
|
children: (value) => (() => {
|
|
5518
|
-
var _el$
|
|
5519
|
-
insertNode(_el$
|
|
5520
|
-
insertNode(_el$
|
|
5521
|
-
setProp(_el$
|
|
5522
|
-
insertNode(_el$
|
|
5523
|
-
insert(_el$
|
|
6170
|
+
var _el$38 = createElement("box"), _el$39 = createElement("text"), _el$41 = createElement("text");
|
|
6171
|
+
insertNode(_el$38, _el$39);
|
|
6172
|
+
insertNode(_el$38, _el$41);
|
|
6173
|
+
setProp(_el$38, "flexDirection", "row");
|
|
6174
|
+
insertNode(_el$39, createTextNode(`⎇ `));
|
|
6175
|
+
insert(_el$41, () => truncateLabel(value(), 32));
|
|
5524
6176
|
effect((_p$) => {
|
|
5525
|
-
var _v$
|
|
5526
|
-
_v$
|
|
5527
|
-
_v$
|
|
6177
|
+
var _v$3 = muted(), _v$4 = text();
|
|
6178
|
+
_v$3 !== _p$.e && (_p$.e = setProp(_el$39, "fg", _v$3, _p$.e));
|
|
6179
|
+
_v$4 !== _p$.t && (_p$.t = setProp(_el$41, "fg", _v$4, _p$.t));
|
|
5528
6180
|
return _p$;
|
|
5529
6181
|
}, {
|
|
5530
6182
|
e: void 0,
|
|
5531
6183
|
t: void 0
|
|
5532
6184
|
});
|
|
5533
|
-
return _el$
|
|
6185
|
+
return _el$38;
|
|
5534
6186
|
})()
|
|
5535
6187
|
}), null);
|
|
5536
6188
|
insert(_el$18, createComponent(Show, {
|
|
@@ -5538,10 +6190,10 @@ function Sidebar(props) {
|
|
|
5538
6190
|
return model.gitLine();
|
|
5539
6191
|
},
|
|
5540
6192
|
children: (line) => (() => {
|
|
5541
|
-
var _el$
|
|
5542
|
-
insert(_el$
|
|
5543
|
-
effect((_$p) => setProp(_el$
|
|
5544
|
-
return _el$
|
|
6193
|
+
var _el$42 = createElement("text");
|
|
6194
|
+
insert(_el$42, line);
|
|
6195
|
+
effect((_$p) => setProp(_el$42, "fg", text(), _$p));
|
|
6196
|
+
return _el$42;
|
|
5545
6197
|
})()
|
|
5546
6198
|
}), null);
|
|
5547
6199
|
return _el$18;
|
|
@@ -5588,10 +6240,10 @@ function Sidebar(props) {
|
|
|
5588
6240
|
return model.todo().visible;
|
|
5589
6241
|
},
|
|
5590
6242
|
children: (item) => (() => {
|
|
5591
|
-
var _el$
|
|
5592
|
-
insert(_el$
|
|
5593
|
-
effect((_$p) => setProp(_el$
|
|
5594
|
-
return _el$
|
|
6243
|
+
var _el$43 = createElement("text");
|
|
6244
|
+
insert(_el$43, () => todoRowText(item));
|
|
6245
|
+
effect((_$p) => setProp(_el$43, "fg", todoFg(item.status), _$p));
|
|
6246
|
+
return _el$43;
|
|
5595
6247
|
})()
|
|
5596
6248
|
}), null);
|
|
5597
6249
|
insert(_el$22, createComponent(Show, {
|
|
@@ -5599,10 +6251,10 @@ function Sidebar(props) {
|
|
|
5599
6251
|
return hiddenTodoText(model.todo().hidden);
|
|
5600
6252
|
},
|
|
5601
6253
|
children: (line) => (() => {
|
|
5602
|
-
var _el$
|
|
5603
|
-
insert(_el$
|
|
5604
|
-
effect((_$p) => setProp(_el$
|
|
5605
|
-
return _el$
|
|
6254
|
+
var _el$44 = createElement("text");
|
|
6255
|
+
insert(_el$44, line);
|
|
6256
|
+
effect((_$p) => setProp(_el$44, "fg", muted(), _$p));
|
|
6257
|
+
return _el$44;
|
|
5606
6258
|
})()
|
|
5607
6259
|
}), null);
|
|
5608
6260
|
return _el$22;
|
|
@@ -5633,9 +6285,9 @@ function Sidebar(props) {
|
|
|
5633
6285
|
return dispatchView();
|
|
5634
6286
|
},
|
|
5635
6287
|
children: (view) => (() => {
|
|
5636
|
-
var _el$
|
|
5637
|
-
setProp(_el$
|
|
5638
|
-
insert(_el$
|
|
6288
|
+
var _el$45 = createElement("box");
|
|
6289
|
+
setProp(_el$45, "flexDirection", "column");
|
|
6290
|
+
insert(_el$45, createComponent(BlockHeader, {
|
|
5639
6291
|
get icon() {
|
|
5640
6292
|
return BLOCK_ICONS.dispatch;
|
|
5641
6293
|
},
|
|
@@ -5650,100 +6302,91 @@ function Sidebar(props) {
|
|
|
5650
6302
|
return dispatchSummary();
|
|
5651
6303
|
}
|
|
5652
6304
|
}), null);
|
|
5653
|
-
insert(_el$
|
|
6305
|
+
insert(_el$45, createComponent(For, {
|
|
5654
6306
|
get each() {
|
|
5655
6307
|
return view().running;
|
|
5656
6308
|
},
|
|
5657
6309
|
children: (row) => (() => {
|
|
5658
|
-
var _el$
|
|
5659
|
-
insertNode(_el$
|
|
5660
|
-
setProp(_el$
|
|
5661
|
-
insert(_el$
|
|
6310
|
+
var _el$47 = createElement("box"), _el$48 = createElement("text");
|
|
6311
|
+
insertNode(_el$47, _el$48);
|
|
6312
|
+
setProp(_el$47, "flexShrink", 0);
|
|
6313
|
+
insert(_el$48, () => row.text);
|
|
5662
6314
|
effect((_p$) => {
|
|
5663
|
-
var _v$
|
|
5664
|
-
_v$
|
|
5665
|
-
_v$
|
|
6315
|
+
var _v$5 = open(row.id), _v$6 = tone("success");
|
|
6316
|
+
_v$5 !== _p$.e && (_p$.e = setProp(_el$47, "onMouseDown", _v$5, _p$.e));
|
|
6317
|
+
_v$6 !== _p$.t && (_p$.t = setProp(_el$48, "fg", _v$6, _p$.t));
|
|
5666
6318
|
return _p$;
|
|
5667
6319
|
}, {
|
|
5668
6320
|
e: void 0,
|
|
5669
6321
|
t: void 0
|
|
5670
6322
|
});
|
|
5671
|
-
return _el$
|
|
6323
|
+
return _el$47;
|
|
5672
6324
|
})()
|
|
5673
6325
|
}), null);
|
|
5674
|
-
insert(_el$
|
|
6326
|
+
insert(_el$45, createComponent(Show, {
|
|
5675
6327
|
get when() {
|
|
5676
6328
|
return view().runningHidden > 0;
|
|
5677
6329
|
},
|
|
5678
6330
|
get children() {
|
|
5679
|
-
var _el$
|
|
5680
|
-
insert(_el$
|
|
5681
|
-
effect((_$p) => setProp(_el$
|
|
5682
|
-
return _el$
|
|
6331
|
+
var _el$46 = createElement("text");
|
|
6332
|
+
insert(_el$46, () => `\u2026 +${view().runningHidden} rodando`);
|
|
6333
|
+
effect((_$p) => setProp(_el$46, "fg", muted(), _$p));
|
|
6334
|
+
return _el$46;
|
|
5683
6335
|
}
|
|
5684
6336
|
}), null);
|
|
5685
|
-
insert(_el$
|
|
6337
|
+
insert(_el$45, createComponent(Show, {
|
|
5686
6338
|
get when() {
|
|
5687
6339
|
return view().summary;
|
|
5688
6340
|
},
|
|
5689
6341
|
children: (line) => (() => {
|
|
5690
|
-
var _el$
|
|
5691
|
-
insertNode(_el$
|
|
5692
|
-
setProp(_el$
|
|
5693
|
-
setProp(_el$
|
|
5694
|
-
insert(_el$
|
|
5695
|
-
insert(_el$
|
|
6342
|
+
var _el$49 = createElement("box"), _el$50 = createElement("text");
|
|
6343
|
+
insertNode(_el$49, _el$50);
|
|
6344
|
+
setProp(_el$49, "flexDirection", "row");
|
|
6345
|
+
setProp(_el$49, "flexShrink", 0);
|
|
6346
|
+
insert(_el$50, line);
|
|
6347
|
+
insert(_el$49, createComponent(Show, {
|
|
5696
6348
|
get when() {
|
|
5697
6349
|
return failedSuffix();
|
|
5698
6350
|
},
|
|
5699
6351
|
children: (suffix) => (() => {
|
|
5700
|
-
var _el$
|
|
5701
|
-
insert(_el$
|
|
5702
|
-
effect((_$p) => setProp(_el$
|
|
5703
|
-
return _el$
|
|
6352
|
+
var _el$51 = createElement("text");
|
|
6353
|
+
insert(_el$51, () => `${SPEND_LINE_SEPARATOR}${suffix()}`);
|
|
6354
|
+
effect((_$p) => setProp(_el$51, "fg", tone("error"), _$p));
|
|
6355
|
+
return _el$51;
|
|
5704
6356
|
})()
|
|
5705
6357
|
}), null);
|
|
5706
|
-
effect((_$p) => setProp(_el$
|
|
5707
|
-
return _el$
|
|
6358
|
+
effect((_$p) => setProp(_el$50, "fg", muted(), _$p));
|
|
6359
|
+
return _el$49;
|
|
5708
6360
|
})()
|
|
5709
6361
|
}), null);
|
|
5710
|
-
insert(_el$
|
|
6362
|
+
insert(_el$45, createComponent(For, {
|
|
5711
6363
|
get each() {
|
|
5712
6364
|
return view().agents;
|
|
5713
6365
|
},
|
|
5714
6366
|
children: (row) => (() => {
|
|
5715
|
-
var _el$
|
|
5716
|
-
insert(_el$
|
|
5717
|
-
effect((_$p) => setProp(_el$
|
|
5718
|
-
return _el$
|
|
6367
|
+
var _el$52 = createElement("text");
|
|
6368
|
+
insert(_el$52, () => childAgentRowText(row));
|
|
6369
|
+
effect((_$p) => setProp(_el$52, "fg", muted(), _$p));
|
|
6370
|
+
return _el$52;
|
|
5719
6371
|
})()
|
|
5720
6372
|
}), null);
|
|
5721
|
-
insert(_el$
|
|
6373
|
+
insert(_el$45, createComponent(Show, {
|
|
5722
6374
|
get when() {
|
|
5723
6375
|
return hiddenChildAgentsText(view().agentsHidden, view().agentsHiddenCost);
|
|
5724
6376
|
},
|
|
5725
6377
|
children: (line) => (() => {
|
|
5726
|
-
var _el$
|
|
5727
|
-
insert(_el$
|
|
5728
|
-
effect((_$p) => setProp(_el$
|
|
5729
|
-
return _el$
|
|
6378
|
+
var _el$53 = createElement("text");
|
|
6379
|
+
insert(_el$53, line);
|
|
6380
|
+
effect((_$p) => setProp(_el$53, "fg", muted(), _$p));
|
|
6381
|
+
return _el$53;
|
|
5730
6382
|
})()
|
|
5731
6383
|
}), null);
|
|
5732
|
-
return _el$
|
|
6384
|
+
return _el$45;
|
|
5733
6385
|
})()
|
|
5734
6386
|
}), null);
|
|
5735
6387
|
return _el$23;
|
|
5736
6388
|
}
|
|
5737
6389
|
}), null);
|
|
5738
|
-
effect((_p$) => {
|
|
5739
|
-
var _v$3 = text(), _v$4 = muted();
|
|
5740
|
-
_v$3 !== _p$.e && (_p$.e = setProp(_el$13, "fg", _v$3, _p$.e));
|
|
5741
|
-
_v$4 !== _p$.t && (_p$.t = setProp(_el$14, "fg", _v$4, _p$.t));
|
|
5742
|
-
return _p$;
|
|
5743
|
-
}, {
|
|
5744
|
-
e: void 0,
|
|
5745
|
-
t: void 0
|
|
5746
|
-
});
|
|
5747
6390
|
return _el$12;
|
|
5748
6391
|
})();
|
|
5749
6392
|
}
|
|
@@ -5813,25 +6456,25 @@ function DispatchPanel(props) {
|
|
|
5813
6456
|
return model.visible().rows;
|
|
5814
6457
|
},
|
|
5815
6458
|
children: (row) => (() => {
|
|
5816
|
-
var _el$
|
|
5817
|
-
insertNode(_el$
|
|
5818
|
-
insertNode(_el$
|
|
5819
|
-
setProp(_el$
|
|
5820
|
-
setProp(_el$
|
|
5821
|
-
insert(_el$
|
|
5822
|
-
insert(_el$
|
|
6459
|
+
var _el$54 = createElement("box"), _el$55 = createElement("text"), _el$56 = createElement("text");
|
|
6460
|
+
insertNode(_el$54, _el$55);
|
|
6461
|
+
insertNode(_el$54, _el$56);
|
|
6462
|
+
setProp(_el$54, "flexDirection", "row");
|
|
6463
|
+
setProp(_el$54, "flexShrink", 0);
|
|
6464
|
+
insert(_el$55, () => selected(row.id) ? `▸ ` : " ");
|
|
6465
|
+
insert(_el$56, () => row.text);
|
|
5823
6466
|
effect((_p$) => {
|
|
5824
|
-
var _v$
|
|
5825
|
-
_v$
|
|
5826
|
-
_v$
|
|
5827
|
-
_v$
|
|
6467
|
+
var _v$7 = selected(row.id) ? text() : muted(), _v$8 = rowFg(row.state), _v$9 = selected(row.id) ? 1 : 0;
|
|
6468
|
+
_v$7 !== _p$.e && (_p$.e = setProp(_el$55, "fg", _v$7, _p$.e));
|
|
6469
|
+
_v$8 !== _p$.t && (_p$.t = setProp(_el$56, "fg", _v$8, _p$.t));
|
|
6470
|
+
_v$9 !== _p$.a && (_p$.a = setProp(_el$56, "attributes", _v$9, _p$.a));
|
|
5828
6471
|
return _p$;
|
|
5829
6472
|
}, {
|
|
5830
6473
|
e: void 0,
|
|
5831
6474
|
t: void 0,
|
|
5832
6475
|
a: void 0
|
|
5833
6476
|
});
|
|
5834
|
-
return _el$
|
|
6477
|
+
return _el$54;
|
|
5835
6478
|
})()
|
|
5836
6479
|
});
|
|
5837
6480
|
const detail = () => createComponent(For, {
|
|
@@ -5839,28 +6482,28 @@ function DispatchPanel(props) {
|
|
|
5839
6482
|
return model.detail();
|
|
5840
6483
|
},
|
|
5841
6484
|
children: (line, index) => (() => {
|
|
5842
|
-
var _el$
|
|
5843
|
-
insert(_el$
|
|
5844
|
-
effect((_$p) => setProp(_el$
|
|
5845
|
-
return _el$
|
|
6485
|
+
var _el$57 = createElement("text");
|
|
6486
|
+
insert(_el$57, line);
|
|
6487
|
+
effect((_$p) => setProp(_el$57, "fg", index() === 0 ? text() : muted(), _$p));
|
|
6488
|
+
return _el$57;
|
|
5846
6489
|
})()
|
|
5847
6490
|
});
|
|
5848
6491
|
const empty = () => (() => {
|
|
5849
|
-
var _el$
|
|
5850
|
-
insertNode(_el$
|
|
5851
|
-
effect((_$p) => setProp(_el$
|
|
5852
|
-
return _el$
|
|
6492
|
+
var _el$58 = createElement("text");
|
|
6493
|
+
insertNode(_el$58, createTextNode(`Nenhuma sessão delegada`));
|
|
6494
|
+
effect((_$p) => setProp(_el$58, "fg", muted(), _$p));
|
|
6495
|
+
return _el$58;
|
|
5853
6496
|
})();
|
|
5854
6497
|
return (() => {
|
|
5855
|
-
var _el$
|
|
5856
|
-
insertNode(_el$
|
|
5857
|
-
insertNode(_el$
|
|
5858
|
-
insertNode(_el$
|
|
5859
|
-
insertNode(_el$
|
|
5860
|
-
setProp(_el$
|
|
5861
|
-
setProp(_el$
|
|
5862
|
-
setProp(_el$
|
|
5863
|
-
insert(_el$
|
|
6498
|
+
var _el$60 = createElement("box"), _el$61 = createElement("text"), _el$62 = createElement("text"), _el$66 = createElement("box"), _el$67 = createElement("text");
|
|
6499
|
+
insertNode(_el$60, _el$61);
|
|
6500
|
+
insertNode(_el$60, _el$62);
|
|
6501
|
+
insertNode(_el$60, _el$66);
|
|
6502
|
+
insertNode(_el$60, _el$67);
|
|
6503
|
+
setProp(_el$60, "flexDirection", "column");
|
|
6504
|
+
setProp(_el$60, "width", "100%");
|
|
6505
|
+
setProp(_el$60, "padding", 1);
|
|
6506
|
+
insert(_el$60, createComponent(DispatchPanelKeymap, {
|
|
5864
6507
|
get context() {
|
|
5865
6508
|
return props.context;
|
|
5866
6509
|
},
|
|
@@ -5868,30 +6511,30 @@ function DispatchPanel(props) {
|
|
|
5868
6511
|
return props.panel;
|
|
5869
6512
|
},
|
|
5870
6513
|
model
|
|
5871
|
-
}), _el$
|
|
5872
|
-
setProp(_el$
|
|
5873
|
-
insert(_el$
|
|
5874
|
-
insert(_el$
|
|
6514
|
+
}), _el$61);
|
|
6515
|
+
setProp(_el$61, "attributes", 1);
|
|
6516
|
+
insert(_el$61, () => model.title());
|
|
6517
|
+
insert(_el$60, createComponent(Show, {
|
|
5875
6518
|
get when() {
|
|
5876
6519
|
return model.header();
|
|
5877
6520
|
},
|
|
5878
6521
|
children: (line) => (() => {
|
|
5879
|
-
var _el$
|
|
5880
|
-
insert(_el$
|
|
5881
|
-
effect((_$p) => setProp(_el$
|
|
5882
|
-
return _el$
|
|
6522
|
+
var _el$68 = createElement("text");
|
|
6523
|
+
insert(_el$68, line);
|
|
6524
|
+
effect((_$p) => setProp(_el$68, "fg", muted(), _$p));
|
|
6525
|
+
return _el$68;
|
|
5883
6526
|
})()
|
|
5884
|
-
}), _el$
|
|
5885
|
-
insert(_el$
|
|
5886
|
-
insert(_el$
|
|
6527
|
+
}), _el$62);
|
|
6528
|
+
insert(_el$62, () => dispatchPanelRule(props.panel.width - 2));
|
|
6529
|
+
insert(_el$60, createComponent(Show, {
|
|
5887
6530
|
get when() {
|
|
5888
6531
|
return model.layout().mode === "wide";
|
|
5889
6532
|
},
|
|
5890
6533
|
get fallback() {
|
|
5891
6534
|
return (() => {
|
|
5892
|
-
var _el$
|
|
5893
|
-
setProp(_el$
|
|
5894
|
-
insert(_el$
|
|
6535
|
+
var _el$69 = createElement("box");
|
|
6536
|
+
setProp(_el$69, "flexDirection", "column");
|
|
6537
|
+
insert(_el$69, createComponent(Show, {
|
|
5895
6538
|
get when() {
|
|
5896
6539
|
return model.rows().length > 0;
|
|
5897
6540
|
},
|
|
@@ -5899,34 +6542,34 @@ function DispatchPanel(props) {
|
|
|
5899
6542
|
return empty();
|
|
5900
6543
|
},
|
|
5901
6544
|
get children() {
|
|
5902
|
-
var _el$
|
|
5903
|
-
setProp(_el$
|
|
5904
|
-
insert(_el$
|
|
5905
|
-
return _el$
|
|
6545
|
+
var _el$70 = createElement("box");
|
|
6546
|
+
setProp(_el$70, "flexDirection", "column");
|
|
6547
|
+
insert(_el$70, rows);
|
|
6548
|
+
return _el$70;
|
|
5906
6549
|
}
|
|
5907
6550
|
}), null);
|
|
5908
|
-
insert(_el$
|
|
6551
|
+
insert(_el$69, createComponent(Show, {
|
|
5909
6552
|
get when() {
|
|
5910
6553
|
return model.selectedID();
|
|
5911
6554
|
},
|
|
5912
6555
|
get children() {
|
|
5913
|
-
var _el$
|
|
5914
|
-
insertNode(_el$
|
|
5915
|
-
setProp(_el$
|
|
5916
|
-
setProp(_el$
|
|
5917
|
-
insert(_el$
|
|
5918
|
-
return _el$
|
|
6556
|
+
var _el$71 = createElement("box"), _el$72 = createElement("box");
|
|
6557
|
+
insertNode(_el$71, _el$72);
|
|
6558
|
+
setProp(_el$71, "flexDirection", "column");
|
|
6559
|
+
setProp(_el$72, "height", 1);
|
|
6560
|
+
insert(_el$71, detail, null);
|
|
6561
|
+
return _el$71;
|
|
5919
6562
|
}
|
|
5920
6563
|
}), null);
|
|
5921
|
-
return _el$
|
|
6564
|
+
return _el$69;
|
|
5922
6565
|
})();
|
|
5923
6566
|
},
|
|
5924
6567
|
get children() {
|
|
5925
|
-
var _el$
|
|
5926
|
-
insertNode(_el$
|
|
5927
|
-
setProp(_el$
|
|
5928
|
-
setProp(_el$
|
|
5929
|
-
insert(_el$
|
|
6568
|
+
var _el$63 = createElement("box"), _el$64 = createElement("box");
|
|
6569
|
+
insertNode(_el$63, _el$64);
|
|
6570
|
+
setProp(_el$63, "flexDirection", "row");
|
|
6571
|
+
setProp(_el$64, "flexDirection", "column");
|
|
6572
|
+
insert(_el$64, createComponent(Show, {
|
|
5930
6573
|
get when() {
|
|
5931
6574
|
return model.rows().length > 0;
|
|
5932
6575
|
},
|
|
@@ -5937,36 +6580,36 @@ function DispatchPanel(props) {
|
|
|
5937
6580
|
return rows();
|
|
5938
6581
|
}
|
|
5939
6582
|
}));
|
|
5940
|
-
insert(_el$
|
|
6583
|
+
insert(_el$63, createComponent(Show, {
|
|
5941
6584
|
get when() {
|
|
5942
6585
|
return model.selectedID();
|
|
5943
6586
|
},
|
|
5944
6587
|
get children() {
|
|
5945
|
-
var _el$
|
|
5946
|
-
setProp(_el$
|
|
5947
|
-
insert(_el$
|
|
5948
|
-
effect((_$p) => setProp(_el$
|
|
5949
|
-
return _el$
|
|
6588
|
+
var _el$65 = createElement("box");
|
|
6589
|
+
setProp(_el$65, "flexDirection", "column");
|
|
6590
|
+
insert(_el$65, detail);
|
|
6591
|
+
effect((_$p) => setProp(_el$65, "width", model.layout().detailWidth, _$p));
|
|
6592
|
+
return _el$65;
|
|
5950
6593
|
}
|
|
5951
6594
|
}), null);
|
|
5952
|
-
effect((_$p) => setProp(_el$
|
|
5953
|
-
return _el$
|
|
6595
|
+
effect((_$p) => setProp(_el$64, "width", model.layout().listWidth, _$p));
|
|
6596
|
+
return _el$63;
|
|
5954
6597
|
}
|
|
5955
|
-
}), _el$
|
|
5956
|
-
setProp(_el$
|
|
5957
|
-
insert(_el$
|
|
6598
|
+
}), _el$66);
|
|
6599
|
+
setProp(_el$66, "height", 1);
|
|
6600
|
+
insert(_el$67, () => model.footer());
|
|
5958
6601
|
effect((_p$) => {
|
|
5959
|
-
var _v$
|
|
5960
|
-
_v$
|
|
5961
|
-
_v$
|
|
5962
|
-
_v$
|
|
6602
|
+
var _v$0 = text(), _v$1 = muted(), _v$10 = muted();
|
|
6603
|
+
_v$0 !== _p$.e && (_p$.e = setProp(_el$61, "fg", _v$0, _p$.e));
|
|
6604
|
+
_v$1 !== _p$.t && (_p$.t = setProp(_el$62, "fg", _v$1, _p$.t));
|
|
6605
|
+
_v$10 !== _p$.a && (_p$.a = setProp(_el$67, "fg", _v$10, _p$.a));
|
|
5963
6606
|
return _p$;
|
|
5964
6607
|
}, {
|
|
5965
6608
|
e: void 0,
|
|
5966
6609
|
t: void 0,
|
|
5967
6610
|
a: void 0
|
|
5968
6611
|
});
|
|
5969
|
-
return _el$
|
|
6612
|
+
return _el$60;
|
|
5970
6613
|
})();
|
|
5971
6614
|
}
|
|
5972
6615
|
/** App-level command claim: the only way into the panel. It registers the
|
|
@@ -6018,12 +6661,17 @@ function PantheonSettingsCommandLayer(props) {
|
|
|
6018
6661
|
function HomeStatus(props) {
|
|
6019
6662
|
const preset = useActivePreset(props.context).preset;
|
|
6020
6663
|
const muted = () => props.context.theme?.text?.muted ?? props.context.theme?.text?.base;
|
|
6021
|
-
return (
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6664
|
+
return createComponent(Show, {
|
|
6665
|
+
get when() {
|
|
6666
|
+
return tuiPrefs().footer.home;
|
|
6667
|
+
},
|
|
6668
|
+
get children() {
|
|
6669
|
+
var _el$73 = createElement("text");
|
|
6670
|
+
insert(_el$73, () => `Pantheon v2.0.0-beta.6${preset().name ? ` ▸ ${preset().name}` : ""}`);
|
|
6671
|
+
effect((_$p) => setProp(_el$73, "fg", muted(), _$p));
|
|
6672
|
+
return _el$73;
|
|
6673
|
+
}
|
|
6674
|
+
});
|
|
6027
6675
|
}
|
|
6028
6676
|
/** Lean footer model: only the preset label and the live delegation count. It
|
|
6029
6677
|
* deliberately does not reuse `createSidebarModel` — that model owns the
|
|
@@ -6074,13 +6722,13 @@ function PromptFooter(props) {
|
|
|
6074
6722
|
const muted = () => props.context.theme?.text?.muted ?? props.context.theme?.text?.base;
|
|
6075
6723
|
return createComponent(Show, {
|
|
6076
6724
|
get when() {
|
|
6077
|
-
return model.running() > 0;
|
|
6725
|
+
return memo(() => !!tuiPrefs().footer.prompt)() && model.running() > 0;
|
|
6078
6726
|
},
|
|
6079
6727
|
get children() {
|
|
6080
|
-
var _el$
|
|
6081
|
-
insert(_el$
|
|
6082
|
-
effect((_$p) => setProp(_el$
|
|
6083
|
-
return _el$
|
|
6728
|
+
var _el$74 = createElement("text");
|
|
6729
|
+
insert(_el$74, () => `▸${model.preset().name ?? "default"} · ✦${model.running()} ativos`);
|
|
6730
|
+
effect((_$p) => setProp(_el$74, "fg", muted(), _$p));
|
|
6731
|
+
return _el$74;
|
|
6084
6732
|
}
|
|
6085
6733
|
});
|
|
6086
6734
|
}
|
|
@@ -6090,6 +6738,7 @@ const plugin = Plugin.define({
|
|
|
6090
6738
|
const globalState = globalThis;
|
|
6091
6739
|
if (globalState[SINGLETON]) return;
|
|
6092
6740
|
globalState[SINGLETON] = true;
|
|
6741
|
+
initTuiPrefs(context);
|
|
6093
6742
|
warmUpSidebarData(context, resolveLocation(context));
|
|
6094
6743
|
const unregisterSidebar = context.ui.slot({
|
|
6095
6744
|
append: "sidebar.content",
|