patchcord 0.3.15 → 0.3.16
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/plugin.json +1 -1
- package/bin/patchcord.mjs +28 -20
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "patchcord",
|
|
3
3
|
"description": "Cross-machine agent messaging with auto-inbox checking. Agents automatically respond to messages from other agents without human intervention.",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.16",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "ppravdin"
|
|
7
7
|
},
|
package/bin/patchcord.mjs
CHANGED
|
@@ -163,28 +163,36 @@ if (cmd === "agent") {
|
|
|
163
163
|
process.exit(1);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
|
|
166
|
+
let token = "";
|
|
167
|
+
let identity = "";
|
|
168
|
+
let serverUrl = "https://mcp.patchcord.dev";
|
|
167
169
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
rl.close();
|
|
171
|
-
process.exit(1);
|
|
172
|
-
}
|
|
170
|
+
while (!identity) {
|
|
171
|
+
token = (await ask("\nPaste your agent token: ")).trim();
|
|
173
172
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
173
|
+
if (!token) {
|
|
174
|
+
console.error("Token is required. Get one from your patchcord dashboard.");
|
|
175
|
+
rl.close();
|
|
176
|
+
process.exit(1);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
console.log("Validating...");
|
|
180
|
+
const validateResp = run(`curl -sf --max-time 5 -H "Authorization: Bearer ${token}" "${serverUrl}/api/inbox?limit=0"`);
|
|
181
|
+
if (validateResp) {
|
|
182
|
+
try {
|
|
183
|
+
const data = JSON.parse(validateResp);
|
|
184
|
+
identity = `${data.agent_id}@${data.namespace_id}`;
|
|
185
|
+
console.log(` ✓ ${identity}`);
|
|
186
|
+
} catch {}
|
|
187
|
+
}
|
|
188
|
+
if (!identity) {
|
|
189
|
+
console.log(" ✗ Token not recognized");
|
|
190
|
+
const retry = (await ask("Try again? (Y/n): ")).trim().toLowerCase();
|
|
191
|
+
if (retry === "n" || retry === "no") {
|
|
192
|
+
rl.close();
|
|
193
|
+
process.exit(1);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
188
196
|
}
|
|
189
197
|
|
|
190
198
|
const customUrl = (await ask("\nCustom server URL? (y/N): ")).trim().toLowerCase();
|