pantheon-opencode 2.0.0-beta.6 → 2.0.0-rc.1

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 (58) hide show
  1. package/AGENTS.global.md +6 -1
  2. package/AGENTS.md +1 -1
  3. package/CHANGELOG.md +45 -0
  4. package/README.md +169 -510
  5. package/README.pt-BR.md +177 -149
  6. package/bin/pantheon-init.mjs +1 -1
  7. package/commands/pantheon-deepwork.md +6 -1
  8. package/commands/pantheon.md +10 -5
  9. package/package.json +1 -1
  10. package/plugin.json +2 -2
  11. package/prompts/orchestrate-with-zeus.prompt.md +82 -290
  12. package/prompts/subtask.prompt.md +1 -1
  13. package/pyproject.toml +1 -1
  14. package/scripts/doctor.mjs +27 -11
  15. package/scripts/hooks/format-multi-language.sh +30 -48
  16. package/scripts/jev-live-probe.mjs +1 -1
  17. package/scripts/release-gates.mjs +19 -5
  18. package/scripts/skill-search.mjs +27 -3
  19. package/scripts/test-opencode-sandbox.sh +44 -15
  20. package/scripts/update.mjs +9 -2
  21. package/skills-lock.json +5 -3
  22. package/src/agents/aphrodite.md +2 -0
  23. package/src/agents/apollo.md +8 -206
  24. package/src/agents/athena.md +25 -29
  25. package/src/agents/hermes.md +3 -1
  26. package/src/agents/mnemosyne.md +1 -1
  27. package/src/agents/nyx.md +1 -1
  28. package/src/agents/prometheus.md +0 -203
  29. package/src/agents/talos.md +2 -0
  30. package/src/agents/themis.md +8 -3
  31. package/src/agents/zeus.md +18 -12
  32. package/src/instructions/memory-protocol.instructions.md +4 -0
  33. package/src/instructions/test-economy.instructions.md +1 -0
  34. package/src/instructions/zeus-council-synthesis.instructions.md +13 -1
  35. package/src/pantheon/pantheon-decision-catalog.ts +8 -0
  36. package/src/pantheon/skill-search-tool.ts +193 -0
  37. package/src/pantheon/tools.ts +2 -0
  38. package/src/plugins/tui/dist/tui.d.ts +12 -2
  39. package/src/plugins/tui/dist/tui.d.ts.map +1 -1
  40. package/src/plugins/tui/dist/tui.js +980 -358
  41. package/src/plugins/tui/dist/tui.js.map +1 -1
  42. package/src/plugins/tui/package-lock.json +2 -2
  43. package/src/plugins/tui/package.json +1 -1
  44. package/src/plugins/tui/src/autonomy-state.ts +1 -1
  45. package/src/plugins/tui/src/context-gauge.ts +64 -5
  46. package/src/plugins/tui/src/decision-router-state.ts +49 -2
  47. package/src/plugins/tui/src/index.tsx +25 -3
  48. package/src/plugins/tui/src/pantheon-settings-state.ts +99 -0
  49. package/src/plugins/tui/src/pantheon-settings.tsx +391 -101
  50. package/src/plugins/tui/src/tui-prefs.ts +161 -9
  51. package/src/plugins/tui/src/update-status.ts +27 -8
  52. package/src/routing.yml +9 -0
  53. package/src/skills/README.md +35 -25
  54. package/src/skills/fast-path-execution/SKILL.md +54 -0
  55. package/src/skills/prompt-refinery/SKILL.md +51 -65
  56. package/src/skills/tdd-with-agents/SKILL.md +22 -10
  57. package/src/skills/test-slicing/SKILL.md +56 -0
  58. package/src/skills/verification-planning/SKILL.md +4 -3
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pantheon-tui",
3
- "version": "2.0.0-beta.6",
3
+ "version": "2.0.0-rc.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pantheon-tui",
9
- "version": "2.0.0-beta.6",
9
+ "version": "2.0.0-rc.1",
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.0.0-beta.6",
4
+ "version": "2.0.0-rc.1",
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": {
@@ -20,7 +20,7 @@
20
20
  * enforced: J1 owns the risk axis, budgets own the money axis — this tab
