The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import type * as emr from "@distilled.cloud/aws/emr-serverless"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import type * as Effect from "effect/Effect"; |
| 4 | import type { Application } from "./Application.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Request accepted by the {@link StartSession} runtime callable. The |
| 8 | * `applicationId` is injected from the bound {@link Application}; the |
| 9 | * idempotency `clientToken` is auto-generated when omitted. |
| 10 | */ |
| 11 | export type StartSessionInput = Omit<emr.StartSessionRequest, "applicationId" | "clientToken"> & { |
| 12 | /** |
| 13 | * Idempotency token deduplicating retried submissions. |
| 14 | * @default a generated UUID per call |
| 15 | */ |
| 16 | clientToken?: string; |
| 17 | }; |
| 18 | |
| 19 | /** |
| 20 | * Runtime binding for `emr-serverless:StartSession`. |
| 21 | * |
| 22 | * Starts an interactive session on the bound {@link Application} (the |
| 23 | * application must enable `interactiveConfiguration`). The session assumes |
| 24 | * the given execution role; grants `iam:PassRole` (conditioned to |
| 25 | * `emr-serverless.amazonaws.com`) accordingly. Provide the implementation |
| 26 | * with `Effect.provide(AWS.EMRServerless.StartSessionHttp)`. |
| 27 | * ### Interactive Sessions |
| 28 | * **Example:** Start A Session |
| 29 | * ```typescript |
| 30 | * // init |
| 31 | * const startSession = yield* AWS.EMRServerless.StartSession(app); |
| 32 | * |
| 33 | * // runtime |
| 34 | * const session = yield* startSession({ executionRoleArn: sessionRoleArn }); |
| 35 | * yield* Effect.log(`started ${session.sessionId}`); |
| 36 | * ``` |
| 37 | * |
| 38 | * @binding |
| 39 | */ |
| 40 | export interface StartSession extends Binding.Service< |
| 41 | StartSession, |
| 42 | "AWS.EMRServerless.StartSession", |
| 43 | ( |
| 44 | application: Application, |
| 45 | ) => Effect.Effect< |
| 46 | (request: StartSessionInput) => Effect.Effect<emr.StartSessionResponse, emr.StartSessionError> |
| 47 | > |
| 48 | > {} |
| 49 | export const StartSession = Binding.Service<StartSession>("AWS.EMRServerless.StartSession"); |