this.me 3.0.33 → 3.1.0

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/me.umd.js CHANGED
@@ -1,8 +1 @@
1
- (function(V,j){typeof exports=="object"&&typeof module<"u"?module.exports=j():typeof define=="function"&&define.amd?define(j):(V=typeof globalThis<"u"?globalThis:V||self,V.Me=j())})(this,(function(){"use strict";function V(c){return{__ptr:c}}function j(c){return!!c&&typeof c=="object"&&typeof c.__ptr=="string"&&c.__ptr.length>0}function pe(c){return{__id:c}}function Qt(c){return!!c&&typeof c=="object"&&typeof c.__id=="string"&&c.__id.length>0}function ye(c){return!!c&&typeof c=="object"&&typeof c.path=="string"&&typeof c.hash=="string"&&typeof c.timestamp=="number"}function N(c){return c.length===0?{scope:[],leaf:null}:{scope:c.slice(0,-1),leaf:c[c.length-1]}}function le(c,r){if(r.length>c.length)return!1;for(let e=0;e<r.length;e++)if(c[e]!==r[e])return!1;return!0}function ce(c){const r=c.trim().toLowerCase();if(r.length<3||r.length>63)throw new Error(`Invalid username length: ${r.length}. Expected 3..63 characters.`);if(!/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(r))throw new Error(`Invalid username. Use only [a-z0-9-], and start/end with [a-z0-9]. Got: ${c}`);if(r.includes("--"))throw new Error(`Invalid username. "--" is not allowed. Got: ${c}`);return r}var ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ge(c){return c&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c}var Xt={exports:{}};/**
2
- * [js-sha3]{@link https://github.com/emn178/js-sha3}
3
- *
4
- * @version 0.9.3
5
- * @author Chen, Yi-Cyuan [emn178@gmail.com]
6
- * @copyright Chen, Yi-Cyuan 2015-2023
7
- * @license MIT
8
- */var ae;function be(){return ae||(ae=1,(function(c){(function(){var r="input is invalid type",e="finalize already called",a=typeof window=="object",i=a?window:{};i.JS_SHA3_NO_WINDOW&&(a=!1);var f=!a&&typeof self=="object",p=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;p?i=ve:f&&(i=self);for(var b=!i.JS_SHA3_NO_COMMON_JS&&!0&&c.exports,y=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",g="0123456789abcdef".split(""),S=[31,7936,2031616,520093696],O=[4,1024,262144,67108864],J=[1,256,65536,16777216],R=[6,1536,393216,100663296],P=[0,8,16,24],W=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],E=[224,256,384,512],H=[128,256],L=["hex","buffer","arrayBuffer","array","digest"],Y={128:168,256:136},ne=i.JS_SHA3_NO_NODE_JS||!Array.isArray?function(t){return Object.prototype.toString.call(t)==="[object Array]"}:Array.isArray,Z=y&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)?function(t){return typeof t=="object"&&t.buffer&&t.buffer.constructor===ArrayBuffer}:ArrayBuffer.isView,k=function(t){var n=typeof t;if(n==="string")return[t,!0];if(n!=="object"||t===null)throw new Error(r);if(y&&t.constructor===ArrayBuffer)return[new Uint8Array(t),!1];if(!ne(t)&&!Z(t))throw new Error(r);return[t,!1]},x=function(t){return k(t)[0].length===0},C=function(t){for(var n=[],o=0;o<t.length;++o)n[o]=t[o];return n},w=function(t,n,o){return function(l){return new B(t,n,t).update(l)[o]()}},_=function(t,n,o){return function(l,u){return new B(t,n,u).update(l)[o]()}},F=function(t,n,o){return function(l,u,h,d){return T["cshake"+t].update(l,u,h,d)[o]()}},I=function(t,n,o){return function(l,u,h,d){return T["kmac"+t].update(l,u,h,d)[o]()}},K=function(t,n,o,l){for(var u=0;u<L.length;++u){var h=L[u];t[h]=n(o,l,h)}return t},M=function(t,n){var o=w(t,n,"hex");return o.create=function(){return new B(t,n,t)},o.update=function(l){return o.create().update(l)},K(o,w,t,n)},Ae=function(t,n){var o=_(t,n,"hex");return o.create=function(l){return new B(t,n,l)},o.update=function(l,u){return o.create(u).update(l)},K(o,_,t,n)},Pe=function(t,n){var o=Y[t],l=F(t,n,"hex");return l.create=function(u,h,d){return x(h)&&x(d)?T["shake"+t].create(u):new B(t,n,u).bytepad([h,d],o)},l.update=function(u,h,d,s){return l.create(h,d,s).update(u)},K(l,F,t,n)},we=function(t,n){var o=Y[t],l=I(t,n,"hex");return l.create=function(u,h,d){return new oe(t,n,h).bytepad(["KMAC",d],o).bytepad([u],o)},l.update=function(u,h,d,s){return l.create(u,d,s).update(h)},K(l,I,t,n)},se=[{name:"keccak",padding:J,bits:E,createMethod:M},{name:"sha3",padding:R,bits:E,createMethod:M},{name:"shake",padding:S,bits:H,createMethod:Ae},{name:"cshake",padding:O,bits:H,createMethod:Pe},{name:"kmac",padding:O,bits:H,createMethod:we}],T={},G=[],z=0;z<se.length;++z)for(var U=se[z],Q=U.bits,$=0;$<Q.length;++$){var ie=U.name+"_"+Q[$];if(G.push(ie),T[ie]=U.createMethod(Q[$],U.padding),U.name!=="sha3"){var de=U.name+Q[$];G.push(de),T[de]=T[ie]}}function B(t,n,o){this.blocks=[],this.s=[],this.padding=n,this.outputBits=o,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=o>>5,this.extraBytes=(o&31)>>3;for(var l=0;l<50;++l)this.s[l]=0}B.prototype.update=function(t){if(this.finalized)throw new Error(e);var n=k(t);t=n[0];for(var o=n[1],l=this.blocks,u=this.byteCount,h=t.length,d=this.blockCount,s=0,A=this.s,v,m;s<h;){if(this.reset)for(this.reset=!1,l[0]=this.block,v=1;v<d+1;++v)l[v]=0;if(o)for(v=this.start;s<h&&v<u;++s)m=t.charCodeAt(s),m<128?l[v>>2]|=m<<P[v++&3]:m<2048?(l[v>>2]|=(192|m>>6)<<P[v++&3],l[v>>2]|=(128|m&63)<<P[v++&3]):m<55296||m>=57344?(l[v>>2]|=(224|m>>12)<<P[v++&3],l[v>>2]|=(128|m>>6&63)<<P[v++&3],l[v>>2]|=(128|m&63)<<P[v++&3]):(m=65536+((m&1023)<<10|t.charCodeAt(++s)&1023),l[v>>2]|=(240|m>>18)<<P[v++&3],l[v>>2]|=(128|m>>12&63)<<P[v++&3],l[v>>2]|=(128|m>>6&63)<<P[v++&3],l[v>>2]|=(128|m&63)<<P[v++&3]);else for(v=this.start;s<h&&v<u;++s)l[v>>2]|=t[s]<<P[v++&3];if(this.lastByteIndex=v,v>=u){for(this.start=v-u,this.block=l[d],v=0;v<d;++v)A[v]^=l[v];q(A),this.reset=!0}else this.start=v}return this},B.prototype.encode=function(t,n){var o=t&255,l=1,u=[o];for(t=t>>8,o=t&255;o>0;)u.unshift(o),t=t>>8,o=t&255,++l;return n?u.push(l):u.unshift(l),this.update(u),u.length},B.prototype.encodeString=function(t){var n=k(t);t=n[0];var o=n[1],l=0,u=t.length;if(o)for(var h=0;h<t.length;++h){var d=t.charCodeAt(h);d<128?l+=1:d<2048?l+=2:d<55296||d>=57344?l+=3:(d=65536+((d&1023)<<10|t.charCodeAt(++h)&1023),l+=4)}else l=u;return l+=this.encode(l*8),this.update(t),l},B.prototype.bytepad=function(t,n){for(var o=this.encode(n),l=0;l<t.length;++l)o+=this.encodeString(t[l]);var u=(n-o%n)%n,h=[];return h.length=u,this.update(h),this},B.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,n=this.lastByteIndex,o=this.blockCount,l=this.s;if(t[n>>2]|=this.padding[n&3],this.lastByteIndex===this.byteCount)for(t[0]=t[o],n=1;n<o+1;++n)t[n]=0;for(t[o-1]|=2147483648,n=0;n<o;++n)l[n]^=t[n];q(l)}},B.prototype.toString=B.prototype.hex=function(){this.finalize();for(var t=this.blockCount,n=this.s,o=this.outputBlocks,l=this.extraBytes,u=0,h=0,d="",s;h<o;){for(u=0;u<t&&h<o;++u,++h)s=n[u],d+=g[s>>4&15]+g[s&15]+g[s>>12&15]+g[s>>8&15]+g[s>>20&15]+g[s>>16&15]+g[s>>28&15]+g[s>>24&15];h%t===0&&(n=C(n),q(n),u=0)}return l&&(s=n[u],d+=g[s>>4&15]+g[s&15],l>1&&(d+=g[s>>12&15]+g[s>>8&15]),l>2&&(d+=g[s>>20&15]+g[s>>16&15])),d},B.prototype.arrayBuffer=function(){this.finalize();var t=this.blockCount,n=this.s,o=this.outputBlocks,l=this.extraBytes,u=0,h=0,d=this.outputBits>>3,s;l?s=new ArrayBuffer(o+1<<2):s=new ArrayBuffer(d);for(var A=new Uint32Array(s);h<o;){for(u=0;u<t&&h<o;++u,++h)A[h]=n[u];h%t===0&&(n=C(n),q(n))}return l&&(A[h]=n[u],s=s.slice(0,d)),s},B.prototype.buffer=B.prototype.arrayBuffer,B.prototype.digest=B.prototype.array=function(){this.finalize();for(var t=this.blockCount,n=this.s,o=this.outputBlocks,l=this.extraBytes,u=0,h=0,d=[],s,A;h<o;){for(u=0;u<t&&h<o;++u,++h)s=h<<2,A=n[u],d[s]=A&255,d[s+1]=A>>8&255,d[s+2]=A>>16&255,d[s+3]=A>>24&255;h%t===0&&(n=C(n),q(n))}return l&&(s=h<<2,A=n[u],d[s]=A&255,l>1&&(d[s+1]=A>>8&255),l>2&&(d[s+2]=A>>16&255)),d};function oe(t,n,o){B.call(this,t,n,o)}oe.prototype=new B,oe.prototype.finalize=function(){return this.encode(this.outputBits,!0),B.prototype.finalize.call(this)};var q=function(t){var n,o,l,u,h,d,s,A,v,m,X,tt,et,rt,nt,it,ot,lt,ct,at,ft,ut,ht,st,dt,pt,yt,vt,gt,bt,St,kt,mt,_t,xt,Bt,At,Pt,wt,Ct,Et,Ot,It,Ft,Nt,jt,Kt,Mt,Tt,zt,Dt,Rt,Wt,Jt,Ht,Ut,Vt,Gt,$t,qt,Lt,Yt,Zt;for(l=0;l<48;l+=2)u=t[0]^t[10]^t[20]^t[30]^t[40],h=t[1]^t[11]^t[21]^t[31]^t[41],d=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],A=t[4]^t[14]^t[24]^t[34]^t[44],v=t[5]^t[15]^t[25]^t[35]^t[45],m=t[6]^t[16]^t[26]^t[36]^t[46],X=t[7]^t[17]^t[27]^t[37]^t[47],tt=t[8]^t[18]^t[28]^t[38]^t[48],et=t[9]^t[19]^t[29]^t[39]^t[49],n=tt^(d<<1|s>>>31),o=et^(s<<1|d>>>31),t[0]^=n,t[1]^=o,t[10]^=n,t[11]^=o,t[20]^=n,t[21]^=o,t[30]^=n,t[31]^=o,t[40]^=n,t[41]^=o,n=u^(A<<1|v>>>31),o=h^(v<<1|A>>>31),t[2]^=n,t[3]^=o,t[12]^=n,t[13]^=o,t[22]^=n,t[23]^=o,t[32]^=n,t[33]^=o,t[42]^=n,t[43]^=o,n=d^(m<<1|X>>>31),o=s^(X<<1|m>>>31),t[4]^=n,t[5]^=o,t[14]^=n,t[15]^=o,t[24]^=n,t[25]^=o,t[34]^=n,t[35]^=o,t[44]^=n,t[45]^=o,n=A^(tt<<1|et>>>31),o=v^(et<<1|tt>>>31),t[6]^=n,t[7]^=o,t[16]^=n,t[17]^=o,t[26]^=n,t[27]^=o,t[36]^=n,t[37]^=o,t[46]^=n,t[47]^=o,n=m^(u<<1|h>>>31),o=X^(h<<1|u>>>31),t[8]^=n,t[9]^=o,t[18]^=n,t[19]^=o,t[28]^=n,t[29]^=o,t[38]^=n,t[39]^=o,t[48]^=n,t[49]^=o,rt=t[0],nt=t[1],jt=t[11]<<4|t[10]>>>28,Kt=t[10]<<4|t[11]>>>28,vt=t[20]<<3|t[21]>>>29,gt=t[21]<<3|t[20]>>>29,qt=t[31]<<9|t[30]>>>23,Lt=t[30]<<9|t[31]>>>23,Ot=t[40]<<18|t[41]>>>14,It=t[41]<<18|t[40]>>>14,_t=t[2]<<1|t[3]>>>31,xt=t[3]<<1|t[2]>>>31,it=t[13]<<12|t[12]>>>20,ot=t[12]<<12|t[13]>>>20,Mt=t[22]<<10|t[23]>>>22,Tt=t[23]<<10|t[22]>>>22,bt=t[33]<<13|t[32]>>>19,St=t[32]<<13|t[33]>>>19,Yt=t[42]<<2|t[43]>>>30,Zt=t[43]<<2|t[42]>>>30,Jt=t[5]<<30|t[4]>>>2,Ht=t[4]<<30|t[5]>>>2,Bt=t[14]<<6|t[15]>>>26,At=t[15]<<6|t[14]>>>26,lt=t[25]<<11|t[24]>>>21,ct=t[24]<<11|t[25]>>>21,zt=t[34]<<15|t[35]>>>17,Dt=t[35]<<15|t[34]>>>17,kt=t[45]<<29|t[44]>>>3,mt=t[44]<<29|t[45]>>>3,st=t[6]<<28|t[7]>>>4,dt=t[7]<<28|t[6]>>>4,Ut=t[17]<<23|t[16]>>>9,Vt=t[16]<<23|t[17]>>>9,Pt=t[26]<<25|t[27]>>>7,wt=t[27]<<25|t[26]>>>7,at=t[36]<<21|t[37]>>>11,ft=t[37]<<21|t[36]>>>11,Rt=t[47]<<24|t[46]>>>8,Wt=t[46]<<24|t[47]>>>8,Ft=t[8]<<27|t[9]>>>5,Nt=t[9]<<27|t[8]>>>5,pt=t[18]<<20|t[19]>>>12,yt=t[19]<<20|t[18]>>>12,Gt=t[29]<<7|t[28]>>>25,$t=t[28]<<7|t[29]>>>25,Ct=t[38]<<8|t[39]>>>24,Et=t[39]<<8|t[38]>>>24,ut=t[48]<<14|t[49]>>>18,ht=t[49]<<14|t[48]>>>18,t[0]=rt^~it&lt,t[1]=nt^~ot&ct,t[10]=st^~pt&vt,t[11]=dt^~yt&gt,t[20]=_t^~Bt&Pt,t[21]=xt^~At&wt,t[30]=Ft^~jt&Mt,t[31]=Nt^~Kt&Tt,t[40]=Jt^~Ut&Gt,t[41]=Ht^~Vt&$t,t[2]=it^~lt&at,t[3]=ot^~ct&ft,t[12]=pt^~vt&bt,t[13]=yt^~gt&St,t[22]=Bt^~Pt&Ct,t[23]=At^~wt&Et,t[32]=jt^~Mt&zt,t[33]=Kt^~Tt&Dt,t[42]=Ut^~Gt&qt,t[43]=Vt^~$t&Lt,t[4]=lt^~at&ut,t[5]=ct^~ft&ht,t[14]=vt^~bt&kt,t[15]=gt^~St&mt,t[24]=Pt^~Ct&Ot,t[25]=wt^~Et&It,t[34]=Mt^~zt&Rt,t[35]=Tt^~Dt&Wt,t[44]=Gt^~qt&Yt,t[45]=$t^~Lt&Zt,t[6]=at^~ut&rt,t[7]=ft^~ht&nt,t[16]=bt^~kt&st,t[17]=St^~mt&dt,t[26]=Ct^~Ot&_t,t[27]=Et^~It&xt,t[36]=zt^~Rt&Ft,t[37]=Dt^~Wt&Nt,t[46]=qt^~Yt&Jt,t[47]=Lt^~Zt&Ht,t[8]=ut^~rt&it,t[9]=ht^~nt&ot,t[18]=kt^~st&pt,t[19]=mt^~dt&yt,t[28]=Ot^~_t&Bt,t[29]=It^~xt&At,t[38]=Rt^~Ft&jt,t[39]=Wt^~Nt&Kt,t[48]=Yt^~Jt&Ut,t[49]=Zt^~Ht&Vt,t[0]^=W[l],t[1]^=W[l+1]};if(b)c.exports=T;else for(z=0;z<G.length;++z)i[G[z]]=T[G[z]]})()})(Xt)),Xt.exports}var Se=be();const ke=ge(Se),{keccak256:fe}=ke;function te(c){return new TextEncoder().encode(c)}function me(c){const r=c.startsWith("0x")?c.slice(2):c,e=new Uint8Array(r.length/2);for(let a=0;a<e.length;a++)e[a]=parseInt(r.substring(a*2,a*2+2),16);return e}function _e(c){let r="";for(let e=0;e<c.length;e++)r+=c[e].toString(16).padStart(2,"0");return"0x"+r}function ue(c,r,e){const a=JSON.stringify(c),i=te(a),f=fe(r+":"+e.join(".")),p=te(f),b=new Uint8Array(i.length);for(let y=0;y<i.length;y++)b[y]=i[y]^p[y%p.length];return _e(b)}function ee(c,r,e){try{const a=me(c),i=fe(r+":"+e.join(".")),f=te(i),p=new Uint8Array(a.length);for(let y=0;y<a.length;y++)p[y]=a[y]^f[y%f.length];const b=new TextDecoder().decode(p);return JSON.parse(b)}catch{return null}}function xe(c){if(typeof c!="string"||!c.startsWith("0x"))return!1;const r=c.slice(2);return r.length<2||r.length%2!==0?!1:/^[0-9a-fA-F]+$/.test(r)}function Be(c,r,e){if(r.length===0){if(e.length===1&&typeof e[0]=="string"){const S=e[0].trim(),O=S.startsWith("_")||S.startsWith("~")||S.startsWith("@"),J=S.includes("."),R=/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(S);if(J||O||R){const P=S.split(".").filter(Boolean);return c.readPath(P)}}if(e.length===0)return c.createProxy([]);const y=c.normalizeArgs(e),g=c.postulate([],y);return g!==void 0?g:c.createProxy([])}const a=c.normalizeArgs(e),i=c.postulate(r,a),{scope:f,leaf:p}=c.splitPath(r),b=p?c.opKind(p):null;if(c.isThought(i)){const y=b?f:r;return c.createProxy(y)}return i!==void 0?i:c.createProxy(r)}const he="+";function D(c){let r=2166136261;for(let e=0;e<c.length;e++)r^=c.charCodeAt(e),r=Math.imul(r,16777619);return("00000000"+(r>>>0).toString(16)).slice(-8)}class re{constructor(r){this.localSecrets={},this.localNoises={},this.encryptedBranches={},this.index={},this._shortTermMemory=[],this.operators={_:{kind:"secret"},"~":{kind:"noise"},__:{kind:"pointer"},"->":{kind:"pointer"},"@":{kind:"identity"},"=":{kind:"eval"},"?":{kind:"query"},"-":{kind:"remove"}},this.localSecrets={},this.localNoises={},this.encryptedBranches={},this.index={},this.operators={_:{kind:"secret"},"~":{kind:"noise"},__:{kind:"pointer"},"->":{kind:"pointer"},"@":{kind:"identity"},"=":{kind:"eval"},"?":{kind:"query"},"-":{kind:"remove"}},this._shortTermMemory=[],r!==void 0&&this.postulate([],r),this.rebuildIndex();const e=this.createProxy([]);return Object.setPrototypeOf(e,re.prototype),Object.assign(e,this),e}get shortTermMemory(){return this._shortTermMemory}isRemoveCall(r,e){if(r.length===0)return null;const{scope:a,leaf:i}=N(r);if(!i||this.opKind(i)!=="remove")return null;if(e==null)return{targetPath:a};if(typeof e=="string"){const f=e.split(".").filter(Boolean);return{targetPath:[...a,...f]}}return null}createProxy(r){const e=this,a=(...i)=>Be({createProxy:f=>e.createProxy(f),normalizeArgs:f=>e.normalizeArgs(f),readPath:f=>e.readPath(f),postulate:(f,p)=>e.postulate(f,p),opKind:f=>e.opKind(f),splitPath:N,isThought:ye},r,i);return new Proxy(a,{get(i,f){if(typeof f=="symbol")return i[f];if(f in e){const b=e[f];return typeof b=="function"?b.bind(e):b}const p=[...r,String(f)];return e.createProxy(p)},apply(i,f,p){return Reflect.apply(i,void 0,p)}})}normalizeArgs(r){if(r.length!==0)return r.length===1?r[0]:r}opKind(r){return this.operators[r]?.kind??null}isSecretScopeCall(r,e){if(r.length===0)return null;const{scope:a,leaf:i}=N(r);return!i||this.opKind(i)!=="secret"||typeof e!="string"?null:{scopeKey:a.join(".")}}isNoiseScopeCall(r,e){if(r.length===0)return null;const{scope:a,leaf:i}=N(r);return!i||this.opKind(i)!=="noise"||typeof e!="string"?null:{scopeKey:a.join(".")}}isPointerCall(r,e){if(r.length===0)return null;const{leaf:a}=N(r);if(!a||this.opKind(a)!=="pointer"||typeof e!="string")return null;const i=e.trim().replace(/^\./,"");return i?{targetPath:i}:null}isIdentityCall(r,e){if(r.length===1&&this.opKind(r[0])==="identity")return typeof e!="string"?null:{id:ce(e),targetPath:[]};const{scope:a,leaf:i}=N(r);return!i||this.opKind(i)!=="identity"||typeof e!="string"?null:{id:ce(e),targetPath:a}}isEvalCall(r,e){if(r.length===0)return null;const{scope:a,leaf:i}=N(r);if(!i||this.opKind(i)!=="eval")return null;if(typeof e=="function")return{mode:"thunk",targetPath:a,thunk:e};if(Array.isArray(e)&&e.length>=2){const f=String(e[0]??"").trim(),p=String(e[1]??"").trim();return!f||!p?null:{mode:"assign",targetPath:a,name:f,expr:p}}return null}isQueryCall(r,e){if(r.length===0)return null;const{scope:a,leaf:i}=N(r);if(!i||this.opKind(i)!=="query")return null;let f=null,p;if(Array.isArray(e)&&e.length>0)Array.isArray(e[0])&&(e.length===1||typeof e[1]=="function")?(f=e[0],p=typeof e[1]=="function"?e[1]:void 0):f=e;else return null;if(!Array.isArray(f)||f.length===0)return null;const b=f.map(y=>String(y)).map(y=>y.trim()).filter(y=>y.length>0);return b.length===0?null:{targetPath:a,paths:b,fn:p}}isDefineOpCall(r,e){if(r.length!==1||r[0]!==he||!Array.isArray(e)||e.length<2)return null;const i=String(e[0]??"").trim(),f=String(e[1]??"").trim();return!i||!f||i===he?null:{op:i,kind:f}}postulate(r,e,a=null){let i=r,f=e;const p=this.isDefineOpCall(i,e);if(p){this.operators[p.op]={kind:p.kind};return}const b=this.isEvalCall(i,e);if(b){if(b.mode==="thunk"){const x=b.thunk();return b.targetPath.length===0?x:this.postulate(b.targetPath,x,"=")}const k=[...b.targetPath,b.name];return this.postulate(k,b.expr,"=")}const y=this.isQueryCall(i,e);if(y){const k=y.paths.map(C=>this.readPath(C.split(".").filter(Boolean))),x=y.fn?y.fn(...k):k;return y.targetPath.length===0?x:this.postulate(y.targetPath,x,"?")}const g=this.isRemoveCall(i,e);if(g){this.removeSubtree(g.targetPath);return}const S=this.isSecretScopeCall(i,e);if(S){this.localSecrets[S.scopeKey]=e;const k=S.scopeKey?S.scopeKey.split(".").filter(Boolean):[],x=k.join("."),C=this.computeEffectiveSecret(k),w="***",_="***",F=JSON.stringify({path:x,operator:"_",expression:w,value:_,effectiveSecret:C}),I=D(F),K=Date.now(),M={path:x,operator:"_",expression:w,value:_,effectiveSecret:C,hash:I,timestamp:K};return this._shortTermMemory.push(M),this.rebuildIndex(),M}const O=this.isNoiseScopeCall(i,e);if(O){this.localNoises[O.scopeKey]=e;const k=O.scopeKey?O.scopeKey.split(".").filter(Boolean):[],x=k.join("."),C=this.computeEffectiveSecret(k),w="***",_="***",F=JSON.stringify({path:x,operator:"~",expression:w,value:_,effectiveSecret:C}),I=D(F),K=Date.now(),M={path:x,operator:"~",expression:w,value:_,effectiveSecret:C,hash:I,timestamp:K};return this._shortTermMemory.push(M),this.rebuildIndex(),M}const J=this.isPointerCall(i,e);if(J){const{scope:k}=N(i);i=k,e=V(J.targetPath),f=e,a===null&&(a="__")}const R=this.isIdentityCall(i,e);R&&(i=R.targetPath,e=pe(R.id),f=e,a===null&&(a="@"));const P=i.join("."),W=this.computeEffectiveSecret(i),E=this.resolveBranchScope(i);if(E&&E.length===0&&this.localSecrets[""]&&this.localSecrets[P],E&&E.length>0){const k=this.computeEffectiveSecret(E),x=i.slice(E.length),C=this.getBranchBlob(E);let w={};if(C&&k){const _=ee(C,k,E);_&&typeof _=="object"&&(w=_)}if(x.length===0)(typeof w!="object"||w===null)&&(w={}),w.expression=e;else{let _=w;for(let F=0;F<x.length-1;F++){const I=x[F];(!_[I]||typeof _[I]!="object")&&(_[I]={}),_=_[I]}_[x[x.length-1]]=e}if(k){const _=ue(w,k,E);this.setBranchBlob(E,_)}f=e}else if(W){const k=a!=="="&&a!=="?";j(e)||Qt(e)||!k?f=e:f=ue(e,W,i)}else f=e;const H=f,L=JSON.stringify({path:P,operator:a,expression:e,value:H,effectiveSecret:W}),Y=D(L),ne=Date.now(),Z={path:P,operator:a,expression:e,value:H,effectiveSecret:W,hash:Y,timestamp:ne};return this._shortTermMemory.push(Z),this.rebuildIndex(),Z}removeSubtree(r){const e=r.join(".");for(const g of Object.keys(this.localSecrets)){if(e===""){delete this.localSecrets[g];continue}(g===e||g.startsWith(e+"."))&&delete this.localSecrets[g]}for(const g of Object.keys(this.localNoises)){if(e===""){delete this.localNoises[g];continue}(g===e||g.startsWith(e+"."))&&delete this.localNoises[g]}for(const g of Object.keys(this.encryptedBranches)){if(e===""){delete this.encryptedBranches[g];continue}(g===e||g.startsWith(e+"."))&&delete this.encryptedBranches[g]}const a=r.join("."),i=Date.now(),f=this.computeEffectiveSecret(r),p=JSON.stringify({path:a,operator:"-",expression:"-",value:"-",effectiveSecret:f}),b=D(p),y={path:a,operator:"-",expression:"-",value:"-",effectiveSecret:f,hash:b,timestamp:i};this._shortTermMemory.push(y),this.rebuildIndex()}computeEffectiveSecret(r){let e=null,a=null;this.localNoises[""]!==void 0&&(e="",a=this.localNoises[""]);for(let f=1;f<=r.length;f++){const p=r.slice(0,f).join(".");this.localNoises[p]!==void 0&&(e=p,a=this.localNoises[p])}let i="root";a?i=D("noise::"+a):this.localSecrets[""]&&(i=D(i+"::"+this.localSecrets[""])),e===null||e===""||e.split(".").filter(Boolean).length;for(let f=1;f<=r.length;f++){const p=r.slice(0,f).join(".");if(this.localSecrets[p]){if(e!==null&&e!==""){const b=e+".";if(!(p===e||p.startsWith(b)))continue}i=D(i+"::"+this.localSecrets[p])}}return i==="root"?"":i}rebuildIndex(){const r={};for(const e of this._shortTermMemory){const a=e.path,i=a.split(".").filter(Boolean),f=this.resolveBranchScope(i),p=f&&f.length>0&&le(i,f);if(e.operator==="-"){if(a===""){for(const y of Object.keys(r))delete r[y];continue}const b=a+".";for(const y of Object.keys(r))(y===a||y.startsWith(b))&&delete r[y];continue}p||(r[a]=e.value)}this.index=r}getIndex(r){return this.index[r.join(".")]}setIndex(r,e){this.index[r.join(".")]=e}resolveIndexPointerPath(r,e=8){let a=r;for(let i=0;i<e;i++){const f=this.getIndex(a);if(!j(f))return{path:a,raw:f};a=f.__ptr.split(".").filter(Boolean)}return{path:a,raw:void 0}}setBranchBlob(r,e){const a=r.join(".");this.encryptedBranches[a]=e}getBranchBlob(r){const e=r.join(".");return this.encryptedBranches[e]}resolveBranchScope(r){let e=null;this.localSecrets[""]&&(e=[]);for(let a=1;a<=r.length;a++){const i=r.slice(0,a),f=i.join(".");this.localSecrets[f]&&(e=i)}return e}readPath(r){const e=this.resolveBranchScope(r);if(e&&e.length>0&&le(r,e)){if(r.length===e.length)return;const p=this.computeEffectiveSecret(e);if(!p)return null;const b=this.getBranchBlob(e);if(!b)return;const y=ee(b,p,e);if(!y||typeof y!="object")return;const g=r.slice(e.length);let S=y;for(const O of g){if(!S||typeof S!="object")return;S=S[O]}return j(S)?this.readPath(S.__ptr.split(".").filter(Boolean)):(Qt(S),S)}const i=this.resolveIndexPointerPath(r).raw;if(i===void 0)return;if(j(i))return this.readPath(i.__ptr.split(".").filter(Boolean));if(Qt(i)||!xe(i))return i;const f=this.computeEffectiveSecret(r);return f?ee(i,f,r):null}}return re}));
1
+ (function(J,T){typeof exports=="object"&&typeof module<"u"?module.exports=T():typeof define=="function"&&define.amd?define(T):(J=typeof globalThis<"u"?globalThis:J||self,J.Me=T())})(this,(function(){"use strict";function T(l){return{__ptr:l}}function j(l){return!!l&&typeof l=="object"&&typeof l.__ptr=="string"&&l.__ptr.length>0}function pe(l){return{__id:l}}function qt(l){return!!l&&typeof l=="object"&&typeof l.__id=="string"&&l.__id.length>0}function ye(l){return!!l&&typeof l=="object"&&typeof l.path=="string"&&typeof l.hash=="string"&&typeof l.timestamp=="number"}function w(l){return l.length===0?{scope:[],leaf:null}:{scope:l.slice(0,-1),leaf:l[l.length-1]}}function $t(l,n){if(n.length>l.length)return!1;for(let e=0;e<n.length;e++)if(l[e]!==n[e])return!1;return!0}function H(l){const n=l.trim().toLowerCase();if(n.length<3||n.length>63)throw new Error(`Invalid username length: ${n.length}. Expected 3..63 characters.`);if(!/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(n))throw new Error(`Invalid username. Use only [a-z0-9-], and start/end with [a-z0-9]. Got: ${l}`);if(n.includes("--"))throw new Error(`Invalid username. "--" is not allowed. Got: ${l}`);return n}function E(l,n){return l[n]?.kind??null}function ge(l,n){if(l.length!==1||l[0]!=="+"||!Array.isArray(n)||n.length<2)return null;const i=String(n[0]??"").trim(),r=String(n[1]??"").trim();return!i||!r||i==="+"?null:{op:i,kind:r}}function ve(l,n,e){if(n.length===0)return null;const{scope:i,leaf:r}=w(n);return!r||E(l,r)!=="secret"||typeof e!="string"?null:{scopeKey:i.join(".")}}function be(l,n,e){if(n.length===0)return null;const{scope:i,leaf:r}=w(n);return!r||E(l,r)!=="noise"||typeof e!="string"?null:{scopeKey:i.join(".")}}function me(l,n,e){if(n.length===0)return null;const{leaf:i}=w(n);if(!i||E(l,i)!=="pointer"||typeof e!="string")return null;const r=e.trim().replace(/^\./,"");return r?{targetPath:r}:null}function ke(l,n,e){if(n.length===1&&E(l,n[0])==="identity")return typeof e!="string"?null:{id:H(e),targetPath:[]};const{scope:i,leaf:r}=w(n);return!r||E(l,r)!=="identity"||typeof e!="string"?null:{id:H(e),targetPath:i}}function Se(l,n,e){if(n.length===0)return null;const{scope:i,leaf:r}=w(n);if(!r||E(l,r)!=="eval")return null;if(typeof e=="function")return{mode:"thunk",targetPath:i,thunk:e};if(Array.isArray(e)&&e.length>=2){const u=String(e[0]??"").trim(),f=String(e[1]??"").trim();return!u||!f?null:{mode:"assign",targetPath:i,name:u,expr:f}}return null}function Ae(l,n,e){if(n.length===0)return null;const{scope:i,leaf:r}=w(n);if(!r||E(l,r)!=="query")return null;let u=null,f;if(Array.isArray(e)&&e.length>0)Array.isArray(e[0])&&(e.length===1||typeof e[1]=="function")?(u=e[0],f=typeof e[1]=="function"?e[1]:void 0):u=e;else return null;if(!Array.isArray(u)||u.length===0)return null;const p=u.map(s=>String(s)).map(s=>s.trim()).filter(s=>s.length>0);return p.length===0?null:{targetPath:i,paths:p,fn:f}}function Be(l,n,e){if(n.length===0)return null;const{scope:i,leaf:r}=w(n);if(!r||E(l,r)!=="remove")return null;if(e==null)return{targetPath:i};if(typeof e=="string"){const u=e.split(".").filter(Boolean);return{targetPath:[...i,...u]}}return null}var _e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pe(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Lt={exports:{}};var ne;function xe(){return ne||(ne=1,(function(l){(function(){var n="input is invalid type",e="finalize already called",i=typeof window=="object",r=i?window:{};r.JS_SHA3_NO_WINDOW&&(i=!1);var u=!i&&typeof self=="object",f=!r.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;f?r=_e:u&&(r=self);for(var p=!r.JS_SHA3_NO_COMMON_JS&&!0&&l.exports,s=!r.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",h="0123456789abcdef".split(""),k=[31,7936,2031616,520093696],m=[4,1024,262144,67108864],S=[1,256,65536,16777216],B=[6,1536,393216,100663296],A=[0,8,16,24],C=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],O=[224,256,384,512],F=[128,256],D=["hex","buffer","arrayBuffer","array","digest"],oe={128:168,256:136},je=r.JS_SHA3_NO_NODE_JS||!Array.isArray?function(t){return Object.prototype.toString.call(t)==="[object Array]"}:Array.isArray,Ne=s&&(r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)?function(t){return typeof t=="object"&&t.buffer&&t.buffer.constructor===ArrayBuffer}:ArrayBuffer.isView,Zt=function(t){var o=typeof t;if(o==="string")return[t,!0];if(o!=="object"||t===null)throw new Error(n);if(s&&t.constructor===ArrayBuffer)return[new Uint8Array(t),!1];if(!je(t)&&!Ne(t))throw new Error(n);return[t,!1]},le=function(t){return Zt(t)[0].length===0},Xt=function(t){for(var o=[],c=0;c<t.length;++c)o[c]=t[c];return o},ue=function(t,o,c){return function(a){return new P(t,o,t).update(a)[c]()}},ce=function(t,o,c){return function(a,d){return new P(t,o,d).update(a)[c]()}},ae=function(t,o,c){return function(a,d,y,v){return K["cshake"+t].update(a,d,y,v)[c]()}},fe=function(t,o,c){return function(a,d,y,v){return K["kmac"+t].update(a,d,y,v)[c]()}},V=function(t,o,c,a){for(var d=0;d<D.length;++d){var y=D[d];t[y]=o(c,a,y)}return t},he=function(t,o){var c=ue(t,o,"hex");return c.create=function(){return new P(t,o,t)},c.update=function(a){return c.create().update(a)},V(c,ue,t,o)},Te=function(t,o){var c=ce(t,o,"hex");return c.create=function(a){return new P(t,o,a)},c.update=function(a,d){return c.create(d).update(a)},V(c,ce,t,o)},Me=function(t,o){var c=oe[t],a=ae(t,o,"hex");return a.create=function(d,y,v){return le(y)&&le(v)?K["shake"+t].create(d):new P(t,o,d).bytepad([y,v],c)},a.update=function(d,y,v,g){return a.create(y,v,g).update(d)},V(a,ae,t,o)},De=function(t,o){var c=oe[t],a=fe(t,o,"hex");return a.create=function(d,y,v){return new ee(t,o,y).bytepad(["KMAC",v],c).bytepad([d],c)},a.update=function(d,y,v,g){return a.create(d,v,g).update(y)},V(a,fe,t,o)},se=[{name:"keccak",padding:S,bits:O,createMethod:he},{name:"sha3",padding:B,bits:O,createMethod:he},{name:"shake",padding:k,bits:F,createMethod:Te},{name:"cshake",padding:m,bits:F,createMethod:Me},{name:"kmac",padding:m,bits:F,createMethod:De}],K={},z=[],I=0;I<se.length;++I)for(var N=se[I],q=N.bits,R=0;R<q.length;++R){var te=N.name+"_"+q[R];if(z.push(te),K[te]=N.createMethod(q[R],N.padding),N.name!=="sha3"){var de=N.name+q[R];z.push(de),K[de]=K[te]}}function P(t,o,c){this.blocks=[],this.s=[],this.padding=o,this.outputBits=c,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=c>>5,this.extraBytes=(c&31)>>3;for(var a=0;a<50;++a)this.s[a]=0}P.prototype.update=function(t){if(this.finalized)throw new Error(e);var o=Zt(t);t=o[0];for(var c=o[1],a=this.blocks,d=this.byteCount,y=t.length,v=this.blockCount,g=0,x=this.s,b,_;g<y;){if(this.reset)for(this.reset=!1,a[0]=this.block,b=1;b<v+1;++b)a[b]=0;if(c)for(b=this.start;g<y&&b<d;++g)_=t.charCodeAt(g),_<128?a[b>>2]|=_<<A[b++&3]:_<2048?(a[b>>2]|=(192|_>>6)<<A[b++&3],a[b>>2]|=(128|_&63)<<A[b++&3]):_<55296||_>=57344?(a[b>>2]|=(224|_>>12)<<A[b++&3],a[b>>2]|=(128|_>>6&63)<<A[b++&3],a[b>>2]|=(128|_&63)<<A[b++&3]):(_=65536+((_&1023)<<10|t.charCodeAt(++g)&1023),a[b>>2]|=(240|_>>18)<<A[b++&3],a[b>>2]|=(128|_>>12&63)<<A[b++&3],a[b>>2]|=(128|_>>6&63)<<A[b++&3],a[b>>2]|=(128|_&63)<<A[b++&3]);else for(b=this.start;g<y&&b<d;++g)a[b>>2]|=t[g]<<A[b++&3];if(this.lastByteIndex=b,b>=d){for(this.start=b-d,this.block=a[v],b=0;b<v;++b)x[b]^=a[b];W(x),this.reset=!0}else this.start=b}return this},P.prototype.encode=function(t,o){var c=t&255,a=1,d=[c];for(t=t>>8,c=t&255;c>0;)d.unshift(c),t=t>>8,c=t&255,++a;return o?d.push(a):d.unshift(a),this.update(d),d.length},P.prototype.encodeString=function(t){var o=Zt(t);t=o[0];var c=o[1],a=0,d=t.length;if(c)for(var y=0;y<t.length;++y){var v=t.charCodeAt(y);v<128?a+=1:v<2048?a+=2:v<55296||v>=57344?a+=3:(v=65536+((v&1023)<<10|t.charCodeAt(++y)&1023),a+=4)}else a=d;return a+=this.encode(a*8),this.update(t),a},P.prototype.bytepad=function(t,o){for(var c=this.encode(o),a=0;a<t.length;++a)c+=this.encodeString(t[a]);var d=(o-c%o)%o,y=[];return y.length=d,this.update(y),this},P.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,o=this.lastByteIndex,c=this.blockCount,a=this.s;if(t[o>>2]|=this.padding[o&3],this.lastByteIndex===this.byteCount)for(t[0]=t[c],o=1;o<c+1;++o)t[o]=0;for(t[c-1]|=2147483648,o=0;o<c;++o)a[o]^=t[o];W(a)}},P.prototype.toString=P.prototype.hex=function(){this.finalize();for(var t=this.blockCount,o=this.s,c=this.outputBlocks,a=this.extraBytes,d=0,y=0,v="",g;y<c;){for(d=0;d<t&&y<c;++d,++y)g=o[d],v+=h[g>>4&15]+h[g&15]+h[g>>12&15]+h[g>>8&15]+h[g>>20&15]+h[g>>16&15]+h[g>>28&15]+h[g>>24&15];y%t===0&&(o=Xt(o),W(o),d=0)}return a&&(g=o[d],v+=h[g>>4&15]+h[g&15],a>1&&(v+=h[g>>12&15]+h[g>>8&15]),a>2&&(v+=h[g>>20&15]+h[g>>16&15])),v},P.prototype.arrayBuffer=function(){this.finalize();var t=this.blockCount,o=this.s,c=this.outputBlocks,a=this.extraBytes,d=0,y=0,v=this.outputBits>>3,g;a?g=new ArrayBuffer(c+1<<2):g=new ArrayBuffer(v);for(var x=new Uint32Array(g);y<c;){for(d=0;d<t&&y<c;++d,++y)x[y]=o[d];y%t===0&&(o=Xt(o),W(o))}return a&&(x[y]=o[d],g=g.slice(0,v)),g},P.prototype.buffer=P.prototype.arrayBuffer,P.prototype.digest=P.prototype.array=function(){this.finalize();for(var t=this.blockCount,o=this.s,c=this.outputBlocks,a=this.extraBytes,d=0,y=0,v=[],g,x;y<c;){for(d=0;d<t&&y<c;++d,++y)g=y<<2,x=o[d],v[g]=x&255,v[g+1]=x>>8&255,v[g+2]=x>>16&255,v[g+3]=x>>24&255;y%t===0&&(o=Xt(o),W(o))}return a&&(g=y<<2,x=o[d],v[g]=x&255,a>1&&(v[g+1]=x>>8&255),a>2&&(v[g+2]=x>>16&255)),v};function ee(t,o,c){P.call(this,t,o,c)}ee.prototype=new P,ee.prototype.finalize=function(){return this.encode(this.outputBits,!0),P.prototype.finalize.call(this)};var W=function(t){var o,c,a,d,y,v,g,x,b,_,$,L,G,Y,Q,Z,X,tt,et,nt,rt,it,ot,lt,ut,ct,at,ft,ht,st,dt,pt,yt,gt,vt,bt,mt,kt,St,At,Bt,_t,Pt,xt,wt,Ct,Ot,Et,Ft,Kt,It,jt,Nt,Tt,Mt,Dt,zt,Rt,Wt,Jt,Ht,Ut,Vt;for(a=0;a<48;a+=2)d=t[0]^t[10]^t[20]^t[30]^t[40],y=t[1]^t[11]^t[21]^t[31]^t[41],v=t[2]^t[12]^t[22]^t[32]^t[42],g=t[3]^t[13]^t[23]^t[33]^t[43],x=t[4]^t[14]^t[24]^t[34]^t[44],b=t[5]^t[15]^t[25]^t[35]^t[45],_=t[6]^t[16]^t[26]^t[36]^t[46],$=t[7]^t[17]^t[27]^t[37]^t[47],L=t[8]^t[18]^t[28]^t[38]^t[48],G=t[9]^t[19]^t[29]^t[39]^t[49],o=L^(v<<1|g>>>31),c=G^(g<<1|v>>>31),t[0]^=o,t[1]^=c,t[10]^=o,t[11]^=c,t[20]^=o,t[21]^=c,t[30]^=o,t[31]^=c,t[40]^=o,t[41]^=c,o=d^(x<<1|b>>>31),c=y^(b<<1|x>>>31),t[2]^=o,t[3]^=c,t[12]^=o,t[13]^=c,t[22]^=o,t[23]^=c,t[32]^=o,t[33]^=c,t[42]^=o,t[43]^=c,o=v^(_<<1|$>>>31),c=g^($<<1|_>>>31),t[4]^=o,t[5]^=c,t[14]^=o,t[15]^=c,t[24]^=o,t[25]^=c,t[34]^=o,t[35]^=c,t[44]^=o,t[45]^=c,o=x^(L<<1|G>>>31),c=b^(G<<1|L>>>31),t[6]^=o,t[7]^=c,t[16]^=o,t[17]^=c,t[26]^=o,t[27]^=c,t[36]^=o,t[37]^=c,t[46]^=o,t[47]^=c,o=_^(d<<1|y>>>31),c=$^(y<<1|d>>>31),t[8]^=o,t[9]^=c,t[18]^=o,t[19]^=c,t[28]^=o,t[29]^=c,t[38]^=o,t[39]^=c,t[48]^=o,t[49]^=c,Y=t[0],Q=t[1],Ct=t[11]<<4|t[10]>>>28,Ot=t[10]<<4|t[11]>>>28,ft=t[20]<<3|t[21]>>>29,ht=t[21]<<3|t[20]>>>29,Jt=t[31]<<9|t[30]>>>23,Ht=t[30]<<9|t[31]>>>23,_t=t[40]<<18|t[41]>>>14,Pt=t[41]<<18|t[40]>>>14,gt=t[2]<<1|t[3]>>>31,vt=t[3]<<1|t[2]>>>31,Z=t[13]<<12|t[12]>>>20,X=t[12]<<12|t[13]>>>20,Et=t[22]<<10|t[23]>>>22,Ft=t[23]<<10|t[22]>>>22,st=t[33]<<13|t[32]>>>19,dt=t[32]<<13|t[33]>>>19,Ut=t[42]<<2|t[43]>>>30,Vt=t[43]<<2|t[42]>>>30,Tt=t[5]<<30|t[4]>>>2,Mt=t[4]<<30|t[5]>>>2,bt=t[14]<<6|t[15]>>>26,mt=t[15]<<6|t[14]>>>26,tt=t[25]<<11|t[24]>>>21,et=t[24]<<11|t[25]>>>21,Kt=t[34]<<15|t[35]>>>17,It=t[35]<<15|t[34]>>>17,pt=t[45]<<29|t[44]>>>3,yt=t[44]<<29|t[45]>>>3,lt=t[6]<<28|t[7]>>>4,ut=t[7]<<28|t[6]>>>4,Dt=t[17]<<23|t[16]>>>9,zt=t[16]<<23|t[17]>>>9,kt=t[26]<<25|t[27]>>>7,St=t[27]<<25|t[26]>>>7,nt=t[36]<<21|t[37]>>>11,rt=t[37]<<21|t[36]>>>11,jt=t[47]<<24|t[46]>>>8,Nt=t[46]<<24|t[47]>>>8,xt=t[8]<<27|t[9]>>>5,wt=t[9]<<27|t[8]>>>5,ct=t[18]<<20|t[19]>>>12,at=t[19]<<20|t[18]>>>12,Rt=t[29]<<7|t[28]>>>25,Wt=t[28]<<7|t[29]>>>25,At=t[38]<<8|t[39]>>>24,Bt=t[39]<<8|t[38]>>>24,it=t[48]<<14|t[49]>>>18,ot=t[49]<<14|t[48]>>>18,t[0]=Y^~Z&tt,t[1]=Q^~X&et,t[10]=lt^~ct&ft,t[11]=ut^~at&ht,t[20]=gt^~bt&kt,t[21]=vt^~mt&St,t[30]=xt^~Ct&Et,t[31]=wt^~Ot&Ft,t[40]=Tt^~Dt&Rt,t[41]=Mt^~zt&Wt,t[2]=Z^~tt&nt,t[3]=X^~et&rt,t[12]=ct^~ft&st,t[13]=at^~ht&dt,t[22]=bt^~kt&At,t[23]=mt^~St&Bt,t[32]=Ct^~Et&Kt,t[33]=Ot^~Ft&It,t[42]=Dt^~Rt&Jt,t[43]=zt^~Wt&Ht,t[4]=tt^~nt&it,t[5]=et^~rt&ot,t[14]=ft^~st&pt,t[15]=ht^~dt&yt,t[24]=kt^~At&_t,t[25]=St^~Bt&Pt,t[34]=Et^~Kt&jt,t[35]=Ft^~It&Nt,t[44]=Rt^~Jt&Ut,t[45]=Wt^~Ht&Vt,t[6]=nt^~it&Y,t[7]=rt^~ot&Q,t[16]=st^~pt&lt,t[17]=dt^~yt&ut,t[26]=At^~_t&gt,t[27]=Bt^~Pt&vt,t[36]=Kt^~jt&xt,t[37]=It^~Nt&wt,t[46]=Jt^~Ut&Tt,t[47]=Ht^~Vt&Mt,t[8]=it^~Y&Z,t[9]=ot^~Q&X,t[18]=pt^~lt&ct,t[19]=yt^~ut&at,t[28]=_t^~gt&bt,t[29]=Pt^~vt&mt,t[38]=jt^~xt&Ct,t[39]=Nt^~wt&Ot,t[48]=Ut^~Tt&Dt,t[49]=Vt^~Mt&zt,t[0]^=C[a],t[1]^=C[a+1]};if(p)l.exports=K;else for(I=0;I<z.length;++I)r[z[I]]=K[z[I]]})()})(Lt)),Lt.exports}var we=xe();const Ce=Pe(we),{keccak256:re}=Ce;function Gt(l){return new TextEncoder().encode(l)}function Oe(l){const n=l.startsWith("0x")?l.slice(2):l,e=new Uint8Array(n.length/2);for(let i=0;i<e.length;i++)e[i]=parseInt(n.substring(i*2,i*2+2),16);return e}function Ee(l){let n="";for(let e=0;e<l.length;e++)n+=l[e].toString(16).padStart(2,"0");return"0x"+n}function Yt(l,n,e){const i=JSON.stringify(l),r=Gt(i),u=re(n+":"+e.join(".")),f=Gt(u),p=new Uint8Array(r.length);for(let s=0;s<r.length;s++)p[s]=r[s]^f[s%f.length];return Ee(p)}function U(l,n,e){try{const i=Oe(l),r=re(n+":"+e.join(".")),u=Gt(r),f=new Uint8Array(i.length);for(let s=0;s<i.length;s++)f[s]=i[s]^u[s%u.length];const p=new TextDecoder().decode(f);return JSON.parse(p)}catch{return null}}function Fe(l){if(typeof l!="string"||!l.startsWith("0x"))return!1;const n=l.slice(2);return n.length<2||n.length%2!==0?!1:/^[0-9a-fA-F]+$/.test(n)}function Ke(l,n,e){if(n.length===0){if(e.length===1&&typeof e[0]=="string"){const k=e[0].trim(),m=k.startsWith("_")||k.startsWith("~")||k.startsWith("@"),S=k.includes("."),B=/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(k);if(S||m||B){const A=k.split(".").filter(Boolean);return l.readPath(A)}}if(e.length===0)return l.createProxy([]);const s=l.normalizeArgs(e),h=l.postulate([],s);return h!==void 0?h:l.createProxy([])}const i=l.normalizeArgs(e),r=l.postulate(n,i),{scope:u,leaf:f}=l.splitPath(n),p=f?l.opKind(f):null;if(l.isThought(r)){const s=p?u:n;return l.createProxy(s)}return r!==void 0?r:l.createProxy(n)}function Ie(l,n,e={}){const{path:i,expression:r}=n,u=ge(i,r);if(u)return{kind:"return",value:{define:u}};const f=ve(l,i,r);if(f)return{kind:"commit",instructions:[{path:f.scopeKey?f.scopeKey.split(".").filter(Boolean):[],op:"secret",value:r}]};const p=be(l,i,r);if(p)return{kind:"commit",instructions:[{path:p.scopeKey?p.scopeKey.split(".").filter(Boolean):[],op:"noise",value:r}]};const s=me(l,i,r);if(s){const{scope:B}=w(i);return{kind:"commit",instructions:[{path:B,op:"ptr",value:T(s.targetPath)}]}}const h=ke(l,i,r);if(h)return{kind:"commit",instructions:[{path:h.targetPath,op:"id",value:pe(h.id)}]};const k=Be(l,i,r);if(k)return{kind:"commit",instructions:[{path:k.targetPath,op:"remove",value:"-"}]};const m=Se(l,i,r);if(m){if(m.mode==="assign")return{kind:"commit",instructions:[{path:[...m.targetPath,m.name],op:"derive",value:{kind:"expr",source:m.expr}}]};if(!e.evaluateThunk)throw new Error('Non-serializable derivation: "=" thunk requires `evaluateThunk` or serializable DNA.');const B=e.evaluateThunk(m.thunk);return m.targetPath.length===0?{kind:"return",value:B}:{kind:"commit",instructions:[{path:m.targetPath,op:"derive",value:B}]}}const S=Ae(l,i,r);if(S){if(!e.readPath)return{kind:"commit",instructions:[{path:S.targetPath,op:"query",value:{paths:S.paths}}]};const B=S.paths.map(C=>e.readPath(C.split(".").filter(Boolean))),A=S.fn?S.fn(...B):B;return S.targetPath.length===0?{kind:"return",value:A}:{kind:"commit",instructions:[{path:S.targetPath,op:"query",value:A}]}}return{kind:"commit",instructions:[{path:i,op:"set",value:r}]}}const ie="+";function M(l){let n=2166136261;for(let e=0;e<l.length;e++)n^=l.charCodeAt(e),n=Math.imul(n,16777619);return("00000000"+(n>>>0).toString(16)).slice(-8)}class Qt{constructor(n){this.localSecrets={},this.localNoises={},this.encryptedBranches={},this.index={},this._shortTermMemory=[],this.operators={_:{kind:"secret"},"~":{kind:"noise"},__:{kind:"pointer"},"->":{kind:"pointer"},"@":{kind:"identity"},"=":{kind:"eval"},"?":{kind:"query"},"-":{kind:"remove"}},this.localSecrets={},this.localNoises={},this.encryptedBranches={},this.index={},this.operators={_:{kind:"secret"},"~":{kind:"noise"},__:{kind:"pointer"},"->":{kind:"pointer"},"@":{kind:"identity"},"=":{kind:"eval"},"?":{kind:"query"},"-":{kind:"remove"}},this._shortTermMemory=[],n!==void 0&&this.postulate([],n),this.rebuildIndex();const e=this.createProxy([]);return Object.setPrototypeOf(e,Qt.prototype),Object.assign(e,this),e}get shortTermMemory(){return this._shortTermMemory}isRemoveCall(n,e){if(n.length===0)return null;const{scope:i,leaf:r}=w(n);if(!r||this.opKind(r)!=="remove")return null;if(e==null)return{targetPath:i};if(typeof e=="string"){const u=e.split(".").filter(Boolean);return{targetPath:[...i,...u]}}return null}createProxy(n){const e=this,i=(...r)=>Ke({createProxy:u=>e.createProxy(u),normalizeArgs:u=>e.normalizeArgs(u),readPath:u=>e.readPath(u),postulate:(u,f)=>e.postulate(u,f),opKind:u=>e.opKind(u),splitPath:w,isThought:ye},n,r);return new Proxy(i,{get(r,u){if(typeof u=="symbol")return r[u];if(u in e){const p=e[u];return typeof p=="function"?p.bind(e):p}const f=[...n,String(u)];return e.createProxy(f)},apply(r,u,f){return Reflect.apply(r,void 0,f)}})}normalizeArgs(n){if(n.length!==0)return n.length===1?n[0]:n}opKind(n){return this.operators[n]?.kind??null}isSecretScopeCall(n,e){if(n.length===0)return null;const{scope:i,leaf:r}=w(n);return!r||this.opKind(r)!=="secret"||typeof e!="string"?null:{scopeKey:i.join(".")}}isNoiseScopeCall(n,e){if(n.length===0)return null;const{scope:i,leaf:r}=w(n);return!r||this.opKind(r)!=="noise"||typeof e!="string"?null:{scopeKey:i.join(".")}}isPointerCall(n,e){if(n.length===0)return null;const{leaf:i}=w(n);if(!i||this.opKind(i)!=="pointer"||typeof e!="string")return null;const r=e.trim().replace(/^\./,"");return r?{targetPath:r}:null}isIdentityCall(n,e){if(n.length===1&&this.opKind(n[0])==="identity")return typeof e!="string"?null:{id:H(e),targetPath:[]};const{scope:i,leaf:r}=w(n);return!r||this.opKind(r)!=="identity"||typeof e!="string"?null:{id:H(e),targetPath:i}}isEvalCall(n,e){if(n.length===0)return null;const{scope:i,leaf:r}=w(n);if(!r||this.opKind(r)!=="eval")return null;if(typeof e=="function")return{mode:"thunk",targetPath:i,thunk:e};if(Array.isArray(e)&&e.length>=2){const u=String(e[0]??"").trim(),f=String(e[1]??"").trim();return!u||!f?null:{mode:"assign",targetPath:i,name:u,expr:f}}return null}isQueryCall(n,e){if(n.length===0)return null;const{scope:i,leaf:r}=w(n);if(!r||this.opKind(r)!=="query")return null;let u=null,f;if(Array.isArray(e)&&e.length>0)Array.isArray(e[0])&&(e.length===1||typeof e[1]=="function")?(u=e[0],f=typeof e[1]=="function"?e[1]:void 0):u=e;else return null;if(!Array.isArray(u)||u.length===0)return null;const p=u.map(s=>String(s)).map(s=>s.trim()).filter(s=>s.length>0);return p.length===0?null:{targetPath:i,paths:p,fn:f}}isDefineOpCall(n,e){if(n.length!==1||n[0]!==ie||!Array.isArray(e)||e.length<2)return null;const r=String(e[0]??"").trim(),u=String(e[1]??"").trim();return!r||!u||r===ie?null:{op:r,kind:u}}commitThoughtOnly(n,e,i,r){const u=n.join("."),f=this.computeEffectiveSecret(n),p=JSON.stringify({path:u,operator:e,expression:i,value:r,effectiveSecret:f}),s=M(p),h=Date.now(),k={path:u,operator:e,expression:i,value:r,effectiveSecret:f,hash:s,timestamp:h};return this._shortTermMemory.push(k),this.rebuildIndex(),k}commitValueMapping(n,e,i=null){let r=e;const u=n.join("."),f=this.computeEffectiveSecret(n),p=this.resolveBranchScope(n);if(p&&p.length===0&&this.localSecrets[""]&&this.localSecrets[u],p&&p.length>0){const s=this.computeEffectiveSecret(p),h=n.slice(p.length),k=this.getBranchBlob(p);let m={};if(k&&s){const S=U(k,s,p);S&&typeof S=="object"&&(m=S)}if(h.length===0)(typeof m!="object"||m===null)&&(m={}),m.expression=e;else{let S=m;for(let B=0;B<h.length-1;B++){const A=h[B];(!S[A]||typeof S[A]!="object")&&(S[A]={}),S=S[A]}S[h[h.length-1]]=e}if(s){const S=Yt(m,s,p);this.setBranchBlob(p,S)}r=e}else if(f){const s=i!=="="&&i!=="?";j(e)||qt(e)||!s?r=e:r=Yt(e,f,n)}else r=e;return this.commitThoughtOnly(n,i,e,r)}commitMapping(n,e=null){switch(n.op){case"set":return this.commitValueMapping(n.path,n.value,e);case"ptr":return this.commitValueMapping(n.path,n.value,"__");case"id":return this.commitValueMapping(n.path,n.value,"@");case"secret":{if(typeof n.value!="string")return;const i=n.path.join(".");return this.localSecrets[i]=n.value,this.commitThoughtOnly(n.path,"_","***","***")}default:return}}postulate(n,e,i=null){let r=n;const u=this.isDefineOpCall(r,e);if(u){this.operators[u.op]={kind:u.kind};return}const{leaf:f}=w(r),p=f?this.opKind(f):null;if(p===null||p==="secret"||p==="pointer"||p==="identity"){const B=Ie(this.operators,{path:r,expression:e});if(B.kind==="commit"){const A=new Set(["set","secret","ptr","id"]);if(B.instructions.every(O=>A.has(O.op))){let O;for(const F of B.instructions){const D=this.commitMapping(F,i);D&&(O=D)}if(O)return O}}}const h=this.isEvalCall(r,e);if(h){if(h.mode==="thunk"){const A=h.thunk();return h.targetPath.length===0?A:this.postulate(h.targetPath,A,"=")}const B=[...h.targetPath,h.name];return this.postulate(B,h.expr,"=")}const k=this.isQueryCall(r,e);if(k){const B=k.paths.map(C=>this.readPath(C.split(".").filter(Boolean))),A=k.fn?k.fn(...B):B;return k.targetPath.length===0?A:this.postulate(k.targetPath,A,"?")}const m=this.isRemoveCall(r,e);if(m){this.removeSubtree(m.targetPath);return}const S=this.isNoiseScopeCall(r,e);if(S){this.localNoises[S.scopeKey]=e;const B=S.scopeKey?S.scopeKey.split(".").filter(Boolean):[];return this.commitThoughtOnly(B,"~","***","***")}return this.commitValueMapping(r,e,i)}removeSubtree(n){const e=n.join(".");for(const h of Object.keys(this.localSecrets)){if(e===""){delete this.localSecrets[h];continue}(h===e||h.startsWith(e+"."))&&delete this.localSecrets[h]}for(const h of Object.keys(this.localNoises)){if(e===""){delete this.localNoises[h];continue}(h===e||h.startsWith(e+"."))&&delete this.localNoises[h]}for(const h of Object.keys(this.encryptedBranches)){if(e===""){delete this.encryptedBranches[h];continue}if(h===e||h.startsWith(e+".")){delete this.encryptedBranches[h];continue}const k=h.split(".").filter(Boolean);if(!$t(n,k)||n.length<=k.length)continue;const m=this.computeEffectiveSecret(k);if(!m)continue;const S=this.getBranchBlob(k);if(!S)continue;const B=U(S,m,k);if(!B||typeof B!="object")continue;const A=n.slice(k.length);let C=B;for(let O=0;O<A.length-1;O++){const F=A[O];if(!C||typeof C!="object"||!(F in C)){C=null;break}C=C[F]}if(C&&typeof C=="object"){delete C[A[A.length-1]];const O=Yt(B,m,k);this.setBranchBlob(k,O)}}const i=n.join("."),r=Date.now(),u=this.computeEffectiveSecret(n),f=JSON.stringify({path:i,operator:"-",expression:"-",value:"-",effectiveSecret:u}),p=M(f),s={path:i,operator:"-",expression:"-",value:"-",effectiveSecret:u,hash:p,timestamp:r};this._shortTermMemory.push(s),this.rebuildIndex()}computeEffectiveSecret(n){let e=null,i=null;this.localNoises[""]!==void 0&&(e="",i=this.localNoises[""]);for(let u=1;u<=n.length;u++){const f=n.slice(0,u).join(".");this.localNoises[f]!==void 0&&(e=f,i=this.localNoises[f])}let r="root";i?r=M("noise::"+i):this.localSecrets[""]&&(r=M(r+"::"+this.localSecrets[""])),e===null||e===""||e.split(".").filter(Boolean).length;for(let u=1;u<=n.length;u++){const f=n.slice(0,u).join(".");if(this.localSecrets[f]){if(e!==null&&e!==""){const p=e+".";if(!(f===e||f.startsWith(p)))continue}r=M(r+"::"+this.localSecrets[f])}}return r==="root"?"":r}rebuildIndex(){const n={};for(const e of this._shortTermMemory){const i=e.path,r=i.split(".").filter(Boolean),u=this.resolveBranchScope(r),f=u&&u.length>0&&$t(r,u);if(e.operator==="-"){if(i===""){for(const s of Object.keys(n))delete n[s];continue}const p=i+".";for(const s of Object.keys(n))(s===i||s.startsWith(p))&&delete n[s];continue}f||(n[i]=e.value)}this.index=n}getIndex(n){return this.index[n.join(".")]}setIndex(n,e){this.index[n.join(".")]=e}resolveIndexPointerPath(n,e=8){let i=n;for(let r=0;r<e;r++){const u=this.getIndex(i);if(j(u)){i=u.__ptr.split(".").filter(Boolean);continue}let f=!1;for(let p=i.length-1;p>=0;p--){const s=i.slice(0,p),h=this.getIndex(s);if(!j(h))continue;const k=h.__ptr.split(".").filter(Boolean),m=i.slice(p);i=[...k,...m],f=!0;break}if(!f)return{path:i,raw:u}}return{path:i,raw:void 0}}setBranchBlob(n,e){const i=n.join(".");this.encryptedBranches[i]=e}getBranchBlob(n){const e=n.join(".");return this.encryptedBranches[e]}resolveBranchScope(n){let e=null;this.localSecrets[""]&&(e=[]);for(let i=1;i<=n.length;i++){const r=n.slice(0,i),u=r.join(".");this.localSecrets[u]&&(e=r)}return e}readPath(n){const e=this.resolveBranchScope(n);if(e&&e.length>0&&$t(n,e)){if(n.length===e.length)return;const p=this.computeEffectiveSecret(e);if(!p)return null;const s=this.getBranchBlob(e);if(!s)return;const h=U(s,p,e);if(!h||typeof h!="object")return;const k=n.slice(e.length);let m=h;for(const S of k){if(!m||typeof m!="object")return;m=m[S]}return j(m)?this.readPath(m.__ptr.split(".").filter(Boolean)):(qt(m),m)}const i=this.getIndex(n);if(j(i))return i;const r=this.resolveIndexPointerPath(n),u=r.raw;if(u===void 0)return r.path.length===n.length&&r.path.every((s,h)=>s===n[h])?void 0:this.readPath(r.path);if(j(u))return this.readPath(u.__ptr.split(".").filter(Boolean));if(qt(u)||!Fe(u))return u;const f=this.computeEffectiveSecret(n);return f?U(u,f,n):null}}return Qt}));
package/dist/src/me.d.ts CHANGED
@@ -31,6 +31,9 @@ export declare class ME {
31
31
  private isEvalCall;
32
32
  private isQueryCall;
33
33
  private isDefineOpCall;
34
+ private commitThoughtOnly;
35
+ private commitValueMapping;
36
+ private commitMapping;
34
37
  private postulate;
35
38
  private removeSubtree;
36
39
  private computeEffectiveSecret;
@@ -0,0 +1,18 @@
1
+ import { MappingIntent, NormalizedCall, OperatorRegistry } from './types.js';
2
+ export interface NormalizeCallDeps {
3
+ /**
4
+ * Optional evaluator for legacy JS closures in "=" thunk mode.
5
+ * If omitted, closure-based derivations are rejected for invariance.
6
+ */
7
+ evaluateThunk?: (fn: Function) => any;
8
+ /**
9
+ * Optional resolver for "?" query source paths.
10
+ * Needed only if query normalization should produce concrete output values.
11
+ */
12
+ readPath?: (path: string[]) => any;
13
+ }
14
+ /**
15
+ * Normalize a proxy invocation into pure mapping instructions.
16
+ * This function is side-effect free: it does not mutate kernel state.
17
+ */
18
+ export declare function normalizeCall(operators: OperatorRegistry, intent: MappingIntent, deps?: NormalizeCallDeps): NormalizedCall;
@@ -182,6 +182,40 @@ export interface OperatorModule {
182
182
  kinds?: OperatorKind[];
183
183
  handler: OperatorHandler;
184
184
  }
185
+ /**
186
+ * Canonical operation tags for blind kernel commits.
187
+ * This coexists with legacy `operator` semantics during migration.
188
+ */
189
+ export type MappingOp = "set" | "secret" | "noise" | "ptr" | "id" | "derive" | "query" | "remove";
190
+ /**
191
+ * Proxy/router-level invocation before semantic normalization.
192
+ */
193
+ export interface MappingIntent {
194
+ path: SemanticPath;
195
+ expression: any;
196
+ }
197
+ /**
198
+ * Normalized mapping instruction ready for kernel commit.
199
+ */
200
+ export interface MappingInstruction {
201
+ path: SemanticPath;
202
+ op: MappingOp;
203
+ value: any;
204
+ meta?: Record<string, any>;
205
+ }
206
+ /**
207
+ * Output of the semantic normalization layer.
208
+ * - "commit": produce one or more instructions for storage.
209
+ * - "return": immediate runtime value (root eval/query-like paths), with optional side commits.
210
+ */
211
+ export type NormalizedCall = {
212
+ kind: "commit";
213
+ instructions: MappingInstruction[];
214
+ } | {
215
+ kind: "return";
216
+ value: any;
217
+ instructions?: MappingInstruction[];
218
+ };
185
219
  /**
186
220
  * Invariants that MUST hold for an extracted-ops architecture to remain compatible with current me.ts.
187
221
  */
package/package.json CHANGED
@@ -1,34 +1,44 @@
1
1
  {
2
2
  "name": "this.me",
3
- "version": "3.0.33",
3
+ "version": "3.1.0",
4
4
  "type": "module",
5
- "main": "./dist/me.cjs.js",
5
+ "main": "./dist/me.cjs",
6
6
  "module": "./dist/me.es.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
+ "types": "./dist/index.d.ts",
10
11
  "browser": "./dist/me.es.js",
11
12
  "import": "./dist/me.es.js",
12
- "require": "./dist/me.cjs.js"
13
+ "require": "./dist/me.cjs"
13
14
  }
14
15
  },
15
16
  "scripts": {
16
- "dev": "vite",
17
- "build": "vite build",
18
- "preview": "vite preview",
17
+ "dev": "vite --config vite.config.ts",
18
+ "build": "vite build --config vite.config.ts",
19
+ "preview": "vite preview --config vite.config.ts",
19
20
  "test:ts": "tsc --noEmit",
20
- "prepublishOnly": "npm run build"
21
+ "prepublishOnly": "npm run build",
22
+ "docs:api": "typedoc",
23
+ "docs:api:watch": "typedoc --watch",
24
+ "docs:dev": "vitepress dev docs",
25
+ "docs:build": "vitepress build docs",
26
+ "docs:preview": "vitepress preview docs"
21
27
  },
22
28
  "files": [
23
29
  "dist"
24
30
  ],
25
31
  "dependencies": {
32
+ "fb": "^2.0.0",
26
33
  "js-sha3": "^0.9.3"
27
34
  },
28
35
  "devDependencies": {
29
- "@types/node": "^24.10.1",
36
+ "@types/node": "^24.10.13",
37
+ "typedoc": "^0.28.16",
38
+ "typedoc-plugin-markdown": "^4.9.0",
30
39
  "vite": "^7.0.6",
31
- "vite-plugin-dts": "^4.5.4"
40
+ "vite-plugin-dts": "^4.5.4",
41
+ "vitepress": "^1.6.4"
32
42
  },
33
43
  "description": ".me is your identity trust through cryptographic signatures.",
34
44
  "keywords": [
@@ -1,46 +0,0 @@
1
- import { Thought } from './types.js';
2
- export type MEProxy = ME & {
3
- [key: string]: any;
4
- (...args: any[]): MEProxy;
5
- };
6
- export declare function hashFn(input: string): string;
7
- export declare class ME {
8
- [key: string]: any;
9
- private localSecrets;
10
- private localNoises;
11
- private encryptedBranches;
12
- private index;
13
- private _shortTermMemory;
14
- get shortTermMemory(): Thought[];
15
- private operators;
16
- /**
17
- * Constructor base:
18
- * me = new ME(expression?)
19
- *
20
- * Esto es equivalente a llamar:
21
- * me(expression) en la raíz.
22
- */
23
- constructor(expression?: any);
24
- private isRemoveCall;
25
- private createProxy;
26
- private handleCall;
27
- private normalizeArgs;
28
- private opKind;
29
- private isSecretScopeCall;
30
- private isNoiseScopeCall;
31
- private isPointerCall;
32
- private isIdentityCall;
33
- private isEvalCall;
34
- private isQueryCall;
35
- private isDefineOpCall;
36
- private postulate;
37
- private removeSubtree;
38
- private computeEffectiveSecret;
39
- private rebuildIndex;
40
- private getIndex;
41
- private resolveIndexPointerPath;
42
- private setBranchBlob;
43
- private getBranchBlob;
44
- private resolveBranchScope;
45
- private readPath;
46
- }