@opentabs-dev/opentabs-plugin-github 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/README.md +159 -0
- package/dist/adapter.iife.js +15870 -0
- package/dist/adapter.iife.js.map +7 -0
- package/dist/github-api.d.ts +15 -0
- package/dist/github-api.d.ts.map +1 -0
- package/dist/github-api.js +145 -0
- package/dist/github-api.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +98 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/add-reaction.d.ts +21 -0
- package/dist/tools/add-reaction.d.ts.map +1 -0
- package/dist/tools/add-reaction.js +50 -0
- package/dist/tools/add-reaction.js.map +1 -0
- package/dist/tools/compare-commits.d.ts +22 -0
- package/dist/tools/compare-commits.d.ts.map +1 -0
- package/dist/tools/compare-commits.js +57 -0
- package/dist/tools/compare-commits.js.map +1 -0
- package/dist/tools/create-comment.d.ts +17 -0
- package/dist/tools/create-comment.d.ts.map +1 -0
- package/dist/tools/create-comment.js +26 -0
- package/dist/tools/create-comment.js.map +1 -0
- package/dist/tools/create-issue.d.ts +26 -0
- package/dist/tools/create-issue.d.ts.map +1 -0
- package/dist/tools/create-issue.js +38 -0
- package/dist/tools/create-issue.js.map +1 -0
- package/dist/tools/create-label.d.ts +16 -0
- package/dist/tools/create-label.d.ts.map +1 -0
- package/dist/tools/create-label.js +37 -0
- package/dist/tools/create-label.js.map +1 -0
- package/dist/tools/create-or-update-file.d.ts +15 -0
- package/dist/tools/create-or-update-file.d.ts.map +1 -0
- package/dist/tools/create-or-update-file.js +46 -0
- package/dist/tools/create-or-update-file.js.map +1 -0
- package/dist/tools/create-pull-request.d.ts +33 -0
- package/dist/tools/create-pull-request.d.ts.map +1 -0
- package/dist/tools/create-pull-request.js +41 -0
- package/dist/tools/create-pull-request.js.map +1 -0
- package/dist/tools/create-release.d.ts +25 -0
- package/dist/tools/create-release.d.ts.map +1 -0
- package/dist/tools/create-release.js +46 -0
- package/dist/tools/create-release.js.map +1 -0
- package/dist/tools/create-repo.d.ts +26 -0
- package/dist/tools/create-repo.d.ts.map +1 -0
- package/dist/tools/create-repo.js +42 -0
- package/dist/tools/create-repo.js.map +1 -0
- package/dist/tools/delete-file.d.ts +16 -0
- package/dist/tools/delete-file.d.ts.map +1 -0
- package/dist/tools/delete-file.js +48 -0
- package/dist/tools/delete-file.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 +33 -0
- package/dist/tools/get-file-content.js.map +1 -0
- package/dist/tools/get-issue.d.ts +23 -0
- package/dist/tools/get-issue.d.ts.map +1 -0
- package/dist/tools/get-issue.js +25 -0
- package/dist/tools/get-issue.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 +26 -0
- package/dist/tools/get-pull-request-diff.js.map +1 -0
- package/dist/tools/get-pull-request.d.ts +29 -0
- package/dist/tools/get-pull-request.d.ts.map +1 -0
- package/dist/tools/get-pull-request.js +25 -0
- package/dist/tools/get-pull-request.js.map +1 -0
- package/dist/tools/get-repo.d.ts +22 -0
- package/dist/tools/get-repo.d.ts.map +1 -0
- package/dist/tools/get-repo.js +24 -0
- package/dist/tools/get-repo.js.map +1 -0
- package/dist/tools/get-user-profile.d.ts +21 -0
- package/dist/tools/get-user-profile.d.ts.map +1 -0
- package/dist/tools/get-user-profile.js +24 -0
- package/dist/tools/get-user-profile.js.map +1 -0
- package/dist/tools/get-workflow-run.d.ts +19 -0
- package/dist/tools/get-workflow-run.d.ts.map +1 -0
- package/dist/tools/get-workflow-run.js +25 -0
- package/dist/tools/get-workflow-run.js.map +1 -0
- package/dist/tools/list-branches.d.ts +14 -0
- package/dist/tools/list-branches.d.ts.map +1 -0
- package/dist/tools/list-branches.js +30 -0
- package/dist/tools/list-branches.js.map +1 -0
- package/dist/tools/list-comments.d.ts +18 -0
- package/dist/tools/list-comments.d.ts.map +1 -0
- package/dist/tools/list-comments.js +31 -0
- package/dist/tools/list-comments.js.map +1 -0
- package/dist/tools/list-commits.d.ts +18 -0
- package/dist/tools/list-commits.d.ts.map +1 -0
- package/dist/tools/list-commits.js +33 -0
- package/dist/tools/list-commits.js.map +1 -0
- package/dist/tools/list-issues.d.ts +40 -0
- package/dist/tools/list-issues.d.ts.map +1 -0
- package/dist/tools/list-issues.js +42 -0
- package/dist/tools/list-issues.js.map +1 -0
- package/dist/tools/list-labels.d.ts +15 -0
- package/dist/tools/list-labels.d.ts.map +1 -0
- package/dist/tools/list-labels.js +30 -0
- package/dist/tools/list-labels.js.map +1 -0
- package/dist/tools/list-notifications.d.ts +19 -0
- package/dist/tools/list-notifications.d.ts.map +1 -0
- package/dist/tools/list-notifications.js +39 -0
- package/dist/tools/list-notifications.js.map +1 -0
- package/dist/tools/list-org-members.d.ts +14 -0
- package/dist/tools/list-org-members.d.ts.map +1 -0
- package/dist/tools/list-org-members.js +42 -0
- package/dist/tools/list-org-members.js.map +1 -0
- package/dist/tools/list-pull-request-files.d.ts +18 -0
- package/dist/tools/list-pull-request-files.d.ts.map +1 -0
- package/dist/tools/list-pull-request-files.js +48 -0
- package/dist/tools/list-pull-request-files.js.map +1 -0
- package/dist/tools/list-pull-requests.d.ts +47 -0
- package/dist/tools/list-pull-requests.d.ts.map +1 -0
- package/dist/tools/list-pull-requests.js +45 -0
- package/dist/tools/list-pull-requests.js.map +1 -0
- package/dist/tools/list-releases.d.ts +21 -0
- package/dist/tools/list-releases.d.ts.map +1 -0
- package/dist/tools/list-releases.js +30 -0
- package/dist/tools/list-releases.js.map +1 -0
- package/dist/tools/list-repos.d.ts +36 -0
- package/dist/tools/list-repos.d.ts.map +1 -0
- package/dist/tools/list-repos.js +48 -0
- package/dist/tools/list-repos.js.map +1 -0
- package/dist/tools/list-workflow-runs.d.ts +39 -0
- package/dist/tools/list-workflow-runs.d.ts.map +1 -0
- package/dist/tools/list-workflow-runs.js +62 -0
- package/dist/tools/list-workflow-runs.js.map +1 -0
- package/dist/tools/merge-pull-request.d.ts +18 -0
- package/dist/tools/merge-pull-request.d.ts.map +1 -0
- package/dist/tools/merge-pull-request.js +40 -0
- package/dist/tools/merge-pull-request.js.map +1 -0
- package/dist/tools/request-pull-request-review.d.ts +31 -0
- package/dist/tools/request-pull-request-review.d.ts.map +1 -0
- package/dist/tools/request-pull-request-review.js +32 -0
- package/dist/tools/request-pull-request-review.js.map +1 -0
- package/dist/tools/schemas.d.ts +403 -0
- package/dist/tools/schemas.d.ts.map +1 -0
- package/dist/tools/schemas.js +259 -0
- package/dist/tools/schemas.js.map +1 -0
- package/dist/tools/search-issues.d.ts +37 -0
- package/dist/tools/search-issues.d.ts.map +1 -0
- package/dist/tools/search-issues.js +46 -0
- package/dist/tools/search-issues.js.map +1 -0
- package/dist/tools/search-repos.d.ts +34 -0
- package/dist/tools/search-repos.d.ts.map +1 -0
- package/dist/tools/search-repos.js +41 -0
- package/dist/tools/search-repos.js.map +1 -0
- package/dist/tools/update-issue.d.ts +31 -0
- package/dist/tools/update-issue.d.ts.map +1 -0
- package/dist/tools/update-issue.js +41 -0
- package/dist/tools/update-issue.js.map +1 -0
- package/dist/tools/update-pull-request.d.ts +37 -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 +4005 -0
- package/package.json +55 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../github-api.js';
|
|
4
|
+
import { labelSchema, mapLabel } from './schemas.js';
|
|
5
|
+
export const createLabel = defineTool({
|
|
6
|
+
name: 'create_label',
|
|
7
|
+
displayName: 'Create Label',
|
|
8
|
+
description: 'Create a new label in a repository.',
|
|
9
|
+
summary: 'Create a label in a repository',
|
|
10
|
+
icon: 'tag',
|
|
11
|
+
group: 'Issues',
|
|
12
|
+
input: z.object({
|
|
13
|
+
owner: z.string().min(1).describe('Repository owner (user or org)'),
|
|
14
|
+
repo: z.string().min(1).describe('Repository name'),
|
|
15
|
+
name: z.string().min(1).describe('Label name'),
|
|
16
|
+
color: z.string().optional().describe('Label hex color without the # prefix (e.g., "ff0000")'),
|
|
17
|
+
description: z.string().optional().describe('Label description'),
|
|
18
|
+
}),
|
|
19
|
+
output: z.object({
|
|
20
|
+
label: labelSchema.describe('The created label'),
|
|
21
|
+
}),
|
|
22
|
+
handle: async (params) => {
|
|
23
|
+
const body = {
|
|
24
|
+
name: params.name,
|
|
25
|
+
};
|
|
26
|
+
if (params.color !== undefined)
|
|
27
|
+
body.color = params.color;
|
|
28
|
+
if (params.description !== undefined)
|
|
29
|
+
body.description = params.description;
|
|
30
|
+
const data = await api(`/repos/${params.owner}/${params.repo}/labels`, {
|
|
31
|
+
method: 'POST',
|
|
32
|
+
body,
|
|
33
|
+
});
|
|
34
|
+
return { label: mapLabel(data) };
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=create-label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-label.js","sourceRoot":"","sources":["../../src/tools/create-label.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,kBAAkB,CAAC;AACvC,OAAO,EAAiB,WAAW,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEpE,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;IACpC,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,qCAAqC;IAClD,OAAO,EAAE,gCAAgC;IACzC,IAAI,EA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CAAC;IACnC,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const createOrUpdateFile: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
owner: z.ZodString;
|
|
4
|
+
repo: z.ZodString;
|
|
5
|
+
path: z.ZodString;
|
|
6
|
+
content: z.ZodString;
|
|
7
|
+
message: z.ZodString;
|
|
8
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
9
|
+
sha: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
sha: z.ZodString;
|
|
12
|
+
commit_sha: z.ZodString;
|
|
13
|
+
html_url: z.ZodString;
|
|
14
|
+
}, z.core.$strip>>;
|
|
15
|
+
//# sourceMappingURL=create-or-update-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-or-update-file.d.ts","sourceRoot":"","sources":["../../src/tools/create-or-update-file.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;kBA6C7B,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../github-api.js';
|
|
4
|
+
export const createOrUpdateFile = defineTool({
|
|
5
|
+
name: 'create_or_update_file',
|
|
6
|
+
displayName: 'Create or Update File',
|
|
7
|
+
description: 'Create or update a file in a repository. To update an existing file, provide the current file SHA (obtainable from the contents API). Commits directly to the specified branch.',
|
|
8
|
+
summary: 'Create or update a file in a repository',
|
|
9
|
+
icon: 'file-edit',
|
|
10
|
+
group: 'Repositories',
|
|
11
|
+
input: z.object({
|
|
12
|
+
owner: z.string().min(1).describe('Repository owner (user or org)'),
|
|
13
|
+
repo: z.string().min(1).describe('Repository name'),
|
|
14
|
+
path: z.string().min(1).describe('File path relative to repository root'),
|
|
15
|
+
content: z.string().min(1).describe('File content as a UTF-8 string (will be base64-encoded automatically)'),
|
|
16
|
+
message: z.string().min(1).describe('Commit message'),
|
|
17
|
+
branch: z.string().optional().describe('Branch to commit to (defaults to the default branch)'),
|
|
18
|
+
sha: z.string().optional().describe('SHA of the file being replaced — required when updating an existing file'),
|
|
19
|
+
}),
|
|
20
|
+
output: z.object({
|
|
21
|
+
sha: z.string().describe('SHA of the created/updated file blob'),
|
|
22
|
+
commit_sha: z.string().describe('SHA of the commit'),
|
|
23
|
+
html_url: z.string().describe('URL to the file on GitHub'),
|
|
24
|
+
}),
|
|
25
|
+
handle: async (params) => {
|
|
26
|
+
const body = {
|
|
27
|
+
message: params.message,
|
|
28
|
+
content: btoa(unescape(encodeURIComponent(params.content))),
|
|
29
|
+
};
|
|
30
|
+
if (params.branch)
|
|
31
|
+
body.branch = params.branch;
|
|
32
|
+
if (params.sha)
|
|
33
|
+
body.sha = params.sha;
|
|
34
|
+
const encodedPath = params.path.split('/').map(encodeURIComponent).join('/');
|
|
35
|
+
const data = await api(`/repos/${params.owner}/${params.repo}/contents/${encodedPath}`, {
|
|
36
|
+
method: 'PUT',
|
|
37
|
+
body,
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
sha: data.content?.sha ?? '',
|
|
41
|
+
commit_sha: data.commit?.sha ?? '',
|
|
42
|
+
html_url: data.content?.html_url ?? '',
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=create-or-update-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-or-update-file.js","sourceRoot":"","sources":["../../src/tools/create-or-update-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EA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C,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;KAC3D,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAA4B;YACpC,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;SAC5D,CAAC;QACF,IAAI,MAAM,CAAC,MAAM;YAAE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC/C,IAAI,MAAM,CAAC,GAAG;YAAE,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;QAEtC,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7E,MAAM,IAAI,GAAG,MAAM,GAAG,CAGnB,UAAU,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,aAAa,WAAW,EAAE,EAAE;YAClE,MAAM,EAAE,KAAK;YACb,IAAI;SACL,CAAC,CAAC;QAEH,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,EAAE;YAC5B,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,EAAE;YAClC,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,IAAI,EAAE;SACvC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const createPullRequest: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
owner: z.ZodString;
|
|
4
|
+
repo: z.ZodString;
|
|
5
|
+
title: z.ZodString;
|
|
6
|
+
head: z.ZodString;
|
|
7
|
+
base: z.ZodString;
|
|
8
|
+
body: z.ZodOptional<z.ZodString>;
|
|
9
|
+
draft: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
pull_request: z.ZodObject<{
|
|
12
|
+
number: z.ZodNumber;
|
|
13
|
+
title: z.ZodString;
|
|
14
|
+
state: z.ZodString;
|
|
15
|
+
body: z.ZodString;
|
|
16
|
+
html_url: z.ZodString;
|
|
17
|
+
user_login: z.ZodString;
|
|
18
|
+
head_ref: z.ZodString;
|
|
19
|
+
base_ref: z.ZodString;
|
|
20
|
+
labels: z.ZodArray<z.ZodString>;
|
|
21
|
+
draft: z.ZodBoolean;
|
|
22
|
+
merged: z.ZodBoolean;
|
|
23
|
+
mergeable: z.ZodBoolean;
|
|
24
|
+
comments: z.ZodNumber;
|
|
25
|
+
commits: z.ZodNumber;
|
|
26
|
+
additions: z.ZodNumber;
|
|
27
|
+
deletions: z.ZodNumber;
|
|
28
|
+
changed_files: z.ZodNumber;
|
|
29
|
+
created_at: z.ZodString;
|
|
30
|
+
updated_at: z.ZodString;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
//# sourceMappingURL=create-pull-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-pull-request.d.ts","sourceRoot":"","sources":["../../src/tools/create-pull-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkC5B,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../github-api.js';
|
|
4
|
+
import { mapPullRequest, pullRequestSchema } from './schemas.js';
|
|
5
|
+
export const createPullRequest = defineTool({
|
|
6
|
+
name: 'create_pull_request',
|
|
7
|
+
displayName: 'Create Pull Request',
|
|
8
|
+
description: 'Create a new pull request.',
|
|
9
|
+
summary: 'Create a new pull request',
|
|
10
|
+
icon: 'git-pull-request-arrow',
|
|
11
|
+
group: 'Pull Requests',
|
|
12
|
+
input: z.object({
|
|
13
|
+
owner: z.string().min(1).describe('Repository owner (user or org)'),
|
|
14
|
+
repo: z.string().min(1).describe('Repository name'),
|
|
15
|
+
title: z.string().min(1).describe('Pull request title'),
|
|
16
|
+
head: z.string().min(1).describe('Source branch name (or "user:branch" for cross-repo)'),
|
|
17
|
+
base: z.string().min(1).describe('Target branch name to merge into'),
|
|
18
|
+
body: z.string().optional().describe('Pull request description in Markdown'),
|
|
19
|
+
draft: z.boolean().optional().describe('Create as a draft PR (default: false)'),
|
|
20
|
+
}),
|
|
21
|
+
output: z.object({
|
|
22
|
+
pull_request: pullRequestSchema.describe('The created pull request'),
|
|
23
|
+
}),
|
|
24
|
+
handle: async (params) => {
|
|
25
|
+
const body = {
|
|
26
|
+
title: params.title,
|
|
27
|
+
head: params.head,
|
|
28
|
+
base: params.base,
|
|
29
|
+
};
|
|
30
|
+
if (params.body !== undefined)
|
|
31
|
+
body.body = params.body;
|
|
32
|
+
if (params.draft !== undefined)
|
|
33
|
+
body.draft = params.draft;
|
|
34
|
+
const data = await api(`/repos/${params.owner}/${params.repo}/pulls`, {
|
|
35
|
+
method: 'POST',
|
|
36
|
+
body,
|
|
37
|
+
});
|
|
38
|
+
return { pull_request: mapPullRequest(data) };
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=create-pull-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-pull-request.js","sourceRoot":"","sources":["../../src/tools/create-pull-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,E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EAAC,EAAE;QACrB,MAAM,IAAI,GAA4B;YACpC,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,CAAC;QACF,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS;YAAE,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACvD,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS;YAAE,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAE1D,MAAM,IAAI,GAAG,MAAM,GAAG,CAA0B,UAAU,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,QAAQ,EAAE;YAC7F,MAAM,EAAE,MAAM;YACd,IAAI;SACL,CAAC,CAAC;QACH,OAAO,EAAE,YAAY,EAAE,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;IAChD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const createRelease: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
owner: z.ZodString;
|
|
4
|
+
repo: z.ZodString;
|
|
5
|
+
tag_name: z.ZodString;
|
|
6
|
+
name: z.ZodOptional<z.ZodString>;
|
|
7
|
+
body: z.ZodOptional<z.ZodString>;
|
|
8
|
+
draft: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
prerelease: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
target_commitish: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
12
|
+
release: z.ZodObject<{
|
|
13
|
+
id: z.ZodNumber;
|
|
14
|
+
tag_name: z.ZodString;
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
body: z.ZodString;
|
|
17
|
+
draft: z.ZodBoolean;
|
|
18
|
+
prerelease: z.ZodBoolean;
|
|
19
|
+
created_at: z.ZodString;
|
|
20
|
+
published_at: z.ZodString;
|
|
21
|
+
html_url: z.ZodString;
|
|
22
|
+
author_login: z.ZodString;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
//# sourceMappingURL=create-release.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-release.d.ts","sourceRoot":"","sources":["../../src/tools/create-release.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;kBAoCxB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../github-api.js';
|
|
4
|
+
import { mapRelease, releaseSchema } from './schemas.js';
|
|
5
|
+
export const createRelease = defineTool({
|
|
6
|
+
name: 'create_release',
|
|
7
|
+
displayName: 'Create Release',
|
|
8
|
+
description: 'Create a new release for a repository. Optionally create as a draft or prerelease.',
|
|
9
|
+
summary: 'Create a release in a repository',
|
|
10
|
+
icon: 'package',
|
|
11
|
+
group: 'Repositories',
|
|
12
|
+
input: z.object({
|
|
13
|
+
owner: z.string().min(1).describe('Repository owner (user or org)'),
|
|
14
|
+
repo: z.string().min(1).describe('Repository name'),
|
|
15
|
+
tag_name: z.string().min(1).describe('Git tag name for the release'),
|
|
16
|
+
name: z.string().optional().describe('Release title'),
|
|
17
|
+
body: z.string().optional().describe('Release notes in Markdown'),
|
|
18
|
+
draft: z.boolean().optional().describe('Create as a draft release (default: false)'),
|
|
19
|
+
prerelease: z.boolean().optional().describe('Mark as a prerelease (default: false)'),
|
|
20
|
+
target_commitish: z.string().optional().describe('Branch or commit SHA to tag — defaults to the default branch'),
|
|
21
|
+
}),
|
|
22
|
+
output: z.object({
|
|
23
|
+
release: releaseSchema.describe('The created release'),
|
|
24
|
+
}),
|
|
25
|
+
handle: async (params) => {
|
|
26
|
+
const body = {
|
|
27
|
+
tag_name: params.tag_name,
|
|
28
|
+
};
|
|
29
|
+
if (params.name !== undefined)
|
|
30
|
+
body.name = params.name;
|
|
31
|
+
if (params.body !== undefined)
|
|
32
|
+
body.body = params.body;
|
|
33
|
+
if (params.draft !== undefined)
|
|
34
|
+
body.draft = params.draft;
|
|
35
|
+
if (params.prerelease !== undefined)
|
|
36
|
+
body.prerelease = params.prerelease;
|
|
37
|
+
if (params.target_commitish !== undefined)
|
|
38
|
+
body.target_commitish = params.target_commitish;
|
|
39
|
+
const data = await api(`/repos/${params.owner}/${params.repo}/releases`, {
|
|
40
|
+
method: 'POST',
|
|
41
|
+
body,
|
|
42
|
+
});
|
|
43
|
+
return { release: mapRelease(data) };
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=create-release.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-release.js","sourceRoot":"","sources":["../../src/tools/create-release.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,kBAAkB,CAAC;AACvC,OAAO,EAAmB,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE1E,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;IACtC,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,oFAAoF;IACjG,OAAO,EAAE,kCAAkC;IAC3C,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,cAAc;IACrB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,gCAAgC,CAA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AAI,MAAM,CAAC,UAAU,KAAK,SAAS;YAAE,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACzE,IAAI,MAAM,CAAC,gBAAgB,KAAK,SAAS;YAAE,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;QAE3F,MAAM,IAAI,GAAG,MAAM,GAAG,CAAa,UAAU,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,WAAW,EAAE;YACnF,MAAM,EAAE,MAAM;YACd,IAAI;SACL,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;IACvC,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const createRepo: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
description: z.ZodOptional<z.ZodString>;
|
|
5
|
+
private: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
auto_init: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
gitignore_template: z.ZodOptional<z.ZodString>;
|
|
8
|
+
license_template: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
10
|
+
repository: z.ZodObject<{
|
|
11
|
+
id: z.ZodNumber;
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
full_name: z.ZodString;
|
|
14
|
+
description: z.ZodString;
|
|
15
|
+
private: z.ZodBoolean;
|
|
16
|
+
html_url: z.ZodString;
|
|
17
|
+
default_branch: z.ZodString;
|
|
18
|
+
language: z.ZodString;
|
|
19
|
+
stargazers_count: z.ZodNumber;
|
|
20
|
+
forks_count: z.ZodNumber;
|
|
21
|
+
open_issues_count: z.ZodNumber;
|
|
22
|
+
archived: z.ZodBoolean;
|
|
23
|
+
updated_at: z.ZodString;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
//# sourceMappingURL=create-repo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-repo.d.ts","sourceRoot":"","sources":["../../src/tools/create-repo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;kBAgCrB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../github-api.js';
|
|
4
|
+
import { mapRepository, repositorySchema } from './schemas.js';
|
|
5
|
+
export const createRepo = defineTool({
|
|
6
|
+
name: 'create_repo',
|
|
7
|
+
displayName: 'Create Repository',
|
|
8
|
+
description: 'Create a new repository for the authenticated user.',
|
|
9
|
+
summary: 'Create a new repository',
|
|
10
|
+
icon: 'plus-circle',
|
|
11
|
+
group: 'Repositories',
|
|
12
|
+
input: z.object({
|
|
13
|
+
name: z.string().min(1).describe('Repository name'),
|
|
14
|
+
description: z.string().optional().describe('Short description of the repository'),
|
|
15
|
+
private: z.boolean().optional().describe('Whether the repository is private (default: false)'),
|
|
16
|
+
auto_init: z.boolean().optional().describe('Initialize with a README (default: false)'),
|
|
17
|
+
gitignore_template: z.string().optional().describe('Gitignore template name (e.g., "Node", "Python")'),
|
|
18
|
+
license_template: z.string().optional().describe('License template (e.g., "mit", "apache-2.0")'),
|
|
19
|
+
}),
|
|
20
|
+
output: z.object({
|
|
21
|
+
repository: repositorySchema.describe('The created repository'),
|
|
22
|
+
}),
|
|
23
|
+
handle: async (params) => {
|
|
24
|
+
const body = { name: params.name };
|
|
25
|
+
if (params.description !== undefined)
|
|
26
|
+
body.description = params.description;
|
|
27
|
+
if (params.private !== undefined)
|
|
28
|
+
body.private = params.private;
|
|
29
|
+
if (params.auto_init !== undefined)
|
|
30
|
+
body.auto_init = params.auto_init;
|
|
31
|
+
if (params.gitignore_template !== undefined)
|
|
32
|
+
body.gitignore_template = params.gitignore_template;
|
|
33
|
+
if (params.license_template !== undefined)
|
|
34
|
+
body.license_template = params.license_template;
|
|
35
|
+
const data = await api('/user/repos', {
|
|
36
|
+
method: 'POST',
|
|
37
|
+
body,
|
|
38
|
+
});
|
|
39
|
+
return { repository: mapRepository(data) };
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=create-repo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-repo.js","sourceRoot":"","sources":["../../src/tools/create-repo.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,kBAAkB,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAE/D,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC;IACnC,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,qDAAqD;IAClE,OAAO,EAAE,yBAAyB;IAClC,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,cAAc;IACrB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC;QACnD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;QAClF,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oDAAoD,CAAC;QAC9F,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC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{ z } from 'zod';
|
|
2
|
+
export declare const deleteFile: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
owner: z.ZodString;
|
|
4
|
+
repo: z.ZodString;
|
|
5
|
+
path: z.ZodString;
|
|
6
|
+
message: z.ZodString;
|
|
7
|
+
sha: z.ZodString;
|
|
8
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
10
|
+
commit: z.ZodObject<{
|
|
11
|
+
sha: z.ZodString;
|
|
12
|
+
message: z.ZodString;
|
|
13
|
+
url: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
//# sourceMappingURL=delete-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-file.d.ts","sourceRoot":"","sources":["../../src/tools/delete-file.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;kBAuCrB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../github-api.js';
|
|
4
|
+
const deleteCommitSchema = z.object({
|
|
5
|
+
sha: z.string().describe('Commit SHA'),
|
|
6
|
+
message: z.string().describe('Commit message'),
|
|
7
|
+
url: z.string().describe('URL to the commit on GitHub'),
|
|
8
|
+
});
|
|
9
|
+
export const deleteFile = defineTool({
|
|
10
|
+
name: 'delete_file',
|
|
11
|
+
displayName: 'Delete File',
|
|
12
|
+
description: 'Delete a file from a repository. Requires the current file SHA (obtainable from the contents API). Commits directly to the specified branch.',
|
|
13
|
+
summary: 'Delete a file from a repository',
|
|
14
|
+
icon: 'file-x',
|
|
15
|
+
group: 'Repositories',
|
|
16
|
+
input: z.object({
|
|
17
|
+
owner: z.string().min(1).describe('Repository owner (user or org)'),
|
|
18
|
+
repo: z.string().min(1).describe('Repository name'),
|
|
19
|
+
path: z.string().min(1).describe('File path relative to repository root'),
|
|
20
|
+
message: z.string().min(1).describe('Commit message for the deletion'),
|
|
21
|
+
sha: z.string().min(1).describe('SHA of the file being deleted — required to prevent accidental overwrites'),
|
|
22
|
+
branch: z.string().optional().describe('Branch to commit to (defaults to the default branch)'),
|
|
23
|
+
}),
|
|
24
|
+
output: z.object({
|
|
25
|
+
commit: deleteCommitSchema.describe('The commit created by the deletion'),
|
|
26
|
+
}),
|
|
27
|
+
handle: async (params) => {
|
|
28
|
+
const body = {
|
|
29
|
+
message: params.message,
|
|
30
|
+
sha: params.sha,
|
|
31
|
+
};
|
|
32
|
+
if (params.branch !== undefined)
|
|
33
|
+
body.branch = params.branch;
|
|
34
|
+
const encodedPath = params.path.split('/').map(encodeURIComponent).join('/');
|
|
35
|
+
const data = await api(`/repos/${params.owner}/${params.repo}/contents/${encodedPath}`, {
|
|
36
|
+
method: 'DELETE',
|
|
37
|
+
body,
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
commit: {
|
|
41
|
+
sha: data.commit?.sha ?? '',
|
|
42
|
+
message: data.commit?.message ?? '',
|
|
43
|
+
url: data.commit?.html_url ?? '',
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=delete-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-file.js","sourceRoot":"","sources":["../../src/tools/delete-file.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,kBAAkB,CAAC;AAEvC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,GAAG,EAAE,CAAC,CAAC,MA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,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAA4B;YACpC,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,GAAG,EAAE,MAAM,CAAC,GAAG;SAChB,CAAC;QACF,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS;YAAE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAE7D,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7E,MAAM,IAAI,GAAG,MAAM,GAAG,CAAoB,UAAU,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,aAAa,WAAW,EAAE,EAAE;YACzG,MAAM,EAAE,QAAQ;YAChB,IAAI;SACL,CAAC,CAAC;QACH,OAAO;YACL,MAAM,EAAE;gBACN,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,EAAE;gBAC3B,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,IAAI,EAAE;gBACnC,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,IAAI,EAAE;aACjC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const getFileContent: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
owner: z.ZodString;
|
|
4
|
+
repo: z.ZodString;
|
|
5
|
+
path: z.ZodString;
|
|
6
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8
|
+
content: z.ZodString;
|
|
9
|
+
path: z.ZodString;
|
|
10
|
+
}, z.core.$strip>>;
|
|
11
|
+
//# sourceMappingURL=get-file-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-file-content.d.ts","sourceRoot":"","sources":["../../src/tools/get-file-content.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,cAAc;;;;;;;;kBA6BzB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { apiRaw } from '../github-api.js';
|
|
4
|
+
export const getFileContent = defineTool({
|
|
5
|
+
name: 'get_file_content',
|
|
6
|
+
displayName: 'Get File Content',
|
|
7
|
+
description: 'Read a file from a repository. Returns the raw content as text. Use the ref parameter to read from a specific branch or commit.',
|
|
8
|
+
summary: 'Read a file from a repository',
|
|
9
|
+
icon: 'file-text',
|
|
10
|
+
group: 'Repositories',
|
|
11
|
+
input: z.object({
|
|
12
|
+
owner: z.string().min(1).describe('Repository owner (user or org)'),
|
|
13
|
+
repo: z.string().min(1).describe('Repository name'),
|
|
14
|
+
path: z.string().min(1).describe('File path relative to repository root (e.g., "src/index.ts")'),
|
|
15
|
+
ref: z.string().optional().describe('Branch name, tag, or commit SHA (defaults to the default branch)'),
|
|
16
|
+
}),
|
|
17
|
+
output: z.object({
|
|
18
|
+
content: z.string().describe('Raw file content as text'),
|
|
19
|
+
path: z.string().describe('File path'),
|
|
20
|
+
}),
|
|
21
|
+
handle: async (params) => {
|
|
22
|
+
const query = {};
|
|
23
|
+
if (params.ref)
|
|
24
|
+
query.ref = params.ref;
|
|
25
|
+
const encodedPath = params.path.split('/').map(encodeURIComponent).join('/');
|
|
26
|
+
const content = await apiRaw(`/repos/${params.owner}/${params.repo}/contents/${encodedPath}`, {
|
|
27
|
+
query,
|
|
28
|
+
accept: 'application/vnd.github.raw+json',
|
|
29
|
+
});
|
|
30
|
+
return { content, path: params.path };
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=get-file-content.js.map
|
|
@@ -0,0 +1 @@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CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;QAEvC,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7E,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,UAAU,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,aAAa,WAAW,EAAE,EAAE;YAC5F,KAAK;YACL,MAAM,EAAE,iCAAiC;SAC1C,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;IACxC,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const getIssue: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
owner: z.ZodString;
|
|
4
|
+
repo: z.ZodString;
|
|
5
|
+
issue_number: z.ZodNumber;
|
|
6
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7
|
+
issue: z.ZodObject<{
|
|
8
|
+
number: z.ZodNumber;
|
|
9
|
+
title: z.ZodString;
|
|
10
|
+
state: z.ZodString;
|
|
11
|
+
body: z.ZodString;
|
|
12
|
+
html_url: z.ZodString;
|
|
13
|
+
user_login: z.ZodString;
|
|
14
|
+
labels: z.ZodArray<z.ZodString>;
|
|
15
|
+
assignees: z.ZodArray<z.ZodString>;
|
|
16
|
+
comments: z.ZodNumber;
|
|
17
|
+
created_at: z.ZodString;
|
|
18
|
+
updated_at: z.ZodString;
|
|
19
|
+
closed_at: z.ZodString;
|
|
20
|
+
is_pull_request: z.ZodBoolean;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
}, z.core.$strip>>;
|
|
23
|
+
//# sourceMappingURL=get-issue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-issue.d.ts","sourceRoot":"","sources":["../../src/tools/get-issue.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;kBAqBnB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../github-api.js';
|
|
4
|
+
import { issueSchema, mapIssue } from './schemas.js';
|
|
5
|
+
export const getIssue = defineTool({
|
|
6
|
+
name: 'get_issue',
|
|
7
|
+
displayName: 'Get Issue',
|
|
8
|
+
description: 'Get detailed information about a specific issue, including its full body.',
|
|
9
|
+
summary: 'Get details of a specific issue',
|
|
10
|
+
icon: 'circle-dot',
|
|
11
|
+
group: 'Issues',
|
|
12
|
+
input: z.object({
|
|
13
|
+
owner: z.string().min(1).describe('Repository owner (user or org)'),
|
|
14
|
+
repo: z.string().min(1).describe('Repository name'),
|
|
15
|
+
issue_number: z.number().int().min(1).describe('Issue number'),
|
|
16
|
+
}),
|
|
17
|
+
output: z.object({
|
|
18
|
+
issue: issueSchema.describe('Issue details'),
|
|
19
|
+
}),
|
|
20
|
+
handle: async (params) => {
|
|
21
|
+
const data = await api(`/repos/${params.owner}/${params.repo}/issues/${params.issue_number}`);
|
|
22
|
+
return { issue: mapIssue(data) };
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=get-issue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-issue.js","sourceRoot":"","sources":["../../src/tools/get-issue.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,kBAAkB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAErD,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;IACjC,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,2EAA2E;IACxF,OAAO,EAAE,iCAAiC;IAC1C,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,gCAAgC,CAAC;QACnE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC;QACnD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC;KAC/D,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,eAAe,CAAC;KAC7C,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,GAAG,CACpB,UAAU,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,WAAW,MAAM,CAAC,YAAY,EAAE,CACtE,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;IACnC,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const getPullRequestDiff: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
owner: z.ZodString;
|
|
4
|
+
repo: z.ZodString;
|
|
5
|
+
pull_number: z.ZodNumber;
|
|
6
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7
|
+
diff: z.ZodString;
|
|
8
|
+
}, z.core.$strip>>;
|
|
9
|
+
//# sourceMappingURL=get-pull-request-diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-pull-request-diff.d.ts","sourceRoot":"","sources":["../../src/tools/get-pull-request-diff.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,kBAAkB;;;;;;kBAqB7B,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { apiRaw } from '../github-api.js';
|
|
4
|
+
export const getPullRequestDiff = defineTool({
|
|
5
|
+
name: 'get_pull_request_diff',
|
|
6
|
+
displayName: 'Get Pull Request Diff',
|
|
7
|
+
description: 'Get the raw diff of a pull request. Returns the unified diff text for all changed files.',
|
|
8
|
+
summary: 'Get the raw diff of a pull request',
|
|
9
|
+
icon: 'file-diff',
|
|
10
|
+
group: 'Pull Requests',
|
|
11
|
+
input: z.object({
|
|
12
|
+
owner: z.string().min(1).describe('Repository owner (user or org)'),
|
|
13
|
+
repo: z.string().min(1).describe('Repository name'),
|
|
14
|
+
pull_number: z.number().int().min(1).describe('Pull request number'),
|
|
15
|
+
}),
|
|
16
|
+
output: z.object({
|
|
17
|
+
diff: z.string().describe('Raw unified diff text'),
|
|
18
|
+
}),
|
|
19
|
+
handle: async (params) => {
|
|
20
|
+
const diff = await apiRaw(`/repos/${params.owner}/${params.repo}/pulls/${params.pull_number}`, {
|
|
21
|
+
accept: 'application/vnd.github.diff',
|
|
22
|
+
});
|
|
23
|
+
return { diff };
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=get-pull-request-diff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-pull-request-diff.js","source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@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const getPullRequest: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
owner: z.ZodString;
|
|
4
|
+
repo: z.ZodString;
|
|
5
|
+
pull_number: z.ZodNumber;
|
|
6
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7
|
+
pull_request: z.ZodObject<{
|
|
8
|
+
number: z.ZodNumber;
|
|
9
|
+
title: z.ZodString;
|
|
10
|
+
state: z.ZodString;
|
|
11
|
+
body: z.ZodString;
|
|
12
|
+
html_url: z.ZodString;
|
|
13
|
+
user_login: z.ZodString;
|
|
14
|
+
head_ref: z.ZodString;
|
|
15
|
+
base_ref: z.ZodString;
|
|
16
|
+
labels: z.ZodArray<z.ZodString>;
|
|
17
|
+
draft: z.ZodBoolean;
|
|
18
|
+
merged: z.ZodBoolean;
|
|
19
|
+
mergeable: z.ZodBoolean;
|
|
20
|
+
comments: z.ZodNumber;
|
|
21
|
+
commits: z.ZodNumber;
|
|
22
|
+
additions: z.ZodNumber;
|
|
23
|
+
deletions: z.ZodNumber;
|
|
24
|
+
changed_files: z.ZodNumber;
|
|
25
|
+
created_at: z.ZodString;
|
|
26
|
+
updated_at: z.ZodString;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
//# sourceMappingURL=get-pull-request.d.ts.map
|