pantheon-opencode 1.6.0-beta.9 → 1.6.0

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 (131) hide show
  1. package/AGENTS.global.md +118 -0
  2. package/AGENTS.md +18 -168
  3. package/CHANGELOG.md +126 -376
  4. package/README.md +83 -610
  5. package/README.pt-BR.md +120 -345
  6. package/bin/pantheon-init.mjs +366 -132
  7. package/commands/pantheon-deepwork.md +14 -3
  8. package/commands/pantheon-vision.md +61 -12
  9. package/package.json +19 -11
  10. package/plugin.json +1 -1
  11. package/pyproject.toml +6 -2
  12. package/scripts/_pantheon_paths.py +24 -0
  13. package/scripts/build-agents-md.mjs +368 -69
  14. package/scripts/changelog-merge.mjs +161 -0
  15. package/scripts/check-plugin-v2-coverage.mjs +11 -8
  16. package/scripts/docs-check-changelog.mjs +204 -0
  17. package/scripts/docs-link-check.mjs +314 -0
  18. package/scripts/docs-media.mjs +157 -0
  19. package/scripts/doctor.mjs +828 -40
  20. package/scripts/install/agents-md.mjs +2 -2
  21. package/scripts/install/backup.mjs +648 -0
  22. package/scripts/install/cli-ui.mjs +303 -72
  23. package/scripts/install/component-selection.mjs +61 -0
  24. package/scripts/install/config-migration.mjs +583 -27
  25. package/scripts/install/exit-codes.mjs +26 -0
  26. package/scripts/install/file-inventory.mjs +555 -0
  27. package/scripts/install/health-check.mjs +31 -25
  28. package/scripts/install/interactive.mjs +78 -383
  29. package/scripts/install/migrate.mjs +49 -25
  30. package/scripts/install/model-picker.mjs +218 -250
  31. package/scripts/install/opencode-version.mjs +83 -21
  32. package/scripts/install/opencode.mjs +1413 -154
  33. package/scripts/install/plan-artifact.mjs +517 -0
  34. package/scripts/install/plan.mjs +475 -0
  35. package/scripts/install/plugin.mjs +214 -27
  36. package/scripts/install/prompt-result.mjs +2 -0
  37. package/scripts/install/shared.mjs +256 -99
  38. package/scripts/install/state.mjs +63 -8
  39. package/scripts/install/strings.mjs +60 -4
  40. package/scripts/install/venv.mjs +90 -47
  41. package/scripts/install/verify.mjs +128 -0
  42. package/scripts/install/vision-prompt.mjs +173 -0
  43. package/scripts/install-mcp.mjs +2 -2
  44. package/scripts/manifest-inventory.mjs +49 -3
  45. package/scripts/mcp_persistence.py +1535 -1050
  46. package/scripts/memory_mcp.py +12 -843
  47. package/scripts/node-engine-policy.mjs +85 -0
  48. package/scripts/package-evidence.mjs +10 -2
  49. package/scripts/postinstall.mjs +26 -26
  50. package/scripts/probe-pantheon-cost.mjs +118 -19
  51. package/scripts/prune.mjs +9 -3
  52. package/scripts/reconcile.mjs +325 -0
  53. package/scripts/release-gates.mjs +682 -0
  54. package/scripts/restore.mjs +222 -0
  55. package/scripts/run-node-tests.mjs +24 -8
  56. package/scripts/sync-artifacts.mjs +19 -7
  57. package/scripts/sync-tui.mjs +5 -1
  58. package/scripts/test-opencode-v2-sandbox.sh +36 -123
  59. package/scripts/uninstall.mjs +369 -34
  60. package/scripts/update.mjs +164 -0
  61. package/scripts/validate-node-engine-policy.mjs +13 -0
  62. package/scripts/version-check.mjs +34 -1
  63. package/scripts/versioning.mjs +23 -3
  64. package/scripts/vision-status.mjs +682 -0
  65. package/skills-lock.json +8 -8
  66. package/src/agents/aphrodite.md +13 -10
  67. package/src/agents/apollo.md +4 -5
  68. package/src/agents/athena.md +74 -46
  69. package/src/agents/demeter.md +10 -7
  70. package/src/agents/gaia.md +0 -1
  71. package/src/agents/hephaestus.md +4 -3
  72. package/src/agents/hermes.md +10 -9
  73. package/src/agents/iris.md +6 -1
  74. package/src/agents/mnemosyne.md +10 -4
  75. package/src/agents/nyx.md +4 -4
  76. package/src/agents/prometheus.md +12 -11
  77. package/src/agents/talos.md +6 -0
  78. package/src/agents/zeus.md +84 -56
  79. package/src/instructions/agent-return-format.instructions.md +12 -41
  80. package/src/instructions/memory-protocol.instructions.md +5 -11
  81. package/src/instructions/test-economy.instructions.md +12 -0
  82. package/src/instructions/yagni.instructions.md +6 -15
  83. package/src/instructions/zeus-anti-stall.instructions.md +6 -6
  84. package/src/instructions/zeus-communication-rules.instructions.md +6 -6
  85. package/src/instructions/zeus-council-synthesis.instructions.md +11 -12
  86. package/src/instructions/zeus-memory-operations.instructions.md +13 -7
  87. package/src/instructions/zeus-timeout-retry.instructions.md +36 -10
  88. package/src/mcp/_pantheon_paths.py +24 -0
  89. package/src/mcp/mcp_codemap_module.py +86 -18
  90. package/src/mcp/mcp_persistence.py +1535 -1050
  91. package/src/mcp/memory_mcp.py +444 -94
  92. package/src/mcp/pantheon_vision.py +285 -41
  93. package/src/mcp/requirements-mcp.txt +5 -0
  94. package/src/pantheon/context-pruner.ts +541 -0
  95. package/src/pantheon/cost-command.ts +814 -60
  96. package/src/pantheon/goal-loop.ts +11 -8
  97. package/src/pantheon/memory-context.ts +1017 -0
  98. package/src/pantheon/model-agents.ts +19 -0
  99. package/src/pantheon/model-command.ts +218 -56
  100. package/src/pantheon/model-pricing.ts +536 -0
  101. package/src/pantheon/presets.mjs +2 -0
  102. package/src/pantheon/task-result-guard.ts +50 -14
  103. package/src/pantheon/v2-bounded-read.ts +640 -0
  104. package/src/pantheon/v2-delegation-enforce.ts +133 -6
  105. package/src/pantheon/v2-execute-after.ts +135 -24
  106. package/src/pantheon/v2-model-overrides.ts +275 -0
  107. package/src/pantheon/v2-tools.ts +89 -35
  108. package/src/pantheon/v2-unsupported.mjs +2 -3
  109. package/src/pantheon/v2-vision.ts +622 -0
  110. package/src/pantheon/vision-local.ts +531 -0
  111. package/src/pantheon/vision.ts +1160 -115
  112. package/src/plugin-v2.ts +654 -162
  113. package/src/plugin.ts +15 -11
  114. package/src/plugins/tui/dist/tui-v2.d.ts +1029 -2
  115. package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -1
  116. package/src/plugins/tui/dist/tui-v2.js +3742 -85
  117. package/src/plugins/tui/dist/tui.js +1 -1
  118. package/src/plugins/tui/package-lock.json +6 -6
  119. package/src/plugins/tui/package.json +5 -4
  120. package/src/plugins/tui/src/index-v2.tsx +4314 -50
  121. package/src/plugins/tui/tsconfig.typecheck.json +5 -0
  122. package/src/routing.yml +50 -5
  123. package/src/skills/agent-coordination/SKILL.md +7 -2
  124. package/src/skills/artifact-management/SKILL.md +5 -1
  125. package/src/skills/auto-continue/SKILL.md +14 -6
  126. package/src/skills/codemap/SKILL.md +1 -1
  127. package/src/skills/memory-bank/SKILL.md +21 -13
  128. package/src/skills/session-goal/SKILL.md +12 -22
  129. package/src/skills/spec-driven-development/SKILL.md +3 -1
  130. package/src/skills/worktrees/SKILL.md +30 -11
  131. package/scripts/probe-context-rehydrate.mjs +0 -263
