@gaud_erp/paperclip-github-manager 1.3.0 → 1.3.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/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: "1.3.0",
4
+ version: "1.3.1",
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",
@@ -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.3.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 \"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 ],\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\n agents: [\n {\n agentKey: \"github-reviewer\",\n displayName: \"GitHub Code Reviewer\",\n role: \"code-review\",\n title: \"Senior Code Reviewer\",\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"],
4
+ "sourcesContent": ["import type { PaperclipPluginManifestV1 } from \"@paperclipai/plugin-sdk\";\n\nconst manifest: PaperclipPluginManifestV1 = {\n id: \"cus.github-manager\",\n version: \"1.3.1\",\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 \"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 ],\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\n agents: [\n {\n agentKey: \"github-reviewer\",\n displayName: \"GitHub Code Reviewer\",\n role: \"code-review\",\n title: \"Senior Code Reviewer\",\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
5
  "mappings": ";AAEA,IAAM,WAAsC;AAAA,EAC1C,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,aAAa;AAAA,EACb,QAAQ;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a;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
@@ -9657,8 +9657,59 @@ async function syncRepoIssues(ctx, companyId, repoId, fullName, since) {
9657
9657
  // src/sync/full-sync.ts
9658
9658
  init_queries();
9659
9659
  async function runFullSync(ctx, companyId) {
9660
- const repos = await listRepos(ctx.db);
9661
- if (repos.length === 0) return;
9660
+ let repos = await listRepos(ctx.db);
9661
+ if (repos.length === 0) {
9662
+ const config = await ctx.config.get();
9663
+ const org = config?.defaultOrg;
9664
+ if (org) {
9665
+ ctx.logger.info(`No repos tracked, discovering from org: ${org}`);
9666
+ let page = 1;
9667
+ let hasMore = true;
9668
+ while (hasMore) {
9669
+ const { data } = await githubFetch(ctx, companyId, `/orgs/${org}/repos?per_page=100&page=${page}`);
9670
+ const items = data;
9671
+ for (const rd of items) {
9672
+ await upsertRepo(ctx.db, {
9673
+ id: rd.id,
9674
+ fullName: rd.full_name,
9675
+ owner: rd.owner.login,
9676
+ name: rd.name,
9677
+ private: rd.private,
9678
+ defaultBranch: rd.default_branch,
9679
+ htmlUrl: rd.html_url,
9680
+ description: rd.description,
9681
+ language: rd.language,
9682
+ topics: rd.topics ?? [],
9683
+ updatedAt: rd.updated_at
9684
+ });
9685
+ }
9686
+ hasMore = items.length === 100;
9687
+ page++;
9688
+ }
9689
+ repos = await listRepos(ctx.db);
9690
+ } else {
9691
+ ctx.logger.info("No repos tracked and no defaultOrg, discovering user repos");
9692
+ const { data } = await githubFetch(ctx, companyId, "/user/repos?per_page=100&sort=updated");
9693
+ const items = data;
9694
+ for (const rd of items) {
9695
+ await upsertRepo(ctx.db, {
9696
+ id: rd.id,
9697
+ fullName: rd.full_name,
9698
+ owner: rd.owner.login,
9699
+ name: rd.name,
9700
+ private: rd.private,
9701
+ defaultBranch: rd.default_branch,
9702
+ htmlUrl: rd.html_url,
9703
+ description: rd.description,
9704
+ language: rd.language,
9705
+ topics: rd.topics ?? [],
9706
+ updatedAt: rd.updated_at
9707
+ });
9708
+ }
9709
+ repos = await listRepos(ctx.db);
9710
+ }
9711
+ if (repos.length === 0) return;
9712
+ }
9662
9713
  const logId = await createSyncLog(ctx.db, "full");
9663
9714
  let reposSynced = 0;
9664
9715
  let prsSynced = 0;