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