@openclaw/xiaomi-provider 2026.9.4 → 2026.9.6

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,31 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
2
+ <!--
3
+ Adapted from OpenClaw ui/public/provider-icons/ProviderIcon-mimo.svg.
4
+ Source: https://github.com/steipete/CodexBar/blob/215efbd39ad58acb4b0cd637c407d63e6183bc8d/Sources/CodexBar/Resources/ProviderIcon-mimo.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 fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2.2" d="M5 18V11" />
30
+ <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2.2" d="M5 5L12 12L19 5V18" />
31
+ </svg>
Binary file
@@ -0,0 +1,186 @@
1
+ import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
2
+ //#region extensions/xiaomi/openclaw.plugin.json
3
+ var modelCatalog = {
4
+ "modelsDev": {
5
+ "xiaomi": "xiaomi",
6
+ "xiaomi-token-plan": "xiaomi-token-plan-sgp"
7
+ },
8
+ "providers": {
9
+ "xiaomi": {
10
+ "baseUrl": "https://api.xiaomimimo.com/v1",
11
+ "api": "openai-completions",
12
+ "models": [
13
+ {
14
+ "id": "mimo-v2.6-pro",
15
+ "name": "Xiaomi MiMo V2.6 Pro",
16
+ "input": ["text", "image"],
17
+ "reasoning": true,
18
+ "contextWindow": 1048576,
19
+ "maxTokens": 131072,
20
+ "cost": {
21
+ "input": .435,
22
+ "output": .87,
23
+ "cacheRead": .0036,
24
+ "cacheWrite": 0
25
+ },
26
+ "compat": { "codeMode": "preferred" }
27
+ },
28
+ {
29
+ "id": "mimo-v2.6-flash",
30
+ "name": "Xiaomi MiMo V2.6 Flash",
31
+ "input": ["text", "image"],
32
+ "reasoning": true,
33
+ "contextWindow": 1048576,
34
+ "maxTokens": 131072,
35
+ "cost": {
36
+ "input": .14,
37
+ "output": .28,
38
+ "cacheRead": .0028,
39
+ "cacheWrite": 0
40
+ },
41
+ "compat": { "codeMode": "preferred" }
42
+ },
43
+ {
44
+ "id": "mimo-v2.6-pro-ultraspeed",
45
+ "name": "Xiaomi MiMo V2.6 Pro UltraSpeed",
46
+ "input": ["text", "image"],
47
+ "reasoning": true,
48
+ "contextWindow": 1048576,
49
+ "maxTokens": 131072,
50
+ "cost": {
51
+ "input": 4.35,
52
+ "output": 8.7,
53
+ "cacheRead": .036,
54
+ "cacheWrite": 0
55
+ }
56
+ },
57
+ {
58
+ "id": "mimo-v2.5",
59
+ "name": "Xiaomi MiMo V2.5",
60
+ "input": ["text", "image"],
61
+ "reasoning": true,
62
+ "contextWindow": 1048576,
63
+ "maxTokens": 131072,
64
+ "cost": {
65
+ "input": .14,
66
+ "output": .28,
67
+ "cacheRead": .0028,
68
+ "cacheWrite": 0
69
+ },
70
+ "compat": { "codeMode": "preferred" }
71
+ },
72
+ {
73
+ "id": "mimo-v2.5-pro",
74
+ "name": "Xiaomi MiMo V2.5 Pro",
75
+ "input": ["text"],
76
+ "reasoning": true,
77
+ "contextWindow": 1048576,
78
+ "maxTokens": 131072,
79
+ "cost": {
80
+ "input": .435,
81
+ "output": .87,
82
+ "cacheRead": .0036,
83
+ "cacheWrite": 0
84
+ }
85
+ }
86
+ ]
87
+ },
88
+ "xiaomi-token-plan": {
89
+ "baseUrl": "https://token-plan-sgp.xiaomimimo.com/v1",
90
+ "api": "openai-completions",
91
+ "models": [
92
+ {
93
+ "id": "mimo-v2.6-pro",
94
+ "name": "Xiaomi MiMo V2.6 Pro",
95
+ "input": ["text", "image"],
96
+ "reasoning": true,
97
+ "contextWindow": 1048576,
98
+ "maxTokens": 131072,
99
+ "cost": {
100
+ "input": 0,
101
+ "output": 0,
102
+ "cacheRead": 0,
103
+ "cacheWrite": 0
104
+ },
105
+ "compat": { "codeMode": "preferred" }
106
+ },
107
+ {
108
+ "id": "mimo-v2.6-flash",
109
+ "name": "Xiaomi MiMo V2.6 Flash",
110
+ "input": ["text", "image"],
111
+ "reasoning": true,
112
+ "contextWindow": 1048576,
113
+ "maxTokens": 131072,
114
+ "cost": {
115
+ "input": 0,
116
+ "output": 0,
117
+ "cacheRead": 0,
118
+ "cacheWrite": 0
119
+ },
120
+ "compat": { "codeMode": "preferred" }
121
+ },
122
+ {
123
+ "id": "mimo-v2.5-pro",
124
+ "name": "Xiaomi MiMo V2.5 Pro",
125
+ "input": ["text"],
126
+ "reasoning": true,
127
+ "contextWindow": 1048576,
128
+ "maxTokens": 131072,
129
+ "cost": {
130
+ "input": 0,
131
+ "output": 0,
132
+ "cacheRead": 0,
133
+ "cacheWrite": 0
134
+ }
135
+ },
136
+ {
137
+ "id": "mimo-v2.5",
138
+ "name": "Xiaomi MiMo V2.5",
139
+ "input": ["text", "image"],
140
+ "reasoning": true,
141
+ "contextWindow": 1048576,
142
+ "maxTokens": 131072,
143
+ "cost": {
144
+ "input": 0,
145
+ "output": 0,
146
+ "cacheRead": 0,
147
+ "cacheWrite": 0
148
+ },
149
+ "compat": { "codeMode": "preferred" }
150
+ }
151
+ ]
152
+ }
153
+ },
154
+ "discovery": {
155
+ "xiaomi": "refreshable",
156
+ "xiaomi-token-plan": "refreshable"
157
+ }
158
+ };
159
+ //#endregion
160
+ //#region extensions/xiaomi/provider-catalog.ts
161
+ const XIAOMI_PROVIDER_ID = "xiaomi";
162
+ const XIAOMI_TOKEN_PLAN_PROVIDER_ID = "xiaomi-token-plan";
163
+ const XIAOMI_DEFAULT_MODEL_ID = "mimo-v2.6-pro";
164
+ const XIAOMI_TOKEN_PLAN_DEFAULT_MODEL_ID = "mimo-v2.6-pro";
165
+ const XIAOMI_TOKEN_PLAN_BASE_URLS = {
166
+ ams: "https://token-plan-ams.xiaomimimo.com/v1",
167
+ cn: "https://token-plan-cn.xiaomimimo.com/v1",
168
+ sgp: "https://token-plan-sgp.xiaomimimo.com/v1"
169
+ };
170
+ function buildXiaomiProvider() {
171
+ return buildManifestModelProviderConfig({
172
+ providerId: XIAOMI_PROVIDER_ID,
173
+ catalog: modelCatalog.providers.xiaomi
174
+ });
175
+ }
176
+ function buildXiaomiTokenPlanProvider() {
177
+ return buildManifestModelProviderConfig({
178
+ providerId: XIAOMI_TOKEN_PLAN_PROVIDER_ID,
179
+ catalog: modelCatalog.providers[XIAOMI_TOKEN_PLAN_PROVIDER_ID]
180
+ });
181
+ }
182
+ function resolveXiaomiTokenPlanBaseUrl(region) {
183
+ return XIAOMI_TOKEN_PLAN_BASE_URLS[region];
184
+ }
185
+ //#endregion
186
+ export { buildXiaomiProvider as a, XIAOMI_TOKEN_PLAN_PROVIDER_ID as i, XIAOMI_PROVIDER_ID as n, buildXiaomiTokenPlanProvider as o, XIAOMI_TOKEN_PLAN_DEFAULT_MODEL_ID as r, resolveXiaomiTokenPlanBaseUrl as s, XIAOMI_DEFAULT_MODEL_ID as t };
package/dist/api.js CHANGED
@@ -1,3 +1,3 @@
1
- import { a as buildXiaomiProvider, t as XIAOMI_DEFAULT_MODEL_ID } from "./provider-catalog-B2pu2gGC.js";
1
+ import { a as buildXiaomiProvider, t as XIAOMI_DEFAULT_MODEL_ID } from "./.setup/provider-catalog-v9-9qyII.mjs";
2
2
  import { XIAOMI_DEFAULT_MODEL_REF, applyXiaomiConfig, applyXiaomiProviderConfig } from "./onboard.js";
