@wrongstack/cli 1.0.32 → 1.0.33
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/data/providers.json +322 -2
- package/dist/auto-discover-providers-JX346GOM.js +7 -0
- package/dist/{chunk-LIZXJHZQ.js → chunk-24C6VVLM.js} +4 -4
- package/dist/{chunk-CFHWIFXL.js → chunk-PA4VBCXS.js} +25 -33
- package/dist/{chunk-WXJH4F6K.js → chunk-SWOPJHXI.js} +2 -2
- package/dist/{cli-context-ITHGP2CE.js → cli-context-7HK67B2Z.js} +4 -4
- package/dist/index.js +2 -2
- package/dist/{modeldiag-PQILD7TN.js → modeldiag-NEPTLFZW.js} +2 -2
- package/dist/{providers-models-W57I3QOA.js → providers-models-O75MKLN2.js} +51 -17
- package/dist/{short-circuit-flags-6LB3EGF7.js → short-circuit-flags-D6VAG47Y.js} +2 -2
- package/dist/{subcommands-QO7VYTSS.js → subcommands-CLI6QTLU.js} +2 -2
- package/package.json +30 -30
- package/dist/auto-discover-providers-QIL34K3U.js +0 -7
package/data/providers.json
CHANGED
|
@@ -4,14 +4,334 @@
|
|
|
4
4
|
"name": "OpenAI Codex (ChatGPT sign-in)",
|
|
5
5
|
"doc": "https://developers.openai.com/codex/models",
|
|
6
6
|
"models": {
|
|
7
|
-
"gpt-6.1-sol": {
|
|
7
|
+
"gpt-6.1-sol": {
|
|
8
|
+
"id": "gpt-6.1-sol",
|
|
9
|
+
"name": "GPT-6.1-Sol",
|
|
10
|
+
"description": "Latest workhorse model for coding and everyday work.",
|
|
11
|
+
"release_date": "2026-09-29",
|
|
12
|
+
"knowledge": "2026-04-30",
|
|
13
|
+
"reasoning": true,
|
|
14
|
+
"reasoning_options": [
|
|
15
|
+
{
|
|
16
|
+
"type": "effort",
|
|
17
|
+
"values": ["low", "medium", "high", "xhigh", "max"]
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"tool_call": true,
|
|
21
|
+
"modalities": {
|
|
22
|
+
"input": ["text", "image"],
|
|
23
|
+
"output": ["text"]
|
|
24
|
+
},
|
|
25
|
+
"limit": {
|
|
26
|
+
"context": 872000,
|
|
27
|
+
"output": 128000
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"gpt-6-astra": {
|
|
31
|
+
"id": "gpt-6-astra",
|
|
32
|
+
"name": "GPT-6-Astra",
|
|
33
|
+
"description": "Frontier intelligence for the most demanding work.",
|
|
34
|
+
"release_date": "2026-09-04",
|
|
35
|
+
"knowledge": "2026-04-30",
|
|
36
|
+
"reasoning": true,
|
|
37
|
+
"reasoning_options": [
|
|
38
|
+
{
|
|
39
|
+
"type": "effort",
|
|
40
|
+
"values": ["low", "medium", "high", "xhigh", "max"]
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"tool_call": true,
|
|
44
|
+
"modalities": {
|
|
45
|
+
"input": ["text", "image"],
|
|
46
|
+
"output": ["text"]
|
|
47
|
+
},
|
|
48
|
+
"limit": {
|
|
49
|
+
"context": 872000,
|
|
50
|
+
"output": 128000
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"gpt-6-sol": {
|
|
54
|
+
"id": "gpt-6-sol",
|
|
55
|
+
"name": "GPT-6-Sol",
|
|
56
|
+
"description": "Previous generation workhorse model.",
|
|
57
|
+
"release_date": "2026-09-22",
|
|
58
|
+
"knowledge": "2026-04-20",
|
|
59
|
+
"reasoning": true,
|
|
60
|
+
"reasoning_options": [
|
|
61
|
+
{
|
|
62
|
+
"type": "effort",
|
|
63
|
+
"values": ["low", "medium", "high", "xhigh", "max"]
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"tool_call": true,
|
|
67
|
+
"modalities": {
|
|
68
|
+
"input": ["text", "image"],
|
|
69
|
+
"output": ["text"]
|
|
70
|
+
},
|
|
71
|
+
"limit": {
|
|
72
|
+
"context": 872000,
|
|
73
|
+
"output": 128000
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"gpt-6-luna": {
|
|
77
|
+
"id": "gpt-6-luna",
|
|
78
|
+
"name": "GPT-6-Luna",
|
|
79
|
+
"description": "Fast and affordable model for easier tasks.",
|
|
80
|
+
"release_date": "2026-09-22",
|
|
81
|
+
"knowledge": "2026-05-18",
|
|
82
|
+
"reasoning": true,
|
|
83
|
+
"reasoning_options": [
|
|
84
|
+
{
|
|
85
|
+
"type": "effort",
|
|
86
|
+
"values": ["low", "medium", "high", "xhigh", "max"]
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"tool_call": true,
|
|
90
|
+
"modalities": {
|
|
91
|
+
"input": ["text", "image"],
|
|
92
|
+
"output": ["text"]
|
|
93
|
+
},
|
|
94
|
+
"limit": {
|
|
95
|
+
"context": 872000,
|
|
96
|
+
"output": 128000
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"gpt-5.6-sol": {
|
|
100
|
+
"id": "gpt-5.6-sol",
|
|
101
|
+
"name": "GPT-5.6-Sol",
|
|
102
|
+
"description": "Older generation workhorse model.",
|
|
103
|
+
"release_date": "2026-07-09",
|
|
104
|
+
"knowledge": "2026-02-16",
|
|
105
|
+
"reasoning": true,
|
|
106
|
+
"reasoning_options": [
|
|
107
|
+
{
|
|
108
|
+
"type": "effort",
|
|
109
|
+
"values": ["low", "medium", "high", "xhigh", "max"]
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"tool_call": true,
|
|
113
|
+
"modalities": {
|
|
114
|
+
"input": ["text", "image"],
|
|
115
|
+
"output": ["text"]
|
|
116
|
+
},
|
|
117
|
+
"limit": {
|
|
118
|
+
"context": 872000,
|
|
119
|
+
"output": 128000
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"gpt-5.6-terra": {
|
|
123
|
+
"id": "gpt-5.6-terra",
|
|
124
|
+
"name": "GPT-5.6-Terra",
|
|
125
|
+
"description": "Older balanced model for straightforward work.",
|
|
126
|
+
"release_date": "2026-07-09",
|
|
127
|
+
"knowledge": "2026-02-16",
|
|
128
|
+
"reasoning": true,
|
|
129
|
+
"reasoning_options": [
|
|
130
|
+
{
|
|
131
|
+
"type": "effort",
|
|
132
|
+
"values": ["low", "medium", "high", "xhigh", "max"]
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"tool_call": true,
|
|
136
|
+
"modalities": {
|
|
137
|
+
"input": ["text", "image"],
|
|
138
|
+
"output": ["text"]
|
|
139
|
+
},
|
|
140
|
+
"limit": {
|
|
141
|
+
"context": 872000,
|
|
142
|
+
"output": 128000
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"gpt-5.6-luna": {
|
|
146
|
+
"id": "gpt-5.6-luna",
|
|
147
|
+
"name": "GPT-5.6-Luna",
|
|
148
|
+
"description": "Older fast and efficient model.",
|
|
149
|
+
"release_date": "2026-07-09",
|
|
150
|
+
"knowledge": "2026-02-16",
|
|
151
|
+
"reasoning": true,
|
|
152
|
+
"reasoning_options": [
|
|
153
|
+
{
|
|
154
|
+
"type": "effort",
|
|
155
|
+
"values": ["low", "medium", "high", "xhigh", "max"]
|
|
156
|
+
}
|
|
157
|
+
],
|
|
158
|
+
"tool_call": true,
|
|
159
|
+
"modalities": {
|
|
160
|
+
"input": ["text", "image"],
|
|
161
|
+
"output": ["text"]
|
|
162
|
+
},
|
|
163
|
+
"limit": {
|
|
164
|
+
"context": 872000,
|
|
165
|
+
"output": 128000
|
|
166
|
+
}
|
|
167
|
+
}
|
|
8
168
|
}
|
|
9
169
|
},
|
|
10
170
|
"openai-chatgpt": {
|
|
11
171
|
"id": "openai-chatgpt",
|
|
12
172
|
"name": "OpenAI (ChatGPT plan)",
|
|
13
173
|
"models": {
|
|
14
|
-
"gpt-6.1-sol": {
|
|
174
|
+
"gpt-6.1-sol": {
|
|
175
|
+
"id": "gpt-6.1-sol",
|
|
176
|
+
"name": "GPT-6.1-Sol",
|
|
177
|
+
"description": "Latest workhorse model for coding and everyday work.",
|
|
178
|
+
"release_date": "2026-09-29",
|
|
179
|
+
"knowledge": "2026-04-30",
|
|
180
|
+
"reasoning": true,
|
|
181
|
+
"reasoning_options": [
|
|
182
|
+
{
|
|
183
|
+
"type": "effort",
|
|
184
|
+
"values": ["low", "medium", "high", "xhigh", "max"]
|
|
185
|
+
}
|
|
186
|
+
],
|
|
187
|
+
"tool_call": true,
|
|
188
|
+
"modalities": {
|
|
189
|
+
"input": ["text", "image"],
|
|
190
|
+
"output": ["text"]
|
|
191
|
+
},
|
|
192
|
+
"limit": {
|
|
193
|
+
"context": 872000,
|
|
194
|
+
"output": 128000
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
"gpt-6-astra": {
|
|
198
|
+
"id": "gpt-6-astra",
|
|
199
|
+
"name": "GPT-6-Astra",
|
|
200
|
+
"description": "Frontier intelligence for the most demanding work.",
|
|
201
|
+
"release_date": "2026-09-04",
|
|
202
|
+
"knowledge": "2026-04-30",
|
|
203
|
+
"reasoning": true,
|
|
204
|
+
"reasoning_options": [
|
|
205
|
+
{
|
|
206
|
+
"type": "effort",
|
|
207
|
+
"values": ["low", "medium", "high", "xhigh", "max"]
|
|
208
|
+
}
|
|
209
|
+
],
|
|
210
|
+
"tool_call": true,
|
|
211
|
+
"modalities": {
|
|
212
|
+
"input": ["text", "image"],
|
|
213
|
+
"output": ["text"]
|
|
214
|
+
},
|
|
215
|
+
"limit": {
|
|
216
|
+
"context": 872000,
|
|
217
|
+
"output": 128000
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"gpt-6-sol": {
|
|
221
|
+
"id": "gpt-6-sol",
|
|
222
|
+
"name": "GPT-6-Sol",
|
|
223
|
+
"description": "Previous generation workhorse model.",
|
|
224
|
+
"release_date": "2026-09-22",
|
|
225
|
+
"knowledge": "2026-04-20",
|
|
226
|
+
"reasoning": true,
|
|
227
|
+
"reasoning_options": [
|
|
228
|
+
{
|
|
229
|
+
"type": "effort",
|
|
230
|
+
"values": ["low", "medium", "high", "xhigh", "max"]
|
|
231
|
+
}
|
|
232
|
+
],
|
|
233
|
+
"tool_call": true,
|
|
234
|
+
"modalities": {
|
|
235
|
+
"input": ["text", "image"],
|
|
236
|
+
"output": ["text"]
|
|
237
|
+
},
|
|
238
|
+
"limit": {
|
|
239
|
+
"context": 872000,
|
|
240
|
+
"output": 128000
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"gpt-6-luna": {
|
|
244
|
+
"id": "gpt-6-luna",
|
|
245
|
+
"name": "GPT-6-Luna",
|
|
246
|
+
"description": "Fast and affordable model for easier tasks.",
|
|
247
|
+
"release_date": "2026-09-22",
|
|
248
|
+
"knowledge": "2026-05-18",
|
|
249
|
+
"reasoning": true,
|
|
250
|
+
"reasoning_options": [
|
|
251
|
+
{
|
|
252
|
+
"type": "effort",
|
|
253
|
+
"values": ["low", "medium", "high", "xhigh", "max"]
|
|
254
|
+
}
|
|
255
|
+
],
|
|
256
|
+
"tool_call": true,
|
|
257
|
+
"modalities": {
|
|
258
|
+
"input": ["text", "image"],
|
|
259
|
+
"output": ["text"]
|
|
260
|
+
},
|
|
261
|
+
"limit": {
|
|
262
|
+
"context": 872000,
|
|
263
|
+
"output": 128000
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
"gpt-5.6-sol": {
|
|
267
|
+
"id": "gpt-5.6-sol",
|
|
268
|
+
"name": "GPT-5.6-Sol",
|
|
269
|
+
"description": "Older generation workhorse model.",
|
|
270
|
+
"release_date": "2026-07-09",
|
|
271
|
+
"knowledge": "2026-02-16",
|
|
272
|
+
"reasoning": true,
|
|
273
|
+
"reasoning_options": [
|
|
274
|
+
{
|
|
275
|
+
"type": "effort",
|
|
276
|
+
"values": ["low", "medium", "high", "xhigh", "max"]
|
|
277
|
+
}
|
|
278
|
+
],
|
|
279
|
+
"tool_call": true,
|
|
280
|
+
"modalities": {
|
|
281
|
+
"input": ["text", "image"],
|
|
282
|
+
"output": ["text"]
|
|
283
|
+
},
|
|
284
|
+
"limit": {
|
|
285
|
+
"context": 872000,
|
|
286
|
+
"output": 128000
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
"gpt-5.6-terra": {
|
|
290
|
+
"id": "gpt-5.6-terra",
|
|
291
|
+
"name": "GPT-5.6-Terra",
|
|
292
|
+
"description": "Older balanced model for straightforward work.",
|
|
293
|
+
"release_date": "2026-07-09",
|
|
294
|
+
"knowledge": "2026-02-16",
|
|
295
|
+
"reasoning": true,
|
|
296
|
+
"reasoning_options": [
|
|
297
|
+
{
|
|
298
|
+
"type": "effort",
|
|
299
|
+
"values": ["low", "medium", "high", "xhigh", "max"]
|
|
300
|
+
}
|
|
301
|
+
],
|
|
302
|
+
"tool_call": true,
|
|
303
|
+
"modalities": {
|
|
304
|
+
"input": ["text", "image"],
|
|
305
|
+
"output": ["text"]
|
|
306
|
+
},
|
|
307
|
+
"limit": {
|
|
308
|
+
"context": 872000,
|
|
309
|
+
"output": 128000
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
"gpt-5.6-luna": {
|
|
313
|
+
"id": "gpt-5.6-luna",
|
|
314
|
+
"name": "GPT-5.6-Luna",
|
|
315
|
+
"description": "Older fast and efficient model.",
|
|
316
|
+
"release_date": "2026-07-09",
|
|
317
|
+
"knowledge": "2026-02-16",
|
|
318
|
+
"reasoning": true,
|
|
319
|
+
"reasoning_options": [
|
|
320
|
+
{
|
|
321
|
+
"type": "effort",
|
|
322
|
+
"values": ["low", "medium", "high", "xhigh", "max"]
|
|
323
|
+
}
|
|
324
|
+
],
|
|
325
|
+
"tool_call": true,
|
|
326
|
+
"modalities": {
|
|
327
|
+
"input": ["text", "image"],
|
|
328
|
+
"output": ["text"]
|
|
329
|
+
},
|
|
330
|
+
"limit": {
|
|
331
|
+
"context": 872000,
|
|
332
|
+
"output": 128000
|
|
333
|
+
}
|
|
334
|
+
}
|
|
15
335
|
}
|
|
16
336
|
},
|
|
17
337
|
"alibaba-token-plan": {
|
|
@@ -19,8 +19,8 @@ var loaders = {
|
|
|
19
19
|
skills: async () => (await import("./tools-skills-33AI6K6S.js")).skillsCmd,
|
|
20
20
|
"skill-suggest": async () => (await import("./skill-suggest-L2EVWB6R.js")).skillSuggestCmd,
|
|
21
21
|
typesafe: async () => (await import("./typesafe-NHC322W5.js")).typesafeCmd,
|
|
22
|
-
providers: async () => (await import("./providers-models-
|
|
23
|
-
models: async () => (await import("./providers-models-
|
|
22
|
+
providers: async () => (await import("./providers-models-O75MKLN2.js")).providersCmd,
|
|
23
|
+
models: async () => (await import("./providers-models-O75MKLN2.js")).modelsCmd,
|
|
24
24
|
mcp: async () => (await import("./mcp-LBS45HWZ.js")).mcpCmd,
|
|
25
25
|
plugin: async () => (await import("./plugin-usage-3TZGROK7.js")).pluginCmd,
|
|
26
26
|
plugins: async () => (await import("./plugin-usage-3TZGROK7.js")).pluginCmd,
|
|
@@ -32,7 +32,7 @@ var loaders = {
|
|
|
32
32
|
version: async () => (await import("./version-help-ATOKGMTK.js")).versionCmd,
|
|
33
33
|
help: async () => (await import("./version-help-ATOKGMTK.js")).helpCmd,
|
|
34
34
|
projects: async () => (await import("./projects-T4CZCA25.js")).projectsCmd,
|
|
35
|
-
modeldiag: async () => (await import("./modeldiag-
|
|
35
|
+
modeldiag: async () => (await import("./modeldiag-NEPTLFZW.js")).modeldiagCmd,
|
|
36
36
|
quick: async () => (await import("./quick-CNB4Z3HS.js")).quickCmd,
|
|
37
37
|
bench: async () => (await import("./bench-MMZHFHDL.js")).benchCmd,
|
|
38
38
|
chronicle: async () => (await import("./chronicle-PBJS7BN6.js")).chronicleCmd,
|
|
@@ -58,4 +58,4 @@ export {
|
|
|
58
58
|
subcommands,
|
|
59
59
|
subcommandNames
|
|
60
60
|
};
|
|
61
|
-
//# sourceMappingURL=chunk-
|
|
61
|
+
//# sourceMappingURL=chunk-24C6VVLM.js.map
|
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
// src/boot/auto-discover-providers.ts
|
|
3
3
|
import * as fs from "node:fs/promises";
|
|
4
4
|
import * as path from "node:path";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
discoverOpenAICompatibleModels,
|
|
7
|
+
discoveryOverlay,
|
|
8
|
+
pruneDiscoveryCache,
|
|
9
|
+
resolveDiscoveryTargets
|
|
10
|
+
} from "@wrongstack/providers";
|
|
6
11
|
async function readCache(file) {
|
|
7
12
|
try {
|
|
8
13
|
return JSON.parse(await fs.readFile(file, "utf8"));
|
|
@@ -25,12 +30,12 @@ async function discoverAndMergeProviders(opts) {
|
|
|
25
30
|
baseUrl,
|
|
26
31
|
apiKey,
|
|
27
32
|
modelDiscoveryPath,
|
|
28
|
-
modelDiscoveryAuthoritative,
|
|
29
33
|
accountCatalog,
|
|
30
34
|
copilotCatalog,
|
|
31
35
|
modelsUrl,
|
|
32
36
|
headers,
|
|
33
|
-
prepareApiKey
|
|
37
|
+
prepareApiKey,
|
|
38
|
+
inheritWireFamily
|
|
34
39
|
} = target;
|
|
35
40
|
let failureReason = "model catalog request failed";
|
|
36
41
|
const provider = await discoverOpenAICompatibleModels(id, {
|
|
@@ -42,6 +47,7 @@ async function discoverAndMergeProviders(opts) {
|
|
|
42
47
|
modelsUrl,
|
|
43
48
|
providerName: id,
|
|
44
49
|
modelDiscoveryPath,
|
|
50
|
+
inheritWireFamily,
|
|
45
51
|
fetchImpl: opts.fetchImpl,
|
|
46
52
|
prepareApiKey,
|
|
47
53
|
onFailure: (reason) => {
|
|
@@ -54,15 +60,10 @@ async function discoverAndMergeProviders(opts) {
|
|
|
54
60
|
if (accountCatalog) cfg.models = Object.keys(provider.models);
|
|
55
61
|
const fetchedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
56
62
|
cache[cacheKey] = { fetchedAt, provider };
|
|
63
|
+
pruneDiscoveryCache(cache, target);
|
|
57
64
|
cacheDirty = true;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{ [id]: provider },
|
|
61
|
-
{ observedAt: fetchedAt, authoritativeProviderIds: [id] }
|
|
62
|
-
);
|
|
63
|
-
} else {
|
|
64
|
-
opts.registry.mergeOverlay({ [id]: provider });
|
|
65
|
-
}
|
|
65
|
+
const merge = discoveryOverlay(target, provider, fetchedAt);
|
|
66
|
+
opts.registry.mergeOverlay(merge.payload, merge.options);
|
|
66
67
|
opts.logger?.info(
|
|
67
68
|
`auto-discovered ${Object.keys(provider.models).length} models for "${id}" from ${baseUrl}`
|
|
68
69
|
);
|
|
@@ -74,34 +75,25 @@ async function discoverAndMergeProviders(opts) {
|
|
|
74
75
|
cache[cacheKey] = cached;
|
|
75
76
|
cacheDirty = true;
|
|
76
77
|
}
|
|
78
|
+
if (pruneDiscoveryCache(cache, target)) cacheDirty = true;
|
|
77
79
|
if (accountCatalog) cfg.models = Object.keys(cached.provider.models);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
{ [id]: cached.provider },
|
|
81
|
-
{ observedAt: cached.fetchedAt, authoritativeProviderIds: [id] }
|
|
82
|
-
);
|
|
83
|
-
} else {
|
|
84
|
-
opts.registry.mergeOverlay({ [id]: cached.provider });
|
|
85
|
-
}
|
|
80
|
+
const merge = discoveryOverlay(target, cached.provider, cached.fetchedAt);
|
|
81
|
+
opts.registry.mergeOverlay(merge.payload, merge.options);
|
|
86
82
|
opts.logger?.warn(
|
|
87
83
|
`auto-discovery for "${id}" failed; using ${Object.keys(cached.provider.models).length} cached models from ${cached.fetchedAt} (${failureReason})`
|
|
88
84
|
);
|
|
89
85
|
} else {
|
|
90
86
|
if (accountCatalog) {
|
|
91
87
|
cfg.models = [];
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
{ authoritativeProviderIds: [id] }
|
|
104
|
-
);
|
|
88
|
+
const merge = discoveryOverlay(target, {
|
|
89
|
+
id,
|
|
90
|
+
name: id,
|
|
91
|
+
npm: "@ai-sdk/openai-compatible",
|
|
92
|
+
api: baseUrl,
|
|
93
|
+
env: [],
|
|
94
|
+
models: {}
|
|
95
|
+
});
|
|
96
|
+
opts.registry.mergeOverlay(merge.payload, merge.options);
|
|
105
97
|
}
|
|
106
98
|
opts.logger?.warn(
|
|
107
99
|
`auto-discovery for "${id}" failed and no cache available (${failureReason}; catalog at ${baseUrl})`
|
|
@@ -120,4 +112,4 @@ async function discoverAndMergeProviders(opts) {
|
|
|
120
112
|
export {
|
|
121
113
|
discoverAndMergeProviders
|
|
122
114
|
};
|
|
123
|
-
//# sourceMappingURL=chunk-
|
|
115
|
+
//# sourceMappingURL=chunk-PA4VBCXS.js.map
|
|
@@ -22,7 +22,7 @@ async function handleHelpVersionShortCircuit(argv) {
|
|
|
22
22
|
}
|
|
23
23
|
if (earlyFlags["help"] === true) {
|
|
24
24
|
if (positional.length > 0) {
|
|
25
|
-
const { subcommandNames } = await import("./subcommands-
|
|
25
|
+
const { subcommandNames } = await import("./subcommands-CLI6QTLU.js");
|
|
26
26
|
if (subcommandNames.includes(positional[0])) {
|
|
27
27
|
const first = positional[0];
|
|
28
28
|
const deep = positional[1];
|
|
@@ -43,4 +43,4 @@ async function handleHelpVersionShortCircuit(argv) {
|
|
|
43
43
|
export {
|
|
44
44
|
handleHelpVersionShortCircuit
|
|
45
45
|
};
|
|
46
|
-
//# sourceMappingURL=chunk-
|
|
46
|
+
//# sourceMappingURL=chunk-SWOPJHXI.js.map
|
|
@@ -30,14 +30,14 @@ import {
|
|
|
30
30
|
} from "./chunk-HLSHFXTO.js";
|
|
31
31
|
import {
|
|
32
32
|
subcommands
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-24C6VVLM.js";
|
|
34
34
|
import {
|
|
35
35
|
renderDeepHelp,
|
|
36
36
|
renderFocusedHelp
|
|
37
37
|
} from "./chunk-2EZ2DHOW.js";
|
|
38
38
|
import {
|
|
39
39
|
handleHelpVersionShortCircuit
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-SWOPJHXI.js";
|
|
41
41
|
import {
|
|
42
42
|
DEFAULT_PORT
|
|
43
43
|
} from "./chunk-RQ4UBKYH.js";
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
} from "./chunk-TWSQTQKR.js";
|
|
57
57
|
import {
|
|
58
58
|
discoverAndMergeProviders
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-PA4VBCXS.js";
|
|
60
60
|
import {
|
|
61
61
|
addFromCatalog,
|
|
62
62
|
boxBottom,
|
|
@@ -3449,4 +3449,4 @@ async function initializeCli(argv, options = {}) {
|
|
|
3449
3449
|
export {
|
|
3450
3450
|
initializeCli
|
|
3451
3451
|
};
|
|
3452
|
-
//# sourceMappingURL=cli-context-
|
|
3452
|
+
//# sourceMappingURL=cli-context-7HK67B2Z.js.map
|
package/dist/index.js
CHANGED
|
@@ -121,7 +121,7 @@ async function main(argv) {
|
|
|
121
121
|
applyAsciiMode(earlyFlags);
|
|
122
122
|
}
|
|
123
123
|
if (earlyFlags["help"] === true || earlyFlags["version"] === true) {
|
|
124
|
-
const { handleHelpVersionShortCircuit } = await import("./short-circuit-flags-
|
|
124
|
+
const { handleHelpVersionShortCircuit } = await import("./short-circuit-flags-D6VAG47Y.js");
|
|
125
125
|
const earlyExit = await handleHelpVersionShortCircuit(argv);
|
|
126
126
|
if (earlyExit !== null) return earlyExit;
|
|
127
127
|
}
|
|
@@ -130,7 +130,7 @@ async function main(argv) {
|
|
|
130
130
|
shouldCaptureTuiStartup(parsed.flags, parsed.positional)
|
|
131
131
|
);
|
|
132
132
|
try {
|
|
133
|
-
const { initializeCli } = await import("./cli-context-
|
|
133
|
+
const { initializeCli } = await import("./cli-context-7HK67B2Z.js");
|
|
134
134
|
const cliCtx = await initializeCli(argv, {
|
|
135
135
|
onNonTuiLaunch: () => startupOutput.stop()
|
|
136
136
|
});
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-TWSQTQKR.js";
|
|
4
4
|
import {
|
|
5
5
|
discoverAndMergeProviders
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PA4VBCXS.js";
|
|
7
7
|
import {
|
|
8
8
|
checkMark,
|
|
9
9
|
costLabel,
|
|
@@ -843,4 +843,4 @@ var modeldiagCmd = async (args, deps) => {
|
|
|
843
843
|
export {
|
|
844
844
|
modeldiagCmd
|
|
845
845
|
};
|
|
846
|
-
//# sourceMappingURL=modeldiag-
|
|
846
|
+
//# sourceMappingURL=modeldiag-NEPTLFZW.js.map
|
|
@@ -243,12 +243,13 @@ ${navLines.join(" \xB7 ")}
|
|
|
243
243
|
function aliasProviderId(configProviderId, cfg) {
|
|
244
244
|
return cfg?.type && cfg.type !== configProviderId ? cfg.type : configProviderId;
|
|
245
245
|
}
|
|
246
|
-
async function discoverProviderModels(deps, ids) {
|
|
246
|
+
async function discoverProviderModels(deps, ids, onlyProviderId) {
|
|
247
247
|
if (!("mergeOverlay" in deps.modelsRegistry)) return void 0;
|
|
248
248
|
try {
|
|
249
|
-
const { discoverAndMergeProviders } = await import("./auto-discover-providers-
|
|
249
|
+
const { discoverAndMergeProviders } = await import("./auto-discover-providers-JX346GOM.js");
|
|
250
|
+
const only = onlyProviderId ? deps.config.providers?.[onlyProviderId] : void 0;
|
|
250
251
|
await discoverAndMergeProviders({
|
|
251
|
-
config: deps.config,
|
|
252
|
+
config: only ? { ...deps.config, providers: { [onlyProviderId]: only } } : deps.config,
|
|
252
253
|
registry: deps.modelsRegistry,
|
|
253
254
|
cacheDir: deps.paths.cacheDir
|
|
254
255
|
});
|
|
@@ -263,6 +264,10 @@ async function discoverProviderModels(deps, ids) {
|
|
|
263
264
|
}
|
|
264
265
|
async function getCatalogProviderForConfigProvider(providerId, deps) {
|
|
265
266
|
const cfg = deps.config.providers?.[providerId];
|
|
267
|
+
if (usesAccountCatalog(cfg)) {
|
|
268
|
+
const found = await discoverProviderModels(deps, [providerId], providerId);
|
|
269
|
+
if (found) return { providerId, provider: found };
|
|
270
|
+
}
|
|
266
271
|
const lookupId = aliasProviderId(providerId, cfg);
|
|
267
272
|
const provider = await deps.modelsRegistry.getProvider(lookupId);
|
|
268
273
|
if (provider) return { providerId: lookupId, provider };
|
|
@@ -271,6 +276,10 @@ async function getCatalogProviderForConfigProvider(providerId, deps) {
|
|
|
271
276
|
provider: await discoverProviderModels(deps, [lookupId, providerId])
|
|
272
277
|
};
|
|
273
278
|
}
|
|
279
|
+
function usesAccountCatalog(cfg) {
|
|
280
|
+
const active = cfg?.apiKeys?.find((key) => key.label === cfg.activeKey) ?? cfg?.apiKeys?.[0];
|
|
281
|
+
return active?.authMethod === "oauth";
|
|
282
|
+
}
|
|
274
283
|
function uniqueStrings(values) {
|
|
275
284
|
return [...new Set(values.map((v) => v.trim()).filter(Boolean))];
|
|
276
285
|
}
|
|
@@ -312,10 +321,7 @@ async function modelsHide(args, deps) {
|
|
|
312
321
|
p.models = nextVisible;
|
|
313
322
|
}
|
|
314
323
|
);
|
|
315
|
-
deps
|
|
316
|
-
...deps.config.providers ?? {},
|
|
317
|
-
[providerId]: { ...saved, models: nextVisible }
|
|
318
|
-
};
|
|
324
|
+
publishProviderConfig(deps, providerId, { ...saved, models: nextVisible });
|
|
319
325
|
deps.renderer.writeInfo(
|
|
320
326
|
`Hidden ${providerId}/${modelId}. Visible: ${nextVisible.length}, hidden: ${Math.max(0, knownIds.length - nextVisible.length)}.`
|
|
321
327
|
);
|
|
@@ -365,10 +371,7 @@ async function modelsShow(args, deps) {
|
|
|
365
371
|
p.models = nextVisible;
|
|
366
372
|
}
|
|
367
373
|
);
|
|
368
|
-
deps
|
|
369
|
-
...deps.config.providers ?? {},
|
|
370
|
-
[providerId]: { ...saved, models: nextVisible }
|
|
371
|
-
};
|
|
374
|
+
publishProviderConfig(deps, providerId, { ...saved, models: nextVisible });
|
|
372
375
|
const isKnown = knownIds.includes(modelId);
|
|
373
376
|
deps.renderer.writeInfo(
|
|
374
377
|
`Visible ${providerId}/${modelId}${isKnown ? "" : " (not in current catalog)"}. Visible: ${nextVisible.length}.`
|
|
@@ -414,10 +417,40 @@ Restore: wstack models show ${providerId} <model> \xB7 reset ${providerId}
|
|
|
414
417
|
);
|
|
415
418
|
return 0;
|
|
416
419
|
}
|
|
420
|
+
function publishProviderConfig(deps, providerId, next) {
|
|
421
|
+
deps.config = {
|
|
422
|
+
...deps.config,
|
|
423
|
+
providers: { ...deps.config.providers ?? {}, [providerId]: next }
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
async function modelsResetCustomModel(providerId, modelId, saved, deps) {
|
|
427
|
+
if (!saved.customModels || !Object.hasOwn(saved.customModels, modelId)) {
|
|
428
|
+
deps.renderer.writeInfo(`${providerId}/${modelId} has no custom definition; nothing to reset.`);
|
|
429
|
+
return 0;
|
|
430
|
+
}
|
|
431
|
+
await mutateConfigProviders(
|
|
432
|
+
activeProfileConfigPath(deps.paths, deps.config),
|
|
433
|
+
deps.vault,
|
|
434
|
+
(providers) => {
|
|
435
|
+
const p = providers[providerId];
|
|
436
|
+
if (!p?.customModels) return;
|
|
437
|
+
delete p.customModels[modelId];
|
|
438
|
+
if (Object.keys(p.customModels).length === 0) delete p.customModels;
|
|
439
|
+
}
|
|
440
|
+
);
|
|
441
|
+
const { [modelId]: _dropped, ...rest } = saved.customModels;
|
|
442
|
+
const next = { ...saved };
|
|
443
|
+
if (Object.keys(rest).length > 0) next.customModels = rest;
|
|
444
|
+
else delete next.customModels;
|
|
445
|
+
publishProviderConfig(deps, providerId, next);
|
|
446
|
+
deps.renderer.writeInfo(`Reset ${providerId}/${modelId} to the catalog definition.`);
|
|
447
|
+
return 0;
|
|
448
|
+
}
|
|
417
449
|
async function modelsReset(args, deps) {
|
|
418
450
|
const providerId = args[0];
|
|
451
|
+
const modelId = args[1];
|
|
419
452
|
if (!providerId) {
|
|
420
|
-
deps.renderer.writeError("Usage: wstack models reset <provider>");
|
|
453
|
+
deps.renderer.writeError("Usage: wstack models reset <provider> [model]");
|
|
421
454
|
return 1;
|
|
422
455
|
}
|
|
423
456
|
const saved = deps.config.providers?.[providerId];
|
|
@@ -425,6 +458,7 @@ async function modelsReset(args, deps) {
|
|
|
425
458
|
deps.renderer.writeError(`Provider "${providerId}" is not configured.`);
|
|
426
459
|
return 1;
|
|
427
460
|
}
|
|
461
|
+
if (modelId) return modelsResetCustomModel(providerId, modelId, saved, deps);
|
|
428
462
|
if (saved.models === void 0) {
|
|
429
463
|
deps.renderer.writeInfo(`${providerId} already shows the full catalog model list.`);
|
|
430
464
|
return 0;
|
|
@@ -440,10 +474,7 @@ async function modelsReset(args, deps) {
|
|
|
440
474
|
);
|
|
441
475
|
const nextProvider = { ...saved };
|
|
442
476
|
delete nextProvider.models;
|
|
443
|
-
deps
|
|
444
|
-
...deps.config.providers ?? {},
|
|
445
|
-
[providerId]: nextProvider
|
|
446
|
-
};
|
|
477
|
+
publishProviderConfig(deps, providerId, nextProvider);
|
|
447
478
|
deps.renderer.writeInfo(
|
|
448
479
|
`Reset visible model list for ${providerId} to the full catalog default.`
|
|
449
480
|
);
|
|
@@ -457,6 +488,9 @@ async function modelsCaps(args, deps) {
|
|
|
457
488
|
deps.renderer.write(color.dim("Defaults to current configured provider/model when omitted.\n"));
|
|
458
489
|
return 1;
|
|
459
490
|
}
|
|
491
|
+
if (usesAccountCatalog(deps.config.providers?.[providerId])) {
|
|
492
|
+
await discoverProviderModels(deps, [providerId], providerId);
|
|
493
|
+
}
|
|
460
494
|
const resolved = await deps.modelsRegistry.getModel(providerId, modelId);
|
|
461
495
|
if (!resolved) {
|
|
462
496
|
deps.renderer.writeError("Model not found in catalog: " + providerId + "/" + modelId);
|
|
@@ -670,4 +704,4 @@ export {
|
|
|
670
704
|
modelsCmd,
|
|
671
705
|
providersCmd
|
|
672
706
|
};
|
|
673
|
-
//# sourceMappingURL=providers-models-
|
|
707
|
+
//# sourceMappingURL=providers-models-O75MKLN2.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handleHelpVersionShortCircuit
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SWOPJHXI.js";
|
|
4
4
|
import "./chunk-MPQCHBDJ.js";
|
|
5
5
|
import "./chunk-WHEYHDIE.js";
|
|
6
6
|
import "./chunk-F5DCFAKI.js";
|
|
7
7
|
export {
|
|
8
8
|
handleHelpVersionShortCircuit
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=short-circuit-flags-
|
|
10
|
+
//# sourceMappingURL=short-circuit-flags-D6VAG47Y.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.33",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "WrongStack CLI — terminal AI coding agent with provider catalog from models.dev. Provides `wrongstack` and `wstack` binaries.",
|
|
6
6
|
"keywords": [
|
|
@@ -41,42 +41,42 @@
|
|
|
41
41
|
"data"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@wrongstack/acp": "1.0.
|
|
45
|
-
"@wrongstack/bench": "1.0.
|
|
46
|
-
"@wrongstack/core": "1.0.
|
|
47
|
-
"@wrongstack/kanban": "1.0.
|
|
48
|
-
"@wrongstack/mcp": "1.0.
|
|
49
|
-
"@wrongstack/persistence": "1.0.
|
|
50
|
-
"@wrongstack/plug-lsp": "1.0.
|
|
51
|
-
"@wrongstack/plugins": "1.0.
|
|
52
|
-
"@wrongstack/primitives": "1.0.
|
|
53
|
-
"@wrongstack/providers": "1.0.
|
|
54
|
-
"@wrongstack/requirement-intake": "1.0.
|
|
55
|
-
"@wrongstack/runtime": "1.0.
|
|
56
|
-
"@wrongstack/sage": "1.0.
|
|
57
|
-
"@wrongstack/sage-mcp": "1.0.
|
|
58
|
-
"@wrongstack/sdd": "1.0.
|
|
59
|
-
"@wrongstack/security-scanner": "1.0.
|
|
60
|
-
"@wrongstack/simpleui": "1.0.
|
|
61
|
-
"@wrongstack/techstack": "1.0.
|
|
62
|
-
"@wrongstack/telegram": "1.0.
|
|
63
|
-
"@wrongstack/tools": "1.0.
|
|
64
|
-
"@wrongstack/tui": "1.0.
|
|
65
|
-
"@wrongstack/vector-memory": "1.0.
|
|
66
|
-
"@wrongstack/webui": "1.0.
|
|
67
|
-
"@wrongstack/webui-hq": "1.0.
|
|
68
|
-
"@wrongstack/webui-protocol": "1.0.
|
|
69
|
-
"@wrongstack/webui-server": "1.0.
|
|
70
|
-
"@wrongstack/wrongtrace": "1.0.
|
|
44
|
+
"@wrongstack/acp": "1.0.33",
|
|
45
|
+
"@wrongstack/bench": "1.0.33",
|
|
46
|
+
"@wrongstack/core": "1.0.33",
|
|
47
|
+
"@wrongstack/kanban": "1.0.33",
|
|
48
|
+
"@wrongstack/mcp": "1.0.33",
|
|
49
|
+
"@wrongstack/persistence": "1.0.33",
|
|
50
|
+
"@wrongstack/plug-lsp": "1.0.33",
|
|
51
|
+
"@wrongstack/plugins": "1.0.33",
|
|
52
|
+
"@wrongstack/primitives": "1.0.33",
|
|
53
|
+
"@wrongstack/providers": "1.0.33",
|
|
54
|
+
"@wrongstack/requirement-intake": "1.0.33",
|
|
55
|
+
"@wrongstack/runtime": "1.0.33",
|
|
56
|
+
"@wrongstack/sage": "1.0.33",
|
|
57
|
+
"@wrongstack/sage-mcp": "1.0.33",
|
|
58
|
+
"@wrongstack/sdd": "1.0.33",
|
|
59
|
+
"@wrongstack/security-scanner": "1.0.33",
|
|
60
|
+
"@wrongstack/simpleui": "1.0.33",
|
|
61
|
+
"@wrongstack/techstack": "1.0.33",
|
|
62
|
+
"@wrongstack/telegram": "1.0.33",
|
|
63
|
+
"@wrongstack/tools": "1.0.33",
|
|
64
|
+
"@wrongstack/tui": "1.0.33",
|
|
65
|
+
"@wrongstack/vector-memory": "1.0.33",
|
|
66
|
+
"@wrongstack/webui": "1.0.33",
|
|
67
|
+
"@wrongstack/webui-hq": "1.0.33",
|
|
68
|
+
"@wrongstack/webui-protocol": "1.0.33",
|
|
69
|
+
"@wrongstack/webui-server": "1.0.33",
|
|
70
|
+
"@wrongstack/wrongtrace": "1.0.33",
|
|
71
71
|
"ws": "^8.21.3"
|
|
72
72
|
},
|
|
73
73
|
"optionalDependencies": {
|
|
74
|
-
"@wrongstack/desktop": "1.0.
|
|
74
|
+
"@wrongstack/desktop": "1.0.33"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@types/node": "^26.5.1",
|
|
78
78
|
"@types/ws": "^8.18.1",
|
|
79
|
-
"@wrongstack/governance": "1.0.
|
|
79
|
+
"@wrongstack/governance": "1.0.33",
|
|
80
80
|
"jsdom": "^30.0.1",
|
|
81
81
|
"typescript": "^7.0.2"
|
|
82
82
|
},
|