@claxedo/workspace-relay 0.5.2 → 0.7.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/bun.d.ts +31 -0
- package/dist/cloudflare.d.ts +98 -0
- package/dist/index.mjs +309 -39
- package/dist/main.d.ts +47 -27
- package/dist/main.mjs +19692 -39183
- package/dist/worker.d.ts +12 -0
- package/dist/workerd-fixture/binary-frame-worker.d.ts +33 -0
- package/package.json +13 -6
package/dist/worker.d.ts
CHANGED
|
@@ -40,11 +40,23 @@ export declare class WorkspaceRelayRoom {
|
|
|
40
40
|
private loading?;
|
|
41
41
|
constructor(state: unknown, env: WorkspaceRelayWorkerEnv);
|
|
42
42
|
private hibernation;
|
|
43
|
+
/**
|
|
44
|
+
* The DO alarm surface, used for the hibernation-safe revocation re-check.
|
|
45
|
+
* Alarms are the only periodic mechanism that survives hibernation, so this is
|
|
46
|
+
* what enforces revocation on an idle hibernated connection.
|
|
47
|
+
*/
|
|
48
|
+
private alarms;
|
|
43
49
|
private loadRoom;
|
|
44
50
|
fetch(request: Request): Promise<Response>;
|
|
45
51
|
webSocketMessage(socket: WorkspaceRelayDurableObjectSocket, message: string | ArrayBuffer): Promise<void>;
|
|
46
52
|
webSocketClose(socket: WorkspaceRelayDurableObjectSocket, code: number, reason: string, wasClean: boolean): Promise<void>;
|
|
47
53
|
webSocketError(socket: WorkspaceRelayDurableObjectSocket, error: unknown): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Forwarded so the room's hibernation-safe revocation sweep actually runs. The
|
|
56
|
+
* DO has ONE alarm slot; the room only ever moves it earlier and never clears
|
|
57
|
+
* it, so adding another alarm user here stays safe.
|
|
58
|
+
*/
|
|
59
|
+
alarm(): Promise<void>;
|
|
48
60
|
}
|
|
49
61
|
declare const _default: {
|
|
50
62
|
fetch(request: Request, env: WorkspaceRelayWorkerEnv): Promise<Response>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
type FixtureSocket = {
|
|
2
|
+
accept: () => void;
|
|
3
|
+
send: (message: string | ArrayBuffer | Uint8Array) => void;
|
|
4
|
+
close: (code?: number, reason?: string) => void;
|
|
5
|
+
binaryType?: string;
|
|
6
|
+
addEventListener: (type: "message" | "close" | "error", listener: (event: {
|
|
7
|
+
data?: unknown;
|
|
8
|
+
}) => void) => void;
|
|
9
|
+
};
|
|
10
|
+
type FixtureState = {
|
|
11
|
+
acceptWebSocket: (socket: FixtureSocket) => void;
|
|
12
|
+
};
|
|
13
|
+
type FixtureNamespace = {
|
|
14
|
+
idFromName: (name: string) => unknown;
|
|
15
|
+
get: (id: unknown) => {
|
|
16
|
+
fetch: (request: Request) => Promise<Response>;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare class BinaryFrameRoom {
|
|
20
|
+
private state;
|
|
21
|
+
constructor(state: FixtureState);
|
|
22
|
+
fetch(request: Request): Promise<Response>;
|
|
23
|
+
/** Hibernation delivery path — survives eviction, so no listener exists. */
|
|
24
|
+
webSocketMessage(socket: FixtureSocket, message: unknown): Promise<void>;
|
|
25
|
+
webSocketClose(): Promise<void>;
|
|
26
|
+
private report;
|
|
27
|
+
}
|
|
28
|
+
declare const _default: {
|
|
29
|
+
fetch(request: Request, env: {
|
|
30
|
+
ROOM: FixtureNamespace;
|
|
31
|
+
}): Promise<Response>;
|
|
32
|
+
};
|
|
33
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claxedo/workspace-relay",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Relay/tunnel server that routes authenticated traffic to workspace runtimes: JWT workspace tokens, header-stripping trust boundary, Bun and Cloudflare adapters",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,20 +43,27 @@
|
|
|
43
43
|
"build": "tsx scripts/build.ts",
|
|
44
44
|
"prepublishOnly": "npm run build",
|
|
45
45
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
46
|
-
"
|
|
46
|
+
"typecheck:bench": "tsc --noEmit -p bench/tsconfig.json",
|
|
47
|
+
"test": "mkdir -p .artifacts/unit && bun test src bench --reporter=junit --reporter-outfile=.artifacts/unit/junit.xml",
|
|
48
|
+
"bench:gate": "bun bench/local-dry-run.ts",
|
|
49
|
+
"bench:gate:cf": "bun bench/cf-dev-smoke.ts"
|
|
47
50
|
},
|
|
48
51
|
"dependencies": {
|
|
49
|
-
"@claxedo/workspace-relay-protocol": "0.
|
|
50
|
-
"@sentry/bun": "10.64.0",
|
|
52
|
+
"@claxedo/workspace-relay-protocol": "0.7.0",
|
|
51
53
|
"hono": "4.10.7",
|
|
52
|
-
"jose": "6.0.11"
|
|
54
|
+
"jose": "6.0.11",
|
|
55
|
+
"posthog-node": "4.18.0"
|
|
53
56
|
},
|
|
54
57
|
"devDependencies": {
|
|
58
|
+
"@claxedo/sandbox-manager": "0.7.0",
|
|
59
|
+
"@daytona/sdk": "0.192.0",
|
|
55
60
|
"@tsconfig/node-lts": "22.0.4",
|
|
56
61
|
"@types/bun": "1.3.13",
|
|
57
62
|
"esbuild": "0.25.12",
|
|
63
|
+
"miniflare": "4.20260722.0",
|
|
58
64
|
"tsx": "4.22.3",
|
|
59
65
|
"typescript": "catalog:",
|
|
60
|
-
"
|
|
66
|
+
"wrangler": "4.114.0",
|
|
67
|
+
"@cloudflare/workers-types": "catalog:"
|
|
61
68
|
}
|
|
62
69
|
}
|