diff --git a/services/cloud-agent-next/src/helpers.ts b/services/cloud-agent-next/src/helpers.ts deleted file mode 100644 index 0c24708936..0000000000 --- a/services/cloud-agent-next/src/helpers.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { getSandbox } from '@cloudflare/sandbox'; -import type { TRPCContext } from './types.js'; -import { getSandboxNamespace } from './sandbox-id.js'; - -/** - * Sets up a sandbox instance and invokes a callback. - * Simplifies sandbox initialization by encapsulating the setup logic. - * @param ctx The TRPC context containing environment - * @param sandboxId The sandbox identifier for sandbox isolation - * @param fn Async callback that receives the configured sandbox instance - * @returns The result of the callback function - */ -export async function withSandbox( - ctx: TRPCContext, - sandboxId: string, - fn: (sandbox: ReturnType) => Promise -): Promise { - const sandbox = getSandbox(getSandboxNamespace(ctx.env, sandboxId), sandboxId); - return await fn(sandbox); -}