@elizaos/plugin-github 1.2.0 → 2.0.0-alpha.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.
@@ -1,3 +0,0 @@
1
- import { type Action } from '@elizaos/core';
2
- export declare const getRepositoryStatsAction: Action;
3
- export declare const getRepositoryTrafficAction: Action;
@@ -1,4 +0,0 @@
1
- import { type Action } from '@elizaos/core';
2
- export declare const getUserProfileAction: Action;
3
- export declare const getUserStatsAction: Action;
4
- export declare const listUserRepositoriesAction: Action;
@@ -1,5 +0,0 @@
1
- import { type Action } from '@elizaos/core';
2
- export declare const createWebhookAction: Action;
3
- export declare const listWebhooksAction: Action;
4
- export declare const deleteWebhookAction: Action;
5
- export declare const pingWebhookAction: Action;
package/dist/index.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import type { Plugin } from '@elizaos/core';
2
- import { type Action, type Provider } from '@elizaos/core';
3
- import { GitHubService } from './services/github';
4
- declare const githubActions: Action[];
5
- declare const githubProviders: Provider[];
6
- export declare const githubPlugin: Plugin;
7
- export { GitHubService, githubActions, githubProviders };
8
- export * from './types';
9
- export default githubPlugin;
@@ -1,6 +0,0 @@
1
- import { type Provider } from '@elizaos/core';
2
- export declare const githubRepositoryProvider: Provider;
3
- export declare const githubIssuesProvider: Provider;
4
- export declare const githubPullRequestsProvider: Provider;
5
- export declare const githubActivityProvider: Provider;
6
- export declare const githubUserProvider: Provider;
@@ -1,342 +0,0 @@
1
- import { Service, type IAgentRuntime } from '@elizaos/core';
2
- export interface GitHubConfig {
3
- GITHUB_TOKEN: string;
4
- GITHUB_USERNAME?: string;
5
- GITHUB_EMAIL?: string;
6
- }
7
- export interface GitHubActivityItem {
8
- id: string;
9
- timestamp: string;
10
- action: string;
11
- resource_type: 'repository' | 'issue' | 'pr' | 'user';
12
- resource_id: string;
13
- details: Record<string, any>;
14
- success: boolean;
15
- error?: string;
16
- }
17
- export declare class GitHubAPIError extends Error {
18
- status?: number;
19
- response?: any;
20
- constructor(message: string, status?: number, response?: any);
21
- }
22
- export declare class GitHubAuthenticationError extends GitHubAPIError {
23
- constructor(message: string);
24
- }
25
- export declare class GitHubRateLimitError extends GitHubAPIError {
26
- resetTime: number;
27
- constructor(message: string, resetTime: number);
28
- }
29
- export declare class GitHubService extends Service {
30
- static serviceType: string;
31
- capabilityDescription: string;
32
- private octokit;
33
- private rateLimitRemaining;
34
- private rateLimitReset;
35
- private activityLog;
36
- private githubConfig;
37
- constructor(runtime?: IAgentRuntime);
38
- static start(runtime: IAgentRuntime): Promise<GitHubService>;
39
- stop(): Promise<void>;
40
- /**
41
- * Validate authentication by checking user permissions
42
- */
43
- validateAuthentication(): Promise<boolean>;
44
- /**
45
- * Rate limiting helper to prevent hitting GitHub API limits
46
- */
47
- private checkRateLimit;
48
- /**
49
- * Update rate limit info from response headers
50
- */
51
- private updateRateLimit;
52
- /**
53
- * Sanitize error for logging (remove sensitive data)
54
- */
55
- private sanitizeError;
56
- /**
57
- * Validate GitHub username/repo name format
58
- */
59
- private validateGitHubName;
60
- /**
61
- * Get authenticated user information
62
- */
63
- getAuthenticatedUser(): Promise<any>;
64
- /**
65
- * Get user by username
66
- */
67
- getUserByUsername(username: string): Promise<any>;
68
- /**
69
- * Get repository information
70
- */
71
- getRepository(owner: string, repo: string): Promise<any>;
72
- /**
73
- * List repositories for authenticated user
74
- */
75
- getRepositories(options?: {
76
- visibility?: 'all' | 'public' | 'private';
77
- affiliation?: 'owner' | 'collaborator' | 'organization_member';
78
- type?: 'all' | 'owner' | 'public' | 'private' | 'member';
79
- sort?: 'created' | 'updated' | 'pushed' | 'full_name';
80
- direction?: 'asc' | 'desc';
81
- per_page?: number;
82
- }): Promise<any>;
83
- /**
84
- * Get repository issues
85
- */
86
- getRepositoryIssues(owner: string, repo: string, options?: {
87
- milestone?: string | number;
88
- state?: 'open' | 'closed' | 'all';
89
- assignee?: string;
90
- creator?: string;
91
- mentioned?: string;
92
- labels?: string;
93
- sort?: 'created' | 'updated' | 'comments';
94
- direction?: 'asc' | 'desc';
95
- since?: string;
96
- per_page?: number;
97
- }): Promise<any>;
98
- /**
99
- * Get specific issue
100
- */
101
- getIssue(owner: string, repo: string, issue_number: number): Promise<any>;
102
- /**
103
- * Create issue comment
104
- */
105
- createIssueComment(owner: string, repo: string, issue_number: number, body: string): Promise<any>;
106
- /**
107
- * Get issue comments
108
- */
109
- getIssueComments(owner: string, repo: string, issue_number: number, options?: {
110
- since?: string;
111
- per_page?: number;
112
- }): Promise<any>;
113
- /**
114
- * Get repository pull requests
115
- */
116
- getRepositoryPullRequests(owner: string, repo: string, options?: {
117
- state?: 'open' | 'closed' | 'all';
118
- head?: string;
119
- base?: string;
120
- sort?: 'created' | 'updated' | 'popularity';
121
- direction?: 'asc' | 'desc';
122
- per_page?: number;
123
- }): Promise<any>;
124
- /**
125
- * Get specific pull request
126
- */
127
- getPullRequest(owner: string, repo: string, pull_number: number): Promise<any>;
128
- /**
129
- * Create pull request
130
- */
131
- createPullRequest(owner: string, repo: string, options: {
132
- title: string;
133
- head: string;
134
- base: string;
135
- body?: string;
136
- maintainer_can_modify?: boolean;
137
- draft?: boolean;
138
- }): Promise<any>;
139
- /**
140
- * Create or update file
141
- */
142
- createOrUpdateFile(owner: string, repo: string, path: string, content: string, message: string, branch?: string, sha?: string): Promise<any>;
143
- /**
144
- * Get file content
145
- */
146
- getFileContent(owner: string, repo: string, path: string, ref?: string): Promise<{
147
- content: string;
148
- sha: string;
149
- }>;
150
- /**
151
- * Delete file
152
- */
153
- deleteFile(owner: string, repo: string, path: string, message: string, sha: string, branch?: string): Promise<any>;
154
- /**
155
- * Get repository tree
156
- */
157
- getRepositoryTree(owner: string, repo: string, tree_sha?: string): Promise<any[]>;
158
- /**
159
- * Get default branch
160
- */
161
- getDefaultBranch(owner: string, repo: string): Promise<string>;
162
- /**
163
- * Create webhook
164
- */
165
- createWebhook(owner: string, repo: string, config: {
166
- url: string;
167
- content_type?: 'json' | 'form';
168
- secret?: string;
169
- insecure_ssl?: string;
170
- }, events?: string[]): Promise<any>;
171
- /**
172
- * List webhooks
173
- */
174
- listWebhooks(owner: string, repo: string): Promise<any[]>;
175
- /**
176
- * Delete webhook
177
- */
178
- deleteWebhook(owner: string, repo: string, hook_id: number): Promise<void>;
179
- /**
180
- * Ping webhook
181
- */
182
- pingWebhook(owner: string, repo: string, hook_id: number): Promise<void>;
183
- /**
184
- * Get activity log for debugging and monitoring
185
- */
186
- getActivityLog(limit?: number): GitHubActivityItem[];
187
- /**
188
- * Clear activity log
189
- */
190
- clearActivityLog(): void;
191
- /**
192
- * Get rate limit status
193
- */
194
- getRateLimitStatus(): {
195
- remaining: number;
196
- reset: number;
197
- limit: number;
198
- used: number;
199
- resource: string;
200
- };
201
- /**
202
- * Get rate limit (alias for compatibility)
203
- */
204
- getRateLimit(): {
205
- remaining: number;
206
- reset: number;
207
- limit: number;
208
- used: number;
209
- resource: string;
210
- };
211
- /**
212
- * Get current authenticated user (alias for compatibility)
213
- */
214
- getCurrentUser(): Promise<any>;
215
- /**
216
- * Get Git reference
217
- */
218
- getRef(owner: string, repo: string, ref: string): Promise<any>;
219
- /**
220
- * Create a new branch
221
- */
222
- createBranch(owner: string, repo: string, branchName: string, sha: string): Promise<any>;
223
- /**
224
- * List branches
225
- */
226
- listBranches(owner: string, repo: string): Promise<any[]>;
227
- /**
228
- * Get branch details
229
- */
230
- getBranch(owner: string, repo: string, branch: string): Promise<any>;
231
- /**
232
- * Delete a branch
233
- */
234
- deleteBranch(owner: string, repo: string, branch: string): Promise<void>;
235
- /**
236
- * Compare two branches
237
- */
238
- compareBranches(owner: string, repo: string, base: string, head: string): Promise<any>;
239
- /**
240
- * Get branch protection settings
241
- */
242
- getBranchProtection(owner: string, repo: string, branch: string): Promise<any>;
243
- /**
244
- * List issues
245
- */
246
- listIssues(owner: string, repo: string, options?: any): Promise<any>;
247
- /**
248
- * Create issue
249
- */
250
- createIssue(owner: string, repo: string, options: {
251
- title: string;
252
- body?: string;
253
- assignees?: string[];
254
- milestone?: number;
255
- labels?: string[];
256
- }): Promise<any>;
257
- /**
258
- * Search issues
259
- */
260
- searchIssues(query: string, options?: any): Promise<any>;
261
- /**
262
- * Search pull requests
263
- */
264
- searchPullRequests(query: string, options?: any): Promise<any>;
265
- /**
266
- * List pull requests
267
- */
268
- listPullRequests(owner: string, repo: string, options?: any): Promise<any>;
269
- /**
270
- * Merge pull request
271
- */
272
- mergePullRequest(owner: string, repo: string, pull_number: number, options?: {
273
- commit_title?: string;
274
- commit_message?: string;
275
- merge_method?: 'merge' | 'squash' | 'rebase';
276
- }): Promise<any>;
277
- /**
278
- * List repositories
279
- */
280
- listRepositories(options?: any): Promise<any>;
281
- /**
282
- * Create repository
283
- */
284
- createRepository(options: {
285
- name: string;
286
- description?: string;
287
- private?: boolean;
288
- auto_init?: boolean;
289
- gitignore_template?: string;
290
- license_template?: string;
291
- }): Promise<any>;
292
- /**
293
- * Search repositories
294
- */
295
- searchRepositories(query: string, options?: any): Promise<any>;
296
- /**
297
- * Get contributors stats
298
- */
299
- getContributorsStats(owner: string, repo: string): Promise<any>;
300
- /**
301
- * Get commit activity stats
302
- */
303
- getCommitActivityStats(owner: string, repo: string): Promise<any>;
304
- /**
305
- * Get code frequency stats
306
- */
307
- getCodeFrequencyStats(owner: string, repo: string): Promise<any>;
308
- /**
309
- * Get repository languages
310
- */
311
- getLanguages(owner: string, repo: string): Promise<any>;
312
- /**
313
- * Get traffic views
314
- */
315
- getTrafficViews(owner: string, repo: string): Promise<any>;
316
- /**
317
- * Get traffic clones
318
- */
319
- getTrafficClones(owner: string, repo: string): Promise<any>;
320
- /**
321
- * Get top paths
322
- */
323
- getTopPaths(owner: string, repo: string): Promise<any>;
324
- /**
325
- * Get top referrers
326
- */
327
- getTopReferrers(owner: string, repo: string): Promise<any>;
328
- /**
329
- * Get user information
330
- */
331
- getUser(username: string): Promise<any>;
332
- /**
333
- * List user repositories
334
- */
335
- listUserRepositories(username: string, options?: any): Promise<any>;
336
- /**
337
- * List user events
338
- */
339
- listUserEvents(username: string, options?: any): Promise<any>;
340
- private logActivity;
341
- private handleError;
342
- }
@@ -1,4 +0,0 @@
1
- import { GitHubPluginTestSuite, GitHubIntelligentAnalysisTestSuite } from './tests';
2
- export { GitHubPluginTestSuite, GitHubIntelligentAnalysisTestSuite };
3
- export declare const AllGitHubTestSuites: import("./__tests__/e2e/intelligent-analysis.test").IntelligentAnalysisTestSuite[];
4
- export default GitHubPluginTestSuite;
package/dist/tests.d.ts DELETED
@@ -1,20 +0,0 @@
1
- import { type IAgentRuntime } from '@elizaos/core';
2
- export declare const githubPluginTestSuite: {
3
- name: string;
4
- description: string;
5
- tests: {
6
- name: string;
7
- fn: (runtime: IAgentRuntime) => Promise<void>;
8
- }[];
9
- };
10
- export declare const GitHubPluginTestSuite: {
11
- name: string;
12
- description: string;
13
- tests: {
14
- name: string;
15
- fn: (runtime: IAgentRuntime) => Promise<void>;
16
- }[];
17
- };
18
- export declare const GitHubIntelligentAnalysisTestSuite: import("./__tests__/e2e/intelligent-analysis.test").IntelligentAnalysisTestSuite;
19
- export declare const AllGitHubTestSuites: import("./__tests__/e2e/intelligent-analysis.test").IntelligentAnalysisTestSuite[];
20
- export default githubPluginTestSuite;
package/dist/types.d.ts DELETED
@@ -1,290 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const githubConfigSchema: z.ZodObject<{
3
- GITHUB_TOKEN: z.ZodEffects<z.ZodString, string, string>;
4
- GITHUB_OWNER: z.ZodOptional<z.ZodString>;
5
- GITHUB_WEBHOOK_SECRET: z.ZodOptional<z.ZodString>;
6
- }, "strip", z.ZodTypeAny, {
7
- GITHUB_TOKEN?: string;
8
- GITHUB_OWNER?: string;
9
- GITHUB_WEBHOOK_SECRET?: string;
10
- }, {
11
- GITHUB_TOKEN?: string;
12
- GITHUB_OWNER?: string;
13
- GITHUB_WEBHOOK_SECRET?: string;
14
- }>;
15
- export declare const githubConfigSchemaFlexible: z.ZodObject<{
16
- GITHUB_TOKEN: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull, z.ZodUndefined]>>>, string, string>;
17
- GITHUB_OWNER: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull, z.ZodUndefined]>>>;
18
- GITHUB_WEBHOOK_SECRET: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull, z.ZodUndefined]>>>;
19
- }, "strip", z.ZodTypeAny, {
20
- GITHUB_TOKEN?: string;
21
- GITHUB_OWNER?: string;
22
- GITHUB_WEBHOOK_SECRET?: string;
23
- }, {
24
- GITHUB_TOKEN?: string;
25
- GITHUB_OWNER?: string;
26
- GITHUB_WEBHOOK_SECRET?: string;
27
- }>;
28
- export type GitHubConfig = z.infer<typeof githubConfigSchema>;
29
- export interface GitHubRepository {
30
- id: number;
31
- name: string;
32
- full_name: string;
33
- description: string | null;
34
- html_url: string;
35
- clone_url: string;
36
- ssh_url: string;
37
- private: boolean;
38
- fork: boolean;
39
- archived: boolean;
40
- disabled: boolean;
41
- created_at: string;
42
- updated_at: string;
43
- pushed_at: string;
44
- size: number;
45
- stargazers_count: number;
46
- watchers_count: number;
47
- forks_count: number;
48
- open_issues_count: number;
49
- language: string | null;
50
- topics: string[];
51
- license: {
52
- key: string;
53
- name: string;
54
- spdx_id: string;
55
- } | null;
56
- default_branch: string;
57
- owner: {
58
- login: string;
59
- id: number;
60
- type: 'User' | 'Organization';
61
- avatar_url: string;
62
- };
63
- }
64
- export interface GitHubIssue {
65
- id: number;
66
- number: number;
67
- title: string;
68
- body: string | null;
69
- state: 'open' | 'closed';
70
- labels: Array<{
71
- id: number;
72
- name: string;
73
- color: string;
74
- description: string | null;
75
- }>;
76
- assignees: Array<{
77
- login: string;
78
- id: number;
79
- avatar_url: string;
80
- }>;
81
- user: {
82
- login: string;
83
- id: number;
84
- avatar_url: string;
85
- };
86
- created_at: string;
87
- updated_at: string;
88
- closed_at: string | null;
89
- html_url: string;
90
- comments: number;
91
- milestone: {
92
- id: number;
93
- title: string;
94
- description: string | null;
95
- state: 'open' | 'closed';
96
- due_on: string | null;
97
- } | null;
98
- }
99
- export interface GitHubPullRequest {
100
- id: number;
101
- number: number;
102
- title: string;
103
- body: string | null;
104
- state: 'open' | 'closed' | 'merged';
105
- draft: boolean;
106
- merged: boolean;
107
- mergeable: boolean | null;
108
- merged_at: string | null;
109
- head: {
110
- ref: string;
111
- sha: string;
112
- repo: GitHubRepository | null;
113
- };
114
- base: {
115
- ref: string;
116
- sha: string;
117
- repo: GitHubRepository;
118
- };
119
- user: {
120
- login: string;
121
- id: number;
122
- avatar_url: string;
123
- };
124
- assignees: Array<{
125
- login: string;
126
- id: number;
127
- avatar_url: string;
128
- }>;
129
- labels: Array<{
130
- id: number;
131
- name: string;
132
- color: string;
133
- description: string | null;
134
- }>;
135
- created_at: string;
136
- updated_at: string;
137
- html_url: string;
138
- comments: number;
139
- commits: number;
140
- additions: number;
141
- deletions: number;
142
- changed_files: number;
143
- }
144
- export interface CreateRepositoryOptions {
145
- name: string;
146
- description?: string;
147
- private?: boolean;
148
- auto_init?: boolean;
149
- gitignore_template?: string;
150
- license_template?: string;
151
- allow_squash_merge?: boolean;
152
- allow_merge_commit?: boolean;
153
- allow_rebase_merge?: boolean;
154
- delete_branch_on_merge?: boolean;
155
- has_issues?: boolean;
156
- has_projects?: boolean;
157
- has_wiki?: boolean;
158
- has_downloads?: boolean;
159
- homepage?: string;
160
- topics?: string[];
161
- }
162
- export interface CreateIssueOptions {
163
- title: string;
164
- body?: string;
165
- assignees?: string[];
166
- milestone?: number;
167
- labels?: string[];
168
- }
169
- export interface CreatePullRequestOptions {
170
- title: string;
171
- head: string;
172
- base: string;
173
- body?: string;
174
- draft?: boolean;
175
- maintainer_can_modify?: boolean;
176
- }
177
- export interface GitHubActivityItem {
178
- id: string;
179
- timestamp: string;
180
- action: string;
181
- resource_type: 'repository' | 'issue' | 'pull_request';
182
- resource_id: string;
183
- details: Record<string, any>;
184
- success: boolean;
185
- error?: string;
186
- }
187
- export interface GitHubSearchResult<T> {
188
- total_count: number;
189
- incomplete_results: boolean;
190
- items: T[];
191
- }
192
- export interface GitHubWebhookPayload {
193
- action: string;
194
- repository?: GitHubRepository;
195
- issue?: GitHubIssue;
196
- pull_request?: GitHubPullRequest;
197
- sender: {
198
- login: string;
199
- id: number;
200
- avatar_url: string;
201
- };
202
- }
203
- export interface GitHubRateLimit {
204
- limit: number;
205
- remaining: number;
206
- reset: number;
207
- used: number;
208
- resource: string;
209
- }
210
- export declare class GitHubAPIError extends Error {
211
- status: number;
212
- response?: any;
213
- constructor(message: string, status: number, response?: any);
214
- }
215
- export declare class GitHubAuthenticationError extends GitHubAPIError {
216
- constructor(message?: string);
217
- }
218
- export declare class GitHubRateLimitError extends GitHubAPIError {
219
- resetTime: number;
220
- constructor(message: string, resetTime: number);
221
- }
222
- export declare const createRepositorySchema: z.ZodObject<{
223
- name: z.ZodString;
224
- description: z.ZodOptional<z.ZodString>;
225
- private: z.ZodDefault<z.ZodBoolean>;
226
- auto_init: z.ZodDefault<z.ZodBoolean>;
227
- gitignore_template: z.ZodOptional<z.ZodString>;
228
- license_template: z.ZodOptional<z.ZodString>;
229
- homepage: z.ZodOptional<z.ZodString>;
230
- topics: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
231
- }, "strip", z.ZodTypeAny, {
232
- name?: string;
233
- private?: boolean;
234
- description?: string;
235
- topics?: string[];
236
- homepage?: string;
237
- auto_init?: boolean;
238
- gitignore_template?: string;
239
- license_template?: string;
240
- }, {
241
- name?: string;
242
- private?: boolean;
243
- description?: string;
244
- topics?: string[];
245
- homepage?: string;
246
- auto_init?: boolean;
247
- gitignore_template?: string;
248
- license_template?: string;
249
- }>;
250
- export declare const createIssueSchema: z.ZodObject<{
251
- title: z.ZodString;
252
- body: z.ZodOptional<z.ZodString>;
253
- assignees: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
254
- labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
255
- milestone: z.ZodOptional<z.ZodNumber>;
256
- }, "strip", z.ZodTypeAny, {
257
- body?: string;
258
- title?: string;
259
- labels?: string[];
260
- milestone?: number;
261
- assignees?: string[];
262
- }, {
263
- body?: string;
264
- title?: string;
265
- labels?: string[];
266
- milestone?: number;
267
- assignees?: string[];
268
- }>;
269
- export declare const createPullRequestSchema: z.ZodObject<{
270
- title: z.ZodString;
271
- head: z.ZodString;
272
- base: z.ZodString;
273
- body: z.ZodOptional<z.ZodString>;
274
- draft: z.ZodDefault<z.ZodBoolean>;
275
- maintainer_can_modify: z.ZodDefault<z.ZodBoolean>;
276
- }, "strip", z.ZodTypeAny, {
277
- base?: string;
278
- body?: string;
279
- head?: string;
280
- title?: string;
281
- draft?: boolean;
282
- maintainer_can_modify?: boolean;
283
- }, {
284
- base?: string;
285
- body?: string;
286
- head?: string;
287
- title?: string;
288
- draft?: boolean;
289
- maintainer_can_modify?: boolean;
290
- }>;