@lunora/runtime 1.0.0-alpha.5 → 1.0.0-alpha.6

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 CHANGED
@@ -2087,6 +2087,61 @@ type FrameworkWorkerOptionsInput = ((env: unknown) => FrameworkWorkerOptions) |
2087
2087
  * @param optionsInput Lunora options minus `httpRouter`, or an `(env) => options` factory.
2088
2088
  */
2089
2089
  declare const withFrameworkWorker: (host: FrameworkHostHandler, optionsInput: FrameworkWorkerOptionsInput) => LunoraWorker;
2090
+ /**
2091
+ * Options for {@link createLunoraHandler}. Either an `(env) => options` factory
2092
+ * (full control — for bindings that only exist at request time), or a partial
2093
+ * {@link FrameworkWorkerOptions} object whose `shardDO` defaults to the
2094
+ * conventional `env.SHARD` binding. Pass nothing for the common case.
2095
+ */
2096
+ type LunoraHandlerOptions = ((env: unknown) => FrameworkWorkerOptions) | Partial<FrameworkWorkerOptions>;
2097
+ /**
2098
+ * No-op `ExecutionContext` used when the host runtime didn't supply one (a
2099
+ * non-Cloudflare preview, or a unit test), so the worker's `fetch` always
2100
+ * receives a valid third argument.
2101
+ */
2102
+ declare const NOOP_EXECUTION_CONTEXT: ExecutionContextLike;
2103
+ /**
2104
+ * Resolve per-request Lunora worker options. A factory is called with the
2105
+ * request `env`; a partial object has its `shardDO` defaulted to `env.SHARD` so
2106
+ * the common case needs no configuration. Throws a clear error when no shard
2107
+ * namespace can be found — a wiring mistake, not a runtime condition to swallow.
2108
+ */
2109
+ declare const resolveLunoraOptions: (options: LunoraHandlerOptions, env: unknown) => FrameworkWorkerOptions;
2110
+ /**
2111
+ * Build a framework-neutral request handler for Lunora's realtime plane
2112
+ * (`/_lunora/rpc`, `/_lunora/ws`, `/_lunora/admin/*`). This is the **one shared
2113
+ * seam** every web-standard framework integration mounts — Hono, Nitro/h3,
2114
+ * Elysia, or any WinterCG host running on Cloudflare Workers — so each is a
2115
+ * 1–2 line bridge (`(request, env, ctx) => Response`) rather than a bespoke
2116
+ * adapter package.
2117
+ *
2118
+ * Mount it under `/_lunora/*` (or whatever path you reserve) inside your app's
2119
+ * router; everything else stays your framework's. The host supplies, per
2120
+ * request: a Web `Request`, the Cloudflare `env` (carrying the `SHARD` Durable
2121
+ * Object namespace), and — when available — the `ExecutionContext`. The
2122
+ * `101 Switching Protocols` WebSocket-upgrade `Response` (with its `webSocket`)
2123
+ * is returned verbatim, so the framework streams the socket through unchanged.
2124
+ *
2125
+ * ```ts
2126
+ * // Hono
2127
+ * const lunora = createLunoraHandler();
2128
+ * app.use("/_lunora/*", (c) => lunora(c.req.raw, c.env, c.executionCtx));
2129
+ *
2130
+ * // Nitro / h3
2131
+ * const lunora = createLunoraHandler();
2132
+ * export default defineEventHandler((event) => {
2133
+ * const { ctx, env } = event.context.cloudflare;
2134
+ * return lunora(toWebRequest(event), env, ctx);
2135
+ * });
2136
+ * ```
2137
+ *
2138
+ * `shardDO` defaults to `env.SHARD`; pass `options` (or an `(env) => options`
2139
+ * factory) to add `auth`, `crons`, a `security` posture, or a custom namespace.
2140
+ * A new worker is composed per request because the options (and the `SHARD`
2141
+ * binding they default from) are only known once `env` arrives.
2142
+ * @param options Partial worker options (default `shardDO: env.SHARD`), or an `(env) => options` factory.
2143
+ */
2144
+ declare const createLunoraHandler: (options?: LunoraHandlerOptions) => ((request: Request, env: unknown, context?: ExecutionContextLike) => Promise<Response>);
2090
2145
  /** Re-exported helper so callers can roundtrip envelopes in tests. */
2091
2146
  declare const defineRpcEnvelope: (envelope: RpcEnvelope) => RpcEnvelope;