3
3
  export { XIAOMI_DEFAULT_MODEL_ID, XIAOMI_DEFAULT_MODEL_REF, applyXiaomiConfig, applyXiaomiProviderConfig, buildXiaomiProvider };
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import { a as buildXiaomiProvider, i as XIAOMI_TOKEN_PLAN_PROVIDER_ID, n as XIAOMI_PROVIDER_ID, o as buildXiaomiTokenPlanProvider } from "./provider-catalog-B2pu2gGC.js";
1
+ import { a as buildXiaomiProvider, i as XIAOMI_TOKEN_PLAN_PROVIDER_ID, n as XIAOMI_PROVIDER_ID, o as buildXiaomiTokenPlanProvider } from "./.setup/provider-catalog-v9-9qyII.mjs";
2
2
  import { XIAOMI_DEFAULT_MODEL_REF, XIAOMI_TOKEN_PLAN_DEFAULT_MODEL_REF, applyXiaomiConnectionConfig, applyXiaomiTokenPlanConfig } from "./onboard.js";
3
3
  import { buildXiaomiSpeechProvider } from "./speech-provider.js";
4
- import { resolveMiMoThinkingProfile } from "./thinking.js";
5
- import { createMiMoThinkingWrapper } from "./stream.js";
4
+ import { isMiMoReasoningModelRef, resolveMiMoThinkingProfile } from "./thinking.js";
6
5
  import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
