smart-home-engine 0.13.0 → 0.15.18

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.
@@ -1420,4 +1420,4 @@ ${e.toString()}`}}class o1{constructor(e=new jh,t=!1,i,n=kte){this._services=e,t
1420
1420
  `+" ".repeat(e)),new Array(Gd).fill(0).map((s,e)=>"\r"+" ".repeat(e)),new Array(Gd).fill(0).map((s,e)=>`\r
1421
1421
  `+" ".repeat(e)),new Array(Gd).fill(0).map((s,e)=>`
1422
1422
  `+" ".repeat(e)),new Array(Gd).fill(0).map((s,e)=>"\r"+" ".repeat(e)),new Array(Gd).fill(0).map((s,e)=>`\r
1423
- `+" ".repeat(e));var V4;(function(s){s.DEFAULT={allowTrailingComma:!1}})(V4||(V4={}));var Gpe=jpe,H4;(function(s){s[s.None=0]="None",s[s.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",s[s.UnexpectedEndOfString=2]="UnexpectedEndOfString",s[s.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",s[s.InvalidUnicode=4]="InvalidUnicode",s[s.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",s[s.InvalidCharacter=6]="InvalidCharacter"})(H4||(H4={}));var $4;(function(s){s[s.OpenBraceToken=1]="OpenBraceToken",s[s.CloseBraceToken=2]="CloseBraceToken",s[s.OpenBracketToken=3]="OpenBracketToken",s[s.CloseBracketToken=4]="CloseBracketToken",s[s.CommaToken=5]="CommaToken",s[s.ColonToken=6]="ColonToken",s[s.NullKeyword=7]="NullKeyword",s[s.TrueKeyword=8]="TrueKeyword",s[s.FalseKeyword=9]="FalseKeyword",s[s.StringLiteral=10]="StringLiteral",s[s.NumericLiteral=11]="NumericLiteral",s[s.LineCommentTrivia=12]="LineCommentTrivia",s[s.BlockCommentTrivia=13]="BlockCommentTrivia",s[s.LineBreakTrivia=14]="LineBreakTrivia",s[s.Trivia=15]="Trivia",s[s.Unknown=16]="Unknown",s[s.EOF=17]="EOF"})($4||($4={}));var z4;(function(s){s[s.InvalidSymbol=1]="InvalidSymbol",s[s.InvalidNumberFormat=2]="InvalidNumberFormat",s[s.PropertyNameExpected=3]="PropertyNameExpected",s[s.ValueExpected=4]="ValueExpected",s[s.ColonExpected=5]="ColonExpected",s[s.CommaExpected=6]="CommaExpected",s[s.CloseBraceExpected=7]="CloseBraceExpected",s[s.CloseBracketExpected=8]="CloseBracketExpected",s[s.EndOfFileExpected=9]="EndOfFileExpected",s[s.InvalidCommentToken=10]="InvalidCommentToken",s[s.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",s[s.UnexpectedEndOfString=12]="UnexpectedEndOfString",s[s.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",s[s.InvalidUnicode=14]="InvalidUnicode",s[s.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",s[s.InvalidCharacter=16]="InvalidCharacter"})(z4||(z4={}));function Kpe(s){return{getInitialState:()=>new T7(null,null,!1,null),tokenize:(e,t)=>s_e(s,e,t)}}var U4="delimiter.bracket.json",q4="delimiter.array.json",Ype="delimiter.colon.json",Zpe="delimiter.comma.json",Xpe="keyword.json",Qpe="keyword.json",Jpe="string.value.json",e_e="number.json",t_e="string.key.json",i_e="comment.block.json",n_e="comment.line.json",Vf=class E7{constructor(e,t){this.parent=e,this.type=t}static pop(e){return e?e.parent:null}static push(e,t){return new E7(e,t)}static equals(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;for(;e&&t;){if(e===t)return!0;if(e.type!==t.type)return!1;e=e.parent,t=t.parent}return!0}},T7=class oE{constructor(e,t,i,n){this._state=e,this.scanError=t,this.lastWasColon=i,this.parents=n}clone(){return new oE(this._state,this.scanError,this.lastWasColon,this.parents)}equals(e){return e===this?!0:!e||!(e instanceof oE)?!1:this.scanError===e.scanError&&this.lastWasColon===e.lastWasColon&&Vf.equals(this.parents,e.parents)}getStateData(){return this._state}setStateData(e){this._state=e}};function s_e(s,e,t,i=0){let n=0,r=!1;switch(t.scanError){case 2:e='"'+e,n=1;break;case 1:e="/*"+e,n=2;break}const o=Gpe(e);let a=t.lastWasColon,l=t.parents;const c={tokens:[],endState:t.clone()};for(;;){let d=i+o.getPosition(),u="";const h=o.scan();if(h===17)break;if(d===i+o.getPosition())throw new Error("Scanner did not advance, next 3 characters are: "+e.substr(o.getPosition(),3));switch(r&&(d-=n),r=n>0,h){case 1:l=Vf.push(l,0),u=U4,a=!1;break;case 2:l=Vf.pop(l),u=U4,a=!1;break;case 3:l=Vf.push(l,1),u=q4,a=!1;break;case 4:l=Vf.pop(l),u=q4,a=!1;break;case 6:u=Ype,a=!0;break;case 5:u=Zpe,a=!1;break;case 8:case 9:u=Xpe,a=!1;break;case 7:u=Qpe,a=!1;break;case 10:const g=(l?l.type:0)===1;u=a||g?Jpe:t_e,a=!1;break;case 11:u=e_e,a=!1;break}switch(h){case 12:u=n_e;break;case 13:u=i_e;break}c.endState=new T7(t.getStateData(),o.getTokenError(),a,l),c.tokens.push({startIndex:d,scopes:u})}return c}var Ks;function r_e(){return new Promise((s,e)=>{if(!Ks)return e("JSON not registered!");s(Ks)})}var o_e=class extends g7{constructor(s,e,t){super(s,e,t.onDidChange),this._disposables.push(ot.editor.onWillDisposeModel(i=>{this._resetSchema(i.uri)})),this._disposables.push(ot.editor.onDidChangeModelLanguage(i=>{this._resetSchema(i.model.uri)}))}_resetSchema(s){this._worker().then(e=>{e.resetSchema(s.toString())})}};function a_e(s){const e=[],t=[],i=new f7(s);e.push(i),Ks=(...o)=>i.getLanguageServiceWorker(...o);function n(){const{languageId:o,modeConfiguration:a}=s;D7(t),a.documentFormattingEdits&&t.push(ot.languages.registerDocumentFormattingEditProvider(o,new C7(Ks))),a.documentRangeFormattingEdits&&t.push(ot.languages.registerDocumentRangeFormattingEditProvider(o,new y7(Ks))),a.completionItems&&t.push(ot.languages.registerCompletionItemProvider(o,new m7(Ks,[" ",":",'"']))),a.hovers&&t.push(ot.languages.registerHoverProvider(o,new p7(Ks))),a.documentSymbols&&t.push(ot.languages.registerDocumentSymbolProvider(o,new b7(Ks))),a.tokens&&t.push(ot.languages.setTokensProvider(o,Kpe(!0))),a.colors&&t.push(ot.languages.registerColorProvider(o,new S7(Ks))),a.foldingRanges&&t.push(ot.languages.registerFoldingRangeProvider(o,new k7(Ks))),a.diagnostics&&t.push(new o_e(o,Ks,s)),a.selectionRanges&&t.push(ot.languages.registerSelectionRangeProvider(o,new L7(Ks)))}n(),e.push(ot.languages.setLanguageConfiguration(s.languageId,l_e));let r=s.modeConfiguration;return s.onDidChange(o=>{o.modeConfiguration!==r&&(r=o.modeConfiguration,n())}),e.push(j4(t)),j4(e)}function j4(s){return{dispose:()=>D7(s)}}function D7(s){for(;s.length;)s.pop().dispose()}var l_e={wordPattern:/(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string"]},{open:"[",close:"]",notIn:["string"]},{open:'"',close:'"',notIn:["string"]}]};const c_e=Object.freeze(Object.defineProperty({__proto__:null,CompletionAdapter:m7,DefinitionAdapter:Wpe,DiagnosticsAdapter:g7,DocumentColorAdapter:S7,DocumentFormattingEditProvider:C7,DocumentHighlightAdapter:Fpe,DocumentLinkAdapter:Upe,DocumentRangeFormattingEditProvider:y7,DocumentSymbolAdapter:b7,FoldingRangeAdapter:k7,HoverAdapter:p7,ReferenceAdapter:Vpe,RenameAdapter:Hpe,SelectionRangeAdapter:L7,WorkerManager:f7,fromPosition:Ol,fromRange:dI,getWorker:r_e,setupMode:a_e,toRange:Bn,toTextEdit:Rh},Symbol.toStringTag,{value:"Module"}));export{ve as $,Xs as A,dt as B,mK as C,We as D,ose as E,o9 as F,Db as G,z5 as H,Gm as I,EX as J,A1 as K,Xo as L,q as M,owe as N,ue as O,OI as P,RI as Q,Fe as R,fT as S,AR as T,vs as U,eS as V,ZE as W,z_e as X,bl as Y,ae as Z,Ou as _,fa as a,GK as a$,Zc as a0,dd as a1,hL as a2,v3 as a3,qa as a4,M as a5,q6 as a6,te as a7,$e as a8,ie as a9,Ls as aA,jt as aB,lt as aC,ka as aD,ip as aE,KF as aF,a3 as aG,ET as aH,Cd as aI,e8 as aJ,tp as aK,at as aL,Yi as aM,jK as aN,xo as aO,kU as aP,pt as aQ,xi as aR,ko as aS,$s as aT,C2 as aU,D9 as aV,yd as aW,_d as aX,pn as aY,Wr as aZ,np as a_,kt as aa,wd as ab,Z9 as ac,SJ as ad,zW as ae,Rm as af,Wu as ag,zx as ah,Sn as ai,_0 as aj,vl as ak,QA as al,Gu as am,Ku as an,nu as ao,iL as ap,Fc as aq,yJ as ar,gT as as,II as at,Gj as au,Vr as av,Gh as aw,EK as ax,gD as ay,ai as az,GH as b,Ug as b$,I0 as b0,IU as b1,cr as b2,E0 as b3,Tl as b4,Km as b5,iT as b6,lr as b7,QK as b8,sY as b9,Ri as bA,Jn as bB,Hr as bC,Kx as bD,z8 as bE,Os as bF,Mle as bG,ph as bH,yi as bI,ga as bJ,uo as bK,Jo as bL,gm as bM,ui as bN,Qa as bO,gt as bP,YE as bQ,$_e as bR,va as bS,PI as bT,FI as bU,om as bV,Js as bW,r9 as bX,X2 as bY,hb as bZ,nr as b_,uR as ba,U8 as bb,g1 as bc,wi as bd,ch as be,WI as bf,AI as bg,VI as bh,Cee as bi,XA as bj,zf as bk,g1e as bl,f1e as bm,so as bn,tt as bo,mW as bp,Xc as bq,Zj as br,uD as bs,td as bt,Qm as bu,PX as bv,ml as bw,ea as bx,tr as by,ke as bz,pa as c,Ple as c$,TC as c0,ab as c1,W as c2,z6 as c3,ZA as c4,e2 as c5,JA as c6,t2 as c7,Qe as c8,A as c9,WJ as cA,Tm as cB,It as cC,Tr as cD,ud as cE,d0 as cF,e0 as cG,Gf as cH,VC as cI,h1 as cJ,Qf as cK,AX as cL,kz as cM,Cl as cN,NS as cO,C3 as cP,b9 as cQ,Ze as cR,fd as cS,N0 as cT,i2 as cU,yr as cV,ii as cW,_c as cX,Oe as cY,d5 as cZ,_z as c_,pe as ca,m_e as cb,bJ as cc,Mi as cd,Kh as ce,Qn as cf,hne as cg,Q1e as ch,Cs as ci,Rc as cj,fn as ck,Ns as cl,Me as cm,qj as cn,Fd as co,HW as cp,ut as cq,mn as cr,RF as cs,wU as ct,oi as cu,cd as cv,Bo as cw,MI as cx,Lz as cy,J2 as cz,OT as d,qe as d$,XE as d0,ag as d1,Ka as d2,nY as d3,_J as d4,La as d5,_2 as d6,R_e as d7,ft as d8,J1e as d9,Nr as dA,CT as dB,CE as dC,Nbe as dD,M7 as dE,Mo as dF,b_e as dG,Nn as dH,Ar as dI,lE as dJ,fo as dK,Oy as dL,Py as dM,My as dN,ir as dO,$I as dP,YX as dQ,Pb as dR,jg as dS,E_e as dT,st as dU,id as dV,EZ as dW,LZ as dX,Zy as dY,N_e as dZ,W5 as d_,cR as da,nm as db,m1e as dc,Qk as dd,See as de,Lee as df,de as dg,Jt as dh,U as di,A_e as dj,vi as dk,am as dl,Dbe as dm,he as dn,Ff as dp,Ji as dq,Ll as dr,B7 as ds,ne as dt,e5 as du,jE as dv,ho as dw,Ube as dx,nt as dy,x0 as dz,$y as e,Pt as e$,MT as e0,pG as e1,sh as e2,O_e as e3,bd as e4,Wa as e5,yZ as e6,FA as e7,p9 as e8,Uh as e9,hbe as eA,lT as eB,gbe as eC,Ja as eD,ru as eE,mbe as eF,pbe as eG,Jm as eH,_A as eI,aq as eJ,xb as eK,nd as eL,b8 as eM,_8 as eN,vbe as eO,wbe as eP,bbe as eQ,_be as eR,su as eS,p8 as eT,yb as eU,yl as eV,er as eW,g8 as eX,hi as eY,r2 as eZ,Ca as e_,m9 as ea,De as eb,Qr as ec,qbe as ed,DY as ee,sp as ef,AT as eg,zh as eh,wM as ei,roe as ej,jk as ek,aoe as el,mM as em,pM as en,soe as eo,ooe as ep,NG as eq,TW as er,n9 as es,Vy as et,Ai as eu,Yc as ev,Ble as ew,fbe as ex,Rr as ey,TK as ez,BS as f,F7 as f$,Abe as f0,ux as f1,OF as f2,fb as f3,I_e as f4,ts as f5,vt as f6,J_ as f7,Twe as f8,Dwe as f9,n1e as fA,u_e as fB,Ye as fC,ube as fD,J5 as fE,Xy as fF,Dx as fG,Kw as fH,ur as fI,C8 as fJ,v8 as fK,y8 as fL,Lq as fM,Tq as fN,Eq as fO,BE as fP,bi as fQ,TE as fR,$m as fS,El as fT,f0 as fU,ih as fV,ble as fW,m5 as fX,RG as fY,Wbe as fZ,IG as f_,rm as fa,Ibe as fb,WE as fc,gn as fd,x_e as fe,So as ff,Ky as fg,Ewe as fh,H6 as fi,PE as fj,zs as fk,Fs as fl,SD as fm,twe as fn,Kj as fo,iwe as fp,Xi as fq,lp as fr,lh as fs,kle as ft,oh as fu,Obe as fv,tH as fw,Yy as fx,FE as fy,_e as fz,gl as g,_we as g$,KW as g0,rr as g1,z_ as g2,Ci as g3,Bu as g4,pi as g5,BD as g6,jf as g7,fl as g8,Vn as g9,hd as gA,si as gB,o1e as gC,On as gD,Sbe as gE,Op as gF,p as gG,h_e as gH,wt as gI,Z_e as gJ,jbe as gK,aG as gL,Eb as gM,RE as gN,eN as gO,lG as gP,Tbe as gQ,vq as gR,xbe as gS,G7 as gT,Ln as gU,T_e as gV,I9 as gW,K8 as gX,ST as gY,al as gZ,Im as g_,nB as ga,Kbe as gb,y_e as gc,rh as gd,Qd as ge,Ge as gf,Ac as gg,mre as gh,pre as gi,gre as gj,G_ as gk,qw as gl,Mh as gm,Gi as gn,JK as go,$be as gp,ws as gq,Ps as gr,Va as gs,Oh as gt,Wn as gu,zbe as gv,hY as gw,Rbe as gx,f_e as gy,Wle as gz,sr as h,cbe as h$,qt as h0,RT as h1,Ms as h2,je as h3,Ct as h4,mE as h5,gA as h6,Y8 as h7,A8 as h8,No as h9,aH as hA,Lb as hB,Nc as hC,yT as hD,pD as hE,yn as hF,$7 as hG,iF as hH,Ep as hI,o8 as hJ,cl as hK,P_e as hL,hz as hM,zE as hN,M_e as hO,Fh as hP,L_e as hQ,Nb as hR,$8 as hS,k_e as hT,o2 as hU,IT as hV,F_e as hW,Wd as hX,Kg as hY,Mu as hZ,Ee as h_,Cbe as ha,s1e as hb,ybe as hc,E2 as hd,Fx as he,Px as hf,D8 as hg,_I as hh,D_e as hi,xoe as hj,pwe as hk,Ys as hl,k0 as hm,W_e as hn,I as ho,q_e as hp,Te as hq,_F as hr,F1e as hs,Al as ht,G_e as hu,U_e as hv,j_e as hw,et as hx,Sa as hy,Mbe as hz,Br as i,Vbe as i0,Yg as i1,ni as i2,Be as i3,S_e as i4,Hl as i5,k1e as i6,NY as i7,fq as i8,I1e as i9,ep as ia,pJ as j,Y_e as k,Yj as l,FR as m,L1 as n,ce as o,Q as p,BI as q,en as r,NI as s,Ym as t,Xe as u,Qie as v,$R as w,G2 as x,di as y,rn as z};
1423
+ `+" ".repeat(e));var V4;(function(s){s.DEFAULT={allowTrailingComma:!1}})(V4||(V4={}));var Gpe=jpe,H4;(function(s){s[s.None=0]="None",s[s.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",s[s.UnexpectedEndOfString=2]="UnexpectedEndOfString",s[s.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",s[s.InvalidUnicode=4]="InvalidUnicode",s[s.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",s[s.InvalidCharacter=6]="InvalidCharacter"})(H4||(H4={}));var $4;(function(s){s[s.OpenBraceToken=1]="OpenBraceToken",s[s.CloseBraceToken=2]="CloseBraceToken",s[s.OpenBracketToken=3]="OpenBracketToken",s[s.CloseBracketToken=4]="CloseBracketToken",s[s.CommaToken=5]="CommaToken",s[s.ColonToken=6]="ColonToken",s[s.NullKeyword=7]="NullKeyword",s[s.TrueKeyword=8]="TrueKeyword",s[s.FalseKeyword=9]="FalseKeyword",s[s.StringLiteral=10]="StringLiteral",s[s.NumericLiteral=11]="NumericLiteral",s[s.LineCommentTrivia=12]="LineCommentTrivia",s[s.BlockCommentTrivia=13]="BlockCommentTrivia",s[s.LineBreakTrivia=14]="LineBreakTrivia",s[s.Trivia=15]="Trivia",s[s.Unknown=16]="Unknown",s[s.EOF=17]="EOF"})($4||($4={}));var z4;(function(s){s[s.InvalidSymbol=1]="InvalidSymbol",s[s.InvalidNumberFormat=2]="InvalidNumberFormat",s[s.PropertyNameExpected=3]="PropertyNameExpected",s[s.ValueExpected=4]="ValueExpected",s[s.ColonExpected=5]="ColonExpected",s[s.CommaExpected=6]="CommaExpected",s[s.CloseBraceExpected=7]="CloseBraceExpected",s[s.CloseBracketExpected=8]="CloseBracketExpected",s[s.EndOfFileExpected=9]="EndOfFileExpected",s[s.InvalidCommentToken=10]="InvalidCommentToken",s[s.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",s[s.UnexpectedEndOfString=12]="UnexpectedEndOfString",s[s.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",s[s.InvalidUnicode=14]="InvalidUnicode",s[s.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",s[s.InvalidCharacter=16]="InvalidCharacter"})(z4||(z4={}));function Kpe(s){return{getInitialState:()=>new T7(null,null,!1,null),tokenize:(e,t)=>s_e(s,e,t)}}var U4="delimiter.bracket.json",q4="delimiter.array.json",Ype="delimiter.colon.json",Zpe="delimiter.comma.json",Xpe="keyword.json",Qpe="keyword.json",Jpe="string.value.json",e_e="number.json",t_e="string.key.json",i_e="comment.block.json",n_e="comment.line.json",Vf=class E7{constructor(e,t){this.parent=e,this.type=t}static pop(e){return e?e.parent:null}static push(e,t){return new E7(e,t)}static equals(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;for(;e&&t;){if(e===t)return!0;if(e.type!==t.type)return!1;e=e.parent,t=t.parent}return!0}},T7=class oE{constructor(e,t,i,n){this._state=e,this.scanError=t,this.lastWasColon=i,this.parents=n}clone(){return new oE(this._state,this.scanError,this.lastWasColon,this.parents)}equals(e){return e===this?!0:!e||!(e instanceof oE)?!1:this.scanError===e.scanError&&this.lastWasColon===e.lastWasColon&&Vf.equals(this.parents,e.parents)}getStateData(){return this._state}setStateData(e){this._state=e}};function s_e(s,e,t,i=0){let n=0,r=!1;switch(t.scanError){case 2:e='"'+e,n=1;break;case 1:e="/*"+e,n=2;break}const o=Gpe(e);let a=t.lastWasColon,l=t.parents;const c={tokens:[],endState:t.clone()};for(;;){let d=i+o.getPosition(),u="";const h=o.scan();if(h===17)break;if(d===i+o.getPosition())throw new Error("Scanner did not advance, next 3 characters are: "+e.substr(o.getPosition(),3));switch(r&&(d-=n),r=n>0,h){case 1:l=Vf.push(l,0),u=U4,a=!1;break;case 2:l=Vf.pop(l),u=U4,a=!1;break;case 3:l=Vf.push(l,1),u=q4,a=!1;break;case 4:l=Vf.pop(l),u=q4,a=!1;break;case 6:u=Ype,a=!0;break;case 5:u=Zpe,a=!1;break;case 8:case 9:u=Xpe,a=!1;break;case 7:u=Qpe,a=!1;break;case 10:const g=(l?l.type:0)===1;u=a||g?Jpe:t_e,a=!1;break;case 11:u=e_e,a=!1;break}switch(h){case 12:u=n_e;break;case 13:u=i_e;break}c.endState=new T7(t.getStateData(),o.getTokenError(),a,l),c.tokens.push({startIndex:d,scopes:u})}return c}var Ks;function r_e(){return new Promise((s,e)=>{if(!Ks)return e("JSON not registered!");s(Ks)})}var o_e=class extends g7{constructor(s,e,t){super(s,e,t.onDidChange),this._disposables.push(ot.editor.onWillDisposeModel(i=>{this._resetSchema(i.uri)})),this._disposables.push(ot.editor.onDidChangeModelLanguage(i=>{this._resetSchema(i.model.uri)}))}_resetSchema(s){this._worker().then(e=>{e.resetSchema(s.toString())})}};function a_e(s){const e=[],t=[],i=new f7(s);e.push(i),Ks=(...o)=>i.getLanguageServiceWorker(...o);function n(){const{languageId:o,modeConfiguration:a}=s;D7(t),a.documentFormattingEdits&&t.push(ot.languages.registerDocumentFormattingEditProvider(o,new C7(Ks))),a.documentRangeFormattingEdits&&t.push(ot.languages.registerDocumentRangeFormattingEditProvider(o,new y7(Ks))),a.completionItems&&t.push(ot.languages.registerCompletionItemProvider(o,new m7(Ks,[" ",":",'"']))),a.hovers&&t.push(ot.languages.registerHoverProvider(o,new p7(Ks))),a.documentSymbols&&t.push(ot.languages.registerDocumentSymbolProvider(o,new b7(Ks))),a.tokens&&t.push(ot.languages.setTokensProvider(o,Kpe(!0))),a.colors&&t.push(ot.languages.registerColorProvider(o,new S7(Ks))),a.foldingRanges&&t.push(ot.languages.registerFoldingRangeProvider(o,new k7(Ks))),a.diagnostics&&t.push(new o_e(o,Ks,s)),a.selectionRanges&&t.push(ot.languages.registerSelectionRangeProvider(o,new L7(Ks)))}n(),e.push(ot.languages.setLanguageConfiguration(s.languageId,l_e));let r=s.modeConfiguration;return s.onDidChange(o=>{o.modeConfiguration!==r&&(r=o.modeConfiguration,n())}),e.push(j4(t)),j4(e)}function j4(s){return{dispose:()=>D7(s)}}function D7(s){for(;s.length;)s.pop().dispose()}var l_e={wordPattern:/(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string"]},{open:"[",close:"]",notIn:["string"]},{open:'"',close:'"',notIn:["string"]}]};const c_e=Object.freeze(Object.defineProperty({__proto__:null,CompletionAdapter:m7,DefinitionAdapter:Wpe,DiagnosticsAdapter:g7,DocumentColorAdapter:S7,DocumentFormattingEditProvider:C7,DocumentHighlightAdapter:Fpe,DocumentLinkAdapter:Upe,DocumentRangeFormattingEditProvider:y7,DocumentSymbolAdapter:b7,FoldingRangeAdapter:k7,HoverAdapter:p7,ReferenceAdapter:Vpe,RenameAdapter:Hpe,SelectionRangeAdapter:L7,WorkerManager:f7,fromPosition:Ol,fromRange:dI,getWorker:r_e,setupMode:a_e,toRange:Bn,toTextEdit:Rh},Symbol.toStringTag,{value:"Module"}));export{ve as $,GH as A,tt as B,Xe as C,A1 as D,z_e as E,Mi as F,o9 as G,Jo as H,jt as I,QK as J,mW as K,pt as L,yi as M,lE as N,hb as O,W as P,Mbe as Q,pe as R,ut as S,Me as T,Oe as U,RI as V,Rc as W,T_e as X,Ze as Y,U as Z,de as _,ai as a,P_e as a$,ie as a0,at as a1,va as a2,Vy as a3,ue as a4,Ac as a5,yT as a6,Y8 as a7,te as a8,bi as a9,rr as aA,YE as aB,Oh as aC,g1 as aD,Qie as aE,mE as aF,Kw as aG,pn as aH,sr as aI,ZA as aJ,C3 as aK,hi as aL,qw as aM,Ls as aN,Tl as aO,ml as aP,vt as aQ,Al as aR,vl as aS,M as aT,Sn as aU,A_e as aV,YX as aW,ip as aX,uD as aY,Js as aZ,ne as a_,np as aa,bl as ab,Te as ac,ws as ad,Ee as ae,BS as af,Mu as ag,Fs as ah,ka as ai,Yi as aj,EK as ak,Wr as al,$m as am,WE as an,Wn as ao,W5 as ap,v3 as aq,Br as ar,z5 as as,gl as at,FR as au,D_e as av,gD as aw,I0 as ax,GK as ay,G_ as az,ce as b,AI as b$,Hr as b0,Uh as b1,C8 as b2,qe as b3,et as b4,Yg as b5,pa as b6,ud as b7,fd as b8,IG as b9,Qe as bA,AR as bB,La as bC,ab as bD,_e as bE,he as bF,_A as bG,nu as bH,_0 as bI,lr as bJ,$y as bK,Xo as bL,fa as bM,Ye as bN,ga as bO,nt as bP,mn as bQ,_d as bR,OT as bS,ph as bT,k1e as bU,Qk as bV,LZ as bW,qt as bX,De as bY,Nr as bZ,zh as b_,Bo as ba,Ct as bb,yd as bc,ET as bd,Sa as be,Ja as bf,ru as bg,Bu as bh,Nb as bi,Ca as bj,wd as bk,TK as bl,ho as bm,E0 as bn,Qm as bo,Ep as bp,wt as bq,_2 as br,Nc as bs,yn as bt,kU as bu,vs as bv,Tm as bw,Cd as bx,F1e as by,Q as bz,ae as c,ko as c$,DY as c0,N_e as c1,Ns as c2,X2 as c3,Ky as c4,Gj as c5,Yy as c6,Kj as c7,FE as c8,Vr as c9,EZ as cA,Ar as cB,zE as cC,Xy as cD,Pt as cE,Ai as cF,Oy as cG,Cs as cH,CT as cI,FA as cJ,Km as cK,jK as cL,pG as cM,uR as cN,G2 as cO,yZ as cP,NG as cQ,Fc as cR,Wu as cS,WJ as cT,NS as cU,nr as cV,J2 as cW,Nbe as cX,cR as cY,td as cZ,Cee as c_,gT as ca,U_e as cb,xi as cc,tp as cd,RG as ce,B7 as cf,II as cg,ir as ch,al as ci,nm as cj,Yj as ck,Zj as cl,Kx as cm,Ge as cn,xo as co,L1 as cp,G7 as cq,Wa as cr,U8 as cs,aH as ct,Zy as cu,Jm as cv,st as cw,nd as cx,Jt as cy,vi as cz,uo as d,j_e as d$,m1e as d0,See as d1,Lee as d2,fo as d3,eN as d4,y_e as d5,g1e as d6,El as d7,jf as d8,wU as d9,ux as dA,Fd as dB,hne as dC,MT as dD,pJ as dE,_J as dF,bJ as dG,y8 as dH,v8 as dI,yJ as dJ,$e as dK,N0 as dL,zs as dM,SJ as dN,BE as dO,Gm as dP,J_ as dQ,tH as dR,m9 as dS,p9 as dT,Vn as dU,e5 as dV,I1e as dW,PE as dX,pbe as dY,gbe as dZ,mbe as d_,Qa as da,BI as db,eS as dc,Ci as dd,gm as de,fbe as df,ch as dg,WI as dh,vbe as di,wbe as dj,bbe as dk,_be as dl,b8 as dm,_8 as dn,dt as dp,ii as dq,ts as dr,oh as ds,Gf as dt,e0 as du,fl as dv,$be as dw,vq as dx,Cbe as dy,E_e as dz,p as e,JK as e$,$_e as e0,s1e as e1,J5 as e2,id as e3,Be as e4,su as e5,Dx as e6,zW as e7,G_e as e8,Ps as e9,TE as eA,tr as eB,AX as eC,PX as eD,E2 as eE,EX as eF,si as eG,o1e as eH,On as eI,RF as eJ,jE as eK,Cl as eL,Xi as eM,ea as eN,n9 as eO,ni as eP,r2 as eQ,sp as eR,lG as eS,zbe as eT,m5 as eU,ube as eV,CE as eW,TW as eX,KW as eY,Vbe as eZ,Wbe as e_,Gi as ea,Mh as eb,qa as ec,Gh as ed,Y_e as ee,kle as ef,Xs as eg,Rm as eh,Twe as ei,Dwe as ej,di as ek,O_e as el,kz as em,Lz as en,Fh as eo,x0 as ep,bd as eq,je as er,Ms as es,d0 as et,jg as eu,Ri as ev,pD as ew,Kh as ex,Zc as ey,Ji as ez,Ym as f,lT as f$,nY as f0,u_e as f1,$s as f2,RT as f3,qbe as f4,hY as f5,ih as f6,k0 as f7,IT as f8,Z_e as f9,Sbe as fA,Ug as fB,lp as fC,iF as fD,Nn as fE,R_e as fF,Xc as fG,Abe as fH,OF as fI,HW as fJ,Im as fK,Qr as fL,jbe as fM,xoe as fN,$R as fO,pwe as fP,Pb as fQ,Kg as fR,b_e as fS,NY as fT,Ube as fU,hL as fV,Os as fW,My as fX,oi as fY,gA as fZ,hbe as f_,TC as fa,L_e as fb,Qf as fc,NI as fd,Jn as fe,F7 as ff,M7 as fg,zx as fh,rm as fi,Ibe as fj,$I as fk,Dbe as fl,_I as fm,e8 as fn,rh as fo,pi as fp,b9 as fq,fT as fr,M_e as fs,Db as ft,er as fu,g8 as fv,Px as fw,D8 as fx,Fx as fy,Op as fz,gn as g,PI as g$,yb as g0,yl as g1,xb as g2,Rr as g3,qj as g4,D9 as g5,C2 as g6,aq as g7,z6 as g8,I9 as g9,aoe as gA,roe as gB,wM as gC,VI as gD,o2 as gE,F_e as gF,ose as gG,Ou as gH,Ll as gI,Ff as gJ,AT as gK,ke as gL,_we as gM,Mo as gN,Ys as gO,MI as gP,BD as gQ,n1e as gR,ep as gS,fq as gT,Eq as gU,Tq as gV,Lq as gW,It as gX,FI as gY,So as gZ,Lb as g_,cd as ga,twe as gb,iwe as gc,Obe as gd,rn as ge,hd as gf,wi as gg,SD as gh,Q1e as gi,_c as gj,q6 as gk,Py as gl,I_e as gm,No as gn,Rbe as go,ybe as gp,xbe as gq,p8 as gr,OI as gs,jk as gt,pM as gu,a3 as gv,r9 as gw,mM as gx,ooe as gy,soe as gz,en as h,$8 as h$,iT as h0,nB as h1,XE as h2,IU as h3,cbe as h4,Qd as h5,Va as h6,H6 as h7,Tr as h8,m_e as h9,$7 as hA,owe as hB,cr as hC,yr as hD,om as hE,ST as hF,K8 as hG,XA as hH,Z9 as hI,JA as hJ,Ewe as hK,sh as hL,QA as hM,cl as hN,k_e as hO,S_e as hP,VC as hQ,x_e as hR,fb as hS,t2 as hT,so as hU,z_ as hV,A8 as hW,aG as hX,Tbe as hY,Eb as hZ,Kbe as h_,h1 as ha,Fe as hb,kt as hc,f_e as hd,sY as he,ur as hf,gre as hg,pre as hh,mre as hi,_z as hj,Hl as hk,zf as hl,KF as hm,d5 as hn,RE as ho,ble as hp,hz as hq,o8 as hr,mK as hs,f1e as ht,lh as hu,dd as hv,ft as hw,We as hx,J1e as hy,iL as hz,z8 as i,e2 as i0,i2 as i1,ag as i2,Ka as i3,f0 as i4,Gu as i5,Ku as i6,Wle as i7,Ble as i8,Ple as i9,Mle as ia,am as j,lt as k,h_e as l,Ln as m,_F as n,q_e as o,ZE as p,I as q,W_e as r,q as s,fn as t,A as u,ui as v,Wd as w,gt as x,Qn as y,Yc as z};
@@ -1,4 +1,4 @@
1
- import{gU as O}from"./monaco-langs-DZ6hB11b.js";import{t as I}from"./index-UyOLwDd5.js";/*!-----------------------------------------------------------------------------
1
+ import{m as O}from"./monaco-langs-Decdf6BV.js";import{t as I}from"./index-DUrZbUbt.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -38,6 +38,7 @@
38
38
  --bg-input: #3c3c3c;
39
39
  --border: #3c3c3c;
40
40
  --border-sub: #333333;
41
+ --indent-line: #505050;
41
42
  --fg: #cccccc;
42
43
  --fg-muted: #858585;
43
44
  --fg-dim: #555555;
@@ -72,8 +73,8 @@
72
73
  --bg-input: #ffffff;
73
74
  --border: #cecece;
74
75
  --border-sub: #e0e0e0;
76
+ --indent-line: #c8c8c8;
75
77
  --fg: #3b3b3b;
76
- --fg-muted: #6e6e6e;
77
78
  --fg-dim: #aaaaaa;
78
79
  --fg-text: #2b2b2b;
79
80
  --fg-brand: #0070c1;
@@ -106,8 +107,8 @@
106
107
  --bg-input: #ffffff;
107
108
  --border: #cecece;
108
109
  --border-sub: #e0e0e0;
110
+ --indent-line: #c8c8c8;
109
111
  --fg: #3b3b3b;
110
- --fg-muted: #6e6e6e;
111
112
  --fg-dim: #aaaaaa;
112
113
  --fg-text: #2b2b2b;
113
114
  --fg-brand: #0070c1;
@@ -153,10 +154,10 @@
153
154
  }
154
155
  })();
155
156
  </script>
156
- <script type="module" crossorigin src="/assets/index-UyOLwDd5.js"></script>
157
- <link rel="modulepreload" crossorigin href="/assets/monaco-langs-DZ6hB11b.js">
157
+ <script type="module" crossorigin src="/assets/index-DUrZbUbt.js"></script>
158
+ <link rel="modulepreload" crossorigin href="/assets/monaco-langs-Decdf6BV.js">
158
159
  <link rel="stylesheet" crossorigin href="/assets/monaco-langs-DyX1CsEw.css">
159
- <link rel="stylesheet" crossorigin href="/assets/index-CxNH_rV4.css">
160
+ <link rel="stylesheet" crossorigin href="/assets/index-B5b-7d7y.css">
160
161
  </head>
161
162
  <body>
162
163
  <div id="app"></div>
package/package.json CHANGED
@@ -1,89 +1,87 @@
1
1
  {
2
- "name": "smart-home-engine",
3
- "version": "0.13.0",
4
- "description": "Node.js based script runner for use in MQTT based Smart Home environments",
5
- "main": "src/index.js",
6
- "scripts": {
7
- "test": "cross-env NODE_OPTIONS=\"--no-warnings\" jest --testPathPattern=test/unit --forceExit",
8
- "test:integration": "cross-env NODE_OPTIONS=\"--no-warnings\" jest --testPathPattern=test/integration --forceExit",
9
- "test:all": "cross-env NODE_OPTIONS=\"--no-warnings\" jest --forceExit",
10
- "test:coverage": "cross-env NODE_OPTIONS=\"--no-warnings\" jest --coverage --forceExit",
11
- "test:verbose": "cross-env NODE_OPTIONS=\"--no-warnings\" jest --verbose --forceExit",
12
- "lint": "eslint --cache --cache-location .cache/.eslintcache .",
13
- "lint:fix": "eslint --cache --cache-location .cache/.eslintcache --fix .",
14
- "format": "prettier --cache --cache-location .cache/.prettiercache --write .",
15
- "format:check": "prettier --cache --cache-location .cache/.prettiercache --check .",
16
- "build:web": "cd web \u0026\u0026 npm install \u0026\u0026 npm run build"
17
- },
18
- "bin": {
19
- "she": "src/index.js"
20
- },
21
- "files": [
22
- "src/",
23
- "sandbox/",
24
- "dist/web/"
25
- ],
26
- "author": "Sebastian \u0027hobbyquaker\u0027 Raff \u003chobbyquaker@gmail.com\u003e",
27
- "license": "MIT",
28
- "dependencies": {
29
- "bcryptjs": "^2.4.3",
30
- "@elastic/elasticsearch": "^9.4.2",
31
- "@influxdata/influxdb-client": "^1.35.0",
32
- "@matter/main": "^0.17.0",
33
- "chokidar": "^4.0.0",
34
- "express": "^5.2.1",
35
- "ioredis": "^5.11.0",
36
- "mqtt": "^5.0.0",
37
- "node-schedule": "^2.0.0",
38
- "pino": "^9.0.0",
39
- "pino-pretty": "^13.0.0",
40
- "suncalc": "^1.9.0",
41
- "ws": "^8.21.0",
42
- "yargs": "^17.0.0"
43
- },
44
- "engines": {
45
- "node": "\u003e=20.0.0"
46
- },
47
- "devDependencies": {
48
- "@eslint/js": "^9.0.0",
49
- "@sinonjs/fake-timers": "^11.0.0",
50
- "@types/jest": "^29.5.0",
51
- "@types/node": "^22.0.0",
52
- "aedes": "^0.50.0",
53
- "cross-env": "^7.0.3",
54
- "eslint": "^9.0.0",
55
- "eslint-config-prettier": "^10.1.8",
56
- "eslint-plugin-n": "^17.0.0",
57
- "eslint-plugin-prettier": "^5.0.0",
58
- "globals": "^16.0.0",
59
- "jest": "^29.7.0",
60
- "prettier": "^3.0.0"
61
- },
62
- "directories": {
63
- "doc": "doc"
64
- },
65
- "repository": {
66
- "type": "git",
67
- "url": "https://github.com/hobbyquaker/she"
68
- },
69
- "keywords": [
70
- "MQTT",
71
- "javascript",
72
- "node.js",
73
- "npm",
74
- "sandbox",
75
- "vm",
76
- "Smart",
77
- "Home",
78
- "Internet",
79
- "of",
80
- "Things",
81
- "IoT"
82
- ],
83
- "bugs": {
84
- "url": "https://github.com/hobbyquaker/she/issues"
85
- },
86
- "homepage": "https://github.com/hobbyquaker/she"
2
+ "name": "smart-home-engine",
3
+ "version": "0.15.18",
4
+ "description": "Node.js based script runner for use in MQTT based Smart Home environments",
5
+ "main": "src/index.js",
6
+ "scripts": {
7
+ "test": "cross-env NODE_OPTIONS=\"--no-warnings\" jest --testPathPattern=test/unit --forceExit",
8
+ "test:integration": "cross-env NODE_OPTIONS=\"--no-warnings\" jest --testPathPattern=test/integration --forceExit",
9
+ "test:all": "cross-env NODE_OPTIONS=\"--no-warnings\" jest --forceExit",
10
+ "test:coverage": "cross-env NODE_OPTIONS=\"--no-warnings\" jest --coverage --forceExit",
11
+ "test:verbose": "cross-env NODE_OPTIONS=\"--no-warnings\" jest --verbose --forceExit",
12
+ "lint": "eslint --cache --cache-location .cache/.eslintcache .",
13
+ "lint:fix": "eslint --cache --cache-location .cache/.eslintcache --fix .",
14
+ "format": "prettier --cache --cache-location .cache/.prettiercache --write .",
15
+ "format:check": "prettier --cache --cache-location .cache/.prettiercache --check .",
16
+ "build:web": "cd web && npm install && npm run build"
17
+ },
18
+ "bin": {
19
+ "she": "src/index.js"
20
+ },
21
+ "files": [
22
+ "src/",
23
+ "sandbox/",
24
+ "dist/web/"
25
+ ],
26
+ "author": "Sebastian 'hobbyquaker' Raff <hobbyquaker@gmail.com>",
27
+ "license": "MIT",
28
+ "dependencies": {
29
+ "bcryptjs": "^2.4.3",
30
+ "@elastic/elasticsearch": "^9.4.2",
31
+ "@influxdata/influxdb-client": "^1.35.0",
32
+ "@matter/main": "^0.17.0",
33
+ "chokidar": "^4.0.0",
34
+ "express": "^5.2.1",
35
+ "ioredis": "^5.11.0",
36
+ "mqtt": "^5.0.0",
37
+ "node-schedule": "^2.0.0",
38
+ "pino": "^9.0.0",
39
+ "pino-pretty": "^13.0.0",
40
+ "suncalc": "^1.9.0",
41
+ "ws": "^8.21.0",
42
+ "yargs": "^17.0.0"
43
+ },
44
+ "engines": {
45
+ "node": ">=20.0.0"
46
+ },
47
+ "devDependencies": {
48
+ "@eslint/js": "^9.0.0",
49
+ "@sinonjs/fake-timers": "^11.0.0",
50
+ "@types/jest": "^29.5.0",
51
+ "@types/node": "^22.0.0",
52
+ "aedes": "^0.50.0",
53
+ "cross-env": "^7.0.3",
54
+ "eslint": "^9.0.0",
55
+ "eslint-config-prettier": "^10.1.8",
56
+ "eslint-plugin-n": "^17.0.0",
57
+ "eslint-plugin-prettier": "^5.0.0",
58
+ "globals": "^16.0.0",
59
+ "jest": "^29.7.0",
60
+ "prettier": "^3.0.0"
61
+ },
62
+ "directories": {
63
+ "doc": "doc"
64
+ },
65
+ "repository": {
66
+ "type": "git",
67
+ "url": "https://github.com/hobbyquaker/she"
68
+ },
69
+ "keywords": [
70
+ "MQTT",
71
+ "javascript",
72
+ "node.js",
73
+ "npm",
74
+ "sandbox",
75
+ "vm",
76
+ "Smart",
77
+ "Home",
78
+ "Internet",
79
+ "of",
80
+ "Things",
81
+ "IoT"
82
+ ],
83
+ "bugs": {
84
+ "url": "https://github.com/hobbyquaker/she/issues"
85
+ },
86
+ "homepage": "https://github.com/hobbyquaker/she"
87
87
  }
88
-
89
-
package/src/config.js CHANGED
@@ -19,6 +19,10 @@ const config = require('yargs')
19
19
  default: path.join(os.homedir(), '.she', 'db'),
20
20
  type: 'string',
21
21
  })
22
+ .option('matter-storage', {
23
+ describe: 'enable Matter controller; pass a directory path or true to use ~/.she/matter',
24
+ type: 'string',
25
+ })
22
26
  .option('port', {
23
27
  alias: 'p',
24
28
  describe: 'HTTP server port (0 = OS-assigned random port)',
package/src/index.js CHANGED
@@ -209,6 +209,42 @@ let connected = false;
209
209
  require('./web/mqtt-api').init(store, () => mqtt);
210
210
  require('./web/ai-api').init(store);
211
211
 
212
+ // MQTT message rate counter — reset on each stats poll
213
+ let _mqttMsgCount = 0;
214
+ let _mqttMsgTs = Date.now();
215
+
216
+ // Register runtime stats provider for GET /she/status
217
+ require('./web/server').setStatsProvider(() => {
218
+ let topics = 0;
219
+ // eslint-disable-next-line no-unused-vars
220
+ for (const _ of store.mqttEntries()) topics++;
221
+ const now = Date.now();
222
+ const elapsed = (now - _mqttMsgTs) / 1000;
223
+ const mqttMsgPerSec = elapsed > 0 ? Math.round((_mqttMsgCount / elapsed) * 10) / 10 : 0;
224
+ _mqttMsgCount = 0;
225
+ _mqttMsgTs = now;
226
+ let matterNodes = 0;
227
+ let matterEndpoints = 0;
228
+ if (config.matterStorage) {
229
+ try {
230
+ const mc = require('./matter/controller');
231
+ const paired = mc.listPaired();
232
+ matterNodes = paired.length;
233
+ for (const { nodeId } of paired) {
234
+ try { matterEndpoints += mc.getEndpoints(nodeId).length; } catch { /* offline */ }
235
+ }
236
+ } catch { /* controller not ready */ }
237
+ }
238
+ return {
239
+ scripts: Object.keys(scripts).length,
240
+ topics,
241
+ mqttMsgPerSec,
242
+ matterEnabled: !!config.matterStorage,
243
+ matterNodes,
244
+ matterEndpoints,
245
+ };
246
+ });
247
+
212
248
  if (!config.url) {
213
249
  log.warn('no MQTT broker URL configured — set "url" in ' + path.join(require('os').homedir(), '.she', 'config.json'));
214
250
  }
@@ -238,6 +274,7 @@ if (config.url) {
238
274
  });
239
275
 
240
276
  mqtt.on('message', (topic, payload, msg) => {
277
+ _mqttMsgCount++;
241
278
  if (shedb.handleMqttMessage(topic, payload)) return;
242
279
 
243
280
  const state = require('./lib/parse-payload')(payload);
@@ -278,7 +315,8 @@ if (config.url) {
278
315
 
279
316
  // sheDB — only init when --db-path is given
280
317
  if (config.dbPath) {
281
- shedb.init({ dbPath: config.dbPath, dbPublish: config.dbPublish || false, dbRetain: config.dbRetain || false, dbPrefix: config.dbPrefix || 'she/db/', mqttName: config.name, mqtt, log, broadcast });
318
+ const dbPathResolved = config.dbPath.replace(/^~(?=[/\\]|$)/, require('os').homedir());
319
+ shedb.init({ dbPath: dbPathResolved, dbPublish: config.dbPublish || false, dbRetain: config.dbRetain || false, dbPrefix: config.dbPrefix || 'she/db/', mqttName: config.name, mqtt, log, broadcast });
282
320
  }
283
321
 
284
322
  // Redis write-through cache — only init when config.redis.url is given
@@ -302,10 +340,19 @@ if (config.elastic) {
302
340
  if (config.matterStorage) {
303
341
  const { ensureStorageDir } = require('./lib/storage');
304
342
  const matterController = require('./matter/controller');
305
- const matterStoragePath = typeof config.matterStorage === 'string' ? config.matterStorage : ensureStorageDir('matter');
343
+ let matterStoragePath;
344
+ if (typeof config.matterStorage === 'string') {
345
+ matterStoragePath = config.matterStorage.replace(/^~(?=[/\\]|$)/, require('os').homedir());
346
+ fs.mkdirSync(matterStoragePath, { recursive: true });
347
+ } else {
348
+ matterStoragePath = ensureStorageDir('matter');
349
+ }
350
+ log.info('matter controller starting, storage:', matterStoragePath);
306
351
  matterController.init(matterStoragePath, log, broadcast).catch((err) => {
307
- log.error('matter controller init failed:', err.message);
352
+ log.error('matter controller init failed:', err.message, err.stack);
308
353
  });
354
+ } else {
355
+ log.warn('matter controller disabled — set matterStorage in config.json to enable');
309
356
  }
310
357
 
311
358
  // Start scripts immediately — MQTT retained state will populate the store asynchronously