@openclaw/opencode-provider 2026.9.4 → 2026.9.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.
- package/assets/activity.svg +30 -0
- package/assets/icon.png +0 -0
- package/dist/{provider-catalog-Cm1_0m0u.js → .setup/provider-catalog-CfBqTHcl.mjs} +29 -60
- package/dist/index.js +1 -1
- package/dist/provider-catalog.js +1 -1
- package/dist/provider-discovery.js +1 -1
- package/openclaw.plugin.json +11 -2
- package/package.json +7 -5
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
|
|
2
|
+
<!--
|
|
3
|
+
Adapted from OpenClaw ui/public/provider-icons/ProviderIcon-opencode.svg.
|
|
4
|
+
Source: https://github.com/steipete/CodexBar/blob/215efbd39ad58acb4b0cd637c407d63e6183bc8d/Sources/CodexBar/Resources/ProviderIcon-opencode.svg
|
|
5
|
+
|
|
6
|
+
MIT License
|
|
7
|
+
Copyright (c) 2026 Peter Steinberger
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
|
26
|
+
|
|
27
|
+
Names and marks remain the property of their respective owners.
|
|
28
|
+
-->
|
|
29
|
+
<path clip-rule="evenodd" fill="currentColor" fill-rule="evenodd" stroke="none" d="M80 88H20V12H80V88ZM35 27H65V72H35V27Z" />
|
|
30
|
+
</svg>
|
package/assets/icon.png
ADDED
|
Binary file
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createUpstreamProviderCatalog, fetchLiveProviderModelIds, listProviderCatalogSnapshotEntries } from "openclaw/plugin-sdk/provider-catalog-live-runtime";
|
|
2
2
|
import { normalizeModelCompat } from "openclaw/plugin-sdk/provider-model-shared";
|
|
3
3
|
//#region extensions/opencode/openclaw.plugin.json
|
|
4
4
|
var openclaw_plugin_default = {
|
|
5
5
|
id: "opencode",
|
|
6
|
-
categories: ["models"
|
|
6
|
+
categories: ["models"],
|
|
7
7
|
activation: { "onStartup": true },
|
|
8
8
|
providerCatalogEntry: "./provider-discovery.ts",
|
|
9
9
|
enabledByDefault: true,
|
|
@@ -253,6 +253,12 @@ var openclaw_plugin_default = {
|
|
|
253
253
|
"capabilities": ["image"],
|
|
254
254
|
"defaultModels": { "image": "gpt-5-nano" }
|
|
255
255
|
} },
|
|
256
|
+
configGroups: [{
|
|
257
|
+
"id": "native-sessions",
|
|
258
|
+
"title": "Native sessions",
|
|
259
|
+
"order": 10,
|
|
260
|
+
"properties": ["sessionCatalog"]
|
|
261
|
+
}],
|
|
256
262
|
configSchema: {
|
|
257
263
|
"type": "object",
|
|
258
264
|
"additionalProperties": false,
|
|
@@ -293,37 +299,27 @@ const OPENCODE_ZEN_SEED_CATALOG = new Map(OPENCODE_ZEN_MANIFEST_PROVIDER.models.
|
|
|
293
299
|
..."replacedBy" in row && typeof row.replacedBy === "string" ? { replacedBy: row.replacedBy } : {}
|
|
294
300
|
}];
|
|
295
301
|
}));
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
302
|
+
const opencodeZenCatalog = createUpstreamProviderCatalog({
|
|
303
|
+
providerId: PROVIDER_ID,
|
|
304
|
+
seed: OPENCODE_ZEN_SEED_CATALOG,
|
|
305
|
+
upstreamSeed: new Map(Array.from(OPENCODE_ZEN_SEED_CATALOG, ([id, { model }]) => [id, { model }])),
|
|
306
|
+
providerConfig: {
|
|
307
|
+
api: "openai-completions",
|
|
308
|
+
baseUrl: OPENCODE_ZEN_OPENAI_BASE_URL
|
|
309
|
+
},
|
|
310
|
+
metadataEndpoint: OPENCODE_UPSTREAM_CATALOG_ENDPOINT,
|
|
311
|
+
modelsEndpoint: OPENCODE_ZEN_MODELS_ENDPOINT,
|
|
312
|
+
anthropicBaseUrl: OPENCODE_ZEN_ANTHROPIC_BASE_URL,
|
|
313
|
+
timeoutMs: OPENCODE_ZEN_MODELS_TIMEOUT_MS,
|
|
314
|
+
ttlMs: OPENCODE_ZEN_MODELS_CACHE_TTL_MS,
|
|
315
|
+
auditContext: "opencode-zen-model-discovery",
|
|
316
|
+
isStaticEntryActive: (entry) => entry?.status !== "deprecated"
|
|
317
|
+
});
|
|
309
318
|
async function prepareOpencodeZenModel(params) {
|
|
310
|
-
|
|
311
|
-
endpoint: OPENCODE_UPSTREAM_CATALOG_ENDPOINT,
|
|
312
|
-
providerId: PROVIDER_ID,
|
|
313
|
-
fetchGuard: params.fetchGuard,
|
|
314
|
-
signal: params.signal
|
|
315
|
-
});
|
|
316
|
-
if (!catalog) return;
|
|
317
|
-
cacheUpstreamOpencodeZenModels(catalog);
|
|
318
|
-
return resolveOpencodeZenModel(params.modelId);
|
|
319
|
+
return (await opencodeZenCatalog.refreshMetadata(params))?.get(params.modelId.trim().toLowerCase())?.model;
|
|
319
320
|
}
|
|
320
321
|
function buildStaticOpencodeZenProviderConfig(apiKey) {
|
|
321
|
-
return
|
|
322
|
-
api: "openai-completions",
|
|
323
|
-
baseUrl: OPENCODE_ZEN_OPENAI_BASE_URL,
|
|
324
|
-
...apiKey ? { apiKey } : {},
|
|
325
|
-
models: listStaticOpencodeZenModels()
|
|
326
|
-
};
|
|
322
|
+
return opencodeZenCatalog.buildStaticProvider(apiKey);
|
|
327
323
|
}
|
|
328
324
|
async function resolveOpencodeZenStarterModel(params) {
|
|
329
325
|
const liveModelIds = await fetchLiveProviderModelIds({
|
|
@@ -339,40 +335,13 @@ async function resolveOpencodeZenStarterModel(params) {
|
|
|
339
335
|
return liveModelIds.includes(preferredModelId) ? params.preferredModelRef : void 0;
|
|
340
336
|
}
|
|
341
337
|
async function buildOpencodeZenLiveProviderConfig(params = {}) {
|
|
342
|
-
|
|
343
|
-
try {
|
|
344
|
-
const upstream = await getCachedUpstreamProviderCatalog({
|
|
345
|
-
endpoint: OPENCODE_UPSTREAM_CATALOG_ENDPOINT,
|
|
346
|
-
providerId: PROVIDER_ID,
|
|
347
|
-
fetchGuard: params.fetchGuard,
|
|
348
|
-
signal: params.signal
|
|
349
|
-
});
|
|
350
|
-
if (upstream) cacheUpstreamOpencodeZenModels(upstream);
|
|
351
|
-
} catch {}
|
|
352
|
-
return await buildLiveModelProviderConfig({
|
|
353
|
-
discoveryMode: "strict",
|
|
354
|
-
providerId: PROVIDER_ID,
|
|
355
|
-
endpoint: OPENCODE_ZEN_MODELS_ENDPOINT,
|
|
356
|
-
providerConfig: {
|
|
357
|
-
api: "openai-completions",
|
|
358
|
-
baseUrl: OPENCODE_ZEN_OPENAI_BASE_URL
|
|
359
|
-
},
|
|
360
|
-
models: listStaticOpencodeZenModels(),
|
|
361
|
-
apiKey: params.apiKey,
|
|
362
|
-
discoveryApiKey: params.discoveryApiKey,
|
|
363
|
-
fetchGuard: params.fetchGuard,
|
|
364
|
-
signal: params.signal,
|
|
365
|
-
timeoutMs: OPENCODE_ZEN_MODELS_TIMEOUT_MS,
|
|
366
|
-
ttlMs: OPENCODE_ZEN_MODELS_CACHE_TTL_MS,
|
|
367
|
-
auditContext: "opencode-zen-model-discovery",
|
|
368
|
-
projectRows: (rows) => projectProviderCatalogSnapshotRows(rows, opencodeZenCatalog)
|
|
369
|
-
});
|
|
338
|
+
return await opencodeZenCatalog.buildLiveProvider(params);
|
|
370
339
|
}
|
|
371
340
|
function listOpencodeZenModelCatalogEntries() {
|
|
372
|
-
return listProviderCatalogSnapshotEntries(opencodeZenCatalog);
|
|
341
|
+
return listProviderCatalogSnapshotEntries(opencodeZenCatalog.getSnapshot());
|
|
373
342
|
}
|
|
374
343
|
function resolveOpencodeZenModel(modelId) {
|
|
375
|
-
return opencodeZenCatalog.get(modelId.trim().toLowerCase())?.model;
|
|
344
|
+
return opencodeZenCatalog.getSnapshot().get(modelId.trim().toLowerCase())?.model;
|
|
376
345
|
}
|
|
377
346
|
function normalizeBaseUrl(baseUrl) {
|
|
378
347
|
return (baseUrl ?? "").trim().replace(/\/+$/, "");
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { opencodeMediaUnderstandingProvider } from "./media-understanding-provider.js";
|
|
2
2
|
import { OPENCODE_ZEN_DEFAULT_MODEL_REF, applyOpencodeZenProviderConfig } from "./onboard.js";
|
|
3
|
-
import { a as prepareOpencodeZenModel, c as openclaw_plugin_default, i as normalizeOpencodeZenBaseUrl, n as buildStaticOpencodeZenProviderConfig, o as resolveOpencodeZenModel, r as listOpencodeZenModelCatalogEntries, s as resolveOpencodeZenStarterModel, t as buildOpencodeZenLiveProviderConfig } from "
|
|
3
|
+
import { a as prepareOpencodeZenModel, c as openclaw_plugin_default, i as normalizeOpencodeZenBaseUrl, n as buildStaticOpencodeZenProviderConfig, o as resolveOpencodeZenModel, r as listOpencodeZenModelCatalogEntries, s as resolveOpencodeZenStarterModel, t as buildOpencodeZenLiveProviderConfig } from "./.setup/provider-catalog-CfBqTHcl.mjs";
|
|
4
4
|
import { resolveThinkingProfile } from "./provider-policy-api.js";
|
|
5
5
|
import { registerOpenCodeSessionCatalog } from "./session-catalog-plugin.js";
|
|
6
6
|
import { wrapOpencodeProviderStream } from "./stream.js";
|
package/dist/provider-catalog.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as prepareOpencodeZenModel, i as normalizeOpencodeZenBaseUrl, n as buildStaticOpencodeZenProviderConfig, o as resolveOpencodeZenModel, r as listOpencodeZenModelCatalogEntries, s as resolveOpencodeZenStarterModel, t as buildOpencodeZenLiveProviderConfig } from "
|
|
1
|
+
import { a as prepareOpencodeZenModel, i as normalizeOpencodeZenBaseUrl, n as buildStaticOpencodeZenProviderConfig, o as resolveOpencodeZenModel, r as listOpencodeZenModelCatalogEntries, s as resolveOpencodeZenStarterModel, t as buildOpencodeZenLiveProviderConfig } from "./.setup/provider-catalog-CfBqTHcl.mjs";
|
|
2
2
|
export { buildOpencodeZenLiveProviderConfig, buildStaticOpencodeZenProviderConfig, listOpencodeZenModelCatalogEntries, normalizeOpencodeZenBaseUrl, prepareOpencodeZenModel, resolveOpencodeZenModel, resolveOpencodeZenStarterModel };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as buildStaticOpencodeZenProviderConfig } from "
|
|
1
|
+
import { n as buildStaticOpencodeZenProviderConfig } from "./.setup/provider-catalog-CfBqTHcl.mjs";
|
|
2
2
|
//#region extensions/opencode/provider-discovery.ts
|
|
3
3
|
const opencodeProviderDiscovery = {
|
|
4
4
|
id: "opencode",
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "opencode",
|
|
3
3
|
"categories": [
|
|
4
|
-
"models"
|
|
5
|
-
"media"
|
|
4
|
+
"models"
|
|
6
5
|
],
|
|
7
6
|
"activation": {
|
|
8
7
|
"onStartup": true
|
|
@@ -331,6 +330,16 @@
|
|
|
331
330
|
}
|
|
332
331
|
}
|
|
333
332
|
},
|
|
333
|
+
"configGroups": [
|
|
334
|
+
{
|
|
335
|
+
"id": "native-sessions",
|
|
336
|
+
"title": "Native sessions",
|
|
337
|
+
"order": 10,
|
|
338
|
+
"properties": [
|
|
339
|
+
"sessionCatalog"
|
|
340
|
+
]
|
|
341
|
+
}
|
|
342
|
+
],
|
|
334
343
|
"configSchema": {
|
|
335
344
|
"type": "object",
|
|
336
345
|
"additionalProperties": false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/opencode-provider",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.5",
|
|
4
4
|
"description": "OpenClaw OpenCode Zen provider plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"minHostVersion": ">=2026.7.2"
|
|
19
19
|
},
|
|
20
20
|
"compat": {
|
|
21
|
-
"pluginApi": ">=2026.9.
|
|
21
|
+
"pluginApi": ">=2026.9.5"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.9.
|
|
24
|
+
"openclawVersion": "2026.9.5",
|
|
25
25
|
"bundledDist": false
|
|
26
26
|
},
|
|
27
27
|
"release": {
|
|
@@ -35,10 +35,12 @@
|
|
|
35
35
|
"files": [
|
|
36
36
|
"dist/**",
|
|
37
37
|
"openclaw.plugin.json",
|
|
38
|
-
"README.md"
|
|
38
|
+
"README.md",
|
|
39
|
+
"assets/icon.png",
|
|
40
|
+
"assets/activity.svg"
|
|
39
41
|
],
|
|
40
42
|
"peerDependencies": {
|
|
41
|
-
"openclaw": ">=2026.9.
|
|
43
|
+
"openclaw": ">=2026.9.5"
|
|
42
44
|
},
|
|
43
45
|
"peerDependenciesMeta": {
|
|
44
46
|
"openclaw": {
|