@phenx-inc/ctlsurf 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/out/main/index.js
CHANGED
|
@@ -9953,11 +9953,9 @@ class WorkerWsClient {
|
|
|
9953
9953
|
workerId = null;
|
|
9954
9954
|
_status = "disconnected";
|
|
9955
9955
|
shouldReconnect = false;
|
|
9956
|
-
fingerprint;
|
|
9957
9956
|
constructor(events, baseUrl) {
|
|
9958
9957
|
this.events = events;
|
|
9959
9958
|
this.baseUrl = baseUrl || "wss://app.ctlsurf.com";
|
|
9960
|
-
this.fingerprint = this.generateFingerprint();
|
|
9961
9959
|
}
|
|
9962
9960
|
get status() {
|
|
9963
9961
|
return this._status;
|
|
@@ -9971,8 +9969,12 @@ class WorkerWsClient {
|
|
|
9971
9969
|
setBaseUrl(url) {
|
|
9972
9970
|
this.baseUrl = url;
|
|
9973
9971
|
}
|
|
9974
|
-
|
|
9975
|
-
|
|
9972
|
+
// Per-directory fingerprint: each working directory is a distinct worker, so
|
|
9973
|
+
// multiple instances on the same machine (one per project) don't collide as a
|
|
9974
|
+
// single worker server-side. cwd is included so the same folder maps to the
|
|
9975
|
+
// same worker across restarts.
|
|
9976
|
+
generateFingerprint(cwd) {
|
|
9977
|
+
const data = `${os.hostname()}:${os.userInfo().username}:${os.platform()}:${os.arch()}:${cwd}`;
|
|
9976
9978
|
return require$$1.createHash("sha256").update(data).digest("hex").slice(0, 32);
|
|
9977
9979
|
}
|
|
9978
9980
|
setStatus(status) {
|
|
@@ -9982,7 +9984,8 @@ class WorkerWsClient {
|
|
|
9982
9984
|
}
|
|
9983
9985
|
}
|
|
9984
9986
|
connect(registration) {
|
|
9985
|
-
|
|
9987
|
+
const fingerprint = this.generateFingerprint(registration.cwd);
|
|
9988
|
+
this.registration = { ...registration, fingerprint };
|
|
9986
9989
|
this.shouldReconnect = true;
|
|
9987
9990
|
this.doConnect();
|
|
9988
9991
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phenx-inc/ctlsurf",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.16",
|
|
4
4
|
"description": "Agent-agnostic terminal and desktop app for ctlsurf — run Claude Code, Codex, or any coding agent with live session logging and remote control",
|
|
5
5
|
"main": "out/main/index.js",
|
|
6
6
|
"bin": {
|
package/src/main/workerWs.ts
CHANGED
|
@@ -47,13 +47,10 @@ export class WorkerWsClient {
|
|
|
47
47
|
private workerId: string | null = null
|
|
48
48
|
private _status: WorkerWsStatus = 'disconnected'
|
|
49
49
|
private shouldReconnect = false
|
|
50
|
-
private fingerprint: string
|
|
51
50
|
|
|
52
51
|
constructor(events: WorkerWsEvents, baseUrl?: string) {
|
|
53
52
|
this.events = events
|
|
54
53
|
this.baseUrl = baseUrl || 'wss://app.ctlsurf.com'
|
|
55
|
-
// Generate a stable machine fingerprint
|
|
56
|
-
this.fingerprint = this.generateFingerprint()
|
|
57
54
|
}
|
|
58
55
|
|
|
59
56
|
get status(): WorkerWsStatus {
|
|
@@ -72,8 +69,12 @@ export class WorkerWsClient {
|
|
|
72
69
|
this.baseUrl = url
|
|
73
70
|
}
|
|
74
71
|
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
// Per-directory fingerprint: each working directory is a distinct worker, so
|
|
73
|
+
// multiple instances on the same machine (one per project) don't collide as a
|
|
74
|
+
// single worker server-side. cwd is included so the same folder maps to the
|
|
75
|
+
// same worker across restarts.
|
|
76
|
+
private generateFingerprint(cwd: string): string {
|
|
77
|
+
const data = `${os.hostname()}:${os.userInfo().username}:${os.platform()}:${os.arch()}:${cwd}`
|
|
77
78
|
return crypto.createHash('sha256').update(data).digest('hex').slice(0, 32)
|
|
78
79
|
}
|
|
79
80
|
|
|
@@ -85,7 +86,8 @@ export class WorkerWsClient {
|
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
connect(registration: WorkerRegistration): void {
|
|
88
|
-
|
|
89
|
+
const fingerprint = this.generateFingerprint(registration.cwd)
|
|
90
|
+
this.registration = { ...registration, fingerprint }
|
|
89
91
|
this.shouldReconnect = true
|
|
90
92
|
this.doConnect()
|
|
91
93
|
}
|