opencode-see-image 0.5.4 → 0.5.6
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/index.ts +13 -2
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -119,6 +119,11 @@ function resolveFromFilesystem(
|
|
|
119
119
|
): ResolvedImage | null {
|
|
120
120
|
let absPath: string | null = null
|
|
121
121
|
|
|
122
|
+
// Expand tilde to home directory
|
|
123
|
+
if (name.startsWith("~")) {
|
|
124
|
+
name = path.join(os.homedir(), name.slice(1))
|
|
125
|
+
}
|
|
126
|
+
|
|
122
127
|
if (path.isAbsolute(name) && fs.existsSync(name)) {
|
|
123
128
|
absPath = name
|
|
124
129
|
} else {
|
|
@@ -462,10 +467,16 @@ const SeeImagePlugin: Plugin = async (ctx) => {
|
|
|
462
467
|
const log = (message: string, level: string = "info") => {
|
|
463
468
|
try {
|
|
464
469
|
client?.app?.log?.({ body: { service: PKG_NAME, level, message } })
|
|
465
|
-
} catch {
|
|
470
|
+
} catch {
|
|
471
|
+
// fallback for environments where client.app.log is unavailable
|
|
472
|
+
if (process.env.NODE_ENV !== "production") {
|
|
473
|
+
console.log(`[${PKG_NAME}] ${level}: ${message}`)
|
|
474
|
+
}
|
|
475
|
+
}
|
|
466
476
|
}
|
|
467
477
|
|
|
468
|
-
|
|
478
|
+
const version = currentVersion() || "unknown"
|
|
479
|
+
log(`plugin initialized v${version}`, "info")
|
|
469
480
|
maybeAutoUpdate(client, $, log).catch((e) => {
|
|
470
481
|
log(`auto-update error: ${e?.message ?? e}`, "warn")
|
|
471
482
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-see-image",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
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",
|