@lunora/client 1.0.0-alpha.51 → 1.0.0-alpha.52

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.
@@ -1,4 +1,4 @@
1
- import { L as LunoraClient } from "../packem_shared/lunora-client.d-BOmxvSrG.mjs";
1
+ import { L as LunoraClient } from "../packem_shared/lunora-client.d-DQ8j9RKD.mjs";
2
2
  import { U as User } from "../packem_shared/types.d-CsuRAQvb.mjs";
3
3
  import '@lunora/runtime';
4
4
  interface IdentityStore {
@@ -1,4 +1,4 @@
1
- import { L as LunoraClient } from "../packem_shared/lunora-client.d-K16SL8Tj.js";
1
+ import { L as LunoraClient } from "../packem_shared/lunora-client.d-BaB4zz9g.js";
2
2
  import { U as User } from "../packem_shared/types.d-CsuRAQvb.js";
3
3
  import '@lunora/runtime';
4
4
  interface IdentityStore {
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
- import { o as PersistenceAdapter, B as BookmarkStorage, H as HttpStreamRef, m as HttpStreamArgsOf, n as HttpStreamChunkOf, F as FunctionReference, A as ArgsOf, R as ReturnOf, O as OfflineQueueOptions, Q as QueryCacheAdapter, p as ReconnectOptions } from "./packem_shared/types.d-CsuRAQvb.mjs";
2
- export type { C as CachedQuery, q as ClientMessage, r as ClientShapeSubscribeMessage, s as ClientShapeUnsubscribeMessage, t as FunctionArgumentDescriptor, h as FunctionDescriptor, l as GlobalFacetResult, u as GlobalFacetValue, j as GlobalFilterClause, G as GlobalTableInfo, k as GlobalTablePage, v as HttpStreamCallArgs, L as LunoraClientOptions, w as OutboxMutation, x as OutboxSink, y as PersistedMutation, P as Preloaded, z as RowOp, D as RpcEnvelope, E as RpcResponseBody, b as ScheduleRecord, I as SchedulerPoolStatus, c as SchedulerStatus, J as ServerMessage, K as ServerPokeEndMessage, M as ServerPokePartMessage, N as ServerPokeStartMessage, T as ShardTrafficEntry, S as ShardTrafficResult, i as StorageListPage, V as StorageObject, a as Unsubscribe, U as User, g as WorkflowInstanceAction, f as WorkflowInstanceDetail, e as WorkflowInstancePage, d as WorkflowInstanceStatus, X as WorkflowInstanceSummary, Y as WorkflowStepDetail, W as WsTokenProvider } from "./packem_shared/types.d-CsuRAQvb.mjs";
3
- import { C as ConnectionStatus, S as SubscriptionError, b as StreamIterable, M as MutationCallOptions, L as LunoraClient } from "./packem_shared/lunora-client.d-BOmxvSrG.mjs";
4
- export { type B as BatchSlot, c as CONFLICT_ERROR_CODE, type d as ClientDebugShard, type e as ClientDebugSnapshot, type f as ClientDebugSubscription, type g as ClientQueryRef, D as DEFAULT_MAX_BUFFER, type h as LunoraClientError, type i as LunoraErrorCode, type j as MutationSettledEvent, type O as OptimisticLocalStore, type k as OptimisticUpdate, type l as StreamHandle, type m as SubscriptionCallback, type a as SubscriptionErrorCallback, n as SubscriptionRegistry, type o as SubscriptionState, type p as SyncWatermark, q as createClientQuery, r as createLocalStore, s as createStream, t as getErrorCode, u as getRetryAfterMs, v as isConflictError, w as isForbiddenError, x as isRateLimitedError, y as isUnauthorizedError } from "./packem_shared/lunora-client.d-BOmxvSrG.mjs";
5
- export { p as preloadQuery, a as preloadedQueryResult } from "./packem_shared/preload.d-BprjXhJi.mjs";
1
+ import { o as PersistenceAdapter, B as BookmarkStorage, H as HttpStreamRef, m as HttpStreamArgsOf, n as HttpStreamChunkOf, O as OfflineQueueOptions, Q as QueryCacheAdapter, p as ReconnectOptions, F as FunctionReference } from "./packem_shared/types.d-CsuRAQvb.mjs";
2
+ export type { A as ArgsOf, C as CachedQuery, q as ClientMessage, r as ClientShapeSubscribeMessage, s as ClientShapeUnsubscribeMessage, t as FunctionArgumentDescriptor, h as FunctionDescriptor, l as GlobalFacetResult, u as GlobalFacetValue, j as GlobalFilterClause, G as GlobalTableInfo, k as GlobalTablePage, v as HttpStreamCallArgs, L as LunoraClientOptions, w as OutboxMutation, x as OutboxSink, y as PersistedMutation, P as Preloaded, R as ReturnOf, z as RowOp, D as RpcEnvelope, E as RpcResponseBody, b as ScheduleRecord, I as SchedulerPoolStatus, c as SchedulerStatus, J as ServerMessage, K as ServerPokeEndMessage, M as ServerPokePartMessage, N as ServerPokeStartMessage, T as ShardTrafficEntry, S as ShardTrafficResult, i as StorageListPage, V as StorageObject, a as Unsubscribe, U as User, g as WorkflowInstanceAction, f as WorkflowInstanceDetail, e as WorkflowInstancePage, d as WorkflowInstanceStatus, X as WorkflowInstanceSummary, Y as WorkflowStepDetail, W as WsTokenProvider } from "./packem_shared/types.d-CsuRAQvb.mjs";
3
+ import { C as ConnectionStatus, S as SubscriptionError, b as StreamIterable, L as LunoraClient } from "./packem_shared/lunora-client.d-DQ8j9RKD.mjs";
4
+ export { type A as ActionCallOptions, type B as BatchSlot, c as CONFLICT_ERROR_CODE, type d as ClientDebugShard, type e as ClientDebugSnapshot, type f as ClientDebugSubscription, type g as ClientQueryRef, D as DEFAULT_MAX_BUFFER, type h as LunoraClientError, type i as LunoraErrorCode, type M as MutationCallOptions, type j as MutationSettledEvent, type O as OptimisticLocalStore, type k as OptimisticUpdate, type l as StreamHandle, type m as SubscriptionCallback, type a as SubscriptionErrorCallback, n as SubscriptionRegistry, type o as SubscriptionState, type p as SyncWatermark, q as createClientQuery, r as createLocalStore, s as createStream, t as getErrorCode, u as getRetryAfterMs, v as isConflictError, w as isForbiddenError, x as isRateLimitedError, y as isUnauthorizedError } from "./packem_shared/lunora-client.d-DQ8j9RKD.mjs";
5
+ export { p as preloadQuery, a as preloadedQueryResult } from "./packem_shared/preload.d--yKFpUIy.mjs";
6
6
  export type { AuthCapabilities, AuthConfigInfo, AuthImpersonation, AuthPage, AuthSession, AuthUser, AuthUserFieldSpec, CronJobInfo, KvKeyEntry, KvKeyListResult, KvNamespaceSummary, KvValueResult, PipelineLogColumnMap, PipelineLogCursor, PipelineLogField, PipelineLogPage, PipelineLogQuery, PipelineLogRow, VectorIndexSummary, VectorQueryMatch } from '@lunora/runtime';
7
7
  declare const anyApi: Record<string, Record<string, unknown>>;
8
8
  /**
@@ -124,6 +124,47 @@ interface AsyncStoragePersistenceOptions {
124
124
  declare const createAsyncStoragePersistence: (options: AsyncStoragePersistenceOptions) => PersistenceAdapter;
125
125
  /** Default in-memory bookmark store. Survives the lifetime of the client. */
126
126
  declare const createInMemoryBookmarkStorage: () => BookmarkStorage;
127
+ /**
128
+ * Reactive sinks an adapter binds to its own primitive's setters (a React
129
+ * `useState`, a Solid signal, a Vue ref, a Svelte store). The runner pushes into
130
+ * them; how they store the value is the adapter's concern (e.g. Solid and React
131
+ * wrap function-valued results in a thunk so the setter stores them rather than
132
+ * invoking them).
133
+ */
134
+ interface CallRunnerSinks<R> {
135
+ /** Receives the normalized {@link Error} when the latest invocation rejects. */
136
+ setError: (error: Error) => void;
137
+ /** Receives `true` while at least one invocation is in flight (ref-counted across overlapping calls), else `false`. */
138
+ setPending: (pending: boolean) => void;
139
+ /** Receives the resolved value when the latest invocation succeeds. */
140
+ setResult: (result: R) => void;
141
+ }
142
+ /**
143
+ * Build the framework-neutral half of an adapter's write primitive — the `mutate`
144
+ * of `useMutation`/`createMutation`/`mutation`, and the `call` of
145
+ * `useAction`/`createAction`/`action`.
146
+ *
147
+ * It owns the orchestration every adapter otherwise copy-pastes: ref-counting
148
+ * overlapping invocations into `setPending` (so the flag clears only once the
149
+ * last settles), normalizing a thrown non-`Error`, and routing success/failure to
150
+ * `setResult`/`setError` before re-throwing the SAME instance (so a typed error's
151
+ * `.code`/`.data` survive for both the `catch` and the template).
152
+ *
153
+ * `invoke` is a pre-bound thunk — `(args, options) => client.mutation(fn, args, options)`
154
+ * or `(args, options) => client.action(fn, args, options)`. Binding at the call
155
+ * site is what keeps this one function: the runner never inspects `options`, it
156
+ * only forwards them, so the option type is inferred from the closure rather
157
+ * than hard-coded per procedure kind. What actually keeps `optimisticUpdate` off
158
+ * an action is the adapter's exported handle type, not this file.
159
+ *
160
+ * `data`/`error` track the LATEST invocation, not the last to settle: overlapping
161
+ * calls can resolve out of order, so an earlier call that finishes later must not
162
+ * clobber a newer call's outcome. Each invocation takes a monotonic token and
163
+ * writes the value sinks only while it is still the most recent one — otherwise a
164
+ * double-click could leave the UI showing the first click's result, or an error
165
+ * for a call that succeeded.
166
+ */
167
+ declare const createCallRunner: <A, O, R>(invoke: (args: A, options?: O) => Promise<R>, sinks: CallRunnerSinks<R>) => ((args: A, options?: O) => Promise<R>);
127
168
  interface TabCoordinatorOptions {
128
169
  /**
129
170
  * BroadcastChannel name. Defaults to `"lunora-bridge"`.
@@ -409,36 +450,6 @@ interface HttpStreamOptions {
409
450
  * @experimental Reconnect/POST-body/wire-fidelity design questions are still open, so the shape may change.
410
451
  */
411
452
  declare const httpStream: <Ref extends HttpStreamRef>(route: Ref, args?: HttpStreamArgsOf<Ref>, options?: HttpStreamOptions) => StreamIterable<HttpStreamChunkOf<Ref>>;
412
- /** The single transport method a mutation runner needs — narrowed so adapters can test against a stub. */
413
- interface MutationCapableClient<F extends FunctionReference> {
414
- mutation: (function_: F, args: ArgsOf<F>, options?: MutationCallOptions<unknown, unknown, ArgsOf<F>>) => Promise<ReturnOf<F>>;
415
- }
416
- /**
417
- * Reactive sinks an adapter binds to its own primitive's setters (a Solid
418
- * signal, a Vue ref, a Svelte store). The runner pushes into them; how they
419
- * store the value is the adapter's concern (e.g. Solid wraps function-valued
420
- * results in a thunk).
421
- */
422
- interface MutationRunnerSinks<R> {
423
- /** Receives the normalized {@link Error} when an invocation rejects. */
424
- setError: (error: Error) => void;
425
- /** Receives `true` while at least one invocation is in flight (ref-counted across overlapping calls), else `false`. */
426
- setPending: (pending: boolean) => void;
427
- /** Receives the resolved value when an invocation succeeds. */
428
- setResult: (result: R) => void;
429
- }
430
- /**
431
- * Build the framework-neutral `mutate` half of an adapter's mutation hook.
432
- *
433
- * Owns the orchestration every adapter otherwise copy-pastes: ref-counts
434
- * overlapping invocations into `setPending` (so it only clears once the last
435
- * settles), normalizes a thrown non-`Error`, and routes success/failure to
436
- * `setResult`/`setError` before re-throwing. Each adapter (`@lunora/react`,
437
- * `/solid`, `/svelte`, `/vue`) binds the three sinks to its own reactive
438
- * setters, so this logic lives in exactly one place. Optimistic-update options
439
- * pass straight through to `client.mutation`.
440
- */
441
- declare const createMutationRunner: <F extends FunctionReference>(client: MutationCapableClient<F>, function_: F, sinks: MutationRunnerSinks<ReturnOf<F>>) => ((args: ArgsOf<F>, options?: MutationCallOptions<unknown, unknown, ArgsOf<F>>) => Promise<ReturnOf<F>>);
442
453
  /**
443
454
  * The structural surface of a TanStack `Transaction` a bound custom mutator
444
455
  * returns — its `isPersisted.promise` resolves once the write is persisted and
@@ -821,4 +832,4 @@ declare const sendToSw: (sw: ServiceWorker | null, message: ClientToSwMessage, e
821
832
  * Create a reply for a client message (call from inside the SW).
822
833
  */
823
834
  declare const createReply: (original: ClientToSwMessage, payload?: unknown) => SwToClientMessage;
824
- export { type ArgsOf, type AsyncStorageLike, type AsyncStoragePersistenceOptions, type BookmarkStorage, ClientServiceWorker, type ClientSwOptions, type ClientToSwMessage, type ConnectionStatus, type FunctionReference, type HttpStreamArgsOf, type HttpStreamChunkOf, type HttpStreamOptions, type HttpStreamRef, type IndexedDbPersistenceOptions, type IndexedDbQueryCacheOptions, LunoraClient, type MutationCallOptions, type MutationDelta, type MutationRunnerSinks, type MutatorHandle, type MutatorRunnerSinks, type MutatorTransaction, OfflineQueue, type OfflineQueueOptions, type OptimisticMessage, type PersistenceAdapter, type QueryCacheAdapter, type QueuedMutation, RETIRE_AFTER_DURABLE_SEQ_ADVANCE, type ReconcileDurableMessage, type ReconnectCalculator, type ReconnectOptions, type ReturnOf, type ServiceWorkerStatus, type StreamIterable, type SubscriptionError, type SwToClientMessage, TabCoordinator, anyApi, applyDelta, createAsyncStoragePersistence, createInMemoryBookmarkStorage, createInMemoryPersistence, createInMemoryQueryCache, createIndexedDbPersistence, createIndexedDbQueryCache, createMutationRunner, createMutatorRunner, createReconnect, createReply, createSnapshotPrecondition, httpStream, isMutationDelta, maxSeq, queryCacheKey, reconcileOptimistic, sendToSw };
835
+ export { type AsyncStorageLike, type AsyncStoragePersistenceOptions, type BookmarkStorage, ClientServiceWorker, type ClientSwOptions, type ClientToSwMessage, type ConnectionStatus, type FunctionReference, type HttpStreamArgsOf, type HttpStreamChunkOf, type HttpStreamOptions, type HttpStreamRef, type IndexedDbPersistenceOptions, type IndexedDbQueryCacheOptions, LunoraClient, type MutationDelta, type MutatorHandle, type MutatorRunnerSinks, type MutatorTransaction, OfflineQueue, type OfflineQueueOptions, type OptimisticMessage, type PersistenceAdapter, type QueryCacheAdapter, type QueuedMutation, RETIRE_AFTER_DURABLE_SEQ_ADVANCE, type ReconcileDurableMessage, type ReconnectCalculator, type ReconnectOptions, type ServiceWorkerStatus, type StreamIterable, type SubscriptionError, type SwToClientMessage, TabCoordinator, anyApi, applyDelta, createAsyncStoragePersistence, createCallRunner, createInMemoryBookmarkStorage, createInMemoryPersistence, createInMemoryQueryCache, createIndexedDbPersistence, createIndexedDbQueryCache, createMutatorRunner, createReconnect, createReply, createSnapshotPrecondition, httpStream, isMutationDelta, maxSeq, queryCacheKey, reconcileOptimistic, sendToSw };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { o as PersistenceAdapter, B as BookmarkStorage, H as HttpStreamRef, m as HttpStreamArgsOf, n as HttpStreamChunkOf, F as FunctionReference, A as ArgsOf, R as ReturnOf, O as OfflineQueueOptions, Q as QueryCacheAdapter, p as ReconnectOptions } from "./packem_shared/types.d-CsuRAQvb.js";
2
- export type { C as CachedQuery, q as ClientMessage, r as ClientShapeSubscribeMessage, s as ClientShapeUnsubscribeMessage, t as FunctionArgumentDescriptor, h as FunctionDescriptor, l as GlobalFacetResult, u as GlobalFacetValue, j as GlobalFilterClause, G as GlobalTableInfo, k as GlobalTablePage, v as HttpStreamCallArgs, L as LunoraClientOptions, w as OutboxMutation, x as OutboxSink, y as PersistedMutation, P as Preloaded, z as RowOp, D as RpcEnvelope, E as RpcResponseBody, b as ScheduleRecord, I as SchedulerPoolStatus, c as SchedulerStatus, J as ServerMessage, K as ServerPokeEndMessage, M as ServerPokePartMessage, N as ServerPokeStartMessage, T as ShardTrafficEntry, S as ShardTrafficResult, i as StorageListPage, V as StorageObject, a as Unsubscribe, U as User, g as WorkflowInstanceAction, f as WorkflowInstanceDetail, e as WorkflowInstancePage, d as WorkflowInstanceStatus, X as WorkflowInstanceSummary, Y as WorkflowStepDetail, W as WsTokenProvider } from "./packem_shared/types.d-CsuRAQvb.js";
3
- import { C as ConnectionStatus, S as SubscriptionError, b as StreamIterable, M as MutationCallOptions, L as LunoraClient } from "./packem_shared/lunora-client.d-K16SL8Tj.js";
4
- export { type B as BatchSlot, c as CONFLICT_ERROR_CODE, type d as ClientDebugShard, type e as ClientDebugSnapshot, type f as ClientDebugSubscription, type g as ClientQueryRef, D as DEFAULT_MAX_BUFFER, type h as LunoraClientError, type i as LunoraErrorCode, type j as MutationSettledEvent, type O as OptimisticLocalStore, type k as OptimisticUpdate, type l as StreamHandle, type m as SubscriptionCallback, type a as SubscriptionErrorCallback, n as SubscriptionRegistry, type o as SubscriptionState, type p as SyncWatermark, q as createClientQuery, r as createLocalStore, s as createStream, t as getErrorCode, u as getRetryAfterMs, v as isConflictError, w as isForbiddenError, x as isRateLimitedError, y as isUnauthorizedError } from "./packem_shared/lunora-client.d-K16SL8Tj.js";
5
- export { p as preloadQuery, a as preloadedQueryResult } from "./packem_shared/preload.d-CM8-Mg2A.js";
1
+ import { o as PersistenceAdapter, B as BookmarkStorage, H as HttpStreamRef, m as HttpStreamArgsOf, n as HttpStreamChunkOf, O as OfflineQueueOptions, Q as QueryCacheAdapter, p as ReconnectOptions, F as FunctionReference } from "./packem_shared/types.d-CsuRAQvb.js";
2
+ export type { A as ArgsOf, C as CachedQuery, q as ClientMessage, r as ClientShapeSubscribeMessage, s as ClientShapeUnsubscribeMessage, t as FunctionArgumentDescriptor, h as FunctionDescriptor, l as GlobalFacetResult, u as GlobalFacetValue, j as GlobalFilterClause, G as GlobalTableInfo, k as GlobalTablePage, v as HttpStreamCallArgs, L as LunoraClientOptions, w as OutboxMutation, x as OutboxSink, y as PersistedMutation, P as Preloaded, R as ReturnOf, z as RowOp, D as RpcEnvelope, E as RpcResponseBody, b as ScheduleRecord, I as SchedulerPoolStatus, c as SchedulerStatus, J as ServerMessage, K as ServerPokeEndMessage, M as ServerPokePartMessage, N as ServerPokeStartMessage, T as ShardTrafficEntry, S as ShardTrafficResult, i as StorageListPage, V as StorageObject, a as Unsubscribe, U as User, g as WorkflowInstanceAction, f as WorkflowInstanceDetail, e as WorkflowInstancePage, d as WorkflowInstanceStatus, X as WorkflowInstanceSummary, Y as WorkflowStepDetail, W as WsTokenProvider } from "./packem_shared/types.d-CsuRAQvb.js";
3
+ import { C as ConnectionStatus, S as SubscriptionError, b as StreamIterable, L as LunoraClient } from "./packem_shared/lunora-client.d-BaB4zz9g.js";
4
+ export { type A as ActionCallOptions, type B as BatchSlot, c as CONFLICT_ERROR_CODE, type d as ClientDebugShard, type e as ClientDebugSnapshot, type f as ClientDebugSubscription, type g as ClientQueryRef, D as DEFAULT_MAX_BUFFER, type h as LunoraClientError, type i as LunoraErrorCode, type M as MutationCallOptions, type j as MutationSettledEvent, type O as OptimisticLocalStore, type k as OptimisticUpdate, type l as StreamHandle, type m as SubscriptionCallback, type a as SubscriptionErrorCallback, n as SubscriptionRegistry, type o as SubscriptionState, type p as SyncWatermark, q as createClientQuery, r as createLocalStore, s as createStream, t as getErrorCode, u as getRetryAfterMs, v as isConflictError, w as isForbiddenError, x as isRateLimitedError, y as isUnauthorizedError } from "./packem_shared/lunora-client.d-BaB4zz9g.js";
5
+ export { p as preloadQuery, a as preloadedQueryResult } from "./packem_shared/preload.d-DBZ4GpsS.js";
6
6
  export type { AuthCapabilities, AuthConfigInfo, AuthImpersonation, AuthPage, AuthSession, AuthUser, AuthUserFieldSpec, CronJobInfo, KvKeyEntry, KvKeyListResult, KvNamespaceSummary, KvValueResult, PipelineLogColumnMap, PipelineLogCursor, PipelineLogField, PipelineLogPage, PipelineLogQuery, PipelineLogRow, VectorIndexSummary, VectorQueryMatch } from '@lunora/runtime';
7
7
  declare const anyApi: Record<string, Record<string, unknown>>;
8
8
  /**
@@ -124,6 +124,47 @@ interface AsyncStoragePersistenceOptions {
124
124
  declare const createAsyncStoragePersistence: (options: AsyncStoragePersistenceOptions) => PersistenceAdapter;
125
125
  /** Default in-memory bookmark store. Survives the lifetime of the client. */
126
126
  declare const createInMemoryBookmarkStorage: () => BookmarkStorage;
127
+ /**
128
+ * Reactive sinks an adapter binds to its own primitive's setters (a React
129
+ * `useState`, a Solid signal, a Vue ref, a Svelte store). The runner pushes into
130
+ * them; how they store the value is the adapter's concern (e.g. Solid and React
131
+ * wrap function-valued results in a thunk so the setter stores them rather than
132
+ * invoking them).
133
+ */
134
+ interface CallRunnerSinks<R> {
135
+ /** Receives the normalized {@link Error} when the latest invocation rejects. */
136
+ setError: (error: Error) => void;
137
+ /** Receives `true` while at least one invocation is in flight (ref-counted across overlapping calls), else `false`. */
138
+ setPending: (pending: boolean) => void;
139
+ /** Receives the resolved value when the latest invocation succeeds. */
140
+ setResult: (result: R) => void;
141
+ }
142
+ /**
143
+ * Build the framework-neutral half of an adapter's write primitive — the `mutate`
144
+ * of `useMutation`/`createMutation`/`mutation`, and the `call` of
145
+ * `useAction`/`createAction`/`action`.
146
+ *
147
+ * It owns the orchestration every adapter otherwise copy-pastes: ref-counting
148
+ * overlapping invocations into `setPending` (so the flag clears only once the
149
+ * last settles), normalizing a thrown non-`Error`, and routing success/failure to
150
+ * `setResult`/`setError` before re-throwing the SAME instance (so a typed error's
151
+ * `.code`/`.data` survive for both the `catch` and the template).
152
+ *
153
+ * `invoke` is a pre-bound thunk — `(args, options) => client.mutation(fn, args, options)`
154
+ * or `(args, options) => client.action(fn, args, options)`. Binding at the call
155
+ * site is what keeps this one function: the runner never inspects `options`, it
156
+ * only forwards them, so the option type is inferred from the closure rather
157
+ * than hard-coded per procedure kind. What actually keeps `optimisticUpdate` off
158
+ * an action is the adapter's exported handle type, not this file.
159
+ *
160
+ * `data`/`error` track the LATEST invocation, not the last to settle: overlapping
161
+ * calls can resolve out of order, so an earlier call that finishes later must not
162
+ * clobber a newer call's outcome. Each invocation takes a monotonic token and
163
+ * writes the value sinks only while it is still the most recent one — otherwise a
164
+ * double-click could leave the UI showing the first click's result, or an error
165
+ * for a call that succeeded.
166
+ */
167
+ declare const createCallRunner: <A, O, R>(invoke: (args: A, options?: O) => Promise<R>, sinks: CallRunnerSinks<R>) => ((args: A, options?: O) => Promise<R>);
127
168
  interface TabCoordinatorOptions {
128
169
  /**
129
170
  * BroadcastChannel name. Defaults to `"lunora-bridge"`.
@@ -409,36 +450,6 @@ interface HttpStreamOptions {
409
450
  * @experimental Reconnect/POST-body/wire-fidelity design questions are still open, so the shape may change.
410
451
  */
411
452
  declare const httpStream: <Ref extends HttpStreamRef>(route: Ref, args?: HttpStreamArgsOf<Ref>, options?: HttpStreamOptions) => StreamIterable<HttpStreamChunkOf<Ref>>;
412
- /** The single transport method a mutation runner needs — narrowed so adapters can test against a stub. */
413
- interface MutationCapableClient<F extends FunctionReference> {
414
- mutation: (function_: F, args: ArgsOf<F>, options?: MutationCallOptions<unknown, unknown, ArgsOf<F>>) => Promise<ReturnOf<F>>;
415
- }
416
- /**
417
- * Reactive sinks an adapter binds to its own primitive's setters (a Solid
418
- * signal, a Vue ref, a Svelte store). The runner pushes into them; how they
419
- * store the value is the adapter's concern (e.g. Solid wraps function-valued
420
- * results in a thunk).
421
- */
422
- interface MutationRunnerSinks<R> {
423
- /** Receives the normalized {@link Error} when an invocation rejects. */
424
- setError: (error: Error) => void;
425
- /** Receives `true` while at least one invocation is in flight (ref-counted across overlapping calls), else `false`. */
426
- setPending: (pending: boolean) => void;
427
- /** Receives the resolved value when an invocation succeeds. */
428
- setResult: (result: R) => void;
429
- }
430
- /**
431
- * Build the framework-neutral `mutate` half of an adapter's mutation hook.
432
- *
433
- * Owns the orchestration every adapter otherwise copy-pastes: ref-counts
434
- * overlapping invocations into `setPending` (so it only clears once the last
435
- * settles), normalizes a thrown non-`Error`, and routes success/failure to
436
- * `setResult`/`setError` before re-throwing. Each adapter (`@lunora/react`,
437
- * `/solid`, `/svelte`, `/vue`) binds the three sinks to its own reactive
438
- * setters, so this logic lives in exactly one place. Optimistic-update options
439
- * pass straight through to `client.mutation`.
440
- */
441
- declare const createMutationRunner: <F extends FunctionReference>(client: MutationCapableClient<F>, function_: F, sinks: MutationRunnerSinks<ReturnOf<F>>) => ((args: ArgsOf<F>, options?: MutationCallOptions<unknown, unknown, ArgsOf<F>>) => Promise<ReturnOf<F>>);
442
453
  /**
443
454
  * The structural surface of a TanStack `Transaction` a bound custom mutator
444
455
  * returns — its `isPersisted.promise` resolves once the write is persisted and
@@ -821,4 +832,4 @@ declare const sendToSw: (sw: ServiceWorker | null, message: ClientToSwMessage, e
821
832
  * Create a reply for a client message (call from inside the SW).
822
833
  */
823
834
  declare const createReply: (original: ClientToSwMessage, payload?: unknown) => SwToClientMessage;
824
- export { type ArgsOf, type AsyncStorageLike, type AsyncStoragePersistenceOptions, type BookmarkStorage, ClientServiceWorker, type ClientSwOptions, type ClientToSwMessage, type ConnectionStatus, type FunctionReference, type HttpStreamArgsOf, type HttpStreamChunkOf, type HttpStreamOptions, type HttpStreamRef, type IndexedDbPersistenceOptions, type IndexedDbQueryCacheOptions, LunoraClient, type MutationCallOptions, type MutationDelta, type MutationRunnerSinks, type MutatorHandle, type MutatorRunnerSinks, type MutatorTransaction, OfflineQueue, type OfflineQueueOptions, type OptimisticMessage, type PersistenceAdapter, type QueryCacheAdapter, type QueuedMutation, RETIRE_AFTER_DURABLE_SEQ_ADVANCE, type ReconcileDurableMessage, type ReconnectCalculator, type ReconnectOptions, type ReturnOf, type ServiceWorkerStatus, type StreamIterable, type SubscriptionError, type SwToClientMessage, TabCoordinator, anyApi, applyDelta, createAsyncStoragePersistence, createInMemoryBookmarkStorage, createInMemoryPersistence, createInMemoryQueryCache, createIndexedDbPersistence, createIndexedDbQueryCache, createMutationRunner, createMutatorRunner, createReconnect, createReply, createSnapshotPrecondition, httpStream, isMutationDelta, maxSeq, queryCacheKey, reconcileOptimistic, sendToSw };
835
+ export { type AsyncStorageLike, type AsyncStoragePersistenceOptions, type BookmarkStorage, ClientServiceWorker, type ClientSwOptions, type ClientToSwMessage, type ConnectionStatus, type FunctionReference, type HttpStreamArgsOf, type HttpStreamChunkOf, type HttpStreamOptions, type HttpStreamRef, type IndexedDbPersistenceOptions, type IndexedDbQueryCacheOptions, LunoraClient, type MutationDelta, type MutatorHandle, type MutatorRunnerSinks, type MutatorTransaction, OfflineQueue, type OfflineQueueOptions, type OptimisticMessage, type PersistenceAdapter, type QueryCacheAdapter, type QueuedMutation, RETIRE_AFTER_DURABLE_SEQ_ADVANCE, type ReconcileDurableMessage, type ReconnectCalculator, type ReconnectOptions, type ServiceWorkerStatus, type StreamIterable, type SubscriptionError, type SwToClientMessage, TabCoordinator, anyApi, applyDelta, createAsyncStoragePersistence, createCallRunner, createInMemoryBookmarkStorage, createInMemoryPersistence, createInMemoryQueryCache, createIndexedDbPersistence, createIndexedDbQueryCache, createMutatorRunner, createReconnect, createReply, createSnapshotPrecondition, httpStream, isMutationDelta, maxSeq, queryCacheKey, reconcileOptimistic, sendToSw };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{anyApi as o}from"./packem_shared/anyApi-CBOws2ZA.mjs";import{RETIRE_AFTER_DURABLE_SEQ_ADVANCE as a,maxSeq as n,reconcileOptimistic as p}from"./packem_shared/RETIRE_AFTER_DURABLE_SEQ_ADVANCE-DoEHtuR8.mjs";import{createAsyncStoragePersistence as i}from"./packem_shared/createAsyncStoragePersistence-yBu2KWAp.mjs";import{default as f}from"./packem_shared/createInMemoryBookmarkStorage-BooZhW0n.mjs";import{createClientQuery as s}from"./packem_shared/createClientQuery-TKD_52cT.mjs";import{TabCoordinator as d}from"./packem_shared/TabCoordinator-DVKG2RlZ.mjs";import{a as y,i as R}from"./packem_shared/delta-merge-BoVuM-rE.mjs";import{CONFLICT_ERROR_CODE as C,getErrorCode as S,getRetryAfterMs as A,isConflictError as D,isForbiddenError as M,isRateLimitedError as _,isUnauthorizedError as I}from"./packem_shared/CONFLICT_ERROR_CODE-LjU7z0mB.mjs";import{httpStream as h}from"./packem_shared/httpStream-x6q-x4yK.mjs";import{c as L}from"./packem_shared/local-store-BD0RFD7A.mjs";import{LunoraClient as T}from"./packem_shared/LunoraClient-CWDiiVcr.mjs";import{createMutationRunner as g}from"./packem_shared/createMutationRunner-C0i1P5RS.mjs";import{createMutatorRunner as U}from"./packem_shared/createMutatorRunner-CuMRJpUx.mjs";import{O as B}from"./packem_shared/offline-queue-BdQFXDz_.mjs";import{createInMemoryPersistence as N,createIndexedDbPersistence as v}from"./packem_shared/createInMemoryPersistence-BPdQiujT.mjs";import{preloadQuery as z,preloadedQueryResult as K}from"./packem_shared/preloadQuery-uFy24PCR.mjs";import{createInMemoryQueryCache as W,createIndexedDbQueryCache as X,queryCacheKey as j}from"./packem_shared/createInMemoryQueryCache-HMIq2XtS.mjs";import{createReconnect as H}from"./packem_shared/createReconnect-CjTmjJDH.mjs";import{default as Y}from"./packem_shared/createSnapshotPrecondition-CP3e1HVS.mjs";import{DEFAULT_MAX_BUFFER as $,createStream as ee}from"./packem_shared/DEFAULT_MAX_BUFFER-D3QH2iaq.mjs";import{SubscriptionRegistry as oe}from"./packem_shared/SubscriptionRegistry-D5Xu-a39.mjs";import{ClientServiceWorker as ae}from"./packem_shared/ClientServiceWorker-DXnBXeWK.mjs";import{createReply as pe,sendToSw as ce}from"./packem_shared/createReply-CwFABEJs.mjs";export{C as CONFLICT_ERROR_CODE,ae as ClientServiceWorker,$ as DEFAULT_MAX_BUFFER,T as LunoraClient,B as OfflineQueue,a as RETIRE_AFTER_DURABLE_SEQ_ADVANCE,oe as SubscriptionRegistry,d as TabCoordinator,o as anyApi,y as applyDelta,i as createAsyncStoragePersistence,s as createClientQuery,f as createInMemoryBookmarkStorage,N as createInMemoryPersistence,W as createInMemoryQueryCache,v as createIndexedDbPersistence,X as createIndexedDbQueryCache,L as createLocalStore,g as createMutationRunner,U as createMutatorRunner,H as createReconnect,pe as createReply,Y as createSnapshotPrecondition,ee as createStream,S as getErrorCode,A as getRetryAfterMs,h as httpStream,D as isConflictError,M as isForbiddenError,R as isMutationDelta,_ as isRateLimitedError,I as isUnauthorizedError,n as maxSeq,z as preloadQuery,K as preloadedQueryResult,j as queryCacheKey,p as reconcileOptimistic,ce as sendToSw};
1
+ import{anyApi as o}from"./packem_shared/anyApi-CBOws2ZA.mjs";import{RETIRE_AFTER_DURABLE_SEQ_ADVANCE as a,maxSeq as p,reconcileOptimistic as c}from"./packem_shared/RETIRE_AFTER_DURABLE_SEQ_ADVANCE-DoEHtuR8.mjs";import{createAsyncStoragePersistence as n}from"./packem_shared/createAsyncStoragePersistence-yBu2KWAp.mjs";import{default as f}from"./packem_shared/createInMemoryBookmarkStorage-BooZhW0n.mjs";import{createCallRunner as s}from"./packem_shared/createCallRunner-Bwcrfh76.mjs";import{createClientQuery as u}from"./packem_shared/createClientQuery-TKD_52cT.mjs";import{TabCoordinator as y}from"./packem_shared/TabCoordinator-DVKG2RlZ.mjs";import{a as E,i as C}from"./packem_shared/delta-merge-BoVuM-rE.mjs";import{CONFLICT_ERROR_CODE as A,getErrorCode as D,getRetryAfterMs as _,isConflictError as I,isForbiddenError as M,isRateLimitedError as Q,isUnauthorizedError as h}from"./packem_shared/CONFLICT_ERROR_CODE-LjU7z0mB.mjs";import{httpStream as L}from"./packem_shared/httpStream-x6q-x4yK.mjs";import{c as T}from"./packem_shared/local-store-BD0RFD7A.mjs";import{LunoraClient as g}from"./packem_shared/LunoraClient-CWDiiVcr.mjs";import{createMutatorRunner as U}from"./packem_shared/createMutatorRunner-CuMRJpUx.mjs";import{O as B}from"./packem_shared/offline-queue-BdQFXDz_.mjs";import{createInMemoryPersistence as N,createIndexedDbPersistence as v}from"./packem_shared/createInMemoryPersistence-BPdQiujT.mjs";import{preloadQuery as z,preloadedQueryResult as K}from"./packem_shared/preloadQuery-uFy24PCR.mjs";import{createInMemoryQueryCache as W,createIndexedDbQueryCache as X,queryCacheKey as j}from"./packem_shared/createInMemoryQueryCache-HMIq2XtS.mjs";import{createReconnect as H}from"./packem_shared/createReconnect-CjTmjJDH.mjs";import{default as Y}from"./packem_shared/createSnapshotPrecondition-CP3e1HVS.mjs";import{DEFAULT_MAX_BUFFER as $,createStream as ee}from"./packem_shared/DEFAULT_MAX_BUFFER-D3QH2iaq.mjs";import{SubscriptionRegistry as oe}from"./packem_shared/SubscriptionRegistry-D5Xu-a39.mjs";import{ClientServiceWorker as ae}from"./packem_shared/ClientServiceWorker-DXnBXeWK.mjs";import{createReply as ce,sendToSw as me}from"./packem_shared/createReply-CwFABEJs.mjs";export{A as CONFLICT_ERROR_CODE,ae as ClientServiceWorker,$ as DEFAULT_MAX_BUFFER,g as LunoraClient,B as OfflineQueue,a as RETIRE_AFTER_DURABLE_SEQ_ADVANCE,oe as SubscriptionRegistry,y as TabCoordinator,o as anyApi,E as applyDelta,n as createAsyncStoragePersistence,s as createCallRunner,u as createClientQuery,f as createInMemoryBookmarkStorage,N as createInMemoryPersistence,W as createInMemoryQueryCache,v as createIndexedDbPersistence,X as createIndexedDbQueryCache,T as createLocalStore,U as createMutatorRunner,H as createReconnect,ce as createReply,Y as createSnapshotPrecondition,ee as createStream,D as getErrorCode,_ as getRetryAfterMs,L as httpStream,I as isConflictError,M as isForbiddenError,C as isMutationDelta,Q as isRateLimitedError,h as isUnauthorizedError,p as maxSeq,z as preloadQuery,K as preloadedQueryResult,j as queryCacheKey,c as reconcileOptimistic,me as sendToSw};
@@ -0,0 +1 @@
1
+ const s=(c,r)=>{let n=0,e=0;return async(i,l)=>{e+=1;const o=e;n+=1,r.setPending(!0);try{const t=await c(i,l);return o===e&&r.setResult(t),t}catch(t){const a=t instanceof Error?t:new Error(String(t));throw o===e&&r.setError(a),a}finally{n-=1,r.setPending(n>0)}}};export{s as createCallRunner};
@@ -387,6 +387,19 @@ interface MutationSettledEvent {
387
387
  /** Terminal outcome. */
388
388
  readonly status: "committed" | "rejected";
389
389
  }
390
+ /**
391
+ * Per-call options for {@link LunoraClient.action} — just `shardKey`, since an
392
+ * action is not a write and carries none of the optimistic machinery. Exported
393
+ * (at the end of this file) for the same reason {@link MutationCallOptions} is:
394
+ * so the framework adapters (`@lunora/react`, `/solid`, `/svelte`, `/vue`,
395
+ * `/angular`) type their `call(args, options?)` against one canonical
396
+ * definition. Add an option here and every adapter forwards it; re-declare it
397
+ * per adapter and they silently cannot.
398
+ */
399
+ interface ActionCallOptions {
400
+ /** Route the call to a specific shard. */
401
+ shardKey?: string;
402
+ }
390
403
  /**
391
404
  * Per-call options for {@link LunoraClient.mutation} — the optimistic-update
392
405
  * machinery plus `shardKey`. Exported (at the end of this file) so the framework
@@ -1044,9 +1057,7 @@ declare class LunoraClient {
1044
1057
  * `OfflineQueueOptions.queueBeforeFirstConnect`.
1045
1058
  */
1046
1059
  mutation<F extends FunctionReference>(function_: F, args: ArgsOf<F>, options?: MutationCallOptions<unknown, unknown, ArgsOf<F>>): Promise<ReturnOf<F>>;
1047
- action<F extends FunctionReference>(function_: F, args: ArgsOf<F>, options?: {
1048
- shardKey?: string;
1049
- }): Promise<ReturnOf<F>>;
1060
+ action<F extends FunctionReference>(function_: F, args: ArgsOf<F>, options?: ActionCallOptions): Promise<ReturnOf<F>>;
1050
1061
  /**
1051
1062
  * Bulk-import `rows` through a mutation that accepts a batch, chunked so a large
1052
1063
  * dataset lands in a bounded number of round-trips.
@@ -2248,4 +2259,4 @@ declare class LunoraClient {
2248
2259
  */
2249
2260
  private settleReplayBatchSlots;
2250
2261
  }
2251
- export { BatchSlot as B, ConnectionStatus as C, DEFAULT_MAX_BUFFER as D, LunoraClient as L, MutationCallOptions as M, OptimisticLocalStore as O, SubscriptionError as S, SubscriptionErrorCallback as a, StreamIterable as b, CONFLICT_ERROR_CODE as c, ClientDebugShard as d, ClientDebugSnapshot as e, ClientDebugSubscription as f, ClientQueryRef as g, LunoraClientError as h, LunoraErrorCode as i, MutationSettledEvent as j, OptimisticUpdate as k, StreamHandle as l, SubscriptionCallback as m, SubscriptionRegistry as n, SubscriptionState as o, SyncWatermark as p, createClientQuery as q, createLocalStore as r, createStream as s, getErrorCode as t, getRetryAfterMs as u, isConflictError as v, isForbiddenError as w, isRateLimitedError as x, isUnauthorizedError as y };
2262
+ export { ActionCallOptions as A, BatchSlot as B, ConnectionStatus as C, DEFAULT_MAX_BUFFER as D, LunoraClient as L, MutationCallOptions as M, OptimisticLocalStore as O, SubscriptionError as S, SubscriptionErrorCallback as a, StreamIterable as b, CONFLICT_ERROR_CODE as c, ClientDebugShard as d, ClientDebugSnapshot as e, ClientDebugSubscription as f, ClientQueryRef as g, LunoraClientError as h, LunoraErrorCode as i, MutationSettledEvent as j, OptimisticUpdate as k, StreamHandle as l, SubscriptionCallback as m, SubscriptionRegistry as n, SubscriptionState as o, SyncWatermark as p, createClientQuery as q, createLocalStore as r, createStream as s, getErrorCode as t, getRetryAfterMs as u, isConflictError as v, isForbiddenError as w, isRateLimitedError as x, isUnauthorizedError as y };
@@ -387,6 +387,19 @@ interface MutationSettledEvent {
387
387
  /** Terminal outcome. */
388
388
  readonly status: "committed" | "rejected";
389
389
  }
390
+ /**
391
+ * Per-call options for {@link LunoraClient.action} — just `shardKey`, since an
392
+ * action is not a write and carries none of the optimistic machinery. Exported
393
+ * (at the end of this file) for the same reason {@link MutationCallOptions} is:
394
+ * so the framework adapters (`@lunora/react`, `/solid`, `/svelte`, `/vue`,
395
+ * `/angular`) type their `call(args, options?)` against one canonical
396
+ * definition. Add an option here and every adapter forwards it; re-declare it
397
+ * per adapter and they silently cannot.
398
+ */
399
+ interface ActionCallOptions {
400
+ /** Route the call to a specific shard. */
401
+ shardKey?: string;
402
+ }
390
403
  /**
391
404
  * Per-call options for {@link LunoraClient.mutation} — the optimistic-update
392
405
  * machinery plus `shardKey`. Exported (at the end of this file) so the framework
@@ -1044,9 +1057,7 @@ declare class LunoraClient {
1044
1057
  * `OfflineQueueOptions.queueBeforeFirstConnect`.
1045
1058
  */
1046
1059
  mutation<F extends FunctionReference>(function_: F, args: ArgsOf<F>, options?: MutationCallOptions<unknown, unknown, ArgsOf<F>>): Promise<ReturnOf<F>>;
1047
- action<F extends FunctionReference>(function_: F, args: ArgsOf<F>, options?: {
1048
- shardKey?: string;
1049
- }): Promise<ReturnOf<F>>;
1060
+ action<F extends FunctionReference>(function_: F, args: ArgsOf<F>, options?: ActionCallOptions): Promise<ReturnOf<F>>;
1050
1061
  /**
1051
1062
  * Bulk-import `rows` through a mutation that accepts a batch, chunked so a large
1052
1063
  * dataset lands in a bounded number of round-trips.
@@ -2248,4 +2259,4 @@ declare class LunoraClient {
2248
2259
  */
2249
2260
  private settleReplayBatchSlots;
2250
2261
  }
2251
- export { BatchSlot as B, ConnectionStatus as C, DEFAULT_MAX_BUFFER as D, LunoraClient as L, MutationCallOptions as M, OptimisticLocalStore as O, SubscriptionError as S, SubscriptionErrorCallback as a, StreamIterable as b, CONFLICT_ERROR_CODE as c, ClientDebugShard as d, ClientDebugSnapshot as e, ClientDebugSubscription as f, ClientQueryRef as g, LunoraClientError as h, LunoraErrorCode as i, MutationSettledEvent as j, OptimisticUpdate as k, StreamHandle as l, SubscriptionCallback as m, SubscriptionRegistry as n, SubscriptionState as o, SyncWatermark as p, createClientQuery as q, createLocalStore as r, createStream as s, getErrorCode as t, getRetryAfterMs as u, isConflictError as v, isForbiddenError as w, isRateLimitedError as x, isUnauthorizedError as y };
2262
+ export { ActionCallOptions as A, BatchSlot as B, ConnectionStatus as C, DEFAULT_MAX_BUFFER as D, LunoraClient as L, MutationCallOptions as M, OptimisticLocalStore as O, SubscriptionError as S, SubscriptionErrorCallback as a, StreamIterable as b, CONFLICT_ERROR_CODE as c, ClientDebugShard as d, ClientDebugSnapshot as e, ClientDebugSubscription as f, ClientQueryRef as g, LunoraClientError as h, LunoraErrorCode as i, MutationSettledEvent as j, OptimisticUpdate as k, StreamHandle as l, SubscriptionCallback as m, SubscriptionRegistry as n, SubscriptionState as o, SyncWatermark as p, createClientQuery as q, createLocalStore as r, createStream as s, getErrorCode as t, getRetryAfterMs as u, isConflictError as v, isForbiddenError as w, isRateLimitedError as x, isUnauthorizedError as y };
@@ -1,4 +1,4 @@
1
- import { L as LunoraClient } from "./lunora-client.d-BOmxvSrG.mjs";
1
+ import { L as LunoraClient } from "./lunora-client.d-DQ8j9RKD.mjs";
2
2
  import { F as FunctionReference, A as ArgsOf, R as ReturnOf, P as Preloaded } from "./types.d-CsuRAQvb.mjs";
3
3
  /**
4
4
  * Run a query once on the server (during SSR) and capture its result in a
@@ -1,4 +1,4 @@
1
- import { L as LunoraClient } from "./lunora-client.d-K16SL8Tj.js";
1
+ import { L as LunoraClient } from "./lunora-client.d-BaB4zz9g.js";
2
2
  import { F as FunctionReference, A as ArgsOf, R as ReturnOf, P as Preloaded } from "./types.d-CsuRAQvb.js";
3
3
  /**
4
4
  * Run a query once on the server (during SSR) and capture its result in a
@@ -1,4 +1,4 @@
1
- import { S as SubscriptionError, L as LunoraClient } from "../packem_shared/lunora-client.d-BOmxvSrG.mjs";
1
+ import { S as SubscriptionError, L as LunoraClient } from "../packem_shared/lunora-client.d-DQ8j9RKD.mjs";
2
2
  export type {
3
3
  /**
4
4
  * `@lunora/client/query` — the framework-neutral live-query state machine shared
@@ -10,7 +10,7 @@ export type {
10
10
  * framework — each adapter supplies thin sinks that write into its own ref /
11
11
  * store / signal / cache.
12
12
  */
13
- a as SubscriptionErrorCallback } from "../packem_shared/lunora-client.d-BOmxvSrG.mjs";
13
+ a as SubscriptionErrorCallback } from "../packem_shared/lunora-client.d-DQ8j9RKD.mjs";
14
14
  import { F as FunctionReference, A as ArgsOf, R as ReturnOf, a as Unsubscribe } from "../packem_shared/types.d-CsuRAQvb.mjs";