21
21
  * shows where the thresholds sit today.
22
22
  */
23
- import type { SettingsRow, SettingsTab } from './pantheon-settings-state.ts'
23
+ import type { SettingsTab } from './pantheon-settings-state.ts'
24
24
 
25
25
  export interface GoalLoopPrefs {
26
26
  enabled: boolean
@@ -6,6 +6,29 @@ export const CONTEXT_BAR_CELLS = 12
6
6
  export const CONTEXT_BAR_FILLED_CELL = '\u25B0'
7
7
  export const CONTEXT_BAR_EMPTY_CELL = '\u25B1'
8
8
 
9
+ export type BarShape = 'block' | 'line' | 'smooth' | 'ascii' | 'dots' | 'braille'
10
+
11
+ export interface BarShapeGlyphs {
12
+ filled: string
13
+ empty: string
14
+ mark?: string
15
+ }
16
+
17
+ export const BAR_SHAPES: Record<BarShape, BarShapeGlyphs> = {
18
+ block: { filled: '\u25B0', empty: '\u25B1', mark: '│' },
19
+ line: { filled: '━', empty: '─', mark: '┼' },
20
+ smooth: { filled: '█', empty: '░', mark: '┆' },
21
+ ascii: { filled: '=', empty: '-', mark: '|' },
22
+ dots: { filled: '●', empty: '○', mark: '│' },
23
+ braille: { filled: '⣿', empty: '⣀', mark: '⡇' },
24
+ }
25
+
26
+ export interface ContextBarOptions {
27
+ cells?: number
28
+ shape?: BarShape
29
+ evenMark?: boolean
30
+ }
31
+
9
32
  function numberOrNull(value: unknown): number | null {
10
33
  return typeof value === 'number' && Number.isFinite(value) ? value : null
11
34
  }
@@ -40,15 +63,51 @@ export function contextBarFilled(percent: number, cells = CONTEXT_BAR_CELLS): nu
40
63
 
41
64
  export function contextBar(
42
65
  percent: number | null | undefined,
43
- cells = CONTEXT_BAR_CELLS,
66
+ options: number | ContextBarOptions = CONTEXT_BAR_CELLS,
44
67
  ): { filled: string; empty: string } | null {
45
68
  const value = numberOrNull(percent)
46
69
  if (value === null) return null
47
- const total = Math.max(1, Math.floor(cells))
48
- const filled = contextBarFilled(value, total)
70
+ const total = Math.max(
71
+ 1,
72
+ Math.floor(typeof options === 'number' ? options : (options?.cells ?? CONTEXT_BAR_CELLS)),
73
+ )
74
+ const shapeKey =
75
+ typeof options === 'object' && options?.shape && options.shape in BAR_SHAPES
76
+ ? options.shape
77
+ : 'block'
78
+ const glyphs = BAR_SHAPES[shapeKey] ?? BAR_SHAPES.block
79
+ const evenMark = typeof options === 'object' ? Boolean(options?.evenMark) : false
80
+
81
+ const filledCount = contextBarFilled(value, total)
82
+ const emptyCount = total - filledCount
83
+
84
+ if (!evenMark || total < 4) {
85
+ return {
86
+ filled: glyphs.filled.repeat(filledCount),
87
+ empty: glyphs.empty.repeat(emptyCount),
88
+ }
89
+ }
90
+
91
+ // Insert even-use mark at the midpoint (50%)
92
+ const mid = Math.floor(total / 2)
93
+ const mark = glyphs.mark ?? '|'
94
+
95
+ if (filledCount <= mid) {
96
+ // Mark is in the empty portion
97
+ const emptyBefore = mid - filledCount
98
+ const emptyAfter = Math.max(0, emptyCount - emptyBefore - 1)
99
+ return {
100
+ filled: glyphs.filled.repeat(filledCount),
101
+ empty: `${glyphs.empty.repeat(emptyBefore)}${mark}${glyphs.empty.repeat(emptyAfter)}`,
102
+ }
103
+ }
104
+
105
+ // Mark is in the filled portion
106
+ const filledBefore = mid
107
+ const filledAfter = Math.max(0, filledCount - filledBefore - 1)
49
108
  return {
50
- filled: CONTEXT_BAR_FILLED_CELL.repeat(filled),
51
- empty: CONTEXT_BAR_EMPTY_CELL.repeat(total - filled),
109
+ filled: `${glyphs.filled.repeat(filledBefore)}${mark}${glyphs.filled.repeat(filledAfter)}`,
110
+ empty: glyphs.empty.repeat(emptyCount),
52
111
  }
53
112
  }
54
113
 
@@ -290,9 +290,56 @@ export function applyDecisionRow(
290
290
  }
291
291
  }
