signetai 0.53.3 → 0.54.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.
@@ -0,0 +1 @@
1
+ import{bb as be,o as Ne,g as A,l as U,k as T,R as ee,bc as pt}from"./DD0ItAbu.js";class ke{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Ee{constructor(t,n){this.status=t,this.location=n}}class Se extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function gt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function mt(e){return e.split("%25").map(decodeURI).join("%25")}function _t(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function de({href:e}){return e.split("#")[0]}function vt(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(s,o){if(o==="get"||o==="getAll"||o==="has")return(c,...d)=>(n(c),s[o](c,...d));t();const l=Reflect.get(s,o);return typeof l=="function"?l.bind(s):l}}),enumerable:!0,configurable:!0});const i=["href","pathname","search","toString","toJSON"];r&&i.push("hash");for(const s of i)Object.defineProperty(a,s,{get(){return t(),e[s]},enumerable:!0,configurable:!0});return a}function wt(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;new TextDecoder;function yt(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const bt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&G.delete(Re(e)),bt(e,t));const G=new Map;function kt(e,t){const n=Re(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...i}=JSON.parse(r.textContent);const s=r.getAttribute("data-ttl");return s&&G.set(n,{body:a,init:i,ttl:1e3*Number(s)}),r.getAttribute("data-b64")!==null&&(a=yt(a)),Promise.resolve(new Response(a,i))}return window.fetch(e,t)}function Et(e,t,n){if(G.size>0){const r=Re(e,n),a=G.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(a.body,a.init);G.delete(r)}}return window.fetch(t,n)}function Re(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${wt(...a)}"]`}return r}const St=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Rt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Lt(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const i=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(i)return t.push({name:i[1],matcher:i[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const s=r.split(/\[(.+?)\](?!\])/);return"/"+s.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return he(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return he(String.fromCharCode(...l.slice(2).split("-").map(v=>parseInt(v,16))));const d=St.exec(l),[,p,f,u,h]=d;return t.push({name:u,matcher:h,optional:!!p,rest:!!f,chained:f?c===1&&s[0]==="":!1}),f?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return he(l)}).join("")}).join("")}/?$`),params:t}}function xt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Lt(e){return e.slice(1).split("/").filter(xt)}function At(e,t,n){const r={},a=e.slice(1),i=a.filter(o=>o!==void 0);let s=0;for(let o=0;o<t.length;o+=1){const l=t[o];let c=a[o-s];if(l.chained&&l.rest&&s&&(c=a.slice(o-s,o+1).filter(d=>d).join("/"),s=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const d=t[o+1],p=a[o+1];d&&!d.rest&&d.optional&&p&&l.chained&&(s=0),!d&&!p&&Object.keys(r).length===i.length&&(s=0);continue}if(l.optional&&l.chained){s++;continue}return}if(!s)return r}function he(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ut({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[l,c,d]])=>{const{pattern:p,params:f}=Rt(o),u={id:o,exec:h=>{const v=p.exec(h);if(v)return At(v,f,r)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...c||[]].map(s),leaf:i(l)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function i(o){const l=o<0;return l&&(o=~o),[l,e[o]]}function s(o){return o===void 0?o:[a.has(o),e[o]]}}function Me(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function je(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const x=globalThis.__sveltekit_4mvmnt?.base??"",Tt=globalThis.__sveltekit_4mvmnt?.assets??x??"",Pt="1773191761227",He="sveltekit:snapshot",We="sveltekit:scroll",Je="sveltekit:states",It="sveltekit:pageurl",K="sveltekit:history",H="sveltekit:navigation",N={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},xe=location.origin;function Ye(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function D(){return{x:pageXOffset,y:pageYOffset}}function V(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const De={...N,"":N.hover};function ze(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function Xe(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=ze(e)}}function me(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,i=!r||!!a||ce(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),s=r?.origin===xe&&e.hasAttribute("download");return{url:r,external:i,target:a,download:s}}function te(e){let t=null,n=null,r=null,a=null,i=null,s=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=V(o,"preload-code")),a===null&&(a=V(o,"preload-data")),t===null&&(t=V(o,"keepfocus")),n===null&&(n=V(o,"noscroll")),i===null&&(i=V(o,"reload")),s===null&&(s=V(o,"replacestate")),o=ze(o);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:De[r??"off"],preload_data:De[a??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(s)}}function qe(e){const t=be(e);let n=!0;function r(){n=!0,t.update(s=>s)}function a(s){n=!1,t.set(s)}function i(s){let o;return t.subscribe(l=>{(o===void 0||n&&l!==o)&&s(o=l)})}return{notify:r,set:a,subscribe:i}}const Qe={v:()=>{}};function Ot(){const{set:e,subscribe:t}=be(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Tt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const s=(await a.json()).version!==Pt;return s&&(e(!0),Qe.v(),clearTimeout(n)),s}catch{return!1}}return{subscribe:t,check:r}}function ce(e,t,n){return e.origin!==xe||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function sn(e){}const Ze=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...Ze];const Ct=new Set([...Ze]);[...Ct];function $t(e){return e.filter(t=>t!=null)}function Le(e){return e instanceof ke||e instanceof Se?e.status:500}function Nt(e){return e instanceof Se?e.text:"Internal Error"}let k,W,pe;const jt=Ne.toString().includes("$$")||/function \w+\(\) \{\}/.test(Ne.toString());jt?(k={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},W={current:null},pe={current:!1}):(k=new class{#e=A({});get data(){return U(this.#e)}set data(t){T(this.#e,t)}#t=A(null);get form(){return U(this.#t)}set form(t){T(this.#t,t)}#n=A(null);get error(){return U(this.#n)}set error(t){T(this.#n,t)}#r=A({});get params(){return U(this.#r)}set params(t){T(this.#r,t)}#a=A({id:null});get route(){return U(this.#a)}set route(t){T(this.#a,t)}#o=A({});get state(){return U(this.#o)}set state(t){T(this.#o,t)}#s=A(-1);get status(){return U(this.#s)}set status(t){T(this.#s,t)}#i=A(new URL("https://example.com"));get url(){return U(this.#i)}set url(t){T(this.#i,t)}},W=new class{#e=A(null);get current(){return U(this.#e)}set current(t){T(this.#e,t)}},pe=new class{#e=A(!1);get current(){return U(this.#e)}set current(t){T(this.#e,t)}},Qe.v=()=>pe.current=!0);function Dt(e){Object.assign(k,e)}const Ve={spanContext(){return qt},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},qt={traceId:"",spanId:"",traceFlags:0},Vt=new Set(["icon","shortcut icon","apple-touch-icon"]),$=Me(We)??{},J=Me(He)??{},C={url:qe({}),page:qe({}),navigating:be(null),updated:Ot()};function Ae(e){$[e]=D()}function Kt(e,t){let n=e+1;for(;$[n];)delete $[n],n+=1;for(n=t+1;J[n];)delete J[n],n+=1}function Y(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function et(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function Ke(){}let Ue,_e,ne,P,ve,w;const re=[],ae=[];let L=null;function we(){L?.fork?.then(e=>e?.discard()),L=null}const Z=new Map,tt=new Set,Bt=new Set,M=new Set;let _={branch:[],error:null,url:null},nt=!1,oe=!1,Be=!0,z=!1,F=!1,rt=!1,Te=!1,at,y,R,j;const se=new Set,Fe=new Map;async function fn(e,t,n){globalThis.__sveltekit_4mvmnt?.data&&globalThis.__sveltekit_4mvmnt.data,document.URL!==location.href&&(location.href=location.href),w=e,await e.hooks.init?.(),Ue=Ut(e),P=document.documentElement,ve=t,_e=e.nodes[0],ne=e.nodes[1],_e(),ne(),y=history.state?.[K],R=history.state?.[H],y||(y=R=Date.now(),history.replaceState({...history.state,[K]:y,[H]:R},""));const r=$[y];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await tn(ve,n)):(await B({type:"enter",url:Ye(w.hash?an(new URL(location.href)):location.href),replace_state:!0}),a()),en()}function Ft(){re.length=0,Te=!1}function ot(e){ae.some(t=>t?.snapshot)&&(J[e]=ae.map(t=>t?.snapshot?.capture()))}function st(e){J[e]?.forEach((t,n)=>{ae[n]?.snapshot?.restore(t)})}function Ge(){Ae(y),je(We,$),ot(R),je(He,J)}async function Gt(e,t,n,r){let a;t.invalidateAll&&we(),await B({type:"goto",url:Ye(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Te=!0,a=[...Fe.keys()]),t.invalidate&&t.invalidate.forEach(Zt)}}),t.invalidateAll&&ee().then(ee).then(()=>{Fe.forEach(({resource:i},s)=>{a?.includes(s)&&i.refresh?.()})})}async function Mt(e){if(e.id!==L?.id){we();const t={};se.add(t),L={id:e.id,token:t,promise:ct({...e,preload:t}).then(n=>(se.delete(t),n.type==="loaded"&&n.state.error&&we(),n)),fork:null}}return L.promise}async function ge(e){const t=(await ue(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].map(n=>n?.[1]()))}async function it(e,t,n){_=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(k,e.props.page),at=new w.root({target:t,props:{...e.props,stores:C,components:ae},hydrate:n,sync:!1}),await Promise.resolve(),st(R),n){const a={from:null,to:{params:_.params,route:{id:_.route?.id??null},url:new URL(location.href),scroll:$[y]??D()},willUnload:!1,type:"enter",complete:Promise.resolve()};M.forEach(i=>i(a))}oe=!0}function ie({url:e,params:t,branch:n,status:r,error:a,route:i,form:s}){let o="never";if(x&&(e.pathname===x||e.pathname===x+"/"))o="always";else for(const u of n)u?.slash!==void 0&&(o=u.slash);e.pathname=gt(e.pathname,o),e.search=e.search;const l={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:i},props:{constructors:$t(n).map(u=>u.node.component),page:$e(k)}};s!==void 0&&(l.props.form=s);let c={},d=!k,p=0;for(let u=0;u<Math.max(n.length,_.branch.length);u+=1){const h=n[u],v=_.branch[u];h?.data!==v?.data&&(d=!0),h&&(c={...c,...h.data},d&&(l.props[`data_${p}`]=c),p+=1)}return(!_.url||e.href!==_.url.href||_.error!==a||s!==void 0&&s!==k.form||d)&&(l.props.page={error:a,params:t,route:{id:i?.id??null},state:{},status:r,url:new URL(e),form:s??null,data:d?c:k.data}),l}async function Pe({loader:e,parent:t,url:n,params:r,route:a,server_data_node:i}){let s=null,o=!0;const l={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},c=await e();if(c.universal?.load){let d=function(...f){for(const u of f){const{href:h}=new URL(u,n);l.dependencies.add(h)}};const p={tracing:{enabled:!1,root:Ve,current:Ve},route:new Proxy(a,{get:(f,u)=>(o&&(l.route=!0),f[u])}),params:new Proxy(r,{get:(f,u)=>(o&&l.params.add(u),f[u])}),data:i?.data??null,url:vt(n,()=>{o&&(l.url=!0)},f=>{o&&l.search_params.add(f)},w.hash),async fetch(f,u){f instanceof Request&&(u={body:f.method==="GET"||f.method==="HEAD"?void 0:await f.blob(),cache:f.cache,credentials:f.credentials,headers:[...f.headers].length>0?f?.headers:void 0,integrity:f.integrity,keepalive:f.keepalive,method:f.method,mode:f.mode,redirect:f.redirect,referrer:f.referrer,referrerPolicy:f.referrerPolicy,signal:f.signal,...u});const{resolved:h,promise:v}=lt(f,u,n);return o&&d(h.href),v},setHeaders:()=>{},depends:d,parent(){return o&&(l.parent=!0),t()},untrack(f){o=!1;try{return f()}finally{o=!0}}};s=await c.universal.load.call(null,p)??null}return{node:c,loader:e,server:i,universal:c.universal?.load?{type:"data",data:s,uses:l}:null,data:s??i?.data??null,slash:c.universal?.trailingSlash??i?.slash}}function lt(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const i=oe?Et(r,a.href,t):kt(r,t);return{resolved:a,promise:i}}function Ht(e,t,n,r,a,i){if(Te)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const s of a.search_params)if(r.has(s))return!0;for(const s of a.params)if(i[s]!==_.params[s])return!0;for(const s of a.dependencies)if(re.some(o=>o(new URL(s))))return!0;return!1}function Ie(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function Wt(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),i=t.searchParams.getAll(r);a.every(s=>i.includes(s))&&i.every(s=>a.includes(s))&&n.delete(r)}return n}function Jt({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:$e(k),constructors:[]}}}async function ct({id:e,invalidating:t,url:n,params:r,route:a,preload:i}){if(L?.id===e)return se.delete(L.token),L.promise;const{errors:s,layouts:o,leaf:l}=a,c=[...o,l];s.forEach(m=>m?.().catch(()=>{})),c.forEach(m=>m?.[1]().catch(()=>{}));const d=_.url?e!==le(_.url):!1,p=_.route?a.id!==_.route.id:!1,f=Wt(_.url,n);let u=!1;const h=c.map(async(m,g)=>{if(!m)return;const E=_.branch[g];return m[1]===E?.loader&&!Ht(u,p,d,f,E.universal?.uses,r)?E:(u=!0,Pe({loader:m[1],url:n,params:r,route:a,parent:async()=>{const I={};for(let O=0;O<g;O+=1)Object.assign(I,(await h[O])?.data);return I},server_data_node:Ie(m[0]?{type:"skip"}:null,m[0]?E?.server:void 0)}))});for(const m of h)m.catch(()=>{});const v=[];for(let m=0;m<c.length;m+=1)if(c[m])try{v.push(await h[m])}catch(g){if(g instanceof Ee)return{type:"redirect",location:g.location};if(se.has(i))return Jt({error:await X(g,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let E=Le(g),S;if(g instanceof ke)S=g.body;else{if(await C.updated.check())return await et(),await Y(n);S=await X(g,{params:r,url:n,route:{id:a.id}})}const I=await Yt(m,v,s);return I?ie({url:n,params:r,branch:v.slice(0,I.idx).concat(I.node),status:E,error:S,route:a}):await ft(n,{id:a.id},S,E)}else v.push(void 0);return ie({url:n,params:r,branch:v,status:200,error:null,route:a,form:t?void 0:null})}async function Yt(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function Oe({status:e,error:t,url:n,route:r}){const a={};let i=null;try{const s=await Pe({loader:_e,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Ie(i)}),o={node:await ne(),loader:ne,universal:null,server:null,data:null};return ie({url:n,params:a,branch:[s,o],status:e,error:t,route:null})}catch(s){if(s instanceof Ee)return Gt(new URL(s.location,location.href),{},0);throw s}}async function zt(e){const t=e.href;if(Z.has(t))return Z.get(t);let n;try{const r=(async()=>{let a=await w.hooks.reroute({url:new URL(e),fetch:async(i,s)=>lt(i,s,e).promise})??e;if(typeof a=="string"){const i=new URL(e);w.hash?i.hash=a:i.pathname=a,a=i}return a})();Z.set(t,r),n=await r}catch{Z.delete(t);return}return n}async function ue(e,t){if(e&&!ce(e,x,w.hash)){const n=await zt(e);if(!n)return;const r=Xt(n);for(const a of Ue){const i=a.exec(r);if(i)return{id:le(e),invalidating:t,route:a,params:_t(i),url:e}}}}function Xt(e){return mt(w.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function le(e){return(w.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function ut({url:e,type:t,intent:n,delta:r,event:a,scroll:i}){let s=!1;const o=Ce(_,n,e,t,i??null);r!==void 0&&(o.navigation.delta=r),a!==void 0&&(o.navigation.event=a);const l={...o.navigation,cancel:()=>{s=!0,o.reject(new Error("navigation cancelled"))}};return z||tt.forEach(c=>c(l)),s?null:o}async function B({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s={},redirect_count:o=0,nav_token:l={},accept:c=Ke,block:d=Ke,event:p}){const f=j;j=l;const u=await ue(t,!1),h=e==="enter"?Ce(_,u,t,e):ut({url:t,type:e,delta:n?.delta,intent:u,scroll:n?.scroll,event:p});if(!h){d(),j===l&&(j=f);return}const v=y,m=R;c(),z=!0,oe&&h.navigation.type!=="enter"&&C.navigating.set(W.current=h.navigation);let g=u&&await ct(u);if(!g){if(ce(t,x,w.hash))return await Y(t,i);g=await ft(t,{id:null},await X(new Se(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i)}if(t=u?.url||t,j!==l)return h.reject(new Error("navigation aborted")),!1;if(g.type==="redirect"){if(o<20){await B({type:e,url:new URL(g.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s,redirect_count:o+1,nav_token:l}),h.fulfil(void 0);return}g=await Oe({status:500,error:await X(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else g.props.page.status>=400&&await C.updated.check()&&(await et(),await Y(t,i));if(Ft(),Ae(v),ot(m),g.props.page.url.pathname!==t.pathname&&(t.pathname=g.props.page.url.pathname),s=n?n.state:s,!n){const b=i?0:1,Q={[K]:y+=b,[H]:R+=b,[Je]:s};(i?history.replaceState:history.pushState).call(history,Q,"",t),i||Kt(y,R)}const E=u&&L?.id===u.id?L.fork:null;L=null,g.props.page.state=s;let S;if(oe){const b=(await Promise.all(Array.from(Bt,q=>q(h.navigation)))).filter(q=>typeof q=="function");if(b.length>0){let q=function(){b.forEach(fe=>{M.delete(fe)})};b.push(q),b.forEach(fe=>{M.add(fe)})}_=g.state,g.props.page&&(g.props.page.url=t);const Q=E&&await E;Q?S=Q.commit():(at.$set(g.props),Dt(g.props.page),S=pt?.()),rt=!0}else await it(g,ve,!1);const{activeElement:I}=document;await S,await ee(),await ee();let O=null;if(Be){const b=n?n.scroll:a?D():null;b?scrollTo(b.x,b.y):(O=t.hash&&document.getElementById(dt(t)))?O.scrollIntoView():scrollTo(0,0)}const ht=document.activeElement!==I&&document.activeElement!==document.body;!r&&!ht&&rn(t,!O),Be=!0,g.props.page&&Object.assign(k,g.props.page),z=!1,e==="popstate"&&st(R),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=D()),M.forEach(b=>b(h.navigation)),C.navigating.set(W.current=null)}async function ft(e,t,n,r,a){return e.origin===xe&&e.pathname===location.pathname&&!nt?await Oe({status:r,error:n,url:e,route:t}):await Y(e,a)}function Qt(){let e,t={element:void 0,href:void 0},n;P.addEventListener("mousemove",o=>{const l=o.target;clearTimeout(e),e=setTimeout(()=>{i(l,N.hover)},20)});function r(o){o.defaultPrevented||i(o.composedPath()[0],N.tap)}P.addEventListener("mousedown",r),P.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const l of o)l.isIntersecting&&(ge(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function i(o,l){const c=Xe(o,P),d=c===t.element&&c?.href===t.href&&l>=n;if(!c||d)return;const{url:p,external:f,download:u}=me(c,x,w.hash);if(f||u)return;const h=te(c),v=p&&le(_.url)===le(p);if(!(h.reload||v))if(l<=h.preload_data){t={element:c,href:c.href},n=N.tap;const m=await ue(p,!1);if(!m)return;Mt(m)}else l<=h.preload_code&&(t={element:c,href:c.href},n=l,ge(p))}function s(){a.disconnect();for(const o of P.querySelectorAll("a")){const{url:l,external:c,download:d}=me(o,x,w.hash);if(c||d)continue;const p=te(o);p.reload||(p.preload_code===N.viewport&&a.observe(o),p.preload_code===N.eager&&ge(l))}}M.add(s),s()}function X(e,t){if(e instanceof ke)return e.body;const n=Le(e),r=Nt(e);return w.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Zt(e){if(typeof e=="function")re.push(e);else{const{href:t}=new URL(e,location.href);re.push(n=>n.href===t)}}function en(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(Ge(),!z){const r=Ce(_,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};tt.forEach(i=>i(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ge()}),navigator.connection?.saveData||Qt(),P.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=Xe(t.composedPath()[0],P);if(!n)return;const{url:r,external:a,target:i,download:s}=me(n,x,w.hash);if(!r)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const o=te(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||s)return;const[c,d]=(w.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=c===de(location);if(a||o.reload&&(!p||!d)){ut({url:r,type:"link",event:t})?z=!0:t.preventDefault();return}if(d!==void 0&&p){const[,f]=_.url.href.split("#");if(f===d){if(t.preventDefault(),d===""||d==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const u=n.ownerDocument.getElementById(decodeURIComponent(d));u&&(u.scrollIntoView(),u.focus())}return}if(F=!0,Ae(y),e(r),!o.replace_state)return;F=!1}t.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await B({type:"link",url:r,keepfocus:o.keepfocus,noscroll:o.noscroll,replace_state:o.replace_state??r.href===location.href,event:t})}),P.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const s=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(ce(s,x,!1))return;const o=t.target,l=te(o);if(l.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(o,r);s.search=new URLSearchParams(c).toString(),B({type:"form",url:s,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??s.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!ye){if(t.state?.[K]){const n=t.state[K];if(j={},n===y)return;const r=$[n],a=t.state[Je]??{},i=new URL(t.state[It]??location.href),s=t.state[H],o=_.url?de(location)===de(_.url):!1;if(s===R&&(rt||o)){a!==k.state&&(k.state=a),e(i),$[y]=D(),r&&scrollTo(r.x,r.y),y=n;return}const c=n-y;await B({type:"popstate",url:i,popped:{state:a,scroll:r,delta:c},accept:()=>{y=n,R=s},block:()=>{history.go(-c)},nav_token:j,event:t})}else if(!F){const n=new URL(location.href);e(n),w.hash&&location.reload()}}}),addEventListener("hashchange",()=>{F&&(F=!1,history.replaceState({...history.state,[K]:++y,[H]:R},"",location.href))});for(const t of document.querySelectorAll("link"))Vt.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&C.navigating.set(W.current=null)});function e(t){_.url=k.url=t,C.page.set($e(k)),C.page.notify()}}async function tn(e,{status:t=200,error:n,node_ids:r,params:a,route:i,server_route:s,data:o,form:l}){nt=!0;const c=new URL(location.href);let d;({params:a={},route:i={id:null}}=await ue(c,!1)||{}),d=Ue.find(({id:u})=>u===i.id);let p,f=!0;try{const u=r.map(async(v,m)=>{const g=o[m];return g?.uses&&(g.uses=nn(g.uses)),Pe({loader:w.nodes[v],url:c,params:a,route:i,parent:async()=>{const E={};for(let S=0;S<m;S+=1)Object.assign(E,(await u[S]).data);return E},server_data_node:Ie(g)})}),h=await Promise.all(u);if(d){const v=d.layouts;for(let m=0;m<v.length;m++)v[m]||h.splice(m,0,void 0)}p=ie({url:c,params:a,branch:h,status:t,error:n,form:l,route:d??null})}catch(u){if(u instanceof Ee){await Y(new URL(u.location,location.href));return}p=await Oe({status:Le(u),error:await X(u,{url:c,params:a,route:i}),url:c,route:i}),e.textContent="",f=!1}p.props.page&&(p.props.page.state={}),await it(p,e,f)}function nn(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let ye=!1;function rn(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=dt(e);if(r&&document.getElementById(r)){const{x:i,y:s}=D();setTimeout(()=>{const o=history.state;ye=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(o,"",e),t&&scrollTo(i,s),ye=!1})}else{const i=document.body,s=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),s!==null?i.setAttribute("tabindex",s):i.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const i=[];for(let s=0;s<a.rangeCount;s+=1)i.push(a.getRangeAt(s));setTimeout(()=>{if(a.rangeCount===i.length){for(let s=0;s<a.rangeCount;s+=1){const o=i[s],l=a.getRangeAt(s);if(o.commonAncestorContainer!==l.commonAncestorContainer||o.startContainer!==l.startContainer||o.endContainer!==l.endContainer||o.startOffset!==l.startOffset||o.endOffset!==l.endOffset)return}a.removeAllRanges()}})}}}function Ce(e,t,n,r,a=null){let i,s;const o=new Promise((c,d)=>{i=c,s=d});return o.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:D()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:a},willUnload:!t,type:r,complete:o},fulfil:i,reject:s}}function $e(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function an(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function dt(e){let t;if(w.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{fn as a,sn as l,k as p,C as s};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BMbfWswK.js","../chunks/DD0ItAbu.js","../assets/vendor-ui.BHIBfuhK.css","../assets/0.CcgsnGth.css","../nodes/1.ZwCpOLEt.js","../chunks/R1uOjb-r.js","../nodes/2.BWuBOpmL.js","../chunks/Bfbjz8Rd.js","../chunks/Bdj9FDJv.js","../chunks/PPVm8Dsz.js","../assets/2.DxI1SNVc.css"])))=>i.map(i=>d[i]);
2
- import{_ as v}from"../chunks/PPVm8Dsz.js";import{p as M,F as g,a7 as Q,Q as B,o as H,l as i,k as h,R as J,f as l,w as b,j as N,b as d,d as S,g as p,c as E,G as P,K as O,i as U,v as W,D as A,z as x,t as X,q as Y,u as Z,a8 as $}from"../chunks/DD0ItAbu.js";const it={};var tt=A('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),et=A("<!> <!>",1);function at(a,t){M(t,!0);let r=g(t,"components",23,()=>[]),_=g(t,"data_0",3,null),y=g(t,"data_1",3,null);Q(()=>t.stores.page.set(t.page)),B(()=>{t.stores,t.page,t.constructors,r(),t.form,_(),y(),t.stores.page.notify()});let f=p(!1),j=p(!1),w=p(null);H(()=>{const e=t.stores.page.subscribe(()=>{i(f)&&(h(j,!0),J().then(()=>{h(w,document.title||"untitled page",!0)}))});return h(f,!0),e});const L=x(()=>t.constructors[1]);var R=et(),k=l(R);{var T=e=>{const s=x(()=>t.constructors[0]);var o=E(),m=l(o);P(m,()=>i(s),(n,c)=>{O(c(n,{get data(){return _()},get form(){return t.form},get params(){return t.page.params},children:(u,st)=>{var D=E(),z=l(D);P(z,()=>i(L),(F,G)=>{O(G(F,{get data(){return y()},get form(){return t.form},get params(){return t.page.params}}),K=>r()[1]=K,()=>r()?.[1])}),d(u,D)},$$slots:{default:!0}}),u=>r()[0]=u,()=>r()?.[0])}),d(e,o)},V=e=>{const s=x(()=>t.constructors[0]);var o=E(),m=l(o);P(m,()=>i(s),(n,c)=>{O(c(n,{get data(){return _()},get form(){return t.form},get params(){return t.page.params}}),u=>r()[0]=u,()=>r()?.[0])}),d(e,o)};b(k,e=>{t.constructors[1]?e(T):e(V,!1)})}var C=N(k,2);{var q=e=>{var s=tt(),o=U(s);{var m=n=>{var c=X();Y(()=>Z(c,i(w))),d(n,c)};b(o,n=>{i(j)&&n(m)})}W(s),d(e,s)};b(C,e=>{i(f)&&e(q)})}d(a,R),S()}const ct=$(at),dt=[()=>v(()=>import("../nodes/0.BMbfWswK.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),()=>v(()=>import("../nodes/1.ZwCpOLEt.js"),__vite__mapDeps([4,1,2,5]),import.meta.url),()=>v(()=>import("../nodes/2.BWuBOpmL.js"),__vite__mapDeps([6,7,8,9,1,2,10]),import.meta.url)],mt=[],ut={"/":[2]},I={handleError:(({error:a})=>{console.error(a)}),reroute:(()=>{}),transport:{}},rt=Object.fromEntries(Object.entries(I.transport).map(([a,t])=>[a,t.decode])),lt=Object.fromEntries(Object.entries(I.transport).map(([a,t])=>[a,t.encode])),_t=!1,ft=(a,t)=>rt[a](t);export{ft as decode,rt as decoders,ut as dictionary,lt as encoders,_t as hash,I as hooks,it as matchers,dt as nodes,ct as root,mt as server_loads};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BMbfWswK.js","../chunks/DD0ItAbu.js","../assets/vendor-ui.BHIBfuhK.css","../assets/0.CcgsnGth.css","../nodes/1.Dy1qzBVU.js","../chunks/BfFzQf6D.js","../nodes/2.BWuBOpmL.js","../chunks/Bfbjz8Rd.js","../chunks/Bdj9FDJv.js","../chunks/PPVm8Dsz.js","../assets/2.DxI1SNVc.css"])))=>i.map(i=>d[i]);
2
+ import{_ as v}from"../chunks/PPVm8Dsz.js";import{p as M,F as g,a7 as Q,Q as B,o as H,l as i,k as h,R as J,f as l,w as b,j as N,b as d,d as S,g as p,c as E,G as P,K as O,i as U,v as W,D as A,z as x,t as X,q as Y,u as Z,a8 as $}from"../chunks/DD0ItAbu.js";const it={};var tt=A('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),et=A("<!> <!>",1);function at(a,t){M(t,!0);let r=g(t,"components",23,()=>[]),_=g(t,"data_0",3,null),y=g(t,"data_1",3,null);Q(()=>t.stores.page.set(t.page)),B(()=>{t.stores,t.page,t.constructors,r(),t.form,_(),y(),t.stores.page.notify()});let f=p(!1),j=p(!1),w=p(null);H(()=>{const e=t.stores.page.subscribe(()=>{i(f)&&(h(j,!0),J().then(()=>{h(w,document.title||"untitled page",!0)}))});return h(f,!0),e});const L=x(()=>t.constructors[1]);var R=et(),k=l(R);{var T=e=>{const s=x(()=>t.constructors[0]);var o=E(),m=l(o);P(m,()=>i(s),(n,c)=>{O(c(n,{get data(){return _()},get form(){return t.form},get params(){return t.page.params},children:(u,st)=>{var D=E(),z=l(D);P(z,()=>i(L),(F,G)=>{O(G(F,{get data(){return y()},get form(){return t.form},get params(){return t.page.params}}),K=>r()[1]=K,()=>r()?.[1])}),d(u,D)},$$slots:{default:!0}}),u=>r()[0]=u,()=>r()?.[0])}),d(e,o)},V=e=>{const s=x(()=>t.constructors[0]);var o=E(),m=l(o);P(m,()=>i(s),(n,c)=>{O(c(n,{get data(){return _()},get form(){return t.form},get params(){return t.page.params}}),u=>r()[0]=u,()=>r()?.[0])}),d(e,o)};b(k,e=>{t.constructors[1]?e(T):e(V,!1)})}var C=N(k,2);{var q=e=>{var s=tt(),o=U(s);{var m=n=>{var c=X();Y(()=>Z(c,i(w))),d(n,c)};b(o,n=>{i(j)&&n(m)})}W(s),d(e,s)};b(C,e=>{i(f)&&e(q)})}d(a,R),S()}const ct=$(at),dt=[()=>v(()=>import("../nodes/0.BMbfWswK.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),()=>v(()=>import("../nodes/1.Dy1qzBVU.js"),__vite__mapDeps([4,1,2,5]),import.meta.url),()=>v(()=>import("../nodes/2.BWuBOpmL.js"),__vite__mapDeps([6,7,8,9,1,2,10]),import.meta.url)],mt=[],ut={"/":[2]},I={handleError:(({error:a})=>{console.error(a)}),reroute:(()=>{}),transport:{}},rt=Object.fromEntries(Object.entries(I.transport).map(([a,t])=>[a,t.decode])),lt=Object.fromEntries(Object.entries(I.transport).map(([a,t])=>[a,t.encode])),_t=!1,ft=(a,t)=>rt[a](t);export{ft as decode,rt as decoders,ut as dictionary,lt as encoders,_t as hash,I as hooks,it as matchers,dt as nodes,ct as root,mt as server_loads};
@@ -0,0 +1 @@
1
+ import{l as o,a as r}from"../chunks/BfFzQf6D.js";export{o as load_css,r as start};
@@ -1 +1 @@
1
- import{p as m,Z as h,f as g,q as v,b as d,d as l,D as _,i as s,v as a,j as x,u as o}from"../chunks/DD0ItAbu.js";import{s as $,p}from"../chunks/R1uOjb-r.js";const b={get error(){return p.error},get status(){return p.status}};$.updated.check;const n=b;var k=_("<h1> </h1> <p> </p>",1);function D(c,i){m(i,!1),h();var r=k(),t=g(r),u=s(t,!0);a(t);var e=x(t,2),f=s(e,!0);a(e),v(()=>{o(u,n.status),o(f,n.error?.message)}),d(c,r),l()}export{D as component};
1
+ import{p as m,Z as h,f as g,q as v,b as d,d as l,D as _,i as s,v as a,j as x,u as o}from"../chunks/DD0ItAbu.js";import{s as $,p}from"../chunks/BfFzQf6D.js";const b={get error(){return p.error},get status(){return p.status}};$.updated.check;const n=b;var k=_("<h1> </h1> <p> </p>",1);function D(c,i){m(i,!1),h();var r=k(),t=g(r),u=s(t,!0);a(t);var e=x(t,2),f=s(e,!0);a(e),v(()=>{o(u,n.status),o(f,n.error?.message)}),d(c,r),l()}export{D as component};
@@ -1 +1 @@
1
- {"version":"1773176091882"}
1
+ {"version":"1773191761227"}
@@ -17,10 +17,10 @@
17
17
  document.documentElement.dataset.theme = t;
18
18
  })();
19
19
  </script>
20
- <link href="/_app/immutable/entry/start._kgbW0sW.js" rel="modulepreload">
21
- <link href="/_app/immutable/chunks/R1uOjb-r.js" rel="modulepreload">
20
+ <link href="/_app/immutable/entry/start.Bku30e8k.js" rel="modulepreload">
21
+ <link href="/_app/immutable/chunks/BfFzQf6D.js" rel="modulepreload">
22
22
  <link href="/_app/immutable/chunks/DD0ItAbu.js" rel="modulepreload">
23
- <link href="/_app/immutable/entry/app.g14rtWz9.js" rel="modulepreload">
23
+ <link href="/_app/immutable/entry/app.B0GBdMla.js" rel="modulepreload">
24
24
  <link href="/_app/immutable/chunks/PPVm8Dsz.js" rel="modulepreload">
25
25
 
26
26
  <link href="/_app/immutable/assets/vendor-ui.BHIBfuhK.css" rel="stylesheet">
@@ -29,15 +29,15 @@
29
29
  <div style="display: contents">
30
30
  <script>
31
31
  {
32
- __sveltekit_1c7g34t = {
32
+ __sveltekit_4mvmnt = {
33
33
  base: ""
34
34
  };
35
35
 
36
36
  const element = document.currentScript.parentElement;
37
37
 
38
38
  Promise.all([
39
- import("/_app/immutable/entry/start._kgbW0sW.js"),
40
- import("/_app/immutable/entry/app.g14rtWz9.js")
39
+ import("/_app/immutable/entry/start.Bku30e8k.js"),
40
+ import("/_app/immutable/entry/app.B0GBdMla.js")
41
41
  ]).then(([kit, app]) => {
42
42
  kit.start(app, element);
43
43
  });
package/dist/cli.js CHANGED
@@ -1589,6 +1589,7 @@ __export(exports_dist, {
1589
1589
  search: () => search,
1590
1590
  runMigrations: () => runMigrations,
1591
1591
  resolvePrimaryPackageManager: () => resolvePrimaryPackageManager,
1592
+ resolveGlobalPackagePath: () => resolveGlobalPackagePath,
1592
1593
  parseSoul: () => parseSoul,
1593
1594
  parseSimpleYaml: () => parseSimpleYaml,
1594
1595
  parsePackageManagerUserAgent: () => parsePackageManagerUserAgent,
@@ -1702,6 +1703,7 @@ import { existsSync as existsSync7, readFileSync as readFileSync52, readdirSync
1702
1703
  import { join as join82 } from "node:path";
1703
1704
  import { existsSync as existsSync82, readFileSync as readFileSync62 } from "node:fs";
1704
1705
  import { spawnSync } from "node:child_process";
1706
+ import { homedir as homedir32 } from "node:os";
1705
1707
  import { join as join92 } from "node:path";
1706
1708
  import { existsSync as existsSync14, statSync as statSync9, readdirSync as readdirSync9 } from "fs";
1707
1709
  import { join as join14, extname as extname3, resolve as resolve2, basename as basename7 } from "path";
@@ -5115,6 +5117,71 @@ function getSkillsRunnerCommand(family, skillsArgs) {
5115
5117
  };
5116
5118
  }
5117
5119
  }
5120
+ function resolveGlobalPackagePath(family, packageName) {
5121
+ try {
5122
+ switch (family) {
5123
+ case "bun": {
5124
+ const bunGlobal = join92(process.env.BUN_INSTALL ?? join92(homedir32(), ".bun"), "install", "global", "node_modules", packageName);
5125
+ if (existsSync82(bunGlobal))
5126
+ return bunGlobal;
5127
+ return;
5128
+ }
5129
+ case "npm": {
5130
+ const result = spawnSync("npm", ["root", "-g"], {
5131
+ encoding: "utf-8",
5132
+ timeout: 1e4,
5133
+ windowsHide: true
5134
+ });
5135
+ if (result.status === 0 && result.stdout.trim()) {
5136
+ const candidate = join92(result.stdout.trim(), packageName);
5137
+ if (existsSync82(candidate))
5138
+ return candidate;
5139
+ }
5140
+ return;
5141
+ }
5142
+ case "pnpm": {
5143
+ const result = spawnSync("pnpm", ["root", "-g"], {
5144
+ encoding: "utf-8",
5145
+ timeout: 1e4,
5146
+ windowsHide: true
5147
+ });
5148
+ if (result.status === 0 && result.stdout.trim()) {
5149
+ const candidate = join92(result.stdout.trim(), packageName);
5150
+ if (existsSync82(candidate))
5151
+ return candidate;
5152
+ }
5153
+ return;
5154
+ }
5155
+ case "yarn": {
5156
+ const versionResult = spawnSync("yarn", ["--version"], {
5157
+ encoding: "utf-8",
5158
+ timeout: 5000,
5159
+ windowsHide: true
5160
+ });
5161
+ const isClassic = versionResult.status === 0 && /^1\./.test(versionResult.stdout.trim());
5162
+ if (isClassic) {
5163
+ const result = spawnSync("yarn", ["global", "dir"], {
5164
+ encoding: "utf-8",
5165
+ timeout: 1e4,
5166
+ windowsHide: true
5167
+ });
5168
+ if (result.status === 0 && result.stdout.trim()) {
5169
+ const candidate = join92(result.stdout.trim(), "node_modules", packageName);
5170
+ if (existsSync82(candidate))
5171
+ return candidate;
5172
+ }
5173
+ } else {
5174
+ const berryGlobal = join92(process.env.YARN_GLOBAL_FOLDER ?? join92(homedir32(), ".yarn", "berry", "global"), "node_modules", packageName);
5175
+ if (existsSync82(berryGlobal))
5176
+ return berryGlobal;
5177
+ }
5178
+ return;
5179
+ }
5180
+ }
5181
+ } catch {
5182
+ return;
5183
+ }
5184
+ }
5118
5185
  function getGlobalInstallCommand(family, packageName) {
5119
5186
  switch (family) {
5120
5187
  case "bun":
@@ -19438,8 +19505,10 @@ import {
19438
19505
  mkdirSync as mkdirSync8,
19439
19506
  readFileSync as readFileSync14,
19440
19507
  readdirSync as readdirSync10,
19508
+ readlinkSync,
19441
19509
  rmSync as rmSync4,
19442
19510
  statSync as statSync5,
19511
+ symlinkSync as symlinkSync6,
19443
19512
  writeFileSync as writeFileSync6
19444
19513
  } from "fs";
19445
19514
  import { homedir as homedir8, platform as platform3 } from "os";
@@ -49981,7 +50050,7 @@ class OpenClawConnector extends BaseConnector3 {
49981
50050
  const warnings = [];
49982
50051
  const configureHooks = options.configureHooks ?? true;
49983
50052
  const configureWorkspace = options.configureWorkspace ?? true;
49984
- const runtimePath = options.runtimePath ?? "legacy";
50053
+ const runtimePath = options.runtimePath ?? "plugin";
49985
50054
  const patch = {};
49986
50055
  if (configureWorkspace) {
49987
50056
  this.validateWorkspacePath(basePath);
@@ -50343,6 +50412,53 @@ class OpenClawConnector extends BaseConnector3 {
50343
50412
  deepMerge2(config, patch);
50344
50413
  writeFileSync3(configPath, JSON.stringify(config, null, indent));
50345
50414
  }
50415
+ patchLoadPaths(searchPath) {
50416
+ const patched = [];
50417
+ const warnings = [];
50418
+ for (const configPath of this.getDiscoveredConfigPaths()) {
50419
+ try {
50420
+ const raw = readFileSync23(configPath, "utf-8");
50421
+ const config = parseJsonOrJson5(raw);
50422
+ const indent = this.detectIndent(raw);
50423
+ if (Array.isArray(config.plugins)) {
50424
+ const warning = `[signet/openclaw] Skipped load.paths patch for ${configPath}: plugins is in legacy array format; run install() first`;
50425
+ warnings.push(warning);
50426
+ console.warn(warning);
50427
+ continue;
50428
+ }
50429
+ const pluginsObj = isJsonObject(config.plugins) ? config.plugins : {};
50430
+ const rawLoad = pluginsObj.load;
50431
+ if (Array.isArray(rawLoad)) {
50432
+ const warning = `[signet/openclaw] Skipped load.paths patch for ${configPath}: plugins.load is array-shaped; run install() first`;
50433
+ warnings.push(warning);
50434
+ console.warn(warning);
50435
+ continue;
50436
+ }
50437
+ if (rawLoad !== undefined && !isJsonObject(rawLoad)) {
50438
+ const warning = `[signet/openclaw] Skipped load.paths patch for ${configPath}: plugins.load has unexpected type (${typeof rawLoad}); cannot safely merge`;
50439
+ warnings.push(warning);
50440
+ console.warn(warning);
50441
+ continue;
50442
+ }
50443
+ const loadObj = isJsonObject(rawLoad) ? rawLoad : {};
50444
+ const rawPaths = loadObj.paths;
50445
+ const existingPaths = Array.isArray(rawPaths) ? rawPaths.filter((entry) => typeof entry === "string") : [];
50446
+ if (!existingPaths.includes(searchPath)) {
50447
+ loadObj.paths = [...existingPaths, searchPath];
50448
+ pluginsObj.load = loadObj;
50449
+ config.plugins = pluginsObj;
50450
+ writeFileSync3(configPath, JSON.stringify(config, null, indent));
50451
+ patched.push(configPath);
50452
+ }
50453
+ } catch (e) {
50454
+ const message = e instanceof Error ? e.message : String(e);
50455
+ const warning = `[signet/openclaw] Skipped load.paths patch for ${configPath}: ${message}`;
50456
+ warnings.push(warning);
50457
+ console.warn(warning);
50458
+ }
50459
+ }
50460
+ return { patched, warnings };
50461
+ }
50346
50462
  installHookFiles(basePath) {
50347
50463
  const hookDir = join43(basePath, "hooks", "agent-memory");
50348
50464
  mkdirSync5(hookDir, { recursive: true });
@@ -70784,7 +70900,15 @@ async function configureHarnessHooks(harness, basePath, options) {
70784
70900
  runtimePath
70785
70901
  });
70786
70902
  if (runtimePath === "plugin") {
70787
- await ensureOpenClawPluginPackage(basePath);
70903
+ const globalPkgPath = await ensureOpenClawPluginPackage(basePath);
70904
+ if (globalPkgPath) {
70905
+ const { patched: lPathPatched, warnings: lPathWarnings } = connector.patchLoadPaths(dirname6(globalPkgPath));
70906
+ if (lPathPatched.length > 0) {
70907
+ console.log(source_default.green(` ✓ OpenClaw config updated with plugins.load.paths (${lPathPatched.length} file(s))`));
70908
+ } else if (lPathWarnings.length === 0) {
70909
+ console.log(source_default.dim(" (no OpenClaw configs found to patch with load.paths; run 'signet setup' again after first OpenClaw launch)"));
70910
+ }
70911
+ }
70788
70912
  }
70789
70913
  break;
70790
70914
  }
@@ -70854,15 +70978,22 @@ function writeOpenClawPluginSyncVersion(basePath, version) {
70854
70978
  async function ensureOpenClawPluginPackage(basePath, options = {}) {
70855
70979
  const connector = new OpenClawConnector;
70856
70980
  if (connector.getConfiguredRuntimePath() !== "plugin") {
70857
- return false;
70858
- }
70859
- if (!options.force && readOpenClawPluginSyncVersion(basePath) === VERSION) {
70860
- return true;
70981
+ return;
70861
70982
  }
70862
70983
  const packageManager = resolvePrimaryPackageManager({
70863
70984
  agentsDir: basePath,
70864
70985
  env: process.env
70865
70986
  });
70987
+ if (!options.force && readOpenClawPluginSyncVersion(basePath) === VERSION) {
70988
+ const cachedPath = resolveGlobalPackagePath(packageManager.family, OPENCLAW_PLUGIN_PACKAGE);
70989
+ if (cachedPath) {
70990
+ ensureOpenClawExtensionSymlink(cachedPath, options.silent);
70991
+ return cachedPath;
70992
+ }
70993
+ if (!options.silent) {
70994
+ console.log(source_default.yellow(` Warning: cached ${OPENCLAW_PLUGIN_PACKAGE} not found on disk; retrying install.`));
70995
+ }
70996
+ }
70866
70997
  const installCommand = getGlobalInstallCommand(packageManager.family, `${OPENCLAW_PLUGIN_PACKAGE}@${VERSION}`);
70867
70998
  const result = spawnSync2(installCommand.command, installCommand.args, {
70868
70999
  stdio: options.silent ? "pipe" : "inherit",
@@ -70874,13 +71005,88 @@ async function ensureOpenClawPluginPackage(basePath, options = {}) {
70874
71005
  if (!options.silent) {
70875
71006
  console.log(source_default.yellow(` Warning: failed to refresh ${OPENCLAW_PLUGIN_PACKAGE}@${VERSION}`));
70876
71007
  }
70877
- return false;
71008
+ return;
70878
71009
  }
70879
71010
  writeOpenClawPluginSyncVersion(basePath, VERSION);
70880
71011
  if (!options.silent) {
70881
71012
  console.log(source_default.green(` ✓ OpenClaw plugin refreshed (${OPENCLAW_PLUGIN_PACKAGE}@${VERSION})`));
70882
71013
  }
70883
- return true;
71014
+ const globalPath = resolveGlobalPackagePath(packageManager.family, OPENCLAW_PLUGIN_PACKAGE);
71015
+ if (globalPath) {
71016
+ ensureOpenClawExtensionSymlink(globalPath, options.silent);
71017
+ } else if (!options.silent) {
71018
+ console.log(source_default.yellow(` Warning: could not resolve global path for ${OPENCLAW_PLUGIN_PACKAGE} after install; plugin discovery may be incomplete. Run 'signet setup' again if needed.`));
71019
+ }
71020
+ return globalPath;
71021
+ }
71022
+ function ensureOpenClawExtensionSymlink(globalPath, silent) {
71023
+ const stateDirCandidates = [];
71024
+ if (process.env.OPENCLAW_STATE_DIR) {
71025
+ stateDirCandidates.push(normalizeAgentPath(process.env.OPENCLAW_STATE_DIR));
71026
+ }
71027
+ if (process.env.CLAWDBOT_STATE_DIR) {
71028
+ stateDirCandidates.push(normalizeAgentPath(process.env.CLAWDBOT_STATE_DIR));
71029
+ }
71030
+ if (process.env.OPENCLAW_STATE_HOME) {
71031
+ stateDirCandidates.push(normalizeAgentPath(process.env.OPENCLAW_STATE_HOME));
71032
+ }
71033
+ const home6 = homedir8();
71034
+ for (const name of [".openclaw", ".clawdbot", ".moldbot", ".moltbot"]) {
71035
+ const candidate = join15(home6, name);
71036
+ if (existsSync10(candidate)) {
71037
+ stateDirCandidates.push(candidate);
71038
+ }
71039
+ }
71040
+ if (stateDirCandidates.length === 0) {
71041
+ stateDirCandidates.push(join15(home6, ".openclaw"));
71042
+ }
71043
+ for (const stateDir of [...new Set(stateDirCandidates)]) {
71044
+ createExtensionSymlink(stateDir, globalPath, silent);
71045
+ }
71046
+ }
71047
+ function createExtensionSymlink(stateDir, globalPath, silent) {
71048
+ const extensionsDir = join15(stateDir, "extensions");
71049
+ const symlinkPath = join15(extensionsDir, "signet-memory-openclaw");
71050
+ try {
71051
+ mkdirSync8(extensionsDir, { recursive: true });
71052
+ } catch (err) {
71053
+ if (!silent) {
71054
+ console.log(source_default.yellow(` Warning: could not prepare OpenClaw extensions dir at ${extensionsDir}: ${err}`));
71055
+ }
71056
+ return;
71057
+ }
71058
+ try {
71059
+ const stat = lstatSync6(symlinkPath);
71060
+ if (stat.isSymbolicLink()) {
71061
+ const currentTarget = readlinkSync(symlinkPath);
71062
+ if (currentTarget === globalPath) {
71063
+ return;
71064
+ }
71065
+ try {
71066
+ rmSync4(symlinkPath, { force: true });
71067
+ } catch (rmErr) {
71068
+ if (!silent) {
71069
+ console.log(source_default.yellow(` Warning: could not remove stale symlink at ${symlinkPath}: ${rmErr}`));
71070
+ }
71071
+ return;
71072
+ }
71073
+ } else {
71074
+ if (!silent) {
71075
+ console.log(source_default.yellow(` Warning: existing non-symlink at ${symlinkPath}; leaving it in place. Remove it manually to enable the Signet-managed symlink.`));
71076
+ }
71077
+ return;
71078
+ }
71079
+ } catch {}
71080
+ try {
71081
+ symlinkSync6(globalPath, symlinkPath, "dir");
71082
+ if (!silent) {
71083
+ console.log(source_default.green(" ✓ OpenClaw extension symlink created"));
71084
+ }
71085
+ } catch (err) {
71086
+ if (!silent) {
71087
+ console.log(source_default.yellow(` Warning: could not create extension symlink: ${err}`));
71088
+ }
71089
+ }
70884
71090
  }
70885
71091
  function hasExistingIdentityFiles(detection) {
70886
71092
  const coreFiles = ["AGENTS.md", "SOUL.md", "IDENTITY.md", "USER.md"];
@@ -73242,12 +73448,12 @@ embedding:
73242
73448
  console.log();
73243
73449
  });
73244
73450
  var DAEMON_URL = `http://localhost:${DEFAULT_PORT}`;
73245
- async function secretApiCall(method, path2, body) {
73451
+ async function secretApiCall(method, path2, body, timeoutMs = 5000) {
73246
73452
  const res = await fetch(`${DAEMON_URL}${path2}`, {
73247
73453
  method,
73248
73454
  headers: body ? { "Content-Type": "application/json" } : {},
73249
73455
  body: body ? JSON.stringify(body) : undefined,
73250
- signal: AbortSignal.timeout(5000)
73456
+ signal: AbortSignal.timeout(timeoutMs)
73251
73457
  });
73252
73458
  const data = await res.json();
73253
73459
  return { ok: res.ok, data };
@@ -73333,6 +73539,99 @@ secretCmd.command("delete <name>").description("Delete a secret").action(async (
73333
73539
  process.exit(1);
73334
73540
  }
73335
73541
  });
73542
+ secretCmd.command("get <name>").description("Explain how to use a secret (values are never exposed)").action(async (name) => {
73543
+ if (!await ensureDaemonForSecrets())
73544
+ return;
73545
+ try {
73546
+ const { ok, data } = await secretApiCall("GET", "/api/secrets");
73547
+ if (!ok) {
73548
+ console.error(source_default.red(` Error: ${data.error}`));
73549
+ process.exit(1);
73550
+ }
73551
+ const secrets = data.secrets ?? [];
73552
+ const exists = secrets.includes(name);
73553
+ if (!exists) {
73554
+ console.error(source_default.red(`
73555
+ Secret "${source_default.bold(name)}" not found.
73556
+ `));
73557
+ console.error(source_default.dim(" Store it with:"));
73558
+ console.error(` signet secret put ${name}
73559
+ `);
73560
+ process.exit(1);
73561
+ }
73562
+ console.log(source_default.yellow(`
73563
+ Secret "${source_default.bold(name)}" exists, but values are never exposed directly.`));
73564
+ console.log(source_default.dim(`
73565
+ Signet secrets are injected at runtime, not read from disk.`));
73566
+ console.log(source_default.dim(` Use one of the following:
73567
+ `));
73568
+ console.log(source_default.dim(" In a command (injected as env var):"));
73569
+ console.log(` signet secret exec --secret ${name} "your-command-here"
73570
+ `);
73571
+ console.log(source_default.dim(" In agent.yaml (resolved by the daemon):"));
73572
+ console.log(` api_key: $secret:${name}
73573
+ `);
73574
+ } catch (e) {
73575
+ console.error(source_default.red(` Error: ${e.message}`));
73576
+ process.exit(1);
73577
+ }
73578
+ });
73579
+ secretCmd.command("exec <command...>").description(`Run a command with secrets injected as environment variables
73580
+ ` + ` NOTE: --secret flags must appear before the command token.
73581
+ ` + ` Secrets are available via process.env / os.environ in the subprocess;
73582
+ ` + " shell-level $VAR expansion is intentionally disabled for security.").passThroughOptions().option("-s, --secret <name>", "Secret to inject (repeatable, must precede command)", appendCliString, []).action(async (commandParts, opts) => {
73583
+ if (!await ensureDaemonForSecrets())
73584
+ return;
73585
+ if (opts.secret.length === 0) {
73586
+ console.error(source_default.red(" At least one --secret is required."));
73587
+ console.log(source_default.dim(" NOTE: --secret flags must come before the command token."));
73588
+ console.log(source_default.dim(`
73589
+ Example:`));
73590
+ console.log(` signet secret exec --secret OPENAI_API_KEY curl https://api.openai.com/v1/models
73591
+ `);
73592
+ process.exit(1);
73593
+ }
73594
+ const VALID_ENV_VAR = /^[A-Za-z_][A-Za-z0-9_]*$/;
73595
+ for (const name of opts.secret) {
73596
+ if (!VALID_ENV_VAR.test(name)) {
73597
+ console.error(source_default.red(` Invalid secret name for env injection: "${name}"`));
73598
+ console.log(source_default.dim(" Names must be valid env var identifiers: letters, digits, underscore; no leading digit or hyphens."));
73599
+ process.exitCode = 1;
73600
+ return;
73601
+ }
73602
+ }
73603
+ const secrets = {};
73604
+ for (const name of opts.secret) {
73605
+ secrets[name] = name;
73606
+ }
73607
+ const command = commandParts.map((arg) => `"${arg.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/`/g, "\\`").replace(/\$/g, "\\$")}"`).join(" ");
73608
+ try {
73609
+ const { ok, data } = await secretApiCall("POST", "/api/secrets/exec", {
73610
+ command,
73611
+ secrets
73612
+ }, 60000);
73613
+ if (!ok) {
73614
+ console.error(source_default.red(` Error: ${data.error}`));
73615
+ process.exitCode = 1;
73616
+ return;
73617
+ }
73618
+ const result = data;
73619
+ if (result.stdout)
73620
+ process.stdout.write(result.stdout);
73621
+ if (result.stderr)
73622
+ process.stderr.write(result.stderr);
73623
+ process.exitCode = result.code ?? 1;
73624
+ } catch (e) {
73625
+ if (e instanceof Error && e.name === "TimeoutError") {
73626
+ console.error(source_default.red(" Error: command timed out after 60 seconds."));
73627
+ console.error(source_default.dim(" The subprocess may still be running on the daemon."));
73628
+ console.error(source_default.dim(" Streaming support is planned — see TODO in source."));
73629
+ } else {
73630
+ console.error(source_default.red(` Error: ${e.message}`));
73631
+ }
73632
+ process.exitCode = 1;
73633
+ }
73634
+ });
73336
73635
  secretCmd.command("has <name>").description("Check if a secret exists (exits 0 if found, 1 if not)").action(async (name) => {
73337
73636
  if (!await ensureDaemonForSecrets())
73338
73637
  return;