@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 30 lines 1.09 KB
Raw
1 import type * as Binding from "./Binding.ts";
2 import { makeBindingLayer } from "./BindingLayer.ts";
3 import {
4 VersionMetadata,
5 type VersionMetadataAccessor,
6 type WorkerVersionMetadata,
7 } from "./VersionMetadata.ts";
8
9 /** The binding value produced by calling {@link VersionMetadata} (declared on `env` or `yield*`-ed). */
10 export type VersionMetadataBinding = Binding.Binding<
11 VersionMetadata["key"],
12 VersionMetadataAccessor,
13 VersionMetadata
14 >;
15
16 /**
17 * The layer that provides the Effect-native interface for the Cloudflare
18 * Workers Version Metadata binding.
19 *
20 * Provide it on the Worker effect (`Effect.provide(Cloudflare.Workers.VersionMetadataBinding)`)
21 * so that yielding a {@link VersionMetadata} binding attaches the native
22 * `version_metadata` binding to the surrounding Worker at deploy time and, at
23 * runtime, resolves to a deferred {@link VersionMetadataAccessor} (yield it to
24 * read the {@link WorkerVersionMetadata}).
25 */
26 export const VersionMetadataBinding = makeBindingLayer<
27 VersionMetadata,
28 WorkerVersionMetadata,
29 VersionMetadataAccessor
30 >(VersionMetadata, (raw) => raw);