15
15
  import '@lunora/runtime';
16
16
  /**
@@ -1,4 +1,4 @@
1
- import { S as SubscriptionError, L as LunoraClient } from "../packem_shared/lunora-client.d-K16SL8Tj.js";
1
+ import { S as SubscriptionError, L as LunoraClient } from "../packem_shared/lunora-client.d-BaB4zz9g.js";
2
2
  export type {
3
3
  /**
4
4
  * `@lunora/client/query` — the framework-neutral live-query state machine shared
@@ -10,7 +10,7 @@ export type {
10
10
  * framework — each adapter supplies thin sinks that write into its own ref /
11
11
  * store / signal / cache.
12
12
  */
13
- a as SubscriptionErrorCallback } from "../packem_shared/lunora-client.d-K16SL8Tj.js";
13
+ a as SubscriptionErrorCallback } from "../packem_shared/lunora-client.d-BaB4zz9g.js";
14
14
  import { F as FunctionReference, A as ArgsOf, R as ReturnOf, a as Unsubscribe } from "../packem_shared/types.d-CsuRAQvb.js";
15
15
  import '@lunora/runtime';
16
16
  /**
@@ -1,6 +1,6 @@
1
1
  import { P as Preloaded } from "../packem_shared/types.d-CsuRAQvb.mjs";
2
2
  export type { A as ArgsOf, F as FunctionReference, R as ReturnOf } from "../packem_shared/types.d-CsuRAQvb.mjs";
3
- import { L as LunoraClient } from "../packem_shared/lunora-client.d-BOmxvSrG.mjs";
3
+ import { L as LunoraClient } from "../packem_shared/lunora-client.d-DQ8j9RKD.mjs";
4
4
  export {
5
5
  /**
6
6
  * `@lunora/client/ssr` — the framework-neutral server contract that every Lunora
@@ -21,7 +21,7 @@ p as preloadQuery,
21
21
  * WebSocket or touches a UI framework, so it is safe to import from any SSR
22
22
  * loader.
23
23
  */
