@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

main
ts 47 lines 1.51 KB
Raw
1 import type * as agentcore from "@distilled.cloud/aws/bedrock-agentcore";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { CodeInterpreter } from "./CodeInterpreter.ts";
5
6 export interface StopCodeInterpreterSessionRequest extends Omit<
7 agentcore.StopCodeInterpreterSessionRequest,
8 "codeInterpreterIdentifier"
9 > {}
10
11 /**
12 * Stops a running code interpreter session.
13 *
14 * Bind a {@link CodeInterpreter} inside a function runtime to end sessions
15 * opened with `StartCodeInterpreterSession` and release the sandbox.
16 * Provide `AgentCore.StopCodeInterpreterSessionHttp` on the Function effect
17 * to implement the binding.
18 *
19 * ### Stopping Sessions
20 * **Example:** Stop a Session After Use
21 * ```typescript
22 * // init
23 * const stopSession = yield* AgentCore.StopCodeInterpreterSession(interpreter);
24 *
25 * // runtime (inside the handler)
26 * yield* stopSession({ sessionId: session.sessionId });
27 * ```
28 *
29 * @binding
30 */
31 export interface StopCodeInterpreterSession extends Binding.Service<
32 StopCodeInterpreterSession,
33 "AWS.BedrockAgentCore.StopCodeInterpreterSession",
34 <R extends CodeInterpreter>(
35 codeInterpreter: R,
36 ) => Effect.Effect<
37 (
38 request: StopCodeInterpreterSessionRequest,
39 ) => Effect.Effect<
40 agentcore.StopCodeInterpreterSessionResponse,
41 agentcore.StopCodeInterpreterSessionError
42 >
43 >
44 > {}
45 export const StopCodeInterpreterSession = Binding.Service<StopCodeInterpreterSession>(
46 "AWS.BedrockAgentCore.StopCodeInterpreterSession",
47 );