pantheon-opencode 1.1.1 → 1.2.0-beta.9.7bef03e

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 (45) hide show
  1. package/README.md +74 -1
  2. package/bin/pantheon-init.mjs +79 -0
  3. package/commands/pantheon-audit.md +25 -0
  4. package/commands/pantheon-consolidate.md +11 -0
  5. package/commands/pantheon-deepwork.md +79 -0
  6. package/commands/pantheon-optimize.md +79 -0
  7. package/commands/pantheon-vision.md +67 -0
  8. package/commands/pantheon.md +49 -0
  9. package/opencode.json +12 -41
  10. package/package.json +5 -1
  11. package/scripts/doctor.mjs +4 -2
  12. package/scripts/install/health-check.mjs +101 -1
  13. package/scripts/install/model-picker.mjs +118 -0
  14. package/scripts/install/opencode.mjs +98 -17
  15. package/scripts/install-mcp.mjs +98 -13
  16. package/scripts/mcp_persistence_server.py +331 -1
  17. package/scripts/secret-scan.mjs +76 -0
  18. package/scripts/validate-routing.mjs +15 -0
  19. package/src/agents/aphrodite.md +7 -0
  20. package/src/agents/demeter.md +7 -0
  21. package/src/agents/hephaestus.md +7 -0
  22. package/src/agents/hermes.md +7 -0
  23. package/src/agents/zeus.md +31 -18
  24. package/src/instructions/agent-return-format.instructions.md +1 -0
  25. package/src/instructions/zeus-anti-stall.instructions.md +43 -5
  26. package/src/instructions/zeus-timeout-retry.instructions.md +47 -10
  27. package/src/mcp/install-mcp.mjs +6 -913
  28. package/src/mcp/mcp_persistence_server.py +332 -0
  29. package/src/mcp/pantheon_vision_server.py +495 -0
  30. package/src/mcp/requirements-vision.txt +3 -0
  31. package/src/pantheon/auto-wake.ts +91 -0
  32. package/src/pantheon/background-job-board.ts +568 -0
  33. package/src/pantheon/file-persistence.ts +95 -0
  34. package/src/pantheon/presets.d.mts +99 -0
  35. package/src/pantheon/presets.mjs +491 -0
  36. package/src/pantheon/vision.ts +1340 -0
  37. package/src/plugin.ts +40 -25
  38. package/src/plugins/tui/dist/tui.d.ts.map +1 -1
  39. package/src/plugins/tui/dist/tui.js +806 -222
  40. package/src/plugins/tui/dist/tui.tsx +866 -121
  41. package/src/plugins/tui/package.json +2 -2
  42. package/src/plugins/tui/src/index.tsx +866 -121
  43. package/src/routing.yml +179 -0
  44. package/commands/pantheon-reflect.md +0 -16
  45. package/commands/pantheon-verify.md +0 -17
package/README.md CHANGED
@@ -172,6 +172,9 @@ npx pantheon-opencode init
172
172
  # Headless mode — for CI and automation
173
173
  npx pantheon-opencode init --headless
174
174
 
175
+ # (Optional) Install + activate a model routing preset
176
+ npx pantheon-opencode init --preset go-fast
177
+
175
178
  # (Optional) Install MCP servers + skills + TUI plugin
176
179
  npm run setup
177
180
 
@@ -182,7 +185,7 @@ opencode
182
185
 
183
186
  > **Modes:** Interactive TUI with checkbox selection (default TTY), or `--headless` for scripts/CI.
184
187
  > **Minimal:** `--headless --no-mcp` installs only agents (~2s).
185
- > **Full:** `--headless` also creates Python venv + MCP servers (memory, persistence, KV).
188
+ > **Full:** `--headless` also creates Python venv + MCP servers (memory, persistence, KV, vision).
186
189
 
187
190
  ---
188
191
 
@@ -418,6 +421,76 @@ subscription (OpenCode Go, Copilot Pro, Claude Pro, etc.).
418
421
 
419
422
  ---
420
423
 
