@openclaw/cohere-provider 2026.11.3 → 2026.11.5-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 @@
1
+ {"version":3,"entries":[{"output":"index.js","source":"extensions/cohere/index.ts"}],"chunks":[{"output":"index.js","sha256":"b49dbd3ebc43f7536f20ea80ee8aa40238fd8b283979ff8b8998630b2ce5b7fc","facadeSource":"extensions/cohere/index.ts","sources":["extensions/cohere/index.ts","extensions/cohere/openclaw.plugin.json"]}],"unrenderedSources":[]}
package/dist/index.js CHANGED
@@ -1,9 +1,234 @@
1
- import { i as openclaw_plugin_default, r as isModernCohereModelId } from "./.setup/models-BtjAnVPh.mjs";
2
- import { applyCohereConfig } from "./onboard.js";
3
- import { COHERE_LIVE_MODEL_DISCOVERY } from "./provider-catalog.js";
4
- import { wrapCohereProviderStream } from "./stream.js";
1
+ import { buildManifestModelProviderConfig, readManifestProviderDefaultModelRef } from "openclaw/plugin-sdk/provider-catalog-shared";
5
2
  import { defineSingleProviderPluginEntry } from "openclaw/plugin-sdk/provider-entry";
3
+ import { createProviderConnectionPresetAppliers } from "openclaw/plugin-sdk/provider-onboard";
4
+ import { createPayloadPatchStreamWrapper } from "openclaw/plugin-sdk/provider-stream-shared";
5
+ import { asOptionalObjectRecord, asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
6
+ //#region extensions/cohere/openclaw.plugin.json
7
+ var openclaw_plugin_default = {
8
+ id: "cohere",
9
+ categories: ["models"],
10
+ name: "Cohere",
11
+ description: "OpenClaw Cohere provider plugin.",
12
+ activation: { "onStartup": false },
13
+ enabledByDefault: true,
14
+ providers: ["cohere"],
15
+ modelCatalog: {
16
+ "modelsDev": { "cohere": "cohere" },
17
+ "providers": { "cohere": {
18
+ "baseUrl": "https://api.cohere.ai/compatibility/v1",
19
+ "api": "openai-completions",
20
+ "defaultModel": "command-a-plus-05-2026",
21
+ "family": "cohere",
22
+ "models": [
23
+ {
24
+ "id": "command-a-plus-05-2026",
25
+ "name": "Command A+",
26
+ "reasoning": true,
27
+ "input": ["text", "image"],
28
+ "contextWindow": 128e3,
29
+ "maxTokens": 64e3,
30
+ "cost": {
31
+ "input": 0,
32
+ "output": 0,
33
+ "cacheRead": 0,
34
+ "cacheWrite": 0
35
+ },
36
+ "compat": {
37
+ "supportsStore": false,
38
+ "supportsUsageInStreaming": false,
39
+ "supportsReasoningEffort": true,
40
+ "supportedReasoningEfforts": ["none", "high"],
41
+ "reasoningEffortMap": {
42
+ "off": "none",
43
+ "none": "none",
44
+ "minimal": "high",
45
+ "low": "high",
46
+ "medium": "high",
47
+ "high": "high",
48
+ "xhigh": "high",
49
+ "adaptive": "high",
50
+ "max": "high"
51
+ },
52
+ "maxTokensField": "max_tokens"
53
+ }
54
+ },
55
+ {
56
+ "id": "command-a-03-2025",
57
+ "name": "Command A",
58
+ "status": "deprecated",
59
+ "replacedBy": "command-a-plus-05-2026",
60
+ "input": ["text"],
61
+ "contextWindow": 256e3,
62
+ "maxTokens": 8e3,
63
+ "cost": {
64
+ "input": 2.5,
65
+ "output": 10,
66
+ "cacheRead": 0,
67
+ "cacheWrite": 0
68
+ },
69
+ "compat": {
70
+ "supportsStore": false,
71
+ "supportsUsageInStreaming": false,
72
+ "maxTokensField": "max_tokens"
73
+ }
74
+ },
75
+ {
76
+ "id": "command-a-reasoning-08-2025",
77
+ "name": "Command A Reasoning",
78
+ "status": "deprecated",
79
+ "replacedBy": "command-a-plus-05-2026",
80
+ "reasoning": true,
81
+ "input": ["text"],
82
+ "contextWindow": 256e3,
83
+ "maxTokens": 32e3,
84
+ "cost": {
85
+ "input": 0,
86
+ "output": 0,
87
+ "cacheRead": 0,
88
+ "cacheWrite": 0
89
+ },
90
+ "compat": {
91
+ "supportsStore": false,
92
+ "supportsUsageInStreaming": false,
93
+ "supportsReasoningEffort": true,
94
+ "supportedReasoningEfforts": ["none", "high"],
95
+ "reasoningEffortMap": {
96
+ "off": "none",
97
+ "none": "none",
98
+ "minimal": "high",
99
+ "low": "high",
100
+ "medium": "high",
101
+ "high": "high",
102
+ "xhigh": "high",
103
+ "adaptive": "high",
104
+ "max": "high"
105
+ },
106
+ "maxTokensField": "max_tokens"
107
+ }
108
+ },
109
+ {
110
+ "id": "command-a-vision-07-2025",
111
+ "name": "Command A Vision",
112
+ "status": "deprecated",
113
+ "replacedBy": "command-a-plus-05-2026",
114
+ "reasoning": false,
115
+ "input": ["text", "image"],
116
+ "contextWindow": 128e3,
117
+ "maxTokens": 8e3,
118
+ "cost": {
119
+ "input": 0,
120
+ "output": 0,
121
+ "cacheRead": 0,
122
+ "cacheWrite": 0
123
+ },
124
+ "compat": {
125
+ "supportsStore": false,
126
+ "supportsUsageInStreaming": false,
127
+ "supportsTools": false,
128
+ "maxTokensField": "max_tokens"
129
+ }
130
+ },
131
+ {
132
+ "id": "north-mini-code-1-0",
133
+ "name": "North Mini Code 1.0",
134
+ "reasoning": true,
135
+ "input": ["text"],
136
+ "contextWindow": 256e3,
137
+ "maxTokens": 64e3,
138
+ "cost": {
139
+ "input": 0,
140
+ "output": 0,
141
+ "cacheRead": 0,
142
+ "cacheWrite": 0
143
+ },
144
+ "compat": {
145
+ "supportsStore": false,
146
+ "supportsUsageInStreaming": false,
147
+ "supportsReasoningEffort": true,
148
+ "supportedReasoningEfforts": ["none", "high"],
149
+ "reasoningEffortMap": {
150
+ "off": "none",
151
+ "none": "none",
152
+ "minimal": "high",
153
+ "low": "high",
154
+ "medium": "high",
155
+ "high": "high",
156
+ "xhigh": "high",
157
+ "adaptive": "high",
158
+ "max": "high"
159
+ },
160
+ "maxTokensField": "max_tokens"
161
+ }
162
+ }
163
+ ]
164
+ } },
165
+ "discovery": { "cohere": "refreshable" }
166
+ },
167
+ setup: { "providers": [{
168
+ "id": "cohere",
169
+ "envVars": ["COHERE_API_KEY"]
170
+ }] },
171
+ providerAuthChoices: [{
172
+ "provider": "cohere",
173
+ "method": "api-key",
174
+ "choiceId": "cohere-api-key",
175
+ "appGuidedSecret": true,
176
+ "choiceLabel": "Cohere API key",
177
+ "groupId": "cohere",
178
+ "groupLabel": "Cohere",
179
+ "groupHint": "OpenAI-compatible inference",
180
+ "optionKey": "cohereApiKey",
181
+ "cliFlag": "--cohere-api-key",
182
+ "cliOption": "--cohere-api-key <key>",
183
+ "cliDescription": "Cohere API key"
184
+ }],
185
+ configSchema: {
186
+ "type": "object",
187
+ "additionalProperties": false,
188
+ "properties": {}
189
+ }
190
+ };
191
+ //#endregion
6
192
  //#region extensions/cohere/index.ts
193
+ const COHERE_MANIFEST_CATALOG = openclaw_plugin_default.modelCatalog.providers.cohere;
194
+ const COHERE_BASE_URL = COHERE_MANIFEST_CATALOG.baseUrl;
195
+ const COHERE_MODERN_MODEL_IDS = /* @__PURE__ */ new Set([
196
+ "command-a-plus-05-2026",
197
+ "command-a-reasoning-08-2025",
198
+ "north-mini-code-1-0"
199
+ ]);
200
+ function buildCohereCatalogModels() {
201
+ return buildManifestModelProviderConfig({
202
+ providerId: "cohere",
203
+ catalog: COHERE_MANIFEST_CATALOG
204
+ }).models;
205
+ }
206
+ const COHERE_DEFAULT_MODEL_REF = readManifestProviderDefaultModelRef(openclaw_plugin_default, "cohere");
207
+ const { applyConfig } = createProviderConnectionPresetAppliers({
208
+ primaryModelRef: COHERE_DEFAULT_MODEL_REF,
209
+ resolveParams: () => ({
210
+ providerId: "cohere",
211
+ api: "openai-completions",
212
+ baseUrl: COHERE_BASE_URL,
213
+ catalogModels: buildCohereCatalogModels,
214
+ aliases: [{
215
+ modelRef: COHERE_DEFAULT_MODEL_REF,
216
+ alias: "Cohere Command A+"
217
+ }]
218
+ })
219
+ });
220
+ function wrapCohereProviderStream(ctx) {
221
+ return createPayloadPatchStreamWrapper(ctx.streamFn, ({ payload }) => {
222
+ if (Array.isArray(payload.messages)) payload.messages = payload.messages.map((message) => {
223
+ const record = asOptionalObjectRecord(message);
224
+ return record?.role === "system" ? {
225
+ ...record,
226
+ role: "developer"
227
+ } : message;
228
+ });
229
+ delete payload.tool_choice;
230
+ });
231
+ }
7
232
  var cohere_default = defineSingleProviderPluginEntry({
8
233
  id: "cohere",
9
234
  name: "Cohere Provider",
@@ -12,14 +237,32 @@ var cohere_default = defineSingleProviderPluginEntry({
12
237
  provider: {
13
238
  label: "Cohere",
14
239
  docsPath: "/providers/cohere",
15
- manifestAuth: { applyConfig: applyCohereConfig },
240
+ manifestAuth: { applyConfig },
16
241
  catalog: {
17
242
  discoveryMode: "strict",
18
- liveModelDiscovery: COHERE_LIVE_MODEL_DISCOVERY
243
+ liveModelDiscovery: {
244
+ endpointUrl: {
245
+ url: "https://api.cohere.com/v1/models?endpoint=chat&page_size=1000",
246
+ requireBaseUrl: COHERE_BASE_URL
247
+ },
248
+ readRows: (body) => {
249
+ const models = asOptionalObjectRecord(body)?.models;
250
+ if (!Array.isArray(models)) throw new Error("Cohere model catalog response must contain models[]");
251
+ return models.flatMap((row) => {
252
+ const record = asOptionalRecord(row);
253
+ const modelId = normalizeOptionalString(record?.name);
254
+ return modelId ? [{
255
+ ...record,
256
+ id: modelId,
257
+ active: record?.is_deprecated !== true
258
+ }] : [];
259
+ });
260
+ }
261
+ }
19
262
  },
20
263
  wrapStreamFn: wrapCohereProviderStream,
21
264
  wrapSimpleCompletionStreamFn: wrapCohereProviderStream,
22
- isModernModelRef: ({ modelId }) => isModernCohereModelId(modelId)
265
+ isModernModelRef: ({ modelId }) => COHERE_MODERN_MODEL_IDS.has(modelId.trim().toLowerCase())
23
266
  }
24
267
  });
25
268
  //#endregion
@@ -17,6 +17,7 @@
17
17
  "baseUrl": "https://api.cohere.ai/compatibility/v1",
18
18
  "api": "openai-completions",
19
19
  "defaultModel": "command-a-plus-05-2026",
20
+ "family": "cohere",
20
21
  "models": [
21
22
  {
22
23
  "id": "command-a-plus-05-2026",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/cohere-provider",
3
- "version": "2026.11.3",
3
+ "version": "2026.11.5-beta.2",
4
4
  "description": "OpenClaw Cohere provider plugin.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,10 +18,10 @@
18
18
  "minHostVersion": ">=2026.6.8"
19
19
  },
20
20
  "compat": {
21
- "pluginApi": ">=2026.11.3"
21
+ "pluginApi": ">=2026.11.5-beta.2"
22
22
  },
23
23
  "build": {
24
- "openclawVersion": "2026.11.3",
24
+ "openclawVersion": "2026.11.5-beta.2",
25
25
  "bundledDist": false
26
26
  },
27
27
  "release": {
@@ -40,7 +40,7 @@
40
40
  "assets/activity.svg"
41
41
  ],
42
42
  "peerDependencies": {
43
- "openclaw": ">=2026.11.3"
43
+ "openclaw": ">=2026.11.5-beta.2"
44
44
  },
45
45
  "peerDependenciesMeta": {
46
46
  "openclaw": {
@@ -1,205 +0,0 @@
1
- import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
2
- //#region extensions/cohere/openclaw.plugin.json
3
- var openclaw_plugin_default = {
4
- id: "cohere",
5
- categories: ["models"],
6
- name: "Cohere",
7
- description: "OpenClaw Cohere provider plugin.",
8
- activation: { "onStartup": false },
9
- enabledByDefault: true,
10
- providers: ["cohere"],
11
- modelCatalog: {
12
- "modelsDev": { "cohere": "cohere" },
13
- "providers": { "cohere": {
14
- "baseUrl": "https://api.cohere.ai/compatibility/v1",
15
- "api": "openai-completions",
16
- "defaultModel": "command-a-plus-05-2026",
17
- "models": [
18
- {
19
- "id": "command-a-plus-05-2026",
20
- "name": "Command A+",
21
- "reasoning": true,
22
- "input": ["text", "image"],
23
- "contextWindow": 128e3,
24
- "maxTokens": 64e3,
25
- "cost": {
26
- "input": 0,
27
- "output": 0,
28
- "cacheRead": 0,
29
- "cacheWrite": 0
30
- },
31
- "compat": {
32
- "supportsStore": false,
33
- "supportsUsageInStreaming": false,
34
- "supportsReasoningEffort": true,
35
- "supportedReasoningEfforts": ["none", "high"],
36
- "reasoningEffortMap": {
37
- "off": "none",
38
- "none": "none",
39
- "minimal": "high",
40
- "low": "high",
41
- "medium": "high",
42
- "high": "high",
43
- "xhigh": "high",
44
- "adaptive": "high",
45
- "max": "high"
46
- },
47
- "maxTokensField": "max_tokens"
48
- }
49
- },
50
- {
51
- "id": "command-a-03-2025",
52
- "name": "Command A",
53
- "status": "deprecated",
54
- "replacedBy": "command-a-plus-05-2026",
55
- "input": ["text"],
56
- "contextWindow": 256e3,
57
- "maxTokens": 8e3,
58
- "cost": {
59
- "input": 2.5,
60
- "output": 10,
61
- "cacheRead": 0,
62
- "cacheWrite": 0
63
- },
64
- "compat": {
65
- "supportsStore": false,
66
- "supportsUsageInStreaming": false,
67
- "maxTokensField": "max_tokens"
68
- }
69
- },
70
- {
71
- "id": "command-a-reasoning-08-2025",
72
- "name": "Command A Reasoning",
73
- "status": "deprecated",
74
- "replacedBy": "command-a-plus-05-2026",
75
- "reasoning": true,
76
- "input": ["text"],
77
- "contextWindow": 256e3,
78
- "maxTokens": 32e3,
79
- "cost": {
80
- "input": 0,
81
- "output": 0,
82
- "cacheRead": 0,
83
- "cacheWrite": 0
84
- },
85
- "compat": {
86
- "supportsStore": false,
87
- "supportsUsageInStreaming": false,
88
- "supportsReasoningEffort": true,
89
- "supportedReasoningEfforts": ["none", "high"],
90
- "reasoningEffortMap": {
91
- "off": "none",
92
- "none": "none",
93
- "minimal": "high",
94
- "low": "high",
95
- "medium": "high",
96
- "high": "high",
97
- "xhigh": "high",
98
- "adaptive": "high",
99
- "max": "high"
100
- },
101
- "maxTokensField": "max_tokens"
102
- }
103
- },
104
- {
105
- "id": "command-a-vision-07-2025",
106
- "name": "Command A Vision",
107
- "status": "deprecated",
108
- "replacedBy": "command-a-plus-05-2026",
109
- "reasoning": false,
110
- "input": ["text", "image"],
111
- "contextWindow": 128e3,
112
- "maxTokens": 8e3,
113
- "cost": {
114
- "input": 0,
115
- "output": 0,
116
- "cacheRead": 0,
117
- "cacheWrite": 0
118
- },
119
- "compat": {
120
- "supportsStore": false,
121
- "supportsUsageInStreaming": false,
122
- "supportsTools": false,
123
- "maxTokensField": "max_tokens"
124
- }
125
- },
126
- {
127
- "id": "north-mini-code-1-0",
128
- "name": "North Mini Code 1.0",
129
- "reasoning": true,
130
- "input": ["text"],
131
- "contextWindow": 256e3,
132
- "maxTokens": 64e3,
133
- "cost": {
134
- "input": 0,
135
- "output": 0,
136
- "cacheRead": 0,
137
- "cacheWrite": 0
138
- },
139
- "compat": {
140
- "supportsStore": false,
141
- "supportsUsageInStreaming": false,
142
- "supportsReasoningEffort": true,
143
- "supportedReasoningEfforts": ["none", "high"],
144
- "reasoningEffortMap": {
145
- "off": "none",
146
- "none": "none",
147
- "minimal": "high",
148
- "low": "high",
149
- "medium": "high",
150
- "high": "high",
151
- "xhigh": "high",
152
- "adaptive": "high",
153
- "max": "high"
154
- },
155
- "maxTokensField": "max_tokens"
156
- }
157
- }
158
- ]
159
- } },
160
- "discovery": { "cohere": "refreshable" }
161
- },
162
- setup: { "providers": [{
163
- "id": "cohere",
164
- "envVars": ["COHERE_API_KEY"]
165
- }] },
166
- providerAuthChoices: [{
167
- "provider": "cohere",
168
- "method": "api-key",
169
- "choiceId": "cohere-api-key",
170
- "appGuidedSecret": true,
171
- "choiceLabel": "Cohere API key",
172
- "groupId": "cohere",
173
- "groupLabel": "Cohere",
174
- "groupHint": "OpenAI-compatible inference",
175
- "optionKey": "cohereApiKey",
176
- "cliFlag": "--cohere-api-key",
177
- "cliOption": "--cohere-api-key <key>",
178
- "cliDescription": "Cohere API key"
179
- }],
180
- configSchema: {
181
- "type": "object",
182
- "additionalProperties": false,
183
- "properties": {}
184
- }
185
- };
186
- //#endregion
187
- //#region extensions/cohere/models.ts
188
- const COHERE_MANIFEST_CATALOG = openclaw_plugin_default.modelCatalog.providers.cohere;
189
- const COHERE_BASE_URL = COHERE_MANIFEST_CATALOG.baseUrl;
190
- const COHERE_MODERN_MODEL_IDS = /* @__PURE__ */ new Set([
191
- "command-a-plus-05-2026",
192
- "command-a-reasoning-08-2025",
193
- "north-mini-code-1-0"
194
- ]);
195
- function isModernCohereModelId(modelId) {
196
- return COHERE_MODERN_MODEL_IDS.has(modelId.trim().toLowerCase());
197
- }
198
- function buildCohereCatalogModels() {
199
- return buildManifestModelProviderConfig({
200
- providerId: "cohere",
201
- catalog: COHERE_MANIFEST_CATALOG
202
- }).models;
203
- }
204
- //#endregion
205
- export { openclaw_plugin_default as i, buildCohereCatalogModels as n, isModernCohereModelId as r, COHERE_BASE_URL as t };
package/dist/models.js DELETED
@@ -1,2 +0,0 @@
1
- import { n as buildCohereCatalogModels, r as isModernCohereModelId, t as COHERE_BASE_URL } from "./.setup/models-BtjAnVPh.mjs";
2
- export { COHERE_BASE_URL, buildCohereCatalogModels, isModernCohereModelId };
package/dist/onboard.js DELETED
@@ -1,20 +0,0 @@
1
- import { i as openclaw_plugin_default, n as buildCohereCatalogModels, t as COHERE_BASE_URL } from "./.setup/models-BtjAnVPh.mjs";
2
- import { readManifestProviderDefaultModelRef } from "openclaw/plugin-sdk/provider-catalog-shared";
3
- import { createProviderConnectionPresetAppliers } from "openclaw/plugin-sdk/provider-onboard";
4
- //#region extensions/cohere/onboard.ts
5
- const COHERE_DEFAULT_MODEL_REF = readManifestProviderDefaultModelRef(openclaw_plugin_default, "cohere");
6
- const { applyConfig: applyCohereConfig } = createProviderConnectionPresetAppliers({
7
- primaryModelRef: COHERE_DEFAULT_MODEL_REF,
8
- resolveParams: () => ({
9
- providerId: "cohere",
10
- api: "openai-completions",
11
- baseUrl: COHERE_BASE_URL,
12
- catalogModels: buildCohereCatalogModels,
13
- aliases: [{
14
- modelRef: COHERE_DEFAULT_MODEL_REF,
15
- alias: "Cohere Command A+"
16
- }]
17
- })
18
- });
19
- //#endregion
20
- export { applyCohereConfig };
@@ -1,24 +0,0 @@
1
- import { t as COHERE_BASE_URL } from "./.setup/models-BtjAnVPh.mjs";
2
- import { asOptionalObjectRecord, asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
3
- //#region extensions/cohere/provider-catalog.ts
4
- const COHERE_LIVE_MODEL_DISCOVERY = {
5
- endpointUrl: {
6
- url: "https://api.cohere.com/v1/models?endpoint=chat&page_size=1000",
7
- requireBaseUrl: COHERE_BASE_URL
8
- },
9
- readRows: (body) => {
10
- const models = asOptionalObjectRecord(body)?.models;
11
- if (!Array.isArray(models)) throw new Error("Cohere model catalog response must contain models[]");
12
- return models.flatMap((row) => {
13
- const record = asOptionalRecord(row);
14
- const modelId = normalizeOptionalString(record?.name);
15
- return modelId ? [{
16
- ...record,
17
- id: modelId,
18
- active: record?.is_deprecated !== true
19
- }] : [];
20
- });
21
- }
22
- };
23
- //#endregion
24
- export { COHERE_LIVE_MODEL_DISCOVERY };
package/dist/stream.js DELETED
@@ -1,13 +0,0 @@
1
- import { createPayloadPatchStreamWrapper } from "openclaw/plugin-sdk/provider-stream-shared";
2
- //#region extensions/cohere/stream.ts
3
- function wrapCohereProviderStream(ctx) {
4
- return createPayloadPatchStreamWrapper(ctx.streamFn, ({ payload }) => {
5
- if (Array.isArray(payload.messages)) payload.messages = payload.messages.map((message) => message && typeof message === "object" && message.role === "system" ? {
6
- ...message,
7
- role: "developer"
8
- } : message);
9
- delete payload.tool_choice;
10
- });
11
- }
12
- //#endregion
13
- export { wrapCohereProviderStream };