mobbdev 1.1.37 → 1.1.39

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,26 +54,18 @@ declare const PromptItemZ: z.ZodObject<{
54
54
  name: string;
55
55
  parameters: string;
56
56
  result: string;
57
- accepted?: boolean | undefined;
58
57
  rawArguments?: string | undefined;
58
+ accepted?: boolean | undefined;
59
59
  }, {
60
60
  name: string;
61
61
  parameters: string;
62
62
  result: string;
63
- accepted?: boolean | undefined;
64
63
  rawArguments?: string | undefined;
64
+ accepted?: boolean | 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;
75
68
  date?: Date | undefined;
76
- text?: string | undefined;
77
69
  attachedFiles?: {
78
70
  relativePath: string;
79
71
  startLine?: number | undefined;
@@ -82,17 +74,17 @@ declare const PromptItemZ: z.ZodObject<{
82
74
  inputCount: number;
83
75
  outputCount: number;
84
76
  } | undefined;
85
- }, {
86
- type: "USER_PROMPT" | "AI_RESPONSE" | "TOOL_EXECUTION" | "AI_THINKING";
77
+ text?: string | undefined;
87
78
  tool?: {
88
79
  name: string;
89
80
  parameters: string;
90
81
  result: string;
91
- accepted?: boolean | undefined;
92
82
  rawArguments?: string | undefined;
83
+ accepted?: boolean | undefined;
93
84
  } | undefined;
85
+ }, {
86
+ type: "USER_PROMPT" | "AI_RESPONSE" | "TOOL_EXECUTION" | "AI_THINKING";
94
87
  date?: Date | undefined;
95
- text?: string | undefined;
96
88
  attachedFiles?: {
97
89
  relativePath: string;
98
90
  startLine?: number | undefined;
@@ -101,6 +93,14 @@ declare const PromptItemZ: z.ZodObject<{
101
93
  inputCount: number;
102
94
  outputCount: number;
103
95
  } | 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,26 +137,18 @@ declare const PromptItemArrayZ: z.ZodArray<z.ZodObject<{
137
137
  name: string;
138
138
  parameters: string;
139
139
  result: string;
140
- accepted?: boolean | undefined;
141
140
  rawArguments?: string | undefined;
141
+ accepted?: boolean | undefined;
142
142
  }, {
143
143
  name: string;
144
144
  parameters: string;
145
145
  result: string;
146
- accepted?: boolean | undefined;
147
146
  rawArguments?: string | undefined;
147
+ accepted?: boolean | 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;
158
151
  date?: Date | undefined;
159
- text?: string | undefined;
160
152
  attachedFiles?: {
161
153
  relativePath: string;
162
154
  startLine?: number | undefined;
@@ -165,17 +157,17 @@ declare const PromptItemArrayZ: z.ZodArray<z.ZodObject<{
165
157
  inputCount: number;
166
158
  outputCount: number;
167
159
  } | undefined;
168
- }, {
169
- type: "USER_PROMPT" | "AI_RESPONSE" | "TOOL_EXECUTION" | "AI_THINKING";
160
+ text?: string | undefined;
170
161
  tool?: {
171
162
  name: string;
172
163
  parameters: string;
173
164
  result: string;
174
- accepted?: boolean | undefined;
175
165
  rawArguments?: string | undefined;
166
+ accepted?: boolean | undefined;
176
167
  } | undefined;
168
+ }, {
169
+ type: "USER_PROMPT" | "AI_RESPONSE" | "TOOL_EXECUTION" | "AI_THINKING";
177
170
  date?: Date | undefined;
178
- text?: string | undefined;
179
171
  attachedFiles?: {
180
172
  relativePath: string;
181
173
  startLine?: number | undefined;
@@ -184,6 +176,14 @@ declare const PromptItemArrayZ: z.ZodArray<z.ZodObject<{
184
176
  inputCount: number;
185
177
  outputCount: number;
186
178
  } | 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 = {
package/dist/index.mjs CHANGED
@@ -8966,7 +8966,11 @@ var GithubSCMLib = class extends SCMLib {
8966
8966
  )
8967
8967
  )
8968
8968
  );
8969
- const diffLines = filesRes ? await this._attributeLinesViaBlame(pr.head.ref, filesRes.data, commits) : [];
8969
+ const diffLines = filesRes ? await this._attributeLinesViaBlame({
8970
+ headSha: pr.head.sha,
8971
+ changedFiles: filesRes.data,
8972
+ prCommits: commits
8973
+ }) : [];
8970
8974
  return {
8971
8975
  diff: prDiff,
8972
8976
  createdAt: new Date(pr.created_at),
@@ -9181,19 +9185,25 @@ var GithubSCMLib = class extends SCMLib {
9181
9185
  * Optimized helper to attribute PR lines to commits using blame API
9182
9186
  * Batch blame queries for minimal API call time (1 call instead of M calls)
9183
9187
  */
9184
- async _attributeLinesViaBlame(headRef, changedFiles, prCommits) {
9188
+ async _attributeLinesViaBlame(params) {
9189
+ const { headSha, changedFiles, prCommits } = params;
9185
9190
  const prCommitShas = new Set(prCommits.map((c) => c.commitSha));
9186
- const filesWithAdditions = changedFiles.filter(
9187
- (file) => file.patch?.includes("\n+")
9188
- );
9191
+ const filesWithAdditions = changedFiles.filter((file) => {
9192
+ if (!file.patch || file.patch.trim().length === 0) {
9193
+ return false;
9194
+ }
9195
+ return true;
9196
+ });
9189
9197
  if (filesWithAdditions.length === 0) {
9190
9198
  return [];
9191
9199
  }
9192
9200
  const { owner, repo } = parseGithubOwnerAndRepo(this.url);
9201
+ const refToUse = headSha;
9193
9202
  const blameMap = await this.githubSdk.getBlameBatch({
9194
9203
  owner,
9195
9204
  repo,
9196
- ref: headRef,
9205
+ ref: refToUse,
9206
+ // Use commit SHA directly from PR.head.sha
9197
9207
  filePaths: filesWithAdditions.map((f) => f.filename)
9198
9208
  });
9199
9209
  const allAttributions = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobbdev",
3
- "version": "1.1.37",
3
+ "version": "1.1.39",
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",
@@ -53,7 +53,7 @@
53
53
  "dependencies": {
54
54
  "@gitbeaker/requester-utils": "43.8.0",
55
55
  "@gitbeaker/rest": "43.8.0",
56
- "@modelcontextprotocol/sdk": "1.25.1",
56
+ "@modelcontextprotocol/sdk": "1.25.2",
57
57
  "@octokit/core": "5.2.0",
58
58
  "@octokit/request-error": "5.1.1",
59
59
  "@openredaction/openredaction": "1.0.4",
@@ -95,7 +95,7 @@
95
95
  "tar": "6.2.1",
96
96
  "tmp": "0.2.5",
97
97
  "tmp-promise": "3.0.3",
98
- "undici": "6.21.3",
98
+ "undici": "6.23.0",
99
99
  "uuid": "11.1.0",
100
100
  "ws": "8.18.3",
101
101
  "xml2js": "0.6.2",