@lunora/react 1.0.0-alpha.42 → 1.0.0-alpha.44

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.
Files changed (21) hide show
  1. package/dist/index.d.mts +12 -12
  2. package/dist/index.d.ts +12 -12
  3. package/dist/index.mjs +1 -1
  4. package/dist/packem_shared/{cache-DsvFYCr6.mjs → cache-DJEsSdUx.mjs} +1 -1
  5. package/dist/packem_shared/{hydratePreloaded-D31idESQ.mjs → hydratePreloaded-CJjZRtQr.mjs} +1 -1
  6. package/dist/packem_shared/{lunoraQueryOptions-DD07hq_6.mjs → lunoraQueryOptions-DWEJoNnh.mjs} +1 -1
  7. package/dist/packem_shared/{query-key-CJZmOvY4.mjs → query-key-DV_Vu-6c.mjs} +1 -1
  8. package/dist/packem_shared/{use-paginated-core-CLqVCtWq.mjs → use-paginated-core-ClJ0EeGx.mjs} +1 -1
  9. package/dist/packem_shared/{useAgent-DNdGYVw2.mjs → useAgent-CkK3jOWX.mjs} +1 -1
  10. package/dist/packem_shared/{useAgentChat-CPHVyOBw.mjs → useAgentChat-vZrUmH0I.mjs} +1 -1
  11. package/dist/packem_shared/{useAgentState-DUPGX92a.mjs → useAgentState-D7NrtQNb.mjs} +1 -1
  12. package/dist/packem_shared/{useAgentToolEvents-DoQYzZmF.mjs → useAgentToolEvents-c88SqJWg.mjs} +1 -1
  13. package/dist/packem_shared/{useInfiniteQuery-C4GDJ5I1.mjs → useInfiniteQuery-RrCwLOXK.mjs} +1 -1
  14. package/dist/packem_shared/{usePaginatedQuery-BDrgYpNq.mjs → usePaginatedQuery-CfPP4EZz.mjs} +1 -1
  15. package/dist/packem_shared/{useQuery-DV77F7is.mjs → useQuery-C1IKYNQp.mjs} +1 -1
  16. package/dist/packem_shared/{useStream-CEoKz6Z-.mjs → useStream-CZqDeZ3D.mjs} +1 -1
  17. package/dist/packem_shared/{useSubscription-Gq5t0nYe.mjs → useSubscription-NfJ0mdhL.mjs} +1 -1
  18. package/dist/packem_shared/wire-key-BjAV3_Rq.mjs +1 -0
  19. package/dist/server.mjs +1 -1
  20. package/package.json +4 -4
  21. package/dist/packem_shared/wire-key-D7KVRdiE.mjs +0 -1
package/dist/index.d.mts CHANGED
@@ -46,7 +46,7 @@ interface LunoraProviderProps {
46
46
  * route through the offline queue on the client), and `gcTime: 5min` (keep
47
47
  * results around for a short return-to-view window).
48
48
  *
