@loopstack/github-module 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-search-code.tool.js","sourceRoot":"","sources":["../../../src/tools/search/github-search-code.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAgD;AAChD,6BAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"github-search-code.tool.js","sourceRoot":"","sources":["../../../src/tools/search/github-search-code.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,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,IAAI,CAAC,IAA0B;QACnC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAEjG,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAO;gBACL,IAAI,EAAE;oBACJ,KAAK,EAAE,cAAc;oBACrB,OAAO,EAAE,yDAAyD;iBACnE;aACF,CAAC;QACJ,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,eAAe,C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CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACxC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,SAAS;SACtC,CAAC,CAAC,CAAC;QAEJ,OAAO;YACL,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE;SAChD,CAAC;IACJ,CAAC;CACF,CAAA;AA5EY,oDAAoB;AAIvB;IADP,IAAA,eAAM,GAAE;8BACW,8BAAe;wDAAC;+BAJzB,oBAAoB;IAPhC,IAAA,aAAI,EAAC;QACJ,QAAQ,EAAE;YACR,WAAW,EACT,gJAAgJ;SACnJ;QACD,MAAM,EAAE,WAAW;KACpB,CAAC;GACW,oBAAoB,CA4EhC"}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseTool, ToolResult } from '@loopstack/common';
|
|
3
|
+
declare const inputSchema: z.ZodObject<{
|
|
4
|
+
query: z.ZodString;
|
|
5
|
+
sort: z.ZodOptional<z.ZodEnum<{
|
|
6
|
+
created: "created";
|
|
7
|
+
updated: "updated";
|
|
8
|
+
comments: "comments";
|
|
9
|
+
reactions: "reactions";
|
|
10
|
+
"reactions-+1": "reactions-+1";
|
|
11
|
+
"reactions--1": "reactions--1";
|
|
12
|
+
interactions: "interactions";
|
|
13
|
+
}>>;
|
|
14
|
+
perPage: z.ZodDefault<z.ZodNumber>;
|
|
15
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
|
+
export type GitHubSearchIssuesArgs = z.input<typeof inputSchema>;
|
|
18
|
+
export declare class GitHubSearchIssuesTool extends BaseTool {
|
|
9
19
|
private readonly logger;
|
|
10
20
|
private tokenStore;
|
|
11
|
-
args: GitHubSearchIssuesArgs
|
|
12
|
-
execute(args: GitHubSearchIssuesArgs, ctx: RunContext): Promise<ToolResult>;
|
|
21
|
+
call(args: GitHubSearchIssuesArgs): Promise<ToolResult>;
|
|
13
22
|
}
|
|
23
|
+
export {};
|
|
14
24
|
//# sourceMappingURL=github-search-issues.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-search-issues.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/search/github-search-issues.tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github-search-issues.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/search/github-search-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;;;;;;;;;;;;;kBASN,CAAC;AAEZ,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEjE,qBAOa,sBAAuB,SAAQ,QAAQ;IAClD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;IAGlE,OAAO,CAAC,UAAU,CAAkB;IAE9B,IAAI,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,UAAU,CAAC;CAiF9D"}
|
|
@@ -15,12 +15,21 @@ 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
|
+
query: zod_1.z.string(),
|
|
21
|
+
sort: zod_1.z
|
|
22
|
+
.enum(['comments', 'reactions', 'reactions-+1', 'reactions--1', 'interactions', 'created', 'updated'])
|
|
23
|
+
.optional(),
|
|
24
|
+
perPage: zod_1.z.number().default(30),
|
|
25
|
+
page: zod_1.z.number().default(1),
|
|
26
|
+
})
|
|
27
|
+
.strict();
|
|
28
|
+
let GitHubSearchIssuesTool = GitHubSearchIssuesTool_1 = class GitHubSearchIssuesTool extends common_2.BaseTool {
|
|
19
29
|
logger = new common_1.Logger(GitHubSearchIssuesTool_1.name);
|
|
20
30
|
tokenStore;
|
|
21
|
-
args
|
|
22
|
-
|
|
23
|
-
const accessToken = await this.tokenStore.getValidAccessToken(ctx.userId, 'github');
|
|
31
|
+
async call(args) {
|
|
32
|
+
const accessToken = await this.tokenStore.getValidAccessToken(this.ctx.context.userId, 'github');
|
|
24
33
|
if (!accessToken) {
|
|
25
34
|
return {
|
|
26
35
|
data: {
|
|
@@ -44,7 +53,7 @@ let GitHubSearchIssuesTool = GitHubSearchIssuesTool_1 = class GitHubSearchIssues
|
|
|
44
53
|
},
|
|
45
54
|
});
|
|
46
55
|
if (response.status === 401 || response.status === 403) {
|
|
47
|
-
this.logger.warn(`GitHub API returned ${response.status} for user ${ctx.userId}`);
|
|
56
|
+
this.logger.warn(`GitHub API returned ${response.status} for user ${this.ctx.context.userId}`);
|
|
48
57
|
return {
|
|
49
58
|
data: {
|
|
50
59
|
error: '401',
|
|
@@ -84,26 +93,12 @@ __decorate([
|
|
|
84
93
|
(0, common_1.Inject)(),
|
|
85
94
|
__metadata("design:type", oauth_module_1.OAuthTokenStore)
|
|
86
95
|
], GitHubSearchIssuesTool.prototype, "tokenStore", void 0);
|
|
87
|
-
__decorate([
|
|
88
|
-
(0, common_2.Input)({
|
|
89
|
-
schema: zod_1.z
|
|
90
|
-
.object({
|
|
91
|
-
query: zod_1.z.string(),
|
|
92
|
-
sort: zod_1.z
|
|
93
|
-
.enum(['comments', 'reactions', 'reactions-+1', 'reactions--1', 'interactions', 'created', 'updated'])
|
|
94
|
-
.optional(),
|
|
95
|
-
perPage: zod_1.z.number().default(30),
|
|
96
|
-
page: zod_1.z.number().default(1),
|
|
97
|
-
})
|
|
98
|
-
.strict(),
|
|
99
|
-
}),
|
|
100
|
-
__metadata("design:type", Object)
|
|
101
|
-
], GitHubSearchIssuesTool.prototype, "args", void 0);
|
|
102
96
|
exports.GitHubSearchIssuesTool = GitHubSearchIssuesTool = GitHubSearchIssuesTool_1 = __decorate([
|
|
103
97
|
(0, common_2.Tool)({
|
|
104
|
-
|
|
98
|
+
uiConfig: {
|
|
105
99
|
description: 'Searches for issues and pull requests across GitHub using the GitHub search syntax. Returns { error: "unauthorized" } if no valid token is available.',
|
|
106
100
|
},
|
|
101
|
+
schema: inputSchema,
|
|
107
102
|
})
|
|
108
103
|
], GitHubSearchIssuesTool);
|
|
109
104
|
//# sourceMappingURL=github-search-issues.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-search-issues.tool.js","sourceRoot":"","sources":["../../../src/tools/search/github-search-issues.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAgD;AAChD,6BAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"github-search-issues.tool.js","sourceRoot":"","sources":["../../../src/tools/search/github-search-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;SACJ,IAAI,CAAC,CAAC,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;SACrG,QAAQ,EAAE;IACb,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC/B,IAAI,EAAE,OAAC,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;AAvFY,wDAAsB;AAIzB;IADP,IAAA,eAAM,GAAE;8BACW,8BAAe;0DAAC;iCAJzB,sBAAsB;IAPlC,IAAA,aAAI,EAAC;QACJ,QAAQ,EAAE;YACR,WAAW,EACT,uJAAuJ;SAC1J;QACD,MAAM,EAAE,WAAW;KACpB,CAAC;GACW,sBAAsB,CAuFlC"}
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseTool, ToolResult } from '@loopstack/common';
|
|
3
|
+
declare const inputSchema: z.ZodObject<{
|
|
4
|
+
query: z.ZodString;
|
|
5
|
+
sort: z.ZodOptional<z.ZodEnum<{
|
|
6
|
+
updated: "updated";
|
|
7
|
+
stars: "stars";
|
|
8
|
+
forks: "forks";
|
|
9
|
+
"help-wanted-issues": "help-wanted-issues";
|
|
10
|
+
}>>;
|
|
11
|
+
perPage: z.ZodDefault<z.ZodNumber>;
|
|
12
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
export type GitHubSearchReposArgs = z.input<typeof inputSchema>;
|
|
15
|
+
export declare class GitHubSearchReposTool extends BaseTool {
|
|
9
16
|
private readonly logger;
|
|
10
17
|
private tokenStore;
|
|
11
|
-
args: GitHubSearchReposArgs
|
|
12
|
-
execute(args: GitHubSearchReposArgs, ctx: RunContext): Promise<ToolResult>;
|
|
18
|
+
call(args: GitHubSearchReposArgs): Promise<ToolResult>;
|
|
13
19
|
}
|
|
20
|
+
export {};
|
|
14
21
|
//# sourceMappingURL=github-search-repos.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-search-repos.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/search/github-search-repos.tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github-search-repos.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/search/github-search-repos.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;;;;;;;;;;kBAON,CAAC;AAEZ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEhE,qBAOa,qBAAsB,SAAQ,QAAQ;IACjD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0C;IAGjE,OAAO,CAAC,UAAU,CAAkB;IAE9B,IAAI,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,UAAU,CAAC;CA8E7D"}
|
|
@@ -15,12 +15,19 @@ 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
|
+
query: zod_1.z.string(),
|
|
21
|
+
sort: zod_1.z.enum(['stars', 'forks', 'help-wanted-issues', 'updated']).optional(),
|
|
22
|
+
perPage: zod_1.z.number().default(30),
|
|
23
|
+
page: zod_1.z.number().default(1),
|
|
24
|
+
})
|
|
25
|
+
.strict();
|
|
26
|
+
let GitHubSearchReposTool = GitHubSearchReposTool_1 = class GitHubSearchReposTool extends common_2.BaseTool {
|
|
19
27
|
logger = new common_1.Logger(GitHubSearchReposTool_1.name);
|
|
20
28
|
tokenStore;
|
|
21
|
-
args
|
|
22
|
-
|
|
23
|
-
const accessToken = await this.tokenStore.getValidAccessToken(ctx.userId, 'github');
|
|
29
|
+
async call(args) {
|
|
30
|
+
const accessToken = await this.tokenStore.getValidAccessToken(this.ctx.context.userId, 'github');
|
|
24
31
|
if (!accessToken) {
|
|
25
32
|
return {
|
|
26
33
|
data: {
|
|
@@ -44,7 +51,7 @@ let GitHubSearchReposTool = GitHubSearchReposTool_1 = class GitHubSearchReposToo
|
|
|
44
51
|
},
|
|
45
52
|
});
|
|
46
53
|
if (response.status === 401 || response.status === 403) {
|
|
47
|
-
this.logger.warn(`GitHub API returned ${response.status} for user ${ctx.userId}`);
|
|
54
|
+
this.logger.warn(`GitHub API returned ${response.status} for user ${this.ctx.context.userId}`);
|
|
48
55
|
return {
|
|
49
56
|
data: {
|
|
50
57
|
error: '401',
|
|
@@ -83,24 +90,12 @@ __decorate([
|
|
|
83
90
|
(0, common_1.Inject)(),
|
|
84
91
|
__metadata("design:type", oauth_module_1.OAuthTokenStore)
|
|
85
92
|
], GitHubSearchReposTool.prototype, "tokenStore", void 0);
|
|
86
|
-
__decorate([
|
|
87
|
-
(0, common_2.Input)({
|
|
88
|
-
schema: zod_1.z
|
|
89
|
-
.object({
|
|
90
|
-
query: zod_1.z.string(),
|
|
91
|
-
sort: zod_1.z.enum(['stars', 'forks', 'help-wanted-issues', 'updated']).optional(),
|
|
92
|
-
perPage: zod_1.z.number().default(30),
|
|
93
|
-
page: zod_1.z.number().default(1),
|
|
94
|
-
})
|
|
95
|
-
.strict(),
|
|
96
|
-
}),
|
|
97
|
-
__metadata("design:type", Object)
|
|
98
|
-
], GitHubSearchReposTool.prototype, "args", void 0);
|
|
99
93
|
exports.GitHubSearchReposTool = GitHubSearchReposTool = GitHubSearchReposTool_1 = __decorate([
|
|
100
94
|
(0, common_2.Tool)({
|
|
101
|
-
|
|
95
|
+
uiConfig: {
|
|
102
96
|
description: 'Searches for repositories on GitHub using the GitHub search syntax. Returns { error: "unauthorized" } if no valid token is available.',
|
|
103
97
|
},
|
|
98
|
+
schema: inputSchema,
|
|
104
99
|
})
|
|
105
100
|
], GitHubSearchReposTool);
|
|
106
101
|
//# sourceMappingURL=github-search-repos.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-search-repos.tool.js","sourceRoot":"","sources":["../../../src/tools/search/github-search-repos.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAgD;AAChD,6BAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"github-search-repos.tool.js","sourceRoot":"","sources":["../../../src/tools/search/github-search-repos.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,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC5E,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,qBAAqB,6BAA3B,MAAM,qBAAsB,SAAQ,iBAAQ;IAChC,MAAM,GAAG,IAAI,eAAM,CAAC,uBAAqB,CAAC,IAAI,CAAC,CAAC;IAGzD,UAAU,CAAkB;IAEpC,KAAK,CAAC,IAAI,CAAC,IAA2B;QACpC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAEjG,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAO;gBACL,IAAI,EAAE;oBACJ,KAAK,EAAE,cAAc;oBACrB,OAAO,EAAE,yDAAyD;iBACnE;aACF,CAAC;QACJ,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;YACjC,CAAC,EAAE,IAAI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AAI,EAAE,CAYlC,CAAC;QAEF,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACxC,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,QAAQ,EAAE,IAAI,CAAC,SAAS;YACxB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,IAAI,CAAC,gBAAgB;YAC5B,KAAK,EAAE,IAAI,CAAC,WAAW;YACvB,SAAS,EAAE,IAAI,CAAC,UAAU;SAC3B,CAAC,CAAC,CAAC;QAEJ,OAAO;YACL,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE;SAChD,CAAC;IACJ,CAAC;CACF,CAAA;AApFY,sDAAqB;AAIxB;IADP,IAAA,eAAM,GAAE;8BACW,8BAAe;yDAAC;gCAJzB,qBAAqB;IAPjC,IAAA,aAAI,EAAC;QACJ,QAAQ,EAAE;YACR,WAAW,EACT,uIAAuI;SAC1I;QACD,MAAM,EAAE,WAAW;KACpB,CAAC;GACW,qBAAqB,CAoFjC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseTool, ToolResult } from '@loopstack/common';
|
|
3
|
+
declare const inputSchema: z.ZodObject<{}, z.core.$strict>;
|
|
4
|
+
export type GitHubGetAuthenticatedUserArgs = z.infer<typeof inputSchema>;
|
|
5
|
+
export declare class GitHubGetAuthenticatedUserTool extends BaseTool {
|
|
4
6
|
private readonly logger;
|
|
5
7
|
private tokenStore;
|
|
6
|
-
|
|
7
|
-
execute(_args: GitHubGetAuthenticatedUserArgs, ctx: RunContext): Promise<ToolResult>;
|
|
8
|
+
call(_args: GitHubGetAuthenticatedUserArgs): Promise<ToolResult>;
|
|
8
9
|
}
|
|
10
|
+
export {};
|
|
9
11
|
//# sourceMappingURL=github-get-authenticated-user.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-get-authenticated-user.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/users/github-get-authenticated-user.tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github-get-authenticated-user.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/users/github-get-authenticated-user.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,iCAAwB,CAAC;AAE1C,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEzE,qBAOa,8BAA+B,SAAQ,QAAQ;IAC1D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmD;IAG1E,OAAO,CAAC,UAAU,CAAkB;IAE9B,IAAI,CAAC,KAAK,EAAE,8BAA8B,GAAG,OAAO,CAAC,UAAU,CAAC;CAyEvE"}
|
|
@@ -15,12 +15,12 @@ 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.object({}).strict();
|
|
19
|
+
let GitHubGetAuthenticatedUserTool = GitHubGetAuthenticatedUserTool_1 = class GitHubGetAuthenticatedUserTool extends common_2.BaseTool {
|
|
19
20
|
logger = new common_1.Logger(GitHubGetAuthenticatedUserTool_1.name);
|
|
20
21
|
tokenStore;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const accessToken = await this.tokenStore.getValidAccessToken(ctx.userId, 'github');
|
|
22
|
+
async call(_args) {
|
|
23
|
+
const accessToken = await this.tokenStore.getValidAccessToken(this.ctx.context.userId, 'github');
|
|
24
24
|
if (!accessToken) {
|
|
25
25
|
return {
|
|
26
26
|
data: {
|
|
@@ -37,7 +37,7 @@ let GitHubGetAuthenticatedUserTool = GitHubGetAuthenticatedUserTool_1 = class Gi
|
|
|
37
37
|
},
|
|
38
38
|
});
|
|
39
39
|
if (response.status === 401 || response.status === 403) {
|
|
40
|
-
this.logger.warn(`GitHub API returned ${response.status} for user ${ctx.userId}`);
|
|
40
|
+
this.logger.warn(`GitHub API returned ${response.status} for user ${this.ctx.context.userId}`);
|
|
41
41
|
return {
|
|
42
42
|
data: {
|
|
43
43
|
error: '401',
|
|
@@ -80,17 +80,12 @@ __decorate([
|
|
|
80
80
|
(0, common_1.Inject)(),
|
|
81
81
|
__metadata("design:type", oauth_module_1.OAuthTokenStore)
|
|
82
82
|
], GitHubGetAuthenticatedUserTool.prototype, "tokenStore", void 0);
|
|
83
|
-
__decorate([
|
|
84
|
-
(0, common_2.Input)({
|
|
85
|
-
schema: zod_1.z.object({}).strict(),
|
|
86
|
-
}),
|
|
87
|
-
__metadata("design:type", Object)
|
|
88
|
-
], GitHubGetAuthenticatedUserTool.prototype, "args", void 0);
|
|
89
83
|
exports.GitHubGetAuthenticatedUserTool = GitHubGetAuthenticatedUserTool = GitHubGetAuthenticatedUserTool_1 = __decorate([
|
|
90
84
|
(0, common_2.Tool)({
|
|
91
|
-
|
|
85
|
+
uiConfig: {
|
|
92
86
|
description: 'Gets the profile of the currently authenticated GitHub user. Returns { error: "unauthorized" } if no valid token is available.',
|
|
93
87
|
},
|
|
88
|
+
schema: inputSchema,
|
|
94
89
|
})
|
|
95
90
|
], GitHubGetAuthenticatedUserTool);
|
|
96
91
|
//# sourceMappingURL=github-get-authenticated-user.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-get-authenticated-user.tool.js","sourceRoot":"","sources":["../../../src/tools/users/github-get-authenticated-user.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAgD;AAChD,6BAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"github-get-authenticated-user.tool.js","sourceRoot":"","sources":["../../../src/tools/users/github-get-authenticated-user.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAgD;AAChD,6BAAwB;AACxB,8CAA+D;AAC/D,0DAA0D;AAE1D,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAWnC,IAAM,8BAA8B,sCAApC,MAAM,8BAA+B,SAAQ,iBAAQ;IACzC,MAAM,GAAG,IAAI,eAAM,CAAC,gCAA8B,CAAC,IAAI,CAAC,CAAC;IAGlE,UAAU,CAAkB;IAEpC,KAAK,CAAC,IAAI,CAAC,KAAqC;QAC9C,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAEjG,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAO;gBACL,IAAI,EAAE;oBACJ,KAAK,EAAE,cAAc;oBACrB,OAAO,EAAE,yDAAyD;iBACnE;aACF,CAAC;QACJ,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,6BAA6B,EAAE;YAC1D,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,WAAW,EAAE;gBACtC,MAAM,EAAE,6BAA6B;gBACrC,sBAAsB,EAAE,YAAY;aACrC;SACF,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YACvD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,uBAAuB,QAAQ,CAAC,MAAM,aAAa,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;Y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;GACW,8BAA8B,CA+E1C"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseTool, ToolResult } from '@loopstack/common';
|
|
3
|
+
declare const inputSchema: z.ZodObject<{
|
|
4
|
+
perPage: z.ZodDefault<z.ZodNumber>;
|
|
5
|
+
}, z.core.$strict>;
|
|
6
|
+
export type GitHubListUserOrgsArgs = z.input<typeof inputSchema>;
|
|
7
|
+
export declare class GitHubListUserOrgsTool extends BaseTool {
|
|
6
8
|
private readonly logger;
|
|
7
9
|
private tokenStore;
|
|
8
|
-
args: GitHubListUserOrgsArgs
|
|
9
|
-
execute(args: GitHubListUserOrgsArgs, ctx: RunContext): Promise<ToolResult>;
|
|
10
|
+
call(args: GitHubListUserOrgsArgs): Promise<ToolResult>;
|
|
10
11
|
}
|
|
12
|
+
export {};
|
|
11
13
|
//# sourceMappingURL=github-list-user-orgs.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-list-user-orgs.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/users/github-list-user-orgs.tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github-list-user-orgs.tool.d.ts","sourceRoot":"","sources":["../../../src/tools/users/github-list-user-orgs.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;;kBAIN,CAAC;AAEZ,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEjE,qBAOa,sBAAuB,SAAQ,QAAQ;IAClD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;IAGlE,OAAO,CAAC,UAAU,CAAkB;IAE9B,IAAI,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,UAAU,CAAC;CA+D9D"}
|
|
@@ -15,12 +15,16 @@ 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
|
+
perPage: zod_1.z.number().default(30),
|
|
21
|
+
})
|
|
22
|
+
.strict();
|
|
23
|
+
let GitHubListUserOrgsTool = GitHubListUserOrgsTool_1 = class GitHubListUserOrgsTool extends common_2.BaseTool {
|
|
19
24
|
logger = new common_1.Logger(GitHubListUserOrgsTool_1.name);
|
|
20
25
|
tokenStore;
|
|
21
|
-
args
|
|
22
|
-
|
|
23
|
-
const accessToken = await this.tokenStore.getValidAccessToken(ctx.userId, 'github');
|
|
26
|
+
async call(args) {
|
|
27
|
+
const accessToken = await this.tokenStore.getValidAccessToken(this.ctx.context.userId, 'github');
|
|
24
28
|
if (!accessToken) {
|
|
25
29
|
return {
|
|
26
30
|
data: {
|
|
@@ -40,7 +44,7 @@ let GitHubListUserOrgsTool = GitHubListUserOrgsTool_1 = class GitHubListUserOrgs
|
|
|
40
44
|
},
|
|
41
45
|
});
|
|
42
46
|
if (response.status === 401 || response.status === 403) {
|
|
43
|
-
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}`);
|
|
44
48
|
return {
|
|
45
49
|
data: {
|
|
46
50
|
error: '401',
|
|
@@ -75,21 +79,12 @@ __decorate([
|
|
|
75
79
|
(0, common_1.Inject)(),
|
|
76
80
|
__metadata("design:type", oauth_module_1.OAuthTokenStore)
|
|
77
81
|
], GitHubListUserOrgsTool.prototype, "tokenStore", void 0);
|
|
78
|
-
__decorate([
|
|
79
|
-
(0, common_2.Input)({
|
|
80
|
-
schema: zod_1.z
|
|
81
|
-
.object({
|
|
82
|
-
perPage: zod_1.z.number().default(30),
|
|
83
|
-
})
|
|
84
|
-
.strict(),
|
|
85
|
-
}),
|
|
86
|
-
__metadata("design:type", Object)
|
|
87
|
-
], GitHubListUserOrgsTool.prototype, "args", void 0);
|
|
88
82
|
exports.GitHubListUserOrgsTool = GitHubListUserOrgsTool = GitHubListUserOrgsTool_1 = __decorate([
|
|
89
83
|
(0, common_2.Tool)({
|
|
90
|
-
|
|
84
|
+
uiConfig: {
|
|
91
85
|
description: 'Lists organizations for the authenticated GitHub user. Returns { error: "unauthorized" } if no valid token is available.',
|
|
92
86
|
},
|
|
87
|
+
schema: inputSchema,
|
|
93
88
|
})
|
|
94
89
|
], GitHubListUserOrgsTool);
|
|
95
90
|
//# sourceMappingURL=github-list-user-orgs.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-list-user-orgs.tool.js","sourceRoot":"","sources":["../../../src/tools/users/github-list-user-orgs.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAgD;AAChD,6BAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"github-list-user-orgs.tool.js","sourceRoot":"","sources":["../../../src/tools/users/github-list-user-orgs.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAgD;AAChD,6BAAwB;AACxB,8CAA+D;AAC/D,0DAA0D;AAE1D,MAAM,WAAW,GAAG,OAAC;KAClB,MAAM,CAAC;IACN,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CAChC,CAAC;KACD,MAAM,EAAE,CAAC;AAWL,IAAM,sBAAsB,8BAA5B,MAAM,sBAAuB,SAAQ,iBAAQ;IACjC,MAAM,GAAG,IAAI,eAAM,CAAC,wBAAsB,CAAC,IAAI,CAAC,CAAC;IAG1D,UAAU,CAAkB;IAEpC,KAAK,CAAC,IAAI,CAAC,IAA4B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EAAE,WAAW;oBAClB,OAAO,EAAE,qBAAqB,QAAQ,CAAC,UAAU,EAAE;iBACpD;aACF,CAAC;QACJ,CAAC;QAED,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAKjC,CAAC;QAEH,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YAC9B,EAAE,EAAE,GAAG,CAAC,EAAE;YACV,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,SAAS,EAAE,GAAG,CAAC,UAAU;SAC1B,CAAC,CAAC,CAAC;QAEJ,OAAO;YACL,IAAI,EAAE,EAAE,IAAI,EAAE;SACf,CAAC;IACJ,CAAC;CACF,CAAA;AArEY,wDAAsB;AAIzB;IADP,IAAA,eAAM,GAAE;8BACW,8BAAe;0DAAC;iCAJzB,sBAAsB;IAPlC,IAAA,aAAI,EAAC;QACJ,QAAQ,EAAE;YACR,WAAW,EACT,0HAA0H;SAC7H;QACD,MAAM,EAAE,WAAW;KACpB,CAAC;GACW,sBAAsB,CAqElC"}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"module",
|
|
10
10
|
"oauth"
|
|
11
11
|
],
|
|
12
|
-
"version": "0.
|
|
12
|
+
"version": "0.2.0",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": {
|
|
15
15
|
"name": "Jakob Klippel",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"watch": "nest build --watch"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@loopstack/oauth-module": "^0.
|
|
33
|
+
"@loopstack/oauth-module": "^0.2.0",
|
|
34
34
|
"zod": "^4.3.6"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
@@ -1,39 +1,33 @@
|
|
|
1
1
|
import { Inject, Logger } from '@nestjs/common';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
3
|
+
import { BaseTool, Tool, ToolResult } from '@loopstack/common';
|
|
4
4
|
import { OAuthTokenStore } from '@loopstack/oauth-module';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const inputSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
owner: z.string(),
|
|
9
|
+
repo: z.string(),
|
|
10
|
+
runId: z.number(),
|
|
11
|
+
})
|
|
12
|
+
.strict();
|
|
13
|
+
|
|
14
|
+
export type GitHubGetWorkflowRunArgs = z.infer<typeof inputSchema>;
|
|
11
15
|
|
|
12
16
|
@Tool({
|
|
13
|
-
|
|
17
|
+
uiConfig: {
|
|
14
18
|
description:
|
|
15
19
|
'Gets detailed information about a specific GitHub Actions workflow run. Returns { error: "unauthorized" } if no valid token is available.',
|
|
16
20
|
},
|
|
21
|
+
schema: inputSchema,
|
|
17
22
|
})
|
|
18
|
-
export class GitHubGetWorkflowRunTool
|
|
23
|
+
export class GitHubGetWorkflowRunTool extends BaseTool {
|
|
19
24
|
private readonly logger = new Logger(GitHubGetWorkflowRunTool.name);
|
|
20
25
|
|
|
21
26
|
@Inject()
|
|
22
27
|
private tokenStore: OAuthTokenStore;
|
|
23
28
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
.object({
|
|
27
|
-
owner: z.string(),
|
|
28
|
-
repo: z.string(),
|
|
29
|
-
runId: z.number(),
|
|
30
|
-
})
|
|
31
|
-
.strict(),
|
|
32
|
-
})
|
|
33
|
-
args: GitHubGetWorkflowRunArgs;
|
|
34
|
-
|
|
35
|
-
async execute(args: GitHubGetWorkflowRunArgs, ctx: RunContext): Promise<ToolResult> {
|
|
36
|
-
const accessToken = await this.tokenStore.getValidAccessToken(ctx.userId, 'github');
|
|
29
|
+
async call(args: GitHubGetWorkflowRunArgs): Promise<ToolResult> {
|
|
30
|
+
const accessToken = await this.tokenStore.getValidAccessToken(this.ctx.context.userId, 'github');
|
|
37
31
|
|
|
38
32
|
if (!accessToken) {
|
|
39
33
|
return {
|
|
@@ -54,7 +48,7 @@ export class GitHubGetWorkflowRunTool implements ToolInterface {
|
|
|
54
48
|
});
|
|
55
49
|
|
|
56
50
|
if (response.status === 401 || response.status === 403) {
|
|
57
|
-
this.logger.warn(`GitHub API returned ${response.status} for user ${ctx.userId}`);
|
|
51
|
+
this.logger.warn(`GitHub API returned ${response.status} for user ${this.ctx.context.userId}`);
|
|
58
52
|
return {
|
|
59
53
|
data: {
|
|
60
54
|
error: '401',
|
|
@@ -1,62 +1,53 @@
|
|
|
1
1
|
import { Inject, Logger } from '@nestjs/common';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
3
|
+
import { BaseTool, Tool, ToolResult } from '@loopstack/common';
|
|
4
4
|
import { OAuthTokenStore } from '@loopstack/oauth-module';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
const inputSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
owner: z.string(),
|
|
9
|
+
repo: z.string(),
|
|
10
|
+
branch: z.string().optional(),
|
|
11
|
+
status: z
|
|
12
|
+
.enum([
|
|
13
|
+
'completed',
|
|
14
|
+
'action_required',
|
|
15
|
+
'cancelled',
|
|
16
|
+
'failure',
|
|
17
|
+
'neutral',
|
|
18
|
+
'skipped',
|
|
19
|
+
'stale',
|
|
20
|
+
'success',
|
|
21
|
+
'timed_out',
|
|
22
|
+
'in_progress',
|
|
23
|
+
'queued',
|
|
24
|
+
'requested',
|
|
25
|
+
'waiting',
|
|
26
|
+
'pending',
|
|
27
|
+
])
|
|
28
|
+
.optional(),
|
|
29
|
+
perPage: z.number().default(30),
|
|
30
|
+
page: z.number().default(1),
|
|
31
|
+
})
|
|
32
|
+
.strict();
|
|
33
|
+
|
|
34
|
+
export type GitHubListWorkflowRunsArgs = z.input<typeof inputSchema>;
|
|
14
35
|
|
|
15
36
|
@Tool({
|
|
16
|
-
|
|
37
|
+
uiConfig: {
|
|
17
38
|
description:
|
|
18
39
|
'Lists workflow runs for a GitHub repository. Returns { error: "unauthorized" } if no valid token is available.',
|
|
19
40
|
},
|
|
41
|
+
schema: inputSchema,
|
|
20
42
|
})
|
|
21
|
-
export class GitHubListWorkflowRunsTool
|
|
43
|
+
export class GitHubListWorkflowRunsTool extends BaseTool {
|
|
22
44
|
private readonly logger = new Logger(GitHubListWorkflowRunsTool.name);
|
|
23
45
|
|
|
24
46
|
@Inject()
|
|
25
47
|
private tokenStore: OAuthTokenStore;
|
|
26
48
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
.object({
|
|
30
|
-
owner: z.string(),
|
|
31
|
-
repo: z.string(),
|
|
32
|
-
branch: z.string().optional(),
|
|
33
|
-
status: z
|
|
34
|
-
.enum([
|
|
35
|
-
'completed',
|
|
36
|
-
'action_required',
|
|
37
|
-
'cancelled',
|
|
38
|
-
'failure',
|
|
39
|
-
'neutral',
|
|
40
|
-
'skipped',
|
|
41
|
-
'stale',
|
|
42
|
-
'success',
|
|
43
|
-
'timed_out',
|
|
44
|
-
'in_progress',
|
|
45
|
-
'queued',
|
|
46
|
-
'requested',
|
|
47
|
-
'waiting',
|
|
48
|
-
'pending',
|
|
49
|
-
])
|
|
50
|
-
.optional(),
|
|
51
|
-
perPage: z.number().default(30),
|
|
52
|
-
page: z.number().default(1),
|
|
53
|
-
})
|
|
54
|
-
.strict(),
|
|
55
|
-
})
|
|
56
|
-
args: GitHubListWorkflowRunsArgs;
|
|
57
|
-
|
|
58
|
-
async execute(args: GitHubListWorkflowRunsArgs, ctx: RunContext): Promise<ToolResult> {
|
|
59
|
-
const accessToken = await this.tokenStore.getValidAccessToken(ctx.userId, 'github');
|
|
49
|
+
async call(args: GitHubListWorkflowRunsArgs): Promise<ToolResult> {
|
|
50
|
+
const accessToken = await this.tokenStore.getValidAccessToken(this.ctx.context.userId, 'github');
|
|
60
51
|
|
|
61
52
|
if (!accessToken) {
|
|
62
53
|
return {
|
|
@@ -85,7 +76,7 @@ export class GitHubListWorkflowRunsTool implements ToolInterface {
|
|
|
85
76
|
});
|
|
86
77
|
|
|
87
78
|
if (response.status === 401 || response.status === 403) {
|
|
88
|
-
this.logger.warn(`GitHub API returned ${response.status} for user ${ctx.userId}`);
|
|
79
|
+
this.logger.warn(`GitHub API returned ${response.status} for user ${this.ctx.context.userId}`);
|
|
89
80
|
return {
|
|
90
81
|
data: {
|
|
91
82
|
error: '401',
|