echoclaw-relay-agent 0.5.0 → 0.6.1

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.
@@ -205,7 +205,7 @@ export class RelayAgent extends EventEmitter {
205
205
  async freshPairing(code) {
206
206
  this.setStatus('connecting');
207
207
  // Connect to relay server as agent
208
- const agentUrl = `${this.config.relayServer}/agent/connect`;
208
+ const agentUrl = `${this.config.relayServer}/agent/connect?code=${code}`;
209
209
  this.transport = new RelayTransport({
210
210
  url: agentUrl,
211
211
  reconnect: this.config.reconnect,
@@ -219,7 +219,7 @@ export class RelayAgent extends EventEmitter {
219
219
  this.pairingCode = receivedCode;
220
220
  this.emit('pairing_code', receivedCode);
221
221
  });
222
- const result = await this.pairing.pairAsAgent();
222
+ const result = await this.pairing.pairAsAgent(code);
223
223
  await this.onPaired(result);
224
224
  }
225
225
  async resumeSession(session) {
@@ -188,7 +188,7 @@ export class RelayClient extends EventEmitter {
188
188
  // ── Private ────────────────────────────────────────────────
189
189
  async freshPairing(code) {
190
190
  this.setStatus('connecting');
191
- const clientUrl = `${this.config.relayServer}/client/connect?code=${code}`;
191
+ const clientUrl = `${this.config.relayServer}/client/connect`;
192
192
  this.transport = new RelayTransport({
193
193
  url: clientUrl,
194
194
  reconnect: this.config.reconnect,
package/dist/cli.js CHANGED
File without changes
@@ -5,7 +5,7 @@
5
5
  * Receiver rejects seq regression (anti-replay), allows gaps (network reorder).
6
6
  * IV is always randomly generated (never derived from seq).
7
7
  */
8
- import { encrypt, decrypt, toBase64, fromBase64 } from '@echoclaw/crypto';
8
+ import { encrypt, decrypt, toBase64, fromBase64 } from 'echoclaw-crypto';
9
9
  export class FrameCrypto {
10
10
  constructor(sessionKey) {
11
11
  Object.defineProperty(this, "sessionKey", {
@@ -14,7 +14,7 @@
14
14
  * body size limits, API token injection.
15
15
  */
16
16
  import { EventEmitter } from 'node:events';
17
- import type { TunnelPayload } from '@echoclaw/crypto';
17
+ import type { TunnelPayload } from 'echoclaw-crypto';
18
18
  import type { BridgeEndpoint } from './types.js';
19
19
  export declare class GatewayBridge extends EventEmitter {
20
20
  private readonly activeRequests;
@@ -9,7 +9,7 @@
9
9
  * - onReconnected(sendFn): reattach callbacks, resume heartbeats
10
10
  */
11
11
  import { EventEmitter } from 'node:events';
12
- import type { TunnelPayload } from '@echoclaw/crypto';
12
+ import type { TunnelPayload } from 'echoclaw-crypto';
13
13
  import type { GatewayConfig, BridgeStatus, DeviceInfo } from './types.js';
14
14
  export declare class GatewayManager extends EventEmitter {
15
15
  private readonly config;
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * Key design: Ack + Heartbeat + Push async model for long-running AI tasks.
8
8
  */
9
- import type { TunnelPayload } from '@echoclaw/crypto';
9
+ import type { TunnelPayload } from 'echoclaw-crypto';
10
10
  export interface GatewayConfig {
11
11
  /** Enable the gateway layer. When false, RelayAgent behaves as V1. */
12
12
  enabled: boolean;
@@ -31,7 +31,7 @@ export declare class PairingProtocol extends EventEmitter {
31
31
  * Agent-side pairing: register with relay, wait for client to pair.
32
32
  * Returns the E2E session key once pairing is complete.
33
33
  */
34
- pairAsAgent(): Promise<PairingResult>;
34
+ pairAsAgent(inputCode?: string): Promise<PairingResult>;
35
35
  /**
36
36
  * Client-side pairing: connect with pairing code, exchange keys with agent.
37
37
  * Returns the E2E session key.
@@ -17,7 +17,7 @@
17
17
  * Pairing code is mixed into HKDF salt for MITM protection.
18
18
  */
19
19
  import { EventEmitter } from 'node:events';
20
- import { generateKeyPair, completeHandshake, toBase64, fromBase64, } from '@echoclaw/crypto';
20
+ import { generateKeyPair, completeHandshake, toBase64, fromBase64, } from 'echoclaw-crypto';
21
21
  export class PairingProtocol extends EventEmitter {
22
22
  constructor(transport) {
23
23
  super();
@@ -38,11 +38,11 @@ export class PairingProtocol extends EventEmitter {
38
38
  * Agent-side pairing: register with relay, wait for client to pair.
39
39
  * Returns the E2E session key once pairing is complete.
40
40
  */
41
- async pairAsAgent() {
41
+ async pairAsAgent(inputCode) {
42
42
  this.keyPair = await generateKeyPair();
43
43
  return new Promise((resolve, reject) => {
44
44
  let sessionId = '';
45
- let pairingCode = '';
45
+ let pairingCode = inputCode || '';
46
46
  let resolved = false;
47
47
  const timeout = setTimeout(() => {
48
48
  if (!resolved) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "echoclaw-relay-agent",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "EchoClaw Relay Connection — E2E encrypted relay transport, pairing, and session management",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -14,18 +14,20 @@
14
14
  "bin": {
15
15
  "echoclaw-relay": "./dist/cli.js"
16
16
  },
17
- "files": ["dist"],
18
- "scripts": {
19
- "build": "tsc",
20
- "dev": "tsx src/cli.ts"
21
- },
17
+ "files": [
18
+ "dist"
19
+ ],
22
20
  "dependencies": {
23
- "@echoclaw/crypto": "npm:echoclaw-crypto@^0.1.0",
24
- "ws": "^8.18.0"
21
+ "ws": "^8.18.0",
22
+ "echoclaw-crypto": "0.2.0"
25
23
  },
26
24
  "devDependencies": {
27
25
  "@types/ws": "^8.5.10",
28
26
  "tsx": "^4.7.0",
29
27
  "typescript": "^5.7.0"
28
+ },
29
+ "scripts": {
30
+ "build": "tsc",
31
+ "dev": "tsx src/cli.ts"
30
32
  }
31
- }
33
+ }