@wallbreakerno4/opencode-commandcode 0.1.0
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/LICENSE +22 -0
- package/README.md +54 -0
- package/dist/disguise/backoff.d.ts +33 -0
- package/dist/disguise/backoff.js +43 -0
- package/dist/disguise/config-block.d.ts +71 -0
- package/dist/disguise/config-block.js +166 -0
- package/dist/disguise/config-freeze.d.ts +27 -0
- package/dist/disguise/config-freeze.js +87 -0
- package/dist/disguise/fingerprint.d.ts +44 -0
- package/dist/disguise/fingerprint.js +127 -0
- package/dist/disguise/hash.d.ts +8 -0
- package/dist/disguise/hash.js +13 -0
- package/dist/disguise/headers.d.ts +25 -0
- package/dist/disguise/headers.js +25 -0
- package/dist/disguise/logger.d.ts +14 -0
- package/dist/disguise/logger.js +18 -0
- package/dist/disguise/preflight.d.ts +74 -0
- package/dist/disguise/preflight.js +139 -0
- package/dist/disguise/redact.d.ts +12 -0
- package/dist/disguise/redact.js +17 -0
- package/dist/disguise/session.d.ts +11 -0
- package/dist/disguise/session.js +24 -0
- package/dist/disguise/slug.d.ts +12 -0
- package/dist/disguise/slug.js +47 -0
- package/dist/disguise/state.d.ts +62 -0
- package/dist/disguise/state.js +157 -0
- package/dist/disguise/traceparent.d.ts +7 -0
- package/dist/disguise/traceparent.js +10 -0
- package/dist/disguise/version-cache.d.ts +27 -0
- package/dist/disguise/version-cache.js +69 -0
- package/dist/disguise/version-runtime.d.ts +42 -0
- package/dist/disguise/version-runtime.js +137 -0
- package/dist/disguise/version.d.ts +21 -0
- package/dist/disguise/version.js +17 -0
- package/dist/host/constants.d.ts +14 -0
- package/dist/host/constants.js +14 -0
- package/dist/host/v1.d.ts +85 -0
- package/dist/host/v1.js +118 -0
- package/dist/host/v2.d.ts +33 -0
- package/dist/host/v2.js +110 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.js +33 -0
- package/dist/models/api.d.ts +23 -0
- package/dist/models/api.js +44 -0
- package/dist/models/artifact.d.ts +45 -0
- package/dist/models/artifact.js +108 -0
- package/dist/models/cascade.d.ts +47 -0
- package/dist/models/cascade.js +40 -0
- package/dist/models/mapping.d.ts +66 -0
- package/dist/models/mapping.js +47 -0
- package/dist/models/pipeline.d.ts +89 -0
- package/dist/models/pipeline.js +331 -0
- package/dist/models/signature.d.ts +20 -0
- package/dist/models/signature.js +29 -0
- package/dist/models/snapshot.d.ts +15 -0
- package/dist/models/snapshot.js +16 -0
- package/dist/models/snapshot.json +535 -0
- package/dist/models/urls.d.ts +39 -0
- package/dist/models/urls.js +96 -0
- package/dist/protocol/envelope.d.ts +118 -0
- package/dist/protocol/envelope.js +331 -0
- package/dist/protocol/errors.d.ts +97 -0
- package/dist/protocol/errors.js +281 -0
- package/dist/protocol/generate.d.ts +53 -0
- package/dist/protocol/generate.js +173 -0
- package/dist/protocol/images.d.ts +45 -0
- package/dist/protocol/images.js +115 -0
- package/dist/protocol/json.d.ts +11 -0
- package/dist/protocol/json.js +8 -0
- package/dist/protocol/ndjson.d.ts +41 -0
- package/dist/protocol/ndjson.js +321 -0
- package/dist/protocol/watchdog.d.ts +37 -0
- package/dist/protocol/watchdog.js +61 -0
- package/dist/provider/model.d.ts +95 -0
- package/dist/provider/model.js +323 -0
- package/package.json +46 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 包内快照(docs/spec/model-pipeline.md §5):与构建产物同 schema 的「最后已知
|
|
3
|
+
* 良好产物」,随插件发版从最新产物复制进来,是运行时永远可用的兜底层——不占
|
|
4
|
+
* modelsUrls 列表位,产物/API 全部失败或从未成功时顶替产物角色(§5 降级表)。
|
|
5
|
+
*
|
|
6
|
+
* 产物原文在同目录 `snapshot.json`(逐字节来自构建产物,sha256 可与渠道产物对
|
|
7
|
+
* 账);刷新走 `pnpm embed-snapshot`(scripts/embed-snapshot.ts:运行时同款
|
|
8
|
+
* parseArtifact schema 校验通过才写入,发布流程见 docs/release/release-process.md)。
|
|
9
|
+
* build 脚本在 tsc 之后 `cp` 一份原文进 dist——tsc 自带的 JSON 复制会重排版,
|
|
10
|
+
* 逐字节一致靠 cp 保住。空快照占位形态不存在——校验拒绝空清单入库;运行时任何
|
|
11
|
+
* 降级路径都不会因快照缺位而崩(loadPackageSnapshot 的防御分支兜底)。
|
|
12
|
+
* 快照 `sourceCliVersion` 同时是版本头兜底链 ④(disguise.md §6)。
|
|
13
|
+
*/
|
|
14
|
+
import snapshotJson from "./snapshot.json" with { type: "json" };
|
|
15
|
+
/** 包内快照原文(unknown:非可信数据,消费方一律经 parseArtifact 解析) */
|
|
16
|
+
export const PACKAGE_SNAPSHOT_JSON = snapshotJson;
|
|
@@ -0,0 +1,535 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"generatedAt": "2026-09-06T16:21:38.693Z",
|
|
4
|
+
"sourceCliVersion": "1.49.1",
|
|
5
|
+
"models": [
|
|
6
|
+
{
|
|
7
|
+
"id": "deepseek/deepseek-v4-pro",
|
|
8
|
+
"name": "DeepSeek V4 Pro (latest)",
|
|
9
|
+
"reasoning": true,
|
|
10
|
+
"inputModalities": [
|
|
11
|
+
"text"
|
|
12
|
+
],
|
|
13
|
+
"efforts": [
|
|
14
|
+
"high",
|
|
15
|
+
"max"
|
|
16
|
+
],
|
|
17
|
+
"context": 1000000,
|
|
18
|
+
"maxOutput": 384000
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": "deepseek/deepseek-v4-flash",
|
|
22
|
+
"name": "DeepSeek V4 Flash (latest)",
|
|
23
|
+
"reasoning": true,
|
|
24
|
+
"inputModalities": [
|
|
25
|
+
"text"
|
|
26
|
+
],
|
|
27
|
+
"efforts": [
|
|
28
|
+
"high",
|
|
29
|
+
"max"
|
|
30
|
+
],
|
|
31
|
+
"context": 1000000,
|
|
32
|
+
"maxOutput": 384000
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "deepseek/deepseek-v4-flash-vision-exp",
|
|
36
|
+
"name": "DeepSeek V4 Flash Vision (exp)",
|
|
37
|
+
"reasoning": true,
|
|
38
|
+
"inputModalities": [
|
|
39
|
+
"text",
|
|
40
|
+
"image"
|
|
41
|
+
],
|
|
42
|
+
"efforts": [
|
|
43
|
+
"high",
|
|
44
|
+
"max"
|
|
45
|
+
],
|
|
46
|
+
"context": 1000000,
|
|
47
|
+
"maxOutput": 384000
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "deepseek/deepseek-v4-flash-fast",
|
|
51
|
+
"name": "DeepSeek V4 Flash Fast",
|
|
52
|
+
"reasoning": true,
|
|
53
|
+
"inputModalities": [
|
|
54
|
+
"text"
|
|
55
|
+
],
|
|
56
|
+
"efforts": [
|
|
57
|
+
"low",
|
|
58
|
+
"high",
|
|
59
|
+
"max"
|
|
60
|
+
],
|
|
61
|
+
"context": 1000000,
|
|
62
|
+
"maxOutput": 32000
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"id": "moonshotai/Kimi-K3",
|
|
66
|
+
"name": "Kimi K3",
|
|
67
|
+
"reasoning": true,
|
|
68
|
+
"inputModalities": [
|
|
69
|
+
"text",
|
|
70
|
+
"image"
|
|
71
|
+
],
|
|
72
|
+
"efforts": [
|
|
73
|
+
"low",
|
|
74
|
+
"high",
|
|
75
|
+
"max"
|
|
76
|
+
],
|
|
77
|
+
"context": 1000000,
|
|
78
|
+
"maxOutput": 131072
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"id": "moonshotai/Kimi-K2.7-Code",
|
|
82
|
+
"name": "Kimi K2.7 Code",
|
|
83
|
+
"reasoning": true,
|
|
84
|
+
"inputModalities": [
|
|
85
|
+
"text",
|
|
86
|
+
"image"
|
|
87
|
+
],
|
|
88
|
+
"context": 256000,
|
|
89
|
+
"maxOutput": 262144
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"id": "moonshotai/Kimi-K2.7-Code-Highspeed",
|
|
93
|
+
"name": "Kimi K2.7 Code HighSpeed",
|
|
94
|
+
"reasoning": true,
|
|
95
|
+
"inputModalities": [
|
|
96
|
+
"text",
|
|
97
|
+
"image"
|
|
98
|
+
],
|
|
99
|
+
"context": 262000,
|
|
100
|
+
"maxOutput": 262144
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"id": "moonshotai/Kimi-K2.6",
|
|
104
|
+
"name": "Kimi K2.6",
|
|
105
|
+
"reasoning": false,
|
|
106
|
+
"inputModalities": [
|
|
107
|
+
"text",
|
|
108
|
+
"image"
|
|
109
|
+
],
|
|
110
|
+
"context": 256000,
|
|
111
|
+
"maxOutput": 262144
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"id": "moonshotai/Kimi-K2.5",
|
|
115
|
+
"name": "Kimi K2.5",
|
|
116
|
+
"reasoning": false,
|
|
117
|
+
"inputModalities": [
|
|
118
|
+
"text",
|
|
119
|
+
"image"
|
|
120
|
+
],
|
|
121
|
+
"context": 256000,
|
|
122
|
+
"maxOutput": 262144
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"id": "z-ai/glm-5.3-flash",
|
|
126
|
+
"name": "GLM-5.3 Flash",
|
|
127
|
+
"reasoning": true,
|
|
128
|
+
"inputModalities": [
|
|
129
|
+
"text",
|
|
130
|
+
"image"
|
|
131
|
+
],
|
|
132
|
+
"efforts": [
|
|
133
|
+
"low",
|
|
134
|
+
"high",
|
|
135
|
+
"max"
|
|
136
|
+
],
|
|
137
|
+
"context": 1048576,
|
|
138
|
+
"maxOutput": 131072
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"id": "zai-org/GLM-5.3",
|
|
142
|
+
"name": "GLM-5.3",
|
|
143
|
+
"reasoning": true,
|
|
144
|
+
"inputModalities": [
|
|
145
|
+
"text"
|
|
146
|
+
],
|
|
147
|
+
"efforts": [
|
|
148
|
+
"low",
|
|
149
|
+
"high",
|
|
150
|
+
"max"
|
|
151
|
+
],
|
|
152
|
+
"context": 1000000,
|
|
153
|
+
"maxOutput": 131072
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"id": "zai-org/GLM-5.2",
|
|
157
|
+
"name": "GLM-5.2",
|
|
158
|
+
"reasoning": true,
|
|
159
|
+
"inputModalities": [
|
|
160
|
+
"text"
|
|
161
|
+
],
|
|
162
|
+
"efforts": [
|
|
163
|
+
"high",
|
|
164
|
+
"max"
|
|
165
|
+
],
|
|
166
|
+
"context": 1000000,
|
|
167
|
+
"maxOutput": 131072
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"id": "zai-org/GLM-5.2-Fast",
|
|
171
|
+
"name": "GLM-5.2 Fast",
|
|
172
|
+
"reasoning": false,
|
|
173
|
+
"inputModalities": [
|
|
174
|
+
"text"
|
|
175
|
+
],
|
|
176
|
+
"context": 1000000,
|
|
177
|
+
"maxOutput": 131072
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"id": "zai-org/GLM-5.1",
|
|
181
|
+
"name": "GLM-5.1",
|
|
182
|
+
"reasoning": false,
|
|
183
|
+
"inputModalities": [
|
|
184
|
+
"text"
|
|
185
|
+
],
|
|
186
|
+
"context": 200000,
|
|
187
|
+
"maxOutput": 131072
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"id": "zai-org/GLM-5",
|
|
191
|
+
"name": "GLM-5",
|
|
192
|
+
"reasoning": false,
|
|
193
|
+
"inputModalities": [
|
|
194
|
+
"text"
|
|
195
|
+
],
|
|
196
|
+
"context": 200000,
|
|
197
|
+
"maxOutput": 131072
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"id": "MiniMaxAI/MiniMax-M3",
|
|
201
|
+
"name": "MiniMax M3",
|
|
202
|
+
"reasoning": true,
|
|
203
|
+
"inputModalities": [
|
|
204
|
+
"text",
|
|
205
|
+
"image"
|
|
206
|
+
],
|
|
207
|
+
"context": 1000000,
|
|
208
|
+
"maxOutput": 512000
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"id": "MiniMaxAI/MiniMax-M2.7",
|
|
212
|
+
"name": "MiniMax M2.7",
|
|
213
|
+
"reasoning": false,
|
|
214
|
+
"inputModalities": [
|
|
215
|
+
"text"
|
|
216
|
+
],
|
|
217
|
+
"context": 200000,
|
|
218
|
+
"maxOutput": 131072
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"id": "MiniMaxAI/MiniMax-M2.5",
|
|
222
|
+
"name": "MiniMax M2.5",
|
|
223
|
+
"reasoning": false,
|
|
224
|
+
"inputModalities": [
|
|
225
|
+
"text"
|
|
226
|
+
],
|
|
227
|
+
"context": 200000,
|
|
228
|
+
"maxOutput": 131072
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"id": "xiaomi/mimo-v2.5-pro",
|
|
232
|
+
"name": "MiMo V2.5 Pro",
|
|
233
|
+
"reasoning": false,
|
|
234
|
+
"inputModalities": [
|
|
235
|
+
"text"
|
|
236
|
+
],
|
|
237
|
+
"context": 1000000,
|
|
238
|
+
"maxOutput": 131072
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"id": "xiaomi/mimo-v2.5",
|
|
242
|
+
"name": "MiMo V2.5",
|
|
243
|
+
"reasoning": false,
|
|
244
|
+
"inputModalities": [
|
|
245
|
+
"text",
|
|
246
|
+
"image"
|
|
247
|
+
],
|
|
248
|
+
"context": 1000000,
|
|
249
|
+
"maxOutput": 131072
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"id": "Qwen/Qwen3.8-Max-0902",
|
|
253
|
+
"name": "Qwen 3.8 Max 0902",
|
|
254
|
+
"reasoning": true,
|
|
255
|
+
"inputModalities": [
|
|
256
|
+
"text",
|
|
257
|
+
"image"
|
|
258
|
+
],
|
|
259
|
+
"efforts": [
|
|
260
|
+
"low",
|
|
261
|
+
"medium",
|
|
262
|
+
"xhigh"
|
|
263
|
+
],
|
|
264
|
+
"context": 1000000,
|
|
265
|
+
"maxOutput": 32768
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"id": "Qwen/Qwen3.8-Max",
|
|
269
|
+
"name": "Qwen 3.8 Max",
|
|
270
|
+
"reasoning": true,
|
|
271
|
+
"inputModalities": [
|
|
272
|
+
"text",
|
|
273
|
+
"image"
|
|
274
|
+
],
|
|
275
|
+
"efforts": [
|
|
276
|
+
"low",
|
|
277
|
+
"medium",
|
|
278
|
+
"xhigh"
|
|
279
|
+
],
|
|
280
|
+
"context": 1000000,
|
|
281
|
+
"maxOutput": 32768
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"id": "Qwen/Qwen3.8-27B",
|
|
285
|
+
"name": "Qwen 3.8 27B",
|
|
286
|
+
"reasoning": true,
|
|
287
|
+
"inputModalities": [
|
|
288
|
+
"text",
|
|
289
|
+
"image"
|
|
290
|
+
],
|
|
291
|
+
"efforts": [
|
|
292
|
+
"low",
|
|
293
|
+
"medium",
|
|
294
|
+
"xhigh"
|
|
295
|
+
],
|
|
296
|
+
"context": 262144,
|
|
297
|
+
"maxOutput": 32768
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"id": "Qwen/Qwen3.8-Flash",
|
|
301
|
+
"name": "Qwen 3.8 Flash",
|
|
302
|
+
"reasoning": true,
|
|
303
|
+
"inputModalities": [
|
|
304
|
+
"text",
|
|
305
|
+
"image"
|
|
306
|
+
],
|
|
307
|
+
"efforts": [
|
|
308
|
+
"low",
|
|
309
|
+
"medium",
|
|
310
|
+
"xhigh"
|
|
311
|
+
],
|
|
312
|
+
"context": 1000000,
|
|
313
|
+
"maxOutput": 32768
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"id": "Qwen/Qwen3.7-Max",
|
|
317
|
+
"name": "Qwen 3.7 Max",
|
|
318
|
+
"reasoning": true,
|
|
319
|
+
"inputModalities": [
|
|
320
|
+
"text"
|
|
321
|
+
],
|
|
322
|
+
"context": 1000000,
|
|
323
|
+
"maxOutput": 32768
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"id": "Qwen/Qwen3.7-Plus",
|
|
327
|
+
"name": "Qwen 3.7 Plus",
|
|
328
|
+
"reasoning": true,
|
|
329
|
+
"inputModalities": [
|
|
330
|
+
"text",
|
|
331
|
+
"image"
|
|
332
|
+
],
|
|
333
|
+
"context": 1000000,
|
|
334
|
+
"maxOutput": 32768
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"id": "Qwen/Qwen3.7-Flash",
|
|
338
|
+
"name": "Qwen 3.7 Flash",
|
|
339
|
+
"reasoning": true,
|
|
340
|
+
"inputModalities": [
|
|
341
|
+
"text",
|
|
342
|
+
"image"
|
|
343
|
+
],
|
|
344
|
+
"context": 1000000,
|
|
345
|
+
"maxOutput": 32768
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"id": "Qwen/Qwen3.6-Max-Preview",
|
|
349
|
+
"name": "Qwen 3.6 Max Preview",
|
|
350
|
+
"reasoning": true,
|
|
351
|
+
"inputModalities": [
|
|
352
|
+
"text"
|
|
353
|
+
],
|
|
354
|
+
"context": 1000000,
|
|
355
|
+
"maxOutput": 32768
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"id": "Qwen/Qwen3.6-Plus",
|
|
359
|
+
"name": "Qwen 3.6 Plus",
|
|
360
|
+
"reasoning": true,
|
|
361
|
+
"inputModalities": [
|
|
362
|
+
"text",
|
|
363
|
+
"image"
|
|
364
|
+
],
|
|
365
|
+
"context": 1000000,
|
|
366
|
+
"maxOutput": 32768
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"id": "meituan/LongCat-2.0:free",
|
|
370
|
+
"name": "LongCat 2.0",
|
|
371
|
+
"reasoning": true,
|
|
372
|
+
"inputModalities": [
|
|
373
|
+
"text"
|
|
374
|
+
],
|
|
375
|
+
"context": 1048576,
|
|
376
|
+
"maxOutput": 32000
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"id": "stepfun/Step-3.7-Flash",
|
|
380
|
+
"name": "Step 3.7 Flash",
|
|
381
|
+
"reasoning": true,
|
|
382
|
+
"inputModalities": [
|
|
383
|
+
"text",
|
|
384
|
+
"image"
|
|
385
|
+
],
|
|
386
|
+
"context": 256000,
|
|
387
|
+
"maxOutput": 256000
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"id": "stepfun/Step-3.5-Flash",
|
|
391
|
+
"name": "Step 3.5 Flash",
|
|
392
|
+
"reasoning": true,
|
|
393
|
+
"inputModalities": [
|
|
394
|
+
"text"
|
|
395
|
+
],
|
|
396
|
+
"context": 1000000,
|
|
397
|
+
"maxOutput": 256000
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"id": "tencent/hy3-paid",
|
|
401
|
+
"name": "Tencent Hy3",
|
|
402
|
+
"reasoning": true,
|
|
403
|
+
"inputModalities": [
|
|
404
|
+
"text"
|
|
405
|
+
],
|
|
406
|
+
"context": 262144,
|
|
407
|
+
"maxOutput": 32000
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"id": "tencent/hy4-preview",
|
|
411
|
+
"name": "Tencent Hy4 Preview",
|
|
412
|
+
"reasoning": true,
|
|
413
|
+
"inputModalities": [
|
|
414
|
+
"text"
|
|
415
|
+
],
|
|
416
|
+
"efforts": [
|
|
417
|
+
"low",
|
|
418
|
+
"medium",
|
|
419
|
+
"high"
|
|
420
|
+
],
|
|
421
|
+
"context": 1048576,
|
|
422
|
+
"maxOutput": 64000
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
"id": "nvidia/nemotron-3-ultra-550b-a55b",
|
|
426
|
+
"name": "Nemotron 3 Ultra",
|
|
427
|
+
"reasoning": true,
|
|
428
|
+
"inputModalities": [
|
|
429
|
+
"text"
|
|
430
|
+
],
|
|
431
|
+
"context": 1000000,
|
|
432
|
+
"maxOutput": 65536
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
"id": "thinkingmachines/inkling",
|
|
436
|
+
"name": "Inkling",
|
|
437
|
+
"reasoning": true,
|
|
438
|
+
"inputModalities": [
|
|
439
|
+
"text",
|
|
440
|
+
"image"
|
|
441
|
+
],
|
|
442
|
+
"context": 256000,
|
|
443
|
+
"maxOutput": 65536
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"id": "thinkingmachines/inkling-small",
|
|
447
|
+
"name": "Inkling Small",
|
|
448
|
+
"reasoning": true,
|
|
449
|
+
"inputModalities": [
|
|
450
|
+
"text",
|
|
451
|
+
"image"
|
|
452
|
+
],
|
|
453
|
+
"context": 1000000,
|
|
454
|
+
"maxOutput": 32768
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"id": "poolside/laguna-s-2.1-free",
|
|
458
|
+
"name": "Laguna S 2.1",
|
|
459
|
+
"reasoning": true,
|
|
460
|
+
"inputModalities": [
|
|
461
|
+
"text"
|
|
462
|
+
],
|
|
463
|
+
"context": 256000,
|
|
464
|
+
"maxOutput": 32768
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
"id": "gpt-5.6-luna",
|
|
468
|
+
"name": "GPT-5.6 Luna",
|
|
469
|
+
"reasoning": true,
|
|
470
|
+
"inputModalities": [
|
|
471
|
+
"text",
|
|
472
|
+
"image"
|
|
473
|
+
],
|
|
474
|
+
"efforts": [
|
|
475
|
+
"low",
|
|
476
|
+
"medium",
|
|
477
|
+
"high",
|
|
478
|
+
"xhigh",
|
|
479
|
+
"max"
|
|
480
|
+
],
|
|
481
|
+
"context": 1050000,
|
|
482
|
+
"maxOutput": 128000
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"id": "meta/muse-spark-1.2-contributor",
|
|
486
|
+
"name": "Muse Spark 1.2 Contributor",
|
|
487
|
+
"reasoning": true,
|
|
488
|
+
"inputModalities": [
|
|
489
|
+
"text",
|
|
490
|
+
"image"
|
|
491
|
+
],
|
|
492
|
+
"efforts": [
|
|
493
|
+
"low",
|
|
494
|
+
"medium",
|
|
495
|
+
"high",
|
|
496
|
+
"xhigh"
|
|
497
|
+
],
|
|
498
|
+
"context": 1048576,
|
|
499
|
+
"maxOutput": 131072
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
"id": "meta/muse-spark-1.3-contributor",
|
|
503
|
+
"name": "Muse Spark 1.3 Contributor",
|
|
504
|
+
"reasoning": true,
|
|
505
|
+
"inputModalities": [
|
|
506
|
+
"text",
|
|
507
|
+
"image"
|
|
508
|
+
],
|
|
509
|
+
"efforts": [
|
|
510
|
+
"low",
|
|
511
|
+
"medium",
|
|
512
|
+
"high",
|
|
513
|
+
"xhigh"
|
|
514
|
+
],
|
|
515
|
+
"context": 1048576,
|
|
516
|
+
"maxOutput": 131072
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
"id": "xai/grok-4.5",
|
|
520
|
+
"name": "Grok 4.5",
|
|
521
|
+
"reasoning": true,
|
|
522
|
+
"inputModalities": [
|
|
523
|
+
"text",
|
|
524
|
+
"image"
|
|
525
|
+
],
|
|
526
|
+
"efforts": [
|
|
527
|
+
"low",
|
|
528
|
+
"medium",
|
|
529
|
+
"high"
|
|
530
|
+
],
|
|
531
|
+
"context": 500000,
|
|
532
|
+
"maxOutput": 500000
|
|
533
|
+
}
|
|
534
|
+
]
|
|
535
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* modelsUrls 覆盖解析(契约:docs/spec/model-pipeline.md §1.3 覆盖机制条款 +
|
|
3
|
+
* docs/research/models-url-override.md §4 定案)。
|
|
4
|
+
*
|
|
5
|
+
* 三通道优先级 config > env > 默认列表,语义为**整列表替换**——解析结果完整取代
|
|
6
|
+
* 内置列表,不拼接不插位;包内快照不占列表位(快照兜底归 pipeline 的降级层,
|
|
7
|
+
* 不经本函数)。非法值逐项校验:可解析且 http/https 的绝对 URL,非法项丢弃 +
|
|
8
|
+
* 逐项 warn;值为非数组/非字符串或合法项为零时整体回退默认列表 + warn(config
|
|
9
|
+
* 非法 → 试 env → 仍非法 → 默认,每级 warn)。任何路径不抛错、不阻断启动。
|
|
10
|
+
*
|
|
11
|
+
* 本函数为纯解析:`config` / `env` 以参数注入直测(models-url-override.md §3.2
|
|
12
|
+
* 纪律——测试不使用 COMMANDCODE_MODELS_URLS 变量本身,保证「变量存在 ≠ 测试后门」);
|
|
13
|
+
* 生产侧由 pipeline 构造时传入 `process.env.COMMANDCODE_MODELS_URLS` 原值。
|
|
14
|
+
*/
|
|
15
|
+
/** 内置默认 URL 列表(ADR 0001:Release → npmmirror files → unpkg → raw data 分支) */
|
|
16
|
+
export declare const DEFAULT_MODELS_URLS: readonly string[];
|
|
17
|
+
/** 统一环境变量兜底通道(逗号分隔;用户配置面,非测试通道) */
|
|
18
|
+
export declare const MODELS_URLS_ENV_VAR = "COMMANDCODE_MODELS_URLS";
|
|
19
|
+
/** 解析结果来源:命中哪个通道 */
|
|
20
|
+
export type ModelsUrlsSource = "config" | "env" | "default";
|
|
21
|
+
/** 结构上与 disguise 的 DisguiseLogger 同形;有意不跨模块共享类型——models 对
|
|
22
|
+
* disguise 保持零依赖,glue 注入同一个适配器即可同时满足两边 */
|
|
23
|
+
export interface ModelsUrlsLogger {
|
|
24
|
+
debug(message: string): void;
|
|
25
|
+
warn(message: string): void;
|
|
26
|
+
}
|
|
27
|
+
export interface ResolvedModelsUrls {
|
|
28
|
+
readonly urls: readonly string[];
|
|
29
|
+
readonly source: ModelsUrlsSource;
|
|
30
|
+
}
|
|
31
|
+
export interface ResolveModelsUrlsInput {
|
|
32
|
+
/** config 通道原样值:v1 工厂 options.modelsUrls / v2 settings 透传的顶层键,未解析 */
|
|
33
|
+
readonly config?: unknown;
|
|
34
|
+
/** env 通道原值(process.env[MODELS_URLS_ENV_VAR]);undefined = 未设置,空串视为未配置 */
|
|
35
|
+
readonly env?: string | undefined;
|
|
36
|
+
readonly logger: ModelsUrlsLogger;
|
|
37
|
+
}
|
|
38
|
+
/** 解析 modelsUrls:绝不抛错,任何非法输入都落到某个可用列表上 */
|
|
39
|
+
export declare function resolveModelsUrls(input: ResolveModelsUrlsInput): ResolvedModelsUrls;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* modelsUrls 覆盖解析(契约:docs/spec/model-pipeline.md §1.3 覆盖机制条款 +
|
|
3
|
+
* docs/research/models-url-override.md §4 定案)。
|
|
4
|
+
*
|
|
5
|
+
* 三通道优先级 config > env > 默认列表,语义为**整列表替换**——解析结果完整取代
|
|
6
|
+
* 内置列表,不拼接不插位;包内快照不占列表位(快照兜底归 pipeline 的降级层,
|
|
7
|
+
* 不经本函数)。非法值逐项校验:可解析且 http/https 的绝对 URL,非法项丢弃 +
|
|
8
|
+
* 逐项 warn;值为非数组/非字符串或合法项为零时整体回退默认列表 + warn(config
|
|
9
|
+
* 非法 → 试 env → 仍非法 → 默认,每级 warn)。任何路径不抛错、不阻断启动。
|
|
10
|
+
*
|
|
11
|
+
* 本函数为纯解析:`config` / `env` 以参数注入直测(models-url-override.md §3.2
|
|
12
|
+
* 纪律——测试不使用 COMMANDCODE_MODELS_URLS 变量本身,保证「变量存在 ≠ 测试后门」);
|
|
13
|
+
* 生产侧由 pipeline 构造时传入 `process.env.COMMANDCODE_MODELS_URLS` 原值。
|
|
14
|
+
*/
|
|
15
|
+
/** 内置默认 URL 列表(ADR 0001:Release → npmmirror files → unpkg → raw data 分支) */
|
|
16
|
+
export const DEFAULT_MODELS_URLS = [
|
|
17
|
+
"https://github.com/WallBreakerNO4/opencode-commandcode-provider/releases/latest/download/models.json",
|
|
18
|
+
"https://registry.npmmirror.com/@wallbreakerno4/opencode-commandcode-models/latest/files/models.json",
|
|
19
|
+
"https://unpkg.com/@wallbreakerno4/opencode-commandcode-models@latest/models.json",
|
|
20
|
+
"https://raw.githubusercontent.com/WallBreakerNO4/opencode-commandcode-provider/data/models.json",
|
|
21
|
+
];
|
|
22
|
+
/** 统一环境变量兜底通道(逗号分隔;用户配置面,非测试通道) */
|
|
23
|
+
export const MODELS_URLS_ENV_VAR = "COMMANDCODE_MODELS_URLS";
|
|
24
|
+
/** 解析 modelsUrls:绝不抛错,任何非法输入都落到某个可用列表上 */
|
|
25
|
+
export function resolveModelsUrls(input) {
|
|
26
|
+
const configParsed = parseUrlList(input.config, input.logger);
|
|
27
|
+
if (configParsed !== null) {
|
|
28
|
+
input.logger.debug(`modelsUrls 生效来源=config,URL 列表:[${configParsed.join(",")}]`);
|
|
29
|
+
return { urls: configParsed, source: "config" };
|
|
30
|
+
}
|
|
31
|
+
// env 未设置/空串静默跳过(视为未配置);设了但整体非法才 warn 并逐级回退
|
|
32
|
+
const envValue = input.env?.trim();
|
|
33
|
+
if (envValue !== undefined && envValue.length > 0) {
|
|
34
|
+
const envParsed = parseUrlList(envValue, input.logger);
|
|
35
|
+
if (envParsed !== null) {
|
|
36
|
+
input.logger.debug(`modelsUrls 生效来源=env,URL 列表:[${envParsed.join(",")}]`);
|
|
37
|
+
return { urls: envParsed, source: "env" };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
input.logger.debug(`modelsUrls 生效来源=default,URL 列表:[${DEFAULT_MODELS_URLS.join(",")}]`);
|
|
41
|
+
return { urls: DEFAULT_MODELS_URLS, source: "default" };
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 单通道值解析:数组或逗号分隔字符串 → 合法 URL 列表。
|
|
45
|
+
* 逐项校验,非法项丢弃 + 逐项 warn;整体非法(非数组/非字符串、合法项为零)
|
|
46
|
+
* warn 一次并返回 null(调用方逐级回退)。
|
|
47
|
+
* 返回 null 只代表「该通道整体不可用」——通道内仍有合法项时不回退(逐项丢弃 ≠ 整体回退)。
|
|
48
|
+
*/
|
|
49
|
+
function parseUrlList(value, logger) {
|
|
50
|
+
if (value === undefined)
|
|
51
|
+
return null;
|
|
52
|
+
// 逗号分隔字符串先滤掉空段再进循环:"a,,b"、尾逗号是格式噪音,静默跳过;
|
|
53
|
+
// 数组不经预滤——显式写出的空串/空格串是用户笔误,照常 warn
|
|
54
|
+
const rawItems = typeof value === "string"
|
|
55
|
+
? value.split(",").filter((segment) => segment.trim().length > 0)
|
|
56
|
+
: Array.isArray(value)
|
|
57
|
+
? value
|
|
58
|
+
: null;
|
|
59
|
+
if (rawItems === null) {
|
|
60
|
+
logger.warn(`modelsUrls 值非法(${preview(value)}):须为 URL 数组或逗号分隔字符串,回退内置默认列表`);
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
const urls = [];
|
|
64
|
+
for (const [index, raw] of rawItems.entries()) {
|
|
65
|
+
const item = typeof raw === "string" ? raw.trim() : undefined;
|
|
66
|
+
if (item === undefined || item.length === 0) {
|
|
67
|
+
logger.warn(`modelsUrls[${index}] 非法项已丢弃(${preview(raw)}):须为 http(s) 绝对 URL 字符串`);
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (!isHttpUrl(item)) {
|
|
71
|
+
logger.warn(`modelsUrls[${index}] 非法项已丢弃:「${item}」:须为 http(s) 绝对 URL`);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
urls.push(item);
|
|
75
|
+
}
|
|
76
|
+
if (urls.length === 0) {
|
|
77
|
+
logger.warn(`modelsUrls 值非法(${preview(value)}):合法项为零,回退内置默认列表`);
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
return urls;
|
|
81
|
+
}
|
|
82
|
+
/** http/https 绝对 URL 校验(§1.3:可解析且协议为 http:/https:) */
|
|
83
|
+
function isHttpUrl(item) {
|
|
84
|
+
try {
|
|
85
|
+
const url = new URL(item);
|
|
86
|
+
return url.protocol === "http:" || url.protocol === "https:";
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/** 原值预览:warn 里注明被回退的原始值(截断防日志爆炸) */
|
|
93
|
+
function preview(value) {
|
|
94
|
+
const text = typeof value === "string" ? value : JSON.stringify(value) ?? String(value);
|
|
95
|
+
return text.length > 80 ? `${text.slice(0, 80)}…` : text;
|
|
96
|
+
}
|