@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, 06:00 UTC

main
ts 56 lines 1.77 KB
Raw
1 import type * as bedrock from "@distilled.cloud/aws/bedrock-agent-runtime";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { AgentAlias } from "./AgentAlias.ts";
5
6 /**
7 * The `DeleteAgentMemory` request with the binding-injected `agentId` and
8 * `agentAliasId` removed — they are supplied automatically from the bound
9 * {@link AgentAlias}.
10 */
11 export interface DeleteAgentMemoryRequest extends Omit<
12 bedrock.DeleteAgentMemoryRequest,
13 "agentId" | "agentAliasId"
14 > {}
15
16 /**
17 * Runtime binding for `bedrock-agent-runtime:DeleteAgentMemory` — delete the
18 * memory an agent has stored, for one session, one memory id, or everything.
19 *
20 * Bind an {@link AgentAlias} inside a function runtime to get a callable
21 * that clears the agent's long-term memory. The binding grants the function
22 * `bedrock:DeleteAgentMemory` scoped to exactly that alias. Deletion is
23 * idempotent — deleting a session or memory id that holds no memory
24 * succeeds.
25 *
26 * ### Deleting Agent Memory
27 * **Example:** Forget One Session
28 * ```typescript
29 * // init
30 * const deleteAgentMemory = yield* Bedrock.DeleteAgentMemory(alias);
31 *
32 * // runtime
33 * yield* deleteAgentMemory({ sessionId });
34 * ```
35 *
36 * **Example:** Forget Everything for a Memory Id
37 * ```typescript
38 * yield* deleteAgentMemory({ memoryId: userId });
39 * ```
40 *
41 * @binding
42 */
43 export interface DeleteAgentMemory extends Binding.Service<
44 DeleteAgentMemory,
45 "AWS.Bedrock.DeleteAgentMemory",
46 <A extends AgentAlias>(
47 alias: A,
48 ) => Effect.Effect<
49 (
50 request: DeleteAgentMemoryRequest,
51 ) => Effect.Effect<bedrock.DeleteAgentMemoryResponse, bedrock.DeleteAgentMemoryError>
52 >
53 > {}
54 export const DeleteAgentMemory = Binding.Service<DeleteAgentMemory>(
55 "AWS.Bedrock.DeleteAgentMemory",
56 );