@lunora/react 1.0.0-alpha.242 → 1.0.0-alpha.243

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
@@ -1278,6 +1278,22 @@ declare const useStream: <F extends FunctionReference<"stream">>(function_: F, a
1278
1278
  * `SubscriptionError` in addition.
1279
1279
  */
1280
1280
  declare const useSubscription: <F extends FunctionReference>(function_: F, args: ArgsOf<F> | "skip", options?: UseQueryOptions) => UseSubscriptionResult<ReturnOf<F>>;
1281
+ /**
1282
+ * Subscribe to a server query inside a `<Suspense>` boundary.
1283
+ *
1284
+ * Unlike `useQuery` the value is never `undefined`: the component suspends
1285
+ * until the query's first value lands (the durable read cache when it already
1286
+ * holds one, otherwise the server's snapshot) and renders only with data. A
1287
+ * failed first fetch throws to the nearest error boundary.
1288
+ *
1289
+ * It shares `useQuery`'s TanStack cache entry and WebSocket subscription —
1290
+ * same query key, same registry — so mixing the two on one query costs one
1291
+ * subscription, and pushes keep the value current once it has rendered.
1292
+ *
1293
+ * There is no `"skip"`: a query that may not run is `useQuery`'s job, since a
1294
+ * suspending hook has no value to return for it.
1295
+ */
1296
+ declare const useSuspenseQuery: <F extends FunctionReference>(function_: F, args: ArgsOf<F>, options?: UseQueryOptions) => ReturnOf<F>;
1281
1297
  /**
1282
1298
  * Browser Web Audio subsystems for `useVoiceAgent` — the default microphone
1283
1299
  * capture and speaker playback implementations injected into the hook via its
@@ -1440,4 +1456,4 @@ interface UseVoiceAgentResult {
1440
1456
  * `createSocket`) so the hook is drivable outside a browser.
1441
1457
  */
1442
1458
  declare const useVoiceAgent: (options: UseVoiceAgentOptions) => UseVoiceAgentResult;
1443
- export { type ActionHook, type AdminAuthListResult, type AgentChatMessage, type AgentLiveEvent, type AgentProgressEvent, type AgentThreadRecord, type AgentThreadStatus, type AgentTokenDelta, type AgentToolEvent, AuthLoading, type AuthState, Authenticated, type FlagValue, type HeartbeatReference, type ListPresentReference, LunoraProvider, type LunoraProviderProps, type MutationHook, type MutatorHook, type PageItemOf, type PaginatedArgs, Unauthenticated, type UseAgentApi, type UseAgentChatApi, type UseAgentChatOptions, type UseAgentChatResult, type UseAgentOptions, type UseAgentResult, type UseAgentStateApi, type UseAgentStateOptions, type UseAgentStateResult, type UseAgentToolEventsApi, type UseAgentToolEventsOptions, type UseAgentToolEventsResult, type UseAuthResult, type UseAuthSessionsOptions, type UseAuthUsersOptions, type UseHttpStreamOptions, type UseHttpStreamResult, type UseImpersonateResult, type UseInfiniteQueryOptions, type UseInfiniteQueryResult, type UseLiveTopicOptions, type UseLiveTopicResult, type UseMutationCallOptions, type UseOrganizationsOptions, type UsePaginatedQueryOptions, type UsePaginatedQueryResult, type UsePresenceOptions, type UsePresenceResult, type UseQueryOptions, type UseRateLimitOptions, type UseRateLimitResult, type UseSignUpInvitationsOptions, type UseStreamOptions, type UseStreamResult, type UseStreamStatus, type UseSubscriptionResult, type UseVoiceAgentOptions, type UseVoiceAgentResult, type VoiceAudioFormat, type VoiceReference, type VoiceStatus, hydratePreloaded, useAction, useAgent, useAgentChat, useAgentState, useAgentToolEvents, useAuth, useAuthSessions, useAuthState, useAuthUsers, useClientQuery, useConnectionStatus, useFlag, useFlags, useHttpStream, useImpersonate, useInfiniteQuery, useLiveTopic, useLunora, useMutation, useMutator, useOrganizations, usePaginatedQuery, usePreloadedQuery, usePresence, useQuery, useRateLimit, useSignUpInvitations, useStream, useSubscription, useVoiceAgent };
1459
+ export { type ActionHook, type AdminAuthListResult, type AgentChatMessage, type AgentLiveEvent, type AgentProgressEvent, type AgentThreadRecord, type AgentThreadStatus, type AgentTokenDelta, type AgentToolEvent, AuthLoading, type AuthState, Authenticated, type FlagValue, type HeartbeatReference, type ListPresentReference, LunoraProvider, type LunoraProviderProps, type MutationHook, type MutatorHook, type PageItemOf, type PaginatedArgs, Unauthenticated, type UseAgentApi, type UseAgentChatApi, type UseAgentChatOptions, type UseAgentChatResult, type UseAgentOptions, type UseAgentResult, type UseAgentStateApi, type UseAgentStateOptions, type UseAgentStateResult, type UseAgentToolEventsApi, type UseAgentToolEventsOptions, type UseAgentToolEventsResult, type UseAuthResult, type UseAuthSessionsOptions, type UseAuthUsersOptions, type UseHttpStreamOptions, type UseHttpStreamResult, type UseImpersonateResult, type UseInfiniteQueryOptions, type UseInfiniteQueryResult, type UseLiveTopicOptions, type UseLiveTopicResult, type UseMutationCallOptions, type UseOrganizationsOptions, type UsePaginatedQueryOptions, type UsePaginatedQueryResult, type UsePresenceOptions, type UsePresenceResult, type UseQueryOptions, type UseRateLimitOptions, type UseRateLimitResult, type UseSignUpInvitationsOptions, type UseStreamOptions, type UseStreamResult, type UseStreamStatus, type UseSubscriptionResult, type UseVoiceAgentOptions, type UseVoiceAgentResult, type VoiceAudioFormat, type VoiceReference, type VoiceStatus, hydratePreloaded, useAction, useAgent, useAgentChat, useAgentState, useAgentToolEvents, useAuth, useAuthSessions, useAuthState, useAuthUsers, useClientQuery, useConnectionStatus, useFlag, useFlags, useHttpStream, useImpersonate, useInfiniteQuery, useLiveTopic, useLunora, useMutation, useMutator, useOrganizations, usePaginatedQuery, usePreloadedQuery, usePresence, useQuery, useRateLimit, useSignUpInvitations, useStream, useSubscription, useSuspenseQuery, useVoiceAgent };
package/dist/index.d.ts CHANGED
@@ -1278,6 +1278,22 @@ declare const useStream: <F extends FunctionReference<"stream">>(function_: F, a
1278
1278
  * `SubscriptionError` in addition.
1279
1279
  */
1280
1280
  declare const useSubscription: <F extends FunctionReference>(function_: F, args: ArgsOf<F> | "skip", options?: UseQueryOptions) => UseSubscriptionResult<ReturnOf<F>>;
1281
+ /**
1282
+ * Subscribe to a server query inside a `<Suspense>` boundary.
1283
+ *
1284
+ * Unlike `useQuery` the value is never `undefined`: the component suspends
1285
+ * until the query's first value lands (the durable read cache when it already
1286
+ * holds one, otherwise the server's snapshot) and renders only with data. A
1287
+ * failed first fetch throws to the nearest error boundary.
1288
+ *
1289
+ * It shares `useQuery`'s TanStack cache entry and WebSocket subscription —
1290
+ * same query key, same registry — so mixing the two on one query costs one
1291
+ * subscription, and pushes keep the value current once it has rendered.
1292
+ *
1293
+ * There is no `"skip"`: a query that may not run is `useQuery`'s job, since a
1294
+ * suspending hook has no value to return for it.
1295
+ */
1296
+ declare const useSuspenseQuery: <F extends FunctionReference>(function_: F, args: ArgsOf<F>, options?: UseQueryOptions) => ReturnOf<F>;
1281
1297
  /**
1282
1298
  * Browser Web Audio subsystems for `useVoiceAgent` — the default microphone
1283
1299
  * capture and speaker playback implementations injected into the hook via its
@@ -1440,4 +1456,4 @@ interface UseVoiceAgentResult {
1440
1456
  * `createSocket`) so the hook is drivable outside a browser.
1441
1457
  */
1442
1458
  declare const useVoiceAgent: (options: UseVoiceAgentOptions) => UseVoiceAgentResult;
1443
- export { type ActionHook, type AdminAuthListResult, type AgentChatMessage, type AgentLiveEvent, type AgentProgressEvent, type AgentThreadRecord, type AgentThreadStatus, type AgentTokenDelta, type AgentToolEvent, AuthLoading, type AuthState, Authenticated, type FlagValue, type HeartbeatReference, type ListPresentReference, LunoraProvider, type LunoraProviderProps, type MutationHook, type MutatorHook, type PageItemOf, type PaginatedArgs, Unauthenticated, type UseAgentApi, type UseAgentChatApi, type UseAgentChatOptions, type UseAgentChatResult, type UseAgentOptions, type UseAgentResult, type UseAgentStateApi, type UseAgentStateOptions, type UseAgentStateResult, type UseAgentToolEventsApi, type UseAgentToolEventsOptions, type UseAgentToolEventsResult, type UseAuthResult, type UseAuthSessionsOptions, type UseAuthUsersOptions, type UseHttpStreamOptions, type UseHttpStreamResult, type UseImpersonateResult, type UseInfiniteQueryOptions, type UseInfiniteQueryResult, type UseLiveTopicOptions, type UseLiveTopicResult, type UseMutationCallOptions, type UseOrganizationsOptions, type UsePaginatedQueryOptions, type UsePaginatedQueryResult, type UsePresenceOptions, type UsePresenceResult, type UseQueryOptions, type UseRateLimitOptions, type UseRateLimitResult, type UseSignUpInvitationsOptions, type UseStreamOptions, type UseStreamResult, type UseStreamStatus, type UseSubscriptionResult, type UseVoiceAgentOptions, type UseVoiceAgentResult, type VoiceAudioFormat, type VoiceReference, type VoiceStatus, hydratePreloaded, useAction, useAgent, useAgentChat, useAgentState, useAgentToolEvents, useAuth, useAuthSessions, useAuthState, useAuthUsers, useClientQuery, useConnectionStatus, useFlag, useFlags, useHttpStream, useImpersonate, useInfiniteQuery, useLiveTopic, useLunora, useMutation, useMutator, useOrganizations, usePaginatedQuery, usePreloadedQuery, usePresence, useQuery, useRateLimit, useSignUpInvitations, useStream, useSubscription, useVoiceAgent };
1459
+ export { type ActionHook, type AdminAuthListResult, type AgentChatMessage, type AgentLiveEvent, type AgentProgressEvent, type AgentThreadRecord, type AgentThreadStatus, type AgentTokenDelta, type AgentToolEvent, AuthLoading, type AuthState, Authenticated, type FlagValue, type HeartbeatReference, type ListPresentReference, LunoraProvider, type LunoraProviderProps, type MutationHook, type MutatorHook, type PageItemOf, type PaginatedArgs, Unauthenticated, type UseAgentApi, type UseAgentChatApi, type UseAgentChatOptions, type UseAgentChatResult, type UseAgentOptions, type UseAgentResult, type UseAgentStateApi, type UseAgentStateOptions, type UseAgentStateResult, type UseAgentToolEventsApi, type UseAgentToolEventsOptions, type UseAgentToolEventsResult, type UseAuthResult, type UseAuthSessionsOptions, type UseAuthUsersOptions, type UseHttpStreamOptions, type UseHttpStreamResult, type UseImpersonateResult, type UseInfiniteQueryOptions, type UseInfiniteQueryResult, type UseLiveTopicOptions, type UseLiveTopicResult, type UseMutationCallOptions, type UseOrganizationsOptions, type UsePaginatedQueryOptions, type UsePaginatedQueryResult, type UsePresenceOptions, type UsePresenceResult, type UseQueryOptions, type UseRateLimitOptions, type UseRateLimitResult, type UseSignUpInvitationsOptions, type UseStreamOptions, type UseStreamResult, type UseStreamStatus, type UseSubscriptionResult, type UseVoiceAgentOptions, type UseVoiceAgentResult, type VoiceAudioFormat, type VoiceReference, type VoiceStatus, hydratePreloaded, useAction, useAgent, useAgentChat, useAgentState, useAgentToolEvents, useAuth, useAuthSessions, useAuthState, useAuthUsers, useClientQuery, useConnectionStatus, useFlag, useFlags, useHttpStream, useImpersonate, useInfiniteQuery, useLiveTopic, useLunora, useMutation, useMutator, useOrganizations, usePaginatedQuery, usePreloadedQuery, usePresence, useQuery, useRateLimit, useSignUpInvitations, useStream, useSubscription, useSuspenseQuery, useVoiceAgent };
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{AuthLoading as o,Authenticated as t,Unauthenticated as u}from"./packem_shared/AuthLoading-024-XH0I.mjs";import{useAuthState as a}from"./packem_shared/useAuthState-CqN1F2FM.mjs";import{L as f,u as n}from"./packem_shared/lunora-provider-_WqSuvf9.mjs";import{lunoraQueryOptions as m}from"./packem_shared/lunoraQueryOptions-IJB_aFzi.mjs";import{useAction as x}from"./packem_shared/useAction-jJl4KPEw.mjs";import{useAuthSessions as g,useAuthUsers as A,useImpersonate as c,useOrganizations as h,useSignUpInvitations as U}from"./packem_shared/useAuthSessions-jJWdw8Zw.mjs";import{useAgent as C}from"./packem_shared/useAgent-C2jMXz2-.mjs";import{useAgentChat as S}from"./packem_shared/useAgentChat-DiBCl0Rr.mjs";import{useAgentState as Q}from"./packem_shared/useAgentState-CDAO3aLL.mjs";import{useAgentToolEvents as R}from"./packem_shared/useAgentToolEvents-Bb94yV7R.mjs";import{default as F}from"./packem_shared/useAuth-CpGKVRsv.mjs";import{default as M}from"./packem_shared/useClientQuery-DUEUAqPh.mjs";import{default as b}from"./packem_shared/useConnectionStatus-Dtx_OWez.mjs";import{useFlag as O,useFlags as k}from"./packem_shared/useFlag-A7XPHExt.mjs";import{useHttpStream as V}from"./packem_shared/useHttpStream-CzryjxVH.mjs";import{default as q}from"./packem_shared/useInfiniteQuery-D_AG59dX.mjs";import{useLiveTopic as B}from"./packem_shared/useLiveTopic-UYAE2s4R.mjs";import{useMutation as G}from"./packem_shared/useMutation-Bz9uwvGf.mjs";import{useMutator as K}from"./packem_shared/useMutator-BtUd-xEA.mjs";import{usePaginatedQuery as W}from"./packem_shared/usePaginatedQuery-DhQAsxgX.mjs";import{hydratePreloaded as Y,default as Z}from"./packem_shared/hydratePreloaded-qs8nspKB.mjs";import{usePresence as $}from"./packem_shared/usePresence-X5Ax04Cf.mjs";import{default as re}from"./packem_shared/useQuery-CETQat99.mjs";import{useRateLimit as te}from"./packem_shared/useRateLimit-Cckxi8m9.mjs";import{useStream as se}from"./packem_shared/useStream-D8GB__4j.mjs";import{default as pe}from"./packem_shared/useSubscription-CwZgOrE4.mjs";import{useVoiceAgent as ne}from"./packem_shared/useVoiceAgent-DAh27XxD.mjs";import{createClientQuery as me,getErrorCode as de,getRetryAfterMs as xe,isConflictError as le,isForbiddenError as ge,isRateLimitedError as Ae,isUnauthorizedError as ce}from"@lunora/client";import{RestrictionError as Ue,UploadControl as ye,UploadError as Ce}from"@visulima/storage-client";import{useChunkedRestUpload as Se,useFileInput as Le,useMultipartUpload as Qe,usePasteUpload as Pe,useTusUpload as Re,useUpload as ve}from"@visulima/storage-client/react";export{o as AuthLoading,t as Authenticated,f as LunoraProvider,Ue as RestrictionError,u as Unauthenticated,ye as UploadControl,Ce as UploadError,me as createClientQuery,de as getErrorCode,xe as getRetryAfterMs,Y as hydratePreloaded,le as isConflictError,ge as isForbiddenError,Ae as isRateLimitedError,ce as isUnauthorizedError,m as lunoraQueryOptions,x as useAction,C as useAgent,S as useAgentChat,Q as useAgentState,R as useAgentToolEvents,F as useAuth,g as useAuthSessions,a as useAuthState,A as useAuthUsers,Se as useChunkedRestUpload,M as useClientQuery,b as useConnectionStatus,Le as useFileInput,O as useFlag,k as useFlags,V as useHttpStream,c as useImpersonate,q as useInfiniteQuery,B as useLiveTopic,n as useLunora,Qe as useMultipartUpload,G as useMutation,K as useMutator,h as useOrganizations,W as usePaginatedQuery,Pe as usePasteUpload,Z as usePreloadedQuery,$ as usePresence,re as useQuery,te as useRateLimit,U as useSignUpInvitations,se as useStream,pe as useSubscription,Re as useTusUpload,ve as useUpload,ne as useVoiceAgent};
2
+ import{AuthLoading as o,Authenticated as t,Unauthenticated as u}from"./packem_shared/AuthLoading-024-XH0I.mjs";import{useAuthState as a}from"./packem_shared/useAuthState-CqN1F2FM.mjs";import{L as f,u as n}from"./packem_shared/lunora-provider-_WqSuvf9.mjs";import{lunoraQueryOptions as m}from"./packem_shared/lunoraQueryOptions-IJB_aFzi.mjs";import{useAction as x}from"./packem_shared/useAction-jJl4KPEw.mjs";import{useAuthSessions as g,useAuthUsers as A,useImpersonate as c,useOrganizations as h,useSignUpInvitations as U}from"./packem_shared/useAuthSessions-jJWdw8Zw.mjs";import{useAgent as S}from"./packem_shared/useAgent-C2jMXz2-.mjs";import{useAgentChat as E}from"./packem_shared/useAgentChat-DiBCl0Rr.mjs";import{useAgentState as L}from"./packem_shared/useAgentState-CDAO3aLL.mjs";import{useAgentToolEvents as R}from"./packem_shared/useAgentToolEvents-Bb94yV7R.mjs";import{default as F}from"./packem_shared/useAuth-CpGKVRsv.mjs";import{default as M}from"./packem_shared/useClientQuery-DUEUAqPh.mjs";import{default as b}from"./packem_shared/useConnectionStatus-Dtx_OWez.mjs";import{useFlag as O,useFlags as k}from"./packem_shared/useFlag-A7XPHExt.mjs";import{useHttpStream as V}from"./packem_shared/useHttpStream-CzryjxVH.mjs";import{default as q}from"./packem_shared/useInfiniteQuery-D_AG59dX.mjs";import{useLiveTopic as B}from"./packem_shared/useLiveTopic-UYAE2s4R.mjs";import{useMutation as G}from"./packem_shared/useMutation-Bz9uwvGf.mjs";import{useMutator as K}from"./packem_shared/useMutator-BtUd-xEA.mjs";import{usePaginatedQuery as W}from"./packem_shared/usePaginatedQuery-DhQAsxgX.mjs";import{hydratePreloaded as Y,default as Z}from"./packem_shared/hydratePreloaded-qs8nspKB.mjs";import{usePresence as $}from"./packem_shared/usePresence-X5Ax04Cf.mjs";import{default as re}from"./packem_shared/useQuery-Cek_oF7t.mjs";import{useRateLimit as te}from"./packem_shared/useRateLimit-Cckxi8m9.mjs";import{useStream as se}from"./packem_shared/useStream-D8GB__4j.mjs";import{default as pe}from"./packem_shared/useSubscription-CwZgOrE4.mjs";import{default as ne}from"./packem_shared/useSuspenseQuery-CZTk7Kch.mjs";import{useVoiceAgent as me}from"./packem_shared/useVoiceAgent-DAh27XxD.mjs";import{createClientQuery as xe,getErrorCode as le,getRetryAfterMs as ge,isConflictError as Ae,isForbiddenError as ce,isRateLimitedError as he,isUnauthorizedError as Ue}from"@lunora/client";import{RestrictionError as Se,UploadControl as Ce,UploadError as Ee}from"@visulima/storage-client";import{useChunkedRestUpload as Le,useFileInput as Pe,useMultipartUpload as Re,usePasteUpload as ve,useTusUpload as Fe,useUpload as Ie}from"@visulima/storage-client/react";export{o as AuthLoading,t as Authenticated,f as LunoraProvider,Se as RestrictionError,u as Unauthenticated,Ce as UploadControl,Ee as UploadError,xe as createClientQuery,le as getErrorCode,ge as getRetryAfterMs,Y as hydratePreloaded,Ae as isConflictError,ce as isForbiddenError,he as isRateLimitedError,Ue as isUnauthorizedError,m as lunoraQueryOptions,x as useAction,S as useAgent,E as useAgentChat,L as useAgentState,R as useAgentToolEvents,F as useAuth,g as useAuthSessions,a as useAuthState,A as useAuthUsers,Le as useChunkedRestUpload,M as useClientQuery,b as useConnectionStatus,Pe as useFileInput,O as useFlag,k as useFlags,V as useHttpStream,c as useImpersonate,q as useInfiniteQuery,B as useLiveTopic,n as useLunora,Re as useMultipartUpload,G as useMutation,K as useMutator,h as useOrganizations,W as usePaginatedQuery,ve as usePasteUpload,Z as usePreloadedQuery,$ as usePresence,re as useQuery,te as useRateLimit,U as useSignUpInvitations,se as useStream,pe as useSubscription,ne as useSuspenseQuery,Fe as useTusUpload,Ie as useUpload,me as useVoiceAgent};
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ import{c as R}from"react/compiler-runtime";import{useRef as $,useEffect as _}from"react";import{g as b}from"./lunora-provider-_WqSuvf9.mjs";const k=i=>{const e=R(16),{args:a,argsKey:y,client:t,function_:s,onError:o,queryClient:r,queryKey:n,shardKey:u,skipped:c}=i,h=`${s.__lunoraRef}\0${y}\0${u??""}`,S=$(o);let f;e[0]!==o?(f=()=>{S.current=o},e[0]=o,e[1]=f):f=e[1],_(f);let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=E=>{S.current?.(E)},e[2]=p):p=e[2];const g=p;let l;e[3]!==a||e[4]!==t||e[5]!==s||e[6]!==r||e[7]!==n||e[8]!==u||e[9]!==c?(l=()=>c?K:b(t).attach(r,n,s,a,u,{onError:g}),e[3]=a,e[4]=t,e[5]=s,e[6]=r,e[7]=n,e[8]=u,e[9]=c,e[10]=l):l=e[10];let m;e[11]!==t||e[12]!==r||e[13]!==c||e[14]!==h?(m=[t,r,h,c,g],e[11]=t,e[12]=r,e[13]=c,e[14]=h,e[15]=m):m=e[15],_(l,m)},w=async(i,e,a,y,t,s)=>{const o=b(i),r=o.openSnapshotSample(s),n=await i.query(a,y,{shardKey:t});return o.closeSnapshotSample(r)?n:e.getQueryData(s)??n};function K(){}export{w as f,k as u};
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ import{c as g}from"react/compiler-runtime";import{useQueryClient as k,useQuery as q}from"@tanstack/react-query";import{useState as v,useEffect as E}from"react";import{u as F}from"./lunora-provider-_WqSuvf9.mjs";import{u as N,f as T}from"./query-core-DRzrn3qJ.mjs";import{a as C}from"./query-key-BysXrewF.mjs";import{stableWireKey as D}from"@lunora/wire";const O=(s,K,I)=>{const e=g(26),R=I===void 0?{}:I,t=F(),u=k(),{onError:f,shardKey:o}=R,a=K==="skip",y=a?{}:K,l=D(y),r=C(s.__lunoraRef,l,o),[d,b]=v(t.isReady);let n,m;e[0]!==t||e[1]!==d?(n=()=>{d||t.whenReady().then(()=>{b(!0)})},m=[t,d],e[0]=t,e[1]=d,e[2]=n,e[3]=m):(n=e[2],m=e[3]),E(n,m);const Q=a?void 0:t.peekHydratedQueryByKey(s.__lunoraRef,l,o),h=!a&&d;let i;e[4]!==y||e[5]!==t||e[6]!==s||e[7]!==u||e[8]!==r||e[9]!==o?(i=async()=>T(t,u,s,y,o,r),e[4]=y,e[5]=t,e[6]=s,e[7]=u,e[8]=r,e[9]=o,e[10]=i):i=e[10];let c;e[11]!==Q||e[12]!==r||e[13]!==h||e[14]!==i?(c={enabled:h,initialData:Q,queryFn:i,queryKey:r,staleTime:Number.POSITIVE_INFINITY},e[11]=Q,e[12]=r,e[13]=h,e[14]=i,e[15]=c):c=e[15];const{data:S}=q(c);let p;return e[16]!==l||e[17]!==y||e[18]!==t||e[19]!==s||e[20]!==f||e[21]!==u||e[22]!==r||e[23]!==o||e[24]!==a?(p={args:y,argsKey:l,client:t,function_:s,onError:f,queryClient:u,queryKey:r,shardKey:o,skipped:a},e[16]=l,e[17]=y,e[18]=t,e[19]=s,e[20]=f,e[21]=u,e[22]=r,e[23]=o,e[24]=a,e[25]=p):p=e[25],N(p),a?void 0:S};export{O as default};
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ import{c as K}from"react/compiler-runtime";import{useQueryClient as h,useSuspenseQuery as R}from"@tanstack/react-query";import{u as S}from"./lunora-provider-_WqSuvf9.mjs";import{u as I,f as g}from"./query-core-DRzrn3qJ.mjs";import{a as b}from"./query-key-BysXrewF.mjs";import{stableWireKey as k}from"@lunora/wire";const C=(s,c,m)=>{const e=K(21),Q=m===void 0?{}:m,r=S(),u=h(),{onError:n,shardKey:a}=Q,y=c,o=k(y),t=b(s.__lunoraRef,o,a),p=r.isReady?r.peekHydratedQueryByKey(s.__lunoraRef,o,a):void 0;let d;e[0]!==o||e[1]!==y||e[2]!==r||e[3]!==s||e[4]!==u||e[5]!==t||e[6]!==a?(d=async()=>(await r.whenReady(),r.peekHydratedQueryByKey(s.__lunoraRef,o,a)??g(r,u,s,y,a,t)),e[0]=o,e[1]=y,e[2]=r,e[3]=s,e[4]=u,e[5]=t,e[6]=a,e[7]=d):d=e[7];let l;e[8]!==p||e[9]!==t||e[10]!==d?(l={initialData:p,queryFn:d,queryKey:t,staleTime:Number.POSITIVE_INFINITY},e[8]=p,e[9]=t,e[10]=d,e[11]=l):l=e[11];const{data:f}=R(l);let i;return e[12]!==o||e[13]!==y||e[14]!==r||e[15]!==s||e[16]!==n||e[17]!==u||e[18]!==t||e[19]!==a?(i={args:y,argsKey:o,client:r,function_:s,onError:n,queryClient:u,queryKey:t,shardKey:a,skipped:!1},e[12]=o,e[13]=y,e[14]=r,e[15]=s,e[16]=n,e[17]=u,e[18]=t,e[19]=a,e[20]=i):i=e[20],I(i),f};export{C as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/react",
3
- "version": "1.0.0-alpha.242",
3
+ "version": "1.0.0-alpha.243",
4
4
  "description": "React hooks for Lunora: useQuery, useMutation, useSubscription, and useAuth",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -57,9 +57,9 @@
57
57
  "access": "public"
58
58
  },
59
59
  "dependencies": {
60
- "@lunora/client": "1.0.0-alpha.229",
60
+ "@lunora/client": "1.0.0-alpha.230",
61
61
  "@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
62
- "@lunora/ratelimit": "1.0.0-alpha.152",
62
+ "@lunora/ratelimit": "1.0.0-alpha.153",
63
63
  "@lunora/wire": "1.0.0-alpha.1",
64
64
  "@visulima/storage-client": "1.0.9"
65
65
  },
@@ -1,2 +0,0 @@
1
- 'use client';
2
- import{useQueryClient as E,useQuery as I}from"@tanstack/react-query";import{useRef as _,useEffect as l,useCallback as k,useState as q}from"react";import{u as $,g}from"./lunora-provider-_WqSuvf9.mjs";import{a as C}from"./query-key-BysXrewF.mjs";import{stableWireKey as D}from"@lunora/wire";const H=(t,p,h={})=>{const e=$(),n=E(),{onError:d,shardKey:s}=h,u=_(d);l(()=>{u.current=d});const m=k(o=>{u.current?.(o)},[u]),r=p==="skip",y=r?{}:p,c=D(y),a=C(t.__lunoraRef,c,s),R=`${t.__lunoraRef}\0${c}\0${s??""}`,[i,K]=q(e.isReady);l(()=>{i||e.whenReady().then(()=>{K(!0)})},[e,i]);const b=r?void 0:e.peekHydratedQueryByKey(t.__lunoraRef,c,s),{data:Q}=I({enabled:!r&&i,initialData:b,queryFn:async()=>{const o=g(e),S=o.openSnapshotSample(a),f=await e.query(t,y,{shardKey:s});return o.closeSnapshotSample(S)?f:n.getQueryData(a)??f},queryKey:a,staleTime:Number.POSITIVE_INFINITY});return l(()=>r?()=>{}:g(e).attach(n,a,t,y,s,{onError:m}),[e,n,R,r,m]),r?void 0:Q};export{H as default};