@lunora/angular 1.0.0-alpha.43 → 1.0.0-alpha.44
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{agent as t}from"./packem_shared/agent-BPvUvuXh.mjs";import{agentChat as m}from"./packem_shared/agentChat-BgD9zNFw.mjs";import{agentState as f}from"./packem_shared/agentState-BBAruY2b.mjs";import{agentToolEvents as n}from"./packem_shared/agentToolEvents-CUwrn-Nu.mjs";import{auth as i,authGate as u}from"./packem_shared/auth-BgwruT_M.mjs";import{LUNORA_CLIENT as c,injectLunoraClient as s,provideLunora as l}from"./packem_shared/LUNORA_CLIENT-B0toApHY.mjs";import{connectionStatus as L}from"./packem_shared/connectionStatus-UhmuwzMa.mjs";import{flag as v,flags as y}from"./packem_shared/flag-orUoJY7A.mjs";import{hydratePreloaded as C}from"./packem_shared/hydratePreloaded-C8lNoww0.mjs";import{liveQuery as S}from"./packem_shared/liveQuery-BvA2co81.mjs";import{mutate as I}from"./packem_shared/mutate-BZvLQLyu.mjs";import{mutator as P}from"./packem_shared/mutator-DjG1yGk8.mjs";import{infiniteQuery as b,paginatedQuery as j}from"./packem_shared/infiniteQuery-
|
|
1
|
+
import{agent as t}from"./packem_shared/agent-BPvUvuXh.mjs";import{agentChat as m}from"./packem_shared/agentChat-BgD9zNFw.mjs";import{agentState as f}from"./packem_shared/agentState-BBAruY2b.mjs";import{agentToolEvents as n}from"./packem_shared/agentToolEvents-CUwrn-Nu.mjs";import{auth as i,authGate as u}from"./packem_shared/auth-BgwruT_M.mjs";import{LUNORA_CLIENT as c,injectLunoraClient as s,provideLunora as l}from"./packem_shared/LUNORA_CLIENT-B0toApHY.mjs";import{connectionStatus as L}from"./packem_shared/connectionStatus-UhmuwzMa.mjs";import{flag as v,flags as y}from"./packem_shared/flag-orUoJY7A.mjs";import{hydratePreloaded as C}from"./packem_shared/hydratePreloaded-C8lNoww0.mjs";import{liveQuery as S}from"./packem_shared/liveQuery-BvA2co81.mjs";import{mutate as I}from"./packem_shared/mutate-BZvLQLyu.mjs";import{mutator as P}from"./packem_shared/mutator-DjG1yGk8.mjs";import{infiniteQuery as b,paginatedQuery as j}from"./packem_shared/infiniteQuery-B5Q21vgn.mjs";import{presence as K}from"./packem_shared/presence-vJUxsR5f.mjs";import{rateLimit as R}from"./packem_shared/rateLimit-B3h9qzh-.mjs";import{runAction as _}from"./packem_shared/runAction-BfiPq4Xz.mjs";import{stream as q}from"./packem_shared/stream-CcjYdpzt.mjs";import{subscription as z}from"./packem_shared/subscription-DqtYnats.mjs";import{voiceAgent as D}from"./packem_shared/voiceAgent-CzyUcUKj.mjs";import{SKIP as H}from"@lunora/client/query";export{c as LUNORA_CLIENT,H as SKIP,t as agent,m as agentChat,f as agentState,n as agentToolEvents,i as auth,u as authGate,L as connectionStatus,v as flag,y as flags,C as hydratePreloaded,b as infiniteQuery,s as injectLunoraClient,S as liveQuery,I as mutate,P as mutator,j as paginatedQuery,K as presence,l as provideLunora,R as rateLimit,_ as runAction,q as stream,z as subscription,D as voiceAgent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{computed as R,inject as q,DestroyRef as Q,signal as C}from"@angular/core";import{initialPages as Y,derivePaginationStatus as T,applyLoadMore as Z,rebalance as v}from"@lunora/client/pagination";import{resolveLunoraClient as V}from"./LUNORA_CLIENT-B0toApHY.mjs";import{s as z,a as tt}from"./platform-I2VyCEIl.mjs";const et=/["\\\u0000-\u001F\uD800-\uDFFF]/,U=t=>et.test(t)?JSON.stringify(t):`"${t}"`,D=t=>{if(t===void 0)return"null";if(typeof t=="bigint")throw new TypeError("stableStringify: cannot use a bigint in a stable JSON cache key — pass it as a string, or use stableWireKey");if(typeof t=="number"){if(Number.isNaN(t))return"nan";if(t===1/0)return"inf";if(t===-1/0)return"-inf";if(Object.is(t,-0))return"-0"}if(typeof t=="string")return U(t);if(t===null||typeof t!="object")return JSON.stringify(t);if(Array.isArray(t)){let r="[";for(let s=0;s<t.length;s++)s>0&&(r+=","),r+=D(t[s]);return r+"]"}const n=Object.getPrototypeOf(t);if(n!==null&&n!==Object.prototype){const r=t.constructor?.name??"value";throw new TypeError(`stableStringify: cannot use a ${r} in a stable JSON cache key — only plain objects, arrays, and JSON primitives are supported (wire-typed values key via stableWireKey)`)}const o=t,i=Object.keys(o).sort();let c="{",e=!0;for(const r of i){const s=o[r];s!==void 0&&(e?e=!1:c+=",",c+=U(r),c+=":",c+=D(s))}return c+"}"},_=t=>{let n="";for(let i=0;i<t.length;i+=32768)n+=String.fromCharCode(...t.subarray(i,i+32768));return btoa(n)},y="$lunora.wire$",J=64,nt="__proto__",rt=t=>{if(t===null||typeof t!="object")return!1;const n=Object.getPrototypeOf(t);return n===null||n===Object.prototype},S=(t,n=0)=>{if(n>J)throw new RangeError(`wire-codec: value nesting exceeds the ${J}-level limit`);if(t===void 0)return[y,"undefined"];if(t===null)return null;const o=typeof t;if(o==="bigint")return[y,"bigint",t.toString()];if(o==="number"){const e=t;return Number.isNaN(e)?[y,"nan"]:e===1/0?[y,"inf"]:e===-1/0?[y,"-inf"]:e}if(o!=="object")return t;if(t instanceof Date)return[y,"date",S(t.getTime(),n+1)];if(t instanceof Error){const e=t,r={};for(const d of Object.keys(e))e[d]!==void 0&&(r[d]=S(e[d],n+1));const s=[y,"error",e.name,e.message,r];return e.cause!==void 0&&s.push(S(e.cause,n+1)),s}if(t instanceof URL)return[y,"url",t.href];if(t instanceof Map)return[y,"map",[...t.entries()].map(([e,r])=>[S(e,n+1),S(r,n+1)])];if(t instanceof Set)return[y,"set",[...t].map(e=>S(e,n+1))];if(t instanceof ArrayBuffer)return[y,"bytes",_(new Uint8Array(t)),"ArrayBuffer"];if(ArrayBuffer.isView(t)){const e=t,r=e.constructor.name,s=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return r==="Uint8Array"?[y,"bytes",_(s)]:[y,"bytes",_(s),r]}if(Array.isArray(t)){const e=t.map(r=>S(r,n+1));return e.length>0&&e[0]===y?[y,"arr",e]:e}if(!rt(t)){const e=t.constructor?.name??"value";throw new TypeError(`wire-codec: cannot encode a ${e} over the Lunora wire — only plain objects, arrays, and the supported built-ins (Date, Error, URL, Map, Set, ArrayBuffer/typed arrays, bigint) round-trip`)}const i=t,c={};for(const e of Object.keys(i)){const r=i[e];if(r===void 0)continue;const s=S(r,n+1);e===nt?Object.defineProperty(c,e,{configurable:!0,enumerable:!0,value:s,writable:!0}):c[e]=s}return c},ot=t=>D(S(t)),k=(t,n)=>`${t}::${ot(n)}`,K=(t,n)=>({...n,paginationOpts:{cursor:t.lower,endCursor:t.upper,numItems:t.numItems}}),W=(t,n,o,i)=>{const c=V(o.client),e=o.destroyRef===void 0&&i===void 0,{initialNumItems:r,shardKey:s}=o,d=t.__lunoraRef,m=n==="skip"?{}:n,a=C(Y(r)),N=C([]),$=C("LoadingFirstPage"),h=new Map,w=new Map,M=new Set,O=()=>{const g=a().map(f=>{const l=k(d,K(f,m));return w.get(l)});N.set(g);const{status:P}=T(n==="skip",g);$.set(P)},H=(p,g)=>{const P=f=>k(d,K(f,m));for(const f of g){const l=P(f);if(w.has(l))continue;const b=p.find(u=>u.lower===f.lower);if(b){const u=w.get(P(b));u&&w.set(l,u)}}},X=p=>{const g=new Set;for(const f of p)g.add(k(d,K(f,m)));for(const[f,l]of h)g.has(l.currentKey)||(l.unsub(),h.delete(f),w.delete(l.currentKey));const P=new Set([...h.values()].map(f=>f.currentKey));for(const f of p){const l=K(f,m),b=k(d,l);if(P.has(b))continue;const u={currentKey:b,unsub:void 0};M.add(b);const L=c.subscribe(t,l,E=>{if(w.set(u.currentKey,E),M.delete(u.currentKey),O(),M.size===0){const j=a(),A=v(j,N());A&&(H(j,A),a.set(A),I(A),O())}},{onError:()=>{M.delete(u.currentKey),O()},shardKey:s});u.unsub=L,h.set(b,u),P.add(b)}};let x=!1,F=!1;const I=p=>{if(x){F=!0;return}x=!0;try{let g=p;do F=!1,X(g),g=a();while(F)}finally{x=!1}};n!=="skip"&&z(e)&&I(a()),O();const B=()=>{for(const p of h.values())p.unsub();h.clear(),w.clear()};return i===void 0?(o.destroyRef??q(Q)).onDestroy(B):i(B),{loadMore:p=>{if(n==="skip")return;const{nextCursor:g,status:P}=T(!1,N());if(P!=="CanLoadMore")return;const f=Z(a(),g,p);if(!f)return;const l=a().at(-1),b=f.at(-2);if(l&&b){const u=k(d,K(l,m)),L=k(d,K(b,m)),E=h.get(u);if(E&&u!==L){const j=w.get(u);j&&w.set(L,j),E.unsub(),h.delete(u),w.delete(u)}}a.set(f),I(a()),O()},pageResults:N,status:$}},G=(t,n,o)=>{if(typeof n!="function")return W(t,n,o);const i=V(o.client),c=o.destroyRef===void 0,e=o.destroyRef??q(Q),r=C(void 0);return z(c)&&tt(n,{destroyRef:e,injector:o.injector},(s,d)=>{const m=[];r.set(W(t,s,{...o,client:i},a=>m.push(a))),d(()=>{for(const a of m)a()})}),{loadMore:s=>{r()?.loadMore(s)},pageResults:R(()=>r()?.pageResults()??[]),status:R(()=>r()?.status()??"LoadingFirstPage")}},ut=(t,n,o)=>{const i=G(t,n,o),c=R(()=>i.pageResults().flatMap(r=>r?.page??[]));return{isLoading:R(()=>{const r=i.status();return r==="LoadingFirstPage"||r==="LoadingMore"}),loadMore:i.loadMore,results:c,status:i.status}},yt=(t,n,o)=>{const{initialNumItems:i}=o,c=G(t,n,o),e=R(()=>c.pageResults().flatMap(a=>a?[a.page]:[])),r=R(()=>c.status()==="LoadingFirstPage"),s=R(()=>c.status()==="CanLoadMore"),d=R(()=>c.status()==="LoadingMore");return{fetchNextPage:a=>{c.loadMore(a??i)},hasNextPage:s,isFetchingNextPage:d,isLoading:r,pages:e,status:c.status}};export{yt as infiniteQuery,ut as paginatedQuery};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/angular",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.44",
|
|
4
4
|
"description": "Angular reactive adapter for Lunora — signal-based live queries and mutations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@lunora/client": "1.0.0-alpha.
|
|
56
|
+
"@lunora/client": "1.0.0-alpha.60",
|
|
57
57
|
"@lunora/ratelimit": "1.0.0-alpha.27",
|
|
58
58
|
"@visulima/storage-client": "1.0.2"
|
|
59
59
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{computed as j,inject as W,DestroyRef as Q,signal as C}from"@angular/core";import{initialPages as X,derivePaginationStatus as U,applyLoadMore as Y,rebalance as Z}from"@lunora/client/pagination";import{resolveLunoraClient as V}from"./LUNORA_CLIENT-B0toApHY.mjs";import{s as q,a as v}from"./platform-I2VyCEIl.mjs";const tt=(t,n)=>t<n?-1:t>n?1:0,F=t=>{if(t===void 0)return"null";if(typeof t=="bigint")throw new TypeError("stableStringify: cannot use a bigint in a stable JSON cache key — pass it as a string, or use stableWireKey");if(typeof t=="number"){if(Number.isNaN(t))return"nan";if(t===1/0)return"inf";if(t===-1/0)return"-inf";if(Object.is(t,-0))return"-0"}if(t===null||typeof t!="object")return JSON.stringify(t);if(Array.isArray(t))return`[${t.map(e=>F(e)).join(",")}]`;const n=Object.getPrototypeOf(t);if(n!==null&&n!==Object.prototype){const e=t.constructor?.name??"value";throw new TypeError(`stableStringify: cannot use a ${e} in a stable JSON cache key — only plain objects, arrays, and JSON primitives are supported (wire-typed values key via stableWireKey)`)}const o=t,s=Object.keys(o).toSorted(tt),i=[];for(const e of s){const r=o[e];r!==void 0&&i.push(`${JSON.stringify(e)}:${F(r)}`)}return`{${i.join(",")}}`},_=t=>{let n="";for(let s=0;s<t.length;s+=32768)n+=String.fromCharCode(...t.subarray(s,s+32768));return btoa(n)},y="$lunora.wire$",D=64,et="__proto__",nt=t=>{if(t===null||typeof t!="object")return!1;const n=Object.getPrototypeOf(t);return n===null||n===Object.prototype},h=(t,n=0)=>{if(n>D)throw new RangeError(`wire-codec: value nesting exceeds the ${D}-level limit`);if(t===void 0)return[y,"undefined"];if(t===null)return null;const o=typeof t;if(o==="bigint")return[y,"bigint",t.toString()];if(o==="number"){const e=t;return Number.isNaN(e)?[y,"nan"]:e===1/0?[y,"inf"]:e===-1/0?[y,"-inf"]:e}if(o!=="object")return t;if(t instanceof Date)return[y,"date",h(t.getTime(),n+1)];if(t instanceof Error){const e=t,r={};for(const d of Object.keys(e))e[d]!==void 0&&(r[d]=h(e[d],n+1));const f=[y,"error",e.name,e.message,r];return e.cause!==void 0&&f.push(h(e.cause,n+1)),f}if(t instanceof URL)return[y,"url",t.href];if(t instanceof Map)return[y,"map",[...t.entries()].map(([e,r])=>[h(e,n+1),h(r,n+1)])];if(t instanceof Set)return[y,"set",[...t].map(e=>h(e,n+1))];if(t instanceof ArrayBuffer)return[y,"bytes",_(new Uint8Array(t)),"ArrayBuffer"];if(ArrayBuffer.isView(t)){const e=t,r=e.constructor.name,f=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return r==="Uint8Array"?[y,"bytes",_(f)]:[y,"bytes",_(f),r]}if(Array.isArray(t)){const e=t.map(r=>h(r,n+1));return e.length>0&&e[0]===y?[y,"arr",e]:e}if(!nt(t)){const e=t.constructor?.name??"value";throw new TypeError(`wire-codec: cannot encode a ${e} over the Lunora wire — only plain objects, arrays, and the supported built-ins (Date, Error, URL, Map, Set, ArrayBuffer/typed arrays, bigint) round-trip`)}const s=t,i={};for(const e of Object.keys(s)){const r=s[e];if(r===void 0)continue;const f=h(r,n+1);e===et?Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:f,writable:!0}):i[e]=f}return i},rt=t=>F(h(t)),K=(t,n)=>`${t}::${rt(n)}`,R=(t,n)=>({...n,paginationOpts:{cursor:t.lower,endCursor:t.upper,numItems:t.numItems}}),J=(t,n,o,s)=>{const i=V(o.client),e=o.destroyRef===void 0&&s===void 0,{initialNumItems:r,shardKey:f}=o,d=t.__lunoraRef,m=n==="skip"?{}:n,c=C(X(r)),M=C([]),B=C("LoadingFirstPage"),S=new Map,w=new Map,N=new Set,k=()=>{const g=c().map(a=>{const l=K(d,R(a,m));return w.get(l)});M.set(g);const{status:P}=U(n==="skip",g);B.set(P)},G=(p,g)=>{const P=a=>K(d,R(a,m));for(const a of g){const l=P(a);if(w.has(l))continue;const b=p.find(u=>u.lower===a.lower);if(b){const u=w.get(P(b));u&&w.set(l,u)}}},H=p=>{const g=new Set;for(const a of p)g.add(K(d,R(a,m)));for(const[a,l]of S)g.has(l.currentKey)||(l.unsub(),S.delete(a),w.delete(l.currentKey));const P=new Set([...S.values()].map(a=>a.currentKey));for(const a of p){const l=R(a,m),b=K(d,l);if(P.has(b))continue;const u={currentKey:b,unsub:void 0};N.add(b);const L=i.subscribe(t,l,x=>{if(w.set(u.currentKey,x),N.delete(u.currentKey),k(),N.size===0){const O=c(),A=Z(O,M());A&&(G(O,A),c.set(A),I(A),k())}},{onError:()=>{N.delete(u.currentKey),k()},shardKey:f});u.unsub=L,S.set(b,u),P.add(b)}};let E=!1,$=!1;const I=p=>{if(E){$=!0;return}E=!0;try{let g=p;do $=!1,H(g),g=c();while($)}finally{E=!1}};n!=="skip"&&q(e)&&I(c()),k();const T=()=>{for(const p of S.values())p.unsub();S.clear(),w.clear()};return s===void 0?(o.destroyRef??W(Q)).onDestroy(T):s(T),{loadMore:p=>{if(n==="skip")return;const{nextCursor:g,status:P}=U(!1,M());if(P!=="CanLoadMore")return;const a=Y(c(),g,p);if(!a)return;const l=c().at(-1),b=a.at(-2);if(l&&b){const u=K(d,R(l,m)),L=K(d,R(b,m)),x=S.get(u);if(x&&u!==L){const O=w.get(u);O&&w.set(L,O),x.unsub(),S.delete(u),w.delete(u)}}c.set(a),I(c()),k()},pageResults:M,status:B}},z=(t,n,o)=>{if(typeof n!="function")return J(t,n,o);const s=V(o.client),i=o.destroyRef===void 0,e=o.destroyRef??W(Q),r=C(void 0);return q(i)&&v(n,{destroyRef:e,injector:o.injector},(f,d)=>{const m=[];r.set(J(t,f,{...o,client:s},c=>m.push(c))),d(()=>{for(const c of m)c()})}),{loadMore:f=>{r()?.loadMore(f)},pageResults:j(()=>r()?.pageResults()??[]),status:j(()=>r()?.status()??"LoadingFirstPage")}},ft=(t,n,o)=>{const s=z(t,n,o),i=j(()=>s.pageResults().flatMap(r=>r?.page??[]));return{isLoading:j(()=>{const r=s.status();return r==="LoadingFirstPage"||r==="LoadingMore"}),loadMore:s.loadMore,results:i,status:s.status}},ut=(t,n,o)=>{const{initialNumItems:s}=o,i=z(t,n,o),e=j(()=>i.pageResults().flatMap(c=>c?[c.page]:[])),r=j(()=>i.status()==="LoadingFirstPage"),f=j(()=>i.status()==="CanLoadMore"),d=j(()=>i.status()==="LoadingMore");return{fetchNextPage:c=>{i.loadMore(c??s)},hasNextPage:f,isFetchingNextPage:d,isLoading:r,pages:e,status:i.status}};export{ut as infiniteQuery,ft as paginatedQuery};
|