2092
2147
  /**
@@ -2330,4 +2385,4 @@ declare const analyticsEngineSink: (options: AnalyticsEngineSinkOptions) => Obse
2330
2385
  */
2331
2386
  declare const combineSinks: (...sinks: ObservabilitySink[]) => ObservabilitySink;
2332
2387
  declare const VERSION: string;
2333
- export { type AdminTableResolver, type AirbyteMessage, type AnalyticsEngineDataPointLike, type AnalyticsEngineDatasetLike, type AnalyticsEngineSinkOptions, type AuthAdmin, type AuthCapabilities, type AuthImpersonation, type AuthIntrospector, type AuthPage, type AuthSession, type AuthUser, type BackupManifest, type BackupStore, type ConnectorChange, type ConnectorSyncPage, type CorsOptions, type CronHandler, type CronJobDispatch, type CronJobInfo, type CrossShardCounter, type CrossShardReader, type CrossShardRelationCapabilities, type CrossShardRelationOptions, type CsrfOptions, DEFAULT_REGISTRY_CACHE_TTL_MS, type DurableObjectJurisdiction, type DynamicShardRegistry, type DynamicShardRegistryOptions, type ExecutionContextLike, type ExportFanOutRequest, type ExportFanOutResult, type FanOutRequest, type FanOutResult, type FanOutSpec, type FivetranResponse, type FrameworkHostHandler, type FrameworkWorkerOptions, type FrameworkWorkerOptionsInput, type FunctionDescriptor, type FunctionRegistryEntry, type FunctionRegistryLike, type GlobalExportFunction as GlobalExportFn, type GlobalImportFunction as GlobalImportFn, type GlobalIntrospector, type GlobalTableInfo as GlobalTableInfoMeta, type GlobalTablePage as GlobalTablePageMeta, type HttpActionContext, type HttpActionLike, type HttpRouterLike, type ImportFanOutRequest, type ImportFanOutResult, type ListAuthUsersOptions, type LogEvent, type LogLevel, LunoraError, type LunoraErrorBody, type LunoraWorker, type MergeStrategy, type MigrationFanOutRequest, type MigrationFanOutResult, type ObservabilityEvent, type ObservabilitySink, type ObservabilitySinkContext, type QueryCoordinator, type QueryCoordinatorOptions, type RankFanOutRequest, type RankFanOutResult, type RankPageFanOutRequest, type RankPageFanOutResult, type ResolvedSecurity, type ResolvedShard, type Route, type RpcContext, type RpcEnvelope, SHARD_REGISTRY_DO_NAME, type ScheduledControllerLike, type SecurityHeadersOptions, type SecurityOptions, type SentrySinkOptions, type ShardError, type ShardExportOutcome, type ShardImportOutcome, type ShardMigrationOutcome, type ShardNamespaceLike, type ShardRankOutcome, type ShardRankPageOutcome, type ShardRegistry, type ShardTrafficEntry, type ShardTrafficFanOutRequest, type ShardTrafficFanOutResult, type ShardingInfo, type StorageListFunction as StorageListFn, type StorageObject, VERSION, type VectorIndexSummary, type VectorIntrospector, type VectorQueryMatch, type WebhookSinkOptions, type WorkerOptions, analyticsEngineSink, applyJurisdiction, combineSinks, composeWorker, consoleSink, createCrossShardRelationCapabilities, createDynamicShardRegistry, createQueryCoordinator, createStaticShardRegistry, createWorker, decorateResponse, defineRpcEnvelope, emitLogEvent, emitRpcEvent, enforceOrigin, handleCorsPreflight, mergeStrategyForAggregate, resolveSecurity, resolveShard, sentrySink, toAirbyteMessages, toErrorResponse, toFivetranResponse, webhookSink, withFrameworkWorker };
2388
+ export { type AdminTableResolver, type AirbyteMessage, type AnalyticsEngineDataPointLike, type AnalyticsEngineDatasetLike, type AnalyticsEngineSinkOptions, type AuthAdmin, type AuthCapabilities, type AuthImpersonation, type AuthIntrospector, type AuthPage, type AuthSession, type AuthUser, type BackupManifest, type BackupStore, type ConnectorChange, type ConnectorSyncPage, type CorsOptions, type CronHandler, type CronJobDispatch, type CronJobInfo, type CrossShardCounter, type CrossShardReader, type CrossShardRelationCapabilities, type CrossShardRelationOptions, type CsrfOptions, DEFAULT_REGISTRY_CACHE_TTL_MS, type DurableObjectJurisdiction, type DynamicShardRegistry, type DynamicShardRegistryOptions, type ExecutionContextLike, type ExportFanOutRequest, type ExportFanOutResult, type FanOutRequest, type FanOutResult, type FanOutSpec, type FivetranResponse, type FrameworkHostHandler, type FrameworkWorkerOptions, type FrameworkWorkerOptionsInput, type FunctionDescriptor, type FunctionRegistryEntry, type FunctionRegistryLike, type GlobalExportFunction as GlobalExportFn, type GlobalImportFunction as GlobalImportFn, type GlobalIntrospector, type GlobalTableInfo as GlobalTableInfoMeta, type GlobalTablePage as GlobalTablePageMeta, type HttpActionContext, type HttpActionLike, type HttpRouterLike, type ImportFanOutRequest, type ImportFanOutResult, type ListAuthUsersOptions, type LogEvent, type LogLevel, LunoraError, type LunoraErrorBody, type LunoraHandlerOptions, type LunoraWorker, type MergeStrategy, type MigrationFanOutRequest, type MigrationFanOutResult, NOOP_EXECUTION_CONTEXT, type ObservabilityEvent, type ObservabilitySink, type ObservabilitySinkContext, type QueryCoordinator, type QueryCoordinatorOptions, type RankFanOutRequest, type RankFanOutResult, type RankPageFanOutRequest, type RankPageFanOutResult, type ResolvedSecurity, type ResolvedShard, type Route, type RpcContext, type RpcEnvelope, SHARD_REGISTRY_DO_NAME, type ScheduledControllerLike, type SecurityHeadersOptions, type SecurityOptions, type SentrySinkOptions, type ShardError, type ShardExportOutcome, type ShardImportOutcome, type ShardMigrationOutcome, type ShardNamespaceLike, type ShardRankOutcome, type ShardRankPageOutcome, type ShardRegistry, type ShardTrafficEntry, type ShardTrafficFanOutRequest, type ShardTrafficFanOutResult, type ShardingInfo, type StorageListFunction as StorageListFn, type StorageObject, VERSION, type VectorIndexSummary, type VectorIntrospector, type VectorQueryMatch, type WebhookSinkOptions, type WorkerOptions, analyticsEngineSink, applyJurisdiction, combineSinks, composeWorker, consoleSink, createCrossShardRelationCapabilities, createDynamicShardRegistry, createLunoraHandler, createQueryCoordinator, createStaticShardRegistry, createWorker, decorateResponse, defineRpcEnvelope, emitLogEvent, emitRpcEvent, enforceOrigin, handleCorsPreflight, mergeStrategyForAggregate, resolveLunoraOptions, resolveSecurity, resolveShard, sentrySink, toAirbyteMessages, toErrorResponse, toFivetranResponse, webhookSink, withFrameworkWorker };
package/dist/index.d.ts CHANGED
@@ -2087,6 +2087,61 @@ type FrameworkWorkerOptionsInput = ((env: unknown) => FrameworkWorkerOptions) |
2087
2087
  * @param optionsInput Lunora options minus `httpRouter`, or an `(env) => options` factory.
