pantheon-opencode 1.3.5-beta.57.2e03676 → 1.3.5-beta.60.efa533f
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/package.json
CHANGED
package/src/pantheon/vision.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { fileURLToPath } from 'node:url'
|
|
|
7
7
|
import type { Hooks, PluginInput } from '@opencode-ai/plugin'
|
|
8
8
|
import type { FilePart, Part, TextPart, UserMessage } from '@opencode-ai/sdk'
|
|
9
9
|
import type { ResolvedPreset } from './presets.mjs'
|
|
10
|
-
import { hasVision, resolveActivePreset, visionBrokenOnGateway } from './presets.mjs'
|
|
10
|
+
import { CAPABILITY_TABLE, hasVision, resolveActivePreset, visionBrokenOnGateway } from './presets.mjs'
|
|
11
11
|
|
|
12
12
|
// ─── Constants ────────────────────────────────────────────────────────────
|
|
13
13
|
|
|
@@ -121,9 +121,30 @@ type NativeVisionEndpoint = { modelID: string; baseURL: string }
|
|
|
121
121
|
|
|
122
122
|
export type VisionMode = 'native' | 'tool' | 'auto'
|
|
123
123
|
|
|
124
|
+
/**
|
|
125
|
+
* Check whether a provider is text-only by examining CAPABILITY_TABLE.
|
|
126
|
+
* A provider is text-only if ALL provider-qualified entries (prefix starting
|
|
127
|
+
* with `providerID/`) have `vision: false`. If no provider-qualified entries
|
|
128
|
+
* exist, the provider is unknown → returns false (fail-open).
|
|
129
|
+
*/
|
|
130
|
+
export function providerIsTextOnly(providerID: string): boolean {
|
|
131
|
+
const providerEntries = CAPABILITY_TABLE.filter((entry) =>
|
|
132
|
+
entry.prefix.startsWith(`${providerID}/`),
|
|
133
|
+
)
|
|
134
|
+
if (providerEntries.length === 0) return false
|
|
135
|
+
return providerEntries.every((entry) => !entry.vision)
|
|
136
|
+
}
|
|
137
|
+
|
|
124
138
|
/** Return whether OpenCode's current model is known to accept image input. */
|
|
125
|
-
export function modelAcceptsImages(
|
|
126
|
-
|
|
139
|
+
export function modelAcceptsImages(
|
|
140
|
+
model: ModelInfo | undefined,
|
|
141
|
+
providerID?: string,
|
|
142
|
+
): boolean {
|
|
143
|
+
if (!model) {
|
|
144
|
+
// Fail-closed for known text-only providers
|
|
145
|
+
if (providerID && providerIsTextOnly(providerID)) return false
|
|
146
|
+
return true
|
|
147
|
+
}
|
|
127
148
|
try {
|
|
128
149
|
const id = `${model.providerID}/${model.modelID}`
|
|
129
150
|
// Provider/gateway-aware: a model can be vision-capable per models.dev
|
|
@@ -1230,7 +1251,7 @@ export function createVisionHandler(input: PluginInput) {
|
|
|
1230
1251
|
const message: UserMessage | undefined = output?.message
|
|
1231
1252
|
if (!message || message.role !== 'user') return
|
|
1232
1253
|
const model = hookInput?.model ?? message.model
|
|
1233
|
-
if (modelAcceptsImages(model)) {
|
|
1254
|
+
if (modelAcceptsImages(model, model?.providerID)) {
|
|
1234
1255
|
nativeVisionSessions.add(hookInput.sessionID)
|
|
1235
1256
|
return
|
|
1236
1257
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pantheon-tui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.3.5-beta.
|
|
4
|
+
"version": "1.3.5-beta.60.efa533f",
|
|
5
5
|
"description": "Pantheon TUI plugin — sidebar (version, preset, sessions, real-time delegations) + AI subscription usage gauges incl. OpenCode Go/Zen dollar limits (vendored, MIT)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"exports": {
|