patchcord 0.3.84 → 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/bin/patchcord.mjs +21 -20
- package/package.json +1 -1
package/bin/patchcord.mjs
CHANGED
|
@@ -391,30 +391,31 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd === "--token" || cmd ===
|
|
|
391
391
|
const rlU = createRLU({ input: process.stdin, output: process.stdout });
|
|
392
392
|
const askU = (q) => new Promise((resolve) => rlU.question(q, resolve));
|
|
393
393
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
if (existingIdentity) {
|
|
398
|
-
identity = existingIdentity;
|
|
399
|
-
const vResp = validateResp ? JSON.parse(validateResp) : {};
|
|
400
|
-
clientType = vResp.client_type || "";
|
|
401
|
-
choice = CLIENT_TYPE_MAP[clientType] || "";
|
|
402
|
-
console.log(` ${green}✓${r} ${bold}${identity}${r} — token valid`);
|
|
403
|
-
} else {
|
|
404
|
-
console.log(` ${yellow}⚠${r} Token expired or invalid. Starting fresh setup.`);
|
|
405
|
-
token = "";
|
|
406
|
-
}
|
|
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") {
|
|
407
397
|
rlU.close();
|
|
398
|
+
// Drop into browser connect flow — fresh setup for new agent
|
|
399
|
+
token = "";
|
|
408
400
|
} else {
|
|
409
|
-
//
|
|
410
|
-
const
|
|
401
|
+
// Q2: Update existing agent?
|
|
402
|
+
const updateAnswer = (await askU(` ${bold}Update ${existingToolName} agent? (y/N):${r} `)).trim().toLowerCase();
|
|
411
403
|
rlU.close();
|
|
412
|
-
if (
|
|
413
|
-
|
|
414
|
-
|
|
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
|
+
}
|
|
415
416
|
} else {
|
|
416
|
-
// Both N —
|
|
417
|
-
console.log(`\n ${dim}
|
|
417
|
+
// Both N — skills already updated by global setup, done
|
|
418
|
+
console.log(`\n ${dim}Skills updated.${r}`);
|
|
418
419
|
process.exit(0);
|
|
419
420
|
}
|
|
420
421
|
}
|