pantheon-opencode 1.6.0-beta.8 → 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.
- package/AGENTS.global.md +118 -0
- package/AGENTS.md +18 -168
- package/CHANGELOG.md +126 -346
- package/README.md +83 -608
- package/README.pt-BR.md +120 -345
- package/bin/pantheon-init.mjs +366 -132
- package/commands/pantheon-audit.md +7 -1
- package/commands/pantheon-consolidate.md +1 -1
- package/commands/pantheon-deepwork.md +14 -3
- package/commands/pantheon-focus.md +17 -0
- package/commands/pantheon-vision.md +61 -12
- package/package.json +19 -11
- package/plugin.json +1 -1
- package/pyproject.toml +6 -2
- package/scripts/_pantheon_paths.py +24 -0
- package/scripts/build-agents-md.mjs +368 -69
- package/scripts/changelog-merge.mjs +161 -0
- package/scripts/check-plugin-v2-coverage.mjs +11 -8
- package/scripts/docs-check-changelog.mjs +204 -0
- package/scripts/docs-link-check.mjs +314 -0
- package/scripts/docs-media.mjs +157 -0
- package/scripts/doctor.mjs +828 -40
- package/scripts/install/agents-md.mjs +2 -2
- package/scripts/install/backup.mjs +648 -0
- package/scripts/install/cli-ui.mjs +303 -72
- package/scripts/install/component-selection.mjs +61 -0
- package/scripts/install/config-migration.mjs +583 -27
- package/scripts/install/exit-codes.mjs +26 -0
- package/scripts/install/file-inventory.mjs +555 -0
- package/scripts/install/health-check.mjs +31 -25
- package/scripts/install/interactive.mjs +78 -383
- package/scripts/install/migrate.mjs +49 -25
- package/scripts/install/model-picker.mjs +218 -250
- package/scripts/install/opencode-version.mjs +83 -21
- package/scripts/install/opencode.mjs +1465 -180
- package/scripts/install/plan-artifact.mjs +517 -0
- package/scripts/install/plan.mjs +475 -0
- package/scripts/install/plugin.mjs +251 -30
- package/scripts/install/prompt-result.mjs +2 -0
- package/scripts/install/shared.mjs +256 -99
- package/scripts/install/state.mjs +63 -8
- package/scripts/install/strings.mjs +60 -4
- package/scripts/install/venv.mjs +90 -47
- package/scripts/install/verify.mjs +128 -0
- package/scripts/install/vision-prompt.mjs +173 -0
- package/scripts/install-mcp.mjs +2 -2
- package/scripts/manifest-inventory.mjs +49 -3
- package/scripts/mcp_persistence.py +1535 -1050
- package/scripts/memory_mcp.py +12 -843
- package/scripts/node-engine-policy.mjs +85 -0
- package/scripts/package-evidence.mjs +10 -2
- package/scripts/postinstall.mjs +26 -26
- package/scripts/probe-pantheon-cost.mjs +118 -19
- package/scripts/prune.mjs +9 -3
- package/scripts/reconcile.mjs +325 -0
- package/scripts/release-gates.mjs +682 -0
- package/scripts/restore.mjs +222 -0
- package/scripts/run-node-tests.mjs +24 -8
- package/scripts/sync-artifacts.mjs +20 -7
- package/scripts/sync-tui.mjs +29 -4
- package/scripts/test-opencode-v2-sandbox.sh +36 -123
- package/scripts/uninstall.mjs +369 -34
- package/scripts/update.mjs +164 -0
- package/scripts/validate-node-engine-policy.mjs +13 -0
- package/scripts/version-check.mjs +34 -1
- package/scripts/versioning.mjs +23 -3
- package/scripts/vision-status.mjs +682 -0
- package/skills-lock.json +8 -8
- package/src/agents/aphrodite.md +13 -10
- package/src/agents/apollo.md +4 -5
- package/src/agents/athena.md +74 -46
- package/src/agents/demeter.md +10 -7
- package/src/agents/gaia.md +0 -1
- package/src/agents/hephaestus.md +4 -3
- package/src/agents/hermes.md +10 -9
- package/src/agents/iris.md +6 -1
- package/src/agents/mnemosyne.md +14 -15
- package/src/agents/nyx.md +4 -4
- package/src/agents/prometheus.md +12 -11
- package/src/agents/talos.md +6 -0
- package/src/agents/zeus.md +84 -56
- package/src/instructions/agent-return-format.instructions.md +12 -41
- package/src/instructions/memory-protocol.instructions.md +5 -11
- package/src/instructions/test-economy.instructions.md +12 -0
- package/src/instructions/yagni.instructions.md +6 -15
- package/src/instructions/zeus-anti-stall.instructions.md +6 -6
- package/src/instructions/zeus-communication-rules.instructions.md +6 -6
- package/src/instructions/zeus-council-synthesis.instructions.md +11 -12
- package/src/instructions/zeus-memory-operations.instructions.md +13 -7
- package/src/instructions/zeus-timeout-retry.instructions.md +36 -10
- package/src/mcp/_pantheon_paths.py +24 -0
- package/src/mcp/mcp_codemap_module.py +86 -18
- package/src/mcp/mcp_persistence.py +1535 -1050
- package/src/mcp/memory_mcp.py +444 -94
- package/src/mcp/pantheon_vision.py +285 -41
- package/src/mcp/requirements-mcp.txt +5 -0
- package/src/pantheon/context-pruner.ts +541 -0
- package/src/pantheon/cost-command.ts +814 -60
- package/src/pantheon/goal-loop.ts +11 -8
- package/src/pantheon/memory-context.ts +1017 -0
- package/src/pantheon/model-agents.ts +19 -0
- package/src/pantheon/model-command.ts +218 -56
- package/src/pantheon/model-pricing.ts +536 -0
- package/src/pantheon/presets.mjs +2 -0
- package/src/pantheon/task-result-guard.ts +50 -14
- package/src/pantheon/v2-bounded-read.ts +640 -0
- package/src/pantheon/v2-delegation-enforce.ts +133 -6
- package/src/pantheon/v2-execute-after.ts +135 -24
- package/src/pantheon/v2-model-overrides.ts +275 -0
- package/src/pantheon/v2-tools.ts +89 -35
- package/src/pantheon/v2-unsupported.mjs +2 -3
- package/src/pantheon/v2-vision.ts +622 -0
- package/src/pantheon/vision-local.ts +531 -0
- package/src/pantheon/vision.ts +1160 -115
- package/src/plugin-v2.ts +654 -162
- package/src/plugin.ts +15 -11
- package/src/plugins/tui/dist/tui-v2.d.ts +1036 -0
- package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -0
- package/src/plugins/tui/dist/tui-v2.js +3808 -0
- package/src/plugins/tui/dist/tui-v2.js.map +1 -0
- package/src/plugins/tui/dist/tui.js +4 -4
- package/src/plugins/tui/index-v2.ts +6 -0
- package/src/plugins/tui/package-lock.json +5416 -1297
- package/src/plugins/tui/package.json +14 -10
- package/src/plugins/tui/src/index-v2.tsx +4372 -0
- package/src/plugins/tui/src/index.tsx +3 -3
- package/src/plugins/tui/src/opencode-v2.d.ts +13 -0
- package/src/plugins/tui/tsconfig.typecheck.json +5 -0
- package/src/plugins/tui/tsdown.config.ts +2 -2
- package/src/plugins/tui/tui-v2.ts +2 -0
- package/src/plugins/tui/tui.ts +3 -0
- package/src/routing.yml +50 -5
- package/src/skills/agent-coordination/SKILL.md +7 -2
- package/src/skills/artifact-management/SKILL.md +5 -1
- package/src/skills/auto-continue/SKILL.md +14 -6
- package/src/skills/codemap/SKILL.md +1 -1
- package/src/skills/memory-bank/SKILL.md +21 -13
- package/src/skills/session-goal/SKILL.md +14 -15
- package/src/skills/spec-driven-development/SKILL.md +3 -1
- package/src/skills/worktrees/SKILL.md +30 -11
- package/scripts/probe-context-rehydrate.mjs +0 -263
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { spawnSync } from 'node:child_process'
|
|
3
|
-
/**
|
|
4
|
-
* Offline/ambiental probe for context_rehydrate and context_session_summary.
|
|
5
|
-
*
|
|
6
|
-
* The Python child imports the installed persistence server and exercises the
|
|
7
|
-
* real FastMCP tools against a temporary SQLite database. No OpenCode command,
|
|
8
|
-
* network call, LLM, or user database is involved. Missing package/runtime is
|
|
9
|
-
* NOT_TESTED/AMBIENTAL rather than a false PASS.
|
|
10
|
-
*/
|
|
11
|
-
import { existsSync, mkdtempSync, rmSync } from 'node:fs'
|
|
12
|
-
import { tmpdir } from 'node:os'
|
|
13
|
-
import { join } from 'node:path'
|
|
14
|
-
import { fileURLToPath } from 'node:url'
|
|
15
|
-
|
|
16
|
-
const requestedVersion = valueFor('--version')
|
|
17
|
-
const jsonOutput = process.argv.includes('--json')
|
|
18
|
-
const runtime = fileURLToPath(new URL('./mcp_persistence.py', import.meta.url))
|
|
19
|
-
|
|
20
|
-
function valueFor(name) {
|
|
21
|
-
const index = process.argv.indexOf(name)
|
|
22
|
-
return index >= 0 ? process.argv[index + 1] : undefined
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function emit(status, detail, checks = []) {
|
|
26
|
-
const result = { status, version: requestedVersion, detail, checks }
|
|
27
|
-
if (jsonOutput) process.stdout.write(JSON.stringify(result))
|
|
28
|
-
else process.stdout.write(`${status}: ${detail}\n`)
|
|
29
|
-
if (status === 'FAIL') process.exitCode = 1
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function unavailable(detail) {
|
|
33
|
-
emit('NOT_TESTED', detail)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function pythonCandidates() {
|
|
37
|
-
const venvPython = process.env.HOME
|
|
38
|
-
? join(process.env.HOME, '.config', 'opencode', '.venv', 'bin', 'python')
|
|
39
|
-
: undefined
|
|
40
|
-
return [process.env.PANTHEON_PYTHON, venvPython, 'python3'].filter(Boolean)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const PYTHON_HARNESS = `
|
|
44
|
-
import asyncio
|
|
45
|
-
import importlib.util
|
|
46
|
-
import json
|
|
47
|
-
import os
|
|
48
|
-
import sys
|
|
49
|
-
from pathlib import Path
|
|
50
|
-
|
|
51
|
-
runtime_path = Path(sys.argv[1]).resolve()
|
|
52
|
-
db_root = Path(sys.argv[2]).resolve()
|
|
53
|
-
sys.path.insert(0, str(runtime_path.parent))
|
|
54
|
-
sys.argv = [str(runtime_path), "--global-db", str(db_root / "global.db"),
|
|
55
|
-
"--project-db", str(db_root / "project.db")]
|
|
56
|
-
|
|
57
|
-
spec = importlib.util.spec_from_file_location("probe_mcp_persistence", runtime_path)
|
|
58
|
-
if spec is None or spec.loader is None:
|
|
59
|
-
raise RuntimeError("could not load persistence runtime")
|
|
60
|
-
module = importlib.util.module_from_spec(spec)
|
|
61
|
-
spec.loader.exec_module(module)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
async def call(name, arguments):
|
|
65
|
-
result = await module.mcp.call_tool(name, arguments)
|
|
66
|
-
structured = getattr(result, "structured_content", None)
|
|
67
|
-
if structured is not None:
|
|
68
|
-
metadata = getattr(result, "meta", None) or {}
|
|
69
|
-
if metadata.get("fastmcp", {}).get("wrap_result"):
|
|
70
|
-
return structured.get("result") if isinstance(structured, dict) else structured
|
|
71
|
-
return structured
|
|
72
|
-
if isinstance(result, tuple):
|
|
73
|
-
structured = result[1]
|
|
74
|
-
if structured is not None:
|
|
75
|
-
if isinstance(structured, dict) and "result" in structured:
|
|
76
|
-
return structured["result"]
|
|
77
|
-
return structured
|
|
78
|
-
result = result[0]
|
|
79
|
-
if isinstance(result, dict):
|
|
80
|
-
return result
|
|
81
|
-
if not result:
|
|
82
|
-
return None
|
|
83
|
-
text = getattr(result[0], "text", str(result[0]))
|
|
84
|
-
try:
|
|
85
|
-
return json.loads(text)
|
|
86
|
-
except (TypeError, ValueError, json.JSONDecodeError):
|
|
87
|
-
return text
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
async def main():
|
|
91
|
-
checks = []
|
|
92
|
-
slug = "context-rehydrate-probe"
|
|
93
|
-
session_id = "synthetic-session"
|
|
94
|
-
checkpoint = {
|
|
95
|
-
"version": 1,
|
|
96
|
-
"goal": {"id": "probe-goal", "objective": "verify context recovery",
|
|
97
|
-
"status": "in_progress"},
|
|
98
|
-
"phase": {"current": 2, "total": 3, "name": "offline validation"},
|
|
99
|
-
"delegations": {"in_flight": [{"alias": "apo-probe", "agent": "apollo",
|
|
100
|
-
"task_id": "probe-task"}]},
|
|
101
|
-
}
|
|
102
|
-
tail = ["phase 1 complete", "phase 2 payload validated"]
|
|
103
|
-
|
|
104
|
-
# context_save creates the real session-qualified latest pointer. Keeping
|
|
105
|
-
# tail under its own key also tests the runtime's latest/tail fallback.
|
|
106
|
-
await call("context_save", {"slug": slug, "key": "tail",
|
|
107
|
-
"content": json.dumps(tail),
|
|
108
|
-
"session_id": session_id})
|
|
109
|
-
await call("context_save", {"slug": slug, "key": "phase:2",
|
|
110
|
-
"content": json.dumps(checkpoint),
|
|
111
|
-
"session_id": session_id})
|
|
112
|
-
latest = await call("context_get", {"slug": slug, "key": "latest",
|
|
113
|
-
"session_id": session_id})
|
|
114
|
-
stored_tail = await call("context_get", {"slug": slug, "key": "tail",
|
|
115
|
-
"session_id": session_id})
|
|
116
|
-
if latest is None or stored_tail is None:
|
|
117
|
-
raise AssertionError("synthetic latest/tail checkpoint payload is null")
|
|
118
|
-
checks.append("synthetic latest/tail/goal/phase/delegation checkpoint: PASS")
|
|
119
|
-
|
|
120
|
-
os.environ.pop("PANTHEON_COMPACTION", None)
|
|
121
|
-
os.environ.pop("PANTHEON_SESSION_END_SUMMARY", None)
|
|
122
|
-
blocks = await call("context_rehydrate", {"slug": slug,
|
|
123
|
-
"session_id": session_id})
|
|
124
|
-
summary = await call("context_session_summary", {"slug": slug,
|
|
125
|
-
"session_id": session_id})
|
|
126
|
-
if not isinstance(blocks, list) or not blocks:
|
|
127
|
-
raise AssertionError("context_rehydrate returned a null/empty payload")
|
|
128
|
-
if not isinstance(summary, str) or not summary:
|
|
129
|
-
raise AssertionError("context_session_summary returned a null/empty payload")
|
|
130
|
-
for fragment in ("verify context recovery", "phase 2/3", "apo-probe",
|
|
131
|
-
"phase 2 payload validated"):
|
|
132
|
-
if not any(fragment in block for block in blocks) and fragment not in summary:
|
|
133
|
-
raise AssertionError(f"payload is missing {fragment!r}")
|
|
134
|
-
checks.append("context_rehydrate non-null payload: PASS")
|
|
135
|
-
checks.append("context_session_summary non-null payload: PASS")
|
|
136
|
-
|
|
137
|
-
missing_blocks = await call("context_rehydrate", {"slug": "probe-absent",
|
|
138
|
-
"session_id": session_id})
|
|
139
|
-
missing_summary = await call("context_session_summary", {"slug": "probe-absent",
|
|
140
|
-
"session_id": session_id})
|
|
141
|
-
if missing_blocks is not None or missing_summary is not None:
|
|
142
|
-
raise AssertionError("absent checkpoint must return null payloads")
|
|
143
|
-
checks.append("absence returns null: PASS")
|
|
144
|
-
|
|
145
|
-
expired_slug = "context-expired-probe"
|
|
146
|
-
await call("context_save", {"slug": expired_slug, "key": "phase:1",
|
|
147
|
-
"content": json.dumps(checkpoint), "ttl": 1,
|
|
148
|
-
"session_id": session_id})
|
|
149
|
-
# Use the public TTL contract (positive seconds) and let the entry expire;
|
|
150
|
-
# negative TTLs are rejected by validation and must not be special-cased.
|
|
151
|
-
await asyncio.sleep(1.2)
|
|
152
|
-
expired_blocks = await call("context_rehydrate", {"slug": expired_slug,
|
|
153
|
-
"session_id": session_id})
|
|
154
|
-
expired_summary = await call("context_session_summary", {"slug": expired_slug,
|
|
155
|
-
"session_id": session_id})
|
|
156
|
-
if expired_blocks is not None or expired_summary is not None:
|
|
157
|
-
raise AssertionError("expired checkpoint must return null payloads")
|
|
158
|
-
checks.append("expiration returns null: PASS")
|
|
159
|
-
|
|
160
|
-
invalid_slug = "context-invalid-probe"
|
|
161
|
-
await call("context_save", {"slug": invalid_slug, "key": "phase:1",
|
|
162
|
-
"content": "not-json", "session_id": session_id})
|
|
163
|
-
invalid_blocks = await call("context_rehydrate", {"slug": invalid_slug,
|
|
164
|
-
"session_id": session_id})
|
|
165
|
-
invalid_summary = await call("context_session_summary", {"slug": invalid_slug,
|
|
166
|
-
"session_id": session_id})
|
|
167
|
-
if invalid_blocks is not None or invalid_summary is not None:
|
|
168
|
-
raise AssertionError("invalid checkpoint must return null payloads")
|
|
169
|
-
checks.append("invalid payload returns null: PASS")
|
|
170
|
-
|
|
171
|
-
os.environ["PANTHEON_COMPACTION"] = "off"
|
|
172
|
-
switched_blocks = await call("context_rehydrate", {"slug": slug,
|
|
173
|
-
"session_id": session_id})
|
|
174
|
-
if switched_blocks is not None:
|
|
175
|
-
raise AssertionError("PANTHEON_COMPACTION=off must return null")
|
|
176
|
-
os.environ.pop("PANTHEON_COMPACTION", None)
|
|
177
|
-
os.environ["PANTHEON_SESSION_END_SUMMARY"] = "off"
|
|
178
|
-
switched_summary = await call("context_session_summary", {"slug": slug,
|
|
179
|
-
"session_id": session_id})
|
|
180
|
-
if switched_summary is not None:
|
|
181
|
-
raise AssertionError("PANTHEON_SESSION_END_SUMMARY=off must return null")
|
|
182
|
-
checks.append("kill-switches return null: PASS")
|
|
183
|
-
print(json.dumps({"checks": checks}))
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
asyncio.run(main())
|
|
187
|
-
`
|
|
188
|
-
|
|
189
|
-
async function main() {
|
|
190
|
-
if (requestedVersion !== 'v1' && requestedVersion !== 'v2') {
|
|
191
|
-
emit('FAIL', 'usage: --version v1|v2 [--json]')
|
|
192
|
-
return
|
|
193
|
-
}
|
|
194
|
-
if (!existsSync(runtime)) {
|
|
195
|
-
unavailable('installed package does not include mcp_persistence.py')
|
|
196
|
-
return
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
const root = mkdtempSync(join(tmpdir(), 'pantheon-context-probe-'))
|
|
200
|
-
const dbRoot = join(root, 'db')
|
|
201
|
-
const python = pythonCandidates().find((candidate) =>
|
|
202
|
-
candidate.includes('/') ? existsSync(candidate) : true,
|
|
203
|
-
)
|
|
204
|
-
if (!python) {
|
|
205
|
-
rmSync(root, { recursive: true, force: true })
|
|
206
|
-
unavailable('Python persistence runtime is not available')
|
|
207
|
-
return
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
try {
|
|
211
|
-
const child = spawnSync(python, ['-c', PYTHON_HARNESS, runtime, dbRoot], {
|
|
212
|
-
encoding: 'utf8',
|
|
213
|
-
timeout: 30000,
|
|
214
|
-
env: process.env,
|
|
215
|
-
})
|
|
216
|
-
if (child.error) {
|
|
217
|
-
const detail = child.error instanceof Error ? child.error.message : String(child.error)
|
|
218
|
-
if (/EACCES|permission denied|not found/i.test(detail)) {
|
|
219
|
-
emit('AMBIENTAL', `persistence runtime unavailable: ${detail}`)
|
|
220
|
-
} else {
|
|
221
|
-
unavailable(`persistence runtime unavailable: ${detail}`)
|
|
222
|
-
}
|
|
223
|
-
return
|
|
224
|
-
}
|
|
225
|
-
if (child.signal === 'SIGTERM') {
|
|
226
|
-
emit('AMBIENTAL', 'persistence probe timed out after 30s')
|
|
227
|
-
return
|
|
228
|
-
}
|
|
229
|
-
if (/IncompleteFieldDefinitionWarning|pydantic_settings/i.test(child.stderr)) {
|
|
230
|
-
emit('FAIL', 'persistence probe emitted an incomplete pydantic_settings field warning')
|
|
231
|
-
return
|
|
232
|
-
}
|
|
233
|
-
if (child.status !== 0) {
|
|
234
|
-
const detail = `${child.stderr || child.stdout || 'persistence probe failed'}`.trim()
|
|
235
|
-
if (
|
|
236
|
-
/No module named|ModuleNotFoundError|can't open file|No such file|importerror/i.test(detail)
|
|
237
|
-
) {
|
|
238
|
-
unavailable(`persistence runtime unavailable: ${detail.slice(0, 320)}`)
|
|
239
|
-
} else {
|
|
240
|
-
emit('FAIL', `offline persistence checks failed: ${detail.slice(0, 320)}`)
|
|
241
|
-
}
|
|
242
|
-
return
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
const lines = child.stdout.trim().split('\n').filter(Boolean)
|
|
246
|
-
const payload = JSON.parse(lines.at(-1) || '')
|
|
247
|
-
if (!Array.isArray(payload.checks) || payload.checks.length < 6) {
|
|
248
|
-
emit('FAIL', 'offline persistence probe returned incomplete checks')
|
|
249
|
-
return
|
|
250
|
-
}
|
|
251
|
-
emit(
|
|
252
|
-
'PASS',
|
|
253
|
-
'offline synthetic persistence checks passed; no LLM or user DB was used',
|
|
254
|
-
payload.checks,
|
|
255
|
-
)
|
|
256
|
-
} catch (error) {
|
|
257
|
-
emit('FAIL', error instanceof Error ? error.message : String(error))
|
|
258
|
-
} finally {
|
|
259
|
-
rmSync(root, { recursive: true, force: true })
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
await main()
|