@lunora/react 1.0.0-alpha.81 → 1.0.0-alpha.83
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 +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/{cache-DmbajSjf.mjs → cache-BN5T8cAI.mjs} +1 -1
- package/dist/packem_shared/{hydratePreloaded-CcBW4phD.mjs → hydratePreloaded-o9sDozdc.mjs} +1 -1
- package/dist/packem_shared/{lunoraQueryOptions-B5PEocLy.mjs → lunoraQueryOptions-Celdopal.mjs} +1 -1
- package/dist/packem_shared/{query-key-C6iUhRuD.mjs → query-key-BFaqaQy8.mjs} +1 -1
- package/dist/packem_shared/{use-paginated-core-CWfn4qb4.mjs → use-paginated-core-CaKTWQBk.mjs} +1 -1
- package/dist/packem_shared/{useAgent-CNDRZNk_.mjs → useAgent-BOOybemP.mjs} +1 -1
- package/dist/packem_shared/{useAgentChat-CXJldvLG.mjs → useAgentChat-PB0upmu5.mjs} +1 -1
- package/dist/packem_shared/{useAgentState-BOIQjgxe.mjs → useAgentState-DcSalToC.mjs} +1 -1
- package/dist/packem_shared/{useAgentToolEvents-B4gy1Q5z.mjs → useAgentToolEvents-Lg1sM60_.mjs} +1 -1
- package/dist/packem_shared/useAuthSessions-gBDeNFnd.mjs +2 -0
- package/dist/packem_shared/{useInfiniteQuery-C7wp0W2d.mjs → useInfiniteQuery-KtrRC-3l.mjs} +1 -1
- package/dist/packem_shared/{usePaginatedQuery-DJNa8KKD.mjs → usePaginatedQuery-Bqgqg19J.mjs} +1 -1
- package/dist/packem_shared/{useQuery-BUzNP_Vb.mjs → useQuery-8ecExZyF.mjs} +1 -1
- package/dist/packem_shared/{useStream-CmGOT0qj.mjs → useStream-MdOMnlR8.mjs} +1 -1
- package/dist/packem_shared/{useSubscription-BHVICtbD.mjs → useSubscription-B9rxVLlG.mjs} +1 -1
- package/dist/packem_shared/wire-key-DhthMX_1.mjs +1 -0
- package/dist/server.mjs +1 -1
- package/package.json +2 -2
- package/dist/packem_shared/useAuthSessions-Bq4-f3g-.mjs +0 -2
- package/dist/packem_shared/wire-key-L5JSXhhG.mjs +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -270,6 +270,20 @@ type UseOrganizationsOptions = AdminAuthQueryOptions;
|
|
|
270
270
|
* invalidation-on-mutate is wired in.
|
|
271
271
|
*/
|
|
272
272
|
declare const useOrganizations: (options?: UseOrganizationsOptions) => AdminAuthListResult<Record<string, unknown>>;
|
|
273
|
+
/** Options for {@link useSignUpInvitations}. */
|
|
274
|
+
type UseSignUpInvitationsOptions = AdminAuthQueryOptions;
|
|
275
|
+
/**
|
|
276
|
+
* List sign-up invitations (requires the `inviteOnly` plugin). Hits
|
|
277
|
+
* `client.listAuthSignUpInvitations` — an HTTP-only admin-gated read, same
|
|
278
|
+
* transport note as {@link useAuthUsers}.
|
|
279
|
+
*
|
|
280
|
+
* Rows come back unfiltered and newest-first; a row is pending when `acceptedAt`
|
|
281
|
+
* is null and `expiresAt` is in the future. Mutations
|
|
282
|
+
* (`client.createAuthSignUpInvitation`, `client.revokeAuthSignUpInvitation`)
|
|
283
|
+
* stay plain `client.*` calls — call `refetch()` afterward, as the other admin
|
|
284
|
+
* hooks do.
|
|
285
|
+
*/
|
|
286
|
+
declare const useSignUpInvitations: (options?: UseSignUpInvitationsOptions) => AdminAuthListResult<Record<string, unknown>>;
|
|
273
287
|
/** Options for {@link useAuthSessions}. */
|
|
274
288
|
interface UseAuthSessionsOptions extends AdminAuthQueryOptions {
|
|
275
289
|
/** Scope the list to one user's sessions; omit for the global cross-user browser. */
|
|
@@ -1325,4 +1339,4 @@ interface UseVoiceAgentResult {
|
|
|
1325
1339
|
* `createSocket`) so the hook is drivable outside a browser.
|
|
1326
1340
|
*/
|
|
1327
1341
|
declare const useVoiceAgent: (options: UseVoiceAgentOptions) => UseVoiceAgentResult;
|
|
1328
|
-
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 UseMutationCallOptions, type UseOrganizationsOptions, type UsePaginatedQueryOptions, type UsePaginatedQueryResult, type UsePresenceOptions, type UsePresenceResult, type UseQueryOptions, type UseRateLimitOptions, type UseRateLimitResult, 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, useLunora, useMutation, useMutator, useOrganizations, usePaginatedQuery, usePreloadedQuery, usePresence, useQuery, useRateLimit, useStream, useSubscription, useVoiceAgent };
|
|
1342
|
+
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 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, useLunora, useMutation, useMutator, useOrganizations, usePaginatedQuery, usePreloadedQuery, usePresence, useQuery, useRateLimit, useSignUpInvitations, useStream, useSubscription, useVoiceAgent };
|
package/dist/index.d.ts
CHANGED
|
@@ -270,6 +270,20 @@ type UseOrganizationsOptions = AdminAuthQueryOptions;
|
|
|
270
270
|
* invalidation-on-mutate is wired in.
|
|
271
271
|
*/
|
|
272
272
|
declare const useOrganizations: (options?: UseOrganizationsOptions) => AdminAuthListResult<Record<string, unknown>>;
|
|
273
|
+
/** Options for {@link useSignUpInvitations}. */
|
|
274
|
+
type UseSignUpInvitationsOptions = AdminAuthQueryOptions;
|
|
275
|
+
/**
|
|
276
|
+
* List sign-up invitations (requires the `inviteOnly` plugin). Hits
|
|
277
|
+
* `client.listAuthSignUpInvitations` — an HTTP-only admin-gated read, same
|
|
278
|
+
* transport note as {@link useAuthUsers}.
|
|
279
|
+
*
|
|
280
|
+
* Rows come back unfiltered and newest-first; a row is pending when `acceptedAt`
|
|
281
|
+
* is null and `expiresAt` is in the future. Mutations
|
|
282
|
+
* (`client.createAuthSignUpInvitation`, `client.revokeAuthSignUpInvitation`)
|
|
283
|
+
* stay plain `client.*` calls — call `refetch()` afterward, as the other admin
|
|
284
|
+
* hooks do.
|
|
285
|
+
*/
|
|
286
|
+
declare const useSignUpInvitations: (options?: UseSignUpInvitationsOptions) => AdminAuthListResult<Record<string, unknown>>;
|
|
273
287
|
/** Options for {@link useAuthSessions}. */
|
|
274
288
|
interface UseAuthSessionsOptions extends AdminAuthQueryOptions {
|
|
275
289
|
/** Scope the list to one user's sessions; omit for the global cross-user browser. */
|
|
@@ -1325,4 +1339,4 @@ interface UseVoiceAgentResult {
|
|
|
1325
1339
|
* `createSocket`) so the hook is drivable outside a browser.
|
|
1326
1340
|
*/
|
|
1327
1341
|
declare const useVoiceAgent: (options: UseVoiceAgentOptions) => UseVoiceAgentResult;
|
|
1328
|
-
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 UseMutationCallOptions, type UseOrganizationsOptions, type UsePaginatedQueryOptions, type UsePaginatedQueryResult, type UsePresenceOptions, type UsePresenceResult, type UseQueryOptions, type UseRateLimitOptions, type UseRateLimitResult, 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, useLunora, useMutation, useMutator, useOrganizations, usePaginatedQuery, usePreloadedQuery, usePresence, useQuery, useRateLimit, useStream, useSubscription, useVoiceAgent };
|
|
1342
|
+
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 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, useLunora, useMutation, useMutator, useOrganizations, usePaginatedQuery, usePreloadedQuery, usePresence, useQuery, useRateLimit, useSignUpInvitations, useStream, useSubscription, 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-dC08yqew.mjs";import{useAuthState as a}from"./packem_shared/useAuthState-CoOG9XdT.mjs";import{LunoraProvider as
|
|
2
|
+
import{AuthLoading as o,Authenticated as t,Unauthenticated as u}from"./packem_shared/AuthLoading-dC08yqew.mjs";import{useAuthState as a}from"./packem_shared/useAuthState-CoOG9XdT.mjs";import{LunoraProvider as n,useLunora as f}from"./packem_shared/LunoraProvider-DC06S-p1.mjs";import{lunoraQueryOptions as m}from"./packem_shared/lunoraQueryOptions-Celdopal.mjs";import{useAction as x}from"./packem_shared/useAction-CUSJu4yq.mjs";import{useAuthSessions as g,useAuthUsers as A,useImpersonate as h,useOrganizations as U,useSignUpInvitations as c}from"./packem_shared/useAuthSessions-gBDeNFnd.mjs";import{useAgent as C}from"./packem_shared/useAgent-BOOybemP.mjs";import{useAgentChat as S}from"./packem_shared/useAgentChat-PB0upmu5.mjs";import{useAgentState as P}from"./packem_shared/useAgentState-DcSalToC.mjs";import{useAgentToolEvents as R}from"./packem_shared/useAgentToolEvents-Lg1sM60_.mjs";import{default as I}from"./packem_shared/useAuth-x4boOoAR.mjs";import{default as v}from"./packem_shared/useClientQuery-DFs7trEf.mjs";import{default as z}from"./packem_shared/useConnectionStatus-XYsYGiT6.mjs";import{useFlag as T,useFlags as k}from"./packem_shared/useFlag-BDM923ke.mjs";import{useHttpStream as V}from"./packem_shared/useHttpStream-D9vum8Qx.mjs";import{default as q}from"./packem_shared/useInfiniteQuery-KtrRC-3l.mjs";import{useMutation as B}from"./packem_shared/useMutation-BnKec7bE.mjs";import{useMutator as G}from"./packem_shared/useMutator-BtUd-xEA.mjs";import{usePaginatedQuery as K}from"./packem_shared/usePaginatedQuery-Bqgqg19J.mjs";import{hydratePreloaded as W,default as X}from"./packem_shared/hydratePreloaded-o9sDozdc.mjs";import{usePresence as Z}from"./packem_shared/usePresence-BVjZyltT.mjs";import{default as $}from"./packem_shared/useQuery-8ecExZyF.mjs";import{useRateLimit as re}from"./packem_shared/useRateLimit-Cckxi8m9.mjs";import{useStream as te}from"./packem_shared/useStream-MdOMnlR8.mjs";import{default as se}from"./packem_shared/useSubscription-B9rxVLlG.mjs";import{useVoiceAgent as pe}from"./packem_shared/useVoiceAgent-C9NI6Vzl.mjs";import{createClientQuery as fe,getErrorCode as ie,getRetryAfterMs as me,isConflictError as de,isForbiddenError as xe,isRateLimitedError as le,isUnauthorizedError as ge}from"@lunora/client";import{RestrictionError as he,UploadControl as Ue,UploadError as ce}from"@visulima/storage-client";import{useChunkedRestUpload as Ce,useFileInput as Ee,useMultipartUpload as Se,usePasteUpload as Qe,useTusUpload as Pe,useUpload as Le}from"@visulima/storage-client/react";export{o as AuthLoading,t as Authenticated,n as LunoraProvider,he as RestrictionError,u as Unauthenticated,Ue as UploadControl,ce as UploadError,fe as createClientQuery,ie as getErrorCode,me as getRetryAfterMs,W as hydratePreloaded,de as isConflictError,xe as isForbiddenError,le as isRateLimitedError,ge as isUnauthorizedError,m as lunoraQueryOptions,x as useAction,C as useAgent,S as useAgentChat,P as useAgentState,R as useAgentToolEvents,I as useAuth,g as useAuthSessions,a as useAuthState,A as useAuthUsers,Ce as useChunkedRestUpload,v as useClientQuery,z as useConnectionStatus,Ee as useFileInput,T as useFlag,k as useFlags,V as useHttpStream,h as useImpersonate,q as useInfiniteQuery,f as useLunora,Se as useMultipartUpload,B as useMutation,G as useMutator,U as useOrganizations,K as usePaginatedQuery,Qe as usePasteUpload,X as usePreloadedQuery,Z as usePresence,$ as useQuery,re as useRateLimit,c as useSignUpInvitations,te as useStream,se as useSubscription,Pe as useTusUpload,Le as useUpload,pe as useVoiceAgent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as u}from"./query-key-
|
|
1
|
+
import{k as u}from"./query-key-BFaqaQy8.mjs";class g{constructor(e){this.client=e}client;entries=new Map;keyOf(e){return u(e)}attach(e,c,f,b,h,k={}){const s=u(c);let r=this.entries.get(s);if(!r){r={errorCallbacks:new Set,refCount:0,unsubscribe:void 0},this.entries.set(s,r);const t=r;try{r.unsubscribe=this.client.subscribe(f,b,n=>{e.setQueryData(c,n)},{onError:n=>{for(const d of t.errorCallbacks)d(n)},shardKey:h})}catch(n){throw this.entries.delete(s),n}}r.refCount+=1;const{onError:o}=k;o&&r.errorCallbacks.add(o);let a=!1;return()=>{if(a)return;a=!0;const t=this.entries.get(s);t&&(t.refCount-=1,o&&t.errorCallbacks.delete(o),t.refCount<=0&&(t.unsubscribe?.(),this.entries.delete(s)))}}}const l=new WeakMap,C=i=>{let e=l.get(i);return e||(e=new g(i),l.set(i,e)),e};export{C as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{c as _}from"react/compiler-runtime";import{useQueryClient as b,useQuery as q}from"@tanstack/react-query";import{useRef as K,useEffect as Q}from"react";import{g as P}from"./cache-
|
|
2
|
+
import{c as _}from"react/compiler-runtime";import{useQueryClient as b,useQuery as q}from"@tanstack/react-query";import{useRef as K,useEffect as Q}from"react";import{g as P}from"./cache-BN5T8cAI.mjs";import{useLunora as v}from"./LunoraProvider-DC06S-p1.mjs";import{l as N,s as S}from"./query-key-BFaqaQy8.mjs";const T=function(a,e){const r=_(9);let o;r[0]!==e?(o=e===void 0?{}:e,r[0]=e,r[1]=o):o=r[1];const n=o,t=v(),s=b(),p=K(n.onError);let i;r[2]!==n.onError?(i=()=>{p.current=n.onError},r[2]=n.onError,r[3]=i):i=r[3],Q(i);let u;r[4]===Symbol.for("react.memo_cache_sentinel")?(u=I=>{p.current?.(I)},r[4]=u):u=r[4];const E=u,{args:l,functionPath:R,shardKey:f,value:g}=a,y={__lunoraRef:R},m=N(y,l,f),{data:h}=q({initialData:g,queryFn:()=>t.query(y,l,{shardKey:f}),queryKey:m,staleTime:Number.POSITIVE_INFINITY}),d=S(m);let c;return r[5]!==t||r[6]!==s||r[7]!==d?(c=[t,s,d,E],r[5]=t,r[6]=s,r[7]=d,r[8]=c):c=r[8],Q(()=>P(t).attach(s,m,y,l,f,{onError:E}),c),h===void 0?g:h},L=function(a,e={}){return T(a,e)};export{T as default,L as hydratePreloaded};
|
package/dist/packem_shared/{lunoraQueryOptions-B5PEocLy.mjs → lunoraQueryOptions-Celdopal.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as u}from"./query-key-
|
|
1
|
+
import{l as u}from"./query-key-BFaqaQy8.mjs";const t=(a,r,s,e={})=>{const y=s??{};return{queryFn:()=>a.query(r,y,{shardKey:e.shardKey}),queryKey:u(r,y,e.shardKey),staleTime:Number.POSITIVE_INFINITY}};export{t as lunoraQueryOptions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as r}from"./wire-key-
|
|
1
|
+
import{s as r}from"./wire-key-DhthMX_1.mjs";const o=e=>r(e),n=(e,s,a)=>["lunora",e.__lunoraRef,s,a??null],t=e=>o(e);export{o as k,n as l,t as s};
|
package/dist/packem_shared/{use-paginated-core-CWfn4qb4.mjs → use-paginated-core-CaKTWQBk.mjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{initialPages as x,rebalance as N,derivePaginationStatus as D,applyLoadMore as T}from"@lunora/client/pagination";import{useQueryClient as B}from"@tanstack/react-query";import{useRef as m,useReducer as G,useState as F,useEffect as y,useCallback as J}from"react";import{g as U}from"./cache-
|
|
2
|
+
import{initialPages as x,rebalance as N,derivePaginationStatus as D,applyLoadMore as T}from"@lunora/client/pagination";import{useQueryClient as B}from"@tanstack/react-query";import{useRef as m,useReducer as G,useState as F,useEffect as y,useCallback as J}from"react";import{g as U}from"./cache-BN5T8cAI.mjs";import{useLunora as V}from"./LunoraProvider-DC06S-p1.mjs";import{s as u,l as v}from"./query-key-BFaqaQy8.mjs";const W=function(i){const l=m(void 0);return l.current??=i(),l},te=function(i,l,C){const f=V(),c=B(),{initialNumItems:R,shardKey:p}=C,d=l==="skip",g=d?{}:l,[,O]=G(e=>e+1,0),[q,h]=F(()=>x(R)),[z,k]=F(void 0),w=m(C.onError);y(()=>{w.current=C.onError});const Q=`${u(v(i,g,p))}::${String(R)}`,A=m(Q);A.current!==Q&&(A.current=Q,h(x(R)),k(void 0));const K=q.map(e=>{const t={...g,paginationOpts:{cursor:e.lower,endCursor:e.upper,numItems:e.numItems}},r=v(i,t,p);return{args:t,key:r}}),P=K.map(({key:e})=>u(e)).join("|"),b=m({baseArgs:g,entries:[],fn:i,shardKey:p});y(()=>{b.current={baseArgs:g,entries:K,fn:i,shardKey:p}});const L=(e,t,r)=>{k(r),h(o=>{const s=b.current,n=o.at(-1);if(o.length<=1||!n||c.getQueryData(t)!==void 0)return o;const S={...s.baseArgs,paginationOpts:{cursor:n.lower,endCursor:n.upper,numItems:n.numItems}};return u(v(s.fn,S,s.shardKey))===e?o.slice(0,-1):o}),w.current?.(r)},E=W(()=>new Map),M=m(f);y(()=>{const e=E.current;if(M.current!==f){for(const s of e.values())s();e.clear(),M.current=f}if(d){for(const s of e.values())s();e.clear();return}const t=b.current,r=U(f),o=new Set(t.entries.map(({key:s})=>u(s)));for(const[s,n]of e)o.has(s)||(n(),e.delete(s));for(const s of t.entries){const n=u(s.key);if(e.has(n))continue;c.fetchQuery({queryFn:()=>f.query(t.fn,s.args,{shardKey:t.shardKey}),queryKey:s.key,staleTime:0}).catch(a=>{L(n,s.key,a instanceof Error?{code:a.code,message:a.message}:{message:String(a)})}),e.set(n,r.attach(c,s.key,t.fn,s.args,t.shardKey,{onError:a=>{L(n,s.key,a)}}))}},[f,c,P,d]),y(()=>()=>{for(const e of E.current.values())e();E.current.clear()},[]),y(()=>c.getQueryCache().subscribe(r=>{if(r.type!=="updated")return;const o=u(r.query.queryKey);K.some(({key:s})=>u(s)===o)&&(k(void 0),O())}),[c,P]);const I=d?[]:K.map(({key:e})=>c.getQueryData(e));y(()=>{if(d)return;const e=N(q,I);e&&h(e)});const{status:$}=D(d,I),j=J(e=>{k(void 0),h(t=>{const r=b.current,o=t.map(a=>{const H={...r.baseArgs,paginationOpts:{cursor:a.lower,endCursor:a.upper,numItems:a.numItems}};return c.getQueryData(v(r.fn,H,r.shardKey))}),{nextCursor:s,status:n}=D(!1,o);return T(t,n==="CanLoadMore"?s:void 0,e)??t})},[c]);return{error:z,loadMore:j,pageResults:I,status:$}};export{te as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{c as N}from"react/compiler-runtime";import{useMutation as R}from"./useMutation-BnKec7bE.mjs";import O from"./useSubscription-
|
|
2
|
+
import{c as N}from"react/compiler-runtime";import{useMutation as R}from"./useMutation-BnKec7bE.mjs";import O from"./useSubscription-B9rxVLlG.mjs";const b={__lunoraRef:""},F=_=>{const t=N(20),{api:A,cancel:a,onError:d,run:I,runArgs:f,threadKey:e}=_,s=R(I),T=R(a??b);let c;t[0]!==e?(c={key:e},t[0]=e,t[1]=c):c=t[1];let r;t[2]!==d?(r={onError:d},t[2]=d,t[3]=r):r=t[3];const{data:v,error:p}=O(A.agents.agentThread,c,r),n=v,g=n?.status,o=n?.instanceId,{mutate:m}=s,{mutate:M}=T;let i;t[4]!==f||t[5]!==m||t[6]!==e?(i=async(w,E)=>{await m({input:w,threadKey:e,...f,...E})},t[4]=f,t[5]=m,t[6]=e,t[7]=i):i=t[7];const h=i;let u;t[8]!==M||t[9]!==a||t[10]!==o||t[11]!==e?(u=async()=>{a===void 0||o===void 0||await M({instanceId:o,threadKey:e})},t[8]=M,t[9]=a,t[10]=o,t[11]=e,t[12]=u):u=t[12];const y=u;let l;return t[13]!==y||t[14]!==p||t[15]!==h||t[16]!==s.pending||t[17]!==g||t[18]!==n?(l={cancel:y,error:p,pending:s.pending,run:h,status:g,thread:n},t[13]=y,t[14]=p,t[15]=h,t[16]=s.pending,t[17]=g,t[18]=n,t[19]=l):l=t[19],l};export{F as useAgent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{reconcileOptimistic as M,maxSeq as R}from"@lunora/client";import{useState as Q,useRef as S}from"react";import{useMutation as u}from"./useMutation-BnKec7bE.mjs";import{useStream as V}from"./useStream-
|
|
2
|
+
import{reconcileOptimistic as M,maxSeq as R}from"@lunora/client";import{useState as Q,useRef as S}from"react";import{useMutation as u}from"./useMutation-BnKec7bE.mjs";import{useStream as V}from"./useStream-MdOMnlR8.mjs";import A from"./useSubscription-B9rxVLlG.mjs";const W={__lunoraRef:""},X={__lunoraRef:""},Z=[],it=E=>{const{api:a,cancel:m,limit:d,onError:l,send:_,sendArgs:k,stream:p,threadKey:e}=E,x=d===void 0?{key:e}:{key:e,limit:d},{data:w,error:O}=A(a.agents.agentMessages,x,{onError:l}),{data:T,error:b}=A(a.agents.agentThread,{key:e},{onError:l}),I=p===void 0?"skip":{key:e},{chunks:j}=V(p??X,I),q=u(_),C=u(m??W),D=u(a.agents.agentResolveApproval),[K,c]=Q([]),f=S(0),h=S(e);h.current!==e&&(h.current=e,c([]));const g=T,N=g?.status,o=g?.instanceId,s=w??Z,v=M(K,s),F=R(s),G=v.length===0?s:[...s,...v.map((t,n)=>({content:t.content,optimistic:!0,role:"user",seq:F+1+n}))],P=s.filter(t=>t.role==="assistant").length,U=j.filter(t=>t.kind!=="progress"&&t.threadKey===e&&t.turn>=P).map(t=>t.text).join(""),{mutate:Y}=q,{mutate:$}=C,{mutate:z}=D,B=async(t,n)=>{const r=f.current;f.current+=1;const H=R(s);c(i=>[...M(i,s),{content:t,id:r,maxDurableSeqAtSend:H}]);try{await Y({input:t,threadKey:e,...k,...n})}catch(i){throw c(J=>J.filter(L=>L.id!==r)),i}},y=async(t,n,r)=>{if(o===void 0)throw new Error(`useAgentChat: cannot ${t} — no in-flight run (thread has no instanceId)`);await z({decision:t,instanceId:o,threadKey:e,toolCallId:n,...r===void 0?{}:{note:r}})};return{approve:(t,n)=>y("approve",t,n),cancel:async()=>{m===void 0||o===void 0||await $({instanceId:o,threadKey:e})},error:O??b,messages:G,reject:(t,n)=>y("reject",t,n),send:B,status:N,streamingText:U}};export{it as useAgentChat};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{c as o}from"react/compiler-runtime";import d from"./useSubscription-
|
|
2
|
+
import{c as o}from"react/compiler-runtime";import d from"./useSubscription-B9rxVLlG.mjs";const l=t=>{const e=o(5);let r;e[0]!==t.threadKey?(r={key:t.threadKey},e[0]=t.threadKey,e[1]=r):r=e[1];const{data:n,error:s}=d(t.api.agents.agentState,r),c=n;let a;return e[2]!==s||e[3]!==c?(a={error:s,state:c},e[2]=s,e[3]=c,e[4]=a):a=e[4],a};export{l as useAgentState};
|
package/dist/packem_shared/{useAgentToolEvents-B4gy1Q5z.mjs → useAgentToolEvents-Lg1sM60_.mjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{c as y}from"react/compiler-runtime";import{useStream as I}from"./useStream-
|
|
2
|
+
import{c as y}from"react/compiler-runtime";import{useStream as I}from"./useStream-MdOMnlR8.mjs";import N from"./useSubscription-B9rxVLlG.mjs";const E={__lunoraRef:""},_=[],k=o=>{if(o.role==="assistant"&&o.toolCalls)return o.toolCalls.map(t=>({input:t.input,seq:o.seq,toolCallId:t.id,toolName:t.name,type:"call"}));if(o.role==="tool")return o.status==="awaiting_approval"?[{seq:o.seq,type:"awaiting-approval",...o.toolCallId===void 0?{}:{toolCallId:o.toolCallId},...o.toolName===void 0?{}:{toolName:o.toolName}}]:[{output:o.content,seq:o.seq,type:"result",...o.status==="approved"||o.status==="rejected"?{status:o.status}:{},...o.toolCallId===void 0?{}:{toolCallId:o.toolCallId},...o.toolName===void 0?{}:{toolName:o.toolName}}]},A=o=>{const t=y(12),{api:c,limit:r,stream:n,threadKey:l}=o;let a;t[0]!==r||t[1]!==l?(a=r===void 0?{key:l}:{key:l,limit:r},t[0]=r,t[1]=l,t[2]=a):a=t[2];const f=a,{data:v}=N(c.agents.agentMessages,f);let i;t[3]!==n||t[4]!==l?(i=n===void 0?"skip":{key:l},t[3]=n,t[4]=l,t[5]=i):i=t[5];const C=i,{chunks:p}=I(n??E,C),s=v??_;let e;if(t[6]!==p||t[7]!==s||t[8]!==l){e=s.flatMap(q);for(const d of p)d.kind==="progress"&&d.threadKey===l&&e.push({data:d.data,toolCallId:d.toolCallId,type:"progress"});t[6]=p,t[7]=s,t[8]=l,t[9]=e}else e=t[9];let u;return t[10]!==e?(u={events:e},t[10]=e,t[11]=u):u=t[11],u};function q(o){return k(o)??[]}export{A as useAgentToolEvents};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{c as A}from"react/compiler-runtime";import{useMutation as y,useQuery as z,keepPreviousData as I}from"@tanstack/react-query";import{useState as _,useSyncExternalStore as b}from"react";import{useLunora as S}from"./LunoraProvider-DC06S-p1.mjs";const U="lunora-react-admin-auth",D=50;function v(t,e,o,u={}){const{enabled:r=!0,pageSize:c=D}=u,[i,s]=_(c),a=b(g=>t.onAuthTokenChange(g),()=>t.currentIdentity(),()=>t.currentIdentity()),n=[U,a??"anon",...e,i],l=z({enabled:r,placeholderData:I,queryFn:()=>o(i),queryKey:n,staleTime:0}),d=l.data?.rows,f=l.data?.total,m=f!==void 0&&d!==void 0&&d.length<f,p=()=>{m&&s(g=>g+c)},h=()=>{l.refetch().catch(()=>{})};return{data:d,error:l.error??void 0,hasMore:m,loadMore:p,loading:l.isLoading,refetch:h,total:f}}const $=t=>{const e=A(20);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const u=o,r=S(),{enabled:c,filterField:i,filterValue:s,pageSize:a,search:n,searchField:l,sortBy:d,sortDirection:f}=u;let m;e[2]!==i||e[3]!==s||e[4]!==n||e[5]!==l||e[6]!==d||e[7]!==f?(m=["users",{filterField:i,filterValue:s,search:n,searchField:l,sortBy:d,sortDirection:f}],e[2]=i,e[3]=s,e[4]=n,e[5]=l,e[6]=d,e[7]=f,e[8]=m):m=e[8];let p;e[9]!==r||e[10]!==i||e[11]!==s||e[12]!==n||e[13]!==l||e[14]!==d||e[15]!==f?(p=g=>r.listAuthUsers({filterField:i,filterValue:s,limit:g,search:n,searchField:l,sortBy:d,sortDirection:f}),e[9]=r,e[10]=i,e[11]=s,e[12]=n,e[13]=l,e[14]=d,e[15]=f,e[16]=p):p=e[16];let h;return e[17]!==c||e[18]!==a?(h={enabled:c,pageSize:a},e[17]=c,e[18]=a,e[19]=h):h=e[19],v(r,m,p,h)},M=t=>{const e=A(8);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const u=o,r=S(),{enabled:c,pageSize:i}=u;let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=["organizations"],e[2]=s):s=e[2];let a;e[3]!==r?(a=l=>r.listAuthOrganizations({limit:l}),e[3]=r,e[4]=a):a=e[4];let n;return e[5]!==c||e[6]!==i?(n={enabled:c,pageSize:i},e[5]=c,e[6]=i,e[7]=n):n=e[7],v(r,s,a,n)},T=t=>{const e=A(8);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const u=o,r=S(),{enabled:c,pageSize:i}=u;let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=["sign-up-invitations"],e[2]=s):s=e[2];let a;e[3]!==r?(a=l=>r.listAuthSignUpInvitations({limit:l}),e[3]=r,e[4]=a):a=e[4];let n;return e[5]!==c||e[6]!==i?(n={enabled:c,pageSize:i},e[5]=c,e[6]=i,e[7]=n):n=e[7],v(r,s,a,n)},q=t=>{const e=A(10);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const u=o,r=S(),{enabled:c,pageSize:i,userId:s}=u;let a;e[2]!==s?(a=["sessions",{userId:s}],e[2]=s,e[3]=a):a=e[3];let n;e[4]!==r||e[5]!==s?(n=d=>r.listAuthSessions({limit:d,userId:s}),e[4]=r,e[5]=s,e[6]=n):n=e[6];let l;return e[7]!==c||e[8]!==i?(l={enabled:c,pageSize:i},e[7]=c,e[8]=i,e[9]=l):l=e[9],v(r,a,n,l)},k=()=>{const t=A(10),e=S();let o;t[0]!==e?(o={mutationFn:l=>e.impersonateAuthUser({userId:l})},t[0]=e,t[1]=o):o=t[1];const u=y(o),{mutateAsync:r,reset:c}=u;let i;t[2]!==r?(i=l=>r(l),t[2]=r,t[3]=i):i=t[3];const s=i,a=u.error??void 0;let n;return t[4]!==s||t[5]!==u.data||t[6]!==u.isPending||t[7]!==c||t[8]!==a?(n={data:u.data,error:a,impersonate:s,pending:u.isPending,reset:c},t[4]=s,t[5]=u.data,t[6]=u.isPending,t[7]=c,t[8]=a,t[9]=n):n=t[9],n};export{q as useAuthSessions,$ as useAuthUsers,k as useImpersonate,M as useOrganizations,T as useSignUpInvitations};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{c as M}from"react/compiler-runtime";import{useRef as R,useEffect as y}from"react";import{u as C}from"./use-paginated-core-
|
|
2
|
+
import{c as M}from"react/compiler-runtime";import{useRef as R,useEffect as y}from"react";import{u as C}from"./use-paginated-core-CaKTWQBk.mjs";const v=(x,c,N)=>{const e=M(16),{initialNumItems:s}=N,{error:u,loadMore:o,pageResults:m,status:a}=C(x,c==="skip"?"skip":c,N),P=c==="skip";let t;if(e[0]!==m){t=[];for(const f of m)f&&t.push(f.page);e[0]=m,e[1]=t}else t=e[1];let i;e[2]!==s||e[3]!==o?(i={defaultNumItems:s,loadMore:o},e[2]=s,e[3]=o,e[4]=i):i=e[4];const h=R(i);let n;e[5]!==s||e[6]!==o?(n=()=>{h.current={defaultNumItems:s,loadMore:o}},e[5]=s,e[6]=o,e[7]=n):n=e[7],y(n);let r;e[8]===Symbol.for("react.memo_cache_sentinel")?(r=f=>{const{defaultNumItems:k,loadMore:L}=h.current;L(f??k)},e[8]=r):r=e[8];const I=r,d=a==="CanLoadMore",p=!P&&a==="LoadingMore",g=!P&&a==="LoadingFirstPage";let l;return e[9]!==u||e[10]!==t||e[11]!==a||e[12]!==d||e[13]!==p||e[14]!==g?(l={error:u,fetchNextPage:I,hasNextPage:d,isFetchingNextPage:p,isLoading:g,pages:t,status:a},e[9]=u,e[10]=t,e[11]=a,e[12]=d,e[13]=p,e[14]=g,e[15]=l):l=e[15],l};export{v as default};
|
package/dist/packem_shared/{usePaginatedQuery-DJNa8KKD.mjs → usePaginatedQuery-Bqgqg19J.mjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{c}from"react/compiler-runtime";import{u as f}from"./use-paginated-core-
|
|
2
|
+
import{c}from"react/compiler-runtime";import{u as f}from"./use-paginated-core-CaKTWQBk.mjs";const L=(d,i,l)=>{const e=c(8),{error:r,loadMore:p,pageResults:n,status:t}=f(d,i==="skip"?"skip":i,l);let s;if(e[0]!==n){s=[];for(const u of n)u&&s.push(...u.page);e[0]=n,e[1]=s}else s=e[1];const a=!(i==="skip")&&(t==="LoadingFirstPage"||t==="LoadingMore");let o;return e[2]!==r||e[3]!==p||e[4]!==s||e[5]!==t||e[6]!==a?(o={error:r,isLoading:a,loadMore:p,results:s,status:t},e[2]=r,e[3]=p,e[4]=s,e[5]=t,e[6]=a,e[7]=o):o=e[7],o};export{L as usePaginatedQuery};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{useQueryClient as h,useQuery as E}from"@tanstack/react-query";import{useRef as b,useEffect as n,useCallback as g,useState as I}from"react";import{g as k}from"./cache-
|
|
2
|
+
import{useQueryClient as h,useQuery as E}from"@tanstack/react-query";import{useRef as b,useEffect as n,useCallback as g,useState as I}from"react";import{g as k}from"./cache-BN5T8cAI.mjs";import{useLunora as q}from"./LunoraProvider-DC06S-p1.mjs";import{l as K,s as C}from"./query-key-BFaqaQy8.mjs";const F=(t,i,p={})=>{const e=q(),y=h(),{onError:c,shardKey:s}=p,d=b(c);n(()=>{d.current=c});const l=g(m=>{d.current?.(m)},[]),r=i==="skip",o=r?{}:i,a=K(t,o,s),[u,f]=I(e.isReady);n(()=>{u||e.whenReady().then(()=>{f(!0)})},[e,u]);const Q=r?void 0:e.peekHydratedQuery(t.__lunoraRef,o,s),{data:R}=E({enabled:!r&&u,initialData:Q,queryFn:()=>e.query(t,o,{shardKey:s}),queryKey:a,staleTime:Number.POSITIVE_INFINITY});return n(()=>r?()=>{}:k(e).attach(y,a,t,o,s,{onError:l}),[e,y,C(a),r,l]),r?void 0:R};export{F as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{c as K}from"react/compiler-runtime";import{useReducer as B,useRef as R,useEffect as _}from"react";import{useLunora as v}from"./LunoraProvider-DC06S-p1.mjs";import{s as S,c as z}from"./stream-state-abygFxmy.mjs";import{s as E}from"./wire-key-
|
|
2
|
+
import{c as K}from"react/compiler-runtime";import{useReducer as B,useRef as R,useEffect as _}from"react";import{useLunora as v}from"./LunoraProvider-DC06S-p1.mjs";import{s as S,c as z}from"./stream-state-abygFxmy.mjs";import{s as E}from"./wire-key-DhthMX_1.mjs";const A=(u,a,l)=>{const e=K(27);let c;e[0]!==l?(c=l===void 0?{}:l,e[0]=l,e[1]=c):c=e[1];const r=c,o=v();let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f={chunks:[],error:void 0,status:"idle"},e[2]=f):f=e[2];const[t,m]=B(S,f),s=a==="skip";let n;e[3]!==a||e[4]!==s?(n=s?"skip":E(a),e[3]=a,e[4]=s,e[5]=n):n=e[5];const y=n,b=R(void 0);let i;e[6]!==a||e[7]!==o||e[8]!==u||e[9]!==r.durable||e[10]!==r.maxBuffer||e[11]!==r.shardKey||e[12]!==s?(i=()=>{if(s)return m({type:"reset"}),L;m({type:"reset"}),m({type:"start"});const{cancel:k,cleanup:x}=z(o.stream(u,a,{durable:r.durable,maxBuffer:r.maxBuffer,shardKey:r.shardKey}),m);return b.current=k,()=>{x(),b.current=void 0}},e[6]=a,e[7]=o,e[8]=u,e[9]=r.durable,e[10]=r.maxBuffer,e[11]=r.shardKey,e[12]=s,e[13]=i):i=e[13];let d;e[14]!==o||e[15]!==u.__lunoraRef||e[16]!==r.durable||e[17]!==r.maxBuffer||e[18]!==r.shardKey||e[19]!==y||e[20]!==s?(d=[o,u.__lunoraRef,y,s,r.shardKey,r.maxBuffer,r.durable],e[14]=o,e[15]=u.__lunoraRef,e[16]=r.durable,e[17]=r.maxBuffer,e[18]=r.shardKey,e[19]=y,e[20]=s,e[21]=d):d=e[21],_(i,d);let p;e[22]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{b.current?.()},e[22]=p):p=e[22];let h;return e[23]!==t.chunks||e[24]!==t.error||e[25]!==t.status?(h={cancel:p,chunks:t.chunks,error:t.error,status:t.status},e[23]=t.chunks,e[24]=t.error,e[25]=t.status,e[26]=h):h=e[26],h};function L(){}export{A as useStream};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{c as x}from"react/compiler-runtime";import{createQuerySubscription as A}from"@lunora/client/query";import{LunoraError as D}from"@lunora/errors";import{useState as F,useRef as S,useEffect as v}from"react";import{useLunora as M}from"./LunoraProvider-DC06S-p1.mjs";import{s as Q}from"./wire-key-
|
|
2
|
+
import{c as x}from"react/compiler-runtime";import{createQuerySubscription as A}from"@lunora/client/query";import{LunoraError as D}from"@lunora/errors";import{useState as F,useRef as S,useEffect as v}from"react";import{useLunora as M}from"./LunoraProvider-DC06S-p1.mjs";import{s as Q}from"./wire-key-DhthMX_1.mjs";const H=(o,r,a)=>{const e=x(24);let l;e[0]!==a?(l=a===void 0?{}:a,e[0]=a,e[1]=l):l=e[1];const t=l,n=M();let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={data:void 0,error:void 0},e[2]=c):c=e[2];const[k,E]=F(c),s=r==="skip";let d;e[3]!==r||e[4]!==s?(d=s?"skip":Q(r),e[3]=r,e[4]=s,e[5]=d):d=e[5];const b=d,K=S(t.onError);let f;e[6]!==t.onError?(f=()=>{K.current=t.onError},e[6]=t.onError,e[7]=f):f=e[7],v(f);let u;e[8]!==r||e[9]!==o?(u={args:r,fn:o},e[8]=r,e[9]=o,e[10]=u):u=e[10];const R=S(u);let m;e[11]!==r||e[12]!==o?(m=()=>{R.current={args:r,fn:o}},e[11]=r,e[12]=o,e[13]=m):m=e[13],v(m);let p;e[14]!==n||e[15]!==t.shardKey||e[16]!==s?(p=()=>{if(s)return E({data:void 0,error:void 0}),W;let h=!1;const{args:w,fn:z}=R.current,L=A(n,z,w,{onData:i=>{h||E({data:i,error:void 0})},onError:i=>{const q=i.code===void 0?new Error(i.message):new D(i.code,i.message);K.current?.(i),queueMicrotask(()=>{h||E({data:void 0,error:q})})}},{shardKey:t.shardKey});return()=>{h=!0,L()}},e[14]=n,e[15]=t.shardKey,e[16]=s,e[17]=p):p=e[17];let y;return e[18]!==n||e[19]!==o.__lunoraRef||e[20]!==t.shardKey||e[21]!==b||e[22]!==s?(y=[n,o.__lunoraRef,b,t.shardKey,s],e[18]=n,e[19]=o.__lunoraRef,e[20]=t.shardKey,e[21]=b,e[22]=s,e[23]=y):y=e[23],v(p,y),k};function W(){}export{H as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as p}from"./stable-key-B_BlboiY.mjs";const y=r=>{let n="";for(let c=0;c<r.length;c+=32768)n+=String.fromCharCode(...r.subarray(c,c+32768));return btoa(n)},t="$lunora.wire$",d=64,m="__proto__",g=r=>{if(r===null||typeof r!="object")return!1;const n=Object.getPrototypeOf(r);return n===null||n===Object.prototype},i=(r,n=0)=>{if(n>d)throw new RangeError(`wire-codec: value nesting exceeds the ${d}-level limit`);if(r===void 0)return[t,"undefined"];if(r===null)return null;const a=typeof r;if(a==="bigint")return[t,"bigint",r.toString()];if(a==="number"){const e=r;return Number.isNaN(e)?[t,"nan"]:e===1/0?[t,"inf"]:e===-1/0?[t,"-inf"]:e}if(a!=="object")return r;if(r instanceof Date)return[t,"date",i(r.getTime(),n+1)];if(r instanceof Error){const e=r,o={};for(const f of Object.keys(e)){if(e[f]===void 0)continue;const b=i(e[f],n+1);f===m?Object.defineProperty(o,f,{configurable:!0,enumerable:!0,value:b,writable:!0}):o[f]=b}const s=[t,"error",e.name,e.message,o];return e.cause!==void 0&&s.push(i(e.cause,n+1)),s}if(r instanceof URL)return[t,"url",r.href];if(r instanceof Map)return[t,"map",[...r.entries()].map(([e,o])=>[i(e,n+1),i(o,n+1)])];if(r instanceof Set)return[t,"set",[...r].map(e=>i(e,n+1))];if(r instanceof ArrayBuffer)return[t,"bytes",y(new Uint8Array(r)),"ArrayBuffer"];if(ArrayBuffer.isView(r)){const e=r,o=e.constructor.name,s=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return o==="Uint8Array"?[t,"bytes",y(s)]:[t,"bytes",y(s),o]}if(Array.isArray(r)){const e=r.map(o=>i(o,n+1));return e.length>0&&e[0]===t?[t,"arr",e]:e}if(!g(r)){const e=r.constructor?.name??"value";throw new TypeError(`wire-codec: cannot encode a ${e} over the Lunora wire — only plain objects, arrays, and the supported built-ins (Date, Error, URL, Map, Set, ArrayBuffer/typed arrays, bigint) round-trip`)}const c=r,u={};for(const e of Object.keys(c)){const o=c[e];if(o===void 0)continue;const s=i(o,n+1);e===m?Object.defineProperty(u,e,{configurable:!0,enumerable:!0,value:s,writable:!0}):u[e]=s}return u},l=r=>p(i(r));export{l as s};
|
package/dist/server.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createServerClient as o}from"@lunora/client/ssr";import{createServerClient as K,deserializePreloaded as f,getServerSession as Q,serializePreloaded as x}from"@lunora/client/ssr";import{l as d}from"./packem_shared/query-key-
|
|
1
|
+
import{createServerClient as o}from"@lunora/client/ssr";import{createServerClient as K,deserializePreloaded as f,getServerSession as Q,serializePreloaded as x}from"@lunora/client/ssr";import{l as d}from"./packem_shared/query-key-BFaqaQy8.mjs";import{lunoraQueryOptions as S}from"./packem_shared/lunoraQueryOptions-Celdopal.mjs";import{preloadQuery as v,preloadedQueryResult as N}from"@lunora/client";import{HydrationBoundary as T,dehydrate as g}from"@tanstack/react-query";const u=async(r,a,e,t,y={})=>{const s=t??{};await r.prefetchQuery({queryFn:()=>a.query(e,s,{shardKey:y.shardKey}),queryKey:d(e,s,y.shardKey),staleTime:Number.POSITIVE_INFINITY})},h=async(r,a,e,t={})=>o(r).query(a,e,{shardKey:t.shardKey}),i=async(r,a,e,t={})=>o(r).mutation(a,e,{shardKey:t.shardKey}),l=async(r,a,e,t={})=>o(r).action(a,e,{shardKey:t.shardKey});export{T as HydrationBoundary,K as createServerClient,g as dehydrate,f as deserializePreloaded,l as fetchAction,i as fetchMutation,h as fetchQuery,Q as getServerSession,S as lunoraQueryOptions,u as prefetchQuery,v as preloadQuery,N as preloadedQueryResult,x as serializePreloaded};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/react",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.83",
|
|
4
4
|
"description": "React hooks for Lunora: useQuery, useMutation, useSubscription, and useAuth",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@lunora/client": "1.0.0-alpha.
|
|
60
|
+
"@lunora/client": "1.0.0-alpha.78",
|
|
61
61
|
"@lunora/errors": "1.0.0-alpha.31",
|
|
62
62
|
"@lunora/ratelimit": "1.0.0-alpha.38",
|
|
63
63
|
"@visulima/storage-client": "1.0.2"
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import{c as A}from"react/compiler-runtime";import{useMutation as v,useQuery as z,keepPreviousData as I}from"@tanstack/react-query";import{useState as _,useSyncExternalStore as b}from"react";import{useLunora as y}from"./LunoraProvider-DC06S-p1.mjs";const D="lunora-react-admin-auth",E=50;function S(t,e,r,u={}){const{enabled:a=!0,pageSize:c=E}=u,[i,s]=_(c),l=b(g=>t.onAuthTokenChange(g),()=>t.currentIdentity(),()=>t.currentIdentity()),n=[D,l??"anon",...e,i],o=z({enabled:a,placeholderData:I,queryFn:()=>r(i),queryKey:n,staleTime:0}),d=o.data?.rows,f=o.data?.total,m=f!==void 0&&d!==void 0&&d.length<f,h=()=>{m&&s(g=>g+c)},p=()=>{o.refetch().catch(()=>{})};return{data:d,error:o.error??void 0,hasMore:m,loadMore:h,loading:o.isLoading,refetch:p,total:f}}const M=t=>{const e=A(20);let r;e[0]!==t?(r=t===void 0?{}:t,e[0]=t,e[1]=r):r=e[1];const u=r,a=y(),{enabled:c,filterField:i,filterValue:s,pageSize:l,search:n,searchField:o,sortBy:d,sortDirection:f}=u;let m;e[2]!==i||e[3]!==s||e[4]!==n||e[5]!==o||e[6]!==d||e[7]!==f?(m=["users",{filterField:i,filterValue:s,search:n,searchField:o,sortBy:d,sortDirection:f}],e[2]=i,e[3]=s,e[4]=n,e[5]=o,e[6]=d,e[7]=f,e[8]=m):m=e[8];let h;e[9]!==a||e[10]!==i||e[11]!==s||e[12]!==n||e[13]!==o||e[14]!==d||e[15]!==f?(h=g=>a.listAuthUsers({filterField:i,filterValue:s,limit:g,search:n,searchField:o,sortBy:d,sortDirection:f}),e[9]=a,e[10]=i,e[11]=s,e[12]=n,e[13]=o,e[14]=d,e[15]=f,e[16]=h):h=e[16];let p;return e[17]!==c||e[18]!==l?(p={enabled:c,pageSize:l},e[17]=c,e[18]=l,e[19]=p):p=e[19],S(a,m,h,p)},T=t=>{const e=A(8);let r;e[0]!==t?(r=t===void 0?{}:t,e[0]=t,e[1]=r):r=e[1];const u=r,a=y(),{enabled:c,pageSize:i}=u;let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=["organizations"],e[2]=s):s=e[2];let l;e[3]!==a?(l=o=>a.listAuthOrganizations({limit:o}),e[3]=a,e[4]=l):l=e[4];let n;return e[5]!==c||e[6]!==i?(n={enabled:c,pageSize:i},e[5]=c,e[6]=i,e[7]=n):n=e[7],S(a,s,l,n)},$=t=>{const e=A(10);let r;e[0]!==t?(r=t===void 0?{}:t,e[0]=t,e[1]=r):r=e[1];const u=r,a=y(),{enabled:c,pageSize:i,userId:s}=u;let l;e[2]!==s?(l=["sessions",{userId:s}],e[2]=s,e[3]=l):l=e[3];let n;e[4]!==a||e[5]!==s?(n=d=>a.listAuthSessions({limit:d,userId:s}),e[4]=a,e[5]=s,e[6]=n):n=e[6];let o;return e[7]!==c||e[8]!==i?(o={enabled:c,pageSize:i},e[7]=c,e[8]=i,e[9]=o):o=e[9],S(a,l,n,o)},q=()=>{const t=A(10),e=y();let r;t[0]!==e?(r={mutationFn:o=>e.impersonateAuthUser({userId:o})},t[0]=e,t[1]=r):r=t[1];const u=v(r),{mutateAsync:a,reset:c}=u;let i;t[2]!==a?(i=o=>a(o),t[2]=a,t[3]=i):i=t[3];const s=i,l=u.error??void 0;let n;return t[4]!==s||t[5]!==u.data||t[6]!==u.isPending||t[7]!==c||t[8]!==l?(n={data:u.data,error:l,impersonate:s,pending:u.isPending,reset:c},t[4]=s,t[5]=u.data,t[6]=u.isPending,t[7]=c,t[8]=l,t[9]=n):n=t[9],n};export{$ as useAuthSessions,M as useAuthUsers,q as useImpersonate,T as useOrganizations};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as d}from"./stable-key-B_BlboiY.mjs";const u=r=>{let t="";for(let c=0;c<r.length;c+=32768)t+=String.fromCharCode(...r.subarray(c,c+32768));return btoa(t)},e="$lunora.wire$",b=64,m="__proto__",p=r=>{if(r===null||typeof r!="object")return!1;const t=Object.getPrototypeOf(r);return t===null||t===Object.prototype},i=(r,t=0)=>{if(t>b)throw new RangeError(`wire-codec: value nesting exceeds the ${b}-level limit`);if(r===void 0)return[e,"undefined"];if(r===null)return null;const f=typeof r;if(f==="bigint")return[e,"bigint",r.toString()];if(f==="number"){const n=r;return Number.isNaN(n)?[e,"nan"]:n===1/0?[e,"inf"]:n===-1/0?[e,"-inf"]:n}if(f!=="object")return r;if(r instanceof Date)return[e,"date",i(r.getTime(),t+1)];if(r instanceof Error){const n=r,o={};for(const y of Object.keys(n))n[y]!==void 0&&(o[y]=i(n[y],t+1));const s=[e,"error",n.name,n.message,o];return n.cause!==void 0&&s.push(i(n.cause,t+1)),s}if(r instanceof URL)return[e,"url",r.href];if(r instanceof Map)return[e,"map",[...r.entries()].map(([n,o])=>[i(n,t+1),i(o,t+1)])];if(r instanceof Set)return[e,"set",[...r].map(n=>i(n,t+1))];if(r instanceof ArrayBuffer)return[e,"bytes",u(new Uint8Array(r)),"ArrayBuffer"];if(ArrayBuffer.isView(r)){const n=r,o=n.constructor.name,s=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);return o==="Uint8Array"?[e,"bytes",u(s)]:[e,"bytes",u(s),o]}if(Array.isArray(r)){const n=r.map(o=>i(o,t+1));return n.length>0&&n[0]===e?[e,"arr",n]:n}if(!p(r)){const n=r.constructor?.name??"value";throw new TypeError(`wire-codec: cannot encode a ${n} over the Lunora wire — only plain objects, arrays, and the supported built-ins (Date, Error, URL, Map, Set, ArrayBuffer/typed arrays, bigint) round-trip`)}const c=r,a={};for(const n of Object.keys(c)){const o=c[n];if(o===void 0)continue;const s=i(o,t+1);n===m?Object.defineProperty(a,n,{configurable:!0,enumerable:!0,value:s,writable:!0}):a[n]=s}return a},w=r=>d(i(r));export{w as s};
|