@gaud_erp/paperclip-github-manager 1.9.0 → 2.0.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/manifest.js +55 -37
- package/dist/manifest.js.map +2 -2
- package/dist/worker.js +149 -0
- package/dist/worker.js.map +2 -2
- package/package.json +1 -1
package/dist/manifest.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/manifest.ts
|
|
2
2
|
var manifest = {
|
|
3
3
|
id: "cus.github-manager",
|
|
4
|
-
version: "
|
|
4
|
+
version: "2.0.0",
|
|
5
5
|
apiVersion: 1,
|
|
6
6
|
displayName: "GitHub Manager",
|
|
7
7
|
description: "Manage GitHub repos, PRs, issues, agent code reviews, and knowledge graphs \u2014 all from Paperclip",
|
|
@@ -161,6 +161,34 @@ var manifest = {
|
|
|
161
161
|
required: ["query"]
|
|
162
162
|
}
|
|
163
163
|
},
|
|
164
|
+
{
|
|
165
|
+
name: "github_get_pr_checks",
|
|
166
|
+
displayName: "Get PR CI/CD Status",
|
|
167
|
+
description: "Get CI/CD check runs status for a pull request (pass/fail/pending)",
|
|
168
|
+
parametersSchema: {
|
|
169
|
+
type: "object",
|
|
170
|
+
properties: {
|
|
171
|
+
owner: { type: "string" },
|
|
172
|
+
repo: { type: "string" },
|
|
173
|
+
pull_number: { type: "number" }
|
|
174
|
+
},
|
|
175
|
+
required: ["owner", "repo", "pull_number"]
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
name: "github_get_pr_comments",
|
|
180
|
+
displayName: "Get PR Review Comments",
|
|
181
|
+
description: "Get all review comments, discussions, and review verdicts on a pull request",
|
|
182
|
+
parametersSchema: {
|
|
183
|
+
type: "object",
|
|
184
|
+
properties: {
|
|
185
|
+
owner: { type: "string" },
|
|
186
|
+
repo: { type: "string" },
|
|
187
|
+
pull_number: { type: "number" }
|
|
188
|
+
},
|
|
189
|
+
required: ["owner", "repo", "pull_number"]
|
|
190
|
+
}
|
|
191
|
+
},
|
|
164
192
|
{
|
|
165
193
|
name: "github_get_repo_structure",
|
|
166
194
|
displayName: "Get Repo Structure",
|
|
@@ -234,47 +262,37 @@ You have access to GitHub repositories through the GitHub Manager plugin tools.
|
|
|
234
262
|
|
|
235
263
|
## Available Tools
|
|
236
264
|
|
|
237
|
-
###
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
-
|
|
242
|
-
- \`refresh\` (optional): Set to true to regenerate from GitHub if cache is stale
|
|
243
|
-
|
|
244
|
-
### 2. github_read_file_content
|
|
245
|
-
Read the content of a specific file from a GitHub repository.
|
|
246
|
-
|
|
247
|
-
Parameters:
|
|
248
|
-
- \`owner\` (required): Repository owner (e.g. "gauderp")
|
|
249
|
-
- \`repo\` (required): Repository name (e.g. "gaud-erp-api")
|
|
250
|
-
- \`path\` (required): File path (e.g. "src/main/java/com/gaud/App.java")
|
|
251
|
-
- \`ref\` (optional): Branch or commit SHA (defaults to main branch)
|
|
252
|
-
|
|
253
|
-
### 3. github_get_pull_request_diff
|
|
254
|
-
Get the unified diff of a pull request for code review.
|
|
255
|
-
|
|
256
|
-
Parameters:
|
|
257
|
-
- \`owner\`, \`repo\`, \`pull_number\`
|
|
258
|
-
|
|
259
|
-
### 4. github_search_issues
|
|
260
|
-
Search GitHub issues and PRs using GitHub search syntax.
|
|
265
|
+
### Codebase Navigation
|
|
266
|
+
- **github_get_repo_structure** \u2014 Get directory/file structure. **Call FIRST** before reading files. Params: \`repo_full_name\`, optional \`refresh=true\`
|
|
267
|
+
- **github_read_file_content** \u2014 Read a file. Params: \`owner\`, \`repo\`, \`path\`, optional \`ref\`
|
|
268
|
+
- **github_list_repositories** \u2014 List all tracked repos (no params)
|
|
269
|
+
- **github_search_issues** \u2014 Search issues/PRs. Params: \`query\`
|
|
261
270
|
|
|
262
|
-
|
|
263
|
-
-
|
|
271
|
+
### PR Review
|
|
272
|
+
- **github_get_pull_request_diff** \u2014 Get unified diff. Params: \`owner\`, \`repo\`, \`pull_number\`
|
|
273
|
+
- **github_get_pr_checks** \u2014 Get CI/CD status (pass/fail/pending). Params: \`owner\`, \`repo\`, \`pull_number\`
|
|
274
|
+
- **github_get_pr_comments** \u2014 Get all review comments, discussions, and verdicts. Params: \`owner\`, \`repo\`, \`pull_number\`
|
|
275
|
+
- **github_create_review_comment** \u2014 Post inline comment. Params: \`owner\`, \`repo\`, \`pull_number\`, \`commit_id\`, \`path\`, \`line\`, \`body\`
|
|
276
|
+
- **github_submit_pr_review** \u2014 Submit verdict. Params: \`owner\`, \`repo\`, \`pull_number\`, \`event\` (APPROVE/REQUEST_CHANGES/COMMENT), \`body\`
|
|
264
277
|
|
|
265
|
-
|
|
266
|
-
List all tracked GitHub repositories (no parameters needed).
|
|
278
|
+
## PR Review Workflow
|
|
267
279
|
|
|
268
|
-
|
|
280
|
+
When reviewing a PR:
|
|
281
|
+
1. \`github_get_repo_structure\` \u2014 understand the codebase
|
|
282
|
+
2. \`github_get_pull_request_diff\` \u2014 see what changed
|
|
283
|
+
3. \`github_get_pr_checks\` \u2014 verify CI/CD passed
|
|
284
|
+
4. \`github_get_pr_comments\` \u2014 check existing reviews from others
|
|
285
|
+
5. \`github_read_file_content\` \u2014 read surrounding code for context
|
|
286
|
+
6. \`github_create_review_comment\` \u2014 post inline comments on issues
|
|
287
|
+
7. \`github_submit_pr_review\` \u2014 approve or request changes with summary
|
|
288
|
+
8. If CI failed or changes needed, tag the PR author to fix
|
|
269
289
|
|
|
270
|
-
|
|
271
|
-
2. Read only the files you actually need with \`github_read_file_content\`
|
|
272
|
-
3. If the structure seems outdated, call \`github_get_repo_structure\` with \`refresh=true\`
|
|
273
|
-
4. Never try to access the local filesystem for source code \u2014 always use these tools
|
|
290
|
+
## Codebase Exploration Workflow
|
|
274
291
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
292
|
+
1. **ALWAYS** start with \`github_get_repo_structure\` to understand layout
|
|
293
|
+
2. Read only the files you need with \`github_read_file_content\`
|
|
294
|
+
3. If structure seems outdated, call with \`refresh=true\`
|
|
295
|
+
4. Never access the local filesystem \u2014 always use these tools
|
|
278
296
|
`
|
|
279
297
|
}
|
|
280
298
|
],
|
package/dist/manifest.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/manifest.ts"],
|
|
4
|
-
"sourcesContent": ["import type { PaperclipPluginManifestV1 } from \"@paperclipai/plugin-sdk\";\n\nconst manifest: PaperclipPluginManifestV1 = {\n id: \"cus.github-manager\",\n version: \"1.9.0\",\n apiVersion: 1,\n displayName: \"GitHub Manager\",\n description: \"Manage GitHub repos, PRs, issues, agent code reviews, and knowledge graphs \u2014 all from Paperclip\",\n author: \"Gaud ERP\",\n categories: [\"connector\", \"automation\"],\n\n capabilities: [\n \"events.subscribe\",\n \"events.emit\",\n \"http.outbound\",\n \"plugin.state.read\",\n \"plugin.state.write\",\n \"database.namespace.read\",\n \"database.namespace.write\",\n \"database.namespace.migrate\",\n \"jobs.schedule\",\n \"webhooks.receive\",\n \"agent.tools.register\",\n \"agents.managed\",\n \"agents.invoke\",\n \"agents.read\",\n \"issues.read\",\n \"issues.create\",\n \"companies.read\",\n \"ui.page.register\",\n \"ui.dashboardWidget.register\",\n \"ui.sidebar.register\",\n \"ui.detailTab.register\",\n \"ui.action.register\",\n \"instance.settings.register\",\n \"skills.managed\",\n ],\n\n instanceConfigSchema: {\n type: \"object\",\n required: [\"githubToken\"],\n properties: {\n githubToken: {\n type: \"string\",\n title: \"GitHub Personal Access Token\",\n description: \"Cole aqui o PAT do GitHub com permiss\u00F5es 'repo' e 'read:org'\",\n },\n defaultOrg: {\n type: \"string\",\n title: \"Default Organization\",\n description: \"GitHub organization to sync repositories from (optional)\",\n },\n syncIntervalMinutes: {\n type: \"number\",\n title: \"Sync Interval (minutes)\",\n description: \"How often to sync PRs and issues (default: 5)\",\n default: 5,\n minimum: 1,\n maximum: 1440,\n },\n },\n },\n\n entrypoints: {\n worker: \"./dist/worker.js\",\n ui: \"./dist/ui\",\n },\n\n database: {\n migrationsDir: \"src/db/migrations\",\n },\n\n jobs: [\n {\n jobKey: \"sync-github\",\n displayName: \"Sync GitHub PRs and Issues\",\n schedule: \"*/5 * * * *\",\n description: \"Incremental sync of open PRs and issues for tracked repositories\",\n },\n ],\n\n webhooks: [\n {\n endpointKey: \"github-events\",\n displayName: \"GitHub Events\",\n description: \"Receives GitHub webhook events (pull_request, issues)\",\n },\n ],\n\n tools: [\n {\n name: \"github_get_pull_request_diff\",\n displayName: \"Get PR Diff\",\n description: \"Retrieve the unified diff of a GitHub pull request\",\n parametersSchema: {\n type: \"object\",\n properties: {\n owner: { type: \"string\" },\n repo: { type: \"string\" },\n pull_number: { type: \"number\" },\n },\n required: [\"owner\", \"repo\", \"pull_number\"],\n },\n },\n {\n name: \"github_read_file_content\",\n displayName: \"Read File\",\n description: \"Read a file from a GitHub repository\",\n parametersSchema: {\n type: \"object\",\n properties: {\n owner: { type: \"string\" },\n repo: { type: \"string\" },\n path: { type: \"string\" },\n ref: { type: \"string\" },\n },\n required: [\"owner\", \"repo\", \"path\"],\n },\n },\n {\n name: \"github_create_review_comment\",\n displayName: \"Add Review Comment\",\n description: \"Post an inline review comment on a pull request\",\n parametersSchema: {\n type: \"object\",\n properties: {\n owner: { type: \"string\" },\n repo: { type: \"string\" },\n pull_number: { type: \"number\" },\n commit_id: { type: \"string\" },\n path: { type: \"string\" },\n line: { type: \"number\" },\n body: { type: \"string\" },\n },\n required: [\"owner\", \"repo\", \"pull_number\", \"commit_id\", \"path\", \"line\", \"body\"],\n },\n },\n {\n name: \"github_submit_pr_review\",\n displayName: \"Submit PR Review\",\n description: \"Submit a review verdict (approve, request changes, comment)\",\n parametersSchema: {\n type: \"object\",\n properties: {\n owner: { type: \"string\" },\n repo: { type: \"string\" },\n pull_number: { type: \"number\" },\n event: { type: \"string\", enum: [\"APPROVE\", \"REQUEST_CHANGES\", \"COMMENT\"] },\n body: { type: \"string\" },\n },\n required: [\"owner\", \"repo\", \"pull_number\", \"event\", \"body\"],\n },\n },\n {\n name: \"github_list_repositories\",\n displayName: \"List Repositories\",\n description: \"List all tracked GitHub repositories\",\n parametersSchema: { type: \"object\", properties: {} },\n },\n {\n name: \"github_search_issues\",\n displayName: \"Search Issues\",\n description: \"Search GitHub issues and PRs using search syntax\",\n parametersSchema: {\n type: \"object\",\n properties: {\n query: { type: \"string\" },\n },\n required: [\"query\"],\n },\n },\n {\n name: \"github_get_repo_structure\",\n displayName: \"Get Repo Structure\",\n description: \"Get the cached directory/file structure of a repository. Use this FIRST before reading files to understand the codebase layout and save tokens. Set refresh=true to regenerate from GitHub.\",\n parametersSchema: {\n type: \"object\",\n properties: {\n repo_full_name: { type: \"string\", description: \"owner/repo format\" },\n refresh: { type: \"boolean\", description: \"Set true to regenerate the structure from GitHub (use when cache is stale)\" },\n },\n required: [\"repo_full_name\"],\n },\n },\n ],\n\n agents: [\n {\n agentKey: \"github-reviewer\",\n displayName: \"GitHub Code Reviewer\",\n role: \"code-review\",\n title: \"Senior Code Reviewer\",\n capabilities: \"Reviews GitHub pull requests using plugin tools. Reads repo structure, analyzes diffs, posts inline comments, and submits review verdicts (approve/request changes).\",\n instructions: {\n entryFile: \"AGENTS.md\",\n content: `# GitHub Code Reviewer\n\nYou are an expert code reviewer. You review pull requests on GitHub repositories.\n\n## Available Tools\n\nYou MUST use these plugin tools to access code:\n\n1. **github_get_repo_structure** \u2014 Call FIRST to understand the codebase layout\n2. **github_get_pull_request_diff** \u2014 Get the PR diff to review\n3. **github_read_file_content** \u2014 Read specific files for context\n4. **github_create_review_comment** \u2014 Post inline comments on specific lines\n5. **github_submit_pr_review** \u2014 Submit your final verdict (APPROVE, REQUEST_CHANGES, or COMMENT)\n\n## Review Workflow\n\n1. Get the repo structure to understand the project\n2. Get the PR diff to see what changed\n3. Read surrounding files for context when needed\n4. Post inline comments on issues you find\n5. Submit your review with a summary\n\n## Review Criteria\n\n- Code correctness and logic errors\n- Security vulnerabilities (SQL injection, XSS, secrets in code)\n- Performance issues (N+1 queries, unnecessary allocations)\n- Code style and naming consistency\n- Missing error handling\n- Test coverage for changes\n- Breaking changes in public APIs\n\n## Tone\n\nBe constructive and specific. Explain WHY something is an issue and suggest a fix. Praise good patterns when you see them.\n`,\n },\n },\n ],\n\n skills: [\n {\n skillKey: \"github-codebase-access\",\n displayName: \"GitHub Codebase Access\",\n description: \"Provides agents with tools to read repository structure and files from GitHub without needing local filesystem access\",\n markdown: `# GitHub Codebase Access\n\nYou have access to GitHub repositories through the GitHub Manager plugin tools. NEVER say you don't have access to the codebase.\n\n## Available Tools\n\n### 1. github_get_repo_structure\nGet the directory and file structure of a repository. **Always call this FIRST** before reading any files.\n\nParameters:\n- \\`repo_full_name\\` (required): Repository in \"owner/repo\" format\n- \\`refresh\\` (optional): Set to true to regenerate from GitHub if cache is stale\n\n### 2. github_read_file_content\nRead the content of a specific file from a GitHub repository.\n\nParameters:\n- \\`owner\\` (required): Repository owner (e.g. \"gauderp\")\n- \\`repo\\` (required): Repository name (e.g. \"gaud-erp-api\")\n- \\`path\\` (required): File path (e.g. \"src/main/java/com/gaud/App.java\")\n- \\`ref\\` (optional): Branch or commit SHA (defaults to main branch)\n\n### 3. github_get_pull_request_diff\nGet the unified diff of a pull request for code review.\n\nParameters:\n- \\`owner\\`, \\`repo\\`, \\`pull_number\\`\n\n### 4. github_search_issues\nSearch GitHub issues and PRs using GitHub search syntax.\n\nParameters:\n- \\`query\\`: GitHub search query (e.g. \"is:open label:bug\")\n\n### 5. github_list_repositories\nList all tracked GitHub repositories (no parameters needed).\n\n## Mandatory Workflow\n\n1. **ALWAYS** start with \\`github_get_repo_structure\\` to understand the codebase layout\n2. Read only the files you actually need with \\`github_read_file_content\\`\n3. If the structure seems outdated, call \\`github_get_repo_structure\\` with \\`refresh=true\\`\n4. Never try to access the local filesystem for source code \u2014 always use these tools\n\n## Token Efficiency\nThe structure cache returns directories and key files in a single call (~5-50KB).\nThis replaces hundreds of file-listing API calls, saving 60-90% of tokens.\n`,\n },\n ],\n\n ui: {\n slots: [\n {\n type: \"sidebar\",\n id: \"github-sidebar\",\n exportName: \"GitHubSidebarLink\",\n displayName: \"GitHub\",\n },\n {\n type: \"page\",\n id: \"github-settings\",\n exportName: \"GitHubSettingsPage\",\n displayName: \"Configura\u00E7\u00F5es GitHub\",\n routePath: \"github-settings\",\n },\n {\n type: \"page\",\n id: \"github-repos\",\n exportName: \"GitHubReposPage\",\n displayName: \"Reposit\u00F3rios\",\n routePath: \"github-repos\",\n },\n {\n type: \"page\",\n id: \"github-prs\",\n exportName: \"GitHubPullRequestsPage\",\n displayName: \"Pull Requests\",\n routePath: \"github-prs\",\n },\n {\n type: \"page\",\n id: \"github-graphs\",\n exportName: \"GitHubGraphsPage\",\n displayName: \"Knowledge Graphs\",\n routePath: \"github-graphs\",\n },\n {\n type: \"dashboardWidget\",\n id: \"github-dashboard\",\n exportName: \"GitHubDashboardWidget\",\n displayName: \"GitHub Status\",\n },\n {\n type: \"detailTab\",\n id: \"github-detail\",\n exportName: \"GitHubDetailTab\",\n displayName: \"GitHub\",\n entityTypes: [\"issue\"],\n },\n {\n type: \"contextMenuItem\",\n id: \"github-context-menu\",\n exportName: \"GitHubContextMenu\",\n displayName: \"GitHub Actions\",\n entityTypes: [\"issue\"],\n },\n ],\n },\n};\n\nexport default manifest;\n"],
|
|
5
|
-
"mappings": ";AAEA,IAAM,WAAsC;AAAA,EAC1C,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,YAAY,CAAC,aAAa,YAAY;AAAA,EAEtC,cAAc;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA
|
|
4
|
+
"sourcesContent": ["import type { PaperclipPluginManifestV1 } from \"@paperclipai/plugin-sdk\";\n\nconst manifest: PaperclipPluginManifestV1 = {\n id: \"cus.github-manager\",\n version: \"2.0.0\",\n apiVersion: 1,\n displayName: \"GitHub Manager\",\n description: \"Manage GitHub repos, PRs, issues, agent code reviews, and knowledge graphs \u2014 all from Paperclip\",\n author: \"Gaud ERP\",\n categories: [\"connector\", \"automation\"],\n\n capabilities: [\n \"events.subscribe\",\n \"events.emit\",\n \"http.outbound\",\n \"plugin.state.read\",\n \"plugin.state.write\",\n \"database.namespace.read\",\n \"database.namespace.write\",\n \"database.namespace.migrate\",\n \"jobs.schedule\",\n \"webhooks.receive\",\n \"agent.tools.register\",\n \"agents.managed\",\n \"agents.invoke\",\n \"agents.read\",\n \"issues.read\",\n \"issues.create\",\n \"companies.read\",\n \"ui.page.register\",\n \"ui.dashboardWidget.register\",\n \"ui.sidebar.register\",\n \"ui.detailTab.register\",\n \"ui.action.register\",\n \"instance.settings.register\",\n \"skills.managed\",\n ],\n\n instanceConfigSchema: {\n type: \"object\",\n required: [\"githubToken\"],\n properties: {\n githubToken: {\n type: \"string\",\n title: \"GitHub Personal Access Token\",\n description: \"Cole aqui o PAT do GitHub com permiss\u00F5es 'repo' e 'read:org'\",\n },\n defaultOrg: {\n type: \"string\",\n title: \"Default Organization\",\n description: \"GitHub organization to sync repositories from (optional)\",\n },\n syncIntervalMinutes: {\n type: \"number\",\n title: \"Sync Interval (minutes)\",\n description: \"How often to sync PRs and issues (default: 5)\",\n default: 5,\n minimum: 1,\n maximum: 1440,\n },\n },\n },\n\n entrypoints: {\n worker: \"./dist/worker.js\",\n ui: \"./dist/ui\",\n },\n\n database: {\n migrationsDir: \"src/db/migrations\",\n },\n\n jobs: [\n {\n jobKey: \"sync-github\",\n displayName: \"Sync GitHub PRs and Issues\",\n schedule: \"*/5 * * * *\",\n description: \"Incremental sync of open PRs and issues for tracked repositories\",\n },\n ],\n\n webhooks: [\n {\n endpointKey: \"github-events\",\n displayName: \"GitHub Events\",\n description: \"Receives GitHub webhook events (pull_request, issues)\",\n },\n ],\n\n tools: [\n {\n name: \"github_get_pull_request_diff\",\n displayName: \"Get PR Diff\",\n description: \"Retrieve the unified diff of a GitHub pull request\",\n parametersSchema: {\n type: \"object\",\n properties: {\n owner: { type: \"string\" },\n repo: { type: \"string\" },\n pull_number: { type: \"number\" },\n },\n required: [\"owner\", \"repo\", \"pull_number\"],\n },\n },\n {\n name: \"github_read_file_content\",\n displayName: \"Read File\",\n description: \"Read a file from a GitHub repository\",\n parametersSchema: {\n type: \"object\",\n properties: {\n owner: { type: \"string\" },\n repo: { type: \"string\" },\n path: { type: \"string\" },\n ref: { type: \"string\" },\n },\n required: [\"owner\", \"repo\", \"path\"],\n },\n },\n {\n name: \"github_create_review_comment\",\n displayName: \"Add Review Comment\",\n description: \"Post an inline review comment on a pull request\",\n parametersSchema: {\n type: \"object\",\n properties: {\n owner: { type: \"string\" },\n repo: { type: \"string\" },\n pull_number: { type: \"number\" },\n commit_id: { type: \"string\" },\n path: { type: \"string\" },\n line: { type: \"number\" },\n body: { type: \"string\" },\n },\n required: [\"owner\", \"repo\", \"pull_number\", \"commit_id\", \"path\", \"line\", \"body\"],\n },\n },\n {\n name: \"github_submit_pr_review\",\n displayName: \"Submit PR Review\",\n description: \"Submit a review verdict (approve, request changes, comment)\",\n parametersSchema: {\n type: \"object\",\n properties: {\n owner: { type: \"string\" },\n repo: { type: \"string\" },\n pull_number: { type: \"number\" },\n event: { type: \"string\", enum: [\"APPROVE\", \"REQUEST_CHANGES\", \"COMMENT\"] },\n body: { type: \"string\" },\n },\n required: [\"owner\", \"repo\", \"pull_number\", \"event\", \"body\"],\n },\n },\n {\n name: \"github_list_repositories\",\n displayName: \"List Repositories\",\n description: \"List all tracked GitHub repositories\",\n parametersSchema: { type: \"object\", properties: {} },\n },\n {\n name: \"github_search_issues\",\n displayName: \"Search Issues\",\n description: \"Search GitHub issues and PRs using search syntax\",\n parametersSchema: {\n type: \"object\",\n properties: {\n query: { type: \"string\" },\n },\n required: [\"query\"],\n },\n },\n {\n name: \"github_get_pr_checks\",\n displayName: \"Get PR CI/CD Status\",\n description: \"Get CI/CD check runs status for a pull request (pass/fail/pending)\",\n parametersSchema: {\n type: \"object\",\n properties: {\n owner: { type: \"string\" },\n repo: { type: \"string\" },\n pull_number: { type: \"number\" },\n },\n required: [\"owner\", \"repo\", \"pull_number\"],\n },\n },\n {\n name: \"github_get_pr_comments\",\n displayName: \"Get PR Review Comments\",\n description: \"Get all review comments, discussions, and review verdicts on a pull request\",\n parametersSchema: {\n type: \"object\",\n properties: {\n owner: { type: \"string\" },\n repo: { type: \"string\" },\n pull_number: { type: \"number\" },\n },\n required: [\"owner\", \"repo\", \"pull_number\"],\n },\n },\n {\n name: \"github_get_repo_structure\",\n displayName: \"Get Repo Structure\",\n description: \"Get the cached directory/file structure of a repository. Use this FIRST before reading files to understand the codebase layout and save tokens. Set refresh=true to regenerate from GitHub.\",\n parametersSchema: {\n type: \"object\",\n properties: {\n repo_full_name: { type: \"string\", description: \"owner/repo format\" },\n refresh: { type: \"boolean\", description: \"Set true to regenerate the structure from GitHub (use when cache is stale)\" },\n },\n required: [\"repo_full_name\"],\n },\n },\n ],\n\n agents: [\n {\n agentKey: \"github-reviewer\",\n displayName: \"GitHub Code Reviewer\",\n role: \"code-review\",\n title: \"Senior Code Reviewer\",\n capabilities: \"Reviews GitHub pull requests using plugin tools. Reads repo structure, analyzes diffs, posts inline comments, and submits review verdicts (approve/request changes).\",\n instructions: {\n entryFile: \"AGENTS.md\",\n content: `# GitHub Code Reviewer\n\nYou are an expert code reviewer. You review pull requests on GitHub repositories.\n\n## Available Tools\n\nYou MUST use these plugin tools to access code:\n\n1. **github_get_repo_structure** \u2014 Call FIRST to understand the codebase layout\n2. **github_get_pull_request_diff** \u2014 Get the PR diff to review\n3. **github_read_file_content** \u2014 Read specific files for context\n4. **github_create_review_comment** \u2014 Post inline comments on specific lines\n5. **github_submit_pr_review** \u2014 Submit your final verdict (APPROVE, REQUEST_CHANGES, or COMMENT)\n\n## Review Workflow\n\n1. Get the repo structure to understand the project\n2. Get the PR diff to see what changed\n3. Read surrounding files for context when needed\n4. Post inline comments on issues you find\n5. Submit your review with a summary\n\n## Review Criteria\n\n- Code correctness and logic errors\n- Security vulnerabilities (SQL injection, XSS, secrets in code)\n- Performance issues (N+1 queries, unnecessary allocations)\n- Code style and naming consistency\n- Missing error handling\n- Test coverage for changes\n- Breaking changes in public APIs\n\n## Tone\n\nBe constructive and specific. Explain WHY something is an issue and suggest a fix. Praise good patterns when you see them.\n`,\n },\n },\n ],\n\n skills: [\n {\n skillKey: \"github-codebase-access\",\n displayName: \"GitHub Codebase Access\",\n description: \"Provides agents with tools to read repository structure and files from GitHub without needing local filesystem access\",\n markdown: `# GitHub Codebase Access\n\nYou have access to GitHub repositories through the GitHub Manager plugin tools. NEVER say you don't have access to the codebase.\n\n## Available Tools\n\n### Codebase Navigation\n- **github_get_repo_structure** \u2014 Get directory/file structure. **Call FIRST** before reading files. Params: \\`repo_full_name\\`, optional \\`refresh=true\\`\n- **github_read_file_content** \u2014 Read a file. Params: \\`owner\\`, \\`repo\\`, \\`path\\`, optional \\`ref\\`\n- **github_list_repositories** \u2014 List all tracked repos (no params)\n- **github_search_issues** \u2014 Search issues/PRs. Params: \\`query\\`\n\n### PR Review\n- **github_get_pull_request_diff** \u2014 Get unified diff. Params: \\`owner\\`, \\`repo\\`, \\`pull_number\\`\n- **github_get_pr_checks** \u2014 Get CI/CD status (pass/fail/pending). Params: \\`owner\\`, \\`repo\\`, \\`pull_number\\`\n- **github_get_pr_comments** \u2014 Get all review comments, discussions, and verdicts. Params: \\`owner\\`, \\`repo\\`, \\`pull_number\\`\n- **github_create_review_comment** \u2014 Post inline comment. Params: \\`owner\\`, \\`repo\\`, \\`pull_number\\`, \\`commit_id\\`, \\`path\\`, \\`line\\`, \\`body\\`\n- **github_submit_pr_review** \u2014 Submit verdict. Params: \\`owner\\`, \\`repo\\`, \\`pull_number\\`, \\`event\\` (APPROVE/REQUEST_CHANGES/COMMENT), \\`body\\`\n\n## PR Review Workflow\n\nWhen reviewing a PR:\n1. \\`github_get_repo_structure\\` \u2014 understand the codebase\n2. \\`github_get_pull_request_diff\\` \u2014 see what changed\n3. \\`github_get_pr_checks\\` \u2014 verify CI/CD passed\n4. \\`github_get_pr_comments\\` \u2014 check existing reviews from others\n5. \\`github_read_file_content\\` \u2014 read surrounding code for context\n6. \\`github_create_review_comment\\` \u2014 post inline comments on issues\n7. \\`github_submit_pr_review\\` \u2014 approve or request changes with summary\n8. If CI failed or changes needed, tag the PR author to fix\n\n## Codebase Exploration Workflow\n\n1. **ALWAYS** start with \\`github_get_repo_structure\\` to understand layout\n2. Read only the files you need with \\`github_read_file_content\\`\n3. If structure seems outdated, call with \\`refresh=true\\`\n4. Never access the local filesystem \u2014 always use these tools\n`,\n },\n ],\n\n ui: {\n slots: [\n {\n type: \"sidebar\",\n id: \"github-sidebar\",\n exportName: \"GitHubSidebarLink\",\n displayName: \"GitHub\",\n },\n {\n type: \"page\",\n id: \"github-settings\",\n exportName: \"GitHubSettingsPage\",\n displayName: \"Configura\u00E7\u00F5es GitHub\",\n routePath: \"github-settings\",\n },\n {\n type: \"page\",\n id: \"github-repos\",\n exportName: \"GitHubReposPage\",\n displayName: \"Reposit\u00F3rios\",\n routePath: \"github-repos\",\n },\n {\n type: \"page\",\n id: \"github-prs\",\n exportName: \"GitHubPullRequestsPage\",\n displayName: \"Pull Requests\",\n routePath: \"github-prs\",\n },\n {\n type: \"page\",\n id: \"github-graphs\",\n exportName: \"GitHubGraphsPage\",\n displayName: \"Knowledge Graphs\",\n routePath: \"github-graphs\",\n },\n {\n type: \"dashboardWidget\",\n id: \"github-dashboard\",\n exportName: \"GitHubDashboardWidget\",\n displayName: \"GitHub Status\",\n },\n {\n type: \"detailTab\",\n id: \"github-detail\",\n exportName: \"GitHubDetailTab\",\n displayName: \"GitHub\",\n entityTypes: [\"issue\"],\n },\n {\n type: \"contextMenuItem\",\n id: \"github-context-menu\",\n exportName: \"GitHubContextMenu\",\n displayName: \"GitHub Actions\",\n entityTypes: [\"issue\"],\n },\n ],\n },\n};\n\nexport default manifest;\n"],
|
|
5
|
+
"mappings": ";AAEA,IAAM,WAAsC;AAAA,EAC1C,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,YAAY,CAAC,aAAa,YAAY;AAAA,EAEtC,cAAc;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EAEA,sBAAsB;AAAA,IACpB,MAAM;AAAA,IACN,UAAU,CAAC,aAAa;AAAA,IACxB,YAAY;AAAA,MACV,aAAa;AAAA,QACX,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,MACf;AAAA,MACA,YAAY;AAAA,QACV,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,MACf;AAAA,MACA,qBAAqB;AAAA,QACnB,MAAM;AAAA,QACN,OAAO;AAAA,QACP,aAAa;AAAA,QACb,SAAS;AAAA,QACT,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EAEA,aAAa;AAAA,IACX,QAAQ;AAAA,IACR,IAAI;AAAA,EACN;AAAA,EAEA,UAAU;AAAA,IACR,eAAe;AAAA,EACjB;AAAA,EAEA,MAAM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AA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAsCZ;AAAA,EACF;AAAA,EAEA,IAAI;AAAA,IACF,OAAO;AAAA,MACL;AAAA,QACE,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,YAAY;AAAA,QACZ,aAAa;AAAA,MACf;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,YAAY;AAAA,QACZ,aAAa;AAAA,QACb,WAAW;AAAA,MACb;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,YAAY;AAAA,QACZ,aAAa;AAAA,QACb,WAAW;AAAA,MACb;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,YAAY;AAAA,QACZ,aAAa;AAAA,QACb,WAAW;AAAA,MACb;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,YAAY;AAAA,QACZ,aAAa;AAAA,QACb,WAAW;AAAA,MACb;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,YAAY;AAAA,QACZ,aAAa;AAAA,MACf;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,YAAY;AAAA,QACZ,aAAa;AAAA,QACb,aAAa,CAAC,OAAO;AAAA,MACvB;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,YAAY;AAAA,QACZ,aAAa;AAAA,QACb,aAAa,CAAC,OAAO;AAAA,MACvB;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,mBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/worker.js
CHANGED
|
@@ -9518,6 +9518,118 @@ ${diff}`,
|
|
|
9518
9518
|
return { content: summary, data: graph };
|
|
9519
9519
|
}
|
|
9520
9520
|
);
|
|
9521
|
+
ctx.tools.register(
|
|
9522
|
+
"github_get_pr_checks",
|
|
9523
|
+
{
|
|
9524
|
+
displayName: "Get PR CI/CD Status",
|
|
9525
|
+
description: "Get the CI/CD check runs status for a pull request (GitHub Actions, etc)",
|
|
9526
|
+
parametersSchema: {
|
|
9527
|
+
type: "object",
|
|
9528
|
+
properties: {
|
|
9529
|
+
owner: { type: "string" },
|
|
9530
|
+
repo: { type: "string" },
|
|
9531
|
+
pull_number: { type: "number" }
|
|
9532
|
+
},
|
|
9533
|
+
required: ["owner", "repo", "pull_number"]
|
|
9534
|
+
}
|
|
9535
|
+
},
|
|
9536
|
+
async (params, runCtx) => {
|
|
9537
|
+
const { owner, repo, pull_number } = params;
|
|
9538
|
+
const companyId = runCtx.companyId;
|
|
9539
|
+
if (!companyId) return { error: "No company context" };
|
|
9540
|
+
const { data: prData } = await githubFetch(ctx, companyId, `/repos/${owner}/${repo}/pulls/${pull_number}`);
|
|
9541
|
+
const headSha = prData.head.sha;
|
|
9542
|
+
const { data } = await githubFetch(ctx, companyId, `/repos/${owner}/${repo}/commits/${headSha}/check-runs`);
|
|
9543
|
+
const result = data;
|
|
9544
|
+
const checkRuns = result.check_runs ?? [];
|
|
9545
|
+
const summary = checkRuns.map((cr) => {
|
|
9546
|
+
const status = cr.status;
|
|
9547
|
+
const conclusion = cr.conclusion;
|
|
9548
|
+
const icon = conclusion === "success" ? "PASS" : conclusion === "failure" ? "FAIL" : status === "in_progress" ? "RUNNING" : "PENDING";
|
|
9549
|
+
return `[${icon}] ${cr.name} \u2014 ${conclusion ?? status}`;
|
|
9550
|
+
});
|
|
9551
|
+
const allPassed = checkRuns.length > 0 && checkRuns.every((cr) => cr.conclusion === "success");
|
|
9552
|
+
const hasFailed = checkRuns.some((cr) => cr.conclusion === "failure");
|
|
9553
|
+
return {
|
|
9554
|
+
content: [
|
|
9555
|
+
`CI/CD Status for PR #${pull_number} (${headSha.slice(0, 7)}):`,
|
|
9556
|
+
`Total checks: ${checkRuns.length}`,
|
|
9557
|
+
allPassed ? "All checks passed!" : hasFailed ? "Some checks FAILED" : "Checks pending...",
|
|
9558
|
+
"",
|
|
9559
|
+
...summary
|
|
9560
|
+
].join("\n"),
|
|
9561
|
+
data: { checkRuns: checkRuns.map((cr) => ({ name: cr.name, status: cr.status, conclusion: cr.conclusion })), allPassed, hasFailed }
|
|
9562
|
+
};
|
|
9563
|
+
}
|
|
9564
|
+
);
|
|
9565
|
+
ctx.tools.register(
|
|
9566
|
+
"github_get_pr_comments",
|
|
9567
|
+
{
|
|
9568
|
+
displayName: "Get PR Review Comments",
|
|
9569
|
+
description: "Get all review comments and issue comments on a pull request from other reviewers",
|
|
9570
|
+
parametersSchema: {
|
|
9571
|
+
type: "object",
|
|
9572
|
+
properties: {
|
|
9573
|
+
owner: { type: "string" },
|
|
9574
|
+
repo: { type: "string" },
|
|
9575
|
+
pull_number: { type: "number" }
|
|
9576
|
+
},
|
|
9577
|
+
required: ["owner", "repo", "pull_number"]
|
|
9578
|
+
}
|
|
9579
|
+
},
|
|
9580
|
+
async (params, runCtx) => {
|
|
9581
|
+
const { owner, repo, pull_number } = params;
|
|
9582
|
+
const companyId = runCtx.companyId;
|
|
9583
|
+
if (!companyId) return { error: "No company context" };
|
|
9584
|
+
const { data: reviewComments } = await githubFetch(ctx, companyId, `/repos/${owner}/${repo}/pulls/${pull_number}/comments?per_page=100`);
|
|
9585
|
+
const rcs = reviewComments.map((c) => ({
|
|
9586
|
+
author: c.user.login,
|
|
9587
|
+
path: c.path,
|
|
9588
|
+
line: c.line,
|
|
9589
|
+
body: c.body,
|
|
9590
|
+
createdAt: c.created_at
|
|
9591
|
+
}));
|
|
9592
|
+
const { data: issueComments } = await githubFetch(ctx, companyId, `/repos/${owner}/${repo}/issues/${pull_number}/comments?per_page=100`);
|
|
9593
|
+
const ics = issueComments.map((c) => ({
|
|
9594
|
+
author: c.user.login,
|
|
9595
|
+
body: c.body,
|
|
9596
|
+
createdAt: c.created_at
|
|
9597
|
+
}));
|
|
9598
|
+
const { data: reviews } = await githubFetch(ctx, companyId, `/repos/${owner}/${repo}/pulls/${pull_number}/reviews?per_page=100`);
|
|
9599
|
+
const rvs = reviews.map((r) => ({
|
|
9600
|
+
author: r.user.login,
|
|
9601
|
+
state: r.state,
|
|
9602
|
+
body: r.body,
|
|
9603
|
+
submittedAt: r.submitted_at
|
|
9604
|
+
}));
|
|
9605
|
+
const lines = [`PR #${pull_number} \u2014 Review Activity:`];
|
|
9606
|
+
if (rvs.length > 0) {
|
|
9607
|
+
lines.push("", "## Reviews:");
|
|
9608
|
+
for (const r of rvs) {
|
|
9609
|
+
lines.push(`- @${r.author}: ${r.state}${r.body ? ` \u2014 "${r.body}"` : ""}`);
|
|
9610
|
+
}
|
|
9611
|
+
}
|
|
9612
|
+
if (rcs.length > 0) {
|
|
9613
|
+
lines.push("", `## Inline Comments (${rcs.length}):`);
|
|
9614
|
+
for (const c of rcs) {
|
|
9615
|
+
lines.push(`- @${c.author} on ${c.path}${c.line ? `:${c.line}` : ""}: ${c.body.slice(0, 200)}`);
|
|
9616
|
+
}
|
|
9617
|
+
}
|
|
9618
|
+
if (ics.length > 0) {
|
|
9619
|
+
lines.push("", `## Discussion Comments (${ics.length}):`);
|
|
9620
|
+
for (const c of ics) {
|
|
9621
|
+
lines.push(`- @${c.author}: ${c.body.slice(0, 200)}`);
|
|
9622
|
+
}
|
|
9623
|
+
}
|
|
9624
|
+
if (rvs.length === 0 && rcs.length === 0 && ics.length === 0) {
|
|
9625
|
+
lines.push("", "No reviews or comments yet.");
|
|
9626
|
+
}
|
|
9627
|
+
return {
|
|
9628
|
+
content: lines.join("\n"),
|
|
9629
|
+
data: { reviews: rvs, reviewComments: rcs, issueComments: ics }
|
|
9630
|
+
};
|
|
9631
|
+
}
|
|
9632
|
+
);
|
|
9521
9633
|
}
|
|
9522
9634
|
|
|
9523
9635
|
// src/sync/webhook-handler.ts
|
|
@@ -9601,6 +9713,42 @@ async function handlePullRequestEvent(ctx, payload) {
|
|
|
9601
9713
|
await upsertPR(ctx.db, pr);
|
|
9602
9714
|
await detectAndLinkCards(ctx, pr.id, pr.headBranch, pr.title);
|
|
9603
9715
|
ctx.logger.info(`Webhook: upserted PR #${pr.number} from ${repoData.full_name}`);
|
|
9716
|
+
const action = payload.action;
|
|
9717
|
+
if (action === "opened" || action === "ready_for_review") {
|
|
9718
|
+
if (pr.draft) return;
|
|
9719
|
+
const repoFullName = repoData.full_name;
|
|
9720
|
+
const [owner, repoName] = repoFullName.split("/");
|
|
9721
|
+
try {
|
|
9722
|
+
const companies = await ctx.companies.list();
|
|
9723
|
+
if (companies.length === 0) return;
|
|
9724
|
+
const companyId = companies[0].id;
|
|
9725
|
+
const issue = await ctx.issues.create({
|
|
9726
|
+
companyId,
|
|
9727
|
+
title: `Code Review: ${repoFullName}#${pr.number}`,
|
|
9728
|
+
description: [
|
|
9729
|
+
`Automated review for PR #${pr.number}: **${pr.title}** by @${pr.author}`,
|
|
9730
|
+
``,
|
|
9731
|
+
`## Review Tasks`,
|
|
9732
|
+
`1. Use \`github_get_repo_structure\` with repo_full_name="${repoFullName}" to understand the codebase`,
|
|
9733
|
+
`2. Use \`github_get_pull_request_diff\` with owner="${owner}", repo="${repoName}", pull_number=${pr.number} to get the diff`,
|
|
9734
|
+
`3. Use \`github_get_pr_checks\` with owner="${owner}", repo="${repoName}", pull_number=${pr.number} to verify CI/CD status`,
|
|
9735
|
+
`4. Use \`github_get_pr_comments\` with owner="${owner}", repo="${repoName}", pull_number=${pr.number} to check existing review comments`,
|
|
9736
|
+
`5. Read relevant files with \`github_read_file_content\` for context`,
|
|
9737
|
+
`6. Post inline comments with \`github_create_review_comment\` for issues found`,
|
|
9738
|
+
`7. If changes are needed, submit review with \`github_submit_pr_review\` event="REQUEST_CHANGES" and tag @${pr.author}`,
|
|
9739
|
+
`8. If everything looks good, submit with event="APPROVE"`,
|
|
9740
|
+
``,
|
|
9741
|
+
`PR: https://github.com/${repoFullName}/pull/${pr.number}`
|
|
9742
|
+
].join("\n"),
|
|
9743
|
+
originKind: "plugin_github_review",
|
|
9744
|
+
originId: `${repoFullName}#${pr.number}`
|
|
9745
|
+
});
|
|
9746
|
+
await linkPRToCard(ctx.db, pr.id, issue.id, "webhook");
|
|
9747
|
+
ctx.logger.info(`Webhook: auto-created review issue for PR #${pr.number}`);
|
|
9748
|
+
} catch (err) {
|
|
9749
|
+
ctx.logger.error(`Webhook: failed to create review issue for PR #${pr.number}: ${err}`);
|
|
9750
|
+
}
|
|
9751
|
+
}
|
|
9604
9752
|
}
|
|
9605
9753
|
async function handleIssuesEvent(ctx, payload) {
|
|
9606
9754
|
const issueData = payload.issue;
|
|
@@ -10147,6 +10295,7 @@ var plugin = definePlugin({
|
|
|
10147
10295
|
originKind: "plugin_github_review",
|
|
10148
10296
|
originId: `${repoFullName}#${prNumber}`
|
|
10149
10297
|
});
|
|
10298
|
+
await linkPRToCard(ctx.db, prId, issue.id, "manual");
|
|
10150
10299
|
return { ok: true, issueId: issue.id };
|
|
10151
10300
|
});
|
|
10152
10301
|
ctx.actions.register("run-quick-check", async ({ companyId, repoFullName, prNumber }) => {
|