@lunora/react 1.0.0-alpha.252 → 1.0.0-alpha.254
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts
CHANGED
|
@@ -475,6 +475,54 @@ interface UseAgentResult {
|
|
|
475
475
|
* beyond the `agents:*` surface.
|
|
476
476
|
*/
|
|
477
477
|
declare const useAgent: (options: UseAgentOptions) => UseAgentResult;
|
|
478
|
+
/**
|
|
479
|
+
* One human-in-the-loop approval a run is paused on, on a thread the caller
|
|
480
|
+
* owns. Carries the triple `agents.agentResolveApproval` takes, so a UI can
|
|
481
|
+
* approve or reject straight from the list.
|
|
482
|
+
*/
|
|
483
|
+
interface PendingApproval {
|
|
484
|
+
agent: string;
|
|
485
|
+
content: string;
|
|
486
|
+
instanceId: string;
|
|
487
|
+
requestedAt: number;
|
|
488
|
+
threadKey: string;
|
|
489
|
+
threadTitle?: string;
|
|
490
|
+
threadUpdatedAt: number;
|
|
491
|
+
toolCallId: string;
|
|
492
|
+
toolName?: string;
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* The `agents.agentPendingApprovals` reference the hook subscribes to. A
|
|
496
|
+
* structural subset of the generated `api.agents` surface, so the whole
|
|
497
|
+
* generated `api` object is assignable. Typed as a loose record for the same
|
|
498
|
+
* reason `useAgentState` is: codegen cannot see the runtime row shape, so the
|
|
499
|
+
* hook casts to {@link PendingApproval}.
|
|
500
|
+
*/
|
|
501
|
+
interface UseAgentApprovalsApi {
|
|
502
|
+
agents: {
|
|
503
|
+
agentPendingApprovals: FunctionReference<"query", {
|
|
504
|
+
limit?: number;
|
|
505
|
+
}, Record<string, unknown>[]>;
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
interface UseAgentApprovalsOptions {
|
|
509
|
+
/** The generated `api` — its `agents.agentPendingApprovals` query drives the inbox. */
|
|
510
|
+
api: UseAgentApprovalsApi;
|
|
511
|
+
}
|
|
512
|
+
interface UseAgentApprovalsResult {
|
|
513
|
+
/** The caller's pending approvals, newest thread first; `undefined` before the first frame. */
|
|
514
|
+
approvals: PendingApproval[] | undefined;
|
|
515
|
+
/** The subscription error, if the live channel reported one. */
|
|
516
|
+
error: Error | undefined;
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Subscribe to the caller's approvals inbox: every run of theirs currently
|
|
520
|
+
* paused on a gated tool. A thin wrapper over
|
|
521
|
+
* `useSubscription(api.agents.agentPendingApprovals, {})` — the server pushes a
|
|
522
|
+
* fresh list whenever a pause starts or is resolved. Anonymous callers receive
|
|
523
|
+
* an empty list.
|
|
524
|
+
*/
|
|
525
|
+
declare const useAgentApprovals: (options: UseAgentApprovalsOptions) => UseAgentApprovalsResult;
|
|
478
526
|
/**
|
|
479
527
|
* One persisted (or optimistic) thread message, as `agents:agentMessages`
|
|
480
528
|
* surfaces it. Client-safe mirror of `@lunora/agent`'s `AgentMessageRow` —
|
|
@@ -1525,4 +1573,4 @@ interface UseVoiceAgentResult {
|
|
|
1525
1573
|
* `createSocket`) so the hook is drivable outside a browser.
|
|
1526
1574
|
*/
|
|
1527
1575
|
declare const useVoiceAgent: (options: UseVoiceAgentOptions) => UseVoiceAgentResult;
|
|
1528
|
-
export { type ActionHook, type AdminAuthListResult, type AgentApprovalGrant, type AgentChatMessage, type AgentLiveEvent, type AgentProgressEvent, type AgentThreadRecord, type AgentThreadStatus, type AgentTokenDelta, type AgentToolEvent, AuthLoading, type AuthState, Authenticated, type FlagValue, type HeartbeatReference, type ListPresentReference, LunoraProvider, type LunoraProviderProps, type MutationHook, type MutatorHook, type PageItemOf, type PaginatedArgs, Unauthenticated, type UseAgentApi, type UseAgentChatApi, type UseAgentChatOptions, type UseAgentChatResult, type UseAgentOptions, type UseAgentResult, type UseAgentStateApi, type UseAgentStateOptions, type UseAgentStateResult, type UseAgentToolEventsApi, type UseAgentToolEventsOptions, type UseAgentToolEventsResult, type UseAuthResult, type UseAuthSessionsOptions, type UseAuthUsersOptions, type UseHttpStreamOptions, type UseHttpStreamResult, type UseImpersonateResult, type UseInfiniteQueryOptions, type UseInfiniteQueryResult, type UseLiveTopicOptions, type UseLiveTopicResult, type UseMutationCallOptions, type UseOrganizationsOptions, type UsePaginatedQueryOptions, type UsePaginatedQueryResult, type UsePresenceOptions, type UsePresenceResult, type UseQueryOptions, type UseRateLimitOptions, type UseRateLimitResult, type UseSignUpInvitationsOptions, type UseStreamOptions, type UseStreamResult, type UseStreamStatus, type UseSubscriptionResult, type UseVoiceAgentOptions, type UseVoiceAgentResult, type VoiceAudioFormat, type VoiceReference, type VoiceStatus, hydratePreloaded, useAction, useAgent, useAgentChat, useAgentState, useAgentToolEvents, useAuth, useAuthSessions, useAuthState, useAuthUsers, useClientQuery, useConnectionStatus, useFlag, useFlags, useHttpStream, useImpersonate, useInfiniteQuery, useLiveTopic, useLunora, useMutation, useMutator, useOrganizations, usePaginatedQuery, usePreloadedQuery, usePresence, useQuery, useRateLimit, useSignUpInvitations, useStream, useSubscription, useSuspenseQuery, useVoiceAgent };
|
|
1576
|
+
export { type ActionHook, type AdminAuthListResult, type AgentApprovalGrant, type AgentChatMessage, type AgentLiveEvent, type AgentProgressEvent, type AgentThreadRecord, type AgentThreadStatus, type AgentTokenDelta, type AgentToolEvent, AuthLoading, type AuthState, Authenticated, type FlagValue, type HeartbeatReference, type ListPresentReference, LunoraProvider, type LunoraProviderProps, type MutationHook, type MutatorHook, type PageItemOf, type PaginatedArgs, type PendingApproval, Unauthenticated, type UseAgentApi, type UseAgentApprovalsApi, type UseAgentApprovalsOptions, type UseAgentApprovalsResult, type UseAgentChatApi, type UseAgentChatOptions, type UseAgentChatResult, type UseAgentOptions, type UseAgentResult, type UseAgentStateApi, type UseAgentStateOptions, type UseAgentStateResult, type UseAgentToolEventsApi, type UseAgentToolEventsOptions, type UseAgentToolEventsResult, type UseAuthResult, type UseAuthSessionsOptions, type UseAuthUsersOptions, type UseHttpStreamOptions, type UseHttpStreamResult, type UseImpersonateResult, type UseInfiniteQueryOptions, type UseInfiniteQueryResult, type UseLiveTopicOptions, type UseLiveTopicResult, type UseMutationCallOptions, type UseOrganizationsOptions, type UsePaginatedQueryOptions, type UsePaginatedQueryResult, type UsePresenceOptions, type UsePresenceResult, type UseQueryOptions, type UseRateLimitOptions, type UseRateLimitResult, type UseSignUpInvitationsOptions, type UseStreamOptions, type UseStreamResult, type UseStreamStatus, type UseSubscriptionResult, type UseVoiceAgentOptions, type UseVoiceAgentResult, type VoiceAudioFormat, type VoiceReference, type VoiceStatus, hydratePreloaded, useAction, useAgent, useAgentApprovals, useAgentChat, useAgentState, useAgentToolEvents, useAuth, useAuthSessions, useAuthState, useAuthUsers, useClientQuery, useConnectionStatus, useFlag, useFlags, useHttpStream, useImpersonate, useInfiniteQuery, useLiveTopic, useLunora, useMutation, useMutator, useOrganizations, usePaginatedQuery, usePreloadedQuery, usePresence, useQuery, useRateLimit, useSignUpInvitations, useStream, useSubscription, useSuspenseQuery, useVoiceAgent };
|
package/dist/index.d.ts
CHANGED
|
@@ -475,6 +475,54 @@ interface UseAgentResult {
|
|
|
475
475
|
* beyond the `agents:*` surface.
|
|
476
476
|
*/
|
|
477
477
|
declare const useAgent: (options: UseAgentOptions) => UseAgentResult;
|
|
478
|
+
/**
|
|
479
|
+
* One human-in-the-loop approval a run is paused on, on a thread the caller
|
|
480
|
+
* owns. Carries the triple `agents.agentResolveApproval` takes, so a UI can
|
|
481
|
+
* approve or reject straight from the list.
|
|
482
|
+
*/
|
|
483
|
+
interface PendingApproval {
|
|
484
|
+
agent: string;
|
|
485
|
+
content: string;
|
|
486
|
+
instanceId: string;
|
|
487
|
+
requestedAt: number;
|
|
488
|
+
threadKey: string;
|
|
489
|
+
threadTitle?: string;
|
|
490
|
+
threadUpdatedAt: number;
|
|
491
|
+
toolCallId: string;
|
|
492
|
+
toolName?: string;
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* The `agents.agentPendingApprovals` reference the hook subscribes to. A
|
|
496
|
+
* structural subset of the generated `api.agents` surface, so the whole
|
|
497
|
+
* generated `api` object is assignable. Typed as a loose record for the same
|
|
498
|
+
* reason `useAgentState` is: codegen cannot see the runtime row shape, so the
|
|
499
|
+
* hook casts to {@link PendingApproval}.
|
|
500
|
+
*/
|
|
501
|
+
interface UseAgentApprovalsApi {
|
|
502
|
+
agents: {
|
|
503
|
+
agentPendingApprovals: FunctionReference<"query", {
|
|
504
|
+
limit?: number;
|
|
505
|
+
}, Record<string, unknown>[]>;
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
interface UseAgentApprovalsOptions {
|
|
509
|
+
/** The generated `api` — its `agents.agentPendingApprovals` query drives the inbox. */
|
|
510
|
+
api: UseAgentApprovalsApi;
|
|
511
|
+
}
|
|
512
|
+
interface UseAgentApprovalsResult {
|
|
513
|
+
/** The caller's pending approvals, newest thread first; `undefined` before the first frame. */
|
|
514
|
+
approvals: PendingApproval[] | undefined;
|
|
515
|
+
/** The subscription error, if the live channel reported one. */
|
|
516
|
+
error: Error | undefined;
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Subscribe to the caller's approvals inbox: every run of theirs currently
|
|
520
|
+
* paused on a gated tool. A thin wrapper over
|
|
521
|
+
* `useSubscription(api.agents.agentPendingApprovals, {})` — the server pushes a
|
|
522
|
+
* fresh list whenever a pause starts or is resolved. Anonymous callers receive
|
|
523
|
+
* an empty list.
|
|
524
|
+
*/
|
|
525
|
+
declare const useAgentApprovals: (options: UseAgentApprovalsOptions) => UseAgentApprovalsResult;
|
|
478
526
|
/**
|
|
479
527
|
* One persisted (or optimistic) thread message, as `agents:agentMessages`
|
|
480
528
|
* surfaces it. Client-safe mirror of `@lunora/agent`'s `AgentMessageRow` —
|
|
@@ -1525,4 +1573,4 @@ interface UseVoiceAgentResult {
|
|
|
1525
1573
|
* `createSocket`) so the hook is drivable outside a browser.
|
|
1526
1574
|
*/
|
|
1527
1575
|
declare const useVoiceAgent: (options: UseVoiceAgentOptions) => UseVoiceAgentResult;
|
|
1528
|
-
export { type ActionHook, type AdminAuthListResult, type AgentApprovalGrant, type AgentChatMessage, type AgentLiveEvent, type AgentProgressEvent, type AgentThreadRecord, type AgentThreadStatus, type AgentTokenDelta, type AgentToolEvent, AuthLoading, type AuthState, Authenticated, type FlagValue, type HeartbeatReference, type ListPresentReference, LunoraProvider, type LunoraProviderProps, type MutationHook, type MutatorHook, type PageItemOf, type PaginatedArgs, Unauthenticated, type UseAgentApi, type UseAgentChatApi, type UseAgentChatOptions, type UseAgentChatResult, type UseAgentOptions, type UseAgentResult, type UseAgentStateApi, type UseAgentStateOptions, type UseAgentStateResult, type UseAgentToolEventsApi, type UseAgentToolEventsOptions, type UseAgentToolEventsResult, type UseAuthResult, type UseAuthSessionsOptions, type UseAuthUsersOptions, type UseHttpStreamOptions, type UseHttpStreamResult, type UseImpersonateResult, type UseInfiniteQueryOptions, type UseInfiniteQueryResult, type UseLiveTopicOptions, type UseLiveTopicResult, type UseMutationCallOptions, type UseOrganizationsOptions, type UsePaginatedQueryOptions, type UsePaginatedQueryResult, type UsePresenceOptions, type UsePresenceResult, type UseQueryOptions, type UseRateLimitOptions, type UseRateLimitResult, type UseSignUpInvitationsOptions, type UseStreamOptions, type UseStreamResult, type UseStreamStatus, type UseSubscriptionResult, type UseVoiceAgentOptions, type UseVoiceAgentResult, type VoiceAudioFormat, type VoiceReference, type VoiceStatus, hydratePreloaded, useAction, useAgent, useAgentChat, useAgentState, useAgentToolEvents, useAuth, useAuthSessions, useAuthState, useAuthUsers, useClientQuery, useConnectionStatus, useFlag, useFlags, useHttpStream, useImpersonate, useInfiniteQuery, useLiveTopic, useLunora, useMutation, useMutator, useOrganizations, usePaginatedQuery, usePreloadedQuery, usePresence, useQuery, useRateLimit, useSignUpInvitations, useStream, useSubscription, useSuspenseQuery, useVoiceAgent };
|
|
1576
|
+
export { type ActionHook, type AdminAuthListResult, type AgentApprovalGrant, type AgentChatMessage, type AgentLiveEvent, type AgentProgressEvent, type AgentThreadRecord, type AgentThreadStatus, type AgentTokenDelta, type AgentToolEvent, AuthLoading, type AuthState, Authenticated, type FlagValue, type HeartbeatReference, type ListPresentReference, LunoraProvider, type LunoraProviderProps, type MutationHook, type MutatorHook, type PageItemOf, type PaginatedArgs, type PendingApproval, Unauthenticated, type UseAgentApi, type UseAgentApprovalsApi, type UseAgentApprovalsOptions, type UseAgentApprovalsResult, type UseAgentChatApi, type UseAgentChatOptions, type UseAgentChatResult, type UseAgentOptions, type UseAgentResult, type UseAgentStateApi, type UseAgentStateOptions, type UseAgentStateResult, type UseAgentToolEventsApi, type UseAgentToolEventsOptions, type UseAgentToolEventsResult, type UseAuthResult, type UseAuthSessionsOptions, type UseAuthUsersOptions, type UseHttpStreamOptions, type UseHttpStreamResult, type UseImpersonateResult, type UseInfiniteQueryOptions, type UseInfiniteQueryResult, type UseLiveTopicOptions, type UseLiveTopicResult, type UseMutationCallOptions, type UseOrganizationsOptions, type UsePaginatedQueryOptions, type UsePaginatedQueryResult, type UsePresenceOptions, type UsePresenceResult, type UseQueryOptions, type UseRateLimitOptions, type UseRateLimitResult, type UseSignUpInvitationsOptions, type UseStreamOptions, type UseStreamResult, type UseStreamStatus, type UseSubscriptionResult, type UseVoiceAgentOptions, type UseVoiceAgentResult, type VoiceAudioFormat, type VoiceReference, type VoiceStatus, hydratePreloaded, useAction, useAgent, useAgentApprovals, useAgentChat, useAgentState, useAgentToolEvents, useAuth, useAuthSessions, useAuthState, useAuthUsers, useClientQuery, useConnectionStatus, useFlag, useFlags, useHttpStream, useImpersonate, useInfiniteQuery, useLiveTopic, useLunora, useMutation, useMutator, useOrganizations, usePaginatedQuery, usePreloadedQuery, usePresence, useQuery, useRateLimit, useSignUpInvitations, useStream, useSubscription, useSuspenseQuery, useVoiceAgent };
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import{AuthLoading as o,Authenticated as t,Unauthenticated as u}from"./packem_shared/AuthLoading-024-XH0I.mjs";import{useAuthState as a}from"./packem_shared/useAuthState-CqN1F2FM.mjs";import{L as f,u as n}from"./packem_shared/lunora-provider-_WqSuvf9.mjs";import{lunoraQueryOptions as m}from"./packem_shared/lunoraQueryOptions-IJB_aFzi.mjs";import{useAction as
|
|
2
|
+
import{AuthLoading as o,Authenticated as t,Unauthenticated as u}from"./packem_shared/AuthLoading-024-XH0I.mjs";import{useAuthState as a}from"./packem_shared/useAuthState-CqN1F2FM.mjs";import{L as f,u as n}from"./packem_shared/lunora-provider-_WqSuvf9.mjs";import{lunoraQueryOptions as m}from"./packem_shared/lunoraQueryOptions-IJB_aFzi.mjs";import{useAction as d}from"./packem_shared/useAction-jJl4KPEw.mjs";import{useAuthSessions as A,useAuthUsers as g,useImpersonate as c,useOrganizations as h,useSignUpInvitations as U}from"./packem_shared/useAuthSessions-jJWdw8Zw.mjs";import{useAgent as S}from"./packem_shared/useAgent-CO523Dot.mjs";import{useAgentApprovals as E}from"./packem_shared/useAgentApprovals-D3AHE0j0.mjs";import{useAgentChat as L}from"./packem_shared/useAgentChat-51qFVjQW.mjs";import{useAgentState as v}from"./packem_shared/useAgentState-CwsVpvmD.mjs";import{useAgentToolEvents as F}from"./packem_shared/useAgentToolEvents-YQl2HgR6.mjs";import{default as M}from"./packem_shared/useAuth-CpGKVRsv.mjs";import{default as b}from"./packem_shared/useClientQuery-DUEUAqPh.mjs";import{default as O}from"./packem_shared/useConnectionStatus-Dtx_OWez.mjs";import{useFlag as H,useFlags as V}from"./packem_shared/useFlag-A7XPHExt.mjs";import{useHttpStream as q}from"./packem_shared/useHttpStream-CzryjxVH.mjs";import{default as B}from"./packem_shared/useInfiniteQuery-D_AG59dX.mjs";import{useLiveTopic as G}from"./packem_shared/useLiveTopic-UYAE2s4R.mjs";import{useMutation as K}from"./packem_shared/useMutation-29nXea_s.mjs";import{useMutator as W}from"./packem_shared/useMutator-BtUd-xEA.mjs";import{usePaginatedQuery as Y}from"./packem_shared/usePaginatedQuery-DhQAsxgX.mjs";import{hydratePreloaded as _,default as $}from"./packem_shared/hydratePreloaded-qs8nspKB.mjs";import{usePresence as re}from"./packem_shared/usePresence-X5Ax04Cf.mjs";import{default as te}from"./packem_shared/useQuery-Cek_oF7t.mjs";import{useRateLimit as se}from"./packem_shared/useRateLimit-Cckxi8m9.mjs";import{useStream as pe}from"./packem_shared/useStream-D8GB__4j.mjs";import{default as ne}from"./packem_shared/useSubscription-D9QkGhO3.mjs";import{default as me}from"./packem_shared/useSuspenseQuery-CZTk7Kch.mjs";import{useVoiceAgent as de}from"./packem_shared/useVoiceAgent-ixfjauAR.mjs";import{createClientQuery as Ae,getErrorCode as ge,getRetryAfterMs as ce,isConflictError as he,isForbiddenError as Ue,isRateLimitedError as ye,isUnauthorizedError as Se}from"@lunora/client";import{RestrictionError as Ee,UploadControl as Qe,UploadError as Le}from"@visulima/storage-client";import{useChunkedRestUpload as ve,useFileInput as Re,useMultipartUpload as Fe,usePasteUpload as Ie,useTusUpload as Me,useUpload as Te}from"@visulima/storage-client/react";export{o as AuthLoading,t as Authenticated,f as LunoraProvider,Ee as RestrictionError,u as Unauthenticated,Qe as UploadControl,Le as UploadError,Ae as createClientQuery,ge as getErrorCode,ce as getRetryAfterMs,_ as hydratePreloaded,he as isConflictError,Ue as isForbiddenError,ye as isRateLimitedError,Se as isUnauthorizedError,m as lunoraQueryOptions,d as useAction,S as useAgent,E as useAgentApprovals,L as useAgentChat,v as useAgentState,F as useAgentToolEvents,M as useAuth,A as useAuthSessions,a as useAuthState,g as useAuthUsers,ve as useChunkedRestUpload,b as useClientQuery,O as useConnectionStatus,Re as useFileInput,H as useFlag,V as useFlags,q as useHttpStream,c as useImpersonate,B as useInfiniteQuery,G as useLiveTopic,n as useLunora,Fe as useMultipartUpload,K as useMutation,W as useMutator,h as useOrganizations,Y as usePaginatedQuery,Ie as usePasteUpload,$ as usePreloadedQuery,re as usePresence,te as useQuery,se as useRateLimit,U as useSignUpInvitations,pe as useStream,ne as useSubscription,me as useSuspenseQuery,Me as useTusUpload,Te as useUpload,de as useVoiceAgent};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import{c as p}from"react/compiler-runtime";import c from"./useSubscription-D9QkGhO3.mjs";const m=n=>{const e=p(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={},e[0]=t):t=e[0];const{data:a,error:r}=c(n.api.agents.agentPendingApprovals,t),s=a;let o;return e[1]!==r||e[2]!==s?(o={approvals:s,error:r},e[1]=r,e[2]=s,e[3]=o):o=e[3],o};export{m as useAgentApprovals};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/react",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.254",
|
|
4
4
|
"description": "React hooks for Lunora: useQuery, useMutation, useSubscription, and useAuth",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@lunora/client": "1.0.0-alpha.
|
|
60
|
+
"@lunora/client": "1.0.0-alpha.241",
|
|
61
61
|
"@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
|
|
62
|
-
"@lunora/ratelimit": "1.0.0-alpha.
|
|
62
|
+
"@lunora/ratelimit": "1.0.0-alpha.161",
|
|
63
63
|
"@lunora/wire": "1.0.0-alpha.2",
|
|
64
64
|
"@visulima/storage-client": "1.0.9"
|
|
65
65
|
},
|