@framers/agentos-ext-github 0.1.3 → 0.1.5

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.
Files changed (3) hide show
  1. package/README.md +346 -0
  2. package/manifest.json +1 -1
  3. package/package.json +3 -3
package/README.md ADDED
@@ -0,0 +1,346 @@
1
+ # GitHub
2
+
3
+ This pack gives an agent tools for repository search, issues, pull requests, files, branches, commits, releases, workflow dispatch, gists, and repository indexing. It uses the GitHub API through `@octokit/rest`.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @framers/agentos-ext-github
9
+ ```
10
+
11
+ Peer dependency: `@framers/agentos` with range `>=0.10.40`.
12
+
13
+ ## Usage
14
+
15
+ ```ts
16
+ import { AgentOS } from '@framers/agentos';
17
+
18
+ const agentos = await AgentOS.create({
19
+ extensionManifest: {
20
+ packs: [
21
+ {
22
+ package: '@framers/agentos-ext-github',
23
+ options: { token: process.env.GITHUB_TOKEN ?? process.env.GH_TOKEN },
24
+ },
25
+ ],
26
+ },
27
+ });
28
+ ```
29
+
30
+ ## Configuration
31
+
32
+ | Option | Secret id | Environment variable | Required | Default |
33
+ | --- | --- | --- | --- | --- |
34
+ | `token` | `github.token` | `GITHUB_TOKEN`, then `GH_TOKEN` | Yes | Token from `gh auth token` |
35
+ | `secrets` in options or context | `github.token` | None | No | `options.secrets ?? context.secrets` |
36
+ | `priority` | None | None | No | `30` |
37
+
38
+ Token resolution checks `options.token`, the `github.token` entry in the selected secrets map, `GITHUB_TOKEN`, `GH_TOKEN`, then `gh auth token`. The manifest declares `github.token` as required.
39
+
40
+ ## Tools
41
+
42
+ | Tool | What it does |
43
+ | --- | --- |
44
+ | `github_search` | Searches GitHub repositories, code, issues, or users. |
45
+ | `github_issue_list` | Lists repository issues with state and label filters. |
46
+ | `github_issue_create` | Creates an issue in a GitHub repository. |
47
+ | `github_issue_update` | Updates the provided fields of an existing GitHub issue. |
48
+ | `github_comment_list` | Lists comments on an issue or pull request. |
49
+ | `github_pr_list` | Lists pull requests with state, head, and base branch filters. |
50
+ | `github_pr_create` | Creates a pull request in a GitHub repository. |
51
+ | `github_pr_diff` | Gets changed files and optional patches for a pull request. |
52
+ | `github_pr_review` | Creates a pull request review with optional inline comments. |
53
+ | `github_pr_merge` | Merges a pull request using merge, squash, or rebase. |
54
+ | `github_pr_comment_list` | Lists inline review comments on a pull request. |
55
+ | `github_pr_comment_create` | Adds a top-level comment to a pull request. |
56
+ | `github_file_read` | Reads repository file contents as decoded UTF-8 text. |
57
+ | `github_gist_create` | Creates a GitHub gist containing files. |
58
+ | `github_repo_list` | Lists repositories for a GitHub user or organisation. |
59
+ | `github_repo_info` | Gets repository metadata including stars, forks, topics, license, and default branch. |
60
+ | `github_repo_create` | Creates a repository for the authenticated user. |
61
+ | `github_repo_index` | Fetches repository metadata, file tree, README, documentation, and `package.json` as text chunks. |
62
+ | `github_release_list` | Lists repository releases with tag, name, status, and publish date. |
63
+ | `github_release_create` | Creates a release with draft, prerelease, and generated release notes options. |
64
+ | `github_actions_list` | Lists workflow runs with an optional workflow filter. |
65
+ | `github_actions_trigger` | Triggers a workflow dispatch with optional inputs and target ref. |
66
+ | `github_file_write` | Creates or updates a repository file using an existing file SHA for updates. |
67
+ | `github_branch_list` | Lists branches with commit SHA and protection status. |
68
+ | `github_branch_create` | Creates a branch and resolves a named source branch to its HEAD SHA. |
69
+ | `github_commit_list` | Lists commits with branch, path, author, and date filters. |
70
+
71
+ ### `github_search`
72
+
73
+ | Parameter | Type | Required | Description |
74
+ | --- | --- | --- | --- |
75
+ | `query` | `string` | Yes | Search query (GitHub search syntax supported) |
76
+ | `type` | `string: repositories, code, issues, users` | No | Search type (default: repositories) |
77
+ | `per_page` | `number` | No | Results per page (max 30, default 10) |
78
+
79
+ ### `github_issue_list`
80
+
81
+ | Parameter | Type | Required | Description |
82
+ | --- | --- | --- | --- |
83
+ | `owner` | `string` | Yes | Repository owner (user or org) |
84
+ | `repo` | `string` | Yes | Repository name |
85
+ | `state` | `string: open, closed, all` | No | Issue state filter (default: open) |
86
+ | `labels` | `string` | No | Comma-separated label names to filter by |
87
+ | `per_page` | `number` | No | Results per page (max 30, default 10) |
88
+
89
+ ### `github_issue_create`
90
+
91
+ | Parameter | Type | Required | Description |
92
+ | --- | --- | --- | --- |
93
+ | `owner` | `string` | Yes | Repository owner (user or org) |
94
+ | `repo` | `string` | Yes | Repository name |
95
+ | `title` | `string` | Yes | Issue title |
96
+ | `body` | `string` | No | Issue body (Markdown supported) |
97
+ | `labels` | `array of string` | No | Labels to apply |
98
+ | `assignees` | `array of string` | No | GitHub usernames to assign |
99
+
100
+ ### `github_issue_update`
101
+
102
+ | Parameter | Type | Required | Description |
103
+ | --- | --- | --- | --- |
104
+ | `owner` | `string` | Yes | Repository owner (user or org) |
105
+ | `repo` | `string` | Yes | Repository name |
106
+ | `issue_number` | `number` | Yes | Issue number to update |
107
+ | `title` | `string` | No | New issue title |
108
+ | `body` | `string` | No | New issue body (Markdown supported) |
109
+ | `state` | `string: open, closed` | No | Set issue state |
110
+ | `labels` | `array of string` | No | Replace labels (full set, not additive) |
111
+ | `assignees` | `array of string` | No | Replace assignees (full set, not additive) |
112
+
113
+ ### `github_comment_list`
114
+
115
+ | Parameter | Type | Required | Description |
116
+ | --- | --- | --- | --- |
117
+ | `owner` | `string` | Yes | Repository owner (user or org) |
118
+ | `repo` | `string` | Yes | Repository name |
119
+ | `issue_number` | `number` | Yes | Issue or PR number |
120
+ | `per_page` | `number` | No | Results per page (max 30, default 10) |
121
+
122
+ ### `github_pr_list`
123
+
124
+ | Parameter | Type | Required | Description |
125
+ | --- | --- | --- | --- |
126
+ | `owner` | `string` | Yes | Repository owner (user or org) |
127
+ | `repo` | `string` | Yes | Repository name |
128
+ | `state` | `string: open, closed, all` | No | PR state filter (default: open) |
129
+ | `head` | `string` | No | Filter by head branch (user:branch format) |
130
+ | `base` | `string` | No | Filter by base branch |
131
+ | `per_page` | `number` | No | Results per page (max 30, default 10) |
132
+
133
+ ### `github_pr_create`
134
+
135
+ | Parameter | Type | Required | Description |
136
+ | --- | --- | --- | --- |
137
+ | `owner` | `string` | Yes | Repository owner (user or org) |
138
+ | `repo` | `string` | Yes | Repository name |
139
+ | `title` | `string` | Yes | PR title |
140
+ | `head` | `string` | Yes | Head branch name (source) |
141
+ | `base` | `string` | Yes | Base branch name (target, e.g. "main") |
142
+ | `body` | `string` | No | PR description (Markdown supported) |
143
+ | `draft` | `boolean` | No | Create as draft PR (default: false) |
144
+
145
+ ### `github_pr_diff`
146
+
147
+ | Parameter | Type | Required | Description |
148
+ | --- | --- | --- | --- |
149
+ | `owner` | `string` | Yes | Repository owner (user or org) |
150
+ | `repo` | `string` | Yes | Repository name |
151
+ | `pull_number` | `number` | Yes | Pull request number |
152
+ | `include_patch` | `boolean` | No | Include patch/diff text per file (default: false). Patches are truncated to 3000 chars. |
153
+
154
+ ### `github_pr_review`
155
+
156
+ | Parameter | Type | Required | Description |
157
+ | --- | --- | --- | --- |
158
+ | `owner` | `string` | Yes | Repository owner (user or org) |
159
+ | `repo` | `string` | Yes | Repository name |
160
+ | `pull_number` | `number` | Yes | Pull request number |
161
+ | `event` | `string: APPROVE, COMMENT, REQUEST_CHANGES` | Yes | Review action: APPROVE, COMMENT, or REQUEST_CHANGES |
162
+ | `body` | `string` | No | Review body/summary (required for REQUEST_CHANGES) |
163
+ | `comments` | `array of object` | No | Inline review comments |
164
+ | `comments[].path` | `string` | Yes, within each comment | File path relative to repo root |
165
+ | `comments[].line` | `number` | Yes, within each comment | Line number in the diff to comment on |
166
+ | `comments[].body` | `string` | Yes, within each comment | Comment body |
167
+
168
+ ### `github_pr_merge`
169
+
170
+ | Parameter | Type | Required | Description |
171
+ | --- | --- | --- | --- |
172
+ | `owner` | `string` | Yes | Repository owner (user or org) |
173
+ | `repo` | `string` | Yes | Repository name |
174
+ | `pull_number` | `number` | Yes | Pull request number |
175
+ | `merge_method` | `string: merge, squash, rebase` | No | Merge strategy (default: merge) |
176
+ | `commit_title` | `string` | No | Custom merge commit title |
177
+ | `commit_message` | `string` | No | Custom merge commit message body |
178
+
179
+ ### `github_pr_comment_list`
180
+
181
+ | Parameter | Type | Required | Description |
182
+ | --- | --- | --- | --- |
183
+ | `owner` | `string` | Yes | Repository owner (user or org) |
184
+ | `repo` | `string` | Yes | Repository name |
185
+ | `pull_number` | `number` | Yes | Pull request number |
186
+ | `per_page` | `number` | No | Results per page (max 30, default 10) |
187
+
188
+ ### `github_pr_comment_create`
189
+
190
+ | Parameter | Type | Required | Description |
191
+ | --- | --- | --- | --- |
192
+ | `owner` | `string` | Yes | Repository owner (user or org) |
193
+ | `repo` | `string` | Yes | Repository name |
194
+ | `pull_number` | `number` | Yes | Pull request number |
195
+ | `body` | `string` | Yes | Comment body (Markdown supported) |
196
+
197
+ ### `github_file_read`
198
+
199
+ | Parameter | Type | Required | Description |
200
+ | --- | --- | --- | --- |
201
+ | `owner` | `string` | Yes | Repository owner (user or org) |
202
+ | `repo` | `string` | Yes | Repository name |
203
+ | `path` | `string` | Yes | File path within the repository |
204
+ | `ref` | `string` | No | Branch, tag, or commit SHA (default: default branch) |
205
+
206
+ ### `github_gist_create`
207
+
208
+ | Parameter | Type | Required | Description |
209
+ | --- | --- | --- | --- |
210
+ | `description` | `string` | No | Gist description |
211
+ | `files` | `object with string values` | Yes | Map of filename to content. Example: {"main.py": "print('hello')"} |
212
+ | `public` | `boolean` | No | Whether the gist is public (default: false) |
213
+
214
+ ### `github_repo_list`
215
+
216
+ | Parameter | Type | Required | Description |
217
+ | --- | --- | --- | --- |
218
+ | `username` | `string` | Yes | GitHub username or organisation name |
219
+ | `type` | `string: user, org` | No | Account type: "user" (default) or "org" |
220
+ | `sort` | `string: created, updated, pushed, full_name` | No | Sort field (default: updated) |
221
+ | `per_page` | `number` | No | Results per page (max 100, default 30) |
222
+
223
+ ### `github_repo_info`
224
+
225
+ | Parameter | Type | Required | Description |
226
+ | --- | --- | --- | --- |
227
+ | `owner` | `string` | Yes | Repository owner (user or org) |
228
+ | `repo` | `string` | Yes | Repository name |
229
+
230
+ ### `github_repo_create`
231
+
232
+ | Parameter | Type | Required | Description |
233
+ | --- | --- | --- | --- |
234
+ | `name` | `string` | Yes | Repository name |
235
+ | `description` | `string` | No | Short description of the repository |
236
+ | `private` | `boolean` | No | Whether the repo is private (default: false) |
237
+ | `auto_init` | `boolean` | No | Initialize with a README (default: false) |
238
+ | `gitignore_template` | `string` | No | Gitignore template name (e.g. "Node", "Python") |
239
+ | `license_template` | `string` | No | License template (e.g. "mit", "apache-2.0") |
240
+
241
+ ### `github_repo_index`
242
+
243
+ | Parameter | Type | Required | Description |
244
+ | --- | --- | --- | --- |
245
+ | `owner` | `string` | Yes | Repository owner (user or org) |
246
+ | `repo` | `string` | Yes | Repository name |
247
+ | `ref` | `string` | No | Branch, tag, or SHA (default: default branch) |
248
+ | `max_doc_files` | `number` | No | Max number of doc files to fetch (default: 10) |
249
+
250
+ ### `github_release_list`
251
+
252
+ | Parameter | Type | Required | Description |
253
+ | --- | --- | --- | --- |
254
+ | `owner` | `string` | Yes | Repository owner (user or org) |
255
+ | `repo` | `string` | Yes | Repository name |
256
+ | `per_page` | `number` | No | Results per page (max 30, default 10) |
257
+
258
+ ### `github_release_create`
259
+
260
+ | Parameter | Type | Required | Description |
261
+ | --- | --- | --- | --- |
262
+ | `owner` | `string` | Yes | Repository owner (user or org) |
263
+ | `repo` | `string` | Yes | Repository name |
264
+ | `tag_name` | `string` | Yes | Tag name for the release. |
265
+ | `name` | `string` | No | Release title |
266
+ | `body` | `string` | No | Release notes body (Markdown supported) |
267
+ | `draft` | `boolean` | No | Create as draft release (default: false) |
268
+ | `prerelease` | `boolean` | No | Mark as prerelease (default: false) |
269
+ | `target_commitish` | `string` | No | Branch or commit SHA to tag (default: default branch) |
270
+ | `generate_release_notes` | `boolean` | No | Auto-generate release notes from commits (default: false) |
271
+
272
+ ### `github_actions_list`
273
+
274
+ | Parameter | Type | Required | Description |
275
+ | --- | --- | --- | --- |
276
+ | `owner` | `string` | Yes | Repository owner (user or org) |
277
+ | `repo` | `string` | Yes | Repository name |
278
+ | `workflow_id` | `string` | No | Workflow ID or filename (e.g. "ci.yml") to filter by |
279
+ | `per_page` | `number` | No | Results per page (max 30, default 10) |
280
+
281
+ ### `github_actions_trigger`
282
+
283
+ | Parameter | Type | Required | Description |
284
+ | --- | --- | --- | --- |
285
+ | `owner` | `string` | Yes | Repository owner (user or org) |
286
+ | `repo` | `string` | Yes | Repository name |
287
+ | `workflow_id` | `string` | Yes | Workflow ID or filename (e.g. "deploy.yml") |
288
+ | `ref` | `string` | No | Git ref to run the workflow on (default: "master") |
289
+ | `inputs` | `object with string values` | No | Key-value input parameters for the workflow |
290
+
291
+ ### `github_file_write`
292
+
293
+ | Parameter | Type | Required | Description |
294
+ | --- | --- | --- | --- |
295
+ | `owner` | `string` | Yes | Repository owner (user or org) |
296
+ | `repo` | `string` | Yes | Repository name |
297
+ | `path` | `string` | Yes | File path within the repository |
298
+ | `content` | `string` | Yes | File content (plain text, will be base64-encoded automatically) |
299
+ | `message` | `string` | Yes | Commit message |
300
+ | `branch` | `string` | No | Target branch (default: repo default branch) |
301
+ | `sha` | `string` | No | SHA of the file being replaced (required for updates, omit for new files) |
302
+
303
+ ### `github_branch_list`
304
+
305
+ | Parameter | Type | Required | Description |
306
+ | --- | --- | --- | --- |
307
+ | `owner` | `string` | Yes | Repository owner (user or org) |
308
+ | `repo` | `string` | Yes | Repository name |
309
+ | `protected` | `boolean` | No | Filter to only protected branches |
310
+ | `per_page` | `number` | No | Results per page (max 100, default 30) |
311
+
312
+ ### `github_branch_create`
313
+
314
+ | Parameter | Type | Required | Description |
315
+ | --- | --- | --- | --- |
316
+ | `owner` | `string` | Yes | Repository owner (user or org) |
317
+ | `repo` | `string` | Yes | Repository name |
318
+ | `branch` | `string` | Yes | New branch name to create |
319
+ | `from` | `string` | No | Source branch name or commit SHA to branch from (default: repo default branch) |
320
+
321
+ ### `github_commit_list`
322
+
323
+ | Parameter | Type | Required | Description |
324
+ | --- | --- | --- | --- |
325
+ | `owner` | `string` | Yes | Repository owner (user or org) |
326
+ | `repo` | `string` | Yes | Repository name |
327
+ | `sha` | `string` | No | Branch name or commit SHA to list from (default: default branch) |
328
+ | `path` | `string` | No | Only include commits touching this file path |
329
+ | `author` | `string` | No | GitHub login or email to filter by author |
330
+ | `since` | `string` | No | ISO 8601 date, only commits after this date |
331
+ | `until` | `string` | No | ISO 8601 date, only commits before this date |
332
+ | `per_page` | `number` | No | Results per page (max 100, default 30) |
333
+
334
+ ## Notes
335
+
336
+ Node.js with range `>=22` is required. Activation initializes Octokit and fetches the authenticated user. Missing credentials cause the factory to throw after the CLI fallback fails. The CLI fallback needs an installed, authenticated `gh` executable and uses a timeout of `5000` milliseconds.
337
+
338
+ Creation, update, review, comment, merge, file write, release, and workflow dispatch tools change GitHub resources. Gists and repositories default to non-public and public visibility respectively. Issue updates replace supplied label and assignee sets.
339
+
340
+ List and search tools fetch a page of results and cap `per_page` as described in their schemas. Pull request patches are truncated when requested. Repository indexing returns text chunks and skips unreadable documentation; it does not create embeddings or write to a vector store. File reads also return directory entries when the path refers to a directory.
341
+
342
+ Top-level pull request comments use the issues API. `github_pr_comment_list` returns inline review comments; `github_comment_list` returns top-level comments.
343
+
344
+ ## License
345
+
346
+ Apache-2.0
package/manifest.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://agentos.sh/schemas/extension-manifest-v1.json",
3
3
  "id": "com.framers.integrations.github",
4
4
  "name": "GitHub Extension",
5
- "version": "0.1.3",
5
+ "version": "0.1.5",
6
6
  "description": "GitHub API tools — 26 tools for repos, issues, PRs, branches, commits, releases, Actions, files, gists, and codebase indexing.",
7
7
  "categories": ["tool", "developer"],
8
8
  "extensions": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@framers/agentos-ext-github",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "description": "GitHub API tools for AgentOS — search repos/code, manage issues/PRs, read files, create gists",
6
6
  "main": "dist/index.js",
@@ -22,7 +22,7 @@
22
22
  "manifest.json"
23
23
  ],
24
24
  "dependencies": {
25
- "@octokit/rest": "^21.0.0"
25
+ "@octokit/rest": "^22.0.1"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@framers/agentos": ">=0.10.40"
@@ -31,7 +31,7 @@
31
31
  "@types/node": "^20.0.0",
32
32
  "typescript": "^5.0.0",
33
33
  "vitest": "^3.2.7",
34
- "@framers/agentos": "^0.13.40"
34
+ "@framers/agentos": "^0.13.51"
35
35
  },
36
36
  "engines": {
37
37
  "node": ">=22"