2088
2088
  */
2089
2089
  declare const withFrameworkWorker: (host: FrameworkHostHandler, optionsInput: FrameworkWorkerOptionsInput) => LunoraWorker;
2090
+ /**
2091
+ * Options for {@link createLunoraHandler}. Either an `(env) => options` factory
2092
+ * (full control — for bindings that only exist at request time), or a partial
2093
+ * {@link FrameworkWorkerOptions} object whose `shardDO` defaults to the
2094
+ * conventional `env.SHARD` binding. Pass nothing for the common case.
2095
+ */
2096
+ type LunoraHandlerOptions = ((env: unknown) => FrameworkWorkerOptions) | Partial<FrameworkWorkerOptions>;
2097
+ /**
2098
+ * No-op `ExecutionContext` used when the host runtime didn't supply one (a
2099
+ * non-Cloudflare preview, or a unit test), so the worker's `fetch` always
2100
+ * receives a valid third argument.
2101
+ */
2102
+ declare const NOOP_EXECUTION_CONTEXT: ExecutionContextLike;
2103
+ /**
2104
+ * Resolve per-request Lunora worker options. A factory is called with the
2105
+ * request `env`; a partial object has its `shardDO` defaulted to `env.SHARD` so
2106
+ * the common case needs no configuration. Throws a clear error when no shard
2107
+ * namespace can be found — a wiring mistake, not a runtime condition to swallow.
2108
+ */
2109
+ declare const resolveLunoraOptions: (options: LunoraHandlerOptions, env: unknown) => FrameworkWorkerOptions;
2110
+ /**
2111
+ * Build a framework-neutral request handler for Lunora's realtime plane
2112
+ * (`/_lunora/rpc`, `/_lunora/ws`, `/_lunora/admin/*`). This is the **one shared
2113
+ * seam** every web-standard framework integration mounts — Hono, Nitro/h3,
2114
+ * Elysia, or any WinterCG host running on Cloudflare Workers — so each is a
2115
+ * 1–2 line bridge (`(request, env, ctx) => Response`) rather than a bespoke
2116
+ * adapter package.
2117
+ *
2118
+ * Mount it under `/_lunora/*` (or whatever path you reserve) inside your app's
2119
+ * router; everything else stays your framework's. The host supplies, per
2120
+ * request: a Web `Request`, the Cloudflare `env` (carrying the `SHARD` Durable
2121
+ * Object namespace), and — when available — the `ExecutionContext`. The
2122
+ * `101 Switching Protocols` WebSocket-upgrade `Response` (with its `webSocket`)
2123
+ * is returned verbatim, so the framework streams the socket through unchanged.
2124
+ *
2125
+ * ```ts
2126
+ * // Hono
2127
+ * const lunora = createLunoraHandler();
2128
+ * app.use("/_lunora/*", (c) => lunora(c.req.raw, c.env, c.executionCtx));
2129
+ *
2130
+ * // Nitro / h3
2131
+ * const lunora = createLunoraHandler();
2132
+ * export default defineEventHandler((event) => {
2133
+ * const { ctx, env } = event.context.cloudflare;
2134
+ * return lunora(toWebRequest(event), env, ctx);
2135
+ * });
2136
+ * ```
2137
+ *
2138
+ * `shardDO` defaults to `env.SHARD`; pass `options` (or an `(env) => options`
2139
+ * factory) to add `auth`, `crons`, a `security` posture, or a custom namespace.
2140
+ * A new worker is composed per request because the options (and the `SHARD`
2141
+ * binding they default from) are only known once `env` arrives.
2142
+ * @param options Partial worker options (default `shardDO: env.SHARD`), or an `(env) => options` factory.
2143
+ */
2144
+ declare const createLunoraHandler: (options?: LunoraHandlerOptions) => ((request: Request, env: unknown, context?: ExecutionContextLike) => Promise<Response>);
2090
2145
  /** Re-exported helper so callers can roundtrip envelopes in tests. */
