@atlassian-dc-mcp/bitbucket 0.32.0 → 0.34.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACvH,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE/C,uBAAuB,EAAE,CAAC;AAE1B,MAAM,WAAW,GAAG,gBAAgB,CAAC,cAAc,EAAE,CAAC;AACtD,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;IAC3B,OAAO,CAAC,KAAK,CAAC,2CAA2C,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACnF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,eAAe,GAAG,yBAAyB,EAAE,CAAC;AACpD,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,CAC3C,eAAe,CAAC,IAAI,EACpB,GAAG,EAAE,CAAC,yBAAyB,EAAE,CAAC,KAAK,EACvC,eAAe,CAAC,WAAW,EAC3B,kBAAkB,CACnB,CAAC;AAEF,MAAM,MAAM,GAAG,eAAe,CAAC;IAC7B,IAAI,EAAE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,EAAE,EAAE,EAAE;IACzC,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IAC/E,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,CACF,CAAC;AAEF,MAAM,aAAa,CAAC,MAAM,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlassian-dc-mcp/bitbucket",
3
- "version": "0.32.0",
3
+ "version": "0.34.0",
4
4
  "main": "build/index.js",
5
5
  "type": "module",
6
6
  "bin": "./bin/run.js",
@@ -31,7 +31,7 @@
31
31
  "test": "jest"
32
32
  },
33
33
  "dependencies": {
34
- "@atlassian-dc-mcp/common": "^0.32.0",
34
+ "@atlassian-dc-mcp/common": "^0.34.0",
35
35
  "@modelcontextprotocol/sdk": "^1.27.1",
36
36
  "dotenv": "^16.4.7",
37
37
  "zod": "^3.24.2"
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "4df3f306bc04b466d7ff5226d1244c0221d3ed27"
51
+ "gitHead": "ab2b534bafefa4666feca463e79824dadb797ff3"
52
52
  }
