opencode-see-image 0.4.0 → 0.4.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/README.md +4 -4
- package/index.ts +16 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -137,17 +137,17 @@ export SEE_IMAGE_MODEL="kimi-k2.7-code"
|
|
|
137
137
|
|
|
138
138
|
## Updating
|
|
139
139
|
|
|
140
|
-
**Auto-update (built in):** the plugin checks npm for a newer version on every opencode startup. If one exists, it
|
|
140
|
+
**Auto-update (built in):** the plugin checks npm for a newer version on every opencode startup. If one exists, it updates itself via `opencode plugin --force` (uses opencode's bundled bun, no global bun needed) and shows a toast: *"opencode-see-image updated to X.Y.Z, restart opencode to apply"*. You just need to restart opencode to load the new version. Nothing to configure.
|
|
141
141
|
|
|
142
142
|
**Manual update** (if you want to force it now):
|
|
143
143
|
```bash
|
|
144
|
-
|
|
144
|
+
opencode plugin opencode-see-image --force --global
|
|
145
145
|
```
|
|
146
|
-
Then restart opencode.
|
|
146
|
+
Then restart opencode. (No bun required, this uses opencode's own bun.)
|
|
147
147
|
|
|
148
148
|
**Pin a version** in your config to opt out of auto-updates:
|
|
149
149
|
```jsonc
|
|
150
|
-
"plugin": ["opencode-see-image@0.
|
|
150
|
+
"plugin": ["opencode-see-image@0.4.1"]
|
|
151
151
|
```
|
|
152
152
|
|
|
153
153
|
## File search locations
|
package/index.ts
CHANGED
|
@@ -271,14 +271,24 @@ async function maybeAutoUpdate(
|
|
|
271
271
|
|
|
272
272
|
if (!semverGt(latest, current)) return
|
|
273
273
|
|
|
274
|
-
log(`update available: ${current} -> ${latest};
|
|
275
|
-
|
|
276
|
-
|
|
274
|
+
log(`update available: ${current} -> ${latest}; updating`, "info")
|
|
275
|
+
|
|
276
|
+
// Use opencode's own plugin command to re-resolve from npm. This uses
|
|
277
|
+
// opencode's bundled bun, so it works even when bun isn't installed
|
|
278
|
+
// globally on the user's PATH.
|
|
279
|
+
const opencodeBin =
|
|
280
|
+
process.env.OPENCODE_BIN ||
|
|
281
|
+
path.join(os.homedir(), ".opencode/bin/opencode")
|
|
277
282
|
try {
|
|
278
|
-
await
|
|
283
|
+
await $`${opencodeBin} plugin ${PKG_NAME} --force --global`.quiet()
|
|
279
284
|
} catch (e: any) {
|
|
280
|
-
|
|
281
|
-
|
|
285
|
+
// Fallback: try bare `opencode` on PATH
|
|
286
|
+
try {
|
|
287
|
+
await $`opencode plugin ${PKG_NAME} --force --global`.quiet()
|
|
288
|
+
} catch (e2: any) {
|
|
289
|
+
log(`plugin update failed: ${e2?.message ?? e2}`, "warn")
|
|
290
|
+
return
|
|
291
|
+
}
|
|
282
292
|
}
|
|
283
293
|
|
|
284
294
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-see-image",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Give non-vision opencode models the ability to see images/screenshots by routing them to a vision-capable model (MiniMax M3 via opencode-go by default).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|