@massa-ai/mcp-client 1.41.0 → 1.43.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/dist/config-cli.js +491 -324
- package/dist/index.js +527 -371
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -25549,6 +25549,7 @@ var init_massa_ai_config = __esm(() => {
|
|
|
25549
25549
|
// ../../packages/shared/dist/config/config-loader.js
|
|
25550
25550
|
var exports_config_loader = {};
|
|
25551
25551
|
__export(exports_config_loader, {
|
|
25552
|
+
writeFileAtomically: () => writeFileAtomically,
|
|
25552
25553
|
saveConfig: () => saveConfig,
|
|
25553
25554
|
migrateDataDirOnce: () => migrateDataDirOnce,
|
|
25554
25555
|
loadConfigSafe: () => loadConfigSafe,
|
|
@@ -25633,15 +25634,17 @@ function migrateDataDirOnce() {
|
|
|
25633
25634
|
function __resetMigrationForTests() {
|
|
25634
25635
|
migrationAttempted = false;
|
|
25635
25636
|
}
|
|
25636
|
-
function
|
|
25637
|
-
|
|
25638
|
-
|
|
25637
|
+
function writeFileAtomically(targetPath, content) {
|
|
25638
|
+
const dir = path3.dirname(targetPath);
|
|
25639
|
+
if (!fs.existsSync(dir)) {
|
|
25640
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
25639
25641
|
}
|
|
25640
25642
|
const unique = `${process.pid}.${++tempFileCounter}.${crypto2.randomBytes(6).toString("hex")}`;
|
|
25641
|
-
const tempFile = path3.join(
|
|
25643
|
+
const tempFile = path3.join(dir, `.${path3.basename(targetPath)}.${unique}.tmp`);
|
|
25642
25644
|
try {
|
|
25643
|
-
fs.writeFileSync(tempFile,
|
|
25644
|
-
fs.
|
|
25645
|
+
fs.writeFileSync(tempFile, content, { mode: 384 });
|
|
25646
|
+
fs.chmodSync(tempFile, 384);
|
|
25647
|
+
fs.renameSync(tempFile, targetPath);
|
|
25645
25648
|
} catch (error51) {
|
|
25646
25649
|
try {
|
|
25647
25650
|
fs.unlinkSync(tempFile);
|
|
@@ -25649,6 +25652,9 @@ function saveConfig(config2) {
|
|
|
25649
25652
|
throw error51;
|
|
25650
25653
|
}
|
|
25651
25654
|
}
|
|
25655
|
+
function saveConfig(config2) {
|
|
25656
|
+
writeFileAtomically(CONFIG_FILE, JSON.stringify(config2, null, 2));
|
|
25657
|
+
}
|
|
25652
25658
|
function initConfig() {
|
|
25653
25659
|
if (!fs.existsSync(CONFIG_FILE)) {
|
|
25654
25660
|
saveConfig(defaultMassaAiConfig);
|
|
@@ -27015,7 +27021,7 @@ function listProfiles(opts = {}) {
|
|
|
27015
27021
|
installed,
|
|
27016
27022
|
skipped: false,
|
|
27017
27023
|
skipReason: null,
|
|
27018
|
-
activeProfile: platform?.modelProfile?.profile ?? "balanced",
|
|
27024
|
+
activeProfile: platform?.modelProfile?.profile ?? opts.hostDefaults?.[host] ?? "balanced",
|
|
27019
27025
|
bundleVersion: platform?.plugin?.version ?? null,
|
|
27020
27026
|
availableProfiles
|
|
27021
27027
|
};
|
|
@@ -27185,6 +27191,114 @@ function reportSucceeded(report) {
|
|
|
27185
27191
|
return report.hosts.every((h) => h.status === "switched" || h.status === "skipped");
|
|
27186
27192
|
}
|
|
27187
27193
|
|
|
27194
|
+
// ../../packages/shared/dist/profile-switch/variant-sync.js
|
|
27195
|
+
import fs6 from "fs";
|
|
27196
|
+
import path9 from "path";
|
|
27197
|
+
import crypto5 from "crypto";
|
|
27198
|
+
function writeFileIntoDirAtomically(destDir, destName, content) {
|
|
27199
|
+
const unique = `${process.pid}.${++tempFileCounter2}.${crypto5.randomBytes(6).toString("hex")}`;
|
|
27200
|
+
const tempFile = path9.join(destDir, `.${destName}.${unique}.tmp`);
|
|
27201
|
+
try {
|
|
27202
|
+
fs6.writeFileSync(tempFile, content);
|
|
27203
|
+
fs6.renameSync(tempFile, path9.join(destDir, destName));
|
|
27204
|
+
} catch (error51) {
|
|
27205
|
+
try {
|
|
27206
|
+
fs6.unlinkSync(tempFile);
|
|
27207
|
+
} catch {}
|
|
27208
|
+
throw error51;
|
|
27209
|
+
}
|
|
27210
|
+
}
|
|
27211
|
+
function isSafeDirName(name) {
|
|
27212
|
+
if (name === "." || name === "..")
|
|
27213
|
+
return false;
|
|
27214
|
+
if (name.includes("/") || name.includes("\\") || name.includes(path9.sep))
|
|
27215
|
+
return false;
|
|
27216
|
+
return path9.basename(name) === name;
|
|
27217
|
+
}
|
|
27218
|
+
function syncHost(host, sourceRoot, targetHome) {
|
|
27219
|
+
const layout = resolveHostLayout(host, { targetHome });
|
|
27220
|
+
if (layout.route === "skip") {
|
|
27221
|
+
return { host, status: "skipped", profiles: [], retained: [], files: 0, reason: layout.reason };
|
|
27222
|
+
}
|
|
27223
|
+
const srcDir = path9.join(sourceRoot, "apps", `${host}-plugin`, "agent-profiles");
|
|
27224
|
+
if (!fs6.existsSync(srcDir) || !fs6.statSync(srcDir).isDirectory()) {
|
|
27225
|
+
return { host, status: "skipped", profiles: [], retained: [], files: 0, reason: "no generated variants for this host" };
|
|
27226
|
+
}
|
|
27227
|
+
if (!fs6.existsSync(layout.variantsRoot)) {
|
|
27228
|
+
return {
|
|
27229
|
+
host,
|
|
27230
|
+
status: "skipped",
|
|
27231
|
+
profiles: [],
|
|
27232
|
+
retained: [],
|
|
27233
|
+
files: 0,
|
|
27234
|
+
reason: `variant tree not present at ${layout.variantsRoot} \u2014 run the plugin installer ` + "or an initial profile switch"
|
|
27235
|
+
};
|
|
27236
|
+
}
|
|
27237
|
+
const profiles = [];
|
|
27238
|
+
let files = 0;
|
|
27239
|
+
for (const entry of fs6.readdirSync(srcDir, { withFileTypes: true })) {
|
|
27240
|
+
if (!entry.isDirectory())
|
|
27241
|
+
continue;
|
|
27242
|
+
if (!isSafeDirName(entry.name))
|
|
27243
|
+
continue;
|
|
27244
|
+
const srcProfileDir = path9.join(srcDir, entry.name);
|
|
27245
|
+
const destProfileDir = path9.join(layout.variantsRoot, entry.name);
|
|
27246
|
+
fs6.mkdirSync(destProfileDir, { recursive: true });
|
|
27247
|
+
for (const fileEntry of fs6.readdirSync(srcProfileDir, { withFileTypes: true })) {
|
|
27248
|
+
if (!fileEntry.isFile())
|
|
27249
|
+
continue;
|
|
27250
|
+
const content = fs6.readFileSync(path9.join(srcProfileDir, fileEntry.name));
|
|
27251
|
+
writeFileIntoDirAtomically(destProfileDir, fileEntry.name, content);
|
|
27252
|
+
files++;
|
|
27253
|
+
}
|
|
27254
|
+
profiles.push(entry.name);
|
|
27255
|
+
}
|
|
27256
|
+
const retained = fs6.readdirSync(layout.variantsRoot, { withFileTypes: true }).filter((e) => e.isDirectory() && !profiles.includes(e.name)).map((e) => e.name).sort();
|
|
27257
|
+
return { host, status: "synced", profiles: profiles.sort(), retained, files };
|
|
27258
|
+
}
|
|
27259
|
+
function syncGeneratedVariants(opts) {
|
|
27260
|
+
const hosts = opts.hosts ?? HOSTS;
|
|
27261
|
+
if (!opts.sourceRoot) {
|
|
27262
|
+
return hosts.map((host) => ({
|
|
27263
|
+
host,
|
|
27264
|
+
status: "skipped",
|
|
27265
|
+
profiles: [],
|
|
27266
|
+
retained: [],
|
|
27267
|
+
files: 0,
|
|
27268
|
+
reason: "no source checkout \u2014 nothing to sync"
|
|
27269
|
+
}));
|
|
27270
|
+
}
|
|
27271
|
+
const sourceRoot = opts.sourceRoot;
|
|
27272
|
+
return hosts.map((host) => {
|
|
27273
|
+
try {
|
|
27274
|
+
return syncHost(host, sourceRoot, opts.targetHome);
|
|
27275
|
+
} catch (err) {
|
|
27276
|
+
return { host, status: "failed", profiles: [], retained: [], files: 0, error: err.message };
|
|
27277
|
+
}
|
|
27278
|
+
});
|
|
27279
|
+
}
|
|
27280
|
+
var tempFileCounter2 = 0;
|
|
27281
|
+
var init_variant_sync = __esm(() => {
|
|
27282
|
+
init_hosts();
|
|
27283
|
+
});
|
|
27284
|
+
|
|
27285
|
+
// ../../packages/shared/dist/profile-switch/repo-root.js
|
|
27286
|
+
import fs7 from "fs";
|
|
27287
|
+
import path10 from "path";
|
|
27288
|
+
function findRepoRootWithMarker(startDir, marker, maxLevels) {
|
|
27289
|
+
let dir = startDir;
|
|
27290
|
+
for (let i = 0;i <= maxLevels; i++) {
|
|
27291
|
+
if (fs7.existsSync(path10.join(dir, marker)))
|
|
27292
|
+
return dir;
|
|
27293
|
+
const parent = path10.dirname(dir);
|
|
27294
|
+
if (parent === dir)
|
|
27295
|
+
break;
|
|
27296
|
+
dir = parent;
|
|
27297
|
+
}
|
|
27298
|
+
return null;
|
|
27299
|
+
}
|
|
27300
|
+
var init_repo_root = () => {};
|
|
27301
|
+
|
|
27188
27302
|
// ../../packages/shared/dist/index.js
|
|
27189
27303
|
var init_dist = __esm(() => {
|
|
27190
27304
|
init_env();
|
|
@@ -27193,6 +27307,8 @@ var init_dist = __esm(() => {
|
|
|
27193
27307
|
init_state();
|
|
27194
27308
|
init_lock();
|
|
27195
27309
|
init_engine();
|
|
27310
|
+
init_variant_sync();
|
|
27311
|
+
init_repo_root();
|
|
27196
27312
|
init_types2();
|
|
27197
27313
|
init_interfaces();
|
|
27198
27314
|
init_utils();
|
|
@@ -28714,7 +28830,7 @@ var import_brace_expansion, minimatch = (p, pattern, options = {}) => {
|
|
|
28714
28830
|
}, qmarksTestNoExtDot = ([$0]) => {
|
|
28715
28831
|
const len = $0.length;
|
|
28716
28832
|
return (f) => f.length === len && f !== "." && f !== "..";
|
|
28717
|
-
}, defaultPlatform,
|
|
28833
|
+
}, defaultPlatform, path11, sep, GLOBSTAR, qmark2 = "[^/]", star2, twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?", filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options), ext = (a, b = {}) => Object.assign({}, a, b), defaults = (def) => {
|
|
28718
28834
|
if (!def || typeof def !== "object" || !Object.keys(def).length) {
|
|
28719
28835
|
return minimatch;
|
|
28720
28836
|
}
|
|
@@ -28772,11 +28888,11 @@ var init_esm = __esm(() => {
|
|
|
28772
28888
|
starRE = /^\*+$/;
|
|
28773
28889
|
qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
|
|
28774
28890
|
defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
28775
|
-
|
|
28891
|
+
path11 = {
|
|
28776
28892
|
win32: { sep: "\\" },
|
|
28777
28893
|
posix: { sep: "/" }
|
|
28778
28894
|
};
|
|
28779
|
-
sep = defaultPlatform === "win32" ?
|
|
28895
|
+
sep = defaultPlatform === "win32" ? path11.win32.sep : path11.posix.sep;
|
|
28780
28896
|
minimatch.sep = sep;
|
|
28781
28897
|
GLOBSTAR = Symbol("globstar **");
|
|
28782
28898
|
minimatch.GLOBSTAR = GLOBSTAR;
|
|
@@ -30742,12 +30858,12 @@ var init_esm4 = __esm(() => {
|
|
|
30742
30858
|
childrenCache() {
|
|
30743
30859
|
return this.#children;
|
|
30744
30860
|
}
|
|
30745
|
-
resolve(
|
|
30746
|
-
if (!
|
|
30861
|
+
resolve(path12) {
|
|
30862
|
+
if (!path12) {
|
|
30747
30863
|
return this;
|
|
30748
30864
|
}
|
|
30749
|
-
const rootPath = this.getRootString(
|
|
30750
|
-
const dir =
|
|
30865
|
+
const rootPath = this.getRootString(path12);
|
|
30866
|
+
const dir = path12.substring(rootPath.length);
|
|
30751
30867
|
const dirParts = dir.split(this.splitSep);
|
|
30752
30868
|
const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
|
|
30753
30869
|
return result;
|
|
@@ -31275,8 +31391,8 @@ var init_esm4 = __esm(() => {
|
|
|
31275
31391
|
newChild(name, type = UNKNOWN, opts = {}) {
|
|
31276
31392
|
return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
|
|
31277
31393
|
}
|
|
31278
|
-
getRootString(
|
|
31279
|
-
return win32.parse(
|
|
31394
|
+
getRootString(path12) {
|
|
31395
|
+
return win32.parse(path12).root;
|
|
31280
31396
|
}
|
|
31281
31397
|
getRoot(rootPath) {
|
|
31282
31398
|
rootPath = uncToDrive(rootPath.toUpperCase());
|
|
@@ -31301,8 +31417,8 @@ var init_esm4 = __esm(() => {
|
|
|
31301
31417
|
constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
|
|
31302
31418
|
super(name, type, root, roots, nocase, children, opts);
|
|
31303
31419
|
}
|
|
31304
|
-
getRootString(
|
|
31305
|
-
return
|
|
31420
|
+
getRootString(path12) {
|
|
31421
|
+
return path12.startsWith("/") ? "/" : "";
|
|
31306
31422
|
}
|
|
31307
31423
|
getRoot(_rootPath) {
|
|
31308
31424
|
return this.root;
|
|
@@ -31321,8 +31437,8 @@ var init_esm4 = __esm(() => {
|
|
|
31321
31437
|
#children;
|
|
31322
31438
|
nocase;
|
|
31323
31439
|
#fs;
|
|
31324
|
-
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs:
|
|
31325
|
-
this.#fs = fsFromOption(
|
|
31440
|
+
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs8 = defaultFS } = {}) {
|
|
31441
|
+
this.#fs = fsFromOption(fs8);
|
|
31326
31442
|
if (cwd instanceof URL || cwd.startsWith("file://")) {
|
|
31327
31443
|
cwd = fileURLToPath(cwd);
|
|
31328
31444
|
}
|
|
@@ -31358,11 +31474,11 @@ var init_esm4 = __esm(() => {
|
|
|
31358
31474
|
}
|
|
31359
31475
|
this.cwd = prev;
|
|
31360
31476
|
}
|
|
31361
|
-
depth(
|
|
31362
|
-
if (typeof
|
|
31363
|
-
|
|
31477
|
+
depth(path12 = this.cwd) {
|
|
31478
|
+
if (typeof path12 === "string") {
|
|
31479
|
+
path12 = this.cwd.resolve(path12);
|
|
31364
31480
|
}
|
|
31365
|
-
return
|
|
31481
|
+
return path12.depth();
|
|
31366
31482
|
}
|
|
31367
31483
|
childrenCache() {
|
|
31368
31484
|
return this.#children;
|
|
@@ -31778,9 +31894,9 @@ var init_esm4 = __esm(() => {
|
|
|
31778
31894
|
process4();
|
|
31779
31895
|
return results;
|
|
31780
31896
|
}
|
|
31781
|
-
chdir(
|
|
31897
|
+
chdir(path12 = this.cwd) {
|
|
31782
31898
|
const oldCwd = this.cwd;
|
|
31783
|
-
this.cwd = typeof
|
|
31899
|
+
this.cwd = typeof path12 === "string" ? this.cwd.resolve(path12) : path12;
|
|
31784
31900
|
this.cwd[setAsCwd](oldCwd);
|
|
31785
31901
|
}
|
|
31786
31902
|
};
|
|
@@ -31797,8 +31913,8 @@ var init_esm4 = __esm(() => {
|
|
|
31797
31913
|
parseRootPath(dir) {
|
|
31798
31914
|
return win32.parse(dir).root.toUpperCase();
|
|
31799
31915
|
}
|
|
31800
|
-
newRoot(
|
|
31801
|
-
return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
31916
|
+
newRoot(fs8) {
|
|
31917
|
+
return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs8 });
|
|
31802
31918
|
}
|
|
31803
31919
|
isAbsolute(p) {
|
|
31804
31920
|
return p.startsWith("/") || p.startsWith("\\") || /^[a-z]:(\/|\\)/i.test(p);
|
|
@@ -31814,8 +31930,8 @@ var init_esm4 = __esm(() => {
|
|
|
31814
31930
|
parseRootPath(_dir) {
|
|
31815
31931
|
return "/";
|
|
31816
31932
|
}
|
|
31817
|
-
newRoot(
|
|
31818
|
-
return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
31933
|
+
newRoot(fs8) {
|
|
31934
|
+
return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs8 });
|
|
31819
31935
|
}
|
|
31820
31936
|
isAbsolute(p) {
|
|
31821
31937
|
return p.startsWith("/");
|
|
@@ -32072,8 +32188,8 @@ class MatchRecord {
|
|
|
32072
32188
|
this.store.set(target, current === undefined ? n : n & current);
|
|
32073
32189
|
}
|
|
32074
32190
|
entries() {
|
|
32075
|
-
return [...this.store.entries()].map(([
|
|
32076
|
-
|
|
32191
|
+
return [...this.store.entries()].map(([path12, n]) => [
|
|
32192
|
+
path12,
|
|
32077
32193
|
!!(n & 2),
|
|
32078
32194
|
!!(n & 1)
|
|
32079
32195
|
]);
|
|
@@ -32277,9 +32393,9 @@ class GlobUtil {
|
|
|
32277
32393
|
signal;
|
|
32278
32394
|
maxDepth;
|
|
32279
32395
|
includeChildMatches;
|
|
32280
|
-
constructor(patterns,
|
|
32396
|
+
constructor(patterns, path12, opts) {
|
|
32281
32397
|
this.patterns = patterns;
|
|
32282
|
-
this.path =
|
|
32398
|
+
this.path = path12;
|
|
32283
32399
|
this.opts = opts;
|
|
32284
32400
|
this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
|
|
32285
32401
|
this.includeChildMatches = opts.includeChildMatches !== false;
|
|
@@ -32298,11 +32414,11 @@ class GlobUtil {
|
|
|
32298
32414
|
});
|
|
32299
32415
|
}
|
|
32300
32416
|
}
|
|
32301
|
-
#ignored(
|
|
32302
|
-
return this.seen.has(
|
|
32417
|
+
#ignored(path12) {
|
|
32418
|
+
return this.seen.has(path12) || !!this.#ignore?.ignored?.(path12);
|
|
32303
32419
|
}
|
|
32304
|
-
#childrenIgnored(
|
|
32305
|
-
return !!this.#ignore?.childrenIgnored?.(
|
|
32420
|
+
#childrenIgnored(path12) {
|
|
32421
|
+
return !!this.#ignore?.childrenIgnored?.(path12);
|
|
32306
32422
|
}
|
|
32307
32423
|
pause() {
|
|
32308
32424
|
this.paused = true;
|
|
@@ -32519,8 +32635,8 @@ var init_walker = __esm(() => {
|
|
|
32519
32635
|
init_processor();
|
|
32520
32636
|
GlobWalker = class GlobWalker extends GlobUtil {
|
|
32521
32637
|
matches = new Set;
|
|
32522
|
-
constructor(patterns,
|
|
32523
|
-
super(patterns,
|
|
32638
|
+
constructor(patterns, path12, opts) {
|
|
32639
|
+
super(patterns, path12, opts);
|
|
32524
32640
|
}
|
|
32525
32641
|
matchEmit(e) {
|
|
32526
32642
|
this.matches.add(e);
|
|
@@ -32557,8 +32673,8 @@ var init_walker = __esm(() => {
|
|
|
32557
32673
|
};
|
|
32558
32674
|
GlobStream = class GlobStream extends GlobUtil {
|
|
32559
32675
|
results;
|
|
32560
|
-
constructor(patterns,
|
|
32561
|
-
super(patterns,
|
|
32676
|
+
constructor(patterns, path12, opts) {
|
|
32677
|
+
super(patterns, path12, opts);
|
|
32562
32678
|
this.results = new Minipass({
|
|
32563
32679
|
signal: this.signal,
|
|
32564
32680
|
objectMode: true
|
|
@@ -32986,20 +33102,20 @@ var require_ignore = __commonJS((exports, module) => {
|
|
|
32986
33102
|
var throwError = (message, Ctor) => {
|
|
32987
33103
|
throw new Ctor(message);
|
|
32988
33104
|
};
|
|
32989
|
-
var checkPath = (
|
|
32990
|
-
if (!isString(
|
|
33105
|
+
var checkPath = (path12, originalPath, doThrow) => {
|
|
33106
|
+
if (!isString(path12)) {
|
|
32991
33107
|
return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError);
|
|
32992
33108
|
}
|
|
32993
|
-
if (!
|
|
33109
|
+
if (!path12) {
|
|
32994
33110
|
return doThrow(`path must not be empty`, TypeError);
|
|
32995
33111
|
}
|
|
32996
|
-
if (checkPath.isNotRelative(
|
|
33112
|
+
if (checkPath.isNotRelative(path12)) {
|
|
32997
33113
|
const r = "`path.relative()`d";
|
|
32998
33114
|
return doThrow(`path should be a ${r} string, but got "${originalPath}"`, RangeError);
|
|
32999
33115
|
}
|
|
33000
33116
|
return true;
|
|
33001
33117
|
};
|
|
33002
|
-
var isNotRelative = (
|
|
33118
|
+
var isNotRelative = (path12) => REGEX_TEST_INVALID_PATH.test(path12);
|
|
33003
33119
|
checkPath.isNotRelative = isNotRelative;
|
|
33004
33120
|
checkPath.convert = (p) => p;
|
|
33005
33121
|
|
|
@@ -33042,7 +33158,7 @@ var require_ignore = __commonJS((exports, module) => {
|
|
|
33042
33158
|
addPattern(pattern) {
|
|
33043
33159
|
return this.add(pattern);
|
|
33044
33160
|
}
|
|
33045
|
-
_testOne(
|
|
33161
|
+
_testOne(path12, checkUnignored) {
|
|
33046
33162
|
let ignored = false;
|
|
33047
33163
|
let unignored = false;
|
|
33048
33164
|
this._rules.forEach((rule) => {
|
|
@@ -33050,7 +33166,7 @@ var require_ignore = __commonJS((exports, module) => {
|
|
|
33050
33166
|
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
|
|
33051
33167
|
return;
|
|
33052
33168
|
}
|
|
33053
|
-
const matched = rule.regex.test(
|
|
33169
|
+
const matched = rule.regex.test(path12);
|
|
33054
33170
|
if (matched) {
|
|
33055
33171
|
ignored = !negative;
|
|
33056
33172
|
unignored = negative;
|
|
@@ -33062,39 +33178,39 @@ var require_ignore = __commonJS((exports, module) => {
|
|
|
33062
33178
|
};
|
|
33063
33179
|
}
|
|
33064
33180
|
_test(originalPath, cache, checkUnignored, slices) {
|
|
33065
|
-
const
|
|
33066
|
-
checkPath(
|
|
33067
|
-
return this._t(
|
|
33181
|
+
const path12 = originalPath && checkPath.convert(originalPath);
|
|
33182
|
+
checkPath(path12, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
|
|
33183
|
+
return this._t(path12, cache, checkUnignored, slices);
|
|
33068
33184
|
}
|
|
33069
|
-
_t(
|
|
33070
|
-
if (
|
|
33071
|
-
return cache[
|
|
33185
|
+
_t(path12, cache, checkUnignored, slices) {
|
|
33186
|
+
if (path12 in cache) {
|
|
33187
|
+
return cache[path12];
|
|
33072
33188
|
}
|
|
33073
33189
|
if (!slices) {
|
|
33074
|
-
slices =
|
|
33190
|
+
slices = path12.split(SLASH);
|
|
33075
33191
|
}
|
|
33076
33192
|
slices.pop();
|
|
33077
33193
|
if (!slices.length) {
|
|
33078
|
-
return cache[
|
|
33194
|
+
return cache[path12] = this._testOne(path12, checkUnignored);
|
|
33079
33195
|
}
|
|
33080
33196
|
const parent = this._t(slices.join(SLASH) + SLASH, cache, checkUnignored, slices);
|
|
33081
|
-
return cache[
|
|
33197
|
+
return cache[path12] = parent.ignored ? parent : this._testOne(path12, checkUnignored);
|
|
33082
33198
|
}
|
|
33083
|
-
ignores(
|
|
33084
|
-
return this._test(
|
|
33199
|
+
ignores(path12) {
|
|
33200
|
+
return this._test(path12, this._ignoreCache, false).ignored;
|
|
33085
33201
|
}
|
|
33086
33202
|
createFilter() {
|
|
33087
|
-
return (
|
|
33203
|
+
return (path12) => !this.ignores(path12);
|
|
33088
33204
|
}
|
|
33089
33205
|
filter(paths) {
|
|
33090
33206
|
return makeArray(paths).filter(this.createFilter());
|
|
33091
33207
|
}
|
|
33092
|
-
test(
|
|
33093
|
-
return this._test(
|
|
33208
|
+
test(path12) {
|
|
33209
|
+
return this._test(path12, this._testCache, true);
|
|
33094
33210
|
}
|
|
33095
33211
|
}
|
|
33096
33212
|
var factory = (options) => new Ignore2(options);
|
|
33097
|
-
var isPathValid = (
|
|
33213
|
+
var isPathValid = (path12) => checkPath(path12 && checkPath.convert(path12), path12, RETURN_FALSE);
|
|
33098
33214
|
factory.isPathValid = isPathValid;
|
|
33099
33215
|
factory.default = factory;
|
|
33100
33216
|
module.exports = factory;
|
|
@@ -33102,7 +33218,7 @@ var require_ignore = __commonJS((exports, module) => {
|
|
|
33102
33218
|
const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
|
|
33103
33219
|
checkPath.convert = makePosix;
|
|
33104
33220
|
const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
|
33105
|
-
checkPath.isNotRelative = (
|
|
33221
|
+
checkPath.isNotRelative = (path12) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path12) || isNotRelative(path12);
|
|
33106
33222
|
}
|
|
33107
33223
|
});
|
|
33108
33224
|
|
|
@@ -33164,13 +33280,13 @@ function validatePolicy(policy, opts = {}) {
|
|
|
33164
33280
|
}
|
|
33165
33281
|
}
|
|
33166
33282
|
}
|
|
33167
|
-
function matchesGlob2(
|
|
33283
|
+
function matchesGlob2(path12, pattern) {
|
|
33168
33284
|
let re = regexCache.get(pattern);
|
|
33169
33285
|
if (!re) {
|
|
33170
33286
|
re = globToRegex(pattern);
|
|
33171
33287
|
regexCache.set(pattern, re);
|
|
33172
33288
|
}
|
|
33173
|
-
return re.test(
|
|
33289
|
+
return re.test(path12);
|
|
33174
33290
|
}
|
|
33175
33291
|
var MAX_MATCH_WORK = 1e5, MAX_IGNORE_PATTERNS2 = 1024, DEFAULT_POLICY, applyPolicy = (filePath, policy) => {
|
|
33176
33292
|
const normalized = filePath.trim();
|
|
@@ -33221,8 +33337,8 @@ var init_capture_policy = __esm(() => {
|
|
|
33221
33337
|
});
|
|
33222
33338
|
|
|
33223
33339
|
// ../../packages/core/dist/services/search/ignore-patterns.js
|
|
33224
|
-
import
|
|
33225
|
-
import
|
|
33340
|
+
import fs8 from "fs/promises";
|
|
33341
|
+
import path12 from "path";
|
|
33226
33342
|
function buildExtensionGlob(extensions) {
|
|
33227
33343
|
return extensions.map((ext2) => `**/*${ext2}`);
|
|
33228
33344
|
}
|
|
@@ -33245,8 +33361,8 @@ async function loadProjectIgnore(projectPath) {
|
|
|
33245
33361
|
const ig = ignore();
|
|
33246
33362
|
ig.add(DEFAULT_IGNORES);
|
|
33247
33363
|
try {
|
|
33248
|
-
const gitignorePath =
|
|
33249
|
-
const gitignoreContent = await
|
|
33364
|
+
const gitignorePath = path12.join(projectPath, ".gitignore");
|
|
33365
|
+
const gitignoreContent = await fs8.readFile(gitignorePath, "utf8");
|
|
33250
33366
|
const rules = gitignoreContent.split(`
|
|
33251
33367
|
`).map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
|
|
33252
33368
|
ig.add(rules);
|
|
@@ -34574,7 +34690,7 @@ var require_cert_signatures = __commonJS((exports, module) => {
|
|
|
34574
34690
|
|
|
34575
34691
|
// ../../node_modules/pg/lib/crypto/sasl.js
|
|
34576
34692
|
var require_sasl = __commonJS((exports, module) => {
|
|
34577
|
-
var
|
|
34693
|
+
var crypto6 = require_utils3();
|
|
34578
34694
|
var { signatureAlgorithmHashFromCertificate } = require_cert_signatures();
|
|
34579
34695
|
function saslprep(password) {
|
|
34580
34696
|
const nonAsciiSpace = /[\u00A0\u1680\u2000-\u200B\u202F\u205F\u3000]/g;
|
|
@@ -34593,7 +34709,7 @@ var require_sasl = __commonJS((exports, module) => {
|
|
|
34593
34709
|
if (mechanism === "SCRAM-SHA-256-PLUS" && typeof stream2.getPeerCertificate !== "function") {
|
|
34594
34710
|
throw new Error("SASL: Mechanism SCRAM-SHA-256-PLUS requires a certificate");
|
|
34595
34711
|
}
|
|
34596
|
-
const clientNonce =
|
|
34712
|
+
const clientNonce = crypto6.randomBytes(18).toString("base64");
|
|
34597
34713
|
const gs2Header = mechanism === "SCRAM-SHA-256-PLUS" ? "p=tls-server-end-point" : stream2 ? "y" : "n";
|
|
34598
34714
|
return {
|
|
34599
34715
|
mechanism,
|
|
@@ -34634,20 +34750,20 @@ var require_sasl = __commonJS((exports, module) => {
|
|
|
34634
34750
|
let hashName = signatureAlgorithmHashFromCertificate(peerCert);
|
|
34635
34751
|
if (hashName === "MD5" || hashName === "SHA-1")
|
|
34636
34752
|
hashName = "SHA-256";
|
|
34637
|
-
const certHash = await
|
|
34753
|
+
const certHash = await crypto6.hashByName(hashName, peerCert);
|
|
34638
34754
|
const bindingData = Buffer.concat([Buffer.from("p=tls-server-end-point,,"), Buffer.from(certHash)]);
|
|
34639
34755
|
channelBinding = bindingData.toString("base64");
|
|
34640
34756
|
}
|
|
34641
34757
|
const clientFinalMessageWithoutProof = "c=" + channelBinding + ",r=" + sv.nonce;
|
|
34642
34758
|
const authMessage = clientFirstMessageBare + "," + serverFirstMessage + "," + clientFinalMessageWithoutProof;
|
|
34643
34759
|
const saltBytes = Buffer.from(sv.salt, "base64");
|
|
34644
|
-
const saltedPassword = await
|
|
34645
|
-
const clientKey = await
|
|
34646
|
-
const storedKey = await
|
|
34647
|
-
const clientSignature = await
|
|
34760
|
+
const saltedPassword = await crypto6.deriveKey(saslprep(password), saltBytes, sv.iteration);
|
|
34761
|
+
const clientKey = await crypto6.hmacSha256(saltedPassword, "Client Key");
|
|
34762
|
+
const storedKey = await crypto6.sha256(clientKey);
|
|
34763
|
+
const clientSignature = await crypto6.hmacSha256(storedKey, authMessage);
|
|
34648
34764
|
const clientProof = xorBuffers(Buffer.from(clientKey), Buffer.from(clientSignature)).toString("base64");
|
|
34649
|
-
const serverKey = await
|
|
34650
|
-
const serverSignatureBytes = await
|
|
34765
|
+
const serverKey = await crypto6.hmacSha256(saltedPassword, "Server Key");
|
|
34766
|
+
const serverSignatureBytes = await crypto6.hmacSha256(serverKey, authMessage);
|
|
34651
34767
|
session.message = "SASLResponse";
|
|
34652
34768
|
session.serverSignature = Buffer.from(serverSignatureBytes).toString("base64");
|
|
34653
34769
|
session.response = clientFinalMessageWithoutProof + ",p=" + clientProof;
|
|
@@ -34842,15 +34958,15 @@ var require_pg_connection_string = __commonJS((exports, module) => {
|
|
|
34842
34958
|
if (config3.sslnegotiation === "direct" && config3.ssl === undefined) {
|
|
34843
34959
|
config3.ssl = true;
|
|
34844
34960
|
}
|
|
34845
|
-
const
|
|
34961
|
+
const fs9 = config3.sslcert || config3.sslkey || config3.sslrootcert ? __require("fs") : null;
|
|
34846
34962
|
if (config3.sslcert) {
|
|
34847
|
-
config3.ssl.cert =
|
|
34963
|
+
config3.ssl.cert = fs9.readFileSync(config3.sslcert).toString();
|
|
34848
34964
|
}
|
|
34849
34965
|
if (config3.sslkey) {
|
|
34850
|
-
config3.ssl.key =
|
|
34966
|
+
config3.ssl.key = fs9.readFileSync(config3.sslkey).toString();
|
|
34851
34967
|
}
|
|
34852
34968
|
if (config3.sslrootcert) {
|
|
34853
|
-
config3.ssl.ca =
|
|
34969
|
+
config3.ssl.ca = fs9.readFileSync(config3.sslrootcert).toString();
|
|
34854
34970
|
}
|
|
34855
34971
|
if (options.useLibpqCompat && config3.uselibpqcompat) {
|
|
34856
34972
|
throw new Error("Both useLibpqCompat and uselibpqcompat are set. Please use only one of them.");
|
|
@@ -36564,7 +36680,7 @@ var require_split2 = __commonJS((exports, module) => {
|
|
|
36564
36680
|
|
|
36565
36681
|
// ../../node_modules/pgpass/lib/helper.js
|
|
36566
36682
|
var require_helper = __commonJS((exports, module) => {
|
|
36567
|
-
var
|
|
36683
|
+
var path13 = __require("path");
|
|
36568
36684
|
var Stream2 = __require("stream").Stream;
|
|
36569
36685
|
var split = require_split2();
|
|
36570
36686
|
var util3 = __require("util");
|
|
@@ -36604,7 +36720,7 @@ var require_helper = __commonJS((exports, module) => {
|
|
|
36604
36720
|
};
|
|
36605
36721
|
exports.getFileName = function(rawEnv) {
|
|
36606
36722
|
var env = rawEnv || process.env;
|
|
36607
|
-
var file2 = env.PGPASSFILE || (isWin ?
|
|
36723
|
+
var file2 = env.PGPASSFILE || (isWin ? path13.join(env.APPDATA || "./", "postgresql", "pgpass.conf") : path13.join(env.HOME || "./", ".pgpass"));
|
|
36608
36724
|
return file2;
|
|
36609
36725
|
};
|
|
36610
36726
|
exports.usePgPass = function(stats, fname) {
|
|
@@ -36728,16 +36844,16 @@ var require_helper = __commonJS((exports, module) => {
|
|
|
36728
36844
|
|
|
36729
36845
|
// ../../node_modules/pgpass/lib/index.js
|
|
36730
36846
|
var require_lib = __commonJS((exports, module) => {
|
|
36731
|
-
var
|
|
36732
|
-
var
|
|
36847
|
+
var path13 = __require("path");
|
|
36848
|
+
var fs9 = __require("fs");
|
|
36733
36849
|
var helper = require_helper();
|
|
36734
36850
|
module.exports = function(connInfo, cb) {
|
|
36735
36851
|
var file2 = helper.getFileName();
|
|
36736
|
-
|
|
36852
|
+
fs9.stat(file2, function(err, stat) {
|
|
36737
36853
|
if (err || !helper.usePgPass(stat, file2)) {
|
|
36738
36854
|
return cb(undefined);
|
|
36739
36855
|
}
|
|
36740
|
-
var st =
|
|
36856
|
+
var st = fs9.createReadStream(file2);
|
|
36741
36857
|
helper.getPassword(connInfo, st, cb);
|
|
36742
36858
|
});
|
|
36743
36859
|
};
|
|
@@ -36755,7 +36871,7 @@ var require_client = __commonJS((exports, module) => {
|
|
|
36755
36871
|
var Query = require_query();
|
|
36756
36872
|
var defaults2 = require_defaults2();
|
|
36757
36873
|
var Connection = require_connection();
|
|
36758
|
-
var
|
|
36874
|
+
var crypto6 = require_utils3();
|
|
36759
36875
|
var activeQueryDeprecationNotice = nodeUtils.deprecate(() => {}, "Client.activeQuery is deprecated and will be removed in pg@9.0");
|
|
36760
36876
|
var queryQueueDeprecationNotice = nodeUtils.deprecate(() => {}, "Client.queryQueue is deprecated and will be removed in pg@9.0.");
|
|
36761
36877
|
var pgPassDeprecationNotice = nodeUtils.deprecate(() => {}, "pgpass support is deprecated and will be removed in pg@9.0. " + "You can provide an async function as the password property to the Client/Pool constructor that returns a password instead. Within this function you can call the pgpass module in your own code.");
|
|
@@ -36987,7 +37103,7 @@ var require_client = __commonJS((exports, module) => {
|
|
|
36987
37103
|
_handleAuthMD5Password(msg) {
|
|
36988
37104
|
this._getPassword(async () => {
|
|
36989
37105
|
try {
|
|
36990
|
-
const hashedPassword = await
|
|
37106
|
+
const hashedPassword = await crypto6.postgresMd5PasswordHash(this.user, this.password, msg.salt);
|
|
36991
37107
|
this.connection.password(hashedPassword);
|
|
36992
37108
|
} catch (e) {
|
|
36993
37109
|
this.emit("error", e);
|
|
@@ -38436,8 +38552,8 @@ var init_alias_resolver = __esm(() => {
|
|
|
38436
38552
|
});
|
|
38437
38553
|
|
|
38438
38554
|
// ../../packages/core/dist/services/search/index-manager.js
|
|
38439
|
-
import
|
|
38440
|
-
import
|
|
38555
|
+
import fs9 from "fs";
|
|
38556
|
+
import path13 from "path";
|
|
38441
38557
|
|
|
38442
38558
|
class IndexManager {
|
|
38443
38559
|
metadataCache = new Map;
|
|
@@ -38530,9 +38646,9 @@ class IndexManager {
|
|
|
38530
38646
|
const fileMetadata = {};
|
|
38531
38647
|
let totalSize = 0;
|
|
38532
38648
|
for (const filePath of indexedFiles) {
|
|
38533
|
-
const fullPath =
|
|
38649
|
+
const fullPath = path13.join(projectPath, filePath);
|
|
38534
38650
|
try {
|
|
38535
|
-
const stat = await
|
|
38651
|
+
const stat = await fs9.promises.stat(fullPath);
|
|
38536
38652
|
fileMetadata[filePath] = {
|
|
38537
38653
|
path: filePath,
|
|
38538
38654
|
mtime: stat.mtimeMs,
|
|
@@ -38583,9 +38699,9 @@ class IndexManager {
|
|
|
38583
38699
|
if (ig.ignores(match2)) {
|
|
38584
38700
|
continue;
|
|
38585
38701
|
}
|
|
38586
|
-
const fullPath =
|
|
38702
|
+
const fullPath = path13.join(projectPath, match2);
|
|
38587
38703
|
try {
|
|
38588
|
-
const stat = await
|
|
38704
|
+
const stat = await fs9.promises.stat(fullPath);
|
|
38589
38705
|
files.set(match2, {
|
|
38590
38706
|
path: match2,
|
|
38591
38707
|
mtime: stat.mtimeMs,
|
|
@@ -41838,23 +41954,23 @@ var require_auth_config = __commonJS((exports, module) => {
|
|
|
41838
41954
|
writeAuthConfig: () => writeAuthConfig
|
|
41839
41955
|
});
|
|
41840
41956
|
module.exports = __toCommonJS2(auth_config_exports);
|
|
41841
|
-
var
|
|
41842
|
-
var
|
|
41957
|
+
var fs10 = __toESM2(__require("fs"));
|
|
41958
|
+
var path14 = __toESM2(__require("path"));
|
|
41843
41959
|
var import_token_util = require_token_util();
|
|
41844
41960
|
function getAuthConfigPath() {
|
|
41845
41961
|
const dataDir = (0, import_token_util.getVercelDataDir)();
|
|
41846
41962
|
if (!dataDir) {
|
|
41847
41963
|
throw new Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`);
|
|
41848
41964
|
}
|
|
41849
|
-
return
|
|
41965
|
+
return path14.join(dataDir, "auth.json");
|
|
41850
41966
|
}
|
|
41851
41967
|
function readAuthConfig() {
|
|
41852
41968
|
try {
|
|
41853
41969
|
const authPath = getAuthConfigPath();
|
|
41854
|
-
if (!
|
|
41970
|
+
if (!fs10.existsSync(authPath)) {
|
|
41855
41971
|
return null;
|
|
41856
41972
|
}
|
|
41857
|
-
const content =
|
|
41973
|
+
const content = fs10.readFileSync(authPath, "utf8");
|
|
41858
41974
|
if (!content) {
|
|
41859
41975
|
return null;
|
|
41860
41976
|
}
|
|
@@ -41865,11 +41981,11 @@ var require_auth_config = __commonJS((exports, module) => {
|
|
|
41865
41981
|
}
|
|
41866
41982
|
function writeAuthConfig(config3) {
|
|
41867
41983
|
const authPath = getAuthConfigPath();
|
|
41868
|
-
const authDir =
|
|
41869
|
-
if (!
|
|
41870
|
-
|
|
41984
|
+
const authDir = path14.dirname(authPath);
|
|
41985
|
+
if (!fs10.existsSync(authDir)) {
|
|
41986
|
+
fs10.mkdirSync(authDir, { mode: 504, recursive: true });
|
|
41871
41987
|
}
|
|
41872
|
-
|
|
41988
|
+
fs10.writeFileSync(authPath, JSON.stringify(config3, null, 2), { mode: 384 });
|
|
41873
41989
|
}
|
|
41874
41990
|
function isValidAccessToken(authConfig, expirationBufferMs = 0) {
|
|
41875
41991
|
if (!authConfig.token)
|
|
@@ -42044,8 +42160,8 @@ var require_token_util = __commonJS((exports, module) => {
|
|
|
42044
42160
|
saveToken: () => saveToken
|
|
42045
42161
|
});
|
|
42046
42162
|
module.exports = __toCommonJS2(token_util_exports);
|
|
42047
|
-
var
|
|
42048
|
-
var
|
|
42163
|
+
var path14 = __toESM2(__require("path"));
|
|
42164
|
+
var fs10 = __toESM2(__require("fs"));
|
|
42049
42165
|
var import_token_error = require_token_error();
|
|
42050
42166
|
var import_token_io = require_token_io();
|
|
42051
42167
|
var import_auth_config = require_auth_config();
|
|
@@ -42057,7 +42173,7 @@ var require_token_util = __commonJS((exports, module) => {
|
|
|
42057
42173
|
if (!dataDir) {
|
|
42058
42174
|
return null;
|
|
42059
42175
|
}
|
|
42060
|
-
return
|
|
42176
|
+
return path14.join(dataDir, vercelFolder);
|
|
42061
42177
|
}
|
|
42062
42178
|
async function getVercelToken2(options) {
|
|
42063
42179
|
const authConfig = (0, import_auth_config.readAuthConfig)();
|
|
@@ -42125,11 +42241,11 @@ var require_token_util = __commonJS((exports, module) => {
|
|
|
42125
42241
|
if (!dir) {
|
|
42126
42242
|
throw new import_token_error.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`");
|
|
42127
42243
|
}
|
|
42128
|
-
const prjPath =
|
|
42129
|
-
if (!
|
|
42244
|
+
const prjPath = path14.join(dir, ".vercel", "project.json");
|
|
42245
|
+
if (!fs10.existsSync(prjPath)) {
|
|
42130
42246
|
throw new import_token_error.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`");
|
|
42131
42247
|
}
|
|
42132
|
-
const prj = JSON.parse(
|
|
42248
|
+
const prj = JSON.parse(fs10.readFileSync(prjPath, "utf8"));
|
|
42133
42249
|
if (typeof prj.projectId !== "string" && typeof prj.orgId !== "string") {
|
|
42134
42250
|
throw new TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project.");
|
|
42135
42251
|
}
|
|
@@ -42140,11 +42256,11 @@ var require_token_util = __commonJS((exports, module) => {
|
|
|
42140
42256
|
if (!dir) {
|
|
42141
42257
|
throw new import_token_error.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");
|
|
42142
42258
|
}
|
|
42143
|
-
const tokenPath =
|
|
42259
|
+
const tokenPath = path14.join(dir, "com.vercel.token", `${projectId}.json`);
|
|
42144
42260
|
const tokenJson = JSON.stringify(token);
|
|
42145
|
-
|
|
42146
|
-
|
|
42147
|
-
|
|
42261
|
+
fs10.mkdirSync(path14.dirname(tokenPath), { mode: 504, recursive: true });
|
|
42262
|
+
fs10.writeFileSync(tokenPath, tokenJson);
|
|
42263
|
+
fs10.chmodSync(tokenPath, 432);
|
|
42148
42264
|
return;
|
|
42149
42265
|
}
|
|
42150
42266
|
function loadToken(projectId) {
|
|
@@ -42152,11 +42268,11 @@ var require_token_util = __commonJS((exports, module) => {
|
|
|
42152
42268
|
if (!dir) {
|
|
42153
42269
|
throw new import_token_error.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");
|
|
42154
42270
|
}
|
|
42155
|
-
const tokenPath =
|
|
42156
|
-
if (!
|
|
42271
|
+
const tokenPath = path14.join(dir, "com.vercel.token", `${projectId}.json`);
|
|
42272
|
+
if (!fs10.existsSync(tokenPath)) {
|
|
42157
42273
|
return null;
|
|
42158
42274
|
}
|
|
42159
|
-
const token = JSON.parse(
|
|
42275
|
+
const token = JSON.parse(fs10.readFileSync(tokenPath, "utf8"));
|
|
42160
42276
|
assertVercelOidcTokenResponse(token);
|
|
42161
42277
|
return token;
|
|
42162
42278
|
}
|
|
@@ -52998,37 +53114,37 @@ function createOpenAI(options = {}) {
|
|
|
52998
53114
|
}, `ai-sdk/openai/${VERSION4}`);
|
|
52999
53115
|
const createChatModel = (modelId) => new OpenAIChatLanguageModel(modelId, {
|
|
53000
53116
|
provider: `${providerName}.chat`,
|
|
53001
|
-
url: ({ path:
|
|
53117
|
+
url: ({ path: path14 }) => `${baseURL}${path14}`,
|
|
53002
53118
|
headers: getHeaders,
|
|
53003
53119
|
fetch: options.fetch
|
|
53004
53120
|
});
|
|
53005
53121
|
const createCompletionModel = (modelId) => new OpenAICompletionLanguageModel(modelId, {
|
|
53006
53122
|
provider: `${providerName}.completion`,
|
|
53007
|
-
url: ({ path:
|
|
53123
|
+
url: ({ path: path14 }) => `${baseURL}${path14}`,
|
|
53008
53124
|
headers: getHeaders,
|
|
53009
53125
|
fetch: options.fetch
|
|
53010
53126
|
});
|
|
53011
53127
|
const createEmbeddingModel = (modelId) => new OpenAIEmbeddingModel(modelId, {
|
|
53012
53128
|
provider: `${providerName}.embedding`,
|
|
53013
|
-
url: ({ path:
|
|
53129
|
+
url: ({ path: path14 }) => `${baseURL}${path14}`,
|
|
53014
53130
|
headers: getHeaders,
|
|
53015
53131
|
fetch: options.fetch
|
|
53016
53132
|
});
|
|
53017
53133
|
const createImageModel = (modelId) => new OpenAIImageModel(modelId, {
|
|
53018
53134
|
provider: `${providerName}.image`,
|
|
53019
|
-
url: ({ path:
|
|
53135
|
+
url: ({ path: path14 }) => `${baseURL}${path14}`,
|
|
53020
53136
|
headers: getHeaders,
|
|
53021
53137
|
fetch: options.fetch
|
|
53022
53138
|
});
|
|
53023
53139
|
const createTranscriptionModel = (modelId) => new OpenAITranscriptionModel(modelId, {
|
|
53024
53140
|
provider: `${providerName}.transcription`,
|
|
53025
|
-
url: ({ path:
|
|
53141
|
+
url: ({ path: path14 }) => `${baseURL}${path14}`,
|
|
53026
53142
|
headers: getHeaders,
|
|
53027
53143
|
fetch: options.fetch
|
|
53028
53144
|
});
|
|
53029
53145
|
const createSpeechModel = (modelId) => new OpenAISpeechModel(modelId, {
|
|
53030
53146
|
provider: `${providerName}.speech`,
|
|
53031
|
-
url: ({ path:
|
|
53147
|
+
url: ({ path: path14 }) => `${baseURL}${path14}`,
|
|
53032
53148
|
headers: getHeaders,
|
|
53033
53149
|
fetch: options.fetch
|
|
53034
53150
|
});
|
|
@@ -53041,7 +53157,7 @@ function createOpenAI(options = {}) {
|
|
|
53041
53157
|
const createResponsesModel = (modelId) => {
|
|
53042
53158
|
return new OpenAIResponsesLanguageModel(modelId, {
|
|
53043
53159
|
provider: `${providerName}.responses`,
|
|
53044
|
-
url: ({ path:
|
|
53160
|
+
url: ({ path: path14 }) => `${baseURL}${path14}`,
|
|
53045
53161
|
headers: getHeaders,
|
|
53046
53162
|
fetch: options.fetch,
|
|
53047
53163
|
fileIdPrefixes: ["file-"]
|
|
@@ -69586,26 +69702,26 @@ var require_process = __commonJS((exports, module) => {
|
|
|
69586
69702
|
|
|
69587
69703
|
// ../../node_modules/detect-libc/lib/filesystem.js
|
|
69588
69704
|
var require_filesystem = __commonJS((exports, module) => {
|
|
69589
|
-
var
|
|
69705
|
+
var fs10 = __require("fs");
|
|
69590
69706
|
var LDD_PATH = "/usr/bin/ldd";
|
|
69591
69707
|
var SELF_PATH = "/proc/self/exe";
|
|
69592
69708
|
var MAX_LENGTH = 2048;
|
|
69593
|
-
var readFileSync2 = (
|
|
69594
|
-
const fd =
|
|
69709
|
+
var readFileSync2 = (path14) => {
|
|
69710
|
+
const fd = fs10.openSync(path14, "r");
|
|
69595
69711
|
const buffer = Buffer.alloc(MAX_LENGTH);
|
|
69596
|
-
const bytesRead =
|
|
69597
|
-
|
|
69712
|
+
const bytesRead = fs10.readSync(fd, buffer, 0, MAX_LENGTH, 0);
|
|
69713
|
+
fs10.close(fd, () => {});
|
|
69598
69714
|
return buffer.subarray(0, bytesRead);
|
|
69599
69715
|
};
|
|
69600
|
-
var readFile = (
|
|
69601
|
-
|
|
69716
|
+
var readFile = (path14) => new Promise((resolve4, reject) => {
|
|
69717
|
+
fs10.open(path14, "r", (err, fd) => {
|
|
69602
69718
|
if (err) {
|
|
69603
69719
|
reject(err);
|
|
69604
69720
|
} else {
|
|
69605
69721
|
const buffer = Buffer.alloc(MAX_LENGTH);
|
|
69606
|
-
|
|
69722
|
+
fs10.read(fd, buffer, 0, MAX_LENGTH, 0, (_, bytesRead) => {
|
|
69607
69723
|
resolve4(buffer.subarray(0, bytesRead));
|
|
69608
|
-
|
|
69724
|
+
fs10.close(fd, () => {});
|
|
69609
69725
|
});
|
|
69610
69726
|
}
|
|
69611
69727
|
});
|
|
@@ -69710,11 +69826,11 @@ var require_detect_libc = __commonJS((exports, module) => {
|
|
|
69710
69826
|
}
|
|
69711
69827
|
return null;
|
|
69712
69828
|
};
|
|
69713
|
-
var familyFromInterpreterPath = (
|
|
69714
|
-
if (
|
|
69715
|
-
if (
|
|
69829
|
+
var familyFromInterpreterPath = (path14) => {
|
|
69830
|
+
if (path14) {
|
|
69831
|
+
if (path14.includes("/ld-musl-")) {
|
|
69716
69832
|
return MUSL;
|
|
69717
|
-
} else if (
|
|
69833
|
+
} else if (path14.includes("/ld-linux-")) {
|
|
69718
69834
|
return GLIBC;
|
|
69719
69835
|
}
|
|
69720
69836
|
}
|
|
@@ -69759,8 +69875,8 @@ var require_detect_libc = __commonJS((exports, module) => {
|
|
|
69759
69875
|
cachedFamilyInterpreter = null;
|
|
69760
69876
|
try {
|
|
69761
69877
|
const selfContent = await readFile(SELF_PATH);
|
|
69762
|
-
const
|
|
69763
|
-
cachedFamilyInterpreter = familyFromInterpreterPath(
|
|
69878
|
+
const path14 = interpreterPath(selfContent);
|
|
69879
|
+
cachedFamilyInterpreter = familyFromInterpreterPath(path14);
|
|
69764
69880
|
} catch (e) {}
|
|
69765
69881
|
return cachedFamilyInterpreter;
|
|
69766
69882
|
};
|
|
@@ -69771,8 +69887,8 @@ var require_detect_libc = __commonJS((exports, module) => {
|
|
|
69771
69887
|
cachedFamilyInterpreter = null;
|
|
69772
69888
|
try {
|
|
69773
69889
|
const selfContent = readFileSync2(SELF_PATH);
|
|
69774
|
-
const
|
|
69775
|
-
cachedFamilyInterpreter = familyFromInterpreterPath(
|
|
69890
|
+
const path14 = interpreterPath(selfContent);
|
|
69891
|
+
cachedFamilyInterpreter = familyFromInterpreterPath(path14);
|
|
69776
69892
|
} catch (e) {}
|
|
69777
69893
|
return cachedFamilyInterpreter;
|
|
69778
69894
|
};
|
|
@@ -71434,18 +71550,18 @@ var require_sharp = __commonJS((exports, module) => {
|
|
|
71434
71550
|
`@img/sharp-${runtimePlatform}/sharp.node`,
|
|
71435
71551
|
"@img/sharp-wasm32/sharp.node"
|
|
71436
71552
|
];
|
|
71437
|
-
var
|
|
71553
|
+
var path14;
|
|
71438
71554
|
var sharp;
|
|
71439
71555
|
var errors4 = [];
|
|
71440
|
-
for (
|
|
71556
|
+
for (path14 of paths) {
|
|
71441
71557
|
try {
|
|
71442
|
-
sharp = __require(
|
|
71558
|
+
sharp = __require(path14);
|
|
71443
71559
|
break;
|
|
71444
71560
|
} catch (err) {
|
|
71445
71561
|
errors4.push(err);
|
|
71446
71562
|
}
|
|
71447
71563
|
}
|
|
71448
|
-
if (sharp &&
|
|
71564
|
+
if (sharp && path14.startsWith("@img/sharp-linux-x64") && !sharp._isUsingX64V2()) {
|
|
71449
71565
|
const err = new Error("Prebuilt binaries for linux-x64 require v2 microarchitecture");
|
|
71450
71566
|
err.code = "Unsupported CPU";
|
|
71451
71567
|
errors4.push(err);
|
|
@@ -74307,15 +74423,15 @@ var require_color = __commonJS((exports, module) => {
|
|
|
74307
74423
|
};
|
|
74308
74424
|
}
|
|
74309
74425
|
function wrapConversion(toModel, graph) {
|
|
74310
|
-
const
|
|
74426
|
+
const path14 = [graph[toModel].parent, toModel];
|
|
74311
74427
|
let fn = conversions_default[graph[toModel].parent][toModel];
|
|
74312
74428
|
let cur = graph[toModel].parent;
|
|
74313
74429
|
while (graph[cur].parent) {
|
|
74314
|
-
|
|
74430
|
+
path14.unshift(graph[cur].parent);
|
|
74315
74431
|
fn = link(conversions_default[graph[cur].parent][cur], fn);
|
|
74316
74432
|
cur = graph[cur].parent;
|
|
74317
74433
|
}
|
|
74318
|
-
fn.conversion =
|
|
74434
|
+
fn.conversion = path14;
|
|
74319
74435
|
return fn;
|
|
74320
74436
|
}
|
|
74321
74437
|
function route(fromModel) {
|
|
@@ -74920,7 +75036,7 @@ var require_output = __commonJS((exports, module) => {
|
|
|
74920
75036
|
Copyright 2013 Lovell Fuller and others.
|
|
74921
75037
|
SPDX-License-Identifier: Apache-2.0
|
|
74922
75038
|
*/
|
|
74923
|
-
var
|
|
75039
|
+
var path14 = __require("path");
|
|
74924
75040
|
var is = require_is();
|
|
74925
75041
|
var sharp = require_sharp();
|
|
74926
75042
|
var formats = new Map([
|
|
@@ -74951,9 +75067,9 @@ var require_output = __commonJS((exports, module) => {
|
|
|
74951
75067
|
let err;
|
|
74952
75068
|
if (!is.string(fileOut)) {
|
|
74953
75069
|
err = new Error("Missing output file path");
|
|
74954
|
-
} else if (is.string(this.options.input.file) &&
|
|
75070
|
+
} else if (is.string(this.options.input.file) && path14.resolve(this.options.input.file) === path14.resolve(fileOut)) {
|
|
74955
75071
|
err = new Error("Cannot use same file for input and output");
|
|
74956
|
-
} else if (jp2Regex.test(
|
|
75072
|
+
} else if (jp2Regex.test(path14.extname(fileOut)) && !this.constructor.format.jp2k.output.file) {
|
|
74957
75073
|
err = errJp2Save();
|
|
74958
75074
|
}
|
|
74959
75075
|
if (err) {
|
|
@@ -82200,11 +82316,11 @@ var init_transformers_node = __esm(() => {
|
|
|
82200
82316
|
throw new Error(`The number of external data chunks (${num_chunks}) exceeds the maximum allowed value (${_utils_hub_js__WEBPACK_IMPORTED_MODULE_5__.MAX_EXTERNAL_DATA_CHUNKS}).`);
|
|
82201
82317
|
}
|
|
82202
82318
|
for (let i = 0;i < num_chunks; ++i) {
|
|
82203
|
-
const
|
|
82204
|
-
const fullPath = `${options.subfolder ?? ""}/${
|
|
82319
|
+
const path14 = `${baseName}_data${i === 0 ? "" : "_" + i}`;
|
|
82320
|
+
const fullPath = `${options.subfolder ?? ""}/${path14}`;
|
|
82205
82321
|
externalDataPromises.push(new Promise(async (resolve4, reject) => {
|
|
82206
82322
|
const data = await (0, _utils_hub_js__WEBPACK_IMPORTED_MODULE_5__.getModelFile)(pretrained_model_name_or_path, fullPath, true, options, return_path);
|
|
82207
|
-
resolve4(data instanceof Uint8Array ? { path:
|
|
82323
|
+
resolve4(data instanceof Uint8Array ? { path: path14, data } : path14);
|
|
82208
82324
|
}));
|
|
82209
82325
|
}
|
|
82210
82326
|
} else if (session_options.externalData !== undefined) {
|
|
@@ -95268,7 +95384,7 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
|
|
|
95268
95384
|
const blob = new Blob([wav], { type: "audio/wav" });
|
|
95269
95385
|
return blob;
|
|
95270
95386
|
}
|
|
95271
|
-
async save(
|
|
95387
|
+
async save(path14) {
|
|
95272
95388
|
let fn;
|
|
95273
95389
|
if (_env_js__WEBPACK_IMPORTED_MODULE_3__.apis.IS_BROWSER_ENV) {
|
|
95274
95390
|
if (_env_js__WEBPACK_IMPORTED_MODULE_3__.apis.IS_WEBWORKER_ENV) {
|
|
@@ -95276,14 +95392,14 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
|
|
|
95276
95392
|
}
|
|
95277
95393
|
fn = _core_js__WEBPACK_IMPORTED_MODULE_2__.saveBlob;
|
|
95278
95394
|
} else if (_env_js__WEBPACK_IMPORTED_MODULE_3__.apis.IS_FS_AVAILABLE) {
|
|
95279
|
-
fn = async (
|
|
95395
|
+
fn = async (path15, blob) => {
|
|
95280
95396
|
let buffer = await blob.arrayBuffer();
|
|
95281
|
-
node_fs__WEBPACK_IMPORTED_MODULE_5__["default"].writeFileSync(
|
|
95397
|
+
node_fs__WEBPACK_IMPORTED_MODULE_5__["default"].writeFileSync(path15, Buffer.from(buffer));
|
|
95282
95398
|
};
|
|
95283
95399
|
} else {
|
|
95284
95400
|
throw new Error("Unable to save because filesystem is disabled in this environment.");
|
|
95285
95401
|
}
|
|
95286
|
-
await fn(
|
|
95402
|
+
await fn(path14, this.toBlob());
|
|
95287
95403
|
}
|
|
95288
95404
|
}
|
|
95289
95405
|
},
|
|
@@ -95379,11 +95495,11 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
|
|
|
95379
95495
|
function calculateReflectOffset(i, w) {
|
|
95380
95496
|
return Math.abs((i + w) % (2 * w) - w);
|
|
95381
95497
|
}
|
|
95382
|
-
function saveBlob(
|
|
95498
|
+
function saveBlob(path14, blob) {
|
|
95383
95499
|
const dataURL = URL.createObjectURL(blob);
|
|
95384
95500
|
const downloadLink = document.createElement("a");
|
|
95385
95501
|
downloadLink.href = dataURL;
|
|
95386
|
-
downloadLink.download =
|
|
95502
|
+
downloadLink.download = path14;
|
|
95387
95503
|
downloadLink.click();
|
|
95388
95504
|
downloadLink.remove();
|
|
95389
95505
|
URL.revokeObjectURL(dataURL);
|
|
@@ -95984,8 +96100,8 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
|
|
|
95984
96100
|
}
|
|
95985
96101
|
|
|
95986
96102
|
class FileCache {
|
|
95987
|
-
constructor(
|
|
95988
|
-
this.path =
|
|
96103
|
+
constructor(path14) {
|
|
96104
|
+
this.path = path14;
|
|
95989
96105
|
}
|
|
95990
96106
|
async match(request) {
|
|
95991
96107
|
let filePath = node_path__WEBPACK_IMPORTED_MODULE_1__["default"].join(this.path, request);
|
|
@@ -96741,20 +96857,20 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
|
|
|
96741
96857
|
}
|
|
96742
96858
|
return this;
|
|
96743
96859
|
}
|
|
96744
|
-
async save(
|
|
96860
|
+
async save(path14) {
|
|
96745
96861
|
if (IS_BROWSER_OR_WEBWORKER) {
|
|
96746
96862
|
if (_env_js__WEBPACK_IMPORTED_MODULE_2__.apis.IS_WEBWORKER_ENV) {
|
|
96747
96863
|
throw new Error("Unable to save an image from a Web Worker.");
|
|
96748
96864
|
}
|
|
96749
|
-
const extension =
|
|
96865
|
+
const extension = path14.split(".").pop().toLowerCase();
|
|
96750
96866
|
const mime = CONTENT_TYPE_MAP.get(extension) ?? "image/png";
|
|
96751
96867
|
const blob = await this.toBlob(mime);
|
|
96752
|
-
(0, _core_js__WEBPACK_IMPORTED_MODULE_0__.saveBlob)(
|
|
96868
|
+
(0, _core_js__WEBPACK_IMPORTED_MODULE_0__.saveBlob)(path14, blob);
|
|
96753
96869
|
} else if (!_env_js__WEBPACK_IMPORTED_MODULE_2__.apis.IS_FS_AVAILABLE) {
|
|
96754
96870
|
throw new Error("Unable to save the image because filesystem is disabled in this environment.");
|
|
96755
96871
|
} else {
|
|
96756
96872
|
const img = this.toSharp();
|
|
96757
|
-
return await img.toFile(
|
|
96873
|
+
return await img.toFile(path14);
|
|
96758
96874
|
}
|
|
96759
96875
|
}
|
|
96760
96876
|
toSharp() {
|
|
@@ -106285,10 +106401,10 @@ Note that ${s.bold("include")} statements only accept relation fields.`, a;
|
|
|
106285
106401
|
super(t, "P2023", r);
|
|
106286
106402
|
}
|
|
106287
106403
|
};
|
|
106288
|
-
var
|
|
106404
|
+
var fs10 = new WeakMap;
|
|
106289
106405
|
function Ep(e) {
|
|
106290
|
-
let t =
|
|
106291
|
-
return t || (t = Object.entries(e),
|
|
106406
|
+
let t = fs10.get(e);
|
|
106407
|
+
return t || (t = Object.entries(e), fs10.set(e, t)), t;
|
|
106292
106408
|
}
|
|
106293
106409
|
function hs(e, t, r) {
|
|
106294
106410
|
switch (t.type) {
|
|
@@ -110256,7 +110372,7 @@ var require_prisma = __commonJS((exports) => {
|
|
|
110256
110372
|
Prisma.JsonNull = JsonNull2;
|
|
110257
110373
|
Prisma.AnyNull = AnyNull2;
|
|
110258
110374
|
Prisma.NullTypes = NullTypes2;
|
|
110259
|
-
var
|
|
110375
|
+
var path14 = __require("path");
|
|
110260
110376
|
exports.Prisma.TransactionIsolationLevel = makeStrictEnum2({
|
|
110261
110377
|
ReadUncommitted: "ReadUncommitted",
|
|
110262
110378
|
ReadCommitted: "ReadCommitted",
|
|
@@ -115800,9 +115916,7 @@ var init_postgres_vector_store = __esm(() => {
|
|
|
115800
115916
|
floatsToBit(v) {
|
|
115801
115917
|
return v.map((x) => x >= 0 ? "1" : "0").join("");
|
|
115802
115918
|
}
|
|
115803
|
-
async
|
|
115804
|
-
if (this.pool && this.initialized)
|
|
115805
|
-
return this.pool;
|
|
115919
|
+
async createPool() {
|
|
115806
115920
|
const pg2 = await Promise.resolve().then(() => (init_esm6(), exports_esm));
|
|
115807
115921
|
const PgPool = pg2.default?.Pool ?? pg2.Pool;
|
|
115808
115922
|
const poolConfig = {
|
|
@@ -115811,7 +115925,12 @@ var init_postgres_vector_store = __esm(() => {
|
|
|
115811
115925
|
idleTimeoutMillis: 30000,
|
|
115812
115926
|
connectionTimeoutMillis: 5000
|
|
115813
115927
|
};
|
|
115814
|
-
|
|
115928
|
+
return new PgPool(poolConfig);
|
|
115929
|
+
}
|
|
115930
|
+
async ensureInitialized() {
|
|
115931
|
+
if (this.pool && this.initialized)
|
|
115932
|
+
return this.pool;
|
|
115933
|
+
const pool = this.pool ?? await this.createPool();
|
|
115815
115934
|
this.pool = pool;
|
|
115816
115935
|
const client = await pool.connect();
|
|
115817
115936
|
try {
|
|
@@ -116199,6 +116318,43 @@ var init_postgres_vector_store = __esm(() => {
|
|
|
116199
116318
|
lastIndexed: row.last_updated?.toISOString() ?? null
|
|
116200
116319
|
}));
|
|
116201
116320
|
}
|
|
116321
|
+
async getPool() {
|
|
116322
|
+
if (this.pool)
|
|
116323
|
+
return this.pool;
|
|
116324
|
+
this.pool = await this.createPool();
|
|
116325
|
+
return this.pool;
|
|
116326
|
+
}
|
|
116327
|
+
async listAllProjectsAcrossDimensions() {
|
|
116328
|
+
const pool = await this.getPool();
|
|
116329
|
+
const { rows: tables } = await pool.query(`
|
|
116330
|
+
SELECT schemaname, tablename FROM pg_tables
|
|
116331
|
+
WHERE schemaname = current_schema()
|
|
116332
|
+
AND (tablename = 'vector_documents' OR tablename ~ '^vector_documents_[0-9]+d$')
|
|
116333
|
+
ORDER BY tablename
|
|
116334
|
+
`);
|
|
116335
|
+
if (tables.length === 0)
|
|
116336
|
+
return [];
|
|
116337
|
+
const unionParts = tables.map((t) => {
|
|
116338
|
+
const qualified = `"${t.schemaname}"."${t.tablename}"`;
|
|
116339
|
+
return `SELECT project_id, COUNT(*)::int AS doc_count, MAX(updated_at) AS last_updated, SUM(LENGTH(content))::bigint AS total_size FROM ${qualified} WHERE id NOT LIKE '_metadata:%' GROUP BY project_id`;
|
|
116340
|
+
}).join(" UNION ALL ");
|
|
116341
|
+
const { rows } = await pool.query(`
|
|
116342
|
+
SELECT project_id,
|
|
116343
|
+
SUM(doc_count)::int AS doc_count,
|
|
116344
|
+
MAX(last_updated) AS last_updated,
|
|
116345
|
+
SUM(total_size)::bigint AS total_size
|
|
116346
|
+
FROM (${unionParts}) AS merged
|
|
116347
|
+
GROUP BY project_id
|
|
116348
|
+
ORDER BY last_updated DESC
|
|
116349
|
+
`);
|
|
116350
|
+
return rows.map((row) => ({
|
|
116351
|
+
projectId: row.project_id,
|
|
116352
|
+
projectPath: null,
|
|
116353
|
+
documentCount: parseInt(row.doc_count),
|
|
116354
|
+
totalSize: parseInt(row.total_size ?? "0"),
|
|
116355
|
+
lastIndexed: row.last_updated?.toISOString() ?? null
|
|
116356
|
+
}));
|
|
116357
|
+
}
|
|
116202
116358
|
async getCollection(name26) {
|
|
116203
116359
|
const pool = await this.ensureInitialized();
|
|
116204
116360
|
return new PostgresVectorCollection(pool, name26, this.tableName, this);
|
|
@@ -116290,7 +116446,7 @@ var init_vector_store_factory = __esm(() => {
|
|
|
116290
116446
|
});
|
|
116291
116447
|
|
|
116292
116448
|
// ../../packages/core/dist/services/search/search-cache-pg.js
|
|
116293
|
-
import
|
|
116449
|
+
import crypto6 from "crypto";
|
|
116294
116450
|
|
|
116295
116451
|
class SearchCachePg {
|
|
116296
116452
|
pool = null;
|
|
@@ -116347,7 +116503,7 @@ class SearchCachePg {
|
|
|
116347
116503
|
projectId,
|
|
116348
116504
|
options: this.normalizeOptions(options)
|
|
116349
116505
|
});
|
|
116350
|
-
return
|
|
116506
|
+
return crypto6.createHash("sha256").update(payload).digest("hex");
|
|
116351
116507
|
}
|
|
116352
116508
|
normalizeOptions(options) {
|
|
116353
116509
|
const searchAffectingParams = [
|
|
@@ -123083,10 +123239,10 @@ var init_chunker_code = __esm(() => {
|
|
|
123083
123239
|
});
|
|
123084
123240
|
|
|
123085
123241
|
// ../../packages/core/dist/services/search/smart-chunker.js
|
|
123086
|
-
import
|
|
123242
|
+
import path14 from "path";
|
|
123087
123243
|
function smartChunk(content, filePath, config3 = {}) {
|
|
123088
123244
|
const cfg = { ...DEFAULT_CONFIG, ...config3 };
|
|
123089
|
-
const ext2 =
|
|
123245
|
+
const ext2 = path14.extname(filePath).toLowerCase();
|
|
123090
123246
|
const relativePath = filePath;
|
|
123091
123247
|
const fileImports = isCodeFile(ext2) ? extractFileImports(content, ext2) : undefined;
|
|
123092
123248
|
let chunks;
|
|
@@ -123393,8 +123549,8 @@ var init_managed_run_repository_pg = __esm(() => {
|
|
|
123393
123549
|
});
|
|
123394
123550
|
|
|
123395
123551
|
// ../../packages/core/dist/services/search/project-indexer.js
|
|
123396
|
-
import
|
|
123397
|
-
import
|
|
123552
|
+
import fs10 from "fs/promises";
|
|
123553
|
+
import path15 from "path";
|
|
123398
123554
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
123399
123555
|
async function runWithIndexLock(lockMap, projectId, work) {
|
|
123400
123556
|
const prevLock = lockMap.get(projectId);
|
|
@@ -123437,7 +123593,7 @@ async function indexProjectInternal(deps, projectPath, projectId, options = {})
|
|
|
123437
123593
|
dot: false
|
|
123438
123594
|
});
|
|
123439
123595
|
const filteredFiles = files.filter((file2) => {
|
|
123440
|
-
const relativePath =
|
|
123596
|
+
const relativePath = path15.relative(projectPath, file2);
|
|
123441
123597
|
const shouldIgnore = ig.ignores(relativePath);
|
|
123442
123598
|
if (shouldIgnore) {
|
|
123443
123599
|
logger.debug("Ignoring file per .gitignore during indexing", {
|
|
@@ -123477,7 +123633,7 @@ async function indexProjectInternal(deps, projectPath, projectId, options = {})
|
|
|
123477
123633
|
});
|
|
123478
123634
|
}
|
|
123479
123635
|
}
|
|
123480
|
-
const indexedFilesList = filteredFiles.map((f) =>
|
|
123636
|
+
const indexedFilesList = filteredFiles.map((f) => path15.relative(projectPath, f));
|
|
123481
123637
|
await deps.indexManager.updateIndexMetadata(projectId, projectPath, indexedFilesList);
|
|
123482
123638
|
logger.info("Project indexing completed", {
|
|
123483
123639
|
projectId,
|
|
@@ -123602,7 +123758,7 @@ async function ensureFreshIndex(deps, projectId, projectPath, options = {}) {
|
|
|
123602
123758
|
let errors4 = 0;
|
|
123603
123759
|
for (const relativeFilePath of filesToReindex) {
|
|
123604
123760
|
try {
|
|
123605
|
-
const fullPath =
|
|
123761
|
+
const fullPath = path15.join(projectPath, relativeFilePath);
|
|
123606
123762
|
const result = await deps.indexFile(fullPath, projectId, projectPath, centralityMap);
|
|
123607
123763
|
filesIndexed++;
|
|
123608
123764
|
chunksIndexed += result.chunks;
|
|
@@ -123653,8 +123809,8 @@ async function checkSearchAdmission(deps, projectId, projectPath) {
|
|
|
123653
123809
|
}
|
|
123654
123810
|
async function indexFile(deps, filePath, projectId, projectRoot, centralityMap) {
|
|
123655
123811
|
projectId = await getProjectIdentityAliasResolver().resolve(projectId);
|
|
123656
|
-
const content = await
|
|
123657
|
-
const relativePath =
|
|
123812
|
+
const content = await fs10.readFile(filePath, "utf-8");
|
|
123813
|
+
const relativePath = path15.relative(projectRoot, filePath);
|
|
123658
123814
|
const maxFileSize = config2.get("security").maxFileSize || 1024 * 1024;
|
|
123659
123815
|
if (content.length > maxFileSize) {
|
|
123660
123816
|
logger.warn("File too large, skipping", {
|
|
@@ -123674,7 +123830,7 @@ async function indexFile(deps, filePath, projectId, projectRoot, centralityMap)
|
|
|
123674
123830
|
chunkIndex: i,
|
|
123675
123831
|
totalChunks: chunks.length,
|
|
123676
123832
|
type: chunk.type,
|
|
123677
|
-
language:
|
|
123833
|
+
language: path15.extname(filePath).slice(1),
|
|
123678
123834
|
lineStart: chunk.lineStart,
|
|
123679
123835
|
lineEnd: chunk.lineEnd,
|
|
123680
123836
|
label: chunk.label,
|
|
@@ -124519,8 +124675,8 @@ function stripNul(content) {
|
|
|
124519
124675
|
}
|
|
124520
124676
|
|
|
124521
124677
|
// ../../packages/core/dist/services/etl/stages/discover.js
|
|
124522
|
-
import
|
|
124523
|
-
import
|
|
124678
|
+
import fs11 from "fs/promises";
|
|
124679
|
+
import path16 from "path";
|
|
124524
124680
|
import { createHash as createHash5 } from "crypto";
|
|
124525
124681
|
|
|
124526
124682
|
class DiscoverStage {
|
|
@@ -124546,7 +124702,7 @@ class DiscoverStage {
|
|
|
124546
124702
|
dot: false,
|
|
124547
124703
|
absolute: false
|
|
124548
124704
|
});
|
|
124549
|
-
relPaths = found.map((p) =>
|
|
124705
|
+
relPaths = found.map((p) => path16.isAbsolute(p) ? path16.relative(ctx.projectPath, p) : p).filter((p) => !ig.ignores(p) && applyPolicy(p, policy) !== "Drop");
|
|
124550
124706
|
}
|
|
124551
124707
|
if (ctx.resumeCursor?.path) {
|
|
124552
124708
|
const cursorPath = ctx.resumeCursor.path;
|
|
@@ -124605,10 +124761,10 @@ class DiscoverStage {
|
|
|
124605
124761
|
return discovered;
|
|
124606
124762
|
}
|
|
124607
124763
|
async processFile(ctx, relativePath, forceReindex) {
|
|
124608
|
-
const absolutePath =
|
|
124764
|
+
const absolutePath = path16.join(ctx.projectPath, relativePath);
|
|
124609
124765
|
try {
|
|
124610
|
-
const stat = await
|
|
124611
|
-
const content = stripNul(await
|
|
124766
|
+
const stat = await fs11.stat(absolutePath);
|
|
124767
|
+
const content = stripNul(await fs11.readFile(absolutePath, "utf-8"));
|
|
124612
124768
|
const contentHash = createHash5("sha256").update(content).digest("hex");
|
|
124613
124769
|
let needsReparse = forceReindex;
|
|
124614
124770
|
if (!forceReindex) {
|
|
@@ -124651,8 +124807,8 @@ class DiscoverStage {
|
|
|
124651
124807
|
ig.add(pattern);
|
|
124652
124808
|
}
|
|
124653
124809
|
try {
|
|
124654
|
-
const gitignorePath =
|
|
124655
|
-
const gitignoreContent = await
|
|
124810
|
+
const gitignorePath = path16.join(projectPath, ".gitignore");
|
|
124811
|
+
const gitignoreContent = await fs11.readFile(gitignorePath, "utf8");
|
|
124656
124812
|
const rules = gitignoreContent.split(`
|
|
124657
124813
|
`).map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
|
|
124658
124814
|
ig.add(rules);
|
|
@@ -126007,8 +126163,8 @@ function rustUseLeaves(node, source, prefix = []) {
|
|
|
126007
126163
|
}
|
|
126008
126164
|
if (node.type === "use_wildcard")
|
|
126009
126165
|
return [{ path: [...prefix, "*"], glob: true }];
|
|
126010
|
-
const
|
|
126011
|
-
return
|
|
126166
|
+
const path17 = rustPathSegments(node, source);
|
|
126167
|
+
return path17.length ? [{ path: [...prefix, ...path17] }] : [];
|
|
126012
126168
|
}
|
|
126013
126169
|
function functionalCaptures(captures, source, family) {
|
|
126014
126170
|
if (family !== "clojure")
|
|
@@ -126980,8 +127136,8 @@ var init_structural_runtime = __esm(() => {
|
|
|
126980
127136
|
});
|
|
126981
127137
|
|
|
126982
127138
|
// ../../packages/core/dist/services/etl/stages/parse.js
|
|
126983
|
-
import
|
|
126984
|
-
import
|
|
127139
|
+
import path17 from "path";
|
|
127140
|
+
import fs12 from "fs/promises";
|
|
126985
127141
|
function resolveChunkerMaxChars() {
|
|
126986
127142
|
const global2 = Number(process.env.EMBEDDING_MAX_CHARS);
|
|
126987
127143
|
if (Number.isFinite(global2) && global2 > 0)
|
|
@@ -127009,8 +127165,8 @@ class ParseStage {
|
|
|
127009
127165
|
const results = new Map;
|
|
127010
127166
|
let processed = 0;
|
|
127011
127167
|
const phases = [
|
|
127012
|
-
files.filter((file2) =>
|
|
127013
|
-
files.filter((file2) =>
|
|
127168
|
+
files.filter((file2) => path17.extname(file2.relativePath).toLowerCase() !== ".h"),
|
|
127169
|
+
files.filter((file2) => path17.extname(file2.relativePath).toLowerCase() === ".h")
|
|
127014
127170
|
];
|
|
127015
127171
|
const batches = phases.flatMap((phase) => Array.from({ length: Math.ceil(phase.length / BATCH_SIZE) }, (_, index) => phase.slice(index * BATCH_SIZE, (index + 1) * BATCH_SIZE)));
|
|
127016
127172
|
for (const batch of batches) {
|
|
@@ -127048,19 +127204,19 @@ class ParseStage {
|
|
|
127048
127204
|
return files.map((file2) => results.get(file2.relativePath));
|
|
127049
127205
|
}
|
|
127050
127206
|
recordHeaderImporterEvidence(ctx, files, parsedFiles) {
|
|
127051
|
-
const knownHeaders = new Set(files.filter((file2) =>
|
|
127207
|
+
const knownHeaders = new Set(files.filter((file2) => path17.extname(file2.relativePath).toLowerCase() === ".h").map((file2) => path17.posix.normalize(file2.relativePath)));
|
|
127052
127208
|
const mutable = {
|
|
127053
127209
|
...ctx.structuralHeaderEvidenceByFile
|
|
127054
127210
|
};
|
|
127055
127211
|
for (const parsed of parsedFiles) {
|
|
127056
|
-
const extension =
|
|
127212
|
+
const extension = path17.extname(parsed.file.relativePath).toLowerCase();
|
|
127057
127213
|
const key = extension === ".c" ? "cImporters" : [".cpp", ".hpp"].includes(extension) ? "cppImporters" : undefined;
|
|
127058
127214
|
if (!key)
|
|
127059
127215
|
continue;
|
|
127060
127216
|
for (const imported of parsed.rawImports) {
|
|
127061
127217
|
if (!["c_include", "cpp_include"].includes(imported.form) || imported.specifier.startsWith("<"))
|
|
127062
127218
|
continue;
|
|
127063
|
-
const header =
|
|
127219
|
+
const header = path17.posix.normalize(path17.posix.join(path17.posix.dirname(parsed.file.relativePath), imported.specifier));
|
|
127064
127220
|
if (!knownHeaders.has(header))
|
|
127065
127221
|
continue;
|
|
127066
127222
|
const existing = mutable[header] ?? {};
|
|
@@ -127071,9 +127227,9 @@ class ParseStage {
|
|
|
127071
127227
|
}
|
|
127072
127228
|
async parseFile(ctx, file2) {
|
|
127073
127229
|
if (!file2.needsReparse) {
|
|
127074
|
-
const extension =
|
|
127230
|
+
const extension = path17.extname(file2.relativePath).toLowerCase();
|
|
127075
127231
|
if ([".c", ".cpp", ".hpp"].includes(extension)) {
|
|
127076
|
-
const content = file2.snapshotContent ?? await
|
|
127232
|
+
const content = file2.snapshotContent ?? await fs12.readFile(file2.absolutePath, "utf8");
|
|
127077
127233
|
const outcome = await this.runtime.parse({ extension, source: Buffer.from(content) });
|
|
127078
127234
|
if (outcome.status === "failed")
|
|
127079
127235
|
throw new StructuralEtlParseError(file2.relativePath, outcome.failureKind, `Structural evidence parse failed (${outcome.failureKind})`, outcome.diagnosticCount, outcome.diagnostics.slice(0, 10));
|
|
@@ -127085,8 +127241,8 @@ class ParseStage {
|
|
|
127085
127241
|
return { file: file2, chunks: [], symbols: [], rawImports: [], rawEdges: [] };
|
|
127086
127242
|
}
|
|
127087
127243
|
try {
|
|
127088
|
-
const content = file2.snapshotContent ?? await
|
|
127089
|
-
const ext2 =
|
|
127244
|
+
const content = file2.snapshotContent ?? await fs12.readFile(file2.absolutePath, "utf-8");
|
|
127245
|
+
const ext2 = path17.extname(file2.relativePath).toLowerCase();
|
|
127090
127246
|
const chunkerMaxChars = resolveChunkerMaxChars();
|
|
127091
127247
|
const chunks = smartChunk(content, file2.relativePath, chunkerMaxChars ? { maxChunkChars: chunkerMaxChars } : {});
|
|
127092
127248
|
let symbols;
|
|
@@ -127640,7 +127796,7 @@ var init_resolver = __esm(() => {
|
|
|
127640
127796
|
});
|
|
127641
127797
|
|
|
127642
127798
|
// ../../packages/core/dist/services/structural/resolvers/typescript.js
|
|
127643
|
-
import
|
|
127799
|
+
import path18 from "path";
|
|
127644
127800
|
function candidates(identities) {
|
|
127645
127801
|
return Object.freeze(identities.map((identity) => Object.freeze({
|
|
127646
127802
|
fqn: identity.fqn,
|
|
@@ -127735,7 +127891,7 @@ function probe(base, known, dialect = "typescript") {
|
|
|
127735
127891
|
const bases = /\.[cm]?jsx?$/u.test(base) ? [base.replace(/\.[cm]?jsx?$/u, ".ts"), base.replace(/\.[cm]?jsx?$/u, ".tsx"), base] : [base];
|
|
127736
127892
|
for (const candidateBase of bases)
|
|
127737
127893
|
for (const suffix of DIALECT_PROBES[dialect] ?? [""]) {
|
|
127738
|
-
const value =
|
|
127894
|
+
const value = path18.posix.normalize(`${candidateBase}${suffix}`);
|
|
127739
127895
|
if (!value.startsWith("../") && value !== ".." && known.has(value))
|
|
127740
127896
|
return value;
|
|
127741
127897
|
}
|
|
@@ -127744,7 +127900,7 @@ function probe(base, known, dialect = "typescript") {
|
|
|
127744
127900
|
function resolveStructuralSpecifier(specifier, fromFile, build, dialect = "typescript") {
|
|
127745
127901
|
const known = new Set(build.knownFiles.map(normalizeStructuralFile));
|
|
127746
127902
|
if (specifier.startsWith("./") || specifier.startsWith("../")) {
|
|
127747
|
-
return probe(
|
|
127903
|
+
return probe(path18.posix.join(path18.posix.dirname(fromFile), specifier), known, dialect);
|
|
127748
127904
|
}
|
|
127749
127905
|
const aliases = build.pathAliasesByFile?.[normalizeStructuralFile(fromFile)] ?? build.pathAliases ?? [];
|
|
127750
127906
|
for (const alias of aliases) {
|
|
@@ -128008,7 +128164,7 @@ var init_scripting2 = __esm(() => {
|
|
|
128008
128164
|
});
|
|
128009
128165
|
|
|
128010
128166
|
// ../../packages/core/dist/services/structural/resolvers/systems.js
|
|
128011
|
-
import
|
|
128167
|
+
import path19 from "path";
|
|
128012
128168
|
var DIALECTS, SYSTEMS_LANGUAGE_RESOLVER;
|
|
128013
128169
|
var init_systems2 = __esm(() => {
|
|
128014
128170
|
init_typescript2();
|
|
@@ -128027,7 +128183,7 @@ var init_systems2 = __esm(() => {
|
|
|
128027
128183
|
const bindings = item.bindings.map((binding) => binding.imported === "*" && binding.local === "*" && unresolvedTarget && !unresolvedTarget.qualifier ? { ...binding, imported: unresolvedTarget.name, local: unresolvedTarget.name } : binding);
|
|
128028
128184
|
if (item.specifier === "crate" || item.specifier.startsWith("crate/")) {
|
|
128029
128185
|
const crateRoot = file2.file.startsWith("src/") ? "src" : "";
|
|
128030
|
-
return { ...item, bindings, specifier: `./${
|
|
128186
|
+
return { ...item, bindings, specifier: `./${path19.posix.relative(path19.posix.dirname(file2.file), path19.posix.join(crateRoot, item.specifier.replace(/^crate\/?/u, "")))}` };
|
|
128031
128187
|
}
|
|
128032
128188
|
if (item.specifier === "self" || item.specifier.startsWith("self/"))
|
|
128033
128189
|
return { ...item, bindings, specifier: `./${item.specifier.replace(/^self\/?/u, "")}` };
|
|
@@ -128125,8 +128281,8 @@ var init_data_document2 = __esm(() => {
|
|
|
128125
128281
|
});
|
|
128126
128282
|
|
|
128127
128283
|
// ../../packages/core/dist/services/etl/stages/resolve.js
|
|
128128
|
-
import
|
|
128129
|
-
import
|
|
128284
|
+
import path20 from "path";
|
|
128285
|
+
import fs13 from "fs";
|
|
128130
128286
|
|
|
128131
128287
|
class ResolveStage {
|
|
128132
128288
|
symbolRepository;
|
|
@@ -128150,7 +128306,7 @@ class ResolveStage {
|
|
|
128150
128306
|
const structuralDocuments = files.flatMap((file2) => {
|
|
128151
128307
|
if (!file2.structure)
|
|
128152
128308
|
return [];
|
|
128153
|
-
const language = resolveStructuralLanguage(
|
|
128309
|
+
const language = resolveStructuralLanguage(path20.extname(file2.file.relativePath));
|
|
128154
128310
|
if (language.status !== "supported")
|
|
128155
128311
|
throw new Error(`structural_manifest_missing:${file2.file.relativePath}`);
|
|
128156
128312
|
return [{
|
|
@@ -128162,13 +128318,13 @@ class ResolveStage {
|
|
|
128162
128318
|
}];
|
|
128163
128319
|
});
|
|
128164
128320
|
const currentStructuralFiles = new Set(structuralDocuments.map((document2) => document2.file));
|
|
128165
|
-
const skippedStructuralFiles = new Set(files.filter((item) => !item.file.needsReparse && STRUCTURAL_SEED_EXTENSIONS.has(
|
|
128321
|
+
const skippedStructuralFiles = new Set(files.filter((item) => !item.file.needsReparse && STRUCTURAL_SEED_EXTENSIONS.has(path20.extname(item.file.relativePath).toLowerCase())).map((item) => item.file.relativePath));
|
|
128166
128322
|
const pathAliasesByFile = Object.fromEntries([...knownRelPaths].map((file2) => [
|
|
128167
128323
|
file2,
|
|
128168
128324
|
this.structuralAliasesFor(file2, rootAliases, monorepoPackages)
|
|
128169
128325
|
]));
|
|
128170
128326
|
const buildMetadata = { knownFiles: [...knownRelPaths], pathAliasesByFile };
|
|
128171
|
-
const seedRows = repositoryDefinitions.filter((definition) => STRUCTURAL_SEED_EXTENSIONS.has(
|
|
128327
|
+
const seedRows = repositoryDefinitions.filter((definition) => STRUCTURAL_SEED_EXTENSIONS.has(path20.extname(definition.file_path).toLowerCase())).filter((definition) => knownRelPaths.has(definition.file_path) && skippedStructuralFiles.has(definition.file_path)).filter((definition) => !currentStructuralFiles.has(definition.file_path));
|
|
128172
128328
|
const seedIds = new Set;
|
|
128173
128329
|
for (const definition of seedRows) {
|
|
128174
128330
|
if (seedIds.has(definition.id))
|
|
@@ -128261,7 +128417,7 @@ class ResolveStage {
|
|
|
128261
128417
|
if (parsed.file !== definition.file_path) {
|
|
128262
128418
|
throw new Error(`structural_repository_seed_file_mismatch:${definition.id}`);
|
|
128263
128419
|
}
|
|
128264
|
-
const language = resolveStructuralLanguage(
|
|
128420
|
+
const language = resolveStructuralLanguage(path20.extname(definition.file_path));
|
|
128265
128421
|
if (language.status !== "supported")
|
|
128266
128422
|
throw new Error(`structural_repository_seed_language:${definition.id}`);
|
|
128267
128423
|
let identity;
|
|
@@ -128313,7 +128469,7 @@ class ResolveStage {
|
|
|
128313
128469
|
});
|
|
128314
128470
|
}
|
|
128315
128471
|
resolveFile(parsed, projectPath, knownRelPaths, rootAliases, monorepoPackages, symbolIndex, knownFqns) {
|
|
128316
|
-
const fromDir =
|
|
128472
|
+
const fromDir = path20.dirname(path20.join(projectPath, parsed.file.relativePath));
|
|
128317
128473
|
const packageAliases = this.getPackageAliases(parsed.file.relativePath, monorepoPackages);
|
|
128318
128474
|
const allAliases = [...packageAliases, ...rootAliases];
|
|
128319
128475
|
const resolvedImports = parsed.rawImports.map((raw2) => {
|
|
@@ -128384,7 +128540,7 @@ class ResolveStage {
|
|
|
128384
128540
|
index.set(def.name, `${def.file_path}#${def.name}`);
|
|
128385
128541
|
}
|
|
128386
128542
|
} catch (err) {
|
|
128387
|
-
const skippedStructural = files.some((file2) => !file2.file.needsReparse && STRUCTURAL_SEED_EXTENSIONS.has(
|
|
128543
|
+
const skippedStructural = files.some((file2) => !file2.file.needsReparse && STRUCTURAL_SEED_EXTENSIONS.has(path20.extname(file2.file.relativePath).toLowerCase()));
|
|
128388
128544
|
if (skippedStructural)
|
|
128389
128545
|
throw new Error("structural_repository_seed_failed", { cause: err });
|
|
128390
128546
|
logger.warn("buildSymbolIndex: repo seed failed, in-batch only", {
|
|
@@ -128408,7 +128564,7 @@ class ResolveStage {
|
|
|
128408
128564
|
}
|
|
128409
128565
|
resolveSpecifier(specifier, fromDir, projectPath, knownRelPaths, aliases) {
|
|
128410
128566
|
if (specifier.startsWith("./") || specifier.startsWith("../")) {
|
|
128411
|
-
const resolved = this.probeExtensions(
|
|
128567
|
+
const resolved = this.probeExtensions(path20.resolve(fromDir, specifier), projectPath, knownRelPaths);
|
|
128412
128568
|
return { resolvedPath: resolved, external: false };
|
|
128413
128569
|
}
|
|
128414
128570
|
for (const alias of aliases) {
|
|
@@ -128416,8 +128572,8 @@ class ResolveStage {
|
|
|
128416
128572
|
const suffix = specifier.slice(alias.prefix.length);
|
|
128417
128573
|
for (const target of alias.targets) {
|
|
128418
128574
|
const cleanTarget = target.replace(/\/\*$/, "");
|
|
128419
|
-
const basePath = alias.packagePath ?
|
|
128420
|
-
const absPath =
|
|
128575
|
+
const basePath = alias.packagePath ? path20.join(projectPath, alias.packagePath) : projectPath;
|
|
128576
|
+
const absPath = path20.join(basePath, cleanTarget + suffix);
|
|
128421
128577
|
const resolved = this.probeExtensions(absPath, projectPath, knownRelPaths);
|
|
128422
128578
|
if (resolved)
|
|
128423
128579
|
return { resolvedPath: resolved, external: false };
|
|
@@ -128433,7 +128589,7 @@ class ResolveStage {
|
|
|
128433
128589
|
...TS_EXTENSIONS.map((ext2) => absPath.replace(/\.[^.]+$/, ext2))
|
|
128434
128590
|
];
|
|
128435
128591
|
for (const candidate2 of candidates2) {
|
|
128436
|
-
const rel =
|
|
128592
|
+
const rel = path20.relative(projectPath, candidate2).replace(/\\/g, "/");
|
|
128437
128593
|
if (knownRelPaths.has(rel))
|
|
128438
128594
|
return rel;
|
|
128439
128595
|
}
|
|
@@ -128441,9 +128597,9 @@ class ResolveStage {
|
|
|
128441
128597
|
}
|
|
128442
128598
|
loadTsConfigPaths(projectPath, packageBase) {
|
|
128443
128599
|
const aliases = [];
|
|
128444
|
-
const tsconfigPath =
|
|
128600
|
+
const tsconfigPath = path20.join(projectPath, "tsconfig.json");
|
|
128445
128601
|
try {
|
|
128446
|
-
const raw2 =
|
|
128602
|
+
const raw2 = fs13.readFileSync(tsconfigPath, "utf-8");
|
|
128447
128603
|
const stripped = raw2.replace(/\/\/[^\n]*/g, "").replace(/\/\*[\s\S]*?\*\//g, "");
|
|
128448
128604
|
const tsconfig = JSON.parse(stripped);
|
|
128449
128605
|
const paths = tsconfig?.compilerOptions?.paths ?? {};
|
|
@@ -128472,7 +128628,7 @@ class ResolveStage {
|
|
|
128472
128628
|
}
|
|
128473
128629
|
}
|
|
128474
128630
|
for (const packageRelPath of packagePaths) {
|
|
128475
|
-
const absPackagePath =
|
|
128631
|
+
const absPackagePath = path20.join(projectPath, packageRelPath);
|
|
128476
128632
|
const aliases = this.loadTsConfigPaths(absPackagePath, packageRelPath);
|
|
128477
128633
|
if (aliases.length > 0) {
|
|
128478
128634
|
packages.push({
|
|
@@ -128502,7 +128658,7 @@ class ResolveStage {
|
|
|
128502
128658
|
structuralAliasesFor(filePath, rootAliases, packages) {
|
|
128503
128659
|
return [...this.getPackageAliases(filePath, packages), ...rootAliases].map((alias) => ({
|
|
128504
128660
|
pattern: alias.prefix + (alias.targets.some((target) => target.includes("*")) ? "/*" : ""),
|
|
128505
|
-
targets: alias.targets.map((target) => alias.packagePath ?
|
|
128661
|
+
targets: alias.targets.map((target) => alias.packagePath ? path20.posix.join(alias.packagePath, target) : target)
|
|
128506
128662
|
}));
|
|
128507
128663
|
}
|
|
128508
128664
|
}
|
|
@@ -128566,7 +128722,7 @@ var init_with_deadlock_retry = __esm(() => {
|
|
|
128566
128722
|
});
|
|
128567
128723
|
|
|
128568
128724
|
// ../../packages/core/dist/services/etl/stages/load.js
|
|
128569
|
-
import
|
|
128725
|
+
import path21 from "path";
|
|
128570
128726
|
function formatDuration(ms) {
|
|
128571
128727
|
const totalSec = Math.max(0, Math.round(ms / 1000));
|
|
128572
128728
|
if (totalSec < 60)
|
|
@@ -128843,7 +128999,7 @@ class LoadStage {
|
|
|
128843
128999
|
const filePath = file2.file.relativePath;
|
|
128844
129000
|
const batch = buildSymbolPersistenceBatch(ctx.projectId, file2);
|
|
128845
129001
|
if (ctx.graphGenerationLease) {
|
|
128846
|
-
const manifest = getLanguageManifestEntry(
|
|
129002
|
+
const manifest = getLanguageManifestEntry(path21.extname(filePath));
|
|
128847
129003
|
const diagnostics2 = (file2.structuralDiagnostics ?? []).slice(0, 10).map((diagnostic2) => ({
|
|
128848
129004
|
code: diagnostic2.code,
|
|
128849
129005
|
severity: diagnostic2.severity,
|
|
@@ -129300,9 +129456,9 @@ var init_graph_generation_coordinator = __esm(() => {
|
|
|
129300
129456
|
// ../../packages/core/dist/services/etl/pipeline.js
|
|
129301
129457
|
import { createHash as createHash7 } from "crypto";
|
|
129302
129458
|
import { setTimeout as delay2 } from "timers/promises";
|
|
129303
|
-
import
|
|
129459
|
+
import path22 from "path";
|
|
129304
129460
|
function buildHeaderLanguageEvidence(files) {
|
|
129305
|
-
const headers = new Set(files.filter((file2) =>
|
|
129461
|
+
const headers = new Set(files.filter((file2) => path22.posix.extname(file2.relativePath).toLowerCase() === ".h").map((file2) => path22.posix.normalize(file2.relativePath)));
|
|
129306
129462
|
const mutable = new Map;
|
|
129307
129463
|
const entry2 = (header) => {
|
|
129308
129464
|
let value = mutable.get(header);
|
|
@@ -129313,7 +129469,7 @@ function buildHeaderLanguageEvidence(files) {
|
|
|
129313
129469
|
return value;
|
|
129314
129470
|
};
|
|
129315
129471
|
for (const file2 of files) {
|
|
129316
|
-
if (
|
|
129472
|
+
if (path22.posix.basename(file2.relativePath) !== "compile_commands.json" || file2.snapshotContent === undefined)
|
|
129317
129473
|
continue;
|
|
129318
129474
|
let commands;
|
|
129319
129475
|
try {
|
|
@@ -129329,11 +129485,11 @@ function buildHeaderLanguageEvidence(files) {
|
|
|
129329
129485
|
const record3 = command;
|
|
129330
129486
|
if (typeof record3.file !== "string")
|
|
129331
129487
|
continue;
|
|
129332
|
-
const projectRoot =
|
|
129333
|
-
const commandDirectory = typeof record3.directory === "string" ?
|
|
129334
|
-
const absoluteInput =
|
|
129335
|
-
const relative2 =
|
|
129336
|
-
const header =
|
|
129488
|
+
const projectRoot = path22.resolve(file2.absolutePath, ...file2.relativePath.split("/").map(() => ".."));
|
|
129489
|
+
const commandDirectory = typeof record3.directory === "string" ? path22.resolve(projectRoot, record3.directory) : projectRoot;
|
|
129490
|
+
const absoluteInput = path22.resolve(commandDirectory, record3.file);
|
|
129491
|
+
const relative2 = path22.relative(projectRoot, absoluteInput);
|
|
129492
|
+
const header = path22.posix.normalize(relative2.replaceAll(path22.sep, "/"));
|
|
129337
129493
|
if (!headers.has(header))
|
|
129338
129494
|
continue;
|
|
129339
129495
|
const invocation = typeof record3.command === "string" ? record3.command : Array.isArray(record3.arguments) ? record3.arguments.join(" ") : "";
|
|
@@ -129864,9 +130020,9 @@ var init_acquire_indexing_lease = __esm(() => {
|
|
|
129864
130020
|
|
|
129865
130021
|
// ../../packages/core/dist/services/project-identity/project-root-identity.js
|
|
129866
130022
|
import { realpath as realpath2 } from "fs/promises";
|
|
129867
|
-
import
|
|
130023
|
+
import path23 from "path";
|
|
129868
130024
|
async function canonicalizeProjectRoot(projectPath, canonicalize = realpath2) {
|
|
129869
|
-
return canonicalize(
|
|
130025
|
+
return canonicalize(path23.resolve(projectPath));
|
|
129870
130026
|
}
|
|
129871
130027
|
async function assertProjectRootReuse(options) {
|
|
129872
130028
|
if (!options.storedProjectPath || options.forceReindex)
|
|
@@ -129874,9 +130030,9 @@ async function assertProjectRootReuse(options) {
|
|
|
129874
130030
|
const canonicalize = options.canonicalize ?? realpath2;
|
|
129875
130031
|
let storedCanonical;
|
|
129876
130032
|
try {
|
|
129877
|
-
storedCanonical = await canonicalize(
|
|
130033
|
+
storedCanonical = await canonicalize(path23.resolve(options.storedProjectPath));
|
|
129878
130034
|
} catch {
|
|
129879
|
-
storedCanonical =
|
|
130035
|
+
storedCanonical = path23.resolve(options.storedProjectPath);
|
|
129880
130036
|
}
|
|
129881
130037
|
if (storedCanonical !== options.canonicalProjectPath) {
|
|
129882
130038
|
throw new Error(`Project ID "${options.projectId}" already indexes canonical root ` + `"${storedCanonical}", not "${options.canonicalProjectPath}"; ` + "use forceReindex only after verifying ownership of the existing project");
|
|
@@ -130619,16 +130775,16 @@ function detectRoutes(httpEdges, defs, opts = {}) {
|
|
|
130619
130775
|
const seen = new Set;
|
|
130620
130776
|
const out = [];
|
|
130621
130777
|
for (const e of httpEdges) {
|
|
130622
|
-
const
|
|
130623
|
-
if (!
|
|
130778
|
+
const path24 = e.route;
|
|
130779
|
+
if (!path24)
|
|
130624
130780
|
continue;
|
|
130625
130781
|
const method = (e.method ?? "ANY").toUpperCase();
|
|
130626
|
-
const key = method + " " +
|
|
130782
|
+
const key = method + " " + path24;
|
|
130627
130783
|
if (seen.has(key))
|
|
130628
130784
|
continue;
|
|
130629
130785
|
seen.add(key);
|
|
130630
130786
|
out.push({
|
|
130631
|
-
path:
|
|
130787
|
+
path: path24,
|
|
130632
130788
|
method: e.method,
|
|
130633
130789
|
file: e.fromFile,
|
|
130634
130790
|
handler: e.targetFqn ?? e.symbolName
|
|
@@ -130639,12 +130795,12 @@ function detectRoutes(httpEdges, defs, opts = {}) {
|
|
|
130639
130795
|
continue;
|
|
130640
130796
|
const parsed = parseRouteName(d.name);
|
|
130641
130797
|
const method = parsed?.method ?? "ANY";
|
|
130642
|
-
const
|
|
130643
|
-
const key = method + " " +
|
|
130798
|
+
const path24 = parsed?.path ?? d.name;
|
|
130799
|
+
const key = method + " " + path24;
|
|
130644
130800
|
if (seen.has(key))
|
|
130645
130801
|
continue;
|
|
130646
130802
|
seen.add(key);
|
|
130647
|
-
out.push({ path:
|
|
130803
|
+
out.push({ path: path24, method: parsed?.method, file: d.filePath, handler: d.name });
|
|
130648
130804
|
}
|
|
130649
130805
|
for (const d of defs) {
|
|
130650
130806
|
const parsed = parseRouteName(d.name);
|
|
@@ -130865,8 +131021,8 @@ __export(exports_symbol_graph_service, {
|
|
|
130865
131021
|
symbolGraphService: () => symbolGraphService,
|
|
130866
131022
|
SymbolGraphService: () => SymbolGraphService
|
|
130867
131023
|
});
|
|
130868
|
-
import
|
|
130869
|
-
import
|
|
131024
|
+
import path24 from "path";
|
|
131025
|
+
import fs14 from "fs/promises";
|
|
130870
131026
|
|
|
130871
131027
|
class SymbolGraphService {
|
|
130872
131028
|
identityLookup;
|
|
@@ -131194,7 +131350,7 @@ class SymbolGraphService {
|
|
|
131194
131350
|
async readSnippet(relativePath, lineStart, lineEnd, projectId) {
|
|
131195
131351
|
try {
|
|
131196
131352
|
const absolutePath = await this.resolveToAbsolute(relativePath, projectId);
|
|
131197
|
-
const content = await
|
|
131353
|
+
const content = await fs14.readFile(absolutePath, "utf-8");
|
|
131198
131354
|
const lines = content.split(`
|
|
131199
131355
|
`);
|
|
131200
131356
|
return lines.slice(Math.max(0, lineStart - 1), Math.min(lines.length, lineEnd)).join(`
|
|
@@ -131206,7 +131362,7 @@ class SymbolGraphService {
|
|
|
131206
131362
|
async readContext(relativePath, lineNumber, contextLines, projectId) {
|
|
131207
131363
|
try {
|
|
131208
131364
|
const absolutePath = await this.resolveToAbsolute(relativePath, projectId);
|
|
131209
|
-
const content = await
|
|
131365
|
+
const content = await fs14.readFile(absolutePath, "utf-8");
|
|
131210
131366
|
const lines = content.split(`
|
|
131211
131367
|
`);
|
|
131212
131368
|
const start = Math.max(0, lineNumber - contextLines - 1);
|
|
@@ -131219,7 +131375,7 @@ class SymbolGraphService {
|
|
|
131219
131375
|
}
|
|
131220
131376
|
async resolveToAbsolute(relativePath, projectId) {
|
|
131221
131377
|
const root = await this.getProjectRoot(projectId);
|
|
131222
|
-
return root ?
|
|
131378
|
+
return root ? path24.resolve(root, relativePath) : relativePath;
|
|
131223
131379
|
}
|
|
131224
131380
|
async getProjectRoot(projectId) {
|
|
131225
131381
|
const cached2 = this.projectRootCache.get(projectId);
|
|
@@ -131362,7 +131518,7 @@ var init_workspace_manager = __esm(() => {
|
|
|
131362
131518
|
});
|
|
131363
131519
|
|
|
131364
131520
|
// ../../packages/core/dist/tools/index_project.js
|
|
131365
|
-
import
|
|
131521
|
+
import path25 from "path";
|
|
131366
131522
|
|
|
131367
131523
|
class IndexProjectTool {
|
|
131368
131524
|
name = "index_project";
|
|
@@ -131410,7 +131566,7 @@ class IndexProjectTool {
|
|
|
131410
131566
|
try {
|
|
131411
131567
|
await assertParserReadyForIndexing();
|
|
131412
131568
|
const canonicalProjectPath = await canonicalizeProjectRoot(projectPath);
|
|
131413
|
-
const finalProjectId = projectId ||
|
|
131569
|
+
const finalProjectId = projectId || path25.basename(canonicalProjectPath) || "default";
|
|
131414
131570
|
const existing = await workspaceManager.getWorkspace(finalProjectId);
|
|
131415
131571
|
await assertProjectRootReuse({
|
|
131416
131572
|
projectId: finalProjectId,
|
|
@@ -131963,17 +132119,17 @@ function applyReplacer(root, replacer) {
|
|
|
131963
132119
|
return transformChildren(root, replacer, []);
|
|
131964
132120
|
return transformChildren(normalizeValue(replacedRoot), replacer, []);
|
|
131965
132121
|
}
|
|
131966
|
-
function transformChildren(value, replacer,
|
|
132122
|
+
function transformChildren(value, replacer, path26) {
|
|
131967
132123
|
if (isJsonObject(value))
|
|
131968
|
-
return transformObject(value, replacer,
|
|
132124
|
+
return transformObject(value, replacer, path26);
|
|
131969
132125
|
if (isJsonArray(value))
|
|
131970
|
-
return transformArray(value, replacer,
|
|
132126
|
+
return transformArray(value, replacer, path26);
|
|
131971
132127
|
return value;
|
|
131972
132128
|
}
|
|
131973
|
-
function transformObject(obj, replacer,
|
|
132129
|
+
function transformObject(obj, replacer, path26) {
|
|
131974
132130
|
const result = {};
|
|
131975
132131
|
for (const [key, value] of Object.entries(obj)) {
|
|
131976
|
-
const childPath = [...
|
|
132132
|
+
const childPath = [...path26, key];
|
|
131977
132133
|
const replacedValue = replacer(key, value, childPath);
|
|
131978
132134
|
if (replacedValue === undefined)
|
|
131979
132135
|
continue;
|
|
@@ -131981,11 +132137,11 @@ function transformObject(obj, replacer, path24) {
|
|
|
131981
132137
|
}
|
|
131982
132138
|
return result;
|
|
131983
132139
|
}
|
|
131984
|
-
function transformArray(arr, replacer,
|
|
132140
|
+
function transformArray(arr, replacer, path26) {
|
|
131985
132141
|
const result = [];
|
|
131986
132142
|
for (let i = 0;i < arr.length; i++) {
|
|
131987
132143
|
const value = arr[i];
|
|
131988
|
-
const childPath = [...
|
|
132144
|
+
const childPath = [...path26, i];
|
|
131989
132145
|
const replacedValue = replacer(String(i), value, childPath);
|
|
131990
132146
|
if (replacedValue === undefined)
|
|
131991
132147
|
continue;
|
|
@@ -137055,9 +137211,9 @@ var init_session_pin_store = __esm(() => {
|
|
|
137055
137211
|
});
|
|
137056
137212
|
|
|
137057
137213
|
// ../../packages/core/dist/services/hooks/attribution-resolver.js
|
|
137058
|
-
import
|
|
137214
|
+
import fs15 from "fs";
|
|
137059
137215
|
import os6 from "os";
|
|
137060
|
-
import
|
|
137216
|
+
import path26 from "path";
|
|
137061
137217
|
|
|
137062
137218
|
class PgWorkspaceRootProvider {
|
|
137063
137219
|
cache = null;
|
|
@@ -137107,7 +137263,7 @@ class AttributionResolver {
|
|
|
137107
137263
|
this.pins = options.pins ?? new SessionPinStore;
|
|
137108
137264
|
this.canonicalize = options.canonicalize ?? defaultCanonicalize;
|
|
137109
137265
|
this.homedir = options.homedir ?? os6.homedir;
|
|
137110
|
-
this.fsRoot = options.fsRoot ?? (() =>
|
|
137266
|
+
this.fsRoot = options.fsRoot ?? (() => path26.parse(path26.sep).root);
|
|
137111
137267
|
}
|
|
137112
137268
|
async resolve(input) {
|
|
137113
137269
|
const caller = input.callerProjectId;
|
|
@@ -137158,7 +137314,7 @@ class AttributionResolver {
|
|
|
137158
137314
|
}
|
|
137159
137315
|
let bestPath = null;
|
|
137160
137316
|
for (const candidate2 of byPath.keys()) {
|
|
137161
|
-
if (canonicalCwd === candidate2 || canonicalCwd.startsWith(candidate2.endsWith(
|
|
137317
|
+
if (canonicalCwd === candidate2 || canonicalCwd.startsWith(candidate2.endsWith(path26.sep) ? candidate2 : candidate2 + path26.sep)) {
|
|
137162
137318
|
if (bestPath === null || candidate2.length > bestPath.length) {
|
|
137163
137319
|
bestPath = candidate2;
|
|
137164
137320
|
}
|
|
@@ -137181,7 +137337,7 @@ class AttributionResolver {
|
|
|
137181
137337
|
return projectPath2;
|
|
137182
137338
|
const fsRoot = this.fsRoot();
|
|
137183
137339
|
let normalized = projectPath2;
|
|
137184
|
-
while (normalized.length > fsRoot.length && normalized.endsWith(
|
|
137340
|
+
while (normalized.length > fsRoot.length && normalized.endsWith(path26.sep)) {
|
|
137185
137341
|
normalized = normalized.slice(0, -1);
|
|
137186
137342
|
}
|
|
137187
137343
|
return normalized;
|
|
@@ -137189,10 +137345,10 @@ class AttributionResolver {
|
|
|
137189
137345
|
}
|
|
137190
137346
|
function defaultCanonicalize(cwd) {
|
|
137191
137347
|
try {
|
|
137192
|
-
return
|
|
137348
|
+
return fs15.realpathSync(cwd);
|
|
137193
137349
|
} catch {
|
|
137194
137350
|
try {
|
|
137195
|
-
return
|
|
137351
|
+
return path26.resolve(cwd);
|
|
137196
137352
|
} catch {
|
|
137197
137353
|
return;
|
|
137198
137354
|
}
|
|
@@ -137940,31 +138096,31 @@ class TracePathService {
|
|
|
137940
138096
|
const chains = [];
|
|
137941
138097
|
const seen = new Set;
|
|
137942
138098
|
let walks = 0;
|
|
137943
|
-
const walk = (fqn,
|
|
138099
|
+
const walk = (fqn, path27) => {
|
|
137944
138100
|
if (chains.length >= CHAIN_CAP)
|
|
137945
138101
|
return;
|
|
137946
138102
|
if (walks >= MAX_WALKS)
|
|
137947
138103
|
return;
|
|
137948
138104
|
walks++;
|
|
137949
|
-
const key =
|
|
138105
|
+
const key = path27.join("\u2192");
|
|
137950
138106
|
if (seen.has(key))
|
|
137951
138107
|
return;
|
|
137952
138108
|
seen.add(key);
|
|
137953
138109
|
const next = adj.get(fqn);
|
|
137954
138110
|
if (!next || next.length === 0 || !whoHasChild.has(fqn)) {
|
|
137955
|
-
if (
|
|
137956
|
-
chains.push(
|
|
138111
|
+
if (path27.length > 1)
|
|
138112
|
+
chains.push(path27.map((n) => this.fqnToName(n)).join(" \u2192 "));
|
|
137957
138113
|
return;
|
|
137958
138114
|
}
|
|
137959
138115
|
for (const child of next) {
|
|
137960
138116
|
if (chains.length >= CHAIN_CAP || walks >= MAX_WALKS)
|
|
137961
138117
|
return;
|
|
137962
|
-
if (
|
|
137963
|
-
const cycled = [...
|
|
138118
|
+
if (path27.includes(child)) {
|
|
138119
|
+
const cycled = [...path27, `${this.fqnToName(child)}\u21BA`];
|
|
137964
138120
|
chains.push(cycled.map((n) => n).join(" \u2192 "));
|
|
137965
138121
|
continue;
|
|
137966
138122
|
}
|
|
137967
|
-
walk(child, [...
|
|
138123
|
+
walk(child, [...path27, child]);
|
|
137968
138124
|
}
|
|
137969
138125
|
};
|
|
137970
138126
|
for (const seed of seeds) {
|
|
@@ -138797,7 +138953,7 @@ var init_get_architecture = __esm(() => {
|
|
|
138797
138953
|
});
|
|
138798
138954
|
|
|
138799
138955
|
// ../../packages/core/dist/services/file-read/file-content-cache.js
|
|
138800
|
-
import
|
|
138956
|
+
import fs16 from "fs/promises";
|
|
138801
138957
|
|
|
138802
138958
|
class FileContentCache {
|
|
138803
138959
|
extractMetadata;
|
|
@@ -138830,7 +138986,7 @@ class FileContentCache {
|
|
|
138830
138986
|
metadata: cached2.metadata
|
|
138831
138987
|
};
|
|
138832
138988
|
}
|
|
138833
|
-
const content = await
|
|
138989
|
+
const content = await fs16.readFile(filePath, "utf-8");
|
|
138834
138990
|
const metadata = await this.extractMetadata(content, filePath, options);
|
|
138835
138991
|
evictOldest(this.fileCache, this.FILE_CACHE_MAX_ENTRIES - 1);
|
|
138836
138992
|
this.fileCache.set(cacheKey, {
|
|
@@ -138847,7 +139003,7 @@ var init_file_content_cache = __esm(() => {
|
|
|
138847
139003
|
});
|
|
138848
139004
|
|
|
138849
139005
|
// ../../packages/core/dist/services/file-read/file-metadata.js
|
|
138850
|
-
import
|
|
139006
|
+
import path27 from "path";
|
|
138851
139007
|
|
|
138852
139008
|
class FileMetadataExtractor {
|
|
138853
139009
|
symbolGraph;
|
|
@@ -138883,7 +139039,7 @@ class FileMetadataExtractor {
|
|
|
138883
139039
|
return metadata;
|
|
138884
139040
|
}
|
|
138885
139041
|
detectLanguage(filePath) {
|
|
138886
|
-
const ext2 =
|
|
139042
|
+
const ext2 = path27.extname(filePath).toLowerCase();
|
|
138887
139043
|
const languageMap2 = {
|
|
138888
139044
|
".ts": "TypeScript",
|
|
138889
139045
|
".tsx": "TypeScript",
|
|
@@ -139005,7 +139161,7 @@ var init_line_range = __esm(() => {
|
|
|
139005
139161
|
});
|
|
139006
139162
|
|
|
139007
139163
|
// ../../packages/core/dist/services/file-read/path-containment.js
|
|
139008
|
-
import
|
|
139164
|
+
import path28 from "path";
|
|
139009
139165
|
|
|
139010
139166
|
class PathContainment {
|
|
139011
139167
|
projectRoots;
|
|
@@ -139013,14 +139169,14 @@ class PathContainment {
|
|
|
139013
139169
|
this.projectRoots = projectRoots;
|
|
139014
139170
|
}
|
|
139015
139171
|
async resolveFilePath(filePath, projectId) {
|
|
139016
|
-
if (
|
|
139017
|
-
return
|
|
139172
|
+
if (path28.isAbsolute(filePath)) {
|
|
139173
|
+
return path28.resolve(filePath);
|
|
139018
139174
|
}
|
|
139019
139175
|
if (projectId) {
|
|
139020
139176
|
const root = await this.projectRoots.getProjectRoot(projectId);
|
|
139021
139177
|
if (root) {
|
|
139022
139178
|
const cleaned = sanitizeFilePath(filePath);
|
|
139023
|
-
return
|
|
139179
|
+
return path28.resolve(root, cleaned);
|
|
139024
139180
|
}
|
|
139025
139181
|
return null;
|
|
139026
139182
|
}
|
|
@@ -139031,17 +139187,17 @@ class PathContainment {
|
|
|
139031
139187
|
if (projectId) {
|
|
139032
139188
|
const root = await this.projectRoots.getProjectRoot(projectId);
|
|
139033
139189
|
if (root)
|
|
139034
|
-
roots.push(
|
|
139190
|
+
roots.push(path28.resolve(root));
|
|
139035
139191
|
}
|
|
139036
|
-
roots.push(
|
|
139192
|
+
roots.push(path28.resolve(process.cwd()));
|
|
139037
139193
|
const envRoots = (process.env.MASSA_AI_READ_FILE_ROOTS ?? "").split(":").map((s) => s.trim()).filter((s) => s.length > 0);
|
|
139038
139194
|
for (const extra of envRoots) {
|
|
139039
|
-
roots.push(
|
|
139195
|
+
roots.push(path28.resolve(extra));
|
|
139040
139196
|
}
|
|
139041
|
-
const target =
|
|
139197
|
+
const target = path28.resolve(absoluteFilePath);
|
|
139042
139198
|
for (const root of roots) {
|
|
139043
|
-
const rel =
|
|
139044
|
-
if (rel !== "" && !rel.startsWith("..") && !
|
|
139199
|
+
const rel = path28.relative(root, target);
|
|
139200
|
+
if (rel !== "" && !rel.startsWith("..") && !path28.isAbsolute(rel)) {
|
|
139045
139201
|
return { allowed: true };
|
|
139046
139202
|
}
|
|
139047
139203
|
if (rel === "")
|
|
@@ -142255,9 +142411,9 @@ var init_l1_memory_cache = __esm(() => {
|
|
|
142255
142411
|
});
|
|
142256
142412
|
|
|
142257
142413
|
// ../../packages/core/dist/services/health/local-health-checker.js
|
|
142258
|
-
import
|
|
142414
|
+
import fs17 from "fs/promises";
|
|
142259
142415
|
import { existsSync as existsSync3 } from "fs";
|
|
142260
|
-
import
|
|
142416
|
+
import path29 from "path";
|
|
142261
142417
|
|
|
142262
142418
|
class LocalHealthChecker {
|
|
142263
142419
|
ollamaBaseUrl = process.env.OLLAMA_BASE_URL || "http://localhost:11434";
|
|
@@ -142291,10 +142447,10 @@ class LocalHealthChecker {
|
|
|
142291
142447
|
const start = Date.now();
|
|
142292
142448
|
try {
|
|
142293
142449
|
if (!existsSync3(this.dataDir))
|
|
142294
|
-
await
|
|
142295
|
-
const probe2 =
|
|
142296
|
-
await
|
|
142297
|
-
await
|
|
142450
|
+
await fs17.mkdir(this.dataDir, { recursive: true });
|
|
142451
|
+
const probe2 = path29.join(this.dataDir, ".health-check-test");
|
|
142452
|
+
await fs17.writeFile(probe2, "ok");
|
|
142453
|
+
await fs17.unlink(probe2);
|
|
142298
142454
|
return { available: true, latency: Date.now() - start, details: { path: this.dataDir, writable: true } };
|
|
142299
142455
|
} catch (error51) {
|
|
142300
142456
|
return { available: false, latency: Date.now() - start, error: `Data directory error: ${error51.message}` };
|
|
@@ -144247,9 +144403,9 @@ var init_scheduler2 = __esm(() => {
|
|
|
144247
144403
|
});
|
|
144248
144404
|
|
|
144249
144405
|
// ../../packages/core/dist/services/pricing/models-dev-client.js
|
|
144250
|
-
import
|
|
144406
|
+
import fs18 from "fs/promises";
|
|
144251
144407
|
import { existsSync as existsSync4 } from "fs";
|
|
144252
|
-
import
|
|
144408
|
+
import path30 from "path";
|
|
144253
144409
|
function getModelsDevClient() {
|
|
144254
144410
|
if (!clientInstance) {
|
|
144255
144411
|
clientInstance = new ModelsDevClient;
|
|
@@ -144269,7 +144425,7 @@ var init_models_dev_client = __esm(() => {
|
|
|
144269
144425
|
memoryCacheTimestamp = 0;
|
|
144270
144426
|
getLocalCachePath() {
|
|
144271
144427
|
const dataDir = config2.get("dataDir");
|
|
144272
|
-
return
|
|
144428
|
+
return path30.join(dataDir, ModelsDevClient.LOCAL_CACHE_FILE);
|
|
144273
144429
|
}
|
|
144274
144430
|
async loadLocalCache() {
|
|
144275
144431
|
const cachePath = this.getLocalCachePath();
|
|
@@ -144277,7 +144433,7 @@ var init_models_dev_client = __esm(() => {
|
|
|
144277
144433
|
if (!existsSync4(cachePath)) {
|
|
144278
144434
|
return null;
|
|
144279
144435
|
}
|
|
144280
|
-
const content = await
|
|
144436
|
+
const content = await fs18.readFile(cachePath, "utf-8");
|
|
144281
144437
|
const data = JSON.parse(content);
|
|
144282
144438
|
const age = Date.now() - data.timestamp;
|
|
144283
144439
|
if (age > ModelsDevClient.LOCAL_CACHE_TTL) {
|
|
@@ -144304,14 +144460,14 @@ var init_models_dev_client = __esm(() => {
|
|
|
144304
144460
|
async saveLocalCache(models) {
|
|
144305
144461
|
const cachePath = this.getLocalCachePath();
|
|
144306
144462
|
try {
|
|
144307
|
-
const dir =
|
|
144308
|
-
await
|
|
144463
|
+
const dir = path30.dirname(cachePath);
|
|
144464
|
+
await fs18.mkdir(dir, { recursive: true });
|
|
144309
144465
|
const data = {
|
|
144310
144466
|
timestamp: Date.now(),
|
|
144311
144467
|
version: "1.0.0",
|
|
144312
144468
|
models: Object.fromEntries(models)
|
|
144313
144469
|
};
|
|
144314
|
-
await
|
|
144470
|
+
await fs18.writeFile(cachePath, JSON.stringify(data), "utf-8");
|
|
144315
144471
|
logger.debug("Saved pricing to local cache", {
|
|
144316
144472
|
models: models.size,
|
|
144317
144473
|
path: cachePath
|
|
@@ -144640,7 +144796,7 @@ var init_models_dev_client = __esm(() => {
|
|
|
144640
144796
|
const cachePath = this.getLocalCachePath();
|
|
144641
144797
|
try {
|
|
144642
144798
|
if (existsSync4(cachePath)) {
|
|
144643
|
-
await
|
|
144799
|
+
await fs18.unlink(cachePath);
|
|
144644
144800
|
logger.debug("Local pricing cache file deleted");
|
|
144645
144801
|
}
|
|
144646
144802
|
} catch (error51) {
|
|
@@ -150195,33 +150351,33 @@ var require_URL = __commonJS((exports, module) => {
|
|
|
150195
150351
|
else
|
|
150196
150352
|
return basepath.substring(0, lastslash + 1) + refpath;
|
|
150197
150353
|
}
|
|
150198
|
-
function remove_dot_segments(
|
|
150199
|
-
if (!
|
|
150200
|
-
return
|
|
150354
|
+
function remove_dot_segments(path31) {
|
|
150355
|
+
if (!path31)
|
|
150356
|
+
return path31;
|
|
150201
150357
|
var output = "";
|
|
150202
|
-
while (
|
|
150203
|
-
if (
|
|
150204
|
-
|
|
150358
|
+
while (path31.length > 0) {
|
|
150359
|
+
if (path31 === "." || path31 === "..") {
|
|
150360
|
+
path31 = "";
|
|
150205
150361
|
break;
|
|
150206
150362
|
}
|
|
150207
|
-
var twochars =
|
|
150208
|
-
var threechars =
|
|
150209
|
-
var fourchars =
|
|
150363
|
+
var twochars = path31.substring(0, 2);
|
|
150364
|
+
var threechars = path31.substring(0, 3);
|
|
150365
|
+
var fourchars = path31.substring(0, 4);
|
|
150210
150366
|
if (threechars === "../") {
|
|
150211
|
-
|
|
150367
|
+
path31 = path31.substring(3);
|
|
150212
150368
|
} else if (twochars === "./") {
|
|
150213
|
-
|
|
150369
|
+
path31 = path31.substring(2);
|
|
150214
150370
|
} else if (threechars === "/./") {
|
|
150215
|
-
|
|
150216
|
-
} else if (twochars === "/." &&
|
|
150217
|
-
|
|
150218
|
-
} else if (fourchars === "/../" || threechars === "/.." &&
|
|
150219
|
-
|
|
150371
|
+
path31 = "/" + path31.substring(3);
|
|
150372
|
+
} else if (twochars === "/." && path31.length === 2) {
|
|
150373
|
+
path31 = "/";
|
|
150374
|
+
} else if (fourchars === "/../" || threechars === "/.." && path31.length === 3) {
|
|
150375
|
+
path31 = "/" + path31.substring(4);
|
|
150220
150376
|
output = output.replace(/\/?[^\/]*$/, "");
|
|
150221
150377
|
} else {
|
|
150222
|
-
var segment =
|
|
150378
|
+
var segment = path31.match(/(\/?([^\/]*))/)[0];
|
|
150223
150379
|
output += segment;
|
|
150224
|
-
|
|
150380
|
+
path31 = path31.substring(segment.length);
|
|
150225
150381
|
}
|
|
150226
150382
|
}
|
|
150227
150383
|
return output;
|
|
@@ -162291,21 +162447,21 @@ function jsonToKeyPathChunks(value, label = "$") {
|
|
|
162291
162447
|
walk(value, label, out);
|
|
162292
162448
|
return out;
|
|
162293
162449
|
}
|
|
162294
|
-
function walk(val,
|
|
162450
|
+
function walk(val, path31, out) {
|
|
162295
162451
|
if (val === null || val === undefined)
|
|
162296
162452
|
return;
|
|
162297
162453
|
if (Array.isArray(val)) {
|
|
162298
162454
|
if (val.length === 0) {
|
|
162299
|
-
out.push({ path:
|
|
162455
|
+
out.push({ path: path31, content: `**${path31}** = _[]_` });
|
|
162300
162456
|
return;
|
|
162301
162457
|
}
|
|
162302
162458
|
if (val.every((v) => v !== null && typeof v === "object")) {
|
|
162303
|
-
val.forEach((v, i) => walk(v, `${
|
|
162459
|
+
val.forEach((v, i) => walk(v, `${path31}[${i}]`, out));
|
|
162304
162460
|
return;
|
|
162305
162461
|
}
|
|
162306
162462
|
const items = val.map((v) => `- \`${String(v)}\``).join(`
|
|
162307
162463
|
`);
|
|
162308
|
-
out.push({ path:
|
|
162464
|
+
out.push({ path: path31, content: `**${path31}**
|
|
162309
162465
|
|
|
162310
162466
|
${items}` });
|
|
162311
162467
|
return;
|
|
@@ -162313,16 +162469,16 @@ ${items}` });
|
|
|
162313
162469
|
if (typeof val === "object") {
|
|
162314
162470
|
const entries = Object.entries(val);
|
|
162315
162471
|
if (entries.length === 0) {
|
|
162316
|
-
out.push({ path:
|
|
162472
|
+
out.push({ path: path31, content: `**${path31}** = _{}_` });
|
|
162317
162473
|
return;
|
|
162318
162474
|
}
|
|
162319
162475
|
for (const [k, v] of entries) {
|
|
162320
162476
|
const safeKey = /^[A-Za-z_$][\w$]*$/.test(k) ? k : JSON.stringify(k);
|
|
162321
|
-
walk(v, `${
|
|
162477
|
+
walk(v, `${path31}.${safeKey}`, out);
|
|
162322
162478
|
}
|
|
162323
162479
|
return;
|
|
162324
162480
|
}
|
|
162325
|
-
out.push({ path:
|
|
162481
|
+
out.push({ path: path31, content: `**${path31}** = \`${String(val)}\`` });
|
|
162326
162482
|
}
|
|
162327
162483
|
var gfm, STRIP_SELECTORS, tdCache = null;
|
|
162328
162484
|
var init_html_to_md = __esm(() => {
|
|
@@ -163085,8 +163241,8 @@ var init_hook_service = __esm(() => {
|
|
|
163085
163241
|
|
|
163086
163242
|
// ../../packages/core/dist/services/bootstrap/bootstrap-service.js
|
|
163087
163243
|
import { randomUUID as randomUUID9 } from "crypto";
|
|
163088
|
-
import
|
|
163089
|
-
import
|
|
163244
|
+
import fs19 from "fs";
|
|
163245
|
+
import path31 from "path";
|
|
163090
163246
|
import { spawn as spawn2 } from "child_process";
|
|
163091
163247
|
function readBootstrapConfig() {
|
|
163092
163248
|
try {
|
|
@@ -163246,9 +163402,9 @@ async function scanSignals(_projectId, projectRoot, caps, symbolGraph, gitRunner
|
|
|
163246
163402
|
}
|
|
163247
163403
|
try {
|
|
163248
163404
|
for (const name26 of README_CANDIDATES) {
|
|
163249
|
-
const p =
|
|
163250
|
-
if (
|
|
163251
|
-
const buf =
|
|
163405
|
+
const p = path31.join(projectRoot, name26);
|
|
163406
|
+
if (fs19.existsSync(p) && fs19.statSync(p).isFile()) {
|
|
163407
|
+
const buf = fs19.readFileSync(p);
|
|
163252
163408
|
signals.readme = buf.slice(0, MAX_README_BYTES).toString("utf8");
|
|
163253
163409
|
break;
|
|
163254
163410
|
}
|
|
@@ -163257,14 +163413,14 @@ async function scanSignals(_projectId, projectRoot, caps, symbolGraph, gitRunner
|
|
|
163257
163413
|
logger.debug("bootstrap scan: README read failed", { error: e.message });
|
|
163258
163414
|
}
|
|
163259
163415
|
try {
|
|
163260
|
-
const docsDir =
|
|
163261
|
-
if (
|
|
163416
|
+
const docsDir = path31.join(projectRoot, "docs");
|
|
163417
|
+
if (fs19.existsSync(docsDir) && fs19.statSync(docsDir).isDirectory()) {
|
|
163262
163418
|
const entries = walkMarkdown(docsDir).slice(0, MAX_DOCS);
|
|
163263
163419
|
for (const rel of entries) {
|
|
163264
163420
|
try {
|
|
163265
|
-
const buf =
|
|
163421
|
+
const buf = fs19.readFileSync(rel);
|
|
163266
163422
|
signals.docs.push({
|
|
163267
|
-
path:
|
|
163423
|
+
path: path31.relative(projectRoot, rel),
|
|
163268
163424
|
snippet: buf.slice(0, MAX_DOC_BYTES).toString("utf8")
|
|
163269
163425
|
});
|
|
163270
163426
|
} catch {}
|
|
@@ -163275,10 +163431,10 @@ async function scanSignals(_projectId, projectRoot, caps, symbolGraph, gitRunner
|
|
|
163275
163431
|
}
|
|
163276
163432
|
try {
|
|
163277
163433
|
for (const name26 of MANIFEST_FILES) {
|
|
163278
|
-
const p =
|
|
163279
|
-
if (!
|
|
163434
|
+
const p = path31.join(projectRoot, name26);
|
|
163435
|
+
if (!fs19.existsSync(p) || !fs19.statSync(p).isFile())
|
|
163280
163436
|
continue;
|
|
163281
|
-
const raw2 =
|
|
163437
|
+
const raw2 = fs19.readFileSync(p).slice(0, MAX_MANIFEST_BYTES).toString("utf8");
|
|
163282
163438
|
const kind = name26;
|
|
163283
163439
|
if (name26 === "package.json") {
|
|
163284
163440
|
try {
|
|
@@ -163318,12 +163474,12 @@ function walkMarkdown(dir) {
|
|
|
163318
163474
|
const cur = stack.pop();
|
|
163319
163475
|
let entries;
|
|
163320
163476
|
try {
|
|
163321
|
-
entries =
|
|
163477
|
+
entries = fs19.readdirSync(cur, { withFileTypes: true });
|
|
163322
163478
|
} catch {
|
|
163323
163479
|
continue;
|
|
163324
163480
|
}
|
|
163325
163481
|
for (const e of entries) {
|
|
163326
|
-
const full =
|
|
163482
|
+
const full = path31.join(cur, e.name);
|
|
163327
163483
|
if (e.isDirectory()) {
|
|
163328
163484
|
if (e.name === "node_modules" || e.name.startsWith("."))
|
|
163329
163485
|
continue;
|
|
@@ -166735,7 +166891,7 @@ class StdioServerTransport {
|
|
|
166735
166891
|
}
|
|
166736
166892
|
|
|
166737
166893
|
// src/index.ts
|
|
166738
|
-
import
|
|
166894
|
+
import fs22 from "fs/promises";
|
|
166739
166895
|
|
|
166740
166896
|
// src/api-client.ts
|
|
166741
166897
|
init_config();
|
|
@@ -166845,8 +167001,8 @@ init_dist();
|
|
|
166845
167001
|
init_dist();
|
|
166846
167002
|
init_dist15();
|
|
166847
167003
|
init_dist();
|
|
166848
|
-
import
|
|
166849
|
-
import
|
|
167004
|
+
import fs20 from "fs/promises";
|
|
167005
|
+
import path32 from "path";
|
|
166850
167006
|
var _indexProjectTool = null;
|
|
166851
167007
|
function indexProjectTool() {
|
|
166852
167008
|
if (!_indexProjectTool)
|
|
@@ -167129,8 +167285,8 @@ class EmbeddedApiClient {
|
|
|
167129
167285
|
} else {
|
|
167130
167286
|
end = start + 20;
|
|
167131
167287
|
}
|
|
167132
|
-
const absolutePath =
|
|
167133
|
-
const content = await
|
|
167288
|
+
const absolutePath = path32.join(workspace.project_path, file2);
|
|
167289
|
+
const content = await fs20.readFile(absolutePath, "utf-8");
|
|
167134
167290
|
const lines = content.split(/\r?\n/);
|
|
167135
167291
|
const slice = lines.slice(start - 1, Math.min(lines.length, end));
|
|
167136
167292
|
const formatted = slice.map((text3, idx) => ({ lineNumber: start + idx, content: text3 }));
|
|
@@ -167367,22 +167523,22 @@ class EmbeddedApiClient {
|
|
|
167367
167523
|
async uploadAndIndex(params) {
|
|
167368
167524
|
const rawBase = params.projectId || params.projectPath.replace(/\\/g, "/").split("/").filter(Boolean).pop() || "default";
|
|
167369
167525
|
const finalProjectId = rawBase.replace(/[^a-zA-Z0-9_.-]/g, "_").slice(0, 128);
|
|
167370
|
-
const uploadRoot = process.env.MASSA_AI_UPLOAD_DIR ||
|
|
167371
|
-
const stagingDir =
|
|
167372
|
-
await
|
|
167373
|
-
await
|
|
167526
|
+
const uploadRoot = process.env.MASSA_AI_UPLOAD_DIR || path32.join(getGlobalDataDir(), "uploads");
|
|
167527
|
+
const stagingDir = path32.resolve(uploadRoot, finalProjectId);
|
|
167528
|
+
await fs20.rm(stagingDir, { recursive: true, force: true });
|
|
167529
|
+
await fs20.mkdir(stagingDir, { recursive: true });
|
|
167374
167530
|
const WRITE_BATCH = 20;
|
|
167375
167531
|
for (let i = 0;i < params.files.length; i += WRITE_BATCH) {
|
|
167376
167532
|
await Promise.all(params.files.slice(i, i + WRITE_BATCH).map(async (file2) => {
|
|
167377
|
-
if (
|
|
167533
|
+
if (path32.isAbsolute(file2.relativePath) || file2.relativePath.includes("..")) {
|
|
167378
167534
|
throw new Error(`Invalid file path: ${file2.relativePath}`);
|
|
167379
167535
|
}
|
|
167380
|
-
const dest =
|
|
167381
|
-
if (!dest.startsWith(stagingDir +
|
|
167536
|
+
const dest = path32.resolve(stagingDir, file2.relativePath.replace(/\//g, path32.sep));
|
|
167537
|
+
if (!dest.startsWith(stagingDir + path32.sep)) {
|
|
167382
167538
|
throw new Error(`Path escapes staging directory: ${file2.relativePath}`);
|
|
167383
167539
|
}
|
|
167384
|
-
await
|
|
167385
|
-
await
|
|
167540
|
+
await fs20.mkdir(path32.dirname(dest), { recursive: true });
|
|
167541
|
+
await fs20.writeFile(dest, file2.content, "utf-8");
|
|
167386
167542
|
}));
|
|
167387
167543
|
}
|
|
167388
167544
|
return await indexProjectTool().handle({
|
|
@@ -167726,8 +167882,8 @@ class EmbeddedApiClient {
|
|
|
167726
167882
|
|
|
167727
167883
|
// src/file-collector.ts
|
|
167728
167884
|
init_config();
|
|
167729
|
-
import
|
|
167730
|
-
import
|
|
167885
|
+
import fs21 from "fs/promises";
|
|
167886
|
+
import path33 from "path";
|
|
167731
167887
|
var SKIP_DIRS = new Set([
|
|
167732
167888
|
"node_modules",
|
|
167733
167889
|
".git",
|
|
@@ -167768,7 +167924,7 @@ async function walk2(root2, dir, files, state, allowed) {
|
|
|
167768
167924
|
return;
|
|
167769
167925
|
let entries;
|
|
167770
167926
|
try {
|
|
167771
|
-
entries = await
|
|
167927
|
+
entries = await fs21.readdir(dir, { withFileTypes: true });
|
|
167772
167928
|
} catch {
|
|
167773
167929
|
return;
|
|
167774
167930
|
}
|
|
@@ -167777,22 +167933,22 @@ async function walk2(root2, dir, files, state, allowed) {
|
|
|
167777
167933
|
break;
|
|
167778
167934
|
if (entry2.isDirectory()) {
|
|
167779
167935
|
if (!SKIP_DIRS.has(entry2.name) && !entry2.name.startsWith(".")) {
|
|
167780
|
-
await walk2(root2,
|
|
167936
|
+
await walk2(root2, path33.join(dir, entry2.name), files, state, allowed);
|
|
167781
167937
|
}
|
|
167782
167938
|
} else if (entry2.isFile()) {
|
|
167783
|
-
const ext2 =
|
|
167939
|
+
const ext2 = path33.extname(entry2.name).toLowerCase();
|
|
167784
167940
|
if (!allowed.has(ext2))
|
|
167785
167941
|
continue;
|
|
167786
|
-
const fullPath =
|
|
167942
|
+
const fullPath = path33.join(dir, entry2.name);
|
|
167787
167943
|
try {
|
|
167788
|
-
const stat = await
|
|
167944
|
+
const stat = await fs21.stat(fullPath);
|
|
167789
167945
|
if (stat.size > MAX_FILE_BYTES)
|
|
167790
167946
|
continue;
|
|
167791
167947
|
if (state.totalBytes + stat.size > MAX_TOTAL_BYTES)
|
|
167792
167948
|
continue;
|
|
167793
|
-
const content = await
|
|
167949
|
+
const content = await fs21.readFile(fullPath, "utf-8");
|
|
167794
167950
|
state.totalBytes += stat.size;
|
|
167795
|
-
const relativePath =
|
|
167951
|
+
const relativePath = path33.relative(root2, fullPath).split(path33.sep).join("/");
|
|
167796
167952
|
files.push({ relativePath, content });
|
|
167797
167953
|
} catch {}
|
|
167798
167954
|
}
|
|
@@ -169693,7 +169849,7 @@ class McpProxyServer {
|
|
|
169693
169849
|
return textContent(JSON.stringify({ success: false, error: "projectPath is required" }));
|
|
169694
169850
|
}
|
|
169695
169851
|
try {
|
|
169696
|
-
if (!(await
|
|
169852
|
+
if (!(await fs22.stat(projectPath2)).isDirectory()) {
|
|
169697
169853
|
return textContent(JSON.stringify({ success: false, error: `${projectPath2} is not a directory` }));
|
|
169698
169854
|
}
|
|
169699
169855
|
} catch {
|