mobbdev 1.4.10 → 1.4.12
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/args/commands/upload_ai_blame.d.mts +28 -9
- package/dist/args/commands/upload_ai_blame.mjs +114 -15
- package/dist/index.mjs +814 -146
- package/package.json +1 -1
|
@@ -56,17 +56,17 @@ declare const PromptItemZ: z.ZodObject<{
|
|
|
56
56
|
name: string;
|
|
57
57
|
parameters: string;
|
|
58
58
|
result: string;
|
|
59
|
+
mcpServer?: string | undefined;
|
|
59
60
|
accepted?: boolean | undefined;
|
|
60
61
|
rawArguments?: string | undefined;
|
|
61
|
-
mcpServer?: string | undefined;
|
|
62
62
|
mcpToolName?: string | undefined;
|
|
63
63
|
}, {
|
|
64
64
|
name: string;
|
|
65
65
|
parameters: string;
|
|
66
66
|
result: string;
|
|
67
|
+
mcpServer?: string | undefined;
|
|
67
68
|
accepted?: boolean | undefined;
|
|
68
69
|
rawArguments?: string | undefined;
|
|
69
|
-
mcpServer?: string | undefined;
|
|
70
70
|
mcpToolName?: string | undefined;
|
|
71
71
|
}>>;
|
|
72
72
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -75,9 +75,9 @@ declare const PromptItemZ: z.ZodObject<{
|
|
|
75
75
|
name: string;
|
|
76
76
|
parameters: string;
|
|
77
77
|
result: string;
|
|
78
|
+
mcpServer?: string | undefined;
|
|
78
79
|
accepted?: boolean | undefined;
|
|
79
80
|
rawArguments?: string | undefined;
|
|
80
|
-
mcpServer?: string | undefined;
|
|
81
81
|
mcpToolName?: string | undefined;
|
|
82
82
|
} | undefined;
|
|
83
83
|
date?: Date | undefined;
|
|
@@ -96,9 +96,9 @@ declare const PromptItemZ: z.ZodObject<{
|
|
|
96
96
|
name: string;
|
|
97
97
|
parameters: string;
|
|
98
98
|
result: string;
|
|
99
|
+
mcpServer?: string | undefined;
|
|
99
100
|
accepted?: boolean | undefined;
|
|
100
101
|
rawArguments?: string | undefined;
|
|
101
|
-
mcpServer?: string | undefined;
|
|
102
102
|
mcpToolName?: string | undefined;
|
|
103
103
|
} | undefined;
|
|
104
104
|
date?: Date | undefined;
|
|
@@ -149,17 +149,17 @@ declare const PromptItemArrayZ: z.ZodArray<z.ZodObject<{
|
|
|
149
149
|
name: string;
|
|
150
150
|
parameters: string;
|
|
151
151
|
result: string;
|
|
152
|
+
mcpServer?: string | undefined;
|
|
152
153
|
accepted?: boolean | undefined;
|
|
153
154
|
rawArguments?: string | undefined;
|
|
154
|
-
mcpServer?: string | undefined;
|
|
155
155
|
mcpToolName?: string | undefined;
|
|
156
156
|
}, {
|
|
157
157
|
name: string;
|
|
158
158
|
parameters: string;
|
|
159
159
|
result: string;
|
|
160
|
+
mcpServer?: string | undefined;
|
|
160
161
|
accepted?: boolean | undefined;
|
|
161
162
|
rawArguments?: string | undefined;
|
|
162
|
-
mcpServer?: string | undefined;
|
|
163
163
|
mcpToolName?: string | undefined;
|
|
164
164
|
}>>;
|
|
165
165
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -168,9 +168,9 @@ declare const PromptItemArrayZ: z.ZodArray<z.ZodObject<{
|
|
|
168
168
|
name: string;
|
|
169
169
|
parameters: string;
|
|
170
170
|
result: string;
|
|
171
|
+
mcpServer?: string | undefined;
|
|
171
172
|
accepted?: boolean | undefined;
|
|
172
173
|
rawArguments?: string | undefined;
|
|
173
|
-
mcpServer?: string | undefined;
|
|
174
174
|
mcpToolName?: string | undefined;
|
|
175
175
|
} | undefined;
|
|
176
176
|
date?: Date | undefined;
|
|
@@ -189,9 +189,9 @@ declare const PromptItemArrayZ: z.ZodArray<z.ZodObject<{
|
|
|
189
189
|
name: string;
|
|
190
190
|
parameters: string;
|
|
191
191
|
result: string;
|
|
192
|
+
mcpServer?: string | undefined;
|
|
192
193
|
accepted?: boolean | undefined;
|
|
193
194
|
rawArguments?: string | undefined;
|
|
194
|
-
mcpServer?: string | undefined;
|
|
195
195
|
mcpToolName?: string | undefined;
|
|
196
196
|
} | undefined;
|
|
197
197
|
date?: Date | undefined;
|
|
@@ -206,6 +206,25 @@ declare const PromptItemArrayZ: z.ZodArray<z.ZodObject<{
|
|
|
206
206
|
}[] | undefined;
|
|
207
207
|
}>, "many">;
|
|
208
208
|
type PromptItemArray = z.infer<typeof PromptItemArrayZ>;
|
|
209
|
+
type RepoState = {
|
|
210
|
+
repositoryUrl: string | null;
|
|
211
|
+
branch: string | null;
|
|
212
|
+
commitSha: string | null;
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Reads git state for tracy event attribution: repo URL, current branch, and
|
|
216
|
+
* HEAD commit SHA. Each field is read fresh — no caching across calls. Detached
|
|
217
|
+
* HEAD (rebase, bisect) returns `branch: null` rather than the literal string
|
|
218
|
+
* "HEAD" that `git rev-parse --abbrev-ref HEAD` would produce.
|
|
219
|
+
*
|
|
220
|
+
* Both the CLI daemon and the VS Code extension flow through the shared
|
|
221
|
+
* `GitService.getCurrentRepoState()` so detached-HEAD handling and SHA
|
|
222
|
+
* normalization stay in lockstep across the two clients.
|
|
223
|
+
*
|
|
224
|
+
* Never throws — non-existent dirs, missing git binaries, and unrecognized
|
|
225
|
+
* remotes all resolve to nulls so the daemon hot path can rely on a value.
|
|
226
|
+
*/
|
|
227
|
+
declare function readRepoState(workingDir?: string): Promise<RepoState>;
|
|
209
228
|
/**
|
|
210
229
|
* Gets the normalized GitHub repository URL from the current working directory.
|
|
211
230
|
* Returns null if not in a git repository or if not a GitHub repository.
|
|
@@ -265,4 +284,4 @@ type UploadAiBlameHandlerOptions = {
|
|
|
265
284
|
declare function uploadAiBlameHandler(options: UploadAiBlameHandlerOptions): Promise<void>;
|
|
266
285
|
declare function uploadAiBlameCommandHandler(args: UploadAiBlameOptions): Promise<void>;
|
|
267
286
|
|
|
268
|
-
export { type PromptItem, type PromptItemArray, type UploadAiBlameOptions, type UploadAiBlameResult, getRepositoryUrl, getSystemInfo, uploadAiBlameBuilder, uploadAiBlameCommandHandler, uploadAiBlameHandler, uploadAiBlameHandlerFromExtension };
|
|
287
|
+
export { type PromptItem, type PromptItemArray, type RepoState, type UploadAiBlameOptions, type UploadAiBlameResult, getRepositoryUrl, getSystemInfo, readRepoState, uploadAiBlameBuilder, uploadAiBlameCommandHandler, uploadAiBlameHandler, uploadAiBlameHandlerFromExtension };
|
|
@@ -109,6 +109,9 @@ function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
109
109
|
autoPrAnalysis(variables, requestHeaders, signal) {
|
|
110
110
|
return withWrapper((wrappedRequestHeaders) => client.request({ document: AutoPrAnalysisDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "autoPrAnalysis", "mutation", variables);
|
|
111
111
|
},
|
|
112
|
+
getFixWithAnswers(variables, requestHeaders, signal) {
|
|
113
|
+
return withWrapper((wrappedRequestHeaders) => client.request({ document: GetFixWithAnswersDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "getFixWithAnswers", "query", variables);
|
|
114
|
+
},
|
|
112
115
|
GetFixReportsByRepoUrl(variables, requestHeaders, signal) {
|
|
113
116
|
return withWrapper((wrappedRequestHeaders) => client.request({ document: GetFixReportsByRepoUrlDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetFixReportsByRepoUrl", "query", variables);
|
|
114
117
|
},
|
|
@@ -138,7 +141,7 @@ function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
138
141
|
}
|
|
139
142
|
};
|
|
140
143
|
}
|
|
141
|
-
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, GetFixReportsByRepoUrlDocument, GetReportFixesDocument, GetLatestReportByRepoUrlDocument, UpdateDownloadedFixDataDocument, GetUserMvsAutoFixDocument, StreamBlameAiAnalysisRequestsDocument, StreamCommitBlameRequestsDocument, ScanSkillDocument, SkillVerdictsByMd5Document, defaultWrapper;
|
|
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;
|
|
142
145
|
var init_client_generates = __esm({
|
|
143
146
|
"src/features/analysis/scm/generates/client_generates.ts"() {
|
|
144
147
|
"use strict";
|
|
@@ -312,6 +315,7 @@ var init_client_generates = __esm({
|
|
|
312
315
|
IssueType_Enum2["NoReturnInFinally"] = "NO_RETURN_IN_FINALLY";
|
|
313
316
|
IssueType_Enum2["NoVar"] = "NO_VAR";
|
|
314
317
|
IssueType_Enum2["NullDereference"] = "NULL_DEREFERENCE";
|
|
318
|
+
IssueType_Enum2["OftenMisusedBooleanGetBoolean"] = "OFTEN_MISUSED_BOOLEAN_GET_BOOLEAN";
|
|
315
319
|
IssueType_Enum2["OpenRedirect"] = "OPEN_REDIRECT";
|
|
316
320
|
IssueType_Enum2["OverlyBroadCatch"] = "OVERLY_BROAD_CATCH";
|
|
317
321
|
IssueType_Enum2["OverlyLargeRange"] = "OVERLY_LARGE_RANGE";
|
|
@@ -442,6 +446,7 @@ var init_client_generates = __esm({
|
|
|
442
446
|
id
|
|
443
447
|
confidence
|
|
444
448
|
safeIssueType
|
|
449
|
+
safeIssueLanguage
|
|
445
450
|
severityText
|
|
446
451
|
gitBlameLogin
|
|
447
452
|
severityValue
|
|
@@ -464,6 +469,19 @@ var init_client_generates = __esm({
|
|
|
464
469
|
... on FixData {
|
|
465
470
|
patch
|
|
466
471
|
patchOriginalEncodingBase64
|
|
472
|
+
questions {
|
|
473
|
+
key
|
|
474
|
+
name
|
|
475
|
+
defaultValue
|
|
476
|
+
value
|
|
477
|
+
inputType
|
|
478
|
+
options
|
|
479
|
+
index
|
|
480
|
+
extraContext {
|
|
481
|
+
key
|
|
482
|
+
value
|
|
483
|
+
}
|
|
484
|
+
}
|
|
467
485
|
extraContext {
|
|
468
486
|
extraContext {
|
|
469
487
|
key
|
|
@@ -1179,6 +1197,37 @@ var init_client_generates = __esm({
|
|
|
1179
1197
|
error
|
|
1180
1198
|
}
|
|
1181
1199
|
}
|
|
1200
|
+
}
|
|
1201
|
+
`;
|
|
1202
|
+
GetFixWithAnswersDocument = `
|
|
1203
|
+
query getFixWithAnswers($fixId: uuid!, $userInput: [QuestionAnswer!]!) {
|
|
1204
|
+
fixData: getFix(fixId: $fixId, userInput: $userInput, loadAnswers: false) {
|
|
1205
|
+
__typename
|
|
1206
|
+
... on FixData {
|
|
1207
|
+
patch
|
|
1208
|
+
patchOriginalEncodingBase64
|
|
1209
|
+
questions {
|
|
1210
|
+
key
|
|
1211
|
+
name
|
|
1212
|
+
defaultValue
|
|
1213
|
+
value
|
|
1214
|
+
inputType
|
|
1215
|
+
options
|
|
1216
|
+
index
|
|
1217
|
+
extraContext {
|
|
1218
|
+
key
|
|
1219
|
+
value
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
extraContext {
|
|
1223
|
+
extraContext {
|
|
1224
|
+
key
|
|
1225
|
+
value
|
|
1226
|
+
}
|
|
1227
|
+
fixDescription
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1182
1231
|
}
|
|
1183
1232
|
`;
|
|
1184
1233
|
GetFixReportsByRepoUrlDocument = `
|
|
@@ -1827,7 +1876,8 @@ var init_getIssueType = __esm({
|
|
|
1827
1876
|
["MISSING_X_FRAME_OPTIONS" /* MissingXFrameOptions */]: "Missing X-Frame-Options Header",
|
|
1828
1877
|
["IMPROPER_VALIDATION_OF_ARRAY_INDEX" /* ImproperValidationOfArrayIndex */]: "Improper Validation of Array Index",
|
|
1829
1878
|
["INCORRECT_INTEGER_CONVERSION" /* IncorrectIntegerConversion */]: "Incorrect Integer Conversion",
|
|
1830
|
-
["IMPROPER_CERTIFICATE_VALIDATION" /* ImproperCertificateValidation */]: "Improper Certificate Validation"
|
|
1879
|
+
["IMPROPER_CERTIFICATE_VALIDATION" /* ImproperCertificateValidation */]: "Improper Certificate Validation",
|
|
1880
|
+
["OFTEN_MISUSED_BOOLEAN_GET_BOOLEAN" /* OftenMisusedBooleanGetBoolean */]: "Often Misused: Boolean.getBoolean()"
|
|
1831
1881
|
};
|
|
1832
1882
|
issueTypeZ = z5.nativeEnum(IssueType_Enum);
|
|
1833
1883
|
getIssueTypeFriendlyString = (issueType) => {
|
|
@@ -3865,6 +3915,31 @@ var init_GitService = __esm({
|
|
|
3865
3915
|
throw new Error(errorMessage);
|
|
3866
3916
|
}
|
|
3867
3917
|
}
|
|
3918
|
+
/**
|
|
3919
|
+
* Reads `{ branch, commitSha }` for tracy event attribution. Detached-HEAD
|
|
3920
|
+
* (rebase, bisect, "open this commit") returns `branch: null` rather than
|
|
3921
|
+
* the literal string `"HEAD"` that `getCurrentBranch()` produces — that
|
|
3922
|
+
* literal would silently corrupt downstream branch dashboards.
|
|
3923
|
+
*
|
|
3924
|
+
* The two reads run in parallel so the wall-time cost is one `git`
|
|
3925
|
+
* round-trip rather than two. Never throws — failures resolve to nulls so
|
|
3926
|
+
* the daemon hot path can rely on a value, not an exception.
|
|
3927
|
+
*/
|
|
3928
|
+
async getCurrentRepoState() {
|
|
3929
|
+
const branchPromise = this.git.raw(["symbolic-ref", "--short", "-q", "HEAD"]).then((s) => {
|
|
3930
|
+
const trimmed = s.trim();
|
|
3931
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
3932
|
+
}).catch(() => null);
|
|
3933
|
+
const commitShaPromise = this.git.raw(["rev-parse", "HEAD"]).then((s) => {
|
|
3934
|
+
const trimmed = s.trim().toLowerCase();
|
|
3935
|
+
return /^[0-9a-f]{40}$/.test(trimmed) ? trimmed : null;
|
|
3936
|
+
}).catch(() => null);
|
|
3937
|
+
const [branch, commitSha] = await Promise.all([
|
|
3938
|
+
branchPromise,
|
|
3939
|
+
commitShaPromise
|
|
3940
|
+
]);
|
|
3941
|
+
return { branch, commitSha };
|
|
3942
|
+
}
|
|
3868
3943
|
/**
|
|
3869
3944
|
* Gets both the current commit hash and current branch name
|
|
3870
3945
|
*/
|
|
@@ -5009,7 +5084,8 @@ var fixDetailsData = {
|
|
|
5009
5084
|
["MISSING_X_FRAME_OPTIONS" /* MissingXFrameOptions */]: void 0,
|
|
5010
5085
|
["IMPROPER_VALIDATION_OF_ARRAY_INDEX" /* ImproperValidationOfArrayIndex */]: void 0,
|
|
5011
5086
|
["INCORRECT_INTEGER_CONVERSION" /* IncorrectIntegerConversion */]: void 0,
|
|
5012
|
-
["IMPROPER_CERTIFICATE_VALIDATION" /* ImproperCertificateValidation */]: void 0
|
|
5087
|
+
["IMPROPER_CERTIFICATE_VALIDATION" /* ImproperCertificateValidation */]: void 0,
|
|
5088
|
+
["OFTEN_MISUSED_BOOLEAN_GET_BOOLEAN" /* OftenMisusedBooleanGetBoolean */]: void 0
|
|
5013
5089
|
};
|
|
5014
5090
|
|
|
5015
5091
|
// src/features/analysis/scm/shared/src/commitDescriptionMarkup.ts
|
|
@@ -7409,8 +7485,16 @@ var ADO_PAT_PATTERN = {
|
|
|
7409
7485
|
severity: "high",
|
|
7410
7486
|
validator: (match) => match.length >= 52 && match.length <= 100
|
|
7411
7487
|
};
|
|
7488
|
+
var DATADOG_APP_KEY_PATTERN = {
|
|
7489
|
+
type: "DATADOG_APP_KEY",
|
|
7490
|
+
regex: /\bddapp_[a-zA-Z0-9]{30,}\b/g,
|
|
7491
|
+
priority: 95,
|
|
7492
|
+
placeholder: "[DATADOG_APP_KEY_{n}]",
|
|
7493
|
+
description: "Datadog Application Key",
|
|
7494
|
+
severity: "high"
|
|
7495
|
+
};
|
|
7412
7496
|
var openRedaction = new OpenRedaction({
|
|
7413
|
-
customPatterns: [ADO_PAT_PATTERN],
|
|
7497
|
+
customPatterns: [ADO_PAT_PATTERN, DATADOG_APP_KEY_PATTERN],
|
|
7414
7498
|
patterns: [
|
|
7415
7499
|
// Core Personal Data
|
|
7416
7500
|
// Removed EMAIL - causes false positives in code/test snippets (e.g. --author="Eve Author <eve@example.com>")
|
|
@@ -8115,19 +8199,33 @@ var PromptItemZ = z27.object({
|
|
|
8115
8199
|
}).optional()
|
|
8116
8200
|
});
|
|
8117
8201
|
var PromptItemArrayZ = z27.array(PromptItemZ);
|
|
8118
|
-
|
|
8202
|
+
var NULL_REPO_STATE = {
|
|
8203
|
+
repositoryUrl: null,
|
|
8204
|
+
branch: null,
|
|
8205
|
+
commitSha: null
|
|
8206
|
+
};
|
|
8207
|
+
async function readRepoState(workingDir) {
|
|
8208
|
+
const dir = workingDir ?? process.cwd();
|
|
8209
|
+
let gitService;
|
|
8119
8210
|
try {
|
|
8120
|
-
|
|
8121
|
-
const isRepo = await gitService.isGitRepository();
|
|
8122
|
-
if (!isRepo) {
|
|
8123
|
-
return null;
|
|
8124
|
-
}
|
|
8125
|
-
const remoteUrl = await gitService.getRemoteUrl();
|
|
8126
|
-
const parsed = parseScmURL(remoteUrl);
|
|
8127
|
-
return parsed?.scmType && parsed.scmType !== "Unknown" ? remoteUrl : null;
|
|
8211
|
+
gitService = new GitService(dir);
|
|
8128
8212
|
} catch {
|
|
8129
|
-
return
|
|
8130
|
-
}
|
|
8213
|
+
return NULL_REPO_STATE;
|
|
8214
|
+
}
|
|
8215
|
+
const repoStatePromise = gitService.getCurrentRepoState().catch(() => ({ branch: null, commitSha: null }));
|
|
8216
|
+
const repositoryUrlPromise = gitService.getRemoteUrl().then((url) => {
|
|
8217
|
+
if (!url) return null;
|
|
8218
|
+
const parsed = parseScmURL(url);
|
|
8219
|
+
return parsed?.scmType && parsed.scmType !== "Unknown" ? url : null;
|
|
8220
|
+
}).catch(() => null);
|
|
8221
|
+
const [{ branch, commitSha }, repositoryUrl] = await Promise.all([
|
|
8222
|
+
repoStatePromise,
|
|
8223
|
+
repositoryUrlPromise
|
|
8224
|
+
]);
|
|
8225
|
+
return { repositoryUrl, branch, commitSha };
|
|
8226
|
+
}
|
|
8227
|
+
async function getRepositoryUrl(workingDir) {
|
|
8228
|
+
return (await readRepoState(workingDir)).repositoryUrl;
|
|
8131
8229
|
}
|
|
8132
8230
|
function getSystemInfo() {
|
|
8133
8231
|
let userName;
|
|
@@ -8409,6 +8507,7 @@ async function uploadAiBlameCommandHandler(args) {
|
|
|
8409
8507
|
export {
|
|
8410
8508
|
getRepositoryUrl,
|
|
8411
8509
|
getSystemInfo,
|
|
8510
|
+
readRepoState,
|
|
8412
8511
|
uploadAiBlameBuilder,
|
|
8413
8512
|
uploadAiBlameCommandHandler,
|
|
8414
8513
|
uploadAiBlameHandler,
|