paperclip-github-plugin 0.15.7 → 0.16.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/README.md +15 -5
- package/dist/manifest.js +19 -3
- package/dist/ui/index.js +10 -7
- package/dist/ui/index.js.map +3 -3
- package/dist/worker.js +886 -330
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ The plugin adds a full in-host workflow instead of a one-off import script:
|
|
|
43
43
|
2. Connect one or more GitHub repositories to Paperclip projects.
|
|
44
44
|
3. Run a sync manually or let the scheduled job keep things up to date.
|
|
45
45
|
|
|
46
|
-
During sync, the plugin imports one top-level Paperclip issue per GitHub issue, stamps it with a namespaced GitHub Sync plugin origin, updates already imported issues instead of recreating them, maps GitHub labels into Paperclip labels, and keeps GitHub-specific metadata in dedicated Paperclip surfaces rather than stuffing everything into the issue description.
|
|
46
|
+
During sync, the plugin imports one top-level Paperclip issue per GitHub issue, stamps it with a namespaced GitHub Sync plugin origin, updates already imported issues instead of recreating them, maps GitHub labels into Paperclip labels, and keeps GitHub-specific metadata in dedicated Paperclip surfaces rather than stuffing everything into the issue description. Imports are first created as neutral, unassigned backlog issues with their durable origin identity; GitHub Sync then persists activation state and any required agent-wake intent before applying the configured initial status or assignee. That ordering lets a restarted worker recover an origin-only issue without duplicating it or losing its first agent wake. Detail surfaces likewise recover GitHub issue and pull request links from Paperclip's own `originKind` / `originId` fields when the plugin registry, link entity, or legacy hidden marker is missing.
|
|
47
47
|
|
|
48
48
|
When the host exposes plugin issue creation, imported GitHub issues are created through the Paperclip plugin SDK path so they are not attributed to the connected board user. The worker still uses direct local Paperclip REST calls for label sync and for description, assignee, or status repair paths when those routes are available.
|
|
49
49
|
|
|
@@ -79,6 +79,14 @@ Sometimes a Paperclip issue is implemented through a GitHub issue or pull reques
|
|
|
79
79
|
|
|
80
80
|
Third-party links are company-scoped and sync only the linked GitHub issue or pull request. Future manual or scheduled company sync runs refresh those external records and update the Paperclip issue status from the same CI, mergeability, review, thread, and issue-state rules used for mapped repositories.
|
|
81
81
|
|
|
82
|
+
### Durable pull-request follow-through owners
|
|
83
|
+
|
|
84
|
+
A pull-request link may include `followThroughAssigneeAgentId`, an optional Paperclip agent id that owns future actionable work for that specific PR. `create_pull_request`, `link_github_item`, the authenticated pull-request metric endpoint, and the hosted link action all accept the field for PR links. Responses include the persisted owner when one is set. Pass `null` when the surface supports updating a link to clear the owner; omitting the property preserves the existing value.
|
|
85
|
+
|
|
86
|
+
The worker validates an explicit owner against the authoritative Paperclip agent service before writing the link. The agent must exist and belong to the authenticated company; missing and cross-company ids fail closed. Successful owner changes carry `followThroughAssigneeUpdatedAt` in the durable link and agent-tool changes remain visible in the existing issue interaction ledger.
|
|
87
|
+
|
|
88
|
+
The owner is stored on the PR-link entity, so unrelated title/state refreshes, process restarts, and execution-state cleanup do not remove it. Old link records without the property remain valid and use the previous fallback behavior. For actionable direct-PR work, assignment precedence is: an active execution-state `returnAssignee`, the PR's durable follow-through owner, the configured company executor, then the configured default assignee. Red CI, unresolved review threads, trusted follow-up, and merge-conflict/action-required states assign and wake the selected owner. A healthy external-maintainer wait remains `in_review` and unassigned. Effective-state fingerprints include durable routing so unchanged polls neither repeat the mutation nor enqueue another wake.
|
|
89
|
+
|
|
82
90
|
### Project pull request command center
|
|
83
91
|
|
|
84
92
|
Each mapped project can expose a **Pull Requests** entry in the sidebar that opens a live GitHub queue page for that repository. The sidebar badge uses a lightweight total-count read, while the queue keeps the default view fast by loading only the current 10-row page, uses a repo-wide metrics read for the summary cards, reuses that cached metrics scan to keep filtered views fast by fetching only the visible filtered rows, keeps repo-scoped count, metrics, and per-PR review/check insight caches warm for repeat visits, lets operators explicitly bust those caches with Refresh when they want a live reread, shows total, mergeable, reviewable, and failing cards that filter the table, only treats a pull request as mergeable when it targets the current default branch with green checks, at least one approval, no outstanding change requests, and no unresolved review threads, includes an **Up to date** column that distinguishes current branches, clean update candidates, conflict cases, and unknown freshness when GitHub cannot confirm the comparison, shows the PR target branch with a highlighted default-branch badge, keeps the list sorted by most recently updated first, paginates larger repositories, keeps a compact bottom detail pane with markdown-and-HTML-rendered conversation plus an inline comment composer, supports deterministic **Update branch** actions for clean behind-base pull requests, adds Copilot quick actions that post `@copilot` requests for **Fix CI**, **Rebase**, and **Address review feedback**, requests Copilot through GitHub’s native reviewer flow for **Review**, keeps comment, review, quick approve/request-changes, re-run CI, merge, and close actions available, lets the review modal submit comment-only, approve, or request-changes reviews, hides any pull request action whose required GitHub permission is not verified for the saved token, and opens linked Paperclip issues in a plugin-provided right drawer so operators can stay on the queue page.
|
|
@@ -196,9 +204,9 @@ Additional behavior:
|
|
|
196
204
|
- For linked pull requests, GitHub Sync treats merge-conflict, behind-branch, blocked, draft, unstable merge states, and unresolved review threads as executor work, while merge-ready states such as `CLEAN` and `HAS_HOOKS` can move work into `in_review` when CI is green and review threads are resolved. If an issue is already `blocked` and GitHub reports only pending external merge requirements while CI is unfinished, sync preserves the external wait instead of waking an executor. A stale aggregate `CHANGES_REQUESTED` review decision alone does not move that maintainer wait back to active execution. Transient `UNKNOWN` mergeability also does not move an already `in_review` maintainer wait back to active execution when CI is green and review threads are resolved.
|
|
197
205
|
- Imported issues that are already `blocked` stay `blocked` while any first-class `blockedBy` issue is still non-terminal, even if the linked GitHub pull request is otherwise green and review-ready.
|
|
198
206
|
- When sync moves work into `in_review`, GitHub Sync first follows the Paperclip issue execution policy's current reviewer or approver when that stage is visible on the issue. If Paperclip exposes an internal review or approval stage but not yet the participant, the plugin falls back to the configured reviewer or approver handoff assignee. If the transition is only a healthy linked-PR wait with no visible internal review or approval stage, GitHub Sync leaves the issue unassigned so it can wait on normal maintainer review without waking an internal owner. An execution state explicitly marked `completed` contains historical stage and decision fields, not active routing: GitHub Sync clears that completed policy/state and the stale internal assignee atomically when restoring `done` to `in_review`, and it emits no assignment wakeup.
|
|
199
|
-
- When sync moves work back into active execution, GitHub Sync first follows the Paperclip issue execution policy `returnAssignee` when it is available. Otherwise it falls back to the configured executor handoff assignee and
|
|
207
|
+
- When sync moves work back into active execution, GitHub Sync first follows the Paperclip issue execution policy `returnAssignee` when it is available. Otherwise it uses the durable pull-request follow-through owner, then falls back to the configured executor handoff assignee and finally to the default imported assignee.
|
|
200
208
|
- Sync-driven handoffs to agent assignees best-effort enqueue an explicit wakeup so the next reviewer, approver, or executor can pick the issue up even when their agent is not running heartbeats.
|
|
201
|
-
- After applying a GitHub-derived state, GitHub Sync immediately stores a bounded fingerprint of the effective issue/PR condition (including head SHA, closure outcome, and the highest-priority actionable check/review/merge condition).
|
|
209
|
+
- After applying a GitHub-derived state, GitHub Sync immediately stores a bounded fingerprint of the effective issue/PR condition (including head SHA, closure outcome, and the highest-priority actionable check/review/merge condition). While local Paperclip status, assignment, and execution metadata still match the desired state, the same fingerprint remains quiescent: sync does not repeat the transition, comment, or wake, including for `done`/`cancelled` closure outcomes and directly PR-linked issues. If local state later drifts under unchanged remote evidence, sync reconciles it through a drift-specific journal attempt and issues one required wake when the corrected state is actionable and agent-owned. Raw `UNKNOWN`/aggregate jitter that does not change the effective action cannot re-arm the transition. A changed effective fingerprint or a trusted new issue/PR/review comment bypasses suppression; untrusted comment-count changes do not. Status/comment watermarks advance only after their action succeeds. When a required assignee wake fails, the successful mutation and a bounded pending-wake record are already durable, so the next sync retries only the wake without repeating the status change or comment.
|
|
202
210
|
- Open imported issues that are already `backlog` stay in `backlog` until someone changes them in Paperclip.
|
|
203
211
|
- If an imported issue is `done` or `cancelled` and GitHub shows it open again with no linked pull request, sync moves it to `todo` so agents can pick it up again.
|
|
204
212
|
- Trusted new GitHub comments from the original issue author or a verified maintainer/admin can move an open imported issue back into active work, whether the new comment lands on the source issue, in a linked pull request's top-level comment stream, or in a linked pull request review thread; GitHub Sync uses `in_progress` when it can route the issue to an executor and otherwise `todo`.
|
|
@@ -251,7 +259,7 @@ For private LAN, Docker, Kubernetes, custom DNS, or self-signed-certificate depl
|
|
|
251
259
|
The plugin exposes GitHub workflow tools to Paperclip agents, including:
|
|
252
260
|
|
|
253
261
|
- repository-scoped search for issues and pull requests
|
|
254
|
-
- issue reads, comment reads, comment writes, metadata updates, and `assign_to_current_user` assignment to the saved token owner
|
|
262
|
+
- issue reads, comment reads, comment writes, metadata updates, native `completed`/`not_planned`/`duplicate` closure and `reopened` transitions, and `assign_to_current_user` assignment to the saved token owner
|
|
255
263
|
- pull request creation, reads, updates, changed-file inspection, CI-check inspection, and asset upload for PR visual evidence
|
|
256
264
|
- review-thread reads, replies, resolve and unresolve actions, and `request_pull_request_reviewers` reviewer requests
|
|
257
265
|
- organization-level GitHub Project search/listing and pull-request-to-project association
|
|
@@ -264,7 +272,9 @@ The call is ordered and retry-safe rather than a cross-system transaction: a pub
|
|
|
264
272
|
|
|
265
273
|
After that durable link is written, pull-request tools can use the same `paperclipIssueId` to read or update the PR immediately, even when the Paperclip issue was created natively and has no linked GitHub issue. If one Paperclip issue has same-number PRs in different repositories, the caller must also supply the repository so the worker can reject ambiguous or unlinked selections.
|
|
266
274
|
|
|
267
|
-
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`.
|
|
275
|
+
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 an `llmModel`, the footer also includes the model name, for example `###### ✨ This comment was AI-generated using gpt-5.4`.
|
|
276
|
+
|
|
277
|
+
`update_issue` accepts `stateReason` with GitHub's native values `completed`, `not_planned`, `duplicate`, and `reopened`. Closing uses `state: "closed"` with one of the first three reasons; reopening uses `state: "open"` with `stateReason: "reopened"`. Duplicate closure also requires `duplicateIssueNumber`, which the worker resolves to GitHub's canonical database id in the same repository. GitHub only applies a reason while changing state, so changing the reason of an already-closed issue fails clearly and requires reopening it first.
|
|
268
278
|
|
|
269
279
|
### KPI attribution API route
|
|
270
280
|
|
package/dist/manifest.js
CHANGED
|
@@ -14,6 +14,10 @@ var paperclipIssueIdProperty = {
|
|
|
14
14
|
type: "string",
|
|
15
15
|
description: "Paperclip issue id used to infer the linked GitHub issue and repository when available."
|
|
16
16
|
};
|
|
17
|
+
var followThroughAssigneeAgentIdProperty = {
|
|
18
|
+
type: ["string", "null"],
|
|
19
|
+
description: "Optional durable Paperclip agent owner for actionable follow-through on this linked pull request. The agent must belong to the authenticated company. Pass null to clear an existing owner."
|
|
20
|
+
};
|
|
17
21
|
var issueNumberProperty = {
|
|
18
22
|
type: "integer",
|
|
19
23
|
minimum: 1,
|
|
@@ -149,7 +153,7 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
149
153
|
{
|
|
150
154
|
name: "update_issue",
|
|
151
155
|
displayName: "Update Issue",
|
|
152
|
-
description: "Update GitHub issue fields such as title, body, state, labels, assignees, or milestone. When a non-empty body is provided, the plugin appends an AI-authorship footer and includes llmModel when supplied.",
|
|
156
|
+
description: "Update GitHub issue fields such as title, body, state, closure reason, labels, assignees, or milestone. When a non-empty body is provided, the plugin appends an AI-authorship footer and includes llmModel when supplied.",
|
|
153
157
|
parametersSchema: {
|
|
154
158
|
type: "object",
|
|
155
159
|
additionalProperties: false,
|
|
@@ -170,6 +174,16 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
170
174
|
type: "string",
|
|
171
175
|
enum: ["open", "closed"]
|
|
172
176
|
},
|
|
177
|
+
stateReason: {
|
|
178
|
+
type: "string",
|
|
179
|
+
enum: ["completed", "not_planned", "duplicate", "reopened"],
|
|
180
|
+
description: "Native GitHub state reason. Use completed, not_planned, or duplicate with state=closed; use reopened with state=open."
|
|
181
|
+
},
|
|
182
|
+
duplicateIssueNumber: {
|
|
183
|
+
type: "integer",
|
|
184
|
+
minimum: 1,
|
|
185
|
+
description: "Canonical issue number in the same repository. Required only when stateReason=duplicate."
|
|
186
|
+
},
|
|
173
187
|
setLabels: {
|
|
174
188
|
type: "array",
|
|
175
189
|
items: {
|
|
@@ -272,6 +286,7 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
272
286
|
type: "string",
|
|
273
287
|
description: "Paperclip issue id used to resolve the trusted execution workspace and durable pull-request link."
|
|
274
288
|
},
|
|
289
|
+
followThroughAssigneeAgentId: followThroughAssigneeAgentIdProperty,
|
|
275
290
|
head: {
|
|
276
291
|
type: "string",
|
|
277
292
|
description: "Plain local branch name to publish. Owner-qualified branches and arbitrary refspecs are rejected."
|
|
@@ -635,7 +650,8 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
635
650
|
pullRequestUrl: {
|
|
636
651
|
type: "string",
|
|
637
652
|
description: "Full GitHub pull request URL."
|
|
638
|
-
}
|
|
653
|
+
},
|
|
654
|
+
followThroughAssigneeAgentId: followThroughAssigneeAgentIdProperty
|
|
639
655
|
}
|
|
640
656
|
}
|
|
641
657
|
},
|
|
@@ -675,7 +691,7 @@ var COMPANY_METRIC_API_ROUTE_URL_PATH = `/api/plugins/${GITHUB_SYNC_PLUGIN_ID}/a
|
|
|
675
691
|
var require2 = createRequire(import.meta.url);
|
|
676
692
|
var packageJson = require2("../package.json");
|
|
677
693
|
var SCHEDULE_TICK_CRON = "* * * * *";
|
|
678
|
-
var MANIFEST_VERSION = "0.
|
|
694
|
+
var MANIFEST_VERSION = "0.16.1"?.trim() || typeof packageJson.version === "string" && packageJson.version.trim() || process.env.npm_package_version?.trim() || "0.0.0-dev";
|
|
679
695
|
var manifest = {
|
|
680
696
|
id: GITHUB_SYNC_PLUGIN_ID,
|
|
681
697
|
apiVersion: 1,
|
package/dist/ui/index.js
CHANGED
|
@@ -370,7 +370,7 @@ import {
|
|
|
370
370
|
usePluginToast
|
|
371
371
|
} from "@paperclipai/plugin-sdk/ui";
|
|
372
372
|
|
|
373
|
-
// node_modules/.pnpm/@ungap+structured-clone@1.3.
|
|
373
|
+
// node_modules/.pnpm/@ungap+structured-clone@1.3.3/node_modules/@ungap/structured-clone/esm/types.js
|
|
374
374
|
var VOID = -1;
|
|
375
375
|
var PRIMITIVE = 0;
|
|
376
376
|
var ARRAY = 1;
|
|
@@ -382,7 +382,7 @@ var SET = 6;
|
|
|
382
382
|
var ERROR = 7;
|
|
383
383
|
var BIGINT = 8;
|
|
384
384
|
|
|
385
|
-
// node_modules/.pnpm/@ungap+structured-clone@1.3.
|
|
385
|
+
// node_modules/.pnpm/@ungap+structured-clone@1.3.3/node_modules/@ungap/structured-clone/esm/deserialize.js
|
|
386
386
|
var env = typeof self === "object" ? self : globalThis;
|
|
387
387
|
var guard = (name2, init) => {
|
|
388
388
|
switch (name2) {
|
|
@@ -441,7 +441,10 @@ var deserializer = ($2, _) => {
|
|
|
441
441
|
}
|
|
442
442
|
case ERROR: {
|
|
443
443
|
const { name: name2, message } = value;
|
|
444
|
-
return as(
|
|
444
|
+
return as(
|
|
445
|
+
typeof env[name2] === "function" ? guard(name2, message) : new Error(message),
|
|
446
|
+
index2
|
|
447
|
+
);
|
|
445
448
|
}
|
|
446
449
|
case BIGINT:
|
|
447
450
|
return as(BigInt(value), index2);
|
|
@@ -460,7 +463,7 @@ var deserializer = ($2, _) => {
|
|
|
460
463
|
};
|
|
461
464
|
var deserialize = (serialized) => deserializer(/* @__PURE__ */ new Map(), serialized)(0);
|
|
462
465
|
|
|
463
|
-
// node_modules/.pnpm/@ungap+structured-clone@1.3.
|
|
466
|
+
// node_modules/.pnpm/@ungap+structured-clone@1.3.3/node_modules/@ungap/structured-clone/esm/serialize.js
|
|
464
467
|
var EMPTY = "";
|
|
465
468
|
var { toString } = {};
|
|
466
469
|
var { keys } = Object;
|
|
@@ -487,8 +490,8 @@ var typeOf = (value) => {
|
|
|
487
490
|
}
|
|
488
491
|
if (asString.includes("Array"))
|
|
489
492
|
return [ARRAY, asString];
|
|
490
|
-
if (
|
|
491
|
-
return [ERROR,
|
|
493
|
+
if (value instanceof Error)
|
|
494
|
+
return [ERROR, value.name || "Error"];
|
|
492
495
|
return [OBJECT, asString];
|
|
493
496
|
};
|
|
494
497
|
var shouldSkip = ([TYPE, type]) => TYPE === PRIMITIVE && (type === "function" || type === "symbol");
|
|
@@ -593,7 +596,7 @@ var serialize = (value, { json, lossy } = {}) => {
|
|
|
593
596
|
return serializer(!(json || lossy), !!json, /* @__PURE__ */ new Map(), _)(value), _;
|
|
594
597
|
};
|
|
595
598
|
|
|
596
|
-
// node_modules/.pnpm/@ungap+structured-clone@1.3.
|
|
599
|
+
// node_modules/.pnpm/@ungap+structured-clone@1.3.3/node_modules/@ungap/structured-clone/esm/index.js
|
|
597
600
|
var esm_default = typeof structuredClone === "function" ? (
|
|
598
601
|
/* c8 ignore start */
|
|
599
602
|
(any, options) => options && ("json" in options || "lossy" in options) ? deserialize(serialize(any, options)) : structuredClone(any)
|