@lunora/solid 1.0.0-alpha.236 → 1.0.0-alpha.237
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 +24 -3
- package/dist/index.d.ts +24 -3
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/createLiveTopic-EjgSMydg.mjs +1 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -102,6 +102,7 @@ render(
|
|
|
102
102
|
| `createQuery` | `useQuery` | Live query signal — returns `() => T \| undefined`, re-subscribes on arg change. |
|
|
103
103
|
| `createMutation` | `useMutation` | Optimistic mutation handle (`data`, `error`, `pending`, `mutate`, `reset`). |
|
|
104
104
|
| `createSubscription` | `useSubscription` | Raw subscription signal — unbounded live stream. |
|
|
105
|
+
| `createLiveTopic` | `useLiveTopic` | One live topic on the shared stream — `lastEvent` and `error` accessors. |
|
|
105
106
|
| `createPaginatedQuery` | `usePaginatedQuery` | Cursor-paginated query with `loadMore`, `status`, `results`, and `error` signals. |
|
|
106
107
|
| `createInfiniteQuery` | `useInfiniteQuery` | Infinite-scroll variant of `createPaginatedQuery`. |
|
|
107
108
|
| `createAuth` | `useAuth` | Reactive auth state (`token`, `user`, `status` signals + `setToken`). |
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LunoraClient, FunctionReference, ArgsOf, ActionCallOptions, ReturnOf, SubscriptionErrorCallback, User, ConnectionStatus, MutationCallOptions, MutatorHandle, SubscriptionError, Preloaded } from '@lunora/client';
|
|
1
|
+
import { LunoraClient, FunctionReference, ArgsOf, ActionCallOptions, ReturnOf, SubscriptionErrorCallback, User, ConnectionStatus, LiveStreamSubscribeError, SubscribeLiveTopicOptions, MutationCallOptions, MutatorHandle, SubscriptionError, Preloaded } from '@lunora/client';
|
|
2
2
|
export type { ArgsOf, FunctionReference, MutatorHandle, MutatorTransaction, OptimisticUpdate, Preloaded, ReturnOf, SubscriptionError, SubscriptionErrorCallback, Unsubscribe } from '@lunora/client';
|
|
3
3
|
import { Context, Accessor } from 'solid-js';
|
|
4
4
|
import { AuthStatus } from '@lunora/client/auth';
|
|
@@ -613,6 +613,27 @@ declare const createFlag: <T extends FlagValue>(key: MaybeAccessor<string>, defa
|
|
|
613
613
|
* reactive — the subscriptions open on mount and tear down on cleanup.
|
|
614
614
|
*/
|
|
615
615
|
declare const createFlags: <T extends Record<string, FlagValue>>(flags: T) => Accessor<T>;
|
|
616
|
+
/**
|
|
617
|
+
* `createLiveTopic` — follow one live topic on the connection shared by its URL.
|
|
618
|
+
*
|
|
619
|
+
* A thin lifecycle wrapper over `subscribeLiveTopic` from `@lunora/client`: it
|
|
620
|
+
* subscribes when the owner mounts, unsubscribes on cleanup, and resubscribes when
|
|
621
|
+
* the url, topic or connection options change. Callbacks are not part of that
|
|
622
|
+
* identity, so a new `onEvent` / `onError` never reopens the subscription.
|
|
623
|
+
*/
|
|
624
|
+
interface CreateLiveTopicResult {
|
|
625
|
+
/** The shard's refusal of this subscription (403, 409, 429 and similar), or `undefined`. */
|
|
626
|
+
error: Accessor<LiveStreamSubscribeError | undefined>;
|
|
627
|
+
/** The last payload delivered on the topic, or `undefined` until the first event. */
|
|
628
|
+
lastEvent: Accessor<unknown>;
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Follow `options.topic` on the shared live connection for `options.url`.
|
|
632
|
+
*
|
|
633
|
+
* `options` may be a plain object or an accessor. The `onEvent` and `onError`
|
|
634
|
+
* callbacks are read at call time, so the latest identity is always the one invoked.
|
|
635
|
+
*/
|
|
636
|
+
declare const createLiveTopic: (options: SubscribeLiveTopicOptions | Accessor<SubscribeLiveTopicOptions>) => CreateLiveTopicResult;
|
|
616
637
|
interface MutationHandle<F extends FunctionReference> {
|
|
617
638
|
/** The latest invocation's resolved value, or `undefined` before the first success. */
|
|
618
639
|
data: Accessor<ReturnOf<F> | undefined>;
|
|
@@ -1189,7 +1210,7 @@ interface LunoraProviderProps {
|
|
|
1189
1210
|
* itself is resolved per-major by {@link providerOf}.
|
|
1190
1211
|
*/
|
|
1191
1212
|
declare const LunoraProvider: (props: LunoraProviderProps) => SolidElement;
|
|
1192
|
-
export { type ActionClient, type ActionHandle, type AgentChatMessage, type AgentLiveEvent, type AgentProgressEvent, type AgentThreadRecord, type AgentThreadStatus, type AgentTokenDelta, type AgentToolEvent, AuthLoading, Authenticated, type CreateAgentApi, type CreateAgentChatApi, type CreateAgentChatOptions, type CreateAgentChatResult, type CreateAgentOptions, type CreateAgentResult, type CreateAgentStateApi, type CreateAgentStateOptions, type CreateAgentStateResult, type CreateAgentToolEventsApi, type CreateAgentToolEventsOptions, type CreateAgentToolEventsResult, type CreateInfiniteQueryOptions, type CreateInfiniteQueryResult, type CreatePaginatedQueryOptions, type CreatePaginatedQueryResult, type CreatePresenceOptions, type CreatePresenceResult, type CreateQueryOptions, type CreateRateLimitOptions, type CreateRateLimitResult, type CreateStreamOptions, type CreateStreamResult, type CreateStreamStatus, type CreateSubscriptionResult, type CreateVoiceAgentOptions, type CreateVoiceAgentResult, type FlagValue, type HeartbeatReference, type ListPresentReference, LunoraContext, LunoraProvider,
|
|
1213
|
+
export { type ActionClient, type ActionHandle, type AgentChatMessage, type AgentLiveEvent, type AgentProgressEvent, type AgentThreadRecord, type AgentThreadStatus, type AgentTokenDelta, type AgentToolEvent, AuthLoading, Authenticated, type CreateAgentApi, type CreateAgentChatApi, type CreateAgentChatOptions, type CreateAgentChatResult, type CreateAgentOptions, type CreateAgentResult, type CreateAgentStateApi, type CreateAgentStateOptions, type CreateAgentStateResult, type CreateAgentToolEventsApi, type CreateAgentToolEventsOptions, type CreateAgentToolEventsResult, type CreateInfiniteQueryOptions, type CreateInfiniteQueryResult, type CreateLiveTopicResult, type CreatePaginatedQueryOptions, type CreatePaginatedQueryResult, type CreatePresenceOptions, type CreatePresenceResult, type CreateQueryOptions, type CreateRateLimitOptions, type CreateRateLimitResult, type CreateStreamOptions, type CreateStreamResult, type CreateStreamStatus, type CreateSubscriptionResult, type CreateVoiceAgentOptions, type CreateVoiceAgentResult, type FlagValue, type HeartbeatReference, type ListPresentReference, LunoraContext, LunoraProvider,
|
|
1193
1214
|
/**
|
|
1194
1215
|
* SolidJS adapter for Lunora.
|
|
1195
1216
|
*
|
|
@@ -1208,4 +1229,4 @@ export { type ActionClient, type ActionHandle, type AgentChatMessage, type Agent
|
|
|
1208
1229
|
* framework-neutral server contract) — call it from your SolidStart route loader
|
|
1209
1230
|
* and hand the resulting `Preloaded` token to `hydratePreloaded`.
|
|
1210
1231
|
*/
|
|
1211
|
-
type LunoraProviderProps, type MutationClient, type MutationHandle, type MutatorHook, type PageItemOf, type PaginatedArgs, type SolidChildren, Unauthenticated, type UseAuthResult, type VoiceAudioFormat, type VoiceReference, type VoiceStatus, createAction, createActionForClient, createAgent, createAgentChat, createAgentState, createAgentToolEvents, createAuth, createConnectionStatus, createFlag, createFlags, createInfiniteQuery, createMutation, createMutationForClient, createMutator, createPaginatedQuery, createPresence, createQuery, createRateLimit, createStream, createSubscription, createVoiceAgent, hydratePreloaded, useLunora };
|
|
1232
|
+
type LunoraProviderProps, type MutationClient, type MutationHandle, type MutatorHook, type PageItemOf, type PaginatedArgs, type SolidChildren, Unauthenticated, type UseAuthResult, type VoiceAudioFormat, type VoiceReference, type VoiceStatus, createAction, createActionForClient, createAgent, createAgentChat, createAgentState, createAgentToolEvents, createAuth, createConnectionStatus, createFlag, createFlags, createInfiniteQuery, createLiveTopic, createMutation, createMutationForClient, createMutator, createPaginatedQuery, createPresence, createQuery, createRateLimit, createStream, createSubscription, createVoiceAgent, hydratePreloaded, useLunora };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LunoraClient, FunctionReference, ArgsOf, ActionCallOptions, ReturnOf, SubscriptionErrorCallback, User, ConnectionStatus, MutationCallOptions, MutatorHandle, SubscriptionError, Preloaded } from '@lunora/client';
|
|
1
|
+
import { LunoraClient, FunctionReference, ArgsOf, ActionCallOptions, ReturnOf, SubscriptionErrorCallback, User, ConnectionStatus, LiveStreamSubscribeError, SubscribeLiveTopicOptions, MutationCallOptions, MutatorHandle, SubscriptionError, Preloaded } from '@lunora/client';
|
|
2
2
|
export type { ArgsOf, FunctionReference, MutatorHandle, MutatorTransaction, OptimisticUpdate, Preloaded, ReturnOf, SubscriptionError, SubscriptionErrorCallback, Unsubscribe } from '@lunora/client';
|
|
3
3
|
import { Context, Accessor } from 'solid-js';
|
|
4
4
|
import { AuthStatus } from '@lunora/client/auth';
|
|
@@ -613,6 +613,27 @@ declare const createFlag: <T extends FlagValue>(key: MaybeAccessor<string>, defa
|
|
|
613
613
|
* reactive — the subscriptions open on mount and tear down on cleanup.
|
|
614
614
|
*/
|
|
615
615
|
declare const createFlags: <T extends Record<string, FlagValue>>(flags: T) => Accessor<T>;
|
|
616
|
+
/**
|
|
617
|
+
* `createLiveTopic` — follow one live topic on the connection shared by its URL.
|
|
618
|
+
*
|
|
619
|
+
* A thin lifecycle wrapper over `subscribeLiveTopic` from `@lunora/client`: it
|
|
620
|
+
* subscribes when the owner mounts, unsubscribes on cleanup, and resubscribes when
|
|
621
|
+
* the url, topic or connection options change. Callbacks are not part of that
|
|
622
|
+
* identity, so a new `onEvent` / `onError` never reopens the subscription.
|
|
623
|
+
*/
|
|
624
|
+
interface CreateLiveTopicResult {
|
|
625
|
+
/** The shard's refusal of this subscription (403, 409, 429 and similar), or `undefined`. */
|
|
626
|
+
error: Accessor<LiveStreamSubscribeError | undefined>;
|
|
627
|
+
/** The last payload delivered on the topic, or `undefined` until the first event. */
|
|
628
|
+
lastEvent: Accessor<unknown>;
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Follow `options.topic` on the shared live connection for `options.url`.
|
|
632
|
+
*
|
|
633
|
+
* `options` may be a plain object or an accessor. The `onEvent` and `onError`
|
|
634
|
+
* callbacks are read at call time, so the latest identity is always the one invoked.
|
|
635
|
+
*/
|
|
636
|
+
declare const createLiveTopic: (options: SubscribeLiveTopicOptions | Accessor<SubscribeLiveTopicOptions>) => CreateLiveTopicResult;
|
|
616
637
|
interface MutationHandle<F extends FunctionReference> {
|
|
617
638
|
/** The latest invocation's resolved value, or `undefined` before the first success. */
|
|
618
639
|
data: Accessor<ReturnOf<F> | undefined>;
|
|
@@ -1189,7 +1210,7 @@ interface LunoraProviderProps {
|
|
|
1189
1210
|
* itself is resolved per-major by {@link providerOf}.
|
|
1190
1211
|
*/
|
|
1191
1212
|
declare const LunoraProvider: (props: LunoraProviderProps) => SolidElement;
|
|
1192
|
-
export { type ActionClient, type ActionHandle, type AgentChatMessage, type AgentLiveEvent, type AgentProgressEvent, type AgentThreadRecord, type AgentThreadStatus, type AgentTokenDelta, type AgentToolEvent, AuthLoading, Authenticated, type CreateAgentApi, type CreateAgentChatApi, type CreateAgentChatOptions, type CreateAgentChatResult, type CreateAgentOptions, type CreateAgentResult, type CreateAgentStateApi, type CreateAgentStateOptions, type CreateAgentStateResult, type CreateAgentToolEventsApi, type CreateAgentToolEventsOptions, type CreateAgentToolEventsResult, type CreateInfiniteQueryOptions, type CreateInfiniteQueryResult, type CreatePaginatedQueryOptions, type CreatePaginatedQueryResult, type CreatePresenceOptions, type CreatePresenceResult, type CreateQueryOptions, type CreateRateLimitOptions, type CreateRateLimitResult, type CreateStreamOptions, type CreateStreamResult, type CreateStreamStatus, type CreateSubscriptionResult, type CreateVoiceAgentOptions, type CreateVoiceAgentResult, type FlagValue, type HeartbeatReference, type ListPresentReference, LunoraContext, LunoraProvider,
|
|
1213
|
+
export { type ActionClient, type ActionHandle, type AgentChatMessage, type AgentLiveEvent, type AgentProgressEvent, type AgentThreadRecord, type AgentThreadStatus, type AgentTokenDelta, type AgentToolEvent, AuthLoading, Authenticated, type CreateAgentApi, type CreateAgentChatApi, type CreateAgentChatOptions, type CreateAgentChatResult, type CreateAgentOptions, type CreateAgentResult, type CreateAgentStateApi, type CreateAgentStateOptions, type CreateAgentStateResult, type CreateAgentToolEventsApi, type CreateAgentToolEventsOptions, type CreateAgentToolEventsResult, type CreateInfiniteQueryOptions, type CreateInfiniteQueryResult, type CreateLiveTopicResult, type CreatePaginatedQueryOptions, type CreatePaginatedQueryResult, type CreatePresenceOptions, type CreatePresenceResult, type CreateQueryOptions, type CreateRateLimitOptions, type CreateRateLimitResult, type CreateStreamOptions, type CreateStreamResult, type CreateStreamStatus, type CreateSubscriptionResult, type CreateVoiceAgentOptions, type CreateVoiceAgentResult, type FlagValue, type HeartbeatReference, type ListPresentReference, LunoraContext, LunoraProvider,
|
|
1193
1214
|
/**
|
|
1194
1215
|
* SolidJS adapter for Lunora.
|
|
1195
1216
|
*
|
|
@@ -1208,4 +1229,4 @@ export { type ActionClient, type ActionHandle, type AgentChatMessage, type Agent
|
|
|
1208
1229
|
* framework-neutral server contract) — call it from your SolidStart route loader
|
|
1209
1230
|
* and hand the resulting `Preloaded` token to `hydratePreloaded`.
|
|
1210
1231
|
*/
|
|
1211
|
-
type LunoraProviderProps, type MutationClient, type MutationHandle, type MutatorHook, type PageItemOf, type PaginatedArgs, type SolidChildren, Unauthenticated, type UseAuthResult, type VoiceAudioFormat, type VoiceReference, type VoiceStatus, createAction, createActionForClient, createAgent, createAgentChat, createAgentState, createAgentToolEvents, createAuth, createConnectionStatus, createFlag, createFlags, createInfiniteQuery, createMutation, createMutationForClient, createMutator, createPaginatedQuery, createPresence, createQuery, createRateLimit, createStream, createSubscription, createVoiceAgent, hydratePreloaded, useLunora };
|
|
1232
|
+
type LunoraProviderProps, type MutationClient, type MutationHandle, type MutatorHook, type PageItemOf, type PaginatedArgs, type SolidChildren, Unauthenticated, type UseAuthResult, type VoiceAudioFormat, type VoiceReference, type VoiceStatus, createAction, createActionForClient, createAgent, createAgentChat, createAgentState, createAgentToolEvents, createAuth, createConnectionStatus, createFlag, createFlags, createInfiniteQuery, createLiveTopic, createMutation, createMutationForClient, createMutator, createPaginatedQuery, createPresence, createQuery, createRateLimit, createStream, createSubscription, createVoiceAgent, hydratePreloaded, useLunora };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{LunoraContext as r,useLunora as o}from"./packem_shared/LunoraContext-BWsj_3CK.mjs";import{createAction as c,createActionForClient as n}from"./packem_shared/createAction-BZkayM2R.mjs";import{createAgent as m}from"./packem_shared/createAgent-BN_C_ztD.mjs";import{createAgentChat as x}from"./packem_shared/createAgentChat-BWtnorVh.mjs";import{createAgentState as u}from"./packem_shared/createAgentState-Cl09r0tX.mjs";import{createAgentToolEvents as A}from"./packem_shared/createAgentToolEvents-on8XD92W.mjs";import{AuthLoading as l,Authenticated as s,Unauthenticated as h,createAuth as
|
|
1
|
+
import{LunoraContext as r,useLunora as o}from"./packem_shared/LunoraContext-BWsj_3CK.mjs";import{createAction as c,createActionForClient as n}from"./packem_shared/createAction-BZkayM2R.mjs";import{createAgent as m}from"./packem_shared/createAgent-BN_C_ztD.mjs";import{createAgentChat as x}from"./packem_shared/createAgentChat-BWtnorVh.mjs";import{createAgentState as u}from"./packem_shared/createAgentState-Cl09r0tX.mjs";import{createAgentToolEvents as A}from"./packem_shared/createAgentToolEvents-on8XD92W.mjs";import{AuthLoading as l,Authenticated as s,Unauthenticated as h,createAuth as L}from"./packem_shared/AuthLoading-DjUnIaP5.mjs";import{default as y}from"./packem_shared/createConnectionStatus-D8bC05Jn.mjs";import{createFlag as P,createFlags as S}from"./packem_shared/createFlag-Bww9WQUu.mjs";import{createLiveTopic as M}from"./packem_shared/createLiveTopic-EjgSMydg.mjs";import{createMutation as T,createMutationForClient as b}from"./packem_shared/createMutation-DM2mXpq3.mjs";import{createMutator as I}from"./packem_shared/createMutator-q9cMjGKv.mjs";import{createInfiniteQuery as U,createPaginatedQuery as V}from"./packem_shared/createInfiniteQuery-CwGPFeuc.mjs";import{createPresence as k}from"./packem_shared/createPresence-DkTotieP.mjs";import{createQuery as w}from"./packem_shared/createQuery-oNQqVGjE.mjs";import{createRateLimit as B}from"./packem_shared/createRateLimit-CIVWrD5H.mjs";import{createStream as G}from"./packem_shared/createStream-CCAOb9q1.mjs";import{createSubscription as J}from"./packem_shared/createSubscription-DiyhxkoK.mjs";import{createVoiceAgent as N}from"./packem_shared/createVoiceAgent-BtRfW4lS.mjs";import{default as W}from"./packem_shared/hydratePreloaded-DCi296oW.mjs";import{LunoraProvider as Y}from"./packem_shared/LunoraProvider-DMhpuxvx.mjs";export{l as AuthLoading,s as Authenticated,r as LunoraContext,Y as LunoraProvider,h as Unauthenticated,c as createAction,n as createActionForClient,m as createAgent,x as createAgentChat,u as createAgentState,A as createAgentToolEvents,L as createAuth,y as createConnectionStatus,P as createFlag,S as createFlags,U as createInfiniteQuery,M as createLiveTopic,T as createMutation,b as createMutationForClient,I as createMutator,V as createPaginatedQuery,k as createPresence,w as createQuery,B as createRateLimit,G as createStream,J as createSubscription,N as createVoiceAgent,W as hydratePreloaded,o as useLunora};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{subscribeLiveTopic as v}from"@lunora/client";import{createSignal as s}from"solid-js";import{t as d}from"./reactive-args-qKMBsFpd.mjs";const l=e=>({headers:e.headers,maxDelayMs:e.maxDelayMs,retryDelay:e.retryDelay,sessionKey:e.sessionKey,topic:e.topic,url:e.url,withCredentials:e.withCredentials}),f=e=>{const t=typeof e=="function"?e:()=>e,[c,n]=s(void 0),[i,o]=s(void 0);return d(()=>l(t()),a=>(n(()=>{}),o(()=>{}),v({...a,onError:r=>{o(()=>r),t().onError?.(r)},onEvent:r=>{n(()=>r),o(()=>{}),t().onEvent?.(r)}}))),{error:i,lastEvent:c}};export{f as createLiveTopic};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/solid",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.237",
|
|
4
4
|
"description": "SolidJS adapter for Lunora — live queries, 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
|
},
|