@massa-ai/tools-api 1.25.0 → 1.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +952 -418
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -6998,10 +6998,460 @@ var init_utils = __esm(() => {
6998
6998
  init_rate_limiter();
6999
6999
  });
7000
7000
 
7001
+ // ../../packages/shared/dist/profile-switch/hosts.js
7002
+ import os3 from "os";
7003
+ import path6 from "path";
7004
+ function isHost(v) {
7005
+ return typeof v === "string" && HOSTS.includes(v);
7006
+ }
7007
+ function fileLayout(host, activeDir, activeGlob, variantsRoot) {
7008
+ return {
7009
+ host,
7010
+ route: "files",
7011
+ activeDir,
7012
+ activeGlob,
7013
+ variantsRoot,
7014
+ variantDir: (profile) => path6.join(variantsRoot, profile)
7015
+ };
7016
+ }
7017
+ function resolveHostLayout(host, opts = {}) {
7018
+ const targetHome = opts.targetHome ?? os3.homedir();
7019
+ const override = opts.projectRoot?.[host];
7020
+ switch (host) {
7021
+ case "cursor":
7022
+ return { host, route: "skip", reason: CURSOR_SKIP_REASON };
7023
+ case "claude": {
7024
+ const root = override ?? path6.join(targetHome, ".claude");
7025
+ return fileLayout(host, path6.join(root, "agents"), "massa-ai-*.md", path6.join(root, "massa-ai", "agent-profiles"));
7026
+ }
7027
+ case "codex": {
7028
+ const root = override ?? path6.join(targetHome, ".codex");
7029
+ return fileLayout(host, path6.join(root, "agents"), "massa-ai-*.toml", path6.join(root, "massa-ai", "agent-profiles"));
7030
+ }
7031
+ case "opencode": {
7032
+ const root = override ?? path6.join(targetHome, ".config", "opencode");
7033
+ const pluginsDir = path6.join(root, "plugins", "massa-ai");
7034
+ return fileLayout(host, path6.join(root, "agents"), "massa-ai-*.md", path6.join(pluginsDir, "agent-profiles"));
7035
+ }
7036
+ }
7037
+ }
7038
+ function detectRoute(platform) {
7039
+ const route = platform?.installRoute;
7040
+ if (route === "file")
7041
+ return { kind: "proceed" };
7042
+ if (route === "marketplace") {
7043
+ return {
7044
+ kind: "refuse",
7045
+ reason: "claude/codex marketplace-route installs are refused (in-place bundle rewrite would dirty a checkout " + "and break the drift gate) \u2014 use the dev path: MASSA_AI_MODEL_PROFILE + regenerate."
7046
+ };
7047
+ }
7048
+ return {
7049
+ kind: "refuse",
7050
+ reason: "no install route recorded \u2014 re-run the installer to record the install route"
7051
+ };
7052
+ }
7053
+ var HOSTS, CURSOR_SKIP_REASON = "all tiers inherit \u2014 Cursor publishes no resolvable model IDs";
7054
+ var init_hosts = __esm(() => {
7055
+ HOSTS = ["claude", "codex", "cursor", "opencode"];
7056
+ });
7057
+
7058
+ // ../../packages/shared/dist/profile-switch/state.js
7059
+ import fs3 from "fs";
7060
+ import path7 from "path";
7061
+ function namedError(name, message) {
7062
+ const err = new InstallStateError(message);
7063
+ err.name = name;
7064
+ return err;
7065
+ }
7066
+ function isPlainObject2(v) {
7067
+ return typeof v === "object" && v !== null && !Array.isArray(v);
7068
+ }
7069
+ function validateShape(raw2, filePath) {
7070
+ if (!isPlainObject2(raw2)) {
7071
+ throw CorruptInstallStateError(filePath, "root is not a JSON object");
7072
+ }
7073
+ if (raw2.platforms !== undefined && !isPlainObject2(raw2.platforms)) {
7074
+ throw CorruptInstallStateError(filePath, '"platforms" is present but not an object');
7075
+ }
7076
+ const platforms = isPlainObject2(raw2.platforms) ? raw2.platforms : {};
7077
+ return {
7078
+ ...raw2,
7079
+ version: typeof raw2.version === "number" ? raw2.version : 2,
7080
+ platforms
7081
+ };
7082
+ }
7083
+ function readInstallState(filePath) {
7084
+ let text;
7085
+ try {
7086
+ text = fs3.readFileSync(filePath, "utf-8");
7087
+ } catch (err) {
7088
+ const code = err.code;
7089
+ if (code === "ENOENT")
7090
+ return DEFAULT_STATE();
7091
+ throw CorruptInstallStateError(filePath, `could not read file: ${err.message}`);
7092
+ }
7093
+ let raw2;
7094
+ try {
7095
+ raw2 = JSON.parse(text);
7096
+ } catch (err) {
7097
+ throw CorruptInstallStateError(filePath, `invalid JSON: ${err.message}`);
7098
+ }
7099
+ return validateShape(raw2, filePath);
7100
+ }
7101
+ function writeInstallState(filePath, state) {
7102
+ const validated = validateShape(state, filePath);
7103
+ const text = `${JSON.stringify(validated, null, 2)}
7104
+ `;
7105
+ try {
7106
+ fs3.mkdirSync(path7.dirname(filePath), { recursive: true });
7107
+ fs3.writeFileSync(filePath, text);
7108
+ } catch (err) {
7109
+ throw UnwritableInstallStateError(filePath, err.message);
7110
+ }
7111
+ }
7112
+ function updatePlatform(filePath, host, patch) {
7113
+ const state = readInstallState(filePath);
7114
+ const existing = isPlainObject2(state.platforms[host]) ? state.platforms[host] : { root: "", skills: [], skillsOwner: "plugin" };
7115
+ const merged = { ...existing, ...patch };
7116
+ const next = {
7117
+ ...state,
7118
+ platforms: { ...state.platforms, [host]: merged }
7119
+ };
7120
+ writeInstallState(filePath, next);
7121
+ return next;
7122
+ }
7123
+ var InstallStateError, CorruptInstallStateError = (filePath, cause) => namedError("CorruptInstallStateError", `install-state.json at ${filePath} is corrupt: ${cause}`), UnwritableInstallStateError = (filePath, cause) => namedError("UnwritableInstallStateError", `could not write install-state.json at ${filePath}: ${cause}`), DEFAULT_STATE = () => ({ version: 2, platforms: {} });
7124
+ var init_state = __esm(() => {
7125
+ InstallStateError = class InstallStateError extends Error {
7126
+ constructor(message) {
7127
+ super(message);
7128
+ this.name = "InstallStateError";
7129
+ }
7130
+ };
7131
+ });
7132
+
7133
+ // ../../packages/shared/dist/profile-switch/lock.js
7134
+ import fs4 from "fs";
7135
+ import path8 from "path";
7136
+ import os4 from "os";
7137
+ import crypto4 from "crypto";
7138
+ import { execFileSync } from "child_process";
7139
+ function namedError2(name, message) {
7140
+ const err = new LockError(message);
7141
+ err.name = name;
7142
+ return err;
7143
+ }
7144
+ function readOwner(ownerPath) {
7145
+ let raw2;
7146
+ try {
7147
+ raw2 = JSON.parse(fs4.readFileSync(ownerPath, "utf-8"));
7148
+ } catch {
7149
+ return null;
7150
+ }
7151
+ if (typeof raw2 !== "object" || raw2 === null)
7152
+ return null;
7153
+ const r2 = raw2;
7154
+ if (typeof r2.host === "string" && typeof r2.pid === "number" && typeof r2.processStart === "string" && typeof r2.token === "string" && typeof r2.timestamp === "number") {
7155
+ return r2;
7156
+ }
7157
+ return null;
7158
+ }
7159
+ function releaseIfOwned(lockDir, ownerPath, token) {
7160
+ const owner = readOwner(ownerPath);
7161
+ if (owner === null || owner.token !== token)
7162
+ return;
7163
+ fs4.rmSync(lockDir, { recursive: true, force: true });
7164
+ }
7165
+ function acquireLock(stateFilePath, options = {}) {
7166
+ const lockDir = `${stateFilePath}.switch.lock`;
7167
+ const ownerPath = path8.join(lockDir, "owner.json");
7168
+ const clock = options.clock ?? DEFAULT_CLOCK;
7169
+ const identity = options.identity ?? DEFAULT_IDENTITY;
7170
+ const staleAfterMs = options.staleAfterMs ?? DEFAULT_STALE_AFTER_MS;
7171
+ const createFresh = () => {
7172
+ fs4.mkdirSync(lockDir);
7173
+ const pid = identity.pid();
7174
+ const startedAt = identity.processStart(pid);
7175
+ if (startedAt == null) {
7176
+ fs4.rmSync(lockDir, { recursive: true, force: true });
7177
+ throw LockAcquireError(lockDir, "could not determine this process's start-time identity");
7178
+ }
7179
+ const token = crypto4.randomUUID();
7180
+ const record = {
7181
+ host: identity.hostname(),
7182
+ pid,
7183
+ processStart: startedAt,
7184
+ token,
7185
+ timestamp: clock.now()
7186
+ };
7187
+ fs4.mkdirSync(path8.dirname(ownerPath), { recursive: true });
7188
+ fs4.writeFileSync(ownerPath, JSON.stringify(record));
7189
+ return { lockDir, release: () => releaseIfOwned(lockDir, ownerPath, token) };
7190
+ };
7191
+ try {
7192
+ return createFresh();
7193
+ } catch (err) {
7194
+ if (err.code !== "EEXIST")
7195
+ throw err;
7196
+ }
7197
+ const owner = readOwner(ownerPath);
7198
+ const provenDead = owner !== null && clock.now() - owner.timestamp >= staleAfterMs && identity.processStart(owner.pid) !== owner.processStart;
7199
+ if (!provenDead)
7200
+ throw LockHeldError(lockDir);
7201
+ const reclaimDir = `${lockDir}.reclaim.${owner.token}`;
7202
+ try {
7203
+ fs4.renameSync(lockDir, reclaimDir);
7204
+ } catch {
7205
+ throw LockHeldError(lockDir);
7206
+ }
7207
+ fs4.rmSync(reclaimDir, { recursive: true, force: true });
7208
+ try {
7209
+ return createFresh();
7210
+ } catch {
7211
+ throw LockHeldError(lockDir);
7212
+ }
7213
+ }
7214
+ var LockError, LockHeldError = (lockDir) => namedError2("LockHeldError", `another switch is running (lock held at ${lockDir})`), LockAcquireError = (lockDir, cause) => namedError2("LockAcquireError", `could not acquire switch lock at ${lockDir}: ${cause}`), DEFAULT_STALE_AFTER_MS, DEFAULT_CLOCK, DEFAULT_IDENTITY;
7215
+ var init_lock = __esm(() => {
7216
+ LockError = class LockError extends Error {
7217
+ constructor(message) {
7218
+ super(message);
7219
+ this.name = "LockError";
7220
+ }
7221
+ };
7222
+ DEFAULT_STALE_AFTER_MS = 5 * 60 * 1000;
7223
+ DEFAULT_CLOCK = { now: () => Date.now() };
7224
+ DEFAULT_IDENTITY = {
7225
+ pid: () => process.pid,
7226
+ hostname: () => os4.hostname(),
7227
+ processStart: (pid) => {
7228
+ try {
7229
+ const out = execFileSync("ps", ["-p", String(pid), "-o", "lstart="], {
7230
+ encoding: "utf-8"
7231
+ }).trim();
7232
+ return out.length > 0 ? out : null;
7233
+ } catch {
7234
+ return null;
7235
+ }
7236
+ }
7237
+ };
7238
+ });
7239
+
7240
+ // ../../packages/shared/dist/profile-switch/engine.js
7241
+ import fs5 from "fs";
7242
+ import path9 from "path";
7243
+ import os5 from "os";
7244
+ import crypto5 from "crypto";
7245
+ function namedError3(name, message) {
7246
+ const err = new SwitchEngineError(message);
7247
+ err.name = name;
7248
+ return err;
7249
+ }
7250
+ function defaultStatePath(targetHome) {
7251
+ return path9.join(targetHome, ".config", "massa-ai", "install-state.json");
7252
+ }
7253
+ function resolveCommon(opts) {
7254
+ const targetHome = opts.targetHome ?? os5.homedir();
7255
+ const stateFilePath = opts.stateFilePath ?? defaultStatePath(targetHome);
7256
+ return { targetHome, stateFilePath };
7257
+ }
7258
+ function listProfiles(opts = {}) {
7259
+ const { targetHome, stateFilePath } = resolveCommon(opts);
7260
+ const state = readInstallState(stateFilePath);
7261
+ const universe = opts.hosts ?? HOSTS;
7262
+ const hosts = universe.map((host) => {
7263
+ const layout = resolveHostLayout(host, { targetHome, projectRoot: opts.projectRoot });
7264
+ if (layout.route === "skip") {
7265
+ return {
7266
+ host,
7267
+ installed: false,
7268
+ skipped: true,
7269
+ skipReason: layout.reason,
7270
+ activeProfile: null,
7271
+ bundleVersion: null,
7272
+ availableProfiles: []
7273
+ };
7274
+ }
7275
+ const installed = fs5.existsSync(layout.activeDir);
7276
+ const availableProfiles = listVariantProfiles(layout);
7277
+ const platform = state.platforms[host];
7278
+ return {
7279
+ host,
7280
+ installed,
7281
+ skipped: false,
7282
+ skipReason: null,
7283
+ activeProfile: platform?.modelProfile?.profile ?? "balanced",
7284
+ bundleVersion: platform?.plugin?.version ?? null,
7285
+ availableProfiles
7286
+ };
7287
+ });
7288
+ return { hosts };
7289
+ }
7290
+ function listVariantProfiles(layout) {
7291
+ if (!fs5.existsSync(layout.variantsRoot))
7292
+ return [];
7293
+ return fs5.readdirSync(layout.variantsRoot, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name).sort();
7294
+ }
7295
+ function matchesGlob(filename, glob) {
7296
+ const starIdx = glob.indexOf("*");
7297
+ if (starIdx === -1)
7298
+ return filename === glob;
7299
+ const prefix = glob.slice(0, starIdx);
7300
+ const suffix = glob.slice(starIdx + 1);
7301
+ return filename.length >= prefix.length + suffix.length && filename.startsWith(prefix) && filename.endsWith(suffix);
7302
+ }
7303
+ function assertStateWritable(stateFilePath) {
7304
+ const dir = path9.dirname(stateFilePath);
7305
+ try {
7306
+ fs5.mkdirSync(dir, { recursive: true });
7307
+ } catch (err) {
7308
+ throw UnwritableInstallStateError(stateFilePath, err.message);
7309
+ }
7310
+ const checkPath = fs5.existsSync(stateFilePath) ? stateFilePath : dir;
7311
+ try {
7312
+ fs5.accessSync(checkPath, fs5.constants.W_OK);
7313
+ } catch (err) {
7314
+ throw UnwritableInstallStateError(stateFilePath, err.message);
7315
+ }
7316
+ }
7317
+ function copyFileRouteVariant(layout, variantDir) {
7318
+ fs5.mkdirSync(layout.activeDir, { recursive: true });
7319
+ let changed = 0;
7320
+ for (const entry of fs5.readdirSync(variantDir, { withFileTypes: true })) {
7321
+ if (!entry.isFile() || !matchesGlob(entry.name, layout.activeGlob))
7322
+ continue;
7323
+ fs5.copyFileSync(path9.join(variantDir, entry.name), path9.join(layout.activeDir, entry.name));
7324
+ changed++;
7325
+ }
7326
+ return changed;
7327
+ }
7328
+ function repointOpencodeVariant(layout, variantDir) {
7329
+ fs5.mkdirSync(layout.activeDir, { recursive: true });
7330
+ let changed = 0;
7331
+ for (const entry of fs5.readdirSync(variantDir, { withFileTypes: true })) {
7332
+ if (!entry.isFile() || !matchesGlob(entry.name, layout.activeGlob))
7333
+ continue;
7334
+ const dest = path9.join(layout.activeDir, entry.name);
7335
+ const target = path9.resolve(path9.join(variantDir, entry.name));
7336
+ let destExists = true;
7337
+ let destIsSymlink = false;
7338
+ try {
7339
+ destIsSymlink = fs5.lstatSync(dest).isSymbolicLink();
7340
+ } catch {
7341
+ destExists = false;
7342
+ }
7343
+ if (destExists && !destIsSymlink)
7344
+ continue;
7345
+ const tmp = `${dest}.massa-ai-switch.${crypto5.randomUUID()}`;
7346
+ fs5.symlinkSync(target, tmp);
7347
+ fs5.renameSync(tmp, dest);
7348
+ changed++;
7349
+ }
7350
+ return changed;
7351
+ }
7352
+ function copyVariant(host, layout, variantDir) {
7353
+ return host === "opencode" ? repointOpencodeVariant(layout, variantDir) : copyFileRouteVariant(layout, variantDir);
7354
+ }
7355
+ function switchProfile(opts) {
7356
+ const { targetHome, stateFilePath } = resolveCommon(opts);
7357
+ const dryRun = opts.dryRun ?? false;
7358
+ const requested = opts.host ? [opts.host] : opts.hosts ?? HOSTS;
7359
+ const universe = HOSTS.filter((h) => requested.includes(h));
7360
+ const state = readInstallState(stateFilePath);
7361
+ if (!dryRun)
7362
+ assertStateWritable(stateFilePath);
7363
+ const layouts = universe.map((host) => ({ host, layout: resolveHostLayout(host, { targetHome, projectRoot: opts.projectRoot }) }));
7364
+ const skipRows = layouts.filter((l2) => l2.layout.route === "skip").map((l2) => ({ host: l2.host, status: "skipped", reason: l2.layout.reason }));
7365
+ const fileHosts = layouts.filter((l2) => l2.layout.route === "files");
7366
+ if (fileHosts.length === 0) {
7367
+ return { profile: opts.profile, dryRun, hosts: orderRows(universe, skipRows), restartRequired: false };
7368
+ }
7369
+ const installedFileHosts = fileHosts.filter((h) => fs5.existsSync(h.layout.activeDir));
7370
+ if (installedFileHosts.length === 0)
7371
+ throw NoHostsDetectedError();
7372
+ const withAvailability = fileHosts.map((h) => {
7373
+ const variantsRootExists = fs5.existsSync(h.layout.variantsRoot);
7374
+ const variantDir = h.layout.variantDir(opts.profile);
7375
+ const available = variantsRootExists && fs5.existsSync(variantDir) && fs5.statSync(variantDir).isDirectory();
7376
+ return { ...h, variantsRootExists, variantDir, available };
7377
+ });
7378
+ if (!withAvailability.some((h) => h.available)) {
7379
+ const known = new Set;
7380
+ for (const h of withAvailability) {
7381
+ if (!h.variantsRootExists)
7382
+ continue;
7383
+ for (const name of listVariantProfiles(h.layout))
7384
+ known.add(name);
7385
+ }
7386
+ throw UnknownProfileError(opts.profile, [...known].sort());
7387
+ }
7388
+ const lock = dryRun ? null : acquireLock(stateFilePath, opts.lock);
7389
+ try {
7390
+ const rows = [...skipRows];
7391
+ for (const h of withAvailability) {
7392
+ if (!h.variantsRootExists) {
7393
+ rows.push({ host: h.host, status: "unsupported", reason: "bundle has no variants \u2014 upgrade plugin" });
7394
+ continue;
7395
+ }
7396
+ if (!h.available) {
7397
+ const supported = listVariantProfiles(h.layout);
7398
+ rows.push({
7399
+ host: h.host,
7400
+ status: "unsupported",
7401
+ reason: `profile "${opts.profile}" not supported on ${h.host} (supports: ${supported.join(", ") || "none"})`
7402
+ });
7403
+ continue;
7404
+ }
7405
+ const route = detectRoute(state.platforms[h.host]);
7406
+ if (route.kind === "refuse") {
7407
+ rows.push({ host: h.host, status: "failed", reason: route.reason });
7408
+ continue;
7409
+ }
7410
+ if (dryRun) {
7411
+ rows.push({ host: h.host, status: "switched" });
7412
+ continue;
7413
+ }
7414
+ try {
7415
+ const filesChanged = copyVariant(h.host, h.layout, h.variantDir);
7416
+ updatePlatform(stateFilePath, h.host, {
7417
+ modelProfile: { profile: opts.profile, switchedAt: new Date().toISOString() }
7418
+ });
7419
+ rows.push({ host: h.host, status: "switched", filesChanged });
7420
+ } catch (err) {
7421
+ rows.push({ host: h.host, status: "failed", reason: err.message });
7422
+ }
7423
+ }
7424
+ const ordered = orderRows(universe, rows);
7425
+ const restartRequired = !dryRun && ordered.some((r2) => r2.status === "switched");
7426
+ return { profile: opts.profile, dryRun, hosts: ordered, restartRequired };
7427
+ } finally {
7428
+ lock?.release();
7429
+ }
7430
+ }
7431
+ function orderRows(universe, rows) {
7432
+ const byHost = new Map(rows.map((r2) => [r2.host, r2]));
7433
+ return HOSTS.filter((h) => universe.includes(h) && byHost.has(h)).map((h) => byHost.get(h));
7434
+ }
7435
+ var SwitchEngineError, UnknownProfileError = (profile, known) => namedError3("UnknownProfileError", `unknown profile "${profile}" \u2014 installed: ${known.length > 0 ? known.join(", ") : "none"}`), NoHostsDetectedError = () => namedError3("NoHostsDetectedError", "no installed hosts found");
7436
+ var init_engine = __esm(() => {
7437
+ init_hosts();
7438
+ init_state();
7439
+ init_lock();
7440
+ SwitchEngineError = class SwitchEngineError extends Error {
7441
+ constructor(message) {
7442
+ super(message);
7443
+ this.name = "SwitchEngineError";
7444
+ }
7445
+ };
7446
+ });
7001
7447
  // ../../packages/shared/dist/index.js
