pantheon-opencode 1.6.3-beta.1 → 1.6.3-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.global.md +1 -1
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +81 -0
- package/README.md +20 -2
- package/bin/pantheon-init.mjs +15 -27
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/pyproject.toml +1 -1
- package/scripts/decision-router-budget.mjs +103 -4
- package/scripts/decision-router-v2-budget.mjs +2 -2
- package/scripts/decision-router-v2-egress.mjs +0 -2
- package/scripts/decision-router.mjs +88 -6
- package/scripts/install/decision-router-config.mjs +53 -2
- package/scripts/install/interactive.mjs +96 -11
- package/scripts/install/opencode.mjs +26 -0
- package/scripts/install/plugin.mjs +17 -0
- package/scripts/jev-live-probe.mjs +210 -0
- package/scripts/skill-search.mjs +242 -0
- package/scripts/sync-tui.mjs +11 -0
- package/src/agents/aphrodite.md +34 -1
- package/src/agents/apollo.md +227 -0
- package/src/agents/athena.md +24 -0
- package/src/agents/demeter.md +33 -0
- package/src/agents/gaia.md +24 -0
- package/src/agents/hephaestus.md +24 -0
- package/src/agents/hermes.md +33 -0
- package/src/agents/iris.md +24 -0
- package/src/agents/mnemosyne.md +25 -3
- package/src/agents/nyx.md +53 -22
- package/src/agents/prometheus.md +242 -1
- package/src/agents/talos.md +24 -0
- package/src/agents/themis.md +24 -0
- package/src/agents/zeus.md +46 -6
- package/src/pantheon/j-telemetry-file.ts +96 -0
- package/src/pantheon/jev-decision-tool.ts +160 -24
- package/src/pantheon/jev-decisions.ts +18 -3
- package/src/pantheon/jev-rank-verify.ts +435 -0
- package/src/pantheon/jev-risk-gate.ts +1 -0
- package/src/pantheon/local-decision-budget.ts +170 -5
- package/src/pantheon/local-decision-provider-matrix.ts +0 -1
- package/src/pantheon/local-decision-usage-evidence.internal.ts +2 -2
- package/src/pantheon/v2-decision-budget.ts +4 -2
- package/src/plugin-v2.ts +9 -2
- package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui-v2.js +457 -4
- package/src/plugins/tui/dist/tui-v2.js.map +1 -1
- package/src/plugins/tui/dist/tui.js +1 -1
- package/src/plugins/tui/package-lock.json +2 -2
- package/src/plugins/tui/package.json +1 -1
- package/src/plugins/tui/src/index-v2.tsx +6 -0
- package/src/plugins/tui/src/whats-new-highlights.ts +263 -0
- package/src/plugins/tui/src/whats-new-open.ts +80 -0
- package/src/plugins/tui/src/whats-new-state.ts +128 -0
- package/src/plugins/tui/src/whats-new.tsx +119 -0
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/** Providers that can appear in usage details: native Decisions routes. */
|
|
11
|
-
export type UsageProvider = 'typesafe-jev' | 'opencode-console' | '
|
|
11
|
+
export type UsageProvider = 'typesafe-jev' | 'opencode-console' | 'openrouter'
|
|
12
12
|
|
|
13
13
|
export interface ParsedUsageCounts {
|
|
14
14
|
provider: UsageProvider
|
|
@@ -47,7 +47,7 @@ const evidenceDetails = new WeakMap<object, VerifiedUsageEvidenceDetails>()
|
|
|
47
47
|
* absent: direct OpenAI has no native route, so it can never settle one.
|
|
48
48
|
*/
|
|
49
49
|
function isNativeUsageProvider(value: string): value is UsageProvider {
|
|
50
|
-
return value === 'typesafe-jev' || value === 'opencode-console' || value === '
|
|
50
|
+
return value === 'typesafe-jev' || value === 'opencode-console' || value === 'openrouter'
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/**
|
|
@@ -288,7 +288,9 @@ export function readDecisionBudgetLedgerFacts(dbPath: string): DecisionBudgetLed
|
|
|
288
288
|
.user_version
|
|
289
289
|
const applicationId = (db.prepare('PRAGMA application_id').get() as { application_id: number })
|
|
290
290
|
.application_id
|
|
291
|
-
|
|
291
|
+
// v4 adds the released_holds archive; the live tables this module reads
|
|
292
|
+
// are identical from v3 through v4.
|
|
293
|
+
if (applicationId !== EXPECTED_APPLICATION_ID || (version !== 3 && version !== 4)) {
|
|
292
294
|
return { present: true, readable: false, reason: 'unsupported-schema' }
|
|
293
295
|
}
|
|
294
296
|
const activeRow = db.prepare('SELECT active_period_utc FROM ledger_state WHERE id = 1').get() as
|
|
@@ -425,7 +427,7 @@ export function listDecisionHoldsReadOnly(dbPath: string): DecisionHoldRow[] | n
|
|
|
425
427
|
.application_id
|
|
426
428
|
const version = (db.prepare('PRAGMA user_version').get() as { user_version: number })
|
|
427
429
|
.user_version
|
|
428
|
-
if (applicationId !== EXPECTED_APPLICATION_ID || version !== 3) return null
|
|
430
|
+
if (applicationId !== EXPECTED_APPLICATION_ID || (version !== 3 && version !== 4)) return null
|
|
429
431
|
const rows = db
|
|
430
432
|
.prepare(
|
|
431
433
|
`SELECT id, provider, model, period_utc, reserved_micros, state
|
package/src/plugin-v2.ts
CHANGED
|
@@ -115,6 +115,7 @@ import {
|
|
|
115
115
|
} from './pantheon/delegation-enforce.ts'
|
|
116
116
|
import { GOAL_LOOP_DEFAULTS, GoalStore } from './pantheon/goal-loop.ts'
|
|
117
117
|
import { createGuardPathResolver } from './pantheon/guard-path.ts'
|
|
118
|
+
import { createJTelemetryMirror } from './pantheon/j-telemetry-file.ts'
|
|
118
119
|
import type { V2JevDecisionRuntime } from './pantheon/jev-decision-tool.ts'
|
|
119
120
|
import { specialistCallerAllowlist } from './pantheon/jev-decision-tool.ts'
|
|
120
121
|
import {
|
|
@@ -705,6 +706,7 @@ function buildV2JevRuntime(host: ReturnType<typeof hostDomains>): V2JevDecisionR
|
|
|
705
706
|
// it; the records are advisory and never read back by the tool path.
|
|
706
707
|
const j4Sink = createTelemetrySink()
|
|
707
708
|
j4TelemetrySink = j4Sink
|
|
709
|
+
const j4Mirror = createJTelemetryMirror({ enabled: true })
|
|
708
710
|
return {
|
|
709
711
|
specialistCallers,
|
|
710
712
|
// Every host method is invoked with its owning domain as receiver: the
|
|
@@ -718,7 +720,9 @@ function buildV2JevRuntime(host: ReturnType<typeof hostDomains>): V2JevDecisionR
|
|
|
718
720
|
listSkills: async () => skillList?.call(skillDomain),
|
|
719
721
|
...(permissionAssert === undefined ? {} : { permissionAssert }),
|
|
720
722
|
shadowSink: (record) => {
|
|
721
|
-
|
|
723
|
+
const shadowRecord = { ...record, mode: 'shadow' }
|
|
724
|
+
j4Sink.emit(shadowRecord)
|
|
725
|
+
j4Mirror?.record(shadowRecord)
|
|
722
726
|
},
|
|
723
727
|
}
|
|
724
728
|
}
|
|
@@ -2009,10 +2013,13 @@ async function registerV2ToolHooks(
|
|
|
2009
2013
|
if (jevRuntime !== undefined && j3EscalationEnabledFromEnv()) {
|
|
2010
2014
|
const j3Sink = createTelemetrySink()
|
|
2011
2015
|
j3TelemetrySink = j3Sink
|
|
2016
|
+
const j3Mirror = createJTelemetryMirror({ enabled: true })
|
|
2012
2017
|
j3Observer = createJ3EscalationObserver({
|
|
2013
2018
|
runtime: jevRuntime,
|
|
2014
2019
|
sink: (record) => {
|
|
2015
|
-
|
|
2020
|
+
const shadowRecord = { ...record, mode: 'shadow' }
|
|
2021
|
+
j3Sink.emit(shadowRecord)
|
|
2022
|
+
j3Mirror?.record(shadowRecord)
|
|
2016
2023
|
},
|
|
2017
2024
|
})
|
|
2018
2025
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tui-v2.d.ts","names":[],"sources":["../src/context-gauge.ts","../src/model-usage-limits.ts","../src/sidebar-width.ts","../src/index-v2.tsx"],"mappings":";;;;KAEY;qBAEC;qBACA;qBACA;wBAMG,iBAAiB,kBAAkB;wBAOnC,iBAAiB;wBAMjB,oBAAoB;wBAQpB,iBAAiB,iBAAiB;wBAOlC,WACd,oCACA;EACG;EAAgB;;wBAWL,YAAY;;;;qBCrDf;qBACA;qBACA;;;;;;;;wBCyHG,UAAU;;;;
|
|
1
|
+
{"version":3,"file":"tui-v2.d.ts","names":[],"sources":["../src/context-gauge.ts","../src/model-usage-limits.ts","../src/sidebar-width.ts","../src/index-v2.tsx"],"mappings":";;;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,KACL;;;;;;;wBAgBY,yBACd,OAAO,KAAK,uDACZ,OAAO,qBACN;;;;;YA6JS;EACV,QAAQ,SAAS;EACjB,SAAS;;wBAGK,kBAAkB,cAAc,sCAAsC;cA0DhF;;EAEW,MAAA,SAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { createComponent, createElement, createTextNode, effect, insert, insertNode, memo, setProp } from "@opentui/solid";
|
|
2
|
-
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { mkdir, readFile, rename, stat, unlink, writeFile } from "node:fs/promises";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
|
-
import { join } from "node:path";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
5
6
|
import { For, Show, createEffect, createMemo, createSignal, on, onCleanup, onMount } from "solid-js";
|
|
6
7
|
import { execFile } from "node:child_process";
|
|
7
8
|
import { Plugin } from "@opencode/plugin/tui";
|
|
@@ -179,6 +180,457 @@ function cellWidth(value) {
|
|
|
179
180
|
for (const { segment } of GRAPHEMES.segment(value)) width += graphemeWidth(segment);
|
|
180
181
|
return width;
|
|
181
182
|
}
|
|
183
|
+
/** Prefix of the "+N more" line appended when the bullet budget is exceeded. */
|
|
184
|
+
const WHATS_NEW_MORE_PREFIX = "… +";
|
|
185
|
+
const EMPTY_HIGHLIGHTS = {
|
|
186
|
+
version: null,
|
|
187
|
+
found: false,
|
|
188
|
+
groups: [],
|
|
189
|
+
totalItems: 0,
|
|
190
|
+
truncated: false
|
|
191
|
+
};
|
|
192
|
+
/** Escape regex metacharacters so a version like 1.0.0 matches literally. */
|
|
193
|
+
function escapeRegExp(text) {
|
|
194
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Extract the body of a version section from changelog text — inline replica
|
|
198
|
+
* of scripts/changelog-extract.mjs `extractSection` (see that file for the
|
|
199
|
+
* full contract: `## [<version>] - YYYY-MM-DD`, leading `v` and the date
|
|
200
|
+
* optional, `## [Unreleased]` never matched).
|
|
201
|
+
*/
|
|
202
|
+
function extractSection(changelogText, version) {
|
|
203
|
+
const normalized = String(version).trim().replace(/^v/i, "");
|
|
204
|
+
if (!normalized || /^unreleased$/i.test(normalized)) return {
|
|
205
|
+
found: false,
|
|
206
|
+
body: null
|
|
207
|
+
};
|
|
208
|
+
const escaped = escapeRegExp(normalized);
|
|
209
|
+
const match = new RegExp(`^##[ \\t]+\\[v?${escaped}\\](?:[ \\t]*-[ \\t]*\\d{4}-\\d{2}-\\d{2})?(?=[ \\t]|$)`, "m").exec(changelogText);
|
|
210
|
+
if (!match) return {
|
|
211
|
+
found: false,
|
|
212
|
+
body: null
|
|
213
|
+
};
|
|
214
|
+
const newline = changelogText.indexOf("\n", match.index);
|
|
215
|
+
const start = newline === -1 ? changelogText.length : newline + 1;
|
|
216
|
+
const nextHeading = /^##[ \t]+\[/m.exec(changelogText.slice(start));
|
|
217
|
+
const end = nextHeading ? start + nextHeading.index : changelogText.length;
|
|
218
|
+
return {
|
|
219
|
+
found: true,
|
|
220
|
+
body: changelogText.slice(start, end).trim()
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Reduce one markdown line to plain text: links keep their label, emphasis
|
|
225
|
+
* and inline-code markers are dropped, HTML comment fragments are removed,
|
|
226
|
+
* and whitespace collapses. Deliberately simple — the input is our own
|
|
227
|
+
* CHANGELOG (lint-capped at 200 chars per bullet), not hostile input.
|
|
228
|
+
*/
|
|
229
|
+
function stripMarkdown(text) {
|
|
230
|
+
return text.replace(/<!--[\s\S]*?-->/g, " ").replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/(\*\*|__)/g, "").replace(/`/g, "").replace(/\s+/g, " ").trim();
|
|
231
|
+
}
|
|
232
|
+
/** Strip the leading H3 marker (`### Added` → `Added`). */
|
|
233
|
+
function stripHeading(text) {
|
|
234
|
+
return text.replace(/^#{1,6}[ \t]+/, "").trim();
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Extract the release highlights for `version`: H3 subsection headings as
|
|
238
|
+
* group labels and their bullets as sanitized plain text, bounded to
|
|
239
|
+
* WHATS_NEW_MAX_ITEMS bullets. A missing section, a bullet-less section or a
|
|
240
|
+
* blank changelog all return EMPTY_HIGHLIGHTS (no window).
|
|
241
|
+
*/
|
|
242
|
+
function extractHighlights(changelogText, version) {
|
|
243
|
+
const { found, body } = extractSection(changelogText ?? "", version ?? "");
|
|
244
|
+
if (!found || !body) return { ...EMPTY_HIGHLIGHTS };
|
|
245
|
+
const groups = [];
|
|
246
|
+
let totalItems = 0;
|
|
247
|
+
let truncated = false;
|
|
248
|
+
for (const rawLine of body.split("\n")) {
|
|
249
|
+
const line = rawLine.trim();
|
|
250
|
+
if (line === "" || line.startsWith("<!--")) continue;
|
|
251
|
+
if (/^#{1,6}[ \t]/.test(line)) {
|
|
252
|
+
const heading = stripMarkdown(stripHeading(line));
|
|
253
|
+
if (heading === "") continue;
|
|
254
|
+
if (groups.at(-1)?.items.length === 0) groups.pop();
|
|
255
|
+
groups.push({
|
|
256
|
+
heading,
|
|
257
|
+
items: []
|
|
258
|
+
});
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
if (totalItems >= 12) {
|
|
262
|
+
if (/^[-*][ \t]/.test(line)) totalItems += 1;
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
const isBullet = /^[-*][ \t]/.test(line);
|
|
266
|
+
const continuation = (groups.at(-1)?.items.length ?? 0) > 0;
|
|
267
|
+
if (!isBullet && !continuation) continue;
|
|
268
|
+
const content = stripMarkdown(isBullet ? line.replace(/^[-*][ \t]+/, "") : line);
|
|
269
|
+
if (content === "") continue;
|
|
270
|
+
const group = groups.at(-1);
|
|
271
|
+
if (group === void 0) groups.push({
|
|
272
|
+
heading: null,
|
|
273
|
+
items: [content]
|
|
274
|
+
});
|
|
275
|
+
else if (isBullet || group.items.length === 0) group.items.push(content);
|
|
276
|
+
else group.items[group.items.length - 1] = `${group.items.at(-1)} ${content}`.trim();
|
|
277
|
+
if (isBullet) totalItems += 1;
|
|
278
|
+
}
|
|
279
|
+
const kept = groups.filter((group) => group.items.length > 0);
|
|
280
|
+
truncated = totalItems > 12;
|
|
281
|
+
return {
|
|
282
|
+
version: found ? String(version).trim().replace(/^v/i, "") : null,
|
|
283
|
+
found,
|
|
284
|
+
groups: kept,
|
|
285
|
+
totalItems,
|
|
286
|
+
truncated
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
/** Window title — mirrors the sidebar's `Pantheon v<version>` convention. */
|
|
290
|
+
function whatsNewTitle(version) {
|
|
291
|
+
return `O que há de novo — Pantheon v${String(version).trim().replace(/^v/i, "")}`;
|
|
292
|
+
}
|
|
293
|
+
/** Flat display lines for the window: group headings, `• ` bullets, `+N more`. */
|
|
294
|
+
function whatsNewLines(highlights) {
|
|
295
|
+
const lines = [];
|
|
296
|
+
for (const group of highlights.groups) {
|
|
297
|
+
if (group.heading !== null) lines.push(group.heading);
|
|
298
|
+
for (const item of group.items) lines.push(`• ${item}`);
|
|
299
|
+
}
|
|
300
|
+
if (highlights.truncated) {
|
|
301
|
+
const hidden = Math.max(0, highlights.totalItems - 12);
|
|
302
|
+
if (hidden > 0) lines.push(`${WHATS_NEW_MORE_PREFIX}${hidden} mais`);
|
|
303
|
+
}
|
|
304
|
+
return lines;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Candidate CHANGELOG.md locations for a bundle, first readable wins:
|
|
308
|
+
* 1. the plugin copy root (`<configDir>/plugins/pantheon-tui/CHANGELOG.md`,
|
|
309
|
+
* shipped by both installers next to package.json);
|
|
310
|
+
* 2. the package root (dev checkout; also an npm-package install when the
|
|
311
|
+
* bundle runs from `<pkg>/src/plugins/tui/dist/`).
|
|
312
|
+
*/
|
|
313
|
+
function changelogCandidates(bundlePath) {
|
|
314
|
+
const dist = dirname(bundlePath);
|
|
315
|
+
const copyRoot = dirname(dist);
|
|
316
|
+
const packageRoot = dirname(dirname(dirname(copyRoot)));
|
|
317
|
+
return [join(copyRoot, "CHANGELOG.md"), join(packageRoot, "CHANGELOG.md")];
|
|
318
|
+
}
|
|
319
|
+
/** Read the first existing candidate; null when none is readable (no window). */
|
|
320
|
+
async function readChangelogForBundle(bundleUrl) {
|
|
321
|
+
try {
|
|
322
|
+
const bundlePath = fileURLToPath(bundleUrl);
|
|
323
|
+
for (const candidate of changelogCandidates(bundlePath)) try {
|
|
324
|
+
return await readFile(candidate, "utf8");
|
|
325
|
+
} catch {}
|
|
326
|
+
return null;
|
|
327
|
+
} catch {
|
|
328
|
+
return null;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
/** The ambient build-time version, or null outside a tsdown build. */
|
|
332
|
+
function embeddedVersion() {
|
|
333
|
+
return "1.6.3-beta.11";
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Resolve the running Pantheon version for the what's-new window: the plugin
|
|
337
|
+
* copy's own package.json first (the copy root two levels above the bundle,
|
|
338
|
+
* then the package root four levels above — the same legs as the V1 sidebar's
|
|
339
|
+
* detectVersion try 0a/0b), falling back to the tsdown build embed. Null when
|
|
340
|
+
* nothing resolves → no window (fail-open).
|
|
341
|
+
*/
|
|
342
|
+
async function resolveRunningVersion(bundleUrl, embedded = embeddedVersion()) {
|
|
343
|
+
try {
|
|
344
|
+
const bundlePath = fileURLToPath(bundleUrl);
|
|
345
|
+
const dist = dirname(bundlePath);
|
|
346
|
+
for (const root of [dirname(dist), dirname(dirname(dirname(dist)))]) try {
|
|
347
|
+
const raw = await readFile(join(root, "package.json"), "utf8");
|
|
348
|
+
const parsed = JSON.parse(raw);
|
|
349
|
+
if (typeof parsed.version === "string" && parsed.version.trim() !== "") return parsed.version;
|
|
350
|
+
} catch {}
|
|
351
|
+
} catch {}
|
|
352
|
+
return embedded;
|
|
353
|
+
}
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region src/whats-new-state.ts
|
|
356
|
+
/**
|
|
357
|
+
* whats-new-state.ts — last-seen version for the one-time "What's new" window.
|
|
358
|
+
*
|
|
359
|
+
* The TUI shows a dismissable release-highlights dialog once per Pantheon
|
|
360
|
+
* version. Whether a version was already seen is persisted next to the other
|
|
361
|
+
* opencode-level Pantheon state: `<configDir>/.pantheon/whats-new.json`, the
|
|
362
|
+
* same directory that already holds `install-state.json` (scripts/install/
|
|
363
|
+
* state.mjs) and the active-preset file the sidebar reads. There is no
|
|
364
|
+
* established persistent TUI KV store (the host `api.kv` is per-process), so
|
|
365
|
+
* the plugin owns one small JSON file with the atomic-write discipline used
|
|
366
|
+
* across the repo (unique tmp + rename, mirrors scripts/install/verify.mjs).
|
|
367
|
+
*
|
|
368
|
+
* Fail-open everywhere: a missing or corrupt file reads as "never seen" (the
|
|
369
|
+
* window may show), a failed write is silent (the window may show again) —
|
|
370
|
+
* neither can ever block TUI startup.
|
|
371
|
+
*/
|
|
372
|
+
/** State file name, kept next to `install-state.json` in `<configDir>/.pantheon/`. */
|
|
373
|
+
const WHATS_NEW_STATE_FILENAME = "whats-new.json";
|
|
374
|
+
/** Parse a state file body; null when unreadable as the expected shape. */
|
|
375
|
+
function parseWhatsNewState(raw) {
|
|
376
|
+
try {
|
|
377
|
+
const parsed = JSON.parse(raw);
|
|
378
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return null;
|
|
379
|
+
const record = parsed;
|
|
380
|
+
const seen = record.seenVersion;
|
|
381
|
+
if (typeof seen !== "string" && seen !== null) return null;
|
|
382
|
+
return {
|
|
383
|
+
seenVersion: seen,
|
|
384
|
+
updatedAt: String(record.updatedAt ?? "")
|
|
385
|
+
};
|
|
386
|
+
} catch {
|
|
387
|
+
return null;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
/** Read the persisted state; null when missing or corrupt (never throws). */
|
|
391
|
+
async function readWhatsNewState(statePath) {
|
|
392
|
+
try {
|
|
393
|
+
return parseWhatsNewState(await readFile(statePath, "utf8"));
|
|
394
|
+
} catch {
|
|
395
|
+
return null;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Whether the one-time window should show for `version`: any version change
|
|
400
|
+
* since the last dismissal (including downgrades). A falsy version — the
|
|
401
|
+
* resolver failed — never shows.
|
|
402
|
+
*/
|
|
403
|
+
async function shouldShowWhatsNew(version, statePath) {
|
|
404
|
+
if (typeof version !== "string" || version.trim() === "") return false;
|
|
405
|
+
return (await readWhatsNewState(statePath))?.seenVersion !== version;
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Persist `version` as seen (atomic tmp + rename, 0o600). Never throws: a
|
|
409
|
+
* failed write leaves the state untouched and the window may show again —
|
|
410
|
+
* the same fail-open contract as the rest of the plugin.
|
|
411
|
+
*/
|
|
412
|
+
async function markSeenWhatsNew(version, statePath) {
|
|
413
|
+
if (typeof version !== "string" || version.trim() === "") return false;
|
|
414
|
+
const previous = await readWhatsNewState(statePath);
|
|
415
|
+
const next = {
|
|
416
|
+
seenVersion: version,
|
|
417
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
418
|
+
};
|
|
419
|
+
const tmpPath = `${statePath}.tmp-${process.pid}`;
|
|
420
|
+
try {
|
|
421
|
+
await mkdir(dirname(statePath), { recursive: true });
|
|
422
|
+
await writeFile(tmpPath, `${JSON.stringify({
|
|
423
|
+
...previous,
|
|
424
|
+
...next
|
|
425
|
+
}, null, 2)}\n`, {
|
|
426
|
+
encoding: "utf8",
|
|
427
|
+
mode: 384
|
|
428
|
+
});
|
|
429
|
+
await rename(tmpPath, statePath);
|
|
430
|
+
return true;
|
|
431
|
+
} catch {
|
|
432
|
+
try {
|
|
433
|
+
await unlink(tmpPath);
|
|
434
|
+
} catch {}
|
|
435
|
+
return false;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
/** `stat`-based existence probe (async I/O discipline). */
|
|
439
|
+
async function pathExists(path) {
|
|
440
|
+
try {
|
|
441
|
+
await stat(path);
|
|
442
|
+
return true;
|
|
443
|
+
} catch {
|
|
444
|
+
return false;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Default state path: `<configDir>/.pantheon/whats-new.json`, resolving the
|
|
449
|
+
* OpenCode config directory exactly like src/pantheon/tui-version-check.ts
|
|
450
|
+
* (`$XDG_CONFIG_HOME/opencode` → `~/.opencode`), defaulting to the XDG
|
|
451
|
+
* location `init` creates when neither exists yet.
|
|
452
|
+
*/
|
|
453
|
+
async function defaultWhatsNewStatePath(env = process.env, home = homedir()) {
|
|
454
|
+
const xdgConfig = env.XDG_CONFIG_HOME || join(home, ".config");
|
|
455
|
+
const primary = join(xdgConfig, "opencode");
|
|
456
|
+
if (await pathExists(primary)) return join(primary, ".pantheon", WHATS_NEW_STATE_FILENAME);
|
|
457
|
+
const legacy = join(home, ".opencode");
|
|
458
|
+
if (await pathExists(legacy)) return join(legacy, ".pantheon", WHATS_NEW_STATE_FILENAME);
|
|
459
|
+
return join(primary, ".pantheon", WHATS_NEW_STATE_FILENAME);
|
|
460
|
+
}
|
|
461
|
+
//#endregion
|
|
462
|
+
//#region src/whats-new-open.ts
|
|
463
|
+
/**
|
|
464
|
+
* whats-new-open.ts — the show-once decision for the "What's new" window.
|
|
465
|
+
*
|
|
466
|
+
* Plain data in, plain data out: the entrypoints (index.tsx / index-v2.tsx)
|
|
467
|
+
* resolve the running version and the shipped CHANGELOG.md, then hand this
|
|
468
|
+
* module a `show` callback that renders the view data through the host's
|
|
469
|
+
* dialog API. Keeping the decision JSX-free makes the whole one-time flow
|
|
470
|
+
* testable offline (node strips the types natively) — the Solid glue lives in
|
|
471
|
+
* whats-new.tsx.
|
|
472
|
+
*
|
|
473
|
+
* Contract (pinned by tests/tui-whats-new.test.mjs):
|
|
474
|
+
* - shows at most once per version: dismissal marks the version seen;
|
|
475
|
+
* - nothing to show (no version, missing CHANGELOG, empty section) → no
|
|
476
|
+
* window AND no pin — the next start may still show it;
|
|
477
|
+
* - never throws on its own inputs; I/O failures inside the state module
|
|
478
|
+
* are fail-open there.
|
|
479
|
+
*/
|
|
480
|
+
/** Muted footer hint teaching the dismiss bind (Portuguese, like the sidebar). */
|
|
481
|
+
const WHATS_NEW_CLOSE_HINT = "esc/q fechar";
|
|
482
|
+
/**
|
|
483
|
+
* Open the one-time window when the version changed and highlights exist.
|
|
484
|
+
* Returns true when the window was shown; the caller's `onClose` callback
|
|
485
|
+
* (both host-initiated and local close binds) must funnel into marking seen.
|
|
486
|
+
*/
|
|
487
|
+
async function openWhatsNew(input) {
|
|
488
|
+
const { version, statePath, changelogText, show } = input;
|
|
489
|
+
if (typeof version !== "string" || version.trim() === "") return false;
|
|
490
|
+
if (!await shouldShowWhatsNew(version, statePath)) return false;
|
|
491
|
+
const lines = whatsNewLines(changelogText ? extractHighlights(changelogText, version) : { ...EMPTY_HIGHLIGHTS });
|
|
492
|
+
if (lines.length === 0) return false;
|
|
493
|
+
const data = {
|
|
494
|
+
version,
|
|
495
|
+
title: whatsNewTitle(version),
|
|
496
|
+
lines,
|
|
497
|
+
hint: WHATS_NEW_CLOSE_HINT
|
|
498
|
+
};
|
|
499
|
+
show(() => data, () => {
|
|
500
|
+
markSeenWhatsNew(version, statePath);
|
|
501
|
+
});
|
|
502
|
+
return true;
|
|
503
|
+
}
|
|
504
|
+
//#endregion
|
|
505
|
+
//#region src/whats-new.tsx
|
|
506
|
+
/** @jsxImportSource @opentui/solid */
|
|
507
|
+
/**
|
|
508
|
+
* whats-new.tsx — the one-time "What's new" window (per Pantheon version).
|
|
509
|
+
*
|
|
510
|
+
* When the running Pantheon version changed since the last TUI start, the V2
|
|
511
|
+
* entrypoint fires {@link maybeShowWhatsNewV2} (fire-and-forget, never
|
|
512
|
+
* awaited — startup must never block). The decision lives in
|
|
513
|
+
* whats-new-open.ts; this file is only the host glue + view:
|
|
514
|
+
* `context.ui.dialog.show` plus a keymap layer gated on the open signal so
|
|
515
|
+
* `escape`/`q` dismiss while (and only while) the window is up — the same
|
|
516
|
+
* gated-layer pattern as the dispatch panel.
|
|
517
|
+
*
|
|
518
|
+
* Deliberately V2-only: the two dist entries are self-contained (the V1
|
|
519
|
+
* sidebar mirrors the preset resolver rather than importing it) because any
|
|
520
|
+
* module shared by both entries becomes a content-hashed chunk in dist/,
|
|
521
|
+
* changing the artifact shape the byte-reproducible-dist gate pins. The V1
|
|
522
|
+
* generation (OpenCode 1.x, legacy) does not show the window; the pure
|
|
523
|
+
* modules here are generation-agnostic, so a V1 mirror can follow the
|
|
524
|
+
* documented inline-replica precedent if it is ever wanted.
|
|
525
|
+
*
|
|
526
|
+
* Dismissal always funnels into `markSeenWhatsNew` (idempotent), so the window
|
|
527
|
+
* is shown exactly once per version. Every failure path is silent: missing
|
|
528
|
+
* CHANGELOG.md, unreadable state, a host API that throws — the window simply
|
|
529
|
+
* does not show (fail-open, like the rest of the plugin).
|
|
530
|
+
*/
|
|
531
|
+
/** Window body: title, rule, bounded highlight lines, dismiss hint. */
|
|
532
|
+
function WhatsNewContent(props) {
|
|
533
|
+
return (() => {
|
|
534
|
+
var _el$ = createElement("box"), _el$2 = createElement("text"), _el$3 = createElement("text"), _el$5 = createElement("box"), _el$6 = createElement("text");
|
|
535
|
+
insertNode(_el$, _el$2);
|
|
536
|
+
insertNode(_el$, _el$3);
|
|
537
|
+
insertNode(_el$, _el$5);
|
|
538
|
+
insertNode(_el$, _el$6);
|
|
539
|
+
setProp(_el$, "flexDirection", "column");
|
|
540
|
+
setProp(_el$, "paddingLeft", 1);
|
|
541
|
+
setProp(_el$, "paddingRight", 1);
|
|
542
|
+
setProp(_el$, "paddingTop", 1);
|
|
543
|
+
setProp(_el$2, "attributes", 1);
|
|
544
|
+
insert(_el$2, () => props.data.title);
|
|
545
|
+
insertNode(_el$3, createTextNode(`──────────────────────────────────────`));
|
|
546
|
+
insert(_el$, createComponent(For, {
|
|
547
|
+
get each() {
|
|
548
|
+
return props.data.lines;
|
|
549
|
+
},
|
|
550
|
+
children: (line) => (() => {
|
|
551
|
+
var _el$7 = createElement("text");
|
|
552
|
+
insert(_el$7, line);
|
|
553
|
+
effect((_$p) => setProp(_el$7, "fg", line.startsWith("• ") ? props.fg : props.muted, _$p));
|
|
554
|
+
return _el$7;
|
|
555
|
+
})()
|
|
556
|
+
}), _el$5);
|
|
557
|
+
setProp(_el$5, "height", 1);
|
|
558
|
+
insert(_el$6, () => props.data.hint);
|
|
559
|
+
effect((_p$) => {
|
|
560
|
+
var _v$ = props.fg, _v$2 = props.muted, _v$3 = props.muted;
|
|
561
|
+
_v$ !== _p$.e && (_p$.e = setProp(_el$2, "fg", _v$, _p$.e));
|
|
562
|
+
_v$2 !== _p$.t && (_p$.t = setProp(_el$3, "fg", _v$2, _p$.t));
|
|
563
|
+
_v$3 !== _p$.a && (_p$.a = setProp(_el$6, "fg", _v$3, _p$.a));
|
|
564
|
+
return _p$;
|
|
565
|
+
}, {
|
|
566
|
+
e: void 0,
|
|
567
|
+
t: void 0,
|
|
568
|
+
a: void 0
|
|
569
|
+
});
|
|
570
|
+
return _el$;
|
|
571
|
+
})();
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Entry glue: resolve version + shipped CHANGELOG.md, then show the window
|
|
575
|
+
* through the host dialog stack once. Never throws.
|
|
576
|
+
*/
|
|
577
|
+
async function maybeShowWhatsNewV2(context) {
|
|
578
|
+
try {
|
|
579
|
+
const version = await resolveRunningVersion(import.meta.url);
|
|
580
|
+
if (!version) return;
|
|
581
|
+
const statePath = await defaultWhatsNewStatePath();
|
|
582
|
+
const changelogText = await readChangelogForBundle(import.meta.url);
|
|
583
|
+
const [open, setOpen] = createSignal(false);
|
|
584
|
+
let dismiss = () => {};
|
|
585
|
+
try {
|
|
586
|
+
context.keymap.layer(() => ({
|
|
587
|
+
mode: "global",
|
|
588
|
+
enabled: () => open(),
|
|
589
|
+
commands: [{
|
|
590
|
+
id: "pantheon.whats-new.close",
|
|
591
|
+
title: "Fechar o que há de novo",
|
|
592
|
+
bind: "escape,q",
|
|
593
|
+
run: () => {
|
|
594
|
+
if (!open()) return false;
|
|
595
|
+
dismiss();
|
|
596
|
+
}
|
|
597
|
+
}]
|
|
598
|
+
}));
|
|
599
|
+
} catch {}
|
|
600
|
+
await openWhatsNew({
|
|
601
|
+
version,
|
|
602
|
+
statePath,
|
|
603
|
+
changelogText,
|
|
604
|
+
show: (render, onClose) => {
|
|
605
|
+
const close = () => {
|
|
606
|
+
setOpen(false);
|
|
607
|
+
onClose();
|
|
608
|
+
};
|
|
609
|
+
dismiss = () => {
|
|
610
|
+
try {
|
|
611
|
+
context.ui.dialog.clear();
|
|
612
|
+
} catch {}
|
|
613
|
+
close();
|
|
614
|
+
};
|
|
615
|
+
setOpen(true);
|
|
616
|
+
try {
|
|
617
|
+
const theme = context.theme?.text ?? {};
|
|
618
|
+
context.ui.dialog.show(() => createComponent(WhatsNewContent, {
|
|
619
|
+
get data() {
|
|
620
|
+
return render();
|
|
621
|
+
},
|
|
622
|
+
get fg() {
|
|
623
|
+
return theme.base;
|
|
624
|
+
},
|
|
625
|
+
get muted() {
|
|
626
|
+
return theme.muted;
|
|
627
|
+
}
|
|
628
|
+
}), close);
|
|
629
|
+
} catch {}
|
|
630
|
+
}
|
|
631
|
+
});
|
|
632
|
+
} catch {}
|
|
633
|
+
}
|
|
182
634
|
//#endregion
|
|
183
635
|
//#region src/index-v2.tsx
|
|
184
636
|
/** @jsxImportSource @opentui/solid */
|
|
@@ -3197,7 +3649,7 @@ function Sidebar(props) {
|
|
|
3197
3649
|
setProp(_el$12, "width", "100%");
|
|
3198
3650
|
setProp(_el$12, "padding", 1);
|
|
3199
3651
|
setProp(_el$13, "attributes", 1);
|
|
3200
|
-
insert(_el$13, `Pantheon v1.6.3-beta.
|
|
3652
|
+
insert(_el$13, `Pantheon v1.6.3-beta.11`);
|
|
3201
3653
|
insert(_el$14, () => presetHeaderLine(model.preset().name ?? "", model.provider()));
|
|
3202
3654
|
insert(_el$12, createComponent(Show, {
|
|
3203
3655
|
get when() {
|
|
@@ -3918,7 +4370,7 @@ function HomeStatus(props) {
|
|
|
3918
4370
|
const muted = () => props.context.theme?.text?.muted ?? props.context.theme?.text?.base;
|
|
3919
4371
|
return (() => {
|
|
3920
4372
|
var _el$72 = createElement("text");
|
|
3921
|
-
insert(_el$72, () => `Pantheon v1.6.3-beta.
|
|
4373
|
+
insert(_el$72, () => `Pantheon v1.6.3-beta.11${preset().name ? ` ▸ ${preset().name}` : ""}`);
|
|
3922
4374
|
effect((_$p) => setProp(_el$72, "fg", muted(), _$p));
|
|
3923
4375
|
return _el$72;
|
|
3924
4376
|
})();
|
|
@@ -4025,6 +4477,7 @@ const plugin = Plugin.define({
|
|
|
4025
4477
|
append: "app",
|
|
4026
4478
|
render: () => createComponent(DispatchCommandLayer, { context })
|
|
4027
4479
|
});
|
|
4480
|
+
maybeShowWhatsNewV2(context);
|
|
4028
4481
|
return () => {
|
|
4029
4482
|
if (typeof unregisterSidebar === "function") unregisterSidebar();
|
|
4030
4483
|
if (typeof unregisterHome === "function") unregisterHome();
|