@rethinkingstudio/clawpilot 1.1.15-internal.1 → 1.1.15-internal.2

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 +1 @@
1
- export declare const DEFAULT_RELAY_SERVER = "http://clawpilot-pre.codeaddict.cn";
1
+ export declare const DEFAULT_RELAY_SERVER = "https://clawpilot-pre.codeaddict.cn";
@@ -1,2 +1,2 @@
1
- export const DEFAULT_RELAY_SERVER = "http://clawpilot-pre.codeaddict.cn";
1
+ export const DEFAULT_RELAY_SERVER = "https://clawpilot-pre.codeaddict.cn";
2
2
  //# sourceMappingURL=build-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-config.js","sourceRoot":"","sources":["../../src/generated/build-config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,oCAAoC,CAAC"}
1
+ {"version":3,"file":"build-config.js","sourceRoot":"","sources":["../../src/generated/build-config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,qCAAqC,CAAC"}
package/dist/index.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rethinkingstudio/clawpilot",
3
- "version": "1.1.15-internal.1",
3
+ "version": "1.1.15-internal.2",
4
4
  "description": "ClawAI relay client for Mac mini",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,7 +10,7 @@
10
10
  "build:config": "node ./scripts/write-build-config.mjs",
11
11
  "build": "npm run build:config && tsc",
12
12
  "build:prod": "npm run build",
13
- "build:internal": "CLAWPILOT_DEFAULT_RELAY_SERVER=http://clawpilot-pre.codeaddict.cn npm run build",
13
+ "build:internal": "CLAWPILOT_DEFAULT_RELAY_SERVER=https://clawpilot-pre.codeaddict.cn npm run build",
14
14
  "dev": "tsx src/index.ts",
15
15
  "start": "node dist/index.js"
16
16
  },
@@ -1 +1 @@
1
- export const DEFAULT_RELAY_SERVER = "http://clawpilot-pre.codeaddict.cn";
1
+ export const DEFAULT_RELAY_SERVER = "https://clawpilot-pre.codeaddict.cn";
@@ -1,18 +0,0 @@
1
- import { WebSocket } from "ws";
2
- /**
3
- * Proxies WebSocket frames between the relay server (via relayWs) and the
4
- * local OpenClaw Gateway (via a new direct WebSocket connection).
5
- *
6
- * All frames are forwarded as raw bytes — no parsing of OpenClaw protocol.
7
- */
8
- export declare class SessionProxy {
9
- private readonly sessionId;
10
- private readonly relayWs;
11
- private readonly gatewayUrl;
12
- private gwWs;
13
- private closed;
14
- constructor(sessionId: string, relayWs: WebSocket, gatewayUrl: string);
15
- start(): Promise<void>;
16
- forwardToGateway(base64Data: string): void;
17
- close(): void;
18
- }
@@ -1,75 +0,0 @@
1
- import { WebSocket } from "ws";
2
- /**
3
- * Proxies WebSocket frames between the relay server (via relayWs) and the
4
- * local OpenClaw Gateway (via a new direct WebSocket connection).
5
- *
6
- * All frames are forwarded as raw bytes — no parsing of OpenClaw protocol.
7
- */
8
- export class SessionProxy {
9
- sessionId;
10
- relayWs;
11
- gatewayUrl;
12
- gwWs = null;
13
- closed = false;
14
- constructor(sessionId, relayWs, gatewayUrl) {
15
- this.sessionId = sessionId;
16
- this.relayWs = relayWs;
17
- this.gatewayUrl = gatewayUrl;
18
- }
19
- async start() {
20
- return new Promise((resolve, reject) => {
21
- const gw = new WebSocket(this.gatewayUrl);
22
- this.gwWs = gw;
23
- const timeout = setTimeout(() => {
24
- gw.terminate();
25
- reject(new Error(`Timeout connecting to gateway at ${this.gatewayUrl}`));
26
- }, 10_000);
27
- gw.on("open", () => {
28
- clearTimeout(timeout);
29
- resolve();
30
- });
31
- gw.on("error", (err) => {
32
- clearTimeout(timeout);
33
- if (!this.closed)
34
- reject(err);
35
- });
36
- // Gateway → relay server
37
- gw.on("message", (raw) => {
38
- if (this.relayWs.readyState !== WebSocket.OPEN)
39
- return;
40
- const data = raw instanceof Buffer ? raw : Buffer.from(raw);
41
- const msg = {
42
- ctrl: "DATA",
43
- sessionId: this.sessionId,
44
- data: data.toString("base64"),
45
- };
46
- this.relayWs.send(JSON.stringify(msg));
47
- });
48
- gw.on("close", () => {
49
- if (!this.closed) {
50
- this.closed = true;
51
- // Notify relay server that session is done
52
- if (this.relayWs.readyState === WebSocket.OPEN) {
53
- const msg = {
54
- ctrl: "SESSION_CLOSE",
55
- sessionId: this.sessionId,
56
- };
57
- this.relayWs.send(JSON.stringify(msg));
58
- }
59
- }
60
- });
61
- });
62
- }
63
- // Called when DATA arrives from the relay server for this session
64
- forwardToGateway(base64Data) {
65
- if (!this.gwWs || this.gwWs.readyState !== WebSocket.OPEN)
66
- return;
67
- const buf = Buffer.from(base64Data, "base64");
68
- this.gwWs.send(buf);
69
- }
70
- close() {
71
- this.closed = true;
72
- this.gwWs?.close();
73
- }
74
- }
75
- //# sourceMappingURL=session-proxy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"session-proxy.js","sourceRoot":"","sources":["../../src/relay/session-proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAa/B;;;;;GAKG;AACH,MAAM,OAAO,YAAY;IAKJ;IACA;IACA;IANX,IAAI,GAAqB,IAAI,CAAC;IAC9B,MAAM,GAAG,KAAK,CAAC;IAEvB,YACmB,SAAiB,EACjB,OAAkB,EAClB,UAAkB;QAFlB,cAAS,GAAT,SAAS,CAAQ;QACjB,YAAO,GAAP,OAAO,CAAW;QAClB,eAAU,GAAV,UAAU,CAAQ;IAClC,CAAC;IAEJ,KAAK,CAAC,KAAK;QACT,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,EAAE,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC1C,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;YAEf,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;gBAC9B,EAAE,CAAC,SAAS,EAAE,CAAC;gB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