@lunora/solid 1.0.0-alpha.31 → 1.0.0-alpha.33
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{LunoraContext as r,useLunora as o}from"./packem_shared/LunoraContext-CVOsskhY.mjs";import{createAgent as c}from"./packem_shared/createAgent-BbHVxEpf.mjs";import{createAgentChat as f}from"./packem_shared/createAgentChat-
|
|
1
|
+
import{LunoraContext as r,useLunora as o}from"./packem_shared/LunoraContext-CVOsskhY.mjs";import{createAgent as c}from"./packem_shared/createAgent-BbHVxEpf.mjs";import{createAgentChat as f}from"./packem_shared/createAgentChat-B79ZiHfq.mjs";import{createAgentState as p}from"./packem_shared/createAgentState-CbE2MP_H.mjs";import{createAgentToolEvents as u}from"./packem_shared/createAgentToolEvents-DOU_J3JT.mjs";import{AuthLoading as d,Authenticated as g,Unauthenticated as s,createAuth as A}from"./packem_shared/AuthLoading-D6A1mBRs.mjs";import{default as h}from"./packem_shared/createConnectionStatus-B9ly5m1x.mjs";import{createFlag as y,createFlags as C}from"./packem_shared/createFlag-qBxuQ5hP.mjs";import{createMutation as S,createMutationForClient as F}from"./packem_shared/createMutation-9i34uh8U.mjs";import{createMutator as Q}from"./packem_shared/createMutator-zzxMk2QQ.mjs";import{createInfiniteQuery as b,createPaginatedQuery as E}from"./packem_shared/createInfiniteQuery-CDLk3UVQ.mjs";import{createPresence as R}from"./packem_shared/createPresence-DNVSvTzP.mjs";import{createQuery as U}from"./packem_shared/createQuery-CFb7mUGW.mjs";import{createRateLimit as j}from"./packem_shared/createRateLimit-BdVo3eNW.mjs";import{createStream as q}from"./packem_shared/createStream-DozkYNOc.mjs";import{createSubscription as z}from"./packem_shared/createSubscription-KbQk0ohZ.mjs";import{createVoiceAgent as D}from"./packem_shared/createVoiceAgent-CzXF9acz.mjs";import{default as H}from"./packem_shared/hydratePreloaded-BbGFlPEb.mjs";import{LunoraProvider as K}from"./packem_shared/LunoraProvider-cifsrLab.mjs";export{d as AuthLoading,g as Authenticated,r as LunoraContext,K as LunoraProvider,s as Unauthenticated,c as createAgent,f as createAgentChat,p as createAgentState,u as createAgentToolEvents,A as createAuth,h as createConnectionStatus,y as createFlag,C as createFlags,b as createInfiniteQuery,S as createMutation,F as createMutationForClient,Q as createMutator,E as createPaginatedQuery,R as createPresence,U as createQuery,j as createRateLimit,q as createStream,z as createSubscription,D as createVoiceAgent,H as hydratePreloaded,o as useLunora};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{reconcileOptimistic as v,maxSeq as I}from"@lunora/client";import{createSignal as N,createMemo as s}from"solid-js";import{resolveMaybe as r,NO_MUTATION_REF as R}from"./createAgent-BbHVxEpf.mjs";import{createMutation as l}from"./createMutation-9i34uh8U.mjs";import{createStream as D}from"./createStream-DozkYNOc.mjs";import{createSubscription as w}from"./createSubscription-KbQk0ohZ.mjs";const F={__lunoraRef:""},H=k=>{const{api:d,cancel:p,limit:h,send:A,sendArgs:K,stream:u,threadKey:n}=k,{data:S}=w(d.agents.agentMessages,()=>{const t=r(n);return h===void 0?{key:t}:{key:t,limit:h}}),{data:x}=w(d.agents.agentThread,()=>({key:r(n)})),M=u===void 0?"skip":()=>({key:r(n)}),{chunks:C}=D(u??F,M),O=l(A),T=l(p??R),g=l(d.agents.agentResolveApproval),[$,f]=N([]);let y=0;const i=s(()=>x()),b=s(()=>i()?.status),c=s(()=>S()??[]),j=s(()=>{const t=c(),a=v($(),t);if(a.length===0)return t;const e=I(t);return[...t,...a.map((m,o)=>({content:m.content,optimistic:!0,role:"user",seq:e+1+o}))]}),E=s(()=>{const t=r(n),a=c().filter(e=>e.role==="assistant").length;return C().filter(e=>e.kind!=="progress"&&e.threadKey===t&&e.turn>=a).map(e=>e.text).join("")});return{approve:async(t,a)=>{const e=i()?.instanceId;if(e===void 0)throw new Error("createAgentChat: cannot approve — no in-flight run (thread has no instanceId)");await g.mutate({decision:"approve",instanceId:e,threadKey:r(n),toolCallId:t,...a===void 0?{}:{note:a}})},cancel:async()=>{const t=i()?.instanceId;p===void 0||t===void 0||await T.mutate({instanceId:t,threadKey:r(n)})},messages:j,reject:async(t,a)=>{const e=i()?.instanceId;if(e===void 0)throw new Error("createAgentChat: cannot reject — no in-flight run (thread has no instanceId)");await g.mutate({decision:"reject",instanceId:e,threadKey:r(n),toolCallId:t,...a===void 0?{}:{note:a}})},send:async(t,a)=>{const e=y;y+=1;const m=I(c());f(o=>[...v(o,c()),{content:t,id:e,maxDurableSeqAtSend:m}]);try{await O.mutate({input:t,threadKey:r(n),...K,...a})}catch(o){throw f(_=>_.filter(q=>q.id!==e)),o}},status:b,streamingText:E}};export{H as createAgentChat};
|
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.33",
|
|
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.31",
|
|
58
58
|
"@lunora/errors": "1.0.0-alpha.8",
|
|
59
|
-
"@lunora/ratelimit": "1.0.0-alpha.
|
|
59
|
+
"@lunora/ratelimit": "1.0.0-alpha.11",
|
|
60
60
|
"@visulima/storage-client": "1.0.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createSignal as _,createMemo as m}from"solid-js";import{resolveMaybe as r,NO_MUTATION_REF as q}from"./createAgent-BbHVxEpf.mjs";import{createMutation as y}from"./createMutation-9i34uh8U.mjs";import{createStream as x}from"./createStream-DozkYNOc.mjs";import{createSubscription as A}from"./createSubscription-KbQk0ohZ.mjs";const N={__lunoraRef:""},k=(f,d)=>{const l=d.filter(i=>i.role==="user"),u=new Set;return f.filter(i=>{for(let o=i.durableUserCountAtSend;o<l.length;o+=1){const h=l[o];if(h!==void 0&&!u.has(o)&&h.content===i.content)return u.add(o),!1}return!0})},G=f=>{const{api:d,cancel:l,limit:u,send:i,sendArgs:o,stream:h,threadKey:a}=f,{data:C}=A(d.agents.agentMessages,()=>{const e=r(a);return u===void 0?{key:e}:{key:e,limit:u}}),{data:K}=A(d.agents.agentThread,()=>({key:r(a)})),S=h===void 0?"skip":()=>({key:r(a)}),{chunks:M}=x(h??N,S),b=y(i),T=y(l??q),v=y(d.agents.agentResolveApproval),[$,I]=_([]);let w=0;const g=m(()=>K()),j=m(()=>g()?.status),p=m(()=>C()??[]),E=m(()=>{const e=p(),n=k($(),e);if(n.length===0)return e;let t=-1;for(const c of e)c.seq>t&&(t=c.seq);return[...e,...n.map((c,s)=>({content:c.content,optimistic:!0,role:"user",seq:t+1+s}))]}),O=m(()=>{const e=r(a),n=p().filter(t=>t.role==="assistant").length;return M().filter(t=>t.kind!=="progress"&&t.threadKey===e&&t.turn>=n).map(t=>t.text).join("")});return{approve:async(e,n)=>{const t=g()?.instanceId;if(t===void 0)throw new Error("createAgentChat: cannot approve — no in-flight run (thread has no instanceId)");await v.mutate({decision:"approve",instanceId:t,threadKey:r(a),toolCallId:e,...n===void 0?{}:{note:n}})},cancel:async()=>{const e=g()?.instanceId;l===void 0||e===void 0||await T.mutate({instanceId:e,threadKey:r(a)})},messages:E,reject:async(e,n)=>{const t=g()?.instanceId;if(t===void 0)throw new Error("createAgentChat: cannot reject — no in-flight run (thread has no instanceId)");await v.mutate({decision:"reject",instanceId:t,threadKey:r(a),toolCallId:e,...n===void 0?{}:{note:n}})},send:async(e,n)=>{const t=w;w+=1;const c=p().filter(s=>s.role==="user").length;I(s=>[...k(s,p()),{content:e,durableUserCountAtSend:c,id:t}]);try{await b.mutate({input:e,threadKey:r(a),...o,...n})}catch(s){throw I(R=>R.filter(U=>U.id!==t)),s}},status:j,streamingText:O}};export{G as createAgentChat};
|