@prestyj/core 4.10.1

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,378 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/model-registry.ts
21
+ var model_registry_exports = {};
22
+ __export(model_registry_exports, {
23
+ DEFAULT_MAX_VIDEO_BYTES: () => DEFAULT_MAX_VIDEO_BYTES,
24
+ MODELS: () => MODELS,
25
+ getContextWindow: () => getContextWindow,
26
+ getDefaultModel: () => getDefaultModel,
27
+ getMaxThinkingLevel: () => getMaxThinkingLevel,
28
+ getModel: () => getModel,
29
+ getModelsForProvider: () => getModelsForProvider,
30
+ getSummaryModel: () => getSummaryModel,
31
+ getVideoByteLimit: () => getVideoByteLimit,
32
+ usesOpenAICodexTransport: () => usesOpenAICodexTransport
33
+ });
34
+ module.exports = __toCommonJS(model_registry_exports);
35
+ var MODELS = [
36
+ // ── Anthropic ──────────────────────────────────────────
37
+ // NOTE: Claude Fable 5 (`claude-fable-5`) and Claude Mythos 5
38
+ // (`claude-mythos-5`) are temporarily unavailable, so they're commented out
39
+ // here to keep them out of the /model selector and avoid user confusion.
40
+ // Re-enable once they're generally available again.
41
+ // {
42
+ // id: "claude-fable-5",
43
+ // name: "Claude Fable 5",
44
+ // provider: "anthropic",
45
+ // contextWindow: 1_000_000,
46
+ // maxOutputTokens: 128_000,
47
+ // supportsThinking: true,
48
+ // supportsImages: true,
49
+ // supportsVideo: false,
50
+ // costTier: "high",
51
+ // maxThinkingLevel: "max",
52
+ // },
53
+ // {
54
+ // // Mythos-class model offered through Project Glasswing (limited
55
+ // // availability, invitation-only). Same underlying model as Fable 5 with
56
+ // // some safeguards lifted; kept here so approved accounts can select it.
57
+ // id: "claude-mythos-5",
58
+ // name: "Claude Mythos 5",
59
+ // provider: "anthropic",
60
+ // contextWindow: 1_000_000,
61
+ // maxOutputTokens: 128_000,
62
+ // supportsThinking: true,
63
+ // supportsImages: true,
64
+ // supportsVideo: false,
65
+ // costTier: "high",
66
+ // maxThinkingLevel: "max",
67
+ // },
68
+ {
69
+ id: "claude-opus-4-8",
70
+ name: "Claude Opus 4.8",
71
+ provider: "anthropic",
72
+ contextWindow: 1e6,
73
+ maxOutputTokens: 128e3,
74
+ supportsThinking: true,
75
+ supportsImages: true,
76
+ supportsVideo: false,
77
+ costTier: "high",
78
+ maxThinkingLevel: "max"
79
+ },
80
+ {
81
+ id: "claude-sonnet-4-6",
82
+ name: "Claude Sonnet 4.6",
83
+ provider: "anthropic",
84
+ contextWindow: 1e6,
85
+ maxOutputTokens: 64e3,
86
+ supportsThinking: true,
87
+ supportsImages: true,
88
+ supportsVideo: false,
89
+ costTier: "medium",
90
+ maxThinkingLevel: "max"
91
+ },
92
+ {
93
+ id: "claude-haiku-4-5-20251001",
94
+ name: "Claude Haiku 4.5",
95
+ provider: "anthropic",
96
+ contextWindow: 2e5,
97
+ maxOutputTokens: 64e3,
98
+ supportsThinking: true,
99
+ supportsImages: true,
100
+ supportsVideo: false,
101
+ costTier: "low",
102
+ maxThinkingLevel: "high"
103
+ },
104
+ // ── OpenAI (Codex) ─────────────────────────────────────
105
+ {
106
+ id: "gpt-5.5",
107
+ name: "GPT-5.5",
108
+ provider: "openai",
109
+ contextWindow: 105e4,
110
+ codexContextWindow: 272e3,
111
+ maxOutputTokens: 128e3,
112
+ supportsThinking: true,
113
+ supportsImages: true,
114
+ supportsVideo: false,
115
+ costTier: "high",
116
+ maxThinkingLevel: "xhigh"
117
+ },
118
+ {
119
+ id: "gpt-5.4",
120
+ name: "GPT-5.4",
121
+ provider: "openai",
122
+ contextWindow: 105e4,
123
+ codexContextWindow: 272e3,
124
+ maxOutputTokens: 128e3,
125
+ supportsThinking: true,
126
+ supportsImages: true,
127
+ supportsVideo: false,
128
+ costTier: "high",
129
+ maxThinkingLevel: "xhigh"
130
+ },
131
+ {
132
+ id: "gpt-5.4-mini",
133
+ name: "GPT-5.4 Mini",
134
+ provider: "openai",
135
+ contextWindow: 4e5,
136
+ maxOutputTokens: 128e3,
137
+ supportsThinking: true,
138
+ supportsImages: true,
139
+ supportsVideo: false,
140
+ costTier: "low",
141
+ maxThinkingLevel: "xhigh"
142
+ },
143
+ {
144
+ id: "gpt-5.3-codex",
145
+ name: "GPT-5.3 Codex",
146
+ provider: "openai",
147
+ contextWindow: 4e5,
148
+ maxOutputTokens: 128e3,
149
+ supportsThinking: true,
150
+ supportsImages: true,
151
+ supportsVideo: false,
152
+ costTier: "high",
153
+ maxThinkingLevel: "xhigh"
154
+ },
155
+ // ── Gemini ─────────────────────────────────────────────
156
+ {
157
+ id: "gemini-3.1-flash-lite-preview",
158
+ name: "Gemini 3.1 Flash Lite Preview",
159
+ provider: "gemini",
160
+ contextWindow: 1048576,
161
+ maxOutputTokens: 65536,
162
+ supportsThinking: true,
163
+ supportsImages: true,
164
+ supportsVideo: true,
165
+ maxVideoBytes: 20 * 1024 * 1024,
166
+ costTier: "low",
167
+ maxThinkingLevel: "high"
168
+ },
169
+ {
170
+ id: "gemini-3.5-flash",
171
+ name: "Gemini 3.5 Flash",
172
+ provider: "gemini",
173
+ contextWindow: 1048576,
174
+ maxOutputTokens: 65536,
175
+ supportsThinking: true,
176
+ supportsImages: true,
177
+ supportsVideo: true,
178
+ maxVideoBytes: 20 * 1024 * 1024,
179
+ costTier: "low",
180
+ maxThinkingLevel: "high"
181
+ },
182
+ // ── Moonshot (Kimi) ────────────────────────────────────
183
+ {
184
+ id: "kimi-k2.7-code",
185
+ name: "Kimi K2.7",
186
+ provider: "moonshot",
187
+ contextWindow: 262144,
188
+ maxOutputTokens: 262144,
189
+ supportsThinking: true,
190
+ supportsImages: true,
191
+ supportsVideo: true,
192
+ maxVideoBytes: 100 * 1024 * 1024,
193
+ costTier: "medium",
194
+ maxThinkingLevel: "high"
195
+ },
196
+ // ── Z.AI (GLM) ─────────────────────────────────────────
197
+ {
198
+ id: "glm-5.1",
199
+ name: "GLM-5.1",
200
+ provider: "glm",
201
+ contextWindow: 204800,
202
+ maxOutputTokens: 131072,
203
+ supportsThinking: true,
204
+ supportsImages: false,
205
+ supportsVideo: false,
206
+ costTier: "medium",
207
+ maxThinkingLevel: "high"
208
+ },
209
+ {
210
+ id: "glm-4.7",
211
+ name: "GLM-4.7",
212
+ provider: "glm",
213
+ contextWindow: 2e5,
214
+ maxOutputTokens: 131072,
215
+ supportsThinking: true,
216
+ supportsImages: false,
217
+ supportsVideo: false,
218
+ costTier: "low",
219
+ maxThinkingLevel: "high"
220
+ },
221
+ {
222
+ id: "glm-4.7-flash",
223
+ name: "GLM-4.7 Flash",
224
+ provider: "glm",
225
+ contextWindow: 2e5,
226
+ maxOutputTokens: 131072,
227
+ supportsThinking: true,
228
+ supportsImages: false,
229
+ supportsVideo: false,
230
+ costTier: "low",
231
+ maxThinkingLevel: "high"
232
+ },
233
+ // ── MiniMax ────────────────────────────────────────────
234
+ {
235
+ id: "MiniMax-M3",
236
+ name: "MiniMax M3",
237
+ provider: "minimax",
238
+ contextWindow: 1e6,
239
+ maxOutputTokens: 131072,
240
+ supportsThinking: true,
241
+ supportsImages: true,
242
+ supportsVideo: true,
243
+ maxVideoBytes: 50 * 1024 * 1024,
244
+ costTier: "medium",
245
+ maxThinkingLevel: "high"
246
+ },
247
+ // ── Xiaomi (MiMo) ──────────────────────────────────────
248
+ // Pro series: text-only coding/agentic flagship. The legacy mimo-v2-pro
249
+ // auto-routes to v2.5 on 2026-06-01 and is fully deprecated by 2026-06-30.
250
+ {
251
+ id: "mimo-v2.5-pro",
252
+ name: "MiMo-V2.5-Pro",
253
+ provider: "xiaomi",
254
+ contextWindow: 1e6,
255
+ maxOutputTokens: 131072,
256
+ supportsThinking: true,
257
+ supportsImages: false,
258
+ supportsVideo: false,
259
+ costTier: "medium",
260
+ maxThinkingLevel: "high"
261
+ },
262
+ // Omni series: native full-modal understanding (image + audio + video).
263
+ // Video/image ride the OpenAI-compatible transport as base64 data URLs
264
+ // (`video_url`/`image_url`), which the shared transform already emits.
265
+ {
266
+ id: "mimo-v2.5",
267
+ name: "MiMo-V2.5",
268
+ provider: "xiaomi",
269
+ contextWindow: 1e6,
270
+ maxOutputTokens: 131072,
271
+ supportsThinking: true,
272
+ supportsImages: true,
273
+ supportsVideo: true,
274
+ maxVideoBytes: 36 * 1024 * 1024,
275
+ costTier: "medium",
276
+ maxThinkingLevel: "high"
277
+ },
278
+ // ── DeepSeek ───────────────────────────────────────────
279
+ {
280
+ id: "deepseek-v4-pro",
281
+ name: "DeepSeek V4 Pro",
282
+ provider: "deepseek",
283
+ contextWindow: 1048576,
284
+ maxOutputTokens: 384e3,
285
+ supportsThinking: true,
286
+ supportsImages: false,
287
+ supportsVideo: false,
288
+ costTier: "high",
289
+ // DeepSeek V4 maps `xhigh` → its internal `max` tier.
290
+ maxThinkingLevel: "xhigh"
291
+ },
292
+ {
293
+ id: "deepseek-v4-flash",
294
+ name: "DeepSeek V4 Flash",
295
+ provider: "deepseek",
296
+ contextWindow: 1048576,
297
+ maxOutputTokens: 384e3,
298
+ supportsThinking: true,
299
+ supportsImages: false,
300
+ supportsVideo: false,
301
+ costTier: "low",
302
+ maxThinkingLevel: "xhigh"
303
+ },
304
+ // ── OpenRouter ─────────────────────────────────────────
305
+ {
306
+ id: "qwen/qwen3.6-plus",
307
+ name: "Qwen3.6-Plus",
308
+ provider: "openrouter",
309
+ contextWindow: 1e6,
310
+ maxOutputTokens: 65536,
311
+ supportsThinking: true,
312
+ supportsImages: false,
313
+ supportsVideo: false,
314
+ costTier: "medium",
315
+ maxThinkingLevel: "high"
316
+ }
317
+ ];
318
+ function getModel(id) {
319
+ return MODELS.find((m) => m.id === id);
320
+ }
321
+ function getModelsForProvider(provider) {
322
+ return MODELS.filter((m) => m.provider === provider);
323
+ }
324
+ var DEFAULT_MAX_VIDEO_BYTES = 20 * 1024 * 1024;
325
+ function getVideoByteLimit(modelId) {
326
+ const model = getModel(modelId);
327
+ if (!model?.supportsVideo) return void 0;
328
+ return model.maxVideoBytes ?? DEFAULT_MAX_VIDEO_BYTES;
329
+ }
330
+ function getDefaultModel(provider) {
331
+ if (provider === "xiaomi") return MODELS.find((m) => m.id === "mimo-v2.5-pro");
332
+ if (provider === "openai") return MODELS.find((m) => m.id === "gpt-5.5");
333
+ if (provider === "gemini") return MODELS.find((m) => m.id === "gemini-3.1-flash-lite-preview");
334
+ if (provider === "glm") return MODELS.find((m) => m.id === "glm-5.1");
335
+ if (provider === "moonshot") return MODELS.find((m) => m.id === "kimi-k2.7-code");
336
+ if (provider === "minimax") return MODELS.find((m) => m.id === "MiniMax-M3");
337
+ if (provider === "deepseek") return MODELS.find((m) => m.id === "deepseek-v4-pro");
338
+ if (provider === "openrouter") return MODELS.find((m) => m.id === "qwen/qwen3.6-plus");
339
+ return MODELS.find((m) => m.id === "claude-sonnet-4-6");
340
+ }
341
+ function usesOpenAICodexTransport(options) {
342
+ return options?.provider === "openai" && Boolean(options.accountId);
343
+ }
344
+ function getContextWindow(modelId, options) {
345
+ const model = getModel(modelId);
346
+ if (!model) return 2e5;
347
+ if (usesOpenAICodexTransport(options) && model.codexContextWindow) {
348
+ return model.codexContextWindow;
349
+ }
350
+ return model.contextWindow;
351
+ }
352
+ function getMaxThinkingLevel(modelId) {
353
+ return getModel(modelId)?.maxThinkingLevel ?? "high";
354
+ }
355
+ function getSummaryModel(provider, currentModelId) {
356
+ if (provider === "anthropic") {
357
+ return MODELS.find((m) => m.id === "claude-sonnet-4-6");
358
+ }
359
+ if (provider === "openai" || provider === "glm" || provider === "deepseek") {
360
+ const low = getModelsForProvider(provider).find((m) => m.costTier === "low");
361
+ if (low) return low;
362
+ }
363
+ return getModel(currentModelId) ?? getDefaultModel(provider);
364
+ }
365
+ // Annotate the CommonJS export names for ESM import in node:
366
+ 0 && (module.exports = {
367
+ DEFAULT_MAX_VIDEO_BYTES,
368
+ MODELS,
369
+ getContextWindow,
370
+ getDefaultModel,
371
+ getMaxThinkingLevel,
372
+ getModel,
373
+ getModelsForProvider,
374
+ getSummaryModel,
375
+ getVideoByteLimit,
376
+ usesOpenAICodexTransport
377
+ });
378
+ //# sourceMappingURL=model-registry.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/model-registry.ts"],"sourcesContent":["import type { Provider, ThinkingLevel } from \"@prestyj/ai\";\n\nexport interface ModelInfo {\n id: string;\n name: string;\n provider: Provider;\n contextWindow: number;\n /**\n * ChatGPT Codex transport uses product-specific windows that can differ from\n * the public API model window. OpenAI OAuth requests include an accountId and\n * route through `/codex/responses`; API-key requests do not.\n */\n codexContextWindow?: number;\n maxOutputTokens: number;\n supportsThinking: boolean;\n supportsImages: boolean;\n supportsVideo: boolean;\n /**\n * Max video payload (bytes) this model's transport accepts, used to decide\n * when an attached/read video must be compressed before sending. Differs by\n * provider delivery mechanism:\n * - Moonshot/Kimi: 100 MB (file-service upload cap)\n * - MiniMax: 50 MB (Anthropic-compatible base64 inline cap)\n * - Gemini: 20 MB (inlineData per-request cap)\n * - Xiaomi (MiMo): ~36 MB raw — the API caps the base64 STRING at 50 MB,\n * and base64 inflates bytes by ~4/3, so 36 MB raw ≈ 48 MB encoded.\n * Only meaningful when `supportsVideo` is true.\n */\n maxVideoBytes?: number;\n costTier: \"low\" | \"medium\" | \"high\";\n /**\n * The top reasoning tier this model genuinely uses. Used when thinking is\n * enabled to pick the strongest setting per model:\n * - OpenAI GPT-5.5-era: `xhigh`\n * - OpenAI Pro/Codex/old: clamped to what the model accepts\n * - Claude Fable 5 / Mythos 5, Opus 4.8 / 4.7 / 4.6 and Sonnet 4.6: `max`\n * (Fable 5 / Mythos 5 use always-on adaptive thinking, low→max ladder)\n * - Claude Haiku 4.5: `high` (no adaptive `max` tier)\n * - GLM / Moonshot / Xiaomi / MiniMax / Qwen: `high` — binary-thinking\n * providers ignore the level on the wire, so the value is cosmetic\n * - DeepSeek V4: `xhigh` (DeepSeek maps `xhigh` → its internal `max`)\n */\n maxThinkingLevel: ThinkingLevel;\n}\n\n// Provider display order — mirrors `PROVIDERS` in ui/login.tsx so the\n// /model selector and login selector sort models identically.\nexport const MODELS: ModelInfo[] = [\n // ── Anthropic ──────────────────────────────────────────\n // NOTE: Claude Fable 5 (`claude-fable-5`) and Claude Mythos 5\n // (`claude-mythos-5`) are temporarily unavailable, so they're commented out\n // here to keep them out of the /model selector and avoid user confusion.\n // Re-enable once they're generally available again.\n // {\n // id: \"claude-fable-5\",\n // name: \"Claude Fable 5\",\n // provider: \"anthropic\",\n // contextWindow: 1_000_000,\n // maxOutputTokens: 128_000,\n // supportsThinking: true,\n // supportsImages: true,\n // supportsVideo: false,\n // costTier: \"high\",\n // maxThinkingLevel: \"max\",\n // },\n // {\n // // Mythos-class model offered through Project Glasswing (limited\n // // availability, invitation-only). Same underlying model as Fable 5 with\n // // some safeguards lifted; kept here so approved accounts can select it.\n // id: \"claude-mythos-5\",\n // name: \"Claude Mythos 5\",\n // provider: \"anthropic\",\n // contextWindow: 1_000_000,\n // maxOutputTokens: 128_000,\n // supportsThinking: true,\n // supportsImages: true,\n // supportsVideo: false,\n // costTier: \"high\",\n // maxThinkingLevel: \"max\",\n // },\n {\n id: \"claude-opus-4-8\",\n name: \"Claude Opus 4.8\",\n provider: \"anthropic\",\n contextWindow: 1_000_000,\n maxOutputTokens: 128_000,\n supportsThinking: true,\n supportsImages: true,\n supportsVideo: false,\n costTier: \"high\",\n maxThinkingLevel: \"max\",\n },\n {\n id: \"claude-sonnet-4-6\",\n name: \"Claude Sonnet 4.6\",\n provider: \"anthropic\",\n contextWindow: 1_000_000,\n maxOutputTokens: 64_000,\n supportsThinking: true,\n supportsImages: true,\n supportsVideo: false,\n costTier: \"medium\",\n maxThinkingLevel: \"max\",\n },\n {\n id: \"claude-haiku-4-5-20251001\",\n name: \"Claude Haiku 4.5\",\n provider: \"anthropic\",\n contextWindow: 200_000,\n maxOutputTokens: 64_000,\n supportsThinking: true,\n supportsImages: true,\n supportsVideo: false,\n costTier: \"low\",\n maxThinkingLevel: \"high\",\n },\n // ── OpenAI (Codex) ─────────────────────────────────────\n {\n id: \"gpt-5.5\",\n name: \"GPT-5.5\",\n provider: \"openai\",\n contextWindow: 1_050_000,\n codexContextWindow: 272_000,\n maxOutputTokens: 128_000,\n supportsThinking: true,\n supportsImages: true,\n supportsVideo: false,\n costTier: \"high\",\n maxThinkingLevel: \"xhigh\",\n },\n {\n id: \"gpt-5.4\",\n name: \"GPT-5.4\",\n provider: \"openai\",\n contextWindow: 1_050_000,\n codexContextWindow: 272_000,\n maxOutputTokens: 128_000,\n supportsThinking: true,\n supportsImages: true,\n supportsVideo: false,\n costTier: \"high\",\n maxThinkingLevel: \"xhigh\",\n },\n {\n id: \"gpt-5.4-mini\",\n name: \"GPT-5.4 Mini\",\n provider: \"openai\",\n contextWindow: 400_000,\n maxOutputTokens: 128_000,\n supportsThinking: true,\n supportsImages: true,\n supportsVideo: false,\n costTier: \"low\",\n maxThinkingLevel: \"xhigh\",\n },\n {\n id: \"gpt-5.3-codex\",\n name: \"GPT-5.3 Codex\",\n provider: \"openai\",\n contextWindow: 400_000,\n maxOutputTokens: 128_000,\n supportsThinking: true,\n supportsImages: true,\n supportsVideo: false,\n costTier: \"high\",\n maxThinkingLevel: \"xhigh\",\n },\n // ── Gemini ─────────────────────────────────────────────\n {\n id: \"gemini-3.1-flash-lite-preview\",\n name: \"Gemini 3.1 Flash Lite Preview\",\n provider: \"gemini\",\n contextWindow: 1_048_576,\n maxOutputTokens: 65_536,\n supportsThinking: true,\n supportsImages: true,\n supportsVideo: true,\n maxVideoBytes: 20 * 1024 * 1024,\n costTier: \"low\",\n maxThinkingLevel: \"high\",\n },\n {\n id: \"gemini-3.5-flash\",\n name: \"Gemini 3.5 Flash\",\n provider: \"gemini\",\n contextWindow: 1_048_576,\n maxOutputTokens: 65_536,\n supportsThinking: true,\n supportsImages: true,\n supportsVideo: true,\n maxVideoBytes: 20 * 1024 * 1024,\n costTier: \"low\",\n maxThinkingLevel: \"high\",\n },\n // ── Moonshot (Kimi) ────────────────────────────────────\n {\n id: \"kimi-k2.7-code\",\n name: \"Kimi K2.7\",\n provider: \"moonshot\",\n contextWindow: 262_144,\n maxOutputTokens: 262_144,\n supportsThinking: true,\n supportsImages: true,\n supportsVideo: true,\n maxVideoBytes: 100 * 1024 * 1024,\n costTier: \"medium\",\n maxThinkingLevel: \"high\",\n },\n // ── Z.AI (GLM) ─────────────────────────────────────────\n {\n id: \"glm-5.1\",\n name: \"GLM-5.1\",\n provider: \"glm\",\n contextWindow: 204_800,\n maxOutputTokens: 131_072,\n supportsThinking: true,\n supportsImages: false,\n supportsVideo: false,\n costTier: \"medium\",\n maxThinkingLevel: \"high\",\n },\n {\n id: \"glm-4.7\",\n name: \"GLM-4.7\",\n provider: \"glm\",\n contextWindow: 200_000,\n maxOutputTokens: 131_072,\n supportsThinking: true,\n supportsImages: false,\n supportsVideo: false,\n costTier: \"low\",\n maxThinkingLevel: \"high\",\n },\n {\n id: \"glm-4.7-flash\",\n name: \"GLM-4.7 Flash\",\n provider: \"glm\",\n contextWindow: 200_000,\n maxOutputTokens: 131_072,\n supportsThinking: true,\n supportsImages: false,\n supportsVideo: false,\n costTier: \"low\",\n maxThinkingLevel: \"high\",\n },\n // ── MiniMax ────────────────────────────────────────────\n {\n id: \"MiniMax-M3\",\n name: \"MiniMax M3\",\n provider: \"minimax\",\n contextWindow: 1_000_000,\n maxOutputTokens: 131_072,\n supportsThinking: true,\n supportsImages: true,\n supportsVideo: true,\n maxVideoBytes: 50 * 1024 * 1024,\n costTier: \"medium\",\n maxThinkingLevel: \"high\",\n },\n // ── Xiaomi (MiMo) ──────────────────────────────────────\n // Pro series: text-only coding/agentic flagship. The legacy mimo-v2-pro\n // auto-routes to v2.5 on 2026-06-01 and is fully deprecated by 2026-06-30.\n {\n id: \"mimo-v2.5-pro\",\n name: \"MiMo-V2.5-Pro\",\n provider: \"xiaomi\",\n contextWindow: 1_000_000,\n maxOutputTokens: 131_072,\n supportsThinking: true,\n supportsImages: false,\n supportsVideo: false,\n costTier: \"medium\",\n maxThinkingLevel: \"high\",\n },\n // Omni series: native full-modal understanding (image + audio + video).\n // Video/image ride the OpenAI-compatible transport as base64 data URLs\n // (`video_url`/`image_url`), which the shared transform already emits.\n {\n id: \"mimo-v2.5\",\n name: \"MiMo-V2.5\",\n provider: \"xiaomi\",\n contextWindow: 1_000_000,\n maxOutputTokens: 131_072,\n supportsThinking: true,\n supportsImages: true,\n supportsVideo: true,\n maxVideoBytes: 36 * 1024 * 1024,\n costTier: \"medium\",\n maxThinkingLevel: \"high\",\n },\n // ── DeepSeek ───────────────────────────────────────────\n {\n id: \"deepseek-v4-pro\",\n name: \"DeepSeek V4 Pro\",\n provider: \"deepseek\",\n contextWindow: 1_048_576,\n maxOutputTokens: 384_000,\n supportsThinking: true,\n supportsImages: false,\n supportsVideo: false,\n costTier: \"high\",\n // DeepSeek V4 maps `xhigh` → its internal `max` tier.\n maxThinkingLevel: \"xhigh\",\n },\n {\n id: \"deepseek-v4-flash\",\n name: \"DeepSeek V4 Flash\",\n provider: \"deepseek\",\n contextWindow: 1_048_576,\n maxOutputTokens: 384_000,\n supportsThinking: true,\n supportsImages: false,\n supportsVideo: false,\n costTier: \"low\",\n maxThinkingLevel: \"xhigh\",\n },\n // ── OpenRouter ─────────────────────────────────────────\n {\n id: \"qwen/qwen3.6-plus\",\n name: \"Qwen3.6-Plus\",\n provider: \"openrouter\",\n contextWindow: 1_000_000,\n maxOutputTokens: 65_536,\n supportsThinking: true,\n supportsImages: false,\n supportsVideo: false,\n costTier: \"medium\",\n maxThinkingLevel: \"high\",\n },\n];\n\nexport function getModel(id: string): ModelInfo | undefined {\n return MODELS.find((m) => m.id === id);\n}\n\nexport function getModelsForProvider(provider: Provider): ModelInfo[] {\n return MODELS.filter((m) => m.provider === provider);\n}\n\n/** Default video payload cap (bytes) when a video model doesn't declare one. */\nexport const DEFAULT_MAX_VIDEO_BYTES = 20 * 1024 * 1024;\n\n/**\n * Max video payload (bytes) the given model's transport accepts before the clip\n * must be compressed. Returns `undefined` for models without video support, so\n * callers can skip the native-video path entirely.\n */\nexport function getVideoByteLimit(modelId: string): number | undefined {\n const model = getModel(modelId);\n if (!model?.supportsVideo) return undefined;\n return model.maxVideoBytes ?? DEFAULT_MAX_VIDEO_BYTES;\n}\n\nexport function getDefaultModel(provider: Provider): ModelInfo {\n if (provider === \"xiaomi\") return MODELS.find((m) => m.id === \"mimo-v2.5-pro\")!;\n if (provider === \"openai\") return MODELS.find((m) => m.id === \"gpt-5.5\")!;\n if (provider === \"gemini\") return MODELS.find((m) => m.id === \"gemini-3.1-flash-lite-preview\")!;\n if (provider === \"glm\") return MODELS.find((m) => m.id === \"glm-5.1\")!;\n if (provider === \"moonshot\") return MODELS.find((m) => m.id === \"kimi-k2.7-code\")!;\n if (provider === \"minimax\") return MODELS.find((m) => m.id === \"MiniMax-M3\")!;\n if (provider === \"deepseek\") return MODELS.find((m) => m.id === \"deepseek-v4-pro\")!;\n if (provider === \"openrouter\") return MODELS.find((m) => m.id === \"qwen/qwen3.6-plus\")!;\n return MODELS.find((m) => m.id === \"claude-sonnet-4-6\")!;\n}\n\nexport interface ContextWindowOptions {\n provider?: Provider;\n accountId?: string;\n}\n\nexport function usesOpenAICodexTransport(options?: ContextWindowOptions): boolean {\n return options?.provider === \"openai\" && Boolean(options.accountId);\n}\n\nexport function getContextWindow(modelId: string, options?: ContextWindowOptions): number {\n const model = getModel(modelId);\n if (!model) return 200_000;\n if (usesOpenAICodexTransport(options) && model.codexContextWindow) {\n return model.codexContextWindow;\n }\n return model.contextWindow;\n}\n\n/**\n * The strongest thinking level the given model genuinely uses. Falls back to\n * `\"high\"` for unknown models since every provider we ship accepts it.\n */\nexport function getMaxThinkingLevel(modelId: string): ThinkingLevel {\n return getModel(modelId)?.maxThinkingLevel ?? \"high\";\n}\n\n/**\n * Get the model to use for compaction summarization.\n * - Anthropic: always Sonnet 4.6\n * - OpenAI: cheapest (Codex Mini)\n * - Gemini: use the current model\n * - GLM: GLM-4.7 Flash (cheap alternative)\n * - Moonshot: use the current model (no cheap alternative)\n */\nexport function getSummaryModel(provider: Provider, currentModelId: string): ModelInfo {\n if (provider === \"anthropic\") {\n return MODELS.find((m) => m.id === \"claude-sonnet-4-6\")!;\n }\n if (provider === \"openai\" || provider === \"glm\" || provider === \"deepseek\") {\n const low = getModelsForProvider(provider).find((m) => m.costTier === \"low\");\n if (low) return low;\n }\n // Moonshot or fallback: use current model\n return getModel(currentModelId) ?? getDefaultModel(provider);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CO,IAAM,SAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiCjC;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,UAAU;AAAA,IACV,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,eA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iBAAiB;AACjF,MAAI,aAAa,aAAc,QAAO,OAAO,KAAK,CAAC,MAAM,EAAE,OAAO,mBAAmB;AACrF,SAAO,OAAO,KAAK,CAAC,MAAM,EAAE,OAAO,mBAAmB;AACxD;AAOO,SAAS,yBAAyB,SAAyC;AAChF,SAAO,SAAS,aAAa,YAAY,QAAQ,QAAQ,SAAS;AACpE;AAEO,SAAS,iBAAiB,SAAiB,SAAwC;AACxF,QAAM,QAAQ,SAAS,OAAO;AAC9B,MAAI,CAAC,MAAO,QAAO;AACnB,MAAI,yBAAyB,OAAO,KAAK,MAAM,oBAAoB;AACjE,WAAO,MAAM;AAAA,EACf;AACA,SAAO,MAAM;AACf;AAMO,SAAS,oBAAoB,SAAgC;AAClE,SAAO,SAAS,OAAO,GAAG,oBAAoB;AAChD;AAUO,SAAS,gBAAgB,UAAoB,gBAAmC;AACrF,MAAI,aAAa,aAAa;AAC5B,WAAO,OAAO,KAAK,CAAC,MAAM,EAAE,OAAO,mBAAmB;AAAA,EACxD;AACA,MAAI,aAAa,YAAY,aAAa,SAAS,aAAa,YAAY;AAC1E,UAAM,MAAM,qBAAqB,QAAQ,EAAE,KAAK,CAAC,MAAM,EAAE,aAAa,KAAK;AAC3E,QAAI,IAAK,QAAO;AAAA,EAClB;AAEA,SAAO,SAAS,cAAc,KAAK,gBAAgB,QAAQ;AAC7D;","names":[]}
@@ -0,0 +1,78 @@
1
+ import { Provider, ThinkingLevel } from '@prestyj/ai';
2
+
3
+ interface ModelInfo {
4
+ id: string;
5
+ name: string;
6
+ provider: Provider;
7
+ contextWindow: number;
8
+ /**
9
+ * ChatGPT Codex transport uses product-specific windows that can differ from
10
+ * the public API model window. OpenAI OAuth requests include an accountId and
11
+ * route through `/codex/responses`; API-key requests do not.
12
+ */
13
+ codexContextWindow?: number;
14
+ maxOutputTokens: number;
15
+ supportsThinking: boolean;
16
+ supportsImages: boolean;
17
+ supportsVideo: boolean;
18
+ /**
19
+ * Max video payload (bytes) this model's transport accepts, used to decide
20
+ * when an attached/read video must be compressed before sending. Differs by
21
+ * provider delivery mechanism:
22
+ * - Moonshot/Kimi: 100 MB (file-service upload cap)
23
+ * - MiniMax: 50 MB (Anthropic-compatible base64 inline cap)
24
+ * - Gemini: 20 MB (inlineData per-request cap)
25
+ * - Xiaomi (MiMo): ~36 MB raw — the API caps the base64 STRING at 50 MB,
26
+ * and base64 inflates bytes by ~4/3, so 36 MB raw ≈ 48 MB encoded.
27
+ * Only meaningful when `supportsVideo` is true.
28
+ */
29
+ maxVideoBytes?: number;
30
+ costTier: "low" | "medium" | "high";
31
+ /**
32
+ * The top reasoning tier this model genuinely uses. Used when thinking is
33
+ * enabled to pick the strongest setting per model:
34
+ * - OpenAI GPT-5.5-era: `xhigh`
35
+ * - OpenAI Pro/Codex/old: clamped to what the model accepts
36
+ * - Claude Fable 5 / Mythos 5, Opus 4.8 / 4.7 / 4.6 and Sonnet 4.6: `max`
37
+ * (Fable 5 / Mythos 5 use always-on adaptive thinking, low→max ladder)
38
+ * - Claude Haiku 4.5: `high` (no adaptive `max` tier)
39
+ * - GLM / Moonshot / Xiaomi / MiniMax / Qwen: `high` — binary-thinking
40
+ * providers ignore the level on the wire, so the value is cosmetic
41
+ * - DeepSeek V4: `xhigh` (DeepSeek maps `xhigh` → its internal `max`)
42
+ */
43
+ maxThinkingLevel: ThinkingLevel;
44
+ }
45
+ declare const MODELS: ModelInfo[];
46
+ declare function getModel(id: string): ModelInfo | undefined;
47
+ declare function getModelsForProvider(provider: Provider): ModelInfo[];
48
+ /** Default video payload cap (bytes) when a video model doesn't declare one. */
49
+ declare const DEFAULT_MAX_VIDEO_BYTES: number;
50
+ /**
51
+ * Max video payload (bytes) the given model's transport accepts before the clip
52
+ * must be compressed. Returns `undefined` for models without video support, so
53
+ * callers can skip the native-video path entirely.
54
+ */
55
+ declare function getVideoByteLimit(modelId: string): number | undefined;
56
+ declare function getDefaultModel(provider: Provider): ModelInfo;
57
+ interface ContextWindowOptions {
58
+ provider?: Provider;
59
+ accountId?: string;
60
+ }
61
+ declare function usesOpenAICodexTransport(options?: ContextWindowOptions): boolean;
62
+ declare function getContextWindow(modelId: string, options?: ContextWindowOptions): number;
63
+ /**
64
+ * The strongest thinking level the given model genuinely uses. Falls back to
65
+ * `"high"` for unknown models since every provider we ship accepts it.
66
+ */
67
+ declare function getMaxThinkingLevel(modelId: string): ThinkingLevel;
68
+ /**
69
+ * Get the model to use for compaction summarization.
70
+ * - Anthropic: always Sonnet 4.6
71
+ * - OpenAI: cheapest (Codex Mini)
72
+ * - Gemini: use the current model
73
+ * - GLM: GLM-4.7 Flash (cheap alternative)
74
+ * - Moonshot: use the current model (no cheap alternative)
75
+ */
76
+ declare function getSummaryModel(provider: Provider, currentModelId: string): ModelInfo;
77
+
78
+ export { type ContextWindowOptions, DEFAULT_MAX_VIDEO_BYTES, MODELS, type ModelInfo, getContextWindow, getDefaultModel, getMaxThinkingLevel, getModel, getModelsForProvider, getSummaryModel, getVideoByteLimit, usesOpenAICodexTransport };
@@ -0,0 +1,78 @@
1
+ import { Provider, ThinkingLevel } from '@prestyj/ai';
2
+
3
+ interface ModelInfo {
4
+ id: string;
5
+ name: string;
6
+ provider: Provider;
7
+ contextWindow: number;
8
+ /**
9
+ * ChatGPT Codex transport uses product-specific windows that can differ from
10
+ * the public API model window. OpenAI OAuth requests include an accountId and
11
+ * route through `/codex/responses`; API-key requests do not.
12
+ */
13
+ codexContextWindow?: number;
14
+ maxOutputTokens: number;
15
+ supportsThinking: boolean;
16
+ supportsImages: boolean;
17
+ supportsVideo: boolean;
18
+ /**
19
+ * Max video payload (bytes) this model's transport accepts, used to decide
20
+ * when an attached/read video must be compressed before sending. Differs by
21
+ * provider delivery mechanism:
22
+ * - Moonshot/Kimi: 100 MB (file-service upload cap)
23
+ * - MiniMax: 50 MB (Anthropic-compatible base64 inline cap)
24
+ * - Gemini: 20 MB (inlineData per-request cap)
25
+ * - Xiaomi (MiMo): ~36 MB raw — the API caps the base64 STRING at 50 MB,
26
+ * and base64 inflates bytes by ~4/3, so 36 MB raw ≈ 48 MB encoded.
27
+ * Only meaningful when `supportsVideo` is true.
28
+ */
29
+ maxVideoBytes?: number;
30
+ costTier: "low" | "medium" | "high";
31
+ /**
32
+ * The top reasoning tier this model genuinely uses. Used when thinking is
33
+ * enabled to pick the strongest setting per model:
34
+ * - OpenAI GPT-5.5-era: `xhigh`
35
+ * - OpenAI Pro/Codex/old: clamped to what the model accepts
36
+ * - Claude Fable 5 / Mythos 5, Opus 4.8 / 4.7 / 4.6 and Sonnet 4.6: `max`
37
+ * (Fable 5 / Mythos 5 use always-on adaptive thinking, low→max ladder)
38
+ * - Claude Haiku 4.5: `high` (no adaptive `max` tier)
39
+ * - GLM / Moonshot / Xiaomi / MiniMax / Qwen: `high` — binary-thinking
40
+ * providers ignore the level on the wire, so the value is cosmetic
41
+ * - DeepSeek V4: `xhigh` (DeepSeek maps `xhigh` → its internal `max`)
42
+ */
43
+ maxThinkingLevel: ThinkingLevel;
44
+ }
45
+ declare const MODELS: ModelInfo[];
46
+ declare function getModel(id: string): ModelInfo | undefined;
47
+ declare function getModelsForProvider(provider: Provider): ModelInfo[];
48
+ /** Default video payload cap (bytes) when a video model doesn't declare one. */
49
+ declare const DEFAULT_MAX_VIDEO_BYTES: number;
50
+ /**
51
+ * Max video payload (bytes) the given model's transport accepts before the clip
52
+ * must be compressed. Returns `undefined` for models without video support, so
53
+ * callers can skip the native-video path entirely.
54
+ */
55
+ declare function getVideoByteLimit(modelId: string): number | undefined;
56
+ declare function getDefaultModel(provider: Provider): ModelInfo;
57
+ interface ContextWindowOptions {
58
+ provider?: Provider;
59
+ accountId?: string;
60
+ }
61
+ declare function usesOpenAICodexTransport(options?: ContextWindowOptions): boolean;
62
+ declare function getContextWindow(modelId: string, options?: ContextWindowOptions): number;
63
+ /**
64
+ * The strongest thinking level the given model genuinely uses. Falls back to
65
+ * `"high"` for unknown models since every provider we ship accepts it.
66
+ */
67
+ declare function getMaxThinkingLevel(modelId: string): ThinkingLevel;
68
+ /**
69
+ * Get the model to use for compaction summarization.
70
+ * - Anthropic: always Sonnet 4.6
71
+ * - OpenAI: cheapest (Codex Mini)
72
+ * - Gemini: use the current model
73
+ * - GLM: GLM-4.7 Flash (cheap alternative)
74
+ * - Moonshot: use the current model (no cheap alternative)
75
+ */
76
+ declare function getSummaryModel(provider: Provider, currentModelId: string): ModelInfo;
77
+
78
+ export { type ContextWindowOptions, DEFAULT_MAX_VIDEO_BYTES, MODELS, type ModelInfo, getContextWindow, getDefaultModel, getMaxThinkingLevel, getModel, getModelsForProvider, getSummaryModel, getVideoByteLimit, usesOpenAICodexTransport };
@@ -0,0 +1,25 @@
1
+ import {
2
+ DEFAULT_MAX_VIDEO_BYTES,
3
+ MODELS,
4
+ getContextWindow,
5
+ getDefaultModel,
6
+ getMaxThinkingLevel,
7
+ getModel,
8
+ getModelsForProvider,
9
+ getSummaryModel,
10
+ getVideoByteLimit,
11
+ usesOpenAICodexTransport
12
+ } from "./chunk-LN5L2S5G.js";
13
+ export {
14
+ DEFAULT_MAX_VIDEO_BYTES,
15
+ MODELS,
16
+ getContextWindow,
17
+ getDefaultModel,
18
+ getMaxThinkingLevel,
19
+ getModel,
20
+ getModelsForProvider,
21
+ getSummaryModel,
22
+ getVideoByteLimit,
23
+ usesOpenAICodexTransport
24
+ };
25
+ //# sourceMappingURL=model-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/paths.cjs ADDED
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/paths.ts
31
+ var paths_exports = {};
32
+ __export(paths_exports, {
33
+ getAppPaths: () => getAppPaths
34
+ });
35
+ module.exports = __toCommonJS(paths_exports);
36
+ var import_node_path = __toESM(require("path"), 1);
37
+ var import_node_os = __toESM(require("os"), 1);
38
+ function getAppPaths() {
39
+ const agentDir = import_node_path.default.join(import_node_os.default.homedir(), ".ezcoder");
40
+ return {
41
+ agentDir,
42
+ sessionsDir: import_node_path.default.join(agentDir, "sessions"),
43
+ settingsFile: import_node_path.default.join(agentDir, "settings.json"),
44
+ authFile: import_node_path.default.join(agentDir, "auth.json"),
45
+ telegramFile: import_node_path.default.join(agentDir, "telegram.json"),
46
+ agentHomeFile: import_node_path.default.join(agentDir, "agent-home.json"),
47
+ mcpFile: import_node_path.default.join(agentDir, "mcp.json"),
48
+ logFile: import_node_path.default.join(agentDir, "debug.log"),
49
+ skillsDir: import_node_path.default.join(agentDir, "skills"),
50
+ extensionsDir: import_node_path.default.join(agentDir, "extensions"),
51
+ agentsDir: import_node_path.default.join(agentDir, "agents")
52
+ };
53
+ }
54
+ // Annotate the CommonJS export names for ESM import in node:
55
+ 0 && (module.exports = {
56
+ getAppPaths
57
+ });
58
+ //# sourceMappingURL=paths.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/paths.ts"],"sourcesContent":["import path from \"node:path\";\nimport os from \"node:os\";\n\nexport interface AppPaths {\n agentDir: string;\n sessionsDir: string;\n settingsFile: string;\n authFile: string;\n telegramFile: string;\n agentHomeFile: string;\n mcpFile: string;\n logFile: string;\n skillsDir: string;\n extensionsDir: string;\n agentsDir: string;\n}\n\nexport function getAppPaths(): AppPaths {\n const agentDir = path.join(os.homedir(), \".ezcoder\");\n return {\n agentDir,\n sessionsDir: path.join(agentDir, \"sessions\"),\n settingsFile: path.join(agentDir, \"settings.json\"),\n authFile: path.join(agentDir, \"auth.json\"),\n telegramFile: path.join(agentDir, \"telegram.json\"),\n agentHomeFile: path.join(agentDir, \"agent-home.json\"),\n mcpFile: path.join(agentDir, \"mcp.json\"),\n logFile: path.join(agentDir, \"debug.log\"),\n skillsDir: path.join(agentDir, \"skills\"),\n extensionsDir: path.join(agentDir, \"extensions\"),\n agentsDir: path.join(agentDir, \"agents\"),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAiB;AACjB,qBAAe;AAgBR,SAAS,cAAwB;AACtC,QAAM,WAAW,iBAAAA,QAAK,KAAK,eAAAC,QAAG,QAAQ,GAAG,UAAU;AACnD,SAAO;AAAA,IACL;AAAA,IACA,aAAa,iBAAAD,QAAK,KAAK,UAAU,UAAU;AAAA,IAC3C,cAAc,iBAAAA,QAAK,KAAK,UAAU,eAAe;AAAA,IACjD,UAAU,iBAAAA,QAAK,KAAK,UAAU,WAAW;AAAA,IACzC,cAAc,iBAAAA,QAAK,KAAK,UAAU,eAAe;AAAA,IACjD,eAAe,iBAAAA,QAAK,KAAK,UAAU,iBAAiB;AAAA,IACpD,SAAS,iBAAAA,QAAK,KAAK,UAAU,UAAU;AAAA,IACvC,SAAS,iBAAAA,QAAK,KAAK,UAAU,WAAW;AAAA,IACxC,WAAW,iBAAAA,QAAK,KAAK,UAAU,QAAQ;AAAA,IACvC,eAAe,iBAAAA,QAAK,KAAK,UAAU,YAAY;AAAA,IAC/C,WAAW,iBAAAA,QAAK,KAAK,UAAU,QAAQ;AAAA,EACzC;AACF;","names":["path","os"]}