pantheon-opencode 2.2.0-beta.1 → 2.2.0-beta.2

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 (60) hide show
  1. package/AGENTS.global.md +2 -2
  2. package/AGENTS.md +1 -1
  3. package/CHANGELOG.md +38 -11
  4. package/README.md +13 -9
  5. package/README.pt-BR.md +13 -9
  6. package/bin/pantheon-init.mjs +1 -1
  7. package/commands/pantheon-audit.md +4 -5
  8. package/commands/pantheon-model.md +1 -2
  9. package/package.json +2 -2
  10. package/plugin.json +1 -1
  11. package/prompts/dynamic/agora-generated.txt +2 -2
  12. package/prompts/dynamic/orchestrate-generated.txt +4 -4
  13. package/prompts/sketch.prompt.md +1 -1
  14. package/pyproject.toml +1 -1
  15. package/scripts/build-agents-md.mjs +73 -12
  16. package/scripts/build-plugin.mjs +2 -0
  17. package/scripts/hooks/format-multi-language.sh +30 -29
  18. package/scripts/prune.mjs +124 -2
  19. package/scripts/setup.mjs +1 -1
  20. package/scripts/themis_heuristic_scan.py +3 -5
  21. package/skills-lock.json +1 -1
  22. package/src/agents/aphrodite.md +1 -1
  23. package/src/agents/athena.md +6 -14
  24. package/src/agents/demeter.md +1 -1
  25. package/src/agents/hermes.md +3 -2
  26. package/src/agents/iris.md +4 -6
  27. package/src/agents/prometheus.md +3 -7
  28. package/src/agents/roster.json +13 -8
  29. package/src/agents/zeus.md +3 -0
  30. package/src/instructions/agent-return-format.instructions.md +1 -1
  31. package/src/instructions/zeus-anti-stall.instructions.md +11 -35
  32. package/src/instructions/zeus-council-synthesis.instructions.md +17 -49
  33. package/src/instructions/zeus-timeout-retry.instructions.md +12 -80
  34. package/src/mcp/mcp_codemap_module.py +6 -5
  35. package/src/mcp/pantheon-mcp-server.mjs +515 -148
  36. package/src/pantheon/agent-forge-tool.ts +316 -0
  37. package/src/pantheon/auto-permissions.ts +31 -1
  38. package/src/pantheon/codemap-tools.ts +525 -0
  39. package/src/pantheon/deepwork/plan-tracker.ts +63 -2
  40. package/src/pantheon/execute-after.ts +21 -0
  41. package/src/pantheon/hook-engine.ts +2 -1
  42. package/src/pantheon/native-memory-tools.ts +686 -0
  43. package/src/pantheon/presets.mjs +15 -0
  44. package/src/pantheon/step-ledger.ts +259 -0
  45. package/src/pantheon/swe-eval-harness.ts +211 -0
  46. package/src/pantheon/tools.ts +62 -7
  47. package/src/plugin/index.js +2980 -9462
  48. package/src/plugin/index.ts +2 -43
  49. package/src/plugin.ts +116 -10
  50. package/src/plugins/tui/dist/tui.js +90 -26
  51. package/src/plugins/tui/dist/tui.js.map +1 -1
  52. package/src/plugins/tui/package-lock.json +2 -2
  53. package/src/plugins/tui/package.json +1 -1
  54. package/src/plugins/tui/src/index.tsx +1 -1
  55. package/src/plugins/tui/src/pantheon-settings.tsx +25 -12
  56. package/src/plugins/tui/src/quota-state.ts +71 -9
  57. package/src/plugins/tui/src/tui-prefs.ts +8 -0
  58. package/src/routing.yml +3 -0
  59. package/src/skills/auto-continue/references/auto-continue-details.md +2 -31
  60. /package/scripts/{setup-v2-config.mjs → setup-config.mjs} +0 -0
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pantheon-tui",
3
- "version": "2.2.0-beta.1",
3
+ "version": "2.2.0-beta.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pantheon-tui",
9
- "version": "2.2.0-beta.1",
9
+ "version": "2.2.0-beta.2",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@opencode/plugin": "2.0.26",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pantheon-tui",
3
3
  "type": "module",
4
- "version": "2.2.0-beta.1",
4
+ "version": "2.2.0-beta.2",
5
5
  "description": "Pantheon TUI plugin \u2014 V1 rich sidebar and usage gauges; native V2 status, session and delegation sidebar",
6
6
  "license": "MIT",
