@openclaw/opencode-provider 2026.9.3 → 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-C73VbD-L.js → .setup/provider-catalog-CfBqTHcl.mjs} +29 -59
- package/dist/index.js +1 -1
- package/dist/provider-catalog.js +1 -1
- package/dist/provider-discovery.js +1 -1
- package/dist/session-catalog-plugin.js +1 -0
- package/openclaw.plugin.json +13 -0
- 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,8 +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
7
|
activation: { "onStartup": true },
|
|
7
8
|
providerCatalogEntry: "./provider-discovery.ts",
|
|
8
9
|
enabledByDefault: true,
|
|
@@ -252,6 +253,12 @@ var openclaw_plugin_default = {
|
|
|
252
253
|
"capabilities": ["image"],
|
|
253
254
|
"defaultModels": { "image": "gpt-5-nano" }
|
|
254
255
|
} },
|
|
256
|
+
configGroups: [{
|
|
257
|
+
"id": "native-sessions",
|
|
258
|
+
"title": "Native sessions",
|
|
259
|
+
"order": 10,
|
|
260
|
+
"properties": ["sessionCatalog"]
|
|
261
|
+
}],
|
|
255
262
|
configSchema: {
|
|
256
263
|
"type": "object",
|
|
257
264
|
"additionalProperties": false,
|
|
@@ -292,37 +299,27 @@ const OPENCODE_ZEN_SEED_CATALOG = new Map(OPENCODE_ZEN_MANIFEST_PROVIDER.models.
|
|
|
292
299
|
..."replacedBy" in row && typeof row.replacedBy === "string" ? { replacedBy: row.replacedBy } : {}
|
|
293
300
|
}];
|
|
294
301
|
}));
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
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
|
+
});
|
|
308
318
|
async function prepareOpencodeZenModel(params) {
|
|
309
|
-
|
|
310
|
-
endpoint: OPENCODE_UPSTREAM_CATALOG_ENDPOINT,
|
|
311
|
-
providerId: PROVIDER_ID,
|
|
312
|
-
fetchGuard: params.fetchGuard,
|
|
313
|
-
signal: params.signal
|
|
314
|
-
});
|
|
315
|
-
if (!catalog) return;
|
|
316
|
-
cacheUpstreamOpencodeZenModels(catalog);
|
|
317
|
-
return resolveOpencodeZenModel(params.modelId);
|
|
319
|
+
return (await opencodeZenCatalog.refreshMetadata(params))?.get(params.modelId.trim().toLowerCase())?.model;
|
|
318
320
|
}
|
|
319
321
|
function buildStaticOpencodeZenProviderConfig(apiKey) {
|
|
320
|
-
return
|
|
321
|
-
api: "openai-completions",
|
|
322
|
-
baseUrl: OPENCODE_ZEN_OPENAI_BASE_URL,
|
|
323
|
-
...apiKey ? { apiKey } : {},
|
|
324
|
-
models: listStaticOpencodeZenModels()
|
|
325
|
-
};
|
|
322
|
+
return opencodeZenCatalog.buildStaticProvider(apiKey);
|
|
326
323
|
}
|
|
327
324
|
async function resolveOpencodeZenStarterModel(params) {
|
|
328
325
|
const liveModelIds = await fetchLiveProviderModelIds({
|
|
@@ -338,40 +335,13 @@ async function resolveOpencodeZenStarterModel(params) {
|
|
|
338
335
|
return liveModelIds.includes(preferredModelId) ? params.preferredModelRef : void 0;
|
|
339
336
|
}
|
|
340
337
|
async function buildOpencodeZenLiveProviderConfig(params = {}) {
|
|
341
|
-
|
|
342
|
-
try {
|
|
343
|
-
const upstream = await getCachedUpstreamProviderCatalog({
|
|
344
|
-
endpoint: OPENCODE_UPSTREAM_CATALOG_ENDPOINT,
|
|
345
|
-
providerId: PROVIDER_ID,
|
|
346
|
-
fetchGuard: params.fetchGuard,
|
|
347
|
-
signal: params.signal
|
|
348
|
-
});
|
|
349
|
-
if (upstream) cacheUpstreamOpencodeZenModels(upstream);
|
|
350
|
-
} catch {}
|
|
351
|
-
return await buildLiveModelProviderConfig({
|
|
352
|
-
discoveryMode: "strict",
|
|
353
|
-
providerId: PROVIDER_ID,
|
|
354
|
-
endpoint: OPENCODE_ZEN_MODELS_ENDPOINT,
|
|
355
|
-
providerConfig: {
|
|
356
|
-
api: "openai-completions",
|
|
357
|
-
baseUrl: OPENCODE_ZEN_OPENAI_BASE_URL
|
|
358
|
-
},
|
|
359
|
-
models: listStaticOpencodeZenModels(),
|
|
360
|
-
apiKey: params.apiKey,
|
|
361
|
-
discoveryApiKey: params.discoveryApiKey,
|
|
362
|
-
fetchGuard: params.fetchGuard,
|
|
363
|
-
signal: params.signal,
|
|
364
|
-
timeoutMs: OPENCODE_ZEN_MODELS_TIMEOUT_MS,
|
|
365
|
-
ttlMs: OPENCODE_ZEN_MODELS_CACHE_TTL_MS,
|
|
366
|
-
auditContext: "opencode-zen-model-discovery",
|
|
367
|
-
projectRows: (rows) => projectProviderCatalogSnapshotRows(rows, opencodeZenCatalog)
|
|
368
|
-
});
|
|
338
|
+
return await opencodeZenCatalog.buildLiveProvider(params);
|
|
369
339
|
}
|
|
370
340
|
function listOpencodeZenModelCatalogEntries() {
|
|
371
|
-
return listProviderCatalogSnapshotEntries(opencodeZenCatalog);
|
|
341
|
+
return listProviderCatalogSnapshotEntries(opencodeZenCatalog.getSnapshot());
|
|
372
342
|
}
|
|
373
343
|
function resolveOpencodeZenModel(modelId) {
|
|
374
|
-
return opencodeZenCatalog.get(modelId.trim().toLowerCase())?.model;
|
|
344
|
+
return opencodeZenCatalog.getSnapshot().get(modelId.trim().toLowerCase())?.model;
|
|
375
345
|
}
|
|
376
346
|
function normalizeBaseUrl(baseUrl) {
|
|
377
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",
|
|
@@ -227,6 +227,7 @@ function registerOpenCodeSessionCatalog(api) {
|
|
|
227
227
|
},
|
|
228
228
|
terminal: {
|
|
229
229
|
executable: "opencode",
|
|
230
|
+
uploadPathStyle: "native",
|
|
230
231
|
args: (threadId) => ["--session", threadId],
|
|
231
232
|
title: (threadId) => `opencode --session ${threadId.slice(0, 12)}…`,
|
|
232
233
|
requireLocalSession: requireLocalOpenCodeSession,
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "opencode",
|
|
3
|
+
"categories": [
|
|
4
|
+
"models"
|
|
5
|
+
],
|
|
3
6
|
"activation": {
|
|
4
7
|
"onStartup": true
|
|
5
8
|
},
|
|
@@ -327,6 +330,16 @@
|
|
|
327
330
|
}
|
|
328
331
|
}
|
|
329
332
|
},
|
|
333
|
+
"configGroups": [
|
|
334
|
+
{
|
|
335
|
+
"id": "native-sessions",
|
|
336
|
+
"title": "Native sessions",
|
|
337
|
+
"order": 10,
|
|
338
|
+
"properties": [
|
|
339
|
+
"sessionCatalog"
|
|
340
|
+
]
|
|
341
|
+
}
|
|
342
|
+
],
|
|
330
343
|
"configSchema": {
|
|
331
344
|
"type": "object",
|
|
332
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": {
|