@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 54 lines 1.61 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 { BrowserCustom } from "./BrowserCustom.ts";
5
6 export interface SaveBrowserSessionProfileRequest extends Omit<
7 agentcore.SaveBrowserSessionProfileRequest,
8 "browserIdentifier"
9 > {}
10
11 /**
12 * Persists a browser session's state to a reusable browser profile.
13 *
14 * Bind a {@link BrowserCustom} inside a function runtime to call the
15 * AgentCore data-plane API against it. Provide `AgentCore.SaveBrowserSessionProfileHttp`
16 * on the Function effect to implement the binding.
17 *
18 * ### Browser Profiles
19 * **Example:** Save a Session Profile
20 * ```typescript
21 * // init
22 * const saveBrowserSessionProfile = yield* AgentCore.SaveBrowserSessionProfile(browser);
23 *
24 * return {
25 * fetch: Effect.gen(function* () {
26 * // runtime
27 * yield* saveBrowserSessionProfile({
28 * sessionId,
29 * profileIdentifier,
30 * });
31 * return HttpServerResponse.json({ saved: true });
32 * }),
33 * };
34 * ```
35 *
36 * @binding
37 */
38 export interface SaveBrowserSessionProfile extends Binding.Service<
39 SaveBrowserSessionProfile,
40 "AWS.BedrockAgentCore.SaveBrowserSessionProfile",
41 <R extends BrowserCustom>(
42 browser: R,
43 ) => Effect.Effect<
44 (
45 request: SaveBrowserSessionProfileRequest,
46 ) => Effect.Effect<
47 agentcore.SaveBrowserSessionProfileResponse,
48 agentcore.SaveBrowserSessionProfileError
49 >
50 >
51 > {}
52 export const SaveBrowserSessionProfile = Binding.Service<SaveBrowserSessionProfile>(
53 "AWS.BedrockAgentCore.SaveBrowserSessionProfile",
54 );