opencode-see-image 0.5.4 → 0.5.5

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.
Files changed (2) hide show
  1. package/index.ts +11 -1
  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,7 +467,12 @@ 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
  log(`plugin initialized`, "info")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-see-image",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
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",