7002
7448
  var init_dist = __esm(() => {
7003
7449
  init_env();
7004
7450
  init_config();
7451
+ init_hosts();
7452
+ init_state();
7453
+ init_lock();
7454
+ init_engine();
7005
7455
  init_types();
7006
7456
  init_interfaces();
7007
7457
  init_utils();
@@ -8523,7 +8973,7 @@ var import_brace_expansion, minimatch = (p, pattern, options = {}) => {
8523
8973
  }, qmarksTestNoExtDot = ([$0]) => {
8524
8974
  const len = $0.length;
8525
8975
  return (f) => f.length === len && f !== "." && f !== "..";
8526
- }, defaultPlatform, path6, sep, GLOBSTAR, qmark2 = "[^/]", star2, twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?", filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options), ext = (a12, b = {}) => Object.assign({}, a12, b), defaults = (def) => {
8976
+ }, defaultPlatform, path10, sep, GLOBSTAR, qmark2 = "[^/]", star2, twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?", filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options), ext = (a12, b = {}) => Object.assign({}, a12, b), defaults = (def) => {
8527
8977
  if (!def || typeof def !== "object" || !Object.keys(def).length) {
8528
8978
  return minimatch;
8529
8979
  }
@@ -8581,11 +9031,11 @@ var init_esm = __esm(() => {
8581
9031
  starRE = /^\*+$/;
8582
9032
  qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
8583
9033
  defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
8584
- path6 = {
9034
+ path10 = {
8585
9035
  win32: { sep: "\\" },
8586
9036
  posix: { sep: "/" }
8587
9037
  };
8588
- sep = defaultPlatform === "win32" ? path6.win32.sep : path6.posix.sep;
9038
+ sep = defaultPlatform === "win32" ? path10.win32.sep : path10.posix.sep;
8589
9039
  minimatch.sep = sep;
8590
9040
  GLOBSTAR = Symbol("globstar **");
8591
9041
  minimatch.GLOBSTAR = GLOBSTAR;
@@ -10551,12 +11001,12 @@ var init_esm4 = __esm(() => {
10551
11001
  childrenCache() {
10552
11002
  return this.#children;
10553
11003
  }
10554
- resolve(path7) {
10555
- if (!path7) {
11004
+ resolve(path11) {
11005
+ if (!path11) {
10556
11006
  return this;
10557
11007
  }
10558
- const rootPath = this.getRootString(path7);
10559
- const dir = path7.substring(rootPath.length);
11008
+ const rootPath = this.getRootString(path11);
11009
+ const dir = path11.substring(rootPath.length);
10560
11010
  const dirParts = dir.split(this.splitSep);
10561
11011
  const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
10562
11012
  return result;
@@ -11084,8 +11534,8 @@ var init_esm4 = __esm(() => {
11084
11534
  newChild(name, type = UNKNOWN, opts = {}) {
11085
11535
  return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
11086
11536
  }
11087
- getRootString(path7) {
11088
- return win32.parse(path7).root;
11537
+ getRootString(path11) {
11538
+ return win32.parse(path11).root;
11089
11539
  }
11090
11540
  getRoot(rootPath) {
11091
11541
  rootPath = uncToDrive(rootPath.toUpperCase());
@@ -11110,8 +11560,8 @@ var init_esm4 = __esm(() => {
11110
11560
  constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
11111
11561
  super(name, type, root, roots, nocase, children, opts);
11112
11562
  }
11113
- getRootString(path7) {
11114
- return path7.startsWith("/") ? "/" : "";
11563
+ getRootString(path11) {
11564
+ return path11.startsWith("/") ? "/" : "";
11115
11565
  }
11116
11566
  getRoot(_rootPath) {
11117
11567
  return this.root;
@@ -11130,8 +11580,8 @@ var init_esm4 = __esm(() => {
11130
11580
  #children;
11131
11581
  nocase;
11132
11582
  #fs;
11133
- constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs3 = defaultFS } = {}) {
11134
- this.#fs = fsFromOption(fs3);
11583
+ constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs6 = defaultFS } = {}) {
11584
+ this.#fs = fsFromOption(fs6);
11135
11585
  if (cwd instanceof URL || cwd.startsWith("file://")) {
11136
11586
  cwd = fileURLToPath(cwd);
11137
11587
  }
@@ -11167,11 +11617,11 @@ var init_esm4 = __esm(() => {
11167
11617
  }
11168
11618
  this.cwd = prev;
11169
11619
  }
11170
- depth(path7 = this.cwd) {
11171
- if (typeof path7 === "string") {
11172
- path7 = this.cwd.resolve(path7);
11620
+ depth(path11 = this.cwd) {
11621
+ if (typeof path11 === "string") {
11622
+ path11 = this.cwd.resolve(path11);
11173
11623
  }
11174
- return path7.depth();
11624
+ return path11.depth();
11175
11625
  }
11176
11626
  childrenCache() {
11177
11627
  return this.#children;
@@ -11587,9 +12037,9 @@ var init_esm4 = __esm(() => {
11587
12037
  process2();
11588
12038
  return results;
11589
12039
  }
11590
- chdir(path7 = this.cwd) {
12040
+ chdir(path11 = this.cwd) {
11591
12041
  const oldCwd = this.cwd;
11592
- this.cwd = typeof path7 === "string" ? this.cwd.resolve(path7) : path7;
12042
+ this.cwd = typeof path11 === "string" ? this.cwd.resolve(path11) : path11;
11593
12043
  this.cwd[setAsCwd](oldCwd);
11594
12044
  }
11595
12045
  };
@@ -11606,8 +12056,8 @@ var init_esm4 = __esm(() => {
11606
12056
  parseRootPath(dir) {
11607
12057
  return win32.parse(dir).root.toUpperCase();
11608
12058
  }
11609
- newRoot(fs3) {
11610
- return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs3 });
12059
+ newRoot(fs6) {
12060
+ return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs6 });
11611
12061
  }
11612
12062
  isAbsolute(p) {
11613
12063
  return p.startsWith("/") || p.startsWith("\\") || /^[a-z]:(\/|\\)/i.test(p);
@@ -11623,8 +12073,8 @@ var init_esm4 = __esm(() => {
11623
12073
  parseRootPath(_dir) {
11624
12074
  return "/";
11625
12075
  }
11626
- newRoot(fs3) {
11627
- return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs3 });
12076
+ newRoot(fs6) {
12077
+ return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs6 });
11628
12078
  }
11629
12079
  isAbsolute(p) {
11630
12080
  return p.startsWith("/");
@@ -11881,8 +12331,8 @@ class MatchRecord {
11881
12331
  this.store.set(target, current === undefined ? n2 : n2 & current);
11882
12332
  }
11883
12333
  entries() {
11884
- return [...this.store.entries()].map(([path7, n2]) => [
11885
- path7,
12334
+ return [...this.store.entries()].map(([path11, n2]) => [
12335
+ path11,
11886
12336
  !!(n2 & 2),
11887
12337
  !!(n2 & 1)
11888
12338
  ]);
@@ -12086,9 +12536,9 @@ class GlobUtil {
12086
12536
  signal;
12087
12537
  maxDepth;
12088
12538
  includeChildMatches;
12089
- constructor(patterns, path7, opts) {
12539
+ constructor(patterns, path11, opts) {
12090
12540
  this.patterns = patterns;
12091
- this.path = path7;
12541
+ this.path = path11;
12092
12542
  this.opts = opts;
12093
12543
  this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
12094
12544
  this.includeChildMatches = opts.includeChildMatches !== false;
@@ -12107,11 +12557,11 @@ class GlobUtil {
12107
12557
  });
12108
12558
  }
12109
12559
  }
12110
- #ignored(path7) {
12111
- return this.seen.has(path7) || !!this.#ignore?.ignored?.(path7);
12560
+ #ignored(path11) {
12561
+ return this.seen.has(path11) || !!this.#ignore?.ignored?.(path11);
12112
12562
  }
12113
- #childrenIgnored(path7) {
12114
- return !!this.#ignore?.childrenIgnored?.(path7);
12563
+ #childrenIgnored(path11) {
12564
+ return !!this.#ignore?.childrenIgnored?.(path11);
12115
12565
  }
12116
12566
  pause() {
12117
12567
  this.paused = true;
@@ -12328,8 +12778,8 @@ var init_walker = __esm(() => {
12328
12778
  init_processor();
12329
12779
  GlobWalker = class GlobWalker extends GlobUtil {
12330
12780
  matches = new Set;
12331
- constructor(patterns, path7, opts) {
12332
- super(patterns, path7, opts);
12781
+ constructor(patterns, path11, opts) {
12782
+ super(patterns, path11, opts);
12333
12783
  }
12334
12784
  matchEmit(e) {
12335
12785
  this.matches.add(e);
@@ -12366,8 +12816,8 @@ var init_walker = __esm(() => {
12366
12816
  };
12367
12817
  GlobStream = class GlobStream extends GlobUtil {
12368
12818
  results;
12369
- constructor(patterns, path7, opts) {
12370
- super(patterns, path7, opts);
12819
+ constructor(patterns, path11, opts) {
12820
+ super(patterns, path11, opts);
12371
12821
  this.results = new Minipass({
12372
12822
  signal: this.signal,
12373
12823
  objectMode: true
@@ -12795,20 +13245,20 @@ var require_ignore = __commonJS((exports, module) => {
12795
13245
  var throwError = (message, Ctor) => {
12796
13246
  throw new Ctor(message);
12797
13247
  };
12798
- var checkPath = (path7, originalPath, doThrow) => {
12799
- if (!isString(path7)) {
13248
+ var checkPath = (path11, originalPath, doThrow) => {
13249
+ if (!isString(path11)) {
12800
13250
  return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError);
12801
13251
  }
12802
- if (!path7) {
13252
+ if (!path11) {
12803
13253
  return doThrow(`path must not be empty`, TypeError);
12804
13254
  }
12805
- if (checkPath.isNotRelative(path7)) {
13255
+ if (checkPath.isNotRelative(path11)) {
12806
13256
  const r2 = "`path.relative()`d";
12807
13257
  return doThrow(`path should be a ${r2} string, but got "${originalPath}"`, RangeError);
12808
13258
  }
12809
13259
  return true;
12810
13260
  };
12811
- var isNotRelative = (path7) => REGEX_TEST_INVALID_PATH.test(path7);
13261
+ var isNotRelative = (path11) => REGEX_TEST_INVALID_PATH.test(path11);
12812
13262
  checkPath.isNotRelative = isNotRelative;
12813
13263
  checkPath.convert = (p) => p;
12814
13264
 
@@ -12851,7 +13301,7 @@ var require_ignore = __commonJS((exports, module) => {
12851
13301
  addPattern(pattern) {
12852
13302
  return this.add(pattern);
12853
13303
  }
12854
- _testOne(path7, checkUnignored) {
13304
+ _testOne(path11, checkUnignored) {
12855
13305
  let ignored = false;
12856
13306
  let unignored = false;
12857
13307
  this._rules.forEach((rule) => {
@@ -12859,7 +13309,7 @@ var require_ignore = __commonJS((exports, module) => {
12859
13309
  if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
12860
13310
  return;
12861
13311
  }
12862
- const matched = rule.regex.test(path7);
13312
+ const matched = rule.regex.test(path11);
12863
13313
  if (matched) {
12864
13314
  ignored = !negative;
12865
13315
  unignored = negative;
@@ -12871,39 +13321,39 @@ var require_ignore = __commonJS((exports, module) => {
12871
13321
  };
12872
13322
  }
12873
13323
  _test(originalPath, cache, checkUnignored, slices) {
12874
- const path7 = originalPath && checkPath.convert(originalPath);
12875
- checkPath(path7, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
12876
- return this._t(path7, cache, checkUnignored, slices);
13324
+ const path11 = originalPath && checkPath.convert(originalPath);
13325
+ checkPath(path11, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
13326
+ return this._t(path11, cache, checkUnignored, slices);
12877
13327
  }
12878
- _t(path7, cache, checkUnignored, slices) {
12879
- if (path7 in cache) {
12880
- return cache[path7];
13328
+ _t(path11, cache, checkUnignored, slices) {
13329
+ if (path11 in cache) {
13330
+ return cache[path11];
12881
13331
  }
12882
13332
  if (!slices) {
12883
- slices = path7.split(SLASH);
13333
+ slices = path11.split(SLASH);
12884
13334
  }
12885
13335
  slices.pop();
12886
13336
  if (!slices.length) {
12887
- return cache[path7] = this._testOne(path7, checkUnignored);
13337
+ return cache[path11] = this._testOne(path11, checkUnignored);
12888
13338
  }
12889
13339
  const parent = this._t(slices.join(SLASH) + SLASH, cache, checkUnignored, slices);
12890
- return cache[path7] = parent.ignored ? parent : this._testOne(path7, checkUnignored);
13340
+ return cache[path11] = parent.ignored ? parent : this._testOne(path11, checkUnignored);
12891
13341
  }
12892
- ignores(path7) {
12893
- return this._test(path7, this._ignoreCache, false).ignored;
13342
+ ignores(path11) {
13343
+ return this._test(path11, this._ignoreCache, false).ignored;
12894
13344
  }
12895
13345
  createFilter() {
12896
- return (path7) => !this.ignores(path7);
13346
+ return (path11) => !this.ignores(path11);
12897
13347
  }
12898
13348
  filter(paths) {
12899
13349
  return makeArray(paths).filter(this.createFilter());
12900
13350
  }
12901
- test(path7) {
12902
- return this._test(path7, this._testCache, true);
13351
+ test(path11) {
13352
+ return this._test(path11, this._testCache, true);
12903
13353
  }
12904
13354
  }
12905
13355
  var factory = (options) => new Ignore2(options);
12906
- var isPathValid = (path7) => checkPath(path7 && checkPath.convert(path7), path7, RETURN_FALSE);
13356
+ var isPathValid = (path11) => checkPath(path11 && checkPath.convert(path11), path11, RETURN_FALSE);
12907
13357
  factory.isPathValid = isPathValid;
12908
13358
  factory.default = factory;
12909
13359
  module.exports = factory;
@@ -12911,7 +13361,7 @@ var require_ignore = __commonJS((exports, module) => {
12911
13361
  const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
12912
13362
  checkPath.convert = makePosix;
12913
13363
  const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
12914
- checkPath.isNotRelative = (path7) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path7) || isNotRelative(path7);
13364
+ checkPath.isNotRelative = (path11) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path11) || isNotRelative(path11);
12915
13365
  }
12916
13366
  });
12917
13367
 
@@ -12973,18 +13423,18 @@ function validatePolicy(policy, opts = {}) {
12973
13423
  }
12974
13424
  }
12975
13425
  }
12976
- function matchesGlob(path7, pattern) {
13426
+ function matchesGlob2(path11, pattern) {
12977
13427
  let re = regexCache.get(pattern);
12978
13428
  if (!re) {
12979
13429
  re = globToRegex(pattern);
12980
13430
  regexCache.set(pattern, re);
12981
13431
  }
12982
- return re.test(path7);
13432
+ return re.test(path11);
12983
13433
  }
12984
13434
  var MAX_MATCH_WORK = 1e5, MAX_IGNORE_PATTERNS2 = 1024, DEFAULT_POLICY, applyPolicy = (filePath, policy) => {
12985
13435
  const normalized = filePath.trim();
12986
13436
  for (const rule of policy.rules) {
12987
- if (matchesGlob(normalized, rule.pattern))
13437
+ if (matchesGlob2(normalized, rule.pattern))
12988
13438
  return rule.disposition;
12989
13439
  }
12990
13440
  return "Keep";
@@ -13030,8 +13480,8 @@ var init_capture_policy = __esm(() => {
13030
13480
  });
13031
13481
 
13032
13482
  // ../../packages/core/dist/services/search/ignore-patterns.js
13033
- import fs3 from "fs/promises";
13034
- import path7 from "path";
13483
+ import fs6 from "fs/promises";
13484
+ import path11 from "path";
13035
13485
  function buildExtensionGlob(extensions2) {
13036
13486
  return extensions2.map((ext2) => `**/*${ext2}`);
13037
13487
  }
@@ -13054,8 +13504,8 @@ async function loadProjectIgnore(projectPath) {
13054
13504
  const ig = ignore();
13055
13505
  ig.add(DEFAULT_IGNORES);
13056
13506
  try {
13057
- const gitignorePath = path7.join(projectPath, ".gitignore");
13058
- const gitignoreContent = await fs3.readFile(gitignorePath, "utf8");
13507
+ const gitignorePath = path11.join(projectPath, ".gitignore");
13508
+ const gitignoreContent = await fs6.readFile(gitignorePath, "utf8");
13059
13509
  const rules = gitignoreContent.split(`
13060
13510
  `).map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
13061
13511
  ig.add(rules);
@@ -13224,8 +13674,8 @@ var init_alias_resolver = __esm(() => {
13224
13674
  });
13225
13675
 
13226
13676
  // ../../packages/core/dist/services/search/index-manager.js
13227
- import fs4 from "fs";
13228
- import path8 from "path";
13677
+ import fs7 from "fs";
13678
+ import path12 from "path";
13229
13679
 
13230
13680
  class IndexManager {
13231
13681
  metadataCache = new Map;
@@ -13318,9 +13768,9 @@ class IndexManager {
13318
13768
  const fileMetadata = {};
13319
13769
  let totalSize = 0;
13320
13770
  for (const filePath of indexedFiles) {
13321
- const fullPath = path8.join(projectPath, filePath);
13771
+ const fullPath = path12.join(projectPath, filePath);
13322
13772
  try {
13323
- const stat2 = await fs4.promises.stat(fullPath);
13773
+ const stat2 = await fs7.promises.stat(fullPath);
13324
13774
  fileMetadata[filePath] = {
13325
13775
  path: filePath,
13326
13776
  mtime: stat2.mtimeMs,
@@ -13371,9 +13821,9 @@ class IndexManager {
13371
13821
  if (ig.ignores(match2)) {
13372
13822
  continue;
13373
13823
  }
13374
- const fullPath = path8.join(projectPath, match2);
13824
+ const fullPath = path12.join(projectPath, match2);
13375
13825
  try {
13376
- const stat2 = await fs4.promises.stat(fullPath);
13826
+ const stat2 = await fs7.promises.stat(fullPath);
13377
13827
  files.set(match2, {
13378
13828
  path: match2,
13379
13829
  mtime: stat2.mtimeMs,
@@ -13692,7 +14142,7 @@ __export(exports_util, {
13692
14142
  jsonStringifyReplacer: () => jsonStringifyReplacer,
13693
14143
  joinValues: () => joinValues,
13694
14144
  issue: () => issue,
13695
- isPlainObject: () => isPlainObject2,
14145
+ isPlainObject: () => isPlainObject3,
13696
14146
  isObject: () => isObject2,
13697
14147
  hexToUint8Array: () => hexToUint8Array,
13698
14148
  getSizableOrigin: () => getSizableOrigin,
@@ -13824,10 +14274,10 @@ function mergeDefs(...defs) {
13824
14274
  function cloneDef(schema) {
13825
14275
  return mergeDefs(schema._zod.def);
13826
14276
  }
13827
- function getElementAtPath(obj, path9) {
13828
- if (!path9)
14277
+ function getElementAtPath(obj, path13) {
14278
+ if (!path13)
13829
14279
  return obj;
13830
- return path9.reduce((acc, key) => acc?.[key], obj);
14280
+ return path13.reduce((acc, key) => acc?.[key], obj);
13831
14281
  }
13832
14282
  function promiseAllObject(promisesObj) {
13833
14283
  const keys = Object.keys(promisesObj);
@@ -13857,7 +14307,7 @@ function slugify(input) {
13857
14307
  function isObject2(data) {
13858
14308
  return typeof data === "object" && data !== null && !Array.isArray(data);
13859
14309
  }
13860
- function isPlainObject2(o) {
14310
+ function isPlainObject3(o) {
13861
14311
  if (isObject2(o) === false)
13862
14312
  return false;
13863
14313
  const ctor = o.constructor;
@@ -13874,7 +14324,7 @@ function isPlainObject2(o) {
13874
14324
  return true;
13875
14325
  }
13876
14326
  function shallowClone(o) {
13877
- if (isPlainObject2(o))
14327
+ if (isPlainObject3(o))
13878
14328
  return { ...o };
13879
14329
  if (Array.isArray(o))
13880
14330
  return [...o];
@@ -14014,7 +14464,7 @@ function omit(schema, mask) {
14014
14464
  return clone2(schema, def);
14015
14465
  }
14016
14466
  function extend(schema, shape) {
14017
- if (!isPlainObject2(shape)) {
14467
+ if (!isPlainObject3(shape)) {
14018
14468
  throw new Error("Invalid input to extend: expected a plain object");
14019
14469
  }
14020
14470
  const checks = schema._zod.def.checks;
@@ -14037,7 +14487,7 @@ function extend(schema, shape) {
14037
14487
  return clone2(schema, def);
14038
14488
  }
14039
14489
  function safeExtend(schema, shape) {
14040
- if (!isPlainObject2(shape)) {
14490
+ if (!isPlainObject3(shape)) {
14041
14491
  throw new Error("Invalid input to safeExtend: expected a plain object");
14042
14492
  }
14043
14493
  const def = mergeDefs(schema._zod.def, {
@@ -14155,11 +14605,11 @@ function explicitlyAborted(x, startIndex = 0) {
14155
14605
  }
14156
14606
  return false;
14157
14607
  }
14158
- function prefixIssues(path9, issues) {
14608
+ function prefixIssues(path13, issues) {
14159
14609
  return issues.map((iss) => {
14160
14610
  var _a4;
14161
14611
  (_a4 = iss).path ?? (_a4.path = []);
14162
- iss.path.unshift(path9);
14612
+ iss.path.unshift(path13);
14163
14613
  return iss;
14164
14614
  });
14165
14615
  }
@@ -14372,16 +14822,16 @@ function flattenError(error, mapper = (issue2) => issue2.message) {
14372
14822
  }
14373
14823
  function formatError(error, mapper = (issue2) => issue2.message) {
14374
14824
  const fieldErrors = { _errors: [] };
14375
- const processError = (error2, path9 = []) => {
14825
+ const processError = (error2, path13 = []) => {
14376
14826
  for (const issue2 of error2.issues) {
14377
14827
  if (issue2.code === "invalid_union" && issue2.errors.length) {
14378
- issue2.errors.map((issues) => processError({ issues }, [...path9, ...issue2.path]));
14828
+ issue2.errors.map((issues) => processError({ issues }, [...path13, ...issue2.path]));
14379
14829
  } else if (issue2.code === "invalid_key") {
14380
- processError({ issues: issue2.issues }, [...path9, ...issue2.path]);
14830
+ processError({ issues: issue2.issues }, [...path13, ...issue2.path]);
14381
14831
  } else if (issue2.code === "invalid_element") {
14382
- processError({ issues: issue2.issues }, [...path9, ...issue2.path]);
14832
+ processError({ issues: issue2.issues }, [...path13, ...issue2.path]);
14383
14833
  } else {
14384
- const fullpath = [...path9, ...issue2.path];
14834
+ const fullpath = [...path13, ...issue2.path];
14385
14835
  if (fullpath.length === 0) {
14386
14836
  fieldErrors._errors.push(mapper(issue2));
14387
14837
  } else {
@@ -14408,17 +14858,17 @@ function formatError(error, mapper = (issue2) => issue2.message) {
14408
14858
  }
14409
14859
  function treeifyError(error, mapper = (issue2) => issue2.message) {
14410
14860
  const result = { errors: [] };
14411
- const processError = (error2, path9 = []) => {
14861
+ const processError = (error2, path13 = []) => {
14412
14862
  var _a4, _b;
14413
14863
  for (const issue2 of error2.issues) {
14414
14864
  if (issue2.code === "invalid_union" && issue2.errors.length) {
14415
- issue2.errors.map((issues) => processError({ issues }, [...path9, ...issue2.path]));
14865
+ issue2.errors.map((issues) => processError({ issues }, [...path13, ...issue2.path]));
14416
14866
  } else if (issue2.code === "invalid_key") {
14417
- processError({ issues: issue2.issues }, [...path9, ...issue2.path]);
14867
+ processError({ issues: issue2.issues }, [...path13, ...issue2.path]);
14418
14868
  } else if (issue2.code === "invalid_element") {
14419
- processError({ issues: issue2.issues }, [...path9, ...issue2.path]);
14869
+ processError({ issues: issue2.issues }, [...path13, ...issue2.path]);
14420
14870
  } else {
14421
- const fullpath = [...path9, ...issue2.path];
14871
+ const fullpath = [...path13, ...issue2.path];
14422
14872
  if (fullpath.length === 0) {
14423
14873
  result.errors.push(mapper(issue2));
14424
14874
  continue;
@@ -14450,8 +14900,8 @@ function treeifyError(error, mapper = (issue2) => issue2.message) {
14450
14900
  }
14451
14901
  function toDotPath(_path) {
14452
14902
  const segs = [];
14453
- const path9 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
14454
- for (const seg of path9) {
14903
+ const path13 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
14904
+ for (const seg of path13) {
14455
14905
  if (typeof seg === "number")
14456
14906
  segs.push(`[${seg}]`);
14457
14907
  else if (typeof seg === "symbol")
@@ -15520,7 +15970,7 @@ function mergeValues2(a12, b) {
15520
15970
  if (a12 instanceof Date && b instanceof Date && +a12 === +b) {
15521
15971
  return { valid: true, data: a12 };
15522
15972
  }
15523
- if (isPlainObject2(a12) && isPlainObject2(b)) {
15973
+ if (isPlainObject3(a12) && isPlainObject3(b)) {
15524
15974
  const bKeys = Object.keys(b);
15525
15975
  const sharedKeys = Object.keys(a12).filter((key) => bKeys.indexOf(key) !== -1);
15526
15976
  const newObj = { ...a12, ...b };
@@ -16777,7 +17227,7 @@ var init_schemas = __esm(() => {
16777
17227
  $ZodType.init(inst, def);
16778
17228
  inst._zod.parse = (payload, ctx) => {
16779
17229
  const input = payload.value;
16780
- if (!isPlainObject2(input)) {
17230
+ if (!isPlainObject3(input)) {
16781
17231
  payload.issues.push({
16782
17232
  expected: "record",
16783
17233
  code: "invalid_type",
@@ -27454,13 +27904,13 @@ function resolveRef(ref, ctx) {
27454
27904
  if (!ref.startsWith("#")) {
27455
27905
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
27456
27906
  }
27457
- const path9 = ref.slice(1).split("/").filter(Boolean);
27458
- if (path9.length === 0) {
27907
+ const path13 = ref.slice(1).split("/").filter(Boolean);
27908
+ if (path13.length === 0) {
27459
27909
  return ctx.rootSchema;
27460
27910
  }
27461
27911
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
27462
- if (path9[0] === defsKey) {
27463
- const key = path9[1];
27912
+ if (path13[0] === defsKey) {
27913
+ const key = path13[1];
27464
27914
  if (!key || !ctx.defs[key]) {
27465
27915
  throw new Error(`Reference not found: ${ref}`);
27466
27916
  }
@@ -28949,8 +29399,8 @@ class ParseStatus2 {
28949
29399
  }
28950
29400
  }
28951
29401
  var makeIssue2 = (params) => {
28952
- const { data, path: path9, errorMaps, issueData } = params;
28953
- const fullPath = [...path9, ...issueData.path || []];
29402
+ const { data, path: path13, errorMaps, issueData } = params;
29403
+ const fullPath = [...path13, ...issueData.path || []];
28954
29404
  const fullIssue = {
28955
29405
  ...issueData,
28956
29406
  path: fullPath
@@ -28995,11 +29445,11 @@ var init_errorUtil = __esm(() => {
28995
29445
 
28996
29446
  // ../../node_modules/zod/v3/types.js
28997
29447
  class ParseInputLazyPath2 {
28998
- constructor(parent, value, path9, key) {
29448
+ constructor(parent, value, path13, key) {
28999
29449
  this._cachedPath = [];
29000
29450
  this.parent = parent;
29001
29451
  this.data = value;
29002
- this._path = path9;
29452
+ this._path = path13;
29003
29453
  this._key = key;
29004
29454
  }
29005
29455
  get path() {
@@ -35064,23 +35514,23 @@ var require_auth_config = __commonJS((exports, module) => {
35064
35514
  writeAuthConfig: () => writeAuthConfig
35065
35515
  });
35066
35516
  module.exports = __toCommonJS2(auth_config_exports);
35067
- var fs5 = __toESM2(__require("fs"));
35068
- var path9 = __toESM2(__require("path"));
35517
+ var fs8 = __toESM2(__require("fs"));
35518
+ var path13 = __toESM2(__require("path"));
35069
35519
  var import_token_util = require_token_util();
35070
35520
  function getAuthConfigPath() {
35071
35521
  const dataDir = (0, import_token_util.getVercelDataDir)();
35072
35522
  if (!dataDir) {
35073
35523
  throw new Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`);
35074
35524
  }
35075
- return path9.join(dataDir, "auth.json");
35525
+ return path13.join(dataDir, "auth.json");
35076
35526
  }
35077
35527
  function readAuthConfig() {
35078
35528
  try {
35079
35529
  const authPath = getAuthConfigPath();
35080
- if (!fs5.existsSync(authPath)) {
35530
+ if (!fs8.existsSync(authPath)) {
35081
35531
  return null;
35082
35532
  }
35083
- const content = fs5.readFileSync(authPath, "utf8");
35533
+ const content = fs8.readFileSync(authPath, "utf8");
35084
35534
  if (!content) {
35085
35535
  return null;
35086
35536
  }
@@ -35091,11 +35541,11 @@ var require_auth_config = __commonJS((exports, module) => {
35091
35541
  }
35092
35542
  function writeAuthConfig(config3) {
35093
35543
  const authPath = getAuthConfigPath();
35094
- const authDir = path9.dirname(authPath);
35095
- if (!fs5.existsSync(authDir)) {
35096
- fs5.mkdirSync(authDir, { mode: 504, recursive: true });
35544
+ const authDir = path13.dirname(authPath);
35545
+ if (!fs8.existsSync(authDir)) {
35546
+ fs8.mkdirSync(authDir, { mode: 504, recursive: true });
35097
35547
  }
35098
- fs5.writeFileSync(authPath, JSON.stringify(config3, null, 2), { mode: 384 });
35548
+ fs8.writeFileSync(authPath, JSON.stringify(config3, null, 2), { mode: 384 });
35099
35549
  }
35100
35550
  function isValidAccessToken(authConfig, expirationBufferMs = 0) {
35101
35551
  if (!authConfig.token)
@@ -35270,8 +35720,8 @@ var require_token_util = __commonJS((exports, module) => {
35270
35720
  saveToken: () => saveToken
35271
35721
  });
35272
35722
  module.exports = __toCommonJS2(token_util_exports);
35273
- var path9 = __toESM2(__require("path"));
35274
- var fs5 = __toESM2(__require("fs"));
35723
+ var path13 = __toESM2(__require("path"));
35724
+ var fs8 = __toESM2(__require("fs"));
35275
35725
  var import_token_error = require_token_error();
35276
35726
  var import_token_io = require_token_io();
35277
35727
  var import_auth_config = require_auth_config();
@@ -35283,7 +35733,7 @@ var require_token_util = __commonJS((exports, module) => {
35283
35733
  if (!dataDir) {
35284
35734
  return null;
35285
35735
  }
35286
- return path9.join(dataDir, vercelFolder);
35736
+ return path13.join(dataDir, vercelFolder);
35287
35737
  }
35288
35738
  async function getVercelToken2(options) {
35289
35739
  const authConfig = (0, import_auth_config.readAuthConfig)();
@@ -35351,11 +35801,11 @@ var require_token_util = __commonJS((exports, module) => {
35351
35801
  if (!dir) {
35352
35802
  throw new import_token_error.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`");
35353
35803
  }
35354
- const prjPath = path9.join(dir, ".vercel", "project.json");
35355
- if (!fs5.existsSync(prjPath)) {
35804
+ const prjPath = path13.join(dir, ".vercel", "project.json");
35805
+ if (!fs8.existsSync(prjPath)) {
35356
35806
  throw new import_token_error.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`");
35357
35807
  }
35358
- const prj = JSON.parse(fs5.readFileSync(prjPath, "utf8"));
35808
+ const prj = JSON.parse(fs8.readFileSync(prjPath, "utf8"));
35359
35809
  if (typeof prj.projectId !== "string" && typeof prj.orgId !== "string") {
35360
35810
  throw new TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project.");
35361
35811
  }
@@ -35366,11 +35816,11 @@ var require_token_util = __commonJS((exports, module) => {
35366
35816
  if (!dir) {
35367
35817
  throw new import_token_error.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");
35368
35818
  }
35369
- const tokenPath = path9.join(dir, "com.vercel.token", `${projectId}.json`);
35819
+ const tokenPath = path13.join(dir, "com.vercel.token", `${projectId}.json`);
35370
35820
  const tokenJson = JSON.stringify(token);
35371
- fs5.mkdirSync(path9.dirname(tokenPath), { mode: 504, recursive: true });
35372
- fs5.writeFileSync(tokenPath, tokenJson);
35373
- fs5.chmodSync(tokenPath, 432);
35821
+ fs8.mkdirSync(path13.dirname(tokenPath), { mode: 504, recursive: true });
35822
+ fs8.writeFileSync(tokenPath, tokenJson);
35823
+ fs8.chmodSync(tokenPath, 432);
35374
35824
  return;
35375
35825
  }
35376
35826
  function loadToken(projectId) {
@@ -35378,11 +35828,11 @@ var require_token_util = __commonJS((exports, module) => {
35378
35828
  if (!dir) {
35379
35829
  throw new import_token_error.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");
35380
35830
  }
35381
- const tokenPath = path9.join(dir, "com.vercel.token", `${projectId}.json`);
35382
- if (!fs5.existsSync(tokenPath)) {
35831
+ const tokenPath = path13.join(dir, "com.vercel.token", `${projectId}.json`);
35832
+ if (!fs8.existsSync(tokenPath)) {
35383
35833
  return null;
35384
35834
  }
35385
- const token = JSON.parse(fs5.readFileSync(tokenPath, "utf8"));
35835
+ const token = JSON.parse(fs8.readFileSync(tokenPath, "utf8"));
35386
35836
  assertVercelOidcTokenResponse(token);
35387
35837
  return token;
35388
35838
  }
@@ -46224,37 +46674,37 @@ function createOpenAI(options = {}) {
46224
46674
  }, `ai-sdk/openai/${VERSION4}`);
46225
46675
  const createChatModel = (modelId) => new OpenAIChatLanguageModel(modelId, {
46226
46676
  provider: `${providerName}.chat`,
46227
- url: ({ path: path9 }) => `${baseURL}${path9}`,
46677
+ url: ({ path: path13 }) => `${baseURL}${path13}`,
46228
46678
  headers: getHeaders,
46229
46679
  fetch: options.fetch
46230
46680
  });
46231
46681
  const createCompletionModel = (modelId) => new OpenAICompletionLanguageModel(modelId, {
46232
46682
  provider: `${providerName}.completion`,
46233
- url: ({ path: path9 }) => `${baseURL}${path9}`,
46683
+ url: ({ path: path13 }) => `${baseURL}${path13}`,
46234
46684
  headers: getHeaders,
46235
46685
  fetch: options.fetch
46236
46686
  });
46237
46687
  const createEmbeddingModel = (modelId) => new OpenAIEmbeddingModel(modelId, {
46238
46688
  provider: `${providerName}.embedding`,
46239
- url: ({ path: path9 }) => `${baseURL}${path9}`,
46689
+ url: ({ path: path13 }) => `${baseURL}${path13}`,
46240
46690
  headers: getHeaders,
46241
46691
  fetch: options.fetch
46242
46692
  });
46243
46693
  const createImageModel = (modelId) => new OpenAIImageModel(modelId, {
46244
46694
  provider: `${providerName}.image`,
46245
- url: ({ path: path9 }) => `${baseURL}${path9}`,
46695
+ url: ({ path: path13 }) => `${baseURL}${path13}`,
46246
46696
  headers: getHeaders,
46247
46697
  fetch: options.fetch
46248
46698
  });
46249
46699
  const createTranscriptionModel = (modelId) => new OpenAITranscriptionModel(modelId, {
46250
46700
  provider: `${providerName}.transcription`,
46251
- url: ({ path: path9 }) => `${baseURL}${path9}`,
46701
+ url: ({ path: path13 }) => `${baseURL}${path13}`,
46252
46702
  headers: getHeaders,
46253
46703
  fetch: options.fetch
46254
46704
  });
46255
46705
  const createSpeechModel = (modelId) => new OpenAISpeechModel(modelId, {
46256
46706
  provider: `${providerName}.speech`,
46257
- url: ({ path: path9 }) => `${baseURL}${path9}`,
46707
+ url: ({ path: path13 }) => `${baseURL}${path13}`,
46258
46708
  headers: getHeaders,
46259
46709
  fetch: options.fetch
46260
46710
  });
@@ -46267,7 +46717,7 @@ function createOpenAI(options = {}) {
46267
46717
  const createResponsesModel = (modelId) => {
46268
46718
  return new OpenAIResponsesLanguageModel(modelId, {
46269
46719
  provider: `${providerName}.responses`,
46270
- url: ({ path: path9 }) => `${baseURL}${path9}`,
46720
+ url: ({ path: path13 }) => `${baseURL}${path13}`,
46271
46721
  headers: getHeaders,
46272
46722
  fetch: options.fetch,
46273
46723
  fileIdPrefixes: ["file-"]
@@ -62800,26 +63250,26 @@ var require_process = __commonJS((exports, module) => {
62800
63250
 
62801
63251
  // ../../node_modules/detect-libc/lib/filesystem.js
62802
63252
  var require_filesystem = __commonJS((exports, module) => {
62803
- var fs5 = __require("fs");
63253
+ var fs8 = __require("fs");
62804
63254
  var LDD_PATH = "/usr/bin/ldd";
62805
63255
  var SELF_PATH = "/proc/self/exe";
62806
63256
  var MAX_LENGTH = 2048;
62807
- var readFileSync2 = (path9) => {
62808
- const fd = fs5.openSync(path9, "r");
63257
+ var readFileSync2 = (path13) => {
63258
+ const fd = fs8.openSync(path13, "r");
62809
63259
  const buffer = Buffer.alloc(MAX_LENGTH);
62810
- const bytesRead = fs5.readSync(fd, buffer, 0, MAX_LENGTH, 0);
62811
- fs5.close(fd, () => {});
63260
+ const bytesRead = fs8.readSync(fd, buffer, 0, MAX_LENGTH, 0);
63261
+ fs8.close(fd, () => {});
62812
63262
  return buffer.subarray(0, bytesRead);
62813
63263
  };
62814
- var readFile = (path9) => new Promise((resolve4, reject) => {
62815
- fs5.open(path9, "r", (err, fd) => {
63264
+ var readFile = (path13) => new Promise((resolve4, reject) => {
63265
+ fs8.open(path13, "r", (err, fd) => {
62816
63266
  if (err) {
62817
63267
  reject(err);
62818
63268
  } else {
62819
63269
  const buffer = Buffer.alloc(MAX_LENGTH);
62820
- fs5.read(fd, buffer, 0, MAX_LENGTH, 0, (_2, bytesRead) => {
63270
+ fs8.read(fd, buffer, 0, MAX_LENGTH, 0, (_2, bytesRead) => {
62821
63271
  resolve4(buffer.subarray(0, bytesRead));
62822
- fs5.close(fd, () => {});
63272
+ fs8.close(fd, () => {});
62823
63273
  });
62824
63274
  }
62825
63275
  });
@@ -62924,11 +63374,11 @@ var require_detect_libc = __commonJS((exports, module) => {
62924
63374
  }
62925
63375
  return null;
62926
63376
  };
62927
- var familyFromInterpreterPath = (path9) => {
62928
- if (path9) {
62929
- if (path9.includes("/ld-musl-")) {
63377
+ var familyFromInterpreterPath = (path13) => {
63378
+ if (path13) {
63379
+ if (path13.includes("/ld-musl-")) {
62930
63380
  return MUSL;
62931
- } else if (path9.includes("/ld-linux-")) {
63381
+ } else if (path13.includes("/ld-linux-")) {
62932
63382
  return GLIBC;
62933
63383
  }
62934
63384
  }
@@ -62973,8 +63423,8 @@ var require_detect_libc = __commonJS((exports, module) => {
62973
63423
  cachedFamilyInterpreter = null;
62974
63424
  try {
62975
63425
  const selfContent = await readFile(SELF_PATH);
62976
- const path9 = interpreterPath(selfContent);
62977
- cachedFamilyInterpreter = familyFromInterpreterPath(path9);
63426
+ const path13 = interpreterPath(selfContent);
63427
+ cachedFamilyInterpreter = familyFromInterpreterPath(path13);
62978
63428
  } catch (e) {}
62979
63429
  return cachedFamilyInterpreter;
62980
63430
  };
@@ -62985,8 +63435,8 @@ var require_detect_libc = __commonJS((exports, module) => {
62985
63435
  cachedFamilyInterpreter = null;
62986
63436
  try {
62987
63437
  const selfContent = readFileSync2(SELF_PATH);
62988
- const path9 = interpreterPath(selfContent);
62989
- cachedFamilyInterpreter = familyFromInterpreterPath(path9);
63438
+ const path13 = interpreterPath(selfContent);
63439
+ cachedFamilyInterpreter = familyFromInterpreterPath(path13);
62990
63440
  } catch (e) {}
62991
63441
  return cachedFamilyInterpreter;
62992
63442
  };
@@ -64648,18 +65098,18 @@ var require_sharp = __commonJS((exports, module) => {
64648
65098
  `@img/sharp-${runtimePlatform}/sharp.node`,
64649
65099
  "@img/sharp-wasm32/sharp.node"
64650
65100
  ];
64651
- var path9;
65101
+ var path13;
64652
65102
  var sharp;
64653
65103
  var errors5 = [];
64654
- for (path9 of paths) {
65104
+ for (path13 of paths) {
64655
65105
  try {
64656
- sharp = __require(path9);
65106
+ sharp = __require(path13);
64657
65107
  break;
64658
65108
  } catch (err) {
64659
65109
  errors5.push(err);
64660
65110
  }
64661
65111
  }
64662
- if (sharp && path9.startsWith("@img/sharp-linux-x64") && !sharp._isUsingX64V2()) {
65112
+ if (sharp && path13.startsWith("@img/sharp-linux-x64") && !sharp._isUsingX64V2()) {
64663
65113
  const err = new Error("Prebuilt binaries for linux-x64 require v2 microarchitecture");
64664
65114
  err.code = "Unsupported CPU";
64665
65115
  errors5.push(err);
@@ -64668,7 +65118,7 @@ var require_sharp = __commonJS((exports, module) => {
64668
65118
  if (sharp) {
64669
65119
  module.exports = sharp;
64670
65120
  } else {
64671
- const [isLinux, isMacOs, isWindows] = ["linux", "darwin", "win32"].map((os3) => runtimePlatform.startsWith(os3));
65121
+ const [isLinux, isMacOs, isWindows] = ["linux", "darwin", "win32"].map((os6) => runtimePlatform.startsWith(os6));
64672
65122
  const help = [`Could not load the "sharp" module using the ${runtimePlatform} runtime`];
64673
65123
  errors5.forEach((err) => {
64674
65124
  if (err.code !== "MODULE_NOT_FOUND") {
@@ -64681,9 +65131,9 @@ var require_sharp = __commonJS((exports, module) => {
64681
65131
  const { found, expected } = isUnsupportedNodeRuntime();
64682
65132
  help.push("- Please upgrade Node.js:", ` Found ${found}`, ` Requires ${expected}`);
64683
65133
  } else if (prebuiltPlatforms.includes(runtimePlatform)) {
64684
- const [os3, cpu] = runtimePlatform.split("-");
64685
- const libc = os3.endsWith("musl") ? " --libc=musl" : "";
64686
- 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=${os3.replace("musl", "")}${libc} --cpu=${cpu} sharp`);
65134
+ const [os6, cpu] = runtimePlatform.split("-");
65135
+ const libc = os6.endsWith("musl") ? " --libc=musl" : "";
65136
+ 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=${os6.replace("musl", "")}${libc} --cpu=${cpu} sharp`);
64687
65137
  } else {
64688
65138
  help.push(`- Manually install libvips >= ${minimumLibvipsVersion}`, "- Add experimental WebAssembly-based dependencies:", " npm install --cpu=wasm32 sharp", " npm install @img/sharp-wasm32");
64689
65139
  }
@@ -67521,15 +67971,15 @@ var require_color = __commonJS((exports, module) => {
67521
67971
  };
67522
67972
  }
67523
67973
  function wrapConversion(toModel, graph) {
67524
- const path9 = [graph[toModel].parent, toModel];
67974
+ const path13 = [graph[toModel].parent, toModel];
67525
67975
  let fn = conversions_default[graph[toModel].parent][toModel];
67526
67976
  let cur = graph[toModel].parent;
67527
67977
  while (graph[cur].parent) {
67528
- path9.unshift(graph[cur].parent);
67978
+ path13.unshift(graph[cur].parent);
67529
67979
  fn = link(conversions_default[graph[cur].parent][cur], fn);
67530
67980
  cur = graph[cur].parent;
67531
67981
  }
67532
- fn.conversion = path9;
67982
+ fn.conversion = path13;
67533
67983
  return fn;
67534
67984
  }
67535
67985
  function route(fromModel) {
@@ -68134,7 +68584,7 @@ var require_output = __commonJS((exports, module) => {
68134
68584
  Copyright 2013 Lovell Fuller and others.
68135
68585
  SPDX-License-Identifier: Apache-2.0
68136
68586
  */
68137
- var path9 = __require("path");
68587
+ var path13 = __require("path");
68138
68588
  var is = require_is();
68139
68589
  var sharp = require_sharp();
68140
68590
  var formats = new Map([
@@ -68165,9 +68615,9 @@ var require_output = __commonJS((exports, module) => {
68165
68615
  let err;
68166
68616
  if (!is.string(fileOut)) {
68167
68617
  err = new Error("Missing output file path");
68168
- } else if (is.string(this.options.input.file) && path9.resolve(this.options.input.file) === path9.resolve(fileOut)) {
68618
+ } else if (is.string(this.options.input.file) && path13.resolve(this.options.input.file) === path13.resolve(fileOut)) {
68169
68619
  err = new Error("Cannot use same file for input and output");
68170
- } else if (jp2Regex.test(path9.extname(fileOut)) && !this.constructor.format.jp2k.output.file) {
68620
+ } else if (jp2Regex.test(path13.extname(fileOut)) && !this.constructor.format.jp2k.output.file) {
68171
68621
  err = errJp2Save();
68172
68622
  }
68173
68623
  if (err) {
@@ -75414,11 +75864,11 @@ var init_transformers_node = __esm(() => {
75414
75864
  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}).`);
75415
75865
  }
75416
75866
  for (let i = 0;i < num_chunks; ++i) {
75417
- const path9 = `${baseName}_data${i === 0 ? "" : "_" + i}`;
75418
- const fullPath = `${options.subfolder ?? ""}/${path9}`;
75867
+ const path13 = `${baseName}_data${i === 0 ? "" : "_" + i}`;
75868
+ const fullPath = `${options.subfolder ?? ""}/${path13}`;
75419
75869
  externalDataPromises.push(new Promise(async (resolve4, reject) => {
75420
75870
  const data = await (0, _utils_hub_js__WEBPACK_IMPORTED_MODULE_5__.getModelFile)(pretrained_model_name_or_path, fullPath, true, options, return_path);
75421
- resolve4(data instanceof Uint8Array ? { path: path9, data } : path9);
75871
+ resolve4(data instanceof Uint8Array ? { path: path13, data } : path13);
75422
75872
  }));
75423
75873
  }
75424
75874
  } else if (session_options.externalData !== undefined) {
@@ -88482,7 +88932,7 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
88482
88932
  const blob = new Blob([wav], { type: "audio/wav" });
88483
88933
  return blob;
88484
88934
  }
88485
- async save(path9) {
88935
+ async save(path13) {
88486
88936
  let fn;
88487
88937
  if (_env_js__WEBPACK_IMPORTED_MODULE_3__.apis.IS_BROWSER_ENV) {
88488
88938
  if (_env_js__WEBPACK_IMPORTED_MODULE_3__.apis.IS_WEBWORKER_ENV) {
@@ -88490,14 +88940,14 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
88490
88940
  }
88491
88941
  fn = _core_js__WEBPACK_IMPORTED_MODULE_2__.saveBlob;
88492
88942
  } else if (_env_js__WEBPACK_IMPORTED_MODULE_3__.apis.IS_FS_AVAILABLE) {
88493
- fn = async (path10, blob) => {
88943
+ fn = async (path14, blob) => {
88494
88944
  let buffer = await blob.arrayBuffer();
88495
- node_fs__WEBPACK_IMPORTED_MODULE_5__["default"].writeFileSync(path10, Buffer.from(buffer));
88945
+ node_fs__WEBPACK_IMPORTED_MODULE_5__["default"].writeFileSync(path14, Buffer.from(buffer));
88496
88946
  };
88497
88947
  } else {
88498
88948
  throw new Error("Unable to save because filesystem is disabled in this environment.");
88499
88949
  }
88500
- await fn(path9, this.toBlob());
88950
+ await fn(path13, this.toBlob());
88501
88951
  }
88502
88952
  }
88503
88953
  },
@@ -88593,11 +89043,11 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
88593
89043
  function calculateReflectOffset(i, w) {
88594
89044
  return Math.abs((i + w) % (2 * w) - w);
88595
89045
  }
88596
- function saveBlob(path9, blob) {
89046
+ function saveBlob(path13, blob) {
88597
89047
  const dataURL = URL.createObjectURL(blob);
88598
89048
  const downloadLink = document.createElement("a");
88599
89049
  downloadLink.href = dataURL;
88600
- downloadLink.download = path9;
89050
+ downloadLink.download = path13;
88601
89051
  downloadLink.click();
88602
89052
  downloadLink.remove();
88603
89053
  URL.revokeObjectURL(dataURL);
@@ -89198,8 +89648,8 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
89198
89648
  }
89199
89649
 
89200
89650
  class FileCache {
89201
- constructor(path9) {
89202
- this.path = path9;
89651
+ constructor(path13) {
89652
+ this.path = path13;
89203
89653
  }
89204
89654
  async match(request) {
89205
89655
  let filePath = node_path__WEBPACK_IMPORTED_MODULE_1__["default"].join(this.path, request);
@@ -89955,20 +90405,20 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
89955
90405
  }
89956
90406
  return this;
89957
90407
  }
89958
- async save(path9) {
90408
+ async save(path13) {
89959
90409
  if (IS_BROWSER_OR_WEBWORKER) {
89960
90410
  if (_env_js__WEBPACK_IMPORTED_MODULE_2__.apis.IS_WEBWORKER_ENV) {
89961
90411
  throw new Error("Unable to save an image from a Web Worker.");
89962
90412
  }
89963
- const extension = path9.split(".").pop().toLowerCase();
90413
+ const extension = path13.split(".").pop().toLowerCase();
89964
90414
  const mime2 = CONTENT_TYPE_MAP.get(extension) ?? "image/png";
89965
90415
  const blob = await this.toBlob(mime2);
89966
- (0, _core_js__WEBPACK_IMPORTED_MODULE_0__.saveBlob)(path9, blob);
90416
+ (0, _core_js__WEBPACK_IMPORTED_MODULE_0__.saveBlob)(path13, blob);
89967
90417
  } else if (!_env_js__WEBPACK_IMPORTED_MODULE_2__.apis.IS_FS_AVAILABLE) {
89968
90418
  throw new Error("Unable to save the image because filesystem is disabled in this environment.");
89969
90419
  } else {
89970
90420
  const img = this.toSharp();
89971
- return await img.toFile(path9);
90421
+ return await img.toFile(path13);
89972
90422
  }
89973
90423
  }
89974
90424
  toSharp() {
@@ -99173,7 +99623,7 @@ Note that ${s.bold("include")} statements only accept relation fields.`, a12;
99173
99623
  function ns(e = Yo, t2 = Yo) {
99174
99624
  return (r2) => e(t2(r2));
99175
99625
  }
99176
- function os3({ dataPath: e, modelName: t2, args: r2, runtimeDataModel: n2 }) {
99626
+ function os6({ dataPath: e, modelName: t2, args: r2, runtimeDataModel: n2 }) {
99177
99627
  let i = { modelName: t2, args: r2 ?? {} }, o = dp(e);
99178
99628
  if (!o || o.length === 0)
99179
99629
  return i;
@@ -99478,10 +99928,10 @@ Note that ${s.bold("include")} statements only accept relation fields.`, a12;
99478
99928
  super(t2, "P2023", r2);
99479
99929
  }
99480
99930
  };
99481
- var fs5 = new WeakMap;
99931
+ var fs8 = new WeakMap;
99482
99932
  function Ep(e) {
99483
- let t2 = fs5.get(e);
99484
- return t2 || (t2 = Object.entries(e), fs5.set(e, t2)), t2;
99933
+ let t2 = fs8.get(e);
99934
+ return t2 || (t2 = Object.entries(e), fs8.set(e, t2)), t2;
99485
99935
  }
99486
99936
  function hs(e, t2, r2) {
99487
99937
  switch (t2.type) {
@@ -103046,7 +103496,7 @@ new PrismaClient({
103046
103496
  let m2 = await es(this, d);
103047
103497
  if (!d.model)
103048
103498
  return m2;
103049
- let g = os3({ dataPath: d.dataPath, modelName: d.model, args: d.args, runtimeDataModel: this._runtimeDataModel });
103499
+ let g = os6({ dataPath: d.dataPath, modelName: d.model, args: d.args, runtimeDataModel: this._runtimeDataModel });
103050
103500
  return Wo({ result: m2, modelName: g.modelName, args: g.args, extensions: this._extensions, runtimeDataModel: this._runtimeDataModel, globalOmit: this._globalOmit });
103051
103501
  };
103052
103502
  return this._tracingHelper.runInChildSpan(s.operation, () => new zl.AsyncResource("prisma-client-request").runInAsyncScope(() => a12(o)));
@@ -103449,7 +103899,7 @@ var require_prisma = __commonJS((exports) => {
103449
103899
  Prisma.JsonNull = JsonNull2;
103450
103900
  Prisma.AnyNull = AnyNull2;
103451
103901
  Prisma.NullTypes = NullTypes2;
103452
- var path9 = __require("path");
103902
+ var path13 = __require("path");
103453
103903
  exports.Prisma.TransactionIsolationLevel = makeStrictEnum2({
103454
103904
  ReadUncommitted: "ReadUncommitted",
103455
103905
  ReadCommitted: "ReadCommitted",
@@ -108044,7 +108494,7 @@ var init_vector_store_factory = __esm(() => {
108044
108494
  });
108045
108495
 
108046
108496
  // ../../packages/core/dist/services/search/search-cache-pg.js
108047
- import crypto4 from "crypto";
108497
+ import crypto6 from "crypto";
108048
108498
 
108049
108499
  class SearchCachePg {
108050
108500
  pool = null;
@@ -108101,7 +108551,7 @@ class SearchCachePg {
108101
108551
  projectId,
108102
108552
  options: this.normalizeOptions(options)
108103
108553
  });
108104
- return crypto4.createHash("sha256").update(payload).digest("hex");
108554
+ return crypto6.createHash("sha256").update(payload).digest("hex");
108105
108555
  }
108106
108556
  normalizeOptions(options) {
108107
108557
  const searchAffectingParams = [
@@ -114830,10 +115280,10 @@ var init_chunker_code = __esm(() => {
114830
115280
  });
114831
115281
 
114832
115282
  // ../../packages/core/dist/services/search/smart-chunker.js
114833
- import path9 from "path";
115283
+ import path13 from "path";
114834
115284
  function smartChunk(content, filePath, config3 = {}) {
114835
115285
  const cfg = { ...DEFAULT_CONFIG, ...config3 };
114836
- const ext2 = path9.extname(filePath).toLowerCase();
115286
+ const ext2 = path13.extname(filePath).toLowerCase();
114837
115287
  const relativePath = filePath;
114838
115288
  const fileImports = isCodeFile(ext2) ? extractFileImports(content, ext2) : undefined;
114839
115289
  let chunks;
@@ -115140,8 +115590,8 @@ var init_managed_run_repository_pg = __esm(() => {
115140
115590
  });
115141
115591
 
115142
115592
  // ../../packages/core/dist/services/search/project-indexer.js
115143
- import fs5 from "fs/promises";
115144
- import path10 from "path";
115593
+ import fs8 from "fs/promises";
115594
+ import path14 from "path";
115145
115595
  import { randomUUID as randomUUID3 } from "crypto";
115146
115596
  async function runWithIndexLock(lockMap, projectId, work) {
115147
115597
  const prevLock = lockMap.get(projectId);
@@ -115184,7 +115634,7 @@ async function indexProjectInternal(deps, projectPath, projectId, options = {})
115184
115634
  dot: false
115185
115635
  });
115186
115636
  const filteredFiles = files.filter((file3) => {
115187
- const relativePath = path10.relative(projectPath, file3);
115637
+ const relativePath = path14.relative(projectPath, file3);
115188
115638
  const shouldIgnore = ig.ignores(relativePath);
115189
115639
  if (shouldIgnore) {
115190
115640
  logger.debug("Ignoring file per .gitignore during indexing", {
@@ -115224,7 +115674,7 @@ async function indexProjectInternal(deps, projectPath, projectId, options = {})
115224
115674
  });
115225
115675
  }
115226
115676
  }
115227
- const indexedFilesList = filteredFiles.map((f) => path10.relative(projectPath, f));
115677
+ const indexedFilesList = filteredFiles.map((f) => path14.relative(projectPath, f));
115228
115678
  await deps.indexManager.updateIndexMetadata(projectId, projectPath, indexedFilesList);
115229
115679
  logger.info("Project indexing completed", {
115230
115680
  projectId,
@@ -115349,7 +115799,7 @@ async function ensureFreshIndex(deps, projectId, projectPath, options = {}) {
115349
115799
  let errors5 = 0;
115350
115800
  for (const relativeFilePath of filesToReindex) {
115351
115801
  try {
115352
- const fullPath = path10.join(projectPath, relativeFilePath);
115802
+ const fullPath = path14.join(projectPath, relativeFilePath);
115353
115803
  const result = await deps.indexFile(fullPath, projectId, projectPath, centralityMap);
115354
115804
  filesIndexed++;
115355
115805
  chunksIndexed += result.chunks;
@@ -115400,8 +115850,8 @@ async function checkSearchAdmission(deps, projectId, projectPath) {
115400
115850
  }
115401
115851
  async function indexFile(deps, filePath, projectId, projectRoot, centralityMap) {
115402
115852
  projectId = await getProjectIdentityAliasResolver().resolve(projectId);
115403
- const content = await fs5.readFile(filePath, "utf-8");
115404
- const relativePath = path10.relative(projectRoot, filePath);
115853
+ const content = await fs8.readFile(filePath, "utf-8");
115854
+ const relativePath = path14.relative(projectRoot, filePath);
115405
115855
  const maxFileSize = config.get("security").maxFileSize || 1024 * 1024;
115406
115856
  if (content.length > maxFileSize) {
115407
115857
  logger.warn("File too large, skipping", {
@@ -115421,7 +115871,7 @@ async function indexFile(deps, filePath, projectId, projectRoot, centralityMap)
115421
115871
  chunkIndex: i,
115422
115872
  totalChunks: chunks.length,
115423
115873
  type: chunk.type,
115424
- language: path10.extname(filePath).slice(1),
115874
+ language: path14.extname(filePath).slice(1),
115425
115875
  lineStart: chunk.lineStart,
115426
115876
  lineEnd: chunk.lineEnd,
115427
115877
  label: chunk.label,
@@ -116260,8 +116710,8 @@ var init_index_job_tracker = __esm(() => {
116260
116710
  });
116261
116711
 
116262
116712
  // ../../packages/core/dist/services/etl/stages/discover.js
116263
- import fs6 from "fs/promises";
116264
- import path11 from "path";
116713
+ import fs9 from "fs/promises";
116714
+ import path15 from "path";
116265
116715
  import { createHash as createHash5 } from "crypto";
116266
116716
 
116267
116717
  class DiscoverStage {
@@ -116287,7 +116737,7 @@ class DiscoverStage {
116287
116737
  dot: false,
116288
116738
  absolute: false
116289
116739
  });
116290
- relPaths = found.map((p) => path11.isAbsolute(p) ? path11.relative(ctx.projectPath, p) : p).filter((p) => !ig.ignores(p) && applyPolicy(p, policy) !== "Drop");
116740
+ relPaths = found.map((p) => path15.isAbsolute(p) ? path15.relative(ctx.projectPath, p) : p).filter((p) => !ig.ignores(p) && applyPolicy(p, policy) !== "Drop");
116291
116741
  }
116292
116742
  if (ctx.resumeCursor?.path) {
116293
116743
  const cursorPath = ctx.resumeCursor.path;
@@ -116346,10 +116796,10 @@ class DiscoverStage {
116346
116796
  return discovered;
116347
116797
  }
116348
116798
  async processFile(ctx, relativePath, forceReindex) {
116349
- const absolutePath = path11.join(ctx.projectPath, relativePath);
116799
+ const absolutePath = path15.join(ctx.projectPath, relativePath);
116350
116800
  try {
116351
- const stat2 = await fs6.stat(absolutePath);
116352
- const content = await fs6.readFile(absolutePath, "utf-8");
116801
+ const stat2 = await fs9.stat(absolutePath);
116802
+ const content = await fs9.readFile(absolutePath, "utf-8");
116353
116803
  const contentHash = createHash5("sha256").update(content).digest("hex");
116354
116804
  let needsReparse = forceReindex;
116355
116805
  if (!forceReindex) {
@@ -116392,8 +116842,8 @@ class DiscoverStage {
116392
116842
  ig.add(pattern);
116393
116843
  }
116394
116844
  try {
116395
- const gitignorePath = path11.join(projectPath, ".gitignore");
116396
- const gitignoreContent = await fs6.readFile(gitignorePath, "utf8");
116845
+ const gitignorePath = path15.join(projectPath, ".gitignore");
116846
+ const gitignoreContent = await fs9.readFile(gitignorePath, "utf8");
116397
116847
  const rules = gitignoreContent.split(`
116398
116848
  `).map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
116399
116849
  ig.add(rules);
@@ -117748,8 +118198,8 @@ function rustUseLeaves(node2, source, prefix = []) {
117748
118198
  }
117749
118199
  if (node2.type === "use_wildcard")
117750
118200
  return [{ path: [...prefix, "*"], glob: true }];
117751
- const path12 = rustPathSegments(node2, source);
117752
- return path12.length ? [{ path: [...prefix, ...path12] }] : [];
118201
+ const path16 = rustPathSegments(node2, source);
118202
+ return path16.length ? [{ path: [...prefix, ...path16] }] : [];
117753
118203
  }
117754
118204
  function functionalCaptures(captures, source, family) {
117755
118205
  if (family !== "clojure")
@@ -118721,8 +119171,8 @@ var init_structural_runtime = __esm(() => {
118721
119171
  });
118722
119172
 
118723
119173
  // ../../packages/core/dist/services/etl/stages/parse.js
118724
- import path12 from "path";
118725
- import fs7 from "fs/promises";
119174
+ import path16 from "path";
119175
+ import fs10 from "fs/promises";
118726
119176
  function resolveChunkerMaxChars() {
118727
119177
  const global2 = Number(process.env.EMBEDDING_MAX_CHARS);
118728
119178
  if (Number.isFinite(global2) && global2 > 0)
@@ -118750,8 +119200,8 @@ class ParseStage {
118750
119200
  const results = new Map;
118751
119201
  let processed = 0;
118752
119202
  const phases = [
118753
- files.filter((file3) => path12.extname(file3.relativePath).toLowerCase() !== ".h"),
118754
- files.filter((file3) => path12.extname(file3.relativePath).toLowerCase() === ".h")
119203
+ files.filter((file3) => path16.extname(file3.relativePath).toLowerCase() !== ".h"),
119204
+ files.filter((file3) => path16.extname(file3.relativePath).toLowerCase() === ".h")
118755
119205
  ];
118756
119206
  const batches = phases.flatMap((phase) => Array.from({ length: Math.ceil(phase.length / BATCH_SIZE) }, (_2, index) => phase.slice(index * BATCH_SIZE, (index + 1) * BATCH_SIZE)));
118757
119207
  for (const batch of batches) {
@@ -118789,19 +119239,19 @@ class ParseStage {
118789
119239
  return files.map((file3) => results.get(file3.relativePath));
118790
119240
  }
118791
119241
  recordHeaderImporterEvidence(ctx, files, parsedFiles) {
118792
- const knownHeaders = new Set(files.filter((file3) => path12.extname(file3.relativePath).toLowerCase() === ".h").map((file3) => path12.posix.normalize(file3.relativePath)));
119242
+ const knownHeaders = new Set(files.filter((file3) => path16.extname(file3.relativePath).toLowerCase() === ".h").map((file3) => path16.posix.normalize(file3.relativePath)));
118793
119243
  const mutable = {
118794
119244
  ...ctx.structuralHeaderEvidenceByFile
118795
119245
  };
118796
119246
  for (const parsed of parsedFiles) {
118797
- const extension = path12.extname(parsed.file.relativePath).toLowerCase();
119247
+ const extension = path16.extname(parsed.file.relativePath).toLowerCase();
118798
119248
  const key = extension === ".c" ? "cImporters" : [".cpp", ".hpp"].includes(extension) ? "cppImporters" : undefined;
118799
119249
  if (!key)
118800
119250
  continue;
118801
119251
  for (const imported of parsed.rawImports) {
118802
119252
  if (!["c_include", "cpp_include"].includes(imported.form) || imported.specifier.startsWith("<"))
118803
119253
  continue;
118804
- const header = path12.posix.normalize(path12.posix.join(path12.posix.dirname(parsed.file.relativePath), imported.specifier));
119254
+ const header = path16.posix.normalize(path16.posix.join(path16.posix.dirname(parsed.file.relativePath), imported.specifier));
118805
119255
  if (!knownHeaders.has(header))
118806
119256
  continue;
118807
119257
  const existing = mutable[header] ?? {};
@@ -118812,9 +119262,9 @@ class ParseStage {
118812
119262
  }
118813
119263
  async parseFile(ctx, file3) {
118814
119264
  if (!file3.needsReparse) {
118815
- const extension = path12.extname(file3.relativePath).toLowerCase();
119265
+ const extension = path16.extname(file3.relativePath).toLowerCase();
118816
119266
  if ([".c", ".cpp", ".hpp"].includes(extension)) {
118817
- const content = file3.snapshotContent ?? await fs7.readFile(file3.absolutePath, "utf8");
119267
+ const content = file3.snapshotContent ?? await fs10.readFile(file3.absolutePath, "utf8");
118818
119268
  const outcome = await this.runtime.parse({ extension, source: Buffer.from(content) });
118819
119269
  if (outcome.status === "failed")
118820
119270
  throw new StructuralEtlParseError(file3.relativePath, outcome.failureKind, `Structural evidence parse failed (${outcome.failureKind})`, outcome.diagnosticCount, outcome.diagnostics.slice(0, 10));
@@ -118826,8 +119276,8 @@ class ParseStage {
118826
119276
  return { file: file3, chunks: [], symbols: [], rawImports: [], rawEdges: [] };
118827
119277
  }
118828
119278
  try {
118829
- const content = file3.snapshotContent ?? await fs7.readFile(file3.absolutePath, "utf-8");
118830
- const ext2 = path12.extname(file3.relativePath).toLowerCase();
119279
+ const content = file3.snapshotContent ?? await fs10.readFile(file3.absolutePath, "utf-8");
119280
+ const ext2 = path16.extname(file3.relativePath).toLowerCase();
118831
119281
  const chunkerMaxChars = resolveChunkerMaxChars();
118832
119282
  const chunks = smartChunk(content, file3.relativePath, chunkerMaxChars ? { maxChunkChars: chunkerMaxChars } : {});
118833
119283
  let symbols;
@@ -119381,7 +119831,7 @@ var init_resolver = __esm(() => {
119381
119831
  });
119382
119832
 
119383
119833
  // ../../packages/core/dist/services/structural/resolvers/typescript.js
119384
- import path13 from "path";
119834
+ import path17 from "path";
119385
119835
  function candidates(identities) {
119386
119836
  return Object.freeze(identities.map((identity) => Object.freeze({
119387
119837
  fqn: identity.fqn,
@@ -119476,7 +119926,7 @@ function probe(base, known, dialect = "typescript") {
119476
119926
  const bases = /\.[cm]?jsx?$/u.test(base) ? [base.replace(/\.[cm]?jsx?$/u, ".ts"), base.replace(/\.[cm]?jsx?$/u, ".tsx"), base] : [base];
119477
119927
  for (const candidateBase of bases)
119478
119928
  for (const suffix of DIALECT_PROBES[dialect] ?? [""]) {
119479
- const value = path13.posix.normalize(`${candidateBase}${suffix}`);
119929
+ const value = path17.posix.normalize(`${candidateBase}${suffix}`);
119480
119930
  if (!value.startsWith("../") && value !== ".." && known.has(value))
119481
119931
  return value;
119482
119932
  }
@@ -119485,7 +119935,7 @@ function probe(base, known, dialect = "typescript") {
119485
119935
  function resolveStructuralSpecifier(specifier, fromFile, build, dialect = "typescript") {
119486
119936
  const known = new Set(build.knownFiles.map(normalizeStructuralFile));
119487
119937
  if (specifier.startsWith("./") || specifier.startsWith("../")) {
119488
- return probe(path13.posix.join(path13.posix.dirname(fromFile), specifier), known, dialect);
119938
+ return probe(path17.posix.join(path17.posix.dirname(fromFile), specifier), known, dialect);
119489
119939
  }
119490
119940
  const aliases = build.pathAliasesByFile?.[normalizeStructuralFile(fromFile)] ?? build.pathAliases ?? [];
119491
119941
  for (const alias of aliases) {
@@ -119749,7 +120199,7 @@ var init_scripting2 = __esm(() => {
119749
120199
  });
119750
120200
 
119751
120201
  // ../../packages/core/dist/services/structural/resolvers/systems.js
119752
- import path14 from "path";
120202
+ import path18 from "path";
119753
120203
  var DIALECTS, SYSTEMS_LANGUAGE_RESOLVER;
119754
120204
  var init_systems2 = __esm(() => {
119755
120205
  init_typescript2();
@@ -119768,7 +120218,7 @@ var init_systems2 = __esm(() => {
119768
120218
  const bindings = item.bindings.map((binding) => binding.imported === "*" && binding.local === "*" && unresolvedTarget && !unresolvedTarget.qualifier ? { ...binding, imported: unresolvedTarget.name, local: unresolvedTarget.name } : binding);
119769
120219
  if (item.specifier === "crate" || item.specifier.startsWith("crate/")) {
119770
120220
  const crateRoot = file3.file.startsWith("src/") ? "src" : "";
119771
- return { ...item, bindings, specifier: `./${path14.posix.relative(path14.posix.dirname(file3.file), path14.posix.join(crateRoot, item.specifier.replace(/^crate\/?/u, "")))}` };
120221
+ return { ...item, bindings, specifier: `./${path18.posix.relative(path18.posix.dirname(file3.file), path18.posix.join(crateRoot, item.specifier.replace(/^crate\/?/u, "")))}` };
119772
120222
  }
119773
120223
  if (item.specifier === "self" || item.specifier.startsWith("self/"))
119774
120224
  return { ...item, bindings, specifier: `./${item.specifier.replace(/^self\/?/u, "")}` };
@@ -119866,8 +120316,8 @@ var init_data_document2 = __esm(() => {
119866
120316
  });
119867
120317
 
119868
120318
  // ../../packages/core/dist/services/etl/stages/resolve.js
119869
- import path15 from "path";
119870
- import fs8 from "fs";
120319
+ import path19 from "path";
120320
+ import fs11 from "fs";
119871
120321
 
119872
120322
  class ResolveStage {
119873
120323
  symbolRepository;
@@ -119891,7 +120341,7 @@ class ResolveStage {
119891
120341
  const structuralDocuments = files.flatMap((file3) => {
119892
120342
  if (!file3.structure)
119893
120343
  return [];
119894
- const language = resolveStructuralLanguage(path15.extname(file3.file.relativePath));
120344
+ const language = resolveStructuralLanguage(path19.extname(file3.file.relativePath));
119895
120345
  if (language.status !== "supported")
119896
120346
  throw new Error(`structural_manifest_missing:${file3.file.relativePath}`);
119897
120347
  return [{
@@ -119903,13 +120353,13 @@ class ResolveStage {
119903
120353
  }];
119904
120354
  });
119905
120355
  const currentStructuralFiles = new Set(structuralDocuments.map((document2) => document2.file));
119906
- const skippedStructuralFiles = new Set(files.filter((item) => !item.file.needsReparse && STRUCTURAL_SEED_EXTENSIONS.has(path15.extname(item.file.relativePath).toLowerCase())).map((item) => item.file.relativePath));
120356
+ const skippedStructuralFiles = new Set(files.filter((item) => !item.file.needsReparse && STRUCTURAL_SEED_EXTENSIONS.has(path19.extname(item.file.relativePath).toLowerCase())).map((item) => item.file.relativePath));
119907
120357
  const pathAliasesByFile = Object.fromEntries([...knownRelPaths].map((file3) => [
119908
120358
  file3,
119909
120359
  this.structuralAliasesFor(file3, rootAliases, monorepoPackages)
119910
120360
  ]));
119911
120361
  const buildMetadata = { knownFiles: [...knownRelPaths], pathAliasesByFile };
119912
- const seedRows = repositoryDefinitions.filter((definition) => STRUCTURAL_SEED_EXTENSIONS.has(path15.extname(definition.file_path).toLowerCase())).filter((definition) => knownRelPaths.has(definition.file_path) && skippedStructuralFiles.has(definition.file_path)).filter((definition) => !currentStructuralFiles.has(definition.file_path));
120362
+ const seedRows = repositoryDefinitions.filter((definition) => STRUCTURAL_SEED_EXTENSIONS.has(path19.extname(definition.file_path).toLowerCase())).filter((definition) => knownRelPaths.has(definition.file_path) && skippedStructuralFiles.has(definition.file_path)).filter((definition) => !currentStructuralFiles.has(definition.file_path));
119913
120363
  const seedIds = new Set;
119914
120364
  for (const definition of seedRows) {
119915
120365
  if (seedIds.has(definition.id))
@@ -120002,7 +120452,7 @@ class ResolveStage {
120002
120452
  if (parsed.file !== definition.file_path) {
120003
120453
  throw new Error(`structural_repository_seed_file_mismatch:${definition.id}`);
120004
120454
  }
120005
- const language = resolveStructuralLanguage(path15.extname(definition.file_path));
120455
+ const language = resolveStructuralLanguage(path19.extname(definition.file_path));
120006
120456
  if (language.status !== "supported")
120007
120457
  throw new Error(`structural_repository_seed_language:${definition.id}`);
120008
120458
  let identity;
@@ -120054,7 +120504,7 @@ class ResolveStage {
120054
120504
  });
120055
120505
  }
120056
120506
  resolveFile(parsed, projectPath, knownRelPaths, rootAliases, monorepoPackages, symbolIndex, knownFqns) {
120057
- const fromDir = path15.dirname(path15.join(projectPath, parsed.file.relativePath));
120507
+ const fromDir = path19.dirname(path19.join(projectPath, parsed.file.relativePath));
120058
120508
  const packageAliases = this.getPackageAliases(parsed.file.relativePath, monorepoPackages);
120059
120509
  const allAliases = [...packageAliases, ...rootAliases];
120060
120510
  const resolvedImports = parsed.rawImports.map((raw2) => {
@@ -120125,7 +120575,7 @@ class ResolveStage {
120125
120575
  index.set(def.name, `${def.file_path}#${def.name}`);
120126
120576
  }
120127
120577
  } catch (err) {
120128
- const skippedStructural = files.some((file3) => !file3.file.needsReparse && STRUCTURAL_SEED_EXTENSIONS.has(path15.extname(file3.file.relativePath).toLowerCase()));
120578
+ const skippedStructural = files.some((file3) => !file3.file.needsReparse && STRUCTURAL_SEED_EXTENSIONS.has(path19.extname(file3.file.relativePath).toLowerCase()));
120129
120579
  if (skippedStructural)
120130
120580
  throw new Error("structural_repository_seed_failed", { cause: err });
120131
120581
  logger.warn("buildSymbolIndex: repo seed failed, in-batch only", {
@@ -120149,7 +120599,7 @@ class ResolveStage {
120149
120599
  }
120150
120600
  resolveSpecifier(specifier, fromDir, projectPath, knownRelPaths, aliases) {
120151
120601
  if (specifier.startsWith("./") || specifier.startsWith("../")) {
120152
- const resolved = this.probeExtensions(path15.resolve(fromDir, specifier), projectPath, knownRelPaths);
120602
+ const resolved = this.probeExtensions(path19.resolve(fromDir, specifier), projectPath, knownRelPaths);
120153
120603
  return { resolvedPath: resolved, external: false };
120154
120604
  }
120155
120605
  for (const alias of aliases) {
@@ -120157,8 +120607,8 @@ class ResolveStage {
120157
120607
  const suffix = specifier.slice(alias.prefix.length);
120158
120608
  for (const target of alias.targets) {
120159
120609
  const cleanTarget = target.replace(/\/\*$/, "");
120160
- const basePath = alias.packagePath ? path15.join(projectPath, alias.packagePath) : projectPath;
120161
- const absPath = path15.join(basePath, cleanTarget + suffix);
120610
+ const basePath = alias.packagePath ? path19.join(projectPath, alias.packagePath) : projectPath;
120611
+ const absPath = path19.join(basePath, cleanTarget + suffix);
120162
120612
  const resolved = this.probeExtensions(absPath, projectPath, knownRelPaths);
120163
120613
  if (resolved)
120164
120614
  return { resolvedPath: resolved, external: false };
@@ -120174,7 +120624,7 @@ class ResolveStage {
120174
120624
  ...TS_EXTENSIONS.map((ext2) => absPath.replace(/\.[^.]+$/, ext2))
120175
120625
  ];
120176
120626
  for (const candidate2 of candidates2) {
120177
- const rel = path15.relative(projectPath, candidate2).replace(/\\/g, "/");
120627
+ const rel = path19.relative(projectPath, candidate2).replace(/\\/g, "/");
120178
120628
  if (knownRelPaths.has(rel))
120179
120629
  return rel;
120180
120630
  }
@@ -120182,9 +120632,9 @@ class ResolveStage {
120182
120632
  }
120183
120633
  loadTsConfigPaths(projectPath, packageBase) {
120184
120634
  const aliases = [];
120185
- const tsconfigPath = path15.join(projectPath, "tsconfig.json");
120635
+ const tsconfigPath = path19.join(projectPath, "tsconfig.json");
120186
120636
  try {
120187
- const raw2 = fs8.readFileSync(tsconfigPath, "utf-8");
120637
+ const raw2 = fs11.readFileSync(tsconfigPath, "utf-8");
120188
120638
  const stripped = raw2.replace(/\/\/[^\n]*/g, "").replace(/\/\*[\s\S]*?\*\//g, "");
120189
120639
  const tsconfig = JSON.parse(stripped);
120190
120640
  const paths = tsconfig?.compilerOptions?.paths ?? {};
@@ -120213,7 +120663,7 @@ class ResolveStage {
120213
120663
  }
120214
120664
  }
120215
120665
  for (const packageRelPath of packagePaths) {
120216
- const absPackagePath = path15.join(projectPath, packageRelPath);
120666
+ const absPackagePath = path19.join(projectPath, packageRelPath);
120217
120667
  const aliases = this.loadTsConfigPaths(absPackagePath, packageRelPath);
120218
120668
  if (aliases.length > 0) {
120219
120669
  packages.push({
@@ -120243,7 +120693,7 @@ class ResolveStage {
120243
120693
  structuralAliasesFor(filePath, rootAliases, packages) {
120244
120694
  return [...this.getPackageAliases(filePath, packages), ...rootAliases].map((alias) => ({
120245
120695
  pattern: alias.prefix + (alias.targets.some((target) => target.includes("*")) ? "/*" : ""),
120246
- targets: alias.targets.map((target) => alias.packagePath ? path15.posix.join(alias.packagePath, target) : target)
120696
+ targets: alias.targets.map((target) => alias.packagePath ? path19.posix.join(alias.packagePath, target) : target)
120247
120697
  }));
120248
120698
  }
120249
120699
  }
@@ -120307,7 +120757,7 @@ var init_with_deadlock_retry = __esm(() => {
120307
120757
  });
120308
120758
 
120309
120759
  // ../../packages/core/dist/services/etl/stages/load.js
120310
- import path16 from "path";
120760
+ import path20 from "path";
120311
120761
  function formatDuration(ms) {
120312
120762
  const totalSec = Math.max(0, Math.round(ms / 1000));
120313
120763
  if (totalSec < 60)
@@ -120577,7 +121027,7 @@ class LoadStage {
120577
121027
  const filePath = file3.file.relativePath;
120578
121028
  const batch = buildSymbolPersistenceBatch(ctx.projectId, file3);
120579
121029
  if (ctx.graphGenerationLease) {
120580
- const manifest = getLanguageManifestEntry(path16.extname(filePath));
121030
+ const manifest = getLanguageManifestEntry(path20.extname(filePath));
120581
121031
  const diagnostics2 = (file3.structuralDiagnostics ?? []).slice(0, 10).map((diagnostic2) => ({
120582
121032
  code: diagnostic2.code,
120583
121033
  severity: diagnostic2.severity,
@@ -121033,9 +121483,9 @@ var init_graph_generation_coordinator = __esm(() => {
121033
121483
  // ../../packages/core/dist/services/etl/pipeline.js
121034
121484
  import { createHash as createHash7 } from "crypto";
121035
121485
  import { setTimeout as delay2 } from "timers/promises";
121036
- import path17 from "path";
121486
+ import path21 from "path";
121037
121487
  function buildHeaderLanguageEvidence(files) {
121038
- const headers = new Set(files.filter((file3) => path17.posix.extname(file3.relativePath).toLowerCase() === ".h").map((file3) => path17.posix.normalize(file3.relativePath)));
121488
+ const headers = new Set(files.filter((file3) => path21.posix.extname(file3.relativePath).toLowerCase() === ".h").map((file3) => path21.posix.normalize(file3.relativePath)));
121039
121489
  const mutable = new Map;
121040
121490
  const entry2 = (header) => {
121041
121491
  let value = mutable.get(header);
@@ -121046,7 +121496,7 @@ function buildHeaderLanguageEvidence(files) {
121046
121496
  return value;
121047
121497
  };
121048
121498
  for (const file3 of files) {
121049
- if (path17.posix.basename(file3.relativePath) !== "compile_commands.json" || file3.snapshotContent === undefined)
121499
+ if (path21.posix.basename(file3.relativePath) !== "compile_commands.json" || file3.snapshotContent === undefined)
121050
121500
  continue;
121051
121501
  let commands;
121052
121502
  try {
@@ -121062,11 +121512,11 @@ function buildHeaderLanguageEvidence(files) {
121062
121512
  const record2 = command;
121063
121513
  if (typeof record2.file !== "string")
121064
121514
  continue;
121065
- const projectRoot = path17.resolve(file3.absolutePath, ...file3.relativePath.split("/").map(() => ".."));
121066
- const commandDirectory = typeof record2.directory === "string" ? path17.resolve(projectRoot, record2.directory) : projectRoot;
121067
- const absoluteInput = path17.resolve(commandDirectory, record2.file);
121068
- const relative2 = path17.relative(projectRoot, absoluteInput);
121069
- const header = path17.posix.normalize(relative2.replaceAll(path17.sep, "/"));
121515
+ const projectRoot = path21.resolve(file3.absolutePath, ...file3.relativePath.split("/").map(() => ".."));
121516
+ const commandDirectory = typeof record2.directory === "string" ? path21.resolve(projectRoot, record2.directory) : projectRoot;
121517
+ const absoluteInput = path21.resolve(commandDirectory, record2.file);
121518
+ const relative2 = path21.relative(projectRoot, absoluteInput);
121519
+ const header = path21.posix.normalize(relative2.replaceAll(path21.sep, "/"));
121070
121520
  if (!headers.has(header))
121071
121521
  continue;
121072
121522
  const invocation = typeof record2.command === "string" ? record2.command : Array.isArray(record2.arguments) ? record2.arguments.join(" ") : "";
@@ -122218,16 +122668,16 @@ function detectRoutes(httpEdges, defs, opts = {}) {
122218
122668
  const seen = new Set;
122219
122669
  const out = [];
122220
122670
  for (const e of httpEdges) {
122221
- const path19 = e.route;
122222
- if (!path19)
122671
+ const path23 = e.route;
122672
+ if (!path23)
122223
122673
  continue;
122224
122674
  const method = (e.method ?? "ANY").toUpperCase();
122225
- const key = method + " " + path19;
122675
+ const key = method + " " + path23;
122226
122676
  if (seen.has(key))
122227
122677
  continue;
122228
122678
  seen.add(key);
122229
122679
  out.push({
122230
- path: path19,
122680
+ path: path23,
122231
122681
  method: e.method,
122232
122682
  file: e.fromFile,
122233
122683
  handler: e.targetFqn ?? e.symbolName
@@ -122238,12 +122688,12 @@ function detectRoutes(httpEdges, defs, opts = {}) {
122238
122688
  continue;
122239
122689
  const parsed = parseRouteName(d.name);
122240
122690
  const method = parsed?.method ?? "ANY";
122241
- const path19 = parsed?.path ?? d.name;
122242
- const key = method + " " + path19;
122691
+ const path23 = parsed?.path ?? d.name;
122692
+ const key = method + " " + path23;
122243
122693
  if (seen.has(key))
122244
122694
  continue;
122245
122695
  seen.add(key);
122246
- out.push({ path: path19, method: parsed?.method, file: d.filePath, handler: d.name });
122696
+ out.push({ path: path23, method: parsed?.method, file: d.filePath, handler: d.name });
122247
122697
  }
122248
122698
  for (const d of defs) {
122249
122699
  const parsed = parseRouteName(d.name);
@@ -122464,8 +122914,8 @@ __export(exports_symbol_graph_service, {
122464
122914
  symbolGraphService: () => symbolGraphService,
122465
122915
  SymbolGraphService: () => SymbolGraphService
122466
122916
  });
122467
- import path19 from "path";
122468
- import fs9 from "fs/promises";
122917
+ import path23 from "path";
122918
+ import fs12 from "fs/promises";
122469
122919
 
122470
122920
  class SymbolGraphService {
122471
122921
  identityLookup;
@@ -122793,7 +123243,7 @@ class SymbolGraphService {
122793
123243
  async readSnippet(relativePath, lineStart, lineEnd, projectId) {
122794
123244
  try {
122795
123245
  const absolutePath = await this.resolveToAbsolute(relativePath, projectId);
122796
- const content = await fs9.readFile(absolutePath, "utf-8");
123246
+ const content = await fs12.readFile(absolutePath, "utf-8");
122797
123247
  const lines = content.split(`
122798
123248
  `);
122799
123249
  return lines.slice(Math.max(0, lineStart - 1), Math.min(lines.length, lineEnd)).join(`
@@ -122805,7 +123255,7 @@ class SymbolGraphService {
122805
123255
  async readContext(relativePath, lineNumber, contextLines, projectId) {
122806
123256
  try {
122807
123257
  const absolutePath = await this.resolveToAbsolute(relativePath, projectId);
122808
- const content = await fs9.readFile(absolutePath, "utf-8");
123258
+ const content = await fs12.readFile(absolutePath, "utf-8");
122809
123259
  const lines = content.split(`
122810
123260
  `);
122811
123261
  const start = Math.max(0, lineNumber - contextLines - 1);
@@ -122818,7 +123268,7 @@ class SymbolGraphService {
122818
123268
  }
122819
123269
  async resolveToAbsolute(relativePath, projectId) {
122820
123270
  const root = await this.getProjectRoot(projectId);
122821
- return root ? path19.resolve(root, relativePath) : relativePath;
123271
+ return root ? path23.resolve(root, relativePath) : relativePath;
122822
123272
  }
122823
123273
  async getProjectRoot(projectId) {
122824
123274
  const cached2 = this.projectRootCache.get(projectId);
@@ -126808,31 +127258,31 @@ class TracePathService {
126808
127258
  const chains = [];
126809
127259
  const seen = new Set;
126810
127260
  let walks = 0;
126811
- const walk = (fqn, path22) => {
127261
+ const walk = (fqn, path26) => {
126812
127262
  if (chains.length >= CHAIN_CAP)
126813
127263
  return;
126814
127264
  if (walks >= MAX_WALKS)
126815
127265
  return;
126816
127266
  walks++;
126817
- const key = path22.join("\u2192");
127267
+ const key = path26.join("\u2192");
126818
127268
  if (seen.has(key))
126819
127269
  return;
126820
127270
  seen.add(key);
126821
127271
  const next = adj.get(fqn);
126822
127272
  if (!next || next.length === 0 || !whoHasChild.has(fqn)) {
126823
- if (path22.length > 1)
126824
- chains.push(path22.map((n2) => this.fqnToName(n2)).join(" \u2192 "));
127273
+ if (path26.length > 1)
127274
+ chains.push(path26.map((n2) => this.fqnToName(n2)).join(" \u2192 "));
126825
127275
  return;
126826
127276
  }
126827
127277
  for (const child of next) {
126828
127278
  if (chains.length >= CHAIN_CAP || walks >= MAX_WALKS)
126829
127279
  return;
126830
- if (path22.includes(child)) {
126831
- const cycled = [...path22, `${this.fqnToName(child)}\u21BA`];
127280
+ if (path26.includes(child)) {
127281
+ const cycled = [...path26, `${this.fqnToName(child)}\u21BA`];
126832
127282
  chains.push(cycled.map((n2) => n2).join(" \u2192 "));
126833
127283
  continue;
126834
127284
  }
126835
- walk(child, [...path22, child]);
127285
+ walk(child, [...path26, child]);
126836
127286
  }
126837
127287
  };
126838
127288
  for (const seed of seeds) {
@@ -126874,7 +127324,7 @@ var init_git_ref_validation = __esm(() => {
126874
127324
  });
126875
127325
 
126876
127326
  // ../../packages/core/dist/services/symbol/impact-analysis.js
126877
- import { execFileSync } from "child_process";
127327
+ import { execFileSync as execFileSync2 } from "child_process";
126878
127328
  function readBfsCteFlag() {
126879
127329
  try {
126880
127330
  return Boolean(config.get("impact")?.bfsCteEnabled);
@@ -127200,19 +127650,19 @@ function defaultDiffRunner(projectPath2, scope, baseBranch, since) {
127200
127650
  let diffRange;
127201
127651
  if (since) {
127202
127652
  try {
127203
- ref = execFileSync("git", ["-C", projectPath2, "rev-parse", "--verify", `${since}^{commit}`], {
127653
+ ref = execFileSync2("git", ["-C", projectPath2, "rev-parse", "--verify", `${since}^{commit}`], {
127204
127654
  cwd: projectPath2,
127205
127655
  encoding: "utf-8",
127206
127656
  stdio: ["ignore", "pipe", "pipe"]
127207
127657
  }).trim();
127208
127658
  } catch {
127209
- ref = execFileSync("git", ["-C", projectPath2, "rev-list", "-1", `--before=${since}`, "HEAD"], {
127659
+ ref = execFileSync2("git", ["-C", projectPath2, "rev-list", "-1", `--before=${since}`, "HEAD"], {
127210
127660
  cwd: projectPath2,
127211
127661
  encoding: "utf-8",
127212
127662
  stdio: ["ignore", "pipe", "pipe"]
127213
127663
  }).trim();
127214
127664
  if (!ref) {
127215
- const emptyTree = execFileSync("git", ["hash-object", "-t", "tree", "--stdin"], {
127665
+ const emptyTree = execFileSync2("git", ["hash-object", "-t", "tree", "--stdin"], {
127216
127666
  cwd: projectPath2,
127217
127667
  encoding: "utf-8",
127218
127668
  input: "",
@@ -127224,7 +127674,7 @@ function defaultDiffRunner(projectPath2, scope, baseBranch, since) {
127224
127674
  }
127225
127675
  args.push(diffRange ?? `${ref}...HEAD`);
127226
127676
  }
127227
- const out = execFileSync("git", args, {
127677
+ const out = execFileSync2("git", args, {
127228
127678
  cwd: projectPath2,
127229
127679
  encoding: "utf-8",
127230
127680
  stdio: ["ignore", "pipe", "pipe"],
@@ -127236,7 +127686,7 @@ function defaultDiffRunner(projectPath2, scope, baseBranch, since) {
127236
127686
  let untrackedFiltered = 0;
127237
127687
  const merged = new Set(tracked);
127238
127688
  if (includeUntracked) {
127239
- const untracked = execFileSync("git", ["-C", projectPath2, "ls-files", "--others", "--exclude-standard"], {
127689
+ const untracked = execFileSync2("git", ["-C", projectPath2, "ls-files", "--others", "--exclude-standard"], {
127240
127690
  cwd: projectPath2,
127241
127691
  encoding: "utf-8",
127242
127692
  stdio: ["ignore", "pipe", "pipe"],
@@ -127274,7 +127724,7 @@ var init_impact_analysis = __esm(() => {
127274
127724
  });
127275
127725
 
127276
127726
  // ../../packages/core/dist/services/executor/runtime.js
127277
- import { execFileSync as execFileSync2, execSync } from "child_process";
127727
+ import { execFileSync as execFileSync3, execSync } from "child_process";
127278
127728
  function commandExists(cmd) {
127279
127729
  try {
127280
127730
  const check3 = isWindows ? `where ${cmd}` : `command -v ${cmd}`;
@@ -127307,7 +127757,7 @@ function getVersion(cmd, args = ["--version"], deps) {
127307
127757
  timeout: 5000
127308
127758
  }).trim().split(/\r?\n/)[0];
127309
127759
  }
127310
- return execFileSync2(cmd, args, {
127760
+ return execFileSync3(cmd, args, {
127311
127761
  encoding: "utf-8",
127312
127762
  stdio: ["pipe", "pipe", "pipe"],
127313
127763
  timeout: 5000
@@ -127448,12 +127898,12 @@ var init_runtime = __esm(() => {
127448
127898
 
127449
127899
  // ../../packages/core/dist/services/executor/sandbox.js
127450
127900
  import { realpathSync as realpathSync2 } from "fs";
127451
- import { execFileSync as execFileSync3 } from "child_process";
127901
+ import { execFileSync as execFileSync4 } from "child_process";
127452
127902
  function isDockerAvailable() {
127453
127903
  if (_dockerAvailable !== null)
127454
127904
  return _dockerAvailable;
127455
127905
  try {
127456
- execFileSync3("docker", ["--version"], { stdio: "pipe", timeout: 5000 });
127906
+ execFileSync4("docker", ["--version"], { stdio: "pipe", timeout: 5000 });
127457
127907
  _dockerAvailable = true;
127458
127908
  } catch {
127459
127909
  _dockerAvailable = false;
@@ -127464,7 +127914,7 @@ function isSeatbeltAvailable() {
127464
127914
  if (_seatbeltAvailable !== null)
127465
127915
  return _seatbeltAvailable;
127466
127916
  try {
127467
- execFileSync3("sandbox-exec", ["--version"], { stdio: "pipe", timeout: 5000 });
127917
+ execFileSync4("sandbox-exec", ["--version"], { stdio: "pipe", timeout: 5000 });
127468
127918
  _seatbeltAvailable = true;
127469
127919
  } catch {
127470
127920
  _seatbeltAvailable = false;
@@ -127569,7 +128019,7 @@ var init_sandbox = __esm(() => {
127569
128019
  });
127570
128020
 
127571
128021
  // ../../packages/core/dist/services/executor/executor.js
127572
- import { spawn, execSync as execSync2, execFileSync as execFileSync4 } from "child_process";
128022
+ import { spawn, execSync as execSync2, execFileSync as execFileSync5 } from "child_process";
127573
128023
  import { mkdtempSync, writeFileSync as writeFileSync2, rmSync, realpathSync as realpathSync3 } from "fs";
127574
128024
  import { join as join3, resolve as resolve5, isAbsolute, relative as relative2 } from "path";
127575
128025
  import { tmpdir } from "os";
@@ -127772,7 +128222,7 @@ ${body}`;
127772
128222
  const binPath = srcPath.replace(/\.rs$/, isWin ? ".exe" : "");
127773
128223
  try {
127774
128224
  try {
127775
- execFileSync4("rustc", [srcPath, "-o", binPath], {
128225
+ execFileSync5("rustc", [srcPath, "-o", binPath], {
127776
128226
  cwd,
127777
128227
  timeout: Math.min(timeout, 60000),
127778
128228
  encoding: "utf-8",
@@ -129974,9 +130424,9 @@ var init_l1_memory_cache = __esm(() => {
129974
130424
  });
129975
130425
 
129976
130426
  // ../../packages/core/dist/services/health/local-health-checker.js
129977
- import fs12 from "fs/promises";
130427
+ import fs15 from "fs/promises";
129978
130428
  import { existsSync as existsSync3 } from "fs";
129979
- import path24 from "path";
130429
+ import path28 from "path";
129980
130430
 
129981
130431
  class LocalHealthChecker {
129982
130432
  ollamaBaseUrl = process.env.OLLAMA_BASE_URL || "http://localhost:11434";
@@ -130010,10 +130460,10 @@ class LocalHealthChecker {
130010
130460
  const start = Date.now();
130011
130461
  try {
130012
130462
  if (!existsSync3(this.dataDir))
130013
- await fs12.mkdir(this.dataDir, { recursive: true });
130014
- const probe2 = path24.join(this.dataDir, ".health-check-test");
130015
- await fs12.writeFile(probe2, "ok");
130016
- await fs12.unlink(probe2);
130463
+ await fs15.mkdir(this.dataDir, { recursive: true });
130464
+ const probe2 = path28.join(this.dataDir, ".health-check-test");
130465
+ await fs15.writeFile(probe2, "ok");
130466
+ await fs15.unlink(probe2);
130017
130467
  return { available: true, latency: Date.now() - start, details: { path: this.dataDir, writable: true } };
130018
130468
  } catch (error51) {
130019
130469
  return { available: false, latency: Date.now() - start, error: `Data directory error: ${error51.message}` };
@@ -131923,9 +132373,9 @@ var init_scheduler2 = __esm(() => {
131923
132373
  });
131924
132374
 
131925
132375
  // ../../packages/core/dist/services/pricing/models-dev-client.js
131926
- import fs13 from "fs/promises";
132376
+ import fs16 from "fs/promises";
131927
132377
  import { existsSync as existsSync4 } from "fs";
131928
- import path25 from "path";
132378
+ import path29 from "path";
131929
132379
  function getModelsDevClient() {
131930
132380
  if (!clientInstance) {
131931
132381
  clientInstance = new ModelsDevClient;
@@ -131945,7 +132395,7 @@ var init_models_dev_client = __esm(() => {
131945
132395
  memoryCacheTimestamp = 0;
131946
132396
  getLocalCachePath() {
131947
132397
  const dataDir = config.get("dataDir");
131948
- return path25.join(dataDir, ModelsDevClient.LOCAL_CACHE_FILE);
132398
+ return path29.join(dataDir, ModelsDevClient.LOCAL_CACHE_FILE);
131949
132399
  }
131950
132400
  async loadLocalCache() {
131951
132401
  const cachePath = this.getLocalCachePath();
@@ -131953,7 +132403,7 @@ var init_models_dev_client = __esm(() => {
131953
132403
  if (!existsSync4(cachePath)) {
131954
132404
  return null;
131955
132405
  }
131956
- const content = await fs13.readFile(cachePath, "utf-8");
132406
+ const content = await fs16.readFile(cachePath, "utf-8");
131957
132407
  const data = JSON.parse(content);
131958
132408
  const age = Date.now() - data.timestamp;
131959
132409
  if (age > ModelsDevClient.LOCAL_CACHE_TTL) {
@@ -131980,14 +132430,14 @@ var init_models_dev_client = __esm(() => {
131980
132430
  async saveLocalCache(models) {
131981
132431
  const cachePath = this.getLocalCachePath();
131982
132432
  try {
131983
- const dir = path25.dirname(cachePath);
131984
- await fs13.mkdir(dir, { recursive: true });
132433
+ const dir = path29.dirname(cachePath);
132434
+ await fs16.mkdir(dir, { recursive: true });
131985
132435
  const data = {
131986
132436
  timestamp: Date.now(),
131987
132437
  version: "1.0.0",
131988
132438
  models: Object.fromEntries(models)
131989
132439
  };
131990
- await fs13.writeFile(cachePath, JSON.stringify(data), "utf-8");
132440
+ await fs16.writeFile(cachePath, JSON.stringify(data), "utf-8");
131991
132441
  logger.debug("Saved pricing to local cache", {
131992
132442
  models: models.size,
131993
132443
  path: cachePath
@@ -132316,7 +132766,7 @@ var init_models_dev_client = __esm(() => {
132316
132766
  const cachePath = this.getLocalCachePath();
132317
132767
  try {
132318
132768
  if (existsSync4(cachePath)) {
132319
- await fs13.unlink(cachePath);
132769
+ await fs16.unlink(cachePath);
132320
132770
  logger.debug("Local pricing cache file deleted");
132321
132771
  }
132322
132772
  } catch (error51) {
@@ -137871,33 +138321,33 @@ var require_URL = __commonJS((exports, module) => {
137871
138321
  else
137872
138322
  return basepath.substring(0, lastslash + 1) + refpath;
137873
138323
  }
137874
- function remove_dot_segments(path26) {
137875
- if (!path26)
137876
- return path26;
138324
+ function remove_dot_segments(path30) {
138325
+ if (!path30)
138326
+ return path30;
137877
138327
  var output = "";
137878
- while (path26.length > 0) {
137879
- if (path26 === "." || path26 === "..") {
137880
- path26 = "";
138328
+ while (path30.length > 0) {
138329
+ if (path30 === "." || path30 === "..") {
138330
+ path30 = "";
137881
138331
  break;
137882
138332
  }
137883
- var twochars = path26.substring(0, 2);
137884
- var threechars = path26.substring(0, 3);
137885
- var fourchars = path26.substring(0, 4);
138333
+ var twochars = path30.substring(0, 2);
138334
+ var threechars = path30.substring(0, 3);
138335
+ var fourchars = path30.substring(0, 4);
137886
138336
  if (threechars === "../") {
137887
- path26 = path26.substring(3);
138337
+ path30 = path30.substring(3);
137888
138338
  } else if (twochars === "./") {
137889
- path26 = path26.substring(2);
138339
+ path30 = path30.substring(2);
137890
138340
  } else if (threechars === "/./") {
137891
- path26 = "/" + path26.substring(3);
137892
- } else if (twochars === "/." && path26.length === 2) {
137893
- path26 = "/";
137894
- } else if (fourchars === "/../" || threechars === "/.." && path26.length === 3) {
137895
- path26 = "/" + path26.substring(4);
138341
+ path30 = "/" + path30.substring(3);
138342
+ } else if (twochars === "/." && path30.length === 2) {
138343
+ path30 = "/";
138344
+ } else if (fourchars === "/../" || threechars === "/.." && path30.length === 3) {
138345
+ path30 = "/" + path30.substring(4);
137896
138346
  output = output.replace(/\/?[^\/]*$/, "");
137897
138347
  } else {
137898
- var segment = path26.match(/(\/?([^\/]*))/)[0];
138348
+ var segment = path30.match(/(\/?([^\/]*))/)[0];
137899
138349
  output += segment;
137900
- path26 = path26.substring(segment.length);
138350
+ path30 = path30.substring(segment.length);
137901
138351
  }
137902
138352
  }
137903
138353
  return output;
@@ -149967,21 +150417,21 @@ function jsonToKeyPathChunks(value, label = "$") {
149967
150417
  walk(value, label, out);
149968
150418
  return out;
149969
150419
  }
149970
- function walk(val, path26, out) {
150420
+ function walk(val, path30, out) {
149971
150421
  if (val === null || val === undefined)
149972
150422
  return;
149973
150423
  if (Array.isArray(val)) {
149974
150424
  if (val.length === 0) {
149975
- out.push({ path: path26, content: `**${path26}** = _[]_` });
150425
+ out.push({ path: path30, content: `**${path30}** = _[]_` });
149976
150426
  return;
149977
150427
  }
149978
150428
  if (val.every((v) => v !== null && typeof v === "object")) {
149979
- val.forEach((v, i) => walk(v, `${path26}[${i}]`, out));
150429
+ val.forEach((v, i) => walk(v, `${path30}[${i}]`, out));
149980
150430
  return;
149981
150431
  }
149982
150432
  const items = val.map((v) => `- \`${String(v)}\``).join(`
149983
150433
  `);
149984
- out.push({ path: path26, content: `**${path26}**
150434
+ out.push({ path: path30, content: `**${path30}**
149985
150435
 
149986
150436
  ${items}` });
149987
150437
  return;
@@ -149989,16 +150439,16 @@ ${items}` });
149989
150439
  if (typeof val === "object") {
149990
150440
  const entries = Object.entries(val);
149991
150441
  if (entries.length === 0) {
149992
- out.push({ path: path26, content: `**${path26}** = _{}_` });
150442
+ out.push({ path: path30, content: `**${path30}** = _{}_` });
149993
150443
  return;
149994
150444
  }
149995
150445
  for (const [k2, v] of entries) {
149996
150446
  const safeKey = /^[A-Za-z_$][\w$]*$/.test(k2) ? k2 : JSON.stringify(k2);
149997
- walk(v, `${path26}.${safeKey}`, out);
150447
+ walk(v, `${path30}.${safeKey}`, out);
149998
150448
  }
149999
150449
  return;
150000
150450
  }
150001
- out.push({ path: path26, content: `**${path26}** = \`${String(val)}\`` });
150451
+ out.push({ path: path30, content: `**${path30}** = \`${String(val)}\`` });
150002
150452
  }
150003
150453
  var gfm, STRIP_SELECTORS, tdCache = null;
150004
150454
  var init_html_to_md = __esm(() => {
@@ -172986,9 +173436,9 @@ async function acquireIndexingLease(request) {
172986
173436
 
172987
173437
  // ../../packages/core/dist/services/project-identity/project-root-identity.js
172988
173438
  import { realpath as realpath2 } from "fs/promises";
172989
- import path18 from "path";
173439
+ import path22 from "path";
172990
173440
  async function canonicalizeProjectRoot(projectPath, canonicalize = realpath2) {
172991
- return canonicalize(path18.resolve(projectPath));
173441
+ return canonicalize(path22.resolve(projectPath));
172992
173442
  }
172993
173443
  async function assertProjectRootReuse(options) {
172994
173444
  if (!options.storedProjectPath || options.forceReindex)
@@ -172996,9 +173446,9 @@ async function assertProjectRootReuse(options) {
172996
173446
  const canonicalize = options.canonicalize ?? realpath2;
172997
173447
  let storedCanonical;
172998
173448
  try {
172999
- storedCanonical = await canonicalize(path18.resolve(options.storedProjectPath));
173449
+ storedCanonical = await canonicalize(path22.resolve(options.storedProjectPath));
173000
173450
  } catch {
173001
- storedCanonical = path18.resolve(options.storedProjectPath);
173451
+ storedCanonical = path22.resolve(options.storedProjectPath);
173002
173452
  }
173003
173453
  if (storedCanonical !== options.canonicalProjectPath) {
173004
173454
  throw new Error(`Project ID "${options.projectId}" already indexes canonical root ` + `"${storedCanonical}", not "${options.canonicalProjectPath}"; ` + "use forceReindex only after verifying ownership of the existing project");
@@ -173008,7 +173458,7 @@ async function assertProjectRootReuse(options) {
173008
173458
  // ../../packages/core/dist/tools/index_project.js
173009
173459
  init_workspace_manager();
173010
173460
  init_parser_readiness();
173011
- import path20 from "path";
173461
+ import path24 from "path";
173012
173462
 
173013
173463
  class IndexProjectTool {
173014
173464
  name = "index_project";
@@ -173056,7 +173506,7 @@ class IndexProjectTool {
173056
173506
  try {
173057
173507
  await assertParserReadyForIndexing();
173058
173508
  const canonicalProjectPath = await canonicalizeProjectRoot(projectPath);
173059
- const finalProjectId = projectId || path20.basename(canonicalProjectPath) || "default";
173509
+ const finalProjectId = projectId || path24.basename(canonicalProjectPath) || "default";
173060
173510
  const existing = await workspaceManager.getWorkspace(finalProjectId);
173061
173511
  await assertProjectRootReuse({
173062
173512
  projectId: finalProjectId,
@@ -173234,7 +173684,7 @@ function normalizeValue(value) {
173234
173684
  return Array.from(value).map(normalizeValue);
173235
173685
  if (value instanceof Map)
173236
173686
  return Object.fromEntries(Array.from(value, ([k2, v]) => [String(k2), normalizeValue(v)]));
173237
- if (isPlainObject3(value)) {
173687
+ if (isPlainObject4(value)) {
173238
173688
  const encodedValues = {};
173239
173689
  for (const key in value)
173240
173690
  if (Object.hasOwn(value, key))
@@ -173255,7 +173705,7 @@ function isJsonObject(value) {
173255
173705
  function isEmptyObject(value) {
173256
173706
  return Object.keys(value).length === 0;
173257
173707
  }
173258
- function isPlainObject3(value) {
173708
+ function isPlainObject4(value) {
173259
173709
  if (value === null || typeof value !== "object")
173260
173710
  return false;
173261
173711
  const prototype = Object.getPrototypeOf(value);
@@ -173610,17 +174060,17 @@ function applyReplacer(root, replacer) {
173610
174060
  return transformChildren(root, replacer, []);
173611
174061
  return transformChildren(normalizeValue(replacedRoot), replacer, []);
173612
174062
  }
173613
- function transformChildren(value, replacer, path21) {
174063
+ function transformChildren(value, replacer, path25) {
173614
174064
  if (isJsonObject(value))
173615
- return transformObject(value, replacer, path21);
174065
+ return transformObject(value, replacer, path25);
173616
174066
  if (isJsonArray(value))
173617
- return transformArray(value, replacer, path21);
174067
+ return transformArray(value, replacer, path25);
173618
174068
  return value;
173619
174069
  }
173620
- function transformObject(obj, replacer, path21) {
174070
+ function transformObject(obj, replacer, path25) {
173621
174071
  const result = {};
173622
174072
  for (const [key, value] of Object.entries(obj)) {
173623
- const childPath = [...path21, key];
174073
+ const childPath = [...path25, key];
173624
174074
  const replacedValue = replacer(key, value, childPath);
173625
174075
  if (replacedValue === undefined)
173626
174076
  continue;
@@ -173628,11 +174078,11 @@ function transformObject(obj, replacer, path21) {
173628
174078
  }
173629
174079
  return result;
173630
174080
  }
173631
- function transformArray(arr, replacer, path21) {
174081
+ function transformArray(arr, replacer, path25) {
173632
174082
  const result = [];
173633
174083
  for (let i = 0;i < arr.length; i++) {
173634
174084
  const value = arr[i];
173635
- const childPath = [...path21, i];
174085
+ const childPath = [...path25, i];
173636
174086
  const replacedValue = replacer(String(i), value, childPath);
173637
174087
  if (replacedValue === undefined)
173638
174088
  continue;
@@ -175012,9 +175462,9 @@ init_compaction_snapshot_service();
175012
175462
  init_dist();
175013
175463
  init_db_connection();
175014
175464
  init_alias_resolver();
175015
- import fs10 from "fs";
175016
- import os3 from "os";
175017
- import path21 from "path";
175465
+ import fs13 from "fs";
175466
+ import os6 from "os";
175467
+ import path25 from "path";
175018
175468
 
175019
175469
  // ../../packages/core/dist/services/hooks/session-pin-store.js
175020
175470
  var DEFAULT_MAX_SIZE = 1000;
@@ -175115,8 +175565,8 @@ class AttributionResolver {
175115
175565
  this.aliasResolver = options.aliasResolver ?? getProjectIdentityAliasResolver();
175116
175566
  this.pins = options.pins ?? new SessionPinStore;
175117
175567
  this.canonicalize = options.canonicalize ?? defaultCanonicalize;
175118
- this.homedir = options.homedir ?? os3.homedir;
175119
- this.fsRoot = options.fsRoot ?? (() => path21.parse(path21.sep).root);
175568
+ this.homedir = options.homedir ?? os6.homedir;
175569
+ this.fsRoot = options.fsRoot ?? (() => path25.parse(path25.sep).root);
175120
175570
  }
175121
175571
  async resolve(input) {
175122
175572
  const caller = input.callerProjectId;
@@ -175169,7 +175619,7 @@ class AttributionResolver {
175169
175619
  }
175170
175620
  let bestPath = null;
175171
175621
  for (const candidate2 of byPath.keys()) {
175172
- if (canonicalCwd === candidate2 || canonicalCwd.startsWith(candidate2.endsWith(path21.sep) ? candidate2 : candidate2 + path21.sep)) {
175622
+ if (canonicalCwd === candidate2 || canonicalCwd.startsWith(candidate2.endsWith(path25.sep) ? candidate2 : candidate2 + path25.sep)) {
175173
175623
  if (bestPath === null || candidate2.length > bestPath.length) {
175174
175624
  bestPath = candidate2;
175175
175625
  }
@@ -175192,7 +175642,7 @@ class AttributionResolver {
175192
175642
  return projectPath2;
175193
175643
  const fsRoot = this.fsRoot();
175194
175644
  let normalized = projectPath2;
175195
- while (normalized.length > fsRoot.length && normalized.endsWith(path21.sep)) {
175645
+ while (normalized.length > fsRoot.length && normalized.endsWith(path25.sep)) {
175196
175646
  normalized = normalized.slice(0, -1);
175197
175647
  }
175198
175648
  return normalized;
@@ -175200,10 +175650,10 @@ class AttributionResolver {
175200
175650
  }
175201
175651
  function defaultCanonicalize(cwd) {
175202
175652
  try {
175203
- return fs10.realpathSync(cwd);
175653
+ return fs13.realpathSync(cwd);
175204
175654
  } catch {
175205
175655
  try {
175206
- return path21.resolve(cwd);
175656
+ return path25.resolve(cwd);
175207
175657
  } catch {
175208
175658
  return;
175209
175659
  }
@@ -175801,7 +176251,7 @@ init_code_compressor();
175801
176251
 
175802
176252
  // ../../packages/core/dist/services/file-read/file-content-cache.js
175803
176253
  init_dist();
175804
- import fs11 from "fs/promises";
176254
+ import fs14 from "fs/promises";
175805
176255
 
175806
176256
  class FileContentCache {
175807
176257
  extractMetadata;
@@ -175834,7 +176284,7 @@ class FileContentCache {
175834
176284
  metadata: cached2.metadata
175835
176285
  };
175836
176286
  }
175837
- const content = await fs11.readFile(filePath, "utf-8");
176287
+ const content = await fs14.readFile(filePath, "utf-8");
175838
176288
  const metadata = await this.extractMetadata(content, filePath, options);
175839
176289
  evictOldest(this.fileCache, this.FILE_CACHE_MAX_ENTRIES - 1);
175840
176290
  this.fileCache.set(cacheKey, {
@@ -175849,7 +176299,7 @@ class FileContentCache {
175849
176299
 
175850
176300
  // ../../packages/core/dist/services/file-read/file-metadata.js
175851
176301
  init_dist();
175852
- import path22 from "path";
176302
+ import path26 from "path";
175853
176303
 
175854
176304
  class FileMetadataExtractor {
175855
176305
  symbolGraph;
@@ -175885,7 +176335,7 @@ class FileMetadataExtractor {
175885
176335
  return metadata;
175886
176336
  }
175887
176337
  detectLanguage(filePath) {
175888
- const ext2 = path22.extname(filePath).toLowerCase();
176338
+ const ext2 = path26.extname(filePath).toLowerCase();
175889
176339
  const languageMap2 = {
175890
176340
  ".ts": "TypeScript",
175891
176341
  ".tsx": "TypeScript",
@@ -176002,7 +176452,7 @@ function selectLines(lines, range) {
176002
176452
 
176003
176453
  // ../../packages/core/dist/services/file-read/path-containment.js
176004
176454
  init_dist();
176005
- import path23 from "path";
176455
+ import path27 from "path";
176006
176456
 
176007
176457
  class PathContainment {
176008
176458
  projectRoots;
@@ -176010,14 +176460,14 @@ class PathContainment {
176010
176460
  this.projectRoots = projectRoots;
176011
176461
  }
176012
176462
  async resolveFilePath(filePath, projectId) {
176013
- if (path23.isAbsolute(filePath)) {
176014
- return path23.resolve(filePath);
176463
+ if (path27.isAbsolute(filePath)) {
176464
+ return path27.resolve(filePath);
176015
176465
  }
176016
176466
  if (projectId) {
176017
176467
  const root = await this.projectRoots.getProjectRoot(projectId);
176018
176468
  if (root) {
176019
176469
  const cleaned = sanitizeFilePath(filePath);
176020
- return path23.resolve(root, cleaned);
176470
+ return path27.resolve(root, cleaned);
176021
176471
  }
176022
176472
  return null;
176023
176473
  }
@@ -176028,17 +176478,17 @@ class PathContainment {
176028
176478
  if (projectId) {
176029
176479
  const root = await this.projectRoots.getProjectRoot(projectId);
176030
176480
  if (root)
176031
- roots.push(path23.resolve(root));
176481
+ roots.push(path27.resolve(root));
176032
176482
  }
176033
- roots.push(path23.resolve(process.cwd()));
176483
+ roots.push(path27.resolve(process.cwd()));
176034
176484
  const envRoots = (process.env.MASSA_AI_READ_FILE_ROOTS ?? "").split(":").map((s) => s.trim()).filter((s) => s.length > 0);
176035
176485
  for (const extra of envRoots) {
176036
- roots.push(path23.resolve(extra));
176486
+ roots.push(path27.resolve(extra));
176037
176487
  }
176038
- const target = path23.resolve(absoluteFilePath);
176488
+ const target = path27.resolve(absoluteFilePath);
176039
176489
  for (const root of roots) {
176040
- const rel = path23.relative(root, target);
176041
- if (rel !== "" && !rel.startsWith("..") && !path23.isAbsolute(rel)) {
176490
+ const rel = path27.relative(root, target);
176491
+ if (rel !== "" && !rel.startsWith("..") && !path27.isAbsolute(rel)) {
176042
176492
  return { allowed: true };
176043
176493
  }
176044
176494
  if (rel === "")
@@ -176873,8 +177323,8 @@ init_event_bus();
176873
177323
  init_llm_client();
176874
177324
  init_symbol_graph_service();
176875
177325
  import { randomUUID as randomUUID9 } from "crypto";
176876
- import fs14 from "fs";
176877
- import path26 from "path";
177326
+ import fs17 from "fs";
177327
+ import path30 from "path";
176878
177328
  import { spawn as spawn2 } from "child_process";
176879
177329
  var FALLBACK_BOOTSTRAP = {
176880
177330
  enabled: true,
@@ -177058,9 +177508,9 @@ async function scanSignals(_projectId, projectRoot, caps, symbolGraph, gitRunner
177058
177508
  }
177059
177509
  try {
177060
177510
  for (const name26 of README_CANDIDATES) {
177061
- const p = path26.join(projectRoot, name26);
177062
- if (fs14.existsSync(p) && fs14.statSync(p).isFile()) {
177063
- const buf = fs14.readFileSync(p);
177511
+ const p = path30.join(projectRoot, name26);
177512
+ if (fs17.existsSync(p) && fs17.statSync(p).isFile()) {
177513
+ const buf = fs17.readFileSync(p);
177064
177514
  signals.readme = buf.slice(0, MAX_README_BYTES).toString("utf8");
177065
177515
  break;
177066
177516
  }
@@ -177069,14 +177519,14 @@ async function scanSignals(_projectId, projectRoot, caps, symbolGraph, gitRunner
177069
177519
  logger.debug("bootstrap scan: README read failed", { error: e.message });
177070
177520
  }
177071
177521
  try {
177072
- const docsDir = path26.join(projectRoot, "docs");
177073
- if (fs14.existsSync(docsDir) && fs14.statSync(docsDir).isDirectory()) {
177522
+ const docsDir = path30.join(projectRoot, "docs");
177523
+ if (fs17.existsSync(docsDir) && fs17.statSync(docsDir).isDirectory()) {
177074
177524
  const entries = walkMarkdown(docsDir).slice(0, MAX_DOCS);
177075
177525
  for (const rel of entries) {
177076
177526
  try {
177077
- const buf = fs14.readFileSync(rel);
177527
+ const buf = fs17.readFileSync(rel);
177078
177528
  signals.docs.push({
177079
- path: path26.relative(projectRoot, rel),
177529
+ path: path30.relative(projectRoot, rel),
177080
177530
  snippet: buf.slice(0, MAX_DOC_BYTES).toString("utf8")
177081
177531
  });
177082
177532
  } catch {}
@@ -177087,10 +177537,10 @@ async function scanSignals(_projectId, projectRoot, caps, symbolGraph, gitRunner
177087
177537
  }
177088
177538
  try {
177089
177539
  for (const name26 of MANIFEST_FILES) {
177090
- const p = path26.join(projectRoot, name26);
177091
- if (!fs14.existsSync(p) || !fs14.statSync(p).isFile())
177540
+ const p = path30.join(projectRoot, name26);
177541
+ if (!fs17.existsSync(p) || !fs17.statSync(p).isFile())
177092
177542
  continue;
177093
- const raw2 = fs14.readFileSync(p).slice(0, MAX_MANIFEST_BYTES).toString("utf8");
177543
+ const raw2 = fs17.readFileSync(p).slice(0, MAX_MANIFEST_BYTES).toString("utf8");
177094
177544
  const kind = name26;
177095
177545
  if (name26 === "package.json") {
177096
177546
  try {
@@ -177130,12 +177580,12 @@ function walkMarkdown(dir) {
177130
177580
  const cur = stack.pop();
177131
177581
  let entries;
177132
177582
  try {
177133
- entries = fs14.readdirSync(cur, { withFileTypes: true });
177583
+ entries = fs17.readdirSync(cur, { withFileTypes: true });
177134
177584
  } catch {
177135
177585
  continue;
177136
177586
  }
177137
177587
  for (const e of entries) {
177138
- const full = path26.join(cur, e.name);
177588
+ const full = path30.join(cur, e.name);
177139
177589
  if (e.isDirectory()) {
177140
177590
  if (e.name === "node_modules" || e.name.startsWith("."))
177141
177591
  continue;
@@ -178168,8 +178618,8 @@ var checkpointRoutes = new Elysia({ prefix: "/api/v1/checkpoints" }).post("/list
178168
178618
 
178169
178619
  // src/routes/project.ts
178170
178620
  init_dist();
178171
- import fs15 from "fs/promises";
178172
- import path27 from "path";
178621
+ import fs18 from "fs/promises";
178622
+ import path31 from "path";
178173
178623
  var indexProjectTool = null;
178174
178624
  var indexStatusTool = null;
178175
178625
  var projectIdentityService = null;
@@ -178378,22 +178828,22 @@ var projectRoutes = new Elysia({ prefix: "/api/v1/project" }).get("/list", async
178378
178828
  }).post("/upload-and-index", async ({ body }) => {
178379
178829
  const rawBase = body.projectId || body.projectPath.replace(/\\/g, "/").split("/").filter(Boolean).pop() || "default";
178380
178830
  const finalProjectId = rawBase.replace(/[^a-zA-Z0-9_.-]/g, "_").slice(0, 128);
178381
- const uploadRoot = process.env.MASSA_AI_UPLOAD_DIR || path27.join(getGlobalDataDir(), "uploads");
178382
- const stagingDir = path27.resolve(uploadRoot, finalProjectId);
178383
- await fs15.rm(stagingDir, { recursive: true, force: true });
178384
- await fs15.mkdir(stagingDir, { recursive: true });
178831
+ const uploadRoot = process.env.MASSA_AI_UPLOAD_DIR || path31.join(getGlobalDataDir(), "uploads");
178832
+ const stagingDir = path31.resolve(uploadRoot, finalProjectId);
178833
+ await fs18.rm(stagingDir, { recursive: true, force: true });
178834
+ await fs18.mkdir(stagingDir, { recursive: true });
178385
178835
  const WRITE_BATCH = 20;
178386
178836
  for (let i = 0;i < body.files.length; i += WRITE_BATCH) {
178387
178837
  await Promise.all(body.files.slice(i, i + WRITE_BATCH).map(async (file3) => {
178388
- if (path27.isAbsolute(file3.relativePath) || file3.relativePath.includes("..")) {
178838
+ if (path31.isAbsolute(file3.relativePath) || file3.relativePath.includes("..")) {
178389
178839
  throw new Error(`Invalid file path: ${file3.relativePath}`);
178390
178840
  }
178391
- const dest = path27.resolve(stagingDir, file3.relativePath.replace(/\//g, path27.sep));
178392
- if (!dest.startsWith(stagingDir + path27.sep)) {
178841
+ const dest = path31.resolve(stagingDir, file3.relativePath.replace(/\//g, path31.sep));
178842
+ if (!dest.startsWith(stagingDir + path31.sep)) {
178393
178843
  throw new Error(`Path escapes staging directory: ${file3.relativePath}`);
178394
178844
  }
178395
- await fs15.mkdir(path27.dirname(dest), { recursive: true });
178396
- await fs15.writeFile(dest, file3.content, "utf-8");
178845
+ await fs18.mkdir(path31.dirname(dest), { recursive: true });
178846
+ await fs18.writeFile(dest, file3.content, "utf-8");
178397
178847
  }));
178398
178848
  }
178399
178849
  return await getIndexProjectTool().handle({
@@ -178547,9 +178997,9 @@ var analyticsRoutes = new Elysia({ prefix: "/api/v1/analytics" }).post("/", asyn
178547
178997
 
178548
178998
  // src/routes/system.ts
178549
178999
  init_dist();
178550
- import path28 from "path";
178551
- import fs16 from "fs";
178552
- import os4 from "os";
179000
+ import path32 from "path";
179001
+ import fs19 from "fs";
179002
+ import os7 from "os";
178553
179003
  function databaseUrlParts() {
178554
179004
  const url2 = new URL(process.env.DATABASE_URL);
178555
179005
  return {
@@ -178580,13 +179030,13 @@ var systemRoutes = new Elysia({ prefix: "/api/v1/system" }).get("/info", async (
178580
179030
  version: "1.0.0",
178581
179031
  service: "massa-ai-tools-api",
178582
179032
  node: process.version,
178583
- platform: os4.platform(),
178584
- arch: os4.arch(),
179033
+ platform: os7.platform(),
179034
+ arch: os7.arch(),
178585
179035
  uptime: process.uptime(),
178586
179036
  memory: {
178587
- total: os4.totalmem(),
178588
- free: os4.freemem(),
178589
- used: os4.totalmem() - os4.freemem(),
179037
+ total: os7.totalmem(),
179038
+ free: os7.freemem(),
179039
+ used: os7.totalmem() - os7.freemem(),
178590
179040
  process: process.memoryUsage()
178591
179041
  },
178592
179042
  dataDir: config.get("dataDir"),
@@ -178622,11 +179072,11 @@ var systemRoutes = new Elysia({ prefix: "/api/v1/system" }).get("/info", async (
178622
179072
  description: "Check PostgreSQL, pgvector, Ollama, and local artifact directory health"
178623
179073
  }
178624
179074
  }).get("/metrics", async () => {
178625
- const metricsPath = path28.join(process.cwd(), "data", "metrics.json");
179075
+ const metricsPath = path32.join(process.cwd(), "data", "metrics.json");
178626
179076
  let metrics2 = {};
178627
- if (fs16.existsSync(metricsPath)) {
179077
+ if (fs19.existsSync(metricsPath)) {
178628
179078
  try {
178629
- metrics2 = JSON.parse(fs16.readFileSync(metricsPath, "utf-8"));
179079
+ metrics2 = JSON.parse(fs19.readFileSync(metricsPath, "utf-8"));
178630
179080
  } catch {}
178631
179081
  }
178632
179082
  const database = await getDatabaseInfo();
@@ -178776,8 +179226,8 @@ var eventsRoutes = new Elysia({ prefix: "/api/v1" }).get("/events", async ({ que
178776
179226
  });
178777
179227
 
178778
179228
  // src/routes/workspace.ts
178779
- import fs17 from "fs/promises";
178780
- import path29 from "path";
179229
+ import fs20 from "fs/promises";
179230
+ import path33 from "path";
178781
179231
  import { realpathSync as realpathSync4 } from "fs";
178782
179232
  var indexProjectTool2 = null;
178783
179233
  function getIndexProjectTool2() {
@@ -178819,7 +179269,7 @@ function realpathSafe(p) {
178819
179269
  try {
178820
179270
  return realpathSync4(p);
178821
179271
  } catch {
178822
- return path29.resolve(p);
179272
+ return path33.resolve(p);
178823
179273
  }
178824
179274
  }
178825
179275
  var graphController = null;
@@ -179170,8 +179620,8 @@ var workspaceRoutes = new Elysia({ prefix: "/api/v1" }).get("/workspace/list", a
179170
179620
  }
179171
179621
  const registeredRoot = realpathSafe(workspace.project_path);
179172
179622
  const callerRoot = realpathSafe(projectPath2);
179173
- const rel = path29.relative(registeredRoot, callerRoot);
179174
- const escapes = rel.startsWith("..") || path29.isAbsolute(rel);
179623
+ const rel = path33.relative(registeredRoot, callerRoot);
179624
+ const escapes = rel.startsWith("..") || path33.isAbsolute(rel);
179175
179625
  if (registeredRoot !== callerRoot && escapes) {
179176
179626
  return {
179177
179627
  success: false,
@@ -179301,8 +179751,8 @@ var workspaceRoutes = new Elysia({ prefix: "/api/v1" }).get("/workspace/list", a
179301
179751
  } else {
179302
179752
  end = start + 20;
179303
179753
  }
179304
- const absolutePath = path29.join(workspace.project_path, file3);
179305
- const content = await fs17.readFile(absolutePath, "utf-8");
179754
+ const absolutePath = path33.join(workspace.project_path, file3);
179755
+ const content = await fs20.readFile(absolutePath, "utf-8");
179306
179756
  const lines = content.split(/\r?\n/);
179307
179757
  const slice = lines.slice(start - 1, Math.min(lines.length, end));
179308
179758
  const formatted = slice.map((text3, idx) => ({
@@ -180217,8 +180667,8 @@ var webRoutes = new Elysia({ prefix: "/api/v1/web" }).post("/fetch_and_index", a
180217
180667
  });
180218
180668
 
180219
180669
  // src/routes/web-ui.ts
180220
- import fs18 from "fs/promises";
180221
- import path30 from "path";
180670
+ import fs21 from "fs/promises";
180671
+ import path34 from "path";
180222
180672
  import { fileURLToPath as fileURLToPath3 } from "url";
180223
180673
 
180224
180674
  // src/web-ui-trust.ts
@@ -180262,9 +180712,9 @@ function buildStaticDirCandidates(moduleDir, cwd) {
180262
180712
  for (const root2 of [moduleDir, cwd]) {
180263
180713
  let dir = root2;
180264
180714
  for (let i = 0;i < 10; i++) {
180265
- candidates2.push(path30.resolve(dir, "apps/web-ui/src/static"));
180266
- candidates2.push(path30.resolve(dir, "web-ui/src/static"));
180267
- const parent = path30.dirname(dir);
180715
+ candidates2.push(path34.resolve(dir, "apps/web-ui/src/static"));
180716
+ candidates2.push(path34.resolve(dir, "web-ui/src/static"));
180717
+ const parent = path34.dirname(dir);
180268
180718
  if (parent === dir)
180269
180719
  break;
180270
180720
  dir = parent;
@@ -180272,11 +180722,11 @@ function buildStaticDirCandidates(moduleDir, cwd) {
180272
180722
  }
180273
180723
  return [...new Set(candidates2)];
180274
180724
  }
180275
- var STATIC_DIR_CANDIDATES = buildStaticDirCandidates(path30.dirname(fileURLToPath3(import.meta.url)), process.cwd());
180725
+ var STATIC_DIR_CANDIDATES = buildStaticDirCandidates(path34.dirname(fileURLToPath3(import.meta.url)), process.cwd());
180276
180726
  async function resolveStaticDir() {
180277
180727
  for (const dir of STATIC_DIR_CANDIDATES) {
180278
180728
  try {
180279
- const st = await fs18.stat(dir);
180729
+ const st = await fs21.stat(dir);
180280
180730
  if (st.isDirectory())
180281
180731
  return dir;
180282
180732
  } catch {}
@@ -180297,7 +180747,7 @@ var CONTENT_TYPES = {
180297
180747
  ".woff2": "font/woff2"
180298
180748
  };
180299
180749
  function contentTypeFor(filePath) {
180300
- const ext2 = path30.extname(filePath).toLowerCase();
180750
+ const ext2 = path34.extname(filePath).toLowerCase();
180301
180751
  return CONTENT_TYPES[ext2] ?? "application/octet-stream";
180302
180752
  }
180303
180753
  function webUiDisabled() {
@@ -180308,13 +180758,13 @@ function webUiDisabled() {
180308
180758
  }
180309
180759
  async function resolveSafePath(staticDir, sub) {
180310
180760
  const cleaned = sub.replace(/^\/+/, "");
180311
- const abs = path30.resolve(staticDir, cleaned);
180312
- const rel = path30.relative(staticDir, abs);
180313
- if (rel.startsWith("..") || path30.isAbsolute(rel)) {
180761
+ const abs = path34.resolve(staticDir, cleaned);
180762
+ const rel = path34.relative(staticDir, abs);
180763
+ if (rel.startsWith("..") || path34.isAbsolute(rel)) {
180314
180764
  return null;
180315
180765
  }
180316
180766
  try {
180317
- await fs18.stat(abs);
180767
+ await fs21.stat(abs);
180318
180768
  return { abs, exists: true };
180319
180769
  } catch {
180320
180770
  return { abs, exists: false };
@@ -180337,7 +180787,7 @@ function injectAccessMarkup(html, apiKey, trusted) {
180337
180787
  return out;
180338
180788
  }
180339
180789
  async function readShell(indexPath, remoteAddress) {
180340
- const raw2 = await fs18.readFile(indexPath, "utf-8");
180790
+ const raw2 = await fs21.readFile(indexPath, "utf-8");
180341
180791
  const trusted = isTrustedWebUiCaller(remoteAddress);
180342
180792
  return Buffer.from(injectAccessMarkup(raw2, getConfiguredApiKey(), trusted), "utf-8");
180343
180793
  }
@@ -180354,7 +180804,7 @@ var webUiRoutes = new Elysia().get("/ui", async ({ set: set3, request }) => {
180354
180804
  set3.status = 500;
180355
180805
  return { status: 500, error: "web ui static dir not found" };
180356
180806
  }
180357
- const indexPath = path30.join(dir, "index.html");
180807
+ const indexPath = path34.join(dir, "index.html");
180358
180808
  try {
180359
180809
  const body = await readShell(indexPath, remoteAddressOf(request));
180360
180810
  set3.headers["content-type"] = contentTypeFor(indexPath);
@@ -180387,7 +180837,7 @@ var webUiRoutes = new Elysia().get("/ui", async ({ set: set3, request }) => {
180387
180837
  }
180388
180838
  if (resolved.exists) {
180389
180839
  try {
180390
- const body = await fs18.readFile(resolved.abs);
180840
+ const body = await fs21.readFile(resolved.abs);
180391
180841
  set3.headers["content-type"] = contentTypeFor(resolved.abs);
180392
180842
  return body;
180393
180843
  } catch {
@@ -180396,7 +180846,7 @@ var webUiRoutes = new Elysia().get("/ui", async ({ set: set3, request }) => {
180396
180846
  }
180397
180847
  }
180398
180848
  try {
180399
- const body = await readShell(path30.join(dir, "index.html"), remoteAddressOf(request));
180849
+ const body = await readShell(path34.join(dir, "index.html"), remoteAddressOf(request));
180400
180850
  set3.headers["content-type"] = "text/html; charset=utf-8";
180401
180851
  return body;
180402
180852
  } catch {
@@ -180539,6 +180989,89 @@ var dashboardRoutes = new Elysia({ prefix: "/api/v1" }).get("/scheduler/status",
180539
180989
  }
180540
180990
  });
180541
180991
 
180992
+ // src/routes/profiles.ts
180993
+ init_dist();
180994
+ var PROFILE_DETAIL = {
180995
+ tags: ["profiles"]
180996
+ };
180997
+ function isNamedError(e) {
180998
+ return e instanceof Error && typeof e.name === "string";
180999
+ }
181000
+ function statusFor(err) {
181001
+ switch (err.name) {
181002
+ case "UnknownProfileError":
181003
+ return 400;
181004
+ case "NoHostsDetectedError":
181005
+ return 404;
181006
+ default:
181007
+ break;
181008
+ }
181009
+ if (err instanceof LockError)
181010
+ return 409;
181011
+ if (err instanceof InstallStateError)
181012
+ return 500;
181013
+ return 500;
181014
+ }
181015
+ function errorBody(err) {
181016
+ return { success: false, error: { code: err.name, message: err.message } };
181017
+ }
181018
+ function validHost(value) {
181019
+ if (value === undefined)
181020
+ return;
181021
+ if (typeof value === "string" && isHost(value))
181022
+ return value;
181023
+ return;
181024
+ }
181025
+ var profileRoutes = new Elysia({ prefix: "/api/v1/profiles" }).get("/", ({ query, set: set3 }) => {
181026
+ const hostParam = query.host;
181027
+ if (hostParam !== undefined && !isHost(hostParam)) {
181028
+ set3.status = 400;
181029
+ return { success: false, error: { code: "InvalidHostError", message: `unknown host "${hostParam}"` } };
181030
+ }
181031
+ try {
181032
+ const inventory = listProfiles(hostParam ? { hosts: [hostParam] } : {});
181033
+ set3.status = 200;
181034
+ return { success: true, data: inventory };
181035
+ } catch (e) {
181036
+ const err = isNamedError(e) ? e : { name: "Error", message: String(e) };
181037
+ set3.status = statusFor(err);
181038
+ return errorBody(err);
181039
+ }
181040
+ }, {
181041
+ query: t.Object({ host: t.Optional(t.String()) }),
181042
+ detail: {
181043
+ ...PROFILE_DETAIL,
181044
+ summary: "List shipped profiles + per-host active profile",
181045
+ description: "Returns the shipped profile names, per-host active profile (from recorded state; 'balanced' shown when unrecorded), and per-host bundle version. Offline \u2014 reads on-disk variant directories only, never the registry."
181046
+ }
181047
+ }).post("/switch", ({ body, set: set3 }) => {
181048
+ const { profile, host, dryRun } = body;
181049
+ if (host !== undefined && !isHost(host)) {
181050
+ set3.status = 400;
181051
+ return { success: false, error: { code: "InvalidHostError", message: `unknown host "${host}"` } };
181052
+ }
181053
+ try {
181054
+ const report = switchProfile({ profile, host: validHost(host), dryRun });
181055
+ set3.status = 200;
181056
+ return { success: true, data: report };
181057
+ } catch (e) {
181058
+ const err = isNamedError(e) ? e : { name: "Error", message: String(e) };
181059
+ set3.status = statusFor(err);
181060
+ return errorBody(err);
181061
+ }
181062
+ }, {
181063
+ body: t.Object({
181064
+ profile: t.String({ description: "Target profile name" }),
181065
+ host: t.Optional(t.String({ description: "Limit the switch to a single host" })),
181066
+ dryRun: t.Optional(t.Boolean({ description: "Print the per-host plan; change nothing" }))
181067
+ }),
181068
+ detail: {
181069
+ ...PROFILE_DETAIL,
181070
+ summary: "Switch installed agents to a profile",
181071
+ description: "Mutates the machine this server runs on: replaces the active installed agent files for every detected, supported host with the chosen profile's variant, and reports per host: switched / skipped (reason) / failed (reason). A session restart is required for the change to take effect. Local trust model \u2014 same as the executor routes."
181072
+ }
181073
+ });
181074
+
180542
181075
  // src/middleware/error.ts
180543
181076
  var errorHandler = new Elysia({ name: "error-handler" }).onError(({ code, error: error51, set: set3 }) => {
180544
181077
  console.error("[massa-ai-api] Request failed", {
@@ -180633,7 +181166,8 @@ var app = new Elysia({ adapter: node() }).use(cors(buildCorsOptions(config.get("
180633
181166
  { name: "proposals", description: "Auto-improvement proposal list/approve/reject" },
180634
181167
  { name: "executor", description: "Polyglot sandbox: execute code, run code over files, batch shell commands" },
180635
181168
  { name: "web", description: "SSRF-guarded web fetch + HTML\u2192md + index (fetch_and_index)" },
180636
- { name: "webUi", description: "Read-only memory/search web browser (Phase 8)" }
181169
+ { name: "webUi", description: "Read-only memory/search web browser (Phase 8)" },
181170
+ { name: "profiles", description: "Model-profile switch: list shipped profiles, switch installed agents" }
180637
181171
  ],
180638
181172
  components: {
180639
181173
  securitySchemes: {
@@ -180647,7 +181181,7 @@ var app = new Elysia({ adapter: node() }).use(cors(buildCorsOptions(config.get("
180647
181181
  },
180648
181182
  security: [{ ApiKeyAuth: [] }]
180649
181183
  }
180650
- })).use(errorHandler).use(authMiddleware).use(searchRoutes).use(memoryRoutes).use(checkpointRoutes).use(projectRoutes).use(contextRoutes).use(analyticsRoutes).use(systemRoutes).use(eventsRoutes).use(workspaceRoutes).use(fileRoutes).use(synapseRoutes).use(hookRoutes).use(bootstrapRoutes).use(handoffRoutes).use(proposalRoutes).use(executorRoutes).use(webRoutes).use(webUiRoutes).use(architectureRoutes).use(dashboardRoutes).get("/health", () => buildHealthResponse(getParserReadiness()));
181184
+ })).use(errorHandler).use(authMiddleware).use(searchRoutes).use(memoryRoutes).use(checkpointRoutes).use(projectRoutes).use(contextRoutes).use(analyticsRoutes).use(systemRoutes).use(eventsRoutes).use(workspaceRoutes).use(fileRoutes).use(synapseRoutes).use(hookRoutes).use(bootstrapRoutes).use(handoffRoutes).use(proposalRoutes).use(executorRoutes).use(webRoutes).use(webUiRoutes).use(architectureRoutes).use(dashboardRoutes).use(profileRoutes).get("/health", () => buildHealthResponse(getParserReadiness()));
180651
181185
  initAuthOrExit();
180652
181186
  warnIfTrustOverrideEnabled();
180653
181187
  await listenAfterParserValidation({