From d91f7e7a4d1294b47c71abf068eef87deef5f4f1 Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Mon, 3 Nov 2025 14:19:45 -0800 Subject: [PATCH] chore(rivetkit): fmt --- biome.json | 1 - .../runner/src/websocket-tunnel-adapter.ts | 13 ++++++++-- .../sdks/typescript/test-runner/src/index.ts | 25 ++++++++++++------- engine/sdks/typescript/test-runner/src/log.ts | 2 +- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/biome.json b/biome.json index bcc74e911b..1d59dadfe3 100644 --- a/biome.json +++ b/biome.json @@ -6,7 +6,6 @@ "**/*.json", "**/*.ts", "!engine/artifacts", - "!engine/sdks", "!engine/sdks/typescript/api-full", "!engine/sdks/typescript/runner-protocol", "!frontend", diff --git a/engine/sdks/typescript/runner/src/websocket-tunnel-adapter.ts b/engine/sdks/typescript/runner/src/websocket-tunnel-adapter.ts index 2fd46085b2..3eee2ce072 100644 --- a/engine/sdks/typescript/runner/src/websocket-tunnel-adapter.ts +++ b/engine/sdks/typescript/runner/src/websocket-tunnel-adapter.ts @@ -28,7 +28,11 @@ export class WebSocketTunnelAdapter { constructor( webSocketId: string, sendCallback: (data: ArrayBuffer | string, isBinary: boolean) => void, - closeCallback: (code?: number, reason?: string, retry?: boolean) => void, + closeCallback: ( + code?: number, + reason?: string, + retry?: boolean, + ) => void, ) { this.#webSocketId = webSocketId; this.#sendCallback = sendCallback; @@ -436,7 +440,12 @@ export class WebSocketTunnelAdapter { } /// Returns false if the message was sent off. - _handleMessage(requestId: ArrayBuffer, data: string | Uint8Array, index: number, isBinary: boolean): boolean { + _handleMessage( + requestId: ArrayBuffer, + data: string | Uint8Array, + index: number, + isBinary: boolean, + ): boolean { if (this.#readyState !== 1) { // OPEN return true; diff --git a/engine/sdks/typescript/test-runner/src/index.ts b/engine/sdks/typescript/test-runner/src/index.ts index 1d9815abc3..7e167642bf 100644 --- a/engine/sdks/typescript/test-runner/src/index.ts +++ b/engine/sdks/typescript/test-runner/src/index.ts @@ -12,8 +12,7 @@ const INTERNAL_SERVER_PORT = process.env.INTERNAL_SERVER_PORT : 5051; const RIVET_NAMESPACE = process.env.RIVET_NAMESPACE ?? "default"; const RIVET_RUNNER_NAME = process.env.RIVET_RUNNER_NAME ?? "test-runner"; -const RIVET_RUNNER_KEY = - process.env.RIVET_RUNNER_KEY; +const RIVET_RUNNER_KEY = process.env.RIVET_RUNNER_KEY; const RIVET_RUNNER_VERSION = process.env.RIVET_RUNNER_VERSION ? Number(process.env.RIVET_RUNNER_VERSION) : 1; @@ -106,8 +105,7 @@ if (AUTOSTART_SERVER) { if (AUTOSTART_RUNNER) { [runner, runnerStarted, runnerStopped] = await startRunner(); -} -else await autoConfigureServerless(); +} else await autoConfigureServerless(); async function autoConfigureServerless() { const res = await fetch( @@ -155,13 +153,14 @@ async function startRunner(): Promise< token: RIVET_TOKEN, namespace: RIVET_NAMESPACE, runnerName: RIVET_RUNNER_NAME, - runnerKey: RIVET_RUNNER_KEY ?? `key-${Math.floor(Math.random() * 10000)}`, + runnerKey: + RIVET_RUNNER_KEY ?? `key-${Math.floor(Math.random() * 10000)}`, totalSlots: RIVET_RUNNER_TOTAL_SLOTS, prepopulateActorNames: {}, onConnected: () => { runnerStarted.resolve(undefined); }, - onDisconnected: () => { }, + onDisconnected: () => {}, onShutdown: () => { runnerStopped.resolve(undefined); }, @@ -227,9 +226,17 @@ async function startRunner(): Promise< ws.send(`Echo: ${data}`); // Ack - const websocketId = Buffer.from((event as any).rivetRequestId).toString("base64"); - websocketLastMsgIndexes.set(websocketId, (event as any).rivetMessageIndex); - runner.sendWebsocketMessageAck((event as any).rivetRequestId, (event as any).rivetMessageIndex); + const websocketId = Buffer.from( + (event as any).rivetRequestId, + ).toString("base64"); + websocketLastMsgIndexes.set( + websocketId, + (event as any).rivetMessageIndex, + ); + runner.sendWebsocketMessageAck( + (event as any).rivetRequestId, + (event as any).rivetMessageIndex, + ); }); ws.addEventListener("close", () => { diff --git a/engine/sdks/typescript/test-runner/src/log.ts b/engine/sdks/typescript/test-runner/src/log.ts index 767a67afff..c74e91e64c 100644 --- a/engine/sdks/typescript/test-runner/src/log.ts +++ b/engine/sdks/typescript/test-runner/src/log.ts @@ -1,3 +1,4 @@ +import { inspect } from "node:util"; import { type Level, type LevelWithSilent, @@ -5,7 +6,6 @@ import { pino, stdTimeFunctions, } from "pino"; -import { inspect } from "util"; export type { Logger } from "pino";