The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import type * as microvms from "@distilled.cloud/aws/lambda-microvms"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import type * as Effect from "effect/Effect"; |
| 4 | import type { MicrovmImage } from "./MicrovmImage.ts"; |
| 5 | |
| 6 | export interface CreateAuthTokenRequest extends microvms.CreateMicrovmAuthTokenRequest {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `CreateMicrovmAuthToken`. |
| 10 | * |
| 11 | * Bind it to a {@link MicrovmImage} to get a callable that mints a short-lived |
| 12 | * token for a running MicroVM. Send it on the MicroVM `endpoint` in the |
| 13 | * `X-aws-proxy-auth` header. |
| 14 | * ### Auth Tokens |
| 15 | * **Example:** Mint an auth token |
| 16 | * ```typescript |
| 17 | * const createAuthToken = yield* AWS.Lambda.CreateAuthToken(Sandbox); |
| 18 | * const { authToken } = yield* createAuthToken({ |
| 19 | * microvmIdentifier: vm.microvmId, |
| 20 | * expirationInMinutes: 5, |
| 21 | * allowedPorts: [{ port: 5000 }], |
| 22 | * }); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface CreateAuthToken extends Binding.Service< |
| 28 | CreateAuthToken, |
| 29 | "AWS.Lambda.CreateAuthToken", |
| 30 | ( |
| 31 | image: MicrovmImage, |
| 32 | ) => Effect.Effect< |
| 33 | ( |
| 34 | request: CreateAuthTokenRequest, |
| 35 | ) => Effect.Effect< |
| 36 | microvms.CreateMicrovmAuthTokenResponse, |
| 37 | microvms.CreateMicrovmAuthTokenError |
| 38 | > |
| 39 | > |
| 40 | > {} |
| 41 | export const CreateAuthToken = Binding.Service<CreateAuthToken>("AWS.Lambda.CreateAuthToken"); |