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.
Files changed (54) hide show
  1. package/AGENTS.global.md +1 -1
  2. package/AGENTS.md +1 -1
  3. package/CHANGELOG.md +81 -0
  4. package/README.md +20 -2
  5. package/bin/pantheon-init.mjs +15 -27
  6. package/package.json +1 -1
  7. package/plugin.json +1 -1
  8. package/pyproject.toml +1 -1
  9. package/scripts/decision-router-budget.mjs +103 -4
  10. package/scripts/decision-router-v2-budget.mjs +2 -2
  11. package/scripts/decision-router-v2-egress.mjs +0 -2
  12. package/scripts/decision-router.mjs +88 -6
  13. package/scripts/install/decision-router-config.mjs +53 -2
  14. package/scripts/install/interactive.mjs +96 -11
  15. package/scripts/install/opencode.mjs +26 -0
  16. package/scripts/install/plugin.mjs +17 -0
  17. package/scripts/jev-live-probe.mjs +210 -0
  18. package/scripts/skill-search.mjs +242 -0
  19. package/scripts/sync-tui.mjs +11 -0
  20. package/src/agents/aphrodite.md +34 -1
  21. package/src/agents/apollo.md +227 -0
  22. package/src/agents/athena.md +24 -0
  23. package/src/agents/demeter.md +33 -0
  24. package/src/agents/gaia.md +24 -0
  25. package/src/agents/hephaestus.md +24 -0
  26. package/src/agents/hermes.md +33 -0
  27. package/src/agents/iris.md +24 -0
  28. package/src/agents/mnemosyne.md +25 -3
  29. package/src/agents/nyx.md +53 -22
  30. package/src/agents/prometheus.md +242 -1
  31. package/src/agents/talos.md +24 -0
  32. package/src/agents/themis.md +24 -0
  33. package/src/agents/zeus.md +46 -6
  34. package/src/pantheon/j-telemetry-file.ts +96 -0
  35. package/src/pantheon/jev-decision-tool.ts +160 -24
  36. package/src/pantheon/jev-decisions.ts +18 -3
  37. package/src/pantheon/jev-rank-verify.ts +435 -0
  38. package/src/pantheon/jev-risk-gate.ts +1 -0
  39. package/src/pantheon/local-decision-budget.ts +170 -5
  40. package/src/pantheon/local-decision-provider-matrix.ts +0 -1
  41. package/src/pantheon/local-decision-usage-evidence.internal.ts +2 -2
  42. package/src/pantheon/v2-decision-budget.ts +4 -2
  43. package/src/plugin-v2.ts +9 -2
  44. package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -1
  45. package/src/plugins/tui/dist/tui-v2.js +457 -4
  46. package/src/plugins/tui/dist/tui-v2.js.map +1 -1
  47. package/src/plugins/tui/dist/tui.js +1 -1
  48. package/src/plugins/tui/package-lock.json +2 -2
  49. package/src/plugins/tui/package.json +1 -1
  50. package/src/plugins/tui/src/index-v2.tsx +6 -0
  51. package/src/plugins/tui/src/whats-new-highlights.ts +263 -0
  52. package/src/plugins/tui/src/whats-new-open.ts +80 -0
  53. package/src/plugins/tui/src/whats-new-state.ts +128 -0
  54. package/src/plugins/tui/src/whats-new.tsx +119 -0
