repomind 0.9.2 → 0.11.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 +267 -186
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -260,8 +260,8 @@ function getFramesFromEvent(event) {
260
260
  }
261
261
  return void 0;
262
262
  }
263
- function normalizeStackTracePath(path) {
264
- let filename = path?.startsWith("file://") ? path.slice(7) : path;
263
+ function normalizeStackTracePath(path2) {
264
+ let filename = path2?.startsWith("file://") ? path2.slice(7) : path2;
265
265
  if (filename?.match(/\/[A-Z]:/)) {
266
266
  filename = filename.slice(1);
267
267
  }
@@ -2231,8 +2231,8 @@ function isValidProtocol(protocol) {
2231
2231
  return protocol === "http" || protocol === "https";
2232
2232
  }
2233
2233
  function dsnToString(dsn2, withPassword = false) {
2234
- const { host, path, pass, port, projectId, protocol, publicKey } = dsn2;
2235
- return `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ""}@${host}${port ? `:${port}` : ""}/${path ? `${path}/` : path}${projectId}`;
2234
+ const { host, path: path2, pass, port, projectId, protocol, publicKey } = dsn2;
2235
+ return `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ""}@${host}${port ? `:${port}` : ""}/${path2 ? `${path2}/` : path2}${projectId}`;
2236
2236
  }
2237
2237
  function dsnFromString(str) {
2238
2238
  const match = DSN_REGEX.exec(str);
@@ -2243,11 +2243,11 @@ function dsnFromString(str) {
2243
2243
  return void 0;
2244
2244
  }
2245
2245
  const [protocol, publicKey, pass = "", host = "", port = "", lastPath = ""] = match.slice(1);
2246
- let path = "";
2246
+ let path2 = "";
2247
2247
  let projectId = lastPath;
2248
2248
  const split = projectId.split("/");
2249
2249
  if (split.length > 1) {
2250
- path = split.slice(0, -1).join("/");
2250
+ path2 = split.slice(0, -1).join("/");
2251
2251
  projectId = split.pop();
2252
2252
  }
2253
2253
  if (projectId) {
@@ -2256,7 +2256,7 @@ function dsnFromString(str) {
2256
2256
  projectId = projectMatch[0];
2257
2257
  }
2258
2258
  }
2259
- return dsnFromComponents({ host, pass, path, projectId, port, protocol, publicKey });
2259
+ return dsnFromComponents({ host, pass, path: path2, projectId, port, protocol, publicKey });
2260
2260
  }
2261
2261
  function dsnFromComponents(components) {
2262
2262
  return {
@@ -4348,9 +4348,9 @@ function stripUrlQueryAndFragment(urlPath) {
4348
4348
  return urlPath.split(/[?#]/, 1)[0];
4349
4349
  }
4350
4350
  function getSanitizedUrlString(url) {
4351
- const { protocol, host, path } = url;
4351
+ const { protocol, host, path: path2 } = url;
4352
4352
  const filteredHost = host?.replace(/^.*@/, "[filtered]:[filtered]@").replace(/(:80)$/, "").replace(/(:443)$/, "") || "";
4353
- return `${protocol ? `${protocol}://` : ""}${filteredHost}${path}`;
4353
+ return `${protocol ? `${protocol}://` : ""}${filteredHost}${path2}`;
4354
4354
  }
4355
4355
  function stripDataUrlContent(url, includeDataPrefix = true) {
4356
4356
  if (url.startsWith("data:")) {
@@ -8697,12 +8697,12 @@ function resolve(...args2) {
8697
8697
  let resolvedPath = "";
8698
8698
  let resolvedAbsolute = false;
8699
8699
  for (let i = args2.length - 1; i >= -1 && !resolvedAbsolute; i--) {
8700
- const path = i >= 0 ? args2[i] : "/";
8701
- if (!path) {
8700
+ const path2 = i >= 0 ? args2[i] : "/";
8701
+ if (!path2) {
8702
8702
  continue;
8703
8703
  }
8704
- resolvedPath = `${path}/${resolvedPath}`;
8705
- resolvedAbsolute = path.charAt(0) === "/";
8704
+ resolvedPath = `${path2}/${resolvedPath}`;
8705
+ resolvedAbsolute = path2.charAt(0) === "/";
8706
8706
  }
8707
8707
  resolvedPath = normalizeArray(
8708
8708
  resolvedPath.split("/").filter((p) => !!p),
@@ -8748,8 +8748,8 @@ function relative(from, to) {
8748
8748
  outputParts = outputParts.concat(toParts.slice(samePartsLength));
8749
8749
  return outputParts.join("/");
8750
8750
  }
8751
- function dirname(path) {
8752
- const result = splitPath(path);
8751
+ function dirname(path2) {
8752
+ const result = splitPath(path2);
8753
8753
  const root = result[0] || "";
8754
8754
  let dir = result[1];
8755
8755
  if (!root && !dir) {
@@ -8760,8 +8760,8 @@ function dirname(path) {
8760
8760
  }
8761
8761
  return root + dir;
8762
8762
  }
8763
- function basename(path, ext) {
8764
- let f = splitPath(path)[2] || "";
8763
+ function basename(path2, ext) {
8764
+ let f = splitPath(path2)[2] || "";
8765
8765
  if (ext && f.slice(ext.length * -1) === ext) {
8766
8766
  f = f.slice(0, f.length - ext.length);
8767
8767
  }
@@ -9260,8 +9260,8 @@ function flattenIssue(issue) {
9260
9260
  unionErrors: "unionErrors" in issue ? JSON.stringify(issue.unionErrors) : void 0
9261
9261
  };
9262
9262
  }
9263
- function flattenIssuePath(path) {
9264
- return path.map((p) => {
9263
+ function flattenIssuePath(path2) {
9264
+ return path2.map((p) => {
9265
9265
  if (typeof p === "number") {
9266
9266
  return "<array>";
9267
9267
  } else {
@@ -13868,12 +13868,12 @@ function captureIfError(nextResult) {
13868
13868
  }
13869
13869
  function trpcMiddleware(options = {}) {
13870
13870
  return async function(opts) {
13871
- const { path, type, next, rawInput, getRawInput } = opts;
13871
+ const { path: path2, type, next, rawInput, getRawInput } = opts;
13872
13872
  const client = getClient();
13873
13873
  const clientOptions = client?.getOptions();
13874
13874
  const dataCollection = client?.getDataCollectionOptions();
13875
13875
  const trpcContext = {
13876
- procedure_path: path,
13876
+ procedure_path: path2,
13877
13877
  procedure_type: type
13878
13878
  };
13879
13879
  setNormalizationDepthOverrideHint(
@@ -13898,7 +13898,7 @@ function trpcMiddleware(options = {}) {
13898
13898
  scope.setContext("trpc", trpcContext);
13899
13899
  return startSpanManual(
13900
13900
  {
13901
- name: `trpc/${path}`,
13901
+ name: `trpc/${path2}`,
13902
13902
  op: "rpc.server",
13903
13903
  attributes: {
13904
13904
  [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "route",
@@ -15150,7 +15150,7 @@ function getActualMatchedRoute(req, constructedRoute) {
15150
15150
  if (layersStore.length === 0) {
15151
15151
  return void 0;
15152
15152
  }
15153
- if (layersStore.every((path) => path === "/")) {
15153
+ if (layersStore.every((path2) => path2 === "/")) {
15154
15154
  return req.originalUrl === "/" ? "/" : void 0;
15155
15155
  }
15156
15156
  if (constructedRoute === "*") {
@@ -15166,11 +15166,11 @@ function getActualMatchedRoute(req, constructedRoute) {
15166
15166
  function getConstructedRoute(req) {
15167
15167
  const layersStore = getStoredLayers(req);
15168
15168
  let constructedRoute = "";
15169
- for (const path of layersStore) {
15170
- if (path === "/" || path === "/*") {
15169
+ for (const path2 of layersStore) {
15170
+ if (path2 === "/" || path2 === "/*") {
15171
15171
  continue;
15172
15172
  }
15173
- constructedRoute += !constructedRoute || constructedRoute.endsWith("/") ? path : `/${path}`;
15173
+ constructedRoute += !constructedRoute || constructedRoute.endsWith("/") ? path2 : `/${path2}`;
15174
15174
  }
15175
15175
  return constructedRoute.replace(/\/{2,}/g, "/");
15176
15176
  }
@@ -15218,15 +15218,15 @@ var init_utils10 = __esm({
15218
15218
  };
15219
15219
  }
15220
15220
  };
15221
- getRouterPath = (path, layer) => {
15221
+ getRouterPath = (path2, layer) => {
15222
15222
  const stackLayer = Array.isArray(layer.handle?.stack) ? layer.handle?.stack?.[0] : void 0;
15223
15223
  if (stackLayer?.route?.path) {
15224
- return `${path}${stackLayer.route.path}`;
15224
+ return `${path2}${stackLayer.route.path}`;
15225
15225
  }
15226
15226
  if (stackLayer && Array.isArray(stackLayer?.handle?.stack)) {
15227
- return getRouterPath(path, stackLayer);
15227
+ return getRouterPath(path2, stackLayer);
15228
15228
  }
15229
- return path;
15229
+ return path2;
15230
15230
  };
15231
15231
  isLayerIgnored = (name, type, config3) => {
15232
15232
  if (Array.isArray(config3?.ignoreLayersType) && config3?.ignoreLayersType?.includes(type)) {
@@ -15817,8 +15817,8 @@ function getRequestUrlObject(requestOptions) {
15817
15817
  const hostHeader = requestOptions.headers?.host && String(requestOptions.headers?.host);
15818
15818
  const hostname2 = hostHeader || requestOptions.hostname || requestOptions.host || "";
15819
15819
  const port = !requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 || /^(.*):(\d+)$/.test(hostname2) ? "" : `:${requestOptions.port}`;
15820
- const path = requestOptions.path ? requestOptions.path : "/";
15821
- return new URL(path, `${protocol}//${hostname2}${port}`);
15820
+ const path2 = requestOptions.path ? requestOptions.path : "/";
15821
+ return new URL(path2, `${protocol}//${hostname2}${port}`);
15822
15822
  }
15823
15823
  function getRequestUrlFromClientRequest(request2) {
15824
15824
  return String(getRequestUrl(getRequestOptions(request2)));
@@ -16576,11 +16576,11 @@ function shouldIgnoreSpansForIncomingRequest(request2, {
16576
16576
  return false;
16577
16577
  }
16578
16578
  function isStaticAssetRequest(urlPath) {
16579
- const path = stripUrlQueryAndFragment(urlPath);
16580
- if (path.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)) {
16579
+ const path2 = stripUrlQueryAndFragment(urlPath);
16580
+ if (path2.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)) {
16581
16581
  return true;
16582
16582
  }
16583
- if (path.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/)) {
16583
+ if (path2.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/)) {
16584
16584
  return true;
16585
16585
  }
16586
16586
  return false;
@@ -20084,19 +20084,19 @@ var require_module_details_from_path = __commonJS({
20084
20084
  basedir += segments[i] + sep2;
20085
20085
  }
20086
20086
  }
20087
- var path = "";
20087
+ var path2 = "";
20088
20088
  var lastSegmentIndex = segments.length - 1;
20089
20089
  for (var i2 = index + offset; i2 <= lastSegmentIndex; i2++) {
20090
20090
  if (i2 === lastSegmentIndex) {
20091
- path += segments[i2];
20091
+ path2 += segments[i2];
20092
20092
  } else {
20093
- path += segments[i2] + sep2;
20093
+ path2 += segments[i2] + sep2;
20094
20094
  }
20095
20095
  }
20096
20096
  return {
20097
20097
  name,
20098
20098
  basedir,
20099
- path
20099
+ path: path2
20100
20100
  };
20101
20101
  };
20102
20102
  }
@@ -20106,7 +20106,7 @@ var require_module_details_from_path = __commonJS({
20106
20106
  var require_require_in_the_middle = __commonJS({
20107
20107
  "../../node_modules/.bun/require-in-the-middle@8.0.1/node_modules/require-in-the-middle/index.js"(exports, module2) {
20108
20108
  "use strict";
20109
- var path = __require("path");
20109
+ var path2 = __require("path");
20110
20110
  var Module = __require("module");
20111
20111
  var debug4 = require_src2()("require-in-the-middle");
20112
20112
  var moduleDetailsFromPath = require_module_details_from_path();
@@ -20251,7 +20251,7 @@ var require_require_in_the_middle = __commonJS({
20251
20251
  }
20252
20252
  moduleName = filename;
20253
20253
  } else if (hasWhitelist === true && modules.includes(filename)) {
20254
- const parsedPath = path.parse(filename);
20254
+ const parsedPath = path2.parse(filename);
20255
20255
  moduleName = parsedPath.name;
20256
20256
  basedir = parsedPath.dir;
20257
20257
  } else {
@@ -20289,7 +20289,7 @@ var require_require_in_the_middle = __commonJS({
20289
20289
  }
20290
20290
  if (res !== filename) {
20291
20291
  if (internals === true) {
20292
- moduleName = moduleName + path.sep + path.relative(basedir, filename);
20292
+ moduleName = moduleName + path2.sep + path2.relative(basedir, filename);
20293
20293
  debug4("preparing to process require of internal file: %s", moduleName);
20294
20294
  } else {
20295
20295
  debug4("ignoring require of non-main module file: %s", res);
@@ -20325,8 +20325,8 @@ var require_require_in_the_middle = __commonJS({
20325
20325
  }
20326
20326
  };
20327
20327
  function resolveModuleName(stat) {
20328
- const normalizedPath = path.sep !== "/" ? stat.path.split(path.sep).join("/") : stat.path;
20329
- return path.posix.join(stat.name, normalizedPath).replace(normalize2, "");
20328
+ const normalizedPath = path2.sep !== "/" ? stat.path.split(path2.sep).join("/") : stat.path;
20329
+ return path2.posix.join(stat.name, normalizedPath).replace(normalize2, "");
20330
20330
  }
20331
20331
  }
20332
20332
  });
@@ -20411,7 +20411,7 @@ var require_RequireInTheMiddleSingleton = __commonJS({
20411
20411
  Object.defineProperty(exports, "__esModule", { value: true });
20412
20412
  exports.RequireInTheMiddleSingleton = void 0;
20413
20413
  var require_in_the_middle_1 = require_require_in_the_middle();
20414
- var path = __require("path");
20414
+ var path2 = __require("path");
20415
20415
  var ModuleNameTrie_1 = require_ModuleNameTrie();
20416
20416
  var isMocha = [
20417
20417
  "afterEach",
@@ -20475,7 +20475,7 @@ var require_RequireInTheMiddleSingleton = __commonJS({
20475
20475
  };
20476
20476
  exports.RequireInTheMiddleSingleton = RequireInTheMiddleSingleton;
20477
20477
  function normalizePathSeparators(moduleNameOrPath) {
20478
- return path.sep !== ModuleNameTrie_1.ModuleNameSeparator ? moduleNameOrPath.split(path.sep).join(ModuleNameTrie_1.ModuleNameSeparator) : moduleNameOrPath;
20478
+ return path2.sep !== ModuleNameTrie_1.ModuleNameSeparator ? moduleNameOrPath.split(path2.sep).join(ModuleNameTrie_1.ModuleNameSeparator) : moduleNameOrPath;
20479
20479
  }
20480
20480
  }
20481
20481
  });
@@ -20536,7 +20536,7 @@ var require_register = __commonJS({
20536
20536
  // ../../node_modules/.bun/import-in-the-middle@3.0.1/node_modules/import-in-the-middle/index.js
20537
20537
  var require_import_in_the_middle = __commonJS({
20538
20538
  "../../node_modules/.bun/import-in-the-middle@3.0.1/node_modules/import-in-the-middle/index.js"(exports, module2) {
20539
- var path = __require("path");
20539
+ var path2 = __require("path");
20540
20540
  var moduleDetailsFromPath = require_module_details_from_path();
20541
20541
  var { fileURLToPath } = __require("url");
20542
20542
  var { MessageChannel: MessageChannel2 } = __require("worker_threads");
@@ -20655,7 +20655,7 @@ var require_import_in_the_middle = __commonJS({
20655
20655
  } else if (baseDir.endsWith(specifiers.get(loadUrl)) || isTurbopackSpecifier(specifiers.get(loadUrl), baseDir)) {
20656
20656
  callHookFn(hookFn, namespace, name, baseDir);
20657
20657
  } else if (internals) {
20658
- const internalPath = name + path.sep + path.relative(baseDir, filePath);
20658
+ const internalPath = name + path2.sep + path2.relative(baseDir, filePath);
20659
20659
  callHookFn(hookFn, namespace, internalPath, baseDir);
20660
20660
  }
20661
20661
  } else if (matchArg === specifier) {
@@ -20730,7 +20730,7 @@ var require_instrumentation2 = __commonJS({
20730
20730
  "use strict";
20731
20731
  Object.defineProperty(exports, "__esModule", { value: true });
20732
20732
  exports.InstrumentationBase = void 0;
20733
- var path = __require("path");
20733
+ var path2 = __require("path");
20734
20734
  var util_1 = __require("util");
20735
20735
  var semver_1 = require_semver();
20736
20736
  var shimmer_1 = require_shimmer();
@@ -20831,7 +20831,7 @@ var require_instrumentation2 = __commonJS({
20831
20831
  }
20832
20832
  _extractPackageVersion(baseDir) {
20833
20833
  try {
20834
- const json = (0, fs_1.readFileSync)(path.join(baseDir, "package.json"), {
20834
+ const json = (0, fs_1.readFileSync)(path2.join(baseDir, "package.json"), {
20835
20835
  encoding: "utf8"
20836
20836
  });
20837
20837
  const version = JSON.parse(json).version;
@@ -20873,7 +20873,7 @@ var require_instrumentation2 = __commonJS({
20873
20873
  return exports2;
20874
20874
  }
20875
20875
  const files = module3.files ?? [];
20876
- const normalizedName = path.normalize(name);
20876
+ const normalizedName = path2.normalize(name);
20877
20877
  const supportedFileInstrumentations = files.filter((f) => f.name === normalizedName && isSupported(f.supportedVersions, version, module3.includePrerelease));
20878
20878
  return supportedFileInstrumentations.reduce((patchedExports, file) => {
20879
20879
  file.moduleExports = patchedExports;
@@ -20919,8 +20919,8 @@ var require_instrumentation2 = __commonJS({
20919
20919
  this._warnOnPreloadedModules();
20920
20920
  for (const module3 of this._modules) {
20921
20921
  const hookFn = (exports2, name, baseDir) => {
20922
- if (!baseDir && path.isAbsolute(name)) {
20923
- const parsedPath = path.parse(name);
20922
+ if (!baseDir && path2.isAbsolute(name)) {
20923
+ const parsedPath = path2.parse(name);
20924
20924
  name = parsedPath.name;
20925
20925
  baseDir = parsedPath.dir;
20926
20926
  }
@@ -20929,7 +20929,7 @@ var require_instrumentation2 = __commonJS({
20929
20929
  const onRequire = (exports2, name, baseDir) => {
20930
20930
  return this._onRequire(module3, exports2, name, baseDir);
20931
20931
  };
20932
- const hook = path.isAbsolute(module3.name) ? new require_in_the_middle_1.Hook([module3.name], { internals: true }, onRequire) : this._requireInTheMiddleSingleton.register(module3.name, onRequire);
20932
+ const hook = path2.isAbsolute(module3.name) ? new require_in_the_middle_1.Hook([module3.name], { internals: true }, onRequire) : this._requireInTheMiddleSingleton.register(module3.name, onRequire);
20933
20933
  this._hooks.push(hook);
20934
20934
  const esmHook = new import_in_the_middle_1.Hook([module3.name], { internals: true }, hookFn);
20935
20935
  this._hooks.push(esmHook);
@@ -24883,11 +24883,11 @@ function isKnownPrefetchRequest2(req) {
24883
24883
  return req.headers["next-router-prefetch"] === "1";
24884
24884
  }
24885
24885
  function isStaticAssetRequest2(urlPath) {
24886
- const path = stripUrlQueryAndFragment(urlPath);
24887
- if (path.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)) {
24886
+ const path2 = stripUrlQueryAndFragment(urlPath);
24887
+ if (path2.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)) {
24888
24888
  return true;
24889
24889
  }
24890
- if (path.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/)) {
24890
+ if (path2.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/)) {
24891
24891
  return true;
24892
24892
  }
24893
24893
  return false;
@@ -25425,19 +25425,19 @@ function getBreadcrumbData(request2) {
25425
25425
  return {};
25426
25426
  }
25427
25427
  }
25428
- function getAbsoluteUrl2(origin, path = "/") {
25428
+ function getAbsoluteUrl2(origin, path2 = "/") {
25429
25429
  try {
25430
- const url = new URL(path, origin);
25430
+ const url = new URL(path2, origin);
25431
25431
  return url.toString();
25432
25432
  } catch {
25433
25433
  const url = `${origin}`;
25434
- if (url.endsWith("/") && path.startsWith("/")) {
25435
- return `${url}${path.slice(1)}`;
25434
+ if (url.endsWith("/") && path2.startsWith("/")) {
25435
+ return `${url}${path2.slice(1)}`;
25436
25436
  }
25437
- if (!url.endsWith("/") && !path.startsWith("/")) {
25438
- return `${url}/${path}`;
25437
+ if (!url.endsWith("/") && !path2.startsWith("/")) {
25438
+ return `${url}/${path2}`;
25439
25439
  }
25440
- return `${url}${path}`;
25440
+ return `${url}${path2}`;
25441
25441
  }
25442
25442
  }
25443
25443
  var SENTRY_TRACE_HEADER, SENTRY_BAGGAGE_HEADER, W3C_TRACEPARENT_HEADER;
@@ -25990,9 +25990,9 @@ var require_getMachineId_linux = __commonJS({
25990
25990
  var api_1 = (init_esm2(), __toCommonJS(esm_exports));
25991
25991
  async function getMachineId() {
25992
25992
  const paths = ["/etc/machine-id", "/var/lib/dbus/machine-id"];
25993
- for (const path of paths) {
25993
+ for (const path2 of paths) {
25994
25994
  try {
25995
- const result = await fs_1.promises.readFile(path, { encoding: "utf8" });
25995
+ const result = await fs_1.promises.readFile(path2, { encoding: "utf8" });
25996
25996
  return result.trim();
25997
25997
  } catch (e) {
25998
25998
  api_1.diag.debug(`error reading machine id: ${e}`);
@@ -30077,12 +30077,12 @@ function emplace(map, key, contents) {
30077
30077
  }
30078
30078
  return value;
30079
30079
  }
30080
- function shouldSkipContextLinesForFile(path) {
30081
- if (path.startsWith("node:")) return true;
30082
- if (path.endsWith(".min.js")) return true;
30083
- if (path.endsWith(".min.cjs")) return true;
30084
- if (path.endsWith(".min.mjs")) return true;
30085
- if (path.startsWith("data:")) return true;
30080
+ function shouldSkipContextLinesForFile(path2) {
30081
+ if (path2.startsWith("node:")) return true;
30082
+ if (path2.endsWith(".min.js")) return true;
30083
+ if (path2.endsWith(".min.cjs")) return true;
30084
+ if (path2.endsWith(".min.mjs")) return true;
30085
+ if (path2.startsWith("data:")) return true;
30086
30086
  return false;
30087
30087
  }
30088
30088
  function shouldSkipContextLinesForFrame(frame) {
@@ -30130,9 +30130,9 @@ function makeLineReaderRanges(lines, linecontext) {
30130
30130
  }
30131
30131
  return out;
30132
30132
  }
30133
- function getContextLinesFromFile(path, ranges, output) {
30133
+ function getContextLinesFromFile(path2, ranges, output) {
30134
30134
  return new Promise((resolve2, _reject) => {
30135
- const stream = createReadStream(path);
30135
+ const stream = createReadStream(path2);
30136
30136
  const lineReaded = createInterface({
30137
30137
  input: stream
30138
30138
  });
@@ -30150,8 +30150,8 @@ function getContextLinesFromFile(path, ranges, output) {
30150
30150
  let rangeStart = range[0];
30151
30151
  let rangeEnd = range[1];
30152
30152
  function onStreamError(e) {
30153
- LRU_FILE_CONTENTS_FS_READ_FAILED.set(path, 1);
30154
- DEBUG_BUILD2 && debug.error(`Failed to read file: ${path}. Error: ${e}`);
30153
+ LRU_FILE_CONTENTS_FS_READ_FAILED.set(path2, 1);
30154
+ DEBUG_BUILD2 && debug.error(`Failed to read file: ${path2}. Error: ${e}`);
30155
30155
  lineReaded.close();
30156
30156
  lineReaded.removeAllListeners();
30157
30157
  destroyStreamAndResolve();
@@ -30835,8 +30835,8 @@ function collectRequireModules() {
30835
30835
  const paths = getRequireCachePaths();
30836
30836
  const infos = {};
30837
30837
  const seen = /* @__PURE__ */ new Set();
30838
- paths.forEach((path) => {
30839
- let dir = path;
30838
+ paths.forEach((path2) => {
30839
+ let dir = path2;
30840
30840
  const updir = () => {
30841
30841
  const orig = dir;
30842
30842
  dir = dirname2(orig);
@@ -31769,8 +31769,8 @@ var init_spotlight2 = __esm({
31769
31769
 
31770
31770
  // ../../node_modules/.bun/@sentry+node-core@10.55.0+17ff94b4ca8021f4/node_modules/@sentry/node-core/build/esm/utils/module.js
31771
31771
  import { posix, sep } from "node:path";
31772
- function normalizeWindowsPath(path) {
31773
- return path.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
31772
+ function normalizeWindowsPath(path2) {
31773
+ return path2.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
31774
31774
  }
31775
31775
  function createGetModuleFromFilename(basePath = process.argv[1] ? dirname(process.argv[1]) : process.cwd(), isWindows3 = sep === "\\") {
31776
31776
  const normalizedBase = isWindows3 ? normalizeWindowsPath(basePath) : basePath;
@@ -33552,15 +33552,15 @@ var init_undici = __esm({
33552
33552
  });
33553
33553
 
33554
33554
  // ../../node_modules/.bun/@sentry+node@10.55.0/node_modules/@sentry/node/build/esm/integrations/node-fetch/index.js
33555
- function getAbsoluteUrl3(origin, path = "/") {
33555
+ function getAbsoluteUrl3(origin, path2 = "/") {
33556
33556
  const url = `${origin}`;
33557
- if (url.endsWith("/") && path.startsWith("/")) {
33558
- return `${url}${path.slice(1)}`;
33557
+ if (url.endsWith("/") && path2.startsWith("/")) {
33558
+ return `${url}${path2.slice(1)}`;
33559
33559
  }
33560
- if (!url.endsWith("/") && !path.startsWith("/")) {
33561
- return `${url}/${path}`;
33560
+ if (!url.endsWith("/") && !path2.startsWith("/")) {
33561
+ return `${url}/${path2}`;
33562
33562
  }
33563
- return `${url}${path}`;
33563
+ return `${url}${path2}`;
33564
33564
  }
33565
33565
  function _shouldInstrumentSpans(options, clientOptions = {}) {
33566
33566
  return typeof options.spans === "boolean" ? options.spans : !clientOptions.skipOpenTelemetrySetup && hasSpansEnabled(clientOptions);
@@ -34030,8 +34030,8 @@ var init_instrumentation = __esm({
34030
34030
  }
34031
34031
  };
34032
34032
  const functionWithOriginalProperties = patchedFunctionWithOriginalProperties(patchedFunction, original);
34033
- const promisified = function(path) {
34034
- return new Promise((resolve2) => functionWithOriginalProperties(path, resolve2));
34033
+ const promisified = function(path2) {
34034
+ return new Promise((resolve2) => functionWithOriginalProperties(path2, resolve2));
34035
34035
  };
34036
34036
  Object.defineProperty(promisified, "name", { value: functionName });
34037
34037
  Object.defineProperty(functionWithOriginalProperties, promisify2.custom, {
@@ -35251,23 +35251,23 @@ function addSpanSource(span, loc, allowValues, start, end) {
35251
35251
  const source = getSourceFromLocation(loc, allowValues, start, end);
35252
35252
  span.setAttribute(AttributeNames2.SOURCE, source);
35253
35253
  }
35254
- function createFieldIfNotExists(tracer, getConfig3, contextValue, info3, path) {
35255
- let field = getField(contextValue, path);
35254
+ function createFieldIfNotExists(tracer, getConfig3, contextValue, info3, path2) {
35255
+ let field = getField(contextValue, path2);
35256
35256
  if (field) {
35257
35257
  return { field, spanAdded: false };
35258
35258
  }
35259
35259
  const config3 = getConfig3();
35260
- const parentSpan = config3.flatResolveSpans ? getRootSpan2(contextValue) : getParentFieldSpan(contextValue, path);
35260
+ const parentSpan = config3.flatResolveSpans ? getRootSpan2(contextValue) : getParentFieldSpan(contextValue, path2);
35261
35261
  field = {
35262
- span: createResolverSpan(tracer, getConfig3, contextValue, info3, path, parentSpan)
35262
+ span: createResolverSpan(tracer, getConfig3, contextValue, info3, path2, parentSpan)
35263
35263
  };
35264
- addField(contextValue, path, field);
35264
+ addField(contextValue, path2, field);
35265
35265
  return { field, spanAdded: true };
35266
35266
  }
35267
- function createResolverSpan(tracer, getConfig3, contextValue, info3, path, parentSpan) {
35267
+ function createResolverSpan(tracer, getConfig3, contextValue, info3, path2, parentSpan) {
35268
35268
  const attributes = {
35269
35269
  [AttributeNames2.FIELD_NAME]: info3.fieldName,
35270
- [AttributeNames2.FIELD_PATH]: path.join("."),
35270
+ [AttributeNames2.FIELD_PATH]: path2.join("."),
35271
35271
  [AttributeNames2.FIELD_TYPE]: info3.returnType.toString(),
35272
35272
  [AttributeNames2.PARENT_NAME]: info3.parentType.name
35273
35273
  };
@@ -35301,15 +35301,15 @@ function getOperation(document2, operationName) {
35301
35301
  return document2.definitions.find((definition) => OPERATION_VALUES.indexOf(definition?.operation) !== -1);
35302
35302
  }
35303
35303
  }
35304
- function addField(contextValue, path, field) {
35305
- return contextValue[OTEL_GRAPHQL_DATA_SYMBOL].fields[path.join(".")] = field;
35304
+ function addField(contextValue, path2, field) {
35305
+ return contextValue[OTEL_GRAPHQL_DATA_SYMBOL].fields[path2.join(".")] = field;
35306
35306
  }
35307
- function getField(contextValue, path) {
35308
- return contextValue[OTEL_GRAPHQL_DATA_SYMBOL].fields[path.join(".")];
35307
+ function getField(contextValue, path2) {
35308
+ return contextValue[OTEL_GRAPHQL_DATA_SYMBOL].fields[path2.join(".")];
35309
35309
  }
35310
- function getParentFieldSpan(contextValue, path) {
35311
- for (let i = path.length - 1; i > 0; i--) {
35312
- const field = getField(contextValue, path.slice(0, i));
35310
+ function getParentFieldSpan(contextValue, path2) {
35311
+ for (let i = path2.length - 1; i > 0; i--) {
35312
+ const field = getField(contextValue, path2.slice(0, i));
35313
35313
  if (field) {
35314
35314
  return field.span;
35315
35315
  }
@@ -35319,9 +35319,9 @@ function getParentFieldSpan(contextValue, path) {
35319
35319
  function getRootSpan2(contextValue) {
35320
35320
  return contextValue[OTEL_GRAPHQL_DATA_SYMBOL].span;
35321
35321
  }
35322
- function pathToArray(mergeItems, path) {
35322
+ function pathToArray(mergeItems, path2) {
35323
35323
  const flattened = [];
35324
- let curr = path;
35324
+ let curr = path2;
35325
35325
  while (curr) {
35326
35326
  let key = curr.key;
35327
35327
  if (mergeItems && typeof key === "number") {
@@ -35449,14 +35449,14 @@ function wrapFieldResolver(tracer, getConfig3, fieldResolver, isDefaultResolver
35449
35449
  if (!contextValue[OTEL_GRAPHQL_DATA_SYMBOL]) {
35450
35450
  return fieldResolver.call(this, source, args2, contextValue, info3);
35451
35451
  }
35452
- const path = pathToArray(config3.mergeItems, info3 && info3.path);
35453
- const depth = path.filter((item) => typeof item === "string").length;
35452
+ const path2 = pathToArray(config3.mergeItems, info3 && info3.path);
35453
+ const depth = path2.filter((item) => typeof item === "string").length;
35454
35454
  let span;
35455
35455
  let shouldEndSpan = false;
35456
35456
  if (config3.depth >= 0 && config3.depth < depth) {
35457
- span = getParentFieldSpan(contextValue, path);
35457
+ span = getParentFieldSpan(contextValue, path2);
35458
35458
  } else {
35459
- const { field, spanAdded } = createFieldIfNotExists(tracer, getConfig3, contextValue, info3, path);
35459
+ const { field, spanAdded } = createFieldIfNotExists(tracer, getConfig3, contextValue, info3, path2);
35460
35460
  span = field.span;
35461
35461
  shouldEndSpan = spanAdded;
35462
35462
  }
@@ -40539,10 +40539,10 @@ var init_postgresjs2 = __esm({
40539
40539
  },
40540
40540
  (exports) => exports
40541
40541
  );
40542
- ["src", "cf/src", "cjs/src"].forEach((path) => {
40542
+ ["src", "cf/src", "cjs/src"].forEach((path2) => {
40543
40543
  module2.files.push(
40544
40544
  new import_instrumentation34.InstrumentationNodeModuleFile(
40545
- `postgres/${path}/query.js`,
40545
+ `postgres/${path2}/query.js`,
40546
40546
  SUPPORTED_VERSIONS3,
40547
40547
  this._patchQueryPrototype.bind(this),
40548
40548
  this._unpatchQueryPrototype.bind(this)
@@ -41629,13 +41629,13 @@ var init_instrumentation13 = __esm({
41629
41629
  return function(original) {
41630
41630
  return function wrappedHandler(...args2) {
41631
41631
  if (typeof args2[0] === "string") {
41632
- const path = args2[0];
41632
+ const path2 = args2[0];
41633
41633
  if (args2.length === 1) {
41634
- return original.apply(this, [path]);
41634
+ return original.apply(this, [path2]);
41635
41635
  }
41636
41636
  const handlers2 = args2.slice(1);
41637
41637
  return original.apply(this, [
41638
- path,
41638
+ path2,
41639
41639
  ...handlers2.map((handler) => instrumentation._wrapHandler(handler))
41640
41640
  ]);
41641
41641
  }
@@ -41669,13 +41669,13 @@ var init_instrumentation13 = __esm({
41669
41669
  return function(original) {
41670
41670
  return function wrappedHandler(...args2) {
41671
41671
  if (typeof args2[0] === "string") {
41672
- const path = args2[0];
41672
+ const path2 = args2[0];
41673
41673
  if (args2.length === 1) {
41674
- return original.apply(this, [path]);
41674
+ return original.apply(this, [path2]);
41675
41675
  }
41676
41676
  const handlers2 = args2.slice(1);
41677
41677
  return original.apply(this, [
41678
- path,
41678
+ path2,
41679
41679
  ...handlers2.map((handler) => instrumentation._wrapHandler(handler))
41680
41680
  ]);
41681
41681
  }
@@ -41695,8 +41695,8 @@ var init_instrumentation13 = __esm({
41695
41695
  if (!instrumentation.isEnabled()) {
41696
41696
  return handler.apply(this, [c, next]);
41697
41697
  }
41698
- const path = c.req.path;
41699
- const span = instrumentation.tracer.startSpan(path);
41698
+ const path2 = c.req.path;
41699
+ const span = instrumentation.tracer.startSpan(path2);
41700
41700
  return context.with(trace2.setSpan(context.active(), span), () => {
41701
41701
  return instrumentation._safeExecute(
41702
41702
  () => {
@@ -41706,7 +41706,7 @@ var init_instrumentation13 = __esm({
41706
41706
  const type = instrumentation._determineHandlerType(result2);
41707
41707
  span.setAttributes({
41708
41708
  [AttributeNames6.HONO_TYPE]: type,
41709
- [AttributeNames6.HONO_NAME]: type === HonoTypes.REQUEST_HANDLER ? path : handler.name || "anonymous"
41709
+ [AttributeNames6.HONO_NAME]: type === HonoTypes.REQUEST_HANDLER ? path2 : handler.name || "anonymous"
41710
41710
  });
41711
41711
  instrumentation.getConfig().responseHook?.(span);
41712
41712
  return result2;
@@ -41715,7 +41715,7 @@ var init_instrumentation13 = __esm({
41715
41715
  const type = instrumentation._determineHandlerType(result);
41716
41716
  span.setAttributes({
41717
41717
  [AttributeNames6.HONO_TYPE]: type,
41718
- [AttributeNames6.HONO_NAME]: type === HonoTypes.REQUEST_HANDLER ? path : handler.name || "anonymous"
41718
+ [AttributeNames6.HONO_NAME]: type === HonoTypes.REQUEST_HANDLER ? path2 : handler.name || "anonymous"
41719
41719
  });
41720
41720
  instrumentation.getConfig().responseHook?.(span);
41721
41721
  return result;
@@ -41993,11 +41993,11 @@ var init_instrumentation14 = __esm({
41993
41993
  const router = dispatchLayer.router;
41994
41994
  const routesStack = router?.stack ?? [];
41995
41995
  for (const pathLayer of routesStack) {
41996
- const path = pathLayer.path;
41996
+ const path2 = pathLayer.path;
41997
41997
  const pathStack = pathLayer.stack;
41998
41998
  for (let j = 0; j < pathStack.length; j++) {
41999
41999
  const routedMiddleware = pathStack[j];
42000
- pathStack[j] = this._patchLayer(routedMiddleware, true, path);
42000
+ pathStack[j] = this._patchLayer(routedMiddleware, true, path2);
42001
42001
  }
42002
42002
  }
42003
42003
  return dispatchLayer;
@@ -56411,10 +56411,10 @@ var require_react_reconciler_development = __commonJS({
56411
56411
  fiber = fiber.next, id--;
56412
56412
  return fiber;
56413
56413
  }
56414
- function copyWithSetImpl(obj, path, index, value) {
56415
- if (index >= path.length) return value;
56416
- var key = path[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
56417
- updated[key] = copyWithSetImpl(obj[key], path, index + 1, value);
56414
+ function copyWithSetImpl(obj, path2, index, value) {
56415
+ if (index >= path2.length) return value;
56416
+ var key = path2[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
56417
+ updated[key] = copyWithSetImpl(obj[key], path2, index + 1, value);
56418
56418
  return updated;
56419
56419
  }
56420
56420
  function copyWithRename(obj, oldPath, newPath) {
@@ -56441,11 +56441,11 @@ var require_react_reconciler_development = __commonJS({
56441
56441
  );
56442
56442
  return updated;
56443
56443
  }
56444
- function copyWithDeleteImpl(obj, path, index) {
56445
- var key = path[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
56446
- if (index + 1 === path.length)
56444
+ function copyWithDeleteImpl(obj, path2, index) {
56445
+ var key = path2[index], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj);
56446
+ if (index + 1 === path2.length)
56447
56447
  return isArrayImpl(updated) ? updated.splice(key, 1) : delete updated[key], updated;
56448
- updated[key] = copyWithDeleteImpl(obj[key], path, index + 1);
56448
+ updated[key] = copyWithDeleteImpl(obj[key], path2, index + 1);
56449
56449
  return updated;
56450
56450
  }
56451
56451
  function shouldSuspendImpl() {
@@ -69722,29 +69722,29 @@ var require_react_reconciler_development = __commonJS({
69722
69722
  var didWarnAboutNestedUpdates = false;
69723
69723
  var didWarnAboutFindNodeInStrictMode = {};
69724
69724
  var overrideHookState = null, overrideHookStateDeletePath = null, overrideHookStateRenamePath = null, overrideProps = null, overridePropsDeletePath = null, overridePropsRenamePath = null, scheduleUpdate = null, scheduleRetry = null, setErrorHandler = null, setSuspenseHandler = null;
69725
- overrideHookState = function(fiber, id, path, value) {
69725
+ overrideHookState = function(fiber, id, path2, value) {
69726
69726
  id = findHook(fiber, id);
69727
- null !== id && (path = copyWithSetImpl(id.memoizedState, path, 0, value), id.memoizedState = path, id.baseState = path, fiber.memoizedProps = assign({}, fiber.memoizedProps), path = enqueueConcurrentRenderForLane(fiber, 2), null !== path && scheduleUpdateOnFiber(path, fiber, 2));
69727
+ null !== id && (path2 = copyWithSetImpl(id.memoizedState, path2, 0, value), id.memoizedState = path2, id.baseState = path2, fiber.memoizedProps = assign({}, fiber.memoizedProps), path2 = enqueueConcurrentRenderForLane(fiber, 2), null !== path2 && scheduleUpdateOnFiber(path2, fiber, 2));
69728
69728
  };
69729
- overrideHookStateDeletePath = function(fiber, id, path) {
69729
+ overrideHookStateDeletePath = function(fiber, id, path2) {
69730
69730
  id = findHook(fiber, id);
69731
- null !== id && (path = copyWithDeleteImpl(id.memoizedState, path, 0), id.memoizedState = path, id.baseState = path, fiber.memoizedProps = assign({}, fiber.memoizedProps), path = enqueueConcurrentRenderForLane(fiber, 2), null !== path && scheduleUpdateOnFiber(path, fiber, 2));
69731
+ null !== id && (path2 = copyWithDeleteImpl(id.memoizedState, path2, 0), id.memoizedState = path2, id.baseState = path2, fiber.memoizedProps = assign({}, fiber.memoizedProps), path2 = enqueueConcurrentRenderForLane(fiber, 2), null !== path2 && scheduleUpdateOnFiber(path2, fiber, 2));
69732
69732
  };
69733
69733
  overrideHookStateRenamePath = function(fiber, id, oldPath, newPath) {
69734
69734
  id = findHook(fiber, id);
69735
69735
  null !== id && (oldPath = copyWithRename(id.memoizedState, oldPath, newPath), id.memoizedState = oldPath, id.baseState = oldPath, fiber.memoizedProps = assign({}, fiber.memoizedProps), oldPath = enqueueConcurrentRenderForLane(fiber, 2), null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, 2));
69736
69736
  };
69737
- overrideProps = function(fiber, path, value) {
69738
- fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path, 0, value);
69737
+ overrideProps = function(fiber, path2, value) {
69738
+ fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path2, 0, value);
69739
69739
  fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
69740
- path = enqueueConcurrentRenderForLane(fiber, 2);
69741
- null !== path && scheduleUpdateOnFiber(path, fiber, 2);
69740
+ path2 = enqueueConcurrentRenderForLane(fiber, 2);
69741
+ null !== path2 && scheduleUpdateOnFiber(path2, fiber, 2);
69742
69742
  };
69743
- overridePropsDeletePath = function(fiber, path) {
69744
- fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path, 0);
69743
+ overridePropsDeletePath = function(fiber, path2) {
69744
+ fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path2, 0);
69745
69745
  fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps);
69746
- path = enqueueConcurrentRenderForLane(fiber, 2);
69747
- null !== path && scheduleUpdateOnFiber(path, fiber, 2);
69746
+ path2 = enqueueConcurrentRenderForLane(fiber, 2);
69747
+ null !== path2 && scheduleUpdateOnFiber(path2, fiber, 2);
69748
69748
  };
69749
69749
  overridePropsRenamePath = function(fiber, oldPath, newPath) {
69750
69750
  fiber.pendingProps = copyWithRename(
@@ -76459,9 +76459,9 @@ function parseNameStatus(line) {
76459
76459
  function parseNumstat(line) {
76460
76460
  const [addStr, delStr, pathField] = line.split(" ");
76461
76461
  const arrowIdx = pathField?.indexOf(" => ") ?? -1;
76462
- const path = arrowIdx !== -1 ? pathField.slice(arrowIdx + 4) : pathField;
76462
+ const path2 = arrowIdx !== -1 ? pathField.slice(arrowIdx + 4) : pathField;
76463
76463
  return {
76464
- path,
76464
+ path: path2,
76465
76465
  additions: addStr === "-" ? 0 : Number.parseInt(addStr, 10),
76466
76466
  deletions: delStr === "-" ? 0 : Number.parseInt(delStr, 10)
76467
76467
  };
@@ -76566,9 +76566,9 @@ function extractFilePatches(rawDiff) {
76566
76566
  for (const section of sections) {
76567
76567
  const headerMatch = section.match(/^diff --git a\/.+? b\/(.+)/m);
76568
76568
  if (!headerMatch) continue;
76569
- const path = headerMatch[1];
76569
+ const path2 = headerMatch[1];
76570
76570
  const isBinary = section.includes("Binary files") && section.includes("differ");
76571
- result.set(path, {
76571
+ result.set(path2, {
76572
76572
  patch: isBinary ? "" : section.replace(/\n+$/, ""),
76573
76573
  isBinary
76574
76574
  });
@@ -76890,8 +76890,8 @@ ${lines}`;
76890
76890
  }
76891
76891
 
76892
76892
  // ../../packages/git/src/staging.ts
76893
- async function stageFile(path) {
76894
- await runGit(["add", path]);
76893
+ async function stageFile(path2) {
76894
+ await runGit(["add", path2]);
76895
76895
  }
76896
76896
  async function resetStaging() {
76897
76897
  await runGit(["reset", "HEAD"]);
@@ -77238,6 +77238,36 @@ async function commitViaWorktree(repoRoot, groups, options) {
77238
77238
  await runGitAt(repoRoot, ["worktree", "remove", "--force", wtPath]);
77239
77239
  }
77240
77240
 
77241
+ // ../../packages/git/src/hooks.ts
77242
+ import path from "node:path";
77243
+ async function runPreCommitHook(repoRoot) {
77244
+ const hookPath = path.join(repoRoot, ".git", "hooks", "pre-commit");
77245
+ const hookFile = Bun.file(hookPath);
77246
+ if (!await hookFile.exists()) {
77247
+ return { ran: false, exitCode: 0, output: "" };
77248
+ }
77249
+ try {
77250
+ const proc = Bun.spawn([hookPath], {
77251
+ cwd: repoRoot,
77252
+ stdout: "pipe",
77253
+ stderr: "pipe",
77254
+ env: { ...process.env, GIT_DIR: path.join(repoRoot, ".git") }
77255
+ });
77256
+ const [stdout, stderr] = await Promise.all([
77257
+ new Response(proc.stdout).text(),
77258
+ new Response(proc.stderr).text()
77259
+ ]);
77260
+ const exitCode = await proc.exited;
77261
+ return {
77262
+ ran: true,
77263
+ exitCode,
77264
+ output: (stdout + stderr).trim()
77265
+ };
77266
+ } catch {
77267
+ return { ran: false, exitCode: 0, output: "" };
77268
+ }
77269
+ }
77270
+
77241
77271
  // ../../packages/git/src/index.ts
77242
77272
  var MAX_FILE_CONTENT_CHARS = 1e4;
77243
77273
  var MAX_FILES_TO_INCLUDE = 8;
@@ -77336,8 +77366,8 @@ async function getAllChanges() {
77336
77366
  isEmpty: false
77337
77367
  };
77338
77368
  }
77339
- async function getFileDiff(path) {
77340
- return runGit(["diff", "--", path]);
77369
+ async function getFileDiff(path2) {
77370
+ return runGit(["diff", "--", path2]);
77341
77371
  }
77342
77372
  async function readStagedFiles(files) {
77343
77373
  const eligible = files.filter((f) => f.status !== "deleted" && !f.isBinary).slice(0, MAX_FILES_TO_INCLUDE);
@@ -77386,10 +77416,10 @@ var PlanLimitError = class extends Error {
77386
77416
  }
77387
77417
  };
77388
77418
  function createApiClient(baseUrl = DEFAULT_BASE_URL2, fetchFn = fetch) {
77389
- async function request2(method, path, token, body, timeoutMs) {
77419
+ async function request2(method, path2, token, body, timeoutMs) {
77390
77420
  let res;
77391
77421
  try {
77392
- res = await fetchFn(`${baseUrl}${path}`, {
77422
+ res = await fetchFn(`${baseUrl}${path2}`, {
77393
77423
  method,
77394
77424
  headers: {
77395
77425
  "Content-Type": "application/json",
@@ -77409,7 +77439,7 @@ function createApiClient(baseUrl = DEFAULT_BASE_URL2, fetchFn = fetch) {
77409
77439
  const errBody = await res.json().catch(() => ({}));
77410
77440
  if (DEBUG)
77411
77441
  console.error(
77412
- `[api-client] ${method} ${path} \u2192 ${res.status}`,
77442
+ `[api-client] ${method} ${path2} \u2192 ${res.status}`,
77413
77443
  errBody
77414
77444
  );
77415
77445
  if (res.status === 401 && errBody.error === "token_expired") {
@@ -77427,10 +77457,10 @@ function createApiClient(baseUrl = DEFAULT_BASE_URL2, fetchFn = fetch) {
77427
77457
  }
77428
77458
  return res.json();
77429
77459
  }
77430
- async function postStream(path, body, token, timeoutMs) {
77460
+ async function postStream(path2, body, token, timeoutMs) {
77431
77461
  let res;
77432
77462
  try {
77433
- res = await fetchFn(`${baseUrl}${path}`, {
77463
+ res = await fetchFn(`${baseUrl}${path2}`, {
77434
77464
  method: "POST",
77435
77465
  headers: {
77436
77466
  "Content-Type": "application/json",
@@ -77450,7 +77480,7 @@ function createApiClient(baseUrl = DEFAULT_BASE_URL2, fetchFn = fetch) {
77450
77480
  if (!res.ok) {
77451
77481
  const errBody = await res.json().catch(() => ({}));
77452
77482
  if (DEBUG)
77453
- console.error(`[api-client] POST ${path} \u2192 ${res.status}`, errBody);
77483
+ console.error(`[api-client] POST ${path2} \u2192 ${res.status}`, errBody);
77454
77484
  if (res.status === 402 && errBody.error === "plan_limit_reached") {
77455
77485
  throw new PlanLimitError(
77456
77486
  String(errBody.plan ?? "unknown"),
@@ -77464,11 +77494,11 @@ function createApiClient(baseUrl = DEFAULT_BASE_URL2, fetchFn = fetch) {
77464
77494
  return res;
77465
77495
  }
77466
77496
  return {
77467
- post(path, body, token, timeoutMs) {
77468
- return request2("POST", path, token, body, timeoutMs);
77497
+ post(path2, body, token, timeoutMs) {
77498
+ return request2("POST", path2, token, body, timeoutMs);
77469
77499
  },
77470
- get(path, token) {
77471
- return request2("GET", path, token);
77500
+ get(path2, token) {
77501
+ return request2("GET", path2, token);
77472
77502
  },
77473
77503
  postStream
77474
77504
  };
@@ -84028,8 +84058,8 @@ function Text({ color, backgroundColor, dimColor = false, bold = false, italic =
84028
84058
  }
84029
84059
 
84030
84060
  // ../../node_modules/.bun/ink@6.8.0+169cb16edda37906/node_modules/ink/build/components/ErrorOverview.js
84031
- var cleanupPath = (path) => {
84032
- return path?.replace(`file://${cwd()}/`, "");
84061
+ var cleanupPath = (path2) => {
84062
+ return path2?.replace(`file://${cwd()}/`, "");
84033
84063
  };
84034
84064
  var stackUtils = new import_stack_utils.default({
84035
84065
  cwd: cwd(),
@@ -85681,17 +85711,17 @@ function saveToken(token, expiresAt) {
85681
85711
  function deleteToken() {
85682
85712
  return deleteTokenFromPath(AUTH_PATH);
85683
85713
  }
85684
- function deleteTokenFromPath(path) {
85714
+ function deleteTokenFromPath(path2) {
85685
85715
  try {
85686
- rmSync(path);
85716
+ rmSync(path2);
85687
85717
  return true;
85688
85718
  } catch {
85689
85719
  return false;
85690
85720
  }
85691
85721
  }
85692
- function readTokenFromPath(path) {
85722
+ function readTokenFromPath(path2) {
85693
85723
  try {
85694
- const raw = readFileSync3(path, "utf-8");
85724
+ const raw = readFileSync3(path2, "utf-8");
85695
85725
  const data = JSON.parse(raw);
85696
85726
  if (Date.now() >= data.expiresAt) return null;
85697
85727
  return data.token;
@@ -85699,10 +85729,10 @@ function readTokenFromPath(path) {
85699
85729
  return null;
85700
85730
  }
85701
85731
  }
85702
- function saveTokenToPath(path, token, expiresAt) {
85703
- mkdirSync(dirname3(path), { recursive: true });
85732
+ function saveTokenToPath(path2, token, expiresAt) {
85733
+ mkdirSync(dirname3(path2), { recursive: true });
85704
85734
  const data = { token, expiresAt };
85705
- writeFileSync(path, JSON.stringify(data), { mode: 384 });
85735
+ writeFileSync(path2, JSON.stringify(data), { mode: 384 });
85706
85736
  }
85707
85737
 
85708
85738
  // src/lib/immersive.ts
@@ -89066,6 +89096,7 @@ var TERMINAL_PHASES = [
89066
89096
  "error-git",
89067
89097
  "error-api",
89068
89098
  "error-commit",
89099
+ "error-hook",
89069
89100
  "error-plan"
89070
89101
  ];
89071
89102
  function parseCommitType(msg) {
@@ -89414,6 +89445,23 @@ function CommitApp({
89414
89445
  setAdditions(changes.files.reduce((s, f) => s + f.additions, 0));
89415
89446
  setDeletions(changes.files.reduce((s, f) => s + f.deletions, 0));
89416
89447
  setRawDiff(changes.rawDiff);
89448
+ if (!deps.skipVerification && deps.getRepoRoot) {
89449
+ const hookFn = deps.runPreCommitHook ?? runPreCommitHook;
89450
+ try {
89451
+ const repoRoot = await deps.getRepoRoot();
89452
+ const hookResult = await hookFn(repoRoot);
89453
+ if (hookResult.ran && hookResult.exitCode !== 0) {
89454
+ const detail = hookResult.output ? `
89455
+ ${hookResult.output}` : "";
89456
+ setErrorMsg(
89457
+ `Hook pre-commit falhou. Corrija os erros e tente novamente.${detail}`
89458
+ );
89459
+ setPhase("error-hook");
89460
+ return;
89461
+ }
89462
+ } catch {
89463
+ }
89464
+ }
89417
89465
  try {
89418
89466
  const stagedFiles = await deps.readStagedFiles(changes.files);
89419
89467
  const body = {
@@ -89528,7 +89576,7 @@ ${prefixed}`);
89528
89576
  setPhase("error-commit");
89529
89577
  return;
89530
89578
  }
89531
- if (deps.captureCommittedDiff && deps.verifyCommitIntegrity && deps.getRepoRoot && deps.runGitReset) {
89579
+ if (!deps.skipVerification && deps.captureCommittedDiff && deps.verifyCommitIntegrity && deps.getRepoRoot && deps.runGitReset) {
89532
89580
  setPhase("verifying");
89533
89581
  try {
89534
89582
  const repoRoot = await deps.getRepoRoot();
@@ -89738,7 +89786,7 @@ ${prefixed}`);
89738
89786
  }
89739
89787
  )
89740
89788
  ] }),
89741
- (phase === "error-auth" || phase === "error-git" || phase === "error-api" || phase === "error-commit") && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box_default, { flexDirection: "column", marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(StatusMessage, { variant: "error", children: errorMsg }) }),
89789
+ (phase === "error-auth" || phase === "error-git" || phase === "error-api" || phase === "error-hook" || phase === "error-commit") && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box_default, { flexDirection: "column", marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(StatusMessage, { variant: "error", children: errorMsg }) }),
89742
89790
  phase === "error-plan" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
89743
89791
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(StatusMessage, { variant: "warning", children: errorMsg.split("\n")[0] }),
89744
89792
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box_default, { marginLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text, { color: C.dim, children: errorMsg.split("\n")[1] }) })
@@ -89856,6 +89904,7 @@ async function commitCommand() {
89856
89904
  }
89857
89905
  const fileConfig = await readRepoConfig();
89858
89906
  const instructions = await resolveInstructions("commit");
89907
+ const skipVerification = process.argv.includes("--no-verify");
89859
89908
  let exitCode = 0;
89860
89909
  let completedMessage = "";
89861
89910
  let errorMessage = "";
@@ -89866,15 +89915,17 @@ async function commitCommand() {
89866
89915
  readToken,
89867
89916
  getStagedChanges,
89868
89917
  readStagedFiles,
89869
- apiPost: (path, body, tkn) => apiClient.post(path, body, tkn),
89870
- postStream: (path, body, tkn, timeoutMs) => apiClient.postStream(path, body, tkn, timeoutMs),
89918
+ apiPost: (path2, body, tkn) => apiClient.post(path2, body, tkn),
89919
+ postStream: (path2, body, tkn, timeoutMs) => apiClient.postStream(path2, body, tkn, timeoutMs),
89871
89920
  runGitCommit,
89872
89921
  captureCommittedDiff,
89873
89922
  verifyCommitIntegrity,
89874
89923
  getRepoRoot,
89875
89924
  runGitReset,
89925
+ runPreCommitHook,
89876
89926
  fileConfig,
89877
- instructionsOverride: instructions
89927
+ instructionsOverride: instructions,
89928
+ skipVerification
89878
89929
  },
89879
89930
  onExit: (code, message, error4) => {
89880
89931
  exitCode = code;
@@ -90326,9 +90377,9 @@ function InitApp({
90326
90377
  }
90327
90378
 
90328
90379
  // src/commands/init.ts
90329
- async function fileExists(path) {
90380
+ async function fileExists(path2) {
90330
90381
  try {
90331
- await access(path);
90382
+ await access(path2);
90332
90383
  return true;
90333
90384
  } catch {
90334
90385
  return false;
@@ -90556,8 +90607,8 @@ async function loginCommand() {
90556
90607
  const { waitUntilExit } = render_default(
90557
90608
  import_react72.default.createElement(LoginApp, {
90558
90609
  deps: {
90559
- apiPost: (path, body) => apiClient2.post(path, body),
90560
- apiGet: (path, token) => apiClient2.get(path, token),
90610
+ apiPost: (path2, body) => apiClient2.post(path2, body),
90611
+ apiGet: (path2, token) => apiClient2.get(path2, token),
90561
90612
  openBrowser,
90562
90613
  saveToken,
90563
90614
  readToken
@@ -90839,7 +90890,7 @@ async function prCommand() {
90839
90890
  deps: {
90840
90891
  readToken,
90841
90892
  getDiffBetweenBranches,
90842
- apiPost: (path, body, token) => apiClient.post(path, body, token),
90893
+ apiPost: (path2, body, token) => apiClient.post(path2, body, token),
90843
90894
  copyToClipboard
90844
90895
  },
90845
90896
  onExit: (code) => {
@@ -90860,8 +90911,8 @@ var import_react76 = __toESM(require_react(), 1);
90860
90911
  init_sentry();
90861
90912
 
90862
90913
  // src/lib/worktree-groups.ts
90863
- function getAllLineIndices(hunksMap, path, hunkIndex) {
90864
- const hunks = hunksMap.get(path);
90914
+ function getAllLineIndices(hunksMap, path2, hunkIndex) {
90915
+ const hunks = hunksMap.get(path2);
90865
90916
  if (!hunks) return [];
90866
90917
  const hunk = hunks.find(
90867
90918
  (h) => h.startLineOld === hunkIndex || hunks.indexOf(h) === hunkIndex
@@ -91069,6 +91120,7 @@ var TERMINAL_PHASES4 = [
91069
91120
  "error-git",
91070
91121
  "error-api",
91071
91122
  "error-plan",
91123
+ "error-hook",
91072
91124
  "error-commit"
91073
91125
  ];
91074
91126
  function computeGroupStats(files, originalFiles) {
@@ -91289,6 +91341,23 @@ function SplitApp({
91289
91341
  setHunksMap(hMap);
91290
91342
  setPatchMap(pMap);
91291
91343
  const manifest = deps.buildSplitManifest(files, hMap);
91344
+ if (!deps.skipVerification) {
91345
+ const hookFn = deps.runPreCommitHook ?? runPreCommitHook;
91346
+ try {
91347
+ const repoRoot = await deps.getRepoRoot();
91348
+ const hookResult = await hookFn(repoRoot);
91349
+ if (hookResult.ran && hookResult.exitCode !== 0) {
91350
+ const detail = hookResult.output ? `
91351
+ ${hookResult.output}` : "";
91352
+ setErrorMsg(
91353
+ `Hook pre-commit falhou. Corrija os erros e tente novamente.${detail}`
91354
+ );
91355
+ setPhase("error-hook");
91356
+ return;
91357
+ }
91358
+ } catch {
91359
+ }
91360
+ }
91292
91361
  const body = { manifest };
91293
91362
  if (Object.keys(activeFileConfig).length > 0) {
91294
91363
  body.config = activeFileConfig;
@@ -91467,7 +91536,8 @@ ${body}`;
91467
91536
  log4(`repoRoot: ${repoRoot}`);
91468
91537
  setPhase("verifying");
91469
91538
  await deps.commitViaWorktree(repoRoot, worktreeGroups, {
91470
- originalDiff: originalRawDiff
91539
+ originalDiff: originalRawDiff,
91540
+ skipVerification: deps.skipVerification
91471
91541
  });
91472
91542
  log4("commitViaWorktree done (verified)");
91473
91543
  let hashes = [];
@@ -91775,7 +91845,7 @@ ${body}`;
91775
91845
  ] }),
91776
91846
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Box_default, { marginLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: C.dim, children: "\u2192 Use git add ou remova --staged" }) })
91777
91847
  ] }),
91778
- (phase === "error-auth" || phase === "error-git" || phase === "error-api" || phase === "error-plan") && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
91848
+ (phase === "error-auth" || phase === "error-git" || phase === "error-api" || phase === "error-hook" || phase === "error-plan") && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
91779
91849
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { gap: 1, children: [
91780
91850
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: C.red, children: "\u2717" }),
91781
91851
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: C.red, children: errorMsg })
@@ -91798,6 +91868,7 @@ async function runGitCommit2(message) {
91798
91868
  async function splitCommand() {
91799
91869
  const fileConfig = await readRepoConfig();
91800
91870
  const useStaged = !process.argv.includes("--all");
91871
+ const skipVerification = process.argv.includes("--no-verify");
91801
91872
  const instructions = await resolveInstructions("split");
91802
91873
  let exitCode = 0;
91803
91874
  let completedCommits = [];
@@ -91820,14 +91891,16 @@ async function splitCommand() {
91820
91891
  applyPatch,
91821
91892
  validatePatch,
91822
91893
  getFileDiff,
91823
- apiPost: (path, body, tkn, timeoutMs) => apiClient.post(path, body, tkn, timeoutMs),
91824
- postStream: (path, body, tkn, timeoutMs) => apiClient.postStream(path, body, tkn, timeoutMs),
91894
+ apiPost: (path2, body, tkn, timeoutMs) => apiClient.post(path2, body, tkn, timeoutMs),
91895
+ postStream: (path2, body, tkn, timeoutMs) => apiClient.postStream(path2, body, tkn, timeoutMs),
91825
91896
  runGitCommit: runGitCommit2,
91826
91897
  commitViaWorktree,
91827
91898
  getRepoRoot,
91899
+ runPreCommitHook,
91828
91900
  fileConfig,
91829
91901
  instructionsOverride: instructions,
91830
- useStaged
91902
+ useStaged,
91903
+ skipVerification
91831
91904
  },
91832
91905
  onExit: (code, commits, error4) => {
91833
91906
  exitCode = code;
@@ -92024,6 +92097,10 @@ var COMMAND_HELP = {
92024
92097
  name: "--instructions [texto]",
92025
92098
  description: 'Instru\xE7\xF5es pontuais para esta gera\xE7\xE3o (ex: "foca na parte de auth"). Sem texto abre um editor interativo.'
92026
92099
  },
92100
+ {
92101
+ name: "--no-verify",
92102
+ description: "Pular verifica\xE7\xE3o de integridade do diff p\xF3s-commit"
92103
+ },
92027
92104
  {
92028
92105
  name: "--verbose",
92029
92106
  alias: "-v",
@@ -92042,6 +92119,10 @@ var COMMAND_HELP = {
92042
92119
  name: "--instructions [texto]",
92043
92120
  description: 'Instru\xE7\xF5es pontuais para esta gera\xE7\xE3o (ex: "separa migration do model"). Sem texto abre um editor interativo.'
92044
92121
  },
92122
+ {
92123
+ name: "--no-verify",
92124
+ description: "Pular verifica\xE7\xE3o de integridade do diff p\xF3s-commit"
92125
+ },
92045
92126
  {
92046
92127
  name: "--verbose",
92047
92128
  alias: "-v",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repomind",
3
- "version": "0.9.2",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "description": "AI-powered git commit messages and repository insights",
6
6
  "keywords": [