@@ -14,33 +14,80 @@ not being described, switching between native and tool mode.
14
14
 
15
15
  1. **Check connectivity & key source**
16
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`.
17
+ (default `~/.local/share/opencode/auth.json`) via `readOpencodeAuthToken`.
18
+ - Credentials follow the endpoint (never cross providers):
19
+ - **Zen endpoints** (`opencode`, `opencode-go*`): the env keys
20
+ `PANTHEON_OPENCODE_API_KEY` / `OPENCODE_API_KEY` first, then the auth
21
+ store — the resolved provider entry first, then the legacy Zen entries
22
+ `opencode-go` then `opencode`.
23
+ - **Non-Zen endpoints** (e.g. discovered OpenAI-compatible providers):
24
+ ONLY that provider's own auth-store entry. The shared Zen env keys and
25
+ the legacy `opencode-go` / `opencode` entries are never attached to a
26
+ non-Zen base URL; absent an own credential the image falls through to
27
+ the tool→local chain.
19
28
  - Report whether the user is connected (`opencode auth login`) or has an
20
- env key (`PANTHEON_OPENCODE_API_KEY` / `OPENCODE_API_KEY`).
29
+ env key — for a non-Zen target, report the target provider's own entry.
21
30
  - **Never log or echo the token itself** — only connected/not connected.
22
31
 
23
- 2. **Show current status**
32
+ 2. **Show current status (mode + resolved target + origin)**
24
33
  - Effective mode precedence: env `PANTHEON_VISION_MODE` > config file
25
34
  `mode` > default `auto`.
26
- - Read the current config file if present (project `.opencode/opencode-vision.json`
27
- then user `~/.config/opencode/opencode-vision.json`).
35
+ - Resolved target + origin, in precedence order:
36
+ env `PANTHEON_VISION_MODEL` → config `visionModel` (project
37
+ `.opencode/opencode-vision.json`, then user
38
+ `~/.config/opencode/opencode-vision.json`) → active preset `vision.model`
39
+ → **automatic discovery** in the host catalog (`GET /config/providers`)
40
+ → built-in default.
41
+ - Resolve the installed helper first (do not assume the current project
42
+ contains Pantheon source). Check, in order:
43
+ `$OPENCODE_CONFIG_DIR/.opencode/scripts/`,
44
+ `$OPENCODE_CONFIG_DIR/scripts/`,
45
+ `${XDG_CONFIG_HOME:-$HOME/.config}/opencode/scripts/`,
46
+ `$HOME/.opencode/scripts/`, `.opencode/scripts/`, then
47
+ `$(npm root -g)/pantheon-opencode/scripts/`. Run the first existing
48
+ `vision-status.mjs` as `node "$helper" --dir="$PWD"` and show its output
49
+ (mode + target + origin). The same helper drives the picker with
50
+ `--list` (enumerate candidates) and `--set <provider/model>` (pin one).
51
+ - If the helper is missing, resolve inline with the same precedence and be
52
+ honest: discovery needs the live host catalog, so when no explicit model
53
+ is configured report `auto (resolved at session start)` and name the
54
+ fallback default — never invent a value.
28
55
 
29
56
  3. **Ask what to set (interactive)**
30
57
  - **Mode:** `native` | `tool` | `auto`
31
- - `native` — describe images via the multimodal model directly (needs key)
58
+ - `native` — describe images via the multimodal model directly (needs a
59
+ usable credential for the resolved endpoint)
32
60
  - `tool` — always use the MCP tool fallback (`imageAnalysisTool`)
33
61
  - `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`).
62
+ - **Vision model — show the picker, do NOT make the user type blind.**
63
+ Run `node "$helper" --list --dir="$PWD"` and present its numbered list.
64
+ - **Read the `Source:` line out loud.** It is `host catalog`
65
+ (`capabilities.input.image`) when the live catalog is available, or
66
+ `heuristic` (`opencode models` + known vision families) otherwise — the
67
+ heuristic is a *guess*, so say so; never present it as certain.
68
+ - Each row shows `Access` (free/paid when the catalog reports cost) and
69
+ `Credential`. **`Credential: no` means the native path has no key for
70
+ that provider, so images degrade to the MCP tool fallback (which then
71
+ falls back to local metadata like EXIF/size) — that is expected, not an
72
+ error.** `yes (env|store)` means a key is present (never echo it).
73
+ - Let the user choose by **number** or type a `provider/model`. Then apply
74
+ it with `node "$helper" --set <provider/model> --dir="$PWD"` (add
75
+ `--global` to pin in the user config; default is the project config).
76
+ - If the list is empty, report the helper's `Source: none` reason (e.g.
77
+ `opencode models` unavailable) and let the user type the model manually.
78
+ - Precedence for the effective model is unchanged: env
79
+ `PANTHEON_VISION_MODEL` > config `visionModel` > active preset
80
+ `vision.model` > automatic discovery > default `opencode-go/mimo-v2.5`.
37
81
  - **Tool fallback:** `imageAnalysisTool` (default
38
82
  `pantheon_vision_vision_describe`). Bifrost is opt-in only when
39
83
  explicitly selected here or through `PANTHEON_VISION_TOOL`.
40
84
 
41
85
  4. **Save the config**
42
- - Default: project config `.opencode/opencode-vision.json`
43
- (merged with the user config `~/.config/opencode/opencode-vision.json`;
86
+ - The `--set` in step 3 already merged `visionModel` atomically
87
+ (`.bak` backup, existing keys preserved, corrupted JSON left untouched).
88
+ If the user typed a model instead of using `--set`, apply it the same way.
89
+ - Default target: project config `.opencode/opencode-vision.json`
90
+ (resolved alongside the user config `~/.config/opencode/opencode-vision.json`;
44
91
  project wins on conflicts).
45
92
  - `--global` → write to `~/.config/opencode/opencode-vision.json`.
46
93
  - Shape:
@@ -65,3 +112,5 @@ not being described, switching between native and tool mode.
65
112
  - Do NOT print tokens or auth.json contents.
66
113
  - Do NOT overwrite existing config keys not being changed — merge.
67
114
  - If the config file is corrupted JSON, warn and ask before overwriting.
115
+ - State the picker's `Source:` (catalog vs heuristic) honestly — a heuristic
116
+ list is a guess; never imply certainty about image capability.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pantheon-opencode",
3
- "version": "1.6.0-beta.9",
3
+ "version": "1.6.0",
4
4
  "description": "Multi-agent orchestration for OpenCode — 14 specialized agents, TDD, Themis review gates.",
5
5
  "type": "module",
6
6
  "workspaces": [
@@ -18,12 +18,12 @@
18
18
  "scripts": {
19
19
  "postinstall": "node scripts/postinstall.mjs && node scripts/sync-tui.mjs",
20
20
  "prepare": "husky",
21
- "setup": "node bin/pantheon-init.mjs init",
21
+ "setup": "node bin/pantheon-init.mjs init --yes",
22
22
  "build:agents-md": "node scripts/build-agents-md.mjs",
23
- "setup:lite": "node bin/pantheon-init.mjs init --clean --components agents,skills,instructions",
23
+ "setup:lite": "node bin/pantheon-init.mjs init --yes --clean --components agents,skills,instructions",
24
24
  "doctor": "node scripts/doctor.mjs",
25
25
  "prune": "node scripts/prune.mjs",
26
- "init": "node bin/pantheon-init.mjs init",
26
+ "init": "node bin/pantheon-init.mjs init --yes",
27
27
  "opencode": "OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true opencode",
28
28
  "start": "OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true opencode",
29
29
  "prepublishOnly": "node scripts/validate-routing.mjs",
@@ -33,16 +33,21 @@
33
33
  "version:check": "node scripts/version-check.mjs",
34
34
  "release:dry-run": "node scripts/versioning.mjs status && node scripts/release-notes.mjs && node scripts/package-evidence.mjs",
35
35
  "package:evidence": "node scripts/package-evidence.mjs",
36
- "package:validate": "node scripts/validate-package.mjs",
36
+ "engine:check": "node scripts/validate-node-engine-policy.mjs",
37
+ "package:validate": "node scripts/validate-package.mjs && npm run engine:check",
37
38
  "lint": "biome ci .",
39
+ "docs:lint": "node scripts/docs-link-check.mjs",
40
+ "docs:media": "node scripts/docs-media.mjs",
41
+ "docs:check-changelog": "node scripts/docs-check-changelog.mjs",
38
42
  "typecheck": "tsc --noEmit",
39
43
  "audit": "npm audit --audit-level=high",
40
44
  "secret-scan": "node scripts/secret-scan.mjs",
41
45
  "hooks:install": "pre-commit install",
42
46
  "hooks:update": "pre-commit autoupdate",
43
47
  "test:security": "npm run secret-scan",
44
- "test:node": "node scripts/run-node-tests.mjs --label 'test:node' 'tests/*.mjs' 'tests/pantheon/*.mjs'",
45
- "coverage": "echo 'Node coverage (report-only, NO threshold is enforced).' && echo 'Covers: the .mjs/.js modules under scripts/, src/ and bin/ that test:node exercises.' && echo 'Does NOT cover: test:ts (hand-rolled tsx loop, no node --test runner) and test:ci (pytest).' && echo ' TypeScript under src/ (41 files) is therefore entirely unmeasured here.' && echo '' && node scripts/run-node-tests.mjs --label 'coverage' -- --experimental-test-coverage --test-coverage-include='scripts/**/*.mjs' --test-coverage-include='src/**/*.mjs' --test-coverage-include='src/**/*.js' --test-coverage-include='bin/**/*.mjs' 'tests/*.mjs' 'tests/pantheon/*.mjs'",
48
+ "test:node": "node scripts/run-node-tests.mjs --label 'test:node' --exclude 'tests/install-opencode.test.mjs' --exclude 'tests/install-e2e.test.mjs' 'tests/*.mjs' 'tests/pantheon/*.mjs'",
49
+ "test:install": "PANTHEON_RUN_INSTALL_TESTS=1 node scripts/run-node-tests.mjs --label 'test:install' 'tests/install-opencode.test.mjs' 'tests/install-e2e.test.mjs'",
50
+ "coverage": "echo 'Node coverage (report-only, NO threshold is enforced).' && echo 'Covers: the .mjs/.js modules under scripts/, src/ and bin/ that test:node exercises.' && echo 'Does NOT cover: test:ts (hand-rolled tsx loop, no node --test runner) and test:ci (pytest).' && echo ' TypeScript under src/ (41 files) is therefore entirely unmeasured here.' && echo '' && node scripts/run-node-tests.mjs --label 'coverage' --exclude 'tests/install-opencode.test.mjs' --exclude 'tests/install-e2e.test.mjs' -- --experimental-test-coverage --test-coverage-include='scripts/**/*.mjs' --test-coverage-include='src/**/*.mjs' --test-coverage-include='src/**/*.js' --test-coverage-include='bin/**/*.mjs' 'tests/*.mjs' 'tests/pantheon/*.mjs'",
46
51
  "coverage:plugin-v2": "node scripts/check-plugin-v2-coverage.mjs",
47
52
  "test:ts": "for f in tests/pantheon/*.test.ts; do if [ \"$f\" = tests/pantheon/plugin-v2-contract.test.ts ]; then NODE_OPTIONS=--conditions=import tsx \"$f\"; else tsx \"$f\"; fi || exit 1; done",
48
53
  "test:hooks": "node scripts/run-node-tests.mjs --label 'test:hooks' 'tests/pantheon/plugin-v2-hook-canary.test.mjs'",
@@ -75,6 +80,7 @@
75
80
  "!src/agents/README.md",
76
81
  "bin/*.mjs",
77
82
  "AGENTS.md",
83
+ "AGENTS.global.md",
78
84
  "CHANGELOG.md",
79
85
  "src/mcp/*.py",
80
86
  "src/instructions/*.instructions.md",
@@ -97,10 +103,11 @@
97
103
  "!**/*.pyc"
98
104
  ],
99
105
  "dependencies": {
106
+ "@clack/prompts": "1.8.1",
100
107
  "@opencode-ai/plugin": "1.18.33",
108
+ "@opencode-ai/sdk": "1.18.33",
101
109
  "js-yaml": "^5.4.2",
102
- "zod": "4.1.8",
103
- "@opencode-ai/sdk": "1.18.33"
110
+ "zod": "4.1.8"
104
111
  },
105
112
  "devDependencies": {
106
113
  "@biomejs/biome": "2.5.14",
@@ -115,7 +122,8 @@
115
122
  "@babel/core": "7.29.7",
116
123
  "seroval": "1.6.8",
117
124
  "solid-js": "1.9.12",
118
- "rolldown": "1.2.7"
125
+ "rolldown": "1.2.7",
126
+ "toml": "5.0.1"
119
127
  },
120
128
  "//overrides": "TUI production advisory fixes: Babel >=7.29.6 and Seroval >=1.6.3; Solid stays at 1.9.12 to satisfy OpenTUI's exact peer. Remove only after upstream ranges include fixed versions; Seroval compatibility is covered by the Solid serializer regression test.",
121
129
  "repository": {
@@ -137,7 +145,7 @@
137
145
  "author": "ils15",
138
146
  "license": "MIT",
139
147
  "engines": {
140
- "node": "^22.22.2 || ^24.15.0 || >=26.0.0"
148
+ "node": ">=26.4.0"
141
149
  },
142
150
  "preferGlobal": true
143
151
  }
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pantheon",
3
3
  "publisher": "ils15",
4
- "version": "1.6.0-beta.9",
4
+ "version": "1.6.0",
5
5
  "displayName": "Pantheon",
6
6
  "description": "Conductor-Delegate orchestration platform with 14 specialized agents, 20 skills, and OpenCode support.",
7
7
  "agents": "./src/agents",
package/pyproject.toml CHANGED
@@ -4,10 +4,14 @@ build-backend = "setuptools.backends._legacy:_Backend"
4
4
 
5
5
  [project]
6
6
  name = "pantheon"
7
- version = "1.6.0-beta.9"
7
+ version = "1.6.0"
8
8
  description = "Multi-agent orchestration framework"
9
9
  requires-python = ">=3.11"
10
- dependencies = []
10
+ # Python sources under src/mcp/ import fastmcp/pydantic at runtime, but those
11
+ # are installed from src/mcp/requirements-*.txt by the installer, not from this
12
+ # metadata. typing_extensions is declared here because src/mcp/memory_mcp.py
13
+ # imports it directly (TypedDict must come from typing_extensions on 3.11).
14
+ dependencies = ["typing_extensions>=4.14.1"]
11
15
 
12
16
  [tool.pytest.ini_options]
13
17
  # `tests/` holds the main suite; the entry below is an orphaned test module
@@ -72,6 +72,30 @@ def pantheon_project() -> Path | None:
72
72
  return None
73
73
 
74
74
 
75
+ def trusted_project_root() -> Path | None:
76
+ """Return an explicitly host-bound project root, or ``None``.
77
+
78
+ The globally launched Memory MCP commonly runs with its working directory
79
+ set to the installed runtime, not the active project. Therefore this
80
+ security-sensitive lookup deliberately accepts only an absolute
81
+ ``PANTHEON_PROJECT`` binding and never falls back to ``PWD`` or cwd.
82
+ """
83
+ configured_root = os.environ.get("PANTHEON_PROJECT")
84
+ if not configured_root:
85
+ return None
86
+
87
+ candidate = Path(configured_root)
88
+ if not candidate.is_absolute():
89
+ return None
90
+ try:
91
+ root = candidate.resolve(strict=True)
92
+ except (OSError, RuntimeError):
93
+ return None
94
+ if not root.is_dir() or root == Path(root.anchor):
95
+ return None
96
+ return root
97
+
98
+
75
99
  def _is_valid_logical_cwd(logical_cwd: str, physical_cwd: str) -> bool:
76
100
  """Validate a launcher-provided logical cwd without resolving its result.
77
101