@opentabs-dev/opentabs-plugin-bitbucket 0.0.74
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/adapter.iife.js +15383 -0
- package/dist/adapter.iife.js.map +7 -0
- package/dist/bitbucket-api.d.ts +12 -0
- package/dist/bitbucket-api.d.ts.map +1 -0
- package/dist/bitbucket-api.js +106 -0
- package/dist/bitbucket-api.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +88 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/approve-pull-request.d.ts +9 -0
- package/dist/tools/approve-pull-request.d.ts.map +1 -0
- package/dist/tools/approve-pull-request.js +24 -0
- package/dist/tools/approve-pull-request.js.map +1 -0
- package/dist/tools/create-branch.d.ts +14 -0
- package/dist/tools/create-branch.d.ts.map +1 -0
- package/dist/tools/create-branch.js +27 -0
- package/dist/tools/create-branch.js.map +1 -0
- package/dist/tools/create-pr-comment.d.ts +14 -0
- package/dist/tools/create-pr-comment.d.ts.map +1 -0
- package/dist/tools/create-pr-comment.js +24 -0
- package/dist/tools/create-pr-comment.js.map +1 -0
- package/dist/tools/create-pull-request.d.ts +25 -0
- package/dist/tools/create-pull-request.d.ts.map +1 -0
- package/dist/tools/create-pull-request.js +48 -0
- package/dist/tools/create-pull-request.js.map +1 -0
- package/dist/tools/create-repository.d.ts +24 -0
- package/dist/tools/create-repository.d.ts.map +1 -0
- package/dist/tools/create-repository.js +40 -0
- package/dist/tools/create-repository.js.map +1 -0
- package/dist/tools/decline-pull-request.d.ts +20 -0
- package/dist/tools/decline-pull-request.d.ts.map +1 -0
- package/dist/tools/decline-pull-request.js +23 -0
- package/dist/tools/decline-pull-request.js.map +1 -0
- package/dist/tools/delete-branch.d.ts +9 -0
- package/dist/tools/delete-branch.d.ts.map +1 -0
- package/dist/tools/delete-branch.js +26 -0
- package/dist/tools/delete-branch.js.map +1 -0
- package/dist/tools/get-commit.d.ts +13 -0
- package/dist/tools/get-commit.d.ts.map +1 -0
- package/dist/tools/get-commit.js +23 -0
- package/dist/tools/get-commit.js.map +1 -0
- package/dist/tools/get-file-content.d.ts +11 -0
- package/dist/tools/get-file-content.d.ts.map +1 -0
- package/dist/tools/get-file-content.js +30 -0
- package/dist/tools/get-file-content.js.map +1 -0
- package/dist/tools/get-pipeline.d.ts +18 -0
- package/dist/tools/get-pipeline.d.ts.map +1 -0
- package/dist/tools/get-pipeline.js +23 -0
- package/dist/tools/get-pipeline.js.map +1 -0
- package/dist/tools/get-pull-request-diff.d.ts +9 -0
- package/dist/tools/get-pull-request-diff.d.ts.map +1 -0
- package/dist/tools/get-pull-request-diff.js +24 -0
- package/dist/tools/get-pull-request-diff.js.map +1 -0
- package/dist/tools/get-pull-request.d.ts +20 -0
- package/dist/tools/get-pull-request.d.ts.map +1 -0
- package/dist/tools/get-pull-request.js +23 -0
- package/dist/tools/get-pull-request.js.map +1 -0
- package/dist/tools/get-repository.d.ts +19 -0
- package/dist/tools/get-repository.d.ts.map +1 -0
- package/dist/tools/get-repository.js +22 -0
- package/dist/tools/get-repository.js.map +1 -0
- package/dist/tools/get-user-profile.d.ts +9 -0
- package/dist/tools/get-user-profile.d.ts.map +1 -0
- package/dist/tools/get-user-profile.js +19 -0
- package/dist/tools/get-user-profile.js.map +1 -0
- package/dist/tools/list-branches.d.ts +17 -0
- package/dist/tools/list-branches.d.ts.map +1 -0
- package/dist/tools/list-branches.js +32 -0
- package/dist/tools/list-branches.js.map +1 -0
- package/dist/tools/list-commits.d.ts +17 -0
- package/dist/tools/list-commits.d.ts.map +1 -0
- package/dist/tools/list-commits.js +34 -0
- package/dist/tools/list-commits.js.map +1 -0
- package/dist/tools/list-pipeline-steps.d.ts +19 -0
- package/dist/tools/list-pipeline-steps.d.ts.map +1 -0
- package/dist/tools/list-pipeline-steps.js +31 -0
- package/dist/tools/list-pipeline-steps.js.map +1 -0
- package/dist/tools/list-pipelines.d.ts +22 -0
- package/dist/tools/list-pipelines.d.ts.map +1 -0
- package/dist/tools/list-pipelines.js +32 -0
- package/dist/tools/list-pipelines.js.map +1 -0
- package/dist/tools/list-pr-comments.d.ts +17 -0
- package/dist/tools/list-pr-comments.d.ts.map +1 -0
- package/dist/tools/list-pr-comments.js +31 -0
- package/dist/tools/list-pr-comments.js.map +1 -0
- package/dist/tools/list-pull-requests.d.ts +29 -0
- package/dist/tools/list-pull-requests.d.ts.map +1 -0
- package/dist/tools/list-pull-requests.js +37 -0
- package/dist/tools/list-pull-requests.js.map +1 -0
- package/dist/tools/list-repositories.d.ts +23 -0
- package/dist/tools/list-repositories.d.ts.map +1 -0
- package/dist/tools/list-repositories.js +31 -0
- package/dist/tools/list-repositories.js.map +1 -0
- package/dist/tools/list-tags.d.ts +15 -0
- package/dist/tools/list-tags.d.ts.map +1 -0
- package/dist/tools/list-tags.js +32 -0
- package/dist/tools/list-tags.js.map +1 -0
- package/dist/tools/list-workspace-members.d.ts +14 -0
- package/dist/tools/list-workspace-members.d.ts.map +1 -0
- package/dist/tools/list-workspace-members.js +29 -0
- package/dist/tools/list-workspace-members.js.map +1 -0
- package/dist/tools/list-workspaces.d.ts +13 -0
- package/dist/tools/list-workspaces.d.ts.map +1 -0
- package/dist/tools/list-workspaces.js +28 -0
- package/dist/tools/list-workspaces.js.map +1 -0
- package/dist/tools/merge-pull-request.d.ts +27 -0
- package/dist/tools/merge-pull-request.d.ts.map +1 -0
- package/dist/tools/merge-pull-request.js +36 -0
- package/dist/tools/merge-pull-request.js.map +1 -0
- package/dist/tools/schemas.d.ts +343 -0
- package/dist/tools/schemas.d.ts.map +1 -0
- package/dist/tools/schemas.js +193 -0
- package/dist/tools/schemas.js.map +1 -0
- package/dist/tools/search-code.d.ts +16 -0
- package/dist/tools/search-code.d.ts.map +1 -0
- package/dist/tools/search-code.js +55 -0
- package/dist/tools/search-code.js.map +1 -0
- package/dist/tools/update-pull-request.d.ts +25 -0
- package/dist/tools/update-pull-request.d.ts.map +1 -0
- package/dist/tools/update-pull-request.js +41 -0
- package/dist/tools/update-pull-request.js.map +1 -0
- package/dist/tools.json +2383 -0
- package/package.json +55 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-pipelines.js","sourceRoot":"","sources":["../../src/tools/list-pipelines.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAoB,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE7E,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;IACtC,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,mFAAmF;IAChG,OAAO,EAAE,2BAA2B;IACpC,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QACxD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;QACjD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;QACpF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;QACjG,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mDAAmD,CAAC;KAC1F,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,oBAAoB,CAAC;KAClE,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,KAAK,GAAgD;YACzD,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,CAAC;QACF,MAAM,IAAI,GAAG,MAAM,GAAG,CACpB,iBAAiB,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,aAAa,EAClE,EAAE,KAAK,EAAE,CACV,CAAC;QACF,OAAO,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;IAC7D,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listPrComments: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
workspace: z.ZodString;
|
|
4
|
+
repo_slug: z.ZodString;
|
|
5
|
+
pull_request_id: z.ZodNumber;
|
|
6
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
pagelen: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
9
|
+
comments: z.ZodArray<z.ZodObject<{
|
|
10
|
+
id: z.ZodNumber;
|
|
11
|
+
content: z.ZodString;
|
|
12
|
+
author: z.ZodString;
|
|
13
|
+
created_on: z.ZodString;
|
|
14
|
+
updated_on: z.ZodString;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
//# sourceMappingURL=list-pr-comments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-pr-comments.d.ts","sourceRoot":"","sources":["../../src/tools/list-pr-comments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;kBA4BzB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../bitbucket-api.js';
|
|
4
|
+
import { commentSchema, mapComment } from './schemas.js';
|
|
5
|
+
export const listPrComments = defineTool({
|
|
6
|
+
name: 'list_pr_comments',
|
|
7
|
+
displayName: 'List PR Comments',
|
|
8
|
+
description: 'List comments on a pull request. Supports pagination.',
|
|
9
|
+
summary: 'List pull request comments',
|
|
10
|
+
icon: 'message-square',
|
|
11
|
+
group: 'Pull Requests',
|
|
12
|
+
input: z.object({
|
|
13
|
+
workspace: z.string().describe('Workspace slug or UUID'),
|
|
14
|
+
repo_slug: z.string().describe('Repository slug'),
|
|
15
|
+
pull_request_id: z.number().int().describe('Pull request ID'),
|
|
16
|
+
page: z.number().int().optional().describe('Page number for pagination (default 1)'),
|
|
17
|
+
pagelen: z.number().int().optional().describe('Number of results per page (default 25, max 100)'),
|
|
18
|
+
}),
|
|
19
|
+
output: z.object({
|
|
20
|
+
comments: z.array(commentSchema).describe('Array of pull request comments'),
|
|
21
|
+
}),
|
|
22
|
+
handle: async (params) => {
|
|
23
|
+
const query = {
|
|
24
|
+
page: params.page,
|
|
25
|
+
pagelen: params.pagelen,
|
|
26
|
+
};
|
|
27
|
+
const data = await api(`/repositories/${params.workspace}/${params.repo_slug}/pullrequests/${params.pull_request_id}/comments`, { query });
|
|
28
|
+
return { comments: (data.values ?? []).map(mapComment) };
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=list-pr-comments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-pr-comments.js","sourceRoot":"","sources":["../../src/tools/list-pr-comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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AAM,IAAI,GAAG,MAAM,GAAG,CACpB,iBAAiB,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,iBAAiB,MAAM,CAAC,eAAe,WAAW,EACvG,EAAE,KAAK,EAAE,CACV,CAAC;QACF,OAAO,EAAE,QAAQ,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;IAC3D,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listPullRequests: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
workspace: z.ZodString;
|
|
4
|
+
repo_slug: z.ZodString;
|
|
5
|
+
state: z.ZodOptional<z.ZodEnum<{
|
|
6
|
+
OPEN: "OPEN";
|
|
7
|
+
MERGED: "MERGED";
|
|
8
|
+
DECLINED: "DECLINED";
|
|
9
|
+
SUPERSEDED: "SUPERSEDED";
|
|
10
|
+
}>>;
|
|
11
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
pagelen: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
14
|
+
pull_requests: z.ZodArray<z.ZodObject<{
|
|
15
|
+
id: z.ZodNumber;
|
|
16
|
+
title: z.ZodString;
|
|
17
|
+
description: z.ZodString;
|
|
18
|
+
state: z.ZodString;
|
|
19
|
+
source_branch: z.ZodString;
|
|
20
|
+
destination_branch: z.ZodString;
|
|
21
|
+
author: z.ZodString;
|
|
22
|
+
close_source_branch: z.ZodBoolean;
|
|
23
|
+
comment_count: z.ZodNumber;
|
|
24
|
+
web_url: z.ZodString;
|
|
25
|
+
created_on: z.ZodString;
|
|
26
|
+
updated_on: z.ZodString;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
//# sourceMappingURL=list-pull-requests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-pull-requests.d.ts","sourceRoot":"","sources":["../../src/tools/list-pull-requests.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgC3B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../bitbucket-api.js';
|
|
4
|
+
import { pullRequestSchema, mapPullRequest } from './schemas.js';
|
|
5
|
+
export const listPullRequests = defineTool({
|
|
6
|
+
name: 'list_pull_requests',
|
|
7
|
+
displayName: 'List Pull Requests',
|
|
8
|
+
description: 'List pull requests for a Bitbucket repository. By default returns open pull requests. Supports pagination and state filtering.',
|
|
9
|
+
summary: 'List pull requests for a repository',
|
|
10
|
+
icon: 'git-pull-request',
|
|
11
|
+
group: 'Pull Requests',
|
|
12
|
+
input: z.object({
|
|
13
|
+
workspace: z.string().describe('Workspace slug or UUID'),
|
|
14
|
+
repo_slug: z.string().describe('Repository slug'),
|
|
15
|
+
state: z
|
|
16
|
+
.enum(['OPEN', 'MERGED', 'DECLINED', 'SUPERSEDED'])
|
|
17
|
+
.optional()
|
|
18
|
+
.describe('Pull request state filter (default OPEN)'),
|
|
19
|
+
page: z.number().int().optional().describe('Page number for pagination (default 1)'),
|
|
20
|
+
pagelen: z.number().int().optional().describe('Number of results per page (default 25, max 100)'),
|
|
21
|
+
}),
|
|
22
|
+
output: z.object({
|
|
23
|
+
pull_requests: z.array(pullRequestSchema).describe('Array of pull requests'),
|
|
24
|
+
}),
|
|
25
|
+
handle: async (params) => {
|
|
26
|
+
const query = {
|
|
27
|
+
state: params.state,
|
|
28
|
+
page: params.page,
|
|
29
|
+
pagelen: params.pagelen,
|
|
30
|
+
};
|
|
31
|
+
const data = await api(`/repositories/${params.workspace}/${params.repo_slug}/pullrequests`, {
|
|
32
|
+
query,
|
|
33
|
+
});
|
|
34
|
+
return { pull_requests: (data.values ?? []).map(mapPullRequest) };
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=list-pull-requests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-pull-requests.js","sourceRoot":"","sources":["../../src/tools/list-pull-requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAc,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE7E,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC;IACzC,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EACT,gIAAgI;IAClI,OAAO,EAAE,qCAAqC;IAC9C,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,eAAe;IACtB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QACxD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;QACjD,KAAK,EAAE,CAAC;aACL,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;aAClD,QAAQ,EAAE;aACV,QAAQ,CAAC,0CAA0C,CAAC;QACvD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;QACpF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;KAClG,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC;KAC7E,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,KAAK,GAAgD;YACzD,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,OAAO,EAAE,MAAM,CAAC,OAAO;SACxB,CAAC;QACF,MAAM,IAAI,GAAG,MAAM,GAAG,CAAsB,iBAAiB,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,eAAe,EAAE;YAChH,KAAK;SACN,CAAC,CAAC;QACH,OAAO,EAAE,aAAa,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC;IACpE,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listRepositories: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
workspace: z.ZodString;
|
|
4
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
pagelen: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
query: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8
|
+
repositories: z.ZodArray<z.ZodObject<{
|
|
9
|
+
uuid: z.ZodString;
|
|
10
|
+
slug: z.ZodString;
|
|
11
|
+
full_name: z.ZodString;
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
description: z.ZodString;
|
|
14
|
+
is_private: z.ZodBoolean;
|
|
15
|
+
scm: z.ZodString;
|
|
16
|
+
language: z.ZodString;
|
|
17
|
+
default_branch: z.ZodString;
|
|
18
|
+
web_url: z.ZodString;
|
|
19
|
+
created_on: z.ZodString;
|
|
20
|
+
updated_on: z.ZodString;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
}, z.core.$strip>>;
|
|
23
|
+
//# sourceMappingURL=list-repositories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-repositories.d.ts","sourceRoot":"","sources":["../../src/tools/list-repositories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;kBA0B3B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../bitbucket-api.js';
|
|
4
|
+
import { repositorySchema, mapRepository } from './schemas.js';
|
|
5
|
+
export const listRepositories = defineTool({
|
|
6
|
+
name: 'list_repositories',
|
|
7
|
+
displayName: 'List Repositories',
|
|
8
|
+
description: 'List repositories in a Bitbucket workspace. Supports pagination and filtering with Bitbucket query language.',
|
|
9
|
+
summary: 'List repositories in a workspace',
|
|
10
|
+
icon: 'book',
|
|
11
|
+
group: 'Repositories',
|
|
12
|
+
input: z.object({
|
|
13
|
+
workspace: z.string().describe('Workspace slug or UUID'),
|
|
14
|
+
page: z.number().int().optional().describe('Page number for pagination (default 1)'),
|
|
15
|
+
pagelen: z.number().int().optional().describe('Number of results per page (default 25, max 100)'),
|
|
16
|
+
query: z.string().optional().describe('Bitbucket query language filter (e.g., \'name ~ "my-repo"\')'),
|
|
17
|
+
}),
|
|
18
|
+
output: z.object({
|
|
19
|
+
repositories: z.array(repositorySchema).describe('Array of repositories'),
|
|
20
|
+
}),
|
|
21
|
+
handle: async (params) => {
|
|
22
|
+
const query = {
|
|
23
|
+
page: params.page,
|
|
24
|
+
pagelen: params.pagelen,
|
|
25
|
+
q: params.query,
|
|
26
|
+
};
|
|
27
|
+
const data = await api(`/repositories/${params.workspace}`, { query });
|
|
28
|
+
return { repositories: (data.values ?? []).map(mapRepository) };
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=list-repositories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-repositories.js","sourceRoot":"","sources":["../../src/tools/list-repositories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAgB,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7E,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC;IACzC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EACT,8GAA8G;IAChH,OAAO,EAAE,kCAAkC;IAC3C,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,cAAc;IACrB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QACxD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;QACpF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;QACjG,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8DAA8D,CAAC;KACtG,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC;KAC1E,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,KAAK,GAAgD;YACzD,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,CAAC,EAAE,MAAM,CAAC,KAAK;SAChB,CAAC;QACF,MAAM,IAAI,GAAG,MAAM,GAAG,CAAwB,iBAAiB,MAAM,CAAC,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAC9F,OAAO,EAAE,YAAY,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;IAClE,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listTags: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
workspace: z.ZodString;
|
|
4
|
+
repo_slug: z.ZodString;
|
|
5
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
pagelen: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8
|
+
tags: z.ZodArray<z.ZodObject<{
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
target_hash: z.ZodString;
|
|
11
|
+
target_date: z.ZodString;
|
|
12
|
+
message: z.ZodString;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
}, z.core.$strip>>;
|
|
15
|
+
//# sourceMappingURL=list-tags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-tags.d.ts","sourceRoot":"","sources":["../../src/tools/list-tags.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,QAAQ;;;;;;;;;;;;kBA0BnB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../bitbucket-api.js';
|
|
4
|
+
import { tagSchema, mapTag } from './schemas.js';
|
|
5
|
+
export const listTags = defineTool({
|
|
6
|
+
name: 'list_tags',
|
|
7
|
+
displayName: 'List Tags',
|
|
8
|
+
description: 'List tags in a Bitbucket repository. Supports pagination.',
|
|
9
|
+
summary: 'List repository tags',
|
|
10
|
+
icon: 'tag',
|
|
11
|
+
group: 'Branches & Tags',
|
|
12
|
+
input: z.object({
|
|
13
|
+
workspace: z.string().describe('Workspace slug or UUID'),
|
|
14
|
+
repo_slug: z.string().describe('Repository slug'),
|
|
15
|
+
page: z.number().int().optional().describe('Page number for pagination (default 1)'),
|
|
16
|
+
pagelen: z.number().int().optional().describe('Number of results per page (default 25, max 100)'),
|
|
17
|
+
}),
|
|
18
|
+
output: z.object({
|
|
19
|
+
tags: z.array(tagSchema).describe('Array of tags'),
|
|
20
|
+
}),
|
|
21
|
+
handle: async (params) => {
|
|
22
|
+
const query = {
|
|
23
|
+
page: params.page,
|
|
24
|
+
pagelen: params.pagelen,
|
|
25
|
+
};
|
|
26
|
+
const data = await api(`/repositories/${params.workspace}/${params.repo_slug}/refs/tags`, {
|
|
27
|
+
query,
|
|
28
|
+
});
|
|
29
|
+
return { tags: (data.values ?? []).map(mapTag) };
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=list-tags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-tags.js","sourceRoot":"","sources":["../../src/tools/list-tags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,qBAA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,EAAE,CAAC;IACnD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listWorkspaceMembers: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
workspace: z.ZodString;
|
|
4
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
pagelen: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7
|
+
members: z.ZodArray<z.ZodObject<{
|
|
8
|
+
display_name: z.ZodString;
|
|
9
|
+
uuid: z.ZodString;
|
|
10
|
+
type: z.ZodString;
|
|
11
|
+
permission: z.ZodString;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
//# sourceMappingURL=list-workspace-members.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-workspace-members.d.ts","sourceRoot":"","sources":["../../src/tools/list-workspace-members.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;kBAuB/B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../bitbucket-api.js';
|
|
4
|
+
import { memberSchema, mapMember } from './schemas.js';
|
|
5
|
+
export const listWorkspaceMembers = defineTool({
|
|
6
|
+
name: 'list_workspace_members',
|
|
7
|
+
displayName: 'List Workspace Members',
|
|
8
|
+
description: 'List all members of a Bitbucket workspace. Supports pagination.',
|
|
9
|
+
summary: 'List workspace members',
|
|
10
|
+
icon: 'users',
|
|
11
|
+
group: 'Workspaces',
|
|
12
|
+
input: z.object({
|
|
13
|
+
workspace: z.string().describe('Workspace slug or UUID'),
|
|
14
|
+
page: z.number().int().optional().describe('Page number for pagination (default 1)'),
|
|
15
|
+
pagelen: z.number().int().optional().describe('Number of results per page (default 25, max 100)'),
|
|
16
|
+
}),
|
|
17
|
+
output: z.object({
|
|
18
|
+
members: z.array(memberSchema).describe('Array of workspace members'),
|
|
19
|
+
}),
|
|
20
|
+
handle: async (params) => {
|
|
21
|
+
const query = {
|
|
22
|
+
page: params.page,
|
|
23
|
+
pagelen: params.pagelen,
|
|
24
|
+
};
|
|
25
|
+
const data = await api(`/workspaces/${params.workspace}/members`, { query });
|
|
26
|
+
return { members: (data.values ?? []).map(mapMember) };
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=list-workspace-members.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-workspace-members.js","sourceRoot":"","sources":["../../src/tools/list-workspace-members.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAkB,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEvE,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC;IAC7C,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,iEAAiE;IAC9E,OAAO,EAAE,wBAAwB;IACjC,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,YAAY;IACnB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QACxD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;QACpF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;KAClG,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,4BAA4B,CAAC;KACtE,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,KAAK,GAAgD;YACzD,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,OAAO,EAAE,MAAM,CAAC,OAAO;SACxB,CAAC;QACF,MAAM,IAAI,GAAG,MAAM,GAAG,CAA0B,eAAe,MAAM,CAAC,SAAS,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QACtG,OAAO,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;IACzD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listWorkspaces: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
pagelen: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
workspaces: z.ZodArray<z.ZodObject<{
|
|
7
|
+
uuid: z.ZodString;
|
|
8
|
+
slug: z.ZodString;
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
type: z.ZodString;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
//# sourceMappingURL=list-workspaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-workspaces.d.ts","sourceRoot":"","sources":["../../src/tools/list-workspaces.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,cAAc;;;;;;;;;;kBAsBzB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../bitbucket-api.js';
|
|
4
|
+
import { workspaceSchema, mapWorkspace } from './schemas.js';
|
|
5
|
+
export const listWorkspaces = defineTool({
|
|
6
|
+
name: 'list_workspaces',
|
|
7
|
+
displayName: 'List Workspaces',
|
|
8
|
+
description: 'List all Bitbucket workspaces the authenticated user has access to. Supports pagination.',
|
|
9
|
+
summary: 'List workspaces',
|
|
10
|
+
icon: 'building',
|
|
11
|
+
group: 'Workspaces',
|
|
12
|
+
input: z.object({
|
|
13
|
+
page: z.number().int().optional().describe('Page number for pagination (default 1)'),
|
|
14
|
+
pagelen: z.number().int().optional().describe('Number of results per page (default 25, max 100)'),
|
|
15
|
+
}),
|
|
16
|
+
output: z.object({
|
|
17
|
+
workspaces: z.array(workspaceSchema).describe('Array of workspaces'),
|
|
18
|
+
}),
|
|
19
|
+
handle: async (params) => {
|
|
20
|
+
const query = {
|
|
21
|
+
page: params.page,
|
|
22
|
+
pagelen: params.pagelen,
|
|
23
|
+
};
|
|
24
|
+
const data = await api('/workspaces', { query });
|
|
25
|
+
return { workspaces: (data.values ?? []).map(mapWorkspace) };
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=list-workspaces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-workspaces.js","sourceRoot":"","sources":["../../src/tools/list-workspaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EA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ZodString;
|
|
5
|
+
pull_request_id: z.ZodNumber;
|
|
6
|
+
merge_strategy: z.ZodOptional<z.ZodEnum<{
|
|
7
|
+
merge_commit: "merge_commit";
|
|
8
|
+
squash: "squash";
|
|
9
|
+
fast_forward: "fast_forward";
|
|
10
|
+
}>>;
|
|
11
|
+
close_source_branch: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
message: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
14
|
+
id: z.ZodNumber;
|
|
15
|
+
title: z.ZodString;
|
|
16
|
+
description: z.ZodString;
|
|
17
|
+
state: z.ZodString;
|
|
18
|
+
source_branch: z.ZodString;
|
|
19
|
+
destination_branch: z.ZodString;
|
|
20
|
+
author: z.ZodString;
|
|
21
|
+
close_source_branch: z.ZodBoolean;
|
|
22
|
+
comment_count: z.ZodNumber;
|
|
23
|
+
web_url: z.ZodString;
|
|
24
|
+
created_on: z.ZodString;
|
|
25
|
+
updated_on: z.ZodString;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
//# sourceMappingURL=merge-pull-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-pull-request.d.ts","sourceRoot":"","sources":["../../src/tools/merge-pull-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;kBA+B3B,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../bitbucket-api.js';
|
|
4
|
+
import { pullRequestSchema, mapPullRequest } from './schemas.js';
|
|
5
|
+
export const mergePullRequest = defineTool({
|
|
6
|
+
name: 'merge_pull_request',
|
|
7
|
+
displayName: 'Merge Pull Request',
|
|
8
|
+
description: 'Merge a pull request. Supports merge commit, squash, and fast-forward strategies.',
|
|
9
|
+
summary: 'Merge a pull request',
|
|
10
|
+
icon: 'git-merge',
|
|
11
|
+
group: 'Pull Requests',
|
|
12
|
+
input: z.object({
|
|
13
|
+
workspace: z.string().describe('Workspace slug or UUID'),
|
|
14
|
+
repo_slug: z.string().describe('Repository slug'),
|
|
15
|
+
pull_request_id: z.number().int().describe('Pull request ID'),
|
|
16
|
+
merge_strategy: z
|
|
17
|
+
.enum(['merge_commit', 'squash', 'fast_forward'])
|
|
18
|
+
.optional()
|
|
19
|
+
.describe('Merge strategy (default merge_commit)'),
|
|
20
|
+
close_source_branch: z.boolean().optional().describe('Whether to delete the source branch after merge'),
|
|
21
|
+
message: z.string().optional().describe('Merge commit message'),
|
|
22
|
+
}),
|
|
23
|
+
output: pullRequestSchema,
|
|
24
|
+
handle: async (params) => {
|
|
25
|
+
const body = {};
|
|
26
|
+
if (params.merge_strategy !== undefined)
|
|
27
|
+
body.merge_strategy = params.merge_strategy;
|
|
28
|
+
if (params.close_source_branch !== undefined)
|
|
29
|
+
body.close_source_branch = params.close_source_branch;
|
|
30
|
+
if (params.message !== undefined)
|
|
31
|
+
body.message = params.message;
|
|
32
|
+
const data = await api(`/repositories/${params.workspace}/${params.repo_slug}/pullrequests/${params.pull_request_id}/merge`, { method: 'POST', body });
|
|
33
|
+
return mapPullRequest(data);
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=merge-pull-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-pull-request.js","sourceRoot":"","sources":["../../src/tools/merge-pull-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAc,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE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