patchcord 0.3.83 → 0.3.85
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/.claude-plugin/marketplace.json +13 -0
- package/bin/patchcord.mjs +31 -24
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "patchcord-marketplace",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "ppravdin"
|
|
5
|
+
},
|
|
6
|
+
"plugins": [
|
|
7
|
+
{
|
|
8
|
+
"name": "patchcord",
|
|
9
|
+
"source": "./",
|
|
10
|
+
"description": "Cross-machine agent messaging — connect Claude Code, Codex, Cursor, ChatGPT, and other agents across projects and machines."
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
package/bin/patchcord.mjs
CHANGED
|
@@ -116,11 +116,17 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd === "--token" || cmd ===
|
|
|
116
116
|
const hasClaude = run("which claude");
|
|
117
117
|
if (hasClaude) {
|
|
118
118
|
// Always re-add marketplace (copies fresh files from this npx package)
|
|
119
|
-
// and
|
|
120
|
-
//
|
|
119
|
+
// and install/update plugin. Claude Code's built-in plugin update
|
|
120
|
+
// doesn't detect new versions from local sources (#37252).
|
|
121
121
|
run(`claude plugin marketplace add "${pluginRoot}"`);
|
|
122
|
-
run(`claude plugin
|
|
123
|
-
|
|
122
|
+
const installed = run(`claude plugin list`)?.includes("patchcord");
|
|
123
|
+
if (installed) {
|
|
124
|
+
run(`claude plugin update patchcord@patchcord-marketplace`);
|
|
125
|
+
globalChanges.push("Claude Code plugin updated");
|
|
126
|
+
} else {
|
|
127
|
+
run(`claude plugin install patchcord@patchcord-marketplace`);
|
|
128
|
+
globalChanges.push("Claude Code plugin installed");
|
|
129
|
+
}
|
|
124
130
|
|
|
125
131
|
const claudeSettings = join(HOME, ".claude", "settings.json");
|
|
126
132
|
if (existsSync(claudeSettings)) {
|
|
@@ -385,30 +391,31 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd === "--token" || cmd ===
|
|
|
385
391
|
const rlU = createRLU({ input: process.stdin, output: process.stdout });
|
|
386
392
|
const askU = (q) => new Promise((resolve) => rlU.question(q, resolve));
|
|
387
393
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
if (existingIdentity) {
|
|
392
|
-
identity = existingIdentity;
|
|
393
|
-
const vResp = validateResp ? JSON.parse(validateResp) : {};
|
|
394
|
-
clientType = vResp.client_type || "";
|
|
395
|
-
choice = CLIENT_TYPE_MAP[clientType] || "";
|
|
396
|
-
console.log(` ${green}✓${r} ${bold}${identity}${r} — token valid`);
|
|
397
|
-
} else {
|
|
398
|
-
console.log(` ${yellow}⚠${r} Token expired or invalid. Starting fresh setup.`);
|
|
399
|
-
token = "";
|
|
400
|
-
}
|
|
394
|
+
// Q1: Add another agent? (most likely reason to re-run installer)
|
|
395
|
+
const addAnswer = (await askU(` ${bold}Add another agent to this project? (y/N):${r} `)).trim().toLowerCase();
|
|
396
|
+
if (addAnswer === "y" || addAnswer === "yes") {
|
|
401
397
|
rlU.close();
|
|
398
|
+
// Drop into browser connect flow — fresh setup for new agent
|
|
399
|
+
token = "";
|
|
402
400
|
} else {
|
|
403
|
-
//
|
|
404
|
-
const
|
|
401
|
+
// Q2: Update existing agent?
|
|
402
|
+
const updateAnswer = (await askU(` ${bold}Update ${existingToolName} agent? (y/N):${r} `)).trim().toLowerCase();
|
|
405
403
|
rlU.close();
|
|
406
|
-
if (
|
|
407
|
-
|
|
408
|
-
|
|
404
|
+
if (updateAnswer === "y" || updateAnswer === "yes") {
|
|
405
|
+
token = existingToken;
|
|
406
|
+
if (existingIdentity) {
|
|
407
|
+
identity = existingIdentity;
|
|
408
|
+
const vResp = validateResp ? JSON.parse(validateResp) : {};
|
|
409
|
+
clientType = vResp.client_type || "";
|
|
410
|
+
choice = CLIENT_TYPE_MAP[clientType] || "";
|
|
411
|
+
console.log(` ${green}✓${r} ${bold}${identity}${r} — token valid`);
|
|
412
|
+
} else {
|
|
413
|
+
console.log(` ${yellow}⚠${r} Token expired or invalid. Starting fresh setup.`);
|
|
414
|
+
token = "";
|
|
415
|
+
}
|
|
409
416
|
} else {
|
|
410
|
-
// Both N —
|
|
411
|
-
console.log(`\n ${dim}
|
|
417
|
+
// Both N — skills already updated by global setup, done
|
|
418
|
+
console.log(`\n ${dim}Skills updated.${r}`);
|
|
412
419
|
process.exit(0);
|
|
413
420
|
}
|
|
414
421
|
}
|