mailcycle-mcp 0.4.2 → 0.4.3
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/README.md +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ Each agent has a send mode, set in the app:
|
|
|
48
48
|
|
|
49
49
|
Mail an agent reads can contain instructions written by whoever sent it. Reply only limits what those can make it do. Message bodies are passed to the model marked as the sender's words.
|
|
50
50
|
|
|
51
|
-
Agents send from
|
|
51
|
+
Agents send only from the addresses you assign them, within your plan's daily sending limit.
|
|
52
52
|
|
|
53
53
|
To send with a name, like "Support at Acme", set **Sender name** on the agent's page in the app. The agent picks it up on its next send.
|
|
54
54
|
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Copyright (c) 2026 Northlab Studios Ltd. All rights reserved. See LICENSE.
|
|
3
|
-
var it=Object.defineProperty;var st=(e,t)=>{for(var n in t)it(e,n,{get:t[n],enumerable:!0})};var X="0.4.2";var U=class extends Error{constructor(n,o,r){super(r);this.status=n;this.code=o;this.name="MailcycleError"}};function B(e){return e instanceof U&&e.status===401}function Ee(e,t){return new U(e,String(t.code??"error"),String(t.message??`Mailcycle answered ${e}.`))}var A=class{constructor(t,n){this.baseUrl=t;this.token=n}async request(t,n,o,r){let a=await this.fetch(t,n,o,r);if(a.type==="opaqueredirect"||a.status>=300&&a.status<400)throw new U(a.status||0,"unexpected_redirect",`${this.baseUrl} tried to redirect the request, which is not allowed.`);let i=await a.text(),s=i?JSON.parse(i):{};if(!a.ok)throw Ee(a.status,s);return s}async fetch(t,n,o,r){try{return await this.rawFetch(t,n,o,r)}catch(a){throw a.name==="AbortError"?a:new U(0,"unreachable",`Could not reach Mailcycle at ${this.baseUrl}. Check the connection.`)}}rawFetch(t,n,o,r){return fetch(`${this.baseUrl}${n}`,{method:t,headers:{...this.token?{Authorization:`Bearer ${this.token}`}:{},...o===void 0?{}:{"Content-Type":"application/json"},"User-Agent":`mailcycle-mcp/${X}`},redirect:"manual",...o===void 0?{}:{body:JSON.stringify(o)},...r?{signal:r}:{}})}createPairingSession(t){return this.request("POST","/workers/pairing-session",{platform:"agent",deviceName:t})}pollPairing(t){return this.request("GET",`/workers/pairing-session/${encodeURIComponent(t)}`)}self(){return this.request("GET","/workers/self")}heartbeat(){return this.request("POST","/workers/heartbeat",{})}messages(t,n){let o=new URLSearchParams;for(let[r,a]of Object.entries(t))a!==void 0&&o.set(r,String(a));return this.request("GET",`/workers/messages?${o}`,void 0,n)}send(t){return this.request("POST","/messages/send",t)}async attachment(t,n){let o=await this.fetch("GET",`/messages/${encodeURIComponent(t)}/attachments/${n}`);if(!o.ok){let r=await o.text(),a={};try{a=r?JSON.parse(r):{}}catch{}throw Ee(o.status,a)}return new Uint8Array(await o.arrayBuffer())}};var le={};st(le,{getRandomValues:()=>ce});var ce=void 0;var j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function v(e){let t=[];for(let n=0;n<e.length;n+=1){let o=e.charCodeAt(n);if(o>=55296&&o<=56319&&n+1<e.length){let r=e.charCodeAt(n+1);r>=56320&&r<=57343&&(o=65536+(o-55296<<10)+(r-56320),n+=1)}o<128?t.push(o):o<2048?t.push(192|o>>6,128|o&63):o<65536?t.push(224|o>>12,128|o>>6&63,128|o&63):t.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|o&63)}return new Uint8Array(t)}function P(e){let t="";for(let n=0;n<e.length;){let o=e[n],r;o<128?(r=o,n+=1):o<224?(r=(o&31)<<6|e[n+1]&63,n+=2):o<240?(r=(o&15)<<12|(e[n+1]&63)<<6|e[n+2]&63,n+=3):(r=(o&7)<<18|(e[n+1]&63)<<12|(e[n+2]&63)<<6|e[n+3]&63,n+=4),r>65535?(r-=65536,t+=String.fromCharCode(55296+(r>>10),56320+(r&1023))):t+=String.fromCharCode(r)}return t}function N(e){let t="";for(let n=0;n<e.length;n+=3){let o=e[n],r=n+1<e.length?e[n+1]:-1,a=n+2<e.length?e[n+2]:-1;if(t+=j[o>>2],t+=j[(o&3)<<4|(r>=0?r>>4:0)],r<0||(t+=j[(r&15)<<2|(a>=0?a>>6:0)],a<0))break;t+=j[a&63]}return t}var T=class extends Error{constructor(t="Not canonical base64url."){super(t),this.name="Base64UrlError"}};function y(e){if(e.length%4===1)throw new T("Truncated base64url.");let n=new Uint8Array(Math.floor(e.length*6/8)),o=0,r=0,a=0;for(let i=0;i<e.length;i+=1){let s=j.indexOf(e[i]);if(s<0)throw new T(`Unexpected character at ${i}.`);o=o<<6|s,r+=6,r>=8&&(r-=8,n[a]=o>>r&255,a+=1)}if(r>0&&(o&(1<<r)-1)!==0)throw new T("Non-canonical trailing bits.");return n}function O(...e){let t=e.reduce((r,a)=>r+a.length,0),n=new Uint8Array(t),o=0;for(let r of e)n.set(r,o),o+=r.length;return n}function Te(){let e=[],t=globalThis.crypto;return typeof t?.getRandomValues=="function"&&e.push({name:"webcrypto",fill:n=>void t.getRandomValues(n)}),typeof le?.getRandomValues=="function"&&e.push({name:"expo-crypto",fill:n=>void(void 0)(n)}),e}var Z=class extends Error{constructor(){super("No cryptographically secure random source available. Mailcycle will not generate key material without one."),this.name="NoRandomSourceError"}};function L(e){let t=Te()[0];if(!t)throw new Z;let n=new Uint8Array(e);return t.fill(n),n}function Q(e,t){return(e<<t|e>>>32-t)>>>0}function S(e,t,n,o,r){e[t]=e[t]+e[n]>>>0,e[r]=Q(e[r]^e[t],16),e[o]=e[o]+e[r]>>>0,e[n]=Q(e[n]^e[o],12),e[t]=e[t]+e[n]>>>0,e[r]=Q(e[r]^e[t],8),e[o]=e[o]+e[r]>>>0,e[n]=Q(e[n]^e[o],7)}function K(e,t,n){if(e.length!==32)throw new Error("ChaCha20 key must be 32 bytes.");if(t.length!==12)throw new Error("ChaCha20 nonce must be 12 bytes.");let o=new DataView(e.buffer,e.byteOffset,e.byteLength),r=new DataView(t.buffer,t.byteOffset,t.byteLength),a=new Uint32Array(16);a[0]=1634760805,a[1]=857760878,a[2]=2036477234,a[3]=1797285236;for(let l=0;l<8;l+=1)a[4+l]=o.getUint32(l*4,!0);a[13]=r.getUint32(0,!0),a[14]=r.getUint32(4,!0),a[15]=r.getUint32(8,!0);let i=new Uint8Array(n.length),s=new Uint32Array(16),c=new Uint8Array(64),m=new DataView(c.buffer);for(let l=0;l*64<n.length;l+=1){s.set(a),s[12]=l;for(let p=0;p<10;p+=1)S(s,0,4,8,12),S(s,1,5,9,13),S(s,2,6,10,14),S(s,3,7,11,15),S(s,0,5,10,15),S(s,1,6,11,12),S(s,2,7,8,13),S(s,3,4,9,14);for(let p=0;p<16;p+=1){let se=p===12?s[p]+l>>>0:s[p]+a[p]>>>0;m.setUint32(p*4,se,!0)}let u=l*64,g=Math.min(64,n.length-u);for(let p=0;p<g;p+=1)i[u+p]=n[u+p]^c[p]}return i}var lt=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ue=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),C=64,Ce=32,ee=8,d=new Uint32Array(64),_=new Uint32Array(ee),me=new Uint32Array(ee);function Ie(){d.fill(0),_.fill(0),me.fill(0)}function F(e){for(let m=16;m<64;m+=1){let l=d[m-15],u=d[m-2],g=(l>>>7|l<<25)^(l>>>18|l<<14)^l>>>3,p=(u>>>17|u<<15)^(u>>>19|u<<13)^u>>>10;d[m]=d[m-16]+g+d[m-7]+p>>>0}let t=e[0],n=e[1],o=e[2],r=e[3],a=e[4],i=e[5],s=e[6],c=e[7];for(let m=0;m<64;m+=1){let l=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),u=a&i^~a&s,g=c+l+u+lt[m]+d[m]>>>0,p=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),se=t&n^t&o^n&o,at=p+se>>>0;c=s,s=i,i=a,a=r+g>>>0,r=o,o=n,n=t,t=g+at>>>0}e[0]=e[0]+t>>>0,e[1]=e[1]+n>>>0,e[2]=e[2]+o>>>0,e[3]=e[3]+r>>>0,e[4]=e[4]+a>>>0,e[5]=e[5]+i>>>0,e[6]=e[6]+s>>>0,e[7]=e[7]+c>>>0}function _e(e,t){for(let n=0;n<16;n+=1){let o=t+n*4;d[n]=(e[o]<<24|e[o+1]<<16|e[o+2]<<8|e[o+3])>>>0}}function $e(e,t,n){let o=t.length,r=o-o%C;for(let u=0;u<r;u+=C)_e(t,u),F(e);let a=o-r,i=new Uint8Array(a+9+63>=128?128:64);i.set(t.subarray(r)),i[a]=128;let s=(n+o)*8,c=i.length,m=Math.floor(s/4294967296),l=s>>>0;i[c-8]=m>>>24&255,i[c-7]=m>>>16&255,i[c-6]=m>>>8&255,i[c-5]=m&255,i[c-4]=l>>>24&255,i[c-3]=l>>>16&255,i[c-2]=l>>>8&255,i[c-1]=l&255;for(let u=0;u<c;u+=C)_e(i,u),F(e)}function Re(e){let t=new Uint8Array(Ce);for(let n=0;n<ee;n+=1){let o=e[n],r=n*4;t[r]=o>>>24&255,t[r+1]=o>>>16&255,t[r+2]=o>>>8&255,t[r+3]=o&255}return t}function W(e){let t=new Uint32Array(ue);$e(t,e,0);let n=Re(t);return Ie(),t.fill(0),n}function ut(e){let t=new Uint8Array(C);t.set(e.length>C?W(e):e);let n=new Uint32Array(ue);for(let r=0;r<16;r+=1){let a=r*4;d[r]=((t[a]^54)<<24|(t[a+1]^54)<<16|(t[a+2]^54)<<8|t[a+3]^54)>>>0}F(n);let o=new Uint32Array(ue);for(let r=0;r<16;r+=1){let a=r*4;d[r]=((t[a]^92)<<24|(t[a+1]^92)<<16|(t[a+2]^92)<<8|t[a+3]^92)>>>0}return F(o),t.fill(0),{inner:n,outer:o}}function mt(e,t,n){_.set(e.inner),$e(_,t,C),me.set(_),_.set(e.outer),dt(me),F(_),n.set(_)}function dt(e){d[0]=e[0],d[1]=e[1],d[2]=e[2],d[3]=e[3],d[4]=e[4],d[5]=e[5],d[6]=e[6],d[7]=e[7],d[8]=2147483648,d[9]=0,d[10]=0,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=(C+Ce)*8}function E(e,t){let n=new Uint32Array(ee);return mt(ut(e),t,n),Ie(),Re(n)}function te(e,t){if(e.length!==t.length)return!1;let n=0;for(let o=0;o<e.length;o+=1)n|=e[o]^t[o];return n===0}function ft(e){let t=new Uint8Array(8);return t[4]=e>>>24&255,t[5]=e>>>16&255,t[6]=e>>>8&255,t[7]=e&255,t}function pt(e,t,n,o){return o===1?O(e,t,n):O(e,t,n,ft(n.length))}function ht(e){if(e.length!==64)throw new Error("Expected a 64-byte secret.");return{encryption:e.slice(0,32),mac:e.slice(32,64)}}var b=class extends Error{constructor(t="This data could not be decrypted with the key provided."){super(t),this.name="DecryptionError"}};function gt(e,t,n=""){let{encryption:o,mac:r}=ht(e);if(typeof t?.n!="string"||typeof t.c!="string"||typeof t.t!="string")throw new b;let a,i,s;try{a=y(t.n),i=y(t.c),s=y(t.t)}catch{throw new b}if(a.length!==12)throw new b;let c=t.v===2?2:1,m=E(r,pt(a,i,v(n),c));if(!te(m,s))throw new b;return K(o,a,i)}function fe(e,t,n=""){let o=gt(e,t,n);try{return JSON.parse(P(o))}catch{throw new b}}function w(e){let t=new Float64Array(16);if(e)for(let n=0;n<e.length;n+=1)t[n]=e[n];return t}var yt=w([56129,1]);function V(e){let t=1;for(let n=0;n<16;n+=1){let o=e[n]+t+65535;t=Math.floor(o/65536),e[n]=o-t*65536}e[0]=e[0]+(t-1)+37*(t-1)}function D(e,t,n){let o=~(n-1);for(let r=0;r<16;r+=1){let a=o&(e[r]^t[r]);e[r]=e[r]^a,t[r]=t[r]^a}}function bt(e,t){let n=w(),o=w();for(let r=0;r<16;r+=1)o[r]=t[r];V(o),V(o),V(o);for(let r=0;r<2;r+=1){n[0]=o[0]-65517;for(let i=1;i<15;i+=1)n[i]=o[i]-65535-(n[i-1]>>16&1),n[i-1]=n[i-1]&65535;n[15]=o[15]-32767-(n[14]>>16&1);let a=n[15]>>16&1;n[14]=n[14]&65535,D(o,n,1-a)}for(let r=0;r<16;r+=1)e[2*r]=o[r]&255,e[2*r+1]=o[r]>>8}function wt(e,t){for(let n=0;n<16;n+=1)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]=e[15]&32767}function re(e,t,n){for(let o=0;o<16;o+=1)e[o]=t[o]+n[o]}function ne(e,t,n){for(let o=0;o<16;o+=1)e[o]=t[o]-n[o]}var xt=new Float64Array(31);function k(e,t,n){let o=xt;for(let r=0;r<31;r+=1)o[r]=0;for(let r=0;r<16;r+=1){let a=t[r];for(let i=0;i<16;i+=1)o[r+i]=o[r+i]+a*n[i]}for(let r=0;r<15;r+=1)o[r]=o[r]+38*o[r+16];for(let r=0;r<16;r+=1)e[r]=o[r];V(e),V(e),o.fill(0)}function z(e,t){k(e,t,t)}function At(e,t){let n=w();for(let o=0;o<16;o+=1)n[o]=t[o];for(let o=253;o>=0;o-=1)z(n,n),o!==2&&o!==4&&k(n,n,t);for(let o=0;o<16;o+=1)e[o]=n[o]}function Me(e,t){if(e.length!==32)throw new Error("x25519: scalar must be 32 bytes");if(t.length!==32)throw new Error("x25519: point must be 32 bytes");let n=new Uint8Array(32);for(let u=0;u<31;u+=1)n[u]=e[u];n[31]=e[31]&127|64,n[0]=n[0]&248;let o=w();wt(o,t);let r=w(),a=w(),i=w(),s=w(),c=w(),m=w();for(let u=0;u<16;u+=1)a[u]=o[u];r[0]=1,s[0]=1;for(let u=254;u>=0;u-=1){let g=n[u>>>3]>>>(u&7)&1;D(r,a,g),D(i,s,g),re(c,r,i),ne(r,r,i),re(i,a,s),ne(a,a,s),z(s,c),z(m,r),k(r,i,r),k(i,a,c),re(c,r,i),ne(r,r,i),z(a,r),ne(i,s,m),k(r,i,yt),re(r,r,s),k(i,i,r),k(r,s,m),k(s,a,o),z(a,c),D(r,a,g),D(i,s,g)}At(i,i),k(r,r,i);let l=new Uint8Array(32);return bt(l,r),l}var je=new Uint8Array(32);je[0]=9;function vt(e){return Me(e,je)}function H(e){return vt(e)}function Pe(e,t){return Me(e,t)}function Ne(e){let t=0;for(let n=0;n<e.length;n+=1)t|=e[n];return t===0}var pe=["able","about","above","absent","absorb","abstract","accent","accident","account","accuse","ache","achieve","acid","acorn","acquire","across","action","actor","actual","adapt","addict","address","adjust","admit","adopt","adult","advance","advice","affair","afford","afraid","after","again","agent","agree","ahead","aim","air","alarm","album","alert","alien","align","alike","alive","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","amber","ambush","among","amount","ample","amused","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","april","arch","arctic","area","arena","argue","arise","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artist","artwork","ashamed","aside","ask","aspect","asphalt","assault","asset","assist","assume","asthma","athlete","atlas","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","berry","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","birch","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","cattle","caught","cause","caution","cave","cedar","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","fern","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","ivy","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","moss","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plum","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quiet","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"],St=pe.length,Et=new Map(pe.map((e,t)=>[e,t]));var Tt=128,Zr=Tt/32;var x=class extends Error{constructor(t="This data could not be decrypted with the key provided."){super(t),this.name="OpenError"}};function q(...e){let t=0;for(let r of e)t+=r.length;let n=new Uint8Array(t),o=0;for(let r of e)n.set(r,o),o+=r.length;return n}function Le(e){e.fill(0)}var _t=new Uint8Array([47,101,110,99]),Ct=new Uint8Array([47,109,97,99]),It=new Uint8Array([109,97,105,108,99,121,99,108,101,47,118,49,47,115,101,97,108,45,116,111,45,112,117,98,108,105,99]);function $t(e,t,n){let o=q(It,e,t,n),r=new Uint8Array(64);return r.set(E(e,q(o,_t)),0),r.set(E(e,q(o,Ct)),32),r}function Rt(e,t,n,o){if(o===1)return q(e,t,n);let r=new Uint8Array(8);return r[4]=n.length>>>24&255,r[5]=n.length>>>16&255,r[6]=n.length>>>8&255,r[7]=n.length&255,q(e,t,n,r)}function he(e,t,n,o=1){if(e.length!==32)throw new x("Private key must be 32 bytes.");if(t.ephemeralPublicKey.length!==32)throw new x;if(t.nonce.length!==12)throw new x;let r=Pe(e,t.ephemeralPublicKey);if(Ne(r))throw new x;let a=$t(r,t.ephemeralPublicKey,H(e));try{let i=E(a.subarray(32,64),Rt(t.nonce,t.ciphertext,n,o));if(!te(i,t.tag))throw new x;return K(a.subarray(0,32),t.nonce,t.ciphertext)}finally{Le(r),Le(a)}}function Bt(e){return{ephemeralPublicKey:y(e.epk),nonce:y(e.n),ciphertext:y(e.c),tag:y(e.t)}}function Fe(e){return typeof e=="object"&&e!==null&&typeof e.epk=="string"}function We(e,t,n=""){try{return he(e,Bt(t),v(n),t?.v===2?2:1)}catch(o){throw o instanceof x||o instanceof T?new b:o instanceof TypeError?new b:o}}var Mt=[77,67,65,49],jt=[77,67,65,50],Ke=80;function De(e,t,n,o){if(o.length<Ke)throw new b;let r=jt.every((i,s)=>o[s]===i)?2:1;if(r===1&&!Mt.every((i,s)=>o[s]===i))throw new b;let a={ephemeralPublicKey:o.subarray(4,36),nonce:o.subarray(36,48),tag:o.subarray(48,80),ciphertext:o.subarray(Ke)};try{return he(e,a,v(`${t}:${n}`),r)}catch(i){throw i instanceof x?new b:i}}var oe=class{symmetric=new Map;sealing=new Map;senderName=null;load(t,n,o){let r=y(t);if(r.length!==64)throw new Error("The saved wrap secret is malformed. Run `mailcycle-mcp pair` again.");let a=fe(r,o,n);this.symmetric=new Map(Object.entries(a.keys).map(([i,s])=>[i,y(s)])),this.sealing=new Map(Object.entries(a.sealingKeys??{}).map(([i,s])=>[i,y(s)])),this.senderName=a.senderName?.trim()||null}has(t){return this.sealing.has(t)||this.symmetric.has(t)}open(t,n,o){if(Fe(o)){let a=this.sealing.get(t);if(!a)throw new I(t);return JSON.parse(P(We(a,o,`${t}:${n}`)))}let r=this.symmetric.get(t);if(!r)throw new I(t);return fe(r,o,n)}openAttachment(t,n,o,r){let a=this.sealing.get(t);if(!a)throw new I(t);return De(a,t,`${t}/${n}/${o}`,r)}},I=class extends Error{constructor(n){super("This agent has no key for that address yet. Open the agent in the Mailcycle app and add the address again.");this.inboxId=n;this.name="MissingKeyError"}};var h=e=>typeof e=="string"?e:"";function Pt(e){return typeof e=="string"?e:e&&typeof e=="object"?h(e.address):""}function Nt(e){return e.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/gi,"").replace(/<br\s*\/?>/gi,`
|
|
3
|
+
var it=Object.defineProperty;var st=(e,t)=>{for(var n in t)it(e,n,{get:t[n],enumerable:!0})};var X="0.4.3";var U=class extends Error{constructor(n,o,r){super(r);this.status=n;this.code=o;this.name="MailcycleError"}};function B(e){return e instanceof U&&e.status===401}function Ee(e,t){return new U(e,String(t.code??"error"),String(t.message??`Mailcycle answered ${e}.`))}var A=class{constructor(t,n){this.baseUrl=t;this.token=n}async request(t,n,o,r){let a=await this.fetch(t,n,o,r);if(a.type==="opaqueredirect"||a.status>=300&&a.status<400)throw new U(a.status||0,"unexpected_redirect",`${this.baseUrl} tried to redirect the request, which is not allowed.`);let i=await a.text(),s=i?JSON.parse(i):{};if(!a.ok)throw Ee(a.status,s);return s}async fetch(t,n,o,r){try{return await this.rawFetch(t,n,o,r)}catch(a){throw a.name==="AbortError"?a:new U(0,"unreachable",`Could not reach Mailcycle at ${this.baseUrl}. Check the connection.`)}}rawFetch(t,n,o,r){return fetch(`${this.baseUrl}${n}`,{method:t,headers:{...this.token?{Authorization:`Bearer ${this.token}`}:{},...o===void 0?{}:{"Content-Type":"application/json"},"User-Agent":`mailcycle-mcp/${X}`},redirect:"manual",...o===void 0?{}:{body:JSON.stringify(o)},...r?{signal:r}:{}})}createPairingSession(t){return this.request("POST","/workers/pairing-session",{platform:"agent",deviceName:t})}pollPairing(t){return this.request("GET",`/workers/pairing-session/${encodeURIComponent(t)}`)}self(){return this.request("GET","/workers/self")}heartbeat(){return this.request("POST","/workers/heartbeat",{})}messages(t,n){let o=new URLSearchParams;for(let[r,a]of Object.entries(t))a!==void 0&&o.set(r,String(a));return this.request("GET",`/workers/messages?${o}`,void 0,n)}send(t){return this.request("POST","/messages/send",t)}async attachment(t,n){let o=await this.fetch("GET",`/messages/${encodeURIComponent(t)}/attachments/${n}`);if(!o.ok){let r=await o.text(),a={};try{a=r?JSON.parse(r):{}}catch{}throw Ee(o.status,a)}return new Uint8Array(await o.arrayBuffer())}};var le={};st(le,{getRandomValues:()=>ce});var ce=void 0;var j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function v(e){let t=[];for(let n=0;n<e.length;n+=1){let o=e.charCodeAt(n);if(o>=55296&&o<=56319&&n+1<e.length){let r=e.charCodeAt(n+1);r>=56320&&r<=57343&&(o=65536+(o-55296<<10)+(r-56320),n+=1)}o<128?t.push(o):o<2048?t.push(192|o>>6,128|o&63):o<65536?t.push(224|o>>12,128|o>>6&63,128|o&63):t.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|o&63)}return new Uint8Array(t)}function P(e){let t="";for(let n=0;n<e.length;){let o=e[n],r;o<128?(r=o,n+=1):o<224?(r=(o&31)<<6|e[n+1]&63,n+=2):o<240?(r=(o&15)<<12|(e[n+1]&63)<<6|e[n+2]&63,n+=3):(r=(o&7)<<18|(e[n+1]&63)<<12|(e[n+2]&63)<<6|e[n+3]&63,n+=4),r>65535?(r-=65536,t+=String.fromCharCode(55296+(r>>10),56320+(r&1023))):t+=String.fromCharCode(r)}return t}function N(e){let t="";for(let n=0;n<e.length;n+=3){let o=e[n],r=n+1<e.length?e[n+1]:-1,a=n+2<e.length?e[n+2]:-1;if(t+=j[o>>2],t+=j[(o&3)<<4|(r>=0?r>>4:0)],r<0||(t+=j[(r&15)<<2|(a>=0?a>>6:0)],a<0))break;t+=j[a&63]}return t}var T=class extends Error{constructor(t="Not canonical base64url."){super(t),this.name="Base64UrlError"}};function y(e){if(e.length%4===1)throw new T("Truncated base64url.");let n=new Uint8Array(Math.floor(e.length*6/8)),o=0,r=0,a=0;for(let i=0;i<e.length;i+=1){let s=j.indexOf(e[i]);if(s<0)throw new T(`Unexpected character at ${i}.`);o=o<<6|s,r+=6,r>=8&&(r-=8,n[a]=o>>r&255,a+=1)}if(r>0&&(o&(1<<r)-1)!==0)throw new T("Non-canonical trailing bits.");return n}function O(...e){let t=e.reduce((r,a)=>r+a.length,0),n=new Uint8Array(t),o=0;for(let r of e)n.set(r,o),o+=r.length;return n}function Te(){let e=[],t=globalThis.crypto;return typeof t?.getRandomValues=="function"&&e.push({name:"webcrypto",fill:n=>void t.getRandomValues(n)}),typeof le?.getRandomValues=="function"&&e.push({name:"expo-crypto",fill:n=>void(void 0)(n)}),e}var Z=class extends Error{constructor(){super("No cryptographically secure random source available. Mailcycle will not generate key material without one."),this.name="NoRandomSourceError"}};function L(e){let t=Te()[0];if(!t)throw new Z;let n=new Uint8Array(e);return t.fill(n),n}function Q(e,t){return(e<<t|e>>>32-t)>>>0}function S(e,t,n,o,r){e[t]=e[t]+e[n]>>>0,e[r]=Q(e[r]^e[t],16),e[o]=e[o]+e[r]>>>0,e[n]=Q(e[n]^e[o],12),e[t]=e[t]+e[n]>>>0,e[r]=Q(e[r]^e[t],8),e[o]=e[o]+e[r]>>>0,e[n]=Q(e[n]^e[o],7)}function K(e,t,n){if(e.length!==32)throw new Error("ChaCha20 key must be 32 bytes.");if(t.length!==12)throw new Error("ChaCha20 nonce must be 12 bytes.");let o=new DataView(e.buffer,e.byteOffset,e.byteLength),r=new DataView(t.buffer,t.byteOffset,t.byteLength),a=new Uint32Array(16);a[0]=1634760805,a[1]=857760878,a[2]=2036477234,a[3]=1797285236;for(let l=0;l<8;l+=1)a[4+l]=o.getUint32(l*4,!0);a[13]=r.getUint32(0,!0),a[14]=r.getUint32(4,!0),a[15]=r.getUint32(8,!0);let i=new Uint8Array(n.length),s=new Uint32Array(16),c=new Uint8Array(64),m=new DataView(c.buffer);for(let l=0;l*64<n.length;l+=1){s.set(a),s[12]=l;for(let p=0;p<10;p+=1)S(s,0,4,8,12),S(s,1,5,9,13),S(s,2,6,10,14),S(s,3,7,11,15),S(s,0,5,10,15),S(s,1,6,11,12),S(s,2,7,8,13),S(s,3,4,9,14);for(let p=0;p<16;p+=1){let se=p===12?s[p]+l>>>0:s[p]+a[p]>>>0;m.setUint32(p*4,se,!0)}let u=l*64,g=Math.min(64,n.length-u);for(let p=0;p<g;p+=1)i[u+p]=n[u+p]^c[p]}return i}var lt=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ue=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),C=64,Ce=32,ee=8,d=new Uint32Array(64),_=new Uint32Array(ee),me=new Uint32Array(ee);function Ie(){d.fill(0),_.fill(0),me.fill(0)}function F(e){for(let m=16;m<64;m+=1){let l=d[m-15],u=d[m-2],g=(l>>>7|l<<25)^(l>>>18|l<<14)^l>>>3,p=(u>>>17|u<<15)^(u>>>19|u<<13)^u>>>10;d[m]=d[m-16]+g+d[m-7]+p>>>0}let t=e[0],n=e[1],o=e[2],r=e[3],a=e[4],i=e[5],s=e[6],c=e[7];for(let m=0;m<64;m+=1){let l=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),u=a&i^~a&s,g=c+l+u+lt[m]+d[m]>>>0,p=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),se=t&n^t&o^n&o,at=p+se>>>0;c=s,s=i,i=a,a=r+g>>>0,r=o,o=n,n=t,t=g+at>>>0}e[0]=e[0]+t>>>0,e[1]=e[1]+n>>>0,e[2]=e[2]+o>>>0,e[3]=e[3]+r>>>0,e[4]=e[4]+a>>>0,e[5]=e[5]+i>>>0,e[6]=e[6]+s>>>0,e[7]=e[7]+c>>>0}function _e(e,t){for(let n=0;n<16;n+=1){let o=t+n*4;d[n]=(e[o]<<24|e[o+1]<<16|e[o+2]<<8|e[o+3])>>>0}}function $e(e,t,n){let o=t.length,r=o-o%C;for(let u=0;u<r;u+=C)_e(t,u),F(e);let a=o-r,i=new Uint8Array(a+9+63>=128?128:64);i.set(t.subarray(r)),i[a]=128;let s=(n+o)*8,c=i.length,m=Math.floor(s/4294967296),l=s>>>0;i[c-8]=m>>>24&255,i[c-7]=m>>>16&255,i[c-6]=m>>>8&255,i[c-5]=m&255,i[c-4]=l>>>24&255,i[c-3]=l>>>16&255,i[c-2]=l>>>8&255,i[c-1]=l&255;for(let u=0;u<c;u+=C)_e(i,u),F(e)}function Re(e){let t=new Uint8Array(Ce);for(let n=0;n<ee;n+=1){let o=e[n],r=n*4;t[r]=o>>>24&255,t[r+1]=o>>>16&255,t[r+2]=o>>>8&255,t[r+3]=o&255}return t}function W(e){let t=new Uint32Array(ue);$e(t,e,0);let n=Re(t);return Ie(),t.fill(0),n}function ut(e){let t=new Uint8Array(C);t.set(e.length>C?W(e):e);let n=new Uint32Array(ue);for(let r=0;r<16;r+=1){let a=r*4;d[r]=((t[a]^54)<<24|(t[a+1]^54)<<16|(t[a+2]^54)<<8|t[a+3]^54)>>>0}F(n);let o=new Uint32Array(ue);for(let r=0;r<16;r+=1){let a=r*4;d[r]=((t[a]^92)<<24|(t[a+1]^92)<<16|(t[a+2]^92)<<8|t[a+3]^92)>>>0}return F(o),t.fill(0),{inner:n,outer:o}}function mt(e,t,n){_.set(e.inner),$e(_,t,C),me.set(_),_.set(e.outer),dt(me),F(_),n.set(_)}function dt(e){d[0]=e[0],d[1]=e[1],d[2]=e[2],d[3]=e[3],d[4]=e[4],d[5]=e[5],d[6]=e[6],d[7]=e[7],d[8]=2147483648,d[9]=0,d[10]=0,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=(C+Ce)*8}function E(e,t){let n=new Uint32Array(ee);return mt(ut(e),t,n),Ie(),Re(n)}function te(e,t){if(e.length!==t.length)return!1;let n=0;for(let o=0;o<e.length;o+=1)n|=e[o]^t[o];return n===0}function ft(e){let t=new Uint8Array(8);return t[4]=e>>>24&255,t[5]=e>>>16&255,t[6]=e>>>8&255,t[7]=e&255,t}function pt(e,t,n,o){return o===1?O(e,t,n):O(e,t,n,ft(n.length))}function ht(e){if(e.length!==64)throw new Error("Expected a 64-byte secret.");return{encryption:e.slice(0,32),mac:e.slice(32,64)}}var b=class extends Error{constructor(t="This data could not be decrypted with the key provided."){super(t),this.name="DecryptionError"}};function gt(e,t,n=""){let{encryption:o,mac:r}=ht(e);if(typeof t?.n!="string"||typeof t.c!="string"||typeof t.t!="string")throw new b;let a,i,s;try{a=y(t.n),i=y(t.c),s=y(t.t)}catch{throw new b}if(a.length!==12)throw new b;let c=t.v===2?2:1,m=E(r,pt(a,i,v(n),c));if(!te(m,s))throw new b;return K(o,a,i)}function fe(e,t,n=""){let o=gt(e,t,n);try{return JSON.parse(P(o))}catch{throw new b}}function w(e){let t=new Float64Array(16);if(e)for(let n=0;n<e.length;n+=1)t[n]=e[n];return t}var yt=w([56129,1]);function V(e){let t=1;for(let n=0;n<16;n+=1){let o=e[n]+t+65535;t=Math.floor(o/65536),e[n]=o-t*65536}e[0]=e[0]+(t-1)+37*(t-1)}function D(e,t,n){let o=~(n-1);for(let r=0;r<16;r+=1){let a=o&(e[r]^t[r]);e[r]=e[r]^a,t[r]=t[r]^a}}function bt(e,t){let n=w(),o=w();for(let r=0;r<16;r+=1)o[r]=t[r];V(o),V(o),V(o);for(let r=0;r<2;r+=1){n[0]=o[0]-65517;for(let i=1;i<15;i+=1)n[i]=o[i]-65535-(n[i-1]>>16&1),n[i-1]=n[i-1]&65535;n[15]=o[15]-32767-(n[14]>>16&1);let a=n[15]>>16&1;n[14]=n[14]&65535,D(o,n,1-a)}for(let r=0;r<16;r+=1)e[2*r]=o[r]&255,e[2*r+1]=o[r]>>8}function wt(e,t){for(let n=0;n<16;n+=1)e[n]=t[2*n]+(t[2*n+1]<<8);e[15]=e[15]&32767}function re(e,t,n){for(let o=0;o<16;o+=1)e[o]=t[o]+n[o]}function ne(e,t,n){for(let o=0;o<16;o+=1)e[o]=t[o]-n[o]}var xt=new Float64Array(31);function k(e,t,n){let o=xt;for(let r=0;r<31;r+=1)o[r]=0;for(let r=0;r<16;r+=1){let a=t[r];for(let i=0;i<16;i+=1)o[r+i]=o[r+i]+a*n[i]}for(let r=0;r<15;r+=1)o[r]=o[r]+38*o[r+16];for(let r=0;r<16;r+=1)e[r]=o[r];V(e),V(e),o.fill(0)}function z(e,t){k(e,t,t)}function At(e,t){let n=w();for(let o=0;o<16;o+=1)n[o]=t[o];for(let o=253;o>=0;o-=1)z(n,n),o!==2&&o!==4&&k(n,n,t);for(let o=0;o<16;o+=1)e[o]=n[o]}function Me(e,t){if(e.length!==32)throw new Error("x25519: scalar must be 32 bytes");if(t.length!==32)throw new Error("x25519: point must be 32 bytes");let n=new Uint8Array(32);for(let u=0;u<31;u+=1)n[u]=e[u];n[31]=e[31]&127|64,n[0]=n[0]&248;let o=w();wt(o,t);let r=w(),a=w(),i=w(),s=w(),c=w(),m=w();for(let u=0;u<16;u+=1)a[u]=o[u];r[0]=1,s[0]=1;for(let u=254;u>=0;u-=1){let g=n[u>>>3]>>>(u&7)&1;D(r,a,g),D(i,s,g),re(c,r,i),ne(r,r,i),re(i,a,s),ne(a,a,s),z(s,c),z(m,r),k(r,i,r),k(i,a,c),re(c,r,i),ne(r,r,i),z(a,r),ne(i,s,m),k(r,i,yt),re(r,r,s),k(i,i,r),k(r,s,m),k(s,a,o),z(a,c),D(r,a,g),D(i,s,g)}At(i,i),k(r,r,i);let l=new Uint8Array(32);return bt(l,r),l}var je=new Uint8Array(32);je[0]=9;function vt(e){return Me(e,je)}function H(e){return vt(e)}function Pe(e,t){return Me(e,t)}function Ne(e){let t=0;for(let n=0;n<e.length;n+=1)t|=e[n];return t===0}var pe=["able","about","above","absent","absorb","abstract","accent","accident","account","accuse","ache","achieve","acid","acorn","acquire","across","action","actor","actual","adapt","addict","address","adjust","admit","adopt","adult","advance","advice","affair","afford","afraid","after","again","agent","agree","ahead","aim","air","alarm","album","alert","alien","align","alike","alive","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","amber","ambush","among","amount","ample","amused","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","april","arch","arctic","area","arena","argue","arise","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artist","artwork","ashamed","aside","ask","aspect","asphalt","assault","asset","assist","assume","asthma","athlete","atlas","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","berry","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","birch","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","cattle","caught","cause","caution","cave","cedar","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","fern","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","ivy","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","moss","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plum","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quiet","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"],St=pe.length,Et=new Map(pe.map((e,t)=>[e,t]));var Tt=128,Zr=Tt/32;var x=class extends Error{constructor(t="This data could not be decrypted with the key provided."){super(t),this.name="OpenError"}};function q(...e){let t=0;for(let r of e)t+=r.length;let n=new Uint8Array(t),o=0;for(let r of e)n.set(r,o),o+=r.length;return n}function Le(e){e.fill(0)}var _t=new Uint8Array([47,101,110,99]),Ct=new Uint8Array([47,109,97,99]),It=new Uint8Array([109,97,105,108,99,121,99,108,101,47,118,49,47,115,101,97,108,45,116,111,45,112,117,98,108,105,99]);function $t(e,t,n){let o=q(It,e,t,n),r=new Uint8Array(64);return r.set(E(e,q(o,_t)),0),r.set(E(e,q(o,Ct)),32),r}function Rt(e,t,n,o){if(o===1)return q(e,t,n);let r=new Uint8Array(8);return r[4]=n.length>>>24&255,r[5]=n.length>>>16&255,r[6]=n.length>>>8&255,r[7]=n.length&255,q(e,t,n,r)}function he(e,t,n,o=1){if(e.length!==32)throw new x("Private key must be 32 bytes.");if(t.ephemeralPublicKey.length!==32)throw new x;if(t.nonce.length!==12)throw new x;let r=Pe(e,t.ephemeralPublicKey);if(Ne(r))throw new x;let a=$t(r,t.ephemeralPublicKey,H(e));try{let i=E(a.subarray(32,64),Rt(t.nonce,t.ciphertext,n,o));if(!te(i,t.tag))throw new x;return K(a.subarray(0,32),t.nonce,t.ciphertext)}finally{Le(r),Le(a)}}function Bt(e){return{ephemeralPublicKey:y(e.epk),nonce:y(e.n),ciphertext:y(e.c),tag:y(e.t)}}function Fe(e){return typeof e=="object"&&e!==null&&typeof e.epk=="string"}function We(e,t,n=""){try{return he(e,Bt(t),v(n),t?.v===2?2:1)}catch(o){throw o instanceof x||o instanceof T?new b:o instanceof TypeError?new b:o}}var Mt=[77,67,65,49],jt=[77,67,65,50],Ke=80;function De(e,t,n,o){if(o.length<Ke)throw new b;let r=jt.every((i,s)=>o[s]===i)?2:1;if(r===1&&!Mt.every((i,s)=>o[s]===i))throw new b;let a={ephemeralPublicKey:o.subarray(4,36),nonce:o.subarray(36,48),tag:o.subarray(48,80),ciphertext:o.subarray(Ke)};try{return he(e,a,v(`${t}:${n}`),r)}catch(i){throw i instanceof x?new b:i}}var oe=class{symmetric=new Map;sealing=new Map;senderName=null;load(t,n,o){let r=y(t);if(r.length!==64)throw new Error("The saved wrap secret is malformed. Run `mailcycle-mcp pair` again.");let a=fe(r,o,n);this.symmetric=new Map(Object.entries(a.keys).map(([i,s])=>[i,y(s)])),this.sealing=new Map(Object.entries(a.sealingKeys??{}).map(([i,s])=>[i,y(s)])),this.senderName=a.senderName?.trim()||null}has(t){return this.sealing.has(t)||this.symmetric.has(t)}open(t,n,o){if(Fe(o)){let a=this.sealing.get(t);if(!a)throw new I(t);return JSON.parse(P(We(a,o,`${t}:${n}`)))}let r=this.symmetric.get(t);if(!r)throw new I(t);return fe(r,o,n)}openAttachment(t,n,o,r){let a=this.sealing.get(t);if(!a)throw new I(t);return De(a,t,`${t}/${n}/${o}`,r)}},I=class extends Error{constructor(n){super("This agent has no key for that address yet. Open the agent in the Mailcycle app and add the address again.");this.inboxId=n;this.name="MissingKeyError"}};var h=e=>typeof e=="string"?e:"";function Pt(e){return typeof e=="string"?e:e&&typeof e=="object"?h(e.address):""}function Nt(e){return e.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/gi,"").replace(/<br\s*\/?>/gi,`
|
|
4
4
|
`).replace(/<\/(p|div|tr|li|h[1-6])>/gi,`
|
|
5
5
|
`).replace(/<[^>]+>/g,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/\n{3,}/g,`
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mailcycle-mcp",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "An email address for your AI agent. MCP server for Mailcycle: read, wait for and reply to mail, open attachments and send files, decrypted on your machine.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mailcycle",
|