the universal sandbox runtime for agents and humans. pocketenv.io
sandbox openclaw agent claude-code vercel-sandbox deno-sandbox cloudflare-sandbox atproto sprites daytona
7
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add modal auth support to sandbox helpers

+26 -2
+26 -2
apps/sandbox/src/lib/sandbox-helpers.ts
··· 6 6 daytonaAuth, 7 7 denoAuth, 8 8 vercelAuth, 9 + modalAuth, 9 10 } from "../schema/mod.ts"; 10 11 import { 11 12 BaseSandbox, ··· 26 27 projectId?: string; 27 28 teamId?: string; 28 29 } | null; 30 + modalAuthParams?: { 31 + tokenId?: string; 32 + tokenSecret?: string; 33 + } | null; 29 34 } 30 35 31 36 export async function getAuthParams( ··· 37 42 [daytonaAuthParams], 38 43 [denoAuthParams], 39 44 [vercelAuthParams], 45 + [modalAuthParams], 40 46 ] = await Promise.all([ 41 47 db 42 48 .select() ··· 58 64 .from(vercelAuth) 59 65 .where(eq(vercelAuth.sandboxId, sandboxDbId)) 60 66 .execute(), 67 + db 68 + .select() 69 + .from(modalAuth) 70 + .where(eq(modalAuth.sandboxId, sandboxDbId)) 71 + .execute(), 61 72 ]); 62 - return { spriteAuthParams, daytonaAuthParams, denoAuthParams, vercelAuthParams }; 73 + return { 74 + spriteAuthParams, 75 + daytonaAuthParams, 76 + denoAuthParams, 77 + vercelAuthParams, 78 + modalAuthParams, 79 + }; 63 80 } 64 81 65 82 export function buildCredentials(auth: AuthParams): SandboxOptions { ··· 71 88 vercelApiToken: decrypt(auth.vercelAuthParams?.vercelToken), 72 89 vercelProjectId: auth.vercelAuthParams?.projectId, 73 90 vercelTeamId: auth.vercelAuthParams?.teamId, 91 + modalTokenId: decrypt(auth.modalAuthParams?.tokenId), 92 + modalTokenSecret: decrypt(auth.modalAuthParams?.tokenSecret), 74 93 }; 75 94 } 76 95 ··· 82 101 if (!record.sandboxId) { 83 102 const sandbox = await createSandbox(record.provider as Provider, { 84 103 id: record.id, 104 + modalAppName: record.name, 85 105 ...credentials, 86 106 }); 87 107 const sandboxId = await sandbox.id(); ··· 93 113 record.sandboxId = sandboxId; 94 114 } 95 115 96 - return getSandboxById(record.provider as Provider, record.sandboxId!, credentials); 116 + return getSandboxById( 117 + record.provider as Provider, 118 + record.sandboxId!, 119 + credentials, 120 + ); 97 121 }