24
- a as preloadedQueryResult } from "../packem_shared/preload.d-BprjXhJi.mjs";
24
+ a as preloadedQueryResult } from "../packem_shared/preload.d--yKFpUIy.mjs";
25
25
  import '@lunora/runtime';
26
26
  /**
27
27
  * Structural shape of a better-auth `getSession` call's resolved value.
@@ -1,6 +1,6 @@
1
1
  import { P as Preloaded } from "../packem_shared/types.d-CsuRAQvb.js";
2
2
  export type { A as ArgsOf, F as FunctionReference, R as ReturnOf } from "../packem_shared/types.d-CsuRAQvb.js";
3
- import { L as LunoraClient } from "../packem_shared/lunora-client.d-K16SL8Tj.js";
3
+ import { L as LunoraClient } from "../packem_shared/lunora-client.d-BaB4zz9g.js";
4
4
  export {
5
5
  /**
6
6
  * `@lunora/client/ssr` — the framework-neutral server contract that every Lunora
@@ -21,7 +21,7 @@ p as preloadQuery,
21
21
  * WebSocket or touches a UI framework, so it is safe to import from any SSR
22
22
  * loader.
23
23
  */
24
- a as preloadedQueryResult } from "../packem_shared/preload.d-CM8-Mg2A.js";
24
+ a as preloadedQueryResult } from "../packem_shared/preload.d-DBZ4GpsS.js";
25
25
  import '@lunora/runtime';
26
26
  /**
27
27
  * Structural shape of a better-auth `getSession` call's resolved value.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/client",
3
- "version": "1.0.0-alpha.51",
3
+ "version": "1.0.0-alpha.52",
4
4
  "description": "Lunora browser SDK: WebSocket transport, optimistic updates, and an offline mutation queue",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -1 +0,0 @@
1
- const u=(o,a,r)=>{let e=0;return async(c,i)=>{e+=1,r.setPending(!0);try{const t=await o.mutation(a,c,i);return r.setResult(t),t}catch(t){const n=t instanceof Error?t:new Error(String(t));throw r.setError(n),n}finally{e-=1,r.setPending(e>0)}}};export{u as createMutationRunner};