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

main
ts 32 lines 1.02 KB
Raw
1 import * as Effect from "effect/Effect";
2 import * as Layer from "effect/Layer";
3 import {
4 makeReadVectorsClient,
5 makeVectorsHttpBinding,
6 makeWriteVectorsClient,
7 readVectorsActions,
8 writeVectorsActions,
9 } from "./BindingHttp.ts";
10 import { type VectorsClient, Vectors } from "./Vectors.ts";
11
12 /**
13 * HTTP implementation of {@link Vectors} — calls the S3 Vectors data plane
14 * with the host Function's own credentials, granting the full read+write
15 * action set on the bound index. Composes the read- and write-level client
16 * builders.
17 */
18 export const VectorsHttp = Layer.effect(
19 Vectors,
20 makeVectorsHttpBinding({
21 name: "Vectors",
22 actions: [...readVectorsActions, ...writeVectorsActions],
23 makeClient: Effect.gen(function* () {
24 const makeRead = yield* makeReadVectorsClient;
25 const makeWrite = yield* makeWriteVectorsClient;
26 return (indexArn: Effect.Effect<string>, label: string): VectorsClient => ({
27 ...makeRead(indexArn, label),
28 ...makeWrite(indexArn, label),
29 });
30 }),
31 }),
32 );