7
- import { applyAuthProfileConfig, buildApiKeyCredential, ensureApiKeyFromOptionEnvOrPrompt, normalizeApiKeyInput, normalizeOptionalSecretInput, upsertAuthProfileWithLockOrThrow, validateApiKeyInput } from "openclaw/plugin-sdk/provider-auth-api-key";
6
+ import { applyAuthProfileConfig, buildApiKeyCredential, captureProviderApiKey, normalizeOptionalSecretInput, persistProviderApiKey } from "openclaw/plugin-sdk/provider-auth-api-key";
8
7
  import { buildOpenAICompatibleLiveProviderCatalog } from "openclaw/plugin-sdk/provider-catalog-live-runtime";
9
8
  import { applyModelCompatPatch, buildProviderReplayFamilyHooks } from "openclaw/plugin-sdk/provider-model-shared";
9
+ import { createDeepSeekV4OpenAICompatibleThinkingWrapper } from "openclaw/plugin-sdk/provider-stream-shared";
10
10
  import { PROVIDER_LABELS } from "openclaw/plugin-sdk/provider-usage";
11
11
  //#region extensions/xiaomi/index.ts
12
12
  const PAYG_FLAG_NAME = "--xiaomi-api-key";
@@ -26,7 +26,11 @@ const XIAOMI_PROVIDER_HOOKS = {
26
26
  dropReasoningFromHistory: false
27
27
  }),
28
28
  normalizeResolvedModel: ({ model }) => applyModelCompatPatch(model, { omitEmptyArrayItems: true }),
29
- wrapStreamFn: (ctx) => createMiMoThinkingWrapper(ctx.streamFn, ctx.thinkingLevel),
29
+ wrapStreamFn: (ctx) => createDeepSeekV4OpenAICompatibleThinkingWrapper({
30
+ baseStreamFn: ctx.streamFn,
31
+ thinkingLevel: ctx.thinkingLevel,
32
+ shouldPatchModel: isMiMoReasoningModelRef
33
+ }),
30
34
  resolveThinkingProfile: ({ modelId }) => resolveMiMoThinkingProfile(modelId),
31
35
  isModernModelRef: ({ modelId }) => Boolean(resolveMiMoThinkingProfile(modelId))
32
36
  };
@@ -73,39 +77,25 @@ function resolveProfileId(providerId) {
73
77
  return `${providerId}:default`;
74
78
  }
