@lunora/codegen 1.0.0-alpha.240 → 1.0.0-alpha.242
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +93 -55
- package/dist/index.d.ts +93 -55
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/AGENTS_FILENAME-Bb2jxbOa.mjs +1 -0
- package/dist/packem_shared/CONTAINERS_FILENAME-CGB4bqUr.mjs +1 -0
- package/dist/packem_shared/DEFAULT_TARGET-B1zgC6k6.mjs +1 -0
- package/dist/packem_shared/SCHEMA_SNAPSHOT_FILENAME-BHDnOBKJ.mjs +9 -0
- package/dist/packem_shared/WORKFLOWS_FILENAME-DNaUHGS8.mjs +1 -0
- package/dist/packem_shared/{discoverCrons-MfKw7IFf.mjs → discoverCrons-0lNudk0S.mjs} +1 -1
- package/dist/packem_shared/{emitAgents-Cy7QGO1t.mjs → emitAgents-Ddcr_r3B.mjs} +1 -1
- package/dist/packem_shared/{emitApi-CJ9ziZnP.mjs → emitApi-DdW9RyGG.mjs} +22 -22
- package/dist/packem_shared/{emitApp-BGhO5bhT.mjs → emitApp--W9G6MZd.mjs} +48 -56
- package/dist/packem_shared/{emitCrons-mkwWkn0R.mjs → emitCrons-Bop1FTEz.mjs} +28 -14
- package/dist/packem_shared/{emitFunctions-BqAz1ssY.mjs → emitFunctions-BgNeOZt_.mjs} +1 -1
- package/dist/packem_shared/{emitServer-BEo_fCY8.mjs → emitServer-B8t7Hzb1.mjs} +38 -40
- package/dist/packem_shared/emitShard-RnNua5aR.mjs +1 -0
- package/dist/packem_shared/ir-BgM8A3XV.mjs +1 -0
- package/dist/packem_shared/{shard-BBv6VBmX.mjs → shard-CCNl561P.mjs} +61 -61
- package/dist/packem_shared/{shard-runtime-CM5qthZc.mjs → shard-runtime-B7xvdFPc.mjs} +48 -39
- package/package.json +10 -10
- package/dist/packem_shared/AGENTS_FILENAME-DoPI92Wu.mjs +0 -1
- package/dist/packem_shared/CONTAINERS_FILENAME-B6TFs82W.mjs +0 -1
- package/dist/packem_shared/DEFAULT_TARGET-DCpDuuUM.mjs +0 -1
- package/dist/packem_shared/SCHEMA_SNAPSHOT_FILENAME-IOiezeVr.mjs +0 -9
- package/dist/packem_shared/WORKFLOWS_FILENAME-B_ZJxRSx.mjs +0 -1
- package/dist/packem_shared/emitShard-CsWK2K91.mjs +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{A as w}from"./capabilities-DJJWVEtk.mjs";import{G as y}from"./shared-DjUziztz.mjs";const k=e=>`has${e.charAt(0).toUpperCase()}${e.slice(1)}`,b=w.map(({appMethod:e,key:t})=>[k(t),e.method,e.configKey,e.doc]),g=e=>b.some(([t])=>e[t]),S=e=>e?['import * as lunoraIdentityContract from "../identity.js";']:[],E=(e,t)=>e?['import type { CreateAccessResolverOptions } from "@lunora/cloudflare-access";',`import { createAccessResolver${t?", composeResolvers":""} } from "@lunora/cloudflare-access";`]:[],D=e=>e?['import { createKvIntrospectorFromEnv } from "@lunora/bindings/kv";']:[],x=e=>e?['import { createVectorAdminIntrospector } from "@lunora/bindings/vectors";']:[],R=e=>e?['import type { D1CtxDbOptions, D1DatabaseLike, D1Exec } from "@lunora/d1";','import { applyCdcChanges, createD1CtxDb, emitD1QueryCost, exportGlobalRows, facetGlobalColumn, importGlobalRows, listGlobalTables, readD1CdcChanges, readGlobalTablePage, retryingExec } from "@lunora/d1";']:[],A=e=>e?['import notifyConfig from "../notify.js";']:[],m=e=>(e.emailAgents?.length??0)>0,C=e=>m(e)?['import { dispatchAgentEmail } from "@lunora/agent/inbound";']:[],O=e=>m(e)?['import * as lunoraAgentDefinitions from "../agents.js";']:[],T=e=>{const{hasFramework:t,hasGlobal:a,hasHyperdriveGlobal:r,hasQueue:n,useUmbrella:i}=e,o=i?"lunorash/runtime":"@lunora/runtime",l=["ExecutionContextLike","HttpRouterLike","LunoraWorker","Route","ScheduledControllerLike","ShardNamespaceLike","WorkerOptions",...n?["TriggerTrace"]:[],...a?["GlobalIntrospector","AdminTableResolver"]:[],...t?["FrameworkHostHandler"]:[]],s=[...a||r?["createCrossShardRelationCapabilities"]:[],"createWorker",...e.jurisdiction?["declareAppJurisdiction"]:[],"resolveLogArchiveFromEnv",...t?["withFrameworkWorker"]:[]].join(", ");return[`import type { ${[...l].toSorted((c,d)=>c.localeCompare(d)).join(", ")} } from "${o}";`,`import { ${s} } from "${o}";`]},N=e=>{const{hasAccess:t,hasAuth:a,hasGlobal:r,hasHyperdriveGlobal:n,hasKvIntrospector:i,hasQueue:o,hasScheduler:l,hasStorage:s,hasWorkflow:c,wantsOpenApi:d,wantsOpenRpc:h}=e;return[...a?['import type { AuthNamespaceLike, LunoraAuth, LunoraAuthOptions } from "@lunora/auth";','import { createAuth, createAuthAdmin, createAuthAuditReader, createDoAuthWiring, d1Executor, ensureMigrated, handleAuthRequest, lunoraD1Adapter } from "@lunora/auth";']:[],...E(t,a),...R(r),...n?['import type { HyperdriveEngine } from "@lunora/hyperdrive/global";','import { createHyperdriveGlobalCtxDb } from "@lunora/hyperdrive/global";','import type { SqlCtxDbOptions, SqlExec } from "@lunora/sql-store";']:[],...D(i),...x(e.hasVectors===!0),...l?['import type { DurableObjectNamespaceLike } from "@lunora/scheduler";','import { createScheduler } from "@lunora/scheduler";']:[],...s?['import type { R2BucketLike, R2S3Credentials, Storage } from "@lunora/storage";','import { createBucketStorage, createStorage } from "@lunora/storage";']:[],...c?['import { createWorkflowsRestClient } from "@lunora/workflow";']:[],...C(e),...T(e),"",...S(e.identity),...O(e),...r||n?['import schema from "../schema.js";']:[],...A(e.hasNotify),'import { LUNORA_CRONS } from "./crons.js";','import { LUNORA_FUNCTIONS } from "./functions.js";',...o?['import { createQueueCaptureSink, dispatchQueueBatch, shouldCaptureQueue } from "@lunora/queue";','import { LUNORA_QUEUE_REGISTRY } from "./queues.js";']:[],...d?['import { openApiSpec } from "./openapi.js";']:[],...h?['import { openRpcSpec } from "./openrpc.js";']:[],'import { createShardDO } from "./shard.js";',...e.hasVectors===!0?['import { LUNORA_VECTOR_INDEXES } from "./vectors.js";']:[]]},I=e=>[...e.hasStorage?["/** `.storage(...)` declaration — one bucket (required) plus optional extra named buckets and signed-URL config. Backs `ctx.storage` AND the studio file browser. */\ninterface StorageDeclaration<Env> {\n /** The default R2 bucket binding (the bare `ctx.storage`). */\n bucket: Selector<Env, R2BucketLike>;\n /** Extra named buckets, reached via `ctx.storage.bucket(\"name\")` and the studio's bucket picker. */\n buckets?: Record<string, Selector<Env, R2BucketLike>>;\n /** Public base URL signed/public object URLs resolve against. Omit it and `ctx.storage` in a mutation, action or HTTP handler (and the studio's copy-URL) signs against the origin the request reached the worker on — no per-environment value to ship. Queries get no such fallback (a live query re-runs with no request behind it), so a query that signs URLs needs this set. */\n publicBaseUrl?: Selector<Env, string>;\n /** R2 S3-API credentials (`{ accountId, accessKeyId, secretAccessKey, bucket, jurisdiction? }`) enabling `ctx.storage.getPresignedUrl` — native S3 presigned URLs that hit R2 directly, bypassing the worker. Omit to use only the worker-signed `getSignedUrl` path. */\n s3?: Selector<Env, R2S3Credentials>;\n /** HMAC secret for signed URLs. */\n signingSecret?: Selector<Env, string>;\n}"]:[],...e.hasScheduler?["/** `.scheduler(...)` declaration — the `SchedulerDO` namespace. Backs `ctx.scheduler` AND the studio's scheduled-jobs view. The origin its callbacks dispatch back to is not declared here: the DO reads `env.LUNORA_ORIGIN_URL` at fire time, because a caller-supplied dispatch target would be an SSRF vector. */\ninterface SchedulerDeclaration<Env> {\n /** The `SchedulerDO` namespace binding (typically `env.SCHEDULER`). */\n namespace: Selector<Env, DurableObjectNamespaceLike & ShardNamespaceLike>;\n}"]:[],...e.hasGlobal?["/** `.global(...)` declaration — the D1 binding backing `.global()` tables. Backs cross-tenant `ctx.db` reads/writes AND the studio's global data browser. */\ninterface GlobalDeclaration<Env> {\n /** The D1 binding (typically `env.DB`). */\n d1: Selector<Env, D1DatabaseLike>;\n /** The worker origin used to fan reverse cross-backend relations across shards. Without it, such a relation throws a clear error. */\n origin?: Selector<Env, string>;\n}"]:[],...e.hasHyperdriveGlobal?['/** `.hyperdriveGlobal(...)` declaration — backs `.global({ backend: "hyperdrive" })` tables on a Postgres/MySQL database via Hyperdrive. Stays reactive: the writer is injected as `globalDb` and the broadcast hook drives live queries. */\ninterface HyperdriveGlobalDeclaration<Env> {\n /** The Hyperdrive engine — selects the Postgres or MySQL dialect. */\n engine: HyperdriveEngine;\n /** Build the `SqlExec` from `env` — e.g. `buildPgExec(fromPostgresJs(postgres(env.HYPERDRIVE.connectionString)))`. Cache the driver on the DO instance; rebuild lazily after hibernation. */\n exec: (env: Env) => SqlExec;\n /** The worker origin used to fan reverse cross-backend relations across shards. Without it, such a relation throws a clear error. */\n origin?: Selector<Env, string>;\n}']:[],...e.hasAuth?['/** `.auth(...)` declaration — better-auth options plus the storage the adapter reads. Give it `d1` (the default) or `namespace` (a Durable Object that hosts the auth tables), never both. The builder owns the lazy build + `ensureMigrated` dance and wires `authHandler` / `resolveIdentity` / `authAdmin`. */\ninterface AuthDeclaration<Env> {\n /** The D1 binding the auth SQL adapter is wired over (via `lunoraD1Adapter`). Omit only when using `namespace`. */\n d1?: Selector<Env, unknown>;\n /** Shared secret the worker presents on the object\'s internal session route. REQUIRED with `namespace`: the binding is reachable from any worker bound to it, so the secret — not the binding — is the authorization boundary. Without it identity resolution fails closed. */\n internalSecret?: Selector<Env, string>;\n /** Name of the Durable Object instance holding the auth tables. Defaults to `"auth"`. Set it to run separate auth objects (per deployment, per tenant) off one namespace. */\n objectName?: Selector<Env, string>;\n /** The auth Durable Object namespace — the DO-backed mode. Needed for `@better-auth/scim`, which requires native transactions that D1 has none of. The object owns the auth tables, so `/api/auth/*` and identity resolution both go through it. Typed as `AuthNamespaceLike` because `createDoAuthWiring` resolves through `idFromName` + `get` and has no `getByName` fallback — both members are load-bearing here, and `ShardNamespaceLike` leaves both optional. */\n namespace?: Selector<Env, AuthNamespaceLike>;\n /** Build the better-auth options from `env` (secret, plugins, email/password, …). */\n options: (env: Env) => LunoraAuthOptions;\n}']:[]],L=e=>[...e.hasAccess?[" private accessSelector?: Selector<Env, CreateAccessResolverOptions | undefined>;"]:[]," private adminToken?: Selector<Env, string>;",...e.hasAuth?[" private authDeclaration?: AuthDeclaration<Env>;"]:[]," private cdcEnabled = false;"," private reactiveCacheConfig: boolean | { maxBytes?: number; maxEntries?: number } = false;",' private maxRelationKeysLimit?: ShardConfig["maxRelationKeys"];',' private observabilitySink?: ShardConfig["observability"];',' private relationExistsPushDownMode?: ShardConfig["relationExistsPushDown"];'," private readonly extendFns: ((env: Env, derived: Readonly<WorkerOptions>) => Partial<WorkerOptions>)[] = [];",...e.hasGlobal?[" private globalDeclaration?: GlobalDeclaration<Env>;"]:[],...e.hasHyperdriveGlobal?[" private hyperdriveGlobalDeclaration?: HyperdriveGlobalDeclaration<Env>;"]:[]," private httpRouterApp?: HttpRouterLike;"," private readonly routeMap: Record<string, Route> = {};",...e.hasScheduler?[" private schedulerDeclaration?: SchedulerDeclaration<Env>;"]:[],...g(e)?[" private readonly shardExtras: Partial<ShardConfig> = {};"]:[]," private shardSelector?: Selector<Env, ShardNamespaceLike>;",...e.hasSourcedTables?[' private sourceClientFactory?: NonNullable<ShardConfig["sourceClient"]>;']:[],...e.hasStorage?[" private storageDeclaration?: StorageDeclaration<Env>;"]:[]],q=e=>b.filter(([t])=>e[t]).map(([,t,a,r])=>` /** ${r} */
|
|
2
|
-
public ${t}(factory: (env: Env) => ReturnType<NonNullable<ShardConfig["${
|
|
3
|
-
this.shardExtras.${
|
|
1
|
+
import{A as w}from"./capabilities-DJJWVEtk.mjs";import{i as k}from"./ir-BgM8A3XV.mjs";import{G as S}from"./shared-DjUziztz.mjs";const E=e=>`has${e.charAt(0).toUpperCase()}${e.slice(1)}`,g=w.map(({appMethod:e,key:t})=>[E(t),e.method,e.configKey,e.doc]),m=e=>g.some(([t])=>e[t]),D=e=>e?['import * as lunoraIdentityContract from "../identity.js";']:[],R=(e,t)=>e?['import type { CreateAccessResolverOptions } from "@lunora/cloudflare-access";',`import { createAccessResolver${t?", composeResolvers":""} } from "@lunora/cloudflare-access";`]:[],x=e=>e?['import { createKvIntrospectorFromEnv } from "@lunora/bindings/kv";']:[],A=e=>e?['import { createVectorAdminIntrospector } from "@lunora/bindings/vectors";']:[],C=e=>e?['import type { D1CtxDbOptions, D1DatabaseLike, D1Exec } from "@lunora/d1";','import { applyCdcChanges, createD1CtxDb, emitD1QueryCost, exportGlobalRows, facetGlobalColumn, importGlobalRows, listGlobalTables, readD1CdcChanges, readGlobalTablePage, retryingExec } from "@lunora/d1";']:[],O=e=>e?['import notifyConfig from "../notify.js";']:[],v=e=>(e.emailAgents?.length??0)>0,T=e=>v(e)?['import { dispatchAgentEmail } from "@lunora/agent/inbound";']:[],N=e=>v(e)?['import * as lunoraAgentDefinitions from "../agents.js";']:[],d=e=>e.tables.some(t=>k(t)),I=e=>{const{hasFramework:t,hasGlobal:r,hasHyperdriveGlobal:a,hasQueue:n,useUmbrella:i}=e,o=i?"lunorash/runtime":"@lunora/runtime",l=["ExecutionContextLike","HttpRouterLike","LunoraWorker","Route","ScheduledControllerLike","ShardNamespaceLike","WorkerOptions",...n?["TriggerTrace"]:[],...r?["GlobalIntrospector"]:[],...e.tables.length>0?["ShardingInfo"]:[],...t?["FrameworkHostHandler"]:[]],s=[...r||a?["createCrossShardRelationCapabilities"]:[],...d(e)?["createDynamicShardRegistry","createQueryCoordinator"]:[],"createWorker",...e.jurisdiction?["declareAppJurisdiction"]:[],"resolveLogArchiveFromEnv",...t?["withFrameworkWorker"]:[]].join(", ");return[`import type { ${[...l].toSorted((c,h)=>c.localeCompare(h)).join(", ")} } from "${o}";`,`import { ${s} } from "${o}";`]},L=e=>{const{hasAccess:t,hasAuth:r,hasGlobal:a,hasHyperdriveGlobal:n,hasKvIntrospector:i,hasQueue:o,hasScheduler:l,hasStorage:s,hasWorkflow:c,wantsOpenApi:h,wantsOpenRpc:u}=e;return[...r?['import type { AuthNamespaceLike, LunoraAuth, LunoraAuthOptions } from "@lunora/auth";','import { createAuth, createAuthAdmin, createAuthAuditReader, createDoAuthWiring, d1Executor, ensureMigrated, handleAuthRequest, lunoraD1Adapter } from "@lunora/auth";']:[],...R(t,r),...C(a),...n?['import type { HyperdriveEngine } from "@lunora/hyperdrive/global";','import { createHyperdriveGlobalCtxDb } from "@lunora/hyperdrive/global";','import type { SqlCtxDbOptions, SqlExec } from "@lunora/sql-store";']:[],...x(i),...A(e.hasVectors===!0),...l?['import type { DurableObjectNamespaceLike } from "@lunora/scheduler";','import { createScheduler } from "@lunora/scheduler";']:[],...s?['import type { R2BucketLike, R2S3Credentials, Storage } from "@lunora/storage";','import { createBucketStorage, createStorage } from "@lunora/storage";']:[],...c?['import { createWorkflowsRestClient } from "@lunora/workflow";']:[],...T(e),...I(e),"",...D(e.identity),...N(e),...a||n?['import schema from "../schema.js";']:[],...O(e.hasNotify),'import { LUNORA_CRONS } from "./crons.js";','import { LUNORA_FUNCTIONS } from "./functions.js";',...o?['import { createQueueCaptureSink, dispatchQueueBatch, shouldCaptureQueue } from "@lunora/queue";','import { LUNORA_QUEUE_REGISTRY } from "./queues.js";']:[],...h?['import { openApiSpec } from "./openapi.js";']:[],...u?['import { openRpcSpec } from "./openrpc.js";']:[],'import { createShardDO } from "./shard.js";',...e.hasVectors===!0?['import { LUNORA_VECTOR_INDEXES } from "./vectors.js";']:[]]},q=e=>[...e.hasStorage?["/** `.storage(...)` declaration — one bucket (required) plus optional extra named buckets and signed-URL config. Backs `ctx.storage` AND the studio file browser. */\ninterface StorageDeclaration<Env> {\n /** The default R2 bucket binding (the bare `ctx.storage`). */\n bucket: Selector<Env, R2BucketLike>;\n /** Extra named buckets, reached via `ctx.storage.bucket(\"name\")` and the studio's bucket picker. */\n buckets?: Record<string, Selector<Env, R2BucketLike>>;\n /** Public base URL signed/public object URLs resolve against. Omit it and `ctx.storage` in a mutation, action or HTTP handler (and the studio's copy-URL) signs against the origin the request reached the worker on — no per-environment value to ship. Queries get no such fallback (a live query re-runs with no request behind it), so a query that signs URLs needs this set. */\n publicBaseUrl?: Selector<Env, string>;\n /** R2 S3-API credentials (`{ accountId, accessKeyId, secretAccessKey, bucket, jurisdiction? }`) enabling `ctx.storage.getPresignedUrl` — native S3 presigned URLs that hit R2 directly, bypassing the worker. Omit to use only the worker-signed `getSignedUrl` path. */\n s3?: Selector<Env, R2S3Credentials>;\n /** HMAC secret for signed URLs. */\n signingSecret?: Selector<Env, string>;\n}"]:[],...e.hasScheduler?["/** `.scheduler(...)` declaration — the `SchedulerDO` namespace. Backs `ctx.scheduler` AND the studio's scheduled-jobs view. The origin its callbacks dispatch back to is not declared here: the DO reads `env.LUNORA_ORIGIN_URL` at fire time, because a caller-supplied dispatch target would be an SSRF vector. */\ninterface SchedulerDeclaration<Env> {\n /** The `SchedulerDO` namespace binding (typically `env.SCHEDULER`). */\n namespace: Selector<Env, DurableObjectNamespaceLike & ShardNamespaceLike>;\n}"]:[],...e.hasGlobal?["/** `.global(...)` declaration — the D1 binding backing `.global()` tables. Backs cross-tenant `ctx.db` reads/writes AND the studio's global data browser. */\ninterface GlobalDeclaration<Env> {\n /** The D1 binding (typically `env.DB`). */\n d1: Selector<Env, D1DatabaseLike>;\n /** The worker origin used to fan reverse cross-backend relations across shards. Without it, such a relation throws a clear error. */\n origin?: Selector<Env, string>;\n}"]:[],...e.hasHyperdriveGlobal?['/** `.hyperdriveGlobal(...)` declaration — backs `.global({ backend: "hyperdrive" })` tables on a Postgres/MySQL database via Hyperdrive. Stays reactive: the writer is injected as `globalDb` and the broadcast hook drives live queries. */\ninterface HyperdriveGlobalDeclaration<Env> {\n /** The Hyperdrive engine — selects the Postgres or MySQL dialect. */\n engine: HyperdriveEngine;\n /** Build the `SqlExec` from `env` — e.g. `buildPgExec(fromPostgresJs(postgres(env.HYPERDRIVE.connectionString)))`. Cache the driver on the DO instance; rebuild lazily after hibernation. */\n exec: (env: Env) => SqlExec;\n /** The worker origin used to fan reverse cross-backend relations across shards. Without it, such a relation throws a clear error. */\n origin?: Selector<Env, string>;\n}']:[],...e.hasAuth?['/** `.auth(...)` declaration — better-auth options plus the storage the adapter reads. Give it `d1` (the default) or `namespace` (a Durable Object that hosts the auth tables), never both. The builder owns the lazy build + `ensureMigrated` dance and wires `authHandler` / `resolveIdentity` / `authAdmin`. */\ninterface AuthDeclaration<Env> {\n /** The D1 binding the auth SQL adapter is wired over (via `lunoraD1Adapter`). Omit only when using `namespace`. */\n d1?: Selector<Env, unknown>;\n /** Shared secret the worker presents on the object\'s internal session route. REQUIRED with `namespace`: the binding is reachable from any worker bound to it, so the secret — not the binding — is the authorization boundary. Without it identity resolution fails closed. */\n internalSecret?: Selector<Env, string>;\n /** Name of the Durable Object instance holding the auth tables. Defaults to `"auth"`. Set it to run separate auth objects (per deployment, per tenant) off one namespace. */\n objectName?: Selector<Env, string>;\n /** The auth Durable Object namespace — the DO-backed mode. Needed for `@better-auth/scim`, which requires native transactions that D1 has none of. The object owns the auth tables, so `/api/auth/*` and identity resolution both go through it. Typed as `AuthNamespaceLike` because `createDoAuthWiring` resolves through `idFromName` + `get` and has no `getByName` fallback — both members are load-bearing here, and `ShardNamespaceLike` leaves both optional. */\n namespace?: Selector<Env, AuthNamespaceLike>;\n /** Build the better-auth options from `env` (secret, plugins, email/password, …). */\n options: (env: Env) => LunoraAuthOptions;\n}']:[]],j=e=>[...e.hasAccess?[" private accessSelector?: Selector<Env, CreateAccessResolverOptions | undefined>;"]:[]," private adminToken?: Selector<Env, string>;",...e.hasAuth?[" private authDeclaration?: AuthDeclaration<Env>;"]:[]," private cdcEnabled = false;"," private reactiveCacheConfig: boolean | { maxBytes?: number; maxEntries?: number } = false;",' private maxRelationKeysLimit?: ShardConfig["maxRelationKeys"];',' private observabilitySink?: ShardConfig["observability"];',' private relationExistsPushDownMode?: ShardConfig["relationExistsPushDown"];'," private readonly extendFns: ((env: Env, derived: Readonly<WorkerOptions>) => Partial<WorkerOptions>)[] = [];",...e.hasGlobal?[" private globalDeclaration?: GlobalDeclaration<Env>;"]:[],...e.hasHyperdriveGlobal?[" private hyperdriveGlobalDeclaration?: HyperdriveGlobalDeclaration<Env>;"]:[]," private httpRouterApp?: HttpRouterLike;"," private readonly routeMap: Record<string, Route> = {};",...e.hasScheduler?[" private schedulerDeclaration?: SchedulerDeclaration<Env>;"]:[],...m(e)?[" private readonly shardExtras: Partial<ShardConfig> = {};"]:[],...d(e)?[" private shardRegistrySelector?: Selector<Env, ShardNamespaceLike>;"]:[]," private shardSelector?: Selector<Env, ShardNamespaceLike>;",...e.hasSourcedTables?[' private sourceClientFactory?: NonNullable<ShardConfig["sourceClient"]>;']:[],...e.hasStorage?[" private storageDeclaration?: StorageDeclaration<Env>;"]:[]],G=e=>g.filter(([t])=>e[t]).map(([,t,r,a])=>` /** ${a} */
|
|
2
|
+
public ${t}(factory: (env: Env) => ReturnType<NonNullable<ShardConfig["${r}"]>>): this {
|
|
3
|
+
this.shardExtras.${r} = factory as NonNullable<ShardConfig["${r}"]>;
|
|
4
4
|
|
|
5
5
|
return this;
|
|
6
|
-
}`),
|
|
6
|
+
}`),B=e=>[...e.hasAccess?[" /** Wire Cloudflare Access (Zero Trust) — feeds the verified Access identity into `ctx.auth` / RLS via `resolveIdentity`. Call it with no argument when the Access policy is attached to the Worker (the identity arrives on the execution context; nothing to configure); pass `teamDomain` + `aud` for a hostname-scoped Access application, whose `Cf-Access-Jwt-Assertion` JWT is verified against your team JWKS. When `.auth(...)` is also configured, Access is composed ahead of it (Access wins when it authenticated the caller; everyone else falls through to the app session). */\n public access(selector?: Selector<Env, CreateAccessResolverOptions>): this {\n this.accessSelector = selector ?? (() => undefined);\n\n return this;\n }"]:[],` /** Bearer token gating the \`/_lunora/admin/*\` endpoints the studio calls. */
|
|
7
7
|
public admin(selector: Selector<Env, string>): this {
|
|
8
8
|
this.adminToken = selector;
|
|
9
9
|
|
|
@@ -52,7 +52,7 @@ import{A as w}from"./capabilities-DJJWVEtk.mjs";import{G as y}from"./shared-DjUz
|
|
|
52
52
|
this.shardSelector = selector;
|
|
53
53
|
|
|
54
54
|
return this;
|
|
55
|
-
}`,...e.hasSourcedTables?[` /** Resolve the SQL client a \`.source(...)\` table's ingest poll reads from, given the wrangler Hyperdrive binding it named. Build it with \`@lunora/hyperdrive\`'s \`createHyperdrive\` plus your driver adapter. REQUIRED for a sourced table: without it every poll tick records "no sourceClient resolved for binding" and the table stays empty. */
|
|
55
|
+
}`,...d(e)?[" /** The `ShardRegistryDO` namespace (typically `env.SHARD_REGISTRY`). Each shard registers itself for the `.shardBy()` tables it writes, and cross-shard export, CDC sync and migrations fan out to the shards it lists. Without it they refuse a `.shardBy()` table. */\n public shardRegistry(selector: Selector<Env, ShardNamespaceLike>): this {\n this.shardRegistrySelector = selector;\n\n return this;\n }"]:[],...e.hasSourcedTables?[` /** Resolve the SQL client a \`.source(...)\` table's ingest poll reads from, given the wrangler Hyperdrive binding it named. Build it with \`@lunora/hyperdrive\`'s \`createHyperdrive\` plus your driver adapter. REQUIRED for a sourced table: without it every poll tick records "no sourceClient resolved for binding" and the table stays empty. */
|
|
56
56
|
public sourceClient(factory: (env: Env, binding: string) => ReturnType<NonNullable<ShardConfig["sourceClient"]>>): this {
|
|
57
57
|
this.sourceClientFactory = factory as NonNullable<ShardConfig["sourceClient"]>;
|
|
58
58
|
|
|
@@ -62,8 +62,8 @@ import{A as w}from"./capabilities-DJJWVEtk.mjs";import{G as y}from"./shared-DjUz
|
|
|
62
62
|
this.storageDeclaration = declaration;
|
|
63
63
|
|
|
64
64
|
return this;
|
|
65
|
-
}`]:[],...
|
|
66
|
-
...(this.schedulerDeclaration ? { scheduler: this.resolveScheduler(env) as unknown as ${
|
|
65
|
+
}`]:[],...G(e)],P=e=>{const t=a=>e.hasScheduler?`
|
|
66
|
+
...(this.schedulerDeclaration ? { scheduler: this.resolveScheduler(env) as unknown as ${a}["scheduler"] } : {}),`:"",r=[" cdc: this.cdcEnabled,"," reactiveCache: this.reactiveCacheConfig,"," ...(this.maxRelationKeysLimit === undefined ? {} : { maxRelationKeys: this.maxRelationKeysLimit }),"," ...(this.observabilitySink === undefined ? {} : { observability: this.observabilitySink }),"," ...(this.relationExistsPushDownMode === undefined ? {} : { relationExistsPushDown: this.relationExistsPushDownMode }),",...e.hasGlobal?[` ...(this.globalDeclaration
|
|
67
67
|
? {
|
|
68
68
|
d1: (rawEnv: Record<string, unknown>, request?: { bookmark?: string; cdc?: boolean; cdcRetentionMs?: number; identity?: Record<string, unknown>; onBookmark?: (bookmark: string | undefined) => void; userId?: string | null }) => {
|
|
69
69
|
const env = rawEnv as Env;
|
|
@@ -134,12 +134,22 @@ import{A as w}from"./capabilities-DJJWVEtk.mjs";import{G as y}from"./shared-DjUz
|
|
|
134
134
|
? {
|
|
135
135
|
scheduler: (rawEnv: Record<string, unknown>) => this.resolveScheduler(rawEnv as Env),
|
|
136
136
|
}
|
|
137
|
-
: {}),`]:[],...e.hasSourcedTables?[" ...(this.sourceClientFactory === undefined ? {} : { sourceClient: this.sourceClientFactory }),"]:[],...e.hasStorage?[" ...(this.storageDeclaration ? { storage: (rawEnv: Record<string, unknown>, origin?: string) => this.resolveStorage(rawEnv as Env, origin) } : {}),"]:[],...
|
|
138
|
-
${
|
|
137
|
+
: {}),`]:[],...d(e)?[" ...(this.shardRegistrySelector ? { shardRegistry: (rawEnv: Record<string, unknown>) => this.shardRegistrySelector?.(rawEnv as Env) } : {}),"]:[],...e.hasSourcedTables?[" ...(this.sourceClientFactory === undefined ? {} : { sourceClient: this.sourceClientFactory }),"]:[],...e.hasStorage?[" ...(this.storageDeclaration ? { storage: (rawEnv: Record<string, unknown>, origin?: string) => this.resolveStorage(rawEnv as Env, origin) } : {}),"]:[],...m(e)?[" ...this.shardExtras,"]:[]];return r.length>0?`
|
|
138
|
+
${r.join(`
|
|
139
139
|
`)}
|
|
140
|
-
`:""},
|
|
140
|
+
`:""},W=e=>e.jurisdiction&&e.jurisdictionPinsAuth===!0?`
|
|
141
141
|
// The schema's jurisdiction pins the auth object like every other DO.
|
|
142
|
-
jurisdiction: ${JSON.stringify(e.jurisdiction)},`:"",
|
|
142
|
+
jurisdiction: ${JSON.stringify(e.jurisdiction)},`:"",_=e=>typeof e=="string"?`{ mode: { kind: ${JSON.stringify(e)} } }`:`{ mode: { field: ${JSON.stringify(e.field)}, kind: "shardBy" } }`,$=e=>[...e.tables.length>0?[` const tableSharding = new Map<string, ShardingInfo>([
|
|
143
|
+
${e.tables.map(t=>` [${JSON.stringify(t.name)}, ${_(t.shardMode)}],`).join(`
|
|
144
|
+
`)}
|
|
145
|
+
]);
|
|
146
|
+
|
|
147
|
+
options.listSchemaTables = () => [...tableSharding.keys()];
|
|
148
|
+
options.resolveTableSharding = (table) => tableSharding.get(table);`]:[],...d(e)?[` const shardRegistry = this.shardRegistrySelector?.(env);
|
|
149
|
+
|
|
150
|
+
if (shardRegistry) {
|
|
151
|
+
options.queryCoordinator = createQueryCoordinator({ registry: createDynamicShardRegistry({ ${e.jurisdiction?`jurisdiction: ${JSON.stringify(e.jurisdiction)}, `:""}namespace: shardRegistry }) });
|
|
152
|
+
}`]:[]],H=e=>[...$(e),...e.hasScheduler?[` if (this.schedulerDeclaration) {
|
|
143
153
|
options.schedulerDO = this.schedulerDeclaration.namespace(env);
|
|
144
154
|
}`]:[],...e.hasWorkflow?[` options.workflowsClient = (workflowEnv) => {
|
|
145
155
|
const source = workflowEnv as Record<string, unknown>;
|
|
@@ -154,14 +164,9 @@ ${a.join(`
|
|
|
154
164
|
|
|
155
165
|
if (database) {
|
|
156
166
|
options.globalIntrospector = buildGlobalIntrospector(database);
|
|
157
|
-
// \`
|
|
158
|
-
//
|
|
159
|
-
//
|
|
160
|
-
// recognised as global and the latter is never reached — the
|
|
161
|
-
// endpoint answers 200 with \`inserted: {}\` for a write that never
|
|
162
|
-
// happened. Both are mechanical over the schema this file already
|
|
163
|
-
// imports, so there is nothing project-specific to configure.
|
|
164
|
-
options.resolveTableSharding = buildTableShardingResolver();
|
|
167
|
+
// \`importGlobals\` wires the admin bulk-import endpoint's global
|
|
168
|
+
// plane: the rows \`resolveTableSharding\` classifies as \`.global()\`
|
|
169
|
+
// land here, and without it they are reported, not written.
|
|
165
170
|
options.importGlobals = buildGlobalImporter(database, this.cdcEnabled);
|
|
166
171
|
// The read/replay half of the same admin plane. Each one is the
|
|
167
172
|
// only reason its endpoint can see the global storage plane at
|
|
@@ -206,7 +211,7 @@ ${a.join(`
|
|
|
206
211
|
// than more emitted code: request-path logic in generated output can only be
|
|
207
212
|
// typechecked, never unit-tested.
|
|
208
213
|
const authWiring = createDoAuthWiring({
|
|
209
|
-
internalSecret: authDeclaration.internalSecret?.(env),${
|
|
214
|
+
internalSecret: authDeclaration.internalSecret?.(env),${W(e)}
|
|
210
215
|
namespace: authNamespace(env),
|
|
211
216
|
objectName: authDeclaration.objectName?.(env),
|
|
212
217
|
});
|
|
@@ -284,14 +289,14 @@ ${a.join(`
|
|
|
284
289
|
}`]:[],...e.voiceAgents&&e.voiceAgents.length>0?[` options.voiceAgents = {
|
|
285
290
|
${e.voiceAgents.map(t=>` ${JSON.stringify(t.exportName)}: (env as Record<string, unknown>)[${JSON.stringify(t.bindingName)}] as ShardNamespaceLike,`).join(`
|
|
286
291
|
`)}
|
|
287
|
-
};`]:[]],
|
|
292
|
+
};`]:[]],U=e=>[" cronJobs: LUNORA_CRONS,"," functions: LUNORA_FUNCTIONS,",...e.identity?[` identity: lunoraIdentityContract.${e.identity.exportName},`]:[],...e.jurisdiction?[` jurisdiction: ${JSON.stringify(e.jurisdiction)},`]:[],...e.wantsOpenApi?[" openApiSpec,"]:[],...e.wantsOpenRpc?[" openRpcSpec,"]:[],...e.hasQueue?[" queue: (batch: unknown, queueEnv: unknown, _context: ExecutionContextLike, trigger: TriggerTrace): Promise<void> =>"," dispatchQueueBatch(batch as Parameters<typeof dispatchQueueBatch>[0], LUNORA_QUEUE_REGISTRY, {"," capture: shouldCaptureQueue(queueEnv as Record<string, unknown>)",` ? createQueueCaptureSink(queueEnv as Record<string, unknown>${e.jurisdiction?`, { jurisdiction: ${JSON.stringify(e.jurisdiction)} }`:""})`," : undefined,"," env: queueEnv as Record<string, unknown>,"," traceparent: trigger.traceparent,"," }),"]:[]," ...(this.httpRouterApp ? { httpRouter: this.httpRouterApp } : {}),"," routes: this.routeMap,"," shardDO: this.shardSelector?.(env) ?? (undefined as unknown as ShardNamespaceLike),"],F=e=>e.hasScheduler?`
|
|
288
293
|
/** Resolve the \`SchedulerDO\`-backed scheduler for this env; \`undefined\` until the namespace is wired. */
|
|
289
294
|
private resolveScheduler(env: Env): ReturnType<typeof createScheduler> | undefined {
|
|
290
295
|
const namespace = this.schedulerDeclaration?.namespace(env);
|
|
291
296
|
|
|
292
297
|
return namespace ? createScheduler({${e.jurisdiction?` jurisdiction: ${JSON.stringify(e.jurisdiction)},`:""} namespace }) : undefined;
|
|
293
298
|
}
|
|
294
|
-
`:""
|
|
299
|
+
`:"",M=e=>e?`
|
|
295
300
|
/**
|
|
296
301
|
* One bucket's \`Storage\`, signing under the name it is registered as.
|
|
297
302
|
*
|
|
@@ -396,7 +401,7 @@ ${e.voiceAgents.map(t=>` ${JSON.stringify(t.exportName)}: (env as Rec
|
|
|
396
401
|
storageUpload: (key: string, body: ArrayBuffer, opts?: { bucket?: string; contentType?: string; sha256?: string }) => pick(opts?.bucket).upload(key, body, opts),
|
|
397
402
|
};
|
|
398
403
|
}
|
|
399
|
-
`:"",
|
|
404
|
+
`:"",Q=e=>e?`
|
|
400
405
|
/**
|
|
401
406
|
* Adapt the raw D1 binding to \`@lunora/d1\`'s \`D1Exec\` (reads via \`all\`, writes via \`run\`, and — when the binding exposes it — several writes in one round trip via \`batch\`).
|
|
402
407
|
*
|
|
@@ -518,19 +523,6 @@ const buildGlobalIntrospector = (database: D1DatabaseLike): GlobalIntrospector =
|
|
|
518
523
|
};
|
|
519
524
|
};
|
|
520
525
|
|
|
521
|
-
/**
|
|
522
|
-
* \`resolveTableSharding\` for the admin bulk-import endpoint: a lookup over each
|
|
523
|
-
* table's declared \`shardMode\` (\`defineTable(...).global()\` / \`.shardBy(field)\`
|
|
524
|
-
* already record exactly this shape on the table) — mechanical, nothing to
|
|
525
|
-
* configure per project. \`undefined\` for a table the schema doesn't declare, so
|
|
526
|
-
* the import endpoint's own unknown-table handling still applies.
|
|
527
|
-
*/
|
|
528
|
-
const buildTableShardingResolver = (): AdminTableResolver => (table) => {
|
|
529
|
-
const declared = (schema as unknown as D1CtxDbOptions["schema"]).tables[table];
|
|
530
|
-
|
|
531
|
-
return declared?.shardMode ? { mode: declared.shardMode } : undefined;
|
|
532
|
-
};
|
|
533
|
-
|
|
534
526
|
/**
|
|
535
527
|
* \`importGlobals\` for the admin bulk-import endpoint: routes \`.global()\` rows
|
|
536
528
|
* through the same D1 writer \`.global()\` reads/writes already use, via
|
|
@@ -631,9 +623,9 @@ const buildGlobalCdcApplier =
|
|
|
631
623
|
|
|
632
624
|
return request.changes.length;
|
|
633
625
|
};
|
|
634
|
-
`:"",
|
|
626
|
+
`:"",K=e=>[...e.hasAuth?["AuthDeclaration"]:[],"ComposedApp",...e.hasGlobal?["GlobalDeclaration"]:[],"LunoraConfig",...e.hasScheduler?["SchedulerDeclaration"]:[],"Selector",...e.hasStorage?["StorageDeclaration"]:[]].toSorted((t,r)=>t.localeCompare(r)).join(", "),Y=e=>{const t={...e,hasVectors:(e.hasVectors??!0)&&(e.vectorIndexCount??0)>0},{hasAuth:r}=t,a=q(t),n=H(t),i=r?` let auth: LunoraAuth | null = null;
|
|
635
627
|
let authInit: Promise<void> | null = null;
|
|
636
|
-
`:"",o=
|
|
628
|
+
`:"",o=r?`
|
|
637
629
|
const initAuth = async (env: Env): Promise<void> => {
|
|
638
630
|
if (!this.authDeclaration) {
|
|
639
631
|
return;
|
|
@@ -682,17 +674,17 @@ const buildGlobalCdcApplier =
|
|
|
682
674
|
authInit = null;
|
|
683
675
|
throw error;
|
|
684
676
|
}));
|
|
685
|
-
`:"",l=
|
|
686
|
-
await ensureAuth(env);`:"",s=
|
|
687
|
-
host ? withFrameworkWorker(host, (hostEnv) => this.buildWorkerOptions(hostEnv as Env, ${s})) : createWorker(this.buildWorkerOptions(env, ${s}));`:` const buildWorker = (env: Env): LunoraWorker => createWorker(this.buildWorkerOptions(env, ${s}));`,
|
|
688
|
-
${
|
|
677
|
+
`:"",l=r?`
|
|
678
|
+
await ensureAuth(env);`:"",s=r?"() => auth":"() => null",c=r?"getAuth: () => LunoraAuth | null":"_getAuth: () => null",h=t.hasFramework?` const buildWorker = (env: Env): LunoraWorker =>
|
|
679
|
+
host ? withFrameworkWorker(host, (hostEnv) => this.buildWorkerOptions(hostEnv as Env, ${s})) : createWorker(this.buildWorkerOptions(env, ${s}));`:` const buildWorker = (env: Env): LunoraWorker => createWorker(this.buildWorkerOptions(env, ${s}));`,u=t.hasFramework?"host?: FrameworkHostHandler":"",p=t.emailAgents??[],y=p.length>0?` composed.email = dispatchAgentEmail([
|
|
680
|
+
${p.map(b=>` { agent: lunoraAgentDefinitions.${b.exportName}, className: ${JSON.stringify(b.className)} },`).join(`
|
|
689
681
|
`)}
|
|
690
682
|
]);
|
|
691
683
|
|
|
692
684
|
`:"",f=` /** Materialise the standalone Cloudflare worker + \`ShardDO\` class. */
|
|
693
685
|
public build(): ComposedApp {
|
|
694
686
|
return this.assemble();
|
|
695
|
-
}${t.hasFramework?"\n\n /** Compose Lunora's realtime plane INTO a meta-framework's Cloudflare handler (SvelteKit/Astro/Nuxt). The framework `host` serves everything except the reserved `/_lunora/*` endpoints; pass the adapter-emitted worker (e.g. SvelteKit's `_worker.js`, Astro's `handle`). */\n public buildFrameworkWorker(host: FrameworkHostHandler): ComposedApp {\n return this.assemble(host);\n }":""}`;return`${
|
|
687
|
+
}${t.hasFramework?"\n\n /** Compose Lunora's realtime plane INTO a meta-framework's Cloudflare handler (SvelteKit/Astro/Nuxt). The framework `host` serves everything except the reserved `/_lunora/*` endpoints; pass the adapter-emitted worker (e.g. SvelteKit's `_worker.js`, Astro's `handle`). */\n public buildFrameworkWorker(host: FrameworkHostHandler): ComposedApp {\n return this.assemble(host);\n }":""}`;return`${S}${L(t).join(`
|
|
696
688
|
`)}
|
|
697
689
|
|
|
698
690
|
/** Read a value off the per-request \`env\`. Returns \`undefined\` to leave the capability unconfigured (its \`ctx.*\`/admin surface stays a clear-error stub). */
|
|
@@ -706,9 +698,9 @@ ${t.jurisdiction?`
|
|
|
706
698
|
// \`@lunora/mail\` reads it to pin its shard RPC like every other DO path.
|
|
707
699
|
declareAppJurisdiction(${JSON.stringify(t.jurisdiction)});
|
|
708
700
|
`:""}
|
|
709
|
-
${
|
|
701
|
+
${a.join(`
|
|
710
702
|
|
|
711
|
-
`)}${
|
|
703
|
+
`)}${a.length>0?`
|
|
712
704
|
|
|
713
705
|
`:""}/** The composed app: a Cloudflare module worker (\`fetch\` / \`scheduled\` / optional \`email\`) plus the \`ShardDO\` class binding. */
|
|
714
706
|
interface ComposedApp extends LunoraWorker {
|
|
@@ -725,27 +717,27 @@ interface ComposedApp extends LunoraWorker {
|
|
|
725
717
|
* first request so per-isolate singletons are built once.
|
|
726
718
|
*/
|
|
727
719
|
class AppBuilder<Env extends object> {
|
|
728
|
-
${
|
|
720
|
+
${j(t).join(`
|
|
729
721
|
`)}
|
|
730
722
|
|
|
731
723
|
private emailHandler?: (env: Env) => (message: unknown, env: unknown, context: ExecutionContextLike) => Promise<void>;
|
|
732
724
|
|
|
733
|
-
${
|
|
725
|
+
${B(t).join(`
|
|
734
726
|
|
|
735
727
|
`)}
|
|
736
728
|
|
|
737
729
|
${f}
|
|
738
730
|
|
|
739
731
|
/** Build the shard DO + compose the worker (standalone or framework-hosted), wrapping the lazy per-isolate singletons + auth init. */
|
|
740
|
-
private assemble(${
|
|
741
|
-
const ShardDO = createShardDO({${
|
|
732
|
+
private assemble(${u}): ComposedApp {
|
|
733
|
+
const ShardDO = createShardDO({${P(t)}});
|
|
742
734
|
|
|
743
735
|
// Per-isolate singletons: the worker (and auth instance) are expensive to
|
|
744
736
|
// build, so the first request constructs them and every later request on
|
|
745
737
|
// the same isolate reuses them.
|
|
746
738
|
let worker: LunoraWorker | null = null;
|
|
747
739
|
${i}${o}
|
|
748
|
-
${
|
|
740
|
+
${h}
|
|
749
741
|
|
|
750
742
|
const composed: ComposedApp = {
|
|
751
743
|
ShardDO,
|
|
@@ -772,7 +764,7 @@ ${d}
|
|
|
772
764
|
},`:""}
|
|
773
765
|
};
|
|
774
766
|
|
|
775
|
-
${
|
|
767
|
+
${y} if (this.emailHandler) {
|
|
776
768
|
const handler = this.emailHandler;
|
|
777
769
|
|
|
778
770
|
composed.email = (message, rawEnv, context) => handler(rawEnv as Env)(message, rawEnv, context);
|
|
@@ -792,11 +784,11 @@ ${t.hasFramework?`
|
|
|
792
784
|
`:""}
|
|
793
785
|
return composed;
|
|
794
786
|
}
|
|
795
|
-
${
|
|
787
|
+
${F(t)}${M(t.hasStorage)}
|
|
796
788
|
/** Fan the recorded declarations into the worker-side \`createWorker\` options. */
|
|
797
789
|
private buildWorkerOptions(env: Env, ${c}): WorkerOptions {
|
|
798
790
|
const options: WorkerOptions = {
|
|
799
|
-
${
|
|
791
|
+
${U(t).join(`
|
|
800
792
|
`)}
|
|
801
793
|
};
|
|
802
794
|
|
|
@@ -815,7 +807,7 @@ ${n.join(`
|
|
|
815
807
|
return options;
|
|
816
808
|
}
|
|
817
809
|
}
|
|
818
|
-
${
|
|
810
|
+
${Q(t.hasGlobal)}
|
|
819
811
|
/**
|
|
820
812
|
* Shape of the project's root \`lunora.config.*\`.
|
|
821
813
|
*
|
|
@@ -848,5 +840,5 @@ interface LunoraConfig<Env extends object = object> {
|
|
|
848
840
|
const defineApp = <Env extends object>(): AppBuilder<Env> => new AppBuilder<Env>();
|
|
849
841
|
|
|
850
842
|
export { AppBuilder, defineApp };
|
|
851
|
-
export type { ${
|
|
852
|
-
`};export{
|
|
843
|
+
export type { ${K(t)} };
|
|
844
|
+
`};export{Y as emitApp};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{G as c}from"./shared-DjUziztz.mjs";const
|
|
1
|
+
import{i as f}from"./ir-BgM8A3XV.mjs";import{G as c,d as m}from"./shared-DjUziztz.mjs";const u=n=>n?`${c}/**
|
|
2
2
|
* The \`SchedulerDO\` Durable Object class, re-exported so a worker entry can
|
|
3
3
|
* forward it — wrangler binds only what the entry exports:
|
|
4
4
|
*
|
|
@@ -8,19 +8,33 @@ import{G as c}from"./shared-DjUziztz.mjs";const g=o=>o?`${c}/**
|
|
|
8
8
|
* forwards this module for you whenever it exists.
|
|
9
9
|
*/
|
|
10
10
|
export { SchedulerDO } from "@lunora/scheduler";
|
|
11
|
-
`:"",
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
`:"",y=(n,r)=>n.some(o=>f(o))?`${c}/**
|
|
12
|
+
* The \`ShardRegistryDO\` Durable Object class — the live set of shard keys per
|
|
13
|
+
* \`.shardBy()\` table, which cross-shard export, CDC sync and migrations fan out
|
|
14
|
+
* to. Re-exported so a worker entry can forward it (wrangler binds only what the
|
|
15
|
+
* entry exports), next to \`.shardRegistry((env) => env.SHARD_REGISTRY)\`:
|
|
16
|
+
*
|
|
17
|
+
* \`export { ShardRegistryDO } from "./lunora/_generated/shardRegistry.js";\`
|
|
18
|
+
*
|
|
19
|
+
* Name the class in a hand-written entry: binding inference provisions
|
|
20
|
+
* \`SHARD_REGISTRY\` off the entry's named exports, and cannot see through an
|
|
21
|
+
* \`export *\`. A Vite-first (class-A) app needs neither line — its generated
|
|
22
|
+
* worker entry does both whenever this module exists.
|
|
23
|
+
*/
|
|
24
|
+
export { ShardRegistryDO } from "${m(r).do}";
|
|
25
|
+
`:"",w=n=>{const r=new Map;for(const s of n){const a=r.get(s.cron);a?a.push(s):r.set(s.cron,[s])}const o=[...r.keys()].map(s=>` ${JSON.stringify(s)},`).join(`
|
|
26
|
+
`),e=o.length>0?`
|
|
27
|
+
${o}
|
|
28
|
+
`:"",t=[...r.entries()].map(([s,a])=>{const l=a.map(i=>{const h=i.workflow?`workflow: ${JSON.stringify(i.workflow.className)}`:`functionPath: ${JSON.stringify(i.functionPath)}`;return` { name: ${JSON.stringify(i.name)}, ${h}, args: ${JSON.stringify(i.args)} },`}).join(`
|
|
29
|
+
`);return` ${JSON.stringify(s)}: [
|
|
16
30
|
${l}
|
|
17
31
|
],`}).join(`
|
|
18
|
-
`),d=
|
|
19
|
-
${
|
|
32
|
+
`),d=t.length>0?`
|
|
33
|
+
${t}
|
|
20
34
|
`:"";return`${c}/**
|
|
21
35
|
* One scheduled cron invocation. Exactly one target is set: \`functionPath\` is
|
|
22
36
|
* the \`namespace:fn\` dispatch ref (matches \`__lunoraRef\`), invoked on the
|
|
23
|
-
* shard; \`workflow\` is a
|
|
37
|
+
* shard; \`workflow\` is a workflow class name (its \`ctx.exports\` key) whose durable workflow is
|
|
24
38
|
* started fresh per fire. \`args\` are forwarded verbatim (a workflow's become
|
|
25
39
|
* its \`params\`).
|
|
26
40
|
*/
|
|
@@ -42,9 +56,9 @@ export const LUNORA_CRON_TRIGGERS: ReadonlyArray<string> = [${e}];
|
|
|
42
56
|
* looks up \`event.cron\` here and dispatches every job in the list.
|
|
43
57
|
*/
|
|
44
58
|
export const LUNORA_CRONS: Record<string, ReadonlyArray<LunoraCronJob>> = {${d}};
|
|
45
|
-
`},
|
|
46
|
-
`),
|
|
47
|
-
${
|
|
59
|
+
`},S=n=>{const r=[...n].toSorted((e,t)=>e.name.localeCompare(t.name)).map(e=>{const t=[`name: ${JSON.stringify(e.name)}`,`table: ${JSON.stringify(e.table)}`];return e.field!==void 0&&t.push(`field: ${JSON.stringify(e.field)}`),e.dimensions!==void 0&&t.push(`dimensions: ${JSON.stringify(e.dimensions)}`),e.metric!==void 0&&t.push(`metric: ${JSON.stringify(e.metric)}`),e.metadata!==void 0&&t.push(`metadata: ${JSON.stringify(e.metadata)}`),` { ${t.join(", ")} },`}).join(`
|
|
60
|
+
`),o=r.length>0?`
|
|
61
|
+
${r}
|
|
48
62
|
`:"";return`${c}/**
|
|
49
63
|
* One vector index declared in \`schema.ts\` — an inline \`.vectorize()\` column
|
|
50
64
|
* or a standalone \`defineVectorIndex()\`. \`field\` is the source column (absent
|
|
@@ -65,5 +79,5 @@ export interface LunoraVectorIndex {
|
|
|
65
79
|
* Vectorize cannot enumerate indexes at runtime, so the worker passes this to
|
|
66
80
|
* \`createWorker({ vectorIntrospector })\` to back the studio's vector browser.
|
|
67
81
|
*/
|
|
68
|
-
export const LUNORA_VECTOR_INDEXES: ReadonlyArray<LunoraVectorIndex> = [${
|
|
69
|
-
`},
|
|
82
|
+
export const LUNORA_VECTOR_INDEXES: ReadonlyArray<LunoraVectorIndex> = [${o}];
|
|
83
|
+
`},R=n=>[...new Set(n.map(r=>r.cron))];export{w as emitCrons,u as emitScheduler,y as emitShardRegistry,S as emitVectors,R as emitWranglerCronTriggers};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{LunoraError as B}from"@lunora/errors";import{L as H,G as q,I as J,d as Q,r as G,b as z,c as x}from"./shared-DjUziztz.mjs";import{s as p}from"./paths-C-9fwEgQ.mjs";import{renderAgentFunctionRegistry as V,renderSandboxFunctionRegistry as W,groupByFileSorted as K}from"./emitApi-
|
|
1
|
+
import{LunoraError as B}from"@lunora/errors";import{L as H,G as q,I as J,d as Q,r as G,b as z,c as x}from"./shared-DjUziztz.mjs";import{s as p}from"./paths-C-9fwEgQ.mjs";import{renderAgentFunctionRegistry as V,renderSandboxFunctionRegistry as W,groupByFileSorted as K}from"./emitApi-DdW9RyGG.mjs";import{r as Y,a as X,b as O,c as Z}from"./qualifiers-BhOL15WZ.mjs";const ee=new Set(["any","bigint","boolean","date","id","null","number","storage","string","timestamp"]),A=n=>n.column!==void 0,te=(n,e)=>{switch(n){case"bigint":return`if (typeof ${e} !== "bigint") return DEFER;
|
|
2
2
|
`;case"boolean":return`if (typeof ${e} !== "boolean") return DEFER;
|
|
3
3
|
`;case"date":case"number":case"timestamp":return`if (typeof ${e} !== "number" || !Number.isFinite(${e})) return DEFER;
|
|
4
4
|
`;case"null":return`if (${e} !== null) return DEFER;
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import{LunoraError as Ie}from"@lunora/errors";import{S as $e}from"./capabilities-DJJWVEtk.mjs";import{a as
|
|
2
|
-
`:"",J=
|
|
3
|
-
readonly ai: LunoraAi;`:"",Y=
|
|
4
|
-
`:"",Z=
|
|
5
|
-
readonly payments: LunoraPayment;`:"",ee=
|
|
6
|
-
`:"",te=
|
|
1
|
+
import{LunoraError as Ie}from"@lunora/errors";import{S as $e}from"./capabilities-DJJWVEtk.mjs";import{a as R,G as Re,u as Be,d as Oe}from"./shared-DjUziztz.mjs";const De=(l,s=[])=>{const t=new Set;for(const a of l.tables)for(const o of Object.values(a.shape)){const i=Be(o);i.kind==="storage"&&typeof i.bucket=="string"&&i.bucket!==""&&t.add(i.bucket)}for(const a of s)a!==""&&a!=="default"&&t.add(a);return["default",...[...t].toSorted((a,o)=>a.localeCompare(o))]},Fe=({agents:l=[],containers:s=[],env:t,hasAccessFacade:a=!1,hasAi:o=!1,hasAnalytics:i=!1,hasBrowser:E=!1,hasVectors:P=!0,hasFlags:j=!1,hasHyperdrive:q=!1,hasImages:L=!1,hasKv:V=!1,hasNotify:G=!1,hasPayments:B=!1,hasPipelines:_=!1,hasR2sql:H=!1,hasX402:O=!1,identity:d,queues:y=[],schema:D,storageRuleBuckets:z=[],useUmbrella:U=!1,workflows:M=[]}={})=>{const r=Oe(U),K=De(D??{tables:[]},z).map(e=>JSON.stringify(e)).join(" | "),X=o?`import type { LunoraAi } from "@lunora/ai";
|
|
2
|
+
`:"",J=o?`
|
|
3
|
+
readonly ai: LunoraAi;`:"",Y=B?`import type { LunoraPayment } from "@lunora/payment";
|
|
4
|
+
`:"",Z=B?`
|
|
5
|
+
readonly payments: LunoraPayment;`:"",ee=O?`import type { X402Pay } from "@lunora/x402/pay";
|
|
6
|
+
`:"",te=O?`
|
|
7
7
|
readonly x402: X402Pay;`:"",ae=s.length>0?`import type { ContainerAccessor } from "@lunora/container";
|
|
8
8
|
`:"",re=s.length>0?`
|
|
9
9
|
readonly containers: {${s.map(e=>`
|
|
10
10
|
readonly ${e.exportName}: ContainerAccessor;`).join("")}
|
|
11
|
-
};`:"",
|
|
12
|
-
readonly ${e.bindingName}?: unknown;`)),...
|
|
13
|
-
readonly ${e.bindingName}?: unknown;`)),...m.map(e=>(c(e.bindingName,`queue binding "${e.bindingName}"`),` /** Queue producer binding for the \`${e.exportName}\` queue. */
|
|
14
|
-
readonly ${e.bindingName}?: unknown;`)),...l.map(e=>(c(e.bindingName,`agent binding "${e.bindingName}"`),` /** Workflow binding for the \`${e.exportName}\` agent. */
|
|
11
|
+
};`:"",A=[...o?[" /** Workers AI binding (the conventional `env.AI`), narrowing `ctx.ai`. */\n readonly AI?: unknown;"]:[],...s.map(e=>(R(e.bindingName,`container binding "${e.bindingName}"`),` /** Durable Object namespace for the \`${e.exportName}\` container. */
|
|
12
|
+
readonly ${e.bindingName}?: unknown;`)),...y.map(e=>(R(e.bindingName,`queue binding "${e.bindingName}"`),` /** Queue producer binding for the \`${e.exportName}\` queue. */
|
|
15
13
|
readonly ${e.bindingName}?: unknown;`))].join(`
|
|
16
|
-
`),
|
|
14
|
+
`),oe=`
|
|
17
15
|
|
|
18
16
|
/**
|
|
19
17
|
* This project's Cloudflare bindings, as far as codegen can discover them from
|
|
@@ -26,26 +24,26 @@ import{LunoraError as Ie}from"@lunora/errors";import{S as $e}from"./capabilities
|
|
|
26
24
|
* surface, so treat them as \`Fetcher\`/\`Service<unknown>\` and cast.
|
|
27
25
|
*/
|
|
28
26
|
export interface CloudflareBindings {
|
|
29
|
-
readonly [binding: string]: unknown;${
|
|
30
|
-
${
|
|
27
|
+
readonly [binding: string]: unknown;${A?`
|
|
28
|
+
${A}`:""}
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
/** Alias for {@link CloudflareBindings} — the typed shape of \`env\`. */
|
|
34
|
-
export type Env = CloudflareBindings;`,
|
|
35
|
-
readonly vectors: VectorSearch<VectorIndexName>;`:"",ce=
|
|
36
|
-
readonly vectors: VectorSearchReader<VectorIndexName>;`:"",ue=
|
|
32
|
+
export type Env = CloudflareBindings;`,n=(e,we,Q)=>{const p=$e.get(e);if(p!==void 0&&p.tier!==Q)throw new Ie("INTERNAL",`@lunora/codegen: capability "${e}" declares tier "${p.tier}" in SERVER_CTX_FIELDS but is emitted onto the "${Q}" context — update whichever is wrong.`);return we?p?.field??"":""},m=n("kv",V,"every"),b=n("analytics",i,"every"),ne=n("hyperdrive",q,"action"),se=n("browser",E,"action"),ie=n("images",L,"action"),de=n("pipelines",_,"action"),le=n("r2sql",H,"action"),c=P&&(D?.vectorIndexes.length??0)>0,h=c?' | "vectors"':"",C=c?`
|
|
33
|
+
readonly vectors: VectorSearch<VectorIndexName>;`:"",ce=c?`
|
|
34
|
+
readonly vectors: VectorSearchReader<VectorIndexName>;`:"",ue=c?`import type { VectorSearch, VectorSearchReader } from "${r.server}";
|
|
37
35
|
import type { VectorIndexName } from "./dataModel.js";
|
|
38
|
-
`:"",
|
|
36
|
+
`:"",f=a?`
|
|
39
37
|
/** Verified Cloudflare Access identity — a synchronous facade over the resolved claims (email / groups / hasGroup / claims). Anonymous when no Access token is present. */
|
|
40
|
-
readonly access: import("@lunora/cloudflare-access/context").AccessFacade;`:"",
|
|
38
|
+
readonly access: import("@lunora/cloudflare-access/context").AccessFacade;`:"",x=j?`
|
|
41
39
|
/** Feature-flag evaluation (OpenFeature). Reads are memoized per request; evaluations never throw — a provider error resolves to the supplied default. */
|
|
42
|
-
readonly flags: import("${r.flags}").LunoraFlags;`:"",
|
|
40
|
+
readonly flags: import("${r.flags}").LunoraFlags;`:"",g=G?`
|
|
43
41
|
/** Multi-channel notifications (@lunora/notify): send / chat / inApp / webhook plus the push device sub-facade. Sends are external I/O — confine them to action handlers. */
|
|
44
42
|
readonly notify: import("@lunora/notify").LunoraNotify;
|
|
45
43
|
/** Device push sub-facade — the same object as ctx.notify.push (register / send / broadcast). Sends belong in action handlers. */
|
|
46
|
-
readonly push: import("@lunora/notify").LunoraPush;`:"",
|
|
44
|
+
readonly push: import("@lunora/notify").LunoraPush;`:"",u=M.length>0,pe=u?`import type { WorkflowHandle } from "@lunora/workflow";
|
|
47
45
|
import type * as lunoraWorkflowDefinitions from "../workflows.js";
|
|
48
|
-
`:"",ye=
|
|
46
|
+
`:"",ye=u?`
|
|
49
47
|
|
|
50
48
|
/** Params type carried by a \`defineWorkflow\` definition (its phantom \`__params\`). */
|
|
51
49
|
type WorkflowParamsOf<Definition> = Definition extends { __params?: infer Params }
|
|
@@ -56,29 +54,29 @@ type WorkflowParamsOf<Definition> = Definition extends { __params?: infer Params
|
|
|
56
54
|
|
|
57
55
|
/** This project's declared workflows, addressable from \`ctx.workflows\` by their \`lunora/workflows.ts\` export name. */
|
|
58
56
|
export interface LunoraWorkflows {
|
|
59
|
-
${
|
|
57
|
+
${M.map(e=>` get(name: ${JSON.stringify(e.exportName)}): WorkflowHandle<WorkflowParamsOf<typeof lunoraWorkflowDefinitions.${e.exportName}>>;`).join(`
|
|
60
58
|
`)}
|
|
61
|
-
}`:"",
|
|
62
|
-
readonly workflows: LunoraWorkflows;`:"",
|
|
59
|
+
}`:"",N=u?' | "workflows"':"",F=u?`
|
|
60
|
+
readonly workflows: LunoraWorkflows;`:"",T=y.length>0,me=T?`import type { QueueProducer } from "@lunora/queue";
|
|
63
61
|
import type * as lunoraQueueDefinitions from "../queues.js";
|
|
64
|
-
`:"",be=
|
|
62
|
+
`:"",be=T?`
|
|
65
63
|
|
|
66
64
|
/** Message body type carried by a \`defineQueue\` definition (its phantom \`__lunoraBody\`). */
|
|
67
65
|
type QueueBodyOf<Definition> = Definition extends { __lunoraBody?: infer Body } ? (unknown extends Body ? unknown : NonNullable<Body>) : unknown;
|
|
68
66
|
|
|
69
67
|
/** This project's declared queues, addressable from \`ctx.queues\` by their \`lunora/queues.ts\` export name. */
|
|
70
68
|
export interface LunoraQueues {
|
|
71
|
-
${
|
|
69
|
+
${y.map(e=>` readonly ${e.exportName}: QueueProducer<QueueBodyOf<typeof lunoraQueueDefinitions.${e.exportName}>>;`).join(`
|
|
72
70
|
`)}
|
|
73
|
-
}`:"",S=
|
|
74
|
-
readonly queues: LunoraQueues;`:"",
|
|
75
|
-
`:"",fe=
|
|
71
|
+
}`:"",S=T?`
|
|
72
|
+
readonly queues: LunoraQueues;`:"",v=l.length>0,he=v?`import type { AgentHandle } from "@lunora/agent";
|
|
73
|
+
`:"",fe=v?`
|
|
76
74
|
|
|
77
75
|
/** This project's declared agents, addressable from \`ctx.agents\` by their \`lunora/agents.ts\` export name. */
|
|
78
76
|
export interface LunoraAgents {
|
|
79
|
-
${l.map(e=>(
|
|
77
|
+
${l.map(e=>(R(e.exportName,`agent export "${e.exportName}"`),` readonly ${e.exportName}: AgentHandle;`)).join(`
|
|
80
78
|
`)}
|
|
81
|
-
}`:"",W=
|
|
79
|
+
}`:"",W=v?`
|
|
82
80
|
readonly agents: LunoraAgents;`:"",xe=d?`import type { InferIdentity } from "${r.server}";
|
|
83
81
|
import type * as lunoraIdentityContract from "../identity.js";
|
|
84
82
|
`:"",ge=d?`
|
|
@@ -87,12 +85,12 @@ import type * as lunoraIdentityContract from "../identity.js";
|
|
|
87
85
|
export type Identity = InferIdentity<typeof lunoraIdentityContract.${d.exportName}>;
|
|
88
86
|
|
|
89
87
|
/** \`ctx.auth\` narrowed so \`getIdentity()\` resolves the declared {@link Identity} contract instead of the untyped claim bag. */
|
|
90
|
-
type NarrowedAuth = Omit<QueryCtxBase["auth"], "getIdentity"> & { getIdentity: () => Promise<Identity | null> };`:"",
|
|
88
|
+
type NarrowedAuth = Omit<QueryCtxBase["auth"], "getIdentity"> & { getIdentity: () => Promise<Identity | null> };`:"",k=d?' | "auth"':"",w=d?`
|
|
91
89
|
readonly auth: NarrowedAuth;`:"",Te=d?", Identity":"",ve=t?`import type * as lunoraEnvContract from "../env.js";
|
|
92
90
|
`:"",ke=t?`
|
|
93
91
|
|
|
94
92
|
/** This app's declared env contract (\`defineEnv\` in \`lunora/env.ts\`) — the validated, coercion-aware shape of \`ctx.env\`. */
|
|
95
|
-
export type LunoraEnv = ReturnType<typeof lunoraEnvContract.${t.exportName}>;`:"",
|
|
93
|
+
export type LunoraEnv = ReturnType<typeof lunoraEnvContract.${t.exportName}>;`:"",I=t?' | "env"':"",$=t?"\n /** Validated, typed environment declared by `defineEnv` in `lunora/env.ts` — parsed & coercion-aware config values (`ctx.env.STRIPE_KEY`); a missing or invalid value throws at read time. */\n readonly env: LunoraEnv;":"";return`${Re}import { createPolicyDsl, defineMutator as defineMutatorBase, initLunora, v as vBase } from "${r.server}";
|
|
96
94
|
import type {
|
|
97
95
|
ActionBuilder,
|
|
98
96
|
ActionCtx as ActionCtxBase,
|
|
@@ -209,7 +207,7 @@ export interface OrmWriter extends OrmReader {
|
|
|
209
207
|
}
|
|
210
208
|
|
|
211
209
|
/** Storage buckets this schema declares (\`v.storage("name")\`), narrowing \`ctx.storage.bucket(name)\`. */
|
|
212
|
-
export type StorageBucketName = ${K};${
|
|
210
|
+
export type StorageBucketName = ${K};${oe}${ye}${be}${fe}${ge}${ke}
|
|
213
211
|
|
|
214
212
|
/**
|
|
215
213
|
* Project-typed contexts. The base contexts from \`@lunora/server\` are
|
|
@@ -272,22 +270,22 @@ type AsIdTable<T extends string> = T extends TableName ? T : string extends T ?
|
|
|
272
270
|
*/
|
|
273
271
|
type TypedAsId = <T extends string>(tableName: AsIdTable<T>, id: string) => IdOfTable<T & TableName>;
|
|
274
272
|
|
|
275
|
-
export interface QueryCtx extends Omit<QueryCtxBase, "db" | "storage"${
|
|
273
|
+
export interface QueryCtx extends Omit<QueryCtxBase, "db" | "storage"${h}${k}${I}> {
|
|
276
274
|
readonly db: Omit<DatabaseReader, "asId" | "query" | "get"> & DatabaseReaderFacade & { asId: TypedAsId; query: TypedTableQuery; get: TypedTableGet };
|
|
277
275
|
readonly orm: OrmReader;
|
|
278
|
-
readonly storage: ReadOnlyStorage<StorageBucketName>;${ce}${
|
|
276
|
+
readonly storage: ReadOnlyStorage<StorageBucketName>;${ce}${f}${m}${x}${g}${b}${$}${w}
|
|
279
277
|
}
|
|
280
278
|
|
|
281
|
-
export interface MutationCtx extends Omit<MutationCtxBase, "db" | "storage"${
|
|
279
|
+
export interface MutationCtx extends Omit<MutationCtxBase, "db" | "storage"${h}${N}${k}${I}> {
|
|
282
280
|
readonly db: Omit<DatabaseWriter, "asId" | "query" | "get"> & DatabaseWriterFacade & { asId: TypedAsId; query: TypedTableQuery; get: TypedTableGet };
|
|
283
281
|
readonly orm: OrmWriter;
|
|
284
|
-
readonly storage: MutationStorage<StorageBucketName>;${
|
|
282
|
+
readonly storage: MutationStorage<StorageBucketName>;${C}${f}${m}${x}${g}${b}${$}${F}${S}${W}${w}
|
|
285
283
|
}
|
|
286
284
|
|
|
287
|
-
export interface ActionCtx extends Omit<ActionCtxBase, "db" | "storage"${
|
|
285
|
+
export interface ActionCtx extends Omit<ActionCtxBase, "db" | "storage"${h}${N}${k}${I}> {
|
|
288
286
|
readonly db: Omit<DatabaseWriter, "asId" | "query" | "get"> & DatabaseWriterFacade & { asId: TypedAsId; query: TypedTableQuery; get: TypedTableGet };
|
|
289
287
|
readonly orm: OrmWriter;
|
|
290
|
-
readonly storage: StorageBase<StorageBucketName>;${
|
|
288
|
+
readonly storage: StorageBase<StorageBucketName>;${C}${f}${J}${Z}${te}${re}${m}${x}${g}${ne}${se}${ie}${b}${de}${le}${$}${F}${S}${W}${w}
|
|
291
289
|
}
|
|
292
290
|
|
|
293
291
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./SCHEMA_SNAPSHOT_VERSION-C0oHwiJZ.mjs";import"./isD1GlobalTable-udvHAAzD.mjs";import"./ir-BgM8A3XV.mjs";import"./json-data-Chfs2Cz5.mjs";import{e as f}from"./shard-CCNl561P.mjs";import"./shard-runtime-B7xvdFPc.mjs";import"./shared-DjUziztz.mjs";export{f as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=d=>typeof d.shardMode=="object"&&d.shardMode.kind==="shardBy";export{o as i};
|