pantheon-opencode 1.5.2 → 1.6.0-beta.10

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 (146) hide show
  1. package/.pantheon/code-mode/README.md +4 -2
  2. package/.pantheon/code-mode/checkpoint_session.py +138 -102
  3. package/.pantheon/code-mode/compress-inline.py +102 -57
  4. package/.pantheon/code-mode/manifest.json +2 -8
  5. package/AGENTS.global.md +182 -0
  6. package/AGENTS.md +10 -891
  7. package/CHANGELOG.md +343 -0
  8. package/README.md +577 -79
  9. package/README.pt-BR.md +345 -60
  10. package/bin/pantheon-init.mjs +26 -3
  11. package/commands/pantheon-audit.md +7 -1
  12. package/commands/pantheon-consolidate.md +1 -1
  13. package/commands/pantheon-deepwork.md +14 -3
  14. package/commands/pantheon-focus.md +17 -0
  15. package/commands/pantheon-optimize.md +2 -2
  16. package/commands/pantheon-vision.md +61 -12
  17. package/package.json +30 -11
  18. package/plugin.json +2 -2
  19. package/pyproject.toml +11 -16
  20. package/scripts/build-agents-md.mjs +376 -58
  21. package/scripts/changelog-merge.mjs +161 -0
  22. package/scripts/check-plugin-v2-coverage.mjs +213 -0
  23. package/scripts/ci-validate-yaml.py +7 -5
  24. package/scripts/{code_mode_server.py → code_mode.py} +119 -27
  25. package/scripts/cost.mjs +244 -41
  26. package/scripts/doctor.mjs +236 -29
  27. package/scripts/install/agents-md.mjs +4 -4
  28. package/scripts/install/cli-ui.mjs +1 -1
  29. package/scripts/install/config-migration.mjs +319 -6
  30. package/scripts/install/health-check.mjs +26 -37
  31. package/scripts/install/interactive.mjs +7 -7
  32. package/scripts/install/migrate.mjs +1 -1
  33. package/scripts/install/opencode-version.mjs +246 -4
  34. package/scripts/install/opencode.mjs +627 -179
  35. package/scripts/install/plugin.mjs +43 -9
  36. package/scripts/install/shared.mjs +120 -12
  37. package/scripts/install/vision-prompt.mjs +161 -0
  38. package/scripts/install-mcp.mjs +28 -9
  39. package/scripts/{mcp_persistence_server.py → mcp_persistence.py} +392 -78
  40. package/{src/mcp/mcp_resources_server.py → scripts/mcp_resources.py} +2 -2
  41. package/scripts/{memory_mcp_server.py → memory_mcp.py} +372 -198
  42. package/scripts/postinstall.mjs +0 -7
  43. package/scripts/probe-context-rehydrate.mjs +36 -13
  44. package/scripts/probe-pantheon-cost.mjs +71 -15
  45. package/scripts/prune.mjs +2 -2
  46. package/scripts/run-node-tests.mjs +189 -0
  47. package/scripts/sync-artifacts.mjs +26 -13
  48. package/scripts/sync-tui.mjs +24 -3
  49. package/scripts/test-opencode-v2-sandbox.sh +1913 -0
  50. package/scripts/validate-routing.mjs +43 -3
  51. package/scripts/validate-sandbox-install.mjs +138 -0
  52. package/scripts/versioning.mjs +13 -1
  53. package/scripts/vision-status.mjs +682 -0
  54. package/skills-lock.json +15 -16
  55. package/src/agents/aphrodite.md +20 -37
  56. package/src/agents/apollo.md +7 -3
  57. package/src/agents/athena.md +63 -35
  58. package/src/agents/demeter.md +8 -28
  59. package/src/agents/gaia.md +1 -1
  60. package/src/agents/hephaestus.md +10 -21
  61. package/src/agents/hermes.md +15 -38
  62. package/src/agents/iris.md +1 -1
  63. package/src/agents/mnemosyne.md +23 -60
  64. package/src/agents/nyx.md +1 -1
  65. package/src/agents/prometheus.md +16 -20
  66. package/src/agents/talos.md +10 -2
  67. package/src/agents/themis.md +5 -5
  68. package/src/agents/zeus.md +99 -130
  69. package/src/instructions/agent-return-format.instructions.md +18 -3
  70. package/src/instructions/backend-standards.instructions.md +2 -0
  71. package/src/instructions/frontend-standards.instructions.md +3 -1
  72. package/src/instructions/memory-protocol.instructions.md +11 -110
  73. package/src/instructions/zeus-anti-stall.instructions.md +14 -61
  74. package/src/instructions/zeus-communication-rules.instructions.md +0 -1
  75. package/src/instructions/zeus-council-synthesis.instructions.md +32 -260
  76. package/src/instructions/zeus-memory-operations.instructions.md +26 -0
  77. package/src/instructions/zeus-timeout-retry.instructions.md +40 -87
  78. package/src/mcp/{code_mode_server.py → code_mode.py} +119 -27
  79. package/src/mcp/eval_store.py +2 -2
  80. package/src/mcp/mcp_codemap_module.py +559 -129
  81. package/src/mcp/{mcp_persistence_server.py → mcp_persistence.py} +392 -78
  82. package/{scripts/mcp_resources_server.py → src/mcp/mcp_resources.py} +2 -2
  83. package/src/mcp/{memory_mcp_server.py → memory_mcp.py} +373 -250
  84. package/src/mcp/{pantheon_vision_server.py → pantheon_vision.py} +396 -40
  85. package/src/mcp/requirements-mcp.txt +10 -6
  86. package/src/mcp/requirements-vision.txt +4 -2
  87. package/src/pantheon/cost-command.ts +399 -101
  88. package/src/pantheon/delegation-enforce.ts +10 -1
  89. package/src/pantheon/model-command.ts +18 -7
  90. package/src/pantheon/presets.d.mts +0 -8
  91. package/src/pantheon/presets.mjs +5 -32
  92. package/src/pantheon/todo-enforcer.ts +1 -1
  93. package/src/pantheon/v2-bounded-read.ts +640 -0
  94. package/src/pantheon/v2-delegation-enforce.ts +214 -0
  95. package/src/pantheon/v2-execute-after.ts +186 -0
  96. package/src/pantheon/v2-tools.ts +429 -0
  97. package/src/pantheon/v2-unsupported.d.mts +11 -0
  98. package/src/pantheon/v2-unsupported.mjs +90 -0
  99. package/src/pantheon/v2-vision.ts +622 -0
  100. package/src/pantheon/vision-local.ts +531 -0
  101. package/src/pantheon/vision.ts +1161 -116
  102. package/src/plugin-v2.ts +1244 -288
  103. package/src/plugin.ts +12 -9
  104. package/src/plugins/tui/dist/server.d.ts +1 -2
  105. package/src/plugins/tui/dist/server.d.ts.map +1 -1
  106. package/src/plugins/tui/dist/tui-v2.d.ts +154 -0
  107. package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -0
  108. package/src/plugins/tui/dist/tui-v2.js +659 -0
  109. package/src/plugins/tui/dist/tui-v2.js.map +1 -0
  110. package/src/plugins/tui/dist/tui.d.ts +85 -82
  111. package/src/plugins/tui/dist/tui.d.ts.map +1 -1
  112. package/src/plugins/tui/dist/tui.js +72 -59
  113. package/src/plugins/tui/index-v2.ts +6 -0
  114. package/src/plugins/tui/package-lock.json +5504 -1341
  115. package/src/plugins/tui/package.json +25 -15
  116. package/src/plugins/tui/src/index-v2.tsx +734 -0
  117. package/src/plugins/tui/src/index.tsx +106 -85
  118. package/src/plugins/tui/src/opencode-v2.d.ts +13 -0
  119. package/src/plugins/tui/tsconfig.build.json +5 -0
  120. package/src/plugins/tui/tsconfig.typecheck.json +5 -0
  121. package/src/plugins/tui/tsdown.config.ts +22 -2
  122. package/src/plugins/tui/tui-v2.ts +2 -0
  123. package/src/plugins/tui/tui.ts +3 -0
  124. package/src/routing.yml +11 -22
  125. package/src/skills/README.md +34 -39
  126. package/src/skills/agent-coordination/SKILL.md +7 -2
  127. package/src/skills/artifact-management/SKILL.md +12 -5
  128. package/src/skills/auto-continue/SKILL.md +54 -95
  129. package/src/skills/code-review-checklist/SKILL.md +5 -5
  130. package/src/skills/context-compression/SKILL.md +26 -879
  131. package/src/skills/session-goal/SKILL.md +14 -5
  132. package/src/skills/spec-driven-development/SKILL.md +3 -1
  133. package/src/skills/tdd-with-agents/SKILL.md +18 -10
  134. package/.pantheon/code-mode/eval-llm-judge.py +0 -255
  135. package/.pantheon/code-mode/eval-monte-carlo.py +0 -368
  136. package/.pantheon/code-mode/eval-run.py +0 -197
  137. package/.pantheon/code-mode/eval-static.py +0 -321
  138. package/.pantheon/code-mode/session-end-save.py +0 -186
  139. package/.pantheon/code-mode/session-end-save.sh +0 -18
  140. package/opencode.json +0 -58
  141. package/scripts/recover-zenodo-deposition.mjs +0 -146
  142. package/scripts/test-opencode-v1-v2-sandbox.sh +0 -862
  143. package/scripts/validate-zenodo-release.mjs +0 -154
  144. package/scripts/zenodo-artifact.mjs +0 -94
  145. package/scripts/zenodo-release-state.mjs +0 -53
  146. package/src/skills/orchestration-workflow/SKILL.md +0 -311
