@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/config-cli.js
CHANGED
|
@@ -2679,12 +2679,13 @@ function selectRecord(records) {
|
|
|
2679
2679
|
}
|
|
2680
2680
|
return best ?? pool[pool.length - 1];
|
|
2681
2681
|
}
|
|
2682
|
-
function
|
|
2682
|
+
function resolveClaudeMarketplaceInstall(opts = {}) {
|
|
2683
2683
|
const targetHome = opts.targetHome ?? os5.homedir();
|
|
2684
2684
|
const pluginKey = opts.pluginKey ?? DEFAULT_PLUGIN_KEY;
|
|
2685
2685
|
const directoryResult = resolveDirectorySourceRoot(targetHome, pluginKey);
|
|
2686
|
-
if (directoryResult !== undefined)
|
|
2687
|
-
return directoryResult;
|
|
2686
|
+
if (directoryResult !== undefined) {
|
|
2687
|
+
return directoryResult === null ? null : { root: directoryResult, route: "directory-source" };
|
|
2688
|
+
}
|
|
2688
2689
|
const registryPath = path9.join(targetHome, ".claude", "plugins", "installed_plugins.json");
|
|
2689
2690
|
let records;
|
|
2690
2691
|
try {
|
|
@@ -2706,15 +2707,197 @@ function resolveClaudeMarketplaceRoot(opts = {}) {
|
|
|
2706
2707
|
} catch {
|
|
2707
2708
|
return null;
|
|
2708
2709
|
}
|
|
2709
|
-
return installPath;
|
|
2710
|
+
return { root: installPath, route: "registry-cache" };
|
|
2711
|
+
}
|
|
2712
|
+
function resolveClaudeMarketplaceRoot(opts = {}) {
|
|
2713
|
+
return resolveClaudeMarketplaceInstall(opts)?.root ?? null;
|
|
2714
|
+
}
|
|
2715
|
+
function readInstalledPluginVersion(opts = {}) {
|
|
2716
|
+
const targetHome = opts.targetHome ?? os5.homedir();
|
|
2717
|
+
const pluginKey = opts.pluginKey ?? DEFAULT_PLUGIN_KEY;
|
|
2718
|
+
const registryPath = path9.join(targetHome, ".claude", "plugins", "installed_plugins.json");
|
|
2719
|
+
let records;
|
|
2720
|
+
try {
|
|
2721
|
+
const parsed = JSON.parse(fs5.readFileSync(registryPath, "utf8"));
|
|
2722
|
+
records = parsed?.plugins?.[pluginKey];
|
|
2723
|
+
} catch {
|
|
2724
|
+
return null;
|
|
2725
|
+
}
|
|
2726
|
+
if (!Array.isArray(records) || records.length === 0)
|
|
2727
|
+
return null;
|
|
2728
|
+
return selectRecord(records)?.version ?? null;
|
|
2710
2729
|
}
|
|
2711
2730
|
var DEFAULT_PLUGIN_KEY = "massa-ai@massa-ai";
|
|
2712
2731
|
var init_claude_marketplace = () => {};
|
|
2713
2732
|
|
|
2714
|
-
// ../../packages/shared/dist/profile-switch/
|
|
2733
|
+
// ../../packages/shared/dist/profile-switch/frontmatter.js
|
|
2734
|
+
function parseFrontmatter(raw2) {
|
|
2735
|
+
const match = /^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/.exec(raw2);
|
|
2736
|
+
if (!match) {
|
|
2737
|
+
throw new Error("charter missing YAML frontmatter (--- ... ---) block");
|
|
2738
|
+
}
|
|
2739
|
+
const yamlText = match[1] ?? "";
|
|
2740
|
+
const body = (match[2] ?? "").replace(/^\r?\n/, "");
|
|
2741
|
+
const frontmatter = parseSimpleYaml(yamlText);
|
|
2742
|
+
return { frontmatter, body };
|
|
2743
|
+
}
|
|
2744
|
+
function parseSimpleYaml(text) {
|
|
2745
|
+
const result = {};
|
|
2746
|
+
const lines = text.split(/\r?\n/);
|
|
2747
|
+
let i = 0;
|
|
2748
|
+
while (i < lines.length) {
|
|
2749
|
+
const line = lines[i] ?? "";
|
|
2750
|
+
if (line.trim() === "" || line.trim().startsWith("#")) {
|
|
2751
|
+
i++;
|
|
2752
|
+
continue;
|
|
2753
|
+
}
|
|
2754
|
+
const m = /^([A-Za-z_][A-Za-z0-9_]*):\s*(.*)$/.exec(line);
|
|
2755
|
+
if (!m) {
|
|
2756
|
+
i++;
|
|
2757
|
+
continue;
|
|
2758
|
+
}
|
|
2759
|
+
const key = m[1];
|
|
2760
|
+
const rest = (m[2] ?? "").trim();
|
|
2761
|
+
if (rest !== "") {
|
|
2762
|
+
result[key] = unquoteScalar(rest);
|
|
2763
|
+
i++;
|
|
2764
|
+
continue;
|
|
2765
|
+
}
|
|
2766
|
+
const nested = {};
|
|
2767
|
+
i++;
|
|
2768
|
+
while (i < lines.length) {
|
|
2769
|
+
const nestedLine = lines[i] ?? "";
|
|
2770
|
+
if (/^\s{2,}\S/.test(nestedLine) === false)
|
|
2771
|
+
break;
|
|
2772
|
+
const nm = /^\s{2,}([A-Za-z_][A-Za-z0-9_]*):\s*(.*)$/.exec(nestedLine);
|
|
2773
|
+
if (!nm)
|
|
2774
|
+
break;
|
|
2775
|
+
nested[nm[1]] = unquoteScalar((nm[2] ?? "").trim());
|
|
2776
|
+
i++;
|
|
2777
|
+
}
|
|
2778
|
+
result[key] = nested;
|
|
2779
|
+
}
|
|
2780
|
+
return result;
|
|
2781
|
+
}
|
|
2782
|
+
function unquoteScalar(s) {
|
|
2783
|
+
if (s.startsWith('"') && s.endsWith('"') || s.startsWith("'") && s.endsWith("'")) {
|
|
2784
|
+
return s.slice(1, -1);
|
|
2785
|
+
}
|
|
2786
|
+
return s;
|
|
2787
|
+
}
|
|
2788
|
+
|
|
2789
|
+
// ../../packages/shared/dist/profile-switch/doctor.js
|
|
2715
2790
|
import fs6 from "fs";
|
|
2716
|
-
import path10 from "path";
|
|
2717
2791
|
import os6 from "os";
|
|
2792
|
+
import path10 from "path";
|
|
2793
|
+
function readTextFile(filePath) {
|
|
2794
|
+
try {
|
|
2795
|
+
return fs6.readFileSync(filePath, "utf8");
|
|
2796
|
+
} catch {
|
|
2797
|
+
return null;
|
|
2798
|
+
}
|
|
2799
|
+
}
|
|
2800
|
+
function readJsonFile(filePath) {
|
|
2801
|
+
const raw2 = readTextFile(filePath);
|
|
2802
|
+
if (raw2 === null)
|
|
2803
|
+
return null;
|
|
2804
|
+
try {
|
|
2805
|
+
return JSON.parse(raw2);
|
|
2806
|
+
} catch {
|
|
2807
|
+
return null;
|
|
2808
|
+
}
|
|
2809
|
+
}
|
|
2810
|
+
function readPluginVersion(pluginRoot) {
|
|
2811
|
+
const manifest = readJsonFile(path10.join(pluginRoot, ".claude-plugin", "plugin.json"));
|
|
2812
|
+
return typeof manifest?.version === "string" ? manifest.version : null;
|
|
2813
|
+
}
|
|
2814
|
+
function detectEnvOverride(env) {
|
|
2815
|
+
for (const name of ENV_OVERRIDE_VARS) {
|
|
2816
|
+
const value = env[name];
|
|
2817
|
+
if (typeof value === "string" && value.trim()) {
|
|
2818
|
+
return { name, value: value.trim() };
|
|
2819
|
+
}
|
|
2820
|
+
}
|
|
2821
|
+
return null;
|
|
2822
|
+
}
|
|
2823
|
+
function readRoles(liveRoot, activeProfile) {
|
|
2824
|
+
const agentsDir = path10.join(liveRoot, "agents");
|
|
2825
|
+
let entries;
|
|
2826
|
+
try {
|
|
2827
|
+
entries = fs6.readdirSync(agentsDir, { withFileTypes: true });
|
|
2828
|
+
} catch {
|
|
2829
|
+
return [];
|
|
2830
|
+
}
|
|
2831
|
+
const roles = [];
|
|
2832
|
+
for (const entry of entries) {
|
|
2833
|
+
if (!entry.isFile() || !entry.name.startsWith("massa-ai-") || !entry.name.endsWith(".md")) {
|
|
2834
|
+
continue;
|
|
2835
|
+
}
|
|
2836
|
+
const activeRaw = readTextFile(path10.join(agentsDir, entry.name));
|
|
2837
|
+
let model = null;
|
|
2838
|
+
let effort = null;
|
|
2839
|
+
if (activeRaw !== null) {
|
|
2840
|
+
try {
|
|
2841
|
+
const { frontmatter } = parseFrontmatter(activeRaw);
|
|
2842
|
+
model = typeof frontmatter.model === "string" ? frontmatter.model : null;
|
|
2843
|
+
effort = typeof frontmatter.effort === "string" ? frontmatter.effort : null;
|
|
2844
|
+
} catch {}
|
|
2845
|
+
}
|
|
2846
|
+
let staleVariant = false;
|
|
2847
|
+
if (activeProfile && activeRaw !== null) {
|
|
2848
|
+
const variantRaw = readTextFile(path10.join(liveRoot, "agent-profiles", activeProfile, entry.name));
|
|
2849
|
+
if (variantRaw !== null) {
|
|
2850
|
+
staleVariant = variantRaw !== activeRaw;
|
|
2851
|
+
}
|
|
2852
|
+
}
|
|
2853
|
+
roles.push({ name: entry.name, model, effort, staleVariant });
|
|
2854
|
+
}
|
|
2855
|
+
return roles.sort((a, b) => a.name.localeCompare(b.name));
|
|
2856
|
+
}
|
|
2857
|
+
function runtimeDriftReport(opts = {}) {
|
|
2858
|
+
const targetHome = opts.targetHome ?? os6.homedir();
|
|
2859
|
+
const stateFilePath = opts.stateFilePath ?? path10.join(targetHome, ".config", "massa-ai", "install-state.json");
|
|
2860
|
+
let state = opts.state ?? null;
|
|
2861
|
+
if (state === null) {
|
|
2862
|
+
try {
|
|
2863
|
+
state = readInstallState(stateFilePath);
|
|
2864
|
+
} catch {
|
|
2865
|
+
state = null;
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
const platform = state?.platforms?.claude;
|
|
2869
|
+
const stateVersion = typeof platform?.plugin?.version === "string" ? platform.plugin.version : null;
|
|
2870
|
+
const activeProfile = platform?.modelProfile?.profile ?? null;
|
|
2871
|
+
const install = resolveClaudeMarketplaceInstall({ targetHome, pluginKey: opts.pluginKey });
|
|
2872
|
+
const liveRoot = install?.root ?? null;
|
|
2873
|
+
const sourceVersion = liveRoot === null ? null : readPluginVersion(liveRoot);
|
|
2874
|
+
const pinnedVersion = readInstalledPluginVersion({ targetHome, pluginKey: opts.pluginKey });
|
|
2875
|
+
const roles = liveRoot === null ? [] : readRoles(liveRoot, activeProfile);
|
|
2876
|
+
return {
|
|
2877
|
+
host: "claude",
|
|
2878
|
+
route: install?.route ?? "unresolved",
|
|
2879
|
+
liveRoot,
|
|
2880
|
+
sourceVersion,
|
|
2881
|
+
stateVersion,
|
|
2882
|
+
pinnedVersion,
|
|
2883
|
+
activeProfile,
|
|
2884
|
+
roles,
|
|
2885
|
+
envOverride: detectEnvOverride(opts.env ?? process.env),
|
|
2886
|
+
versionDrift: sourceVersion !== null && stateVersion !== null && sourceVersion !== stateVersion,
|
|
2887
|
+
profileMaterialized: roles.some((role) => role.staleVariant)
|
|
2888
|
+
};
|
|
2889
|
+
}
|
|
2890
|
+
var ENV_OVERRIDE_VARS;
|
|
2891
|
+
var init_doctor = __esm(() => {
|
|
2892
|
+
init_claude_marketplace();
|
|
2893
|
+
init_state();
|
|
2894
|
+
ENV_OVERRIDE_VARS = ["CLAUDE_CODE_SUBAGENT_MODEL"];
|
|
2895
|
+
});
|
|
2896
|
+
|
|
2897
|
+
// ../../packages/shared/dist/profile-switch/engine.js
|
|
2898
|
+
import fs7 from "fs";
|
|
2899
|
+
import path11 from "path";
|
|
2900
|
+
import os7 from "os";
|
|
2718
2901
|
import crypto4 from "crypto";
|
|
2719
2902
|
import { execFileSync as execFileSync2 } from "child_process";
|
|
2720
2903
|
function namedError3(name, message) {
|
|
@@ -2723,10 +2906,10 @@ function namedError3(name, message) {
|
|
|
2723
2906
|
return err;
|
|
2724
2907
|
}
|
|
2725
2908
|
function defaultStatePath(targetHome) {
|
|
2726
|
-
return
|
|
2909
|
+
return path11.join(targetHome, ".config", "massa-ai", "install-state.json");
|
|
2727
2910
|
}
|
|
2728
2911
|
function resolveCommon(opts) {
|
|
2729
|
-
const targetHome = opts.targetHome ??
|
|
2912
|
+
const targetHome = opts.targetHome ?? os7.homedir();
|
|
2730
2913
|
const stateFilePath = opts.stateFilePath ?? defaultStatePath(targetHome);
|
|
2731
2914
|
return { targetHome, stateFilePath };
|
|
2732
2915
|
}
|
|
@@ -2734,7 +2917,7 @@ function marketplaceRoots(targetHome, state) {
|
|
|
2734
2917
|
return state.platforms.claude?.installRoute === "marketplace" ? { claude: resolveClaudeMarketplaceRoot({ targetHome }) ?? undefined } : {};
|
|
2735
2918
|
}
|
|
2736
2919
|
function claudeMarketplaceUnresolvedReason(targetHome) {
|
|
2737
|
-
const registryPath =
|
|
2920
|
+
const registryPath = path11.join(targetHome, ".claude", "plugins", "installed_plugins.json");
|
|
2738
2921
|
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";
|
|
2739
2922
|
}
|
|
2740
2923
|
function listProfiles(opts = {}) {
|
|
@@ -2742,6 +2925,12 @@ function listProfiles(opts = {}) {
|
|
|
2742
2925
|
const state = readInstallState(stateFilePath);
|
|
2743
2926
|
const roots = marketplaceRoots(targetHome, state);
|
|
2744
2927
|
const universe = opts.hosts ?? HOSTS;
|
|
2928
|
+
const claudeDrift = universe.includes("claude") ? runtimeDriftReport({ targetHome, stateFilePath, state, env: opts.env }) : null;
|
|
2929
|
+
const claudeDriftFields = (host) => host === "claude" && claudeDrift !== null ? {
|
|
2930
|
+
liveRoot: claudeDrift.liveRoot,
|
|
2931
|
+
sourceVersion: claudeDrift.sourceVersion,
|
|
2932
|
+
envOverride: claudeDrift.envOverride ? `${claudeDrift.envOverride.name}=${claudeDrift.envOverride.value}` : null
|
|
2933
|
+
} : { liveRoot: null, sourceVersion: null, envOverride: null };
|
|
2745
2934
|
const hosts = universe.map((host) => {
|
|
2746
2935
|
if (host === "claude" && state.platforms.claude?.installRoute === "marketplace" && roots.claude === undefined) {
|
|
2747
2936
|
const platform2 = state.platforms.claude;
|
|
@@ -2752,7 +2941,8 @@ function listProfiles(opts = {}) {
|
|
|
2752
2941
|
skipReason: null,
|
|
2753
2942
|
activeProfile: platform2.modelProfile?.profile ?? opts.hostDefaults?.[host] ?? "balanced",
|
|
2754
2943
|
bundleVersion: platform2.plugin?.version ?? null,
|
|
2755
|
-
availableProfiles: []
|
|
2944
|
+
availableProfiles: [],
|
|
2945
|
+
...claudeDriftFields(host)
|
|
2756
2946
|
};
|
|
2757
2947
|
}
|
|
2758
2948
|
const layout = resolveHostLayout(host, { targetHome, projectRoot: opts.projectRoot, marketplaceRoot: roots });
|
|
@@ -2764,10 +2954,11 @@ function listProfiles(opts = {}) {
|
|
|
2764
2954
|
skipReason: layout.reason,
|
|
2765
2955
|
activeProfile: null,
|
|
2766
2956
|
bundleVersion: null,
|
|
2767
|
-
availableProfiles: []
|
|
2957
|
+
availableProfiles: [],
|
|
2958
|
+
...claudeDriftFields(host)
|
|
2768
2959
|
};
|
|
2769
2960
|
}
|
|
2770
|
-
const installed =
|
|
2961
|
+
const installed = fs7.existsSync(layout.activeDir);
|
|
2771
2962
|
const availableProfiles = listVariantProfiles(layout);
|
|
2772
2963
|
const platform = state.platforms[host];
|
|
2773
2964
|
return {
|
|
@@ -2777,15 +2968,16 @@ function listProfiles(opts = {}) {
|
|
|
2777
2968
|
skipReason: null,
|
|
2778
2969
|
activeProfile: platform?.modelProfile?.profile ?? opts.hostDefaults?.[host] ?? "balanced",
|
|
2779
2970
|
bundleVersion: platform?.plugin?.version ?? null,
|
|
2780
|
-
availableProfiles
|
|
2971
|
+
availableProfiles,
|
|
2972
|
+
...claudeDriftFields(host)
|
|
2781
2973
|
};
|
|
2782
2974
|
});
|
|
2783
2975
|
return { hosts };
|
|
2784
2976
|
}
|
|
2785
2977
|
function listVariantProfiles(layout) {
|
|
2786
|
-
if (!
|
|
2978
|
+
if (!fs7.existsSync(layout.variantsRoot))
|
|
2787
2979
|
return [];
|
|
2788
|
-
return
|
|
2980
|
+
return fs7.readdirSync(layout.variantsRoot, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name).sort();
|
|
2789
2981
|
}
|
|
2790
2982
|
function matchesGlob(filename, glob) {
|
|
2791
2983
|
const starIdx = glob.indexOf("*");
|
|
@@ -2796,7 +2988,7 @@ function matchesGlob(filename, glob) {
|
|
|
2796
2988
|
return filename.length >= prefix.length + suffix.length && filename.startsWith(prefix) && filename.endsWith(suffix);
|
|
2797
2989
|
}
|
|
2798
2990
|
function matchingFileNames(dir, glob) {
|
|
2799
|
-
return
|
|
2991
|
+
return fs7.readdirSync(dir, { withFileTypes: true }).filter((e) => e.isFile() && matchesGlob(e.name, glob)).map((e) => e.name);
|
|
2800
2992
|
}
|
|
2801
2993
|
function detectGitAvailability(dir) {
|
|
2802
2994
|
try {
|
|
@@ -2822,7 +3014,7 @@ function gitTrackedFileNames(dir, filenames) {
|
|
|
2822
3014
|
}
|
|
2823
3015
|
}
|
|
2824
3016
|
function checkTrackedPathGuard(activeDir, filenames) {
|
|
2825
|
-
if (filenames.length === 0 || !
|
|
3017
|
+
if (filenames.length === 0 || !fs7.existsSync(activeDir))
|
|
2826
3018
|
return GUARD_PASS;
|
|
2827
3019
|
const availability = detectGitAvailability(activeDir);
|
|
2828
3020
|
if (availability === "no-git")
|
|
@@ -2833,53 +3025,53 @@ function checkTrackedPathGuard(activeDir, filenames) {
|
|
|
2833
3025
|
if (tracked.size === 0)
|
|
2834
3026
|
return GUARD_PASS;
|
|
2835
3027
|
const offending = filenames.find((name) => tracked.has(name));
|
|
2836
|
-
return { blocked: true, path:
|
|
3028
|
+
return { blocked: true, path: path11.join(activeDir, offending), unchecked: false };
|
|
2837
3029
|
}
|
|
2838
3030
|
function assertStateWritable(stateFilePath) {
|
|
2839
|
-
const dir =
|
|
3031
|
+
const dir = path11.dirname(stateFilePath);
|
|
2840
3032
|
try {
|
|
2841
|
-
|
|
3033
|
+
fs7.mkdirSync(dir, { recursive: true });
|
|
2842
3034
|
} catch (err) {
|
|
2843
3035
|
throw UnwritableInstallStateError(stateFilePath, err.message);
|
|
2844
3036
|
}
|
|
2845
|
-
const checkPath =
|
|
3037
|
+
const checkPath = fs7.existsSync(stateFilePath) ? stateFilePath : dir;
|
|
2846
3038
|
try {
|
|
2847
|
-
|
|
3039
|
+
fs7.accessSync(checkPath, fs7.constants.W_OK);
|
|
2848
3040
|
} catch (err) {
|
|
2849
3041
|
throw UnwritableInstallStateError(stateFilePath, err.message);
|
|
2850
3042
|
}
|
|
2851
3043
|
}
|
|
2852
3044
|
function copyFileRouteVariant(layout, variantDir) {
|
|
2853
|
-
|
|
3045
|
+
fs7.mkdirSync(layout.activeDir, { recursive: true });
|
|
2854
3046
|
let changed = 0;
|
|
2855
|
-
for (const entry of
|
|
3047
|
+
for (const entry of fs7.readdirSync(variantDir, { withFileTypes: true })) {
|
|
2856
3048
|
if (!entry.isFile() || !matchesGlob(entry.name, layout.activeGlob))
|
|
2857
3049
|
continue;
|
|
2858
|
-
|
|
3050
|
+
fs7.copyFileSync(path11.join(variantDir, entry.name), path11.join(layout.activeDir, entry.name));
|
|
2859
3051
|
changed++;
|
|
2860
3052
|
}
|
|
2861
3053
|
return changed;
|
|
2862
3054
|
}
|
|
2863
3055
|
function repointOpencodeVariant(layout, variantDir) {
|
|
2864
|
-
|
|
3056
|
+
fs7.mkdirSync(layout.activeDir, { recursive: true });
|
|
2865
3057
|
let changed = 0;
|
|
2866
|
-
for (const entry of
|
|
3058
|
+
for (const entry of fs7.readdirSync(variantDir, { withFileTypes: true })) {
|
|
2867
3059
|
if (!entry.isFile() || !matchesGlob(entry.name, layout.activeGlob))
|
|
2868
3060
|
continue;
|
|
2869
|
-
const dest =
|
|
2870
|
-
const target =
|
|
3061
|
+
const dest = path11.join(layout.activeDir, entry.name);
|
|
3062
|
+
const target = path11.resolve(path11.join(variantDir, entry.name));
|
|
2871
3063
|
let destExists = true;
|
|
2872
3064
|
let destIsSymlink = false;
|
|
2873
3065
|
try {
|
|
2874
|
-
destIsSymlink =
|
|
3066
|
+
destIsSymlink = fs7.lstatSync(dest).isSymbolicLink();
|
|
2875
3067
|
} catch {
|
|
2876
3068
|
destExists = false;
|
|
2877
3069
|
}
|
|
2878
3070
|
if (destExists && !destIsSymlink)
|
|
2879
3071
|
continue;
|
|
2880
3072
|
const tmp = `${dest}.massa-ai-switch.${crypto4.randomUUID()}`;
|
|
2881
|
-
|
|
2882
|
-
|
|
3073
|
+
fs7.symlinkSync(target, tmp);
|
|
3074
|
+
fs7.renameSync(tmp, dest);
|
|
2883
3075
|
changed++;
|
|
2884
3076
|
}
|
|
2885
3077
|
return changed;
|
|
@@ -2919,13 +3111,13 @@ function switchProfile(opts) {
|
|
|
2919
3111
|
if (fileHosts.length === 0) {
|
|
2920
3112
|
return { profile: opts.profile, dryRun, hosts: orderRows(universe, skipRows), restartRequired: false };
|
|
2921
3113
|
}
|
|
2922
|
-
const installedFileHosts = fileHosts.filter((h) =>
|
|
3114
|
+
const installedFileHosts = fileHosts.filter((h) => fs7.existsSync(h.layout.activeDir));
|
|
2923
3115
|
if (installedFileHosts.length === 0)
|
|
2924
3116
|
throw NoHostsDetectedError();
|
|
2925
3117
|
const withAvailability = fileHosts.map((h) => {
|
|
2926
|
-
const variantsRootExists =
|
|
3118
|
+
const variantsRootExists = fs7.existsSync(h.layout.variantsRoot);
|
|
2927
3119
|
const variantDir = h.layout.variantDir(opts.profile);
|
|
2928
|
-
const available = variantsRootExists &&
|
|
3120
|
+
const available = variantsRootExists && fs7.existsSync(variantDir) && fs7.statSync(variantDir).isDirectory();
|
|
2929
3121
|
return { ...h, variantsRootExists, variantDir, available };
|
|
2930
3122
|
});
|
|
2931
3123
|
if (!withAvailability.some((h) => h.available)) {
|
|
@@ -2961,7 +3153,7 @@ function switchProfile(opts) {
|
|
|
2961
3153
|
continue;
|
|
2962
3154
|
}
|
|
2963
3155
|
if (dryRun) {
|
|
2964
|
-
rows.push({ host: h.host, status: "
|
|
3156
|
+
rows.push({ host: h.host, status: "would-switch" });
|
|
2965
3157
|
continue;
|
|
2966
3158
|
}
|
|
2967
3159
|
const candidateNames = matchingFileNames(h.variantDir, h.layout.activeGlob);
|
|
@@ -3006,6 +3198,7 @@ var init_engine = __esm(() => {
|
|
|
3006
3198
|
init_state();
|
|
3007
3199
|
init_lock();
|
|
3008
3200
|
init_claude_marketplace();
|
|
3201
|
+
init_doctor();
|
|
3009
3202
|
SwitchEngineError = class SwitchEngineError extends Error {
|
|
3010
3203
|
constructor(message) {
|
|
3011
3204
|
super(message);
|
|
@@ -3018,29 +3211,29 @@ var init_engine = __esm(() => {
|
|
|
3018
3211
|
|
|
3019
3212
|
// ../../packages/shared/dist/profile-switch/report.js
|
|
3020
3213
|
function reportSucceeded(report) {
|
|
3021
|
-
return report.hosts.every((h) => h.status === "switched" || h.status === "skipped");
|
|
3214
|
+
return report.hosts.every((h) => h.status === "switched" || h.status === "would-switch" || h.status === "skipped");
|
|
3022
3215
|
}
|
|
3023
3216
|
|
|
3024
3217
|
// ../../packages/shared/dist/profile-switch/variant-sync.js
|
|
3025
|
-
import
|
|
3026
|
-
import
|
|
3027
|
-
import
|
|
3218
|
+
import fs8 from "fs";
|
|
3219
|
+
import path12 from "path";
|
|
3220
|
+
import os8 from "os";
|
|
3028
3221
|
import crypto5 from "crypto";
|
|
3029
3222
|
function defaultStatePath2(targetHome) {
|
|
3030
|
-
return
|
|
3223
|
+
return path12.join(targetHome, ".config", "massa-ai", "install-state.json");
|
|
3031
3224
|
}
|
|
3032
3225
|
function marketplaceRoots2(targetHome, state) {
|
|
3033
3226
|
return state.platforms.claude?.installRoute === "marketplace" ? { claude: resolveClaudeMarketplaceRoot({ targetHome }) ?? undefined } : {};
|
|
3034
3227
|
}
|
|
3035
3228
|
function writeFileIntoDirAtomically(destDir, destName, content) {
|
|
3036
3229
|
const unique = `${process.pid}.${++tempFileCounter2}.${crypto5.randomBytes(6).toString("hex")}`;
|
|
3037
|
-
const tempFile =
|
|
3230
|
+
const tempFile = path12.join(destDir, `.${destName}.${unique}.tmp`);
|
|
3038
3231
|
try {
|
|
3039
|
-
|
|
3040
|
-
|
|
3232
|
+
fs8.writeFileSync(tempFile, content);
|
|
3233
|
+
fs8.renameSync(tempFile, path12.join(destDir, destName));
|
|
3041
3234
|
} catch (error) {
|
|
3042
3235
|
try {
|
|
3043
|
-
|
|
3236
|
+
fs8.unlinkSync(tempFile);
|
|
3044
3237
|
} catch {}
|
|
3045
3238
|
throw error;
|
|
3046
3239
|
}
|
|
@@ -3048,20 +3241,20 @@ function writeFileIntoDirAtomically(destDir, destName, content) {
|
|
|
3048
3241
|
function isSafeDirName(name) {
|
|
3049
3242
|
if (name === "." || name === "..")
|
|
3050
3243
|
return false;
|
|
3051
|
-
if (name.includes("/") || name.includes("\\") || name.includes(
|
|
3244
|
+
if (name.includes("/") || name.includes("\\") || name.includes(path12.sep))
|
|
3052
3245
|
return false;
|
|
3053
|
-
return
|
|
3246
|
+
return path12.basename(name) === name;
|
|
3054
3247
|
}
|
|
3055
3248
|
function syncHost(host, sourceRoot, targetHome, marketplaceRoot) {
|
|
3056
3249
|
const layout = resolveHostLayout(host, { targetHome, marketplaceRoot });
|
|
3057
3250
|
if (layout.route === "skip") {
|
|
3058
3251
|
return { host, status: "skipped", profiles: [], retained: [], files: 0, reason: layout.reason };
|
|
3059
3252
|
}
|
|
3060
|
-
const srcDir =
|
|
3061
|
-
if (!
|
|
3253
|
+
const srcDir = path12.join(sourceRoot, "apps", `${host}-plugin`, "agent-profiles");
|
|
3254
|
+
if (!fs8.existsSync(srcDir) || !fs8.statSync(srcDir).isDirectory()) {
|
|
3062
3255
|
return { host, status: "skipped", profiles: [], retained: [], files: 0, reason: "no generated variants for this host" };
|
|
3063
3256
|
}
|
|
3064
|
-
if (!
|
|
3257
|
+
if (!fs8.existsSync(layout.variantsRoot)) {
|
|
3065
3258
|
return {
|
|
3066
3259
|
host,
|
|
3067
3260
|
status: "skipped",
|
|
@@ -3073,24 +3266,24 @@ function syncHost(host, sourceRoot, targetHome, marketplaceRoot) {
|
|
|
3073
3266
|
}
|
|
3074
3267
|
const profiles = [];
|
|
3075
3268
|
let files = 0;
|
|
3076
|
-
for (const entry of
|
|
3269
|
+
for (const entry of fs8.readdirSync(srcDir, { withFileTypes: true })) {
|
|
3077
3270
|
if (!entry.isDirectory())
|
|
3078
3271
|
continue;
|
|
3079
3272
|
if (!isSafeDirName(entry.name))
|
|
3080
3273
|
continue;
|
|
3081
|
-
const srcProfileDir =
|
|
3082
|
-
const destProfileDir =
|
|
3083
|
-
|
|
3084
|
-
for (const fileEntry of
|
|
3274
|
+
const srcProfileDir = path12.join(srcDir, entry.name);
|
|
3275
|
+
const destProfileDir = path12.join(layout.variantsRoot, entry.name);
|
|
3276
|
+
fs8.mkdirSync(destProfileDir, { recursive: true });
|
|
3277
|
+
for (const fileEntry of fs8.readdirSync(srcProfileDir, { withFileTypes: true })) {
|
|
3085
3278
|
if (!fileEntry.isFile())
|
|
3086
3279
|
continue;
|
|
3087
|
-
const content =
|
|
3280
|
+
const content = fs8.readFileSync(path12.join(srcProfileDir, fileEntry.name));
|
|
3088
3281
|
writeFileIntoDirAtomically(destProfileDir, fileEntry.name, content);
|
|
3089
3282
|
files++;
|
|
3090
3283
|
}
|
|
3091
3284
|
profiles.push(entry.name);
|
|
3092
3285
|
}
|
|
3093
|
-
const retained =
|
|
3286
|
+
const retained = fs8.readdirSync(layout.variantsRoot, { withFileTypes: true }).filter((e) => e.isDirectory() && !profiles.includes(e.name)).map((e) => e.name).sort();
|
|
3094
3287
|
return { host, status: "synced", profiles: profiles.sort(), retained, files };
|
|
3095
3288
|
}
|
|
3096
3289
|
function syncGeneratedVariants(opts) {
|
|
@@ -3106,7 +3299,7 @@ function syncGeneratedVariants(opts) {
|
|
|
3106
3299
|
}));
|
|
3107
3300
|
}
|
|
3108
3301
|
const sourceRoot = opts.sourceRoot;
|
|
3109
|
-
const targetHome = opts.targetHome ??
|
|
3302
|
+
const targetHome = opts.targetHome ?? os8.homedir();
|
|
3110
3303
|
const state = readInstallState(defaultStatePath2(targetHome));
|
|
3111
3304
|
const roots = marketplaceRoots2(targetHome, state);
|
|
3112
3305
|
return hosts.map((host) => {
|
|
@@ -3125,14 +3318,14 @@ var init_variant_sync = __esm(() => {
|
|
|
3125
3318
|
});
|
|
3126
3319
|
|
|
3127
3320
|
// ../../packages/shared/dist/profile-switch/repo-root.js
|
|
3128
|
-
import
|
|
3129
|
-
import
|
|
3321
|
+
import fs9 from "fs";
|
|
3322
|
+
import path13 from "path";
|
|
3130
3323
|
function findRepoRootWithMarker(startDir, marker, maxLevels) {
|
|
3131
3324
|
let dir = startDir;
|
|
3132
3325
|
for (let i = 0;i <= maxLevels; i++) {
|
|
3133
|
-
if (
|
|
3326
|
+
if (fs9.existsSync(path13.join(dir, marker)))
|
|
3134
3327
|
return dir;
|
|
3135
|
-
const parent =
|
|
3328
|
+
const parent = path13.dirname(dir);
|
|
3136
3329
|
if (parent === dir)
|
|
3137
3330
|
break;
|
|
3138
3331
|
dir = parent;
|
|
@@ -3230,7 +3423,7 @@ var init_rules = __esm(() => {
|
|
|
3230
3423
|
});
|
|
3231
3424
|
|
|
3232
3425
|
// ../../packages/shared/dist/bootstrap/state.js
|
|
3233
|
-
import
|
|
3426
|
+
import fs10 from "fs";
|
|
3234
3427
|
function isPlainObject2(value) {
|
|
3235
3428
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3236
3429
|
}
|
|
@@ -3261,7 +3454,7 @@ function resolveBootstrapState(doc) {
|
|
|
3261
3454
|
}
|
|
3262
3455
|
function readConfigBytes() {
|
|
3263
3456
|
try {
|
|
3264
|
-
return
|
|
3457
|
+
return fs10.readFileSync(getConfigPath(), "utf-8");
|
|
3265
3458
|
} catch (error) {
|
|
3266
3459
|
if (error?.code === "ENOENT")
|
|
3267
3460
|
return "";
|
|
@@ -3316,7 +3509,7 @@ var init_state2 = __esm(() => {
|
|
|
3316
3509
|
});
|
|
3317
3510
|
|
|
3318
3511
|
// ../../packages/shared/dist/bootstrap/render.js
|
|
3319
|
-
import
|
|
3512
|
+
import path14 from "path";
|
|
3320
3513
|
function wrapBootstrapBlock(body) {
|
|
3321
3514
|
return `${BOOTSTRAP_BLOCK_START}
|
|
3322
3515
|
${body.replace(/\n+$/, "")}
|
|
@@ -3329,19 +3522,19 @@ function ruleMarker(id, suffix) {
|
|
|
3329
3522
|
function resolveHostRoot(host, targetHome, hostRoot) {
|
|
3330
3523
|
requireAbsoluteTargetHome(targetHome);
|
|
3331
3524
|
if (hostRoot === undefined)
|
|
3332
|
-
return
|
|
3333
|
-
const relative =
|
|
3334
|
-
if (!
|
|
3525
|
+
return path14.join(targetHome, ...HOST_CONFIG_DIR[host]);
|
|
3526
|
+
const relative = path14.relative(targetHome, hostRoot);
|
|
3527
|
+
if (!path14.isAbsolute(hostRoot) || relative === "" || relative.startsWith("..") || path14.isAbsolute(relative)) {
|
|
3335
3528
|
throw new BootstrapRenderError("HostRootOutsideTargetHomeError", `hostRoot must be an absolute directory inside targetHome, got "${hostRoot}" for targetHome "${targetHome}"`, [hostRoot, targetHome]);
|
|
3336
3529
|
}
|
|
3337
3530
|
return hostRoot;
|
|
3338
3531
|
}
|
|
3339
3532
|
function bootstrapContractPath(host, targetHome, hostRoot) {
|
|
3340
|
-
return
|
|
3533
|
+
return path14.join(resolveHostRoot(host, targetHome, hostRoot), CONTRACT_FILENAME);
|
|
3341
3534
|
}
|
|
3342
3535
|
function bootstrapStateFilePath(targetHome) {
|
|
3343
3536
|
requireAbsoluteTargetHome(targetHome);
|
|
3344
|
-
return
|
|
3537
|
+
return path14.join(targetHome, ".config", "massa-ai", "config.json");
|
|
3345
3538
|
}
|
|
3346
3539
|
function renderBootstrap(options) {
|
|
3347
3540
|
const { source, state, host, targetHome, hostRoot } = options;
|
|
@@ -3364,7 +3557,7 @@ ${body}`;
|
|
|
3364
3557
|
return { contract, pointer };
|
|
3365
3558
|
}
|
|
3366
3559
|
function requireAbsoluteTargetHome(targetHome) {
|
|
3367
|
-
if (!
|
|
3560
|
+
if (!path14.isAbsolute(targetHome)) {
|
|
3368
3561
|
throw new BootstrapRenderError("TargetHomeNotAbsoluteError", `targetHome must be an absolute path, got "${targetHome}"`, [targetHome]);
|
|
3369
3562
|
}
|
|
3370
3563
|
}
|
|
@@ -3541,14 +3734,14 @@ var init_report = __esm(() => {
|
|
|
3541
3734
|
});
|
|
3542
3735
|
|
|
3543
3736
|
// ../../packages/shared/dist/bootstrap/engine.js
|
|
3544
|
-
import
|
|
3545
|
-
import
|
|
3737
|
+
import fs11 from "fs";
|
|
3738
|
+
import path15 from "path";
|
|
3546
3739
|
function applyBootstrapState(options) {
|
|
3547
3740
|
const { targetHome } = options;
|
|
3548
3741
|
const dryRun = options.dryRun ?? false;
|
|
3549
3742
|
const warn = options.onWarning ?? ((message) => console.warn(message));
|
|
3550
3743
|
const configPath = bootstrapStateFilePath(targetHome);
|
|
3551
|
-
const installStatePath =
|
|
3744
|
+
const installStatePath = path15.join(path15.dirname(configPath), INSTALL_STATE_FILENAME);
|
|
3552
3745
|
const { platforms } = readInstallState(installStatePath);
|
|
3553
3746
|
const installed = HOSTS.filter((host) => platforms[host] !== undefined);
|
|
3554
3747
|
if (installed.length === 0) {
|
|
@@ -3641,22 +3834,22 @@ function applyHost(input) {
|
|
|
3641
3834
|
}
|
|
3642
3835
|
function wiringArtifact(host, targetHome, hostRoot) {
|
|
3643
3836
|
const root = resolveHostRoot(host, targetHome, hostRoot);
|
|
3644
|
-
const contractPath =
|
|
3837
|
+
const contractPath = path15.join(root, CONTRACT_FILENAME);
|
|
3645
3838
|
switch (host) {
|
|
3646
3839
|
case "claude":
|
|
3647
|
-
return { file:
|
|
3840
|
+
return { file: path15.join(root, "CLAUDE.md"), token: `@${CONTRACT_FILENAME}` };
|
|
3648
3841
|
case "codex":
|
|
3649
3842
|
case "cursor":
|
|
3650
|
-
return { file:
|
|
3843
|
+
return { file: path15.join(root, "AGENTS.md"), token: contractPath };
|
|
3651
3844
|
case "opencode":
|
|
3652
3845
|
return { file: openCodeConfigPath(root), token: `"${contractPath}"` };
|
|
3653
3846
|
}
|
|
3654
3847
|
}
|
|
3655
3848
|
function openCodeConfigPath(root) {
|
|
3656
|
-
const json =
|
|
3657
|
-
if (
|
|
3849
|
+
const json = path15.join(root, "opencode.json");
|
|
3850
|
+
if (fs11.existsSync(json))
|
|
3658
3851
|
return json;
|
|
3659
|
-
return
|
|
3852
|
+
return path15.join(root, "opencode.jsonc");
|
|
3660
3853
|
}
|
|
3661
3854
|
function isWired(host, targetHome, hostRoot) {
|
|
3662
3855
|
const artifact = wiringArtifact(host, targetHome, hostRoot);
|
|
@@ -3669,7 +3862,7 @@ function notWiredReason(host, targetHome, hostRoot) {
|
|
|
3669
3862
|
}
|
|
3670
3863
|
function readFileOrNull(filePath) {
|
|
3671
3864
|
try {
|
|
3672
|
-
return
|
|
3865
|
+
return fs11.readFileSync(filePath, "utf-8");
|
|
3673
3866
|
} catch {
|
|
3674
3867
|
return null;
|
|
3675
3868
|
}
|
|
@@ -5275,7 +5468,7 @@ var import_brace_expansion, minimatch = (p, pattern, options = {}) => {
|
|
|
5275
5468
|
}, qmarksTestNoExtDot = ([$0]) => {
|
|
5276
5469
|
const len = $0.length;
|
|
5277
5470
|
return (f) => f.length === len && f !== "." && f !== "..";
|
|
5278
|
-
}, defaultPlatform,
|
|
5471
|
+
}, 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) => {
|
|
5279
5472
|
if (!def || typeof def !== "object" || !Object.keys(def).length) {
|
|
5280
5473
|
return minimatch;
|
|
5281
5474
|
}
|
|
@@ -5333,11 +5526,11 @@ var init_esm = __esm(() => {
|
|
|
5333
5526
|
starRE = /^\*+$/;
|
|
5334
5527
|
qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
|
|
5335
5528
|
defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
5336
|
-
|
|
5529
|
+
path16 = {
|
|
5337
5530
|
win32: { sep: "\\" },
|
|
5338
5531
|
posix: { sep: "/" }
|
|
5339
5532
|
};
|
|
5340
|
-
sep = defaultPlatform === "win32" ?
|
|
5533
|
+
sep = defaultPlatform === "win32" ? path16.win32.sep : path16.posix.sep;
|
|
5341
5534
|
minimatch.sep = sep;
|
|
5342
5535
|
GLOBSTAR = Symbol("globstar **");
|
|
5343
5536
|
minimatch.GLOBSTAR = GLOBSTAR;
|
|
@@ -7303,12 +7496,12 @@ var init_esm4 = __esm(() => {
|
|
|
7303
7496
|
childrenCache() {
|
|
7304
7497
|
return this.#children;
|
|
7305
7498
|
}
|
|
7306
|
-
resolve(
|
|
7307
|
-
if (!
|
|
7499
|
+
resolve(path17) {
|
|
7500
|
+
if (!path17) {
|
|
7308
7501
|
return this;
|
|
7309
7502
|
}
|
|
7310
|
-
const rootPath = this.getRootString(
|
|
7311
|
-
const dir =
|
|
7503
|
+
const rootPath = this.getRootString(path17);
|
|
7504
|
+
const dir = path17.substring(rootPath.length);
|
|
7312
7505
|
const dirParts = dir.split(this.splitSep);
|
|
7313
7506
|
const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
|
|
7314
7507
|
return result;
|
|
@@ -7836,8 +8029,8 @@ var init_esm4 = __esm(() => {
|
|
|
7836
8029
|
newChild(name, type = UNKNOWN, opts = {}) {
|
|
7837
8030
|
return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
|
|
7838
8031
|
}
|
|
7839
|
-
getRootString(
|
|
7840
|
-
return win32.parse(
|
|
8032
|
+
getRootString(path17) {
|
|
8033
|
+
return win32.parse(path17).root;
|
|
7841
8034
|
}
|
|
7842
8035
|
getRoot(rootPath) {
|
|
7843
8036
|
rootPath = uncToDrive(rootPath.toUpperCase());
|
|
@@ -7862,8 +8055,8 @@ var init_esm4 = __esm(() => {
|
|
|
7862
8055
|
constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
|
|
7863
8056
|
super(name, type, root, roots, nocase, children, opts);
|
|
7864
8057
|
}
|
|
7865
|
-
getRootString(
|
|
7866
|
-
return
|
|
8058
|
+
getRootString(path17) {
|
|
8059
|
+
return path17.startsWith("/") ? "/" : "";
|
|
7867
8060
|
}
|
|
7868
8061
|
getRoot(_rootPath) {
|
|
7869
8062
|
return this.root;
|
|
@@ -7882,8 +8075,8 @@ var init_esm4 = __esm(() => {
|
|
|
7882
8075
|
#children;
|
|
7883
8076
|
nocase;
|
|
7884
8077
|
#fs;
|
|
7885
|
-
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs:
|
|
7886
|
-
this.#fs = fsFromOption(
|
|
8078
|
+
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs12 = defaultFS } = {}) {
|
|
8079
|
+
this.#fs = fsFromOption(fs12);
|
|
7887
8080
|
if (cwd instanceof URL || cwd.startsWith("file://")) {
|
|
7888
8081
|
cwd = fileURLToPath(cwd);
|
|
7889
8082
|
}
|
|
@@ -7919,11 +8112,11 @@ var init_esm4 = __esm(() => {
|
|
|
7919
8112
|
}
|
|
7920
8113
|
this.cwd = prev;
|
|
7921
8114
|
}
|
|
7922
|
-
depth(
|
|
7923
|
-
if (typeof
|
|
7924
|
-
|
|
8115
|
+
depth(path17 = this.cwd) {
|
|
8116
|
+
if (typeof path17 === "string") {
|
|
8117
|
+
path17 = this.cwd.resolve(path17);
|
|
7925
8118
|
}
|
|
7926
|
-
return
|
|
8119
|
+
return path17.depth();
|
|
7927
8120
|
}
|
|
7928
8121
|
childrenCache() {
|
|
7929
8122
|
return this.#children;
|
|
@@ -8339,9 +8532,9 @@ var init_esm4 = __esm(() => {
|
|
|
8339
8532
|
process2();
|
|
8340
8533
|
return results;
|
|
8341
8534
|
}
|
|
8342
|
-
chdir(
|
|
8535
|
+
chdir(path17 = this.cwd) {
|
|
8343
8536
|
const oldCwd = this.cwd;
|
|
8344
|
-
this.cwd = typeof
|
|
8537
|
+
this.cwd = typeof path17 === "string" ? this.cwd.resolve(path17) : path17;
|
|
8345
8538
|
this.cwd[setAsCwd](oldCwd);
|
|
8346
8539
|
}
|
|
8347
8540
|
};
|
|
@@ -8358,8 +8551,8 @@ var init_esm4 = __esm(() => {
|
|
|
8358
8551
|
parseRootPath(dir) {
|
|
8359
8552
|
return win32.parse(dir).root.toUpperCase();
|
|
8360
8553
|
}
|
|
8361
|
-
newRoot(
|
|
8362
|
-
return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
8554
|
+
newRoot(fs12) {
|
|
8555
|
+
return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs12 });
|
|
8363
8556
|
}
|
|
8364
8557
|
isAbsolute(p) {
|
|
8365
8558
|
return p.startsWith("/") || p.startsWith("\\") || /^[a-z]:(\/|\\)/i.test(p);
|
|
@@ -8375,8 +8568,8 @@ var init_esm4 = __esm(() => {
|
|
|
8375
8568
|
parseRootPath(_dir) {
|
|
8376
8569
|
return "/";
|
|
8377
8570
|
}
|
|
8378
|
-
newRoot(
|
|
8379
|
-
return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
8571
|
+
newRoot(fs12) {
|
|
8572
|
+
return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs12 });
|
|
8380
8573
|
}
|
|
8381
8574
|
isAbsolute(p) {
|
|
8382
8575
|
return p.startsWith("/");
|
|
@@ -8633,8 +8826,8 @@ class MatchRecord {
|
|
|
8633
8826
|
this.store.set(target, current === undefined ? n : n & current);
|
|
8634
8827
|
}
|
|
8635
8828
|
entries() {
|
|
8636
|
-
return [...this.store.entries()].map(([
|
|
8637
|
-
|
|
8829
|
+
return [...this.store.entries()].map(([path17, n]) => [
|
|
8830
|
+
path17,
|
|
8638
8831
|
!!(n & 2),
|
|
8639
8832
|
!!(n & 1)
|
|
8640
8833
|
]);
|
|
@@ -8838,9 +9031,9 @@ class GlobUtil {
|
|
|
8838
9031
|
signal;
|
|
8839
9032
|
maxDepth;
|
|
8840
9033
|
includeChildMatches;
|
|
8841
|
-
constructor(patterns,
|
|
9034
|
+
constructor(patterns, path17, opts) {
|
|
8842
9035
|
this.patterns = patterns;
|
|
8843
|
-
this.path =
|
|
9036
|
+
this.path = path17;
|
|
8844
9037
|
this.opts = opts;
|
|
8845
9038
|
this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
|
|
8846
9039
|
this.includeChildMatches = opts.includeChildMatches !== false;
|
|
@@ -8859,11 +9052,11 @@ class GlobUtil {
|
|
|
8859
9052
|
});
|
|
8860
9053
|
}
|
|
8861
9054
|
}
|
|
8862
|
-
#ignored(
|
|
8863
|
-
return this.seen.has(
|
|
9055
|
+
#ignored(path17) {
|
|
9056
|
+
return this.seen.has(path17) || !!this.#ignore?.ignored?.(path17);
|
|
8864
9057
|
}
|
|
8865
|
-
#childrenIgnored(
|
|
8866
|
-
return !!this.#ignore?.childrenIgnored?.(
|
|
9058
|
+
#childrenIgnored(path17) {
|
|
9059
|
+
return !!this.#ignore?.childrenIgnored?.(path17);
|
|
8867
9060
|
}
|
|
8868
9061
|
pause() {
|
|
8869
9062
|
this.paused = true;
|
|
@@ -9080,8 +9273,8 @@ var init_walker = __esm(() => {
|
|
|
9080
9273
|
init_processor();
|
|
9081
9274
|
GlobWalker = class GlobWalker extends GlobUtil {
|
|
9082
9275
|
matches = new Set;
|
|
9083
|
-
constructor(patterns,
|
|
9084
|
-
super(patterns,
|
|
9276
|
+
constructor(patterns, path17, opts) {
|
|
9277
|
+
super(patterns, path17, opts);
|
|
9085
9278
|
}
|
|
9086
9279
|
matchEmit(e) {
|
|
9087
9280
|
this.matches.add(e);
|
|
@@ -9118,8 +9311,8 @@ var init_walker = __esm(() => {
|
|
|
9118
9311
|
};
|
|
9119
9312
|
GlobStream = class GlobStream extends GlobUtil {
|
|
9120
9313
|
results;
|
|
9121
|
-
constructor(patterns,
|
|
9122
|
-
super(patterns,
|
|
9314
|
+
constructor(patterns, path17, opts) {
|
|
9315
|
+
super(patterns, path17, opts);
|
|
9123
9316
|
this.results = new Minipass({
|
|
9124
9317
|
signal: this.signal,
|
|
9125
9318
|
objectMode: true
|
|
@@ -9547,20 +9740,20 @@ var require_ignore = __commonJS((exports, module) => {
|
|
|
9547
9740
|
var throwError = (message, Ctor) => {
|
|
9548
9741
|
throw new Ctor(message);
|
|
9549
9742
|
};
|
|
9550
|
-
var checkPath = (
|
|
9551
|
-
if (!isString(
|
|
9743
|
+
var checkPath = (path17, originalPath, doThrow) => {
|
|
9744
|
+
if (!isString(path17)) {
|
|
9552
9745
|
return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError);
|
|
9553
9746
|
}
|
|
9554
|
-
if (!
|
|
9747
|
+
if (!path17) {
|
|
9555
9748
|
return doThrow(`path must not be empty`, TypeError);
|
|
9556
9749
|
}
|
|
9557
|
-
if (checkPath.isNotRelative(
|
|
9750
|
+
if (checkPath.isNotRelative(path17)) {
|
|
9558
9751
|
const r = "`path.relative()`d";
|
|
9559
9752
|
return doThrow(`path should be a ${r} string, but got "${originalPath}"`, RangeError);
|
|
9560
9753
|
}
|
|
9561
9754
|
return true;
|
|
9562
9755
|
};
|
|
9563
|
-
var isNotRelative = (
|
|
9756
|
+
var isNotRelative = (path17) => REGEX_TEST_INVALID_PATH.test(path17);
|
|
9564
9757
|
checkPath.isNotRelative = isNotRelative;
|
|
9565
9758
|
checkPath.convert = (p) => p;
|
|
9566
9759
|
|
|
@@ -9603,7 +9796,7 @@ var require_ignore = __commonJS((exports, module) => {
|
|
|
9603
9796
|
addPattern(pattern) {
|
|
9604
9797
|
return this.add(pattern);
|
|
9605
9798
|
}
|
|
9606
|
-
_testOne(
|
|
9799
|
+
_testOne(path17, checkUnignored) {
|
|
9607
9800
|
let ignored = false;
|
|
9608
9801
|
let unignored = false;
|
|
9609
9802
|
this._rules.forEach((rule) => {
|
|
@@ -9611,7 +9804,7 @@ var require_ignore = __commonJS((exports, module) => {
|
|
|
9611
9804
|
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
|
|
9612
9805
|
return;
|
|
9613
9806
|
}
|
|
9614
|
-
const matched = rule.regex.test(
|
|
9807
|
+
const matched = rule.regex.test(path17);
|
|
9615
9808
|
if (matched) {
|
|
9616
9809
|
ignored = !negative;
|
|
9617
9810
|
unignored = negative;
|
|
@@ -9623,39 +9816,39 @@ var require_ignore = __commonJS((exports, module) => {
|
|
|
9623
9816
|
};
|
|
9624
9817
|
}
|
|
9625
9818
|
_test(originalPath, cache, checkUnignored, slices) {
|
|
9626
|
-
const
|
|
9627
|
-
checkPath(
|
|
9628
|
-
return this._t(
|
|
9819
|
+
const path17 = originalPath && checkPath.convert(originalPath);
|
|
9820
|
+
checkPath(path17, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
|
|
9821
|
+
return this._t(path17, cache, checkUnignored, slices);
|
|
9629
9822
|
}
|
|
9630
|
-
_t(
|
|
9631
|
-
if (
|
|
9632
|
-
return cache[
|
|
9823
|
+
_t(path17, cache, checkUnignored, slices) {
|
|
9824
|
+
if (path17 in cache) {
|
|
9825
|
+
return cache[path17];
|
|
9633
9826
|
}
|
|
9634
9827
|
if (!slices) {
|
|
9635
|
-
slices =
|
|
9828
|
+
slices = path17.split(SLASH2);
|
|
9636
9829
|
}
|
|
9637
9830
|
slices.pop();
|
|
9638
9831
|
if (!slices.length) {
|
|
9639
|
-
return cache[
|
|
9832
|
+
return cache[path17] = this._testOne(path17, checkUnignored);
|
|
9640
9833
|
}
|
|
9641
9834
|
const parent = this._t(slices.join(SLASH2) + SLASH2, cache, checkUnignored, slices);
|
|
9642
|
-
return cache[
|
|
9835
|
+
return cache[path17] = parent.ignored ? parent : this._testOne(path17, checkUnignored);
|
|
9643
9836
|
}
|
|
9644
|
-
ignores(
|
|
9645
|
-
return this._test(
|
|
9837
|
+
ignores(path17) {
|
|
9838
|
+
return this._test(path17, this._ignoreCache, false).ignored;
|
|
9646
9839
|
}
|
|
9647
9840
|
createFilter() {
|
|
9648
|
-
return (
|
|
9841
|
+
return (path17) => !this.ignores(path17);
|
|
9649
9842
|
}
|
|
9650
9843
|
filter(paths) {
|
|
9651
9844
|
return makeArray(paths).filter(this.createFilter());
|
|
9652
9845
|
}
|
|
9653
|
-
test(
|
|
9654
|
-
return this._test(
|
|
9846
|
+
test(path17) {
|
|
9847
|
+
return this._test(path17, this._testCache, true);
|
|
9655
9848
|
}
|
|
9656
9849
|
}
|
|
9657
9850
|
var factory = (options) => new Ignore2(options);
|
|
9658
|
-
var isPathValid = (
|
|
9851
|
+
var isPathValid = (path17) => checkPath(path17 && checkPath.convert(path17), path17, RETURN_FALSE);
|
|
9659
9852
|
factory.isPathValid = isPathValid;
|
|
9660
9853
|
factory.default = factory;
|
|
9661
9854
|
module.exports = factory;
|
|
@@ -9663,7 +9856,7 @@ var require_ignore = __commonJS((exports, module) => {
|
|
|
9663
9856
|
const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
|
|
9664
9857
|
checkPath.convert = makePosix;
|
|
9665
9858
|
const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
|
9666
|
-
checkPath.isNotRelative = (
|
|
9859
|
+
checkPath.isNotRelative = (path17) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path17) || isNotRelative(path17);
|
|
9667
9860
|
}
|
|
9668
9861
|
});
|
|
9669
9862
|
|
|
@@ -9725,13 +9918,13 @@ function validatePolicy(policy, opts = {}) {
|
|
|
9725
9918
|
}
|
|
9726
9919
|
}
|
|
9727
9920
|
}
|
|
9728
|
-
function matchesGlob2(
|
|
9921
|
+
function matchesGlob2(path17, pattern) {
|
|
9729
9922
|
let re = regexCache.get(pattern);
|
|
9730
9923
|
if (!re) {
|
|
9731
9924
|
re = globToRegex(pattern);
|
|
9732
9925
|
regexCache.set(pattern, re);
|
|
9733
9926
|
}
|
|
9734
|
-
return re.test(
|
|
9927
|
+
return re.test(path17);
|
|
9735
9928
|
}
|
|
9736
9929
|
var DEFAULT_POLICY, applyPolicy = (filePath, policy) => {
|
|
9737
9930
|
const normalized = filePath.trim();
|
|
@@ -9748,8 +9941,8 @@ var init_capture_policy = __esm(() => {
|
|
|
9748
9941
|
});
|
|
9749
9942
|
|
|
9750
9943
|
// ../../packages/core/dist/services/search/ignore-patterns.js
|
|
9751
|
-
import
|
|
9752
|
-
import
|
|
9944
|
+
import fs12 from "fs/promises";
|
|
9945
|
+
import path17 from "path";
|
|
9753
9946
|
function buildExtensionGlob(extensions) {
|
|
9754
9947
|
return extensions.map((ext2) => `**/*${ext2}`);
|
|
9755
9948
|
}
|
|
@@ -9772,8 +9965,8 @@ async function loadProjectIgnore(projectPath) {
|
|
|
9772
9965
|
const ig = ignore();
|
|
9773
9966
|
ig.add(DEFAULT_IGNORES);
|
|
9774
9967
|
try {
|
|
9775
|
-
const gitignorePath =
|
|
9776
|
-
const gitignoreContent = await
|
|
9968
|
+
const gitignorePath = path17.join(projectPath, ".gitignore");
|
|
9969
|
+
const gitignoreContent = await fs12.readFile(gitignorePath, "utf8");
|
|
9777
9970
|
const rules = gitignoreContent.split(`
|
|
9778
9971
|
`).map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
|
|
9779
9972
|
ig.add(rules);
|
|
@@ -11372,15 +11565,15 @@ var require_pg_connection_string = __commonJS((exports, module) => {
|
|
|
11372
11565
|
if (config2.sslnegotiation === "direct" && config2.ssl === undefined) {
|
|
11373
11566
|
config2.ssl = true;
|
|
11374
11567
|
}
|
|
11375
|
-
const
|
|
11568
|
+
const fs13 = config2.sslcert || config2.sslkey || config2.sslrootcert ? __require("fs") : null;
|
|
11376
11569
|
if (config2.sslcert) {
|
|
11377
|
-
config2.ssl.cert =
|
|
11570
|
+
config2.ssl.cert = fs13.readFileSync(config2.sslcert).toString();
|
|
11378
11571
|
}
|
|
11379
11572
|
if (config2.sslkey) {
|
|
11380
|
-
config2.ssl.key =
|
|
11573
|
+
config2.ssl.key = fs13.readFileSync(config2.sslkey).toString();
|
|
11381
11574
|
}
|
|
11382
11575
|
if (config2.sslrootcert) {
|
|
11383
|
-
config2.ssl.ca =
|
|
11576
|
+
config2.ssl.ca = fs13.readFileSync(config2.sslrootcert).toString();
|
|
11384
11577
|
}
|
|
11385
11578
|
if (options.useLibpqCompat && config2.uselibpqcompat) {
|
|
11386
11579
|
throw new Error("Both useLibpqCompat and uselibpqcompat are set. Please use only one of them.");
|
|
@@ -13094,7 +13287,7 @@ var require_split2 = __commonJS((exports, module) => {
|
|
|
13094
13287
|
|
|
13095
13288
|
// ../../node_modules/pgpass/lib/helper.js
|
|
13096
13289
|
var require_helper = __commonJS((exports, module) => {
|
|
13097
|
-
var
|
|
13290
|
+
var path18 = __require("path");
|
|
13098
13291
|
var Stream2 = __require("stream").Stream;
|
|
13099
13292
|
var split = require_split2();
|
|
13100
13293
|
var util = __require("util");
|
|
@@ -13134,7 +13327,7 @@ var require_helper = __commonJS((exports, module) => {
|
|
|
13134
13327
|
};
|
|
13135
13328
|
exports.getFileName = function(rawEnv) {
|
|
13136
13329
|
var env = rawEnv || process.env;
|
|
13137
|
-
var file = env.PGPASSFILE || (isWin ?
|
|
13330
|
+
var file = env.PGPASSFILE || (isWin ? path18.join(env.APPDATA || "./", "postgresql", "pgpass.conf") : path18.join(env.HOME || "./", ".pgpass"));
|
|
13138
13331
|
return file;
|
|
13139
13332
|
};
|
|
13140
13333
|
exports.usePgPass = function(stats, fname) {
|
|
@@ -13258,16 +13451,16 @@ var require_helper = __commonJS((exports, module) => {
|
|
|
13258
13451
|
|
|
13259
13452
|
// ../../node_modules/pgpass/lib/index.js
|
|
13260
13453
|
var require_lib = __commonJS((exports, module) => {
|
|
13261
|
-
var
|
|
13262
|
-
var
|
|
13454
|
+
var path18 = __require("path");
|
|
13455
|
+
var fs13 = __require("fs");
|
|
13263
13456
|
var helper = require_helper();
|
|
13264
13457
|
module.exports = function(connInfo, cb) {
|
|
13265
13458
|
var file = helper.getFileName();
|
|
13266
|
-
|
|
13459
|
+
fs13.stat(file, function(err, stat) {
|
|
13267
13460
|
if (err || !helper.usePgPass(stat, file)) {
|
|
13268
13461
|
return cb(undefined);
|
|
13269
13462
|
}
|
|
13270
|
-
var st =
|
|
13463
|
+
var st = fs13.createReadStream(file);
|
|
13271
13464
|
helper.getPassword(connInfo, st, cb);
|
|
13272
13465
|
});
|
|
13273
13466
|
};
|
|
@@ -14966,8 +15159,8 @@ var init_alias_resolver = __esm(() => {
|
|
|
14966
15159
|
});
|
|
14967
15160
|
|
|
14968
15161
|
// ../../packages/core/dist/services/search/index-manager.js
|
|
14969
|
-
import
|
|
14970
|
-
import
|
|
15162
|
+
import fs13 from "fs";
|
|
15163
|
+
import path18 from "path";
|
|
14971
15164
|
|
|
14972
15165
|
class IndexManager {
|
|
14973
15166
|
metadataCache = new Map;
|
|
@@ -15060,9 +15253,9 @@ class IndexManager {
|
|
|
15060
15253
|
const fileMetadata = {};
|
|
15061
15254
|
let totalSize = 0;
|
|
15062
15255
|
for (const filePath of indexedFiles) {
|
|
15063
|
-
const fullPath =
|
|
15256
|
+
const fullPath = path18.join(projectPath, filePath);
|
|
15064
15257
|
try {
|
|
15065
|
-
const stat = await
|
|
15258
|
+
const stat = await fs13.promises.stat(fullPath);
|
|
15066
15259
|
fileMetadata[filePath] = {
|
|
15067
15260
|
path: filePath,
|
|
15068
15261
|
mtime: stat.mtimeMs,
|
|
@@ -15113,9 +15306,9 @@ class IndexManager {
|
|
|
15113
15306
|
if (ig.ignores(match2)) {
|
|
15114
15307
|
continue;
|
|
15115
15308
|
}
|
|
15116
|
-
const fullPath =
|
|
15309
|
+
const fullPath = path18.join(projectPath, match2);
|
|
15117
15310
|
try {
|
|
15118
|
-
const stat = await
|
|
15311
|
+
const stat = await fs13.promises.stat(fullPath);
|
|
15119
15312
|
files.set(match2, {
|
|
15120
15313
|
path: match2,
|
|
15121
15314
|
mtime: stat.mtimeMs,
|
|
@@ -15566,10 +15759,10 @@ function mergeDefs(...defs) {
|
|
|
15566
15759
|
function cloneDef(schema) {
|
|
15567
15760
|
return mergeDefs(schema._zod.def);
|
|
15568
15761
|
}
|
|
15569
|
-
function getElementAtPath(obj,
|
|
15570
|
-
if (!
|
|
15762
|
+
function getElementAtPath(obj, path19) {
|
|
15763
|
+
if (!path19)
|
|
15571
15764
|
return obj;
|
|
15572
|
-
return
|
|
15765
|
+
return path19.reduce((acc, key) => acc?.[key], obj);
|
|
15573
15766
|
}
|
|
15574
15767
|
function promiseAllObject(promisesObj) {
|
|
15575
15768
|
const keys = Object.keys(promisesObj);
|
|
@@ -15897,11 +16090,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
15897
16090
|
}
|
|
15898
16091
|
return false;
|
|
15899
16092
|
}
|
|
15900
|
-
function prefixIssues(
|
|
16093
|
+
function prefixIssues(path19, issues) {
|
|
15901
16094
|
return issues.map((iss) => {
|
|
15902
16095
|
var _a3;
|
|
15903
16096
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
15904
|
-
iss.path.unshift(
|
|
16097
|
+
iss.path.unshift(path19);
|
|
15905
16098
|
return iss;
|
|
15906
16099
|
});
|
|
15907
16100
|
}
|
|
@@ -16114,16 +16307,16 @@ function flattenError(error, mapper = (issue2) => issue2.message) {
|
|
|
16114
16307
|
}
|
|
16115
16308
|
function formatError(error, mapper = (issue2) => issue2.message) {
|
|
16116
16309
|
const fieldErrors = { _errors: [] };
|
|
16117
|
-
const processError = (error2,
|
|
16310
|
+
const processError = (error2, path19 = []) => {
|
|
16118
16311
|
for (const issue2 of error2.issues) {
|
|
16119
16312
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
16120
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
16313
|
+
issue2.errors.map((issues) => processError({ issues }, [...path19, ...issue2.path]));
|
|
16121
16314
|
} else if (issue2.code === "invalid_key") {
|
|
16122
|
-
processError({ issues: issue2.issues }, [...
|
|
16315
|
+
processError({ issues: issue2.issues }, [...path19, ...issue2.path]);
|
|
16123
16316
|
} else if (issue2.code === "invalid_element") {
|
|
16124
|
-
processError({ issues: issue2.issues }, [...
|
|
16317
|
+
processError({ issues: issue2.issues }, [...path19, ...issue2.path]);
|
|
16125
16318
|
} else {
|
|
16126
|
-
const fullpath = [...
|
|
16319
|
+
const fullpath = [...path19, ...issue2.path];
|
|
16127
16320
|
if (fullpath.length === 0) {
|
|
16128
16321
|
fieldErrors._errors.push(mapper(issue2));
|
|
16129
16322
|
} else {
|
|
@@ -16150,17 +16343,17 @@ function formatError(error, mapper = (issue2) => issue2.message) {
|
|
|
16150
16343
|
}
|
|
16151
16344
|
function treeifyError(error, mapper = (issue2) => issue2.message) {
|
|
16152
16345
|
const result = { errors: [] };
|
|
16153
|
-
const processError = (error2,
|
|
16346
|
+
const processError = (error2, path19 = []) => {
|
|
16154
16347
|
var _a3, _b;
|
|
16155
16348
|
for (const issue2 of error2.issues) {
|
|
16156
16349
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
16157
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
16350
|
+
issue2.errors.map((issues) => processError({ issues }, [...path19, ...issue2.path]));
|
|
16158
16351
|
} else if (issue2.code === "invalid_key") {
|
|
16159
|
-
processError({ issues: issue2.issues }, [...
|
|
16352
|
+
processError({ issues: issue2.issues }, [...path19, ...issue2.path]);
|
|
16160
16353
|
} else if (issue2.code === "invalid_element") {
|
|
16161
|
-
processError({ issues: issue2.issues }, [...
|
|
16354
|
+
processError({ issues: issue2.issues }, [...path19, ...issue2.path]);
|
|
16162
16355
|
} else {
|
|
16163
|
-
const fullpath = [...
|
|
16356
|
+
const fullpath = [...path19, ...issue2.path];
|
|
16164
16357
|
if (fullpath.length === 0) {
|
|
16165
16358
|
result.errors.push(mapper(issue2));
|
|
16166
16359
|
continue;
|
|
@@ -16192,8 +16385,8 @@ function treeifyError(error, mapper = (issue2) => issue2.message) {
|
|
|
16192
16385
|
}
|
|
16193
16386
|
function toDotPath(_path) {
|
|
16194
16387
|
const segs = [];
|
|
16195
|
-
const
|
|
16196
|
-
for (const seg of
|
|
16388
|
+
const path19 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
16389
|
+
for (const seg of path19) {
|
|
16197
16390
|
if (typeof seg === "number")
|
|
16198
16391
|
segs.push(`[${seg}]`);
|
|
16199
16392
|
else if (typeof seg === "symbol")
|
|
@@ -29196,13 +29389,13 @@ function resolveRef(ref, ctx) {
|
|
|
29196
29389
|
if (!ref.startsWith("#")) {
|
|
29197
29390
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
29198
29391
|
}
|
|
29199
|
-
const
|
|
29200
|
-
if (
|
|
29392
|
+
const path19 = ref.slice(1).split("/").filter(Boolean);
|
|
29393
|
+
if (path19.length === 0) {
|
|
29201
29394
|
return ctx.rootSchema;
|
|
29202
29395
|
}
|
|
29203
29396
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
29204
|
-
if (
|
|
29205
|
-
const key =
|
|
29397
|
+
if (path19[0] === defsKey) {
|
|
29398
|
+
const key = path19[1];
|
|
29206
29399
|
if (!key || !ctx.defs[key]) {
|
|
29207
29400
|
throw new Error(`Reference not found: ${ref}`);
|
|
29208
29401
|
}
|
|
@@ -30691,8 +30884,8 @@ class ParseStatus {
|
|
|
30691
30884
|
}
|
|
30692
30885
|
}
|
|
30693
30886
|
var makeIssue = (params) => {
|
|
30694
|
-
const { data, path:
|
|
30695
|
-
const fullPath = [...
|
|
30887
|
+
const { data, path: path19, errorMaps, issueData } = params;
|
|
30888
|
+
const fullPath = [...path19, ...issueData.path || []];
|
|
30696
30889
|
const fullIssue = {
|
|
30697
30890
|
...issueData,
|
|
30698
30891
|
path: fullPath
|
|
@@ -30737,11 +30930,11 @@ var init_errorUtil = __esm(() => {
|
|
|
30737
30930
|
|
|
30738
30931
|
// ../../node_modules/zod/v3/types.js
|
|
30739
30932
|
class ParseInputLazyPath {
|
|
30740
|
-
constructor(parent, value,
|
|
30933
|
+
constructor(parent, value, path19, key) {
|
|
30741
30934
|
this._cachedPath = [];
|
|
30742
30935
|
this.parent = parent;
|
|
30743
30936
|
this.data = value;
|
|
30744
|
-
this._path =
|
|
30937
|
+
this._path = path19;
|
|
30745
30938
|
this._key = key;
|
|
30746
30939
|
}
|
|
30747
30940
|
get path() {
|
|
@@ -36806,23 +36999,23 @@ var require_auth_config = __commonJS((exports, module) => {
|
|
|
36806
36999
|
writeAuthConfig: () => writeAuthConfig
|
|
36807
37000
|
});
|
|
36808
37001
|
module.exports = __toCommonJS2(auth_config_exports);
|
|
36809
|
-
var
|
|
36810
|
-
var
|
|
37002
|
+
var fs14 = __toESM2(__require("fs"));
|
|
37003
|
+
var path19 = __toESM2(__require("path"));
|
|
36811
37004
|
var import_token_util = require_token_util();
|
|
36812
37005
|
function getAuthConfigPath() {
|
|
36813
37006
|
const dataDir = (0, import_token_util.getVercelDataDir)();
|
|
36814
37007
|
if (!dataDir) {
|
|
36815
37008
|
throw new Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`);
|
|
36816
37009
|
}
|
|
36817
|
-
return
|
|
37010
|
+
return path19.join(dataDir, "auth.json");
|
|
36818
37011
|
}
|
|
36819
37012
|
function readAuthConfig() {
|
|
36820
37013
|
try {
|
|
36821
37014
|
const authPath = getAuthConfigPath();
|
|
36822
|
-
if (!
|
|
37015
|
+
if (!fs14.existsSync(authPath)) {
|
|
36823
37016
|
return null;
|
|
36824
37017
|
}
|
|
36825
|
-
const content =
|
|
37018
|
+
const content = fs14.readFileSync(authPath, "utf8");
|
|
36826
37019
|
if (!content) {
|
|
36827
37020
|
return null;
|
|
36828
37021
|
}
|
|
@@ -36833,11 +37026,11 @@ var require_auth_config = __commonJS((exports, module) => {
|
|
|
36833
37026
|
}
|
|
36834
37027
|
function writeAuthConfig(config3) {
|
|
36835
37028
|
const authPath = getAuthConfigPath();
|
|
36836
|
-
const authDir =
|
|
36837
|
-
if (!
|
|
36838
|
-
|
|
37029
|
+
const authDir = path19.dirname(authPath);
|
|
37030
|
+
if (!fs14.existsSync(authDir)) {
|
|
37031
|
+
fs14.mkdirSync(authDir, { mode: 504, recursive: true });
|
|
36839
37032
|
}
|
|
36840
|
-
|
|
37033
|
+
fs14.writeFileSync(authPath, JSON.stringify(config3, null, 2), { mode: 384 });
|
|
36841
37034
|
}
|
|
36842
37035
|
function isValidAccessToken(authConfig, expirationBufferMs = 0) {
|
|
36843
37036
|
if (!authConfig.token)
|
|
@@ -37012,8 +37205,8 @@ var require_token_util = __commonJS((exports, module) => {
|
|
|
37012
37205
|
saveToken: () => saveToken
|
|
37013
37206
|
});
|
|
37014
37207
|
module.exports = __toCommonJS2(token_util_exports);
|
|
37015
|
-
var
|
|
37016
|
-
var
|
|
37208
|
+
var path19 = __toESM2(__require("path"));
|
|
37209
|
+
var fs14 = __toESM2(__require("fs"));
|
|
37017
37210
|
var import_token_error = require_token_error();
|
|
37018
37211
|
var import_token_io = require_token_io();
|
|
37019
37212
|
var import_auth_config = require_auth_config();
|
|
@@ -37025,7 +37218,7 @@ var require_token_util = __commonJS((exports, module) => {
|
|
|
37025
37218
|
if (!dataDir) {
|
|
37026
37219
|
return null;
|
|
37027
37220
|
}
|
|
37028
|
-
return
|
|
37221
|
+
return path19.join(dataDir, vercelFolder);
|
|
37029
37222
|
}
|
|
37030
37223
|
async function getVercelToken2(options) {
|
|
37031
37224
|
const authConfig = (0, import_auth_config.readAuthConfig)();
|
|
@@ -37093,11 +37286,11 @@ var require_token_util = __commonJS((exports, module) => {
|
|
|
37093
37286
|
if (!dir) {
|
|
37094
37287
|
throw new import_token_error.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`");
|
|
37095
37288
|
}
|
|
37096
|
-
const prjPath =
|
|
37097
|
-
if (!
|
|
37289
|
+
const prjPath = path19.join(dir, ".vercel", "project.json");
|
|
37290
|
+
if (!fs14.existsSync(prjPath)) {
|
|
37098
37291
|
throw new import_token_error.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`");
|
|
37099
37292
|
}
|
|
37100
|
-
const prj = JSON.parse(
|
|
37293
|
+
const prj = JSON.parse(fs14.readFileSync(prjPath, "utf8"));
|
|
37101
37294
|
if (typeof prj.projectId !== "string" && typeof prj.orgId !== "string") {
|
|
37102
37295
|
throw new TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project.");
|
|
37103
37296
|
}
|
|
@@ -37108,11 +37301,11 @@ var require_token_util = __commonJS((exports, module) => {
|
|
|
37108
37301
|
if (!dir) {
|
|
37109
37302
|
throw new import_token_error.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");
|
|
37110
37303
|
}
|
|
37111
|
-
const tokenPath =
|
|
37304
|
+
const tokenPath = path19.join(dir, "com.vercel.token", `${projectId}.json`);
|
|
37112
37305
|
const tokenJson = JSON.stringify(token);
|
|
37113
|
-
|
|
37114
|
-
|
|
37115
|
-
|
|
37306
|
+
fs14.mkdirSync(path19.dirname(tokenPath), { mode: 504, recursive: true });
|
|
37307
|
+
fs14.writeFileSync(tokenPath, tokenJson);
|
|
37308
|
+
fs14.chmodSync(tokenPath, 432);
|
|
37116
37309
|
return;
|
|
37117
37310
|
}
|
|
37118
37311
|
function loadToken(projectId) {
|
|
@@ -37120,11 +37313,11 @@ var require_token_util = __commonJS((exports, module) => {
|
|
|
37120
37313
|
if (!dir) {
|
|
37121
37314
|
throw new import_token_error.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");
|
|
37122
37315
|
}
|
|
37123
|
-
const tokenPath =
|
|
37124
|
-
if (!
|
|
37316
|
+
const tokenPath = path19.join(dir, "com.vercel.token", `${projectId}.json`);
|
|
37317
|
+
if (!fs14.existsSync(tokenPath)) {
|
|
37125
37318
|
return null;
|
|
37126
37319
|
}
|
|
37127
|
-
const token = JSON.parse(
|
|
37320
|
+
const token = JSON.parse(fs14.readFileSync(tokenPath, "utf8"));
|
|
37128
37321
|
assertVercelOidcTokenResponse(token);
|
|
37129
37322
|
return token;
|
|
37130
37323
|
}
|
|
@@ -47966,37 +48159,37 @@ function createOpenAI(options = {}) {
|
|
|
47966
48159
|
}, `ai-sdk/openai/${VERSION4}`);
|
|
47967
48160
|
const createChatModel = (modelId) => new OpenAIChatLanguageModel(modelId, {
|
|
47968
48161
|
provider: `${providerName}.chat`,
|
|
47969
|
-
url: ({ path:
|
|
48162
|
+
url: ({ path: path19 }) => `${baseURL}${path19}`,
|
|
47970
48163
|
headers: getHeaders,
|
|
47971
48164
|
fetch: options.fetch
|
|
47972
48165
|
});
|
|
47973
48166
|
const createCompletionModel = (modelId) => new OpenAICompletionLanguageModel(modelId, {
|
|
47974
48167
|
provider: `${providerName}.completion`,
|
|
47975
|
-
url: ({ path:
|
|
48168
|
+
url: ({ path: path19 }) => `${baseURL}${path19}`,
|
|
47976
48169
|
headers: getHeaders,
|
|
47977
48170
|
fetch: options.fetch
|
|
47978
48171
|
});
|
|
47979
48172
|
const createEmbeddingModel = (modelId) => new OpenAIEmbeddingModel(modelId, {
|
|
47980
48173
|
provider: `${providerName}.embedding`,
|
|
47981
|
-
url: ({ path:
|
|
48174
|
+
url: ({ path: path19 }) => `${baseURL}${path19}`,
|
|
47982
48175
|
headers: getHeaders,
|
|
47983
48176
|
fetch: options.fetch
|
|
47984
48177
|
});
|
|
47985
48178
|
const createImageModel = (modelId) => new OpenAIImageModel(modelId, {
|
|
47986
48179
|
provider: `${providerName}.image`,
|
|
47987
|
-
url: ({ path:
|
|
48180
|
+
url: ({ path: path19 }) => `${baseURL}${path19}`,
|
|
47988
48181
|
headers: getHeaders,
|
|
47989
48182
|
fetch: options.fetch
|
|
47990
48183
|
});
|
|
47991
48184
|
const createTranscriptionModel = (modelId) => new OpenAITranscriptionModel(modelId, {
|
|
47992
48185
|
provider: `${providerName}.transcription`,
|
|
47993
|
-
url: ({ path:
|
|
48186
|
+
url: ({ path: path19 }) => `${baseURL}${path19}`,
|
|
47994
48187
|
headers: getHeaders,
|
|
47995
48188
|
fetch: options.fetch
|
|
47996
48189
|
});
|
|
47997
48190
|
const createSpeechModel = (modelId) => new OpenAISpeechModel(modelId, {
|
|
47998
48191
|
provider: `${providerName}.speech`,
|
|
47999
|
-
url: ({ path:
|
|
48192
|
+
url: ({ path: path19 }) => `${baseURL}${path19}`,
|
|
48000
48193
|
headers: getHeaders,
|
|
48001
48194
|
fetch: options.fetch
|
|
48002
48195
|
});
|
|
@@ -48009,7 +48202,7 @@ function createOpenAI(options = {}) {
|
|
|
48009
48202
|
const createResponsesModel = (modelId) => {
|
|
48010
48203
|
return new OpenAIResponsesLanguageModel(modelId, {
|
|
48011
48204
|
provider: `${providerName}.responses`,
|
|
48012
|
-
url: ({ path:
|
|
48205
|
+
url: ({ path: path19 }) => `${baseURL}${path19}`,
|
|
48013
48206
|
headers: getHeaders,
|
|
48014
48207
|
fetch: options.fetch,
|
|
48015
48208
|
fileIdPrefixes: ["file-"]
|
|
@@ -64621,26 +64814,26 @@ var require_process = __commonJS((exports, module) => {
|
|
|
64621
64814
|
|
|
64622
64815
|
// ../../node_modules/detect-libc/lib/filesystem.js
|
|
64623
64816
|
var require_filesystem = __commonJS((exports, module) => {
|
|
64624
|
-
var
|
|
64817
|
+
var fs14 = __require("fs");
|
|
64625
64818
|
var LDD_PATH = "/usr/bin/ldd";
|
|
64626
64819
|
var SELF_PATH = "/proc/self/exe";
|
|
64627
64820
|
var MAX_LENGTH = 2048;
|
|
64628
|
-
var readFileSync2 = (
|
|
64629
|
-
const fd =
|
|
64821
|
+
var readFileSync2 = (path19) => {
|
|
64822
|
+
const fd = fs14.openSync(path19, "r");
|
|
64630
64823
|
const buffer = Buffer.alloc(MAX_LENGTH);
|
|
64631
|
-
const bytesRead =
|
|
64632
|
-
|
|
64824
|
+
const bytesRead = fs14.readSync(fd, buffer, 0, MAX_LENGTH, 0);
|
|
64825
|
+
fs14.close(fd, () => {});
|
|
64633
64826
|
return buffer.subarray(0, bytesRead);
|
|
64634
64827
|
};
|
|
64635
|
-
var readFile = (
|
|
64636
|
-
|
|
64828
|
+
var readFile = (path19) => new Promise((resolve4, reject) => {
|
|
64829
|
+
fs14.open(path19, "r", (err, fd) => {
|
|
64637
64830
|
if (err) {
|
|
64638
64831
|
reject(err);
|
|
64639
64832
|
} else {
|
|
64640
64833
|
const buffer = Buffer.alloc(MAX_LENGTH);
|
|
64641
|
-
|
|
64834
|
+
fs14.read(fd, buffer, 0, MAX_LENGTH, 0, (_, bytesRead) => {
|
|
64642
64835
|
resolve4(buffer.subarray(0, bytesRead));
|
|
64643
|
-
|
|
64836
|
+
fs14.close(fd, () => {});
|
|
64644
64837
|
});
|
|
64645
64838
|
}
|
|
64646
64839
|
});
|
|
@@ -64745,11 +64938,11 @@ var require_detect_libc = __commonJS((exports, module) => {
|
|
|
64745
64938
|
}
|
|
64746
64939
|
return null;
|
|
64747
64940
|
};
|
|
64748
|
-
var familyFromInterpreterPath = (
|
|
64749
|
-
if (
|
|
64750
|
-
if (
|
|
64941
|
+
var familyFromInterpreterPath = (path19) => {
|
|
64942
|
+
if (path19) {
|
|
64943
|
+
if (path19.includes("/ld-musl-")) {
|
|
64751
64944
|
return MUSL;
|
|
64752
|
-
} else if (
|
|
64945
|
+
} else if (path19.includes("/ld-linux-")) {
|
|
64753
64946
|
return GLIBC;
|
|
64754
64947
|
}
|
|
64755
64948
|
}
|
|
@@ -64794,8 +64987,8 @@ var require_detect_libc = __commonJS((exports, module) => {
|
|
|
64794
64987
|
cachedFamilyInterpreter = null;
|
|
64795
64988
|
try {
|
|
64796
64989
|
const selfContent = await readFile(SELF_PATH);
|
|
64797
|
-
const
|
|
64798
|
-
cachedFamilyInterpreter = familyFromInterpreterPath(
|
|
64990
|
+
const path19 = interpreterPath(selfContent);
|
|
64991
|
+
cachedFamilyInterpreter = familyFromInterpreterPath(path19);
|
|
64799
64992
|
} catch (e) {}
|
|
64800
64993
|
return cachedFamilyInterpreter;
|
|
64801
64994
|
};
|
|
@@ -64806,8 +64999,8 @@ var require_detect_libc = __commonJS((exports, module) => {
|
|
|
64806
64999
|
cachedFamilyInterpreter = null;
|
|
64807
65000
|
try {
|
|
64808
65001
|
const selfContent = readFileSync2(SELF_PATH);
|
|
64809
|
-
const
|
|
64810
|
-
cachedFamilyInterpreter = familyFromInterpreterPath(
|
|
65002
|
+
const path19 = interpreterPath(selfContent);
|
|
65003
|
+
cachedFamilyInterpreter = familyFromInterpreterPath(path19);
|
|
64811
65004
|
} catch (e) {}
|
|
64812
65005
|
return cachedFamilyInterpreter;
|
|
64813
65006
|
};
|
|
@@ -66469,18 +66662,18 @@ var require_sharp = __commonJS((exports, module) => {
|
|
|
66469
66662
|
`@img/sharp-${runtimePlatform}/sharp.node`,
|
|
66470
66663
|
"@img/sharp-wasm32/sharp.node"
|
|
66471
66664
|
];
|
|
66472
|
-
var
|
|
66665
|
+
var path19;
|
|
66473
66666
|
var sharp;
|
|
66474
66667
|
var errors4 = [];
|
|
66475
|
-
for (
|
|
66668
|
+
for (path19 of paths) {
|
|
66476
66669
|
try {
|
|
66477
|
-
sharp = __require(
|
|
66670
|
+
sharp = __require(path19);
|
|
66478
66671
|
break;
|
|
66479
66672
|
} catch (err) {
|
|
66480
66673
|
errors4.push(err);
|
|
66481
66674
|
}
|
|
66482
66675
|
}
|
|
66483
|
-
if (sharp &&
|
|
66676
|
+
if (sharp && path19.startsWith("@img/sharp-linux-x64") && !sharp._isUsingX64V2()) {
|
|
66484
66677
|
const err = new Error("Prebuilt binaries for linux-x64 require v2 microarchitecture");
|
|
66485
66678
|
err.code = "Unsupported CPU";
|
|
66486
66679
|
errors4.push(err);
|
|
@@ -66489,7 +66682,7 @@ var require_sharp = __commonJS((exports, module) => {
|
|
|
66489
66682
|
if (sharp) {
|
|
66490
66683
|
module.exports = sharp;
|
|
66491
66684
|
} else {
|
|
66492
|
-
const [isLinux, isMacOs, isWindows] = ["linux", "darwin", "win32"].map((
|
|
66685
|
+
const [isLinux, isMacOs, isWindows] = ["linux", "darwin", "win32"].map((os9) => runtimePlatform.startsWith(os9));
|
|
66493
66686
|
const help = [`Could not load the "sharp" module using the ${runtimePlatform} runtime`];
|
|
66494
66687
|
errors4.forEach((err) => {
|
|
66495
66688
|
if (err.code !== "MODULE_NOT_FOUND") {
|
|
@@ -66502,9 +66695,9 @@ var require_sharp = __commonJS((exports, module) => {
|
|
|
66502
66695
|
const { found, expected } = isUnsupportedNodeRuntime();
|
|
66503
66696
|
help.push("- Please upgrade Node.js:", ` Found ${found}`, ` Requires ${expected}`);
|
|
66504
66697
|
} else if (prebuiltPlatforms.includes(runtimePlatform)) {
|
|
66505
|
-
const [
|
|
66506
|
-
const libc =
|
|
66507
|
-
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=${
|
|
66698
|
+
const [os9, cpu] = runtimePlatform.split("-");
|
|
66699
|
+
const libc = os9.endsWith("musl") ? " --libc=musl" : "";
|
|
66700
|
+
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`);
|
|
66508
66701
|
} else {
|
|
66509
66702
|
help.push(`- Manually install libvips >= ${minimumLibvipsVersion}`, "- Add experimental WebAssembly-based dependencies:", " npm install --cpu=wasm32 sharp", " npm install @img/sharp-wasm32");
|
|
66510
66703
|
}
|
|
@@ -69342,15 +69535,15 @@ var require_color = __commonJS((exports, module) => {
|
|
|
69342
69535
|
};
|
|
69343
69536
|
}
|
|
69344
69537
|
function wrapConversion(toModel, graph) {
|
|
69345
|
-
const
|
|
69538
|
+
const path19 = [graph[toModel].parent, toModel];
|
|
69346
69539
|
let fn = conversions_default[graph[toModel].parent][toModel];
|
|
69347
69540
|
let cur = graph[toModel].parent;
|
|
69348
69541
|
while (graph[cur].parent) {
|
|
69349
|
-
|
|
69542
|
+
path19.unshift(graph[cur].parent);
|
|
69350
69543
|
fn = link(conversions_default[graph[cur].parent][cur], fn);
|
|
69351
69544
|
cur = graph[cur].parent;
|
|
69352
69545
|
}
|
|
69353
|
-
fn.conversion =
|
|
69546
|
+
fn.conversion = path19;
|
|
69354
69547
|
return fn;
|
|
69355
69548
|
}
|
|
69356
69549
|
function route(fromModel) {
|
|
@@ -69955,7 +70148,7 @@ var require_output = __commonJS((exports, module) => {
|
|
|
69955
70148
|
Copyright 2013 Lovell Fuller and others.
|
|
69956
70149
|
SPDX-License-Identifier: Apache-2.0
|
|
69957
70150
|
*/
|
|
69958
|
-
var
|
|
70151
|
+
var path19 = __require("path");
|
|
69959
70152
|
var is = require_is();
|
|
69960
70153
|
var sharp = require_sharp();
|
|
69961
70154
|
var formats = new Map([
|
|
@@ -69986,9 +70179,9 @@ var require_output = __commonJS((exports, module) => {
|
|
|
69986
70179
|
let err;
|
|
69987
70180
|
if (!is.string(fileOut)) {
|
|
69988
70181
|
err = new Error("Missing output file path");
|
|
69989
|
-
} else if (is.string(this.options.input.file) &&
|
|
70182
|
+
} else if (is.string(this.options.input.file) && path19.resolve(this.options.input.file) === path19.resolve(fileOut)) {
|
|
69990
70183
|
err = new Error("Cannot use same file for input and output");
|
|
69991
|
-
} else if (jp2Regex.test(
|
|
70184
|
+
} else if (jp2Regex.test(path19.extname(fileOut)) && !this.constructor.format.jp2k.output.file) {
|
|
69992
70185
|
err = errJp2Save();
|
|
69993
70186
|
}
|
|
69994
70187
|
if (err) {
|
|
@@ -77235,11 +77428,11 @@ var init_transformers_node = __esm(() => {
|
|
|
77235
77428
|
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}).`);
|
|
77236
77429
|
}
|
|
77237
77430
|
for (let i = 0;i < num_chunks; ++i) {
|
|
77238
|
-
const
|
|
77239
|
-
const fullPath = `${options.subfolder ?? ""}/${
|
|
77431
|
+
const path19 = `${baseName}_data${i === 0 ? "" : "_" + i}`;
|
|
77432
|
+
const fullPath = `${options.subfolder ?? ""}/${path19}`;
|
|
77240
77433
|
externalDataPromises.push(new Promise(async (resolve4, reject) => {
|
|
77241
77434
|
const data = await (0, _utils_hub_js__WEBPACK_IMPORTED_MODULE_5__.getModelFile)(pretrained_model_name_or_path, fullPath, true, options, return_path);
|
|
77242
|
-
resolve4(data instanceof Uint8Array ? { path:
|
|
77435
|
+
resolve4(data instanceof Uint8Array ? { path: path19, data } : path19);
|
|
77243
77436
|
}));
|
|
77244
77437
|
}
|
|
77245
77438
|
} else if (session_options.externalData !== undefined) {
|
|
@@ -90303,7 +90496,7 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
|
|
|
90303
90496
|
const blob = new Blob([wav], { type: "audio/wav" });
|
|
90304
90497
|
return blob;
|
|
90305
90498
|
}
|
|
90306
|
-
async save(
|
|
90499
|
+
async save(path19) {
|
|
90307
90500
|
let fn;
|
|
90308
90501
|
if (_env_js__WEBPACK_IMPORTED_MODULE_3__.apis.IS_BROWSER_ENV) {
|
|
90309
90502
|
if (_env_js__WEBPACK_IMPORTED_MODULE_3__.apis.IS_WEBWORKER_ENV) {
|
|
@@ -90311,14 +90504,14 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
|
|
|
90311
90504
|
}
|
|
90312
90505
|
fn = _core_js__WEBPACK_IMPORTED_MODULE_2__.saveBlob;
|
|
90313
90506
|
} else if (_env_js__WEBPACK_IMPORTED_MODULE_3__.apis.IS_FS_AVAILABLE) {
|
|
90314
|
-
fn = async (
|
|
90507
|
+
fn = async (path20, blob) => {
|
|
90315
90508
|
let buffer = await blob.arrayBuffer();
|
|
90316
|
-
node_fs__WEBPACK_IMPORTED_MODULE_5__["default"].writeFileSync(
|
|
90509
|
+
node_fs__WEBPACK_IMPORTED_MODULE_5__["default"].writeFileSync(path20, Buffer.from(buffer));
|
|
90317
90510
|
};
|
|
90318
90511
|
} else {
|
|
90319
90512
|
throw new Error("Unable to save because filesystem is disabled in this environment.");
|
|
90320
90513
|
}
|
|
90321
|
-
await fn(
|
|
90514
|
+
await fn(path19, this.toBlob());
|
|
90322
90515
|
}
|
|
90323
90516
|
}
|
|
90324
90517
|
},
|
|
@@ -90414,11 +90607,11 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
|
|
|
90414
90607
|
function calculateReflectOffset(i, w) {
|
|
90415
90608
|
return Math.abs((i + w) % (2 * w) - w);
|
|
90416
90609
|
}
|
|
90417
|
-
function saveBlob(
|
|
90610
|
+
function saveBlob(path19, blob) {
|
|
90418
90611
|
const dataURL = URL.createObjectURL(blob);
|
|
90419
90612
|
const downloadLink = document.createElement("a");
|
|
90420
90613
|
downloadLink.href = dataURL;
|
|
90421
|
-
downloadLink.download =
|
|
90614
|
+
downloadLink.download = path19;
|
|
90422
90615
|
downloadLink.click();
|
|
90423
90616
|
downloadLink.remove();
|
|
90424
90617
|
URL.revokeObjectURL(dataURL);
|
|
@@ -91019,8 +91212,8 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
|
|
|
91019
91212
|
}
|
|
91020
91213
|
|
|
91021
91214
|
class FileCache {
|
|
91022
|
-
constructor(
|
|
91023
|
-
this.path =
|
|
91215
|
+
constructor(path19) {
|
|
91216
|
+
this.path = path19;
|
|
91024
91217
|
}
|
|
91025
91218
|
async match(request) {
|
|
91026
91219
|
let filePath = node_path__WEBPACK_IMPORTED_MODULE_1__["default"].join(this.path, request);
|
|
@@ -91776,20 +91969,20 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
|
|
|
91776
91969
|
}
|
|
91777
91970
|
return this;
|
|
91778
91971
|
}
|
|
91779
|
-
async save(
|
|
91972
|
+
async save(path19) {
|
|
91780
91973
|
if (IS_BROWSER_OR_WEBWORKER) {
|
|
91781
91974
|
if (_env_js__WEBPACK_IMPORTED_MODULE_2__.apis.IS_WEBWORKER_ENV) {
|
|
91782
91975
|
throw new Error("Unable to save an image from a Web Worker.");
|
|
91783
91976
|
}
|
|
91784
|
-
const extension =
|
|
91977
|
+
const extension = path19.split(".").pop().toLowerCase();
|
|
91785
91978
|
const mime = CONTENT_TYPE_MAP.get(extension) ?? "image/png";
|
|
91786
91979
|
const blob = await this.toBlob(mime);
|
|
91787
|
-
(0, _core_js__WEBPACK_IMPORTED_MODULE_0__.saveBlob)(
|
|
91980
|
+
(0, _core_js__WEBPACK_IMPORTED_MODULE_0__.saveBlob)(path19, blob);
|
|
91788
91981
|
} else if (!_env_js__WEBPACK_IMPORTED_MODULE_2__.apis.IS_FS_AVAILABLE) {
|
|
91789
91982
|
throw new Error("Unable to save the image because filesystem is disabled in this environment.");
|
|
91790
91983
|
} else {
|
|
91791
91984
|
const img = this.toSharp();
|
|
91792
|
-
return await img.toFile(
|
|
91985
|
+
return await img.toFile(path19);
|
|
91793
91986
|
}
|
|
91794
91987
|
}
|
|
91795
91988
|
toSharp() {
|
|
@@ -101018,7 +101211,7 @@ Note that ${s.bold("include")} statements only accept relation fields.`, a;
|
|
|
101018
101211
|
function ns(e = Yo, t = Yo) {
|
|
101019
101212
|
return (r) => e(t(r));
|
|
101020
101213
|
}
|
|
101021
|
-
function
|
|
101214
|
+
function os9({ dataPath: e, modelName: t, args: r, runtimeDataModel: n }) {
|
|
101022
101215
|
let i = { modelName: t, args: r ?? {} }, o = dp(e);
|
|
101023
101216
|
if (!o || o.length === 0)
|
|
101024
101217
|
return i;
|
|
@@ -101323,10 +101516,10 @@ Note that ${s.bold("include")} statements only accept relation fields.`, a;
|
|
|
101323
101516
|
super(t, "P2023", r);
|
|
101324
101517
|
}
|
|
101325
101518
|
};
|
|
101326
|
-
var
|
|
101519
|
+
var fs14 = new WeakMap;
|
|
101327
101520
|
function Ep(e) {
|
|
101328
|
-
let t =
|
|
101329
|
-
return t || (t = Object.entries(e),
|
|
101521
|
+
let t = fs14.get(e);
|
|
101522
|
+
return t || (t = Object.entries(e), fs14.set(e, t)), t;
|
|
101330
101523
|
}
|
|
101331
101524
|
function hs(e, t, r) {
|
|
101332
101525
|
switch (t.type) {
|
|
@@ -104891,7 +105084,7 @@ new PrismaClient({
|
|
|
104891
105084
|
let m = await es(this, d);
|
|
104892
105085
|
if (!d.model)
|
|
104893
105086
|
return m;
|
|
104894
|
-
let g =
|
|
105087
|
+
let g = os9({ dataPath: d.dataPath, modelName: d.model, args: d.args, runtimeDataModel: this._runtimeDataModel });
|
|
104895
105088
|
return Wo({ result: m, modelName: g.modelName, args: g.args, extensions: this._extensions, runtimeDataModel: this._runtimeDataModel, globalOmit: this._globalOmit });
|
|
104896
105089
|
};
|
|
104897
105090
|
return this._tracingHelper.runInChildSpan(s.operation, () => new zl.AsyncResource("prisma-client-request").runInAsyncScope(() => a(o)));
|
|
@@ -105294,7 +105487,7 @@ var require_prisma = __commonJS((exports) => {
|
|
|
105294
105487
|
Prisma.JsonNull = JsonNull2;
|
|
105295
105488
|
Prisma.AnyNull = AnyNull2;
|
|
105296
105489
|
Prisma.NullTypes = NullTypes2;
|
|
105297
|
-
var
|
|
105490
|
+
var path19 = __require("path");
|
|
105298
105491
|
exports.Prisma.TransactionIsolationLevel = makeStrictEnum2({
|
|
105299
105492
|
ReadUncommitted: "ReadUncommitted",
|
|
105300
105493
|
ReadCommitted: "ReadCommitted",
|
|
@@ -116992,10 +117185,10 @@ var init_chunker_code = __esm(() => {
|
|
|
116992
117185
|
});
|
|
116993
117186
|
|
|
116994
117187
|
// ../../packages/core/dist/services/search/smart-chunker.js
|
|
116995
|
-
import
|
|
117188
|
+
import path19 from "path";
|
|
116996
117189
|
function smartChunk(content, filePath, config3 = {}) {
|
|
116997
117190
|
const cfg = { ...DEFAULT_CONFIG, ...config3 };
|
|
116998
|
-
const ext2 =
|
|
117191
|
+
const ext2 = path19.extname(filePath).toLowerCase();
|
|
116999
117192
|
const relativePath = filePath;
|
|
117000
117193
|
const fileImports = isCodeFile(ext2) ? extractFileImports(content, ext2) : undefined;
|
|
117001
117194
|
let chunks;
|
|
@@ -117333,8 +117526,8 @@ var init_embedding_freshness = __esm(() => {
|
|
|
117333
117526
|
});
|
|
117334
117527
|
|
|
117335
117528
|
// ../../packages/core/dist/services/search/project-indexer.js
|
|
117336
|
-
import
|
|
117337
|
-
import
|
|
117529
|
+
import fs14 from "fs/promises";
|
|
117530
|
+
import path20 from "path";
|
|
117338
117531
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
117339
117532
|
async function runWithIndexLock(lockMap, projectId, work) {
|
|
117340
117533
|
const prevLock = lockMap.get(projectId);
|
|
@@ -117377,7 +117570,7 @@ async function indexProjectInternal(deps, projectPath, projectId, options = {})
|
|
|
117377
117570
|
dot: false
|
|
117378
117571
|
});
|
|
117379
117572
|
const filteredFiles = files.filter((file2) => {
|
|
117380
|
-
const relativePath =
|
|
117573
|
+
const relativePath = path20.relative(projectPath, file2);
|
|
117381
117574
|
const shouldIgnore = ig.ignores(relativePath);
|
|
117382
117575
|
if (shouldIgnore) {
|
|
117383
117576
|
logger.debug("Ignoring file per .gitignore during indexing", {
|
|
@@ -117417,7 +117610,7 @@ async function indexProjectInternal(deps, projectPath, projectId, options = {})
|
|
|
117417
117610
|
});
|
|
117418
117611
|
}
|
|
117419
117612
|
}
|
|
117420
|
-
const indexedFilesList = filteredFiles.map((f) =>
|
|
117613
|
+
const indexedFilesList = filteredFiles.map((f) => path20.relative(projectPath, f));
|
|
117421
117614
|
await deps.indexManager.updateIndexMetadata(projectId, projectPath, indexedFilesList);
|
|
117422
117615
|
logger.info("Project indexing completed", {
|
|
117423
117616
|
projectId,
|
|
@@ -117547,7 +117740,7 @@ async function ensureFreshIndex(deps, projectId, projectPath, options = {}) {
|
|
|
117547
117740
|
let errors4 = 0;
|
|
117548
117741
|
for (const relativeFilePath of filesToReindex) {
|
|
117549
117742
|
try {
|
|
117550
|
-
const fullPath =
|
|
117743
|
+
const fullPath = path20.join(projectPath, relativeFilePath);
|
|
117551
117744
|
const result = await deps.indexFile(fullPath, projectId, projectPath, centralityMap);
|
|
117552
117745
|
filesIndexed++;
|
|
117553
117746
|
chunksIndexed += result.chunks;
|
|
@@ -117607,8 +117800,8 @@ async function checkSearchAdmission(deps, projectId, projectPath) {
|
|
|
117607
117800
|
}
|
|
117608
117801
|
async function indexFile(deps, filePath, projectId, projectRoot, centralityMap) {
|
|
117609
117802
|
projectId = await getProjectIdentityAliasResolver().resolve(projectId);
|
|
117610
|
-
const content = await
|
|
117611
|
-
const relativePath =
|
|
117803
|
+
const content = await fs14.readFile(filePath, "utf-8");
|
|
117804
|
+
const relativePath = path20.relative(projectRoot, filePath);
|
|
117612
117805
|
const maxFileSize = config.get("security").maxFileSize || 1024 * 1024;
|
|
117613
117806
|
if (content.length > maxFileSize) {
|
|
117614
117807
|
logger.warn("File too large, skipping", {
|
|
@@ -117628,7 +117821,7 @@ async function indexFile(deps, filePath, projectId, projectRoot, centralityMap)
|
|
|
117628
117821
|
chunkIndex: i,
|
|
117629
117822
|
totalChunks: chunks.length,
|
|
117630
117823
|
type: chunk.type,
|
|
117631
|
-
language:
|
|
117824
|
+
language: path20.extname(filePath).slice(1),
|
|
117632
117825
|
lineStart: chunk.lineStart,
|
|
117633
117826
|
lineEnd: chunk.lineEnd,
|
|
117634
117827
|
label: chunk.label,
|
|
@@ -122179,16 +122372,16 @@ function detectRoutes(httpEdges, defs, opts = {}) {
|
|
|
122179
122372
|
const seen = new Set;
|
|
122180
122373
|
const out = [];
|
|
122181
122374
|
for (const e of httpEdges) {
|
|
122182
|
-
const
|
|
122183
|
-
if (!
|
|
122375
|
+
const path21 = e.route;
|
|
122376
|
+
if (!path21)
|
|
122184
122377
|
continue;
|
|
122185
122378
|
const method = (e.method ?? "ANY").toUpperCase();
|
|
122186
|
-
const key = method + " " +
|
|
122379
|
+
const key = method + " " + path21;
|
|
122187
122380
|
if (seen.has(key))
|
|
122188
122381
|
continue;
|
|
122189
122382
|
seen.add(key);
|
|
122190
122383
|
out.push({
|
|
122191
|
-
path:
|
|
122384
|
+
path: path21,
|
|
122192
122385
|
method: e.method,
|
|
122193
122386
|
file: e.fromFile,
|
|
122194
122387
|
handler: e.targetFqn ?? e.symbolName
|
|
@@ -122199,12 +122392,12 @@ function detectRoutes(httpEdges, defs, opts = {}) {
|
|
|
122199
122392
|
continue;
|
|
122200
122393
|
const parsed = parseRouteName(d.name);
|
|
122201
122394
|
const method = parsed?.method ?? "ANY";
|
|
122202
|
-
const
|
|
122203
|
-
const key = method + " " +
|
|
122395
|
+
const path21 = parsed?.path ?? d.name;
|
|
122396
|
+
const key = method + " " + path21;
|
|
122204
122397
|
if (seen.has(key))
|
|
122205
122398
|
continue;
|
|
122206
122399
|
seen.add(key);
|
|
122207
|
-
out.push({ path:
|
|
122400
|
+
out.push({ path: path21, method: parsed?.method, file: d.filePath, handler: d.name });
|
|
122208
122401
|
}
|
|
122209
122402
|
for (const d of defs) {
|
|
122210
122403
|
const parsed = parseRouteName(d.name);
|
|
@@ -122425,8 +122618,8 @@ __export(exports_symbol_graph_service, {
|
|
|
122425
122618
|
symbolGraphService: () => symbolGraphService,
|
|
122426
122619
|
SymbolGraphService: () => SymbolGraphService
|
|
122427
122620
|
});
|
|
122428
|
-
import
|
|
122429
|
-
import
|
|
122621
|
+
import path21 from "path";
|
|
122622
|
+
import fs15 from "fs/promises";
|
|
122430
122623
|
|
|
122431
122624
|
class SymbolGraphService {
|
|
122432
122625
|
identityLookup;
|
|
@@ -122754,7 +122947,7 @@ class SymbolGraphService {
|
|
|
122754
122947
|
async readSnippet(relativePath, lineStart, lineEnd, projectId) {
|
|
122755
122948
|
try {
|
|
122756
122949
|
const absolutePath = await this.resolveToAbsolute(relativePath, projectId);
|
|
122757
|
-
const content = await
|
|
122950
|
+
const content = await fs15.readFile(absolutePath, "utf-8");
|
|
122758
122951
|
const lines = content.split(`
|
|
122759
122952
|
`);
|
|
122760
122953
|
return lines.slice(Math.max(0, lineStart - 1), Math.min(lines.length, lineEnd)).join(`
|
|
@@ -122766,7 +122959,7 @@ class SymbolGraphService {
|
|
|
122766
122959
|
async readContext(relativePath, lineNumber, contextLines, projectId) {
|
|
122767
122960
|
try {
|
|
122768
122961
|
const absolutePath = await this.resolveToAbsolute(relativePath, projectId);
|
|
122769
|
-
const content = await
|
|
122962
|
+
const content = await fs15.readFile(absolutePath, "utf-8");
|
|
122770
122963
|
const lines = content.split(`
|
|
122771
122964
|
`);
|
|
122772
122965
|
const start = Math.max(0, lineNumber - contextLines - 1);
|
|
@@ -122779,7 +122972,7 @@ class SymbolGraphService {
|
|
|
122779
122972
|
}
|
|
122780
122973
|
async resolveToAbsolute(relativePath, projectId) {
|
|
122781
122974
|
const root = await this.getProjectRoot(projectId);
|
|
122782
|
-
return root ?
|
|
122975
|
+
return root ? path21.resolve(root, relativePath) : relativePath;
|
|
122783
122976
|
}
|
|
122784
122977
|
async getProjectRoot(projectId) {
|
|
122785
122978
|
const cached2 = this.projectRootCache.get(projectId);
|
|
@@ -124557,31 +124750,31 @@ class TracePathService {
|
|
|
124557
124750
|
const chains = [];
|
|
124558
124751
|
const seen = new Set;
|
|
124559
124752
|
let walks = 0;
|
|
124560
|
-
const walk = (fqn,
|
|
124753
|
+
const walk = (fqn, path22) => {
|
|
124561
124754
|
if (chains.length >= CHAIN_CAP)
|
|
124562
124755
|
return;
|
|
124563
124756
|
if (walks >= MAX_WALKS)
|
|
124564
124757
|
return;
|
|
124565
124758
|
walks++;
|
|
124566
|
-
const key =
|
|
124759
|
+
const key = path22.join("\u2192");
|
|
124567
124760
|
if (seen.has(key))
|
|
124568
124761
|
return;
|
|
124569
124762
|
seen.add(key);
|
|
124570
124763
|
const next = adj.get(fqn);
|
|
124571
124764
|
if (!next || next.length === 0 || !whoHasChild.has(fqn)) {
|
|
124572
|
-
if (
|
|
124573
|
-
chains.push(
|
|
124765
|
+
if (path22.length > 1)
|
|
124766
|
+
chains.push(path22.map((n) => this.fqnToName(n)).join(" \u2192 "));
|
|
124574
124767
|
return;
|
|
124575
124768
|
}
|
|
124576
124769
|
for (const child of next) {
|
|
124577
124770
|
if (chains.length >= CHAIN_CAP || walks >= MAX_WALKS)
|
|
124578
124771
|
return;
|
|
124579
|
-
if (
|
|
124580
|
-
const cycled = [...
|
|
124772
|
+
if (path22.includes(child)) {
|
|
124773
|
+
const cycled = [...path22, `${this.fqnToName(child)}\u21BA`];
|
|
124581
124774
|
chains.push(cycled.map((n) => n).join(" \u2192 "));
|
|
124582
124775
|
continue;
|
|
124583
124776
|
}
|
|
124584
|
-
walk(child, [...
|
|
124777
|
+
walk(child, [...path22, child]);
|
|
124585
124778
|
}
|
|
124586
124779
|
};
|
|
124587
124780
|
for (const seed of seeds) {
|
|
@@ -126604,9 +126797,9 @@ var init_inference_probe = __esm(() => {
|
|
|
126604
126797
|
});
|
|
126605
126798
|
|
|
126606
126799
|
// ../../packages/core/dist/services/health/local-health-checker.js
|
|
126607
|
-
import
|
|
126800
|
+
import fs16 from "fs/promises";
|
|
126608
126801
|
import { existsSync as existsSync3 } from "fs";
|
|
126609
|
-
import
|
|
126802
|
+
import path22 from "path";
|
|
126610
126803
|
|
|
126611
126804
|
class LocalHealthChecker {
|
|
126612
126805
|
dataDir = config.get("dataDir");
|
|
@@ -126684,10 +126877,10 @@ class LocalHealthChecker {
|
|
|
126684
126877
|
const start = Date.now();
|
|
126685
126878
|
try {
|
|
126686
126879
|
if (!existsSync3(this.dataDir))
|
|
126687
|
-
await
|
|
126688
|
-
const probe =
|
|
126689
|
-
await
|
|
126690
|
-
await
|
|
126880
|
+
await fs16.mkdir(this.dataDir, { recursive: true });
|
|
126881
|
+
const probe = path22.join(this.dataDir, ".health-check-test");
|
|
126882
|
+
await fs16.writeFile(probe, "ok");
|
|
126883
|
+
await fs16.unlink(probe);
|
|
126691
126884
|
return { available: true, latency: Date.now() - start, details: { path: this.dataDir, writable: true } };
|
|
126692
126885
|
} catch (error51) {
|
|
126693
126886
|
return { available: false, latency: Date.now() - start, error: `Data directory error: ${error51.message}` };
|
|
@@ -129978,9 +130171,9 @@ var init_scheduler2 = __esm(() => {
|
|
|
129978
130171
|
});
|
|
129979
130172
|
|
|
129980
130173
|
// ../../packages/core/dist/services/pricing/models-dev-client.js
|
|
129981
|
-
import
|
|
130174
|
+
import fs17 from "fs/promises";
|
|
129982
130175
|
import { existsSync as existsSync4 } from "fs";
|
|
129983
|
-
import
|
|
130176
|
+
import path23 from "path";
|
|
129984
130177
|
function getModelsDevClient() {
|
|
129985
130178
|
if (!clientInstance) {
|
|
129986
130179
|
clientInstance = new ModelsDevClient;
|
|
@@ -130000,7 +130193,7 @@ var init_models_dev_client = __esm(() => {
|
|
|
130000
130193
|
memoryCacheTimestamp = 0;
|
|
130001
130194
|
getLocalCachePath() {
|
|
130002
130195
|
const dataDir = config.get("dataDir");
|
|
130003
|
-
return
|
|
130196
|
+
return path23.join(dataDir, ModelsDevClient.LOCAL_CACHE_FILE);
|
|
130004
130197
|
}
|
|
130005
130198
|
async loadLocalCache() {
|
|
130006
130199
|
const cachePath = this.getLocalCachePath();
|
|
@@ -130008,7 +130201,7 @@ var init_models_dev_client = __esm(() => {
|
|
|
130008
130201
|
if (!existsSync4(cachePath)) {
|
|
130009
130202
|
return null;
|
|
130010
130203
|
}
|
|
130011
|
-
const content = await
|
|
130204
|
+
const content = await fs17.readFile(cachePath, "utf-8");
|
|
130012
130205
|
const data = JSON.parse(content);
|
|
130013
130206
|
const age = Date.now() - data.timestamp;
|
|
130014
130207
|
if (age > ModelsDevClient.LOCAL_CACHE_TTL) {
|
|
@@ -130035,14 +130228,14 @@ var init_models_dev_client = __esm(() => {
|
|
|
130035
130228
|
async saveLocalCache(models) {
|
|
130036
130229
|
const cachePath = this.getLocalCachePath();
|
|
130037
130230
|
try {
|
|
130038
|
-
const dir =
|
|
130039
|
-
await
|
|
130231
|
+
const dir = path23.dirname(cachePath);
|
|
130232
|
+
await fs17.mkdir(dir, { recursive: true });
|
|
130040
130233
|
const data = {
|
|
130041
130234
|
timestamp: Date.now(),
|
|
130042
130235
|
version: "1.0.0",
|
|
130043
130236
|
models: Object.fromEntries(models)
|
|
130044
130237
|
};
|
|
130045
|
-
await
|
|
130238
|
+
await fs17.writeFile(cachePath, JSON.stringify(data), "utf-8");
|
|
130046
130239
|
logger.debug("Saved pricing to local cache", {
|
|
130047
130240
|
models: models.size,
|
|
130048
130241
|
path: cachePath
|
|
@@ -130371,7 +130564,7 @@ var init_models_dev_client = __esm(() => {
|
|
|
130371
130564
|
const cachePath = this.getLocalCachePath();
|
|
130372
130565
|
try {
|
|
130373
130566
|
if (existsSync4(cachePath)) {
|
|
130374
|
-
await
|
|
130567
|
+
await fs17.unlink(cachePath);
|
|
130375
130568
|
logger.debug("Local pricing cache file deleted");
|
|
130376
130569
|
}
|
|
130377
130570
|
} catch (error51) {
|
|
@@ -130974,8 +131167,8 @@ function stripNul(content) {
|
|
|
130974
131167
|
}
|
|
130975
131168
|
|
|
130976
131169
|
// ../../packages/core/dist/services/etl/stages/discover.js
|
|
130977
|
-
import
|
|
130978
|
-
import
|
|
131170
|
+
import fs18 from "fs/promises";
|
|
131171
|
+
import path24 from "path";
|
|
130979
131172
|
import { createHash as createHash8 } from "crypto";
|
|
130980
131173
|
|
|
130981
131174
|
class DiscoverStage {
|
|
@@ -131001,7 +131194,7 @@ class DiscoverStage {
|
|
|
131001
131194
|
dot: false,
|
|
131002
131195
|
absolute: false
|
|
131003
131196
|
});
|
|
131004
|
-
relPaths = found.map((p) =>
|
|
131197
|
+
relPaths = found.map((p) => path24.isAbsolute(p) ? path24.relative(ctx.projectPath, p) : p).filter((p) => !ig.ignores(p) && applyPolicy(p, policy) !== "Drop");
|
|
131005
131198
|
}
|
|
131006
131199
|
if (ctx.resumeCursor?.path) {
|
|
131007
131200
|
const cursorPath = ctx.resumeCursor.path;
|
|
@@ -131060,10 +131253,10 @@ class DiscoverStage {
|
|
|
131060
131253
|
return discovered;
|
|
131061
131254
|
}
|
|
131062
131255
|
async processFile(ctx, relativePath, forceReindex) {
|
|
131063
|
-
const absolutePath =
|
|
131256
|
+
const absolutePath = path24.join(ctx.projectPath, relativePath);
|
|
131064
131257
|
try {
|
|
131065
|
-
const stat = await
|
|
131066
|
-
const content = stripNul(await
|
|
131258
|
+
const stat = await fs18.stat(absolutePath);
|
|
131259
|
+
const content = stripNul(await fs18.readFile(absolutePath, "utf-8"));
|
|
131067
131260
|
const contentHash = createHash8("sha256").update(content).digest("hex");
|
|
131068
131261
|
let needsReparse = forceReindex;
|
|
131069
131262
|
if (!forceReindex) {
|
|
@@ -131106,8 +131299,8 @@ class DiscoverStage {
|
|
|
131106
131299
|
ig.add(pattern);
|
|
131107
131300
|
}
|
|
131108
131301
|
try {
|
|
131109
|
-
const gitignorePath =
|
|
131110
|
-
const gitignoreContent = await
|
|
131302
|
+
const gitignorePath = path24.join(projectPath, ".gitignore");
|
|
131303
|
+
const gitignoreContent = await fs18.readFile(gitignorePath, "utf8");
|
|
131111
131304
|
const rules = gitignoreContent.split(`
|
|
131112
131305
|
`).map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
|
|
131113
131306
|
ig.add(rules);
|
|
@@ -132462,8 +132655,8 @@ function rustUseLeaves(node, source, prefix = []) {
|
|
|
132462
132655
|
}
|
|
132463
132656
|
if (node.type === "use_wildcard")
|
|
132464
132657
|
return [{ path: [...prefix, "*"], glob: true }];
|
|
132465
|
-
const
|
|
132466
|
-
return
|
|
132658
|
+
const path25 = rustPathSegments(node, source);
|
|
132659
|
+
return path25.length ? [{ path: [...prefix, ...path25] }] : [];
|
|
132467
132660
|
}
|
|
132468
132661
|
function functionalCaptures(captures, source, family) {
|
|
132469
132662
|
if (family !== "clojure")
|
|
@@ -133435,8 +133628,8 @@ var init_structural_runtime = __esm(() => {
|
|
|
133435
133628
|
});
|
|
133436
133629
|
|
|
133437
133630
|
// ../../packages/core/dist/services/etl/stages/parse.js
|
|
133438
|
-
import
|
|
133439
|
-
import
|
|
133631
|
+
import path25 from "path";
|
|
133632
|
+
import fs19 from "fs/promises";
|
|
133440
133633
|
function resolveChunkerMaxChars() {
|
|
133441
133634
|
const global2 = Number(process.env.EMBEDDING_MAX_CHARS);
|
|
133442
133635
|
if (Number.isFinite(global2) && global2 > 0)
|
|
@@ -133464,8 +133657,8 @@ class ParseStage {
|
|
|
133464
133657
|
const results = new Map;
|
|
133465
133658
|
let processed = 0;
|
|
133466
133659
|
const phases = [
|
|
133467
|
-
files.filter((file2) =>
|
|
133468
|
-
files.filter((file2) =>
|
|
133660
|
+
files.filter((file2) => path25.extname(file2.relativePath).toLowerCase() !== ".h"),
|
|
133661
|
+
files.filter((file2) => path25.extname(file2.relativePath).toLowerCase() === ".h")
|
|
133469
133662
|
];
|
|
133470
133663
|
const batches = phases.flatMap((phase) => Array.from({ length: Math.ceil(phase.length / BATCH_SIZE) }, (_, index) => phase.slice(index * BATCH_SIZE, (index + 1) * BATCH_SIZE)));
|
|
133471
133664
|
for (const batch of batches) {
|
|
@@ -133503,19 +133696,19 @@ class ParseStage {
|
|
|
133503
133696
|
return files.map((file2) => results.get(file2.relativePath));
|
|
133504
133697
|
}
|
|
133505
133698
|
recordHeaderImporterEvidence(ctx, files, parsedFiles) {
|
|
133506
|
-
const knownHeaders = new Set(files.filter((file2) =>
|
|
133699
|
+
const knownHeaders = new Set(files.filter((file2) => path25.extname(file2.relativePath).toLowerCase() === ".h").map((file2) => path25.posix.normalize(file2.relativePath)));
|
|
133507
133700
|
const mutable = {
|
|
133508
133701
|
...ctx.structuralHeaderEvidenceByFile
|
|
133509
133702
|
};
|
|
133510
133703
|
for (const parsed of parsedFiles) {
|
|
133511
|
-
const extension =
|
|
133704
|
+
const extension = path25.extname(parsed.file.relativePath).toLowerCase();
|
|
133512
133705
|
const key = extension === ".c" ? "cImporters" : [".cpp", ".hpp"].includes(extension) ? "cppImporters" : undefined;
|
|
133513
133706
|
if (!key)
|
|
133514
133707
|
continue;
|
|
133515
133708
|
for (const imported of parsed.rawImports) {
|
|
133516
133709
|
if (!["c_include", "cpp_include"].includes(imported.form) || imported.specifier.startsWith("<"))
|
|
133517
133710
|
continue;
|
|
133518
|
-
const header =
|
|
133711
|
+
const header = path25.posix.normalize(path25.posix.join(path25.posix.dirname(parsed.file.relativePath), imported.specifier));
|
|
133519
133712
|
if (!knownHeaders.has(header))
|
|
133520
133713
|
continue;
|
|
133521
133714
|
const existing = mutable[header] ?? {};
|
|
@@ -133526,9 +133719,9 @@ class ParseStage {
|
|
|
133526
133719
|
}
|
|
133527
133720
|
async parseFile(ctx, file2) {
|
|
133528
133721
|
if (!file2.needsReparse) {
|
|
133529
|
-
const extension =
|
|
133722
|
+
const extension = path25.extname(file2.relativePath).toLowerCase();
|
|
133530
133723
|
if ([".c", ".cpp", ".hpp"].includes(extension)) {
|
|
133531
|
-
const content = file2.snapshotContent ?? await
|
|
133724
|
+
const content = file2.snapshotContent ?? await fs19.readFile(file2.absolutePath, "utf8");
|
|
133532
133725
|
const outcome = await this.runtime.parse({ extension, source: Buffer.from(content) });
|
|
133533
133726
|
if (outcome.status === "failed")
|
|
133534
133727
|
throw new StructuralEtlParseError(file2.relativePath, outcome.failureKind, `Structural evidence parse failed (${outcome.failureKind})`, outcome.diagnosticCount, outcome.diagnostics.slice(0, 10));
|
|
@@ -133540,8 +133733,8 @@ class ParseStage {
|
|
|
133540
133733
|
return { file: file2, chunks: [], symbols: [], rawImports: [], rawEdges: [] };
|
|
133541
133734
|
}
|
|
133542
133735
|
try {
|
|
133543
|
-
const content = file2.snapshotContent ?? await
|
|
133544
|
-
const ext2 =
|
|
133736
|
+
const content = file2.snapshotContent ?? await fs19.readFile(file2.absolutePath, "utf-8");
|
|
133737
|
+
const ext2 = path25.extname(file2.relativePath).toLowerCase();
|
|
133545
133738
|
const chunkerMaxChars = resolveChunkerMaxChars();
|
|
133546
133739
|
const chunks = smartChunk(content, file2.relativePath, chunkerMaxChars ? { maxChunkChars: chunkerMaxChars } : {});
|
|
133547
133740
|
let symbols;
|
|
@@ -134095,7 +134288,7 @@ var init_resolver = __esm(() => {
|
|
|
134095
134288
|
});
|
|
134096
134289
|
|
|
134097
134290
|
// ../../packages/core/dist/services/structural/resolvers/typescript.js
|
|
134098
|
-
import
|
|
134291
|
+
import path26 from "path";
|
|
134099
134292
|
function candidates(identities) {
|
|
134100
134293
|
return Object.freeze(identities.map((identity) => Object.freeze({
|
|
134101
134294
|
fqn: identity.fqn,
|
|
@@ -134190,7 +134383,7 @@ function probe(base, known, dialect = "typescript") {
|
|
|
134190
134383
|
const bases = /\.[cm]?jsx?$/u.test(base) ? [base.replace(/\.[cm]?jsx?$/u, ".ts"), base.replace(/\.[cm]?jsx?$/u, ".tsx"), base] : [base];
|
|
134191
134384
|
for (const candidateBase of bases)
|
|
134192
134385
|
for (const suffix of DIALECT_PROBES[dialect] ?? [""]) {
|
|
134193
|
-
const value =
|
|
134386
|
+
const value = path26.posix.normalize(`${candidateBase}${suffix}`);
|
|
134194
134387
|
if (!value.startsWith("../") && value !== ".." && known.has(value))
|
|
134195
134388
|
return value;
|
|
134196
134389
|
}
|
|
@@ -134199,7 +134392,7 @@ function probe(base, known, dialect = "typescript") {
|
|
|
134199
134392
|
function resolveStructuralSpecifier(specifier, fromFile, build, dialect = "typescript") {
|
|
134200
134393
|
const known = new Set(build.knownFiles.map(normalizeStructuralFile));
|
|
134201
134394
|
if (specifier.startsWith("./") || specifier.startsWith("../")) {
|
|
134202
|
-
return probe(
|
|
134395
|
+
return probe(path26.posix.join(path26.posix.dirname(fromFile), specifier), known, dialect);
|
|
134203
134396
|
}
|
|
134204
134397
|
const aliases = build.pathAliasesByFile?.[normalizeStructuralFile(fromFile)] ?? build.pathAliases ?? [];
|
|
134205
134398
|
for (const alias of aliases) {
|
|
@@ -134463,7 +134656,7 @@ var init_scripting2 = __esm(() => {
|
|
|
134463
134656
|
});
|
|
134464
134657
|
|
|
134465
134658
|
// ../../packages/core/dist/services/structural/resolvers/systems.js
|
|
134466
|
-
import
|
|
134659
|
+
import path27 from "path";
|
|
134467
134660
|
var DIALECTS, SYSTEMS_LANGUAGE_RESOLVER;
|
|
134468
134661
|
var init_systems2 = __esm(() => {
|
|
134469
134662
|
init_typescript2();
|
|
@@ -134482,7 +134675,7 @@ var init_systems2 = __esm(() => {
|
|
|
134482
134675
|
const bindings = item.bindings.map((binding) => binding.imported === "*" && binding.local === "*" && unresolvedTarget && !unresolvedTarget.qualifier ? { ...binding, imported: unresolvedTarget.name, local: unresolvedTarget.name } : binding);
|
|
134483
134676
|
if (item.specifier === "crate" || item.specifier.startsWith("crate/")) {
|
|
134484
134677
|
const crateRoot = file2.file.startsWith("src/") ? "src" : "";
|
|
134485
|
-
return { ...item, bindings, specifier: `./${
|
|
134678
|
+
return { ...item, bindings, specifier: `./${path27.posix.relative(path27.posix.dirname(file2.file), path27.posix.join(crateRoot, item.specifier.replace(/^crate\/?/u, "")))}` };
|
|
134486
134679
|
}
|
|
134487
134680
|
if (item.specifier === "self" || item.specifier.startsWith("self/"))
|
|
134488
134681
|
return { ...item, bindings, specifier: `./${item.specifier.replace(/^self\/?/u, "")}` };
|
|
@@ -134580,8 +134773,8 @@ var init_data_document2 = __esm(() => {
|
|
|
134580
134773
|
});
|
|
134581
134774
|
|
|
134582
134775
|
// ../../packages/core/dist/services/etl/stages/resolve.js
|
|
134583
|
-
import
|
|
134584
|
-
import
|
|
134776
|
+
import path28 from "path";
|
|
134777
|
+
import fs20 from "fs";
|
|
134585
134778
|
|
|
134586
134779
|
class ResolveStage {
|
|
134587
134780
|
symbolRepository;
|
|
@@ -134605,7 +134798,7 @@ class ResolveStage {
|
|
|
134605
134798
|
const structuralDocuments = files.flatMap((file2) => {
|
|
134606
134799
|
if (!file2.structure)
|
|
134607
134800
|
return [];
|
|
134608
|
-
const language = resolveStructuralLanguage(
|
|
134801
|
+
const language = resolveStructuralLanguage(path28.extname(file2.file.relativePath));
|
|
134609
134802
|
if (language.status !== "supported")
|
|
134610
134803
|
throw new Error(`structural_manifest_missing:${file2.file.relativePath}`);
|
|
134611
134804
|
return [{
|
|
@@ -134617,13 +134810,13 @@ class ResolveStage {
|
|
|
134617
134810
|
}];
|
|
134618
134811
|
});
|
|
134619
134812
|
const currentStructuralFiles = new Set(structuralDocuments.map((document2) => document2.file));
|
|
134620
|
-
const skippedStructuralFiles = new Set(files.filter((item) => !item.file.needsReparse && STRUCTURAL_SEED_EXTENSIONS.has(
|
|
134813
|
+
const skippedStructuralFiles = new Set(files.filter((item) => !item.file.needsReparse && STRUCTURAL_SEED_EXTENSIONS.has(path28.extname(item.file.relativePath).toLowerCase())).map((item) => item.file.relativePath));
|
|
134621
134814
|
const pathAliasesByFile = Object.fromEntries([...knownRelPaths].map((file2) => [
|
|
134622
134815
|
file2,
|
|
134623
134816
|
this.structuralAliasesFor(file2, rootAliases, monorepoPackages)
|
|
134624
134817
|
]));
|
|
134625
134818
|
const buildMetadata = { knownFiles: [...knownRelPaths], pathAliasesByFile };
|
|
134626
|
-
const seedRows = repositoryDefinitions.filter((definition) => STRUCTURAL_SEED_EXTENSIONS.has(
|
|
134819
|
+
const seedRows = repositoryDefinitions.filter((definition) => STRUCTURAL_SEED_EXTENSIONS.has(path28.extname(definition.file_path).toLowerCase())).filter((definition) => knownRelPaths.has(definition.file_path) && skippedStructuralFiles.has(definition.file_path)).filter((definition) => !currentStructuralFiles.has(definition.file_path));
|
|
134627
134820
|
const seedIds = new Set;
|
|
134628
134821
|
for (const definition of seedRows) {
|
|
134629
134822
|
if (seedIds.has(definition.id))
|
|
@@ -134716,7 +134909,7 @@ class ResolveStage {
|
|
|
134716
134909
|
if (parsed.file !== definition.file_path) {
|
|
134717
134910
|
throw new Error(`structural_repository_seed_file_mismatch:${definition.id}`);
|
|
134718
134911
|
}
|
|
134719
|
-
const language = resolveStructuralLanguage(
|
|
134912
|
+
const language = resolveStructuralLanguage(path28.extname(definition.file_path));
|
|
134720
134913
|
if (language.status !== "supported")
|
|
134721
134914
|
throw new Error(`structural_repository_seed_language:${definition.id}`);
|
|
134722
134915
|
let identity;
|
|
@@ -134768,7 +134961,7 @@ class ResolveStage {
|
|
|
134768
134961
|
});
|
|
134769
134962
|
}
|
|
134770
134963
|
resolveFile(parsed, projectPath, knownRelPaths, rootAliases, monorepoPackages, symbolIndex, knownFqns) {
|
|
134771
|
-
const fromDir =
|
|
134964
|
+
const fromDir = path28.dirname(path28.join(projectPath, parsed.file.relativePath));
|
|
134772
134965
|
const packageAliases = this.getPackageAliases(parsed.file.relativePath, monorepoPackages);
|
|
134773
134966
|
const allAliases = [...packageAliases, ...rootAliases];
|
|
134774
134967
|
const resolvedImports = parsed.rawImports.map((raw2) => {
|
|
@@ -134839,7 +135032,7 @@ class ResolveStage {
|
|
|
134839
135032
|
index.set(def.name, `${def.file_path}#${def.name}`);
|
|
134840
135033
|
}
|
|
134841
135034
|
} catch (err) {
|
|
134842
|
-
const skippedStructural = files.some((file2) => !file2.file.needsReparse && STRUCTURAL_SEED_EXTENSIONS.has(
|
|
135035
|
+
const skippedStructural = files.some((file2) => !file2.file.needsReparse && STRUCTURAL_SEED_EXTENSIONS.has(path28.extname(file2.file.relativePath).toLowerCase()));
|
|
134843
135036
|
if (skippedStructural)
|
|
134844
135037
|
throw new Error("structural_repository_seed_failed", { cause: err });
|
|
134845
135038
|
logger.warn("buildSymbolIndex: repo seed failed, in-batch only", {
|
|
@@ -134863,7 +135056,7 @@ class ResolveStage {
|
|
|
134863
135056
|
}
|
|
134864
135057
|
resolveSpecifier(specifier, fromDir, projectPath, knownRelPaths, aliases) {
|
|
134865
135058
|
if (specifier.startsWith("./") || specifier.startsWith("../")) {
|
|
134866
|
-
const resolved = this.probeExtensions(
|
|
135059
|
+
const resolved = this.probeExtensions(path28.resolve(fromDir, specifier), projectPath, knownRelPaths);
|
|
134867
135060
|
return { resolvedPath: resolved, external: false };
|
|
134868
135061
|
}
|
|
134869
135062
|
for (const alias of aliases) {
|
|
@@ -134871,8 +135064,8 @@ class ResolveStage {
|
|
|
134871
135064
|
const suffix = specifier.slice(alias.prefix.length);
|
|
134872
135065
|
for (const target of alias.targets) {
|
|
134873
135066
|
const cleanTarget = target.replace(/\/\*$/, "");
|
|
134874
|
-
const basePath = alias.packagePath ?
|
|
134875
|
-
const absPath =
|
|
135067
|
+
const basePath = alias.packagePath ? path28.join(projectPath, alias.packagePath) : projectPath;
|
|
135068
|
+
const absPath = path28.join(basePath, cleanTarget + suffix);
|
|
134876
135069
|
const resolved = this.probeExtensions(absPath, projectPath, knownRelPaths);
|
|
134877
135070
|
if (resolved)
|
|
134878
135071
|
return { resolvedPath: resolved, external: false };
|
|
@@ -134888,7 +135081,7 @@ class ResolveStage {
|
|
|
134888
135081
|
...TS_EXTENSIONS.map((ext2) => absPath.replace(/\.[^.]+$/, ext2))
|
|
134889
135082
|
];
|
|
134890
135083
|
for (const candidate2 of candidates2) {
|
|
134891
|
-
const rel =
|
|
135084
|
+
const rel = path28.relative(projectPath, candidate2).replace(/\\/g, "/");
|
|
134892
135085
|
if (knownRelPaths.has(rel))
|
|
134893
135086
|
return rel;
|
|
134894
135087
|
}
|
|
@@ -134896,9 +135089,9 @@ class ResolveStage {
|
|
|
134896
135089
|
}
|
|
134897
135090
|
loadTsConfigPaths(projectPath, packageBase) {
|
|
134898
135091
|
const aliases = [];
|
|
134899
|
-
const tsconfigPath =
|
|
135092
|
+
const tsconfigPath = path28.join(projectPath, "tsconfig.json");
|
|
134900
135093
|
try {
|
|
134901
|
-
const raw2 =
|
|
135094
|
+
const raw2 = fs20.readFileSync(tsconfigPath, "utf-8");
|
|
134902
135095
|
const stripped = raw2.replace(/\/\/[^\n]*/g, "").replace(/\/\*[\s\S]*?\*\//g, "");
|
|
134903
135096
|
const tsconfig = JSON.parse(stripped);
|
|
134904
135097
|
const paths = tsconfig?.compilerOptions?.paths ?? {};
|
|
@@ -134927,7 +135120,7 @@ class ResolveStage {
|
|
|
134927
135120
|
}
|
|
134928
135121
|
}
|
|
134929
135122
|
for (const packageRelPath of packagePaths) {
|
|
134930
|
-
const absPackagePath =
|
|
135123
|
+
const absPackagePath = path28.join(projectPath, packageRelPath);
|
|
134931
135124
|
const aliases = this.loadTsConfigPaths(absPackagePath, packageRelPath);
|
|
134932
135125
|
if (aliases.length > 0) {
|
|
134933
135126
|
packages.push({
|
|
@@ -134957,7 +135150,7 @@ class ResolveStage {
|
|
|
134957
135150
|
structuralAliasesFor(filePath, rootAliases, packages) {
|
|
134958
135151
|
return [...this.getPackageAliases(filePath, packages), ...rootAliases].map((alias) => ({
|
|
134959
135152
|
pattern: alias.prefix + (alias.targets.some((target) => target.includes("*")) ? "/*" : ""),
|
|
134960
|
-
targets: alias.targets.map((target) => alias.packagePath ?
|
|
135153
|
+
targets: alias.targets.map((target) => alias.packagePath ? path28.posix.join(alias.packagePath, target) : target)
|
|
134961
135154
|
}));
|
|
134962
135155
|
}
|
|
134963
135156
|
}
|
|
@@ -135021,7 +135214,7 @@ var init_with_deadlock_retry = __esm(() => {
|
|
|
135021
135214
|
});
|
|
135022
135215
|
|
|
135023
135216
|
// ../../packages/core/dist/services/etl/stages/load.js
|
|
135024
|
-
import
|
|
135217
|
+
import path29 from "path";
|
|
135025
135218
|
function formatDuration(ms) {
|
|
135026
135219
|
const totalSec = Math.max(0, Math.round(ms / 1000));
|
|
135027
135220
|
if (totalSec < 60)
|
|
@@ -135298,7 +135491,7 @@ class LoadStage {
|
|
|
135298
135491
|
const filePath = file2.file.relativePath;
|
|
135299
135492
|
const batch = buildSymbolPersistenceBatch(ctx.projectId, file2);
|
|
135300
135493
|
if (ctx.graphGenerationLease) {
|
|
135301
|
-
const manifest = getLanguageManifestEntry(
|
|
135494
|
+
const manifest = getLanguageManifestEntry(path29.extname(filePath));
|
|
135302
135495
|
const diagnostics2 = (file2.structuralDiagnostics ?? []).slice(0, 10).map((diagnostic2) => ({
|
|
135303
135496
|
code: diagnostic2.code,
|
|
135304
135497
|
severity: diagnostic2.severity,
|
|
@@ -135755,9 +135948,9 @@ var init_graph_generation_coordinator = __esm(() => {
|
|
|
135755
135948
|
// ../../packages/core/dist/services/etl/pipeline.js
|
|
135756
135949
|
import { createHash as createHash10 } from "crypto";
|
|
135757
135950
|
import { setTimeout as delay2 } from "timers/promises";
|
|
135758
|
-
import
|
|
135951
|
+
import path30 from "path";
|
|
135759
135952
|
function buildHeaderLanguageEvidence(files) {
|
|
135760
|
-
const headers = new Set(files.filter((file2) =>
|
|
135953
|
+
const headers = new Set(files.filter((file2) => path30.posix.extname(file2.relativePath).toLowerCase() === ".h").map((file2) => path30.posix.normalize(file2.relativePath)));
|
|
135761
135954
|
const mutable = new Map;
|
|
135762
135955
|
const entry2 = (header) => {
|
|
135763
135956
|
let value = mutable.get(header);
|
|
@@ -135768,7 +135961,7 @@ function buildHeaderLanguageEvidence(files) {
|
|
|
135768
135961
|
return value;
|
|
135769
135962
|
};
|
|
135770
135963
|
for (const file2 of files) {
|
|
135771
|
-
if (
|
|
135964
|
+
if (path30.posix.basename(file2.relativePath) !== "compile_commands.json" || file2.snapshotContent === undefined)
|
|
135772
135965
|
continue;
|
|
135773
135966
|
let commands;
|
|
135774
135967
|
try {
|
|
@@ -135784,11 +135977,11 @@ function buildHeaderLanguageEvidence(files) {
|
|
|
135784
135977
|
const record2 = command;
|
|
135785
135978
|
if (typeof record2.file !== "string")
|
|
135786
135979
|
continue;
|
|
135787
|
-
const projectRoot =
|
|
135788
|
-
const commandDirectory = typeof record2.directory === "string" ?
|
|
135789
|
-
const absoluteInput =
|
|
135790
|
-
const relative3 =
|
|
135791
|
-
const header =
|
|
135980
|
+
const projectRoot = path30.resolve(file2.absolutePath, ...file2.relativePath.split("/").map(() => ".."));
|
|
135981
|
+
const commandDirectory = typeof record2.directory === "string" ? path30.resolve(projectRoot, record2.directory) : projectRoot;
|
|
135982
|
+
const absoluteInput = path30.resolve(commandDirectory, record2.file);
|
|
135983
|
+
const relative3 = path30.relative(projectRoot, absoluteInput);
|
|
135984
|
+
const header = path30.posix.normalize(relative3.replaceAll(path30.sep, "/"));
|
|
135792
135985
|
if (!headers.has(header))
|
|
135793
135986
|
continue;
|
|
135794
135987
|
const invocation = typeof record2.command === "string" ? record2.command : Array.isArray(record2.arguments) ? record2.arguments.join(" ") : "";
|
|
@@ -141670,33 +141863,33 @@ var require_URL = __commonJS((exports, module) => {
|
|
|
141670
141863
|
else
|
|
141671
141864
|
return basepath.substring(0, lastslash + 1) + refpath;
|
|
141672
141865
|
}
|
|
141673
|
-
function remove_dot_segments(
|
|
141674
|
-
if (!
|
|
141675
|
-
return
|
|
141866
|
+
function remove_dot_segments(path31) {
|
|
141867
|
+
if (!path31)
|
|
141868
|
+
return path31;
|
|
141676
141869
|
var output = "";
|
|
141677
|
-
while (
|
|
141678
|
-
if (
|
|
141679
|
-
|
|
141870
|
+
while (path31.length > 0) {
|
|
141871
|
+
if (path31 === "." || path31 === "..") {
|
|
141872
|
+
path31 = "";
|
|
141680
141873
|
break;
|
|
141681
141874
|
}
|
|
141682
|
-
var twochars =
|
|
141683
|
-
var threechars =
|
|
141684
|
-
var fourchars =
|
|
141875
|
+
var twochars = path31.substring(0, 2);
|
|
141876
|
+
var threechars = path31.substring(0, 3);
|
|
141877
|
+
var fourchars = path31.substring(0, 4);
|
|
141685
141878
|
if (threechars === "../") {
|
|
141686
|
-
|
|
141879
|
+
path31 = path31.substring(3);
|
|
141687
141880
|
} else if (twochars === "./") {
|
|
141688
|
-
|
|
141881
|
+
path31 = path31.substring(2);
|
|
141689
141882
|
} else if (threechars === "/./") {
|
|
141690
|
-
|
|
141691
|
-
} else if (twochars === "/." &&
|
|
141692
|
-
|
|
141693
|
-
} else if (fourchars === "/../" || threechars === "/.." &&
|
|
141694
|
-
|
|
141883
|
+
path31 = "/" + path31.substring(3);
|
|
141884
|
+
} else if (twochars === "/." && path31.length === 2) {
|
|
141885
|
+
path31 = "/";
|
|
141886
|
+
} else if (fourchars === "/../" || threechars === "/.." && path31.length === 3) {
|
|
141887
|
+
path31 = "/" + path31.substring(4);
|
|
141695
141888
|
output = output.replace(/\/?[^\/]*$/, "");
|
|
141696
141889
|
} else {
|
|
141697
|
-
var segment =
|
|
141890
|
+
var segment = path31.match(/(\/?([^\/]*))/)[0];
|
|
141698
141891
|
output += segment;
|
|
141699
|
-
|
|
141892
|
+
path31 = path31.substring(segment.length);
|
|
141700
141893
|
}
|
|
141701
141894
|
}
|
|
141702
141895
|
return output;
|
|
@@ -153766,21 +153959,21 @@ function jsonToKeyPathChunks(value, label = "$") {
|
|
|
153766
153959
|
walk(value, label, out);
|
|
153767
153960
|
return out;
|
|
153768
153961
|
}
|
|
153769
|
-
function walk(val,
|
|
153962
|
+
function walk(val, path31, out) {
|
|
153770
153963
|
if (val === null || val === undefined)
|
|
153771
153964
|
return;
|
|
153772
153965
|
if (Array.isArray(val)) {
|
|
153773
153966
|
if (val.length === 0) {
|
|
153774
|
-
out.push({ path:
|
|
153967
|
+
out.push({ path: path31, content: `**${path31}** = _[]_` });
|
|
153775
153968
|
return;
|
|
153776
153969
|
}
|
|
153777
153970
|
if (val.every((v) => v !== null && typeof v === "object")) {
|
|
153778
|
-
val.forEach((v, i) => walk(v, `${
|
|
153971
|
+
val.forEach((v, i) => walk(v, `${path31}[${i}]`, out));
|
|
153779
153972
|
return;
|
|
153780
153973
|
}
|
|
153781
153974
|
const items = val.map((v) => `- \`${String(v)}\``).join(`
|
|
153782
153975
|
`);
|
|
153783
|
-
out.push({ path:
|
|
153976
|
+
out.push({ path: path31, content: `**${path31}**
|
|
153784
153977
|
|
|
153785
153978
|
${items}` });
|
|
153786
153979
|
return;
|
|
@@ -153788,16 +153981,16 @@ ${items}` });
|
|
|
153788
153981
|
if (typeof val === "object") {
|
|
153789
153982
|
const entries = Object.entries(val);
|
|
153790
153983
|
if (entries.length === 0) {
|
|
153791
|
-
out.push({ path:
|
|
153984
|
+
out.push({ path: path31, content: `**${path31}** = _{}_` });
|
|
153792
153985
|
return;
|
|
153793
153986
|
}
|
|
153794
153987
|
for (const [k, v] of entries) {
|
|
153795
153988
|
const safeKey = /^[A-Za-z_$][\w$]*$/.test(k) ? k : JSON.stringify(k);
|
|
153796
|
-
walk(v, `${
|
|
153989
|
+
walk(v, `${path31}.${safeKey}`, out);
|
|
153797
153990
|
}
|
|
153798
153991
|
return;
|
|
153799
153992
|
}
|
|
153800
|
-
out.push({ path:
|
|
153993
|
+
out.push({ path: path31, content: `**${path31}** = \`${String(val)}\`` });
|
|
153801
153994
|
}
|
|
153802
153995
|
var gfm, STRIP_SELECTORS, tdCache = null;
|
|
153803
153996
|
var init_html_to_md = __esm(() => {
|
|
@@ -154222,8 +154415,8 @@ var init_recover_project = __esm(() => {
|
|
|
154222
154415
|
init_config();
|
|
154223
154416
|
init_dist();
|
|
154224
154417
|
init_inference_providers();
|
|
154225
|
-
import
|
|
154226
|
-
import
|
|
154418
|
+
import os9 from "os";
|
|
154419
|
+
import path31 from "path";
|
|
154227
154420
|
var WRITABLE_PROVIDERS = ["ollama", "lmstudio", "mistral", "openai", "google", "cohere"];
|
|
154228
154421
|
var GENERATOR_MARKER = "scripts/generate-subagent-artifacts.ts";
|
|
154229
154422
|
var GENERATOR_MARKER_MAX_LEVELS = 6;
|
|
@@ -154585,9 +154778,9 @@ Using defaults:`);
|
|
|
154585
154778
|
return 1;
|
|
154586
154779
|
}
|
|
154587
154780
|
const targetOpt = typeof options.target === "string" ? options.target : undefined;
|
|
154588
|
-
const targetHome = targetOpt === undefined ?
|
|
154589
|
-
if (targetHome !==
|
|
154590
|
-
console.error(`Error: --target ${targetHome} is not your home (${
|
|
154781
|
+
const targetHome = targetOpt === undefined ? os9.homedir() : path31.resolve(targetOpt);
|
|
154782
|
+
if (targetHome !== os9.homedir() && options.yes !== true) {
|
|
154783
|
+
console.error(`Error: --target ${targetHome} is not your home (${os9.homedir()}) \u2014 pass --yes to confirm writing there`);
|
|
154591
154784
|
return 1;
|
|
154592
154785
|
}
|
|
154593
154786
|
const dryRun = options["dry-run"] === true;
|
|
@@ -154605,7 +154798,7 @@ Using defaults:`);
|
|
|
154605
154798
|
const report = applyBootstrapState({
|
|
154606
154799
|
targetHome,
|
|
154607
154800
|
dryRun,
|
|
154608
|
-
sourcePath: repoRoot === null ? undefined :
|
|
154801
|
+
sourcePath: repoRoot === null ? undefined : path31.join(repoRoot, "skills", "AGENTS.md")
|
|
154609
154802
|
});
|
|
154610
154803
|
console.log(formatBootstrapReport(report));
|
|
154611
154804
|
return bootstrapReportSucceeded(report) ? 0 : 1;
|