The best way to control Claude Code, Codex and more from any computer or phone

main
ts 47 lines 1.35 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 { Memory } from "./Memory.ts";
5
6 export interface DeleteEventRequest extends Omit<agentcore.DeleteEventInput, "memoryId"> {}
7
8 /**
9 * Deletes a short-term event from an actor's session.
10 *
11 * Bind a {@link Memory} inside a function runtime to call the
12 * AgentCore data-plane API against it. Provide `AgentCore.DeleteEventHttp`
13 * on the Function effect to implement the binding.
14 *
15 * ### Deleting Events
16 * **Example:** Delete an Event by Id
17 * ```typescript
18 * // init
19 * const deleteEvent = yield* AgentCore.DeleteEvent(memory);
20 *
21 * return {
22 * fetch: Effect.gen(function* () {
23 * // runtime
24 * yield* deleteEvent({
25 * actorId: "user-1",
26 * sessionId: "session-1",
27 * eventId,
28 * });
29 * return HttpServerResponse.json({ deleted: true });
30 * }),
31 * };
32 * ```
33 *
34 * @binding
35 */
36 export interface DeleteEvent extends Binding.Service<
37 DeleteEvent,
38 "AWS.BedrockAgentCore.DeleteEvent",
39 <R extends Memory>(
40 memory: R,
41 ) => Effect.Effect<
42 (
43 request: DeleteEventRequest,
44 ) => Effect.Effect<agentcore.DeleteEventOutput, agentcore.DeleteEventError>
45 >
46 > {}
47 export const DeleteEvent = Binding.Service<DeleteEvent>("AWS.BedrockAgentCore.DeleteEvent");