mobbdev 1.2.29 → 1.2.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -851,12 +851,15 @@ var init_client_generates = __esm({
851
851
  }
852
852
  `;
853
853
  AnalyzeCommitForExtensionAiBlameDocument = `
854
- mutation AnalyzeCommitForExtensionAIBlame($repositoryURL: String!, $commitSha: String!, $organizationId: String!, $commitTimestamp: Timestamp) {
854
+ mutation AnalyzeCommitForExtensionAIBlame($repositoryURL: String!, $commitSha: String!, $organizationId: String!, $commitTimestamp: Timestamp, $commitAuthor: GitIdentityInput, $commitCommitter: GitIdentityInput, $commitCoAuthors: [GitIdentityInput!]) {
855
855
  analyzeCommitForAIBlame(
856
856
  repositoryURL: $repositoryURL
857
857
  commitSha: $commitSha
858
858
  organizationId: $organizationId
859
859
  commitTimestamp: $commitTimestamp
860
+ commitAuthor: $commitAuthor
861
+ commitCommitter: $commitCommitter
862
+ commitCoAuthors: $commitCoAuthors
860
863
  ) {
861
864
  __typename
862
865
  ... on ProcessAIBlameFinalResult {
@@ -2689,6 +2692,217 @@ var init_configs = __esm({
2689
2692
  }
2690
2693
  });
2691
2694
 
2695
+ // src/utils/blame/gitBlameTypes.ts
2696
+ import { z as z18 } from "zod";
2697
+ function parseCoAuthorValue(raw) {
2698
+ const trimmed = raw.trim();
2699
+ if (!trimmed) {
2700
+ return null;
2701
+ }
2702
+ const openBracket = trimmed.lastIndexOf("<");
2703
+ const closeBracket = trimmed.lastIndexOf(">");
2704
+ if (openBracket === -1 || closeBracket === -1 || closeBracket < openBracket) {
2705
+ return null;
2706
+ }
2707
+ const name = trimmed.slice(0, openBracket).trim();
2708
+ const email = trimmed.slice(openBracket + 1, closeBracket).trim();
2709
+ if (!name || !email) {
2710
+ return null;
2711
+ }
2712
+ return { name, email };
2713
+ }
2714
+ function parseCommitLine(line) {
2715
+ const parts = line.split("\0");
2716
+ if (parts.length < 7) {
2717
+ return null;
2718
+ }
2719
+ return {
2720
+ sha: parts[0],
2721
+ author: { name: parts[2], email: parts[1] },
2722
+ committer: { name: parts[4], email: parts[3] },
2723
+ coAuthors: parts.slice(7).map(parseCoAuthorValue).filter((v) => v !== null),
2724
+ timestamp: parseInt(parts[5], 10),
2725
+ message: parts[6]
2726
+ };
2727
+ }
2728
+ var PrepareGitBlameMessageZ, PrepareGitBlameResponseMessageZ, CommitMetadataZ, LineToCommitMapZ, CommitMetadataMapZ, BlameInfoZ, LineRangeZ, PrContextZ, PrepareCommitBlameMessageZ, BlameLineInfoZ, FileBlameDataZ, ChunkFetchResultZ, FileBlameResponseEntryZ, CommitBlameDataZ, CommitInfoZ, GitIdentityZ, COMMIT_LOG_FORMAT, CommitDataZ, PrDiffDataZ, PrStatsZ, CommitsManifestZ, BlameLineEntryZ, BlameLinesDataZ, PrepareCommitBlameResponseMessageZ;
2729
+ var init_gitBlameTypes = __esm({
2730
+ "src/utils/blame/gitBlameTypes.ts"() {
2731
+ "use strict";
2732
+ PrepareGitBlameMessageZ = z18.object({
2733
+ reportId: z18.string(),
2734
+ repoArchivePath: z18.string()
2735
+ });
2736
+ PrepareGitBlameResponseMessageZ = z18.object({
2737
+ reportId: z18.string()
2738
+ });
2739
+ CommitMetadataZ = z18.object({
2740
+ author: z18.string().optional(),
2741
+ "author-mail": z18.string().optional(),
2742
+ "author-time": z18.string().optional(),
2743
+ "author-tz": z18.string().optional(),
2744
+ committer: z18.string().optional(),
2745
+ "committer-mail": z18.string().optional(),
2746
+ "committer-time": z18.string().optional(),
2747
+ "committer-tz": z18.string().optional(),
2748
+ summary: z18.string().optional(),
2749
+ filename: z18.string().optional()
2750
+ });
2751
+ LineToCommitMapZ = z18.record(z18.string(), z18.string());
2752
+ CommitMetadataMapZ = z18.record(z18.string(), CommitMetadataZ);
2753
+ BlameInfoZ = z18.object({
2754
+ lineToCommit: LineToCommitMapZ,
2755
+ commitMetadata: CommitMetadataMapZ
2756
+ });
2757
+ LineRangeZ = z18.object({
2758
+ /** First line in chunk (1-indexed) */
2759
+ start: z18.number(),
2760
+ /** Last line in chunk (inclusive) */
2761
+ end: z18.number()
2762
+ });
2763
+ PrContextZ = z18.object({
2764
+ prNumber: z18.number(),
2765
+ repositoryUrl: z18.string(),
2766
+ organizationId: z18.string(),
2767
+ userEmail: z18.string(),
2768
+ source: z18.enum(["pr", "github"]),
2769
+ githubContext: z18.object({
2770
+ prNumber: z18.number(),
2771
+ installationId: z18.number(),
2772
+ repositoryURL: z18.string()
2773
+ }).optional()
2774
+ });
2775
+ PrepareCommitBlameMessageZ = z18.object({
2776
+ /** Commit blame request ID from database (for tracking and updating status) */
2777
+ commitBlameRequestId: z18.string(),
2778
+ /** Organization ID (for org-scoped caching) */
2779
+ organizationId: z18.string(),
2780
+ /** Full repository URL (e.g., https://github.com/org/repo) */
2781
+ repositoryUrl: z18.string(),
2782
+ /** Commit SHA to analyze (typically PR head commit) */
2783
+ commitSha: z18.string(),
2784
+ /** Authentication headers for repository access (e.g., GitHub token) */
2785
+ extraHeaders: z18.record(z18.string(), z18.string()).default({}),
2786
+ // --- PR analysis fields ---
2787
+ /** Target branch name (from getPr() base.ref). When set, enables PR analysis mode. */
2788
+ targetBranch: z18.string().optional(),
2789
+ /** Context for triggering blame attribution analysis after SCM agent completes. */
2790
+ prContext: PrContextZ.optional(),
2791
+ /** User email for blame attribution analysis trigger context (used for both PR and single commit flows). */
2792
+ userEmail: z18.string().optional()
2793
+ });
2794
+ BlameLineInfoZ = z18.object({
2795
+ /** Line number as it appeared in the introducing commit */
2796
+ originalLineNumber: z18.number(),
2797
+ /** Commit SHA that introduced this line */
2798
+ commitSha: z18.string(),
2799
+ /** Author name for this line */
2800
+ authorName: z18.string().optional(),
2801
+ /** Author email for this line */
2802
+ authorEmail: z18.string().optional()
2803
+ }).nullable();
2804
+ FileBlameDataZ = z18.array(BlameLineInfoZ);
2805
+ ChunkFetchResultZ = z18.object({
2806
+ filePath: z18.string(),
2807
+ lines: z18.array(z18.number()),
2808
+ data: FileBlameDataZ.nullable()
2809
+ });
2810
+ FileBlameResponseEntryZ = z18.object({
2811
+ /** Chunk index (0 for small files, 0-N for large file chunks) */
2812
+ chunkIndex: z18.number(),
2813
+ /** Blame data array (1-indexed, index 0 is null) */
2814
+ blameData: FileBlameDataZ
2815
+ });
2816
+ CommitBlameDataZ = z18.record(
2817
+ z18.string(),
2818
+ // fileName
2819
+ z18.array(FileBlameResponseEntryZ)
2820
+ );
2821
+ CommitInfoZ = z18.object({
2822
+ /** Number of parent commits (1 = normal commit, 2+ = merge commit, null = failed to determine) */
2823
+ parentCount: z18.number().nullable()
2824
+ });
2825
+ GitIdentityZ = z18.object({
2826
+ name: z18.string(),
2827
+ email: z18.string()
2828
+ });
2829
+ COMMIT_LOG_FORMAT = "%H%x00%ae%x00%an%x00%ce%x00%cn%x00%at%x00%s%x00%(trailers:key=Co-authored-by,valueonly,separator=%x00)";
2830
+ CommitDataZ = z18.object({
2831
+ diff: z18.string(),
2832
+ author: GitIdentityZ,
2833
+ committer: GitIdentityZ,
2834
+ coAuthors: z18.array(GitIdentityZ),
2835
+ timestamp: z18.number(),
2836
+ // Unix timestamp in seconds
2837
+ message: z18.string().optional(),
2838
+ parentCount: z18.number().nullable()
2839
+ });
2840
+ PrDiffDataZ = z18.object({
2841
+ diff: z18.string()
2842
+ });
2843
+ PrStatsZ = z18.object({
2844
+ additions: z18.number(),
2845
+ deletions: z18.number()
2846
+ });
2847
+ CommitsManifestZ = z18.object({
2848
+ commits: z18.array(z18.string())
2849
+ // Array of commit SHAs in order
2850
+ });
2851
+ BlameLineEntryZ = z18.object({
2852
+ file: z18.string(),
2853
+ line: z18.number(),
2854
+ originalCommitSha: z18.string(),
2855
+ originalLineNumber: z18.number()
2856
+ });
2857
+ BlameLinesDataZ = z18.object({
2858
+ lines: z18.array(BlameLineEntryZ)
2859
+ });
2860
+ PrepareCommitBlameResponseMessageZ = z18.object({
2861
+ /** Commit blame request ID (matches request, used to update specific DB record) */
2862
+ commitBlameRequestId: z18.string(),
2863
+ /** Organization ID (matches request) */
2864
+ organizationId: z18.string(),
2865
+ /** Repository URL (matches request) */
2866
+ repositoryUrl: z18.string(),
2867
+ /** Commit SHA analyzed (matches request) */
2868
+ commitSha: z18.string(),
2869
+ /** Processing status */
2870
+ status: z18.enum(["success", "failure"]),
2871
+ /** Error message (only present if status is 'failure') */
2872
+ error: z18.string().optional(),
2873
+ /**
2874
+ * Blame data for all processed files/chunks.
2875
+ * Empty dictionary if status is 'failure'.
2876
+ * Contains line mappings as arrays if status is 'success'.
2877
+ */
2878
+ blameData: CommitBlameDataZ,
2879
+ /**
2880
+ * Info about each commit referenced in the blame data plus the head commit.
2881
+ * Keyed by commit SHA, deduplicated.
2882
+ * Empty dictionary if status is 'failure'.
2883
+ */
2884
+ commits: z18.record(z18.string(), CommitInfoZ).default({}),
2885
+ // --- New PR diff computation response fields ---
2886
+ /** S3 paths for commit-level data (commitSha → S3 key). Present in PR analysis mode and single commit mode. */
2887
+ commitDataS3Paths: z18.record(z18.string(), z18.string()).optional(),
2888
+ /** S3 key for PR diff JSON. Present in PR analysis mode. */
2889
+ prDiffS3Path: z18.string().optional(),
2890
+ /** S3 key for commits manifest. Present in PR analysis mode. */
2891
+ commitsManifestS3Path: z18.string().optional(),
2892
+ /** S3 key for per-line targeted blame data. Present in PR analysis mode. */
2893
+ blameLinesS3Path: z18.string().optional(),
2894
+ /** S3 key for PR stats (additions/deletions). Present in PR analysis mode. */
2895
+ prStatsS3Path: z18.string().optional(),
2896
+ /** PR context passed through from request for response handler. */
2897
+ prContext: PrContextZ.optional(),
2898
+ /** PR title from the request metadata (passed through). */
2899
+ prTitle: z18.string().optional(),
2900
+ /** User email passed through from request for single commit blame attribution analysis trigger. */
2901
+ userEmail: z18.string().optional()
2902
+ });
2903
+ }
2904
+ });
2905
+
2692
2906
  // src/features/analysis/scm/services/ExcludedDirs.ts
2693
2907
  var EXCLUDED_DIRS;
2694
2908
  var init_ExcludedDirs = __esm({
@@ -3361,6 +3575,7 @@ var init_GitService = __esm({
3361
3575
  "src/features/analysis/scm/services/GitService.ts"() {
3362
3576
  "use strict";
3363
3577
  init_configs();
3578
+ init_gitBlameTypes();
3364
3579
  init_urlParser2();
3365
3580
  init_FileUtils();
3366
3581
  MAX_COMMIT_DIFF_SIZE_BYTES = 3 * 1024 * 1024;
@@ -3857,7 +4072,7 @@ ${rootContent}`;
3857
4072
  const DIFF_DELIMITER = "---MOBB_DIFF_START---";
3858
4073
  const output = await this.git.show([
3859
4074
  commitSha,
3860
- `--format=%cI%n${DIFF_DELIMITER}`,
4075
+ `--format=${COMMIT_LOG_FORMAT}%n${DIFF_DELIMITER}`,
3861
4076
  "--patch"
3862
4077
  ]);
3863
4078
  const delimiterIndex = output.indexOf(DIFF_DELIMITER);
@@ -3878,16 +4093,16 @@ ${rootContent}`;
3878
4093
  });
3879
4094
  return null;
3880
4095
  }
3881
- const metadataLines = metadataOutput.trim().split("\n");
3882
- if (metadataLines.length < 1 || !metadataLines[0]) {
4096
+ const metadataLine = metadataOutput.trim();
4097
+ const parsed = parseCommitLine(metadataLine);
4098
+ if (!parsed) {
3883
4099
  this.log("[GitService] Unexpected metadata format", "warning", {
3884
4100
  commitSha,
3885
- metadataLines
4101
+ metadataLine
3886
4102
  });
3887
4103
  return null;
3888
4104
  }
3889
- const timestampStr = metadataLines[0];
3890
- const timestamp = new Date(timestampStr);
4105
+ const timestamp = new Date(parsed.timestamp * 1e3);
3891
4106
  this.log("[GitService] Local commit data retrieved", "debug", {
3892
4107
  commitSha,
3893
4108
  diffSizeBytes,
@@ -3895,7 +4110,10 @@ ${rootContent}`;
3895
4110
  });
3896
4111
  return {
3897
4112
  diff,
3898
- timestamp
4113
+ timestamp,
4114
+ author: parsed.author,
4115
+ committer: parsed.committer,
4116
+ coAuthors: parsed.coAuthors
3899
4117
  };
3900
4118
  } catch (error) {
3901
4119
  const errorMessage = `Failed to get local commit data: ${error.message}`;
@@ -7381,34 +7599,34 @@ import querystring2 from "querystring";
7381
7599
  import * as bitbucketPkgNode from "bitbucket";
7382
7600
  import bitbucketPkg from "bitbucket";
7383
7601
  import Debug2 from "debug";
7384
- import { z as z19 } from "zod";
7602
+ import { z as z20 } from "zod";
7385
7603
 
7386
7604
  // src/features/analysis/scm/bitbucket/validation.ts
7387
- import { z as z18 } from "zod";
7388
- var BitbucketAuthResultZ = z18.object({
7389
- access_token: z18.string(),
7390
- token_type: z18.string(),
7391
- refresh_token: z18.string()
7605
+ import { z as z19 } from "zod";
7606
+ var BitbucketAuthResultZ = z19.object({
7607
+ access_token: z19.string(),
7608
+ token_type: z19.string(),
7609
+ refresh_token: z19.string()
7392
7610
  });
7393
7611
 
7394
7612
  // src/features/analysis/scm/bitbucket/bitbucket.ts
7395
7613
  var debug2 = Debug2("scm:bitbucket");
7396
7614
  var BITBUCKET_HOSTNAME = "bitbucket.org";
7397
- var TokenExpiredErrorZ = z19.object({
7398
- status: z19.number(),
7399
- error: z19.object({
7400
- type: z19.string(),
7401
- error: z19.object({
7402
- message: z19.string()
7615
+ var TokenExpiredErrorZ = z20.object({
7616
+ status: z20.number(),
7617
+ error: z20.object({
7618
+ type: z20.string(),
7619
+ error: z20.object({
7620
+ message: z20.string()
7403
7621
  })
7404
7622
  })
7405
7623
  });
7406
7624
  var BITBUCKET_ACCESS_TOKEN_URL = `https://${BITBUCKET_HOSTNAME}/site/oauth2/access_token`;
7407
7625
  var MAX_BITBUCKET_PR_BODY_LENGTH = 32768;
7408
- var BitbucketParseResultZ = z19.object({
7409
- organization: z19.string(),
7410
- repoName: z19.string(),
7411
- hostname: z19.literal(BITBUCKET_HOSTNAME)
7626
+ var BitbucketParseResultZ = z20.object({
7627
+ organization: z20.string(),
7628
+ repoName: z20.string(),
7629
+ hostname: z20.literal(BITBUCKET_HOSTNAME)
7412
7630
  });
7413
7631
  function parseBitbucketOrganizationAndRepo(bitbucketUrl) {
7414
7632
  const parsedGitHubUrl = normalizeUrl(bitbucketUrl);
@@ -7468,7 +7686,7 @@ function getBitbucketSdk(params) {
7468
7686
  if (!res.data.values) {
7469
7687
  return [];
7470
7688
  }
7471
- return res.data.values.filter((branch) => !!branch.name).map((branch) => z19.string().parse(branch.name));
7689
+ return res.data.values.filter((branch) => !!branch.name).map((branch) => z20.string().parse(branch.name));
7472
7690
  },
7473
7691
  async getIsUserCollaborator(params2) {
7474
7692
  const { repoUrl } = params2;
@@ -7583,7 +7801,7 @@ function getBitbucketSdk(params) {
7583
7801
  return GetReferenceResultZ.parse({
7584
7802
  sha: tagRes.data.target?.hash,
7585
7803
  type: "TAG" /* TAG */,
7586
- date: new Date(z19.string().parse(tagRes.data.target?.date))
7804
+ date: new Date(z20.string().parse(tagRes.data.target?.date))
7587
7805
  });
7588
7806
  },
7589
7807
  async getBranchRef(params2) {
@@ -7591,7 +7809,7 @@ function getBitbucketSdk(params) {
7591
7809
  return GetReferenceResultZ.parse({
7592
7810
  sha: getBranchRes.target?.hash,
7593
7811
  type: "BRANCH" /* BRANCH */,
7594
- date: new Date(z19.string().parse(getBranchRes.target?.date))
7812
+ date: new Date(z20.string().parse(getBranchRes.target?.date))
7595
7813
  });
7596
7814
  },
7597
7815
  async getCommitRef(params2) {
@@ -7599,13 +7817,13 @@ function getBitbucketSdk(params) {
7599
7817
  return GetReferenceResultZ.parse({
7600
7818
  sha: getCommitRes.hash,
7601
7819
  type: "COMMIT" /* COMMIT */,
7602
- date: new Date(z19.string().parse(getCommitRes.date))
7820
+ date: new Date(z20.string().parse(getCommitRes.date))
7603
7821
  });
7604
7822
  },
7605
7823
  async getDownloadUrl({ url, sha }) {
7606
7824
  this.getReferenceData({ ref: sha, url });
7607
7825
  const repoRes = await this.getRepo({ repoUrl: url });
7608
- const parsedRepoUrl = z19.string().url().parse(repoRes.links?.html?.href);
7826
+ const parsedRepoUrl = z20.string().url().parse(repoRes.links?.html?.href);
7609
7827
  return `${parsedRepoUrl}/get/${sha}.zip`;
7610
7828
  },
7611
7829
  async getPullRequest(params2) {
@@ -7670,7 +7888,7 @@ async function validateBitbucketParams(params) {
7670
7888
  }
7671
7889
  async function getUsersWorkspacesSlugs(bitbucketClient) {
7672
7890
  const res = await bitbucketClient.workspaces.getWorkspaces({});
7673
- return res.data.values?.map((v) => z19.string().parse(v.slug));
7891
+ return res.data.values?.map((v) => z20.string().parse(v.slug));
7674
7892
  }
7675
7893
  async function getAllUsersRepositories(bitbucketClient) {
7676
7894
  const userWorkspacesSlugs = await getUsersWorkspacesSlugs(bitbucketClient);
@@ -7698,10 +7916,10 @@ async function getRepositoriesByWorkspace(bitbucketClient, { workspaceSlug }) {
7698
7916
 
7699
7917
  // src/features/analysis/scm/bitbucket/BitbucketSCMLib.ts
7700
7918
  import { setTimeout as setTimeout3 } from "timers/promises";
7701
- import { z as z20 } from "zod";
7919
+ import { z as z21 } from "zod";
7702
7920
  function getUserAndPassword(token) {
7703
7921
  const [username, password] = token.split(":");
7704
- const safePasswordAndUsername = z20.object({ username: z20.string(), password: z20.string() }).parse({ username, password });
7922
+ const safePasswordAndUsername = z21.object({ username: z21.string(), password: z21.string() }).parse({ username, password });
7705
7923
  return {
7706
7924
  username: safePasswordAndUsername.username,
7707
7925
  password: safePasswordAndUsername.password
@@ -7773,7 +7991,7 @@ var BitbucketSCMLib = class extends SCMLib {
7773
7991
  return { username, password, authType };
7774
7992
  }
7775
7993
  case "token": {
7776
- return { authType, token: z20.string().parse(this.accessToken) };
7994
+ return { authType, token: z21.string().parse(this.accessToken) };
7777
7995
  }
7778
7996
  case "public":
7779
7997
  return { authType };
@@ -7787,7 +8005,7 @@ var BitbucketSCMLib = class extends SCMLib {
7787
8005
  ...params,
7788
8006
  repoUrl: this.url
7789
8007
  });
7790
- return String(z20.number().parse(pullRequestRes.id));
8008
+ return String(z21.number().parse(pullRequestRes.id));
7791
8009
  } catch (e) {
7792
8010
  console.warn(
7793
8011
  `error creating pull request for BB. Try number ${String(i + 1).replace(/\n|\r/g, "")}`,
@@ -7872,7 +8090,7 @@ var BitbucketSCMLib = class extends SCMLib {
7872
8090
  async getUsername() {
7873
8091
  this._validateAccessToken();
7874
8092
  const res = await this.bitbucketSdk.getUser();
7875
- return z20.string().parse(res["username"]);
8093
+ return z21.string().parse(res["username"]);
7876
8094
  }
7877
8095
  async getSubmitRequestStatus(_scmSubmitRequestId) {
7878
8096
  this._validateAccessTokenAndUrl();
@@ -7898,7 +8116,7 @@ var BitbucketSCMLib = class extends SCMLib {
7898
8116
  async getRepoDefaultBranch() {
7899
8117
  this._validateUrl();
7900
8118
  const repoRes = await this.bitbucketSdk.getRepo({ repoUrl: this.url });
7901
- return z20.string().parse(repoRes.mainbranch?.name);
8119
+ return z21.string().parse(repoRes.mainbranch?.name);
7902
8120
  }
7903
8121
  getSubmitRequestUrl(submitRequestId) {
7904
8122
  this._validateUrl();
@@ -7964,7 +8182,7 @@ var REPORT_DEFAULT_FILE_NAME = "report.json";
7964
8182
  init_env();
7965
8183
 
7966
8184
  // src/features/analysis/scm/github/GithubSCMLib.ts
7967
- import { z as z21 } from "zod";
8185
+ import { z as z22 } from "zod";
7968
8186
  init_client_generates();
7969
8187
 
7970
8188
  // src/features/analysis/scm/utils/cursorValidation.ts
@@ -8949,7 +9167,7 @@ var GithubSCMLib = class extends SCMLib {
8949
9167
  owner,
8950
9168
  repo
8951
9169
  });
8952
- return z21.string().parse(prRes.data);
9170
+ return z22.string().parse(prRes.data);
8953
9171
  }
8954
9172
  async getRepoList(_scmOrg) {
8955
9173
  this._validateAccessToken();
@@ -9402,11 +9620,11 @@ var contextLogger = {
9402
9620
  init_env();
9403
9621
 
9404
9622
  // src/features/analysis/scm/gitlab/types.ts
9405
- import { z as z22 } from "zod";
9406
- var GitlabAuthResultZ = z22.object({
9407
- access_token: z22.string(),
9408
- token_type: z22.string(),
9409
- refresh_token: z22.string()
9623
+ import { z as z23 } from "zod";
9624
+ var GitlabAuthResultZ = z23.object({
9625
+ access_token: z23.string(),
9626
+ token_type: z23.string(),
9627
+ refresh_token: z23.string()
9410
9628
  });
9411
9629
 
9412
9630
  // src/features/analysis/scm/gitlab/gitlab.ts
@@ -10442,7 +10660,7 @@ var GitlabSCMLib = class extends SCMLib {
10442
10660
  };
10443
10661
 
10444
10662
  // src/features/analysis/scm/scmFactory.ts
10445
- import { z as z23 } from "zod";
10663
+ import { z as z24 } from "zod";
10446
10664
 
10447
10665
  // src/features/analysis/scm/StubSCMLib.ts
10448
10666
  var StubSCMLib = class extends SCMLib {
@@ -10579,7 +10797,7 @@ async function createScmLib({ url, accessToken, scmType, scmOrg }, { propagateEx
10579
10797
  if (e instanceof InvalidRepoUrlError && url) {
10580
10798
  throw new RepoNoTokenAccessError(
10581
10799
  "no access to repo",
10582
- scmLibScmTypeToScmType[z23.nativeEnum(ScmLibScmType).parse(scmType)]
10800
+ scmLibScmTypeToScmType[z24.nativeEnum(ScmLibScmType).parse(scmType)]
10583
10801
  );
10584
10802
  }
10585
10803
  console.error(`error validating scm: ${scmType} `, e);
@@ -11169,7 +11387,7 @@ import path6 from "path";
11169
11387
  import chalk from "chalk";
11170
11388
  import Debug4 from "debug";
11171
11389
  import * as dotenv from "dotenv";
11172
- import { z as z24 } from "zod";
11390
+ import { z as z25 } from "zod";
11173
11391
  var debug5 = Debug4("mobbdev:constants");
11174
11392
  var runtimeConfigPath = path6.join(
11175
11393
  getModuleRootDir(),
@@ -11214,17 +11432,17 @@ var scannerToVulnerabilityReportVendorEnum = {
11214
11432
  [SCANNERS.Semgrep]: "semgrep" /* Semgrep */,
11215
11433
  [SCANNERS.Datadog]: "datadog" /* Datadog */
11216
11434
  };
11217
- var SupportedScannersZ = z24.enum([SCANNERS.Checkmarx, SCANNERS.Snyk]);
11218
- var envVariablesSchema = z24.object({
11435
+ var SupportedScannersZ = z25.enum([SCANNERS.Checkmarx, SCANNERS.Snyk]);
11436
+ var envVariablesSchema = z25.object({
11219
11437
  // These have safe defaults for production - the VS Code extension passes explicit URLs
11220
- WEB_APP_URL: z24.string().optional().default(DEFAULT_WEB_APP_URL),
11221
- API_URL: z24.string().optional().default(DEFAULT_API_URL),
11438
+ WEB_APP_URL: z25.string().optional().default(DEFAULT_WEB_APP_URL),
11439
+ API_URL: z25.string().optional().default(DEFAULT_API_URL),
11222
11440
  // These are only needed for local development with Hasura
11223
- HASURA_ACCESS_KEY: z24.string().optional().default(""),
11224
- LOCAL_GRAPHQL_ENDPOINT: z24.string().optional().default(""),
11441
+ HASURA_ACCESS_KEY: z25.string().optional().default(""),
11442
+ LOCAL_GRAPHQL_ENDPOINT: z25.string().optional().default(""),
11225
11443
  // Proxy settings
11226
- HTTP_PROXY: z24.string().optional().default(""),
11227
- HTTPS_PROXY: z24.string().optional().default("")
11444
+ HTTP_PROXY: z25.string().optional().default(""),
11445
+ HTTPS_PROXY: z25.string().optional().default("")
11228
11446
  });
11229
11447
  var envVariables = envVariablesSchema.parse(process.env);
11230
11448
  debug5("config %o", envVariables);
@@ -11475,7 +11693,7 @@ import { createSpinner as createSpinner4 } from "nanospinner";
11475
11693
  import fetch4 from "node-fetch";
11476
11694
  import open3 from "open";
11477
11695
  import tmp2 from "tmp";
11478
- import { z as z29 } from "zod";
11696
+ import { z as z30 } from "zod";
11479
11697
 
11480
11698
  // src/commands/handleMobbLogin.ts
11481
11699
  import chalk3 from "chalk";
@@ -11763,62 +11981,62 @@ init_client_generates();
11763
11981
 
11764
11982
  // src/features/analysis/graphql/types.ts
11765
11983
  init_client_generates();
11766
- import { z as z25 } from "zod";
11767
- var VulnerabilityReportIssueCodeNodeZ = z25.object({
11768
- vulnerabilityReportIssueId: z25.string(),
11769
- path: z25.string(),
11770
- startLine: z25.number(),
11771
- vulnerabilityReportIssue: z25.object({
11772
- fixId: z25.string(),
11773
- category: z25.nativeEnum(Vulnerability_Report_Issue_Category_Enum),
11774
- safeIssueType: z25.string(),
11775
- vulnerabilityReportIssueTags: z25.array(
11776
- z25.object({
11777
- tag: z25.nativeEnum(Vulnerability_Report_Issue_Tag_Enum)
11984
+ import { z as z26 } from "zod";
11985
+ var VulnerabilityReportIssueCodeNodeZ = z26.object({
11986
+ vulnerabilityReportIssueId: z26.string(),
11987
+ path: z26.string(),
11988
+ startLine: z26.number(),
11989
+ vulnerabilityReportIssue: z26.object({
11990
+ fixId: z26.string(),
11991
+ category: z26.nativeEnum(Vulnerability_Report_Issue_Category_Enum),
11992
+ safeIssueType: z26.string(),
11993
+ vulnerabilityReportIssueTags: z26.array(
11994
+ z26.object({
11995
+ tag: z26.nativeEnum(Vulnerability_Report_Issue_Tag_Enum)
11778
11996
  })
11779
11997
  )
11780
11998
  })
11781
11999
  });
11782
- var VulnerabilityReportIssueNoFixCodeNodeZ = z25.object({
11783
- vulnerabilityReportIssues: z25.array(
11784
- z25.object({
11785
- id: z25.string(),
11786
- fixId: z25.string().nullable(),
11787
- category: z25.nativeEnum(Vulnerability_Report_Issue_Category_Enum),
11788
- safeIssueType: z25.string(),
11789
- fpId: z25.string().uuid().nullable(),
11790
- codeNodes: z25.array(
11791
- z25.object({
11792
- path: z25.string(),
11793
- startLine: z25.number()
12000
+ var VulnerabilityReportIssueNoFixCodeNodeZ = z26.object({
12001
+ vulnerabilityReportIssues: z26.array(
12002
+ z26.object({
12003
+ id: z26.string(),
12004
+ fixId: z26.string().nullable(),
12005
+ category: z26.nativeEnum(Vulnerability_Report_Issue_Category_Enum),
12006
+ safeIssueType: z26.string(),
12007
+ fpId: z26.string().uuid().nullable(),
12008
+ codeNodes: z26.array(
12009
+ z26.object({
12010
+ path: z26.string(),
12011
+ startLine: z26.number()
11794
12012
  })
11795
12013
  ),
11796
- vulnerabilityReportIssueTags: z25.array(
11797
- z25.object({
11798
- tag: z25.nativeEnum(Vulnerability_Report_Issue_Tag_Enum)
12014
+ vulnerabilityReportIssueTags: z26.array(
12015
+ z26.object({
12016
+ tag: z26.nativeEnum(Vulnerability_Report_Issue_Tag_Enum)
11799
12017
  })
11800
12018
  )
11801
12019
  })
11802
12020
  )
11803
12021
  });
11804
- var GetVulByNodesMetadataZ = z25.object({
11805
- vulnerabilityReportIssueCodeNodes: z25.array(VulnerabilityReportIssueCodeNodeZ),
11806
- nonFixablePrVuls: z25.object({
11807
- aggregate: z25.object({
11808
- count: z25.number()
12022
+ var GetVulByNodesMetadataZ = z26.object({
12023
+ vulnerabilityReportIssueCodeNodes: z26.array(VulnerabilityReportIssueCodeNodeZ),
12024
+ nonFixablePrVuls: z26.object({
12025
+ aggregate: z26.object({
12026
+ count: z26.number()
11809
12027
  })
11810
12028
  }),
11811
- fixablePrVuls: z25.object({
11812
- aggregate: z25.object({
11813
- count: z25.number()
12029
+ fixablePrVuls: z26.object({
12030
+ aggregate: z26.object({
12031
+ count: z26.number()
11814
12032
  })
11815
12033
  }),
11816
- totalScanVulnerabilities: z25.object({
11817
- aggregate: z25.object({
11818
- count: z25.number()
12034
+ totalScanVulnerabilities: z26.object({
12035
+ aggregate: z26.object({
12036
+ count: z26.number()
11819
12037
  })
11820
12038
  }),
11821
- irrelevantVulnerabilityReportIssue: z25.array(
12039
+ irrelevantVulnerabilityReportIssue: z26.array(
11822
12040
  VulnerabilityReportIssueNoFixCodeNodeZ
11823
12041
  )
11824
12042
  });
@@ -12595,7 +12813,7 @@ import Debug11 from "debug";
12595
12813
  // src/features/analysis/add_fix_comments_for_pr/utils/utils.ts
12596
12814
  import Debug10 from "debug";
12597
12815
  import parseDiff from "parse-diff";
12598
- import { z as z27 } from "zod";
12816
+ import { z as z28 } from "zod";
12599
12817
 
12600
12818
  // src/features/analysis/utils/by_key.ts
12601
12819
  function keyBy(array, keyBy2) {
@@ -12683,7 +12901,7 @@ var scannerToFriendlyString = {
12683
12901
 
12684
12902
  // src/features/analysis/add_fix_comments_for_pr/utils/buildCommentBody.ts
12685
12903
  import Debug9 from "debug";
12686
- import { z as z26 } from "zod";
12904
+ import { z as z27 } from "zod";
12687
12905
  init_client_generates();
12688
12906
  var debug10 = Debug9("mobbdev:handle-finished-analysis");
12689
12907
  var getCommitFixButton = (commitUrl) => `<a href="${commitUrl}"><img src=${COMMIT_FIX_SVG}></a>`;
@@ -12737,11 +12955,11 @@ function buildFixCommentBody({
12737
12955
  });
12738
12956
  const issueType = getIssueTypeFriendlyString(fix.safeIssueType);
12739
12957
  const title = `# ${MobbIconMarkdown} ${issueType} fix is ready`;
12740
- const validFixParseRes = z26.object({
12958
+ const validFixParseRes = z27.object({
12741
12959
  patchAndQuestions: PatchAndQuestionsZ,
12742
- safeIssueLanguage: z26.nativeEnum(IssueLanguage_Enum),
12743
- severityText: z26.nativeEnum(Vulnerability_Severity_Enum),
12744
- safeIssueType: z26.nativeEnum(IssueType_Enum)
12960
+ safeIssueLanguage: z27.nativeEnum(IssueLanguage_Enum),
12961
+ severityText: z27.nativeEnum(Vulnerability_Severity_Enum),
12962
+ safeIssueType: z27.nativeEnum(IssueType_Enum)
12745
12963
  }).safeParse(fix);
12746
12964
  if (!validFixParseRes.success) {
12747
12965
  debug10(
@@ -12975,7 +13193,7 @@ async function getRelevantVulenrabilitiesFromDiff(params) {
12975
13193
  });
12976
13194
  const lineAddedRanges = calculateRanges(fileNumbers);
12977
13195
  const fileFilter = {
12978
- path: z27.string().parse(file.to),
13196
+ path: z28.string().parse(file.to),
12979
13197
  ranges: lineAddedRanges.map(([startLine, endLine]) => ({
12980
13198
  endLine,
12981
13199
  startLine
@@ -13287,15 +13505,15 @@ import { globby } from "globby";
13287
13505
  import { isBinary as isBinary2 } from "istextorbinary";
13288
13506
  import { simpleGit as simpleGit3 } from "simple-git";
13289
13507
  import { parseStringPromise } from "xml2js";
13290
- import { z as z28 } from "zod";
13508
+ import { z as z29 } from "zod";
13291
13509
  var debug15 = Debug14("mobbdev:pack");
13292
- var FPR_SOURCE_CODE_FILE_MAPPING_SCHEMA = z28.object({
13293
- properties: z28.object({
13294
- entry: z28.array(
13295
- z28.object({
13296
- _: z28.string(),
13297
- $: z28.object({
13298
- key: z28.string()
13510
+ var FPR_SOURCE_CODE_FILE_MAPPING_SCHEMA = z29.object({
13511
+ properties: z29.object({
13512
+ entry: z29.array(
13513
+ z29.object({
13514
+ _: z29.string(),
13515
+ $: z29.object({
13516
+ key: z29.string()
13299
13517
  })
13300
13518
  })
13301
13519
  )
@@ -14117,7 +14335,7 @@ async function _scan(params, { skipPrompts = false } = {}) {
14117
14335
  spinner: mobbSpinner,
14118
14336
  submitVulnerabilityReportVariables: {
14119
14337
  fixReportId: reportUploadInfo.fixReportId,
14120
- repoUrl: z29.string().parse(repo),
14338
+ repoUrl: z30.string().parse(repo),
14121
14339
  reference,
14122
14340
  projectId,
14123
14341
  vulnerabilityReportFileName: shouldScan ? void 0 : REPORT_DEFAULT_FILE_NAME,
@@ -14450,9 +14668,9 @@ async function waitForAnaysisAndReviewPr({
14450
14668
  gqlClient,
14451
14669
  polling
14452
14670
  }) {
14453
- const params = z29.object({
14454
- repo: z29.string().url(),
14455
- githubActionToken: z29.string()
14671
+ const params = z30.object({
14672
+ repo: z30.string().url(),
14673
+ githubActionToken: z30.string()
14456
14674
  }).parse({ repo, githubActionToken });
14457
14675
  const scm = await createScmLib(
14458
14676
  {
@@ -14470,7 +14688,7 @@ async function waitForAnaysisAndReviewPr({
14470
14688
  analysisId: analysisId2,
14471
14689
  gqlClient,
14472
14690
  scm,
14473
- scanner: z29.nativeEnum(SCANNERS).parse(scanner)
14691
+ scanner: z30.nativeEnum(SCANNERS).parse(scanner)
14474
14692
  });
14475
14693
  };
14476
14694
  if (polling) {
@@ -14784,7 +15002,7 @@ async function scanSkill(options) {
14784
15002
  // src/args/validation.ts
14785
15003
  import chalk8 from "chalk";
14786
15004
  import path11 from "path";
14787
- import { z as z30 } from "zod";
15005
+ import { z as z31 } from "zod";
14788
15006
  function throwRepoUrlErrorMessage({
14789
15007
  error,
14790
15008
  repoUrl,
@@ -14801,11 +15019,11 @@ Example:
14801
15019
  )}`;
14802
15020
  throw new CliError(formattedErrorMessage);
14803
15021
  }
14804
- var UrlZ = z30.string({
15022
+ var UrlZ = z31.string({
14805
15023
  invalid_type_error: `is not a valid ${Object.values(ScmType).join("/ ")} URL`
14806
15024
  });
14807
15025
  function validateOrganizationId(organizationId) {
14808
- const orgIdValidation = z30.string().uuid().nullish().safeParse(organizationId);
15026
+ const orgIdValidation = z31.string().uuid().nullish().safeParse(organizationId);
14809
15027
  if (!orgIdValidation.success) {
14810
15028
  throw new CliError(`organizationId: ${organizationId} is not a valid UUID`);
14811
15029
  }
@@ -14913,7 +15131,7 @@ async function analyzeHandler(args) {
14913
15131
  }
14914
15132
 
14915
15133
  // src/features/claude_code/data_collector.ts
14916
- import { z as z32 } from "zod";
15134
+ import { z as z33 } from "zod";
14917
15135
 
14918
15136
  // src/args/commands/upload_ai_blame.ts
14919
15137
  import fsPromises3 from "fs/promises";
@@ -14921,7 +15139,7 @@ import * as os3 from "os";
14921
15139
  import path12 from "path";
14922
15140
  import chalk10 from "chalk";
14923
15141
  import { withFile } from "tmp-promise";
14924
- import z31 from "zod";
15142
+ import z32 from "zod";
14925
15143
  init_client_generates();
14926
15144
  init_GitService();
14927
15145
  init_urlParser2();
@@ -15020,7 +15238,8 @@ import { OpenRedaction } from "@openredaction/openredaction";
15020
15238
  var openRedaction = new OpenRedaction({
15021
15239
  patterns: [
15022
15240
  // Core Personal Data
15023
- "EMAIL",
15241
+ // Removed EMAIL - causes false positives in code/test snippets (e.g. --author="Eve Author <eve@example.com>")
15242
+ // Prefer false negatives over false positives for this use case.
15024
15243
  "SSN",
15025
15244
  "NATIONAL_INSURANCE_UK",
15026
15245
  "DATE_OF_BIRTH",
@@ -15035,7 +15254,8 @@ var openRedaction = new OpenRedaction({
15035
15254
  "VISA_MRZ",
15036
15255
  "TAX_ID",
15037
15256
  // Financial Data (removed SWIFT_BIC, CARD_AUTH_CODE - too broad, causing false positives with authentication words)
15038
- "CREDIT_CARD",
15257
+ // Removed CREDIT_CARD - causes false positives on zero-filled UUIDs (e.g. '00000000-0000-0000-0000-000000000000')
15258
+ // Prefer false negatives over false positives for this use case.
15039
15259
  "IBAN",
15040
15260
  "BANK_ACCOUNT_UK",
15041
15261
  "ROUTING_NUMBER_US",
@@ -15121,15 +15341,6 @@ async function sanitizeDataWithCounts(obj) {
15121
15341
  ...piiDetections.low
15122
15342
  ];
15123
15343
  for (const detection of allDetections) {
15124
- if (detection.type === "CREDIT_CARD") {
15125
- const start = detection.position[0];
15126
- const end = detection.position[1];
15127
- const charBefore = (start > 0 ? str[start - 1] : "") ?? "";
15128
- const charAfter = str[end] ?? "";
15129
- if (charBefore === "." || charBefore >= "0" && charBefore <= "9" || charAfter >= "0" && charAfter <= "9") {
15130
- continue;
15131
- }
15132
- }
15133
15344
  counts.detections.total++;
15134
15345
  if (detection.severity === "high") counts.detections.high++;
15135
15346
  else if (detection.severity === "medium") counts.detections.medium++;
@@ -15182,8 +15393,8 @@ var defaultLogger2 = {
15182
15393
  }
15183
15394
  }
15184
15395
  };
15185
- var PromptItemZ = z31.object({
15186
- type: z31.enum([
15396
+ var PromptItemZ = z32.object({
15397
+ type: z32.enum([
15187
15398
  "USER_PROMPT",
15188
15399
  "AI_RESPONSE",
15189
15400
  "TOOL_EXECUTION",
@@ -15191,32 +15402,32 @@ var PromptItemZ = z31.object({
15191
15402
  "MCP_TOOL_CALL"
15192
15403
  // MCP (Model Context Protocol) tool invocation
15193
15404
  ]),
15194
- attachedFiles: z31.array(
15195
- z31.object({
15196
- relativePath: z31.string(),
15197
- startLine: z31.number().optional()
15405
+ attachedFiles: z32.array(
15406
+ z32.object({
15407
+ relativePath: z32.string(),
15408
+ startLine: z32.number().optional()
15198
15409
  })
15199
15410
  ).optional(),
15200
- tokens: z31.object({
15201
- inputCount: z31.number(),
15202
- outputCount: z31.number()
15411
+ tokens: z32.object({
15412
+ inputCount: z32.number(),
15413
+ outputCount: z32.number()
15203
15414
  }).optional(),
15204
- text: z31.string().optional(),
15205
- date: z31.date().optional(),
15206
- tool: z31.object({
15207
- name: z31.string(),
15208
- parameters: z31.string(),
15209
- result: z31.string(),
15210
- rawArguments: z31.string().optional(),
15211
- accepted: z31.boolean().optional(),
15415
+ text: z32.string().optional(),
15416
+ date: z32.date().optional(),
15417
+ tool: z32.object({
15418
+ name: z32.string(),
15419
+ parameters: z32.string(),
15420
+ result: z32.string(),
15421
+ rawArguments: z32.string().optional(),
15422
+ accepted: z32.boolean().optional(),
15212
15423
  // MCP-specific fields (only populated for MCP_TOOL_CALL type)
15213
- mcpServer: z31.string().optional(),
15424
+ mcpServer: z32.string().optional(),
15214
15425
  // MCP server name (e.g., "datadog", "mobb-mcp")
15215
- mcpToolName: z31.string().optional()
15426
+ mcpToolName: z32.string().optional()
15216
15427
  // MCP tool name without prefix (e.g., "scan_and_fix_vulnerabilities")
15217
15428
  }).optional()
15218
15429
  });
15219
- var PromptItemArrayZ = z31.array(PromptItemZ);
15430
+ var PromptItemArrayZ = z32.array(PromptItemZ);
15220
15431
  async function getRepositoryUrl() {
15221
15432
  try {
15222
15433
  const gitService = new GitService(process.cwd());
@@ -15606,46 +15817,46 @@ async function parseTranscriptAndCreateTrace(transcriptPath, hookData, inference
15606
15817
  }
15607
15818
 
15608
15819
  // src/features/claude_code/data_collector.ts
15609
- var StructuredPatchItemSchema = z32.object({
15610
- oldStart: z32.number(),
15611
- oldLines: z32.number(),
15612
- newStart: z32.number(),
15613
- newLines: z32.number(),
15614
- lines: z32.array(z32.string())
15820
+ var StructuredPatchItemSchema = z33.object({
15821
+ oldStart: z33.number(),
15822
+ oldLines: z33.number(),
15823
+ newStart: z33.number(),
15824
+ newLines: z33.number(),
15825
+ lines: z33.array(z33.string())
15615
15826
  });
15616
- var EditToolInputSchema = z32.object({
15617
- file_path: z32.string(),
15618
- old_string: z32.string(),
15619
- new_string: z32.string()
15827
+ var EditToolInputSchema = z33.object({
15828
+ file_path: z33.string(),
15829
+ old_string: z33.string(),
15830
+ new_string: z33.string()
15620
15831
  });
15621
- var WriteToolInputSchema = z32.object({
15622
- file_path: z32.string(),
15623
- content: z32.string()
15832
+ var WriteToolInputSchema = z33.object({
15833
+ file_path: z33.string(),
15834
+ content: z33.string()
15624
15835
  });
15625
- var EditToolResponseSchema = z32.object({
15626
- filePath: z32.string(),
15627
- oldString: z32.string().optional(),
15628
- newString: z32.string().optional(),
15629
- originalFile: z32.string().optional(),
15630
- structuredPatch: z32.array(StructuredPatchItemSchema),
15631
- userModified: z32.boolean().optional(),
15632
- replaceAll: z32.boolean().optional()
15836
+ var EditToolResponseSchema = z33.object({
15837
+ filePath: z33.string(),
15838
+ oldString: z33.string().optional(),
15839
+ newString: z33.string().optional(),
15840
+ originalFile: z33.string().optional(),
15841
+ structuredPatch: z33.array(StructuredPatchItemSchema),
15842
+ userModified: z33.boolean().optional(),
15843
+ replaceAll: z33.boolean().optional()
15633
15844
  });
15634
- var WriteToolResponseSchema = z32.object({
15635
- type: z32.string().optional(),
15636
- filePath: z32.string(),
15637
- content: z32.string().optional(),
15638
- structuredPatch: z32.array(z32.any()).optional()
15845
+ var WriteToolResponseSchema = z33.object({
15846
+ type: z33.string().optional(),
15847
+ filePath: z33.string(),
15848
+ content: z33.string().optional(),
15849
+ structuredPatch: z33.array(z33.any()).optional()
15639
15850
  });
15640
- var HookDataSchema = z32.object({
15641
- session_id: z32.string(),
15642
- transcript_path: z32.string(),
15643
- cwd: z32.string(),
15644
- permission_mode: z32.string().optional(),
15645
- hook_event_name: z32.literal("PostToolUse"),
15646
- tool_name: z32.enum(["Edit", "Write"]),
15647
- tool_input: z32.union([EditToolInputSchema, WriteToolInputSchema]),
15648
- tool_response: z32.union([EditToolResponseSchema, WriteToolResponseSchema])
15851
+ var HookDataSchema = z33.object({
15852
+ session_id: z33.string(),
15853
+ transcript_path: z33.string(),
15854
+ cwd: z33.string(),
15855
+ permission_mode: z33.string().optional(),
15856
+ hook_event_name: z33.literal("PostToolUse"),
15857
+ tool_name: z33.enum(["Edit", "Write"]),
15858
+ tool_input: z33.union([EditToolInputSchema, WriteToolInputSchema]),
15859
+ tool_response: z33.union([EditToolResponseSchema, WriteToolResponseSchema])
15649
15860
  });
15650
15861
  async function readStdinData() {
15651
15862
  return new Promise((resolve, reject) => {
@@ -16118,131 +16329,131 @@ init_configs();
16118
16329
 
16119
16330
  // src/mcp/types.ts
16120
16331
  init_client_generates();
16121
- import { z as z33 } from "zod";
16122
- var ScanAndFixVulnerabilitiesToolSchema = z33.object({
16123
- path: z33.string()
16332
+ import { z as z34 } from "zod";
16333
+ var ScanAndFixVulnerabilitiesToolSchema = z34.object({
16334
+ path: z34.string()
16124
16335
  });
16125
- var VulnerabilityReportIssueTagSchema = z33.object({
16126
- vulnerability_report_issue_tag_value: z33.nativeEnum(
16336
+ var VulnerabilityReportIssueTagSchema = z34.object({
16337
+ vulnerability_report_issue_tag_value: z34.nativeEnum(
16127
16338
  Vulnerability_Report_Issue_Tag_Enum
16128
16339
  )
16129
16340
  });
16130
- var VulnerabilityReportIssueSchema = z33.object({
16131
- category: z33.any().optional().nullable(),
16132
- parsedIssueType: z33.nativeEnum(IssueType_Enum).nullable().optional(),
16133
- parsedSeverity: z33.nativeEnum(Vulnerability_Severity_Enum).nullable().optional(),
16134
- vulnerabilityReportIssueTags: z33.array(VulnerabilityReportIssueTagSchema)
16341
+ var VulnerabilityReportIssueSchema = z34.object({
16342
+ category: z34.any().optional().nullable(),
16343
+ parsedIssueType: z34.nativeEnum(IssueType_Enum).nullable().optional(),
16344
+ parsedSeverity: z34.nativeEnum(Vulnerability_Severity_Enum).nullable().optional(),
16345
+ vulnerabilityReportIssueTags: z34.array(VulnerabilityReportIssueTagSchema)
16135
16346
  });
16136
- var SharedStateSchema = z33.object({
16137
- __typename: z33.literal("fix_shared_state").optional(),
16138
- id: z33.any(),
16347
+ var SharedStateSchema = z34.object({
16348
+ __typename: z34.literal("fix_shared_state").optional(),
16349
+ id: z34.any(),
16139
16350
  // GraphQL uses `any` type for UUID
16140
- downloadedBy: z33.array(z33.any().nullable()).optional().nullable()
16351
+ downloadedBy: z34.array(z34.any().nullable()).optional().nullable()
16141
16352
  });
16142
- var UnstructuredFixExtraContextSchema = z33.object({
16143
- __typename: z33.literal("UnstructuredFixExtraContext").optional(),
16144
- key: z33.string(),
16145
- value: z33.any()
16353
+ var UnstructuredFixExtraContextSchema = z34.object({
16354
+ __typename: z34.literal("UnstructuredFixExtraContext").optional(),
16355
+ key: z34.string(),
16356
+ value: z34.any()
16146
16357
  // GraphQL JSON type
16147
16358
  });
16148
- var FixExtraContextResponseSchema = z33.object({
16149
- __typename: z33.literal("FixExtraContextResponse").optional(),
16150
- extraContext: z33.array(UnstructuredFixExtraContextSchema),
16151
- fixDescription: z33.string()
16359
+ var FixExtraContextResponseSchema = z34.object({
16360
+ __typename: z34.literal("FixExtraContextResponse").optional(),
16361
+ extraContext: z34.array(UnstructuredFixExtraContextSchema),
16362
+ fixDescription: z34.string()
16152
16363
  });
16153
- var FixDataSchema = z33.object({
16154
- __typename: z33.literal("FixData"),
16155
- patch: z33.string(),
16156
- patchOriginalEncodingBase64: z33.string(),
16364
+ var FixDataSchema = z34.object({
16365
+ __typename: z34.literal("FixData"),
16366
+ patch: z34.string(),
16367
+ patchOriginalEncodingBase64: z34.string(),
16157
16368
  extraContext: FixExtraContextResponseSchema
16158
16369
  });
16159
- var GetFixNoFixErrorSchema = z33.object({
16160
- __typename: z33.literal("GetFixNoFixError")
16370
+ var GetFixNoFixErrorSchema = z34.object({
16371
+ __typename: z34.literal("GetFixNoFixError")
16161
16372
  });
16162
- var PatchAndQuestionsSchema = z33.union([FixDataSchema, GetFixNoFixErrorSchema]);
16163
- var McpFixSchema = z33.object({
16164
- __typename: z33.literal("fix").optional(),
16165
- id: z33.any(),
16373
+ var PatchAndQuestionsSchema = z34.union([FixDataSchema, GetFixNoFixErrorSchema]);
16374
+ var McpFixSchema = z34.object({
16375
+ __typename: z34.literal("fix").optional(),
16376
+ id: z34.any(),
16166
16377
  // GraphQL uses `any` type for UUID
16167
- confidence: z33.number(),
16168
- safeIssueType: z33.string().nullable(),
16169
- severityText: z33.string().nullable(),
16170
- gitBlameLogin: z33.string().nullable().optional(),
16378
+ confidence: z34.number(),
16379
+ safeIssueType: z34.string().nullable(),
16380
+ severityText: z34.string().nullable(),
16381
+ gitBlameLogin: z34.string().nullable().optional(),
16171
16382
  // Optional in GraphQL
16172
- severityValue: z33.number().nullable(),
16173
- vulnerabilityReportIssues: z33.array(VulnerabilityReportIssueSchema),
16383
+ severityValue: z34.number().nullable(),
16384
+ vulnerabilityReportIssues: z34.array(VulnerabilityReportIssueSchema),
16174
16385
  sharedState: SharedStateSchema.nullable().optional(),
16175
16386
  // Optional in GraphQL
16176
16387
  patchAndQuestions: PatchAndQuestionsSchema,
16177
16388
  // Additional field added by the client
16178
- fixUrl: z33.string().optional()
16389
+ fixUrl: z34.string().optional()
16179
16390
  });
16180
- var FixAggregateSchema = z33.object({
16181
- __typename: z33.literal("fix_aggregate").optional(),
16182
- aggregate: z33.object({
16183
- __typename: z33.literal("fix_aggregate_fields").optional(),
16184
- count: z33.number()
16391
+ var FixAggregateSchema = z34.object({
16392
+ __typename: z34.literal("fix_aggregate").optional(),
16393
+ aggregate: z34.object({
16394
+ __typename: z34.literal("fix_aggregate_fields").optional(),
16395
+ count: z34.number()
16185
16396
  }).nullable()
16186
16397
  });
16187
- var VulnerabilityReportIssueAggregateSchema = z33.object({
16188
- __typename: z33.literal("vulnerability_report_issue_aggregate").optional(),
16189
- aggregate: z33.object({
16190
- __typename: z33.literal("vulnerability_report_issue_aggregate_fields").optional(),
16191
- count: z33.number()
16398
+ var VulnerabilityReportIssueAggregateSchema = z34.object({
16399
+ __typename: z34.literal("vulnerability_report_issue_aggregate").optional(),
16400
+ aggregate: z34.object({
16401
+ __typename: z34.literal("vulnerability_report_issue_aggregate_fields").optional(),
16402
+ count: z34.number()
16192
16403
  }).nullable()
16193
16404
  });
16194
- var RepoSchema = z33.object({
16195
- __typename: z33.literal("repo").optional(),
16196
- originalUrl: z33.string()
16405
+ var RepoSchema = z34.object({
16406
+ __typename: z34.literal("repo").optional(),
16407
+ originalUrl: z34.string()
16197
16408
  });
16198
- var ProjectSchema = z33.object({
16199
- id: z33.any(),
16409
+ var ProjectSchema = z34.object({
16410
+ id: z34.any(),
16200
16411
  // GraphQL uses `any` type for UUID
16201
- organizationId: z33.any()
16412
+ organizationId: z34.any()
16202
16413
  // GraphQL uses `any` type for UUID
16203
16414
  });
16204
- var VulnerabilityReportSchema = z33.object({
16205
- scanDate: z33.any().nullable(),
16415
+ var VulnerabilityReportSchema = z34.object({
16416
+ scanDate: z34.any().nullable(),
16206
16417
  // GraphQL uses `any` type for timestamp
16207
- vendor: z33.string(),
16418
+ vendor: z34.string(),
16208
16419
  // GraphQL generates as string, not enum
16209
- projectId: z33.any().optional(),
16420
+ projectId: z34.any().optional(),
16210
16421
  // GraphQL uses `any` type for UUID
16211
16422
  project: ProjectSchema,
16212
16423
  totalVulnerabilityReportIssuesCount: VulnerabilityReportIssueAggregateSchema,
16213
16424
  notFixableVulnerabilityReportIssuesCount: VulnerabilityReportIssueAggregateSchema
16214
16425
  });
16215
- var FixReportSummarySchema = z33.object({
16216
- __typename: z33.literal("fixReport").optional(),
16217
- id: z33.any(),
16426
+ var FixReportSummarySchema = z34.object({
16427
+ __typename: z34.literal("fixReport").optional(),
16428
+ id: z34.any(),
16218
16429
  // GraphQL uses `any` type for UUID
16219
- createdOn: z33.any(),
16430
+ createdOn: z34.any(),
16220
16431
  // GraphQL uses `any` type for timestamp
16221
16432
  repo: RepoSchema.nullable(),
16222
- issueTypes: z33.any().nullable(),
16433
+ issueTypes: z34.any().nullable(),
16223
16434
  // GraphQL uses `any` type for JSON
16224
16435
  CRITICAL: FixAggregateSchema,
16225
16436
  HIGH: FixAggregateSchema,
16226
16437
  MEDIUM: FixAggregateSchema,
16227
16438
  LOW: FixAggregateSchema,
16228
- fixes: z33.array(McpFixSchema),
16229
- userFixes: z33.array(McpFixSchema).optional(),
16439
+ fixes: z34.array(McpFixSchema),
16440
+ userFixes: z34.array(McpFixSchema).optional(),
16230
16441
  // Present in some responses but can be omitted
16231
16442
  filteredFixesCount: FixAggregateSchema,
16232
16443
  totalFixesCount: FixAggregateSchema,
16233
16444
  vulnerabilityReport: VulnerabilityReportSchema
16234
16445
  });
16235
- var ExpiredReportSchema = z33.object({
16236
- __typename: z33.literal("fixReport").optional(),
16237
- id: z33.any(),
16446
+ var ExpiredReportSchema = z34.object({
16447
+ __typename: z34.literal("fixReport").optional(),
16448
+ id: z34.any(),
16238
16449
  // GraphQL uses `any` type for UUID
16239
- expirationOn: z33.any().nullable()
16450
+ expirationOn: z34.any().nullable()
16240
16451
  // GraphQL uses `any` type for timestamp
16241
16452
  });
16242
- var GetLatestReportByRepoUrlResponseSchema = z33.object({
16243
- __typename: z33.literal("query_root").optional(),
16244
- fixReport: z33.array(FixReportSummarySchema),
16245
- expiredReport: z33.array(ExpiredReportSchema)
16453
+ var GetLatestReportByRepoUrlResponseSchema = z34.object({
16454
+ __typename: z34.literal("query_root").optional(),
16455
+ fixReport: z34.array(FixReportSummarySchema),
16456
+ expiredReport: z34.array(ExpiredReportSchema)
16246
16457
  });
16247
16458
 
16248
16459
  // src/mcp/services/McpAuthService.ts
@@ -18153,10 +18364,10 @@ var McpServer = class {
18153
18364
  };
18154
18365
 
18155
18366
  // src/mcp/prompts/CheckForNewVulnerabilitiesPrompt.ts
18156
- import { z as z35 } from "zod";
18367
+ import { z as z36 } from "zod";
18157
18368
 
18158
18369
  // src/mcp/prompts/base/BasePrompt.ts
18159
- import { z as z34 } from "zod";
18370
+ import { z as z35 } from "zod";
18160
18371
  var BasePrompt = class {
18161
18372
  getDefinition() {
18162
18373
  return {
@@ -18185,7 +18396,7 @@ var BasePrompt = class {
18185
18396
  const argsToValidate = args === void 0 ? {} : args;
18186
18397
  return this.argumentsValidationSchema.parse(argsToValidate);
18187
18398
  } catch (error) {
18188
- if (error instanceof z34.ZodError) {
18399
+ if (error instanceof z35.ZodError) {
18189
18400
  const errorDetails = error.errors.map((e) => {
18190
18401
  const fieldPath = e.path.length > 0 ? e.path.join(".") : "root";
18191
18402
  const message = e.message === "Required" ? `Missing required argument '${fieldPath}'` : `Invalid value for '${fieldPath}': ${e.message}`;
@@ -18214,8 +18425,8 @@ var BasePrompt = class {
18214
18425
  };
18215
18426
 
18216
18427
  // src/mcp/prompts/CheckForNewVulnerabilitiesPrompt.ts
18217
- var CheckForNewVulnerabilitiesArgsSchema = z35.object({
18218
- path: z35.string().optional()
18428
+ var CheckForNewVulnerabilitiesArgsSchema = z36.object({
18429
+ path: z36.string().optional()
18219
18430
  });
18220
18431
  var CheckForNewVulnerabilitiesPrompt = class extends BasePrompt {
18221
18432
  constructor() {
@@ -18460,9 +18671,9 @@ Call the \`check_for_new_available_fixes\` tool now${args?.path ? ` for ${args.p
18460
18671
  };
18461
18672
 
18462
18673
  // src/mcp/prompts/FullSecurityAuditPrompt.ts
18463
- import { z as z36 } from "zod";
18464
- var FullSecurityAuditArgsSchema = z36.object({
18465
- path: z36.string().optional()
18674
+ import { z as z37 } from "zod";
18675
+ var FullSecurityAuditArgsSchema = z37.object({
18676
+ path: z37.string().optional()
18466
18677
  });
18467
18678
  var FullSecurityAuditPrompt = class extends BasePrompt {
18468
18679
  constructor() {
@@ -18913,9 +19124,9 @@ Begin the audit now${args?.path ? ` for ${args.path}` : ""}.
18913
19124
  };
18914
19125
 
18915
19126
  // src/mcp/prompts/ReviewAndFixCriticalPrompt.ts
18916
- import { z as z37 } from "zod";
18917
- var ReviewAndFixCriticalArgsSchema = z37.object({
18918
- path: z37.string().optional()
19127
+ import { z as z38 } from "zod";
19128
+ var ReviewAndFixCriticalArgsSchema = z38.object({
19129
+ path: z38.string().optional()
18919
19130
  });
18920
19131
  var ReviewAndFixCriticalPrompt = class extends BasePrompt {
18921
19132
  constructor() {
@@ -19219,9 +19430,9 @@ Start by scanning${args?.path ? ` ${args.path}` : " the repository"} and priorit
19219
19430
  };
19220
19431
 
19221
19432
  // src/mcp/prompts/ScanRecentChangesPrompt.ts
19222
- import { z as z38 } from "zod";
19223
- var ScanRecentChangesArgsSchema = z38.object({
19224
- path: z38.string().optional()
19433
+ import { z as z39 } from "zod";
19434
+ var ScanRecentChangesArgsSchema = z39.object({
19435
+ path: z39.string().optional()
19225
19436
  });
19226
19437
  var ScanRecentChangesPrompt = class extends BasePrompt {
19227
19438
  constructor() {
@@ -19432,9 +19643,9 @@ You now have the guidance needed to perform a fast, targeted security scan of re
19432
19643
  };
19433
19644
 
19434
19645
  // src/mcp/prompts/ScanRepositoryPrompt.ts
19435
- import { z as z39 } from "zod";
19436
- var ScanRepositoryArgsSchema = z39.object({
19437
- path: z39.string().optional()
19646
+ import { z as z40 } from "zod";
19647
+ var ScanRepositoryArgsSchema = z40.object({
19648
+ path: z40.string().optional()
19438
19649
  });
19439
19650
  var ScanRepositoryPrompt = class extends BasePrompt {
19440
19651
  constructor() {
@@ -19832,7 +20043,7 @@ import * as os11 from "os";
19832
20043
  import * as path18 from "path";
19833
20044
 
19834
20045
  // src/mcp/tools/checkForNewAvailableFixes/CheckForNewAvailableFixesTool.ts
19835
- import { z as z42 } from "zod";
20046
+ import { z as z43 } from "zod";
19836
20047
 
19837
20048
  // src/mcp/services/PathValidation.ts
19838
20049
  import fs19 from "fs";
@@ -19908,7 +20119,7 @@ async function validatePath(inputPath) {
19908
20119
  }
19909
20120
 
19910
20121
  // src/mcp/tools/base/BaseTool.ts
19911
- import { z as z40 } from "zod";
20122
+ import { z as z41 } from "zod";
19912
20123
  var BaseTool = class {
19913
20124
  getDefinition() {
19914
20125
  return {
@@ -19941,7 +20152,7 @@ var BaseTool = class {
19941
20152
  try {
19942
20153
  return this.inputValidationSchema.parse(args);
19943
20154
  } catch (error) {
19944
- if (error instanceof z40.ZodError) {
20155
+ if (error instanceof z41.ZodError) {
19945
20156
  const errorDetails = error.errors.map((e) => {
19946
20157
  const fieldPath = e.path.length > 0 ? e.path.join(".") : "root";
19947
20158
  const message = e.message === "Required" ? `Missing required parameter '${fieldPath}'` : `Invalid value for '${fieldPath}': ${e.message}`;
@@ -20660,13 +20871,13 @@ init_client_generates();
20660
20871
  init_GitService();
20661
20872
  import fs21 from "fs";
20662
20873
  import path20 from "path";
20663
- import { z as z41 } from "zod";
20874
+ import { z as z42 } from "zod";
20664
20875
  function extractPathFromPatch(patch) {
20665
20876
  const match = patch?.match(/diff --git a\/([^\s]+) b\//);
20666
20877
  return match?.[1] ?? null;
20667
20878
  }
20668
20879
  function parsedIssueTypeRes(issueType) {
20669
- return z41.nativeEnum(IssueType_Enum).safeParse(issueType);
20880
+ return z42.nativeEnum(IssueType_Enum).safeParse(issueType);
20670
20881
  }
20671
20882
  var LocalMobbFolderService = class {
20672
20883
  /**
@@ -23363,8 +23574,8 @@ Example payload:
23363
23574
  },
23364
23575
  required: ["path"]
23365
23576
  });
23366
- __publicField(this, "inputValidationSchema", z42.object({
23367
- path: z42.string().describe(
23577
+ __publicField(this, "inputValidationSchema", z43.object({
23578
+ path: z43.string().describe(
23368
23579
  "Full local path to the cloned git repository to check for new available fixes"
23369
23580
  )
23370
23581
  }));
@@ -23394,7 +23605,7 @@ Example payload:
23394
23605
 
23395
23606
  // src/mcp/tools/fetchAvailableFixes/FetchAvailableFixesTool.ts
23396
23607
  init_GitService();
23397
- import { z as z43 } from "zod";
23608
+ import { z as z44 } from "zod";
23398
23609
 
23399
23610
  // src/mcp/tools/fetchAvailableFixes/FetchAvailableFixesService.ts
23400
23611
  init_configs();
@@ -23537,16 +23748,16 @@ Call this tool instead of ${MCP_TOOL_SCAN_AND_FIX_VULNERABILITIES} when you only
23537
23748
  },
23538
23749
  required: ["path"]
23539
23750
  });
23540
- __publicField(this, "inputValidationSchema", z43.object({
23541
- path: z43.string().describe(
23751
+ __publicField(this, "inputValidationSchema", z44.object({
23752
+ path: z44.string().describe(
23542
23753
  "Full local path to the cloned git repository to check for available fixes"
23543
23754
  ),
23544
- offset: z43.number().optional().describe("Optional offset for pagination"),
23545
- limit: z43.number().optional().describe("Optional maximum number of fixes to return"),
23546
- fileFilter: z43.array(z43.string()).optional().describe(
23755
+ offset: z44.number().optional().describe("Optional offset for pagination"),
23756
+ limit: z44.number().optional().describe("Optional maximum number of fixes to return"),
23757
+ fileFilter: z44.array(z44.string()).optional().describe(
23547
23758
  "Optional list of file paths relative to the path parameter to filter fixes by. INCOMPATIBLE with fetchFixesFromAnyFile"
23548
23759
  ),
23549
- fetchFixesFromAnyFile: z43.boolean().optional().describe(
23760
+ fetchFixesFromAnyFile: z44.boolean().optional().describe(
23550
23761
  "Optional boolean to fetch fixes for all files. INCOMPATIBLE with fileFilter"
23551
23762
  )
23552
23763
  }));
@@ -23611,7 +23822,7 @@ Call this tool instead of ${MCP_TOOL_SCAN_AND_FIX_VULNERABILITIES} when you only
23611
23822
  };
23612
23823
 
23613
23824
  // src/mcp/tools/mcpChecker/mcpCheckerTool.ts
23614
- import z44 from "zod";
23825
+ import z45 from "zod";
23615
23826
 
23616
23827
  // src/mcp/tools/mcpChecker/mcpCheckerService.ts
23617
23828
  var _McpCheckerService = class _McpCheckerService {
@@ -23672,7 +23883,7 @@ var McpCheckerTool = class extends BaseTool {
23672
23883
  __publicField(this, "displayName", "MCP Checker");
23673
23884
  // A detailed description to guide the LLM on when and how to invoke this tool.
23674
23885
  __publicField(this, "description", "Check the MCP servers running on this IDE against organization policies.");
23675
- __publicField(this, "inputValidationSchema", z44.object({}));
23886
+ __publicField(this, "inputValidationSchema", z45.object({}));
23676
23887
  __publicField(this, "inputSchema", {
23677
23888
  type: "object",
23678
23889
  properties: {},
@@ -23698,7 +23909,7 @@ var McpCheckerTool = class extends BaseTool {
23698
23909
  };
23699
23910
 
23700
23911
  // src/mcp/tools/scanAndFixVulnerabilities/ScanAndFixVulnerabilitiesTool.ts
23701
- import z45 from "zod";
23912
+ import z46 from "zod";
23702
23913
  init_configs();
23703
23914
 
23704
23915
  // src/mcp/tools/scanAndFixVulnerabilities/ScanAndFixVulnerabilitiesService.ts
@@ -23886,17 +24097,17 @@ Example payload:
23886
24097
  "rescan": false
23887
24098
  }`);
23888
24099
  __publicField(this, "hasAuthentication", true);
23889
- __publicField(this, "inputValidationSchema", z45.object({
23890
- path: z45.string().describe(
24100
+ __publicField(this, "inputValidationSchema", z46.object({
24101
+ path: z46.string().describe(
23891
24102
  "Full local path to repository to scan and fix vulnerabilities"
23892
24103
  ),
23893
- offset: z45.number().optional().describe("Optional offset for pagination"),
23894
- limit: z45.number().optional().describe("Optional maximum number of results to return"),
23895
- maxFiles: z45.number().optional().describe(
24104
+ offset: z46.number().optional().describe("Optional offset for pagination"),
24105
+ limit: z46.number().optional().describe("Optional maximum number of results to return"),
24106
+ maxFiles: z46.number().optional().describe(
23896
24107
  `Optional maximum number of files to scan (default: ${MCP_DEFAULT_MAX_FILES_TO_SCAN}). Increase for comprehensive scans of larger codebases or decrease for faster focused scans.`
23897
24108
  ),
23898
- rescan: z45.boolean().optional().describe("Optional whether to rescan the repository"),
23899
- scanRecentlyChangedFiles: z45.boolean().optional().describe(
24109
+ rescan: z46.boolean().optional().describe("Optional whether to rescan the repository"),
24110
+ scanRecentlyChangedFiles: z46.boolean().optional().describe(
23900
24111
  "Optional whether to automatically scan recently changed files when no changed files are found in git status. If false, the tool will prompt the user instead."
23901
24112
  )
23902
24113
  }));
@@ -24204,7 +24415,7 @@ async function addScmTokenHandler(args) {
24204
24415
  }
24205
24416
 
24206
24417
  // src/features/codeium_intellij/data_collector.ts
24207
- import { z as z46 } from "zod";
24418
+ import { z as z47 } from "zod";
24208
24419
  init_client_generates();
24209
24420
  init_urlParser2();
24210
24421
 
@@ -24345,8 +24556,8 @@ function findRunningCodeiumLanguageServers() {
24345
24556
  }
24346
24557
 
24347
24558
  // src/features/codeium_intellij/data_collector.ts
24348
- var HookDataSchema2 = z46.object({
24349
- trajectory_id: z46.string()
24559
+ var HookDataSchema2 = z47.object({
24560
+ trajectory_id: z47.string()
24350
24561
  });
24351
24562
  async function processAndUploadHookData2() {
24352
24563
  const tracePayload = await getTraceDataForHook();