@loopstack/github-module 0.1.0 → 0.2.1
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 +86 -5
- package/dist/tools/actions/github-get-workflow-run.tool.d.ts +11 -9
- package/dist/tools/actions/github-get-workflow-run.tool.d.ts.map +1 -1
- package/dist/tools/actions/github-get-workflow-run.tool.js +13 -18
- package/dist/tools/actions/github-get-workflow-run.tool.js.map +1 -1
- package/dist/tools/actions/github-list-workflow-runs.tool.d.ts +29 -12
- package/dist/tools/actions/github-list-workflow-runs.tool.d.ts.map +1 -1
- package/dist/tools/actions/github-list-workflow-runs.tool.js +33 -38
- package/dist/tools/actions/github-list-workflow-runs.tool.js.map +1 -1
- package/dist/tools/actions/github-trigger-workflow.tool.d.ts +13 -11
- package/dist/tools/actions/github-trigger-workflow.tool.d.ts.map +1 -1
- package/dist/tools/actions/github-trigger-workflow.tool.js +15 -20
- package/dist/tools/actions/github-trigger-workflow.tool.js.map +1 -1
- package/dist/tools/content/github-create-or-update-file.tool.d.ts +15 -13
- package/dist/tools/content/github-create-or-update-file.tool.d.ts.map +1 -1
- package/dist/tools/content/github-create-or-update-file.tool.js +17 -22
- package/dist/tools/content/github-create-or-update-file.tool.js.map +1 -1
- package/dist/tools/content/github-get-commit.tool.d.ts +11 -9
- package/dist/tools/content/github-get-commit.tool.d.ts.map +1 -1
- package/dist/tools/content/github-get-commit.tool.js +13 -18
- package/dist/tools/content/github-get-commit.tool.js.map +1 -1
- package/dist/tools/content/github-get-file-content.tool.d.ts +12 -10
- package/dist/tools/content/github-get-file-content.tool.d.ts.map +1 -1
- package/dist/tools/content/github-get-file-content.tool.js +14 -19
- package/dist/tools/content/github-get-file-content.tool.js.map +1 -1
- package/dist/tools/content/github-list-directory.tool.d.ts +12 -10
- package/dist/tools/content/github-list-directory.tool.d.ts.map +1 -1
- package/dist/tools/content/github-list-directory.tool.js +14 -19
- package/dist/tools/content/github-list-directory.tool.js.map +1 -1
- package/dist/tools/issues/github-create-issue-comment.tool.d.ts +12 -10
- package/dist/tools/issues/github-create-issue-comment.tool.d.ts.map +1 -1
- package/dist/tools/issues/github-create-issue-comment.tool.js +14 -19
- package/dist/tools/issues/github-create-issue-comment.tool.js.map +1 -1
- package/dist/tools/issues/github-create-issue.tool.d.ts +14 -12
- package/dist/tools/issues/github-create-issue.tool.d.ts.map +1 -1
- package/dist/tools/issues/github-create-issue.tool.js +16 -21
- package/dist/tools/issues/github-create-issue.tool.js.map +1 -1
- package/dist/tools/issues/github-get-issue.tool.d.ts +11 -9
- package/dist/tools/issues/github-get-issue.tool.d.ts.map +1 -1
- package/dist/tools/issues/github-get-issue.tool.js +13 -18
- package/dist/tools/issues/github-get-issue.tool.js.map +1 -1
- package/dist/tools/issues/github-list-issues.tool.d.ts +19 -13
- package/dist/tools/issues/github-list-issues.tool.d.ts.map +1 -1
- package/dist/tools/issues/github-list-issues.tool.js +17 -22
- package/dist/tools/issues/github-list-issues.tool.js.map +1 -1
- package/dist/tools/pull-requests/github-create-pull-request.tool.d.ts +15 -13
- package/dist/tools/pull-requests/github-create-pull-request.tool.d.ts.map +1 -1
- package/dist/tools/pull-requests/github-create-pull-request.tool.js +17 -22
- package/dist/tools/pull-requests/github-create-pull-request.tool.js.map +1 -1
- package/dist/tools/pull-requests/github-get-pull-request.tool.d.ts +11 -9
- package/dist/tools/pull-requests/github-get-pull-request.tool.d.ts.map +1 -1
- package/dist/tools/pull-requests/github-get-pull-request.tool.js +13 -18
- package/dist/tools/pull-requests/github-get-pull-request.tool.js.map +1 -1
- package/dist/tools/pull-requests/github-list-pr-reviews.tool.d.ts +11 -9
- package/dist/tools/pull-requests/github-list-pr-reviews.tool.d.ts.map +1 -1
- package/dist/tools/pull-requests/github-list-pr-reviews.tool.js +13 -18
- package/dist/tools/pull-requests/github-list-pr-reviews.tool.js.map +1 -1
- package/dist/tools/pull-requests/github-list-pull-requests.tool.d.ts +18 -12
- package/dist/tools/pull-requests/github-list-pull-requests.tool.d.ts.map +1 -1
- package/dist/tools/pull-requests/github-list-pull-requests.tool.js +16 -21
- package/dist/tools/pull-requests/github-list-pull-requests.tool.js.map +1 -1
- package/dist/tools/pull-requests/github-merge-pull-request.tool.d.ts +18 -12
- package/dist/tools/pull-requests/github-merge-pull-request.tool.d.ts.map +1 -1
- package/dist/tools/pull-requests/github-merge-pull-request.tool.js +16 -21
- package/dist/tools/pull-requests/github-merge-pull-request.tool.js.map +1 -1
- package/dist/tools/repos/github-create-repo.tool.d.ts +12 -10
- package/dist/tools/repos/github-create-repo.tool.d.ts.map +1 -1
- package/dist/tools/repos/github-create-repo.tool.js +14 -19
- package/dist/tools/repos/github-create-repo.tool.js.map +1 -1
- package/dist/tools/repos/github-get-repo.tool.d.ts +10 -8
- package/dist/tools/repos/github-get-repo.tool.d.ts.map +1 -1
- package/dist/tools/repos/github-get-repo.tool.js +12 -17
- package/dist/tools/repos/github-get-repo.tool.js.map +1 -1
- package/dist/tools/repos/github-list-branches.tool.d.ts +11 -9
- package/dist/tools/repos/github-list-branches.tool.d.ts.map +1 -1
- package/dist/tools/repos/github-list-branches.tool.js +13 -18
- package/dist/tools/repos/github-list-branches.tool.js.map +1 -1
- package/dist/tools/repos/github-list-repos.tool.d.ts +21 -10
- package/dist/tools/repos/github-list-repos.tool.d.ts.map +1 -1
- package/dist/tools/repos/github-list-repos.tool.js +14 -19
- package/dist/tools/repos/github-list-repos.tool.js.map +1 -1
- package/dist/tools/search/github-search-code.tool.d.ts +11 -9
- package/dist/tools/search/github-search-code.tool.d.ts.map +1 -1
- package/dist/tools/search/github-search-code.tool.js +13 -18
- package/dist/tools/search/github-search-code.tool.js.map +1 -1
- package/dist/tools/search/github-search-issues.tool.d.ts +20 -10
- package/dist/tools/search/github-search-issues.tool.d.ts.map +1 -1
- package/dist/tools/search/github-search-issues.tool.js +16 -21
- package/dist/tools/search/github-search-issues.tool.js.map +1 -1
- package/dist/tools/search/github-search-repos.tool.d.ts +17 -10
- package/dist/tools/search/github-search-repos.tool.d.ts.map +1 -1
- package/dist/tools/search/github-search-repos.tool.js +14 -19
- package/dist/tools/search/github-search-repos.tool.js.map +1 -1
- package/dist/tools/users/github-get-authenticated-user.tool.d.ts +7 -5
- package/dist/tools/users/github-get-authenticated-user.tool.d.ts.map +1 -1
- package/dist/tools/users/github-get-authenticated-user.tool.js +7 -12
- package/dist/tools/users/github-get-authenticated-user.tool.js.map +1 -1
- package/dist/tools/users/github-list-user-orgs.tool.d.ts +9 -7
- package/dist/tools/users/github-list-user-orgs.tool.d.ts.map +1 -1
- package/dist/tools/users/github-list-user-orgs.tool.js +11 -16
- package/dist/tools/users/github-list-user-orgs.tool.js.map +1 -1
- package/package.json +2 -2
- package/src/tools/actions/github-get-workflow-run.tool.ts +16 -22
- package/src/tools/actions/github-list-workflow-runs.tool.ts +36 -45
- package/src/tools/actions/github-trigger-workflow.tool.ts +18 -26
- package/src/tools/content/github-create-or-update-file.tool.ts +20 -30
- package/src/tools/content/github-get-commit.tool.ts +16 -22
- package/src/tools/content/github-get-file-content.tool.ts +17 -24
- package/src/tools/content/github-list-directory.tool.ts +17 -24
- package/src/tools/issues/github-create-issue-comment.tool.ts +17 -24
- package/src/tools/issues/github-create-issue.tool.ts +19 -28
- package/src/tools/issues/github-get-issue.tool.ts +16 -22
- package/src/tools/issues/github-list-issues.tool.ts +20 -30
- package/src/tools/pull-requests/github-create-pull-request.tool.ts +20 -30
- package/src/tools/pull-requests/github-get-pull-request.tool.ts +16 -22
- package/src/tools/pull-requests/github-list-pr-reviews.tool.ts +16 -22
- package/src/tools/pull-requests/github-list-pull-requests.tool.ts +19 -28
- package/src/tools/pull-requests/github-merge-pull-request.tool.ts +19 -28
- package/src/tools/repos/github-create-repo.tool.ts +17 -24
- package/src/tools/repos/github-get-repo.tool.ts +15 -20
- package/src/tools/repos/github-list-branches.tool.ts +16 -22
- package/src/tools/repos/github-list-repos.tool.ts +17 -24
- package/src/tools/search/github-search-code.tool.ts +16 -22
- package/src/tools/search/github-search-issues.tool.ts +19 -26
- package/src/tools/search/github-search-repos.tool.ts +17 -24
- package/src/tools/users/github-get-authenticated-user.tool.ts +10 -12
- package/src/tools/users/github-list-user-orgs.tool.ts +14 -18
|
@@ -15,12 +15,18 @@ const common_1 = require("@nestjs/common");
|
|
|
15
15
|
const zod_1 = require("zod");
|
|
16
16
|
const common_2 = require("@loopstack/common");
|
|
17
17
|
const oauth_module_1 = require("@loopstack/oauth-module");
|
|
18
|
-
|
|
18
|
+
const inputSchema = zod_1.z
|
|
19
|
+
.object({
|
|
20
|
+
owner: zod_1.z.string(),
|
|
21
|
+
repo: zod_1.z.string(),
|
|
22
|
+
issueNumber: zod_1.z.number(),
|
|
23
|
+
})
|
|
24
|
+
.strict();
|
|
25
|
+
let GitHubGetIssueTool = GitHubGetIssueTool_1 = class GitHubGetIssueTool extends common_2.BaseTool {
|
|
19
26
|
logger = new common_1.Logger(GitHubGetIssueTool_1.name);
|
|
20
27
|
tokenStore;
|
|
21
|
-
args
|
|
22
|
-
|
|
23
|
-
const accessToken = await this.tokenStore.getValidAccessToken(ctx.userId, 'github');
|
|
28
|
+
async call(args) {
|
|
29
|
+
const accessToken = await this.tokenStore.getValidAccessToken(this.ctx.context.userId, 'github');
|
|
24
30
|
if (!accessToken) {
|
|
25
31
|
return {
|
|
26
32
|
data: {
|
|
@@ -38,7 +44,7 @@ let GitHubGetIssueTool = GitHubGetIssueTool_1 = class GitHubGetIssueTool {
|
|
|
38
44
|
},
|
|
39
45
|
});
|
|
40
46
|
if (response.status === 401 || response.status === 403) {
|
|
41
|
-
this.logger.warn(`GitHub API returned ${response.status} for user ${ctx.userId}`);
|
|
47
|
+
this.logger.warn(`GitHub API returned ${response.status} for user ${this.ctx.context.userId}`);
|
|
42
48
|
return {
|
|
43
49
|
data: {
|
|
44
50
|
error: '401',
|
|
@@ -84,23 +90,12 @@ __decorate([
|
|
|
84
90
|
(0, common_1.Inject)(),
|
|
85
91
|
__metadata("design:type", oauth_module_1.OAuthTokenStore)
|
|
86
92
|
], GitHubGetIssueTool.prototype, "tokenStore", void 0);
|
|
87
|
-
__decorate([
|
|
88
|
-
(0, common_2.Input)({
|
|
89
|
-
schema: zod_1.z
|
|
90
|
-
.object({
|
|
91
|
-
owner: zod_1.z.string(),
|
|
92
|
-
repo: zod_1.z.string(),
|
|
93
|
-
issueNumber: zod_1.z.number(),
|
|
94
|
-
})
|
|
95
|
-
.strict(),
|
|
96
|
-
}),
|
|
97
|
-
__metadata("design:type", Object)
|
|
98
|
-
], GitHubGetIssueTool.prototype, "args", void 0);
|
|
99
93
|
exports.GitHubGetIssueTool = GitHubGetIssueTool = GitHubGetIssueTool_1 = __decorate([
|
|
100
94
|
(0, common_2.Tool)({
|
|
101
|
-
|
|
95
|
+
uiConfig: {
|
|
102
96
|
description: 'Gets detailed information about a specific GitHub issue. Returns { error: "unauthorized" } if no valid token is available.',
|
|
103
97
|
},
|
|
98
|
+
schema: inputSchema,
|
|
104
99
|
})
|
|
105
100
|
], GitHubGetIssueTool);
|
|
106
101
|
//# sourceMappingURL=github-get-issue.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-get-issue.tool.js","sourceRoot":"","sources":["../../../src/tools/issues/github-get-issue.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAgD;AAChD,6BAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"github-get-issue.tool.js","sourceRoot":"","sources":["../../../src/tools/issues/github-get-issue.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAgD;AAChD,6BAAwB;AACxB,8CAA+D;AAC/D,0DAA0D;AAE1D,MAAM,WAAW,GAAG,OAAC;KAClB,MAAM,CAAC;IACN,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE;CACxB,CAAC;KACD,MAAM,EAAE,CAAC;AAWL,IAA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A,aAAI,EAAC;QACJ,QAAQ,EAAE;YACR,WAAW,EACT,4HAA4H;SAC/H;QACD,MAAM,EAAE,WAAW;KACpB,CAAC;GACW,kBAAkB,CAsF9B"}
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseTool, ToolResult } from '@loopstack/common';
|
|
3
|
+
declare const inputSchema: z.ZodObject<{
|
|
4
|
+
owner: z.ZodString;
|
|
5
|
+
repo: z.ZodString;
|
|
6
|
+
state: z.ZodDefault<z.ZodEnum<{
|
|
7
|
+
open: "open";
|
|
8
|
+
closed: "closed";
|
|
9
|
+
all: "all";
|
|
10
|
+
}>>;
|
|
11
|
+
labels: z.ZodOptional<z.ZodString>;
|
|
12
|
+
assignee: z.ZodOptional<z.ZodString>;
|
|
13
|
+
perPage: z.ZodDefault<z.ZodNumber>;
|
|
14
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
15
|
+
}, z.core.$strict>;
|
|
16
|
+
export type GitHubListIssuesArgs = z.input<typeof inputSchema>;
|
|
17
|
+
export declare class GitHubListIssuesTool extends BaseTool {
|
|
12
18
|
private readonly logger;
|
|
13
19
|
private tokenStore;
|
|
14
|
-
args: GitHubListIssuesArgs
|
|
15
|
-
execute(args: GitHubListIssuesArgs, ctx: RunContext): Promise<ToolResult>;
|
|
20
|
+
call(args: GitHubListIssuesArgs): Promise<ToolResult>;
|
|
16
21
|
}
|
|
22
|
+
export {};
|
|
17
23
|
//# sourceMappingURL=github-list-issues.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-list-issues.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/issues/github-list-issues.tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github-list-issues.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/issues/github-list-issues.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAQ,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/D,QAAA,MAAM,WAAW;;;;;;;;;;;;kBAUN,CAAC;AAEZ,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAE/D,qBAOa,oBAAqB,SAAQ,QAAQ;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyC;IAGhE,OAAO,CAAC,UAAU,CAAkB;IAE9B,IAAI,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC;CAmF5D"}
|
|
@@ -15,12 +15,22 @@ const common_1 = require("@nestjs/common");
|
|
|
15
15
|
const zod_1 = require("zod");
|
|
16
16
|
const common_2 = require("@loopstack/common");
|
|
17
17
|
const oauth_module_1 = require("@loopstack/oauth-module");
|
|
18
|
-
|
|
18
|
+
const inputSchema = zod_1.z
|
|
19
|
+
.object({
|
|
20
|
+
owner: zod_1.z.string(),
|
|
21
|
+
repo: zod_1.z.string(),
|
|
22
|
+
state: zod_1.z.enum(['open', 'closed', 'all']).default('open'),
|
|
23
|
+
labels: zod_1.z.string().optional(),
|
|
24
|
+
assignee: zod_1.z.string().optional(),
|
|
25
|
+
perPage: zod_1.z.number().default(30),
|
|
26
|
+
page: zod_1.z.number().default(1),
|
|
27
|
+
})
|
|
28
|
+
.strict();
|
|
29
|
+
let GitHubListIssuesTool = GitHubListIssuesTool_1 = class GitHubListIssuesTool extends common_2.BaseTool {
|
|
19
30
|
logger = new common_1.Logger(GitHubListIssuesTool_1.name);
|
|
20
31
|
tokenStore;
|
|
21
|
-
args
|
|
22
|
-
|
|
23
|
-
const accessToken = await this.tokenStore.getValidAccessToken(ctx.userId, 'github');
|
|
32
|
+
async call(args) {
|
|
33
|
+
const accessToken = await this.tokenStore.getValidAccessToken(this.ctx.context.userId, 'github');
|
|
24
34
|
if (!accessToken) {
|
|
25
35
|
return {
|
|
26
36
|
data: {
|
|
@@ -47,7 +57,7 @@ let GitHubListIssuesTool = GitHubListIssuesTool_1 = class GitHubListIssuesTool {
|
|
|
47
57
|
},
|
|
48
58
|
});
|
|
49
59
|
if (response.status === 401 || response.status === 403) {
|
|
50
|
-
this.logger.warn(`GitHub API returned ${response.status} for user ${ctx.userId}`);
|
|
60
|
+
this.logger.warn(`GitHub API returned ${response.status} for user ${this.ctx.context.userId}`);
|
|
51
61
|
return {
|
|
52
62
|
data: {
|
|
53
63
|
error: '401',
|
|
@@ -89,27 +99,12 @@ __decorate([
|
|
|
89
99
|
(0, common_1.Inject)(),
|
|
90
100
|
__metadata("design:type", oauth_module_1.OAuthTokenStore)
|
|
91
101
|
], GitHubListIssuesTool.prototype, "tokenStore", void 0);
|
|
92
|
-
__decorate([
|
|
93
|
-
(0, common_2.Input)({
|
|
94
|
-
schema: zod_1.z
|
|
95
|
-
.object({
|
|
96
|
-
owner: zod_1.z.string(),
|
|
97
|
-
repo: zod_1.z.string(),
|
|
98
|
-
state: zod_1.z.enum(['open', 'closed', 'all']).default('open'),
|
|
99
|
-
labels: zod_1.z.string().optional(),
|
|
100
|
-
assignee: zod_1.z.string().optional(),
|
|
101
|
-
perPage: zod_1.z.number().default(30),
|
|
102
|
-
page: zod_1.z.number().default(1),
|
|
103
|
-
})
|
|
104
|
-
.strict(),
|
|
105
|
-
}),
|
|
106
|
-
__metadata("design:type", Object)
|
|
107
|
-
], GitHubListIssuesTool.prototype, "args", void 0);
|
|
108
102
|
exports.GitHubListIssuesTool = GitHubListIssuesTool = GitHubListIssuesTool_1 = __decorate([
|
|
109
103
|
(0, common_2.Tool)({
|
|
110
|
-
|
|
104
|
+
uiConfig: {
|
|
111
105
|
description: 'Lists issues for a GitHub repository. Note: the GitHub API returns both issues and pull requests; pull requests have a pull_request key. Returns { error: "unauthorized" } if no valid token is available.',
|
|
112
106
|
},
|
|
107
|
+
schema: inputSchema,
|
|
113
108
|
})
|
|
114
109
|
], GitHubListIssuesTool);
|
|
115
110
|
//# sourceMappingURL=github-list-issues.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-list-issues.tool.js","sourceRoot":"","sources":["../../../src/tools/issues/github-list-issues.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAgD;AAChD,6BAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"github-list-issues.tool.js","sourceRoot":"","sources":["../../../src/tools/issues/github-list-issues.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAgD;AAChD,6BAAwB;AACxB,8CAA+D;AAC/D,0DAA0D;AAE1D,MAAM,WAAW,GAAG,OAAC;KAClB,MAAM,CAAC;IACN,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACxD,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC/B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;CAC5B,CAAC;KACD,MAAM,EAAE,CAAC;AAWL,IAAM,oBAAoB,4BAA1B,MAAM,oBAAqB,SAAQ,iBAAQ;IAC/B,MAAM,GAAG,IAAI,eAAM,CAAC,sBAAoB,CAAC,IAAI,CAAC,CAAC;IAGxD,UAAU,CAAkB;IAEpC,KAAK,CAAC,IAA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C,QAAQ;YACvB,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY;SACpC,CAAC,CAAC,CAAC;QAEJ,OAAO;YACL,IAAI,EAAE,EAAE,MAAM,EAAE;SACjB,CAAC;IACJ,CAAC;CACF,CAAA;AAzFY,oDAAoB;AAIvB;IADP,IAAA,eAAM,GAAE;8BACW,8BAAe;wDAAC;+BAJzB,oBAAoB;IAPhC,IAAA,aAAI,EAAC;QACJ,QAAQ,EAAE;YACR,WAAW,EACT,4MAA4M;SAC/M;QACD,MAAM,EAAE,WAAW;KACpB,CAAC;GACW,oBAAoB,CAyFhC"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseTool, ToolResult } from '@loopstack/common';
|
|
3
|
+
declare const inputSchema: z.ZodObject<{
|
|
4
|
+
owner: z.ZodString;
|
|
5
|
+
repo: z.ZodString;
|
|
6
|
+
title: z.ZodString;
|
|
7
|
+
head: z.ZodString;
|
|
8
|
+
base: z.ZodString;
|
|
9
|
+
body: z.ZodOptional<z.ZodString>;
|
|
10
|
+
draft: z.ZodDefault<z.ZodBoolean>;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
export type GitHubCreatePullRequestArgs = z.input<typeof inputSchema>;
|
|
13
|
+
export declare class GitHubCreatePullRequestTool extends BaseTool {
|
|
12
14
|
private readonly logger;
|
|
13
15
|
private tokenStore;
|
|
14
|
-
args: GitHubCreatePullRequestArgs
|
|
15
|
-
execute(args: GitHubCreatePullRequestArgs, ctx: RunContext): Promise<ToolResult>;
|
|
16
|
+
call(args: GitHubCreatePullRequestArgs): Promise<ToolResult>;
|
|
16
17
|
}
|
|
18
|
+
export {};
|
|
17
19
|
//# sourceMappingURL=github-create-pull-request.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-create-pull-request.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/pull-requests/github-create-pull-request.tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github-create-pull-request.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/pull-requests/github-create-pull-request.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAQ,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/D,QAAA,MAAM,WAAW;;;;;;;;kBAUN,CAAC;AAEZ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtE,qBAOa,2BAA4B,SAAQ,QAAQ;IACvD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgD;IAGvE,OAAO,CAAC,UAAU,CAAkB;IAE9B,IAAI,CAAC,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,UAAU,CAAC;CA4EnE"}
|
|
@@ -15,12 +15,22 @@ const common_1 = require("@nestjs/common");
|
|
|
15
15
|
const zod_1 = require("zod");
|
|
16
16
|
const common_2 = require("@loopstack/common");
|
|
17
17
|
const oauth_module_1 = require("@loopstack/oauth-module");
|
|
18
|
-
|
|
18
|
+
const inputSchema = zod_1.z
|
|
19
|
+
.object({
|
|
20
|
+
owner: zod_1.z.string(),
|
|
21
|
+
repo: zod_1.z.string(),
|
|
22
|
+
title: zod_1.z.string(),
|
|
23
|
+
head: zod_1.z.string(),
|
|
24
|
+
base: zod_1.z.string(),
|
|
25
|
+
body: zod_1.z.string().optional(),
|
|
26
|
+
draft: zod_1.z.boolean().default(false),
|
|
27
|
+
})
|
|
28
|
+
.strict();
|
|
29
|
+
let GitHubCreatePullRequestTool = GitHubCreatePullRequestTool_1 = class GitHubCreatePullRequestTool extends common_2.BaseTool {
|
|
19
30
|
logger = new common_1.Logger(GitHubCreatePullRequestTool_1.name);
|
|
20
31
|
tokenStore;
|
|
21
|
-
args
|
|
22
|
-
|
|
23
|
-
const accessToken = await this.tokenStore.getValidAccessToken(ctx.userId, 'github');
|
|
32
|
+
async call(args) {
|
|
33
|
+
const accessToken = await this.tokenStore.getValidAccessToken(this.ctx.context.userId, 'github');
|
|
24
34
|
if (!accessToken) {
|
|
25
35
|
return {
|
|
26
36
|
data: {
|
|
@@ -49,7 +59,7 @@ let GitHubCreatePullRequestTool = GitHubCreatePullRequestTool_1 = class GitHubCr
|
|
|
49
59
|
body: JSON.stringify(requestBody),
|
|
50
60
|
});
|
|
51
61
|
if (response.status === 401 || response.status === 403) {
|
|
52
|
-
this.logger.warn(`GitHub API returned ${response.status} for user ${ctx.userId}`);
|
|
62
|
+
this.logger.warn(`GitHub API returned ${response.status} for user ${this.ctx.context.userId}`);
|
|
53
63
|
return {
|
|
54
64
|
data: {
|
|
55
65
|
error: '401',
|
|
@@ -87,27 +97,12 @@ __decorate([
|
|
|
87
97
|
(0, common_1.Inject)(),
|
|
88
98
|
__metadata("design:type", oauth_module_1.OAuthTokenStore)
|
|
89
99
|
], GitHubCreatePullRequestTool.prototype, "tokenStore", void 0);
|
|
90
|
-
__decorate([
|
|
91
|
-
(0, common_2.Input)({
|
|
92
|
-
schema: zod_1.z
|
|
93
|
-
.object({
|
|
94
|
-
owner: zod_1.z.string(),
|
|
95
|
-
repo: zod_1.z.string(),
|
|
96
|
-
title: zod_1.z.string(),
|
|
97
|
-
head: zod_1.z.string(),
|
|
98
|
-
base: zod_1.z.string(),
|
|
99
|
-
body: zod_1.z.string().optional(),
|
|
100
|
-
draft: zod_1.z.boolean().default(false),
|
|
101
|
-
})
|
|
102
|
-
.strict(),
|
|
103
|
-
}),
|
|
104
|
-
__metadata("design:type", Object)
|
|
105
|
-
], GitHubCreatePullRequestTool.prototype, "args", void 0);
|
|
106
100
|
exports.GitHubCreatePullRequestTool = GitHubCreatePullRequestTool = GitHubCreatePullRequestTool_1 = __decorate([
|
|
107
101
|
(0, common_2.Tool)({
|
|
108
|
-
|
|
102
|
+
uiConfig: {
|
|
109
103
|
description: 'Creates a new pull request in a GitHub repository. Returns { error: "unauthorized" } if no valid token is available.',
|
|
110
104
|
},
|
|
105
|
+
schema: inputSchema,
|
|
111
106
|
})
|
|
112
107
|
], GitHubCreatePullRequestTool);
|
|
113
108
|
//# sourceMappingURL=github-create-pull-request.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-create-pull-request.tool.js","sourceRoot":"","sources":["../../../src/tools/pull-requests/github-create-pull-request.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAgD;AAChD,6BAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"github-create-pull-request.tool.js","sourceRoot":"","sources":["../../../src/tools/pull-requests/github-create-pull-request.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAgD;AAChD,6BAAwB;AACxB,8CAA+D;AAC/D,0DAA0D;AAE1D,MAAM,WAAW,GAAG,OAAC;KAClB,MAAM,CAAC;IACN,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,KAAK,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CAClC,CAAC;KACD,MAAM,EAAE,CAAC;AAWL,IAAM,2BAA2B,mCAAjC,MAAM,2BAA4B,SAAQ,iBAAQ;IACtC,MAAM,GAAG,IAAI,eAAM,CAAC,6BAA2B,CAAC,IAAI,CAAC,CAAC;IAG/D,UAAU,CAAkB;IAEpC,KAAK,CAA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, ToolResult } from '@loopstack/common';
|
|
3
|
+
declare const inputSchema: z.ZodObject<{
|
|
4
|
+
owner: z.ZodString;
|
|
5
|
+
repo: z.ZodString;
|
|
6
|
+
pullNumber: z.ZodNumber;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
export type GitHubGetPullRequestArgs = z.infer<typeof inputSchema>;
|
|
9
|
+
export declare class GitHubGetPullRequestTool extends BaseTool {
|
|
8
10
|
private readonly logger;
|
|
9
11
|
private tokenStore;
|
|
10
|
-
args: GitHubGetPullRequestArgs
|
|
11
|
-
execute(args: GitHubGetPullRequestArgs, ctx: RunContext): Promise<ToolResult>;
|
|
12
|
+
call(args: GitHubGetPullRequestArgs): Promise<ToolResult>;
|
|
12
13
|
}
|
|
14
|
+
export {};
|
|
13
15
|
//# sourceMappingURL=github-get-pull-request.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-get-pull-request.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/pull-requests/github-get-pull-request.tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github-get-pull-request.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/pull-requests/github-get-pull-request.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAQ,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/D,QAAA,MAAM,WAAW;;;;kBAMN,CAAC;AAEZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEnE,qBAOa,wBAAyB,SAAQ,QAAQ;IACpD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6C;IAGpE,OAAO,CAAC,UAAU,CAAkB;IAE9B,IAAI,CAAC,IAAI,EAAE,wBAAwB,GAAG,OAAO,CAAC,UAAU,CAAC;CA6FhE"}
|
|
@@ -15,12 +15,18 @@ const common_1 = require("@nestjs/common");
|
|
|
15
15
|
const zod_1 = require("zod");
|
|
16
16
|
const common_2 = require("@loopstack/common");
|
|
17
17
|
const oauth_module_1 = require("@loopstack/oauth-module");
|
|
18
|
-
|
|
18
|
+
const inputSchema = zod_1.z
|
|
19
|
+
.object({
|
|
20
|
+
owner: zod_1.z.string(),
|
|
21
|
+
repo: zod_1.z.string(),
|
|
22
|
+
pullNumber: zod_1.z.number(),
|
|
23
|
+
})
|
|
24
|
+
.strict();
|
|
25
|
+
let GitHubGetPullRequestTool = GitHubGetPullRequestTool_1 = class GitHubGetPullRequestTool extends common_2.BaseTool {
|
|
19
26
|
logger = new common_1.Logger(GitHubGetPullRequestTool_1.name);
|
|
20
27
|
tokenStore;
|
|
21
|
-
args
|
|
22
|
-
|
|
23
|
-
const accessToken = await this.tokenStore.getValidAccessToken(ctx.userId, 'github');
|
|
28
|
+
async call(args) {
|
|
29
|
+
const accessToken = await this.tokenStore.getValidAccessToken(this.ctx.context.userId, 'github');
|
|
24
30
|
if (!accessToken) {
|
|
25
31
|
return {
|
|
26
32
|
data: {
|
|
@@ -38,7 +44,7 @@ let GitHubGetPullRequestTool = GitHubGetPullRequestTool_1 = class GitHubGetPullR
|
|
|
38
44
|
},
|
|
39
45
|
});
|
|
40
46
|
if (response.status === 401 || response.status === 403) {
|
|
41
|
-
this.logger.warn(`GitHub API returned ${response.status} for user ${ctx.userId}`);
|
|
47
|
+
this.logger.warn(`GitHub API returned ${response.status} for user ${this.ctx.context.userId}`);
|
|
42
48
|
return {
|
|
43
49
|
data: {
|
|
44
50
|
error: '401',
|
|
@@ -91,23 +97,12 @@ __decorate([
|
|
|
91
97
|
(0, common_1.Inject)(),
|
|
92
98
|
__metadata("design:type", oauth_module_1.OAuthTokenStore)
|
|
93
99
|
], GitHubGetPullRequestTool.prototype, "tokenStore", void 0);
|
|
94
|
-
__decorate([
|
|
95
|
-
(0, common_2.Input)({
|
|
96
|
-
schema: zod_1.z
|
|
97
|
-
.object({
|
|
98
|
-
owner: zod_1.z.string(),
|
|
99
|
-
repo: zod_1.z.string(),
|
|
100
|
-
pullNumber: zod_1.z.number(),
|
|
101
|
-
})
|
|
102
|
-
.strict(),
|
|
103
|
-
}),
|
|
104
|
-
__metadata("design:type", Object)
|
|
105
|
-
], GitHubGetPullRequestTool.prototype, "args", void 0);
|
|
106
100
|
exports.GitHubGetPullRequestTool = GitHubGetPullRequestTool = GitHubGetPullRequestTool_1 = __decorate([
|
|
107
101
|
(0, common_2.Tool)({
|
|
108
|
-
|
|
102
|
+
uiConfig: {
|
|
109
103
|
description: 'Gets detailed information about a specific GitHub pull request. Returns { error: "unauthorized" } if no valid token is available.',
|
|
110
104
|
},
|
|
105
|
+
schema: inputSchema,
|
|
111
106
|
})
|
|
112
107
|
], GitHubGetPullRequestTool);
|
|
113
108
|
//# sourceMappingURL=github-get-pull-request.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-get-pull-request.tool.js","sourceRoot":"","sources":["../../../src/tools/pull-requests/github-get-pull-request.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAgD;AAChD,6BAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"github-get-pull-request.tool.js","sourceRoot":"","sources":["../../../src/tools/pull-requests/github-get-pull-request.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAgD;AAChD,6BAAwB;AACxB,8CAA+D;AAC/D,0DAA0D;AAE1D,MAAM,WAAW,GAAG,OAAC;KAClB,MAAM,CAAC;IACN,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;CACvB,CAAC;KACD,MAAM,EAAE,CAAC;AAWL,IAAM,wBAAwB,gCAA9B,MAAM,wBAAyB,SAAQ,iBAAQ;IACnC,MAAM,GAAG,IAAI,eAAM,CAAC,0BAAwB,CAAC,IAAI,CAAC,CAAC;I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AAA,aAAI,EAAC;QACJ,QAAQ,EAAE;YACR,WAAW,EACT,mIAAmI;SACtI;QACD,MAAM,EAAE,WAAW;KACpB,CAAC;GACW,wBAAwB,CAmGpC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseTool, ToolResult } from '@loopstack/common';
|
|
3
|
+
declare const inputSchema: z.ZodObject<{
|
|
4
|
+
owner: z.ZodString;
|
|
5
|
+
repo: z.ZodString;
|
|
6
|
+
pullNumber: z.ZodNumber;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
export type GitHubListPrReviewsArgs = z.infer<typeof inputSchema>;
|
|
9
|
+
export declare class GitHubListPrReviewsTool extends BaseTool {
|
|
8
10
|
private readonly logger;
|
|
9
11
|
private tokenStore;
|
|
10
|
-
args: GitHubListPrReviewsArgs
|
|
11
|
-
execute(args: GitHubListPrReviewsArgs, ctx: RunContext): Promise<ToolResult>;
|
|
12
|
+
call(args: GitHubListPrReviewsArgs): Promise<ToolResult>;
|
|
12
13
|
}
|
|
14
|
+
export {};
|
|
13
15
|
//# sourceMappingURL=github-list-pr-reviews.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-list-pr-reviews.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/pull-requests/github-list-pr-reviews.tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github-list-pr-reviews.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/pull-requests/github-list-pr-reviews.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAQ,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/D,QAAA,MAAM,WAAW;;;;kBAMN,CAAC;AAEZ,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAElE,qBAOa,uBAAwB,SAAQ,QAAQ;IACnD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4C;IAGnE,OAAO,CAAC,UAAU,CAAkB;IAE9B,IAAI,CAAC,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC;CAgE/D"}
|
|
@@ -15,12 +15,18 @@ const common_1 = require("@nestjs/common");
|
|
|
15
15
|
const zod_1 = require("zod");
|
|
16
16
|
const common_2 = require("@loopstack/common");
|
|
17
17
|
const oauth_module_1 = require("@loopstack/oauth-module");
|
|
18
|
-
|
|
18
|
+
const inputSchema = zod_1.z
|
|
19
|
+
.object({
|
|
20
|
+
owner: zod_1.z.string(),
|
|
21
|
+
repo: zod_1.z.string(),
|
|
22
|
+
pullNumber: zod_1.z.number(),
|
|
23
|
+
})
|
|
24
|
+
.strict();
|
|
25
|
+
let GitHubListPrReviewsTool = GitHubListPrReviewsTool_1 = class GitHubListPrReviewsTool extends common_2.BaseTool {
|
|
19
26
|
logger = new common_1.Logger(GitHubListPrReviewsTool_1.name);
|
|
20
27
|
tokenStore;
|
|
21
|
-
args
|
|
22
|
-
|
|
23
|
-
const accessToken = await this.tokenStore.getValidAccessToken(ctx.userId, 'github');
|
|
28
|
+
async call(args) {
|
|
29
|
+
const accessToken = await this.tokenStore.getValidAccessToken(this.ctx.context.userId, 'github');
|
|
24
30
|
if (!accessToken) {
|
|
25
31
|
return {
|
|
26
32
|
data: {
|
|
@@ -38,7 +44,7 @@ let GitHubListPrReviewsTool = GitHubListPrReviewsTool_1 = class GitHubListPrRevi
|
|
|
38
44
|
},
|
|
39
45
|
});
|
|
40
46
|
if (response.status === 401 || response.status === 403) {
|
|
41
|
-
this.logger.warn(`GitHub API returned ${response.status} for user ${ctx.userId}`);
|
|
47
|
+
this.logger.warn(`GitHub API returned ${response.status} for user ${this.ctx.context.userId}`);
|
|
42
48
|
return {
|
|
43
49
|
data: {
|
|
44
50
|
error: '401',
|
|
@@ -75,23 +81,12 @@ __decorate([
|
|
|
75
81
|
(0, common_1.Inject)(),
|
|
76
82
|
__metadata("design:type", oauth_module_1.OAuthTokenStore)
|
|
77
83
|
], GitHubListPrReviewsTool.prototype, "tokenStore", void 0);
|
|
78
|
-
__decorate([
|
|
79
|
-
(0, common_2.Input)({
|
|
80
|
-
schema: zod_1.z
|
|
81
|
-
.object({
|
|
82
|
-
owner: zod_1.z.string(),
|
|
83
|
-
repo: zod_1.z.string(),
|
|
84
|
-
pullNumber: zod_1.z.number(),
|
|
85
|
-
})
|
|
86
|
-
.strict(),
|
|
87
|
-
}),
|
|
88
|
-
__metadata("design:type", Object)
|
|
89
|
-
], GitHubListPrReviewsTool.prototype, "args", void 0);
|
|
90
84
|
exports.GitHubListPrReviewsTool = GitHubListPrReviewsTool = GitHubListPrReviewsTool_1 = __decorate([
|
|
91
85
|
(0, common_2.Tool)({
|
|
92
|
-
|
|
86
|
+
uiConfig: {
|
|
93
87
|
description: 'Lists reviews on a GitHub pull request. Returns { error: "unauthorized" } if no valid token is available.',
|
|
94
88
|
},
|
|
89
|
+
schema: inputSchema,
|
|
95
90
|
})
|
|
96
91
|
], GitHubListPrReviewsTool);
|
|
97
92
|
//# sourceMappingURL=github-list-pr-reviews.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-list-pr-reviews.tool.js","sourceRoot":"","sources":["../../../src/tools/pull-requests/github-list-pr-reviews.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAgD;AAChD,6BAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"github-list-pr-reviews.tool.js","sourceRoot":"","sources":["../../../src/tools/pull-requests/github-list-pr-reviews.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAgD;AAChD,6BAAwB;AACxB,8CAA+D;AAC/D,0DAA0D;AAE1D,MAAM,WAAW,GAAG,OAAC;K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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseTool, ToolResult } from '@loopstack/common';
|
|
3
|
+
declare const inputSchema: z.ZodObject<{
|
|
4
|
+
owner: z.ZodString;
|
|
5
|
+
repo: z.ZodString;
|
|
6
|
+
state: z.ZodDefault<z.ZodEnum<{
|
|
7
|
+
open: "open";
|
|
8
|
+
closed: "closed";
|
|
9
|
+
all: "all";
|
|
10
|
+
}>>;
|
|
11
|
+
base: z.ZodOptional<z.ZodString>;
|
|
12
|
+
perPage: z.ZodDefault<z.ZodNumber>;
|
|
13
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
export type GitHubListPullRequestsArgs = z.input<typeof inputSchema>;
|
|
16
|
+
export declare class GitHubListPullRequestsTool extends BaseTool {
|
|
11
17
|
private readonly logger;
|
|
12
18
|
private tokenStore;
|
|
13
|
-
args: GitHubListPullRequestsArgs
|
|
14
|
-
execute(args: GitHubListPullRequestsArgs, ctx: RunContext): Promise<ToolResult>;
|
|
19
|
+
call(args: GitHubListPullRequestsArgs): Promise<ToolResult>;
|
|
15
20
|
}
|
|
21
|
+
export {};
|
|
16
22
|
//# sourceMappingURL=github-list-pull-requests.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-list-pull-requests.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/pull-requests/github-list-pull-requests.tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github-list-pull-requests.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/pull-requests/github-list-pull-requests.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAQ,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/D,QAAA,MAAM,WAAW;;;;;;;;;;;kBASN,CAAC;AAEZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAErE,qBAOa,0BAA2B,SAAQ,QAAQ;IACtD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA+C;IAGtE,OAAO,CAAC,UAAU,CAAkB;IAE9B,IAAI,CAAC,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,UAAU,CAAC;CAmFlE"}
|