@@ -0,0 +1,119 @@
1
+ // biome-ignore-all lint/suspicious/noExplicitAny: OpenCode exposes its TUI API at runtime.
2
+ // biome-ignore-all lint/a11y/noStaticElementInteractions: TUI elements, not DOM
3
+ /** @jsxImportSource @opentui/solid */
4
+
5
+ /**
6
+ * whats-new.tsx — the one-time "What's new" window (per Pantheon version).
7
+ *
8
+ * When the running Pantheon version changed since the last TUI start, the V2
9
+ * entrypoint fires {@link maybeShowWhatsNewV2} (fire-and-forget, never
10
+ * awaited — startup must never block). The decision lives in
11
+ * whats-new-open.ts; this file is only the host glue + view:
12
+ * `context.ui.dialog.show` plus a keymap layer gated on the open signal so
13
+ * `escape`/`q` dismiss while (and only while) the window is up — the same
14
+ * gated-layer pattern as the dispatch panel.
15
+ *
16
+ * Deliberately V2-only: the two dist entries are self-contained (the V1
17
+ * sidebar mirrors the preset resolver rather than importing it) because any
18
+ * module shared by both entries becomes a content-hashed chunk in dist/,
19
+ * changing the artifact shape the byte-reproducible-dist gate pins. The V1
20
+ * generation (OpenCode 1.x, legacy) does not show the window; the pure
21
+ * modules here are generation-agnostic, so a V1 mirror can follow the
22
+ * documented inline-replica precedent if it is ever wanted.
23
+ *
24
+ * Dismissal always funnels into `markSeenWhatsNew` (idempotent), so the window
25
+ * is shown exactly once per version. Every failure path is silent: missing
26
+ * CHANGELOG.md, unreadable state, a host API that throws — the window simply
27
+ * does not show (fail-open, like the rest of the plugin).
28
+ */
29
+ import type { Context } from '@opencode/plugin/tui/context'
30
+ import { createSignal, For } from 'solid-js'
31
+ import { readChangelogForBundle, resolveRunningVersion } from './whats-new-highlights.ts'
32
+ import { openWhatsNew, type WhatsNewViewData } from './whats-new-open.ts'
33
+ import { defaultWhatsNewStatePath } from './whats-new-state.ts'
34
+
35
+ /** Window body: title, rule, bounded highlight lines, dismiss hint. */
36
+ export function WhatsNewContent(props: { data: WhatsNewViewData; fg?: any; muted?: any }) {
37
+ return (
38
+ <box flexDirection="column" paddingLeft={1} paddingRight={1} paddingTop={1}>
39
+ <text attributes={1} fg={props.fg}>
40
+ {props.data.title}
41
+ </text>
42
+ <text fg={props.muted}>{'─'.repeat(38)}</text>
43
+ <For each={props.data.lines}>
44
+ {(line: string) => <text fg={line.startsWith('• ') ? props.fg : props.muted}>{line}</text>}
45
+ </For>
46
+ <box height={1} />
47
+ <text fg={props.muted}>{props.data.hint}</text>
48
+ </box>
49
+ )
50
+ }
51
+
52
+ /**
53
+ * Entry glue: resolve version + shipped CHANGELOG.md, then show the window
54
+ * through the host dialog stack once. Never throws.
55
+ */
56
+ export async function maybeShowWhatsNewV2(context: Context): Promise<void> {
57
+ try {
58
+ const version = await resolveRunningVersion(import.meta.url)
59
+ if (!version) return
60
+ const statePath = await defaultWhatsNewStatePath()
61
+ const changelogText = await readChangelogForBundle(import.meta.url)
62
+
63
+ const [open, setOpen] = createSignal(false)
64
+ let dismiss: () => void = () => {}
65
+ try {
66
+ // Gated layer: inert (all keys fall through) while the window is closed.
67
+ context.keymap.layer(() => ({
68
+ mode: 'global',
69
+ enabled: () => open(),
70
+ commands: [
71
+ {
72
+ id: 'pantheon.whats-new.close',
73
+ title: 'Fechar o que há de novo',
74
+ bind: 'escape,q',
75
+ run: () => {
76
+ if (!open()) return false
77
+ dismiss()
78
+ return undefined
79
+ },
80
+ },
81
+ ],
82
+ }))
83
+ } catch {
84
+ /* keymap API unavailable — the host dialog chrome still dismisses (ESC) */
85
+ }
86
+
87
+ await openWhatsNew({
88
+ version,
89
+ statePath,
90
+ changelogText,
91
+ show: (render, onClose) => {
92
+ const close = () => {
93
+ setOpen(false)
94
+ onClose()
95
+ }
96
+ dismiss = () => {
97
+ try {
98
+ context.ui.dialog.clear()
99
+ } catch {
100
+ /* already closed */
101
+ }
102
+ close()
103
+ }
104
+ setOpen(true)
105
+ try {
106
+ const theme = context.theme?.text ?? {}
107
+ context.ui.dialog.show(
108
+ () => <WhatsNewContent data={render()} fg={theme.base} muted={theme.muted} />,
109
+ close,
110
+ )
111
+ } catch {
112
+ /* dialog stack unavailable — fail-open, retried on the next start */
113
+ }
114
+ },
115
+ })
116
+ } catch {
117
+ /* fail-open — the window must never block or break TUI startup */
118
+ }
119
+ }