Skip to content

Commit ee2cc72

Browse files
NathanFlurryclaude
andcommitted
fix: add missing UpgradeSocket bridge refs, fix V8 postinstall and typecheck errors
- Add UpgradeSocketWriteRawBridgeRef, UpgradeSocketEndRawBridgeRef, UpgradeSocketDestroyRawBridgeRef to bridge-contract.ts (were imported in index.ts but never defined) - Fix V8 postinstall to use postinstall.cjs (package.json has type:module so postinstall.js with require() fails) - Add type annotations to execution-driver.ts callback params Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 287fa75 commit ee2cc72

4 files changed

Lines changed: 651 additions & 65 deletions

File tree

packages/secure-exec-core/src/shared/bridge-contract.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ export type NetworkHttpServerListenResult = { address: { address: string; family
178178
export type NetworkHttpServerListenRawBridgeRef = (optionsJson: string) => Promise<NetworkHttpServerListenResult>;
179179
export type NetworkHttpServerCloseRawBridgeRef = (serverId: number) => Promise<void>;
180180

181+
// Upgrade socket (WebSocket relay) boundary contracts.
182+
export type UpgradeSocketWriteRawBridgeRef = (socketId: number, dataBase64: string) => void;
183+
export type UpgradeSocketEndRawBridgeRef = (socketId: number) => void;
184+
export type UpgradeSocketDestroyRawBridgeRef = (socketId: number) => void;
185+
181186
// PTY boundary contracts.
182187
export type PtySetRawModeBridgeRef = (mode: boolean) => void;
183188

packages/secure-exec-node/src/execution-driver.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ async function getSharedV8Runtime(): Promise<V8Runtime> {
1616
if (!sharedV8RuntimePromise) {
1717
sharedV8RuntimePromise = createV8Runtime({
1818
warmupBridgeCode: composeBridgeCodeForWarmup(),
19-
}).then((r) => {
19+
}).then((r: V8Runtime) => {
2020
sharedV8Runtime = r;
2121
return r;
22-
}).catch((err) => {
22+
}).catch((err: unknown) => {
2323
// Reset on failure so next call retries instead of returning cached rejection
2424
sharedV8RuntimePromise = null;
2525
sharedV8Runtime = null;
@@ -446,7 +446,7 @@ export class NodeExecutionDriver implements RuntimeDriver {
446446
arch: osConfig.arch ?? process.arch,
447447
},
448448
bridgeHandlers,
449-
onStreamCallback: (_callbackType, _payload) => {
449+
onStreamCallback: (_callbackType: string, _payload: unknown) => {
450450
// Handle stream callbacks from V8 (e.g., HTTP server responses)
451451
},
452452
});

packages/secure-exec-v8/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"types": "./dist/index.d.ts",
88
"files": [
99
"dist",
10-
"postinstall.js",
10+
"postinstall.cjs",
1111
"README.md"
1212
],
1313
"repository": {
@@ -26,7 +26,7 @@
2626
"check-types": "tsc --noEmit",
2727
"build": "tsc",
2828
"test": "vitest run",
29-
"postinstall": "node postinstall.js"
29+
"postinstall": "node postinstall.cjs"
3030
},
3131
"optionalDependencies": {
3232
"@secure-exec/v8-linux-x64-gnu": "0.1.0",

0 commit comments

Comments
 (0)