@vibecook/ghosttea-electron 0.4.0 → 0.5.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/bridge-entry.js +3 -3
- package/dist/bridge-socket.js +5 -5
- package/dist/bridge.js +1 -1
- package/package.json +6 -6
package/dist/bridge-entry.js
CHANGED
|
@@ -37,7 +37,7 @@ async function attachRenderer(rawData, ports) {
|
|
|
37
37
|
controlPort.postMessage({
|
|
38
38
|
requestId: 0,
|
|
39
39
|
type: "bridge-error",
|
|
40
|
-
message: `Invalid
|
|
40
|
+
message: `Invalid ghosttead response: ${error.message}`,
|
|
41
41
|
});
|
|
42
42
|
controlSocket?.destroy();
|
|
43
43
|
}
|
|
@@ -64,7 +64,7 @@ async function attachRenderer(rawData, ports) {
|
|
|
64
64
|
if (!message ||
|
|
65
65
|
typeof message !== "object" ||
|
|
66
66
|
!["subscription-ack", "frame-gap"].includes(String(message.type))) {
|
|
67
|
-
throw new Error("
|
|
67
|
+
throw new Error("ghosttead sent an invalid frame-channel message");
|
|
68
68
|
}
|
|
69
69
|
framePort.postMessage(message);
|
|
70
70
|
}
|
|
@@ -114,7 +114,7 @@ async function attachRenderer(rawData, ports) {
|
|
|
114
114
|
if (capabilities) {
|
|
115
115
|
// Announce support before forwarding the subscription. MessagePort
|
|
116
116
|
// ordering then guarantees that the renderer knows credits are active
|
|
117
|
-
// before
|
|
117
|
+
// before ghosttead can deliver the subscription's first frame.
|
|
118
118
|
framePort.postMessage(capabilities);
|
|
119
119
|
frameFlowEnabled = true;
|
|
120
120
|
}
|
package/dist/bridge-socket.js
CHANGED
|
@@ -19,7 +19,7 @@ export async function connectSocket(path, token, limit, onPacket, onDisconnect,
|
|
|
19
19
|
return;
|
|
20
20
|
settled = true;
|
|
21
21
|
socket.destroy();
|
|
22
|
-
reject(new Error(`
|
|
22
|
+
reject(new Error(`ghosttead connection timed out during authentication at ${path}`));
|
|
23
23
|
}, Math.max(0, deadline - Date.now()));
|
|
24
24
|
socket.on("error", (error) => {
|
|
25
25
|
if (!settled) {
|
|
@@ -36,10 +36,10 @@ export async function connectSocket(path, token, limit, onPacket, onDisconnect,
|
|
|
36
36
|
if (!settled) {
|
|
37
37
|
settled = true;
|
|
38
38
|
clearTimeout(timeout);
|
|
39
|
-
reject(new Error(`
|
|
39
|
+
reject(new Error(`ghosttead connection closed during authentication at ${path}`));
|
|
40
40
|
}
|
|
41
41
|
else if (authenticated) {
|
|
42
|
-
onDisconnect(new Error(`
|
|
42
|
+
onDisconnect(new Error(`ghosttead connection closed at ${path}`));
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
// `openEndpoint` resolves only once connected, so authenticate now.
|
|
@@ -52,7 +52,7 @@ export async function connectSocket(path, token, limit, onPacket, onDisconnect,
|
|
|
52
52
|
while (buffered.length >= 4) {
|
|
53
53
|
const length = buffered.readUInt32LE(0);
|
|
54
54
|
if (length > limit) {
|
|
55
|
-
socket.destroy(new Error("
|
|
55
|
+
socket.destroy(new Error("ghosttead packet exceeds bridge quota"));
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
58
|
if (buffered.length < 4 + length)
|
|
@@ -64,7 +64,7 @@ export async function connectSocket(path, token, limit, onPacket, onDisconnect,
|
|
|
64
64
|
settled = true;
|
|
65
65
|
clearTimeout(timeout);
|
|
66
66
|
socket.destroy();
|
|
67
|
-
reject(new Error("
|
|
67
|
+
reject(new Error("ghosttead authentication failed"));
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
70
|
authenticated = true;
|
package/dist/bridge.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibecook/ghosttea-electron",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Electron lifecycle and direct renderer transport for Ghosttea.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "James Yong",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
],
|
|
41
41
|
"repository": {
|
|
42
42
|
"type": "git",
|
|
43
|
-
"url": "git+https://github.com/
|
|
44
|
-
"directory": "packages/
|
|
43
|
+
"url": "git+https://github.com/vibecook-dev/ghosttea.git",
|
|
44
|
+
"directory": "packages/ghosttea-electron"
|
|
45
45
|
},
|
|
46
|
-
"homepage": "https://github.com/
|
|
46
|
+
"homepage": "https://github.com/vibecook-dev/ghosttea#readme",
|
|
47
47
|
"bugs": {
|
|
48
|
-
"url": "https://github.com/
|
|
48
|
+
"url": "https://github.com/vibecook-dev/ghosttea/issues"
|
|
49
49
|
},
|
|
50
50
|
"keywords": [
|
|
51
51
|
"electron",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"prepublishOnly": "npm run build"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@vibecook/ghosttea-client": "0.
|
|
67
|
+
"@vibecook/ghosttea-client": "0.5.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"electron": ">=35"
|