pantheon-opencode 1.6.1 → 1.6.2-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/AGENTS.global.md +11 -11
- package/AGENTS.md +2 -2
- package/CHANGELOG.md +179 -0
- package/README.md +268 -20
- package/README.pt-BR.md +34 -11
- package/bin/pantheon-init.mjs +301 -32
- package/package.json +13 -4
- package/plugin.json +1 -1
- package/prompts/README.md +58 -0
- package/prompts/debug-issue.prompt.md +46 -0
- package/prompts/dynamic/agora-generated.txt +38 -0
- package/prompts/dynamic/orchestrate-generated.txt +51 -0
- package/prompts/focus.prompt.md +42 -0
- package/prompts/implement-feature.prompt.md +39 -0
- package/prompts/optimize-database.prompt.md +58 -0
- package/prompts/orchestrate-with-zeus.prompt.md +441 -0
- package/prompts/plan-architecture.prompt.md +59 -0
- package/prompts/quick-discovery-large-codebase.prompt.md +294 -0
- package/prompts/quick-plan-large-feature.prompt.md +197 -0
- package/prompts/semantic-summarize.md +50 -0
- package/prompts/sketch.prompt.md +91 -0
- package/prompts/subtask.prompt.md +131 -0
- package/pyproject.toml +1 -1
- package/scripts/build-agents-md.mjs +1 -1
- package/scripts/decision-router-budget.mjs +780 -0
- package/scripts/decision-router-v2-budget.mjs +218 -0
- package/scripts/decision-router-v2-egress.mjs +272 -0
- package/scripts/decision-router.mjs +758 -0
- package/scripts/docs-check-changelog.mjs +5 -3
- package/scripts/doctor.mjs +213 -45
- package/scripts/install/agents-md.mjs +2 -1
- package/scripts/install/component-selection.mjs +9 -4
- package/scripts/install/config-migration.mjs +344 -393
- package/scripts/install/config-paths.mjs +15 -0
- package/scripts/install/decision-layer-preview.mjs +376 -0
- package/scripts/install/decision-router-config.mjs +560 -0
- package/scripts/install/health-check.mjs +20 -11
- package/scripts/install/interactive.mjs +103 -14
- package/scripts/install/interrupt.mjs +4 -3
- package/scripts/install/mcp-permissions.mjs +164 -0
- package/scripts/install/migrate.mjs +123 -72
- package/scripts/install/opencode-version.mjs +31 -13
- package/scripts/install/opencode-wildcard.mjs +106 -0
- package/scripts/install/opencode.mjs +411 -184
- package/scripts/install/plan-artifact.mjs +12 -1
- package/scripts/install/plan.mjs +8 -1
- package/scripts/install/plugin.mjs +18 -1
- package/scripts/install/state.mjs +12 -0
- package/scripts/install/strings.mjs +22 -0
- package/scripts/install/v2-capabilities.mjs +5 -6
- package/scripts/install/venv.mjs +34 -17
- package/scripts/mcp_resources.py +11 -9
- package/scripts/package-evidence.mjs +1 -0
- package/scripts/release-notes.mjs +30 -7
- package/scripts/restore.mjs +22 -10
- package/scripts/sandbox-env.sh +174 -0
- package/scripts/setup-v2-config.mjs +1703 -0
- package/scripts/setup.mjs +415 -0
- package/scripts/sync-tui.mjs +9 -1
- package/scripts/test-opencode-v2-sandbox.sh +448 -157
- package/scripts/update-skills-lock.mjs +30 -0
- package/scripts/versioning.mjs +41 -5
- package/skills-lock.json +10 -10
- package/src/agents/aphrodite.md +11 -3
- package/src/agents/apollo.md +6 -0
- package/src/agents/athena.md +7 -1
- package/src/agents/demeter.md +6 -2
- package/src/agents/gaia.md +5 -0
- package/src/agents/hephaestus.md +7 -2
- package/src/agents/hermes.md +14 -13
- package/src/agents/iris.md +6 -2
- package/src/agents/mnemosyne.md +21 -50
- package/src/agents/nyx.md +6 -2
- package/src/agents/prometheus.md +5 -1
- package/src/agents/talos.md +10 -1
- package/src/agents/themis.md +5 -1
- package/src/agents/zeus.md +61 -65
- package/src/instructions/agent-return-format.instructions.md +1 -1
- package/src/instructions/memory-protocol.instructions.md +3 -3
- package/src/instructions/test-economy.instructions.md +6 -6
- package/src/mcp/eval_store.py +11 -4
- package/src/mcp/mcp_resources.py +11 -9
- package/src/mcp/memory_mcp.py +293 -150
- package/src/mcp/pantheon_vision.py +37 -36
- package/src/pantheon/cost-command.ts +30 -133
- package/src/pantheon/jev-decision-tool.ts +347 -0
- package/src/pantheon/jev-decisions.ts +625 -0
- package/src/pantheon/local-decision-agents.ts +170 -0
- package/src/pantheon/local-decision-budget.ts +1046 -0
- package/src/pantheon/local-decision-egress-gate.ts +144 -0
- package/src/pantheon/local-decision-prompt.ts +256 -0
- package/src/pantheon/local-decision-provider-matrix.ts +44 -0
- package/src/pantheon/local-decision-router.ts +225 -0
- package/src/pantheon/local-decision-skills.ts +281 -0
- package/src/pantheon/local-decision-tool.ts +160 -0
- package/src/pantheon/local-decision-turn.ts +101 -0
- package/src/pantheon/local-decision-usage-evidence.internal.ts +168 -0
- package/src/pantheon/local-orchestration.ts +322 -0
- package/src/pantheon/model-pricing.ts +1 -536
- package/src/pantheon/pantheon-decision-catalog.ts +101 -0
- package/src/pantheon/v2-decision-budget.ts +456 -0
- package/src/pantheon/v2-decision-contracts.ts +300 -0
- package/src/pantheon/v2-decision-egress.ts +203 -0
- package/src/pantheon/v2-decision-events.ts +180 -0
- package/src/pantheon/v2-decision-heuristic.ts +121 -0
- package/src/pantheon/v2-decision-points/p1-agent.ts +91 -0
- package/src/pantheon/v2-decision-points/p10-claims.ts +243 -0
- package/src/pantheon/v2-decision-points/p11-catalog.ts +220 -0
- package/src/pantheon/v2-decision-points/p2-skill.ts +83 -0
- package/src/pantheon/v2-decision-points/p3-complexity.ts +108 -0
- package/src/pantheon/v2-decision-points/p4-memory.ts +137 -0
- package/src/pantheon/v2-decision-points/p5-themis-verify.ts +190 -0
- package/src/pantheon/v2-decision-points/p6-council.ts +161 -0
- package/src/pantheon/v2-decision-points/p7-loop.ts +263 -0
- package/src/pantheon/v2-decision-points/p8-guardrail.ts +367 -0
- package/src/pantheon/v2-decision-points/p9-memory-compaction.ts +304 -0
- package/src/pantheon/v2-decision-points.ts +242 -0
- package/src/pantheon/v2-decision-policy.ts +166 -0
- package/src/pantheon/v2-decision-premises.ts +146 -0
- package/src/pantheon/v2-decision-prompt-surface.ts +115 -0
- package/src/pantheon/v2-decision-rank.ts +91 -0
- package/src/pantheon/v2-decision-registry.ts +391 -0
- package/src/pantheon/v2-decision-resource-ids.ts +127 -0
- package/src/pantheon/v2-decision-shadow.ts +123 -0
- package/src/pantheon/v2-decision-telemetry.ts +214 -0
- package/src/pantheon/v2-decision-verify.ts +51 -0
- package/src/pantheon/v2-hook-engine.ts +307 -0
- package/src/pantheon/v2-native-decisions.ts +365 -0
- package/src/pantheon/v2-shell-hooks.ts +66 -2
- package/src/pantheon/v2-tools.ts +38 -15
- package/src/pantheon/v2-vision.ts +34 -29
- package/src/pantheon/vision.ts +43 -10
- package/src/plugin-v2.ts +449 -79
- package/src/plugin.ts +4 -0
- package/src/plugins/tui/THIRD_PARTY_NOTICES.md +24 -0
- package/src/plugins/tui/dist/server-v2.d.ts +22 -0
- package/src/plugins/tui/dist/server-v2.d.ts.map +1 -0
- package/src/plugins/tui/dist/server-v2.js +26 -0
- package/src/plugins/tui/dist/server-v2.js.map +1 -0
- package/src/plugins/tui/dist/tui-v2.d.ts +54 -51
- package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui-v2.js +762 -529
- package/src/plugins/tui/dist/tui-v2.js.map +1 -1
- package/src/plugins/tui/dist/tui.js +1 -1
- package/src/plugins/tui/index-v2.ts +3 -6
- package/src/plugins/tui/package-lock.json +17 -2
- package/src/plugins/tui/package.json +6 -3
- package/src/plugins/tui/src/context-gauge.ts +59 -0
- package/src/plugins/tui/src/cost-data.ts +607 -0
- package/src/plugins/tui/src/index-v2.tsx +360 -242
- package/src/plugins/tui/src/model-pricing.ts +536 -0
- package/src/plugins/tui/src/model-usage-limits.ts +4 -0
- package/src/plugins/tui/src/server-v2.ts +21 -0
- package/src/plugins/tui/src/sidebar-width.ts +129 -0
- package/src/plugins/tui/tsconfig.typecheck.json +1 -1
- package/src/plugins/tui/tsdown.config.ts +34 -5
- package/src/routing.yml +72 -13
- package/src/skills/README.md +4 -0
- package/src/skills/agent-coordination/SKILL.md +0 -3
- package/src/skills/artifact-management/SKILL.md +0 -3
- package/src/skills/auto-continue/SKILL.md +0 -3
- package/src/skills/code-review-checklist/SKILL.md +0 -3
- package/src/skills/context-compression/SKILL.md +0 -3
- package/src/skills/memory-bank/SKILL.md +6 -28
- package/src/skills/session-goal/SKILL.md +0 -3
- package/src/skills/simplify/SKILL.md +5 -4
- package/src/skills/tdd-with-agents/SKILL.md +0 -3
- package/src/skills/visual-review-pipeline/SKILL.md +0 -1
- package/src/pantheon/memory-context.ts +0 -1017
|
@@ -11,20 +11,38 @@ const VALID_VERSIONS = new Set(['v1', 'v2', 'auto'])
|
|
|
11
11
|
|
|
12
12
|
/** @param {string[]} args @returns {'v1'|'v2'|'auto'|null} */
|
|
13
13
|
export function parseOpenCodeVersion(args) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
// Match init's selector precedence: modern --version wins over the legacy
|
|
15
|
+
// alias regardless of argument order. The package-level --version command is
|
|
16
|
+
// handled before this init selector parser is called.
|
|
17
|
+
const inlineModern = args.find((arg) => arg.startsWith('--version='))
|
|
18
|
+
if (inlineModern !== undefined) {
|
|
19
|
+
const value = inlineModern.slice('--version='.length)
|
|
20
|
+
if (!value) throw missingVersionValue('--version')
|
|
21
|
+
return normalize(value)
|
|
22
|
+
}
|
|
23
|
+
const modernIndex = args.indexOf('--version')
|
|
24
|
+
if (modernIndex >= 0) {
|
|
25
|
+
const modern = args[modernIndex + 1]
|
|
26
|
+
if (modern === undefined || modern.startsWith('-')) throw missingVersionValue('--version')
|
|
27
|
+
return normalize(modern)
|
|
28
|
+
}
|
|
29
|
+
const inlineLegacy = args.find((arg) => arg.startsWith('--opencode-version='))
|
|
30
|
+
if (inlineLegacy !== undefined) {
|
|
31
|
+
const value = inlineLegacy.slice('--opencode-version='.length)
|
|
32
|
+
if (!value) throw missingVersionValue('--opencode-version')
|
|
33
|
+
return normalize(value)
|
|
26
34
|
}
|
|
27
|
-
|
|
35
|
+
const legacyIndex = args.indexOf('--opencode-version')
|
|
36
|
+
if (legacyIndex < 0) return null
|
|
37
|
+
const legacy = args[legacyIndex + 1]
|
|
38
|
+
if (legacy === undefined || legacy.startsWith('-')) {
|
|
39
|
+
throw missingVersionValue('--opencode-version')
|
|
40
|
+
}
|
|
41
|
+
return normalize(legacy)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function missingVersionValue(flag) {
|
|
45
|
+
return new Error(`${flag} requires a value: v1, v2, or auto.`)
|
|
28
46
|
}
|
|
29
47
|
|
|
30
48
|
function normalize(value) {
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/** OpenCode's permission wildcard matcher and exact language intersection. */
|
|
2
|
+
|
|
3
|
+
const CASE_INSENSITIVE = process.platform === 'win32'
|
|
4
|
+
|
|
5
|
+
function normalizePattern(pattern) {
|
|
6
|
+
return pattern.replaceAll('\\', '/')
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function escapeRegexCharacter(char) {
|
|
10
|
+
return /[\\^$.*+?()[\]{}|]/.test(char) ? `\\${char}` : char
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Match the OpenCode Wildcard.match behavior used by permission evaluation. */
|
|
14
|
+
export function opencodeWildcardMatch(input, pattern) {
|
|
15
|
+
const normalizedPattern = normalizePattern(pattern)
|
|
16
|
+
const trailingSpaceStar = normalizedPattern.endsWith(' *')
|
|
17
|
+
const body = trailingSpaceStar ? normalizedPattern.slice(0, -2) : normalizedPattern
|
|
18
|
+
let expression = '^'
|
|
19
|
+
for (let index = 0; index < body.length; index += 1) {
|
|
20
|
+
const char = body[index]
|
|
21
|
+
if (char === '*') expression += '.*'
|
|
22
|
+
else if (char === '?') expression += '.'
|
|
23
|
+
else expression += escapeRegexCharacter(char)
|
|
24
|
+
}
|
|
25
|
+
if (trailingSpaceStar) expression += '(?: .*)?'
|
|
26
|
+
return new RegExp(`${expression}$`, CASE_INSENSITIVE ? 'is' : 's').test(normalizePattern(input))
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function compileWildcard(pattern) {
|
|
30
|
+
const normalized = normalizePattern(pattern)
|
|
31
|
+
const trailingSpaceStar = normalized.endsWith(' *')
|
|
32
|
+
const body = trailingSpaceStar ? normalized.slice(0, -2) : normalized
|
|
33
|
+
const states = [{ epsilon: [], edges: [] }]
|
|
34
|
+
let current = 0
|
|
35
|
+
const addState = () => {
|
|
36
|
+
states.push({ epsilon: [], edges: [] })
|
|
37
|
+
return states.length - 1
|
|
38
|
+
}
|
|
39
|
+
const edge = (from, to, kind, value) => states[from].edges.push({ to, kind, value })
|
|
40
|
+
|
|
41
|
+
for (let index = 0; index < body.length; index += 1) {
|
|
42
|
+
const char = body[index]
|
|
43
|
+
if (char === '*') {
|
|
44
|
+
const next = addState()
|
|
45
|
+
states[current].epsilon.push(next)
|
|
46
|
+
edge(current, current, 'any')
|
|
47
|
+
current = next
|
|
48
|
+
} else {
|
|
49
|
+
const next = addState()
|
|
50
|
+
edge(current, next, char === '?' ? 'any' : 'literal', char)
|
|
51
|
+
current = next
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (trailingSpaceStar) {
|
|
56
|
+
const next = addState()
|
|
57
|
+
const spaceLoop = addState()
|
|
58
|
+
states[current].epsilon.push(next)
|
|
59
|
+
edge(current, spaceLoop, 'literal', ' ')
|
|
60
|
+
states[spaceLoop].epsilon.push(next)
|
|
61
|
+
edge(spaceLoop, spaceLoop, 'any')
|
|
62
|
+
current = next
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return { states, start: 0, accept: current }
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function literalCharactersOverlap(left, right) {
|
|
69
|
+
if (!CASE_INSENSITIVE) return left === right
|
|
70
|
+
return new RegExp(`^${escapeRegexCharacter(left)}$`, 'i').test(right)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function edgesOverlap(left, right) {
|
|
74
|
+
if (left.kind === 'any' || right.kind === 'any') return true
|
|
75
|
+
return literalCharactersOverlap(left.value, right.value)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Exact non-empty language intersection for OpenCode's `*`/`?` wildcard
|
|
80
|
+
* grammar. Brackets and other regex punctuation are literal; backslashes are
|
|
81
|
+
* normalized to slashes; `*` crosses slashes; and a final ` *` is optional.
|
|
82
|
+
*/
|
|
83
|
+
export function opencodeWildcardPatternsOverlap(leftPattern, rightPattern) {
|
|
84
|
+
const left = compileWildcard(leftPattern)
|
|
85
|
+
const right = compileWildcard(rightPattern)
|
|
86
|
+
const queue = [[left.start, right.start]]
|
|
87
|
+
const visited = new Set()
|
|
88
|
+
|
|
89
|
+
for (let cursor = 0; cursor < queue.length; cursor += 1) {
|
|
90
|
+
const [leftState, rightState] = queue[cursor]
|
|
91
|
+
const key = `${leftState}:${rightState}`
|
|
92
|
+
if (visited.has(key)) continue
|
|
93
|
+
visited.add(key)
|
|
94
|
+
if (leftState === left.accept && rightState === right.accept) return true
|
|
95
|
+
|
|
96
|
+
for (const next of left.states[leftState].epsilon) queue.push([next, rightState])
|
|
97
|
+
for (const next of right.states[rightState].epsilon) queue.push([leftState, next])
|
|
98
|
+
for (const leftEdge of left.states[leftState].edges) {
|
|
99
|
+
for (const rightEdge of right.states[rightState].edges) {
|
|
100
|
+
if (edgesOverlap(leftEdge, rightEdge)) queue.push([leftEdge.to, rightEdge.to])
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return false
|
|
106
|
+
}
|