292
292
 
293
+ /** The host's provider auth store (`opencode auth login` writes here). */
294
+ export function decisionAuthStorePath(env: Record<string, string | undefined> = process.env) {
295
+ const xdgData = env.XDG_DATA_HOME
296
+ const home = env.HOME ?? ''
297
+ const root = xdgData ?? join(home, '.local', 'share')
298
+ return join(root, 'opencode', 'auth.json')
299
+ }
300
+
301
+ /** Provider ids as they appear in the host auth store / config providers. */
302
+ const PROVIDER_AUTH_NAMES: Readonly<Record<string, readonly string[]>> = Object.freeze({
303
+ 'openai-decisions': Object.freeze(['openai']),
304
+ 'typesafe-jev': Object.freeze(['typesafe-ai']),
305
+ 'opencode-console-jev': Object.freeze([]),
306
+ 'openrouter-jev': Object.freeze(['openrouter']),
307
+ 'vercel-gateway-jev': Object.freeze(['vercel-ai-gateway', 'vercel']),
308
+ 'cloudflare-workers-jev': Object.freeze(['cloudflare-workers-ai']),
309
+ })
310
+
311
+ export type CredentialForm = 'env' | 'auth store' | 'config' | 'missing'
312
+
313
+ /**
314
+ * TWO recognition forms (field feedback beta.6: keys registered via
315
+ * `opencode auth login` showed MISSING because only env vars were checked):
316
+ * env var set → 'env'; provider present in the host auth store → 'auth
317
+ * store'; provider entry in opencode.json providers → 'config'. Values are
318
+ * NEVER read — existence only.
319
+ */
320
+ export function credentialStatus(
321
+ provider: string,
322
+ env: Record<string, string | undefined>,
323
+ authProviders: ReadonlySet<string>,
324
+ configProviders: ReadonlySet<string>,
325
+ ): CredentialForm {
326
+ const credential = DECISION_PROVIDER_CREDENTIALS[provider]
327
+ if (credential?.env !== undefined && env[credential.env]) return 'env'
328
+ for (const name of PROVIDER_AUTH_NAMES[provider] ?? []) {
329
+ if (authProviders.has(name)) return 'auth store'
330
+ }
331
+ for (const name of PROVIDER_AUTH_NAMES[provider] ?? []) {
332
+ if (configProviders.has(name)) return 'config'
333
+ }
334
+ if (provider === 'opencode-console-jev') return 'auth store'
335
+ return 'missing'
336
+ }
337
+
293
338
  export function buildDecisionTab(
294
339
  read: DecisionConfigRead,
295
340
  env: Record<string, string | undefined> = process.env,
341
+ authProviders: ReadonlySet<string> = new Set(),
342
+ configProviders: ReadonlySet<string> = new Set(),
296
343
  ): SettingsTab {
297
344
  const { config, corrupt } = read
298
345
  const rows: SettingsRow[] = [
@@ -352,12 +399,12 @@ export function buildDecisionTab(
352
399
  {
353
400
  title: 'Credentials (status only — values never enter the window)',
354
401
  rows: DECISION_KNOWN_PROVIDERS.map((provider) => {
402
+ const status = credentialStatus(provider, env, authProviders, configProviders)
355
403
  const credential = DECISION_PROVIDER_CREDENTIALS[provider] ?? { note: '' }
356
- const isSet = credential.env === undefined ? true : Boolean(env[credential.env])
357
404
  return {
358
405
  id: `decision.key.${provider}`,
359
406
  name: provider,
360
- value: credential.env === undefined ? 'n/a' : isSet ? 'set' : 'MISSING',
407
+ value: status === 'missing' ? 'MISSING' : status,
361
408
  note: credential.note,
362
409
  }
363
410
  }),
@@ -12,6 +12,7 @@ import type { Context, KeymapLayer, PanelInput } from '@opencode/plugin/tui/cont
12
12
  import type { Accessor, JSX } from 'solid-js'
13
13
  import { createEffect, createMemo, createSignal, For, on, onCleanup, onMount, Show } from 'solid-js'
14
14
  import {
15
+ CONTEXT_BAR_CELLS,
15
16
  type ContextProgressTone,
16
17
  contextBar,
17
18
  contextUsageTone,
@@ -693,6 +694,7 @@ export function contextBlockRows(
693
694
  usage: ContextUsage | null,
694
695
  cost: number | null | undefined,
695
696
  gaugeStyle: 'both' | 'bar' | 'percent' | 'off' = 'both',
697
+ barOptions?: number | { shape?: any; cells?: number; evenMark?: boolean },
696
698
  ): ContextBlockRows | null {
697
699
  const spentValue = formatSpent(cost)
698
700
  const spent: ContextRow | null =
@@ -709,7 +711,7 @@ export function contextBlockRows(
709
711
 
710
712
  const percentValue = numberOrNull(usage.percent)
711
713
  const window = formatContextWindow(usage.limit)
712
- const bar = contextBar(percentValue)
714
+ const bar = contextBar(percentValue, barOptions ?? CONTEXT_BAR_CELLS)
713
715
  let percent: ContextRow | null = null
714
716
  if (gaugeStyle !== 'off' && bar !== null && percentValue !== null) {
715
717
  const suffix = window === null ? null : ` of ${window}`
@@ -4025,7 +4027,19 @@ function Sidebar(props: SidebarProps): JSX.Element {
4025
4027
  // host store, so a flip in /pantheon-settings re-renders here instantly).
4026
4028
  const contextRows = () => {
4027
4029
  const prefs = tuiPrefs()
4028
- const rows = contextBlockRows(model.contextUsage(), model.cost(), prefs.sidebar.context.gauge)
4030
+ const barCells =
4031
+ prefs.sidebar.context.barWidth === 'compact'
4032
+ ? 8
4033
+ : prefs.sidebar.context.barWidth === 'wide'
4034
+ ? 16
4035
+ : prefs.sidebar.context.barWidth === 'full'
4036
+ ? 20
4037
+ : 12
4038
+ const rows = contextBlockRows(model.contextUsage(), model.cost(), prefs.sidebar.context.gauge, {
4039
+ shape: prefs.sidebar.context.barShape,
4040
+ cells: barCells,
4041
+ evenMark: prefs.sidebar.context.evenMark,
4042
+ })
4029
4043
  if (rows === null) return null
4030
4044
  return {
4031
4045
  tokens: prefs.sidebar.context.tokens ? rows.tokens : null,
@@ -4053,10 +4067,18 @@ function Sidebar(props: SidebarProps): JSX.Element {
4053
4067
  // session each drop independently; nothing reflows — the column just shortens.
4054
4068
  const header = () => tuiPrefs().sidebar.header
4055
4069
  return (
4056
- <box flexDirection="column" width="100%" padding={1}>
4070
+ <box
4071
+ flexDirection="column"
4072
+ width="100%"
4073
+ paddingLeft={1}
4074
+ paddingRight={1}
4075
+ paddingTop={tuiPrefs().layout.preset === 'compact' ? 0 : 1}
4076
+ paddingBottom={tuiPrefs().layout.preset === 'compact' ? 0 : 1}
4077
+ >
4057
4078
  <Show when={header().version}>
4058
4079
  <text fg={text()} attributes={1}>{`Pantheon v${__PANTHEON_VERSION__}`}</text>
4059
4080
  </Show>
4081
+
4060
4082
  {/* Preset plus the provider of the model in use — both derived from host
4061
4083
  state. The provider is dropped when nothing resolves, so the row is
4062
4084
  never a placeholder. */}
@@ -162,6 +162,8 @@ export interface SettingsRow {
162
162
  value: string
163
163
  /** Allowed values for ←/→; presence marks the row as editable. */
164
164
  cycle?: readonly string[]
165
+ /** The row's DEFAULT value — what the Defaults action stages. */
166
+ def?: string
165
167
  /** Right-column note (writes-where, applies-live, from-where). */
166
168
  note?: string
167
169
  /** Enter triggers this action instead of cycling (e.g. `update-check`). */
@@ -225,6 +227,45 @@ export function stageValue(
225
227
  return { ...draft, [row.id]: staged }
226
228
  }
227
229
 
230
+ /** Stage an explicit target value for one row (the Defaults action path). */
231
+ export function stageRowToValue(
232
+ draft: SettingsDraft,
233
+ row: SettingsRow,
234
+ target: string,
235
+ ): SettingsDraft {
236
+ if (!row.cycle?.includes(target)) return draft
237
+ if (target === row.value) {
238
+ if (draft[row.id] === undefined) return draft
239
+ const next = { ...draft }
240
+ delete next[row.id]
241
+ return next
242
+ }
243
+ return { ...draft, [row.id]: target }
244
+ }
245
+
246
+ /**
247
+ * Stage every cyclable row's DEFAULT value of a tab. Rows already at their
248
+ * default have their staged entry dropped; rows staged elsewhere keep it
249
+ * until the Defaults action targets them.
250
+ */
251
+ export function stageDefaults(draft: SettingsDraft, tab: SettingsTab): SettingsDraft {
252
+ let next = draft
253
+ for (const row of tabRows(tab)) {
254
+ if (row.cycle === undefined || row.def === undefined) continue
255
+ const candidate = next[row.id] ?? row.value
256
+ if (candidate === row.def) {
257
+ if (next[row.id] !== undefined) {
258
+ const copy = { ...next }
259
+ delete copy[row.id]
260
+ next = copy
261
+ }
262
+ continue
263
+ }
264
+ next = stageRowToValue(next, { ...row, value: candidate }, row.def)
265
+ }
266
+ return next
267
+ }
268
+
228
269
  /** Drop every staged entry of one tab (ctrl+r). */
229
270
  export function resetTab(draft: SettingsDraft, tab: SettingsTab): SettingsDraft {
230
271
  const ids = new Set(tabRows(tab).map((row) => row.id))
@@ -342,3 +383,61 @@ export function buildAboutTab(version: string): SettingsTab {
342
383
  ],
343
384
  }
344
385
  }
386
+
387
+ export interface ChangelogHighlightItem {
388
+ title: string
389
+ detail: string
390
+ group?: string | undefined
391
+ }
392
+
393
+ export function buildChangelogTab(
394
+ version: string,
395
+ items: ChangelogHighlightItem[] = [],
396
+ ): SettingsTab {
397
+ const rows: SettingsRow[] = []
398
+ if (items.length > 0) {
399
+ items.forEach((item, index) => {
400
+ rows.push({
401
+ id: `changelog.item.${index + 1}`,
402
+ name: item.title.slice(0, 26),
403
+ value: item.detail.length > 20 ? `${item.detail.slice(0, 19)}…` : item.detail,
404
+ note: item.detail,
405
+ })
406
+ })
407
+ } else {
408
+ rows.push({
409
+ id: 'changelog.info',
410
+ name: 'Release',
411
+ value: `v${version}`,
412
+ note: 'view full history in CHANGELOG.md or GitHub releases',
413
+ })
414
+ }
415
+
416
+ return {
417
+ id: 'changelog',
418
+ title: 'Changelog',
419
+ groups: [
420
+ {
421
+ title: `What's New in v${version}`,
422
+ rows,
423
+ },
424
+ {
425
+ title: 'Release References',
426
+ rows: [
427
+ {
428
+ id: 'changelog.docs',
429
+ name: 'Documentation',
430
+ value: 'CHANGELOG.md',
431
+ note: 'shipped at plugin root and repository root',
432
+ },
433
+ {
434
+ id: 'changelog.repo',
435
+ name: 'GitHub Repository',
436
+ value: 'ils15/pantheon-opencode',
437
+ note: 'releases, pull requests and discussion',
438
+ },
439
+ ],
440
+ },
441
+ ],
442
+ }
443
+ }