@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 43 lines 1.44 KB
Raw
1 import type * as polly from "@distilled.cloud/aws/polly";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Lexicon } from "./Lexicon.ts";
5
6 /**
7 * Runtime binding for `polly:GetLexicon` — read the PLS content and
8 * attributes of a pronunciation lexicon at runtime.
9 *
10 * Bind it to a `Lexicon` resource; the deploy-time half grants
11 * `polly:GetLexicon` scoped to that lexicon's ARN and the runtime callable
12 * injects the lexicon name. The returned `Lexicon.Content` is `Redacted`
13 * (distilled models it as sensitive) — unwrap with `Redacted.value(...)` at
14 * the point of use. Provide the implementation with
15 * `Effect.provide(AWS.Polly.GetLexiconHttp)`.
16 *
17 * ### Managing Lexicons
18 * **Example:** Read a lexicon's content at runtime
19 * ```typescript
20 * // init
21 * const getLexicon = yield* AWS.Polly.GetLexicon(lexicon);
22 *
23 * // runtime
24 * const result = yield* getLexicon();
25 * const content = result.Lexicon?.Content;
26 * const xml =
27 * content === undefined
28 * ? undefined
29 * : Redacted.isRedacted(content)
30 * ? Redacted.value(content)
31 * : content;
32 * ```
33 *
34 * @binding
35 */
36 export interface GetLexicon extends Binding.Service<
37 GetLexicon,
38 "AWS.Polly.GetLexicon",
39 <L extends Lexicon>(
40 lexicon: L,
41 ) => Effect.Effect<() => Effect.Effect<polly.GetLexiconOutput, polly.GetLexiconError>>
42 > {}
43 export const GetLexicon = Binding.Service<GetLexicon>("AWS.Polly.GetLexicon");