@darknesskiller/opencode-cliproxyapi 0.3.0 → 0.3.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/CHANGELOG.md +15 -2
- package/README.md +22 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -17
- package/dist/plugin-v2.d.ts.map +1 -1
- package/dist/shared.d.ts +5 -0
- package/dist/shared.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,19 @@ All notable changes to this project are documented here.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
|
|
6
6
|
and this project follows [Semantic Versioning](https://semver.org/).
|
|
7
7
|
|
|
8
|
-
## [0.3.
|
|
8
|
+
## [0.3.1] - Unreleased
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Image attachments now reach discovered Claude, Gemini, and GPT models.
|
|
13
|
+
OpenCode only forwards image parts to models that declare image input, and
|
|
14
|
+
the plugin previously declared it only for `*-image-*` generation models, so
|
|
15
|
+
other models received a `Cannot read "<file>"` placeholder instead. V1 now
|
|
16
|
+
sets `modalities: { input: ["text", "image"], output: ["text"] }` and V2
|
|
17
|
+
sets the matching `capabilities.input`, both from one shared policy.
|
|
18
|
+
Text-only `gpt-oss-*` models are no longer marked as attachment-capable.
|
|
19
|
+
|
|
20
|
+
## [0.3.0] - 2026-10-05
|
|
9
21
|
|
|
10
22
|
### Added
|
|
11
23
|
|
|
@@ -78,7 +90,8 @@ and this project follows [Semantic Versioning](https://semver.org/).
|
|
|
78
90
|
- Automatic model names and capability hints in OpenCode's model picker.
|
|
79
91
|
- Local plugin and npm package installation flows.
|
|
80
92
|
|
|
81
|
-
[Unreleased]: https://github.com/DarknessKiller/opencode-cliproxyapi/compare/v0.
|
|
93
|
+
[Unreleased]: https://github.com/DarknessKiller/opencode-cliproxyapi/compare/v0.3.0...HEAD
|
|
94
|
+
[0.3.0]: https://github.com/DarknessKiller/opencode-cliproxyapi/compare/v0.2.1...v0.3.0
|
|
82
95
|
[0.2.1]: https://github.com/DarknessKiller/opencode-cliproxyapi/compare/v0.2.0...v0.2.1
|
|
83
96
|
[0.2.0]: https://github.com/DarknessKiller/opencode-cliproxyapi/compare/v0.1.2...v0.2.0
|
|
84
97
|
[0.1.2]: https://github.com/DarknessKiller/opencode-cliproxyapi/compare/v0.1.1...v0.1.2
|
package/README.md
CHANGED
|
@@ -240,6 +240,28 @@ Then restart OpenCode and run:
|
|
|
240
240
|
opencode models cliproxyapi
|
|
241
241
|
```
|
|
242
242
|
|
|
243
|
+
### The model says it cannot read an attached image
|
|
244
|
+
|
|
245
|
+
CLIProxyAPI's `/v1/models` only reports model ids, so image input is inferred
|
|
246
|
+
from the model family: discovered models whose id starts with `claude`,
|
|
247
|
+
`gemini`, or `gpt` (except text-only `gpt-oss-*`) accept images, and
|
|
248
|
+
`*-image-*` models are treated as image generators. New releases in those
|
|
249
|
+
families are covered automatically. On OpenCode v1, declare the modalities of
|
|
250
|
+
a vision model outside these families under the provider's `models` in
|
|
251
|
+
`opencode.json`; user entries override the discovered metadata:
|
|
252
|
+
|
|
253
|
+
```jsonc
|
|
254
|
+
{
|
|
255
|
+
"provider": {
|
|
256
|
+
"cliproxyapi": {
|
|
257
|
+
"models": {
|
|
258
|
+
"your-vision-model": { "attachment": true, "modalities": { "input": ["text", "image"], "output": ["text"] } }
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
243
265
|
### Environment configuration works in one terminal but not another
|
|
244
266
|
|
|
245
267
|
Move the connection to the recommended global OpenCode config, or add the
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,MAAM,EAAgB,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,MAAM,EAAgB,MAAM,qBAAqB,CAAA;AAwBvE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAWtC,eAAO,MAAM,iBAAiB,EAAE,MAiE/B,CAAA;AAED;;;GAGG;;;;;;AACH,wBAIkD;AAClD,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,wBAAwB,EACxB,gBAAgB,EAChB,YAAY,EACZ,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,cAAc,CAAA;AACrB,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -152,7 +152,14 @@ function isReasoningModel(modelID, efforts) {
|
|
|
152
152
|
return /thinking|reasoning|codex|gpt-(?:5|oss)/i.test(modelID);
|
|
153
153
|
}
|
|
154
154
|
function supportsAttachments(modelID) {
|
|
155
|
-
return /^(?:claude|gemini|gpt)/i.test(modelID);
|
|
155
|
+
return /^(?:claude|gemini|gpt)/i.test(modelID) && !/^gpt-oss(?:-|$)/i.test(modelID);
|
|
156
|
+
}
|
|
157
|
+
function modelModalities(modelID) {
|
|
158
|
+
const imageOutput = isImageModel(modelID);
|
|
159
|
+
return {
|
|
160
|
+
input: imageOutput || supportsAttachments(modelID) ? ["text", "image"] : ["text"],
|
|
161
|
+
output: imageOutput ? ["image"] : ["text"]
|
|
162
|
+
};
|
|
156
163
|
}
|
|
157
164
|
function resolveModelNpm(catalog, providerID, modelID) {
|
|
158
165
|
const provider = catalog[providerID];
|
|
@@ -206,6 +213,7 @@ var DEFAULT_CONTEXT_LIMIT = 128000;
|
|
|
206
213
|
var DEFAULT_OUTPUT_LIMIT = 4096;
|
|
207
214
|
function toV2Model(model, input) {
|
|
208
215
|
const image = isImageModel(model.id);
|
|
216
|
+
const modalities = modelModalities(model.id);
|
|
209
217
|
const levels = supportedEffortLevels(model, input.discovery);
|
|
210
218
|
const anthropic = isAnthropicRouted(model, input.discovery.protocolCatalog);
|
|
211
219
|
return {
|
|
@@ -216,8 +224,8 @@ function toV2Model(model, input) {
|
|
|
216
224
|
...anthropic ? { package: V2_ANTHROPIC_PACKAGE } : {},
|
|
217
225
|
capabilities: {
|
|
218
226
|
tools: !image,
|
|
219
|
-
input:
|
|
220
|
-
output:
|
|
227
|
+
input: modalities.input,
|
|
228
|
+
output: modalities.output
|
|
221
229
|
},
|
|
222
230
|
variants: (levels ?? []).map((level) => ({
|
|
223
231
|
id: level,
|
|
@@ -348,12 +356,7 @@ function addProvider(config, input) {
|
|
|
348
356
|
npm: V1_ANTHROPIC_PACKAGE
|
|
349
357
|
}
|
|
350
358
|
} : {},
|
|
351
|
-
...
|
|
352
|
-
modalities: {
|
|
353
|
-
input: ["text", "image"],
|
|
354
|
-
output: ["image"]
|
|
355
|
-
}
|
|
356
|
-
} : {},
|
|
359
|
+
...imageModalities(model.id),
|
|
357
360
|
...reasoningEffortConfig(model, input)
|
|
358
361
|
}
|
|
359
362
|
]));
|
|
@@ -373,6 +376,12 @@ function addProvider(config, input) {
|
|
|
373
376
|
}
|
|
374
377
|
};
|
|
375
378
|
}
|
|
379
|
+
function imageModalities(modelID) {
|
|
380
|
+
const modalities = modelModalities(modelID);
|
|
381
|
+
if (!modalities.input.includes("image") && !modalities.output.includes("image"))
|
|
382
|
+
return {};
|
|
383
|
+
return { modalities };
|
|
384
|
+
}
|
|
376
385
|
function reasoningEffortConfig(model, input) {
|
|
377
386
|
const efforts = input.effortCatalog[model.id];
|
|
378
387
|
if (!efforts)
|
|
@@ -411,13 +420,13 @@ function mergeModels(discovered, existing) {
|
|
|
411
420
|
return merged;
|
|
412
421
|
}
|
|
413
422
|
export {
|
|
414
|
-
|
|
415
|
-
parseModelProtocolCatalog,
|
|
416
|
-
parseCatalog,
|
|
417
|
-
normalizeBaseURL,
|
|
418
|
-
discoverReasoningEfforts,
|
|
419
|
-
discoverModels,
|
|
420
|
-
discoverModelProtocols,
|
|
423
|
+
CLIProxyAPIPlugin,
|
|
421
424
|
src_default as default,
|
|
422
|
-
|
|
425
|
+
discoverModelProtocols,
|
|
426
|
+
discoverModels,
|
|
427
|
+
discoverReasoningEfforts,
|
|
428
|
+
normalizeBaseURL,
|
|
429
|
+
parseCatalog,
|
|
430
|
+
parseModelProtocolCatalog,
|
|
431
|
+
parseReasoningEffortCatalog
|
|
423
432
|
};
|
package/dist/plugin-v2.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-v2.d.ts","sourceRoot":"","sources":["../src/plugin-v2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAS,MAAM,EAAY,MAAM,kBAAkB,CAAA;AAE/D,OAAO,
|
|
1
|
+
{"version":3,"file":"plugin-v2.d.ts","sourceRoot":"","sources":["../src/plugin-v2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAS,MAAM,EAAY,MAAM,kBAAkB,CAAA;AAE/D,OAAO,EAgBL,KAAK,gBAAgB,EAEtB,MAAM,aAAa,CAAA;AAEpB,KAAK,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;AAK7B,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE;QACZ,KAAK,EAAE,OAAO,CAAA;QACd,KAAK,EAAE,MAAM,EAAE,CAAA;QACf,MAAM,EAAE,MAAM,EAAE,CAAA;KACjB,CAAA;IACD,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAA;KACjB,CAAA;IACD,IAAI,EAAE,KAAK,CAAC;QACV,KAAK,EAAE,MAAM,CAAA;QACb,MAAM,EAAE,MAAM,CAAA;QACd,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAA;KACvC,CAAC,CAAA;IACF,MAAM,EAAE,QAAQ,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE;QACL,OAAO,EAAE,MAAM,CAAA;QACf,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;CACF;AAED,wBAAgB,SAAS,CACvB,KAAK,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,EAC1C,KAAK,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,gBAAgB,CAAA;CAAE,GACzD,WAAW,CA6Bb;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,gBAAgB,CAAA;CAC5B,GAAG,WAAW,EAAE,CAIhB;AAED;;;GAGG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,CA8CtE;AAED,eAAO,MAAM,YAAY;;;CAGxB,CAAA"}
|
package/dist/shared.d.ts
CHANGED
|
@@ -35,6 +35,11 @@ export declare function isReasoningModel(modelID: string, efforts?: {
|
|
|
35
35
|
defaultLevel?: string;
|
|
36
36
|
}): boolean;
|
|
37
37
|
export declare function supportsAttachments(modelID: string): boolean;
|
|
38
|
+
export type ModelModalities = {
|
|
39
|
+
input: Array<"text" | "image">;
|
|
40
|
+
output: Array<"text" | "image">;
|
|
41
|
+
};
|
|
42
|
+
export declare function modelModalities(modelID: string): ModelModalities;
|
|
38
43
|
export declare function resolveModelNpm(catalog: ModelProtocolCatalog, providerID: string, modelID: string): string | undefined;
|
|
39
44
|
export declare function isAnthropicRouted(model: CatalogModel, protocolCatalog: ModelProtocolCatalog): boolean;
|
|
40
45
|
export declare function supportedEffortLevels(model: CatalogModel, input: {
|
package/dist/shared.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC5B,MAAM,cAAc,CAAA;AAErB,eAAO,MAAM,gBAAgB,6BAA6B,CAAA;AAC1D,eAAO,MAAM,mBAAmB,gBAAgB,CAAA;AAChD,eAAO,MAAM,qBAAqB,gBAAgB,CAAA;AAClD,eAAO,MAAM,4BAA4B,QAAS,CAAA;AAClD,eAAO,MAAM,0BAA0B,gCAAgC,CAAA;AAGvE,eAAO,MAAM,eAAe,8BAA8B,CAAA;AAC1D,eAAO,MAAM,oBAAoB,mBAAmB,CAAA;AACpD,eAAO,MAAM,oBAAoB,sBAAsB,CAAA;AACvD,eAAO,MAAM,eAAe,6CAA6C,CAAA;AACzE,eAAO,MAAM,oBAAoB,kCAAkC,CAAA;AACnE,eAAO,MAAM,oBAAoB,qCAAqC,CAAA;AAEtE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;IAC/B,gBAAgB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IACjC,kBAAkB,CAA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B,OAAO,EAAE,oBAAoB,EAC7B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAGpB;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,YAAY,EACnB,eAAe,EAAE,oBAAoB,GACpC,OAAO,CAKT;AAMD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE;IAAE,eAAe,EAAE,oBAAoB,CAAC;IAAC,aAAa,EAAE,sBAAsB,CAAA;CAAE,GACtF,MAAM,EAAE,GAAG,SAAS,CAOtB;AAKD,wBAAsB,eAAe,CAAC,KAAK,EAAE;IAC3C,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,MAAM,GAAG,KAAK,CAAA;IAChC,SAAS,EAAE,MAAM,CAAA;CAClB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAe5B"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@darknesskiller/opencode-cliproxyapi",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"description": "Fork of opencode-cliproxyapi that discovers CLIProxyAPI models and auto-configures reasoning-effort variants in OpenCode.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|