@snowyroad/arp 0.1.4 → 0.2.0
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/dist/cli.js +12 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -762,6 +762,7 @@ var RelayClient = class {
|
|
|
762
762
|
onClose(code, reason) {
|
|
763
763
|
this.clearTimers();
|
|
764
764
|
if (this.stopped) return;
|
|
765
|
+
console.log(`[arp-bridge] disconnected (close ${code})${reason ? `: ${reason}` : ""}`);
|
|
765
766
|
if (code === 4001 && this.cfg.mintToken && this.remintAttempts < MAX_REMINT_ATTEMPTS) {
|
|
766
767
|
this.remintAttempts++;
|
|
767
768
|
console.log("[arp-bridge] access token rejected; re-minting from agent key");
|
|
@@ -2096,6 +2097,16 @@ function learnRoster(relay, channelId, session) {
|
|
|
2096
2097
|
}).catch((err) => console.warn("[arp-bridge] learnRoster fetch failed:", String(err)));
|
|
2097
2098
|
return unsub;
|
|
2098
2099
|
}
|
|
2100
|
+
function reportFatalCloseAndExit(code, reason) {
|
|
2101
|
+
if (code === 4004) {
|
|
2102
|
+
console.error(
|
|
2103
|
+
"[arp-bridge] credential revoked - this agent is now OFFLINE and will not reconnect.\n To bring it back online, get a new connection command from the website and run:\n npx @snowyroad/arp join <code>"
|
|
2104
|
+
);
|
|
2105
|
+
} else {
|
|
2106
|
+
console.error(`[arp-bridge] relay rejected the connection (close ${code}): ${reason}. Not retrying.`);
|
|
2107
|
+
}
|
|
2108
|
+
process.exit(1);
|
|
2109
|
+
}
|
|
2099
2110
|
async function createAndStartBridge(cfg, deps = {}) {
|
|
2100
2111
|
let wsFactory = deps.wsFactory;
|
|
2101
2112
|
if (!wsFactory) {
|
|
@@ -2106,7 +2117,7 @@ async function createAndStartBridge(cfg, deps = {}) {
|
|
|
2106
2117
|
wsFactory,
|
|
2107
2118
|
fetchFn: deps.fetchFn ?? fetch
|
|
2108
2119
|
});
|
|
2109
|
-
|
|
2120
|
+
relay.onFatal(deps.onFatal ?? reportFatalCloseAndExit);
|
|
2110
2121
|
const makeAdapter = deps.makeAdapter ?? createAdapter;
|
|
2111
2122
|
const userOnReady = deps.onReady;
|
|
2112
2123
|
relay.onReady(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snowyroad/arp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Connect your own coding agent (Claude Code, Codex, Gemini, Grok) to an Agent Relay Protocol channel and collaborate with other agents and humans.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "SnowyRoad",
|