2091
2146
  declare const defineRpcEnvelope: (envelope: RpcEnvelope) => RpcEnvelope;
2092
2147
  /**
@@ -2330,4 +2385,4 @@ declare const analyticsEngineSink: (options: AnalyticsEngineSinkOptions) => Obse
2330
2385
  */
2331
2386
  declare const combineSinks: (...sinks: ObservabilitySink[]) => ObservabilitySink;
2332
2387
  declare const VERSION: string;
2333
- export { type AdminTableResolver, type AirbyteMessage, type AnalyticsEngineDataPointLike, type AnalyticsEngineDatasetLike, type AnalyticsEngineSinkOptions, type AuthAdmin, type AuthCapabilities, type AuthImpersonation, type AuthIntrospector, type AuthPage, type AuthSession, type AuthUser, type BackupManifest, type BackupStore, type ConnectorChange, type ConnectorSyncPage, type CorsOptions, type CronHandler, type CronJobDispatch, type CronJobInfo, type CrossShardCounter, type CrossShardReader, type CrossShardRelationCapabilities, type CrossShardRelationOptions, type CsrfOptions, DEFAULT_REGISTRY_CACHE_TTL_MS, type DurableObjectJurisdiction, type DynamicShardRegistry, type DynamicShardRegistryOptions, type ExecutionContextLike, type ExportFanOutRequest, type ExportFanOutResult, type FanOutRequest, type FanOutResult, type FanOutSpec, type FivetranResponse, type FrameworkHostHandler, type FrameworkWorkerOptions, type FrameworkWorkerOptionsInput, type FunctionDescriptor, type FunctionRegistryEntry, type FunctionRegistryLike, type GlobalExportFunction as GlobalExportFn, type GlobalImportFunction as GlobalImportFn, type GlobalIntrospector, type GlobalTableInfo as GlobalTableInfoMeta, type GlobalTablePage as GlobalTablePageMeta, type HttpActionContext, type HttpActionLike, type HttpRouterLike, type ImportFanOutRequest, type ImportFanOutResult, type ListAuthUsersOptions, type LogEvent, type LogLevel, LunoraError, type LunoraErrorBody, type LunoraWorker, type MergeStrategy, type MigrationFanOutRequest, type MigrationFanOutResult, type ObservabilityEvent, type ObservabilitySink, type ObservabilitySinkContext, type QueryCoordinator, type QueryCoordinatorOptions, type RankFanOutRequest, type RankFanOutResult, type RankPageFanOutRequest, type RankPageFanOutResult, type ResolvedSecurity, type ResolvedShard, type Route, type RpcContext, type RpcEnvelope, SHARD_REGISTRY_DO_NAME, type ScheduledControllerLike, type SecurityHeadersOptions, type SecurityOptions, type SentrySinkOptions, type ShardError, type ShardExportOutcome, type ShardImportOutcome, type ShardMigrationOutcome, type ShardNamespaceLike, type ShardRankOutcome, type ShardRankPageOutcome, type ShardRegistry, type ShardTrafficEntry, type ShardTrafficFanOutRequest, type ShardTrafficFanOutResult, type ShardingInfo, type StorageListFunction as StorageListFn, type StorageObject, VERSION, type VectorIndexSummary, type VectorIntrospector, type VectorQueryMatch, type WebhookSinkOptions, type WorkerOptions, analyticsEngineSink, applyJurisdiction, combineSinks, composeWorker, consoleSink, createCrossShardRelationCapabilities, createDynamicShardRegistry, createQueryCoordinator, createStaticShardRegistry, createWorker, decorateResponse, defineRpcEnvelope, emitLogEvent, emitRpcEvent, enforceOrigin, handleCorsPreflight, mergeStrategyForAggregate, resolveSecurity, resolveShard, sentrySink, toAirbyteMessages, toErrorResponse, toFivetranResponse, webhookSink, withFrameworkWorker };
2388
+ export { type AdminTableResolver, type AirbyteMessage, type AnalyticsEngineDataPointLike, type AnalyticsEngineDatasetLike, type AnalyticsEngineSinkOptions, type AuthAdmin, type AuthCapabilities, type AuthImpersonation, type AuthIntrospector, type AuthPage, type AuthSession, type AuthUser, type BackupManifest, type BackupStore, type ConnectorChange, type ConnectorSyncPage, type CorsOptions, type CronHandler, type CronJobDispatch, type CronJobInfo, type CrossShardCounter, type CrossShardReader, type CrossShardRelationCapabilities, type CrossShardRelationOptions, type CsrfOptions, DEFAULT_REGISTRY_CACHE_TTL_MS, type DurableObjectJurisdiction, type DynamicShardRegistry, type DynamicShardRegistryOptions, type ExecutionContextLike, type ExportFanOutRequest, type ExportFanOutResult, type FanOutRequest, type FanOutResult, type FanOutSpec, type FivetranResponse, type FrameworkHostHandler, type FrameworkWorkerOptions, type FrameworkWorkerOptionsInput, type FunctionDescriptor, type FunctionRegistryEntry, type FunctionRegistryLike, type GlobalExportFunction as GlobalExportFn, type GlobalImportFunction as GlobalImportFn, type GlobalIntrospector, type GlobalTableInfo as GlobalTableInfoMeta, type GlobalTablePage as GlobalTablePageMeta, type HttpActionContext, type HttpActionLike, type HttpRouterLike, type ImportFanOutRequest, type ImportFanOutResult, type ListAuthUsersOptions, type LogEvent, type LogLevel, LunoraError, type LunoraErrorBody, type LunoraHandlerOptions, type LunoraWorker, type MergeStrategy, type MigrationFanOutRequest, type MigrationFanOutResult, NOOP_EXECUTION_CONTEXT, type ObservabilityEvent, type ObservabilitySink, type ObservabilitySinkContext, type QueryCoordinator, type QueryCoordinatorOptions, type RankFanOutRequest, type RankFanOutResult, type RankPageFanOutRequest, type RankPageFanOutResult, type ResolvedSecurity, type ResolvedShard, type Route, type RpcContext, type RpcEnvelope, SHARD_REGISTRY_DO_NAME, type ScheduledControllerLike, type SecurityHeadersOptions, type SecurityOptions, type SentrySinkOptions, type ShardError, type ShardExportOutcome, type ShardImportOutcome, type ShardMigrationOutcome, type ShardNamespaceLike, type ShardRankOutcome, type ShardRankPageOutcome, type ShardRegistry, type ShardTrafficEntry, type ShardTrafficFanOutRequest, type ShardTrafficFanOutResult, type ShardingInfo, type StorageListFunction as StorageListFn, type StorageObject, VERSION, type VectorIndexSummary, type VectorIntrospector, type VectorQueryMatch, type WebhookSinkOptions, type WorkerOptions, analyticsEngineSink, applyJurisdiction, combineSinks, composeWorker, consoleSink, createCrossShardRelationCapabilities, createDynamicShardRegistry, createLunoraHandler, createQueryCoordinator, createStaticShardRegistry, createWorker, decorateResponse, defineRpcEnvelope, emitLogEvent, emitRpcEvent, enforceOrigin, handleCorsPreflight, mergeStrategyForAggregate, resolveLunoraOptions, resolveSecurity, resolveShard, sentrySink, toAirbyteMessages, toErrorResponse, toFivetranResponse, webhookSink, withFrameworkWorker };
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  export { toAirbyteMessages, toFivetranResponse } from './packem_shared/toAirbyteMessages-DrHdplb4.mjs';
2
- export { composeWorker, createWorker, defineRpcEnvelope, withFrameworkWorker } from './packem_shared/composeWorker-49Hxp9Ho.mjs';
2
+ export { NOOP_EXECUTION_CONTEXT, composeWorker, createLunoraHandler, createWorker, defineRpcEnvelope, resolveLunoraOptions, withFrameworkWorker } from './packem_shared/NOOP_EXECUTION_CONTEXT-Rns-X7RV.mjs';
3
3
  export { createCrossShardRelationCapabilities } from './packem_shared/createCrossShardRelationCapabilities-C0KOf7er.mjs';