75
79
  async function runXiaomiApiKeyAuth(ctx, params) {
76
- let capturedSecretInput;
77
- let capturedCredential = false;
78
- let capturedMode;
79
80
  const profileId = resolveProfileId(params.providerId);
81
+ const { apiKey, input, mode } = await captureProviderApiKey(ctx, {
82
+ token: normalizeOptionalSecretInput(ctx.opts?.[params.optionKey]) ?? normalizeOptionalSecretInput(ctx.opts?.token),
83
+ tokenProvider: normalizeOptionalSecretInput(ctx.opts?.[params.optionKey]) ? params.providerId : normalizeOptionalSecretInput(ctx.opts?.tokenProvider),
84
+ env: ctx.env,
85
+ expectedProviders: [params.providerId],
86
+ provider: params.providerId,
87
+ envLabel: params.envVar,
88
+ promptMessage: params.promptMessage,
89
+ missingInputMessage: `Missing Xiaomi API key for provider "${params.providerId}".`
90
+ });
80
91
  assertCompatibleXiaomiKey({
81
- actualKey: await ensureApiKeyFromOptionEnvOrPrompt({
82
- token: normalizeOptionalSecretInput(ctx.opts?.[params.optionKey]) ?? normalizeOptionalSecretInput(ctx.opts?.token),
83
- tokenProvider: normalizeOptionalSecretInput(ctx.opts?.[params.optionKey]) ? params.providerId : normalizeOptionalSecretInput(ctx.opts?.tokenProvider),
84
- secretInputMode: ctx.allowSecretRefPrompt === false ? ctx.secretInputMode ?? "plaintext" : ctx.secretInputMode,
85
- config: ctx.config,
86
- env: ctx.env,
87
- workspaceDir: ctx.workspaceDir,
88
- expectedProviders: [params.providerId],
89
- provider: params.providerId,
90
- envLabel: params.envVar,
91
- promptMessage: params.promptMessage,
92
- normalize: normalizeApiKeyInput,
93
- validate: validateApiKeyInput,
94
- prompter: ctx.prompter,
95
- setCredential: async (key, mode) => {
96
- capturedSecretInput = key;
97
- capturedCredential = true;
98
- capturedMode = mode;
99
- }
100
- }),
92
+ actualKey: apiKey,
101
93
  expectedKind: params.expectedKind
102
94
  });
103
- if (!capturedCredential) throw new Error(`Missing Xiaomi API key for provider "${params.providerId}".`);
104
- const credentialInput = capturedSecretInput ?? "";
105
95
  return {
106
96
  profiles: [{
107
97
  profileId,
108
- credential: buildApiKeyCredential(params.providerId, credentialInput, void 0, capturedMode ? { secretInputMode: capturedMode } : void 0)
98
+ credential: buildApiKeyCredential(params.providerId, input, void 0, mode ? { secretInputMode: mode } : void 0)
109
99
  }],
110
100
  configPatch: params.applyConfig(ctx.config),
111
101
  defaultModel: params.defaultModel
@@ -124,18 +114,10 @@ async function runXiaomiApiKeyAuthNonInteractive(ctx, params) {
124
114
  expectedKind: params.expectedKind
125
115
  });
126
116
  const profileId = resolveProfileId(params.providerId);
127
- if (resolved.source !== "profile") {
128
- const credential = ctx.toApiKeyCredential({
129
- provider: params.providerId,
130
- resolved
131
- });
132
- if (!credential) return null;
133
- await upsertAuthProfileWithLockOrThrow({
134
- profileId,
135
- credential,
136
- agentDir: ctx.agentDir
137
- });
138
- }
117
+ if (!await persistProviderApiKey(ctx, profileId, {
118
+ provider: params.providerId,
119
+ resolved
120
+ })) return null;
139
121
  const next = applyAuthProfileConfig(ctx.config, {
140
122
  profileId,
141
123
  provider: params.providerId,
@@ -143,70 +125,42 @@ async function runXiaomiApiKeyAuthNonInteractive(ctx, params) {
143
125
  });
144
126
  return params.applyConfig(next);
145
127
  }
146
- function createPaygAuthMethod() {
147
- return {
148
- id: "api-key",
149
- label: "Xiaomi API key (Pay-as-you-go)",
150
- hint: "Endpoint: api.xiaomimimo.com/v1",
151
- kind: "api_key",
152
- wizard: {
153
- choiceId: "xiaomi-api-key",
154
- choiceLabel: "Xiaomi API key (Pay-as-you-go)",
155
- choiceHint: "Endpoint: api.xiaomimimo.com/v1",
156
- ...XIAOMI_WIZARD_GROUP
157
- },
158
- run: async (ctx) => await runXiaomiApiKeyAuth(ctx, {
159
- providerId: XIAOMI_PROVIDER_ID,
160
- optionKey: PAYG_OPTION_KEY,
161
- envVar: PAYG_ENV_VAR,
162
- promptMessage: "Enter Xiaomi MiMo API key (pay-as-you-go, sk-...)",
163
- expectedKind: "payg",
164
- defaultModel: XIAOMI_DEFAULT_MODEL_REF,
165
- applyConfig: applyXiaomiConnectionConfig
166
- }),
167
- runNonInteractive: async (ctx) => await runXiaomiApiKeyAuthNonInteractive(ctx, {
168
- providerId: XIAOMI_PROVIDER_ID,
169
- optionKey: PAYG_OPTION_KEY,
170
- flagName: PAYG_FLAG_NAME,
171
- envVar: PAYG_ENV_VAR,
172
- expectedKind: "payg",
173
- applyConfig: applyXiaomiConnectionConfig
174
- })
175
- };
176
- }
177
- function createTokenPlanAuthMethod(region) {
128
+ function createXiaomiApiKeyAuthMethod(region) {
178
129
  const regionLabel = region === "ams" ? "Europe" : region === "cn" ? "China" : "Singapore";
179
- const choiceId = `xiaomi-token-plan-${region}`;
180
- const choiceLabel = `Xiaomi Token Plan (${regionLabel})`;
181
- const choiceHint = `Endpoint preset: token-plan-${region}.xiaomimimo.com/v1`;
130
+ const choiceLabel = region ? `Xiaomi Token Plan (${regionLabel})` : "Xiaomi API key (Pay-as-you-go)";
131
+ const choiceHint = region ? `Endpoint preset: token-plan-${region}.xiaomimimo.com/v1` : "Endpoint: api.xiaomimimo.com/v1";
132
+ const auth = region ? {
133
+ providerId: XIAOMI_TOKEN_PLAN_PROVIDER_ID,
134
+ optionKey: TOKEN_PLAN_OPTION_KEY,
135
+ flagName: TOKEN_PLAN_FLAG_NAME,
136
+ envVar: TOKEN_PLAN_ENV_VAR,
137
+ promptMessage: `Enter Xiaomi MiMo Token Plan API key (tp-...) for ${regionLabel}`,
138
+ expectedKind: "token-plan",
139
+ defaultModel: XIAOMI_TOKEN_PLAN_DEFAULT_MODEL_REF,
140
+ applyConfig: (cfg) => applyXiaomiTokenPlanConfig(cfg, region)
141
+ } : {
142
+ providerId: XIAOMI_PROVIDER_ID,
143
+ optionKey: PAYG_OPTION_KEY,
144
+ flagName: PAYG_FLAG_NAME,
145
+ envVar: PAYG_ENV_VAR,
146
+ promptMessage: "Enter Xiaomi MiMo API key (pay-as-you-go, sk-...)",
147
+ expectedKind: "payg",
148
+ defaultModel: XIAOMI_DEFAULT_MODEL_REF,
149
+ applyConfig: applyXiaomiConnectionConfig
150
+ };
182
151
  return {
183
- id: `token-plan-${region}`,
152
+ id: region ? `token-plan-${region}` : "api-key",
184
153
  label: choiceLabel,
185
154
  hint: choiceHint,
186
155
  kind: "api_key",
187
156
  wizard: {
188
- choiceId,
157
+ choiceId: region ? `xiaomi-token-plan-${region}` : "xiaomi-api-key",
189
158
  choiceLabel,
190
159
  choiceHint,
191
160
  ...XIAOMI_WIZARD_GROUP
192
161
  },
193
- run: async (ctx) => await runXiaomiApiKeyAuth(ctx, {
194
- providerId: XIAOMI_TOKEN_PLAN_PROVIDER_ID,
195
- optionKey: TOKEN_PLAN_OPTION_KEY,
196
- envVar: TOKEN_PLAN_ENV_VAR,
197
- promptMessage: `Enter Xiaomi MiMo Token Plan API key (tp-...) for ${regionLabel}`,
198
- expectedKind: "token-plan",
199
- defaultModel: XIAOMI_TOKEN_PLAN_DEFAULT_MODEL_REF,
200
- applyConfig: (cfg) => applyXiaomiTokenPlanConfig(cfg, region)
201
- }),
202
- runNonInteractive: async (ctx) => await runXiaomiApiKeyAuthNonInteractive(ctx, {
203
- providerId: XIAOMI_TOKEN_PLAN_PROVIDER_ID,
204
- optionKey: TOKEN_PLAN_OPTION_KEY,
205
- flagName: TOKEN_PLAN_FLAG_NAME,
206
- envVar: TOKEN_PLAN_ENV_VAR,
207
- expectedKind: "token-plan",
208
- applyConfig: (cfg) => applyXiaomiTokenPlanConfig(cfg, region)
209
- })
162
+ run: async (ctx) => await runXiaomiApiKeyAuth(ctx, auth),
163
+ runNonInteractive: async (ctx) => await runXiaomiApiKeyAuthNonInteractive(ctx, auth)
210
164
  };
211
165
  }
212
166
  var xiaomi_default = definePluginEntry({
@@ -214,73 +168,57 @@ var xiaomi_default = definePluginEntry({
214
168
  name: "Xiaomi Provider",
215
169
  description: "Xiaomi provider plugin",
216
170
  register(api) {
217
- api.registerProvider({
171
+ for (const provider of [{
218
172
  id: XIAOMI_PROVIDER_ID,
219
173
  label: "Xiaomi",
220
- docsPath: "/providers/xiaomi",
221
- envVars: [PAYG_ENV_VAR],
222
- auth: [createPaygAuthMethod()],
223
- catalog: {
224
- order: "simple",
225
- run: async (ctx) => resolveXiaomiCatalog({
226
- ctx,
227
- providerId: XIAOMI_PROVIDER_ID,
228
- buildProvider: buildXiaomiProvider
229
- })
230
- },
231
- staticCatalog: {
232
- order: "simple",
233
- run: async () => ({ provider: buildXiaomiProvider() })
234
- },
235
- ...XIAOMI_PROVIDER_HOOKS,
236
- resolveUsageAuth: async (ctx) => {
237
- const apiKey = ctx.resolveApiKeyFromConfigAndStore({
238
- providerIds: [XIAOMI_PROVIDER_ID],
239
- envDirect: [ctx.env.XIAOMI_API_KEY]
240
- });
241
- return apiKey ? { token: apiKey } : null;
242
- },
243
- fetchUsageSnapshot: async () => ({
244
- provider: XIAOMI_PROVIDER_ID,
245
- displayName: PROVIDER_LABELS.xiaomi,
246
- windows: []
247
- })
248
- });
249
- api.registerProvider({
174
+ envVar: PAYG_ENV_VAR,
175
+ auth: () => [createXiaomiApiKeyAuthMethod()],
176
+ buildProvider: buildXiaomiProvider,
177
+ displayName: PROVIDER_LABELS.xiaomi,
178
+ requiresRegion: false
179
+ }, {
250
180
  id: XIAOMI_TOKEN_PLAN_PROVIDER_ID,
251
181
  label: "Xiaomi Token Plan",
182
+ envVar: TOKEN_PLAN_ENV_VAR,
183
+ auth: () => [
184
+ "ams",
185
+ "cn",
186
+ "sgp"
187
+ ].map(createXiaomiApiKeyAuthMethod),
188
+ buildProvider: buildXiaomiTokenPlanProvider,
189
+ displayName: "Xiaomi MiMo Token Plan",
190
+ requiresRegion: true
191
+ }]) api.registerProvider({
192
+ id: provider.id,
193
+ label: provider.label,
252
194
  docsPath: "/providers/xiaomi",
253
- envVars: [TOKEN_PLAN_ENV_VAR],
254
- auth: [
255
- createTokenPlanAuthMethod("ams"),
256
- createTokenPlanAuthMethod("cn"),
257
- createTokenPlanAuthMethod("sgp")
258
- ],
195
+ envVars: [provider.envVar],
196
+ auth: provider.auth(),
259
197
  catalog: {
260
198
  order: "simple",
261
199
  run: async (ctx) => resolveXiaomiCatalog({
262
200
  ctx,
263
- providerId: XIAOMI_TOKEN_PLAN_PROVIDER_ID,
264
- buildProvider: buildXiaomiTokenPlanProvider,
265
- requireConfiguredProvider: true,
266
- requireBaseUrl: true
201
+ providerId: provider.id,
202
+ buildProvider: provider.buildProvider,
203
+ requireConfiguredProvider: provider.requiresRegion,
204
+ requireBaseUrl: provider.requiresRegion
267
205
  })
268
206
  },
269
207
  staticCatalog: {
270
208
  order: "simple",
271
- run: async () => ({ provider: buildXiaomiTokenPlanProvider() })
209
+ run: async () => ({ provider: provider.buildProvider() })
272
210
  },
273
211
  ...XIAOMI_PROVIDER_HOOKS,
274
212
  resolveUsageAuth: async (ctx) => {
275
213
  const apiKey = ctx.resolveApiKeyFromConfigAndStore({
276
- providerIds: [XIAOMI_TOKEN_PLAN_PROVIDER_ID],
277
- envDirect: [ctx.env.XIAOMI_TOKEN_PLAN_API_KEY]
214
+ providerIds: [provider.id],
215
+ envDirect: [ctx.env[provider.envVar]]
278
216
  });
279
217
  return apiKey ? { token: apiKey } : null;
280
218
  },
281
219
  fetchUsageSnapshot: async () => ({
282
- provider: XIAOMI_TOKEN_PLAN_PROVIDER_ID,
283
- displayName: "Xiaomi MiMo Token Plan",
220
+ provider: provider.id,
221
+ displayName: provider.displayName,
284
222
  windows: []
285
223
  })
286
224
  });
package/dist/onboard.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as buildXiaomiProvider, i as XIAOMI_TOKEN_PLAN_PROVIDER_ID, n as XIAOMI_PROVIDER_ID, o as buildXiaomiTokenPlanProvider, r as XIAOMI_TOKEN_PLAN_DEFAULT_MODEL_ID, s as resolveXiaomiTokenPlanBaseUrl, t as XIAOMI_DEFAULT_MODEL_ID } from "./provider-catalog-B2pu2gGC.js";
1
+ import { a as buildXiaomiProvider, i as XIAOMI_TOKEN_PLAN_PROVIDER_ID, n as XIAOMI_PROVIDER_ID, o as buildXiaomiTokenPlanProvider, r as XIAOMI_TOKEN_PLAN_DEFAULT_MODEL_ID, s as resolveXiaomiTokenPlanBaseUrl, t as XIAOMI_DEFAULT_MODEL_ID } from "./.setup/provider-catalog-v9-9qyII.mjs";
2
2
  import { createDefaultModelsConnectionPresetAppliers, createDefaultModelsPresetAppliers } from "openclaw/plugin-sdk/provider-onboard";
3
3
  //#region extensions/xiaomi/onboard.ts
4
4
  const XIAOMI_DEFAULT_MODEL_REF = `${XIAOMI_PROVIDER_ID}/${XIAOMI_DEFAULT_MODEL_ID}`;
@@ -36,7 +36,7 @@ const xiaomiTokenPlanPresetAppliers = createDefaultModelsPresetAppliers({
36
36
  const defaultModel = defaultProvider.models?.find((m) => m.id === XIAOMI_TOKEN_PLAN_DEFAULT_MODEL_ID);
37
37
  return [{
38
38
  modelRef: XIAOMI_TOKEN_PLAN_DEFAULT_MODEL_REF,
39
- alias: defaultModel?.name ?? "MiMo V2.5 Pro"
39
+ alias: defaultModel?.name ?? "Xiaomi MiMo V2.6 Pro"
40
40
  }];
41
41
  })()
42
42
  };
@@ -1,2 +1,2 @@
1
- import { a as buildXiaomiProvider, i as XIAOMI_TOKEN_PLAN_PROVIDER_ID, n as XIAOMI_PROVIDER_ID, o as buildXiaomiTokenPlanProvider, r as XIAOMI_TOKEN_PLAN_DEFAULT_MODEL_ID, s as resolveXiaomiTokenPlanBaseUrl, t as XIAOMI_DEFAULT_MODEL_ID } from "./provider-catalog-B2pu2gGC.js";
1
+ import { a as buildXiaomiProvider, i as XIAOMI_TOKEN_PLAN_PROVIDER_ID, n as XIAOMI_PROVIDER_ID, o as buildXiaomiTokenPlanProvider, r as XIAOMI_TOKEN_PLAN_DEFAULT_MODEL_ID, s as resolveXiaomiTokenPlanBaseUrl, t as XIAOMI_DEFAULT_MODEL_ID } from "./.setup/provider-catalog-v9-9qyII.mjs";
2
2
  export { XIAOMI_DEFAULT_MODEL_ID, XIAOMI_PROVIDER_ID, XIAOMI_TOKEN_PLAN_DEFAULT_MODEL_ID, XIAOMI_TOKEN_PLAN_PROVIDER_ID, buildXiaomiProvider, buildXiaomiTokenPlanProvider, resolveXiaomiTokenPlanBaseUrl };
package/dist/thinking.js CHANGED
@@ -1,9 +1,11 @@
1
- import "./provider-catalog-B2pu2gGC.js";
1
+ import "./.setup/provider-catalog-v9-9qyII.mjs";
2
2
  //#region extensions/xiaomi/thinking.ts
3
3
  const MIMO_REASONING_MODEL_IDS = /* @__PURE__ */ new Set([
4
4
  "mimo-v2.5",
5
5
  "mimo-v2.5-pro",
6
- "mimo-v2.6-pro"
6
+ "mimo-v2.6-flash",
7
+ "mimo-v2.6-pro",
8
+ "mimo-v2.6-pro-ultraspeed"
7
9
  ]);
8
10
  function isMiMoReasoningModelId(modelId) {
9
11
  return MIMO_REASONING_MODEL_IDS.has(modelId.toLowerCase());
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "id": "xiaomi",
3
3
  "categories": [
4
- "models",
5
- "voice"
4
+ "models"
6
5
  ],
7
6
  "capabilityCatalogEntry": "./dist/capability-catalog.js",
8
7
  "activation": {
@@ -43,6 +42,63 @@
43
42
  "baseUrl": "https://api.xiaomimimo.com/v1",
44
43
  "api": "openai-completions",
45
44
  "models": [
45
+ {
46
+ "id": "mimo-v2.6-pro",
47
+ "name": "Xiaomi MiMo V2.6 Pro",
48
+ "input": [
49
+ "text",
50
+ "image"
51
+ ],
52
+ "reasoning": true,
53
+ "contextWindow": 1048576,
54
+ "maxTokens": 131072,
55
+ "cost": {
56
+ "input": 0.435,
57
+ "output": 0.87,
58
+ "cacheRead": 0.0036,
59
+ "cacheWrite": 0
60
+ },
61
+ "compat": {
62
+ "codeMode": "preferred"
63
+ }
64
+ },
65
+ {
66
+ "id": "mimo-v2.6-flash",
67
+ "name": "Xiaomi MiMo V2.6 Flash",
68
+ "input": [
69
+ "text",
70
+ "image"
71
+ ],
72
+ "reasoning": true,
73
+ "contextWindow": 1048576,
74
+ "maxTokens": 131072,
75
+ "cost": {
76
+ "input": 0.14,
77
+ "output": 0.28,
78
+ "cacheRead": 0.0028,
79
+ "cacheWrite": 0
80
+ },
81
+ "compat": {
82
+ "codeMode": "preferred"
83
+ }
84
+ },
85
+ {
86
+ "id": "mimo-v2.6-pro-ultraspeed",
87
+ "name": "Xiaomi MiMo V2.6 Pro UltraSpeed",
88
+ "input": [
89
+ "text",
90
+ "image"
91
+ ],
92
+ "reasoning": true,
93
+ "contextWindow": 1048576,
94
+ "maxTokens": 131072,
95
+ "cost": {
96
+ "input": 4.35,
97
+ "output": 8.7,
98
+ "cacheRead": 0.036,
99
+ "cacheWrite": 0
100
+ }
101
+ },
46
102
  {
47
103
  "id": "mimo-v2.5",
48
104
  "name": "Xiaomi MiMo V2.5",
@@ -85,6 +141,46 @@
85
141
  "baseUrl": "https://token-plan-sgp.xiaomimimo.com/v1",
86
142
  "api": "openai-completions",
87
143
  "models": [
144
+ {
145
+ "id": "mimo-v2.6-pro",
146
+ "name": "Xiaomi MiMo V2.6 Pro",
147
+ "input": [
148
+ "text",
149
+ "image"
150
+ ],
151
+ "reasoning": true,
152
+ "contextWindow": 1048576,
153
+ "maxTokens": 131072,
154
+ "cost": {
155
+ "input": 0,
156
+ "output": 0,
157
+ "cacheRead": 0,
158
+ "cacheWrite": 0
159
+ },
160
+ "compat": {
161
+ "codeMode": "preferred"
162
+ }
163
+ },
164
+ {
165
+ "id": "mimo-v2.6-flash",
166
+ "name": "Xiaomi MiMo V2.6 Flash",
167
+ "input": [
168
+ "text",
169
+ "image"
170
+ ],
171
+ "reasoning": true,
172
+ "contextWindow": 1048576,
173
+ "maxTokens": 131072,
174
+ "cost": {
175
+ "input": 0,
176
+ "output": 0,
177
+ "cacheRead": 0,
178
+ "cacheWrite": 0
179
+ },
180
+ "compat": {
181
+ "codeMode": "preferred"
182
+ }
183
+ },
88
184
  {
89
185
  "id": "mimo-v2.5-pro",
90
186
  "name": "Xiaomi MiMo V2.5 Pro",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/xiaomi-provider",
3
- "version": "2026.9.4",
3
+ "version": "2026.9.6",
4
4
  "description": "OpenClaw Xiaomi 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.4"
21
+ "pluginApi": ">=2026.9.6"
22
22
  },
23
23
  "build": {
24
- "openclawVersion": "2026.9.4",
24
+ "openclawVersion": "2026.9.6",
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.4"
43
+ "openclaw": ">=2026.9.6"
42
44
  },
43
45
  "peerDependenciesMeta": {
44
46
  "openclaw": {
@@ -1,106 +0,0 @@
1
- import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
2
- //#region extensions/xiaomi/openclaw.plugin.json
3
- var modelCatalog = {
4
- "modelsDev": {
5
- "xiaomi": "xiaomi",
6
- "xiaomi-token-plan": "xiaomi-token-plan-sgp"
7
- },
8
- "providers": {
9
- "xiaomi": {
10
- "baseUrl": "https://api.xiaomimimo.com/v1",
11
- "api": "openai-completions",
12
- "models": [{
13
- "id": "mimo-v2.5",
14
- "name": "Xiaomi MiMo V2.5",
15
- "input": ["text", "image"],
16
- "reasoning": true,
17
- "contextWindow": 1048576,
18
- "maxTokens": 131072,
19
- "cost": {
20
- "input": .14,
21
- "output": .28,
22
- "cacheRead": .0028,
23
- "cacheWrite": 0
24
- },
25
- "compat": { "codeMode": "preferred" }
26
- }, {
27
- "id": "mimo-v2.5-pro",
28
- "name": "Xiaomi MiMo V2.5 Pro",
29
- "input": ["text"],
30
- "reasoning": true,
31
- "contextWindow": 1048576,
32
- "maxTokens": 131072,
33
- "cost": {
34
- "input": .435,
35
- "output": .87,
36
- "cacheRead": .0036,
37
- "cacheWrite": 0
38
- }
39
- }]
40
- },
41
- "xiaomi-token-plan": {
42
- "baseUrl": "https://token-plan-sgp.xiaomimimo.com/v1",
43
- "api": "openai-completions",
44
- "models": [{
45
- "id": "mimo-v2.5-pro",
46
- "name": "Xiaomi MiMo V2.5 Pro",
47
- "input": ["text"],
48
- "reasoning": true,
49
- "contextWindow": 1048576,
50
- "maxTokens": 131072,
51
- "cost": {
52
- "input": 0,
53
- "output": 0,
54
- "cacheRead": 0,
55
- "cacheWrite": 0
56
- }
57
- }, {
58
- "id": "mimo-v2.5",
59
- "name": "Xiaomi MiMo V2.5",
60
- "input": ["text", "image"],
61
- "reasoning": true,
62
- "contextWindow": 1048576,
63
- "maxTokens": 131072,
64
- "cost": {
65
- "input": 0,
66
- "output": 0,
67
- "cacheRead": 0,
68
- "cacheWrite": 0
69
- },
70
- "compat": { "codeMode": "preferred" }
71
- }]
72
- }
73
- },
74
- "discovery": {
75
- "xiaomi": "refreshable",
76
- "xiaomi-token-plan": "refreshable"
77
- }
78
- };
79
- //#endregion
80
- //#region extensions/xiaomi/provider-catalog.ts
81
- const XIAOMI_PROVIDER_ID = "xiaomi";
82
- const XIAOMI_TOKEN_PLAN_PROVIDER_ID = "xiaomi-token-plan";
83
- const XIAOMI_DEFAULT_MODEL_ID = "mimo-v2.5";
84
- const XIAOMI_TOKEN_PLAN_DEFAULT_MODEL_ID = "mimo-v2.5-pro";
85
- const XIAOMI_TOKEN_PLAN_BASE_URLS = {
86
- ams: "https://token-plan-ams.xiaomimimo.com/v1",
87
- cn: "https://token-plan-cn.xiaomimimo.com/v1",
88
- sgp: "https://token-plan-sgp.xiaomimimo.com/v1"
89
- };
90
- function buildXiaomiProvider() {
91
- return buildManifestModelProviderConfig({
92
- providerId: XIAOMI_PROVIDER_ID,
93
- catalog: modelCatalog.providers.xiaomi
94
- });
95
- }
96
- function buildXiaomiTokenPlanProvider() {
97
- return buildManifestModelProviderConfig({
98
- providerId: XIAOMI_TOKEN_PLAN_PROVIDER_ID,
99
- catalog: modelCatalog.providers[XIAOMI_TOKEN_PLAN_PROVIDER_ID]
100
- });
101
- }
102
- function resolveXiaomiTokenPlanBaseUrl(region) {
103
- return XIAOMI_TOKEN_PLAN_BASE_URLS[region];
104
- }
105
- //#endregion
106
- export { buildXiaomiProvider as a, XIAOMI_TOKEN_PLAN_PROVIDER_ID as i, XIAOMI_PROVIDER_ID as n, buildXiaomiTokenPlanProvider as o, XIAOMI_TOKEN_PLAN_DEFAULT_MODEL_ID as r, resolveXiaomiTokenPlanBaseUrl as s, XIAOMI_DEFAULT_MODEL_ID as t };
package/dist/stream.js DELETED
@@ -1,12 +0,0 @@
1
- import { isMiMoReasoningModelRef } from "./thinking.js";
2
- import { createDeepSeekV4OpenAICompatibleThinkingWrapper } from "openclaw/plugin-sdk/provider-stream-shared";
3
- //#region extensions/xiaomi/stream.ts
4
- function createMiMoThinkingWrapper(baseStreamFn, thinkingLevel) {
5
- return createDeepSeekV4OpenAICompatibleThinkingWrapper({
6
- baseStreamFn,
7
- thinkingLevel,
8
- shouldPatchModel: isMiMoReasoningModelRef
9
- });
10
- }
11
- //#endregion
12
- export { createMiMoThinkingWrapper };