@codeworksh/aikit 0.6.0-dev.20260613095948 → 0.7.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/cli.d.mts +1 -1
- package/cli.mjs +7 -238
- package/cli.mjs.map +1 -1
- package/{codex-C36oU6yH.mjs → codex-DyQHzQmn.mjs} +24 -24
- package/codex-DyQHzQmn.mjs.map +1 -0
- package/index.d.mts +7948 -6669
- package/index.mjs +788 -614
- package/index.mjs.map +1 -1
- package/model-En2JLLXC.d.mts +328 -0
- package/modelgen-BcsqB44a.mjs +325 -0
- package/modelgen-BcsqB44a.mjs.map +1 -0
- package/modelgen.d.mts +9 -0
- package/modelgen.mjs +2 -0
- package/oauth/openai/codex.mjs +1 -1
- package/openai-codex-FcyE8vxh.mjs +2 -0
- package/openai-codex-_3XkJ4bs.mjs +1158 -0
- package/openai-codex-_3XkJ4bs.mjs.map +1 -0
- package/package.json +18 -13
- package/{registry-DUKrGxt4.mjs → registry-CMkIE_B4.mjs} +591 -503
- package/{registry-DUKrGxt4.mjs.map → registry-CMkIE_B4.mjs.map} +1 -1
- package/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/codex-C36oU6yH.mjs.map +0 -1
- package/openai-codex-CZrBnLAJ.mjs +0 -753
- package/openai-codex-CZrBnLAJ.mjs.map +0 -1
- package/openai-codex-bzfev3us.mjs +0 -2
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { pipeline } from "stream/promises";
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import Type$1 from "typebox";
|
|
3
|
+
import { lstatSync, readdir, readdirSync, readlinkSync, realpathSync } from "fs";
|
|
4
|
+
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
5
|
+
import { dirname } from "path";
|
|
7
6
|
import { fileURLToPath } from "node:url";
|
|
8
|
-
import { join
|
|
7
|
+
import { join, posix, resolve, win32 } from "node:path";
|
|
9
8
|
import * as xi from "node:fs";
|
|
10
9
|
import { lstat, readdir as readdir$1, readlink, realpath } from "node:fs/promises";
|
|
11
10
|
import { EventEmitter } from "node:events";
|
|
@@ -27,6 +26,7 @@ var NamedError = class NamedError extends Error {
|
|
|
27
26
|
const result = class extends NamedError {
|
|
28
27
|
static Schema = schema;
|
|
29
28
|
name = name;
|
|
29
|
+
data;
|
|
30
30
|
constructor(data, options) {
|
|
31
31
|
super(name, options);
|
|
32
32
|
this.data = data;
|
|
@@ -56,133 +56,32 @@ var NamedError = class NamedError extends Error {
|
|
|
56
56
|
};
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region ../utils/src/filesystem.ts
|
|
59
|
-
|
|
60
|
-
(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
_Filesystem.stat = stat;
|
|
77
|
-
async function size(path) {
|
|
78
|
-
const result = stat(path)?.size ?? 0;
|
|
79
|
-
return typeof result === "bigint" ? Number(result) : result;
|
|
80
|
-
}
|
|
81
|
-
_Filesystem.size = size;
|
|
82
|
-
async function readText(path) {
|
|
83
|
-
return readFile(path, "utf-8");
|
|
84
|
-
}
|
|
85
|
-
_Filesystem.readText = readText;
|
|
86
|
-
async function readJson(path) {
|
|
87
|
-
return JSON.parse(await readFile(path, "utf-8"));
|
|
88
|
-
}
|
|
89
|
-
_Filesystem.readJson = readJson;
|
|
90
|
-
async function readBytes(path) {
|
|
91
|
-
return readFile(path);
|
|
92
|
-
}
|
|
93
|
-
_Filesystem.readBytes = readBytes;
|
|
94
|
-
async function readArrayBuffer(path) {
|
|
95
|
-
const buffer = await readFile(path);
|
|
96
|
-
return buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
|
|
97
|
-
}
|
|
98
|
-
_Filesystem.readArrayBuffer = readArrayBuffer;
|
|
99
|
-
function isEnoent(error) {
|
|
100
|
-
return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
|
|
101
|
-
}
|
|
102
|
-
async function write(path, content, mode) {
|
|
103
|
-
try {
|
|
59
|
+
async function readText(path) {
|
|
60
|
+
return readFile(path, "utf-8");
|
|
61
|
+
}
|
|
62
|
+
async function readJson(path) {
|
|
63
|
+
return JSON.parse(await readFile(path, "utf-8"));
|
|
64
|
+
}
|
|
65
|
+
function isEnoent(error) {
|
|
66
|
+
return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
|
|
67
|
+
}
|
|
68
|
+
async function write(path, content, mode) {
|
|
69
|
+
try {
|
|
70
|
+
if (mode) await writeFile(path, content, { mode });
|
|
71
|
+
else await writeFile(path, content);
|
|
72
|
+
} catch (error) {
|
|
73
|
+
if (isEnoent(error)) {
|
|
74
|
+
await mkdir(dirname(path), { recursive: true });
|
|
104
75
|
if (mode) await writeFile(path, content, { mode });
|
|
105
76
|
else await writeFile(path, content);
|
|
106
|
-
|
|
107
|
-
if (isEnoent(error)) {
|
|
108
|
-
await mkdir(dirname(path), { recursive: true });
|
|
109
|
-
if (mode) await writeFile(path, content, { mode });
|
|
110
|
-
else await writeFile(path, content);
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
throw error;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
_Filesystem.write = write;
|
|
117
|
-
async function writeJson(path, data, mode) {
|
|
118
|
-
return write(path, JSON.stringify(data, null, 2), mode);
|
|
119
|
-
}
|
|
120
|
-
_Filesystem.writeJson = writeJson;
|
|
121
|
-
async function writeStream(path, stream, mode) {
|
|
122
|
-
const directory = dirname(path);
|
|
123
|
-
if (!existsSync(directory)) await mkdir(directory, { recursive: true });
|
|
124
|
-
await pipeline(stream instanceof ReadableStream ? Readable.fromWeb(stream) : stream, createWriteStream(path));
|
|
125
|
-
if (mode) await chmod(path, mode);
|
|
126
|
-
}
|
|
127
|
-
_Filesystem.writeStream = writeStream;
|
|
128
|
-
function normalizePath(path) {
|
|
129
|
-
if (process.platform !== "win32") return path;
|
|
130
|
-
try {
|
|
131
|
-
return realpathSync.native(path);
|
|
132
|
-
} catch {
|
|
133
|
-
return path;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
_Filesystem.normalizePath = normalizePath;
|
|
137
|
-
function windowsPath(p) {
|
|
138
|
-
if (process.platform !== "win32") return p;
|
|
139
|
-
return p.replace(/^\/([a-zA-Z]):(?:[\\/]|$)/, (_, drive) => `${drive.toUpperCase()}:/`).replace(/^\/([a-zA-Z])(?:\/|$)/, (_, drive) => `${drive.toUpperCase()}:/`).replace(/^\/cygdrive\/([a-zA-Z])(?:\/|$)/, (_, drive) => `${drive.toUpperCase()}:/`).replace(/^\/mnt\/([a-zA-Z])(?:\/|$)/, (_, drive) => `${drive.toUpperCase()}:/`);
|
|
140
|
-
}
|
|
141
|
-
_Filesystem.windowsPath = windowsPath;
|
|
142
|
-
function overlaps(a, b) {
|
|
143
|
-
const relA = relative(a, b);
|
|
144
|
-
const relB = relative(b, a);
|
|
145
|
-
return !relA?.startsWith("..") || !relB?.startsWith("..");
|
|
146
|
-
}
|
|
147
|
-
_Filesystem.overlaps = overlaps;
|
|
148
|
-
function contains(parent, child) {
|
|
149
|
-
return !relative(parent, child).startsWith("..");
|
|
150
|
-
}
|
|
151
|
-
_Filesystem.contains = contains;
|
|
152
|
-
async function findUp(target, start, stop) {
|
|
153
|
-
let current = start;
|
|
154
|
-
const result = [];
|
|
155
|
-
while (true) {
|
|
156
|
-
const search = join(current, target);
|
|
157
|
-
if (await exists(search)) result.push(search);
|
|
158
|
-
if (stop === current) break;
|
|
159
|
-
const parent = dirname(current);
|
|
160
|
-
if (parent === current) break;
|
|
161
|
-
current = parent;
|
|
162
|
-
}
|
|
163
|
-
return result;
|
|
164
|
-
}
|
|
165
|
-
_Filesystem.findUp = findUp;
|
|
166
|
-
async function* up(options) {
|
|
167
|
-
const { targets, start, stop } = options;
|
|
168
|
-
let current = start;
|
|
169
|
-
while (true) {
|
|
170
|
-
for (const target of targets) {
|
|
171
|
-
const search = join(current, target);
|
|
172
|
-
if (await exists(search)) yield search;
|
|
173
|
-
}
|
|
174
|
-
if (stop === current) break;
|
|
175
|
-
const parent = dirname(current);
|
|
176
|
-
if (parent === current) break;
|
|
177
|
-
current = parent;
|
|
77
|
+
return;
|
|
178
78
|
}
|
|
79
|
+
throw error;
|
|
179
80
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
_Filesystem.resolve = resolve$2;
|
|
185
|
-
})(Filesystem || (Filesystem = {}));
|
|
81
|
+
}
|
|
82
|
+
async function writeJson(path, data, mode) {
|
|
83
|
+
return write(path, JSON.stringify(data, null, 2), mode);
|
|
84
|
+
}
|
|
186
85
|
//#endregion
|
|
187
86
|
//#region ../utils/src/lazy.ts
|
|
188
87
|
function lazy(fn) {
|
|
@@ -211,10 +110,12 @@ var Gt = (n, t, e) => {
|
|
|
211
110
|
body: e.slice(r[0] + s.length, r[1]),
|
|
212
111
|
post: e.slice(r[1] + i.length)
|
|
213
112
|
};
|
|
214
|
-
}
|
|
113
|
+
};
|
|
114
|
+
var ce = (n, t) => {
|
|
215
115
|
let e = t.match(n);
|
|
216
116
|
return e ? e[0] : null;
|
|
217
|
-
}
|
|
117
|
+
};
|
|
118
|
+
var ss = (n, t, e) => {
|
|
218
119
|
let s, i, r, o, h, a = e.indexOf(n), l = e.indexOf(t, a + 1), u = a;
|
|
219
120
|
if (a >= 0 && l > 0) {
|
|
220
121
|
if (n === t) return [a, l];
|
|
@@ -230,7 +131,22 @@ var Gt = (n, t, e) => {
|
|
|
230
131
|
}
|
|
231
132
|
return h;
|
|
232
133
|
};
|
|
233
|
-
var fe = "\0SLASH" + Math.random() + "\0"
|
|
134
|
+
var fe = "\0SLASH" + Math.random() + "\0";
|
|
135
|
+
var ue = "\0OPEN" + Math.random() + "\0";
|
|
136
|
+
var qt = "\0CLOSE" + Math.random() + "\0";
|
|
137
|
+
var de = "\0COMMA" + Math.random() + "\0";
|
|
138
|
+
var pe = "\0PERIOD" + Math.random() + "\0";
|
|
139
|
+
var is = new RegExp(fe, "g");
|
|
140
|
+
var rs = new RegExp(ue, "g");
|
|
141
|
+
var ns = new RegExp(qt, "g");
|
|
142
|
+
var os = new RegExp(de, "g");
|
|
143
|
+
var hs = new RegExp(pe, "g");
|
|
144
|
+
var as = /\\\\/g;
|
|
145
|
+
var ls = /\\{/g;
|
|
146
|
+
var cs = /\\}/g;
|
|
147
|
+
var fs = /\\,/g;
|
|
148
|
+
var us = /\\./g;
|
|
149
|
+
var ds = 1e5;
|
|
234
150
|
function Ht(n) {
|
|
235
151
|
return isNaN(n) ? n.charCodeAt(0) : parseInt(n, 10);
|
|
236
152
|
}
|
|
@@ -332,7 +248,11 @@ var Ss = {
|
|
|
332
248
|
"[:upper:]": ["\\p{Lu}", !0],
|
|
333
249
|
"[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", !0],
|
|
334
250
|
"[:xdigit:]": ["A-Fa-f0-9", !1]
|
|
335
|
-
}
|
|
251
|
+
};
|
|
252
|
+
var lt = (n) => n.replace(/[[\]\\-]/g, "\\$&");
|
|
253
|
+
var Es = (n) => n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
254
|
+
var we = (n) => n.join("");
|
|
255
|
+
var ye = (n, t) => {
|
|
336
256
|
let e = t;
|
|
337
257
|
if (n.charAt(e) !== "[") throw new Error("not in a brace expression");
|
|
338
258
|
let s = [], i = [], r = e + 1, o = !1, h = !1, a = !1, l = !1, u = e, c = "";
|
|
@@ -403,13 +323,24 @@ var Ss = {
|
|
|
403
323
|
];
|
|
404
324
|
};
|
|
405
325
|
var W = (n, { windowsPathsNoEscape: t = !1, magicalBraces: e = !0 } = {}) => e ? t ? n.replace(/\[([^\/\\])\]/g, "$1") : n.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1") : t ? n.replace(/\[([^\/\\{}])\]/g, "$1") : n.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, "$1$2").replace(/\\([^\/{}])/g, "$1");
|
|
406
|
-
var xs = new Set([
|
|
326
|
+
var xs = /* @__PURE__ */ new Set([
|
|
407
327
|
"!",
|
|
408
328
|
"?",
|
|
409
329
|
"+",
|
|
410
330
|
"*",
|
|
411
331
|
"@"
|
|
412
|
-
])
|
|
332
|
+
]);
|
|
333
|
+
var be = (n) => xs.has(n);
|
|
334
|
+
var vs = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
|
335
|
+
var Ct = "(?!\\.)";
|
|
336
|
+
var Cs = /* @__PURE__ */ new Set(["[", "."]);
|
|
337
|
+
var Ts = /* @__PURE__ */ new Set(["..", "."]);
|
|
338
|
+
var As = /* @__PURE__ */ new Set("().*{}+?[]^$\\!");
|
|
339
|
+
var ks = (n) => n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
340
|
+
var Kt = "[^/]";
|
|
341
|
+
var Se = Kt + "*?";
|
|
342
|
+
var Ee = Kt + "+?";
|
|
343
|
+
var Q = class n {
|
|
413
344
|
type;
|
|
414
345
|
#t;
|
|
415
346
|
#s;
|
|
@@ -650,34 +581,60 @@ var xs = new Set([
|
|
|
650
581
|
}
|
|
651
582
|
};
|
|
652
583
|
var tt = (n, { windowsPathsNoEscape: t = !1, magicalBraces: e = !1 } = {}) => e ? t ? n.replace(/[?*()[\]{}]/g, "[$&]") : n.replace(/[?*()[\]\\{}]/g, "\\$&") : t ? n.replace(/[?*()[\]]/g, "[$&]") : n.replace(/[?*()[\]\\]/g, "\\$&");
|
|
653
|
-
var O = (n, t, e = {}) => (at(t), !e.nocomment && t.charAt(0) === "#" ? !1 : new D(t, e).match(n))
|
|
584
|
+
var O = (n, t, e = {}) => (at(t), !e.nocomment && t.charAt(0) === "#" ? !1 : new D(t, e).match(n));
|
|
585
|
+
var Rs = /^\*+([^+@!?\*\[\(]*)$/;
|
|
586
|
+
var Os = (n) => (t) => !t.startsWith(".") && t.endsWith(n);
|
|
587
|
+
var Fs = (n) => (t) => t.endsWith(n);
|
|
588
|
+
var Ds = (n) => (n = n.toLowerCase(), (t) => !t.startsWith(".") && t.toLowerCase().endsWith(n));
|
|
589
|
+
var Ms = (n) => (n = n.toLowerCase(), (t) => t.toLowerCase().endsWith(n));
|
|
590
|
+
var Ns = /^\*+\.\*+$/;
|
|
591
|
+
var _s = (n) => !n.startsWith(".") && n.includes(".");
|
|
592
|
+
var Ls = (n) => n !== "." && n !== ".." && n.includes(".");
|
|
593
|
+
var Ws = /^\.\*+$/;
|
|
594
|
+
var Ps = (n) => n !== "." && n !== ".." && n.startsWith(".");
|
|
595
|
+
var js = /^\*+$/;
|
|
596
|
+
var Is = (n) => n.length !== 0 && !n.startsWith(".");
|
|
597
|
+
var zs = (n) => n.length !== 0 && n !== "." && n !== "..";
|
|
598
|
+
var Bs = /^\?+([^+@!?\*\[\(]*)?$/;
|
|
599
|
+
var Us = ([n, t = ""]) => {
|
|
654
600
|
let e = Ce([n]);
|
|
655
601
|
return t ? (t = t.toLowerCase(), (s) => e(s) && s.toLowerCase().endsWith(t)) : e;
|
|
656
|
-
}
|
|
602
|
+
};
|
|
603
|
+
var $s = ([n, t = ""]) => {
|
|
657
604
|
let e = Te([n]);
|
|
658
605
|
return t ? (t = t.toLowerCase(), (s) => e(s) && s.toLowerCase().endsWith(t)) : e;
|
|
659
|
-
}
|
|
606
|
+
};
|
|
607
|
+
var Gs = ([n, t = ""]) => {
|
|
660
608
|
let e = Te([n]);
|
|
661
609
|
return t ? (s) => e(s) && s.endsWith(t) : e;
|
|
662
|
-
}
|
|
610
|
+
};
|
|
611
|
+
var Hs = ([n, t = ""]) => {
|
|
663
612
|
let e = Ce([n]);
|
|
664
613
|
return t ? (s) => e(s) && s.endsWith(t) : e;
|
|
665
|
-
}
|
|
614
|
+
};
|
|
615
|
+
var Ce = ([n]) => {
|
|
666
616
|
let t = n.length;
|
|
667
617
|
return (e) => e.length === t && !e.startsWith(".");
|
|
668
|
-
}
|
|
618
|
+
};
|
|
619
|
+
var Te = ([n]) => {
|
|
669
620
|
let t = n.length;
|
|
670
621
|
return (e) => e.length === t && e !== "." && e !== "..";
|
|
671
|
-
}
|
|
622
|
+
};
|
|
623
|
+
var Ae = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
624
|
+
var xe = {
|
|
672
625
|
win32: { sep: "\\" },
|
|
673
626
|
posix: { sep: "/" }
|
|
674
627
|
};
|
|
675
628
|
O.sep = Ae === "win32" ? xe.win32.sep : xe.posix.sep;
|
|
676
629
|
var A = Symbol("globstar **");
|
|
677
630
|
O.GLOBSTAR = A;
|
|
678
|
-
var Vs = "[^/]*?"
|
|
631
|
+
var Vs = "[^/]*?";
|
|
632
|
+
var Ys = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
|
|
633
|
+
var Xs = "(?:(?!(?:\\/|^)\\.).)*?";
|
|
634
|
+
var Js = (n, t = {}) => (e) => O(e, n, t);
|
|
679
635
|
O.filter = Js;
|
|
680
|
-
var N = (n, t = {}) => Object.assign({}, n, t)
|
|
636
|
+
var N = (n, t = {}) => Object.assign({}, n, t);
|
|
637
|
+
var Zs = (n) => {
|
|
681
638
|
if (!n || typeof n != "object" || !Object.keys(n).length) return O;
|
|
682
639
|
let t = O;
|
|
683
640
|
return Object.assign((s, i, r = {}) => t(s, i, N(n, r)), {
|
|
@@ -718,7 +675,9 @@ var ti = (n, t, e = {}) => {
|
|
|
718
675
|
return n = n.filter((i) => s.match(i)), s.options.nonull && !n.length && n.push(t), n;
|
|
719
676
|
};
|
|
720
677
|
O.match = ti;
|
|
721
|
-
var ve = /[?*]|[+@!]\(.*?\)|\[|\]
|
|
678
|
+
var ve = /[?*]|[+@!]\(.*?\)|\[|\]/;
|
|
679
|
+
var ei = (n) => n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
680
|
+
var D = class {
|
|
722
681
|
options;
|
|
723
682
|
set;
|
|
724
683
|
pattern;
|
|
@@ -738,7 +697,8 @@ var ve = /[?*]|[+@!]\(.*?\)|\[|\]/, ei = (n) => n.replace(/[-[\]{}()*+?.,\\^$|#\
|
|
|
738
697
|
regexp;
|
|
739
698
|
constructor(t, e = {}) {
|
|
740
699
|
at(t), e = e || {}, this.options = e, this.pattern = t, this.platform = e.platform || Ae, this.isWindows = this.platform === "win32";
|
|
741
|
-
|
|
700
|
+
let s = "allowWindowsEscape";
|
|
701
|
+
this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e[s] === !1, this.windowsPathsNoEscape && (this.pattern = this.pattern.replace(/\\/g, "/")), this.preserveMultipleSlashes = !!e.preserveMultipleSlashes, this.regexp = null, this.negate = !1, this.nonegate = !!e.nonegate, this.comment = !1, this.empty = !1, this.partial = !!e.partial, this.nocase = !!this.options.nocase, this.windowsNoMagicRoot = e.windowsNoMagicRoot !== void 0 ? e.windowsNoMagicRoot : !!(this.isWindows && this.nocase), this.globSet = [], this.globParts = [], this.set = [], this.make();
|
|
742
702
|
}
|
|
743
703
|
hasMagic() {
|
|
744
704
|
if (this.options.magicalBraces && this.set.length > 1) return !0;
|
|
@@ -1001,9 +961,14 @@ O.AST = Q;
|
|
|
1001
961
|
O.Minimatch = D;
|
|
1002
962
|
O.escape = tt;
|
|
1003
963
|
O.unescape = W;
|
|
1004
|
-
var si = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date
|
|
964
|
+
var si = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
965
|
+
var Oe = /* @__PURE__ */ new Set();
|
|
966
|
+
var Vt = typeof process == "object" && process ? process : {};
|
|
967
|
+
var Fe = (n, t, e, s) => {
|
|
1005
968
|
typeof Vt.emitWarning == "function" ? Vt.emitWarning(n, t, e, s) : console.error(`[${e}] ${t}: ${n}`);
|
|
1006
|
-
}
|
|
969
|
+
};
|
|
970
|
+
var At = globalThis.AbortController;
|
|
971
|
+
var Re = globalThis.AbortSignal;
|
|
1007
972
|
if (typeof At > "u") {
|
|
1008
973
|
Re = class {
|
|
1009
974
|
onabort;
|
|
@@ -1031,11 +996,14 @@ if (typeof At > "u") {
|
|
|
1031
996
|
};
|
|
1032
997
|
}
|
|
1033
998
|
var ii = (n) => !Oe.has(n);
|
|
1034
|
-
var q = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n)
|
|
999
|
+
var q = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n);
|
|
1000
|
+
var De = (n) => q(n) ? n <= Math.pow(2, 8) ? Uint8Array : n <= Math.pow(2, 16) ? Uint16Array : n <= Math.pow(2, 32) ? Uint32Array : n <= Number.MAX_SAFE_INTEGER ? Tt : null : null;
|
|
1001
|
+
var Tt = class extends Array {
|
|
1035
1002
|
constructor(n) {
|
|
1036
1003
|
super(n), this.fill(0);
|
|
1037
1004
|
}
|
|
1038
|
-
}
|
|
1005
|
+
};
|
|
1006
|
+
var ri = class ct {
|
|
1039
1007
|
heap;
|
|
1040
1008
|
length;
|
|
1041
1009
|
static #t = !1;
|
|
@@ -1056,7 +1024,8 @@ var q = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n), De = (n) => q(n
|
|
|
1056
1024
|
pop() {
|
|
1057
1025
|
return this.heap[--this.length];
|
|
1058
1026
|
}
|
|
1059
|
-
}
|
|
1027
|
+
};
|
|
1028
|
+
var ft = class Me {
|
|
1060
1029
|
#t;
|
|
1061
1030
|
#s;
|
|
1062
1031
|
#n;
|
|
@@ -1599,7 +1568,47 @@ var q = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n), De = (n) => q(n
|
|
|
1599
1568
|
var Ne = typeof process == "object" && process ? process : {
|
|
1600
1569
|
stdout: null,
|
|
1601
1570
|
stderr: null
|
|
1602
|
-
}
|
|
1571
|
+
};
|
|
1572
|
+
var oi = (n) => !!n && typeof n == "object" && (n instanceof V || n instanceof Pe || hi(n) || ai(n));
|
|
1573
|
+
var hi = (n) => !!n && typeof n == "object" && n instanceof EventEmitter && typeof n.pipe == "function" && n.pipe !== Pe.Writable.prototype.pipe;
|
|
1574
|
+
var ai = (n) => !!n && typeof n == "object" && n instanceof EventEmitter && typeof n.write == "function" && typeof n.end == "function";
|
|
1575
|
+
var G = Symbol("EOF");
|
|
1576
|
+
var H = Symbol("maybeEmitEnd");
|
|
1577
|
+
var K = Symbol("emittedEnd");
|
|
1578
|
+
var kt = Symbol("emittingEnd");
|
|
1579
|
+
var ut = Symbol("emittedError");
|
|
1580
|
+
var Rt = Symbol("closed");
|
|
1581
|
+
var _e = Symbol("read");
|
|
1582
|
+
var Ot = Symbol("flush");
|
|
1583
|
+
var Le = Symbol("flushChunk");
|
|
1584
|
+
var P = Symbol("encoding");
|
|
1585
|
+
var et = Symbol("decoder");
|
|
1586
|
+
var v = Symbol("flowing");
|
|
1587
|
+
var dt = Symbol("paused");
|
|
1588
|
+
var st = Symbol("resume");
|
|
1589
|
+
var C = Symbol("buffer");
|
|
1590
|
+
var F = Symbol("pipes");
|
|
1591
|
+
var T = Symbol("bufferLength");
|
|
1592
|
+
var Yt = Symbol("bufferPush");
|
|
1593
|
+
var Ft = Symbol("bufferShift");
|
|
1594
|
+
var k = Symbol("objectMode");
|
|
1595
|
+
var x = Symbol("destroyed");
|
|
1596
|
+
var Xt = Symbol("error");
|
|
1597
|
+
var Jt = Symbol("emitData");
|
|
1598
|
+
var We = Symbol("emitEnd");
|
|
1599
|
+
var Zt = Symbol("emitEnd2");
|
|
1600
|
+
var B = Symbol("async");
|
|
1601
|
+
var Qt = Symbol("abort");
|
|
1602
|
+
var Dt = Symbol("aborted");
|
|
1603
|
+
var pt = Symbol("signal");
|
|
1604
|
+
var Y = Symbol("dataListeners");
|
|
1605
|
+
var M = Symbol("discarded");
|
|
1606
|
+
var mt = (n) => Promise.resolve().then(n);
|
|
1607
|
+
var li = (n) => n();
|
|
1608
|
+
var ci = (n) => n === "end" || n === "finish" || n === "prefinish";
|
|
1609
|
+
var fi = (n) => n instanceof ArrayBuffer || !!n && typeof n == "object" && n.constructor && n.constructor.name === "ArrayBuffer" && n.byteLength >= 0;
|
|
1610
|
+
var ui = (n) => !Buffer.isBuffer(n) && ArrayBuffer.isView(n);
|
|
1611
|
+
var Mt = class {
|
|
1603
1612
|
src;
|
|
1604
1613
|
dest;
|
|
1605
1614
|
opts;
|
|
@@ -1614,14 +1623,18 @@ var Ne = typeof process == "object" && process ? process : {
|
|
|
1614
1623
|
end() {
|
|
1615
1624
|
this.unpipe(), this.opts.end && this.dest.end();
|
|
1616
1625
|
}
|
|
1617
|
-
}
|
|
1626
|
+
};
|
|
1627
|
+
var te = class extends Mt {
|
|
1618
1628
|
unpipe() {
|
|
1619
1629
|
this.src.removeListener("error", this.proxyErrors), super.unpipe();
|
|
1620
1630
|
}
|
|
1621
1631
|
constructor(t, e, s) {
|
|
1622
1632
|
super(t, e, s), this.proxyErrors = (i) => this.dest.emit("error", i), t.on("error", this.proxyErrors);
|
|
1623
1633
|
}
|
|
1624
|
-
}
|
|
1634
|
+
};
|
|
1635
|
+
var di = (n) => !!n.objectMode;
|
|
1636
|
+
var pi = (n) => !n.objectMode && !!n.encoding && n.encoding !== "buffer";
|
|
1637
|
+
var V = class extends EventEmitter {
|
|
1625
1638
|
[v] = !1;
|
|
1626
1639
|
[dt] = !1;
|
|
1627
1640
|
[F] = [];
|
|
@@ -1918,47 +1931,80 @@ while (this[Le](this[Ft]()) && this[C].length);
|
|
|
1918
1931
|
static get isStream() {
|
|
1919
1932
|
return oi;
|
|
1920
1933
|
}
|
|
1921
|
-
}
|
|
1934
|
+
};
|
|
1935
|
+
var vi = realpathSync.native;
|
|
1936
|
+
var wt = {
|
|
1922
1937
|
lstatSync,
|
|
1923
1938
|
readdir,
|
|
1924
1939
|
readdirSync,
|
|
1925
1940
|
readlinkSync,
|
|
1926
|
-
realpathSync:
|
|
1941
|
+
realpathSync: vi,
|
|
1927
1942
|
promises: {
|
|
1928
1943
|
lstat,
|
|
1929
1944
|
readdir: readdir$1,
|
|
1930
1945
|
readlink,
|
|
1931
1946
|
realpath
|
|
1932
1947
|
}
|
|
1933
|
-
}
|
|
1948
|
+
};
|
|
1949
|
+
var Ue = (n) => !n || n === wt || n === xi ? wt : {
|
|
1934
1950
|
...wt,
|
|
1935
1951
|
...n,
|
|
1936
1952
|
promises: {
|
|
1937
1953
|
...wt.promises,
|
|
1938
1954
|
...n.promises || {}
|
|
1939
1955
|
}
|
|
1940
|
-
}
|
|
1956
|
+
};
|
|
1957
|
+
var $e = /^\\\\\?\\([a-z]:)\\?$/i;
|
|
1958
|
+
var Ri = (n) => n.replace(/\//g, "\\").replace($e, "$1\\");
|
|
1959
|
+
var Oi = /[\\\/]/;
|
|
1960
|
+
var L = 0;
|
|
1961
|
+
var Ge = 1;
|
|
1962
|
+
var He = 2;
|
|
1963
|
+
var U = 4;
|
|
1964
|
+
var qe = 6;
|
|
1965
|
+
var Ke = 8;
|
|
1966
|
+
var X = 10;
|
|
1967
|
+
var Ve = 12;
|
|
1968
|
+
var _ = 15;
|
|
1969
|
+
var gt = ~_;
|
|
1970
|
+
var se = 16;
|
|
1971
|
+
var je = 32;
|
|
1972
|
+
var yt = 64;
|
|
1973
|
+
var j = 128;
|
|
1974
|
+
var Nt = 256;
|
|
1975
|
+
var Lt = 512;
|
|
1976
|
+
var Ie = yt | j | Lt;
|
|
1977
|
+
var Fi = 1023;
|
|
1978
|
+
var ie = (n) => n.isFile() ? Ke : n.isDirectory() ? U : n.isSymbolicLink() ? X : n.isCharacterDevice() ? He : n.isBlockDevice() ? qe : n.isSocket() ? Ve : n.isFIFO() ? Ge : L;
|
|
1979
|
+
var ze = new ft({ max: 2 ** 12 });
|
|
1980
|
+
var bt = (n) => {
|
|
1941
1981
|
let t = ze.get(n);
|
|
1942
1982
|
if (t) return t;
|
|
1943
1983
|
let e = n.normalize("NFKD");
|
|
1944
1984
|
return ze.set(n, e), e;
|
|
1945
|
-
}
|
|
1985
|
+
};
|
|
1986
|
+
var Be = new ft({ max: 2 ** 12 });
|
|
1987
|
+
var _t = (n) => {
|
|
1946
1988
|
let t = Be.get(n);
|
|
1947
1989
|
if (t) return t;
|
|
1948
1990
|
let e = bt(n.toLowerCase());
|
|
1949
1991
|
return Be.set(n, e), e;
|
|
1950
|
-
}
|
|
1992
|
+
};
|
|
1993
|
+
var Wt = class extends ft {
|
|
1951
1994
|
constructor() {
|
|
1952
1995
|
super({ max: 256 });
|
|
1953
1996
|
}
|
|
1954
|
-
}
|
|
1955
|
-
|
|
1997
|
+
};
|
|
1998
|
+
var ne = class extends ft {
|
|
1999
|
+
constructor(t = 16384) {
|
|
1956
2000
|
super({
|
|
1957
2001
|
maxSize: t,
|
|
1958
2002
|
sizeCalculation: (e) => e.length + 1
|
|
1959
2003
|
});
|
|
1960
2004
|
}
|
|
1961
|
-
}
|
|
2005
|
+
};
|
|
2006
|
+
var Ye = Symbol("PathScurry setAsCwd");
|
|
2007
|
+
var R = class {
|
|
1962
2008
|
name;
|
|
1963
2009
|
root;
|
|
1964
2010
|
roots;
|
|
@@ -2112,7 +2158,8 @@ while (this[Le](this[Ft]()) && this[C].length);
|
|
|
2112
2158
|
if (this.#g !== void 0) return this.#g;
|
|
2113
2159
|
let t = this.name, e = this.parent;
|
|
2114
2160
|
if (!e) return this.#g = this.name;
|
|
2115
|
-
|
|
2161
|
+
let i = e.fullpath() + (e.parent ? this.sep : "") + t;
|
|
2162
|
+
return this.#g = i;
|
|
2116
2163
|
}
|
|
2117
2164
|
fullpathPosix() {
|
|
2118
2165
|
if (this.#y !== void 0) return this.#y;
|
|
@@ -2121,8 +2168,8 @@ while (this[Le](this[Ft]()) && this[C].length);
|
|
|
2121
2168
|
let i = this.fullpath().replace(/\\/g, "/");
|
|
2122
2169
|
return /^[a-z]:\//i.test(i) ? this.#y = `//?/${i}` : this.#y = i;
|
|
2123
2170
|
}
|
|
2124
|
-
let t = this.parent, e = t.fullpathPosix();
|
|
2125
|
-
return this.#y =
|
|
2171
|
+
let t = this.parent, e = t.fullpathPosix(), s = e + (!e || !t.parent ? "" : "/") + this.name;
|
|
2172
|
+
return this.#y = s;
|
|
2126
2173
|
}
|
|
2127
2174
|
isUnknown() {
|
|
2128
2175
|
return (this.#e & _) === L;
|
|
@@ -2370,7 +2417,8 @@ while (this[Le](this[Ft]()) && this[C].length);
|
|
|
2370
2417
|
for (; i && i.parent;) e.add(i), i.#x = s.join(this.sep), i.#A = s.join("/"), i = i.parent, s.push("..");
|
|
2371
2418
|
for (i = t; i && i.parent && !e.has(i);) i.#x = void 0, i.#A = void 0, i = i.parent;
|
|
2372
2419
|
}
|
|
2373
|
-
}
|
|
2420
|
+
};
|
|
2421
|
+
var Pt = class n extends R {
|
|
2374
2422
|
sep = "\\";
|
|
2375
2423
|
splitSep = Oi;
|
|
2376
2424
|
constructor(t, e = L, s, i, r, o, h) {
|
|
@@ -2390,7 +2438,8 @@ while (this[Le](this[Ft]()) && this[C].length);
|
|
|
2390
2438
|
sameRoot(t, e = this.root.name) {
|
|
2391
2439
|
return t = t.toUpperCase().replace(/\//g, "\\").replace($e, "$1\\"), t === e;
|
|
2392
2440
|
}
|
|
2393
|
-
}
|
|
2441
|
+
};
|
|
2442
|
+
var jt = class n extends R {
|
|
2394
2443
|
splitSep = "/";
|
|
2395
2444
|
sep = "/";
|
|
2396
2445
|
constructor(t, e = L, s, i, r, o, h) {
|
|
@@ -2405,7 +2454,8 @@ while (this[Le](this[Ft]()) && this[C].length);
|
|
|
2405
2454
|
newChild(t, e = L, s = {}) {
|
|
2406
2455
|
return new n(t, e, this.root, this.roots, this.nocase, this.childrenCache(), s);
|
|
2407
2456
|
}
|
|
2408
|
-
}
|
|
2457
|
+
};
|
|
2458
|
+
var It = class {
|
|
2409
2459
|
root;
|
|
2410
2460
|
rootPath;
|
|
2411
2461
|
roots;
|
|
@@ -2415,7 +2465,7 @@ while (this[Le](this[Ft]()) && this[C].length);
|
|
|
2415
2465
|
#n;
|
|
2416
2466
|
nocase;
|
|
2417
2467
|
#r;
|
|
2418
|
-
constructor(t = process.cwd(), e, s, { nocase: i, childrenCacheSize: r =
|
|
2468
|
+
constructor(t = process.cwd(), e, s, { nocase: i, childrenCacheSize: r = 16384, fs: o = wt } = {}) {
|
|
2419
2469
|
this.#r = Ue(o), (t instanceof URL || t.startsWith("file://")) && (t = fileURLToPath(t));
|
|
2420
2470
|
let h = e.resolve(t);
|
|
2421
2471
|
this.roots = Object.create(null), this.rootPath = this.parseRootPath(h), this.#t = new Wt(), this.#s = new Wt(), this.#n = new ne(r);
|
|
@@ -2538,7 +2588,7 @@ while (this[Le](this[Ft]()) && this[C].length);
|
|
|
2538
2588
|
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t, t = this.cwd);
|
|
2539
2589
|
let { withFileTypes: s = !0, follow: i = !1, filter: r, walkFilter: o } = e, h = [];
|
|
2540
2590
|
(!r || r(t)) && h.push(s ? t : t.fullpath());
|
|
2541
|
-
let a = new Set([t]);
|
|
2591
|
+
let a = /* @__PURE__ */ new Set([t]);
|
|
2542
2592
|
for (let l of a) {
|
|
2543
2593
|
let u = l.readdirSync();
|
|
2544
2594
|
for (let c of u) {
|
|
@@ -2566,7 +2616,7 @@ while (this[Le](this[Ft]()) && this[C].length);
|
|
|
2566
2616
|
typeof t == "string" ? t = this.cwd.resolve(t) : t instanceof R || (e = t, t = this.cwd);
|
|
2567
2617
|
let { withFileTypes: s = !0, follow: i = !1, filter: r, walkFilter: o } = e;
|
|
2568
2618
|
(!r || r(t)) && (yield s ? t : t.fullpath());
|
|
2569
|
-
let h = new Set([t]);
|
|
2619
|
+
let h = /* @__PURE__ */ new Set([t]);
|
|
2570
2620
|
for (let a of h) {
|
|
2571
2621
|
let l = a.readdirSync();
|
|
2572
2622
|
for (let u of l) {
|
|
@@ -2649,7 +2699,8 @@ while (this[Le](this[Ft]()) && this[C].length);
|
|
|
2649
2699
|
let e = this.cwd;
|
|
2650
2700
|
this.cwd = typeof t == "string" ? this.cwd.resolve(t) : t, this.cwd[Ye](e);
|
|
2651
2701
|
}
|
|
2652
|
-
}
|
|
2702
|
+
};
|
|
2703
|
+
var it = class extends It {
|
|
2653
2704
|
sep = "\\";
|
|
2654
2705
|
constructor(t = process.cwd(), e = {}) {
|
|
2655
2706
|
let { nocase: s = !0 } = e;
|
|
@@ -2668,7 +2719,8 @@ while (this[Le](this[Ft]()) && this[C].length);
|
|
|
2668
2719
|
isAbsolute(t) {
|
|
2669
2720
|
return t.startsWith("/") || t.startsWith("\\") || /^[a-z]:(\/|\\)/i.test(t);
|
|
2670
2721
|
}
|
|
2671
|
-
}
|
|
2722
|
+
};
|
|
2723
|
+
var rt = class extends It {
|
|
2672
2724
|
sep = "/";
|
|
2673
2725
|
constructor(t = process.cwd(), e = {}) {
|
|
2674
2726
|
let { nocase: s = !1 } = e;
|
|
@@ -2686,7 +2738,8 @@ while (this[Le](this[Ft]()) && this[C].length);
|
|
|
2686
2738
|
isAbsolute(t) {
|
|
2687
2739
|
return t.startsWith("/");
|
|
2688
2740
|
}
|
|
2689
|
-
}
|
|
2741
|
+
};
|
|
2742
|
+
var St = class extends rt {
|
|
2690
2743
|
constructor(t = process.cwd(), e = {}) {
|
|
2691
2744
|
let { nocase: s = !0 } = e;
|
|
2692
2745
|
super(t, {
|
|
@@ -2697,7 +2750,10 @@ while (this[Le](this[Ft]()) && this[C].length);
|
|
|
2697
2750
|
};
|
|
2698
2751
|
process.platform;
|
|
2699
2752
|
var Xe = process.platform === "win32" ? it : process.platform === "darwin" ? St : rt;
|
|
2700
|
-
var Di = (n) => n.length >= 1
|
|
2753
|
+
var Di = (n) => n.length >= 1;
|
|
2754
|
+
var Mi = (n) => n.length >= 1;
|
|
2755
|
+
var Ni = Symbol.for("nodejs.util.inspect.custom");
|
|
2756
|
+
var nt = class n {
|
|
2701
2757
|
#t;
|
|
2702
2758
|
#s;
|
|
2703
2759
|
#n;
|
|
@@ -2787,7 +2843,8 @@ var Di = (n) => n.length >= 1, Mi = (n) => n.length >= 1, Ni = Symbol.for("nodej
|
|
|
2787
2843
|
return this.#n === 0 || !this.isGlobstar() || !this.#u ? !1 : (this.#u = !1, !0);
|
|
2788
2844
|
}
|
|
2789
2845
|
};
|
|
2790
|
-
var _i = typeof process == "object" && process && typeof process.platform == "string" ? process.platform : "linux"
|
|
2846
|
+
var _i = typeof process == "object" && process && typeof process.platform == "string" ? process.platform : "linux";
|
|
2847
|
+
var ot = class {
|
|
2791
2848
|
relative;
|
|
2792
2849
|
relativeChildren;
|
|
2793
2850
|
absolute;
|
|
@@ -2844,9 +2901,10 @@ var oe = class n {
|
|
|
2844
2901
|
}
|
|
2845
2902
|
storeWalked(t, e) {
|
|
2846
2903
|
let s = t.fullpath(), i = this.store.get(s);
|
|
2847
|
-
i ? i.add(e.globString()) : this.store.set(s, new Set([e.globString()]));
|
|
2904
|
+
i ? i.add(e.globString()) : this.store.set(s, /* @__PURE__ */ new Set([e.globString()]));
|
|
2848
2905
|
}
|
|
2849
|
-
}
|
|
2906
|
+
};
|
|
2907
|
+
var he = class {
|
|
2850
2908
|
store = /* @__PURE__ */ new Map();
|
|
2851
2909
|
add(t, e, s) {
|
|
2852
2910
|
let i = (e ? 2 : 0) | (s ? 1 : 0), r = this.store.get(t);
|
|
@@ -2859,7 +2917,8 @@ var oe = class n {
|
|
|
2859
2917
|
!!(e & 1)
|
|
2860
2918
|
]);
|
|
2861
2919
|
}
|
|
2862
|
-
}
|
|
2920
|
+
};
|
|
2921
|
+
var ae = class {
|
|
2863
2922
|
store = /* @__PURE__ */ new Map();
|
|
2864
2923
|
add(t, e) {
|
|
2865
2924
|
if (!t.canReaddir()) return;
|
|
@@ -2877,7 +2936,8 @@ var oe = class n {
|
|
|
2877
2936
|
keys() {
|
|
2878
2937
|
return [...this.store.keys()].filter((t) => t.canReaddir());
|
|
2879
2938
|
}
|
|
2880
|
-
}
|
|
2939
|
+
};
|
|
2940
|
+
var Et = class n {
|
|
2881
2941
|
hasWalkedCache;
|
|
2882
2942
|
matches = new he();
|
|
2883
2943
|
subwalks = new ae();
|
|
@@ -2957,7 +3017,8 @@ var oe = class n {
|
|
|
2957
3017
|
t.isNamed(e) && (s ? this.subwalks.add(t, s) : this.matches.add(t, i, !1));
|
|
2958
3018
|
}
|
|
2959
3019
|
};
|
|
2960
|
-
var Li = (n, t) => typeof n == "string" ? new ot([n], t) : Array.isArray(n) ? new ot(n, t) : n
|
|
3020
|
+
var Li = (n, t) => typeof n == "string" ? new ot([n], t) : Array.isArray(n) ? new ot(n, t) : n;
|
|
3021
|
+
var zt = class {
|
|
2961
3022
|
path;
|
|
2962
3023
|
patterns;
|
|
2963
3024
|
opts;
|
|
@@ -3113,7 +3174,8 @@ var Li = (n, t) => typeof n == "string" ? new ot([n], t) : Array.isArray(n) ? ne
|
|
|
3113
3174
|
for (let [h, a] of s.subwalks.entries()) r++, this.walkCB2Sync(h, a, s.child(), o);
|
|
3114
3175
|
o();
|
|
3115
3176
|
}
|
|
3116
|
-
}
|
|
3177
|
+
};
|
|
3178
|
+
var xt = class extends zt {
|
|
3117
3179
|
matches = /* @__PURE__ */ new Set();
|
|
3118
3180
|
constructor(t, e, s) {
|
|
3119
3181
|
super(t, e, s);
|
|
@@ -3135,7 +3197,8 @@ var Li = (n, t) => typeof n == "string" ? new ot([n], t) : Array.isArray(n) ? ne
|
|
|
3135
3197
|
if (this.signal?.aborted) throw this.signal.reason;
|
|
3136
3198
|
}), this.matches;
|
|
3137
3199
|
}
|
|
3138
|
-
}
|
|
3200
|
+
};
|
|
3201
|
+
var vt = class extends zt {
|
|
3139
3202
|
results;
|
|
3140
3203
|
constructor(t, e, s) {
|
|
3141
3204
|
super(t, e, s), this.results = new V({
|
|
@@ -3156,7 +3219,8 @@ var Li = (n, t) => typeof n == "string" ? new ot([n], t) : Array.isArray(n) ? ne
|
|
|
3156
3219
|
return this.path.isUnknown() && this.path.lstatSync(), this.walkCBSync(this.path, this.patterns, () => this.results.end()), this.results;
|
|
3157
3220
|
}
|
|
3158
3221
|
};
|
|
3159
|
-
var Pi = typeof process == "object" && process && typeof process.platform == "string" ? process.platform : "linux"
|
|
3222
|
+
var Pi = typeof process == "object" && process && typeof process.platform == "string" ? process.platform : "linux";
|
|
3223
|
+
var I = class {
|
|
3160
3224
|
absolute;
|
|
3161
3225
|
cwd;
|
|
3162
3226
|
root;
|
|
@@ -3196,10 +3260,13 @@ var Pi = typeof process == "object" && process && typeof process.platform == "st
|
|
|
3196
3260
|
platform: this.platform
|
|
3197
3261
|
}, e.scurry) {
|
|
3198
3262
|
if (this.scurry = e.scurry, e.nocase !== void 0 && e.nocase !== e.scurry.nocase) throw new Error("nocase option contradicts provided scurry option");
|
|
3199
|
-
} else
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3263
|
+
} else {
|
|
3264
|
+
let a = e.platform === "win32" ? it : e.platform === "darwin" ? St : e.platform ? rt : Xe;
|
|
3265
|
+
this.scurry = new a(this.cwd, {
|
|
3266
|
+
nocase: e.nocase,
|
|
3267
|
+
fs: e.fs
|
|
3268
|
+
});
|
|
3269
|
+
}
|
|
3203
3270
|
this.nocase = this.scurry.nocase;
|
|
3204
3271
|
let s = this.platform === "darwin" || this.platform === "win32", i = {
|
|
3205
3272
|
braceExpandMax: 1e4,
|
|
@@ -3295,10 +3362,15 @@ function Ut(n, t = {}) {
|
|
|
3295
3362
|
function es(n, t = {}) {
|
|
3296
3363
|
return new I(n, t).iterate();
|
|
3297
3364
|
}
|
|
3298
|
-
var ji = Bt
|
|
3365
|
+
var ji = Bt;
|
|
3366
|
+
var Ii = Object.assign(Qe, { sync: Bt });
|
|
3367
|
+
var zi = Ut;
|
|
3368
|
+
var Bi = Object.assign(es, { sync: Ut });
|
|
3369
|
+
var Ui = Object.assign(ts, {
|
|
3299
3370
|
stream: Bt,
|
|
3300
3371
|
iterate: Ut
|
|
3301
|
-
})
|
|
3372
|
+
});
|
|
3373
|
+
var Ze = Object.assign(Je, {
|
|
3302
3374
|
glob: Je,
|
|
3303
3375
|
globSync: ts,
|
|
3304
3376
|
sync: Ui,
|
|
@@ -3507,7 +3579,7 @@ function expand_(str, max, isTop) {
|
|
|
3507
3579
|
}
|
|
3508
3580
|
//#endregion
|
|
3509
3581
|
//#region ../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/assert-valid-pattern.js
|
|
3510
|
-
const MAX_PATTERN_LENGTH =
|
|
3582
|
+
const MAX_PATTERN_LENGTH = 65536;
|
|
3511
3583
|
const assertValidPattern = (pattern) => {
|
|
3512
3584
|
if (typeof pattern !== "string") throw new TypeError("invalid pattern");
|
|
3513
3585
|
if (pattern.length > MAX_PATTERN_LENGTH) throw new TypeError("pattern is too long");
|
|
@@ -3618,12 +3690,15 @@ const parseClass = (glob, position) => {
|
|
|
3618
3690
|
glob.length - pos,
|
|
3619
3691
|
true
|
|
3620
3692
|
];
|
|
3621
|
-
if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate)
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3693
|
+
if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
|
|
3694
|
+
const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
|
|
3695
|
+
return [
|
|
3696
|
+
regexpEscape(r),
|
|
3697
|
+
false,
|
|
3698
|
+
endPos - pos,
|
|
3699
|
+
false
|
|
3700
|
+
];
|
|
3701
|
+
}
|
|
3627
3702
|
const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
|
|
3628
3703
|
const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
|
|
3629
3704
|
return [
|
|
@@ -3661,7 +3736,7 @@ const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}
|
|
|
3661
3736
|
//#endregion
|
|
3662
3737
|
//#region ../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/ast.js
|
|
3663
3738
|
var _a;
|
|
3664
|
-
const types = new Set([
|
|
3739
|
+
const types = /* @__PURE__ */ new Set([
|
|
3665
3740
|
"!",
|
|
3666
3741
|
"?",
|
|
3667
3742
|
"+",
|
|
@@ -3670,7 +3745,7 @@ const types = new Set([
|
|
|
3670
3745
|
]);
|
|
3671
3746
|
const isExtglobType = (c) => types.has(c);
|
|
3672
3747
|
const isExtglobAST = (c) => isExtglobType(c.type);
|
|
3673
|
-
const adoptionMap = new Map([
|
|
3748
|
+
const adoptionMap = /* @__PURE__ */ new Map([
|
|
3674
3749
|
["!", ["@"]],
|
|
3675
3750
|
["?", ["?", "@"]],
|
|
3676
3751
|
["@", ["@"]],
|
|
@@ -3682,12 +3757,12 @@ const adoptionMap = new Map([
|
|
|
3682
3757
|
]],
|
|
3683
3758
|
["+", ["+", "@"]]
|
|
3684
3759
|
]);
|
|
3685
|
-
const adoptionWithSpaceMap = new Map([
|
|
3760
|
+
const adoptionWithSpaceMap = /* @__PURE__ */ new Map([
|
|
3686
3761
|
["!", ["?"]],
|
|
3687
3762
|
["@", ["?"]],
|
|
3688
3763
|
["+", ["?", "*"]]
|
|
3689
3764
|
]);
|
|
3690
|
-
const adoptionAnyMap = new Map([
|
|
3765
|
+
const adoptionAnyMap = /* @__PURE__ */ new Map([
|
|
3691
3766
|
["!", ["?", "@"]],
|
|
3692
3767
|
["?", ["?", "@"]],
|
|
3693
3768
|
["@", ["?", "@"]],
|
|
@@ -3704,27 +3779,27 @@ const adoptionAnyMap = new Map([
|
|
|
3704
3779
|
"*"
|
|
3705
3780
|
]]
|
|
3706
3781
|
]);
|
|
3707
|
-
const usurpMap = new Map([
|
|
3708
|
-
["!", new Map([["!", "@"]])],
|
|
3709
|
-
["?", new Map([["*", "*"], ["+", "*"]])],
|
|
3710
|
-
["@", new Map([
|
|
3782
|
+
const usurpMap = /* @__PURE__ */ new Map([
|
|
3783
|
+
["!", /* @__PURE__ */ new Map([["!", "@"]])],
|
|
3784
|
+
["?", /* @__PURE__ */ new Map([["*", "*"], ["+", "*"]])],
|
|
3785
|
+
["@", /* @__PURE__ */ new Map([
|
|
3711
3786
|
["!", "!"],
|
|
3712
3787
|
["?", "?"],
|
|
3713
3788
|
["@", "@"],
|
|
3714
3789
|
["*", "*"],
|
|
3715
3790
|
["+", "+"]
|
|
3716
3791
|
])],
|
|
3717
|
-
["+", new Map([["?", "*"], ["*", "*"]])]
|
|
3792
|
+
["+", /* @__PURE__ */ new Map([["?", "*"], ["*", "*"]])]
|
|
3718
3793
|
]);
|
|
3719
3794
|
const startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
|
3720
3795
|
const startNoDot = "(?!\\.)";
|
|
3721
|
-
const addPatternStart = new Set(["[", "."]);
|
|
3722
|
-
const justDots = new Set(["..", "."]);
|
|
3796
|
+
const addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
|
|
3797
|
+
const justDots = /* @__PURE__ */ new Set(["..", "."]);
|
|
3723
3798
|
const reSpecials = /* @__PURE__ */ new Set("().*{}+?[]^$\\!");
|
|
3724
3799
|
const regExpEscape$1 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
3725
3800
|
const qmark = "[^/]";
|
|
3726
|
-
const star$1 =
|
|
3727
|
-
const starNoEmpty =
|
|
3801
|
+
const star$1 = "[^/]*?";
|
|
3802
|
+
const starNoEmpty = "[^/]+?";
|
|
3728
3803
|
let ID = 0;
|
|
3729
3804
|
var AST = class {
|
|
3730
3805
|
type;
|
|
@@ -4069,7 +4144,7 @@ var AST = class {
|
|
|
4069
4144
|
let final = "";
|
|
4070
4145
|
if (this.type === "!" && this.#emptyExt) final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
|
|
4071
4146
|
else {
|
|
4072
|
-
const close = this.type === "!" ? "))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") +
|
|
4147
|
+
const close = this.type === "!" ? "))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + "[^/]*?)" : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
|
|
4073
4148
|
final = start + body + close;
|
|
4074
4149
|
}
|
|
4075
4150
|
return [
|
|
@@ -4242,11 +4317,11 @@ const qmarksTestNoExtDot = ([$0]) => {
|
|
|
4242
4317
|
};
|
|
4243
4318
|
/* c8 ignore start */
|
|
4244
4319
|
const defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
4245
|
-
const path = {
|
|
4320
|
+
const path$1 = {
|
|
4246
4321
|
win32: { sep: "\\" },
|
|
4247
4322
|
posix: { sep: "/" }
|
|
4248
4323
|
};
|
|
4249
|
-
minimatch.sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
|
|
4324
|
+
minimatch.sep = defaultPlatform === "win32" ? path$1.win32.sep : path$1.posix.sep;
|
|
4250
4325
|
const GLOBSTAR = Symbol("globstar **");
|
|
4251
4326
|
minimatch.GLOBSTAR = GLOBSTAR;
|
|
4252
4327
|
const star = "[^/]*?";
|
|
@@ -4334,7 +4409,8 @@ var Minimatch = class {
|
|
|
4334
4409
|
this.pattern = pattern;
|
|
4335
4410
|
this.platform = options.platform || defaultPlatform;
|
|
4336
4411
|
this.isWindows = this.platform === "win32";
|
|
4337
|
-
|
|
4412
|
+
const awe = "allowWindowsEscape";
|
|
4413
|
+
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options[awe] === false;
|
|
4338
4414
|
if (this.windowsPathsNoEscape) this.pattern = this.pattern.replace(/\\/g, "/");
|
|
4339
4415
|
this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
|
|
4340
4416
|
this.regexp = null;
|
|
@@ -4804,290 +4880,301 @@ minimatch.Minimatch = Minimatch;
|
|
|
4804
4880
|
minimatch.escape = escape;
|
|
4805
4881
|
minimatch.unescape = unescape;
|
|
4806
4882
|
//#endregion
|
|
4807
|
-
//#region ../utils/src/glob.ts
|
|
4808
|
-
let Glob;
|
|
4809
|
-
(function(_Glob) {
|
|
4810
|
-
function toGlobOptions(options) {
|
|
4811
|
-
return {
|
|
4812
|
-
cwd: options.cwd,
|
|
4813
|
-
absolute: options.absolute,
|
|
4814
|
-
dot: options.dot,
|
|
4815
|
-
follow: options.symlink ?? false,
|
|
4816
|
-
nodir: options.include !== "all"
|
|
4817
|
-
};
|
|
4818
|
-
}
|
|
4819
|
-
async function scan(pattern, options = {}) {
|
|
4820
|
-
return await Ze(pattern, toGlobOptions(options));
|
|
4821
|
-
}
|
|
4822
|
-
_Glob.scan = scan;
|
|
4823
|
-
function scanSync(pattern, options = {}) {
|
|
4824
|
-
return ts(pattern, toGlobOptions(options));
|
|
4825
|
-
}
|
|
4826
|
-
_Glob.scanSync = scanSync;
|
|
4827
|
-
function match(pattern, filepath) {
|
|
4828
|
-
return minimatch(filepath, pattern, { dot: true });
|
|
4829
|
-
}
|
|
4830
|
-
_Glob.match = match;
|
|
4831
|
-
})(Glob || (Glob = {}));
|
|
4832
|
-
//#endregion
|
|
4833
4883
|
//#region src/model/catalog.ts
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
return JSON.parse(content);
|
|
4871
|
-
});
|
|
4872
|
-
async function get() {
|
|
4873
|
-
return data().catch(() => ({}));
|
|
4874
|
-
}
|
|
4875
|
-
_ModelCatalog.get = get;
|
|
4876
|
-
})(ModelCatalog || (ModelCatalog = {}));
|
|
4884
|
+
const KnownProviderEnum$1 = {
|
|
4885
|
+
anthropic: "anthropic",
|
|
4886
|
+
google: "google",
|
|
4887
|
+
googleVertex: "google-vertex",
|
|
4888
|
+
googleVertexAnthropic: "google-vertex-anthropic",
|
|
4889
|
+
openai: "openai",
|
|
4890
|
+
openaiCompatible: "openai-compatible",
|
|
4891
|
+
openaiCodex: "openai-codex",
|
|
4892
|
+
openrouter: "openrouter",
|
|
4893
|
+
xai: "xai"
|
|
4894
|
+
};
|
|
4895
|
+
const KnownProviderEnumSchema$1 = Type$1.Union([
|
|
4896
|
+
Type$1.Literal(KnownProviderEnum$1.anthropic),
|
|
4897
|
+
Type$1.Literal(KnownProviderEnum$1.google),
|
|
4898
|
+
Type$1.Literal(KnownProviderEnum$1.googleVertex),
|
|
4899
|
+
Type$1.Literal(KnownProviderEnum$1.googleVertexAnthropic),
|
|
4900
|
+
Type$1.Literal(KnownProviderEnum$1.openai),
|
|
4901
|
+
Type$1.Literal(KnownProviderEnum$1.openaiCompatible),
|
|
4902
|
+
Type$1.Literal(KnownProviderEnum$1.openaiCodex),
|
|
4903
|
+
Type$1.Literal(KnownProviderEnum$1.openrouter),
|
|
4904
|
+
Type$1.Literal(KnownProviderEnum$1.xai)
|
|
4905
|
+
]);
|
|
4906
|
+
function projectRoot() {
|
|
4907
|
+
return process.cwd();
|
|
4908
|
+
}
|
|
4909
|
+
function path() {
|
|
4910
|
+
return resolve(process.env.CODEWORK_MODELS_FILE ?? join(projectRoot(), "models.gen.json"));
|
|
4911
|
+
}
|
|
4912
|
+
const data = lazy(async () => {
|
|
4913
|
+
const content = await readText(path()).catch(() => void 0);
|
|
4914
|
+
if (!content?.trim()) return {};
|
|
4915
|
+
return JSON.parse(content);
|
|
4916
|
+
});
|
|
4917
|
+
async function get() {
|
|
4918
|
+
return data().catch(() => ({}));
|
|
4919
|
+
}
|
|
4877
4920
|
//#endregion
|
|
4878
4921
|
//#region src/model/model.ts
|
|
4879
|
-
|
|
4880
|
-
(
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
const
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
4922
|
+
var model_exports = /* @__PURE__ */ __exportAll({
|
|
4923
|
+
APIMetadataSchema: () => APIMetadataSchema,
|
|
4924
|
+
APIMethodEnum: () => APIMethodEnum,
|
|
4925
|
+
APIMethodEnumSchema: () => APIMethodEnumSchema,
|
|
4926
|
+
ActiveThinkingLevel: () => ActiveThinkingLevel,
|
|
4927
|
+
CompatibilitySchema: () => CompatibilitySchema,
|
|
4928
|
+
ExtrasSchema: () => ExtrasSchema,
|
|
4929
|
+
Info: () => Info,
|
|
4930
|
+
KnownProviderEnum: () => KnownProviderEnum,
|
|
4931
|
+
KnownProviderEnumSchema: () => KnownProviderEnumSchema,
|
|
4932
|
+
ProviderInfo: () => ProviderInfo,
|
|
4933
|
+
Schema: () => Schema,
|
|
4934
|
+
ThinkingLevel: () => ThinkingLevel,
|
|
4935
|
+
ThinkingLevelEnum: () => ThinkingLevelEnum,
|
|
4936
|
+
ThinkingLevelMapSchema: () => ThinkingLevelMapSchema,
|
|
4937
|
+
calculateCost: () => calculateCost,
|
|
4938
|
+
clampThinkingLevel: () => clampThinkingLevel,
|
|
4939
|
+
getBuiltInModels: () => getBuiltInModels,
|
|
4940
|
+
getModel: () => getModel,
|
|
4941
|
+
getModels: () => getModels,
|
|
4942
|
+
getProviders: () => getProviders,
|
|
4943
|
+
getSupportedThinkingLevels: () => getSupportedThinkingLevels,
|
|
4944
|
+
modelsAreEqual: () => modelsAreEqual,
|
|
4945
|
+
normalizeInput: () => normalizeInput,
|
|
4946
|
+
registry: () => registry,
|
|
4947
|
+
supportsProtocol: () => supportsProtocol
|
|
4948
|
+
});
|
|
4949
|
+
const KnownProviderEnum = KnownProviderEnum$1;
|
|
4950
|
+
const KnownProviderEnumSchema = KnownProviderEnumSchema$1;
|
|
4951
|
+
const ThinkingLevelEnum = {
|
|
4952
|
+
off: "off",
|
|
4953
|
+
minimal: "minimal",
|
|
4954
|
+
low: "low",
|
|
4955
|
+
medium: "medium",
|
|
4956
|
+
high: "high",
|
|
4957
|
+
xhigh: "xhigh",
|
|
4958
|
+
max: "max"
|
|
4959
|
+
};
|
|
4960
|
+
const ThinkingLevel = Type$1.Union([
|
|
4961
|
+
Type$1.Literal(ThinkingLevelEnum.off),
|
|
4962
|
+
Type$1.Literal(ThinkingLevelEnum.minimal),
|
|
4963
|
+
Type$1.Literal(ThinkingLevelEnum.low),
|
|
4964
|
+
Type$1.Literal(ThinkingLevelEnum.medium),
|
|
4965
|
+
Type$1.Literal(ThinkingLevelEnum.high),
|
|
4966
|
+
Type$1.Literal(ThinkingLevelEnum.xhigh),
|
|
4967
|
+
Type$1.Literal(ThinkingLevelEnum.max)
|
|
4968
|
+
]);
|
|
4969
|
+
const ActiveThinkingLevel = Type$1.Union([
|
|
4970
|
+
Type$1.Literal(ThinkingLevelEnum.minimal),
|
|
4971
|
+
Type$1.Literal(ThinkingLevelEnum.low),
|
|
4972
|
+
Type$1.Literal(ThinkingLevelEnum.medium),
|
|
4973
|
+
Type$1.Literal(ThinkingLevelEnum.high),
|
|
4974
|
+
Type$1.Literal(ThinkingLevelEnum.xhigh),
|
|
4975
|
+
Type$1.Literal(ThinkingLevelEnum.max)
|
|
4976
|
+
]);
|
|
4977
|
+
const ACTIVE_THINKING_LEVELS = [
|
|
4978
|
+
ThinkingLevelEnum.minimal,
|
|
4979
|
+
ThinkingLevelEnum.low,
|
|
4980
|
+
ThinkingLevelEnum.medium,
|
|
4981
|
+
ThinkingLevelEnum.high,
|
|
4982
|
+
ThinkingLevelEnum.xhigh,
|
|
4983
|
+
ThinkingLevelEnum.max
|
|
4984
|
+
];
|
|
4985
|
+
const MODEL_THINKING_LEVELS = [ThinkingLevelEnum.off, ...ACTIVE_THINKING_LEVELS];
|
|
4986
|
+
const ProviderInfo = Type$1.Object({
|
|
4987
|
+
id: Type$1.String(),
|
|
4988
|
+
name: Type$1.String(),
|
|
4989
|
+
source: Type$1.Enum([
|
|
4990
|
+
"env",
|
|
4991
|
+
"config",
|
|
4992
|
+
"custom",
|
|
4993
|
+
"api",
|
|
4994
|
+
"unknown"
|
|
4995
|
+
]),
|
|
4996
|
+
env: Type$1.Array(Type$1.String()),
|
|
4997
|
+
key: Type$1.Optional(Type$1.String()),
|
|
4998
|
+
options: Type$1.Optional(Type$1.Record(Type$1.String(), Type$1.Any()))
|
|
4999
|
+
});
|
|
5000
|
+
const InputSchema = Type$1.Array(Type$1.Union([Type$1.Literal("text"), Type$1.Literal("image")]));
|
|
5001
|
+
const CostRatesSchema = Type$1.Object({
|
|
5002
|
+
input: Type$1.Number(),
|
|
5003
|
+
output: Type$1.Number(),
|
|
5004
|
+
cacheRead: Type$1.Number(),
|
|
5005
|
+
cacheWrite: Type$1.Number()
|
|
5006
|
+
});
|
|
5007
|
+
const CostTierSchema = Type$1.Object({
|
|
5008
|
+
...CostRatesSchema.properties,
|
|
5009
|
+
inputTokensAbove: Type$1.Number()
|
|
5010
|
+
});
|
|
5011
|
+
const CostSchema = Type$1.Object({
|
|
5012
|
+
...CostRatesSchema.properties,
|
|
5013
|
+
tiers: Type$1.Optional(Type$1.Array(CostTierSchema))
|
|
5014
|
+
});
|
|
5015
|
+
const SupportedProtocolsSchema = Type$1.Partial(Type$1.Object({
|
|
5016
|
+
anthropic: KnownProviderEnumSchema,
|
|
5017
|
+
google: KnownProviderEnumSchema,
|
|
5018
|
+
googleVertex: KnownProviderEnumSchema,
|
|
5019
|
+
googleVertexAnthropic: KnownProviderEnumSchema,
|
|
5020
|
+
openai: KnownProviderEnumSchema,
|
|
5021
|
+
openaiCompatible: KnownProviderEnumSchema,
|
|
5022
|
+
openaiCodex: KnownProviderEnumSchema,
|
|
5023
|
+
openrouter: KnownProviderEnumSchema,
|
|
5024
|
+
xai: KnownProviderEnumSchema
|
|
5025
|
+
}));
|
|
5026
|
+
const APIMethodEnum = {
|
|
5027
|
+
languageModel: "languageModel",
|
|
5028
|
+
chat: "chat",
|
|
5029
|
+
completion: "completion",
|
|
5030
|
+
completionModel: "completionModel",
|
|
5031
|
+
messages: "messages",
|
|
5032
|
+
responses: "responses"
|
|
5033
|
+
};
|
|
5034
|
+
const APIMethodEnumSchema = Type$1.Union([
|
|
5035
|
+
Type$1.Literal(APIMethodEnum.languageModel),
|
|
5036
|
+
Type$1.Literal(APIMethodEnum.chat),
|
|
5037
|
+
Type$1.Literal(APIMethodEnum.completion),
|
|
5038
|
+
Type$1.Literal(APIMethodEnum.completionModel),
|
|
5039
|
+
Type$1.Literal(APIMethodEnum.messages),
|
|
5040
|
+
Type$1.Literal(APIMethodEnum.responses)
|
|
5041
|
+
]);
|
|
5042
|
+
const APIMetadataSchema = Type$1.Object({
|
|
5043
|
+
id: Type$1.Optional(Type$1.String()),
|
|
5044
|
+
url: Type$1.Optional(Type$1.String()),
|
|
5045
|
+
method: Type$1.Optional(APIMethodEnumSchema)
|
|
5046
|
+
});
|
|
5047
|
+
const ThinkingLevelMapSchema = Type$1.Partial(Type$1.Record(ThinkingLevel, Type$1.Union([Type$1.String(), Type$1.Null()])));
|
|
5048
|
+
const CompatibilitySchema = Type$1.Object({
|
|
5049
|
+
supportsToolSearch: Type$1.Optional(Type$1.Boolean()),
|
|
5050
|
+
supportsAdditionalTools: Type$1.Optional(Type$1.Boolean()),
|
|
5051
|
+
supportsStrictMode: Type$1.Optional(Type$1.Boolean()),
|
|
5052
|
+
supportsOpenAIGrammarTools: Type$1.Optional(Type$1.Boolean())
|
|
5053
|
+
});
|
|
5054
|
+
const Schema = Type$1.Object({
|
|
5055
|
+
id: Type$1.String(),
|
|
5056
|
+
name: Type$1.String(),
|
|
5057
|
+
provider: ProviderInfo,
|
|
5058
|
+
baseUrl: Type$1.String(),
|
|
5059
|
+
reasoning: Type$1.Boolean(),
|
|
5060
|
+
thinkingLevelMap: Type$1.Optional(ThinkingLevelMapSchema),
|
|
5061
|
+
input: InputSchema,
|
|
5062
|
+
cost: CostSchema,
|
|
5063
|
+
contextWindow: Type$1.Number(),
|
|
5064
|
+
maxTokens: Type$1.Number(),
|
|
5065
|
+
headers: Type$1.Optional(Type$1.Record(Type$1.String(), Type$1.String())),
|
|
5066
|
+
npm: Type$1.Optional(Type$1.String()),
|
|
5067
|
+
api: Type$1.Optional(APIMetadataSchema),
|
|
5068
|
+
providerOptionsKey: Type$1.Optional(Type$1.String()),
|
|
5069
|
+
options: Type$1.Optional(Type$1.Record(Type$1.String(), Type$1.Unknown())),
|
|
5070
|
+
providerOptions: Type$1.Optional(Type$1.Record(Type$1.String(), Type$1.Unknown())),
|
|
5071
|
+
compat: Type$1.Optional(CompatibilitySchema),
|
|
5072
|
+
protocol: KnownProviderEnumSchema,
|
|
5073
|
+
supportedProtocols: Type$1.Optional(SupportedProtocolsSchema)
|
|
5074
|
+
});
|
|
5075
|
+
const ExtrasSchema = Type$1.Object({});
|
|
5076
|
+
const Info = Type$1.Evaluate(Type$1.Intersect([Schema, ExtrasSchema]));
|
|
5077
|
+
function calculateCost(model, usage) {
|
|
5078
|
+
const inputTokens = usage.input + usage.cacheRead + usage.cacheWrite;
|
|
5079
|
+
let rates = model.cost;
|
|
5080
|
+
let matchedThreshold = -1;
|
|
5081
|
+
for (const tier of model.cost.tiers ?? []) if (inputTokens > tier.inputTokensAbove && tier.inputTokensAbove > matchedThreshold) {
|
|
5082
|
+
rates = tier;
|
|
5083
|
+
matchedThreshold = tier.inputTokensAbove;
|
|
5084
|
+
}
|
|
5085
|
+
usage.cost.input = usage.input / 1e6 * rates.input;
|
|
5086
|
+
usage.cost.output = usage.output / 1e6 * rates.output;
|
|
5087
|
+
usage.cost.cacheRead = usage.cacheRead / 1e6 * rates.cacheRead;
|
|
5088
|
+
usage.cost.cacheWrite = usage.cacheWrite / 1e6 * rates.cacheWrite;
|
|
5089
|
+
usage.cost.total = usage.cost.input + usage.cost.output + usage.cost.cacheRead + usage.cost.cacheWrite;
|
|
5090
|
+
}
|
|
5091
|
+
function normalizeInput(input) {
|
|
5092
|
+
const normalized = /* @__PURE__ */ new Set();
|
|
5093
|
+
for (const modality of input ?? ["text"]) if (modality === "text" || modality === "image") normalized.add(modality);
|
|
5094
|
+
if (normalized.size === 0) normalized.add("text");
|
|
5095
|
+
return [...normalized];
|
|
5096
|
+
}
|
|
5097
|
+
async function getBuiltInModels() {
|
|
5098
|
+
return await get();
|
|
5099
|
+
}
|
|
5100
|
+
const registry = lazy(async () => {
|
|
5101
|
+
const registry = /* @__PURE__ */ new Map();
|
|
5102
|
+
const models = await getBuiltInModels();
|
|
5103
|
+
for (const [provider, value] of Object.entries(models)) {
|
|
5104
|
+
const providerModels = /* @__PURE__ */ new Map();
|
|
5105
|
+
for (const [id, model] of Object.entries(value)) providerModels.set(id, model);
|
|
5106
|
+
registry.set(provider, providerModels);
|
|
5107
|
+
}
|
|
5108
|
+
return registry;
|
|
5109
|
+
});
|
|
5110
|
+
function supportsProtocol(model, protocol) {
|
|
5111
|
+
if (model.protocol === protocol) return true;
|
|
5112
|
+
return Object.values(model.supportedProtocols ?? {}).includes(protocol);
|
|
5113
|
+
}
|
|
5114
|
+
async function getModel(provider, model, overrides) {
|
|
5115
|
+
const result = (await registry()).get(provider)?.get(model);
|
|
5116
|
+
if (result && overrides) {
|
|
5117
|
+
if (overrides.protocol && !supportsProtocol(result, overrides.protocol)) return;
|
|
5118
|
+
return {
|
|
5119
|
+
...result,
|
|
5120
|
+
...overrides
|
|
5121
|
+
};
|
|
5075
5122
|
}
|
|
5076
|
-
|
|
5077
|
-
}
|
|
5123
|
+
return result;
|
|
5124
|
+
}
|
|
5125
|
+
async function getProviders() {
|
|
5126
|
+
const data = await registry();
|
|
5127
|
+
return Array.from(data.keys());
|
|
5128
|
+
}
|
|
5129
|
+
async function getModels(provider) {
|
|
5130
|
+
const models = (await registry()).get(provider);
|
|
5131
|
+
return models ? Array.from(models.values()) : [];
|
|
5132
|
+
}
|
|
5133
|
+
/**
|
|
5134
|
+
* Check if two models are equal by comparing both their id and provider id.
|
|
5135
|
+
* Returns false if either model is null or undefined.
|
|
5136
|
+
*/
|
|
5137
|
+
function modelsAreEqual(a, b) {
|
|
5138
|
+
if (!a || !b) return false;
|
|
5139
|
+
return a.id === b.id && a.provider.id === b.provider.id;
|
|
5140
|
+
}
|
|
5141
|
+
function getSupportedThinkingLevels(model) {
|
|
5142
|
+
if (!model.reasoning) return ["off"];
|
|
5143
|
+
return MODEL_THINKING_LEVELS.filter((level) => {
|
|
5144
|
+
const mapped = model.thinkingLevelMap?.[level];
|
|
5145
|
+
if (mapped === null) return false;
|
|
5146
|
+
if (level === "xhigh" || level === "max") return mapped !== void 0;
|
|
5147
|
+
return true;
|
|
5148
|
+
});
|
|
5149
|
+
}
|
|
5150
|
+
function clampThinkingLevel(model, level) {
|
|
5151
|
+
const availableLevels = getSupportedThinkingLevels(model);
|
|
5152
|
+
if (availableLevels.includes(level)) return level;
|
|
5153
|
+
const requestedIndex = MODEL_THINKING_LEVELS.indexOf(level);
|
|
5154
|
+
if (requestedIndex === -1) return availableLevels[0] ?? "off";
|
|
5155
|
+
for (let i = requestedIndex; i < MODEL_THINKING_LEVELS.length; i++) {
|
|
5156
|
+
const candidate = MODEL_THINKING_LEVELS[i];
|
|
5157
|
+
if (availableLevels.includes(candidate)) return candidate;
|
|
5158
|
+
}
|
|
5159
|
+
for (let i = requestedIndex - 1; i >= 0; i--) {
|
|
5160
|
+
const candidate = MODEL_THINKING_LEVELS[i];
|
|
5161
|
+
if (availableLevels.includes(candidate)) return candidate;
|
|
5162
|
+
}
|
|
5163
|
+
return availableLevels[0] ?? "off";
|
|
5164
|
+
}
|
|
5078
5165
|
//#endregion
|
|
5079
5166
|
//#region src/llm/registry.ts
|
|
5080
5167
|
const DEFAULT_AI_SDK_FALLBACK = "@ai-sdk/openai-compatible";
|
|
5081
5168
|
const AI_SDK_PACKAGE_TO_PROTOCOL = {
|
|
5082
|
-
"@ai-sdk/anthropic":
|
|
5083
|
-
"@ai-sdk/google":
|
|
5084
|
-
"@ai-sdk/google-vertex":
|
|
5085
|
-
"@ai-sdk/google-vertex/anthropic":
|
|
5086
|
-
"@ai-sdk/openai":
|
|
5087
|
-
"@ai-sdk/openai-compatible":
|
|
5088
|
-
"@codeworksh/ai-sdk-openai-codex":
|
|
5089
|
-
"@openrouter/ai-sdk-provider":
|
|
5090
|
-
"@ai-sdk/xai":
|
|
5169
|
+
"@ai-sdk/anthropic": KnownProviderEnum.anthropic,
|
|
5170
|
+
"@ai-sdk/google": KnownProviderEnum.google,
|
|
5171
|
+
"@ai-sdk/google-vertex": KnownProviderEnum.googleVertex,
|
|
5172
|
+
"@ai-sdk/google-vertex/anthropic": KnownProviderEnum.googleVertexAnthropic,
|
|
5173
|
+
"@ai-sdk/openai": KnownProviderEnum.openai,
|
|
5174
|
+
"@ai-sdk/openai-compatible": KnownProviderEnum.openaiCompatible,
|
|
5175
|
+
"@codeworksh/ai-sdk-openai-codex": KnownProviderEnum.openaiCodex,
|
|
5176
|
+
"@openrouter/ai-sdk-provider": KnownProviderEnum.openrouter,
|
|
5177
|
+
"@ai-sdk/xai": KnownProviderEnum.xai
|
|
5091
5178
|
};
|
|
5092
5179
|
const PROVIDER_LOADERS = {
|
|
5093
5180
|
"@ai-sdk/anthropic": () => import("@ai-sdk/anthropic").then((m) => m.createAnthropic),
|
|
@@ -5098,7 +5185,7 @@ const PROVIDER_LOADERS = {
|
|
|
5098
5185
|
"@ai-sdk/openai-compatible": () => import("@ai-sdk/openai-compatible").then((m) => m.createOpenAICompatible),
|
|
5099
5186
|
"@openrouter/ai-sdk-provider": () => import("@openrouter/ai-sdk-provider").then((m) => m.createOpenRouter),
|
|
5100
5187
|
"@ai-sdk/xai": () => import("@ai-sdk/xai").then((m) => m.createXai),
|
|
5101
|
-
"@codeworksh/ai-sdk-openai-codex": () => import("./openai-codex-
|
|
5188
|
+
"@codeworksh/ai-sdk-openai-codex": () => import("./openai-codex-FcyE8vxh.mjs").then((m) => m.createOpenAICodex)
|
|
5102
5189
|
};
|
|
5103
5190
|
function isAISDKPackage(value) {
|
|
5104
5191
|
return value in AI_SDK_PACKAGE_TO_PROTOCOL;
|
|
@@ -5108,34 +5195,35 @@ function packageForModel(model) {
|
|
|
5108
5195
|
return isAISDKPackage(npm) ? npm : DEFAULT_AI_SDK_FALLBACK;
|
|
5109
5196
|
}
|
|
5110
5197
|
function protocolForPackage(npm) {
|
|
5111
|
-
|
|
5198
|
+
const resolved = npm && isAISDKPackage(npm) ? npm : DEFAULT_AI_SDK_FALLBACK;
|
|
5199
|
+
return AI_SDK_PACKAGE_TO_PROTOCOL[resolved];
|
|
5112
5200
|
}
|
|
5113
5201
|
async function loadProviderFactory(npm) {
|
|
5114
5202
|
return PROVIDER_LOADERS[npm]();
|
|
5115
5203
|
}
|
|
5116
5204
|
function defaultMethodForModel(model) {
|
|
5117
|
-
if (model.protocol ===
|
|
5118
|
-
return
|
|
5205
|
+
if (model.protocol === KnownProviderEnum.openai || model.protocol === KnownProviderEnum.openaiCodex || model.protocol === KnownProviderEnum.xai) return APIMethodEnum.responses;
|
|
5206
|
+
return APIMethodEnum.languageModel;
|
|
5119
5207
|
}
|
|
5120
5208
|
function resolveLanguageModel(provider, model, methodOverride) {
|
|
5121
5209
|
const modelId = model.api?.id ?? model.id;
|
|
5122
5210
|
const method = methodOverride ?? model.api?.method ?? defaultMethodForModel(model);
|
|
5123
5211
|
const callable = provider;
|
|
5124
|
-
if (method ===
|
|
5125
|
-
if (method ===
|
|
5126
|
-
if (method ===
|
|
5212
|
+
if (method === APIMethodEnum.responses && callable.responses) return callable.responses(modelId);
|
|
5213
|
+
if (method === APIMethodEnum.messages && callable.messages) return callable.messages(modelId);
|
|
5214
|
+
if (method === APIMethodEnum.chat) {
|
|
5127
5215
|
if (callable.chat) return callable.chat(modelId);
|
|
5128
5216
|
if (callable.chatModel) return callable.chatModel(modelId);
|
|
5129
5217
|
}
|
|
5130
|
-
if (method ===
|
|
5218
|
+
if (method === APIMethodEnum.completion) {
|
|
5131
5219
|
if (callable.completion) return callable.completion(modelId);
|
|
5132
5220
|
if (callable.completionModel) return callable.completionModel(modelId);
|
|
5133
5221
|
}
|
|
5134
|
-
if (method ===
|
|
5222
|
+
if (method === APIMethodEnum.completionModel && callable.completionModel) return callable.completionModel(modelId);
|
|
5135
5223
|
if (callable.languageModel) return callable.languageModel(modelId);
|
|
5136
5224
|
return callable(modelId);
|
|
5137
5225
|
}
|
|
5138
5226
|
//#endregion
|
|
5139
|
-
export { protocolForPackage as a,
|
|
5227
|
+
export { lazy as C, NamedError as E, path as S, writeJson as T, getProviders as _, protocolForPackage as a, normalizeInput as b, APIMethodEnumSchema as c, KnownProviderEnumSchema as d, ProviderInfo as f, getModels as g, getModel as h, packageForModel as i, ActiveThinkingLevel as l, clampThinkingLevel as m, isAISDKPackage as n, resolveLanguageModel as o, calculateCost as p, loadProviderFactory as r, APIMethodEnum as s, DEFAULT_AI_SDK_FALLBACK as t, KnownProviderEnum as u, model_exports as v, readJson as w, registry as x, modelsAreEqual as y };
|
|
5140
5228
|
|
|
5141
|
-
//# sourceMappingURL=registry-
|
|
5229
|
+
//# sourceMappingURL=registry-CMkIE_B4.mjs.map
|