paperclip-github-plugin 0.3.0 → 0.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
@@ -435,7 +435,7 @@ var require2 = createRequire(import.meta.url);
435
435
  var packageJson = require2("../package.json");
436
436
  var DASHBOARD_WIDGET_CAPABILITY = "ui.dashboardWidget.register";
437
437
  var SCHEDULE_TICK_CRON = "* * * * *";
438
- var MANIFEST_VERSION = "0.3.0"?.trim() || typeof packageJson.version === "string" && packageJson.version.trim() || process.env.npm_package_version?.trim() || "0.0.0-dev";
438
+ var MANIFEST_VERSION = "0.3.1"?.trim() || typeof packageJson.version === "string" && packageJson.version.trim() || process.env.npm_package_version?.trim() || "0.0.0-dev";
439
439
  var manifest = {
440
440
  id: "paperclip-github-plugin",
441
441
  apiVersion: 1,
package/dist/worker.js CHANGED
@@ -1,11 +1,13 @@
1
1
  // src/worker.ts
2
+ import { realpathSync } from "node:fs";
2
3
  import { readFile } from "node:fs/promises";
3
4
  import { homedir } from "node:os";
4
- import { join } from "node:path";
5
+ import { join, resolve } from "node:path";
6
+ import { fileURLToPath } from "node:url";
5
7
  import { Octokit } from "@octokit/rest";
6
8
  import {
7
9
  definePlugin,
8
- runWorker
10
+ startWorkerRpcHost
9
11
  } from "@paperclipai/plugin-sdk";
10
12
 
11
13
  // src/github-agent-tools.ts
@@ -2625,8 +2627,8 @@ async function waitForSyncResultWithinGracePeriod(promise, timeoutMs) {
2625
2627
  try {
2626
2628
  return await Promise.race([
2627
2629
  promise,
2628
- new Promise((resolve) => {
2629
- timer = globalThis.setTimeout(() => resolve(null), timeoutMs);
2630
+ new Promise((resolve2) => {
2631
+ timer = globalThis.setTimeout(() => resolve2(null), timeoutMs);
2630
2632
  })
2631
2633
  ]);
2632
2634
  } finally {
@@ -9917,6 +9919,17 @@ function registerGitHubAgentTools(ctx) {
9917
9919
  })
9918
9920
  );
9919
9921
  }
9922
+ function shouldStartWorkerHost(moduleUrl, entry = process.argv[1]) {
9923
+ if (typeof entry !== "string" || !entry.trim()) {
9924
+ return false;
9925
+ }
9926
+ const modulePath = fileURLToPath(moduleUrl);
9927
+ try {
9928
+ return realpathSync(entry) === realpathSync(modulePath);
9929
+ } catch {
9930
+ return resolve(entry) === resolve(modulePath);
9931
+ }
9932
+ }
9920
9933
  var plugin = definePlugin({
9921
9934
  async setup(ctx) {
9922
9935
  ctx.data.register("settings.registration", async (input) => {
@@ -10190,7 +10203,10 @@ var plugin = definePlugin({
10190
10203
  }
10191
10204
  });
10192
10205
  var worker_default = plugin;
10193
- runWorker(plugin, import.meta.url);
10206
+ if (shouldStartWorkerHost(import.meta.url)) {
10207
+ startWorkerRpcHost({ plugin });
10208
+ }
10194
10209
  export {
10195
- worker_default as default
10210
+ worker_default as default,
10211
+ shouldStartWorkerHost
10196
10212
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paperclip-github-plugin",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Paperclip plugin for synchronizing GitHub issues into Paperclip projects.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",