@lunora/angular 1.0.0-alpha.182 → 1.0.0-alpha.184

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-Dh0JmOsE.mjs";import{agentChat as m}from"./packem_shared/agentChat-CUftyWn5.mjs";import{agentState as f}from"./packem_shared/agentState-DvCNdMQS.mjs";import{agentToolEvents as n}from"./packem_shared/agentToolEvents-aMyN8x_9.mjs";import{auth as i,authGate as u}from"./packem_shared/auth-C3dB8sYS.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-BskglOb_.mjs";import{hydratePreloaded as C}from"./packem_shared/hydratePreloaded-C-ZpUiHG.mjs";import{liveQuery as S}from"./packem_shared/liveQuery-pzb7zABN.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-CjummhFC.mjs";import{presence as K}from"./packem_shared/presence-Dmkc_W2i.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-BOw34-B1.mjs";import{subscription as z}from"./packem_shared/subscription-D-IAulJZ.mjs";import{voiceAgent as D}from"./packem_shared/voiceAgent-CrYnuWjJ.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};
1
+ import{agent as t}from"./packem_shared/agent-Dh0JmOsE.mjs";import{agentChat as m}from"./packem_shared/agentChat-CUftyWn5.mjs";import{agentState as f}from"./packem_shared/agentState-DvCNdMQS.mjs";import{agentToolEvents as n}from"./packem_shared/agentToolEvents-aMyN8x_9.mjs";import{auth as i,authGate as u}from"./packem_shared/auth-C3dB8sYS.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-BskglOb_.mjs";import{hydratePreloaded as C}from"./packem_shared/hydratePreloaded-C-ZpUiHG.mjs";import{liveQuery as S}from"./packem_shared/liveQuery-pzb7zABN.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-CjummhFC.mjs";import{presence as K}from"./packem_shared/presence-DzVvQuEt.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-BOw34-B1.mjs";import{subscription as z}from"./packem_shared/subscription-D-IAulJZ.mjs";import{voiceAgent as D}from"./packem_shared/voiceAgent-CrYnuWjJ.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{inject as S,DestroyRef as U,signal as v}from"@angular/core";import{resolveLunoraClient as C}from"./LUNORA_CLIENT-B0toApHY.mjs";import{s as E,r as A}from"./platform-xIXjiJ6l.mjs";const w=()=>{if(typeof crypto<"u"){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();if(typeof crypto.getRandomValues=="function"){const n=crypto.getRandomValues(new Uint8Array(16));return Array.from(n,e=>e.toString(16).padStart(2,"0")).join("")}}throw new Error("randomSessionId: no Web Crypto available — a session id needs crypto.randomUUID or crypto.getRandomValues")},L=1e4,j=(n,e)=>{const i=C(e.client),f=e.destroyRef===void 0,p=e.destroyRef??S(U),{heartbeat:b,listPresent:g,shardKey:a}=e,o=e.intervalMs??L,c=e.sessionId??w(),y=v(void 0),d=v(void 0);if(!Number.isFinite(o)||o<=0)throw new RangeError(`presence intervalMs must be a positive number, got ${String(o)}`);let l=e.data,u=!1;const r=()=>{const t={roomId:n,sessionId:c};l!==void 0&&(t.data=l),i.mutation(b,t,{shardKey:a}).catch(()=>{})},R=t=>{l=t,u&&r()};if(E(f)){u=!0;const t=i.acquireConnectionContext({roomId:n,sessionId:c},{shardKey:a});r();const m=()=>{typeof document<"u"&&document.visibilityState==="visible"&&r()},I=A(f,()=>(typeof document<"u"&&document.addEventListener("visibilitychange",m),setInterval(r,o))),h={roomId:n},D=i.subscribe(g,h,s=>{y.set(s),d.set(void 0)},{onError:s=>{d.set(s),e.onError?.(s)},shardKey:a});p.onDestroy(()=>{u=!1,clearInterval(I),typeof document<"u"&&document.removeEventListener("visibilitychange",m),t(),D()})}return{error:d.asReadonly(),present:y.asReadonly(),sessionId:c,setData:R}};export{j as presence};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/angular",
3
- "version": "1.0.0-alpha.182",
3
+ "version": "1.0.0-alpha.184",
4
4
  "description": "Angular reactive adapter for Lunora — signal-based live queries and mutations",
5
5
  "keywords": [
6
6
  "angular",
@@ -53,8 +53,8 @@
53
53
  "access": "public"
54
54
  },
55
55
  "dependencies": {
56
- "@lunora/client": "1.0.0-alpha.196",
57
- "@lunora/ratelimit": "1.0.0-alpha.123",
56
+ "@lunora/client": "1.0.0-alpha.198",
57
+ "@lunora/ratelimit": "1.0.0-alpha.125",
58
58
  "@visulima/storage-client": "1.0.9"
59
59
  },
60
60
  "peerDependencies": {
@@ -1 +0,0 @@
1
- import{inject as D,DestroyRef as S,signal as m}from"@angular/core";import{resolveLunoraClient as U}from"./LUNORA_CLIENT-B0toApHY.mjs";import{s as C,r as E}from"./platform-xIXjiJ6l.mjs";const A=()=>{if(typeof crypto<"u"){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();if(typeof crypto.getRandomValues=="function"){const n=crypto.getRandomValues(new Uint8Array(16));return Array.from(n,e=>e.toString(16).padStart(2,"0")).join("")}}throw new Error("randomSessionId: no Web Crypto available — a session id needs crypto.randomUUID or crypto.getRandomValues")},w=1e4,M=(n,e)=>{const i=U(e.client),u=e.destroyRef===void 0,v=e.destroyRef??D(S),{heartbeat:p,listPresent:b,shardKey:a}=e,o=e.intervalMs??w,c=e.sessionId??A(),f=m(void 0),d=m(void 0);if(!Number.isFinite(o)||o<=0)throw new RangeError(`presence intervalMs must be a positive number, got ${String(o)}`);let l=e.data;const r=()=>{const t={roomId:n,sessionId:c};l!==void 0&&(t.data=l),i.mutation(p,t,{shardKey:a}).catch(()=>{})},g=t=>{l=t,r()};if(C(u)){const t=i.acquireConnectionContext({roomId:n,sessionId:c},{shardKey:a});r();const y=()=>{typeof document<"u"&&document.visibilityState==="visible"&&r()},R=E(u,()=>(typeof document<"u"&&document.addEventListener("visibilitychange",y),setInterval(r,o))),I={roomId:n},h=i.subscribe(b,I,s=>{f.set(s),d.set(void 0)},{onError:s=>{d.set(s),e.onError?.(s)},shardKey:a});v.onDestroy(()=>{clearInterval(R),typeof document<"u"&&document.removeEventListener("visibilitychange",y),t(),h()})}return{error:d.asReadonly(),present:f.asReadonly(),sessionId:c,setData:g}};export{M as presence};