repomind 0.10.0 → 0.12.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 +307 -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) {
@@ -89310,6 +89341,9 @@ function CommitApp({
89310
89341
  deps.instructionsOverride ?? null
89311
89342
  );
89312
89343
  const committedMessageRef = (0, import_react64.useRef)("");
89344
+ const lastRejectedRef = (0, import_react64.useRef)("");
89345
+ const flowIdRef = (0, import_react64.useRef)("");
89346
+ const editedRef = (0, import_react64.useRef)(false);
89313
89347
  const [phase, setPhase] = (0, import_react64.useState)("analyzing");
89314
89348
  const [message, setMessage] = (0, import_react64.useState)("");
89315
89349
  const [issueRef, setIssueRef] = (0, import_react64.useState)("");
@@ -89326,15 +89360,32 @@ function CommitApp({
89326
89360
  );
89327
89361
  const streamOptions = streamPayload && phase === "streaming" ? {
89328
89362
  path: streamPayload.path,
89329
- body: streamPayload.body,
89363
+ body: retryCount > 0 ? {
89364
+ ...streamPayload.body,
89365
+ regeneration: {
89366
+ attempt: retryCount,
89367
+ ...lastRejectedRef.current ? { previousMessage: lastRejectedRef.current } : {}
89368
+ }
89369
+ } : streamPayload.body,
89330
89370
  token: streamPayload.token,
89331
89371
  postStream: deps.postStream,
89332
89372
  stepLabels: STEP_LABELS,
89333
89373
  retryKey: retryCount
89334
89374
  } : null;
89335
- const stream = usePipelineStream(
89336
- streamOptions
89337
- );
89375
+ const stream = usePipelineStream(streamOptions);
89376
+ const sendFeedback = (outcome, editedMessage) => {
89377
+ if (!flowIdRef.current || !streamPayload?.token) return;
89378
+ deps.apiPost(
89379
+ "/commit/feedback",
89380
+ {
89381
+ flowId: flowIdRef.current,
89382
+ outcome,
89383
+ ...editedMessage ? { editedMessage } : {}
89384
+ },
89385
+ streamPayload.token
89386
+ ).catch(() => {
89387
+ });
89388
+ };
89338
89389
  (0, import_react64.useEffect)(() => {
89339
89390
  if (!TERMINAL_PHASES.includes(phase)) return;
89340
89391
  const code = phase === "done" || phase === "aborted" ? 0 : 1;
@@ -89350,6 +89401,8 @@ function CommitApp({
89350
89401
  if (stream.result) {
89351
89402
  setMessage(stream.result.message);
89352
89403
  if (stream.result.commitId) setCommitId(stream.result.commitId);
89404
+ if (stream.result.flowId) flowIdRef.current = stream.result.flowId;
89405
+ editedRef.current = false;
89353
89406
  setPhase("confirm");
89354
89407
  return;
89355
89408
  }
@@ -89414,6 +89467,23 @@ function CommitApp({
89414
89467
  setAdditions(changes.files.reduce((s, f) => s + f.additions, 0));
89415
89468
  setDeletions(changes.files.reduce((s, f) => s + f.deletions, 0));
89416
89469
  setRawDiff(changes.rawDiff);
89470
+ if (!deps.skipVerification && deps.getRepoRoot) {
89471
+ const hookFn = deps.runPreCommitHook ?? runPreCommitHook;
89472
+ try {
89473
+ const repoRoot = await deps.getRepoRoot();
89474
+ const hookResult = await hookFn(repoRoot);
89475
+ if (hookResult.ran && hookResult.exitCode !== 0) {
89476
+ const detail = hookResult.output ? `
89477
+ ${hookResult.output}` : "";
89478
+ setErrorMsg(
89479
+ `Hook pre-commit falhou. Corrija os erros e tente novamente.${detail}`
89480
+ );
89481
+ setPhase("error-hook");
89482
+ return;
89483
+ }
89484
+ } catch {
89485
+ }
89486
+ }
89417
89487
  try {
89418
89488
  const stagedFiles = await deps.readStagedFiles(changes.files);
89419
89489
  const body = {
@@ -89486,6 +89556,7 @@ ${prefixed}`);
89486
89556
  if (phase !== "confirm") return;
89487
89557
  if (confirmingAbort) {
89488
89558
  if (input.toLowerCase() === "y") {
89559
+ sendFeedback("discarded");
89489
89560
  setConfirmingAbort(false);
89490
89561
  setPhase("aborted");
89491
89562
  return;
@@ -89498,6 +89569,8 @@ ${prefixed}`);
89498
89569
  }
89499
89570
  const parsed2 = parseCommitType(message);
89500
89571
  if (input === "r") {
89572
+ sendFeedback("regenerated");
89573
+ lastRejectedRef.current = message;
89501
89574
  setMessage("");
89502
89575
  setCommitId("");
89503
89576
  setIssueRef("");
@@ -89506,6 +89579,7 @@ ${prefixed}`);
89506
89579
  return;
89507
89580
  }
89508
89581
  if (input === "e") {
89582
+ editedRef.current = true;
89509
89583
  setPhase("editing");
89510
89584
  return;
89511
89585
  }
@@ -89569,6 +89643,10 @@ ${prefixed}`);
89569
89643
  ).catch(() => {
89570
89644
  });
89571
89645
  }
89646
+ sendFeedback(
89647
+ editedRef.current ? "edited" : "accepted",
89648
+ editedRef.current ? message : void 0
89649
+ );
89572
89650
  committedMessageRef.current = message;
89573
89651
  setPhase("done");
89574
89652
  } else if (denied) {
@@ -89738,7 +89816,7 @@ ${prefixed}`);
89738
89816
  }
89739
89817
  )
89740
89818
  ] }),
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 }) }),
89819
+ (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
89820
  phase === "error-plan" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
89743
89821
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(StatusMessage, { variant: "warning", children: errorMsg.split("\n")[0] }),
89744
89822
  /* @__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] }) })
@@ -89867,13 +89945,14 @@ async function commitCommand() {
89867
89945
  readToken,
89868
89946
  getStagedChanges,
89869
89947
  readStagedFiles,
89870
- apiPost: (path, body, tkn) => apiClient.post(path, body, tkn),
89871
- postStream: (path, body, tkn, timeoutMs) => apiClient.postStream(path, body, tkn, timeoutMs),
89948
+ apiPost: (path2, body, tkn) => apiClient.post(path2, body, tkn),
89949
+ postStream: (path2, body, tkn, timeoutMs) => apiClient.postStream(path2, body, tkn, timeoutMs),
89872
89950
  runGitCommit,
89873
89951
  captureCommittedDiff,
89874
89952
  verifyCommitIntegrity,
89875
89953
  getRepoRoot,
89876
89954
  runGitReset,
89955
+ runPreCommitHook,
89877
89956
  fileConfig,
89878
89957
  instructionsOverride: instructions,
89879
89958
  skipVerification
@@ -90328,9 +90407,9 @@ function InitApp({
90328
90407
  }
90329
90408
 
90330
90409
  // src/commands/init.ts
90331
- async function fileExists(path) {
90410
+ async function fileExists(path2) {
90332
90411
  try {
90333
- await access(path);
90412
+ await access(path2);
90334
90413
  return true;
90335
90414
  } catch {
90336
90415
  return false;
@@ -90558,8 +90637,8 @@ async function loginCommand() {
90558
90637
  const { waitUntilExit } = render_default(
90559
90638
  import_react72.default.createElement(LoginApp, {
90560
90639
  deps: {
90561
- apiPost: (path, body) => apiClient2.post(path, body),
90562
- apiGet: (path, token) => apiClient2.get(path, token),
90640
+ apiPost: (path2, body) => apiClient2.post(path2, body),
90641
+ apiGet: (path2, token) => apiClient2.get(path2, token),
90563
90642
  openBrowser,
90564
90643
  saveToken,
90565
90644
  readToken
@@ -90841,7 +90920,7 @@ async function prCommand() {
90841
90920
  deps: {
90842
90921
  readToken,
90843
90922
  getDiffBetweenBranches,
90844
- apiPost: (path, body, token) => apiClient.post(path, body, token),
90923
+ apiPost: (path2, body, token) => apiClient.post(path2, body, token),
90845
90924
  copyToClipboard
90846
90925
  },
90847
90926
  onExit: (code) => {
@@ -90862,8 +90941,8 @@ var import_react76 = __toESM(require_react(), 1);
90862
90941
  init_sentry();
90863
90942
 
90864
90943
  // src/lib/worktree-groups.ts
90865
- function getAllLineIndices(hunksMap, path, hunkIndex) {
90866
- const hunks = hunksMap.get(path);
90944
+ function getAllLineIndices(hunksMap, path2, hunkIndex) {
90945
+ const hunks = hunksMap.get(path2);
90867
90946
  if (!hunks) return [];
90868
90947
  const hunk = hunks.find(
90869
90948
  (h) => h.startLineOld === hunkIndex || hunks.indexOf(h) === hunkIndex
@@ -91071,6 +91150,7 @@ var TERMINAL_PHASES4 = [
91071
91150
  "error-git",
91072
91151
  "error-api",
91073
91152
  "error-plan",
91153
+ "error-hook",
91074
91154
  "error-commit"
91075
91155
  ];
91076
91156
  function computeGroupStats(files, originalFiles) {
@@ -91116,6 +91196,8 @@ function SplitApp({
91116
91196
  const [regenGroupIndex, setRegenGroupIndex] = (0, import_react76.useState)(null);
91117
91197
  const [regenBody, setRegenBody] = (0, import_react76.useState)(null);
91118
91198
  const [regenRetryCount, setRegenRetryCount] = (0, import_react76.useState)(0);
91199
+ const flowIdRef = (0, import_react76.useRef)("");
91200
+ const editedAnyRef = (0, import_react76.useRef)(false);
91119
91201
  const [streamPayload, setStreamPayload] = (0, import_react76.useState)(
91120
91202
  null
91121
91203
  );
@@ -91145,6 +91227,15 @@ function SplitApp({
91145
91227
  const regenStream = usePipelineStream(
91146
91228
  regenStreamOptions
91147
91229
  );
91230
+ const sendFeedback = (outcome) => {
91231
+ if (!flowIdRef.current || !authToken) return;
91232
+ deps.apiPost(
91233
+ "/commit/feedback",
91234
+ { flowId: flowIdRef.current, outcome },
91235
+ authToken
91236
+ ).catch(() => {
91237
+ });
91238
+ };
91148
91239
  (0, import_react76.useEffect)(() => {
91149
91240
  if (!TERMINAL_PHASES4.includes(phase)) return;
91150
91241
  const code = phase === "done" || phase === "aborted" ? 0 : 1;
@@ -91165,6 +91256,7 @@ function SplitApp({
91165
91256
  if (stream.result.orphans?.length) {
91166
91257
  setOrphanCount(stream.result.orphans.length);
91167
91258
  }
91259
+ if (stream.result.flowId) flowIdRef.current = stream.result.flowId;
91168
91260
  setPhase("review");
91169
91261
  return;
91170
91262
  }
@@ -91199,6 +91291,9 @@ function SplitApp({
91199
91291
  (0, import_react76.useEffect)(() => {
91200
91292
  if (phase !== "regenerating") return;
91201
91293
  if (regenStream.result) {
91294
+ if (regenStream.result.flowId) {
91295
+ flowIdRef.current = regenStream.result.flowId;
91296
+ }
91202
91297
  const newMessage = regenStream.result.message;
91203
91298
  if (regenGroupIndex !== null) {
91204
91299
  setGroups((prev) => {
@@ -91291,6 +91386,23 @@ function SplitApp({
91291
91386
  setHunksMap(hMap);
91292
91387
  setPatchMap(pMap);
91293
91388
  const manifest = deps.buildSplitManifest(files, hMap);
91389
+ if (!deps.skipVerification) {
91390
+ const hookFn = deps.runPreCommitHook ?? runPreCommitHook;
91391
+ try {
91392
+ const repoRoot = await deps.getRepoRoot();
91393
+ const hookResult = await hookFn(repoRoot);
91394
+ if (hookResult.ran && hookResult.exitCode !== 0) {
91395
+ const detail = hookResult.output ? `
91396
+ ${hookResult.output}` : "";
91397
+ setErrorMsg(
91398
+ `Hook pre-commit falhou. Corrija os erros e tente novamente.${detail}`
91399
+ );
91400
+ setPhase("error-hook");
91401
+ return;
91402
+ }
91403
+ } catch {
91404
+ }
91405
+ }
91294
91406
  const body = { manifest };
91295
91407
  if (Object.keys(activeFileConfig).length > 0) {
91296
91408
  body.config = activeFileConfig;
@@ -91311,6 +91423,7 @@ function SplitApp({
91311
91423
  if (phase !== "review") return;
91312
91424
  if (confirmingAbort) {
91313
91425
  if (input.toLowerCase() === "y") {
91426
+ sendFeedback("discarded");
91314
91427
  setConfirmingAbort(false);
91315
91428
  setPhase("aborted");
91316
91429
  return;
@@ -91334,17 +91447,23 @@ function SplitApp({
91334
91447
  return;
91335
91448
  }
91336
91449
  if (input === "e") {
91450
+ editedAnyRef.current = true;
91337
91451
  setPhase("editing");
91338
91452
  return;
91339
91453
  }
91340
91454
  if (input === "r") {
91341
91455
  const group = groups[selectedIndex];
91342
91456
  if (!group || !authToken) return;
91457
+ sendFeedback("regenerated");
91343
91458
  const combinedPatch = group.files.map((f) => patchMap.get(f.path) ?? "").filter(Boolean).join("\n");
91344
91459
  const body = { diff: combinedPatch };
91345
91460
  if (Object.keys(activeFileConfig).length > 0) {
91346
91461
  body.config = activeFileConfig;
91347
91462
  }
91463
+ body.regeneration = {
91464
+ attempt: regenRetryCount + 1,
91465
+ previousMessage: group.message
91466
+ };
91348
91467
  setRegenGroupIndex(selectedIndex);
91349
91468
  setRegenBody(body);
91350
91469
  setRegenRetryCount((c) => c + 1);
@@ -91497,6 +91616,7 @@ ${body}`;
91497
91616
  });
91498
91617
  }
91499
91618
  }
91619
+ sendFeedback(editedAnyRef.current ? "edited" : "accepted");
91500
91620
  committedMessagesRef.current = activeGroups2.map((g) => g.message);
91501
91621
  setPhase("done");
91502
91622
  } catch (e) {
@@ -91778,7 +91898,7 @@ ${body}`;
91778
91898
  ] }),
91779
91899
  /* @__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" }) })
91780
91900
  ] }),
91781
- (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: [
91901
+ (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: [
91782
91902
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Box_default, { gap: 1, children: [
91783
91903
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: C.red, children: "\u2717" }),
91784
91904
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Text, { color: C.red, children: errorMsg })
@@ -91824,11 +91944,12 @@ async function splitCommand() {
91824
91944
  applyPatch,
91825
91945
  validatePatch,
91826
91946
  getFileDiff,
91827
- apiPost: (path, body, tkn, timeoutMs) => apiClient.post(path, body, tkn, timeoutMs),
91828
- postStream: (path, body, tkn, timeoutMs) => apiClient.postStream(path, body, tkn, timeoutMs),
91947
+ apiPost: (path2, body, tkn, timeoutMs) => apiClient.post(path2, body, tkn, timeoutMs),
91948
+ postStream: (path2, body, tkn, timeoutMs) => apiClient.postStream(path2, body, tkn, timeoutMs),
91829
91949
  runGitCommit: runGitCommit2,
91830
91950
  commitViaWorktree,
91831
91951
  getRepoRoot,
91952
+ runPreCommitHook,
91832
91953
  fileConfig,
91833
91954
  instructionsOverride: instructions,
91834
91955
  useStaged,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repomind",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "type": "module",
5
5
  "description": "AI-powered git commit messages and repository insights",
6
6
  "keywords": [