@z0ne/installer 0.1.1 → 0.1.2
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/lib/tools/opencode.js +22 -10
- package/package.json +1 -1
package/lib/tools/opencode.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// OpenCode — ~/.config/opencode/opencode.json
|
|
3
3
|
// Registers z0ne.ai as an @ai-sdk/openai-compatible provider and sets the
|
|
4
|
-
// active model to z0ne/<id>.
|
|
4
|
+
// active model to z0ne/<id>. The full live catalog is pinned with per-model
|
|
5
|
+
// input modalities so vision keeps working on any model the user picks.
|
|
5
6
|
|
|
6
7
|
const path = require("path");
|
|
7
8
|
const fs = require("fs");
|
|
@@ -36,15 +37,26 @@ module.exports = {
|
|
|
36
37
|
};
|
|
37
38
|
existing.models = existing.models || {};
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
// Pin the whole live catalog, not just the selected model. OpenCode
|
|
41
|
+
// treats auto-discovered openai-compatible models as text-only and
|
|
42
|
+
// silently strips pasted images, so every vision model must carry an
|
|
43
|
+
// explicit image modality here.
|
|
44
|
+
for (const row of Object.values(ctx.rowsById || {})) {
|
|
45
|
+
const hasImage =
|
|
46
|
+
Array.isArray(row.input_modalities) && row.input_modalities.includes("image");
|
|
47
|
+
existing.models[row.id] = {
|
|
48
|
+
...existing.models[row.id],
|
|
49
|
+
name: row.id,
|
|
50
|
+
...(hasImage ? { attachment: true } : {}),
|
|
51
|
+
modalities: { input: hasImage ? ["text", "image"] : ["text"], output: ["text"] },
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
if (!existing.models[ctx.model]) {
|
|
55
|
+
existing.models[ctx.model] = {
|
|
56
|
+
name: ctx.model,
|
|
57
|
+
modalities: { input: ["text"], output: ["text"] },
|
|
58
|
+
};
|
|
59
|
+
}
|
|
48
60
|
|
|
49
61
|
config.provider.z0ne = existing;
|
|
50
62
|
config.model = "z0ne/" + ctx.model;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@z0ne/installer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Point coding agents at z0ne.ai — Claude Code, Codex, OpenCode, Cline, Hermes, OpenClaw. One key, one command. Optionally installs a Claude Code statusline.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://z0ne.ai",
|