1import type * as agentcore from "@distilled.cloud/aws/bedrock-agentcore";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { BrowserCustom } from "./BrowserCustom.ts";
5
6export interface GetBrowserSessionRequest extends Omit<
7 agentcore.GetBrowserSessionRequest,
8 "browserIdentifier"
9> {}
10
11/**
12 * Reads a browser session's configuration, status, and stream endpoints.
13 *
14 * Bind a {@link BrowserCustom} inside a function runtime to call the
15 * AgentCore data-plane API against it. Provide `AgentCore.GetBrowserSessionHttp`
16 * on the Function effect to implement the binding.
17 *
18 * ### Browser Sessions
19 * **Example:** Read a Session
20 * ```typescript
21 * // init
22 * const getBrowserSession = yield* AgentCore.GetBrowserSession(browser);
23 *
24 * return {
25 * fetch: Effect.gen(function* () {
26 * // runtime
27 * const result = yield* getBrowserSession({ sessionId });
28 * return HttpServerResponse.json({ status: result.status });
29 * }),
30 * };
31 * ```
32 *
33 * @binding
34 */
35export interface GetBrowserSession extends Binding.Service<
36 GetBrowserSession,
37 "AWS.BedrockAgentCore.GetBrowserSession",
38 <R extends BrowserCustom>(
39 browser: R,
40 ) => Effect.Effect<
41 (
42 request: GetBrowserSessionRequest,
43 ) => Effect.Effect<
44 agentcore.GetBrowserSessionResponse,
45 agentcore.GetBrowserSessionError
46 >
47 >
48> {}
49export const GetBrowserSession = Binding.Service<GetBrowserSession>(
50 "AWS.BedrockAgentCore.GetBrowserSession",
51);