pantheon-opencode 2.0.0-beta.5 → 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 +22 -0
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/pyproject.toml +1 -1
- package/scripts/install/opencode.mjs +13 -1
- package/scripts/skill-search.mjs +39 -4
- 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.js +495 -83
- 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/pantheon-settings.tsx +278 -24
- 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
|
}
|
|
@@ -1067,7 +1286,28 @@ function buildUpdatesTab(input) {
|
|
|
1067
1286
|
* report beta.2: navigation "stopped working" was exactly that theft).
|
|
1068
1287
|
*/
|
|
1069
1288
|
const ROUTE_NAME = "pantheon-settings";
|
|
1289
|
+
/** The input mode the page pushes while mounted (composer layers sleep). */
|
|
1290
|
+
const ROUTE_MODE = "pantheon-settings";
|
|
1070
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
|
+
}
|
|
1071
1311
|
const [blocking, setBlocking] = createSignal(false);
|
|
1072
1312
|
/** True while a Pantheon settings surface (page or fallback dialog) is open. */
|
|
1073
1313
|
function pantheonSettingsBlocking() {
|
|
@@ -1111,6 +1351,68 @@ function readOverridesLoad() {
|
|
|
1111
1351
|
function writeOverridesToDisk(load) {
|
|
1112
1352
|
writeFileSync(globalOverridesPath(), serializeOverrides(load.global), "utf8");
|
|
1113
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
|
+
}
|
|
1114
1416
|
function updateCheckStatePath() {
|
|
1115
1417
|
const stateDir = process.env.XDG_STATE_HOME ?? join(process.env.HOME ?? "", ".local", "state");
|
|
1116
1418
|
return join(stateDir, "pantheon", "update-check.json");
|
|
@@ -1141,29 +1443,27 @@ function persistUpdateCheckState(previous, latest) {
|
|
|
1141
1443
|
} catch {}
|
|
1142
1444
|
}
|
|
1143
1445
|
function resolveRunningVersion$1() {
|
|
1144
|
-
|
|
1145
|
-
return JSON.parse(readFileSync(new URL("../../package.json", import.meta.url), "utf8")).version ?? "unknown";
|
|
1146
|
-
} catch {
|
|
1147
|
-
return "unknown";
|
|
1148
|
-
}
|
|
1446
|
+
return "2.0.0-beta.6";
|
|
1149
1447
|
}
|
|
1150
1448
|
const VALUE_WIDTH = 22;
|
|
1151
1449
|
function SettingsWindow(props) {
|
|
1152
1450
|
const tab = () => props.tabs()[props.page()] ?? props.tabs()[0] ?? EMPTY_TAB;
|
|
1153
1451
|
const rows = () => tabRows(tab());
|
|
1154
1452
|
return (() => {
|
|
1155
|
-
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");
|
|
1156
1454
|
insertNode(_el$, _el$2);
|
|
1157
|
-
insertNode(_el$, _el$
|
|
1158
|
-
insertNode(_el$, _el$9);
|
|
1455
|
+
insertNode(_el$, _el$7);
|
|
1159
1456
|
insertNode(_el$, _el$0);
|
|
1457
|
+
insertNode(_el$, _el$1);
|
|
1160
1458
|
setProp(_el$, "flexDirection", "column");
|
|
1161
1459
|
setProp(_el$, "paddingLeft", 1);
|
|
1162
1460
|
setProp(_el$, "paddingRight", 1);
|
|
1163
1461
|
setProp(_el$, "paddingTop", 1);
|
|
1164
1462
|
insertNode(_el$2, _el$3);
|
|
1165
1463
|
insertNode(_el$2, _el$4);
|
|
1464
|
+
insertNode(_el$2, _el$5);
|
|
1166
1465
|
setProp(_el$2, "flexDirection", "row");
|
|
1466
|
+
setProp(_el$3, "flexShrink", 0);
|
|
1167
1467
|
setProp(_el$3, "attributes", 1);
|
|
1168
1468
|
insert(_el$3, () => `Pantheon v${props.version}`);
|
|
1169
1469
|
insert(_el$2, createComponent(For, {
|
|
@@ -1171,37 +1471,40 @@ function SettingsWindow(props) {
|
|
|
1171
1471
|
return props.tabs();
|
|
1172
1472
|
},
|
|
1173
1473
|
children: (t, index) => (() => {
|
|
1174
|
-
var _el$
|
|
1175
|
-
|
|
1474
|
+
var _el$11 = createElement("text");
|
|
1475
|
+
setProp(_el$11, "flexShrink", 0);
|
|
1476
|
+
spread(_el$11, mergeProps({ get fg() {
|
|
1176
1477
|
return memo(() => index() === props.page())() ? props.fg : props.muted;
|
|
1177
1478
|
} }, () => index() === props.page() ? { attributes: 1 } : {}), true);
|
|
1178
|
-
insert(_el$
|
|
1179
|
-
return _el$
|
|
1479
|
+
insert(_el$11, () => ` ${t.title}${tabDirty(props.draft(), t) ? " ●" : ""}`);
|
|
1480
|
+
return _el$11;
|
|
1180
1481
|
})()
|
|
1181
1482
|
}), _el$4);
|
|
1182
|
-
|
|
1183
|
-
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(`────────────────────────────────────────────────────────────────────────`));
|
|
1184
1487
|
insert(_el$, createComponent(For, {
|
|
1185
1488
|
get each() {
|
|
1186
1489
|
return tab().groups;
|
|
1187
1490
|
},
|
|
1188
1491
|
children: (group) => (() => {
|
|
1189
|
-
var _el$
|
|
1190
|
-
insertNode(_el$
|
|
1191
|
-
setProp(_el$
|
|
1192
|
-
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, {
|
|
1193
1496
|
get when() {
|
|
1194
1497
|
return group.title !== void 0;
|
|
1195
1498
|
},
|
|
1196
1499
|
get children() {
|
|
1197
|
-
var _el$
|
|
1198
|
-
setProp(_el$
|
|
1199
|
-
insert(_el$
|
|
1200
|
-
effect((_$p) => setProp(_el$
|
|
1201
|
-
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;
|
|
1202
1505
|
}
|
|
1203
|
-
}), _el$
|
|
1204
|
-
insert(_el$
|
|
1506
|
+
}), _el$14);
|
|
1507
|
+
insert(_el$12, createComponent(For, {
|
|
1205
1508
|
get each() {
|
|
1206
1509
|
return group.rows;
|
|
1207
1510
|
},
|
|
@@ -1212,67 +1515,70 @@ function SettingsWindow(props) {
|
|
|
1212
1515
|
const gutter = () => isSelected() ? "▸ " : " ";
|
|
1213
1516
|
const valueCell = () => row.cycle !== void 0 ? `< ${display()} >` : display();
|
|
1214
1517
|
return (() => {
|
|
1215
|
-
var _el$
|
|
1216
|
-
insertNode(_el$14, _el$15);
|
|
1217
|
-
insertNode(_el$14, _el$17);
|
|
1218
|
-
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");
|
|
1219
1519
|
insertNode(_el$15, _el$16);
|
|
1220
|
-
|
|
1221
|
-
|
|
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() {
|
|
1222
1525
|
return props.fg;
|
|
1223
1526
|
} }, () => isSelected() ? { attributes: 1 } : {}), true);
|
|
1224
|
-
insert(_el$
|
|
1225
|
-
insertNode(_el$
|
|
1226
|
-
setProp(_el$
|
|
1227
|
-
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() {
|
|
1228
1531
|
return memo(() => !!(isSelected() || staged()))() ? props.fg : props.muted;
|
|
1229
1532
|
} }, () => isSelected() ? { attributes: 1 } : {}), true);
|
|
1230
|
-
insert(_el$
|
|
1231
|
-
insert(_el$
|
|
1533
|
+
insert(_el$19, () => `${valueCell()}${staged() ? " ●" : ""}`.padEnd(VALUE_WIDTH));
|
|
1534
|
+
insert(_el$15, createComponent(Show, {
|
|
1232
1535
|
get when() {
|
|
1233
1536
|
return row.note !== void 0;
|
|
1234
1537
|
},
|
|
1235
1538
|
get children() {
|
|
1236
|
-
var _el$
|
|
1237
|
-
insertNode(_el$
|
|
1238
|
-
setProp(_el$
|
|
1239
|
-
setProp(_el$
|
|
1240
|
-
insert(_el$
|
|
1241
|
-
effect((_$p) => setProp(_el$
|
|
1242
|
-
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;
|
|
1243
1546
|
}
|
|
1244
1547
|
}), null);
|
|
1245
|
-
return _el$
|
|
1548
|
+
return _el$15;
|
|
1246
1549
|
})();
|
|
1247
1550
|
}
|
|
1248
|
-
}), _el$
|
|
1249
|
-
setProp(_el$
|
|
1250
|
-
return _el$
|
|
1551
|
+
}), _el$14);
|
|
1552
|
+
setProp(_el$14, "height", 1);
|
|
1553
|
+
return _el$12;
|
|
1251
1554
|
})()
|
|
1252
|
-
}), _el$
|
|
1555
|
+
}), _el$0);
|
|
1253
1556
|
insert(_el$, createComponent(Show, {
|
|
1254
1557
|
get when() {
|
|
1255
1558
|
return props.notice() !== void 0;
|
|
1256
1559
|
},
|
|
1257
1560
|
get children() {
|
|
1258
|
-
var _el$
|
|
1259
|
-
insert(_el$
|
|
1260
|
-
|
|
1261
|
-
|
|
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;
|
|
1262
1568
|
}
|
|
1263
|
-
}), _el$
|
|
1264
|
-
insert(_el$
|
|
1265
|
-
var _c$ = memo(() => !!draftDirty(props.draft()));
|
|
1266
|
-
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";
|
|
1267
1573
|
})());
|
|
1268
|
-
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`));
|
|
1269
1575
|
effect((_p$) => {
|
|
1270
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;
|
|
1271
1577
|
_v$ !== _p$.e && (_p$.e = setProp(_el$3, "fg", _v$, _p$.e));
|
|
1272
|
-
_v$2 !== _p$.t && (_p$.t = setProp(_el$
|
|
1273
|
-
_v$3 !== _p$.a && (_p$.a = setProp(_el$
|
|
1274
|
-
_v$4 !== _p$.o && (_p$.o = setProp(_el$
|
|
1275
|
-
_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));
|
|
1276
1582
|
return _p$;
|
|
1277
1583
|
}, {
|
|
1278
1584
|
e: void 0,
|
|
@@ -1290,6 +1596,9 @@ function createWindowController(context, exit) {
|
|
|
1290
1596
|
const [selected, setSelected] = createSignal(0);
|
|
1291
1597
|
const [load, setLoad] = createSignal(readOverridesLoad());
|
|
1292
1598
|
const [decision, setDecision] = createSignal(readDecisionRouterConfig());
|
|
1599
|
+
const [goalLoop, setGoalLoop] = createSignal(readGoalLoopPrefs());
|
|
1600
|
+
const [budgets, setBudgets] = createSignal(readDecisionBudgets());
|
|
1601
|
+
const [autonomyRestartPending, setAutonomyRestartPending] = createSignal(false);
|
|
1293
1602
|
const [presetTick, setPresetTick] = createSignal(0);
|
|
1294
1603
|
const [lastChecked, setLastChecked] = createSignal(void 0);
|
|
1295
1604
|
const [checking, setChecking] = createSignal(false);
|
|
@@ -1319,6 +1628,11 @@ function createWindowController(context, exit) {
|
|
|
1319
1628
|
buildDecisionTab(decision()),
|
|
1320
1629
|
buildPresetTab(presetInput()),
|
|
1321
1630
|
buildTuiTab(tuiPrefs()),
|
|
1631
|
+
buildAutonomyTab({
|
|
1632
|
+
goalLoop: goalLoop(),
|
|
1633
|
+
budgets: budgets(),
|
|
1634
|
+
goalLoopRestartPending: autonomyRestartPending()
|
|
1635
|
+
}),
|
|
1322
1636
|
buildJ1Tab(process.env, false),
|
|
1323
1637
|
buildUpdatesTab(updatesInput()),
|
|
1324
1638
|
buildDoctorTab({
|
|
@@ -1400,6 +1714,31 @@ function createWindowController(context, exit) {
|
|
|
1400
1714
|
};
|
|
1401
1715
|
}
|
|
1402
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
|
+
}
|
|
1403
1742
|
if (id === "preset") try {
|
|
1404
1743
|
if (value === "none") clearActivePreset(globalActivePresetPath());
|
|
1405
1744
|
else writeActivePreset(globalActivePresetPath(), value);
|
|
@@ -1411,6 +1750,56 @@ function createWindowController(context, exit) {
|
|
|
1411
1750
|
reason: error instanceof Error ? error.message : "preset marker write failed"
|
|
1412
1751
|
};
|
|
1413
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
|
+
}
|
|
1414
1803
|
if (id.startsWith("tui.")) try {
|
|
1415
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"));
|
|
1416
1805
|
return { ok: true };
|
|
@@ -1452,16 +1841,15 @@ function createWindowController(context, exit) {
|
|
|
1452
1841
|
setSelected(0);
|
|
1453
1842
|
};
|
|
1454
1843
|
const close = () => {
|
|
1455
|
-
|
|
1844
|
+
const staged = draftCount(draft());
|
|
1845
|
+
if (staged > 0) {
|
|
1846
|
+
setDraft({});
|
|
1456
1847
|
try {
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
message:
|
|
1460
|
-
})).then((confirmed) => {
|
|
1461
|
-
if (confirmed === true) exit();
|
|
1848
|
+
context.ui.toast?.show?.({
|
|
1849
|
+
variant: "info",
|
|
1850
|
+
message: `settings: ${staged} staged change${staged === 1 ? "" : "s"} discarded`
|
|
1462
1851
|
});
|
|
1463
1852
|
} catch {}
|
|
1464
|
-
return;
|
|
1465
1853
|
}
|
|
1466
1854
|
exit();
|
|
1467
1855
|
};
|
|
@@ -1501,6 +1889,10 @@ function SettingsPage(props) {
|
|
|
1501
1889
|
const controller = createWindowController(context, () => navigateBack(context, returnRoute !== void 0 ? { returnRoute } : {}));
|
|
1502
1890
|
const theme = context.theme?.text ?? {};
|
|
1503
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 {}
|
|
1504
1896
|
onCleanup(controller.cleanup);
|
|
1505
1897
|
setBlocking(true);
|
|
1506
1898
|
pageApi = controller.api;
|
|
@@ -1534,7 +1926,12 @@ function SettingsPage(props) {
|
|
|
1534
1926
|
}
|
|
1535
1927
|
function navigateBack(context, data) {
|
|
1536
1928
|
try {
|
|
1537
|
-
|
|
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);
|
|
1538
1935
|
} catch {}
|
|
1539
1936
|
}
|
|
1540
1937
|
const [dialogOpen, setDialogOpen] = createSignal(false);
|
|
@@ -1617,7 +2014,22 @@ function setupPantheonSettings(context) {
|
|
|
1617
2014
|
title: "Close settings",
|
|
1618
2015
|
bind: "escape,q",
|
|
1619
2016
|
run: () => {
|
|
1620
|
-
|
|
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();
|
|
1621
2033
|
}
|
|
1622
2034
|
},
|
|
1623
2035
|
{
|
|
@@ -1695,7 +2107,7 @@ function setupPantheonSettings(context) {
|
|
|
1695
2107
|
];
|
|
1696
2108
|
try {
|
|
1697
2109
|
context.keymap.layer(() => ({
|
|
1698
|
-
mode:
|
|
2110
|
+
mode: ROUTE_MODE,
|
|
1699
2111
|
priority: 1,
|
|
1700
2112
|
enabled: () => routeGated(),
|
|
1701
2113
|
commands
|
|
@@ -1716,7 +2128,7 @@ async function openPantheonSettings(context) {
|
|
|
1716
2128
|
let returnRoute;
|
|
1717
2129
|
try {
|
|
1718
2130
|
const current = context.ui.router.current();
|
|
1719
|
-
if (!(current.type === "plugin" && current.name === "pantheon-settings")) returnRoute = current;
|
|
2131
|
+
if (!(current.type === "plugin" && current.name === "pantheon-settings")) returnRoute = plainRoute(current);
|
|
1720
2132
|
} catch {
|
|
1721
2133
|
returnRoute = void 0;
|
|
1722
2134
|
}
|
|
@@ -2039,7 +2451,7 @@ async function readChangelogForBundle(bundleUrl) {
|
|
|
2039
2451
|
}
|
|
2040
2452
|
/** The ambient build-time version, or null outside a tsdown build. */
|
|
2041
2453
|
function embeddedVersion() {
|
|
2042
|
-
return "2.0.0-beta.
|
|
2454
|
+
return "2.0.0-beta.6";
|
|
2043
2455
|
}
|
|
2044
2456
|
/**
|
|
2045
2457
|
* Resolve the running Pantheon version for the what's-new window: the plugin
|
|
@@ -4697,7 +5109,7 @@ async function checkForPantheonUpdate(context) {
|
|
|
4697
5109
|
const latest = String((await response.json())?.version ?? "");
|
|
4698
5110
|
if (!latest) return;
|
|
4699
5111
|
const notice = pickUpdateNotice({
|
|
4700
|
-
currentVersion: "2.0.0-beta.
|
|
5112
|
+
currentVersion: "2.0.0-beta.6",
|
|
4701
5113
|
latestVersion: latest,
|
|
4702
5114
|
state: readState(),
|
|
4703
5115
|
nowMs: Date.now()
|
|
@@ -5492,7 +5904,7 @@ function Sidebar(props) {
|
|
|
5492
5904
|
get children() {
|
|
5493
5905
|
var _el$13 = createElement("text");
|
|
5494
5906
|
setProp(_el$13, "attributes", 1);
|
|
5495
|
-
insert(_el$13, `Pantheon v2.0.0-beta.
|
|
5907
|
+
insert(_el$13, `Pantheon v2.0.0-beta.6`);
|
|
5496
5908
|
effect((_$p) => setProp(_el$13, "fg", text(), _$p));
|
|
5497
5909
|
return _el$13;
|
|
5498
5910
|
}
|
|
@@ -6255,7 +6667,7 @@ function HomeStatus(props) {
|
|
|
6255
6667
|
},
|
|
6256
6668
|
get children() {
|
|
6257
6669
|
var _el$73 = createElement("text");
|
|
6258
|
-
insert(_el$73, () => `Pantheon v2.0.0-beta.
|
|
6670
|
+
insert(_el$73, () => `Pantheon v2.0.0-beta.6${preset().name ? ` ▸ ${preset().name}` : ""}`);
|
|
6259
6671
|
effect((_$p) => setProp(_el$73, "fg", muted(), _$p));
|
|
6260
6672
|
return _el$73;
|
|
6261
6673
|
}
|