mobbdev 1.1.28 → 1.1.30
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.
|
@@ -54,18 +54,26 @@ declare const PromptItemZ: z.ZodObject<{
|
|
|
54
54
|
name: string;
|
|
55
55
|
parameters: string;
|
|
56
56
|
result: string;
|
|
57
|
-
rawArguments?: string | undefined;
|
|
58
57
|
accepted?: boolean | undefined;
|
|
58
|
+
rawArguments?: string | undefined;
|
|
59
59
|
}, {
|
|
60
60
|
name: string;
|
|
61
61
|
parameters: string;
|
|
62
62
|
result: string;
|
|
63
|
-
rawArguments?: string | undefined;
|
|
64
63
|
accepted?: boolean | undefined;
|
|
64
|
+
rawArguments?: string | undefined;
|
|
65
65
|
}>>;
|
|
66
66
|
}, "strip", z.ZodTypeAny, {
|
|
67
67
|
type: "USER_PROMPT" | "AI_RESPONSE" | "TOOL_EXECUTION" | "AI_THINKING";
|
|
68
|
+
tool?: {
|
|
69
|
+
name: string;
|
|
70
|
+
parameters: string;
|
|
71
|
+
result: string;
|
|
72
|
+
accepted?: boolean | undefined;
|
|
73
|
+
rawArguments?: string | undefined;
|
|
74
|
+
} | undefined;
|
|
68
75
|
date?: Date | undefined;
|
|
76
|
+
text?: string | undefined;
|
|
69
77
|
attachedFiles?: {
|
|
70
78
|
relativePath: string;
|
|
71
79
|
startLine?: number | undefined;
|
|
@@ -74,17 +82,17 @@ declare const PromptItemZ: z.ZodObject<{
|
|
|
74
82
|
inputCount: number;
|
|
75
83
|
outputCount: number;
|
|
76
84
|
} | undefined;
|
|
77
|
-
|
|
85
|
+
}, {
|
|
86
|
+
type: "USER_PROMPT" | "AI_RESPONSE" | "TOOL_EXECUTION" | "AI_THINKING";
|
|
78
87
|
tool?: {
|
|
79
88
|
name: string;
|
|
80
89
|
parameters: string;
|
|
81
90
|
result: string;
|
|
82
|
-
rawArguments?: string | undefined;
|
|
83
91
|
accepted?: boolean | undefined;
|
|
92
|
+
rawArguments?: string | undefined;
|
|
84
93
|
} | undefined;
|
|
85
|
-
}, {
|
|
86
|
-
type: "USER_PROMPT" | "AI_RESPONSE" | "TOOL_EXECUTION" | "AI_THINKING";
|
|
87
94
|
date?: Date | undefined;
|
|
95
|
+
text?: string | undefined;
|
|
88
96
|
attachedFiles?: {
|
|
89
97
|
relativePath: string;
|
|
90
98
|
startLine?: number | undefined;
|
|
@@ -93,14 +101,6 @@ declare const PromptItemZ: z.ZodObject<{
|
|
|
93
101
|
inputCount: number;
|
|
94
102
|
outputCount: number;
|
|
95
103
|
} | undefined;
|
|
96
|
-
text?: string | undefined;
|
|
97
|
-
tool?: {
|
|
98
|
-
name: string;
|
|
99
|
-
parameters: string;
|
|
100
|
-
result: string;
|
|
101
|
-
rawArguments?: string | undefined;
|
|
102
|
-
accepted?: boolean | undefined;
|
|
103
|
-
} | undefined;
|
|
104
104
|
}>;
|
|
105
105
|
type PromptItem = z.infer<typeof PromptItemZ>;
|
|
106
106
|
declare const PromptItemArrayZ: z.ZodArray<z.ZodObject<{
|
|
@@ -137,18 +137,26 @@ declare const PromptItemArrayZ: z.ZodArray<z.ZodObject<{
|
|
|
137
137
|
name: string;
|
|
138
138
|
parameters: string;
|
|
139
139
|
result: string;
|
|
140
|
-
rawArguments?: string | undefined;
|
|
141
140
|
accepted?: boolean | undefined;
|
|
141
|
+
rawArguments?: string | undefined;
|
|
142
142
|
}, {
|
|
143
143
|
name: string;
|
|
144
144
|
parameters: string;
|
|
145
145
|
result: string;
|
|
146
|
-
rawArguments?: string | undefined;
|
|
147
146
|
accepted?: boolean | undefined;
|
|
147
|
+
rawArguments?: string | undefined;
|
|
148
148
|
}>>;
|
|
149
149
|
}, "strip", z.ZodTypeAny, {
|
|
150
150
|
type: "USER_PROMPT" | "AI_RESPONSE" | "TOOL_EXECUTION" | "AI_THINKING";
|
|
151
|
+
tool?: {
|
|
152
|
+
name: string;
|
|
153
|
+
parameters: string;
|
|
154
|
+
result: string;
|
|
155
|
+
accepted?: boolean | undefined;
|
|
156
|
+
rawArguments?: string | undefined;
|
|
157
|
+
} | undefined;
|
|
151
158
|
date?: Date | undefined;
|
|
159
|
+
text?: string | undefined;
|
|
152
160
|
attachedFiles?: {
|
|
153
161
|
relativePath: string;
|
|
154
162
|
startLine?: number | undefined;
|
|
@@ -157,17 +165,17 @@ declare const PromptItemArrayZ: z.ZodArray<z.ZodObject<{
|
|
|
157
165
|
inputCount: number;
|
|
158
166
|
outputCount: number;
|
|
159
167
|
} | undefined;
|
|
160
|
-
|
|
168
|
+
}, {
|
|
169
|
+
type: "USER_PROMPT" | "AI_RESPONSE" | "TOOL_EXECUTION" | "AI_THINKING";
|
|
161
170
|
tool?: {
|
|
162
171
|
name: string;
|
|
163
172
|
parameters: string;
|
|
164
173
|
result: string;
|
|
165
|
-
rawArguments?: string | undefined;
|
|
166
174
|
accepted?: boolean | undefined;
|
|
175
|
+
rawArguments?: string | undefined;
|
|
167
176
|
} | undefined;
|
|
168
|
-
}, {
|
|
169
|
-
type: "USER_PROMPT" | "AI_RESPONSE" | "TOOL_EXECUTION" | "AI_THINKING";
|
|
170
177
|
date?: Date | undefined;
|
|
178
|
+
text?: string | undefined;
|
|
171
179
|
attachedFiles?: {
|
|
172
180
|
relativePath: string;
|
|
173
181
|
startLine?: number | undefined;
|
|
@@ -176,14 +184,6 @@ declare const PromptItemArrayZ: z.ZodArray<z.ZodObject<{
|
|
|
176
184
|
inputCount: number;
|
|
177
185
|
outputCount: number;
|
|
178
186
|
} | undefined;
|
|
179
|
-
text?: string | undefined;
|
|
180
|
-
tool?: {
|
|
181
|
-
name: string;
|
|
182
|
-
parameters: string;
|
|
183
|
-
result: string;
|
|
184
|
-
rawArguments?: string | undefined;
|
|
185
|
-
accepted?: boolean | undefined;
|
|
186
|
-
} | undefined;
|
|
187
187
|
}>, "many">;
|
|
188
188
|
type PromptItemArray = z.infer<typeof PromptItemArrayZ>;
|
|
189
189
|
type UploadAiBlameOptions = {
|
|
@@ -80,11 +80,13 @@ import fs4 from "fs";
|
|
|
80
80
|
import ignore from "ignore";
|
|
81
81
|
import * as path5 from "path";
|
|
82
82
|
import { simpleGit as simpleGit2 } from "simple-git";
|
|
83
|
+
var MAX_COMMIT_DIFF_SIZE_BYTES;
|
|
83
84
|
var init_GitService = __esm({
|
|
84
85
|
"src/features/analysis/scm/services/GitService.ts"() {
|
|
85
86
|
"use strict";
|
|
86
87
|
init_configs();
|
|
87
88
|
init_FileUtils();
|
|
89
|
+
MAX_COMMIT_DIFF_SIZE_BYTES = 3 * 1024 * 1024;
|
|
88
90
|
}
|
|
89
91
|
});
|
|
90
92
|
|
|
@@ -817,11 +819,14 @@ var UploadS3BucketInfoDocument = `
|
|
|
817
819
|
}
|
|
818
820
|
`;
|
|
819
821
|
var AnalyzeCommitForExtensionAiBlameDocument = `
|
|
820
|
-
mutation AnalyzeCommitForExtensionAIBlame($repositoryURL: String!, $commitSha: String!, $organizationId: String!) {
|
|
822
|
+
mutation AnalyzeCommitForExtensionAIBlame($repositoryURL: String!, $commitSha: String!, $organizationId: String!, $commitDiff: String, $commitTimestamp: Timestamp, $parentCommits: [ParentCommitInput!]) {
|
|
821
823
|
analyzeCommitForAIBlame(
|
|
822
824
|
repositoryURL: $repositoryURL
|
|
823
825
|
commitSha: $commitSha
|
|
824
826
|
organizationId: $organizationId
|
|
827
|
+
commitDiff: $commitDiff
|
|
828
|
+
commitTimestamp: $commitTimestamp
|
|
829
|
+
parentCommits: $parentCommits
|
|
825
830
|
) {
|
|
826
831
|
__typename
|
|
827
832
|
... on ProcessAIBlameFinalResult {
|
|
@@ -867,6 +872,30 @@ var GetAiBlameAttributionPromptDocument = `
|
|
|
867
872
|
}
|
|
868
873
|
}
|
|
869
874
|
`;
|
|
875
|
+
var GetPromptSummaryDocument = `
|
|
876
|
+
query GetPromptSummary($aiBlameAttributionId: String!) {
|
|
877
|
+
getPromptSummary(aiBlameAttributionId: $aiBlameAttributionId) {
|
|
878
|
+
__typename
|
|
879
|
+
... on PromptSummarySuccess {
|
|
880
|
+
status
|
|
881
|
+
summary {
|
|
882
|
+
goal
|
|
883
|
+
developersPlan
|
|
884
|
+
aiImplementationDetails
|
|
885
|
+
importantInstructionsAndPushbacks
|
|
886
|
+
frictionScore {
|
|
887
|
+
score
|
|
888
|
+
justification
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
... on PromptSummaryError {
|
|
893
|
+
status
|
|
894
|
+
error
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
`;
|
|
870
899
|
var UploadAiBlameInferencesInitDocument = `
|
|
871
900
|
mutation UploadAIBlameInferencesInit($sessions: [AIBlameInferenceInitInput!]!) {
|
|
872
901
|
uploadAIBlameInferencesInit(sessions: $sessions) {
|
|
@@ -1194,6 +1223,9 @@ function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
1194
1223
|
GetAIBlameAttributionPrompt(variables, requestHeaders, signal) {
|
|
1195
1224
|
return withWrapper((wrappedRequestHeaders) => client.request({ document: GetAiBlameAttributionPromptDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetAIBlameAttributionPrompt", "query", variables);
|
|
1196
1225
|
},
|
|
1226
|
+
GetPromptSummary(variables, requestHeaders, signal) {
|
|
1227
|
+
return withWrapper((wrappedRequestHeaders) => client.request({ document: GetPromptSummaryDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetPromptSummary", "query", variables);
|
|
1228
|
+
},
|
|
1197
1229
|
UploadAIBlameInferencesInit(variables, requestHeaders, signal) {
|
|
1198
1230
|
return withWrapper((wrappedRequestHeaders) => client.request({ document: UploadAiBlameInferencesInitDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "UploadAIBlameInferencesInit", "mutation", variables);
|
|
1199
1231
|
},
|
|
@@ -5103,6 +5135,9 @@ var GQLClient = class {
|
|
|
5103
5135
|
async getAIBlameAttributionPrompt(variables) {
|
|
5104
5136
|
return await this._clientSdk.GetAIBlameAttributionPrompt(variables);
|
|
5105
5137
|
}
|
|
5138
|
+
async getAIBlameAttributionPromptSummary(variables) {
|
|
5139
|
+
return await this._clientSdk.GetPromptSummary(variables);
|
|
5140
|
+
}
|
|
5106
5141
|
};
|
|
5107
5142
|
|
|
5108
5143
|
// src/mcp/services/types.ts
|
package/dist/index.mjs
CHANGED
|
@@ -723,12 +723,13 @@ import fs2 from "fs";
|
|
|
723
723
|
import ignore from "ignore";
|
|
724
724
|
import * as path2 from "path";
|
|
725
725
|
import { simpleGit } from "simple-git";
|
|
726
|
-
var GitService;
|
|
726
|
+
var MAX_COMMIT_DIFF_SIZE_BYTES, GitService;
|
|
727
727
|
var init_GitService = __esm({
|
|
728
728
|
"src/features/analysis/scm/services/GitService.ts"() {
|
|
729
729
|
"use strict";
|
|
730
730
|
init_configs();
|
|
731
731
|
init_FileUtils();
|
|
732
|
+
MAX_COMMIT_DIFF_SIZE_BYTES = 3 * 1024 * 1024;
|
|
732
733
|
GitService = class {
|
|
733
734
|
constructor(repositoryPath, log2) {
|
|
734
735
|
__publicField(this, "git");
|
|
@@ -1307,6 +1308,97 @@ ${rootContent}`;
|
|
|
1307
1308
|
throw new Error(errorMessage);
|
|
1308
1309
|
}
|
|
1309
1310
|
}
|
|
1311
|
+
/**
|
|
1312
|
+
* Gets timestamps for parent commits in a single git call.
|
|
1313
|
+
* @param parentShas Array of parent commit SHAs
|
|
1314
|
+
* @returns Array of parent commits with timestamps, or undefined if unavailable
|
|
1315
|
+
*/
|
|
1316
|
+
async getParentCommitTimestamps(parentShas) {
|
|
1317
|
+
if (parentShas.length === 0) {
|
|
1318
|
+
return void 0;
|
|
1319
|
+
}
|
|
1320
|
+
try {
|
|
1321
|
+
const output = await this.git.raw([
|
|
1322
|
+
"log",
|
|
1323
|
+
"--format=%H %cI",
|
|
1324
|
+
"--no-walk",
|
|
1325
|
+
...parentShas
|
|
1326
|
+
]);
|
|
1327
|
+
const parentCommits = output.trim().split("\n").filter(Boolean).map((line) => {
|
|
1328
|
+
const [sha, ts] = line.split(" ");
|
|
1329
|
+
return { sha: sha ?? "", timestamp: new Date(ts ?? "") };
|
|
1330
|
+
}).filter((p) => p.sha !== "");
|
|
1331
|
+
return parentCommits.length > 0 ? parentCommits : void 0;
|
|
1332
|
+
} catch {
|
|
1333
|
+
this.log("[GitService] Could not get parent commit timestamps", "debug", {
|
|
1334
|
+
parentShas
|
|
1335
|
+
});
|
|
1336
|
+
return void 0;
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
/**
|
|
1340
|
+
* Gets local commit data including diff, timestamp, and parent commits.
|
|
1341
|
+
* Used by Tracy extension to send commit data directly without requiring SCM token.
|
|
1342
|
+
* @param commitSha The commit SHA to get data for
|
|
1343
|
+
* @param maxDiffSizeBytes Maximum diff size in bytes (default 3MB). Returns null if exceeded.
|
|
1344
|
+
* @returns Commit data or null if unavailable/too large
|
|
1345
|
+
*/
|
|
1346
|
+
async getLocalCommitData(commitSha, maxDiffSizeBytes = MAX_COMMIT_DIFF_SIZE_BYTES) {
|
|
1347
|
+
this.log("[GitService] Getting local commit data", "debug", { commitSha });
|
|
1348
|
+
try {
|
|
1349
|
+
const DIFF_DELIMITER = "---MOBB_DIFF_START---";
|
|
1350
|
+
const output = await this.git.show([
|
|
1351
|
+
commitSha,
|
|
1352
|
+
`--format=%cI%n%P%n${DIFF_DELIMITER}`,
|
|
1353
|
+
"--patch"
|
|
1354
|
+
]);
|
|
1355
|
+
const delimiterIndex = output.indexOf(DIFF_DELIMITER);
|
|
1356
|
+
if (delimiterIndex === -1) {
|
|
1357
|
+
this.log("[GitService] Could not parse git show output", "warning", {
|
|
1358
|
+
commitSha
|
|
1359
|
+
});
|
|
1360
|
+
return null;
|
|
1361
|
+
}
|
|
1362
|
+
const metadataOutput = output.substring(0, delimiterIndex);
|
|
1363
|
+
const diff = output.substring(delimiterIndex + DIFF_DELIMITER.length + 1);
|
|
1364
|
+
const diffSizeBytes = Buffer.byteLength(diff, "utf8");
|
|
1365
|
+
if (diffSizeBytes > maxDiffSizeBytes) {
|
|
1366
|
+
this.log("[GitService] Commit diff exceeds size limit", "warning", {
|
|
1367
|
+
commitSha,
|
|
1368
|
+
diffSizeBytes,
|
|
1369
|
+
maxDiffSizeBytes
|
|
1370
|
+
});
|
|
1371
|
+
return null;
|
|
1372
|
+
}
|
|
1373
|
+
const metadataLines = metadataOutput.trim().split("\n");
|
|
1374
|
+
if (metadataLines.length < 1 || !metadataLines[0]) {
|
|
1375
|
+
this.log("[GitService] Unexpected metadata format", "warning", {
|
|
1376
|
+
commitSha,
|
|
1377
|
+
metadataLines
|
|
1378
|
+
});
|
|
1379
|
+
return null;
|
|
1380
|
+
}
|
|
1381
|
+
const timestampStr = metadataLines[0];
|
|
1382
|
+
const timestamp = new Date(timestampStr);
|
|
1383
|
+
const parentShas = (metadataLines[1] ?? "").trim().split(/\s+/).filter(Boolean);
|
|
1384
|
+
const parentCommits = await this.getParentCommitTimestamps(parentShas);
|
|
1385
|
+
this.log("[GitService] Local commit data retrieved", "debug", {
|
|
1386
|
+
commitSha,
|
|
1387
|
+
diffSizeBytes,
|
|
1388
|
+
timestamp: timestamp.toISOString(),
|
|
1389
|
+
parentCommitCount: parentCommits?.length ?? 0
|
|
1390
|
+
});
|
|
1391
|
+
return {
|
|
1392
|
+
diff,
|
|
1393
|
+
timestamp,
|
|
1394
|
+
parentCommits
|
|
1395
|
+
};
|
|
1396
|
+
} catch (error) {
|
|
1397
|
+
const errorMessage = `Failed to get local commit data: ${error.message}`;
|
|
1398
|
+
this.log(`[GitService] ${errorMessage}`, "debug", { error, commitSha });
|
|
1399
|
+
return null;
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1310
1402
|
};
|
|
1311
1403
|
}
|
|
1312
1404
|
});
|
|
@@ -2070,11 +2162,14 @@ var UploadS3BucketInfoDocument = `
|
|
|
2070
2162
|
}
|
|
2071
2163
|
`;
|
|
2072
2164
|
var AnalyzeCommitForExtensionAiBlameDocument = `
|
|
2073
|
-
mutation AnalyzeCommitForExtensionAIBlame($repositoryURL: String!, $commitSha: String!, $organizationId: String!) {
|
|
2165
|
+
mutation AnalyzeCommitForExtensionAIBlame($repositoryURL: String!, $commitSha: String!, $organizationId: String!, $commitDiff: String, $commitTimestamp: Timestamp, $parentCommits: [ParentCommitInput!]) {
|
|
2074
2166
|
analyzeCommitForAIBlame(
|
|
2075
2167
|
repositoryURL: $repositoryURL
|
|
2076
2168
|
commitSha: $commitSha
|
|
2077
2169
|
organizationId: $organizationId
|
|
2170
|
+
commitDiff: $commitDiff
|
|
2171
|
+
commitTimestamp: $commitTimestamp
|
|
2172
|
+
parentCommits: $parentCommits
|
|
2078
2173
|
) {
|
|
2079
2174
|
__typename
|
|
2080
2175
|
... on ProcessAIBlameFinalResult {
|
|
@@ -2120,6 +2215,30 @@ var GetAiBlameAttributionPromptDocument = `
|
|
|
2120
2215
|
}
|
|
2121
2216
|
}
|
|
2122
2217
|
`;
|
|
2218
|
+
var GetPromptSummaryDocument = `
|
|
2219
|
+
query GetPromptSummary($aiBlameAttributionId: String!) {
|
|
2220
|
+
getPromptSummary(aiBlameAttributionId: $aiBlameAttributionId) {
|
|
2221
|
+
__typename
|
|
2222
|
+
... on PromptSummarySuccess {
|
|
2223
|
+
status
|
|
2224
|
+
summary {
|
|
2225
|
+
goal
|
|
2226
|
+
developersPlan
|
|
2227
|
+
aiImplementationDetails
|
|
2228
|
+
importantInstructionsAndPushbacks
|
|
2229
|
+
frictionScore {
|
|
2230
|
+
score
|
|
2231
|
+
justification
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
}
|
|
2235
|
+
... on PromptSummaryError {
|
|
2236
|
+
status
|
|
2237
|
+
error
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
`;
|
|
2123
2242
|
var UploadAiBlameInferencesInitDocument = `
|
|
2124
2243
|
mutation UploadAIBlameInferencesInit($sessions: [AIBlameInferenceInitInput!]!) {
|
|
2125
2244
|
uploadAIBlameInferencesInit(sessions: $sessions) {
|
|
@@ -2447,6 +2566,9 @@ function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
2447
2566
|
GetAIBlameAttributionPrompt(variables, requestHeaders, signal) {
|
|
2448
2567
|
return withWrapper((wrappedRequestHeaders) => client.request({ document: GetAiBlameAttributionPromptDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetAIBlameAttributionPrompt", "query", variables);
|
|
2449
2568
|
},
|
|
2569
|
+
GetPromptSummary(variables, requestHeaders, signal) {
|
|
2570
|
+
return withWrapper((wrappedRequestHeaders) => client.request({ document: GetPromptSummaryDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "GetPromptSummary", "query", variables);
|
|
2571
|
+
},
|
|
2450
2572
|
UploadAIBlameInferencesInit(variables, requestHeaders, signal) {
|
|
2451
2573
|
return withWrapper((wrappedRequestHeaders) => client.request({ document: UploadAiBlameInferencesInitDocument, variables, requestHeaders: { ...requestHeaders, ...wrappedRequestHeaders }, signal }), "UploadAIBlameInferencesInit", "mutation", variables);
|
|
2452
2574
|
},
|
|
@@ -11403,6 +11525,9 @@ var GQLClient = class {
|
|
|
11403
11525
|
async getAIBlameAttributionPrompt(variables) {
|
|
11404
11526
|
return await this._clientSdk.GetAIBlameAttributionPrompt(variables);
|
|
11405
11527
|
}
|
|
11528
|
+
async getAIBlameAttributionPromptSummary(variables) {
|
|
11529
|
+
return await this._clientSdk.GetPromptSummary(variables);
|
|
11530
|
+
}
|
|
11406
11531
|
};
|
|
11407
11532
|
|
|
11408
11533
|
// src/mcp/services/types.ts
|