@openclaw/opencode-provider 0.0.0 → 2026.8.1-beta.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.
@@ -0,0 +1,25 @@
1
+ import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
2
+ import { describeImageWithModelPayloadTransform, describeImagesWithModelPayloadTransform } from "openclaw/plugin-sdk/media-understanding";
3
+ //#region extensions/opencode/media-understanding-provider.ts
4
+ function stripOpencodeDisabledResponsesReasoningPayload(payload) {
5
+ if (!isRecord(payload)) return;
6
+ const reasoning = payload.reasoning;
7
+ if (reasoning === "none") {
8
+ delete payload.reasoning;
9
+ return;
10
+ }
11
+ if (!isRecord(reasoning) || reasoning.effort !== "none") return;
12
+ delete payload.reasoning;
13
+ }
14
+ const stripDisabledResponsesReasoning = (payload) => {
15
+ stripOpencodeDisabledResponsesReasoningPayload(payload);
16
+ };
17
+ const opencodeMediaUnderstandingProvider = {
18
+ id: "opencode",
19
+ capabilities: ["image"],
20
+ defaultModels: { image: "gpt-5-nano" },
21
+ describeImage: (request) => describeImageWithModelPayloadTransform(request, stripDisabledResponsesReasoning),
22
+ describeImages: (request) => describeImagesWithModelPayloadTransform(request, stripDisabledResponsesReasoning)
23
+ };
24
+ //#endregion
25
+ export { opencodeMediaUnderstandingProvider };
@@ -0,0 +1,20 @@
1
+ import { withAgentModelAliases } from "openclaw/plugin-sdk/provider-onboard";
2
+ //#region extensions/opencode/onboard.ts
3
+ const OPENCODE_ZEN_DEFAULT_MODEL_REF = "opencode/claude-opus-5";
4
+ function applyOpencodeZenProviderConfig(cfg) {
5
+ return {
6
+ ...cfg,
7
+ agents: {
8
+ ...cfg.agents,
9
+ defaults: {
10
+ ...cfg.agents?.defaults,
11
+ models: withAgentModelAliases(cfg.agents?.defaults?.models, [{
12
+ modelRef: OPENCODE_ZEN_DEFAULT_MODEL_REF,
13
+ alias: "Opus"
14
+ }])
15
+ }
16
+ }
17
+ };
18
+ }
19
+ //#endregion
20
+ export { OPENCODE_ZEN_DEFAULT_MODEL_REF, applyOpencodeZenProviderConfig };