424
+ ## Model Routing Presets
425
+
426
+ The abstract tiers above are pinned to concrete `provider/model` IDs by **6 built-in model presets**. Each preset maps all 14 agents to a specific model plus a reasoning effort per role (planners/reviewers, implementers, scouts). **Zero-mutation default**: without an active preset, agents run on OpenCode's default model — behavior is unchanged.
427
+
428
+ ### Presets
429
+
430
+ | Preset | Provider | Planners/Reviewers | Implementers | Scouts |
431
+ |--------|----------|--------------------|--------------|--------|
432
+ | `go-deepseek` | opencode (Zen) | `opencode/deepseek-v4-pro` | `opencode/deepseek-v4-flash` | `opencode/deepseek-v4-flash-free` |
433
+ | `go-fast` | opencode-go | `opencode-go/deepseek-v4-flash` — all 14 agents, effort `low` | | |
434
+ | `go-claude` | anthropic | `anthropic/claude-opus-4-8` | `anthropic/claude-sonnet-5` | `anthropic/claude-haiku-4-5` |
435
+ | `go-openai` | openai | `openai/gpt-5.6-sol` | `openai/gpt-5.6-terra` | `openai/gpt-5.6-luna-fast` |
436
+ | `go-premium` | opencode-go | GLM-5.1 (zeus), DeepSeek V4 Pro (athena), Qwen3.7 Max (themis) | MiniMax M2.7 (hermes, hephaestus), Kimi K2.6 (aphrodite), Qwen3.7 Plus (demeter), GLM-5.2 (prometheus) | DeepSeek V4 Flash (scouts) |
437
+ | `go-free` | opencode (Zen free, $0) | Big Pickle (zeus), Nemotron 3 Ultra Free (athena) | DeepSeek V4 Flash Free | North Mini Code Free (scouts) |
438
+
439
+ The exact per-agent mapping (model + reasoning effort + fallbacks) lives in the `presets:` block of [src/routing.yml](src/routing.yml).
440
+
441
+ ### Requirements
442
+
443
+ - **Env vars** — checked fail-fast (CLI and plugin) when the selected preset uses the provider:
444
+ - `PANTHEON_OPENCODE_API_KEY` — `opencode` + `opencode-go` providers (`go-deepseek`, `go-fast`, `go-premium`, `go-free`)
445
+ - `PANTHEON_ANTHROPIC_API_KEY` — `anthropic` provider (`go-claude`)
446
+ - `PANTHEON_OPENAI_API_KEY` — `openai` provider (`go-openai`)
447
+ - **OpenCode Go subscription** required for `go-fast` / `go-premium`.
448
+ - **OpenCode Zen free tier** for `go-free` — note `nemotron-3-ultra-free` has known intermittent failures ([opencode#38028](https://github.com/opencode/opencode/issues/38028)); fall back to `go-fast` if flaky.
449
+
450
+ ### Commands
451
+
452
+ ```bash
453
+ # Install + activate a preset
454
+ npx pantheon-opencode init --preset go-fast
455
+
456
+ # Switch preset (global config; --project for project-local; --dry-run to preview)
457
+ pantheon-opencode set-tier go-deepseek
458
+ pantheon-opencode set-tier go-fast --project
459
+ pantheon-opencode set-tier go-fast --dry-run
460
+
461
+ # Clear preset — back to the zero-mutation default
462
+ pantheon-opencode set-tier none
463
+
464
+ # No name → lists available presets (none, go-deepseek, go-fast, go-claude, go-openai, go-premium, go-free)
465
+ pantheon-opencode set-tier
466
+ ```
467
+
468
+ **Env override (CI/headless)** — wins over the file:
469
+
470
+ ```bash
471
+ export PANTHEON_MODEL_PRESET=go-deepseek
472
+ ```
473
+
474
+ ### How it works
475
+
476
+ - The active selection is persisted to `.pantheon/active-preset.json` — `{version, preset, source, updated_at}` — written atomically (tmp file + rename) with a `.bak` backup of the previous file. It applies on the next OpenCode startup (no hot-swap); the plugin's `hooks.config` injects it.
477
+ - **Resolution precedence**: `PANTHEON_MODEL_PRESET` env → first existing `.pantheon/active-preset.json` (project → `~/.config/opencode` → `~/.opencode`) → **none** (defaults).
478
+ - **Partial semantics**: a preset overrides only the agents it lists; unlisted agents inherit the invoking primary agent's model.
479
+ - Interactive picker during `init`: one prompt listing the 6 presets (select by number or name, blank to skip). It never touches your `opencode.json` — the choice is injected at startup instead. The file format also supports an optional `overrides` block (per-agent `model`/`variant`, per-provider `baseURL`/`apiKeyEnv`) merged over the preset definition.
480
+ - **Capability normalization**: requested reasoning effort is clamped to each model family's ceiling (`deepseek-v4-flash` max `medium`; claude models strip the variant entirely — Anthropic uses thinking).
481
+ - **fallback_models**: per-agent ordered fallback list where configured (e.g. `go-deepseek` sets `[opencode/mimo-v2.5]` for every agent).
482
+
483
+ ### Quick smoke test
484
+
485
+ ```bash
486
+ export PANTHEON_OPENCODE_API_KEY=...
487
+ pantheon-opencode set-tier go-fast --project
488
+ opencode run "hello" 2>&1 | grep "Pantheon"
489
+ # expect: [Pantheon Plugin] Model preset active: go-fast (source: file)
490
+ ```
491
+
492
+ ---
493
+
421
494
  ## Quick Start
422
495
 
423
496
  ### 1. Install Pantheon
@@ -8,6 +8,7 @@
8
8
  * installOpenCode() from scripts/install/opencode.mjs.
9
9
  */
10
10
  import fs from 'fs';
11
+ import os from 'os';
11
12
  import path from 'path';
12
13
  import { fileURLToPath } from 'url';
13
14
 
@@ -33,6 +34,9 @@ function printUsage() {
33
34
  console.log(' npx pantheon-opencode init --interactive # Force interactive TUI mode');
34
35
  console.log(' npx pantheon-opencode init --headless # Force non-interactive mode');
35
36
  console.log(' npx pantheon-opencode init -y # Skip confirmations, use defaults');
37
+ console.log(' npx pantheon-opencode init --preset <name> # Install and activate model preset');
38
+ console.log(' npx pantheon-opencode set-tier <name> # Set active model preset (global)');
39
+ console.log(' npx pantheon-opencode set-tier <name> --project # Set active model preset (project)');
36
40
  console.log(' npx pantheon-opencode --help # Show this help');
37
41
  }
38
42
 
@@ -42,6 +46,78 @@ async function main() {
42
46
 
43
47
  if (args.includes('--help')) { printUsage(); process.exit(0); }
44
48
 
49
+ if (command === 'set-tier') {
50
+ const isProject = args.includes('--project');
51
+ const isDryRun = args.includes('--dry-run');
52
+ const name = args[1];
53
+
54
+ const { loadPresetDefs } = await import('../src/pantheon/presets.mjs');
55
+ const { writeActivePreset } = await import('../scripts/install/model-picker.mjs');
56
+ const presets = loadPresetDefs();
57
+ const presetList = `none, ${Object.keys(presets).join(', ')}`;
58
+
59
+ if (!name) {
60
+ console.error('❌ set-tier requires a preset name');
61
+ console.error(` Available: ${presetList}`);
62
+ process.exit(1);
63
+ }
64
+ if (name !== 'none' && !presets[name]) {
65
+ console.error(`❌ Unknown preset "${name}"`);
66
+ console.error(` Available: ${presetList}`);
67
+ process.exit(1);
68
+ }
69
+
70
+ // Fail-fast: every provider's API key env var must be set before writing
71
+ if (name !== 'none') {
72
+ for (const [pid, provider] of Object.entries(presets[name].providers || {})) {
73
+ if (!process.env[provider.apiKeyEnv]) {
74
+ console.error(`❌ Missing required API key configuration for provider "${pid}"`);
75
+ console.error(' Set the provider API key environment variable and retry.');
76
+ process.exit(1);
77
+ }
78
+ }
79
+ }
80
+
81
+ const presetDir = isProject
82
+ ? process.cwd()
83
+ : path.join(process.env.XDG_CONFIG_HOME || path.join(os.homedir(), '.config'), 'opencode');
84
+ const filePath = path.join(presetDir, '.pantheon', 'active-preset.json');
85
+ const bakPath = path.join(presetDir, '.pantheon', 'active-preset.json.bak');
86
+
87
+ let prevName = '(none)';
88
+ if (fs.existsSync(filePath)) {
89
+ try {
90
+ prevName = JSON.parse(fs.readFileSync(filePath, 'utf8')).preset || '(unknown)';
91
+ } catch { prevName = '(unknown)'; }
92
+ }
93
+
94
+ if (name === 'none') {
95
+ if (isDryRun) {
96
+ console.log('[dry-run] Would clear model preset');
97
+ } else {
98
+ if (fs.existsSync(filePath)) {
99
+ fs.mkdirSync(path.dirname(bakPath), { recursive: true });
100
+ fs.copyFileSync(filePath, bakPath);
101
+ fs.rmSync(filePath, { force: true });
102
+ }
103
+ console.log('Model preset cleared. Using opencode defaults.');
104
+ console.log(` Backup: ${bakPath}`);
105
+ }
106
+ return;
107
+ }
108
+
109
+ const result = writeActivePreset(presetDir, name, { dryRun: isDryRun, source: 'cli' });
110
+
111
+ console.log(`Model preset set: ${prevName} → ${name}`);
112
+ for (const [agent, spec] of Object.entries(presets[name].agents || {})) {
113
+ console.log(` ${agent}: ${spec.model} [${spec.reasoning_effort}]`);
114
+ }
115
+ const providerNames = Object.keys(presets[name].providers || {});
116
+ console.log(` Providers: ${providerNames.join(', ') || 'none'}`);
117
+ if (result.backupPath) console.log(` Backup: ${result.backupPath}`);
118
+ return;
119
+ }
120
+
45
121
  if (command === 'init' || !command) {
46
122
  const isProject = args.includes('--project');
47
123
  const isDryRun = args.includes('--dry-run');
@@ -51,6 +127,8 @@ async function main() {
51
127
  const forceInteractive = args.includes('--interactive');
52
128
  const forceHeadless = args.includes('--headless');
53
129
  const autoYes = args.includes('--yes') || args.includes('-y');
130
+ const presetIndex = args.indexOf('--preset');
131
+ const presetOpt = presetIndex >= 0 ? (args[presetIndex + 1] ?? null) : null;
54
132
 
55
133
  const components = ['agents', 'skills', 'instructions', 'commands', 'plugins'];
56
134
  if (!skipMCP) components.push('runtime');
@@ -75,6 +153,7 @@ async function main() {
75
153
  interactive: forceInteractive,
76
154
  headless: forceHeadless,
77
155
  yes: autoYes,
156
+ preset: presetOpt,
78
157
  });
79
158
  } catch (err) {
80
159
  console.error(`❌ Installation failed: ${err.message}\n Run with --no-mcp to skip Python dependencies:\n npx pantheon-opencode init --no-mcp\n Or retry with --force to recreate the venv:\n npx pantheon-opencode init --force`);
@@ -0,0 +1,25 @@
1
+ ---
2
+ description: "Audit: heuristic scan (zero LLM) + Themis review. Usage: /pantheon-audit [--light|--full|--plan]"
3
+ agent: "zeus"
4
+ ---
5
+ # /pantheon-audit — Quality & Security Audit
6
+
7
+ **What:** Layer 1 heuristic scan (zero tokens, <2s). If BLOCKING, returns score. If APPROVED, Themis deep review.
8
+
9
+ **Usage:**
10
+ - `/pantheon-audit` — Full audit (Layer 1 → 2 → 3)
11
+ - `/pantheon-audit --light` — Layer 1 only (quick scan)
12
+ - `/pantheon-audit --full` — Force full review
13
+ - `/pantheon-audit --plan` — Verification planning only
14
+
15
+ ## Layers
16
+
17
+ ### Layer 1 — Heuristic Scan
18
+ `python3 scripts/themis_heuristic_scan.py [--path=<dir>]`
19
+ Zero tokens, <2s. Checks: ruff, biome, anti-pattern slop, anti-overengineering (YAGNI), hash-anchored edits. Returns score 0-100 + APPROVED/BLOCKING.
20
+
21
+ ### Layer 2 — Themis Deep Review
22
+ ~500 tokens. Confidence scoring, regression prediction, OWASP Top 10.
23
+
24
+ ### Layer 3 — Verification Planning
25
+ For N>5 file changes. Sugere plano de verificação antes de implementar.
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: "Merge and consolidate memory entries"
3
+ agent: zeus
4
+ ---
5
+
6
+ Merge related memory entries and consolidate duplicates:
7
+
8
+ 1. Search for related memories via memory_search
9
+ 2. Merge overlapping entries
10
+ 3. Remove duplicates via memory_forget
11
+ 4. Store consolidated entry via memory_store
@@ -0,0 +1,79 @@
1
+ ---
2
+ description: "Start a heavy multi-phase task with persisted checkpoints, phased specialist dispatch, and Themis review gates. Progress saved to .pantheon/deepwork/ for resumability."
3
+ agent: "zeus"
4
+ ---
5
+ # /pantheon-deepwork — Heavy Task Workflow
6
+
7
+ Structured, checkpointed workflow for complex multi-step tasks spanning multiple agents and sessions. Progress persisted to `.pantheon/deepwork/<task-slug>/`. Each phase gated by Themis.
8
+
9
+ | Use When | Don't Use When |
10
+ |---|---|
11
+ | 10+ turns or multi-session | Simple fixes (→ @talos) |
12
+ | Multi-agent dependencies | Single-file changes (→ /subtask) |
13
+ | Costly context loss | < 5 turns (→ normal delegation) |
14
+
15
+ ## Workflow
16
+
17
+ ```
18
+ Phase 0: SCOPING
19
+ └─ Zeus + Athena define scope, phases, acceptance criteria → PLAN.md
20
+
21
+ Phase 1: DISCOVERY
22
+ └─ @apollo maps relevant codebase areas → DISCOVERY.md
23
+
24
+ Phase 2-N: IMPLEMENTATION (parallel per phase)
25
+ └─ @hermes, @aphrodite, @demeter, @hephaestus, @prometheus
26
+ └─ Output: IMPL-phase-<N>-<agent>.md
27
+
28
+ GATE after each phase:
29
+ └─ @themis reviews output → FAIL (fix + resubmit) or PASS (continue)
30
+
31
+ Phase FINAL: VERIFICATION
32
+ └─ @themis full integration review → REVIEW.md
33
+ └─ All tests pass, coverage >80%
34
+ ```
35
+
36
+ ## Checkpoints
37
+
38
+ ```
39
+ Usage: --resume <slug> | --status <slug> | --list
40
+
41
+ .pantheon/deepwork/<slug>/
42
+ ├── PLAN.md DISCOVERY.md IMPL-phase-*-*.md phase-*-review.md REVIEW.md STATUS.md
43
+ ```
44
+
45
+ ## Full-Auto Mode (`--full-auto`)
46
+
47
+ > ⚠️ Bypasses human review gates. Tier 1 gates (plan, commit, deploy) still require approval.
48
+
49
+ **Themis auto-approves non-blocking reviews** — only stops on **BLOCKING** verdict. No waiting between phases. Checkpoints saved at every boundary.
50
+
51
+ ```
52
+ /pantheon-deepwork --full-auto "Refactor auth service to use JWT"
53
+ /pantheon-deepwork --full-auto --resume auth-jwt
54
+ ```
55
+
56
+ ## Anti-Stall
57
+
58
+ - **Stall Detection** — 3 turns no progress → escalate
59
+ - **Phase Reminder** — continue only independent work after dispatch
60
+ - **Progress Checkpoint** — every 5 turns, summarize completed vs remaining
61
+ - **Delegate Retry** — failures retried once with rephrased prompt
62
+
63
+ ## Usage
64
+
65
+ ```
66
+ /pantheon-deepwork "Add user authentication with OAuth2" # Start new session
67
+ /pantheon-deepwork --resume auth-oauth2 # Resume interrupted
68
+ /pantheon-deepwork --status auth-oauth2 # Show progress
69
+ /pantheon-deepwork --list /pantheon-deepwork --archive <slug> # List / archive
70
+ /pantheon-deepwork --full-auto "Refactor auth" # Themis auto-approve
71
+ /pantheon-deepwork --full-auto --resume auth-refactor # Resume full-auto
72
+ ```
73
+
74
+ ## Safety
75
+
76
+ - All progress persisted — work is never lost
77
+ - Each phase gated by Themis — quality enforced at every step
78
+ - Explicit resume required — no auto-continue without intent (unless `--full-auto`)
79
+ - `.pantheon/deepwork/` is gitignored — no accidental commits
@@ -0,0 +1,79 @@
1
+ ---
2
+ description: "Scan, clean, cache, and archive Pantheon project files. Scans for bloat, archives completed deepwork, migrates flat files to MCP memory, and reports optimization opportunities. Usage: /pantheon-optimize"
3
+ agent: "zeus"
4
+ ---
5
+ # /pantheon-optimize — Pantheon Project Optimizer
6
+
7
+ **What:** Multi-mode optimization: scans for documentation bloat, archives completed deepwork, migrates memory-bank flat files to MCP memory (ChromaDB), and reports token savings.
8
+
9
+ ## Usage
10
+
11
+ ```
12
+ /pantheon-optimize → Full scan + compress (default)
13
+ /pantheon-optimize --dry-run → Preview only, no changes
14
+ /pantheon-optimize --archive → Archive completed deepwork sessions
15
+ /pantheon-optimize --cache → Migrate memory-bank to MCP memory
16
+ /pantheon-optimize --path=<dir> → Limit scan to directory
17
+ /pantheon-optimize --all → Run all modes (default)
18
+ ```
19
+
20
+ ## Modes
21
+
22
+ ### `--archive` — Deepwork Archiving
23
+ Archives completed deepwork sessions from `.pantheon/deepwork/<slug>/` to `.pantheon/deepwork/archive/<slug>/`.
24
+
25
+ **Criteria:** A session is "completed" if it has a `REVIEW.md` containing "APPROVED".
26
+
27
+ ```
28
+ /pantheon-optimize archive → Interactive (ask per slug)
29
+ /pantheon-optimize archive --dry-run → Preview only
30
+ /pantheon-optimize archive --auto → Archive all completed
31
+ /pantheon-optimize archive --auto --keep=2 → Keep only PLAN.md + REVIEW.md
32
+ /pantheon-optimize archive --auto --compress → Single .md per slug
33
+ ```
34
+
35
+ ### `--cache` — Memory Bank Migration
36
+ Scans `.pantheon/memory-bank/` for flat `.md` files and migrates them to the MCP memory server (ChromaDB).
37
+
38
+ **What it does:**
39
+ 1. Reads all `.md` files in `.pantheon/memory-bank/`
40
+ 2. Chunks by heading (## sections)
41
+ 3. Calls `memory_store()` for each chunk with appropriate namespace
42
+ 4. Optionally archives the original files after successful migration
43
+
44
+ ```
45
+ /pantheon-optimize cache → Preview candidates, ask confirm
46
+ /pantheon-optimize cache --dry-run → Show what would migrate
47
+ /pantheon-optimize cache --auto → Migrate + archive originals
48
+ ```
49
+
50
+ ### `--dry-run` (global flag)
51
+ Prevents any destructive action. Shows what WOULD be done.
52
+
53
+ ### Default mode (no flags)
54
+ Runs bloat scan on all `.md` and `.json` files + compression report.
55
+
56
+ ## Output
57
+
58
+ ```
59
+ 🧹 Pantheon Optimize Report
60
+
61
+ 📦 Bloat Scan: 47 .md + 12 .json files
62
+ → 3 oversized files found
63
+ → ~2.4K tokens recoverable
64
+
65
+ 📁 Deepwork Archive: 15 candidates
66
+ → 12 completed (REVIEW.md APPROVED)
67
+ → 3 in progress (skipped)
68
+ → Run with --archive --auto to archive 12 sessions
69
+
70
+ 🗄️ Memory Cache: 24 files in memory-bank/
71
+ → 18 already in MCP memory (dedup)
72
+ → 6 candidates for migration (~3.2K tokens)
73
+ → Run with --cache to migrate
74
+
75
+ 📊 Summary:
76
+ ⚡ 15 files optimizable → ~5.6K tokens
77
+ 🗑️ 12 deepworks archivable → ~320 files cleanup
78
+ 🗄️ 6 memory files → MCP migration ready
79
+ ```
@@ -0,0 +1,67 @@
1
+ ---
2
+ description: "Configure Pantheon vision interactively: auth check, mode (native|tool|auto), vision model, tool fallback. Saves to opencode-vision.json. Usage: /pantheon-vision"
3
+ agent: hermes
4
+ ---
5
+ # /pantheon-vision — Configure Vision
6
+
7
+ **What:** Walks the user through configuring Pantheon's image-vision plugin
8
+ (native multimodal model via the opencode Zen endpoint, or MCP tool fallback).
9
+ **Usage:** `/pantheon-vision [--global]`
10
+ **When:** First-time setup, changing the vision model, troubleshooting images
11
+ not being described, switching between native and tool mode.
12
+
13
+ ## Steps
14
+
15
+ 1. **Check connectivity & key source**
16
+ - Read the opencode auth store: `<data dir>/auth.json`
17
+ (default `~/.local/share/opencode/auth.json`, provider entries
18
+ `opencode-go` then `opencode`) via `readOpencodeAuthToken`.
19
+ - Report whether the user is connected (`opencode auth login`) or has an
20
+ env key (`PANTHEON_OPENCODE_API_KEY` / `OPENCODE_API_KEY`).
21
+ - **Never log or echo the token itself** — only connected/not connected.
22
+
23
+ 2. **Show current status**
24
+ - Effective mode precedence: env `PANTHEON_VISION_MODE` > config file
25
+ `mode` > default `auto`.
26
+ - Read the current config file if present (project `.opencode/opencode-vision.json`
27
+ then user `~/.config/opencode/opencode-vision.json`).
28
+
29
+ 3. **Ask what to set (interactive)**
30
+ - **Mode:** `native` | `tool` | `auto`
31
+ - `native` — describe images via the multimodal model directly (needs key)
32
+ - `tool` — always use the MCP tool fallback (`imageAnalysisTool`)
33
+ - `auto` — try native first, fall back to the tool (default)
34
+ - **Vision model:** e.g. `opencode-go/mimo-v2.5`, `opencode-go/minimax-m3`,
35
+ or an explicit override (precedence: env `PANTHEON_VISION_MODEL` > config
36
+ `visionModel` > active preset `vision.model` > default `opencode-go/mimo-v2.5`).
37
+ - **Tool fallback:** `imageAnalysisTool` (default
38
+ `pantheon_vision_vision_describe`). Bifrost is opt-in only when
39
+ explicitly selected here or through `PANTHEON_VISION_TOOL`.
40
+
41
+ 4. **Save the config**
42
+ - Default: project config `.opencode/opencode-vision.json`
43
+ (merged with the user config `~/.config/opencode/opencode-vision.json`;
44
+ project wins on conflicts).
45
+ - `--global` → write to `~/.config/opencode/opencode-vision.json`.
46
+ - Shape:
47
+ ```json
48
+ {
49
+ "mode": "auto",
50
+ "visionModel": "opencode-go/mimo-v2.5",
51
+ "imageAnalysisTool": "pantheon_vision_vision_describe"
52
+ }
53
+ ```
54
+ - Optional fields also supported: `models` (model wildcard patterns),
55
+ `promptTemplate` (with `{imageList}`/`{imageCount}`/`{toolName}`/`{userText}`).
56
+
57
+ 5. **Wrap up**
58
+ - Tell the user to restart opencode (config is read at startup / per turn)
59
+ and test by pasting an image with a question.
60
+ - If no key and no auth store entry exist, recommend `opencode auth login`
61
+ (native mode) or leaving the tool fallback enabled.
62
+
63
+ ## Rules
64
+
65
+ - Do NOT print tokens or auth.json contents.
66
+ - Do NOT overwrite existing config keys not being changed — merge.
67
+ - If the config file is corrupted JSON, warn and ask before overwriting.
@@ -0,0 +1,49 @@
1
+ ---
2
+ description: "Dispatch a question to 2-4 specialist agents via inline Zeus council"
3
+ agent: zeus
4
+ ---
5
+ # /pantheon — Council Synthesis
6
+
7
+ **What:** Dispatches the question to 2-3 specialist agents **in parallel** via `task()`, then synthesizes their responses into a single recommendation with resolved divergences.
8
+ **Usage:** `/pantheon <question>`
9
+ **When:** Architecture trade-offs, technology selection, security assessments, multi-stakeholder concerns
10
+ **Returns:** Structured synthesis with recommendation, confidence level, resolved divergences
11
+
12
+ ## Dispatch Selection
13
+
14
+ Choose 2-3 agents based on domain:
15
+
16
+ | Domain | Specialists |
17
+ |--------|-------------|
18
+ | Architecture | hermes, demeter, themis, athena |
19
+ | Security | themis, hermes, prometheus, nyx |
20
+ | Database | demeter, hermes, prometheus |
21
+ | AI/RAG | hephaestus, nyx |
22
+ | Infrastructure | prometheus, hermes, themis |
23
+ | Frontend/UX | aphrodite, themis, hermes |
24
+ | Observability | nyx, hermes |
25
+ | General | athena, themis, hermes |
26
+
27
+ Send ALL `task()` calls in a single message. Each must return: Recommendation · Reasoning · Trade-offs · Risks · Confidence.
28
+
29
+ ## Synthesis Structure
30
+
31
+ After ALL responses arrive, produce EXACTLY this structure:
32
+
33
+ ### 📋 Individual Assessments
34
+ For each specialist: Recommendation, Reasoning, Trade-offs, Risks, Confidence
35
+
36
+ ### ✅ Agreements
37
+ Where 2+ specialists converge
38
+
39
+ ### ⚡ Divergences
40
+ Where they disagree — resolve each one with reasoning
41
+
42
+ ### 🔥 Total Divergence
43
+ If ALL specialists disagree on a point, call this out explicitly
44
+
45
+ ### 🏆 Recommendation
46
+ Decisive conclusion with confidence level
47
+
48
+ ## Question:
49
+ $ARGUMENTS
package/opencode.json CHANGED
@@ -1,5 +1,15 @@
1
1
  {
2
2
  "$schema": "https://opencode.ai/config.json",
3
+ "provider": {
4
+ "opencode-go": {
5
+ "models": {
6
+ "mimo-v2.5": {
7
+ "attachment": true,
8
+ "modalities": { "input": ["text", "image"] }
9
+ }
10
+ }
11
+ }
12
+ },
3
13
  "default_agent": "zeus",
4
14
  "subagent_depth": 2,
5
15
  "model": "opencode-go/deepseek-v4-flash",
@@ -18,19 +28,13 @@
18
28
  "pip *": "allow"
19
29
  }
20
30
  },
21
- "instructions": [
22
- "AGENTS.md",
23
- "src/instructions/*.instructions.md"
24
- ],
31
+ "instructions": ["AGENTS.md", "src/instructions/*.instructions.md"],
25
32
  "plugin": [],
26
33
  "mcp": {
27
34
  "bifrost": {
28
35
  "type": "remote",
29
36
  "url": "https://llm.ofertachina.cloud/mcp",
30
- "enabled": true,
31
- "headers": {
32
- "x-bf-vk": "sk-bf-a5a9b5b0-45fc-414d-8e4d-f9beb8c49a6d"
33
- }
37
+ "enabled": true
34
38
  }
35
39
  },
36
40
  "agent": {
@@ -40,41 +44,8 @@
40
44
  "themis": {
41
45
  "model": "opencode-go/deepseek-v4-pro"
42
46
  },
43
- "zeus": {
44
- "model": "opencode-go/deepseek-v4-pro"
45
- },
46
47
  "hephaestus": {
47
48
  "model": "opencode-go/deepseek-v4-pro"
48
- },
49
- "hermes": {
50
- "model": "opencode-go/deepseek-v4-flash"
51
- },
52
- "aphrodite": {
53
- "model": "opencode-go/deepseek-v4-flash"
54
- },
55
- "demeter": {
56
- "model": "opencode-go/deepseek-v4-flash"
57
- },
58
- "prometheus": {
59
- "model": "opencode-go/deepseek-v4-flash"
60
- },
61
- "apollo": {
62
- "model": "opencode-go/deepseek-v4-flash"
63
- },
64
- "nyx": {
65
- "model": "opencode-go/deepseek-v4-flash"
66
- },
67
- "gaia": {
68
- "model": "opencode-go/deepseek-v4-flash"
69
- },
70
- "iris": {
71
- "model": "opencode-go/deepseek-v4-flash"
72
- },
73
- "mnemosyne": {
74
- "model": "opencode-go/deepseek-v4-flash"
75
- },
76
- "talos": {
77
- "model": "opencode-go/deepseek-v4-flash"
78
49
  }
79
50
  }
80
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pantheon-opencode",
3
- "version": "1.1.1",
3
+ "version": "1.2.0-beta.9.7bef03e",
4
4
  "description": "Multi-agent orchestration for OpenCode — 14 specialized agents, TDD, Themis review gates.",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -23,6 +23,8 @@
23
23
  "lint": "npx biome ci .",
24
24
  "typecheck": "npx tsc --noEmit",
25
25
  "audit": "npm audit --audit-level=high",
26
+ "secret-scan": "node scripts/secret-scan.mjs",
27
+ "test:security": "npm run secret-scan && node tests/test_install_mcp_vision.mjs",
26
28
  "test": "python3 -m pytest tests/ -q 2>&1 || echo \"No tests found\"",
27
29
  "test:ci": "python3 -m pytest tests/ -q --tb=short 2>&1 || true"
28
30
  },
@@ -50,6 +52,7 @@
50
52
  "scripts/*.mjs",
51
53
  "src/mcp/*.sh",
52
54
  "src/routing.yml",
55
+ "src/pantheon/**",
53
56
  "src/mcp/requirements*",
54
57
  "src/plugins/tui/**",
55
58
  "src/skills/**"
@@ -60,6 +63,7 @@
60
63
  "devDependencies": {
61
64
  "@commitlint/cli": "^19.8.0",
62
65
  "@commitlint/config-conventional": "^19.8.0",
66
+ "@opencode-ai/plugin": "1.18.11",
63
67
  "husky": "^9.1.7"
64
68
  },
65
69
  "repository": {
@@ -44,8 +44,6 @@ const _ALL_PLATFORMS = ['opencode']
44
44
  const PLATFORM_LABELS = {
45
45
  opencode: 'OpenCode',
46
46
  }
47
- opencode: 'OpenCode',
48
- }
49
47
 
50
48
  // ---------------------------------------------------------------------------
51
49
  // State
@@ -236,6 +234,10 @@ function checkAgentFiles(args) {
236
234
  pass(`${canonical.length} canonical agents found in agents/`)
237
235
 
238
236
  // Determine which platforms to check
237
+ if (!existsSync(PLATFORM_DIR)) {
238
+ warn('Platform component not distributed in this package — skipping platform agent check')
239
+ return
240
+ }
239
241
  const platformDirs = readdirSync(PLATFORM_DIR, { withFileTypes: true })
240
242
  .filter((d) => d.isDirectory() && d.name !== '_template' && d.name !== 'plans')
241
243
  .map((d) => d.name)