@lunora/vue 1.0.0-alpha.50 → 1.0.0-alpha.52
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.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AuthLoading as o,Authenticated as t,Unauthenticated as u}from"./packem_shared/AuthLoading-CST_mkXL.mjs";import{hydratePreloaded as a}from"./packem_shared/hydratePreloaded-D8EcBXmG.mjs";import{LUNORA_INJECTION_KEY as f,createLunora as m,provideLunora as p,useLunora as x}from"./packem_shared/LUNORA_INJECTION_KEY-CswQb5zb.mjs";import{useAgent as d}from"./packem_shared/useAgent-DyWC-Sm8.mjs";import{useAgentChat as A}from"./packem_shared/useAgentChat-
|
|
1
|
+
import{AuthLoading as o,Authenticated as t,Unauthenticated as u}from"./packem_shared/AuthLoading-CST_mkXL.mjs";import{hydratePreloaded as a}from"./packem_shared/hydratePreloaded-D8EcBXmG.mjs";import{LUNORA_INJECTION_KEY as f,createLunora as m,provideLunora as p,useLunora as x}from"./packem_shared/LUNORA_INJECTION_KEY-CswQb5zb.mjs";import{useAgent as d}from"./packem_shared/useAgent-DyWC-Sm8.mjs";import{useAgentChat as A}from"./packem_shared/useAgentChat-CIpcfLnG.mjs";import{useAgentState as h}from"./packem_shared/useAgentState-CUHDV3h7.mjs";import{useAgentToolEvents as l}from"./packem_shared/useAgentToolEvents-DvcPNShc.mjs";import{useAuth as Q}from"./packem_shared/useAuth-DwDFjvto.mjs";import{default as b}from"./packem_shared/useConnectionStatus-BwLyL_L_.mjs";import{useFlag as E,useFlags as I}from"./packem_shared/useFlag-Bxoq8mH9.mjs";import{useMutation as P}from"./packem_shared/useMutation-MdgW9pRE.mjs";import{useMutator as v}from"./packem_shared/useMutator-DRVDOhcj.mjs";import{useInfiniteQuery as M,usePaginatedQuery as O}from"./packem_shared/useInfiniteQuery-Czncoie-.mjs";import{usePresence as U}from"./packem_shared/usePresence-AiurcGAB.mjs";import{subscribeToQuery as J,useQuery as K}from"./packem_shared/subscribeToQuery-CGvPMz37.mjs";import{useRateLimit as Y}from"./packem_shared/useRateLimit-z8EUFuYJ.mjs";import{useStream as k}from"./packem_shared/useStream-CYkKEcDf.mjs";import{useSubscription as w}from"./packem_shared/useSubscription-D4Ap-tJr.mjs";import{useVoiceAgent as B}from"./packem_shared/useVoiceAgent-Ba0SIP06.mjs";export{o as AuthLoading,t as Authenticated,f as LUNORA_INJECTION_KEY,u as Unauthenticated,m as createLunora,a as hydratePreloaded,p as provideLunora,J as subscribeToQuery,d as useAgent,A as useAgentChat,h as useAgentState,l as useAgentToolEvents,Q as useAuth,b as useConnectionStatus,E as useFlag,I as useFlags,M as useInfiniteQuery,x as useLunora,P as useMutation,v as useMutator,O as usePaginatedQuery,U as usePresence,K as useQuery,Y as useRateLimit,k as useStream,w as useSubscription,B as useVoiceAgent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{reconcileOptimistic as y,maxSeq as I}from"@lunora/client";import{ref as b,computed as s,toValue as o}from"vue";import{NO_MUTATION_REF as R}from"./useAgent-DyWC-Sm8.mjs";import{useMutation as m}from"./useMutation-MdgW9pRE.mjs";import{useStream as D}from"./useStream-CYkKEcDf.mjs";import{useSubscription as w}from"./useSubscription-D4Ap-tJr.mjs";const N={__lunoraRef:""},G=A=>{const{api:u,cancel:v,limit:p,send:k,sendArgs:x,stream:h,threadKey:n}=A,{data:C}=w(u.agents.agentMessages,()=>{const e=o(n);return p===void 0?{key:e}:{key:e,limit:p}}),{data:K}=w(u.agents.agentThread,()=>({key:o(n)})),S=h===void 0?"skip":()=>({key:o(n)}),{chunks:T}=D(h??N,S),j=m(k),q=m(v??R),g=m(u.agents.agentResolveApproval),r=b([]);let f=0;const i=s(()=>K.value),E=s(()=>i.value?.status),c=s(()=>C.value??[]),M=s(()=>{const e=c.value,a=y(r.value,e);if(a.length===0)return e;const t=I(e);return[...e,...a.map((l,d)=>({content:l.content,optimistic:!0,role:"user",seq:t+1+d}))]}),O=s(()=>{const e=o(n),a=c.value.filter(t=>t.role==="assistant").length;return T.value.filter(t=>t.kind!=="progress"&&t.threadKey===e&&t.turn>=a).map(t=>t.text).join("")});return{approve:async(e,a)=>{const t=i.value?.instanceId;if(t===void 0)throw new Error("useAgentChat: cannot approve — no in-flight run (thread has no instanceId)");await g.mutate({decision:"approve",instanceId:t,threadKey:o(n),toolCallId:e,...a===void 0?{}:{note:a}})},cancel:async()=>{const e=i.value?.instanceId;v===void 0||e===void 0||await q.mutate({instanceId:e,threadKey:o(n)})},messages:M,reject:async(e,a)=>{const t=i.value?.instanceId;if(t===void 0)throw new Error("useAgentChat: cannot reject — no in-flight run (thread has no instanceId)");await g.mutate({decision:"reject",instanceId:t,threadKey:o(n),toolCallId:e,...a===void 0?{}:{note:a}})},send:async(e,a)=>{const t=f;f+=1;const l=I(c.value);r.value=[...y(r.value,c.value),{content:e,id:t,maxDurableSeqAtSend:l}];try{await j.mutate({input:e,threadKey:o(n),...x,...a})}catch(d){throw r.value=r.value.filter(_=>_.id!==t),d}},status:E,streamingText:O}};export{G as useAgentChat};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/vue",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.52",
|
|
4
4
|
"description": "Vue adapter for Lunora — live composables, optimistic mutations, and reactive loaders",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@lunora/client": "1.0.0-alpha.
|
|
61
|
+
"@lunora/client": "1.0.0-alpha.31",
|
|
62
62
|
"@lunora/errors": "1.0.0-alpha.8",
|
|
63
|
-
"@lunora/ratelimit": "1.0.0-alpha.
|
|
64
|
-
"@lunora/runtime": "1.0.0-alpha.
|
|
63
|
+
"@lunora/ratelimit": "1.0.0-alpha.11",
|
|
64
|
+
"@lunora/runtime": "1.0.0-alpha.40",
|
|
65
65
|
"@visulima/storage-client": "1.0.0"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ref as R,computed as m,toValue as r}from"vue";import{NO_MUTATION_REF as _}from"./useAgent-DyWC-Sm8.mjs";import{useMutation as y}from"./useMutation-MdgW9pRE.mjs";import{useStream as x}from"./useStream-CYkKEcDf.mjs";import{useSubscription as A}from"./useSubscription-D4Ap-tJr.mjs";const O={__lunoraRef:""},k=(g,u)=>{const l=u.filter(s=>s.role==="user"),c=new Set;return g.filter(s=>{for(let o=s.durableUserCountAtSend;o<l.length;o+=1){const d=l[o];if(d!==void 0&&!c.has(o)&&d.content===s.content)return c.add(o),!1}return!0})},B=g=>{const{api:u,cancel:l,limit:c,send:s,sendArgs:o,stream:d,threadKey:a}=g,{data:C}=A(u.agents.agentMessages,()=>{const t=r(a);return c===void 0?{key:t}:{key:t,limit:c}}),{data:K}=A(u.agents.agentThread,()=>({key:r(a)})),S=d===void 0?"skip":()=>({key:r(a)}),{chunks:j}=x(d??O,S),T=y(s),U=y(l??_),I=y(u.agents.agentResolveApproval),v=R([]);let w=0;const f=m(()=>K.value),b=m(()=>f.value?.status),p=m(()=>C.value??[]),q=m(()=>{const t=p.value,n=k(v.value,t);if(n.length===0)return t;let e=-1;for(const i of t)i.seq>e&&(e=i.seq);return[...t,...n.map((i,h)=>({content:i.content,optimistic:!0,role:"user",seq:e+1+h}))]}),E=m(()=>{const t=r(a),n=p.value.filter(e=>e.role==="assistant").length;return j.value.filter(e=>e.kind!=="progress"&&e.threadKey===t&&e.turn>=n).map(e=>e.text).join("")});return{approve:async(t,n)=>{const e=f.value?.instanceId;if(e===void 0)throw new Error("useAgentChat: cannot approve — no in-flight run (thread has no instanceId)");await I.mutate({decision:"approve",instanceId:e,threadKey:r(a),toolCallId:t,...n===void 0?{}:{note:n}})},cancel:async()=>{const t=f.value?.instanceId;l===void 0||t===void 0||await U.mutate({instanceId:t,threadKey:r(a)})},messages:q,reject:async(t,n)=>{const e=f.value?.instanceId;if(e===void 0)throw new Error("useAgentChat: cannot reject — no in-flight run (thread has no instanceId)");await I.mutate({decision:"reject",instanceId:e,threadKey:r(a),toolCallId:t,...n===void 0?{}:{note:n}})},send:async(t,n)=>{const e=w;w+=1;const i=p.value.filter(h=>h.role==="user").length;v.value=[...k(v.value,p.value),{content:t,durableUserCountAtSend:i,id:e}];try{await T.mutate({input:t,threadKey:r(a),...o,...n})}catch(h){throw v.value=v.value.filter(M=>M.id!==e),h}},status:b,streamingText:E}};export{B as useAgentChat};
|