patchcord 0.5.46 → 0.5.48
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/bin/patchcord.mjs +26 -0
- package/package.json +1 -1
- package/skills/subscribe/SKILL.md +1 -1
package/bin/patchcord.mjs
CHANGED
|
@@ -383,8 +383,34 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
|
|
|
383
383
|
} catch {}
|
|
384
384
|
}
|
|
385
385
|
|
|
386
|
+
// ── Install patchcord as a global CLI tool ───────────────────
|
|
387
|
+
// Avoids relying on `npx patchcord subscribe` which is subject to npx
|
|
388
|
+
// caching and supply-chain-protection min-release-age policies that
|
|
389
|
+
// silently downgrade to older cached versions.
|
|
390
|
+
// If npm install -g fails (e.g. system npm requires sudo), fall back to
|
|
391
|
+
// copying the package to a stable local path and writing a wrapper there.
|
|
392
|
+
// The fallback MUST NOT point to the npx cache — that gets swept on each install.
|
|
393
|
+
let globalCliInstalled = false;
|
|
394
|
+
try {
|
|
395
|
+
execSync(`npm install -g patchcord@${currentVersion}`, { stdio: "pipe" });
|
|
396
|
+
globalCliInstalled = true;
|
|
397
|
+
} catch {
|
|
398
|
+
try {
|
|
399
|
+
const stableDir = join(HOME, ".local", "share", "patchcord");
|
|
400
|
+
mkdirSync(stableDir, { recursive: true });
|
|
401
|
+
cpSync(pluginRoot, stableDir, { recursive: true, force: true });
|
|
402
|
+
const localBin = join(HOME, ".local", "bin");
|
|
403
|
+
mkdirSync(localBin, { recursive: true });
|
|
404
|
+
const wrapper = join(localBin, "patchcord");
|
|
405
|
+
writeFileSync(wrapper, `#!/bin/sh\nexec node "${join(stableDir, "bin", "patchcord.mjs")}" "$@"\n`);
|
|
406
|
+
chmodSync(wrapper, 0o755);
|
|
407
|
+
globalCliInstalled = true;
|
|
408
|
+
} catch {}
|
|
409
|
+
}
|
|
410
|
+
|
|
386
411
|
// ── Global setup (silent if nothing changed) ──
|
|
387
412
|
let globalChanges = [];
|
|
413
|
+
if (globalCliInstalled) globalChanges.push("Patchcord CLI installed globally");
|
|
388
414
|
|
|
389
415
|
// Claude Code
|
|
390
416
|
const hasClaude = run("which claude");
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@ User invoked /patchcord:subscribe — do NOT substitute `wait_for_message()`. Sp
|
|
|
20
20
|
description: "patchcord realtime listener",
|
|
21
21
|
persistent: true,
|
|
22
22
|
timeout_ms: 3600000,
|
|
23
|
-
command: "exec
|
|
23
|
+
command: "exec patchcord subscribe"
|
|
24
24
|
)
|
|
25
25
|
```
|
|
26
26
|
|