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.
- package/.pantheon/code-mode/README.md +4 -2
- package/.pantheon/code-mode/checkpoint_session.py +138 -102
- package/.pantheon/code-mode/compress-inline.py +102 -57
- package/.pantheon/code-mode/manifest.json +2 -8
- package/AGENTS.global.md +182 -0
- package/AGENTS.md +10 -891
- package/CHANGELOG.md +343 -0
- package/README.md +577 -79
- package/README.pt-BR.md +345 -60
- package/bin/pantheon-init.mjs +26 -3
- 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-optimize.md +2 -2
- package/commands/pantheon-vision.md +61 -12
- package/package.json +30 -11
- package/plugin.json +2 -2
- package/pyproject.toml +11 -16
- package/scripts/build-agents-md.mjs +376 -58
- package/scripts/changelog-merge.mjs +161 -0
- package/scripts/check-plugin-v2-coverage.mjs +213 -0
- package/scripts/ci-validate-yaml.py +7 -5
- package/scripts/{code_mode_server.py → code_mode.py} +119 -27
- package/scripts/cost.mjs +244 -41
- package/scripts/doctor.mjs +236 -29
- package/scripts/install/agents-md.mjs +4 -4
- package/scripts/install/cli-ui.mjs +1 -1
- package/scripts/install/config-migration.mjs +319 -6
- package/scripts/install/health-check.mjs +26 -37
- package/scripts/install/interactive.mjs +7 -7
- package/scripts/install/migrate.mjs +1 -1
- package/scripts/install/opencode-version.mjs +246 -4
- package/scripts/install/opencode.mjs +627 -179
- package/scripts/install/plugin.mjs +43 -9
- package/scripts/install/shared.mjs +120 -12
- package/scripts/install/vision-prompt.mjs +161 -0
- package/scripts/install-mcp.mjs +28 -9
- package/scripts/{mcp_persistence_server.py → mcp_persistence.py} +392 -78
- package/{src/mcp/mcp_resources_server.py → scripts/mcp_resources.py} +2 -2
- package/scripts/{memory_mcp_server.py → memory_mcp.py} +372 -198
- package/scripts/postinstall.mjs +0 -7
- package/scripts/probe-context-rehydrate.mjs +36 -13
- package/scripts/probe-pantheon-cost.mjs +71 -15
- package/scripts/prune.mjs +2 -2
- package/scripts/run-node-tests.mjs +189 -0
- package/scripts/sync-artifacts.mjs +26 -13
- package/scripts/sync-tui.mjs +24 -3
- package/scripts/test-opencode-v2-sandbox.sh +1913 -0
- package/scripts/validate-routing.mjs +43 -3
- package/scripts/validate-sandbox-install.mjs +138 -0
- package/scripts/versioning.mjs +13 -1
- package/scripts/vision-status.mjs +682 -0
- package/skills-lock.json +15 -16
- package/src/agents/aphrodite.md +20 -37
- package/src/agents/apollo.md +7 -3
- package/src/agents/athena.md +63 -35
- package/src/agents/demeter.md +8 -28
- package/src/agents/gaia.md +1 -1
- package/src/agents/hephaestus.md +10 -21
- package/src/agents/hermes.md +15 -38
- package/src/agents/iris.md +1 -1
- package/src/agents/mnemosyne.md +23 -60
- package/src/agents/nyx.md +1 -1
- package/src/agents/prometheus.md +16 -20
- package/src/agents/talos.md +10 -2
- package/src/agents/themis.md +5 -5
- package/src/agents/zeus.md +99 -130
- package/src/instructions/agent-return-format.instructions.md +18 -3
- package/src/instructions/backend-standards.instructions.md +2 -0
- package/src/instructions/frontend-standards.instructions.md +3 -1
- package/src/instructions/memory-protocol.instructions.md +11 -110
- package/src/instructions/zeus-anti-stall.instructions.md +14 -61
- package/src/instructions/zeus-communication-rules.instructions.md +0 -1
- package/src/instructions/zeus-council-synthesis.instructions.md +32 -260
- package/src/instructions/zeus-memory-operations.instructions.md +26 -0
- package/src/instructions/zeus-timeout-retry.instructions.md +40 -87
- package/src/mcp/{code_mode_server.py → code_mode.py} +119 -27
- package/src/mcp/eval_store.py +2 -2
- package/src/mcp/mcp_codemap_module.py +559 -129
- package/src/mcp/{mcp_persistence_server.py → mcp_persistence.py} +392 -78
- package/{scripts/mcp_resources_server.py → src/mcp/mcp_resources.py} +2 -2
- package/src/mcp/{memory_mcp_server.py → memory_mcp.py} +373 -250
- package/src/mcp/{pantheon_vision_server.py → pantheon_vision.py} +396 -40
- package/src/mcp/requirements-mcp.txt +10 -6
- package/src/mcp/requirements-vision.txt +4 -2
- package/src/pantheon/cost-command.ts +399 -101
- package/src/pantheon/delegation-enforce.ts +10 -1
- package/src/pantheon/model-command.ts +18 -7
- package/src/pantheon/presets.d.mts +0 -8
- package/src/pantheon/presets.mjs +5 -32
- package/src/pantheon/todo-enforcer.ts +1 -1
- package/src/pantheon/v2-bounded-read.ts +640 -0
- package/src/pantheon/v2-delegation-enforce.ts +214 -0
- package/src/pantheon/v2-execute-after.ts +186 -0
- package/src/pantheon/v2-tools.ts +429 -0
- package/src/pantheon/v2-unsupported.d.mts +11 -0
- package/src/pantheon/v2-unsupported.mjs +90 -0
- package/src/pantheon/v2-vision.ts +622 -0
- package/src/pantheon/vision-local.ts +531 -0
- package/src/pantheon/vision.ts +1161 -116
- package/src/plugin-v2.ts +1244 -288
- package/src/plugin.ts +12 -9
- package/src/plugins/tui/dist/server.d.ts +1 -2
- package/src/plugins/tui/dist/server.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui-v2.d.ts +154 -0
- package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -0
- package/src/plugins/tui/dist/tui-v2.js +659 -0
- package/src/plugins/tui/dist/tui-v2.js.map +1 -0
- package/src/plugins/tui/dist/tui.d.ts +85 -82
- package/src/plugins/tui/dist/tui.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui.js +72 -59
- package/src/plugins/tui/index-v2.ts +6 -0
- package/src/plugins/tui/package-lock.json +5504 -1341
- package/src/plugins/tui/package.json +25 -15
- package/src/plugins/tui/src/index-v2.tsx +734 -0
- package/src/plugins/tui/src/index.tsx +106 -85
- package/src/plugins/tui/src/opencode-v2.d.ts +13 -0
- package/src/plugins/tui/tsconfig.build.json +5 -0
- package/src/plugins/tui/tsconfig.typecheck.json +5 -0
- package/src/plugins/tui/tsdown.config.ts +22 -2
- package/src/plugins/tui/tui-v2.ts +2 -0
- package/src/plugins/tui/tui.ts +3 -0
- package/src/routing.yml +11 -22
- package/src/skills/README.md +34 -39
- package/src/skills/agent-coordination/SKILL.md +7 -2
- package/src/skills/artifact-management/SKILL.md +12 -5
- package/src/skills/auto-continue/SKILL.md +54 -95
- package/src/skills/code-review-checklist/SKILL.md +5 -5
- package/src/skills/context-compression/SKILL.md +26 -879
- package/src/skills/session-goal/SKILL.md +14 -5
- package/src/skills/spec-driven-development/SKILL.md +3 -1
- package/src/skills/tdd-with-agents/SKILL.md +18 -10
- package/.pantheon/code-mode/eval-llm-judge.py +0 -255
- package/.pantheon/code-mode/eval-monte-carlo.py +0 -368
- package/.pantheon/code-mode/eval-run.py +0 -197
- package/.pantheon/code-mode/eval-static.py +0 -321
- package/.pantheon/code-mode/session-end-save.py +0 -186
- package/.pantheon/code-mode/session-end-save.sh +0 -18
- package/opencode.json +0 -58
- package/scripts/recover-zenodo-deposition.mjs +0 -146
- package/scripts/test-opencode-v1-v2-sandbox.sh +0 -862
- package/scripts/validate-zenodo-release.mjs +0 -154
- package/scripts/zenodo-artifact.mjs +0 -94
- package/scripts/zenodo-release-state.mjs +0 -53
- package/src/skills/orchestration-workflow/SKILL.md +0 -311
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { pathToFileURL } from 'node:url'
|
|
2
|
-
import { validateZenodoResponse } from './zenodo-release-state.mjs'
|
|
3
|
-
|
|
4
|
-
export function zenodoReleaseMarker(tag) {
|
|
5
|
-
if (typeof tag !== 'string' || !/^v\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(tag))
|
|
6
|
-
throw new Error('Release tag is invalid.')
|
|
7
|
-
return `pantheon-opencode-release:${tag}`
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function depositionDescription(deposition) {
|
|
11
|
-
return [deposition?.metadata?.description, deposition?.description]
|
|
12
|
-
.filter((value) => typeof value === 'string')
|
|
13
|
-
.join('\n')
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function exactTotal(value) {
|
|
17
|
-
if (Number.isSafeInteger(value) && value >= 0) return value
|
|
18
|
-
if (
|
|
19
|
-
value &&
|
|
20
|
-
typeof value === 'object' &&
|
|
21
|
-
Number.isSafeInteger(value.value) &&
|
|
22
|
-
value.value >= 0 &&
|
|
23
|
-
(value.relation === undefined || value.relation === 'eq')
|
|
24
|
-
)
|
|
25
|
-
return value.value
|
|
26
|
-
return null
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export async function findUniqueZenodoDeposition(
|
|
30
|
-
depositionsUrl,
|
|
31
|
-
token,
|
|
32
|
-
releaseMarker,
|
|
33
|
-
fetchImpl = fetch,
|
|
34
|
-
) {
|
|
35
|
-
let url
|
|
36
|
-
try {
|
|
37
|
-
url = new URL(depositionsUrl)
|
|
38
|
-
} catch {
|
|
39
|
-
throw new Error('Zenodo deposition URL must be a valid absolute HTTPS URL.')
|
|
40
|
-
}
|
|
41
|
-
if (
|
|
42
|
-
url.protocol !== 'https:' ||
|
|
43
|
-
!url.hostname ||
|
|
44
|
-
url.username ||
|
|
45
|
-
url.password ||
|
|
46
|
-
url.hash ||
|
|
47
|
-
/%(?![0-9A-Fa-f]{2})/.test(depositionsUrl) ||
|
|
48
|
-
/[\s{}\\|^`]/.test(depositionsUrl)
|
|
49
|
-
)
|
|
50
|
-
throw new Error('Zenodo deposition URL must be a valid HTTPS URL without credentials.')
|
|
51
|
-
if (typeof releaseMarker !== 'string' || !releaseMarker)
|
|
52
|
-
throw new Error('Zenodo release marker is required.')
|
|
53
|
-
if (typeof token !== 'string' || !token) throw new Error('Zenodo token is required.')
|
|
54
|
-
url.searchParams.set('q', releaseMarker)
|
|
55
|
-
// Zenodo documents page/size for this endpoint. The response's links are
|
|
56
|
-
// optional, so keep a deterministic fallback for the real hits/total shape.
|
|
57
|
-
url.searchParams.set('page', '1')
|
|
58
|
-
url.searchParams.set('size', '100')
|
|
59
|
-
const candidates = []
|
|
60
|
-
const visitedUrls = new Set()
|
|
61
|
-
let nextUrl = url
|
|
62
|
-
let pageNumber = 1
|
|
63
|
-
let expectedTotal = null
|
|
64
|
-
while (nextUrl) {
|
|
65
|
-
const currentUrl = String(nextUrl)
|
|
66
|
-
if (visitedUrls.has(currentUrl)) throw new Error('Zenodo search returned a pagination cycle.')
|
|
67
|
-
visitedUrls.add(currentUrl)
|
|
68
|
-
const response = await fetchImpl(nextUrl, {
|
|
69
|
-
headers: { Authorization: `Bearer ${token}`, Accept: 'application/json' },
|
|
70
|
-
})
|
|
71
|
-
if (!response.ok) throw new Error(`Zenodo deposition search failed (${response.status}).`)
|
|
72
|
-
const payload = await response.json()
|
|
73
|
-
if (Array.isArray(payload)) {
|
|
74
|
-
throw new Error('Zenodo search returned ambiguous pagination.')
|
|
75
|
-
}
|
|
76
|
-
const page = payload?.hits?.hits
|
|
77
|
-
const total = payload?.hits?.total
|
|
78
|
-
const normalizedTotal = exactTotal(total)
|
|
79
|
-
if (!Array.isArray(page) || normalizedTotal === null)
|
|
80
|
-
throw new Error('Zenodo search returned ambiguous pagination.')
|
|
81
|
-
if (expectedTotal !== null && expectedTotal !== normalizedTotal)
|
|
82
|
-
throw new Error('Zenodo search returned inconsistent pagination totals.')
|
|
83
|
-
expectedTotal = normalizedTotal
|
|
84
|
-
candidates.push(...page)
|
|
85
|
-
const rawNext = payload?.links?.next
|
|
86
|
-
if (candidates.length >= expectedTotal) {
|
|
87
|
-
nextUrl = null
|
|
88
|
-
} else if (rawNext === null || rawNext === undefined || rawNext === '') {
|
|
89
|
-
// Some Zenodo Cloud responses omit links entirely. Continue with the
|
|
90
|
-
// documented page parameter instead of treating the first page as the
|
|
91
|
-
// complete search result.
|
|
92
|
-
if (page.length === 0)
|
|
93
|
-
throw new Error('Zenodo search ended before all results were examined.')
|
|
94
|
-
pageNumber += 1
|
|
95
|
-
const pagedNext = new URL(url)
|
|
96
|
-
pagedNext.searchParams.set('page', String(pageNumber))
|
|
97
|
-
nextUrl = pagedNext
|
|
98
|
-
} else {
|
|
99
|
-
if (typeof rawNext !== 'string')
|
|
100
|
-
throw new Error('Zenodo search returned an invalid pagination link.')
|
|
101
|
-
let parsedNext
|
|
102
|
-
try {
|
|
103
|
-
parsedNext = new URL(rawNext, url)
|
|
104
|
-
} catch {
|
|
105
|
-
throw new Error('Zenodo search returned an invalid pagination link.')
|
|
106
|
-
}
|
|
107
|
-
if (
|
|
108
|
-
parsedNext.protocol !== 'https:' ||
|
|
109
|
-
parsedNext.origin !== url.origin ||
|
|
110
|
-
parsedNext.pathname !== url.pathname
|
|
111
|
-
)
|
|
112
|
-
throw new Error('Zenodo search returned an unsafe pagination link.')
|
|
113
|
-
const linkedPage = Number(parsedNext.searchParams.get('page'))
|
|
114
|
-
if (Number.isSafeInteger(linkedPage) && linkedPage > pageNumber) {
|
|
115
|
-
pageNumber = linkedPage
|
|
116
|
-
}
|
|
117
|
-
nextUrl = parsedNext
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
const escapedMarker = releaseMarker.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
|
121
|
-
const markerPattern = new RegExp(`(?:^|[^A-Za-z0-9._:-])${escapedMarker}(?![A-Za-z0-9.-])`)
|
|
122
|
-
const matches = candidates.filter((deposition) =>
|
|
123
|
-
markerPattern.test(depositionDescription(deposition)),
|
|
124
|
-
)
|
|
125
|
-
if (matches.length === 0) return null
|
|
126
|
-
if (matches.length !== 1) {
|
|
127
|
-
throw new Error(
|
|
128
|
-
`Zenodo recovery requires exactly one matching deposition; found ${matches.length}.`,
|
|
129
|
-
)
|
|
130
|
-
}
|
|
131
|
-
return validateZenodoResponse(matches[0])
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
135
|
-
try {
|
|
136
|
-
const result = await findUniqueZenodoDeposition(
|
|
137
|
-
process.env.ZENODO_DEPOSITIONS_URL,
|
|
138
|
-
process.env.ZENODO_TOKEN,
|
|
139
|
-
process.env.RELEASE_MARKER,
|
|
140
|
-
)
|
|
141
|
-
process.stdout.write(JSON.stringify(result))
|
|
142
|
-
} catch (error) {
|
|
143
|
-
console.error(`zenodo recovery: ${error.message}`)
|
|
144
|
-
process.exit(1)
|
|
145
|
-
}
|
|
146
|
-
}
|