@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 39 lines 1.34 KB
Raw
1 import type * as cloudtrail from "@distilled.cloud/aws/cloudtrail";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { EventDataStore } from "./EventDataStore.ts";
5
6 /**
7 * Runtime binding for `cloudtrail:GenerateQuery`.
8 *
9 * Generates a CloudTrail Lake SQL statement from a natural-language prompt
10 * against the bound {@link EventDataStore} (the store list is injected from
11 * the binding). Provide the implementation with
12 * `Effect.provide(AWS.CloudTrail.GenerateQueryHttp)`.
13 * ### Querying CloudTrail Lake
14 * **Example:** Generate SQL from a Prompt
15 * ```typescript
16 * // init — bind the operation to the event data store
17 * const generateQuery = yield* AWS.CloudTrail.GenerateQuery(store);
18 *
19 * // runtime
20 * const result = yield* generateQuery({
21 * Prompt: "What are my top errors in the past month?",
22 * });
23 * console.log(result.QueryStatement);
24 * ```
25 *
26 * @binding
27 */
28 export interface GenerateQuery extends Binding.Service<
29 GenerateQuery,
30 "AWS.CloudTrail.GenerateQuery",
31 (
32 store: EventDataStore,
33 ) => Effect.Effect<
34 (
35 request: Omit<cloudtrail.GenerateQueryRequest, "EventDataStores">,
36 ) => Effect.Effect<cloudtrail.GenerateQueryResponse, cloudtrail.GenerateQueryError>
37 >
38 > {}
39 export const GenerateQuery = Binding.Service<GenerateQuery>("AWS.CloudTrail.GenerateQuery");