7
7
  "engines": {
@@ -1006,7 +1006,7 @@ export function resolveGateStatus(env: Record<string, string | undefined> = proc
1006
1006
  if (mode === 'shadow' || mode === '1' || mode === 'true' || mode === 'on') {
1007
1007
  return '✓ Gate: active'
1008
1008
  }
1009
- return '✓ Gate: tests pass'
1009
+ return '✓ Gate: shadow'
1010
1010
  }
1011
1011
 
1012
1012
  /* ─── Per-model real usage ────────────────────────────────
@@ -60,6 +60,8 @@ import {
60
60
  type EffectiveOverrides,
61
61
  EMPTY_TAB,
62
62
  findRow,
63
+ isBehaviorDisabled,
64
+ mergedOverrides,
63
65
  type OverridesLoad,
64
66
  resetTab,
65
67
  type SettingsDraft,
@@ -84,7 +86,7 @@ import {
84
86
  writeActivePreset,
85
87
  writeConfiguredVisionModel,
86
88
  } from './preset-state.ts'
87
- import { buildQuotaTab } from './quota-state.ts'
89
+ import { applyQuotaRow, buildQuotaTab, readQuotaPrefs, writeQuotaPrefs } from './quota-state.ts'
88
90
  import { resolveLanguage } from './settings-i18n.ts'
89
91
  import {
90
92
  applyTuiRow,
@@ -93,7 +95,6 @@ import {
93
95
  mutateTuiPrefs,
94
96
  resolveAccentColor,
95
97
  setTuiDraftPreview,
96
- tuiDraftPreview,
97
98
  tuiPrefs,
98
99
  } from './tui-prefs.ts'
99
100
  import { nextCheckState, type UpdateCheckState } from './update-notice.ts'
@@ -871,7 +872,7 @@ function createWindowController(
871
872
  buildGatesTab(load(), lang),
872
873
  buildDecisionTab(decision(), process.env, readAuthProviders(), readConfigProviders(), lang),
873
874
  buildPresetTab(presetInput(), lang),
874
- buildQuotaTab(undefined, lang),
875
+ buildQuotaTab(undefined, lang, readQuotaPrefs()),
875
876
  buildTuiTab(tuiPrefs(), lang),
876
877
  buildAutonomyTab({
877
878
  goalLoop: goalLoop(),
@@ -879,7 +880,11 @@ function createWindowController(
879
880
  goalLoopRestartPending: autonomyRestartPending(),
880
881
  languagePref: lang,
881
882
  }),
882
- buildJ1Tab(process.env, false, lang),
883
+ buildJ1Tab(
884
+ process.env,
885
+ isBehaviorDisabled(mergedOverrides(load()), 'gate-j1-risk-gate'),
886
+ lang,
887
+ ),
883
888
  buildUpdatesTab({ ...updatesInput(), languagePref: lang }),
884
889
  buildChangelogTab(currentVersion, changelogItems(), lang),
885
890
  buildDoctorTab({
@@ -1109,7 +1114,14 @@ function createWindowController(
1109
1114
  }
1110
1115
  }
1111
1116
  if (id.startsWith('quota.')) {
1112
- return { ok: true }
1117
+ try {
1118
+ const current = readQuotaPrefs()
1119
+ const updated = applyQuotaRow(current, id, value)
1120
+ writeQuotaPrefs(updated)
1121
+ return { ok: true }
1122
+ } catch {
1123
+ return { ok: false, reason: 'quota prefs disk write failed' }
1124
+ }
1113
1125
  }
1114
1126
  return { ok: false, reason: 'unknown staged row' }
1115
1127
  }
@@ -1304,8 +1316,7 @@ function SettingsPage(props: {
1304
1316
  navigateBack(context, returnRoute !== undefined ? { returnRoute } : {}),
1305
1317
  )
1306
1318
  const theme = context.theme?.text ?? {}
1307
- const accent = () =>
1308
- resolveAccentColor(tuiDraftPreview()?.theme?.accent ?? tuiPrefs().theme?.accent, context.theme)
1319
+ const accent = () => resolveAccentColor(tuiPrefs().theme?.accent, context.theme)
1309
1320
  const warn = () => accent()
1310
1321
  // The page owns the keyboard while mounted: push an input MODE so the
1311
1322
  // composer's base-mode layers sleep (they eat escape and plain letters —
@@ -1385,8 +1396,7 @@ let dialogDismiss: () => void = () => {}
1385
1396
  function openSettingsDialog(context: Context): void {
1386
1397
  const controller = createWindowController(context, () => dialogDismiss())
1387
1398
  const theme = context.theme?.text ?? {}
1388
- const accent = () =>
1389
- resolveAccentColor(tuiDraftPreview()?.theme?.accent ?? tuiPrefs().theme?.accent, context.theme)
1399
+ const accent = () => resolveAccentColor(tuiPrefs().theme?.accent, context.theme)
1390
1400
  const warn = () => accent()
1391
1401
  controller.cleanup = () => {
1392
1402
  pageApi = undefined
@@ -1556,8 +1566,7 @@ function InSessionSettingsWindow(props: { context: Context; sessionID: string })
1556
1566
  pageApi = controller.api
1557
1567
 
1558
1568
  const theme = (context as any).theme?.text ?? {}
1559
- const accent = () =>
1560
- resolveAccentColor(tuiDraftPreview()?.theme?.accent ?? tuiPrefs().theme?.accent, context.theme)
1569
+ const accent = () => resolveAccentColor(tuiPrefs().theme?.accent, context.theme)
1561
1570
  const warn = () => accent()
1562
1571
 
1563
1572
  return (
@@ -1612,7 +1621,11 @@ export function setupPantheonSettings(
1612
1621
  context.ui.router?.register?.({
1613
1622
  name: ROUTE_NAME,
1614
1623
  render: ({ data }) => (
1615
- <SettingsPage context={context} data={data} renderSidebar={registeredSidebarRenderer} />
1624
+ <SettingsPage
1625
+ context={context}
1626
+ data={data}
1627
+ {...(registeredSidebarRenderer ? { renderSidebar: registeredSidebarRenderer } : {})}
1628
+ />
1616
1629
  ),
1617
1630
  })
1618
1631
  routerAvailable = true
@@ -4,6 +4,9 @@
4
4
  * Exposes live model token spending, daily budgets, rate-limits per provider,
5
5
  * and context token telemetry in a dedicated tab in the Pantheon Settings window.
6
6
  */
7
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'
8
+ import { homedir } from 'node:os'
9
+ import { dirname, join } from 'node:path'
7
10
  import type { SettingsTab } from './pantheon-settings-state.ts'
8
11
  import { resolveLanguage } from './settings-i18n.ts'
9
12
 
@@ -16,7 +19,66 @@ export interface QuotaSnapshot {
16
19
  speed?: string
17
20
  }
18
21
 
19
- export function buildQuotaTab(snapshot?: QuotaSnapshot, languagePref?: string): SettingsTab {
22
+ export interface QuotaPrefs {
23
+ sessionCap: string
24
+ alertThreshold: 'enabled' | 'disabled'
25
+ autoCompact: 'enabled' | 'disabled'
26
+ }
27
+
28
+ export const DEFAULT_QUOTA_PREFS: QuotaPrefs = {
29
+ sessionCap: '$5.00',
30
+ alertThreshold: 'enabled',
31
+ autoCompact: 'enabled',
32
+ }
33
+
34
+ export function resolveQuotaPrefsPath(): string {
35
+ const xdg = process.env.XDG_CONFIG_HOME
36
+ const base = xdg?.startsWith('/') ? xdg : join(homedir(), '.config')
37
+ return join(base, 'opencode', 'pantheon-quota.json')
38
+ }
39
+
40
+ export function readQuotaPrefs(filePath = resolveQuotaPrefsPath()): QuotaPrefs {
41
+ try {
42
+ if (!existsSync(filePath)) return { ...DEFAULT_QUOTA_PREFS }
43
+ const raw = JSON.parse(readFileSync(filePath, 'utf8')) as Partial<QuotaPrefs>
44
+ return {
45
+ sessionCap:
46
+ typeof raw.sessionCap === 'string' &&
47
+ ['$1.00', '$2.00', '$5.00', '$10.00', 'unlimited'].includes(raw.sessionCap)
48
+ ? raw.sessionCap
49
+ : DEFAULT_QUOTA_PREFS.sessionCap,
50
+ alertThreshold: raw.alertThreshold === 'disabled' ? 'disabled' : 'enabled',
51
+ autoCompact: raw.autoCompact === 'disabled' ? 'disabled' : 'enabled',
52
+ }
53
+ } catch {
54
+ return { ...DEFAULT_QUOTA_PREFS }
55
+ }
56
+ }
57
+
58
+ export function writeQuotaPrefs(prefs: QuotaPrefs, filePath = resolveQuotaPrefsPath()): void {
59
+ mkdirSync(dirname(filePath), { recursive: true })
60
+ writeFileSync(filePath, `${JSON.stringify(prefs, null, 2)}\n`, 'utf8')
61
+ }
62
+
63
+ export function applyQuotaRow(prefs: QuotaPrefs, id: string, value: string): QuotaPrefs {
64
+ const next = { ...prefs }
65
+ if (id === 'quota.budget.sessionCap') {
66
+ if (['$1.00', '$2.00', '$5.00', '$10.00', 'unlimited'].includes(value)) {
67
+ next.sessionCap = value
68
+ }
69
+ } else if (id === 'quota.budget.alertThreshold') {
70
+ next.alertThreshold = value === 'disabled' ? 'disabled' : 'enabled'
71
+ } else if (id === 'quota.compaction.auto') {
72
+ next.autoCompact = value === 'disabled' ? 'disabled' : 'enabled'
73
+ }
74
+ return next
75
+ }
76
+
77
+ export function buildQuotaTab(
78
+ snapshot?: QuotaSnapshot,
79
+ languagePref?: string,
80
+ prefs: QuotaPrefs = readQuotaPrefs(),
81
+ ): SettingsTab {
20
82
  const isPt = resolveLanguage(languagePref) === 'pt-BR'
21
83
 
22
84
  return {
@@ -29,25 +91,25 @@ export function buildQuotaTab(snapshot?: QuotaSnapshot, languagePref?: string):
29
91
  {
30
92
  id: 'quota.spend.today',
31
93
  name: isPt ? 'Gasto hoje (00h-agora)' : 'Spend today (00h-now)',
32
- value: snapshot?.todaySpend ?? '$0.00',
94
+ value: snapshot?.todaySpend ?? '—',
33
95
  note: isPt ? 'Calculado a partir de opencode.db' : 'Derived from opencode.db ledger',
34
96
  },
35
97
  {
36
98
  id: 'quota.spend.month',
37
99
  name: isPt ? 'Gasto acumulado (30d)' : 'Spend last 30 days',
38
- value: snapshot?.monthSpend ?? '$0.00',
100
+ value: snapshot?.monthSpend ?? '—',
39
101
  note: isPt ? 'Janela móvel de 30 dias' : 'Rolling 30-day window',
40
102
  },
41
103
  {
42
104
  id: 'quota.spend.session',
43
105
  name: isPt ? 'Gasto na sessão ativa' : 'Active session spend',
44
- value: snapshot?.sessionSpend ?? '$0.00',
106
+ value: snapshot?.sessionSpend ?? '—',
45
107
  note: isPt ? 'Custo de todas as mensagens do turno' : 'Sum of turn assistant messages',
46
108
  },
47
109
  {
48
110
  id: 'quota.tokens.context',
49
111
  name: isPt ? 'Tokens de contexto' : 'Context tokens',
50
- value: snapshot?.sessionTokens ?? '19.1k / 1.0M (2%)',
112
+ value: snapshot?.sessionTokens ?? '—',
51
113
  note: isPt
52
114
  ? 'Tokens consumidos vs janela do modelo'
53
115
  : 'Tokens used vs model context limit',
@@ -55,7 +117,7 @@ export function buildQuotaTab(snapshot?: QuotaSnapshot, languagePref?: string):
55
117
  {
56
118
  id: 'quota.tokens.cache',
57
119
  name: isPt ? 'Eficiência de cache' : 'Prompt cache hit',
58
- value: snapshot?.cacheHit ?? '97%',
120
+ value: snapshot?.cacheHit ?? '—',
59
121
  note: isPt ? 'Desconto de leitura em cache aplicado' : 'Cache read discount applied',
60
122
  },
61
123
  ],
@@ -66,7 +128,7 @@ export function buildQuotaTab(snapshot?: QuotaSnapshot, languagePref?: string):
66
128
  {
67
129
  id: 'quota.budget.sessionCap',
68
130
  name: isPt ? 'Teto por sessão' : 'Session budget cap',
69
- value: '$5.00',
131
+ value: prefs.sessionCap,
70
132
  cycle: ['$1.00', '$2.00', '$5.00', '$10.00', 'unlimited'],
71
133
  note: isPt
72
134
  ? 'Avisa ou pausa ao atingir o teto'
@@ -75,7 +137,7 @@ export function buildQuotaTab(snapshot?: QuotaSnapshot, languagePref?: string):
75
137
  {
76
138
  id: 'quota.budget.alertThreshold',
77
139
  name: isPt ? 'Alerta em 80% do teto' : 'Alert at 80% of cap',
78
- value: 'enabled',
140
+ value: prefs.alertThreshold,
79
141
  cycle: ['enabled', 'disabled'],
80
142
  note: isPt
81
143
  ? 'Emite aviso visual no footer da TUI'
@@ -84,7 +146,7 @@ export function buildQuotaTab(snapshot?: QuotaSnapshot, languagePref?: string):
84
146
  {
85
147
  id: 'quota.compaction.auto',
86
148
  name: isPt ? 'Auto-compactar em 80% do contexto' : 'Auto-compact at 80% context',
87
- value: 'enabled',
149
+ value: prefs.autoCompact,
88
150
  cycle: ['enabled', 'disabled'],
89
151
  note: isPt
90
152
  ? 'Aciona compressão automática de histórico'
@@ -111,8 +111,12 @@ export function previewTuiPrefs(base: TuiPrefs, draft?: SettingsDraft): TuiPrefs
111
111
  const effective: TuiPrefs = {
112
112
  version: 1,
113
113
  layout: { ...normalized.layout },
114
+ ...(normalized.theme ? { theme: { ...normalized.theme } } : {}),
114
115
  sidebar: {
115
116
  header: { ...normalized.sidebar.header },
117
+ ...(normalized.sidebar.pinnedSessions
118
+ ? { pinnedSessions: [...normalized.sidebar.pinnedSessions] }
119
+ : {}),
116
120
  blocks: { ...normalized.sidebar.blocks },
117
121
  context: { ...normalized.sidebar.context },
118
122
  },
@@ -785,6 +789,10 @@ export function tuiRowValue(prefs: TuiPrefs, id: string): string | undefined {
785
789
  return prefs.sidebar.context.performance
786
790
  case 'tui.sidebar.context.localSpend':
787
791
  return prefs.sidebar.context.localSpend
792
+ case 'tui.sidebar.context.turnCost':
793
+ return prefs.sidebar.context.turnCost
794
+ case 'tui.sidebar.context.tokenAnatomy':
795
+ return prefs.sidebar.context.tokenAnatomy
788
796
  case 'tui.footer.prompt':
789
797
  return prefs.footer.prompt
790
798
  case 'tui.footer.home':
package/src/routing.yml CHANGED
@@ -207,6 +207,7 @@ agents:
207
207
  - memory_recall
208
208
  - pantheon_resources
209
209
  skills:
210
+ - artifact-management
210
211
  - loop-engineering
211
212
  - memory-bank
212
213
  - reflect
@@ -254,6 +255,7 @@ agents:
254
255
  - pantheon_code_mode
255
256
  skills:
256
257
  - clonedeps
258
+ - code-review-checklist
257
259
  - fast-path-execution
258
260
  - git-workflow-and-versioning
259
261
  - incremental-implementation
@@ -357,6 +359,7 @@ agents:
357
359
  - incremental-implementation
358
360
  - loop-engineering
359
361
  - reflect
362
+ - security-hardening
360
363
  - simplify
361
364
  - worktrees
362
365
  hephaestus:
@@ -128,43 +128,14 @@ ID so the `latest` pointer survives compaction. `state` must be an object — ne
128
128
 
129
129
  ---
130
130
 
131
- ## Safety Policy Configuration
132
-
133
- Configurable gates for different platforms and risk levels:
131
+ ## Safety Policy Summary
134
132
 
135
133
  | Gate | Default | Auto-Approval Condition |
136
- |------|---------|------------------------|
134
+ |---|---|---|
137
135
  | Council | Only when explicitly invoked | Never auto-start a council for ordinary implementation |
138
136
  | Plan approval | Only for requested or risk-required plans | Skip for bounded, clear work |
139
137
  | Themis review | Required for sensitive/material changes | May omit for trivial isolated edits; never auto-bypass required findings |
140
138
  | Git / external actions | Never Auto | Commit, push, merge, deploy, destructive/global changes require explicit approval |
141
- | Deploy | Always Ask | N/A — always requires human |
142
- | Destructive DB Ops | Always Ask | N/A — always requires human |
143
-
144
- ### Configuration Format (for agents/PLAN.md)
145
-
146
- ```yaml
147
- auto-continue:
148
- checkpoint_interval: 5 # turns between checkpoints
149
- idle_warning: 60 # seconds before warning
150
- idle_stall: 120 # seconds before stall detection
151
- idle_pause: 300 # seconds before auto-pause
152
- gates:
153
- plan_approval: when_required_by_scope_or_risk
154
- themis_review: required_for_sensitive_or_material_changes
155
- git_commit: never_auto
156
- deploy: always_ask
157
- destructive_ops: always_ask
158
- ```
159
-
160
- ### Idle Detection
161
-
162
- | Condition | Action |
163
- |-----------|--------|
164
- | No tool call for 60s | Log warning heartbeat (status: warning) |
165
- | No tool call for 120s | Trigger anti-stall protocol |
166
- | No tool call for 300s | Auto-save checkpoint and pause session |
167
- | Resume | User must acknowledge and restart |
168
139
 
169
140
  ---
170
141