pantheon-opencode 1.6.0 → 1.6.2-beta.1
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 +45 -0
- package/README.md +122 -6
- package/README.pt-BR.md +14 -9
- package/bin/pantheon-init.mjs +255 -39
- package/package.json +8 -6
- package/plugin.json +1 -1
- package/pyproject.toml +1 -1
- package/scripts/build-agents-md.mjs +1 -1
- package/scripts/doctor.mjs +231 -46
- package/scripts/install/agents-md.mjs +2 -1
- package/scripts/install/config-migration.mjs +344 -393
- package/scripts/install/config-paths.mjs +15 -0
- package/scripts/install/interactive.mjs +30 -9
- package/scripts/install/interrupt.mjs +78 -0
- package/scripts/install/mcp-permissions.mjs +164 -0
- package/scripts/install/opencode-state.mjs +91 -0
- package/scripts/install/opencode-version.mjs +31 -13
- package/scripts/install/opencode-wildcard.mjs +106 -0
- package/scripts/install/opencode.mjs +508 -108
- package/scripts/install/plan-artifact.mjs +12 -1
- package/scripts/install/plugin.mjs +17 -1
- package/scripts/install/run-record.mjs +115 -0
- package/scripts/install/strings.mjs +35 -6
- package/scripts/install/v2-capabilities.mjs +204 -0
- package/scripts/package-evidence.mjs +1 -0
- package/scripts/release-gates.mjs +7 -2
- 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 +438 -151
- package/scripts/update-skills-lock.mjs +30 -0
- package/skills-lock.json +10 -10
- package/src/agents/aphrodite.md +5 -2
- package/src/agents/apollo.md +5 -0
- package/src/agents/athena.md +6 -1
- package/src/agents/demeter.md +5 -1
- package/src/agents/gaia.md +4 -0
- package/src/agents/hephaestus.md +6 -1
- package/src/agents/hermes.md +6 -3
- package/src/agents/iris.md +5 -1
- package/src/agents/mnemosyne.md +20 -50
- package/src/agents/nyx.md +5 -1
- package/src/agents/prometheus.md +4 -0
- package/src/agents/talos.md +4 -0
- package/src/agents/themis.md +4 -0
- package/src/agents/zeus.md +9 -3
- 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/pantheon_vision.py +37 -36
- package/src/mcp/requirements-mcp.txt +1 -1
- package/src/mcp/requirements-vision.txt +1 -1
- package/src/pantheon/cost-command.ts +127 -40
- package/src/pantheon/delegation-enforce.ts +160 -23
- package/src/pantheon/guard-path.ts +162 -0
- package/src/pantheon/v2-bounded-read.ts +15 -1
- package/src/pantheon/v2-bridge.ts +27 -0
- package/src/pantheon/v2-shell-hooks.ts +260 -0
- package/src/pantheon/v2-unsupported.mjs +32 -4
- package/src/pantheon/v2-vision.ts +34 -29
- package/src/pantheon/vision.ts +49 -11
- package/src/plugin-v2.ts +413 -60
- package/src/plugin.ts +22 -2
- package/src/plugins/tui/dist/quota-adapters.d.ts +89 -0
- package/src/plugins/tui/dist/quota-adapters.d.ts.map +1 -0
- package/src/plugins/tui/dist/quota-adapters.js +1142 -0
- package/src/plugins/tui/dist/quota-adapters.js.map +1 -0
- package/src/plugins/tui/dist/quota-cli.d.ts +17 -0
- package/src/plugins/tui/dist/quota-cli.d.ts.map +1 -0
- package/src/plugins/tui/dist/quota-cli.js +184 -0
- package/src/plugins/tui/dist/quota-cli.js.map +1 -0
- package/src/plugins/tui/dist/quota-rpc-UL2HuFRJ.js +390 -0
- package/src/plugins/tui/dist/quota-rpc-UL2HuFRJ.js.map +1 -0
- package/src/plugins/tui/dist/server-v2.d.ts +14 -0
- package/src/plugins/tui/dist/server-v2.d.ts.map +1 -0
- package/src/plugins/tui/dist/server-v2.js +673 -0
- package/src/plugins/tui/dist/server-v2.js.map +1 -0
- package/src/plugins/tui/dist/tui-v2.d.ts +247 -52
- package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui-v2.js +2492 -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 +11 -11
- package/src/plugins/tui/package.json +6 -4
- package/src/plugins/tui/src/context-gauge.ts +59 -0
- package/src/plugins/tui/src/go-key-diagnostic-ui.ts +100 -0
- package/src/plugins/tui/src/go-key-diagnostic.ts +125 -0
- package/src/plugins/tui/src/index-v2.tsx +199 -240
- package/src/plugins/tui/src/model-usage-limits.ts +4 -0
- package/src/plugins/tui/src/quota-adapters.ts +1598 -0
- package/src/plugins/tui/src/quota-cli.ts +237 -0
- package/src/plugins/tui/src/quota-rpc.ts +209 -0
- package/src/plugins/tui/src/quota-v2-model.ts +1032 -0
- package/src/plugins/tui/src/quota-v2.tsx +986 -0
- package/src/plugins/tui/src/server-v2.ts +841 -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 +8 -1
- 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
package/src/pantheon/vision.ts
CHANGED
|
@@ -2126,6 +2126,16 @@ function syntheticHistoryPart(message: VisionHistoryMessage, text: string): Text
|
|
|
2126
2126
|
}
|
|
2127
2127
|
}
|
|
2128
2128
|
|
|
2129
|
+
/**
|
|
2130
|
+
* Result of a recursive sanitize pass: the (possibly rebuilt) value plus
|
|
2131
|
+
* whether anything at or below it actually changed. Unchanged subtrees keep
|
|
2132
|
+
* the ORIGINAL value by reference so host-owned instances (objects carrying
|
|
2133
|
+
* methods like `.inline()`, class instances, etc.) are never replaced by
|
|
2134
|
+
* plain-object copies — deep-copying them strips prototypes and crashes the
|
|
2135
|
+
* host when it later calls methods on what should still be its own objects.
|
|
2136
|
+
*/
|
|
2137
|
+
type SanitizeResult = { value: unknown; changed: boolean }
|
|
2138
|
+
|
|
2129
2139
|
/**
|
|
2130
2140
|
* Remove image-bearing parts before a provider serializer can turn them into
|
|
2131
2141
|
* image_url content. This hook is deliberately synchronous in spirit: it only
|
|
@@ -2144,33 +2154,61 @@ export function sanitizeVisionHistory(
|
|
|
2144
2154
|
const sessionID = historyMessage.info?.sessionID ?? historyMessage.sessionID ?? ''
|
|
2145
2155
|
if (nativeVisionSessions.has(sessionID)) continue
|
|
2146
2156
|
const descriptions = sessionVisionText.get(sessionID)
|
|
2147
|
-
const sanitize = (value: unknown, inParts: boolean):
|
|
2148
|
-
|
|
2149
|
-
|
|
2157
|
+
const sanitize = (value: unknown, inParts: boolean): SanitizeResult => {
|
|
2158
|
+
// Lazily-copied array: the original array is returned by reference
|
|
2159
|
+
// until the first changed child forces a rebuild.
|
|
2160
|
+
if (Array.isArray(value)) {
|
|
2161
|
+
let items: unknown[] | null = null
|
|
2162
|
+
for (let i = 0; i < value.length; i++) {
|
|
2163
|
+
const result = sanitize(value[i], inParts)
|
|
2164
|
+
if (!result.changed && !items) continue
|
|
2165
|
+
items ??= value.slice(0, i)
|
|
2166
|
+
items.push(result.value)
|
|
2167
|
+
}
|
|
2168
|
+
return items ? { value: items, changed: true } : { value, changed: false }
|
|
2169
|
+
}
|
|
2170
|
+
if (!value || typeof value !== 'object') return { value, changed: false }
|
|
2150
2171
|
|
|
2151
2172
|
const raw = value as { type?: unknown; id?: unknown; mime?: unknown }
|
|
2152
2173
|
const isImageUrl = raw.type === 'image_url'
|
|
2174
|
+
// AI-SDK provider-bound parts use `{ type: 'image', ... }` rather than
|
|
2175
|
+
// the `image_url`/`file` shapes; without this branch such a part reached
|
|
2176
|
+
// the provider untouched, which is the failure this sanitizer exists to
|
|
2177
|
+
// prevent.
|
|
2178
|
+
const isImagePart = raw.type === 'image'
|
|
2153
2179
|
const isImageFile =
|
|
2154
2180
|
raw.type === 'file' &&
|
|
2155
2181
|
typeof raw.mime === 'string' &&
|
|
2156
2182
|
raw.mime.toLowerCase().startsWith('image/')
|
|
2157
|
-
if (isImageUrl || isImageFile) {
|
|
2183
|
+
if (isImageUrl || isImagePart || isImageFile) {
|
|
2158
2184
|
const partID = typeof raw.id === 'string' ? raw.id : ''
|
|
2159
2185
|
const text =
|
|
2160
2186
|
descriptions?.get(partID) ??
|
|
2161
2187
|
'Imagem removida do histórico antes do envio ao provedor textual.'
|
|
2162
|
-
return
|
|
2188
|
+
return {
|
|
2189
|
+
value: inParts ? syntheticHistoryPart(historyMessage, text) : { type: 'text', text },
|
|
2190
|
+
changed: true,
|
|
2191
|
+
}
|
|
2163
2192
|
}
|
|
2164
2193
|
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2194
|
+
// Lazily-copied object: untouched subtrees keep their original value —
|
|
2195
|
+
// including host class instances and objects with methods — so nothing
|
|
2196
|
+
// loses its prototype unless a nested image part must be replaced.
|
|
2197
|
+
const entries = Object.entries(value)
|
|
2198
|
+
let copy: Record<string, unknown> | null = null
|
|
2199
|
+
for (let i = 0; i < entries.length; i++) {
|
|
2200
|
+
const [key, child] = entries[i] as [string, unknown]
|
|
2201
|
+
const result = sanitize(child, key === 'parts')
|
|
2202
|
+
if (!result.changed && !copy) continue
|
|
2203
|
+
copy ??= Object.fromEntries(entries.slice(0, i))
|
|
2204
|
+
copy[key] = result.value
|
|
2168
2205
|
}
|
|
2169
|
-
return copy
|
|
2206
|
+
return copy ? { value: copy, changed: true } : { value, changed: false }
|
|
2170
2207
|
}
|
|
2171
2208
|
|
|
2172
|
-
const sanitized = sanitize(historyMessage, false)
|
|
2173
|
-
|
|
2209
|
+
const sanitized = sanitize(historyMessage, false)
|
|
2210
|
+
if (!sanitized.changed) continue
|
|
2211
|
+
for (const [key, value] of Object.entries(sanitized.value as VisionHistoryMessage)) {
|
|
2174
2212
|
historyMessage[key] = value
|
|
2175
2213
|
}
|
|
2176
2214
|
}
|