@@ -26,7 +26,8 @@ jest.mock('../bitbucket-client/index.js', () => ({
26
26
  get3: jest.fn()
27
27
  },
28
28
  RepositoryService: {
29
- streamRaw: jest.fn()
29
+ streamRaw: jest.fn(),
30
+ createBranch: jest.fn()
30
31
  },
31
32
  OpenAPI: {
32
33
  BASE: '',
@@ -1212,6 +1213,168 @@ describe('BitbucketService', () => {
1212
1213
  });
1213
1214
  });
1214
1215
 
1216
+ describe('getBranchDiff', () => {
1217
+ const { request: mockRequest } = require('../bitbucket-client/core/request.js');
1218
+ // Trimmed capture of a real Bitbucket DC 9.x compare/diff response.
1219
+ const mockCompareDiff = {
1220
+ fromHash: '4ab70c4ea742bd2102e929a3b58811a69a46ff23',
1221
+ toHash: 'feature/my-branch',
1222
+ diffs: [
1223
+ {
1224
+ source: { toString: 'Dockerfile' },
1225
+ destination: { toString: 'Dockerfile' },
1226
+ hunks: [
1227
+ {
1228
+ sourceLine: 1,
1229
+ sourceSpan: 2,
1230
+ destinationLine: 1,
1231
+ destinationSpan: 3,
1232
+ segments: [
1233
+ { type: 'CONTEXT', lines: [{ line: 'FROM node:20-alpine' }] },
1234
+ { type: 'ADDED', lines: [{ line: 'COPY shbdn ./shbdn' }] },
1235
+ { type: 'REMOVED', lines: [{ line: 'RUN npm ci' }] }
1236
+ ]
1237
+ }
1238
+ ]
1239
+ }
1240
+ ],
1241
+ truncated: false
1242
+ };
1243
+
1244
+ it('should diff the whole comparison against the default branch when only a source branch is given', async () => {
1245
+ mockRequest.mockResolvedValue(mockCompareDiff);
1246
+
1247
+ const result = await bitbucketService.getBranchDiff(
1248
+ mockProjectKey,
1249
+ mockRepositorySlug,
1250
+ 'feature/my-branch'
1251
+ );
1252
+
1253
+ expect(result.success).toBe(true);
1254
+ expect(result.data).toBe(
1255
+ 'diff --git a/Dockerfile b/Dockerfile\n' +
1256
+ '--- a/Dockerfile\n' +
1257
+ '+++ b/Dockerfile\n' +
1258
+ '@@ -1,2 +1,3 @@\n' +
1259
+ ' FROM node:20-alpine\n' +
1260
+ '+COPY shbdn ./shbdn\n' +
1261
+ '-RUN npm ci'
1262
+ );
1263
+ expect(mockRequest).toHaveBeenCalledWith(
1264
+ expect.any(Object),
1265
+ {
1266
+ method: 'GET',
1267
+ url: '/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/diff{path}',
1268
+ path: {
1269
+ 'path': '',
1270
+ 'projectKey': mockProjectKey,
1271
+ 'repositorySlug': mockRepositorySlug,
1272
+ },
1273
+ query: {
1274
+ 'from': 'feature/my-branch',
1275
+ 'to': undefined,
1276
+ 'contextLines': undefined,
1277
+ 'srcPath': undefined,
1278
+ 'whitespace': undefined,
1279
+ },
1280
+ errors: {
1281
+ 401: `The currently authenticated user has insufficient permissions to view the repository.`,
1282
+ 404: `The repository, or one of the compared refs, does not exist.`,
1283
+ },
1284
+ }
1285
+ );
1286
+ });
1287
+
1288
+ it('should not request text/plain, which the compare resource rejects with 406', async () => {
1289
+ mockRequest.mockResolvedValue(mockCompareDiff);
1290
+
1291
+ await bitbucketService.getBranchDiff(mockProjectKey, mockRepositorySlug, 'feature/my-branch');
1292
+
1293
+ expect(mockRequest).toHaveBeenCalledWith(
1294
+ expect.any(Object),
1295
+ expect.not.objectContaining({ headers: expect.anything() })
1296
+ );
1297
+ });
1298
+
1299
+ it('should pass all optional parameters through and normalize the file path', async () => {
1300
+ mockRequest.mockResolvedValue(mockCompareDiff);
1301
+
1302
+ const result = await bitbucketService.getBranchDiff(
1303
+ mockProjectKey,
1304
+ mockRepositorySlug,
1305
+ 'feature/my-branch',
1306
+ 'main',
1307
+ '/src/file.txt',
1308
+ '5',
1309
+ 'old/file.txt',
1310
+ 'ignore-all'
1311
+ );
1312
+
1313
+ expect(result.success).toBe(true);
1314
+ expect(mockRequest).toHaveBeenCalledWith(
1315
+ expect.any(Object),
1316
+ expect.objectContaining({
1317
+ path: expect.objectContaining({ 'path': '/src/file.txt' }),
1318
+ query: {
1319
+ 'from': 'feature/my-branch',
1320
+ 'to': 'main',
1321
+ 'contextLines': '5',
1322
+ 'srcPath': 'old/file.txt',
1323
+ 'whitespace': 'ignore-all',
1324
+ },
1325
+ })
1326
+ );
1327
+ });
1328
+
1329
+ it('should return the raw payload when output is full', async () => {
1330
+ mockRequest.mockResolvedValue(mockCompareDiff);
1331
+
1332
+ const result = await bitbucketService.getBranchDiff(
1333
+ mockProjectKey,
1334
+ mockRepositorySlug,
1335
+ 'feature/my-branch',
1336
+ undefined,
1337
+ undefined,
1338
+ undefined,
1339
+ undefined,
1340
+ undefined,
1341
+ 'full'
1342
+ );
1343
+
1344
+ expect(result.success).toBe(true);
1345
+ expect(result.data).toEqual(mockCompareDiff);
1346
+ });
1347
+
1348
+ it('should normalize project key and repository slug casing', async () => {
1349
+ mockRequest.mockResolvedValue(mockCompareDiff);
1350
+
1351
+ await bitbucketService.getBranchDiff('test', 'TEST-REPO', 'feature/my-branch');
1352
+
1353
+ expect(mockRequest).toHaveBeenCalledWith(
1354
+ expect.any(Object),
1355
+ expect.objectContaining({
1356
+ path: expect.objectContaining({
1357
+ 'projectKey': 'TEST',
1358
+ 'repositorySlug': 'test-repo',
1359
+ }),
1360
+ })
1361
+ );
1362
+ });
1363
+
1364
+ it('should handle API errors gracefully', async () => {
1365
+ mockRequest.mockRejectedValue(new Error('API Error'));
1366
+
1367
+ const result = await bitbucketService.getBranchDiff(
1368
+ mockProjectKey,
1369
+ mockRepositorySlug,
1370
+ 'feature/my-branch'
1371
+ );
1372
+
1373
+ expect(result.success).toBe(false);
1374
+ expect(result.error).toBe('API Error');
1375
+ });
1376
+ });
1377
+
1215
1378
  describe('getFileContent', () => {
1216
1379
  const mockFileContent = 'FROM node:20-alpine\n\nWORKDIR /app\n';
1217
1380
 
@@ -1284,6 +1447,78 @@ describe('BitbucketService', () => {
1284
1447
  });
1285
1448
  });
1286
1449
 
1450
+ describe('createBranch', () => {
1451
+ const mockBranch = {
1452
+ id: 'refs/heads/feature/my-branch',
1453
+ displayId: 'feature/my-branch',
1454
+ type: 'BRANCH',
1455
+ latestCommit: '10a5844f89abf8fd8aebf61168eb60d177d20b4f',
1456
+ isDefault: false
1457
+ };
1458
+
1459
+ it('should create a branch from the given start point', async () => {
1460
+ (RepositoryService.createBranch as jest.Mock).mockResolvedValue(mockBranch);
1461
+
1462
+ const result = await bitbucketService.createBranch(
1463
+ mockProjectKey,
1464
+ mockRepositorySlug,
1465
+ 'feature/my-branch',
1466
+ 'master'
1467
+ );
1468
+
1469
+ expect(result.success).toBe(true);
1470
+ expect(result.data).toEqual(mockBranch);
1471
+ expect(RepositoryService.createBranch).toHaveBeenCalledWith(
1472
+ mockProjectKey,
1473
+ mockRepositorySlug,
1474
+ { name: 'feature/my-branch', startPoint: 'master' }
1475
+ );
1476
+ });
1477
+
1478
+ it('should accept a commit id as the start point', async () => {
1479
+ (RepositoryService.createBranch as jest.Mock).mockResolvedValue(mockBranch);
1480
+
1481
+ await bitbucketService.createBranch(
1482
+ mockProjectKey,
1483
+ mockRepositorySlug,
1484
+ 'hotfix/x',
1485
+ '10a5844f89abf8fd8aebf61168eb60d177d20b4f'
1486
+ );
1487
+
1488
+ expect(RepositoryService.createBranch).toHaveBeenCalledWith(
1489
+ mockProjectKey,
1490
+ mockRepositorySlug,
1491
+ { name: 'hotfix/x', startPoint: '10a5844f89abf8fd8aebf61168eb60d177d20b4f' }
1492
+ );
1493
+ });
1494
+
1495
+ it('should normalize project key and repository slug casing', async () => {
1496
+ (RepositoryService.createBranch as jest.Mock).mockResolvedValue(mockBranch);
1497
+
1498
+ await bitbucketService.createBranch('test', 'TEST-REPO', 'feature/my-branch', 'master');
1499
+
1500
+ expect(RepositoryService.createBranch).toHaveBeenCalledWith(
1501
+ 'TEST',
1502
+ 'test-repo',
1503
+ { name: 'feature/my-branch', startPoint: 'master' }
1504
+ );
1505
+ });
1506
+
1507
+ it('should handle API errors gracefully', async () => {
1508
+ (RepositoryService.createBranch as jest.Mock).mockRejectedValue(new Error('API Error'));
1509
+
1510
+ const result = await bitbucketService.createBranch(
1511
+ mockProjectKey,
1512
+ mockRepositorySlug,
1513
+ 'feature/my-branch',
1514
+ 'master'
1515
+ );
1516
+
1517
+ expect(result.success).toBe(false);
1518
+ expect(result.error).toBe('API Error');
1519
+ });
1520
+ });
1521
+
1287
1522
  describe('createPullRequest', () => {
1288
1523
  it('should successfully create a PR with minimal parameters', async () => {
1289
1524
  const mockPullRequest = {
@@ -0,0 +1,116 @@
1
+ import { formatCompareDiffAsUnified } from '../compare-diff-mapper.js';
2
+
3
+ describe('formatCompareDiffAsUnified', () => {
4
+ it('should report an empty comparison', () => {
5
+ expect(formatCompareDiffAsUnified({ diffs: [] })).toBe('No differences found.');
6
+ expect(formatCompareDiffAsUnified({})).toBe('No differences found.');
7
+ });
8
+
9
+ it('should render added and removed files against /dev/null', () => {
10
+ const result = formatCompareDiffAsUnified({
11
+ diffs: [
12
+ {
13
+ source: null,
14
+ destination: { toString: 'new-file.js' },
15
+ hunks: [
16
+ {
17
+ sourceLine: 0,
18
+ sourceSpan: 0,
19
+ destinationLine: 1,
20
+ destinationSpan: 1,
21
+ segments: [{ type: 'ADDED', lines: [{ line: 'export const a = 1;' }] }]
22
+ }
23
+ ]
24
+ },
25
+ {
26
+ source: { toString: 'old-file.js' },
27
+ destination: null,
28
+ hunks: [
29
+ {
30
+ sourceLine: 1,
31
+ sourceSpan: 1,
32
+ destinationLine: 0,
33
+ destinationSpan: 0,
34
+ segments: [{ type: 'REMOVED', lines: [{ line: 'export const b = 2;' }] }]
35
+ }
36
+ ]
37
+ }
38
+ ]
39
+ });
40
+
41
+ expect(result).toBe(
42
+ 'diff --git a/new-file.js b/new-file.js\n' +
43
+ '--- /dev/null\n' +
44
+ '+++ b/new-file.js\n' +
45
+ '@@ -0,0 +1,1 @@\n' +
46
+ '+export const a = 1;\n' +
47
+ 'diff --git a/old-file.js b/old-file.js\n' +
48
+ '--- a/old-file.js\n' +
49
+ '+++ /dev/null\n' +
50
+ '@@ -1,1 +0,0 @@\n' +
51
+ '-export const b = 2;'
52
+ );
53
+ });
54
+
55
+ it('should note files without a textual diff', () => {
56
+ const result = formatCompareDiffAsUnified({
57
+ diffs: [{ source: { toString: 'logo.png' }, destination: { toString: 'logo.png' } }]
58
+ });
59
+
60
+ expect(result).toContain('[no textual diff available]');
61
+ });
62
+
63
+ it('should surface server-side truncation at hunk, file and diff level', () => {
64
+ const result = formatCompareDiffAsUnified({
65
+ truncated: true,
66
+ diffs: [
67
+ {
68
+ source: { toString: 'big.txt' },
69
+ destination: { toString: 'big.txt' },
70
+ truncated: true,
71
+ hunks: [{ sourceLine: 1, sourceSpan: 1, destinationLine: 1, destinationSpan: 1, segments: [], truncated: true }]
72
+ }
73
+ ]
74
+ });
75
+
76
+ expect(result).toContain('[hunk truncated by the Bitbucket server]');
77
+ expect(result).toContain('[file diff truncated by the Bitbucket server]');
78
+ expect(result).toContain('[diff truncated by the Bitbucket server; narrow the comparison with `path`]');
79
+ });
80
+
81
+ it('should prefix segments by type and default unknown types to context', () => {
82
+ const result = formatCompareDiffAsUnified({
83
+ diffs: [
84
+ {
85
+ source: { toString: 'f.txt' },
86
+ destination: { toString: 'f.txt' },
87
+ hunks: [
88
+ {
89
+ sourceLine: 10,
90
+ sourceSpan: 3,
91
+ destinationLine: 10,
92
+ destinationSpan: 4,
93
+ segments: [
94
+ { type: 'CONTEXT', lines: [{ line: 'keep' }] },
95
+ { type: 'REMOVED', lines: [{ line: 'gone' }] },
96
+ { type: 'ADDED', lines: [{ line: 'fresh' }] },
97
+ { type: 'SOMETHING_NEW', lines: [{ line: 'unknown' }] }
98
+ ]
99
+ }
100
+ ]
101
+ }
102
+ ]
103
+ });
104
+
105
+ expect(result).toBe(
106
+ 'diff --git a/f.txt b/f.txt\n' +
107
+ '--- a/f.txt\n' +
108
+ '+++ b/f.txt\n' +
109
+ '@@ -10,3 +10,4 @@\n' +
110
+ ' keep\n' +
111
+ '-gone\n' +
112
+ '+fresh\n' +
113
+ ' unknown'
114
+ );
115
+ });
116
+ });
@@ -3,6 +3,7 @@ import { OpenAPI, ProjectService, PullRequestsService, RepositoryService } from
3
3
  import { request as __request } from './bitbucket-client/core/request.js';
4
4
  import { handleApiOperation, resolveOpenApiBase } from '@atlassian-dc-mcp/common';
5
5
  import { simplifyInboxPullRequests } from './inbox-pr-mapper.js';
6
+ import { CompareDiffResponse, formatCompareDiffAsUnified } from './compare-diff-mapper.js';
6
7
  import { BITBUCKET_PRODUCT, getDefaultPageSize, getMissingConfig } from './config.js';
7
8
  import { fetchMergeability, mergePullRequest, type MergePullRequestParams } from './pr-merge.js';
8
9
  import {
@@ -26,6 +27,8 @@ function resolveToken(token: string | (() => string | undefined), missingTokenMe
26
27
 
27
28
  type DiffLineType = 'ADDED' | 'REMOVED' | 'CONTEXT';
28
29
 
30
+ type BranchDiffOutputMode = 'unified' | 'full';
31
+
29
32
  /**
30
33
  * Build a Bitbucket DC inline comment anchor.
31
34
  *
@@ -234,6 +237,23 @@ export class BitbucketService {
234
237
  );
235
238
  }
236
239
 
240
+ /**
241
+ * Create a branch in a repository
242
+ * @param projectKey The project key
243
+ * @param repositorySlug The repository slug
244
+ * @param name The name of the branch to create
245
+ * @param startPoint The branch, tag or commit the new branch is forked from
246
+ * @returns Promise with the created branch
247
+ */
248
+ async createBranch(projectKey: string, repositorySlug: string, name: string, startPoint: string) {
249
+ projectKey = projectKey.toUpperCase();
250
+ repositorySlug = repositorySlug.toLowerCase();
251
+ return handleApiOperation(
252
+ () => RepositoryService.createBranch(projectKey, repositorySlug, { name, startPoint }),
253
+ 'Error creating branch'
254
+ );
255
+ }
256
+
237
257
  /**
238
258
  * Get pull requests for a repository
239
259
  * @param projectKey The project key
@@ -704,6 +724,66 @@ export class BitbucketService {
704
724
  );
705
725
  }
706
726
 
727
+ /**
728
+ * Get text diff between two branches, with or without an existing pull request.
729
+ *
730
+ * Mirrors the Bitbucket "compare" view: the diff contains changes reachable from
731
+ * `sourceBranch` but not from `targetBranch`.
732
+ * @param projectKey The project key
733
+ * @param repositorySlug The repository slug
734
+ * @param sourceBranch The source branch, tag or commit
735
+ * @param targetBranch Optional target branch, tag or commit. Defaults to the repository default branch
736
+ * @param path Optional file path to limit the diff to a single file
737
+ * @param contextLines Optional number of context lines to include around added/removed lines
738
+ * @param srcPath Optional previous path to the file, if the file has been copied, moved or renamed
739
+ * @param whitespace Optional whitespace flag which can be set to 'ignore-all'
740
+ * @param output Render a unified diff or return the raw RestDiff payload. Defaults to 'unified'
741
+ * @returns Promise with the diff between the two refs
742
+ */
743
+ async getBranchDiff(
744
+ projectKey: string,
745
+ repositorySlug: string,
746
+ sourceBranch: string,
747
+ targetBranch?: string,
748
+ path?: string,
749
+ contextLines?: string,
750
+ srcPath?: string,
751
+ whitespace?: string,
752
+ output: BranchDiffOutputMode = 'unified'
753
+ ) {
754
+ projectKey = projectKey.toUpperCase();
755
+ repositorySlug = repositorySlug.toLowerCase();
756
+ // The endpoint is `/compare/diff{path}`: an empty path diffs the whole comparison,
757
+ // a file path must keep its leading slash to stay a separate URL segment.
758
+ const trimmedPath = path?.replace(/^\/+/, '') ?? '';
759
+ return handleApiOperation(
760
+ async () => {
761
+ const diff = await __request<CompareDiffResponse>(OpenAPI, {
762
+ method: 'GET',
763
+ url: '/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/diff{path}',
764
+ path: {
765
+ 'path': trimmedPath ? `/${trimmedPath}` : '',
766
+ 'projectKey': projectKey,
767
+ 'repositorySlug': repositorySlug,
768
+ },
769
+ query: {
770
+ 'from': sourceBranch,
771
+ 'to': targetBranch,
772
+ 'contextLines': contextLines,
773
+ 'srcPath': srcPath,
774
+ 'whitespace': whitespace,
775
+ },
776
+ errors: {
777
+ 401: `The currently authenticated user has insufficient permissions to view the repository.`,
778
+ 404: `The repository, or one of the compared refs, does not exist.`,
779
+ },
780
+ });
781
+ return output === 'full' ? diff : formatCompareDiffAsUnified(diff);
782
+ },
783
+ 'Error fetching branch diff'
784
+ );
785
+ }
786
+
707
787
  /**
708
788
  * Create a pull request
709
789
  * @param projectKey The project key (also used as the destination repository's project)
@@ -1053,6 +1133,12 @@ export const bitbucketToolSchemas = {
1053
1133
  path: z.string().describe("Path to the file in the repository (e.g. 'src/index.ts')"),
1054
1134
  at: z.string().optional().describe("A branch, tag or commit to read the file at (e.g. 'refs/heads/main', 'feature/x', or a commit id). Defaults to the repository's default branch")
1055
1135
  },
1136
+ createBranch: {
1137
+ projectKey: z.string().describe("The project key"),
1138
+ repositorySlug: z.string().describe("The repository slug"),
1139
+ name: z.string().describe("The name of the branch to create, without the 'refs/heads/' prefix (e.g. 'feature/my-branch')"),
1140
+ startPoint: z.string().describe("The branch, tag or commit the new branch is forked from (e.g. 'master', 'refs/heads/master', or a commit id)")
1141
+ },
1056
1142
  getCommits: {
1057
1143
  projectKey: z.string().describe("The project key"),
1058
1144
  repositorySlug: z.string().describe("The repository slug"),
@@ -1133,6 +1219,17 @@ export const bitbucketToolSchemas = {
1133
1219
  untilId: z.string().optional().describe("The until commit hash to stream a diff between two arbitrary hashes"),
1134
1220
  whitespace: z.string().optional().describe("Optional whitespace flag which can be set to 'ignore-all'")
1135
1221
  },
1222
+ getBranchDiff: {
1223
+ projectKey: z.string().describe("The project key"),
1224
+ repositorySlug: z.string().describe("The repository slug"),
1225
+ sourceBranch: z.string().describe("The source branch, tag or commit to diff (e.g. 'feature/my-branch'). Changes reachable from here but not from targetBranch are returned"),
1226
+ targetBranch: z.string().optional().describe("The target branch, tag or commit to compare against. Defaults to the repository's default branch"),
1227
+ path: z.string().optional().describe("Limit the diff to a single file path. Omit to get the diff for every changed file"),
1228
+ contextLines: z.string().optional().describe("Number of context lines to include around added/removed lines in the diff"),
1229
+ srcPath: z.string().optional().describe("The previous path to the file, if the file has been copied, moved or renamed"),
1230
+ whitespace: z.string().optional().describe("Optional whitespace flag which can be set to 'ignore-all'"),
1231
+ output: z.enum(['unified', 'full']).optional().describe("Render the comparison as a unified diff or return the raw RestDiff payload. Defaults to unified.")
1232
+ },
1136
1233
  createPullRequest: {
1137
1234
  projectKey: z.string().describe("The destination repository's project key"),
1138
1235
  repositorySlug: z.string().describe("The destination repository's slug"),
@@ -0,0 +1,99 @@
1
+ // Shape of the `RestDiff` payload returned by the Bitbucket compare/diff resource.
2
+ interface DiffLine {
3
+ line: string;
4
+ truncated?: boolean;
5
+ }
6
+
7
+ interface DiffSegment {
8
+ type: string;
9
+ lines?: DiffLine[];
10
+ }
11
+
12
+ interface DiffHunk {
13
+ sourceLine?: number;
14
+ sourceSpan?: number;
15
+ destinationLine?: number;
16
+ destinationSpan?: number;
17
+ segments?: DiffSegment[];
18
+ truncated?: boolean;
19
+ }
20
+
21
+ interface FileDiff {
22
+ source?: { toString: string } | null;
23
+ destination?: { toString: string } | null;
24
+ hunks?: DiffHunk[];
25
+ truncated?: boolean;
26
+ }
27
+
28
+ export interface CompareDiffResponse {
29
+ fromHash?: string;
30
+ toHash?: string;
31
+ diffs?: FileDiff[];
32
+ truncated?: boolean;
33
+ }
34
+
35
+ const SEGMENT_PREFIXES: Record<string, string> = {
36
+ ADDED: '+',
37
+ REMOVED: '-',
38
+ CONTEXT: ' ',
39
+ };
40
+
41
+ function renderHunk(hunk: DiffHunk, out: string[]): void {
42
+ out.push(`@@ -${hunk.sourceLine ?? 0},${hunk.sourceSpan ?? 0} +${hunk.destinationLine ?? 0},${hunk.destinationSpan ?? 0} @@`);
43
+ for (const segment of hunk.segments ?? []) {
44
+ const prefix = SEGMENT_PREFIXES[segment.type] ?? ' ';
45
+ for (const line of segment.lines ?? []) {
46
+ out.push(`${prefix}${line.line}`);
47
+ }
48
+ }
49
+ if (hunk.truncated) {
50
+ out.push('[hunk truncated by the Bitbucket server]');
51
+ }
52
+ }
53
+
54
+ function renderFile(file: FileDiff, out: string[]): void {
55
+ // A missing source means the file was added, a missing destination that it was deleted.
56
+ const source = file.source?.toString;
57
+ const destination = file.destination?.toString;
58
+ const oldPath = source ? `a/${source}` : '/dev/null';
59
+ const newPath = destination ? `b/${destination}` : '/dev/null';
60
+
61
+ out.push(`diff --git ${source ? `a/${source}` : `a/${destination}`} ${destination ? `b/${destination}` : `b/${source}`}`);
62
+ out.push(`--- ${oldPath}`);
63
+ out.push(`+++ ${newPath}`);
64
+
65
+ const hunks = file.hunks ?? [];
66
+ if (hunks.length === 0) {
67
+ // Bitbucket omits hunks for binary files and for pure mode/rename changes.
68
+ out.push('[no textual diff available]');
69
+ }
70
+ for (const hunk of hunks) {
71
+ renderHunk(hunk, out);
72
+ }
73
+ if (file.truncated) {
74
+ out.push('[file diff truncated by the Bitbucket server]');
75
+ }
76
+ }
77
+
78
+ /**
79
+ * Render a Bitbucket `RestDiff` payload as a unified diff.
80
+ *
81
+ * The compare resource only speaks JSON (it answers 406 to `Accept: text/plain`, unlike the
82
+ * pull request diff resource), so the structured payload is folded into the far more compact
83
+ * unified format that models already understand.
84
+ */
85
+ export function formatCompareDiffAsUnified(diff: CompareDiffResponse): string {
86
+ const files = diff.diffs ?? [];
87
+ if (files.length === 0) {
88
+ return 'No differences found.';
89
+ }
90
+
91
+ const out: string[] = [];
92
+ for (const file of files) {
93
+ renderFile(file, out);
94
+ }
95
+ if (diff.truncated) {
96
+ out.push('[diff truncated by the Bitbucket server; narrow the comparison with `path`]');
97
+ }
98
+ return out.join('\n');
99
+ }