paperclip-github-plugin 0.12.0 → 0.14.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/README.md +26 -18
- package/dist/manifest.js +12 -13
- package/dist/ui/index.js +10 -426
- package/dist/ui/index.js.map +3 -3
- package/dist/worker.js +442 -59
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -19,7 +19,6 @@ With this plugin, you can:
|
|
|
19
19
|
- import open GitHub issues into Paperclip without adding title prefixes or duplicate issues
|
|
20
20
|
- keep descriptions, labels, and status aligned with GitHub over time
|
|
21
21
|
- configure mappings and import defaults per Paperclip company
|
|
22
|
-
- choose exactly which company agents should receive the saved GitHub token as `GITHUB_TOKEN`
|
|
23
22
|
- run sync manually or on a schedule
|
|
24
23
|
- triage open pull requests from mapped Paperclip projects in a hosted queue
|
|
25
24
|
- give Paperclip agents native GitHub tools for issues, pull requests, CI, review threads, and org-level projects
|
|
@@ -29,7 +28,7 @@ With this plugin, you can:
|
|
|
29
28
|
The plugin adds a full in-host workflow instead of a one-off import script:
|
|
30
29
|
|
|
31
30
|
- a hosted settings page for GitHub auth, repository mappings, company defaults, execution-policy handoff fallbacks, and sync controls
|
|
32
|
-
- setup controls for Paperclip board access
|
|
31
|
+
- setup controls for Paperclip board access when host API calls require board credentials
|
|
33
32
|
- a dashboard widget that shows sync readiness, current sync status, and run/cancel controls
|
|
34
33
|
- a separate KPI dashboard widget that tracks GitHub backlog size, GitHub issues closed, and Paperclip pull requests created with recent history and historical comparisons
|
|
35
34
|
- saved sync diagnostics that let operators inspect the latest per-issue failures, raw errors, and suggested next steps
|
|
@@ -70,7 +69,7 @@ GitHub Sync exposes a dedicated KPI dashboard widget alongside the operational s
|
|
|
70
69
|
|
|
71
70
|
Because GitHub alone cannot tell which pull requests came from a Paperclip company, the plugin uses explicit Paperclip attribution for delivery activity. `create_pull_request` automatically records a Paperclip-created PR event, and agents that use `gh` or another non-plugin GitHub client can post pull-request-created events to the plugin API route so the KPI history stays specific to Paperclip work. When either path includes the Paperclip issue id, GitHub Sync also records the pull request link so later sync runs can move that issue based on PR CI, merge state, and review activity.
|
|
72
71
|
|
|
73
|
-
That API route remains intentionally separate from the plugin tool surface because it records PRs created outside the plugin, for example when an agent uses
|
|
72
|
+
That API route remains intentionally separate from the plugin tool surface because it records PRs created outside the plugin, for example when an agent uses an external GitHub client instead of the GitHub Sync tool. The Paperclip host authenticates the bearer agent token, scopes the request to the calling agent's company, and rejects anonymous or non-agent calls before dispatching to the worker.
|
|
74
73
|
|
|
75
74
|
### Third-party issue links
|
|
76
75
|
|
|
@@ -106,7 +105,7 @@ They can also link a Paperclip issue to a GitHub issue or pull request in any ac
|
|
|
106
105
|
## Requirements
|
|
107
106
|
|
|
108
107
|
- Node.js 20+
|
|
109
|
-
- a Paperclip host with plugin installation enabled. GitHub Sync is built and tested against Paperclip `2026.
|
|
108
|
+
- a Paperclip host with plugin installation enabled. GitHub Sync is built and tested against Paperclip `2026.626.0`; the manifest relies on explicit capabilities instead of a strict host-version gate because current latest/development hosts can report `0.0.0` during plugin upgrade.
|
|
110
109
|
- a GitHub token with API access to the repositories you want to sync
|
|
111
110
|
|
|
112
111
|
## Install from npm
|
|
@@ -138,13 +137,12 @@ npx paperclipai plugin install --local "$PWD"
|
|
|
138
137
|
1. Open the plugin settings for **GitHub Sync** from inside the Paperclip company you want to configure.
|
|
139
138
|
2. Paste a GitHub token, validate it, and save it.
|
|
140
139
|
3. If the deployment is authenticated or local trusted, connect Paperclip board access from the same settings page and complete the approval flow when host API calls need board credentials.
|
|
141
|
-
4.
|
|
142
|
-
5.
|
|
143
|
-
6.
|
|
144
|
-
7.
|
|
145
|
-
8.
|
|
146
|
-
9.
|
|
147
|
-
10. Repeat inside other companies if they need their own mappings, defaults, board access, or agent token propagation.
|
|
140
|
+
4. Add one or more repository mappings for the current company.
|
|
141
|
+
5. For each mapping, either choose an existing GitHub-linked Paperclip project or enter the project name that should receive synced issues.
|
|
142
|
+
6. Optionally configure company-wide defaults for imported issues, including the default assignee, the default Paperclip status, executor/reviewer/approver handoff assignees for sync-driven transitions, and ignored GitHub usernames. When Paperclip board access is connected, each assignee dropdown also offers `Me` for the connected board user. `Automatic routing` means GitHub Sync follows the issue's Paperclip execution policy first and only uses the saved fallback when Paperclip does not expose the next reviewer, approver, or return assignee yet. Bot aliases such as `renovate[bot]` are matched when you save `renovate`.
|
|
143
|
+
7. Choose the automatic sync interval in minutes.
|
|
144
|
+
8. Save the settings and run the first manual sync.
|
|
145
|
+
9. Repeat inside other companies if they need their own mappings, defaults, or board access.
|
|
148
146
|
|
|
149
147
|
Repository input accepts either `owner/repo` or `https://github.com/owner/repo`.
|
|
150
148
|
When a token is saved, the settings page audits the mapped repositories for the permissions needed by pull request actions and warns when permissions are missing or GitHub cannot verify them yet.
|
|
@@ -196,7 +194,7 @@ The plugin is designed to avoid persisting raw credentials in plugin state.
|
|
|
196
194
|
- GitHub tokens saved through the UI are stored as per-company Paperclip secret references.
|
|
197
195
|
- Paperclip board access tokens are also stored as per-company secret references.
|
|
198
196
|
- The settings UI also keeps lightweight non-secret identity labels for those saved connections, so later visits can still show who each company GitHub token and board access are connected as.
|
|
199
|
-
-
|
|
197
|
+
- Agents use Paperclip's plugin tool dispatcher for GitHub Sync tools; the settings UI no longer propagates the saved GitHub token into agent environment variables.
|
|
200
198
|
- The worker resolves those secret references at runtime instead of storing raw tokens in plugin state.
|
|
201
199
|
- When the current Paperclip host rejects plugin secret refs, GitHub Sync keeps company-scoped worker-local compatibility copies for GitHub tokens and Paperclip board-access tokens in `${PAPERCLIP_HOME:-~/.paperclip}/plugins/github-sync/config.json`. Reconnect board access once after upgrading if sync still cannot authenticate Paperclip label or issue REST calls.
|
|
202
200
|
- On authenticated Paperclip deployments, sync is blocked until the relevant company has connected Paperclip board access. On local trusted deployments, board access setup remains visible so operators can configure it for host API paths that still require board credentials, but missing board access does not by itself block sync preflight.
|
|
@@ -224,7 +222,6 @@ Notes:
|
|
|
224
222
|
- The raw token is never persisted back into plugin state or plugin config.
|
|
225
223
|
- A GitHub token secret saved through the settings UI is the primary source. If the current Paperclip host rejects plugin secret-ref resolution while company-scoped plugin config is unavailable, GitHub Sync stores the validated token in `githubTokensByCompanyId` as a worker-local compatibility fallback.
|
|
226
224
|
- A Paperclip board access secret saved through the settings UI is also the primary source. If the host cannot resolve it for plugin workers, reconnecting board access stores the approved board token in `paperclipBoardApiTokensByCompanyId` as a worker-local compatibility fallback for direct Paperclip REST calls.
|
|
227
|
-
- Selected agents receive `GITHUB_TOKEN` as a latest-version secret-ref env binding, and the settings UI patches agent adapter config with `replaceAdapterConfig: true` so newer Paperclip hosts persist the merged env map.
|
|
228
225
|
|
|
229
226
|
### Worker-facing Paperclip API URL
|
|
230
227
|
|
|
@@ -242,6 +239,12 @@ The plugin exposes GitHub workflow tools to Paperclip agents, including:
|
|
|
242
239
|
- review-thread reads, replies, resolve and unresolve actions, and `request_pull_request_reviewers` reviewer requests
|
|
243
240
|
- organization-level GitHub Project search/listing and pull-request-to-project association
|
|
244
241
|
|
|
242
|
+
`create_pull_request` is the single agent-facing delivery call for both branch publication and PR creation. The caller supplies the Paperclip issue id, a plain local branch name, the exact 40-character local branch-tip SHA, the base branch, and the PR metadata. The trusted plugin worker verifies checkout ownership, resolves the issue's execution worktree and GitHub secret, verifies the checked-out branch, worktree HEAD, local branch tip, and base ancestry, publishes only that exact commit with a non-forcing refspec, reads the remote branch SHA back, and only then creates and links the PR. The GitHub credential is never returned to or injected into the calling agent.
|
|
243
|
+
|
|
244
|
+
Branch publication uses an isolated temporary bare repository backed by the trusted workspace object database. It does not execute repository hooks, accept arbitrary refspecs, or honor agent-supplied remote URLs. Publication rejects owner-qualified heads, base-branch targets, non-fast-forward updates, cross-project issues, mismatched local branch tips, and remote SHA mismatches.
|
|
245
|
+
|
|
246
|
+
The call is ordered and retry-safe rather than a cross-system transaction: a published branch may remain if GitHub PR creation or Paperclip link persistence fails. On retry, the tool re-verifies and republishes the exact SHA, then recovers an already-open PR only when repository, head, base, and head SHA all match before repairing the link and metric. It never deletes a branch or closes a PR as automatic compensation.
|
|
247
|
+
|
|
245
248
|
When an agent sends GitHub body content through the plugin, including issue bodies, pull request descriptions, comments, and review-thread replies, the plugin adds a GitHub-flavored Markdown footer with a horizontal rule and compact heading that discloses AI authorship. If the tool caller supplies `llmModel`, the footer also includes the model name, for example `###### ✨ This comment was AI-generated using gpt-5.4`.
|
|
246
249
|
|
|
247
250
|
### KPI attribution API route
|
|
@@ -279,7 +282,12 @@ curl -X POST "${PAPERCLIP_API_URL%/}/api/plugins/paperclip-github-plugin/api/com
|
|
|
279
282
|
|
|
280
283
|
The worker deduplicates repeated PR events by preferring the pull request URL, then `repository + pullRequestNumber`, before falling back to the explicit `eventKey`. When `paperclipIssueId` is present, the worker verifies the live pull request and persists the same PR-link metadata used by scheduled/manual status syncs.
|
|
281
284
|
|
|
282
|
-
|
|
285
|
+
|
|
286
|
+
Paperclip `2026.626.0` adds external object references and task watchdogs, both relevant to GitHub URLs and long-running PR follow-up. GitHub issue and pull request URLs in synced descriptions, comments, and status-transition annotations can be recognized by Paperclip's built-in GitHub external-object provider, so GitHub Sync retires its plugin comment-annotation slot instead of continuing to render a duplicate GitHub-link annotation on comments. GitHub Sync also does **not** register a separate `external.objects.*` provider in this release: the host now owns generic GitHub URL detection and liveness snapshots, while GitHub Sync continues to own repository mappings, issue/PR sync, project PR dashboards, KPI attribution, and mutating GitHub agent tools. A future product PR can connect core external-object mentions back to GitHub Sync entities if operators need richer cross-filtering, but status routing must keep GitHub Sync as the source of truth for mapped/linked work.
|
|
287
|
+
|
|
288
|
+
Task watchdogs are also deliberately not used as a replacement for GitHub Sync's scheduled/manual refresh loop. A watched issue tree that is merely waiting on GitHub CI, mergeability, review threads, or maintainer approval can look "stopped" to Paperclip's generic task-watchdog classifier because there may be no live Paperclip run or wake request while GitHub is the active external system. GitHub Sync should keep encoding those states through issue/PR links, sync comments, status transitions, assignee/execution-policy handoffs, and scheduled sync. Use task watchdogs only for Paperclip-owned delegated task trees; do not use them to poll GitHub PR state or to infer that GitHub Sync should wake an executor.
|
|
289
|
+
|
|
290
|
+
Paperclip `2026.626.0` accepts agent authentication for plugin tool discovery and execution, so agents should use the declared GitHub Sync tools for first-class workflow operations. The KPI attribution endpoint remains a native plugin JSON route for PRs created outside the plugin tool path.
|
|
283
291
|
|
|
284
292
|
### Pull request asset upload
|
|
285
293
|
|
|
@@ -328,7 +336,7 @@ Example tool payload:
|
|
|
328
336
|
- If an older GitHub Sync build fails upgrade with `requires host version 2026.427.0 or newer, but this server is running 0.0.0`, upgrade to a build that removes the strict manifest host-version gate. The host is reporting a development-version sentinel, so the plugin now relies on declared capabilities and runtime fallbacks instead.
|
|
329
337
|
- If setup is reported as incomplete, confirm that a GitHub token has been saved or that `${PAPERCLIP_HOME:-~/.paperclip}/plugins/github-sync/config.json` contains `githubToken`, and make sure at least one mapping has a created Paperclip project or at least one Paperclip issue has been linked to GitHub.
|
|
330
338
|
- If Paperclip says board access is required, open plugin settings inside the affected company and complete the Paperclip board access flow before retrying sync.
|
|
331
|
-
- If GitHub Sync agent tools fail on `/api/plugins/tools` or `/api/plugins/tools/execute`, confirm the Paperclip host is `2026.
|
|
339
|
+
- If GitHub Sync agent tools fail on `/api/plugins/tools` or `/api/plugins/tools/execute`, confirm the Paperclip host is `2026.626.0` or newer and that the tool request includes the agent run context required by Paperclip.
|
|
332
340
|
- If a KPI API route call is rejected, make sure the request includes `Authorization: Bearer ${PAPERCLIP_API_KEY}`, that the token is still valid for the current run, and that any `companyId` in the payload matches the calling agent's company.
|
|
333
341
|
- If the worker reaches an authenticated HTML page instead of the Paperclip API JSON responses it expects, connect Paperclip board access for that company or set **Worker Paperclip API URL** in GitHub Sync settings to a worker-accessible Paperclip API origin.
|
|
334
342
|
- If a Paperclip API fetch fails before any HTTP response is returned, the saved diagnostics include the method, URL, primary error, nested cause, and cause code when Node exposes them.
|
|
@@ -354,10 +362,10 @@ Useful scripts:
|
|
|
354
362
|
|
|
355
363
|
- `pnpm dev` watches the manifest, worker, and UI bundles and rebuilds them into `dist/`
|
|
356
364
|
- `pnpm dev:ui` starts a local Paperclip plugin UI dev server from `dist/ui` on port `4177`
|
|
357
|
-
- `pnpm test:e2e` builds the plugin, boots an isolated Paperclip `2026.
|
|
358
|
-
- `pnpm verify:manual` builds the plugin, boots a local-trusted Paperclip `2026.
|
|
365
|
+
- `pnpm test:e2e` builds the plugin, boots an isolated Paperclip `2026.626.0` instance, installs the plugin, and verifies the hosted settings page renders
|
|
366
|
+
- `pnpm verify:manual` builds the plugin, boots a local-trusted Paperclip `2026.626.0` instance for manual inspection, seeds a `Dummy Company` with a mapped review project and a `CEO` agent on the Codex local adapter using model `gpt-5.4`, installs the plugin, and opens the company dashboard without seeding KPI history.
|
|
359
367
|
|
|
360
|
-
The disposable Paperclip harnesses run `paperclipai@2026.
|
|
368
|
+
The disposable Paperclip harnesses run `paperclipai@2026.626.0` under `node@24`, matching the release's Docker baseline and avoiding Node 20's missing `node:sqlite` runtime module.
|
|
361
369
|
|
|
362
370
|
For fast hosted UI iteration, run `pnpm dev` in one terminal and `pnpm dev:ui` in another.
|
|
363
371
|
|
package/dist/manifest.js
CHANGED
|
@@ -254,20 +254,25 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
254
254
|
{
|
|
255
255
|
name: "create_pull_request",
|
|
256
256
|
displayName: "Create Pull Request",
|
|
257
|
-
description: "
|
|
257
|
+
description: "Publish the local branch at the exact requested commit, verify the remote branch, then create and link a GitHub pull request in one operation. The GitHub credential remains inside the trusted plugin worker. When a non-empty body is provided, the plugin appends an AI-authorship footer and includes llmModel when supplied.",
|
|
258
258
|
parametersSchema: {
|
|
259
259
|
type: "object",
|
|
260
260
|
additionalProperties: false,
|
|
261
|
-
required: ["head", "base", "title"],
|
|
261
|
+
required: ["paperclipIssueId", "head", "headCommitSha", "base", "title"],
|
|
262
262
|
properties: {
|
|
263
263
|
repository: repositoryProperty,
|
|
264
264
|
paperclipIssueId: {
|
|
265
265
|
type: "string",
|
|
266
|
-
description: "
|
|
266
|
+
description: "Paperclip issue id used to resolve the trusted project workspace, mapped GitHub repository, and durable pull-request link."
|
|
267
267
|
},
|
|
268
268
|
head: {
|
|
269
269
|
type: "string",
|
|
270
|
-
description: "
|
|
270
|
+
description: "Plain local branch name to publish. Owner-qualified branches and arbitrary refspecs are rejected."
|
|
271
|
+
},
|
|
272
|
+
headCommitSha: {
|
|
273
|
+
type: "string",
|
|
274
|
+
pattern: "^[0-9a-fA-F]{40}$",
|
|
275
|
+
description: "Full 40-character commit SHA that must equal the exact local branch tip and the verified remote branch tip."
|
|
271
276
|
},
|
|
272
277
|
base: {
|
|
273
278
|
type: "string",
|
|
@@ -636,7 +641,7 @@ var COMPANY_METRIC_API_ROUTE_URL_PATH = `/api/plugins/${GITHUB_SYNC_PLUGIN_ID}/a
|
|
|
636
641
|
var require2 = createRequire(import.meta.url);
|
|
637
642
|
var packageJson = require2("../package.json");
|
|
638
643
|
var SCHEDULE_TICK_CRON = "* * * * *";
|
|
639
|
-
var MANIFEST_VERSION = "0.
|
|
644
|
+
var MANIFEST_VERSION = "0.14.0"?.trim() || typeof packageJson.version === "string" && packageJson.version.trim() || process.env.npm_package_version?.trim() || "0.0.0-dev";
|
|
640
645
|
var manifest = {
|
|
641
646
|
id: GITHUB_SYNC_PLUGIN_ID,
|
|
642
647
|
apiVersion: 1,
|
|
@@ -650,13 +655,14 @@ var manifest = {
|
|
|
650
655
|
"ui.page.register",
|
|
651
656
|
"ui.dashboardWidget.register",
|
|
652
657
|
"ui.detailTab.register",
|
|
653
|
-
"ui.commentAnnotation.register",
|
|
654
658
|
"ui.action.register",
|
|
655
659
|
"plugin.state.read",
|
|
656
660
|
"plugin.state.write",
|
|
657
661
|
"instance.settings.register",
|
|
658
662
|
"projects.read",
|
|
663
|
+
"execution.workspaces.read",
|
|
659
664
|
"issues.read",
|
|
665
|
+
"issues.checkout",
|
|
660
666
|
"issues.create",
|
|
661
667
|
"issues.update",
|
|
662
668
|
"issues.wakeup",
|
|
@@ -751,13 +757,6 @@ var manifest = {
|
|
|
751
757
|
exportName: "GitHubSyncIssueTaskDetailView",
|
|
752
758
|
entityTypes: ["issue"]
|
|
753
759
|
},
|
|
754
|
-
{
|
|
755
|
-
type: "commentAnnotation",
|
|
756
|
-
id: "paperclip-github-plugin-comment-annotation",
|
|
757
|
-
displayName: "GitHub Sync Links",
|
|
758
|
-
exportName: "GitHubSyncCommentAnnotation",
|
|
759
|
-
entityTypes: ["comment"]
|
|
760
|
-
},
|
|
761
760
|
{
|
|
762
761
|
type: "globalToolbarButton",
|
|
763
762
|
id: "paperclip-github-plugin-global-toolbar-button",
|