4
4
  export { DEFAULT_REGISTRY_CACHE_TTL_MS, SHARD_REGISTRY_DO_NAME, createDynamicShardRegistry } from './packem_shared/DEFAULT_REGISTRY_CACHE_TTL_MS-ocax8v0n.mjs';
5
5
  export { LunoraError, toErrorResponse } from './packem_shared/LunoraError-CL0aOtpo.mjs';
@@ -2505,6 +2505,25 @@ const withFrameworkWorker = (host, optionsInput) => {
2505
2505
  serverQuery: (request, env, reference, args, options) => build(optionsFactory(env)).serverQuery(request, env, reference, args, options)
2506
2506
  };
2507
2507
  };
2508
+ const NOOP_EXECUTION_CONTEXT = {
2509
+ passThroughOnException: () => {
2510
+ },
2511
+ waitUntil: () => {
2512
+ }
2513
+ };
2514
+ const resolveLunoraOptions = (options, env) => {
2515
+ if (typeof options === "function") {
2516
+ return options(env);
2517
+ }
2518
+ const shardDO = options.shardDO ?? env?.SHARD;
2519
+ if (!shardDO) {
2520
+ throw new Error(
2521
+ "@lunora/runtime: no shard Durable Object namespace found. Bind `SHARD` in wrangler.jsonc, or pass `createLunoraHandler({ shardDO: env.MY_SHARD })`."
2522
+ );
2523
+ }
2524
+ return { ...options, shardDO };
2525
+ };
2526
+ const createLunoraHandler = (options = {}) => (request, env, context) => createWorker(resolveLunoraOptions(options, env)).fetch(request, env, context ?? NOOP_EXECUTION_CONTEXT);
2508
2527
  const defineRpcEnvelope = (envelope) => envelope;
2509
2528
 
2510
- export { composeWorker, createWorker, defineRpcEnvelope, withFrameworkWorker };
2529
+ export { NOOP_EXECUTION_CONTEXT, composeWorker, createLunoraHandler, createWorker, defineRpcEnvelope, resolveLunoraOptions, withFrameworkWorker };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/runtime",
3
- "version": "1.0.0-alpha.5",
3
+ "version": "1.0.0-alpha.6",
4
4
  "description": "Lunora Worker runtime: the RPC router, shard resolver, and query coordinator",
5
5
  "keywords": [
6
6
  "cloudflare",