paperclip-github-plugin 0.13.0 → 0.14.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 CHANGED
@@ -239,6 +239,14 @@ The plugin exposes GitHub workflow tools to Paperclip agents, including:
239
239
  - review-thread reads, replies, resolve and unresolve actions, and `request_pull_request_reviewers` reviewer requests
240
240
  - organization-level GitHub Project search/listing and pull-request-to-project association
241
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
+
248
+ 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.
249
+
242
250
  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`.
243
251
 
244
252
  ### KPI attribution API route
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: "Open a GitHub pull request once the implementation branch is pushed. When a non-empty body is provided, the plugin appends an AI-authorship footer and includes llmModel when supplied.",
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: "Optional Paperclip issue id to link with the created pull request so GitHub Sync can monitor PR status for that issue."
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: "Head branch name or owner:branch."
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.13.0"?.trim() || typeof packageJson.version === "string" && packageJson.version.trim() || process.env.npm_package_version?.trim() || "0.0.0-dev";
644
+ var MANIFEST_VERSION = "0.14.1"?.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,
@@ -655,7 +660,9 @@ var manifest = {
655
660
  "plugin.state.write",
656
661
  "instance.settings.register",
657
662
  "projects.read",
663
+ "execution.workspaces.read",
658
664
  "issues.read",
665
+ "issues.checkout",
659
666
  "issues.create",
660
667
  "issues.update",
661
668
  "issues.wakeup",
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.1/node_modules/@ungap/structured-clone/esm/types.js
373
+ // node_modules/.pnpm/@ungap+structured-clone@1.3.2/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.1/node_modules/@ungap/structured-clone/esm/deserialize.js
385
+ // node_modules/.pnpm/@ungap+structured-clone@1.3.2/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) {
@@ -460,7 +460,7 @@ var deserializer = ($2, _) => {
460
460
  };
461
461
  var deserialize = (serialized) => deserializer(/* @__PURE__ */ new Map(), serialized)(0);
462
462
 
463
- // node_modules/.pnpm/@ungap+structured-clone@1.3.1/node_modules/@ungap/structured-clone/esm/serialize.js
463
+ // node_modules/.pnpm/@ungap+structured-clone@1.3.2/node_modules/@ungap/structured-clone/esm/serialize.js
464
464
  var EMPTY = "";
465
465
  var { toString } = {};
466
466
  var { keys } = Object;
@@ -559,7 +559,7 @@ var serializer = (strict, json, $2, _) => {
559
559
  return index2;
560
560
  }
561
561
  case DATE:
562
- return as([TYPE, value.toISOString()], value);
562
+ return as([TYPE, isNaN(value.getTime()) ? EMPTY : value.toISOString()], value);
563
563
  case REGEXP: {
564
564
  const { source, flags } = value;
565
565
  return as([TYPE, { source, flags }], value);
@@ -593,7 +593,7 @@ var serialize = (value, { json, lossy } = {}) => {
593
593
  return serializer(!(json || lossy), !!json, /* @__PURE__ */ new Map(), _)(value), _;
594
594
  };
595
595
 
596
- // node_modules/.pnpm/@ungap+structured-clone@1.3.1/node_modules/@ungap/structured-clone/esm/index.js
596
+ // node_modules/.pnpm/@ungap+structured-clone@1.3.2/node_modules/@ungap/structured-clone/esm/index.js
597
597
  var esm_default = typeof structuredClone === "function" ? (
598
598
  /* c8 ignore start */
599
599
  (any, options) => options && ("json" in options || "lossy" in options) ? deserialize(serialize(any, options)) : structuredClone(any)