@@ -350,7 +350,9 @@ function presetPathForScope(options: ModelCommandOptions, scope: ModelScope): st
350
350
  const globalCandidates = globalConfigCandidates(options).map((p) =>
351
351
  resolve(join(dirname(p), '.pantheon', 'active-preset.json')),
352
352
  )
353
- return globalCandidates[0] ?? candidates[0]!
353
+ const fallback = globalCandidates[0] ?? candidates[0]
354
+ if (!fallback) throw new ModelCommandError('global preset path is unavailable')
355
+ return fallback
354
356
  }
355
357
 
356
358
  async function readActivePresetRaw(path: string, label: string): Promise<ReadFileResult> {
@@ -552,10 +554,16 @@ async function updateActivePreset(
552
554
  const overrides = shaped.overrides as Record<string, unknown>
553
555
  const agents = overrides.agents as Record<string, unknown>
554
556
 
555
- const agentKey = validateAgent(args.agent!)
557
+ if (typeof args.agent !== 'string') {
558
+ throw new ModelCommandError(`${action} requires --agent <name>`)
559
+ }
560
+ const agentKey = validateAgent(args.agent)
556
561
 
557
562
  if (action === 'set') {
558
- const model = args.model!
563
+ if (typeof args.model !== 'string') {
564
+ throw new ModelCommandError('set requires --model <provider/model-id>')
565
+ }
566
+ const model = args.model
559
567
  const effort = args.effort
560
568
  let variantInfo: { variant: 'low' | 'medium' | 'high' | null; clamped: boolean }
561
569
  try {
@@ -778,22 +786,25 @@ async function promptViaReadline(
778
786
  ): Promise<Record<string, unknown>> {
779
787
  const answers: Record<string, unknown> = {}
780
788
  // Q1 agent
781
- const agentQ = questions[0]!
789
+ const agentQ = questions[0]
790
+ const modelQ = questions[1]
791
+ const effortQ = questions[2]
792
+ const scopeQ = questions[3]
793
+ if (!agentQ || !modelQ || !effortQ || !scopeQ) {
794
+ throw new ModelCommandError('wizard requires agent, model, effort, and scope questions')
795
+ }
782
796
  const agentPrompt = `${agentQ.question} [${KNOWN_AGENTS.join('/')}] : `
783
797
  const agentAns = (await rl.question(agentPrompt)).trim().toLowerCase()
784
798
  answers.agent = agentAns || KNOWN_AGENTS[0]
785
799
 
786
- const modelQ = questions[1]!
787
800
  const modelAns = (await rl.question(`${modelQ.question} : `)).trim()
788
801
  answers.model = modelAns
789
802
 
790
- const effortQ = questions[2]!
791
803
  const effortAns = (await rl.question(`${effortQ.question} [low/medium/high] : `))
792
804
  .trim()
793
805
  .toLowerCase()
794
806
  answers.effort = effortAns || 'medium'
795
807
 
796
- const scopeQ = questions[3]!
797
808
  const scopeAns = (await rl.question(`${scopeQ.question} [project/global] : `))
798
809
  .trim()
799
810
  .toLowerCase()
@@ -104,14 +104,6 @@ export interface RoutingRetryPolicyOptions {
104
104
  logger?: { warn?: (msg: string) => void }
105
105
  }
106
106
 
107
- /**
108
- * R4: per-agent step caps from routing.yml `agents.<name>.max_steps`.
109
- * Fail-open → {} (no agent capped).
110
- */
111
- export declare function loadRoutingMaxSteps(
112
- options?: RoutingRetryPolicyOptions,
113
- ): Record<string, number>
114
-
115
107
  /**
116
108
  * O5: permission.task glob rules from routing.yml `permission.task`
117
109
  * (glob pattern → 'allow' | 'deny'). Fail-open → null.
@@ -26,7 +26,7 @@
26
26
  import { readFileSync } from 'node:fs'
27
27
  import { join } from 'node:path'
28
28
  import { fileURLToPath } from 'node:url'
29
- import yaml from 'js-yaml'
29
+ import { load } from 'js-yaml'
30
30
 
31
31
  export const EFFORT_RANK = { low: 0, medium: 1, high: 2 }
32
32
 
@@ -61,6 +61,8 @@ export const CAPABILITY_TABLE = [
61
61
  // entry above matches 'mimo/v2.5' (full-string) but NOT 'mimo-v2.5'
62
62
  // (segment 'mimo-v2.5' has no slash, so 'mimo/' prefix cannot match).
63
63
  { prefix: 'mimo-v2.5', maxEffort: 'low', stripEffort: false, vision: true },
64
+ // Current free OpenCode Zen vision model (renamed to the v2.6 Flash family).
65
+ { prefix: 'mimo-v2.6-flash', maxEffort: 'low', stripEffort: false, vision: true },
64
66
  // mimo-v2.5-pro is text-only per models.dev api.json (2026-08-27).
65
67
  { prefix: 'mimo-v2.5-pro', maxEffort: 'low', stripEffort: false, vision: false },
66
68
  // Go subscription specific — bare segment prefixes so opencode-go/<model> IDs match
@@ -192,7 +194,7 @@ export function loadPresetDefs(routingPath) {
192
194
  }
193
195
  let routing
194
196
  try {
195
- routing = yaml.load(raw)
197
+ routing = load(raw)
196
198
  } catch (err) {
197
199
  throw new Error(`presets: failed to load routing.yml: ${err.message}`)
198
200
  }
@@ -209,39 +211,10 @@ export function loadPresetDefs(routingPath) {
209
211
  function loadRoutingYaml(routingPath) {
210
212
  const path = routingPath ?? fileURLToPath(new URL('../routing.yml', import.meta.url))
211
213
  const raw = readFileSync(path, 'utf8')
212
- const routing = yaml.load(raw)
214
+ const routing = load(raw)
213
215
  return routing && typeof routing === 'object' ? routing : null
214
216
  }
215
217
 
216
- /**
217
- * Load the R4 per-agent step caps from routing.yml
218
- * (`agents.<name>.max_steps`). Fail-open: missing config yields {}.
219
- *
220
- * @param {object} [opts]
221
- * @param {string} [opts.routingPath]
222
- * @param {{warn?: Function}} [opts.logger]
223
- * @returns {Record<string, number>} lowercase agent → max_steps
224
- */
225
- export function loadRoutingMaxSteps({ routingPath, logger = console } = {}) {
226
- try {
227
- const routing = loadRoutingYaml(routingPath)
228
- const agents = routing?.agents
229
- if (!agents || typeof agents !== 'object') return {}
230
- const out = {}
231
- for (const [agent, spec] of Object.entries(agents)) {
232
- const maxSteps = spec && typeof spec === 'object' ? spec.max_steps : undefined
233
- if (Number.isSafeInteger(maxSteps) && maxSteps > 0) {
234
- out[agent.toLowerCase()] = maxSteps
235
- }
236
- }
237
- return out
238
- } catch (err) {
239
- const reason = err instanceof Error ? err.message : String(err)
240
- logger.warn?.(`presets: routing.yml max_steps unavailable (${reason})`)
241
- return {}
242
- }
243
- }
244
-
245
218
  /**
246
219
  * Load the O5 permission.task glob rules from routing.yml
247
220
  * (`permission.task:`). Fail-open: missing config yields null (caller keeps
@@ -49,7 +49,7 @@
49
49
 
50
50
  import type { BackgroundJobBoard } from './background-job-board.ts'
51
51
  import { createPantheonLogger } from './logger.ts'
52
- import { buildChildrenPath, safeSessionPath } from './session-guard.ts'
52
+ import { safeSessionPath } from './session-guard.ts'
53
53
 
54
54
  // Silence-by-default TUI policy (pantheon-hooks L42-58): the default warn
55
55
  // fallback logs to .pantheon/logs/hooks.log; console echo is opt-in via