@@ -3,7 +3,13 @@ import type { Context, Layer } from "effect";
33import type { HttpClient } from "effect/unstable/http" ;
44import type { HttpApiGroup } from "effect/unstable/httpapi" ;
55import type { StandardJSONSchemaV1 , StandardSchemaV1 } from "@standard-schema/spec" ;
6- import type { FumaDb , FumaTables , IFumaClient , StorageFailure } from "./fuma-runtime" ;
6+ import type {
7+ FumaDb ,
8+ FumaTables ,
9+ IFumaClient ,
10+ StorageFailure ,
11+ TablesToFumaSchema ,
12+ } from "./fuma-runtime" ;
713
814import type { PluginBlobStore } from "./blob" ;
915import type {
@@ -44,7 +50,7 @@ import type { Usage, UsagesForConnectionInput, UsagesForSecretInput } from "./us
4450// and writes stamp an explicit `scope_id`.
4551// ---------------------------------------------------------------------------
4652
47- export interface StorageDeps < _TTables extends FumaTables | undefined = undefined > {
53+ export interface StorageDeps < TTables extends FumaTables | undefined = undefined > {
4854 /**
4955 * Precedence-ordered scope stack visible to this executor. Innermost
5056 * first. Reads on scoped tables walk every scope; writes require the
@@ -53,19 +59,12 @@ export interface StorageDeps<_TTables extends FumaTables | undefined = undefined
5359 */
5460 readonly scopes : readonly Scope [ ] ;
5561 /** Plugin-facing FumaDB query handle. Plugins call FumaDB directly. */
56- readonly db : FumaDb ;
62+ readonly db : FumaDb < TablesToFumaSchema < TTables > > ;
5763 /** Effect boundary around the same FumaDB handle for stores implemented in Effect. */
58- readonly fuma : IFumaClient ;
64+ readonly fuma : IFumaClient < TablesToFumaSchema < TTables > > ;
5965 readonly blobs : PluginBlobStore ;
6066}
6167
62- // ---------------------------------------------------------------------------
63- // defineSchema — compatibility name for plugin tables. It returns FumaDB table
64- // definitions directly; there is no Executor-specific schema DSL anymore.
65- // ---------------------------------------------------------------------------
66-
67- export const defineSchema = < const TTables extends FumaTables > ( tables : TTables ) : TTables => tables ;
68-
6968// ---------------------------------------------------------------------------
7069// Elicit — suspends the fiber, calls the invoke-time elicitation
7170// handler, resumes with the user's response. Available on both static
0 commit comments