@loopstack/github-oauth-example 0.1.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 +114 -0
- package/dist/github-example.module.d.ts +3 -0
- package/dist/github-example.module.d.ts.map +1 -0
- package/dist/github-example.module.js +27 -0
- package/dist/github-example.module.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/authenticate-github-task.tool.d.ts +17 -0
- package/dist/tools/authenticate-github-task.tool.d.ts.map +1 -0
- package/dist/tools/authenticate-github-task.tool.js +107 -0
- package/dist/tools/authenticate-github-task.tool.js.map +1 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +18 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/workflows/github-agent.workflow.d.ts +48 -0
- package/dist/workflows/github-agent.workflow.d.ts.map +1 -0
- package/dist/workflows/github-agent.workflow.js +215 -0
- package/dist/workflows/github-agent.workflow.js.map +1 -0
- package/dist/workflows/github-agent.workflow.yaml +154 -0
- package/dist/workflows/github-repos-overview.workflow.d.ts +102 -0
- package/dist/workflows/github-repos-overview.workflow.d.ts.map +1 -0
- package/dist/workflows/github-repos-overview.workflow.js +300 -0
- package/dist/workflows/github-repos-overview.workflow.js.map +1 -0
- package/dist/workflows/github-repos-overview.workflow.yaml +249 -0
- package/dist/workflows/index.d.ts +3 -0
- package/dist/workflows/index.d.ts.map +1 -0
- package/dist/workflows/index.js +19 -0
- package/dist/workflows/index.js.map +1 -0
- package/package.json +80 -0
- package/src/github-example.module.ts +14 -0
- package/src/index.ts +3 -0
- package/src/tools/authenticate-github-task.tool.ts +125 -0
- package/src/tools/index.ts +1 -0
- package/src/workflows/__tests__/github-repos-overview-workflow.spec.ts +725 -0
- package/src/workflows/github-agent.workflow.ts +118 -0
- package/src/workflows/github-agent.workflow.yaml +154 -0
- package/src/workflows/github-repos-overview.workflow.ts +254 -0
- package/src/workflows/github-repos-overview.workflow.yaml +249 -0
- package/src/workflows/index.ts +2 -0
package/README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# @loopstack/github-oauth-example
|
|
2
|
+
|
|
3
|
+
> An example module for the [Loopstack AI](https://loopstack.ai) automation framework.
|
|
4
|
+
|
|
5
|
+
This module demonstrates how to build workflows that interact with the GitHub API using OAuth authentication. It includes two workflows: a structured overview that fetches repository data, and an interactive chat agent powered by an LLM that can use all 25 GitHub tools.
|
|
6
|
+
|
|
7
|
+
## Workflows
|
|
8
|
+
|
|
9
|
+
### GitHub Repos Overview (`gitHubReposOverview`)
|
|
10
|
+
|
|
11
|
+
A multi-step workflow that fetches and displays a comprehensive overview of a GitHub repository. If the user is not authenticated, it launches the OAuth sub-workflow and retries automatically.
|
|
12
|
+
|
|
13
|
+
**Inputs:** `owner` (default: `octocat`), `repo` (default: `Hello-World`)
|
|
14
|
+
|
|
15
|
+
**Flow:**
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
start -> fetch_user -> fetch_orgs -> fetch_repo_details -> fetch_issues_prs
|
|
19
|
+
-> fetch_content_actions -> fetch_search -> display_results -> end
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
With OAuth branching:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
fetch_user -> (unauthorized) -> auth_required -> awaiting_auth
|
|
26
|
+
|
|
|
27
|
+
auth_completed -> start (retry)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Tools exercised in the workflow:**
|
|
31
|
+
|
|
32
|
+
| Category | Tool | Used in workflow |
|
|
33
|
+
| ------------- | ---------------------------- | ---------------- |
|
|
34
|
+
| Users | `gitHubGetAuthenticatedUser` | Yes |
|
|
35
|
+
| Users | `gitHubListUserOrgs` | Yes |
|
|
36
|
+
| Repos | `gitHubListRepos` | No |
|
|
37
|
+
| Repos | `gitHubGetRepo` | Yes |
|
|
38
|
+
| Repos | `gitHubCreateRepo` | No |
|
|
39
|
+
| Repos | `gitHubListBranches` | Yes |
|
|
40
|
+
| Issues | `gitHubListIssues` | Yes |
|
|
41
|
+
| Issues | `gitHubGetIssue` | No |
|
|
42
|
+
| Issues | `gitHubCreateIssue` | No |
|
|
43
|
+
| Issues | `gitHubCreateIssueComment` | No |
|
|
44
|
+
| Pull Requests | `gitHubListPullRequests` | Yes |
|
|
45
|
+
| Pull Requests | `gitHubGetPullRequest` | No |
|
|
46
|
+
| Pull Requests | `gitHubCreatePullRequest` | No |
|
|
47
|
+
| Pull Requests | `gitHubMergePullRequest` | No |
|
|
48
|
+
| Pull Requests | `gitHubListPrReviews` | No |
|
|
49
|
+
| Content | `gitHubGetFileContent` | No |
|
|
50
|
+
| Content | `gitHubCreateOrUpdateFile` | No |
|
|
51
|
+
| Content | `gitHubListDirectory` | Yes |
|
|
52
|
+
| Content | `gitHubGetCommit` | No |
|
|
53
|
+
| Actions | `gitHubListWorkflowRuns` | Yes |
|
|
54
|
+
| Actions | `gitHubTriggerWorkflow` | No |
|
|
55
|
+
| Actions | `gitHubGetWorkflowRun` | No |
|
|
56
|
+
| Search | `gitHubSearchCode` | Yes |
|
|
57
|
+
| Search | `gitHubSearchRepos` | No |
|
|
58
|
+
| Search | `gitHubSearchIssues` | No |
|
|
59
|
+
|
|
60
|
+
All 25 tools are injected and available; 9 are called directly by the workflow transitions. The remaining 16 (including all write operations) are available for use but not exercised automatically.
|
|
61
|
+
|
|
62
|
+
### GitHub Agent (`gitHubAgent`)
|
|
63
|
+
|
|
64
|
+
An interactive chat agent that gives an LLM access to all 25 GitHub tools. The agent can manage repositories, issues, pull requests, browse code, check CI/CD status, search across GitHub, and handle OAuth automatically.
|
|
65
|
+
|
|
66
|
+
**How it works:**
|
|
67
|
+
|
|
68
|
+
1. Sets up a system prompt describing available GitHub capabilities
|
|
69
|
+
2. Waits for user input via a chat prompt
|
|
70
|
+
3. Sends the conversation to the LLM with all GitHub tools available
|
|
71
|
+
4. Executes any tool calls the LLM makes
|
|
72
|
+
5. If a tool returns an auth error, launches OAuth and resumes after authentication
|
|
73
|
+
6. Loops back to wait for the next user message
|
|
74
|
+
|
|
75
|
+
This is the easiest way to interactively test every GitHub tool — just ask the agent to perform any GitHub operation.
|
|
76
|
+
|
|
77
|
+
## Setup
|
|
78
|
+
|
|
79
|
+
### Environment Variables
|
|
80
|
+
|
|
81
|
+
Create a GitHub OAuth App at https://github.com/settings/developers and configure:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
GITHUB_CLIENT_ID=your-client-id
|
|
85
|
+
GITHUB_CLIENT_SECRET=your-client-secret
|
|
86
|
+
GITHUB_OAUTH_REDIRECT_URI=http://localhost:5173/oauth/callback
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
For the GitHub Agent workflow, you also need an LLM API key:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
OPENAI_API_KEY=your-openai-api-key
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Dependencies
|
|
96
|
+
|
|
97
|
+
- `@loopstack/core` — Core framework functionality including `ExecuteWorkflowAsync`
|
|
98
|
+
- `@loopstack/ai-module` — LLM integration (`AiGenerateText`, `DelegateToolCall`)
|
|
99
|
+
- `@loopstack/oauth-module` — OAuth infrastructure (`OAuthTokenStore`, `OAuthWorkflow`)
|
|
100
|
+
- `@loopstack/github-module` — All 25 GitHub tools and the GitHub OAuth provider
|
|
101
|
+
- `@loopstack/core-ui-module` — `CreateDocument`, `LinkDocument`, `MarkdownDocument`
|
|
102
|
+
- `@loopstack/create-chat-message-tool` — `CreateChatMessage`
|
|
103
|
+
|
|
104
|
+
## About
|
|
105
|
+
|
|
106
|
+
Author: [Jakob Klippel](https://github.com/loopstack-ai)
|
|
107
|
+
|
|
108
|
+
License: Apache-2.0
|
|
109
|
+
|
|
110
|
+
### Additional Resources
|
|
111
|
+
|
|
112
|
+
- [Loopstack Documentation](https://loopstack.ai/docs)
|
|
113
|
+
- [Getting Started with Loopstack](https://loopstack.ai/docs/getting-started)
|
|
114
|
+
- Find more Loopstack examples in the [Loopstack Registry](https://loopstack.ai/registry)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-example.module.d.ts","sourceRoot":"","sources":["../src/github-example.module.ts"],"names":[],"mappings":"AAQA,qBAKa,mBAAmB;CAAG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.GitHubExampleModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const claude_module_1 = require("@loopstack/claude-module");
|
|
12
|
+
const core_1 = require("@loopstack/core");
|
|
13
|
+
const create_chat_message_tool_1 = require("@loopstack/create-chat-message-tool");
|
|
14
|
+
const github_module_1 = require("@loopstack/github-module");
|
|
15
|
+
const tools_1 = require("./tools");
|
|
16
|
+
const workflows_1 = require("./workflows");
|
|
17
|
+
let GitHubExampleModule = class GitHubExampleModule {
|
|
18
|
+
};
|
|
19
|
+
exports.GitHubExampleModule = GitHubExampleModule;
|
|
20
|
+
exports.GitHubExampleModule = GitHubExampleModule = __decorate([
|
|
21
|
+
(0, common_1.Module)({
|
|
22
|
+
imports: [core_1.LoopCoreModule, create_chat_message_tool_1.CreateChatMessageToolModule, claude_module_1.ClaudeModule, github_module_1.GitHubModule],
|
|
23
|
+
providers: [tools_1.AuthenticateGitHubTask, workflows_1.GitHubReposOverviewWorkflow, workflows_1.GitHubAgentWorkflow],
|
|
24
|
+
exports: [tools_1.AuthenticateGitHubTask, workflows_1.GitHubReposOverviewWorkflow, workflows_1.GitHubAgentWorkflow],
|
|
25
|
+
})
|
|
26
|
+
], GitHubExampleModule);
|
|
27
|
+
//# sourceMappingURL=github-example.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-example.module.js","sourceRoot":"","sources":["../src/github-example.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,4DAAwD;AACxD,0CAAiD;AACjD,kFAAkF;AAClF,4DAAwD;AACxD,mCAAiD;AACjD,2CAA+E;AAOxE,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAAG,CAAA;AAAtB,kDAAmB;8BAAnB,mBAAmB;IAL/B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,qBAAc,EAAE,sDAA2B,EAAE,4BAAY,EAAE,4BAAY,CAAC;QAClF,SAAS,EAAE,CAAC,8BAAsB,EAAE,uCAA2B,EAAE,+BAAmB,CAAC;QACrF,OAAO,EAAE,CAAC,8BAAsB,EAAE,uCAA2B,EAAE,+BAAmB,CAAC;KACpF,CAAC;GACW,mBAAmB,CAAG"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./github-example.module"), exports);
|
|
18
|
+
__exportStar(require("./tools"), exports);
|
|
19
|
+
__exportStar(require("./workflows"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,0CAAwB;AACxB,8CAA4B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { RunContext, ToolInterface, ToolResult, WorkflowInterface, WorkflowMetadataInterface } from '@loopstack/common';
|
|
3
|
+
declare const AuthenticateGitHubTaskInputSchema: z.ZodObject<{
|
|
4
|
+
scopes: z.ZodArray<z.ZodString>;
|
|
5
|
+
}, z.core.$strict>;
|
|
6
|
+
type AuthenticateGitHubTaskInput = z.infer<typeof AuthenticateGitHubTaskInputSchema>;
|
|
7
|
+
export declare class AuthenticateGitHubTask implements ToolInterface<AuthenticateGitHubTaskInput> {
|
|
8
|
+
private readonly logger;
|
|
9
|
+
private task;
|
|
10
|
+
private createDocument;
|
|
11
|
+
private linkDocument;
|
|
12
|
+
args: AuthenticateGitHubTaskInput;
|
|
13
|
+
execute(args: AuthenticateGitHubTaskInput, ctx: RunContext, parent: WorkflowInterface | ToolInterface, metadata: WorkflowMetadataInterface): Promise<ToolResult>;
|
|
14
|
+
complete(result: Record<string, unknown>, ctx: RunContext, parent: WorkflowInterface | ToolInterface, metadata: WorkflowMetadataInterface): Promise<ToolResult>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=authenticate-github-task.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticate-github-task.tool.d.ts","sourceRoot":"","sources":["../../src/tools/authenticate-github-task.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAIL,UAAU,EAEV,aAAa,EACb,UAAU,EAEV,iBAAiB,EACjB,yBAAyB,EAC1B,MAAM,mBAAmB,CAAC;AAG3B,QAAA,MAAM,iCAAiC;;kBAI5B,CAAC;AAEZ,KAAK,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAErF,qBAUa,sBAAuB,YAAW,aAAa,CAAC,2BAA2B,CAAC;IACvF,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;IAEpD,OAAO,CAAC,IAAI,CAAO;IACnB,OAAO,CAAC,cAAc,CAAiB;IACnC,OAAO,CAAC,YAAY,CAAe;IAGrD,IAAI,EAAE,2BAA2B,CAAC;IAE5B,OAAO,CACX,IAAI,EAAE,2BAA2B,EACjC,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,iBAAiB,GAAG,aAAa,EACzC,QAAQ,EAAE,yBAAyB,GAClC,OAAO,CAAC,UAAU,CAAC;IAuChB,QAAQ,CACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,iBAAiB,GAAG,aAAa,EACzC,QAAQ,EAAE,yBAAyB,GAClC,OAAO,CAAC,UAAU,CAAC;CA+BvB"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var AuthenticateGitHubTask_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.AuthenticateGitHubTask = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const zod_1 = require("zod");
|
|
16
|
+
const common_2 = require("@loopstack/common");
|
|
17
|
+
const core_1 = require("@loopstack/core");
|
|
18
|
+
const AuthenticateGitHubTaskInputSchema = zod_1.z
|
|
19
|
+
.object({
|
|
20
|
+
scopes: zod_1.z.array(zod_1.z.string()).describe('The OAuth scopes to request (e.g. repo, user, workflow, read:org)'),
|
|
21
|
+
})
|
|
22
|
+
.strict();
|
|
23
|
+
let AuthenticateGitHubTask = AuthenticateGitHubTask_1 = class AuthenticateGitHubTask {
|
|
24
|
+
logger = new common_1.Logger(AuthenticateGitHubTask_1.name);
|
|
25
|
+
task;
|
|
26
|
+
createDocument;
|
|
27
|
+
linkDocument;
|
|
28
|
+
args;
|
|
29
|
+
async execute(args, ctx, parent, metadata) {
|
|
30
|
+
const taskResult = await this.task.execute({ workflow: 'oAuth', args: { provider: 'github', scopes: args.scopes } }, ctx, parent);
|
|
31
|
+
const effects = [];
|
|
32
|
+
const linkResult = await this.createDocument.execute({
|
|
33
|
+
document: 'linkDocument',
|
|
34
|
+
id: 'github_auth_link',
|
|
35
|
+
validate: 'skip',
|
|
36
|
+
update: {
|
|
37
|
+
content: {
|
|
38
|
+
icon: 'LockKeyhole',
|
|
39
|
+
label: 'GitHub authentication required',
|
|
40
|
+
caption: 'Complete sign-in to access GitHub',
|
|
41
|
+
href: `/pipelines/${String(taskResult.data.pipelineId)}`,
|
|
42
|
+
embed: true,
|
|
43
|
+
expanded: true,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
}, ctx, this, metadata);
|
|
47
|
+
if (linkResult.effects) {
|
|
48
|
+
effects.push(...linkResult.effects);
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
data: taskResult.data,
|
|
52
|
+
effects,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
async complete(result, ctx, parent, metadata) {
|
|
56
|
+
const data = result;
|
|
57
|
+
const effects = [];
|
|
58
|
+
const linkResult = await this.createDocument.execute({
|
|
59
|
+
document: 'linkDocument',
|
|
60
|
+
id: 'github_auth_link',
|
|
61
|
+
validate: 'skip',
|
|
62
|
+
update: {
|
|
63
|
+
content: {
|
|
64
|
+
icon: 'ShieldCheck',
|
|
65
|
+
label: 'GitHub authentication completed',
|
|
66
|
+
href: `/pipelines/${data.pipelineId}`,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
}, ctx, this, metadata);
|
|
70
|
+
if (linkResult.effects) {
|
|
71
|
+
effects.push(...linkResult.effects);
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
data: 'GitHub authentication completed successfully. You can now use GitHub tools.',
|
|
75
|
+
effects,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
exports.AuthenticateGitHubTask = AuthenticateGitHubTask;
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, common_2.InjectTool)(),
|
|
82
|
+
__metadata("design:type", core_1.Task)
|
|
83
|
+
], AuthenticateGitHubTask.prototype, "task", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, common_2.InjectTool)(),
|
|
86
|
+
__metadata("design:type", core_1.CreateDocument)
|
|
87
|
+
], AuthenticateGitHubTask.prototype, "createDocument", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, common_2.InjectDocument)(),
|
|
90
|
+
__metadata("design:type", core_1.LinkDocument)
|
|
91
|
+
], AuthenticateGitHubTask.prototype, "linkDocument", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, common_2.Input)({ schema: AuthenticateGitHubTaskInputSchema }),
|
|
94
|
+
__metadata("design:type", Object)
|
|
95
|
+
], AuthenticateGitHubTask.prototype, "args", void 0);
|
|
96
|
+
exports.AuthenticateGitHubTask = AuthenticateGitHubTask = AuthenticateGitHubTask_1 = __decorate([
|
|
97
|
+
(0, common_1.Injectable)(),
|
|
98
|
+
(0, common_2.Tool)({
|
|
99
|
+
config: {
|
|
100
|
+
description: 'Launches GitHub OAuth authentication. Shows the user a sign-in prompt to authorize access to GitHub. ' +
|
|
101
|
+
'Use this when a GitHub tool returns an "unauthorized" error. ' +
|
|
102
|
+
'Pass the required OAuth scopes for the GitHub APIs you need access to. ' +
|
|
103
|
+
'IMPORTANT: When using this tool, it must be the ONLY tool call in your response. Do not combine it with other tool calls.',
|
|
104
|
+
},
|
|
105
|
+
})
|
|
106
|
+
], AuthenticateGitHubTask);
|
|
107
|
+
//# sourceMappingURL=authenticate-github-task.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticate-github-task.tool.js","sourceRoot":"","sources":["../../src/tools/authenticate-github-task.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,6BAAwB;AACxB,8CAW2B;AAC3B,0CAAqE;AAErE,MAAM,iCAAiC,GAAG,OAAC;KACxC,MAAM,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./authenticate-github-task.tool"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAgD"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ClaudeGenerateText, ClaudeMessageDocument, DelegateToolCalls, UpdateToolResult } from '@loopstack/claude-module';
|
|
2
|
+
import { WorkflowInterface } from '@loopstack/common';
|
|
3
|
+
import { CreateDocument, LinkDocument, Task } from '@loopstack/core';
|
|
4
|
+
import { GitHubCreateIssueCommentTool, GitHubCreateIssueTool, GitHubCreateOrUpdateFileTool, GitHubCreatePullRequestTool, GitHubCreateRepoTool, GitHubGetAuthenticatedUserTool, GitHubGetCommitTool, GitHubGetFileContentTool, GitHubGetIssueTool, GitHubGetPullRequestTool, GitHubGetRepoTool, GitHubGetWorkflowRunTool, GitHubListBranchesTool, GitHubListDirectoryTool, GitHubListIssuesTool, GitHubListPrReviewsTool, GitHubListPullRequestsTool, GitHubListReposTool, GitHubListUserOrgsTool, GitHubListWorkflowRunsTool, GitHubMergePullRequestTool, GitHubSearchCodeTool, GitHubSearchIssuesTool, GitHubSearchReposTool, GitHubTriggerWorkflowTool } from '@loopstack/github-module';
|
|
5
|
+
import { OAuthWorkflow } from '@loopstack/oauth-module';
|
|
6
|
+
import { AuthenticateGitHubTask } from '../tools/authenticate-github-task.tool';
|
|
7
|
+
export declare class GitHubAgentWorkflow implements WorkflowInterface {
|
|
8
|
+
createDocument: CreateDocument;
|
|
9
|
+
claudeGenerateText: ClaudeGenerateText;
|
|
10
|
+
delegateToolCalls: DelegateToolCalls;
|
|
11
|
+
updateToolResult: UpdateToolResult;
|
|
12
|
+
task: Task;
|
|
13
|
+
authenticateGitHub: AuthenticateGitHubTask;
|
|
14
|
+
claudeMessageDocument: ClaudeMessageDocument;
|
|
15
|
+
linkDocument: LinkDocument;
|
|
16
|
+
gitHubListRepos: GitHubListReposTool;
|
|
17
|
+
gitHubGetRepo: GitHubGetRepoTool;
|
|
18
|
+
gitHubCreateRepo: GitHubCreateRepoTool;
|
|
19
|
+
gitHubListBranches: GitHubListBranchesTool;
|
|
20
|
+
gitHubListIssues: GitHubListIssuesTool;
|
|
21
|
+
gitHubGetIssue: GitHubGetIssueTool;
|
|
22
|
+
gitHubCreateIssue: GitHubCreateIssueTool;
|
|
23
|
+
gitHubCreateIssueComment: GitHubCreateIssueCommentTool;
|
|
24
|
+
gitHubListPullRequests: GitHubListPullRequestsTool;
|
|
25
|
+
gitHubGetPullRequest: GitHubGetPullRequestTool;
|
|
26
|
+
gitHubCreatePullRequest: GitHubCreatePullRequestTool;
|
|
27
|
+
gitHubMergePullRequest: GitHubMergePullRequestTool;
|
|
28
|
+
gitHubListPrReviews: GitHubListPrReviewsTool;
|
|
29
|
+
gitHubGetFileContent: GitHubGetFileContentTool;
|
|
30
|
+
gitHubCreateOrUpdateFile: GitHubCreateOrUpdateFileTool;
|
|
31
|
+
gitHubListDirectory: GitHubListDirectoryTool;
|
|
32
|
+
gitHubGetCommit: GitHubGetCommitTool;
|
|
33
|
+
gitHubListWorkflowRuns: GitHubListWorkflowRunsTool;
|
|
34
|
+
gitHubTriggerWorkflow: GitHubTriggerWorkflowTool;
|
|
35
|
+
gitHubGetWorkflowRun: GitHubGetWorkflowRunTool;
|
|
36
|
+
gitHubSearchCode: GitHubSearchCodeTool;
|
|
37
|
+
gitHubSearchRepos: GitHubSearchReposTool;
|
|
38
|
+
gitHubSearchIssues: GitHubSearchIssuesTool;
|
|
39
|
+
gitHubGetAuthenticatedUser: GitHubGetAuthenticatedUserTool;
|
|
40
|
+
gitHubListUserOrgs: GitHubListUserOrgsTool;
|
|
41
|
+
oAuth: OAuthWorkflow;
|
|
42
|
+
state: {
|
|
43
|
+
llmResult?: any;
|
|
44
|
+
delegateResult?: any;
|
|
45
|
+
};
|
|
46
|
+
runtime: any;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=github-agent.workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-agent.workflow.d.ts","sourceRoot":"","sources":["../../src/workflows/github-agent.workflow.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAOL,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,EACrB,4BAA4B,EAC5B,2B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,CAAC;IAC/C,wBAAwB,EAAE,4BAA4B,CAAC;IACvD,mBAAmB,EAAE,uBAAuB,CAAC;IAC7C,eAAe,EAAE,mBAAmB,CAAC;IAGrC,sBAAsB,EAAE,0BAA0B,CAAC;IACnD,qBAAqB,EAAE,yBAAyB,CAAC;IACjD,oBAAoB,EAAE,wBAAwB,CAAC;IAG/C,gBAAgB,EAAE,oBAAoB,CAAC;IACvC,iBAAiB,EAAE,qBAAqB,CAAC;IACzC,kBAAkB,EAAE,sBAAsB,CAAC;IAG3C,0BAA0B,EAAE,8BAA8B,CAAC;IAC3D,kBAAkB,EAAE,sBAAsB,CAAC;IAEvC,KAAK,EAAE,aAAa,CAAC;IAQvC,KAAK,EAAE;QACL,SAAS,CAAC,EAAE,GAAG,CAAC;QAChB,cAAc,CAAC,EAAE,GAAG,CAAC;KACtB,CAAC;IAGF,OAAO,EAAE,GAAG,CAAC;CACd"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GitHubAgentWorkflow = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const zod_1 = require("zod");
|
|
15
|
+
const claude_module_1 = require("@loopstack/claude-module");
|
|
16
|
+
const common_2 = require("@loopstack/common");
|
|
17
|
+
const core_1 = require("@loopstack/core");
|
|
18
|
+
const github_module_1 = require("@loopstack/github-module");
|
|
19
|
+
const oauth_module_1 = require("@loopstack/oauth-module");
|
|
20
|
+
const authenticate_github_task_tool_1 = require("../tools/authenticate-github-task.tool");
|
|
21
|
+
let GitHubAgentWorkflow = class GitHubAgentWorkflow {
|
|
22
|
+
createDocument;
|
|
23
|
+
claudeGenerateText;
|
|
24
|
+
delegateToolCalls;
|
|
25
|
+
updateToolResult;
|
|
26
|
+
task;
|
|
27
|
+
authenticateGitHub;
|
|
28
|
+
claudeMessageDocument;
|
|
29
|
+
linkDocument;
|
|
30
|
+
gitHubListRepos;
|
|
31
|
+
gitHubGetRepo;
|
|
32
|
+
gitHubCreateRepo;
|
|
33
|
+
gitHubListBranches;
|
|
34
|
+
gitHubListIssues;
|
|
35
|
+
gitHubGetIssue;
|
|
36
|
+
gitHubCreateIssue;
|
|
37
|
+
gitHubCreateIssueComment;
|
|
38
|
+
gitHubListPullRequests;
|
|
39
|
+
gitHubGetPullRequest;
|
|
40
|
+
gitHubCreatePullRequest;
|
|
41
|
+
gitHubMergePullRequest;
|
|
42
|
+
gitHubListPrReviews;
|
|
43
|
+
gitHubGetFileContent;
|
|
44
|
+
gitHubCreateOrUpdateFile;
|
|
45
|
+
gitHubListDirectory;
|
|
46
|
+
gitHubGetCommit;
|
|
47
|
+
gitHubListWorkflowRuns;
|
|
48
|
+
gitHubTriggerWorkflow;
|
|
49
|
+
gitHubGetWorkflowRun;
|
|
50
|
+
gitHubSearchCode;
|
|
51
|
+
gitHubSearchRepos;
|
|
52
|
+
gitHubSearchIssues;
|
|
53
|
+
gitHubGetAuthenticatedUser;
|
|
54
|
+
gitHubListUserOrgs;
|
|
55
|
+
oAuth;
|
|
56
|
+
state;
|
|
57
|
+
runtime;
|
|
58
|
+
};
|
|
59
|
+
exports.GitHubAgentWorkflow = GitHubAgentWorkflow;
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, common_2.InjectTool)(),
|
|
62
|
+
__metadata("design:type", core_1.CreateDocument)
|
|
63
|
+
], GitHubAgentWorkflow.prototype, "createDocument", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, common_2.InjectTool)(),
|
|
66
|
+
__metadata("design:type", claude_module_1.ClaudeGenerateText)
|
|
67
|
+
], GitHubAgentWorkflow.prototype, "claudeGenerateText", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, common_2.InjectTool)(),
|
|
70
|
+
__metadata("design:type", claude_module_1.DelegateToolCalls)
|
|
71
|
+
], GitHubAgentWorkflow.prototype, "delegateToolCalls", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, common_2.InjectTool)(),
|
|
74
|
+
__metadata("design:type", claude_module_1.UpdateToolResult)
|
|
75
|
+
], GitHubAgentWorkflow.prototype, "updateToolResult", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, common_2.InjectTool)(),
|
|
78
|
+
__metadata("design:type", core_1.Task)
|
|
79
|
+
], GitHubAgentWorkflow.prototype, "task", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, common_2.InjectTool)(),
|
|
82
|
+
__metadata("design:type", authenticate_github_task_tool_1.AuthenticateGitHubTask)
|
|
83
|
+
], GitHubAgentWorkflow.prototype, "authenticateGitHub", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, common_2.InjectDocument)(),
|
|
86
|
+
__metadata("design:type", claude_module_1.ClaudeMessageDocument)
|
|
87
|
+
], GitHubAgentWorkflow.prototype, "claudeMessageDocument", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, common_2.InjectDocument)(),
|
|
90
|
+
__metadata("design:type", core_1.LinkDocument)
|
|
91
|
+
], GitHubAgentWorkflow.prototype, "linkDocument", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, common_2.InjectTool)(),
|
|
94
|
+
__metadata("design:type", github_module_1.GitHubListReposTool)
|
|
95
|
+
], GitHubAgentWorkflow.prototype, "gitHubListRepos", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, common_2.InjectTool)(),
|
|
98
|
+
__metadata("design:type", github_module_1.GitHubGetRepoTool)
|
|
99
|
+
], GitHubAgentWorkflow.prototype, "gitHubGetRepo", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, common_2.InjectTool)(),
|
|
102
|
+
__metadata("design:type", github_module_1.GitHubCreateRepoTool)
|
|
103
|
+
], GitHubAgentWorkflow.prototype, "gitHubCreateRepo", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, common_2.InjectTool)(),
|
|
106
|
+
__metadata("design:type", github_module_1.GitHubListBranchesTool)
|
|
107
|
+
], GitHubAgentWorkflow.prototype, "gitHubListBranches", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, common_2.InjectTool)(),
|
|
110
|
+
__metadata("design:type", github_module_1.GitHubListIssuesTool)
|
|
111
|
+
], GitHubAgentWorkflow.prototype, "gitHubListIssues", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, common_2.InjectTool)(),
|
|
114
|
+
__metadata("design:type", github_module_1.GitHubGetIssueTool)
|
|
115
|
+
], GitHubAgentWorkflow.prototype, "gitHubGetIssue", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, common_2.InjectTool)(),
|
|
118
|
+
__metadata("design:type", github_module_1.GitHubCreateIssueTool)
|
|
119
|
+
], GitHubAgentWorkflow.prototype, "gitHubCreateIssue", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
(0, common_2.InjectTool)(),
|
|
122
|
+
__metadata("design:type", github_module_1.GitHubCreateIssueCommentTool)
|
|
123
|
+
], GitHubAgentWorkflow.prototype, "gitHubCreateIssueComment", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, common_2.InjectTool)(),
|
|
126
|
+
__metadata("design:type", github_module_1.GitHubListPullRequestsTool)
|
|
127
|
+
], GitHubAgentWorkflow.prototype, "gitHubListPullRequests", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
(0, common_2.InjectTool)(),
|
|
130
|
+
__metadata("design:type", github_module_1.GitHubGetPullRequestTool)
|
|
131
|
+
], GitHubAgentWorkflow.prototype, "gitHubGetPullRequest", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
(0, common_2.InjectTool)(),
|
|
134
|
+
__metadata("design:type", github_module_1.GitHubCreatePullRequestTool)
|
|
135
|
+
], GitHubAgentWorkflow.prototype, "gitHubCreatePullRequest", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
(0, common_2.InjectTool)(),
|
|
138
|
+
__metadata("design:type", github_module_1.GitHubMergePullRequestTool)
|
|
139
|
+
], GitHubAgentWorkflow.prototype, "gitHubMergePullRequest", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
(0, common_2.InjectTool)(),
|
|
142
|
+
__metadata("design:type", github_module_1.GitHubListPrReviewsTool)
|
|
143
|
+
], GitHubAgentWorkflow.prototype, "gitHubListPrReviews", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
(0, common_2.InjectTool)(),
|
|
146
|
+
__metadata("design:type", github_module_1.GitHubGetFileContentTool)
|
|
147
|
+
], GitHubAgentWorkflow.prototype, "gitHubGetFileContent", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
(0, common_2.InjectTool)(),
|
|
150
|
+
__metadata("design:type", github_module_1.GitHubCreateOrUpdateFileTool)
|
|
151
|
+
], GitHubAgentWorkflow.prototype, "gitHubCreateOrUpdateFile", void 0);
|
|
152
|
+
__decorate([
|
|
153
|
+
(0, common_2.InjectTool)(),
|
|
154
|
+
__metadata("design:type", github_module_1.GitHubListDirectoryTool)
|
|
155
|
+
], GitHubAgentWorkflow.prototype, "gitHubListDirectory", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
(0, common_2.InjectTool)(),
|
|
158
|
+
__metadata("design:type", github_module_1.GitHubGetCommitTool)
|
|
159
|
+
], GitHubAgentWorkflow.prototype, "gitHubGetCommit", void 0);
|
|
160
|
+
__decorate([
|
|
161
|
+
(0, common_2.InjectTool)(),
|
|
162
|
+
__metadata("design:type", github_module_1.GitHubListWorkflowRunsTool)
|
|
163
|
+
], GitHubAgentWorkflow.prototype, "gitHubListWorkflowRuns", void 0);
|
|
164
|
+
__decorate([
|
|
165
|
+
(0, common_2.InjectTool)(),
|
|
166
|
+
__metadata("design:type", github_module_1.GitHubTriggerWorkflowTool)
|
|
167
|
+
], GitHubAgentWorkflow.prototype, "gitHubTriggerWorkflow", void 0);
|
|
168
|
+
__decorate([
|
|
169
|
+
(0, common_2.InjectTool)(),
|
|
170
|
+
__metadata("design:type", github_module_1.GitHubGetWorkflowRunTool)
|
|
171
|
+
], GitHubAgentWorkflow.prototype, "gitHubGetWorkflowRun", void 0);
|
|
172
|
+
__decorate([
|
|
173
|
+
(0, common_2.InjectTool)(),
|
|
174
|
+
__metadata("design:type", github_module_1.GitHubSearchCodeTool)
|
|
175
|
+
], GitHubAgentWorkflow.prototype, "gitHubSearchCode", void 0);
|
|
176
|
+
__decorate([
|
|
177
|
+
(0, common_2.InjectTool)(),
|
|
178
|
+
__metadata("design:type", github_module_1.GitHubSearchReposTool)
|
|
179
|
+
], GitHubAgentWorkflow.prototype, "gitHubSearchRepos", void 0);
|
|
180
|
+
__decorate([
|
|
181
|
+
(0, common_2.InjectTool)(),
|
|
182
|
+
__metadata("design:type", github_module_1.GitHubSearchIssuesTool)
|
|
183
|
+
], GitHubAgentWorkflow.prototype, "gitHubSearchIssues", void 0);
|
|
184
|
+
__decorate([
|
|
185
|
+
(0, common_2.InjectTool)(),
|
|
186
|
+
__metadata("design:type", github_module_1.GitHubGetAuthenticatedUserTool)
|
|
187
|
+
], GitHubAgentWorkflow.prototype, "gitHubGetAuthenticatedUser", void 0);
|
|
188
|
+
__decorate([
|
|
189
|
+
(0, common_2.InjectTool)(),
|
|
190
|
+
__metadata("design:type", github_module_1.GitHubListUserOrgsTool)
|
|
191
|
+
], GitHubAgentWorkflow.prototype, "gitHubListUserOrgs", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
(0, common_2.InjectWorkflow)(),
|
|
194
|
+
__metadata("design:type", oauth_module_1.OAuthWorkflow)
|
|
195
|
+
], GitHubAgentWorkflow.prototype, "oAuth", void 0);
|
|
196
|
+
__decorate([
|
|
197
|
+
(0, common_2.State)({
|
|
198
|
+
schema: zod_1.z.object({
|
|
199
|
+
llmResult: zod_1.z.any().optional(),
|
|
200
|
+
delegateResult: zod_1.z.any().optional(),
|
|
201
|
+
}),
|
|
202
|
+
}),
|
|
203
|
+
__metadata("design:type", Object)
|
|
204
|
+
], GitHubAgentWorkflow.prototype, "state", void 0);
|
|
205
|
+
__decorate([
|
|
206
|
+
(0, common_2.Runtime)(),
|
|
207
|
+
__metadata("design:type", Object)
|
|
208
|
+
], GitHubAgentWorkflow.prototype, "runtime", void 0);
|
|
209
|
+
exports.GitHubAgentWorkflow = GitHubAgentWorkflow = __decorate([
|
|
210
|
+
(0, common_1.Injectable)(),
|
|
211
|
+
(0, common_2.Workflow)({
|
|
212
|
+
configFile: __dirname + '/github-agent.workflow.yaml',
|
|
213
|
+
})
|
|
214
|
+
], GitHubAgentWorkflow);
|
|
215
|
+
//# sourceMappingURL=github-agent.workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-agent.workflow.js","sourceRoot":"","sources":["../../src/workflows/github-agent.workflow.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6BAAwB;AACxB,4DAKkC;AAClC,8CAQ2B;AAC3B,0CAAqE;AACrE,4DA0BkC;AAClC,0DAAwD;AACxD,0FAAgF;AAMzE,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAChB,cAAc,CAAiB;IAC/B,kBAAkB,CAAqB;IACvC,iBAAiB,CAAoB;IACrC,gBAAgB,CAAmB;IACnC,IAAI,CA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