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.
@@ -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.15",
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
- const token = (await ask("\nPaste your agent token: ")).trim();
166
+ let token = "";
167
+ let identity = "";
168
+ let serverUrl = "https://mcp.patchcord.dev";
167
169
 
168
- if (!token) {
169
- console.error("Token is required. Get one from your patchcord dashboard.");
170
- rl.close();
171
- process.exit(1);
172
- }
170
+ while (!identity) {
171
+ token = (await ask("\nPaste your agent token: ")).trim();
173
172
 
174
- // Validate token
175
- let serverUrl = "https://mcp.patchcord.dev";
176
- console.log("\nValidating token...");
177
- const validateResp = run(`curl -sf --max-time 5 -H "Authorization: Bearer ${token}" "${serverUrl}/api/inbox?limit=0"`);
178
- let identity = "";
179
- if (validateResp) {
180
- try {
181
- const data = JSON.parse(validateResp);
182
- identity = `${data.agent_id}@${data.namespace_id}`;
183
- console.log(` ✓ ${identity}`);
184
- } catch {}
185
- }
186
- if (!identity) {
187
- console.log(" ✗ Could not validate token against mcp.patchcord.dev");
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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchcord",
3
- "version": "0.3.15",
3
+ "version": "0.3.16",
4
4
  "description": "Cross-machine agent messaging for Claude Code and Codex",
5
5
  "author": "ppravdin",
6
6
  "license": "MIT",