mobbdev 1.4.23 → 1.4.25

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.
@@ -138,10 +138,16 @@ function getSdk(client, withWrapper = defaultWrapper) {
138
138
  },
139
139
  SkillVerdictsByMd5(variables, requestHeaders, signal) {
140
140
  return withWrapper((wrappedRequestHeaders) => client.request({ document: SkillVerdictsByMd5Document, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "SkillVerdictsByMd5", "query", variables);
141
+ },
142
+ LogMvsEvent(variables, requestHeaders, signal) {
143
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: LogMvsEventDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "LogMvsEvent", "mutation", variables);
144
+ },
145
+ getMvsProject(variables, requestHeaders, signal) {
146
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetMvsProjectDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "getMvsProject", "mutation", variables);
141
147
  }
142
148
  };
143
149
  }
144
- var AiBlameInferenceType, FixQuestionInputType, Language, ManifestAction, Effort_To_Apply_Fix_Enum, Fix_Rating_Tag_Enum, Fix_Report_State_Enum, Fix_State_Enum, IssueLanguage_Enum, IssueType_Enum, Pr_Status_Enum, Project_Role_Type_Enum, Vulnerability_Report_Issue_Category_Enum, Vulnerability_Report_Issue_State_Enum, Vulnerability_Report_Issue_Tag_Enum, Vulnerability_Report_Vendor_Enum, Vulnerability_Severity_Enum, FixDetailsFragmentDoc, FixReportSummaryFieldsFragmentDoc, MeDocument, GetLastOrgAndNamedProjectDocument, GetLastOrgDocument, GetEncryptedApiTokenDocument, FixReportStateDocument, GetVulnerabilityReportPathsDocument, GetAnalysisSubscriptionDocument, GetAnalysisDocument, GetFixesDocument, GetVulByNodesMetadataDocument, GetFalsePositiveDocument, UpdateScmTokenDocument, UploadS3BucketInfoDocument, GetTracyDiffUploadUrlDocument, AnalyzeCommitForExtensionAiBlameDocument, GetAiBlameInferenceDocument, GetAiBlameAttributionPromptDocument, GetPromptSummaryDocument, UploadAiBlameInferencesInitDocument, FinalizeAiBlameInferencesUploadDocument, UploadTracyRecordsDocument, GetTracyRawDataUploadUrlDocument, DigestVulnerabilityReportDocument, SubmitVulnerabilityReportDocument, CreateCommunityUserDocument, CreateCliLoginDocument, PerformCliLoginDocument, SetQuarantineEnabledDocument, CreateProjectDocument, ValidateRepoUrlDocument, GitReferenceDocument, AutoPrAnalysisDocument, GetFixWithAnswersDocument, GetFixReportsByRepoUrlDocument, GetReportFixesDocument, GetLatestReportByRepoUrlDocument, UpdateDownloadedFixDataDocument, GetUserMvsAutoFixDocument, StreamBlameAiAnalysisRequestsDocument, StreamCommitBlameRequestsDocument, ScanSkillDocument, SkillVerdictsByMd5Document, defaultWrapper;
150
+ var AiBlameInferenceType, FixQuestionInputType, Language, ManifestAction, Effort_To_Apply_Fix_Enum, Fix_Rating_Tag_Enum, Fix_Report_State_Enum, Fix_State_Enum, IssueLanguage_Enum, IssueType_Enum, Pr_Status_Enum, Project_Role_Type_Enum, Vulnerability_Report_Issue_Category_Enum, Vulnerability_Report_Issue_State_Enum, Vulnerability_Report_Issue_Tag_Enum, Vulnerability_Report_Vendor_Enum, Vulnerability_Severity_Enum, FixDetailsFragmentDoc, FixReportSummaryFieldsFragmentDoc, MeDocument, GetLastOrgAndNamedProjectDocument, GetLastOrgDocument, GetEncryptedApiTokenDocument, FixReportStateDocument, GetVulnerabilityReportPathsDocument, GetAnalysisSubscriptionDocument, GetAnalysisDocument, GetFixesDocument, GetVulByNodesMetadataDocument, GetFalsePositiveDocument, UpdateScmTokenDocument, UploadS3BucketInfoDocument, GetTracyDiffUploadUrlDocument, AnalyzeCommitForExtensionAiBlameDocument, GetAiBlameInferenceDocument, GetAiBlameAttributionPromptDocument, GetPromptSummaryDocument, UploadAiBlameInferencesInitDocument, FinalizeAiBlameInferencesUploadDocument, UploadTracyRecordsDocument, GetTracyRawDataUploadUrlDocument, DigestVulnerabilityReportDocument, SubmitVulnerabilityReportDocument, CreateCommunityUserDocument, CreateCliLoginDocument, PerformCliLoginDocument, SetQuarantineEnabledDocument, CreateProjectDocument, ValidateRepoUrlDocument, GitReferenceDocument, AutoPrAnalysisDocument, GetFixWithAnswersDocument, GetFixReportsByRepoUrlDocument, GetReportFixesDocument, GetLatestReportByRepoUrlDocument, UpdateDownloadedFixDataDocument, GetUserMvsAutoFixDocument, StreamBlameAiAnalysisRequestsDocument, StreamCommitBlameRequestsDocument, ScanSkillDocument, SkillVerdictsByMd5Document, LogMvsEventDocument, GetMvsProjectDocument, defaultWrapper;
145
151
  var init_client_generates = __esm({
146
152
  "src/features/analysis/scm/generates/client_generates.ts"() {
147
153
  "use strict";
@@ -1077,7 +1083,7 @@ var init_client_generates = __esm({
1077
1083
  }
1078
1084
  `;
1079
1085
  SubmitVulnerabilityReportDocument = `
1080
- mutation SubmitVulnerabilityReport($fixReportId: String!, $repoUrl: String!, $reference: String!, $projectId: String!, $scanSource: String!, $sha: String, $experimentalEnabled: Boolean, $vulnerabilityReportFileName: String, $pullRequest: Int, $isFullScan: Boolean, $scanContext: String!, $fileCount: Int) {
1086
+ mutation SubmitVulnerabilityReport($fixReportId: String!, $repoUrl: String!, $reference: String!, $projectId: String!, $scanSource: String!, $sha: String, $experimentalEnabled: Boolean, $vulnerabilityReportFileName: String, $pullRequest: Int, $isFullScan: Boolean, $scanContext: String!, $fileCount: Int, $computerName: String, $computerUser: String, $clientVersion: String) {
1081
1087
  submitVulnerabilityReport(
1082
1088
  fixReportId: $fixReportId
1083
1089
  repoUrl: $repoUrl
@@ -1091,6 +1097,9 @@ var init_client_generates = __esm({
1091
1097
  scanSource: $scanSource
1092
1098
  scanContext: $scanContext
1093
1099
  fileCount: $fileCount
1100
+ computerName: $computerName
1101
+ computerUser: $computerUser
1102
+ clientVersion: $clientVersion
1094
1103
  ) {
1095
1104
  __typename
1096
1105
  ... on VulnerabilityReport {
@@ -1365,6 +1374,29 @@ var init_client_generates = __esm({
1365
1374
  scannedAt
1366
1375
  }
1367
1376
  }
1377
+ }
1378
+ `;
1379
+ LogMvsEventDocument = `
1380
+ mutation LogMvsEvent($eventType: String!, $fixReportId: String, $projectId: String, $repoUrl: String, $riskCount: Int, $computerName: String, $computerUser: String, $clientVersion: String) {
1381
+ logMvsEvent(
1382
+ eventType: $eventType
1383
+ fixReportId: $fixReportId
1384
+ projectId: $projectId
1385
+ repoUrl: $repoUrl
1386
+ riskCount: $riskCount
1387
+ computerName: $computerName
1388
+ computerUser: $computerUser
1389
+ clientVersion: $clientVersion
1390
+ ) {
1391
+ status
1392
+ }
1393
+ }
1394
+ `;
1395
+ GetMvsProjectDocument = `
1396
+ mutation getMvsProject($organizationId: String!) {
1397
+ getMvsProject(organizationId: $organizationId) {
1398
+ projectId
1399
+ }
1368
1400
  }
1369
1401
  `;
1370
1402
  defaultWrapper = (action, _operationName, _operationType, _variables) => action();
@@ -4494,7 +4526,6 @@ var CliError = class extends Error {
4494
4526
 
4495
4527
  // src/commands/AuthManager.ts
4496
4528
  import crypto from "crypto";
4497
- import os from "os";
4498
4529
  import Debug10 from "debug";
4499
4530
  import open from "open";
4500
4531
 
@@ -7885,16 +7916,42 @@ var URL_REFRESH_MS = 20 * 60 * 1e3;
7885
7916
  var debug10 = Debug9("mobbdev:tracy-batch-upload");
7886
7917
 
7887
7918
  // src/mcp/services/types.ts
7888
- function buildLoginUrl(baseUrl, loginId, hostname, context) {
7919
+ import os from "os";
7920
+ function buildLoginUrl(baseUrl, loginId, machine, context) {
7889
7921
  const url = new URL(`${baseUrl}/${loginId}`);
7890
- url.searchParams.set("hostname", hostname);
7891
- url.searchParams.set("trigger", context.trigger);
7892
- url.searchParams.set("source", context.source);
7893
- if (context.ide) {
7894
- url.searchParams.set("ide", context.ide);
7922
+ url.searchParams.set("hostname", machine.hostname);
7923
+ if (machine.computerUser) {
7924
+ url.searchParams.set("computerUser", machine.computerUser);
7925
+ }
7926
+ if (machine.clientVersion) {
7927
+ url.searchParams.set("clientVersion", machine.clientVersion);
7928
+ }
7929
+ if (context) {
7930
+ url.searchParams.set("trigger", context.trigger);
7931
+ url.searchParams.set("source", context.source);
7932
+ if (context.ide) {
7933
+ url.searchParams.set("ide", context.ide);
7934
+ }
7895
7935
  }
7896
7936
  return url.toString();
7897
7937
  }
7938
+ function getComputerUser() {
7939
+ try {
7940
+ return os.userInfo().username || void 0;
7941
+ } catch {
7942
+ return void 0;
7943
+ }
7944
+ }
7945
+ function getLoginMachineInfo() {
7946
+ return {
7947
+ hostname: os.hostname(),
7948
+ computerUser: getComputerUser(),
7949
+ clientVersion: packageJson.version
7950
+ };
7951
+ }
7952
+ function buildLoginBrowserUrl(baseUrl, loginId, context) {
7953
+ return buildLoginUrl(baseUrl, loginId, getLoginMachineInfo(), context);
7954
+ }
7898
7955
 
7899
7956
  // src/utils/ConfigStoreService.ts
7900
7957
  import Configstore from "configstore";
@@ -8057,7 +8114,11 @@ var _AuthManager = class _AuthManager {
8057
8114
  publicKey: this.publicKey.export({ format: "pem", type: "pkcs1" }).toString()
8058
8115
  });
8059
8116
  const webLoginUrl = `${this.resolvedWebAppUrl}${loginPath || "/cli-login"}`;
8060
- const browserUrl = loginContext ? buildLoginUrl(webLoginUrl, this.loginId, os.hostname(), loginContext) : `${webLoginUrl}/${this.loginId}?hostname=${os.hostname()}`;
8117
+ const browserUrl = buildLoginBrowserUrl(
8118
+ webLoginUrl,
8119
+ this.loginId,
8120
+ loginContext
8121
+ );
8061
8122
  this.currentBrowserUrl = browserUrl;
8062
8123
  return browserUrl;
8063
8124
  } catch (error) {
package/dist/index.mjs CHANGED
@@ -138,10 +138,16 @@ function getSdk(client, withWrapper = defaultWrapper) {
138
138
  },
139
139
  SkillVerdictsByMd5(variables, requestHeaders, signal) {
140
140
  return withWrapper((wrappedRequestHeaders) => client.request({ document: SkillVerdictsByMd5Document, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "SkillVerdictsByMd5", "query", variables);
141
+ },
142
+ LogMvsEvent(variables, requestHeaders, signal) {
143
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: LogMvsEventDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "LogMvsEvent", "mutation", variables);
144
+ },
145
+ getMvsProject(variables, requestHeaders, signal) {
146
+ return withWrapper((wrappedRequestHeaders) => client.request({ document: GetMvsProjectDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "getMvsProject", "mutation", variables);
141
147
  }
142
148
  };
143
149
  }
144
- var AiBlameInferenceType, FixQuestionInputType, Language, ManifestAction, Effort_To_Apply_Fix_Enum, Fix_Rating_Tag_Enum, Fix_Report_State_Enum, Fix_State_Enum, IssueLanguage_Enum, IssueType_Enum, Pr_Status_Enum, Project_Role_Type_Enum, Vulnerability_Report_Issue_Category_Enum, Vulnerability_Report_Issue_State_Enum, Vulnerability_Report_Issue_Tag_Enum, Vulnerability_Report_Vendor_Enum, Vulnerability_Severity_Enum, FixDetailsFragmentDoc, FixReportSummaryFieldsFragmentDoc, MeDocument, GetLastOrgAndNamedProjectDocument, GetLastOrgDocument, GetEncryptedApiTokenDocument, FixReportStateDocument, GetVulnerabilityReportPathsDocument, GetAnalysisSubscriptionDocument, GetAnalysisDocument, GetFixesDocument, GetVulByNodesMetadataDocument, GetFalsePositiveDocument, UpdateScmTokenDocument, UploadS3BucketInfoDocument, GetTracyDiffUploadUrlDocument, AnalyzeCommitForExtensionAiBlameDocument, GetAiBlameInferenceDocument, GetAiBlameAttributionPromptDocument, GetPromptSummaryDocument, UploadAiBlameInferencesInitDocument, FinalizeAiBlameInferencesUploadDocument, UploadTracyRecordsDocument, GetTracyRawDataUploadUrlDocument, DigestVulnerabilityReportDocument, SubmitVulnerabilityReportDocument, CreateCommunityUserDocument, CreateCliLoginDocument, PerformCliLoginDocument, SetQuarantineEnabledDocument, CreateProjectDocument, ValidateRepoUrlDocument, GitReferenceDocument, AutoPrAnalysisDocument, GetFixWithAnswersDocument, GetFixReportsByRepoUrlDocument, GetReportFixesDocument, GetLatestReportByRepoUrlDocument, UpdateDownloadedFixDataDocument, GetUserMvsAutoFixDocument, StreamBlameAiAnalysisRequestsDocument, StreamCommitBlameRequestsDocument, ScanSkillDocument, SkillVerdictsByMd5Document, defaultWrapper;
150
+ var AiBlameInferenceType, FixQuestionInputType, Language, ManifestAction, Effort_To_Apply_Fix_Enum, Fix_Rating_Tag_Enum, Fix_Report_State_Enum, Fix_State_Enum, IssueLanguage_Enum, IssueType_Enum, Pr_Status_Enum, Project_Role_Type_Enum, Vulnerability_Report_Issue_Category_Enum, Vulnerability_Report_Issue_State_Enum, Vulnerability_Report_Issue_Tag_Enum, Vulnerability_Report_Vendor_Enum, Vulnerability_Severity_Enum, FixDetailsFragmentDoc, FixReportSummaryFieldsFragmentDoc, MeDocument, GetLastOrgAndNamedProjectDocument, GetLastOrgDocument, GetEncryptedApiTokenDocument, FixReportStateDocument, GetVulnerabilityReportPathsDocument, GetAnalysisSubscriptionDocument, GetAnalysisDocument, GetFixesDocument, GetVulByNodesMetadataDocument, GetFalsePositiveDocument, UpdateScmTokenDocument, UploadS3BucketInfoDocument, GetTracyDiffUploadUrlDocument, AnalyzeCommitForExtensionAiBlameDocument, GetAiBlameInferenceDocument, GetAiBlameAttributionPromptDocument, GetPromptSummaryDocument, UploadAiBlameInferencesInitDocument, FinalizeAiBlameInferencesUploadDocument, UploadTracyRecordsDocument, GetTracyRawDataUploadUrlDocument, DigestVulnerabilityReportDocument, SubmitVulnerabilityReportDocument, CreateCommunityUserDocument, CreateCliLoginDocument, PerformCliLoginDocument, SetQuarantineEnabledDocument, CreateProjectDocument, ValidateRepoUrlDocument, GitReferenceDocument, AutoPrAnalysisDocument, GetFixWithAnswersDocument, GetFixReportsByRepoUrlDocument, GetReportFixesDocument, GetLatestReportByRepoUrlDocument, UpdateDownloadedFixDataDocument, GetUserMvsAutoFixDocument, StreamBlameAiAnalysisRequestsDocument, StreamCommitBlameRequestsDocument, ScanSkillDocument, SkillVerdictsByMd5Document, LogMvsEventDocument, GetMvsProjectDocument, defaultWrapper;
145
151
  var init_client_generates = __esm({
146
152
  "src/features/analysis/scm/generates/client_generates.ts"() {
147
153
  "use strict";
@@ -1077,7 +1083,7 @@ var init_client_generates = __esm({
1077
1083
  }
1078
1084
  `;
1079
1085
  SubmitVulnerabilityReportDocument = `
1080
- mutation SubmitVulnerabilityReport($fixReportId: String!, $repoUrl: String!, $reference: String!, $projectId: String!, $scanSource: String!, $sha: String, $experimentalEnabled: Boolean, $vulnerabilityReportFileName: String, $pullRequest: Int, $isFullScan: Boolean, $scanContext: String!, $fileCount: Int) {
1086
+ mutation SubmitVulnerabilityReport($fixReportId: String!, $repoUrl: String!, $reference: String!, $projectId: String!, $scanSource: String!, $sha: String, $experimentalEnabled: Boolean, $vulnerabilityReportFileName: String, $pullRequest: Int, $isFullScan: Boolean, $scanContext: String!, $fileCount: Int, $computerName: String, $computerUser: String, $clientVersion: String) {
1081
1087
  submitVulnerabilityReport(
1082
1088
  fixReportId: $fixReportId
1083
1089
  repoUrl: $repoUrl
@@ -1091,6 +1097,9 @@ var init_client_generates = __esm({
1091
1097
  scanSource: $scanSource
1092
1098
  scanContext: $scanContext
1093
1099
  fileCount: $fileCount
1100
+ computerName: $computerName
1101
+ computerUser: $computerUser
1102
+ clientVersion: $clientVersion
1094
1103
  ) {
1095
1104
  __typename
1096
1105
  ... on VulnerabilityReport {
@@ -1365,6 +1374,29 @@ var init_client_generates = __esm({
1365
1374
  scannedAt
1366
1375
  }
1367
1376
  }
1377
+ }
1378
+ `;
1379
+ LogMvsEventDocument = `
1380
+ mutation LogMvsEvent($eventType: String!, $fixReportId: String, $projectId: String, $repoUrl: String, $riskCount: Int, $computerName: String, $computerUser: String, $clientVersion: String) {
1381
+ logMvsEvent(
1382
+ eventType: $eventType
1383
+ fixReportId: $fixReportId
1384
+ projectId: $projectId
1385
+ repoUrl: $repoUrl
1386
+ riskCount: $riskCount
1387
+ computerName: $computerName
1388
+ computerUser: $computerUser
1389
+ clientVersion: $clientVersion
1390
+ ) {
1391
+ status
1392
+ }
1393
+ }
1394
+ `;
1395
+ GetMvsProjectDocument = `
1396
+ mutation getMvsProject($organizationId: String!) {
1397
+ getMvsProject(organizationId: $organizationId) {
1398
+ projectId
1399
+ }
1368
1400
  }
1369
1401
  `;
1370
1402
  defaultWrapper = (action, _operationName, _operationType, _variables) => action();
@@ -13204,7 +13236,6 @@ import { z as z31 } from "zod";
13204
13236
 
13205
13237
  // src/commands/AuthManager.ts
13206
13238
  import crypto from "crypto";
13207
- import os3 from "os";
13208
13239
  import Debug11 from "debug";
13209
13240
  import open from "open";
13210
13241
 
@@ -15223,6 +15254,7 @@ async function prepareAndSendTracyRecords(client, rawRecords, workingDir, option
15223
15254
  }
15224
15255
 
15225
15256
  // src/mcp/services/types.ts
15257
+ import os3 from "os";
15226
15258
  function detectIDE() {
15227
15259
  const env3 = process.env;
15228
15260
  if (env3["CURSOR_TRACE_ID"] || env3["CURSOR_SESSION_ID"]) return "cursor";
@@ -15243,16 +15275,41 @@ function createMcpLoginContext(trigger) {
15243
15275
  ide: detectIDE()
15244
15276
  };
15245
15277
  }
15246
- function buildLoginUrl(baseUrl, loginId, hostname, context) {
15278
+ function buildLoginUrl(baseUrl, loginId, machine, context) {
15247
15279
  const url = new URL(`${baseUrl}/${loginId}`);
15248
- url.searchParams.set("hostname", hostname);
15249
- url.searchParams.set("trigger", context.trigger);
15250
- url.searchParams.set("source", context.source);
15251
- if (context.ide) {
15252
- url.searchParams.set("ide", context.ide);
15280
+ url.searchParams.set("hostname", machine.hostname);
15281
+ if (machine.computerUser) {
15282
+ url.searchParams.set("computerUser", machine.computerUser);
15283
+ }
15284
+ if (machine.clientVersion) {
15285
+ url.searchParams.set("clientVersion", machine.clientVersion);
15286
+ }
15287
+ if (context) {
15288
+ url.searchParams.set("trigger", context.trigger);
15289
+ url.searchParams.set("source", context.source);
15290
+ if (context.ide) {
15291
+ url.searchParams.set("ide", context.ide);
15292
+ }
15253
15293
  }
15254
15294
  return url.toString();
15255
15295
  }
15296
+ function getComputerUser() {
15297
+ try {
15298
+ return os3.userInfo().username || void 0;
15299
+ } catch {
15300
+ return void 0;
15301
+ }
15302
+ }
15303
+ function getLoginMachineInfo() {
15304
+ return {
15305
+ hostname: os3.hostname(),
15306
+ computerUser: getComputerUser(),
15307
+ clientVersion: packageJson.version
15308
+ };
15309
+ }
15310
+ function buildLoginBrowserUrl(baseUrl, loginId, context) {
15311
+ return buildLoginUrl(baseUrl, loginId, getLoginMachineInfo(), context);
15312
+ }
15256
15313
 
15257
15314
  // src/commands/AuthManager.ts
15258
15315
  var debug12 = Debug11("mobbdev:auth");
@@ -15397,7 +15454,11 @@ var _AuthManager = class _AuthManager {
15397
15454
  publicKey: this.publicKey.export({ format: "pem", type: "pkcs1" }).toString()
15398
15455
  });
15399
15456
  const webLoginUrl = `${this.resolvedWebAppUrl}${loginPath || "/cli-login"}`;
15400
- const browserUrl = loginContext ? buildLoginUrl(webLoginUrl, this.loginId, os3.hostname(), loginContext) : `${webLoginUrl}/${this.loginId}?hostname=${os3.hostname()}`;
15457
+ const browserUrl = buildLoginBrowserUrl(
15458
+ webLoginUrl,
15459
+ this.loginId,
15460
+ loginContext
15461
+ );
15401
15462
  this.currentBrowserUrl = browserUrl;
15402
15463
  return browserUrl;
15403
15464
  } catch (error) {
@@ -16435,8 +16496,8 @@ if (typeof __filename !== "undefined") {
16435
16496
  }
16436
16497
  var costumeRequire = createRequire(moduleUrl);
16437
16498
  var getCheckmarxPath = () => {
16438
- const os17 = type();
16439
- const cxFileName = os17 === "Windows_NT" ? "cx.exe" : "cx";
16499
+ const os19 = type();
16500
+ const cxFileName = os19 === "Windows_NT" ? "cx.exe" : "cx";
16440
16501
  try {
16441
16502
  return costumeRequire.resolve(`.bin/${cxFileName}`);
16442
16503
  } catch (e) {
@@ -19721,7 +19782,7 @@ function createLogger(config2) {
19721
19782
 
19722
19783
  // src/features/claude_code/hook_logger.ts
19723
19784
  var DD_RUM_TOKEN = true ? "pubf59c0182545bfb4c299175119f1abf9b" : "";
19724
- var CLI_VERSION = true ? "1.4.23" : "unknown";
19785
+ var CLI_VERSION = true ? "1.4.25" : "unknown";
19725
19786
  var NAMESPACE = "mobbdev-claude-code-hook-logs";
19726
19787
  var claudeCodeVersion;
19727
19788
  function buildDdTags() {
@@ -21246,7 +21307,7 @@ var logDebug = (message, data) => logger2.log(message, "debug", data);
21246
21307
  var log = logger2.log.bind(logger2);
21247
21308
 
21248
21309
  // src/mcp/services/McpGQLClient.ts
21249
- import crypto2 from "crypto";
21310
+ import os9 from "os";
21250
21311
  init_client_generates();
21251
21312
  init_configs();
21252
21313
 
@@ -21628,85 +21689,20 @@ var McpGQLClient = class extends GQLClient {
21628
21689
  if (!userEmail) {
21629
21690
  throw new Error("User email not found");
21630
21691
  }
21631
- const shortEmailHash = crypto2.createHash("sha256").update(userEmail).digest("hex").slice(0, 8).toUpperCase();
21632
- const projectName = `MCP Scans ${shortEmailHash}`;
21633
- logDebug("[GraphQL] Calling getLastOrgAndNamedProject query", {
21634
- projectName
21635
- });
21636
- const orgAndProjectRes = await this._clientSdk.getLastOrgAndNamedProject({
21637
- email: userEmail,
21638
- projectName
21639
- });
21640
- logDebug("[GraphQL] getLastOrgAndNamedProject successful", {
21641
- result: orgAndProjectRes
21642
- });
21643
- if (!orgAndProjectRes.user?.[0]?.userOrganizationsAndUserOrganizationRoles?.[0]?.organization?.id) {
21692
+ const orgRes = await this._clientSdk.getLastOrg({ email: userEmail });
21693
+ const organizationId = orgRes.user?.[0]?.userOrganizationsAndUserOrganizationRoles?.[0]?.organization?.id;
21694
+ if (!organizationId) {
21644
21695
  throw new Error(
21645
- `The user with email:${userEmail} is not associated with any organization`
21696
+ `The user with email:${userEmail} is not associated with any organization`
21646
21697
  );
21647
21698
  }
21648
- const organization = orgAndProjectRes.user?.[0]?.userOrganizationsAndUserOrganizationRoles?.[0]?.organization;
21649
- const projectId = organization?.projects?.[0]?.id;
21650
- if (projectId) {
21651
- logDebug("[GraphQL] Found existing project", {
21652
- projectId,
21653
- projectName
21654
- });
21655
- return projectId;
21656
- }
21657
- logDebug("[GraphQL] Project not found, creating new project", {
21658
- organizationId: organization.id,
21659
- projectName
21660
- });
21661
- try {
21662
- const createdProject = await this._clientSdk.CreateProject({
21663
- organizationId: organization.id,
21664
- projectName
21665
- });
21666
- logDebug("[GraphQL] CreateProject successful", {
21667
- result: createdProject
21668
- });
21669
- return createdProject.createProject.projectId;
21670
- } catch (createError) {
21671
- const errorMessage3 = createError instanceof Error ? createError.message : String(createError);
21672
- const isConstraintViolation = errorMessage3.includes(
21673
- "duplicate key value violates unique constraint"
21674
- ) && errorMessage3.includes("project_name_organization_id_key");
21675
- if (isConstraintViolation) {
21676
- logDebug(
21677
- "[GraphQL] Project creation failed due to constraint violation, retrying fetch",
21678
- {
21679
- organizationId: organization.id,
21680
- projectName,
21681
- error: errorMessage3
21682
- }
21683
- );
21684
- const retryOrgAndProjectRes = await this._clientSdk.getLastOrgAndNamedProject({
21685
- email: userEmail,
21686
- projectName
21687
- });
21688
- const retryProjectId = retryOrgAndProjectRes.user?.[0]?.userOrganizationsAndUserOrganizationRoles?.[0]?.organization?.projects?.[0]?.id;
21689
- if (retryProjectId) {
21690
- logDebug(
21691
- "[GraphQL] Successfully found existing project after constraint violation",
21692
- {
21693
- projectId: retryProjectId,
21694
- projectName
21695
- }
21696
- );
21697
- return retryProjectId;
21698
- }
21699
- logError(
21700
- "[GraphQL] Failed to find project even after constraint violation retry",
21701
- {
21702
- organizationId: organization.id,
21703
- projectName,
21704
- retryResult: retryOrgAndProjectRes
21705
- }
21706
- );
21707
- }
21708
- throw createError;
21699
+ const mvsRes = await this._clientSdk.getMvsProject({ organizationId });
21700
+ const projectId = mvsRes.getMvsProject?.projectId;
21701
+ if (!projectId) {
21702
+ throw new Error("Failed to resolve the MVS project");
21709
21703
  }
21704
+ logDebug("[GraphQL] Resolved MVS project", { projectId });
21705
+ return projectId;
21710
21706
  } catch (e) {
21711
21707
  logError("[GraphQL] getProjectId failed", {
21712
21708
  error: e,
@@ -21803,6 +21799,26 @@ var McpGQLClient = class extends GQLClient {
21803
21799
  logDebug("[GraphQL] No auto-applied fixes to update status");
21804
21800
  }
21805
21801
  }
21802
+ /** Best-effort: a telemetry failure must never break a scan/fix, so errors are swallowed. */
21803
+ async logMvsEvent(params) {
21804
+ try {
21805
+ await this._clientSdk.LogMvsEvent({
21806
+ eventType: params.eventType,
21807
+ fixReportId: params.fixReportId ?? null,
21808
+ projectId: params.projectId ?? null,
21809
+ repoUrl: params.repoUrl ?? null,
21810
+ riskCount: params.riskCount ?? null,
21811
+ computerName: os9.hostname(),
21812
+ computerUser: getComputerUser() ?? null,
21813
+ clientVersion: packageJson.version
21814
+ });
21815
+ } catch (error) {
21816
+ logDebug("[GraphQL] logMvsEvent failed (ignored)", {
21817
+ eventType: params.eventType,
21818
+ error: error.message
21819
+ });
21820
+ }
21821
+ }
21806
21822
  async getMvsAutoFixSettings() {
21807
21823
  try {
21808
21824
  const envOverride = process.env["MVS_AUTO_FIX"];
@@ -22076,7 +22092,7 @@ async function createAuthenticatedMcpGQLClient({
22076
22092
  // src/mcp/services/McpUsageService/host.ts
22077
22093
  import { execSync as execSync2 } from "child_process";
22078
22094
  import fs15 from "fs";
22079
- import os9 from "os";
22095
+ import os10 from "os";
22080
22096
  import path25 from "path";
22081
22097
  var IDEs = ["cursor", "windsurf", "webstorm", "vscode", "claude"];
22082
22098
  var runCommand = (cmd) => {
@@ -22091,7 +22107,7 @@ var gitInfo = {
22091
22107
  email: runCommand("git config user.email")
22092
22108
  };
22093
22109
  var getClaudeWorkspacePaths = () => {
22094
- const home = os9.homedir();
22110
+ const home = os10.homedir();
22095
22111
  const claudeIdePath = path25.join(home, ".claude", "ide");
22096
22112
  const workspacePaths = [];
22097
22113
  if (!fs15.existsSync(claudeIdePath)) {
@@ -22120,7 +22136,7 @@ var getClaudeWorkspacePaths = () => {
22120
22136
  return workspacePaths;
22121
22137
  };
22122
22138
  var getMCPConfigPaths = (hostName) => {
22123
- const home = os9.homedir();
22139
+ const home = os10.homedir();
22124
22140
  const currentDir = process.env["WORKSPACE_FOLDER_PATHS"] || process.env["PWD"] || process.cwd();
22125
22141
  switch (hostName.toLowerCase()) {
22126
22142
  case "cursor":
@@ -22210,7 +22226,7 @@ var readMCPConfig = (hostName) => {
22210
22226
  };
22211
22227
  var getRunningProcesses = () => {
22212
22228
  try {
22213
- return os9.platform() === "win32" ? execSync2("tasklist", { encoding: "utf8" }) : execSync2("ps aux", { encoding: "utf8" });
22229
+ return os10.platform() === "win32" ? execSync2("tasklist", { encoding: "utf8" }) : execSync2("ps aux", { encoding: "utf8" });
22214
22230
  } catch {
22215
22231
  return "";
22216
22232
  }
@@ -22285,7 +22301,7 @@ var versionCommands = {
22285
22301
  }
22286
22302
  };
22287
22303
  var getProcessInfo = (pid) => {
22288
- const platform2 = os9.platform();
22304
+ const platform2 = os10.platform();
22289
22305
  try {
22290
22306
  if (platform2 === "linux" || platform2 === "darwin") {
22291
22307
  const output = execSync2(`ps -o pid=,ppid=,comm= -p ${pid}`, {
@@ -22404,7 +22420,7 @@ var getHostInfo = (additionalMcpList) => {
22404
22420
  const config2 = allConfigs[ide] || null;
22405
22421
  const ideName = ide.charAt(0).toUpperCase() + ide.slice(1) || "Unknown";
22406
22422
  let ideVersion = "Unknown";
22407
- const platform2 = os9.platform();
22423
+ const platform2 = os10.platform();
22408
22424
  const cmds = versionCommands[ideName]?.[platform2] ?? [];
22409
22425
  for (const cmd of cmds) {
22410
22426
  try {
@@ -22437,14 +22453,14 @@ var getHostInfo = (additionalMcpList) => {
22437
22453
 
22438
22454
  // src/mcp/services/McpUsageService/McpUsageService.ts
22439
22455
  import fetch6 from "node-fetch";
22440
- import os11 from "os";
22456
+ import os12 from "os";
22441
22457
  import { v4 as uuidv42, v5 as uuidv5 } from "uuid";
22442
22458
  init_configs();
22443
22459
 
22444
22460
  // src/mcp/services/McpUsageService/system.ts
22445
22461
  init_configs();
22446
22462
  import fs16 from "fs";
22447
- import os10 from "os";
22463
+ import os11 from "os";
22448
22464
  import path26 from "path";
22449
22465
  var MAX_DEPTH = 2;
22450
22466
  var patterns = ["mcp", "claude"];
@@ -22479,8 +22495,8 @@ var searchDir = async (dir, depth = 0) => {
22479
22495
  };
22480
22496
  var findSystemMCPConfigs = async () => {
22481
22497
  try {
22482
- const home = os10.homedir();
22483
- const platform2 = os10.platform();
22498
+ const home = os11.homedir();
22499
+ const platform2 = os11.platform();
22484
22500
  const knownDirs = platform2 === "win32" ? [
22485
22501
  path26.join(home, ".cursor"),
22486
22502
  path26.join(home, "Documents"),
@@ -22552,7 +22568,7 @@ var McpUsageService = class {
22552
22568
  generateHostId() {
22553
22569
  const stored = configStore.get(this.configKey);
22554
22570
  if (stored?.mcpHostId) return stored.mcpHostId;
22555
- const interfaces = os11.networkInterfaces();
22571
+ const interfaces = os12.networkInterfaces();
22556
22572
  const macs = [];
22557
22573
  for (const iface of Object.values(interfaces)) {
22558
22574
  if (!iface) continue;
@@ -22560,7 +22576,7 @@ var McpUsageService = class {
22560
22576
  if (net.mac && net.mac !== "00:00:00:00:00:00") macs.push(net.mac);
22561
22577
  }
22562
22578
  }
22563
- const macString = macs.length ? macs.sort().join(",") : `${os11.hostname()}-${uuidv42()}`;
22579
+ const macString = macs.length ? macs.sort().join(",") : `${os12.hostname()}-${uuidv42()}`;
22564
22580
  const hostId = uuidv5(macString, uuidv5.DNS);
22565
22581
  logDebug("[UsageService] Generated new host ID", { hostId });
22566
22582
  return hostId;
@@ -22583,7 +22599,7 @@ var McpUsageService = class {
22583
22599
  mcpHostId,
22584
22600
  organizationId,
22585
22601
  mcpVersion: packageJson.version,
22586
- mcpOsName: os11.platform(),
22602
+ mcpOsName: os12.platform(),
22587
22603
  mcps: JSON.stringify(mcps),
22588
22604
  status,
22589
22605
  userName: user.name,
@@ -24904,7 +24920,7 @@ For a complete security audit workflow, use the \`full-security-audit\` prompt.
24904
24920
 
24905
24921
  // src/mcp/services/McpDetectionService/CursorMcpDetectionService.ts
24906
24922
  import * as fs19 from "fs";
24907
- import * as os13 from "os";
24923
+ import * as os14 from "os";
24908
24924
  import * as path28 from "path";
24909
24925
 
24910
24926
  // src/mcp/services/McpDetectionService/BaseMcpDetectionService.ts
@@ -24915,11 +24931,11 @@ import * as path27 from "path";
24915
24931
 
24916
24932
  // src/mcp/services/McpDetectionService/McpDetectionServiceUtils.ts
24917
24933
  import * as fs17 from "fs";
24918
- import * as os12 from "os";
24934
+ import * as os13 from "os";
24919
24935
 
24920
24936
  // src/mcp/services/McpDetectionService/VscodeMcpDetectionService.ts
24921
24937
  import * as fs20 from "fs";
24922
- import * as os14 from "os";
24938
+ import * as os15 from "os";
24923
24939
  import * as path29 from "path";
24924
24940
 
24925
24941
  // src/mcp/tools/checkForNewAvailableFixes/CheckForNewAvailableFixesTool.ts
@@ -27625,6 +27641,7 @@ var PatchApplicationService = class {
27625
27641
  // src/mcp/services/ScanFiles.ts
27626
27642
  init_client_generates();
27627
27643
  init_GitService();
27644
+ import os16 from "os";
27628
27645
  init_configs();
27629
27646
 
27630
27647
  // src/mcp/services/FileOperations.ts
@@ -27898,7 +27915,12 @@ var executeSecurityScan = async ({
27898
27915
  isFullScan: !!isAllDetectionRulesScan,
27899
27916
  sha,
27900
27917
  scanContext,
27901
- fileCount
27918
+ fileCount,
27919
+ // MVS device attribution: a developer appears in the MVS Developers grid
27920
+ // from scanning alone (no fresh login needed).
27921
+ computerName: os16.hostname(),
27922
+ computerUser: getComputerUser(),
27923
+ clientVersion: packageJson.version
27902
27924
  };
27903
27925
  logInfo(`[${scanContext}] Submitting vulnerability report`);
27904
27926
  logDebug(`[${scanContext}] Submit vulnerability report variables`, {
@@ -29023,6 +29045,7 @@ var _ScanAndFixVulnerabilitiesService = class _ScanAndFixVulnerabilitiesService
29023
29045
  isExpired: this.storedFixReportId ? this.isFixReportIdExpired() : null
29024
29046
  });
29025
29047
  let fixReportId = this.storedFixReportId;
29048
+ let didScan = false;
29026
29049
  if (!fixReportId || isRescan || this.isFixReportIdExpired()) {
29027
29050
  logInfo("Scanning files");
29028
29051
  this.reset();
@@ -29034,6 +29057,7 @@ var _ScanAndFixVulnerabilitiesService = class _ScanAndFixVulnerabilitiesService
29034
29057
  scanContext: ScanContext.USER_REQUEST
29035
29058
  });
29036
29059
  fixReportId = scanResult.fixReportId;
29060
+ didScan = true;
29037
29061
  } else {
29038
29062
  logInfo("Using stored fixReportId");
29039
29063
  }
@@ -29046,6 +29070,23 @@ var _ScanAndFixVulnerabilitiesService = class _ScanAndFixVulnerabilitiesService
29046
29070
  limit: effectiveLimit
29047
29071
  });
29048
29072
  logInfo(`Found ${fixes.totalCount} fixes`);
29073
+ if (fixReportId && effectiveOffset === 0 && fixes.totalCount > 0) {
29074
+ if (didScan) {
29075
+ await this.gqlClient.logMvsEvent({
29076
+ eventType: "RISK_DETECTED",
29077
+ fixReportId,
29078
+ riskCount: fixes.totalCount
29079
+ });
29080
+ }
29081
+ await this.gqlClient.logMvsEvent({
29082
+ eventType: "FIXES_VIEWED",
29083
+ fixReportId,
29084
+ // Count of fixes shown, so the Event Log row mirrors Fixable Issues
29085
+ // Detected ("N issues"). Not summed into the Fixable Issues KPI,
29086
+ // which only counts RISK_DETECTED.
29087
+ riskCount: fixes.totalCount
29088
+ });
29089
+ }
29049
29090
  if (fixes.totalCount > 0) {
29050
29091
  this.storedFixReportId = fixReportId;
29051
29092
  this.fixReportIdTimestamp = Date.now();
@@ -29842,18 +29883,18 @@ async function getGrpcClient(port, csrf3) {
29842
29883
 
29843
29884
  // src/features/codeium_intellij/parse_intellij_logs.ts
29844
29885
  import fs27 from "fs";
29845
- import os15 from "os";
29886
+ import os17 from "os";
29846
29887
  import path35 from "path";
29847
29888
  function getLogsDir() {
29848
29889
  if (process.platform === "darwin") {
29849
- return path35.join(os15.homedir(), "Library/Logs/JetBrains");
29890
+ return path35.join(os17.homedir(), "Library/Logs/JetBrains");
29850
29891
  } else if (process.platform === "win32") {
29851
29892
  return path35.join(
29852
- process.env["LOCALAPPDATA"] || path35.join(os15.homedir(), "AppData/Local"),
29893
+ process.env["LOCALAPPDATA"] || path35.join(os17.homedir(), "AppData/Local"),
29853
29894
  "JetBrains"
29854
29895
  );
29855
29896
  } else {
29856
- return path35.join(os15.homedir(), ".cache/JetBrains");
29897
+ return path35.join(os17.homedir(), ".cache/JetBrains");
29857
29898
  }
29858
29899
  }
29859
29900
  function parseIdeLogDir(ideLogDir) {
@@ -30076,11 +30117,11 @@ function processChatStepCodeAction(step) {
30076
30117
 
30077
30118
  // src/features/codeium_intellij/install_hook.ts
30078
30119
  import fsPromises5 from "fs/promises";
30079
- import os16 from "os";
30120
+ import os18 from "os";
30080
30121
  import path36 from "path";
30081
30122
  import chalk14 from "chalk";
30082
30123
  function getCodeiumHooksPath() {
30083
- return path36.join(os16.homedir(), ".codeium", "hooks.json");
30124
+ return path36.join(os18.homedir(), ".codeium", "hooks.json");
30084
30125
  }
30085
30126
  async function readCodeiumHooks() {
30086
30127
  const hooksPath = getCodeiumHooksPath();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobbdev",
3
- "version": "1.4.23",
3
+ "version": "1.4.25",
4
4
  "description": "Automated secure code remediation tool",
5
5
  "repository": "git+https://github.com/mobb-dev/bugsy.git",
6
6
  "main": "dist/index.mjs",