@elizaos/plugin-github 2.0.0-alpha.6 → 2.0.3-beta.2

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shaw Walters and elizaOS Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,86 @@
1
+ # @elizaos/plugin-github
2
+
3
+ GitHub integration for elizaOS agents. Enables agents to manage pull requests, issues, and notifications using the GitHub REST API via Octokit.
4
+
5
+ ## What it does
6
+
7
+ - **List pull requests** — open/closed/all for a specific repo or across accessible repos, with optional author filter.
8
+ - **Review pull requests** — submit approve, request-changes, or comment reviews (requires confirmation).
9
+ - **Issue management** — create, assign, close, reopen, comment on, or label issues (all write ops require confirmation).
10
+ - **Notification triage** — fetch unread GitHub notifications and return them ranked by priority score (reason, subject type, repo freshness). Read-only, no confirmation needed.
11
+ - **PAT management** — REST endpoints for storing/removing a GitHub Personal Access Token from local disk (`<state-dir>/credentials/github.json`).
12
+
13
+ ## Enabling the plugin
14
+
15
+ Add `"@elizaos/plugin-github"` to the agent's `plugins` array in its character file or runtime configuration. The plugin is opt-in.
16
+
17
+ ## Required configuration
18
+
19
+ At least one GitHub token must be configured. The plugin supports two roles:
20
+
21
+ - **`user`** — acts on behalf of the human (used for reviews and notifications by default).
22
+ - **`agent`** — acts on behalf of the Eliza agent (used for issue and PR ops by default).
23
+
24
+ ### Multi-account (recommended)
25
+
26
+ Set `GITHUB_ACCOUNTS` to a JSON array:
27
+
28
+ ```json
29
+ [
30
+ { "accountId": "user", "role": "user", "token": "ghp_..." },
31
+ { "accountId": "agent", "role": "agent", "token": "ghp_..." }
32
+ ]
33
+ ```
34
+
35
+ ### Legacy single-account
36
+
37
+ | Env var | Role |
38
+ |---|---|
39
+ | `GITHUB_USER_PAT` | user |
40
+ | `GITHUB_AGENT_PAT` | agent |
41
+
42
+ ### OAuth (optional)
43
+
44
+ To enable OAuth-app flows through the connector account manager, also set:
45
+
46
+ - `GITHUB_OAUTH_CLIENT_ID`
47
+ - `GITHUB_OAUTH_CLIENT_SECRET`
48
+ - `GITHUB_OAUTH_REDIRECT_URI`
49
+
50
+ ## Actions
51
+
52
+ The plugin exposes one umbrella action `GITHUB` that dispatches to sub-operations via an `action` parameter:
53
+
54
+ | `action` value | What it does |
55
+ |---|---|
56
+ | `pr_list` | List pull requests |
57
+ | `pr_review` | Submit a PR review (requires `review_action`: approve / request-changes / comment) |
58
+ | `issue_create` | Create a new issue (`title` required) |
59
+ | `issue_assign` | Assign users to an issue |
60
+ | `issue_close` | Close an issue |
61
+ | `issue_reopen` | Reopen a closed issue |
62
+ | `issue_comment` | Add a comment to an issue |
63
+ | `issue_label` | Apply labels to an issue |
64
+ | `notification_triage` | Fetch and rank unread notifications |
65
+
66
+ All write operations require confirmation before they execute.
67
+
68
+ ## HTTP routes
69
+
70
+ The plugin registers three routes on the agent's server for PAT management:
71
+
72
+ | Method | Path | Description |
73
+ |---|---|---|
74
+ | `GET` | `/api/github/token` | Returns connection status (token never exposed) |
75
+ | `POST` | `/api/github/token` | Save a PAT (validated against GitHub `/user` before save) |
76
+ | `DELETE` | `/api/github/token` | Remove the saved PAT |
77
+
78
+ ## Development
79
+
80
+ ```bash
81
+ bun run --cwd plugins/plugin-github build
82
+ bun run --cwd plugins/plugin-github test
83
+ bun run --cwd plugins/plugin-github typecheck
84
+ ```
85
+
86
+ See [CLAUDE.md](CLAUDE.md) for agent-facing layout and extension guide.
package/package.json CHANGED
@@ -1,119 +1,57 @@
1
1
  {
2
2
  "name": "@elizaos/plugin-github",
3
- "version": "2.0.0-alpha.6",
3
+ "version": "2.0.3-beta.2",
4
+ "description": "GitHub integration plugin for elizaOS agents — PRs, issues, notifications via the GitHub REST API",
4
5
  "type": "module",
5
6
  "main": "dist/index.js",
6
- "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
- "repository": {
9
- "type": "git",
10
- "url": "git+https://github.com/elizaos-plugins/plugin-github.git"
11
- },
12
8
  "exports": {
13
- "./package.json": "./package.json",
14
9
  ".": {
15
- "import": {
16
- "types": "./dist/index.d.ts",
17
- "default": "./dist/index.js"
18
- }
10
+ "types": "./dist/index.d.ts",
11
+ "eliza-source": {
12
+ "types": "./src/index.ts",
13
+ "import": "./src/index.ts",
14
+ "default": "./src/index.ts"
15
+ },
16
+ "import": "./dist/index.js",
17
+ "default": "./dist/index.js"
18
+ },
19
+ "./*.css": "./dist/*.css",
20
+ "./*": {
21
+ "types": "./dist/*.d.ts",
22
+ "eliza-source": {
23
+ "types": "./src/*.ts",
24
+ "import": "./src/*.ts",
25
+ "default": "./src/*.ts"
26
+ },
27
+ "import": "./dist/*.js",
28
+ "default": "./dist/*.js"
19
29
  }
20
30
  },
21
31
  "files": [
22
32
  "dist"
23
33
  ],
34
+ "scripts": {
35
+ "build": "tsup src/index.ts src/register-routes.ts --format esm --dts --clean",
36
+ "test": "vitest run",
37
+ "typecheck": "tsgo --noEmit",
38
+ "clean": "rm -rf dist .turbo"
39
+ },
24
40
  "dependencies": {
25
- "@elizaos/core": "2.0.0-alpha.3",
26
- "@octokit/rest": "^21.0.0",
27
- "@octokit/types": "^13.0.0",
28
- "@octokit/webhooks-types": "^7.5.0",
29
- "glob": "^11.0.0",
30
- "simple-git": "^3.27.0",
31
- "zod": "^4.3.6"
41
+ "@elizaos/core": "2.0.3-beta.2",
42
+ "@octokit/rest": "^22.0.0"
32
43
  },
33
- "devDependencies": {
34
- "@biomejs/biome": "^2.3.11",
35
- "@types/node": "^25.0.3",
36
- "typescript": "^5.9.3"
44
+ "peerDependencies": {
45
+ "@elizaos/core": "2.0.3-beta.2"
37
46
  },
38
- "scripts": {
39
- "dev": "bun --hot build.ts",
40
- "typecheck": "tsc --noEmit -p tsconfig.json",
41
- "test": "vitest run __tests__/ --passWithNoTests",
42
- "test:unit": "vitest run __tests__/ --passWithNoTests",
43
- "test:integration": "echo 'Integration tests require elizaos CLI - skipping'",
44
- "lint": "bunx @biomejs/biome check --write --unsafe .",
45
- "lint:check": "biome check .",
46
- "clean": "rm -rf dist .turbo node_modules .turbo-tsconfig.json tsconfig.tsbuildinfo",
47
- "format": "biome format --write .",
48
- "format:check": "biome format .",
49
- "build": "bun run build.ts",
50
- "build:ts": "bun run build.ts"
47
+ "devDependencies": {
48
+ "@types/node": "24.12.2",
49
+ "tsup": "8.5.1",
50
+ "typescript": "^6.0.3",
51
+ "vitest": "4.1.9"
51
52
  },
52
53
  "publishConfig": {
53
54
  "access": "public"
54
55
  },
55
- "agentConfig": {
56
- "pluginType": "elizaos:plugin:1.0.0",
57
- "pluginParameters": {
58
- "GITHUB_API_TOKEN": {
59
- "type": "string",
60
- "description": "GitHub personal access token for API authentication",
61
- "required": true,
62
- "sensitive": true
63
- },
64
- "GITHUB_OWNER": {
65
- "type": "string",
66
- "description": "Default GitHub repository owner (username or organization)",
67
- "required": false,
68
- "sensitive": false
69
- },
70
- "GITHUB_REPO": {
71
- "type": "string",
72
- "description": "Default GitHub repository name",
73
- "required": false,
74
- "sensitive": false
75
- },
76
- "GITHUB_BRANCH": {
77
- "type": "string",
78
- "description": "Default branch name (defaults to main)",
79
- "required": false,
80
- "default": "main",
81
- "sensitive": false
82
- },
83
- "GITHUB_WEBHOOK_SECRET": {
84
- "type": "string",
85
- "description": "Secret for validating GitHub webhook payloads",
86
- "required": false,
87
- "sensitive": true
88
- },
89
- "GITHUB_APP_ID": {
90
- "type": "string",
91
- "description": "GitHub App ID for app-based authentication",
92
- "required": false,
93
- "sensitive": false
94
- },
95
- "GITHUB_APP_PRIVATE_KEY": {
96
- "type": "string",
97
- "description": "GitHub App private key for app-based authentication",
98
- "required": false,
99
- "sensitive": true
100
- },
101
- "GITHUB_INSTALLATION_ID": {
102
- "type": "string",
103
- "description": "GitHub App installation ID",
104
- "required": false,
105
- "sensitive": false
106
- }
107
- }
108
- },
109
- "gitHead": "646c632924826e2b75c2304a75ee56959fe4a460",
110
- "milady": {
111
- "platforms": [
112
- "node"
113
- ],
114
- "runtime": "node",
115
- "platformDetails": {
116
- "node": "ESM build available via exports.import"
117
- }
118
- }
56
+ "gitHead": "82fe0f44215954c2417328203f5bd6510985c1fc"
119
57
  }