@lunora/svelte 1.0.0-alpha.266 → 1.0.0-alpha.267
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/README.md +1 -0
- package/dist/index.d.mts +26 -3
- package/dist/index.d.ts +26 -3
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/liveTopic-DiHigDnv.mjs +1 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -104,6 +104,7 @@ All functions that require a component lifecycle (presence, rate-limit) return a
|
|
|
104
104
|
| `query` | `useQuery` | Live readable store — updates on every server delta. |
|
|
105
105
|
| `mutation` | `useMutation` | Optimistic mutation handle (`data`, `error`, `pending`, `mutate`, `reset` stores). |
|
|
106
106
|
| `subscription` | `useSubscription` | Raw subscription readable — unbounded live stream. |
|
|
107
|
+
| `liveTopic` | `useLiveTopic` | One live topic on the shared stream — readable of `{ lastEvent, error }`, no teardown. |
|
|
107
108
|
| `paginatedQuery` | `usePaginatedQuery` | Cursor-paginated query with `loadMore`, `status`, `results`, and `error` stores. |
|
|
108
109
|
| `infiniteQuery` | `useInfiniteQuery` | Infinite-scroll variant of `paginatedQuery`. |
|
|
109
110
|
| `auth` | `useAuth` | Reactive auth stores (`user`, `token`, `status`) plus `setToken`. |
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FunctionReference, ArgsOf, ActionCallOptions, ReturnOf, LunoraClient, SubscriptionErrorCallback, User, ConnectionStatus, Preloaded, MutationCallOptions, MutatorHandle, SubscriptionError } from '@lunora/client';
|
|
1
|
+
import { FunctionReference, ArgsOf, ActionCallOptions, ReturnOf, LunoraClient, SubscriptionErrorCallback, User, ConnectionStatus, Preloaded, LiveStreamSubscribeError, SubscribeLiveTopicOptions, MutationCallOptions, MutatorHandle, SubscriptionError } from '@lunora/client';
|
|
2
2
|
export type { ArgsOf, ConnectionStatus, FunctionReference, LunoraClient, MutationCallOptions, MutatorHandle, MutatorTransaction, Preloaded, ReturnOf } from '@lunora/client';
|
|
3
3
|
import { Readable } from 'svelte/store';
|
|
4
4
|
import { AuthStatus } from '@lunora/client/auth';
|
|
@@ -680,6 +680,29 @@ declare function flags<T extends Record<string, FlagValue>>(client: LunoraClient
|
|
|
680
680
|
declare const hydratePreloaded: <T>(preloaded: Preloaded<T>, client?: LunoraClient, options?: {
|
|
681
681
|
onError?: SubscriptionErrorCallback;
|
|
682
682
|
}) => Readable<T | undefined>;
|
|
683
|
+
/**
|
|
684
|
+
* `liveTopic` — follow one live topic on the connection shared by its URL.
|
|
685
|
+
*
|
|
686
|
+
* A thin lifecycle wrapper over `subscribeLiveTopic` from `@lunora/client`. The
|
|
687
|
+
* subscription opens when the store gets its first subscriber and closes when it
|
|
688
|
+
* loses its last one, so there is no `teardown()` to call. Like the other stores
|
|
689
|
+
* here, a server render subscribes and opens nothing.
|
|
690
|
+
*/
|
|
691
|
+
/** The state a `liveTopic` store holds. */
|
|
692
|
+
interface LiveTopicState {
|
|
693
|
+
/** The shard's refusal of this subscription (403, 409, 429 and similar), or `undefined`. */
|
|
694
|
+
error: LiveStreamSubscribeError | undefined;
|
|
695
|
+
/** The last payload delivered on the topic, or `undefined` until the first event. */
|
|
696
|
+
lastEvent: unknown;
|
|
697
|
+
}
|
|
698
|
+
/**
|
|
699
|
+
* Follow `options.topic` on the shared live connection for `options.url`.
|
|
700
|
+
*
|
|
701
|
+
* `options` may also be a `Readable` store. A new emission resubscribes only when
|
|
702
|
+
* its url, topic or connection options change; a new `onEvent` / `onError` is
|
|
703
|
+
* picked up on the next call without reopening the subscription.
|
|
704
|
+
*/
|
|
705
|
+
declare const liveTopic: (options: SubscribeLiveTopicOptions | Readable<SubscribeLiveTopicOptions>) => Readable<LiveTopicState>;
|
|
683
706
|
/**
|
|
684
707
|
* The reactive handle returned by {@link mutation} — the Svelte counterpart to
|
|
685
708
|
* React's `useMutation`, re-expressed as stores you read with `$`. The surface
|
|
@@ -1239,7 +1262,7 @@ interface VoiceAgentHandle {
|
|
|
1239
1262
|
*/
|
|
1240
1263
|
declare function voiceAgent(options: VoiceAgentOptions): VoiceAgentHandle;
|
|
1241
1264
|
declare function voiceAgent(client: LunoraClient, options: VoiceAgentOptions): VoiceAgentHandle;
|
|
1242
|
-
export { type ActionHandle, type AgentApi, type AgentChatApi, type AgentChatHandle, type AgentChatMessage, type AgentChatOptions, type AgentHandle, type AgentLiveEvent, type AgentOptions, type AgentProgressEvent, type AgentStateApi, type AgentStateHandle, type AgentStateOptions, type AgentThreadRecord, type AgentThreadStatus, type AgentTokenDelta, type AgentToolEvent, type AgentToolEventsApi, type AgentToolEventsHandle, type AgentToolEventsOptions, type AuthGateStore, type AuthStore, type ConnectionStatusStore, type FlagValue, type HeartbeatReference, type InfiniteQueryHandle, type InfiniteQueryOptions, type ListPresentReference, type MutationHandle, type MutatorHandleStore, type PageItemOf, type PaginatedArgs, type PaginatedQueryHandle, type PaginatedQueryOptions, type PresenceHandle, type PresenceOptions, type QueryStore, type QueryStoreOptions, type RateLimitHandle, type RateLimitOptions, type ReactiveArgs, type ReactivePaginatedArgs, type StreamHandle, type StreamStatus, type StreamStoreOptions, type SubscriptionHandle, type SubscriptionStoreOptions, type VoiceAgentHandle, type VoiceAgentOptions, type VoiceAudioFormat, type VoiceReference, type VoiceStatus, action, agent, agentChat, agentState, agentToolEvents, auth, authGate, connectionStatus, flag, flags,
|
|
1265
|
+
export { type ActionHandle, type AgentApi, type AgentChatApi, type AgentChatHandle, type AgentChatMessage, type AgentChatOptions, type AgentHandle, type AgentLiveEvent, type AgentOptions, type AgentProgressEvent, type AgentStateApi, type AgentStateHandle, type AgentStateOptions, type AgentThreadRecord, type AgentThreadStatus, type AgentTokenDelta, type AgentToolEvent, type AgentToolEventsApi, type AgentToolEventsHandle, type AgentToolEventsOptions, type AuthGateStore, type AuthStore, type ConnectionStatusStore, type FlagValue, type HeartbeatReference, type InfiniteQueryHandle, type InfiniteQueryOptions, type ListPresentReference, type LiveTopicState, type MutationHandle, type MutatorHandleStore, type PageItemOf, type PaginatedArgs, type PaginatedQueryHandle, type PaginatedQueryOptions, type PresenceHandle, type PresenceOptions, type QueryStore, type QueryStoreOptions, type RateLimitHandle, type RateLimitOptions, type ReactiveArgs, type ReactivePaginatedArgs, type StreamHandle, type StreamStatus, type StreamStoreOptions, type SubscriptionHandle, type SubscriptionStoreOptions, type VoiceAgentHandle, type VoiceAgentOptions, type VoiceAudioFormat, type VoiceReference, type VoiceStatus, action, agent, agentChat, agentState, agentToolEvents, auth, authGate, connectionStatus, flag, flags,
|
|
1243
1266
|
/**
|
|
1244
1267
|
* Svelte adapter for Lunora (`@lunora/svelte`).
|
|
1245
1268
|
*
|
|
@@ -1261,7 +1284,7 @@ export { type ActionHandle, type AgentApi, type AgentChatApi, type AgentChatHand
|
|
|
1261
1284
|
* framework-neutral server contract) — import them there in your SvelteKit
|
|
1262
1285
|
* `+page.ts` / `+layout.ts` load.
|
|
1263
1286
|
*/
|
|
1264
|
-
getLunoraClient, hydratePreloaded, infiniteQuery, mutation, mutator, paginatedQuery, presence, query, rateLimit,
|
|
1287
|
+
getLunoraClient, hydratePreloaded, infiniteQuery, liveTopic, mutation, mutator, paginatedQuery, presence, query, rateLimit,
|
|
1265
1288
|
/**
|
|
1266
1289
|
* Svelte adapter for Lunora (`@lunora/svelte`).
|
|
1267
1290
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FunctionReference, ArgsOf, ActionCallOptions, ReturnOf, LunoraClient, SubscriptionErrorCallback, User, ConnectionStatus, Preloaded, MutationCallOptions, MutatorHandle, SubscriptionError } from '@lunora/client';
|
|
1
|
+
import { FunctionReference, ArgsOf, ActionCallOptions, ReturnOf, LunoraClient, SubscriptionErrorCallback, User, ConnectionStatus, Preloaded, LiveStreamSubscribeError, SubscribeLiveTopicOptions, MutationCallOptions, MutatorHandle, SubscriptionError } from '@lunora/client';
|
|
2
2
|
export type { ArgsOf, ConnectionStatus, FunctionReference, LunoraClient, MutationCallOptions, MutatorHandle, MutatorTransaction, Preloaded, ReturnOf } from '@lunora/client';
|
|
3
3
|
import { Readable } from 'svelte/store';
|
|
4
4
|
import { AuthStatus } from '@lunora/client/auth';
|
|
@@ -680,6 +680,29 @@ declare function flags<T extends Record<string, FlagValue>>(client: LunoraClient
|
|
|
680
680
|
declare const hydratePreloaded: <T>(preloaded: Preloaded<T>, client?: LunoraClient, options?: {
|
|
681
681
|
onError?: SubscriptionErrorCallback;
|
|
682
682
|
}) => Readable<T | undefined>;
|
|
683
|
+
/**
|
|
684
|
+
* `liveTopic` — follow one live topic on the connection shared by its URL.
|
|
685
|
+
*
|
|
686
|
+
* A thin lifecycle wrapper over `subscribeLiveTopic` from `@lunora/client`. The
|
|
687
|
+
* subscription opens when the store gets its first subscriber and closes when it
|
|
688
|
+
* loses its last one, so there is no `teardown()` to call. Like the other stores
|
|
689
|
+
* here, a server render subscribes and opens nothing.
|
|
690
|
+
*/
|
|
691
|
+
/** The state a `liveTopic` store holds. */
|
|
692
|
+
interface LiveTopicState {
|
|
693
|
+
/** The shard's refusal of this subscription (403, 409, 429 and similar), or `undefined`. */
|
|
694
|
+
error: LiveStreamSubscribeError | undefined;
|
|
695
|
+
/** The last payload delivered on the topic, or `undefined` until the first event. */
|
|
696
|
+
lastEvent: unknown;
|
|
697
|
+
}
|
|
698
|
+
/**
|
|
699
|
+
* Follow `options.topic` on the shared live connection for `options.url`.
|
|
700
|
+
*
|
|
701
|
+
* `options` may also be a `Readable` store. A new emission resubscribes only when
|
|
702
|
+
* its url, topic or connection options change; a new `onEvent` / `onError` is
|
|
703
|
+
* picked up on the next call without reopening the subscription.
|
|
704
|
+
*/
|
|
705
|
+
declare const liveTopic: (options: SubscribeLiveTopicOptions | Readable<SubscribeLiveTopicOptions>) => Readable<LiveTopicState>;
|
|
683
706
|
/**
|
|
684
707
|
* The reactive handle returned by {@link mutation} — the Svelte counterpart to
|
|
685
708
|
* React's `useMutation`, re-expressed as stores you read with `$`. The surface
|
|
@@ -1239,7 +1262,7 @@ interface VoiceAgentHandle {
|
|
|
1239
1262
|
*/
|
|
1240
1263
|
declare function voiceAgent(options: VoiceAgentOptions): VoiceAgentHandle;
|
|
1241
1264
|
declare function voiceAgent(client: LunoraClient, options: VoiceAgentOptions): VoiceAgentHandle;
|
|
1242
|
-
export { type ActionHandle, type AgentApi, type AgentChatApi, type AgentChatHandle, type AgentChatMessage, type AgentChatOptions, type AgentHandle, type AgentLiveEvent, type AgentOptions, type AgentProgressEvent, type AgentStateApi, type AgentStateHandle, type AgentStateOptions, type AgentThreadRecord, type AgentThreadStatus, type AgentTokenDelta, type AgentToolEvent, type AgentToolEventsApi, type AgentToolEventsHandle, type AgentToolEventsOptions, type AuthGateStore, type AuthStore, type ConnectionStatusStore, type FlagValue, type HeartbeatReference, type InfiniteQueryHandle, type InfiniteQueryOptions, type ListPresentReference, type MutationHandle, type MutatorHandleStore, type PageItemOf, type PaginatedArgs, type PaginatedQueryHandle, type PaginatedQueryOptions, type PresenceHandle, type PresenceOptions, type QueryStore, type QueryStoreOptions, type RateLimitHandle, type RateLimitOptions, type ReactiveArgs, type ReactivePaginatedArgs, type StreamHandle, type StreamStatus, type StreamStoreOptions, type SubscriptionHandle, type SubscriptionStoreOptions, type VoiceAgentHandle, type VoiceAgentOptions, type VoiceAudioFormat, type VoiceReference, type VoiceStatus, action, agent, agentChat, agentState, agentToolEvents, auth, authGate, connectionStatus, flag, flags,
|
|
1265
|
+
export { type ActionHandle, type AgentApi, type AgentChatApi, type AgentChatHandle, type AgentChatMessage, type AgentChatOptions, type AgentHandle, type AgentLiveEvent, type AgentOptions, type AgentProgressEvent, type AgentStateApi, type AgentStateHandle, type AgentStateOptions, type AgentThreadRecord, type AgentThreadStatus, type AgentTokenDelta, type AgentToolEvent, type AgentToolEventsApi, type AgentToolEventsHandle, type AgentToolEventsOptions, type AuthGateStore, type AuthStore, type ConnectionStatusStore, type FlagValue, type HeartbeatReference, type InfiniteQueryHandle, type InfiniteQueryOptions, type ListPresentReference, type LiveTopicState, type MutationHandle, type MutatorHandleStore, type PageItemOf, type PaginatedArgs, type PaginatedQueryHandle, type PaginatedQueryOptions, type PresenceHandle, type PresenceOptions, type QueryStore, type QueryStoreOptions, type RateLimitHandle, type RateLimitOptions, type ReactiveArgs, type ReactivePaginatedArgs, type StreamHandle, type StreamStatus, type StreamStoreOptions, type SubscriptionHandle, type SubscriptionStoreOptions, type VoiceAgentHandle, type VoiceAgentOptions, type VoiceAudioFormat, type VoiceReference, type VoiceStatus, action, agent, agentChat, agentState, agentToolEvents, auth, authGate, connectionStatus, flag, flags,
|
|
1243
1266
|
/**
|
|
1244
1267
|
* Svelte adapter for Lunora (`@lunora/svelte`).
|
|
1245
1268
|
*
|
|
@@ -1261,7 +1284,7 @@ export { type ActionHandle, type AgentApi, type AgentChatApi, type AgentChatHand
|
|
|
1261
1284
|
* framework-neutral server contract) — import them there in your SvelteKit
|
|
1262
1285
|
* `+page.ts` / `+layout.ts` load.
|
|
1263
1286
|
*/
|
|
1264
|
-
getLunoraClient, hydratePreloaded, infiniteQuery, mutation, mutator, paginatedQuery, presence, query, rateLimit,
|
|
1287
|
+
getLunoraClient, hydratePreloaded, infiniteQuery, liveTopic, mutation, mutator, paginatedQuery, presence, query, rateLimit,
|
|
1265
1288
|
/**
|
|
1266
1289
|
* Svelte adapter for Lunora (`@lunora/svelte`).
|
|
1267
1290
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{action as t}from"./packem_shared/action-SjeZUGhX.mjs";import{agent as
|
|
1
|
+
import{action as t}from"./packem_shared/action-SjeZUGhX.mjs";import{agent as m}from"./packem_shared/agent-WMVWf1Ks.mjs";import{agentChat as a}from"./packem_shared/agentChat-CX6dTMoY.mjs";import{agentState as n}from"./packem_shared/agentState-DQC-OIi6.mjs";import{agentToolEvents as i}from"./packem_shared/agentToolEvents-BD98xaGH.mjs";import{auth as g,authGate as s}from"./packem_shared/auth-Z0G_aZYz.mjs";import{connectionStatus as l}from"./packem_shared/connectionStatus-DMx3BE5Q.mjs";import{getLunoraClient as h,setLunoraClient as y}from"./packem_shared/getLunoraClient-DU7BmZy1.mjs";import{flag as C,flags as L}from"./packem_shared/flag-Csh9LBiO.mjs";import{hydratePreloaded as S}from"./packem_shared/hydratePreloaded-CNm2-Rha.mjs";import{liveTopic as b}from"./packem_shared/liveTopic-DiHigDnv.mjs";import{mutation as A}from"./packem_shared/mutation-DLBr5Op1.mjs";import{mutator as G}from"./packem_shared/mutator-DECDuo94.mjs";import{infiniteQuery as j,paginatedQuery as k}from"./packem_shared/infiniteQuery-B6dobUkL.mjs";import{presence as z}from"./packem_shared/presence-C4ZgfGfr.mjs";import{query as D}from"./packem_shared/query-C6B__ZRN.mjs";import{rateLimit as H}from"./packem_shared/rateLimit-Cli38qWO.mjs";import{stream as J}from"./packem_shared/stream-Cxl8guzh.mjs";import{subscription as M}from"./packem_shared/subscription-BKRHURpA.mjs";import{voiceAgent as O}from"./packem_shared/voiceAgent-KSChAXsW.mjs";export{t as action,m as agent,a as agentChat,n as agentState,i as agentToolEvents,g as auth,s as authGate,l as connectionStatus,C as flag,L as flags,h as getLunoraClient,S as hydratePreloaded,j as infiniteQuery,b as liveTopic,A as mutation,G as mutator,k as paginatedQuery,z as presence,D as query,H as rateLimit,y as setLunoraClient,J as stream,M as subscription,O as voiceAgent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{subscribeLiveTopic as d}from"@lunora/client";import{readable as c,derived as m}from"svelte/store";import{i as u}from"./is-browser-BEdfLJHK.mjs";import{i as b,s as y}from"./subscribe-reactive-args-D0fSbP1k.mjs";const E=r=>({headers:r.headers,maxDelayMs:r.maxDelayMs,retryDelay:r.retryDelay,sessionKey:r.sessionKey,topic:r.topic,url:r.url,withCredentials:r.withCredentials}),w=r=>c({error:void 0,lastEvent:void 0},o=>{if(!u())return;const a=b(r)?r:c(r);let s;const n=a.subscribe(i=>{s=i}),l=i=>{let t;return o({error:void 0,lastEvent:t}),d({...i,onError:e=>{o({error:e,lastEvent:t}),s?.onError?.(e)},onEvent:e=>{t=e,o({error:void 0,lastEvent:t}),s?.onEvent?.(e)}})},v=y(m(a,E),l);return()=>{v(),n()}});export{w as liveTopic};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/svelte",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.267",
|
|
4
4
|
"description": "Svelte adapter for Lunora — live stores, optimistic mutations, and reactive loaders",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@lunora/client": "1.0.0-alpha.
|
|
57
|
+
"@lunora/client": "1.0.0-alpha.228",
|
|
58
58
|
"@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
|
|
59
|
-
"@lunora/ratelimit": "1.0.0-alpha.
|
|
59
|
+
"@lunora/ratelimit": "1.0.0-alpha.151",
|
|
60
60
|
"@lunora/wire": "1.0.0-alpha.1",
|
|
61
61
|
"@visulima/storage-client": "1.0.9"
|
|
62
62
|
},
|