@massa-ai/mcp-client 1.60.0 → 1.60.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config-cli.js +586 -393
- package/dist/index.js +630 -437
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -27676,12 +27676,13 @@ function selectRecord(records) {
|
|
|
27676
27676
|
}
|
|
27677
27677
|
return best ?? pool[pool.length - 1];
|
|
27678
27678
|
}
|
|
27679
|
-
function
|
|
27679
|
+
function resolveClaudeMarketplaceInstall(opts = {}) {
|
|
27680
27680
|
const targetHome = opts.targetHome ?? os5.homedir();
|
|
27681
27681
|
const pluginKey = opts.pluginKey ?? DEFAULT_PLUGIN_KEY;
|
|
27682
27682
|
const directoryResult = resolveDirectorySourceRoot(targetHome, pluginKey);
|
|
27683
|
-
if (directoryResult !== undefined)
|
|
27684
|
-
return directoryResult;
|
|
27683
|
+
if (directoryResult !== undefined) {
|
|
27684
|
+
return directoryResult === null ? null : { root: directoryResult, route: "directory-source" };
|
|
27685
|
+
}
|
|
27685
27686
|
const registryPath = path9.join(targetHome, ".claude", "plugins", "installed_plugins.json");
|
|
27686
27687
|
let records;
|
|
27687
27688
|
try {
|
|
@@ -27703,15 +27704,197 @@ function resolveClaudeMarketplaceRoot(opts = {}) {
|
|
|
27703
27704
|
} catch {
|
|
27704
27705
|
return null;
|
|
27705
27706
|
}
|
|
27706
|
-
return installPath;
|
|
27707
|
+
return { root: installPath, route: "registry-cache" };
|
|
27708
|
+
}
|
|
27709
|
+
function resolveClaudeMarketplaceRoot(opts = {}) {
|
|
27710
|
+
return resolveClaudeMarketplaceInstall(opts)?.root ?? null;
|
|
27711
|
+
}
|
|
27712
|
+
function readInstalledPluginVersion(opts = {}) {
|
|
27713
|
+
const targetHome = opts.targetHome ?? os5.homedir();
|
|
27714
|
+
const pluginKey = opts.pluginKey ?? DEFAULT_PLUGIN_KEY;
|
|
27715
|
+
const registryPath = path9.join(targetHome, ".claude", "plugins", "installed_plugins.json");
|
|
27716
|
+
let records;
|
|
27717
|
+
try {
|
|
27718
|
+
const parsed = JSON.parse(fs5.readFileSync(registryPath, "utf8"));
|
|
27719
|
+
records = parsed?.plugins?.[pluginKey];
|
|
27720
|
+
} catch {
|
|
27721
|
+
return null;
|
|
27722
|
+
}
|
|
27723
|
+
if (!Array.isArray(records) || records.length === 0)
|
|
27724
|
+
return null;
|
|
27725
|
+
return selectRecord(records)?.version ?? null;
|
|
27707
27726
|
}
|
|
27708
27727
|
var DEFAULT_PLUGIN_KEY = "massa-ai@massa-ai";
|
|
27709
27728
|
var init_claude_marketplace = () => {};
|
|
27710
27729
|
|
|
27711
|
-
// ../../packages/shared/dist/profile-switch/
|
|
27730
|
+
// ../../packages/shared/dist/profile-switch/frontmatter.js
|
|
27731
|
+
function parseFrontmatter(raw2) {
|
|
27732
|
+
const match = /^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/.exec(raw2);
|
|
27733
|
+
if (!match) {
|
|
27734
|
+
throw new Error("charter missing YAML frontmatter (--- ... ---) block");
|
|
27735
|
+
}
|
|
27736
|
+
const yamlText = match[1] ?? "";
|
|
27737
|
+
const body = (match[2] ?? "").replace(/^\r?\n/, "");
|
|
27738
|
+
const frontmatter = parseSimpleYaml(yamlText);
|
|
27739
|
+
return { frontmatter, body };
|
|
27740
|
+
}
|
|
27741
|
+
function parseSimpleYaml(text) {
|
|
27742
|
+
const result = {};
|
|
27743
|
+
const lines = text.split(/\r?\n/);
|
|
27744
|
+
let i = 0;
|
|
27745
|
+
while (i < lines.length) {
|
|
27746
|
+
const line = lines[i] ?? "";
|
|
27747
|
+
if (line.trim() === "" || line.trim().startsWith("#")) {
|
|
27748
|
+
i++;
|
|
27749
|
+
continue;
|
|
27750
|
+
}
|
|
27751
|
+
const m = /^([A-Za-z_][A-Za-z0-9_]*):\s*(.*)$/.exec(line);
|
|
27752
|
+
if (!m) {
|
|
27753
|
+
i++;
|
|
27754
|
+
continue;
|
|
27755
|
+
}
|
|
27756
|
+
const key = m[1];
|
|
27757
|
+
const rest = (m[2] ?? "").trim();
|
|
27758
|
+
if (rest !== "") {
|
|
27759
|
+
result[key] = unquoteScalar(rest);
|
|
27760
|
+
i++;
|
|
27761
|
+
continue;
|
|
27762
|
+
}
|
|
27763
|
+
const nested = {};
|
|
27764
|
+
i++;
|
|
27765
|
+
while (i < lines.length) {
|
|
27766
|
+
const nestedLine = lines[i] ?? "";
|
|
27767
|
+
if (/^\s{2,}\S/.test(nestedLine) === false)
|
|
27768
|
+
break;
|
|
27769
|
+
const nm = /^\s{2,}([A-Za-z_][A-Za-z0-9_]*):\s*(.*)$/.exec(nestedLine);
|
|
27770
|
+
if (!nm)
|
|
27771
|
+
break;
|
|
27772
|
+
nested[nm[1]] = unquoteScalar((nm[2] ?? "").trim());
|
|
27773
|
+
i++;
|
|
27774
|
+
}
|
|
27775
|
+
result[key] = nested;
|
|
27776
|
+
}
|
|
27777
|
+
return result;
|
|
27778
|
+
}
|
|
27779
|
+
function unquoteScalar(s) {
|
|
27780
|
+
if (s.startsWith('"') && s.endsWith('"') || s.startsWith("'") && s.endsWith("'")) {
|
|
27781
|
+
return s.slice(1, -1);
|
|
27782
|
+
}
|
|
27783
|
+
return s;
|
|
27784
|
+
}
|
|
27785
|
+
|
|
27786
|
+
// ../../packages/shared/dist/profile-switch/doctor.js
|
|
27712
27787
|
import fs6 from "fs";
|
|
27713
|
-
import path10 from "path";
|
|
27714
27788
|
import os6 from "os";
|
|
27789
|
+
import path10 from "path";
|
|
27790
|
+
function readTextFile(filePath) {
|
|
27791
|
+
try {
|
|
27792
|
+
return fs6.readFileSync(filePath, "utf8");
|
|
27793
|
+
} catch {
|
|
27794
|
+
return null;
|
|
27795
|
+
}
|
|
27796
|
+
}
|
|
27797
|
+
function readJsonFile(filePath) {
|
|
27798
|
+
const raw2 = readTextFile(filePath);
|
|
27799
|
+
if (raw2 === null)
|
|
27800
|
+
return null;
|
|
27801
|
+
try {
|
|
27802
|
+
return JSON.parse(raw2);
|
|
27803
|
+
} catch {
|
|
27804
|
+
return null;
|
|
27805
|
+
}
|
|
27806
|
+
}
|
|
27807
|
+
function readPluginVersion(pluginRoot) {
|
|
27808
|
+
const manifest = readJsonFile(path10.join(pluginRoot, ".claude-plugin", "plugin.json"));
|
|
27809
|
+
return typeof manifest?.version === "string" ? manifest.version : null;
|
|
27810
|
+
}
|
|
27811
|
+
function detectEnvOverride(env) {
|
|
27812
|
+
for (const name of ENV_OVERRIDE_VARS) {
|
|
27813
|
+
const value = env[name];
|
|
27814
|
+
if (typeof value === "string" && value.trim()) {
|
|
27815
|
+
return { name, value: value.trim() };
|
|
27816
|
+
}
|
|
27817
|
+
}
|
|
27818
|
+
return null;
|
|
27819
|
+
}
|
|
27820
|
+
function readRoles(liveRoot, activeProfile) {
|
|
27821
|
+
const agentsDir = path10.join(liveRoot, "agents");
|
|
27822
|
+
let entries;
|
|
27823
|
+
try {
|
|
27824
|
+
entries = fs6.readdirSync(agentsDir, { withFileTypes: true });
|
|
27825
|
+
} catch {
|
|
27826
|
+
return [];
|
|
27827
|
+
}
|
|
27828
|
+
const roles = [];
|
|
27829
|
+
for (const entry of entries) {
|
|
27830
|
+
if (!entry.isFile() || !entry.name.startsWith("massa-ai-") || !entry.name.endsWith(".md")) {
|
|
27831
|
+
continue;
|
|
27832
|
+
}
|
|
27833
|
+
const activeRaw = readTextFile(path10.join(agentsDir, entry.name));
|
|
27834
|
+
let model = null;
|
|
27835
|
+
let effort = null;
|
|
27836
|
+
if (activeRaw !== null) {
|
|
27837
|
+
try {
|
|
27838
|
+
const { frontmatter } = parseFrontmatter(activeRaw);
|
|
27839
|
+
model = typeof frontmatter.model === "string" ? frontmatter.model : null;
|
|
27840
|
+
effort = typeof frontmatter.effort === "string" ? frontmatter.effort : null;
|
|
27841
|
+
} catch {}
|
|
27842
|
+
}
|
|
27843
|
+
let staleVariant = false;
|
|
27844
|
+
if (activeProfile && activeRaw !== null) {
|
|
27845
|
+
const variantRaw = readTextFile(path10.join(liveRoot, "agent-profiles", activeProfile, entry.name));
|
|
27846
|
+
if (variantRaw !== null) {
|
|
27847
|
+
staleVariant = variantRaw !== activeRaw;
|
|
27848
|
+
}
|
|
27849
|
+
}
|
|
27850
|
+
roles.push({ name: entry.name, model, effort, staleVariant });
|
|
27851
|
+
}
|
|
27852
|
+
return roles.sort((a, b) => a.name.localeCompare(b.name));
|
|
27853
|
+
}
|
|
27854
|
+
function runtimeDriftReport(opts = {}) {
|
|
27855
|
+
const targetHome = opts.targetHome ?? os6.homedir();
|
|
27856
|
+
const stateFilePath = opts.stateFilePath ?? path10.join(targetHome, ".config", "massa-ai", "install-state.json");
|
|
27857
|
+
let state = opts.state ?? null;
|
|
27858
|
+
if (state === null) {
|
|
27859
|
+
try {
|
|
27860
|
+
state = readInstallState(stateFilePath);
|
|
27861
|
+
} catch {
|
|
27862
|
+
state = null;
|
|
27863
|
+
}
|
|
27864
|
+
}
|
|
27865
|
+
const platform = state?.platforms?.claude;
|
|
27866
|
+
const stateVersion = typeof platform?.plugin?.version === "string" ? platform.plugin.version : null;
|
|
27867
|
+
const activeProfile = platform?.modelProfile?.profile ?? null;
|
|
27868
|
+
const install = resolveClaudeMarketplaceInstall({ targetHome, pluginKey: opts.pluginKey });
|
|
27869
|
+
const liveRoot = install?.root ?? null;
|
|
27870
|
+
const sourceVersion = liveRoot === null ? null : readPluginVersion(liveRoot);
|
|
27871
|
+
const pinnedVersion = readInstalledPluginVersion({ targetHome, pluginKey: opts.pluginKey });
|
|
27872
|
+
const roles = liveRoot === null ? [] : readRoles(liveRoot, activeProfile);
|
|
27873
|
+
return {
|
|
27874
|
+
host: "claude",
|
|
27875
|
+
route: install?.route ?? "unresolved",
|
|
27876
|
+
liveRoot,
|
|
27877
|
+
sourceVersion,
|
|
27878
|
+
stateVersion,
|
|
27879
|
+
pinnedVersion,
|
|
27880
|
+
activeProfile,
|
|
27881
|
+
roles,
|
|
27882
|
+
envOverride: detectEnvOverride(opts.env ?? process.env),
|
|
27883
|
+
versionDrift: sourceVersion !== null && stateVersion !== null && sourceVersion !== stateVersion,
|
|
27884
|
+
profileMaterialized: roles.some((role) => role.staleVariant)
|
|
27885
|
+
};
|
|
27886
|
+
}
|
|
27887
|
+
var ENV_OVERRIDE_VARS;
|
|
27888
|
+
var init_doctor = __esm(() => {
|
|
27889
|
+
init_claude_marketplace();
|
|
27890
|
+
init_state();
|
|
27891
|
+
ENV_OVERRIDE_VARS = ["CLAUDE_CODE_SUBAGENT_MODEL"];
|
|
27892
|
+
});
|
|
27893
|
+
|
|
27894
|
+
// ../../packages/shared/dist/profile-switch/engine.js
|
|
27895
|
+
import fs7 from "fs";
|
|
27896
|
+
import path11 from "path";
|
|
27897
|
+
import os7 from "os";
|
|
27715
27898
|
import crypto4 from "crypto";
|
|
27716
27899
|
import { execFileSync as execFileSync2 } from "child_process";
|
|
27717
27900
|
function namedError3(name, message) {
|
|
@@ -27720,10 +27903,10 @@ function namedError3(name, message) {
|
|
|
27720
27903
|
return err;
|
|
27721
27904
|
}
|
|
27722
27905
|
function defaultStatePath(targetHome) {
|
|
27723
|
-
return
|
|
27906
|
+
return path11.join(targetHome, ".config", "massa-ai", "install-state.json");
|
|
27724
27907
|
}
|
|
27725
27908
|
function resolveCommon(opts) {
|
|
27726
|
-
const targetHome = opts.targetHome ??
|
|
27909
|
+
const targetHome = opts.targetHome ?? os7.homedir();
|
|
27727
27910
|
const stateFilePath = opts.stateFilePath ?? defaultStatePath(targetHome);
|
|
27728
27911
|
return { targetHome, stateFilePath };
|
|
27729
27912
|
}
|
|
@@ -27731,7 +27914,7 @@ function marketplaceRoots(targetHome, state) {
|
|
|
27731
27914
|
return state.platforms.claude?.installRoute === "marketplace" ? { claude: resolveClaudeMarketplaceRoot({ targetHome }) ?? undefined } : {};
|
|
27732
27915
|
}
|
|
27733
27916
|
function claudeMarketplaceUnresolvedReason(targetHome) {
|
|
27734
|
-
const registryPath =
|
|
27917
|
+
const registryPath = path11.join(targetHome, ".claude", "plugins", "installed_plugins.json");
|
|
27735
27918
|
return `claude installRoute is "marketplace" but no install root could be resolved from ${registryPath} ` + "\u2014 re-run the Claude plugin installer, or verify the plugin registry file";
|
|
27736
27919
|
}
|
|
27737
27920
|
function listProfiles(opts = {}) {
|
|
@@ -27739,6 +27922,12 @@ function listProfiles(opts = {}) {
|
|
|
27739
27922
|
const state = readInstallState(stateFilePath);
|
|
27740
27923
|
const roots = marketplaceRoots(targetHome, state);
|
|
27741
27924
|
const universe = opts.hosts ?? HOSTS;
|
|
27925
|
+
const claudeDrift = universe.includes("claude") ? runtimeDriftReport({ targetHome, stateFilePath, state, env: opts.env }) : null;
|
|
27926
|
+
const claudeDriftFields = (host) => host === "claude" && claudeDrift !== null ? {
|
|
27927
|
+
liveRoot: claudeDrift.liveRoot,
|
|
27928
|
+
sourceVersion: claudeDrift.sourceVersion,
|
|
27929
|
+
envOverride: claudeDrift.envOverride ? `${claudeDrift.envOverride.name}=${claudeDrift.envOverride.value}` : null
|
|
27930
|
+
} : { liveRoot: null, sourceVersion: null, envOverride: null };
|
|
27742
27931
|
const hosts = universe.map((host) => {
|
|
27743
27932
|
if (host === "claude" && state.platforms.claude?.installRoute === "marketplace" && roots.claude === undefined) {
|
|
27744
27933
|
const platform2 = state.platforms.claude;
|
|
@@ -27749,7 +27938,8 @@ function listProfiles(opts = {}) {
|
|
|
27749
27938
|
skipReason: null,
|
|
27750
27939
|
activeProfile: platform2.modelProfile?.profile ?? opts.hostDefaults?.[host] ?? "balanced",
|
|
27751
27940
|
bundleVersion: platform2.plugin?.version ?? null,
|
|
27752
|
-
availableProfiles: []
|
|
27941
|
+
availableProfiles: [],
|
|
27942
|
+
...claudeDriftFields(host)
|
|
27753
27943
|
};
|
|
27754
27944
|
}
|
|
27755
27945
|
const layout = resolveHostLayout(host, { targetHome, projectRoot: opts.projectRoot, marketplaceRoot: roots });
|
|
@@ -27761,10 +27951,11 @@ function listProfiles(opts = {}) {
|
|
|
27761
27951
|
skipReason: layout.reason,
|
|
27762
27952
|
activeProfile: null,
|
|
27763
27953
|
bundleVersion: null,
|
|
27764
|
-
availableProfiles: []
|
|
27954
|
+
availableProfiles: [],
|
|
27955
|
+
...claudeDriftFields(host)
|
|
27765
27956
|
};
|
|
27766
27957
|
}
|
|
27767
|
-
const installed =
|
|
27958
|
+
const installed = fs7.existsSync(layout.activeDir);
|
|
27768
27959
|
const availableProfiles = listVariantProfiles(layout);
|
|
27769
27960
|
const platform = state.platforms[host];
|
|
27770
27961
|
return {
|
|
@@ -27774,15 +27965,16 @@ function listProfiles(opts = {}) {
|
|
|
27774
27965
|
skipReason: null,
|
|
27775
27966
|
activeProfile: platform?.modelProfile?.profile ?? opts.hostDefaults?.[host] ?? "balanced",
|
|
27776
27967
|
bundleVersion: platform?.plugin?.version ?? null,
|
|
27777
|
-
availableProfiles
|
|
27968
|
+
availableProfiles,
|
|
27969
|
+
...claudeDriftFields(host)
|
|
27778
27970
|
};
|
|
27779
27971
|
});
|
|
27780
27972
|
return { hosts };
|
|
27781
27973
|
}
|
|
27782
27974
|
function listVariantProfiles(layout) {
|
|
27783
|
-
if (!
|
|
27975
|
+
if (!fs7.existsSync(layout.variantsRoot))
|
|
27784
27976
|
return [];
|
|
27785
|
-
return
|
|
27977
|
+
return fs7.readdirSync(layout.variantsRoot, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name).sort();
|
|
27786
27978
|
}
|
|
27787
27979
|
function matchesGlob(filename, glob) {
|
|
27788
27980
|
const starIdx = glob.indexOf("*");
|
|
@@ -27793,7 +27985,7 @@ function matchesGlob(filename, glob) {
|
|
|
27793
27985
|
return filename.length >= prefix.length + suffix.length && filename.startsWith(prefix) && filename.endsWith(suffix);
|
|
27794
27986
|
}
|
|
27795
27987
|
function matchingFileNames(dir, glob) {
|
|
27796
|
-
return
|
|
27988
|
+
return fs7.readdirSync(dir, { withFileTypes: true }).filter((e) => e.isFile() && matchesGlob(e.name, glob)).map((e) => e.name);
|
|
27797
27989
|
}
|
|
27798
27990
|
function detectGitAvailability(dir) {
|
|
27799
27991
|
try {
|
|
@@ -27819,7 +28011,7 @@ function gitTrackedFileNames(dir, filenames) {
|
|
|
27819
28011
|
}
|
|
27820
28012
|
}
|
|
27821
28013
|
function checkTrackedPathGuard(activeDir, filenames) {
|
|
27822
|
-
if (filenames.length === 0 || !
|
|
28014
|
+
if (filenames.length === 0 || !fs7.existsSync(activeDir))
|
|
27823
28015
|
return GUARD_PASS;
|
|
27824
28016
|
const availability = detectGitAvailability(activeDir);
|
|
27825
28017
|
if (availability === "no-git")
|
|
@@ -27830,53 +28022,53 @@ function checkTrackedPathGuard(activeDir, filenames) {
|
|
|
27830
28022
|
if (tracked.size === 0)
|
|
27831
28023
|
return GUARD_PASS;
|
|
27832
28024
|
const offending = filenames.find((name) => tracked.has(name));
|
|
27833
|
-
return { blocked: true, path:
|
|
28025
|
+
return { blocked: true, path: path11.join(activeDir, offending), unchecked: false };
|
|
27834
28026
|
}
|
|
27835
28027
|
function assertStateWritable(stateFilePath) {
|
|
27836
|
-
const dir =
|
|
28028
|
+
const dir = path11.dirname(stateFilePath);
|
|
27837
28029
|
try {
|
|
27838
|
-
|
|
28030
|
+
fs7.mkdirSync(dir, { recursive: true });
|
|
27839
28031
|
} catch (err) {
|
|
27840
28032
|
throw UnwritableInstallStateError(stateFilePath, err.message);
|
|
27841
28033
|
}
|
|
27842
|
-
const checkPath =
|
|
28034
|
+
const checkPath = fs7.existsSync(stateFilePath) ? stateFilePath : dir;
|
|
27843
28035
|
try {
|
|
27844
|
-
|
|
28036
|
+
fs7.accessSync(checkPath, fs7.constants.W_OK);
|
|
27845
28037
|
} catch (err) {
|
|
27846
28038
|
throw UnwritableInstallStateError(stateFilePath, err.message);
|
|
27847
28039
|
}
|
|
27848
28040
|
}
|
|
27849
28041
|
function copyFileRouteVariant(layout, variantDir) {
|
|
27850
|
-
|
|
28042
|
+
fs7.mkdirSync(layout.activeDir, { recursive: true });
|
|
27851
28043
|
let changed = 0;
|
|
27852
|
-
for (const entry of
|
|
28044
|
+
for (const entry of fs7.readdirSync(variantDir, { withFileTypes: true })) {
|
|
27853
28045
|
if (!entry.isFile() || !matchesGlob(entry.name, layout.activeGlob))
|
|
27854
28046
|
continue;
|
|
27855
|
-
|
|
28047
|
+
fs7.copyFileSync(path11.join(variantDir, entry.name), path11.join(layout.activeDir, entry.name));
|
|
27856
28048
|
changed++;
|
|
27857
28049
|
}
|
|
27858
28050
|
return changed;
|
|
27859
28051
|
}
|
|
27860
28052
|
function repointOpencodeVariant(layout, variantDir) {
|
|
27861
|
-
|
|
28053
|
+
fs7.mkdirSync(layout.activeDir, { recursive: true });
|
|
27862
28054
|
let changed = 0;
|
|
27863
|
-
for (const entry of
|
|
28055
|
+
for (const entry of fs7.readdirSync(variantDir, { withFileTypes: true })) {
|
|
27864
28056
|
if (!entry.isFile() || !matchesGlob(entry.name, layout.activeGlob))
|
|
27865
28057
|
continue;
|
|
27866
|
-
const dest =
|
|
27867
|
-
const target =
|
|
28058
|
+
const dest = path11.join(layout.activeDir, entry.name);
|
|
28059
|
+
const target = path11.resolve(path11.join(variantDir, entry.name));
|
|
27868
28060
|
let destExists = true;
|
|
27869
28061
|
let destIsSymlink = false;
|
|
27870
28062
|
try {
|
|
27871
|
-
destIsSymlink =
|
|
28063
|
+
destIsSymlink = fs7.lstatSync(dest).isSymbolicLink();
|
|
27872
28064
|
} catch {
|
|
27873
28065
|
destExists = false;
|
|
27874
28066
|
}
|
|
27875
28067
|
if (destExists && !destIsSymlink)
|
|
27876
28068
|
continue;
|
|
27877
28069
|
const tmp = `${dest}.massa-ai-switch.${crypto4.randomUUID()}`;
|
|
27878
|
-
|
|
27879
|
-
|
|
28070
|
+
fs7.symlinkSync(target, tmp);
|
|
28071
|
+
fs7.renameSync(tmp, dest);
|
|
27880
28072
|
changed++;
|
|
27881
28073
|
}
|
|
27882
28074
|
return changed;
|
|
@@ -27916,13 +28108,13 @@ function switchProfile(opts) {
|
|
|
27916
28108
|
if (fileHosts.length === 0) {
|
|
27917
28109
|
return { profile: opts.profile, dryRun, hosts: orderRows(universe, skipRows), restartRequired: false };
|
|
27918
28110
|
}
|
|
27919
|
-
const installedFileHosts = fileHosts.filter((h) =>
|
|
28111
|
+
const installedFileHosts = fileHosts.filter((h) => fs7.existsSync(h.layout.activeDir));
|
|
27920
28112
|
if (installedFileHosts.length === 0)
|
|
27921
28113
|
throw NoHostsDetectedError();
|
|
27922
28114
|
const withAvailability = fileHosts.map((h) => {
|
|
27923
|
-
const variantsRootExists =
|
|
28115
|
+
const variantsRootExists = fs7.existsSync(h.layout.variantsRoot);
|
|
27924
28116
|
const variantDir = h.layout.variantDir(opts.profile);
|
|
27925
|
-
const available = variantsRootExists &&
|
|
28117
|
+
const available = variantsRootExists && fs7.existsSync(variantDir) && fs7.statSync(variantDir).isDirectory();
|
|
27926
28118
|
return { ...h, variantsRootExists, variantDir, available };
|
|
27927
28119
|
});
|
|
27928
28120
|
if (!withAvailability.some((h) => h.available)) {
|
|
@@ -27958,7 +28150,7 @@ function switchProfile(opts) {
|
|
|
27958
28150
|
continue;
|
|
27959
28151
|
}
|
|
27960
28152
|
if (dryRun) {
|
|
27961
|
-
rows.push({ host: h.host, status: "
|
|
28153
|
+
rows.push({ host: h.host, status: "would-switch" });
|
|
27962
28154
|
continue;
|
|
27963
28155
|
}
|
|
27964
28156
|
const candidateNames = matchingFileNames(h.variantDir, h.layout.activeGlob);
|
|
@@ -28003,6 +28195,7 @@ var init_engine = __esm(() => {
|
|
|
28003
28195
|
init_state();
|
|
28004
28196
|
init_lock();
|
|
28005
28197
|
init_claude_marketplace();
|
|
28198
|
+
init_doctor();
|
|
28006
28199
|
SwitchEngineError = class SwitchEngineError extends Error {
|
|
28007
28200
|
constructor(message) {
|
|
28008
28201
|
super(message);
|
|
@@ -28015,29 +28208,29 @@ var init_engine = __esm(() => {
|
|
|
28015
28208
|
|
|
28016
28209
|
// ../../packages/shared/dist/profile-switch/report.js
|
|
28017
28210
|
function reportSucceeded(report) {
|
|
28018
|
-
return report.hosts.every((h) => h.status === "switched" || h.status === "skipped");
|
|
28211
|
+
return report.hosts.every((h) => h.status === "switched" || h.status === "would-switch" || h.status === "skipped");
|
|
28019
28212
|
}
|
|
28020
28213
|
|
|
28021
28214
|
// ../../packages/shared/dist/profile-switch/variant-sync.js
|
|
28022
|
-
import
|
|
28023
|
-
import
|
|
28024
|
-
import
|
|
28215
|
+
import fs8 from "fs";
|
|
28216
|
+
import path12 from "path";
|
|
28217
|
+
import os8 from "os";
|
|
28025
28218
|
import crypto5 from "crypto";
|
|
28026
28219
|
function defaultStatePath2(targetHome) {
|
|
28027
|
-
return
|
|
28220
|
+
return path12.join(targetHome, ".config", "massa-ai", "install-state.json");
|
|
28028
28221
|
}
|
|
28029
28222
|
function marketplaceRoots2(targetHome, state) {
|
|
28030
28223
|
return state.platforms.claude?.installRoute === "marketplace" ? { claude: resolveClaudeMarketplaceRoot({ targetHome }) ?? undefined } : {};
|
|
28031
28224
|
}
|
|
28032
28225
|
function writeFileIntoDirAtomically(destDir, destName, content) {
|
|
28033
28226
|
const unique = `${process.pid}.${++tempFileCounter2}.${crypto5.randomBytes(6).toString("hex")}`;
|
|
28034
|
-
const tempFile =
|
|
28227
|
+
const tempFile = path12.join(destDir, `.${destName}.${unique}.tmp`);
|
|
28035
28228
|
try {
|
|
28036
|
-
|
|
28037
|
-
|
|
28229
|
+
fs8.writeFileSync(tempFile, content);
|
|
28230
|
+
fs8.renameSync(tempFile, path12.join(destDir, destName));
|
|
28038
28231
|
} catch (error51) {
|
|
28039
28232
|
try {
|
|
28040
|
-
|
|
28233
|
+
fs8.unlinkSync(tempFile);
|
|
28041
28234
|
} catch {}
|
|
28042
28235
|
throw error51;
|
|
28043
28236
|
}
|
|
@@ -28045,20 +28238,20 @@ function writeFileIntoDirAtomically(destDir, destName, content) {
|
|
|
28045
28238
|
function isSafeDirName(name) {
|
|
28046
28239
|
if (name === "." || name === "..")
|
|
28047
28240
|
return false;
|
|
28048
|
-
if (name.includes("/") || name.includes("\\") || name.includes(
|
|
28241
|
+
if (name.includes("/") || name.includes("\\") || name.includes(path12.sep))
|
|
28049
28242
|
return false;
|
|
28050
|
-
return
|
|
28243
|
+
return path12.basename(name) === name;
|
|
28051
28244
|
}
|
|
28052
28245
|
function syncHost(host, sourceRoot, targetHome, marketplaceRoot) {
|
|
28053
28246
|
const layout = resolveHostLayout(host, { targetHome, marketplaceRoot });
|
|
28054
28247
|
if (layout.route === "skip") {
|
|
28055
28248
|
return { host, status: "skipped", profiles: [], retained: [], files: 0, reason: layout.reason };
|
|
28056
28249
|
}
|
|
28057
|
-
const srcDir =
|
|
28058
|
-
if (!
|
|
28250
|
+
const srcDir = path12.join(sourceRoot, "apps", `${host}-plugin`, "agent-profiles");
|
|
28251
|
+
if (!fs8.existsSync(srcDir) || !fs8.statSync(srcDir).isDirectory()) {
|
|
28059
28252
|
return { host, status: "skipped", profiles: [], retained: [], files: 0, reason: "no generated variants for this host" };
|
|
28060
28253
|
}
|
|
28061
|
-
if (!
|
|
28254
|
+
if (!fs8.existsSync(layout.variantsRoot)) {
|
|
28062
28255
|
return {
|
|
28063
28256
|
host,
|
|
28064
28257
|
status: "skipped",
|
|
@@ -28070,24 +28263,24 @@ function syncHost(host, sourceRoot, targetHome, marketplaceRoot) {
|
|
|
28070
28263
|
}
|
|
28071
28264
|
const profiles = [];
|
|
28072
28265
|
let files = 0;
|
|
28073
|
-
for (const entry of
|
|
28266
|
+
for (const entry of fs8.readdirSync(srcDir, { withFileTypes: true })) {
|
|
28074
28267
|
if (!entry.isDirectory())
|
|
28075
28268
|
continue;
|
|
28076
28269
|
if (!isSafeDirName(entry.name))
|
|
28077
28270
|
continue;
|
|
28078
|
-
const srcProfileDir =
|
|
28079
|
-
const destProfileDir =
|
|
28080
|
-
|
|
28081
|
-
for (const fileEntry of
|
|
28271
|
+
const srcProfileDir = path12.join(srcDir, entry.name);
|
|
28272
|
+
const destProfileDir = path12.join(layout.variantsRoot, entry.name);
|
|
28273
|
+
fs8.mkdirSync(destProfileDir, { recursive: true });
|
|
28274
|
+
for (const fileEntry of fs8.readdirSync(srcProfileDir, { withFileTypes: true })) {
|
|
28082
28275
|
if (!fileEntry.isFile())
|
|
28083
28276
|
continue;
|
|
28084
|
-
const content =
|
|
28277
|
+
const content = fs8.readFileSync(path12.join(srcProfileDir, fileEntry.name));
|
|
28085
28278
|
writeFileIntoDirAtomically(destProfileDir, fileEntry.name, content);
|
|
28086
28279
|
files++;
|
|
28087
28280
|
}
|
|
28088
28281
|
profiles.push(entry.name);
|
|
28089
28282
|
}
|
|
28090
|
-
const retained =
|
|
28283
|
+
const retained = fs8.readdirSync(layout.variantsRoot, { withFileTypes: true }).filter((e) => e.isDirectory() && !profiles.includes(e.name)).map((e) => e.name).sort();
|
|
28091
28284
|
return { host, status: "synced", profiles: profiles.sort(), retained, files };
|
|
28092
28285
|
}
|
|
28093
28286
|
function syncGeneratedVariants(opts) {
|
|
@@ -28103,7 +28296,7 @@ function syncGeneratedVariants(opts) {
|
|
|
28103
28296
|
}));
|
|
28104
28297
|
}
|
|
28105
28298
|
const sourceRoot = opts.sourceRoot;
|
|
28106
|
-
const targetHome = opts.targetHome ??
|
|
28299
|
+
const targetHome = opts.targetHome ?? os8.homedir();
|
|
28107
28300
|
const state = readInstallState(defaultStatePath2(targetHome));
|
|
28108
28301
|
const roots = marketplaceRoots2(targetHome, state);
|
|
28109
28302
|
return hosts.map((host) => {
|
|
@@ -28122,14 +28315,14 @@ var init_variant_sync = __esm(() => {
|
|
|
28122
28315
|
});
|
|
28123
28316
|
|
|
28124
28317
|
// ../../packages/shared/dist/profile-switch/repo-root.js
|
|
28125
|
-
import
|
|
28126
|
-
import
|
|
28318
|
+
import fs9 from "fs";
|
|
28319
|
+
import path13 from "path";
|
|
28127
28320
|
function findRepoRootWithMarker(startDir, marker, maxLevels) {
|
|
28128
28321
|
let dir = startDir;
|
|
28129
28322
|
for (let i = 0;i <= maxLevels; i++) {
|
|
28130
|
-
if (
|
|
28323
|
+
if (fs9.existsSync(path13.join(dir, marker)))
|
|
28131
28324
|
return dir;
|
|
28132
|
-
const parent =
|
|
28325
|
+
const parent = path13.dirname(dir);
|
|
28133
28326
|
if (parent === dir)
|
|
28134
28327
|
break;
|
|
28135
28328
|
dir = parent;
|
|
@@ -28227,7 +28420,7 @@ var init_rules = __esm(() => {
|
|
|
28227
28420
|
});
|
|
28228
28421
|
|
|
28229
28422
|
// ../../packages/shared/dist/bootstrap/state.js
|
|
28230
|
-
import
|
|
28423
|
+
import fs10 from "fs";
|
|
28231
28424
|
function isPlainObject4(value) {
|
|
28232
28425
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
28233
28426
|
}
|
|
@@ -28258,7 +28451,7 @@ function resolveBootstrapState(doc2) {
|
|
|
28258
28451
|
}
|
|
28259
28452
|
function readConfigBytes() {
|
|
28260
28453
|
try {
|
|
28261
|
-
return
|
|
28454
|
+
return fs10.readFileSync(getConfigPath(), "utf-8");
|
|
28262
28455
|
} catch (error51) {
|
|
28263
28456
|
if (error51?.code === "ENOENT")
|
|
28264
28457
|
return "";
|
|
@@ -28313,7 +28506,7 @@ var init_state2 = __esm(() => {
|
|
|
28313
28506
|
});
|
|
28314
28507
|
|
|
28315
28508
|
// ../../packages/shared/dist/bootstrap/render.js
|
|
28316
|
-
import
|
|
28509
|
+
import path14 from "path";
|
|
28317
28510
|
function wrapBootstrapBlock(body) {
|
|
28318
28511
|
return `${BOOTSTRAP_BLOCK_START}
|
|
28319
28512
|
${body.replace(/\n+$/, "")}
|
|
@@ -28326,19 +28519,19 @@ function ruleMarker(id, suffix) {
|
|
|
28326
28519
|
function resolveHostRoot(host, targetHome, hostRoot) {
|
|
28327
28520
|
requireAbsoluteTargetHome(targetHome);
|
|
28328
28521
|
if (hostRoot === undefined)
|
|
28329
|
-
return
|
|
28330
|
-
const relative =
|
|
28331
|
-
if (!
|
|
28522
|
+
return path14.join(targetHome, ...HOST_CONFIG_DIR[host]);
|
|
28523
|
+
const relative = path14.relative(targetHome, hostRoot);
|
|
28524
|
+
if (!path14.isAbsolute(hostRoot) || relative === "" || relative.startsWith("..") || path14.isAbsolute(relative)) {
|
|
28332
28525
|
throw new BootstrapRenderError("HostRootOutsideTargetHomeError", `hostRoot must be an absolute directory inside targetHome, got "${hostRoot}" for targetHome "${targetHome}"`, [hostRoot, targetHome]);
|
|
28333
28526
|
}
|
|
28334
28527
|
return hostRoot;
|
|
28335
28528
|
}
|
|
28336
28529
|
function bootstrapContractPath(host, targetHome, hostRoot) {
|
|
28337
|
-
return
|
|
28530
|
+
return path14.join(resolveHostRoot(host, targetHome, hostRoot), CONTRACT_FILENAME);
|
|
28338
28531
|
}
|
|
28339
28532
|
function bootstrapStateFilePath(targetHome) {
|
|
28340
28533
|
requireAbsoluteTargetHome(targetHome);
|
|
28341
|
-
return
|
|
28534
|
+
return path14.join(targetHome, ".config", "massa-ai", "config.json");
|
|
28342
28535
|
}
|
|
28343
28536
|
function renderBootstrap(options) {
|
|
28344
28537
|
const { source, state, host, targetHome, hostRoot } = options;
|
|
@@ -28361,7 +28554,7 @@ ${body}`;
|
|
|
28361
28554
|
return { contract, pointer };
|
|
28362
28555
|
}
|
|
28363
28556
|
function requireAbsoluteTargetHome(targetHome) {
|
|
28364
|
-
if (!
|
|
28557
|
+
if (!path14.isAbsolute(targetHome)) {
|
|
28365
28558
|
throw new BootstrapRenderError("TargetHomeNotAbsoluteError", `targetHome must be an absolute path, got "${targetHome}"`, [targetHome]);
|
|
28366
28559
|
}
|
|
28367
28560
|
}
|
|
@@ -28538,14 +28731,14 @@ var init_report = __esm(() => {
|
|
|
28538
28731
|
});
|
|
28539
28732
|
|
|
28540
28733
|
// ../../packages/shared/dist/bootstrap/engine.js
|
|
28541
|
-
import
|
|
28542
|
-
import
|
|
28734
|
+
import fs11 from "fs";
|
|
28735
|
+
import path15 from "path";
|
|
28543
28736
|
function applyBootstrapState(options) {
|
|
28544
28737
|
const { targetHome } = options;
|
|
28545
28738
|
const dryRun = options.dryRun ?? false;
|
|
28546
28739
|
const warn = options.onWarning ?? ((message) => console.warn(message));
|
|
28547
28740
|
const configPath = bootstrapStateFilePath(targetHome);
|
|
28548
|
-
const installStatePath =
|
|
28741
|
+
const installStatePath = path15.join(path15.dirname(configPath), INSTALL_STATE_FILENAME);
|
|
28549
28742
|
const { platforms } = readInstallState(installStatePath);
|
|
28550
28743
|
const installed = HOSTS.filter((host) => platforms[host] !== undefined);
|
|
28551
28744
|
if (installed.length === 0) {
|
|
@@ -28638,22 +28831,22 @@ function applyHost(input) {
|
|
|
28638
28831
|
}
|
|
28639
28832
|
function wiringArtifact(host, targetHome, hostRoot) {
|
|
28640
28833
|
const root = resolveHostRoot(host, targetHome, hostRoot);
|
|
28641
|
-
const contractPath =
|
|
28834
|
+
const contractPath = path15.join(root, CONTRACT_FILENAME);
|
|
28642
28835
|
switch (host) {
|
|
28643
28836
|
case "claude":
|
|
28644
|
-
return { file:
|
|
28837
|
+
return { file: path15.join(root, "CLAUDE.md"), token: `@${CONTRACT_FILENAME}` };
|
|
28645
28838
|
case "codex":
|
|
28646
28839
|
case "cursor":
|
|
28647
|
-
return { file:
|
|
28840
|
+
return { file: path15.join(root, "AGENTS.md"), token: contractPath };
|
|
28648
28841
|
case "opencode":
|
|
28649
28842
|
return { file: openCodeConfigPath(root), token: `"${contractPath}"` };
|
|
28650
28843
|
}
|
|
28651
28844
|
}
|
|
28652
28845
|
function openCodeConfigPath(root) {
|
|
28653
|
-
const json2 =
|
|
28654
|
-
if (
|
|
28846
|
+
const json2 = path15.join(root, "opencode.json");
|
|
28847
|
+
if (fs11.existsSync(json2))
|
|
28655
28848
|
return json2;
|
|
28656
|
-
return
|
|
28849
|
+
return path15.join(root, "opencode.jsonc");
|
|
28657
28850
|
}
|
|
28658
28851
|
function isWired(host, targetHome, hostRoot) {
|
|
28659
28852
|
const artifact = wiringArtifact(host, targetHome, hostRoot);
|
|
@@ -28666,7 +28859,7 @@ function notWiredReason(host, targetHome, hostRoot) {
|
|
|
28666
28859
|
}
|
|
28667
28860
|
function readFileOrNull(filePath) {
|
|
28668
28861
|
try {
|
|
28669
|
-
return
|
|
28862
|
+
return fs11.readFileSync(filePath, "utf-8");
|
|
28670
28863
|
} catch {
|
|
28671
28864
|
return null;
|
|
28672
28865
|
}
|
|
@@ -30272,7 +30465,7 @@ var import_brace_expansion, minimatch = (p, pattern, options = {}) => {
|
|
|
30272
30465
|
}, qmarksTestNoExtDot = ([$0]) => {
|
|
30273
30466
|
const len = $0.length;
|
|
30274
30467
|
return (f) => f.length === len && f !== "." && f !== "..";
|
|
30275
|
-
}, defaultPlatform,
|
|
30468
|
+
}, defaultPlatform, path16, 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) => {
|
|
30276
30469
|
if (!def || typeof def !== "object" || !Object.keys(def).length) {
|
|
30277
30470
|
return minimatch;
|
|
30278
30471
|
}
|
|
@@ -30330,11 +30523,11 @@ var init_esm = __esm(() => {
|
|
|
30330
30523
|
starRE = /^\*+$/;
|
|
30331
30524
|
qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
|
|
30332
30525
|
defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
30333
|
-
|
|
30526
|
+
path16 = {
|
|
30334
30527
|
win32: { sep: "\\" },
|
|
30335
30528
|
posix: { sep: "/" }
|
|
30336
30529
|
};
|
|
30337
|
-
sep = defaultPlatform === "win32" ?
|
|
30530
|
+
sep = defaultPlatform === "win32" ? path16.win32.sep : path16.posix.sep;
|
|
30338
30531
|
minimatch.sep = sep;
|
|
30339
30532
|
GLOBSTAR = Symbol("globstar **");
|
|
30340
30533
|
minimatch.GLOBSTAR = GLOBSTAR;
|
|
@@ -32300,12 +32493,12 @@ var init_esm4 = __esm(() => {
|
|
|
32300
32493
|
childrenCache() {
|
|
32301
32494
|
return this.#children;
|
|
32302
32495
|
}
|
|
32303
|
-
resolve(
|
|
32304
|
-
if (!
|
|
32496
|
+
resolve(path17) {
|
|
32497
|
+
if (!path17) {
|
|
32305
32498
|
return this;
|
|
32306
32499
|
}
|
|
32307
|
-
const rootPath = this.getRootString(
|
|
32308
|
-
const dir =
|
|
32500
|
+
const rootPath = this.getRootString(path17);
|
|
32501
|
+
const dir = path17.substring(rootPath.length);
|
|
32309
32502
|
const dirParts = dir.split(this.splitSep);
|
|
32310
32503
|
const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
|
|
32311
32504
|
return result;
|
|
@@ -32833,8 +33026,8 @@ var init_esm4 = __esm(() => {
|
|
|
32833
33026
|
newChild(name, type = UNKNOWN, opts = {}) {
|
|
32834
33027
|
return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
|
|
32835
33028
|
}
|
|
32836
|
-
getRootString(
|
|
32837
|
-
return win32.parse(
|
|
33029
|
+
getRootString(path17) {
|
|
33030
|
+
return win32.parse(path17).root;
|
|
32838
33031
|
}
|
|
32839
33032
|
getRoot(rootPath) {
|
|
32840
33033
|
rootPath = uncToDrive(rootPath.toUpperCase());
|
|
@@ -32859,8 +33052,8 @@ var init_esm4 = __esm(() => {
|
|
|
32859
33052
|
constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
|
|
32860
33053
|
super(name, type, root, roots, nocase, children, opts);
|
|
32861
33054
|
}
|
|
32862
|
-
getRootString(
|
|
32863
|
-
return
|
|
33055
|
+
getRootString(path17) {
|
|
33056
|
+
return path17.startsWith("/") ? "/" : "";
|
|
32864
33057
|
}
|
|
32865
33058
|
getRoot(_rootPath) {
|
|
32866
33059
|
return this.root;
|
|
@@ -32879,8 +33072,8 @@ var init_esm4 = __esm(() => {
|
|
|
32879
33072
|
#children;
|
|
32880
33073
|
nocase;
|
|
32881
33074
|
#fs;
|
|
32882
|
-
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs:
|
|
32883
|
-
this.#fs = fsFromOption(
|
|
33075
|
+
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs12 = defaultFS } = {}) {
|
|
33076
|
+
this.#fs = fsFromOption(fs12);
|
|
32884
33077
|
if (cwd instanceof URL || cwd.startsWith("file://")) {
|
|
32885
33078
|
cwd = fileURLToPath(cwd);
|
|
32886
33079
|
}
|
|
@@ -32916,11 +33109,11 @@ var init_esm4 = __esm(() => {
|
|
|
32916
33109
|
}
|
|
32917
33110
|
this.cwd = prev;
|
|
32918
33111
|
}
|
|
32919
|
-
depth(
|
|
32920
|
-
if (typeof
|
|
32921
|
-
|
|
33112
|
+
depth(path17 = this.cwd) {
|
|
33113
|
+
if (typeof path17 === "string") {
|
|
33114
|
+
path17 = this.cwd.resolve(path17);
|
|
32922
33115
|
}
|
|
32923
|
-
return
|
|
33116
|
+
return path17.depth();
|
|
32924
33117
|
}
|
|
32925
33118
|
childrenCache() {
|
|
32926
33119
|
return this.#children;
|
|
@@ -33336,9 +33529,9 @@ var init_esm4 = __esm(() => {
|
|
|
33336
33529
|
process4();
|
|
33337
33530
|
return results;
|
|
33338
33531
|
}
|
|
33339
|
-
chdir(
|
|
33532
|
+
chdir(path17 = this.cwd) {
|
|
33340
33533
|
const oldCwd = this.cwd;
|
|
33341
|
-
this.cwd = typeof
|
|
33534
|
+
this.cwd = typeof path17 === "string" ? this.cwd.resolve(path17) : path17;
|
|
33342
33535
|
this.cwd[setAsCwd](oldCwd);
|
|
33343
33536
|
}
|
|
33344
33537
|
};
|
|
@@ -33355,8 +33548,8 @@ var init_esm4 = __esm(() => {
|
|
|
33355
33548
|
parseRootPath(dir) {
|
|
33356
33549
|
return win32.parse(dir).root.toUpperCase();
|
|
33357
33550
|
}
|
|
33358
|
-
newRoot(
|
|
33359
|
-
return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
33551
|
+
newRoot(fs12) {
|
|
33552
|
+
return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs12 });
|
|
33360
33553
|
}
|
|
33361
33554
|
isAbsolute(p) {
|
|
33362
33555
|
return p.startsWith("/") || p.startsWith("\\") || /^[a-z]:(\/|\\)/i.test(p);
|
|
@@ -33372,8 +33565,8 @@ var init_esm4 = __esm(() => {
|
|
|
33372
33565
|
parseRootPath(_dir) {
|
|
33373
33566
|
return "/";
|
|
33374
33567
|
}
|
|
33375
|
-
newRoot(
|
|
33376
|
-
return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
33568
|
+
newRoot(fs12) {
|
|
33569
|
+
return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs12 });
|
|
33377
33570
|
}
|
|
33378
33571
|
isAbsolute(p) {
|
|
33379
33572
|
return p.startsWith("/");
|
|
@@ -33630,8 +33823,8 @@ class MatchRecord {
|
|
|
33630
33823
|
this.store.set(target, current === undefined ? n : n & current);
|
|
33631
33824
|
}
|
|
33632
33825
|
entries() {
|
|
33633
|
-
return [...this.store.entries()].map(([
|
|
33634
|
-
|
|
33826
|
+
return [...this.store.entries()].map(([path17, n]) => [
|
|
33827
|
+
path17,
|
|
33635
33828
|
!!(n & 2),
|
|
33636
33829
|
!!(n & 1)
|
|
33637
33830
|
]);
|
|
@@ -33835,9 +34028,9 @@ class GlobUtil {
|
|
|
33835
34028
|
signal;
|
|
33836
34029
|
maxDepth;
|
|
33837
34030
|
includeChildMatches;
|
|
33838
|
-
constructor(patterns,
|
|
34031
|
+
constructor(patterns, path17, opts) {
|
|
33839
34032
|
this.patterns = patterns;
|
|
33840
|
-
this.path =
|
|
34033
|
+
this.path = path17;
|
|
33841
34034
|
this.opts = opts;
|
|
33842
34035
|
this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
|
|
33843
34036
|
this.includeChildMatches = opts.includeChildMatches !== false;
|
|
@@ -33856,11 +34049,11 @@ class GlobUtil {
|
|
|
33856
34049
|
});
|
|
33857
34050
|
}
|
|
33858
34051
|
}
|
|
33859
|
-
#ignored(
|
|
33860
|
-
return this.seen.has(
|
|
34052
|
+
#ignored(path17) {
|
|
34053
|
+
return this.seen.has(path17) || !!this.#ignore?.ignored?.(path17);
|
|
33861
34054
|
}
|
|
33862
|
-
#childrenIgnored(
|
|
33863
|
-
return !!this.#ignore?.childrenIgnored?.(
|
|
34055
|
+
#childrenIgnored(path17) {
|
|
34056
|
+
return !!this.#ignore?.childrenIgnored?.(path17);
|
|
33864
34057
|
}
|
|
33865
34058
|
pause() {
|
|
33866
34059
|
this.paused = true;
|
|
@@ -34077,8 +34270,8 @@ var init_walker = __esm(() => {
|
|
|
34077
34270
|
init_processor();
|
|
34078
34271
|
GlobWalker = class GlobWalker extends GlobUtil {
|
|
34079
34272
|
matches = new Set;
|
|
34080
|
-
constructor(patterns,
|
|
34081
|
-
super(patterns,
|
|
34273
|
+
constructor(patterns, path17, opts) {
|
|
34274
|
+
super(patterns, path17, opts);
|
|
34082
34275
|
}
|
|
34083
34276
|
matchEmit(e) {
|
|
34084
34277
|
this.matches.add(e);
|
|
@@ -34115,8 +34308,8 @@ var init_walker = __esm(() => {
|
|
|
34115
34308
|
};
|
|
34116
34309
|
GlobStream = class GlobStream extends GlobUtil {
|
|
34117
34310
|
results;
|
|
34118
|
-
constructor(patterns,
|
|
34119
|
-
super(patterns,
|
|
34311
|
+
constructor(patterns, path17, opts) {
|
|
34312
|
+
super(patterns, path17, opts);
|
|
34120
34313
|
this.results = new Minipass({
|
|
34121
34314
|
signal: this.signal,
|
|
34122
34315
|
objectMode: true
|
|
@@ -34544,20 +34737,20 @@ var require_ignore = __commonJS((exports, module) => {
|
|
|
34544
34737
|
var throwError = (message, Ctor) => {
|
|
34545
34738
|
throw new Ctor(message);
|
|
34546
34739
|
};
|
|
34547
|
-
var checkPath = (
|
|
34548
|
-
if (!isString(
|
|
34740
|
+
var checkPath = (path17, originalPath, doThrow) => {
|
|
34741
|
+
if (!isString(path17)) {
|
|
34549
34742
|
return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError);
|
|
34550
34743
|
}
|
|
34551
|
-
if (!
|
|
34744
|
+
if (!path17) {
|
|
34552
34745
|
return doThrow(`path must not be empty`, TypeError);
|
|
34553
34746
|
}
|
|
34554
|
-
if (checkPath.isNotRelative(
|
|
34747
|
+
if (checkPath.isNotRelative(path17)) {
|
|
34555
34748
|
const r = "`path.relative()`d";
|
|
34556
34749
|
return doThrow(`path should be a ${r} string, but got "${originalPath}"`, RangeError);
|
|
34557
34750
|
}
|
|
34558
34751
|
return true;
|
|
34559
34752
|
};
|
|
34560
|
-
var isNotRelative = (
|
|
34753
|
+
var isNotRelative = (path17) => REGEX_TEST_INVALID_PATH.test(path17);
|
|
34561
34754
|
checkPath.isNotRelative = isNotRelative;
|
|
34562
34755
|
checkPath.convert = (p) => p;
|
|
34563
34756
|
|
|
@@ -34600,7 +34793,7 @@ var require_ignore = __commonJS((exports, module) => {
|
|
|
34600
34793
|
addPattern(pattern) {
|
|
34601
34794
|
return this.add(pattern);
|
|
34602
34795
|
}
|
|
34603
|
-
_testOne(
|
|
34796
|
+
_testOne(path17, checkUnignored) {
|
|
34604
34797
|
let ignored = false;
|
|
34605
34798
|
let unignored = false;
|
|
34606
34799
|
this._rules.forEach((rule) => {
|
|
@@ -34608,7 +34801,7 @@ var require_ignore = __commonJS((exports, module) => {
|
|
|
34608
34801
|
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
|
|
34609
34802
|
return;
|
|
34610
34803
|
}
|
|
34611
|
-
const matched = rule.regex.test(
|
|
34804
|
+
const matched = rule.regex.test(path17);
|
|
34612
34805
|
if (matched) {
|
|
34613
34806
|
ignored = !negative;
|
|
34614
34807
|
unignored = negative;
|
|
@@ -34620,39 +34813,39 @@ var require_ignore = __commonJS((exports, module) => {
|
|
|
34620
34813
|
};
|
|
34621
34814
|
}
|
|
34622
34815
|
_test(originalPath, cache, checkUnignored, slices) {
|
|
34623
|
-
const
|
|
34624
|
-
checkPath(
|
|
34625
|
-
return this._t(
|
|
34816
|
+
const path17 = originalPath && checkPath.convert(originalPath);
|
|
34817
|
+
checkPath(path17, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
|
|
34818
|
+
return this._t(path17, cache, checkUnignored, slices);
|
|
34626
34819
|
}
|
|
34627
|
-
_t(
|
|
34628
|
-
if (
|
|
34629
|
-
return cache[
|
|
34820
|
+
_t(path17, cache, checkUnignored, slices) {
|
|
34821
|
+
if (path17 in cache) {
|
|
34822
|
+
return cache[path17];
|
|
34630
34823
|
}
|
|
34631
34824
|
if (!slices) {
|
|
34632
|
-
slices =
|
|
34825
|
+
slices = path17.split(SLASH2);
|
|
34633
34826
|
}
|
|
34634
34827
|
slices.pop();
|
|
34635
34828
|
if (!slices.length) {
|
|
34636
|
-
return cache[
|
|
34829
|
+
return cache[path17] = this._testOne(path17, checkUnignored);
|
|
34637
34830
|
}
|
|
34638
34831
|
const parent = this._t(slices.join(SLASH2) + SLASH2, cache, checkUnignored, slices);
|
|
34639
|
-
return cache[
|
|
34832
|
+
return cache[path17] = parent.ignored ? parent : this._testOne(path17, checkUnignored);
|
|
34640
34833
|
}
|
|
34641
|
-
ignores(
|
|
34642
|
-
return this._test(
|
|
34834
|
+
ignores(path17) {
|
|
34835
|
+
return this._test(path17, this._ignoreCache, false).ignored;
|
|
34643
34836
|
}
|
|
34644
34837
|
createFilter() {
|
|
34645
|
-
return (
|
|
34838
|
+
return (path17) => !this.ignores(path17);
|
|
34646
34839
|
}
|
|
34647
34840
|
filter(paths) {
|
|
34648
34841
|
return makeArray(paths).filter(this.createFilter());
|
|
34649
34842
|
}
|
|
34650
|
-
test(
|
|
34651
|
-
return this._test(
|
|
34843
|
+
test(path17) {
|
|
34844
|
+
return this._test(path17, this._testCache, true);
|
|
34652
34845
|
}
|
|
34653
34846
|
}
|
|
34654
34847
|
var factory = (options) => new Ignore2(options);
|
|
34655
|
-
var isPathValid = (
|
|
34848
|
+
var isPathValid = (path17) => checkPath(path17 && checkPath.convert(path17), path17, RETURN_FALSE);
|
|
34656
34849
|
factory.isPathValid = isPathValid;
|
|
34657
34850
|
factory.default = factory;
|
|
34658
34851
|
module.exports = factory;
|
|
@@ -34660,7 +34853,7 @@ var require_ignore = __commonJS((exports, module) => {
|
|
|
34660
34853
|
const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
|
|
34661
34854
|
checkPath.convert = makePosix;
|
|
34662
34855
|
const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
|
34663
|
-
checkPath.isNotRelative = (
|
|
34856
|
+
checkPath.isNotRelative = (path17) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path17) || isNotRelative(path17);
|
|
34664
34857
|
}
|
|
34665
34858
|
});
|
|
34666
34859
|
|
|
@@ -34722,13 +34915,13 @@ function validatePolicy(policy, opts = {}) {
|
|
|
34722
34915
|
}
|
|
34723
34916
|
}
|
|
34724
34917
|
}
|
|
34725
|
-
function matchesGlob2(
|
|
34918
|
+
function matchesGlob2(path17, pattern) {
|
|
34726
34919
|
let re = regexCache.get(pattern);
|
|
34727
34920
|
if (!re) {
|
|
34728
34921
|
re = globToRegex(pattern);
|
|
34729
34922
|
regexCache.set(pattern, re);
|
|
34730
34923
|
}
|
|
34731
|
-
return re.test(
|
|
34924
|
+
return re.test(path17);
|
|
34732
34925
|
}
|
|
34733
34926
|
var DEFAULT_POLICY, applyPolicy = (filePath, policy) => {
|
|
34734
34927
|
const normalized = filePath.trim();
|
|
@@ -34745,8 +34938,8 @@ var init_capture_policy = __esm(() => {
|
|
|
34745
34938
|
});
|
|
34746
34939
|
|
|
34747
34940
|
// ../../packages/core/dist/services/search/ignore-patterns.js
|
|
34748
|
-
import
|
|
34749
|
-
import
|
|
34941
|
+
import fs12 from "fs/promises";
|
|
34942
|
+
import path17 from "path";
|
|
34750
34943
|
function buildExtensionGlob(extensions) {
|
|
34751
34944
|
return extensions.map((ext2) => `**/*${ext2}`);
|
|
34752
34945
|
}
|
|
@@ -34769,8 +34962,8 @@ async function loadProjectIgnore(projectPath) {
|
|
|
34769
34962
|
const ig = ignore();
|
|
34770
34963
|
ig.add(DEFAULT_IGNORES);
|
|
34771
34964
|
try {
|
|
34772
|
-
const gitignorePath =
|
|
34773
|
-
const gitignoreContent = await
|
|
34965
|
+
const gitignorePath = path17.join(projectPath, ".gitignore");
|
|
34966
|
+
const gitignoreContent = await fs12.readFile(gitignorePath, "utf8");
|
|
34774
34967
|
const rules = gitignoreContent.split(`
|
|
34775
34968
|
`).map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
|
|
34776
34969
|
ig.add(rules);
|
|
@@ -36369,15 +36562,15 @@ var require_pg_connection_string = __commonJS((exports, module) => {
|
|
|
36369
36562
|
if (config3.sslnegotiation === "direct" && config3.ssl === undefined) {
|
|
36370
36563
|
config3.ssl = true;
|
|
36371
36564
|
}
|
|
36372
|
-
const
|
|
36565
|
+
const fs13 = config3.sslcert || config3.sslkey || config3.sslrootcert ? __require("fs") : null;
|
|
36373
36566
|
if (config3.sslcert) {
|
|
36374
|
-
config3.ssl.cert =
|
|
36567
|
+
config3.ssl.cert = fs13.readFileSync(config3.sslcert).toString();
|
|
36375
36568
|
}
|
|
36376
36569
|
if (config3.sslkey) {
|
|
36377
|
-
config3.ssl.key =
|
|
36570
|
+
config3.ssl.key = fs13.readFileSync(config3.sslkey).toString();
|
|
36378
36571
|
}
|
|
36379
36572
|
if (config3.sslrootcert) {
|
|
36380
|
-
config3.ssl.ca =
|
|
36573
|
+
config3.ssl.ca = fs13.readFileSync(config3.sslrootcert).toString();
|
|
36381
36574
|
}
|
|
36382
36575
|
if (options.useLibpqCompat && config3.uselibpqcompat) {
|
|
36383
36576
|
throw new Error("Both useLibpqCompat and uselibpqcompat are set. Please use only one of them.");
|
|
@@ -38091,7 +38284,7 @@ var require_split2 = __commonJS((exports, module) => {
|
|
|
38091
38284
|
|
|
38092
38285
|
// ../../node_modules/pgpass/lib/helper.js
|
|
38093
38286
|
var require_helper = __commonJS((exports, module) => {
|
|
38094
|
-
var
|
|
38287
|
+
var path18 = __require("path");
|
|
38095
38288
|
var Stream2 = __require("stream").Stream;
|
|
38096
38289
|
var split = require_split2();
|
|
38097
38290
|
var util3 = __require("util");
|
|
@@ -38131,7 +38324,7 @@ var require_helper = __commonJS((exports, module) => {
|
|
|
38131
38324
|
};
|
|
38132
38325
|
exports.getFileName = function(rawEnv) {
|
|
38133
38326
|
var env = rawEnv || process.env;
|
|
38134
|
-
var file2 = env.PGPASSFILE || (isWin ?
|
|
38327
|
+
var file2 = env.PGPASSFILE || (isWin ? path18.join(env.APPDATA || "./", "postgresql", "pgpass.conf") : path18.join(env.HOME || "./", ".pgpass"));
|
|
38135
38328
|
return file2;
|
|
38136
38329
|
};
|
|
38137
38330
|
exports.usePgPass = function(stats, fname) {
|
|
@@ -38255,16 +38448,16 @@ var require_helper = __commonJS((exports, module) => {
|
|
|
38255
38448
|
|
|
38256
38449
|
// ../../node_modules/pgpass/lib/index.js
|
|
38257
38450
|
var require_lib = __commonJS((exports, module) => {
|
|
38258
|
-
var
|
|
38259
|
-
var
|
|
38451
|
+
var path18 = __require("path");
|
|
38452
|
+
var fs13 = __require("fs");
|
|
38260
38453
|
var helper = require_helper();
|
|
38261
38454
|
module.exports = function(connInfo, cb) {
|
|
38262
38455
|
var file2 = helper.getFileName();
|
|
38263
|
-
|
|
38456
|
+
fs13.stat(file2, function(err, stat) {
|
|
38264
38457
|
if (err || !helper.usePgPass(stat, file2)) {
|
|
38265
38458
|
return cb(undefined);
|
|
38266
38459
|
}
|
|
38267
|
-
var st =
|
|
38460
|
+
var st = fs13.createReadStream(file2);
|
|
38268
38461
|
helper.getPassword(connInfo, st, cb);
|
|
38269
38462
|
});
|
|
38270
38463
|
};
|
|
@@ -39963,8 +40156,8 @@ var init_alias_resolver = __esm(() => {
|
|
|
39963
40156
|
});
|
|
39964
40157
|
|
|
39965
40158
|
// ../../packages/core/dist/services/search/index-manager.js
|
|
39966
|
-
import
|
|
39967
|
-
import
|
|
40159
|
+
import fs13 from "fs";
|
|
40160
|
+
import path18 from "path";
|
|
39968
40161
|
|
|
39969
40162
|
class IndexManager {
|
|
39970
40163
|
metadataCache = new Map;
|
|
@@ -40057,9 +40250,9 @@ class IndexManager {
|
|
|
40057
40250
|
const fileMetadata = {};
|
|
40058
40251
|
let totalSize = 0;
|
|
40059
40252
|
for (const filePath of indexedFiles) {
|
|
40060
|
-
const fullPath =
|
|
40253
|
+
const fullPath = path18.join(projectPath, filePath);
|
|
40061
40254
|
try {
|
|
40062
|
-
const stat = await
|
|
40255
|
+
const stat = await fs13.promises.stat(fullPath);
|
|
40063
40256
|
fileMetadata[filePath] = {
|
|
40064
40257
|
path: filePath,
|
|
40065
40258
|
mtime: stat.mtimeMs,
|
|
@@ -40110,9 +40303,9 @@ class IndexManager {
|
|
|
40110
40303
|
if (ig.ignores(match2)) {
|
|
40111
40304
|
continue;
|
|
40112
40305
|
}
|
|
40113
|
-
const fullPath =
|
|
40306
|
+
const fullPath = path18.join(projectPath, match2);
|
|
40114
40307
|
try {
|
|
40115
|
-
const stat = await
|
|
40308
|
+
const stat = await fs13.promises.stat(fullPath);
|
|
40116
40309
|
files.set(match2, {
|
|
40117
40310
|
path: match2,
|
|
40118
40311
|
mtime: stat.mtimeMs,
|
|
@@ -43365,23 +43558,23 @@ var require_auth_config = __commonJS((exports, module) => {
|
|
|
43365
43558
|
writeAuthConfig: () => writeAuthConfig
|
|
43366
43559
|
});
|
|
43367
43560
|
module.exports = __toCommonJS2(auth_config_exports);
|
|
43368
|
-
var
|
|
43369
|
-
var
|
|
43561
|
+
var fs14 = __toESM2(__require("fs"));
|
|
43562
|
+
var path19 = __toESM2(__require("path"));
|
|
43370
43563
|
var import_token_util = require_token_util();
|
|
43371
43564
|
function getAuthConfigPath() {
|
|
43372
43565
|
const dataDir = (0, import_token_util.getVercelDataDir)();
|
|
43373
43566
|
if (!dataDir) {
|
|
43374
43567
|
throw new Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`);
|
|
43375
43568
|
}
|
|
43376
|
-
return
|
|
43569
|
+
return path19.join(dataDir, "auth.json");
|
|
43377
43570
|
}
|
|
43378
43571
|
function readAuthConfig() {
|
|
43379
43572
|
try {
|
|
43380
43573
|
const authPath = getAuthConfigPath();
|
|
43381
|
-
if (!
|
|
43574
|
+
if (!fs14.existsSync(authPath)) {
|
|
43382
43575
|
return null;
|
|
43383
43576
|
}
|
|
43384
|
-
const content =
|
|
43577
|
+
const content = fs14.readFileSync(authPath, "utf8");
|
|
43385
43578
|
if (!content) {
|
|
43386
43579
|
return null;
|
|
43387
43580
|
}
|
|
@@ -43392,11 +43585,11 @@ var require_auth_config = __commonJS((exports, module) => {
|
|
|
43392
43585
|
}
|
|
43393
43586
|
function writeAuthConfig(config3) {
|
|
43394
43587
|
const authPath = getAuthConfigPath();
|
|
43395
|
-
const authDir =
|
|
43396
|
-
if (!
|
|
43397
|
-
|
|
43588
|
+
const authDir = path19.dirname(authPath);
|
|
43589
|
+
if (!fs14.existsSync(authDir)) {
|
|
43590
|
+
fs14.mkdirSync(authDir, { mode: 504, recursive: true });
|
|
43398
43591
|
}
|
|
43399
|
-
|
|
43592
|
+
fs14.writeFileSync(authPath, JSON.stringify(config3, null, 2), { mode: 384 });
|
|
43400
43593
|
}
|
|
43401
43594
|
function isValidAccessToken(authConfig, expirationBufferMs = 0) {
|
|
43402
43595
|
if (!authConfig.token)
|
|
@@ -43571,8 +43764,8 @@ var require_token_util = __commonJS((exports, module) => {
|
|
|
43571
43764
|
saveToken: () => saveToken
|
|
43572
43765
|
});
|
|
43573
43766
|
module.exports = __toCommonJS2(token_util_exports);
|
|
43574
|
-
var
|
|
43575
|
-
var
|
|
43767
|
+
var path19 = __toESM2(__require("path"));
|
|
43768
|
+
var fs14 = __toESM2(__require("fs"));
|
|
43576
43769
|
var import_token_error = require_token_error();
|
|
43577
43770
|
var import_token_io = require_token_io();
|
|
43578
43771
|
var import_auth_config = require_auth_config();
|
|
@@ -43584,7 +43777,7 @@ var require_token_util = __commonJS((exports, module) => {
|
|
|
43584
43777
|
if (!dataDir) {
|
|
43585
43778
|
return null;
|
|
43586
43779
|
}
|
|
43587
|
-
return
|
|
43780
|
+
return path19.join(dataDir, vercelFolder);
|
|
43588
43781
|
}
|
|
43589
43782
|
async function getVercelToken2(options) {
|
|
43590
43783
|
const authConfig = (0, import_auth_config.readAuthConfig)();
|
|
@@ -43652,11 +43845,11 @@ var require_token_util = __commonJS((exports, module) => {
|
|
|
43652
43845
|
if (!dir) {
|
|
43653
43846
|
throw new import_token_error.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`");
|
|
43654
43847
|
}
|
|
43655
|
-
const prjPath =
|
|
43656
|
-
if (!
|
|
43848
|
+
const prjPath = path19.join(dir, ".vercel", "project.json");
|
|
43849
|
+
if (!fs14.existsSync(prjPath)) {
|
|
43657
43850
|
throw new import_token_error.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`");
|
|
43658
43851
|
}
|
|
43659
|
-
const prj = JSON.parse(
|
|
43852
|
+
const prj = JSON.parse(fs14.readFileSync(prjPath, "utf8"));
|
|
43660
43853
|
if (typeof prj.projectId !== "string" && typeof prj.orgId !== "string") {
|
|
43661
43854
|
throw new TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project.");
|
|
43662
43855
|
}
|
|
@@ -43667,11 +43860,11 @@ var require_token_util = __commonJS((exports, module) => {
|
|
|
43667
43860
|
if (!dir) {
|
|
43668
43861
|
throw new import_token_error.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");
|
|
43669
43862
|
}
|
|
43670
|
-
const tokenPath =
|
|
43863
|
+
const tokenPath = path19.join(dir, "com.vercel.token", `${projectId}.json`);
|
|
43671
43864
|
const tokenJson = JSON.stringify(token);
|
|
43672
|
-
|
|
43673
|
-
|
|
43674
|
-
|
|
43865
|
+
fs14.mkdirSync(path19.dirname(tokenPath), { mode: 504, recursive: true });
|
|
43866
|
+
fs14.writeFileSync(tokenPath, tokenJson);
|
|
43867
|
+
fs14.chmodSync(tokenPath, 432);
|
|
43675
43868
|
return;
|
|
43676
43869
|
}
|
|
43677
43870
|
function loadToken(projectId) {
|
|
@@ -43679,11 +43872,11 @@ var require_token_util = __commonJS((exports, module) => {
|
|
|
43679
43872
|
if (!dir) {
|
|
43680
43873
|
throw new import_token_error.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");
|
|
43681
43874
|
}
|
|
43682
|
-
const tokenPath =
|
|
43683
|
-
if (!
|
|
43875
|
+
const tokenPath = path19.join(dir, "com.vercel.token", `${projectId}.json`);
|
|
43876
|
+
if (!fs14.existsSync(tokenPath)) {
|
|
43684
43877
|
return null;
|
|
43685
43878
|
}
|
|
43686
|
-
const token = JSON.parse(
|
|
43879
|
+
const token = JSON.parse(fs14.readFileSync(tokenPath, "utf8"));
|
|
43687
43880
|
assertVercelOidcTokenResponse(token);
|
|
43688
43881
|
return token;
|
|
43689
43882
|
}
|
|
@@ -54525,37 +54718,37 @@ function createOpenAI(options = {}) {
|
|
|
54525
54718
|
}, `ai-sdk/openai/${VERSION4}`);
|
|
54526
54719
|
const createChatModel = (modelId) => new OpenAIChatLanguageModel(modelId, {
|
|
54527
54720
|
provider: `${providerName}.chat`,
|
|
54528
|
-
url: ({ path:
|
|
54721
|
+
url: ({ path: path19 }) => `${baseURL}${path19}`,
|
|
54529
54722
|
headers: getHeaders,
|
|
54530
54723
|
fetch: options.fetch
|
|
54531
54724
|
});
|
|
54532
54725
|
const createCompletionModel = (modelId) => new OpenAICompletionLanguageModel(modelId, {
|
|
54533
54726
|
provider: `${providerName}.completion`,
|
|
54534
|
-
url: ({ path:
|
|
54727
|
+
url: ({ path: path19 }) => `${baseURL}${path19}`,
|
|
54535
54728
|
headers: getHeaders,
|
|
54536
54729
|
fetch: options.fetch
|
|
54537
54730
|
});
|
|
54538
54731
|
const createEmbeddingModel = (modelId) => new OpenAIEmbeddingModel(modelId, {
|
|
54539
54732
|
provider: `${providerName}.embedding`,
|
|
54540
|
-
url: ({ path:
|
|
54733
|
+
url: ({ path: path19 }) => `${baseURL}${path19}`,
|
|
54541
54734
|
headers: getHeaders,
|
|
54542
54735
|
fetch: options.fetch
|
|
54543
54736
|
});
|
|
54544
54737
|
const createImageModel = (modelId) => new OpenAIImageModel(modelId, {
|
|
54545
54738
|
provider: `${providerName}.image`,
|
|
54546
|
-
url: ({ path:
|
|
54739
|
+
url: ({ path: path19 }) => `${baseURL}${path19}`,
|
|
54547
54740
|
headers: getHeaders,
|
|
54548
54741
|
fetch: options.fetch
|
|
54549
54742
|
});
|
|
54550
54743
|
const createTranscriptionModel = (modelId) => new OpenAITranscriptionModel(modelId, {
|
|
54551
54744
|
provider: `${providerName}.transcription`,
|
|
54552
|
-
url: ({ path:
|
|
54745
|
+
url: ({ path: path19 }) => `${baseURL}${path19}`,
|
|
54553
54746
|
headers: getHeaders,
|
|
54554
54747
|
fetch: options.fetch
|
|
54555
54748
|
});
|
|
54556
54749
|
const createSpeechModel = (modelId) => new OpenAISpeechModel(modelId, {
|
|
54557
54750
|
provider: `${providerName}.speech`,
|
|
54558
|
-
url: ({ path:
|
|
54751
|
+
url: ({ path: path19 }) => `${baseURL}${path19}`,
|
|
54559
54752
|
headers: getHeaders,
|
|
54560
54753
|
fetch: options.fetch
|
|
54561
54754
|
});
|
|
@@ -54568,7 +54761,7 @@ function createOpenAI(options = {}) {
|
|
|
54568
54761
|
const createResponsesModel = (modelId) => {
|
|
54569
54762
|
return new OpenAIResponsesLanguageModel(modelId, {
|
|
54570
54763
|
provider: `${providerName}.responses`,
|
|
54571
|
-
url: ({ path:
|
|
54764
|
+
url: ({ path: path19 }) => `${baseURL}${path19}`,
|
|
54572
54765
|
headers: getHeaders,
|
|
54573
54766
|
fetch: options.fetch,
|
|
54574
54767
|
fileIdPrefixes: ["file-"]
|
|
@@ -71180,26 +71373,26 @@ var require_process = __commonJS((exports, module) => {
|
|
|
71180
71373
|
|
|
71181
71374
|
// ../../node_modules/detect-libc/lib/filesystem.js
|
|
71182
71375
|
var require_filesystem = __commonJS((exports, module) => {
|
|
71183
|
-
var
|
|
71376
|
+
var fs14 = __require("fs");
|
|
71184
71377
|
var LDD_PATH = "/usr/bin/ldd";
|
|
71185
71378
|
var SELF_PATH = "/proc/self/exe";
|
|
71186
71379
|
var MAX_LENGTH = 2048;
|
|
71187
|
-
var readFileSync2 = (
|
|
71188
|
-
const fd =
|
|
71380
|
+
var readFileSync2 = (path19) => {
|
|
71381
|
+
const fd = fs14.openSync(path19, "r");
|
|
71189
71382
|
const buffer = Buffer.alloc(MAX_LENGTH);
|
|
71190
|
-
const bytesRead =
|
|
71191
|
-
|
|
71383
|
+
const bytesRead = fs14.readSync(fd, buffer, 0, MAX_LENGTH, 0);
|
|
71384
|
+
fs14.close(fd, () => {});
|
|
71192
71385
|
return buffer.subarray(0, bytesRead);
|
|
71193
71386
|
};
|
|
71194
|
-
var readFile = (
|
|
71195
|
-
|
|
71387
|
+
var readFile = (path19) => new Promise((resolve4, reject) => {
|
|
71388
|
+
fs14.open(path19, "r", (err, fd) => {
|
|
71196
71389
|
if (err) {
|
|
71197
71390
|
reject(err);
|
|
71198
71391
|
} else {
|
|
71199
71392
|
const buffer = Buffer.alloc(MAX_LENGTH);
|
|
71200
|
-
|
|
71393
|
+
fs14.read(fd, buffer, 0, MAX_LENGTH, 0, (_, bytesRead) => {
|
|
71201
71394
|
resolve4(buffer.subarray(0, bytesRead));
|
|
71202
|
-
|
|
71395
|
+
fs14.close(fd, () => {});
|
|
71203
71396
|
});
|
|
71204
71397
|
}
|
|
71205
71398
|
});
|
|
@@ -71304,11 +71497,11 @@ var require_detect_libc = __commonJS((exports, module) => {
|
|
|
71304
71497
|
}
|
|
71305
71498
|
return null;
|
|
71306
71499
|
};
|
|
71307
|
-
var familyFromInterpreterPath = (
|
|
71308
|
-
if (
|
|
71309
|
-
if (
|
|
71500
|
+
var familyFromInterpreterPath = (path19) => {
|
|
71501
|
+
if (path19) {
|
|
71502
|
+
if (path19.includes("/ld-musl-")) {
|
|
71310
71503
|
return MUSL;
|
|
71311
|
-
} else if (
|
|
71504
|
+
} else if (path19.includes("/ld-linux-")) {
|
|
71312
71505
|
return GLIBC;
|
|
71313
71506
|
}
|
|
71314
71507
|
}
|
|
@@ -71353,8 +71546,8 @@ var require_detect_libc = __commonJS((exports, module) => {
|
|
|
71353
71546
|
cachedFamilyInterpreter = null;
|
|
71354
71547
|
try {
|
|
71355
71548
|
const selfContent = await readFile(SELF_PATH);
|
|
71356
|
-
const
|
|
71357
|
-
cachedFamilyInterpreter = familyFromInterpreterPath(
|
|
71549
|
+
const path19 = interpreterPath(selfContent);
|
|
71550
|
+
cachedFamilyInterpreter = familyFromInterpreterPath(path19);
|
|
71358
71551
|
} catch (e) {}
|
|
71359
71552
|
return cachedFamilyInterpreter;
|
|
71360
71553
|
};
|
|
@@ -71365,8 +71558,8 @@ var require_detect_libc = __commonJS((exports, module) => {
|
|
|
71365
71558
|
cachedFamilyInterpreter = null;
|
|
71366
71559
|
try {
|
|
71367
71560
|
const selfContent = readFileSync2(SELF_PATH);
|
|
71368
|
-
const
|
|
71369
|
-
cachedFamilyInterpreter = familyFromInterpreterPath(
|
|
71561
|
+
const path19 = interpreterPath(selfContent);
|
|
71562
|
+
cachedFamilyInterpreter = familyFromInterpreterPath(path19);
|
|
71370
71563
|
} catch (e) {}
|
|
71371
71564
|
return cachedFamilyInterpreter;
|
|
71372
71565
|
};
|
|
@@ -73028,18 +73221,18 @@ var require_sharp = __commonJS((exports, module) => {
|
|
|
73028
73221
|
`@img/sharp-${runtimePlatform}/sharp.node`,
|
|
73029
73222
|
"@img/sharp-wasm32/sharp.node"
|
|
73030
73223
|
];
|
|
73031
|
-
var
|
|
73224
|
+
var path19;
|
|
73032
73225
|
var sharp;
|
|
73033
73226
|
var errors4 = [];
|
|
73034
|
-
for (
|
|
73227
|
+
for (path19 of paths) {
|
|
73035
73228
|
try {
|
|
73036
|
-
sharp = __require(
|
|
73229
|
+
sharp = __require(path19);
|
|
73037
73230
|
break;
|
|
73038
73231
|
} catch (err) {
|
|
73039
73232
|
errors4.push(err);
|
|
73040
73233
|
}
|
|
73041
73234
|
}
|
|
73042
|
-
if (sharp &&
|
|
73235
|
+
if (sharp && path19.startsWith("@img/sharp-linux-x64") && !sharp._isUsingX64V2()) {
|
|
73043
73236
|
const err = new Error("Prebuilt binaries for linux-x64 require v2 microarchitecture");
|
|
73044
73237
|
err.code = "Unsupported CPU";
|
|
73045
73238
|
errors4.push(err);
|
|
@@ -73048,7 +73241,7 @@ var require_sharp = __commonJS((exports, module) => {
|
|
|
73048
73241
|
if (sharp) {
|
|
73049
73242
|
module.exports = sharp;
|
|
73050
73243
|
} else {
|
|
73051
|
-
const [isLinux, isMacOs, isWindows] = ["linux", "darwin", "win32"].map((
|
|
73244
|
+
const [isLinux, isMacOs, isWindows] = ["linux", "darwin", "win32"].map((os9) => runtimePlatform.startsWith(os9));
|
|
73052
73245
|
const help = [`Could not load the "sharp" module using the ${runtimePlatform} runtime`];
|
|
73053
73246
|
errors4.forEach((err) => {
|
|
73054
73247
|
if (err.code !== "MODULE_NOT_FOUND") {
|
|
@@ -73061,9 +73254,9 @@ var require_sharp = __commonJS((exports, module) => {
|
|
|
73061
73254
|
const { found, expected } = isUnsupportedNodeRuntime();
|
|
73062
73255
|
help.push("- Please upgrade Node.js:", ` Found ${found}`, ` Requires ${expected}`);
|
|
73063
73256
|
} else if (prebuiltPlatforms.includes(runtimePlatform)) {
|
|
73064
|
-
const [
|
|
73065
|
-
const libc =
|
|
73066
|
-
help.push("- Ensure optional dependencies can be installed:", " npm install --include=optional sharp", "- Ensure your package manager supports multi-platform installation:", " See https://sharp.pixelplumbing.com/install#cross-platform", "- Add platform-specific dependencies:", ` npm install --os=${
|
|
73257
|
+
const [os9, cpu] = runtimePlatform.split("-");
|
|
73258
|
+
const libc = os9.endsWith("musl") ? " --libc=musl" : "";
|
|
73259
|
+
help.push("- Ensure optional dependencies can be installed:", " npm install --include=optional sharp", "- Ensure your package manager supports multi-platform installation:", " See https://sharp.pixelplumbing.com/install#cross-platform", "- Add platform-specific dependencies:", ` npm install --os=${os9.replace("musl", "")}${libc} --cpu=${cpu} sharp`);
|
|
73067
73260
|
} else {
|
|
73068
73261
|
help.push(`- Manually install libvips >= ${minimumLibvipsVersion}`, "- Add experimental WebAssembly-based dependencies:", " npm install --cpu=wasm32 sharp", " npm install @img/sharp-wasm32");
|
|
73069
73262
|
}
|
|
@@ -75901,15 +76094,15 @@ var require_color = __commonJS((exports, module) => {
|
|
|
75901
76094
|
};
|
|
75902
76095
|
}
|
|
75903
76096
|
function wrapConversion(toModel, graph) {
|
|
75904
|
-
const
|
|
76097
|
+
const path19 = [graph[toModel].parent, toModel];
|
|
75905
76098
|
let fn = conversions_default[graph[toModel].parent][toModel];
|
|
75906
76099
|
let cur = graph[toModel].parent;
|
|
75907
76100
|
while (graph[cur].parent) {
|
|
75908
|
-
|
|
76101
|
+
path19.unshift(graph[cur].parent);
|
|
75909
76102
|
fn = link(conversions_default[graph[cur].parent][cur], fn);
|
|
75910
76103
|
cur = graph[cur].parent;
|
|
75911
76104
|
}
|
|
75912
|
-
fn.conversion =
|
|
76105
|
+
fn.conversion = path19;
|
|
75913
76106
|
return fn;
|
|
75914
76107
|
}
|
|
75915
76108
|
function route(fromModel) {
|
|
@@ -76514,7 +76707,7 @@ var require_output = __commonJS((exports, module) => {
|
|
|
76514
76707
|
Copyright 2013 Lovell Fuller and others.
|
|
76515
76708
|
SPDX-License-Identifier: Apache-2.0
|
|
76516
76709
|
*/
|
|
76517
|
-
var
|
|
76710
|
+
var path19 = __require("path");
|
|
76518
76711
|
var is = require_is();
|
|
76519
76712
|
var sharp = require_sharp();
|
|
76520
76713
|
var formats = new Map([
|
|
@@ -76545,9 +76738,9 @@ var require_output = __commonJS((exports, module) => {
|
|
|
76545
76738
|
let err;
|
|
76546
76739
|
if (!is.string(fileOut)) {
|
|
76547
76740
|
err = new Error("Missing output file path");
|
|
76548
|
-
} else if (is.string(this.options.input.file) &&
|
|
76741
|
+
} else if (is.string(this.options.input.file) && path19.resolve(this.options.input.file) === path19.resolve(fileOut)) {
|
|
76549
76742
|
err = new Error("Cannot use same file for input and output");
|
|
76550
|
-
} else if (jp2Regex.test(
|
|
76743
|
+
} else if (jp2Regex.test(path19.extname(fileOut)) && !this.constructor.format.jp2k.output.file) {
|
|
76551
76744
|
err = errJp2Save();
|
|
76552
76745
|
}
|
|
76553
76746
|
if (err) {
|
|
@@ -83794,11 +83987,11 @@ var init_transformers_node = __esm(() => {
|
|
|
83794
83987
|
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}).`);
|
|
83795
83988
|
}
|
|
83796
83989
|
for (let i = 0;i < num_chunks; ++i) {
|
|
83797
|
-
const
|
|
83798
|
-
const fullPath = `${options.subfolder ?? ""}/${
|
|
83990
|
+
const path19 = `${baseName}_data${i === 0 ? "" : "_" + i}`;
|
|
83991
|
+
const fullPath = `${options.subfolder ?? ""}/${path19}`;
|
|
83799
83992
|
externalDataPromises.push(new Promise(async (resolve4, reject) => {
|
|
83800
83993
|
const data = await (0, _utils_hub_js__WEBPACK_IMPORTED_MODULE_5__.getModelFile)(pretrained_model_name_or_path, fullPath, true, options, return_path);
|
|
83801
|
-
resolve4(data instanceof Uint8Array ? { path:
|
|
83994
|
+
resolve4(data instanceof Uint8Array ? { path: path19, data } : path19);
|
|
83802
83995
|
}));
|
|
83803
83996
|
}
|
|
83804
83997
|
} else if (session_options.externalData !== undefined) {
|
|
@@ -96862,7 +97055,7 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
|
|
|
96862
97055
|
const blob = new Blob([wav], { type: "audio/wav" });
|
|
96863
97056
|
return blob;
|
|
96864
97057
|
}
|
|
96865
|
-
async save(
|
|
97058
|
+
async save(path19) {
|
|
96866
97059
|
let fn;
|
|
96867
97060
|
if (_env_js__WEBPACK_IMPORTED_MODULE_3__.apis.IS_BROWSER_ENV) {
|
|
96868
97061
|
if (_env_js__WEBPACK_IMPORTED_MODULE_3__.apis.IS_WEBWORKER_ENV) {
|
|
@@ -96870,14 +97063,14 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
|
|
|
96870
97063
|
}
|
|
96871
97064
|
fn = _core_js__WEBPACK_IMPORTED_MODULE_2__.saveBlob;
|
|
96872
97065
|
} else if (_env_js__WEBPACK_IMPORTED_MODULE_3__.apis.IS_FS_AVAILABLE) {
|
|
96873
|
-
fn = async (
|
|
97066
|
+
fn = async (path20, blob) => {
|
|
96874
97067
|
let buffer = await blob.arrayBuffer();
|
|
96875
|
-
node_fs__WEBPACK_IMPORTED_MODULE_5__["default"].writeFileSync(
|
|
97068
|
+
node_fs__WEBPACK_IMPORTED_MODULE_5__["default"].writeFileSync(path20, Buffer.from(buffer));
|
|
96876
97069
|
};
|
|
96877
97070
|
} else {
|
|
96878
97071
|
throw new Error("Unable to save because filesystem is disabled in this environment.");
|
|
96879
97072
|
}
|
|
96880
|
-
await fn(
|
|
97073
|
+
await fn(path19, this.toBlob());
|
|
96881
97074
|
}
|
|
96882
97075
|
}
|
|
96883
97076
|
},
|
|
@@ -96973,11 +97166,11 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
|
|
|
96973
97166
|
function calculateReflectOffset(i, w) {
|
|
96974
97167
|
return Math.abs((i + w) % (2 * w) - w);
|
|
96975
97168
|
}
|
|
96976
|
-
function saveBlob(
|
|
97169
|
+
function saveBlob(path19, blob) {
|
|
96977
97170
|
const dataURL = URL.createObjectURL(blob);
|
|
96978
97171
|
const downloadLink = document.createElement("a");
|
|
96979
97172
|
downloadLink.href = dataURL;
|
|
96980
|
-
downloadLink.download =
|
|
97173
|
+
downloadLink.download = path19;
|
|
96981
97174
|
downloadLink.click();
|
|
96982
97175
|
downloadLink.remove();
|
|
96983
97176
|
URL.revokeObjectURL(dataURL);
|
|
@@ -97578,8 +97771,8 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
|
|
|
97578
97771
|
}
|
|
97579
97772
|
|
|
97580
97773
|
class FileCache {
|
|
97581
|
-
constructor(
|
|
97582
|
-
this.path =
|
|
97774
|
+
constructor(path19) {
|
|
97775
|
+
this.path = path19;
|
|
97583
97776
|
}
|
|
97584
97777
|
async match(request) {
|
|
97585
97778
|
let filePath = node_path__WEBPACK_IMPORTED_MODULE_1__["default"].join(this.path, request);
|
|
@@ -98335,20 +98528,20 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
|
|
|
98335
98528
|
}
|
|
98336
98529
|
return this;
|
|
98337
98530
|
}
|
|
98338
|
-
async save(
|
|
98531
|
+
async save(path19) {
|
|
98339
98532
|
if (IS_BROWSER_OR_WEBWORKER) {
|
|
98340
98533
|
if (_env_js__WEBPACK_IMPORTED_MODULE_2__.apis.IS_WEBWORKER_ENV) {
|
|
98341
98534
|
throw new Error("Unable to save an image from a Web Worker.");
|
|
98342
98535
|
}
|
|
98343
|
-
const extension =
|
|
98536
|
+
const extension = path19.split(".").pop().toLowerCase();
|
|
98344
98537
|
const mime = CONTENT_TYPE_MAP.get(extension) ?? "image/png";
|
|
98345
98538
|
const blob = await this.toBlob(mime);
|
|
98346
|
-
(0, _core_js__WEBPACK_IMPORTED_MODULE_0__.saveBlob)(
|
|
98539
|
+
(0, _core_js__WEBPACK_IMPORTED_MODULE_0__.saveBlob)(path19, blob);
|
|
98347
98540
|
} else if (!_env_js__WEBPACK_IMPORTED_MODULE_2__.apis.IS_FS_AVAILABLE) {
|
|
98348
98541
|
throw new Error("Unable to save the image because filesystem is disabled in this environment.");
|
|
98349
98542
|
} else {
|
|
98350
98543
|
const img = this.toSharp();
|
|
98351
|
-
return await img.toFile(
|
|
98544
|
+
return await img.toFile(path19);
|
|
98352
98545
|
}
|
|
98353
98546
|
}
|
|
98354
98547
|
toSharp() {
|
|
@@ -107577,7 +107770,7 @@ Note that ${s.bold("include")} statements only accept relation fields.`, a;
|
|
|
107577
107770
|
function ns(e = Yo, t = Yo) {
|
|
107578
107771
|
return (r) => e(t(r));
|
|
107579
107772
|
}
|
|
107580
|
-
function
|
|
107773
|
+
function os9({ dataPath: e, modelName: t, args: r, runtimeDataModel: n }) {
|
|
107581
107774
|
let i = { modelName: t, args: r ?? {} }, o = dp(e);
|
|
107582
107775
|
if (!o || o.length === 0)
|
|
107583
107776
|
return i;
|
|
@@ -107882,10 +108075,10 @@ Note that ${s.bold("include")} statements only accept relation fields.`, a;
|
|
|
107882
108075
|
super(t, "P2023", r);
|
|
107883
108076
|
}
|
|
107884
108077
|
};
|
|
107885
|
-
var
|
|
108078
|
+
var fs14 = new WeakMap;
|
|
107886
108079
|
function Ep(e) {
|
|
107887
|
-
let t =
|
|
107888
|
-
return t || (t = Object.entries(e),
|
|
108080
|
+
let t = fs14.get(e);
|
|
108081
|
+
return t || (t = Object.entries(e), fs14.set(e, t)), t;
|
|
107889
108082
|
}
|
|
107890
108083
|
function hs(e, t, r) {
|
|
107891
108084
|
switch (t.type) {
|
|
@@ -111450,7 +111643,7 @@ new PrismaClient({
|
|
|
111450
111643
|
let m = await es(this, d);
|
|
111451
111644
|
if (!d.model)
|
|
111452
111645
|
return m;
|
|
111453
|
-
let g =
|
|
111646
|
+
let g = os9({ dataPath: d.dataPath, modelName: d.model, args: d.args, runtimeDataModel: this._runtimeDataModel });
|
|
111454
111647
|
return Wo({ result: m, modelName: g.modelName, args: g.args, extensions: this._extensions, runtimeDataModel: this._runtimeDataModel, globalOmit: this._globalOmit });
|
|
111455
111648
|
};
|
|
111456
111649
|
return this._tracingHelper.runInChildSpan(s.operation, () => new zl.AsyncResource("prisma-client-request").runInAsyncScope(() => a(o)));
|
|
@@ -111853,7 +112046,7 @@ var require_prisma = __commonJS((exports) => {
|
|
|
111853
112046
|
Prisma.JsonNull = JsonNull2;
|
|
111854
112047
|
Prisma.AnyNull = AnyNull2;
|
|
111855
112048
|
Prisma.NullTypes = NullTypes2;
|
|
111856
|
-
var
|
|
112049
|
+
var path19 = __require("path");
|
|
111857
112050
|
exports.Prisma.TransactionIsolationLevel = makeStrictEnum2({
|
|
111858
112051
|
ReadUncommitted: "ReadUncommitted",
|
|
111859
112052
|
ReadCommitted: "ReadCommitted",
|
|
@@ -123551,10 +123744,10 @@ var init_chunker_code = __esm(() => {
|
|
|
123551
123744
|
});
|
|
123552
123745
|
|
|
123553
123746
|
// ../../packages/core/dist/services/search/smart-chunker.js
|
|
123554
|
-
import
|
|
123747
|
+
import path19 from "path";
|
|
123555
123748
|
function smartChunk(content, filePath, config3 = {}) {
|
|
123556
123749
|
const cfg = { ...DEFAULT_CONFIG, ...config3 };
|
|
123557
|
-
const ext2 =
|
|
123750
|
+
const ext2 = path19.extname(filePath).toLowerCase();
|
|
123558
123751
|
const relativePath = filePath;
|
|
123559
123752
|
const fileImports = isCodeFile(ext2) ? extractFileImports(content, ext2) : undefined;
|
|
123560
123753
|
let chunks;
|
|
@@ -123892,8 +124085,8 @@ var init_embedding_freshness = __esm(() => {
|
|
|
123892
124085
|
});
|
|
123893
124086
|
|
|
123894
124087
|
// ../../packages/core/dist/services/search/project-indexer.js
|
|
123895
|
-
import
|
|
123896
|
-
import
|
|
124088
|
+
import fs14 from "fs/promises";
|
|
124089
|
+
import path20 from "path";
|
|
123897
124090
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
123898
124091
|
async function runWithIndexLock(lockMap, projectId, work) {
|
|
123899
124092
|
const prevLock = lockMap.get(projectId);
|
|
@@ -123936,7 +124129,7 @@ async function indexProjectInternal(deps, projectPath, projectId, options = {})
|
|
|
123936
124129
|
dot: false
|
|
123937
124130
|
});
|
|
123938
124131
|
const filteredFiles = files.filter((file2) => {
|
|
123939
|
-
const relativePath =
|
|
124132
|
+
const relativePath = path20.relative(projectPath, file2);
|
|
123940
124133
|
const shouldIgnore = ig.ignores(relativePath);
|
|
123941
124134
|
if (shouldIgnore) {
|
|
123942
124135
|
logger.debug("Ignoring file per .gitignore during indexing", {
|
|
@@ -123976,7 +124169,7 @@ async function indexProjectInternal(deps, projectPath, projectId, options = {})
|
|
|
123976
124169
|
});
|
|
123977
124170
|
}
|
|
123978
124171
|
}
|
|
123979
|
-
const indexedFilesList = filteredFiles.map((f) =>
|
|
124172
|
+
const indexedFilesList = filteredFiles.map((f) => path20.relative(projectPath, f));
|
|
123980
124173
|
await deps.indexManager.updateIndexMetadata(projectId, projectPath, indexedFilesList);
|
|
123981
124174
|
logger.info("Project indexing completed", {
|
|
123982
124175
|
projectId,
|
|
@@ -124106,7 +124299,7 @@ async function ensureFreshIndex(deps, projectId, projectPath, options = {}) {
|
|
|
124106
124299
|
let errors4 = 0;
|
|
124107
124300
|
for (const relativeFilePath of filesToReindex) {
|
|
124108
124301
|
try {
|
|
124109
|
-
const fullPath =
|
|
124302
|
+
const fullPath = path20.join(projectPath, relativeFilePath);
|
|
124110
124303
|
const result = await deps.indexFile(fullPath, projectId, projectPath, centralityMap);
|
|
124111
124304
|
filesIndexed++;
|
|
124112
124305
|
chunksIndexed += result.chunks;
|
|
@@ -124166,8 +124359,8 @@ async function checkSearchAdmission(deps, projectId, projectPath) {
|
|
|
124166
124359
|
}
|
|
124167
124360
|
async function indexFile(deps, filePath, projectId, projectRoot, centralityMap) {
|
|
124168
124361
|
projectId = await getProjectIdentityAliasResolver().resolve(projectId);
|
|
124169
|
-
const content = await
|
|
124170
|
-
const relativePath =
|
|
124362
|
+
const content = await fs14.readFile(filePath, "utf-8");
|
|
124363
|
+
const relativePath = path20.relative(projectRoot, filePath);
|
|
124171
124364
|
const maxFileSize = config2.get("security").maxFileSize || 1024 * 1024;
|
|
124172
124365
|
if (content.length > maxFileSize) {
|
|
124173
124366
|
logger.warn("File too large, skipping", {
|
|
@@ -124187,7 +124380,7 @@ async function indexFile(deps, filePath, projectId, projectRoot, centralityMap)
|
|
|
124187
124380
|
chunkIndex: i,
|
|
124188
124381
|
totalChunks: chunks.length,
|
|
124189
124382
|
type: chunk.type,
|
|
124190
|
-
language:
|
|
124383
|
+
language: path20.extname(filePath).slice(1),
|
|
124191
124384
|
lineStart: chunk.lineStart,
|
|
124192
124385
|
lineEnd: chunk.lineEnd,
|
|
124193
124386
|
label: chunk.label,
|
|
@@ -126252,8 +126445,8 @@ function stripNul(content) {
|
|
|
126252
126445
|
}
|
|
126253
126446
|
|
|
126254
126447
|
// ../../packages/core/dist/services/etl/stages/discover.js
|
|
126255
|
-
import
|
|
126256
|
-
import
|
|
126448
|
+
import fs15 from "fs/promises";
|
|
126449
|
+
import path21 from "path";
|
|
126257
126450
|
import { createHash as createHash5 } from "crypto";
|
|
126258
126451
|
|
|
126259
126452
|
class DiscoverStage {
|
|
@@ -126279,7 +126472,7 @@ class DiscoverStage {
|
|
|
126279
126472
|
dot: false,
|
|
126280
126473
|
absolute: false
|
|
126281
126474
|
});
|
|
126282
|
-
relPaths = found.map((p) =>
|
|
126475
|
+
relPaths = found.map((p) => path21.isAbsolute(p) ? path21.relative(ctx.projectPath, p) : p).filter((p) => !ig.ignores(p) && applyPolicy(p, policy) !== "Drop");
|
|
126283
126476
|
}
|
|
126284
126477
|
if (ctx.resumeCursor?.path) {
|
|
126285
126478
|
const cursorPath = ctx.resumeCursor.path;
|
|
@@ -126338,10 +126531,10 @@ class DiscoverStage {
|
|
|
126338
126531
|
return discovered;
|
|
126339
126532
|
}
|
|
126340
126533
|
async processFile(ctx, relativePath, forceReindex) {
|
|
126341
|
-
const absolutePath =
|
|
126534
|
+
const absolutePath = path21.join(ctx.projectPath, relativePath);
|
|
126342
126535
|
try {
|
|
126343
|
-
const stat = await
|
|
126344
|
-
const content = stripNul(await
|
|
126536
|
+
const stat = await fs15.stat(absolutePath);
|
|
126537
|
+
const content = stripNul(await fs15.readFile(absolutePath, "utf-8"));
|
|
126345
126538
|
const contentHash = createHash5("sha256").update(content).digest("hex");
|
|
126346
126539
|
let needsReparse = forceReindex;
|
|
126347
126540
|
if (!forceReindex) {
|
|
@@ -126384,8 +126577,8 @@ class DiscoverStage {
|
|
|
126384
126577
|
ig.add(pattern);
|
|
126385
126578
|
}
|
|
126386
126579
|
try {
|
|
126387
|
-
const gitignorePath =
|
|
126388
|
-
const gitignoreContent = await
|
|
126580
|
+
const gitignorePath = path21.join(projectPath, ".gitignore");
|
|
126581
|
+
const gitignoreContent = await fs15.readFile(gitignorePath, "utf8");
|
|
126389
126582
|
const rules = gitignoreContent.split(`
|
|
126390
126583
|
`).map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
|
|
126391
126584
|
ig.add(rules);
|
|
@@ -127740,8 +127933,8 @@ function rustUseLeaves(node, source, prefix = []) {
|
|
|
127740
127933
|
}
|
|
127741
127934
|
if (node.type === "use_wildcard")
|
|
127742
127935
|
return [{ path: [...prefix, "*"], glob: true }];
|
|
127743
|
-
const
|
|
127744
|
-
return
|
|
127936
|
+
const path22 = rustPathSegments(node, source);
|
|
127937
|
+
return path22.length ? [{ path: [...prefix, ...path22] }] : [];
|
|
127745
127938
|
}
|
|
127746
127939
|
function functionalCaptures(captures, source, family) {
|
|
127747
127940
|
if (family !== "clojure")
|
|
@@ -128713,8 +128906,8 @@ var init_structural_runtime = __esm(() => {
|
|
|
128713
128906
|
});
|
|
128714
128907
|
|
|
128715
128908
|
// ../../packages/core/dist/services/etl/stages/parse.js
|
|
128716
|
-
import
|
|
128717
|
-
import
|
|
128909
|
+
import path22 from "path";
|
|
128910
|
+
import fs16 from "fs/promises";
|
|
128718
128911
|
function resolveChunkerMaxChars() {
|
|
128719
128912
|
const global2 = Number(process.env.EMBEDDING_MAX_CHARS);
|
|
128720
128913
|
if (Number.isFinite(global2) && global2 > 0)
|
|
@@ -128742,8 +128935,8 @@ class ParseStage {
|
|
|
128742
128935
|
const results = new Map;
|
|
128743
128936
|
let processed = 0;
|
|
128744
128937
|
const phases = [
|
|
128745
|
-
files.filter((file2) =>
|
|
128746
|
-
files.filter((file2) =>
|
|
128938
|
+
files.filter((file2) => path22.extname(file2.relativePath).toLowerCase() !== ".h"),
|
|
128939
|
+
files.filter((file2) => path22.extname(file2.relativePath).toLowerCase() === ".h")
|
|
128747
128940
|
];
|
|
128748
128941
|
const batches = phases.flatMap((phase) => Array.from({ length: Math.ceil(phase.length / BATCH_SIZE) }, (_, index) => phase.slice(index * BATCH_SIZE, (index + 1) * BATCH_SIZE)));
|
|
128749
128942
|
for (const batch of batches) {
|
|
@@ -128781,19 +128974,19 @@ class ParseStage {
|
|
|
128781
128974
|
return files.map((file2) => results.get(file2.relativePath));
|
|
128782
128975
|
}
|
|
128783
128976
|
recordHeaderImporterEvidence(ctx, files, parsedFiles) {
|
|
128784
|
-
const knownHeaders = new Set(files.filter((file2) =>
|
|
128977
|
+
const knownHeaders = new Set(files.filter((file2) => path22.extname(file2.relativePath).toLowerCase() === ".h").map((file2) => path22.posix.normalize(file2.relativePath)));
|
|
128785
128978
|
const mutable = {
|
|
128786
128979
|
...ctx.structuralHeaderEvidenceByFile
|
|
128787
128980
|
};
|
|
128788
128981
|
for (const parsed of parsedFiles) {
|
|
128789
|
-
const extension =
|
|
128982
|
+
const extension = path22.extname(parsed.file.relativePath).toLowerCase();
|
|
128790
128983
|
const key = extension === ".c" ? "cImporters" : [".cpp", ".hpp"].includes(extension) ? "cppImporters" : undefined;
|
|
128791
128984
|
if (!key)
|
|
128792
128985
|
continue;
|
|
128793
128986
|
for (const imported of parsed.rawImports) {
|
|
128794
128987
|
if (!["c_include", "cpp_include"].includes(imported.form) || imported.specifier.startsWith("<"))
|
|
128795
128988
|
continue;
|
|
128796
|
-
const header =
|
|
128989
|
+
const header = path22.posix.normalize(path22.posix.join(path22.posix.dirname(parsed.file.relativePath), imported.specifier));
|
|
128797
128990
|
if (!knownHeaders.has(header))
|
|
128798
128991
|
continue;
|
|
128799
128992
|
const existing = mutable[header] ?? {};
|
|
@@ -128804,9 +128997,9 @@ class ParseStage {
|
|
|
128804
128997
|
}
|
|
128805
128998
|
async parseFile(ctx, file2) {
|
|
128806
128999
|
if (!file2.needsReparse) {
|
|
128807
|
-
const extension =
|
|
129000
|
+
const extension = path22.extname(file2.relativePath).toLowerCase();
|
|
128808
129001
|
if ([".c", ".cpp", ".hpp"].includes(extension)) {
|
|
128809
|
-
const content = file2.snapshotContent ?? await
|
|
129002
|
+
const content = file2.snapshotContent ?? await fs16.readFile(file2.absolutePath, "utf8");
|
|
128810
129003
|
const outcome = await this.runtime.parse({ extension, source: Buffer.from(content) });
|
|
128811
129004
|
if (outcome.status === "failed")
|
|
128812
129005
|
throw new StructuralEtlParseError(file2.relativePath, outcome.failureKind, `Structural evidence parse failed (${outcome.failureKind})`, outcome.diagnosticCount, outcome.diagnostics.slice(0, 10));
|
|
@@ -128818,8 +129011,8 @@ class ParseStage {
|
|
|
128818
129011
|
return { file: file2, chunks: [], symbols: [], rawImports: [], rawEdges: [] };
|
|
128819
129012
|
}
|
|
128820
129013
|
try {
|
|
128821
|
-
const content = file2.snapshotContent ?? await
|
|
128822
|
-
const ext2 =
|
|
129014
|
+
const content = file2.snapshotContent ?? await fs16.readFile(file2.absolutePath, "utf-8");
|
|
129015
|
+
const ext2 = path22.extname(file2.relativePath).toLowerCase();
|
|
128823
129016
|
const chunkerMaxChars = resolveChunkerMaxChars();
|
|
128824
129017
|
const chunks = smartChunk(content, file2.relativePath, chunkerMaxChars ? { maxChunkChars: chunkerMaxChars } : {});
|
|
128825
129018
|
let symbols;
|
|
@@ -129373,7 +129566,7 @@ var init_resolver = __esm(() => {
|
|
|
129373
129566
|
});
|
|
129374
129567
|
|
|
129375
129568
|
// ../../packages/core/dist/services/structural/resolvers/typescript.js
|
|
129376
|
-
import
|
|
129569
|
+
import path23 from "path";
|
|
129377
129570
|
function candidates(identities) {
|
|
129378
129571
|
return Object.freeze(identities.map((identity) => Object.freeze({
|
|
129379
129572
|
fqn: identity.fqn,
|
|
@@ -129468,7 +129661,7 @@ function probe(base, known, dialect = "typescript") {
|
|
|
129468
129661
|
const bases = /\.[cm]?jsx?$/u.test(base) ? [base.replace(/\.[cm]?jsx?$/u, ".ts"), base.replace(/\.[cm]?jsx?$/u, ".tsx"), base] : [base];
|
|
129469
129662
|
for (const candidateBase of bases)
|
|
129470
129663
|
for (const suffix of DIALECT_PROBES[dialect] ?? [""]) {
|
|
129471
|
-
const value =
|
|
129664
|
+
const value = path23.posix.normalize(`${candidateBase}${suffix}`);
|
|
129472
129665
|
if (!value.startsWith("../") && value !== ".." && known.has(value))
|
|
129473
129666
|
return value;
|
|
129474
129667
|
}
|
|
@@ -129477,7 +129670,7 @@ function probe(base, known, dialect = "typescript") {
|
|
|
129477
129670
|
function resolveStructuralSpecifier(specifier, fromFile, build, dialect = "typescript") {
|
|
129478
129671
|
const known = new Set(build.knownFiles.map(normalizeStructuralFile));
|
|
129479
129672
|
if (specifier.startsWith("./") || specifier.startsWith("../")) {
|
|
129480
|
-
return probe(
|
|
129673
|
+
return probe(path23.posix.join(path23.posix.dirname(fromFile), specifier), known, dialect);
|
|
129481
129674
|
}
|
|
129482
129675
|
const aliases = build.pathAliasesByFile?.[normalizeStructuralFile(fromFile)] ?? build.pathAliases ?? [];
|
|
129483
129676
|
for (const alias of aliases) {
|
|
@@ -129741,7 +129934,7 @@ var init_scripting2 = __esm(() => {
|
|
|
129741
129934
|
});
|
|
129742
129935
|
|
|
129743
129936
|
// ../../packages/core/dist/services/structural/resolvers/systems.js
|
|
129744
|
-
import
|
|
129937
|
+
import path24 from "path";
|
|
129745
129938
|
var DIALECTS, SYSTEMS_LANGUAGE_RESOLVER;
|
|
129746
129939
|
var init_systems2 = __esm(() => {
|
|
129747
129940
|
init_typescript2();
|
|
@@ -129760,7 +129953,7 @@ var init_systems2 = __esm(() => {
|
|
|
129760
129953
|
const bindings = item.bindings.map((binding) => binding.imported === "*" && binding.local === "*" && unresolvedTarget && !unresolvedTarget.qualifier ? { ...binding, imported: unresolvedTarget.name, local: unresolvedTarget.name } : binding);
|
|
129761
129954
|
if (item.specifier === "crate" || item.specifier.startsWith("crate/")) {
|
|
129762
129955
|
const crateRoot = file2.file.startsWith("src/") ? "src" : "";
|
|
129763
|
-
return { ...item, bindings, specifier: `./${
|
|
129956
|
+
return { ...item, bindings, specifier: `./${path24.posix.relative(path24.posix.dirname(file2.file), path24.posix.join(crateRoot, item.specifier.replace(/^crate\/?/u, "")))}` };
|
|
129764
129957
|
}
|
|
129765
129958
|
if (item.specifier === "self" || item.specifier.startsWith("self/"))
|
|
129766
129959
|
return { ...item, bindings, specifier: `./${item.specifier.replace(/^self\/?/u, "")}` };
|
|
@@ -129858,8 +130051,8 @@ var init_data_document2 = __esm(() => {
|
|
|
129858
130051
|
});
|
|
129859
130052
|
|
|
129860
130053
|
// ../../packages/core/dist/services/etl/stages/resolve.js
|
|
129861
|
-
import
|
|
129862
|
-
import
|
|
130054
|
+
import path25 from "path";
|
|
130055
|
+
import fs17 from "fs";
|
|
129863
130056
|
|
|
129864
130057
|
class ResolveStage {
|
|
129865
130058
|
symbolRepository;
|
|
@@ -129883,7 +130076,7 @@ class ResolveStage {
|
|
|
129883
130076
|
const structuralDocuments = files.flatMap((file2) => {
|
|
129884
130077
|
if (!file2.structure)
|
|
129885
130078
|
return [];
|
|
129886
|
-
const language = resolveStructuralLanguage(
|
|
130079
|
+
const language = resolveStructuralLanguage(path25.extname(file2.file.relativePath));
|
|
129887
130080
|
if (language.status !== "supported")
|
|
129888
130081
|
throw new Error(`structural_manifest_missing:${file2.file.relativePath}`);
|
|
129889
130082
|
return [{
|
|
@@ -129895,13 +130088,13 @@ class ResolveStage {
|
|
|
129895
130088
|
}];
|
|
129896
130089
|
});
|
|
129897
130090
|
const currentStructuralFiles = new Set(structuralDocuments.map((document2) => document2.file));
|
|
129898
|
-
const skippedStructuralFiles = new Set(files.filter((item) => !item.file.needsReparse && STRUCTURAL_SEED_EXTENSIONS.has(
|
|
130091
|
+
const skippedStructuralFiles = new Set(files.filter((item) => !item.file.needsReparse && STRUCTURAL_SEED_EXTENSIONS.has(path25.extname(item.file.relativePath).toLowerCase())).map((item) => item.file.relativePath));
|
|
129899
130092
|
const pathAliasesByFile = Object.fromEntries([...knownRelPaths].map((file2) => [
|
|
129900
130093
|
file2,
|
|
129901
130094
|
this.structuralAliasesFor(file2, rootAliases, monorepoPackages)
|
|
129902
130095
|
]));
|
|
129903
130096
|
const buildMetadata = { knownFiles: [...knownRelPaths], pathAliasesByFile };
|
|
129904
|
-
const seedRows = repositoryDefinitions.filter((definition) => STRUCTURAL_SEED_EXTENSIONS.has(
|
|
130097
|
+
const seedRows = repositoryDefinitions.filter((definition) => STRUCTURAL_SEED_EXTENSIONS.has(path25.extname(definition.file_path).toLowerCase())).filter((definition) => knownRelPaths.has(definition.file_path) && skippedStructuralFiles.has(definition.file_path)).filter((definition) => !currentStructuralFiles.has(definition.file_path));
|
|
129905
130098
|
const seedIds = new Set;
|
|
129906
130099
|
for (const definition of seedRows) {
|
|
129907
130100
|
if (seedIds.has(definition.id))
|
|
@@ -129994,7 +130187,7 @@ class ResolveStage {
|
|
|
129994
130187
|
if (parsed.file !== definition.file_path) {
|
|
129995
130188
|
throw new Error(`structural_repository_seed_file_mismatch:${definition.id}`);
|
|
129996
130189
|
}
|
|
129997
|
-
const language = resolveStructuralLanguage(
|
|
130190
|
+
const language = resolveStructuralLanguage(path25.extname(definition.file_path));
|
|
129998
130191
|
if (language.status !== "supported")
|
|
129999
130192
|
throw new Error(`structural_repository_seed_language:${definition.id}`);
|
|
130000
130193
|
let identity;
|
|
@@ -130046,7 +130239,7 @@ class ResolveStage {
|
|
|
130046
130239
|
});
|
|
130047
130240
|
}
|
|
130048
130241
|
resolveFile(parsed, projectPath, knownRelPaths, rootAliases, monorepoPackages, symbolIndex, knownFqns) {
|
|
130049
|
-
const fromDir =
|
|
130242
|
+
const fromDir = path25.dirname(path25.join(projectPath, parsed.file.relativePath));
|
|
130050
130243
|
const packageAliases = this.getPackageAliases(parsed.file.relativePath, monorepoPackages);
|
|
130051
130244
|
const allAliases = [...packageAliases, ...rootAliases];
|
|
130052
130245
|
const resolvedImports = parsed.rawImports.map((raw2) => {
|
|
@@ -130117,7 +130310,7 @@ class ResolveStage {
|
|
|
130117
130310
|
index.set(def.name, `${def.file_path}#${def.name}`);
|
|
130118
130311
|
}
|
|
130119
130312
|
} catch (err) {
|
|
130120
|
-
const skippedStructural = files.some((file2) => !file2.file.needsReparse && STRUCTURAL_SEED_EXTENSIONS.has(
|
|
130313
|
+
const skippedStructural = files.some((file2) => !file2.file.needsReparse && STRUCTURAL_SEED_EXTENSIONS.has(path25.extname(file2.file.relativePath).toLowerCase()));
|
|
130121
130314
|
if (skippedStructural)
|
|
130122
130315
|
throw new Error("structural_repository_seed_failed", { cause: err });
|
|
130123
130316
|
logger.warn("buildSymbolIndex: repo seed failed, in-batch only", {
|
|
@@ -130141,7 +130334,7 @@ class ResolveStage {
|
|
|
130141
130334
|
}
|
|
130142
130335
|
resolveSpecifier(specifier, fromDir, projectPath, knownRelPaths, aliases) {
|
|
130143
130336
|
if (specifier.startsWith("./") || specifier.startsWith("../")) {
|
|
130144
|
-
const resolved = this.probeExtensions(
|
|
130337
|
+
const resolved = this.probeExtensions(path25.resolve(fromDir, specifier), projectPath, knownRelPaths);
|
|
130145
130338
|
return { resolvedPath: resolved, external: false };
|
|
130146
130339
|
}
|
|
130147
130340
|
for (const alias of aliases) {
|
|
@@ -130149,8 +130342,8 @@ class ResolveStage {
|
|
|
130149
130342
|
const suffix = specifier.slice(alias.prefix.length);
|
|
130150
130343
|
for (const target of alias.targets) {
|
|
130151
130344
|
const cleanTarget = target.replace(/\/\*$/, "");
|
|
130152
|
-
const basePath = alias.packagePath ?
|
|
130153
|
-
const absPath =
|
|
130345
|
+
const basePath = alias.packagePath ? path25.join(projectPath, alias.packagePath) : projectPath;
|
|
130346
|
+
const absPath = path25.join(basePath, cleanTarget + suffix);
|
|
130154
130347
|
const resolved = this.probeExtensions(absPath, projectPath, knownRelPaths);
|
|
130155
130348
|
if (resolved)
|
|
130156
130349
|
return { resolvedPath: resolved, external: false };
|
|
@@ -130166,7 +130359,7 @@ class ResolveStage {
|
|
|
130166
130359
|
...TS_EXTENSIONS.map((ext2) => absPath.replace(/\.[^.]+$/, ext2))
|
|
130167
130360
|
];
|
|
130168
130361
|
for (const candidate2 of candidates2) {
|
|
130169
|
-
const rel =
|
|
130362
|
+
const rel = path25.relative(projectPath, candidate2).replace(/\\/g, "/");
|
|
130170
130363
|
if (knownRelPaths.has(rel))
|
|
130171
130364
|
return rel;
|
|
130172
130365
|
}
|
|
@@ -130174,9 +130367,9 @@ class ResolveStage {
|
|
|
130174
130367
|
}
|
|
130175
130368
|
loadTsConfigPaths(projectPath, packageBase) {
|
|
130176
130369
|
const aliases = [];
|
|
130177
|
-
const tsconfigPath =
|
|
130370
|
+
const tsconfigPath = path25.join(projectPath, "tsconfig.json");
|
|
130178
130371
|
try {
|
|
130179
|
-
const raw2 =
|
|
130372
|
+
const raw2 = fs17.readFileSync(tsconfigPath, "utf-8");
|
|
130180
130373
|
const stripped = raw2.replace(/\/\/[^\n]*/g, "").replace(/\/\*[\s\S]*?\*\//g, "");
|
|
130181
130374
|
const tsconfig = JSON.parse(stripped);
|
|
130182
130375
|
const paths = tsconfig?.compilerOptions?.paths ?? {};
|
|
@@ -130205,7 +130398,7 @@ class ResolveStage {
|
|
|
130205
130398
|
}
|
|
130206
130399
|
}
|
|
130207
130400
|
for (const packageRelPath of packagePaths) {
|
|
130208
|
-
const absPackagePath =
|
|
130401
|
+
const absPackagePath = path25.join(projectPath, packageRelPath);
|
|
130209
130402
|
const aliases = this.loadTsConfigPaths(absPackagePath, packageRelPath);
|
|
130210
130403
|
if (aliases.length > 0) {
|
|
130211
130404
|
packages.push({
|
|
@@ -130235,7 +130428,7 @@ class ResolveStage {
|
|
|
130235
130428
|
structuralAliasesFor(filePath, rootAliases, packages) {
|
|
130236
130429
|
return [...this.getPackageAliases(filePath, packages), ...rootAliases].map((alias) => ({
|
|
130237
130430
|
pattern: alias.prefix + (alias.targets.some((target) => target.includes("*")) ? "/*" : ""),
|
|
130238
|
-
targets: alias.targets.map((target) => alias.packagePath ?
|
|
130431
|
+
targets: alias.targets.map((target) => alias.packagePath ? path25.posix.join(alias.packagePath, target) : target)
|
|
130239
130432
|
}));
|
|
130240
130433
|
}
|
|
130241
130434
|
}
|
|
@@ -130299,7 +130492,7 @@ var init_with_deadlock_retry = __esm(() => {
|
|
|
130299
130492
|
});
|
|
130300
130493
|
|
|
130301
130494
|
// ../../packages/core/dist/services/etl/stages/load.js
|
|
130302
|
-
import
|
|
130495
|
+
import path26 from "path";
|
|
130303
130496
|
function formatDuration(ms) {
|
|
130304
130497
|
const totalSec = Math.max(0, Math.round(ms / 1000));
|
|
130305
130498
|
if (totalSec < 60)
|
|
@@ -130576,7 +130769,7 @@ class LoadStage {
|
|
|
130576
130769
|
const filePath = file2.file.relativePath;
|
|
130577
130770
|
const batch = buildSymbolPersistenceBatch(ctx.projectId, file2);
|
|
130578
130771
|
if (ctx.graphGenerationLease) {
|
|
130579
|
-
const manifest = getLanguageManifestEntry(
|
|
130772
|
+
const manifest = getLanguageManifestEntry(path26.extname(filePath));
|
|
130580
130773
|
const diagnostics2 = (file2.structuralDiagnostics ?? []).slice(0, 10).map((diagnostic2) => ({
|
|
130581
130774
|
code: diagnostic2.code,
|
|
130582
130775
|
severity: diagnostic2.severity,
|
|
@@ -131033,9 +131226,9 @@ var init_graph_generation_coordinator = __esm(() => {
|
|
|
131033
131226
|
// ../../packages/core/dist/services/etl/pipeline.js
|
|
131034
131227
|
import { createHash as createHash7 } from "crypto";
|
|
131035
131228
|
import { setTimeout as delay2 } from "timers/promises";
|
|
131036
|
-
import
|
|
131229
|
+
import path27 from "path";
|
|
131037
131230
|
function buildHeaderLanguageEvidence(files) {
|
|
131038
|
-
const headers = new Set(files.filter((file2) =>
|
|
131231
|
+
const headers = new Set(files.filter((file2) => path27.posix.extname(file2.relativePath).toLowerCase() === ".h").map((file2) => path27.posix.normalize(file2.relativePath)));
|
|
131039
131232
|
const mutable = new Map;
|
|
131040
131233
|
const entry2 = (header) => {
|
|
131041
131234
|
let value = mutable.get(header);
|
|
@@ -131046,7 +131239,7 @@ function buildHeaderLanguageEvidence(files) {
|
|
|
131046
131239
|
return value;
|
|
131047
131240
|
};
|
|
131048
131241
|
for (const file2 of files) {
|
|
131049
|
-
if (
|
|
131242
|
+
if (path27.posix.basename(file2.relativePath) !== "compile_commands.json" || file2.snapshotContent === undefined)
|
|
131050
131243
|
continue;
|
|
131051
131244
|
let commands;
|
|
131052
131245
|
try {
|
|
@@ -131062,11 +131255,11 @@ function buildHeaderLanguageEvidence(files) {
|
|
|
131062
131255
|
const record3 = command;
|
|
131063
131256
|
if (typeof record3.file !== "string")
|
|
131064
131257
|
continue;
|
|
131065
|
-
const projectRoot =
|
|
131066
|
-
const commandDirectory = typeof record3.directory === "string" ?
|
|
131067
|
-
const absoluteInput =
|
|
131068
|
-
const relative2 =
|
|
131069
|
-
const header =
|
|
131258
|
+
const projectRoot = path27.resolve(file2.absolutePath, ...file2.relativePath.split("/").map(() => ".."));
|
|
131259
|
+
const commandDirectory = typeof record3.directory === "string" ? path27.resolve(projectRoot, record3.directory) : projectRoot;
|
|
131260
|
+
const absoluteInput = path27.resolve(commandDirectory, record3.file);
|
|
131261
|
+
const relative2 = path27.relative(projectRoot, absoluteInput);
|
|
131262
|
+
const header = path27.posix.normalize(relative2.replaceAll(path27.sep, "/"));
|
|
131070
131263
|
if (!headers.has(header))
|
|
131071
131264
|
continue;
|
|
131072
131265
|
const invocation = typeof record3.command === "string" ? record3.command : Array.isArray(record3.arguments) ? record3.arguments.join(" ") : "";
|
|
@@ -131613,9 +131806,9 @@ var init_acquire_indexing_lease = __esm(() => {
|
|
|
131613
131806
|
|
|
131614
131807
|
// ../../packages/core/dist/services/project-identity/project-root-identity.js
|
|
131615
131808
|
import { realpath as realpath2 } from "fs/promises";
|
|
131616
|
-
import
|
|
131809
|
+
import path28 from "path";
|
|
131617
131810
|
async function canonicalizeProjectRoot(projectPath, canonicalize = realpath2) {
|
|
131618
|
-
return canonicalize(
|
|
131811
|
+
return canonicalize(path28.resolve(projectPath));
|
|
131619
131812
|
}
|
|
131620
131813
|
async function assertProjectRootReuse(options) {
|
|
131621
131814
|
if (!options.storedProjectPath || options.forceReindex)
|
|
@@ -131623,9 +131816,9 @@ async function assertProjectRootReuse(options) {
|
|
|
131623
131816
|
const canonicalize = options.canonicalize ?? realpath2;
|
|
131624
131817
|
let storedCanonical;
|
|
131625
131818
|
try {
|
|
131626
|
-
storedCanonical = await canonicalize(
|
|
131819
|
+
storedCanonical = await canonicalize(path28.resolve(options.storedProjectPath));
|
|
131627
131820
|
} catch {
|
|
131628
|
-
storedCanonical =
|
|
131821
|
+
storedCanonical = path28.resolve(options.storedProjectPath);
|
|
131629
131822
|
}
|
|
131630
131823
|
if (storedCanonical !== options.canonicalProjectPath) {
|
|
131631
131824
|
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");
|
|
@@ -132368,16 +132561,16 @@ function detectRoutes(httpEdges, defs, opts = {}) {
|
|
|
132368
132561
|
const seen = new Set;
|
|
132369
132562
|
const out = [];
|
|
132370
132563
|
for (const e of httpEdges) {
|
|
132371
|
-
const
|
|
132372
|
-
if (!
|
|
132564
|
+
const path29 = e.route;
|
|
132565
|
+
if (!path29)
|
|
132373
132566
|
continue;
|
|
132374
132567
|
const method = (e.method ?? "ANY").toUpperCase();
|
|
132375
|
-
const key = method + " " +
|
|
132568
|
+
const key = method + " " + path29;
|
|
132376
132569
|
if (seen.has(key))
|
|
132377
132570
|
continue;
|
|
132378
132571
|
seen.add(key);
|
|
132379
132572
|
out.push({
|
|
132380
|
-
path:
|
|
132573
|
+
path: path29,
|
|
132381
132574
|
method: e.method,
|
|
132382
132575
|
file: e.fromFile,
|
|
132383
132576
|
handler: e.targetFqn ?? e.symbolName
|
|
@@ -132388,12 +132581,12 @@ function detectRoutes(httpEdges, defs, opts = {}) {
|
|
|
132388
132581
|
continue;
|
|
132389
132582
|
const parsed = parseRouteName(d.name);
|
|
132390
132583
|
const method = parsed?.method ?? "ANY";
|
|
132391
|
-
const
|
|
132392
|
-
const key = method + " " +
|
|
132584
|
+
const path29 = parsed?.path ?? d.name;
|
|
132585
|
+
const key = method + " " + path29;
|
|
132393
132586
|
if (seen.has(key))
|
|
132394
132587
|
continue;
|
|
132395
132588
|
seen.add(key);
|
|
132396
|
-
out.push({ path:
|
|
132589
|
+
out.push({ path: path29, method: parsed?.method, file: d.filePath, handler: d.name });
|
|
132397
132590
|
}
|
|
132398
132591
|
for (const d of defs) {
|
|
132399
132592
|
const parsed = parseRouteName(d.name);
|
|
@@ -132614,8 +132807,8 @@ __export(exports_symbol_graph_service, {
|
|
|
132614
132807
|
symbolGraphService: () => symbolGraphService,
|
|
132615
132808
|
SymbolGraphService: () => SymbolGraphService
|
|
132616
132809
|
});
|
|
132617
|
-
import
|
|
132618
|
-
import
|
|
132810
|
+
import path29 from "path";
|
|
132811
|
+
import fs18 from "fs/promises";
|
|
132619
132812
|
|
|
132620
132813
|
class SymbolGraphService {
|
|
132621
132814
|
identityLookup;
|
|
@@ -132943,7 +133136,7 @@ class SymbolGraphService {
|
|
|
132943
133136
|
async readSnippet(relativePath, lineStart, lineEnd, projectId) {
|
|
132944
133137
|
try {
|
|
132945
133138
|
const absolutePath = await this.resolveToAbsolute(relativePath, projectId);
|
|
132946
|
-
const content = await
|
|
133139
|
+
const content = await fs18.readFile(absolutePath, "utf-8");
|
|
132947
133140
|
const lines = content.split(`
|
|
132948
133141
|
`);
|
|
132949
133142
|
return lines.slice(Math.max(0, lineStart - 1), Math.min(lines.length, lineEnd)).join(`
|
|
@@ -132955,7 +133148,7 @@ class SymbolGraphService {
|
|
|
132955
133148
|
async readContext(relativePath, lineNumber, contextLines, projectId) {
|
|
132956
133149
|
try {
|
|
132957
133150
|
const absolutePath = await this.resolveToAbsolute(relativePath, projectId);
|
|
132958
|
-
const content = await
|
|
133151
|
+
const content = await fs18.readFile(absolutePath, "utf-8");
|
|
132959
133152
|
const lines = content.split(`
|
|
132960
133153
|
`);
|
|
132961
133154
|
const start = Math.max(0, lineNumber - contextLines - 1);
|
|
@@ -132968,7 +133161,7 @@ class SymbolGraphService {
|
|
|
132968
133161
|
}
|
|
132969
133162
|
async resolveToAbsolute(relativePath, projectId) {
|
|
132970
133163
|
const root = await this.getProjectRoot(projectId);
|
|
132971
|
-
return root ?
|
|
133164
|
+
return root ? path29.resolve(root, relativePath) : relativePath;
|
|
132972
133165
|
}
|
|
132973
133166
|
async getProjectRoot(projectId) {
|
|
132974
133167
|
const cached2 = this.projectRootCache.get(projectId);
|
|
@@ -133111,7 +133304,7 @@ var init_workspace_manager = __esm(() => {
|
|
|
133111
133304
|
});
|
|
133112
133305
|
|
|
133113
133306
|
// ../../packages/core/dist/tools/index_project.js
|
|
133114
|
-
import
|
|
133307
|
+
import path30 from "path";
|
|
133115
133308
|
|
|
133116
133309
|
class IndexProjectTool {
|
|
133117
133310
|
name = "index_project";
|
|
@@ -133159,7 +133352,7 @@ class IndexProjectTool {
|
|
|
133159
133352
|
try {
|
|
133160
133353
|
await assertParserReadyForIndexing();
|
|
133161
133354
|
const canonicalProjectPath = await canonicalizeProjectRoot(projectPath);
|
|
133162
|
-
const finalProjectId = projectId ||
|
|
133355
|
+
const finalProjectId = projectId || path30.basename(canonicalProjectPath) || "default";
|
|
133163
133356
|
const existing = await workspaceManager.getWorkspace(finalProjectId);
|
|
133164
133357
|
await assertProjectRootReuse({
|
|
133165
133358
|
projectId: finalProjectId,
|
|
@@ -133712,17 +133905,17 @@ function applyReplacer(root, replacer) {
|
|
|
133712
133905
|
return transformChildren(root, replacer, []);
|
|
133713
133906
|
return transformChildren(normalizeValue(replacedRoot), replacer, []);
|
|
133714
133907
|
}
|
|
133715
|
-
function transformChildren(value, replacer,
|
|
133908
|
+
function transformChildren(value, replacer, path31) {
|
|
133716
133909
|
if (isJsonObject(value))
|
|
133717
|
-
return transformObject(value, replacer,
|
|
133910
|
+
return transformObject(value, replacer, path31);
|
|
133718
133911
|
if (isJsonArray(value))
|
|
133719
|
-
return transformArray(value, replacer,
|
|
133912
|
+
return transformArray(value, replacer, path31);
|
|
133720
133913
|
return value;
|
|
133721
133914
|
}
|
|
133722
|
-
function transformObject(obj, replacer,
|
|
133915
|
+
function transformObject(obj, replacer, path31) {
|
|
133723
133916
|
const result = {};
|
|
133724
133917
|
for (const [key, value] of Object.entries(obj)) {
|
|
133725
|
-
const childPath = [...
|
|
133918
|
+
const childPath = [...path31, key];
|
|
133726
133919
|
const replacedValue = replacer(key, value, childPath);
|
|
133727
133920
|
if (replacedValue === undefined)
|
|
133728
133921
|
continue;
|
|
@@ -133730,11 +133923,11 @@ function transformObject(obj, replacer, path30) {
|
|
|
133730
133923
|
}
|
|
133731
133924
|
return result;
|
|
133732
133925
|
}
|
|
133733
|
-
function transformArray(arr, replacer,
|
|
133926
|
+
function transformArray(arr, replacer, path31) {
|
|
133734
133927
|
const result = [];
|
|
133735
133928
|
for (let i = 0;i < arr.length; i++) {
|
|
133736
133929
|
const value = arr[i];
|
|
133737
|
-
const childPath = [...
|
|
133930
|
+
const childPath = [...path31, i];
|
|
133738
133931
|
const replacedValue = replacer(String(i), value, childPath);
|
|
133739
133932
|
if (replacedValue === undefined)
|
|
133740
133933
|
continue;
|
|
@@ -138815,9 +139008,9 @@ var init_session_pin_store = __esm(() => {
|
|
|
138815
139008
|
});
|
|
138816
139009
|
|
|
138817
139010
|
// ../../packages/core/dist/services/hooks/attribution-resolver.js
|
|
138818
|
-
import
|
|
138819
|
-
import
|
|
138820
|
-
import
|
|
139011
|
+
import fs19 from "fs";
|
|
139012
|
+
import os9 from "os";
|
|
139013
|
+
import path31 from "path";
|
|
138821
139014
|
|
|
138822
139015
|
class PgWorkspaceRootProvider {
|
|
138823
139016
|
cache = null;
|
|
@@ -138866,8 +139059,8 @@ class AttributionResolver {
|
|
|
138866
139059
|
this.aliasResolver = options.aliasResolver ?? getProjectIdentityAliasResolver();
|
|
138867
139060
|
this.pins = options.pins ?? new SessionPinStore;
|
|
138868
139061
|
this.canonicalize = options.canonicalize ?? defaultCanonicalize;
|
|
138869
|
-
this.homedir = options.homedir ??
|
|
138870
|
-
this.fsRoot = options.fsRoot ?? (() =>
|
|
139062
|
+
this.homedir = options.homedir ?? os9.homedir;
|
|
139063
|
+
this.fsRoot = options.fsRoot ?? (() => path31.parse(path31.sep).root);
|
|
138871
139064
|
}
|
|
138872
139065
|
async resolve(input) {
|
|
138873
139066
|
const caller = input.callerProjectId;
|
|
@@ -138918,7 +139111,7 @@ class AttributionResolver {
|
|
|
138918
139111
|
}
|
|
138919
139112
|
let bestPath = null;
|
|
138920
139113
|
for (const candidate2 of byPath.keys()) {
|
|
138921
|
-
if (canonicalCwd === candidate2 || canonicalCwd.startsWith(candidate2.endsWith(
|
|
139114
|
+
if (canonicalCwd === candidate2 || canonicalCwd.startsWith(candidate2.endsWith(path31.sep) ? candidate2 : candidate2 + path31.sep)) {
|
|
138922
139115
|
if (bestPath === null || candidate2.length > bestPath.length) {
|
|
138923
139116
|
bestPath = candidate2;
|
|
138924
139117
|
}
|
|
@@ -138941,7 +139134,7 @@ class AttributionResolver {
|
|
|
138941
139134
|
return projectPath2;
|
|
138942
139135
|
const fsRoot = this.fsRoot();
|
|
138943
139136
|
let normalized = projectPath2;
|
|
138944
|
-
while (normalized.length > fsRoot.length && normalized.endsWith(
|
|
139137
|
+
while (normalized.length > fsRoot.length && normalized.endsWith(path31.sep)) {
|
|
138945
139138
|
normalized = normalized.slice(0, -1);
|
|
138946
139139
|
}
|
|
138947
139140
|
return normalized;
|
|
@@ -138949,10 +139142,10 @@ class AttributionResolver {
|
|
|
138949
139142
|
}
|
|
138950
139143
|
function defaultCanonicalize(cwd) {
|
|
138951
139144
|
try {
|
|
138952
|
-
return
|
|
139145
|
+
return fs19.realpathSync(cwd);
|
|
138953
139146
|
} catch {
|
|
138954
139147
|
try {
|
|
138955
|
-
return
|
|
139148
|
+
return path31.resolve(cwd);
|
|
138956
139149
|
} catch {
|
|
138957
139150
|
return;
|
|
138958
139151
|
}
|
|
@@ -139700,31 +139893,31 @@ class TracePathService {
|
|
|
139700
139893
|
const chains = [];
|
|
139701
139894
|
const seen = new Set;
|
|
139702
139895
|
let walks = 0;
|
|
139703
|
-
const walk = (fqn,
|
|
139896
|
+
const walk = (fqn, path32) => {
|
|
139704
139897
|
if (chains.length >= CHAIN_CAP)
|
|
139705
139898
|
return;
|
|
139706
139899
|
if (walks >= MAX_WALKS)
|
|
139707
139900
|
return;
|
|
139708
139901
|
walks++;
|
|
139709
|
-
const key =
|
|
139902
|
+
const key = path32.join("\u2192");
|
|
139710
139903
|
if (seen.has(key))
|
|
139711
139904
|
return;
|
|
139712
139905
|
seen.add(key);
|
|
139713
139906
|
const next = adj.get(fqn);
|
|
139714
139907
|
if (!next || next.length === 0 || !whoHasChild.has(fqn)) {
|
|
139715
|
-
if (
|
|
139716
|
-
chains.push(
|
|
139908
|
+
if (path32.length > 1)
|
|
139909
|
+
chains.push(path32.map((n) => this.fqnToName(n)).join(" \u2192 "));
|
|
139717
139910
|
return;
|
|
139718
139911
|
}
|
|
139719
139912
|
for (const child of next) {
|
|
139720
139913
|
if (chains.length >= CHAIN_CAP || walks >= MAX_WALKS)
|
|
139721
139914
|
return;
|
|
139722
|
-
if (
|
|
139723
|
-
const cycled = [...
|
|
139915
|
+
if (path32.includes(child)) {
|
|
139916
|
+
const cycled = [...path32, `${this.fqnToName(child)}\u21BA`];
|
|
139724
139917
|
chains.push(cycled.map((n) => n).join(" \u2192 "));
|
|
139725
139918
|
continue;
|
|
139726
139919
|
}
|
|
139727
|
-
walk(child, [...
|
|
139920
|
+
walk(child, [...path32, child]);
|
|
139728
139921
|
}
|
|
139729
139922
|
};
|
|
139730
139923
|
for (const seed of seeds) {
|
|
@@ -140557,7 +140750,7 @@ var init_get_architecture = __esm(() => {
|
|
|
140557
140750
|
});
|
|
140558
140751
|
|
|
140559
140752
|
// ../../packages/core/dist/services/file-read/file-content-cache.js
|
|
140560
|
-
import
|
|
140753
|
+
import fs20 from "fs/promises";
|
|
140561
140754
|
|
|
140562
140755
|
class FileContentCache {
|
|
140563
140756
|
extractMetadata;
|
|
@@ -140590,7 +140783,7 @@ class FileContentCache {
|
|
|
140590
140783
|
metadata: cached2.metadata
|
|
140591
140784
|
};
|
|
140592
140785
|
}
|
|
140593
|
-
const content = await
|
|
140786
|
+
const content = await fs20.readFile(filePath, "utf-8");
|
|
140594
140787
|
const metadata = await this.extractMetadata(content, filePath, options);
|
|
140595
140788
|
evictOldest(this.fileCache, this.FILE_CACHE_MAX_ENTRIES - 1);
|
|
140596
140789
|
this.fileCache.set(cacheKey, {
|
|
@@ -140607,7 +140800,7 @@ var init_file_content_cache = __esm(() => {
|
|
|
140607
140800
|
});
|
|
140608
140801
|
|
|
140609
140802
|
// ../../packages/core/dist/services/file-read/file-metadata.js
|
|
140610
|
-
import
|
|
140803
|
+
import path32 from "path";
|
|
140611
140804
|
|
|
140612
140805
|
class FileMetadataExtractor {
|
|
140613
140806
|
symbolGraph;
|
|
@@ -140643,7 +140836,7 @@ class FileMetadataExtractor {
|
|
|
140643
140836
|
return metadata;
|
|
140644
140837
|
}
|
|
140645
140838
|
detectLanguage(filePath) {
|
|
140646
|
-
const ext2 =
|
|
140839
|
+
const ext2 = path32.extname(filePath).toLowerCase();
|
|
140647
140840
|
const languageMap2 = {
|
|
140648
140841
|
".ts": "TypeScript",
|
|
140649
140842
|
".tsx": "TypeScript",
|
|
@@ -140765,7 +140958,7 @@ var init_line_range = __esm(() => {
|
|
|
140765
140958
|
});
|
|
140766
140959
|
|
|
140767
140960
|
// ../../packages/core/dist/services/file-read/path-containment.js
|
|
140768
|
-
import
|
|
140961
|
+
import path33 from "path";
|
|
140769
140962
|
|
|
140770
140963
|
class PathContainment {
|
|
140771
140964
|
projectRoots;
|
|
@@ -140773,14 +140966,14 @@ class PathContainment {
|
|
|
140773
140966
|
this.projectRoots = projectRoots;
|
|
140774
140967
|
}
|
|
140775
140968
|
async resolveFilePath(filePath, projectId) {
|
|
140776
|
-
if (
|
|
140777
|
-
return
|
|
140969
|
+
if (path33.isAbsolute(filePath)) {
|
|
140970
|
+
return path33.resolve(filePath);
|
|
140778
140971
|
}
|
|
140779
140972
|
if (projectId) {
|
|
140780
140973
|
const root = await this.projectRoots.getProjectRoot(projectId);
|
|
140781
140974
|
if (root) {
|
|
140782
140975
|
const cleaned = sanitizeFilePath(filePath);
|
|
140783
|
-
return
|
|
140976
|
+
return path33.resolve(root, cleaned);
|
|
140784
140977
|
}
|
|
140785
140978
|
return null;
|
|
140786
140979
|
}
|
|
@@ -140791,17 +140984,17 @@ class PathContainment {
|
|
|
140791
140984
|
if (projectId) {
|
|
140792
140985
|
const root = await this.projectRoots.getProjectRoot(projectId);
|
|
140793
140986
|
if (root)
|
|
140794
|
-
roots.push(
|
|
140987
|
+
roots.push(path33.resolve(root));
|
|
140795
140988
|
}
|
|
140796
|
-
roots.push(
|
|
140989
|
+
roots.push(path33.resolve(process.cwd()));
|
|
140797
140990
|
const envRoots = (process.env.MASSA_AI_READ_FILE_ROOTS ?? "").split(":").map((s) => s.trim()).filter((s) => s.length > 0);
|
|
140798
140991
|
for (const extra of envRoots) {
|
|
140799
|
-
roots.push(
|
|
140992
|
+
roots.push(path33.resolve(extra));
|
|
140800
140993
|
}
|
|
140801
|
-
const target =
|
|
140994
|
+
const target = path33.resolve(absoluteFilePath);
|
|
140802
140995
|
for (const root of roots) {
|
|
140803
|
-
const rel =
|
|
140804
|
-
if (rel !== "" && !rel.startsWith("..") && !
|
|
140996
|
+
const rel = path33.relative(root, target);
|
|
140997
|
+
if (rel !== "" && !rel.startsWith("..") && !path33.isAbsolute(rel)) {
|
|
140805
140998
|
return { allowed: true };
|
|
140806
140999
|
}
|
|
140807
141000
|
if (rel === "")
|
|
@@ -144044,9 +144237,9 @@ var init_inference_probe = __esm(() => {
|
|
|
144044
144237
|
});
|
|
144045
144238
|
|
|
144046
144239
|
// ../../packages/core/dist/services/health/local-health-checker.js
|
|
144047
|
-
import
|
|
144240
|
+
import fs21 from "fs/promises";
|
|
144048
144241
|
import { existsSync as existsSync3 } from "fs";
|
|
144049
|
-
import
|
|
144242
|
+
import path34 from "path";
|
|
144050
144243
|
|
|
144051
144244
|
class LocalHealthChecker {
|
|
144052
144245
|
dataDir = config2.get("dataDir");
|
|
@@ -144124,10 +144317,10 @@ class LocalHealthChecker {
|
|
|
144124
144317
|
const start = Date.now();
|
|
144125
144318
|
try {
|
|
144126
144319
|
if (!existsSync3(this.dataDir))
|
|
144127
|
-
await
|
|
144128
|
-
const probe2 =
|
|
144129
|
-
await
|
|
144130
|
-
await
|
|
144320
|
+
await fs21.mkdir(this.dataDir, { recursive: true });
|
|
144321
|
+
const probe2 = path34.join(this.dataDir, ".health-check-test");
|
|
144322
|
+
await fs21.writeFile(probe2, "ok");
|
|
144323
|
+
await fs21.unlink(probe2);
|
|
144131
144324
|
return { available: true, latency: Date.now() - start, details: { path: this.dataDir, writable: true } };
|
|
144132
144325
|
} catch (error51) {
|
|
144133
144326
|
return { available: false, latency: Date.now() - start, error: `Data directory error: ${error51.message}` };
|
|
@@ -146261,9 +146454,9 @@ var init_scheduler2 = __esm(() => {
|
|
|
146261
146454
|
});
|
|
146262
146455
|
|
|
146263
146456
|
// ../../packages/core/dist/services/pricing/models-dev-client.js
|
|
146264
|
-
import
|
|
146457
|
+
import fs22 from "fs/promises";
|
|
146265
146458
|
import { existsSync as existsSync4 } from "fs";
|
|
146266
|
-
import
|
|
146459
|
+
import path35 from "path";
|
|
146267
146460
|
function getModelsDevClient() {
|
|
146268
146461
|
if (!clientInstance) {
|
|
146269
146462
|
clientInstance = new ModelsDevClient;
|
|
@@ -146283,7 +146476,7 @@ var init_models_dev_client = __esm(() => {
|
|
|
146283
146476
|
memoryCacheTimestamp = 0;
|
|
146284
146477
|
getLocalCachePath() {
|
|
146285
146478
|
const dataDir = config2.get("dataDir");
|
|
146286
|
-
return
|
|
146479
|
+
return path35.join(dataDir, ModelsDevClient.LOCAL_CACHE_FILE);
|
|
146287
146480
|
}
|
|
146288
146481
|
async loadLocalCache() {
|
|
146289
146482
|
const cachePath = this.getLocalCachePath();
|
|
@@ -146291,7 +146484,7 @@ var init_models_dev_client = __esm(() => {
|
|
|
146291
146484
|
if (!existsSync4(cachePath)) {
|
|
146292
146485
|
return null;
|
|
146293
146486
|
}
|
|
146294
|
-
const content = await
|
|
146487
|
+
const content = await fs22.readFile(cachePath, "utf-8");
|
|
146295
146488
|
const data = JSON.parse(content);
|
|
146296
146489
|
const age = Date.now() - data.timestamp;
|
|
146297
146490
|
if (age > ModelsDevClient.LOCAL_CACHE_TTL) {
|
|
@@ -146318,14 +146511,14 @@ var init_models_dev_client = __esm(() => {
|
|
|
146318
146511
|
async saveLocalCache(models) {
|
|
146319
146512
|
const cachePath = this.getLocalCachePath();
|
|
146320
146513
|
try {
|
|
146321
|
-
const dir =
|
|
146322
|
-
await
|
|
146514
|
+
const dir = path35.dirname(cachePath);
|
|
146515
|
+
await fs22.mkdir(dir, { recursive: true });
|
|
146323
146516
|
const data = {
|
|
146324
146517
|
timestamp: Date.now(),
|
|
146325
146518
|
version: "1.0.0",
|
|
146326
146519
|
models: Object.fromEntries(models)
|
|
146327
146520
|
};
|
|
146328
|
-
await
|
|
146521
|
+
await fs22.writeFile(cachePath, JSON.stringify(data), "utf-8");
|
|
146329
146522
|
logger.debug("Saved pricing to local cache", {
|
|
146330
146523
|
models: models.size,
|
|
146331
146524
|
path: cachePath
|
|
@@ -146654,7 +146847,7 @@ var init_models_dev_client = __esm(() => {
|
|
|
146654
146847
|
const cachePath = this.getLocalCachePath();
|
|
146655
146848
|
try {
|
|
146656
146849
|
if (existsSync4(cachePath)) {
|
|
146657
|
-
await
|
|
146850
|
+
await fs22.unlink(cachePath);
|
|
146658
146851
|
logger.debug("Local pricing cache file deleted");
|
|
146659
146852
|
}
|
|
146660
146853
|
} catch (error51) {
|
|
@@ -152209,33 +152402,33 @@ var require_URL = __commonJS((exports, module) => {
|
|
|
152209
152402
|
else
|
|
152210
152403
|
return basepath.substring(0, lastslash + 1) + refpath;
|
|
152211
152404
|
}
|
|
152212
|
-
function remove_dot_segments(
|
|
152213
|
-
if (!
|
|
152214
|
-
return
|
|
152405
|
+
function remove_dot_segments(path36) {
|
|
152406
|
+
if (!path36)
|
|
152407
|
+
return path36;
|
|
152215
152408
|
var output = "";
|
|
152216
|
-
while (
|
|
152217
|
-
if (
|
|
152218
|
-
|
|
152409
|
+
while (path36.length > 0) {
|
|
152410
|
+
if (path36 === "." || path36 === "..") {
|
|
152411
|
+
path36 = "";
|
|
152219
152412
|
break;
|
|
152220
152413
|
}
|
|
152221
|
-
var twochars =
|
|
152222
|
-
var threechars =
|
|
152223
|
-
var fourchars =
|
|
152414
|
+
var twochars = path36.substring(0, 2);
|
|
152415
|
+
var threechars = path36.substring(0, 3);
|
|
152416
|
+
var fourchars = path36.substring(0, 4);
|
|
152224
152417
|
if (threechars === "../") {
|
|
152225
|
-
|
|
152418
|
+
path36 = path36.substring(3);
|
|
152226
152419
|
} else if (twochars === "./") {
|
|
152227
|
-
|
|
152420
|
+
path36 = path36.substring(2);
|
|
152228
152421
|
} else if (threechars === "/./") {
|
|
152229
|
-
|
|
152230
|
-
} else if (twochars === "/." &&
|
|
152231
|
-
|
|
152232
|
-
} else if (fourchars === "/../" || threechars === "/.." &&
|
|
152233
|
-
|
|
152422
|
+
path36 = "/" + path36.substring(3);
|
|
152423
|
+
} else if (twochars === "/." && path36.length === 2) {
|
|
152424
|
+
path36 = "/";
|
|
152425
|
+
} else if (fourchars === "/../" || threechars === "/.." && path36.length === 3) {
|
|
152426
|
+
path36 = "/" + path36.substring(4);
|
|
152234
152427
|
output = output.replace(/\/?[^\/]*$/, "");
|
|
152235
152428
|
} else {
|
|
152236
|
-
var segment =
|
|
152429
|
+
var segment = path36.match(/(\/?([^\/]*))/)[0];
|
|
152237
152430
|
output += segment;
|
|
152238
|
-
|
|
152431
|
+
path36 = path36.substring(segment.length);
|
|
152239
152432
|
}
|
|
152240
152433
|
}
|
|
152241
152434
|
return output;
|
|
@@ -164305,21 +164498,21 @@ function jsonToKeyPathChunks(value, label = "$") {
|
|
|
164305
164498
|
walk(value, label, out);
|
|
164306
164499
|
return out;
|
|
164307
164500
|
}
|
|
164308
|
-
function walk(val,
|
|
164501
|
+
function walk(val, path36, out) {
|
|
164309
164502
|
if (val === null || val === undefined)
|
|
164310
164503
|
return;
|
|
164311
164504
|
if (Array.isArray(val)) {
|
|
164312
164505
|
if (val.length === 0) {
|
|
164313
|
-
out.push({ path:
|
|
164506
|
+
out.push({ path: path36, content: `**${path36}** = _[]_` });
|
|
164314
164507
|
return;
|
|
164315
164508
|
}
|
|
164316
164509
|
if (val.every((v) => v !== null && typeof v === "object")) {
|
|
164317
|
-
val.forEach((v, i) => walk(v, `${
|
|
164510
|
+
val.forEach((v, i) => walk(v, `${path36}[${i}]`, out));
|
|
164318
164511
|
return;
|
|
164319
164512
|
}
|
|
164320
164513
|
const items = val.map((v) => `- \`${String(v)}\``).join(`
|
|
164321
164514
|
`);
|
|
164322
|
-
out.push({ path:
|
|
164515
|
+
out.push({ path: path36, content: `**${path36}**
|
|
164323
164516
|
|
|
164324
164517
|
${items}` });
|
|
164325
164518
|
return;
|
|
@@ -164327,16 +164520,16 @@ ${items}` });
|
|
|
164327
164520
|
if (typeof val === "object") {
|
|
164328
164521
|
const entries = Object.entries(val);
|
|
164329
164522
|
if (entries.length === 0) {
|
|
164330
|
-
out.push({ path:
|
|
164523
|
+
out.push({ path: path36, content: `**${path36}** = _{}_` });
|
|
164331
164524
|
return;
|
|
164332
164525
|
}
|
|
164333
164526
|
for (const [k, v] of entries) {
|
|
164334
164527
|
const safeKey = /^[A-Za-z_$][\w$]*$/.test(k) ? k : JSON.stringify(k);
|
|
164335
|
-
walk(v, `${
|
|
164528
|
+
walk(v, `${path36}.${safeKey}`, out);
|
|
164336
164529
|
}
|
|
164337
164530
|
return;
|
|
164338
164531
|
}
|
|
164339
|
-
out.push({ path:
|
|
164532
|
+
out.push({ path: path36, content: `**${path36}** = \`${String(val)}\`` });
|
|
164340
164533
|
}
|
|
164341
164534
|
var gfm, STRIP_SELECTORS, tdCache = null;
|
|
164342
164535
|
var init_html_to_md = __esm(() => {
|
|
@@ -165099,8 +165292,8 @@ var init_hook_service = __esm(() => {
|
|
|
165099
165292
|
|
|
165100
165293
|
// ../../packages/core/dist/services/bootstrap/bootstrap-service.js
|
|
165101
165294
|
import { randomUUID as randomUUID9 } from "crypto";
|
|
165102
|
-
import
|
|
165103
|
-
import
|
|
165295
|
+
import fs23 from "fs";
|
|
165296
|
+
import path36 from "path";
|
|
165104
165297
|
import { spawn as spawn2 } from "child_process";
|
|
165105
165298
|
function readBootstrapConfig() {
|
|
165106
165299
|
try {
|
|
@@ -165260,9 +165453,9 @@ async function scanSignals(_projectId, projectRoot, caps, symbolGraph, gitRunner
|
|
|
165260
165453
|
}
|
|
165261
165454
|
try {
|
|
165262
165455
|
for (const name26 of README_CANDIDATES) {
|
|
165263
|
-
const p =
|
|
165264
|
-
if (
|
|
165265
|
-
const buf =
|
|
165456
|
+
const p = path36.join(projectRoot, name26);
|
|
165457
|
+
if (fs23.existsSync(p) && fs23.statSync(p).isFile()) {
|
|
165458
|
+
const buf = fs23.readFileSync(p);
|
|
165266
165459
|
signals.readme = buf.slice(0, MAX_README_BYTES).toString("utf8");
|
|
165267
165460
|
break;
|
|
165268
165461
|
}
|
|
@@ -165271,14 +165464,14 @@ async function scanSignals(_projectId, projectRoot, caps, symbolGraph, gitRunner
|
|
|
165271
165464
|
logger.debug("bootstrap scan: README read failed", { error: e.message });
|
|
165272
165465
|
}
|
|
165273
165466
|
try {
|
|
165274
|
-
const docsDir =
|
|
165275
|
-
if (
|
|
165467
|
+
const docsDir = path36.join(projectRoot, "docs");
|
|
165468
|
+
if (fs23.existsSync(docsDir) && fs23.statSync(docsDir).isDirectory()) {
|
|
165276
165469
|
const entries = walkMarkdown(docsDir).slice(0, MAX_DOCS);
|
|
165277
165470
|
for (const rel of entries) {
|
|
165278
165471
|
try {
|
|
165279
|
-
const buf =
|
|
165472
|
+
const buf = fs23.readFileSync(rel);
|
|
165280
165473
|
signals.docs.push({
|
|
165281
|
-
path:
|
|
165474
|
+
path: path36.relative(projectRoot, rel),
|
|
165282
165475
|
snippet: buf.slice(0, MAX_DOC_BYTES).toString("utf8")
|
|
165283
165476
|
});
|
|
165284
165477
|
} catch {}
|
|
@@ -165289,10 +165482,10 @@ async function scanSignals(_projectId, projectRoot, caps, symbolGraph, gitRunner
|
|
|
165289
165482
|
}
|
|
165290
165483
|
try {
|
|
165291
165484
|
for (const name26 of MANIFEST_FILES) {
|
|
165292
|
-
const p =
|
|
165293
|
-
if (!
|
|
165485
|
+
const p = path36.join(projectRoot, name26);
|
|
165486
|
+
if (!fs23.existsSync(p) || !fs23.statSync(p).isFile())
|
|
165294
165487
|
continue;
|
|
165295
|
-
const raw2 =
|
|
165488
|
+
const raw2 = fs23.readFileSync(p).slice(0, MAX_MANIFEST_BYTES).toString("utf8");
|
|
165296
165489
|
const kind = name26;
|
|
165297
165490
|
if (name26 === "package.json") {
|
|
165298
165491
|
try {
|
|
@@ -165332,12 +165525,12 @@ function walkMarkdown(dir) {
|
|
|
165332
165525
|
const cur = stack.pop();
|
|
165333
165526
|
let entries;
|
|
165334
165527
|
try {
|
|
165335
|
-
entries =
|
|
165528
|
+
entries = fs23.readdirSync(cur, { withFileTypes: true });
|
|
165336
165529
|
} catch {
|
|
165337
165530
|
continue;
|
|
165338
165531
|
}
|
|
165339
165532
|
for (const e of entries) {
|
|
165340
|
-
const full =
|
|
165533
|
+
const full = path36.join(cur, e.name);
|
|
165341
165534
|
if (e.isDirectory()) {
|
|
165342
165535
|
if (e.name === "node_modules" || e.name.startsWith("."))
|
|
165343
165536
|
continue;
|
|
@@ -168867,7 +169060,7 @@ class StdioServerTransport {
|
|
|
168867
169060
|
}
|
|
168868
169061
|
|
|
168869
169062
|
// src/index.ts
|
|
168870
|
-
import
|
|
169063
|
+
import fs26 from "fs/promises";
|
|
168871
169064
|
|
|
168872
169065
|
// src/api-client.ts
|
|
168873
169066
|
init_config();
|
|
@@ -168977,8 +169170,8 @@ init_dist();
|
|
|
168977
169170
|
init_dist();
|
|
168978
169171
|
init_dist15();
|
|
168979
169172
|
init_dist();
|
|
168980
|
-
import
|
|
168981
|
-
import
|
|
169173
|
+
import fs24 from "fs/promises";
|
|
169174
|
+
import path37 from "path";
|
|
168982
169175
|
var _indexProjectTool = null;
|
|
168983
169176
|
function indexProjectTool() {
|
|
168984
169177
|
if (!_indexProjectTool)
|
|
@@ -169281,8 +169474,8 @@ class EmbeddedApiClient {
|
|
|
169281
169474
|
} else {
|
|
169282
169475
|
end = start + 20;
|
|
169283
169476
|
}
|
|
169284
|
-
const absolutePath =
|
|
169285
|
-
const content = await
|
|
169477
|
+
const absolutePath = path37.join(workspace.project_path, file2);
|
|
169478
|
+
const content = await fs24.readFile(absolutePath, "utf-8");
|
|
169286
169479
|
const lines = content.split(/\r?\n/);
|
|
169287
169480
|
const slice = lines.slice(start - 1, Math.min(lines.length, end));
|
|
169288
169481
|
const formatted = slice.map((text3, idx) => ({ lineNumber: start + idx, content: text3 }));
|
|
@@ -169537,22 +169730,22 @@ class EmbeddedApiClient {
|
|
|
169537
169730
|
async uploadAndIndex(params) {
|
|
169538
169731
|
const rawBase = params.projectId || params.projectPath.replace(/\\/g, "/").split("/").filter(Boolean).pop() || "default";
|
|
169539
169732
|
const finalProjectId = rawBase.replace(/[^a-zA-Z0-9_.-]/g, "_").slice(0, 128);
|
|
169540
|
-
const uploadRoot = process.env.MASSA_AI_UPLOAD_DIR ||
|
|
169541
|
-
const stagingDir =
|
|
169542
|
-
await
|
|
169543
|
-
await
|
|
169733
|
+
const uploadRoot = process.env.MASSA_AI_UPLOAD_DIR || path37.join(getGlobalDataDir(), "uploads");
|
|
169734
|
+
const stagingDir = path37.resolve(uploadRoot, finalProjectId);
|
|
169735
|
+
await fs24.rm(stagingDir, { recursive: true, force: true });
|
|
169736
|
+
await fs24.mkdir(stagingDir, { recursive: true });
|
|
169544
169737
|
const WRITE_BATCH = 20;
|
|
169545
169738
|
for (let i = 0;i < params.files.length; i += WRITE_BATCH) {
|
|
169546
169739
|
await Promise.all(params.files.slice(i, i + WRITE_BATCH).map(async (file2) => {
|
|
169547
|
-
if (
|
|
169740
|
+
if (path37.isAbsolute(file2.relativePath) || file2.relativePath.includes("..")) {
|
|
169548
169741
|
throw new Error(`Invalid file path: ${file2.relativePath}`);
|
|
169549
169742
|
}
|
|
169550
|
-
const dest =
|
|
169551
|
-
if (!dest.startsWith(stagingDir +
|
|
169743
|
+
const dest = path37.resolve(stagingDir, file2.relativePath.replace(/\//g, path37.sep));
|
|
169744
|
+
if (!dest.startsWith(stagingDir + path37.sep)) {
|
|
169552
169745
|
throw new Error(`Path escapes staging directory: ${file2.relativePath}`);
|
|
169553
169746
|
}
|
|
169554
|
-
await
|
|
169555
|
-
await
|
|
169747
|
+
await fs24.mkdir(path37.dirname(dest), { recursive: true });
|
|
169748
|
+
await fs24.writeFile(dest, file2.content, "utf-8");
|
|
169556
169749
|
}));
|
|
169557
169750
|
}
|
|
169558
169751
|
return await indexProjectTool().handle({
|
|
@@ -170049,8 +170242,8 @@ class EmbeddedApiClient {
|
|
|
170049
170242
|
|
|
170050
170243
|
// src/file-collector.ts
|
|
170051
170244
|
init_config();
|
|
170052
|
-
import
|
|
170053
|
-
import
|
|
170245
|
+
import fs25 from "fs/promises";
|
|
170246
|
+
import path38 from "path";
|
|
170054
170247
|
var SKIP_DIRS = new Set([
|
|
170055
170248
|
"node_modules",
|
|
170056
170249
|
".git",
|
|
@@ -170091,7 +170284,7 @@ async function walk2(root2, dir, files, state, allowed) {
|
|
|
170091
170284
|
return;
|
|
170092
170285
|
let entries;
|
|
170093
170286
|
try {
|
|
170094
|
-
entries = await
|
|
170287
|
+
entries = await fs25.readdir(dir, { withFileTypes: true });
|
|
170095
170288
|
} catch {
|
|
170096
170289
|
return;
|
|
170097
170290
|
}
|
|
@@ -170100,22 +170293,22 @@ async function walk2(root2, dir, files, state, allowed) {
|
|
|
170100
170293
|
break;
|
|
170101
170294
|
if (entry2.isDirectory()) {
|
|
170102
170295
|
if (!SKIP_DIRS.has(entry2.name) && !entry2.name.startsWith(".")) {
|
|
170103
|
-
await walk2(root2,
|
|
170296
|
+
await walk2(root2, path38.join(dir, entry2.name), files, state, allowed);
|
|
170104
170297
|
}
|
|
170105
170298
|
} else if (entry2.isFile()) {
|
|
170106
|
-
const ext2 =
|
|
170299
|
+
const ext2 = path38.extname(entry2.name).toLowerCase();
|
|
170107
170300
|
if (!allowed.has(ext2))
|
|
170108
170301
|
continue;
|
|
170109
|
-
const fullPath =
|
|
170302
|
+
const fullPath = path38.join(dir, entry2.name);
|
|
170110
170303
|
try {
|
|
170111
|
-
const stat = await
|
|
170304
|
+
const stat = await fs25.stat(fullPath);
|
|
170112
170305
|
if (stat.size > MAX_FILE_BYTES)
|
|
170113
170306
|
continue;
|
|
170114
170307
|
if (state.totalBytes + stat.size > MAX_TOTAL_BYTES)
|
|
170115
170308
|
continue;
|
|
170116
|
-
const content = await
|
|
170309
|
+
const content = await fs25.readFile(fullPath, "utf-8");
|
|
170117
170310
|
state.totalBytes += stat.size;
|
|
170118
|
-
const relativePath =
|
|
170311
|
+
const relativePath = path38.relative(root2, fullPath).split(path38.sep).join("/");
|
|
170119
170312
|
files.push({ relativePath, content });
|
|
170120
170313
|
} catch {}
|
|
170121
170314
|
}
|
|
@@ -171353,7 +171546,7 @@ var PROJECT_TOOL_DEFINITIONS = [
|
|
|
171353
171546
|
},
|
|
171354
171547
|
{
|
|
171355
171548
|
name: "profile_list",
|
|
171356
|
-
description: "List shipped model profiles and, per detected host, the currently active profile (from recorded state; " + "'balanced' shown when unrecorded) and bundle version. Offline \u2014 reads on-disk variant directories only, " + "never the registry.",
|
|
171549
|
+
description: "List shipped model profiles and, per detected host, the currently active profile (from recorded state; " + "'balanced' shown when unrecorded) and bundle version. Offline \u2014 reads on-disk variant directories only, " + "never the registry. The claude row also carries agent-runtime-drift fields: liveRoot + sourceVersion " + "(the live tree the host actually loads, beside the recorded bundleVersion) and envOverride (a host env " + "var such as CLAUDE_CODE_SUBAGENT_MODEL that overrides every per-agent model at runtime).",
|
|
171357
171550
|
apiEndpoint: "/api/v1/profiles",
|
|
171358
171551
|
apiMethod: "GET",
|
|
171359
171552
|
inputSchema: {
|
|
@@ -172098,7 +172291,7 @@ class McpProxyServer {
|
|
|
172098
172291
|
return textContent(JSON.stringify({ success: false, error: "projectPath is required" }));
|
|
172099
172292
|
}
|
|
172100
172293
|
try {
|
|
172101
|
-
if (!(await
|
|
172294
|
+
if (!(await fs26.stat(projectPath2)).isDirectory()) {
|
|
172102
172295
|
return textContent(JSON.stringify({ success: false, error: `${projectPath2} is not a directory` }));
|
|
172103
172296
|
}
|
|
172104
172297
|
} catch {
|