49
- * If a parent `<QueryClientProvider>` is already mounted, the provider
49
+ * If a parent `<QueryClientProvider>` is already mounted, the provider
50
50
  * uses *that* client and does NOT install an inner one (so apps with their
51
51
  * own setup don't double-wrap).
52
52
  */
@@ -59,7 +59,7 @@ interface LunoraProviderProps {
59
59
  */
60
60
  declare const LunoraProvider: ({ children, client, queryClient }: LunoraProviderProps) => ReactElement;
61
61
  /**
62
- * Read the {@link LunoraClient} from the nearest `&lt;LunoraProvider>`. Kept
62
+ * Read the {@link LunoraClient} from the nearest `<LunoraProvider>`. Kept
63
63
  * colocated with the provider for back-compat.
64
64
  */
65
65
  declare const useLunora: () => LunoraClient;
@@ -373,14 +373,14 @@ interface UseAgentOptions {
373
373
  api: UseAgentApi;
374
374
  /**
375
375
  * Optional app mutation over the agent's cancel path
376
- * (`ctx.agents.&lt;name>.cancel(id)`). Called with `{ instanceId, threadKey }`.
376
+ * (`ctx.agents.<name>.cancel(id)`). Called with `{ instanceId, threadKey }`.
377
377
  * When omitted (or no run is in flight) {@link UseAgentResult.cancel} is a
378
378
  * no-op.
379
379
  */
380
380
  cancel?: FunctionReference<"mutation">;
381
381
  /**
382
382
  * The app mutation that starts (or continues) a run — a thin wrapper over
383
- * `ctx.agents.&lt;name>.run(...)`. Called with `{ threadKey, input }` merged with
383
+ * `ctx.agents.<name>.run(...)`. Called with `{ threadKey, input }` merged with
384
384
  * {@link UseAgentOptions.runArgs} and the per-call args.
385
385
  */
386
386
  run: FunctionReference<"mutation">;
@@ -412,7 +412,7 @@ interface UseAgentResult {
412
412
  * `useAgentChat`.
413
413
  *
414
414
  * `run` and `cancel` stay generic over the app-defined mutations that wrap
415
- * `ctx.agents.&lt;name>.run` / `.cancel`, so the hook hard-codes no function names
415
+ * `ctx.agents.<name>.run` / `.cancel`, so the hook hard-codes no function names
416
416
  * beyond the `agents:*` surface.
417
417
  */
418
418
  declare const useAgent: (options: UseAgentOptions) => UseAgentResult;
@@ -524,7 +524,7 @@ interface UseAgentChatOptions {
524
524
  api: UseAgentChatApi;
525
525
  /**
526
526
  * Optional app mutation over the agent's cancel path
527
- * (`ctx.agents.&lt;name>.cancel(id)`). Called with `{ instanceId, threadKey }`.
527
+ * (`ctx.agents.<name>.cancel(id)`). Called with `{ instanceId, threadKey }`.
528
528
  * When omitted (or no run is in flight) {@link UseAgentChatResult.cancel} is a
529
529
  * no-op.
530
530
  */
@@ -533,7 +533,7 @@ interface UseAgentChatOptions {
533
533
  limit?: number;
534
534
  /**
535
535
  * The app mutation that starts (or continues) a run — a thin wrapper over
536
- * `ctx.agents.&lt;name>.run(...)`. Called with `{ threadKey, input }` merged with
536
+ * `ctx.agents.<name>.run(...)`. Called with `{ threadKey, input }` merged with
537
537
  * {@link UseAgentChatOptions.sendArgs} and the per-call args.
538
538
  */
539
539
  send: FunctionReference<"mutation">;
@@ -841,7 +841,7 @@ interface UseHttpStreamOptions {
841
841
  maxBuffer?: number;
842
842
  }
843
843
  /**
844
- * Consume an **HTTP-SSE route stream** (`httpRoute.&lt;verb>(path).stream()`) via
844
+ * Consume an **HTTP-SSE route stream** (`httpRoute.<verb>(path).stream()`) via
845
845
  * `client.httpStream`. Distinct from `useStream`, which consumes the WS
846
846
  * procedure stream (`kind: "stream"`). Returns the chunks received so far plus
847
847
  * a lifecycle status and a cancel function. Changing the route or the
@@ -1180,9 +1180,9 @@ type CreateSpeaker = (config: {
1180
1180
  audioFormat: VoiceAudioFormat;
1181
1181
  }) => VoiceSpeaker;
1182
1182
  /**
1183
- * The `agents.&lt;name>Voice` reference codegen emits for a voice-enabled agent — a
1183
+ * The `agents.<name>Voice` reference codegen emits for a voice-enabled agent — a
1184
1184
  * live, WS-backed session keyed by `threadKey`. A structural subset of the
1185
- * generated member, so passing `api.agents.&lt;name>Voice` type-checks.
1185
+ * generated member, so passing `api.agents.<name>Voice` type-checks.
1186
1186
  */
1187
1187
  type VoiceReference = FunctionReference<"stream", {
1188
1188
  threadKey: string;
@@ -1224,7 +1224,7 @@ interface UseVoiceAgentOptions {
1224
1224
  silenceThreshold?: number;
1225
1225
  /** The thread to converse on — shared with the agent's text turns. */
1226
1226
  threadKey: string;
1227
- /** The generated `api.agents.&lt;name>Voice` reference — identifies the voice DO endpoint. */
1227
+ /** The generated `api.agents.<name>Voice` reference — identifies the voice DO endpoint. */
1228
1228
  voice: VoiceReference;
1229
1229
  }
1230
1230
  interface UseVoiceAgentResult {
@@ -1256,7 +1256,7 @@ interface UseVoiceAgentResult {
1256
1256
  * WebSocket to the agent's `VoiceSessionDO`, captures mic audio as 16 kHz PCM,
1257
1257
  * streams the agent's synthesized speech back through the browser's audio output,
1258
1258
  * and mirrors the call lifecycle (`status`, `transcript`, `interimTranscript`,
1259
- * `audioLevel`) to React state. Pass the generated `api.agents.&lt;name>Voice`
1259
+ * `audioLevel`) to React state. Pass the generated `api.agents.<name>Voice`
1260
1260
  * reference (never a string), matching `useAgentChat`'s reference-passing style.
1261
1261
  *
1262
1262
  * v1 transport is plain binary WebSocket frames with push-to-talk / silence-timer
package/dist/index.d.ts CHANGED
@@ -46,7 +46,7 @@ interface LunoraProviderProps {
46
46
  * route through the offline queue on the client), and `gcTime: 5min` (keep
47
47
  * results around for a short return-to-view window).
48
48
  *
49
- * If a parent `&lt;QueryClientProvider>` is already mounted, the provider
49
+ * If a parent `<QueryClientProvider>` is already mounted, the provider
50
50
  * uses *that* client and does NOT install an inner one (so apps with their
51
51
  * own setup don't double-wrap).
52
52
  */
@@ -59,7 +59,7 @@ interface LunoraProviderProps {
59
59
  */
60
60
  declare const LunoraProvider: ({ children, client, queryClient }: LunoraProviderProps) => ReactElement;
61
61
  /**
62
- * Read the {@link LunoraClient} from the nearest `&lt;LunoraProvider>`. Kept
62
+ * Read the {@link LunoraClient} from the nearest `<LunoraProvider>`. Kept
63
63
  * colocated with the provider for back-compat.
64
64
  */
65
65
  declare const useLunora: () => LunoraClient;
@@ -373,14 +373,14 @@ interface UseAgentOptions {
373
373
  api: UseAgentApi;
374
374
  /**
375
375
  * Optional app mutation over the agent's cancel path
376
- * (`ctx.agents.&lt;name>.cancel(id)`). Called with `{ instanceId, threadKey }`.
376
+ * (`ctx.agents.<name>.cancel(id)`). Called with `{ instanceId, threadKey }`.
377
377
  * When omitted (or no run is in flight) {@link UseAgentResult.cancel} is a
378
378
  * no-op.
379
379
  */
380
380
  cancel?: FunctionReference<"mutation">;
381
381
  /**
382
382
  * The app mutation that starts (or continues) a run — a thin wrapper over
383
- * `ctx.agents.&lt;name>.run(...)`. Called with `{ threadKey, input }` merged with
383
+ * `ctx.agents.<name>.run(...)`. Called with `{ threadKey, input }` merged with
384
384
  * {@link UseAgentOptions.runArgs} and the per-call args.
385
385
  */
386
386
  run: FunctionReference<"mutation">;
@@ -412,7 +412,7 @@ interface UseAgentResult {
412
412
  * `useAgentChat`.
413
413
  *
414
414
  * `run` and `cancel` stay generic over the app-defined mutations that wrap
415
- * `ctx.agents.&lt;name>.run` / `.cancel`, so the hook hard-codes no function names
415
+ * `ctx.agents.<name>.run` / `.cancel`, so the hook hard-codes no function names
416
416
  * beyond the `agents:*` surface.
417
417
  */
418
418
  declare const useAgent: (options: UseAgentOptions) => UseAgentResult;
@@ -524,7 +524,7 @@ interface UseAgentChatOptions {
524
524
  api: UseAgentChatApi;
525
525
  /**
526
526
  * Optional app mutation over the agent's cancel path
527
- * (`ctx.agents.&lt;name>.cancel(id)`). Called with `{ instanceId, threadKey }`.
527
+ * (`ctx.agents.<name>.cancel(id)`). Called with `{ instanceId, threadKey }`.
528
528
  * When omitted (or no run is in flight) {@link UseAgentChatResult.cancel} is a
529
529
  * no-op.
530
530
  */
@@ -533,7 +533,7 @@ interface UseAgentChatOptions {
533
533
  limit?: number;
534
534
  /**
535
535
  * The app mutation that starts (or continues) a run — a thin wrapper over
536
- * `ctx.agents.&lt;name>.run(...)`. Called with `{ threadKey, input }` merged with
536
+ * `ctx.agents.<name>.run(...)`. Called with `{ threadKey, input }` merged with
537
537
  * {@link UseAgentChatOptions.sendArgs} and the per-call args.
538
538
  */
539
539
  send: FunctionReference<"mutation">;
@@ -841,7 +841,7 @@ interface UseHttpStreamOptions {
841
841
  maxBuffer?: number;
842
842
  }
843
843
  /**
844
- * Consume an **HTTP-SSE route stream** (`httpRoute.&lt;verb>(path).stream()`) via
844
+ * Consume an **HTTP-SSE route stream** (`httpRoute.<verb>(path).stream()`) via
845
845
  * `client.httpStream`. Distinct from `useStream`, which consumes the WS
846
846
  * procedure stream (`kind: "stream"`). Returns the chunks received so far plus
847
847
  * a lifecycle status and a cancel function. Changing the route or the
@@ -1180,9 +1180,9 @@ type CreateSpeaker = (config: {
1180
1180
  audioFormat: VoiceAudioFormat;
1181
1181
  }) => VoiceSpeaker;
1182
1182
  /**
1183
- * The `agents.&lt;name>Voice` reference codegen emits for a voice-enabled agent — a
1183
+ * The `agents.<name>Voice` reference codegen emits for a voice-enabled agent — a
1184
1184
  * live, WS-backed session keyed by `threadKey`. A structural subset of the
1185
- * generated member, so passing `api.agents.&lt;name>Voice` type-checks.
1185
+ * generated member, so passing `api.agents.<name>Voice` type-checks.
1186
1186
  */
1187
1187
  type VoiceReference = FunctionReference<"stream", {
1188
1188
  threadKey: string;
@@ -1224,7 +1224,7 @@ interface UseVoiceAgentOptions {
1224
1224
  silenceThreshold?: number;
1225
1225
  /** The thread to converse on — shared with the agent's text turns. */
1226
1226
  threadKey: string;
1227
- /** The generated `api.agents.&lt;name>Voice` reference — identifies the voice DO endpoint. */
1227
+ /** The generated `api.agents.<name>Voice` reference — identifies the voice DO endpoint. */
1228
1228
  voice: VoiceReference;
1229
1229
  }
1230
1230
  interface UseVoiceAgentResult {
@@ -1256,7 +1256,7 @@ interface UseVoiceAgentResult {
1256
1256
  * WebSocket to the agent's `VoiceSessionDO`, captures mic audio as 16 kHz PCM,
1257
1257
  * streams the agent's synthesized speech back through the browser's audio output,
1258
1258
  * and mirrors the call lifecycle (`status`, `transcript`, `interimTranscript`,
1259
- * `audioLevel`) to React state. Pass the generated `api.agents.&lt;name>Voice`
1259
+ * `audioLevel`) to React state. Pass the generated `api.agents.<name>Voice`
1260
1260
  * reference (never a string), matching `useAgentChat`'s reference-passing style.
1261
1261
  *
1262
1262
  * v1 transport is plain binary WebSocket frames with push-to-talk / silence-timer
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{AuthLoading as t,Authenticated as o,Unauthenticated as u}from"./packem_shared/AuthLoading-eLWn4Z7G.mjs";import{useAuthState as a}from"./packem_shared/useAuthState-jnCMkIwt.mjs";import{LunoraProvider as f,useLunora as n}from"./packem_shared/LunoraProvider-InsjxtOB.mjs";import{CheckoutButton as i,CustomerPortalButton as d,useCheckout as x}from"./packem_shared/CheckoutButton-DS_DKgNf.mjs";import{lunoraQueryOptions as h}from"./packem_shared/lunoraQueryOptions-DD07hq_6.mjs";import{useAuthSessions as A,useAuthUsers as c,useImpersonate as C,useOrganizations as U}from"./packem_shared/useAuthSessions-Dw4Zhtxa.mjs";import{useAgent as E}from"./packem_shared/useAgent-DNdGYVw2.mjs";import{useAgentChat as Q}from"./packem_shared/useAgentChat-CPHVyOBw.mjs";import{useAgentState as L}from"./packem_shared/useAgentState-DUPGX92a.mjs";import{useAgentToolEvents as F}from"./packem_shared/useAgentToolEvents-DoQYzZmF.mjs";import{default as k}from"./packem_shared/useAuth-CWkJn7i9.mjs";import{default as b}from"./packem_shared/useClientQuery-EPo__hzu.mjs";import{default as z}from"./packem_shared/useConnectionStatus-PL5D-S7t.mjs";import{useFlag as O,useFlags as T}from"./packem_shared/useFlag-Dh7bXXPx.mjs";import{useHttpStream as V}from"./packem_shared/useHttpStream-DFswZrRk.mjs";import{default as q}from"./packem_shared/useInfiniteQuery-C4GDJ5I1.mjs";import{useMutation as D}from"./packem_shared/useMutation-B4uL3Rde.mjs";import{useMutator as J}from"./packem_shared/useMutator-D3CGrk5-.mjs";import{usePaginatedQuery as N}from"./packem_shared/usePaginatedQuery-BDrgYpNq.mjs";import{hydratePreloaded as X,default as Y}from"./packem_shared/hydratePreloaded-D31idESQ.mjs";import{usePresence as _}from"./packem_shared/usePresence-xAbekAr_.mjs";import{default as ee}from"./packem_shared/useQuery-DV77F7is.mjs";import{useRateLimit as te}from"./packem_shared/useRateLimit-DqikMrX9.mjs";import{useStream as ue}from"./packem_shared/useStream-CEoKz6Z-.mjs";import{default as ae}from"./packem_shared/useSubscription-Gq5t0nYe.mjs";import{useVoiceAgent as fe}from"./packem_shared/useVoiceAgent-4gj2W2jc.mjs";import{createClientQuery as me,getErrorCode as ie,getRetryAfterMs as de,isConflictError as xe,isForbiddenError as le,isRateLimitedError as he,isUnauthorizedError as ge}from"@lunora/client";import{RestrictionError as ce,UploadControl as Ce,UploadError as Ue}from"@visulima/storage-client";import{useChunkedRestUpload as Ee,useFileInput as Pe,useMultipartUpload as Qe,usePasteUpload as Se,useTusUpload as Le,useUpload as Re}from"@visulima/storage-client/react";export{t as AuthLoading,o as Authenticated,i as CheckoutButton,d as CustomerPortalButton,f as LunoraProvider,ce as RestrictionError,u as Unauthenticated,Ce as UploadControl,Ue as UploadError,me as createClientQuery,ie as getErrorCode,de as getRetryAfterMs,X as hydratePreloaded,xe as isConflictError,le as isForbiddenError,he as isRateLimitedError,ge as isUnauthorizedError,h as lunoraQueryOptions,E as useAgent,Q as useAgentChat,L as useAgentState,F as useAgentToolEvents,k as useAuth,A as useAuthSessions,a as useAuthState,c as useAuthUsers,x as useCheckout,Ee as useChunkedRestUpload,b as useClientQuery,z as useConnectionStatus,Pe as useFileInput,O as useFlag,T as useFlags,V as useHttpStream,C as useImpersonate,q as useInfiniteQuery,n as useLunora,Qe as useMultipartUpload,D as useMutation,J as useMutator,U as useOrganizations,N as usePaginatedQuery,Se as usePasteUpload,Y as usePreloadedQuery,_ as usePresence,ee as useQuery,te as useRateLimit,ue as useStream,ae as useSubscription,Le as useTusUpload,Re as useUpload,fe as useVoiceAgent};
2
+ import{AuthLoading as t,Authenticated as o,Unauthenticated as u}from"./packem_shared/AuthLoading-eLWn4Z7G.mjs";import{useAuthState as a}from"./packem_shared/useAuthState-jnCMkIwt.mjs";import{LunoraProvider as f,useLunora as n}from"./packem_shared/LunoraProvider-InsjxtOB.mjs";import{CheckoutButton as i,CustomerPortalButton as d,useCheckout as x}from"./packem_shared/CheckoutButton-DS_DKgNf.mjs";import{lunoraQueryOptions as h}from"./packem_shared/lunoraQueryOptions-DWEJoNnh.mjs";import{useAuthSessions as A,useAuthUsers as c,useImpersonate as C,useOrganizations as U}from"./packem_shared/useAuthSessions-Dw4Zhtxa.mjs";import{useAgent as E}from"./packem_shared/useAgent-CkK3jOWX.mjs";import{useAgentChat as Q}from"./packem_shared/useAgentChat-vZrUmH0I.mjs";import{useAgentState as L}from"./packem_shared/useAgentState-D7NrtQNb.mjs";import{useAgentToolEvents as F}from"./packem_shared/useAgentToolEvents-c88SqJWg.mjs";import{default as k}from"./packem_shared/useAuth-CWkJn7i9.mjs";import{default as b}from"./packem_shared/useClientQuery-EPo__hzu.mjs";import{default as z}from"./packem_shared/useConnectionStatus-PL5D-S7t.mjs";import{useFlag as O,useFlags as T}from"./packem_shared/useFlag-Dh7bXXPx.mjs";import{useHttpStream as V}from"./packem_shared/useHttpStream-DFswZrRk.mjs";import{default as q}from"./packem_shared/useInfiniteQuery-RrCwLOXK.mjs";import{useMutation as D}from"./packem_shared/useMutation-B4uL3Rde.mjs";import{useMutator as J}from"./packem_shared/useMutator-D3CGrk5-.mjs";import{usePaginatedQuery as N}from"./packem_shared/usePaginatedQuery-CfPP4EZz.mjs";import{hydratePreloaded as X,default as Y}from"./packem_shared/hydratePreloaded-CJjZRtQr.mjs";import{usePresence as _}from"./packem_shared/usePresence-xAbekAr_.mjs";import{default as ee}from"./packem_shared/useQuery-C1IKYNQp.mjs";import{useRateLimit as te}from"./packem_shared/useRateLimit-DqikMrX9.mjs";import{useStream as ue}from"./packem_shared/useStream-CZqDeZ3D.mjs";import{default as ae}from"./packem_shared/useSubscription-NfJ0mdhL.mjs";import{useVoiceAgent as fe}from"./packem_shared/useVoiceAgent-4gj2W2jc.mjs";import{createClientQuery as me,getErrorCode as ie,getRetryAfterMs as de,isConflictError as xe,isForbiddenError as le,isRateLimitedError as he,isUnauthorizedError as ge}from"@lunora/client";import{RestrictionError as ce,UploadControl as Ce,UploadError as Ue}from"@visulima/storage-client";import{useChunkedRestUpload as Ee,useFileInput as Pe,useMultipartUpload as Qe,usePasteUpload as Se,useTusUpload as Le,useUpload as Re}from"@visulima/storage-client/react";export{t as AuthLoading,o as Authenticated,i as CheckoutButton,d as CustomerPortalButton,f as LunoraProvider,ce as RestrictionError,u as Unauthenticated,Ce as UploadControl,Ue as UploadError,me as createClientQuery,ie as getErrorCode,de as getRetryAfterMs,X as hydratePreloaded,xe as isConflictError,le as isForbiddenError,he as isRateLimitedError,ge as isUnauthorizedError,h as lunoraQueryOptions,E as useAgent,Q as useAgentChat,L as useAgentState,F as useAgentToolEvents,k as useAuth,A as useAuthSessions,a as useAuthState,c as useAuthUsers,x as useCheckout,Ee as useChunkedRestUpload,b as useClientQuery,z as useConnectionStatus,Pe as useFileInput,O as useFlag,T as useFlags,V as useHttpStream,C as useImpersonate,q as useInfiniteQuery,n as useLunora,Qe as useMultipartUpload,D as useMutation,J as useMutator,U as useOrganizations,N as usePaginatedQuery,Se as usePasteUpload,Y as usePreloadedQuery,_ as usePresence,ee as useQuery,te as useRateLimit,ue as useStream,ae as useSubscription,Le as useTusUpload,Re as useUpload,fe as useVoiceAgent};
@@ -1 +1 @@
1
- import{r as u}from"./query-key-CJZmOvY4.mjs";class f{constructor(e){this.client=e}client;entries=new Map;keyOf(e){return u(e)}attach(e,n,c,o,h,b={}){const s=u(n);let r=this.entries.get(s);if(!r){r={pollTimer:void 0,refCount:0,unsubscribe:void 0},this.entries.set(s,r);try{r.unsubscribe=this.client.subscribe(c,o,t=>{e.setQueryData(n,t)},{shardKey:h})}catch{r.pollTimer=setInterval(()=>{e.invalidateQueries({queryKey:n}).catch(()=>{})},b.pollIntervalMs??5e3)}}r.refCount+=1;let l=!1;return()=>{if(l)return;l=!0;const t=this.entries.get(s);t&&(t.refCount-=1,t.refCount<=0&&(t.unsubscribe?.(),t.pollTimer&&clearInterval(t.pollTimer),this.entries.delete(s)))}}}const a=new WeakMap,m=i=>{let e=a.get(i);return e||(e=new f(i),a.set(i,e)),e};export{m as b};
1
+ import{r as u}from"./query-key-DV_Vu-6c.mjs";class f{constructor(e){this.client=e}client;entries=new Map;keyOf(e){return u(e)}attach(e,n,c,o,h,b={}){const s=u(n);let r=this.entries.get(s);if(!r){r={pollTimer:void 0,refCount:0,unsubscribe:void 0},this.entries.set(s,r);try{r.unsubscribe=this.client.subscribe(c,o,t=>{e.setQueryData(n,t)},{shardKey:h})}catch{r.pollTimer=setInterval(()=>{e.invalidateQueries({queryKey:n}).catch(()=>{})},b.pollIntervalMs??5e3)}}r.refCount+=1;let l=!1;return()=>{if(l)return;l=!0;const t=this.entries.get(s);t&&(t.refCount-=1,t.refCount<=0&&(t.unsubscribe?.(),t.pollTimer&&clearInterval(t.pollTimer),this.entries.delete(s)))}}}const a=new WeakMap,m=i=>{let e=a.get(i);return e||(e=new f(i),a.set(i,e)),e};export{m as b};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{c as l}from"react/compiler-runtime";import{useQueryClient as d,useQuery as p}from"@tanstack/react-query";import{useEffect as h}from"react";import{b as I}from"./cache-DsvFYCr6.mjs";import{useLunora as q}from"./LunoraProvider-InsjxtOB.mjs";import{i as K,y as N}from"./query-key-CJZmOvY4.mjs";const P=function(o){const r=l(4),e=q(),t=d(),{args:u,functionPath:c,shardKey:i,value:s}=o,n={__lunoraRef:c},m=N(n,u,i),{data:y}=p({initialData:s,queryFn:()=>e.query(n,u,{shardKey:i}),queryKey:m,staleTime:Number.POSITIVE_INFINITY}),f=K(m);let a;return r[0]!==e||r[1]!==t||r[2]!==f?(a=[e,t,f],r[0]=e,r[1]=t,r[2]=f,r[3]=a):a=r[3],h(()=>I(e).attach(t,m,n,u,i),a),y===void 0?s:y},F=function(o){return P(o)};export{P as default,F as hydratePreloaded};
2
+ import{c as l}from"react/compiler-runtime";import{useQueryClient as d,useQuery as p}from"@tanstack/react-query";import{useEffect as h}from"react";import{b as I}from"./cache-DJEsSdUx.mjs";import{useLunora as q}from"./LunoraProvider-InsjxtOB.mjs";import{i as K,y as N}from"./query-key-DV_Vu-6c.mjs";const P=function(o){const r=l(4),e=q(),t=d(),{args:u,functionPath:c,shardKey:i,value:s}=o,n={__lunoraRef:c},m=N(n,u,i),{data:y}=p({initialData:s,queryFn:()=>e.query(n,u,{shardKey:i}),queryKey:m,staleTime:Number.POSITIVE_INFINITY}),f=K(m);let a;return r[0]!==e||r[1]!==t||r[2]!==f?(a=[e,t,f],r[0]=e,r[1]=t,r[2]=f,r[3]=a):a=r[3],h(()=>I(e).attach(t,m,n,u,i),a),y===void 0?s:y},F=function(o){return P(o)};export{P as default,F as hydratePreloaded};
@@ -1 +1 @@
1
- import{y as s}from"./query-key-CJZmOvY4.mjs";const u=(n,r,o,e={})=>{const y=o??{};return{queryFn:()=>n.query(r,y,{shardKey:e.shardKey}),queryKey:s(r,y,e.shardKey),staleTime:Number.POSITIVE_INFINITY}};export{u as lunoraQueryOptions};
1
+ import{y as s}from"./query-key-DV_Vu-6c.mjs";const u=(n,r,o,e={})=>{const y=o??{};return{queryFn:()=>n.query(r,y,{shardKey:e.shardKey}),queryKey:s(r,y,e.shardKey),staleTime:Number.POSITIVE_INFINITY}};export{u as lunoraQueryOptions};
@@ -1 +1 @@
1
- import{t as n}from"./wire-key-D7KVRdiE.mjs";const t=o=>n(o),a=(o,r,l)=>["lunora",o.__lunoraRef,r,l??null],e=o=>t(o);export{e as i,t as r,a as y};
1
+ import{t as n}from"./wire-key-BjAV3_Rq.mjs";const t=o=>n(o),a=(o,r,l)=>["lunora",o.__lunoraRef,r,l??null],e=o=>t(o);export{e as i,t as r,a as y};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{initialPages as R,rebalance as O,derivePaginationStatus as S,applyLoadMore as P}from"@lunora/client/pagination";import{useQueryClient as j}from"@tanstack/react-query";import{useRef as d,useReducer as B,useState as E,useEffect as m,useCallback as N}from"react";import{b as T}from"./cache-DsvFYCr6.mjs";import{useLunora as $}from"./LunoraProvider-InsjxtOB.mjs";import{i,y as I}from"./query-key-CJZmOvY4.mjs";const z=function(o){const f=d(void 0);return f.current??=o(),f},X=function(o,f,x){const a=$(),n=j(),{initialNumItems:g,shardKey:p}=x,u=f==="skip",y=u?{}:f,[,L]=B(e=>e+1,0),[w,h]=E(()=>R(g)),k=`${i(I(o,y,p))}::${String(g)}`,A=d(k);A.current!==k&&(A.current=k,h(R(g)));const l=w.map(e=>{const t={...y,paginationOpts:{cursor:e.lower,endCursor:e.upper,numItems:e.numItems}},s=I(o,t,p);return{args:t,key:s}}),M=l.map(({key:e})=>i(e)).join("|"),K=d({baseArgs:y,entries:[],fn:o,shardKey:p});m(()=>{K.current={baseArgs:y,entries:l,fn:o,shardKey:p}});const v=z(()=>new Map),Q=d(a);m(()=>{const e=v.current;if(Q.current!==a){for(const r of e.values())r();e.clear(),Q.current=a}if(u){for(const r of e.values())r();e.clear();return}const t=K.current,s=T(a),b=new Set(t.entries.map(({key:r})=>i(r)));for(const[r,c]of e)b.has(r)||(c(),e.delete(r));for(const r of t.entries){const c=i(r.key);e.has(c)||(n.fetchQuery({queryFn:()=>a.query(t.fn,r.args,{shardKey:t.shardKey}),queryKey:r.key,staleTime:0}).catch(()=>{}),e.set(c,s.attach(n,r.key,t.fn,r.args,t.shardKey)))}},[a,n,M,u]),m(()=>()=>{for(const e of v.current.values())e();v.current.clear()},[]),m(()=>n.getQueryCache().subscribe(e=>{if(e.type!=="updated")return;const t=i(e.query.queryKey);l.some(({key:s})=>i(s)===t)&&L()}),[n,M]);const C=u?[]:l.map(({key:e})=>n.getQueryData(e));m(()=>{if(u)return;const e=O(w,C);e&&h(e)});const{status:D}=S(u,C);return{loadMore:N(e=>{h(t=>{const s=K.current,b=t.map(q=>{const F={...s.baseArgs,paginationOpts:{cursor:q.lower,endCursor:q.upper,numItems:q.numItems}};return n.getQueryData(I(s.fn,F,s.shardKey))}),{nextCursor:r,status:c}=S(!1,b);return P(t,c==="CanLoadMore"?r:void 0,e)??t})},[n]),pageResults:C,status:D}};export{X as B};
2
+ import{initialPages as R,rebalance as O,derivePaginationStatus as S,applyLoadMore as P}from"@lunora/client/pagination";import{useQueryClient as j}from"@tanstack/react-query";import{useRef as d,useReducer as B,useState as E,useEffect as m,useCallback as N}from"react";import{b as T}from"./cache-DJEsSdUx.mjs";import{useLunora as $}from"./LunoraProvider-InsjxtOB.mjs";import{i,y as I}from"./query-key-DV_Vu-6c.mjs";const z=function(o){const f=d(void 0);return f.current??=o(),f},X=function(o,f,x){const a=$(),n=j(),{initialNumItems:g,shardKey:p}=x,u=f==="skip",y=u?{}:f,[,L]=B(e=>e+1,0),[w,h]=E(()=>R(g)),k=`${i(I(o,y,p))}::${String(g)}`,A=d(k);A.current!==k&&(A.current=k,h(R(g)));const l=w.map(e=>{const t={...y,paginationOpts:{cursor:e.lower,endCursor:e.upper,numItems:e.numItems}},s=I(o,t,p);return{args:t,key:s}}),M=l.map(({key:e})=>i(e)).join("|"),K=d({baseArgs:y,entries:[],fn:o,shardKey:p});m(()=>{K.current={baseArgs:y,entries:l,fn:o,shardKey:p}});const v=z(()=>new Map),Q=d(a);m(()=>{const e=v.current;if(Q.current!==a){for(const r of e.values())r();e.clear(),Q.current=a}if(u){for(const r of e.values())r();e.clear();return}const t=K.current,s=T(a),b=new Set(t.entries.map(({key:r})=>i(r)));for(const[r,c]of e)b.has(r)||(c(),e.delete(r));for(const r of t.entries){const c=i(r.key);e.has(c)||(n.fetchQuery({queryFn:()=>a.query(t.fn,r.args,{shardKey:t.shardKey}),queryKey:r.key,staleTime:0}).catch(()=>{}),e.set(c,s.attach(n,r.key,t.fn,r.args,t.shardKey)))}},[a,n,M,u]),m(()=>()=>{for(const e of v.current.values())e();v.current.clear()},[]),m(()=>n.getQueryCache().subscribe(e=>{if(e.type!=="updated")return;const t=i(e.query.queryKey);l.some(({key:s})=>i(s)===t)&&L()}),[n,M]);const C=u?[]:l.map(({key:e})=>n.getQueryData(e));m(()=>{if(u)return;const e=O(w,C);e&&h(e)});const{status:D}=S(u,C);return{loadMore:N(e=>{h(t=>{const s=K.current,b=t.map(q=>{const F={...s.baseArgs,paginationOpts:{cursor:q.lower,endCursor:q.upper,numItems:q.numItems}};return n.getQueryData(I(s.fn,F,s.shardKey))}),{nextCursor:r,status:c}=S(!1,b);return P(t,c==="CanLoadMore"?r:void 0,e)??t})},[n]),pageResults:C,status:D}};export{X as B};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{c as T}from"react/compiler-runtime";import{useMutation as h}from"./useMutation-B4uL3Rde.mjs";import $ from"./useSubscription-Gq5t0nYe.mjs";const b={__lunoraRef:""},M=f=>{const t=T(17),{api:w,cancel:a,run:A,runArgs:u,threadKey:e}=f,r=h(A),K=h(a??b);let s;t[0]!==e?(s={key:e},t[0]=e,t[1]=s):s=t[1];const{data:_}=$(w.agents.agentThread,s),n=_,p=n?.status,i=n?.instanceId,{mutate:g}=r,{mutate:l}=K;let o;t[2]!==u||t[3]!==g||t[4]!==e?(o=async(v,I)=>{await g({input:v,threadKey:e,...u,...I})},t[2]=u,t[3]=g,t[4]=e,t[5]=o):o=t[5];const m=o;let c;t[6]!==l||t[7]!==a||t[8]!==i||t[9]!==e?(c=async()=>{a===void 0||i===void 0||await l({instanceId:i,threadKey:e})},t[6]=l,t[7]=a,t[8]=i,t[9]=e,t[10]=c):c=t[10];const y=c;let d;return t[11]!==y||t[12]!==m||t[13]!==r.pending||t[14]!==p||t[15]!==n?(d={cancel:y,pending:r.pending,run:m,status:p,thread:n},t[11]=y,t[12]=m,t[13]=r.pending,t[14]=p,t[15]=n,t[16]=d):d=t[16],d};export{M as useAgent};
2
+ import{c as T}from"react/compiler-runtime";import{useMutation as h}from"./useMutation-B4uL3Rde.mjs";import $ from"./useSubscription-NfJ0mdhL.mjs";const b={__lunoraRef:""},M=f=>{const t=T(17),{api:w,cancel:a,run:A,runArgs:u,threadKey:e}=f,r=h(A),K=h(a??b);let s;t[0]!==e?(s={key:e},t[0]=e,t[1]=s):s=t[1];const{data:_}=$(w.agents.agentThread,s),n=_,p=n?.status,i=n?.instanceId,{mutate:g}=r,{mutate:l}=K;let o;t[2]!==u||t[3]!==g||t[4]!==e?(o=async(v,I)=>{await g({input:v,threadKey:e,...u,...I})},t[2]=u,t[3]=g,t[4]=e,t[5]=o):o=t[5];const m=o;let c;t[6]!==l||t[7]!==a||t[8]!==i||t[9]!==e?(c=async()=>{a===void 0||i===void 0||await l({instanceId:i,threadKey:e})},t[6]=l,t[7]=a,t[8]=i,t[9]=e,t[10]=c):c=t[10];const y=c;let d;return t[11]!==y||t[12]!==m||t[13]!==r.pending||t[14]!==p||t[15]!==n?(d={cancel:y,pending:r.pending,run:m,status:p,thread:n},t[11]=y,t[12]=m,t[13]=r.pending,t[14]=p,t[15]=n,t[16]=d):d=t[16],d};export{M as useAgent};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{c as ot}from"react/compiler-runtime";import{reconcileOptimistic as Q,maxSeq as U}from"@lunora/client";import{useState as st,useRef as rt}from"react";import{useMutation as J}from"./useMutation-B4uL3Rde.mjs";import{useStream as it}from"./useStream-CEoKz6Z-.mjs";import V from"./useSubscription-Gq5t0nYe.mjs";const ct={__lunoraRef:""},lt={__lunoraRef:""},dt=[],wt=i=>{const t=ot(47),{api:S,cancel:l,limit:d,send:W,sendArgs:_,stream:u,threadKey:e}=i;let m;t[0]!==d||t[1]!==e?(m=d===void 0?{key:e}:{key:e,limit:d},t[0]=d,t[1]=e,t[2]=m):m=t[2];const X=m,{data:Y}=V(S.agents.agentMessages,X);let h;t[3]!==e?(h={key:e},t[3]=e,t[4]=h):h=t[4];const{data:Z}=V(S.agents.agentThread,h);let p;t[5]!==u||t[6]!==e?(p=u===void 0?"skip":{key:e},t[5]=u,t[6]=e,t[7]=p):p=t[7];const z=p,{chunks:x}=it(u??lt,z),B=J(W),L=J(l??ct),tt=J(S.agents.agentResolveApproval);let f;t[8]===Symbol.for("react.memo_cache_sentinel")?(f=[],t[8]=f):f=t[8];const[j,N]=st(f),R=rt(0),P=Z,q=P?.status,s=P?.instanceId,a=Y??dt;let g;if(t[9]!==a||t[10]!==j){const n=Q(j,a),o=U(a);g=n.length===0?a:[...a,...n.map((K,G)=>({content:K.content,optimistic:!0,role:"user",seq:o+1+G}))],t[9]=a,t[10]=j,t[11]=g}else g=t[11];const T=g;let y;t[12]!==a?(y=a.filter(ut),t[12]=a,t[13]=y):y=t[13];const c=y.length;let v;if(t[14]!==c||t[15]!==x||t[16]!==e){let n;t[18]!==c||t[19]!==e?(n=o=>o.kind!=="progress"&&o.threadKey===e&&o.turn>=c,t[18]=c,t[19]=e,t[20]=n):n=t[20],v=x.filter(n).map(mt).join(""),t[14]=c,t[15]=x,t[16]=e,t[17]=v}else v=t[17];const b=v,{mutate:E}=B,{mutate:M}=L,{mutate:r}=tt;let w;t[21]!==a||t[22]!==_||t[23]!==E||t[24]!==e?(w=async(n,o)=>{const K=R.current;R.current=R.current+1;const G=U(a);N(H=>[...Q(H,a),{content:n,id:K,maxDurableSeqAtSend:G}]);try{await E({input:n,threadKey:e,..._,...o})}catch(H){const et=H;throw N(nt=>nt.filter(at=>at.id!==K)),et}},t[21]=a,t[22]=_,t[23]=E,t[24]=e,t[25]=w):w=t[25];const $=w;let I;t[26]!==s||t[27]!==r||t[28]!==e?(I=async(n,o)=>{if(s===void 0)throw new Error("useAgentChat: cannot approve — no in-flight run (thread has no instanceId)");await r({decision:"approve",instanceId:s,threadKey:e,toolCallId:n,...o===void 0?{}:{note:o}})},t[26]=s,t[27]=r,t[28]=e,t[29]=I):I=t[29];const D=I;let k;t[30]!==s||t[31]!==r||t[32]!==e?(k=async(n,o)=>{if(s===void 0)throw new Error("useAgentChat: cannot reject — no in-flight run (thread has no instanceId)");await r({decision:"reject",instanceId:s,threadKey:e,toolCallId:n,...o===void 0?{}:{note:o}})},t[30]=s,t[31]=r,t[32]=e,t[33]=k):k=t[33];const O=k;let A;t[34]!==M||t[35]!==l||t[36]!==s||t[37]!==e?(A=async()=>{l===void 0||s===void 0||await M({instanceId:s,threadKey:e})},t[34]=M,t[35]=l,t[36]=s,t[37]=e,t[38]=A):A=t[38];const F=A;let C;return t[39]!==D||t[40]!==F||t[41]!==T||t[42]!==O||t[43]!==$||t[44]!==q||t[45]!==b?(C={approve:D,cancel:F,messages:T,reject:O,send:$,status:q,streamingText:b},t[39]=D,t[40]=F,t[41]=T,t[42]=O,t[43]=$,t[44]=q,t[45]=b,t[46]=C):C=t[46],C};function ut(i){return i.role==="assistant"}function mt(i){return i.text}export{wt as useAgentChat};
2
+ import{c as ot}from"react/compiler-runtime";import{reconcileOptimistic as Q,maxSeq as U}from"@lunora/client";import{useState as st,useRef as rt}from"react";import{useMutation as J}from"./useMutation-B4uL3Rde.mjs";import{useStream as it}from"./useStream-CZqDeZ3D.mjs";import V from"./useSubscription-NfJ0mdhL.mjs";const ct={__lunoraRef:""},lt={__lunoraRef:""},dt=[],wt=i=>{const t=ot(47),{api:S,cancel:l,limit:d,send:W,sendArgs:_,stream:u,threadKey:e}=i;let m;t[0]!==d||t[1]!==e?(m=d===void 0?{key:e}:{key:e,limit:d},t[0]=d,t[1]=e,t[2]=m):m=t[2];const X=m,{data:Y}=V(S.agents.agentMessages,X);let h;t[3]!==e?(h={key:e},t[3]=e,t[4]=h):h=t[4];const{data:Z}=V(S.agents.agentThread,h);let p;t[5]!==u||t[6]!==e?(p=u===void 0?"skip":{key:e},t[5]=u,t[6]=e,t[7]=p):p=t[7];const z=p,{chunks:x}=it(u??lt,z),B=J(W),L=J(l??ct),tt=J(S.agents.agentResolveApproval);let f;t[8]===Symbol.for("react.memo_cache_sentinel")?(f=[],t[8]=f):f=t[8];const[j,N]=st(f),R=rt(0),P=Z,q=P?.status,s=P?.instanceId,a=Y??dt;let g;if(t[9]!==a||t[10]!==j){const n=Q(j,a),o=U(a);g=n.length===0?a:[...a,...n.map((K,G)=>({content:K.content,optimistic:!0,role:"user",seq:o+1+G}))],t[9]=a,t[10]=j,t[11]=g}else g=t[11];const T=g;let y;t[12]!==a?(y=a.filter(ut),t[12]=a,t[13]=y):y=t[13];const c=y.length;let v;if(t[14]!==c||t[15]!==x||t[16]!==e){let n;t[18]!==c||t[19]!==e?(n=o=>o.kind!=="progress"&&o.threadKey===e&&o.turn>=c,t[18]=c,t[19]=e,t[20]=n):n=t[20],v=x.filter(n).map(mt).join(""),t[14]=c,t[15]=x,t[16]=e,t[17]=v}else v=t[17];const b=v,{mutate:E}=B,{mutate:M}=L,{mutate:r}=tt;let w;t[21]!==a||t[22]!==_||t[23]!==E||t[24]!==e?(w=async(n,o)=>{const K=R.current;R.current=R.current+1;const G=U(a);N(H=>[...Q(H,a),{content:n,id:K,maxDurableSeqAtSend:G}]);try{await E({input:n,threadKey:e,..._,...o})}catch(H){const et=H;throw N(nt=>nt.filter(at=>at.id!==K)),et}},t[21]=a,t[22]=_,t[23]=E,t[24]=e,t[25]=w):w=t[25];const $=w;let I;t[26]!==s||t[27]!==r||t[28]!==e?(I=async(n,o)=>{if(s===void 0)throw new Error("useAgentChat: cannot approve — no in-flight run (thread has no instanceId)");await r({decision:"approve",instanceId:s,threadKey:e,toolCallId:n,...o===void 0?{}:{note:o}})},t[26]=s,t[27]=r,t[28]=e,t[29]=I):I=t[29];const D=I;let k;t[30]!==s||t[31]!==r||t[32]!==e?(k=async(n,o)=>{if(s===void 0)throw new Error("useAgentChat: cannot reject — no in-flight run (thread has no instanceId)");await r({decision:"reject",instanceId:s,threadKey:e,toolCallId:n,...o===void 0?{}:{note:o}})},t[30]=s,t[31]=r,t[32]=e,t[33]=k):k=t[33];const O=k;let A;t[34]!==M||t[35]!==l||t[36]!==s||t[37]!==e?(A=async()=>{l===void 0||s===void 0||await M({instanceId:s,threadKey:e})},t[34]=M,t[35]=l,t[36]=s,t[37]=e,t[38]=A):A=t[38];const F=A;let C;return t[39]!==D||t[40]!==F||t[41]!==T||t[42]!==O||t[43]!==$||t[44]!==q||t[45]!==b?(C={approve:D,cancel:F,messages:T,reject:O,send:$,status:q,streamingText:b},t[39]=D,t[40]=F,t[41]=T,t[42]=O,t[43]=$,t[44]=q,t[45]=b,t[46]=C):C=t[46],C};function ut(i){return i.role==="assistant"}function mt(i){return i.text}export{wt as useAgentChat};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{c}from"react/compiler-runtime";import d from"./useSubscription-Gq5t0nYe.mjs";const p=t=>{const e=c(5);let r;e[0]!==t.threadKey?(r={key:t.threadKey},e[0]=t.threadKey,e[1]=r):r=e[1];const{data:s,error:o}=d(t.api.agents.agentState,r),n=s;let a;return e[2]!==o||e[3]!==n?(a={error:o,state:n},e[2]=o,e[3]=n,e[4]=a):a=e[4],a};export{p as useAgentState};
2
+ import{c}from"react/compiler-runtime";import d from"./useSubscription-NfJ0mdhL.mjs";const p=t=>{const e=c(5);let r;e[0]!==t.threadKey?(r={key:t.threadKey},e[0]=t.threadKey,e[1]=r):r=e[1];const{data:s,error:o}=d(t.api.agents.agentState,r),n=s;let a;return e[2]!==o||e[3]!==n?(a={error:o,state:n},e[2]=o,e[3]=n,e[4]=a):a=e[4],a};export{p as useAgentState};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{c as v}from"react/compiler-runtime";import{useStream as g}from"./useStream-CEoKz6Z-.mjs";import y from"./useSubscription-Gq5t0nYe.mjs";const I={__lunoraRef:""},k=[],N=l=>{if(l.role==="assistant"&&l.toolCalls)return l.toolCalls.map(o=>({input:o.input,seq:l.seq,toolCallId:o.id,toolName:o.name,type:"call"}));if(l.role==="tool")return l.status==="awaiting_approval"?[{seq:l.seq,type:"awaiting-approval",...l.toolCallId===void 0?{}:{toolCallId:l.toolCallId},...l.toolName===void 0?{}:{toolName:l.toolName}}]:[{output:l.content,seq:l.seq,type:"result",...l.status==="approved"||l.status==="rejected"?{status:l.status}:{},...l.toolCallId===void 0?{}:{toolCallId:l.toolCallId},...l.toolName===void 0?{}:{toolName:l.toolName}}]},_=l=>{const o=v(12),{api:m,limit:a,stream:s,threadKey:t}=l;let r;o[0]!==a||o[1]!==t?(r=a===void 0?{key:t}:{key:t,limit:a},o[0]=a,o[1]=t,o[2]=r):r=o[2];const c=r,{data:f}=y(m.agents.agentMessages,c);let i;o[3]!==s||o[4]!==t?(i=s===void 0?"skip":{key:t},o[3]=s,o[4]=t,o[5]=i):i=o[5];const C=i,{chunks:p}=g(s??I,C),u=f??k;let e;if(o[6]!==p||o[7]!==u||o[8]!==t){e=u.flatMap(q);for(const d of p)d.kind==="progress"&&d.threadKey===t&&e.push({data:d.data,toolCallId:d.toolCallId,type:"progress"});o[6]=p,o[7]=u,o[8]=t,o[9]=e}else e=o[9];let n;return o[10]!==e?(n={events:e},o[10]=e,o[11]=n):n=o[11],n};function q(l){return N(l)??[]}export{_ as useAgentToolEvents};
2
+ import{c as v}from"react/compiler-runtime";import{useStream as g}from"./useStream-CZqDeZ3D.mjs";import y from"./useSubscription-NfJ0mdhL.mjs";const I={__lunoraRef:""},k=[],N=l=>{if(l.role==="assistant"&&l.toolCalls)return l.toolCalls.map(o=>({input:o.input,seq:l.seq,toolCallId:o.id,toolName:o.name,type:"call"}));if(l.role==="tool")return l.status==="awaiting_approval"?[{seq:l.seq,type:"awaiting-approval",...l.toolCallId===void 0?{}:{toolCallId:l.toolCallId},...l.toolName===void 0?{}:{toolName:l.toolName}}]:[{output:l.content,seq:l.seq,type:"result",...l.status==="approved"||l.status==="rejected"?{status:l.status}:{},...l.toolCallId===void 0?{}:{toolCallId:l.toolCallId},...l.toolName===void 0?{}:{toolName:l.toolName}}]},_=l=>{const o=v(12),{api:m,limit:a,stream:s,threadKey:t}=l;let r;o[0]!==a||o[1]!==t?(r=a===void 0?{key:t}:{key:t,limit:a},o[0]=a,o[1]=t,o[2]=r):r=o[2];const c=r,{data:f}=y(m.agents.agentMessages,c);let i;o[3]!==s||o[4]!==t?(i=s===void 0?"skip":{key:t},o[3]=s,o[4]=t,o[5]=i):i=o[5];const C=i,{chunks:p}=g(s??I,C),u=f??k;let e;if(o[6]!==p||o[7]!==u||o[8]!==t){e=u.flatMap(q);for(const d of p)d.kind==="progress"&&d.threadKey===t&&e.push({data:d.data,toolCallId:d.toolCallId,type:"progress"});o[6]=p,o[7]=u,o[8]=t,o[9]=e}else e=o[9];let n;return o[10]!==e?(n={events:e},o[10]=e,o[11]=n):n=o[11],n};function q(l){return N(l)??[]}export{_ as useAgentToolEvents};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{c as P}from"react/compiler-runtime";import{useRef as k,useEffect as F}from"react";import{B as y}from"./use-paginated-core-CLqVCtWq.mjs";const B=(M,c,g)=>{const e=P(15),{initialNumItems:o}=g,{loadMore:s,pageResults:f,status:a}=y(M,c==="skip"?"skip":c,g),N=c==="skip";let t;if(e[0]!==f){t=[];for(const u of f)u&&t.push(u.page);e[0]=f,e[1]=t}else t=e[1];let r;e[2]!==o||e[3]!==s?(r={defaultNumItems:o,loadMore:s},e[2]=o,e[3]=s,e[4]=r):r=e[4];const h=k(r);let i;e[5]!==o||e[6]!==s?(i=()=>{h.current={defaultNumItems:o,loadMore:s}},e[5]=o,e[6]=s,e[7]=i):i=e[7],F(i);let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=u=>{const{defaultNumItems:I,loadMore:L}=h.current;L(u??I)},e[8]=m):m=e[8];const x=m,l=a==="CanLoadMore",d=!N&&a==="LoadingMore",p=!N&&a==="LoadingFirstPage";let n;return e[9]!==t||e[10]!==a||e[11]!==l||e[12]!==d||e[13]!==p?(n={fetchNextPage:x,hasNextPage:l,isFetchingNextPage:d,isLoading:p,pages:t,status:a},e[9]=t,e[10]=a,e[11]=l,e[12]=d,e[13]=p,e[14]=n):n=e[14],n};export{B as default};
2
+ import{c as P}from"react/compiler-runtime";import{useRef as k,useEffect as F}from"react";import{B as y}from"./use-paginated-core-ClJ0EeGx.mjs";const B=(M,c,g)=>{const e=P(15),{initialNumItems:o}=g,{loadMore:s,pageResults:f,status:a}=y(M,c==="skip"?"skip":c,g),N=c==="skip";let t;if(e[0]!==f){t=[];for(const u of f)u&&t.push(u.page);e[0]=f,e[1]=t}else t=e[1];let r;e[2]!==o||e[3]!==s?(r={defaultNumItems:o,loadMore:s},e[2]=o,e[3]=s,e[4]=r):r=e[4];const h=k(r);let i;e[5]!==o||e[6]!==s?(i=()=>{h.current={defaultNumItems:o,loadMore:s}},e[5]=o,e[6]=s,e[7]=i):i=e[7],F(i);let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=u=>{const{defaultNumItems:I,loadMore:L}=h.current;L(u??I)},e[8]=m):m=e[8];const x=m,l=a==="CanLoadMore",d=!N&&a==="LoadingMore",p=!N&&a==="LoadingFirstPage";let n;return e[9]!==t||e[10]!==a||e[11]!==l||e[12]!==d||e[13]!==p?(n={fetchNextPage:x,hasNextPage:l,isFetchingNextPage:d,isLoading:p,pages:t,status:a},e[9]=t,e[10]=a,e[11]=l,e[12]=d,e[13]=p,e[14]=n):n=e[14],n};export{B as default};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{c as g}from"react/compiler-runtime";import{B as l}from"./use-paginated-core-CLqVCtWq.mjs";const m=(u,a,c)=>{const s=g(7),{loadMore:r,pageResults:i,status:t}=l(u,a==="skip"?"skip":a,c);let o;if(s[0]!==i){o=[];for(const p of i)p&&o.push(...p.page);s[0]=i,s[1]=o}else o=s[1];const n=a!=="skip"&&(t==="LoadingFirstPage"||t==="LoadingMore");let e;return s[2]!==r||s[3]!==o||s[4]!==t||s[5]!==n?(e={isLoading:n,loadMore:r,results:o,status:t},s[2]=r,s[3]=o,s[4]=t,s[5]=n,s[6]=e):e=s[6],e};export{m as usePaginatedQuery};
2
+ import{c as g}from"react/compiler-runtime";import{B as l}from"./use-paginated-core-ClJ0EeGx.mjs";const m=(u,a,c)=>{const s=g(7),{loadMore:r,pageResults:i,status:t}=l(u,a==="skip"?"skip":a,c);let o;if(s[0]!==i){o=[];for(const p of i)p&&o.push(...p.page);s[0]=i,s[1]=o}else o=s[1];const n=a!=="skip"&&(t==="LoadingFirstPage"||t==="LoadingMore");let e;return s[2]!==r||s[3]!==o||s[4]!==t||s[5]!==n?(e={isLoading:n,loadMore:r,results:o,status:t},s[2]=r,s[3]=o,s[4]=t,s[5]=n,s[6]=e):e=s[6],e};export{m as usePaginatedQuery};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{c as N}from"react/compiler-runtime";import{useQueryClient as Q,useQuery as R}from"@tanstack/react-query";import{useState as q,useEffect as h}from"react";import{b as v}from"./cache-DsvFYCr6.mjs";import{useLunora as K}from"./LunoraProvider-InsjxtOB.mjs";import{i as T,y as _}from"./query-key-CJZmOvY4.mjs";const C=(a,c,p)=>{const e=N(9),l=p===void 0?{}:p,r=K(),i=Q(),{shardKey:u}=l,t=c==="skip",n=t?{}:c,s=_(a,n,u),[o,b]=q(r.isReady);let m,y;e[0]!==r||e[1]!==o?(m=()=>{o||r.whenReady().then(()=>{b(!0)})},y=[r,o],e[0]=r,e[1]=o,e[2]=m,e[3]=y):(m=e[2],y=e[3]),h(m,y);const I=t?void 0:r.peekHydratedQuery(a.__lunoraRef,n,u),{data:$}=R({enabled:!t&&o,initialData:I,queryFn:()=>r.query(a,n,{shardKey:u}),queryKey:s,staleTime:Number.POSITIVE_INFINITY}),f=T(s);let d;return e[4]!==r||e[5]!==i||e[6]!==t||e[7]!==f?(d=[r,i,f,t],e[4]=r,e[5]=i,e[6]=t,e[7]=f,e[8]=d):d=e[8],h(()=>t?k:v(r).attach(i,s,a,n,u),d),t?void 0:$};function k(){}export{C as default};
2
+ import{c as N}from"react/compiler-runtime";import{useQueryClient as Q,useQuery as R}from"@tanstack/react-query";import{useState as q,useEffect as h}from"react";import{b as v}from"./cache-DJEsSdUx.mjs";import{useLunora as K}from"./LunoraProvider-InsjxtOB.mjs";import{i as T,y as _}from"./query-key-DV_Vu-6c.mjs";const C=(a,c,p)=>{const e=N(9),l=p===void 0?{}:p,r=K(),i=Q(),{shardKey:u}=l,t=c==="skip",n=t?{}:c,s=_(a,n,u),[o,b]=q(r.isReady);let m,y;e[0]!==r||e[1]!==o?(m=()=>{o||r.whenReady().then(()=>{b(!0)})},y=[r,o],e[0]=r,e[1]=o,e[2]=m,e[3]=y):(m=e[2],y=e[3]),h(m,y);const I=t?void 0:r.peekHydratedQuery(a.__lunoraRef,n,u),{data:$}=R({enabled:!t&&o,initialData:I,queryFn:()=>r.query(a,n,{shardKey:u}),queryKey:s,staleTime:Number.POSITIVE_INFINITY}),f=T(s);let d;return e[4]!==r||e[5]!==i||e[6]!==t||e[7]!==f?(d=[r,i,f,t],e[4]=r,e[5]=i,e[6]=t,e[7]=f,e[8]=d):d=e[8],h(()=>t?k:v(r).attach(i,s,a,n,u),d),t?void 0:$};function k(){}export{C as default};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{useReducer as l,useRef as k,useEffect as y}from"react";import{useLunora as v}from"./LunoraProvider-InsjxtOB.mjs";import{t as x}from"./wire-key-D7KVRdiE.mjs";const g=function(r,e){switch(e.type){case"chunk":return{chunks:[...r.chunks,e.chunk],error:void 0,status:"streaming"};case"complete":return{...r,status:"complete"};case"error":return{...r,error:e.error,status:"error"};case"reset":return{chunks:[],error:void 0,status:"idle"};case"start":return{...r,status:"streaming"};default:return r}},K=(r,e,u={})=>{const f=v(),[a,t]=l(g,{chunks:[],error:void 0,status:"idle"}),c=e==="skip",p=c?"skip":x(e),o=k(void 0);return y(()=>{if(c)return t({type:"reset"}),()=>{};t({type:"reset"}),t({type:"start"});let n=!0,i=!1;const h=f.stream(r,e,{maxBuffer:u.maxBuffer,shardKey:u.shardKey}),m=()=>{i||(i=!0,h.cancel())};return o.current=m,(async()=>{try{for await(const s of h){if(!n)return;t({chunk:s,type:"chunk"})}n&&t({type:"complete"})}catch(s){if(!n)return;const d=s instanceof Error?s:new Error(String(s));t({error:d,type:"error"})}})().catch(()=>{}),()=>{n=!1,m(),o.current=void 0}},[f,r.__lunoraRef,p,c,u.shardKey,u.maxBuffer]),{cancel:()=>{o.current?.()},chunks:a.chunks,error:a.error,status:a.status}};export{K as useStream};
2
+ import{useReducer as l,useRef as k,useEffect as y}from"react";import{useLunora as v}from"./LunoraProvider-InsjxtOB.mjs";import{t as x}from"./wire-key-BjAV3_Rq.mjs";const g=function(r,e){switch(e.type){case"chunk":return{chunks:[...r.chunks,e.chunk],error:void 0,status:"streaming"};case"complete":return{...r,status:"complete"};case"error":return{...r,error:e.error,status:"error"};case"reset":return{chunks:[],error:void 0,status:"idle"};case"start":return{...r,status:"streaming"};default:return r}},K=(r,e,u={})=>{const f=v(),[a,t]=l(g,{chunks:[],error:void 0,status:"idle"}),c=e==="skip",p=c?"skip":x(e),o=k(void 0);return y(()=>{if(c)return t({type:"reset"}),()=>{};t({type:"reset"}),t({type:"start"});let n=!0,i=!1;const h=f.stream(r,e,{maxBuffer:u.maxBuffer,shardKey:u.shardKey}),m=()=>{i||(i=!0,h.cancel())};return o.current=m,(async()=>{try{for await(const s of h){if(!n)return;t({chunk:s,type:"chunk"})}n&&t({type:"complete"})}catch(s){if(!n)return;const d=s instanceof Error?s:new Error(String(s));t({error:d,type:"error"})}})().catch(()=>{}),()=>{n=!1,m(),o.current=void 0}},[f,r.__lunoraRef,p,c,u.shardKey,u.maxBuffer]),{cancel:()=>{o.current?.()},chunks:a.chunks,error:a.error,status:a.status}};export{K as useStream};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{c as b}from"react/compiler-runtime";import{createQuerySubscription as w}from"@lunora/client/query";import{useState as x,useRef as q,useEffect as v}from"react";import{useLunora as A}from"./LunoraProvider-InsjxtOB.mjs";import{t as D}from"./wire-key-D7KVRdiE.mjs";const B=(o,r,n)=>{const e=b(22);let u;e[0]!==n?(u=n===void 0?{}:n,e[0]=n,e[1]=u):u=e[1];const a=u,s=A();let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={data:void 0,error:void 0},e[2]=c):c=e[2];const[g,p]=x(c),t=r==="skip";let d;e[3]!==r||e[4]!==t?(d=t?"skip":D(r),e[3]=r,e[4]=t,e[5]=d):d=e[5];const y=d;let f;e[6]!==r||e[7]!==o?(f={args:r,fn:o},e[6]=r,e[7]=o,e[8]=f):f=e[8];const _=q(f);let i;e[9]!==r||e[10]!==o?(i=()=>{_.current={args:r,fn:o}},e[9]=r,e[10]=o,e[11]=i):i=e[11],v(i);let l;e[12]!==s||e[13]!==a.shardKey||e[14]!==t?(l=()=>{if(t)return p({data:void 0,error:void 0}),L;let h=!1;const{args:k,fn:E}=_.current,R=w(s,E,k,{onData:K=>{h||p({data:K,error:void 0})},onError:K=>{const S=new Error(K.message);queueMicrotask(()=>{h||p({data:void 0,error:S})})}},{shardKey:a.shardKey});return()=>{h=!0,R()}},e[12]=s,e[13]=a.shardKey,e[14]=t,e[15]=l):l=e[15];let m;return e[16]!==s||e[17]!==o.__lunoraRef||e[18]!==a.shardKey||e[19]!==y||e[20]!==t?(m=[s,o.__lunoraRef,y,a.shardKey,t],e[16]=s,e[17]=o.__lunoraRef,e[18]=a.shardKey,e[19]=y,e[20]=t,e[21]=m):m=e[21],v(l,m),g};function L(){}export{B as default};
2
+ import{c as b}from"react/compiler-runtime";import{createQuerySubscription as w}from"@lunora/client/query";import{useState as x,useRef as q,useEffect as v}from"react";import{useLunora as A}from"./LunoraProvider-InsjxtOB.mjs";import{t as D}from"./wire-key-BjAV3_Rq.mjs";const B=(o,r,n)=>{const e=b(22);let u;e[0]!==n?(u=n===void 0?{}:n,e[0]=n,e[1]=u):u=e[1];const a=u,s=A();let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={data:void 0,error:void 0},e[2]=c):c=e[2];const[g,p]=x(c),t=r==="skip";let d;e[3]!==r||e[4]!==t?(d=t?"skip":D(r),e[3]=r,e[4]=t,e[5]=d):d=e[5];const y=d;let f;e[6]!==r||e[7]!==o?(f={args:r,fn:o},e[6]=r,e[7]=o,e[8]=f):f=e[8];const _=q(f);let i;e[9]!==r||e[10]!==o?(i=()=>{_.current={args:r,fn:o}},e[9]=r,e[10]=o,e[11]=i):i=e[11],v(i);let l;e[12]!==s||e[13]!==a.shardKey||e[14]!==t?(l=()=>{if(t)return p({data:void 0,error:void 0}),L;let h=!1;const{args:k,fn:E}=_.current,R=w(s,E,k,{onData:K=>{h||p({data:K,error:void 0})},onError:K=>{const S=new Error(K.message);queueMicrotask(()=>{h||p({data:void 0,error:S})})}},{shardKey:a.shardKey});return()=>{h=!0,R()}},e[12]=s,e[13]=a.shardKey,e[14]=t,e[15]=l):l=e[15];let m;return e[16]!==s||e[17]!==o.__lunoraRef||e[18]!==a.shardKey||e[19]!==y||e[20]!==t?(m=[s,o.__lunoraRef,y,a.shardKey,t],e[16]=s,e[17]=o.__lunoraRef,e[18]=a.shardKey,e[19]=y,e[20]=t,e[21]=m):m=e[21],v(l,m),g};function L(){}export{B as default};
@@ -0,0 +1 @@
1
+ import{e as b}from"./stable-key-BSG0zK_E.mjs";const c=r=>{let t="";for(let a=0;a<r.length;a+=32768)t+=String.fromCharCode(...r.subarray(a,a+32768));return btoa(t)},o="$lunora.wire$",l=64,p="__proto__",d=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>l)throw new RangeError(`wire-codec: value nesting exceeds the ${l}-level limit`);if(r===void 0)return[o,"undefined"];if(r===null)return null;const a=typeof r;if(a==="bigint")return[o,"bigint",r.toString()];if(a==="number"){const e=r;return Number.isNaN(e)?[o,"nan"]:e===1/0?[o,"inf"]:e===-1/0?[o,"-inf"]:e}if(a!=="object")return r;if(r instanceof Date)return[o,"date",i(r.getTime(),t+1)];if(r instanceof Error){const e=r,n={};for(const s of Object.keys(e))e[s]!==void 0&&(n[s]=i(e[s],t+1));const f=[o,"error",e.name,e.message,n];return e.cause!==void 0&&f.push(i(e.cause,t+1)),f}if(r instanceof URL)return[o,"url",r.href];if(r instanceof Map)return[o,"map",[...r.entries()].map(([e,n])=>[i(e,t+1),i(n,t+1)])];if(r instanceof Set)return[o,"set",[...r].map(e=>i(e,t+1))];if(r instanceof ArrayBuffer)return[o,"bytes",c(new Uint8Array(r)),"ArrayBuffer"];if(ArrayBuffer.isView(r)){const e=r,n=e.constructor.name,f=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return n==="Uint8Array"?[o,"bytes",c(f)]:[o,"bytes",c(f),n]}if(Array.isArray(r)){const e=r.map(n=>i(n,t+1));return e.length>0&&e[0]===o?[o,"arr",e]:e}if(!d(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 y=r,u={};for(const e of Object.keys(y)){const n=y[e];if(n===void 0)continue;const f=i(n,t+1);e===p?Object.defineProperty(u,e,{configurable:!0,enumerable:!0,value:f,writable:!0}):u[e]=f}return u},g=r=>b(i(r));export{g as t};
package/dist/server.mjs CHANGED
@@ -1 +1 @@
1
- import{createServerClient as o}from"@lunora/client/ssr";import{createServerClient as m,deserializePreloaded as K,getServerSession as Q,serializePreloaded as x}from"@lunora/client/ssr";import{y as s}from"./packem_shared/query-key-CJZmOvY4.mjs";import{lunoraQueryOptions as S}from"./packem_shared/lunoraQueryOptions-DD07hq_6.mjs";import{preloadQuery as v,preloadedQueryResult as N}from"@lunora/client";import{HydrationBoundary as T,dehydrate as z}from"@tanstack/react-query";const u=async(r,a,e,t,y={})=>{const d=t??{};await r.prefetchQuery({queryFn:()=>a.query(e,d,{shardKey:y.shardKey}),queryKey:s(e,d,y.shardKey),staleTime:Number.POSITIVE_INFINITY})},c=async(r,a,e,t={})=>o(r).query(a,e,{shardKey:t.shardKey}),h=async(r,a,e,t={})=>o(r).mutation(a,e,{shardKey:t.shardKey}),p=async(r,a,e,t={})=>o(r).action(a,e,{shardKey:t.shardKey});export{T as HydrationBoundary,m as createServerClient,z as dehydrate,K as deserializePreloaded,p as fetchAction,h as fetchMutation,c as fetchQuery,Q as getServerSession,S as lunoraQueryOptions,u as prefetchQuery,v as preloadQuery,N as preloadedQueryResult,x as serializePreloaded};
1
+ import{createServerClient as o}from"@lunora/client/ssr";import{createServerClient as m,deserializePreloaded as K,getServerSession as Q,serializePreloaded as x}from"@lunora/client/ssr";import{y as s}from"./packem_shared/query-key-DV_Vu-6c.mjs";import{lunoraQueryOptions as S}from"./packem_shared/lunoraQueryOptions-DWEJoNnh.mjs";import{preloadQuery as v,preloadedQueryResult as N}from"@lunora/client";import{HydrationBoundary as T,dehydrate as z}from"@tanstack/react-query";const u=async(r,a,e,t,y={})=>{const d=t??{};await r.prefetchQuery({queryFn:()=>a.query(e,d,{shardKey:y.shardKey}),queryKey:s(e,d,y.shardKey),staleTime:Number.POSITIVE_INFINITY})},c=async(r,a,e,t={})=>o(r).query(a,e,{shardKey:t.shardKey}),h=async(r,a,e,t={})=>o(r).mutation(a,e,{shardKey:t.shardKey}),p=async(r,a,e,t={})=>o(r).action(a,e,{shardKey:t.shardKey});export{T as HydrationBoundary,m as createServerClient,z as dehydrate,K as deserializePreloaded,p as fetchAction,h as fetchMutation,c 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.42",
3
+ "version": "1.0.0-alpha.44",
4
4
  "description": "React hooks for Lunora: useQuery, useMutation, useSubscription, and useAuth",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -53,9 +53,9 @@
53
53
  "access": "public"
54
54
  },
55
55
  "dependencies": {
56
- "@lunora/client": "1.0.0-alpha.38",
57
- "@lunora/errors": "1.0.0-alpha.13",
58
- "@lunora/ratelimit": "1.0.0-alpha.16",
56
+ "@lunora/client": "1.0.0-alpha.40",
57
+ "@lunora/errors": "1.0.0-alpha.14",
58
+ "@lunora/ratelimit": "1.0.0-alpha.17",
59
59
  "@visulima/storage-client": "1.0.0"
60
60
  },
61
61
  "peerDependencies": {
@@ -1 +0,0 @@
1
- import{e as b}from"./stable-key-BSG0zK_E.mjs";const u=r=>{let e="";for(let a=0;a<r.length;a+=32768)e+=String.fromCharCode(...r.subarray(a,a+32768));return btoa(e)},o="$lunora.wire$",l=64,p=r=>{if(r===null||typeof r!="object")return!1;const e=Object.getPrototypeOf(r);return e===null||e===Object.prototype},i=(r,e=0)=>{if(e>l)throw new RangeError(`wire-codec: value nesting exceeds the ${l}-level limit`);if(r===void 0)return[o,"undefined"];if(r===null)return null;const a=typeof r;if(a==="bigint")return[o,"bigint",r.toString()];if(a==="number"){const t=r;return Number.isNaN(t)?[o,"nan"]:t===1/0?[o,"inf"]:t===-1/0?[o,"-inf"]:t}if(a!=="object")return r;if(r instanceof Date)return[o,"date",i(r.getTime(),e+1)];if(r instanceof Error){const t=r,n={};for(const s of Object.keys(t))t[s]!==void 0&&(n[s]=i(t[s],e+1));const f=[o,"error",t.name,t.message,n];return t.cause!==void 0&&f.push(i(t.cause,e+1)),f}if(r instanceof URL)return[o,"url",r.href];if(r instanceof Map)return[o,"map",[...r.entries()].map(([t,n])=>[i(t,e+1),i(n,e+1)])];if(r instanceof Set)return[o,"set",[...r].map(t=>i(t,e+1))];if(r instanceof ArrayBuffer)return[o,"bytes",u(new Uint8Array(r)),"ArrayBuffer"];if(ArrayBuffer.isView(r)){const t=r,n=t.constructor.name,f=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);return n==="Uint8Array"?[o,"bytes",u(f)]:[o,"bytes",u(f),n]}if(Array.isArray(r)){const t=r.map(n=>i(n,e+1));return t.length>0&&t[0]===o?[o,"arr",t]:t}if(!p(r)){const t=r.constructor?.name??"value";throw new TypeError(`wire-codec: cannot encode a ${t} 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,y={};for(const t of Object.keys(c)){const n=c[t];n!==void 0&&(y[t]=i(n,e+1))}return y},m=r=>b(i(r));export{m as t};