@solana-agent-wallet-adapter/cli 0.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/LICENSE +15 -0
- package/README.md +107 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +84340 -0
- package/dist/index.js.map +7 -0
- package/dist/wallet-host/.well-known/assetlinks.json +12 -0
- package/dist/wallet-host/assets/codex-B1ZwolvK.svg +3 -0
- package/dist/wallet-host/assets/index-D5ySS2CU.js +2143 -0
- package/dist/wallet-host/assets/index-ZynMhs1G.css +1 -0
- package/dist/wallet-host/assets/mobile-wallet-adapter-CqDJSDZ5.js +738 -0
- package/dist/wallet-host/assets/saturn-source-cutout-wQ5itUw-.png +0 -0
- package/dist/wallet-host/assets/solana-runtime-BhiDfU5_.js +20 -0
- package/dist/wallet-host/assets/wallet-standard-eoxEevjj.js +11 -0
- package/dist/wallet-host/icons/agentic-192.png +0 -0
- package/dist/wallet-host/icons/agentic-192.png.bak +0 -0
- package/dist/wallet-host/icons/agentic-512.png +0 -0
- package/dist/wallet-host/icons/agentic-512.png.bak +0 -0
- package/dist/wallet-host/icons/agentic.png +0 -0
- package/dist/wallet-host/icons/agentic.png.bak +0 -0
- package/dist/wallet-host/icons/agentic.svg +44 -0
- package/dist/wallet-host/icons/favicon-transparent.png +0 -0
- package/dist/wallet-host/index.html +45 -0
- package/dist/wallet-host/manifest.webmanifest +20 -0
- package/dist/wallet-host/og/agentic-multi-wallet-agent-signer-1200.png +0 -0
- package/dist/wallet-host/og/agentic-solana-multi-wallet-agent-signer-agentic-bigger.png +0 -0
- package/dist/wallet-host/og/agentic-solana-multi-wallet-agent-signer.png +0 -0
- package/dist/wallet-host/og/og-card.png +0 -0
- package/package.json +55 -0
|
@@ -0,0 +1,2143 @@
|
|
|
1
|
+
var Qi=Object.defineProperty;var Xi=(e,t,r)=>t in e?Qi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var La=(e,t,r)=>Xi(e,typeof t!="symbol"?t+"":t,r);import{P as Re,j as Mt,l as eo,W as to,h as ao}from"./wallet-standard-eoxEevjj.js";import{r as no,g as ro,P as Lr,a as Ir,T as io,b as oo}from"./solana-runtime-BhiDfU5_.js";import{d as so,r as lo}from"./mobile-wallet-adapter-CqDJSDZ5.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const p of document.querySelectorAll('link[rel="modulepreload"]'))l(p);new MutationObserver(p=>{for(const b of p)if(b.type==="childList")for(const x of b.addedNodes)x.tagName==="LINK"&&x.rel==="modulepreload"&&l(x)}).observe(document,{childList:!0,subtree:!0});function r(p){const b={};return p.integrity&&(b.integrity=p.integrity),p.referrerPolicy&&(b.referrerPolicy=p.referrerPolicy),p.crossOrigin==="use-credentials"?b.credentials="include":p.crossOrigin==="anonymous"?b.credentials="omit":b.credentials="same-origin",b}function l(p){if(p.ep)return;p.ep=!0;const b=r(p);fetch(p.href,b)}})();function co(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Er={exports:{}};(function(e){(function(t){var r=function(i){var s,o=new Float64Array(16);if(i)for(s=0;s<i.length;s++)o[s]=i[s];return o},l=function(){throw new Error("no PRNG")},p=new Uint8Array(16),b=new Uint8Array(32);b[0]=9;var x=r(),G=r([1]),ne=r([56129,1]),ue=r([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),pe=r([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),xe=r([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),it=r([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),bt=r([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function qt(i,s,o,n){i[s]=o>>24&255,i[s+1]=o>>16&255,i[s+2]=o>>8&255,i[s+3]=o&255,i[s+4]=n>>24&255,i[s+5]=n>>16&255,i[s+6]=n>>8&255,i[s+7]=n&255}function vt(i,s,o,n,c){var f,g=0;for(f=0;f<c;f++)g|=i[s+f]^o[n+f];return(1&g-1>>>8)-1}function jt(i,s,o,n){return vt(i,s,o,n,16)}function yt(i,s,o,n){return vt(i,s,o,n,32)}function xa(i,s,o,n){for(var c=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,f=o[0]&255|(o[1]&255)<<8|(o[2]&255)<<16|(o[3]&255)<<24,g=o[4]&255|(o[5]&255)<<8|(o[6]&255)<<16|(o[7]&255)<<24,y=o[8]&255|(o[9]&255)<<8|(o[10]&255)<<16|(o[11]&255)<<24,$=o[12]&255|(o[13]&255)<<8|(o[14]&255)<<16|(o[15]&255)<<24,N=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,C=s[0]&255|(s[1]&255)<<8|(s[2]&255)<<16|(s[3]&255)<<24,re=s[4]&255|(s[5]&255)<<8|(s[6]&255)<<16|(s[7]&255)<<24,L=s[8]&255|(s[9]&255)<<8|(s[10]&255)<<16|(s[11]&255)<<24,D=s[12]&255|(s[13]&255)<<8|(s[14]&255)<<16|(s[15]&255)<<24,q=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,z=o[16]&255|(o[17]&255)<<8|(o[18]&255)<<16|(o[19]&255)<<24,H=o[20]&255|(o[21]&255)<<8|(o[22]&255)<<16|(o[23]&255)<<24,j=o[24]&255|(o[25]&255)<<8|(o[26]&255)<<16|(o[27]&255)<<24,Y=o[28]&255|(o[29]&255)<<8|(o[30]&255)<<16|(o[31]&255)<<24,F=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,I=c,O=f,T=g,E=y,_=$,P=N,h=C,m=re,A=L,v=D,w=q,S=z,W=H,K=j,J=Y,V=F,u,Q=0;Q<20;Q+=2)u=I+W|0,_^=u<<7|u>>>25,u=_+I|0,A^=u<<9|u>>>23,u=A+_|0,W^=u<<13|u>>>19,u=W+A|0,I^=u<<18|u>>>14,u=P+O|0,v^=u<<7|u>>>25,u=v+P|0,K^=u<<9|u>>>23,u=K+v|0,O^=u<<13|u>>>19,u=O+K|0,P^=u<<18|u>>>14,u=w+h|0,J^=u<<7|u>>>25,u=J+w|0,T^=u<<9|u>>>23,u=T+J|0,h^=u<<13|u>>>19,u=h+T|0,w^=u<<18|u>>>14,u=V+S|0,E^=u<<7|u>>>25,u=E+V|0,m^=u<<9|u>>>23,u=m+E|0,S^=u<<13|u>>>19,u=S+m|0,V^=u<<18|u>>>14,u=I+E|0,O^=u<<7|u>>>25,u=O+I|0,T^=u<<9|u>>>23,u=T+O|0,E^=u<<13|u>>>19,u=E+T|0,I^=u<<18|u>>>14,u=P+_|0,h^=u<<7|u>>>25,u=h+P|0,m^=u<<9|u>>>23,u=m+h|0,_^=u<<13|u>>>19,u=_+m|0,P^=u<<18|u>>>14,u=w+v|0,S^=u<<7|u>>>25,u=S+w|0,A^=u<<9|u>>>23,u=A+S|0,v^=u<<13|u>>>19,u=v+A|0,w^=u<<18|u>>>14,u=V+J|0,W^=u<<7|u>>>25,u=W+V|0,K^=u<<9|u>>>23,u=K+W|0,J^=u<<13|u>>>19,u=J+K|0,V^=u<<18|u>>>14;I=I+c|0,O=O+f|0,T=T+g|0,E=E+y|0,_=_+$|0,P=P+N|0,h=h+C|0,m=m+re|0,A=A+L|0,v=v+D|0,w=w+q|0,S=S+z|0,W=W+H|0,K=K+j|0,J=J+Y|0,V=V+F|0,i[0]=I>>>0&255,i[1]=I>>>8&255,i[2]=I>>>16&255,i[3]=I>>>24&255,i[4]=O>>>0&255,i[5]=O>>>8&255,i[6]=O>>>16&255,i[7]=O>>>24&255,i[8]=T>>>0&255,i[9]=T>>>8&255,i[10]=T>>>16&255,i[11]=T>>>24&255,i[12]=E>>>0&255,i[13]=E>>>8&255,i[14]=E>>>16&255,i[15]=E>>>24&255,i[16]=_>>>0&255,i[17]=_>>>8&255,i[18]=_>>>16&255,i[19]=_>>>24&255,i[20]=P>>>0&255,i[21]=P>>>8&255,i[22]=P>>>16&255,i[23]=P>>>24&255,i[24]=h>>>0&255,i[25]=h>>>8&255,i[26]=h>>>16&255,i[27]=h>>>24&255,i[28]=m>>>0&255,i[29]=m>>>8&255,i[30]=m>>>16&255,i[31]=m>>>24&255,i[32]=A>>>0&255,i[33]=A>>>8&255,i[34]=A>>>16&255,i[35]=A>>>24&255,i[36]=v>>>0&255,i[37]=v>>>8&255,i[38]=v>>>16&255,i[39]=v>>>24&255,i[40]=w>>>0&255,i[41]=w>>>8&255,i[42]=w>>>16&255,i[43]=w>>>24&255,i[44]=S>>>0&255,i[45]=S>>>8&255,i[46]=S>>>16&255,i[47]=S>>>24&255,i[48]=W>>>0&255,i[49]=W>>>8&255,i[50]=W>>>16&255,i[51]=W>>>24&255,i[52]=K>>>0&255,i[53]=K>>>8&255,i[54]=K>>>16&255,i[55]=K>>>24&255,i[56]=J>>>0&255,i[57]=J>>>8&255,i[58]=J>>>16&255,i[59]=J>>>24&255,i[60]=V>>>0&255,i[61]=V>>>8&255,i[62]=V>>>16&255,i[63]=V>>>24&255}function Aa(i,s,o,n){for(var c=n[0]&255|(n[1]&255)<<8|(n[2]&255)<<16|(n[3]&255)<<24,f=o[0]&255|(o[1]&255)<<8|(o[2]&255)<<16|(o[3]&255)<<24,g=o[4]&255|(o[5]&255)<<8|(o[6]&255)<<16|(o[7]&255)<<24,y=o[8]&255|(o[9]&255)<<8|(o[10]&255)<<16|(o[11]&255)<<24,$=o[12]&255|(o[13]&255)<<8|(o[14]&255)<<16|(o[15]&255)<<24,N=n[4]&255|(n[5]&255)<<8|(n[6]&255)<<16|(n[7]&255)<<24,C=s[0]&255|(s[1]&255)<<8|(s[2]&255)<<16|(s[3]&255)<<24,re=s[4]&255|(s[5]&255)<<8|(s[6]&255)<<16|(s[7]&255)<<24,L=s[8]&255|(s[9]&255)<<8|(s[10]&255)<<16|(s[11]&255)<<24,D=s[12]&255|(s[13]&255)<<8|(s[14]&255)<<16|(s[15]&255)<<24,q=n[8]&255|(n[9]&255)<<8|(n[10]&255)<<16|(n[11]&255)<<24,z=o[16]&255|(o[17]&255)<<8|(o[18]&255)<<16|(o[19]&255)<<24,H=o[20]&255|(o[21]&255)<<8|(o[22]&255)<<16|(o[23]&255)<<24,j=o[24]&255|(o[25]&255)<<8|(o[26]&255)<<16|(o[27]&255)<<24,Y=o[28]&255|(o[29]&255)<<8|(o[30]&255)<<16|(o[31]&255)<<24,F=n[12]&255|(n[13]&255)<<8|(n[14]&255)<<16|(n[15]&255)<<24,I=c,O=f,T=g,E=y,_=$,P=N,h=C,m=re,A=L,v=D,w=q,S=z,W=H,K=j,J=Y,V=F,u,Q=0;Q<20;Q+=2)u=I+W|0,_^=u<<7|u>>>25,u=_+I|0,A^=u<<9|u>>>23,u=A+_|0,W^=u<<13|u>>>19,u=W+A|0,I^=u<<18|u>>>14,u=P+O|0,v^=u<<7|u>>>25,u=v+P|0,K^=u<<9|u>>>23,u=K+v|0,O^=u<<13|u>>>19,u=O+K|0,P^=u<<18|u>>>14,u=w+h|0,J^=u<<7|u>>>25,u=J+w|0,T^=u<<9|u>>>23,u=T+J|0,h^=u<<13|u>>>19,u=h+T|0,w^=u<<18|u>>>14,u=V+S|0,E^=u<<7|u>>>25,u=E+V|0,m^=u<<9|u>>>23,u=m+E|0,S^=u<<13|u>>>19,u=S+m|0,V^=u<<18|u>>>14,u=I+E|0,O^=u<<7|u>>>25,u=O+I|0,T^=u<<9|u>>>23,u=T+O|0,E^=u<<13|u>>>19,u=E+T|0,I^=u<<18|u>>>14,u=P+_|0,h^=u<<7|u>>>25,u=h+P|0,m^=u<<9|u>>>23,u=m+h|0,_^=u<<13|u>>>19,u=_+m|0,P^=u<<18|u>>>14,u=w+v|0,S^=u<<7|u>>>25,u=S+w|0,A^=u<<9|u>>>23,u=A+S|0,v^=u<<13|u>>>19,u=v+A|0,w^=u<<18|u>>>14,u=V+J|0,W^=u<<7|u>>>25,u=W+V|0,K^=u<<9|u>>>23,u=K+W|0,J^=u<<13|u>>>19,u=J+K|0,V^=u<<18|u>>>14;i[0]=I>>>0&255,i[1]=I>>>8&255,i[2]=I>>>16&255,i[3]=I>>>24&255,i[4]=P>>>0&255,i[5]=P>>>8&255,i[6]=P>>>16&255,i[7]=P>>>24&255,i[8]=w>>>0&255,i[9]=w>>>8&255,i[10]=w>>>16&255,i[11]=w>>>24&255,i[12]=V>>>0&255,i[13]=V>>>8&255,i[14]=V>>>16&255,i[15]=V>>>24&255,i[16]=h>>>0&255,i[17]=h>>>8&255,i[18]=h>>>16&255,i[19]=h>>>24&255,i[20]=m>>>0&255,i[21]=m>>>8&255,i[22]=m>>>16&255,i[23]=m>>>24&255,i[24]=A>>>0&255,i[25]=A>>>8&255,i[26]=A>>>16&255,i[27]=A>>>24&255,i[28]=v>>>0&255,i[29]=v>>>8&255,i[30]=v>>>16&255,i[31]=v>>>24&255}function ot(i,s,o,n){xa(i,s,o,n)}function st(i,s,o,n){Aa(i,s,o,n)}var Be=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function Ft(i,s,o,n,c,f,g){var y=new Uint8Array(16),$=new Uint8Array(64),N,C;for(C=0;C<16;C++)y[C]=0;for(C=0;C<8;C++)y[C]=f[C];for(;c>=64;){for(ot($,y,g,Be),C=0;C<64;C++)i[s+C]=o[n+C]^$[C];for(N=1,C=8;C<16;C++)N=N+(y[C]&255)|0,y[C]=N&255,N>>>=8;c-=64,s+=64,n+=64}if(c>0)for(ot($,y,g,Be),C=0;C<c;C++)i[s+C]=o[n+C]^$[C];return 0}function Gt(i,s,o,n,c){var f=new Uint8Array(16),g=new Uint8Array(64),y,$;for($=0;$<16;$++)f[$]=0;for($=0;$<8;$++)f[$]=n[$];for(;o>=64;){for(ot(g,f,c,Be),$=0;$<64;$++)i[s+$]=g[$];for(y=1,$=8;$<16;$++)y=y+(f[$]&255)|0,f[$]=y&255,y>>>=8;o-=64,s+=64}if(o>0)for(ot(g,f,c,Be),$=0;$<o;$++)i[s+$]=g[$];return 0}function Yt(i,s,o,n,c){var f=new Uint8Array(32);st(f,n,c,Be);for(var g=new Uint8Array(8),y=0;y<8;y++)g[y]=n[y+16];return Gt(i,s,o,g,f)}function wt(i,s,o,n,c,f,g){var y=new Uint8Array(32);st(y,f,g,Be);for(var $=new Uint8Array(8),N=0;N<8;N++)$[N]=f[N+16];return Ft(i,s,o,n,c,$,y)}var lt=function(i){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var s,o,n,c,f,g,y,$;s=i[0]&255|(i[1]&255)<<8,this.r[0]=s&8191,o=i[2]&255|(i[3]&255)<<8,this.r[1]=(s>>>13|o<<3)&8191,n=i[4]&255|(i[5]&255)<<8,this.r[2]=(o>>>10|n<<6)&7939,c=i[6]&255|(i[7]&255)<<8,this.r[3]=(n>>>7|c<<9)&8191,f=i[8]&255|(i[9]&255)<<8,this.r[4]=(c>>>4|f<<12)&255,this.r[5]=f>>>1&8190,g=i[10]&255|(i[11]&255)<<8,this.r[6]=(f>>>14|g<<2)&8191,y=i[12]&255|(i[13]&255)<<8,this.r[7]=(g>>>11|y<<5)&8065,$=i[14]&255|(i[15]&255)<<8,this.r[8]=(y>>>8|$<<8)&8191,this.r[9]=$>>>5&127,this.pad[0]=i[16]&255|(i[17]&255)<<8,this.pad[1]=i[18]&255|(i[19]&255)<<8,this.pad[2]=i[20]&255|(i[21]&255)<<8,this.pad[3]=i[22]&255|(i[23]&255)<<8,this.pad[4]=i[24]&255|(i[25]&255)<<8,this.pad[5]=i[26]&255|(i[27]&255)<<8,this.pad[6]=i[28]&255|(i[29]&255)<<8,this.pad[7]=i[30]&255|(i[31]&255)<<8};lt.prototype.blocks=function(i,s,o){for(var n=this.fin?0:2048,c,f,g,y,$,N,C,re,L,D,q,z,H,j,Y,F,I,O,T,E=this.h[0],_=this.h[1],P=this.h[2],h=this.h[3],m=this.h[4],A=this.h[5],v=this.h[6],w=this.h[7],S=this.h[8],W=this.h[9],K=this.r[0],J=this.r[1],V=this.r[2],u=this.r[3],Q=this.r[4],ie=this.r[5],oe=this.r[6],Z=this.r[7],te=this.r[8],ae=this.r[9];o>=16;)c=i[s+0]&255|(i[s+1]&255)<<8,E+=c&8191,f=i[s+2]&255|(i[s+3]&255)<<8,_+=(c>>>13|f<<3)&8191,g=i[s+4]&255|(i[s+5]&255)<<8,P+=(f>>>10|g<<6)&8191,y=i[s+6]&255|(i[s+7]&255)<<8,h+=(g>>>7|y<<9)&8191,$=i[s+8]&255|(i[s+9]&255)<<8,m+=(y>>>4|$<<12)&8191,A+=$>>>1&8191,N=i[s+10]&255|(i[s+11]&255)<<8,v+=($>>>14|N<<2)&8191,C=i[s+12]&255|(i[s+13]&255)<<8,w+=(N>>>11|C<<5)&8191,re=i[s+14]&255|(i[s+15]&255)<<8,S+=(C>>>8|re<<8)&8191,W+=re>>>5|n,L=0,D=L,D+=E*K,D+=_*(5*ae),D+=P*(5*te),D+=h*(5*Z),D+=m*(5*oe),L=D>>>13,D&=8191,D+=A*(5*ie),D+=v*(5*Q),D+=w*(5*u),D+=S*(5*V),D+=W*(5*J),L+=D>>>13,D&=8191,q=L,q+=E*J,q+=_*K,q+=P*(5*ae),q+=h*(5*te),q+=m*(5*Z),L=q>>>13,q&=8191,q+=A*(5*oe),q+=v*(5*ie),q+=w*(5*Q),q+=S*(5*u),q+=W*(5*V),L+=q>>>13,q&=8191,z=L,z+=E*V,z+=_*J,z+=P*K,z+=h*(5*ae),z+=m*(5*te),L=z>>>13,z&=8191,z+=A*(5*Z),z+=v*(5*oe),z+=w*(5*ie),z+=S*(5*Q),z+=W*(5*u),L+=z>>>13,z&=8191,H=L,H+=E*u,H+=_*V,H+=P*J,H+=h*K,H+=m*(5*ae),L=H>>>13,H&=8191,H+=A*(5*te),H+=v*(5*Z),H+=w*(5*oe),H+=S*(5*ie),H+=W*(5*Q),L+=H>>>13,H&=8191,j=L,j+=E*Q,j+=_*u,j+=P*V,j+=h*J,j+=m*K,L=j>>>13,j&=8191,j+=A*(5*ae),j+=v*(5*te),j+=w*(5*Z),j+=S*(5*oe),j+=W*(5*ie),L+=j>>>13,j&=8191,Y=L,Y+=E*ie,Y+=_*Q,Y+=P*u,Y+=h*V,Y+=m*J,L=Y>>>13,Y&=8191,Y+=A*K,Y+=v*(5*ae),Y+=w*(5*te),Y+=S*(5*Z),Y+=W*(5*oe),L+=Y>>>13,Y&=8191,F=L,F+=E*oe,F+=_*ie,F+=P*Q,F+=h*u,F+=m*V,L=F>>>13,F&=8191,F+=A*J,F+=v*K,F+=w*(5*ae),F+=S*(5*te),F+=W*(5*Z),L+=F>>>13,F&=8191,I=L,I+=E*Z,I+=_*oe,I+=P*ie,I+=h*Q,I+=m*u,L=I>>>13,I&=8191,I+=A*V,I+=v*J,I+=w*K,I+=S*(5*ae),I+=W*(5*te),L+=I>>>13,I&=8191,O=L,O+=E*te,O+=_*Z,O+=P*oe,O+=h*ie,O+=m*Q,L=O>>>13,O&=8191,O+=A*u,O+=v*V,O+=w*J,O+=S*K,O+=W*(5*ae),L+=O>>>13,O&=8191,T=L,T+=E*ae,T+=_*te,T+=P*Z,T+=h*oe,T+=m*ie,L=T>>>13,T&=8191,T+=A*Q,T+=v*u,T+=w*V,T+=S*J,T+=W*K,L+=T>>>13,T&=8191,L=(L<<2)+L|0,L=L+D|0,D=L&8191,L=L>>>13,q+=L,E=D,_=q,P=z,h=H,m=j,A=Y,v=F,w=I,S=O,W=T,s+=16,o-=16;this.h[0]=E,this.h[1]=_,this.h[2]=P,this.h[3]=h,this.h[4]=m,this.h[5]=A,this.h[6]=v,this.h[7]=w,this.h[8]=S,this.h[9]=W},lt.prototype.finish=function(i,s){var o=new Uint16Array(10),n,c,f,g;if(this.leftover){for(g=this.leftover,this.buffer[g++]=1;g<16;g++)this.buffer[g]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,g=2;g<10;g++)this.h[g]+=n,n=this.h[g]>>>13,this.h[g]&=8191;for(this.h[0]+=n*5,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,o[0]=this.h[0]+5,n=o[0]>>>13,o[0]&=8191,g=1;g<10;g++)o[g]=this.h[g]+n,n=o[g]>>>13,o[g]&=8191;for(o[9]-=8192,c=(n^1)-1,g=0;g<10;g++)o[g]&=c;for(c=~c,g=0;g<10;g++)this.h[g]=this.h[g]&c|o[g];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,f=this.h[0]+this.pad[0],this.h[0]=f&65535,g=1;g<8;g++)f=(this.h[g]+this.pad[g]|0)+(f>>>16)|0,this.h[g]=f&65535;i[s+0]=this.h[0]>>>0&255,i[s+1]=this.h[0]>>>8&255,i[s+2]=this.h[1]>>>0&255,i[s+3]=this.h[1]>>>8&255,i[s+4]=this.h[2]>>>0&255,i[s+5]=this.h[2]>>>8&255,i[s+6]=this.h[3]>>>0&255,i[s+7]=this.h[3]>>>8&255,i[s+8]=this.h[4]>>>0&255,i[s+9]=this.h[4]>>>8&255,i[s+10]=this.h[5]>>>0&255,i[s+11]=this.h[5]>>>8&255,i[s+12]=this.h[6]>>>0&255,i[s+13]=this.h[6]>>>8&255,i[s+14]=this.h[7]>>>0&255,i[s+15]=this.h[7]>>>8&255},lt.prototype.update=function(i,s,o){var n,c;if(this.leftover){for(c=16-this.leftover,c>o&&(c=o),n=0;n<c;n++)this.buffer[this.leftover+n]=i[s+n];if(o-=c,s+=c,this.leftover+=c,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(o>=16&&(c=o-o%16,this.blocks(i,s,c),s+=c,o-=c),o){for(n=0;n<o;n++)this.buffer[this.leftover+n]=i[s+n];this.leftover+=o}};function xt(i,s,o,n,c,f){var g=new lt(f);return g.update(o,n,c),g.finish(i,s),0}function Ht(i,s,o,n,c,f){var g=new Uint8Array(16);return xt(g,0,o,n,c,f),jt(i,s,g,0)}function At(i,s,o,n,c){var f;if(o<32)return-1;for(wt(i,0,s,0,o,n,c),xt(i,16,i,32,o-32,i),f=0;f<16;f++)i[f]=0;return 0}function St(i,s,o,n,c){var f,g=new Uint8Array(32);if(o<32||(Yt(g,0,32,n,c),Ht(s,16,s,32,o-32,g)!==0))return-1;for(wt(i,0,s,0,o,n,c),f=0;f<32;f++)i[f]=0;return 0}function Oe(i,s){var o;for(o=0;o<16;o++)i[o]=s[o]|0}function $t(i){var s,o,n=1;for(s=0;s<16;s++)o=i[s]+n+65535,n=Math.floor(o/65536),i[s]=o-n*65536;i[0]+=n-1+37*(n-1)}function Ye(i,s,o){for(var n,c=~(o-1),f=0;f<16;f++)n=c&(i[f]^s[f]),i[f]^=n,s[f]^=n}function He(i,s){var o,n,c,f=r(),g=r();for(o=0;o<16;o++)g[o]=s[o];for($t(g),$t(g),$t(g),n=0;n<2;n++){for(f[0]=g[0]-65517,o=1;o<15;o++)f[o]=g[o]-65535-(f[o-1]>>16&1),f[o-1]&=65535;f[15]=g[15]-32767-(f[14]>>16&1),c=f[15]>>16&1,f[14]&=65535,Ye(g,f,1-c)}for(o=0;o<16;o++)i[2*o]=g[o]&255,i[2*o+1]=g[o]>>8}function zt(i,s){var o=new Uint8Array(32),n=new Uint8Array(32);return He(o,i),He(n,s),yt(o,0,n,0)}function Kt(i){var s=new Uint8Array(32);return He(s,i),s[0]&1}function kt(i,s){var o;for(o=0;o<16;o++)i[o]=s[2*o]+(s[2*o+1]<<8);i[15]&=32767}function Ie(i,s,o){for(var n=0;n<16;n++)i[n]=s[n]+o[n]}function Ee(i,s,o){for(var n=0;n<16;n++)i[n]=s[n]-o[n]}function X(i,s,o){var n,c,f=0,g=0,y=0,$=0,N=0,C=0,re=0,L=0,D=0,q=0,z=0,H=0,j=0,Y=0,F=0,I=0,O=0,T=0,E=0,_=0,P=0,h=0,m=0,A=0,v=0,w=0,S=0,W=0,K=0,J=0,V=0,u=o[0],Q=o[1],ie=o[2],oe=o[3],Z=o[4],te=o[5],ae=o[6],be=o[7],le=o[8],fe=o[9],ge=o[10],he=o[11],ve=o[12],Se=o[13],$e=o[14],ke=o[15];n=s[0],f+=n*u,g+=n*Q,y+=n*ie,$+=n*oe,N+=n*Z,C+=n*te,re+=n*ae,L+=n*be,D+=n*le,q+=n*fe,z+=n*ge,H+=n*he,j+=n*ve,Y+=n*Se,F+=n*$e,I+=n*ke,n=s[1],g+=n*u,y+=n*Q,$+=n*ie,N+=n*oe,C+=n*Z,re+=n*te,L+=n*ae,D+=n*be,q+=n*le,z+=n*fe,H+=n*ge,j+=n*he,Y+=n*ve,F+=n*Se,I+=n*$e,O+=n*ke,n=s[2],y+=n*u,$+=n*Q,N+=n*ie,C+=n*oe,re+=n*Z,L+=n*te,D+=n*ae,q+=n*be,z+=n*le,H+=n*fe,j+=n*ge,Y+=n*he,F+=n*ve,I+=n*Se,O+=n*$e,T+=n*ke,n=s[3],$+=n*u,N+=n*Q,C+=n*ie,re+=n*oe,L+=n*Z,D+=n*te,q+=n*ae,z+=n*be,H+=n*le,j+=n*fe,Y+=n*ge,F+=n*he,I+=n*ve,O+=n*Se,T+=n*$e,E+=n*ke,n=s[4],N+=n*u,C+=n*Q,re+=n*ie,L+=n*oe,D+=n*Z,q+=n*te,z+=n*ae,H+=n*be,j+=n*le,Y+=n*fe,F+=n*ge,I+=n*he,O+=n*ve,T+=n*Se,E+=n*$e,_+=n*ke,n=s[5],C+=n*u,re+=n*Q,L+=n*ie,D+=n*oe,q+=n*Z,z+=n*te,H+=n*ae,j+=n*be,Y+=n*le,F+=n*fe,I+=n*ge,O+=n*he,T+=n*ve,E+=n*Se,_+=n*$e,P+=n*ke,n=s[6],re+=n*u,L+=n*Q,D+=n*ie,q+=n*oe,z+=n*Z,H+=n*te,j+=n*ae,Y+=n*be,F+=n*le,I+=n*fe,O+=n*ge,T+=n*he,E+=n*ve,_+=n*Se,P+=n*$e,h+=n*ke,n=s[7],L+=n*u,D+=n*Q,q+=n*ie,z+=n*oe,H+=n*Z,j+=n*te,Y+=n*ae,F+=n*be,I+=n*le,O+=n*fe,T+=n*ge,E+=n*he,_+=n*ve,P+=n*Se,h+=n*$e,m+=n*ke,n=s[8],D+=n*u,q+=n*Q,z+=n*ie,H+=n*oe,j+=n*Z,Y+=n*te,F+=n*ae,I+=n*be,O+=n*le,T+=n*fe,E+=n*ge,_+=n*he,P+=n*ve,h+=n*Se,m+=n*$e,A+=n*ke,n=s[9],q+=n*u,z+=n*Q,H+=n*ie,j+=n*oe,Y+=n*Z,F+=n*te,I+=n*ae,O+=n*be,T+=n*le,E+=n*fe,_+=n*ge,P+=n*he,h+=n*ve,m+=n*Se,A+=n*$e,v+=n*ke,n=s[10],z+=n*u,H+=n*Q,j+=n*ie,Y+=n*oe,F+=n*Z,I+=n*te,O+=n*ae,T+=n*be,E+=n*le,_+=n*fe,P+=n*ge,h+=n*he,m+=n*ve,A+=n*Se,v+=n*$e,w+=n*ke,n=s[11],H+=n*u,j+=n*Q,Y+=n*ie,F+=n*oe,I+=n*Z,O+=n*te,T+=n*ae,E+=n*be,_+=n*le,P+=n*fe,h+=n*ge,m+=n*he,A+=n*ve,v+=n*Se,w+=n*$e,S+=n*ke,n=s[12],j+=n*u,Y+=n*Q,F+=n*ie,I+=n*oe,O+=n*Z,T+=n*te,E+=n*ae,_+=n*be,P+=n*le,h+=n*fe,m+=n*ge,A+=n*he,v+=n*ve,w+=n*Se,S+=n*$e,W+=n*ke,n=s[13],Y+=n*u,F+=n*Q,I+=n*ie,O+=n*oe,T+=n*Z,E+=n*te,_+=n*ae,P+=n*be,h+=n*le,m+=n*fe,A+=n*ge,v+=n*he,w+=n*ve,S+=n*Se,W+=n*$e,K+=n*ke,n=s[14],F+=n*u,I+=n*Q,O+=n*ie,T+=n*oe,E+=n*Z,_+=n*te,P+=n*ae,h+=n*be,m+=n*le,A+=n*fe,v+=n*ge,w+=n*he,S+=n*ve,W+=n*Se,K+=n*$e,J+=n*ke,n=s[15],I+=n*u,O+=n*Q,T+=n*ie,E+=n*oe,_+=n*Z,P+=n*te,h+=n*ae,m+=n*be,A+=n*le,v+=n*fe,w+=n*ge,S+=n*he,W+=n*ve,K+=n*Se,J+=n*$e,V+=n*ke,f+=38*O,g+=38*T,y+=38*E,$+=38*_,N+=38*P,C+=38*h,re+=38*m,L+=38*A,D+=38*v,q+=38*w,z+=38*S,H+=38*W,j+=38*K,Y+=38*J,F+=38*V,c=1,n=f+c+65535,c=Math.floor(n/65536),f=n-c*65536,n=g+c+65535,c=Math.floor(n/65536),g=n-c*65536,n=y+c+65535,c=Math.floor(n/65536),y=n-c*65536,n=$+c+65535,c=Math.floor(n/65536),$=n-c*65536,n=N+c+65535,c=Math.floor(n/65536),N=n-c*65536,n=C+c+65535,c=Math.floor(n/65536),C=n-c*65536,n=re+c+65535,c=Math.floor(n/65536),re=n-c*65536,n=L+c+65535,c=Math.floor(n/65536),L=n-c*65536,n=D+c+65535,c=Math.floor(n/65536),D=n-c*65536,n=q+c+65535,c=Math.floor(n/65536),q=n-c*65536,n=z+c+65535,c=Math.floor(n/65536),z=n-c*65536,n=H+c+65535,c=Math.floor(n/65536),H=n-c*65536,n=j+c+65535,c=Math.floor(n/65536),j=n-c*65536,n=Y+c+65535,c=Math.floor(n/65536),Y=n-c*65536,n=F+c+65535,c=Math.floor(n/65536),F=n-c*65536,n=I+c+65535,c=Math.floor(n/65536),I=n-c*65536,f+=c-1+37*(c-1),c=1,n=f+c+65535,c=Math.floor(n/65536),f=n-c*65536,n=g+c+65535,c=Math.floor(n/65536),g=n-c*65536,n=y+c+65535,c=Math.floor(n/65536),y=n-c*65536,n=$+c+65535,c=Math.floor(n/65536),$=n-c*65536,n=N+c+65535,c=Math.floor(n/65536),N=n-c*65536,n=C+c+65535,c=Math.floor(n/65536),C=n-c*65536,n=re+c+65535,c=Math.floor(n/65536),re=n-c*65536,n=L+c+65535,c=Math.floor(n/65536),L=n-c*65536,n=D+c+65535,c=Math.floor(n/65536),D=n-c*65536,n=q+c+65535,c=Math.floor(n/65536),q=n-c*65536,n=z+c+65535,c=Math.floor(n/65536),z=n-c*65536,n=H+c+65535,c=Math.floor(n/65536),H=n-c*65536,n=j+c+65535,c=Math.floor(n/65536),j=n-c*65536,n=Y+c+65535,c=Math.floor(n/65536),Y=n-c*65536,n=F+c+65535,c=Math.floor(n/65536),F=n-c*65536,n=I+c+65535,c=Math.floor(n/65536),I=n-c*65536,f+=c-1+37*(c-1),i[0]=f,i[1]=g,i[2]=y,i[3]=$,i[4]=N,i[5]=C,i[6]=re,i[7]=L,i[8]=D,i[9]=q,i[10]=z,i[11]=H,i[12]=j,i[13]=Y,i[14]=F,i[15]=I}function Ce(i,s){X(i,s,s)}function Vt(i,s){var o=r(),n;for(n=0;n<16;n++)o[n]=s[n];for(n=253;n>=0;n--)Ce(o,o),n!==2&&n!==4&&X(o,o,s);for(n=0;n<16;n++)i[n]=o[n]}function Jt(i,s){var o=r(),n;for(n=0;n<16;n++)o[n]=s[n];for(n=250;n>=0;n--)Ce(o,o),n!==1&&X(o,o,s);for(n=0;n<16;n++)i[n]=o[n]}function ct(i,s,o){var n=new Uint8Array(32),c=new Float64Array(80),f,g,y=r(),$=r(),N=r(),C=r(),re=r(),L=r();for(g=0;g<31;g++)n[g]=s[g];for(n[31]=s[31]&127|64,n[0]&=248,kt(c,o),g=0;g<16;g++)$[g]=c[g],C[g]=y[g]=N[g]=0;for(y[0]=C[0]=1,g=254;g>=0;--g)f=n[g>>>3]>>>(g&7)&1,Ye(y,$,f),Ye(N,C,f),Ie(re,y,N),Ee(y,y,N),Ie(N,$,C),Ee($,$,C),Ce(C,re),Ce(L,y),X(y,N,y),X(N,$,re),Ie(re,y,N),Ee(y,y,N),Ce($,y),Ee(N,C,L),X(y,N,ne),Ie(y,y,C),X(N,N,y),X(y,C,L),X(C,$,c),Ce($,re),Ye(y,$,f),Ye(N,C,f);for(g=0;g<16;g++)c[g+16]=y[g],c[g+32]=N[g],c[g+48]=$[g],c[g+64]=C[g];var D=c.subarray(32),q=c.subarray(16);return Vt(D,D),X(q,q,D),He(i,q),0}function dt(i,s){return ct(i,s,b)}function Zt(i,s){return l(s,32),dt(i,s)}function ut(i,s,o){var n=new Uint8Array(32);return ct(n,o,s),st(i,p,n,Be)}var k=At,U=St;function Ae(i,s,o,n,c,f){var g=new Uint8Array(32);return ut(g,c,f),k(i,s,o,n,g)}function an(i,s,o,n,c,f){var g=new Uint8Array(32);return ut(g,c,f),U(i,s,o,n,g)}var Qt=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Sa(i,s,o,n){for(var c=new Int32Array(16),f=new Int32Array(16),g,y,$,N,C,re,L,D,q,z,H,j,Y,F,I,O,T,E,_,P,h,m,A,v,w,S,W=i[0],K=i[1],J=i[2],V=i[3],u=i[4],Q=i[5],ie=i[6],oe=i[7],Z=s[0],te=s[1],ae=s[2],be=s[3],le=s[4],fe=s[5],ge=s[6],he=s[7],ve=0;n>=128;){for(_=0;_<16;_++)P=8*_+ve,c[_]=o[P+0]<<24|o[P+1]<<16|o[P+2]<<8|o[P+3],f[_]=o[P+4]<<24|o[P+5]<<16|o[P+6]<<8|o[P+7];for(_=0;_<80;_++)if(g=W,y=K,$=J,N=V,C=u,re=Q,L=ie,D=oe,q=Z,z=te,H=ae,j=be,Y=le,F=fe,I=ge,O=he,h=oe,m=he,A=m&65535,v=m>>>16,w=h&65535,S=h>>>16,h=(u>>>14|le<<18)^(u>>>18|le<<14)^(le>>>9|u<<23),m=(le>>>14|u<<18)^(le>>>18|u<<14)^(u>>>9|le<<23),A+=m&65535,v+=m>>>16,w+=h&65535,S+=h>>>16,h=u&Q^~u&ie,m=le&fe^~le&ge,A+=m&65535,v+=m>>>16,w+=h&65535,S+=h>>>16,h=Qt[_*2],m=Qt[_*2+1],A+=m&65535,v+=m>>>16,w+=h&65535,S+=h>>>16,h=c[_%16],m=f[_%16],A+=m&65535,v+=m>>>16,w+=h&65535,S+=h>>>16,v+=A>>>16,w+=v>>>16,S+=w>>>16,T=w&65535|S<<16,E=A&65535|v<<16,h=T,m=E,A=m&65535,v=m>>>16,w=h&65535,S=h>>>16,h=(W>>>28|Z<<4)^(Z>>>2|W<<30)^(Z>>>7|W<<25),m=(Z>>>28|W<<4)^(W>>>2|Z<<30)^(W>>>7|Z<<25),A+=m&65535,v+=m>>>16,w+=h&65535,S+=h>>>16,h=W&K^W&J^K&J,m=Z&te^Z&ae^te&ae,A+=m&65535,v+=m>>>16,w+=h&65535,S+=h>>>16,v+=A>>>16,w+=v>>>16,S+=w>>>16,D=w&65535|S<<16,O=A&65535|v<<16,h=N,m=j,A=m&65535,v=m>>>16,w=h&65535,S=h>>>16,h=T,m=E,A+=m&65535,v+=m>>>16,w+=h&65535,S+=h>>>16,v+=A>>>16,w+=v>>>16,S+=w>>>16,N=w&65535|S<<16,j=A&65535|v<<16,K=g,J=y,V=$,u=N,Q=C,ie=re,oe=L,W=D,te=q,ae=z,be=H,le=j,fe=Y,ge=F,he=I,Z=O,_%16===15)for(P=0;P<16;P++)h=c[P],m=f[P],A=m&65535,v=m>>>16,w=h&65535,S=h>>>16,h=c[(P+9)%16],m=f[(P+9)%16],A+=m&65535,v+=m>>>16,w+=h&65535,S+=h>>>16,T=c[(P+1)%16],E=f[(P+1)%16],h=(T>>>1|E<<31)^(T>>>8|E<<24)^T>>>7,m=(E>>>1|T<<31)^(E>>>8|T<<24)^(E>>>7|T<<25),A+=m&65535,v+=m>>>16,w+=h&65535,S+=h>>>16,T=c[(P+14)%16],E=f[(P+14)%16],h=(T>>>19|E<<13)^(E>>>29|T<<3)^T>>>6,m=(E>>>19|T<<13)^(T>>>29|E<<3)^(E>>>6|T<<26),A+=m&65535,v+=m>>>16,w+=h&65535,S+=h>>>16,v+=A>>>16,w+=v>>>16,S+=w>>>16,c[P]=w&65535|S<<16,f[P]=A&65535|v<<16;h=W,m=Z,A=m&65535,v=m>>>16,w=h&65535,S=h>>>16,h=i[0],m=s[0],A+=m&65535,v+=m>>>16,w+=h&65535,S+=h>>>16,v+=A>>>16,w+=v>>>16,S+=w>>>16,i[0]=W=w&65535|S<<16,s[0]=Z=A&65535|v<<16,h=K,m=te,A=m&65535,v=m>>>16,w=h&65535,S=h>>>16,h=i[1],m=s[1],A+=m&65535,v+=m>>>16,w+=h&65535,S+=h>>>16,v+=A>>>16,w+=v>>>16,S+=w>>>16,i[1]=K=w&65535|S<<16,s[1]=te=A&65535|v<<16,h=J,m=ae,A=m&65535,v=m>>>16,w=h&65535,S=h>>>16,h=i[2],m=s[2],A+=m&65535,v+=m>>>16,w+=h&65535,S+=h>>>16,v+=A>>>16,w+=v>>>16,S+=w>>>16,i[2]=J=w&65535|S<<16,s[2]=ae=A&65535|v<<16,h=V,m=be,A=m&65535,v=m>>>16,w=h&65535,S=h>>>16,h=i[3],m=s[3],A+=m&65535,v+=m>>>16,w+=h&65535,S+=h>>>16,v+=A>>>16,w+=v>>>16,S+=w>>>16,i[3]=V=w&65535|S<<16,s[3]=be=A&65535|v<<16,h=u,m=le,A=m&65535,v=m>>>16,w=h&65535,S=h>>>16,h=i[4],m=s[4],A+=m&65535,v+=m>>>16,w+=h&65535,S+=h>>>16,v+=A>>>16,w+=v>>>16,S+=w>>>16,i[4]=u=w&65535|S<<16,s[4]=le=A&65535|v<<16,h=Q,m=fe,A=m&65535,v=m>>>16,w=h&65535,S=h>>>16,h=i[5],m=s[5],A+=m&65535,v+=m>>>16,w+=h&65535,S+=h>>>16,v+=A>>>16,w+=v>>>16,S+=w>>>16,i[5]=Q=w&65535|S<<16,s[5]=fe=A&65535|v<<16,h=ie,m=ge,A=m&65535,v=m>>>16,w=h&65535,S=h>>>16,h=i[6],m=s[6],A+=m&65535,v+=m>>>16,w+=h&65535,S+=h>>>16,v+=A>>>16,w+=v>>>16,S+=w>>>16,i[6]=ie=w&65535|S<<16,s[6]=ge=A&65535|v<<16,h=oe,m=he,A=m&65535,v=m>>>16,w=h&65535,S=h>>>16,h=i[7],m=s[7],A+=m&65535,v+=m>>>16,w+=h&65535,S+=h>>>16,v+=A>>>16,w+=v>>>16,S+=w>>>16,i[7]=oe=w&65535|S<<16,s[7]=he=A&65535|v<<16,ve+=128,n-=128}return n}function pt(i,s,o){var n=new Int32Array(8),c=new Int32Array(8),f=new Uint8Array(256),g,y=o;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,c[0]=4089235720,c[1]=2227873595,c[2]=4271175723,c[3]=1595750129,c[4]=2917565137,c[5]=725511199,c[6]=4215389547,c[7]=327033209,Sa(n,c,s,o),o%=128,g=0;g<o;g++)f[g]=s[y-o+g];for(f[o]=128,o=256-128*(o<112?1:0),f[o-9]=0,qt(f,o-8,y/536870912|0,y<<3),Sa(n,c,f,o),g=0;g<8;g++)qt(i,8*g,n[g],c[g]);return 0}function $a(i,s){var o=r(),n=r(),c=r(),f=r(),g=r(),y=r(),$=r(),N=r(),C=r();Ee(o,i[1],i[0]),Ee(C,s[1],s[0]),X(o,o,C),Ie(n,i[0],i[1]),Ie(C,s[0],s[1]),X(n,n,C),X(c,i[3],s[3]),X(c,c,pe),X(f,i[2],s[2]),Ie(f,f,f),Ee(g,n,o),Ee(y,f,c),Ie($,f,c),Ie(N,n,o),X(i[0],g,y),X(i[1],N,$),X(i[2],$,y),X(i[3],g,N)}function rr(i,s,o){var n;for(n=0;n<4;n++)Ye(i[n],s[n],o)}function nn(i,s){var o=r(),n=r(),c=r();Vt(c,s[2]),X(o,s[0],c),X(n,s[1],c),He(i,n),i[31]^=Kt(o)<<7}function rn(i,s,o){var n,c;for(Oe(i[0],x),Oe(i[1],G),Oe(i[2],G),Oe(i[3],x),c=255;c>=0;--c)n=o[c/8|0]>>(c&7)&1,rr(i,s,n),$a(s,i),$a(i,i),rr(i,s,n)}function ka(i,s){var o=[r(),r(),r(),r()];Oe(o[0],xe),Oe(o[1],it),Oe(o[2],G),X(o[3],xe,it),rn(i,o,s)}function on(i,s,o){var n=new Uint8Array(64),c=[r(),r(),r(),r()],f;for(o||l(s,32),pt(n,s,32),n[0]&=248,n[31]&=127,n[31]|=64,ka(c,n),nn(i,c),f=0;f<32;f++)s[f+32]=i[f];return 0}var Pa=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function sn(i,s){var o,n,c,f;for(n=63;n>=32;--n){for(o=0,c=n-32,f=n-12;c<f;++c)s[c]+=o-16*s[n]*Pa[c-(n-32)],o=Math.floor((s[c]+128)/256),s[c]-=o*256;s[c]+=o,s[n]=0}for(o=0,c=0;c<32;c++)s[c]+=o-(s[31]>>4)*Pa[c],o=s[c]>>8,s[c]&=255;for(c=0;c<32;c++)s[c]-=o*Pa[c];for(n=0;n<32;n++)s[n+1]+=s[n]>>8,i[n]=s[n]&255}function ln(i){var s=new Float64Array(64),o;for(o=0;o<64;o++)s[o]=i[o];for(o=0;o<64;o++)i[o]=0;sn(i,s)}function ir(i,s,o,n){var c=new Uint8Array(64),f=new Uint8Array(64),g=new Uint8Array(64),y,$,N=new Float64Array(64),C=[r(),r(),r(),r()];pt(c,n,32),c[0]&=248,c[31]&=127,c[31]|=64;var re=o+64;for(y=0;y<o;y++)i[64+y]=s[y];for(y=0;y<32;y++)i[32+y]=c[32+y];for(pt(g,i.subarray(32),o+32),ln(g),ka(C,g),nn(i,C),y=32;y<64;y++)i[y]=n[y];for(pt(f,i,o+64),ln(f),y=0;y<64;y++)N[y]=0;for(y=0;y<32;y++)N[y]=g[y];for(y=0;y<32;y++)for($=0;$<32;$++)N[y+$]+=f[y]*c[$];return sn(i.subarray(32),N),re}function Ki(i,s){var o=r(),n=r(),c=r(),f=r(),g=r(),y=r(),$=r();return Oe(i[2],G),kt(i[1],s),Ce(c,i[1]),X(f,c,ue),Ee(c,c,i[2]),Ie(f,i[2],f),Ce(g,f),Ce(y,g),X($,y,g),X(o,$,c),X(o,o,f),Jt(o,o),X(o,o,c),X(o,o,f),X(o,o,f),X(i[0],o,f),Ce(n,i[0]),X(n,n,f),zt(n,c)&&X(i[0],i[0],bt),Ce(n,i[0]),X(n,n,f),zt(n,c)?-1:(Kt(i[0])===s[31]>>7&&Ee(i[0],x,i[0]),X(i[3],i[0],i[1]),0)}function cn(i,s,o,n){var c,f=new Uint8Array(32),g=new Uint8Array(64),y=[r(),r(),r(),r()],$=[r(),r(),r(),r()];if(o<64||Ki($,n))return-1;for(c=0;c<o;c++)i[c]=s[c];for(c=0;c<32;c++)i[c+32]=n[c];if(pt(g,i,o),ln(g),rn(y,$,g),ka($,s.subarray(32)),$a(y,$),nn(f,y),o-=64,yt(s,0,f,0)){for(c=0;c<o;c++)i[c]=0;return-1}for(c=0;c<o;c++)i[c]=s[c+64];return o}var dn=32,Ca=24,Xt=32,Pt=16,ea=32,Ta=32,ta=32,aa=32,un=32,or=Ca,Vi=Xt,Ji=Pt,ze=64,ft=32,Ct=64,pn=32,fn=64;t.lowlevel={crypto_core_hsalsa20:st,crypto_stream_xor:wt,crypto_stream:Yt,crypto_stream_salsa20_xor:Ft,crypto_stream_salsa20:Gt,crypto_onetimeauth:xt,crypto_onetimeauth_verify:Ht,crypto_verify_16:jt,crypto_verify_32:yt,crypto_secretbox:At,crypto_secretbox_open:St,crypto_scalarmult:ct,crypto_scalarmult_base:dt,crypto_box_beforenm:ut,crypto_box_afternm:k,crypto_box:Ae,crypto_box_open:an,crypto_box_keypair:Zt,crypto_hash:pt,crypto_sign:ir,crypto_sign_keypair:on,crypto_sign_open:cn,crypto_secretbox_KEYBYTES:dn,crypto_secretbox_NONCEBYTES:Ca,crypto_secretbox_ZEROBYTES:Xt,crypto_secretbox_BOXZEROBYTES:Pt,crypto_scalarmult_BYTES:ea,crypto_scalarmult_SCALARBYTES:Ta,crypto_box_PUBLICKEYBYTES:ta,crypto_box_SECRETKEYBYTES:aa,crypto_box_BEFORENMBYTES:un,crypto_box_NONCEBYTES:or,crypto_box_ZEROBYTES:Vi,crypto_box_BOXZEROBYTES:Ji,crypto_sign_BYTES:ze,crypto_sign_PUBLICKEYBYTES:ft,crypto_sign_SECRETKEYBYTES:Ct,crypto_sign_SEEDBYTES:pn,crypto_hash_BYTES:fn,gf:r,D:ue,L:Pa,pack25519:He,unpack25519:kt,M:X,A:Ie,S:Ce,Z:Ee,pow2523:Jt,add:$a,set25519:Oe,modL:sn,scalarmult:rn,scalarbase:ka};function sr(i,s){if(i.length!==dn)throw new Error("bad key size");if(s.length!==Ca)throw new Error("bad nonce size")}function Zi(i,s){if(i.length!==ta)throw new Error("bad public key size");if(s.length!==aa)throw new Error("bad secret key size")}function _e(){for(var i=0;i<arguments.length;i++)if(!(arguments[i]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function lr(i){for(var s=0;s<i.length;s++)i[s]=0}t.randomBytes=function(i){var s=new Uint8Array(i);return l(s,i),s},t.secretbox=function(i,s,o){_e(i,s,o),sr(o,s);for(var n=new Uint8Array(Xt+i.length),c=new Uint8Array(n.length),f=0;f<i.length;f++)n[f+Xt]=i[f];return At(c,n,n.length,s,o),c.subarray(Pt)},t.secretbox.open=function(i,s,o){_e(i,s,o),sr(o,s);for(var n=new Uint8Array(Pt+i.length),c=new Uint8Array(n.length),f=0;f<i.length;f++)n[f+Pt]=i[f];return n.length<32||St(c,n,n.length,s,o)!==0?null:c.subarray(Xt)},t.secretbox.keyLength=dn,t.secretbox.nonceLength=Ca,t.secretbox.overheadLength=Pt,t.scalarMult=function(i,s){if(_e(i,s),i.length!==Ta)throw new Error("bad n size");if(s.length!==ea)throw new Error("bad p size");var o=new Uint8Array(ea);return ct(o,i,s),o},t.scalarMult.base=function(i){if(_e(i),i.length!==Ta)throw new Error("bad n size");var s=new Uint8Array(ea);return dt(s,i),s},t.scalarMult.scalarLength=Ta,t.scalarMult.groupElementLength=ea,t.box=function(i,s,o,n){var c=t.box.before(o,n);return t.secretbox(i,s,c)},t.box.before=function(i,s){_e(i,s),Zi(i,s);var o=new Uint8Array(un);return ut(o,i,s),o},t.box.after=t.secretbox,t.box.open=function(i,s,o,n){var c=t.box.before(o,n);return t.secretbox.open(i,s,c)},t.box.open.after=t.secretbox.open,t.box.keyPair=function(){var i=new Uint8Array(ta),s=new Uint8Array(aa);return Zt(i,s),{publicKey:i,secretKey:s}},t.box.keyPair.fromSecretKey=function(i){if(_e(i),i.length!==aa)throw new Error("bad secret key size");var s=new Uint8Array(ta);return dt(s,i),{publicKey:s,secretKey:new Uint8Array(i)}},t.box.publicKeyLength=ta,t.box.secretKeyLength=aa,t.box.sharedKeyLength=un,t.box.nonceLength=or,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(i,s){if(_e(i,s),s.length!==Ct)throw new Error("bad secret key size");var o=new Uint8Array(ze+i.length);return ir(o,i,i.length,s),o},t.sign.open=function(i,s){if(_e(i,s),s.length!==ft)throw new Error("bad public key size");var o=new Uint8Array(i.length),n=cn(o,i,i.length,s);if(n<0)return null;for(var c=new Uint8Array(n),f=0;f<c.length;f++)c[f]=o[f];return c},t.sign.detached=function(i,s){for(var o=t.sign(i,s),n=new Uint8Array(ze),c=0;c<n.length;c++)n[c]=o[c];return n},t.sign.detached.verify=function(i,s,o){if(_e(i,s,o),s.length!==ze)throw new Error("bad signature size");if(o.length!==ft)throw new Error("bad public key size");var n=new Uint8Array(ze+i.length),c=new Uint8Array(ze+i.length),f;for(f=0;f<ze;f++)n[f]=s[f];for(f=0;f<i.length;f++)n[f+ze]=i[f];return cn(c,n,n.length,o)>=0},t.sign.keyPair=function(){var i=new Uint8Array(ft),s=new Uint8Array(Ct);return on(i,s),{publicKey:i,secretKey:s}},t.sign.keyPair.fromSecretKey=function(i){if(_e(i),i.length!==Ct)throw new Error("bad secret key size");for(var s=new Uint8Array(ft),o=0;o<s.length;o++)s[o]=i[32+o];return{publicKey:s,secretKey:new Uint8Array(i)}},t.sign.keyPair.fromSeed=function(i){if(_e(i),i.length!==pn)throw new Error("bad seed size");for(var s=new Uint8Array(ft),o=new Uint8Array(Ct),n=0;n<32;n++)o[n]=i[n];return on(s,o,!0),{publicKey:s,secretKey:o}},t.sign.publicKeyLength=ft,t.sign.secretKeyLength=Ct,t.sign.seedLength=pn,t.sign.signatureLength=ze,t.hash=function(i){_e(i);var s=new Uint8Array(fn);return pt(s,i,i.length),s},t.hash.hashLength=fn,t.verify=function(i,s){return _e(i,s),i.length===0||s.length===0||i.length!==s.length?!1:vt(i,0,s,0,i.length)===0},t.setPRNG=function(i){l=i},function(){var i=typeof self<"u"?self.crypto||self.msCrypto:null;if(i&&i.getRandomValues){var s=65536;t.setPRNG(function(o,n){var c,f=new Uint8Array(n);for(c=0;c<n;c+=s)i.getRandomValues(f.subarray(c,c+Math.min(n-c,s)));for(c=0;c<n;c++)o[c]=f[c];lr(f)})}else typeof co<"u"&&(i=no,i&&i.randomBytes&&t.setPRNG(function(o,n){var c,f=i.randomBytes(n);for(c=0;c<n;c++)o[c]=f[c];lr(f)}))}()})(e.exports?e.exports:self.nacl=self.nacl||{})})(Er);var uo=Er.exports;const po=ro(uo),fo=12e4,mt=new Map;let go=1;function _r(){const e=Or();return{isAndroidNative:!!(e!=null&&e.mwaRequest),bridgeAvailable:!!e}}async function ho(){return{count:(await Ve("status")).cachedCount}}async function Nr(e){const t=new Ra(e),r=await t.reconnectLatest();return r?{backend:t,address:r,walletName:t.walletName(),cacheCount:t.cacheCount()}:null}class Ra{constructor(t){La(this,"cluster");La(this,"approvals",new Map);La(this,"activeStatus",null);this.cluster=mo(t.cluster)}async capabilities(){var t,r,l;return(t=this.activeStatus)!=null&&t.capabilities||await this.refreshStatus(),(r=this.activeStatus)!=null&&r.capabilities?this.activeStatus.capabilities:cr(this.cluster,(l=this.activeStatus)==null?void 0:l.address)}async getAddress(){var r;if((r=this.activeStatus)!=null&&r.address)return this.activeStatus.address;const t=await this.refreshStatus();return t.address?t.address:this.connect()}async connect(){const t=await Ve("connect",{cluster:this.cluster});if(this.applyStatus(t),!t.address)throw new Re("wallet_unreachable","Android MWA did not return a wallet address.");return t.address}async reconnectLatest(){const t=await Ve("reconnectLatest",{cluster:this.cluster});return this.applyStatus(t),t.address??null}async submit(t){if(t.cluster!==this.cluster)throw new Re("cluster_mismatch",`Android native MWA is connected to ${this.cluster}; request targets ${t.cluster}.`);await this.getAddress();const r={requestId:t.id,status:"pending"};return this.approvals.set(t.id,r),Ve("sign",t).then(l=>{this.approvals.set(t.id,{requestId:t.id,status:"approved",result:l})}).catch(l=>{const p=Mr(l);this.approvals.set(t.id,{requestId:t.id,status:p.code==="user_rejected"?"rejected":"failed",error:p.toPayload()})}),r}async poll(t){const r=this.approvals.get(t);if(!r)throw new Re("invalid_request",`Unknown Android native MWA request id: ${t}`);return r}async cancel(t){this.approvals.get(t)&&this.approvals.set(t,{requestId:t,status:"rejected",error:{code:"user_rejected",message:"Android native MWA approval request cancelled by caller.",recoverable:!1}})}async disconnect(){const t=await Ve("disconnect");this.applyStatus(t)}async clearTransientState(){const t=await Ve("clearTransient");this.applyStatus(t)}async clearStateFullReset(){const t=await Ve("fullReset");this.applyStatus(t)}async clearAllCachedAuthorizations(){const t=await Ve("clearAllAccounts");this.applyStatus(t)}walletName(){return xo(this.activeStatus)}cacheCount(){var t;return((t=this.activeStatus)==null?void 0:t.cachedCount)??0}async refreshStatus(){const t=await Ve("status");return this.applyStatus(t),t}applyStatus(t){this.activeStatus={...t,capabilities:t.capabilities??cr(this.cluster,t.address)}}}function cr(e,t){return{backend:"android-native-mwa",cluster:[e],supports:{signMessage:!0,signTransaction:!0,signAndSendTransaction:!0,multiSign:!0,simulationPreview:!1},...t&&{address:t}}}function mo(e){if(e==="localnet")throw new Re("cluster_mismatch","Android native MWA supports mainnet-beta, devnet, and testnet. Select devnet for local testing.");return e}function Ve(e,t){bo();const r=Or();if(!(r!=null&&r.mwaRequest))return Promise.reject(new Re("wallet_unreachable","Android native MWA bridge is not available."));const l=r,p=`android-mwa-${Date.now()}-${go++}`;return new Promise((b,x)=>{const G=window.setTimeout(()=>{mt.delete(p),sa("request","FAIL",{method:e,requestId:p,reason:"timeout"},"warn"),x(new Re("expired",`Android native MWA request ${p} timed out.`))},fo);mt.set(p,{method:e,resolve:ne=>b(ne),reject:x,timer:G});try{sa("request","START",{method:e,requestId:p}),l.mwaRequest(p,e,JSON.stringify(t??{}))}catch(ne){window.clearTimeout(G),mt.delete(p),sa("request","FAIL",{method:e,requestId:p,error:ne instanceof Error?ne.message:String(ne)},"warn"),x(Mr(ne))}})}function bo(){const e=window;e.__agenticAndroidMwaBridge||(e.__agenticAndroidMwaBridge={resolve(t,r){const l=mt.get(t);l&&(window.clearTimeout(l.timer),mt.delete(t),sa("request","SUCCESS",{method:l.method,requestId:t}),l.resolve(r))},reject(t,r){const l=mt.get(t);l&&(window.clearTimeout(l.timer),mt.delete(t),sa("request","FAIL",{method:l.method,requestId:t,code:r.code??"UNKNOWN",message:r.message??"Android native MWA request failed."},"warn"),l.reject(Wr(r)))}})}function Or(){return globalThis.AgenticAndroid}function Mr(e){return e instanceof Re?e:yo(e)?Re.fromPayload(e):wo(e)?Wr(e):new Re("wallet_unreachable",e instanceof Error?e.message:String(e))}function Wr(e){return new Re(vo(e.code),e.message||"Android native MWA request failed.")}function vo(e){switch((e??"").toUpperCase()){case"USER_REJECTED":return"user_rejected";case"UNAUTHORIZED":case"WALLET_AUTH_MISMATCH":case"WALLET_CHANGED":case"INSUFFICIENT_FUNDS_FOR_RENT":return"unauthorized";case"CLUSTER_MISMATCH":return"cluster_mismatch";case"UNSUPPORTED_METHOD":case"WALLET_SIGN_MESSAGES_UNSUPPORTED":case"JUPITER_SIGN_TRANSACTION_UNSUPPORTED":return"unsupported_method";case"INVALID_PAYLOADS":case"INVALID_REQUEST":return"invalid_request";case"NO_WALLET_FOUND":case"WALLET_HUNG":case"WALLET_ERROR":case"WALLET_NATIVE_SIGN_AND_SEND_UNSUPPORTED":case"RPC_BROADCAST_FAILED":default:return"wallet_unreachable"}}function yo(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.code=="string"&&typeof t.message=="string"}function wo(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.code=="string"||typeof t.message=="string"}function xo(e){var r;const t=((r=e==null?void 0:e.walletPackage)==null?void 0:r.toLowerCase())??"";return t.includes("phantom")?"Phantom":t.includes("solflare")?"Solflare":t.includes("backpack")?"Backpack":t.includes("jupiter")?"Jupiter":e!=null&&e.accountLabel?e.accountLabel:"Mobile Wallet Adapter"}function sa(e,t,r,l="info"){const p=Object.entries(r).map(([x,G])=>`${x}=${JSON.stringify(G)}`).join(" "),b=`[AgentAndroidNative] ${e} | ${t}${p?` ${p}`:""}`;if(l==="warn"){console.warn(b);return}console.info(b)}const En=["Wallet approval is required before any signature or transaction leaves the device.","The agent never receives the wallet private key or seed phrase.","Amounts, recipients, routes, and policy notes must be visible before signing."],dr="https://api.openai.com/v1",It="gpt-5",_n="openai",ua=[{id:"openai",label:"OpenAI",detail:"GPT models through Agentic hosted or local bridge calls.",apiFormat:"openai-compatible",baseUrl:dr,model:It,models:[{id:"gpt-5.5",label:"GPT-5.5"},{id:"gpt-5.4",label:"GPT-5.4"},{id:"gpt-5.4-mini",label:"GPT-5.4 mini"},{id:"gpt-5.4-nano",label:"GPT-5.4 nano"},{id:It,label:"GPT-5"},{id:"gpt-5.2",label:"GPT-5.2"},{id:"gpt-5.1",label:"GPT-5.1"},{id:"gpt-5-mini",label:"GPT-5 mini"},{id:"gpt-5-nano",label:"GPT-5 nano"},{id:"gpt-4.1",label:"GPT-4.1"}]},{id:"anthropic",label:"Claude / Anthropic",detail:"Claude models through the Anthropic Messages API.",apiFormat:"anthropic",baseUrl:"https://api.anthropic.com/v1",model:"claude-sonnet-4-5",models:[{id:"claude-sonnet-4-5",label:"Claude Sonnet 4.5"},{id:"claude-sonnet-4-5-20250929",label:"Claude Sonnet 4.5 snapshot"},{id:"claude-opus-4-1-20250805",label:"Claude Opus 4.1"},{id:"claude-sonnet-4-20250514",label:"Claude Sonnet 4"},{id:"claude-3-5-haiku-20241022",label:"Claude Haiku 3.5"}]},{id:"gemini",label:"Gemini",detail:"Google Gemini through its OpenAI-compatible endpoint.",apiFormat:"openai-compatible",baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai",model:"gemini-2.5-flash",models:[{id:"gemini-2.5-flash",label:"Gemini 2.5 Flash"},{id:"gemini-2.5-pro",label:"Gemini 2.5 Pro"},{id:"gemini-2.5-flash-lite",label:"Gemini 2.5 Flash-Lite"},{id:"gemini-2.0-flash",label:"Gemini 2.0 Flash"}]},{id:"openrouter",label:"OpenRouter",detail:"Use OpenRouter as a gateway for many hosted models.",apiFormat:"openai-compatible",baseUrl:"https://openrouter.ai/api/v1",model:"openrouter/auto",models:[{id:"openrouter/auto",label:"Auto Router"},{id:"openai/gpt-5",label:"OpenAI GPT-5"},{id:"anthropic/claude-sonnet-4.5",label:"Claude Sonnet 4.5"},{id:"google/gemini-2.5-pro",label:"Gemini 2.5 Pro"}]},{id:"custom-openai-compatible",label:"Custom OpenAI-compatible",detail:"Vercel AI Gateway, Cloudflare AI Gateway, or a self-hosted proxy.",apiFormat:"openai-compatible",baseUrl:dr,model:It,models:[{id:It,label:"GPT-5 compatible default"}]}],Cn=[de("payments","transfer-sol","Send SOL","Prepare a SOL payment with recipient, amount, memo, and wallet approval.","transfer_sol","medium",[M("recipient","Recipient address","Recipient public key","",!0),M("amount","Amount SOL","0.01","0.01",!0),M("memo","Memo / reason","Invoice, friend payment, reimbursement","User-approved SOL payment")]),de("payments","transfer-token","Send SPL token","Prepare a token transfer for USDC, BONK, JUP, or any configured SPL token.","transfer_spl","medium",[Te("token","Token",["USDC","SOL","JUP","BONK","WIF","PYUSD"],"USDC"),M("recipient","Recipient address","Recipient public key","",!0),M("amount","Token amount","10","10",!0),M("memo","Memo / reason","Payment reason","User-approved token payment")]),de("trading","swap","Swap tokens","Prepare a Jupiter-style swap request with explicit input, output, amount, and slippage cap.","swap","medium",[Te("inputToken","Input token",["SOL","USDC","JUP","BONK","WIF","PYUSD"],"SOL"),Te("outputToken","Output token",["USDC","SOL","JUP","BONK","WIF","PYUSD"],"USDC"),M("amount","Input amount","0.01","0.01",!0),M("slippageBps","Max slippage bps","50","50")]),de("recurring","dca","DCA recurring buy","Create a recurring approval schedule where every occurrence still needs wallet review.","recurring_payment","medium",[Te("token","Spend token",["SOL","USDC","PYUSD"],"USDC"),M("amount","Amount per occurrence","10","10",!0),M("recipient","Recipient / settlement wallet","Recipient public key","",!0),Te("cadence","Cadence",["weekly","monthly","interval_days"],"weekly"),M("memo","Strategy note","Buy SOL weekly if route stays under cap","Recurring DCA approval")]),de("recurring","subscription","Subscription / allowance","Prepare a recurring payment review without granting unlimited authority.","recurring_payment","medium",[Te("token","Token",["USDC","SOL","PYUSD"],"USDC"),M("recipient","Recipient address","Recipient public key","",!0),M("amount","Max amount per payment","5","5",!0),Te("cadence","Cadence",["weekly","monthly","interval_days"],"monthly"),M("memo","Service / reason","Subscription memo","Recurring user-approved payment")]),de("trading","limit-order","Limit order review","Draft a limit-order intent that waits for explicit wallet approval at execution time.","manual_review","medium",[Te("inputToken","Input token",["SOL","USDC","JUP","BONK","WIF"],"SOL"),Te("outputToken","Output token",["USDC","SOL","JUP","BONK","WIF"],"USDC"),M("amount","Input amount","0.1","0.1"),M("limitPrice","Limit price / condition","Only if SOL >= $250","")]),de("trading","rebalance","Portfolio rebalance","Plan a rebalance while preserving final wallet approval for each action.","manual_review","high",[gt("target","Target allocation","Example: 60% SOL, 30% USDC, 10% JUP"),M("maxTradeSize","Max trade size","100 USDC","100 USDC"),M("slippageBps","Max slippage bps","50","50")]),de("portfolio","balances","Portfolio check","Read and summarize wallet balances before proposing any action.","read_only","low",[Te("scope","Scope",["SOL + configured tokens","All SPL tokens","NFTs","DeFi positions"],"SOL + configured tokens"),M("threshold","Alert threshold","Show assets over $10","Show assets over $10")]),de("portfolio","nft-review","NFT holdings review","Review NFT holdings, floor-risk notes, and suspicious collection signals.","read_only","low",[M("collection","Collection / mint","Optional collection name or mint",""),Te("goal","Goal",["Summarize","Flag suspicious assets","Prepare sale review","Prepare transfer review"],"Summarize")]),de("staking","stake-sol","Stake SOL","Draft a staking/delegation action with validator and amount visible before signing.","manual_review","medium",[M("validator","Validator vote account","Vote account or validator name","",!0),M("amount","Amount SOL","1","1"),M("memo","Reason","Stake with selected validator","Stake review")]),de("staking","unstake-sol","Unstake / deactivate","Prepare an unstake or deactivate review with cooldown expectations.","manual_review","medium",[M("stakeAccount","Stake account","Stake account public key",""),M("amount","Amount SOL or all","all","all"),M("memo","Reason","Liquidity needed","Unstake review")]),de("governance","vote","Governance vote","Summarize a proposal and create a wallet approval proof for the chosen vote.","manual_review","medium",[M("proposal","Proposal link / id","Realm proposal URL or id","",!0),Te("vote","Vote",["Yes","No","Abstain"],"Abstain"),gt("reason","Voting reason","Why this vote matches my policy")]),de("security","transaction-review","Transaction simulation review","Review transaction bytes, touched programs, accounts, and authority changes before signing.","manual_review","high",[gt("transaction","Transaction / link / base64","Paste transaction bytes, link, or request description"),M("policy","Policy cap","No new authority grants, no unlimited approvals","No new authority grants")]),de("security","authority-audit","Authority / approval audit","Look for delegate authority, token account permissions, and suspicious approval semantics.","manual_review","high",[M("programOrMint","Program, mint, or account","Address to review",""),gt("concern","Concern","What feels risky or needs checking?")]),de("security","rug-check","Token risk check","Draft a token risk review before buying, swapping, or accepting a token.","manual_review","high",[M("mint","Token mint","Mint address",""),M("amount","Planned amount","Optional amount",""),M("source","Source / link","DexScreener, Jupiter, X, website","")]),de("defi","lend-borrow","Lending / borrow review","Prepare a DeFi lending, borrow, repay, or withdraw plan with collateral risk visible.","manual_review","high",[Te("action","Action",["Deposit","Withdraw","Borrow","Repay"],"Deposit"),M("market","Protocol / market","Kamino, MarginFi, Solend, custom",""),M("amount","Amount","100 USDC","100 USDC"),M("ltv","Max LTV / rule","Stay below 50% LTV","Stay below 50% LTV")]),de("defi","liquidity","Liquidity position review","Review LP deposits, withdrawals, fees, and impermanent loss before wallet approval.","manual_review","high",[M("pool","Pool / protocol","Orca, Raydium, Meteora, custom",""),M("amounts","Amounts","0.1 SOL + 20 USDC",""),M("range","Price range / condition","Optional range","")]),de("nft","nft-transfer","NFT transfer","Prepare an NFT transfer with recipient, collection, and anti-phishing checks.","manual_review","medium",[M("mint","NFT mint","Mint address","",!0),M("recipient","Recipient address","Recipient public key","",!0),M("memo","Reason","Transfer memo","NFT transfer review")]),de("nft","marketplace-listing","Marketplace listing review","Draft a listing or delisting review with price, marketplace, and royalties visible.","manual_review","medium",[M("mint","NFT mint","Mint address",""),M("marketplace","Marketplace","Tensor, Magic Eden, custom",""),M("price","Price","1 SOL","")]),de("developer","devnet-smoke","Devnet smoke test","Prepare a safe devnet signing test for local wallets, bridge, and receipt flow.","manual_review","low",[M("message","Test message","Approve this Agentic devnet smoke test.","Approve this Agentic devnet smoke test."),Te("network","Network",["devnet","testnet","localnet"],"devnet")]),de("developer","custom-tx","Custom transaction bytes","Review pasted transaction bytes and produce an approval checklist before signing.","manual_review","high",[gt("transaction","Transaction bytes / base64","Paste base64 transaction bytes"),M("expected","Expected outcome","What should happen if signed?","")]),de("mobile","seed-vault","Seed Vault mobile approval","Plan an Android MWA or Seed Vault signing path without exposing wallet keys.","manual_review","medium",[Te("walletPath","Wallet path",["Mobile Wallet Adapter","Seed Vault Wallet","Phantom mobile","Solflare mobile"],"Mobile Wallet Adapter"),M("action","Action","Connect wallet and approve request","Connect wallet and approve request"),M("deviceNote","Device note","Seeker / Android Chrome / TWA","Android Chrome / TWA")]),de("integration","dapp-interaction","dApp interaction review","Prepare a review for a third-party dApp request before the user signs.","manual_review","high",[M("dapp","dApp / URL","Jupiter, Meteora, Tensor, custom URL",""),gt("request","Request details","What the dApp asks the wallet to sign"),M("policy","Policy cap","No unknown programs or authority grants","No unknown programs or authority grants")]),de("bridge","bridge-swap","Bridge / cross-chain link review","Review a bridge or cross-chain link while keeping signing inside the wallet flow.","manual_review","high",[M("sourceChain","Source chain","Solana","Solana"),M("destinationChain","Destination chain","Base, Ethereum, Arbitrum, Solana",""),M("amount","Amount","10 USDC","10 USDC"),M("link","Bridge link / quote","Paste link or quote id","")]),de("receipts","tax-export","Receipt / tax note","Create an audit note after approval for tax, accounting, or operations review.","read_only","low",[M("txid","Transaction id","Optional tx id",""),M("label","Label","Treasury transfer, swap, reimbursement","Agentic wallet action"),gt("notes","Notes","Accounting or audit notes")]),de("custom","custom-request","Custom request","Turn any plain-English request into a visible approval plan before signing.","manual_review","medium",[M("policy","Policy cap","What should never be allowed?","No private key sharing, no unlimited approvals")])];function ga(e){return Cn.find(t=>t.id===e)??Cn[0]}function Fa(e){return Object.fromEntries(e.fields.map(t=>[t.id,t.defaultValue??""]))}function Ao(e,t){var r;return((r=e.fields.find(l=>l.id===t))==null?void 0:r.label)??Nn(t)}function Rr(e,t,r="template",l=""){const p=Wo(e,t),b=p.length?p.map(G=>`${G.label}: ${G.value}`).join("; "):e.prompt,x=l.trim();return{intent:r==="ai"?e.prompt:`${e.title}: ${b}`,route:gn(e.route,t),risk:gn(e.riskText,t),approval:gn(e.approval,t),source:r,category:e.category,actionType:e.actionType,templateTitle:e.title,...x&&{userNotes:x},parameters:t,fields:p,safeguards:[...En,...e.safeguards]}}function nt(e){return ua.find(t=>t.id===e)??ua[0]}function So(e){return e==="anthropic"?"Anthropic Messages API":"OpenAI-compatible"}async function $o(e,t){if(!e.apiKey.trim())throw new Error("Session AI key is required.");if(e.provider==="openai")throw new Error("OpenAI keys cannot be called directly from browser session mode. Select Hosted BYOK or Local bridge.");return e.apiFormat==="anthropic"?Eo(e,t):To(e,t)}async function ko(e,t){if(!e.apiKey.trim())throw new Error("Hosted BYOK key is required.");await Po();const r=await fetch("/api/ai/generate-plan",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({settings:{apiKey:e.apiKey,provider:e.provider,apiFormat:e.apiFormat,baseUrl:e.baseUrl,model:e.model},request:t})}).catch(p=>{throw new Error(`Hosted AI request failed. ${p instanceof Error?p.message:String(p)}`)}),l=await Br(r,"Hosted BYOK API returned a non-JSON response. Serve Agentic through the Render Node service or use Local bridge.");if(!r.ok)throw new Error(Qe(jr(l)||`Hosted AI returned HTTP ${r.status}.`));return Lo(l,t)}async function Po(){const e=await fetch("/api/ai/status",{headers:{accept:"application/json"}}).catch(r=>{throw new Error(`Hosted BYOK API is not reachable on this origin. Serve Agentic through the Render Node service or use Local bridge. ${r instanceof Error?r.message:String(r)}`)}),t=await Br(e,"Hosted BYOK API is not available on this origin. Serve Agentic through the Render Node service or use Local bridge.");if(!e.ok||!Co(t))throw new Error("Hosted BYOK API is not available on this origin. Serve Agentic through the Render Node service or use Local bridge.")}function Co(e){if(!e||typeof e!="object")return!1;const t=e;return t.available===!0&&t.mode==="hosted-byok"}async function Br(e,t){const r=await e.text().catch(()=>"");if(!r.trim())return{};try{return JSON.parse(r)}catch{throw new Error(t)}}async function To(e,t){const r=qr(e.baseUrl,"openai-compatible"),l={model:e.model.trim()||It,response_format:{type:"json_object"},messages:Ur(t),...!Ro(e.model.trim()||It)&&{temperature:.2}},p=await fetch(`${r}/chat/completions`,{method:"POST",headers:{authorization:`Bearer ${e.apiKey.trim()}`,"content-type":"application/json"},body:JSON.stringify(l)}).catch(x=>{throw new Error(`AI provider request failed. Use the local bridge or a browser-compatible gateway. ${x instanceof Error?x.message:String(x)}`)}),b=await p.json().catch(()=>({}));if(!p.ok)throw new Error(Fr(b,p.status));return Dr(b,t)}function Lo(e,t){if(!Io(e))throw new Error("Hosted AI returned an invalid plan.");const r=e,l=Array.isArray(r.fields)?r.fields.filter(b=>!!b&&typeof b=="object"&&typeof b.label=="string"&&typeof b.value=="string"):Object.entries(t.parameters).filter(([,b])=>b.trim().length>0).map(([b,x])=>({label:Nn(b),value:x})),p=Array.isArray(r.safeguards)?r.safeguards.filter(b=>typeof b=="string"&&b.trim().length>0):En;return{intent:Me(r.intent,`${t.template.title}: ${t.prompt}`),route:Me(r.route,`Draft ${t.template.actionType} request and show route details before wallet approval.`),risk:Me(r.risk,`Risk level ${t.template.risk}. Verify all visible fields before signing.`),approval:Me(r.approval,"Wallet approval remains a separate explicit user action."),source:"ai",category:Me(r.category,t.template.category),actionType:Me(r.actionType,t.template.actionType),templateTitle:Me(r.templateTitle,t.template.title),userNotes:typeof r.userNotes=="string"?r.userNotes:t.userNotes,parameters:r.parameters&&typeof r.parameters=="object"?r.parameters:t.parameters,fields:l,safeguards:p}}function Io(e){if(!e||typeof e!="object")return!1;const t=e;return t.source==="ai"&&typeof t.intent=="string"&&typeof t.route=="string"&&typeof t.risk=="string"&&typeof t.approval=="string"}async function Eo(e,t){var ne,ue;const r=qr(e.baseUrl,"anthropic"),l=Ur(t),p=((ne=l[0])==null?void 0:ne.content)??"",b=((ue=l[1])==null?void 0:ue.content)??JSON.stringify(t),x=await fetch(`${r}/messages`,{method:"POST",headers:{"anthropic-dangerous-direct-browser-access":"true","anthropic-version":"2023-06-01","content-type":"application/json","x-api-key":e.apiKey.trim()},body:JSON.stringify({model:e.model.trim()||nt("anthropic").model,max_tokens:1024,system:p,messages:[{role:"user",content:b}],temperature:.2})}).catch(pe=>{throw new Error(`AI provider request failed. Use the local bridge or a browser-compatible gateway. ${pe instanceof Error?pe.message:String(pe)}`)}),G=await x.json().catch(()=>({}));if(!x.ok)throw new Error(Fr(G,x.status));return Dr(G,t)}function Ur(e){return[{role:"system",content:"You convert Solana wallet user requests into structured approval plans. Return only JSON with string fields intent, route, risk, approval, and safeguards as an array of short strings. Never claim a transaction is signed, submitted, approved, or safe. Never request private keys. The wallet user must approve separately."},{role:"user",content:JSON.stringify({userPrompt:e.prompt,userNotes:e.userNotes,template:e.template,parameters:e.parameters,requiredBoundary:"AI drafts a plan only. Wallet approval and signing happen later in the user wallet."})}]}function Dr(e,t){var x;const r=Bo(e),l=Uo(r),p=ga(t.template.id),b=Rr(p,t.parameters,"ai");return{...b,intent:Me(l.intent,b.intent),route:Me(l.route,b.route),risk:Me(l.risk,b.risk),approval:Me(l.approval,b.approval),source:"ai",userNotes:((x=t.userNotes)==null?void 0:x.trim())||t.prompt.trim()||void 0,safeguards:Do(l.safeguards,b.safeguards)}}function Qe(e){return e.replace(/Bearer\s+[A-Za-z0-9._~+/=-]+/gi,"Bearer [redacted]").replace(/\bsk-[A-Za-z0-9_-]{8,}\b/g,"sk-[redacted]").replace(/\bsk-proj-[A-Za-z0-9_-]{8,}\b/g,"sk-proj-[redacted]").replace(/\b[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{20,}\b/g,"[redacted-token]")}function de(e,t,r,l,p,b,x){return{id:t,category:e,title:r,description:l,actionType:p,risk:b,route:_o(p),riskText:No(b),approval:Oo(p),safeguards:Mo(p,b),requiresWallet:p!=="read_only",requiresBridge:["transfer_sol","transfer_spl","swap","recurring_payment"].includes(p),fields:x,prompt:l}}function M(e,t,r="",l="",p=!1){return{id:e,label:t,placeholder:r,defaultValue:l,required:p,type:"text"}}function gt(e,t,r="",l=""){return{id:e,label:t,placeholder:r,defaultValue:l,type:"textarea"}}function Te(e,t,r,l){return{id:e,label:t,options:r,defaultValue:l,type:"select"}}function _o(e){switch(e){case"transfer_sol":return"Prepare a SOL transfer to {recipient} for {amount} SOL. Queue through the local bridge when connected.";case"transfer_spl":return"Prepare a {token} transfer to {recipient} for {amount}. Queue through the local bridge when connected.";case"swap":return"Prepare a swap from {amount} {inputToken} to {outputToken} with max slippage {slippageBps} bps.";case"recurring_payment":return"Create a recurring review item for {amount} {token} on {cadence}. Every occurrence still requires wallet approval.";case"read_only":return"Read or review wallet context only. No transaction should be produced unless the user creates a separate approval.";default:return"Draft the request, expose the route and policy checks, then require a separate wallet approval before signing."}}function No(e){switch(e){case"low":return"Low signing risk. This is read-only or proof-oriented unless the user later creates a wallet action.";case"medium":return"Medium signing risk. Verify recipient, amount, network, fees, route, and memo before approving.";case"high":return"High signing risk. Require simulation, touched-program review, authority-delta review, and explicit user confirmation."}}function Oo(e){switch(e){case"read_only":return"No wallet signature is required unless the user chooses to sign an audit proof.";case"manual_review":return"Wallet can sign an off-chain approval proof after the user reviews the structured plan.";default:return"The local bridge can queue this action, but the wallet must still approve the final signature."}}function Mo(e,t){const r=["Reject any request that asks for a private key, seed phrase, unlimited approval, or hidden delegation."];return t==="high"&&r.push("Treat unknown programs, authority changes, and mismatched transaction semantics as blockers."),e==="swap"&&r.push("Confirm quote, output token, route, and slippage cap before signing."),e.includes("transfer")&&r.push("Confirm recipient address and amount character by character before signing."),r}function Wo(e,t){return e.fields.map(r=>({label:r.label,value:(t[r.id]??"").trim()})).filter(r=>r.value.length>0)}function gn(e,t){return e.replace(/\{([^}]+)\}/g,(r,l)=>{var b;return((b=t[l])==null?void 0:b.trim())||Nn(l)})}function qr(e,t){const r=e.trim().replace(/\/+$/,"");return r?t==="anthropic"?/\/v\d+(\/|$)/i.test(r)?r:`${r}/v1`:/\/v\d+(beta)?(\/|$)/i.test(r)||/\/openai$/i.test(r)?r:`${r}/v1`:nt(t==="anthropic"?"anthropic":_n).baseUrl}function jr(e){if(!e||typeof e!="object")return"";const r=e.error;if(typeof r=="string")return r;if(r&&typeof r=="object"){const l=r.message;return typeof l=="string"?l:""}return""}function Fr(e,t){const r=jr(e)||`AI provider returned HTTP ${t}.`;return/unsupported value:\s*['"]?temperature/i.test(r)||/temperature.*only the default/i.test(r)?Qe(`Model does not support one of Agentic's request parameters. ${r}`):Qe(r)}function Ro(e){const t=e.trim().toLowerCase();return t.startsWith("gpt-5")||t.includes("/gpt-5")||/^o\d/.test(t)||t.startsWith("o-")||t.includes("/o1")||t.includes("/o3")||t.includes("/o4")}function Bo(e){if(!e||typeof e!="object")return"";const t=e,r=t.output_text;if(typeof r=="string")return r;const l=t.content;if(Array.isArray(l)){const b=l.map(x=>{if(!x||typeof x!="object")return"";const G=x.text;return typeof G=="string"?G:""}).filter(Boolean).join(`
|
|
2
|
+
`);if(b)return b}const p=t.choices;if(Array.isArray(p)){const b=p[0];if(b&&typeof b=="object"){const x=b.message;if(x&&typeof x=="object"){const ne=x.content;if(typeof ne=="string")return ne}const G=b.text;if(typeof G=="string")return G}}return JSON.stringify(e)}function Uo(e){const t=e.trim(),r=t.startsWith("{")?t:t.slice(Math.max(0,t.indexOf("{")),t.lastIndexOf("}")+1);try{const l=JSON.parse(r);return l&&typeof l=="object"?l:{}}catch{return{}}}function Me(e,t){return typeof e=="string"&&e.trim()?e.trim():t}function Do(e,t){if(!Array.isArray(e))return t;const r=e.filter(l=>typeof l=="string"&&l.trim().length>0);return r.length?[...En,...r.slice(0,8)]:t}function Nn(e){return e.replace(/([A-Z])/g," $1").replace(/[-_]+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase())}const Gr={VITE_AGENTIC_ANDROID_SHOW_EXAMPLE_TAB:"false"},qo=["mainnet-beta","devnet","testnet","localnet"],On="Approve this Solana agent action with user custody.",jo="Solana Agent Wallet Adapter demo",Fo="http://127.0.0.1:8787",Go="local-agent-wallet",Yo="",Yr="solana-agent-wallet-demo-v2",Hr="solana-agent-wallet-generated-plans-v1",Ho=100,zr="solana-agent-wallet-lab-artifacts-v1",zo="solana-agent-wallet-lab-artifacts",Ko=1,Wt="artifacts",Vo=new Lr("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),Jo="https://github.com/mstevens843/solana-agent-wallet-adapter/releases/latest/download",Mn="https://github.com/mstevens843/solana-agent-wallet-adapter/releases/latest",Wn="npm install -g @solana-agent-wallet-adapter/cli",Rt="npm exec @solana-agent-wallet-adapter/cli -- app",Kr="solana-agent-wallet app",Vr="__custom__",Zo=["/","/docs","/app","/cli","/desktop","/android","/demo","/mwa-test","/privacy","/terms"],Qo=new Set(Zo),ye=Pd(),Rn=Id(),Xo=new Map([["#top","/"],["#docs","/docs"],["#browser","/app"],["#app","/app"],["#cli","/cli"],["#desktop","/desktop"],["#android","/android"],["#workspace","/demo"],["#mwa-test","/mwa-test"]]),es=[{route:"/",label:"Home"},{route:"/docs",label:"Docs"},{route:"/cli",label:"CLI",mobileHidden:!0},{route:"/desktop",label:"Desktop App",mobileHidden:!0},{route:"/demo",label:"Launch Demo",mobileLabel:"Demo"},...Rn?[{route:"/mwa-test",label:"MWA",mobileHidden:!0}]:[],{route:"/app",label:"Launch App",pill:!0,mobileLabel:"App"}],ts={"/mwa-test":"MWA · Agentic","/privacy":"Privacy Policy · Agentic","/terms":"Terms of Service · Agentic"},pa=[{id:"exec",eyebrow:"No install",label:"One-shot CLI",detail:"Start the local approval app from npm.",command:Rt,terminalCommand:Rt,badge:"No install",actionLabel:"Copy",actionKind:"copy",copyName:"CLI one-shot command",bridgeLine:"Bridge starts from terminal",walletLine:"Wallet host opens for Phantom, Backpack, or Solflare"},{id:"install",eyebrow:"Reusable",label:"Install once",detail:"Keep the approval app available from any terminal.",command:Wn,terminalCommand:Kr,badge:"Install",actionLabel:"Copy",actionKind:"copy",copyName:"CLI install command",bridgeLine:"Install once, then run solana-agent-wallet app",walletLine:"Local wallet host stays on your machine"},{id:"desktop",eyebrow:"App UI",label:"Desktop App",detail:"Use bundled controls, logs, and diagnostics.",command:"/desktop",terminalCommand:"/desktop",badge:"App UI",actionLabel:"View Desktop App",actionKind:"link",href:"/desktop",bridgeLine:"Desktop runtime manages the local bridge",walletLine:"Browser wallet still approves every request"}],as=[["macOS Apple Silicon","solana-agent-wallet-macos-arm64.tar.gz"],["macOS Intel","solana-agent-wallet-macos-x64.tar.gz"],["Linux x64","solana-agent-wallet-linux-x64.tar.gz"],["Windows x64","solana-agent-wallet-windows-x64.zip"]],ns=[["macOS Apple Silicon","agentic-desktop-macos-arm64.dmg"],["macOS Intel","agentic-desktop-macos-x64.dmg"],["Windows x64","agentic-desktop-windows-x64.msi"],["Linux x64","agentic-desktop-linux-x64.AppImage"]],rs=[["Android APK","agentic-android.apk"],["Android App Bundle","agentic-android.aab"]],is=new URL("/assets/saturn-source-cutout-wQ5itUw-.png",import.meta.url).href,Bn={backpack:new URL("data:image/svg+xml,%3csvg%20width='138'%20height='201'%20viewBox='0%200%20138%20201'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M122.825%20145.385C129.915%20145.385%20133.46%20145.385%20135.662%20147.587C137.865%20149.79%20137.865%20153.335%20137.865%20160.425V170.451C137.865%20184.631%20137.865%20191.721%20133.46%20196.126C129.055%20200.531%20121.965%20200.531%20107.785%20200.531H30.0796C15.9%20200.531%208.81%20200.531%204.40497%20196.126C-0.0000869549%20191.721%200%20184.631%200%20170.451V160.425C0%20153.335%20-0.0000439257%20149.79%202.20249%20147.587C4.40501%20145.385%207.94998%20145.385%2015.0398%20145.385H122.825Z'%20fill='%23E33E3F'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M68.9332%2029.4531C138.869%2029.4531%20137.866%2076.0758%20137.866%2098.3856V123.452C137.866%20127.605%20134.499%20130.972%20130.346%20130.972H7.52068C3.36755%20130.972%200.000780484%20127.605%200.000780454%20123.452V98.3856C0.000780676%2076.0758%20-1.0025%2029.4531%2068.9332%2029.4531ZM68.9332%2047.2186C57.166%2047.2186%2047.6268%2056.7578%2047.6268%2068.5253C47.627%2080.292%2057.1661%2089.8317%2068.9332%2089.8317C80.7006%2089.8317%2090.2396%2080.292%2090.2396%2068.5253C90.2396%2056.7578%2080.7006%2047.2186%2068.9332%2047.2186Z'%20fill='%23E33E3F'/%3e%3cpath%20d='M68.9133%200.550781C84.0038%200.550781%2097.2138%205.82527%20100.707%2014.415C101.234%2015.897%20101.496%2016.6382%20101.029%2017.1884C100.561%2017.7387%2099.6559%2017.5747%2097.8454%2017.2466C93.1668%2016.3986%2086.543%2015.8155%2080.7113%2015.6432C76.9903%2015.4433%2073.0649%2015.3397%2068.9346%2015.3397C64.8061%2015.3397%2060.8825%2015.4435%2057.1633%2015.6432C51.3037%2015.8154%2044.6563%2016.3984%2039.9608%2017.2178C38.1889%2017.527%2037.3027%2017.6814%2036.8385%2017.1327C36.3743%2016.584%2036.6309%2015.8564%2037.1445%2014.4015C40.6099%205.83887%2053.8272%200.550828%2068.9133%200.550781Z'%20fill='%23E33E3F'/%3e%3c/svg%3e",import.meta.url).href,claude:new URL("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%20class='w-full'%20fill='hsl(14.8,%2063.1%25,%2059.6%25)'%3e%3cpath%20d='m19.6%2066.5%2019.7-11%20.3-1-.3-.5h-1l-3.3-.2-11.2-.3L14%2053l-9.5-.5-2.4-.5L0%2049l.2-1.5%202-1.3%202.9.2%206.3.5%209.5.6%206.9.4L38%2049.1h1.6l.2-.7-.5-.4-.4-.4L29%2041l-10.6-7-5.6-4.1-3-2-1.5-2-.6-4.2%202.7-3%203.7.3.9.2%203.7%202.9%208%206.1L37%2036l1.5%201.2.6-.4.1-.3-.7-1.1L33%2025l-6-10.4-2.7-4.3-.7-2.6c-.3-1-.4-2-.4-3l3-4.2L28%200l4.2.6L33.8%202l2.6%206%204.1%209.3L47%2029.9l2%203.8%201%203.4.3%201h.7v-.5l.5-7.2%201-8.7%201-11.2.3-3.2%201.6-3.8%203-2L61%202.6l2%202.9-.3%201.8-1.1%207.7L59%2027.1l-1.5%208.2h.9l1-1.1%204.1-5.4%206.9-8.6%203-3.5L77%2013l2.3-1.8h4.3l3.1%204.7-1.4%204.9-4.4%205.6-3.7%204.7-5.3%207.1-3.2%205.7.3.4h.7l12-2.6%206.4-1.1%207.6-1.3%203.5%201.6.4%201.6-1.4%203.4-8.2%202-9.6%202-14.3%203.3-.2.1.2.3%206.4.6%202.8.2h6.8l12.6%201%203.3%202%201.9%202.7-.3%202-5.1%202.6-6.8-1.6-16-3.8-5.4-1.3h-.8v.4l4.6%204.5%208.3%207.5L89%2080.1l.5%202.4-1.3%202-1.4-.2-9.2-7-3.6-3-8-6.8h-.5v.7l1.8%202.7%209.8%2014.7.5%204.5-.7%201.4-2.6%201-2.7-.6-5.8-8-6-9-4.7-8.2-.5.4-2.9%2030.2-1.3%201.5-3%201.2-2.5-2-1.4-3%201.4-6.2%201.6-8%201.3-6.4%201.2-7.9.7-2.6v-.2H49L43%2072l-9%2012.3-7.2%207.6-1.7.7-3-1.5.3-2.8L24%2086l10-12.8%206-7.9%204-4.6-.1-.5h-.3L17.2%2077.4l-4.7.6-2-2%20.2-3%201-1%208-5.5Z'%3e%3c/path%3e%3c/svg%3e",import.meta.url).href,codex:new URL("/assets/codex-B1ZwolvK.svg",import.meta.url).href,jupiter:new URL("data:image/svg+xml,%3csvg%20width='256'%20height='256'%20viewBox='0%200%20256%20256'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M26.1464%20199.614C36.7084%20214.305%2050.2565%20226.598%2065.9023%20235.686C81.5482%20244.774%2098.9383%20250.452%20116.932%20252.348C107.675%20238.417%2094.218%20225.6%2077.4183%20215.842C60.6186%20206.084%2042.8275%20200.754%2026.1464%20199.614Z'%20fill='url(%23paint0_linear_13278_146915)'/%3e%3cpath%20d='M99.9925%20176.988C67.6261%20158.185%2032.5947%20153.393%207.52861%20161.858C9.94843%20169.856%2013.1398%20177.599%2017.0576%20184.979C38.8358%20184.475%2062.6138%20190.39%2084.7394%20203.241C106.865%20216.092%20123.787%20233.828%20134.143%20253C142.499%20252.743%20150.811%20251.679%20158.963%20249.822C153.896%20223.858%20132.35%20195.796%2099.9925%20176.988Z'%20fill='url(%23paint1_linear_13278_146915)'/%3e%3cpath%20d='M254.229%20100.663C250.113%2083.925%20242.668%2068.1877%20232.336%2054.3909C222.004%2040.5942%20208.997%2029.0209%20194.093%2020.3621C179.189%2011.7034%20162.693%206.13675%20145.59%203.99461C128.487%201.85247%20111.128%203.17875%2094.5489%207.89426C122.246%2011.2839%20152.99%2021.6814%20183.14%2039.1972C213.291%2056.7129%20237.573%2078.2665%20254.229%20100.663Z'%20fill='url(%23paint2_linear_13278_146915)'/%3e%3cpath%20d='M213.93%20162.049C199.753%20138.505%20175.467%20115.959%20145.55%2098.5793C115.632%2081.1992%2084.0242%2071.2719%2056.5727%2070.6152C32.4219%2070.0432%2014.296%2077.0639%206.85584%2089.8723C6.81347%2089.9486%206.75415%2090.0206%206.70754%2090.0969C6.0381%2092.4992%205.46187%2094.9058%204.93648%2097.3209C15.3256%2093.2195%2027.3629%2090.9358%2040.7476%2090.6816C70.5124%2090.1223%20103.824%2099.6428%20134.563%20117.502C165.302%20135.361%20190.093%20159.592%20204.346%20185.717C210.736%20197.488%20214.723%20209.076%20216.303%20220.147C218.142%20218.503%20219.947%20216.804%20221.697%20215.037C221.743%20214.957%20221.773%20214.872%20221.82%20214.787C229.26%20201.966%20226.383%20182.747%20213.93%20162.049Z'%20fill='url(%23paint3_linear_13278_146915)'/%3e%3cpath%20d='M122.788%20137.754C76.9736%20111.137%2026.3458%20106.968%202%20125.543C2.04782%20131.357%202.49231%20137.161%203.3304%20142.915C10.4921%20140.744%2017.8732%20139.377%2025.3373%20138.839C52.5431%20136.792%2082.5368%20144.372%20109.755%20160.193C136.974%20176.014%20158.43%20198.326%20170.132%20222.956C173.367%20229.703%20175.834%20236.792%20177.488%20244.09C182.902%20241.967%20188.167%20239.48%20193.245%20236.646C197.321%20206.292%20168.616%20164.375%20122.788%20137.754Z'%20fill='url(%23paint4_linear_13278_146915)'/%3e%3cpath%20d='M237.496%20122.641C223.158%2099.1218%20198.659%2076.5132%20168.53%2059.0187C138.401%2041.5241%20106.67%2031.4401%2079.1295%2030.6308C58.1352%2030.0249%2041.8736%2035.1135%2033.4419%2044.7273C68.4522%2038.7955%20114.631%2048.7651%20159.391%2074.7676C204.15%20100.77%20235.699%20135.954%20247.876%20169.303C252.05%20157.224%20248.419%20140.577%20237.496%20122.641Z'%20fill='url(%23paint5_linear_13278_146915)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_13278_146915'%20x1='169.969'%20y1='53.7813'%20x2='54.0834'%20y2='253'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0.0001'%20stop-color='%23A4D756'/%3e%3cstop%20offset='1'%20stop-color='%2300B6E7'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_13278_146915'%20x1='169.969'%20y1='53.7813'%20x2='54.0834'%20y2='253'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0.0001'%20stop-color='%23A4D756'/%3e%3cstop%20offset='1'%20stop-color='%2300B6E7'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_13278_146915'%20x1='169.969'%20y1='53.7813'%20x2='54.0834'%20y2='253'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0.0001'%20stop-color='%23A4D756'/%3e%3cstop%20offset='1'%20stop-color='%2300B6E7'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_13278_146915'%20x1='169.969'%20y1='53.7813'%20x2='54.0834'%20y2='253'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0.0001'%20stop-color='%23A4D756'/%3e%3cstop%20offset='1'%20stop-color='%2300B6E7'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_13278_146915'%20x1='169.969'%20y1='53.7813'%20x2='54.0834'%20y2='253'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0.0001'%20stop-color='%23A4D756'/%3e%3cstop%20offset='1'%20stop-color='%2300B6E7'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_13278_146915'%20x1='169.969'%20y1='53.7813'%20x2='54.0834'%20y2='253'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0.0001'%20stop-color='%23A4D756'/%3e%3cstop%20offset='1'%20stop-color='%2300B6E7'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",import.meta.url).href,phantom:new URL("data:image/svg+xml,%3csvg%20width='1200'%20height='1200'%20viewBox='0%200%201200%201200'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2596_138588)'%3e%3crect%20width='1200'%20height='1200'%20rx='257.592'%20fill='%23AB9FF2'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M517.219%20779.814C470.102%20852.012%20391.148%20943.378%20286.09%20943.378C236.426%20943.378%20188.672%20922.933%20188.672%20834.122C188.672%20607.943%20497.48%20257.813%20784.004%20257.813C947.004%20257.813%201011.95%20370.902%201011.95%20499.326C1011.95%20664.168%20904.98%20852.651%20798.648%20852.651C764.902%20852.651%20748.347%20834.122%20748.347%20804.732C748.347%20797.065%20749.621%20788.759%20752.168%20779.814C715.875%20841.789%20645.836%20899.292%20580.254%20899.292C532.5%20899.292%20508.305%20869.263%20508.305%20827.094C508.305%20811.76%20511.488%20795.787%20517.219%20779.814ZM904.363%20494.869C904.363%20532.291%20882.284%20551.002%20857.586%20551.002C832.514%20551.002%20810.809%20532.291%20810.809%20494.869C810.809%20457.448%20832.514%20438.737%20857.586%20438.737C882.284%20438.737%20904.363%20457.448%20904.363%20494.869ZM764.031%20494.871C764.031%20532.293%20741.952%20551.004%20717.254%20551.004C692.182%20551.004%20670.477%20532.293%20670.477%20494.871C670.477%20457.449%20692.182%20438.739%20717.254%20438.739C741.952%20438.739%20764.031%20457.449%20764.031%20494.871Z'%20fill='%23FFFDF8'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2596_138588'%3e%3crect%20width='1200'%20height='1200'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",import.meta.url).href,solana:new URL("data:image/svg+xml,%3csvg%20width='398'%20height='312'%20viewBox='0%200%20398%20312'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cdefs%3e%3clinearGradient%20id='solana-gradient'%20x1='360'%20y1='40'%20x2='40'%20y2='280'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2300FFA3'/%3e%3cstop%20offset='1'%20stop-color='%23DC1FFF'/%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20fill='url(%23solana-gradient)'%20d='M64.6%20237.9c2.4-2.4%205.7-3.8%209.2-3.8h317.4c5.8%200%208.7%207%204.6%2011.1l-62.7%2062.7c-2.4%202.4-5.7%203.8-9.2%203.8H6.5c-5.8%200-8.7-7-4.6-11.1l62.7-62.7Z'/%3e%3cpath%20fill='url(%23solana-gradient)'%20d='M64.6%203.8C67.1%201.4%2070.4%200%2073.8%200h317.4c5.8%200%208.7%207%204.6%2011.1l-62.7%2062.7c-2.4%202.4-5.7%203.8-9.2%203.8H6.5c-5.8%200-8.7-7-4.6-11.1L64.6%203.8Z'/%3e%3cpath%20fill='url(%23solana-gradient)'%20d='M333.1%20120.1c-2.4-2.4-5.7-3.8-9.2-3.8H6.5c-5.8%200-8.7%207-4.6%2011.1l62.7%2062.7c2.4%202.4%205.7%203.8%209.2%203.8h317.4c5.8%200%208.7-7%204.6-11.1l-62.7-62.7Z'/%3e%3c/svg%3e",import.meta.url).href,solanaMobile:new URL("data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cdefs%3e%3clinearGradient%20id='solana-mobile-gradient'%20x1='49'%20y1='17'%20x2='15'%20y2='48'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2300FFA3'/%3e%3cstop%20offset='1'%20stop-color='%23DC1FFF'/%3e%3c/linearGradient%3e%3c/defs%3e%3crect%20x='13'%20y='4'%20width='38'%20height='56'%20rx='10'%20fill='%2310282C'%20stroke='%2361AFBD'%20stroke-width='3'/%3e%3crect%20x='26'%20y='9'%20width='12'%20height='2.5'%20rx='1.25'%20fill='%23CFE6E4'/%3e%3cg%20transform='translate(18%2022)%20scale(0.071)'%3e%3cpath%20fill='url(%23solana-mobile-gradient)'%20d='M64.6%20237.9c2.4-2.4%205.7-3.8%209.2-3.8h317.4c5.8%200%208.7%207%204.6%2011.1l-62.7%2062.7c-2.4%202.4-5.7%203.8-9.2%203.8H6.5c-5.8%200-8.7-7-4.6-11.1l62.7-62.7Z'/%3e%3cpath%20fill='url(%23solana-mobile-gradient)'%20d='M64.6%203.8C67.1%201.4%2070.4%200%2073.8%200h317.4c5.8%200%208.7%207%204.6%2011.1l-62.7%2062.7c-2.4%202.4-5.7%203.8-9.2%203.8H6.5c-5.8%200-8.7-7-4.6-11.1L64.6%203.8Z'/%3e%3cpath%20fill='url(%23solana-mobile-gradient)'%20d='M333.1%20120.1c-2.4-2.4-5.7-3.8-9.2-3.8H6.5c-5.8%200-8.7%207-4.6%2011.1l62.7%2062.7c2.4%202.4%205.7%203.8%209.2%203.8h317.4c5.8%200%208.7-7%204.6-11.1l-62.7-62.7Z'/%3e%3c/g%3e%3c/svg%3e",import.meta.url).href,solflare:new URL("data:image/svg+xml,%3csvg%20width='290'%20height='290'%20viewBox='0%200%20290%20290'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_146_299)'%3e%3cpath%20d='M63.2951%201H226.705C261.11%201%20289%2028.8905%20289%2063.2951V226.705C289%20261.11%20261.11%20289%20226.705%20289H63.2951C28.8905%20289%201%20261.11%201%20226.705V63.2951C1%2028.8905%2028.8905%201%2063.2951%201Z'%20fill='%23FFEF46'%20stroke='%23EEDA0F'%20stroke-width='2'/%3e%3cpath%20d='M140.548%20153.231L154.832%20139.432L181.462%20148.147C198.893%20153.958%20207.609%20164.61%20207.609%20179.62C207.609%20190.999%20203.251%20198.504%20194.536%20208.188L191.873%20211.093L192.841%20204.314C196.714%20179.62%20189.452%20168.968%20165.484%20161.22L140.548%20153.231ZM104.717%2068.739L177.347%2092.9488L161.61%20107.959L123.843%2095.3698C110.77%2091.012%20106.412%2083.9911%20104.717%2069.2232V68.739ZM100.359%20191.725L116.822%20175.988L147.811%20186.157C164.031%20191.483%20169.599%20198.504%20167.905%20216.177L100.359%20191.725ZM79.539%20121.516C79.539%20116.917%2081.9599%20112.559%2086.0756%20108.927C90.4334%20115.222%2097.9384%20120.79%20109.801%20124.664L135.464%20133.137L121.18%20146.937L96.0016%20138.705C84.3809%20134.832%2079.539%20129.021%2079.539%20121.516ZM155.558%20248.618C208.819%20213.272%20237.387%20189.304%20237.387%20159.768C237.387%20140.158%20225.766%20129.263%20200.104%20120.79L180.736%20114.253L233.756%2063.4128L223.103%2052.0342L207.367%2065.8337L133.043%2041.3818C110.043%2048.8869%2080.9916%2070.9178%2080.9916%2092.9487C80.9916%2095.3697%2081.2337%2097.7907%2081.96%20100.454C62.8342%20111.348%2055.0871%20121.516%2055.0871%20134.105C55.0871%20145.968%2061.3816%20157.831%2081.4758%20164.368L97.4542%20169.694L42.2559%20222.713L52.9082%20234.092L70.0972%20218.356L155.558%20248.618Z'%20fill='%2302050A'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_146_299'%3e%3crect%20width='290'%20height='290'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",import.meta.url).href,vercel:new URL("data:image/svg+xml,%3csvg%20width='1155'%20height='1000'%20viewBox='0%200%201155%201000'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M577.344%200L1154.69%201000H0L577.344%200Z'%20fill='white'/%3e%3c/svg%3e",import.meta.url).href},os=[{id:"phantom",name:"Phantom",detail:"Encrypted iOS deeplink",transport:"encrypted-deeplink",appStoreUrl:"https://apps.apple.com/app/phantom-crypto-wallet/id1598432977"},{id:"solflare",name:"Solflare",detail:"Encrypted iOS deeplink",transport:"encrypted-deeplink",appStoreUrl:"https://apps.apple.com/app/solflare/id1580902717"},{id:"backpack",name:"Backpack",detail:"Encrypted iOS deeplink",transport:"encrypted-deeplink",appStoreUrl:"https://apps.apple.com/app/backpack-crypto-wallet/id6445964121"},{id:"jupiter",name:"Jupiter",detail:"WalletConnect path",transport:"walletconnect",appStoreUrl:"https://apps.apple.com/app/jupiter-mobile/id6474343098"}];function Jr(){return{isNative:!1,platform:"web",isIos:!1,isIosNative:!1,callbackScheme:"agenticwallet"}}function Zr(){return os}async function ss(){return{count:0}}async function Qr(e){return null}const Xr=class{constructor(){throw new Error("iOS native wallet backend is not available in the web build yet.")}},qe=[{id:"flight",title:"1. Flight Recorder",kind:"agent_flight_recorder",defaultInput:"Swap 0.05 SOL to USDC only if simulation shows no new authority grants and the route stays within 50 bps slippage.",description:"Bind the agent's stated intent, plan, tool trace, and risk interpretation to the wallet signature."},{id:"auction",title:"2. Intent Auctions",kind:"signed_intent_auction",defaultInput:"Ask three quote agents for the best SOL to USDC route and select only offers matching my caps.",description:"Sign demand once, then let competing agents attach auditable offers without gaining custody."},{id:"cosigner",title:"3. Risk Co-Signers",kind:"risk_cosigner_market",defaultInput:"Review this swap request for unknown programs, authority deltas, route drift, and hidden approvals.",description:"Collect multiple agent reviews before the wallet opens for the final settlement signature."},{id:"rejection",title:"4. Rejection Intelligence",kind:"rejection_fingerprint",defaultInput:"Reject any request that mentions unlimited approvals, private keys, or unknown custody delegation.",description:"Turn a rejection into a reusable local safety fingerprint."},{id:"semantic",title:"5. Semantic Firewall",kind:"semantic_firewall",defaultInput:"Allow SOL to USDC swap semantics only when touched programs and authority changes match the explanation.",description:"Compare what the agent says with what the eventual transaction does."},{id:"nonaction",title:"6. Proof of Non-Action",kind:"signed_non_action",defaultInput:"Do nothing unless SOL drops below the signed threshold and liquidity remains above the floor.",description:"Prove the agent checked conditions and intentionally avoided a wallet action."},{id:"reputation",title:"7. Agent Reputation",kind:"agent_reputation",defaultInput:"Score the agent based on signed successes, rejections, warnings, and restraint proofs.",description:"Make behavior portable across apps through wallet-signed outcome records."},{id:"blinks",title:"8. Agent-Reviewed Links",kind:"agent_reviewed_blink",defaultInput:"Review this Blink claim, summarize cost and authority deltas, and attach the signed interpretation.",description:"Carry agent interpretation beside a Solana Action before wallet settlement."},{id:"capsule",title:"9. Intent Time Capsules",kind:"intent_time_capsule",defaultInput:"Seal an intent that can open later only if price, route, deadline, and slippage all match.",description:"Sign future permission without allowing arbitrary future execution."},{id:"delegation",title:"10. Sub-Agent Delegation",kind:"sub_agent_delegation",defaultInput:"Delegate quote, risk, tax tag, and final explanation slices to specialist agents.",description:"Let agents hire specialists while every responsibility slice remains signed and auditable."},{id:"outcome",title:"11. Outcome Signatures",kind:"outcome_signature",defaultInput:"Authorize only the acceptable end state: minimum USDC output, no authority grants, and capped fees.",description:"Give agents path freedom while the wallet signs the acceptable result envelope."},{id:"insurance",title:"12. Request Insurance",kind:"request_insurance",defaultInput:"Quote coverage for route mismatch, simulation divergence, and known exploit classes.",description:"Show deterministic risk-transfer terms beside the signing request."},{id:"constitution",title:"13. Personal Constitution",kind:"personal_constitution",defaultInput:"My wallet never signs unlimited approvals, mainnet-first tests, or swaps above 100 bps slippage.",description:"Diff each request against a portable wallet-signed personal policy."},{id:"receipts",title:"14. Tool Receipts",kind:"tool_receipts",defaultInput:"Attach hashes for portfolio read, quote, simulation, policy diff, and final explanation tools.",description:"Prove which tools and data the agent actually used before requesting approval."},{id:"apprentice",title:"15. Apprenticeship Mode",kind:"apprenticeship_mode",defaultInput:"Run five training scenarios and score the agent before granting live signing authority.",description:"Require signed predictions and scorecards before an agent graduates to production signing."}],Et=Gd(),ls=ye?Et.cluster??"mainnet-beta":"mainnet-beta",ur=ga("custom-request"),ei="agent",cs=Td(Et),a={activeTab:ei,artifactView:"create",selectedRuntimePath:"exec",recentCopyId:"",inboxFilter:"all",wallets:[],selectedWalletName:Et.selectedWalletName??"",androidNativeEnvironment:_r(),androidAuthCacheCount:0,androidNativeStatus:"Android native MWA idle.",iosNativeEnvironment:Jr(),iosWallets:Zr(),selectedIosWalletId:Et.selectedIosWalletId??"phantom",iosAuthCacheCount:0,iosNativeStatus:"iOS native wallet idle.",address:"",signature:"",txSignature:"",txid:"",customTransactionBase64:"",transactionStatus:"",agentPrompt:Yo,selectedTemplateId:ur.id,templateFields:Fa(ur),agentPlan:null,agentSignature:"",agentPreparedActionId:"",generatedPlans:[],selectedGeneratedPlanId:"",showArchivedGeneratedPlans:!1,aiSettings:{...cs,apiKey:""},aiSettingsPanelOpen:null,aiStatus:null,toasts:[],capabilities:null,error:"",busy:!1,activeOperation:null,cluster:ls,bridgeUrl:Et.bridgeUrl??Fo,bridgeToken:Et.bridgeToken??Go,bridgeActive:!1,bridgeStatus:"Bridge idle.",bridgeRpcUrl:"",health:null,balances:null,preparedActions:[],materializedActions:[],recurringPayments:[],receipts:[],recurringDraft:Ad(),mwaEnvironment:so(),mwaRegistration:null,activeLab:qe[0].id,labInputs:Sd(),labArtifacts:Yi(),labArchiveStatus:"Browser archive loading.",steps:{discover:"idle",connect:"idle",sign:"idle",transaction:"idle",bridge:"idle",inbox:"idle",lab:"idle",ai:"idle"}};let we=null,Pe=null,pr=1,Ma=null,hn=!1,fr=0,Ia=null,_t=null;const Ba=document.querySelector("#app");ds();async function ds(){try{if(!Ba)throw new Error("Missing #app");gs(),us(),ee(),window.addEventListener("popstate",()=>ee()),await fs()}catch(e){ps(e)}}function us(){var e,t;try{const r=Yd();a.generatedPlans=r,a.selectedGeneratedPlanId=((e=r.find(l=>l.status!=="archived"))==null?void 0:e.id)??((t=r[0])==null?void 0:t.id)??""}catch(r){a.generatedPlans=[],a.selectedGeneratedPlanId="",console.warn("Generated plan storage could not be loaded.",r)}}function ps(e){const t=e instanceof Error?e.message:String(e),r=d(t||"Unknown startup error."),l=Ba??document.body;l.innerHTML=`
|
|
3
|
+
<section data-agentic-startup-failure style="
|
|
4
|
+
min-height: 100vh;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
display: grid;
|
|
7
|
+
place-items: center;
|
|
8
|
+
padding: 24px;
|
|
9
|
+
background: #020504;
|
|
10
|
+
color: #eef8f2;
|
|
11
|
+
font-family: Space Grotesk, Inter, system-ui, sans-serif;
|
|
12
|
+
">
|
|
13
|
+
<div style="
|
|
14
|
+
max-width: 620px;
|
|
15
|
+
border: 1px solid rgba(94, 231, 158, 0.35);
|
|
16
|
+
border-radius: 12px;
|
|
17
|
+
background: rgba(9, 18, 15, 0.94);
|
|
18
|
+
box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
|
|
19
|
+
padding: 22px;
|
|
20
|
+
">
|
|
21
|
+
<p style="
|
|
22
|
+
margin: 0 0 8px;
|
|
23
|
+
color: #8bcdaa;
|
|
24
|
+
font-size: 0.75rem;
|
|
25
|
+
font-weight: 900;
|
|
26
|
+
letter-spacing: 0.08em;
|
|
27
|
+
text-transform: uppercase;
|
|
28
|
+
">Agentic startup failed</p>
|
|
29
|
+
<h1 style="margin: 0 0 10px; font-size: 1.35rem; line-height: 1.2;">Refresh loaded the shell, but the app could not start.</h1>
|
|
30
|
+
<p style="margin: 0; color: rgba(218, 229, 224, 0.84); line-height: 1.5;">${r}</p>
|
|
31
|
+
</div>
|
|
32
|
+
</section>
|
|
33
|
+
`,console.error("Agentic startup failed.",e)}async function fs(){a.mwaRegistration=await lo({appIdentity:{name:"Agentic",uri:window.location.origin},chains:["solana:devnet","solana:mainnet-beta"],logLevel:"info"}),a.mwaEnvironment=a.mwaRegistration.environment,a.androidNativeEnvironment=_r(),a.androidNativeEnvironment.isAndroidNative&&a.cluster==="localnet"&&(a.cluster="devnet",me()),await ma(),a.androidNativeEnvironment.isAndroidNative&&await Bc(),a.iosNativeEnvironment=Jr(),await Ut(),a.iosNativeEnvironment.isIosNative&&await Uc(),await Hi(),await xi(!1),a.aiSettings.mode==="bridge"&&await Ja(!1),ee()}function ee(){if(!Ba)return;const e=hs();ys(e),Tn(),Ba.innerHTML=bs(vs(e),e),ql()}function gs(){const e=Xo.get(window.location.hash);if(e){window.history.replaceState({},"",e);return}const t=Ga(window.location.pathname);if(t==="/browser"){window.history.replaceState({},"","/app");return}if(t==="/dos"){window.history.replaceState({},"","/docs");return}Un(t)&&window.location.pathname!==t&&window.history.replaceState({},"",t)}function hs(){const e=Ga(window.location.pathname);return Un(e)?e:null}function ms(e){Ga(window.location.pathname)!==e&&window.history.pushState({},"",e),ee(),window.scrollTo({top:0,behavior:"auto"})}function Ga(e){return e==="/"?"/":e.replace(/\/+$/,"")||"/"}function Un(e){return Qo.has(e)}function bs(e,t){const r=t?`route-${t==="/"?"home":t.slice(1).replace(/[^a-z0-9-]/g,"-")}`:"route-unknown",l=a.iosNativeEnvironment.isIosNative?"ios-native-shell":a.androidNativeEnvironment.bridgeAvailable?"android-shell":"";return`
|
|
34
|
+
<section class="shell homepage-shell ${r} ${l}">
|
|
35
|
+
${Ud()}
|
|
36
|
+
${Ls(t)}
|
|
37
|
+
${e}
|
|
38
|
+
${Ks()}
|
|
39
|
+
</section>
|
|
40
|
+
`}function vs(e){switch(e){case"/":return ws();case"/docs":return xs();case"/app":return As();case"/cli":return Ss();case"/desktop":return $s();case"/android":return ks();case"/demo":return Ps();case"/mwa-test":return Rn?zs():gr();case"/privacy":return Cs();case"/terms":return Ts();default:return gr()}}function ys(e){document.title=ts[e??""]??"Agentic | Solana Agent Wallet Adapter"}function ws(){return`
|
|
41
|
+
${Es()}
|
|
42
|
+
${ti()}
|
|
43
|
+
${ai()}
|
|
44
|
+
${Ys()}
|
|
45
|
+
`}function xs(){return`
|
|
46
|
+
${Ws()}
|
|
47
|
+
${ti()}
|
|
48
|
+
${ai()}
|
|
49
|
+
`}function As(){return ni("app")}function Ss(){return`
|
|
50
|
+
${js()}
|
|
51
|
+
${Vs()}
|
|
52
|
+
`}function $s(){return Fs()}function ks(){return Gs()}function Ps(){return`
|
|
53
|
+
${Hs()}
|
|
54
|
+
${ni("demo")}
|
|
55
|
+
`}function gr(){return`
|
|
56
|
+
<section class="docs-section page-not-found" aria-labelledby="not-found-title">
|
|
57
|
+
<div class="section-heading">
|
|
58
|
+
<p class="eyebrow mini">Not found</p>
|
|
59
|
+
<h2 id="not-found-title">This Agentic page does not exist.</h2>
|
|
60
|
+
<p>Use the navigation bar to open docs, install paths, the guided demo, or the hosted app.</p>
|
|
61
|
+
</div>
|
|
62
|
+
</section>
|
|
63
|
+
`}function Cs(){return`
|
|
64
|
+
<section class="docs-section legal-page" aria-labelledby="privacy-title">
|
|
65
|
+
<div class="section-heading">
|
|
66
|
+
<p class="eyebrow mini">Legal</p>
|
|
67
|
+
<h2 id="privacy-title">Privacy Policy</h2>
|
|
68
|
+
<p class="legal-meta">Last updated: 2026-05-07</p>
|
|
69
|
+
</div>
|
|
70
|
+
<article class="legal-prose">
|
|
71
|
+
<p>SolPulse LLC ("SolPulse," "we," "our," or "us") values your privacy and is committed to protecting your information. This Privacy Policy describes how we collect, use, store, and disclose information when you access or use the Agentic websites, command-line interface, desktop app, browser app, mobile clients, runtime bridge, APIs, or related services (collectively, the "Platform" or "Agentic"). Agentic is a non-custodial wallet authority adapter — we do not take possession of your assets or private keys. You remain in full control of your wallets and signatures at all times, but certain data you provide or that we collect may still constitute personal data under applicable privacy laws.</p>
|
|
72
|
+
<p>By accessing or using Agentic, you acknowledge that you have read, understood, and agree to this Privacy Policy. If you disagree with any portion of this Policy, please discontinue use of the Platform.</p>
|
|
73
|
+
|
|
74
|
+
<h3>Quick Summary</h3>
|
|
75
|
+
<ul>
|
|
76
|
+
<li><strong>No private keys:</strong> Agentic does not ask for, collect, store, transmit, recover, or custody seed phrases, private keys, or wallet recovery credentials.</li>
|
|
77
|
+
<li><strong>No hosted account required:</strong> the current public app does not require an Agentic account.</li>
|
|
78
|
+
<li><strong>Local-first runtime:</strong> CLI, desktop, bridge settings, approval queues, bridge tokens, Android MWA authorization cache, and app logs are designed to stay on your device unless you choose to send information to us for support or connect them to third-party services.</li>
|
|
79
|
+
<li><strong>Android permissions:</strong> the Android app currently requests Internet access and foreground data-sync service permissions for wallet approval and bridge polling. It does not request camera, microphone, contacts, SMS, phone, precise location, health, calendar, or file-system permissions.</li>
|
|
80
|
+
<li><strong>No ad sale:</strong> we do not sell personal information and do not share it for cross-context behavioral advertising.</li>
|
|
81
|
+
<li><strong>Public blockchain:</strong> wallet addresses, transaction IDs, signatures, balances, token activity, timing, and other on-chain data may be public, permanent, and outside our control.</li>
|
|
82
|
+
</ul>
|
|
83
|
+
|
|
84
|
+
<h3>1. Information We Collect</h3>
|
|
85
|
+
<p><strong>A. Information You Provide</strong></p>
|
|
86
|
+
<ul>
|
|
87
|
+
<li>Contact details such as your email address (when you contact support)</li>
|
|
88
|
+
<li>Wallet information such as your Solana public key when you connect a wallet to a demo or web flow (which may be considered personal data when linked to other identifiers)</li>
|
|
89
|
+
<li>Any content you submit via forms, customer support, feedback surveys, community channels, or app-store review communications</li>
|
|
90
|
+
<li>AI planner prompts, templates, parameters, policy notes, and model settings you enter when you use the optional planner features</li>
|
|
91
|
+
<li>Session AI keys or bridge AI keys you choose to enter. Browser session keys are intended to be used for the current session only; bridge session keys are intended to stay in the local bridge process memory unless you configure otherwise. We do not ask you to send AI keys to SolPulse servers.</li>
|
|
92
|
+
</ul>
|
|
93
|
+
<p>We do not require know-your-customer (KYC) verification because the Platform is non-custodial and does not match, settle, or take the other side of any trade. However, regulations may change; we reserve the right to request additional information to comply with applicable laws or to prevent fraud, money laundering, or other illicit activity.</p>
|
|
94
|
+
<p><strong>B. Information We Collect Automatically</strong></p>
|
|
95
|
+
<ul>
|
|
96
|
+
<li>Technical data such as your IP address, browser type, device operating system, and user-agent information</li>
|
|
97
|
+
<li>Usage data such as access timestamps, referral URLs, pages visited, and actions taken on the public website</li>
|
|
98
|
+
<li>Wallet-connection events on the website (for example, when you connect, approve, or disconnect a wallet for a demo)</li>
|
|
99
|
+
<li>Approximate geolocation information inferred from your IP address, to comply with sanctions and jurisdictional restrictions</li>
|
|
100
|
+
<li>Android app technical data needed for Mobile Wallet Adapter operation, such as wallet package or URI availability checks, public wallet address, account label if supplied by the wallet, cluster, wallet capabilities, shortened signatures or transaction IDs in local logs, foreground service status, and bridge polling status</li>
|
|
101
|
+
<li>App diagnostics, errors, and security telemetry such as request IDs, timestamps, status codes, rejected wallet operations, and redacted log metadata</li>
|
|
102
|
+
</ul>
|
|
103
|
+
<p>The Agentic CLI, desktop runtime, Android MWA surface, and bridge run <strong>locally on your device</strong> and are not telemetered to SolPulse by default. Approval rails, prepared-action queues, Android authorization cache, signing flows, bridge tokens, and local logs execute or persist on your machine; we do not receive telemetry on transaction content unless you contact us with a support request that you elect to attach.</p>
|
|
104
|
+
<p><strong>C. Public Blockchain Data</strong></p>
|
|
105
|
+
<p>Transactions you broadcast to the Solana blockchain are publicly accessible and cannot be erased. We do not control or store on-chain data, but we may analyse publicly available blockchain information to detect suspicious activity, debug issues, or improve documentation.</p>
|
|
106
|
+
|
|
107
|
+
<h3>2. How We Use Your Information</h3>
|
|
108
|
+
<ul>
|
|
109
|
+
<li>To provide, operate, maintain, and improve the Platform and its tooling</li>
|
|
110
|
+
<li>To respond to support requests and feedback</li>
|
|
111
|
+
<li>To analyse usage patterns and improve performance and reliability of the public website</li>
|
|
112
|
+
<li>To enforce our Terms of Service, detect and prevent fraud, abuse, or other misuse</li>
|
|
113
|
+
<li>To communicate with you about updates, new features, or regulatory notices (with your consent where required)</li>
|
|
114
|
+
<li>To comply with applicable laws, regulations, and legal processes</li>
|
|
115
|
+
</ul>
|
|
116
|
+
<p>We do not sell your personal data. We may share it with service providers who help us operate the Platform under strict confidentiality obligations, and with regulators or law enforcement if required by law.</p>
|
|
117
|
+
|
|
118
|
+
<h3>3. Cookies, Local Storage & Analytics</h3>
|
|
119
|
+
<p>The Agentic website uses browser-based storage methods such as IndexedDB and localStorage to maintain app state, selected wallet name, selected cluster, bridge URL, bridge token, lab artifacts, UI preferences, and similar local workspace data. When a local bridge is connected, signed lab artifacts may also be mirrored to a local bridge archive file. The Android app may store Mobile Wallet Adapter authorization records in app-private storage so you can reconnect a previously approved wallet. You may clear browser storage, app storage, or local runtime files, but doing so may remove preferences, authorization cache, receipts, or local artifacts.</p>
|
|
120
|
+
<p>We may add Google Analytics 4 to the public marketing site or hosted app. If enabled, Google Analytics may collect or process usage events, page views, device/browser information, approximate location, and related identifiers according to Google's terms and settings. We will not use Google Analytics to sell personal information or for cross-context behavioral advertising, and we will update the Google Play Data Safety form before enabling analytics in the Android distribution.</p>
|
|
121
|
+
|
|
122
|
+
<h3>4. Data Storage & Security</h3>
|
|
123
|
+
<p>We implement reasonable technical and organizational measures designed to protect your personal information. Examples include encryption in transit via SSL/TLS, secure infrastructure, and access controls. Despite these measures, no method of transmission or storage is completely secure; you use the Platform at your own risk.</p>
|
|
124
|
+
<p>We retain your information only as long as necessary to provide the Platform, comply with our legal obligations, resolve disputes, and enforce our agreements. Where feasible, we minimize data and may anonymize or aggregate information to further protect your privacy. You remain responsible for securing your device, browser profile, wallet app, seed phrase, bridge token, AI provider key, and any third-party agent software you connect.</p>
|
|
125
|
+
|
|
126
|
+
<h3>5. Children's Privacy</h3>
|
|
127
|
+
<p>Agentic does not knowingly collect or store data from anyone under the age of 18. If you are a parent or guardian and believe your child has submitted information to us, contact us at support@solpulse.trade and we'll promptly delete it.</p>
|
|
128
|
+
|
|
129
|
+
<h3>6. Information Sharing</h3>
|
|
130
|
+
<p>We may share your data with service providers who support our infrastructure, analytics, or communications; legal authorities, if required by law or in connection with a legal investigation; and third-party tools, only when necessary and never for marketing resale purposes.</p>
|
|
131
|
+
|
|
132
|
+
<h3>7. International Data Transfers</h3>
|
|
133
|
+
<p>SolPulse LLC operates globally. Your information may be processed in countries outside of your jurisdiction of residence, which may have different data protection laws. Where required by law, we use appropriate safeguards, such as standard contractual clauses, to protect cross-border data transfers. By using the Platform, you consent to this processing and transfer of your information.</p>
|
|
134
|
+
|
|
135
|
+
<h3>8. Your Rights</h3>
|
|
136
|
+
<p>Depending on your jurisdiction, you may have the right to request access to your personal information, request deletion of your personal data, or opt out of email communications. To exercise these rights, email us at support@solpulse.trade. We will remove your personal data within 30 days of a verified request, except where retention is required by law (e.g., compliance logs).</p>
|
|
137
|
+
|
|
138
|
+
<h3>9. Updates to This Policy</h3>
|
|
139
|
+
<p>We may update this Privacy Policy from time to time. The most current version will always be available at https://agenticwalletadapter.com/privacy. Your continued use of Agentic after changes are posted signifies your acceptance of those changes.</p>
|
|
140
|
+
|
|
141
|
+
<h3>10. Contact Us</h3>
|
|
142
|
+
<p>If you have any questions or requests regarding this Privacy Policy, you can reach us at:</p>
|
|
143
|
+
<ul>
|
|
144
|
+
<li>📧 Email: support@solpulse.trade</li>
|
|
145
|
+
<li>📍 Location: SolPulse LLC, 1621 Central Ave, Cheyenne, WY 82001</li>
|
|
146
|
+
</ul>
|
|
147
|
+
|
|
148
|
+
<h3>11. Do Not Sell or Share Personal Information</h3>
|
|
149
|
+
<p>We do not sell your personal information and we do not share it for cross-context behavioral advertising. We disclose personal information only to service providers and processors under written agreements to operate the Platform, or where required by law.</p>
|
|
150
|
+
|
|
151
|
+
<h3>12. Legal Bases for Processing (where applicable)</h3>
|
|
152
|
+
<ul>
|
|
153
|
+
<li><strong>Contract:</strong> to provide and support the Platform you request.</li>
|
|
154
|
+
<li><strong>Legitimate Interests:</strong> to secure, improve, and support the Platform; prevent fraud and abuse; understand usage.</li>
|
|
155
|
+
<li><strong>Consent:</strong> for optional diagnostics, marketing communications, or non-essential cookies.</li>
|
|
156
|
+
<li><strong>Legal Obligation:</strong> to satisfy regulatory, tax, accounting, and law-enforcement requirements.</li>
|
|
157
|
+
</ul>
|
|
158
|
+
|
|
159
|
+
<h3>13. Data Retention & Deletion</h3>
|
|
160
|
+
<ul>
|
|
161
|
+
<li><strong>Public-website usage logs:</strong> approximately 30–90 days, extendable for security or abuse investigations.</li>
|
|
162
|
+
<li><strong>Support tickets & attachments:</strong> active ticket duration plus up to 24 months.</li>
|
|
163
|
+
<li><strong>Google Analytics 4 data, if enabled:</strong> retained according to the configured Google Analytics property retention settings and applicable Google controls.</li>
|
|
164
|
+
<li><strong>Local-device data (CLI, runtime, desktop bridge, Android MWA app, local logs, authorization cache, bridge tokens, session AI keys, and receipts):</strong> stays on your device under your control; we do not retain it unless you send it to us.</li>
|
|
165
|
+
<li><strong>Public blockchain data:</strong> may be permanent and cannot be deleted or modified by SolPulse.</li>
|
|
166
|
+
<li><strong>Legal, safety, and compliance records:</strong> retained as long as necessary to satisfy legal obligations, sanctions controls, fraud prevention, security, dispute resolution, or legal defense.</li>
|
|
167
|
+
</ul>
|
|
168
|
+
|
|
169
|
+
<h3>14. Third-Party Services & Processors</h3>
|
|
170
|
+
<p>We rely on third-party providers to operate the public-facing parts of the Platform. These providers act as processors or service providers under contracts that restrict their use of personal information to the services we request.</p>
|
|
171
|
+
<ul>
|
|
172
|
+
<li><strong>Wallet Standard wallets</strong> (Phantom, Solflare, Backpack, Glow, etc.) — chosen by you. When you connect a wallet, that wallet provider's privacy policy applies to wallet-side data, including key custody and recovery.</li>
|
|
173
|
+
<li><strong>Mobile Wallet Adapter wallets and Android platform services</strong> — chosen by you or provided by the Android/browser environment to route approvals, foreground data-sync behavior, and wallet handoffs.</li>
|
|
174
|
+
<li><strong>Solana RPC providers</strong> (e.g., Helius, public mainnet RPC, or configured RPC endpoints) — for on-chain reads, simulations, balance checks, and transaction submission initiated by you, your wallet, or your agent.</li>
|
|
175
|
+
<li><strong>Hosting (Render), Google Play, Chrome/Custom Tabs/TWA, and app-store services</strong> — to distribute or serve the public website and Android app surfaces.</li>
|
|
176
|
+
<li><strong>Optional AI clients and providers</strong> (Anthropic Claude, OpenAI/Codex, Vercel AI SDK, third-party MCP servers, or OpenAI-compatible providers you configure) — your chosen agent client, browser session key, local bridge, or hosted BYOK request calls them under its own terms and privacy policy. Hosted BYOK relays your API key to the selected provider for that request and does not store it.</li>
|
|
177
|
+
<li><strong>Google Analytics 4</strong> (if enabled) — aggregated usage measurement for product and reliability analysis, subject to Google Analytics configuration and applicable consent requirements.</li>
|
|
178
|
+
</ul>
|
|
179
|
+
|
|
180
|
+
<h3>15. Additional Rights by Jurisdiction</h3>
|
|
181
|
+
<p>Depending on where you live (e.g., EEA/UK, California), you may have additional rights, such as portability, restriction, objection to certain processing, and the right to appeal automated decisions. To exercise any rights beyond those listed above, contact us using the details in the "Contact Us" section.</p>
|
|
182
|
+
|
|
183
|
+
<h3>16. AML / CTF & Sanctions Processing</h3>
|
|
184
|
+
<p>Although Agentic is a non-custodial software interface and is not itself a regulated financial intermediary, we may collect and process limited identifiers, contact information, wallet addresses, approximate location signals, device or session identifiers, and screening results from compliance service providers to comply with anti-money-laundering (AML), counter-terrorist-financing (CTF), and sanctions requirements. Where required, we may request additional verification or documentation. Processing is based on our legal obligations and our legitimate interests in maintaining Platform integrity and compliance. We may disclose relevant information to competent authorities or service providers when legally required or to prevent fraud or abuse.</p>
|
|
185
|
+
|
|
186
|
+
<h3>17. Geographic Restrictions</h3>
|
|
187
|
+
<p>We may use IP address, coarse location, and related technical signals to determine feature availability and to restrict access from prohibited or high-risk jurisdictions for compliance and safety purposes. These signals are approximate and do not constitute precise geolocation. We may retain logs necessary to demonstrate compliance with sanctions and other legal requirements.</p>
|
|
188
|
+
|
|
189
|
+
<h3>18. Third-Party Data, Content & Links</h3>
|
|
190
|
+
<p>The Platform may display market data, token metadata, pricing, RPC results, or other content provided by third parties and may include links to external websites. We do not control third-party content and are not responsible for its accuracy or availability. Your interactions with third-party services are governed by their own terms and policies. Where technically necessary, we may transmit limited identifiers to such services to enable functionality.</p>
|
|
191
|
+
|
|
192
|
+
<h3>19. Security Telemetry & Malicious Code</h3>
|
|
193
|
+
<p>While we employ reasonable safeguards, we cannot guarantee that files or data available through the Platform are free from viruses, malware, or other harmful components, or that services will be immune to denial-of-service or similar attacks. To protect the Platform, we may collect security telemetry such as error codes, request metadata, and limited device signals for detection, prevention, and response. You remain responsible for appropriate device and account security measures.</p>
|
|
194
|
+
|
|
195
|
+
<h3>20. Tutorials, Documentation & Help Resources</h3>
|
|
196
|
+
<p>Tutorials, videos, FAQs, and helpdesk responses describe Platform functionality only and are not personalized advice, suitability assessments, or recommendations. We may process the content of your help requests and attachments to resolve issues and improve quality. Aggregated, de-identified analytics may be used to improve support resources.</p>
|
|
197
|
+
|
|
198
|
+
<h3>21. Google Play Data Safety & Financial Features</h3>
|
|
199
|
+
<p>If Agentic is distributed through Google Play, the Google Play Data Safety form and any Financial features declaration must be kept consistent with this Privacy Policy and the actual Android app behavior. Because Agentic involves cryptocurrency wallet actions, SolPulse may disclose financial-feature information to Google Play and may update app availability, disclosures, or functionality to satisfy store policy or applicable law.</p>
|
|
200
|
+
</article>
|
|
201
|
+
</section>
|
|
202
|
+
`}function Ts(){return`
|
|
203
|
+
<section class="docs-section legal-page" aria-labelledby="terms-title">
|
|
204
|
+
<div class="section-heading">
|
|
205
|
+
<p class="eyebrow mini">Legal</p>
|
|
206
|
+
<h2 id="terms-title">Terms of Service</h2>
|
|
207
|
+
<p class="legal-meta">Last updated: 2026-05-07</p>
|
|
208
|
+
</div>
|
|
209
|
+
<article class="legal-prose">
|
|
210
|
+
<p>These Terms of Service ("Terms") constitute a legally binding agreement between you ("you" or "User") and SolPulse LLC ("SolPulse," "we," "our," or "us"). These Terms govern your use of the Agentic websites, command-line interface, desktop app, browser app, mobile clients, runtime bridge, APIs, and other services provided by SolPulse (collectively, the "Platform" or "Agentic"). By accessing or using the Platform, you acknowledge that you have read, understood, and agree to be bound by these Terms. If you do not agree, you must not use the Platform.</p>
|
|
211
|
+
|
|
212
|
+
<h3>1. Eligibility</h3>
|
|
213
|
+
<p>You may use the Platform only if you are at least 18 years of age and have the legal capacity to enter into a binding contract. You are solely responsible for ensuring that your use of the Platform complies with all laws and regulations applicable to you. Access to the Platform may not be legal for certain persons or in certain countries. If use of the Platform is prohibited by law in your jurisdiction, you must not use it.</p>
|
|
214
|
+
|
|
215
|
+
<h3>2. Use of the Platform</h3>
|
|
216
|
+
<p>The Platform is provided for your personal and lawful use only. You agree that you will not:</p>
|
|
217
|
+
<ul>
|
|
218
|
+
<li>Use the Platform for any unlawful or fraudulent purpose, including activities that violate anti-money laundering or sanctions laws</li>
|
|
219
|
+
<li>Interfere with or disrupt the integrity or performance of the Platform, or attempt to circumvent any measures we use to prevent or restrict access</li>
|
|
220
|
+
<li>Transmit viruses, worms, or other malicious code</li>
|
|
221
|
+
<li>Use robots, scrapers, or other automated means not provided by us to access the public website in a manner that sends more requests to our servers than a human can reasonably produce in the same period</li>
|
|
222
|
+
<li>Use another User's account or session credentials without permission, or share your own</li>
|
|
223
|
+
</ul>
|
|
224
|
+
<p><strong>2a. License Grant.</strong> Subject to your continued compliance with these Terms, SolPulse grants you a limited, revocable, non-exclusive, non-transferable, non-sublicensable license to access and use the Platform for your personal, non-commercial activity. No other rights are granted. Any rights not expressly granted are reserved. You may not rent, lease, resell, sublicense, or commercially exploit the Platform, or any part of it, without our prior written consent.</p>
|
|
225
|
+
|
|
226
|
+
<h3>3. Web3 Access & Wallets</h3>
|
|
227
|
+
<p>Agentic is a <strong>non-custodial wallet authority adapter</strong>: we do not hold or control your cryptocurrency, your private keys, or your seed phrase. You connect your own Wallet Standard, Mobile Wallet Adapter, or other supported wallet (such as Phantom, Solflare, Backpack, or Glow), and you remain responsible for:</p>
|
|
228
|
+
<ul>
|
|
229
|
+
<li>Generating, maintaining, and safeguarding your own private keys, seed phrases, and wallet credentials</li>
|
|
230
|
+
<li>Reviewing every prepared transaction surfaced by the Platform — including transfers, approvals, swaps, and any agent-initiated action — before signing it</li>
|
|
231
|
+
<li>Configuring and revoking any caps, allowlists, recurring payments, or pre-approved categories you enable</li>
|
|
232
|
+
</ul>
|
|
233
|
+
<p>Because the Platform is non-custodial, <strong>losing access to your private keys will permanently prevent you from accessing your assets</strong>. We have no ability to reset, retrieve, or restore lost keys or funds.</p>
|
|
234
|
+
<p>If you use a third-party embedded wallet, hardware wallet, or wallet-as-a-service product, key recovery and custody are subject to that provider's terms and infrastructure. We do not control third-party wallet providers and are not liable for their unavailability, security breaches, or loss of access.</p>
|
|
235
|
+
|
|
236
|
+
<p><strong>3a. Agent / MCP Risk.</strong> Agentic exists to let AI agents — including but not limited to large language models, MCP servers, third-party agent frameworks, scheduled bots, and any automation you connect to the Platform — propose wallet actions for your review. <strong>The agent's request is a proposal; your click is the authority.</strong> You acknowledge and accept that:</p>
|
|
237
|
+
<ul>
|
|
238
|
+
<li>AI agents and LLMs can hallucinate, be prompt-injected, behave unexpectedly, or be authored by malicious third parties</li>
|
|
239
|
+
<li>A buggy or hostile agent could attempt to author transactions that drain, lock, or otherwise harm your wallet if signed</li>
|
|
240
|
+
<li>Agentic's role is to surface the proposed action so you can review it; the Platform does not auto-approve and does not vet the agent's intent</li>
|
|
241
|
+
<li>AI providers (Anthropic, OpenAI, third-party MCP authors, Vercel AI, etc.) are not SolPulse's agents, employees, or representatives; their behavior is not under our control</li>
|
|
242
|
+
<li>Optional AI planner features only draft plans or explanations; they do not make a transaction safe, signed, submitted, profitable, reversible, or suitable for you</li>
|
|
243
|
+
<li>You remain solely responsible for what you sign, including approvals issued by automation or pre-authorized categories you enabled</li>
|
|
244
|
+
</ul>
|
|
245
|
+
|
|
246
|
+
<p><strong>3b. What Agentic Does Not Do.</strong> Agentic does <strong>not</strong>:</p>
|
|
247
|
+
<ul>
|
|
248
|
+
<li>Custody, hold, or escrow your digital assets</li>
|
|
249
|
+
<li>Generate, store, or recover seed phrases or private keys</li>
|
|
250
|
+
<li>Auto-approve transactions on your behalf</li>
|
|
251
|
+
<li>Call AI providers on your behalf — your chosen agent client makes those calls under its own privacy policy</li>
|
|
252
|
+
<li>Match, settle, or take the other side of any trade</li>
|
|
253
|
+
<li>Operate an order book, an exchange, or a liquidity pool</li>
|
|
254
|
+
</ul>
|
|
255
|
+
|
|
256
|
+
<p><strong>3c. Bring-Your-Own AI Keys.</strong> If you paste or configure an AI provider key, base URL, model name, prompt, template, or plan parameter in Agentic, you are instructing your browser, local bridge, or chosen client to contact that provider. You are responsible for the provider you choose, its terms, its privacy practices, its billing, and the content you send to it. SolPulse does not guarantee that provider responses are accurate, secure, compliant, or fit for any purpose. Never enter a wallet seed phrase, private key, recovery phrase, or unrestricted credential into any AI prompt, MCP server, bridge, or support request.</p>
|
|
257
|
+
|
|
258
|
+
<h3>4. Future Paid Features</h3>
|
|
259
|
+
<p>The Platform is currently provided without subscription fees. SolPulse may, in the future, offer paid features, subscriptions, or premium tiers. If we do, the pricing, billing terms, and payment schedule will be presented at signup, and your use of those paid features will be subject to these Terms together with any additional, feature-specific terms posted at the time of purchase. Network fees, RPC fees, protocol fees, and any other third-party fees you incur when broadcasting transactions through the Platform are set by third parties and not by SolPulse.</p>
|
|
260
|
+
|
|
261
|
+
<h3>5. Risk Disclosure</h3>
|
|
262
|
+
<p><strong>Crypto and agent-action risk.</strong> The cryptocurrency market is extremely volatile, and the use of AI agents to interact with on-chain protocols is novel and carries unique risk. By using the Platform, you acknowledge and agree that:</p>
|
|
263
|
+
<ul>
|
|
264
|
+
<li>You are solely responsible for your transactions and decisions and assume all risk associated with them</li>
|
|
265
|
+
<li>You may lose some or all of your capital; there is no guarantee of profit or asset preservation</li>
|
|
266
|
+
<li>An AI agent or MCP server can prepare transactions you did not intend; reviewing each approval is your responsibility</li>
|
|
267
|
+
<li>Past performance of any strategy, agent, market, or protocol does not guarantee future results</li>
|
|
268
|
+
<li>Market manipulation, pump-and-dump schemes, prompt injection, hostile MCP servers, and other fraudulent or adversarial activities may affect your outcomes; you should conduct your own due diligence and remain vigilant</li>
|
|
269
|
+
</ul>
|
|
270
|
+
<p>SolPulse provides software and a consent rail. We are <strong>not</strong> a broker-dealer, investment adviser, or financial advisor. Nothing on the Platform constitutes financial advice. Please consult a qualified professional before making financial decisions.</p>
|
|
271
|
+
<p><strong>Voluntary assumption of risk.</strong> By using the Platform, you voluntarily assume all risks associated with cryptocurrency activity and agent-mediated transactions, including the risk of total and permanent loss of all funds in your wallet. You acknowledge that digital assets are not legal tender, are not backed by any government, and are not insured by any federal or state agency (including the FDIC or SIPC). You agree not to hold SolPulse liable for any losses, missed actions, failed transactions, or adverse outcomes resulting from your use of the Platform or from agents you connect to it.</p>
|
|
272
|
+
|
|
273
|
+
<h3>6. Compliance & Regulatory Status</h3>
|
|
274
|
+
<p>Agentic is a non-custodial software interface that brokers wallet authority between you and the agents you choose to connect. We do not operate an exchange, an order book, a matching engine, or a liquidity pool. We do not take the other side of any trade. We do not hold, custody, or control your funds or private keys at any time. All transactions are signed by you in your own wallet and broadcast to public networks (such as Solana) through third-party RPC providers and on-chain protocols.</p>
|
|
275
|
+
<p>SolPulse intends Agentic to operate as non-custodial software and not as a money transmitter, broker, dealer, exchange, investment adviser, bank, fiduciary, payment processor, or other regulated financial intermediary. Laws and regulations regarding digital assets, wallets, AI agents, and automated approvals are evolving and may be interpreted differently by different authorities. You are responsible for determining whether use of the Platform is permitted under the laws of your jurisdiction and for complying with any applicable licensing, registration, tax, accounting, or reporting obligations. We reserve the right to implement KYC/AML procedures, sanctions screening, geoblocking, app-store declarations, feature restrictions, or other compliance measures as necessary to meet legal requirements or risk controls.</p>
|
|
276
|
+
|
|
277
|
+
<h3>7. No Warranty</h3>
|
|
278
|
+
<p>The Platform and all related services are provided on an "as is" and "as available" basis without warranty of any kind. To the fullest extent permitted by law, SolPulse disclaims all warranties, express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, accuracy, non-infringement, and uninterrupted or error-free operation. We do not guarantee the availability, timeliness, completeness, or reliability of any information, agent integration, or feature offered through the Platform. You use the Platform at your own risk.</p>
|
|
279
|
+
|
|
280
|
+
<h3>8. Limitation of Liability</h3>
|
|
281
|
+
<p>To the maximum extent permitted by law, SolPulse and its directors, employees, agents, and affiliates will not be liable to you for any indirect, incidental, special, punitive, or consequential damages arising out of or in connection with your use of the Platform, even if we have been advised of the possibility of such damages. This limitation applies to, but is not limited to: any loss of profits, revenue, or data; loss of digital assets or cryptocurrency; trading or position losses; missed or failed transactions; liquidation events; losses from rug pulls, scams, exploits, prompt injection, hostile agents, or malicious MCP servers; losses caused by third-party protocol failures; losses due to network congestion, RPC outages, or MEV; losses from automation or agent malfunction; business interruption; or any other economic disadvantage. In no event shall our aggregate liability exceed the greater of (a) the amount you paid to us in the twelve months preceding the claim, or (b) one hundred US dollars (USD $100). Some jurisdictions do not allow limitations on implied warranties or liability; in such jurisdictions, our liability shall be limited to the greatest extent permitted by law.</p>
|
|
282
|
+
<p><strong>Claims Only Against the Company.</strong> You agree that any claim you may have in connection with the Platform may be brought only against SolPulse LLC and not against its owners, officers, directors, employees, contractors, affiliates, service providers, or licensors in their personal or individual capacity. This limitation applies to the fullest extent permitted by law.</p>
|
|
283
|
+
|
|
284
|
+
<h3>9. Intellectual Property</h3>
|
|
285
|
+
<p>All intellectual property rights in the Platform, including but not limited to branding, UI, documentation, hosted service configuration, app-store listings, images, names, logos, and non-open-source assets, remain the property of SolPulse or its licensors. Open-source code published by SolPulse is governed by the open-source license included with that code, currently Apache-2.0 for this repository. These Terms do not reduce rights granted to you under that open-source license, but they do not grant rights to use SolPulse names, logos, trade dress, hosted services, app listings, or other brand assets except as expressly permitted in writing.</p>
|
|
286
|
+
<p>All trademarks, service marks, trade names, logos, and brand identifiers appearing on the Platform that are not owned by SolPulse are the property of their respective owners. Reference to any third-party mark, protocol, token, or service is for identification only and does not imply endorsement, partnership, or affiliation.</p>
|
|
287
|
+
<p><strong>9a. Copyright & DMCA.</strong> SolPulse respects the intellectual property rights of others and expects users of the Platform to do the same. If you believe material accessible on or from the Platform infringes your copyright, you may request its removal by sending a written notice of infringement to our designated agent that includes: (a) a physical or electronic signature of the copyright owner or a person authorized to act on their behalf; (b) identification of the copyrighted work claimed to be infringed; (c) identification of the allegedly infringing material and information reasonably sufficient to locate it on the Platform; (d) your contact information (name, address, telephone number, and email); (e) a statement that you have a good-faith belief that the use is not authorized by the copyright owner, its agent, or the law; and (f) a statement, made under penalty of perjury, that the information in your notice is accurate and that you are the copyright owner or authorized to act on the owner's behalf. Send notices to our DMCA agent at support@solpulse.trade with the subject line "DMCA Notice." We may, in appropriate circumstances and at our discretion, terminate the accounts of users who are repeat infringers. Knowingly submitting a false or misleading notice of infringement may subject you to liability under applicable law.</p>
|
|
288
|
+
|
|
289
|
+
<h3>10. Termination & Suspension</h3>
|
|
290
|
+
<p>We may suspend, restrict, or terminate your access to the Platform at any time, with or without notice, if we believe you have violated these Terms, engaged in fraudulent or illegal activity, or if your use of the Platform poses a security or regulatory risk. You agree that we will not be liable to you or any third party for any termination of your access. Upon termination, your right to use the Platform ceases immediately. Any provisions of these Terms that by their nature should survive termination (including ownership rights, warranty disclaimers, limitation of liability, indemnification, and dispute resolution) shall remain in effect.</p>
|
|
291
|
+
|
|
292
|
+
<h3>11. Indemnification</h3>
|
|
293
|
+
<p>You agree to indemnify, defend, and hold harmless SolPulse and its directors, officers, employees, and agents from and against any claims, liabilities, damages, losses, and expenses (including reasonable attorney's fees) arising out of or related to (a) your use or misuse of the Platform, (b) your violation of these Terms, (c) your violation of any rights of another person or entity, or (d) your violation of any applicable law or regulation. We reserve the right to assume exclusive control of any matter otherwise subject to indemnification by you, in which case you agree to cooperate with our defence.</p>
|
|
294
|
+
|
|
295
|
+
<h3>12. Governing Law & Dispute Resolution</h3>
|
|
296
|
+
<p>These Terms, and any dispute arising out of or in connection with the Platform or these Terms, shall be governed by and construed in accordance with the laws of the State of Wyoming, without regard to conflict of law principles. You agree that any dispute, claim, or controversy arising out of or relating to these Terms or the breach, termination, enforcement, interpretation, or validity thereof (collectively, "Disputes") shall be resolved by binding arbitration administered by the American Arbitration Association (AAA) under its Consumer Arbitration Rules, conducted remotely or in the State of Wyoming. Either party may bring claims in small claims court if the claim qualifies. The arbitration shall be conducted on an individual basis and not on a class or representative basis. <strong>YOU AGREE THAT ANY CLAIMS WILL BE RESOLVED ON AN INDIVIDUAL BASIS AND NOT AS PART OF ANY CLASS, CONSOLIDATED, OR REPRESENTATIVE ACTION.</strong> You understand that by agreeing to arbitrate disputes, you are waiving your right to a jury trial and to participate in a class action. If this arbitration clause is found to be unenforceable, then all Disputes shall be subject to the exclusive jurisdiction of the federal and state courts located in the State of Wyoming, and you consent to the personal jurisdiction of such courts.</p>
|
|
297
|
+
<p><strong>Thirty-Day Opt-Out.</strong> You have the right to opt out of the arbitration and class-action waiver provisions set forth above by sending written notice to support@solpulse.trade with the subject line "Arbitration Opt-Out" within thirty (30) days of the date you first accept these Terms. Your notice must include your full legal name, the email address associated with your account or contact, and a clear statement that you wish to opt out of arbitration. Opting out does not affect any other provision of these Terms, including the governing-law and venue selections.</p>
|
|
298
|
+
<p><strong>Prevailing Party Fees.</strong> In any arbitration or legal proceeding arising out of or relating to these Terms, the prevailing party shall be entitled to recover its reasonable attorneys' fees, expert fees, arbitration filing fees, and costs, to the extent permitted by applicable law and the rules of the forum.</p>
|
|
299
|
+
|
|
300
|
+
<h3>13. Changes to Terms</h3>
|
|
301
|
+
<p>We may update these Terms from time to time. The latest version will always be posted at https://agenticwalletadapter.com/terms. Continued use after changes constitutes acceptance.</p>
|
|
302
|
+
|
|
303
|
+
<h3>14. Contact</h3>
|
|
304
|
+
<ul>
|
|
305
|
+
<li>📧 Email: support@solpulse.trade</li>
|
|
306
|
+
<li>📍 Location: SolPulse LLC, 1621 Central Ave, Cheyenne, WY 82001</li>
|
|
307
|
+
</ul>
|
|
308
|
+
<p><strong>14a. Privacy.</strong> Your use of the Platform is also governed by our <a href="/privacy">Privacy Policy</a>, which is incorporated into these Terms by reference. The Privacy Policy describes what data we collect, how we use it, with whom we share it, and your rights regarding your personal information. By using the Platform you consent to the collection, use, and sharing of your data as described in the Privacy Policy. If you do not agree with the Privacy Policy, you must not use the Platform.</p>
|
|
309
|
+
<p><strong>14b. Electronic Communications & Signatures.</strong> By using the Platform, you consent to receive communications from SolPulse electronically, including by email, in-app notice, or other channel where you have provided contact information, and you agree that all agreements, notices, disclosures, and other communications we provide to you electronically satisfy any legal requirement that such communications be in writing. You further agree that your electronic acceptance of these Terms — for example, by clicking "I accept," connecting a wallet, or continuing to use the Platform after notice of updates — constitutes a legally binding signature under the U.S. Electronic Signatures in Global and National Commerce Act (15 U.S.C. § 7001 et seq.) and any applicable state Uniform Electronic Transactions Act. You may withdraw this consent only by discontinuing use of the Platform.</p>
|
|
310
|
+
|
|
311
|
+
<h3>15. Action Approval & Execution</h3>
|
|
312
|
+
<p>Actions surfaced by the Platform are prepared off-chain by the agent or other software you connect, displayed for your review, signed by your wallet, and broadcast to the relevant blockchain network through third-party RPC providers and on-chain protocols. Any pre-action estimate displayed by the Platform — including price, slippage, fees, route, or expected outcome — is for informational convenience only and may differ from the actual on-chain result due to network conditions, slippage, routing changes, MEV activity, or third-party protocol behavior. Approvals can expire, fail to land, partial-fill, or be re-ordered, front-run, censored, or delayed by the network or validators. Adjusting compute unit prices or priority tips may improve inclusion probabilities but does not guarantee execution or price. SolPulse does not guarantee that any signed transaction will land or settle, and is not responsible for the outcomes of transactions you authorize.</p>
|
|
313
|
+
|
|
314
|
+
<h3>16. Third-Party Services & Data Sources</h3>
|
|
315
|
+
<p>The Platform may rely on third-party services and data sources such as wallet providers, RPC nodes, AI clients, MCP servers, DEX aggregators/routers, market data providers, block explorers, messaging services, and email providers. We do not control and are not responsible for their availability, accuracy, performance, security, or legality. Outages, inaccuracies, or changes in those services may affect your experience and outcomes. Your use of third-party services may be governed by their own terms and privacy policies.</p>
|
|
316
|
+
|
|
317
|
+
<h3>17. Automation, Caps & Pre-Authorized Categories</h3>
|
|
318
|
+
<p>If you enable automated approvals, spend caps, recurring payments, allowlisted recipients, bridge polling, Android foreground wallet-approval flows, or any "always allow" / pre-authorized category in the Platform, you authorize the Platform to prepare, queue, poll for, or submit transactions via your connected wallet in accordance with your parameters. You are responsible for maintaining adequate balances, monitoring the automation, and disabling or revoking it when desired. We may implement idempotency or duplicate-protection mechanisms, but they cannot prevent all race conditions, retries, stale authorizations, wallet bugs, bridge failures, or double-submissions across networks, devices, agents, or wallets.</p>
|
|
319
|
+
|
|
320
|
+
<h3>18. Safety Checks & Heuristics</h3>
|
|
321
|
+
<p>Any safety, simulation, cap, allowlist, balance, slippage, or risk check surfaced by the Platform is heuristic and informational only. Such checks do not constitute a guarantee that an action is safe, that a token is legitimate, that liquidity is sufficient, or that an agent is non-malicious. You should conduct your own due diligence before approving any action and understand that heuristic checks can be incomplete, stale, or bypassed. We are not liable for losses arising from rug pulls, honeypots, scam tokens, exploits, prompt-injected agents, or any fraudulent activity that you authorize through the Platform, even if our safety checks failed to detect it.</p>
|
|
322
|
+
<p><strong>18a. Smart Contract & On-Chain Risk.</strong> The Platform interacts with third-party blockchain networks, decentralized protocols, smart contracts, and routers (including but not limited to Jupiter Aggregator, Raydium, Orca, Meteora, and other on-chain venues that an agent may select). We do not develop, audit, or control these smart contracts. Smart contracts may contain bugs, vulnerabilities, or exploits that could result in partial or total loss of funds. You acknowledge that interacting with on-chain protocols carries inherent risk, and SolPulse is not liable for any losses caused by smart contract failures, exploits, hacks, or vulnerabilities in third-party protocols, regardless of whether the transaction was initiated manually or via agent automation.</p>
|
|
323
|
+
<p><strong>Public & Permanent.</strong> Every transaction you submit through the Platform is broadcast to the relevant blockchain network and recorded on a public, immutable ledger. You acknowledge that your wallet address, counterparty addresses, transaction amounts, slippage tolerances, and timing metadata may be observed, indexed, copied, or exploited by any third party with access to the network, including searcher bots, MEV actors, block explorers, and analytics platforms. SolPulse cannot and does not guarantee the privacy, reversibility, or anonymity of any on-chain activity.</p>
|
|
324
|
+
|
|
325
|
+
<h3>19. Taxes & Recordkeeping</h3>
|
|
326
|
+
<p>You are solely responsible for all taxes, reporting, and recordkeeping related to your use of the Platform, including gains, losses, fees, and other taxable events. We do not provide tax advice. You should consult a qualified tax professional regarding your obligations.</p>
|
|
327
|
+
|
|
328
|
+
<h3>20. Service Availability, Maintenance & Incidents</h3>
|
|
329
|
+
<p>We may perform maintenance, upgrades, or changes that temporarily affect availability. We may also activate read-only or maintenance modes to preserve system integrity or comply with legal requirements. Status information may be communicated through in-app notices or external status pages. We are not liable for losses arising from downtime, maintenance windows, or incidents. Except as expressly agreed in writing, SolPulse has no obligation to provide support, bug fixes, updates, or customer service in connection with the Platform, and any assistance we do provide is on a best-effort, as-available basis.</p>
|
|
330
|
+
|
|
331
|
+
<h3>21. Beta / Experimental Features</h3>
|
|
332
|
+
<p>Certain features may be labeled beta or experimental. Such features may be incomplete, change without notice, or be withdrawn. They may have reduced reliability or performance. Your use of beta features is at your own risk and subject to these Terms.</p>
|
|
333
|
+
|
|
334
|
+
<h3>22. Account Deletion, Data Export & Retention</h3>
|
|
335
|
+
<p>Where provided, you may request deletion of any data we hold about you and export of certain data. Deletion requests may be subject to verification and limitations where retention is required by law, security, or dispute resolution. Additional details about retention periods and processing are described in our Privacy Policy.</p>
|
|
336
|
+
|
|
337
|
+
<h3>23. Changes to the Platform</h3>
|
|
338
|
+
<p>We may add, modify, or discontinue features, components, or access methods of the Platform at any time. Where changes materially affect any paid access, we will provide reasonable notice consistent with Section 4. We are not responsible for third-party withdrawals of service or feature changes outside our control.</p>
|
|
339
|
+
|
|
340
|
+
<h3>24. Third-Party Links</h3>
|
|
341
|
+
<p>The Platform may contain links to third-party websites or resources. We provide these links as a convenience and are not responsible for the content, products, or services on or available from those websites or resources. Accessing any third-party site is at your own risk and may be subject to separate terms and privacy policies established by those third parties.</p>
|
|
342
|
+
|
|
343
|
+
<h3>25. Export Controls & Sanctions</h3>
|
|
344
|
+
<p>You agree to comply with all applicable export control and economic sanctions laws and regulations, including those administered by the U.S. Department of the Treasury's Office of Foreign Assets Control (OFAC) and the U.S. Department of Commerce. You represent that you are not located in, under the control of, or a national or resident of any country or region subject to comprehensive sanctions, and that you are not identified on any government restricted party list. You will not use the Platform to transact with or benefit any such person, entity, country, or region.</p>
|
|
345
|
+
|
|
346
|
+
<h3>26. Geographic Restrictions & Prohibited Jurisdictions</h3>
|
|
347
|
+
<p>We may restrict access to the Platform where we believe it is necessary to comply with laws, regulations, or risk controls. We may employ geoblocking or other measures to prevent access from prohibited jurisdictions. You are responsible for ensuring that your use of the Platform is lawful in your location and for ceasing use if it becomes unlawful.</p>
|
|
348
|
+
|
|
349
|
+
<h3>27. Force Majeure</h3>
|
|
350
|
+
<p>We will not be liable for any delay or failure to perform resulting from causes beyond our reasonable control, including acts of God, natural disasters, war, terrorism, civil unrest, labor disputes, government actions, power or internet failures, failures of third-party service providers, or network/validator disruptions.</p>
|
|
351
|
+
|
|
352
|
+
<h3>28. Assignment; No Agency</h3>
|
|
353
|
+
<p>You may not assign or transfer any rights or obligations under these Terms without our prior written consent. We may assign these Terms without restriction. Nothing in these Terms shall be construed to create a partnership, joint venture, fiduciary, or agency relationship between you and SolPulse; neither party has authority to bind the other.</p>
|
|
354
|
+
|
|
355
|
+
<h3>29. Severability; Entire Agreement; Waiver; Interpretation</h3>
|
|
356
|
+
<p>If any provision of these Terms is held to be invalid or unenforceable, that provision will be enforced to the maximum extent permissible and the remaining provisions will remain in full force and effect. These Terms constitute the entire agreement between you and SolPulse regarding the Platform and supersede any prior or contemporaneous agreements on the same subject. No waiver of any provision shall be effective unless in writing and signed by the waiving party, and no waiver shall be deemed a waiver of any other provision or of the same provision on another occasion. Headings are for convenience only and do not affect interpretation.</p>
|
|
357
|
+
<p><strong>No Third-Party Beneficiaries.</strong> These Terms are solely for the benefit of you and SolPulse. Nothing in these Terms, express or implied, is intended to or shall confer upon any other person or entity any legal or equitable right, benefit, or remedy of any nature.</p>
|
|
358
|
+
|
|
359
|
+
<h3>30. Sanctions Screening</h3>
|
|
360
|
+
<p>Access to or use of the Platform may be restricted or prohibited in certain jurisdictions. You represent and warrant that you are not located in, organized under the laws of, or ordinarily resident in any jurisdiction subject to comprehensive sanctions, and that you are not listed on any government sanctions or restricted party list. You agree that you will not use the Platform to benefit any sanctioned person or jurisdiction or for any unlawful purpose. We may implement geoblocking, sanctions screening, and other compliance measures and may suspend or terminate access where we believe it is necessary to comply with law.</p>
|
|
361
|
+
|
|
362
|
+
<h3>31. No Offer; No Suitability Determination</h3>
|
|
363
|
+
<p>All content and functionality on the Platform are provided for informational and operational purposes only and do not constitute an offer, solicitation, recommendation, or endorsement of any digital asset, strategy, agent, or course of action. We do not assess the suitability of any action, asset, or strategy for you, and we do not provide investment, legal, tax, or accounting advice. You are solely responsible for your decisions and should obtain independent professional advice tailored to your circumstances.</p>
|
|
364
|
+
|
|
365
|
+
<h3>32. User-Directed Agents; No Discretion</h3>
|
|
366
|
+
<p>Any AI agents, LLMs, MCP servers, automation, schedulers, or "bots" connected to the Platform operate strictly according to the parameters you configure and authorize. The Platform does not exercise discretionary authority over your account, funds, or strategy. SolPulse does not owe you a fiduciary duty. We do not act as your agent, advisor, or fiduciary. All automation is user-directed and parameter-driven. You may stop or revoke any agent at any time, subject to on-chain conditions and network availability. Enabling automation or pre-authorized categories authorizes the Platform to prepare or submit transactions via your connected wallet pursuant to your parameters; you remain responsible for monitoring positions, risk, and outcomes.</p>
|
|
367
|
+
|
|
368
|
+
<h3>33. Protocol Changes, Forks, and Unsupported Assets</h3>
|
|
369
|
+
<p>Blockchain networks and protocols may change, fork, experience re-organizations, fee spikes, congestion, or failures. We do not control any blockchain and make no guarantees regarding network security, functionality, or availability. We may determine, in our sole discretion, how to respond to protocol changes (including whether to support particular forks, airdrops, or tokens) and have no obligation to support any asset or distribution. Because Agentic is non-custodial, we do not relay, distribute, or hold airdrops, forked assets, or protocol distributions on your behalf. You acknowledge you are not entitled to any forked assets, airdrops, or protocol distributions via the Platform unless we explicitly state otherwise.</p>
|
|
370
|
+
|
|
371
|
+
<h3>34. Third-Party Content, Data, and Links</h3>
|
|
372
|
+
<p>The Platform may display or rely on third-party information and services, including pricing, market data, routing, wallets, RPC, analytics, messaging, and external websites. We do not guarantee the accuracy, completeness, timeliness, reliability, or availability of any third-party content or services. Links to third-party sites are provided for convenience only, and your use of them is at your own risk and subject to their terms and policies.</p>
|
|
373
|
+
|
|
374
|
+
<h3>35. Security, Malicious Code, and Network Attacks</h3>
|
|
375
|
+
<p>You are solely responsible for securing your devices and accounts. We do not warrant that the Platform or any files or data available through it are free of viruses, worms, trojans, logic bombs, or other harmful components, or that services will be immune to denial-of-service or similar attacks. We are not liable for losses arising from such events. Use reputable security software and follow best practices when interacting with digital assets, wallets, and downloads.</p>
|
|
376
|
+
|
|
377
|
+
<h3>36. Availability; Internet, Devices & Support</h3>
|
|
378
|
+
<p>The Platform operates over the internet and mobile networks and may be affected by factors outside our control, including connectivity, device or operating system versions, and app store policies. We do not guarantee continuous, uninterrupted access, and we have no obligation to provide device-level or operating system support. We may update, modify, or suspend functionality from time to time to maintain security and performance. Tutorials, videos, FAQs, and helpdesk materials describe Platform functionality only and do not contain personalized advice or recommendations.</p>
|
|
379
|
+
|
|
380
|
+
<h3>37. Release of Claims</h3>
|
|
381
|
+
<p>To the fullest extent permitted by law, you hereby release and forever discharge SolPulse and its owners, directors, officers, employees, agents, successors, and assigns from any and all claims, demands, damages, losses, costs, and expenses (including attorneys' fees) of every kind and nature, known or unknown, arising out of or in any way connected with: (a) your transaction activity or financial decisions; (b) the performance or non-performance of any agent, strategy, or automation; (c) any interaction with third-party protocols, smart contracts, or decentralized exchanges; (d) the loss, theft, or unauthorized access to your wallet, private keys, or digital assets; (e) any token you interacted with that turned out to be fraudulent, a rug pull, or otherwise worthless; or (f) any other use of the Platform. If applicable law does not allow the release of unknown claims, you waive the protections of any statute or doctrine that limits the scope of a release to known claims.</p>
|
|
382
|
+
|
|
383
|
+
<h3>38. Acknowledgment</h3>
|
|
384
|
+
<p>By using the Platform, you acknowledge that you have read, understood, and agree to all of these Terms. You confirm that you are not relying on any representation or warranty not expressly set out in these Terms. You understand that cryptocurrency activity is speculative, that you may lose all funds, and that Agentic is a software tool — not a financial institution, broker, exchange, or advisor.</p>
|
|
385
|
+
</article>
|
|
386
|
+
</section>
|
|
387
|
+
`}function Ls(e){return`
|
|
388
|
+
<header class="homepage-nav" aria-label="Agentic navigation">
|
|
389
|
+
<a class="homepage-brand" href="/" aria-label="Agentic home" ${e==="/"?'aria-current="page"':""}>
|
|
390
|
+
${qn()}
|
|
391
|
+
<span>Agentic</span>
|
|
392
|
+
</a>
|
|
393
|
+
<nav class="homepage-links" aria-label="Primary navigation">
|
|
394
|
+
${es.map(t=>Is(t,e)).join("")}
|
|
395
|
+
</nav>
|
|
396
|
+
</header>
|
|
397
|
+
`}function Is(e,t){const r=e.route===t,l=[e.pill?"nav-pill-link":"",e.route==="/app"?"launch-app-link":"",e.mobileHidden?"mobile-nav-hidden":"",e.mobileLabel?"has-mobile-label":""].filter(Boolean).join(" "),p=e.mobileLabel?`<span class="nav-label nav-label-full">${d(e.label)}</span><span class="nav-label nav-label-mobile">${d(e.mobileLabel)}</span>`:`<span class="nav-label">${d(e.label)}</span>`;return`
|
|
398
|
+
<a href="${d(e.route)}" class="${l}" ${r?'aria-current="page"':""}>
|
|
399
|
+
${p}
|
|
400
|
+
</a>
|
|
401
|
+
`}function Es(){return`
|
|
402
|
+
<section id="top" class="homepage-hero" aria-labelledby="hero-title">
|
|
403
|
+
<div class="hero-copy">
|
|
404
|
+
<div class="chain-strip" aria-label="Network and signing layer">
|
|
405
|
+
<span class="logo-chip solana-chip">${ca("solana","logo-chip-icon")}<span>Solana</span></span>
|
|
406
|
+
<span class="logo-chip" aria-label="Wallet Standard">${ca("solana","logo-chip-icon")}<span class="chip-label chip-label-full">Wallet Standard</span><span class="chip-label chip-label-mobile" aria-hidden="true">Wallet Std</span></span>
|
|
407
|
+
<span class="logo-chip" aria-label="Mobile Wallet Adapter">${ca("solanaMobile","logo-chip-icon")}<span class="chip-label chip-label-full">Mobile Wallet Adapter</span><span class="chip-label chip-label-mobile" aria-hidden="true">MWA</span></span>
|
|
408
|
+
</div>
|
|
409
|
+
<p class="eyebrow mini">Wallet authority for agents</p>
|
|
410
|
+
<h1 id="hero-title">
|
|
411
|
+
<span>Let agents use your</span>
|
|
412
|
+
<span>Solana wallet</span>
|
|
413
|
+
<span>without giving</span>
|
|
414
|
+
<span>them one.</span>
|
|
415
|
+
</h1>
|
|
416
|
+
<p class="hero-lede">
|
|
417
|
+
<span>Agentic gives Claude, Codex, local MCP servers,</span>
|
|
418
|
+
<span>and app runtimes a single approval path</span>
|
|
419
|
+
<span>through the wallet you already trust.</span>
|
|
420
|
+
<span>Agents prepare the action;</span>
|
|
421
|
+
<span>your wallet remains the signer.</span>
|
|
422
|
+
</p>
|
|
423
|
+
<div class="hero-command-area">
|
|
424
|
+
${_s()}
|
|
425
|
+
<a class="button-link hero-app-link nav-pill-link launch-app-link mobile-redundant-nav" href="/app">Launch App</a>
|
|
426
|
+
<a class="button-link hero-demo-link mobile-redundant-nav" href="/demo">Launch Demo</a>
|
|
427
|
+
</div>
|
|
428
|
+
${Us()}
|
|
429
|
+
${Ds()}
|
|
430
|
+
</div>
|
|
431
|
+
${Rs()}
|
|
432
|
+
</section>
|
|
433
|
+
`}function _s(){const e=Ha(),t=rl("hero",e),r=a.recentCopyId===t;return`
|
|
434
|
+
<div class="command-deck" aria-label="Runtime command deck">
|
|
435
|
+
<div class="command-deck-options" aria-label="Choose runtime path">
|
|
436
|
+
${pa.map(Os).join("")}
|
|
437
|
+
</div>
|
|
438
|
+
<div class="command-readout ${r?"copied":""}">
|
|
439
|
+
${Ns(e)}
|
|
440
|
+
<span class="command-status-pill">${d(e.badge)}</span>
|
|
441
|
+
${Ms(e,t,r)}
|
|
442
|
+
</div>
|
|
443
|
+
</div>
|
|
444
|
+
`}function Ns(e){return e.actionKind==="link"?`
|
|
445
|
+
<div class="command-readout-line link-readout">
|
|
446
|
+
<span class="command-prompt" aria-hidden="true">→</span>
|
|
447
|
+
<span class="readout-label">Download route</span>
|
|
448
|
+
<code>${d(e.href??e.command)}</code>
|
|
449
|
+
</div>
|
|
450
|
+
`:`
|
|
451
|
+
<div class="command-readout-line">
|
|
452
|
+
<span class="command-prompt" aria-hidden="true">$</span>
|
|
453
|
+
<code>${d(e.command)}</code>
|
|
454
|
+
<span class="command-caret" aria-hidden="true"></span>
|
|
455
|
+
</div>
|
|
456
|
+
`}function Os(e){const t=e.id===a.selectedRuntimePath;return`
|
|
457
|
+
<button
|
|
458
|
+
type="button"
|
|
459
|
+
class="command-path ${t?"active":""}"
|
|
460
|
+
data-runtime-path="${d(e.id)}"
|
|
461
|
+
aria-pressed="${t?"true":"false"}"
|
|
462
|
+
>
|
|
463
|
+
<span>${d(e.eyebrow)}</span>
|
|
464
|
+
<strong>${d(e.label)}</strong>
|
|
465
|
+
<small>${d(e.detail)}</small>
|
|
466
|
+
</button>
|
|
467
|
+
`}function Ms(e,t,r){return e.actionKind==="link"?`
|
|
468
|
+
<a class="command-deck-action" href="${d(e.href??"/desktop")}">
|
|
469
|
+
${d(e.actionLabel)}
|
|
470
|
+
</a>
|
|
471
|
+
`:`
|
|
472
|
+
<button
|
|
473
|
+
class="command-copy-button ${r?"copied":""}"
|
|
474
|
+
data-copy="${d(e.command)}"
|
|
475
|
+
data-copy-id="${d(t)}"
|
|
476
|
+
data-copy-name="${d(e.copyName??e.label)}"
|
|
477
|
+
title="Copy command: ${d(e.command)}"
|
|
478
|
+
>
|
|
479
|
+
${r?"Copied":d(e.actionLabel)}
|
|
480
|
+
</button>
|
|
481
|
+
`}function mn(e,t){return`
|
|
482
|
+
<article class="browser-app-card">
|
|
483
|
+
<h3>${d(e)}</h3>
|
|
484
|
+
<p>${d(t)}</p>
|
|
485
|
+
</article>
|
|
486
|
+
`}function Ws(){return`
|
|
487
|
+
<section id="docs" class="docs-section" aria-labelledby="docs-title">
|
|
488
|
+
<div class="section-heading">
|
|
489
|
+
<!-- Docs eyebrow intentionally hidden. -->
|
|
490
|
+
<h2 id="docs-title">A local signing boundary for agent runtimes.</h2>
|
|
491
|
+
<p>
|
|
492
|
+
Render serves this website, but Agentic's bridge, CLI, and Desktop App run locally beside the user's wallet.
|
|
493
|
+
Android users can use the hosted app in mobile browser surfaces that support Mobile Wallet Adapter. Agents
|
|
494
|
+
can ask for signatures, swaps, transfers, receipts, and inbox approvals without receiving a seed phrase,
|
|
495
|
+
keypair file, or server-side private key.
|
|
496
|
+
</p>
|
|
497
|
+
</div>
|
|
498
|
+
<div class="docs-grid">
|
|
499
|
+
${bn("1. Launch the app","Use the hosted app and guided demo to see wallet discovery, connection, signing, and Mobile Wallet Adapter readiness.")}
|
|
500
|
+
${bn("2. Install a local runtime","Use the npm CLI, a standalone CLI binary, or the Desktop App when Codex, Claude, or an MCP client needs a persistent local bridge.")}
|
|
501
|
+
${bn("3. Let agents request approval","Claude, Codex, MCP clients, and framework adapters send bounded actions to the local bridge; the wallet still signs every request.")}
|
|
502
|
+
</div>
|
|
503
|
+
</section>
|
|
504
|
+
`}function bn(e,t){return`
|
|
505
|
+
<article class="docs-card">
|
|
506
|
+
<h3>${d(e)}</h3>
|
|
507
|
+
<p>${d(t)}</p>
|
|
508
|
+
</article>
|
|
509
|
+
`}function Rs(){const e=Ha(),t=si(e);return`
|
|
510
|
+
<aside class="hero-terminal" aria-label="Agentic terminal preview">
|
|
511
|
+
<div class="terminal-preview-window hero-terminal-window">
|
|
512
|
+
<div class="terminal-preview-bar">
|
|
513
|
+
<span></span>
|
|
514
|
+
<span></span>
|
|
515
|
+
<span></span>
|
|
516
|
+
<strong>agentic</strong>
|
|
517
|
+
</div>
|
|
518
|
+
<div class="terminal-preview-body">
|
|
519
|
+
${Bs(e)}
|
|
520
|
+
<p class="${t.bridgeTone}">${d(t.bridgeLine)}</p>
|
|
521
|
+
<p class="${t.walletTone}">${d(t.walletLine)}</p>
|
|
522
|
+
<p><span>agent</span> prepare swap SOL to USDC</p>
|
|
523
|
+
<p><span>wallet</span> user approval required</p>
|
|
524
|
+
<p class="ok"><span>result</span> no private key handed to agent</p>
|
|
525
|
+
</div>
|
|
526
|
+
</div>
|
|
527
|
+
<div class="hero-proof-panel" aria-label="Authority model">
|
|
528
|
+
${vn("Agent requests","Intent, route, limits, and transaction bytes.")}
|
|
529
|
+
${vn("Wallet approves",a.address?R(a.address):"Existing user wallet signs.")}
|
|
530
|
+
${vn("Adapter records","Receipt, policy context, bridge state, and audit artifacts.")}
|
|
531
|
+
</div>
|
|
532
|
+
</aside>
|
|
533
|
+
`}function Bs(e){return e.actionKind==="link"?`<p><span>route</span> ${d(e.href??e.terminalCommand)}</p>`:`<p><span>$</span> ${d(e.terminalCommand)}<i class="terminal-caret" aria-hidden="true"></i></p>`}function vn(e,t){return`
|
|
534
|
+
<div class="hero-proof">
|
|
535
|
+
<span>${d(e)}</span>
|
|
536
|
+
<strong>${d(t)}</strong>
|
|
537
|
+
</div>
|
|
538
|
+
`}function Us(){return`
|
|
539
|
+
<div class="integration-strip" aria-label="Agent runtimes">
|
|
540
|
+
${[{name:"Claude",logoId:"claude"},{name:"Codex",logoId:"codex"},{name:"MCP"},{name:"Vercel AI",logoId:"vercel"},{name:"Solana Agent Kit",logoId:"solana"}].map(t=>`
|
|
541
|
+
<span>
|
|
542
|
+
${t.logoId?ca(t.logoId,"runtime-logo"):""}
|
|
543
|
+
<span>${d(t.name)}</span>
|
|
544
|
+
</span>
|
|
545
|
+
`).join("")}
|
|
546
|
+
</div>
|
|
547
|
+
`}function Ds(){return`
|
|
548
|
+
<div class="wallet-chip-strip" aria-label="Supported wallet examples">
|
|
549
|
+
${[{name:"Phantom",logoId:"phantom"},{name:"Solflare",logoId:"solflare"},{name:"Backpack",logoId:"backpack"},{name:"Jupiter Mobile",logoId:"jupiter"},{name:"Seed Vault",logoId:"solanaMobile"}].map(t=>qs(t.name,t.logoId)).join("")}
|
|
550
|
+
<span class="wallet-chip standard-chip">
|
|
551
|
+
${ca("solana","wallet-chip-icon")}
|
|
552
|
+
<span>Wallet Standard / MWA</span>
|
|
553
|
+
</span>
|
|
554
|
+
</div>
|
|
555
|
+
`}function qs(e,t){const r=Ua(e);return`
|
|
556
|
+
<span class="wallet-chip ${r?"detected":""}">
|
|
557
|
+
${ri(r,da(e),"wallet-chip-icon",t)}
|
|
558
|
+
<span>${d((r==null?void 0:r.name)??e)}</span>
|
|
559
|
+
</span>
|
|
560
|
+
`}function ti(){return`
|
|
561
|
+
<section class="gap-section" aria-labelledby="gap-title">
|
|
562
|
+
<div class="gap-copy">
|
|
563
|
+
<p class="eyebrow mini">The gap</p>
|
|
564
|
+
<h2 id="gap-title">Agents can plan Solana actions. Most stacks still ask for the wrong signer.</h2>
|
|
565
|
+
</div>
|
|
566
|
+
<div class="gap-body">
|
|
567
|
+
<p>
|
|
568
|
+
Read-only MCPs stop before approval. Server-key agents move custody into an environment variable.
|
|
569
|
+
Agent wallets and vaults ask users to fund a separate signer. Product links hand the user off to
|
|
570
|
+
someone else's flow.
|
|
571
|
+
</p>
|
|
572
|
+
<p>
|
|
573
|
+
Solana Agent Wallet Adapter keeps the user's existing wallet as the signing boundary, while giving
|
|
574
|
+
agents one request path across Wallet Standard, Mobile Wallet Adapter, iOS wallet links, MCP, Vercel AI,
|
|
575
|
+
Solana Agent Kit, CLI, and the local bridge.
|
|
576
|
+
</p>
|
|
577
|
+
<div class="gap-proof-grid" aria-label="Differentiators">
|
|
578
|
+
${yn("Existing wallet","Phantom, Solflare, Backpack, Seed Vault, and compatible Solana wallets stay in control.")}
|
|
579
|
+
${yn("No private key handoff","Agents request signatures without receiving a seed phrase, keypair file, or env-var signer.")}
|
|
580
|
+
${yn("One adapter layer","The same wallet backend supports browser, mobile, MCP, framework, CLI, receipts, and approval inbox flows.")}
|
|
581
|
+
</div>
|
|
582
|
+
</div>
|
|
583
|
+
</section>
|
|
584
|
+
`}function ai(){return`
|
|
585
|
+
<section id="wallets" class="wallet-directory-section" aria-labelledby="wallet-directory-title">
|
|
586
|
+
<div class="section-heading">
|
|
587
|
+
<p class="eyebrow mini">Wallet directory</p>
|
|
588
|
+
<h2 id="wallet-directory-title">Use the wallet users already picked.</h2>
|
|
589
|
+
<p>
|
|
590
|
+
Agentic targets Solana wallet authority through Wallet Standard, Mobile Wallet Adapter, Seed Vault,
|
|
591
|
+
and compatible provider surfaces. Discovered wallets use their provider-supplied icons.
|
|
592
|
+
</p>
|
|
593
|
+
</div>
|
|
594
|
+
<div class="wallet-directory-grid">
|
|
595
|
+
${Tt("Phantom","Browser and mobile approvals through the user-owned Phantom signer.",["phantom"],"phantom")}
|
|
596
|
+
${Tt("Solflare","Wallet Standard signing without moving custody into an agent runtime.",["solflare"],"solflare")}
|
|
597
|
+
${Tt("Backpack","Installed wallet approval for agent-prepared messages and transactions.",["backpack"],"backpack")}
|
|
598
|
+
${Tt("Jupiter Mobile","Mobile approval path for swap-aware wallet flows and prepared actions.",["jupiter"],"jupiter")}
|
|
599
|
+
${Tt("Seed Vault","Android hardware-backed custody through Mobile Wallet Adapter surfaces.",["seed vault","seedvault"],"solanaMobile")}
|
|
600
|
+
${Tt("Wallet Standard / MWA","One adapter surface for browser wallets, Android MWA, and wallet in-app browsers.",["wallet standard","mobile wallet adapter","mwa"],"solana",!0)}
|
|
601
|
+
</div>
|
|
602
|
+
<div class="wallet-directory-action">
|
|
603
|
+
<button data-start-action="discover" class="${a.wallets.length?"":"primary"}" ${a.busy?"disabled":""}>
|
|
604
|
+
${a.wallets.length?"Refresh Wallet Directory":"Discover Wallets"}
|
|
605
|
+
</button>
|
|
606
|
+
<span>${a.wallets.length?`${a.wallets.length} provider(s) discovered in this browser.`:"Provider icons appear after discovery."}</span>
|
|
607
|
+
</div>
|
|
608
|
+
</section>
|
|
609
|
+
`}function Tt(e,t,r,l,p=!1){const b=r.map(Ua).find(G=>!!G),x=!!b;return`
|
|
610
|
+
<article class="wallet-directory-card ${x?"detected":""}">
|
|
611
|
+
<div class="wallet-directory-head">
|
|
612
|
+
${ri(b,da(e),"wallet-directory-icon",l)}
|
|
613
|
+
<div>
|
|
614
|
+
<h3>${d((b==null?void 0:b.name)??e)}</h3>
|
|
615
|
+
<span>${x?"Detected provider":p?"Adapter surface":"Supported path"}</span>
|
|
616
|
+
</div>
|
|
617
|
+
</div>
|
|
618
|
+
<p>${d(t)}</p>
|
|
619
|
+
</article>
|
|
620
|
+
`}function js(){return`
|
|
621
|
+
<section id="cli" class="runtime-section cli-section" aria-labelledby="cli-title">
|
|
622
|
+
<div class="section-heading runtime-heading">
|
|
623
|
+
<!-- CLI eyebrow intentionally hidden. -->
|
|
624
|
+
<h2 id="cli-title">Install the local approval CLI.</h2>
|
|
625
|
+
<p>
|
|
626
|
+
The public CLI path is npm first, with standalone binaries for users who prefer a direct download.
|
|
627
|
+
The CLI starts the local bridge and wallet host; this website only copies commands or links releases.
|
|
628
|
+
</p>
|
|
629
|
+
</div>
|
|
630
|
+
<div class="runtime-grid">
|
|
631
|
+
<article class="runtime-card">
|
|
632
|
+
<span class="runtime-kicker">npm global</span>
|
|
633
|
+
<h3>Install once</h3>
|
|
634
|
+
<p>Install the command globally, then run <code>solana-agent-wallet app</code> from any terminal.</p>
|
|
635
|
+
${la("Global install",Wn,"Copy command")}
|
|
636
|
+
</article>
|
|
637
|
+
<article class="runtime-card">
|
|
638
|
+
<span class="runtime-kicker">npm exec</span>
|
|
639
|
+
<h3>Run without installing</h3>
|
|
640
|
+
<p>Use npm's one-shot execution path to start the terminal approval app.</p>
|
|
641
|
+
${la("One-shot app",Rt,"Copy command")}
|
|
642
|
+
</article>
|
|
643
|
+
</div>
|
|
644
|
+
<div class="download-section">
|
|
645
|
+
<div class="download-section-head">
|
|
646
|
+
<h3>Standalone CLI binaries</h3>
|
|
647
|
+
<a href="${Mn}" target="_blank" rel="noreferrer">View all releases</a>
|
|
648
|
+
</div>
|
|
649
|
+
<div class="download-grid">
|
|
650
|
+
${as.map(([e,t])=>Dn(e,t,"CLI binary")).join("")}
|
|
651
|
+
</div>
|
|
652
|
+
</div>
|
|
653
|
+
</section>
|
|
654
|
+
`}function Fs(){return`
|
|
655
|
+
<section id="desktop" class="desktop-section" aria-labelledby="desktop-title">
|
|
656
|
+
<div class="section-heading">
|
|
657
|
+
<!-- Desktop App eyebrow intentionally hidden. -->
|
|
658
|
+
<h2 id="desktop-title">Download the Agentic Desktop App.</h2>
|
|
659
|
+
<p>
|
|
660
|
+
The Desktop App is optional easy mode for the local bridge, approval inbox, logs, and diagnostics. Use it
|
|
661
|
+
when you want app controls instead of terminal commands. Browser extension wallets still approve every
|
|
662
|
+
signing request through the external wallet host.
|
|
663
|
+
</p>
|
|
664
|
+
</div>
|
|
665
|
+
<div class="download-grid desktop-download-grid">
|
|
666
|
+
${ns.map(([e,t])=>Dn(e,t,"Desktop installer")).join("")}
|
|
667
|
+
</div>
|
|
668
|
+
<p class="download-note">
|
|
669
|
+
Release artifacts are attached to GitHub Releases. If a platform build is not available yet, use the CLI install path above.
|
|
670
|
+
</p>
|
|
671
|
+
</section>
|
|
672
|
+
`}function Gs(){return`
|
|
673
|
+
<section id="android" class="android-section" aria-labelledby="android-title">
|
|
674
|
+
<div class="section-heading">
|
|
675
|
+
<!-- Android eyebrow intentionally hidden. -->
|
|
676
|
+
<h2 id="android-title">Install the Agentic Android app.</h2>
|
|
677
|
+
<p>
|
|
678
|
+
The Android build is a Trusted Web Activity for the Render-hosted Agentic site. It keeps the browser-based
|
|
679
|
+
Solana Mobile Wallet Adapter path available without turning the app into a private-key custodian.
|
|
680
|
+
</p>
|
|
681
|
+
</div>
|
|
682
|
+
<div class="download-section">
|
|
683
|
+
<div class="download-section-head">
|
|
684
|
+
<h3>Android release artifacts</h3>
|
|
685
|
+
<a href="${Mn}" target="_blank" rel="noreferrer">View all releases</a>
|
|
686
|
+
</div>
|
|
687
|
+
<div class="download-grid android-download-grid">
|
|
688
|
+
${rs.map(([e,t])=>Dn(e,t,e.includes("Bundle")?"Play release":"Android install")).join("")}
|
|
689
|
+
</div>
|
|
690
|
+
</div>
|
|
691
|
+
<p class="download-note">
|
|
692
|
+
Use the APK for direct install testing and the AAB for Play or managed release pipelines. Production trusted
|
|
693
|
+
mode requires the deployed site to serve Digital Asset Links for the signing certificate.
|
|
694
|
+
</p>
|
|
695
|
+
</section>
|
|
696
|
+
`}function Ys(){return`
|
|
697
|
+
<section class="homepage-demo-cta" aria-labelledby="homepage-demo-title">
|
|
698
|
+
<div>
|
|
699
|
+
<p class="eyebrow mini">Approval workspace</p>
|
|
700
|
+
<h2 id="homepage-demo-title">Open the real wallet approval workspace.</h2>
|
|
701
|
+
<p>
|
|
702
|
+
Launch App opens the browser and mobile-web approval surface. The demo stays available when you want a guided
|
|
703
|
+
preview before connecting a wallet.
|
|
704
|
+
</p>
|
|
705
|
+
</div>
|
|
706
|
+
<div class="homepage-cta-actions">
|
|
707
|
+
<a class="button-link nav-pill-link launch-app-link mobile-redundant-nav" href="/app">Launch App</a>
|
|
708
|
+
<a class="button-link mobile-redundant-nav" href="/demo">Preview Demo</a>
|
|
709
|
+
</div>
|
|
710
|
+
</section>
|
|
711
|
+
`}function Hs(){return`
|
|
712
|
+
<section id="demo-guide" class="browser-app-section guided-demo-overview" aria-labelledby="guided-demo-title">
|
|
713
|
+
<div class="section-heading">
|
|
714
|
+
<p class="eyebrow mini">Guided demo</p>
|
|
715
|
+
<h2 id="guided-demo-title">Try the approval flow before launching the full app.</h2>
|
|
716
|
+
<p>
|
|
717
|
+
This page keeps a short guide above the live demo workspace. Use the cards to jump into wallet signing,
|
|
718
|
+
agent plan review, approval queues, recurring approvals, or artifacts without losing the interactive controls below.
|
|
719
|
+
</p>
|
|
720
|
+
</div>
|
|
721
|
+
<div class="browser-app-grid demo-guide-grid">
|
|
722
|
+
${Lt("wallet","Wallet signing","Connect a wallet and sign a bounded demo message without exposing keys.","Try signing")}
|
|
723
|
+
${Lt("agent","Agent plan","Draft a structured approval plan, then sign the proof when connected.","Draft a plan")}
|
|
724
|
+
${Lt("generated","Generated plans","Review saved AI and template drafts before signing proofs or queueing approvals.","Review plans")}
|
|
725
|
+
${Lt("inbox","Approval Inbox","Preview prepared actions and receipts from the local bridge.","View inbox")}
|
|
726
|
+
${Lt("schedule","Create Recurring","Create recurring approval requests that still require wallet review each time.","Create recurring")}
|
|
727
|
+
${Lt("labs","Artifacts","Create wallet-signed audit artifacts for intent, policy, evidence, and verification.","Create artifact")}
|
|
728
|
+
</div>
|
|
729
|
+
<div class="browser-app-actions">
|
|
730
|
+
<button data-start-action="discover" ${a.busy?"disabled":""}>
|
|
731
|
+
${a.wallets.length?"Refresh Wallets":"Discover Wallets"}
|
|
732
|
+
</button>
|
|
733
|
+
<button class="nav-pill-link" data-demo-tab="wallet" ${a.busy?"disabled":""}>Open live demo</button>
|
|
734
|
+
<a class="button-link launch-app-link mobile-redundant-nav" href="/app">Launch full app</a>
|
|
735
|
+
<a class="button-link mobile-redundant-nav" href="/docs">Read Docs</a>
|
|
736
|
+
</div>
|
|
737
|
+
</section>
|
|
738
|
+
`}function Lt(e,t,r,l){return`
|
|
739
|
+
<article class="browser-app-card demo-step-card">
|
|
740
|
+
<div>
|
|
741
|
+
<h3>${d(t)}</h3>
|
|
742
|
+
<p>${d(r)}</p>
|
|
743
|
+
</div>
|
|
744
|
+
<button class="demo-step-action" data-demo-tab="${d(e)}">${d(l)}</button>
|
|
745
|
+
</article>
|
|
746
|
+
`}function zs(){var t;const e=!!((t=Xn())!=null&&t.openMwaExample);return`
|
|
747
|
+
<section id="mwa-test" class="browser-app-section" aria-labelledby="mwa-test-title">
|
|
748
|
+
<div class="section-heading">
|
|
749
|
+
<p class="eyebrow mini">Android MWA</p>
|
|
750
|
+
<h2 id="mwa-test-title">Raw Mobile Wallet Adapter controls.</h2>
|
|
751
|
+
<p>
|
|
752
|
+
This tab is available only in Android builds with the example tab flag enabled. It opens the native MWA
|
|
753
|
+
tester for wallet connect, SIWS, message signing, transaction signing, bridge polling, and reset smokes.
|
|
754
|
+
</p>
|
|
755
|
+
</div>
|
|
756
|
+
<div class="browser-app-grid demo-guide-grid">
|
|
757
|
+
${mn("Native tester","Use the old Android MWA test surface without making it the app launcher.")}
|
|
758
|
+
${mn("Wallet handoff","Exercise Solana Mobile Wallet Adapter connect, reconnect, and signing paths.")}
|
|
759
|
+
${mn("Bridge smoke","Connect to the local Agentic bridge and resolve agent requests with a real wallet.")}
|
|
760
|
+
</div>
|
|
761
|
+
<div class="browser-app-actions">
|
|
762
|
+
<button id="openAndroidMwaTest" class="nav-pill-link" ${e?"":"disabled"}>
|
|
763
|
+
Open MWA
|
|
764
|
+
</button>
|
|
765
|
+
<a class="button-link" href="/app">Back to Launch App</a>
|
|
766
|
+
</div>
|
|
767
|
+
${e?"":'<p class="inline-status warning">MWA is only available inside the Android app build.</p>'}
|
|
768
|
+
</section>
|
|
769
|
+
`}function Ks(){return`
|
|
770
|
+
<footer class="homepage-footer" aria-label="Agentic footer">
|
|
771
|
+
<div>
|
|
772
|
+
<span class="footer-brand">${qn("mini-mark")} Agentic</span>
|
|
773
|
+
<p>Render hosts the static website. CLI, Desktop App, bridge, and wallet approvals run locally.</p>
|
|
774
|
+
<p class="footer-contact">
|
|
775
|
+
<span>SolPulse LLC</span>
|
|
776
|
+
<a href="mailto:support@solpulse.trade">support@solpulse.trade</a>
|
|
777
|
+
</p>
|
|
778
|
+
</div>
|
|
779
|
+
<nav aria-label="Footer navigation">
|
|
780
|
+
<a href="/docs">Docs</a>
|
|
781
|
+
<a href="${Mn}" target="_blank" rel="noreferrer">Releases</a>
|
|
782
|
+
<a href="/terms">Terms</a>
|
|
783
|
+
<a href="/privacy">Privacy</a>
|
|
784
|
+
</nav>
|
|
785
|
+
</footer>
|
|
786
|
+
`}function Vs(){return`
|
|
787
|
+
<section id="local-development" class="local-dev-section" aria-labelledby="local-dev-title">
|
|
788
|
+
<div class="section-heading">
|
|
789
|
+
<p class="eyebrow mini">Local repo development</p>
|
|
790
|
+
<h2 id="local-dev-title">Contributor commands stay separate from public install paths.</h2>
|
|
791
|
+
<p>
|
|
792
|
+
These commands are for developers running this monorepo locally. They are not required for public website visitors.
|
|
793
|
+
</p>
|
|
794
|
+
</div>
|
|
795
|
+
<div class="runtime-grid">
|
|
796
|
+
<article class="runtime-card">
|
|
797
|
+
<span class="runtime-kicker">Launch App</span>
|
|
798
|
+
<h3>Develop the hosted app</h3>
|
|
799
|
+
${la("Browser dev server","pnpm demo:browser","Copy command")}
|
|
800
|
+
</article>
|
|
801
|
+
<article class="runtime-card">
|
|
802
|
+
<span class="runtime-kicker">Repo fallback</span>
|
|
803
|
+
<h3>Run unreleased local runtimes</h3>
|
|
804
|
+
${la("Desktop App dev","pnpm desktop:dev","Copy command")}
|
|
805
|
+
${la("CLI from repo","pnpm cli -- app","Copy command")}
|
|
806
|
+
</article>
|
|
807
|
+
</div>
|
|
808
|
+
</section>
|
|
809
|
+
`}function Dn(e,t,r){const l=`${Jo}/${t}`;return`
|
|
810
|
+
<a class="download-card" href="${d(l)}" target="_blank" rel="noreferrer">
|
|
811
|
+
<span>${d(r)}</span>
|
|
812
|
+
<strong>${d(e)}</strong>
|
|
813
|
+
<code>${d(t)}</code>
|
|
814
|
+
</a>
|
|
815
|
+
`}function la(e,t,r){const l=za("runtime",e,t),p=a.recentCopyId===l;return`
|
|
816
|
+
<div class="runtime-command-row ${p?"copied":""}">
|
|
817
|
+
<div>
|
|
818
|
+
<span>${d(e)}</span>
|
|
819
|
+
<code>${d(t)}</code>
|
|
820
|
+
</div>
|
|
821
|
+
<button
|
|
822
|
+
class="${p?"copied":""}"
|
|
823
|
+
data-copy="${d(t)}"
|
|
824
|
+
data-copy-id="${d(l)}"
|
|
825
|
+
data-copy-name="${d(e)}"
|
|
826
|
+
title="Copy command: ${d(t)}"
|
|
827
|
+
>
|
|
828
|
+
${p?"Copied":d(r)}
|
|
829
|
+
</button>
|
|
830
|
+
</div>
|
|
831
|
+
`}function ni(e="app"){const t=ye?"dev-app":"public-app",r=e==="demo"?"demo-workspace":"workspace",l=e==="demo"?"demo-workspace-title":"workspace-title";return`
|
|
832
|
+
<section id="${r}" class="app-workspace-section ${t} ${e==="demo"?"demo-workspace-mode":"launch-workspace-mode"}" aria-labelledby="${l}">
|
|
833
|
+
<div class="workspace-intro">
|
|
834
|
+
<div>
|
|
835
|
+
${e==="demo"?'<p class="eyebrow mini">Interactive demo</p>':"<!-- Launch App eyebrow intentionally hidden. -->"}
|
|
836
|
+
<h2 id="${l}">${e==="demo"?"Live approval demo.":"Agentic approval workspace."}</h2>
|
|
837
|
+
</div>
|
|
838
|
+
${ye?hr():""}
|
|
839
|
+
</div>
|
|
840
|
+
${ye?Js():""}
|
|
841
|
+
${ye?`<header class="app-header command-bar">
|
|
842
|
+
<div class="brand-lockup">
|
|
843
|
+
<span class="brand-mark">${qn("mini-mark")}</span>
|
|
844
|
+
<div>
|
|
845
|
+
<p class="eyebrow mini">Solana Agent Wallet Adapter</p>
|
|
846
|
+
<h1>Wallet approval workspace</h1>
|
|
847
|
+
</div>
|
|
848
|
+
</div>
|
|
849
|
+
${hr()}
|
|
850
|
+
</header>`:""}
|
|
851
|
+
|
|
852
|
+
<section class="workspace ${ye?"dev-workspace":"public-workspace"}">
|
|
853
|
+
${Zs()}
|
|
854
|
+
<section class="panel main-panel">
|
|
855
|
+
<div class="surface-topbar">
|
|
856
|
+
<div>
|
|
857
|
+
<h2>${cd()}</h2>
|
|
858
|
+
</div>
|
|
859
|
+
<nav class="nav-cluster tabs workspace-tabs" aria-label="Workspace navigation">
|
|
860
|
+
|
|
861
|
+
${ra("agent","Agent Plan","Plan")}
|
|
862
|
+
${ra("generated","Generated Plans","Plans")}
|
|
863
|
+
${ra("inbox","Approval Inbox","Inbox")}
|
|
864
|
+
${ra("schedule","Create Recurring","Recur")}
|
|
865
|
+
${ra("labs","Artifacts")}
|
|
866
|
+
</nav>
|
|
867
|
+
</div>
|
|
868
|
+
${sl()}
|
|
869
|
+
</section>
|
|
870
|
+
${ye?Ul():Dl()}
|
|
871
|
+
</section>
|
|
872
|
+
</section>
|
|
873
|
+
`}function yn(e,t){return`
|
|
874
|
+
<article class="gap-proof">
|
|
875
|
+
<strong>${d(e)}</strong>
|
|
876
|
+
<p>${d(t)}</p>
|
|
877
|
+
</article>
|
|
878
|
+
`}function qn(e=""){const t=["agentic-mark",e].filter(Boolean).join(" ");return`
|
|
879
|
+
<img class="${d(t)}" src="${d(is)}" alt="" aria-hidden="true" decoding="async" />
|
|
880
|
+
`}function ca(e,t){return`
|
|
881
|
+
<span class="${d(t)} brand-logo" aria-hidden="true">
|
|
882
|
+
<img src="${d(Bn[e])}" alt="" />
|
|
883
|
+
</span>
|
|
884
|
+
`}function ri(e,t,r,l){const p=(e==null?void 0:e.icon)??(l?Bn[l]:void 0);return p?`
|
|
885
|
+
<span class="${d(r)} wallet-provider-icon" aria-hidden="true">
|
|
886
|
+
<img src="${d(p)}" alt="" />
|
|
887
|
+
</span>
|
|
888
|
+
`:`<span class="${d(r)} wallet-provider-fallback" aria-hidden="true">${d(t)}</span>`}function Ua(e){const t=e.toLowerCase();return a.wallets.find(r=>r.name.toLowerCase().includes(t))}function da(e){return e.split(/[\s/-]+/).filter(Boolean).slice(0,2).map(t=>{var r;return((r=t[0])==null?void 0:r.toUpperCase())??""}).join("")}function wn(e){const t=e.toLowerCase();if(t.includes("backpack"))return"backpack";if(t.includes("phantom"))return"phantom";if(t.includes("solflare"))return"solflare";if(t.includes("jupiter"))return"jupiter"}function Js(){const e=a.preparedActions.filter(t=>!t.archived&&!["approved","rejected"].includes(t.status)).length;return`
|
|
889
|
+
<section class="mission-strip">
|
|
890
|
+
${_a("Wallet",a.address?R(a.address):"Not connected",a.address?"online":"")}
|
|
891
|
+
${_a("Cluster",a.cluster,a.cluster==="mainnet-beta"?"warn":"")}
|
|
892
|
+
${_a("Bridge",a.bridgeActive?"Ready":"Offline",a.bridgeActive?"online":"")}
|
|
893
|
+
${_a("Approvals",`${e} queued`,e>0?"warn":"")}
|
|
894
|
+
</section>
|
|
895
|
+
`}function hr(){const e=a.preparedActions.filter(t=>!t.archived&&!["approved","rejected"].includes(t.status)).length;return`
|
|
896
|
+
<div class="system-spine" aria-label="System status">
|
|
897
|
+
${Ea("Wallet",a.address?R(a.address):"Connect wallet",a.address?"online":"")}
|
|
898
|
+
${Ea("Network",Ge(a.cluster),a.cluster==="mainnet-beta"?"warn":"")}
|
|
899
|
+
${Ea("Bridge",a.bridgeActive?"Ready":"Offline",a.bridgeActive?"online":"")}
|
|
900
|
+
${Ea("Queue",`${e}`,e>0?"warn":"")}
|
|
901
|
+
</div>
|
|
902
|
+
`}function Ea(e,t,r=""){return`
|
|
903
|
+
<div class="spine-node ${r}">
|
|
904
|
+
<span>${d(e)}</span>
|
|
905
|
+
<strong>${d(t)}</strong>
|
|
906
|
+
</div>
|
|
907
|
+
`}function _a(e,t,r=""){return`
|
|
908
|
+
<div class="mission-metric ${r}">
|
|
909
|
+
<span>${d(e)}</span>
|
|
910
|
+
<strong>${d(t)}</strong>
|
|
911
|
+
</div>
|
|
912
|
+
`}function Zs(){const e=ye&&!a.address,t=!ye&&!a.address&&!a.androidNativeEnvironment.isAndroidNative&&!a.iosNativeEnvironment.isIosNative&&a.wallets.length>1,r=!ye&&!a.address&&a.iosNativeEnvironment.isIosNative,l=jc();return`
|
|
913
|
+
<aside class="panel custody-panel custody-module">
|
|
914
|
+
<div class="rail-heading custody-heading">
|
|
915
|
+
${Qs(l)}
|
|
916
|
+
<div>
|
|
917
|
+
<p class="eyebrow mini">Signer</p>
|
|
918
|
+
<h2>${d(l.title)}</h2>
|
|
919
|
+
</div>
|
|
920
|
+
</div>
|
|
921
|
+
|
|
922
|
+
<div class="connection-summary custody-card">
|
|
923
|
+
<span class="status-dot ${a.address?"online":""}"></span>
|
|
924
|
+
<div>
|
|
925
|
+
<strong>${d(l.summary)}</strong>
|
|
926
|
+
<p>${d(l.detail)}</p>
|
|
927
|
+
</div>
|
|
928
|
+
</div>
|
|
929
|
+
|
|
930
|
+
${ye&&a.address?`<button id="disconnect" class="text-button" ${a.busy?"disabled":""}>Disconnect wallet</button>`:""}
|
|
931
|
+
${ye?"":Xs()}
|
|
932
|
+
|
|
933
|
+
${ye?`
|
|
934
|
+
<details class="rail-details developer-settings" ${e?"open":""}>
|
|
935
|
+
<summary>Developer settings</summary>
|
|
936
|
+
${el()}
|
|
937
|
+
</details>`:""}
|
|
938
|
+
|
|
939
|
+
${t?`
|
|
940
|
+
<details class="rail-details wallet-picker-details" open>
|
|
941
|
+
<summary>Choose wallet</summary>
|
|
942
|
+
<label class="field">
|
|
943
|
+
<span>Selected wallet</span>
|
|
944
|
+
<select id="walletSelect" ${a.busy?"disabled":""}>
|
|
945
|
+
${Li()}
|
|
946
|
+
</select>
|
|
947
|
+
</label>
|
|
948
|
+
</details>`:""}
|
|
949
|
+
|
|
950
|
+
${r?`
|
|
951
|
+
<details class="rail-details wallet-picker-details" open>
|
|
952
|
+
<summary>Choose iOS wallet</summary>
|
|
953
|
+
<label class="field">
|
|
954
|
+
<span>Selected wallet</span>
|
|
955
|
+
<select id="iosWalletSelect" ${a.busy?"disabled":""}>
|
|
956
|
+
${Ii()}
|
|
957
|
+
</select>
|
|
958
|
+
</label>
|
|
959
|
+
</details>`:""}
|
|
960
|
+
|
|
961
|
+
${ye&&a.address?`
|
|
962
|
+
<details class="rail-details bridge-details" ${a.bridgeActive?"open":""}>
|
|
963
|
+
<summary>Bridge operations</summary>
|
|
964
|
+
${tl()}
|
|
965
|
+
</details>`:""}
|
|
966
|
+
${ye&&a.address?`
|
|
967
|
+
<details class="rail-details">
|
|
968
|
+
<summary>Environment</summary>
|
|
969
|
+
${oi()}
|
|
970
|
+
</details>`:""}
|
|
971
|
+
</aside>
|
|
972
|
+
`}function Qs(e){var r;const t=e.logoId?Bn[e.logoId]:(r=e.discoveredWallet)==null?void 0:r.icon;return t?`
|
|
973
|
+
<span class="rail-icon wallet-provider-icon" aria-hidden="true">
|
|
974
|
+
<img src="${d(t)}" alt="" />
|
|
975
|
+
</span>
|
|
976
|
+
`:`<span class="rail-icon" aria-hidden="true">${d(e.icon)}</span>`}function Xs(){const e=Jn(),t=a.androidNativeEnvironment.isAndroidNative,r=a.iosNativeEnvironment.isIosNative,l=t||r;return a.address?`
|
|
977
|
+
<div class="wallet-actions public-wallet-actions connected">
|
|
978
|
+
<button id="disconnect" ${a.busy?"disabled":""}>Disconnect wallet</button>
|
|
979
|
+
</div>
|
|
980
|
+
`:l?`
|
|
981
|
+
<div class="wallet-actions public-wallet-actions native-wallet-actions">
|
|
982
|
+
<button data-start-action="connect" class="primary wallet-connect-cta" ${a.busy?"disabled":""}>
|
|
983
|
+
${ii()}
|
|
984
|
+
<span>Connect wallet</span>
|
|
985
|
+
</button>
|
|
986
|
+
</div>
|
|
987
|
+
`:`
|
|
988
|
+
<div class="wallet-actions public-wallet-actions">
|
|
989
|
+
<button data-start-action="discover" class="${a.wallets.length?"":"primary"}" ${a.busy?"disabled":""}>
|
|
990
|
+
${a.wallets.length?"Refresh":"Discover"}
|
|
991
|
+
</button>
|
|
992
|
+
<button data-start-action="connect" class="${a.wallets.length?"primary":""}" ${a.wallets.length===0||!e||a.busy?"disabled":""} title="${e?"":"Discover and select a wallet provider first."}">
|
|
993
|
+
Connect wallet
|
|
994
|
+
</button>
|
|
995
|
+
</div>
|
|
996
|
+
`}function ii(){return`
|
|
997
|
+
<svg class="wallet-button-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
|
998
|
+
<path d="M19 7h-1V6.5A2.5 2.5 0 0 0 15.5 4H5.75A3.75 3.75 0 0 0 2 7.75v8.5A3.75 3.75 0 0 0 5.75 20H19a3 3 0 0 0 3-3v-7a3 3 0 0 0-3-3Zm-3-1a.5.5 0 0 1 .5.5V7H5.75a1.25 1.25 0 0 1 0-2.5h9.75ZM20 17a1 1 0 0 1-1 1H5.75A1.75 1.75 0 0 1 4 16.25V8.76c.52.16 1.08.24 1.75.24H19a1 1 0 0 1 1 1v7Zm-4.5-4.5a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5Z"></path>
|
|
999
|
+
</svg>
|
|
1000
|
+
`}function el(){const e=a.androidNativeEnvironment.isAndroidNative;return`
|
|
1001
|
+
<label class="field">
|
|
1002
|
+
<span>Cluster</span>
|
|
1003
|
+
<select id="clusterSelect" ${a.busy||a.bridgeActive?"disabled":""}>
|
|
1004
|
+
${qo.map(t=>`<option value="${t}" ${t===a.cluster?"selected":""} ${e&&t==="localnet"?"disabled":""}>${t}</option>`).join("")}
|
|
1005
|
+
</select>
|
|
1006
|
+
</label>
|
|
1007
|
+
|
|
1008
|
+
${e?"":a.iosNativeEnvironment.isIosNative?`
|
|
1009
|
+
<label class="field">
|
|
1010
|
+
<span>iOS wallet</span>
|
|
1011
|
+
<select id="iosWalletSelect" ${a.busy?"disabled":""}>
|
|
1012
|
+
${Ii()}
|
|
1013
|
+
</select>
|
|
1014
|
+
</label>`:`
|
|
1015
|
+
<label class="field">
|
|
1016
|
+
<span>Selected wallet</span>
|
|
1017
|
+
<select id="walletSelect" ${a.wallets.length===0||a.busy?"disabled":""}>
|
|
1018
|
+
${Li()}
|
|
1019
|
+
</select>
|
|
1020
|
+
</label>`}
|
|
1021
|
+
|
|
1022
|
+
${a.capabilities?Gc(a.capabilities):""}
|
|
1023
|
+
${e||a.iosNativeEnvironment.isIosNative?oi():""}
|
|
1024
|
+
`}function oi(){return a.androidNativeEnvironment.isAndroidNative?`
|
|
1025
|
+
<div class="mobile-wallet-box android-native-box">
|
|
1026
|
+
<h3>Android Native MWA</h3>
|
|
1027
|
+
<p>${d(a.androidNativeStatus)}</p>
|
|
1028
|
+
<div class="capabilities compact-caps">
|
|
1029
|
+
<span>Android app</span>
|
|
1030
|
+
<span>MWA picker</span>
|
|
1031
|
+
<span>${a.androidAuthCacheCount} cached</span>
|
|
1032
|
+
</div>
|
|
1033
|
+
<div class="bridge-actions ios-state-actions">
|
|
1034
|
+
<button id="androidReconnectCached" ${a.busy?"disabled":""}>Reconnect cached</button>
|
|
1035
|
+
<button id="androidClearTransient" ${a.busy?"disabled":""}>Clear transient</button>
|
|
1036
|
+
<button id="androidFullReset" ${a.busy?"disabled":""}>Full reset</button>
|
|
1037
|
+
<button id="androidClearAllAccounts" ${a.busy?"disabled":""}>Clear all accounts</button>
|
|
1038
|
+
</div>
|
|
1039
|
+
</div>
|
|
1040
|
+
`:a.iosNativeEnvironment.isIosNative?`
|
|
1041
|
+
<div class="mobile-wallet-box ios-native-box">
|
|
1042
|
+
<h3>iOS Wallet Runtime</h3>
|
|
1043
|
+
<p>${d(a.iosNativeStatus)}</p>
|
|
1044
|
+
<div class="capabilities compact-caps">
|
|
1045
|
+
<span>Capacitor iOS</span>
|
|
1046
|
+
<span>${d(va(a.selectedIosWalletId))}</span>
|
|
1047
|
+
<span>${a.iosAuthCacheCount} cached</span>
|
|
1048
|
+
</div>
|
|
1049
|
+
<div class="bridge-actions ios-state-actions">
|
|
1050
|
+
<button id="iosReconnectCached" ${a.busy?"disabled":""}>Reconnect cached</button>
|
|
1051
|
+
<button id="iosClearTransient" ${a.busy?"disabled":""}>Clear transient</button>
|
|
1052
|
+
<button id="iosFullReset" ${a.busy?"disabled":""}>Full reset</button>
|
|
1053
|
+
<button id="iosClearAllAccounts" ${a.busy?"disabled":""}>Clear all accounts</button>
|
|
1054
|
+
</div>
|
|
1055
|
+
</div>
|
|
1056
|
+
`:`
|
|
1057
|
+
<div class="mobile-wallet-box">
|
|
1058
|
+
<h3>Android MWA</h3>
|
|
1059
|
+
<p>${d(md())}</p>
|
|
1060
|
+
<div class="capabilities compact-caps">
|
|
1061
|
+
<span>${a.mwaEnvironment.isAndroid?"Android":"Desktop"}</span>
|
|
1062
|
+
<span>${a.mwaEnvironment.supportsMwaMobileWeb?"MWA ready":"Browser wallet"}</span>
|
|
1063
|
+
</div>
|
|
1064
|
+
</div>
|
|
1065
|
+
`}function tl(){const e=a.bridgeActive?"online":a.busy?"checking":"",t=a.bridgeActive?"Connected":a.busy?"Checking":"Offline";return`
|
|
1066
|
+
<div class="bridge-box bridge-ops-card">
|
|
1067
|
+
<div class="bridge-ops-head">
|
|
1068
|
+
<div>
|
|
1069
|
+
<span>Local bridge</span>
|
|
1070
|
+
<h3>Bridge host</h3>
|
|
1071
|
+
</div>
|
|
1072
|
+
<strong class="${e}">${d(t)}</strong>
|
|
1073
|
+
</div>
|
|
1074
|
+
<div class="bridge-endpoint">
|
|
1075
|
+
<span>Endpoint</span>
|
|
1076
|
+
<code>${d(al(a.bridgeUrl))}</code>
|
|
1077
|
+
</div>
|
|
1078
|
+
<div class="bridge-actions bridge-primary-actions">
|
|
1079
|
+
<button id="connectBridge" class="primary" ${!a.address||a.busy||a.bridgeActive?"disabled":""}>
|
|
1080
|
+
Connect bridge
|
|
1081
|
+
</button>
|
|
1082
|
+
<button id="disconnectBridge" ${!a.bridgeActive||a.busy?"disabled":""}>Disconnect</button>
|
|
1083
|
+
</div>
|
|
1084
|
+
<p class="bridge-ops-status">${d(a.bridgeStatus)}</p>
|
|
1085
|
+
<div class="bridge-terminal-hint">
|
|
1086
|
+
<span>Terminal control</span>
|
|
1087
|
+
<code>${Rt}</code>
|
|
1088
|
+
<button data-copy="${Rt}" data-copy-name="CLI one-shot command" title="Copy terminal command">Copy</button>
|
|
1089
|
+
</div>
|
|
1090
|
+
<details class="bridge-advanced-settings">
|
|
1091
|
+
<summary>Advanced bridge settings</summary>
|
|
1092
|
+
<label class="field compact">
|
|
1093
|
+
<span>Bridge URL</span>
|
|
1094
|
+
<input id="bridgeUrl" value="${d(a.bridgeUrl)}" ${a.busy||a.bridgeActive?"disabled":""} />
|
|
1095
|
+
</label>
|
|
1096
|
+
<label class="field compact">
|
|
1097
|
+
<span>Bridge token</span>
|
|
1098
|
+
<input id="bridgeToken" value="${d(a.bridgeToken)}" ${a.busy||a.bridgeActive?"disabled":""} />
|
|
1099
|
+
</label>
|
|
1100
|
+
</details>
|
|
1101
|
+
</div>
|
|
1102
|
+
`}function al(e){try{const t=new URL(e);return`${t.hostname}${t.port?`:${t.port}`:""}`}catch{return R(e)}}function Ya(e,t){const r=Jn(),l=a.androidNativeEnvironment.isAndroidNative,p=a.iosNativeEnvironment.isIosNative,b=l||p,x=va(a.selectedIosWalletId);return`
|
|
1103
|
+
<section class="guided-start signature-stage stage-dormant">
|
|
1104
|
+
<div class="guided-start-copy">
|
|
1105
|
+
<h2>${d(e)}</h2>
|
|
1106
|
+
<p>${d(t)}</p>
|
|
1107
|
+
</div>
|
|
1108
|
+
<div class="guided-path" aria-label="Wallet connection path">
|
|
1109
|
+
${xn("1",l?"Discover":p?"iOS paths":"Discover",l?"Open the Android MWA wallet picker":p?`${a.iosWallets.length} wallet path(s) ready`:a.wallets.length?`${a.wallets.length} provider(s) found`:"Find installed Wallet Standard providers",b||a.wallets.length>0)}
|
|
1110
|
+
${xn("2","Select",l?"Choose from the MWA picker":p?x:r||(a.wallets.length?"Choose a discovered provider":"Choose a wallet provider"),l||(p?!!x:!!r))}
|
|
1111
|
+
${xn("3","Connect","Authorize this app in the wallet",!!a.address)}
|
|
1112
|
+
</div>
|
|
1113
|
+
<div class="guided-actions">
|
|
1114
|
+
${b?`
|
|
1115
|
+
<button data-start-action="connect" class="primary wallet-connect-cta" ${a.busy?"disabled":""}>
|
|
1116
|
+
${ii()}
|
|
1117
|
+
<span>Connect wallet</span>
|
|
1118
|
+
</button>`:`
|
|
1119
|
+
<button data-start-action="discover" class="${a.wallets.length?"":"primary"}" ${a.busy?"disabled":""}>Discover wallets</button>
|
|
1120
|
+
<button data-start-action="connect" class="${a.wallets.length?"primary":""}" ${a.wallets.length===0||!r||a.busy?"disabled":""} title="${r?"":"Discover and select a wallet provider first."}">Connect wallet</button>`}
|
|
1121
|
+
</div>
|
|
1122
|
+
<p class="guided-note">Bridge review, recurring approvals, artifact creation, and transaction tools unlock after a wallet is connected.</p>
|
|
1123
|
+
</section>
|
|
1124
|
+
`}function xn(e,t,r,l){return`
|
|
1125
|
+
<div class="guided-step ${l?"complete":""}">
|
|
1126
|
+
<span>${d(e)}</span>
|
|
1127
|
+
<div>
|
|
1128
|
+
<strong>${d(t)}</strong>
|
|
1129
|
+
<p>${d(r)}</p>
|
|
1130
|
+
</div>
|
|
1131
|
+
</div>
|
|
1132
|
+
`}function mr(){const e=Ha(),t=e.actionKind==="copy"?e:pa[0],r=si(t);return`
|
|
1133
|
+
<section class="terminal-try-panel" aria-label="Terminal app quick start">
|
|
1134
|
+
<div class="terminal-try-copy">
|
|
1135
|
+
<span class="workbench-kicker">Try it now</span>
|
|
1136
|
+
<h2>Run the approval terminal</h2>
|
|
1137
|
+
<p>Copy one command into Terminal. The terminal controls the bridge and approval queue; your browser wallet still signs every request.</p>
|
|
1138
|
+
<div class="terminal-command-list">
|
|
1139
|
+
${An("One-shot CLI",Rt,"No install")}
|
|
1140
|
+
${An("Global install",Wn,"Install")}
|
|
1141
|
+
${An("Installed app",Kr,"After install")}
|
|
1142
|
+
</div>
|
|
1143
|
+
</div>
|
|
1144
|
+
<div class="terminal-preview-window">
|
|
1145
|
+
<div class="terminal-preview-bar">
|
|
1146
|
+
<span></span>
|
|
1147
|
+
<span></span>
|
|
1148
|
+
<span></span>
|
|
1149
|
+
<strong>terminal</strong>
|
|
1150
|
+
</div>
|
|
1151
|
+
<div class="terminal-preview-body">
|
|
1152
|
+
<p><span>$</span> ${d(t.terminalCommand)}<i class="terminal-caret" aria-hidden="true"></i></p>
|
|
1153
|
+
<p class="${r.bridgeTone}">${d(r.bridgeLine)}</p>
|
|
1154
|
+
<p class="${r.walletTone}">${d(r.walletLine)}</p>
|
|
1155
|
+
<p><span>sawa></span> /connect</p>
|
|
1156
|
+
<p><span>sawa></span> /inbox</p>
|
|
1157
|
+
</div>
|
|
1158
|
+
</div>
|
|
1159
|
+
</section>
|
|
1160
|
+
`}function An(e,t,r){const l=za("terminal",e,t),p=a.recentCopyId===l;return`
|
|
1161
|
+
<div class="terminal-command-row ${p?"copied":""}">
|
|
1162
|
+
<div>
|
|
1163
|
+
<span>${d(e)}</span>
|
|
1164
|
+
<code>${d(t)}</code>
|
|
1165
|
+
</div>
|
|
1166
|
+
<strong>${d(r)}</strong>
|
|
1167
|
+
<button
|
|
1168
|
+
class="${p?"copied":""}"
|
|
1169
|
+
data-copy="${d(t)}"
|
|
1170
|
+
data-copy-id="${d(l)}"
|
|
1171
|
+
data-copy-name="${d(e)} command"
|
|
1172
|
+
title="Copy ${d(e)} command"
|
|
1173
|
+
>
|
|
1174
|
+
${p?"Copied":"Copy"}
|
|
1175
|
+
</button>
|
|
1176
|
+
</div>
|
|
1177
|
+
`}function si(e=Ha()){return a.bridgeActive&&a.address?{bridgeLine:"Bridge connected",bridgeTone:"ok",walletLine:`Wallet ${R(a.address)} ready`,walletTone:"ok"}:a.address?{bridgeLine:"Bridge offline, terminal app can start it",bridgeTone:"warn",walletLine:`Wallet ${R(a.address)} connected in browser`,walletTone:"ok"}:{bridgeLine:e.bridgeLine,bridgeTone:"warn",walletLine:e.walletLine,walletTone:""}}function Ha(){return pa.find(e=>e.id===a.selectedRuntimePath)??pa[0]}function nl(e){return pa.find(t=>t.id===e)}function rl(e,t){return za(e,t.label,t.command)}function za(e,t,r){return`${e}:${t}:${r}`}function il(e){a.recentCopyId=e,Ia!==null&&window.clearTimeout(Ia),Ia=window.setTimeout(()=>{a.recentCopyId===e&&(a.recentCopyId="",Ia=null,ee())},1600)}function ol(e){return`
|
|
1178
|
+
<div class="signature-lifecycle signature-trace" aria-label="Signature lifecycle">
|
|
1179
|
+
${e.map(([t,r,l])=>`
|
|
1180
|
+
<div class="trace-node ${l?"complete":""}">
|
|
1181
|
+
<span class="trace-dot"></span>
|
|
1182
|
+
<div>
|
|
1183
|
+
<strong>${d(t)}</strong>
|
|
1184
|
+
<p>${d(r)}</p>
|
|
1185
|
+
</div>
|
|
1186
|
+
</div>
|
|
1187
|
+
`).join("")}
|
|
1188
|
+
</div>
|
|
1189
|
+
`}function li(e,t){return`
|
|
1190
|
+
<div class="signature-placeholder">
|
|
1191
|
+
<span>${d(e)}</span>
|
|
1192
|
+
<p>${d(t)}</p>
|
|
1193
|
+
</div>
|
|
1194
|
+
`}function sl(){switch(a.activeTab){case"wallet":return ll();case"agent":return cl();case"generated":return dl();case"inbox":return Pl();case"schedule":return Cl();case"labs":return Tl()}}function ll(){if(!a.address)return`
|
|
1195
|
+
${Ya("Wallet signing","Connect a browser wallet to open signing requests, approvals, and receipts.")}
|
|
1196
|
+
${ye?mr():""}
|
|
1197
|
+
`;const e=a.signature?"primary resolved":"primary",t=a.signature?"Signed":"Sign message",r=a.signature||!a.address||a.busy?"disabled":"",l=a.signature?"Wallet signature captured. Receipt is ready for audit.":a.transactionStatus||"Ready for wallet approval.";return`
|
|
1198
|
+
<section class="approval-object signature-stage stage-wallet ${a.signature?"stage-complete":"stage-active"}">
|
|
1199
|
+
<div class="signature-object-head">
|
|
1200
|
+
<div>
|
|
1201
|
+
<h2>Message approval</h2>
|
|
1202
|
+
<p>Wallet-held key approval for a bounded agent message on ${d(Ge(a.cluster))}.</p>
|
|
1203
|
+
</div>
|
|
1204
|
+
<span class="signature-state ${a.signature?"complete":"active"}">${a.signature?"signed":"ready"}</span>
|
|
1205
|
+
</div>
|
|
1206
|
+
|
|
1207
|
+
<div class="signature-capsule">
|
|
1208
|
+
<div class="capsule-main">
|
|
1209
|
+
<span>Request</span>
|
|
1210
|
+
<strong>${d(On)}</strong>
|
|
1211
|
+
<p>Signer: ${d(a.selectedWalletName||"Connected wallet")} • ${d(R(a.address))}</p>
|
|
1212
|
+
</div>
|
|
1213
|
+
<button id="signMessage" class="${e}" ${r}>${t}</button>
|
|
1214
|
+
</div>
|
|
1215
|
+
|
|
1216
|
+
${ol([["Provider",a.wallets.length?`${a.wallets.length} discovered`:"Ready",!0],["Signer",R(a.address),!0],["Approval",a.signature?"Wallet signed":"Waiting for action",!!a.signature],["Receipt",a.txid||a.txSignature?"Available":"Pending",!!(a.txid||a.txSignature)]])}
|
|
1217
|
+
|
|
1218
|
+
${ye?`<details class="advanced-section" ${a.customTransactionBase64||a.txSignature||a.txid?"open":""}>
|
|
1219
|
+
<summary>
|
|
1220
|
+
<span>Advanced transaction tools</span>
|
|
1221
|
+
<strong>${a.cluster==="devnet"?"Devnet memo test":"Paste transaction bytes"}</strong>
|
|
1222
|
+
</summary>
|
|
1223
|
+
<div class="transaction-actions">
|
|
1224
|
+
<div class="transaction-action-row">
|
|
1225
|
+
<button id="createTx" ${!a.address||a.busy||a.cluster!=="devnet"?"disabled":""}>Create demo transaction</button>
|
|
1226
|
+
<button id="signTx" ${!a.address||!a.customTransactionBase64||a.busy?"disabled":""}>Sign transaction</button>
|
|
1227
|
+
<button id="sendTx" ${qc()?"":"disabled"}>Sign and send</button>
|
|
1228
|
+
</div>
|
|
1229
|
+
<label class="field compact transaction-field">
|
|
1230
|
+
<span>Transaction base64</span>
|
|
1231
|
+
<textarea id="txInput" placeholder="Create a demo transaction or paste a transaction, base64 encoded" ${a.busy?"disabled":""}>${d(a.customTransactionBase64)}</textarea>
|
|
1232
|
+
</label>
|
|
1233
|
+
</div>
|
|
1234
|
+
</details>`:""}
|
|
1235
|
+
|
|
1236
|
+
<div class="signature-floor">
|
|
1237
|
+
<div>
|
|
1238
|
+
<span>Status</span>
|
|
1239
|
+
<strong>${d(l)}</strong>
|
|
1240
|
+
</div>
|
|
1241
|
+
${ye?`<button id="airdrop" class="utility" ${!a.address||a.busy||a.cluster!=="devnet"?"disabled":""}>
|
|
1242
|
+
Request devnet SOL
|
|
1243
|
+
</button>`:""}
|
|
1244
|
+
</div>
|
|
1245
|
+
|
|
1246
|
+
${Hc()}
|
|
1247
|
+
${ye?mr():""}
|
|
1248
|
+
${a.error?`<div class="error">${d(a.error)}</div>`:""}
|
|
1249
|
+
</section>
|
|
1250
|
+
`}function cl(){const e=!!a.address,t=a.agentPlan?je(a.agentPlan):!1;return`
|
|
1251
|
+
<section class="approval-object signature-stage stage-agent ${a.agentSignature?"stage-complete":a.agentPlan?"stage-active":"stage-draft"}">
|
|
1252
|
+
<div class="signature-object-head">
|
|
1253
|
+
<div>
|
|
1254
|
+
<h2>Agent planner</h2>
|
|
1255
|
+
<p>Use keyless templates or BYOK AI to draft plans; wallet approval stays separate.</p>
|
|
1256
|
+
</div>
|
|
1257
|
+
<span class="signature-state ${a.agentSignature?"complete":a.agentPlan?"active":""}">${a.agentSignature?"proof signed":a.agentPlan?"plan ready":"draft"}</span>
|
|
1258
|
+
</div>
|
|
1259
|
+
|
|
1260
|
+
${hl()}
|
|
1261
|
+
${vl()}
|
|
1262
|
+
|
|
1263
|
+
${a.agentPlan?Ei(a.agentPlan):li("Plan details","Generate a plan to show route, risk, and approval constraints before signing.")}
|
|
1264
|
+
${Kc()}
|
|
1265
|
+
${a.agentPreparedActionId?`<div class="notice">Queued prepared action: ${d(a.agentPreparedActionId)}</div>`:""}
|
|
1266
|
+
${e?"":'<div class="notice">You can draft plans without a wallet. Connect a wallet only when you are ready to sign an approval proof.</div>'}
|
|
1267
|
+
${a.agentPlan&&!t?'<div class="notice">This template creates a review/proof plan. Queueing is available for SOL transfers, SPL transfers, swaps, and recurring payments.</div>':""}
|
|
1268
|
+
${a.error?`<div class="error">${d(a.error)}</div>`:""}
|
|
1269
|
+
</section>
|
|
1270
|
+
`}function dl(){const e=gi(),t=Ka()??e[0],r=a.generatedPlans.filter(p=>p.status==="archived").length,l=a.generatedPlans.length-r;return`
|
|
1271
|
+
<section class="approval-object signature-stage stage-generated stage-anchor ${a.generatedPlans.length?"stage-active":"stage-draft"}">
|
|
1272
|
+
<div class="signature-object-head">
|
|
1273
|
+
<div>
|
|
1274
|
+
<h2>Generated plans</h2>
|
|
1275
|
+
<p>Review every AI and template draft saved in this browser. Queue only executable actions into Approval Inbox.</p>
|
|
1276
|
+
</div>
|
|
1277
|
+
<div class="generated-plans-toolbar signature-toolbar">
|
|
1278
|
+
<span class="signature-state">${d(`${l} active`)}</span>
|
|
1279
|
+
<button
|
|
1280
|
+
id="toggleArchivedGeneratedPlans"
|
|
1281
|
+
class="utility"
|
|
1282
|
+
${r===0?"disabled":""}
|
|
1283
|
+
>
|
|
1284
|
+
${a.showArchivedGeneratedPlans?"Hide archived":`Show archived (${r})`}
|
|
1285
|
+
</button>
|
|
1286
|
+
</div>
|
|
1287
|
+
</div>
|
|
1288
|
+
|
|
1289
|
+
${ul(e.length,r)}
|
|
1290
|
+
${e.length?`
|
|
1291
|
+
<div class="generated-plans-layout">
|
|
1292
|
+
<div class="generated-plan-list" aria-label="Generated plans">
|
|
1293
|
+
${e.map(p=>pl(p,(t==null?void 0:t.id)===p.id)).join("")}
|
|
1294
|
+
</div>
|
|
1295
|
+
${t?fl(t):br()}
|
|
1296
|
+
</div>
|
|
1297
|
+
`:br()}
|
|
1298
|
+
${a.error?`<div class="error">${d(a.error)}</div>`:""}
|
|
1299
|
+
</section>
|
|
1300
|
+
`}function ul(e,t){return`
|
|
1301
|
+
<div class="queue-status generated-plan-status">
|
|
1302
|
+
<span>${d(`${a.generatedPlans.length} saved`)}</span>
|
|
1303
|
+
<strong>${e} visible</strong>
|
|
1304
|
+
<span>${t} archived</span>
|
|
1305
|
+
<span>Newest first</span>
|
|
1306
|
+
</div>
|
|
1307
|
+
`}function pl(e,t){const r=e.preparedActionId?`Queued ${R(e.preparedActionId)}`:je(e.plan)?"Queueable":"Proof only";return`
|
|
1308
|
+
<article class="generated-plan-row ${t?"selected":""} ${e.status==="archived"?"archived":""}">
|
|
1309
|
+
<button
|
|
1310
|
+
data-generated-plan-action="view"
|
|
1311
|
+
data-generated-plan-id="${d(e.id)}"
|
|
1312
|
+
type="button"
|
|
1313
|
+
${a.busy?"disabled":""}
|
|
1314
|
+
>
|
|
1315
|
+
<span class="generated-plan-row-top">
|
|
1316
|
+
<span class="status-pill ${mi(e)}">${d(Fn(e))}</span>
|
|
1317
|
+
<span>${d(De(e.createdAt))}</span>
|
|
1318
|
+
</span>
|
|
1319
|
+
<strong>${d(e.plan.intent)}</strong>
|
|
1320
|
+
<span>${d(`${Ni(e.plan)} · ${r}`)}</span>
|
|
1321
|
+
</button>
|
|
1322
|
+
</article>
|
|
1323
|
+
`}function fl(e){const t=je(e.plan),r=e.status==="archived",l=!a.address||a.busy||r?"disabled":"",p=!a.address||!a.bridgeActive||!t||a.busy||r?"disabled":"";return`
|
|
1324
|
+
<div class="generated-plan-detail">
|
|
1325
|
+
<div class="generated-plan-detail-head">
|
|
1326
|
+
<div>
|
|
1327
|
+
<span class="workbench-kicker">${d(e.source==="ai"?"AI draft":"Template draft")}</span>
|
|
1328
|
+
<h3>${d(e.plan.templateTitle)}</h3>
|
|
1329
|
+
<p>${d(fc(e))}</p>
|
|
1330
|
+
</div>
|
|
1331
|
+
<span class="status-pill ${mi(e)}">${d(Fn(e))}</span>
|
|
1332
|
+
</div>
|
|
1333
|
+
<div class="generated-plan-actions agent-actions">
|
|
1334
|
+
<button
|
|
1335
|
+
data-generated-plan-action="make-active"
|
|
1336
|
+
data-generated-plan-id="${d(e.id)}"
|
|
1337
|
+
${a.busy?"disabled":""}
|
|
1338
|
+
>
|
|
1339
|
+
Make active
|
|
1340
|
+
</button>
|
|
1341
|
+
<button
|
|
1342
|
+
class="${e.signature?"":"primary"}"
|
|
1343
|
+
data-generated-plan-action="sign-proof"
|
|
1344
|
+
data-generated-plan-id="${d(e.id)}"
|
|
1345
|
+
${l}
|
|
1346
|
+
title="${d(gc(e))}"
|
|
1347
|
+
>
|
|
1348
|
+
Sign proof
|
|
1349
|
+
</button>
|
|
1350
|
+
<button
|
|
1351
|
+
class="utility"
|
|
1352
|
+
data-generated-plan-action="queue"
|
|
1353
|
+
data-generated-plan-id="${d(e.id)}"
|
|
1354
|
+
${p}
|
|
1355
|
+
title="${d(hc(e))}"
|
|
1356
|
+
>
|
|
1357
|
+
Queue approval
|
|
1358
|
+
</button>
|
|
1359
|
+
<button
|
|
1360
|
+
class="utility"
|
|
1361
|
+
data-generated-plan-action="${r?"restore":"archive"}"
|
|
1362
|
+
data-generated-plan-id="${d(e.id)}"
|
|
1363
|
+
${a.busy?"disabled":""}
|
|
1364
|
+
>
|
|
1365
|
+
${r?"Restore":"Archive"}
|
|
1366
|
+
</button>
|
|
1367
|
+
<button
|
|
1368
|
+
class="utility danger"
|
|
1369
|
+
data-generated-plan-action="delete"
|
|
1370
|
+
data-generated-plan-id="${d(e.id)}"
|
|
1371
|
+
${a.busy?"disabled":""}
|
|
1372
|
+
>
|
|
1373
|
+
Delete
|
|
1374
|
+
</button>
|
|
1375
|
+
</div>
|
|
1376
|
+
${Ei(e.plan)}
|
|
1377
|
+
${gl(e)}
|
|
1378
|
+
${a.address?"":'<div class="notice">Connect a wallet when you are ready to sign a review proof for this plan.</div>'}
|
|
1379
|
+
${t?"":'<div class="notice">This draft is a review/proof plan. Queue approval is only available for SOL transfers, SPL transfers, swaps, and recurring payments.</div>'}
|
|
1380
|
+
</div>
|
|
1381
|
+
`}function gl(e){return!e.signature&&!e.preparedActionId?'<div class="empty">Signed proof and queued approval ids appear here after action.</div>':`
|
|
1382
|
+
<div class="results generated-plan-results">
|
|
1383
|
+
${e.signature?`
|
|
1384
|
+
<div class="result-row">
|
|
1385
|
+
<span>Signed proof</span>
|
|
1386
|
+
<code>${d(e.signature)}</code>
|
|
1387
|
+
<button data-copy="${d(e.signature)}" data-copy-name="Signed proof">Copy</button>
|
|
1388
|
+
</div>
|
|
1389
|
+
`:""}
|
|
1390
|
+
${e.preparedActionId?`
|
|
1391
|
+
<div class="result-row">
|
|
1392
|
+
<span>Queued approval</span>
|
|
1393
|
+
<code>${d(e.preparedActionId)}</code>
|
|
1394
|
+
<button data-copy="${d(e.preparedActionId)}" data-copy-name="Queued approval id">Copy</button>
|
|
1395
|
+
</div>
|
|
1396
|
+
`:""}
|
|
1397
|
+
</div>
|
|
1398
|
+
`}function br(){const e=a.generatedPlans.length?"Archived plans are hidden. Show archived to inspect or restore them.":"Generate a template or AI plan from Agent Plan. It will be saved here automatically.";return li("No generated plans visible",e)}function hl(){const e=ha(),t=$i(e),r=ui(),l=a.activeOperation==="generate-template-plan",p=a.activeOperation==="generate-ai-plan";return`
|
|
1399
|
+
<div class="agent-planner-grid">
|
|
1400
|
+
<div class="intent-capsule intent-document-card planner-card ${a.agentPlan?"plan-linked":"draft"}">
|
|
1401
|
+
<div class="intent-document-head">
|
|
1402
|
+
<div>
|
|
1403
|
+
<span>Template planner</span>
|
|
1404
|
+
<h3>${d(e.title)}</h3>
|
|
1405
|
+
</div>
|
|
1406
|
+
<strong>${d(e.category)}</strong>
|
|
1407
|
+
</div>
|
|
1408
|
+
<div class="field compact planner-template-select">
|
|
1409
|
+
<span id="templatePickerLabel">Plan template</span>
|
|
1410
|
+
${yl(e)}
|
|
1411
|
+
</div>
|
|
1412
|
+
<p class="template-description">${d(e.description)}</p>
|
|
1413
|
+
<div class="planner-fields">
|
|
1414
|
+
${e.fields.map(wl).join("")}
|
|
1415
|
+
</div>
|
|
1416
|
+
<label class="intent-document planner-prompt">
|
|
1417
|
+
<span>${t?"Custom request / notes":"User notes / instructions"}${t?" *":""}</span>
|
|
1418
|
+
<textarea id="agentPrompt" placeholder="${t?"Describe what you want prepared or reviewed.":"Optional context, reason, policy note, or instruction for this approval record."}" ${a.busy?"disabled":""}>${d(a.agentPrompt)}</textarea>
|
|
1419
|
+
</label>
|
|
1420
|
+
<div class="intent-policy-strip">
|
|
1421
|
+
<span>Approval rule</span>
|
|
1422
|
+
<p>Templates create one-off approval plans without the bridge. The inbox and recurring approvals require the local bridge.</p>
|
|
1423
|
+
</div>
|
|
1424
|
+
<div class="agent-actions signature-actions intent-document-actions">
|
|
1425
|
+
<button id="generatePlan" class="${a.agentPlan?"":"primary"}" ${a.busy?"disabled":""}>${l?`${Tr()}Generating...`:"Generate template plan"}</button>
|
|
1426
|
+
<button id="generateAiPlan" class="${r?"primary":""}" ${!r||a.busy?"disabled":""} title="${r?"Generate through your configured AI key.":"Add a hosted/session key or configure local bridge AI first."}">${p?`${Tr()}Generating...`:"Generate with AI"}</button>
|
|
1427
|
+
<button id="signAgentPlan" class="${a.agentPlan?"primary":""}" ${!a.address||!a.agentPlan||a.busy?"disabled":""} title="${a.address?a.agentPlan?"":"Generate a plan before signing approval.":"Connect a wallet before signing."}">Sign proof</button>
|
|
1428
|
+
<button id="queueAgentPlan" class="utility" ${!a.address||!a.agentPlan||!a.bridgeActive||!je(a.agentPlan)||a.busy?"disabled":""} title="${Oc()}">Queue approval</button>
|
|
1429
|
+
</div>
|
|
1430
|
+
</div>
|
|
1431
|
+
${ml()}
|
|
1432
|
+
</div>
|
|
1433
|
+
`}function ml(){const e=Al(),r=a.aiSettingsPanelOpen??(e&&!bl())?"open":"";return`
|
|
1434
|
+
<details class="ai-settings-panel ${e?"configured":"optional"}" ${r}>
|
|
1435
|
+
<summary>
|
|
1436
|
+
<span class="ai-summary-copy">
|
|
1437
|
+
<span>Optional AI Agent</span>
|
|
1438
|
+
<em>Use BYOK AI for drafts; templates work without it.</em>
|
|
1439
|
+
</span>
|
|
1440
|
+
<strong>${e?"configured":"not configured"}</strong>
|
|
1441
|
+
</summary>
|
|
1442
|
+
${xl()}
|
|
1443
|
+
</details>
|
|
1444
|
+
`}function bl(){return window.matchMedia("(max-width: 700px)").matches}function vl(){return`
|
|
1445
|
+
<aside class="agent-path-explainer" aria-label="Template and connected agent paths">
|
|
1446
|
+
<div>
|
|
1447
|
+
<span>Templates</span>
|
|
1448
|
+
<p>Pick an action, fill fields and notes, then generate a keyless approval record. No AI key, Claude, Codex, or MCP required.</p>
|
|
1449
|
+
</div>
|
|
1450
|
+
<div>
|
|
1451
|
+
<span>Connected agent</span>
|
|
1452
|
+
<p>Claude, Codex, MCP, or Solana Agent Kit can prepare richer requests through the local bridge. Your wallet still signs.</p>
|
|
1453
|
+
</div>
|
|
1454
|
+
<div>
|
|
1455
|
+
<span>Always true</span>
|
|
1456
|
+
<p>Agentic never receives a private key. Templates and agents both end in explicit wallet approval.</p>
|
|
1457
|
+
</div>
|
|
1458
|
+
</aside>
|
|
1459
|
+
`}function yl(e){const t=vr(e);return`
|
|
1460
|
+
<div class="template-picker" data-template-picker>
|
|
1461
|
+
<button
|
|
1462
|
+
id="templatePickerButton"
|
|
1463
|
+
class="template-picker-trigger"
|
|
1464
|
+
type="button"
|
|
1465
|
+
aria-haspopup="listbox"
|
|
1466
|
+
aria-expanded="false"
|
|
1467
|
+
aria-labelledby="templatePickerLabel templatePickerValue"
|
|
1468
|
+
${a.busy?"disabled":""}
|
|
1469
|
+
>
|
|
1470
|
+
<span class="template-picker-current">
|
|
1471
|
+
<span class="template-picker-category">${d(Da(e.category))}</span>
|
|
1472
|
+
<strong id="templatePickerValue">${d(e.title)}</strong>
|
|
1473
|
+
</span>
|
|
1474
|
+
<span class="template-picker-caret" aria-hidden="true"></span>
|
|
1475
|
+
</button>
|
|
1476
|
+
<div
|
|
1477
|
+
id="templatePickerMenu"
|
|
1478
|
+
class="template-picker-menu"
|
|
1479
|
+
role="listbox"
|
|
1480
|
+
aria-labelledby="templatePickerLabel"
|
|
1481
|
+
hidden
|
|
1482
|
+
>
|
|
1483
|
+
${Cn.map(r=>{const l=r.id===e.id;return`
|
|
1484
|
+
<button
|
|
1485
|
+
id="template-option-${d(r.id)}"
|
|
1486
|
+
class="template-picker-option ${l?"selected":""}"
|
|
1487
|
+
type="button"
|
|
1488
|
+
role="option"
|
|
1489
|
+
aria-selected="${l?"true":"false"}"
|
|
1490
|
+
data-template-option="${d(r.id)}"
|
|
1491
|
+
title="${d(vr(r))}"
|
|
1492
|
+
>
|
|
1493
|
+
<span>${d(Da(r.category))}</span>
|
|
1494
|
+
<strong>${d(r.title)}</strong>
|
|
1495
|
+
</button>
|
|
1496
|
+
`}).join("")}
|
|
1497
|
+
</div>
|
|
1498
|
+
<span class="template-picker-sr">${d(t)}</span>
|
|
1499
|
+
</div>
|
|
1500
|
+
`}function vr(e){return`${Da(e.category)} - ${e.title}`}function wl(e){var l;const t=Nc(e.id),r=a.busy?"disabled":"";return e.type==="textarea"||e.id==="policy"?`
|
|
1501
|
+
<label class="field compact planner-field">
|
|
1502
|
+
<span>${d(e.label)}</span>
|
|
1503
|
+
<textarea data-template-field="${d(e.id)}" placeholder="${d(e.placeholder??"")}" ${r}>${d(t)}</textarea>
|
|
1504
|
+
</label>
|
|
1505
|
+
`:e.type==="select"&&((l=e.options)!=null&&l.length)?`
|
|
1506
|
+
<label class="field compact planner-field">
|
|
1507
|
+
<span>${d(e.label)}</span>
|
|
1508
|
+
<select data-template-field="${d(e.id)}" ${r}>
|
|
1509
|
+
${e.options.map(p=>`<option value="${d(p)}" ${p===t?"selected":""}>${d(p)}</option>`).join("")}
|
|
1510
|
+
</select>
|
|
1511
|
+
</label>
|
|
1512
|
+
`:`
|
|
1513
|
+
<label class="field compact planner-field">
|
|
1514
|
+
<span>${d(e.label)}</span>
|
|
1515
|
+
<input data-template-field="${d(e.id)}" value="${d(t)}" placeholder="${d(e.placeholder??"")}" ${r} />
|
|
1516
|
+
</label>
|
|
1517
|
+
`}function xl(){const e=a.aiStatus,t=nt(a.aiSettings.provider),r=So(a.aiSettings.apiFormat),l=t.id==="custom-openai-compatible",p=Sl(),x=!t.models.find(pe=>pe.id===a.aiSettings.model),G=$l(e),ne=a.aiSettings.mode==="bridge"?"Bridge session key":a.aiSettings.mode==="hosted"?"Hosted request key":"Browser session key",ue=a.aiSettings.mode==="hosted"?"Hosted BYOK relays your key to the selected provider for this request only. Agentic does not store it.":a.aiSettings.mode==="bridge"?"The local bridge keeps the key in process memory and calls the provider from your machine.":"Browser session keys stay in this browser tab only and require a browser-compatible provider or gateway.";return`
|
|
1518
|
+
<aside class="ai-settings-card">
|
|
1519
|
+
<div>
|
|
1520
|
+
<span class="workbench-kicker">Connect AI Agent</span>
|
|
1521
|
+
<h3>AI key stays out of Agentic custody</h3>
|
|
1522
|
+
<p>${d(ue)}</p>
|
|
1523
|
+
</div>
|
|
1524
|
+
<label class="field compact">
|
|
1525
|
+
<span>AI path</span>
|
|
1526
|
+
<select id="aiMode" ${a.busy?"disabled":""}>
|
|
1527
|
+
<option value="hosted" ${a.aiSettings.mode==="hosted"?"selected":""}>Hosted BYOK</option>
|
|
1528
|
+
<option value="bridge" ${a.aiSettings.mode==="bridge"?"selected":""}>Local bridge</option>
|
|
1529
|
+
<option value="session" ${a.aiSettings.mode==="session"?"selected":""}>Browser session only</option>
|
|
1530
|
+
</select>
|
|
1531
|
+
</label>
|
|
1532
|
+
<label class="field compact">
|
|
1533
|
+
<span>Provider preset</span>
|
|
1534
|
+
<select id="aiProvider" ${a.busy?"disabled":""}>
|
|
1535
|
+
${p.map(pe=>`
|
|
1536
|
+
<option value="${d(pe.id)}" ${pe.id===a.aiSettings.provider?"selected":""}>
|
|
1537
|
+
${d(pe.label)}
|
|
1538
|
+
</option>
|
|
1539
|
+
`).join("")}
|
|
1540
|
+
</select>
|
|
1541
|
+
</label>
|
|
1542
|
+
<label class="field compact">
|
|
1543
|
+
<span>Model</span>
|
|
1544
|
+
<select id="aiModelSelect" ${a.busy?"disabled":""}>
|
|
1545
|
+
${t.models.map(pe=>`
|
|
1546
|
+
<option value="${d(pe.id)}" ${pe.id===a.aiSettings.model?"selected":""}>
|
|
1547
|
+
${d(pe.label)}
|
|
1548
|
+
</option>
|
|
1549
|
+
`).join("")}
|
|
1550
|
+
<option value="${Vr}" ${x?"selected":""}>Custom model</option>
|
|
1551
|
+
</select>
|
|
1552
|
+
</label>
|
|
1553
|
+
${x?`
|
|
1554
|
+
<label class="field compact">
|
|
1555
|
+
<span>Custom model</span>
|
|
1556
|
+
<input id="aiModelCustom" value="${d(a.aiSettings.model)}" placeholder="${d(t.model)}" ${a.busy?"disabled":""} />
|
|
1557
|
+
</label>
|
|
1558
|
+
`:""}
|
|
1559
|
+
${l?`
|
|
1560
|
+
<label class="field compact">
|
|
1561
|
+
<span>Gateway URL</span>
|
|
1562
|
+
<input id="aiBaseUrl" value="${d(a.aiSettings.baseUrl)}" placeholder="${d(t.baseUrl)}" ${a.busy?"disabled":""} />
|
|
1563
|
+
</label>
|
|
1564
|
+
`:""}
|
|
1565
|
+
<label class="field compact">
|
|
1566
|
+
<span>${d(ne)}</span>
|
|
1567
|
+
<input id="aiApiKey" type="password" value="${d(a.aiSettings.apiKey)}" placeholder="Not saved by default" autocomplete="off" ${a.busy?"disabled":""} />
|
|
1568
|
+
</label>
|
|
1569
|
+
<div class="ai-actions">
|
|
1570
|
+
${a.aiSettings.mode==="bridge"?`<button id="saveBridgeAiKey" ${ci()?"":"disabled"}>Set bridge key</button>`:""}
|
|
1571
|
+
<button id="clearAiKey" ${di()?"":"disabled"}>Clear key</button>
|
|
1572
|
+
${a.aiSettings.mode==="bridge"?`<button id="refreshAiStatus" ${a.busy?"disabled":""}>Refresh</button>`:""}
|
|
1573
|
+
</div>
|
|
1574
|
+
<div class="ai-status-line">
|
|
1575
|
+
<span>AI route</span>
|
|
1576
|
+
<strong>${d(G)}</strong>
|
|
1577
|
+
</div>
|
|
1578
|
+
<div class="ai-status-line">
|
|
1579
|
+
<span>Format</span>
|
|
1580
|
+
<strong>${d(r)}</strong>
|
|
1581
|
+
</div>
|
|
1582
|
+
<p class="ai-security-note">No AI can sign, submit, or approve. It only drafts a structured plan for your wallet review.</p>
|
|
1583
|
+
</aside>
|
|
1584
|
+
`}function ci(){return a.aiSettings.mode==="bridge"&&!!a.aiSettings.apiKey.trim()&&!!a.aiSettings.model.trim()&&jn()&&!a.busy}function di(){var e;return!!(a.aiSettings.apiKey.trim()||a.aiSettings.mode==="bridge"&&((e=a.aiStatus)!=null&&e.available))}function ui(){var t;const e=!!a.aiSettings.model.trim();return a.aiSettings.mode==="bridge"?!!((t=a.aiStatus)!=null&&t.available&&!a.busy):!!(a.aiSettings.apiKey.trim()&&e&&jn()&&!a.busy)}function Al(){var t;const e=!!a.aiSettings.model.trim();return a.aiSettings.mode==="bridge"?!!((t=a.aiStatus)!=null&&t.available):!!(a.aiSettings.apiKey.trim()&&e&&jn())}function jn(){const e=nt(a.aiSettings.provider);return a.aiSettings.mode==="session"&&e.id==="openai"?!1:a.aiSettings.mode==="hosted"?e.id!=="custom-openai-compatible":e.id!=="custom-openai-compatible"||!!a.aiSettings.baseUrl.trim()}function Sl(){return a.aiSettings.mode==="hosted"?ua.filter(e=>e.id!=="custom-openai-compatible"):ua}function $l(e){return a.aiSettings.mode==="hosted"?a.aiSettings.apiKey.trim()?`hosted - ${a.aiSettings.provider} - ${a.aiSettings.model||"model configured"}`:"hosted - key required":a.aiSettings.mode==="session"?a.aiSettings.provider==="openai"?"browser - OpenAI requires hosted or bridge":a.aiSettings.apiKey.trim()?`browser - ${a.aiSettings.provider} - ${a.aiSettings.model||"model configured"}`:"browser - key required":e!=null&&e.available?`${e.source} - ${e.provider??e.apiFormat??"AI"} - ${e.model??"model configured"}`:"bridge - not configured"}function kl(){if(a.aiSettings.mode!=="hosted"||a.aiSettings.provider!=="custom-openai-compatible")return;const e=nt(_n);a.aiSettings.provider=e.id,a.aiSettings.apiFormat=e.apiFormat,a.aiSettings.baseUrl=e.baseUrl,a.aiSettings.model=e.model}function Sn(){const e=document.querySelector("#saveBridgeAiKey"),t=document.querySelector("#clearAiKey"),r=document.querySelector("#generateAiPlan"),l=ui();e&&(e.disabled=!ci()),t&&(t.disabled=!di()),r&&(r.disabled=!l,r.classList.toggle("primary",l),r.title=l?"Generate through your configured AI key.":"Add a hosted/session key or configure local bridge AI first.")}function Pl(){if(!a.address)return Ya("Approval inbox","Connect a wallet before reviewing prepared actions from the local bridge.");const e=Oi();return`
|
|
1585
|
+
<section class="approval-object signature-stage stage-inbox stage-anchor ${a.preparedActions.length?"stage-active":"stage-draft"}">
|
|
1586
|
+
<div class="signature-object-head">
|
|
1587
|
+
<div>
|
|
1588
|
+
<h2>Approval inbox</h2>
|
|
1589
|
+
<p>Actions wait here until policy, intent, and wallet approval are all visible.</p>
|
|
1590
|
+
</div>
|
|
1591
|
+
<div class="inbox-toolbar signature-toolbar">
|
|
1592
|
+
<select id="inboxFilter">
|
|
1593
|
+
${Ze("all","All")}
|
|
1594
|
+
${Ze("ready","Ready")}
|
|
1595
|
+
${Ze("scheduled","Scheduled")}
|
|
1596
|
+
${Ze("approved","Approved")}
|
|
1597
|
+
${Ze("failed","Failed")}
|
|
1598
|
+
${Ze("rejected","Rejected")}
|
|
1599
|
+
${Ze("one-time","One-time")}
|
|
1600
|
+
${Ze("recurring","Recurring")}
|
|
1601
|
+
</select>
|
|
1602
|
+
<button id="refreshInbox" class="utility" ${!a.bridgeActive||a.busy?"disabled":""} title="${a.bridgeActive?"":"Connect the bridge to refresh prepared approvals."}">Refresh</button>
|
|
1603
|
+
</div>
|
|
1604
|
+
</div>
|
|
1605
|
+
|
|
1606
|
+
${Vc(e.length)}
|
|
1607
|
+
${Zc(e)}
|
|
1608
|
+
${a.error?`<div class="error">${d(a.error)}</div>`:""}
|
|
1609
|
+
</section>
|
|
1610
|
+
`}function Cl(){return a.address?`
|
|
1611
|
+
<section class="approval-object signature-stage stage-schedule stage-anchor ${a.recurringPayments.length?"stage-active":"stage-draft"}">
|
|
1612
|
+
<div class="signature-object-head">
|
|
1613
|
+
<div>
|
|
1614
|
+
<h2>Create recurring approval</h2>
|
|
1615
|
+
<p>Define recurring requests. Each occurrence still lands in Approval Inbox for wallet review.</p>
|
|
1616
|
+
</div>
|
|
1617
|
+
<button id="refreshInbox" class="utility" ${!a.bridgeActive||a.busy?"disabled":""} title="${a.bridgeActive?"":"Connect the bridge to refresh recurring approvals."}">Refresh</button>
|
|
1618
|
+
</div>
|
|
1619
|
+
|
|
1620
|
+
${Jc()}
|
|
1621
|
+
${ed()}
|
|
1622
|
+
${td()}
|
|
1623
|
+
${a.error?`<div class="error">${d(a.error)}</div>`:""}
|
|
1624
|
+
</section>
|
|
1625
|
+
`:Ya("Create recurring approval","Connect a wallet before creating recurring approval requests.")}function Tl(){const e=Xa(),t=Ui(e.id),r=a.labArtifacts,l=a.artifactView==="signed"?r.length>0:!!t,p=a.artifactView==="signed"?`Review wallet-signed audit records saved on this device${a.bridgeActive?" and mirrored to the local bridge archive":""}.`:"Create a signed record that binds request intent, policy interpretation, wallet identity, and local verification.";return`
|
|
1626
|
+
<section class="approval-object signature-stage stage-labs stage-anchor ${l?"stage-complete":"stage-draft"}">
|
|
1627
|
+
<div class="signature-object-head artifact-workspace-head">
|
|
1628
|
+
<div>
|
|
1629
|
+
<h2>Artifacts</h2>
|
|
1630
|
+
<p>${d(p)}</p>
|
|
1631
|
+
</div>
|
|
1632
|
+
${Ll()}
|
|
1633
|
+
</div>
|
|
1634
|
+
|
|
1635
|
+
${a.artifactView==="signed"?El():Il()}
|
|
1636
|
+
${a.error?`<div class="error">${d(a.error)}</div>`:""}
|
|
1637
|
+
</section>
|
|
1638
|
+
`}function Ll(){return`
|
|
1639
|
+
<div class="tabs compact-tabs artifact-view-tabs" role="tablist" aria-label="Artifact views">
|
|
1640
|
+
${yr("create","Create Artifact")}
|
|
1641
|
+
${yr("signed","Signed Artifacts")}
|
|
1642
|
+
</div>
|
|
1643
|
+
`}function yr(e,t){const r=a.artifactView===e;return`
|
|
1644
|
+
<button
|
|
1645
|
+
data-artifact-view="${e}"
|
|
1646
|
+
class="${r?"active":""}"
|
|
1647
|
+
role="tab"
|
|
1648
|
+
aria-selected="${r?"true":"false"}"
|
|
1649
|
+
type="button"
|
|
1650
|
+
>
|
|
1651
|
+
${d(t)}
|
|
1652
|
+
</button>
|
|
1653
|
+
`}function Il(){if(!a.address)return Ya("Create artifact","Connect a wallet before creating signed audit artifacts.");const e=Xa(),t=Ui(e.id);return`
|
|
1654
|
+
<div class="lab-panel lab-workbench">
|
|
1655
|
+
<div class="artifact-create-status">
|
|
1656
|
+
<span class="signature-state">${d(vd())}</span>
|
|
1657
|
+
</div>
|
|
1658
|
+
${Rl(e)}
|
|
1659
|
+
<div class="lab-workbench-grid">
|
|
1660
|
+
<div class="lab-copy research-brief">
|
|
1661
|
+
<span class="workbench-kicker">Definition</span>
|
|
1662
|
+
<h3>${d(e.title.replace(/^\d+\.\s*/,""))}</h3>
|
|
1663
|
+
<p>${d(e.description)}</p>
|
|
1664
|
+
<div class="capabilities compact-caps">
|
|
1665
|
+
<span>${d(en(e.kind))}</span>
|
|
1666
|
+
<span>${t?"artifact ready":"awaiting signature"}</span>
|
|
1667
|
+
</div>
|
|
1668
|
+
</div>
|
|
1669
|
+
|
|
1670
|
+
<label class="field agent-prompt lab-intent-document">
|
|
1671
|
+
<span>Agent intent</span>
|
|
1672
|
+
<textarea id="labInput" ${a.busy?"disabled":""}>${d(Di(e.id))}</textarea>
|
|
1673
|
+
</label>
|
|
1674
|
+
</div>
|
|
1675
|
+
|
|
1676
|
+
<div class="lab-actions lab-signature-action">
|
|
1677
|
+
<button id="createLabArtifact" class="primary" ${!a.address||a.busy?"disabled":""}>Create signed artifact</button>
|
|
1678
|
+
<span>The next wallet approval creates a locally verified audit artifact.</span>
|
|
1679
|
+
</div>
|
|
1680
|
+
|
|
1681
|
+
${t?nd(t):Bl()}
|
|
1682
|
+
</div>
|
|
1683
|
+
`}function El(){const e=a.labArtifacts;return`
|
|
1684
|
+
<div class="lab-panel signed-artifacts-panel">
|
|
1685
|
+
<div class="inbox-toolbar signature-toolbar artifact-archive-toolbar">
|
|
1686
|
+
<span class="signature-state">${d(`${e.length} artifact${e.length===1?"":"s"}`)}</span>
|
|
1687
|
+
<button id="refreshLabArtifacts" class="utility" ${a.busy?"disabled":""}>Refresh</button>
|
|
1688
|
+
</div>
|
|
1689
|
+
${_l()}
|
|
1690
|
+
${e.length?Ol(e):Nl()}
|
|
1691
|
+
</div>
|
|
1692
|
+
`}function _l(){var t;const e=a.bridgeActive?(t=a.health)!=null&&t.labArtifactStorePath?`Bridge file: ${a.health.labArtifactStorePath}`:"Bridge archive connected":"Bridge archive unavailable";return`
|
|
1693
|
+
<div class="artifact-archive-status">
|
|
1694
|
+
<span>${d(a.labArchiveStatus)}</span>
|
|
1695
|
+
<strong>${d(e)}</strong>
|
|
1696
|
+
</div>
|
|
1697
|
+
`}function Nl(){return`
|
|
1698
|
+
<div class="empty lab-empty-state">
|
|
1699
|
+
<span>No signed artifacts</span>
|
|
1700
|
+
<h3>Archive is empty</h3>
|
|
1701
|
+
<p>Use Create Artifact to add the first wallet-bound record.</p>
|
|
1702
|
+
</div>
|
|
1703
|
+
`}function Ol(e){return`
|
|
1704
|
+
<div class="signed-artifact-list">
|
|
1705
|
+
${e.map(t=>Ml(t)).join("")}
|
|
1706
|
+
</div>
|
|
1707
|
+
`}function Ml(e){return`
|
|
1708
|
+
<article class="signed-artifact-row">
|
|
1709
|
+
<div class="signed-artifact-main">
|
|
1710
|
+
<div class="artifact-meta-line">
|
|
1711
|
+
<span class="status-pill ${e.verified?"tx-confirmed":"tx-pending"}">${e.verified?"verified":"signed"}</span>
|
|
1712
|
+
<span>${d(en(e.kind))}</span>
|
|
1713
|
+
</div>
|
|
1714
|
+
<h3>${d(e.title)}</h3>
|
|
1715
|
+
<p>${d(e.payload.thesis)}</p>
|
|
1716
|
+
</div>
|
|
1717
|
+
<div class="signed-artifact-facts">
|
|
1718
|
+
${Ue("Created",De(e.createdAt))}
|
|
1719
|
+
${Ue("Wallet",R(e.walletAddress))}
|
|
1720
|
+
${Ue("Cluster",Ge(e.cluster))}
|
|
1721
|
+
${Ue("Artifact",R(e.artifactHash))}
|
|
1722
|
+
</div>
|
|
1723
|
+
<div class="signed-artifact-actions">
|
|
1724
|
+
<button data-copy="${d(Fe(e))}" data-copy-name="Artifact JSON">Copy JSON</button>
|
|
1725
|
+
<button data-copy="${d(e.signingMessage)}" data-copy-name="Signing payload">Copy Payload</button>
|
|
1726
|
+
</div>
|
|
1727
|
+
<details class="artifact-technical-details signed-artifact-details">
|
|
1728
|
+
<summary>
|
|
1729
|
+
<span>Full artifact</span>
|
|
1730
|
+
<strong>Creation details and evidence</strong>
|
|
1731
|
+
</summary>
|
|
1732
|
+
${Wl(e)}
|
|
1733
|
+
</details>
|
|
1734
|
+
</article>
|
|
1735
|
+
`}function Ue(e,t){return`
|
|
1736
|
+
<div>
|
|
1737
|
+
<span>${d(e)}</span>
|
|
1738
|
+
<strong>${d(t)}</strong>
|
|
1739
|
+
</div>
|
|
1740
|
+
`}function Wl(e){return`
|
|
1741
|
+
<div class="artifact-detail-grid">
|
|
1742
|
+
${Ue("Artifact type",e.title)}
|
|
1743
|
+
${Ue("Kind",en(e.kind))}
|
|
1744
|
+
${Ue("Created",De(e.createdAt))}
|
|
1745
|
+
${Ue("Cluster",Ge(e.cluster))}
|
|
1746
|
+
${Ue("Wallet",e.walletAddress)}
|
|
1747
|
+
${Ue("Artifact hash",e.artifactHash)}
|
|
1748
|
+
</div>
|
|
1749
|
+
<div class="artifact-intent-block">
|
|
1750
|
+
<span>Agent intent</span>
|
|
1751
|
+
<p>${d(e.input)}</p>
|
|
1752
|
+
</div>
|
|
1753
|
+
<div class="artifact-evidence-row">
|
|
1754
|
+
${Ot(e,"Decision")}
|
|
1755
|
+
${Ot(e,"Custody")}
|
|
1756
|
+
${Ot(e,"Settlement")}
|
|
1757
|
+
</div>
|
|
1758
|
+
<div class="artifact-evidence-list">
|
|
1759
|
+
${e.payload.evidence.map(t=>`
|
|
1760
|
+
<div class="${d(t.tone)}">
|
|
1761
|
+
<span>${d(t.title)}</span>
|
|
1762
|
+
<p>${d(t.detail)}</p>
|
|
1763
|
+
<code>${d(R(t.hash))}</code>
|
|
1764
|
+
</div>
|
|
1765
|
+
`).join("")}
|
|
1766
|
+
</div>
|
|
1767
|
+
<div class="hash-grid">
|
|
1768
|
+
${tt("Pre-signature",e.preSignatureHash)}
|
|
1769
|
+
${tt("Artifact",e.artifactHash)}
|
|
1770
|
+
${tt("Signature",e.signature)}
|
|
1771
|
+
${tt("Wallet",e.walletAddress)}
|
|
1772
|
+
</div>
|
|
1773
|
+
`}function Rl(e){return`
|
|
1774
|
+
<label class="field compact lab-select-field">
|
|
1775
|
+
<span>Artifact type</span>
|
|
1776
|
+
<select id="labSelect" ${a.busy?"disabled":""}>
|
|
1777
|
+
${qe.map(t=>`<option value="${d(t.id)}" ${t.id===e.id?"selected":""}>${d(t.title)}</option>`).join("")}
|
|
1778
|
+
</select>
|
|
1779
|
+
</label>
|
|
1780
|
+
`}function Bl(){return`
|
|
1781
|
+
<div class="empty lab-empty-state">
|
|
1782
|
+
<span>No artifact yet</span>
|
|
1783
|
+
<h3>Signed artifact required</h3>
|
|
1784
|
+
<p>The next wallet approval will bind the selected artifact type, request, wallet, cluster, and local verification result.</p>
|
|
1785
|
+
</div>
|
|
1786
|
+
`}function Ul(){const e=a.labArtifacts[0],t=a.busy?"Waiting on wallet response":a.address?a.activeTab==="agent"&&!a.agentPlan?"Generate an agent plan":a.activeTab==="generated"?"Review generated plans":a.activeTab==="inbox"?"Review queued approvals":a.activeTab==="schedule"?"Create recurring approval":a.activeTab==="labs"&&a.artifactView==="signed"?"Review signed artifacts":a.activeTab==="labs"?"Create an artifact":"Review current request":"Connect a wallet";return`
|
|
1787
|
+
<aside class="panel context-panel evidence-panel">
|
|
1788
|
+
<div class="evidence-header">
|
|
1789
|
+
<h2>${a.address?"Wallet connected":"Wallet required"}</h2>
|
|
1790
|
+
<p>${d(t)}</p>
|
|
1791
|
+
</div>
|
|
1792
|
+
<div class="evidence-rail" aria-label="Approval evidence">
|
|
1793
|
+
${Xe("Intent",Mi(),et("intent"))}
|
|
1794
|
+
${Xe("Policy",Wi(),et("policy"))}
|
|
1795
|
+
${Xe("Wallet",Ri(),et("wallet"))}
|
|
1796
|
+
${Xe("Receipt",Bi(e),et("receipt"))}
|
|
1797
|
+
</div>
|
|
1798
|
+
<details class="evidence-details">
|
|
1799
|
+
<summary>Runtime details</summary>
|
|
1800
|
+
<div class="context-stack compact-context">
|
|
1801
|
+
${ht("Wallet",a.address?R(a.address):"Not connected",a.address?"good":"")}
|
|
1802
|
+
${ht("Cluster",Ge(a.cluster),a.cluster==="mainnet-beta"?"warn":"")}
|
|
1803
|
+
${ht("Bridge",a.bridgeActive?"Ready":"Disconnected",a.bridgeActive?"good":"")}
|
|
1804
|
+
${ht("MCP inbox",`${a.preparedActions.filter(r=>!r.archived).length} action(s)`,a.preparedActions.length?"warn":"")}
|
|
1805
|
+
${ht("Agent proof",a.agentSignature?R(a.agentSignature):"Unsigned")}
|
|
1806
|
+
${ht("Last tx",a.txid?R(a.txid):bd())}
|
|
1807
|
+
${ht("Latest lab",e?R(e.artifactHash):"No artifact")}
|
|
1808
|
+
</div>
|
|
1809
|
+
</details>
|
|
1810
|
+
<div class="custody-manifest">
|
|
1811
|
+
<h3>Signing boundary</h3>
|
|
1812
|
+
<p>Agents can prepare intent, policy, simulation, receipts, and transaction bytes. A wallet approval is still required before signing.</p>
|
|
1813
|
+
</div>
|
|
1814
|
+
</aside>
|
|
1815
|
+
`}function Dl(){const e=a.labArtifacts[0],t=a.preparedActions.filter(l=>!l.archived).length;return!!a.address||t>0||!!a.agentPlan||!!a.agentSignature||!!a.signature||!!a.txid||!!e?`
|
|
1816
|
+
<details class="panel public-request-context evidence-details">
|
|
1817
|
+
<summary>Request context</summary>
|
|
1818
|
+
<div class="evidence-rail" aria-label="Approval evidence">
|
|
1819
|
+
${Xe("Intent",Mi(),et("intent"))}
|
|
1820
|
+
${Xe("Policy",Wi(),et("policy"))}
|
|
1821
|
+
${Xe("Wallet",Ri(),et("wallet"))}
|
|
1822
|
+
${Xe("Receipt",Bi(e),et("receipt"))}
|
|
1823
|
+
</div>
|
|
1824
|
+
<div class="custody-manifest compact-manifest">
|
|
1825
|
+
<h3>Signing boundary</h3>
|
|
1826
|
+
<p>Agents can prepare intent, policy, simulation, receipts, and transaction bytes. A wallet approval is still required before signing.</p>
|
|
1827
|
+
</div>
|
|
1828
|
+
</details>
|
|
1829
|
+
`:""}function ql(){var e,t,r,l,p,b,x,G,ne,ue,pe,xe,it,bt,qt,vt,jt,yt,xa,Aa,ot,st,Be,Ft,Gt,Yt,wt,lt,xt,Ht,At,St,Oe,$t,Ye,He,zt,Kt,kt,Ie,Ee,X,Ce,Vt,Jt,ct,dt,Zt,ut;jl(),Fl();for(const k of document.querySelectorAll("[data-tab]"))k.addEventListener("click",()=>{a.activeTab=k.dataset.tab,a.activeTab==="labs"&&(a.artifactView="create"),a.error="",ee()});(e=document.querySelector("#discover"))==null||e.addEventListener("click",xr),(t=document.querySelector("#connect"))==null||t.addEventListener("click",Ar),(r=document.querySelector("#disconnect"))==null||r.addEventListener("click",Gl),(l=document.querySelector("#androidReconnectCached"))==null||l.addEventListener("click",Yl),(p=document.querySelector("#androidClearTransient"))==null||p.addEventListener("click",Hl),(b=document.querySelector("#androidFullReset"))==null||b.addEventListener("click",zl),(x=document.querySelector("#androidClearAllAccounts"))==null||x.addEventListener("click",Kl),(G=document.querySelector("#iosReconnectCached"))==null||G.addEventListener("click",Vl),(ne=document.querySelector("#iosClearTransient"))==null||ne.addEventListener("click",Jl),(ue=document.querySelector("#iosFullReset"))==null||ue.addEventListener("click",Zl),(pe=document.querySelector("#iosClearAllAccounts"))==null||pe.addEventListener("click",Ql),(xe=document.querySelector("#signMessage"))==null||xe.addEventListener("click",Xl),(it=document.querySelector("#airdrop"))==null||it.addEventListener("click",ec),(bt=document.querySelector("#createTx"))==null||bt.addEventListener("click",tc),(qt=document.querySelector("#signTx"))==null||qt.addEventListener("click",ac),(vt=document.querySelector("#sendTx"))==null||vt.addEventListener("click",nc),(jt=document.querySelector("#generatePlan"))==null||jt.addEventListener("click",rc),(yt=document.querySelector("#generateAiPlan"))==null||yt.addEventListener("click",ic),(xa=document.querySelector("#signAgentPlan"))==null||xa.addEventListener("click",oc),(Aa=document.querySelector("#queueAgentPlan"))==null||Aa.addEventListener("click",sc),(ot=document.querySelector("#toggleArchivedGeneratedPlans"))==null||ot.addEventListener("click",()=>{a.showArchivedGeneratedPlans=!a.showArchivedGeneratedPlans,a.error="",ee()});for(const k of document.querySelectorAll("[data-generated-plan-action]"))k.addEventListener("click",()=>{const U=k.dataset.generatedPlanAction,Ae=k.dataset.generatedPlanId;!U||!Ae||lc(Ae,U)});(st=document.querySelector("#saveBridgeAiKey"))==null||st.addEventListener("click",bc),(Be=document.querySelector("#clearAiKey"))==null||Be.addEventListener("click",vc),(Ft=document.querySelector("#refreshAiStatus"))==null||Ft.addEventListener("click",yc),(Gt=document.querySelector(".ai-settings-panel"))==null||Gt.addEventListener("toggle",k=>{a.aiSettingsPanelOpen=k.currentTarget.open}),(Yt=document.querySelector("#connectBridge"))==null||Yt.addEventListener("click",xc),(wt=document.querySelector("#disconnectBridge"))==null||wt.addEventListener("click",Ac),(lt=document.querySelector("#refreshInbox"))==null||lt.addEventListener("click",Sc),(xt=document.querySelector("#createRecurring"))==null||xt.addEventListener("click",$c),(Ht=document.querySelector("#createLabArtifact"))==null||Ht.addEventListener("click",Cc),(At=document.querySelector("#refreshLabArtifacts"))==null||At.addEventListener("click",Tc),(St=document.querySelector("#openAndroidMwaTest"))==null||St.addEventListener("click",ji);for(const k of document.querySelectorAll("[data-start-action]"))k.addEventListener("click",()=>{k.dataset.startAction==="discover"&&xr(),k.dataset.startAction==="connect"&&Ar()});for(const k of document.querySelectorAll("[data-demo-tab]"))k.addEventListener("click",()=>{const U=k.dataset.demoTab;U&&(a.activeTab=U,U==="labs"&&(a.artifactView="create"),a.error="",ee(),window.requestAnimationFrame(()=>{var Ae;(Ae=document.querySelector("#demo-workspace"))==null||Ae.scrollIntoView({behavior:"smooth",block:"start"})}))});(Oe=document.querySelector("#clusterSelect"))==null||Oe.addEventListener("change",k=>{const U=k.currentTarget.value;wa(U)&&(a.cluster=U,at(),a.error="",me(),ee())}),($t=document.querySelector("#walletSelect"))==null||$t.addEventListener("change",k=>{a.selectedWalletName=k.currentTarget.value,at(),a.error="",me(),ee()}),(Ye=document.querySelector("#iosWalletSelect"))==null||Ye.addEventListener("change",k=>{const U=k.currentTarget.value;Fc(U)&&(a.selectedIosWalletId=U,a.selectedWalletName=va(U),at(),a.error="",me(),ee())}),(He=document.querySelector("#bridgeUrl"))==null||He.addEventListener("input",k=>{a.bridgeUrl=k.currentTarget.value.trim(),me()}),(zt=document.querySelector("#bridgeToken"))==null||zt.addEventListener("input",k=>{a.bridgeToken=k.currentTarget.value.trim(),me()}),(Kt=document.querySelector("#agentPrompt"))==null||Kt.addEventListener("input",k=>{a.agentPrompt=k.currentTarget.value,a.agentPlan=null,a.agentSignature="",a.agentPreparedActionId=""});for(const k of document.querySelectorAll("[data-template-field]"))k.addEventListener("input",()=>{const U=k.dataset.templateField;U&&(a.templateFields[U]=k.value,a.agentPlan=null,a.agentSignature="",a.agentPreparedActionId="")}),k.addEventListener("change",()=>{const U=k.dataset.templateField;U&&(a.templateFields[U]=k.value)});(kt=document.querySelector("#aiMode"))==null||kt.addEventListener("change",k=>{const U=k.currentTarget.value;a.aiSettings.mode=U==="session"||U==="hosted"?U:"bridge",kl(),me(),ee()}),(Ie=document.querySelector("#aiProvider"))==null||Ie.addEventListener("change",k=>{const U=nt(k.currentTarget.value);a.aiSettings.provider=U.id,a.aiSettings.apiFormat=U.apiFormat,a.aiSettings.baseUrl=U.baseUrl,a.aiSettings.model=U.model,me(),ee()}),(Ee=document.querySelector("#aiBaseUrl"))==null||Ee.addEventListener("input",k=>{a.aiSettings.baseUrl=k.currentTarget.value.trim(),me(),Sn()}),(X=document.querySelector("#aiModelSelect"))==null||X.addEventListener("change",k=>{const U=k.currentTarget.value;a.aiSettings.model=U===Vr?"":U,me(),ee()}),(Ce=document.querySelector("#aiModelCustom"))==null||Ce.addEventListener("input",k=>{a.aiSettings.model=k.currentTarget.value.trim(),me(),Sn()}),(Vt=document.querySelector("#aiApiKey"))==null||Vt.addEventListener("input",k=>{a.aiSettings.apiKey=k.currentTarget.value,Sn()}),(Jt=document.querySelector("#labInput"))==null||Jt.addEventListener("input",k=>{a.labInputs[a.activeLab]=k.currentTarget.value}),(ct=document.querySelector("#labSelect"))==null||ct.addEventListener("change",k=>{a.activeLab=k.currentTarget.value,a.error="",ee()});for(const k of document.querySelectorAll("[data-artifact-view]"))k.addEventListener("click",()=>{const U=k.dataset.artifactView;U!=="create"&&U!=="signed"||(a.artifactView=U,a.error="",ee())});(dt=document.querySelector("#txInput"))==null||dt.addEventListener("input",k=>{a.customTransactionBase64=k.currentTarget.value.trim(),a.txSignature="",a.txid=""}),(Zt=document.querySelector("#inboxFilter"))==null||Zt.addEventListener("change",k=>{a.inboxFilter=k.currentTarget.value,ee()}),(ut=document.querySelector("#recurringCadence"))==null||ut.addEventListener("change",k=>{a.recurringDraft=qi(),a.recurringDraft.cadence=k.currentTarget.value,ee()});for(const k of document.querySelectorAll("[data-action-op]"))k.addEventListener("click",()=>{const U=k.dataset.actionId,Ae=k.dataset.actionOp;!U||!Ae||kc(U,Ae)});for(const k of document.querySelectorAll("[data-recurring-op]"))k.addEventListener("click",()=>{const U=k.dataset.recurringId,Ae=k.dataset.recurringOp;!U||!Ae||Pc(U,Ae)});for(const k of document.querySelectorAll("[data-lab]"))k.addEventListener("click",()=>{a.activeLab=k.dataset.lab??qe[0].id,a.error="",ee()});for(const k of document.querySelectorAll("[data-runtime-path]"))k.addEventListener("click",()=>{const U=nl(k.dataset.runtimePath);U&&(a.selectedRuntimePath=U.id,a.recentCopyId="",a.error="",ee())});for(const k of document.querySelectorAll("[data-copy]"))k.addEventListener("click",async()=>{const U=k.dataset.copy??"",Ae=k.dataset.copyName??"Value",an=k.dataset.copyId??za("copy",Ae,U);try{await navigator.clipboard.writeText(U),il(an),B("success",`${Ae} copied`,U)}catch(Qt){const Sa=Qt instanceof Error?Qt.message:"Clipboard permission was denied.";B("error","Copy failed",Sa)}ee()});for(const k of document.querySelectorAll("[data-toast-dismiss]"))k.addEventListener("click",()=>er(Number(k.dataset.toastDismiss)))}function jl(){for(const e of document.querySelectorAll("a[href]"))e.addEventListener("click",t=>{var p;if(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;const r=new URL(e.href);if(r.origin!==window.location.origin)return;const l=Ga(r.pathname);if(Un(l)){if(t.preventDefault(),l==="/mwa-test"&&Rn&&((p=Xn())!=null&&p.openMwaExample)){ji();return}ms(l)}})}function Fl(){const e=document.querySelector("[data-template-picker]");if(!e)return;const t=e.querySelector("#templatePickerButton"),r=e.querySelector("#templatePickerMenu"),l=[...e.querySelectorAll("[data-template-option]")];if(!t||!r||l.length===0)return;const p=(x=!1)=>{var pe;if(t.disabled)return;Tn(),e.classList.add("open"),t.setAttribute("aria-expanded","true"),r.hidden=!1,Na(t,r),window.requestAnimationFrame(()=>Na(t,r));const G=l.find(xe=>xe.dataset.templateOption===a.selectedTemplateId)??l[0],ne=x==="first"?l[0]:x==="last"?l[l.length-1]:G;oa(l,ne,!!x),_t=new AbortController;const{signal:ue}=_t;window.addEventListener("pointerdown",xe=>{xe.target instanceof Node&&e.contains(xe.target)||b(!1)},{signal:ue}),window.addEventListener("keydown",xe=>{xe.key==="Escape"&&(xe.preventDefault(),b(!0))},{signal:ue}),window.addEventListener("resize",()=>Na(t,r),{signal:ue}),(pe=window.visualViewport)==null||pe.addEventListener("resize",()=>Na(t,r),{signal:ue})},b=x=>{e.classList.remove("open"),t.setAttribute("aria-expanded","false"),r.hidden=!0,Tn(),x&&t.focus({preventScroll:!0})};t.addEventListener("click",x=>{x.stopPropagation(),r.hidden?p(!1):b(!1)}),t.addEventListener("keydown",x=>{x.key==="ArrowDown"&&(x.preventDefault(),p("selected"),Oa(l,1)),x.key==="ArrowUp"&&(x.preventDefault(),p("selected"),Oa(l,-1)),(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),p("selected"))}),r.addEventListener("keydown",x=>{if(x.key==="ArrowDown"&&(x.preventDefault(),Oa(l,1)),x.key==="ArrowUp"&&(x.preventDefault(),Oa(l,-1)),x.key==="Home"&&(x.preventDefault(),oa(l,l[0],!0)),x.key==="End"&&(x.preventDefault(),oa(l,l[l.length-1],!0)),x.key==="Enter"||x.key===" "){x.preventDefault();const ne=(document.activeElement instanceof HTMLButtonElement?document.activeElement:l.find(ue=>ue.classList.contains("active"))??l[0]).dataset.templateOption;if(!ne)return;wr(ne)||b(!0)}});for(const x of l)x.addEventListener("click",()=>{const G=x.dataset.templateOption;G&&(wr(G)||b(!0))}),x.addEventListener("pointermove",()=>oa(l,x,!1))}function Tn(){_t==null||_t.abort(),_t=null}function wr(e){const t=ga(e);return t.id===a.selectedTemplateId?!1:(a.selectedTemplateId=t.id,a.templateFields={...Fa(t),...a.templateFields},a.agentPlan=null,a.agentSignature="",a.agentPreparedActionId="",ee(),!0)}function Na(e,t){const r=window.visualViewport,l=(r==null?void 0:r.offsetTop)??0,p=(r==null?void 0:r.width)??window.innerWidth,b=e.getBoundingClientRect(),x=l+10,G=Math.max(0,Math.floor(b.top-x-8)),ne=Math.min(420,G);t.style.setProperty("--template-menu-max-height",`${ne}px`),t.style.setProperty("--template-menu-max-width",`${Math.max(220,Math.floor(p-20))}px`)}function oa(e,t,r){for(const l of e){const p=l===t;l.classList.toggle("active",p),l.tabIndex=p?0:-1}r&&t.focus({preventScroll:!0}),t.scrollIntoView({block:"nearest"})}function Oa(e,t){const r=e.findIndex(p=>p===document.activeElement||p.classList.contains("active")),l=r<0?0:(r+t+e.length)%e.length;oa(e,e[l],!0)}async function xr(){await se("discover",async()=>{var e;if(a.androidNativeEnvironment.isAndroidNative){await Ci(!0),B("success","Android MWA connected",R(a.address));return}if(a.iosNativeEnvironment.isIosNative){a.iosWallets=Zr(),await Ut(),a.iosNativeStatus=`${a.iosWallets.length} iOS wallet path(s) available. Cached authorizations: ${a.iosAuthCacheCount}.`,me(),B("success","iOS wallets ready",`${a.iosWallets.length} wallet path(s) available.`);return}if(a.wallets=[...eo()],a.wallets.some(t=>t.name===a.selectedWalletName)||(a.selectedWalletName=((e=a.wallets[0])==null?void 0:e.name)??""),a.wallets.length===0)throw new Error("No Wallet Standard Solana wallets are registered in this browser.");me(),B("success","Wallets discovered",`${a.wallets.length} provider(s) found.`)})}async function Ar(){await se("connect",async()=>{if(a.androidNativeEnvironment.isAndroidNative){await Ci(!0),a.transactionStatus=`Android MWA wallet connected on ${a.cluster}.`,a.bridgeActive&&await Nt(),me(),B("success","Android MWA connected",R(a.address));return}if(a.iosNativeEnvironment.isIosNative){Pe=new Xr({walletId:a.selectedIosWalletId,cluster:a.cluster,appUrl:window.location.origin,rpcUrl:qa(),logLevel:"info"}),we=new Mt({backend:Pe}),a.address=await we.getAddress(),a.capabilities=await we.capabilities(),a.selectedWalletName=va(a.selectedIosWalletId),a.iosNativeStatus=`iOS ${a.selectedWalletName} connected on ${a.cluster}.`,a.transactionStatus=`iOS wallet connected on ${a.cluster}.`,await Ut(),a.bridgeActive&&await Nt(),me(),B("success","iOS wallet connected",R(a.address));return}const e=Rc();Pe=new to({wallet:e,cluster:a.cluster,rpcUrl:qa()}),we=new Mt({backend:Pe}),a.address=await we.getAddress(),a.capabilities=await we.capabilities(),a.transactionStatus=`Wallet connected on ${a.cluster}.`,a.bridgeActive&&await Nt(),me(),B("success","Wallet connected",R(a.address))})}async function Gl(){await se("connect",async()=>{a.bridgeActive&&await Bt().catch(()=>{}),await Dc().catch(()=>{}),at(),await ma(),a.androidNativeEnvironment.isAndroidNative&&(a.androidNativeStatus=a.androidAuthCacheCount>0?"Android MWA disconnected locally. Cached authorization retained.":"Android MWA disconnected."),await Ut(),B("success","Wallet disconnected","Local signing session cleared.")})}async function Yl(){await se("connect",async()=>{ba();const e=await Nr({cluster:Za()});if(!e)throw new Error("No cached Android MWA authorization found.");await Ti(e),a.bridgeActive&&await Nt(),B("success","Android MWA restored",R(a.address))})}async function Hl(){await se("connect",async()=>{ba(),await zn().clearTransientState(),a.androidNativeStatus="Android MWA transient state cleared. Cached authorization retained.",await ma(),B("success","Android state cleared","Cached authorization retained.")})}async function zl(){await se("connect",async()=>{ba(),a.bridgeActive&&await Bt().catch(()=>{}),await zn().clearStateFullReset(),at(),await ma(),a.androidNativeStatus="Android MWA authorization reset. Discover again to authorize.",B("success","Android wallet reset","Authorization cleared.")})}async function Kl(){await se("connect",async()=>{ba(),a.bridgeActive&&await Bt().catch(()=>{}),await zn().clearAllCachedAuthorizations(),at(),await ma(),a.androidNativeStatus="All Android MWA cached authorizations cleared.",B("success","Android cache cleared","All cached accounts removed.")})}async function Vl(){await se("connect",async()=>{Qa();const e=await Qr({cluster:a.cluster,appUrl:window.location.origin,rpcUrl:qa(),logLevel:"info"});if(!e)throw new Error("No cached iOS wallet authorization is available. Connect once first.");Pe=e.backend,we=new Mt({backend:Pe}),a.address=e.address,a.selectedIosWalletId=e.walletId,a.selectedWalletName=e.walletName,a.capabilities=await we.capabilities(),a.iosAuthCacheCount=e.cacheCount,a.iosNativeStatus=`Restored cached ${e.walletName} authorization on ${a.cluster}.`,a.bridgeActive&&await Nt(),me(),B("success","iOS cache restored",R(a.address))})}async function Jl(){await se("connect",async()=>{Qa(),await Kn().clearTransientState("browser_demo"),a.iosNativeStatus="iOS transient callback state cleared. Auth cache retained.",B("success","iOS transient state cleared","Cached authorizations were retained.")})}async function Zl(){await se("connect",async()=>{Qa(),a.bridgeActive&&await Bt().catch(()=>{}),await Kn().clearStateFullReset("browser_demo"),at(),await Ut(),a.iosNativeStatus="iOS wallet state reset. Connect again to authorize.",B("success","iOS wallet reset","Latest authorization cleared.")})}async function Ql(){await se("connect",async()=>{Qa(),a.bridgeActive&&await Bt().catch(()=>{}),await Kn().clearAllCachedAuthorizations(),at(),await Ut(),a.iosNativeStatus="All cached iOS wallet authorizations cleared.",B("success","iOS auth cache cleared","All cached accounts were removed.")})}async function Xl(){await se("sign",async()=>{const t=await Dt().signMessage(On,ya("Command center message signature"));a.signature=t.signature,B("success","Message signed",R(t.signature))})}async function ec(){await se("transaction",async()=>{if(a.cluster!=="devnet")throw new Error("Devnet SOL is available only when the cluster is devnet.");const e=Vn();a.transactionStatus="Requesting 1 devnet SOL from the Solana faucet...",ee();const t=new Ir(Zn("devnet"),"confirmed"),r=await t.requestAirdrop(e,1e9);await t.confirmTransaction(r,"confirmed"),a.transactionStatus=`Airdrop confirmed: ${R(r)}. Create and sign a demo transaction now.`,B("success","Devnet SOL requested",R(r))})}async function tc(){await se("transaction",async()=>{if(a.cluster!=="devnet")throw new Error("The built-in memo transaction is devnet-only.");const e=Vn(),t=new Ir(Zn("devnet"),"confirmed");if(await t.getBalance(e,"confirmed")===0)throw a.transactionStatus="This devnet account has 0 SOL. Request devnet SOL before signing the demo transaction.",new Error("Not enough devnet SOL for transaction fees. Click Request devnet SOL, then try again.");const{blockhash:l}=await t.getLatestBlockhash(),p=new io({feePayer:e,recentBlockhash:l}).add(new oo({keys:[{pubkey:e,isSigner:!0,isWritable:!1}],programId:Vo,data:new TextEncoder().encode(jo)}));a.customTransactionBase64=Fd(p.serialize({requireAllSignatures:!1,verifySignatures:!1})),a.txSignature="",a.txid="",a.transactionStatus="Demo transaction created. Sign it without broadcasting, or sign and send it on devnet.",B("success","Transaction created","Demo transaction ready.")})}async function ac(){await se("transaction",async()=>{const e=Dt();a.transactionStatus="Opening wallet approval for transaction signature...";const t=await e.signTransaction(a.customTransactionBase64,ya("Transaction signature request"));a.txSignature=t.signature,a.txid="",a.transactionStatus="Transaction signed by wallet. The signed transaction bytes were not broadcast.",B("success","Transaction signed","Signed bytes returned.")})}async function nc(){await se("transaction",async()=>{var r;const e=Dt();if(!((r=a.capabilities)!=null&&r.supports.signAndSendTransaction))throw new Error("Selected wallet does not support sign and send.");a.transactionStatus=`Opening wallet approval to sign and send on ${a.cluster}...`;const t=await e.signAndSendTransaction(a.customTransactionBase64,ya("Transaction broadcast request"));a.txid=t.txid??t.signature,a.txSignature="",a.transactionStatus="Transaction sent. The transaction id is shown below.",B("success","Transaction sent",R(a.txid))})}async function rc(){a.activeOperation="generate-template-plan";const e=B("pending","Generating template plan","Preparing a saved review draft.");try{await se("sign",async()=>{const t=ha(),r=Ai(t);Si(t,r);const l=a.agentPrompt.trim();ki(t,l);const p=Rr(t,r,"template",l);a.agentPlan=p,a.agentSignature="",a.agentPreparedActionId="";const b=pi(p,t,l||t.description);a.selectedGeneratedPlanId=b.id,a.activeTab="generated",ja(e,"success","Template plan saved",`${t.title} is in Generated Plans.`)},{onError:t=>ja(e,"error","Template plan failed",t)})}finally{a.activeOperation=null,ee()}}async function ic(){a.activeOperation="generate-ai-plan";const e=B("pending","Generating AI plan","Drafting through your configured AI route.");try{await se("ai",async()=>{const t=ha(),r=Ai(t);Si(t,r);const l=a.agentPrompt.trim();ki(t,l);const p={prompt:l||t.description,userNotes:l,template:{id:t.id,category:t.category,title:t.title,description:t.description,actionType:t.actionType,risk:t.risk},parameters:r},b=a.aiSettings.mode==="bridge"?await ce("/bridge/ai/generate-plan",{method:"POST",body:JSON.stringify(p)}):a.aiSettings.mode==="hosted"?await ko(a.aiSettings,p):await $o(a.aiSettings,p);a.agentPlan=b,a.agentSignature="",a.agentPreparedActionId="";const x=pi(b,t,p.prompt);a.selectedGeneratedPlanId=x.id,a.activeTab="generated",ja(e,"success","AI plan generated",`${b.templateTitle} is ready in Generated Plans.`)},{onError:t=>ja(e,"error","AI plan failed",t)})}finally{a.activeOperation=null,ee()}}async function oc(){await se("sign",async()=>{if(!a.agentPlan)throw new Error("Generate an agent plan before signing.");const e=await bi(a.agentPlan,"Agent plan review proof");a.agentSignature=e,fi({signature:e,status:"signed"}),B("success","Plan proof signed",R(e))})}async function sc(){await se("inbox",async()=>{if(!a.agentPlan)throw new Error("Generate an agent plan before queueing.");const e=await Pi(a.agentPlan);a.agentPreparedActionId=e.id,fi({preparedActionId:e.id,status:"queued"}),a.activeTab="inbox",a.inboxFilter="ready",await Je(),B("success","Prepared action queued",e.id)})}async function lc(e,t){const r=Va(e);if(r){if(t==="view"){a.selectedGeneratedPlanId=e,a.error="",ee();return}if(t==="make-active"){uc(r),B("success","Plan made active",`${r.plan.templateTitle} is ready on Agent Plan.`),ee();return}if(t==="archive"){fa(e,{status:"archived"}),Sr(),B("success","Plan archived",r.plan.templateTitle),ee();return}if(t==="restore"){fa(e,{status:pc(r)}),a.selectedGeneratedPlanId=e,B("success","Plan restored",r.plan.templateTitle),ee();return}if(t==="delete"){if(!window.confirm("Delete this generated plan permanently?"))return;a.generatedPlans=a.generatedPlans.filter(l=>l.id!==e),tr(),Sr(),B("success","Plan deleted",r.plan.templateTitle),ee();return}if(t==="sign-proof"){await cc(e);return}t==="queue"&&await dc(e)}}async function cc(e){await se("sign",async()=>{const t=hi(e);if(t.status==="archived")throw new Error("Restore this generated plan before signing a proof.");const r=await bi(t.plan,"Generated plan review proof");fa(e,{signature:r,status:"signed"}),a.selectedGeneratedPlanId=e,a.agentPlan&&Gn(a.agentPlan,t.plan)&&(a.agentSignature=r),B("success","Plan proof signed",R(r))})}async function dc(e){await se("inbox",async()=>{const t=hi(e);if(t.status==="archived")throw new Error("Restore this generated plan before queueing it.");if(!je(t.plan))throw new Error("Queue approval is available only for transfer, swap, and recurring payment plans.");const r=await Pi(t.plan);fa(e,{preparedActionId:r.id,status:"queued"}),a.selectedGeneratedPlanId=e,a.agentPlan&&Gn(a.agentPlan,t.plan)&&(a.agentPreparedActionId=r.id),a.activeTab="inbox",a.inboxFilter="ready",await Je(),B("success","Prepared action queued",r.id)})}function pi(e,t,r){const l=new Date().toISOString(),p={id:Fi("plan"),plan:e,createdAt:l,updatedAt:l,source:e.source,templateId:t.id,templateTitle:t.title,prompt:r,walletAddress:a.address,cluster:a.cluster,status:"draft"};return a.generatedPlans=ar([p],a.generatedPlans),tr(),p}function fa(e,t){const r=new Date().toISOString();a.generatedPlans=a.generatedPlans.map(l=>l.id!==e?l:{...l,...t,updatedAt:r}),tr()}function fi(e){if(!a.agentPlan)return;const t=Va(a.selectedGeneratedPlanId);t&&Gn(t.plan,a.agentPlan)&&fa(t.id,e)}function uc(e){a.agentPlan=e.plan,a.agentSignature=e.signature??"",a.agentPreparedActionId=e.preparedActionId??"",a.selectedGeneratedPlanId=e.id,a.activeTab="agent",a.error=""}function gi(){return a.showArchivedGeneratedPlans?a.generatedPlans:a.generatedPlans.filter(e=>e.status!=="archived")}function Ka(){const e=Va(a.selectedGeneratedPlanId);if(e&&!(!a.showArchivedGeneratedPlans&&e.status==="archived"))return e}function Va(e){return a.generatedPlans.find(t=>t.id===e)}function hi(e){const t=Va(e);if(!t)throw new Error("Generated plan was not found.");return t}function Sr(){const e=gi()[0]??a.generatedPlans[0];a.selectedGeneratedPlanId=(e==null?void 0:e.id)??""}function pc(e){return e.preparedActionId?"queued":e.signature?"signed":"draft"}function Fn(e){return e.status==="archived"?"archived":e.preparedActionId||e.status==="queued"?"queued":e.signature||e.status==="signed"?"proof signed":"draft"}function mi(e){return e.status==="archived"?"neutral":e.preparedActionId||e.status==="queued"?"tx-pending":e.signature||e.status==="signed"?"tx-confirmed":"neutral"}function fc(e){const t=e.walletAddress?R(e.walletAddress):"No wallet at creation";return`${De(e.createdAt)} · ${Ge(e.cluster)} · ${t}`}function gc(e){return e.status==="archived"?"Restore this generated plan before signing.":a.address?e.signature?"Sign a fresh review proof for this generated plan.":"Sign that you reviewed this generated plan.":"Connect a wallet before signing a review proof."}function hc(e){return e.status==="archived"?"Restore this generated plan before queueing it.":a.address?a.bridgeActive?je(e.plan)?"Queue this generated plan in Approval Inbox.":"Queue approval is available only for transfers, swaps, and recurring payments.":"Connect the local bridge before queueing this approval.":"Connect a wallet before queueing."}function Gn(e,t){return Fe(e)===Fe(t)}async function bi(e,t){return(await Dt().signMessage(mc(e),ya(t))).signature}function mc(e){return["Solana Agent Wallet Adapter agent approval",`Address: ${a.address}`,`Cluster: ${a.cluster}`,`Source: ${e.source}`,`Template: ${e.templateTitle}`,`Action: ${e.actionType}`,`Prepared by: ${_i(e)}`,`Intent: ${e.intent}`,`Route: ${e.route}`,`Risk: ${e.risk}`,`Approval: ${e.approval}`,`Parameters: ${Fe(e.parameters)}`,`User notes: ${e.userNotes||"None"}`,`Safeguards: ${e.safeguards.join(" | ")}`,`Time: ${new Date().toISOString()}`].join(`
|
|
1830
|
+
`)}async function bc(){await se("ai",async()=>{await ce("/bridge/ai/session-key",{method:"POST",body:JSON.stringify({apiKey:a.aiSettings.apiKey,baseUrl:a.aiSettings.baseUrl,model:a.aiSettings.model,provider:a.aiSettings.provider,apiFormat:a.aiSettings.apiFormat})}),a.aiSettings.apiKey="",await Ja(!0),B("success","Bridge AI key set","The key is held only in the local bridge process memory.")})}async function vc(){await se("ai",async()=>{a.aiSettings.apiKey="",a.aiSettings.mode==="bridge"&&(await ce("/bridge/ai/session-key",{method:"POST",body:JSON.stringify({clear:!0})}).catch(()=>{}),await Ja(!1)),B("success","AI key cleared",wc())})}async function yc(){await se("ai",async()=>{var e;await Ja(!0),B("success","AI status refreshed",(e=a.aiStatus)!=null&&e.available?"Bridge AI is available.":"Bridge AI is not configured.")})}function wc(){return a.aiSettings.mode==="hosted"?"Hosted BYOK key removed from this browser session.":a.aiSettings.mode==="session"?"Browser session key removed from this app.":"Session key removed from this app and local bridge memory."}async function xc(){await se("bridge",async()=>{a.bridgeUrl=Le("#bridgeUrl")||a.bridgeUrl,a.bridgeToken=Le("#bridgeToken")||a.bridgeToken,await xi(!0),await Nt(),a.bridgeActive=!0,a.bridgeStatus="Connected to local bridge. Waiting for agent requests.",Ec(),await Promise.all([Je(),yi(),wi().catch(()=>{}),Yn()]),me(),B("success","Bridge connected",Qn())})}async function Ac(){await se("bridge",async()=>{await Bt(),a.bridgeActive=!1,a.bridgeStatus="Bridge disconnected.",Hn(),B("success","Bridge disconnected","Local approval host stopped polling.")})}async function Sc(){await se("inbox",async()=>{await Promise.all([Je(),yi(),wi().catch(()=>{}),Yn()]),B("success","Inbox refreshed",`${a.preparedActions.length} action(s) loaded.`)})}async function $c(){await se("inbox",async()=>{a.recurringDraft=qi();const e=xd(a.recurringDraft);await ce("/bridge/recurring-payments",{method:"POST",body:JSON.stringify(e)}),a.activeTab="schedule",await Je(),B("success","Recurring approval created",`${e.amount} ${e.token}`)})}async function kc(e,t){if(t==="copy"){const r=a.preparedActions.find(l=>l.id===e);r&&(await navigator.clipboard.writeText(Fe(r)),B("success","Receipt copied",e));return}await se("inbox",async()=>{switch(t){case"execute":await ce("/bridge/prepared-actions/execute",{method:"POST",body:JSON.stringify({actionId:e})}),B("success","Wallet approval complete",e);break;case"reject":await ce("/bridge/prepared-actions/reject",{method:"POST",body:JSON.stringify({actionId:e,reason:"Rejected in browser wallet UI."})}),B("success","Prepared action rejected",e);break;case"archive":await ce("/bridge/prepared-actions/archive",{method:"POST",body:JSON.stringify({actionId:e})}),B("success","Prepared action archived",e);break;case"delete":await ce("/bridge/prepared-actions/delete",{method:"POST",body:JSON.stringify({actionId:e})}),B("success","Prepared action deleted",e);break;default:throw new Error(`Unknown action operation: ${t}`)}await Je()})}async function Pc(e,t){await se("inbox",async()=>{const r=t==="pause"?"/bridge/recurring-payments/pause":t==="resume"?"/bridge/recurring-payments/resume":t==="delete"?"/bridge/recurring-payments/delete":"";if(!r)throw new Error(`Unknown recurring operation: ${t}`);await ce(r,{method:"POST",body:JSON.stringify({recurringId:e})}),await Je(),B("success",`Recurring ${t}`,e)})}async function Cc(){await se("lab",async()=>{const e=Dt(),t=Xa(),r=Di(t.id).trim()||t.defaultInput,l=new Date().toISOString(),p=await yd(t.id,r,l),b=Fi(t.id.slice(0,3).replace(/[^a-z]/g,"")||"lab"),x={version:"labs-ui-v1",id:b,labId:t.id,kind:t.kind,createdAt:l,walletAddress:a.address,cluster:a.cluster,title:t.title,input:r,payload:p},G=await Ln(Fe(x)),ne=["Solana Agent Wallet Adapter",`Lab: ${t.title}`,`Artifact: ${b}`,`Wallet: ${a.address}`,`Cluster: ${a.cluster}`,`Hash: ${G}`].join(`
|
|
1831
|
+
`),ue=await e.signMessage(ne,ya(`${t.title} artifact`)),pe=Bd(ne,ue.signature),xe={...x,preSignatureHash:G,signingMessage:ne,signature:ue.signature,verified:pe},it={...xe,artifactHash:await Ln(Fe(xe))},bt=await Lc(it);B("success",`${t.title} signed`,bt?"Saved locally and to the bridge archive.":"Saved to the local device archive.")})}async function Tc(){await se("lab",async()=>{await Hi(),a.bridgeActive&&await Yn(),B("success","Artifacts refreshed",`${a.labArtifacts.length} artifact(s) loaded.`)})}async function se(e,t,r={}){a.error="",a.busy=!0,a.steps[e]="active",ee();try{await t(),a.steps[e]="done"}catch(l){a.steps[e]="error",a.error=Qe(l instanceof Error?l.message:String(l)),r.onError?r.onError(a.error):B("error","Action failed",a.error)}finally{a.busy=!1,ee()}}async function Lc(e){if(a.labArtifacts=rt([e],a.labArtifacts),await nr(),!a.bridgeActive)return!1;try{return await vi(e),!0}catch(t){return a.bridgeStatus=`Artifact bridge archive failed: ${t instanceof Error?t.message:String(t)}`,!1}}async function Yn(){if(a.bridgeActive)try{const e=await Ic(),t=a.labArtifacts,r=new Set(e.map(p=>p.id)),l=t.filter(p=>!r.has(p.id));for(const p of l)await vi(p);a.labArtifacts=rt(e,t),await nr(),a.labArchiveStatus="Browser archive synced with bridge."}catch(e){a.bridgeStatus=`Artifact bridge archive unavailable: ${e instanceof Error?e.message:String(e)}`}}async function Ic(){const e=await ce("/bridge/lab-artifacts");return rt(Array.isArray(e.artifacts)?e.artifacts.filter(tn):[])}async function vi(e){await ce("/bridge/lab-artifacts",{method:"POST",body:JSON.stringify({artifact:e})})}async function Je(){const[e,t,r,l]=await Promise.all([ce("/bridge/prepared-actions"),ce("/bridge/recurring-payments"),ce("/bridge/receipts"),ce("/bridge/prepared-actions/tx-status").catch(()=>null)]);a.materializedActions=e.materialized??[],a.preparedActions=(l==null?void 0:l.actions)??e.actions??[],a.recurringPayments=t.recurringPayments??[],a.receipts=r.receipts??[]}async function yi(){a.health=await ce("/bridge/health")}async function wi(){a.balances=await ce("/bridge/action/balances")}async function xi(e){try{const t=await ce("/bridge/config");if(!wa(t.cluster)||!t.rpcUrl)throw new Error("Local bridge returned an invalid runtime config.");a.cluster=t.cluster,a.bridgeRpcUrl=t.rpcUrl,me()}catch(t){if(a.bridgeRpcUrl="",e)throw t}}async function Nt(){if(!a.address||!a.capabilities)throw new Error("Connect a wallet before connecting the bridge.");await ce("/bridge/connect",{method:"POST",body:JSON.stringify({address:a.address,capabilities:a.capabilities})}),await Wa("browser.bridge.connected",{address:a.address,cluster:a.cluster,rpcHost:a.bridgeRpcUrl?Qn():null})}async function Bt(){await ce("/bridge/disconnect",{method:"POST"}).catch(()=>{})}function Ec(){Hn(),Ma=window.setInterval(()=>{$r()},1e3),$r()}function Hn(){Ma!==null&&(window.clearInterval(Ma),Ma=null)}async function $r(){if(!(!a.bridgeActive||!we||hn))try{const e=await ce("/bridge/next");if(e.request){hn=!0,await _c(e.request);return}const t=Date.now();(a.activeTab==="inbox"||a.activeTab==="schedule")&&t-fr>5e3&&(fr=t,await Je().catch(()=>{}),ee())}catch(e){a.bridgeStatus=e instanceof Error?e.message:String(e),ee()}finally{hn=!1}}async function _c(e){var r,l;const t=Dt();a.bridgeStatus=`Opening wallet for ${e.kind}: ${((r=e.display)==null?void 0:r.summary)??e.id}`,await Wa("browser.approval.start",{requestId:e.id,kind:e.kind,cluster:e.cluster,summary:(l=e.display)==null?void 0:l.summary}),ee();try{let p;switch(e.kind){case"sign_message":p=await t.signMessage(e.payload.data,kn(e));break;case"sign_transaction":p=await t.signTransaction(e.payload.data,kn(e));break;case"sign_and_send_transaction":p=await t.signAndSendTransaction(e.payload.data,kn(e));break}await ce("/bridge/resolve",{method:"POST",body:JSON.stringify({requestId:e.id,signature:p.signature,...p.txid!==void 0&&{txid:p.txid}})}),a.bridgeStatus=`Approved ${e.kind}: ${R(p.txid??p.signature)}`,await Wa("browser.approval.success",{requestId:e.id,kind:e.kind,signature:p.signature,txid:p.txid}),B("success","Bridge request approved",R(p.txid??p.signature))}catch(p){const b=Wd(p);await ce("/bridge/reject",{method:"POST",body:JSON.stringify({requestId:e.id,error:b})}).catch(()=>{}),a.bridgeStatus=`Rejected ${e.kind}: ${b.message}`,await Wa("browser.approval.error",{requestId:e.id,kind:e.kind,code:b.code,message:b.message}),B("error","Bridge request failed",b.message)}finally{await Je().catch(()=>{}),ee()}}async function Wa(e,t){a.bridgeToken&&await ce("/bridge/trace",{method:"POST",body:JSON.stringify({event:e,payload:t})}).catch(()=>{})}async function Ja(e){try{a.aiStatus=await ce("/bridge/ai/status")}catch(t){if(a.aiStatus=null,e)throw t}}function ha(){return ga(a.selectedTemplateId)}function Ai(e=ha()){const t={...Fa(e),...a.templateFields};for(const r of document.querySelectorAll("[data-template-field]")){const l=r.dataset.templateField;l&&(t[l]=r.value)}return a.templateFields=t,t}function Nc(e){const t=ha();return a.templateFields[e]??Fa(t)[e]??""}function Si(e,t){const r=e.fields.filter(l=>{var p;return l.required&&!((p=t[l.id])!=null&&p.trim())}).map(l=>l.label);if(r.length>0)throw new Error(`Complete required planner fields: ${r.join(", ")}.`)}function $i(e){return e.id==="custom-request"}function ki(e,t){if($i(e)&&!t.trim())throw new Error("Describe the custom request before generating this plan.")}function je(e){return["transfer_sol","transfer_spl","swap","recurring_payment"].includes(e.actionType)}function Oc(){return a.address?a.bridgeActive?a.agentPlan?je(a.agentPlan)?"Queue this plan in the local bridge approval inbox.":"Queueing is available for transfer, swap, and recurring payment templates.":"Generate a plan before queueing.":"Templates can be signed directly. Connect the local bridge only to queue approvals into the inbox.":"Connect a wallet before queueing."}async function Pi(e){var r,l;const t=e.intent.slice(0,500);switch(e.actionType){case"transfer_sol":return{id:(await ce("/bridge/action/prepare-transfer-sol",{method:"POST",body:JSON.stringify({recipient:Ke(e,"recipient"),amountSol:Ke(e,"amount"),note:t})})).preparedAction.id};case"transfer_spl":return{id:(await ce("/bridge/action/prepare-transfer-spl",{method:"POST",body:JSON.stringify({token:Ke(e,"token"),recipient:Ke(e,"recipient"),amount:Ke(e,"amount"),note:t})})).preparedAction.id};case"swap":{const p=Number(e.parameters.slippageBps||"50");return{id:(await ce("/bridge/action/prepare-swap",{method:"POST",body:JSON.stringify({inputToken:e.parameters.inputToken||"SOL",outputToken:e.parameters.outputToken||"USDC",amount:Ke(e,"amount"),slippageBps:Number.isFinite(p)?p:50,note:t})})).preparedAction.id}}case"recurring_payment":{const p=await ce("/bridge/recurring-payments",{method:"POST",body:JSON.stringify({token:Ke(e,"token"),recipient:Ke(e,"recipient"),amount:Ke(e,"amount"),...Mc(e),note:t})});return{id:((r=p.recurringPayment)==null?void 0:r.id)??((l=p.payment)==null?void 0:l.id)??"recurring-payment"}}default:throw new Error("This plan type creates a review/proof only and cannot be queued as a bridge action yet.")}}function Mc(e){var l,p,b,x;const t=Wc(e.parameters.cadence),r=((l=e.parameters.localTime)==null?void 0:l.trim())||"09:00";switch(t){case"weekly":return{cadence:t,dayOfWeek:na(e,"dayOfWeek",1,0,6),localTime:r};case"monthly":return{cadence:t,dayOfMonth:na(e,"dayOfMonth",1,1,31),localTime:r};case"interval_days":return{cadence:t,intervalDays:na(e,"intervalDays",7,1,365),startAt:((p=e.parameters.startAt)==null?void 0:p.trim())||$n()};case"interval_hours":return{cadence:t,intervalHours:na(e,"intervalHours",24,1,8760),startAt:((b=e.parameters.startAt)==null?void 0:b.trim())||$n()};case"interval_minutes":return{cadence:t,intervalMinutes:na(e,"intervalMinutes",60,1,525600),startAt:((x=e.parameters.startAt)==null?void 0:x.trim())||$n()}}}function Wc(e){const t=e==null?void 0:e.trim();return t==="weekly"||t==="monthly"||t==="interval_days"||t==="interval_hours"||t==="interval_minutes"?t:"weekly"}function na(e,t,r,l,p){const b=Number(e.parameters[t]);return!Number.isInteger(b)||b<l||b>p?r:b}function $n(){return new Date(Date.now()+6e4).toISOString()}function Ke(e,t){var l;const r=(l=e.parameters[t])==null?void 0:l.trim();if(!r)throw new Error(`Plan is missing ${Ao(ga(a.selectedTemplateId),t)}.`);return r}async function ce(e,t){if(!a.bridgeToken)throw new Error("Bridge token is required.");const r=new URL(e,$d()),l=new Headers(t==null?void 0:t.headers);l.set("x-agent-wallet-token",a.bridgeToken),(t==null?void 0:t.body)!==void 0&&!l.has("content-type")&&l.set("content-type","application/json");const p=await fetch(r,{...t,headers:l}),b=await p.json().catch(()=>({}));if(!p.ok){const x=Rd(b);throw p.status===401?new Error("Wrong bridge token. Use the token printed by the bridge process."):new Error(x)}return b}function Rc(){const e=a.wallets.find(t=>t.name===a.selectedWalletName);if(!e)throw new Error("Select a wallet first.");return e}async function Ci(e){ba();const t=new Ra({cluster:Za()});Pe=t,we=new Mt({backend:t}),a.address=await t.connect(),a.capabilities=await we.capabilities(),a.selectedWalletName=t.walletName(),a.wallets=[],a.androidAuthCacheCount=t.cacheCount(),a.androidNativeStatus=`Android ${a.selectedWalletName} connected on ${a.cluster}.`,a.transactionStatus=`Android MWA wallet connected on ${a.cluster}.`,a.steps.connect="done",me()}async function Ti(e){Pe=e.backend,we=new Mt({backend:Pe}),a.address=e.address,a.selectedWalletName=e.walletName,a.wallets=[],a.capabilities=await we.capabilities(),a.androidAuthCacheCount=e.cacheCount,a.androidNativeStatus=`Restored cached ${e.walletName} authorization on ${a.cluster}.`,a.transactionStatus=`Android MWA wallet connected on ${a.cluster}.`,a.steps.connect="done",me()}async function Bc(){if(a.cluster==="localnet"){a.androidNativeStatus="Android native MWA supports mainnet-beta, devnet, and testnet. Select devnet for local testing.";return}const e=await Nr({cluster:Za()});if(!e){a.androidNativeStatus="No cached Android MWA authorization found. Tap Discover to open the wallet picker.";return}await Ti(e)}async function ma(){if(!a.androidNativeEnvironment.isAndroidNative)return;const e=await ho().catch(()=>({count:0}));a.androidAuthCacheCount=e.count}function zn(){return Pe instanceof Ra?Pe:new Ra({cluster:Za()})}function Za(){return a.cluster==="localnet"&&(a.cluster="devnet",me()),a.cluster}function ba(){if(!a.androidNativeEnvironment.isAndroidNative)throw new Error("Android native MWA controls are available only inside the Android app.")}async function Uc(){const e=await Qr();if(!e){a.iosNativeStatus="No cached iOS authorization found.";return}Pe=e.backend,we=new Mt({backend:Pe}),a.address=e.address,a.selectedIosWalletId=e.walletId,a.selectedWalletName=e.walletName,a.capabilities=await we.capabilities(),a.iosAuthCacheCount=e.cacheCount,a.iosNativeStatus=`Restored cached ${e.walletName} authorization on ${a.cluster}.`}async function Ut(){if(!a.iosNativeEnvironment.isIos)return;const e=await ss().catch(()=>({count:0}));a.iosAuthCacheCount=e.count}function Kn(){const e=Pe;return e!=null&&e.clearTransientState&&e.clearStateFullReset&&e.clearAllCachedAuthorizations?e:new Xr({walletId:a.selectedIosWalletId,cluster:a.cluster,appUrl:window.location.origin,rpcUrl:qa(),logLevel:"info"})}async function Dc(){var t;const e=Pe;await((t=e==null?void 0:e.disconnect)==null?void 0:t.call(e))}function Qa(){if(!a.iosNativeEnvironment.isIosNative)throw new Error("iOS native wallet controls are available only inside the Capacitor iOS app.")}function Dt(){if(!we)throw new Error("Connect a wallet before requesting a signature.");return we}function qc(){var e;return!!(a.address&&a.customTransactionBase64&&!a.busy&&((e=a.capabilities)!=null&&e.supports.signAndSendTransaction))}function Vn(){try{return new Lr(a.address)}catch{throw new Error("Connected wallet address is not a valid Solana public key.")}}function at(){we=null,Pe=null,a.activeTab=ei,a.address="",a.signature="",a.txSignature="",a.txid="",a.customTransactionBase64="",a.transactionStatus="",a.agentPlan=null,a.agentSignature="",a.agentPreparedActionId="",a.capabilities=null,a.bridgeActive=!1,a.bridgeStatus="Bridge idle.",Hn(),a.steps.connect="idle",a.steps.sign="idle",a.steps.transaction="idle",a.steps.bridge="idle"}function Jn(){return a.wallets.some(e=>e.name===a.selectedWalletName)?a.selectedWalletName:""}function jc(){const e=Jn(),t=a.wallets.length;if(a.address){const r=e||a.selectedWalletName||"Connected wallet";return{icon:da(r),logoId:wn(r),discoveredWallet:Ua(r),title:r,summary:R(a.address),detail:`${Ge(a.cluster)} signer`}}if(a.androidNativeEnvironment.isAndroidNative)return{icon:"MW",logoId:"solanaMobile",title:"Android MWA standby",summary:"Mobile Wallet Adapter",detail:a.androidAuthCacheCount>0?`${a.androidAuthCacheCount} cached authorization(s)`:"Tap Discover to open the wallet picker"};if(a.iosNativeEnvironment.isIosNative){const r=va(a.selectedIosWalletId);return{icon:da(r),logoId:wn(r),title:"iOS wallet standby",summary:r,detail:a.iosAuthCacheCount>0?`${a.iosAuthCacheCount} cached authorization(s)`:"Encrypted links and WalletConnect ready"}}return t>0&&e?{icon:da(e),logoId:wn(e),discoveredWallet:Ua(e),title:"Wallet standby",summary:e,detail:`${t} provider(s) discovered`}:{icon:"SA",title:"Wallet standby",summary:"No signer connected",detail:t>0?`${t} provider(s) discovered`:"No providers discovered"}}function Li(){return a.wallets.length===0?'<option value="">No wallets discovered</option>':a.wallets.map(e=>`<option value="${d(e.name)}" ${e.name===a.selectedWalletName?"selected":""}>${d(e.name)}</option>`).join("")}function Ii(){return a.iosWallets.map(e=>`<option value="${d(e.id)}" ${e.id===a.selectedIosWalletId?"selected":""}>${d(e.name)} - ${d(e.detail)}</option>`).join("")}function va(e){var t;return((t=a.iosWallets.find(r=>r.id===e))==null?void 0:t.name)??e}function Fc(e){return a.iosWallets.some(t=>t.id===e)}function Gc(e){const t=e.supports;return`
|
|
1832
|
+
<div class="capabilities">
|
|
1833
|
+
<span>${d(e.backend)}</span>
|
|
1834
|
+
<span>${e.cluster.map(Ge).join(", ")}</span>
|
|
1835
|
+
<span>message ${t.signMessage?"yes":"no"}</span>
|
|
1836
|
+
<span>transaction ${t.signTransaction?"yes":"no"}</span>
|
|
1837
|
+
<span>send ${t.signAndSendTransaction?"yes":"no"}</span>
|
|
1838
|
+
</div>
|
|
1839
|
+
`}function Yc(e){const t=[e.supports.signMessage?"message":"",e.supports.signTransaction?"transaction":"",e.supports.signAndSendTransaction?"send":""].filter(Boolean);return t.length?`${e.backend}: ${t.join(", ")}`:e.backend}function ra(e,t,r){const l=!a.address&&e!=="wallet"&&e!=="agent"&&e!=="generated"&&e!=="labs",p=[a.activeTab===e?"active":"",r?"has-mobile-label":""].filter(Boolean).join(" "),b=r?`<span class="nav-label nav-label-full">${d(t)}</span><span class="nav-label nav-label-mobile">${d(r)}</span>`:`<span class="nav-label">${d(t)}</span>`;return`<button data-tab="${e}" class="${p}" aria-label="${d(t)}" ${l?'disabled title="Connect a wallet to unlock this workspace."':""}>${b}</button>`}function Hc(){const e=[a.address?["Address",a.address]:null,a.signature?["Message signature",a.signature]:null,a.customTransactionBase64&&!a.txSignature?["Generated transaction",a.customTransactionBase64]:null,a.txSignature?["Signed transaction",a.txSignature]:null,a.txid?["Transaction id",a.txid]:null].filter(Boolean);return e.length===0?'<div class="empty">Results appear here after wallet approval.</div>':`
|
|
1840
|
+
<div class="results">
|
|
1841
|
+
${e.map(([t,r])=>`
|
|
1842
|
+
<div class="result-row">
|
|
1843
|
+
<span>${d(t)}</span>
|
|
1844
|
+
<code>${d(r)}</code>
|
|
1845
|
+
<button data-copy="${d(r)}">Copy</button>
|
|
1846
|
+
</div>
|
|
1847
|
+
`).join("")}
|
|
1848
|
+
</div>
|
|
1849
|
+
`}function Ei(e){return`
|
|
1850
|
+
<article class="plan-card proof-preview">
|
|
1851
|
+
<div>
|
|
1852
|
+
<span class="workbench-kicker">${d(e.source==="ai"?"AI-drafted plan":"Keyless template plan")}</span>
|
|
1853
|
+
<h3>${d(e.intent)}</h3>
|
|
1854
|
+
</div>
|
|
1855
|
+
<div class="pill-row">
|
|
1856
|
+
<span class="status-pill neutral">${d(Da(e.category))}</span>
|
|
1857
|
+
<span class="status-pill neutral">${d(e.actionType.replace(/_/g," "))}</span>
|
|
1858
|
+
<span class="status-pill ${je(e)?"tx-confirmed":"tx-pending"}">${je(e)?"queueable":"proof only"}</span>
|
|
1859
|
+
</div>
|
|
1860
|
+
<dl class="proof-grid plan-review-grid">
|
|
1861
|
+
${zc(e).map(([t,r])=>We(t,r)).join("")}
|
|
1862
|
+
</dl>
|
|
1863
|
+
<dl class="proof-grid">
|
|
1864
|
+
${We("Route",e.route)}
|
|
1865
|
+
${We("Risk",e.risk)}
|
|
1866
|
+
${We("Approval",e.approval)}
|
|
1867
|
+
</dl>
|
|
1868
|
+
${e.userNotes?`
|
|
1869
|
+
<dl class="proof-grid plan-notes-grid">
|
|
1870
|
+
${We("User notes",e.userNotes)}
|
|
1871
|
+
</dl>
|
|
1872
|
+
`:""}
|
|
1873
|
+
${e.fields.length?`
|
|
1874
|
+
<dl class="proof-grid plan-field-grid">
|
|
1875
|
+
${e.fields.map(t=>We(t.label,t.value)).join("")}
|
|
1876
|
+
</dl>
|
|
1877
|
+
`:""}
|
|
1878
|
+
<div class="plan-safeguards">
|
|
1879
|
+
<span>Safeguards</span>
|
|
1880
|
+
<ul>
|
|
1881
|
+
${e.safeguards.slice(0,6).map(t=>`<li>${d(t)}</li>`).join("")}
|
|
1882
|
+
</ul>
|
|
1883
|
+
</div>
|
|
1884
|
+
</article>
|
|
1885
|
+
`}function zc(e){return[["Prepared by",_i(e)],["Source",Ni(e)],["Wallet",a.address?R(a.address):"Connect wallet to sign"],["Network",Ge(a.cluster)],["Template",e.templateTitle],["Action",e.actionType.replace(/_/g," ")]]}function _i(e){return e.source==="ai"?"AI draft reviewed in Agentic":"You in Agentic"}function Ni(e){return e.source==="ai"?"Bring-your-own-key AI draft":"Keyless template, no AI"}function Kc(){return a.agentSignature?`
|
|
1886
|
+
<div class="results">
|
|
1887
|
+
<div class="result-row">
|
|
1888
|
+
<span>Agent approval signature</span>
|
|
1889
|
+
<code>${d(a.agentSignature)}</code>
|
|
1890
|
+
<button data-copy="${d(a.agentSignature)}">Copy</button>
|
|
1891
|
+
</div>
|
|
1892
|
+
</div>
|
|
1893
|
+
`:'<div class="empty">Agent approval signature appears here after wallet approval.</div>'}function Vc(e){const t=a.preparedActions.filter(p=>!p.archived).length,r=a.bridgeActive?"Bridge connected":"Bridge unavailable",l=rd(a.inboxFilter);return`
|
|
1894
|
+
<div class="queue-status">
|
|
1895
|
+
<span>${d(r)}</span>
|
|
1896
|
+
<strong>${e} awaiting review</strong>
|
|
1897
|
+
<span>${t} in queue</span>
|
|
1898
|
+
<span>${d(l)}</span>
|
|
1899
|
+
</div>
|
|
1900
|
+
`}function Jc(){const e=a.recurringPayments.filter(l=>l.status==="active").length,t=a.recurringPayments.length,r=a.bridgeActive?"Bridge connected":"Bridge unavailable";return`
|
|
1901
|
+
<div class="queue-status">
|
|
1902
|
+
<span>${d(r)}</span>
|
|
1903
|
+
<strong>${e} active recurring approval${e===1?"":"s"}</strong>
|
|
1904
|
+
<span>${t} saved</span>
|
|
1905
|
+
<span>Each run still needs wallet approval</span>
|
|
1906
|
+
</div>
|
|
1907
|
+
`}function Zc(e=Oi()){return a.bridgeActive?e.length===0?kr("clear"):`
|
|
1908
|
+
<div class="inbox-list">
|
|
1909
|
+
${e.map(Qc).join("")}
|
|
1910
|
+
</div>
|
|
1911
|
+
`:kr("bridge")}function kr(e){const t=e==="bridge",r=t?"Approval queue unavailable":"No approvals waiting",l=t?"Start the local bridge to review prepared payment, swap, and recurring actions.":dd();return`
|
|
1912
|
+
<div class="empty queue-empty queue-empty-state">
|
|
1913
|
+
<div>
|
|
1914
|
+
<span>${d(t?"Bridge required":"Queue clear")}</span>
|
|
1915
|
+
<h3>${d(r)}</h3>
|
|
1916
|
+
<p>${d(l)}</p>
|
|
1917
|
+
</div>
|
|
1918
|
+
</div>
|
|
1919
|
+
`}function Qc(e){const t=["ready","overdue","failed"].includes(e.status);return`
|
|
1920
|
+
<article class="inbox-item approval-ticket ${e.status}">
|
|
1921
|
+
<div class="ticket-status-rail ${Cr(e.status)}"></div>
|
|
1922
|
+
<div class="ticket-body">
|
|
1923
|
+
<div class="pill-row">
|
|
1924
|
+
<span class="status-pill ${Cr(e.status)}">${d(e.status)}</span>
|
|
1925
|
+
<span class="status-pill neutral">${d(e.kind.replace("_"," "))}</span>
|
|
1926
|
+
${e.recurringId?'<span class="status-pill neutral">recurring</span>':""}
|
|
1927
|
+
${e.txStatus?`<span class="status-pill ${gd(e.txStatus)}">tx ${d(e.txStatus)}</span>`:""}
|
|
1928
|
+
</div>
|
|
1929
|
+
<h3>${d(e.summary)}</h3>
|
|
1930
|
+
${e.note?`<p class="action-note">${d(e.note)}</p>`:""}
|
|
1931
|
+
${Xc(e)}
|
|
1932
|
+
<p>${d(e.kind)} on ${d(e.cluster)} - due ${De(e.dueAt)}</p>
|
|
1933
|
+
${e.error?`<p class="error-text">${d(e.error)}</p>`:""}
|
|
1934
|
+
${e.txError?`<p class="error-text">${d(e.txError)}</p>`:""}
|
|
1935
|
+
${e.txid?ld(e.txid,e.cluster):""}
|
|
1936
|
+
</div>
|
|
1937
|
+
<div class="inbox-actions">
|
|
1938
|
+
<button data-action-op="execute" data-action-id="${e.id}" class="primary" ${!a.bridgeActive||a.busy||!t?"disabled":""}>Approve</button>
|
|
1939
|
+
<button data-action-op="reject" data-action-id="${e.id}" ${a.busy||["approved","rejected"].includes(e.status)?"disabled":""}>Reject</button>
|
|
1940
|
+
<button data-action-op="copy" data-action-id="${e.id}">Copy receipt</button>
|
|
1941
|
+
<button data-action-op="archive" data-action-id="${e.id}" ${a.busy?"disabled":""}>Archive</button>
|
|
1942
|
+
<button data-action-op="delete" data-action-id="${e.id}" ${a.busy?"disabled":""}>Delete</button>
|
|
1943
|
+
</div>
|
|
1944
|
+
</article>
|
|
1945
|
+
`}function Xc(e){return`
|
|
1946
|
+
<dl class="action-preview">
|
|
1947
|
+
${[["Wallet",R(e.walletAddress)],["Recipient",Pr(e,"recipient")?R(Pr(e,"recipient")):"n/a"],["Amount",ud(e)],["Token",pd(e)],["Caps","Checked before wallet opens"],["Fee","Estimated by wallet at approval"]].map(([r,l])=>We(r,l)).join("")}
|
|
1948
|
+
</dl>
|
|
1949
|
+
`}function ed(){const e=a.recurringDraft,t=e.recipient?R(e.recipient):"Recipient required",r=e.maxOccurrences?`${e.maxOccurrences} occurrence${e.maxOccurrences==="1"?"":"s"}`:"Manual review every time",l=!a.bridgeActive||a.busy;return`
|
|
1950
|
+
<div class="recurring-panel recurring-contract">
|
|
1951
|
+
<div class="contract-head">
|
|
1952
|
+
<div>
|
|
1953
|
+
<span>Recurring setup</span>
|
|
1954
|
+
<h3>Create recurring approval</h3>
|
|
1955
|
+
<p class="recurring-help">Define the recurring request. Each occurrence still requires wallet approval.</p>
|
|
1956
|
+
</div>
|
|
1957
|
+
<strong>${d(id(e.cadence))}</strong>
|
|
1958
|
+
</div>
|
|
1959
|
+
<dl class="contract-summary">
|
|
1960
|
+
${We("Asset",`${e.amount||"Amount"} ${e.token||"Token"}`)}
|
|
1961
|
+
${We("Recipient",t)}
|
|
1962
|
+
${We("Cadence",od(e))}
|
|
1963
|
+
${We("Limit",r)}
|
|
1964
|
+
</dl>
|
|
1965
|
+
<div class="contract-section">
|
|
1966
|
+
<div>
|
|
1967
|
+
<span>Payment terms</span>
|
|
1968
|
+
<p>What the prepared action will request from the wallet.</p>
|
|
1969
|
+
</div>
|
|
1970
|
+
<div class="recurring-grid">
|
|
1971
|
+
${Ne("recurringToken","Token",e.token)}
|
|
1972
|
+
${Ne("recurringAmount","Amount",e.amount)}
|
|
1973
|
+
${Ne("recurringRecipient","Recipient",e.recipient)}
|
|
1974
|
+
</div>
|
|
1975
|
+
</div>
|
|
1976
|
+
<div class="contract-section">
|
|
1977
|
+
<div>
|
|
1978
|
+
<span>Schedule terms</span>
|
|
1979
|
+
<p>When new approval items should appear for review.</p>
|
|
1980
|
+
</div>
|
|
1981
|
+
<div class="recurring-grid schedule-grid">
|
|
1982
|
+
<label class="field compact">
|
|
1983
|
+
<span>Cadence</span>
|
|
1984
|
+
<select id="recurringCadence">
|
|
1985
|
+
${ia("weekly","Weekly")}
|
|
1986
|
+
${ia("monthly","Monthly")}
|
|
1987
|
+
${ia("interval_days","Interval days")}
|
|
1988
|
+
${ia("interval_hours","Interval hours")}
|
|
1989
|
+
${ia("interval_minutes","Interval minutes")}
|
|
1990
|
+
</select>
|
|
1991
|
+
</label>
|
|
1992
|
+
${sd(e)}
|
|
1993
|
+
</div>
|
|
1994
|
+
</div>
|
|
1995
|
+
<label class="field compact approval-memo">
|
|
1996
|
+
<span>Approval memo</span>
|
|
1997
|
+
<input id="recurringNote" value="${d(e.note)}" placeholder="Reason shown in the approval inbox" />
|
|
1998
|
+
</label>
|
|
1999
|
+
<div class="recurring-form-actions contract-actions">
|
|
2000
|
+
<button id="createRecurring" class="primary" ${l?"disabled":""}>Create recurring approval</button>
|
|
2001
|
+
${l?'<span class="contract-helper">Bridge required before creating recurring approvals.</span>':'<span class="contract-helper">Recurring approvals create reviewable inbox items.</span>'}
|
|
2002
|
+
</div>
|
|
2003
|
+
</div>
|
|
2004
|
+
`}function td(){return!a.bridgeActive||a.recurringPayments.length===0?"":`
|
|
2005
|
+
<div class="recurring-list">
|
|
2006
|
+
${a.recurringPayments.map(ad).join("")}
|
|
2007
|
+
</div>
|
|
2008
|
+
`}function ad(e){return`
|
|
2009
|
+
<article class="recurring-item">
|
|
2010
|
+
<div>
|
|
2011
|
+
<div class="pill-row">
|
|
2012
|
+
<span class="status-pill ${e.status==="active"?"tx-confirmed":"neutral"}">${d(e.status)}</span>
|
|
2013
|
+
<span class="status-pill neutral">${d(e.cadence)}</span>
|
|
2014
|
+
<span class="recurring-count">${e.occurrencesCreated??0}${e.maxOccurrences?` of ${e.maxOccurrences}`:""}</span>
|
|
2015
|
+
</div>
|
|
2016
|
+
<h3>${d(e.amount)} ${d(e.token)} to ${d(R(e.recipient))}</h3>
|
|
2017
|
+
<p>${d(fd(e))}</p>
|
|
2018
|
+
${e.note?`<p class="action-note">${d(e.note)}</p>`:""}
|
|
2019
|
+
</div>
|
|
2020
|
+
<div class="recurring-actions">
|
|
2021
|
+
<button data-recurring-op="pause" data-recurring-id="${e.id}" ${e.status!=="active"||a.busy?"disabled":""}>Pause</button>
|
|
2022
|
+
<button data-recurring-op="resume" data-recurring-id="${e.id}" ${e.status!=="paused"||a.busy?"disabled":""}>Resume</button>
|
|
2023
|
+
<button data-recurring-op="delete" data-recurring-id="${e.id}" ${a.busy?"disabled":""}>Delete</button>
|
|
2024
|
+
</div>
|
|
2025
|
+
</article>
|
|
2026
|
+
`}function nd(e){return`
|
|
2027
|
+
<article class="lab-artifact artifact-summary-card">
|
|
2028
|
+
<div class="artifact-summary-head">
|
|
2029
|
+
<div class="artifact-meta-line">
|
|
2030
|
+
<span class="status-pill ${e.verified?"tx-confirmed":"tx-pending"}">${e.verified?"verified":"signed"}</span>
|
|
2031
|
+
<span>${d(en(e.kind))}</span>
|
|
2032
|
+
</div>
|
|
2033
|
+
<span>${d(De(e.createdAt))}</span>
|
|
2034
|
+
</div>
|
|
2035
|
+
<h3>${d(e.title)}</h3>
|
|
2036
|
+
<p class="lab-thesis">${d(e.payload.thesis)}</p>
|
|
2037
|
+
<div class="artifact-evidence-row">
|
|
2038
|
+
${Ot(e,"Decision")}
|
|
2039
|
+
${Ot(e,"Custody")}
|
|
2040
|
+
${Ot(e,"Settlement")}
|
|
2041
|
+
</div>
|
|
2042
|
+
<details class="artifact-technical-details">
|
|
2043
|
+
<summary>
|
|
2044
|
+
<span>Technical evidence</span>
|
|
2045
|
+
<strong>Hashes and signing payload</strong>
|
|
2046
|
+
</summary>
|
|
2047
|
+
<div class="hash-grid">
|
|
2048
|
+
${tt("Pre-signature",e.preSignatureHash)}
|
|
2049
|
+
${tt("Artifact",e.artifactHash)}
|
|
2050
|
+
${tt("Signature",e.signature)}
|
|
2051
|
+
${tt("Wallet",e.walletAddress)}
|
|
2052
|
+
</div>
|
|
2053
|
+
<div class="results compact-results">
|
|
2054
|
+
<div class="result-row">
|
|
2055
|
+
<span>Signing message</span>
|
|
2056
|
+
<code>${d(e.signingMessage)}</code>
|
|
2057
|
+
<button data-copy="${d(e.signingMessage)}">Copy</button>
|
|
2058
|
+
</div>
|
|
2059
|
+
</div>
|
|
2060
|
+
</details>
|
|
2061
|
+
</article>
|
|
2062
|
+
`}function Ot(e,t){const r=e.payload.metrics.find(b=>b.label.toLowerCase()===t.toLowerCase()),l=(r==null?void 0:r.value)??"Recorded";return`
|
|
2063
|
+
<div class="${(r==null?void 0:r.tone)??"neutral"}">
|
|
2064
|
+
<span>${d(t)}</span>
|
|
2065
|
+
<strong>${d(l)}</strong>
|
|
2066
|
+
</div>
|
|
2067
|
+
`}function Oi(){const e=a.preparedActions.filter(t=>!t.archived);switch(a.inboxFilter){case"one-time":return e.filter(t=>!t.recurringId);case"recurring":return e.filter(t=>!!t.recurringId);case"ready":return e.filter(t=>t.status==="ready"||t.status==="overdue");case"scheduled":return e.filter(t=>t.status==="scheduled");case"approved":return e.filter(t=>t.status==="approved");case"failed":return e.filter(t=>t.status==="failed"||t.status==="blocked");case"rejected":return e.filter(t=>t.status==="rejected");case"all":return e}}function Ze(e,t){return`<option value="${e}" ${a.inboxFilter===e?"selected":""}>${d(t)}</option>`}function rd(e){switch(e){case"ready":return"Showing ready approvals";case"scheduled":return"Showing scheduled items";case"approved":return"Showing approved approvals";case"failed":return"Showing needs attention";case"rejected":return"Showing rejected approvals";case"one-time":return"Showing one-time approvals";case"recurring":return"Showing recurring approvals";case"all":return"Showing all"}}function ia(e,t){return`<option value="${e}" ${a.recurringDraft.cadence===e?"selected":""}>${d(t)}</option>`}function id(e){switch(e){case"weekly":return"Weekly";case"monthly":return"Monthly";case"interval_days":return"Every few days";case"interval_hours":return"Hourly interval";case"interval_minutes":return"Minute interval"}}function od(e){const t=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];return e.cadence==="weekly"?`${t[Number(e.dayOfWeek)]??"Selected day"} at ${e.localTime||"09:00"}`:e.cadence==="monthly"?`Day ${e.dayOfMonth||"1"} at ${e.localTime||"09:00"}`:e.cadence==="interval_hours"?`Every ${e.intervalHours||"1"} hour(s)`:e.cadence==="interval_minutes"?`Every ${e.intervalMinutes||"60"} minute(s)`:`Every ${e.intervalDays||"1"} day(s)`}function sd(e){const t=Ne("recurringMaxOccurrences","Max occurrences",e.maxOccurrences,"empty for indefinite");return e.cadence==="weekly"?`
|
|
2068
|
+
<label class="field compact">
|
|
2069
|
+
<span>Day</span>
|
|
2070
|
+
<select id="recurringDayOfWeek">
|
|
2071
|
+
${["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"].map((r,l)=>`<option value="${l}" ${e.dayOfWeek===String(l)?"selected":""}>${r}</option>`).join("")}
|
|
2072
|
+
</select>
|
|
2073
|
+
</label>
|
|
2074
|
+
${Ne("recurringLocalTime","Local time",e.localTime,"09:00")}
|
|
2075
|
+
${t}
|
|
2076
|
+
`:e.cadence==="monthly"?`
|
|
2077
|
+
${Ne("recurringDayOfMonth","Day of month",e.dayOfMonth,"1-31")}
|
|
2078
|
+
${Ne("recurringLocalTime","Local time",e.localTime,"09:00")}
|
|
2079
|
+
${t}
|
|
2080
|
+
`:e.cadence==="interval_hours"?`
|
|
2081
|
+
${Ne("recurringIntervalHours","Every hours",e.intervalHours,"1")}
|
|
2082
|
+
${Ne("recurringStartAt","Start at",e.startAt,"","datetime-local")}
|
|
2083
|
+
${t}
|
|
2084
|
+
`:e.cadence==="interval_minutes"?`
|
|
2085
|
+
${Ne("recurringIntervalMinutes","Every minutes",e.intervalMinutes,"60")}
|
|
2086
|
+
${Ne("recurringStartAt","Start at",e.startAt,"","datetime-local")}
|
|
2087
|
+
${t}
|
|
2088
|
+
`:`
|
|
2089
|
+
${Ne("recurringIntervalDays","Every days",e.intervalDays,"1")}
|
|
2090
|
+
${Ne("recurringStartAt","Start at",e.startAt,"","datetime-local")}
|
|
2091
|
+
${t}
|
|
2092
|
+
`}function Ne(e,t,r,l="",p="text"){return`
|
|
2093
|
+
<label class="field compact">
|
|
2094
|
+
<span>${d(t)}</span>
|
|
2095
|
+
<input id="${e}" type="${p}" value="${d(r)}" placeholder="${d(l)}" />
|
|
2096
|
+
</label>
|
|
2097
|
+
`}function Xe(e,t,r){return`
|
|
2098
|
+
<article class="evidence-step ${r}">
|
|
2099
|
+
<div class="evidence-indicator"><span></span></div>
|
|
2100
|
+
<div>
|
|
2101
|
+
<div class="evidence-title">
|
|
2102
|
+
<strong>${d(e)}</strong>
|
|
2103
|
+
<span>${d(t.status)}</span>
|
|
2104
|
+
</div>
|
|
2105
|
+
<p>${d(t.detail)}</p>
|
|
2106
|
+
${t.meta?`<small>${d(t.meta)}</small>`:""}
|
|
2107
|
+
</div>
|
|
2108
|
+
</article>
|
|
2109
|
+
`}function Mi(){if(a.activeTab==="generated"){const e=Ka();return{status:a.generatedPlans.length?"Saved":"Empty",detail:(e==null?void 0:e.plan.intent)??"Generated AI and template plans are saved here for later review.",meta:e?`${Fn(e)} · ${De(e.createdAt)}`:void 0}}if(a.activeTab==="wallet")return{status:a.signature?"Signed":"Ready",detail:a.signature?"Message approval returned a wallet signature.":On,meta:a.signature?R(a.signature):`${Ge(a.cluster)} message request`};if(a.agentPlan)return{status:"Prepared",detail:a.agentPlan.intent,meta:"Agent plan is ready for wallet review."};if(a.signature)return{status:"Signed",detail:"Message intent was approved by the connected wallet.",meta:R(a.signature)};if(a.customTransactionBase64)return{status:"Transaction ready",detail:"Transaction bytes are staged for wallet approval.",meta:R(a.customTransactionBase64)};if(a.activeTab==="inbox"){const e=a.preparedActions.filter(t=>!t.archived).length;return{status:e?"Queued":"Empty",detail:e?`${e} prepared action(s) are ready for review.`:"No prepared actions are currently waiting.",meta:a.bridgeActive?"Bridge queue connected":"Bridge offline"}}if(a.activeTab==="schedule"){const e=a.recurringPayments.filter(t=>t.status==="active").length;return{status:e?"Recurring":"Draft",detail:e?`${e} recurring approval${e===1?"":"s"} active.`:"Create a recurring approval for future wallet review.",meta:a.bridgeActive?"Bridge recurring engine connected":"Bridge offline"}}if(a.activeTab==="labs"){if(a.artifactView==="signed")return{status:a.labArtifacts.length?"Archived":"Empty",detail:a.labArtifacts.length?`${a.labArtifacts.length} signed audit artifact(s) are available for review.`:"No signed audit artifacts have been created yet.",meta:a.labArtifacts[0]?R(a.labArtifacts[0].artifactHash):void 0};const e=Xa();return{status:"Artifact",detail:e.defaultInput,meta:e.title}}return{status:a.address?"Ready":"Waiting",detail:a.address?"Select a workflow to prepare intent.":"Connect a wallet before intent can be reviewed."}}function Wi(){var t,r;const e=a.preparedActions.filter(l=>!l.archived).length;if(a.activeTab==="wallet")return{status:a.cluster==="mainnet-beta"?"Mainnet caution":"Local policy",detail:a.cluster==="mainnet-beta"?"Only explicit wallet approval can produce a signature on mainnet.":"Wallet Standard approval gates every message and transaction request.",meta:a.capabilities?Yc(a.capabilities):void 0};if(a.activeTab==="agent")return{status:a.agentPlan?"Plan scoped":"Draft",detail:((t=a.agentPlan)==null?void 0:t.risk)??"Generate a plan to expose route and risk before signing.",meta:a.bridgeActive?"Can queue prepared action":"Bridge queue unavailable"};if(a.activeTab==="generated"){const l=Ka();return{status:l?"Review scoped":"No drafts",detail:(l==null?void 0:l.plan.risk)??"Generated plans stay separate from Approval Inbox until they are queued.",meta:l&&je(l.plan)?"Queueable with bridge":"Proof-only review"}}return a.activeTab==="schedule"?{status:a.bridgeActive?"Recurring ready":"Bridge required",detail:"Recurring approvals create reviewable inbox items, not automatic signatures.",meta:a.recurringPayments.length?`${a.recurringPayments.length} recurring approval(s)`:void 0}:a.activeTab==="labs"?a.artifactView==="signed"?{status:a.bridgeActive?"Bridge mirrored":"Local archive",detail:a.labArchiveStatus,meta:((r=a.health)==null?void 0:r.labArtifactStorePath)??(a.bridgeActive?"Bridge archive connected":"Browser durable storage")}:{status:"Local verification",detail:"Audit artifacts bind payload hash, wallet, cluster, and signature for review.",meta:a.labArtifacts.length?`${a.labArtifacts.length} artifact(s)`:"No artifacts yet"}:e>0?{status:"Queued",detail:`${e} prepared action(s) are waiting for review.`,meta:a.bridgeActive?"Local bridge policy is active.":"Bridge is offline."}:a.bridgeActive?{status:"Active",detail:"Local bridge is connected and ready to enforce prepared-action policy.",meta:Qn()}:{status:a.cluster==="mainnet-beta"?"Caution":"Idle",detail:a.cluster==="mainnet-beta"?"Mainnet requests require explicit wallet approval and visible receipts.":"Policy checks activate when the local bridge is connected."}}function Ri(){return a.address?{status:"Connected",detail:a.selectedWalletName||"Browser wallet signer is connected.",meta:R(a.address)}:{status:"Not connected",detail:"The app cannot sign or approve until a user wallet is connected.",meta:hd()}}function Bi(e){var t;if(a.activeTab==="wallet"&&a.signature)return{status:"Message proof",detail:"The wallet signature is ready to copy or verify downstream.",meta:R(a.signature)};if(a.activeTab==="agent"&&a.agentSignature)return{status:"Approval proof",detail:"The signed agent plan proof is available for audit.",meta:R(a.agentSignature)};if(a.activeTab==="generated"){const r=Ka();if(r!=null&&r.signature)return{status:"Proof signed",detail:"This generated plan has a wallet-signed review proof.",meta:R(r.signature)};if(r!=null&&r.preparedActionId)return{status:"Queued",detail:"This generated plan has been sent to Approval Inbox.",meta:r.preparedActionId}}return a.txid?{status:"Broadcast",detail:"A transaction id is available for external verification.",meta:R(a.txid)}:a.txSignature?{status:"Signed bytes",detail:"The wallet returned signed transaction bytes without broadcasting.",meta:R(a.txSignature)}:a.agentSignature?{status:"Proof signed",detail:"The agent approval proof is available for copy or audit.",meta:R(a.agentSignature)}:a.receipts.length>0?{status:"Receipt ready",detail:`${a.receipts.length} local receipt(s) are available from the bridge.`,meta:(t=a.receipts[0])==null?void 0:t.actionId}:a.activeTab==="labs"&&e?{status:"Artifact",detail:"A signed audit artifact is available for review.",meta:R(e.artifactHash)}:{status:"Pending",detail:a.activeTab==="inbox"||a.activeTab==="schedule"?"Receipts appear after an approval is approved, rejected, or archived.":"Receipts appear after wallet approval or signed artifact creation."}}function et(e){switch(e){case"intent":return a.agentPlan||a.generatedPlans.length||a.signature||a.customTransactionBase64?"good":a.address?"active":"idle";case"policy":return a.preparedActions.length||a.bridgeActive?"good":a.cluster==="mainnet-beta"?"warn":"idle";case"wallet":return a.address?"good":"idle";case"receipt":return a.txid||a.txSignature||a.agentSignature||a.receipts.length||a.labArtifacts.length?"good":"idle"}}function ht(e,t,r=""){return`
|
|
2110
|
+
<div class="context-row ${r}">
|
|
2111
|
+
<span>${d(e)}</span>
|
|
2112
|
+
<strong>${d(t)}</strong>
|
|
2113
|
+
</div>
|
|
2114
|
+
`}function ld(e,t){const r=kd(e,t);return`
|
|
2115
|
+
<div class="tx-block">
|
|
2116
|
+
<code>${d(e)}</code>
|
|
2117
|
+
<a href="${d(r)}" target="_blank" rel="noreferrer">Explorer</a>
|
|
2118
|
+
<button data-copy="${d(e)}">Copy</button>
|
|
2119
|
+
</div>
|
|
2120
|
+
`}function tt(e,t){return`
|
|
2121
|
+
<div>
|
|
2122
|
+
<span>${d(e)}</span>
|
|
2123
|
+
<code>${d(R(t))}</code>
|
|
2124
|
+
</div>
|
|
2125
|
+
`}function We(e,t){return`
|
|
2126
|
+
<div>
|
|
2127
|
+
<dt>${d(e)}</dt>
|
|
2128
|
+
<dd>${d(t)}</dd>
|
|
2129
|
+
</div>
|
|
2130
|
+
`}function cd(){switch(a.activeTab){case"wallet":return"Wallet signing";case"agent":return"Agent Plan";case"generated":return"Generated Plans";case"inbox":return"Approval Inbox";case"schedule":return"Create Recurring";case"labs":return"Artifacts"}}function dd(){return a.inboxFilter==="one-time"?"No one-time actions. Ask the MCP agent to prepare a payment or swap.":a.inboxFilter==="recurring"?"No recurring actions yet. Create a recurring approval above.":"No prepared actions yet. Ask the MCP agent to prepare a payment, swap, or recurring payment."}function ud(e){return typeof e.params.amountSol=="string"?`${e.params.amountSol} SOL`:typeof e.params.amount=="string"?e.params.amount:"n/a"}function pd(e){return e.kind==="transfer_sol"?"SOL":typeof e.params.token=="string"?e.params.token:typeof e.params.inputToken=="string"&&typeof e.params.outputToken=="string"?`${e.params.inputToken} to ${e.params.outputToken}`:"n/a"}function Pr(e,t){const r=e.params[t];return typeof r=="string"?r:""}function fd(e){const t=e.maxOccurrences?`, ${e.occurrencesCreated??0} of ${e.maxOccurrences} created`:", indefinite";return e.cadence==="weekly"?`Weekly on ${["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.dayOfWeek??-1]??"unknown day"} at ${e.localTime??"?"}${t}.`:e.cadence==="monthly"?`Monthly on day ${e.dayOfMonth??"?"} at ${e.localTime??"?"}${t}.`:e.cadence==="interval_hours"?`Every ${e.intervalHours??"?"} hour(s) starting ${De(e.startAt??"")}${t}.`:e.cadence==="interval_minutes"?`Every ${e.intervalMinutes??"?"} minute(s) starting ${De(e.startAt??"")}${t}.`:`Every ${e.intervalDays??"?"} day(s) starting ${De(e.startAt??"")}${t}.`}function Cr(e){return e==="approved"||e==="ready"||e==="overdue"?"tx-confirmed":e==="approval_pending"||e==="scheduled"?"tx-pending":e==="failed"||e==="blocked"||e==="rejected"?"tx-failed":"neutral"}function gd(e){return e==="confirmed"?"tx-confirmed":e==="failed"?"tx-failed":"tx-pending"}function Da(e){return e.replace(/[-_]+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase())}function hd(){return a.androidNativeEnvironment.isAndroidNative?"Android native MWA ready":a.iosNativeEnvironment.isIosNative?"iOS native wallet ready":a.mwaEnvironment.supportsMwaMobileWeb?"Android MWA ready":a.mwaEnvironment.supportsIosWalletStandardFallback?"iOS wallet browser":"Desktop browser wallet"}function md(){const e=a.mwaRegistration;if(!e)return a.mwaEnvironment.supportsMwaMobileWeb?"Android Chrome can register Mobile Wallet Adapter.":"MWA unavailable here. Browser Wallet Standard providers still work when injected.";if(e.registered)return"Registered. Android Chrome users can select Mobile Wallet Adapter.";switch(e.skippedReason){case"already_registered":return"Already registered. Android MWA remains available if this browser supports it.";case"not_browser":return"Skipped outside browser. Desktop wallets still work.";case"registration_failed":return"Registration failed. Desktop browser wallets still work.";case"unsupported_environment":return e.environment.supportsIosWalletStandardFallback?"MWA is Android-only. On iOS, open this page inside a wallet in-app browser or use a wallet Safari extension.":e.environment.isAndroid?"Android detected, but MWA mobile web requires Chrome or a Chrome PWA.":"MWA unavailable here. Browser Wallet Standard providers still work when injected.";default:return"Desktop browser mode. Android MWA appears only on Android Chrome or PWA."}}function bd(){var t;const e=(t=a.preparedActions.find(r=>r.txid))==null?void 0:t.txid;return e?R(e):"None"}function Ui(e){return a.labArtifacts.find(t=>t.labId===e)??null}function Xa(){return qe.find(e=>e.id===a.activeLab)??qe[0]}function Di(e){var t;return a.labInputs[e]??((t=qe.find(r=>r.id===e))==null?void 0:t.defaultInput)??""}function vd(){const e=qe.findIndex(t=>t.id===a.activeLab);return e>=0?`lab ${e+1} of ${qe.length}`:"lab"}async function yd(e,t,r){const l=/\bunlimited\b|seed phrase|private key|unknown custody/i.test(t),p=l?"blocked":/unknown|authority|insurance|override/i.test(t)?"warn":"approved",b=[["Request",t,l?"danger":"neutral"],["Wallet gate","Final transaction signing remains a separate wallet approval.","good"],["Replay guard",`Artifact time ${r} binds this record to one review moment.`,"good"]],x=await Promise.all(b.map(async([G,ne,ue])=>({title:G,detail:ne,tone:ue,hash:await Ln(Fe({title:G,detail:ne,tone:ue}))})));return{status:p,thesis:wd(e,p),nextSignatureGate:p==="blocked"?"Future matching requests should warn before wallet approval and require a fresh explicit signature.":"Only sign settlement if the future transaction preview matches this signed envelope.",metrics:[{label:"Decision",value:p,tone:p==="blocked"?"danger":p==="warn"?"warn":"good"},{label:"Custody",value:"user wallet",tone:"good"},{label:"Settlement",value:"future gated",tone:"neutral"}],evidence:x}}function wd(e,t){const r=qe.find(l=>l.id===e);return r?t==="blocked"?"The request becomes a refusal fingerprint without exposing private wallet data.":t==="warn"?"The request is reviewable, but the next wallet signature must prove semantic and policy alignment.":r.description:"Signed agent artifact created."}function qi(){return{token:Le("#recurringToken")||a.recurringDraft.token,recipient:Le("#recurringRecipient")||a.recurringDraft.recipient,amount:Le("#recurringAmount")||a.recurringDraft.amount,cadence:Le("#recurringCadence")||a.recurringDraft.cadence,localTime:Le("#recurringLocalTime")||a.recurringDraft.localTime,dayOfWeek:Le("#recurringDayOfWeek")||a.recurringDraft.dayOfWeek,dayOfMonth:Le("#recurringDayOfMonth")||a.recurringDraft.dayOfMonth,intervalDays:Le("#recurringIntervalDays")||a.recurringDraft.intervalDays,intervalHours:Le("#recurringIntervalHours")||a.recurringDraft.intervalHours,intervalMinutes:Le("#recurringIntervalMinutes")||a.recurringDraft.intervalMinutes,startAt:Le("#recurringStartAt")||a.recurringDraft.startAt,maxOccurrences:Le("#recurringMaxOccurrences")||a.recurringDraft.maxOccurrences,note:Le("#recurringNote")||a.recurringDraft.note}}function xd(e){const t={token:e.token,recipient:e.recipient,amount:e.amount,cadence:e.cadence};e.note&&(t.note=e.note);const r=Number(e.maxOccurrences);return Number.isInteger(r)&&r>0&&(t.maxOccurrences=r),e.cadence==="weekly"?(t.dayOfWeek=Number(e.dayOfWeek),t.localTime=e.localTime):e.cadence==="monthly"?(t.dayOfMonth=Number(e.dayOfMonth),t.localTime=e.localTime):e.cadence==="interval_hours"?(t.intervalHours=Number(e.intervalHours),t.startAt=Pn(e.startAt)):e.cadence==="interval_minutes"?(t.intervalMinutes=Number(e.intervalMinutes),t.startAt=Pn(e.startAt)):(t.intervalDays=Number(e.intervalDays),t.startAt=Pn(e.startAt)),t}function Ad(){return{token:"SOL",recipient:"",amount:"0.01",cadence:"weekly",localTime:"09:00",dayOfWeek:"1",dayOfMonth:"1",intervalDays:"1",intervalHours:"24",intervalMinutes:"60",startAt:Md(new Date(Date.now()+6e4)),maxOccurrences:"",note:""}}function Sd(){return Object.fromEntries(qe.map(e=>[e.id,e.defaultInput]))}function kn(e){var t;return((t=e.display)==null?void 0:t.summary)!==void 0?{cluster:e.cluster,summary:e.display.summary}:{cluster:e.cluster}}function ya(e){return{cluster:a.cluster,summary:e}}function qa(){return a.bridgeRpcUrl||Zn(a.cluster)}function Zn(e){switch(e){case"mainnet-beta":return"https://api.mainnet-beta.solana.com";case"devnet":return"https://api.devnet.solana.com";case"testnet":return"https://api.testnet.solana.com";case"localnet":return"http://127.0.0.1:8899"}}function $d(){return a.bridgeUrl.endsWith("/")?a.bridgeUrl:`${a.bridgeUrl}/`}function Qn(){try{return new URL(a.bridgeUrl).host}catch{return a.bridgeUrl}}function Ge(e){return e==="mainnet-beta"?"Mainnet-Beta":e[0].toUpperCase()+e.slice(1)}function en(e){return e.split("_").filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join(" ")}function kd(e,t){const r=t==="mainnet-beta"?"":`?cluster=${t}`;return`https://solscan.io/tx/${e}${r}`}function Pd(){var l;const e=Gr,t=String((e==null?void 0:e.VITE_AGENTIC_DEV_CONTROLS)??"").trim().toLowerCase();if(["1","true","yes","on"].includes(t))return!0;if(["0","false","no","off"].includes(t))return!1;const r=((l=globalThis.location)==null?void 0:l.hostname)??"";return r==="localhost"||r==="127.0.0.1"||r==="::1"}function Cd(){return Ld()?"bridge":"hosted"}function Td(e){var x,G;const t=nt(_n),r=e.aiProvider?nt(e.aiProvider):t,l=e.aiMode??Cd(),p=((x=e.aiModel)==null?void 0:x.trim())||r.model,b={mode:l,provider:r.id,apiFormat:e.aiApiFormat??r.apiFormat,baseUrl:((G=e.aiBaseUrl)==null?void 0:G.trim())||r.baseUrl,model:p};return b.mode==="hosted"&&b.provider==="custom-openai-compatible"?{mode:b.mode,provider:t.id,apiFormat:t.apiFormat,baseUrl:t.baseUrl,model:t.model}:b}function Ld(){var t;const e=((t=globalThis.location)==null?void 0:t.hostname)??"";return e==="localhost"||e==="127.0.0.1"||e==="::1"||e===""}function Id(){const e=Gr,t=String(e==null?void 0:e.VITE_AGENTIC_ANDROID_SHOW_EXAMPLE_TAB).trim().toLowerCase();return["1","true","yes","on"].includes(t)}function Xn(){return globalThis.AgenticAndroid}function ji(){const e=Xn();if(!(e!=null&&e.openMwaExample)){B("error","MWA unavailable","Open this tab inside an Android build with the MWA tab enabled.");return}e.openMwaExample()}function wa(e){return e==="mainnet-beta"||e==="devnet"||e==="testnet"||e==="localnet"}function Ed(e){return e==="hosted"||e==="session"||e==="bridge"}function _d(e){return e==="openai-compatible"||e==="anthropic"}function Nd(e){return ua.some(t=>t.id===e)}function Od(e){return e==="phantom"||e==="solflare"||e==="backpack"||e==="jupiter"}function Le(e){const t=document.querySelector(e);return(t==null?void 0:t.value.trim())??""}function Pn(e){const t=new Date(e);if(Number.isNaN(t.getTime()))throw new Error("Start time must be a valid local date and time.");return t.toISOString()}function Md(e){const t=e.getTimezoneOffset()*6e4;return new Date(e.getTime()-t).toISOString().slice(0,16)}function De(e){const t=new Date(e);return Number.isNaN(t.getTime())?e||"n/a":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(t)}function Wd(e){return e instanceof Re?e.toPayload():{code:"wallet_unreachable",message:e instanceof Error?e.message:"Wallet request failed.",recoverable:!0}}function Rd(e){if(e&&typeof e=="object"&&"error"in e){const t=e.error;if(typeof t=="string")return Qe(t);if(t&&typeof t=="object"&&"message"in t){const r=t.message;if(typeof r=="string")return Qe(r)}return Qe(Fe(t))}return Qe(Fe(e))}async function Ln(e){const t=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(e));return Array.from(new Uint8Array(t),r=>r.toString(16).padStart(2,"0")).join("")}function Fe(e){return JSON.stringify(In(e),null,2)}function In(e){if(Array.isArray(e))return e.map(In);if(e&&typeof e=="object"){const t={};for(const r of Object.keys(e).sort()){const l=e[r];l!==void 0&&(t[r]=In(l))}return t}return e}function Bd(e,t){try{return po.sign.detached.verify(new TextEncoder().encode(e),ao.decode(t),Vn().toBytes())}catch{return!1}}function Fi(e){const t=new Uint8Array(8);globalThis.crypto.getRandomValues(t);const r=Array.from(t,l=>l.toString(16).padStart(2,"0")).join("");return`${e}_${r}`}function Ud(){return a.toasts.length===0?"":`
|
|
2131
|
+
<div class="toast-stack" aria-live="polite">
|
|
2132
|
+
${a.toasts.map(e=>`
|
|
2133
|
+
<div class="toast ${e.kind}">
|
|
2134
|
+
<span class="toast-icon" aria-hidden="true">${jd(e.kind)}</span>
|
|
2135
|
+
<div>
|
|
2136
|
+
<strong>${d(e.title)}</strong>
|
|
2137
|
+
<p>${d(e.message)}</p>
|
|
2138
|
+
</div>
|
|
2139
|
+
<button data-toast-dismiss="${e.id}" aria-label="Dismiss notification">x</button>
|
|
2140
|
+
</div>
|
|
2141
|
+
`).join("")}
|
|
2142
|
+
</div>
|
|
2143
|
+
`}function B(e,t,r){const l={id:pr,kind:e,title:t,message:r};return pr+=1,a.toasts=[l,...a.toasts].slice(0,2),e!=="pending"&&window.setTimeout(()=>{er(l.id)},4e3),l.id}function ja(e,t,r,l){a.toasts=a.toasts.map(p=>p.id===e?{...p,kind:t,title:r,message:l}:p),t!=="pending"&&window.setTimeout(()=>{er(e)},4e3),ee()}function er(e){const t=a.toasts.filter(r=>r.id!==e);t.length!==a.toasts.length&&(a.toasts=t,ee())}function Dd(){return'<svg viewBox="0 0 24 24" focusable="false"><path d="M9.4 16.6 5.8 13l1.4-1.4 2.2 2.2 7.4-7.4L18.2 8 9.4 16.6Z"></path></svg>'}function qd(){return'<svg viewBox="0 0 24 24" focusable="false"><path d="m12 10.6 4.1-4.1 1.4 1.4-4.1 4.1 4.1 4.1-1.4 1.4-4.1-4.1-4.1 4.1-1.4-1.4 4.1-4.1-4.1-4.1 1.4-1.4 4.1 4.1Z"></path></svg>'}function jd(e){return e==="pending"?'<span class="toast-spinner"></span>':e==="error"?qd():Dd()}function Tr(){return'<span class="button-spinner" aria-hidden="true"></span>'}function R(e){return e.length<=16?e:`${e.slice(0,8)}...${e.slice(-8)}`}function d(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Fd(e){let t="";for(const r of e)t+=String.fromCharCode(r);return btoa(t)}function Gd(){try{const e=window.localStorage.getItem(Yr);if(!e)return{};const t=JSON.parse(e);return{...typeof t.selectedWalletName=="string"&&{selectedWalletName:t.selectedWalletName},...typeof t.selectedIosWalletId=="string"&&Od(t.selectedIosWalletId)&&{selectedIosWalletId:t.selectedIosWalletId},...typeof t.cluster=="string"&&wa(t.cluster)&&{cluster:t.cluster},...typeof t.bridgeUrl=="string"&&{bridgeUrl:t.bridgeUrl},...typeof t.bridgeToken=="string"&&{bridgeToken:t.bridgeToken},...typeof t.aiMode=="string"&&Ed(t.aiMode)&&{aiMode:t.aiMode},...typeof t.aiProvider=="string"&&Nd(t.aiProvider)&&{aiProvider:t.aiProvider},...typeof t.aiApiFormat=="string"&&_d(t.aiApiFormat)&&{aiApiFormat:t.aiApiFormat},...typeof t.aiBaseUrl=="string"&&{aiBaseUrl:t.aiBaseUrl},...typeof t.aiModel=="string"&&{aiModel:t.aiModel}}}catch{return{}}}function me(){try{window.localStorage.setItem(Yr,JSON.stringify({selectedWalletName:a.selectedWalletName,selectedIosWalletId:a.selectedIosWalletId,cluster:a.cluster,bridgeUrl:a.bridgeUrl,bridgeToken:a.bridgeToken,aiMode:a.aiSettings.mode,aiProvider:a.aiSettings.provider,aiApiFormat:a.aiSettings.apiFormat,aiBaseUrl:a.aiSettings.baseUrl,aiModel:a.aiSettings.model}))}catch{}}function Yd(){try{const e=window.localStorage.getItem(Hr);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?ar(t.filter(Gi)):[]}catch{return[]}}function tr(){try{a.generatedPlans=ar(a.generatedPlans),window.localStorage.setItem(Hr,JSON.stringify(a.generatedPlans))}catch{}}function ar(...e){const t=new Map;for(const r of e)for(const l of r){if(!Gi(l))continue;const p=t.get(l.id);(!p||l.updatedAt.localeCompare(p.updatedAt)>=0)&&t.set(l.id,l)}return[...t.values()].sort((r,l)=>l.createdAt.localeCompare(r.createdAt)).slice(0,Ho)}function Gi(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&Hd(t.plan)&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string"&&(t.source==="template"||t.source==="ai")&&typeof t.templateId=="string"&&typeof t.templateTitle=="string"&&typeof t.prompt=="string"&&typeof t.walletAddress=="string"&&wa(t.cluster??"")&&Kd(t.status)&&(t.signature===void 0||typeof t.signature=="string")&&(t.preparedActionId===void 0||typeof t.preparedActionId=="string")}function Hd(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.intent=="string"&&typeof t.route=="string"&&typeof t.risk=="string"&&typeof t.approval=="string"&&(t.source==="template"||t.source==="ai")&&typeof t.category=="string"&&typeof t.actionType=="string"&&typeof t.templateTitle=="string"&&(t.userNotes===void 0||typeof t.userNotes=="string")&&!!t.parameters&&typeof t.parameters=="object"&&!Array.isArray(t.parameters)&&Object.values(t.parameters).every(r=>typeof r=="string")&&Array.isArray(t.fields)&&t.fields.every(zd)&&Array.isArray(t.safeguards)&&t.safeguards.every(r=>typeof r=="string")}function zd(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.label=="string"&&typeof t.value=="string"}function Kd(e){return e==="draft"||e==="signed"||e==="queued"||e==="archived"}function Yi(){try{const e=window.localStorage.getItem(zr);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?rt(t.filter(tn)):[]}catch{return[]}}async function Hi(){const e=Yi(),t=await Zd().catch(()=>[]);a.labArtifacts=rt(a.labArtifacts,e,t),await Jd(),await nr()}async function nr(){a.labArtifacts=rt(a.labArtifacts),await Qd(a.labArtifacts).catch(()=>{});try{window.localStorage.setItem(zr,JSON.stringify(a.labArtifacts))}catch{}}function rt(...e){const t=new Map;for(const r of e)for(const l of r){if(!tn(l))continue;const p=t.get(l.id);(!p||l.createdAt.localeCompare(p.createdAt)>=0)&&t.set(l.id,l)}return[...t.values()].sort((r,l)=>l.createdAt.localeCompare(r.createdAt))}function tn(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&typeof t.labId=="string"&&typeof t.title=="string"&&typeof t.kind=="string"&&typeof t.createdAt=="string"&&typeof t.walletAddress=="string"&&wa(t.cluster??"")&&typeof t.input=="string"&&typeof t.preSignatureHash=="string"&&typeof t.signingMessage=="string"&&typeof t.signature=="string"&&typeof t.verified=="boolean"&&typeof t.artifactHash=="string"&&Vd(t.payload)}function Vd(e){if(!e||typeof e!="object")return!1;const t=e;return(t.status==="approved"||t.status==="blocked"||t.status==="warn"||t.status==="observed")&&typeof t.thesis=="string"&&typeof t.nextSignatureGate=="string"&&Array.isArray(t.metrics)&&Array.isArray(t.evidence)}async function Jd(){var e,t,r;try{if(!((e=navigator.storage)!=null&&e.persist)){a.labArchiveStatus="Browser archive ready.";return}if(await((r=(t=navigator.storage).persisted)==null?void 0:r.call(t))){a.labArchiveStatus="Persistent browser archive ready.";return}const p=await navigator.storage.persist();a.labArchiveStatus=p?"Persistent browser archive ready.":"Browser archive ready."}catch{a.labArchiveStatus="Browser archive ready."}}async function Zd(){const e=await zi();return new Promise((t,r)=>{const l=e.transaction(Wt,"readonly"),b=l.objectStore(Wt).getAll();b.onsuccess=()=>t(rt(b.result.filter(tn))),b.onerror=()=>r(b.error??new Error("Unable to load lab artifact archive.")),l.oncomplete=()=>e.close(),l.onerror=()=>{e.close(),r(l.error??new Error("Unable to load lab artifact archive."))}})}async function Qd(e){const t=await zi();await new Promise((r,l)=>{const p=t.transaction(Wt,"readwrite"),b=p.objectStore(Wt);for(const x of rt(e))b.put(x);p.oncomplete=()=>{t.close(),r()},p.onerror=()=>{t.close(),l(p.error??new Error("Unable to save lab artifact archive."))}})}function zi(){return new Promise((e,t)=>{if(!window.indexedDB){t(new Error("IndexedDB is unavailable."));return}const r=window.indexedDB.open(zo,Ko);r.onupgradeneeded=()=>{const l=r.result;l.objectStoreNames.contains(Wt)||l.createObjectStore(Wt,{keyPath:"id"}).createIndex("createdAt","createdAt")},r.onsuccess=()=>e(r.result),r.onerror=()=>t(r.error??new Error("Unable to open lab artifact archive."))})}
|